summaryrefslogtreecommitdiffstats
path: root/kate
diff options
context:
space:
mode:
Diffstat (limited to 'kate')
-rw-r--r--kate/AUTHORS42
-rw-r--r--kate/COPYING.LIB482
-rw-r--r--kate/ChangeLog343
-rw-r--r--kate/Mainpage.dox36
-rw-r--r--kate/Makefile.am11
-rw-r--r--kate/NEWS43
-rw-r--r--kate/README10
-rw-r--r--kate/README.testing241
-rw-r--r--kate/TODO66
-rw-r--r--kate/data/Makefile.am34
-rw-r--r--kate/data/abc.xml88
-rw-r--r--kate/data/actionscript.xml334
-rw-r--r--kate/data/ada.xml194
-rw-r--r--kate/data/ahdl.xml145
-rw-r--r--kate/data/alert.xml53
-rw-r--r--kate/data/ansic89.xml150
-rw-r--r--kate/data/apache.xml630
-rw-r--r--kate/data/asm-avr.xml208
-rw-r--r--kate/data/asm6502.xml120
-rw-r--r--kate/data/asp.xml393
-rw-r--r--kate/data/awk.xml112
-rw-r--r--kate/data/bash.xml829
-rw-r--r--kate/data/bibtex.xml65
-rw-r--r--kate/data/c.xml167
-rw-r--r--kate/data/cg.xml288
-rw-r--r--kate/data/cgis.xml146
-rw-r--r--kate/data/changelog.xml29
-rw-r--r--kate/data/cisco.xml312
-rw-r--r--kate/data/clipper.xml501
-rw-r--r--kate/data/cmake.xml352
-rw-r--r--kate/data/coldfusion.xml732
-rw-r--r--kate/data/commonlisp.xml1173
-rw-r--r--kate/data/component-pascal.xml172
-rw-r--r--kate/data/cpp.xml273
-rw-r--r--kate/data/cs.xml161
-rw-r--r--kate/data/css.xml624
-rw-r--r--kate/data/cue.xml74
-rw-r--r--kate/data/d.xml348
-rw-r--r--kate/data/debianchangelog.xml60
-rw-r--r--kate/data/debiancontrol.xml61
-rw-r--r--kate/data/desktop.xml28
-rw-r--r--kate/data/diff.xml113
-rw-r--r--kate/data/doxygen.xml447
-rw-r--r--kate/data/e.xml258
-rw-r--r--kate/data/eiffel.xml125
-rw-r--r--kate/data/email.xml106
-rw-r--r--kate/data/euphoria.xml376
-rw-r--r--kate/data/ferite.xml117
-rw-r--r--kate/data/fgl-4gl.xml363
-rw-r--r--kate/data/fgl-per.xml172
-rw-r--r--kate/data/fortran.xml569
-rw-r--r--kate/data/fstab.xml96
-rw-r--r--kate/data/gdl.xml313
-rw-r--r--kate/data/generate-php.pl56
-rw-r--r--kate/data/gettext.xml63
-rw-r--r--kate/data/glsl.xml323
-rw-r--r--kate/data/gnuassembler.xml282
-rw-r--r--kate/data/haskell.xml388
-rw-r--r--kate/data/html.xml201
-rw-r--r--kate/data/idconsole.xml2146
-rw-r--r--kate/data/idl.xml116
-rw-r--r--kate/data/ilerpg.xml725
-rw-r--r--kate/data/inform.xml406
-rw-r--r--kate/data/ini.xml80
-rw-r--r--kate/data/java.xml3428
-rw-r--r--kate/data/javadoc.xml107
-rw-r--r--kate/data/javascript.xml501
-rw-r--r--kate/data/jsp.xml3070
-rw-r--r--kate/data/katefiletyperc34
-rw-r--r--kate/data/katepart.desktop90
-rw-r--r--kate/data/katepartreadonlyui.rc98
-rw-r--r--kate/data/katepartui.rc124
-rw-r--r--kate/data/katesyntaxhighlightingrc3
-rw-r--r--kate/data/kbasic.xml97
-rw-r--r--kate/data/language.dtd468
-rw-r--r--kate/data/latex.xml332
-rw-r--r--kate/data/ldif.xml305
-rw-r--r--kate/data/lex.xml144
-rw-r--r--kate/data/lilypond.xml1095
-rw-r--r--kate/data/list-keywords-ldif.awk38
-rw-r--r--kate/data/list-keywords-ldif.sh12
-rw-r--r--kate/data/literate-haskell.xml386
-rw-r--r--kate/data/logtalk.xml206
-rw-r--r--kate/data/lpc.xml166
-rw-r--r--kate/data/lua.xml237
-rw-r--r--kate/data/m3u.xml48
-rw-r--r--kate/data/mab.xml30
-rw-r--r--kate/data/makefile.xml82
-rw-r--r--kate/data/mason.xml203
-rw-r--r--kate/data/matlab.xml222
-rw-r--r--kate/data/mediawiki.xml95
-rw-r--r--kate/data/mips.xml359
-rw-r--r--kate/data/modula-2.xml188
-rw-r--r--kate/data/mup.xml865
-rw-r--r--kate/data/nasm.xml1321
-rw-r--r--kate/data/objectivec.xml128
-rw-r--r--kate/data/ocaml.xml181
-rw-r--r--kate/data/octave.xml2219
-rw-r--r--kate/data/pascal.xml193
-rw-r--r--kate/data/perl.xml827
-rw-r--r--kate/data/php.xml6549
-rw-r--r--kate/data/picsrc.xml402
-rw-r--r--kate/data/pike.xml121
-rw-r--r--kate/data/postscript.xml434
-rw-r--r--kate/data/povray.xml883
-rw-r--r--kate/data/progress.xml1608
-rw-r--r--kate/data/prolog.xml230
-rw-r--r--kate/data/purebasic.xml918
-rw-r--r--kate/data/python.xml233
-rw-r--r--kate/data/r.xml136
-rw-r--r--kate/data/rexx.xml134
-rw-r--r--kate/data/rhtml.xml1235
-rw-r--r--kate/data/rib.xml143
-rw-r--r--kate/data/rpmspec.xml80
-rw-r--r--kate/data/rsiidl.xml440
-rw-r--r--kate/data/ruby.xml908
-rw-r--r--kate/data/sather.xml141
-rw-r--r--kate/data/scheme.xml436
-rw-r--r--kate/data/sci.xml1191
-rw-r--r--kate/data/sgml.xml46
-rw-r--r--kate/data/sieve.xml67
-rw-r--r--kate/data/sml.xml104
-rw-r--r--kate/data/spice.xml50
-rw-r--r--kate/data/sql-mysql.xml476
-rw-r--r--kate/data/sql-postgresql.xml797
-rw-r--r--kate/data/sql.xml951
-rw-r--r--kate/data/stata.xml478
-rw-r--r--kate/data/syntax.template28
-rw-r--r--kate/data/tcl.xml490
-rw-r--r--kate/data/tibasic.xml71
-rw-r--r--kate/data/txt2tags.xml61
-rw-r--r--kate/data/uscript.xml186
-rw-r--r--kate/data/velocity.xml51
-rw-r--r--kate/data/verilog.xml227
-rw-r--r--kate/data/vhdl.xml286
-rw-r--r--kate/data/vrml.xml139
-rw-r--r--kate/data/winehq.xml36
-rw-r--r--kate/data/xharbour.xml543
-rw-r--r--kate/data/xml.xml147
-rw-r--r--kate/data/xmldebug.xml593
-rw-r--r--kate/data/xslt.xml379
-rw-r--r--kate/data/yacas.xml237
-rw-r--r--kate/data/yacc.xml159
-rw-r--r--kate/interfaces/.kateconfig1
-rw-r--r--kate/interfaces/Makefile.am12
-rw-r--r--kate/interfaces/document.h407
-rw-r--r--kate/interfaces/interfaces.cpp127
-rw-r--r--kate/interfaces/katecmd.cpp223
-rw-r--r--kate/interfaces/katecmd.h99
-rw-r--r--kate/interfaces/view.h303
-rw-r--r--kate/part/.kateconfig1
-rw-r--r--kate/part/Makefile.am44
-rw-r--r--kate/part/configure.in.in89
-rw-r--r--kate/part/katearbitraryhighlight.cpp162
-rw-r--r--kate/part/katearbitraryhighlight.h87
-rw-r--r--kate/part/kateattribute.cpp268
-rw-r--r--kate/part/kateattribute.h147
-rw-r--r--kate/part/kateautoindent.cpp2543
-rw-r--r--kate/part/kateautoindent.h581
-rw-r--r--kate/part/katebookmarks.cpp287
-rw-r--r--kate/part/katebookmarks.h86
-rw-r--r--kate/part/katebuffer.cpp1660
-rw-r--r--kate/part/katebuffer.h709
-rw-r--r--kate/part/katecmds.cpp605
-rw-r--r--kate/part/katecmds.h178
-rw-r--r--kate/part/katecodecompletion.cpp566
-rw-r--r--kate/part/katecodecompletion.h164
-rw-r--r--kate/part/katecodefoldinghelpers.cpp1662
-rw-r--r--kate/part/katecodefoldinghelpers.h222
-rw-r--r--kate/part/kateconfig.cpp1429
-rw-r--r--kate/part/kateconfig.h537
-rw-r--r--kate/part/katecursor.cpp192
-rw-r--r--kate/part/katecursor.h250
-rw-r--r--kate/part/katedialogs.cpp1740
-rw-r--r--kate/part/katedialogs.h406
-rw-r--r--kate/part/katedocument.cpp5174
-rw-r--r--kate/part/katedocument.h1073
-rw-r--r--kate/part/katedocumenthelpers.cpp56
-rw-r--r--kate/part/katedocumenthelpers.h71
-rw-r--r--kate/part/katefactory.cpp276
-rw-r--r--kate/part/katefactory.h312
-rw-r--r--kate/part/katefiletype.cpp596
-rw-r--r--kate/part/katefiletype.h142
-rw-r--r--kate/part/katefont.cpp127
-rw-r--r--kate/part/katefont.h114
-rw-r--r--kate/part/katehighlight.cpp3473
-rw-r--r--kate/part/katehighlight.h438
-rw-r--r--kate/part/kateindentscriptabstracts.cpp49
-rw-r--r--kate/part/kateindentscriptabstracts.h99
-rw-r--r--kate/part/katejscript.cpp1169
-rw-r--r--kate/part/katejscript.h233
-rw-r--r--kate/part/katekeyinterceptorfunctor.h25
-rw-r--r--kate/part/katelinerange.cpp75
-rw-r--r--kate/part/katelinerange.h70
-rw-r--r--kate/part/kateluaindentscript.cpp528
-rw-r--r--kate/part/kateluaindentscript.h69
-rw-r--r--kate/part/kateprinter.cpp1005
-rw-r--r--kate/part/kateprinter.h136
-rw-r--r--kate/part/katerenderer.cpp1032
-rw-r--r--kate/part/katerenderer.h272
-rw-r--r--kate/part/kateschema.cpp1611
-rw-r--r--kate/part/kateschema.h323
-rw-r--r--kate/part/katesearch.cpp1012
-rw-r--r--kate/part/katesearch.h243
-rw-r--r--kate/part/katespell.cpp221
-rw-r--r--kate/part/katespell.h86
-rw-r--r--kate/part/katesupercursor.cpp746
-rw-r--r--kate/part/katesupercursor.h463
-rw-r--r--kate/part/katesyntaxdocument.cpp475
-rw-r--r--kate/part/katesyntaxdocument.h164
-rw-r--r--kate/part/katetemplatehandler.cpp342
-rw-r--r--kate/part/katetemplatehandler.h68
-rw-r--r--kate/part/katetextline.cpp443
-rw-r--r--kate/part/katetextline.h456
-rw-r--r--kate/part/kateundo.cpp392
-rw-r--r--kate/part/kateundo.h141
-rw-r--r--kate/part/kateview.cpp1920
-rw-r--r--kate/part/kateview.h571
-rw-r--r--kate/part/kateviewhelpers.cpp1205
-rw-r--r--kate/part/kateviewhelpers.h207
-rw-r--r--kate/part/kateviewinternal.cpp3496
-rw-r--r--kate/part/kateviewinternal.h397
-rw-r--r--kate/part/test_regression.cpp1344
-rw-r--r--kate/part/test_regression.h249
-rw-r--r--kate/plugins/Makefile.am2
-rw-r--r--kate/plugins/autobookmarker/Makefile.am17
-rw-r--r--kate/plugins/autobookmarker/autobookmarker.cpp521
-rw-r--r--kate/plugins/autobookmarker/autobookmarker.h137
-rw-r--r--kate/plugins/autobookmarker/ktexteditor_autobookmarker.desktop135
-rw-r--r--kate/plugins/autobookmarker/ktexteditor_autobookmarkerrc18
-rw-r--r--kate/plugins/insertfile/Makefile.am17
-rw-r--r--kate/plugins/insertfile/insertfileplugin.cpp185
-rw-r--r--kate/plugins/insertfile/insertfileplugin.h70
-rw-r--r--kate/plugins/insertfile/ktexteditor_insertfile.desktop156
-rw-r--r--kate/plugins/insertfile/ktexteditor_insertfileui.rc9
-rw-r--r--kate/plugins/isearch/ISearchPlugin.cpp495
-rw-r--r--kate/plugins/isearch/ISearchPlugin.h114
-rw-r--r--kate/plugins/isearch/Makefile.am18
-rw-r--r--kate/plugins/isearch/ktexteditor_isearch.desktop153
-rw-r--r--kate/plugins/isearch/ktexteditor_isearchui.rc14
-rw-r--r--kate/plugins/kdatatool/Makefile.am19
-rw-r--r--kate/plugins/kdatatool/kate_kdatatool.cpp246
-rw-r--r--kate/plugins/kdatatool/kate_kdatatool.h76
-rw-r--r--kate/plugins/kdatatool/ktexteditor_kdatatool.desktop169
-rw-r--r--kate/plugins/kdatatool/ktexteditor_kdatatoolui.rc8
-rw-r--r--kate/plugins/wordcompletion/Makefile.am17
-rw-r--r--kate/plugins/wordcompletion/docwordcompletion.cpp554
-rw-r--r--kate/plugins/wordcompletion/docwordcompletion.h133
-rw-r--r--kate/plugins/wordcompletion/docwordcompletionui.rc16
-rw-r--r--kate/plugins/wordcompletion/ktexteditor_docwordcompletion.desktop139
-rw-r--r--kate/scripts/Makefile.am5
-rw-r--r--kate/scripts/jstest.desktop119
-rw-r--r--kate/scripts/jstest.js26
-rw-r--r--kate/scripts/script-indent-c-char.js30
-rw-r--r--kate/scripts/script-indent-c-newline.js113
-rw-r--r--kate/scripts/script-indent-c-test.js180
-rw-r--r--kate/scripts/script-indent-c1-test.lua154
-rw-r--r--kate/scripts/sort.js18
-rw-r--r--kate/scripts/test.js16
-rw-r--r--kate/scripts/test_selectioniface.js26
-rw-r--r--kate/tests/ejp1.asm285
-rw-r--r--kate/tests/highlight.abc8
-rw-r--r--kate/tests/highlight.ahdl43
-rw-r--r--kate/tests/highlight.asm-avr75
-rw-r--r--kate/tests/highlight.asm-nasm27
-rw-r--r--kate/tests/highlight.asp58
-rw-r--r--kate/tests/highlight.awk28
-rw-r--r--kate/tests/highlight.bib31
-rw-r--r--kate/tests/highlight.cmake48
-rw-r--r--kate/tests/highlight.css49
-rw-r--r--kate/tests/highlight.do89
-rw-r--r--kate/tests/highlight.dox227
-rw-r--r--kate/tests/highlight.e90
-rw-r--r--kate/tests/highlight.exu97
-rw-r--r--kate/tests/highlight.f90181
-rw-r--r--kate/tests/highlight.glsl62
-rw-r--r--kate/tests/highlight.hs124
-rw-r--r--kate/tests/highlight.jsp170
-rw-r--r--kate/tests/highlight.lex82
-rw-r--r--kate/tests/highlight.lhs124
-rw-r--r--kate/tests/highlight.lisp36
-rw-r--r--kate/tests/highlight.ly114
-rw-r--r--kate/tests/highlight.m61
-rw-r--r--kate/tests/highlight.mup103
-rw-r--r--kate/tests/highlight.pb87
-rw-r--r--kate/tests/highlight.php23
-rw-r--r--kate/tests/highlight.pike24
-rw-r--r--kate/tests/highlight.pl44
-rw-r--r--kate/tests/highlight.pov76
-rw-r--r--kate/tests/highlight.prg71
-rw-r--r--kate/tests/highlight.rb480
-rw-r--r--kate/tests/highlight.rib68
-rw-r--r--kate/tests/highlight.scheme186
-rw-r--r--kate/tests/highlight.sh198
-rw-r--r--kate/tests/highlight.sp32
-rw-r--r--kate/tests/highlight.tcl50
-rw-r--r--kate/tests/highlight.tex73
-rw-r--r--kate/tests/highlight.wrl41
-rw-r--r--kate/tests/highlight.xml67
-rw-r--r--kate/tests/highlight.xsl109
-rw-r--r--kate/tests/highlight.y54
-rw-r--r--kate/tests/highlight_lpc.c64
-rw-r--r--kate/tests/highlight_ocaml.ml105
-rw-r--r--kate/tests/highlight_octave.m74
-rw-r--r--kate/tests/test.js134
-rw-r--r--kate/tests/test.uc266
306 files changed, 116336 insertions, 0 deletions
diff --git a/kate/AUTHORS b/kate/AUTHORS
new file mode 100644
index 000000000..c12c9810f
--- /dev/null
+++ b/kate/AUTHORS
@@ -0,0 +1,42 @@
+ *** Kate Team ***
+- Christoph Cullmann <cullmann@kde.org>
+ (Maintainer)
+
+- Joseph Wenninger <jowenn@kde.org>
+ (highlight guy + big bug hunter)
+
+- Anders Lund <anders@alweb.dk>
+ (bookmarks, iconborder, ...)
+
+- Hamish Rodda <rodda@kde.org>
+ (dynamic wrap, view, optimise, etc)
+
+- Waldo Bastian <bastian@kde.org>
+ (buffer handling)
+
+- Charles Samuels <charles@kde.org>
+ (regular expressions)
+
+- Michael Bartl <michael.bartl1@chello.at>
+ (first one who really helped out :)
+
+- Matt Newell <newellm@proaxis.com>
+
+- Michael McCallum <gholam@xtra.co.nz>
+
+- John Firebaugh <jfirebaugh@kde.org>
+
+- Nadeem Hasan <nhasan@nadmm.com>
+
+ *** KWrite Team ***
+- Jochen Wilhelmy <digisnap@cs.tu-berlin.de>
+ (original author of kwrite in kde 1.x until kde 2.1)
+
+- Glen Parker <glenebob@nwlink.com>
+ (undo history, kspell-integration)
+
+- Michael Koch <koch@kde.org>
+ (port to KParts)
+
+- Dominik Haumann <dhdev@gmx.de>
+ (developer, highlight wizard)
diff --git a/kate/COPYING.LIB b/kate/COPYING.LIB
new file mode 100644
index 000000000..a96b5730d
--- /dev/null
+++ b/kate/COPYING.LIB
@@ -0,0 +1,482 @@
+ GNU LIBRARY GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1991 Free Software Foundation, Inc.
+ 51 Franklin Street, Fifth Floor
+ Boston, MA 02110-1301, USA.
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the library GPL. It is
+ numbered 2 because it goes with version 2 of the ordinary GPL.]
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+ This license, the Library General Public License, applies to some
+specially designated Free Software Foundation software, and to any
+other libraries whose authors decide to use it. You can use it for
+your libraries, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if
+you distribute copies of the library, or if you modify it.
+
+ For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you. You must make sure that they, too, receive or can get the source
+code. If you link a program with the library, you must provide
+complete object files to the recipients so that they can relink them
+with the library, after making changes to the library and recompiling
+it. And you must show them these terms so they know their rights.
+
+ Our method of protecting your rights has two steps: (1) copyright
+the library, and (2) offer you this license which gives you legal
+permission to copy, distribute and/or modify the library.
+
+ Also, for each distributor's protection, we want to make certain
+that everyone understands that there is no warranty for this free
+library. If the library is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original
+version, so that any problems introduced by others will not reflect on
+the original authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that companies distributing free
+software will individually obtain patent licenses, thus in effect
+transforming the program into proprietary software. To prevent this,
+we have made it clear that any patent must be licensed for everyone's
+free use or not licensed at all.
+
+ Most GNU software, including some libraries, is covered by the ordinary
+GNU General Public License, which was designed for utility programs. This
+license, the GNU Library General Public License, applies to certain
+designated libraries. This license is quite different from the ordinary
+one; be sure to read it in full, and don't assume that anything in it is
+the same as in the ordinary license.
+
+ The reason we have a separate public license for some libraries is that
+they blur the distinction we usually make between modifying or adding to a
+program and simply using it. Linking a program with a library, without
+changing the library, is in some sense simply using the library, and is
+analogous to running a utility program or application program. However, in
+a textual and legal sense, the linked executable is a combined work, a
+derivative of the original library, and the ordinary General Public License
+treats it as such.
+
+ Because of this blurred distinction, using the ordinary General
+Public License for libraries did not effectively promote software
+sharing, because most developers did not use the libraries. We
+concluded that weaker conditions might promote sharing better.
+
+ However, unrestricted linking of non-free programs would deprive the
+users of those programs of all benefit from the free status of the
+libraries themselves. This Library General Public License is intended to
+permit developers of non-free programs to use free libraries, while
+preserving your freedom as a user of such programs to change the free
+libraries that are incorporated in them. (We have not seen how to achieve
+this as regards changes in header files, but we have achieved it as regards
+changes in the actual functions of the Library.) The hope is that this
+will lead to faster development of free libraries.
+
+ The precise terms and conditions for copying, distribution and
+modification follow. Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library". The
+former contains code derived from the library, while the latter only
+works together with the library.
+
+ Note that it is possible for a library to be covered by the ordinary
+General Public License rather than by this special one.
+
+ GNU LIBRARY GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License Agreement applies to any software library which
+contains a notice placed by the copyright holder or other authorized
+party saying it may be distributed under the terms of this Library
+General Public License (also called "this License"). Each licensee is
+addressed as "you".
+
+ A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+ The "Library", below, refers to any such software library or work
+which has been distributed under these terms. A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language. (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+ "Source code" for a work means the preferred form of the work for
+making modifications to it. For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+ Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it). Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+
+ 1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+ You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+
+ 2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) The modified work must itself be a software library.
+
+ b) You must cause the files modified to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ c) You must cause the whole of the work to be licensed at no
+ charge to all third parties under the terms of this License.
+
+ d) If a facility in the modified Library refers to a function or a
+ table of data to be supplied by an application program that uses
+ the facility, other than as an argument passed when the facility
+ is invoked, then you must make a good faith effort to ensure that,
+ in the event an application does not supply such function or
+ table, the facility still operates, and performs whatever part of
+ its purpose remains meaningful.
+
+ (For example, a function in a library to compute square roots has
+ a purpose that is entirely well-defined independent of the
+ application. Therefore, Subsection 2d requires that any
+ application-supplied function or table used by this function must
+ be optional: if the application does not supply it, the square
+ root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library. To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License. (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.) Do not make any other change in
+these notices.
+
+ Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+ This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+ 4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+ If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library". Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+ However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library". The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+ When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library. The
+threshold for this to be true is not precisely defined by law.
+
+ If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work. (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+ Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+
+ 6. As an exception to the Sections above, you may also compile or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+ You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License. You must supply a copy of this License. If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License. Also, you must do one
+of these things:
+
+ a) Accompany the work with the complete corresponding
+ machine-readable source code for the Library including whatever
+ changes were used in the work (which must be distributed under
+ Sections 1 and 2 above); and, if the work is an executable linked
+ with the Library, with the complete machine-readable "work that
+ uses the Library", as object code and/or source code, so that the
+ user can modify the Library and then relink to produce a modified
+ executable containing the modified Library. (It is understood
+ that the user who changes the contents of definitions files in the
+ Library will not necessarily be able to recompile the application
+ to use the modified definitions.)
+
+ b) Accompany the work with a written offer, valid for at
+ least three years, to give the same user the materials
+ specified in Subsection 6a, above, for a charge no more
+ than the cost of performing this distribution.
+
+ c) If distribution of the work is made by offering access to copy
+ from a designated place, offer equivalent access to copy the above
+ specified materials from the same place.
+
+ d) Verify that the user has already received a copy of these
+ materials or that you have already sent this user a copy.
+
+ For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it. However, as a special exception,
+the source code distributed need not include anything that is normally
+distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+ It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system. Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+
+ 7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+ a) Accompany the combined library with a copy of the same work
+ based on the Library, uncombined with any other library
+ facilities. This must be distributed under the terms of the
+ Sections above.
+
+ b) Give prominent notice with the combined library of the fact
+ that part of it is a work based on the Library, and explaining
+ where to find the accompanying uncombined form of the same work.
+
+ 8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License. Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License. However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+ 9. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Library or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+ 10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all. For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded. In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+ 13. The Free Software Foundation may publish revised and/or new
+versions of the Library General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation. If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+
+ 14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission. For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this. Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+ NO WARRANTY
+
+ 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Libraries
+
+ If you develop a new library, and you want it to be of the greatest
+possible use to the public, we recommend making it free software that
+everyone can redistribute and change. You can do so by permitting
+redistribution under these terms (or, alternatively, under the terms of the
+ordinary General Public License).
+
+ To apply these terms, attach the following notices to the library. It is
+safest to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least the
+"copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the library's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+Also add information on how to contact you by electronic and paper mail.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the library, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the
+ library `Frob' (a library for tweaking knobs) written by James Random Hacker.
+
+ <signature of Ty Coon>, 1 April 1990
+ Ty Coon, President of Vice
+
+That's all there is to it!
diff --git a/kate/ChangeLog b/kate/ChangeLog
new file mode 100644
index 000000000..21fc54ba5
--- /dev/null
+++ b/kate/ChangeLog
@@ -0,0 +1,343 @@
+2003-12-24 Christoph Cullmann <cullmann@kde.org>
+ * Overview about some fixes done in the last months:
+ - Hamish Rodda:
+ - lots of fixes in the area of the
+ rendering/selection/view department and massive
+ bughunting
+
+ - Anders Lund:
+ - bookmarks/printing enhancements
+
+ - Christoph Cullmann:
+ - bughunting, config classes/dialogs, consolidation of
+ part -><- app interaction
+
+2003-08-28 Christoph Cullmann <cullmann@kde.org>
+ * color schemes support
+ * filetype support
+ * indenters for different languages by jesse
+ * folding by indentation kind of working, not perfect :/
+
+2002-11-05 Christoph Cullmann <cullmann@kde.org>
+ * fix the printing crash + loop together with Anders ;)
+
+2002-09-06 Christoph Cullmann <cullmann@kde.org>
+ * commiting a fix from Nicolai Haehnle <prefect_@gmx.net> for the
+ cursorDown()/cursorUp() behavior
+
+2002-09-03 Christoph Cullmann <cullmann@kde.org>
+ * some minor fixes in the last days (redraw stuff, memset, ...)
+
+2002-08-27 Christoph Cullmann <cullmann@kde.org>
+ * extended the context signed char to a uint ;)
+ * some folding fixes (hopefully)
+ * memleak fix
+ * undo stuff changed a bit, 0 means unlimited like before, show
+ that now in the dialog and add a comment to ktexteditor
+
+2002-08-26 Christoph Cullmann <cullmann@kde.org>
+ * Fixes for folding, cleanup, move folding tree into the buffer,
+ add some inliner's
+ * Fixes for the big memory usage for the attributes in the buffer
+ by using run length encoding for the attributes if they are
+ dumped into the bytearray
+
+2002-06-01 Christian Couder <christian@kdevelop.org>
+ * Move view stuff from katedocument to kateviewinternal.
+
+2002-05-20 Christoph Cullmann <cullmann@kde.org>
+ * some more references in use ;)
+ * fixed some undo probs
+ (mem leak, KateUndo is now only for internal use in KateUndoGroup)
+ * start of convertion my*** to m_*** and add m_ to any other private stuff
+
+2002-05-17 Christian Couder <christian@kdevelop.org>
+ * Move font stuff from katedocument into new katefont.h and
+ katefont.cpp files, and clean up katedocument font stuff.
+
+2002-05-14 Christian Couder <christian@kdevelop.org>
+ * Big clean up in katedocument using new katecursor stuff.
+
+2002-05-12 Bernd Gehrmann <bernd@mail.berlios.de>
+ * Moved browser extension from view to doc, where it belongs
+ * If servicetype in the browser extension specifies an encoding,
+ use that instead of user's local encoding
+
+2002-05-11 Christian Couder <christian@kdevelop.org>
+ * implement the KTextEditor::Cursor in the KateCursor class
+
+2002-05-04 Christoph Cullmann <cullmann@kde.org>
+ * first KTextEditor::ViewPlugin which works
+ drop the helloworld plugin, as it is really no good example (bad code, ..)
+
+2002-05-04 Christian Couder <christian@kdevelop.org>
+ * fix undo for comment and uncomment
+
+2002-05-01 Christian Couder <christian@kdevelop.org>
+ * cleanups related to the uncomment feature in katetextline and katedocument
+
+2002-01-04 Christoph Cullmann <cullmann@kde.org>
+ * the search stuff in the katedocument is rewritten now, should work mostly,
+ only search for whole words is just a mess :(
+
+2002-01-03 Christoph Cullmann <cullmann@kde.org>
+ * kate app and kwrite app now use the katepart via libloader and link only
+ to the kateinterfaces (which will soon be splitted into katepartinterfaces
+ and kateinterfaces
+ * new framework for the configpages of the katepart accessible through the
+ interfaces
+ * KSpell works again ;) my god, what a buggy thingy
+
+2001-12-01 Christoph Cullmann <cullmann@kde.org>
+ * speedup for insert/removeText/Line
+ * new editStart/editEnd/editAddUndo functions to make the undo/redo + update
+ after edit function calls easier to understand an use in katedocument.*
+
+2001-11-30 Joseph Wenninger <jowenn@kde.org>
+ * I hopefully fixed the CSS highlighting finally. It used
+ deprecated syntax and there was a bug in the highlighting code,
+ for handling weakDeliminiators. Who renamed them, once they where
+ called weakDelimiters, which I think is the correct pronounciation.
+
+2001-11-29 Joseph Wenninger <jowenn@kde.org>
+ * KWrite/Kate use different font settings for printing and viewing now
+ * Fixed a small crash in my kdevelop->kate port of the codecompletion interface
+
+2001-11-26 Christoph Cullmann <cullmann@kde.org>
+ * backspace bug fixed
+ * more cleanups in doc/view
+
+2001-11-24 Christoph Cullmann <cullmann@kde.org>
+ * the docID is now called documentNumber and is in the KTextEditor lib ;)
+ * new print and mark interfaces ;)
+ * bugfixes for some stuff in kateview/document.*
+ * move more of the document stuff from the view to the document
+ (old kwritedoc/view was very mixed, no real separation, but that should be nearly done)
+
+2001-11-17 Christoph Cullmann <cullmann@kde.org>
+ * new selection code (bit buggy at the moment, but better than the old way
+ of storing the selection in the attributes
+
+2001-10-29 Joseph Wenninger <jowenn@kde.org>
+ * Highlighting definitions support now #stay and #pop as context values
+ * Some highlighting definitions ported
+
+2001-10-27 Christoph Cullmann <cullmann@kde.org>
+ * undo/redo works now without errors
+ * fix many memleaks + some crashs in buffer + hl
+ * fix ctx management (almost)
+
+2001-10-27 Joseph Wenninger <jowenn@kde.org
+ * Highlighting isn't updated completely yet (should be fixed now), but uses:
+ * I have to do some nasty workaround because the overloaded ==
+ operator in QMemArray crashes, if one or both of the arrays has
+ a size of 0 (I think this is a bug in QT, but it could be that
+ this is intended behavior. Who knows ?)
+
+2001-10-26 Joseph Wenninger <jowenn@kde.org>
+ * The stacked highlighting shoul almost work now.
+ Using old description files it will use quite a lot memory, but
+ they should work.
+ Problems:
+ * It's leaking like a sieve on destruction, because the
+ memarrays aren't deleted correctly yet (They need to be pointers and not
+ references, otherwise there are out of memory errors in qgarray)
+ * Highlighting isn't updated completely yet
+ * I have to do some nasty workaround because the overloaded ==
+ operator in QMemArray crashes, if one or both of the arrays has
+ a size of 0 (I think this is a bug in QT, but it could be that
+ this is intended behavior. Who knows ?)
+
+2001-10-20 Christoph Cullmann <cullmann@kde.org>
+ * new undo/redo stuff, should work now already fine (mostly ;)
+
+2001-10-14 Christoph Cullmann <cullmann@kde.org>
+ * new interfaces
+ * fixed some bugs (or better mistakes) in EditInterface
+ * fix bugs and even more bugs
+
+2001-10-14 Christoph Cullmann <cullmann@kde.org>
+ * implementing and enhancing the new KTextEditor interfaces
+ * rewrite the whole internal document/view stuff ;) (hope will be finished
+ soon with that old crap !
+ * reconstruction of whole katelibs + dirs
+
+2001-10-06 Christoph Cullmann <cullmann@kde.org>
+ * myself back again ;)
+ * now kate is clean (only qt3), no backports ;)
+
+2001-08-24 christian@kdevelop.org
+ * reimplement the commenting of selections on some languages
+
+2001-08-19 christian@kdevelop.org
+ * added back Sather highlighting support
+ * improved Eiffel language syntax highlighting support
+ * added Eiffel language comment directive in eiffel.xml
+ * added Ada language comment directive in ada.xml
+
+2001-08-15 christian@kdevelop.org
+ * committed Eiffel language syntax highlighting support
+
+2001-08-08 rokrau@yahoo.com
+ * committed changes to Kate's API necessary for integration of kate as
+ a kpart into kdevelop
+
+2001-05-13 Christoph Cullmann <cullmann@kde.org>
+ * after some time of learning for my "Abitur" now again some fixes ;):
+ textlines stuff rewritten, selection fixed + +/- font zoom buttons in the part
+
+2001-04-27 Christoph Cullmann <cullmann@kde.org>
+ * now the pluginconfig pages work ;)
+
+2001-04-24 Joseph Wenninger <jowenn@kde.org>
+ * now <keywords> and <types> is replaced by <list name="XXXX">
+
+2001-04-20 Christoph Cullmann <cullmann@kde.org>
+ * new configdialog
+ * enhanced pluginIface to supports configdialogpages
+
+2001-04-14 Christoph Cullmann <cullmann@kde.org>
+ * now kateview has in iconborder too (without real function at the moment)
+
+2001-04-10 Christoph Cullmann <cullmann@kde.org>
+ * bugfixes for drawBuffer stuff, next/prev viewspace, restoreView
+
+2001-04-08 Christoph Cullmann <cullmann@kde.org>
+ * now encoding for files can be selected at settings dialog (not only UTF8, all possible encodings)
+ * dropped old code -> use Waldo's code ;)
+
+2001-04-07 Joseph Wenninger <jowenn@kde.org>
+ * Activated Waldo Bastian's NEW_CODE
+ * Ported Highlighting to it
+
+2001-04-05 Joseph Wenninger <jowenn@kde.org>
+ * Highlighting Configuration is now in kate/kwrite settings too
+ * Made a cleanup of no longer used classes
+
+2001-04-04 Christoph Cullmann <cullmann@kde.org>
+ * sidebar now again restores config
+
+2001-04-03 Joseph Wenninger <jowenn@kde.org>
+ * Cristi Dumitrescu's PHP keyword / type list added
+
+2001-04-01 Joseph Wenninger <jowenn@kde.org>
+ * Added a new widget KateStackTabWidget
+ Now you can chose between tabbed or an
+ KOffice Workspace like view for the file sidebar
+ --> You can change this behavior in the config dialog
+ * Not implemented:
+ restore sidebar page on startup
+ remove page not implemented yet
+ (will be fixed soon)
+ * Added a backport of QT3's QRegExp I got from Scott Manson
+ wit one addtion (see qt3back/README)
+ hopefully this will give us more flexibility for syntax
+ highlighting
+
+2001-03-27 Christoph Cullmann <cullmann@kde.org>
+ * console disabled per default
+ * console only loaded if enabled
+
+2001-03-28 Joseph Wenninger <jowenn@kde.org>
+ * -n in kate.desktop removed, now config settings are used
+
+2001-03-27 Christoph Cullmann <cullmann@kde.org>
+ * interfaces extended (mainly for projectmanager)
+ * piper moved to plugins/projectmanager/piper
+ * a piper Makefile.am created
+
+2001-03-26 Joseph Wenninger <jowenn@kde.org>
+ * 2 reimplemented highlighing configs
+ * 1 experimental highlighting config
+ * preparations for an highlighting editing dialog
+
+2001-03-25 Christoph Cullmann <cullmann@kde.org>
+ * rewrite of plugin API and manager, now loading/unloading nice
+
+2001-03-22 Joseph Wenninger <jowenn@kde.org>
+ * single / multi instance mode configurable
+ Cullmann's -n option forces a new instance
+ Otherwise it uses the configuration from
+ the settings dialog. At the moment -n is
+ default start option
+
+2001-03-21 Christoph Cullmann <cullmann@kde.org>
+ * QPopupMenu for filelist
+
+2001-03-20 Christoph Cullmann <cullmann@kde.org>
+ * kate is now a normal KApplication
+
+2001-03-18 Christoph Cullmann <cullmann@kde.org>
+ * big location changes of source files
+ * KateFactory now in use by hole Kate app
+ * KatePartView/Doc merged with KateView/Doc (make life more easy)
+
+2001-03-18 Joseph Wenninger <jowenn@kde.org>
+ * openheader plugin opens the corresponding
+ .h file for .cpp or .c, and vice versa
+ * Hopefully fixed highlighting dialog for now.
+
+2001-03-17 Joseph Wenninger <jowenn@kde.org>
+ * Syntaxhighlighting is now defined in cpp.xml, c.xml html.xml ...
+ instead of a global syntax.xml.
+ (Not ported completely yet)
+ * Some simple reg expression work (see html.xml)
+
+2001-03-17 Christoph Cullmann <cullmann@kde.org>
+ * moved textfilter stuff to a own plugin "textfilter"
+ * cleaned up katemainwindow.*
+
+2001-03-16 Christoph Cullmann <cullmann@kde.org>
+ * search dialog comes up with selected text
+ * backport of some KDevelop KWrite patches ;)
+
+2001-03-15 Christoph Cullmann <cullmann@kde.org>
+ * katepart finished
+ * new kwrite using katepart
+ * removed old kwrite and kwritepart !
+ * fixed menu and toolbar problems of the new KWrite app
+
+2001-03-11 Christoph Cullmann <cullmann@kde.org>
+ * kwrite stuff merged into kate !!!!!
+
+2001-03-04 Christoph Cullmann <cullmann@kde.org>
+ * mutiple mainwindows
+ * fileist, sync for all mainwindows, all open docs listed
+
+2001-03-03 Christoph Cullmann <cullmann@kde.org>
+ * session management (Anders Lund)
+ * removed some debug stuff
+
+2001-02-26 Joseph Wenninger <jowenn@kde.org>
+ * First step for a plugin management dialog page
+ Soon to come
+
+2001-02-26 Christoph Cullmann <cullmann@kde.org>
+ * Kate is a part of kdebase :)
+ sourceforge.net CVS won't be used in the future
+
+2001-02-24 Phlip <phlip_cpp@my-deja.com>
+ * HTML button - select text, hit <Ctrl+Dash>, and enter the fields
+ for an SGML tag. Don't enter the < > or closing tag. We put these
+ around the selected text, and [try to] re-select that text so you can add
+ another nested tag right away. We are now the first HTML editor
+ that's actually better than Notepad! Hours of fun.
+
+ * Filter - select text, hit <Ctrl+Backslash>, and enter an OS command.
+ we pipe the selected text thru that command, such as "sort", and then
+ replace the selection with the result. Impress your friends.
+
+2001-02-21 Joseph Wenninger <jowenn@kde.org>
+ * Makefile.am's : correction for linking
+ * katemenuitem.h : Improved menu items added doc-list
+ * katelistboxitem.h : Improved listboxitem files-list
+
+2001-02-19 Christoph Cullmann <cullmann@kde.org>
+ * kateconsole.* konsole/* : add kateconsole widget
+
+2001-02-16 Anders Lund <anders@alweb.dk>
+ * katemainwindow.cpp :fixing read/write options to use maindockwindow functions.
+
+2001-02-15 Joseph Wenninger <jowenn@kde.org>
+ * kateview.cpp : Tab doesn't jump to next widget anymore, but inserts a tab into the text
+ * katemainwindow.* : F8 / SHIFT-F8 jumps to next / previous widget
diff --git a/kate/Mainpage.dox b/kate/Mainpage.dox
new file mode 100644
index 000000000..301d5788b
--- /dev/null
+++ b/kate/Mainpage.dox
@@ -0,0 +1,36 @@
+/** @mainpage Kate Editor Component
+
+The Kate Editor Component (also called Kate Part) implements the
+KTextEditor interfaces. Thus, all Kate Part classes are internal
+and never appear in public interfaces.
+
+If you wish to have a text editor component in your application,
+use the KTextEditor interfaces.
+
+@authors
+Christoph Cullmann \<cullmann@kde.org\><br>
+Joseph Wenninger \<jowenn@kde.org\><br>
+Anders Lund \<anders@alweb.dk\><br>
+Hamish Rodda \<rodda@kde.org\><br>
+Waldo Bastian \<bastian@kde.org\><br>
+Charles Samuels \<charles@kde.org\><br>
+Michael Bartl \<michael.bartl1@chello.at\><br>
+Matt Newell \<newellm@proaxis.com\><br>
+Michael McCallum \<gholam@xtra.co.nz\><br>
+John Firebaugh \<jfirebaugh@kde.org\><br>
+Nadeem Hasan \<nhasan@nadmm.com\><br>
+Jochen Wilhelmy \<digisnap@cs.tu-berlin.de\><br>
+Glen Parker \<glenebob@nwlink.com\><br>
+Michael Koch \<koch@kde.org\><br>
+Dominik Haumann \<dhdev@gmx.de\>
+
+@maintainers
+Christoph Cullmann \<cullmann@kde.org\>
+
+@licenses
+@lgpl
+
+*/
+// DOXYGEN_REFERENCES = kdecore kio kdeui kparts interfaces/kdocument interfaces/ktexteditor kjs
+// DOXYGEN_SET_PROJECT_NAME = Kate
+// vim:ts=4:sw=4:expandtab:filetype=doxygen
diff --git a/kate/Makefile.am b/kate/Makefile.am
new file mode 100644
index 000000000..180e86dab
--- /dev/null
+++ b/kate/Makefile.am
@@ -0,0 +1,11 @@
+SUBDIRS = interfaces part data scripts plugins
+EXTRA_DIST = AUTHORS COPYING.LIB ChangeLog NEWS README TODO
+
+messages:
+ $(EXTRACTRC) ./*/*.rc >> rc.cpp
+ $(EXTRACTATTR) --attr=language,name,Language --attr="language,section,Language Section" data/*.xml >> rc.cpp
+ $(XGETTEXT) `find . -name "*.cpp"` part/*.h -o $(podir)/katepart.pot
+
+DOXYGEN_REFERENCES = kdecore dcop kio kdeui kparts
+include ../admin/Doxyfile.am
+
diff --git a/kate/NEWS b/kate/NEWS
new file mode 100644
index 000000000..df01fb9a3
--- /dev/null
+++ b/kate/NEWS
@@ -0,0 +1,43 @@
+2005-05-05
+ SVN conversion over, thx to coolo and co ;)
+
+2003-12-24
+ XMas ;)
+
+2003-08-28
+ KDE 3.2 feature freeze is close, last big stuff included like
+ the folding for indentation based languages and the new indenters
+ by jesse and the color schemes + file type settings, folding for pythong
+ still needs work
+
+2002-11-11
+ KDE 3.1 is close, printing + dynamic word wrap seems to work fine ;P
+
+2002-08-26
+ Hacking at the KDE e.V. meeting ;)
+
+2002-03-28
+ The code folding Branch is readded back into HEAD
+
+2002-01-10
+ Kate Part is now in Kdelibs ;)
+
+Old news of kate part/app in kdebase:
+
+2002-01-03
+ Kate App and Part separated
+
+2001-11-24
+ KTextEditor interfaces are near completion ;)
+
+2001-06-11
+ Little Cullmann got his little Abitur with 1.zero ;)
+
+2001-05-12
+ juhu, my abi is over ;) (just must type a news item ;)
+
+2001-04-01
+ Kant -> Kate
+
+2001-03-01
+ Kant is now official part of KDEBASE ;-)
diff --git a/kate/README b/kate/README
new file mode 100644
index 000000000..5b6281567
--- /dev/null
+++ b/kate/README
@@ -0,0 +1,10 @@
+ *** Kate Part ***
+The Kate Part supports the majority of KTextEditor interfaces and it is
+highly approciated to use them (the Kate::View/Document interfaces allow are more
+tight integration with the kate part, but makes you more depend on the kate part!)
+
+Homepage: http://kate.kde.org
+
+Licensing:
+The Kate Part and its interfaces are licensed under the LGPL version 2,
+not any later version.
diff --git a/kate/README.testing b/kate/README.testing
new file mode 100644
index 000000000..037271027
--- /dev/null
+++ b/kate/README.testing
@@ -0,0 +1,241 @@
+ Testing Kate
+==============
+
+Author: Leo Savernik
+
+Kate contains regression tests to ensure that fixed bugs do not reappear in
+newer versions. To facilitate regression testing, a dedicated application
+testkateregression will execute the regression tests and compare them to the
+expecting results, indicating passed as well as failed testcases.
+
+
+1. Using testkateregression
+ --------------------------
+
+We tried to make regression testing for Kate as easy as possible such that you
+can run it before each commit and find out regressions caused by your changes
+before they are shipped as part of a release.
+
+Running all regression tests works by simply invoking
+
+ > make check
+
+in your kate build directory. While executing, testkateregression prints a line
+for each executed testcase, prefixed with "PASS" if it passed, and "FAIL" if it
+failed. Furthermore, testkateregression stores a comprehensive output log under
+<katetests-directory>/output/index.html. The output log is invaluable for
+determining why a certain testcase failed.
+
+If you invoke testkateregression the first time, it will print instructions on
+how to fetch the testsuite and pointing testkateregression to it. This setup
+has only to be done once per branch.
+
+
+2. Discriminating your regressions against existing regressions
+ --------------------------------------------------------------
+
+In an ideal universe, all testcases always pass. In this universe, however,
+some testcases fail, be it because of anticipating future features not
+implemented yet, be it because of nasty bugs which cannot be repaired easily.
+
+This means if you've hacked on kate for quite some while and then fire up
+"make check", you are likely to see many failed tests pass by, most of them
+*not* caused by your very changes, as they failed already before.
+
+To discriminate the failed tests caused by your changes against the unaffected
+failures, testkateregression provides the option --save-failures=<name>, which
+runs the regression tests and stores all failures under a failure snapshot
+identified by <name>.
+
+The next time you run "make check", testkateregression automatically picks up
+the most recently stored failure snapshot and compares the failures and passes
+with the one stored in the snapshot. Each failure not listed in the failure
+snapshot will be prefixed with "FAIL (new)", indicating that this is a new
+failure. Testcases which failed in the snapshot but do pass now are prefixed
+with "PASS (new)", indicating that this testcase seems to be fixed now.
+
+
+3. Using testkateregression efficiently
+ --------------------------------------
+
+Therefore, to get the most out of regression testing, we suggest the following
+development approach:
+
+ 1. Before you change Kate, update and run testkateregression in the part-
+ subdirectory.
+
+ > make testkateregression && ./testkateregression --save-failures=last
+
+ This will produce a failure snapshot called "last".
+
+ 2. Hack on Kate.
+
+ 3. Before you commit, run
+
+ > make check
+
+ It will automatically pick up the failure snapshot "last" (provided you
+ didn't generate a newer one in the meantime) and compare all results with
+ the previously stored ones.
+
+ If you inspect <katetests-directory>/output/index.html, the new failures
+ are marked red. Those are of interest to you, because they have been
+ caused by your changes.
+
+ New passes are marked green. These were former failures which started
+ working due to your changes.
+
+ Goto 2 while there are any new failures.
+
+ 4. Commit.
+
+
+4. Invoking testkateregression directly
+ --------------------------------------
+
+While make check is handy and simple enough for the common case, you might
+sometimes need more control over regression testing.
+
+testkateregression features a broad range of options, enabling you to run
+dedicated testcases only, specifying an alternate output directory for the
+logs, etc.
+
+ > ./testregression --help
+
+will provide you with a complete list of options.
+
+
+5. Structure of the regression test suite
+ ----------------------------------------
+
+Kate's regression testsuite is located in the KDE repository under
+
+ trunk/tests/katetests/regression
+
+and consists of two subdirectories
+
+ baseline
+ tests
+
+The latter, tests, contains a directory hierarchy for all testcases to be run
+by testkateregression. The former, baseline, contains results as they are
+expected by correct operation. Mismatch between the output of a test and its
+baseline is considered to be a failure.
+
+Each directory under tests may optionally contain one of the following files.
+
+ .kateconfig
+ .kateconfig-commands
+ ignore
+ KNOWN_FAILURES
+
+.kateconfig: This file works exactly like .kateconfig as supported by the kate
+and kwrite editors. It may contain any kate line variable necessary to set up
+the testcases proper. Note that .kateconfig files from parent directories are
+not merged with .kateconfig files from child directories.
+
+.kateconfig-commands: This file may contain all commands that can be entered by
+kate's command line (F7). Each line will be interpreted as one command. To the
+contrary of .kateconfig, .kateconfig-commands files are merged with
+.kateconfig-commands files from parent directories. Nearer ancestors' commands
+take precedence over farther ancestors'.
+
+ignore: This file specifies on each line a file to be ignored in the directory
+the ignore-file is located. This enables you to mark any helper files which
+otherwise would be interpreted as testcases. Note that hidden files (.*) are
+ignored by default, and cannot be "unignored".
+
+KNOWN_FAILURES: This file specifies on each line a file name of a testcase
+which is known to fail. Such known failures are counted towards the total count
+of failures but they don't cause testkateregression to return a failure code.
+
+
+6. Structure of a testcase
+ -------------------------
+
+A testcase is comprised of a simple plain text file <testcase>.txt which may
+be located in any subdirectory under tests. This file contains the *initial*
+content the testcase operates on.
+
+Each <testcase>.txt must be accompanied with a <testcase>.txt-script which
+contains the actual tests to be performed on the testcase. It consists of
+simple JavaScript-statements for direct interfacing with Kate.
+
+Last but not least, a <testcase>.txt-result exists under the baseline
+subdirectory, which contains a mirrored directory hierarchy of tests. This very
+file contains the expected *result* of the performed tests.
+
+
+7. Writing a simple testcase
+ ---------------------------
+
+Writing your own testcases is easy once you know how to get started. Let's
+test how Kate's C-Style indenter fares with indenting after opening braces.
+
+First, we create the new initial content under tests/indent/csmart/openbrc.txt
+and fill it with (the dashed lines are not part of the content)
+---------------------------
+
+int main() {
+
+---------------------------
+
+Now, we need to write a script performing some actions. We therefore create
+a file tests/indent/csmart/openbrc.txt-script and fill it with
+---------------------------
+v.setCursorPosition(1,12);
+v.enter();
+v.type("good");
+---------------------------
+
+Here, we set the initial cursor position to line 2 (the coordinates are zero-
+based) and column 13 which happens to be just after the opening brace. Then
+v.enter() simulates pressing the return key in the editor, thus inserting a
+new line. v.type simulates typing of the word "good" at the current position
+of the cursor.
+
+The options under .kateconfig specify the C-Style indenter to be applied to the
+testcases and an indent width of two. With this information, we know what we
+expect as a result.
+
+What we are still missing is the expected result itself which we create under
+baseline/indent/csmart/openbrc.txt-result and fill it with
+---------------------------
+
+int main() {
+ good
+
+---------------------------
+
+You can see that "good" is indented by two spaces, even though we didn't
+specify those with v.type. We expect from the indenter to provide them for us.
+
+Last but not least we test the testcase by invoking in kate's part directory
+
+ > ./testkateregression indent/csmart/openbrc.txt
+
+and checking whether it works the way we intended it.
+
+
+7. The JavaScript-interface to the testcases
+ -------------------------------------------
+
+testkateregression provides you with the following global objects for each
+testcase:
+
+ v - object of view
+ d - object of document
+
+Each object provides the same methods and fields as the respective JavaScript-
+interfaces built in to Kate, like v.setCursorPosition.
+
+Additionally, v provides the following methods unique to testkateregression.
+
+type(<string>)
+ Inserts <string> into the current cursor position as if <string> had
+ been typed by the keyboard. Contrary to insert(<string>), it will
+ trigger indentation and other checks.
+enter(), returnKey()
+ Inserts a new line as if the return key had been pressed. This will
+ trigger special indentation rules.
+
diff --git a/kate/TODO b/kate/TODO
new file mode 100644
index 000000000..1f50f6b4f
--- /dev/null
+++ b/kate/TODO
@@ -0,0 +1,66 @@
+TODO:
+ A current todo list is available on:
+ http://kate.babylon2k.com/index.php/Work_todo
+
+**** Refactoring/Cleanups ****
+
+* KateLineRange to become a proper class with methods etc. Parts needed for
+ bidi.
+
+* KateViewInternal to be completely hidden from view for almost everything but
+ the view itself.
+
+ -> in progress, almost done for most parts, viewinternal only visible to friends of KateView
+
+* Separate more functionality from KateDocument (selections moving to KateView,
+ a plugin manager class, a config class, etc)
+
+ -> in progress:
+ * config classes already in place
+ * selection moved to KateView
+
+**** new features ****
+
+* Fix EOL whitespace cleaning finally by removing whitespace at load-time and
+ keeping the document consistent all the time
+
+ -> DONE ;) whitespaces are no cleaned at load time, the magic clean on save stuff is gone
+
+* BiDi finally, using Scribe
+
+* Finally implement arbitrary highlighting and arbitrary input filtering
+
+* Switch internal highlighting to use arbitrary highlighting api and thus be
+ exposed (read-only)
+
+* Buffer locking (Per-line or per-group-of-lines) for multithreaded access
+
+* More robust history including cursor position history
+
+* More featureful code completion including syntax highlighted entries
+
+* Custom widgets in between lines interface (eg. so kcachegrind could use
+ katepart to display its cpu usage information etc)
+
+* KateFoldingTree* to use smart cursors
+
+* Splitting a view over multiple columns (I want to by a 30" apple display ;)
+
+* Modular input subsystem, to support emulation of other editors in a clean way
+
+* Improved input modes especially in block selection
+
+* Multiple selection support
+
+* Better support for information overlay (eg. documentation of a function -
+ switch between short / detailed descriptions)
+
+* Whatever else is needed for multiuser editing (and perhaps put most of it
+ inside the part, so eg. kate, kdevelop, quanta etc. could all use it)
+
+* Scripting (we don't have any yet do we?)
+
+ -> in progress, part gets kjs support, already working, but API needs to be
+ finished and a clever way to let scripts register for the katecmdline needs to
+ be implemented, with caching and all other cool things the world doesn'T or does
+ need \ No newline at end of file
diff --git a/kate/data/Makefile.am b/kate/data/Makefile.am
new file mode 100644
index 000000000..da5febd95
--- /dev/null
+++ b/kate/data/Makefile.am
@@ -0,0 +1,34 @@
+kde_services_DATA = katepart.desktop
+
+rckatedir = $(kde_datadir)/katepart
+rckate_DATA = katepartui.rc katepartreadonlyui.rc
+
+syntaxkatedir = $(kde_datadir)/katepart/syntax
+syntaxkate_DATA = language.dtd syntax.template cpp.xml c.xml html.xml kbasic.xml objectivec.xml \
+ changelog.xml ada.xml css.xml perl.xml php.xml xml.xml java.xml rpmspec.xml \
+ sql.xml sql-mysql.xml sql-postgresql.xml vhdl.xml diff.xml bash.xml latex.xml postscript.xml ruby.xml rhtml.xml \
+ desktop.xml eiffel.xml pascal.xml sather.xml python.xml makefile.xml \
+ ferite.xml scheme.xml matlab.xml tcl.xml ilerpg.xml verilog.xml javascript.xml \
+ sml.xml winehq.xml cs.xml sgml.xml idconsole.xml xmldebug.xml fortran.xml haskell.xml \
+ literate-haskell.xml r.xml gnuassembler.xml mab.xml mason.xml idl.xml prolog.xml \
+ rsiidl.xml coldfusion.xml picsrc.xml uscript.xml lpc.xml velocity.xml sci.xml ldif.xml \
+ inform.xml xharbour.xml yacas.xml component-pascal.xml asm6502.xml gdl.xml bibtex.xml d.xml \
+ vrml.xml rexx.xml cue.xml progress.xml e.xml sieve.xml modula-2.xml awk.xml cisco.xml \
+ doxygen.xml lua.xml pike.xml debianchangelog.xml debiancontrol.xml fgl-4gl.xml fgl-per.xml alert.xml \
+ gettext.xml commonlisp.xml clipper.xml povray.xml euphoria.xml mup.xml jsp.xml ocaml.xml lex.xml yacc.xml \
+ cg.xml html-php.xml css-php.xml javascript-php.xml ahdl.xml ansic89.xml tibasic.xml \
+ purebasic.xml mips.xml logtalk.xml txt2tags.xml xslt.xml stata.xml glsl.xml \
+ lilypond.xml abc.xml asp.xml asm-avr.xml rib.xml cmake.xml octave.xml javadoc.xml cgis.xml \
+ spice.xml nasm.xml mediawiki.xml apache.xml m3u.xml ini.xml fstab.xml actionscript.xml
+
+partrcdir = $(kde_confdir)
+partrc_DATA = katesyntaxhighlightingrc katefiletyperc
+
+html-php.xml: $(srcdir)/html.xml $(srcdir)/generate-php.pl
+ $(PERL) $(srcdir)/generate-php.pl < $(srcdir)/html.xml > $@
+
+css-php.xml: $(srcdir)/css.xml $(srcdir)/generate-php.pl
+ $(PERL) $(srcdir)/generate-php.pl < $(srcdir)/css.xml > $@
+
+javascript-php.xml: $(srcdir)/javascript.xml $(srcdir)/generate-php.pl
+ $(PERL) $(srcdir)/generate-php.pl < $(srcdir)/javascript.xml > $@
diff --git a/kate/data/abc.xml b/kate/data/abc.xml
new file mode 100644
index 000000000..8d5ff163b
--- /dev/null
+++ b/kate/data/abc.xml
@@ -0,0 +1,88 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+<!-- Andrea Primiani - primiani at dag dot it
+ version1.10 - 12 december 2005 -->
+<language name="ABC" version="1.10" kateversion="2.4" section="Other" extensions="*.abc;*.ABC" mimetype="text/vnd.abc" casesensitive="1" author="Andrea Primiani (primiani@dag.it)" license="LGPL">
+ <highlighting>
+ <contexts>
+ <context name="Normal" attribute="Normal Text" lineEndContext="#stay">
+<!-- detects tuplet symbols e.g. (3 or (3:2:2-->
+ <RegExpr attribute="Tuplet" context="#stay" String="\([23456789]:?[23456789]?:?[23456789]?" />
+<!-- detects quoted strings -->
+ <RangeDetect attribute="String" context="#stay" char="&quot;" char1="&quot;"/>
+<!-- detects decorations delimited by ! ! symbols -->
+ <RangeDetect attribute="Decoration" context="#stay" char="!" char1="!" />
+<!-- detects single header command delimited by [ and sends to Header context -->
+ <RegExpr attribute="Header" context="Header" String="\[[ABCGHILMNOQRSTUVZ]:" />
+<!-- detects single header line inside a song without [] - ends at EOL-->
+ <RegExpr attribute="Header" context="Header2" String="[ABCGHILMNOPQRSTUVZ]:" />
+<!-- detect beginning of header zone with X: and sends to Header context -->
+ <Detect2Chars attribute="Header" context="Header" char="X" char1=":" beginRegion="header" column="0"/>
+<!-- detects bar beginning (or chord) symbols and sends to Bar context -->
+ <AnyChar attribute="Bar" context="Bar" String="|:[" />
+<!-- detects ] if used to close chords -->
+ <DetectChar attribute="Bar" context="#stay" char="]" />
+<!-- detects () for slurs -->
+ <AnyChar attribute="Slur" context="#stay" String="()" />
+<!-- detects {} for gracings -->
+ <AnyChar attribute="Slur" context="#stay" String="{}" />
+<!-- detects W: and w: lyric lines -->
+ <Detect2Chars attribute="Lyrics" context="Lyrics" char="W" char1=":" />
+ <Detect2Chars attribute="Lyrics" context="Lyrics" char="w" char1=":" />
+<!-- detects %% preprocessor lines and % comment lines-->
+ <Detect2Chars attribute="Preprocessor" context="Preprocessor" char="%" char1="%"/>
+ <DetectChar attribute="Comment" context="Comment" char="%" />
+<!-- detects ^ _ = symbols before a note -->
+ <RegExpr attribute="Sharp" context="#stay" String="[_|\^]?[_|=|\^][A-Ga-g]" />
+ </context>
+<!-- returns to Normal context at the end of line -->
+ <context name="Preprocessor" attribute="Preprocessor" lineEndContext="#pop" />
+ <context name="Lyrics" attribute="Lyrics" lineEndContext="#pop" />
+ <context name="Part" attribute="Header" lineEndContext="#pop" />
+ <context name="Comment" attribute="Comment" lineEndContext="#pop" />
+<!-- returns to Normal context after the end of bar symbols or at EOL -->
+ <context name="Bar" attribute="Bar" lineEndContext="#pop" >
+ <DetectChar attribute="Normal" context="#pop" char="&quot;" />
+<!-- the bar symbol ends when a note letter follows -->
+ <RegExpr attribute="Normal" context="#pop" String="[A-Ga-gZz]" />
+<!-- the bar symbol ends after a white space -->
+ <DetectChar attribute="Normal" context="#pop" char=" " />
+<!-- detects decorations delimited by ! ! symbols -->
+ <RangeDetect attribute="Decoration" context="#stay" char="!" char1="!" />
+<!-- detects () for slurs -->
+ <AnyChar attribute="Slur" context="#stay" String="()" />
+<!-- chomps all other bar symbols -->
+ <RegExpr attribute="Bar" context="#pop" String=":*\|*[1-9]|/*\|" />
+ </context>
+<!-- returns to Normal context at the end of header -->
+ <context name="Header" attribute="Header" lineEndContext="#stay">
+<!-- the header ends after K: line -->
+ <RegExpr attribute="Header" context="#pop" String="K:.+" endRegion="header" column="0"/>
+<!-- the single header command ends at the ] char -->
+ <DetectChar attribute="Header" context="#pop" char="]" />
+ </context>
+<!-- the single header line ends at EOL -->
+ <context name="Header2" attribute="Header" lineEndContext="#pop" />
+ </contexts>
+ <itemDatas>
+ <itemData name="Normal Text" defStyleNum="dsNormal"/>
+ <itemData name="Notes" defStyleNum="dsKeyword" bold="true"/>
+ <itemData name="Comment" defStyleNum="dsComment"/>
+ <itemData name="Decoration" defStyleNum="dsFloat" color="#00bbaa" />
+ <itemData name="String" defStyleNum="dsString" bold="true"/>
+ <itemData name="Preprocessor" defStyleNum="dsString" italic="true"/>
+ <itemData name="Header" defStyleNum="dsFloat"/>
+ <itemData name="Slur" defStyleNum="dsDataType" bold="true"/>
+ <itemData name="Tuplet" defStyleNum="dsDataType" color="#bb00bb"/>
+ <itemData name="Lyrics" defStyleNum="dsDataType" color="#00bb00"/>
+ <itemData name="Bar" defStyleNum="dsChar" color="#0000ff"/>
+ <itemData name="Sharp" defStyleNum="dsNormal" color="#22bb66" bold="true"/>
+ </itemDatas>
+ </highlighting>
+ <general>
+ <comments>
+ <comment name="singleLine" start="%" />
+ </comments>
+ <keywords casesensitive="1" />
+ </general>
+</language>
diff --git a/kate/data/actionscript.xml b/kate/data/actionscript.xml
new file mode 100644
index 000000000..c2656a3e2
--- /dev/null
+++ b/kate/data/actionscript.xml
@@ -0,0 +1,334 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+<language name="ActionScript 2.0" version="1.00" kateversion="2.4" section="Sources" extensions="*.as" mimetype="text/x-actionscript" license="LGPL" author="Aaron Miller (armantic101@gmail.com)">
+ <highlighting>
+
+ <list name="properties">
+ <item> _accProps </item>
+ <item> _focusrect </item>
+ <item> _global </item>
+ <item> _highquality </item>
+ <item> _level </item>
+ <item> _parent </item>
+ <item> _quality </item>
+ <item> _root </item>
+ <item> _soundbuftime </item>
+ <item> maxscroll </item>
+ <item> scroll </item>
+ <item> this </item>
+ </list>
+
+ <list name="global_functions">
+ <item> asfunction </item>
+ <item> call </item>
+ <item> chr </item>
+ <item> clearInterval </item>
+ <item> duplicateMovieClip </item>
+ <item> escape </item>
+ <item> eval </item>
+ <item> fscommand </item>
+ <item> getProperty </item>
+ <item> getTimer </item>
+ <item> getURL </item>
+ <item> getVersion </item>
+ <item> gotoAndPlay </item>
+ <item> gotoAndStop </item>
+ <item> ifFrameLoaded </item>
+ <item> int </item>
+ <item> isFinite </item>
+ <item> isNaN </item>
+ <item> length </item>
+ <item> loadMovie </item>
+ <item> loadMovieNum </item>
+ <item> loadVariables </item>
+ <item> loadVariablesNum </item>
+ <item> mbchr </item>
+ <item> mblength </item>
+ <item> mbord </item>
+ <item> mbsubstring </item>
+ <item> nextFrame </item>
+ <item> nextScene </item>
+ <item> on </item>
+ <item> onClipEvent </item>
+ <item> ord </item>
+ <item> parseFloat </item>
+ <item> parseInt </item>
+ <item> play </item>
+ <item> prevFrame </item>
+ <item> prevScene </item>
+ <item> print </item>
+ <item> printAsBitmap </item>
+ <item> printAsBitmapNum </item>
+ <item> printNum </item>
+ <item> random </item>
+ <item> removeMovieClip </item>
+ <item> setInterval </item>
+ <item> setProperty </item>
+ <item> showRedrawRegions </item>
+ <item> startDrag </item>
+ <item> stop </item>
+ <item> stopAllSounds </item>
+ <item> stopDrag </item>
+ <item> substring </item>
+ <item> targetPath </item>
+ <item> tellTarget </item>
+ <item> toggleHighQuality </item>
+ <item> trace </item>
+ <item> typeof </item>
+ <item> unescape </item>
+ <item> unloadMovie </item>
+ <item> unloadMovieNum </item>
+ <item> updateAfterEvent </item>
+ </list>
+
+ <list name="classes">
+ <item> Accessibility </item>
+ <item> Accordion </item>
+ <item> Alert </item>
+ <item> Binding </item>
+ <item> Button </item>
+ <item> Camera </item>
+ <item> CellRenderer </item>
+ <item> CheckBox </item>
+ <item> Collection </item>
+ <item> Color </item>
+ <item> ComboBox </item>
+ <item> ComponentMixins </item>
+ <item> ContextMenu </item>
+ <item> ContextMenuItem </item>
+ <item> CustomActions </item>
+ <item> CustomFormatter </item>
+ <item> CustomValidator </item>
+ <item> DataGrid </item>
+ <item> DataHolder </item>
+ <item> DataProvider </item>
+ <item> DataSet </item>
+ <item> DataType </item>
+ <item> Date </item>
+ <item> DateChooser </item>
+ <item> DateField </item>
+ <item> Delta </item>
+ <item> DeltaItem </item>
+ <item> DeltaPacket </item>
+ <item> DepthManager </item>
+ <item> EndPoint </item>
+ <item> Error </item>
+ <item> FaultEvent </item>
+ <item> FocusManager </item>
+ <item> Form </item>
+ <item> Function </item>
+ <item> Iterator </item>
+ <item> Key </item>
+ <item> Label </item>
+ <item> List </item>
+ <item> LoadVars </item>
+ <item> Loader </item>
+ <item> LocalConnection </item>
+ <item> Log </item>
+ <item> Math </item>
+ <item> Media </item>
+ <item> Menu </item>
+ <item> MenuBar </item>
+ <item> Microphone </item>
+ <item> Mouse </item>
+ <item> MovieClip </item>
+ <item> MovieClipLoader </item>
+ <item> NetConnection </item>
+ <item> NetStream </item>
+ <item> Number </item>
+ <item> NumericStepper </item>
+ <item> PendingCall </item>
+ <item> PopUpManager </item>
+ <item> PrintJob </item>
+ <item> ProgressBar </item>
+ <item> RDBMSResolver </item>
+ <item> RadioButton </item>
+ <item> RelayResponder </item>
+ <item> SOAPCall </item>
+ <item> Screen </item>
+ <item> ScrollPane </item>
+ <item> Selection </item>
+ <item> SharedObject </item>
+ <item> Slide </item>
+ <item> Sound </item>
+ <item> Stage </item>
+ <item> StyleManager </item>
+ <item> System </item>
+ <item> TextArea </item>
+ <item> TextField </item>
+ <item> TextFormat </item>
+ <item> TextInput </item>
+ <item> TextSnapshot </item>
+ <item> TransferObject </item>
+ <item> Tree </item>
+ <item> TreeDataProvider </item>
+ <item> TypedValue </item>
+ <item> UIComponent </item>
+ <item> UIEventDispatcher </item>
+ <item> UIObject </item>
+ <item> Video </item>
+ <item> WebService </item>
+ <item> WebServiceConnector </item>
+ <item> Window </item>
+ <item> XML </item>
+ <item> XMLConnector </item>
+ <item> XUpdateResolver </item>
+ </list>
+
+ <list name="keywords">
+ <item> add </item>
+ <item> and </item>
+ <item> break </item>
+ <item> case </item>
+ <item> catch </item>
+ <item> class </item>
+ <item> continue </item>
+ <item> default </item>
+ <item> delete </item>
+ <item> do </item>
+ <item> dynamic </item>
+ <item> else </item>
+ <item> eq </item>
+ <item> extends </item>
+ <item> finally </item>
+ <item> for </item>
+ <item> function </item>
+ <item> ge </item>
+ <item> get </item>
+ <item> gt </item>
+ <item> if </item>
+ <item> implements </item>
+ <item> import </item>
+ <item> in </item>
+ <item> instanceof </item>
+ <item> interface </item>
+ <item> intrinsic </item>
+ <item> le </item>
+ <item> lt </item>
+ <item> ne </item>
+ <item> new </item>
+ <item> not </item>
+ <item> or </item>
+ <item> private </item>
+ <item> public </item>
+ <item> return </item>
+ <item> set </item>
+ <item> static </item>
+ <item> switch </item>
+ <item> throw </item>
+ <item> try </item>
+ <item> var </item>
+ <item> void </item>
+ <item> while </item>
+ <item> with </item>
+ </list>
+
+ <list name="const">
+ <item> false </item>
+ <item> Infinity </item>
+ <item> -Infinity </item>
+ <item> NaN </item>
+ <item> newline </item>
+ <item> null </item>
+ <item> true </item>
+ <item> undefined </item>
+ </list>
+
+ <list name="types">
+ <item> Array </item>
+ <item> Boolean </item>
+ <item> Number </item>
+ <item> Object </item>
+ <item> String </item>
+ <item> Void </item>
+ </list>
+
+ <contexts>
+ <context attribute="Normal Text" lineEndContext="#stay" name="Normal">
+ <!-- Comment next line if you don't use Javadoc tool -->
+ <IncludeRules context="##Javadoc"/>
+ <keyword attribute="Properties" context="#stay" String="properties"/>
+ <keyword attribute="Global Functions" context="#stay" String="global_functions"/>
+ <keyword attribute="Classes" context="#stay" String="classes"/>
+ <keyword attribute="Keyword" context="#stay" String="keywords"/>
+ <keyword attribute="Constants" context="#stay" String="const"/>
+ <keyword attribute="Data Type" context="#stay" String="types"/>
+ <Float attribute="Float" context="#stay">
+ <AnyChar String="fF" attribute="Float" context="#stay"/>
+ </Float>
+ <HlCOct attribute="Octal" context="#stay"/>
+ <HlCHex attribute="Hex" context="#stay"/>
+ <Int attribute="Decimal" context="#stay">
+ <StringDetect attribute="Decimal" context="#stay" String="ULL" insensitive="TRUE"/>
+ <StringDetect attribute="Decimal" context="#stay" String="LUL" insensitive="TRUE"/>
+ <StringDetect attribute="Decimal" context="#stay" String="LLU" insensitive="TRUE"/>
+ <StringDetect attribute="Decimal" context="#stay" String="UL" insensitive="TRUE"/>
+ <StringDetect attribute="Decimal" context="#stay" String="LU" insensitive="TRUE"/>
+ <StringDetect attribute="Decimal" context="#stay" String="LL" insensitive="TRUE"/>
+ <StringDetect attribute="Decimal" context="#stay" String="U" insensitive="TRUE"/>
+ <StringDetect attribute="Decimal" context="#stay" String="L" insensitive="TRUE"/>
+ </Int>
+ <HlCChar attribute="Char" context="#stay"/>
+ <RegExpr attribute="Decimal" context="#stay" String="//\s*BEGIN.*$" beginRegion="Region1"/>
+ <RegExpr attribute="Decimal" context="#stay" String="//\s*END.*$" endRegion="Region1"/>
+ <DetectChar attribute="String" context="String" char="&quot;"/>
+ <Detect2Chars attribute="Comment" context="Commentar 1" char="/" char1="/"/>
+ <Detect2Chars attribute="Comment" context="Commentar 2" char="/" char1="*" beginRegion="Comment"/>
+ <DetectChar attribute="Symbol" context="#stay" char="{" beginRegion="Brace1"/>
+ <DetectChar attribute="Symbol" context="#stay" char="}" endRegion="Brace1"/>
+ <RegExpr attribute="Keyword" context="#stay" String="\.{3,3}\s+" />
+ <RegExpr attribute="Keyword" context="StaticImports" String="\b(import\s+static)\b" />
+ <RegExpr attribute="Keyword" context="Imports" String="\b(package|import)\b" />
+ <RegExpr attribute="Function" context="#stay" String="\b[_\w][_\w\d]*(?=[\s]*(/\*\s*\d+\s*\*/\s*)?[(])" />
+ <RegExpr attribute="Symbol" context="Member" String="[.]{1,1}" />
+ <AnyChar attribute="Symbol" context="#stay" String=":!%&amp;()+,-/.*&lt;=&gt;?[]|~^&#59;"/>
+ </context>
+ <context attribute="String" lineEndContext="#pop" name="String">
+ <LineContinue attribute="String" context="#stay"/>
+ <HlCStringChar attribute="String Char" context="#stay"/>
+ <DetectChar attribute="String" context="#pop" char="&quot;"/>
+ </context>
+ <context attribute="Normal Text" lineEndContext="#pop" name="Member" fallthrough="true" fallthroughContext="#pop">
+ <RegExpr attribute="Function" context="#pop" String="\b[_a-zA-Z]\w*(?=[\s]*)" />
+ </context>
+ <context attribute="Normal Text" lineEndContext="#pop" name="StaticImports">
+ <RegExpr attribute="StaticImports" context="#pop" String="\s*.*$" />
+ </context>
+ <context attribute="Normal Text" lineEndContext="#pop" name="Imports">
+ <RegExpr attribute="Imports" context="#pop" String="\s*.*$" />
+ </context>
+ <context attribute="Comment" lineEndContext="#pop" name="Commentar 1"/>
+ <context attribute="Comment" lineEndContext="#stay" name="Commentar 2">
+ <Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" endRegion="Comment"/>
+ </context>
+ </contexts>
+ <itemDatas>
+ <itemData name="Normal Text" defStyleNum="dsNormal"/>
+ <itemData name="Keyword" defStyleNum="dsKeyword"/>
+ <itemData name="Function" defStyleNum="dsFunction"/>
+ <itemData name="StaticImports" defStyleNum="dsKeyword" color="#800080" selColor="#FFFFFF" bold="0" italic="0"/>
+ <itemData name="Imports" defStyleNum="dsKeyword" color="#808000" selColor="#FFFFFF" bold="0" italic="0"/>
+ <itemData name="Data Type" defStyleNum="dsDataType"/>
+ <itemData name="Decimal" defStyleNum="dsDecVal"/>
+ <itemData name="Octal" defStyleNum="dsBaseN"/>
+ <itemData name="Hex" defStyleNum="dsBaseN"/>
+ <itemData name="Float" defStyleNum="dsFloat"/>
+ <itemData name="Char" defStyleNum="dsChar"/>
+ <itemData name="String" defStyleNum="dsString"/>
+ <itemData name="String Char" defStyleNum="dsChar"/>
+ <itemData name="Comment" defStyleNum="dsComment"/>
+ <itemData name="Symbol" defStyleNum="dsNormal"/>
+ <itemData name="Properties" defStyleNum="dsNormal" color="#000033" selColor="#CCCCCC" bold="1" italic="0"/>
+ <itemData name="Global Functions" defStyleNum="dsNormal" color="#006666" selColor="#CCCCCC" bold="1" italic="0"/>
+ <itemData name="Classes" defStyleNum="dsNormal" color="#660066" selColor="#CCCCCC" bold="1" italic="0"/>
+ <itemData name="Constants" defStyleNum="dsNormal" color="#003300" selColor="#CCCCCC" bold="1" italic="0"/>
+ </itemDatas>
+ </highlighting>
+ <general>
+ <comments>
+ <comment name="singleLine" start="//"/>
+ <comment name="multiLine" start="/*" end="*/"/>
+ </comments>
+ <keywords casesensitive="1"/>
+ </general>
+</language>
diff --git a/kate/data/ada.xml b/kate/data/ada.xml
new file mode 100644
index 000000000..830c5cbd2
--- /dev/null
+++ b/kate/data/ada.xml
@@ -0,0 +1,194 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+<language name="Ada" version="1.06" kateversion="2.4" section="Sources" extensions="*.adb;*.ads;*.ada;*.a" mimetype="text/x-adasrc">
+ <highlighting>
+ <list name="keywords">
+ <item> abort </item>
+ <item> abs </item>
+ <item> abstract </item>
+ <item> accept </item>
+ <item> access </item>
+ <item> aliased </item>
+ <item> all </item>
+ <item> and </item>
+ <item> array </item>
+ <item> at </item>
+ <item> begin </item>
+ <item> body </item>
+ <item> constant </item>
+ <item> declare </item>
+ <item> delay </item>
+ <item> delta </item>
+ <item> digits </item>
+ <item> do </item>
+ <item> else </item>
+ <item> elsif </item>
+ <item> end </item>
+ <item> entry </item>
+ <item> exception </item>
+ <item> exit </item>
+ <item> for </item>
+ <item> function </item>
+ <item> generic </item>
+ <item> goto </item>
+ <item> in </item>
+ <item> interface </item>
+ <item> is </item>
+ <item> limited </item>
+ <item> mod </item>
+ <item> new </item>
+ <item> not </item>
+ <item> null </item>
+ <item> of </item>
+ <item> or </item>
+ <item> others </item>
+ <item> out </item>
+ <item> overriding </item>
+ <item> package </item>
+ <item> pragma </item>
+ <item> private </item>
+ <item> procedure </item>
+ <item> protected </item>
+ <item> raise </item>
+ <item> range </item>
+ <item> rem </item>
+ <item> record </item>
+ <item> renames </item>
+ <item> requeue </item>
+ <item> return </item>
+ <item> reverse </item>
+ <item> separate </item>
+ <item> subtype </item>
+ <item> tagged </item>
+ <item> task </item>
+ <item> terminate </item>
+ <item> then </item>
+ <item> type </item>
+ <item> until </item>
+ <item> use </item>
+ <item> when </item>
+ <item> while </item>
+ <item> with </item>
+ <item> xor </item>
+ </list>
+ <list name="pragmas">
+ <item> all_calls_remote </item>
+ <item> assert </item>
+ <item> assertion_policy </item>
+ <item> asynchronous </item>
+ <item> atomic </item>
+ <item> atomic_components </item>
+ <item> attach_handler </item>
+ <item> controlled </item>
+ <item> convention </item>
+ <item> detect_blocking </item>
+ <item> discard_names </item>
+ <item> elaborate </item>
+ <item> elaborate_all </item>
+ <item> elaborate_body </item>
+ <item> export </item>
+ <item> import </item>
+ <item> inline </item>
+ <item> inspection_point </item>
+ <item> interrupt_handler </item>
+ <item> interrupt_priority </item>
+ <item> linker_options </item>
+ <item> list </item>
+ <item> locking_policy </item>
+ <item> no_return </item>
+ <item> normalize_scalars </item>
+ <item> optimize </item>
+ <item> pack </item>
+ <item> page </item>
+ <item> partition_elaboration_policy </item>
+ <item> preelaborable_initialization </item>
+ <item> preelaborate </item>
+ <item> priority </item>
+ <item> priority_specific_dispatching </item>
+ <item> profile </item>
+ <item> pure </item>
+ <item> queuing_policy </item>
+ <item> relative_deadline </item>
+ <item> remote_call_interface </item>
+ <item> remote_types </item>
+ <item> restrictions </item>
+ <item> reviewable </item>
+ <item> shared_passive </item>
+ <item> storage_size </item>
+ <item> suppress </item>
+ <item> task_dispatching_policy </item>
+ <item> unchecked_union </item>
+ <item> unsuppress </item>
+ <item> volatile </item>
+ <item> volatile_components </item>
+ </list>
+ <list name="types">
+ <item> boolean </item>
+ <item> char </item>
+ <item> float </item>
+ <item> integer </item>
+ <item> long_float </item>
+ <item> long_integer </item>
+ <item> long_long_float </item>
+ <item> long_long_integer </item>
+ <item> short_float </item>
+ <item> short_integer </item>
+ <item> string </item>
+ <item> wide_string </item>
+ <item> wide_char </item>
+ <item> wide_wide_char </item>
+ <item> wide_wide_string </item>
+ </list>
+ <contexts>
+ <context attribute="Normal Text" lineEndContext="#stay" name="Default">
+ <RegExpr attribute="Keyword" context="#stay" String="if " insensitive="TRUE" beginRegion="Region1" firstNonSpace="true"/>
+ <StringDetect attribute="Keyword" context="#stay" String="end if" insensitive="TRUE" endRegion="Region1"/>
+ <RegExpr attribute="Keyword" context="#stay" String="\sloop\s+" insensitive="TRUE" beginRegion="Region3"/>
+ <RegExpr attribute="Keyword" context="#stay" String="\sloop$" insensitive="TRUE" beginRegion="Region3"/>
+ <StringDetect attribute="Keyword" context="#stay" String="end loop;" insensitive="TRUE" endRegion="Region3"/>
+ <RegExpr attribute="Keyword" context="#stay" String="\sselect\s+" insensitive="TRUE" beginRegion="Region4"/>
+ <RegExpr attribute="Keyword" context="#stay" String="\sselect$" insensitive="TRUE" beginRegion="Region4"/>
+ <StringDetect attribute="Keyword" context="#stay" String="end select;" insensitive="TRUE" endRegion="Region4"/>
+ <RegExpr attribute="Keyword" context="#stay" String="\b(begin|case|record)\b" insensitive="true" beginRegion="Region5"/>
+ <RegExpr attribute="Keyword" context="#stay" String="\bend(?=((\{[^}]*(\}|$)|\(\*.*(\*\)|$))*)([.;\s]|$)|//|$)" insensitive="true" endRegion="Region5"/>
+ <StringDetect attribute="Region Marker" context="Region Marker" String="-- BEGIN" beginRegion="RegionMarker" firstNonSpace="true" />
+ <StringDetect attribute="Region Marker" context="Region Marker" String="-- END" endRegion="RegionMarker" firstNonSpace="true" />
+ <keyword attribute="Keyword" context="#stay" String="keywords"/>
+ <keyword attribute="Pragmas" context="#stay" String="pragmas" />
+ <keyword attribute="Data Type" context="#stay" String="types" />
+ <Float attribute="Float" context="#stay"/>
+ <Int attribute="Decimal" context="#stay"/>
+ <RegExpr attribute="Char" context="#stay" String="'.'"/>
+ <DetectChar attribute="String" context="String" char="&quot;"/>
+ <Detect2Chars attribute="Comment" context="Comment" char="-" char1="-"/>
+ <AnyChar attribute="Symbol" context="#stay" String=":!%&amp;()+,-/.*&lt;=&gt;|"/>
+ </context>
+ <context attribute="Region Marker" lineEndContext="#pop" name="Region Marker"/>
+ <context attribute="String" lineEndContext="#pop" name="String">
+ <DetectChar attribute="String" context="#pop" char="&quot;"/>
+ </context>
+ <context attribute="Comment" lineEndContext="#pop" name="Comment"/>
+ </contexts>
+ <itemDatas>
+ <itemData name="Normal Text" defStyleNum="dsNormal" />
+ <itemData name="Keyword" defStyleNum="dsKeyword" />
+ <itemData name="Pragmas" defStyleNum="dsKeyword" color="#0095ff" selColor="#ffffff" bold="1" italic="0"/>
+ <itemData name="Data Type" defStyleNum="dsDataType"/>
+ <itemData name="Decimal" defStyleNum="dsDecVal" />
+ <itemData name="Base-N" defStyleNum="dsBaseN" />
+ <itemData name="Float" defStyleNum="dsFloat" />
+ <itemData name="Char" defStyleNum="dsChar" />
+ <itemData name="String" defStyleNum="dsString" />
+ <itemData name="Comment" defStyleNum="dsComment" />
+ <itemData name="Symbol" defStyleNum="dsNormal"/>
+ <itemData name="Region Marker" defStyleNum="dsRegionMarker" />
+ </itemDatas>
+ </highlighting>
+ <general>
+ <comments>
+ <comment name="singleLine" start="--" />
+ </comments>
+ <keywords casesensitive="0" />
+ </general>
+</language>
+<!-- kate: space-indent on; indent-width 2; replace-tabs on; -->
diff --git a/kate/data/ahdl.xml b/kate/data/ahdl.xml
new file mode 100644
index 000000000..cf0ab4652
--- /dev/null
+++ b/kate/data/ahdl.xml
@@ -0,0 +1,145 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+<language name="AHDL" version="1.04" kateversion="2.4" section="Hardware" extensions="*.ahdl;*.tdf" mimetype="text/x-ahdl" author="Dominik Haumann (dhdev@gmx.de)" license="LGPL">
+ <highlighting>
+ <list name="keywords">
+ <item> assert </item>
+ <item> bidir </item>
+ <item> bits </item>
+ <item> buried </item>
+ <item> case </item>
+ <item> clique </item>
+ <item> connected_pins </item>
+ <item> constant </item>
+ <item> defaults </item>
+ <item> define </item>
+ <item> design </item>
+ <item> device </item>
+ <item> else </item>
+ <item> elsif </item>
+ <item> for </item>
+ <item> function </item>
+ <item> generate </item>
+ <item> gnd </item>
+ <item> help_id </item>
+ <item> in </item>
+ <item> include </item>
+ <item> input </item>
+ <item> is </item>
+ <item> machine </item>
+ <item> node </item>
+ <item> of </item>
+ <item> options </item>
+ <item> others </item>
+ <item> output </item>
+ <item> parameters </item>
+ <item> returns </item>
+ <item> states </item>
+ <item> subdesign </item>
+ <item> then </item>
+ <item> title </item>
+ <item> to </item>
+ <item> tri_state_node </item>
+ <item> variable </item>
+ <item> vcc </item>
+ <item> when </item>
+ <item> with </item>
+ </list>
+ <list name="types">
+ <item> carry </item>
+ <item> cascade </item>
+ <item> dffe </item>
+ <item> dff </item>
+ <item> exp </item>
+ <item> global </item>
+ <item> jkffe </item>
+ <item> jkff </item>
+ <item> latch </item>
+ <item> lcell </item>
+ <item> mcell </item>
+ <item> memory </item>
+ <item> opendrn </item>
+ <item> soft </item>
+ <item> srffe </item>
+ <item> srff </item>
+ <item> tffe </item>
+ <item> tff </item>
+ <item> tri </item>
+ <item> wire </item>
+ <item> x </item>
+ </list>
+ <list name="operator">
+ <item> not </item>
+ <item> and </item>
+ <item> nand </item>
+ <item> or </item>
+ <item> nor </item>
+ <item> xor </item>
+ <item> xnor </item>
+ <item> mod </item>
+ <item> div </item>
+ <item> log2 </item>
+ <item> used </item>
+ <item> ceil </item>
+ <item> floor </item>
+ </list>
+ <contexts>
+ <context name="normal" attribute="Normal Text" lineEndContext="#stay">
+ <RegExpr attribute="Keyword" context="#stay" String="\bdefaults\b" insensitive="true" beginRegion="def"/>
+ <RegExpr attribute="Keyword" context="#stay" String="\bend\s+defaults\b" insensitive="true" endRegion="def"/>
+ <RegExpr attribute="Keyword" context="#stay" String="\bif\b" insensitive="true" beginRegion="if"/>
+ <RegExpr attribute="Keyword" context="#stay" String="\bend\s+if\b" insensitive="true" endRegion="if"/>
+ <RegExpr attribute="Keyword" context="#stay" String="\btable\b" insensitive="true" beginRegion="table"/>
+ <RegExpr attribute="Keyword" context="#stay" String="\bend\s+table\b" insensitive="true" endRegion="table"/>
+ <RegExpr attribute="Keyword" context="#stay" String="\bcase\b" insensitive="true" beginRegion="case"/>
+ <RegExpr attribute="Keyword" context="#stay" String="\bend\s+case\b" insensitive="true" endRegion="case"/>
+ <RegExpr attribute="Keyword" context="#stay" String="\bbegin\b" insensitive="true" beginRegion="block"/>
+ <RegExpr attribute="Keyword" context="#stay" String="\bend\b" insensitive="true" endRegion="block"/>
+ <DetectChar attribute="Normal Text" context="#stay" char="(" beginRegion="bracket"/>
+ <DetectChar attribute="Normal Text" context="#stay" char=")" endRegion="bracket"/>
+ <keyword attribute="Keyword" context="#stay" String="keywords"/>
+ <keyword attribute="Data Type" context="#stay" String="types"/>
+ <keyword attribute="Operator" context="#stay" String="operator"/>
+ <RegExpr attribute="Decimal" context="#stay" String="\b(\d+)\b" />
+ <RegExpr attribute="Bit" context="#stay" String="\bb&quot;(0|1|x)+&quot;" insensitive="true"/>
+ <RegExpr attribute="Octal" context="#stay" String="\b(o|q)&quot;[0-7*]&quot;" insensitive="true"/>
+ <RegExpr attribute="Hex" context="#stay" String="\b(h|x)&quot;[0-9a-f]*&quot;" insensitive="true"/>
+ <DetectChar attribute="String" context="string" char="&quot;" />
+ <RegExpr attribute="Region Marker" context="#stay" String="--\s*BEGIN.*$" beginRegion="region" firstNonSpace="true"/>
+ <RegExpr attribute="Region Marker" context="#stay" String="--\s*END.*$" endRegion="region" firstNonSpace="true"/>
+ <RegExpr attribute="Comment" context="#stay" String="--.*$" />
+ <DetectChar attribute="Comment" context="comment" char="%" />
+ <HlCChar attribute="Char" context="#stay"/>
+ </context>
+ <context name="string" attribute="String" lineEndContext="#stay" >
+ <Detect2Chars attribute="Char" context="#stay" char="\" char1="&quot;" />
+ <DetectChar attribute="String" context="#pop" char="&quot;" />
+ </context>
+ <context name="comment" attribute="Comment" lineEndContext="#stay" >
+ <DetectChar attribute="Comment" context="#pop" char="%" />
+ </context>
+ </contexts>
+ <itemDatas>
+ <itemData name="Normal Text" defStyleNum="dsNormal" />
+ <itemData name="Keyword" defStyleNum="dsKeyword" />
+ <itemData name="Data Type" defStyleNum="dsDataType" />
+ <itemData name="Comment" defStyleNum="dsComment" />
+ <itemData name="String" defStyleNum="dsString" />
+ <itemData name="Operator" defStyleNum="dsOthers" />
+ <itemData name="Char" defStyleNum="dsChar"/>
+ <itemData name="Bit" defStyleNum="dsDecVal"/>
+ <itemData name="Decimal" defStyleNum="dsDecVal"/>
+ <itemData name="Octal" defStyleNum="dsBaseN"/>
+ <itemData name="Hex" defStyleNum="dsBaseN"/>
+ <itemData name="Region Marker" defStyleNum="dsRegionMarker"/>
+ </itemDatas>
+ </highlighting>
+ <general>
+ <comments>
+ <comment name="singleLine" start="--" />
+ <comment name="multiLine" start="%" end="%" />
+ </comments>
+ <keywords casesensitive="0" />
+ </general>
+</language>
+<!-- kate: space-indent on; indent-width 2; replace-tabs on; -->
diff --git a/kate/data/alert.xml b/kate/data/alert.xml
new file mode 100644
index 000000000..551509662
--- /dev/null
+++ b/kate/data/alert.xml
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+<!--
+ This file is part of KDE's kate project.
+
+ copyright : (C) 2004 by Dominik Haumann
+ email : dhdev at gmx dot de
+
+ **********************************************************************
+ * This library is free software; you can redistribute it and/or *
+ * modify it under the terms of the GNU Library General Public *
+ * License as published by the Free Software Foundation; either *
+ * version 2 of the License, or (at your option) any later version. *
+ * *
+ * This library is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Library General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this library; if not, write to the *
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, *
+ * Boston, MA 02110-1301, USA. *
+ **********************************************************************
+
+ This file is included in every file that highlights the "alerts" keywords.
+ That's why extensions and mimetype are empty.
+-->
+<language version="1.06" kateversion="2.3" name="Alerts" section="Other" extensions="" mimetype="" author="Dominik Haumann (dhdev@gmx.de)" license="LGPL" hidden="true">
+ <highlighting>
+ <list name="alerts">
+ <item> FIXME </item>
+ <item> HACK </item>
+ <item> NOTE </item>
+ <item> NOTICE </item>
+ <item> TASK </item>
+ <item> TODO </item>
+ <item> ### </item>
+ </list>
+ <contexts>
+ <context attribute="Normal Text" lineEndContext="#pop" name="Normal Text" >
+ <keyword attribute="Alert" context="#stay" String="alerts" />
+ </context>
+ </contexts>
+ <itemDatas>
+ <itemData name="Normal Text" defStyleNum="dsNormal"/>
+ <itemData name="Alert" defStyleNum="dsAlert"/>
+ </itemDatas>
+ </highlighting>
+ <general>
+ <keywords casesensitive="1"/>
+ </general>
+</language>
diff --git a/kate/data/ansic89.xml b/kate/data/ansic89.xml
new file mode 100644
index 000000000..2fb3b2d1e
--- /dev/null
+++ b/kate/data/ansic89.xml
@@ -0,0 +1,150 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+<!--
+ This file is part of KDE's kate project.
+
+ copyright : (C) 2004 by Dominik Haumann
+ email : dhdev at gmx dot de
+
+ last change : 2004-03-26
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the
+ Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+
+ -->
+<language name="ANSI C89" version="1.09" kateversion="2.4" section="Sources" extensions="*.c;*.C;*.h" mimetype="text/x-csrc;text/x-c++src;text/x-chdr" priority="2" author="Dominik Haumann (dhdev@gmx.de)" license="LGPL">
+ <highlighting>
+ <list name="keywords">
+ <item> break </item>
+ <item> case </item>
+ <item> continue </item>
+ <item> default </item>
+ <item> do </item>
+ <item> else </item>
+ <item> enum </item>
+ <item> extern </item>
+ <item> for </item>
+ <item> goto </item>
+ <item> if </item>
+ <item> return </item>
+ <item> sizeof </item>
+ <item> struct </item>
+ <item> switch </item>
+ <item> typedef </item>
+ <item> union </item>
+ <item> while </item>
+ </list>
+ <list name="types">
+ <item> auto </item>
+ <item> char </item>
+ <item> const </item>
+ <item> double </item>
+ <item> float </item>
+ <item> int </item>
+ <item> long </item>
+ <item> register </item>
+ <item> short </item>
+ <item> signed </item>
+ <item> static </item>
+ <item> unsigned </item>
+ <item> void </item>
+ <item> volatile </item>
+ </list>
+ <contexts>
+ <context attribute="Normal Text" lineEndContext="#stay" name="Normal">
+ <DetectSpaces />
+ <RegExpr attribute="Preprocessor" context="Outscoped" String="#\s*if\s+0" beginRegion="Outscoped" firstNonSpace="true" />
+ <DetectChar attribute="Preprocessor" context="Preprocessor" char="#" firstNonSpace="true" />
+ <keyword attribute="Keyword" context="#stay" String="keywords"/>
+ <keyword attribute="Data Type" context="#stay" String="types"/>
+ <DetectIdentifier />
+ <DetectChar attribute="Symbol" context="#stay" char="{" beginRegion="Brace1" />
+ <DetectChar attribute="Symbol" context="#stay" char="}" endRegion="Brace1" />
+ <Float attribute="Float" context="#stay">
+ <AnyChar String="fF" attribute="Float" context="#stay"/>
+ </Float>
+ <HlCOct attribute="Octal" context="#stay"/>
+ <HlCHex attribute="Hex" context="#stay"/>
+ <Int attribute="Decimal" context="#stay" >
+ <StringDetect attribute="Decimal" context="#stay" String="ULL" insensitive="TRUE"/>
+ <StringDetect attribute="Decimal" context="#stay" String="LUL" insensitive="TRUE"/>
+ <StringDetect attribute="Decimal" context="#stay" String="LLU" insensitive="TRUE"/>
+ <StringDetect attribute="Decimal" context="#stay" String="UL" insensitive="TRUE"/>
+ <StringDetect attribute="Decimal" context="#stay" String="LU" insensitive="TRUE"/>
+ <StringDetect attribute="Decimal" context="#stay" String="LL" insensitive="TRUE"/>
+ <StringDetect attribute="Decimal" context="#stay" String="U" insensitive="TRUE"/>
+ <StringDetect attribute="Decimal" context="#stay" String="L" insensitive="TRUE"/>
+ </Int>
+ <HlCChar attribute="Char" context="#stay"/>
+ <DetectChar attribute="String" context="String" char="&quot;"/>
+ <Detect2Chars attribute="Comment" context="comment" char="/" char1="*" beginRegion="blockcomment"/>
+ <AnyChar attribute="Symbol" context="#stay" String=":!%&amp;()+,-/.*&lt;=&gt;?[]|~^&#59;"/>
+ </context>
+ <context attribute="String" lineEndContext="#pop" name="String">
+ <LineContinue attribute="String" context="#stay"/>
+ <HlCStringChar attribute="String Char" context="#stay"/>
+ <DetectChar attribute="String" context="#pop" char="&quot;"/>
+ </context>
+ <context attribute="Comment" lineEndContext="#stay" name="comment">
+ <Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" endRegion="blockcomment"/>
+ <IncludeRules context="##Alerts" />
+ </context>
+ <context attribute="Preprocessor" lineEndContext="#pop" name="Preprocessor">
+ <LineContinue attribute="Preprocessor" context="#stay"/>
+ <RegExpr attribute="Preprocessor" context="Define" String="define.*((?=\\))"/>
+ <RegExpr attribute="Preprocessor" context="#stay" String="define.*"/>
+ <RangeDetect attribute="Prep. Lib" context="#stay" char="&quot;" char1="&quot;"/>
+ <RangeDetect attribute="Prep. Lib" context="#stay" char="&lt;" char1="&gt;"/>
+ <Detect2Chars attribute="Comment" context="comment" char="/" char1="*" beginRegion="blockcomment"/>
+ </context>
+ <context attribute="Preprocessor" lineEndContext="#pop" name="Define">
+ <LineContinue attribute="Preprocessor" context="#stay"/>
+ </context>
+ <context attribute="Comment" lineEndContext="#stay" name="Outscoped" >
+ <Detect2Chars attribute="Comment" context="comment" char="/" char1="*" beginRegion="Comment"/>
+ <IncludeRules context="##Alerts" />
+ <RegExpr attribute="Comment" context="Outscoped intern" String="#\s*if" beginRegion="Outscoped" firstNonSpace="true" />
+ <RegExpr attribute="Preprocessor" context="#pop" String="#\s*(endif|else|elif)" endRegion="Outscoped" firstNonSpace="true" />
+ </context>
+ <context attribute="Comment" lineEndContext="#stay" name="Outscoped intern">
+ <Detect2Chars attribute="Comment" context="comment" char="/" char1="*" beginRegion="Comment"/>
+ <RegExpr attribute="Comment" context="Outscoped intern" String="#\s*if" beginRegion="Outscoped" firstNonSpace="true" />
+ <RegExpr attribute="Comment" context="#pop" String="#\s*endif" endRegion="Outscoped" firstNonSpace="true" />
+ </context>
+ </contexts>
+ <itemDatas>
+ <itemData name="Normal Text" defStyleNum="dsNormal"/>
+ <itemData name="Keyword" defStyleNum="dsKeyword"/>
+ <itemData name="Data Type" defStyleNum="dsDataType"/>
+ <itemData name="Decimal" defStyleNum="dsDecVal"/>
+ <itemData name="Octal" defStyleNum="dsBaseN"/>
+ <itemData name="Hex" defStyleNum="dsBaseN"/>
+ <itemData name="Float" defStyleNum="dsFloat"/>
+ <itemData name="Char" defStyleNum="dsChar"/>
+ <itemData name="String" defStyleNum="dsString"/>
+ <itemData name="String Char" defStyleNum="dsChar"/>
+ <itemData name="Comment" defStyleNum="dsComment"/>
+ <itemData name="Symbol" defStyleNum="dsNormal"/>
+ <itemData name="Preprocessor" defStyleNum="dsOthers"/>
+ <itemData name="Prep. Lib" defStyleNum="dsOthers"/>
+ </itemDatas>
+ </highlighting>
+ <general>
+ <comments>
+ <comment name="multiLine" start="/*" end="*/" />
+ </comments>
+ <keywords casesensitive="1" />
+ </general>
+</language>
diff --git a/kate/data/apache.xml b/kate/data/apache.xml
new file mode 100644
index 000000000..2441f1abf
--- /dev/null
+++ b/kate/data/apache.xml
@@ -0,0 +1,630 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+
+<!-- Changelog:
+
+v1.1:
+- improved Syntax
+- added support for Apache 2.2 Directives
+- .ht* files may now automaticaly be highlighted
+
+v1.0:
+- first Release
+-->
+
+<language name="Apache Configuration" section="Configuration" extensions="httpd.conf;httpd2.conf;apache.conf;apache2.conf;.ht*" mimetype="" version="1.10" author="Jan Janssen (medhefgo@googlemail.com)" license="LGPL">
+
+<highlighting>
+<list name="String Directives">
+<item>AcceptFilter</item>
+<item>AccessFileName</item>
+<item>Action</item>
+<item>AddAlt</item>
+<item>AddAltByEncoding</item>
+<item>AddAltByType</item>
+<item>AddCharset</item>
+<item>AddDefaultCharset</item>
+<item>AddDescription</item>
+<item>AddEncoding</item>
+<item>AddHandler</item>
+<item>AddIcon</item>
+<item>AddIconByEncoding</item>
+<item>AddIconByType</item>
+<item>AddInputFilter</item>
+<item>AddLanguage</item>
+<item>AddModuleInfo</item>
+<item>AddOutputFilter</item>
+<item>AddOutputFilterByType</item>
+<item>AddType</item>
+<item>Alias</item>
+<item>AliasMatch</item>
+<item>Allow</item>
+<item>Anonymous</item>
+<item>AuthBasicProvider</item>
+<item>AuthDBMGroupFile</item>
+<item>AuthDBMUserFile</item>
+<item>AuthDigestDomain</item>
+<item>AuthDigestFile</item>
+<item>AuthDigestGroupFile</item>
+<item>AuthDigestNonceFormat</item>
+<item>AuthDigestProvider</item>
+<item>AuthGroupFile</item>
+<item>AuthLDAPBindDN</item>
+<item>AuthLDAPBindPassword</item>
+<item>AuthLDAPCharsetConfig</item>
+<item>AuthLDAPGroupAttribute</item>
+<item>AuthLDAPUrl</item>
+<item>AuthName</item>
+<item>AuthUserFile</item>
+<item>BrowserMatch</item>
+<item>BrowserMatchNoCase</item>
+<item>BS2000Account</item>
+<item>CacheDisable</item>
+<item>CacheEnable</item>
+<item>CacheFile</item>
+<item>CacheGcClean</item>
+<item>CacheGcUnused</item>
+<item>CacheRoot</item>
+<item>CGIMapExtension</item>
+<item>CharsetDefault</item>
+<item>CharsetOptions</item>
+<item>CharsetSourceEnc</item>
+<item>CookieDomain</item>
+<item>CookieLog</item>
+<item>CookieName</item>
+<item>CoreDumpDirectory</item>
+<item>CustomLog</item>
+<item>Dav</item>
+<item>DavGenericLockDB</item>
+<item>DavLockDB</item>
+<item>DBDParams</item>
+<item>DBDPrepareSQL</item>
+<item>DBDriver</item>
+<item>DefaultIcon</item>
+<item>DefaultLanguage</item>
+<item>DefaultType</item>
+<item>DeflateFilterNote</item>
+<item>Deny</item>
+<item>DirectoryIndex</item>
+<item>DocumentRoot</item>
+<item>ErrorDocument</item>
+<item>ErrorLog</item>
+<item>Example</item>
+<item>ExpiresByType</item>
+<item>ExpiresDefault</item>
+<item>ExtFilterDefine</item>
+<item>ExtFilterOptions</item>
+<item>FilterChain</item>
+<item>FilterDeclare</item>
+<item>FilterProtocol</item>
+<item>FilterProvider</item>
+<item>FilterTrace</item>
+<item>ForceType</item>
+<item>ForensicLog</item>
+<item>Group</item>
+<item>Header</item>
+<item>HeaderName</item>
+<item>ImapBase</item>
+<item>Include</item>
+<item>IndexIgnore</item>
+<item>IndexOptions</item>
+<item>IndexStyleSheet</item>
+<item>ISAPICacheFile</item>
+<item>LanguagePriority</item>
+<item>LDAPSharedCacheFile</item>
+<item>LDAPTrustedCA</item>
+<item>LDAPTrustedCAType</item>
+<item>LDAPTrustedClientCert</item>
+<item>LDAPTrustedGlobalCert</item>
+<item>Listen</item>
+<item>LoadFile</item>
+<item>LoadModule</item>
+<item>LockFile</item>
+<item>LogFormat</item>
+<item>MetaDir</item>
+<item>MetaSuffix</item>
+<item>MimeMagicFile</item>
+<item>MMapFile</item>
+<item>NameVirtualHost</item>
+<item>NoProxy</item>
+<item>NWSSLTrustedCerts</item>
+<item>NWSSLUpgradeable</item>
+<item>PassEnv</item>
+<item>PidFile</item>
+<item>ProxyBlock</item>
+<item>ProxyDomain</item>
+<item>ProxyPass</item>
+<item>ProxyPassReverse</item>
+<item>ProxyPassReverseCookieDomain</item>
+<item>ProxyPassReverseCookiePath</item>
+<item>ProxyRemote</item>
+<item>ProxyRemoteMatch</item>
+<item>ReadmeName</item>
+<item>Redirect</item>
+<item>RedirectMatch</item>
+<item>RedirectPermanent</item>
+<item>RedirectTemp</item>
+<item>RemoveCharset</item>
+<item>RemoveEncoding</item>
+<item>RemoveHandler</item>
+<item>RemoveInputFilter</item>
+<item>RemoveLanguage</item>
+<item>RemoveOutputFilter</item>
+<item>RemoveType</item>
+<item>RequestHeader</item>
+<item>Require</item>
+<item>RewriteBase</item>
+<item>RewriteCond</item>
+<item>RewriteLock</item>
+<item>RewriteLog</item>
+<item>RewriteMap</item>
+<item>RewriteRule</item>
+<item>ScoreBoardFile</item>
+<item>Script</item>
+<item>ScriptAlias</item>
+<item>ScriptAliasMatch</item>
+<item>ScriptLog</item>
+<item>ScriptSock</item>
+<item>SecureListen</item>
+<item>ServerAdmin</item>
+<item>ServerAlias</item>
+<item>ServerName</item>
+<item>ServerPath</item>
+<item>ServerRoot</item>
+<item>SetEnv</item>
+<item>SetEnvIf</item>
+<item>SetEnvIfNoCase</item>
+<item>SetHandler</item>
+<item>SetInputFilter</item>
+<item>SetOutputFilter</item>
+<item>SSIEndTag</item>
+<item>SSIErrorMsg</item>
+<item>SSIStartTag</item>
+<item>SSITimeFormat</item>
+<item>SSIUndefinedEcho</item>
+<item>SSLCACertificateFile</item>
+<item>SSLCACertificatePath</item>
+<item>SSLCADNRequestFile</item>
+<item>SSLCADNRequestPath</item>
+<item>SSLCARevocationFile</item>
+<item>SSLCARevocationPath</item>
+<item>SSLCertificateChainFile</item>
+<item>SSLCertificateFile</item>
+<item>SSLCertificateKeyFile</item>
+<item>SSLCipherSuite</item>
+<item>SSLCryptoDevice</item>
+<item>SSLHonorCiperOrder</item>
+<item>SSLPassPhraseDialog</item>
+<item>SSLProxyCACertificateFile</item>
+<item>SSLProxyCACertificatePath</item>
+<item>SSLProxyCARevocationFile</item>
+<item>SSLProxyCARevocationPath</item>
+<item>SSLProxyCipherSuite</item>
+<item>SSLProxyMachineCertificateFile</item>
+<item>SSLProxyMachineCertificatePath</item>
+<item>SSLProxyProtocol</item>
+<item>SSLRandomSeed</item>
+<item>SSLRequire</item>
+<item>SSLRequireSSL</item>
+<item>SSLUserName</item>
+<item>SuexecUserGroup</item>
+<item>TransferLog</item>
+<item>TypesConfig</item>
+<item>UnsetEnv</item>
+<item>User</item>
+<item>UserDir</item>
+<item>VirtualDocumentRoot</item>
+<item>VirtualDocumentRootIP</item>
+<item>VirtualScriptAlias</item>
+<item>VirtualScriptAliasIP</item>
+<item>Win32DisableAcceptEx</item>
+</list>
+
+<list name="Integer Directives">
+<item>AllowCONNECT</item>
+<item>AssignUserID</item>
+<item>AuthDigestNonceLifetime</item>
+<item>AuthDigestShmemSize</item>
+<item>CacheDefaultExpire</item>
+<item>CacheDirLength</item>
+<item>CacheDirLevels</item>
+<item>CacheForceCompletion</item>
+<item>CacheGcDaily</item>
+<item>CacheGcInterval</item>
+<item>CacheGcMemUsage</item>
+<item>CacheLastModifiedFactor</item>
+<item>CacheMaxExpire</item>
+<item>CacheMaxFileSize</item>
+<item>CacheMinFileSize</item>
+<item>CacheSize</item>
+<item>CacheTimeMargin</item>
+<item>ChildPerUserID</item>
+<item>CookieExpires</item>
+<item>DavMinTimeout</item>
+<item>DBDExptime</item>
+<item>DBDKeep</item>
+<item>DBDMax</item>
+<item>DBDMin</item>
+<item>DBDPersist</item>
+<item>DeflateBufferSize</item>
+<item>DeflateCompressionLevel</item>
+<item>DeflateMemLevel</item>
+<item>DeflateWindowSize</item>
+<item>IdentityCheckTimeout</item>
+<item>ISAPIReadAheadBuffer</item>
+<item>KeepAliveTimeout</item>
+<item>LDAPCacheEntries</item>
+<item>LDAPCacheTTL</item>
+<item>LDAPConnectionTimeout</item>
+<item>LDAPOpCacheEntries</item>
+<item>LDAPOpCacheTTL</item>
+<item>LDAPSharedCacheSize</item>
+<item>LimitInternalRecursion</item>
+<item>LimitRequestBody</item>
+<item>LimitRequestFields</item>
+<item>LimitRequestFieldsize</item>
+<item>LimitRequestLine</item>
+<item>LimitXMLRequestBody</item>
+<item>ListenBacklog</item>
+<item>MaxClients</item>
+<item>MaxKeepAliveRequests</item>
+<item>MaxMemFree</item>
+<item>MaxRequestsPerChild</item>
+<item>MaxRequestsPerThread</item>
+<item>MaxSpareServers</item>
+<item>MaxSpareThreads</item>
+<item>MaxThreads</item>
+<item>MaxThreadsPerChild</item>
+<item>MCacheMaxObjectCount</item>
+<item>MCacheMaxObjectSize</item>
+<item>MCacheMaxStreamingBuffer</item>
+<item>MCacheMinObjectSize</item>
+<item>MCacheSize</item>
+<item>MinSpareServers</item>
+<item>MinSpareThreads</item>
+<item>NumServers</item>
+<item>ProxyIOBufferSize</item>
+<item>ProxyMaxForwards</item>
+<item>ProxyReceiveBufferSize</item>
+<item>ProxyTimeout</item>
+<item>RewriteLogLevel</item>
+<item>RLimitCPU</item>
+<item>RLimitMEM</item>
+<item>RLimitNPROC</item>
+<item>ScriptLogBuffer</item>
+<item>ScriptLogLength</item>
+<item>SendBufferSize</item>
+<item>ServerLimit</item>
+<item>SSLProxyVerifyDepth</item>
+<item>SSLSessionCacheTimeout</item>
+<item>SSLVerifyDepth</item>
+<item>StartServers</item>
+<item>StartThreads</item>
+<item>ThreadLimit</item>
+<item>ThreadsPerChild</item>
+<item>ThreadStackSize</item>
+<item>TimeOut</item>
+</list>
+
+<list name="Alternative Directives">
+<item>AcceptMutex</item>
+<item>AcceptPathInfo</item>
+<item>AllowEncodedSlashes</item>
+<item>AllowOverride</item>
+<item>Anonymous_Authoritative</item>
+<item>Anonymous_LogEmail</item>
+<item>Anonymous_MustGiveEmail</item>
+<item>Anonymous_NoUserID</item>
+<item>Anonymous_VerifyEmail</item>
+<item>AuthAuthoritative</item>
+<item>AuthBasicAuthoritative</item>
+<item>AuthBasicProvider</item>
+<item>AuthDBMAuthoritative</item>
+<item>AuthDBMType</item>
+<item>AuthDefaultAuthoritative</item>
+<item>AuthDigestAlgorithm</item>
+<item>AuthDigestNcCheck</item>
+<item>AuthDigestQop</item>
+<item>AuthLDAPAuthoritative</item>
+<item>AuthLDAPCompareDNOnServer</item>
+<item>AuthLDAPDereferenceAliases</item>
+<item>AuthLDAPEnabled</item>
+<item>AuthLDAPFrontPageHack</item>
+<item>AuthLDAPGroupAttributeIsDN</item>
+<item>AuthLDAPRemoteUserIsDN</item>
+<item>AuthType</item>
+<item>AuthzDBMAuthoritative</item>
+<item>AuthzDBMType</item>
+<item>AuthzDefaultAuthoritative</item>
+<item>AuthzGroupFileAuthoritative</item>
+<item>AuthzLDAPAuthoritative</item>
+<item>AuthzOwnerAuthoritative</item>
+<item>AuthzUserAuthoritative</item>
+<item>BufferedLogs</item>
+<item>CacheExpiryCheck</item>
+<item>CacheIgnoreCacheControl</item>
+<item>CacheIgnoreHeaders</item>
+<item>CacheIgnoreNoLastMod</item>
+<item>CacheNegotiatedDocs</item>
+<item>CacheStoreNoStore</item>
+<item>CacheStorePrivate</item>
+<item>CheckSpelling</item>
+<item>ContentDigest</item>
+<item>CookieStyle</item>
+<item>CookieTracking</item>
+<item>CoreDumpDirectory</item>
+<item>CustomLog</item>
+<item>DavDepthInfinity</item>
+<item>DirectorySlash</item>
+<item>DumpIOInput</item>
+<item>DumpIOOutput</item>
+<item>EnableExceptionHook</item>
+<item>EnableMMAP</item>
+<item>EnableSendfile</item>
+<item>ExpiresActive</item>
+<item>ExtendedStatus</item>
+<item>FileETag</item>
+<item>ForceLanguagePriority</item>
+<item>HostnameLookups</item>
+<item>IdentityCheck</item>
+<item>ImapDefault</item>
+<item>ImapMenu</item>
+<item>IndexOrderDefault</item>
+<item>ISAPIAppendLogToErrors</item>
+<item>ISAPIAppendLogToQuery</item>
+<item>ISAPIFakeAsync</item>
+<item>ISAPILogNotSupported</item>
+<item>KeepAlive</item>
+<item>LDAPTrustedMode</item>
+<item>LDAPVerifyServerCert</item>
+<item>LogLevel</item>
+<item>MCacheRemovalAlgorithm</item>
+<item>MetaFiles</item>
+<item>ModMimeUsePathInfo</item>
+<item>MultiviewsMatch</item>
+<item>Options</item>
+<item>Order</item>
+<item>ProtocolEcho</item>
+<item>ProxyBadHeader</item>
+<item>ProxyErrorOverride</item>
+<item>ProxyPreserveHost</item>
+<item>ProxyRequests</item>
+<item>ProxyVia</item>
+<item>RewriteEngine</item>
+<item>RewriteOptions</item>
+<item>Satisfy</item>
+<item>ScriptInterpreterSource</item>
+<item>ServerSignature</item>
+<item>ServerTokens</item>
+<item>SSLEngine</item>
+<item>SSLMutex</item>
+<item>SSLOptions</item>
+<item>SSLProtocol</item>
+<item>SSLProxyEngine</item>
+<item>SSLProxyVerify</item>
+<item>SSLSessionCache</item>
+<item>SSLVerifyClient</item>
+<item>UseCanonicalName</item>
+<item>XBitHack</item>
+</list>
+
+<list name="Alternates">
+<item>On</item>
+<item>Off</item>
+<item>Default</item>
+<item>flock</item>
+<item>fcntl</item>
+<item>posixsem</item>
+<item>pthread</item>
+<item>sysvsem</item>
+<item>All</item>
+<item>None</item>
+<item>AuthConfig</item>
+<item>FileInfo</item>
+<item>Indexes</item>
+<item>Limit</item>
+<item>Options</item>
+
+<item>ExecCGI</item>
+<item>FollowSymLinks</item>
+<item>Includes</item>
+<item>IncludesNOEXEC</item>
+<item>Indexes</item>
+<item>MultiViews</item>
+<item>SymLinksIfOwnerMatch</item>
+<item>StdEnvVars</item>
+<item>CompatEnvVars</item>
+<item>ExportCertData</item>
+<item>FakeBasicAuth</item>
+<item>StrictRequire</item>
+<item>OptRenegotiate</item>
+
+<item>SDBM</item>
+<item>GDBM</item>
+<item>NDBM</item>
+<item>DB</item>
+<item>MD5</item>
+<item>MD5-sess</item>
+<item>auth</item>
+<item>auth-int</item>
+<item>never</item>
+<item>searching</item>
+<item>finding</item>
+<item>always</item>
+<item>Basic</item>
+<item>Digest</item>
+<item>Connection</item>
+<item>Keep-Alive</item>
+<item>Proxy-Authenticate</item>
+<item>Proxy-Authorization</item>
+<item>TE</item>
+<item>Trailers</item>
+<item>Transfer-Encoding</item>
+<item>Upgrade</item>
+<item>Netscape</item>
+<item>Cookie</item>
+<item>Cookie2</item>
+<item>RFC2109</item>
+<item>RFC2965</item>
+<item>INode</item>
+<item>MTime</item>
+<item>Size</item>
+<item>Prefer</item>
+<item>Fallback</item>
+<item>Double</item>
+<item>error</item>
+<item>nocontent</item>
+<item>map</item>
+<item>referer</item>
+<item>formatted</item>
+<item>semiformatted</item>
+<item>unformatted</item>
+<item>Ascending</item>
+<item>Descending</item>
+<item>Name</item>
+<item>Date</item>
+<item>Size</item>
+<item>Description</item>
+<item>SSL</item>
+<item>TLS</item>
+<item>STARTTLS</item>
+<item>emerg</item>
+<item>alert</item>
+<item>crit</item>
+<item>error</item>
+<item>warn</item>
+<item>notice</item>
+<item>info</item>
+<item>debug</item>
+<item>LRU</item>
+<item>GDSF</item>
+<item>Any</item>
+<item>NegotiatedOnly</item>
+<item>Filters</item>
+<item>Handlers</item>
+<item>Deny,Allow</item>
+<item>Allow,Deny</item>
+<item>Mutual-failure</item>
+<item>IsError</item>
+<item>Ignore</item>
+<item>StartBody</item>
+<item>Full</item>
+<item>Block</item>
+<item>inherit</item>
+<item>Registry</item>
+<item>Registry-Strict</item>
+<item>Script</item>
+<item>EMail</item>
+<item>Major</item>
+<item>Minor</item>
+<item>Min</item>
+<item>Minimal</item>
+<item>Prod</item>
+<item>ProductOnly</item>
+<item>OS</item>
+<item>Full</item>
+<item>optional</item>
+<item>posixsem</item>
+<item>sysvsem</item>
+<item>sem</item>
+<item>pthread</item>
+<item>fcntl:</item>
+<item>flock:</item>
+<item>file:</item>
+<item>yes</item>
+<item>no</item>
+<item>SSLv2</item>
+<item>SSLv3</item>
+<item>TLSv1</item>
+<item>require</item>
+<item>optional_no_ca</item>
+<item>nonenotnull</item>
+<item>dbm:</item>
+<item>shm:</item>
+<item>dc:</item>
+<item>DNS</item>
+</list>
+
+
+<contexts>
+ <context name="apache" attribute="Normal Text" lineEndContext="#stay">
+ <keyword context="String Directives" String="String Directives" />
+ <keyword attribute="Directives" context="Integer Directives" String="Integer Directives" />
+ <keyword attribute="Directives" context="Alternative Directives" String="Alternative Directives" />
+
+ <RegExpr attribute="Container" context="Container Open" String="&lt;\w+" beginRegion="Container" />
+ <RegExpr attribute="Container" context="Container Close" String="&lt;/\w+" endRegion="Container" />
+ <DetectChar attribute="Comment" context="Comment" char="#" firstNonSpace="true" />
+ </context>
+
+ <!-- Directives - separated after String, Integer and Alternatives -->
+ <context name="String Directives" attribute="Directives" lineEndContext="#pop">
+ <RegExpr attribute="String" context="#stay" String="[^#]*" />
+ <IncludeRules context="Comment Alert" />
+ </context>
+
+ <context name="Integer Directives" attribute="Other" lineEndContext="#pop">
+ <Float attribute="Float" context="Integer Directives" />
+ <Int attribute="Int" context="Integer Directives" />
+ <IncludeRules context="Comment Alert" />
+ </context>
+
+ <context name="Alternative Directives" attribute="Other" lineEndContext="#pop">
+ <keyword attribute="Alternates" context="#stay" String="Alternates" />
+ <DetectChar attribute="Alternates" context="#stay" char="-" />
+ <DetectChar attribute="Alternates" context="#stay" char="+" />
+ <IncludeRules context="Comment Alert" />
+ </context>
+
+<!-- Other -->
+ <context name="Comment" attribute="Comment" lineEndContext="#pop">
+ <DetectSpaces />
+ <IncludeRules context="##Alerts" />
+ <DetectIdentifier />
+ </context>
+
+<!-- Container -->
+ <context name="Container Open" attribute="Container" lineEndContext="#pop">
+ <DetectChar attribute="Container" context="Alert" char="&gt;" />
+ <RegExpr attribute="Attribute" context="#stay" String="[^#&gt;]*" />
+ <IncludeRules context="Comment Alert" />
+ </context>
+
+ <context name="Container Close" attribute="Container" lineEndContext="#pop">
+ <DetectChar attribute="Container" context="Alert" char="&gt;" />
+ </context>
+
+<!-- Alerts -->
+ <context name="Comment Alert" attribute="Normal Text" lineEndContext="#pop">
+ <DetectChar attribute="Alert" context="Alert" char="#" />
+ </context>
+
+ <context name="Alert" attribute="Alert" lineEndContext="#pop" />
+</contexts>
+
+<itemDatas>
+ <itemData name="Normal Text" defStyleNum="dsNormal" />
+ <itemData name="Comment" defStyleNum="dsComment" />
+ <itemData name="Directives" defStyleNum="dsOthers" color="#0000FF" selColor="#0000FF" bold="true" italic="false" />
+ <itemData name="String" defStyleNum="dsString" />
+ <itemData name="Float" defStyleNum="dsFloat" />
+ <itemData name="Int" defStyleNum="dsFloat" />
+ <itemData name="Alternates" defStyleNum="dsKeyword" />
+ <itemData name="Alert" defStyleNum="dsError" />
+ <itemData name="Container" defStyleNum="dsFunction" />
+ <itemData name="Attribute" defStyleNum="dsOthers" />
+ <itemData name="Other" defStyleNum="dsChar" />
+</itemDatas>
+</highlighting>
+
+
+<general>
+ <comments>
+ <comment name="singleLine" start="#" />
+ </comments>
+ <keywords casesensitive="0" weakDeliminator="," />
+</general>
+
+</language>
+
+
diff --git a/kate/data/asm-avr.xml b/kate/data/asm-avr.xml
new file mode 100644
index 000000000..b9c377191
--- /dev/null
+++ b/kate/data/asm-avr.xml
@@ -0,0 +1,208 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+<!--
+
+*************************************************************************
+* *
+* Syntax highlighting for the AVR Assembler *
+* Copyright (C) 2004, Roland Nagy *
+* *
+*************************************************************************
+
+Author: Rolanf Nagy <R.Nagy@pknc.com>
+Date: 18th May, 2004
+Version: 1.0
+
+This file contains the XML syntax highlighting description for the AVR
+Assembler, for KATE, the KDE Advanced Editor. Keywords have been taken
+directly from the AVR Assembler source code.
+
+This program, including associated files, is free software. You may
+distribute it and/or modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either Version 2 of
+the license, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License along
+with this program; if not, write to the Free Software Foundation, Inc.,
+51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+-->
+
+<language name="AVR Assembler" version="1.03" kateversion="2.4" section="Assembler" extensions="*.asm;*.ASM;*.asm-avr" mimetype="text/x-asm;text/x-asm-avr" author="Roland Nagy" license="GPL">
+ <highlighting>
+ <list name="keywords">
+ <item> adc</item>
+ <item> add</item>
+ <item> adiw</item>
+ <item> and</item>
+ <item> andi</item>
+ <item> asr</item>
+ <item> bclr</item>
+ <item> bld</item>
+ <item> brbc</item>
+ <item> brbs</item>
+ <item> break</item>
+ <item> breq</item>
+ <item> brge</item>
+ <item> brhc</item>
+ <item> brhs</item>
+ <item> brid</item>
+ <item> brie</item>
+ <item> brlo</item>
+ <item> brlt</item>
+ <item> brmi</item>
+ <item> brne</item>
+ <item> brpl</item>
+ <item> brsh</item>
+ <item> brtc</item>
+ <item> brts</item>
+ <item> brvc</item>
+ <item> brvs</item>
+ <item> bset</item>
+ <item> bst</item>
+ <item> call</item>
+ <item> cbi</item>
+ <item> cbr</item>
+ <item> clc</item>
+ <item> clh</item>
+ <item> cli</item>
+ <item> cln</item>
+ <item> clr</item>
+ <item> cls</item>
+ <item> clt</item>
+ <item> clv</item>
+ <item> clz</item>
+ <item> com</item>
+ <item> cp</item>
+ <item> cpc</item>
+ <item> cpi</item>
+ <item> cpse</item>
+ <item> dec</item>
+ <item> eicall</item>
+ <item> eijmp</item>
+ <item> elpm</item>
+ <item> eor</item>
+ <item> fmul</item>
+ <item> fmuls</item>
+ <item> fmulsu</item>
+ <item> icall</item>
+ <item> ijmp</item>
+ <item> in</item>
+ <item> inc</item>
+ <item> jmp</item>
+ <item> ld</item>
+ <item> ldi</item>
+ <item> lds</item>
+ <item> lpm</item>
+ <item> lsl</item>
+ <item> lsr</item>
+ <item> mov</item>
+ <item> movw</item>
+ <item> mul</item>
+ <item> muls</item>
+ <item> mulsu</item>
+ <item> neg</item>
+ <item> nop</item>
+ <item> or</item>
+ <item> ori</item>
+ <item> out</item>
+ <item> pop</item>
+ <item> push</item>
+ <item> rcall</item>
+ <item> ret</item>
+ <item> reti</item>
+ <item> rjmp</item>
+ <item> rol</item>
+ <item> ror</item>
+ <item> sbc</item>
+ <item> sbr</item>
+ <item> sbrc</item>
+ <item> sbrs</item>
+ <item> sec</item>
+ <item> seh</item>
+ <item> sbi</item>
+ <item> sbci</item>
+ <item> sbic</item>
+ <item> sbis</item>
+ <item> sbiw</item>
+ <item> sei</item>
+ <item> sen</item>
+ <item> ser</item>
+ <item> ses</item>
+ <item> set</item>
+ <item> sev</item>
+ <item> sez</item>
+ <item> sleep</item>
+ <item> spm</item>
+ <item> st</item>
+ <item> sts</item>
+ <item> sub</item>
+ <item> subi</item>
+ <item> swap</item>
+ <item> tst</item>
+ <item> wdr</item>
+ </list>
+
+ <contexts>
+ <context attribute="Normal Text" lineEndContext="#stay" name="Normal">
+ <RegExpr attribute="Label" context="#stay" String="[A-Za-z0-9_.$]+:" firstNonSpace="true"/>
+ <keyword attribute="Keyword" context="#stay" String="keywords"/>
+ <HlCOct attribute="Octal" context="#stay" />
+ <HlCHex attribute="Hex" context="#stay" />
+ <RegExpr attribute="Binary" context="#stay" String="0[bB][01]+" />
+ <Int attribute="Decimal" context="#stay" />
+ <RegExpr attribute="Float" context="#stay" String="0[fFeEdD][-+]?[0-9]*\.?[0-9]*[eE]?[-+]?[0-9]+" />
+ <RegExpr attribute="Normal Text" context="#stay" String="[A-Za-z_.$][A-Za-z0-9_.$]*" />
+ <RegExpr attribute="Char" context="#stay" String="'(\\x[0-9a-fA-F][0-9a-fA-F]?|\\[0-7]?[0-7]?[0-7]?|\\.|.)" />
+ <DetectChar attribute="String" context="String" char="&quot;" />
+ <Detect2Chars attribute="Comment" context="Commentar 1" char="/" char1="*" />
+ <DetectChar attribute="Comment" context="Commentar 2" char="@" />
+ <DetectChar attribute="Comment" context="Commentar 2" char=";" />
+ <AnyChar attribute="Symbol" context="#stay" String="!#%&amp;*()+,-&lt;=&gt;?/:[]^{|}~" />
+ <RegExpr attribute="Preprocessor" context="Preprocessor" String="^#" />
+ </context>
+ <context attribute="Comment" lineEndContext="#stay" name="Commentar 1">
+ <Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" />
+ </context>
+ <context attribute="Comment" lineEndContext="#pop" name="Commentar 2" />
+ <context attribute="Preprocessor" lineEndContext="#pop" name="Preprocessor" />
+ <context attribute="String" lineEndContext="#pop" name="String">
+ <LineContinue attribute="String" context="Some Context" />
+ <HlCStringChar attribute="String Char" context="#stay" />
+ <DetectChar attribute="String" context="#pop" char="&quot;" />
+ </context>
+ <context attribute="Normal Text" lineEndContext="#pop" name="Some Context" />
+ </contexts>
+
+ <itemDatas>
+ <itemData name="Normal Text" defStyleNum="dsNormal" />
+ <itemData name="Label" defStyleNum="dsFunction" />
+ <itemData name="Keyword" defStyleNum="dsKeyword" />
+ <itemData name="Decimal" defStyleNum="dsDecVal" />
+ <itemData name="Octal" defStyleNum="dsBaseN" />
+ <itemData name="Hex" defStyleNum="dsBaseN" />
+ <itemData name="Binary" defStyleNum="dsBaseN" />
+ <itemData name="Float" defStyleNum="dsFloat" />
+ <itemData name="Char" defStyleNum="dsChar" />
+ <itemData name="String" defStyleNum="dsString" />
+ <itemData name="String Char" defStyleNum="dsChar" />
+ <itemData name="Symbol" defStyleNum="dsNormal" />
+ <itemData name="Comment" defStyleNum="dsComment" />
+ <itemData name="Preprocessor" defStyleNum="dsOthers" />
+ </itemDatas>
+ </highlighting>
+
+ <general>
+ <comments>
+ <comment name="singleLine" start=";" />
+ <comment name="singleLine" start="@" />
+ <comment name="multiLine" start="/*" end="*/" />
+ </comments>
+ <keywords casesensitive="1" weakDeliminator="_.$" />
+ </general>
+</language>
diff --git a/kate/data/asm6502.xml b/kate/data/asm6502.xml
new file mode 100644
index 000000000..8d3e7261c
--- /dev/null
+++ b/kate/data/asm6502.xml
@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+<language name="Asm6502" version="1.04" kateversion="2.1" section="Assembler" extensions="*.asm" mimetype="text/x-asm6502">
+ <highlighting>
+
+ <contexts>
+ <context name = "Base" attribute = "Normal Text" lineEndContext = "#stay">
+
+
+ <RegExpr String= "#define.*$" attribute = "Preprocessor" context="#stay"/>
+ <RegExpr String= "#include .*$" attribute = "Preprocessor" context="#stay"/>
+ <RegExpr String= ";.*$" attribute = "Comment" context="#stay"/>
+ <RegExpr String= "\.byte" attribute = "Data Type" context="#stay"/>
+ <RegExpr String= "\.byt" attribute = "Data Type" context="#stay"/>
+ <RegExpr String= "\.word" attribute = "Data Type" context="#stay"/>
+ <RegExpr String= "\.asc" attribute = "Data Type" context="#stay"/>
+ <RegExpr String= "\.dsb" attribute = "Data Type" context="#stay"/>
+ <RegExpr String= "\.fopt" attribute = "Data Type" context="#stay"/>
+ <RegExpr String= "\.text" attribute = "Data Type" context="#stay"/>
+ <RegExpr String= "\.data" attribute = "Data Type" context="#stay"/>
+ <RegExpr String= "\.bss" attribute = "Data Type" context="#stay"/>
+ <RegExpr String= "\.zero" attribute = "Data Type" context="#stay"/>
+ <RegExpr String= "\.align" attribute = "Data Type" context="#stay"/>
+ <RegExpr String= "\$[A-Za-z0-9]*" attribute = "Hex" context="#stay"/>
+ <RegExpr String= ",x$" attribute = "Keyword" context="#stay" insensitive="TRUE"/>
+ <RegExpr String= ",y$" attribute = "Keyword" context="#stay" insensitive="TRUE"/>
+ <RegExpr String= "#" attribute = "Keyword" context="#stay" insensitive="TRUE"/>
+ <StringDetect attribute="Keyword" context="#stay" String="TAX" insensitive="TRUE"/>
+ <StringDetect attribute="Keyword" context="#stay" String="ADC" insensitive="TRUE"/>
+ <StringDetect attribute="Keyword" context="#stay" String="AND" insensitive="TRUE"/>
+ <StringDetect attribute="Keyword" context="#stay" String="ASL" insensitive="TRUE"/>
+ <StringDetect attribute="Keyword" context="#stay" String="BCC" insensitive="TRUE"/>
+ <StringDetect attribute="Keyword" context="#stay" String="BCS" insensitive="TRUE"/>
+ <StringDetect attribute="Keyword" context="#stay" String="BEQ" insensitive="TRUE"/>
+ <StringDetect attribute="Keyword" context="#stay" String="BIT" insensitive="TRUE"/>
+ <StringDetect attribute="Keyword" context="#stay" String="BMI" insensitive="TRUE"/>
+ <StringDetect attribute="Keyword" context="#stay" String="BNE" insensitive="TRUE"/>
+ <StringDetect attribute="Keyword" context="#stay" String="BPL" insensitive="TRUE"/>
+ <StringDetect attribute="Keyword" context="#stay" String="BRK" insensitive="TRUE"/>
+ <StringDetect attribute="Keyword" context="#stay" String="BVC" insensitive="TRUE"/>
+ <StringDetect attribute="Keyword" context="#stay" String="BVS" insensitive="TRUE"/>
+ <StringDetect attribute="Keyword" context="#stay" String="CLC" insensitive="TRUE"/>
+ <StringDetect attribute="Keyword" context="#stay" String="CLD" insensitive="TRUE"/>
+ <StringDetect attribute="Keyword" context="#stay" String="CLI" insensitive="TRUE"/>
+ <StringDetect attribute="Keyword" context="#stay" String="CLV" insensitive="TRUE"/>
+ <StringDetect attribute="Keyword" context="#stay" String="CMP" insensitive="TRUE"/>
+ <StringDetect attribute="Keyword" context="#stay" String="CPX" insensitive="TRUE"/>
+ <StringDetect attribute="Keyword" context="#stay" String="CPY" insensitive="TRUE"/>
+ <StringDetect attribute="Keyword" context="#stay" String="DEC" insensitive="TRUE"/>
+ <StringDetect attribute="Keyword" context="#stay" String="DEX" insensitive="TRUE"/>
+ <StringDetect attribute="Keyword" context="#stay" String="DEY" insensitive="TRUE"/>
+ <StringDetect attribute="Keyword" context="#stay" String="EOR" insensitive="TRUE"/>
+ <StringDetect attribute="Keyword" context="#stay" String="INC" insensitive="TRUE"/>
+ <StringDetect attribute="Keyword" context="#stay" String="INX" insensitive="TRUE"/>
+ <StringDetect attribute="Keyword" context="#stay" String="INY" insensitive="TRUE"/>
+ <StringDetect attribute="Keyword" context="#stay" String="JMP" insensitive="TRUE"/>
+ <StringDetect attribute="Keyword" context="#stay" String="JSR" insensitive="TRUE"/>
+ <StringDetect attribute="Keyword" context="#stay" String="LDA" insensitive="TRUE"/>
+ <StringDetect attribute="Keyword" context="#stay" String="LDX" insensitive="TRUE"/>
+ <StringDetect attribute="Keyword" context="#stay" String="LDY" insensitive="TRUE"/>
+ <StringDetect attribute="Keyword" context="#stay" String="LSR" insensitive="TRUE"/>
+ <StringDetect attribute="Keyword" context="#stay" String="NOP" insensitive="TRUE"/>
+ <StringDetect attribute="Keyword" context="#stay" String="ORA" insensitive="TRUE"/>
+ <StringDetect attribute="Keyword" context="#stay" String="PHA" insensitive="TRUE"/>
+ <StringDetect attribute="Keyword" context="#stay" String="PHP" insensitive="TRUE"/>
+ <StringDetect attribute="Keyword" context="#stay" String="PLA" insensitive="TRUE"/>
+ <StringDetect attribute="Keyword" context="#stay" String="PLP" insensitive="TRUE"/>
+ <StringDetect attribute="Keyword" context="#stay" String="ROL" insensitive="TRUE"/>
+ <StringDetect attribute="Keyword" context="#stay" String="ROR" insensitive="TRUE"/>
+ <StringDetect attribute="Keyword" context="#stay" String="RTI" insensitive="TRUE"/>
+ <StringDetect attribute="Keyword" context="#stay" String="RTS" insensitive="TRUE"/>
+ <StringDetect attribute="Keyword" context="#stay" String="SBC" insensitive="TRUE"/>
+ <StringDetect attribute="Keyword" context="#stay" String="SEC" insensitive="TRUE"/>
+ <StringDetect attribute="Keyword" context="#stay" String="SED" insensitive="TRUE"/>
+ <StringDetect attribute="Keyword" context="#stay" String="SEI" insensitive="TRUE"/>
+ <StringDetect attribute="Keyword" context="#stay" String="STA" insensitive="TRUE"/>
+ <StringDetect attribute="Keyword" context="#stay" String="STX" insensitive="TRUE"/>
+ <StringDetect attribute="Keyword" context="#stay" String="STY" insensitive="TRUE"/>
+ <StringDetect attribute="Keyword" context="#stay" String="TAY" insensitive="TRUE"/>
+ <StringDetect attribute="Keyword" context="#stay" String="TSX" insensitive="TRUE"/>
+ <StringDetect attribute="Keyword" context="#stay" String="TXA" insensitive="TRUE"/>
+ <StringDetect attribute="Keyword" context="#stay" String="TXS" insensitive="TRUE"/>
+ <StringDetect attribute="Keyword" context="#stay" String="TYA" insensitive="TRUE"/>
+
+ <RegExpr String= "\*=" attribute = "Decimal" context="#stay"/>
+ <RangeDetect char = "&quot;" char1 = "&quot;" attribute = "String" context = "#stay"/>
+ <AnyChar String = "-+&lt;&gt;=;" attribute = "Operator" context = "#stay"/>
+ <Detect2Chars attribute="Comment" context="Commentar 2" char="/" char1="*" beginRegion="Comment"/>
+
+
+ </context>
+ <context attribute="Comment" lineEndContext="#stay" name="Commentar 2">
+ <Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" endRegion="Comment"/>
+ </context>
+ </contexts>
+
+ <itemDatas>
+ <itemData name = "Normal Text" defStyleNum = "dsNormal"/>
+ <itemData name = "Keyword" defStyleNum = "dsKeyword"/>
+ <itemData name="Decimal" defStyleNum="dsDecVal"/>
+ <itemData name="Data Type" defStyleNum="dsDataType"/>
+ <itemData name="Hex" defStyleNum="dsBaseN"/>
+ <itemData name = "String" defStyleNum = "dsString"/>
+ <itemData name = "Comment" defStyleNum = "dsComment"/>
+ <itemData name = "Substitution" defStyleNum = "dsOthers"/>
+ <itemData name="Preprocessor" defStyleNum="dsOthers"/>
+ <itemData name = "Parameter" defStyleNum = "dsOthers"/>
+ <itemData name = "Operator" defStyleNum = "dsOthers"/>
+ <itemData name = "Command" defStyleNum = "dsNormal"/>
+ </itemDatas>
+ </highlighting>
+ <general>
+ <comments>
+ <comment name="singleLine" start=";"/>
+ <comment name="multiLine" start="/*" end="*/"/>
+ </comments>
+ <keywords casesensitive="1"/>
+ </general>
+</language>
+
diff --git a/kate/data/asp.xml b/kate/data/asp.xml
new file mode 100644
index 000000000..1aa4f92d7
--- /dev/null
+++ b/kate/data/asp.xml
@@ -0,0 +1,393 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+<language name="ASP" version="1.03" kateversion="2.1" section="Markup" extensions="*.asp;" mimetype="text/x-asp-src;text/x-asp-src" author="Antonio Salazar (savedfastcool@gmail.com)" license="LGPL">
+ <highlighting>
+ <list name="control structures">
+ <item>select</item>
+ <item>case</item>
+ <item>end select</item>
+
+ <item>if</item>
+ <item>then</item>
+ <item>else</item>
+ <item>elseif</item>
+ <item>end if</item>
+
+
+ <item>while</item>
+ <item>do</item>
+ <item>until</item>
+ <item>loop</item>
+ <item>wend</item>
+
+ <item>for</item>
+ <item>each</item>
+ <item>to</item>
+ <item>in</item>
+ <item>next</item>
+
+ <item>exit</item>
+ <item>continue</item>
+ </list>
+ <list name="keywords">
+ <item>dim</item>
+ <item>redim</item>
+ <item>preserve</item>
+
+ <item>const</item>
+ <item>erase</item>
+ <item>nothing</item>
+ <item>set</item>
+
+ <item>new</item>
+ <item>me</item>
+
+
+ <item>function</item>
+ <item>sub</item>
+ <item>call</item>
+
+ <item>class</item>
+ <item>private</item>
+ <item>public</item>
+ <item>with</item>
+
+ <item>randomize</item>
+
+ <item>open</item>
+ <item>close</item>
+ <item>movenext</item>
+ <item>execute</item>
+ <item>eof</item>
+
+ <item>not</item>
+ <item>true</item>
+ <item>false</item>
+ <item>or</item>
+ <item>and</item>
+ <item>xor</item>
+ </list>
+ <list name="functions">
+ <item>response</item>
+ <item>write</item>
+ <item>redirect</item>
+ <item>end</item>
+
+ <item>request</item>
+ <item>form</item>
+ <item>querystring</item>
+ <item>servervariables</item>
+ <item>cookies</item>
+
+ <item>session</item>
+
+ <item>server</item>
+ <item>createobject</item>
+
+ <item>abs</item>
+ <item>array</item>
+ <item>asc</item>
+ <item>atn</item>
+ <item>cbool</item>
+ <item>cbyte</item>
+ <item>ccur</item>
+ <item>cdate</item>
+ <item>cdbl</item>
+ <item>chr</item>
+ <item>cint</item>
+ <item>clng</item>
+ <item>cos</item>
+ <item>csng</item>
+ <item>cstr</item>
+ <item>date</item>
+ <item>dateadd</item>
+
+ <item>DateDiff</item>
+ <item>DatePart</item>
+ <item>DateSerial</item>
+ <item>DateValue</item>
+ <item>Date</item>
+ <item>Day</item>
+ <item>Exp</item>
+ <item>Filter</item>
+ <item>Fix</item>
+ <item>FormatCurrency</item>
+ <item>FormatDateTime</item>
+ <item>FormatNumber</item>
+ <item>FormatPercent</item>
+
+ <item>GetObject</item>
+ <item>Hex</item>
+ <item>Hour</item>
+ <item>InputBox</item>
+ <item>InStr</item>
+ <item>InStrRev</item>
+ <item>Int</item>
+ <item>IsArray</item>
+ <item>IsDate</item>
+ <item>IsEmpty</item>
+ <item>IsNull</item>
+ <item>IsNumeric</item>
+ <item>IsObject</item>
+ <item>Join</item>
+ <item>LBound</item>
+ <item>LCase</item>
+
+ <item>Left</item>
+ <item>Len</item>
+ <item>LoadPicture</item>
+ <item>Log</item>
+ <item>LTrim</item>
+ <item>Mid</item>
+ <item>Minute</item>
+ <item>Month</item>
+ <item>MonthName</item>
+ <item>MsgBox</item>
+ <item>Now</item>
+ <item>Oct</item>
+ <item>Replace</item>
+
+ <item>RGB</item>
+ <item>Right</item>
+ <item>Rnd</item>
+ <item>Round</item>
+ <item>RTrim</item>
+
+ <item>ScriptEngine</item>
+ <item>ScriptEngineBuildVersion</item>
+ <item>ScriptEngineMajorVersion</item>
+ <item>ScriptEngineMinorVersion</item>
+ <item>Second</item>
+ <item>Sgn</item>
+ <item>Sin</item>
+ <item>Space</item>
+ <item>Split</item>
+ <item>Sqr</item>
+ <item>StrComp</item>
+ <item>StrReverse</item>
+ <item>String</item>
+ <item>Tan</item>
+ <item>Time</item>
+ <item>Timer</item>
+ <item>TimeSerial</item>
+ <item>TimeValue</item>
+ <item>Trim</item>
+ <item>TypeName</item>
+ <item>UBound</item>
+ <item>UCase</item>
+ <item>VarType</item>
+ <item>Weekday</item>
+ <item>WeekdayName</item>
+ <item>Year</item>
+
+ <item>Add</item>
+ <item>AddFolders</item>
+ <item>BuildPath</item>
+ <item>Clear</item>
+ <item>Close</item>
+ <item>Copy</item>
+ <item>CopyFile</item>
+ <item>CopyFolder</item>
+ <item>CreateFolder</item>
+ <item>CreateTextFile</item>
+ <item>Delete</item>
+ <item>DeleteFile</item>
+ <item>DeleteFolder</item>
+ <item>DriveExists</item>
+ <item>Exists</item>
+ <item>FileExists</item>
+ <item>FolderExists</item>
+ <item>GetAbsolutePathName</item>
+ <item>GetBaseName</item>
+ <item>GetDrive</item>
+ <item>GetDriveName</item>
+ <item>GetExtensionName</item>
+ <item>GetFile</item>
+ <item>GetFileName</item>
+ <item>GetFolder</item>
+ <item>GetParentFolderName</item>
+
+ <item>GetSpecialFolder</item>
+ <item>GetTempName</item>
+ <item>Items</item>
+ <item>item</item>
+ <item>Keys</item>
+ <item>Move</item>
+ <item>MoveFile</item>
+ <item>MoveFolder</item>
+ <item>OpenAsTextStream</item>
+ <item>OpenTextFile</item>
+ <item>Raise</item>
+ <item>Read</item>
+ <item>ReadAll</item>
+ <item>ReadLine</item>
+ <item>Remove</item>
+ <item>RemoveAll</item>
+ <item>Skip</item>
+ <item>SkipLine</item>
+ <item>Write</item>
+ <item>WriteBlankLines</item>
+ <item>WriteLine</item>
+ </list>
+ <contexts>
+ <context name="nosource" attribute="Normal Text" lineEndContext="#stay">
+ <StringDetect attribute="Keyword" context="aspsource" String="&lt;%" />
+ <RegExpr attribute="HTML Tag" context="aspsource" String="&lt;\s*script\s*language=&quot;VBScript&quot;[^&gt;]*&gt;" insensitive="TRUE" />
+ <RegExpr attribute="HTML Tag" context="scripts" String="&lt;\s*script(\s|&gt;)" insensitive="TRUE" />
+ <RegExpr attribute="HTML Tag" context="htmltag" String="&lt;\s*\/?\s*[a-zA-Z_:][a-zA-Z0-9._:-]*" />
+ <StringDetect attribute="HTML Comment" context="htmlcomment" String="&lt;!--" />
+ </context>
+
+ <context name="aspsource" attribute="ASP Text" lineEndContext="#stay">
+ <StringDetect attribute="Keyword" context="#pop" String="%&gt;" />
+ <RegExpr attribute="HTML Tag" context="#pop" String="&lt;\s*\/\s*script\s*&gt;" insensitive="TRUE" />
+ <DetectChar attribute="Comment" context="asp_onelinecomment" char="'" />
+ <DetectChar attribute="String" context="doublequotestring" char="&quot;" />
+ <DetectChar attribute="String" context="singlequotestring" char="&#39;" />
+ <DetectChar attribute="Keyword" context="#stay" char="&amp;" />
+ <RegExpr attribute="String" context="" String="" />
+ <RegExpr attribute="String" context="#stay" String="[0123456789]*\.\.\.[0123456789]*" />
+ <HlCOct attribute="Octal" context="#stay" />
+ <HlCHex attribute="Hex" context="#stay" />
+ <Float attribute="Float" context="#stay" />
+ <Int attribute="Decimal" context="#stay" />
+ <AnyChar attribute="Other" context="#stay" String=";()}{:,[]" />
+ <keyword attribute="Other" context="#stay" String="Others" />
+
+ <RegExpr attribute="Control Structures" context="#stay" String="\belseif\b" insensitive="TRUE" beginRegion="iffi1" endRegion="iffi1"/>
+ <RegExpr attribute="Control Structures" context="#stay" String="\belse\b" insensitive="TRUE" beginRegion="iffi1" endRegion="iffi1"/>
+ <RegExpr attribute="Control Structures" context="#stay" String="\bif\b" insensitive="TRUE" beginRegion="iffi1"/>
+ <RegExpr attribute="Control Structures" context="#stay" String="\bend if\b" insensitive="TRUE" endRegion="iffi1"/>
+
+ <RegExpr attribute="Keyword" context="#stay" String="\bexit function\b" insensitive="TRUE" />
+ <RegExpr attribute="Keyword" context="#stay" String="\bfunction\b" insensitive="TRUE" beginRegion="funendfun1"/>
+ <RegExpr attribute="Keyword" context="#stay" String="\bend function\b" insensitive="TRUE" endRegion="funendfun1"/>
+
+ <RegExpr attribute="Keyword" context="#stay" String="\bexit sub\b" insensitive="TRUE" />
+ <RegExpr attribute="Keyword" context="#stay" String="\bsub\b" insensitive="TRUE" beginRegion="subendsub1"/>
+ <RegExpr attribute="Keyword" context="#stay" String="\bend sub\b" insensitive="TRUE" endRegion="subendsub1"/>
+
+ <RegExpr attribute="Keyword" context="#stay" String="\bclass\b" insensitive="TRUE" beginRegion="classendclass1"/>
+ <RegExpr attribute="Keyword" context="#stay" String="\bend class\b" insensitive="TRUE" endRegion="classendclass1"/>
+
+ <RegExpr attribute="Control Structures" context="#stay" String="\bexit do\b" insensitive="TRUE" />
+ <RegExpr attribute="Control Structures" context="#stay" String="\bdo\b" insensitive="TRUE" beginRegion="doloop1"/>
+ <RegExpr attribute="Control Structures" context="#stay" String="\bloop\b" insensitive="TRUE" endRegion="doloop1"/>
+
+ <RegExpr attribute="Control Structures" context="#stay" String="\bexit while\b" insensitive="TRUE" />
+ <RegExpr attribute="Control Structures" context="#stay" String="\bwhile\b" insensitive="TRUE" beginRegion="whilewend1"/>
+ <RegExpr attribute="Control Structures" context="#stay" String="\bwend\b" insensitive="TRUE" endRegion="whilewend1"/>
+
+ <RegExpr attribute="Control Structures" context="#stay" String="\bexit for\b" insensitive="TRUE" />
+ <RegExpr attribute="Control Structures" context="#stay" String="\bfor\b" insensitive="TRUE" beginRegion="fornext1"/>
+ <RegExpr attribute="Control Structures" context="#stay" String="\bnext\b" insensitive="TRUE" endRegion="fornext1"/>
+
+ <RegExpr attribute="Control Structures" context="#stay" String="\bselect case\b" insensitive="TRUE" beginRegion="selcase1"/>
+ <RegExpr attribute="Control Structures" context="#stay" String="\bend select\b" insensitive="TRUE" endRegion="selcase1"/>
+
+ <keyword attribute="Keyword" context="#stay" String="keywords" />
+ <keyword attribute="Control Structures" context="#stay" String="control structures" />
+ <keyword attribute="Function" context="#stay" String="functions" />
+ </context>
+ <context name="asp_onelinecomment" attribute="Comment" lineEndContext="#pop">
+ <StringDetect attribute="Keyword" context="#pop#pop" String="%&gt;" />
+ </context>
+ <context name="doublequotestring" attribute="String" lineEndContext="#stay">
+ <Detect2Chars attribute="Escape Code" context="#stay" char="&quot;" char1="&quot;" />
+ <RegExpr attribute="Escape Code" context="#stay" String="\\[0-7]{1,3}" />
+ <RegExpr attribute="Escape Code" context="#stay" String="\\x[0-9A-Fa-f]{1,2}" />
+ <DetectChar attribute="String" context="#pop" char="&quot;" />
+ </context>
+ <context name="singlequotestring" attribute="String" lineEndContext="#stay">
+ <Detect2Chars attribute="Escape Code" context="#stay" char="'" char1="'"/>
+ <DetectChar attribute="String" context="#pop" char="'" />
+ </context>
+ <context name="htmltag" attribute="Identifier" lineEndContext="#stay">
+ <Detect2Chars attribute="HTML Tag" context="#pop" char="/" char1="&gt;" />
+ <DetectChar attribute="HTML Tag" context="#pop" char="&gt;"/>
+ <StringDetect attribute="Keyword" context="aspsource" String="&lt;%" />
+ <StringDetect attribute="Keyword" context="aspsource" String="&lt;%" />
+ <RegExpr attribute="Identifier" context="identifiers" String="\s*=\s*"/>
+ </context>
+ <context name="htmlcomment" attribute="HTML Comment" lineEndContext="#stay">
+ <StringDetect attribute="Keyword" context="aspsource" String="&lt;%" />
+ <StringDetect attribute="Keyword" context="aspsource" String="&lt;%" />
+ <StringDetect attribute="HTML Comment" context="#pop" String="--&gt;" />
+ <RegExpr attribute="Normal Text" context="identifiers" String="\s*=\s*"/>
+ </context>
+ <context name="identifiers" attribute="Identifier" lineEndContext="#stay">
+ <RegExpr attribute="String" context="#pop" String="\s*#?[a-zA-Z0-9]*" />
+ <DetectChar attribute="Types" context="types1" char="'" />
+ <DetectChar attribute="Types" context="types2" char="&quot;" />
+ </context>
+
+ <context name="types1" attribute="Types" lineEndContext="#stay">
+ <StringDetect attribute="Keyword" context="aspsource" String="&lt;%" />
+ <StringDetect attribute="Keyword" context="aspsource" String="&lt;%" />
+ <DetectChar attribute="Types" context="#pop#pop" char="'" />
+ </context>
+
+ <context name="types2" attribute="Types" lineEndContext="#stay">
+ <StringDetect attribute="Keyword" context="aspsource" String="&lt;%" />
+ <StringDetect attribute="Keyword" context="aspsource" String="&lt;%" />
+ <DetectChar attribute="Types" context="#pop#pop" char="&quot;" />
+ </context>
+
+ <context name="scripts" attribute="Normal Text" lineEndContext="#stay">
+ <Detect2Chars attribute="Comment" context="scripts_onelinecomment" char="/" char1="/" />
+ <Detect2Chars attribute="Comment" context="twolinecomment" char="/" char1="*" />
+ <keyword attribute="Control Structures" context="#stay" String="control structures" />
+ <keyword attribute="Keyword" context="#stay" String="keywords" />
+ <keyword attribute="Function" context="#stay" String="functions" />
+ <StringDetect attribute="Keyword" context="aspsource" String="&lt;%"/>
+ <RegExpr attribute="HTML Tag" context="#pop" String="&lt;\s*\/\s*script\s*&gt;" insensitive="TRUE" />
+
+ <DetectChar attribute="String" context="doublequotestring" char="&quot;" />
+ <DetectChar attribute="String" context="singlequotestring" char="&#39;" />
+ <HlCOct attribute="Octal" context="#stay" />
+ <HlCHex attribute="Hex" context="#stay" />
+ <Float attribute="Float" context="#stay" />
+ <Int attribute="Decimal" context="#stay" />
+ <DetectChar attribute="Normal Text" context="#stay" char="{" beginRegion="Brace1" />
+ <DetectChar attribute="Normal Text" context="#stay" char="}" endRegion="Brace1" />
+ <AnyChar attribute="Other" context="#stay" String=";()}{:,[]" />
+ <keyword attribute="Other" context="#stay" String="Others" />
+ </context>
+ <context name="scripts_onelinecomment" attribute="Comment" lineEndContext="#pop">
+ <RegExpr attribute="HTML Tag" context="#pop#pop" String="&lt;\s*\/\s*script\s*&gt;" insensitive="TRUE" />
+ </context>
+ <context name="twolinecomment" attribute="Comment" lineEndContext="#stay">
+ <Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" endRegion="Comment" />
+ </context>
+
+ </contexts>
+ <itemDatas>
+ <itemData name="Normal Text" defStyleNum="dsNormal" />
+ <itemData name="ASP Text" defStyleNum="dsNormal" />
+ <itemData name="Keyword" defStyleNum="dsKeyword" />
+ <itemData name="Function" defStyleNum="dsKeyword" color="#0000FF" selColor="#00ffff" bold="0" italic="0"/>
+ <itemData name="Decimal" defStyleNum="dsDecVal" />
+ <itemData name="Octal" defStyleNum="dsBaseN" />
+ <itemData name="Hex" defStyleNum="dsBaseN" />
+ <itemData name="Float" defStyleNum="dsFloat" />
+ <itemData name="String" defStyleNum="dsString" />
+ <itemData name="Comment" defStyleNum="dsComment" />
+ <itemData name="Variable" defStyleNum="dsKeyword" color="#5555FF" selColor="#ffffff" bold="0" italic="0" />
+ <itemData name="Control Structures" defStyleNum="dsKeyword" color="#A1A100" selColor="#ffffff" bold="0" italic="0" />
+ <itemData name="Escape Code" defStyleNum="dsKeyword" color="#0F0F8F" selColor="#ffffff" bold="1" italic="0" />
+ <itemData name="Other" defStyleNum="dsOthers" />
+
+ <itemData name="HTML Tag" defStyleNum="dsKeyword" color="#0F0000" selColor="#ffffff" bold="1" italic="0" />
+ <itemData name="HTML Comment" defStyleNum="dsComment" />
+ <itemData name="Identifier" defStyleNum="dsOthers" />
+ <itemData name="Types" defStyleNum="dsDataType" />
+ </itemDatas>
+ </highlighting>
+ <general>
+ <comments>
+ <comment name="singleLine" start="'" />
+ <comment name="multiLine" start="/*" end="*/" />
+ </comments>
+ <keywords casesensitive="0" weakDeliminator=""/>
+ </general>
+</language>
diff --git a/kate/data/awk.xml b/kate/data/awk.xml
new file mode 100644
index 000000000..0f16ca4cc
--- /dev/null
+++ b/kate/data/awk.xml
@@ -0,0 +1,112 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+<language name="AWK" version="0.90" kateversion="2.3" section="Scripts" extensions="*.awk" mimetype="text/x-awk">
+ <highlighting>
+ <list name="keywords">
+ <item>if</item>
+ <item>else</item>
+ <item>while</item>
+ <item>do</item>
+ <item>for</item>
+ <item>in</item>
+ <item>continue</item>
+ <item>break</item>
+ <item>print</item>
+ <item>printf</item>
+ <item>getline</item>
+ <item>function</item>
+ <item>return</item>
+ <item>next</item>
+ <item>exit</item>
+ </list>
+ <list name="builtins">
+ <item>ARGC</item>
+ <item>ARGV</item>
+ <item>CONVFMT</item>
+ <item>ENVIRON</item>
+ <item>FILENAME</item>
+ <item>FNR</item>
+ <item>FS</item>
+ <item>NF</item>
+ <item>NR</item>
+ <item>OFMT</item>
+ <item>OFS</item>
+ <item>ORS</item>
+ <item>RS</item>
+ <item>RSTART</item>
+ <item>RLENGTH</item>
+ <item>SUBSEP</item>
+ </list>
+ <list name="functions">
+ <item>gsub</item>
+ <item>gensub</item>
+ <item>index</item>
+ <item>length</item>
+ <item>match</item>
+ <item>split</item>
+ <item>sprintf</item>
+ <item>sub</item>
+ <item>substr</item>
+ <item>tolower</item>
+ <item>toupper</item>
+ <item>atan2</item>
+ <item>cos</item>
+ <item>exp</item>
+ <item>int</item>
+ <item>log</item>
+ <item>rand</item>
+ <item>sin</item>
+ <item>sqrt</item>
+ <item>srand</item>
+ <item>close</item>
+ <item>fflush</item>
+ <item>system</item>
+ </list>
+
+ <contexts>
+
+ <context name="Base" attribute="Normal" lineEndContext="#stay">
+ <RegExpr String="\b(BEGIN|END)\b" attribute="Pattern" context="#stay" />
+ <RegExpr String="/([^\/[]|\\.|\[\]?(\[[^]]+\]|.)+\])+/" attribute="Pattern" context="#stay" />
+ <DetectChar char="{" attribute="Keyword" context="#stay" beginRegion="block" />
+ <DetectChar char="}" attribute="Keyword" context="#stay" endRegion="block" />
+ <DetectChar char="#" attribute="Comment" context="Comment" />
+ <DetectChar char="&quot;" attribute="String" context="String"/>
+ <keyword String="keywords" attribute="Keyword" context="#stay"/>
+ <keyword String="builtins" attribute="Builtin" context="#stay"/>
+ <keyword String="functions" attribute="Function" context="#stay"/>
+ <Float attribute="Float" context="#stay"/>
+ <Int attribute="Decimal" context="#stay"/>
+ <RegExpr String="\$[A-Za-z0-9_]+" attribute="Field" context="#stay"/>
+ </context>
+
+ <context name="String" attribute="String" lineEndContext="#stay">
+ <DetectChar char="&quot;" attribute="String" context="#pop"/>
+ <HlCStringChar attribute="String" context="#stay"/>
+ </context>
+
+ <context name="Comment" attribute="Comment" lineEndContext="#pop">
+ <IncludeRules context="##Alerts" />
+ </context>
+
+ </contexts>
+ <itemDatas>
+ <itemData name="Normal" defStyleNum="dsNormal"/>
+ <itemData name="Keyword" defStyleNum="dsKeyword"/>
+ <itemData name="Builtin" defStyleNum="dsDataType"/>
+ <itemData name="Function" defStyleNum="dsFunction"/>
+ <itemData name="Decimal" defStyleNum="dsDecVal"/>
+ <itemData name="Float" defStyleNum="dsFloat"/>
+ <itemData name="String" defStyleNum="dsString"/>
+ <itemData name="Comment" defStyleNum="dsComment"/>
+ <itemData name="Pattern" defStyleNum="dsString"/>
+ <itemData name="Field" defStyleNum="dsOthers"/>
+ </itemDatas>
+ </highlighting>
+ <general>
+ <comments>
+ <comment name="singleLine" start="#"/>
+ </comments>
+ <keywords casesensitive="1" />
+ </general>
+</language>
diff --git a/kate/data/bash.xml b/kate/data/bash.xml
new file mode 100644
index 000000000..7fe38d3a4
--- /dev/null
+++ b/kate/data/bash.xml
@@ -0,0 +1,829 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd"
+[
+ <!ENTITY funcname "[A-Za-z_:][A-Za-z0-9_:#&#37;@-]*">
+ <!ENTITY varname "[A-Za-z_][A-Za-z0-9_]*">
+ <!ENTITY word "[^|&amp;;()&lt;&gt;\s]+"> <!-- see man bash -->
+ <!ENTITY eos "(?=($|\s))"> <!-- eol or space following -->
+ <!ENTITY noword "(?![\w$+-])"> <!-- no word, $, + or - following -->
+]>
+<language name="Bash" version="2.06" kateversion="2.4" section="Scripts" extensions="*.sh;*.bash;*.ebuild;*.eclass" mimetype="application/x-shellscript" casesensitive="1" author="Wilbert Berendsen (wilbert@kde.nl)" license="LGPL">
+
+<!-- (c) 2004 by Wilbert Berendsen, wilbert@kde.nl
+ Released under the LGPL, part of kdelibs/kate -->
+
+ <highlighting>
+ <list name="keywords">
+ <item> else </item>
+ <item> for </item>
+ <item> function </item>
+ <item> in </item>
+ <item> select </item>
+ <item> until </item>
+ <item> while </item>
+ <item> . </item>
+ <item> elif </item>
+ <item> then </item>
+ <item> set </item>
+ </list>
+
+ <list name="builtins">
+ <item> : </item>
+ <item> . </item>
+ <item> source </item>
+ <item> alias </item>
+ <item> bg </item>
+ <item> bind </item>
+ <item> break </item>
+ <item> builtin </item>
+ <item> cd </item>
+ <item> command </item>
+ <item> compgen </item>
+ <item> complete </item>
+ <item> continue </item>
+ <item> dirs </item>
+ <item> disown </item>
+ <item> echo </item>
+ <item> enable </item>
+ <item> eval </item>
+ <item> exec </item>
+ <item> exit </item>
+ <item> fc </item>
+ <item> fg </item>
+ <item> getopts </item>
+ <item> hash </item>
+ <item> help </item>
+ <item> history </item>
+ <item> jobs </item>
+ <item> kill </item>
+ <item> let </item>
+ <item> logout </item>
+ <item> popd </item>
+ <item> printf </item>
+ <item> pushd </item>
+ <item> pwd </item>
+ <item> return </item>
+ <item> set </item>
+ <item> shift </item>
+ <item> shopt </item>
+ <item> suspend </item>
+ <item> test </item>
+ <item> times </item>
+ <item> trap </item>
+ <item> type </item>
+ <item> ulimit </item>
+ <item> umask </item>
+ <item> unalias </item>
+ <item> wait </item>
+ </list>
+
+ <list name="builtins_var">
+ <item> export </item>
+ <item> unset </item>
+ <item> declare </item>
+ <item> typeset </item>
+ <item> local </item>
+ <item> read </item>
+ <item> readonly </item>
+ </list>
+
+ <list name="unixcommands">
+ <!-- /bin -->
+ <item> arch </item>
+ <item> awk </item>
+ <item> bash </item>
+ <item> bunzip2 </item>
+ <item> bzcat </item>
+ <item> bzcmp </item>
+ <item> bzdiff </item>
+ <item> bzegrep </item>
+ <item> bzfgrep </item>
+ <item> bzgrep </item>
+ <item> bzip2 </item>
+ <item> bzip2recover </item>
+ <item> bzless </item>
+ <item> bzmore </item>
+ <item> cat </item>
+ <item> chattr </item>
+ <item> chgrp </item>
+ <item> chmod </item>
+ <item> chown </item>
+ <item> chvt </item>
+ <item> cp </item>
+ <item> date </item>
+ <item> dd </item>
+ <item> deallocvt </item>
+ <item> df </item>
+ <item> dir </item>
+ <item> dircolors </item>
+ <item> dmesg </item>
+ <item> dnsdomainname </item>
+ <item> domainname </item>
+ <item> du </item>
+ <item> dumpkeys </item>
+ <item> echo </item>
+ <item> ed </item>
+ <item> egrep </item>
+ <item> false </item>
+ <item> fgconsole </item>
+ <item> fgrep </item>
+ <item> fuser </item>
+ <item> gawk </item>
+ <item> getkeycodes </item>
+ <item> gocr </item>
+ <item> grep </item>
+ <item> groups </item>
+ <item> gunzip </item>
+ <item> gzexe </item>
+ <item> gzip </item>
+ <item> hostname </item>
+ <item> igawk </item>
+ <item> install </item>
+ <item> kbd_mode </item>
+ <item> kbdrate </item>
+ <item> killall </item>
+ <item> last </item>
+ <item> lastb </item>
+ <item> link </item>
+ <item> ln </item>
+ <item> loadkeys </item>
+ <item> loadunimap </item>
+ <item> login </item>
+ <item> ls </item>
+ <item> lsattr </item>
+ <item> lsmod </item>
+ <item> lsmod.old </item>
+ <item> mapscrn </item>
+ <item> mesg </item>
+ <item> mkdir </item>
+ <item> mkfifo </item>
+ <item> mknod </item>
+ <item> mktemp </item>
+ <item> more </item>
+ <item> mount </item>
+ <item> mv </item>
+ <item> nano </item>
+ <item> netstat </item>
+ <item> nisdomainname </item>
+ <item> openvt </item>
+ <item> pgawk </item>
+ <item> pidof </item>
+ <item> ping </item>
+ <item> ps </item>
+ <item> pstree </item>
+ <item> pwd </item>
+ <item> rbash </item>
+ <item> readlink </item>
+ <item> red </item>
+ <item> resizecons </item>
+ <item> rm </item>
+ <item> rmdir </item>
+ <item> run-parts </item>
+ <item> sash </item>
+ <item> sed </item>
+ <item> setfont </item>
+ <item> setkeycodes </item>
+ <item> setleds </item>
+ <item> setmetamode </item>
+ <item> setserial </item>
+ <item> sh </item>
+ <item> showkey </item>
+ <item> shred </item>
+ <item> sleep </item>
+ <item> ssed </item>
+ <item> stat </item>
+ <item> stty </item>
+ <item> su </item>
+ <item> sync </item>
+ <item> tar </item>
+ <item> tempfile </item>
+ <item> touch </item>
+ <item> true </item>
+ <item> umount </item>
+ <item> uname </item>
+ <item> unicode_start </item>
+ <item> unicode_stop </item>
+ <item> unlink </item>
+ <item> utmpdump </item>
+ <item> uuidgen </item>
+ <item> vdir </item>
+ <item> wall </item>
+ <item> wc </item>
+ <item> ypdomainname </item>
+ <item> zcat </item>
+ <item> zcmp </item>
+ <item> zdiff </item>
+ <item> zegrep </item>
+ <item> zfgrep </item>
+ <item> zforce </item>
+ <item> zgrep </item>
+ <item> zless </item>
+ <item> zmore </item>
+ <item> znew </item>
+ <item> zsh </item>
+
+ <!-- some from /usr/bin -->
+ <item> aclocal </item>
+ <item> aconnect </item>
+ <item> aplay </item>
+ <item> apm </item>
+ <item> apmsleep </item>
+ <item> apropos </item>
+ <item> ar </item>
+ <item> arecord </item>
+ <item> as </item>
+ <item> as86 </item>
+ <item> autoconf </item>
+ <item> autoheader </item>
+ <item> automake </item>
+ <item> awk </item>
+ <item> basename </item>
+ <item> bc </item>
+ <item> bison </item>
+ <item> c++ </item>
+ <item> cal </item>
+ <item> cat </item>
+ <item> cc </item>
+ <item> cdda2wav </item>
+ <item> cdparanoia </item>
+ <item> cdrdao </item>
+ <item> cd-read </item>
+ <item> cdrecord </item>
+ <item> chfn </item>
+ <item> chgrp </item>
+ <item> chmod </item>
+ <item> chown </item>
+ <item> chroot </item>
+ <item> chsh </item>
+ <item> clear </item>
+ <item> cmp </item>
+ <item> co </item>
+ <item> col </item>
+ <item> comm </item>
+ <item> cp </item>
+ <item> cpio </item>
+ <item> cpp </item>
+ <item> cut </item>
+ <item> dc </item>
+ <item> dd </item>
+ <item> df </item>
+ <item> diff </item>
+ <item> diff3 </item>
+ <item> dir </item>
+ <item> dircolors </item>
+ <item> directomatic </item>
+ <item> dirname </item>
+ <item> du </item>
+ <item> env </item>
+ <item> expr </item>
+ <item> fbset </item>
+ <item> file </item>
+ <item> find </item>
+ <item> flex </item>
+ <item> flex++ </item>
+ <item> fmt </item>
+ <item> free </item>
+ <item> ftp </item>
+ <item> funzip </item>
+ <item> fuser </item>
+ <item> g++ </item>
+ <item> gawk </item>
+ <item> gc </item>
+ <item> gcc </item>
+ <item> gdb </item>
+ <item> getent </item>
+ <item> getopt </item>
+ <item> gettext </item>
+ <item> gettextize </item>
+ <item> gimp </item>
+ <item> gimp-remote </item>
+ <item> gimptool </item>
+ <item> gmake </item>
+ <item> gs </item>
+ <item> head </item>
+ <item> hexdump </item>
+ <item> id </item>
+ <item> install </item>
+ <item> join </item>
+ <item> kill </item>
+ <item> killall </item>
+ <item> ld </item>
+ <item> ld86 </item>
+ <item> ldd </item>
+ <item> less </item>
+ <item> lex </item>
+ <item> ln </item>
+ <item> locate </item>
+ <item> lockfile </item>
+ <item> logname </item>
+ <item> lp </item>
+ <item> lpr </item>
+ <item> ls </item>
+ <item> lynx </item>
+ <item> m4 </item>
+ <item> make </item>
+ <item> man </item>
+ <item> mkdir </item>
+ <item> mknod </item>
+ <item> msgfmt </item>
+ <item> mv </item>
+ <item> namei </item>
+ <item> nasm </item>
+ <item> nawk </item>
+ <item> nice </item>
+ <item> nl </item>
+ <item> nm </item>
+ <item> nm86 </item>
+ <item> nmap </item>
+ <item> nohup </item>
+ <item> nop </item>
+ <item> od </item>
+ <item> passwd </item>
+ <item> patch </item>
+ <item> pcregrep </item>
+ <item> pcretest </item>
+ <item> perl </item>
+ <item> perror </item>
+ <item> pidof </item>
+ <item> pr </item>
+ <item> printf </item>
+ <item> procmail </item>
+ <item> prune </item>
+ <item> ps2ascii </item>
+ <item> ps2epsi </item>
+ <item> ps2frag </item>
+ <item> ps2pdf </item>
+ <item> ps2ps </item>
+ <item> psbook </item>
+ <item> psmerge </item>
+ <item> psnup </item>
+ <item> psresize </item>
+ <item> psselect </item>
+ <item> pstops </item>
+ <item> rcs </item>
+ <item> rev </item>
+ <item> rm </item>
+ <item> scp </item>
+ <item> sed </item>
+ <item> seq </item>
+ <item> setterm </item>
+ <item> shred </item>
+ <item> size </item>
+ <item> size86 </item>
+ <item> skill </item>
+ <item> slogin </item>
+ <item> snice </item>
+ <item> sort </item>
+ <item> sox </item>
+ <item> split </item>
+ <item> ssh </item>
+ <item> ssh-add </item>
+ <item> ssh-agent </item>
+ <item> ssh-keygen </item>
+ <item> ssh-keyscan </item>
+ <item> stat </item>
+ <item> strings </item>
+ <item> strip </item>
+ <item> sudo </item>
+ <item> suidperl </item>
+ <item> sum </item>
+ <item> tac </item>
+ <item> tail </item>
+ <item> tee </item>
+ <item> test </item>
+ <item> tr </item>
+ <item> uniq </item>
+ <item> unlink </item>
+ <item> unzip </item>
+ <item> updatedb </item>
+ <item> updmap </item>
+ <item> uptime </item>
+ <item> users </item>
+ <item> vmstat </item>
+ <item> w </item>
+ <item> wc </item>
+ <item> wget </item>
+ <item> whatis </item>
+ <item> whereis </item>
+ <item> which </item>
+ <item> who </item>
+ <item> whoami </item>
+ <item> write </item>
+ <item> xargs </item>
+ <item> yacc </item>
+ <item> yes </item>
+ <item> zip </item>
+ <item> zsoelim </item>
+
+ <!-- others -->
+ <item> dcop </item>
+ <item> kdialog </item>
+ <item> kfile </item>
+ <item> xhost </item>
+ <item> xmodmap </item>
+ <item> xset </item>
+ </list>
+
+
+ <contexts>
+ <context attribute="Normal Text" lineEndContext="#stay" name="Start">
+ <IncludeRules context="FindAll" />
+ </context>
+
+<!-- ====== The following rulessets are meant to be included ======== -->
+ <!-- FindAll tries to interpret everything -->
+ <context attribute="Normal Text" lineEndContext="#stay" name="FindAll">
+ <IncludeRules context="FindComments" />
+ <IncludeRules context="FindCommands" />
+ <IncludeRules context="FindStrings" />
+ <IncludeRules context="FindSubstitutions" />
+ <IncludeRules context="FindOthers" />
+ </context>
+
+ <!-- FindMost tries to interpret anything except commands -->
+ <context attribute="Normal Text" lineEndContext="#stay" name="FindMost">
+ <IncludeRules context="FindComments" />
+ <IncludeRules context="FindStrings" />
+ <IncludeRules context="FindSubstitutions" />
+ <IncludeRules context="FindOthers" />
+ </context>
+
+
+ <!-- FindComments consumes shell comments till EOL -->
+ <context attribute="Normal Text" lineEndContext="#pop" name="FindComments">
+ <DetectChar attribute="Comment" context="Comment" char="#" firstNonSpace="true"/>
+ <RegExpr attribute="Normal Text" context="Comment" String="[\s;](?=#)" />
+ </context>
+ <context attribute="Comment" lineEndContext="#pop" name="Comment">
+ <IncludeRules context="##Alerts" />
+ </context>
+
+ <!-- FindCommentsParen consumes shell comments till EOL or a closing parenthese -->
+ <context attribute="Normal Text" lineEndContext="#pop" name="FindCommentsParen">
+ <DetectChar attribute="Comment" context="CommentParen" char="#" firstNonSpace="true"/>
+ <RegExpr attribute="Normal Text" context="CommentParen" String="[\s;](?=#)" />
+ </context>
+ <context attribute="Comment" lineEndContext="#pop" name="CommentParen">
+ <RegExpr attribute="Comment" context="#pop" String="[^)](?=\))" />
+ <IncludeRules context="##Alerts" />
+ </context>
+
+ <!-- FindCommentsBackq consumes shell comments till EOL or a backquote -->
+ <context attribute="Normal Text" lineEndContext="#pop" name="FindCommentsBackq">
+ <DetectChar attribute="Comment" context="CommentBackq" char="#" firstNonSpace="true"/>
+ <RegExpr attribute="Normal Text" context="CommentBackq" String="[\s;](?=#)" />
+ </context>
+ <context attribute="Comment" lineEndContext="#pop" name="CommentBackq">
+ <RegExpr attribute="Comment" context="#pop" String="[^`](?=`)" />
+ <IncludeRules context="##Alerts" />
+ </context>
+
+
+ <!-- FindCommands matches many items that can be expected outside strings, substitutions etc. -->
+ <context attribute="Normal Text" lineEndContext="#stay" name="FindCommands">
+ <!-- start expression in double parentheses -->
+ <Detect2Chars attribute="Keyword" context="ExprDblParen" char="(" char1="(" beginRegion="expression" />
+ <!-- start expression in double brackets -->
+ <RegExpr attribute="Keyword" context="ExprDblBracket" String="\[\[&eos;" beginRegion="expression" column="0"/>
+ <RegExpr attribute="Keyword" context="ExprDblBracket" String="\s\[\[&eos;" beginRegion="expression" />
+ <!-- start expression in single brackets -->
+ <RegExpr attribute="Builtin" context="ExprBracket" String="\[&eos;" beginRegion="expression" column="0"/>
+ <RegExpr attribute="Builtin" context="ExprBracket" String="\s\[&eos;" beginRegion="expression" />
+ <!-- start a group command with { -->
+ <RegExpr attribute="Keyword" context="Group" String="\{&eos;" beginRegion="group" />
+ <!-- start a subshell -->
+ <DetectChar attribute="Keyword" context="SubShell" char="(" beginRegion="subshell" />
+ <!-- match do and if blocks -->
+ <RegExpr attribute="Keyword" context="#stay" String="\bdo&noword;" beginRegion="do" />
+ <RegExpr attribute="Keyword" context="#stay" String="\bdone&noword;" endRegion="do" />
+ <RegExpr attribute="Keyword" context="#stay" String="\bif&noword;" beginRegion="if" />
+ <RegExpr attribute="Keyword" context="#stay" String="\bfi&noword;" endRegion="if" />
+ <!-- handle case as a special case -->
+ <RegExpr attribute="Keyword" context="Case" String="\bcase&noword;" beginRegion="case" />
+ <!-- handle command line options -->
+ <RegExpr attribute="Option" context="#stay" String="-[A-Za-z0-9]+" />
+ <RegExpr attribute="Option" context="#stay" String="--[a-z][A-Za-z0-9_-]*" />
+ <!-- handle variable assignments -->
+ <RegExpr attribute="Variable" context="Assign" String="\b&varname;\+?=" />
+ <RegExpr attribute="Variable" context="AssignSubscr" String="\b&varname;(?=\[[^]]+\]=)" />
+ <!-- handle functions with function keyword before keywords -->
+ <StringDetect attribute="Function" context="#stay" String=":()" />
+ <RegExpr attribute="Keyword" context="FunctionDef" String="\bfunction\b" />
+ <!-- handle keywords -->
+ <keyword attribute="Keyword" context="#stay" String="keywords" />
+ <keyword attribute="Builtin" context="#stay" String="builtins" />
+ <keyword attribute="Command" context="#stay" String="unixcommands" />
+ <!-- handle commands that have variable names as argument -->
+ <keyword attribute="Builtin" context="VarName" String="builtins_var" />
+ <!-- handle here-string -->
+ <StringDetect attribute="Redirection" context="#stay" String="&lt;&lt;&lt;" />
+ <!-- handle here document -->
+ <StringDetect attribute="Redirection" context="HereDoc" String="&lt;&lt;" lookAhead="true" />
+ <!-- handle process subst -->
+ <RegExpr attribute="Redirection" context="ProcessSubst" String="[&lt;&gt;]\(" />
+ <!-- handle redirection -->
+ <RegExpr attribute="Redirection" context="#stay" String="([0-9]*(&gt;{1,2}|&lt;)(&amp;[0-9]+-?)?|&amp;&gt;|&gt;&amp;|[0-9]*&lt;&gt;)" />
+ <!-- handle &, &&, | and || -->
+ <RegExpr attribute="Control" context="#stay" String="([|&amp;])\1?" />
+ <!-- mark function definitions without function keyword -->
+ <RegExpr attribute="Function" context="#stay" String="&funcname;\s*\(\)" />
+ </context>
+
+ <!-- FindOthers contains various rules to mark different shell input -->
+ <context attribute="Normal Text" lineEndContext="#stay" name="FindOthers">
+ <RegExpr attribute="Escape" context="#stay" String="\\[][;&quot;\\'$`{}()|&amp;&lt;&gt;* ]" />
+ <RegExpr attribute="Keyword" context="#stay" String="\\$" />
+ <RegExpr attribute="Escape" context="#stay" String="\{(?!(\s|$))\S*\}" />
+ <RegExpr attribute="Path" context="#stay" String="\.?/[\w_@.+-]+(?=([\s/):]|$))" />
+ <!-- TODO: shell globs -->
+ </context>
+
+ <!-- FindStrings looks for single and double quoted strings, also with $-prefix -->
+ <context attribute="Normal Text" lineEndContext="#stay" name="FindStrings">
+ <DetectChar attribute="String SingleQ" context="StringSQ" char="'" />
+ <DetectChar attribute="String DoubleQ" context="StringDQ" char="&quot;" />
+ <Detect2Chars attribute="String SingleQ" context="StringEsc" char="$" char1="'" />
+ <Detect2Chars attribute="String Transl." context="StringDQ" char="$" char1="&quot;" />
+ </context>
+
+ <!-- FindSubstitutions goes after anything starting with $ and ` and their escapes -->
+ <context attribute="Normal Text" lineEndContext="#stay" name="FindSubstitutions">
+ <RegExpr attribute="Variable" context="#stay" String="\$[*@#?$!_0-9-]" />
+ <RegExpr attribute="Variable" context="Subscript" String="\$&varname;\[" />
+ <RegExpr attribute="Variable" context="#stay" String="\$&varname;" />
+ <RegExpr attribute="Variable" context="#stay" String="\$\{[*@#?$!_0-9-]\}" />
+ <RegExpr attribute="Variable" context="#stay" String="\$\{#&varname;\}" />
+ <RegExpr attribute="Variable" context="#stay" String="\$\{!&varname;\*?\}" />
+ <RegExpr attribute="Variable" context="VarBrace" String="\$\{&varname;" />
+ <RegExpr attribute="Variable" context="VarBrace" String="\$\{[*@#?$!_0-9-](?=[:#%/])" />
+ <StringDetect attribute="Variable" context="ExprDblParenSubst" String="$((" beginRegion="expression" />
+ <StringDetect attribute="Redirection" context="SubstFile" String="$(&lt;" />
+ <StringDetect attribute="Variable" context="SubstCommand" String="$(" />
+ <DetectChar attribute="Backquote" context="SubstBackq" char="`" />
+ <RegExpr attribute="Escape" context="#stay" String="\\[`$\\]" />
+ </context>
+
+
+
+
+
+<!-- ====== These are the contexts that can be branched to ======= -->
+
+ <!-- ExprDblParen consumes an expression started in command mode till )) -->
+ <context attribute="Normal Text" lineEndContext="#stay" name="ExprDblParen">
+ <Detect2Chars attribute="Keyword" context="#pop" char=")" char1=")" endRegion="expression" />
+ <DetectChar attribute="Normal Text" context="ExprSubParen" char="(" />
+ <IncludeRules context="FindMost" />
+ </context>
+
+ <!-- ExprDblParenSubst like ExprDblParen but matches )) as Variable -->
+ <context attribute="Normal Text" lineEndContext="#stay" name="ExprDblParenSubst">
+ <Detect2Chars attribute="Variable" context="#pop" char=")" char1=")" endRegion="expression" />
+ <DetectChar attribute="Normal Text" context="ExprSubParen" char="(" />
+ <IncludeRules context="FindMost" />
+ </context>
+
+ <!-- ExprSubParen consumes an expression till ) -->
+ <context attribute="Normal Text" lineEndContext="#stay" name="ExprSubParen">
+ <DetectChar attribute="Normal Text" context="#pop" char=")" />
+ <DetectChar attribute="Normal Text" context="ExprSubParen" char="(" />
+ <IncludeRules context="FindMost" />
+ </context>
+
+ <!-- ExprBracket consumes an expression till ] -->
+ <context attribute="Normal Text" lineEndContext="#stay" name="ExprBracket">
+ <RegExpr attribute="Builtin" context="#pop" String="\s\](?=($|[\s;|&amp;]))" endRegion="expression" />
+ <RegExpr attribute="Builtin" context="#pop" String="\](?=($|[\s;|&amp;]))" endRegion="expression" column="0"/>
+ <DetectChar attribute="Normal Text" context="ExprSubParen" char="(" />
+ <IncludeRules context="FindMost" />
+ </context>
+
+ <!-- ExprDblBracket consumes an expression till ]] -->
+ <context attribute="Normal Text" lineEndContext="#stay" name="ExprDblBracket">
+ <RegExpr attribute="Keyword" context="#pop" String="\s\]\](?=($|[\s;|&amp;]))" endRegion="expression" />
+ <RegExpr attribute="Keyword" context="#pop" String="\]\](?=($|[\s;|&amp;]))" endRegion="expression" column="0"/>
+ <DetectChar attribute="Normal Text" context="ExprSubParen" char="(" />
+ <IncludeRules context="FindMost" />
+ </context>
+
+ <!-- Group consumes shell input till } -->
+ <context attribute="Normal Text" lineEndContext="#stay" name="Group">
+ <DetectChar attribute="Keyword" context="#pop" char="}" endRegion="group" />
+ <IncludeRules context="FindAll" />
+ </context>
+
+ <!-- SubShell consumes shell input till ) -->
+ <context attribute="Normal Text" lineEndContext="#stay" name="SubShell">
+ <DetectChar attribute="Keyword" context="#pop" char=")" endRegion="subshell" />
+ <IncludeRules context="FindAll" />
+ </context>
+
+ <!-- Assign consumes an expression till EOL or whitespace -->
+ <context attribute="Normal Text" lineEndContext="#pop" name="Assign" fallthrough="true" fallthroughContext="#pop">
+ <DetectChar attribute="Variable" context="AssignArray" char="(" />
+ <IncludeRules context="FindStrings" />
+ <IncludeRules context="FindSubstitutions" />
+ <IncludeRules context="FindOthers" />
+ <RegExpr attribute="Normal Text" context="#stay" String="[\w:,+_./-]+" />
+ </context>
+
+ <!-- AssignArray consumes everything till ), marking assignments -->
+ <context attribute="Normal Text" lineEndContext="#pop" name="AssignArray">
+ <DetectChar attribute="Variable" context="#pop" char=")" />
+ <DetectChar attribute="Variable" context="Subscript" char="[" />
+ <DetectChar attribute="Variable" context="Assign" char="=" />
+ <IncludeRules context="FindMost" />
+ </context>
+
+ <!-- AssignSubscr first expects a [ then parses subscript and continues with '=value' -->
+ <context attribute="Normal Text" lineEndContext="#pop" name="AssignSubscr" fallthrough="true" fallthroughContext="#pop">
+ <DetectChar attribute="Variable" context="Subscript" char="[" />
+ <DetectChar attribute="Variable" context="Assign" char="=" />
+ <IncludeRules context="FindStrings" />
+ <IncludeRules context="FindSubstitutions" />
+ <IncludeRules context="FindOthers" />
+ </context>
+
+ <!-- Subscript consumes anything till ], marks as Variable -->
+ <context attribute="Variable" lineEndContext="#stay" name="Subscript">
+ <DetectChar attribute="Variable" context="#pop" char="]" />
+ <IncludeRules context="FindStrings" />
+ <IncludeRules context="FindSubstitutions" />
+ <IncludeRules context="FindOthers" />
+ </context>
+
+ <!-- FunctionDef consumes a name, possibly with (), marks as Function -->
+ <context attribute="Function" lineEndContext="#pop" name="FunctionDef" fallthrough="true" fallthroughContext="#pop">
+ <RegExpr attribute="Function" context="#pop" String="\s+&funcname;(\s*\(\))?" />
+ </context>
+
+ <!-- VarName consumes spare variable names and assignments -->
+ <context attribute="Normal Text" lineEndContext="#pop" name="VarName" fallthrough="true" fallthroughContext="#pop">
+ <!-- handle command line options -->
+ <RegExpr attribute="Option" context="#stay" String="-[A-Za-z0-9]+" />
+ <RegExpr attribute="Option" context="#stay" String="--[a-z][A-Za-z0-9_-]*" />
+ <RegExpr attribute="Variable" context="#stay" String="\b&varname;" />
+ <DetectChar attribute="Variable" context="Subscript" char="[" />
+ <DetectChar attribute="Variable" context="Assign" char="=" />
+ <IncludeRules context="FindMost" />
+ <!-- stay here in spaces and other safe characters -->
+ <RegExpr attribute="Normal Text" context="#stay" String="[^]})|;`&amp;&gt;&lt;]" />
+ </context>
+
+ <!-- ProcessSubst handles <(command) and >(command) -->
+ <context attribute="Normal Text" lineEndContext="#stay" name="ProcessSubst">
+ <DetectChar attribute="Redirection" context="#pop" char=")" />
+ <IncludeRules context="FindCommentsParen" />
+ <IncludeRules context="FindCommands" />
+ <IncludeRules context="FindStrings" />
+ <IncludeRules context="FindSubstitutions" />
+ <IncludeRules context="FindOthers" />
+ </context>
+
+ <!-- StringSQ consumes anything till ' -->
+ <context attribute="String SingleQ" lineEndContext="#stay" name="StringSQ">
+ <DetectChar attribute="String SingleQ" context="#pop" char="'" />
+ </context>
+
+ <!-- StringDQ consumes anything till ", substitutes vars and expressions -->
+ <context attribute="String DoubleQ" lineEndContext="#stay" name="StringDQ">
+ <DetectChar attribute="String DoubleQ" context="#pop" char="&quot;" />
+ <RegExpr attribute="String Escape" context="#stay" String="\\[`&quot;\\$\n]" />
+ <IncludeRules context="FindSubstitutions" />
+ </context>
+
+ <!-- StringEsc eats till ', but escaping many characters -->
+ <context attribute="String SingleQ" lineEndContext="#stay" name="StringEsc">
+ <DetectChar attribute="String SingleQ" context="#pop" char="'" />
+ <RegExpr attribute="String Escape" context="#stay" String="\\[abefnrtv\\']" />
+ <RegExpr attribute="String Escape" context="#stay" String="\\([0-7]{1,3}|x[A-Fa-f0-9]{1,2}|c.)" />
+ </context>
+
+ <!-- VarBrace is called as soon as ${xxx is encoutered -->
+ <context attribute="Variable" lineEndContext="#stay" name="VarBrace">
+ <DetectChar attribute="Variable" context="#pop" char="}" />
+ <DetectChar attribute="Variable" context="Subscript" char="[" />
+ <IncludeRules context="FindStrings" />
+ <IncludeRules context="FindSubstitutions" />
+ <!-- TODO: highlight various special parameter expansions } -->
+ </context>
+
+ <!-- SubstFile is called after a <( or >( is encoutered -->
+ <context attribute="Normal Text" lineEndContext="#stay" name="SubstFile">
+ <DetectChar attribute="Redirection" context="#pop" char=")" />
+ <IncludeRules context="FindCommentsParen" />
+ <IncludeRules context="FindStrings" />
+ <IncludeRules context="FindSubstitutions" />
+ <IncludeRules context="FindOthers" />
+ </context>
+
+ <!-- SubstCommand is called after a $( is encountered -->
+ <context attribute="Normal Text" lineEndContext="#stay" name="SubstCommand">
+ <DetectChar attribute="Variable" context="#pop" char=")" />
+ <IncludeRules context="FindCommentsParen" />
+ <IncludeRules context="FindCommands" />
+ <IncludeRules context="FindStrings" />
+ <IncludeRules context="FindSubstitutions" />
+ <IncludeRules context="FindOthers" />
+ </context>
+
+ <!-- SubstBackq is called when a backquote is encountered -->
+ <context attribute="Normal Text" lineEndContext="#stay" name="SubstBackq">
+ <DetectChar attribute="Keyword" context="#pop" char="`" />
+ <IncludeRules context="FindCommentsBackq" />
+ <IncludeRules context="FindCommands" />
+ <IncludeRules context="FindStrings" />
+ <IncludeRules context="FindSubstitutions" />
+ <IncludeRules context="FindOthers" />
+ </context>
+
+ <!-- Case is called after the case keyword is encoutered. We handle this because of
+ the lonely closing parentheses that would otherwise disturb the expr matching -->
+ <context attribute="Normal Text" lineEndContext="#stay" name="Case">
+ <RegExpr attribute="Keyword" context="CaseIn" String="\sin\b" />
+ <IncludeRules context="FindMost" />
+ </context>
+
+ <!-- CaseIn is called when the construct 'case ... in' has been found. -->
+ <context attribute="Normal Text" lineEndContext="#stay" name="CaseIn">
+ <RegExpr attribute="Keyword" context="#pop#pop" String="\besac(?=$|[\s;)])" endRegion="case" />
+ <DetectChar attribute="Keyword" context="CaseExpr" char=")" beginRegion="caseexpr" />
+ <AnyChar attribute="Keyword" context="#stay" String="(|" />
+ <IncludeRules context="FindMost" />
+ </context>
+
+ <!-- CaseExpr eats shell input till ;; -->
+ <context attribute="Normal Text" lineEndContext="#stay" name="CaseExpr">
+ <Detect2Chars attribute="Keyword" context="#pop" char=";" char1=";" endRegion="caseexpr" />
+ <IncludeRules context="FindAll" />
+ </context>
+
+ <!-- HereDoc consumes Here-documents. It is called at the beginning of the "<<" construct. -->
+ <context attribute="Normal Text" lineEndContext="#stay" name="HereDoc">
+ <RegExpr attribute="Redirection" context="HereDocQ" String="(&lt;&lt;\s*&quot;(&word;)&quot;)" lookAhead="true" />
+ <RegExpr attribute="Redirection" context="HereDocQ" String="(&lt;&lt;\s*'(&word;)')" lookAhead="true" />
+ <RegExpr attribute="Redirection" context="HereDocQ" String="(&lt;&lt;\s*\\(&word;))" lookAhead="true" />
+ <RegExpr attribute="Redirection" context="HereDocNQ" String="(&lt;&lt;(?!-)\s*(&word;))" lookAhead="true" />
+ <RegExpr attribute="Redirection" context="HereDocIQ" String="(&lt;&lt;-\s*&quot;(&word;)&quot;)" lookAhead="true" />
+ <RegExpr attribute="Redirection" context="HereDocIQ" String="(&lt;&lt;-\s*'(&word;)')" lookAhead="true" />
+ <RegExpr attribute="Redirection" context="HereDocIQ" String="(&lt;&lt;-\s*\\(&word;))" lookAhead="true" />
+ <RegExpr attribute="Redirection" context="HereDocINQ" String="(&lt;&lt;-\s*(&word;))" lookAhead="true" />
+ <StringDetect attribute="Redirection" context="#pop" String="&lt;&lt;" /><!-- always met -->
+ </context>
+
+ <context attribute="Normal Text" lineEndContext="#pop" name="HereDocRemainder">
+ <IncludeRules context="FindAll" />
+ </context>
+
+ <context attribute="Normal Text" lineEndContext="#stay" name="HereDocQ" dynamic="true">
+ <RegExpr attribute="Redirection" context="HereDocRemainder" String="%1" dynamic="true" />
+ <RegExpr attribute="Redirection" context="#pop#pop" String="%2[\s;]*$" dynamic="true" column="0"/>
+ </context>
+
+ <context attribute="Normal Text" lineEndContext="#stay" name="HereDocNQ" dynamic="true">
+ <RegExpr attribute="Redirection" context="HereDocRemainder" String="%1" dynamic="true" />
+ <RegExpr attribute="Redirection" context="#pop#pop" String="%2[\s;]*$" dynamic="true" column="0"/>
+ <IncludeRules context="FindSubstitutions" />
+ </context>
+
+ <context attribute="Normal Text" lineEndContext="#stay" name="HereDocIQ" dynamic="true">
+ <RegExpr attribute="Redirection" context="HereDocRemainder" String="%1" dynamic="true" />
+ <RegExpr attribute="Redirection" context="#pop#pop" String="\s*%2[\s;]*$" dynamic="true" column="0"/>
+ </context>
+
+ <context attribute="Normal Text" lineEndContext="#stay" name="HereDocINQ" dynamic="true">
+ <RegExpr attribute="Redirection" context="HereDocRemainder" String="%1" dynamic="true" />
+ <RegExpr attribute="Redirection" context="#pop#pop" String="\s*%2[\s;]*$" dynamic="true" column="0"/>
+ <IncludeRules context="FindSubstitutions" />
+ </context>
+
+ </contexts>
+
+ <itemDatas>
+ <itemData name="Normal Text" defStyleNum="dsNormal" />
+ <itemData name="Comment" defStyleNum="dsComment" />
+ <itemData name="Keyword" defStyleNum="dsKeyword" />
+ <itemData name="Control" defStyleNum="dsKeyword" />
+ <itemData name="Builtin" defStyleNum="dsKeyword" color="#808" />
+ <itemData name="Command" defStyleNum="dsKeyword" color="#c0c" />
+ <itemData name="Redirection" defStyleNum="dsKeyword" color="#238" />
+ <itemData name="Escape" defStyleNum="dsDataType" />
+ <itemData name="String SingleQ" defStyleNum="dsString" />
+ <itemData name="String DoubleQ" defStyleNum="dsString" />
+ <itemData name="Backquote" defStyleNum="dsKeyword" />
+ <itemData name="String Transl." defStyleNum="dsString" />
+ <itemData name="String Escape" defStyleNum="dsDataType" />
+ <itemData name="Variable" defStyleNum="dsOthers" />
+ <itemData name="Expression" defStyleNum="dsOthers" />
+ <itemData name="Function" defStyleNum="dsChar" bold="1" />
+ <itemData name="Path" defStyleNum="dsNormal" />
+ <itemData name="Option" defStyleNum="dsNormal" />
+ </itemDatas>
+ </highlighting>
+ <general>
+ <comments>
+ <comment name="singleLine" start="#"/>
+ </comments>
+ <keywords casesensitive="1" weakDeliminator="^%#[]$._{}:-" additionalDeliminator="`"/>
+ </general>
+</language>
diff --git a/kate/data/bibtex.xml b/kate/data/bibtex.xml
new file mode 100644
index 000000000..b1c225521
--- /dev/null
+++ b/kate/data/bibtex.xml
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+<language name="BibTeX" version="1.13" kateversion="2.4" extensions="*.bib" section="Markup" mimetype="text/x-bib" casesensitive="1" author="Jeroen Wijnhout (Jeroen.Wijnhout@kdemail.net)" license="LGPL">
+ <highlighting>
+ <list name="kw_entry">
+ <item>@article</item>
+ <item>@book</item>
+ <item>@booklet</item>
+ <item>@conference</item>
+ <item>@inbook</item>
+ <item>@incollection</item>
+ <item>@inproceedings</item>
+ <item>@manual</item>
+ <item>@mastersthesis</item>
+ <item>@misc</item>
+ <item>@phdthesis</item>
+ <item>@proceedings</item>
+ <item>@techreport</item>
+ <item>@unpublished</item>
+ <item>@collection</item>
+ <item>@patent</item>
+ </list>
+ <list name="kw_command">
+ <item>@string</item>
+ <item>@preamble</item>
+ <item>@comment</item>
+ </list>
+ <contexts>
+ <context name="Normal" attribute="Normal Text" lineEndContext="#stay">
+ <RegExpr String="([a-zA-Z]+)\s*=" attribute="Field" context="#stay" firstNonSpace="true" />
+ <keyword String="kw_entry" attribute="Entry" context="Entry"/>
+ <keyword String="kw_command" attribute="Command" context="#stay"/>
+ <DetectChar char="{" attribute="Normal Text" context="#stay" beginRegion="block" />
+ <DetectChar char="}" attribute="Normal Text" context="#stay" endRegion="block" />
+ <RegExpr String="\\([a-zA-Z]+|.)" attribute="Char" context="#stay"/>
+ <DetectChar char="&quot;" attribute="String" context="String"/>
+ </context>
+
+ <context name="Entry" attribute="Ref Key" lineEndContext="#stay">
+ <DetectChar char="," attribute="Normal Text" context="#pop"/>
+ <DetectChar char="{" attribute="Normal Text" context="#stay" beginRegion="block" />
+ <DetectChar char="}" attribute="Normal Text" context="#stay" endRegion="block" />
+ <RegExpr String="\\([a-zA-Z]+|.)" attribute="Char" context="#stay"/>
+ <DetectChar char="&quot;" attribute="String" context="#pop"/>
+ </context>
+
+ <context name="String" attribute="String" lineEndContext="#stay">
+ <RegExpr String="\\([a-zA-Z]+|.)" attribute="Char" context="#stay"/>
+ <DetectChar char="&quot;" attribute="String" context="#pop"/>
+ </context>
+ </contexts>
+ <itemDatas>
+ <itemData name="Normal Text" defStyleNum="dsNormal"/>
+ <itemData name="Entry" defStyleNum="dsKeyword" color="#0000ff"/>
+ <itemData name="Command" defStyleNum="dsFunction"/>
+ <itemData name="Field" defStyleNum="dsDataType"/>
+ <itemData name="Ref Key" defStyleNum="dsOthers"/>
+ <itemData name="String" defStyleNum="dsString"/>
+ <itemData name="Char" defStyleNum="dsChar"/>
+ </itemDatas>
+ </highlighting>
+ <general>
+ <keywords casesensitive="0" weakDeliminator="\" wordWrapDeliminator=",{}[]"/>
+ </general>
+</language>
diff --git a/kate/data/c.xml b/kate/data/c.xml
new file mode 100644
index 000000000..d4e8f1dd4
--- /dev/null
+++ b/kate/data/c.xml
@@ -0,0 +1,167 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+<language name="C" version="1.25" kateversion="2.4" section="Sources" extensions="*.c;*.C;*.h" mimetype="text/x-csrc;text/x-c++src;text/x-chdr" priority="5">
+ <highlighting>
+ <list name="keywords">
+ <item> break </item>
+ <item> case </item>
+ <item> continue </item>
+ <item> default </item>
+ <item> do </item>
+ <item> else </item>
+ <item> enum </item>
+ <item> extern </item>
+ <item> for </item>
+ <item> goto </item>
+ <item> if </item>
+ <item> inline </item>
+ <item> return </item>
+ <item> sizeof </item>
+ <item> struct </item>
+ <item> switch </item>
+ <item> typedef </item>
+ <item> union </item>
+ <item> while </item>
+ </list>
+ <list name="types">
+ <item> auto </item>
+ <item> char </item>
+ <item> const </item>
+ <item> double </item>
+ <item> float </item>
+ <item> int </item>
+ <item> long </item>
+ <item> register </item>
+ <item> restrict </item>
+ <item> short </item>
+ <item> signed </item>
+ <item> static </item>
+ <item> unsigned </item>
+ <item> void </item>
+ <item> volatile </item>
+ <item> int8_t </item>
+ <item> int16_t </item>
+ <item> int32_t </item>
+ <item> int64_t </item>
+ <item> uint8_t </item>
+ <item> uint16_t </item>
+ <item> uint32_t </item>
+ <item> uint64_t </item>
+ <item> wchar_t </item>
+ <item> _Imaginary </item>
+ <item> _Complex </item>
+ <item> _Bool </item>
+ </list>
+ <contexts>
+ <context attribute="Normal Text" lineEndContext="#stay" name="Normal">
+ <DetectSpaces />
+ <RegExpr attribute="Preprocessor" context="Outscoped" String="#\s*if\s+0" beginRegion="Outscoped" firstNonSpace="true" />
+ <DetectChar attribute="Preprocessor" context="Preprocessor" char="#" firstNonSpace="true" />
+ <StringDetect attribute="Region Marker" context="Region Marker" String="//BEGIN" beginRegion="Region1" firstNonSpace="true" />
+ <StringDetect attribute="Region Marker" context="Region Marker" String="//END" endRegion="Region1" firstNonSpace="true" />
+ <keyword attribute="Keyword" context="#stay" String="keywords"/>
+ <keyword attribute="Data Type" context="#stay" String="types"/>
+ <DetectIdentifier />
+ <DetectChar attribute="Symbol" context="#stay" char="{" beginRegion="Brace1" />
+ <DetectChar attribute="Symbol" context="#stay" char="}" endRegion="Brace1" />
+ <Float attribute="Float" context="#stay">
+ <AnyChar String="fF" attribute="Float" context="#stay"/>
+ </Float>
+ <HlCOct attribute="Octal" context="#stay"/>
+ <HlCHex attribute="Hex" context="#stay"/>
+ <Int attribute="Decimal" context="#stay" >
+ <StringDetect attribute="Decimal" context="#stay" String="ULL" insensitive="TRUE"/>
+ <StringDetect attribute="Decimal" context="#stay" String="LUL" insensitive="TRUE"/>
+ <StringDetect attribute="Decimal" context="#stay" String="LLU" insensitive="TRUE"/>
+ <StringDetect attribute="Decimal" context="#stay" String="UL" insensitive="TRUE"/>
+ <StringDetect attribute="Decimal" context="#stay" String="LU" insensitive="TRUE"/>
+ <StringDetect attribute="Decimal" context="#stay" String="LL" insensitive="TRUE"/>
+ <StringDetect attribute="Decimal" context="#stay" String="U" insensitive="TRUE"/>
+ <StringDetect attribute="Decimal" context="#stay" String="L" insensitive="TRUE"/>
+ </Int>
+ <HlCChar attribute="Char" context="#stay"/>
+ <DetectChar attribute="String" context="String" char="&quot;"/>
+ <IncludeRules context="##Doxygen" />
+ <Detect2Chars attribute="Comment" context="Commentar 1" char="/" char1="/"/>
+ <Detect2Chars attribute="Comment" context="Commentar 2" char="/" char1="*" beginRegion="Comment"/>
+ <AnyChar attribute="Symbol" context="#stay" String=":!%&amp;()+,-/.*&lt;=&gt;?[]|~^&#59;"/>
+ </context>
+ <context attribute="String" lineEndContext="#pop" name="String">
+ <LineContinue attribute="String" context="#stay"/>
+ <HlCStringChar attribute="String Char" context="#stay"/>
+ <DetectChar attribute="String" context="#pop" char="&quot;"/>
+ </context>
+ <context attribute="Region Marker" lineEndContext="#pop" name="Region Marker">
+ </context>
+ <context attribute="Comment" lineEndContext="#pop" name="Commentar 1">
+ <IncludeRules context="##Alerts" />
+ </context>
+ <context attribute="Comment" lineEndContext="#stay" name="Commentar 2">
+ <Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" endRegion="Comment"/>
+ <IncludeRules context="##Alerts" />
+ </context>
+ <context attribute="Preprocessor" lineEndContext="#pop" name="Preprocessor">
+ <LineContinue attribute="Preprocessor" context="#stay"/>
+ <RegExpr attribute="Preprocessor" context="Define" String="define.*((?=\\))"/>
+ <RegExpr attribute="Preprocessor" context="#stay" String="define.*"/>
+ <RangeDetect attribute="Prep. Lib" context="#stay" char="&quot;" char1="&quot;"/>
+ <RangeDetect attribute="Prep. Lib" context="#stay" char="&lt;" char1="&gt;"/>
+ <IncludeRules context="##Doxygen" />
+ <Detect2Chars attribute="Comment" context="Commentar/Preprocessor" char="/" char1="*" beginRegion="Comment2"/>
+ </context>
+ <context attribute="Preprocessor" lineEndContext="#pop" name="Define">
+ <LineContinue attribute="Preprocessor" context="#stay"/>
+ </context>
+ <context attribute="Comment" lineEndContext="#stay" name="Commentar/Preprocessor">
+ <Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" endRegion="Comment2" />
+ </context>
+ <context attribute="Comment" lineEndContext="#stay" name="Outscoped" >
+ <DetectSpaces />
+ <IncludeRules context="##Alerts" />
+ <DetectIdentifier />
+ <DetectChar attribute="String" context="String" char="&quot;"/>
+ <IncludeRules context="##Doxygen" />
+ <Detect2Chars attribute="Comment" context="Commentar 1" char="/" char1="/"/>
+ <Detect2Chars attribute="Comment" context="Commentar 2" char="/" char1="*" beginRegion="Comment"/>
+ <RegExpr attribute="Comment" context="Outscoped intern" String="#\s*if" beginRegion="Outscoped" firstNonSpace="true" />
+ <RegExpr attribute="Preprocessor" context="#pop" String="#\s*(endif|else|elif)" endRegion="Outscoped" firstNonSpace="true" />
+ </context>
+ <context attribute="Comment" lineEndContext="#stay" name="Outscoped intern">
+ <DetectSpaces />
+ <IncludeRules context="##Alerts" />
+ <DetectIdentifier />
+ <DetectChar attribute="String" context="String" char="&quot;"/>
+ <IncludeRules context="##Doxygen" />
+ <Detect2Chars attribute="Comment" context="Commentar 1" char="/" char1="/"/>
+ <Detect2Chars attribute="Comment" context="Commentar 2" char="/" char1="*" beginRegion="Comment"/>
+ <RegExpr attribute="Comment" context="Outscoped intern" String="#\s*if" beginRegion="Outscoped" firstNonSpace="true" />
+ <RegExpr attribute="Comment" context="#pop" String="#\s*endif" endRegion="Outscoped" firstNonSpace="true" />
+ </context>
+ </contexts>
+ <itemDatas>
+ <itemData name="Normal Text" defStyleNum="dsNormal"/>
+ <itemData name="Keyword" defStyleNum="dsKeyword"/>
+ <itemData name="Data Type" defStyleNum="dsDataType"/>
+ <itemData name="Decimal" defStyleNum="dsDecVal"/>
+ <itemData name="Octal" defStyleNum="dsBaseN"/>
+ <itemData name="Hex" defStyleNum="dsBaseN"/>
+ <itemData name="Float" defStyleNum="dsFloat"/>
+ <itemData name="Char" defStyleNum="dsChar"/>
+ <itemData name="String" defStyleNum="dsString"/>
+ <itemData name="String Char" defStyleNum="dsChar"/>
+ <itemData name="Comment" defStyleNum="dsComment"/>
+ <itemData name="Symbol" defStyleNum="dsNormal"/>
+ <itemData name="Preprocessor" defStyleNum="dsOthers"/>
+ <itemData name="Prep. Lib" defStyleNum="dsOthers"/> <!--,Qt::darkYellow,Qt::yellow,false,false)); -->
+ <itemData name="Alert" defStyleNum="dsAlert" />
+ <itemData name="Region Marker" defStyleNum="dsRegionMarker" />
+ </itemDatas>
+ </highlighting>
+ <general>
+ <comments>
+ <comment name="singleLine" start="//" />
+ <comment name="multiLine" start="/*" end="*/" />
+ </comments>
+ <keywords casesensitive="1" additionalDeliminator="'&quot;" />
+ </general>
+</language>
diff --git a/kate/data/cg.xml b/kate/data/cg.xml
new file mode 100644
index 000000000..338d0d23a
--- /dev/null
+++ b/kate/data/cg.xml
@@ -0,0 +1,288 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+
+<!--
+ ** Cg Syntax Rules **
+
+ NOTES:
+ - some stuff stolen from c.xml
+
+ TODO:
+ - some exotic keywords are missing, find out which; the spec is a bloody mess
+
+2004-05-25
+ * Initial release
+2004-05-27
+ * Added swizzle highlighting
+ * Added stdlib function highlighting
+2004-12-07 (julien.antille at kdemail.net)
+ * Added COLOR1 through COLOR3 output sementics, for Multiple Render Targets (MRTs).
+ * Added FACE sementic for the new fp40 profile
+-->
+
+<language name="Cg" section="Sources" extensions="*.cg" mimetype="text/x-cgsrc" version="1.11" kateversion="2.4" author="Florian Schanda (florian.schanda@schanda.de)" license="LGPL">
+ <highlighting>
+ <list name="binding">
+ <item>POSITION</item>
+ <item>COLOR</item>
+ <item>COLOR0</item>
+ <item>COLOR1</item>
+ <item>COLOR2</item>
+ <item>COLOR3</item>
+ <item>TEXCOORD0</item>
+ <item>TEXCOORD1</item>
+ <item>TEXCOORD2</item>
+ <item>TEXCOORD3</item>
+ <item>TEXCOORD4</item>
+ <item>TEXCOORD5</item>
+ <item>TEXCOORD6</item>
+ <item>TEXCOORD7</item>
+ <item>TEXCOORD8</item>
+ <item>TEXCOORD9</item>
+ <item>TEXCOORD10</item>
+ <item>TEXCOORD11</item>
+ <item>TEXCOORD12</item>
+ <item>TEXCOORD13</item>
+ <item>TEXCOORD14</item>
+ <item>TEXCOORD15</item>
+ <item>TEXUNIT0</item>
+ <item>TEXUNIT1</item>
+ <item>TEXUNIT2</item>
+ <item>TEXUNIT3</item>
+ <item>TEXUNIT4</item>
+ <item>TEXUNIT5</item>
+ <item>TEXUNIT6</item>
+ <item>TEXUNIT7</item>
+ <item>TEXUNIT8</item>
+ <item>TEXUNIT9</item>
+ <item>TEXUNIT10</item>
+ <item>TEXUNIT11</item>
+ <item>TEXUNIT12</item>
+ <item>TEXUNIT13</item>
+ <item>TEXUNIT14</item>
+ <item>TEXUNIT15</item>
+ <item>WPOS</item>
+ <item>DEPTH</item>
+ <item>BLENDWEIGHT</item>
+ <item>NORMAL</item>
+ <item>TESSFACTOR</item>
+ <item>FOGCOORD</item>
+ <item>PSIZE</item>
+ <item>BLENDINDICES</item>
+ <item>TANGENT</item>
+ <item>BINORMAL</item>
+ <item>FOG</item>
+ <item>BCOL0</item>
+ <item>BCOL1</item>
+ <item>FACE</item>
+ </list>
+ <list name="keywords">
+ <item>do</item>
+ <item>while</item>
+ <item>if</item>
+ <item>else</item>
+ <item>for</item>
+ <item>struct</item>
+ <item>return</item>
+ <item>static</item>
+ <item>typedef</item>
+ <item>discard</item>
+ <item>true</item>
+ <item>false</item>
+ </list>
+ <list name="types">
+ <item>bool</item>
+ <item>int</item>
+ <item>fixed</item>
+ <item>half</item>
+ <item>float</item>
+
+ <item>void</item>
+ <item>sampler</item>
+ <item>sampler1D</item>
+ <item>sampler2D</item>
+ <item>sampler3D</item>
+ <item>samplerCUBE</item>
+ <item>samplerRECT</item>
+
+ <item>packed</item>
+ <item>const</item>
+ <item>uniform</item>
+ <item>in</item>
+ <item>out</item>
+ <item>inout</item>
+ </list>
+ <list name="attention">
+ <item>FIXME</item>
+ <item>TODO</item>
+ <item>BUG</item>
+ </list>
+ <list name="stdlib">
+ <item>abs</item>
+ <item>acos</item>
+ <item>all</item>
+ <item>any</item>
+ <item>asin</item>
+ <item>atan</item>
+ <item>atan2</item>
+ <item>ceil</item>
+ <item>clamp</item>
+ <item>cos</item>
+ <item>cosh</item>
+ <item>cross</item>
+ <item>degrees</item> <!-- the spec got this wrong... -->
+ <item>determinant</item>
+ <item>dot</item>
+ <item>exp</item>
+ <item>exp2</item>
+ <item>floor</item>
+ <item>fmod</item>
+ <item>frac</item>
+ <item>frexp</item>
+ <item>isfinite</item>
+ <item>isinf</item>
+ <item>isnan</item>
+ <item>ldexp</item>
+ <item>lerp</item>
+ <item>lit</item>
+ <item>log</item>
+ <item>log2</item>
+ <item>log10</item>
+ <item>max</item>
+ <item>min</item>
+ <item>modf</item>
+ <item>mul</item>
+ <item>noise</item>
+ <item>pow</item>
+ <item>radians</item>
+ <item>round</item>
+ <item>rsqrt</item>
+ <item>saturate</item>
+ <item>sign</item>
+ <item>sin</item>
+ <item>sincos</item>
+ <item>sinh</item>
+ <item>smoothstep</item>
+ <item>step</item>
+ <item>sqrt</item>
+ <item>tan</item>
+ <item>tanh</item>
+ <item>transpose</item>
+ <item>distance</item>
+ <item>faceforward</item>
+ <item>length</item>
+ <item>normalize</item>
+ <item>reflect</item>
+ <item>refract</item>
+ <item>tex1D</item>
+ <item>tex1Dproj</item>
+ <item>tex2D</item>
+ <item>tex2Dproj</item>
+ <item>texRECT</item>
+ <item>texRECTproj</item>
+ <item>tex3D</item>
+ <item>tex3Dproj</item>
+ <item>texCUBE</item>
+ <item>texCUBEproj</item>
+ <item>ddx</item>
+ <item>ddy</item>
+ <item>debug</item>
+ <item>pack_2half</item>
+ <item>unpack_2half</item>
+ <item>pack_2ushort</item>
+ <item>unpack_2ushort</item>
+ <item>pack_4byte</item>
+ <item>unpack_4byte</item>
+ <item>pack_4ubyte</item>
+ <item>unpack_4ubyte</item>
+ </list>
+ <list name="stdstruct">
+ <item>fragout</item>
+ <item>fragout_float</item>
+ </list>
+ <contexts>
+ <context attribute="Normal Text" lineEndContext="#stay" name="Normal">
+ <keyword String="keywords" attribute="Keyword" context="#stay" />
+ <keyword String="binding" attribute="Binding" context="#stay" />
+ <keyword String="attention" attribute="Alert" context="#stay" />
+
+ <DetectChar attribute="Symbol" context="#stay" char="{" beginRegion="Brace1" />
+ <DetectChar attribute="Symbol" context="#stay" char="}" endRegion="Brace1" />
+
+ <RegExpr String="float[1234](x[1234])?" attribute="Data Type" context="#stay" />
+ <RegExpr String="half[1234](x[1234])?" attribute="Data Type" context="#stay" />
+ <RegExpr String="fixed[1234](x[1234])?" attribute="Data Type" context="#stay" />
+ <RegExpr String="bool[1234](x[1234])?" attribute="Data Type" context="#stay" />
+ <RegExpr String="int[1234](x[1234])?" attribute="Data Type" context="#stay" />
+ <keyword String="types" attribute="Data Type" context="#stay" />
+ <keyword String="stdstruct" attribute="Data Type" context="#stay" />
+
+ <RegExpr String="[0123456789]*[.][0123456789]+f" attribute="Float" context="#stay" />
+ <RegExpr String="[0123456789]*[.][0123456789]+h" attribute="Half" context="#stay" />
+ <RegExpr String="[0123456789]*[.][0123456789]+x" attribute="Fixed" context="#stay" />
+ <RegExpr String="[0123456789]*[.][0123456789]+" attribute="Float" context="#stay" />
+ <Int attribute="Decimal" context="#stay" />
+
+ <Detect2Chars attribute="Comment" context="Commentar 1" char="/" char1="/"/>
+ <Detect2Chars attribute="Comment" context="Commentar 2" char="/" char1="*" beginRegion="Comment"/>
+
+ <keyword String="stdlib" attribute="StdFunction" context="#stay" />
+
+ <RegExpr attribute="Function" context="#stay" String="\b[_\w][_\w\d]*(?=[\s]*[(])" />
+
+ <RegExpr attribute="Swizzle" context="#stay" String="[.]{1,1}[rgbaxyzw]+(?=[\s/*-+&lt;&gt;])" />
+
+ <RegExpr attribute="Symbol" context="Member" String="[.]{1,1}" />
+ <AnyChar attribute="Symbol" context="#stay" String=":!%&amp;()+,-/.*&lt;=&gt;?[]|~^&#59;"/>
+ </context>
+ <context name="Member" attribute="Normal Text" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop">
+ <RegExpr attribute="Function" context="#pop" String="\b[_\w][_\w\d]*(?=[\s]*)" />
+ </context>
+ <context name="Commentar 1" attribute="Comment" lineEndContext="#pop">
+ <keyword attribute="Alert" context="#stay" String="attention" />
+ </context>
+ <context name="Commentar 2" attribute="Comment" lineEndContext="#stay">
+ <Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" endRegion="Comment"/>
+ <keyword attribute="Alert" context="#stay" String="attention" />
+ </context>
+ <context name="Commentar/Preprocessor" attribute="Comment" lineEndContext="#stay">
+ <Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" endRegion="Comment2" />
+ </context>
+ <context name="Outscoped" attribute="Comment" lineEndContext="#stay">
+ <Detect2Chars attribute="Comment" context="Commentar 2" char="/" char1="*" beginRegion="Comment"/>
+ <keyword attribute="Alert" context="#stay" String="attention" />
+ <RegExpr attribute="Comment" context="Outscoped intern" String="#\s*if" beginRegion="Outscoped" firstNonSpace="true"/>
+ <RegExpr attribute="Preprocessor" context="#pop" String="#\s*(endif|else|elif)" endRegion="Outscoped" firstNonSpace="true"/>
+ </context>
+ <context name="Outscoped intern" attribute="Comment" lineEndContext="#stay">
+ <Detect2Chars attribute="Comment" context="Commentar 2" char="/" char1="*" beginRegion="Comment"/>
+ <RegExpr attribute="Comment" context="Outscoped intern" String="#\s*if" beginRegion="Outscoped" firstNonSpace="true"/>
+ <RegExpr attribute="Comment" context="#pop" String="#\s*endif" endRegion="Outscoped" firstNonSpace="true"/>
+ </context>
+ </contexts>
+ <itemDatas>
+ <itemData name="Normal Text" defStyleNum="dsNormal"/>
+ <itemData name="Binding" defStyleNum="dsKeyword"/>
+ <itemData name="Keyword" defStyleNum="dsKeyword"/>
+ <itemData name="Function" defStyleNum="dsFunction" bold="0"/>
+ <itemData name="StdFunction" defStyleNum="dsFunction" bold="1"/>
+ <itemData name="Data Type" defStyleNum="dsDataType"/>
+ <itemData name="Decimal" defStyleNum="dsDecVal"/>
+ <itemData name="Float" defStyleNum="dsFloat"/>
+ <itemData name="Half" defStyleNum="dsFloat"/>
+ <itemData name="Fixed" defStyleNum="dsFloat"/>
+ <itemData name="Symbol" defStyleNum="dsNormal"/>
+ <itemData name="Swizzle" defStyleNum="dsNormal" bold="1"/>
+ <itemData name="Comment" defStyleNum="dsComment"/>
+ <itemData name="Alert" defStyleNum="dsAlert" />
+ <itemData name="Error" defStyleNum="dsError" />
+ </itemDatas>
+ </highlighting>
+ <general>
+ <comments>
+ <comment name="singleLine" start="//" />
+ <comment name="multiLine" start="/*" end="*/" />
+ </comments>
+ <keywords casesensitive="1" />
+ </general>
+</language>
diff --git a/kate/data/cgis.xml b/kate/data/cgis.xml
new file mode 100644
index 000000000..dda121fe7
--- /dev/null
+++ b/kate/data/cgis.xml
@@ -0,0 +1,146 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+<language name="CGiS" version="1.02" kateversion="2.4" section="Sources" extensions="*.cgis" mimetype="">
+ <highlighting>
+ <list name="keywords">
+ <item> 1D </item>
+ <item> 2D </item>
+ <item> break </item>
+ <item> continue </item>
+ <item> do </item>
+ <item> else </item>
+ <item> extern </item>
+ <item> for </item>
+ <item> forall </item>
+ <item> foreach </item>
+ <item> function </item>
+ <item> if </item>
+ <item> in </item>
+ <item> inout </item>
+ <item> internal </item>
+ <item> out </item>
+ <item> reduction </item>
+ <item> return </item>
+ <item> struct </item>
+ <item> typedef </item>
+ <item> while </item>
+ </list>
+ <list name="types">
+ <item> bool </item>
+ <item> bool2 </item>
+ <item> bool3 </item>
+ <item> bool4 </item>
+ <item> int </item>
+ <item> int2 </item>
+ <item> int3 </item>
+ <item> int4 </item>
+ <item> half </item>
+ <item> half2 </item>
+ <item> half3 </item>
+ <item> half4 </item>
+ <item> float </item>
+ <item> float2 </item>
+ <item> float3 </item>
+ <item> float4 </item>
+ </list>
+ <contexts>
+ <context attribute="Normal Text" lineEndContext="#stay" name="Normal">
+ <DetectSpaces />
+ <StringDetect attribute="Keyword" context="#stay" String="PROGRAM" />
+ <StringDetect attribute="Keyword" context="Interface" String="INTERFACE" />
+ </context>
+
+ <context attribute="Normal Text" lineEndContext="#stay" name="Interface">
+ <DetectSpaces />
+ <StringDetect attribute="Keyword" context="Control" String="CONTROL" />
+ <StringDetect attribute="Keyword" context="Code" String="CODE" />
+
+ <IncludeRules context="Common" />
+ </context>
+
+ <context attribute="Normal Text" lineEndContext="#stay" name="Code">
+ <DetectSpaces />
+ <StringDetect attribute="Keyword" context="Control" String="CONTROL" />
+
+ <StringDetect attribute="Hint" context="Hint" String="#HINT" />
+
+ <IncludeRules context="Common" />
+ </context>
+
+ <context attribute="Normal Text" lineEndContext="#stay" name="Control">
+ <DetectSpaces />
+ <StringDetect attribute="Keyword" context="Code" String="CODE" />
+
+ <IncludeRules context="Common" />
+ </context>
+
+ <context attribute="Normal Text" lineEndContext="#stay" name="Common">
+ <StringDetect attribute="Region Marker" context="Region Marker" String="//BEGIN" beginRegion="Region1" firstNonSpace="true" />
+ <StringDetect attribute="Region Marker" context="Region Marker" String="//END" endRegion="Region1" firstNonSpace="true" />
+ <keyword attribute="Keyword" context="#stay" String="keywords"/>
+ <keyword attribute="Data Type" context="#stay" String="types"/>
+ <DetectIdentifier />
+ <DetectChar attribute="Symbol" context="#stay" char="{" beginRegion="Brace1" />
+ <DetectChar attribute="Symbol" context="#stay" char="}" endRegion="Brace1" />
+ <Float attribute="Float" context="#stay">
+ <AnyChar String="fF" attribute="Float" context="#stay"/>
+ </Float>
+ <HlCOct attribute="Octal" context="#stay"/>
+ <HlCHex attribute="Hex" context="#stay"/>
+ <Int attribute="Decimal" context="#stay"/>
+ <IncludeRules context="##Doxygen" />
+ <Detect2Chars attribute="Comment" context="Commentar 1" char="/" char1="/"/>
+ <Detect2Chars attribute="Comment" context="Commentar 2" char="/" char1="*" beginRegion="Comment"/>
+ </context>
+
+ <context attribute="Hint" lineEndContext="#stay" name="Hint">
+ <DetectSpaces />
+ <DetectChar attribute="Hint" context="#pop" char=")" />
+ <DetectIdentifier />
+ </context>
+
+ <context attribute="Region Marker" lineEndContext="#pop" name="Region Marker">
+ </context>
+ <context attribute="Comment" lineEndContext="#pop" name="Commentar 1">
+ <IncludeRules context="##Alerts" />
+ </context>
+ <context attribute="Comment" lineEndContext="#stay" name="Commentar 2">
+ <Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" endRegion="Comment"/>
+ <IncludeRules context="##Alerts" />
+ </context>
+ <context attribute="Region Marker" lineEndContext="#pop" name="Region Marker">
+ </context>
+ <context attribute="Comment" lineEndContext="#pop" name="Commentar 1">
+ <IncludeRules context="##Alerts" />
+ </context>
+ <context attribute="Comment" lineEndContext="#stay" name="Commentar 2">
+ <Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" endRegion="Comment"/>
+ <IncludeRules context="##Alerts" />
+ </context>
+ </contexts>
+ <itemDatas>
+ <itemData name="Normal Text" defStyleNum="dsNormal"/>
+ <itemData name="Keyword" defStyleNum="dsKeyword"/>
+ <itemData name="Data Type" defStyleNum="dsDataType"/>
+ <itemData name="Decimal" defStyleNum="dsDecVal"/>
+ <itemData name="Octal" defStyleNum="dsBaseN"/>
+ <itemData name="Hex" defStyleNum="dsBaseN"/>
+ <itemData name="Float" defStyleNum="dsFloat"/>
+ <itemData name="Char" defStyleNum="dsChar"/>
+ <itemData name="String" defStyleNum="dsString"/>
+ <itemData name="String Char" defStyleNum="dsChar"/>
+ <itemData name="Comment" defStyleNum="dsComment"/>
+ <itemData name="Symbol" defStyleNum="dsNormal"/>
+ <itemData name="Alert" defStyleNum="dsAlert" />
+ <itemData name="Region Marker" defStyleNum="dsRegionMarker" />
+ <itemData name="Hint " defStyleNum="dsOthers"/>
+ </itemDatas>
+ </highlighting>
+ <general>
+ <comments>
+ <comment name="singleLine" start="//" />
+ <comment name="multiLine" start="/*" end="*/" />
+ </comments>
+ <keywords casesensitive="1" />
+ </general>
+</language>
diff --git a/kate/data/changelog.xml b/kate/data/changelog.xml
new file mode 100644
index 000000000..aec339214
--- /dev/null
+++ b/kate/data/changelog.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+<language name="ChangeLog" version="1.04" kateversion="2.4" section="Other" extensions="ChangeLog" mimetype="" author="Dominik Haumann (dhdev@gmx.de)" license="LGPL">
+ <highlighting>
+ <contexts>
+ <context attribute="Normal Text" lineEndContext="#stay" name="Normal">
+ <DetectChar attribute="Entry" context="entry" char="*" firstNonSpace="true" />
+ <RegExpr attribute="Date" context="line" String="\d\d\d\d\s*-\s*\d\d\s*-\s*\d\d\s*" column="0"/>
+ </context>
+ <context attribute="Normal Text" lineEndContext="#pop" name="line">
+ <RegExpr attribute="Name" context="#stay" String="(\w\s*)+"/>
+ <RegExpr attribute="E-Mail" context="#pop" String="&lt;.*&gt;\s*$"/>
+ </context>
+ <context attribute="Normal Text" lineEndContext="#pop" name="entry">
+ <RegExpr attribute="Entry" context="#pop" String=".*:" minimal="true"/>
+ </context>
+ </contexts>
+ <itemDatas>
+ <itemData name="Normal Text" defStyleNum="dsNormal"/>
+ <itemData name="Name" defStyleNum="dsKeyword"/>
+ <itemData name="E-Mail" defStyleNum="dsOthers"/>
+ <itemData name="Date" defStyleNum="dsDataType"/>
+ <itemData name="Entry" defStyleNum="dsDecVal"/>
+ </itemDatas>
+ </highlighting>
+ <general>
+ <keywords casesensitive="1" />
+ </general>
+</language>
diff --git a/kate/data/cisco.xml b/kate/data/cisco.xml
new file mode 100644
index 000000000..47c788807
--- /dev/null
+++ b/kate/data/cisco.xml
@@ -0,0 +1,312 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+<language name="Cisco" version="1.10" kateversion="2.4" section="Configuration" extensions="*.cis" mimetype="text/cisco" author="Raphaël GRAPINET" license="LGPL">
+ <highlighting>
+ <list name = "commands">
+ <item> aaa </item>
+ <item> access-list </item>
+ <item> address </item>
+ <item> alias </item>
+ <item> arp </item>
+ <item> async-bootp </item>
+ <item> banner </item>
+ <item> boot </item>
+ <item> bridge </item>
+ <item> buffers </item>
+ <item> busy-message </item>
+ <item> call-history-mib </item>
+ <item> cdp </item>
+ <item> chat-script </item>
+ <item> class-map </item>
+ <item> clock </item>
+ <item> cns </item>
+ <item> config-register </item>
+ <item> controller </item>
+ <item> crypto </item>
+ <item> default </item>
+ <item> default-value </item>
+ <item> dialer </item>
+ <item> dialer-list </item>
+ <item> dnsix-dmdp </item>
+ <item> dnsix-nat </item>
+ <item> downward-compatible-config </item>
+ <item> enable </item>
+ <item> end </item>
+ <item> exception </item>
+ <item> exit </item>
+ <item> file </item>
+ <item> frame-relay </item>
+ <item> help </item>
+ <item> hostname </item>
+ <item> interface </item>
+ <item> ip </item>
+ <item> isdn </item>
+ <item> isdn-mib </item>
+ <item> kerberos </item>
+ <item> key </item>
+ <item> line </item>
+ <item> logging </item>
+ <item> login-string </item>
+ <item> map-class </item>
+ <item> map-list </item>
+ <item> memory-size </item>
+ <item> menu </item>
+ <item> modemcap </item>
+ <item> multilink </item>
+ <item> netbios </item>
+ <item> no </item>
+ <item> ntp </item>
+ <item> partition </item>
+ <item> policy-map </item>
+ <item> priority-list </item>
+ <item> privilege </item>
+ <item> process-max-time </item>
+ <item> prompt </item>
+ <item> queue-list </item>
+ <item> resume-string </item>
+ <item> rlogin </item>
+ <item> rmon </item>
+ <item> route-map </item>
+ <item> router </item>
+ <item> rtr </item>
+ <item> scheduler </item>
+ <item> service </item>
+ <item> snmp-server </item>
+ <item> sntp </item>
+ <item> stackmaker </item>
+ <item> state-machine </item>
+ <item> subscriber-policy </item>
+ <item> tacacs-server </item>
+ <item> template </item>
+ <item> terminal-queue </item>
+ <item> tftp-server </item>
+ <item> time-range </item>
+ <item> username </item>
+ <item> virtual-profile </item>
+ <item> virtual-template </item>
+ <item> vpdn </item>
+ <item> vpdn-group </item>
+ <item> x25 </item>
+ <item> x29 </item>
+ </list>
+ <list name = "parameters">
+ <item> accounting </item>
+ <item> accounting-list </item>
+ <item> accounting-threshold </item>
+ <item> accounting-transits </item>
+ <item> address-pool </item>
+ <item> as-path </item>
+ <item> audit </item>
+ <item> auth-proxy </item>
+ <item> authentication </item>
+ <item> authorization </item>
+ <item> bgp-community </item>
+ <item> bootp </item>
+ <item> cef </item>
+ <item> classless </item>
+ <item> community-list </item>
+ <item> default-gateway </item>
+ <item> default-network </item>
+ <item> dhcp </item>
+ <item> dhcp-server </item>
+ <item> domain-list </item>
+ <item> domain-lookup </item>
+ <item> domain-name </item>
+ <item> dvmrp </item>
+ <item> exec-callback </item>
+ <item> extcommunity-list </item>
+ <item> finger </item>
+ <item> flow-aggregation </item>
+ <item> flow-cache </item>
+ <item> flow-export </item>
+ <item> forward-protocol </item>
+ <item> ftp </item>
+ <item> gratuitous-arps </item>
+ <item> host </item>
+ <item> host-routing </item>
+ <item> hp-host </item>
+ <item> http </item>
+ <item> icmp </item>
+ <item> inspect </item>
+ <item> local </item>
+ <item> mrm </item>
+ <item> mroute </item>
+ <item> msdp </item>
+ <item> multicast </item>
+ <item> multicast-routing </item>
+ <item> name-server </item>
+ <item> nat </item>
+ <item> new-model </item>
+ <item> ospf </item>
+ <item> password </item>
+ <item> password-encryption </item>
+ <item> pgm </item>
+ <item> pim </item>
+ <item> port-map </item>
+ <item> prefix-list </item>
+ <item> radius </item>
+ <item> rcmd </item>
+ <item> reflexive-list </item>
+ <item> route </item>
+ <item> routing </item>
+ <item> rsvp </item>
+ <item> rtcp </item>
+ <item> sap </item>
+ <item> sdr </item>
+ <item> security </item>
+ <item> source-route </item>
+ <item> subnet-zero </item>
+ <item> tacacs </item>
+ <item> tcp </item>
+ <item> tcp-small-servers </item>
+ <item> telnet </item>
+ <item> tftp </item>
+ <item> timestamps </item>
+ <item> udp-small-servers </item>
+ <item> vrf </item>
+ <item> wccp </item>
+ </list>
+ <list name = "options">
+ <item> accounting </item>
+ <item> accounting-list </item>
+ <item> accounting-threshold </item>
+ <item> accounting-transits </item>
+ <item> address-pool </item>
+ <item> as-path </item>
+ <item> audit </item>
+ <item> auth-proxy </item>
+ <item> authentication </item>
+ <item> authorization </item>
+ <item> bgp-community </item>
+ <item> bootp </item>
+ <item> cef </item>
+ <item> classless </item>
+ <item> community-list </item>
+ <item> default-gateway </item>
+ <item> default-network </item>
+ <item> dhcp </item>
+ <item> dhcp-server </item>
+ <item> domain-list </item>
+ <item> domain-lookup </item>
+ <item> domain-name </item>
+ <item> dvmrp </item>
+ <item> exec-callback </item>
+ <item> extcommunity-list </item>
+ <item> finger </item>
+ <item> flow-aggregation </item>
+ <item> flow-cache </item>
+ <item> flow-export </item>
+ <item> forward-protocol </item>
+ <item> ftp </item>
+ <item> gratuitous-arps </item>
+ <item> host </item>
+ <item> host-routing </item>
+ <item> hp-host </item>
+ <item> http </item>
+ <item> icmp </item>
+ <item> inspect </item>
+ <item> local </item>
+ <item> mrm </item>
+ <item> mroute </item>
+ <item> msdp </item>
+ <item> multicast </item>
+ <item> multicast-routing </item>
+ <item> name-server </item>
+ <item> nat </item>
+ <item> new-model </item>
+ <item> ospf </item>
+ <item> password </item>
+ <item> password-encryption </item>
+ <item> pgm </item>
+ <item> pim </item>
+ <item> port-map </item>
+ <item> prefix-list </item>
+ <item> radius </item>
+ <item> rcmd </item>
+ <item> reflexive-list </item>
+ <item> route </item>
+ <item> routing </item>
+ <item> rsvp </item>
+ <item> rtcp </item>
+ <item> sap </item>
+ <item> sdr </item>
+ <item> security </item>
+ <item> source-route </item>
+ <item> subnet-zero </item>
+ <item> tacacs </item>
+ <item> tcp </item>
+ <item> tcp-small-servers </item>
+ <item> telnet </item>
+ <item> tftp </item>
+ <item> timestamps </item>
+ <item> udp-small-servers </item>
+ <item> vrf </item>
+ <item> wccp </item>
+ </list>
+ <contexts>
+ <context name = "Base" attribute = "Normal Text" lineEndContext = "#stay">
+ <RegExpr attribute="Keyword" context="#stay" String="\bdone\b" insensitive="TRUE" endRegion="dodone1"/>
+ <RegExpr attribute="Keyword" context="#stay" String="\bdo\b" insensitive="TRUE" beginRegion="dodone1"/>
+ <RegExpr attribute="Keyword" context="#stay" String="\belif\b" insensitive="TRUE" beginRegion="iffi1" endRegion="iffi1"/>
+ <RegExpr attribute="Keyword" context="#stay" String="\bif\b" insensitive="TRUE" beginRegion="iffi1"/>
+ <RegExpr attribute="Keyword" context="#stay" String="\bfi\b" insensitive="TRUE" endRegion="iffi1"/>
+ <RegExpr attribute="Keyword" context="#stay" String="\bcase\b" insensitive="TRUE" beginRegion="case1"/>
+ <RegExpr attribute="Keyword" context="#stay" String="\besac\b" insensitive="TRUE" endRegion="case1"/>
+ <RegExpr attribute="Keyword" context="#stay" String="[^()]+\)" insensitive="TRUE" beginRegion="subcase1" column="0"/>
+ <Detect2Chars attribute="Keyword" context="#stay" char=";" char1=";" endRegion="subcase1"/>
+ <DetectChar attribute="Keyword" context="#stay" char="{" beginRegion="func1"/>
+ <DetectChar attribute="Keyword" context="#stay" char="}" endRegion="func1"/>
+
+ <keyword String = "commands" attribute = "Command" context = "#stay"/>
+ <keyword String = "parameters" attribute = "Parameter" context = "#stay"/>
+ <keyword String = "options" attribute = "Keyword" context = "#stay"/>
+ <Int attribute = "Decimal" context = "#stay"/>
+ <RegExpr String = "\$[A-Za-z0-9_?{}!]+" attribute = "Parameter" context = "#stay"/>
+ <RangeDetect char = "&quot;" char1 = "&quot;" attribute = "String" context = "#stay"/>
+ <AnyChar String = "|&lt;&gt;=;" attribute = "Operator" context = "#stay"/>
+ <DetectChar char="'" attribute = "String" context = "Single Quote"/>
+ <DetectChar char="`" attribute = "Substitution" context = "Substitution"/>
+ <Detect2Chars attribute = "Normal Text" context = "#stay" char = "\" char1 = "#"/>
+ <RegExpr String= "#.*$" attribute = "Comment" context="#stay"/>
+
+ </context>
+ <context name = "String" attribute = "String" lineEndContext="#stay">
+ <Detect2Chars char = "\" char1 = "\" attribute = "String" context = "#stay"/>
+ <Detect2Chars char = "\" char1 = "&quot;" attribute = "String" context = "#stay"/>
+ <DetectChar char = "&quot;" attribute = "String" context = "#pop"/>
+ </context>
+ <context name = "Single Quote" attribute = "String" lineEndContext="#stay">
+ <Detect2Chars char = "\" char1 = "\" attribute = "String" context = "#stay"/>
+ <Detect2Chars char = "\" char1 = "'" attribute = "String" context = "#stay"/>
+ <DetectChar char = "'" attribute = "String" context = "#pop"/>
+ </context>
+ <context name = "Substitution" attribute = "Substitution" lineEndContext="#stay">
+ <Detect2Chars char = "\" char1 = "\" attribute = "String" context = "#stay"/>
+ <Detect2Chars char = "\" char1 = "`" attribute = "String" context = "#stay"/>
+ <DetectChar char = "`" attribute = "Substitution" context = "#pop"/>
+ </context>
+ <context name = "Parameter" attribute = "Parameter" lineEndContext="#stay">
+ <RegExpr String = "\$[A-Za-z0-9_?]+" attribute = "Parameter" context="#pop"/>
+ </context>
+ </contexts>
+ <itemDatas>
+ <itemData name = "Normal Text" defStyleNum = "dsNormal"/>
+ <itemData name = "Keyword" defStyleNum = "dsKeyword"/>
+ <itemData name = "Decimal" defStyleNum = "dsDecVal"/>
+ <itemData name = "Float" defStyleNum = "dsFloat"/>
+ <itemData name = "Char" defStyleNum = "dsChar"/>
+ <itemData name = "String" defStyleNum = "dsString"/>
+ <itemData name = "Comment" defStyleNum = "dsComment"/>
+ <itemData name = "Substitution" defStyleNum = "dsOthers"/>
+ <itemData name = "Parameter" defStyleNum = "dsOthers"/>
+ <itemData name = "Operator" defStyleNum = "dsOthers"/>
+ <itemData name = "Command" defStyleNum = "dsNormal"/>
+ </itemDatas>
+ </highlighting>
+ <general>
+ <comments>
+ <comment name="singleLine" start="!"/>
+ </comments>
+ <keywords casesensitive="0"/>
+ </general>
+</language>
diff --git a/kate/data/clipper.xml b/kate/data/clipper.xml
new file mode 100644
index 000000000..11bba638a
--- /dev/null
+++ b/kate/data/clipper.xml
@@ -0,0 +1,501 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+<language name="Clipper" version="1.05" kateversion="2.3" section="Sources" extensions="*.prg;*.PRG;*.ch" mimetype="text/x-clipper-src" priority="2" author="Andrey Cherepanov (sibskull@mail.ru)" license="GPL">
+ <highlighting>
+
+ <list name="keywords">
+ <!-- compiler directives and structures -->
+ <item> .and. </item>
+ <item> announce </item>
+ <item> begin </item>
+ <item> case </item>
+ <item> command </item>
+ <item> define </item>
+ <item> do </item>
+ <item> elseif </item>
+ <item> else </item>
+ <item> endcase </item>
+ <item> enddo </item>
+ <item> endif </item>
+ <item> error </item>
+ <item> exit </item>
+ <item> field </item>
+ <item> .f. </item>
+ <item> for </item>
+ <item> function </item>
+ <item> ifdef </item>
+ <item> if </item>
+ <item> include </item>
+ <item> init </item>
+ <item> inndef </item>
+ <item> local </item>
+ <item> memvar </item>
+ <item> next </item>
+ <item> nil </item>
+ <item> .not. </item>
+ <item> .or. </item>
+ <item> other </item>
+ <item> parameters </item>
+ <item> private </item>
+ <item> procedure </item>
+ <item> public </item>
+ <item> request </item>
+ <item> return </item>
+ <item> sequence </item>
+ <item> static </item>
+ <item> stdout </item>
+ <item> .t. </item>
+ <item> traslate </item>
+ <item> undef </item>
+ <item> while </item>
+ <item> xcommand </item>
+ <item> xtranslate </item>
+ </list>
+
+ <list name="commands">
+ <!-- Commands -->
+ <item> accept </item>
+ <item> all </item>
+ <item> alternate </item>
+ <item> append </item>
+ <item> ascending </item>
+ <item> average </item>
+ <item> bell </item>
+ <item> blank </item>
+ <item> box </item>
+ <item> century </item>
+ <item> clear </item>
+ <item> close </item>
+ <item> coclor </item>
+ <item> color </item>
+ <item> commit </item>
+ <item> confirm </item>
+ <item> console </item>
+ <item> continue </item>
+ <item> copy </item>
+ <item> count </item>
+ <item> create </item>
+ <item> cursor </item>
+ <item> date </item>
+ <item> decimals </item>
+ <item> default </item>
+ <item> deleted </item>
+ <item> delete </item>
+ <item> delimiters </item>
+ <item> descending </item>
+ <item> device </item>
+ <item> display </item>
+ <item> do </item>
+ <item> eject </item>
+ <item> epoch </item>
+ <item> erase </item>
+ <item> escape </item>
+ <item> eval </item>
+ <item> every </item>
+ <item> exact </item>
+ <item> extended </item>
+ <item> file </item>
+ <item> filter </item>
+ <item> fixed </item>
+ <item> form </item>
+ <item> from </item>
+ <item> get </item>
+ <item> gets </item>
+ <item> go </item>
+ <item> goto </item>
+ <item> index </item>
+ <item> input </item>
+ <item> intensity </item>
+ <item> ? </item>
+ <item> ?? </item>
+ <item> @ </item>
+ <item> join </item>
+ <item> keyboard </item>
+ <item> key </item>
+ <item> label </item>
+ <item> list </item>
+ <item> locate </item>
+ <item> margin </item>
+ <item> memory </item>
+ <item> menu </item>
+ <item> message </item>
+ <item> new </item>
+ <item> on </item>
+ <item> order </item>
+ <item> pack </item>
+ <item> path </item>
+ <item> pict </item>
+ <item> printer </item>
+ <item> prompt </item>
+ <item> quit </item>
+ <item> range </item>
+ <item> read </item>
+ <item> recall </item>
+ <item> record </item>
+ <item> reindex </item>
+ <item> relation </item>
+ <item> release </item>
+ <item> rename </item>
+ <item> replace </item>
+ <item> report </item>
+ <item> rest </item>
+ <item> restore </item>
+ <item> run </item>
+ <item> save </item>
+ <item> say </item>
+ <item> scoreboard </item>
+ <item> seek </item>
+ <item> select </item>
+ <item> set </item>
+ <item> skip </item>
+ <item> softseek </item>
+ <item> sort </item>
+ <item> structure </item>
+ <item> sum </item>
+ <item> tag </item>
+ <item> to </item>
+ <item> total </item>
+ <item> typeahead </item>
+ <item> type </item>
+ <item> unique </item>
+ <item> unlock </item>
+ <item> update </item>
+ <item> use </item>
+ <item> valid </item>
+ <item> wait </item>
+ <item> when </item>
+ <item> with </item>
+ <item> wrap </item>
+ <item> zap </item>
+ </list>
+
+ <list name="functions">
+ <!-- Functions -->
+ <item> aadd </item>
+ <item> abs </item>
+ <item> achoice </item>
+ <item> aclone </item>
+ <item> acopy </item>
+ <item> adel </item>
+ <item> aeval </item>
+ <item> afill </item>
+ <item> ains </item>
+ <item> alert </item>
+ <item> alias </item>
+ <item> alltrim </item>
+ <item> altd </item>
+ <item> array </item>
+ <item> ascan </item>
+ <item> asize </item>
+ <item> asort </item>
+ <item> atail </item>
+ <item> at </item>
+ <item> bin2i </item>
+ <item> bin2l </item>
+ <item> bin2w </item>
+ <item> bof </item>
+ <item> break </item>
+ <item> browse </item>
+ <item> cdowchr </item>
+ <item> chr </item>
+ <item> cmonth </item>
+ <item> col </item>
+ <item> colorselect </item>
+ <item> ctod </item>
+ <item> curdir </item>
+ <item> date </item>
+ <item> day </item>
+ <item> dbappend </item>
+ <item> dbclearall </item>
+ <item> dbclearfilter </item>
+ <item> dbclearindex </item>
+ <item> dbclearrelation </item>
+ <item> dbcloseall </item>
+ <item> dbclosearea </item>
+ <item> dbcommitall </item>
+ <item> dbcommit </item>
+ <item> dbcreateindex </item>
+ <item> dbcreate </item>
+ <item> dbdelete </item>
+ <item> dbedit </item>
+ <item> dbeval </item>
+ <item> dbfilter </item>
+ <item> dbf </item>
+ <item> dbgobottom </item>
+ <item> dbgoto </item>
+ <item> dbgotop </item>
+ <item> dbrecall </item>
+ <item> dbreindex </item>
+ <item> dbrelation </item>
+ <item> dbrlock </item>
+ <item> dbrlocklist </item>
+ <item> dbrselect </item>
+ <item> dbrunlock </item>
+ <item> dbseek </item>
+ <item> dbselectarea </item>
+ <item> dbsetfilter </item>
+ <item> dbsetindex </item>
+ <item> dbsetorder </item>
+ <item> dbsetrelation </item>
+ <item> dbskip </item>
+ <item> dbstruct </item>
+ <item> dbunlockall </item>
+ <item> dbunlock </item>
+ <item> dbusearea </item>
+ <item> deleted </item>
+ <item> descend </item>
+ <item> devout </item>
+ <item> devpos </item>
+ <item> directory </item>
+ <item> dispbegin </item>
+ <item> dispbox </item>
+ <item> dispcount </item>
+ <item> dispend </item>
+ <item> dispout </item>
+ <item> dispspace </item>
+ <item> doserror </item>
+ <item> dow </item>
+ <item> dtoc </item>
+ <item> dtos </item>
+ <item> empty </item>
+ <item> eof </item>
+ <item> errorblock </item>
+ <item> errorinhandler </item>
+ <item> errorlevel </item>
+ <item> eval </item>
+ <item> exp </item>
+ <item> fclose </item>
+ <item> fcount </item>
+ <item> fcreate </item>
+ <item> ferase </item>
+ <item> ferror </item>
+ <item> fieldblock </item>
+ <item> fieldget </item>
+ <item> field </item>
+ <item> fieldname </item>
+ <item> fieldpos </item>
+ <item> fieldput </item>
+ <item> fieldwblock </item>
+ <item> file </item>
+ <item> flock </item>
+ <item> fopen </item>
+ <item> found </item>
+ <item> fread </item>
+ <item> freadstr </item>
+ <item> frename </item>
+ <item> fseek </item>
+ <item> fwrite </item>
+ <item> getactive </item>
+ <item> getenv </item>
+ <item> hardcr </item>
+ <item> header </item>
+ <item> i2bin </item>
+ <item> iif </item>
+ <item> indexext </item>
+ <item> indexkey </item>
+ <item> indexord </item>
+ <item> inkey </item>
+ <item> int </item>
+ <item> isalpha </item>
+ <item> iscolor </item>
+ <item> isdigit </item>
+ <item> islower </item>
+ <item> isprinter </item>
+ <item> isupper </item>
+ <item> l2bin </item>
+ <item> lastkey </item>
+ <item> lastrec </item>
+ <item> left </item>
+ <item> len </item>
+ <item> lock </item>
+ <item> log </item>
+ <item> lower </item>
+ <item> ltrim </item>
+ <item> lupdate </item>
+ <item> maxcol </item>
+ <item> max </item>
+ <item> maxrow </item>
+ <item> memoedit </item>
+ <item> memoline </item>
+ <item> memoread </item>
+ <item> memory </item>
+ <item> memotran </item>
+ <item> memowrit </item>
+ <item> memvarblock </item>
+ <item> min </item>
+ <item> mlcount </item>
+ <item> mlctopos </item>
+ <item> mlpos </item>
+ <item> mod </item>
+ <item> month </item>
+ <item> mpostolc </item>
+ <item> neterr </item>
+ <item> netname </item>
+ <item> nextkey </item>
+ <item> nosnow </item>
+ <item> ordbagext </item>
+ <item> ordbagname </item>
+ <item> ordcreate </item>
+ <item> orddestroy </item>
+ <item> ordfor </item>
+ <item> ordkey </item>
+ <item> ordlistadd </item>
+ <item> ordlistclear </item>
+ <item> ordlistrebuild </item>
+ <item> ordname </item>
+ <item> ordnumber </item>
+ <item> ordsetfocus </item>
+ <item> os </item>
+ <item> outerr </item>
+ <item> outstd </item>
+ <item> padc </item>
+ <item> padl </item>
+ <item> padr </item>
+ <item> pcol </item>
+ <item> pcount </item>
+ <item> proclineprocname </item>
+ <item> prow </item>
+ <item> qout </item>
+ <item> qqout </item>
+ <item> rat </item>
+ <item> rddlist </item>
+ <item> rddname </item>
+ <item> rddsetdefault </item>
+ <item> readexit </item>
+ <item> readinsert </item>
+ <item> readmodal </item>
+ <item> readvar </item>
+ <item> reccount </item>
+ <item> recno </item>
+ <item> recsize </item>
+ <item> replicate </item>
+ <item> restscreen </item>
+ <item> right </item>
+ <item> rlock </item>
+ <item> round </item>
+ <item> row </item>
+ <item> rtrim </item>
+ <item> savesreen </item>
+ <item> scroll </item>
+ <item> seconds </item>
+ <item> select </item>
+ <item> setblink </item>
+ <item> setcancel </item>
+ <item> setcolor </item>
+ <item> setcursor </item>
+ <item> setkey </item>
+ <item> setmode </item>
+ <item> setpos </item>
+ <item> setprc </item>
+ <item> soundex </item>
+ <item> space </item>
+ <item> sqrt </item>
+ <item> str </item>
+ <item> strtran </item>
+ <item> stuff </item>
+ <item> substr </item>
+ <item> time </item>
+ <item> tone </item>
+ <item> transform </item>
+ <item> trim </item>
+ <item> updated </item>
+ <item> upper </item>
+ <item> used </item>
+ <item> val </item>
+ <item> valtype </item>
+ <item> version </item>
+ </list>
+
+ <contexts>
+ <context attribute="Normal Text" lineEndContext="#stay" name="Normal">
+ <RegExpr attribute="Keyword" context="#stay" String="\bfunction\b" insensitive="TRUE" beginRegion="regFunction" />
+ <RegExpr attribute="Keyword" context="#stay" String="^return\b" insensitive="TRUE" endRegion="regFunction" />
+ <RegExpr attribute="Keyword" context="#stay" String="\bbegin\s+sequence\b" insensitive="TRUE" beginRegion="regSequence" />
+ <RegExpr attribute="Keyword" context="#stay" String="\bend\s+sequence\b" insensitive="TRUE" endRegion="regSequence" />
+ <RegExpr attribute="Keyword" context="#stay" String="\bdo\s+case\b" insensitive="TRUE" beginRegion="regDoCase" />
+ <RegExpr attribute="Keyword" context="#stay" String="\bendcase\b" insensitive="TRUE" endRegion="regDoCase" />
+ <RegExpr attribute="Keyword" context="#stay" String="\bdo\s+while\b" insensitive="TRUE" beginRegion="regDoWhile" />
+ <RegExpr attribute="Keyword" context="#stay" String="\benddo\b" insensitive="TRUE" endRegion="regDoWhile" />
+ <RegExpr attribute="Keyword" context="#stay" String="\bfor\b" insensitive="TRUE" beginRegion="regFor" />
+ <RegExpr attribute="Keyword" context="#stay" String="\bnext\b" insensitive="TRUE" endRegion="regFor" />
+ <RegExpr attribute="Keyword" context="#stay" String="\bif\b" insensitive="TRUE" beginRegion="regIf" />
+ <RegExpr attribute="Keyword" context="#stay" String="\belseif\b" insensitive="TRUE" endRegion="regIf" beginRegion="regIf" />
+ <RegExpr attribute="Keyword" context="#stay" String="\belse\b" insensitive="TRUE" endRegion="regIf" beginRegion="regIf" />
+ <RegExpr attribute="Keyword" context="#stay" String="\bendif\b" insensitive="TRUE" endRegion="regIf" />
+ <RegExpr attribute="Keyword" context="#stay" String="\bswitch\b" insensitive="TRUE" beginRegion="regSwitch" />
+ <RegExpr attribute="Keyword" context="#stay" String="\bendswitch\b" insensitive="TRUE" endRegion="regSwitch" />
+
+ <keyword attribute="Keyword" context="#stay" String="keywords"/>
+ <keyword attribute="Command" context="#stay" String="commands"/>
+ <keyword attribute="Function" context="#stay" String="functions"/>
+ <HlCHex attribute="StringChar" context="#stay"/>
+ <DetectChar attribute="String" context="String" char="&quot;"/>
+ <RegExpr attribute="Region Marker" context="#stay" String="//\s*BEGIN.*$" beginRegion="regMarker"/>
+ <RegExpr attribute="Region Marker" context="#stay" String="//\s*END.*$" endRegion="regMarker"/>
+ <Detect2Chars attribute="Comment" context="LineComment" char="/" char1="/"/>
+ <RegExpr attribute="Comment" context="LineComment" String="^\s*\*.*$"/>
+ <Detect2Chars attribute="Comment" context="BlockComment" char="/" char1="*" beginRegion="Comment2" />
+ <AnyChar attribute="Symbol" context="#stay" String="!%&amp;()+,-&lt;:=&gt;[]^~"/>
+ <RegExpr attribute="Preprocessor" context="Preprocessor" String="#"/>
+ <Detect2Chars attribute="Eval Block" context="EvalBlock" char="{" char1="|"/>
+ <DetectChar attribute="String" context="String2" char="'"/>
+
+ </context>
+ <context attribute="String" lineEndContext="#pop" name="String">
+ <LineContinue attribute="String" context="#stay"/>
+ <HlCStringChar attribute="String Char" context="#stay"/>
+ <DetectChar attribute="String" context="#pop" char="&quot;"/>
+ </context>
+ <context attribute="Comment" lineEndContext="#pop" name="LineComment">
+ <RegExpr attribute="Command" context="#stay" String="(FIXME|TODO|NOT(IC)?E)" />
+ </context>
+ <context attribute="Comment" lineEndContext="#stay" name="BlockComment">
+ <Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" endRegion="Comment2" />
+ <RegExpr attribute="Command" context="#stay" String="(FIXME|TODO|NOT(IC)?E)" />
+ </context>
+ <context attribute="Preprocessor" lineEndContext="#pop" name="Preprocessor">
+ <LineContinue attribute="Preprocessor" context="#stay"/>
+ <RangeDetect attribute="Prep. Lib" context="#stay" char="&quot;" char1="&quot;"/>
+ <RangeDetect attribute="Prep. Lib" context="#stay" char="&lt;" char1="&gt;"/>
+ <RegExpr attribute="Region Marker" context="#stay" String="//\s*BEGIN.*$" beginRegion="regMarker"/>
+ <RegExpr attribute="Region Marker" context="#stay" String="//\s*END.*$" endRegion="regMarker"/>
+ <Detect2Chars attribute="Comment" context="LineComment" char="/" char1="/"/>
+ <Detect2Chars attribute="Comment" context="BlockComment" char="/" char1="*" beginRegion="Comment2" />
+ </context>
+ <context attribute="Eval Block" lineEndContext="#stay" name="EvalBlock">
+ <LineContinue attribute="Eval Block" context="#stay"/>
+ <DetectChar attribute="Eval Block" context="#pop" char="}" />
+ </context>
+ <context attribute="String" lineEndContext="#pop" name="String2">
+ <LineContinue attribute="String" context="#stay"/>
+ <HlCStringChar attribute="String Char" context="#stay"/>
+ <DetectChar attribute="String" context="#pop" char="'"/>
+ </context>
+ </contexts>
+ <itemDatas>
+ <itemData name="Normal Text" defStyleNum="dsNormal"/>
+ <itemData name="Keyword" defStyleNum="dsKeyword"/>
+ <itemData name="Command" defStyleNum="dsDataType"/>
+ <itemData name="Function" defStyleNum="dsFunction"/>
+ <itemData name="Decimal" defStyleNum="dsDecVal"/>
+ <itemData name="Hex" defStyleNum="dsBaseN"/>
+ <itemData name="String" defStyleNum="dsString"/>
+ <itemData name="String Char" defStyleNum="dsChar"/>
+ <itemData name="Comment" defStyleNum="dsComment"/>
+ <itemData name="Symbol" defStyleNum="dsNormal"/>
+ <itemData name="Preprocessor" defStyleNum="dsOthers"/>
+ <itemData name="Prep. Lib" defStyleNum="dsOthers"/>
+ <itemData name="Eval Block" defStyleNum="dsOthers"/>
+<!-- <itemData name="Region Marker" defStyleNum="dsNormal" color="#0000ff"/>-->
+ <itemData name="Region Marker" defStyleNum="dsRegionMarker"/>
+ </itemDatas>
+ </highlighting>
+ <general>
+ <comments>
+ <comment name="singleLine" start="*" />
+ <comment name="singleLine" start="//" />
+ <comment name="multiLine" start="/*" end="*/" />
+ </comments>
+ <keywords casesensitive="0" weakDeliminator="?." />
+ </general>
+</language>
diff --git a/kate/data/cmake.xml b/kate/data/cmake.xml
new file mode 100644
index 000000000..0fa775860
--- /dev/null
+++ b/kate/data/cmake.xml
@@ -0,0 +1,352 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+<!--
+ This file is part of KDE's kate project.
+
+ Copyright 2004 Alexander Neundorf (neundorf@kde.org)
+ Copyright 2005 Dominik Haumann (dhdev@gmx.de)
+ Copyright 2007,2008 Matthew Woehlke (mw_triad@users.sourceforge.net)
+
+ **********************************************************************
+ * This library is free software; you can redistribute it and/or *
+ * modify it under the terms of the GNU Lesser General Public *
+ * License as published by the Free Software Foundation; either *
+ * version 2 of the License, or (at your option) any later version. *
+ * *
+ * This library is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this library; if not, write to the *
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, *
+ * Boston, MA 02110-1301, USA. *
+ **********************************************************************
+ -->
+<!-- generated for "cmake version 2.6-patch 2" -->
+<language name="CMake" version="1.06" kateversion="2.4" section="Other" extensions="CMakeLists.txt;*.cmake;" mimetype="" author="Alexander Neundorf (neundorf@kde.org)" license="LGPL">
+ <highlighting>
+
+ <list name = "commands">
+ <item> ADD_CUSTOM_COMMAND </item>
+ <item> ADD_CUSTOM_TARGET </item>
+ <item> ADD_DEFINITIONS </item>
+ <item> ADD_DEPENDENCIES </item>
+ <item> ADD_EXECUTABLE </item>
+ <item> ADD_LIBRARY </item>
+ <item> ADD_SUBDIRECTORY </item>
+ <item> ADD_TEST </item>
+ <item> AUX_SOURCE_DIRECTORY </item>
+ <item> BREAK </item>
+ <item> BUILD_COMMAND </item>
+ <item> BUILD_NAME </item>
+ <item> CMAKE_MINIMUM_REQUIRED </item>
+ <item> CMAKE_POLICY </item>
+ <item> CONFIGURE_FILE </item>
+ <item> CREATE_TEST_SOURCELIST </item>
+ <item> DEFINE_PROPERTY </item>
+ <item> ELSE </item>
+ <item> ELSEIF </item>
+ <item> ENABLE_LANGUAGE </item>
+ <item> ENABLE_TESTING </item>
+ <item> ENDFOREACH </item>
+ <item> ENDFUNCTION </item>
+ <item> ENDIF </item>
+ <item> ENDMACRO </item>
+ <item> ENDWHILE </item>
+ <item> EXECUTE_PROCESS </item>
+ <item> EXEC_PROGRAM </item>
+ <item> EXPORT </item>
+ <item> EXPORT_LIBRARY_DEPENDENCIES </item>
+ <item> FILE </item>
+ <item> FIND_FILE </item>
+ <item> FIND_LIBRARY </item>
+ <item> FIND_PACKAGE </item>
+ <item> FIND_PATH </item>
+ <item> FIND_PROGRAM </item>
+ <item> FLTK_WRAP_UI </item>
+ <item> FOREACH </item>
+ <item> FUNCTION </item>
+ <item> GET_CMAKE_PROPERTY </item>
+ <item> GET_DIRECTORY_PROPERTY </item>
+ <item> GET_FILENAME_COMPONENT </item>
+ <item> GET_PROPERTY </item>
+ <item> GET_SOURCE_FILE_PROPERTY </item>
+ <item> GET_TARGET_PROPERTY </item>
+ <item> GET_TEST_PROPERTY </item>
+ <item> IF </item>
+ <item> INCLUDE </item>
+ <item> INCLUDE_DIRECTORIES </item>
+ <item> INCLUDE_EXTERNAL_MSPROJECT </item>
+ <item> INCLUDE_REGULAR_EXPRESSION </item>
+ <item> INSTALL </item>
+ <item> INSTALL_FILES </item>
+ <item> INSTALL_PROGRAMS </item>
+ <item> INSTALL_TARGETS </item>
+ <item> ITK_WRAP_TCL </item>
+ <item> LINK_DIRECTORIES </item>
+ <item> LINK_LIBRARIES </item>
+ <item> LIST </item>
+ <item> LOAD_CACHE </item>
+ <item> LOAD_COMMAND </item>
+ <item> MACRO </item>
+ <item> MAKE_DIRECTORY </item>
+ <item> MARK_AS_ADVANCED </item>
+ <item> MATH </item>
+ <item> MESSAGE </item>
+ <item> OPTION </item>
+ <item> OUTPUT_REQUIRED_FILES </item>
+ <item> PROJECT </item>
+ <item> QT_WRAP_CPP </item>
+ <item> QT_WRAP_UI </item>
+ <item> REMOVE </item>
+ <item> REMOVE_DEFINITIONS </item>
+ <item> RETURN </item>
+ <item> SEPARATE_ARGUMENTS </item>
+ <item> SET </item>
+ <item> SET_DIRECTORY_PROPERTIES </item>
+ <item> SET_PROPERTY </item>
+ <item> SET_SOURCE_FILES_PROPERTIES </item>
+ <item> SET_TARGET_PROPERTIES </item>
+ <item> SITE_NAME </item>
+ <item> SOURCE_GROUP </item>
+ <item> STRING </item>
+ <item> SUBDIRS </item>
+ <item> SUBDIR_DEPENDS </item>
+ <item> TARGET_LINK_LIBRARIES </item>
+ <item> TRY_COMPILE </item>
+ <item> TRY_RUN </item>
+ <item> UNSET </item>
+ <item> UTILITY_SOURCE </item>
+ <item> VARIABLE_REQUIRES </item>
+ <item> VARIABLE_WATCH </item>
+ <item> VTK_MAKE_INSTANTIATOR </item>
+ <item> VTK_WRAP_JAVA </item>
+ <item> VTK_WRAP_PYTHON </item>
+ <item> VTK_WRAP_TCL </item>
+ <item> WRITE_FILE </item>
+ </list>
+
+ <list name="special_args">
+ <item> ABSOLUTE </item>
+ <item> ABSTRACT </item>
+ <item> ADDITIONAL_MAKE_CLEAN_FILES </item>
+ <item> ALL </item>
+ <item> AND </item>
+ <item> APPEND </item>
+ <item> ARCHIVE </item>
+ <item> ARGS </item>
+ <item> ASCII </item>
+ <item> BEFORE </item>
+ <item> BRIEF_DOCS </item>
+ <item> BUNDLE </item>
+ <item> CACHE </item>
+ <item> CACHE_VARIABLES </item>
+ <item> CLEAR </item>
+ <item> CMAKE_FLAGS </item>
+ <item> CMAKE_FIND_ROOT_PATH_BOTH </item>
+ <item> CODE </item>
+ <item> COMMAND </item>
+ <item> COMMANDS </item>
+ <item> COMMAND_NAME </item>
+ <item> COMMENT </item>
+ <item> COMPARE </item>
+ <item> COMPILE_FLAGS </item>
+ <item> COMPONENT </item>
+ <item> COMPONENTS </item>
+ <item> CONFIGURATIONS </item>
+ <item> CONFIGURE </item>
+ <item> COPYONLY </item>
+ <item> DEFINED </item>
+ <item> DEFINE_SYMBOL </item>
+ <item> DEFINITION </item>
+ <item> DEPENDS </item>
+ <item> DESTINATION </item>
+ <item> DIRECTORY </item>
+ <item> DIRECTORY_PERMISSIONS </item>
+ <item> DOC </item>
+ <item> DOWNLOAD </item>
+ <item> EQUAL </item>
+ <item> ESCAPE_QUOTES </item>
+ <item> EXACT </item>
+ <item> EXCLUDE </item>
+ <item> EXCLUDE_FROM_ALL </item>
+ <item> EXISTS </item>
+ <item> EXPORT </item>
+ <item> EXPR </item>
+ <item> EXT </item>
+ <item> EXTRA_INCLUDE </item>
+ <item> FATAL_ERROR </item>
+ <item> FILE </item>
+ <item> FILES </item>
+ <item> FILE_PERMISSIONS </item>
+ <item> FILES_MATCHING </item>
+ <item> FORCE </item>
+ <item> FRAMEWORK </item>
+ <item> FULL_DOCS </item>
+ <item> GENERATED </item>
+ <item> GET </item>
+ <item> GLOB </item>
+ <item> GLOB_RECURSE </item>
+ <item> GLOBAL </item>
+ <item> GREATER </item>
+ <item> GROUP_SIZE </item>
+ <item> HEADER_FILE_ONLY </item>
+ <item> HEADER_LOCATION </item>
+ <item> HINTS </item>
+ <item> IMMEDIATE </item>
+ <item> INCLUDES </item>
+ <item> INCLUDE_DIRECTORIES </item>
+ <item> INCLUDE_INTERNALS </item>
+ <item> INCLUDE_REGULAR_EXPRESSION </item>
+ <item> INHERITED </item>
+ <item> INTERNAL </item>
+ <item> IS_ABSOLUTE </item>
+ <item> IS_NEWER_THAN </item>
+ <item> LENGTH </item>
+ <item> LESS </item>
+ <item> LIBRARY </item>
+ <item> LINK_DIRECTORIES </item>
+ <item> LINK_FLAGS </item>
+ <item> LINK_INTERFACE_LIBRARIES </item>
+ <item> LOCATION </item>
+ <item> MACOSX_BUNDLE </item>
+ <item> MACROS </item>
+ <item> MAIN_DEPENDENCY </item>
+ <item> MAKE_DIRECTORY </item>
+ <item> MATCH </item>
+ <item> MATCHALL </item>
+ <item> MATCHES </item>
+ <item> MODULE </item>
+ <item> NAME </item>
+ <item> NAMELINK_ONLY </item>
+ <item> NAMELINK_SKIP </item>
+ <item> NAMES </item>
+ <item> NAME_WE </item>
+ <item> NOT </item>
+ <item> NOTEQUAL </item>
+ <item> NO_CMAKE_PATH </item>
+ <item> NO_CMAKE_ENVIRONMENT_PATH </item>
+ <item> NO_CMAKE_FIND_ROOT_PATH </item>
+ <item> NO_DEFAULT_PATH </item>
+ <item> NO_MODULE </item>
+ <item> NO_SYSTEM_PATH </item>
+ <item> NO_SYSTEM_ENVIRONMENT_PATH </item>
+ <item> OBJECT_DEPENDS </item>
+ <item> ONLY_CMAKE_FIND_ROOT_PATH </item>
+ <item> OPTIONAL </item>
+ <item> OR </item>
+ <item> OUTPUT </item>
+ <item> OUTPUT_VARIABLE </item>
+ <item> PARENT_SCOPE </item>
+ <item> PATH </item>
+ <item> PATHS </item>
+ <item> PATH_SUFFIXES </item>
+ <item> PATTERN </item>
+ <item> PERMISSIONS </item>
+ <item> POLICY </item>
+ <item> POP </item>
+ <item> POST_BUILD </item>
+ <item> POST_INSTALL_SCRIPT </item>
+ <item> PREFIX </item>
+ <item> PREORDER </item>
+ <item> PRE_BUILD </item>
+ <item> PRE_INSTALL_SCRIPT </item>
+ <item> PRE_LINK </item>
+ <item> PRIVATE_HEADER </item>
+ <item> PROGRAM </item>
+ <item> PROGRAMS </item>
+ <item> PROGRAM_ARGS </item>
+ <item> PROPERTIES </item>
+ <item> PUBLIC_HEADER </item>
+ <item> PUSH </item>
+ <item> QUIET </item>
+ <item> RANDOM </item>
+ <item> RANGE </item>
+ <item> READ </item>
+ <item> REGEX </item>
+ <item> REGULAR_EXPRESSION </item>
+ <item> RELATIVE_PATH </item>
+ <item> REMOVE </item>
+ <item> REMOVE_RECURSE </item>
+ <item> RENAME </item>
+ <item> REPLACE </item>
+ <item> REQUIRED </item>
+ <item> RESOURCE </item>
+ <item> RETURN_VALUE </item>
+ <item> RUNTIME </item>
+ <item> RUNTIME_DIRECTORY </item>
+ <item> SCRIPT </item>
+ <item> SEND_ERROR </item>
+ <item> SHARED </item>
+ <item> SOURCE </item>
+ <item> SOURCES </item>
+ <item> STATIC </item>
+ <item> STATUS </item>
+ <item> STRIP </item>
+ <item> STRINGS </item>
+ <item> STREQUAL </item>
+ <item> STRGREATER </item>
+ <item> STRLESS </item>
+ <item> SUFFIX </item>
+ <item> SUBSTRING </item>
+ <item> TARGET </item>
+ <item> TARGETS </item>
+ <item> TIMEOUT </item>
+ <item> TOLOWER </item>
+ <item> TOUPPER </item>
+ <item> TO_CMAKE_PATH </item>
+ <item> TO_NATIVE_PATH </item>
+ <item> USE_SOURCE_PERMISSIONS </item>
+ <item> VAR </item>
+ <item> VARIABLE </item>
+ <item> VARIABLES </item>
+ <item> VERSION </item>
+ <item> VERSION_LESS </item>
+ <item> VERSION_EQUAL </item>
+ <item> VERSION_GREATER </item>
+ <item> WIN32 </item>
+ <item> WORKING_DIRECTORY </item>
+ <item> WRAP_EXCLUDE </item>
+ <item> WRITE </item>
+ </list>
+ <contexts>
+ <context attribute="Normal Text" lineEndContext="#stay" name="Normal Text">
+ <DetectSpaces/>
+ <keyword attribute="Commands" context="Function Args" String="commands" insensitive="true"/>
+ <RegExpr attribute="Region Marker" context="#stay" String="#\s*BEGIN.*$" beginRegion="block" firstNonSpace="true"/>
+ <RegExpr attribute="Region Marker" context="#stay" String="#\s*END.*$" endRegion="block" firstNonSpace="true"/>
+ <DetectChar attribute="Comment" context="Comment" char="#"/>
+ <RegExpr attribute="Variable" context="#stay" String="\$\{\s*\w+\s*\}"/>
+ <RegExpr attribute="Macros" context="#stay" String="\w+\s*(?=\()"/>
+ </context>
+ <context attribute="Normal Text" lineEndContext="#stay" name="Function Args">
+ <DetectChar attribute="Normal Text" context="#pop" char=")"/>
+ <keyword attribute="Special Args" context="#stay" String="special_args"/>
+ <RegExpr attribute="Comment" context="#stay" String="#.*$"/>
+ <RegExpr attribute="Variable" context="#stay" String="\$\{\s*\w+\s*\}"/>
+ </context>
+ <context attribute="Comment" lineEndContext="#pop" name="Comment">
+ <IncludeRules context="##Alerts" />
+ </context>
+
+ </contexts>
+ <itemDatas>
+ <itemData name="Normal Text" defStyleNum="dsNormal"/>
+ <itemData name="Special Args" defStyleNum="dsOthers" color="#000000" bold="0" italic="1"/>
+ <itemData name="Commands" defStyleNum="dsKeyword"/>
+ <itemData name="Macros" defStyleNum="dsKeyword"/>
+ <itemData name="Variable" defStyleNum="dsDecVal"/>
+ <itemData name="Comment" defStyleNum="dsComment"/>
+ <itemData name="Region Marker" defStyleNum="dsRegionMarker"/>
+ </itemDatas>
+ </highlighting>
+
+ <general>
+ <comments>
+ <comment name="singleLine" start="#"/>
+ </comments>
+ <keywords casesensitive="1"/>
+ </general>
+</language>
diff --git a/kate/data/coldfusion.xml b/kate/data/coldfusion.xml
new file mode 100644
index 000000000..9e49e4af6
--- /dev/null
+++ b/kate/data/coldfusion.xml
@@ -0,0 +1,732 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+<language name="ColdFusion" version="1.04" kateversion="2.3" section="Markup" extensions="*.cfm;*.cfc;*.cfml;*.dbm" mimetype="text/x-coldfusion">
+
+ <highlighting>
+
+ <list name="Script Keywords">
+
+ <item> if </item>
+ <item> else </item>
+ <item> for </item>
+ <item> in </item>
+ <item> while </item>
+ <item> do </item>
+ <item> continue </item>
+ <item> break </item>
+ <item> with </item>
+ <item> try </item>
+ <item> catch </item>
+ <item> switch </item>
+ <item> case </item>
+ <item> new </item>
+ <item> var </item>
+ <item> function </item>
+ <item> return </item>
+ <item> this </item>
+ <item> delete </item>
+ <item> true </item>
+ <item> false </item>
+ <item> void </item>
+ <item> throw </item>
+ <item> typeof </item>
+ <item> const </item>
+ <item> default </item>
+
+ </list>
+
+ <list name="Script Objects">
+
+ <item> Anchor </item>
+ <item> Applet </item>
+ <item> Area </item>
+ <item> Array </item>
+ <item> Boolean </item>
+ <item> Button </item>
+ <item> Checkbox </item>
+ <item> Date </item>
+ <item> Document </item>
+ <item> Event </item>
+ <item> FileUpload </item>
+ <item> Form </item>
+ <item> Frame </item>
+ <item> Function </item>
+ <item> Hidden </item>
+ <item> History </item>
+ <item> Image </item>
+ <item> Layer </item>
+ <item> Linke </item>
+ <item> Location </item>
+ <item> Math </item>
+ <item> Navigator </item>
+ <item> Number </item>
+ <item> Object </item>
+ <item> Option </item>
+ <item> Password </item>
+ <item> Radio </item>
+ <item> RegExp </item>
+ <item> Reset </item>
+ <item> Screen </item>
+ <item> Select </item>
+ <item> String </item>
+ <item> Submit </item>
+ <item> Text </item>
+ <item> Textarea </item>
+ <item> Window </item>
+
+ </list>
+
+ <list name="Script Methods">
+
+ <item> abs </item>
+ <item> acos </item>
+ <item> alert </item>
+ <item> anchor </item>
+ <item> apply </item>
+ <item> asin </item>
+ <item> atan </item>
+ <item> atan2 </item>
+ <item> back </item>
+ <item> blur </item>
+ <item> call </item>
+ <item> captureEvents </item>
+ <item> ceil </item>
+ <item> charAt </item>
+ <item> charCodeAt </item>
+ <item> clearInterval </item>
+ <item> clearTimeout </item>
+ <item> click </item>
+ <item> close </item>
+ <item> compile </item>
+ <item> concat </item>
+ <item> confirm </item>
+ <item> cos </item>
+ <item> disableExternalCapture </item>
+ <item> enableExternalCapture </item>
+ <item> eval </item>
+ <item> exec </item>
+ <item> exp </item>
+ <item> find </item>
+ <item> floor </item>
+ <item> focus </item>
+ <item> forward </item>
+ <item> fromCharCode </item>
+ <item> getDate </item>
+ <item> getDay </item>
+ <item> getFullYear </item>
+ <item> getHours </item>
+ <item> getMilliseconds </item>
+ <item> getMinutes </item>
+ <item> getMonth </item>
+ <item> getSeconds </item>
+ <item> getSelection </item>
+ <item> getTime </item>
+ <item> getTimezoneOffset </item>
+ <item> getUTCDate </item>
+ <item> getUTCDay </item>
+ <item> getUTCFullYear </item>
+ <item> getUTCHours </item>
+ <item> getUTCMilliseconds </item>
+ <item> getUTCMinutes </item>
+ <item> getUTCMonth </item>
+ <item> getUTCSeconds </item>
+ <item> go </item>
+ <item> handleEvent </item>
+ <item> home </item>
+ <item> indexOf </item>
+ <item> javaEnabled </item>
+ <item> join </item>
+ <item> lastIndexOf </item>
+ <item> link </item>
+ <item> load </item>
+ <item> log </item>
+ <item> match </item>
+ <item> max </item>
+ <item> min </item>
+ <item> moveAbove </item>
+ <item> moveBelow </item>
+ <item> moveBy </item>
+ <item> moveTo </item>
+ <item> moveToAbsolute </item>
+ <item> open </item>
+ <item> parse </item>
+ <item> plugins.refresh </item>
+ <item> pop </item>
+ <item> pow </item>
+ <item> preference </item>
+ <item> print </item>
+ <item> prompt </item>
+ <item> push </item>
+ <item> random </item>
+ <item> releaseEvents </item>
+ <item> reload </item>
+ <item> replace </item>
+ <item> reset </item>
+ <item> resizeBy </item>
+ <item> resizeTo </item>
+ <item> reverse </item>
+ <item> round </item>
+ <item> routeEvent </item>
+ <item> scrollBy </item>
+ <item> scrollTo </item>
+ <item> search </item>
+ <item> select </item>
+ <item> setDate </item>
+ <item> setFullYear </item>
+ <item> setHours </item>
+ <item> setInterval </item>
+ <item> setMilliseconds </item>
+ <item> setMinutes </item>
+ <item> setMonth </item>
+ <item> setSeconds </item>
+ <item> setTime </item>
+ <item> setTimeout </item>
+ <item> setUTCDate </item>
+ <item> setUTCFullYear </item>
+ <item> setUTCHours </item>
+ <item> setUTCMilliseconds </item>
+ <item> setUTCMinutes </item>
+ <item> setUTCMonth </item>
+ <item> setUTCSeconds </item>
+ <item> shift </item>
+ <item> sin </item>
+ <item> slice </item>
+ <item> sort </item>
+ <item> splice </item>
+ <item> split </item>
+ <item> sqrt </item>
+ <item> stop </item>
+ <item> String formatting </item>
+ <item> submit </item>
+ <item> substr </item>
+ <item> substring </item>
+ <item> taintEnabled </item>
+ <item> tan </item>
+ <item> test </item>
+ <item> toLocaleString </item>
+ <item> toLowerCase </item>
+ <item> toSource </item>
+ <item> toString </item>
+ <item> toUpperCase </item>
+ <item> toUTCString </item>
+ <item> unshift </item>
+ <item> unwatch </item>
+ <item> UTC </item>
+ <item> valueOf </item>
+ <item> watch </item>
+ <item> write </item>
+ <item> writeln </item>
+
+ </list>
+
+ <list name="CFSCRIPT Keywords">
+
+ <item> break </item>
+ <item> case </item>
+ <item> catch </item>
+ <item> continue </item>
+ <item> default </item>
+ <item> do </item>
+ <item> else </item>
+ <item> for </item>
+ <item> function </item>
+ <item> if </item>
+ <item> in </item>
+ <item> return </item>
+ <item> switch </item>
+ <item> try </item>
+ <item> var </item>
+ <item> while </item>
+
+ </list>
+
+ <list name="CFSCRIPT Functions">
+
+ <item> Abs </item>
+ <item> ACos </item>
+ <item> ArrayAppend </item>
+ <item> ArrayAvg </item>
+ <item> ArrayClear </item>
+ <item> ArrayDeleteAt </item>
+ <item> ArrayInsertAt </item>
+ <item> ArrayIsEmpty </item>
+ <item> ArrayLen </item>
+ <item> ArrayMax </item>
+ <item> ArrayMin </item>
+ <item> ArrayNew </item>
+ <item> ArrayPrepend </item>
+ <item> ArrayResize </item>
+ <item> ArraySet </item>
+ <item> ArraySort </item>
+ <item> ArraySum </item>
+ <item> ArraySwap </item>
+ <item> ArrayToList </item>
+ <item> Asc </item>
+ <item> ASin </item>
+ <item> Atn </item>
+ <item> BitAnd </item>
+ <item> BitMaskClear </item>
+ <item> BitMaskRead </item>
+ <item> BitMaskSet </item>
+ <item> BitNot </item>
+ <item> BitOr </item>
+ <item> BitSHLN </item>
+ <item> BitSHRN </item>
+ <item> BitXor </item>
+ <item> Ceiling </item>
+ <item> Chr </item>
+ <item> CJustify </item>
+ <item> Compare </item>
+ <item> CompareNoCase </item>
+ <item> Cos </item>
+ <item> CreateDate </item>
+ <item> CreateDateTime </item>
+ <item> CreateObject </item>
+ <item> CreateODBCDate </item>
+ <item> CreateODBCDateTime </item>
+ <item> CreateODBCTime </item>
+ <item> CreateTime </item>
+ <item> CreateTimeSpan </item>
+ <item> CreateUUID </item>
+ <item> DateAdd </item>
+ <item> DateCompare </item>
+ <item> DateConvert </item>
+ <item> DateDiff </item>
+ <item> DateFormat </item>
+ <item> DatePart </item>
+ <item> Day </item>
+ <item> DayOfWeek </item>
+ <item> DayOfWeekAsString </item>
+ <item> DayOfYear </item>
+ <item> DaysInMonth </item>
+ <item> DaysInYear </item>
+ <item> DE </item>
+ <item> DecimalFormat </item>
+ <item> DecrementValue </item>
+ <item> Decrypt </item>
+ <item> DeleteClientVariable </item>
+ <item> DirectoryExists </item>
+ <item> DollarFormat </item>
+ <item> Duplicate </item>
+ <item> Encrypt </item>
+ <item> Evaluate </item>
+ <item> Exp </item>
+ <item> ExpandPath </item>
+ <item> FileExists </item>
+ <item> Find </item>
+ <item> FindNoCase </item>
+ <item> FindOneOf </item>
+ <item> FirstDayOfMonth </item>
+ <item> Fix </item>
+ <item> FormatBaseN </item>
+ <item> GetAuthUser </item>
+ <item> GetBaseTagData </item>
+ <item> GetBaseTagList </item>
+ <item> GetBaseTemplatePath </item>
+ <item> GetClientVariablesList </item>
+ <item> GetCurrentTemplatePath </item>
+ <item> GetDirectoryFromPath </item>
+ <item> GetException </item>
+ <item> GetFileFromPath </item>
+ <item> GetFunctionList </item>
+ <item> GetHttpRequestData </item>
+ <item> GetHttpTimeString </item>
+ <item> GetK2ServerDocCount </item>
+ <item> GetK2ServerDocCountLimit </item>
+ <item> GetLocale </item>
+ <item> GetMetaData </item>
+ <item> GetMetricData </item>
+ <item> GetPageContext </item>
+ <item> GetProfileSections </item>
+ <item> GetProfileString </item>
+ <item> GetServiceSettings </item>
+ <item> GetTempDirectory </item>
+ <item> GetTempFile </item>
+ <item> GetTemplatePath </item>
+ <item> GetTickCount </item>
+ <item> GetTimeZoneInfo </item>
+ <item> GetToken </item>
+ <item> Hash </item>
+ <item> Hour </item>
+ <item> HTMLCodeFormat </item>
+ <item> HTMLEditFormat </item>
+ <item> IIf </item>
+ <item> IncrementValue </item>
+ <item> InputBaseN </item>
+ <item> Insert </item>
+ <item> Int </item>
+ <item> IsArray </item>
+ <item> IsBinary </item>
+ <item> IsBoolean </item>
+ <item> IsCustomFunction </item>
+ <item> IsDate </item>
+ <item> IsDebugMode </item>
+ <item> IsDefined </item>
+ <item> IsK2ServerABroker </item>
+ <item> IsK2ServerDocCountExceeded </item>
+ <item> IsK2ServerOnline </item>
+ <item> IsLeapYear </item>
+ <item> IsNumeric </item>
+ <item> IsNumericDate </item>
+ <item> IsObject </item>
+ <item> IsQuery </item>
+ <item> IsSimpleValue </item>
+ <item> IsStruct </item>
+ <item> IsUserInRole </item>
+ <item> IsWDDX </item>
+ <item> IsXmlDoc </item>
+ <item> IsXmlElement </item>
+ <item> IsXmlRoot </item>
+ <item> JavaCast </item>
+ <item> JSStringFormat </item>
+ <item> LCase </item>
+ <item> Left </item>
+ <item> Len </item>
+ <item> ListAppend </item>
+ <item> ListChangeDelims </item>
+ <item> ListContains </item>
+ <item> ListContainsNoCase </item>
+ <item> ListDeleteAt </item>
+ <item> ListFind </item>
+ <item> ListFindNoCase </item>
+ <item> ListFirst </item>
+ <item> ListGetAt </item>
+ <item> ListInsertAt </item>
+ <item> ListLast </item>
+ <item> ListLen </item>
+ <item> ListPrepend </item>
+ <item> ListQualify </item>
+ <item> ListRest </item>
+ <item> ListSetAt </item>
+ <item> ListSort </item>
+ <item> ListToArray </item>
+ <item> ListValueCount </item>
+ <item> ListValueCountNoCase </item>
+ <item> LJustify </item>
+ <item> Log </item>
+ <item> Log10 </item>
+ <item> LSCurrencyFormat </item>
+ <item> LSDateFormat </item>
+ <item> LSEuroCurrencyFormat </item>
+ <item> LSIsCurrency </item>
+ <item> LSIsDate </item>
+ <item> LSIsNumeric </item>
+ <item> LSNumberFormat </item>
+ <item> LSParseCurrency </item>
+ <item> LSParseDateTime </item>
+ <item> LSParseEuroCurrency </item>
+ <item> LSParseNumber </item>
+ <item> LSTimeFormat </item>
+ <item> LTrim </item>
+ <item> Max </item>
+ <item> Mid </item>
+ <item> Min </item>
+ <item> Minute </item>
+ <item> Month </item>
+ <item> MonthAsString </item>
+ <item> Now </item>
+ <item> NumberFormat </item>
+ <item> ParagraphFormat </item>
+ <item> ParameterExists </item>
+ <item> ParseDateTime </item>
+ <item> Pi </item>
+ <item> PreserveSingleQuotes </item>
+ <item> Quarter </item>
+ <item> QueryAddColumn </item>
+ <item> QueryAddRow </item>
+ <item> QueryNew </item>
+ <item> QuerySetCell </item>
+ <item> QuotedValueList </item>
+ <item> Rand </item>
+ <item> Randomize </item>
+ <item> RandRange </item>
+ <item> REFind </item>
+ <item> REFindNoCase </item>
+ <item> RemoveChars </item>
+ <item> RepeatString </item>
+ <item> Replace </item>
+ <item> ReplaceList </item>
+ <item> ReplaceNoCase </item>
+ <item> REReplace </item>
+ <item> REReplaceNoCase </item>
+ <item> Reverse </item>
+ <item> Right </item>
+ <item> RJustify </item>
+ <item> Round </item>
+ <item> RTrim </item>
+ <item> Second </item>
+ <item> SetEncoding </item>
+ <item> SetLocale </item>
+ <item> SetProfileString </item>
+ <item> SetVariable </item>
+ <item> Sgn </item>
+ <item> Sin </item>
+ <item> SpanExcluding </item>
+ <item> SpanIncluding </item>
+ <item> Sqr </item>
+ <item> StripCR </item>
+ <item> StructAppend </item>
+ <item> StructClear </item>
+ <item> StructCopy </item>
+ <item> StructCount </item>
+ <item> StructDelete </item>
+ <item> StructFind </item>
+ <item> StructFindKey </item>
+ <item> StructFindValue </item>
+ <item> StructGet </item>
+ <item> StructInsert </item>
+ <item> StructIsEmpty </item>
+ <item> StructKeyArray </item>
+ <item> StructKeyExists </item>
+ <item> StructKeyList </item>
+ <item> StructNew </item>
+ <item> StructSort </item>
+ <item> StructUpdate </item>
+ <item> Tan </item>
+ <item> TimeFormat </item>
+ <item> ToBase64 </item>
+ <item> ToBinary </item>
+ <item> ToString </item>
+ <item> Trim </item>
+ <item> UCase </item>
+ <item> URLDecode </item>
+ <item> URLEncodedFormat </item>
+ <item> URLSessionFormat </item>
+ <item> Val </item>
+ <item> ValueList </item>
+ <item> Week </item>
+ <item> WriteOutput </item>
+ <item> XmlChildPos </item>
+ <item> XmlElemNew </item>
+ <item> XmlFormat </item>
+ <item> XmlNew </item>
+ <item> XmlParse </item>
+ <item> XmlSearch </item>
+ <item> XmlTransform </item>
+ <item> Year </item>
+ <item> YesNoFormat </item>
+
+ </list>
+
+ <contexts>
+
+ <context attribute="Normal Text" lineEndContext="#stay" name="Normal Text">
+ <StringDetect attribute="CF Comment" context="ctxCF Comment" String="&lt;!---" />
+ <StringDetect attribute="HTML Comment" context="ctxHTML Comment" String="&lt;!--" />
+ <RegExpr attribute="Script Tags" context="ctxCFSCRIPT Tag" String="&lt;[cC][fF][sS][cC][rR][iI][pP][tT]" />
+ <RegExpr attribute="Script Tags" context="ctxSCRIPT Tag" String="&lt;[sS][cC][rR][iI][pP][tT]" />
+ <RegExpr attribute="Style Tags" context="ctxSTYLE Tag" String="&lt;[sS][tT][yY][lL][eE]" />
+ <DetectChar attribute="HTML Entities" context="ctxHTML Entities" char="&amp;" />
+ <RegExpr attribute="Custom Tags" context="ctxCustom Tag" String="&lt;\/?[cC][fF]_" />
+ <RegExpr attribute="CFX Tags" context="ctxCFX Tag" String="&lt;\/?[cC][fF][xX]_" />
+ <RegExpr attribute="CF Tags" context="ctxCF Tag" String="&lt;\/?[cC][fF]" />
+ <RegExpr attribute="Table Tags" context="ctxTable Tag" String="&lt;\/?([tT][aAhHbBfFrRdD])|([cC][aA][pP][tT])" />
+ <RegExpr attribute="Anchor Tags" context="ctxAnchor Tag" String="&lt;\/?[aA] " />
+ <RegExpr attribute="Image Tags" context="ctxImage Tag" String="&lt;\/?[iI][mM][gG] " />
+ <RegExpr attribute="Tags" context="ctxTag" String="&lt;!?\/?[a-zA-Z0-9_]+" />
+ </context>
+
+
+
+ <context name="ctxCFSCRIPT Tag" attribute="Script Tags" lineEndContext="#stay">
+ <DetectChar attribute="Script Tags" context="ctxCFSCRIPT Block" char="&gt;" />
+ <DetectChar attribute="Normal Text" context="#stay" char="=" />
+ <RegExpr attribute="Attribute Values" context="#stay" String="&quot;[^&quot;]*&quot;" />
+ <RegExpr attribute="Attribute Values" context="#stay" String="'[^']*'" />
+ </context>
+
+ <context name="ctxSCRIPT Tag" attribute="Script Tags" lineEndContext="#stay">
+ <DetectChar attribute="Script Tags" context="ctxSCRIPT Block" char="&gt;" />
+ <DetectChar attribute="Normal Text" context="#stay" char="=" />
+ <RegExpr attribute="Attribute Values" context="#stay" String="&quot;[^&quot;]*&quot;" />
+ <RegExpr attribute="Attribute Values" context="#stay" String="'[^']*'" />
+ </context>
+
+ <context name="ctxSTYLE Tag" attribute="Style Tags" lineEndContext="#stay">
+ <DetectChar attribute="Style Tags" context="ctxSTYLE Block" char="&gt;" />
+ <DetectChar attribute="Normal Text" context="#stay" char="=" />
+ <RegExpr attribute="Attribute Values" context="#stay" String="&quot;[^&quot;]*&quot;" />
+ <RegExpr attribute="Attribute Values" context="#stay" String="'[^']*'" />
+ </context>
+
+
+
+ <context name="ctxTag" attribute="Tags" lineEndContext="#stay">
+ <DetectChar attribute="Tags" context="#pop" char="&gt;" />
+ <DetectChar attribute="Normal Text" context="#stay" char="=" />
+ <RegExpr attribute="Attribute Values" context="#stay" String="&quot;[^&quot;]*&quot;" />
+ <RegExpr attribute="Attribute Values" context="#stay" String="'[^']*'" />
+ </context>
+
+ <context name="ctxTable Tag" attribute="Table Tags" lineEndContext="#stay">
+ <DetectChar attribute="Table Tags" context="#pop" char="&gt;" />
+ <DetectChar attribute="Normal Text" context="#stay" char="=" />
+ <RegExpr attribute="Attribute Values" context="#stay" String="&quot;[^&quot;]*&quot;" />
+ <RegExpr attribute="Attribute Values" context="#stay" String="'[^']*'" />
+ </context>
+
+ <context name="ctxAnchor Tag" attribute="Anchor Tags" lineEndContext="#stay">
+ <DetectChar attribute="Anchor Tags" context="#pop" char="&gt;" />
+ <DetectChar attribute="Normal Text" context="#stay" char="=" />
+ <RegExpr attribute="Attribute Values" context="#stay" String="&quot;[^&quot;]*&quot;" />
+ <RegExpr attribute="Attribute Values" context="#stay" String="'[^']*'" />
+ </context>
+
+ <context name="ctxImage Tag" attribute="Image Tags" lineEndContext="#stay">
+ <DetectChar attribute="Image Tags" context="#pop" char="&gt;" />
+ <DetectChar attribute="Normal Text" context="#stay" char="=" />
+ <RegExpr attribute="Attribute Values" context="#stay" String="&quot;[^&quot;]*&quot;" />
+ <RegExpr attribute="Attribute Values" context="#stay" String="'[^']*'" />
+ </context>
+
+ <context name="ctxCF Tag" attribute="CF Tags" lineEndContext="#stay">
+ <DetectChar attribute="CF Tags" context="#pop" char="&gt;" />
+ <DetectChar attribute="Normal Text" context="#stay" char="=" />
+ <RegExpr attribute="Attribute Values" context="#stay" String="&quot;[^&quot;]*&quot;" />
+ <RegExpr attribute="Attribute Values" context="#stay" String="'[^']*'" />
+ </context>
+
+ <context name="ctxCustom Tag" attribute="Custom Tags" lineEndContext="#stay">
+ <DetectChar attribute="Custom Tags" context="#pop" char="&gt;" />
+ <DetectChar attribute="Normal Text" context="#stay" char="=" />
+ <RegExpr attribute="Attribute Values" context="#stay" String="&quot;[^&quot;]*&quot;" />
+ <RegExpr attribute="Attribute Values" context="#stay" String="'[^']*'" />
+ </context>
+
+ <context name="ctxCFX Tag" attribute="CFX Tags" lineEndContext="#stay">
+ <DetectChar attribute="CFX Tags" context="#pop" char="&gt;" />
+ <DetectChar attribute="Normal Text" context="#stay" char="=" />
+ <RegExpr attribute="Attribute Values" context="#stay" String="&quot;[^&quot;]*&quot;" />
+ <RegExpr attribute="Attribute Values" context="#stay" String="'[^']*'" />
+ </context>
+
+
+
+ <context name="ctxHTML Comment" attribute="HTML Comment" lineEndContext="#stay">
+ <StringDetect attribute="CF Comment" context="ctxCF Comment" String="&lt;!---" />
+ <StringDetect attribute="HTML Comment" context="#pop" String="--&gt;" />
+ </context>
+
+ <context name="ctxCF Comment" attribute="CF Comment" lineEndContext="#stay">
+ <StringDetect attribute="CF Comment" context="#pop" String="---&gt;" />
+ </context>
+
+ <context name="ctxC Style Comment" attribute="Script Comment" lineEndContext="#stay">
+ <Detect2Chars attribute="Script Comment" context="#pop" char="*" char1="/" />
+ </context>
+
+ <context name="ctxOne Line Comment" attribute="Script Comment" lineEndContext="#pop" />
+
+ <context name="ctxHTML Entities" attribute="HTML Entities" lineEndContext="#pop">
+ <DetectChar attribute="HTML Entities" context="#pop" char=";" />
+ </context>
+
+
+
+ <context name="ctxCFSCRIPT Block" attribute="Normal Text" lineEndContext="#stay">
+ <Detect2Chars attribute="Script Comment" context="ctxC Style Comment" char="/" char1="*" />
+ <Detect2Chars attribute="Script Comment" context="ctxOne Line Comment" char="/" char1="/" />
+ <RegExpr attribute="Script Strings" context="#stay" String="&quot;[^&quot;]*&quot;" />
+ <RegExpr attribute="Script Strings" context="#stay" String="'[^']*'" />
+ <Int attribute="Script Numbers" context="#stay" />
+ <Float attribute="Script Numbers" context="#stay" />
+ <AnyChar attribute="Script Operators" context="#stay" String="[()[\]=+-*/]+" />
+ <AnyChar attribute="Brackets" context="#stay" String="{}" />
+
+ <keyword attribute="Script Keywords" context="#stay" String="CFSCRIPT Keywords" />
+ <keyword attribute="Script Functions" context="#stay" String="CFSCRIPT Functions" />
+ <RegExpr attribute="Script Tags" context="#pop#pop" String="&lt;/[cC][fF][sS][cC][rR][iI][pP][tT]&gt;" />
+ </context>
+
+
+
+ <context name="ctxSCRIPT Block" attribute="Normal Text" lineEndContext="#stay">
+ <Detect2Chars attribute="Script Comment" context="ctxC Style Comment" char="/" char1="*" />
+ <Detect2Chars attribute="Script Comment" context="ctxOne Line Comment" char="/" char1="/" />
+ <RegExpr attribute="Script Strings" context="#stay" String="&quot;[^&quot;]*&quot;" />
+ <RegExpr attribute="Script Strings" context="#stay" String="'[^']*'" />
+ <Int attribute="Script Numbers" context="#stay" />
+ <Float attribute="Script Numbers" context="#stay" />
+ <AnyChar attribute="Script Operators" context="#stay" String="[()[\]=+-*/]+" />
+ <AnyChar attribute="Brackets" context="#stay" String="{}" />
+
+ <keyword attribute="Script Keywords" context="#stay" String="Script Keywords" />
+ <keyword attribute="Script Objects" context="#stay" String="Script Objects" />
+ <keyword attribute="Script Functions" context="#stay" String="Script Methods" />
+ <RegExpr attribute="Script Tags" context="#pop#pop" String="&lt;/[sS][cC][rR][iI][pP][tT]&gt;" />
+ </context>
+
+
+
+ <context name="ctxSTYLE Block" attribute="Style Selectors" lineEndContext="#stay">
+ <Detect2Chars attribute="Script Comment" context="ctxC Style Comment" char="/" char1="*" />
+ <DetectChar attribute="Brackets" context="ctxStyle Properties" char="{" />
+ <RegExpr attribute="Style Tags" context="#pop#pop" String="&lt;/[sS][tT][yY][lL][eE]&gt;" />
+ </context>
+
+ <context name="ctxStyle Properties" attribute="Style Properties" lineEndContext="#stay">
+ <DetectChar attribute="Brackets" context="#pop" char="}" />
+ <Detect2Chars attribute="Script Comment" context="ctxC Style Comment" char="/" char1="*" />
+ <DetectChar attribute="Normal Text" context="ctxStyle Values" char=":" />
+ </context>
+
+ <context name="ctxStyle Values" attribute="Style Values" lineEndContext="#pop">
+ <DetectChar attribute="Normal Text" context="#pop" char=";" />
+ <DetectChar attribute="Normal Text" context="#stay" char="," />
+ <Int attribute="Numbers" context="#stay" />
+ <Float attribute="Numbers" context="#stay" />
+ <RegExpr attribute="Numbers" context="#stay" String="#([0-9a-fA-F]{3})|([0-9a-fA-F]{6})" />
+ <RegExpr attribute="Attribute Values" context="#stay" String="&quot;[^&quot;]*&quot;" />
+ <RegExpr attribute="Attribute Values" context="#stay" String="'[^']*'" />
+ </context>
+
+ </contexts>
+
+ <itemDatas>
+
+ <itemData name="Normal Text" defStyleNum="dsNormal" color="#000000" selColor="#ffffff" bold="0" italic="0" />
+ <itemData name="Tags" defStyleNum="dsNormal" color="#000080" selColor="#ffffff" bold="0" italic="0" />
+ <itemData name="Table Tags" defStyleNum="dsNormal" color="#008080" selColor="#ffffff" bold="0" italic="0" />
+ <itemData name="Script Tags" defStyleNum="dsNormal" color="#800000" selColor="#ffffff" bold="0" italic="0" />
+ <itemData name="Image Tags" defStyleNum="dsNormal" color="#800080" selColor="#ffffff" bold="0" italic="0" />
+ <itemData name="Style Tags" defStyleNum="dsNormal" color="#800080" selColor="#ffffff" bold="0" italic="0" />
+ <itemData name="Anchor Tags" defStyleNum="dsNormal" color="#008000" selColor="#ffffff" bold="0" italic="0" />
+ <itemData name="Attribute Values" defStyleNum="dsNormal" color="#0000ff" selColor="#ffffff" bold="0" italic="0" />
+ <itemData name="HTML Comment" defStyleNum="dsComment" color="#008000" selColor="#999999" bold="0" italic="0" />
+ <itemData name="CF Comment" defStyleNum="dsComment" color="#ff9900" selColor="#999999" bold="0" italic="0" />
+ <itemData name="Script Comment" defStyleNum="dsComment" color="#ff9900" selColor="#999999" bold="0" italic="0" />
+ <itemData name="CF Tags" defStyleNum="dsNormal" color="#800000" selColor="#ffffff" bold="0" italic="0" />
+ <itemData name="Custom Tags" defStyleNum="dsNormal" color="#cc6666" selColor="#ffffff" bold="0" italic="0" />
+ <itemData name="CFX Tags" defStyleNum="dsNormal" color="#008000" selColor="#ffffff" bold="0" italic="0" />
+ <itemData name="Numbers" defStyleNum="dsNormal" color="#0000ff" selColor="#ffffff" bold="0" italic="0" />
+ <itemData name="HTML Entities" defStyleNum="dsNormal" color="#000000" selColor="#ffffff" bold="1" italic="0" />
+ <itemData name="Style Selectors" defStyleNum="dsNormal" color="#ff00ff" selColor="#ffffff" bold="0" italic="0" />
+ <itemData name="Style Properties" defStyleNum="dsNormal" color="#000080" selColor="#ffffff" bold="0" italic="0" />
+ <itemData name="Style Values" defStyleNum="dsNormal" color="#ff0000" selColor="#ffffff" bold="0" italic="0" />
+ <itemData name="Brackets" defStyleNum="dsNormal" color="#000080" selColor="#ffffff" bold="1" italic="0" />
+ <itemData name="Script Numbers" defStyleNum="dsNormal" color="#ff00ff" selColor="#ffffff" bold="0" italic="0" />
+ <itemData name="Script Strings" defStyleNum="dsNormal" color="#008080" selColor="#ffffff" bold="0" italic="0" />
+ <itemData name="Script Operators" defStyleNum="dsNormal" color="#0000ff" selColor="#ffffff" bold="0" italic="0" />
+ <itemData name="Script Keywords" defStyleNum="dsNormal" color="#0000cc" selColor="#ffffff" bold="1" italic="0" />
+ <itemData name="Script Functions" defStyleNum="dsFunction" bold="1" />
+ <itemData name="Script Objects" defStyleNum="dsNormal" color="#0000cc" selColor="#ffffff" bold="1" italic="0" />
+
+ </itemDatas>
+
+ </highlighting>
+
+ <general>
+
+ <comments>
+
+ <comment name="multiLine" start="&lt;!--" end="--&gt;" />
+ <comment name="multiLine" start="/*" end="*/" />
+ <comment name="singleLine" start="//" />
+
+ </comments>
+
+ <keywords casesensitive="0" weakDeliminator="-" />
+
+ </general>
+
+</language>
diff --git a/kate/data/commonlisp.xml b/kate/data/commonlisp.xml
new file mode 100644
index 000000000..880929c81
--- /dev/null
+++ b/kate/data/commonlisp.xml
@@ -0,0 +1,1173 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+<!--
+ This file is part of KDE's kate project.
+
+ copyright : (C) 2004 by Dominik Haumann
+ email : dhdev at gmx dot de
+
+ last change : 2004-03-16
+
+ **********************************************************************
+ * This library is free software; you can redistribute it and/or *
+ * modify it under the terms of the GNU Library General Public *
+ * License as published by the Free Software Foundation; either *
+ * version 2 of the License, or (at your option) any later version. *
+ * *
+ * This library is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Library General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this library; if not, write to the *
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, *
+ * Boston, MA 02110-1301, USA. *
+ **********************************************************************
+ -->
+<language version="1.02" kateversion="2.3" name="Common Lisp" section="Scripts" extensions="*.lisp;*.cl;*.lsp" mimetype="" author="Dominik Haumann (dhdev@gmx.de)" license="LGPL">
+ <highlighting>
+ <list name="symbols">
+ <item> &lt; </item>
+ <item> &lt;= </item>
+ <item> = </item>
+ <item> &gt; </item>
+ <item> &gt;= </item>
+ <item> =&gt; </item>
+ <item> - </item>
+ <item> / </item>
+ <item> /= </item>
+ <item> // </item>
+ <item> /// </item>
+ <item> * </item>
+ <item> ** </item>
+ <item> *** </item>
+ <item> + </item>
+ <item> ++ </item>
+ <item> +++ </item>
+ <item> 1- </item>
+ <item> 1+ </item>
+ </list>
+ <list name="definitions">
+ <item> defclass </item>
+ <item> defconstant </item>
+ <item> defgeneric </item>
+ <item> define-compiler-macro </item>
+ <item> define-condition </item>
+ <item> define-method-combination </item>
+ <item> define-modify-macro </item>
+ <item> define-setf-expander </item>
+ <item> define-setf-method </item>
+ <item> define-symbol-macro </item>
+ <item> defmacro </item>
+ <item> defmethod </item>
+ <item> defpackage </item>
+ <item> defparameter </item>
+ <item> defsetf </item>
+ <item> deftype </item>
+ <item> defvar </item>
+ <item> defun </item>
+ <item> defstruct </item>
+ </list>
+ <list name="keywords">
+ <item> abort </item>
+ <item> abs </item>
+ <item> access </item>
+ <item> acons </item>
+ <item> acos </item>
+ <item> acosh </item>
+ <item> add-method </item>
+ <item> adjoin </item>
+ <item> adjustable-array-p </item>
+ <item> adjust-array </item>
+ <item> allocate-instance </item>
+ <item> alpha-char-p </item>
+ <item> alphanumericp </item>
+ <item> and </item>
+ <item> append </item>
+ <item> apply </item>
+ <item> applyhook </item>
+ <item> apropos </item>
+ <item> apropos-list </item>
+ <item> aref </item>
+ <item> arithmetic-error </item>
+ <item> arithmetic-error-operands </item>
+ <item> arithmetic-error-operation </item>
+ <item> array </item>
+ <item> array-dimension </item>
+ <item> array-dimension-limit </item>
+ <item> array-dimensions </item>
+ <item> array-displacement </item>
+ <item> array-element-type </item>
+ <item> array-has-fill-pointer-p </item>
+ <item> array-in-bounds-p </item>
+ <item> arrayp </item>
+ <item> array-rank </item>
+ <item> array-rank-limit </item>
+ <item> array-row-major-index </item>
+ <item> array-total-size </item>
+ <item> array-total-size-limit </item>
+ <item> ash </item>
+ <item> asin </item>
+ <item> asinh </item>
+ <item> assert </item>
+ <item> assoc </item>
+ <item> assoc-if </item>
+ <item> assoc-if-not </item>
+ <item> atan </item>
+ <item> atanh </item>
+ <item> atom </item>
+ <item> base-char </item>
+ <item> base-string </item>
+ <item> bignum </item>
+ <item> bit </item>
+ <item> bit-and </item>
+ <item> bit-andc1 </item>
+ <item> bit-andc2 </item>
+ <item> bit-eqv </item>
+ <item> bit-ior </item>
+ <item> bit-nand </item>
+ <item> bit-nor </item>
+ <item> bit-not </item>
+ <item> bit-orc1 </item>
+ <item> bit-orc2 </item>
+ <item> bit-vector </item>
+ <item> bit-vector-p </item>
+ <item> bit-xor </item>
+ <item> block </item>
+ <item> boole </item>
+ <item> boole-1 </item>
+ <item> boole-2 </item>
+ <item> boolean </item>
+ <item> boole-and </item>
+ <item> boole-andc1 </item>
+ <item> boole-andc2 </item>
+ <item> boole-c1 </item>
+ <item> boole-c2 </item>
+ <item> boole-clr </item>
+ <item> boole-eqv </item>
+ <item> boole-ior </item>
+ <item> boole-nand </item>
+ <item> boole-nor </item>
+ <item> boole-orc1 </item>
+ <item> boole-orc2 </item>
+ <item> boole-set </item>
+ <item> boole-xor </item>
+ <item> both-case-p </item>
+ <item> boundp </item>
+ <item> break </item>
+ <item> broadcast-stream </item>
+ <item> broadcast-stream-streams </item>
+ <item> built-in-class </item>
+ <item> butlast </item>
+ <item> byte </item>
+ <item> byte-position </item>
+ <item> byte-size </item>
+ <item> call-arguments-limit </item>
+ <item> call-method </item>
+ <item> call-next-method </item>
+ <item> capitalize </item>
+ <item> car </item>
+ <item> case </item>
+ <item> catch </item>
+ <item> ccase </item>
+ <item> cdr </item>
+ <item> ceiling </item>
+ <item> cell-error </item>
+ <item> cell-error-name </item>
+ <item> cerror </item>
+ <item> change-class </item>
+ <item> char </item>
+ <item> char&lt; </item>
+ <item> char&lt;= </item>
+ <item> char= </item>
+ <item> char&gt; </item>
+ <item> char&gt;= </item>
+ <item> char/= </item>
+ <item> character </item>
+ <item> characterp </item>
+ <item> char-bit </item>
+ <item> char-bits </item>
+ <item> char-bits-limit </item>
+ <item> char-code </item>
+ <item> char-code-limit </item>
+ <item> char-control-bit </item>
+ <item> char-downcase </item>
+ <item> char-equal </item>
+ <item> char-font </item>
+ <item> char-font-limit </item>
+ <item> char-greaterp </item>
+ <item> char-hyper-bit </item>
+ <item> char-int </item>
+ <item> char-lessp </item>
+ <item> char-meta-bit </item>
+ <item> char-name </item>
+ <item> char-not-equal </item>
+ <item> char-not-greaterp </item>
+ <item> char-not-lessp </item>
+ <item> char-super-bit </item>
+ <item> char-upcase </item>
+ <item> check-type </item>
+ <item> cis </item>
+ <item> class </item>
+ <item> class-name </item>
+ <item> class-of </item>
+ <item> clear-input </item>
+ <item> clear-output </item>
+ <item> close </item>
+ <item> clrhash </item>
+ <item> code-char </item>
+ <item> coerce </item>
+ <item> commonp </item>
+ <item> compilation-speed </item>
+ <item> compile </item>
+ <item> compiled-function </item>
+ <item> compiled-function-p </item>
+ <item> compile-file </item>
+ <item> compile-file-pathname </item>
+ <item> compiler-let </item>
+ <item> compiler-macro </item>
+ <item> compiler-macro-function </item>
+ <item> complement </item>
+ <item> complex </item>
+ <item> complexp </item>
+ <item> compute-applicable-methods </item>
+ <item> compute-restarts </item>
+ <item> concatenate </item>
+ <item> concatenated-stream </item>
+ <item> concatenated-stream-streams </item>
+ <item> cond </item>
+ <item> condition </item>
+ <item> conjugate </item>
+ <item> cons </item>
+ <item> consp </item>
+ <item> constantly </item>
+ <item> constantp </item>
+ <item> continue </item>
+ <item> control-error </item>
+ <item> copy-alist </item>
+ <item> copy-list </item>
+ <item> copy-pprint-dispatch </item>
+ <item> copy-readtable </item>
+ <item> copy-seq </item>
+ <item> copy-structure </item>
+ <item> copy-symbol </item>
+ <item> copy-tree </item>
+ <item> cos </item>
+ <item> cosh </item>
+ <item> count </item>
+ <item> count-if </item>
+ <item> count-if-not </item>
+ <item> ctypecase </item>
+ <item> debug </item>
+ <item> decf </item>
+ <item> declaim </item>
+ <item> declaration </item>
+ <item> declare </item>
+ <item> decode-float </item>
+ <item> decode-universal-time </item>
+ <item> delete </item>
+ <item> delete-duplicates </item>
+ <item> delete-file </item>
+ <item> delete-if </item>
+ <item> delete-if-not </item>
+ <item> delete-package </item>
+ <item> denominator </item>
+ <item> deposit-field </item>
+ <item> describe </item>
+ <item> describe-object </item>
+ <item> destructuring-bind </item>
+ <item> digit-char </item>
+ <item> digit-char-p </item>
+ <item> directory </item>
+ <item> directory-namestring </item>
+ <item> disassemble </item>
+ <item> division-by-zero </item>
+ <item> do </item>
+ <item> do* </item>
+ <item> do-all-symbols </item>
+ <item> documentation </item>
+ <item> do-exeternal-symbols </item>
+ <item> do-external-symbols </item>
+ <item> dolist </item>
+ <item> do-symbols </item>
+ <item> dotimes </item>
+ <item> double-float </item>
+ <item> double-float-epsilon </item>
+ <item> double-float-negative-epsilon </item>
+ <item> dpb </item>
+ <item> dribble </item>
+ <item> dynamic-extent </item>
+ <item> ecase </item>
+ <item> echo-stream </item>
+ <item> echo-stream-input-stream </item>
+ <item> echo-stream-output-stream </item>
+ <item> ed </item>
+ <item> eighth </item>
+ <item> elt </item>
+ <item> encode-universal-time </item>
+ <item> end-of-file </item>
+ <item> endp </item>
+ <item> enough-namestring </item>
+ <item> ensure-directories-exist </item>
+ <item> ensure-generic-function </item>
+ <item> eq </item>
+ <item> eql </item>
+ <item> equal </item>
+ <item> equalp </item>
+ <item> error </item>
+ <item> etypecase </item>
+ <item> eval </item>
+ <item> evalhook </item>
+ <item> eval-when </item>
+ <item> evenp </item>
+ <item> every </item>
+ <item> exp </item>
+ <item> export </item>
+ <item> expt </item>
+ <item> extended-char </item>
+ <item> fboundp </item>
+ <item> fceiling </item>
+ <item> fdefinition </item>
+ <item> ffloor </item>
+ <item> fifth </item>
+ <item> file-author </item>
+ <item> file-error </item>
+ <item> file-error-pathname </item>
+ <item> file-length </item>
+ <item> file-namestring </item>
+ <item> file-position </item>
+ <item> file-stream </item>
+ <item> file-string-length </item>
+ <item> file-write-date </item>
+ <item> fill </item>
+ <item> fill-pointer </item>
+ <item> find </item>
+ <item> find-all-symbols </item>
+ <item> find-class </item>
+ <item> find-if </item>
+ <item> find-if-not </item>
+ <item> find-method </item>
+ <item> find-package </item>
+ <item> find-restart </item>
+ <item> find-symbol </item>
+ <item> finish-output </item>
+ <item> first </item>
+ <item> fixnum </item>
+ <item> flet </item>
+ <item> float </item>
+ <item> float-digits </item>
+ <item> floating-point-inexact </item>
+ <item> floating-point-invalid-operation </item>
+ <item> floating-point-overflow </item>
+ <item> floating-point-underflow </item>
+ <item> floatp </item>
+ <item> float-precision </item>
+ <item> float-radix </item>
+ <item> float-sign </item>
+ <item> floor </item>
+ <item> fmakunbound </item>
+ <item> force-output </item>
+ <item> format </item>
+ <item> formatter </item>
+ <item> fourth </item>
+ <item> fresh-line </item>
+ <item> fround </item>
+ <item> ftruncate </item>
+ <item> ftype </item>
+ <item> funcall </item>
+ <item> function </item>
+ <item> function-keywords </item>
+ <item> function-lambda-expression </item>
+ <item> functionp </item>
+ <item> gbitp </item>
+ <item> gcd </item>
+ <item> generic-function </item>
+ <item> gensym </item>
+ <item> gentemp </item>
+ <item> get </item>
+ <item> get-decoded-time </item>
+ <item> get-dispatch-macro-character </item>
+ <item> getf </item>
+ <item> gethash </item>
+ <item> get-internal-real-time </item>
+ <item> get-internal-run-time </item>
+ <item> get-macro-character </item>
+ <item> get-output-stream-string </item>
+ <item> get-properties </item>
+ <item> get-setf-expansion </item>
+ <item> get-setf-method </item>
+ <item> get-universal-time </item>
+ <item> go </item>
+ <item> graphic-char-p </item>
+ <item> handler-bind </item>
+ <item> handler-case </item>
+ <item> hash-table </item>
+ <item> hash-table-count </item>
+ <item> hash-table-p </item>
+ <item> hash-table-rehash-size </item>
+ <item> hash-table-rehash-threshold </item>
+ <item> hash-table-size </item>
+ <item> hash-table-test </item>
+ <item> host-namestring </item>
+ <item> identity </item>
+ <item> if </item>
+ <item> if-exists </item>
+ <item> ignorable </item>
+ <item> ignore </item>
+ <item> ignore-errors </item>
+ <item> imagpart </item>
+ <item> import </item>
+ <item> incf </item>
+ <item> initialize-instance </item>
+ <item> inline </item>
+ <item> in-package </item>
+ <item> in-package </item>
+ <item> input-stream-p </item>
+ <item> inspect </item>
+ <item> int-char </item>
+ <item> integer </item>
+ <item> integer-decode-float </item>
+ <item> integer-length </item>
+ <item> integerp </item>
+ <item> interactive-stream-p </item>
+ <item> intern </item>
+ <item> internal-time-units-per-second </item>
+ <item> intersection </item>
+ <item> invalid-method-error </item>
+ <item> invoke-debugger </item>
+ <item> invoke-restart </item>
+ <item> invoke-restart-interactively </item>
+ <item> isqrt </item>
+ <item> keyword </item>
+ <item> keywordp </item>
+ <item> labels </item>
+ <item> lambda </item>
+ <item> lambda-list-keywords </item>
+ <item> lambda-parameters-limit </item>
+ <item> last </item>
+ <item> lcm </item>
+ <item> ldb </item>
+ <item> ldb-test </item>
+ <item> ldiff </item>
+ <item> least-negative-double-float </item>
+ <item> least-negative-long-float </item>
+ <item> least-negative-normalized-double-float </item>
+ <item> least-negative-normalized-long-float </item>
+ <item> least-negative-normalized-short-float </item>
+ <item> least-negative-normalized-single-float </item>
+ <item> least-negative-short-float </item>
+ <item> least-negative-single-float </item>
+ <item> least-positive-double-float </item>
+ <item> least-positive-long-float </item>
+ <item> least-positive-normalized-double-float </item>
+ <item> least-positive-normalized-long-float </item>
+ <item> least-positive-normalized-short-float </item>
+ <item> least-positive-normalized-single-float </item>
+ <item> least-positive-short-float </item>
+ <item> least-positive-single-float </item>
+ <item> length </item>
+ <item> let </item>
+ <item> let* </item>
+ <item> lisp </item>
+ <item> lisp-implementation-type </item>
+ <item> lisp-implementation-version </item>
+ <item> list </item>
+ <item> list* </item>
+ <item> list-all-packages </item>
+ <item> listen </item>
+ <item> list-length </item>
+ <item> listp </item>
+ <item> load </item>
+ <item> load-logical-pathname-translations </item>
+ <item> load-time-value </item>
+ <item> locally </item>
+ <item> log </item>
+ <item> logand </item>
+ <item> logandc1 </item>
+ <item> logandc2 </item>
+ <item> logbitp </item>
+ <item> logcount </item>
+ <item> logeqv </item>
+ <item> logical-pathname </item>
+ <item> logical-pathname-translations </item>
+ <item> logior </item>
+ <item> lognand </item>
+ <item> lognor </item>
+ <item> lognot </item>
+ <item> logorc1 </item>
+ <item> logorc2 </item>
+ <item> logtest </item>
+ <item> logxor </item>
+ <item> long-float </item>
+ <item> long-float-epsilon </item>
+ <item> long-float-negative-epsilon </item>
+ <item> long-site-name </item>
+ <item> loop </item>
+ <item> loop-finish </item>
+ <item> lower-case-p </item>
+ <item> machine-instance </item>
+ <item> machine-type </item>
+ <item> machine-version </item>
+ <item> macroexpand </item>
+ <item> macroexpand-1 </item>
+ <item> macroexpand-l </item>
+ <item> macro-function </item>
+ <item> macrolet </item>
+ <item> make-array </item>
+ <item> make-array </item>
+ <item> make-broadcast-stream </item>
+ <item> make-char </item>
+ <item> make-concatenated-stream </item>
+ <item> make-condition </item>
+ <item> make-dispatch-macro-character </item>
+ <item> make-echo-stream </item>
+ <item> make-hash-table </item>
+ <item> make-instance </item>
+ <item> make-instances-obsolete </item>
+ <item> make-list </item>
+ <item> make-load-form </item>
+ <item> make-load-form-saving-slots </item>
+ <item> make-method </item>
+ <item> make-package </item>
+ <item> make-pathname </item>
+ <item> make-random-state </item>
+ <item> make-sequence </item>
+ <item> make-string </item>
+ <item> make-string-input-stream </item>
+ <item> make-string-output-stream </item>
+ <item> make-symbol </item>
+ <item> make-synonym-stream </item>
+ <item> make-two-way-stream </item>
+ <item> makunbound </item>
+ <item> map </item>
+ <item> mapc </item>
+ <item> mapcan </item>
+ <item> mapcar </item>
+ <item> mapcon </item>
+ <item> maphash </item>
+ <item> map-into </item>
+ <item> mapl </item>
+ <item> maplist </item>
+ <item> mask-field </item>
+ <item> max </item>
+ <item> member </item>
+ <item> member-if </item>
+ <item> member-if-not </item>
+ <item> merge </item>
+ <item> merge-pathname </item>
+ <item> merge-pathnames </item>
+ <item> method </item>
+ <item> method-combination </item>
+ <item> method-combination-error </item>
+ <item> method-qualifiers </item>
+ <item> min </item>
+ <item> minusp </item>
+ <item> mismatch </item>
+ <item> mod </item>
+ <item> most-negative-double-float </item>
+ <item> most-negative-fixnum </item>
+ <item> most-negative-long-float </item>
+ <item> most-negative-short-float </item>
+ <item> most-negative-single-float </item>
+ <item> most-positive-double-float </item>
+ <item> most-positive-fixnum </item>
+ <item> most-positive-long-float </item>
+ <item> most-positive-short-float </item>
+ <item> most-positive-single-float </item>
+ <item> muffle-warning </item>
+ <item> multiple-value-bind </item>
+ <item> multiple-value-call </item>
+ <item> multiple-value-list </item>
+ <item> multiple-value-prog1 </item>
+ <item> multiple-value-seteq </item>
+ <item> multiple-value-setq </item>
+ <item> multiple-values-limit </item>
+ <item> name-char </item>
+ <item> namestring </item>
+ <item> nbutlast </item>
+ <item> nconc </item>
+ <item> next-method-p </item>
+ <item> nil </item>
+ <item> nintersection </item>
+ <item> ninth </item>
+ <item> no-applicable-method </item>
+ <item> no-next-method </item>
+ <item> not </item>
+ <item> notany </item>
+ <item> notevery </item>
+ <item> notinline </item>
+ <item> nreconc </item>
+ <item> nreverse </item>
+ <item> nset-difference </item>
+ <item> nset-exclusive-or </item>
+ <item> nstring </item>
+ <item> nstring-capitalize </item>
+ <item> nstring-downcase </item>
+ <item> nstring-upcase </item>
+ <item> nsublis </item>
+ <item> nsubst </item>
+ <item> nsubst-if </item>
+ <item> nsubst-if-not </item>
+ <item> nsubstitute </item>
+ <item> nsubstitute-if </item>
+ <item> nsubstitute-if-not </item>
+ <item> nth </item>
+ <item> nthcdr </item>
+ <item> nth-value </item>
+ <item> null </item>
+ <item> number </item>
+ <item> numberp </item>
+ <item> numerator </item>
+ <item> nunion </item>
+ <item> oddp </item>
+ <item> open </item>
+ <item> open-stream-p </item>
+ <item> optimize </item>
+ <item> or </item>
+ <item> otherwise </item>
+ <item> output-stream-p </item>
+ <item> package </item>
+ <item> package-error </item>
+ <item> package-error-package </item>
+ <item> package-name </item>
+ <item> package-nicknames </item>
+ <item> packagep </item>
+ <item> package-shadowing-symbols </item>
+ <item> package-used-by-list </item>
+ <item> package-use-list </item>
+ <item> pairlis </item>
+ <item> parse-error </item>
+ <item> parse-integer </item>
+ <item> parse-namestring </item>
+ <item> pathname </item>
+ <item> pathname-device </item>
+ <item> pathname-directory </item>
+ <item> pathname-host </item>
+ <item> pathname-match-p </item>
+ <item> pathname-name </item>
+ <item> pathnamep </item>
+ <item> pathname-type </item>
+ <item> pathname-version </item>
+ <item> peek-char </item>
+ <item> phase </item>
+ <item> pi </item>
+ <item> plusp </item>
+ <item> pop </item>
+ <item> position </item>
+ <item> position-if </item>
+ <item> position-if-not </item>
+ <item> pprint </item>
+ <item> pprint-dispatch </item>
+ <item> pprint-exit-if-list-exhausted </item>
+ <item> pprint-fill </item>
+ <item> pprint-indent </item>
+ <item> pprint-linear </item>
+ <item> pprint-logical-block </item>
+ <item> pprint-newline </item>
+ <item> pprint-pop </item>
+ <item> pprint-tab </item>
+ <item> pprint-tabular </item>
+ <item> prin1 </item>
+ <item> prin1-to-string </item>
+ <item> princ </item>
+ <item> princ-to-string </item>
+ <item> print </item>
+ <item> print-not-readable </item>
+ <item> print-not-readable-object </item>
+ <item> print-object </item>
+ <item> print-unreadable-object </item>
+ <item> probe-file </item>
+ <item> proclaim </item>
+ <item> prog </item>
+ <item> prog* </item>
+ <item> prog1 </item>
+ <item> prog2 </item>
+ <item> progn </item>
+ <item> program-error </item>
+ <item> progv </item>
+ <item> provide </item>
+ <item> psetf </item>
+ <item> psetq </item>
+ <item> push </item>
+ <item> pushnew </item>
+ <item> putprop </item>
+ <item> quote </item>
+ <item> random </item>
+ <item> random-state </item>
+ <item> random-state-p </item>
+ <item> rassoc </item>
+ <item> rassoc-if </item>
+ <item> rassoc-if-not </item>
+ <item> ratio </item>
+ <item> rational </item>
+ <item> rationalize </item>
+ <item> rationalp </item>
+ <item> read </item>
+ <item> read-byte </item>
+ <item> read-char </item>
+ <item> read-char-no-hang </item>
+ <item> read-delimited-list </item>
+ <item> reader-error </item>
+ <item> read-eval-print </item>
+ <item> read-from-string </item>
+ <item> read-line </item>
+ <item> read-preserving-whitespace </item>
+ <item> read-sequence </item>
+ <item> readtable </item>
+ <item> readtable-case </item>
+ <item> readtablep </item>
+ <item> real </item>
+ <item> realp </item>
+ <item> realpart </item>
+ <item> reduce </item>
+ <item> reinitialize-instance </item>
+ <item> rem </item>
+ <item> remf </item>
+ <item> remhash </item>
+ <item> remove </item>
+ <item> remove-duplicates </item>
+ <item> remove-if </item>
+ <item> remove-if-not </item>
+ <item> remove-method </item>
+ <item> remprop </item>
+ <item> rename-file </item>
+ <item> rename-package </item>
+ <item> replace </item>
+ <item> require </item>
+ <item> rest </item>
+ <item> restart </item>
+ <item> restart-bind </item>
+ <item> restart-case </item>
+ <item> restart-name </item>
+ <item> return </item>
+ <item> return-from </item>
+ <item> revappend </item>
+ <item> reverse </item>
+ <item> room </item>
+ <item> rotatef </item>
+ <item> round </item>
+ <item> row-major-aref </item>
+ <item> rplaca </item>
+ <item> rplacd </item>
+ <item> safety </item>
+ <item> satisfies </item>
+ <item> sbit </item>
+ <item> scale-float </item>
+ <item> schar </item>
+ <item> search </item>
+ <item> second </item>
+ <item> sequence </item>
+ <item> serious-condition </item>
+ <item> set </item>
+ <item> set-char-bit </item>
+ <item> set-difference </item>
+ <item> set-dispatch-macro-character </item>
+ <item> set-exclusive-or </item>
+ <item> setf </item>
+ <item> set-macro-character </item>
+ <item> set-pprint-dispatch </item>
+ <item> setq </item>
+ <item> set-syntax-from-char </item>
+ <item> seventh </item>
+ <item> shadow </item>
+ <item> shadowing-import </item>
+ <item> shared-initialize </item>
+ <item> shiftf </item>
+ <item> short-float </item>
+ <item> short-float-epsilon </item>
+ <item> short-float-negative-epsilon </item>
+ <item> short-site-name </item>
+ <item> signal </item>
+ <item> signed-byte </item>
+ <item> signum </item>
+ <item> simle-condition </item>
+ <item> simple-array </item>
+ <item> simple-base-string </item>
+ <item> simple-bit-vector </item>
+ <item> simple-bit-vector-p </item>
+ <item> simple-condition-format-arguments </item>
+ <item> simple-condition-format-control </item>
+ <item> simple-error </item>
+ <item> simple-string </item>
+ <item> simple-string-p </item>
+ <item> simple-type-error </item>
+ <item> simple-vector </item>
+ <item> simple-vector-p </item>
+ <item> simple-warning </item>
+ <item> sin </item>
+ <item> single-flaot-epsilon </item>
+ <item> single-float </item>
+ <item> single-float-epsilon </item>
+ <item> single-float-negative-epsilon </item>
+ <item> sinh </item>
+ <item> sixth </item>
+ <item> sleep </item>
+ <item> slot-boundp </item>
+ <item> slot-exists-p </item>
+ <item> slot-makunbound </item>
+ <item> slot-missing </item>
+ <item> slot-unbound </item>
+ <item> slot-value </item>
+ <item> software-type </item>
+ <item> software-version </item>
+ <item> some </item>
+ <item> sort </item>
+ <item> space </item>
+ <item> special </item>
+ <item> special-form-p </item>
+ <item> special-operator-p </item>
+ <item> speed </item>
+ <item> sqrt </item>
+ <item> stable-sort </item>
+ <item> standard </item>
+ <item> standard-char </item>
+ <item> standard-char-p </item>
+ <item> standard-class </item>
+ <item> standard-generic-function </item>
+ <item> standard-method </item>
+ <item> standard-object </item>
+ <item> step </item>
+ <item> storage-condition </item>
+ <item> store-value </item>
+ <item> stream </item>
+ <item> stream-element-type </item>
+ <item> stream-error </item>
+ <item> stream-error-stream </item>
+ <item> stream-external-format </item>
+ <item> streamp </item>
+ <item> streamup </item>
+ <item> string </item>
+ <item> string&lt; </item>
+ <item> string&lt;= </item>
+ <item> string= </item>
+ <item> string&gt; </item>
+ <item> string&gt;= </item>
+ <item> string/= </item>
+ <item> string-capitalize </item>
+ <item> string-char </item>
+ <item> string-char-p </item>
+ <item> string-downcase </item>
+ <item> string-equal </item>
+ <item> string-greaterp </item>
+ <item> string-left-trim </item>
+ <item> string-lessp </item>
+ <item> string-not-equal </item>
+ <item> string-not-greaterp </item>
+ <item> string-not-lessp </item>
+ <item> stringp </item>
+ <item> string-right-strim </item>
+ <item> string-right-trim </item>
+ <item> string-stream </item>
+ <item> string-trim </item>
+ <item> string-upcase </item>
+ <item> structure </item>
+ <item> structure-class </item>
+ <item> structure-object </item>
+ <item> style-warning </item>
+ <item> sublim </item>
+ <item> sublis </item>
+ <item> subseq </item>
+ <item> subsetp </item>
+ <item> subst </item>
+ <item> subst-if </item>
+ <item> subst-if-not </item>
+ <item> substitute </item>
+ <item> substitute-if </item>
+ <item> substitute-if-not </item>
+ <item> subtypep </item>
+ <item> svref </item>
+ <item> sxhash </item>
+ <item> symbol </item>
+ <item> symbol-function </item>
+ <item> symbol-macrolet </item>
+ <item> symbol-name </item>
+ <item> symbolp </item>
+ <item> symbol-package </item>
+ <item> symbol-plist </item>
+ <item> symbol-value </item>
+ <item> synonym-stream </item>
+ <item> synonym-stream-symbol </item>
+ <item> sys </item>
+ <item> system </item>
+ <item> t </item>
+ <item> tagbody </item>
+ <item> tailp </item>
+ <item> tan </item>
+ <item> tanh </item>
+ <item> tenth </item>
+ <item> terpri </item>
+ <item> the </item>
+ <item> third </item>
+ <item> throw </item>
+ <item> time </item>
+ <item> trace </item>
+ <item> translate-logical-pathname </item>
+ <item> translate-pathname </item>
+ <item> tree-equal </item>
+ <item> truename </item>
+ <item> truncase </item>
+ <item> truncate </item>
+ <item> two-way-stream </item>
+ <item> two-way-stream-input-stream </item>
+ <item> two-way-stream-output-stream </item>
+ <item> type </item>
+ <item> typecase </item>
+ <item> type-error </item>
+ <item> type-error-datum </item>
+ <item> type-error-expected-type </item>
+ <item> type-of </item>
+ <item> typep </item>
+ <item> unbound-slot </item>
+ <item> unbound-slot-instance </item>
+ <item> unbound-variable </item>
+ <item> undefined-function </item>
+ <item> unexport </item>
+ <item> unintern </item>
+ <item> union </item>
+ <item> unless </item>
+ <item> unread </item>
+ <item> unread-char </item>
+ <item> unsigned-byte </item>
+ <item> untrace </item>
+ <item> unuse-package </item>
+ <item> unwind-protect </item>
+ <item> update-instance-for-different-class </item>
+ <item> update-instance-for-redefined-class </item>
+ <item> upgraded-array-element-type </item>
+ <item> upgraded-complex-part-type </item>
+ <item> upper-case-p </item>
+ <item> use-package </item>
+ <item> user </item>
+ <item> user-homedir-pathname </item>
+ <item> use-value </item>
+ <item> values </item>
+ <item> values-list </item>
+ <item> vector </item>
+ <item> vectorp </item>
+ <item> vector-pop </item>
+ <item> vector-push </item>
+ <item> vector-push-extend </item>
+ <item> warn </item>
+ <item> warning </item>
+ <item> when </item>
+ <item> wild-pathname-p </item>
+ <item> with-accessors </item>
+ <item> with-compilation-unit </item>
+ <item> with-condition-restarts </item>
+ <item> with-hash-table-iterator </item>
+ <item> with-input-from-string </item>
+ <item> with-open-file </item>
+ <item> with-open-stream </item>
+ <item> with-output-to-string </item>
+ <item> with-package-iterator </item>
+ <item> with-simple-restart </item>
+ <item> with-slots </item>
+ <item> with-standard-io-syntax </item>
+ <item> write </item>
+ <item> write-byte </item>
+ <item> write-char </item>
+ <item> write-line </item>
+ <item> write-sequence </item>
+ <item> write-string </item>
+ <item> write-to-string </item>
+ <item> yes-or-no-p </item>
+ <item> y-or-n-p </item>
+ <item> zerop </item>
+ </list>
+
+ <list name="modifiers">
+ <item> :abort </item>
+ <item> :adjustable </item>
+ <item> :append </item>
+ <item> :array </item>
+ <item> :base </item>
+ <item> :case </item>
+ <item> :circle </item>
+ <item> :conc-name </item>
+ <item> :constructor </item>
+ <item> :copier </item>
+ <item> :count </item>
+ <item> :create </item>
+ <item> :default </item>
+ <item> :defaults </item>
+ <item> :device </item>
+ <item> :direction </item>
+ <item> :directory </item>
+ <item> :displaced-index-offset </item>
+ <item> :displaced-to </item>
+ <item> :element-type </item>
+ <item> :end1 </item>
+ <item> :end2 </item>
+ <item> :end </item>
+ <item> :error </item>
+ <item> :escape </item>
+ <item> :external </item>
+ <item> :from-end </item>
+ <item> :gensym </item>
+ <item> :host </item>
+ <item> :if-does-not-exist:pretty </item>
+ <item> :if-exists:print </item>
+ <item> :include:print-function </item>
+ <item> :index </item>
+ <item> :inherited </item>
+ <item> :initial-contents </item>
+ <item> :initial-element </item>
+ <item> :initial-offset </item>
+ <item> :initial-value </item>
+ <item> :input </item>
+ <item> :internal:size </item>
+ <item> :io </item>
+ <item> :junk-allowed </item>
+ <item> :key </item>
+ <item> :length </item>
+ <item> :level </item>
+ <item> :named </item>
+ <item> :name </item>
+ <item> :new-version </item>
+ <item> :nicknames </item>
+ <item> :output-file </item>
+ <item> :output </item>
+ <item> :overwrite </item>
+ <item> :predicate </item>
+ <item> :preserve-whitespace </item>
+ <item> :probe </item>
+ <item> :radix </item>
+ <item> :read-only </item>
+ <item> :rehash-size </item>
+ <item> :rehash-threshold </item>
+ <item> :rename-and-delete </item>
+ <item> :rename </item>
+ <item> :start1 </item>
+ <item> :start2 </item>
+ <item> :start </item>
+ <item> :stream </item>
+ <item> :supersede </item>
+ <item> :test </item>
+ <item> :test-not </item>
+ <item> :type </item>
+ <item> :use </item>
+ <item> :verbose </item>
+ <item> :version </item>
+ </list>
+ <list name="variables">
+ <item> *applyhook* </item>
+ <item> *break-on-signals* </item>
+ <item> *break-on-signals* </item>
+ <item> *break-on-warnings* </item>
+ <item> *compile-file-pathname* </item>
+ <item> *compile-file-pathname* </item>
+ <item> *compile-file-truename* </item>
+ <item> *compile-file-truename* </item>
+ <item> *compile-print* </item>
+ <item> *compile-verbose* </item>
+ <item> *compile-verbose* </item>
+ <item> *debugger-hook* </item>
+ <item> *debug-io* </item>
+ <item> *default-pathname-defaults* </item>
+ <item> *error-output* </item>
+ <item> *evalhook* </item>
+ <item> *features* </item>
+ <item> *gensym-counter* </item>
+ <item> *load-pathname* </item>
+ <item> *load-print* </item>
+ <item> *load-truename* </item>
+ <item> *load-verbose* </item>
+ <item> *macroexpand-hook* </item>
+ <item> *modules* </item>
+ <item> *package* </item>
+ <item> *print-array* </item>
+ <item> *print-base* </item>
+ <item> *print-case* </item>
+ <item> *print-circle* </item>
+ <item> *print-escape* </item>
+ <item> *print-gensym* </item>
+ <item> *print-length* </item>
+ <item> *print-level* </item>
+ <item> *print-lines* </item>
+ <item> *print-miser-width* </item>
+ <item> *print-miser-width* </item>
+ <item> *print-pprint-dispatch* </item>
+ <item> *print-pprint-dispatch* </item>
+ <item> *print-pretty* </item>
+ <item> *print-radix* </item>
+ <item> *print-readably* </item>
+ <item> *print-right-margin* </item>
+ <item> *print-right-margin* </item>
+ <item> *query-io* </item>
+ <item> *random-state* </item>
+ <item> *read-base* </item>
+ <item> *read-default-float-format* </item>
+ <item> *read-eval* </item>
+ <item> *read-suppress* </item>
+ <item> *readtable* </item>
+ <item> *standard-input* </item>
+ <item> *standard-output* </item>
+ <item> *terminal-io* </item>
+ <item> *trace-output* </item>
+ </list>
+
+ <contexts>
+ <context name="Normal" attribute="Normal" lineEndContext="#stay">
+ <RegExpr attribute="Region Marker" context="#stay" String=";+\s*BEGIN.*$" beginRegion="region"/>
+ <RegExpr attribute="Region Marker" context="#stay" String=";+\s*END.*$" endRegion="region"/>
+ <RegExpr attribute="Comment" context="#stay" String=";.*$"/>
+ <Detect2Chars attribute="Comment" context="MultiLineComment" char="#" char1="|" beginRegion="region"/>
+ <DetectChar attribute="Brackets" context="#stay" char="("/>
+ <DetectChar attribute="Brackets" context="#stay" char=")"/>
+ <keyword attribute="Keyword" context="#stay" String="keywords"/>
+ <keyword attribute="Operator" context="#stay" String="symbols"/>
+ <keyword attribute="Modifier" context="#stay" String="modifiers"/>
+ <keyword attribute="Variable" context="#stay" String="variables"/>
+ <keyword attribute="Definition" context="function_decl" String="definitions"/>
+ <RegExpr attribute="Char" context="#stay" String="#\\."/>
+ <DetectChar attribute="String" context="String" char="&quot;"/>
+ <RegExpr attribute="Char" context="SpecialNumber" String="#[bodxei]"/>
+ <RegExpr attribute="Decimal" context="#stay" String="#[tf]"/>
+ <Float attribute="Float" context="#stay"/>
+ <Int attribute="Decimal" context="#stay"/>
+ </context>
+ <context name="MultiLineComment" attribute="Comment" lineEndContext="#stay">
+ <Detect2Chars attribute="Comment" context="#pop" char="|" char1="#" endRegion="region"/>
+ </context>
+ <context name="function_decl" attribute="Function" lineEndContext="#stay">
+ <RegExpr attribute="Function" context="#pop" String="\s*[A-Za-z0-9-+\&lt;\&gt;//\*]*\s*" />
+ </context>
+ <context name="SpecialNumber" attribute="Normal" lineEndContext="#pop">
+ <Float attribute="Float" context="#pop"/>
+ <Int attribute="Decimal" context="#pop"/>
+ <HlCOct attribute="BaseN" context="#pop"/>
+ <HlCHex attribute="Float" context="#pop"/>
+ </context>
+ <context name="String" attribute="String" lineEndContext="#stay">
+ <RegExpr attribute="Char" context="#stay" String="#\\."/>
+ <DetectChar attribute="String" context="#pop" char="&quot;"/>
+ </context>
+ </contexts>
+ <itemDatas>
+ <itemData name="Normal" defStyleNum="dsNormal"/>
+ <itemData name="Keyword" defStyleNum="dsKeyword"/>
+ <itemData name="Operator" defStyleNum="dsKeyword" color="#d22811"/>
+ <itemData name="Modifier" defStyleNum="dsKeyword" color="#800000"/>
+ <itemData name="Variable" defStyleNum="dsKeyword" color="#b07e1f"/>
+ <itemData name="Definition" defStyleNum="dsKeyword" color="#d22811"/>
+ <itemData name="Data" defStyleNum="dsDataType"/>
+ <itemData name="Decimal" defStyleNum="dsDecVal"/>
+ <itemData name="BaseN" defStyleNum="dsBaseN"/>
+ <itemData name="Float" defStyleNum="dsFloat"/>
+ <itemData name="Function" defStyleNum="dsFunction"/>
+ <itemData name="Char" defStyleNum="dsChar"/>
+ <itemData name="String" defStyleNum="dsString"/>
+ <itemData name="Comment" defStyleNum="dsComment"/>
+ <itemData name="Region Marker" defStyleNum="dsRegionMarker"/>
+ <itemData name="Brackets" defStyleNum="dsNormal" color="#0000ff" selColor="#00ff00" bold="1" italic="0"/>
+ </itemDatas>
+ </highlighting>
+ <general>
+ <keywords casesensitive="1" weakDeliminator="-+*?!&lt;&gt;=/:#\"/>
+ <comments>
+ <comment name="singleLine" start=";;" />
+ <comment name="multiLine" start="#|" end="|#" />
+ </comments>
+ </general>
+</language>
diff --git a/kate/data/component-pascal.xml b/kate/data/component-pascal.xml
new file mode 100644
index 000000000..09e70011b
--- /dev/null
+++ b/kate/data/component-pascal.xml
@@ -0,0 +1,172 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+<!-- Author: Werner Braun <wb@o3-software.de> -->
+<!-- 29.05.2003 wb mailed to the kate-team (cullmann) -->
+<!-- 23.05.2003 wb added *.bro File-Type for GPCP Browser output-->
+<!-- 09.05.2003 wb nested comments allowed (maximum two level nesting) -->
+<!-- 07.04.2003 wb IN Problem solved -->
+<!-- 06.05.2003 wb NEW without ( -->
+<!-- 22.04.2003 wb Minor bugfixes -->
+<!-- 19.04.2003 wb Some more Enhancements -->
+<!-- 18.04.2003 wb Enhancenment for Maior / Minor Comments and Full / ReadOnly Exports, Folds for Procedures, Records, Comments -->
+<!-- 17.04.2003 wb Enhancements for Relation and Operators -->
+<language name="Component-Pascal" version="1.05" kateversion="2.1" section="Sources" extensions="*.cp;*.bro" mimetype="text/x-component-pascal" author="Werner Braun (wb@o3-software.de)" license="">
+ <highlighting>
+ <list name="keywords">
+ <item> BEGIN </item>
+ <item> BY </item>
+ <item> CASE </item>
+ <item> CLOSE </item>
+ <item> CONST </item>
+ <item> DO </item>
+ <item> ELSE </item>
+ <item> ELSIF </item>
+ <item> END </item>
+ <item> FOR </item>
+ <item> IF </item>
+ <item> IMPORT </item>
+ <item> LOOP </item>
+ <item> MODULE </item>
+ <item> NEW </item>
+ <item> OF </item>
+ <item> OUT </item>
+ <item> PROCEDURE </item>
+ <item> REPEAT </item>
+ <item> THEN </item>
+ <item> TO </item>
+ <item> TYPE </item>
+ <item> UNTIL </item>
+ <item> VAR </item>
+ <item> WHILE </item>
+ <item> WITH </item>
+ </list>
+ <list name="exits">
+ <item> ASSERT </item>
+ <item> EXIT </item>
+ <item> HALT </item>
+ <item> RETURN </item>
+ </list>
+ <list name="types">
+ <item> ANYPTR </item>
+ <item> ANYREC </item>
+ <item> ARRAY </item>
+ <item> BOOLEAN </item>
+ <item> SHORTCHAR </item>
+ <item> CHAR </item>
+ <item> BYTE </item>
+ <item> SHORTINT </item>
+ <item> INTEGER </item>
+ <item> LONGINT </item>
+ <item> POINTER </item>
+ <item> RECORD </item>
+ <item> SHORTREAL </item>
+ <item> REAL </item>
+ <item> SET </item>
+ </list>
+ <list name="attributes">
+ <item> ABSTRACT </item>
+ <item> EMPTY </item>
+ <item> EXTENSIBLE </item>
+ <item> LIMITED </item>
+ </list>
+ <list name="builtins">
+ <item> ABS </item>
+ <item> ASH </item>
+ <item> BITS </item>
+ <item> CAP </item>
+ <item> CHR </item>
+ <item> DEC </item>
+ <item> ENTIER </item>
+ <item> EXCL </item>
+ <item> INC </item>
+ <item> INCL </item>
+ <item> LEN </item>
+ <item> LONG </item>
+ <item> MAX </item>
+ <item> MIN </item>
+ <item> ODD </item>
+ <item> ORD </item>
+ <item> SHORT </item>
+ <item> SIZE </item>
+ </list>
+ <list name="specials">
+ <item> FALSE </item>
+ <item> INF </item>
+ <item> NIL </item>
+ <item> TRUE </item>
+ </list>
+ <contexts>
+ <context attribute="Normal Text" lineEndContext="#stay" name="Normal">
+ <StringDetect attribute="CommentMaior" context="Comment1" String="(**" beginRegion="Comment"/>
+ <Detect2Chars attribute="CommentMinor" context="Comment2" char="(" char1="*" beginRegion="Comment"/>
+ <DetectChar attribute="String" context="String1" char="&quot;" />
+ <DetectChar attribute="String" context="String2" char="'" />
+ <RegExpr attribute="Keyword" context="#stay" String="PROCEDURE\s" beginRegion="Proc"/>
+ <RegExpr attribute="Normal Text" context="#stay" String="ABSTRACT;|EMPTY;|END\s*[A-Za-z][A-Za-z0-9_]*\;" endRegion="Proc"/>
+ <RegExpr attribute="Type" context="#stay" String="RECORD" beginRegion="Rec"/>
+ <RegExpr attribute="Keyword" context="#stay" String="END" endRegion="Rec"/>
+ <StringDetect attribute="MemAlloc" context="#stay" String="NEW"/>
+ <keyword attribute="Keyword" context="#stay" String="keywords"/>
+ <keyword attribute="Exit" context="#stay" String="exits"/>
+ <keyword attribute="Type" context="#stay" String="types"/>
+ <keyword attribute="Attribute" context="#stay" String="attributes"/>
+ <keyword attribute="Builtin" context="#stay" String="builtins"/>
+ <keyword attribute="SpecialValues" context="#stay" String="specials"/>
+ <RegExpr attribute="Integer" context="#stay" String="\s[\+|\-]{0,1}[0-9]([0-9]*|[0-9A-F]*(H|L))"/>
+ <Float attribute="Float" context="#stay"/>
+ <RegExpr attribute="Char" context="#stay" String="\s[0-9][0-9A-F]*X"/>
+ <RegExpr attribute="ExportFull" context="#stay" String="[A-Za-z][A-Za-z0-9_]*\*"/>
+ <RegExpr attribute="ExportReadOnly" context="#stay" String="[A-Za-z][A-Za-z0-9_]*\-"/>
+ <RegExpr attribute="Relation" context="#stay" String="\s(=|#|&lt;|&lt;=|&gt;|&gt;=|IN\s|IS)"/>
+ <RegExpr attribute="Operator" context="#stay" String="\s(\+|\-|OR|\*|/|DIV|MOD|\&amp;)"/>
+ </context>
+ <context attribute="CommentMaior" lineEndContext="#stay" name="Comment1">
+ <Detect2Chars attribute="CommentMaior" context="#pop" char="*" char1=")" endRegion="Comment"/>
+ <Detect2Chars attribute="CommentMinor" context="CommentN" char="(" char1="*"/>
+ </context>
+ <context attribute="CommentMinor" lineEndContext="#stay" name="Comment2">
+ <Detect2Chars attribute="CommentMinor" context="#pop" char="*" char1=")" endRegion="Comment"/>
+ <Detect2Chars attribute="CommentMinor" context="CommentN" char="(" char1="*"/>
+ </context>
+ <context attribute="CommentMinor" lineEndContext="#stay" name="CommentN">
+ <Detect2Chars attribute="CommentMinor" context="#pop" char="*" char1=")"/>
+ <Detect2Chars attribute="CommentMinor" context="CommentN2" char="(" char1="*"/>
+ </context>
+ <context attribute="CommentMinor" lineEndContext="#stay" name="CommentN2">
+ <Detect2Chars attribute="CommentMinor" context="#pop" char="*" char1=")"/>
+ </context>
+ <context attribute="String" lineEndContext="#stay" name="String1">
+ <DetectChar attribute="String" context="#pop" char="&quot;"/>
+ </context>
+ <context attribute="String" lineEndContext="#stay" name="String2">
+ <DetectChar attribute="String" context="#pop" char="'"/>
+ </context>
+ </contexts>
+ <itemDatas>
+ <itemData name="Normal Text" defStyleNum="dsNormal" />
+ <itemData name="CommentMaior" defStyleNum="dsComment" />
+ <itemData name="CommentMinor" defStyleNum="dsComment" />
+ <itemData name="String" defStyleNum="dsString" />
+ <itemData name="Keyword" defStyleNum="dsKeyword" />
+ <itemData name="MemAlloc" defStyleNum="dsKeyword" />
+ <itemData name="Exit" defStyleNum="dsKeyword"/>
+ <itemData name="Type" defStyleNum="dsDataType"/>
+ <itemData name="Attribute" defStyleNum="dsOthers"/>
+ <itemData name="Builtin" defStyleNum="dsNormal"/>
+ <itemData name="Integer" defStyleNum="dsBaseN"/>
+ <itemData name="Float" defStyleNum="dsFloat" />
+ <itemData name="Char" defStyleNum="dsChar" />
+ <itemData name="SpecialValues" defStyleNum="dsDecVal"/>
+ <itemData name="ExportFull" defStyleNum="dsOthers"/>
+ <itemData name="ExportReadOnly" defStyleNum="dsOthers"/>
+ <itemData name="Relation" defStyleNum="dsNormal"/>
+ <itemData name="Operator" defStyleNum="dsNormal"/>
+ </itemDatas>
+ </highlighting>
+ <general>
+ <keywords casesensitive="1" />
+ <comments>
+ <comment name="multiLine" start="(*" end="*)" />
+ </comments>
+ </general>
+</language>
diff --git a/kate/data/cpp.xml b/kate/data/cpp.xml
new file mode 100644
index 000000000..790c0d8f9
--- /dev/null
+++ b/kate/data/cpp.xml
@@ -0,0 +1,273 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+<language name="C++" version="1.38" kateversion="2.4" section="Sources" extensions="*.c++;*.cxx;*.cpp;*.cc;*.C;*.h;*.hh;*.H;*.h++;*.hxx;*.hpp;*.hcc;*.moc" mimetype="text/x-c++src;text/x-c++hdr;text/x-chdr" priority="9">
+ <highlighting>
+ <list name="keywords">
+ <item> asm </item>
+ <item> break </item>
+ <item> case </item>
+ <item> catch </item>
+ <item> class </item>
+ <item> const_cast </item>
+ <item> continue </item>
+ <item> default </item>
+ <item> delete </item>
+ <item> do </item>
+ <item> dynamic_cast</item>
+ <item> else </item>
+ <item> enum </item>
+ <item> explicit </item>
+ <item> export </item>
+ <item> extern </item>
+ <item> false </item>
+ <item> friend </item>
+ <item> for </item>
+ <item> goto </item>
+ <item> if </item>
+ <item> inline </item>
+ <item> namespace </item>
+ <item> new </item>
+ <item> operator </item>
+ <item> private </item>
+ <item> protected </item>
+ <item> public </item>
+ <item> qobject_cast </item>
+ <item> reinterpret_cast </item>
+ <item> return </item>
+ <item> sizeof </item>
+ <item> static_cast </item>
+ <item> struct </item>
+ <item> switch </item>
+ <item> template </item>
+ <item> this </item>
+ <item> throw </item>
+ <item> true </item>
+ <item> try </item>
+ <item> typedef </item>
+ <item> typeid </item>
+ <item> type_info </item>
+ <item> typename </item>
+ <item> union </item>
+ <item> using </item>
+ <item> virtual </item>
+ <item> while </item>
+
+ <item> and </item>
+ <item> and_eq </item>
+ <item> bad_cast </item>
+ <item> bad_typeid </item>
+ <item> bitand </item>
+ <item> bitor </item>
+ <item> compl </item>
+ <item> not </item>
+ <item> not_eq </item>
+ <item> or </item>
+ <item> or_eq </item>
+ <item> xor </item>
+ <item> xor_eq </item>
+ <item> except </item>
+ <item> finally </item>
+ <item> xalloc </item>
+ </list>
+ <list name="extensions">
+ <item> K_DCOP </item>
+ <item> SLOT </item>
+ <item> SIGNAL </item>
+ <item> Q_CLASSINFO </item>
+ <item> Q_ENUMS </item>
+ <item> Q_EXPORT </item>
+ <item> Q_OBJECT </item>
+ <item> Q_OVERRIDE </item>
+ <item> Q_PROPERTY </item>
+ <item> Q_SETS </item>
+ <item> Q_SIGNALS </item>
+ <item> Q_SLOTS </item>
+ <item> Q_FOREACH </item>
+ <item> Q_DECLARE_FLAGS </item>
+ <item> Q_INIT_RESOURCE </item>
+ <item> Q_CLEANUP_RESOURCE </item>
+ <item> Q_GLOBAL_STATIC </item>
+ <item> Q_GLOBAL_STATIC_WITH_ARGS </item>
+ <item> Q_DECLARE_INTERFACE </item>
+ <item> Q_DECLARE_TYPEINFO </item>
+ <item> Q_DECLARE_SHARED </item>
+ <item> Q_DECLARE_FLAGS </item>
+ <item> Q_DECLARE_OPERATORS_FOR_FLAGS </item>
+ <item> Q_FOREVER </item>
+ <item> Q_DECLARE_PRIVATE </item>
+ <item> Q_DECLARE_PUBLIC </item>
+ <item> Q_D </item>
+ <item> Q_Q </item>
+ <item> Q_DISABLE_COPY </item>
+ <item> Q_INTERFACES </item>
+ <item> Q_FLAGS </item>
+ <item> Q_SCRIPTABLE </item>
+ <item> Q_INVOKABLE </item>
+ <item> Q_GADGET </item>
+ <item> Q_ARG </item>
+ <item> Q_RETURN_ARG </item>
+ <item> Q_ASSERT </item>
+ <item> Q_ASSERT_X </item>
+ <item> Q_PRIVATE_SLOT </item>
+ <item> Q_DECLARE_METATYPE </item>
+ <item> Q_NOREPLY </item>
+ <item> TRUE </item>
+ <item> FALSE </item>
+ <item> connect </item>
+ <item> disconnect </item>
+ <item> emit </item>
+ <item> signals </item>
+ <item> slots </item>
+ <item> foreach </item>
+ <item> forever </item>
+ </list>
+ <list name="types">
+ <item> auto </item>
+ <item> bool </item>
+ <item> char </item>
+ <item> const </item>
+ <item> double </item>
+ <item> float </item>
+ <item> int </item>
+ <item> long </item>
+ <item> mutable </item>
+ <item> register </item>
+ <item> short </item>
+ <item> signed </item>
+ <item> static </item>
+ <item> unsigned </item>
+ <item> void </item>
+ <item> volatile </item>
+ <item> uchar </item>
+ <item> uint </item>
+ <item> int8_t </item>
+ <item> int16_t </item>
+ <item> int32_t </item>
+ <item> int64_t </item>
+ <item> uint8_t </item>
+ <item> uint16_t </item>
+ <item> uint32_t </item>
+ <item> uint64_t </item>
+ <item> wchar_t </item>
+ </list>
+ <contexts>
+ <context attribute="Normal Text" lineEndContext="#stay" name="Normal">
+ <DetectSpaces />
+ <RegExpr attribute="Preprocessor" context="Outscoped" String="#\s*if\s+0" beginRegion="Outscoped" firstNonSpace="true" />
+ <DetectChar attribute="Preprocessor" context="Preprocessor" char="#" firstNonSpace="true" />
+ <StringDetect attribute="Region Marker" context="Region Marker" String="//BEGIN" beginRegion="Region1" firstNonSpace="true" />
+ <StringDetect attribute="Region Marker" context="Region Marker" String="//END" endRegion="Region1" firstNonSpace="true" />
+ <keyword attribute="Keyword" context="#stay" String="keywords" />
+ <keyword attribute="Extensions" context="#stay" String="extensions" />
+ <keyword attribute="Data Type" context="#stay" String="types" />
+ <HlCChar attribute="Char" context="#stay"/>
+ <DetectChar attribute="String" context="String" char="&quot;"/>
+ <DetectIdentifier />
+ <Float attribute="Float" context="#stay">
+ <AnyChar String="fF" attribute="Float" context="#stay"/>
+ </Float>
+ <HlCOct attribute="Octal" context="#stay"/>
+ <HlCHex attribute="Hex" context="#stay"/>
+ <Int attribute="Decimal" context="#stay">
+ <StringDetect attribute="Decimal" context="#stay" String="ULL" insensitive="TRUE"/>
+ <StringDetect attribute="Decimal" context="#stay" String="LUL" insensitive="TRUE"/>
+ <StringDetect attribute="Decimal" context="#stay" String="LLU" insensitive="TRUE"/>
+ <StringDetect attribute="Decimal" context="#stay" String="UL" insensitive="TRUE"/>
+ <StringDetect attribute="Decimal" context="#stay" String="LU" insensitive="TRUE"/>
+ <StringDetect attribute="Decimal" context="#stay" String="LL" insensitive="TRUE"/>
+ <StringDetect attribute="Decimal" context="#stay" String="U" insensitive="TRUE"/>
+ <StringDetect attribute="Decimal" context="#stay" String="L" insensitive="TRUE"/>
+ </Int>
+ <IncludeRules context="##Doxygen" />
+ <Detect2Chars attribute="Comment" context="Commentar 1" char="/" char1="/"/>
+ <Detect2Chars attribute="Comment" context="Commentar 2" char="/" char1="*" beginRegion="Comment"/>
+ <DetectChar attribute="Symbol" context="#stay" char="{" beginRegion="Brace1" />
+ <DetectChar attribute="Symbol" context="#stay" char="}" endRegion="Brace1" />
+ <AnyChar attribute="Symbol" context="#stay" String=":!%&amp;()+,-/.*&lt;=&gt;?[]{|}~^&#59;"/>
+ </context>
+ <context attribute="String" lineEndContext="#pop" name="String">
+ <LineContinue attribute="String" context="#stay"/>
+ <HlCStringChar attribute="String Char" context="#stay"/>
+ <DetectChar attribute="String" context="#pop" char="&quot;"/>
+ </context>
+ <context attribute="Region Marker" lineEndContext="#pop" name="Region Marker">
+ </context>
+ <context attribute="Comment" lineEndContext="#pop" name="Commentar 1">
+ <DetectSpaces />
+ <IncludeRules context="##Alerts" />
+ <DetectIdentifier />
+ </context>
+ <context attribute="Comment" lineEndContext="#stay" name="Commentar 2">
+ <DetectSpaces />
+ <Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" endRegion="Comment"/>
+ <IncludeRules context="##Alerts" />
+ <DetectIdentifier />
+ </context>
+ <context attribute="Preprocessor" lineEndContext="#pop" name="Preprocessor">
+ <LineContinue attribute="Preprocessor" context="#stay"/>
+ <RegExpr attribute="Preprocessor" context="Define" String="define.*((?=\\))"/>
+ <RegExpr attribute="Preprocessor" context="#stay" String="define.*"/>
+ <RangeDetect attribute="Prep. Lib" context="#stay" char="&quot;" char1="&quot;"/>
+ <RangeDetect attribute="Prep. Lib" context="#stay" char="&lt;" char1="&gt;"/>
+ <IncludeRules context="##Doxygen" />
+ <Detect2Chars attribute="Comment" context="Commentar 1" char="/" char1="/"/>
+ <Detect2Chars attribute="Comment" context="Commentar/Preprocessor" char="/" char1="*"/>
+ </context>
+ <context attribute="Preprocessor" lineEndContext="#pop" name="Define">
+ <LineContinue attribute="Preprocessor" context="#stay"/>
+ </context>
+ <context attribute="Comment" lineEndContext="#stay" name="Commentar/Preprocessor">
+ <DetectSpaces />
+ <Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" />
+ <DetectIdentifier />
+ </context>
+ <context attribute="Comment" lineEndContext="#stay" name="Outscoped" >
+ <DetectSpaces />
+ <IncludeRules context="##Alerts" />
+ <DetectIdentifier />
+ <DetectChar attribute="String" context="String" char="&quot;"/>
+ <IncludeRules context="##Doxygen" />
+ <Detect2Chars attribute="Comment" context="Commentar 1" char="/" char1="/"/>
+ <Detect2Chars attribute="Comment" context="Commentar 2" char="/" char1="*" beginRegion="Comment"/>
+ <RegExpr attribute="Comment" context="Outscoped intern" String="#\s*if" beginRegion="Outscoped" firstNonSpace="true" />
+ <RegExpr attribute="Preprocessor" context="#pop" String="#\s*(endif|else|elif)" endRegion="Outscoped" firstNonSpace="true" />
+ </context>
+ <context attribute="Comment" lineEndContext="#stay" name="Outscoped intern">
+ <DetectSpaces />
+ <IncludeRules context="##Alerts" />
+ <DetectIdentifier />
+ <DetectChar attribute="String" context="String" char="&quot;"/>
+ <IncludeRules context="##Doxygen" />
+ <Detect2Chars attribute="Comment" context="Commentar 1" char="/" char1="/"/>
+ <Detect2Chars attribute="Comment" context="Commentar 2" char="/" char1="*" beginRegion="Comment"/>
+ <RegExpr attribute="Comment" context="Outscoped intern" String="#\s*if" beginRegion="Outscoped" firstNonSpace="true"/>
+ <RegExpr attribute="Comment" context="#pop" String="#\s*endif" endRegion="Outscoped" firstNonSpace="true"/>
+ </context>
+ </contexts>
+ <itemDatas>
+ <itemData name="Normal Text" defStyleNum="dsNormal"/>
+ <itemData name="Keyword" defStyleNum="dsKeyword"/>
+ <itemData name="Extensions" defStyleNum="dsKeyword" color="#0095ff" selColor="#ffffff" bold="1" italic="0"/>
+ <itemData name="Data Type" defStyleNum="dsDataType"/>
+ <itemData name="Decimal" defStyleNum="dsDecVal"/>
+ <itemData name="Octal" defStyleNum="dsBaseN"/>
+ <itemData name="Hex" defStyleNum="dsBaseN"/>
+ <itemData name="Float" defStyleNum="dsFloat"/>
+ <itemData name="Char" defStyleNum="dsChar"/>
+ <itemData name="String" defStyleNum="dsString"/>
+ <itemData name="String Char" defStyleNum="dsChar"/>
+ <itemData name="Comment" defStyleNum="dsComment"/>
+ <itemData name="Symbol" defStyleNum="dsNormal"/>
+ <itemData name="Preprocessor" defStyleNum="dsOthers"/>
+ <itemData name="Prep. Lib" defStyleNum="dsOthers"/>
+ <itemData name="Region Marker" defStyleNum="dsRegionMarker" />
+ </itemDatas>
+ </highlighting>
+ <general>
+ <comments>
+ <comment name="singleLine" start="//" />
+ <comment name="multiLine" start="/*" end="*/" region="Comment"/>
+ </comments>
+ <keywords casesensitive="1" />
+ </general>
+</language>
diff --git a/kate/data/cs.xml b/kate/data/cs.xml
new file mode 100644
index 000000000..3393aa204
--- /dev/null
+++ b/kate/data/cs.xml
@@ -0,0 +1,161 @@
+<!DOCTYPE language SYSTEM "language.dtd">
+<language name="C#" version="1.14" kateversion="2.3" section="Sources" extensions="*.cs" mimetype="text/x-csharp-src;text/x-csharp-hde">
+ <highlighting>
+ <list name="keywords">
+ <item> abstract</item>
+ <item> as</item>
+ <item> base</item>
+ <item> break</item>
+ <item> case</item>
+ <item> catch</item>
+ <item> class</item>
+ <item> checked</item>
+ <item> continue</item>
+ <item> default</item>
+ <item> delegate</item>
+ <item> do</item>
+ <item> else</item>
+ <item> enum</item>
+ <item> event</item>
+ <item> explicit</item>
+ <item> extern</item>
+ <item> false</item>
+ <item> for</item>
+ <item> foreach</item>
+ <item> finally</item>
+ <item> fixed</item>
+ <item> goto</item>
+ <item> if</item>
+ <item> implicit</item>
+ <item> in</item>
+ <item> interface</item>
+ <item> internal</item>
+ <item> is</item>
+ <item> lock</item>
+ <item> namespace</item>
+ <item> new</item>
+ <item> null</item>
+ <item> operator</item>
+ <item> out</item>
+ <item> override</item>
+ <item> params</item>
+ <item> private</item>
+ <item> protected</item>
+ <item> public</item>
+ <item> readonly</item>
+ <item> ref</item>
+ <item> return</item>
+ <item> sealed</item>
+ <item> sizeof</item>
+ <item> stackalloc</item>
+ <item> static</item>
+ <item> struct</item>
+ <item> switch</item>
+ <item> this</item>
+ <item> throw</item>
+ <item> true</item>
+ <item> try</item>
+ <item> typeof</item>
+ <item> unchecked</item>
+ <item> unsafe</item>
+ <item> using</item>
+ <item> virtual</item>
+ <item> while</item>
+ <item> #if</item>
+ <item> #else</item>
+ <item> #elif</item>
+ <item> #endif</item>
+ <item> #define</item>
+ <item> #undef</item>
+ <item> #warning</item>
+ <item> #error</item>
+ <item> #line</item>
+ </list>
+ <list name="types">
+ <item> bool</item>
+ <item> byte</item>
+ <item> char</item>
+ <item> const</item>
+ <item> decimal</item>
+ <item> double</item>
+ <item> float</item>
+ <item> int</item>
+ <item> long</item>
+ <item> object</item>
+ <item> uint</item>
+ <item> ushort</item>
+ <item> ulong</item>
+ <item> sbyte</item>
+ <item> short</item>
+ <item> string</item>
+ <item> void</item>
+ </list>
+ <contexts>
+ <context attribute="Normal Text" lineEndContext="#stay" name="Normal">
+ <keyword attribute="Keyword" context="#stay" String="keywords"/>
+ <keyword attribute="Data Type" context="#stay" String="types" />
+ <Float attribute="Float" context="#stay">
+ <AnyChar String="fF" attribute="Float" context="#stay"/>
+ </Float>
+ <HlCOct attribute="Octal" context="#stay"/>
+ <HlCHex attribute="Hex" context="#stay"/>
+ <Int attribute="Decimal" context="#stay" >
+ <StringDetect attribute="Decimal" context="#stay" String="ULL" insensitive="TRUE"/>
+ <StringDetect attribute="Decimal" context="#stay" String="LUL" insensitive="TRUE"/>
+ <StringDetect attribute="Decimal" context="#stay" String="LLU" insensitive="TRUE"/>
+ <StringDetect attribute="Decimal" context="#stay" String="UL" insensitive="TRUE"/>
+ <StringDetect attribute="Decimal" context="#stay" String="LU" insensitive="TRUE"/>
+ <StringDetect attribute="Decimal" context="#stay" String="LL" insensitive="TRUE"/>
+ <StringDetect attribute="Decimal" context="#stay" String="U" insensitive="TRUE"/>
+ <StringDetect attribute="Decimal" context="#stay" String="L" insensitive="TRUE"/>
+ </Int>
+ <HlCChar attribute="Char" context="#stay"/>
+ <DetectChar attribute="String" context="String" char="&quot;"/>
+ <IncludeRules context="##Doxygen" />
+ <Detect2Chars attribute="Comment" context="Commentar 1" char="/" char1="/"/>
+ <Detect2Chars attribute="Comment" context="Commentar 2" char="/" char1="*"/>
+ <DetectChar attribute="Symbol" context="#stay" char="{" beginRegion="block1"/>
+ <DetectChar attribute="Symbol" context="#stay" char="}" endRegion="block1"/>
+ <RegExpr attribute="Decimal" context="#stay" String="#region.*$" beginRegion="Region1"/>
+ <RegExpr attribute="Decimal" context="#stay" String="#endregion.*$" endRegion="Region1"/>
+ <RegExpr attribute="Function" context="#stay" String="\b[_\w][_\w\d]*(?=[\s]*[(])" />
+ <RegExpr attribute="Symbol" context="Member" String="[.]{1,1}" />
+ <AnyChar attribute="Symbol" context="#stay" String=":!%&amp;()+,-/.*&lt;=&gt;?[]|~^&#59;"/>
+ </context>
+ <context attribute="String" lineEndContext="#pop" name="String">
+ <LineContinue attribute="String" context="#pop"/>
+ <HlCStringChar attribute="String Char" context="#stay"/>
+ <DetectChar attribute="String" context="#pop" char="&quot;"/>
+ </context>
+ <context attribute="Normal Text" lineEndContext="#pop" name="Member" fallthrough="true" fallthroughContext="#pop">
+ <RegExpr attribute="Function" context="#pop" String="\b[_\w][_\w\d]*(?=[\s]*)" />
+ </context>
+ <context attribute="Comment" lineEndContext="#pop" name="Commentar 1"/>
+ <context attribute="Comment" lineEndContext="#stay" name="Commentar 2">
+ <Detect2Chars attribute="Comment" context="#pop" char="*" char1="/"/>
+ </context>
+ </contexts>
+ <itemDatas>
+ <itemData name="Normal Text" defStyleNum="dsNormal"/>
+ <itemData name="Keyword" defStyleNum="dsKeyword"/>
+ <itemData name="Function" defStyleNum="dsFunction"/>
+ <itemData name="Data Type" defStyleNum="dsDataType"/>
+ <itemData name="Decimal" defStyleNum="dsDecVal"/>
+ <itemData name="Octal" defStyleNum="dsBaseN"/>
+ <itemData name="Hex" defStyleNum="dsBaseN"/>
+ <itemData name="Float" defStyleNum="dsFloat"/>
+ <itemData name="Char" defStyleNum="dsChar"/>
+ <itemData name="String" defStyleNum="dsString"/>
+ <itemData name="String Char" defStyleNum="dsChar"/>
+ <itemData name="Comment" defStyleNum="dsComment"/>
+ <itemData name="Symbol" defStyleNum="dsNormal"/>
+ </itemDatas>
+ </highlighting>
+ <general>
+ <comments>
+ <comment name="singleLine" start="//" />
+ <comment name="multiLine" start="/*" end="*/" />
+ </comments>
+ <keywords casesensitive="1" />
+ </general>
+</language>
diff --git a/kate/data/css.xml b/kate/data/css.xml
new file mode 100644
index 000000000..0e9188382
--- /dev/null
+++ b/kate/data/css.xml
@@ -0,0 +1,624 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+<language name="CSS" version="2.00" kateversion="2.4" section="Markup" extensions="*.css" mimetype="text/css" author="Wilbert Berendsen (wilbert@kde.nl)" license="LGPL">
+
+ <highlighting>
+ <list name="properties">
+ <!-- CSS2 -->
+ <item> azimuth </item>
+ <item> background </item>
+ <item> background-attachment </item>
+ <item> background-color </item>
+ <item> background-image </item>
+ <item> background-position </item>
+ <item> background-repeat </item>
+ <item> border </item>
+ <item> border-bottom </item>
+ <item> border-bottom-color </item>
+ <item> border-bottom-style </item>
+ <item> border-bottom-width </item>
+ <item> border-collapse </item>
+ <item> border-color </item>
+ <item> border-left </item>
+ <item> border-left-color </item>
+ <item> border-left-style </item>
+ <item> border-left-width </item>
+ <item> border-right </item>
+ <item> border-right-color </item>
+ <item> border-right-style </item>
+ <item> border-right-width </item>
+ <item> border-spacing </item>
+ <item> border-style </item>
+ <item> border-top </item>
+ <item> border-top-color </item>
+ <item> border-top-style </item>
+ <item> border-top-width </item>
+ <item> border-width </item>
+ <item> bottom </item>
+ <item> caption-side </item>
+ <item> clear </item>
+ <item> clip </item>
+ <item> color </item>
+ <item> content </item>
+ <item> counter-increment </item>
+ <item> counter-reset </item>
+ <item> cue </item>
+ <item> cue-after </item>
+ <item> cue-before </item>
+ <item> cursor </item>
+ <item> direction </item>
+ <item> display </item>
+ <item> elevation </item>
+ <item> empty-cells </item>
+ <item> float </item>
+ <item> font </item>
+ <item> font-family </item>
+ <item> font-size </item>
+ <item> font-size-adjust </item>
+ <item> font-stretch </item>
+ <item> font-style </item>
+ <item> font-variant </item>
+ <item> font-weight </item>
+ <item> height </item>
+ <item> left </item>
+ <item> letter-spacing </item>
+ <item> line-height </item>
+ <item> list-style </item>
+ <item> list-style-image </item>
+ <item> list-style-keyword </item>
+ <item> list-style-position </item>
+ <item> list-style-type </item>
+ <item> margin </item>
+ <item> margin-bottom </item>
+ <item> margin-left </item>
+ <item> margin-right </item>
+ <item> margin-top </item>
+ <item> marker-offset </item>
+ <item> max-height </item>
+ <item> max-width </item>
+ <item> min-height </item>
+ <item> min-width </item>
+ <item> orphans </item>
+ <item> outline </item>
+ <item> outline-color </item>
+ <item> outline-style </item>
+ <item> outline-width </item>
+ <item> overflow </item>
+ <item> padding </item>
+ <item> padding-bottom </item>
+ <item> padding-left </item>
+ <item> padding-right </item>
+ <item> padding-top </item>
+ <item> page </item>
+ <item> page-break-after </item>
+ <item> page-break-before </item>
+ <item> page-break-inside </item>
+ <item> pause </item>
+ <item> pause-after </item>
+ <item> pause-before </item>
+ <item> pitch </item>
+ <item> pitch-range </item>
+ <item> play-during </item>
+ <item> position </item>
+ <item> quotes </item>
+ <item> richness </item>
+ <item> right </item>
+ <item> size </item>
+ <item> speak </item>
+ <item> speak-header </item>
+ <item> speak-numeral </item>
+ <item> speak-punctuation </item>
+ <item> speech-rate </item>
+ <item> stress </item>
+ <item> table-layout </item>
+ <item> text-align </item>
+ <item> text-decoration </item>
+ <item> text-decoration-color </item>
+ <item> text-indent </item>
+ <item> text-shadow </item>
+ <item> text-transform </item>
+ <item> top </item>
+ <item> unicode-bidi </item>
+ <item> vertical-align </item>
+ <item> visibility </item>
+ <item> voice-family </item>
+ <item> volume </item>
+ <item> white-space </item>
+ <item> widows </item>
+ <item> width </item>
+ <item> word-spacing </item>
+ <item> z-index </item>
+
+ <!-- CSS3 -->
+ <item> box-sizing </item>
+ <item> opacity </item>
+ <item> text-shadow </item>
+
+ <!-- konq specific -->
+ <item> konq_bgpos_x </item>
+ <item> konq_bgpos_y </item>
+
+ <!-- font properties in @font-face -->
+ <item> font-family </item>
+ <item> font-size </item>
+ <item> font-stretch </item>
+ <item> font-style </item>
+ <item> font-variant </item>
+ <item> font-weight </item>
+ <item> unicode-range </item>
+ <item> units-per-em </item>
+ <item> src </item>
+ <item> panose-1 </item>
+ <item> stemv </item>
+ <item> stemh </item>
+ <item> slope </item>
+ <item> cap-height </item>
+ <item> x-height </item>
+ <item> ascent </item>
+ <item> descent </item>
+ <item> widths </item>
+ <item> bbox </item>
+ <item> definition-src </item>
+ <item> baseline </item>
+ <item> centerline </item>
+ <item> mathline </item>
+ <item> topline </item>
+ </list>
+
+ <list name="types">
+ <item> inherit </item>
+ <item> none </item>
+ <item> hidden </item>
+ <item> dotted </item>
+ <item> dashed </item>
+ <item> solid </item>
+ <item> double </item>
+ <item> groove </item>
+ <item> ridge </item>
+ <item> inset </item>
+ <item> outset </item>
+ <item> xx-small </item>
+ <item> x-small </item>
+ <item> small </item>
+ <item> medium </item>
+ <item> large </item>
+ <item> x-large </item>
+ <item> xx-large </item>
+ <item> smaller </item>
+ <item> larger </item>
+ <item> italic </item>
+ <item> oblique </item>
+ <item> small-caps </item>
+ <item> normal </item>
+ <item> bold </item>
+ <item> bolder </item>
+ <item> lighter </item>
+ <item> light </item>
+ <item> 100 </item>
+ <item> 200 </item>
+ <item> 300 </item>
+ <item> 400 </item>
+ <item> 500 </item>
+ <item> 600 </item>
+ <item> 700 </item>
+ <item> 800 </item>
+ <item> 900 </item>
+ <item> transparent </item>
+ <item> repeat </item>
+ <item> repeat-x </item>
+ <item> repeat-y </item>
+ <item> no-repeat </item>
+ <item> baseline </item>
+ <item> sub </item>
+ <item> super </item>
+ <item> top </item>
+ <item> text-top </item>
+ <item> middle </item>
+ <item> bottom </item>
+ <item> text-bottom </item>
+ <item> left </item>
+ <item> right </item>
+ <item> center </item>
+ <item> justify </item>
+ <item> konq-center </item>
+ <item> disc </item>
+ <item> circle </item>
+ <item> square </item>
+ <item> box </item>
+ <item> decimal </item>
+ <item> decimal-leading-zero </item>
+ <item> lower-roman </item>
+ <item> upper-roman </item>
+ <item> lower-greek </item>
+ <item> lower-alpha </item>
+ <item> lower-latin </item>
+ <item> upper-alpha </item>
+ <item> upper-latin </item>
+ <item> hebrew </item>
+ <item> armenian </item>
+ <item> georgian </item>
+ <item> cjk-ideographic </item>
+ <item> hiragana </item>
+ <item> katakana </item>
+ <item> hiragana-iroha </item>
+ <item> katakana-iroha </item>
+ <item> inline </item>
+ <item> inline-block </item>
+ <item> block </item>
+ <item> list-item </item>
+ <item> run-in </item>
+ <item> compact </item>
+ <item> marker </item>
+ <item> table </item>
+ <item> inline-table </item>
+ <item> table-row-group </item>
+ <item> table-header-group </item>
+ <item> table-footer-group </item>
+ <item> table-row </item>
+ <item> table-column-group </item>
+ <item> table-column </item>
+ <item> table-cell </item>
+ <item> table-caption </item>
+ <item> auto </item>
+ <item> crosshair </item>
+ <item> default </item>
+ <item> pointer </item>
+ <item> move </item>
+ <item> e-resize </item>
+ <item> ne-resize </item>
+ <item> nw-resize </item>
+ <item> n-resize </item>
+ <item> se-resize </item>
+ <item> sw-resize </item>
+ <item> s-resize </item>
+ <item> w-resize </item>
+ <item> text </item>
+ <item> wait </item>
+ <item> help </item>
+ <item> above </item>
+ <item> absolute </item>
+ <item> always </item>
+ <item> avoid </item>
+ <item> below </item>
+ <item> bidi-override </item>
+ <item> blink </item>
+ <item> both </item>
+ <item> capitalize </item>
+ <item> caption </item>
+ <item> close-quote </item>
+ <item> collapse </item>
+ <item> condensed </item>
+ <item> crop </item>
+ <item> cross </item>
+ <item> embed </item>
+ <item> expanded </item>
+ <item> extra-condensed </item>
+ <item> extra-expanded </item>
+ <item> fixed </item>
+ <item> hand </item>
+ <item> hide </item>
+ <item> higher </item>
+ <item> icon </item>
+ <item> inside </item>
+ <item> invert </item>
+ <item> landscape </item>
+ <item> level </item>
+ <item> line-through </item>
+ <item> loud </item>
+ <item> lower </item>
+ <item> lowercase </item>
+ <item> ltr </item>
+ <item> menu </item>
+ <item> message-box </item>
+ <item> mix </item>
+ <item> narrower </item>
+ <item> no-close-quote </item>
+ <item> no-open-quote </item>
+ <item> nowrap </item>
+ <item> open-quote </item>
+ <item> outside </item>
+ <item> overline </item>
+ <item> portrait </item>
+ <item> pre </item>
+ <item> pre-line </item>
+ <item> pre-wrap </item>
+ <item> relative </item>
+ <item> rtl </item>
+ <item> scroll </item>
+ <item> semi-condensed </item>
+ <item> semi-expanded </item>
+ <item> separate </item>
+ <item> show </item>
+ <item> small-caption </item>
+ <item> static </item>
+ <item> static-position </item>
+ <item> status-bar </item>
+ <item> thick </item>
+ <item> thin </item>
+ <item> ultra-condensed </item>
+ <item> ultra-expanded </item>
+ <item> underline </item>
+ <item> uppercase </item>
+ <item> visible </item>
+ <item> wider </item>
+ <item> break </item>
+ <item> serif </item>
+ <item> sans-serif </item>
+ <item> cursive </item>
+ <item> fantasy </item>
+ <item> monospace </item>
+ <item> border-box </item>
+ <item> content-box </item>
+ </list>
+
+
+ <list name="colors">
+ <item> aqua </item>
+ <item> black </item>
+ <item> blue </item>
+ <item> fuchsia </item>
+ <item> gray </item>
+ <item> green </item>
+ <item> lime </item>
+ <item> maroon </item>
+ <item> navy </item>
+ <item> olive </item>
+ <item> purple </item>
+ <item> red </item>
+ <item> silver </item>
+ <item> teal </item>
+ <item> white </item>
+ <item> yellow </item>
+ <item> ActiveBorder </item>
+ <item> ActiveCaption </item>
+ <item> AppWorkspace </item>
+ <item> Background </item>
+ <item> ButtonFace </item>
+ <item> ButtonHighlight </item>
+ <item> ButtonShadow </item>
+ <item> ButtonText </item>
+ <item> CaptionText </item>
+ <item> GrayText </item>
+ <item> Highlight </item>
+ <item> HighlightText </item>
+ <item> InactiveBorder </item>
+ <item> InactiveCaption </item>
+ <item> InactiveCaptionText </item>
+ <item> InfoBackground </item>
+ <item> InfoText </item>
+ <item> Menu </item>
+ <item> MenuText </item>
+ <item> Scrollbar </item>
+ <item> ThreeDDarkShadow </item>
+ <item> ThreeDFace </item>
+ <item> ThreeDHighlight </item>
+ <item> ThreeDLightShadow </item>
+ <item> ThreeDShadow </item>
+ <item> Window </item>
+ <item> WindowFrame </item>
+ <item> WindowText </item>
+ </list>
+
+ <list name="paren">
+ <item> url </item>
+ <item> attr </item>
+ <item> rect </item>
+ <item> rgb </item>
+ <item> counter </item>
+ <item> counters </item>
+
+ <!-- in @font-face -->
+ <item> local </item>
+ <item> format </item>
+ </list>
+
+ <list name="mediatypes">
+ <item> all </item>
+ <item> aural </item>
+ <item> braille </item>
+ <item> embossed </item>
+ <item> handheld </item>
+ <item> print </item>
+ <item> projection </item>
+ <item> screen </item>
+ <item> tty </item>
+ <item> tv </item>
+ </list>
+
+ <list name="pseudoclasses">
+ <item> hover </item>
+ <item> link </item>
+ <item> visited </item>
+ <item> active </item>
+ <item> focus </item>
+ <item> first-child </item>
+ <item> last-child </item>
+ <item> only-child </item>
+ <item> first-of-type </item>
+ <item> last-of-type </item>
+ <item> only-of-type </item>
+ <item> first-letter </item>
+ <item> first-line </item>
+ <item> before </item>
+ <item> after </item>
+ <item> selection </item>
+ <item> root </item>
+ <item> empty </item>
+ <item> target </item>
+ <item> enabled </item>
+ <item> disabled </item>
+ <item> checked </item>
+ <item> indeterminate </item>
+ <item> nth-child </item>
+ <item> nth-last-child </item>
+ <item> nth-of-type </item>
+ <item> nth-last-of-type </item>
+ <item> not </item>
+ </list>
+
+ <contexts>
+ <context attribute="Normal Text" lineEndContext="#stay" name="Base">
+ <LineContinue/>
+ <DetectSpaces/>
+ <IncludeRules context="FindRuleSets" />
+ </context>
+
+ <!-- to be included -->
+ <!-- finds rules and detects nesting -->
+ <context attribute="Normal Text" lineEndContext="#stay" name="FindRuleSets">
+ <RegExpr attribute="Media" context="Media" String="@media\b" />
+ <RegExpr attribute="At Rule" context="Import" String="@import\b" />
+ <RegExpr attribute="At Rule" context="#stay" String="@(font-face|charset)\b" />
+ <DetectChar attribute="Property" context="RuleSet" char="{" beginRegion="ruleset" />
+ <!--parse selectors-->
+ <DetectChar attribute="Selector Attr" context="SelAttr" char="[" />
+ <RegExpr attribute="Selector Id" context="#stay" String="#[A-Za-z0-9][\w\-]*" />
+ <RegExpr attribute="Selector Class" context="#stay" String="\.[A-Za-z0-9][\w\-]*" />
+ <RegExpr attribute="Selector Pseudo" context="#stay" String=":lang\([\w_-]+\)" />
+ <DetectChar attribute="Selector Pseudo" context="SelPseudo" char=":" />
+ <IncludeRules context="FindStrings" />
+ <IncludeRules context="FindComments" />
+ </context>
+
+ <!-- finds arguments to properties -->
+ <context attribute="Normal Text" lineEndContext="#stay" name="FindValues">
+ <RegExpr attribute="Value" context="#stay" String="[-+]?[0-9.]+(em|ex|px|in|cm|mm|pt|pc|deg|rad|grad|ms|s|Hz|kHz)\b" />
+ <RegExpr attribute="Value" context="#stay" String="[-+]?[0-9.]+[%]?" />
+ <RegExpr attribute="Normal Text" context="#stay" String="[\w\-]+" />
+ </context>
+
+ <!-- finds strings -->
+ <context attribute="Normal Text" lineEndContext="#stay" name="FindStrings">
+ <DetectChar attribute="String" context="StringDQ" char="&quot;" />
+ <DetectChar attribute="String" context="StringSQ" char="'" />
+ </context>
+
+ <!-- finds comments -->
+ <context attribute="Normal Text" lineEndContext="#stay" name="FindComments">
+ <RegExpr attribute="Region Marker" context="#stay" String="/\*BEGIN.*\*/" beginRegion="UserDefined" />
+ <RegExpr attribute="Region Marker" context="#stay" String="/\*END.*\*/" endRegion="UserDefined" />
+ <Detect2Chars attribute="Comment" context="Comment" char="/" char1="*" beginRegion="comment" />
+ </context>
+
+ <!-- other contexts -->
+ <context attribute="Normal Text" lineEndContext="#stay" name="Media">
+ <DetectChar attribute="Media" context="Media2" char="{" beginRegion="media" />
+ <keyword attribute="Media" context="#stay" String="mediatypes" />
+ <DetectChar attribute="Media" context="#stay" char="," />
+ <IncludeRules context="FindComments" />
+ <RegExpr attribute="Error" context="#stay" String="\S+" />
+ </context>
+
+ <context attribute="Normal Text" lineEndContext="#stay" name="Media2">
+ <DetectChar attribute="Media" context="#pop#pop" char="}" endRegion="media" />
+ <IncludeRules context="FindRuleSets" />
+ </context>
+
+ <context attribute="Selector Attr" lineEndContext="#stay" name="SelAttr">
+ <DetectChar attribute="Selector Attr" context="#pop" char="]" />
+ <IncludeRules context="FindStrings" />
+ </context>
+
+ <context attribute="Selector Pseudo" lineEndContext="#pop" name="SelPseudo"
+ fallthrough="true" fallthroughContext="#pop">
+ <keyword attribute="Selector Pseudo" context="#pop" String="pseudoclasses" />
+ </context>
+
+ <context attribute="Normal Text" lineEndContext="#stay" name="Import">
+ <DetectChar attribute="At Rule" context="#pop" char=";" />
+ <keyword attribute="Media" context="#stay" String="mediatypes" />
+ <IncludeRules context="FindValues" />
+ <IncludeRules context="FindStrings" />
+ <IncludeRules context="FindComments" />
+ </context>
+
+ <context attribute="Comment" lineEndContext="#stay" name="Comment">
+ <DetectSpaces/>
+ <Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" endRegion="comment" />
+ <IncludeRules context="##Alerts" />
+ <DetectIdentifier/>
+ </context>
+
+ <context attribute="Normal Text" lineEndContext="#stay" name="RuleSet">
+ <DetectChar attribute="Property" context="#pop" char="}" endRegion="ruleset" />
+ <keyword attribute="Property" context="Rule" String="properties" />
+ <RegExpr attribute="Unknown Property" context="Rule" String="-?[A-Za-z_-]+(?=\s*:)" />
+ <IncludeRules context="FindComments" />
+ <RegExpr attribute="Error" context="#stay" String="\S" />
+ </context>
+
+ <context attribute="Normal Text" lineEndContext="#stay" name="Rule">
+ <DetectChar attribute="Property" context="Rule2" char=":" />
+ <RegExpr attribute="Error" context="#stay" String="\S" />
+ </context>
+
+ <context attribute="Normal Text" lineEndContext="#stay" name="Rule2">
+ <DetectChar attribute="Property" context="#pop#pop" char=";" />
+ <DetectChar attribute="Property" context="#pop#pop#pop" char="}" endRegion="ruleset" />
+ <!-- parse property values -->
+ <keyword attribute="Value" context="#stay" String="types" />
+ <keyword attribute="Value" context="#stay" String="colors" />
+ <RegExpr attribute="Value" context="#stay" String="#([0-9A-Fa-f]{3}){1,4}\b" />
+ <keyword attribute="Value" context="PropParen" String="paren" />
+ <RegExpr attribute="Important" context="#stay" String="!important\b" />
+ <IncludeRules context="FindValues" />
+ <IncludeRules context="FindStrings" />
+ <IncludeRules context="FindComments" />
+ </context>
+
+ <context attribute="Normal Text" lineEndContext="#stay" name="PropParen">
+ <DetectChar attribute="Value" context="PropParen2" char="(" />
+ <IncludeRules context="FindComments" />
+ <RegExpr attribute="Error" context="#stay" String="\S" />
+ </context>
+
+ <context attribute="Normal Text" lineEndContext="#stay" name="PropParen2">
+ <DetectChar attribute="Value" context="#pop#pop" char=")" />
+ <IncludeRules context="FindValues" />
+ <IncludeRules context="FindStrings" />
+ <IncludeRules context="FindComments" />
+ </context>
+
+ <!-- string contexts -->
+ <context attribute="String" lineEndContext="#stay" name="StringDQ">
+ <DetectChar attribute="String" context="#pop" char="&quot;" />
+ <IncludeRules context="InsideString" />
+ </context>
+
+ <context attribute="String" lineEndContext="#stay" name="StringSQ">
+ <DetectChar attribute="String" context="#pop" char="'" />
+ <IncludeRules context="InsideString" />
+ </context>
+
+ <context attribute="String" lineEndContext="#stay" name="InsideString">
+ <RegExpr attribute="String" context="#stay" String="\\[&quot;']" />
+ <DetectIdentifier/>
+ </context>
+
+ </contexts>
+ <itemDatas>
+ <itemData name="Normal Text" defStyleNum="dsNormal"/>
+ <itemData name="Property" defStyleNum="dsKeyword"/>
+ <itemData name="Unknown Property" defStyleNum="dsKeyword" italic="1"/>
+ <itemData name="Media" defStyleNum="dsDecVal" bold="1"/>
+ <itemData name="At Rule" defStyleNum="dsDecVal" />
+ <itemData name="String" defStyleNum="dsString" />
+ <itemData name="Value" defStyleNum="dsDataType" />
+ <itemData name="Important" defStyleNum="dsKeyword" />
+ <itemData name="Selector Attr" defStyleNum="dsChar" />
+ <itemData name="Selector Id" defStyleNum="dsFloat" bold="1"/>
+ <itemData name="Selector Class" defStyleNum="dsFloat" />
+ <itemData name="Selector Pseudo" defStyleNum="dsDecVal" />
+ <itemData name="Comment" defStyleNum="dsComment" />
+ <itemData name="Region Marker" defStyleNum="dsRegionMarker"/>
+ <itemData name="Alert" defStyleNum="dsAlert"/>
+ <itemData name="Error" defStyleNum="dsError"/>
+ </itemDatas>
+ </highlighting>
+ <general>
+ <keywords casesensitive="0" weakDeliminator="-%"/>
+ <comments>
+ <comment name="multiLine" start="/*" end="*/" />
+ </comments>
+ </general>
+</language>
diff --git a/kate/data/cue.xml b/kate/data/cue.xml
new file mode 100644
index 000000000..6044aae7b
--- /dev/null
+++ b/kate/data/cue.xml
@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+<language name="CUE Sheet" version="0.91" kateversion="2.1" section="Other" extensions="*.cue" mimetype="application/x-cue">
+ <highlighting>
+ <list name="keywords">
+ <item> CATALOG </item>
+ <item> CDTEXTFILE </item>
+ <item> FILE </item>
+ <item> FLAGS </item>
+ <item> INDEX </item>
+ <item> ISRC </item>
+ <item> PERFORMER </item>
+ <item> PREGAP </item>
+ <item> POSTGAP </item>
+ <item> REM </item>
+ <item> SONGWRITER </item>
+ <item> TITLE </item>
+ <item> TRACK </item>
+ </list>
+ <list name="format">
+ <item> AIFF </item>
+ <item> WAVE </item>
+ <item> MP3 </item>
+ <item> BINARY </item>
+ <item> MOTOTOLA </item>
+ </list>
+ <list name="mode">
+ <item> AUDIO </item>
+ <item> CDG </item>
+ <item> CDI </item>
+ <item> MODE1 </item>
+ <item> MODE2 </item>
+ <item> RAW </item>
+ </list>
+ <list name="flags">
+ <item> 4CH </item>
+ <item> DCP </item>
+ <item> PRE </item>
+ <item> SCMS </item>
+ </list>
+ <contexts>
+ <context attribute="Normal Text" lineEndContext="#stay" name="Normal">
+ <keyword attribute="Keyword" context="#stay" String="keywords" />
+ <keyword attribute="Format" context="#stay" String="format" />
+ <keyword attribute="Mode" context="#stay" String="mode" />
+ <keyword attribute="Flags" context="#stay" String="flags" />
+ <Int attribute="Decimal" context="#stay" />
+ <DetectChar attribute="String" context="String" char="&quot;"/>
+ <DetectChar attribute="Comment" context="Comment" char=";"/>
+ </context>
+ <context attribute="String" lineEndContext="#pop" name="String">
+ <LineContinue attribute="String" context="#stay"/>
+ <DetectChar attribute="String" context="#pop" char="&quot;"/>
+ </context>
+ <context attribute="Comment" lineEndContext="#pop" name="Comment" />
+ </contexts>
+ <itemDatas>
+ <itemData name="Normal Text" defStyleNum="dsNormal"/>
+ <itemData name="Keyword" defStyleNum="dsKeyword"/>
+ <itemData name="Format" defStyleNum="dsNormal" color="#800000"/>
+ <itemData name="Mode" defStyleNum="dsNormal" color="#000080"/>
+ <itemData name="Flags" defStyleNum="dsNormal" color="#008000"/>
+ <itemData name="Decimal" defStyleNum="dsDecVal"/>
+ <itemData name="String" defStyleNum="dsString"/>
+ <itemData name="Comment" defStyleNum="dsComment"/>
+ </itemDatas>
+ </highlighting>
+ <general>
+ <comments>
+ <comment name="singleLine" start=";" />
+ </comments>
+ <keywords casesensitive="0" />
+ </general>
+</language>
diff --git a/kate/data/d.xml b/kate/data/d.xml
new file mode 100644
index 000000000..e53a3174c
--- /dev/null
+++ b/kate/data/d.xml
@@ -0,0 +1,348 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+<!--
+ ========================================================================
+
+ D.XML supports syntax highlighting for the D programming language under Kate.
+
+ Copyright (C) 2004 - Simon J Mackenzie <project.katedxml@smackoz.fastmail.fm>
+ This code is released under the LGPL as part of kdelibs/kate.
+
+ ========================================================================
+
+ D is a next generation language written by Walter Bright of Digital Mars fame.
+ Digital Mars C, C++ and D Compilers can be obtained from http://www.digitalmars.com/
+
+ ========================================================================
+
+ Updates for D.XML can be obtained from http://kate.kde.org/hl/
+
+ UPDATE HISTORY:-
+ 2004.08.15 - D.XML 1.36 - D 0.98 - Current release of D.
+ - package, writef(strictly speaking writyef isn't a keyword) - keywords are now supported.
+ 2004.??.?? - D.XML 1.35 - D 0.?? - Not sure how this release got posted!
+ 2004.05.23 - D.XML 1.34 - D 0.90 - updated.
+ 2004.05.19 - D.XML 1.33 - D 0.89 - mixin - keyword is now supported.
+ 2004.05.19 - D.XML 1.32 - D 0.77 - pragma, typeof - keywords are now supported.
+ 2004.05.19 - D.XML 1.31 - D 0.76 - is - keyword is now supported.
+ 2003.09.06 - D.XML 1.30 - D 0.71 - foreach - keyword is now supported.
+ 2003.08.18 - D.XML 1.20 - D 0.69 - floats are now supported.
+ - embedded underscores in integer and float literals are now supported.
+ 2003.08.11 - D.XML 1.10 - updated.
+ 2003.07.18 - D.XML 1.00 - First released.
+
+ TODO:-
+ - Kate string translation cannot handle \" as a literal within a D string. The " will be interpreted as an end of string marker
+ when it should be ignored because of the preceding back-slash.
+
+ ========================================================================
+-->
+
+<language name="D" section="Sources" extensions="*.d;*.D" mimetype="text/x-dsrc" version="1.36" kateversion="2.2" casesensitive="true" author="Simon J Mackenzie (project.katedxml@smackoz.fastmail.fm)" license="LGPL">
+ <highlighting>
+ <list name="keywords">
+ <item> abstract </item>
+ <item> alias </item>
+ <item> align </item>
+ <item> asm </item>
+ <item> auto </item>
+
+ <item> body </item>
+ <item> break </item>
+
+ <item> case </item>
+ <item> cast </item>
+ <item> catch </item>
+ <item> class </item>
+ <item> const </item>
+ <item> continue </item>
+
+ <item> default </item>
+ <item> delegate </item>
+ <item> delete </item>
+ <item> deprecated </item>
+ <item> do </item>
+
+ <item> else </item>
+ <item> enum </item>
+ <item> export </item>
+
+ <item> false </item>
+ <item> final </item>
+ <item> finally </item>
+ <item> for </item>
+ <item> foreach </item>
+ <item> function </item>
+
+ <item> goto </item>
+
+ <item> if </item>
+ <item> in </item>
+ <item> inout </item>
+ <item> interface </item>
+ <item> invariant </item>
+ <item> is </item>
+
+ <item> mixin </item>
+
+ <item> new </item>
+ <item> null </item>
+
+ <item> out </item>
+ <item> override </item>
+
+ <item> package </item>
+ <item> private </item>
+ <item> protected </item>
+ <item> public </item>
+
+ <item> return </item>
+
+ <item> static </item>
+ <item> struct </item>
+ <item> super </item>
+ <item> switch </item>
+ <item> synchronized </item>
+
+ <item> template </item>
+ <item> this </item>
+ <item> throw </item>
+ <item> true </item>
+ <item> try </item>
+ <item> typedef </item>
+ <item> typeof </item>
+
+ <item> union </item>
+
+ <item> volatile </item>
+
+ <item> while </item>
+ <item> with </item>
+ </list>
+ <list name="modules">
+ <item> module </item>
+ <item> import </item>
+ </list>
+ <list name="types">
+ <item> void </item>
+ <item> bit </item>
+ <item> byte </item>
+ <item> ubyte </item>
+ <item> short </item>
+ <item> ushort </item>
+ <item> int </item>
+ <item> uint </item>
+ <item> long </item>
+ <item> ulong </item>
+ <item> cent </item>
+ <item> ucent </item>
+ <item> float </item>
+ <item> double </item>
+ <item> real </item>
+ <item> ireal </item>
+ <item> ifloat </item>
+ <item> idouble </item>
+ <item> creal </item>
+ <item> cfloat </item>
+ <item> cdouble </item>
+ <item> char </item>
+ <item> wchar </item>
+ <item> dchar </item>
+ </list>
+ <list name="phobos">
+ <item> printf </item>
+ <item> writef </item>
+ </list>
+
+ <list name="linkage">
+ <item> extern </item>
+ </list>
+ <list name="ltypes">
+ <item> C </item>
+ <item> D </item>
+ <item> Windows </item>
+ <item> Pascal </item>
+ </list>
+
+ <list name="debug">
+ <item> debug </item>
+ </list>
+ <list name="assert">
+ <item> assert </item>
+ </list>
+
+ <list name="pragma">
+ <item> pragma </item>
+ </list>
+ <list name="ptypes">
+ <item> msg </item>
+ </list>
+
+ <list name="version">
+ <item> version </item>
+ </list>
+ <list name="vtypes">
+ <item> DigitalMars </item>
+ <item> X86 </item>
+ <item> AMD64 </item>
+ <item> Windows </item>
+ <item> Win32 </item>
+ <item> Win64 </item>
+ <item> linux </item>
+ <item> LittleEndian </item>
+ <item> BigEndian </item>
+ <item> D_InlineAsm </item>
+ <item> none </item>
+ </list>
+
+ <list name="unittest">
+ <item> unittest </item>
+ </list>
+
+ <contexts>
+ <context attribute="Normal Text" lineEndContext="#stay" name="normal">
+ <keyword attribute="Keyword" context="#stay" String="keywords"/>
+ <keyword attribute="Module" context="ModuleName" String="modules"/>
+ <keyword attribute="Type" context="#stay" String="types"/>
+ <keyword attribute="Phobos Library" context="#stay" String="phobos"/>
+ <keyword attribute="Linkage" context="Linkage" String="linkage"/>
+ <keyword attribute="Debug" context="#stay" String="debug"/>
+ <keyword attribute="Assert" context="#stay" String="assert"/>
+ <keyword attribute="Pragma" context="Pragmas" String="pragma"/>
+ <keyword attribute="Version" context="Version" String="version"/>
+ <keyword attribute="Unit Test" context="#stay" String="unittest"/>
+
+ <Detect2Chars attribute="Wysiwyg" context="Wysiwyg" char="r" char1="&quot;"/>
+ <Detect2Chars attribute="Hex" context="Hex" char="x" char1="&quot;"/>
+
+ <RegExpr attribute="Normal Text" context="#pop" String="[_a-z][\w]*" insensitive="true"/>
+
+ <RegExpr attribute="Pragma" context="#pop" String="\#[ ]*line"/>
+
+ <RegExpr attribute="Escape String" context="#pop" String="\\[n|t|&quot;]"/>
+ <RegExpr attribute="Escape String" context="#pop" String="(\\r\\n)"/>
+ <RegExpr attribute="Escape String" context="#pop" String="\\0[0-7]+"/>
+ <RegExpr attribute="Escape String" context="#pop" String="\\u[\d]+" insensitive="true"/>
+ <RegExpr attribute="Escape String" context="#pop" String="\\x[\da-fA-F]+"/>
+
+ <RegExpr attribute="Binary" context="#pop" String="0b[01]+[_01]*[ ]*\.\.[ ]*0b[01]+[_01]*(UL|LU|U|L)?" insensitive="true"/>
+ <RegExpr attribute="Octal" context="#pop" String="0[0-7]+[_0-7]*[ ]*\.\.[ ]*0[0-7]+[_0-7]*(UL|LU|U|L)?" insensitive="true"/>
+ <RegExpr attribute="Hex" context="#pop" String="0x[\da-f]+[_\da-f]*[ ]*\.\.[ ]*0x[\da-f]+[_\da-f]*(UL|LU|U|L)?" insensitive="true"/>
+ <RegExpr attribute="Integer" context="#pop" String="[\d]+[_\d]*(UL|LU|U|L)?[ ]*\.\.[ ]*[\d]+[_\d]*(UL|LU|U|L)?" insensitive="true"/>
+
+ <RegExpr attribute="Float" context="#pop" String="[\d]*[_\d]*\.[_\d]*(e-|e|e\+)?[\d]+[_\d]*(F|L|I|FI|LI|)?" insensitive="true"/>
+ <RegExpr attribute="Float" context="#pop" String="[\d]*[_\d]*\.?[_\d]*(e-|e|e\+)[\d]+[_\d]*(F|L|I|FI|LI|)?" insensitive="true"/>
+ <RegExpr attribute="Float" context="#pop" String="0x[\da-f]+[_\da-f]*\.[_\da-f]*(p-|p|p\+)?[\da-f]+[_\da-f]*(F|L|I|FI|LI)?" insensitive="true"/>
+ <RegExpr attribute="Float" context="#pop" String="0x[\da-f]+[_\da-f]*\.?[_\da-f]*(p-|p|p\+)[\da-f]+[_\da-f]*(F|L|I|FI|LI)?" insensitive="true"/>
+
+ <RegExpr attribute="Binary" context="#pop" String="0B[01]+[_01]*(UL|LU|U|L)?" insensitive="true"/>
+ <RegExpr attribute="Octal" context="#pop" String="0[0-7]+[_0-7]*(UL|LU|U|L)?" insensitive="true"/>
+ <RegExpr attribute="Hex" context="#pop" String="0x[\da-f]+[_\da-f]*(UL|LU|U|L)?" insensitive="true"/>
+ <RegExpr attribute="Integer" context="#pop" String="[\d]+[_\d]*(UL|LU|U|L)?" insensitive="true"/>
+
+ <DetectChar attribute="Char" context="Char" char="'"/>
+ <DetectChar attribute="String" context="String" char="&quot;"/>
+ <DetectChar attribute="Wysiwyg" context="Wysiwyg" char="`"/>
+
+ <Detect2Chars attribute="Comment" context="CommentLine" char="/" char1="/"/>
+ <Detect2Chars attribute="Comment" context="CommentBlockA" char="/" char1="*" beginRegion="CommentA"/>
+ <Detect2Chars attribute="Comment" context="CommentBlockB" char="/" char1="+" beginRegion="CommentB"/>
+
+ <DetectChar attribute="Normal Text" context="#stay" char="{" beginRegion="BraceA" />
+ <DetectChar attribute="Normal Text" context="#stay" char="}" endRegion="BraceA" />
+ </context>
+
+ <context attribute="Module Name" lineEndContext="#stay" name="ModuleName">
+ <DetectChar attribute="Normal Text" context="#stay" char=","/>
+ <DetectChar attribute="Normal Text" context="#pop" char=";"/>
+ <Detect2Chars attribute="Comment" context="CommentLine" char="/" char1="/"/>
+ <Detect2Chars attribute="Comment" context="CommentBlockA" char="/" char1="*" beginRegion="CommentA"/>
+ <Detect2Chars attribute="Comment" context="CommentBlockB" char="/" char1="+" beginRegion="CommentB"/>
+ </context>
+
+ <context attribute="Linkage" lineEndContext="#pop" name="Linkage">
+ <keyword attribute="Type" context="#pop" String="types"/>
+ <DetectChar attribute="Normal Text" context="#stay" char="("/>
+ <keyword attribute="Linkage Type" context="#stay" String="ltypes"/>
+ <DetectChar attribute="Normal Text" context="#pop" char=")"/>
+ <DetectChar attribute="Normal Text" context="#pop" char=";"/>
+ </context>
+ <context attribute="Version" lineEndContext="#pop" name="Version">
+ <DetectChar attribute="Normal Text" context="#pop" char="="/>
+ <DetectChar attribute="Normal Text" context="#stay" char="("/>
+ <keyword attribute="Version Type" context="#stay" String="vtypes"/>
+ <RegExpr attribute="Normal Text" context="#pop" String="\w" insensitive="true"/>
+ <DetectChar attribute="Normal Text" context="#pop" char=")"/>
+ </context>
+ <context attribute="Pragma" lineEndContext="#pop" name="Pragmas">
+ <DetectChar attribute="Normal Text" context="#stay" char="("/>
+ <keyword attribute="Version Type" context="#stay" String="ptypes"/>
+ <keyword attribute="Version Type" context="#stay" String="vtypes"/>
+ <RegExpr attribute="Keyword" context="#pop" String="[_a-z][\w]*" insensitive="true"/>
+ <DetectChar attribute="Normal Text" context="#pop" char=","/>
+ <DetectChar attribute="Normal Text" context="#pop" char=")"/>
+ </context>
+
+ <context attribute="Wysiwyg" lineEndContext="#stay" name="Wysiwyg">
+ <DetectChar attribute="Wysiwyg" context="#pop" char="&quot;"/>
+ <DetectChar attribute="Wysiwyg" context="#pop" char="`"/>
+ </context>
+ <context attribute="Hex" lineEndContext="#stay" name="Hex">
+ <DetectChar attribute="Hex" context="#pop" char="&quot;"/>
+ </context>
+ <context attribute="Char" lineEndContext="#stay" name="Char">
+ <Detect2Chars attribute="Char" context="#stay" char="\" char1="'"/>
+ <Detect2Chars attribute="Char" context="#stay" char="\" char1="\"/>
+ <DetectChar attribute="Char" context="#pop" char="'"/>
+ </context>
+ <context attribute="String" lineEndContext="#stay" name="String">
+ <DetectChar attribute="String" context="#pop" char="&quot;"/>
+ </context>
+
+ <context attribute="Comment" lineEndContext="#pop" name="CommentLine">
+ </context>
+ <context attribute="Comment" lineEndContext="#stay" name="CommentBlockA">
+ <Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" endRegion="CommentA"/>
+ </context>
+ <context attribute="Comment" lineEndContext="#stay" name="CommentBlockB">
+ <Detect2Chars attribute="Comment" context="#pop" char="+" char1="/" endRegion="CommentB"/>
+ </context>
+ </contexts>
+ <itemDatas>
+ <itemData name="Normal Text" defStyleNum="dsNormal"/>
+ <itemData name="Keyword" defStyleNum="dsKeyword" color="#000000" selColor="#ffffff" bold="1" italic="0"/>
+ <itemData name="Module" defStyleNum="dsKeyword" color="#0000ff" selColor="#ffffff" bold="0" italic="0"/>
+ <itemData name="Module Name" defStyleNum="dsKeyword" color="#0000ff" selColor="#ffffff" bold="1" italic="1"/>
+ <itemData name="Type" defStyleNum="dsDataType"/>
+ <itemData name="Phobos Library" defStyleNum="dsKeyword" color="#000000" selColor="#ffffff" bold="1" italic="1"/>
+ <itemData name="Linkage" defStyleNum="dsKeyword" color="#ff0000" selColor="#ffffff" bold="0" italic="0"/>
+ <itemData name="Linkage Type" defStyleNum="dsDataType" color="#ff0000" selColor="#ffffff" bold="1" italic="1"/>
+ <itemData name="Debug" defStyleNum="dsKeyword" color="#ff00ff" selColor="#ffffff" bold="0" italic="0"/>
+ <itemData name="Assert" defStyleNum="dsKeyword" color="#0000ff" selColor="#ffffff" bold="0" italic="0"/>
+ <itemData name="Version" defStyleNum="dsKeyword" color="#ff0000" selColor="#ffffff" bold="0" italic="0"/>
+ <itemData name="Version Type" defStyleNum="dsDataType" color="#ff0000" selColor="#ffffff" bold="1" italic="1"/>
+ <itemData name="Unit Test" defStyleNum="dsKeyword" color="#ff00ff" selColor="#ffffff" bold="1" italic="0"/>
+ <itemData name="Pragma" defStyleNum="dsKeyword" color="#00aa00" selColor="#ffffff" bold="1" italic="0"/>
+
+ <itemData name="Integer" defStyleNum="dsDecVal"/>
+ <itemData name="Binary" defStyleNum="dsBaseN" color="#00dddd" selColor="#00ffff" bold="0" italic="0"/>
+ <itemData name="Octal" defStyleNum="dsBaseN" color="#00aaaa" selColor="#00ffff" bold="0" italic="0"/>
+ <itemData name="Hex" defStyleNum="dsBaseN" color="#006666" selColor="#00ffff" bold="0" italic="0"/>
+ <itemData name="Float" defStyleNum="dsFloat"/>
+
+ <itemData name="Escape String" defStyleNum="dsString" color="#00aa00" selColor="#ff0000" bold="0" italic="0"/>
+ <itemData name="String" defStyleNum="dsString" color="#00aa00" selColor="#ff0000" bold="0" italic="0"/>
+ <itemData name="Char" defStyleNum="dsChar" color="#ff00ff" selColor="#ff00ff" bold="0" italic="0"/>
+ <itemData name="Wysiwyg" defStyleNum="dsChar" color="#a100a1" selColor="#ff00ff" bold="0" italic="0"/>
+
+ <itemData name="Comment" defStyleNum="dsComment"/>
+ </itemDatas>
+ </highlighting>
+ <general>
+ <comments>
+ <comment name="singleLine" start="//"/>
+ <comment name="multiLine" start="/+" end="+/"/>
+ </comments>
+ <keywords casesensitive="true"/>
+ </general>
+</language>
diff --git a/kate/data/debianchangelog.xml b/kate/data/debianchangelog.xml
new file mode 100644
index 000000000..b752f229c
--- /dev/null
+++ b/kate/data/debianchangelog.xml
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+<language name="Debian Changelog" version="0.62" kateversion="2.4" section="Other" extensions="" mimetype="">
+ <highlighting>
+ <list name="keywords">
+ <item>urgency</item>
+ </list>
+
+ <list name="distributions">
+ <item>stable</item>
+ <item>testing</item>
+ <item>frozen</item>
+ <item>unstable</item>
+ <item>experimental</item>
+ </list>
+
+ <list name="urgencies">
+ <item>low</item>
+ <item>medium</item>
+ <item>high</item>
+ <item>emergency</item>
+ <item>bug</item>
+ </list>
+
+ <contexts>
+ <context attribute="Normal Text" lineEndContext="#stay" name="INIT">
+ <RegExpr attribute="Keyword" context="Head" String="[^ ]*" column="0"/>
+ <RegExpr attribute="Email" context="#stay" String="&lt;.*@.*&gt;"/>
+ <RegExpr attribute="Keyword" context="#stay" String=" \-\-" column="0"/>
+ <RegExpr attribute="Keyword" context="#stay" String=" \*" column="0"/>
+ <RegExpr attribute="Bug" context="#stay" String="[Cc][Ll][Oo][Ss][Ee][Ss]:[\s]*(([Bb][Uu][Gg]\s*)?#\s*\d+)(\s*, *([Bb[Uu][Gg]\s*)?#\s*\d+)*"/>
+ </context>
+
+ <context attribute="Normal Text" lineEndContext="#pop" name="Head">
+ <DetectChar attribute="Keyword" context="Version" char="("/>
+ <RegExpr attribute="Keyword" context="#stay" String="[,;=]"/>
+ <keyword attribute="Keyword" context="#stay" String="keywords"/>
+ <keyword attribute="Data" context="#stay" String="distributions"/>
+ <keyword attribute="Data" context="#stay" String="urgencies"/>
+ </context>
+
+ <context attribute="Version" lineEndContext="#pop" name="Version">
+ <DetectChar attribute="Keyword" context="#pop" char=")"/>
+ </context>
+ </contexts>
+
+ <itemDatas>
+ <itemData name="Normal Text" defStyleNum="dsNormal"/>
+ <itemData name="Keyword" defStyleNum="dsKeyword"/>
+ <itemData name="Version" defStyleNum="dsDataType"/>
+ <itemData name="Data" defStyleNum="dsDataType"/>
+ <itemData name="Bug" defStyleNum="dsDataType"/>
+ <itemData name="Email" defStyleNum="dsOthers"/>
+ </itemDatas>
+ </highlighting>
+
+ <general>
+ <keywords casesensitive="1" />
+ </general>
+</language>
diff --git a/kate/data/debiancontrol.xml b/kate/data/debiancontrol.xml
new file mode 100644
index 000000000..76b761863
--- /dev/null
+++ b/kate/data/debiancontrol.xml
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+<language name="Debian Control" version="0.82" kateversion="2.4" section="Other" extensions="" mimetype="">
+ <highlighting>
+ <contexts>
+ <context attribute="Normal Text" lineEndContext="#stay" name="INIT">
+ <StringDetect attribute="Keyword" context="DependencyField" String="Depends:"/>
+ <StringDetect attribute="Keyword" context="DependencyField" String="Recommends:"/>
+ <StringDetect attribute="Keyword" context="DependencyField" String="Suggests:"/>
+ <StringDetect attribute="Keyword" context="DependencyField" String="Conflicts:"/>
+ <StringDetect attribute="Keyword" context="DependencyField" String="Provides:"/>
+ <StringDetect attribute="Keyword" context="DependencyField" String="Replaces:"/>
+ <StringDetect attribute="Keyword" context="DependencyField" String="Enhances:"/>
+ <StringDetect attribute="Keyword" context="DependencyField" String="Pre-Depends:"/>
+ <StringDetect attribute="Keyword" context="DependencyField" String="Build-Depends:"/>
+ <StringDetect attribute="Keyword" context="DependencyField" String="Build-Depends-Indep:"/>
+ <StringDetect attribute="Keyword" context="DependencyField" String="Build-Conflicts:"/>
+ <StringDetect attribute="Keyword" context="DependencyField" String="Build-Conflicts-Indep:"/>
+ <RegExpr attribute="Keyword" context="Field" minimal="true" String="[^ ]*:" column="0"/>
+ <DetectChar attribute="Value" context="Field" char=" " column="0"/>
+ </context>
+
+ <context attribute="Value" lineEndContext="#pop" name="Field">
+ <RegExpr attribute="Email" context="#stay" String="&lt;.*@.*&gt;" minimal="true"/>
+ <Detect2Chars attribute="Keyword" context="Variable" char="$" char1="{"/>
+ </context>
+
+ <context attribute="Variable" lineEndContext="#pop" name="Variable">
+ <DetectChar attribute="Keyword" context="#pop" char="}"/>
+ </context>
+
+ <context attribute="Value" lineEndContext="#pop" name="DependencyField">
+ <RegExpr attribute="Email" context="#stay" String="&lt;.*@.*&gt;" minimal="true"/>
+ <Detect2Chars attribute="Keyword" context="Variable" char="$" char1="{"/>
+ <RegExpr attribute="Keyword" context="#stay" String="[,\|]"/>
+ <DetectChar attribute="Keyword" context="Constrain" char="("/>
+ <DetectChar attribute="Keyword" context="Constrain" char="["/>
+ </context>
+
+ <context attribute="Version" lineEndContext="#stay" name="Constrain">
+ <Detect2Chars attribute="Keyword" context="Variable" char="$" char1="{"/>
+ <RegExpr attribute="Keyword" context="#stay" String="[!&lt;=&gt;]"/>
+ <DetectChar attribute="Keyword" context="#pop" char=")"/>
+ <DetectChar attribute="Keyword" context="#pop" char="]"/>
+ </context>
+ </contexts>
+
+ <itemDatas>
+ <itemData name="Normal Text" defStyleNum="dsNormal"/>
+ <itemData name="Keyword" defStyleNum="dsKeyword"/>
+ <itemData name="Version" defStyleNum="dsDecVal"/>
+ <itemData name="Value" defStyleNum="dsDataType"/>
+ <itemData name="Variable" defStyleNum="dsOthers"/>
+ <itemData name="Email" defStyleNum="dsOthers"/>
+ </itemDatas>
+ </highlighting>
+
+ <general>
+ <keywords casesensitive="1" />
+ </general>
+</language>
diff --git a/kate/data/desktop.xml b/kate/data/desktop.xml
new file mode 100644
index 000000000..c91e6273f
--- /dev/null
+++ b/kate/data/desktop.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+<language name=".desktop" version="1.04" kateversion="2.4" section="Configuration" extensions="*.desktop;*.kdelnk" mimetype="application/x-desktop">
+ <highlighting>
+ <contexts>
+ <context attribute="Key" lineEndContext="#stay" name="Normal">
+ <RegExpr String="\[.*\]$" attribute="Section" context="#stay" beginRegion="Section" endRegion="Section" column="0"/>
+ <RegExpr String="\[.*\]" attribute="Language" context="Value"/>
+ <DetectChar char="#" attribute="Comment" context="Comment" firstNonSpace="true"/>
+ <DetectChar char="=" attribute="Normal Text" context="Value"/>
+ </context>
+ <context attribute="Normal Text" lineEndContext="#pop" name="Value"/>
+ <context attribute="Comment" lineEndContext="#pop" name="Comment"/>
+ </contexts>
+ <itemDatas>
+ <itemData name="Normal Text" defStyleNum="dsNormal"/>
+ <itemData name="Section" defStyleNum="dsKeyword"/>
+ <itemData name="Key" defStyleNum="dsDataType"/>
+ <itemData name="Language" defStyleNum="dsDecVal" bold="1"/>
+ <itemData name="Comment" defStyleNum="dsComment"/>
+ </itemDatas>
+ </highlighting>
+ <general>
+ <comments>
+ <comment name="singleLine" start="#"/>
+ </comments>
+ </general>
+</language>
diff --git a/kate/data/diff.xml b/kate/data/diff.xml
new file mode 100644
index 000000000..e9d2ccf05
--- /dev/null
+++ b/kate/data/diff.xml
@@ -0,0 +1,113 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd"
+[
+ <!ENTITY file "(====|\*\*\*|\-\-\-|diff|Only in .*:).*$">
+ <!ENTITY chunk "(\@\@|\d).*$">
+ <!ENTITY csep "(\+\+\+|\-\-\-).*$">
+]>
+<!--
+ 2006-08-02: 1.10 Matthew Woehlke <mw_triad@sourceforge.net>
+ Added folding. Context diff changes are now identified as old/new (using
+ seperate attributes). Recognize 'Only in' from 'diff -r' output.
+ There is currently a bug (KATE limitation?) where regions may sometimes
+ pick up one line too many.
+-->
+<language name="Diff" version="1.10" kateversion="2.1" section="Other" extensions="*.diff;*patch" mimetype="text/x-diff">
+
+ <highlighting>
+
+ <contexts>
+
+ <context attribute="Normal Text" lineEndContext="#stay" name="Normal">
+ <RegExpr attribute="Header" context="Chunk" String="&chunk;" beginRegion="chunk" column="0"/>
+ <RegExpr attribute="Header" context="RChunk" String="\*+$" beginRegion="chunk" column="0"/>
+ <RegExpr attribute="File" context="#stay" String="Only in .*:.*$" column="0"/>
+ <RegExpr attribute="File" context="RFile" String="diff.*$" beginRegion="file" column="0"/>
+ <RegExpr attribute="File" context="File" String="(====|\*\*\*|\-\-\-).*$" beginRegion="file" column="0"/>
+ <IncludeRules context="FindDiff"/>
+ <DetectChar attribute="Changed line" context="ChangedOld" char="!" column="0"/>
+ </context>
+
+ <context attribute="Normal Text" lineEndContext="#stay" name="FindDiff">
+ <RegExpr attribute="Header" context="#stay" String="&csep;" column="0"/>
+ <AnyChar attribute="Added line" context="Added" String="+&gt;" column="0"/>
+ <AnyChar attribute="Removed line" context="Removed" String="-&lt;" column="0"/>
+ </context>
+
+ <!-- block contexts -->
+ <context attribute="Normal Text" lineEndContext="#stay" name="File">
+ <RegExpr attribute="Header" context="ChunkInFile" String="&chunk;" beginRegion="chunk" column="0"/>
+ <RegExpr attribute="Header" context="RChunkInFile" String="\*+$" beginRegion="block" column="0"/>
+ <RegExpr attribute="File" context="#pop" String="&file;" endRegion="block" lookAhead="true" column="0"/>
+ <DetectChar attribute="Changed line (old)" context="ChangedOld" char="!" column="0"/>
+ <IncludeRules context="FindDiff"/>
+ </context>
+
+ <context attribute="Normal Text" lineEndContext="#stay" name="Chunk">
+ <RegExpr attribute="Header" context="#pop" String="&chunk;" endRegion="block" lookAhead="true" column="0"/>
+ <DetectChar attribute="Changed line (old)" context="ChangedOld" char="!" column="0"/>
+ <IncludeRules context="FindDiff"/>
+ </context>
+
+ <context attribute="Normal Text" lineEndContext="#stay" name="ChunkInFile">
+ <RegExpr attribute="Header" context="#pop" String="&chunk;" endRegion="block" lookAhead="true" column="0"/>
+ <RegExpr attribute="File" context="#pop" String="&file;" endRegion="block" lookAhead="true" column="0"/>
+ <DetectChar attribute="Changed line (old)" context="ChangedOld" char="!" column="0"/>
+ <IncludeRules context="FindDiff"/>
+ </context>
+
+ <!-- block contexts (diff -r) -->
+ <context attribute="Normal Text" lineEndContext="#stay" name="RFile">
+ <RegExpr attribute="File" context="#pop" String="(diff|Only in .*:).*$" endRegion="block" lookAhead="true" column="0"/>
+ <RegExpr attribute="Header" context="#stay" String="&file;" column="0"/>
+ <RegExpr attribute="Header" context="RChunkInFile" String="\*+$" beginRegion="block" column="0"/>
+ <IncludeRules context="File"/>
+ </context>
+
+ <context attribute="Normal Text" lineEndContext="#stay" name="RChunk">
+ <RegExpr attribute="Header" context="#stay" String="\*\*\* .* \*\*\*\*$" column="0"/>
+ <RegExpr attribute="Header" context="RChunkNew" String="\-\-\- .* \-\-\-\-$" column="0"/>
+ <IncludeRules context="Chunk"/>
+ </context>
+
+ <context attribute="Normal Text" lineEndContext="#stay" name="RChunkInFile">
+ <RegExpr attribute="Header" context="#stay" String="\*\*\* .* \*\*\*\*$" column="0"/>
+ <RegExpr attribute="Header" context="RChunkInFileNew" String="\-\-\- .* \-\-\-\-$" column="0"/>
+ <IncludeRules context="ChunkInFile"/>
+ </context>
+
+ <context attribute="Normal Text" lineEndContext="#stay" name="RChunkNew">
+ <RegExpr attribute="Header" context="#pop#pop" String="&chunk;" lookAhead="true" column="0"/>
+ <DetectChar attribute="Changed line (new)" context="ChangedNew" char="!" column="0"/>
+ <IncludeRules context="FindDiff"/>
+ </context>
+
+ <context attribute="Normal Text" lineEndContext="#stay" name="RChunkInFileNew">
+ <RegExpr attribute="Header" context="#pop#pop" String="&chunk;" lookAhead="true" column="0"/>
+ <RegExpr attribute="File" context="#pop#pop" String="&file;" endRegion="block" lookAhead="true" column="0"/>
+ <DetectChar attribute="Changed line (new)" context="ChangedNew" char="!" column="0"/>
+ <IncludeRules context="FindDiff"/>
+ </context>
+
+ <!-- line contexts -->
+ <context attribute="File" lineEndContext="#pop" name="File"/>
+ <context attribute="Removed line" lineEndContext="#pop" name="Removed"/>
+ <context attribute="Added line" lineEndContext="#pop" name="Added"/>
+ <context attribute="Changed line (old)" lineEndContext="#pop" name="ChangedOld"/>
+ <context attribute="Changed line (new)" lineEndContext="#pop" name="ChangedNew"/>
+
+ </contexts>
+
+ <itemDatas>
+ <itemData name="Normal Text" defStyleNum="dsNormal"/>
+ <itemData name="File" defStyleNum="dsKeyword"/>
+ <itemData name="Header" defStyleNum="dsDataType"/>
+ <itemData name="Removed line" defStyleNum="dsOthers" color="#FF0000"/>
+ <itemData name="Added line" defStyleNum="dsString" color="#0000FF"/>
+ <itemData name="Changed line (old)" defStyleNum="dsOthers" color="#FF0000"/>
+ <itemData name="Changed line (new)" defStyleNum="dsString" color="#0000FF"/>
+ </itemDatas>
+
+ </highlighting>
+
+</language>
diff --git a/kate/data/doxygen.xml b/kate/data/doxygen.xml
new file mode 100644
index 000000000..a464c98d0
--- /dev/null
+++ b/kate/data/doxygen.xml
@@ -0,0 +1,447 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+<!--
+ This file is part of KDE's kate project.
+
+ copyright : (C) 2004 by Dominik Haumann
+ email : dhdev at gmx dot de
+
+ **********************************************************************
+ * This library is free software; you can redistribute it and/or *
+ * modify it under the terms of the GNU Library General Public *
+ * License as published by the Free Software Foundation; either *
+ * version 2 of the License, or (at your option) any later version. *
+ * *
+ * This library is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Library General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this library; if not, write to the *
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, *
+ * Boston, MA 02110-1301, USA. *
+ **********************************************************************
+ -->
+<language name="Doxygen" version="1.25" kateversion="2.4" section="Markup" extensions="*.dox;*.doxygen" mimetype="text/x-doxygen" author="Dominik Haumann (dhdev@gmx.de)" license="LGPL">
+ <highlighting>
+ <!-- note: all tags may begin with a \ or @ char
+ so if you add/change tags you have to do it twice -->
+ <list name="TagOnly">
+ <item> \arg </item>
+ <item> \attention </item>
+ <item> \author </item>
+ <item> \callgraph </item>
+ <item> \code </item>
+ <item> \dot </item>
+ <item> \else </item>
+ <item> \endcode </item>
+ <item> \enddot </item>
+ <item> \endhtmlonly </item>
+ <item> \endif </item>
+ <item> \endlatexonly </item>
+ <item> \endlink </item>
+ <item> \endmanonly </item>
+ <item> \endverbatim </item>
+ <item> \endxmlonly </item>
+ <item> \f[ </item>
+ <item> \f] </item>
+ <item> \f$ </item>
+ <item> \hideinitializer </item>
+ <item> \htmlonly </item>
+ <item> \interface </item>
+ <item> \internal </item>
+ <item> \invariant </item>
+ <item> \~ </item>
+ <item> \@ </item>
+ <item> \$ </item>
+ <item> \\ </item>
+ <item> \# </item>
+ <item> \latexonly </item>
+ <item> \li </item>
+ <item> \manonly </item>
+ <item> \n </item>
+ <item> \nosubgrouping </item>
+ <item> \note </item>
+ <item> \only </item>
+ <item> \par </item>
+ <item> \post </item>
+ <item> \pre </item>
+ <item> \remarks </item>
+ <item> \return </item>
+ <item> \returns </item>
+ <item> \sa </item>
+ <item> \see </item>
+ <item> \showinitializer </item>
+ <item> \since </item>
+ <item> \test </item>
+ <item> \todo </item>
+ <item> \verbatim </item>
+ <item> \warning </item>
+ <item> \xmlonly </item>
+
+ <item> @arg </item>
+ <item> @attention </item>
+ <item> @author </item>
+ <item> @callgraph </item>
+ <item> @code </item>
+ <item> @dot </item>
+ <item> @else </item>
+ <item> @endcode </item>
+ <item> @enddot </item>
+ <item> @endhtmlonly </item>
+ <item> @endif </item>
+ <item> @endlatexonly </item>
+ <item> @endlink </item>
+ <item> @endmanonly </item>
+ <item> @endverbatim </item>
+ <item> @endxmlonly </item>
+ <item> @f[ </item>
+ <item> @f] </item>
+ <item> @f$ </item>
+ <item> @hideinitializer </item>
+ <item> @htmlonly </item>
+ <item> @interface </item>
+ <item> @internal </item>
+ <item> @invariant </item>
+ <item> @~ </item>
+ <item> @@ </item>
+ <item> @$ </item>
+ <item> @\ </item>
+ <item> @# </item>
+ <item> @latexonly </item>
+ <item> @li </item>
+ <item> @manonly </item>
+ <item> @n </item>
+ <item> @nosubgrouping </item>
+ <item> @note </item>
+ <item> @only </item>
+ <item> @par </item>
+ <item> @post </item>
+ <item> @pre </item>
+ <item> @remarks </item>
+ <item> @return </item>
+ <item> @returns </item>
+ <item> @sa </item>
+ <item> @see </item>
+ <item> @showinitializer </item>
+ <item> @since </item>
+ <item> @test </item>
+ <item> @todo </item>
+ <item> @verbatim </item>
+ <item> @warning </item>
+ <item> @xmlonly </item>
+ </list>
+
+ <list name="TagWord">
+ <item> \addtogroup </item>
+ <item> \a </item>
+ <item> \anchor </item>
+ <item> \b </item>
+ <item> \c </item>
+ <item> \class </item>
+ <item> \copydoc </item>
+ <item> \def </item>
+ <item> \dontinclude </item>
+ <item> \dotfile </item>
+ <item> \e </item>
+ <item> \elseif </item>
+ <item> \em </item>
+ <item> \enum </item>
+ <item> \example </item>
+ <item> \exception </item>
+ <item> \exceptions </item>
+ <item> \file </item>
+ <item> \htmlinclude </item>
+ <item> \if </item>
+ <item> \ifnot </item>
+ <item> \include </item>
+ <item> \link </item>
+ <item> \namespace </item>
+ <item> \p </item>
+ <item> \package </item>
+ <item> \param </item>
+ <item> \ref </item>
+ <item> \relatesalso </item>
+ <item> \relates </item>
+ <item> \retval </item>
+ <item> \throw </item>
+ <item> \throws </item>
+ <item> \verbinclude </item>
+ <item> \version </item>
+ <item> \xrefitem </item>
+
+ <item> @addtogroup </item>
+ <item> @a </item>
+ <item> @anchor </item>
+ <item> @b </item>
+ <item> @c </item>
+ <item> @class </item>
+ <item> @copydoc </item>
+ <item> @def </item>
+ <item> @dontinclude </item>
+ <item> @dotfile </item>
+ <item> @e </item>
+ <item> @elseif </item>
+ <item> @em </item>
+ <item> @enum </item>
+ <item> @example </item>
+ <item> @exception </item>
+ <item> @exceptions </item>
+ <item> @file </item>
+ <item> @htmlinclude </item>
+ <item> @if </item>
+ <item> @ifnot </item>
+ <item> @include </item>
+ <item> @link </item>
+ <item> @namespace </item>
+ <item> @p </item>
+ <item> @package </item>
+ <item> @param </item>
+ <item> @ref </item>
+ <item> @relatesalso </item>
+ <item> @relates </item>
+ <item> @retval </item>
+ <item> @throw </item>
+ <item> @throws </item>
+ <item> @verbinclude </item>
+ <item> @version </item>
+ <item> @xrefitem </item>
+ </list>
+ <list name="TagWordWord">
+ <item> \image </item>
+
+ <item> @image </item>
+ </list>
+ <list name="TagWordString">
+ <item> \defgroup </item>
+ <item> \page </item>
+ <item> \paragraph </item>
+ <item> \section </item>
+ <item> \struct </item>
+ <item> \subsection </item>
+ <item> \subsubsection </item>
+ <item> \union </item>
+ <item> \weakgroup </item>
+
+ <item> @defgroup </item>
+ <item> @page </item>
+ <item> @paragraph </item>
+ <item> @section </item>
+ <item> @struct </item>
+ <item> @subsection </item>
+ <item> @subsubsection </item>
+ <item> @union </item>
+ <item> @weakgroup </item>
+ </list>
+ <list name="TagString">
+ <item> \addindex </item>
+ <item> \brief </item>
+ <item> \bug </item>
+ <item> \date </item>
+ <item> \deprecated </item>
+ <item> \fn </item>
+ <item> \ingroup </item>
+ <item> \line </item>
+ <item> \mainpage </item>
+ <item> \name </item>
+ <item> \overload </item>
+ <item> \short </item>
+ <item> \skip </item>
+ <item> \skipline </item>
+ <item> \typedef </item>
+ <item> \until </item>
+ <item> \var </item>
+
+ <item> @addindex </item>
+ <item> @brief </item>
+ <item> @bug </item>
+ <item> @date </item>
+ <item> @deprecated </item>
+ <item> @fn </item>
+ <item> @ingroup </item>
+ <item> @line </item>
+ <item> @mainpage </item>
+ <item> @name </item>
+ <item> @overload </item>
+ <item> @short </item>
+ <item> @skip </item>
+ <item> @skipline </item>
+ <item> @typedef </item>
+ <item> @until </item>
+ <item> @var </item>
+ </list>
+ <contexts>
+ <!-- different formats:
+ @tag : TagOnly
+ @tag rest_of_line : TagString
+ @tag <word> : TagWord
+ @tag <word> <word> : TagWordWord
+ @tag <word> rest_of_line : TagWordString
+ -->
+ <context attribute="Normal Text" lineEndContext="#stay" name="Normal">
+ <RegExpr attribute="Comment" context="LineComment" String="//(!|(/(?=[^/]|$)))&lt;?"/>
+ <RegExpr attribute="Comment" context="BlockComment" String="/\*(\*[^*/]|!|\*$)&lt;?" beginRegion="BlockComment"/>
+ </context>
+ <context attribute="Comment" lineEndContext="#pop" name="LineComment">
+ <DetectSpaces />
+ <IncludeRules context="##Alerts" />
+ <keyword attribute="Tags" context="#stay" String="TagOnly" />
+ <keyword attribute="Tags" context="SL_TagWord" String="TagWord" />
+ <keyword attribute="Tags" context="SL_TagWordWord" String="TagWordWord" />
+ <keyword attribute="Tags" context="SL_TagString" String="TagString" />
+ <keyword attribute="Tags" context="SL_TagWordString" String="TagWordString" />
+ <DetectIdentifier />
+ <StringDetect attribute="HTML Comment" context="SL_htmlcomment" String="&lt;!--" />
+ <Detect2Chars attribute="Comment" context="#stay" char="&lt;" char1="&lt;" />
+ <RegExpr attribute="HTML Tag" context="SL_htmltag" String="&lt;\s*\/?\s*[a-zA-Z_:][a-zA-Z0-9._:-]*" />
+ </context>
+ <context attribute="Comment" lineEndContext="#stay" name="BlockComment">
+ <DetectSpaces />
+ <Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" endRegion="BlockComment"/>
+ <IncludeRules context="##Alerts" />
+ <keyword attribute="Tags" context="#stay" String="TagOnly" />
+ <keyword attribute="Tags" context="ML_TagWord" String="TagWord" />
+ <keyword attribute="Tags" context="ML_TagWordWord" String="TagWordWord" />
+ <keyword attribute="Tags" context="ML_TagString" String="TagString" />
+ <keyword attribute="Tags" context="ML_TagWordString" String="TagWordString" />
+ <DetectIdentifier />
+ <RegExpr attribute="Tags" context="#stay" String="\\(&lt;|&gt;)" />
+ <Detect2Chars attribute="Comment" context="#stay" char="&lt;" char1="&lt;" />
+ <RegExpr attribute="HTML Tag" context="ML_htmltag" String="&lt;\s*\/?\s*[a-zA-Z_:][a-zA-Z0-9._:-]*" />
+ <StringDetect attribute="HTML Comment" context="ML_htmlcomment" String="&lt;!--" />
+ </context>
+
+<!-- NOTE: all contexts beginning with ML_ are for multiline comments
+ The following contexts contain a Detect2Chars that looks for a */ sequence to end multiline comments. Singleline comments do not have this limitation - that's why all contexts are copy&pasted and the line <Detect2Chars ... */> is removed. <IncludeRules context="acontext"> could be used instead but it would make context switching much more complex and very hard to understand!
+-->
+ <!-- tag contexts -->
+ <context attribute="Comment" lineEndContext="#pop" name="ML_TagWord">
+ <Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" lookAhead="true"/>
+ <DetectSpaces />
+ <RegExpr attribute="Word" context="#pop" String="\S\s" />
+ <RegExpr attribute="Word" context="#stay" String="\S" />
+ </context>
+ <context attribute="Comment" lineEndContext="#pop" name="ML_TagWordWord">
+ <Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" lookAhead="true"/>
+ <DetectSpaces />
+ <RegExpr attribute="Word" context="#pop" String="\S\s" />
+ <RegExpr attribute="Word" context="#stay" String="\S" />
+ </context>
+ <context attribute="Comment" lineEndContext="#pop" name="ML_Tag2ndWord">
+ <Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" lookAhead="true"/>
+ <DetectSpaces />
+ <RegExpr attribute="Word" context="#pop" String="\S\s" />
+ <RegExpr attribute="Word" context="#stay" String="\S" />
+ </context>
+ <context attribute="Comment" lineEndContext="#pop" name="ML_TagString">
+ <DetectSpaces />
+ <Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" lookAhead="true"/>
+ <StringDetect attribute="HTML Comment" context="ML_htmlcomment" String="&lt;!--" />
+ <Detect2Chars attribute="Comment" context="#stay" char="&lt;" char1="&lt;" />
+ <RegExpr attribute="HTML Tag" context="ML_htmltag" String="&lt;\s*\/?\s*[a-zA-Z_:][a-zA-Z0-9._:-]*" />
+ <RegExpr attribute="Description" context="#stay" String="." />
+ </context>
+ <context attribute="Comment" lineEndContext="#pop" name="ML_TagWordString">
+ <Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" lookAhead="true"/>
+ <DetectSpaces />
+ <RegExpr attribute="Word" context="#pop" String="\S\s" />
+ <RegExpr attribute="Word" context="#stay" String="\S" />
+ </context>
+
+ <!-- html contexts -->
+ <context name="ML_htmltag" attribute="Identifier" lineEndContext="#stay">
+ <Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" lookAhead="true"/>
+ <Detect2Chars attribute="HTML Tag" context="#pop" char="/" char1="&gt;" />
+ <DetectChar attribute="HTML Tag" context="#pop" char="&gt;"/>
+ <RegExpr attribute="Identifier" context="ML_identifiers" String="\s*=\s*"/>
+ </context>
+ <context name="ML_htmlcomment" attribute="HTML Comment" lineEndContext="#stay">
+ <Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" lookAhead="true"/>
+ <IncludeRules context="##Alerts" />
+ <StringDetect attribute="HTML Comment" context="#pop" String="--&gt;" />
+ </context>
+ <context name="ML_identifiers" attribute="Identifier" lineEndContext="#stay">
+ <Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" lookAhead="true"/>
+ <RegExpr attribute="String" context="#pop" String="\s*#?[a-zA-Z0-9]*" />
+ <DetectChar attribute="Types" context="ML_types1" char="'" />
+ <DetectChar attribute="Types" context="ML_types2" char="&quot;" />
+ </context>
+ <context name="ML_types1" attribute="Types" lineEndContext="#stay">
+ <Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" lookAhead="true"/>
+ <DetectChar attribute="Types" context="#pop#pop" char="'" />
+ </context>
+ <context name="ML_types2" attribute="Types" lineEndContext="#stay">
+ <Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" lookAhead="true"/>
+ <DetectChar attribute="Types" context="#pop#pop" char="&quot;" />
+ </context>
+
+<!-- NOTE: all contexts beginning with SL_ are for singleline comments -->
+ <!-- tag contexts -->
+ <context attribute="Comment" lineEndContext="#pop" name="SL_TagWord">
+ <DetectSpaces />
+ <RegExpr attribute="Word" context="#pop" String="\S\s" />
+ <RegExpr attribute="Word" context="#stay" String="\S" />
+ </context>
+ <context attribute="Comment" lineEndContext="#pop" name="SL_TagWordWord">
+ <DetectSpaces />
+ <RegExpr attribute="Word" context="#pop" String="\S\s" />
+ <RegExpr attribute="Word" context="#stay" String="\S" />
+ </context>
+ <context attribute="Comment" lineEndContext="#pop" name="SL_Tag2ndWord">
+ <DetectSpaces />
+ <RegExpr attribute="Word" context="#pop" String="\S\s" />
+ <RegExpr attribute="Word" context="#stay" String="\S" />
+ </context>
+ <context attribute="Comment" lineEndContext="#pop" name="SL_TagString">
+ <DetectSpaces />
+ <StringDetect attribute="HTML Comment" context="SL_htmlcomment" String="&lt;!--" />
+ <Detect2Chars attribute="Comment" context="#stay" char="&lt;" char1="&lt;" />
+ <RegExpr attribute="HTML Tag" context="SL_htmltag" String="&lt;\s*\/?\s*[a-zA-Z_:][a-zA-Z0-9._:-]*" />
+ <RegExpr attribute="Description" context="#stay" String="." />
+ </context>
+ <context attribute="Comment" lineEndContext="#pop" name="SL_TagWordString">
+ <DetectSpaces />
+ <RegExpr attribute="Word" context="#pop" String="\S\s" />
+ <RegExpr attribute="Word" context="#stay" String="\S" />
+ </context>
+
+ <!-- html contexts -->
+ <context name="SL_htmltag" attribute="Identifier" lineEndContext="#pop">
+ <Detect2Chars attribute="HTML Tag" context="#pop" char="/" char1="&gt;" />
+ <DetectChar attribute="HTML Tag" context="#pop" char="&gt;"/>
+ <RegExpr attribute="Identifier" context="SL_identifiers" String="\s*=\s*"/>
+ </context>
+ <context name="SL_htmlcomment" attribute="HTML Comment" lineEndContext="#pop">
+ <IncludeRules context="##Alerts" />
+ <StringDetect attribute="HTML Comment" context="#pop" String="--&gt;" />
+ </context>
+ <context name="SL_identifiers" attribute="Identifier" lineEndContext="#pop">
+ <RegExpr attribute="String" context="#pop" String="\s*#?[a-zA-Z0-9]*" />
+ <DetectChar attribute="Types" context="SL_types1" char="'" />
+ <DetectChar attribute="Types" context="SL_types2" char="&quot;" />
+ </context>
+ <context name="SL_types1" attribute="Types" lineEndContext="#pop">
+ <DetectChar attribute="Types" context="#pop#pop" char="'" />
+ </context>
+ <context name="SL_types2" attribute="Types" lineEndContext="#pop">
+ <DetectChar attribute="Types" context="#pop#pop" char="&quot;" />
+ </context>
+
+ </contexts>
+ <itemDatas>
+ <itemData name="Normal Text" defStyleNum="dsNormal" />
+ <itemData name="Tags" defStyleNum="dsKeyword" color="#ca60ca" selColor="#ffffff" bold="1" italic="0" />
+ <itemData name="Word" defStyleNum="dsKeyword" color="#0095ff" selColor="#ffffff" bold="1" italic="0" />
+ <itemData name="HTML Tag" defStyleNum="dsKeyword" color="#000000" selColor="#ffffff" bold="1" italic="0" />
+ <itemData name="Description" defStyleNum="dsString" color="#ff0000" />
+ <itemData name="Comment" defStyleNum="dsComment" color="#0000ff" selColor="#ffffff" italic="1" />
+ <itemData name="Identifier" defStyleNum="dsOthers" />
+ <itemData name="HTML Comment" defStyleNum="dsComment" />
+ <itemData name="Types" defStyleNum="dsDataType" />
+ </itemDatas>
+ </highlighting>
+ <general>
+ <keywords casesensitive="0" weakDeliminator="\$~" />
+ </general>
+</language>
diff --git a/kate/data/e.xml b/kate/data/e.xml
new file mode 100644
index 000000000..a1fa75f6d
--- /dev/null
+++ b/kate/data/e.xml
@@ -0,0 +1,258 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+<language name="E Language" version="0.21" kateversion="2.3" section="Sources" extensions="*.e" mimetype="text/x-e-src">
+ <highlighting>
+ <list name="Type">
+ <item> FALSE </item>
+ <item> MAX_INT </item>
+ <item> MIN_INT </item>
+ <item> NULL </item>
+ <item> TRUE </item>
+ <item> UNDEF </item>
+ <item> bit </item>
+ <item> bits </item>
+ <item> body </item>
+ <item> bool </item>
+ <item> byte </item>
+ <item> byte_array </item>
+ <item> continue </item>
+ <item> copy </item>
+ <item> default </item>
+ <item> external_pointer </item>
+ <item> files </item>
+ <item> file </item>
+ <item> form </item>
+ <item> global </item>
+ <item> index </item>
+ <item> init </item>
+ <item> int </item>
+ <item> it </item>
+ <item> list </item>
+ <item> load </item>
+ <item> long </item>
+ <item> me </item>
+ <item> method </item>
+ <item> module </item>
+ <item> ntv </item>
+ <item> of </item>
+ <item> pat </item>
+ <item> print </item>
+ <item> result </item>
+ <item> source_ref </item>
+ <item> string </item>
+ <item> symtab </item>
+ <item> sys </item>
+ <item> test </item>
+ <item> uint </item>
+ <item> untyped </item>
+ <item> vec </item>
+ </list>
+ <list name="Function">
+ <item> run </item>
+ <item> init </item>
+ <item> pre_generate </item>
+ <item> dut_error </item>
+ <item> pack </item>
+ <item> unpack </item>
+ <item> post_generate </item>
+ <item> pre_generate </item>
+ <item> set_config </item>
+ <item> hex </item>
+ <item> stop_run </item>
+ <item> append </item>
+ <item> size </item>
+ <item> delete </item>
+ <item> is_empty </item>
+ <item> deep_compare </item>
+ <item> deep_compare_physical </item>
+ <item> clear </item>
+ <item> pop0 </item>
+ <item> setup </item>
+ <item> crc_32 </item>
+ </list>
+ <list name="Statement">
+ <item> chars </item>
+ <item> define </item>
+ <item> extend </item>
+ <item> event </item>
+ <item> ECHO </item>
+ <item> DOECHO </item>
+ <item> import </item>
+ <item> initialize </item>
+ <item> non_terminal </item>
+ <item> struct </item>
+ <item> unit </item>
+ <item> script </item>
+ <item> testgroup </item>
+ <item> type </item>
+ </list>
+ <list name="Action">
+ <item> C </item>
+ <item> add </item>
+ <item> also </item>
+ <item> and </item>
+ <item> as </item>
+ <item> as_a </item>
+ <item> break </item>
+ <item> code </item>
+ <item> compute </item>
+ <item> computed </item>
+ <item> delayed </item>
+ <item> do </item>
+ <item> else </item>
+ <item> each </item>
+ <item> emit </item>
+ <item> empty </item>
+ <item> end </item>
+ <item> exit </item>
+ <item> finish </item>
+ <item> for </item>
+ <item> from </item>
+ <item> if </item>
+ <item> in </item>
+ <item> is </item>
+ <item> like </item>
+ <item> log </item>
+ <item> new </item>
+ <item> no </item>
+ <item> not </item>
+ <item> only </item>
+ <item> or </item>
+ <item> out </item>
+ <item> read </item>
+ <item> repeat </item>
+ <item> return </item>
+ <item> reverse </item>
+ <item> routine </item>
+ <item> step </item>
+ <item> then </item>
+ <item> to </item>
+ <item> traceable </item>
+ <item> untraceable </item>
+ <item> var </item>
+ <item> when </item>
+ <item> while </item>
+ <item> with </item>
+ <item> write </item>
+ <item> xor </item>
+ </list>
+ <list name="Generation">
+ <item> before </item>
+ <item> by </item>
+ <item> choose </item>
+ <item> gen </item>
+ <item> keep </item>
+ <item> keeping </item>
+ <item> matches </item>
+ <item> next </item>
+ <item> select </item>
+ <item> sequence </item>
+ <item> soft </item>
+ <item> using </item>
+ </list>
+ <list name="Cover">
+ <item> address </item>
+ <item> cover </item>
+ <item> error </item>
+ <item> events </item>
+ <item> event </item>
+ <item> length </item>
+ <item> kind </item>
+ <item> ranges </item>
+ <item> range </item>
+ <item> sample </item>
+ <item> text </item>
+ <item> value </item>
+ <item> item </item>
+ <item> transition </item>
+ <item> illegal </item>
+ </list>
+ <list name="Simulator">
+ <item> always </item>
+ <item> all </item>
+ <item> basic </item>
+ <item> call </item>
+ <item> cycles </item>
+ <item> cycle </item>
+ <item> clock </item>
+ <item> change </item>
+ <item> check </item>
+ <item> expect </item>
+ <item> fall </item>
+ <item> first </item>
+ <item> forever </item>
+ <item> idle </item>
+ <item> initial </item>
+ <item> negedge </item>
+ <item> others </item>
+ <item> on </item>
+ <item> posedge </item>
+ <item> rise </item>
+ <item> start </item>
+ <item> that </item>
+ <item> time </item>
+ <item> task </item>
+ <item> until </item>
+ <item> verilog </item>
+ <item> vhdl </item>
+ <item> wait </item>
+ <item> within </item>
+ </list>
+ <contexts>
+
+ <context name="out_comment" attribute="OutSide E code" lineEndContext="#stay">
+ <Detect2Chars attribute="code_begin" context="normal" char="&lt;" char1="'" />
+ </context>
+
+ <context name="normal" attribute="Normal Text" lineEndContext="#stay">
+ <DetectChar attribute="Operators" context="#stay" char="{" beginRegion="Region1"/>
+ <DetectChar attribute="Operators" context="#stay" char="}" endRegion="Region1"/>
+ <HlCHex attribute="Integer" context="#stay" />
+ <HlCOct attribute="Integer" context="#stay" />
+ <Int attribute="Integer" context="#stay" />
+ <Detect2Chars attribute="code_end" context="out_comment" char="'" char1="&gt;" />
+ <Detect2Chars attribute="Comment" context="comment" char="-" char1="-" />
+ <Detect2Chars attribute="Comment" context="comment" char="/" char1="/" />
+ <DetectChar attribute="Vector" context="string" char="&quot;" />
+ <AnyChar attribute="Operators" context="#stay" String="'[&amp;&gt;&lt;=:+\-*\|].,;" />
+ <keyword attribute="Data Type" context="#stay" String="Type"/>
+ <keyword attribute="Function" context="#stay" String="Function"/>
+ <keyword attribute="Statement" context="#stay" String="Statement"/>
+ <keyword attribute="Action" context="#stay" String="Action"/>
+ <keyword attribute="Keyword" context="#stay" String="Generation"/>
+ <keyword attribute="Keyword" context="#stay" String="Cover"/>
+ <keyword attribute="Keyword" context="#stay" String="Simulator"/>
+
+ </context>
+
+
+ <context name="comment" attribute="Comment" lineEndContext="#pop" />
+
+ <context name="string" attribute="Vector" lineEndContext="#stay" >
+ <DetectChar attribute="Vector" context="#pop" char="&quot;" />
+ </context>
+
+ </contexts>
+
+ <itemDatas>
+ <itemData name="OutSide E code" defStyleNum="dsComment"/>
+ <itemData name="Normal Text" defStyleNum="dsNormal" />
+ <itemData name="Keyword" defStyleNum="dsKeyword" />
+ <itemData name="Function" defStyleNum="dsFunction" bold="1"/>
+ <itemData name="Statement" defStyleNum="dsNormal" color="#8080FF" selColor="#00ff00" bold="1" italic="0" />
+ <itemData name="Action" defStyleNum="dsNormal" color="#FF8080" selColor="#00ff00" bold="1" italic="0" />
+ <itemData name="Data Type" defStyleNum="dsDataType" />
+ <itemData name="Comment" defStyleNum="dsComment" />
+ <itemData name="Integer" defStyleNum="dsDecVal" />
+ <itemData name="Bit" defStyleNum="dsDecVal" />
+ <itemData name="Vector" defStyleNum="dsString" />
+ <itemData name="Operators" defStyleNum="dsNormal" color="#404000" selColor="#00ff00" bold="0" italic="0" />
+ </itemDatas>
+
+ </highlighting>
+ <general>
+ <keywords casesensitive="1" />
+ </general>
+</language>
+
+
diff --git a/kate/data/eiffel.xml b/kate/data/eiffel.xml
new file mode 100644
index 000000000..9998fd824
--- /dev/null
+++ b/kate/data/eiffel.xml
@@ -0,0 +1,125 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+<!--
+Eiffel syntax highlighting for Kate and Kwrite editors
+
+Change log:
+2003-12-16 Revised existing version by adding several missing keywords. Added predefined
+ entities as a separate word list. Moved from numeric to named contexts.
+ Changed version to 1.02.
+
+Author of version 1.02: Sebastian Vuorinen
+-->
+<language name="Eiffel" version="1.02" kateversion="2.1" section="Sources" extensions="*.e" mimetype="text/x-eiffel-src" author="Sebastian Vuorinen" license="">
+ <highlighting>
+ <list name="keywords">
+ <item> agent </item>
+ <item> alias </item>
+ <item> all </item>
+ <item> and </item>
+ <item> as </item>
+ <item> assign </item>
+ <item> class </item>
+ <item> convert </item>
+ <item> create </item>
+ <item> creation </item>
+ <item> debug </item>
+ <item> deferred </item>
+ <item> do </item>
+ <item> else </item>
+ <item> elseif </item>
+ <item> end </item>
+ <item> expanded </item>
+ <item> export </item>
+ <item> external </item>
+ <item> feature </item>
+ <item> from </item>
+ <item> frozen </item>
+ <item> if </item>
+ <item> implies </item>
+ <item> indexing </item>
+ <item> infix </item>
+ <item> inherit </item>
+ <item> inspect </item>
+ <item> is </item>
+ <item> like </item>
+ <item> local </item>
+ <item> loop </item>
+ <item> not </item>
+ <item> obsolete </item>
+ <item> old </item>
+ <item> once </item>
+ <item> or </item>
+ <item> prefix </item>
+ <item> pure </item>
+ <item> redefine </item>
+ <item> reference </item>
+ <item> rename </item>
+ <item> rescue </item>
+ <item> retry </item>
+ <item> separate </item>
+ <item> then </item>
+ <item> undefine </item>
+ </list>
+
+ <list name="predefined-entities">
+ <item> Current </item>
+ <item> False </item>
+ <item> Precursor </item>
+ <item> Result </item>
+ <item> True </item>
+ <item> TUPLE </item>
+ </list>
+
+ <list name="assertions">
+ <item> check </item>
+ <item> ensure </item>
+ <item> require </item>
+ <item> variant </item>
+ <item> invariant </item>
+ </list>
+
+ <contexts>
+ <context name = "Normal" attribute = "Normal Text" lineEndContext="#stay">
+ <keyword attribute = "Keyword" String = "keywords" context="#stay" />
+ <keyword attribute = "Predefined entities" String = "predefined-entities" context="#stay" />
+ <keyword attribute = "Assertions" String = "assertions" context="#stay" />
+
+ <Int attribute = "Decimal" context="#stay" />
+ <Float attribute = "Float" context="#stay" />
+ <HlCChar attribute = "Char" context="#stay" />
+ <DetectChar attribute = "String" char = "&quot;" context="Quoted String" />
+
+ <Detect2Chars attribute = "Comment" char = "-" char1 = "-" context="Documentation" />
+ </context>
+
+ <context name = "Quoted String" attribute = "String" lineEndContext="#pop">
+ <DetectChar attribute = "String" char = "&quot;" context="#pop" />
+ </context>
+
+ <context name = "Documentation" attribute="Comment" lineEndContext="#pop" />
+ </contexts>
+
+ <itemDatas>
+ <itemData name="Normal Text" defStyleNum="dsNormal" />
+
+ <itemData name="Keyword" defStyleNum="dsKeyword" />
+ <itemData name="Predefined entities" defStyleNum="dsOthers" />
+ <itemData name="Assertions" defStyleNum="dsOthers" />
+
+ <itemData name="Decimal" defStyleNum="dsDecVal" />
+ <itemData name="Float" defStyleNum="dsFloat" />
+ <itemData name="Char" defStyleNum="dsChar" />
+ <itemData name="String" defStyleNum="dsString" />
+
+ <itemData name="Comment" defStyleNum="dsComment" />
+ </itemDatas>
+ </highlighting>
+
+ <general>
+ <comments>
+ <comment name="singleLine" start="--" />
+ </comments>
+ <keywords casesensitive="1" />
+ </general>
+</language>
diff --git a/kate/data/email.xml b/kate/data/email.xml
new file mode 100644
index 000000000..a3ef294f2
--- /dev/null
+++ b/kate/data/email.xml
@@ -0,0 +1,106 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+<!--
+ Copyright (C) 2005 Carl A Joslin <carl.joslin@joslin.dyndns.org>
+-->
+<language name="Email" version="1.00" kateversion="2.4" extensions="*.eml" section="Other" mimetype="message/rfc822" casesensitive="0" author="Carl A Joslin (carl.joslin@joslin.dyndns.org)" license="GPL">
+ <highlighting>
+ <contexts>
+ <context name="headder" attribute="Normal Text" lineEndContext="#stay" casesensitive="0">
+ <RegExpr attribute="rfc-main" context="#stay" String="^[Tt]o:.*$"/>
+ <RegExpr attribute="rfc-main" context="#stay" String="^[Ff]rom:.*$"/>
+ <RegExpr attribute="rfc-main" context="#stay" String="^[Cc][Cc]:.*$"/>
+ <RegExpr attribute="rfc-main" context="#stay" String="^[Bb][Cc][Cc]:.*$"/>
+ <RegExpr attribute="rfc-main" context="#stay" String="^[Ss]ubject:.*$"/>
+ <RegExpr attribute="rfc-main" context="#stay" String="^[Dd]ate:.*$"/>
+
+ <RegExpr attribute="rfc" context="#stay" String="^[Ss]ender:"/>
+ <RegExpr attribute="rfc" context="#stay" String="^[Rr]eply-[Tt]o:"/>
+ <RegExpr attribute="rfc" context="#stay" String="^[Mm]essage-[Ii][Dd]:"/>
+ <RegExpr attribute="rfc" context="#stay" String="^[Ii]n-[Rr]eply-[Tt]o:"/>
+ <RegExpr attribute="rfc" context="#stay" String="^[Rr]eferences:"/>
+ <RegExpr attribute="rfc" context="#stay" String="^[Cc]omments:"/>
+ <RegExpr attribute="rfc" context="#stay" String="^[Kk]eywors:"/>
+ <RegExpr attribute="rfc" context="#stay" String="^[Rr]esent-[Dd]ate:"/>
+ <RegExpr attribute="rfc" context="#stay" String="^[Rr]esent-[Ff]rom:"/>
+ <RegExpr attribute="rfc" context="#stay" String="^[Rr]esent-[Ss]ender:"/>
+ <RegExpr attribute="rfc" context="#stay" String="^[Rr]esent-[Tt]o:"/>
+ <RegExpr attribute="rfc" context="#stay" String="^[Rr]esent-[Cc][Cc]:"/>
+ <RegExpr attribute="rfc" context="#stay" String="^[Rr]esent-[Bb][Cc][Cc]:"/>
+ <RegExpr attribute="rfc" context="#stay" String="^[Rr]esent-[Mm]essage-[Ii][Dd]:"/>
+ <RegExpr attribute="rfc" context="#stay" String="^[Rr]esent-[Rr]eply-[Tt]o:"/>
+ <RegExpr attribute="rfc" context="#stay" String="^[Rr]eturn-[Pp]ath:"/>
+ <RegExpr attribute="rfc" context="#stay" String="^[Rr]eceived:"/>
+
+ <RegExpr attribute="common" context="#stay" String="^[Xx]-[Mm]ozilla-[Ss]tatus:"/>
+ <RegExpr attribute="common" context="#stay" String="^[Xx]-[Mm]ozilla-[Ss]tatus2:"/>
+ <RegExpr attribute="common" context="#stay" String="^[Ee]nverlope-[Tt]o:"/>
+ <RegExpr attribute="common" context="#stay" String="^[Dd]elivery-[Dd]ate:"/>
+ <RegExpr attribute="common" context="#stay" String="^[Xx]-[Oo]riginating-[Ii][Pp]:"/>
+ <RegExpr attribute="common" context="#stay" String="^[Xx]-[Oo]riginating-[Ee]mail:"/>
+ <RegExpr attribute="common" context="#stay" String="^[Xx]-[Ss]ender:"/>
+ <RegExpr attribute="common" context="#stay" String="^[Mm]ime-[Vv]ersion:"/>
+ <RegExpr attribute="common" context="#stay" String="^[Cc]ontent-[Tt]ype:"/>
+ <RegExpr attribute="common" context="#stay" String="^[Xx]-[Mm]ailing-[Ll]ist:"/>
+ <RegExpr attribute="common" context="#stay" String="^[Xx]-[Ll]oop:"/>
+ <RegExpr attribute="common" context="#stay" String="^[Ll]ist-[Pp]ost:"/>
+ <RegExpr attribute="common" context="#stay" String="^[Ll]ist-[Hh]elp:"/>
+ <RegExpr attribute="common" context="#stay" String="^[Ll]ist-[Uu]nsubscribe:"/>
+ <RegExpr attribute="common" context="#stay" String="^[Pp]recedence:"/>
+ <RegExpr attribute="common" context="#stay" String="^[Cc]ontent-[Tt]ransfer-[Ee]ncoding:"/>
+ <RegExpr attribute="common" context="#stay" String="^[Cc]ontent-[Tt]ype:"/>
+ <RegExpr attribute="common" context="#stay" String="^[Xx]-[Bb]ulkmail:"/>
+ <RegExpr attribute="common" context="#stay" String="^[Pp]recedence:"/>
+ <RegExpr attribute="common" context="#stay" String="^[Cc]ontent-[Dd]isposition:"/>
+
+ <RegExpr attribute="other" context="#stay" String="^[0-9a-zA-Z-.]+:"/>
+
+ <RegExpr attribute="email" context="#stay" String='[a-zA-Z0-9.\-]+\@[a-zA-Z0-9.\-]+'/>
+ <RegExpr attribute="email" context="#stay" String='[a-zA-Z0-9.\-]*\s*&lt;[a-zA-Z0-9.\-]+\@[a-zA-Z0-9.\-]+&gt;'/>
+ <RegExpr attribute="email" context="#stay" String='"[a-zA-Z0-9. \-]+"\s*&lt;[a-zA-Z0-9.\-]+\@[a-zA-Z0-9.\-]+&gt;'/>
+
+ <RegExpr attribute="string" context="#stay" String='".*"'/>
+ <RegExpr attribute="string" context="#stay" String="'.*'"/>
+
+ <!--<RegExpr attribute="sign" context="sign" String="^[|&gt;]*[\s_-]*[_-][_-][\s_-]*$"/>-->
+
+ <RegExpr attribute="indent6" context="#stay" String="^[|>]\s*[|>]\s*[|>]\s*[|>]\s*[|>]\s*[|>].*"/>
+ <RegExpr attribute="indent5" context="#stay" String="^[|>]\s*[|>]\s*[|>]\s*[|>]\s*[|>].*"/>
+ <RegExpr attribute="indent4" context="#stay" String="^[|>]\s*[|>]\s*[|>]\s*[|>].*"/>
+ <RegExpr attribute="indent3" context="#stay" String="^[|>]\s*[|>]\s*[|>].*"/>
+ <RegExpr attribute="indent2" context="#stay" String="^[|>]\s*[|>].*"/>
+ <RegExpr attribute="indent1" context="#stay" String="^[|>].*"/>
+
+ <RegExpr attribute="base64" context="#stay" String="^([A-Za-z0-9+/][A-Za-z0-9+/][A-Za-z0-9+/][A-Za-z0-9+/]){10,20}$"/>
+ <RegExpr attribute="base64" context="#stay" String="^[A-Za-z0-9+=/]+=$"/>
+
+ <RegExpr attribute="marker" context="#stay" String="^(- )?--(--.*)?"/>
+ </context>
+ </contexts>
+ <itemDatas>
+ <itemData name="Normal Text" defStyleNum="dsNormal"/>
+ <itemData name="rfc" color="darkgreen"/>
+ <itemData name="rfc-main" bold="1" color="darkgreen" defStyleNum="dsAlert"/>
+ <itemData name="common" color="gold"/>
+ <itemData name="other" color="red"/>
+ <itemData name="email" color="blue"/>
+ <itemData name="string" defStyleNum="dsString"/>
+
+ <itemData name="base64" defStyleNum="dsRegionMarker"/>
+ <itemData name="marker" defStyleNum="dsAlert"/>
+
+ <itemData name="indent1" bold="1" color="red"/>
+ <itemData name="indent2" bold="1" color="green"/>
+ <itemData name="indent3" bold="1" color="blue"/>
+ <itemData name="indent4" bold="1" color="cyan"/>
+ <itemData name="indent5" bold="1" color="magenta"/>
+ <itemData name="indent6" bold="1" color="yellow"/>
+
+
+ <itemData name="sign" defStyleNum="dsComment"/>
+ </itemDatas>
+ </highlighting>
+ <general>
+ <keywords casesensitive="0" />
+ </general>
+</language>
diff --git a/kate/data/euphoria.xml b/kate/data/euphoria.xml
new file mode 100644
index 000000000..a1ca19994
--- /dev/null
+++ b/kate/data/euphoria.xml
@@ -0,0 +1,376 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+<!--
+
+ This file is part of KDE's kate project.
+
+ copyright : (C) 2004 by Irv Mullins
+ email : irvm at ellijay dot com
+
+ last change : 2004-04-24
+
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the
+ Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+
+-->
+
+<!-- Store this in /usr/share/apps/katepart/syntax -->
+
+<language name="Euphoria" version="2.08" kateversion="2.4" section="Scripts" extensions="*.e;*.ex;*.exw;*.exu" mimetype="text/x-euphoria" author="Irv Mullins (irvm@ellijay.com)" license="LGPL">
+ <highlighting>
+ <list name="keywords">
+ <item> abort </item>
+ <item> allocate </item>
+ <item> allocate_string </item>
+ <item> allow_break </item>
+ <item> and </item>
+ <item> and_bits </item>
+ <item> append </item>
+ <item> arccos </item>
+ <item> arcsin </item>
+ <item> arctan </item>
+ <item> atom_to_float32 </item>
+ <item> atom_to_float64 </item>
+ <item> as </item>
+ <item> begin </item>
+ <item> bits_to_int </item>
+ <item> bytes_to_int </item>
+ <item> c_func </item>
+ <item> c_proc </item>
+ <item> call </item>
+ <item> call_back </item>
+ <item> call_func </item>
+ <item> call_proc </item>
+ <item> check_break </item>
+ <item> chdir </item>
+ <item> clear_screen </item>
+ <item> close </item>
+ <item> command_line </item>
+ <item> compare </item>
+ <item> cos </item>
+ <item> crash_file </item>
+ <item> crash_message </item>
+ <item> current_dir </item>
+ <item> custom_sort </item>
+ <item> date </item>
+ <item> define_c_func </item>
+ <item> define_c_proc </item>
+ <item> define_c_var </item>
+ <item> dir </item>
+ <item> display_text_image </item>
+ <item> do </item>
+ <item> else </item>
+ <item> elsif </item>
+ <item> end </item>
+ <item> equal </item>
+ <item> exit </item>
+ <item> find </item>
+ <item> float32_to_atom </item>
+ <item> float64_to_atom </item>
+ <item> floor </item>
+ <item> flush </item>
+ <item> for </item>
+ <item> free </item>
+ <item> free_console </item>
+ <item> function </item>
+ <item> get_bytes </item>
+ <item> get_key </item>
+ <item> get_mouse </item>
+ <item> get_position </item>
+ <item> get_screen_char </item>
+ <item> getc </item>
+ <item> getenv </item>
+ <item> gets </item>
+ <item> if </item>
+ <item> include </item>
+ <item> int_to_bits </item>
+ <item> int_to_bytes </item>
+ <item> length </item>
+ <item> lock_file </item>
+ <item> log </item>
+ <item> lower </item>
+ <item> machine_func </item>
+ <item> machine_proc </item>
+ <item> match </item>
+ <item> mem_copy </item>
+ <item> mem_set </item>
+ <item> mouse_events </item>
+ <item> mouse_pointer </item>
+ <item> not </item>
+ <item> not_bits </item>
+ <item> of </item>
+ <item> open </item>
+ <item> open_dll </item>
+ <item> or </item>
+ <item> or_bits </item>
+ <item> peek </item>
+ <item> peek4 </item>
+ <item> peek4s </item>
+ <item> peek4u </item>
+ <item> platform </item>
+ <item> poke </item>
+ <item> poke4 </item>
+ <item> position </item>
+ <item> power </item>
+ <item> prepend </item>
+ <item> print </item>
+ <item> printf </item>
+ <item> procedure </item>
+ <item> profile </item>
+ <item> prompt_number </item>
+ <item> prompt_string </item>
+ <item> put_screen_char </item>
+ <item> puts </item>
+ <item> rand </item>
+ <item> read_bitmap </item>
+ <item> register_block </item>
+ <item> remainder </item>
+ <item> repeat </item>
+ <item> return </item>
+ <item> reverse </item>
+ <item> routine_id </item>
+ <item> save_bitmap </item>
+ <item> save_text_image </item>
+ <item> scroll </item>
+ <item> seek </item>
+ <item> set_rand </item>
+ <item> sin </item>
+ <item> sleep </item>
+ <item> sort </item>
+ <item> sprint </item>
+ <item> sprintf </item>
+ <item> sqrt </item>
+ <item> system </item>
+ <item> system_exec </item>
+ <item> tan </item>
+ <item> text_color </item>
+ <item> then </item>
+ <item> time </item>
+ <item> to </item>
+ <item> trace </item>
+ <item> type </item>
+ <item> unlock_file </item>
+ <item> unregister_block </item>
+ <item> upper </item>
+ <item> value </item>
+ <item> video_config </item>
+ <item> wait_key </item>
+ <item> walk_dir </item>
+ <item> where </item>
+ <item> while </item>
+ <item> wildcard_file </item>
+ <item> wildcard_match </item>
+ <item> with </item>
+ <item> without </item>
+ <item> wrap </item>
+ <item> xor </item>
+ <item> xor_bits </item>
+ <item> ? </item>
+ </list>
+
+ <list name="types">
+ <item> atom </item>
+ <item> constant </item>
+ <item> global </item>
+ <item> integer </item>
+ <item> object </item>
+ <item> sequence </item>
+ <item> type </item>
+ </list>
+
+ <list name="constants">
+ <item> PI </item>
+ <item> GET_SUCCESS </item>
+ </list>
+
+ <list name="GtkKeywords">
+ <item> addto </item>
+ <item> adjustment </item>
+ <item> alignment </item>
+ <item> appendto </item>
+ <item> append_page </item>
+ <item> arrow </item>
+ <item> aspect_frame </item>
+ <item> button </item>
+ <item> calendar </item>
+ <item> cell_renderer_text </item>
+ <item> cell_renderer_toggle </item>
+ <item> check </item>
+ <item> checkbutton </item>
+ <item> check_menu_item </item>
+ <item> choice </item>
+ <item> combo </item>
+ <item> connect </item>
+ <item> drawingarea </item>
+ <item> draw_arc </item>
+ <item> draw_image </item>
+ <item> draw_line </item>
+ <item> draw_polygon </item>
+ <item> draw_point </item>
+ <item> draw_rectangle </item>
+ <item> end_submenu </item>
+ <item> entry </item>
+ <item> euget </item>
+ <item> event_box </item>
+ <item> flatten </item>
+ <item> font </item>
+ <item> frame </item>
+ <item> get </item>
+ <item> getImage </item>
+ <item> getSize </item>
+ <item> g_list </item>
+ <item> g_list_to_sequence </item>
+ <item> deallocate_strings </item>
+ <item> draw_line </item>
+ <item> hbox </item>
+ <item> hbuttonbox </item>
+ <item> hpaned </item>
+ <item> hscrollbar </item>
+ <item> hseparator </item>
+ <item> hscale </item>
+ <item> idle_add </item>
+ <item> image </item>
+ <item> image_menu_item </item>
+ <item> init </item>
+ <item> label </item>
+ <item> limit </item>
+ <item> list_store </item>
+ <item> list_view </item>
+ <item> list_view_column </item>
+ <item> main </item>
+ <item> mark_day </item>
+ <item> menu </item>
+ <item> menubar </item>
+ <item> menu_item </item>
+ <item> mouse_button </item>
+ <item> new_gc </item>
+ <item> new_group </item>
+ <item> new_menu_group </item>
+ <item> notebook </item>
+ <item> option </item>
+ <item> option_menu </item>
+ <item> pack </item>
+ <item> path </item>
+ <item> pop </item>
+ <item> progress_bar </item>
+ <item> push </item>
+ <item> quit </item>
+ <item> radio </item>
+ <item> radiobutton </item>
+ <item> radio_menu_item </item>
+ <item> rc_parse </item>
+ <item> run </item>
+ <item> separator_menu_item </item>
+ <item> set </item>
+ <item> set_submenu </item>
+ <item> str </item>
+ <item> scrolled_window </item>
+ <item> seq_to_str </item>
+ <item> setfg </item>
+ <item> setProperty </item>
+ <item> show </item>
+ <item> spinbutton </item>
+ <item> statusbar </item>
+ <item> table </item>
+ <item> textbox </item>
+ <item> timer </item>
+ <item> togglebutton </item>
+ <item> toolbar </item>
+ <item> tooltip </item>
+ <item> tree_store </item>
+ <item> tree_view </item>
+ <item> tree_view_column </item>
+ <item> vbox </item>
+ <item> vbuttonbox </item>
+ <item> vpaned </item>
+ <item> vscale </item>
+ <item> vscrollbar </item>
+ <item> vseparator </item>
+ <item> when </item>
+ <item> window </item>
+ <item> NULL </item>
+ <item> TRUE </item>
+ <item> FALSE </item>
+ <item> color_selection </item>
+ <item> file_selection </item>
+ <item> font_selection_dialog </item>
+ <item> Error </item>
+ <item> Info </item>
+ <item> Question </item>
+ <item> Warn </item>
+ <item> YesNo </item>
+ </list>
+
+ <contexts>
+ <context attribute="Normal Text" lineEndContext="#stay" name="Normal">
+ <RegExpr attribute="Keyword" context="#stay" String="\bend\s+for\b" endRegion="regFor"/>
+ <RegExpr attribute="Keyword" context="#stay" String="\bfor\b" beginRegion="regFor"/>
+
+ <RegExpr attribute="Keyword" context="#stay" String="\bend\s+if\b" endRegion="regIf"/>
+ <RegExpr attribute="Keyword" context="#stay" String="\bif\b" beginRegion="regIf"/>
+
+ <RegExpr attribute="Keyword" context="#stay" String="\bend\s+function\b" endRegion="regFunction"/>
+ <RegExpr attribute="Keyword" context="#stay" String="\bfunction\b" beginRegion="regFunction"/>
+
+ <RegExpr attribute="Keyword" context="#stay" String="\bend\s+procedure\b" endRegion="regProcedure"/>
+ <RegExpr attribute="Keyword" context="#stay" String="\bprocedure\b" beginRegion="regProcedure"/>
+
+ <RegExpr attribute="Keyword" context="#stay" String="\bend\s+while\b" endRegion="regWhile"/>
+ <RegExpr attribute="Keyword" context="#stay" String="\bwhile\b" beginRegion="regWhile"/>
+
+ <RegExpr attribute="Keyword" context="#stay" String="\bend\s+type\b" endRegion="regType"/>
+ <RegExpr attribute="Keyword" context="#stay" String="\btype\b" beginRegion="regType"/>
+
+ <keyword attribute="Keyword" context="#stay" String="keywords"/>
+ <keyword attribute="GtkKeyword" context="#stay" String="GtkKeywords"/>
+ <keyword attribute="Type" context="#stay" String="types"/>
+ <Float attribute="Number" context="#stay"/>
+ <Int attribute="Number" context="#stay"/>
+ <DetectChar attribute="String" context="String" char="&quot;" />
+ <RegExpr attribute="Region Marker" context="#stay" String="--\s*BEGIN.*" beginRegion="regMarker" firstNonSpace="true"/>
+ <RegExpr attribute="Region Marker" context="#stay" String="--\s*END.*" endRegion="regMarker" firstNonSpace="true"/>
+ <Detect2Chars attribute="Comment" context="Comment" char="-" char1="-"/>
+ </context>
+
+ <context attribute="String" lineEndContext="#pop" name="String">
+ <DetectChar attribute="String" context="#pop" char="&quot;"/>
+ </context>
+
+ <context attribute="Comment" lineEndContext="#pop" name="Comment">
+ <keyword attribute="Number" context="#stay" String="attention" />
+ </context>
+ </contexts>
+
+ <itemDatas>
+ <itemData name="Normal Text" defStyleNum="dsNormal" />
+ <itemData name="Keyword" defStyleNum="dsKeyword" />
+ <itemData name="GtkKeyword" defStyleNum="dsKeyword" />
+ <itemData name="Type" defStyleNum="dsDataType"/>
+ <itemData name="Number" defStyleNum="dsDecVal" />
+ <itemData name="String" defStyleNum="dsString" />
+ <itemData name="Directive" defStyleNum="dsOthers" />
+ <itemData name="Comment" defStyleNum="dsComment" />
+ <itemData name="Region Marker" defStyleNum="dsRegionMarker" />
+ </itemDatas>
+
+ </highlighting>
+ <general>
+ <keywords casesensitive="1" />
+ <comments>
+ <comment name="singleLine" start="--" />
+ </comments>
+ </general>
+</language>
diff --git a/kate/data/ferite.xml b/kate/data/ferite.xml
new file mode 100644
index 000000000..7d1548275
--- /dev/null
+++ b/kate/data/ferite.xml
@@ -0,0 +1,117 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+<language name="ferite" version="1.04" kateversion="2.4" section="Scripts" extensions="*.fe;*.feh" mimetype="text/x-ferite-src">
+ <highlighting>
+ <list name="keywords">
+ <item> break </item>
+ <item> case </item>
+ <item> continue </item>
+ <item> else </item>
+ <item> for </item>
+ <item> if </item>
+ <item> do </item>
+ <item> function </item>
+ <item> namespace </item>
+ <item> while </item>
+ <item> class </item>
+ <item> new </item>
+ <item> uses </item>
+ <item> global </item>
+ <item> return </item>
+ <item> self </item>
+ <item> super </item>
+ <item> null </item>
+ <item> iferr </item>
+ <item> fix </item>
+ </list>
+ <list name="types">
+ <item> number </item>
+ <item> void </item>
+ <item> string </item>
+ <item> array </item>
+ <item> object </item>
+ <item> final </item>
+ <item> static </item>
+ </list>
+ <contexts>
+ <context attribute="Normal Text" lineEndContext="#stay" name="Default" >
+ <keyword attribute="Keyword" context="#stay" String="keywords"/>
+ <keyword attribute="Data Type" context="#stay" String="types"/>
+ <Float attribute="Float" context="#stay">
+ <AnyChar String="fF" attribute="Float" context="#stay"/>
+ </Float>
+ <HlCOct attribute="Octal" context="#stay" />
+ <HlCHex attribute="Hex" context="#stay" />
+ <Int attribute="Decimal" context="#stay" >
+ <StringDetect attribute="Decimal" context="#stay" String="ULL" insensitive="TRUE"/>
+ <StringDetect attribute="Decimal" context="#stay" String="LUL" insensitive="TRUE"/>
+ <StringDetect attribute="Decimal" context="#stay" String="LLU" insensitive="TRUE"/>
+ <StringDetect attribute="Decimal" context="#stay" String="UL" insensitive="TRUE"/>
+ <StringDetect attribute="Decimal" context="#stay" String="LU" insensitive="TRUE"/>
+ <StringDetect attribute="Decimal" context="#stay" String="LL" insensitive="TRUE"/>
+ <StringDetect attribute="Decimal" context="#stay" String="U" insensitive="TRUE"/>
+ <StringDetect attribute="Decimal" context="#stay" String="L" insensitive="TRUE"/>
+ </Int>
+ <HlCChar attribute="Char" context="#stay"/>
+ <DetectChar attribute="String" context="String" char="&quot;"/>
+ <Detect2Chars attribute="Comment" context="Comment" char="/" char1="/"/>
+ <Detect2Chars attribute="Comment" context="Multiline Comment" char="/" char1="*"/>
+ <AnyChar attribute="Symbol" context="#stay" String="!%&amp;()+,-&lt;=&gt;?[]^{|}~"/>
+ <StringDetect attribute="Comment" context="Undeffed" String="#if 0" insensitive="FALSE"/>
+ <DetectChar attribute="Preprocessor" context="Preprocessor" char="#" column="0"/>
+ </context>
+ <context attribute="String" lineEndContext="#pop" name="String">
+ <LineContinue attribute="String" context="#stay"/>
+ <HlCStringChar attribute="String Char" context="#stay"/>
+ <DetectChar attribute="String" context="#pop" char="&quot;"/>
+ </context>
+ <context attribute="Comment" lineEndContext="#pop" name="Comment">
+ <RegExpr attribute="Alert" context="#stay" String="(FIXME|TODO)" />
+ </context>
+ <context attribute="Comment" lineEndContext="#stay" name="Multiline Comment">
+ <Detect2Chars attribute="Comment" context="#pop" char="*" char1="/"/>
+ <RegExpr attribute="Alert" context="#stay" String="(FIXME|TODO)" />
+ </context>
+ <context attribute="Preprocessor" lineEndContext="#pop" name="Preprocessor">
+ <LineContinue attribute="Preprocessor" context="#stay"/>
+ <RangeDetect attribute="Prep. Lib" context="#stay" char="&quot;" char1="&quot;"/>
+ <RangeDetect attribute="Prep. Lib" context="#stay" char="&lt;" char1="&gt;"/>
+ <Detect2Chars attribute="Comment" context="Comment" char="/" char1="/"/>
+ <Detect2Chars attribute="Comment" context="Multiline Comment 2" char="/" char1="*"/>
+ </context>
+ <context attribute="Comment" lineEndContext="#stay" name="Multiline Comment 2">
+ <Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" />
+ </context>
+ <context attribute="Normal Text" lineEndContext="#pop" name="unknown" />
+ <context attribute="Normal Text" lineEndContext="#pop" name ="unknown 2" />
+ <context attribute="Comment" lineEndContext="#stay" name="Undeffed">
+ <RegExpr attribute="Alert" context="#stay" String="(FIXME|TODO)" />
+ <StringDetect attribute="Comment" context="#pop" String="#endif" column="0"/>
+ </context>
+ </contexts>
+ <itemDatas>
+ <itemData name="Normal Text" defStyleNum="dsNormal"/>
+ <itemData name="Keyword" defStyleNum="dsKeyword"/>
+ <itemData name="Data Type" defStyleNum="dsDataType"/>
+ <itemData name="Decimal" defStyleNum="dsDecVal"/>
+ <itemData name="Octal" defStyleNum="dsBaseN"/>
+ <itemData name="Hex" defStyleNum="dsBaseN"/>
+ <itemData name="Float" defStyleNum="dsFloat"/>
+ <itemData name="Char" defStyleNum="dsChar"/>
+ <itemData name="String" defStyleNum="dsString"/>
+ <itemData name="String Char" defStyleNum="dsChar"/>
+ <itemData name="Comment" defStyleNum="dsComment"/>
+ <itemData name="Symbol" defStyleNum="dsNormal"/>
+ <itemData name="Preprocessor" defStyleNum="dsOthers"/>
+ <itemData name="Prep. Lib" defStyleNum="dsOthers"/>
+ <itemData name="Alert" defStyleNum="dsAlert" />
+ </itemDatas>
+ </highlighting>
+ <general>
+ <comments>
+ <comment name="singleLine" start="//" />
+ <comment name="multiLine" start="/*" end="*/" />
+ </comments>
+ <keywords casesensitive="1" />
+ </general>
+</language>
diff --git a/kate/data/fgl-4gl.xml b/kate/data/fgl-4gl.xml
new file mode 100644
index 000000000..2acbe8ff2
--- /dev/null
+++ b/kate/data/fgl-4gl.xml
@@ -0,0 +1,363 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+<language name="4GL" version="1.02" kateversion="2.5" section="Database" extensions="*.4gl;*.4GL;*.err" mimetype="text/x-4glsrc;text/x-4glerr" author="Andrej Falout (andrej@falout.org)" license="LGPL">
+ <highlighting>
+ <list name="keywords">
+ <item> at </item>
+ <item> by </item>
+ <item> go </item>
+ <item> if </item>
+ <item> in </item>
+ <item> is </item>
+ <item> no </item>
+ <item> of </item>
+ <item> on </item>
+ <item> or </item>
+ <item> to </item>
+ <item> up </item>
+
+ <item> add </item>
+ <item> ALL </item>
+ <item> and </item>
+ <item> ANY </item>
+ <item> avg </item>
+ <item> day </item>
+ <item> end </item>
+ <item> ESC </item>
+ <item> for </item>
+ <item> key </item>
+ <item> let </item>
+ <item> log </item>
+ <item> max </item>
+ <item> mdy </item>
+ <item> min </item>
+ <item> not </item>
+ <item> put </item>
+ <item> red </item>
+ <item> row </item>
+ <item> run </item>
+ <item> set </item>
+ <item> sum </item>
+ <item> top </item>
+
+ <item> blue </item>
+ <item> BOLD </item>
+ <item> call </item>
+ <item> case </item>
+ <item> cyan </item>
+ <item> desc </item>
+ <item> DROP </item>
+ <item> else </item>
+ <item> exit </item>
+ <item> file </item>
+ <item> form </item>
+ <item> FREE </item>
+ <item> from </item>
+ <item> goto </item>
+ <item> help </item>
+ <item> HIDE </item>
+ <item> HOLD </item>
+ <item> HOUR </item>
+ <item> into </item>
+ <item> last </item>
+ <item> left </item>
+ <item> like </item>
+ <item> line </item>
+ <item> load </item>
+ <item> LOCK </item>
+ <item> main </item>
+ <item> menu </item>
+ <item> MODE </item>
+ <item> name </item>
+ <item> NEED </item>
+ <item> next </item>
+ <item> null </item>
+ <item> open </item>
+ <item> page </item>
+ <item> PIPE </item>
+ <item> quit </item>
+ <item> READ </item>
+ <item> rows </item>
+ <item> show </item>
+ <item> skip </item>
+ <item> sort </item>
+ <item> STEP </item>
+ <item> STOP </item>
+ <item> TEMP </item>
+ <item> text </item>
+ <item> then </item>
+ <item> thru </item>
+ <item> true </item>
+ <item> user </item>
+ <item> WAIT </item>
+ <item> when </item>
+ <item> with </item>
+ <item> WORK </item>
+ <item> WRAP </item>
+ <item> year </item>
+
+ <item> after </item>
+ <item> alter </item>
+ <item> ascii </item>
+ <item> BEGIN </item>
+ <item> blink </item>
+ <item> clear </item>
+ <item> close </item>
+ <item> count </item>
+ <item> DEFER </item>
+ <item> DIRTY </item>
+ <item> error </item>
+ <item> every </item>
+ <item> false </item>
+ <item> fetch </item>
+ <item> field </item>
+ <item> first </item>
+ <item> flush </item>
+ <item> green </item>
+ <item> GROUP </item>
+ <item> index </item>
+ <item> input </item>
+ <item> label </item>
+ <item> lines </item>
+ <item> month </item>
+ <item> order </item>
+ <item> outer </item>
+ <item> pause </item>
+ <item> print </item>
+ <item> right </item>
+ <item> share </item>
+ <item> sleep </item>
+ <item> space </item>
+ <item> start </item>
+ <item> TABLE </item>
+ <item> today </item>
+ <item> union </item>
+ <item> UNITS </item>
+ <item> using </item>
+ <item> where </item>
+ <item> WHILE </item>
+ <item> white </item>
+
+ <item> ACCEPT </item>
+ <item> before </item>
+ <item> border </item>
+ <item> bottom </item>
+ <item> column </item>
+ <item> commit </item>
+ <item> create </item>
+ <item> cursor </item>
+ <item> define </item>
+ <item> delete </item>
+ <item> enable </item>
+ <item> ESCAPE </item>
+ <item> exists </item>
+ <item> finish </item>
+ <item> format </item>
+ <item> HAVING </item>
+ <item> header </item>
+ <item> insert </item>
+ <item> length </item>
+ <item> locate </item>
+ <item> margin </item>
+ <item> MINUTE </item>
+ <item> MODIFY </item>
+ <item> normal </item>
+ <item> option </item>
+ <item> output </item>
+ <item> PAGENO </item>
+ <item> prompt </item>
+ <item> record </item>
+ <item> report </item>
+ <item> return </item>
+ <item> revoke </item>
+ <item> SCREEN </item>
+ <item> scroll </item>
+ <item> SECOND </item>
+ <item> select </item>
+ <item> spaces </item>
+ <item> status </item>
+ <item> UNIQUE </item>
+ <item> UNLOAD </item>
+ <item> update </item>
+ <item> values </item>
+ <item> window </item>
+ <item> yellow </item>
+
+ <item> between </item>
+ <item> clipped </item>
+ <item> cluster </item>
+ <item> columns </item>
+ <item> command </item>
+ <item> comment </item>
+ <item> connect </item>
+ <item> CURRENT </item>
+ <item> declare </item>
+ <item> display </item>
+ <item> execute </item>
+ <item> foreach </item>
+ <item> globals </item>
+ <item> infield </item>
+ <item> MAGENTA </item>
+ <item> matches </item>
+ <item> message </item>
+ <item> options </item>
+ <item> prepare </item>
+ <item> printer </item>
+ <item> program </item>
+ <item> reverse </item>
+ <item> trailer </item>
+ <item> upshift </item>
+ <item> waiting </item>
+ <item> without </item>
+
+ <item> ABSOLUTE </item>
+ <item> continue </item>
+ <item> database </item>
+ <item> defaults </item>
+ <item> DISTINCT </item>
+ <item> EXTERNAL </item>
+ <item> function </item>
+ <item> INT_FLAG </item>
+ <item> NOTFOUND </item>
+ <item> previous </item>
+ <item> ROLLBACK </item>
+ <item> whenever </item>
+ <item> wordwrap </item>
+
+ <item> attribute </item>
+ <item> committed </item>
+ <item> construct </item>
+ <item> delimiter </item>
+ <item> downshift </item>
+ <item> exclusive </item>
+ <item> INTERRUPT </item>
+ <item> ISOLATION </item>
+ <item> otherwise </item>
+ <item> quit_flag </item>
+ <item> returning </item>
+
+ <item> attributes </item>
+ <item> CONSTRAINT </item>
+ <item> initialize </item>
+ <item> statistics </item>
+
+ <item> fgl_lastkey </item>
+ <item> formhandler </item>
+
+ <item> fgl_lastkey() </item>
+
+
+ </list>
+ <list name="types">
+ <item> char </item>
+ <item> date </item>
+ <item> array </item>
+ <item> float </item>
+ <item> money </item>
+ <item> serial </item>
+ <item> DECIMAL </item>
+ <item> integer </item>
+ <item> NUMERIC </item>
+ <item> VARCHAR </item>
+ <item> DATETIME </item>
+ <item> FRACTION </item>
+ <item> INTERVAL </item>
+ <item> smallint </item>
+ </list>
+ <contexts>
+ <context attribute="Normal Text" lineEndContext="#stay" name="Normal Text 1">
+ <keyword attribute="Keyword" context="#stay" String="keywords"/>
+ <keyword attribute="Data Type" context="#stay" String="types"/>
+ <Float attribute="Float" context="#stay">
+ <AnyChar String="fF" attribute="Float" context="#stay"/>
+ </Float>
+ <HlCOct attribute="Octal" context="#stay"/>
+ <HlCHex attribute="Hex" context="#stay"/>
+ <Int attribute="Decimal" context="#stay" >
+ <StringDetect attribute="Decimal" context="#stay" String="ULL" insensitive="TRUE"/>
+ <StringDetect attribute="Decimal" context="#stay" String="LUL" insensitive="TRUE"/>
+ <StringDetect attribute="Decimal" context="#stay" String="LLU" insensitive="TRUE"/>
+ <StringDetect attribute="Decimal" context="#stay" String="UL" insensitive="TRUE"/>
+ <StringDetect attribute="Decimal" context="#stay" String="LU" insensitive="TRUE"/>
+ <StringDetect attribute="Decimal" context="#stay" String="LL" insensitive="TRUE"/>
+ <StringDetect attribute="Decimal" context="#stay" String="U" insensitive="TRUE"/>
+ <StringDetect attribute="Decimal" context="#stay" String="L" insensitive="TRUE"/>
+ </Int>
+ <HlCChar attribute="Char" context="#stay"/>
+ <DetectChar attribute="String" context="String" char="&quot;"/>
+ <DetectChar attribute="Comment" context="Comment 1" char="#"/>
+ <DetectChar attribute="Comment" context="Comment 2" char="{"/>
+ <Detect2Chars attribute="Comment" context="Comment 1" char="-" char1="-"/>
+<!-- <Detect2Chars attribute="Comment" context="Comment 1" char="/" char1="/"/>
+ <Detect2Chars attribute="Comment" context="Comment 2" char="/" char1="*"/>//-->
+ <AnyChar attribute="Symbol" context="#stay" String="!%&amp;()+,-&lt;=&gt;?[]^|~"/>
+ <StringDetect attribute="Preprocessor" context="Comment 4" String="#if 0" insensitive="FALSE"/>
+ <RegExpr attribute="Preprocessor" context="Preprocessor" String="#"/>
+ </context>
+ <context attribute="String" lineEndContext="#pop" name="String">
+ <LineContinue attribute="String" context="#stay"/>
+ <HlCStringChar attribute="String Char" context="#stay"/>
+ <DetectChar attribute="String" context="#pop" char="&quot;"/>
+ </context>
+ <context attribute="Comment" lineEndContext="#pop" name="Comment 1">
+ <RegExpr attribute="Alert" context="#stay" String="(FIXME|TODO)" />
+ </context>
+ <context attribute="Comment" lineEndContext="#stay" name="Comment 2">
+ <DetectChar attribute="Comment" context="#pop" char="}"/>
+ <Detect2Chars attribute="Comment" context="#pop" char="*" char1="/"/>
+ <RegExpr attribute="Alert" context="#stay" String="(FIXME|TODO)" />
+ </context>
+ <context attribute="Preprocessor" lineEndContext="#pop" name="Preprocessor">
+ <LineContinue attribute="Preprocessor" context="#stay"/>
+ <RangeDetect attribute="Prep. Lib" context="#stay" char="&quot;" char1="&quot;"/>
+ <RangeDetect attribute="Prep. Lib" context="#stay" char="&lt;" char1="&gt;"/>
+ <DetectChar attribute="Comment" context="Comment 1" char="#"/>
+ <DetectChar attribute="Comment" context="Comment 2" char="{"/>
+ <Detect2Chars attribute="Comment" context="Comment 1" char="/" char1="/"/>
+ <Detect2Chars attribute="Comment" context="Comment 3" char="/" char1="*"/>
+ </context>
+ <context attribute="Comment" lineEndContext="#stay" name="Comment 3">
+ <DetectChar attribute="Comment" context="#pop" char="}"/>
+ <Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" />
+ </context>
+ <context attribute="Normal Text" lineEndContext="#pop" name="Normal Text 2" />
+ <context attribute="Normal Text" lineEndContext="#pop" name="Normal Text 3" />
+ <context attribute="Comment" lineEndContext="#stay" name="Comment 4">
+ <RegExpr attribute="Alert" context="#stay" String="(FIXME|TODO)" />
+ <RegExpr attribute="Comment" context="Comment 5" String="#if" />
+ <RegExpr attribute="Preprocessor" context="#pop" String="#endif" />
+ <RegExpr attribute="Preprocessor" context="#pop" String="#else" />
+ </context>
+ <context attribute="Comment" lineEndContext="#stay" name="Comment 5">
+ <RegExpr attribute="Comment" context="Comment 5" String="#if" />
+ <RegExpr attribute="Comment" context="#pop" String="#endif" />
+ </context>
+ </contexts>
+ <itemDatas>
+ <itemData name="Normal Text" defStyleNum="dsNormal"/>
+ <itemData name="Keyword" defStyleNum="dsKeyword"/>
+ <itemData name="Data Type" defStyleNum="dsDataType"/>
+ <itemData name="Decimal" defStyleNum="dsDecVal"/>
+ <itemData name="Octal" defStyleNum="dsBaseN"/>
+ <itemData name="Hex" defStyleNum="dsBaseN"/>
+ <itemData name="Float" defStyleNum="dsFloat"/>
+ <itemData name="Char" defStyleNum="dsChar"/>
+ <itemData name="String" defStyleNum="dsString"/>
+ <itemData name="String Char" defStyleNum="dsChar"/>
+ <itemData name="Comment" defStyleNum="dsComment"/>
+ <itemData name="Symbol" defStyleNum="dsNormal"/>
+ <itemData name="Preprocessor" defStyleNum="dsOthers"/>
+ <itemData name="Prep. Lib" defStyleNum="dsOthers"/> <!--,Qt::darkYellow,Qt::yellow,false,false)); -->
+ <itemData name="Alert" defStyleNum="dsAlert" />
+ </itemDatas>
+ </highlighting>
+ <general>
+ <comments>
+ <comment name="multiLine" start="{" end="}" />
+ </comments>
+ <keywords casesensitive="0" />
+ </general>
+</language>
+
+
+
diff --git a/kate/data/fgl-per.xml b/kate/data/fgl-per.xml
new file mode 100644
index 000000000..9b3461ad8
--- /dev/null
+++ b/kate/data/fgl-per.xml
@@ -0,0 +1,172 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+<language name="4GL-PER" version="1.02" kateversion="2.5" section="Database" extensions="*.per;*.PER;*.per.err" mimetype="text/x-4glper;text/x-4glpererr" author="Andrej Falout (andrej@falout.org)" license="LGPL">
+ <highlighting>
+ <list name="keywords">
+ <item> by </item>
+ <item> to </item>
+
+ <item> end </item>
+ <item> not </item>
+ <item> red </item>
+
+ <item> blue </item>
+ <item> cyan </item>
+ <item> keys </item>
+ <item> like </item>
+ <item> null </item>
+ <item> size </item>
+ <item> type </item>
+
+ <item> black </item>
+ <item> color </item>
+ <item> green </item>
+ <item> input </item>
+ <item> today </item>
+ <item> white </item>
+
+ <item> format </item>
+ <item> record </item>
+ <item> screen </item>
+ <item> tables </item>
+ <item> yellow </item>
+
+ <item> default </item>
+ <item> display </item>
+ <item> include </item>
+ <item> magenta </item>
+ <item> noentry </item>
+ <item> picture </item>
+ <item> reverse </item>
+ <item> through </item>
+ <item> UPSHIFT </item>
+ <item> without </item>
+
+ <item> autonext </item>
+ <item> comments </item>
+ <item> COMPRESS </item>
+ <item> database </item>
+ <item> formonly </item>
+ <item> noupdate </item>
+ <item> required </item>
+ <item> WORDWRAP </item>
+
+ <item> character </item>
+ <item> downshift </item>
+ <item> invisible </item>
+ <item> underline </item>
+
+ <item> attributes </item>
+ <item> delimiters </item>
+
+ <item> instructions </item>
+ </list>
+ <list name="types">
+ <item> char </item>
+ <item> date </item>
+ <item> array </item>
+ <item> float </item>
+ <item> money </item>
+ <item> serial </item>
+ <item> DECIMAL </item>
+ <item> integer </item>
+ <item> NUMERIC </item>
+ <item> VARCHAR </item>
+ <item> DATETIME </item>
+ <item> FRACTION </item>
+ <item> INTERVAL </item>
+ <item> smallint </item>
+ </list>
+ <contexts>
+ <context attribute="Normal Text" lineEndContext="#stay" name="Normal Text 1">
+ <keyword attribute="Keyword" context="#stay" String="keywords"/>
+ <keyword attribute="Data Type" context="#stay" String="types"/>
+ <Float attribute="Float" context="#stay">
+ <AnyChar String="fF" attribute="Float" context="#stay"/>
+ </Float>
+ <HlCOct attribute="Octal" context="#stay"/>
+ <HlCHex attribute="Hex" context="#stay"/>
+ <Int attribute="Decimal" context="#stay" >
+ <StringDetect attribute="Decimal" context="#stay" String="ULL" insensitive="TRUE"/>
+ <StringDetect attribute="Decimal" context="#stay" String="LUL" insensitive="TRUE"/>
+ <StringDetect attribute="Decimal" context="#stay" String="LLU" insensitive="TRUE"/>
+ <StringDetect attribute="Decimal" context="#stay" String="UL" insensitive="TRUE"/>
+ <StringDetect attribute="Decimal" context="#stay" String="LU" insensitive="TRUE"/>
+ <StringDetect attribute="Decimal" context="#stay" String="LL" insensitive="TRUE"/>
+ <StringDetect attribute="Decimal" context="#stay" String="U" insensitive="TRUE"/>
+ <StringDetect attribute="Decimal" context="#stay" String="L" insensitive="TRUE"/>
+ </Int>
+ <HlCChar attribute="Char" context="#stay"/>
+ <DetectChar attribute="String" context="String" char="&quot;"/>
+ <DetectChar attribute="Comment" context="Comment 1" char="#"/>
+ <DetectChar attribute="Comment" context="Comment 2" char="{"/>
+ <Detect2Chars attribute="Comment" context="Comment 1" char="/" char1="/"/>
+ <Detect2Chars attribute="Comment" context="Comment 2" char="/" char1="*"/>
+ <AnyChar attribute="Symbol" context="#stay" String="!%&amp;()+,-&lt;=&gt;?[]^|~"/>
+ <StringDetect attribute="Preprocessor" context="Comment 4" String="#if 0" insensitive="FALSE"/>
+ <RegExpr attribute="Preprocessor" context="Preprocessor" String="#"/>
+ </context>
+ <context attribute="String" lineEndContext="#pop" name="String">
+ <LineContinue attribute="String" context="#stay"/>
+ <HlCStringChar attribute="String Char" context="#stay"/>
+ <DetectChar attribute="String" context="#pop" char="&quot;"/>
+ </context>
+ <context attribute="Comment" lineEndContext="#pop" name="Comment 1">
+ <RegExpr attribute="Alert" context="#stay" String="(FIXME|TODO)" />
+ </context>
+ <context attribute="Comment" lineEndContext="#stay" name="Comment 2">
+ <DetectChar attribute="Comment" context="#pop" char="}"/>
+ <Detect2Chars attribute="Comment" context="#pop" char="*" char1="/"/>
+ <RegExpr attribute="Alert" context="#stay" String="(FIXME|TODO)" />
+ </context>
+ <context attribute="Preprocessor" lineEndContext="#pop" name="Preprocessor">
+ <LineContinue attribute="Preprocessor" context="#stay"/>
+ <RangeDetect attribute="Prep. Lib" context="#stay" char="&quot;" char1="&quot;"/>
+ <RangeDetect attribute="Prep. Lib" context="#stay" char="&lt;" char1="&gt;"/>
+ <DetectChar attribute="Comment" context="Comment 1" char="#"/>
+ <DetectChar attribute="Comment" context="Comment 2" char="{"/>
+ <Detect2Chars attribute="Comment" context="Comment 1" char="/" char1="/"/>
+ <Detect2Chars attribute="Comment" context="Comment 3" char="/" char1="*"/>
+ </context>
+ <context attribute="Comment" lineEndContext="#stay" name="Comment 3">
+ <DetectChar attribute="Comment" context="#pop" char="}"/>
+ <Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" />
+ </context>
+ <context attribute="Normal Text" lineEndContext="#pop" name="Normal Text 2" />
+ <context attribute="Normal Text" lineEndContext="#pop" name="Normal Text 3" />
+ <context attribute="Comment" lineEndContext="#stay" name="Comment 4">
+ <RegExpr attribute="Alert" context="#stay" String="(FIXME|TODO)" />
+ <RegExpr attribute="Comment" context="Comment 5" String="#if" />
+ <RegExpr attribute="Preprocessor" context="#pop" String="#endif" />
+ <RegExpr attribute="Preprocessor" context="#pop" String="#else" />
+ </context>
+ <context attribute="Comment" lineEndContext="#stay" name="Comment 5">
+ <RegExpr attribute="Comment" context="Comment 5" String="#if" />
+ <RegExpr attribute="Comment" context="#pop" String="#endif" />
+ </context>
+ </contexts>
+ <itemDatas>
+ <itemData name="Normal Text" defStyleNum="dsNormal"/>
+ <itemData name="Keyword" defStyleNum="dsKeyword"/>
+ <itemData name="Data Type" defStyleNum="dsDataType"/>
+ <itemData name="Decimal" defStyleNum="dsDecVal"/>
+ <itemData name="Octal" defStyleNum="dsBaseN"/>
+ <itemData name="Hex" defStyleNum="dsBaseN"/>
+ <itemData name="Float" defStyleNum="dsFloat"/>
+ <itemData name="Char" defStyleNum="dsChar"/>
+ <itemData name="String" defStyleNum="dsString"/>
+ <itemData name="String Char" defStyleNum="dsChar"/>
+ <itemData name="Comment" defStyleNum="dsComment"/>
+ <itemData name="Symbol" defStyleNum="dsNormal"/>
+ <itemData name="Preprocessor" defStyleNum="dsOthers"/>
+ <itemData name="Prep. Lib" defStyleNum="dsOthers"/> <!--,Qt::darkYellow,Qt::yellow,false,false)); -->
+ <itemData name="Alert" defStyleNum="dsAlert" />
+ </itemDatas>
+ </highlighting>
+ <general>
+ <comments>
+ <comment name="multiLine" start="{" end="}" />
+ </comments>
+ <keywords casesensitive="0" />
+ </general>
+</language>
diff --git a/kate/data/fortran.xml b/kate/data/fortran.xml
new file mode 100644
index 000000000..948267fc9
--- /dev/null
+++ b/kate/data/fortran.xml
@@ -0,0 +1,569 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+<language name="Fortran" version="1.11" kateversion="2.4" section="Sources" extensions="*.f;*.F;*.for;*.FOR;*.f90;*.F90;*.fpp;*.FPP;*.f95;*.F95;" mimetype="text/x-fortran-src" casesensitive="0" author="Franchin Matteo (fnch@libero.it)" license="LGPL">
+<!-- by Franchin Matteo, fnch@libero.it -->
+ <highlighting>
+
+<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->
+<!-- * L I S T S * -->
+<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->
+ <list name="keywords">
+ <item> allocate </item>
+ <item> break </item>
+ <item> call </item>
+ <item> case </item>
+ <item> common </item>
+ <item> contains </item>
+ <item> continue </item>
+ <item> cycle </item>
+ <item> deallocate </item>
+ <item> default </item>
+ <item> do </item>
+ <item> forall </item>
+ <item> where </item>
+ <item> elsewhere </item>
+ <item> elseif </item>
+ <item> else </item>
+ <item> equivalence </item>
+ <item> exit </item>
+ <item> external </item>
+ <item> for </item>
+ <item> go </item>
+ <item> goto </item>
+ <item> if </item>
+ <item> implicit </item>
+ <item> include </item>
+ <item> interface </item>
+ <item> intrinsic </item>
+ <item> namelist </item>
+ <item> none </item>
+ <item> nullify </item>
+ <item> operator </item>
+ <item> assignment </item>
+ <item> pause </item>
+ <item> procedure </item>
+ <item> pure </item>
+ <item> elemental </item>
+ <item> record </item>
+ <item> recursive </item>
+ <item> result </item>
+ <item> return </item>
+ <item> select </item>
+ <item> selectcase </item>
+ <item> stop </item>
+ <item> then </item>
+ <item> to </item>
+ <item> use </item>
+ <item> only </item>
+ <item> entry </item>
+ <item> while </item>
+ </list>
+ <list name="io_functions">
+ <item> access </item>
+ <item> backspace </item>
+ <item> close </item>
+ <item> inquire </item>
+ <item> open </item>
+ <item> print </item>
+ <item> read </item>
+ <item> rewind </item>
+ <item> write </item>
+ <item> format </item>
+ </list>
+ <!-- Keywords inside read(...), write(...), backspace(...),
+ rewind(...), endfile(...), close(...) -->
+ <list name="io_keywords">
+ <item> unit </item>
+ <item> end </item>
+ <item> err </item>
+ <item> fmt </item>
+ <item> iostat </item>
+ <item> status </item>
+ <item> advance </item>
+ <item> size </item>
+ <item> eor </item>
+ </list>
+ <!-- Keywords inside open(...) -->
+ <list name="open_keywords">
+ <item> unit </item>
+ <item> iostat </item>
+ <item> err </item>
+ <item> file </item>
+ <item> status </item>
+ <item> access </item>
+ <item> form </item>
+ <item> recl </item>
+ <item> blank </item>
+ <item> position </item>
+ <item> action </item>
+ <item> delim </item>
+ <item> pad </item>
+ </list>
+ <!-- Keywords inside inquire(...) -->
+ <list name="inquire_keywords">
+ <item> unit </item>
+ <item> iostat </item>
+ <item> err </item>
+ <item> file </item>
+ <item> exist </item>
+ <item> opened </item>
+ <item> number </item>
+ <item> named </item>
+ <item> name </item>
+ <item> access </item>
+ <item> sequential </item>
+ <item> direct </item>
+ <item> form </item>
+ <item> formatted </item>
+ <item> unformatted </item>
+ <item> recl </item>
+ <item> nextrec </item>
+ <item> blank </item>
+ <item> position </item>
+ <item> action </item>
+ <item> read </item>
+ <item> write </item>
+ <item> readwrite </item>
+ <item> delim </item>
+ <item> pad </item>
+ </list>
+ <list name="types">
+ <item> double </item>
+ <item> precision </item>
+ <item> parameter </item>
+ <item> save </item>
+ <item> pointer </item>
+ <item> public </item>
+ <item> private </item>
+ <item> target </item>
+ <item> allocatable </item>
+ <item> optional </item>
+ <item> sequence </item>
+ </list>
+
+<!-- There are 4 types of intrinsic procedures in Fortran 90:
+ 1) Elemental procedures (elemental_procs);
+ 2) Inquiry functions (inquiry_fn);
+ 3) Transformational functions (transform_fn);
+ 4) Non elemental subroutines (non_elem_subr);
+ Often mathematical functions have one generic form and many specific names!
+ If you use the generic form, the compiler will select the right function
+ to use depending on the type of the arguments.
+ But you can use also the specific names!
+ -->
+
+<!-- E L E M E N T A L P R O C E D U R E S -->
+ <list name="elemental_procs">
+ <!-- Elemental functions that may convert -->
+ <item> abs </item> <!-- Generic form: abs -->
+ <item> cabs </item> <!-- Specific names for abs -->
+ <item> dabs </item>
+ <item> iabs </item>
+ <item> aimag </item>
+ <item> aint </item> <!-- Generic form: aint -->
+ <item> dint </item> <!-- Specific name for aint -->
+ <item> anint </item> <!-- Generic form: anint -->
+ <item> dnint </item> <!-- Specific name for anint -->
+ <item> ceiling </item>
+ <item> cmplx </item>
+ <item> dcmplx </item> <!-- (non standard) -->
+ <item> dimag </item> <!-- (non standard) -->
+ <item> floor </item>
+ <item> nint </item> <!-- Generic form: nint -->
+ <item> idnint </item><!-- Specific name for nint -->
+ <item> int </item> <!-- Generic form: int -->
+ <item> idint </item> <!-- Specific names for int -->
+ <item> ifix </item>
+ <item> real </item> <!-- Generic form: real -->
+ <item> float </item> <!-- Specific names for real -->
+ <item> sngl </item>
+ <item> dble </item>
+ <item> dreal </item> <!-- (non standard) -->
+ <item> aprime </item> <!-- 5 functions from fortran.xml -->
+ <item> dconjg </item> <!-- I don't know if they really belong to -->
+ <item> dfloat </item> <!-- the fortran 90/95 standard! -->
+ <item> ddmim </item>
+ <item> rand </item>
+ <!-- Elemental functions that do not convert -->
+ <item> modulo </item>
+ <item> conjg </item>
+ <item> dprod </item> <!-- dprod(x, y) is the specific name for x*y -->
+ <item> dim </item> <!-- Generic form: dim -->
+ <item> ddim </item> <!-- Specific names for dim -->
+ <item> idim </item>
+ <item> max </item> <!-- Generic form: max -->
+ <item> amax0 </item> <!-- Specific names for max -->
+ <item> amax1 </item>
+ <item> max0 </item>
+ <item> max1 </item>
+ <item> dmax1 </item>
+ <item> min </item> <!-- Generic form: min -->
+ <item> amin0 </item> <!-- Specific names for min -->
+ <item> amin1 </item>
+ <item> min0 </item>
+ <item> min1 </item>
+ <item> dmin1 </item>
+ <item> mod </item> <!-- Generic form: mod -->
+ <item> amod </item> <!-- Specific names for mod -->
+ <item> dmod </item>
+ <item> sign </item> <!-- Generic form: sign -->
+ <item> dsign </item> <!-- Specific names for sign -->
+ <item> isign </item>
+ <!-- Elemental mathematical functions -->
+ <item> acos </item> <!-- Generic form: acos -->
+ <item> dacos </item> <!-- Specific names for acos -->
+ <item> asin </item> <!-- Generic form: asin -->
+ <item> dasin </item> <!-- Specific names for asin -->
+ <item> atan </item> <!-- Generic form: atan -->
+ <item> datan </item> <!-- Specific names for atan -->
+ <item> atan2 </item> <!-- Generic form: atan2 -->
+ <item> datan2 </item> <!-- Specific names for atan2 -->
+ <item> cos </item> <!-- Generic form: cos -->
+ <item> ccos </item> <!-- Specific names for cos -->
+ <item> dcos </item>
+ <item> cosh </item> <!-- Generic form: cosh -->
+ <item> dcosh </item> <!-- Specific names for cosh -->
+ <item> exp </item> <!-- Generic form: exp -->
+ <item> cexp </item> <!-- Specific names for exp -->
+ <item> dexp </item>
+ <item> log </item> <!-- Generic form: log -->
+ <item> alog </item> <!-- Specific names for log -->
+ <item> dlog </item>
+ <item> clog </item>
+ <item> log10 </item> <!-- Generic form: log10 -->
+ <item> alog10 </item> <!-- Specific names for log10 -->
+ <item> dlog10 </item>
+ <item> sin </item> <!-- Generic form: sin -->
+ <item> csin </item> <!-- Specific names for sin -->
+ <item> dsin </item>
+ <item> sinh </item> <!-- Generic form: sinh -->
+ <item> dsinh </item> <!-- Specific name for sinh -->
+ <item> sqrt </item> <!-- Generic form: sqrt -->
+ <item> csqrt </item> <!-- Specific names for sqrt -->
+ <item> dsqrt </item>
+ <item> tan </item> <!-- Generic form: tan -->
+ <item> dtan </item> <!-- Generic form: dtan -->
+ <item> tanh </item> <!-- Generic form: tanh -->
+ <item> dtanh </item> <!-- Specific names for tanh -->
+ <!-- Elemental character and logical functions -->
+ <!-- Character-integer conversions -->
+ <item> achar </item>
+ <item> char </item>
+ <item> iachar </item>
+ <item> ichar </item>
+ <!-- Lexical comparison functions -->
+ <item> lge </item>
+ <item> lgt </item>
+ <item> lle </item>
+ <item> llt </item>
+ <!-- String-handling elemental functions -->
+ <item> adjustl </item>
+ <item> adjustr </item>
+ <item> index </item>
+ <item> len_trim </item>
+ <item> scan </item>
+ <item> verify </item>
+ <!-- Logical conversion -->
+ <item> logical </item>
+ <!-- Elemental functions to manipulate reals -->
+ <item> exponent </item>
+ <item> fraction </item>
+ <item> nearest </item>
+ <item> rrspacing </item>
+ <item> scale </item>
+ <item> set_exponent </item>
+ <item> spacing </item>
+ <!-- Bit manipulation elemental functions -->
+ <item> btest </item>
+ <item> iand </item>
+ <item> ibclr </item>
+ <item> ibits </item>
+ <item> ibset </item>
+ <item> ieor </item>
+ <item> ior </item>
+ <item> ishft </item>
+ <item> ishftc </item>
+ <item> not </item>
+ <!-- Bit manipulation elemental subroutine -->
+ <item> mvbits </item>
+ <!-- Merge elemental function -->
+ <item> merge </item>
+ </list>
+
+<!-- I N Q U I R Y F U N C T I O N S -->
+ <list name="inquiry_fn">
+ <!-- Inquiry functions for any type -->
+ <item> associated </item>
+ <item> present </item>
+ <item> kind </item>
+ <!-- String-handling inquiry function -->
+ <item> len </item>
+ <!-- Numeric inquiry functions -->
+ <item> digits </item>
+ <item> epsilon </item>
+ <item> huge </item>
+ <item> maxexponent </item>
+ <item> minexponent </item>
+ <item> precision </item>
+ <item> radix </item>
+ <item> range </item>
+ <item> tiny </item>
+ <!-- Bit inquiry function -->
+ <item> bit_size </item>
+ <!-- Array inquiry functions -->
+ <item> allocated </item>
+ <item> lbound </item>
+ <item> ubound </item>
+ <item> shape </item>
+ <item> size </item>
+ </list>
+
+<!-- T R A N S F O R M A T I O N A L F U N C T I O N S -->
+ <list name="transform_fn">
+ <!-- String-handling transformational functions -->
+ <item> repeat </item>
+ <item> trim </item>
+ <!-- Transformational functions for kind values -->
+ <item> selected_int_kind </item>
+ <item> selected_real_kind </item>
+ <!-- Transfer function -->
+ <item> transfer </item>
+ <!-- Vector and matrix multiplication functions -->
+ <item> dot_product </item>
+ <item> matmul </item>
+ <!-- Transformational functions that reduce arrays -->
+ <item> all </item>
+ <item> any </item>
+ <item> count </item>
+ <item> maxval </item>
+ <item> minval </item>
+ <item> product </item>
+ <item> sum </item>
+ <!-- Packing and unpacking arrays -->
+ <item> pack </item>
+ <item> unpack </item>
+ <!-- Transformational function for reshaping an array -->
+ <item> reshape </item>
+ <!-- Transformational function for replication -->
+ <item> spread </item>
+ <!-- Array shifting functions -->
+ <item> cshift </item>
+ <item> eoshift </item>
+ <!-- Matrix transpose -->
+ <item> transpose </item>
+ <!-- Transformational functions for geometric location -->
+ <item> maxloc </item>
+ <item> minloc </item>
+ </list>
+
+<!-- N O N E L E M E N T A L S U B R O U T I N E S -->
+ <list name="non_elem_subr">
+ <!-- Real time clock -->
+ <item> date_and_time </item>
+ <item> system_clock </item>
+ <!-- Random numbers -->
+ <item> random_number </item>
+ <item> random_seed </item>
+ </list>
+
+<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->
+<!-- * C O N T E X T S * -->
+<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->
+ <contexts>
+ <context attribute="Normal Text" lineEndContext="#stay" name="default" >
+ <IncludeRules context="find_strings" />
+ <IncludeRules context="find_decls" />
+ <IncludeRules context="find_intrinsics" />
+ <IncludeRules context="find_io_stmnts" />
+ <IncludeRules context="find_op_and_log" />
+ <IncludeRules context="find_numbers" />
+ <IncludeRules context="find_preprocessor" />
+ <IncludeRules context="find_comments" />
+ <IncludeRules context="find_symbols" />
+ <IncludeRules context="find_end_stmnts" />
+ <IncludeRules context="find_begin_stmnts" />
+ </context>
+<!--************************END OF THE MAIN CONTEXT*************************-->
+
+
+
+<!-- This context highlights preprocessor lines -->
+ <context attribute="Normal Text" lineEndContext="#stay" name="find_preprocessor">
+ <RegExpr attribute="Preprocessor" context="#stay" String="(#|cDEC\$|CDEC\$).*$" column="0"/>
+ </context>
+
+<!-- This context highlights operators and the logical values .true. .false. -->
+ <context attribute="Normal Text" lineEndContext="#stay" name="find_op_and_log">
+ <RegExpr attribute="Logical" context="#stay" String="\.(true|false)\." insensitive="TRUE"/>
+ <RegExpr attribute="Operator" context="#stay" String="\.[A-Za-z]+\."/>
+ <RegExpr attribute="Operator" context="#stay" String="(==|/=|&lt;|&lt;=|&gt;|&gt;=)"/>
+ </context>
+
+<!-- This context highlights comments -->
+ <context attribute="Normal Text" lineEndContext="#stay" name="find_comments">
+ <RegExpr attribute="Comment" context="#stay" String="[cC\*].*$" column="0"/>
+ <RegExpr attribute="Comment" context="#stay" String="!.*$"/>
+ </context>
+
+<!-- This context highlights symbols -->
+ <context attribute="Normal Text" lineEndContext="#stay" name="find_symbols">
+ <Detect2Chars attribute="Keyword" context="#stay" char="*" char1="*"/>
+ <Detect2Chars attribute="Keyword" context="#stay" char="(" char1="/"/>
+ <Detect2Chars attribute="Keyword" context="#stay" char="/" char1=")"/>
+ <AnyChar attribute="Keyword" context="#stay" String="&amp;+-*/=?[]^{|}~"/>
+ <AnyChar attribute="Symbol" context="#stay" String="(),"/>
+ </context>
+
+<!-- This context highlights items inside the parentesis of a function -->
+ <context attribute="Normal Text" lineEndContext="#stay" name="inside_func_paren">
+ <DetectChar attribute="Normal Text" context="inside_func_paren" char="("/>
+ <DetectChar attribute="Normal Text" context="#pop" char=")"/>
+ <IncludeRules context="find_strings" />
+ <IncludeRules context="find_intrinsics" />
+ <IncludeRules context="find_numbers" />
+ </context>
+
+<!-- The following two contexts match input/output statements -->
+ <context attribute="Normal Text" lineEndContext="#stay" name="find_io_stmnts">
+ <RegExpr attribute="IO Function" context="find_io_paren" String="\b(read|write|backspace|rewind|end\s*file|close)\s*[(]" insensitive="TRUE"/>
+ <RegExpr attribute="IO Function" context="find_io_paren" String="\bopen\s*[(]" insensitive="TRUE"/>
+ <RegExpr attribute="IO Function" context="find_io_paren" String="\binquire\s*[(]" insensitive="TRUE"/>
+ <RegExpr attribute="IO Function" context="format_stmnt" String="\bformat\s*[(]" insensitive="TRUE"/>
+ <RegExpr attribute="IO Function" context="#stay" String="\bend\s*file\b" insensitive="TRUE"/>
+ <keyword attribute="IO Function" context="#stay" String="io_functions"/>
+ </context>
+<!-- This context matches parenthesis for the read, write, ... statements -->
+ <context attribute="Normal Text" lineEndContext="#stay" name="find_io_paren">
+ <DetectChar attribute="IO Function" context="#stay" char="*"/>
+ <DetectChar attribute="Normal Text" context="inside_func_paren" char="("/>
+ <DetectChar attribute="IO Function" context="#pop" char=")"/>
+ <keyword attribute="IO Function" context="#stay" String="io_keywords"/>
+ <keyword attribute="IO Function" context="#stay" String="inquire_keywords"/>
+ <keyword attribute="IO Function" context="#stay" String="open_keywords"/>
+ <IncludeRules context="find_strings" />
+ <IncludeRules context="find_intrinsics" />
+ <IncludeRules context="find_numbers" />
+ <IncludeRules context="find_symbols" />
+ </context>
+<!-- This context highlights the text inside the parenthesis of fortran statement -->
+ <context attribute="Normal Text" lineEndContext="#stay" name="format_stmnt">
+ <DetectChar attribute="IO Function" context="format_stmnt" char="("/>
+ <DetectChar attribute="IO Function" context="#pop" char=")"/>
+ <RegExpr attribute="IO Function" context="#stay" String="[0-9]*/" insensitive="TRUE"/>
+ <AnyChar attribute="IO Function" context="#stay" String=":"/>
+ <IncludeRules context="find_strings" />
+ <IncludeRules context="find_symbols" />
+ </context>
+
+<!-- The following context matches the begin of program units -->
+ <context attribute="Normal Text" lineEndContext="#stay" name="find_begin_stmnts">
+ <RegExpr attribute="Keyword" context="#stay" String="\bmodule\s+procedure\b" insensitive="TRUE"/>
+ <RegExpr attribute="Keyword" context="#stay" String="\b(program|subroutine|function|module|block\s*data)\b" insensitive="TRUE" beginRegion="Unit"/>
+ </context>
+<!-- The following context matches the end of program units -->
+ <context attribute="Normal Text" lineEndContext="#stay" name="find_end_stmnts">
+ <RegExpr attribute="Keyword" context="#stay" String="\bend\s*(program|subroutine|function|module|block\s*data)\b" insensitive="TRUE" endRegion="Unit"/>
+ <RegExpr attribute="Keyword" context="#stay" String="\bend\s*(do|if|select|where|forall|interface)\b" insensitive="TRUE"/>
+ <RegExpr attribute="Keyword" context="#stay" String="\bend\b" insensitive="TRUE" endRegion="Unit"/>
+ </context>
+
+<!-- The following two contexts match declarations -->
+ <context attribute="Normal Text" lineEndContext="#stay" name="find_decls">
+ <RegExpr attribute="Data Type" context="#stay" String="\binteger[\*]\d{1,2}" insensitive="TRUE"/>
+ <RegExpr attribute="Data Type" context="#stay" String="\breal[\*]\d{1,2}" insensitive="TRUE"/>
+ <RegExpr attribute="Data Type" context="#stay" String="\bcomplex[\*]\d{1,2}" insensitive="TRUE"/>
+ <RegExpr attribute="Data Type" context="#stay" String="\bend\s*type\b" insensitive="TRUE"/>
+ <keyword attribute="Data Type" context="#stay" String="types"/>
+ <RegExpr attribute="Data Type" context="#stay" String="^\s*data\b" insensitive="TRUE"/>
+ <RegExpr attribute="Data Type" context="find_paren" String="^\s*real\s*[(]" insensitive="TRUE"/>
+ <RegExpr attribute="Data Type" context="#stay" String="^\s*real(?![\w\*])" insensitive="TRUE"/>
+ <RegExpr attribute="Data Type" context="#stay" String="\bcharacter[*][0-9]+\b" insensitive="TRUE"/>
+ <RegExpr attribute="Data Type" context="find_paren" String="\b(type|integer|complex|character|logical|intent|dimension)\b\s*[(]" insensitive="TRUE"/>
+ <RegExpr attribute="Data Type" context="#stay" String="\b(type|integer|complex|character|logical|intent|dimension)\b" insensitive="TRUE"/>
+ <Detect2Chars attribute="Data Type" context="#stay" char=":" char1=":"/>
+ </context>
+<!-- This context matches parenthesis in data type declarations, such as in 'real(...)'-->
+ <context attribute="Data Type" lineEndContext="#pop" name="find_paren">
+ <DetectChar attribute="Data Type" context="find_paren" char="("/>
+ <DetectChar attribute="Data Type" context="#pop" char=")"/>
+ </context>
+
+<!-- The following context matches intrinsic procedures -->
+ <context attribute="Normal Text" lineEndContext="#stay" name="find_intrinsics">
+ <keyword attribute="Keyword" context="#stay" String="keywords"/>
+ <!-- INTRINSIC PROCEDURES -->
+ <keyword attribute="Elemental Procedure" context="#stay" String="elemental_procs"/>
+ <keyword attribute="Inquiry Function" context="#stay" String="inquiry_fn"/>
+ <keyword attribute="Transformational Function" context="#stay" String="transform_fn"/>
+ <keyword attribute="Non elemental subroutine" context="#stay" String="non_elem_subr"/>
+ </context>
+
+<!-- The following context matches integer and real numbers -->
+ <context attribute="Normal Text" lineEndContext="#stay" name="find_numbers">
+ <!-- Floating-point numbers with optional kind -->
+ <RegExpr attribute="Float" context="#stay" String="[0-9]*\.[0-9]+([de][+-]?[0-9]+)?([_]([0-9]+|[a-z][\w_]*))?" insensitive="TRUE"/>
+ <RegExpr attribute="Float" context="#stay" String="\b[0-9]+\.[0-9]*([de][+-]?[0-9]+)?([_]([0-9]+|[a-z][\w_]*))?(?![a-z])" insensitive="TRUE"/>
+ <RegExpr attribute="Float" context="#stay" String="\b[0-9]+[de][+-]?[0-9]+([_]([0-9]+|[a-z][\w_]*))?" insensitive="TRUE"/>
+ <!-- Integers with optional kind specifier -->
+ <RegExpr attribute="Decimal" context="#stay" String="\b[0-9]+([_]([0-9]+|[a-zA-Z][\w_]*))?"/>
+ <!-- Integers in binary, octal and hexadecimal notations -->
+ <RegExpr attribute="Decimal" context="#stay" String="\b[bozx]([&apos;][0-9a-f]+[&apos;]|[&quot;][0-9a-f]+[&quot;])" insensitive="TRUE"/>
+ </context>
+
+<!-- The following four contexts implement the complex string multi-line declarations -->
+ <!-- Matches STRINGS (there are 2 types of strings: '...' and "...") -->
+ <context attribute="String" lineEndContext="#stay" name="find_strings">
+ <DetectChar attribute="String" context="string_1" char="&apos;"/>
+ <DetectChar attribute="String" context="string_2" char="&quot;"/>
+ </context>
+
+ <context attribute="String" lineEndContext="#stay" name="string_1" fallthrough="true" fallthroughContext="#pop">
+ <RegExpr attribute="String" context="#pop" String="[^&apos;]*&apos;"/>
+ <RegExpr attribute="Keyword" context="end_of_string" String="&amp;\s*$"/>
+ <RegExpr attribute="String" context="end_of_string" String=".*(?=&amp;\s*$)"/>
+ </context>
+
+ <context attribute="String" lineEndContext="#stay" name="string_2" fallthrough="true" fallthroughContext="#pop">
+ <RegExpr attribute="String" context="#pop" String="[^&quot;]*&quot;"/>
+ <RegExpr attribute="Keyword" context="end_of_string" String="&amp;\s*$"/>
+ <RegExpr attribute="String" context="end_of_string" String=".*(?=&amp;\s*$)"/>
+ </context>
+
+ <context attribute="String" lineEndContext="#stay" name="end_of_string" fallthrough="true" fallthroughContext="#pop#pop">
+ <DetectSpaces />
+ <RegExpr attribute="Keyword" context="#stay" String="&amp;\s*$"/>
+ <DetectChar attribute="Keyword" context="#pop" char="&amp;" firstNonSpace="true"/>
+ <RegExpr attribute="Comment" context="#stay" String="(!.*)?$" firstNonSpace="true"/>
+ </context>
+ </contexts>
+
+<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->
+<!-- * S T Y L E I T E M D E F I N I T I O N S * -->
+<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->
+ <itemDatas>
+ <itemData name="Normal Text" defStyleNum="dsNormal"/>
+ <itemData name="Keyword" defStyleNum="dsKeyword"/>
+ <itemData name="Data Type" defStyleNum="dsDataType"/>
+ <itemData name="Decimal" defStyleNum="dsDecVal"/>
+ <itemData name="Float" defStyleNum="dsFloat"/>
+ <itemData name="String" defStyleNum="dsString"/>
+ <itemData name="Comment" defStyleNum="dsComment"/>
+ <itemData name="Symbol" defStyleNum="dsNormal"/>
+ <itemData name="Preprocessor" defStyleNum="dsOthers"/>
+ <itemData name="Operator" defStyleNum="dsKeyword" color="#008000" selColor="#ff00ff" bold="1" italic="0"/>
+ <itemData name="Logical" defStyleNum="dsOthers" color="#800080" selColor="#ffa0a0" bold="1" italic="0"/>
+ <itemData name="IO Function" defStyleNum="dsFunction" color="#006060" selColor="#ffffff" bold="0" italic="0"/>
+ <itemData name="Elemental Procedure" defStyleNum="dsKeyword" color="#600060" selColor="#ffa0ff" bold="1" italic="0"/>
+ <itemData name="Inquiry Function" defStyleNum="dsFunction" color="#000060" selColor="#a0a0ff" bold="1" italic="1"/>
+ <itemData name="Transformational Function" defStyleNum="dsFunction" color="#600060" selColor="#ffa0ff" bold="1" italic="0"/>
+ <itemData name="Non elemental subroutine" defStyleNum="dsKeyword" color="#600060" selColor="#ffa0ff" bold="1" italic="0"/>
+ </itemDatas>
+ </highlighting>
+ <general>
+ <comments>
+ <comment name="singleLine" start="c"/>
+ <comment name="singleLine" start="!"/>
+ </comments>
+ <keywords casesensitive="0"/>
+ </general>
+</language>
diff --git a/kate/data/fstab.xml b/kate/data/fstab.xml
new file mode 100644
index 000000000..c2e1b21c6
--- /dev/null
+++ b/kate/data/fstab.xml
@@ -0,0 +1,96 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+
+<language name="fstab" version="1.00" kateversion="2.4" section="Configuration" extensions="fstab;mtab" author="Diego Iastrubni (elcuco@kde.org)" license="Public Domain" >
+ <highlighting>
+ <list name="valid_fs">
+ <item> ext2 </item>
+ <item> ext3 </item>
+ <item> fat </item>
+ <item> vfat </item>
+ <item> reiser </item>
+ <item> proc </item>
+ <item> none </item>
+ <item> sysfs </item>
+ <item> ntfs </item>
+ <item> umsdos </item>
+ <item> swap </item>
+ <item> minix </item>
+ <item> iso9660 </item>
+ </list>
+
+ <contexts>
+ <!-- <file system> <mount point> <type> <options> <dump> <pass> -->
+ <context name="device" attribute="Device" lineEndContext="#stay">
+ <DetectChar context="comment" char="#" firstNonSpace="1" />
+ <RegExpr context="mount_point" String="[\s]*" />
+ </context>
+
+ <context name="mount_point" attribute="Mount Point" lineEndContext="device" >
+ <DetectChar context="comment" char="#" firstNonSpace="1" />
+ <RegExpr context="_type" String="[\s]*" />
+ </context>
+
+ <context name="_type" attribute="Normal" lineEndContext="device" >
+ <DetectChar context="comment" char="#" firstNonSpace="1" />
+ <RegExpr context="type" String="[\S]*" />
+ </context>
+
+ <context name="type" attribute="Type" lineEndContext="device" >
+ <DetectChar context="comment" char="#" firstNonSpace="1" />
+ <keyword context="#stay" attribute="Valid FileSystem" String="Valid FileSystem" />
+ <RegExpr context="options" String="[\s]*"/>
+ </context>
+
+ <context name="options" attribute="Options" lineEndContext="device" >
+ <DetectChar context="comment" char="#" firstNonSpace="1" />
+ <RegExpr context="dump" String="[\s]*"/>
+ </context>
+
+ <context name="dump" attribute="Dump" lineEndContext="device" >
+ <DetectChar context="comment" char="#" firstNonSpace="1" />
+ <RegExpr context="pass" String="[\s]*"/>
+ </context>
+
+ <context name="pass" attribute="Pass" lineEndContext="device" >
+ <DetectChar context="comment" char="#" firstNonSpace="1" />
+ <RegExpr context="__error" String="[\s]*"/>
+ </context>
+
+ <context name="__error" attribute="Pass" lineEndContext="device" >
+ <DetectChar context="comment" char="#" />
+ <RegExpr context="error" String="[\S]*"/>
+ </context>
+
+ <!-- error -->
+ <context name="error" attribute="Error" lineEndContext="device" >
+ </context>
+
+ <!-- comment -->
+ <context name="comment" attribute="Comment" lineEndContext="#pop" >
+ </context>
+ </contexts>
+
+ <itemDatas>
+ <itemData name="Device" defStyleNum="dsKeyword" />
+ <itemData name="Mount Point" defStyleNum="dsDataType" />
+ <itemData name="Type" defStyleNum="dsFunction" />
+ <itemData name="Options" defStyleNum="dsKeyword" />
+ <itemData name="Dump" defStyleNum="dsDecVal" />
+ <itemData name="Pass" defStyleNum="dsDecVal" />
+
+ <itemData name="Valid FileSystem" defStyleNum="dsDataType" italic="1"/>
+
+ <itemData name="Normal" defStyleNum="dsNormal" />
+ <itemData name="Comment" defStyleNum="dsComment" />
+ <itemData name="Error" defStyleNum="dsError" />
+ </itemDatas>
+ </highlighting>
+
+ <general>
+ <comments>
+ <comment name="singleLine" start="#" />
+ </comments>
+ </general>
+</language>
+
diff --git a/kate/data/gdl.xml b/kate/data/gdl.xml
new file mode 100644
index 000000000..a41af14c4
--- /dev/null
+++ b/kate/data/gdl.xml
@@ -0,0 +1,313 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+<language name="GDL" version="1.01" kateversion="2.0" section="Scientific" extensions="*.gdl;*.vcg;*.GDL;*.VCG" mimetype="">
+ <highlighting>
+ <list name="colors">
+ <item> white </item>
+ <item> blue </item>
+ <item> red </item>
+ <item> green </item>
+ <item> yellow </item>
+ <item> magenta </item>
+ <item> cyan </item>
+ <item> darkgrey </item>
+ <item> darkgray </item>
+ <item> darkblue </item>
+ <item> darkred </item>
+ <item> darkgreen </item>
+ <item> darkyellow </item>
+ <item> darkmagenta </item>
+ <item> darkcyan </item>
+ <item> gold </item>
+ <item> lightgrey </item>
+ <item> lightgray </item>
+ <item> lightblue </item>
+ <item> lightred </item>
+ <item> lightgreen </item>
+ <item> lightyellow </item>
+ <item> lightmagenta </item>
+ <item> lightcyan </item>
+ <item> lilac </item>
+ <item> turquoise </item>
+ <item> aquamarine </item>
+ <item> khaki </item>
+ <item> purple </item>
+ <item> yellowgreen </item>
+ <item> pink </item>
+ <item> orange </item>
+ <item> orchid </item>
+ <item> black </item>
+ </list>
+ <list name="shapes">
+ <item> box </item>
+ <item> triangle </item>
+ <item> circle </item>
+ <item> ellipse </item>
+ <item> hexagon </item>
+ <item> rhomb </item>
+ <item> rhomboid </item>
+ <item> trapeze </item>
+ <item> uptrapeze </item>
+ <item> trapezoid </item>
+ <item> uptrapezoid </item>
+ <item> lparallelogram </item>
+ <item> rparallelogram </item>
+ </list>
+ <list name="states">
+ <item> unfolded </item>
+ <item> folded </item>
+ <item> boxed </item>
+ <item> clustered </item>
+ <item> wrapped </item>
+ <item> exclusive </item>
+ <item> white </item>
+ </list>
+ <list name="algorithms">
+ <item> normal </item>
+ <item> tree </item>
+ <item> forcedir </item>
+ <item> dfs </item>
+ <item> minbackward </item>
+ <item> maxdepth </item>
+ <item> maxdepthslow </item>
+ <item> mindepth </item>
+ <item> mindepthslow </item>
+ <item> minindegree </item>
+ <item> minoutdegree </item>
+ <item> maxindegree </item>
+ <item> maxoutdegree </item>
+ <item> maxdegree </item>
+ <item> mindegree </item>
+ </list>
+ <list name="forcedir">
+ <item> attraction </item>
+ <item> repulsion </item>
+ <item> randomfactor </item>
+ <item> randomimpulse </item>
+ <item> randomrounds </item>
+ <item> tempscheme </item>
+ <item> temptreshold </item>
+ <item> tempmin </item>
+ <item> tempmax </item>
+ </list>
+ <list name="magnetic">
+ <item> no </item>
+ <item> polar </item>
+ <item> circular </item>
+ <item> polcircular </item>
+ <item> orthogonal </item>
+ </list>
+ <list name="orientation">
+ <item> toptobottom </item>
+ <item> bottomtotop </item>
+ <item> lefttoright </item>
+ <item> righttoleft </item>
+ <item> top_to_bottom </item>
+ <item> bottom_to_top </item>
+ <item> left_to_right </item>
+ <item> right_to_left </item>
+ </list>
+ <list name="lines">
+ <item> solid </item>
+ <item> continuous </item>
+ <item> dashed </item>
+ <item> dotted </item>
+ <item> double </item>
+ <item> triple </item>
+ <item> invisible </item>
+ </list>
+ <list name="fisheye">
+ <item> pfish </item>
+ <item> cfish </item>
+ <item> fpfish </item>
+ <item> fcfish </item>
+ <item> dpfish </item>
+ <item> dcfish </item>
+ </list>
+ <contexts>
+ <context name="default" attribute="Normal" lineEndContext="#stay">
+ <Detect2Chars attribute="Comment" context="ccomment" char="/" char1="/"/>
+ <Detect2Chars attribute="Comment" context="cppcomment" char="/" char1="*"/>
+ <StringDetect attribute="Keyword" context="#stay" String="focus"/>
+ <RegExpr attribute="Keyword" context="#stay" String="(graph|edge|node|region|backedge|(left|right|)(bent|)nearedge):"/>
+ <RegExpr attribute="Value" context="#stay" String="loc *:"/>
+ <StringDetect attribute="Value" context="centry" String="colorentry"/>
+ <RegExpr attribute="Value" context="arrowmode" String="arrow_?mode *:"/>
+ <RegExpr attribute="Value" context="colorid" String="(foldnode.|node.|)(text|border|)color *:"/>
+ <RegExpr attribute="Value" context="colorid" String="(foldedge.|edge.|)(arrow|backarrow|)color *:"/>
+ <RegExpr attribute="Value" context="arrow" String="(foldedge.|edge.|)(arrow|backarrow)style *:"/>
+ <RegExpr attribute="Value" context="lineid" String="(foldedge.|edge.|)linestyle *:"/>
+ <RegExpr attribute="Value" context="lineid" String="(foldnode.|node.|)borderstyle *:"/>
+ <RegExpr attribute="Value" context="fishid" String="view *:"/>
+ <RegExpr attribute="Value" context="shapeid" String="(foldnode.|node.|)shape"/>
+ <RegExpr attribute="Value" context="lquote" String="(source|target)(name|)"/>
+ <RegExpr attribute="Value" context="lquote" String="title *:"/>
+ <RegExpr attribute="Value" context="lquote" String="(foldnode.|node.|foldedge.|edge.|)label *:"/>
+ <RegExpr attribute="Value" context="fontlq" String="(foldnode.|node.|foldedge.|edge.|)fontname *:"/>
+ <RegExpr attribute="Value" context="lquote" String="infoname(1|2|3) *:"/>
+ <RegExpr attribute="Value" context="lquote" String="(foldnode.|node.|)info(1|2|3) *:"/>
+ <RegExpr attribute="Value" context="intval" String="spreadlevel *:"/>
+ <RegExpr attribute="Value" context="nodelevel" String="(foldnode.|node.|)(level|vertical_?order) *:"/>
+ <RegExpr attribute="Value" context="intval" String="(foldnode.|node.|foldedge.|edge.|)horizontal_?order *:"/>
+ <RegExpr attribute="Value" context="stateid" String="stat(e|us) *:"/>
+ <RegExpr attribute="Value" context="algid" String="layout_?algorithm *:"/>
+ <RegExpr attribute="Value" context="boolean" String="crossing_?optimization *:"/>
+ <RegExpr attribute="Value" context="boolean" String="crossing_?phase2 *:"/>
+ <RegExpr attribute="Value" context="boolean" String="(dirty_edge_|display_edge_|displayedge|late_edge_|subgraph_?)labels *:"/>
+ <RegExpr attribute="Value" context="boolean" String="s?manhatt(a|e)n_?edges *:"/>
+ <RegExpr attribute="Value" context="boolean" String="(nodes|near_?edges|edges|splines) *:"/>
+ <RegExpr attribute="Value" context="classname" String="classname"/>
+ <RegExpr attribute="Value" context="orient" String="orientation *:"/>
+ <RegExpr attribute="Value" context="nodealign" String="node_alignment *:"/>
+ <RegExpr attribute="Value" context="textmode" String="(foldnode.|node.|)textmode *:"/>
+ <RegExpr attribute="Value" context="boolean" String="equal_y_dist *:"/>
+ <RegExpr attribute="Value" context="boolean" String="equal_?ydist *:"/>
+ <RegExpr attribute="Value" context="weight" String="crossing_?weight *:"/>
+ <RegExpr attribute="Value" context="boolean" String="(fast_?|)icons *:"/>
+ <RegExpr attribute="Value" context="boolean" String="fine_?tuning *:"/>
+ <RegExpr attribute="Value" context="boolean" String="(f?straight_?|priority_)phase *:"/>
+ <RegExpr attribute="Value" context="boolean" String="ignore_?singles *:"/>
+ <RegExpr attribute="Value" context="boolean" String="(in|out|)port_?sharing *:"/>
+ <RegExpr attribute="Value" context="boolean" String="linear_?segments *:"/>
+ <RegExpr attribute="Value" context="intval" String="(foldnode.|node.|)(height|width|borderwidth|stretch|shrink) *:"/>
+ <RegExpr attribute="Value" context="intval" String="(foldedge.|edge.|)(arrowsize|backarrowsize|thickness|class|priority) *:"/>
+ <RegExpr attribute="Value" context="intval" String="anchor *:"/>
+ <RegExpr attribute="Value" context="intval" String="iconcolors *:"/>
+ <RegExpr attribute="Value" context="intval" String="hidden *:"/>
+ <RegExpr attribute="Value" context="boolean" String="energetic *:"/>
+ <RegExpr attribute="Value" context="intval" String="layout_(up|down|near|spline)factor *:"/>
+ <RegExpr attribute="Value" context="intval" String="border +(x|y) *:"/>
+ <RegExpr attribute="Value" context="intval" String="splinefactor *:"/>
+ <RegExpr attribute="Value" context="floatval" String="(gravity|tempfactor|treefactor) *:"/>
+ <RegExpr attribute="Value" context="intval" String="(xspace|xbase|xmax|xraster|x) *:"/>
+ <RegExpr attribute="Value" context="intval" String="(yspace|ybase|ymax|yraster|y) *:"/>
+ <RegExpr attribute="Value" context="intval" String="(xlraster|xlspace) *:"/>
+ <RegExpr attribute="Value" context="intval" String="magnetic_force(1|2) *:"/>
+ <RegExpr attribute="Value" context="magnor" String="magnetic_field(1|2) *:"/>
+ <RegExpr attribute="Value" context="intval" String="(a|b|c|fd|p|r|s)(max) *:"/>
+ <RegExpr attribute="Value" context="intval" String="(c|p|r)(min) *:"/>
+ <keyword attribute="Value" context="intval" String="forcedir"/>
+ <RegExpr attribute="Value" context="scaling" String="scaling *:"/>
+ <RegExpr attribute="Value" context="lquote" String="useraction(name|cmd)(1|2|3|4) *:"/>
+ </context>
+ <context name="string" attribute="String" lineEndContext="#stay">
+ <DetectChar attribute="String" context="default" char="&quot;"/>
+ <Detect2Chars attribute="Char" context="#stay" char="\" char1="&quot;"/>
+ <RegExpr attribute="Char" context="#stay" String="\\(n|a|t|b)"/>
+ <RegExpr attribute="Char" context="#stay" String="\\fi(0|1|2)[0-9][0-9]"/>
+ <RegExpr attribute="Char" context="#stay" String="\\f(u|I|b|B|n|[0-9][0-9])"/>
+ </context>
+ <context name="scaling" attribute="Normal" lineEndContext="#stay">
+ <StringDetect attribute="Datatype" context="default" String="maxspect"/>
+ <Float attribute="Float" context="default"/>
+ </context>
+ <context name="ccomment" attribute="Comment" lineEndContext="default">
+ </context>
+ <context name="cppcomment" attribute="Comment" lineEndContext="#stay">
+ <Detect2Chars attribute="Comment" context="default" char="*" char1="/"/>
+ </context>
+ <context name="colorid" attribute="Normal" lineEndContext="#stay">
+ <keyword attribute="Datatype" context="default" String="colors"/>
+ <RegExpr attribute="Datatype" context="default" String="[0-9][0-9]?"/>
+ </context>
+ <context name="shapeid" attribute="Normal" lineEndContext="#stay">
+ <keyword attribute="Datatype" context="default" String="shapes"/>
+ </context>
+ <context name="lquote" attribute="Normal" lineEndContext="#stay">
+ <DetectChar attribute="String" context="string" char="&quot;"/>
+ </context>
+ <context name="stateid" attribute="Normal" lineEndContext="#stay">
+ <keyword attribute="Datatype" context="default" String="states"/>
+ </context>
+ <context name="algid" attribute="Normal" lineEndContext="#stay">
+ <keyword attribute="Datatype" context="default" String="algorithms"/>
+ </context>
+ <context name="fishid" attribute="Normal" lineEndContext="#stay">
+ <keyword attribute="Datatype" context="default" String="fisheye"/>
+ </context>
+ <context name="boolean" attribute="Normal" lineEndContext="#stay">
+ <RegExpr attribute="Datatype" context="default" String="(yes|no)"/>
+ </context>
+ <context name="lineid" attribute="Normal" lineEndContext="#stay">
+ <keyword attribute="Datatype" context="default" String="lines"/>
+ </context>
+ <context name="intval" attribute="Normal" lineEndContext="#stay">
+ <Int attribute="Integer" context="longint"/>
+ </context>
+ <context name="longint" attribute="Normal" lineEndContext="default">
+ <Int attribute="Integer" context="longint"/>
+ <RegExpr attribute="Normal" context="default" String="\ "/>
+ </context>
+ <context name="centry" attribute="Normal" lineEndContext="default">
+ <RegExpr attribute="Value" context="cecolon" String="[0-9][0-9]?"/>
+ </context>
+ <context name="rgb" attribute="Normal" lineEndContext="#stay">
+ <RegExpr attribute="Integer" context="default" String="[0-9][0-9]?[0-9]? +[0-9][0-9]?[0-9]? +[0-9][0-9]?[0-9]?"/>
+ </context>
+ <context name="floatval" attribute="Normal" lineEndContext="#stay">
+ <Float attribute="Float" context="default"/>
+ </context>
+ <context name="fontlq" attribute="Normal" lineEndContext="#stay">
+ <DetectChar attribute="Datatype" context="fontbase" char="&quot;"/>
+ </context>
+ <context name="fontbase" attribute="Normal" lineEndContext="#stay">
+ <RegExpr attribute="Datatype" context="fontsize" String="((tim|ncen)(R|B|I|BI)|(cour|helv)(R|B|O|BO)|symb)"/>
+ </context>
+ <context name="fontsize" attribute="Normal" lineEndContext="#stay">
+ <RegExpr attribute="Datatype" context="#stay" String="(08|10|12|14|18|24)(.vcf|)"/>
+ <DetectChar attribute="Datatype" context="default" char="&quot;"/>
+ </context>
+ <context name="arrow" attribute="Normal" lineEndContext="#stay">
+ <RegExpr attribute="Datatype" context="default" String="(solid|line|none)"/>
+ </context>
+ <context name="arrowmode" attribute="Normal" lineEndContext="#stay">
+ <RegExpr attribute="Datatype" context="default" String="(free|fixed)"/>
+ </context>
+ <context name="magnor" attribute="Normal" lineEndContext="#stay">
+ <keyword attribute="Datatype" context="default" String="magnetic"/>
+ <keyword attribute="Datatype" context="default" String="orientation"/>
+ </context>
+ <context name="orient" attribute="Normal" lineEndContext="#stay">
+ <keyword attribute="Datatype" context="default" String="orientation"/>
+ </context>
+ <context name="nodealign" attribute="Normal" lineEndContext="#stay">
+ <RegExpr attribute="Datatype" context="default" String="(top|center|bottom)"/>
+ </context>
+ <context name="nodelevel" attribute="Normal" lineEndContext="#stay">
+ <StringDetect attribute="Datatype" context="default" String="maxlevel"/>
+ <Int attribute="Integer" context="longint"/>
+ </context>
+ <context name="classname" attribute="Normal" lineEndContext="#stay">
+ <RegExpr attribute="Value" context="#stay" String="[0-9]+"/>
+ <DetectChar attribute="Value" context="lquote" char=":"/>
+ </context>
+ <context name="cecolon" attribute="Normal" lineEndContext="#stay">
+ <DetectChar attribute="Value" context="rgb" char=":"/>
+ </context>
+ <context name="weight" attribute="Normal" lineEndContext="#stay">
+ <RegExpr attribute="Datatype" context="default" String="(medianbary|barymedian|bary|median)"/>
+ </context>
+ <context name="textmode" attribute="Normal" lineEndContext="#stay">
+ <RegExpr attribute="Datatype" context="default" String="(center|left_justify|right_justify)"/>
+ </context>
+ </contexts>
+ <itemDatas>
+ <itemData name="Normal" defStyleNum="dsNormal"/>
+ <itemData name="String" defStyleNum="dsString"/>
+ <itemData name="Char" defStyleNum="dsChar"/>
+ <itemData name="Keyword" defStyleNum="dsKeyword"/>
+ <itemData name="Integer" defStyleNum="dsDecVal"/>
+ <itemData name="Datatype" defStyleNum="dsDataType"/>
+ <itemData name="Comment" defStyleNum="dsComment"/>
+ <itemData name="Value" defStyleNum="dsOthers"/>
+ <itemData name="Float" defStyleNum="dsFloat"/>
+ </itemDatas>
+ </highlighting>
+ <general>
+ <comments>
+ <comment name="singleLine" start="//" />
+ <comment name="multiLine" start="/*" end="*/"/>
+ </comments>
+ <keywords casesensitive="1"/>
+ </general>
+</language>
diff --git a/kate/data/generate-php.pl b/kate/data/generate-php.pl
new file mode 100644
index 000000000..c6bb3a50c
--- /dev/null
+++ b/kate/data/generate-php.pl
@@ -0,0 +1,56 @@
+# This perl script read stdin and write on stdout. It shall be an XML language file.
+#
+# * If the name of the language is 'HTML', then it creates the language 'PHP (HTML)'
+# which shall be used for PHP hl.
+#
+# * If the name of the language is something else (say '*'), it creates the language '*/PHP'.
+# This new language is the same as the old one, but is able to detect PHP everywhere.
+#
+# This script will correctly set extensions & mimetype, and will replace
+# <IncludeRules context="##*"> by <IncludeRules context="##*/PHP">
+#
+# Generated languages need a language named 'PHP/PHP', which shall take care of PHP hl itself
+# and which will be called every time something like <?php is encountred.
+#
+# Author: Jan Villat <jan.villat@net2000.ch>
+# License: LGPL
+
+my $file = "";
+
+while (<>)
+{
+ $file .= $_;
+}
+
+$warning = "\n\n<!-- ***** THIS FILE WAS GENERATED BY A SCRIPT - DO NOT EDIT ***** -->\n";
+
+$file =~ s/(?=<language)/$warning\n\n\n/;
+
+if ($file =~ /<language[^>]+name="HTML"/)
+{
+ $root = 1;
+}
+
+if ($root == 1)
+{
+ $file =~ s/<language([^>]+)name="[^"]*"/<language$1name="PHP (HTML)"/s;
+ $file =~ s/<language([^>]+)section="[^"]*"/<language$1section="Scripts"/s;
+ $file =~ s/<language([^>]+)extensions="[^"]*"/<language$1extensions="*.php;*.php3;*.wml;*.phtml;*.phtm;*.inc"/s;
+ $file =~ s/<language([^>]+)mimetype="[^"]*"/<language$1mimetype="text\/x-php4-src;text\/x-php3-src;text\/vnd.wap.wml;application\/x-php"/s;
+}
+else
+{
+ $file =~ s/<language([^>]+)name="([^"]*)"/<language$1name="$2\/PHP" hidden="true"/s;
+ $file =~ s/<language([^>]+)section="[^"]*"/<language$1section="Other"/s;
+ $file =~ s/<language([^>]+)extensions="[^"]*"/<language$1extensions=""/s;
+ $file =~ s/<language([^>]+)mimetype="[^"]*"/<language$1mimetype=""/s;
+}
+
+$findphp = "<context name=\"FindPHP\">\n<RegExpr context=\"##PHP/PHP\" String=\"&lt;\\?(?:=|php)?\" lookAhead=\"true\" />\n</context>\n";
+
+$file =~ s/<IncludeRules\s([^>]*)context="##(?!Alerts)([^"]+)"/<IncludeRules $1context="##$2\/PHP"/g;
+$file =~ s/(<context\s[^>]*>)/$1\n<IncludeRules context="FindPHP" \/>/g;
+$file =~ s/(?=<\/contexts\s*>)/$findphp/;
+
+print $file;
+print $warning;
diff --git a/kate/data/gettext.xml b/kate/data/gettext.xml
new file mode 100644
index 000000000..f659eda9f
--- /dev/null
+++ b/kate/data/gettext.xml
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+<!--
+ This file is part of KDE's kate project.
+
+ copyright : (C) 2004 by Dominik Haumann
+ email : dhdev at gmx dot de
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the
+ Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+ -->
+<language name="GNU Gettext" version="1.03" kateversion="2.4" section="Markup" extensions="*.po;*.pot" mimetype="application/x-gettext" author="Dominik Haumann (dhdev@gmx.de)" license="LGPL">
+ <highlighting>
+
+ <contexts>
+ <context name = "Normal" attribute = "Normal Text" lineEndContext="#stay">
+ <RegExpr attribute = "Keyword" String = "^(msgid_plural|msgid|msgstr|msgctxt)" context="#stay"/>
+ <RegExpr attribute = "Automatic Comment" String = "#\..*$" context="#stay" firstNonSpace="true"/>
+ <RegExpr attribute = "Reference" String = "#:.*$" context="#stay" firstNonSpace="true"/>
+ <RegExpr attribute = "Flag" String = "#,.*$" context="#stay" firstNonSpace="true"/>
+ <RegExpr attribute = "Translator Comment" String = "#.*$" context="#stay" firstNonSpace="true"/>
+ <RegExpr attribute = "Char" String="\\." context="#stay"/>
+ <DetectChar attribute = "String" char="&quot;" context="String"/>
+ <RegExpr attribute = "Index" String="\[\d+\]" context="#stay"/>
+ </context>
+ <context name = "String" attribute = "String" lineEndContext="#stay">
+ <RegExpr attribute = "Char" String="\\." context="#stay"/>
+ <DetectChar attribute = "String" char="&quot;" context="#pop"/>
+ </context>
+ </contexts>
+
+ <itemDatas>
+ <itemData name = "Normal Text" defStyleNum ="dsNormal"/>
+ <itemData name = "Keyword" defStyleNum ="dsKeyword"/>
+ <itemData name = "String" defStyleNum ="dsString"/>
+ <itemData name = "Translator Comment" defStyleNum ="dsComment"/>
+ <itemData name = "Automatic Comment" defStyleNum ="dsComment" color="#0000ff"/>
+ <itemData name = "Reference" defStyleNum ="dsComment" color="#0000ff"/>
+ <itemData name = "Flag" defStyleNum ="dsComment" color="#0000ff"/>
+ <itemData name = "Char" defStyleNum ="dsChar"/>
+
+ <itemData name = "Index" defStyleNum ="dsDecVal"/>
+ </itemDatas>
+ </highlighting>
+ <general>
+ <comments>
+ <comment name="singleLine" start="#" />
+ </comments>
+ <keywords casesensitive="1" />
+ </general>
+</language>
diff --git a/kate/data/glsl.xml b/kate/data/glsl.xml
new file mode 100644
index 000000000..21ef312a0
--- /dev/null
+++ b/kate/data/glsl.xml
@@ -0,0 +1,323 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+<language name="GLSL" section="Sources" extensions="*.glsl;*.vert;*.frag" mimetype="text/x-glslsrc" version="1.02" kateversion="2.4" author="Oliver Richers (o.richers@tu-bs.de)" license="LGPL">
+ <highlighting>
+ <list name="keywords">
+ <item>break</item>
+ <item>continue</item>
+ <item>do</item>
+ <item>for</item>
+ <item>while</item>
+
+ <item>if</item>
+ <item>else</item>
+
+ <item>true</item>
+ <item>false</item>
+
+ <item>discard</item>
+ <item>return</item>
+
+ <item>struct</item>
+ </list>
+ <list name="types">
+ <item>float</item>
+ <item>int</item>
+ <item>void</item>
+ <item>bool</item>
+
+ <item>mat2</item>
+ <item>mat3</item>
+ <item>mat4</item>
+
+ <item>vec2</item>
+ <item>vec3</item>
+ <item>vec4</item>
+ <item>ivec2</item>
+ <item>ivec3</item>
+ <item>ivec4</item>
+ <item>bvec2</item>
+ <item>bvec3</item>
+ <item>bvec4</item>
+
+ <item>sampler1D</item>
+ <item>sampler2D</item>
+ <item>sampler3D</item>
+ <item>samplerCube</item>
+ <item>sampler1DShadow</item>
+ <item>sampler2DShadow</item>
+ </list>
+ <list name="typequal">
+ <item>attribute</item>
+ <item>const</item>
+ <item>uniform</item>
+ <item>varying</item>
+
+ <item>in</item>
+ <item>out</item>
+ <item>inout</item>
+ </list>
+ <list name="attention">
+ <item>FIXME</item>
+ <item>TODO</item>
+ <item>BUG</item>
+ </list>
+ <list name="stdlib">
+ <!-- Angle and Trigonometry Functions -->
+ <item>radians</item>
+ <item>degrees</item>
+ <item>sin</item>
+ <item>cos</item>
+ <item>tan</item>
+ <item>asin</item>
+ <item>acos</item>
+ <item>atan</item>
+
+ <!-- Exponential Functions -->
+ <item>pow</item>
+ <item>exp</item>
+ <item>log</item>
+ <item>exp2</item>
+ <item>log2</item>
+ <item>sqrt</item>
+ <item>inversesqrt</item>
+
+ <!-- Common Functions -->
+ <item>abs</item>
+ <item>sign</item>
+ <item>floor</item>
+ <item>ceil</item>
+ <item>fract</item>
+ <item>mod</item>
+ <item>min</item>
+ <item>max</item>
+ <item>clamp</item>
+ <item>mix</item>
+ <item>step</item>
+ <item>smoothstep</item>
+
+ <!-- Geometric Functions -->
+ <item>length</item>
+ <item>distance</item>
+ <item>dot</item>
+ <item>cross</item>
+ <item>normalize</item>
+ <item>ftransform</item>
+ <item>faceforward</item>
+ <item>reflect</item>
+ <item>refract</item>
+
+ <!-- Matrix Functions -->
+ <item>matrixCompMult</item>
+
+ <!-- Vector Relational Functions -->
+ <item>lessThan</item>
+ <item>lessThenEqual</item>
+ <item>greaterThan</item>
+ <item>greaterThanEqual</item>
+ <item>equal</item>
+ <item>notEqual</item>
+ <item>any</item>
+ <item>all</item>
+ <item>not</item>
+
+ <!-- Texture Lookup Functions -->
+ <item>texture1D</item>
+ <item>texture1DProj</item>
+ <item>texture1DLod</item>
+ <item>texture1DProjLod</item>
+ <item>texture2D</item>
+ <item>texture2DProj</item>
+ <item>texture2DLod</item>
+ <item>texture2DProjLod</item>
+ <item>texture3D</item>
+ <item>texture3DProj</item>
+ <item>texture3DLod</item>
+ <item>texture3DProjLod</item>
+ <item>textureCube</item>
+ <item>textureCubeLod</item>
+ <item>shadow1D</item>
+ <item>shadow2D</item>
+ <item>shadow1DProj</item>
+ <item>shadow2DProj</item>
+ <item>shadow1DLod</item>
+ <item>shadow2DLod</item>
+ <item>shadow1DProjLod</item>
+ <item>shadow2DProjLod</item>
+
+ <!-- Fragment Processing Functions -->
+ <item>dFdx</item>
+ <item>dFdy</item>
+ <item>fwidth</item>
+
+ <!-- Noise Functions -->
+ <item>noise1</item>
+ <item>noise2</item>
+ <item>noise3</item>
+ <item>noise4</item>
+ </list>
+ <list name="stdvar">
+ <!-- Vertex Shader Special Variables -->
+ <item>gl_Position</item>
+ <item>gl_PointSize</item>
+ <item>gl_ClipVertex</item>
+
+ <!-- Fragment Shader Special Variables -->
+ <item>gl_FragCoord</item>
+ <item>gl_FragFacing</item>
+ <item>gl_FragColor</item>
+ <item>gl_FragData</item>
+ <item>gl_FragDepth</item>
+
+ <!-- Vertex Shader Built-in Attributes -->
+ <item>gl_Color</item>
+ <item>gl_SecondaryColor</item>
+ <item>gl_Normal</item>
+ <item>gl_Vertex</item>
+ <item>gl_MultiTexCoord0</item>
+ <item>gl_MultiTexCoord1</item>
+ <item>gl_MultiTexCoord2</item>
+ <item>gl_MultiTexCoord2</item>
+ <item>gl_MultiTexCoord3</item>
+ <item>gl_MultiTexCoord4</item>
+ <item>gl_MultiTexCoord5</item>
+ <item>gl_MultiTexCoord6</item>
+ <item>gl_MultiTexCoord7</item>
+ <item>gl_FogColor</item>
+
+ <!-- Built-in Constants -->
+ <item>gl_MaxLights</item>
+ <item>gl_MaxClipPlanes</item>
+ <item>gl_MaxTextureUnits</item>
+ <item>gl_MaxTextureCoords</item>
+ <item>gl_MaxVertexAttributes</item>
+ <item>gl_MaxVertexUniformComponents</item>
+ <item>gl_MaxVaryingFloats</item>
+ <item>gl_MaxVertexTextureImageUnits</item>
+ <item>gl_MaxCombinedTextureImageUnits</item>
+ <item>gl_MaxTextureImageUnits</item>
+ <item>gl_MaxFragmentUniformComponents</item>
+ <item>gl_MaxDrawBuffers</item>
+
+ <!-- Built-in Uniform State -->
+ <item>gl_ModelViewMatrix</item>
+ <item>gl_ProjectionMatrix</item>
+ <item>gl_ModelViewProjectionMatrix</item>
+ <item>gl_TextureMatrix</item>
+ <item>gl_NormalMatrix</item>
+ <item>gl_ModelViewMatrixInverse</item>
+ <item>gl_ProjectionMatrixInverse</item>
+ <item>gl_ModelViewProjectionMatrixInverse</item>
+ <item>gl_TextureMatrixInverse</item>
+ <item>gl_ModelViewMatrixTranspose</item>
+ <item>gl_ProjectionMatrixTranspose</item>
+ <item>gl_ModelViewProjectionMatrixTranspose</item>
+ <item>gl_TextureMatrixTranspose</item>
+ <item>gl_ModelViewMatrixInverseTranspose</item>
+ <item>gl_ProjectionMatrixInverseTranspose</item>
+ <item>gl_ModelViewProjectionMatrixInverseTranspose</item>
+ <item>gl_TextureMatrixInverseTranspose</item>
+ <item>gl_NormScale</item>
+ <item>gl_DepthRangeParameters</item>
+ <item>gl_DepthRange</item>
+ <item>gl_ClipPlane</item>
+ <item>gl_PointParameters</item>
+ <item>gl_Point</item>
+ <item>gl_MaterialParameters</item>
+ <item>gl_FrontMaterial</item>
+ <item>gl_BackMaterial</item>
+ <item>gl_LightSourceParameters</item>
+ <item>gl_LightSource</item>
+ <item>gl_LightModelParameters</item>
+ <item>gl_LightModel</item>
+ <item>gl_LightModelProducts</item>
+ <item>gl_FrontLightModelProduct</item>
+ <item>gl_BackLightModelProduct</item>
+ <item>gl_LightProducts</item>
+ <item>gl_FrontLightProduct</item>
+ <item>gl_BackLightProduct</item>
+ <item>gl_TextureEnvColor</item>
+ <item>gl_EyePlaneS</item>
+ <item>gl_EyePlaneT</item>
+ <item>gl_EyePlaneR</item>
+ <item>gl_EyePlaneQ</item>
+ <item>gl_ObjectPlaneS</item>
+ <item>gl_ObjectPlaneT</item>
+ <item>gl_ObjectPlaneR</item>
+ <item>gl_ObjectPlaneQ</item>
+ <item>gl_FogParameters</item>
+ <item>gl_Fog</item>
+
+ <!-- Varying Variables -->
+ <item>gl_FrontColor</item>
+ <item>gl_BackColor</item>
+ <item>gl_FrontSecondaryColor</item>
+ <item>gl_BackSecondaryColor</item>
+ <item>gl_TexCoord</item>
+ <item>gl_FogFragCoord</item>
+ <item>gl_Color</item>
+ <item>gl_SecondaryColor</item>
+ </list>
+ <contexts>
+ <context attribute="Normal Text" lineEndContext="#stay" name="Normal">
+ <keyword attribute="Keyword" String="keywords" context="#stay" />
+ <keyword attribute="Data Type" String="types" context="#stay" />
+ <keyword attribute="Type Qualifier" String="typequal" context="#stay" />
+ <keyword attribute="StdFunction" String="stdlib" context="#stay" />
+ <keyword attribute="StdVariable" String="stdvar" context="#stay" />
+
+ <Float attribute="Float" context="#stay" />
+ <HlCOct attribute="Octal" context="#stay"/>
+ <HlCHex attribute="Hex" context="#stay"/>
+ <Int attribute="Decimal" context="#stay" />
+
+ <Detect2Chars attribute="Comment" context="Commentar 1" char="/" char1="/"/>
+ <Detect2Chars attribute="Comment" context="Commentar 2" char="/" char1="*" beginRegion="Comment"/>
+ <DetectChar attribute="Symbol" context="#stay" char="{" beginRegion="Brace1" />
+ <DetectChar attribute="Symbol" context="#stay" char="}" endRegion="Brace1" />
+
+ <DetectChar attribute="Preprocessor" context="Preprocessor" char="#" firstNonSpace="true"/>
+ <RegExpr attribute="Function" context="#stay" String="\b[_\w][_\w\d]*(?=[\s]*[(])" />
+
+ <RegExpr attribute="Symbol" context="Member" String="[.]{1,1}" />
+ <AnyChar attribute="Symbol" context="#stay" String=".+-/*%&lt;&gt;[]()^|&amp;~=!:;,?&#59;" />
+ </context>
+ <context name="Member" attribute="Normal Text" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop">
+ <RegExpr attribute="Function" context="#pop" String="\b[_\w][_\w\d]*(?=[\s]*)" />
+ </context>
+ <context name="Commentar 1" attribute="Comment" lineEndContext="#pop">
+ <keyword attribute="Alert" context="#stay" String="attention" />
+ </context>
+ <context name="Commentar 2" attribute="Comment" lineEndContext="#stay">
+ <Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" endRegion="Comment"/>
+ <keyword attribute="Alert" context="#stay" String="attention" />
+ </context>
+ <context name="Preprocessor" attribute="Preprocessor" lineEndContext="#pop">
+ </context>
+ </contexts>
+ <itemDatas>
+ <itemData name="Normal Text" defStyleNum="dsNormal"/>
+ <itemData name="Keyword" defStyleNum="dsKeyword"/>
+ <itemData name="Function" defStyleNum="dsFunction" bold="0"/>
+ <itemData name="StdFunction" defStyleNum="dsFunction" bold="1"/>
+ <itemData name="StdVariable" defStyleNum="dsFunction" bold="0"/>
+ <itemData name="Data Type" defStyleNum="dsDataType"/>
+ <itemData name="Type Qualifier" defStyleNum="dsDataType"/>
+ <itemData name="Decimal" defStyleNum="dsDecVal"/>
+ <itemData name="Octal" defStyleNum="dsBaseN"/>
+ <itemData name="Hex" defStyleNum="dsBaseN"/>
+ <itemData name="Float" defStyleNum="dsFloat"/>
+ <itemData name="Symbol" defStyleNum="dsNormal"/>
+ <itemData name="Preprocessor" defStyleNum="dsOthers"/>
+ <itemData name="Comment" defStyleNum="dsComment"/>
+ <itemData name="Alert" defStyleNum="dsAlert" />
+ </itemDatas>
+ </highlighting>
+ <general>
+ <comments>
+ <comment name="singleLine" start="//" />
+ <comment name="multiLine" start="/*" end="*/" />
+ </comments>
+ <keywords casesensitive="1" />
+ </general>
+</language>
diff --git a/kate/data/gnuassembler.xml b/kate/data/gnuassembler.xml
new file mode 100644
index 000000000..754e4fa02
--- /dev/null
+++ b/kate/data/gnuassembler.xml
@@ -0,0 +1,282 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+<!--
+
+*************************************************************************
+* *
+* Syntax highlighting for the GNU Assembler *
+* Copyright (C) 2002, John Zaitseff *
+* *
+*************************************************************************
+
+Updated: Roland Pabel <roland@pabel.name>
+Date: 15th August, 2002
+Version: 1.01
+
+Author: John Zaitseff <J.Zaitseff@zap.org.au>
+Date: 15th April, 2002
+Version: 1.0
+
+This file contains the XML syntax highlighting description for the GNU
+Assembler, for KATE, the KDE Advanced Editor. Keywords have been taken
+directly from the GNU Assembler source code (read.c).
+
+Known problems: Floating point highlighting does not work correctly.
+
+This program, including associated files, is free software. You may
+distribute it and/or modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either Version 2 of
+the license, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License along
+with this program; if not, write to the Free Software Foundation, Inc.,
+51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+-->
+
+<language name="GNU Assembler" version="1.05" kateversion="2.4" section="Assembler" extensions="*.s;*.S" mimetype="text/x-asm" author="John Zaitseff (J.Zaitseff@zap.org.au), Roland Pabel (roland@pabel.name)" license="GPL">
+ <highlighting>
+ <list name="keywords">
+ <item>.abort</item>
+ <item>.align</item>
+ <item>.appfile</item>
+ <item>.appline</item>
+ <item>.ascii</item>
+ <item>.asciz</item>
+ <item>.balign</item>
+ <item>.balignl</item>
+ <item>.balignw</item>
+ <item>.byte</item>
+ <item>.comm</item>
+ <item>.common.s</item>
+ <item>.common</item>
+ <item>.data</item>
+ <item>.dc.b</item>
+ <item>.dc.d</item>
+ <item>.dc.l</item>
+ <item>.dc.s</item>
+ <item>.dc.w</item>
+ <item>.dc.x</item>
+ <item>.dc</item>
+ <item>.dcb.b</item>
+ <item>.dcb.d</item>
+ <item>.dcb.l</item>
+ <item>.dcb.s</item>
+ <item>.dcb.w</item>
+ <item>.dcb.x</item>
+ <item>.dcb</item>
+ <item>.debug</item>
+ <item>.def</item>
+ <item>.desc</item>
+ <item>.dim</item>
+ <item>.double</item>
+ <item>.ds.b</item>
+ <item>.ds.d</item>
+ <item>.ds.l</item>
+ <item>.ds.p</item>
+ <item>.ds.s</item>
+ <item>.ds.w</item>
+ <item>.ds.x</item>
+ <item>.ds</item>
+ <item>.dsect</item>
+ <item>.eject</item>
+ <item>.else</item>
+ <item>.elsec</item>
+ <item>.elseif</item>
+ <item>.end</item>
+ <item>.endc</item>
+ <item>.endef</item>
+ <item>.endfunc</item>
+ <item>.endif</item>
+ <item>.endm</item>
+ <item>.endr</item>
+ <item>.equ</item>
+ <item>.equiv</item>
+ <item>.err</item>
+ <item>.exitm</item>
+ <item>.extend</item>
+ <item>.extern</item>
+ <item>.fail</item>
+ <item>.file</item>
+ <item>.fill</item>
+ <item>.float</item>
+ <item>.format</item>
+ <item>.func</item>
+ <item>.global</item>
+ <item>.globl</item>
+ <item>.hidden</item>
+ <item>.hword</item>
+ <item>.ident</item>
+ <item>.if</item>
+ <item>.ifc</item>
+ <item>.ifdef</item>
+ <item>.ifeq</item>
+ <item>.ifeqs</item>
+ <item>.ifge</item>
+ <item>.ifgt</item>
+ <item>.ifle</item>
+ <item>.iflt</item>
+ <item>.ifnc</item>
+ <item>.ifndef</item>
+ <item>.ifne</item>
+ <item>.ifnes</item>
+ <item>.ifnotdef</item>
+ <item>.include</item>
+ <item>.int</item>
+ <item>.internal</item>
+ <item>.irep</item>
+ <item>.irepc</item>
+ <item>.irp</item>
+ <item>.irpc</item>
+ <item>.lcomm</item>
+ <item>.lflags</item>
+ <item>.line</item>
+ <item>.linkonce</item>
+ <item>.list</item>
+ <item>.llen</item>
+ <item>.ln</item>
+ <item>.long</item>
+ <item>.lsym</item>
+ <item>.macro</item>
+ <item>.mexit</item>
+ <item>.name</item>
+ <item>.noformat</item>
+ <item>.nolist</item>
+ <item>.nopage</item>
+ <item>.octa</item>
+ <item>.offset</item>
+ <item>.org</item>
+ <item>.p2align</item>
+ <item>.p2alignl</item>
+ <item>.p2alignw</item>
+ <item>.page</item>
+ <item>.plen</item>
+ <item>.popsection</item>
+ <item>.previous</item>
+ <item>.print</item>
+ <item>.protected</item>
+ <item>.psize</item>
+ <item>.purgem</item>
+ <item>.pushsection</item>
+ <item>.quad</item>
+ <item>.rep</item>
+ <item>.rept</item>
+ <item>.rva</item>
+ <item>.sbttl</item>
+ <item>.scl</item>
+ <item>.sect.s</item>
+ <item>.sect</item>
+ <item>.section.s</item>
+ <item>.section</item>
+ <item>.set</item>
+ <item>.short</item>
+ <item>.single</item>
+ <item>.size</item>
+ <item>.skip</item>
+ <item>.sleb128</item>
+ <item>.space</item>
+ <item>.spc</item>
+ <item>.stabd</item>
+ <item>.stabn</item>
+ <item>.stabs</item>
+ <item>.string</item>
+ <item>.struct</item>
+ <item>.subsection</item>
+ <item>.symver</item>
+ <item>.tag</item>
+ <item>.text</item>
+ <item>.title</item>
+ <item>.ttl</item>
+ <item>.type</item>
+ <item>.uleb128</item>
+ <item>.use</item>
+ <item>.val</item>
+ <item>.version</item>
+ <item>.vtable_entry</item>
+ <item>.vtable_inherit</item>
+ <item>.weak</item>
+ <item>.word</item>
+ <item>.xcom</item>
+ <item>.xdef</item>
+ <item>.xref</item>
+ <item>.xstabs</item>
+ <item>.zero</item>
+ <!-- Directives specific to ARM -->
+ <item>.arm</item>
+ <item>.bss</item>
+ <item>.code</item>
+ <item>.even</item>
+ <item>.force_thumb</item>
+ <item>.ldouble</item>
+ <item>.loc</item>
+ <item>.ltorg</item>
+ <item>.packed</item>
+ <item>.pool</item>
+ <item>.req</item>
+ <item>.thumb</item>
+ <item>.thumb_func</item>
+ <item>.thumb_set</item>
+ </list>
+
+ <contexts>
+ <context attribute="Normal Text" lineEndContext="#stay" name="Normal">
+ <RegExpr attribute="Label" context="#stay" String="[A-Za-z0-9_.$]+:" firstNonSpace="true"/>
+ <keyword attribute="Keyword" context="#stay" String="keywords"/>
+ <HlCOct attribute="Octal" context="#stay" />
+ <HlCHex attribute="Hex" context="#stay" />
+ <RegExpr attribute="Binary" context="#stay" String="0[bB][01]+" />
+ <Int attribute="Decimal" context="#stay" />
+ <RegExpr attribute="Float" context="#stay" String="0[fFeEdD][-+]?[0-9]*\.?[0-9]*[eE]?[-+]?[0-9]+" />
+ <RegExpr attribute="Normal Text" context="#stay" String="[A-Za-z_.$][A-Za-z0-9_.$]*" />
+ <RegExpr attribute="Char" context="#stay" String="'(\\x[0-9a-fA-F][0-9a-fA-F]?|\\[0-7]?[0-7]?[0-7]?|\\.|.)" />
+ <DetectChar attribute="String" context="String" char="&quot;" />
+ <Detect2Chars attribute="Comment" context="Commentar 1" char="/" char1="*" />
+ <AnyChar attribute="Comment" context="Commentar 2" String="@;" />
+ <AnyChar attribute="Symbol" context="#stay" String="!#%&amp;*()+,-&lt;=&gt;?/:[]^{|}~" />
+ <RegExpr attribute="Preprocessor" context="Preprocessor" String="^#" />
+ </context>
+ <context attribute="Comment" lineEndContext="#stay" name="Commentar 1">
+ <Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" />
+ </context>
+ <context attribute="Comment" lineEndContext="#pop" name="Commentar 2" />
+ <context attribute="Preprocessor" lineEndContext="#pop" name="Preprocessor" />
+ <context attribute="String" lineEndContext="#pop" name="String">
+ <LineContinue attribute="String" context="Some Context" />
+ <HlCStringChar attribute="String Char" context="#stay" />
+ <DetectChar attribute="String" context="#pop" char="&quot;" />
+ </context>
+ <context attribute="Normal Text" lineEndContext="#pop" name="Some Context" />
+ </contexts>
+
+ <itemDatas>
+ <itemData name="Normal Text" defStyleNum="dsNormal" />
+ <itemData name="Label" defStyleNum="dsNormal" />
+ <itemData name="Keyword" defStyleNum="dsKeyword" />
+ <itemData name="Decimal" defStyleNum="dsDecVal" />
+ <itemData name="Octal" defStyleNum="dsBaseN" />
+ <itemData name="Hex" defStyleNum="dsBaseN" />
+ <itemData name="Binary" defStyleNum="dsBaseN" />
+ <itemData name="Float" defStyleNum="dsFloat" />
+ <itemData name="Char" defStyleNum="dsChar" />
+ <itemData name="String" defStyleNum="dsString" />
+ <itemData name="String Char" defStyleNum="dsChar" />
+ <itemData name="Symbol" defStyleNum="dsNormal" />
+ <itemData name="Comment" defStyleNum="dsComment" />
+ <itemData name="Preprocessor" defStyleNum="dsOthers" />
+ </itemDatas>
+ </highlighting>
+
+ <general>
+ <comments>
+ <comment name="singleLine" start=";" />
+ <comment name="singleLine" start="@" />
+ <comment name="multiLine" start="/*" end="*/" />
+ </comments>
+ <keywords casesensitive="1" weakDeliminator="_.$" />
+ </general>
+</language>
diff --git a/kate/data/haskell.xml b/kate/data/haskell.xml
new file mode 100644
index 000000000..81b09e76f
--- /dev/null
+++ b/kate/data/haskell.xml
@@ -0,0 +1,388 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+<!-- Haskell syntax highlighting by Marcel Martin <mmar@freenet.de> -->
+<language name="Haskell" version="1.05" kateversion="2.3" section="Sources" extensions="*.hs" author="Marcel Martin (mmar@freenet.de)" license="">
+ <highlighting>
+ <list name="keywords">
+ <item> case </item>
+ <item> class </item>
+ <item> data </item>
+ <item> deriving </item>
+ <item> do </item>
+ <item> else </item>
+ <item> if </item>
+ <item> import </item>
+ <item> in </item>
+ <item> infixl </item>
+ <item> infixr </item>
+ <item> instance </item>
+ <item> let </item>
+ <item> module </item>
+ <item> of </item>
+ <item> primitive </item>
+ <item> then </item>
+ <item> type </item>
+ <item> where </item>
+ </list>
+ <list name="infix operators">
+ <item> quot </item>
+ <item> rem </item>
+ <item> div </item>
+ <item> mod </item>
+ <item> elem </item>
+ <item> notElem </item>
+ <item> seq </item>
+ </list>
+ <list name="functions">
+ <!--
+ These operators are not handled yet.
+ <item> !! </item>
+ <item> % </item>
+ <item> && </item>
+ <item> $! </item>
+ <item> $ </item>
+ <item> * </item>
+ <item> ** </item>
+ <item> - </item>
+ <item> . </item>
+ <item> /= </item>
+ <item> < </item>
+ <item> <= </item>
+ <item> =<< </item>
+ <item> == </item>
+ <item> > </item>
+ <item> >= </item>
+ <item> >> </item>
+ <item> >>= </item>
+ <item> ^ </item>
+ <item> ^^ </item>
+ <item> ++ </item>
+ <item> || </item>
+ //-->
+
+ <item> FilePath </item>
+ <item> IOError </item>
+ <item> abs </item>
+ <item> acos </item>
+ <item> acosh </item>
+ <item> all </item>
+ <item> and </item>
+ <item> any </item>
+ <item> appendFile </item>
+ <item> approxRational </item>
+ <item> asTypeOf </item>
+ <item> asin </item>
+ <item> asinh </item>
+ <item> atan </item>
+ <item> atan2 </item>
+ <item> atanh </item>
+ <item> basicIORun </item>
+ <item> break </item>
+ <item> catch </item>
+ <item> ceiling </item>
+ <item> chr </item>
+ <item> compare </item>
+ <item> concat </item>
+ <item> concatMap </item>
+ <item> const </item>
+ <item> cos </item>
+ <item> cosh </item>
+ <item> curry </item>
+ <item> cycle </item>
+ <item> decodeFloat </item>
+ <item> denominator </item>
+ <item> digitToInt </item>
+ <item> div </item>
+ <item> divMod </item>
+ <item> drop </item>
+ <item> dropWhile </item>
+ <item> either </item>
+ <item> elem </item>
+ <item> encodeFloat </item>
+ <item> enumFrom </item>
+ <item> enumFromThen </item>
+ <item> enumFromThenTo </item>
+ <item> enumFromTo </item>
+ <item> error </item>
+ <item> even </item>
+ <item> exp </item>
+ <item> exponent </item>
+ <item> fail </item>
+ <item> filter </item>
+ <item> flip </item>
+ <item> floatDigits </item>
+ <item> floatRadix </item>
+ <item> floatRange </item>
+ <item> floor </item>
+ <item> fmap </item>
+ <item> foldl </item>
+ <item> foldl1 </item>
+ <item> foldr </item>
+ <item> foldr1 </item>
+ <item> fromDouble </item>
+ <item> fromEnum </item>
+ <item> fromInt </item>
+ <item> fromInteger </item>
+ <item> fromIntegral </item>
+ <item> fromRational </item>
+ <item> fst </item>
+ <item> gcd </item>
+ <item> getChar </item>
+ <item> getContents </item>
+ <item> getLine </item>
+ <item> head </item>
+ <item> id </item>
+ <item> inRange </item>
+ <item> index </item>
+ <item> init </item>
+ <item> intToDigit </item>
+ <item> interact </item>
+ <item> ioError </item>
+ <item> isAlpha </item>
+ <item> isAlphaNum </item>
+ <item> isAscii </item>
+ <item> isControl </item>
+ <item> isDenormalized </item>
+ <item> isDigit </item>
+ <item> isHexDigit </item>
+ <item> isIEEE </item>
+ <item> isInfinite </item>
+ <item> isLower </item>
+ <item> isNaN </item>
+ <item> isNegativeZero </item>
+ <item> isOctDigit </item>
+ <item> isPrint </item>
+ <item> isSpace </item>
+ <item> isUpper </item>
+ <item> iterate </item>
+ <item> last </item>
+ <item> lcm </item>
+ <item> length </item>
+ <item> lex </item>
+ <item> lexDigits </item>
+ <item> lexLitChar </item>
+ <item> lines </item>
+ <item> log </item>
+ <item> logBase </item>
+ <item> lookup </item>
+ <item> map </item>
+ <item> mapM </item>
+ <item> mapM_ </item>
+ <item> max </item>
+ <item> maxBound </item>
+ <item> maximum </item>
+ <item> maybe </item>
+ <item> min </item>
+ <item> minBound </item>
+ <item> minimum </item>
+ <item> mod </item>
+ <item> negate </item>
+ <item> not </item>
+ <item> notElem </item>
+ <item> null </item>
+ <item> numerator </item>
+ <item> odd </item>
+ <item> or </item>
+ <item> ord </item>
+ <item> otherwise </item>
+ <item> pi </item>
+ <item> pred </item>
+ <item> primExitWith </item>
+ <item> print </item>
+ <item> product </item>
+ <item> properFraction </item>
+ <item> putChar </item>
+ <item> putStr </item>
+ <item> putStrLn </item>
+ <item> quot </item>
+ <item> quotRem </item>
+ <item> range </item>
+ <item> rangeSize </item>
+ <item> read </item>
+ <item> readDec </item>
+ <item> readFile </item>
+ <item> readFloat </item>
+ <item> readHex </item>
+ <item> readIO </item>
+ <item> readInt </item>
+ <item> readList </item>
+ <item> readLitChar </item>
+ <item> readLn </item>
+ <item> readOct </item>
+ <item> readParen </item>
+ <item> readSigned </item>
+ <item> reads </item>
+ <item> readsPrec </item>
+ <item> realToFrac </item>
+ <item> recip </item>
+ <item> rem </item>
+ <item> repeat </item>
+ <item> replicate </item>
+ <item> return </item>
+ <item> reverse </item>
+ <item> round </item>
+ <item> scaleFloat </item>
+ <item> scanl </item>
+ <item> scanl1 </item>
+ <item> scanr </item>
+ <item> scanr1 </item>
+ <item> seq </item>
+ <item> sequence </item>
+ <item> sequence_ </item>
+ <item> show </item>
+ <item> showChar </item>
+ <item> showInt </item>
+ <item> showList </item>
+ <item> showLitChar </item>
+ <item> showParen </item>
+ <item> showSigned </item>
+ <item> showString </item>
+ <item> shows </item>
+ <item> showsPrec </item>
+ <item> significand </item>
+ <item> signum </item>
+ <item> sin </item>
+ <item> sinh </item>
+ <item> snd </item>
+ <item> span </item>
+ <item> splitAt </item>
+ <item> sqrt </item>
+ <item> subtract </item>
+ <item> succ </item>
+ <item> sum </item>
+ <item> tail </item>
+ <item> take </item>
+ <item> takeWhile </item>
+ <item> tan </item>
+ <item> tanh </item>
+ <item> threadToIOResult </item>
+ <item> toEnum </item>
+ <item> toInt </item>
+ <item> toInteger </item>
+ <item> toLower </item>
+ <item> toRational </item>
+ <item> toUpper </item>
+ <item> truncate </item>
+ <item> uncurry </item>
+ <item> undefined </item>
+ <item> unlines </item>
+ <item> until </item>
+ <item> unwords </item>
+ <item> unzip </item>
+ <item> unzip3 </item>
+ <item> userError </item>
+ <item> words </item>
+ <item> writeFile </item>
+ <item> zip </item>
+ <item> zip3 </item>
+ <item> zipWith </item>
+ <item> zipWith3 </item>
+ </list>
+ <list name="type constructors">
+ <item> Bool </item>
+ <item> Char </item>
+ <item> Double </item>
+ <item> Either </item>
+ <item> Float </item>
+ <item> IO </item>
+ <item> Integer </item>
+ <item> Int </item>
+ <item> Maybe </item>
+ <item> Ordering </item>
+ <item> Rational </item>
+ <item> Ratio </item>
+ <item> ReadS </item>
+ <item> ShowS </item>
+ <item> String </item>
+
+ </list>
+ <list name="classes">
+ <item> Bounded </item>
+ <item> Enum </item>
+ <item> Eq </item>
+ <item> Floating </item>
+ <item> Fractional </item>
+ <item> Functor </item>
+ <item> Integral </item>
+ <item> Ix </item>
+ <item> Monad </item>
+ <item> Num </item>
+ <item> Ord </item>
+ <item> Read </item>
+ <item> RealFloat </item>
+ <item> RealFrac </item>
+ <item> Real </item>
+ <item> Show </item>
+ </list>
+ <list name="data constructors">
+ <item> EQ </item>
+ <item> False </item>
+ <item> GT </item>
+ <item> Just </item>
+ <item> LT </item>
+ <item> Left </item>
+ <item> Nothing </item>
+ <item> Right </item>
+ <item> True </item>
+ </list>
+ <contexts>
+ <context attribute="Normal Text" lineEndContext="#stay" name="normal">
+ <Detect2Chars attribute="Comment" context="comment_multi_line" char="{" char1="-" />
+ <Detect2Chars attribute="Comment" context="comment_single_line" char="-" char1="-" />
+ <keyword attribute="Keyword" context="#stay" String="keywords" />
+ <keyword attribute="Class" context="#stay" String="classes" />
+ <keyword attribute="Type Constructor" context="#stay" String="type constructors" />
+ <keyword attribute="Function" context="#stay" String="functions" />
+ <keyword attribute="Data Constructor" context="#stay" String="data constructors" />
+ <DetectChar attribute="String" context="string" char="&quot;" />
+ <DetectChar attribute="Infix Operator" context="infix" char="`"/>
+ <RegExpr attribute="Normal Text" context="#stay" String="\w[']+" />
+ <DetectChar attribute="Char" context="single_char" char="'" />
+ <RegExpr attribute="Function Definition" context="#stay" String="[a-z_]+\w*'*\s*::" />
+ <Float attribute="Float" context="#stay" />
+ <Int attribute="Decimal" context="#stay" />
+ </context>
+ <context attribute="Comment" lineEndContext="#pop" name="comment_single_line" />
+ <context attribute="Comment" lineEndContext="#stay" name="comment_multi_line">
+ <Detect2Chars attribute="Comment" context="#pop" char="-" char1="}" />
+ </context>
+ <context attribute="String" lineEndContext="#stay" name="string">
+ <RegExpr attribute="String" context="#stay" String="\\." />
+ <DetectChar attribute="String" context="#pop" char="&quot;" />
+ </context>
+ <context attribute="Infix Operator" lineEndContext="#stay" name="infix">
+ <DetectChar attribute="Infix Operator" context="#pop" char="`"/>
+ </context>
+ <context attribute="Char" lineEndContext="#pop" name="single_char">
+ <RegExpr attribute="Char" context="#stay" String="\\." />
+ <DetectChar attribute="Char" context="#pop" char="'" />
+ </context>
+ <context attribute="Function Definition" lineEndContext="#pop" name="function_definition">
+ <DetectChar attribute="Function Definition" context="#pop" char=";" />
+ </context>
+ </contexts>
+ <itemDatas>
+ <itemData name="Normal Text" defStyleNum="dsNormal"/>
+ <itemData name="Keyword" defStyleNum="dsKeyword"/>
+ <itemData name="Function" defStyleNum="dsFunction"/>
+ <itemData name="Function Definition" defStyleNum="dsFunction"/>
+ <itemData name="Class" defStyleNum="dsKeyword"/>
+ <itemData name="Decimal" defStyleNum="dsDecVal"/>
+ <itemData name="Float" defStyleNum="dsFloat"/>
+ <itemData name="Char" defStyleNum="dsChar"/>
+ <itemData name="String" defStyleNum="dsString"/>
+ <itemData name="Constructor" defStyleNum="dsOthers"/>
+ <itemData name="Comment" defStyleNum="dsComment"/>
+ <itemData name="Data Constructor" defStyleNum="dsKeyword"/>
+ <itemData name="Type Constructor" defStyleNum="dsDataType"/>
+ <itemData name="Infix Operator" defStyleNum="dsOthers"/>
+ </itemDatas>
+ </highlighting>
+ <general>
+ <comments>
+ <comment name="singleLine" start="--" />
+ <comment name="multiLine" start="{-" end="-}" />
+ </comments>
+ <keywords casesensitive="1" />
+ </general>
+</language>
diff --git a/kate/data/html.xml b/kate/data/html.xml
new file mode 100644
index 000000000..f7477e8e0
--- /dev/null
+++ b/kate/data/html.xml
@@ -0,0 +1,201 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd"
+[
+ <!ENTITY name "[A-Za-z_:][\w.:_-]*">
+ <!ENTITY entref "&amp;(#[0-9]+|#[xX][0-9A-Fa-f]+|&name;);">
+]>
+<language name="HTML" version="1.98" kateversion="2.4" section="Markup" extensions="*.htm;*.html;*.shtml;*.shtm" mimetype="text/html" author="Wilbert Berendsen (wilbert@kde.nl)" license="LGPL" priority="10">
+
+<highlighting>
+<contexts>
+ <context name="Start" attribute="Normal Text" lineEndContext="#stay">
+ <IncludeRules context="FindHTML" />
+ </context>
+
+ <context name="FindHTML" attribute="Normal Text" lineEndContext="#stay">
+ <DetectSpaces/>
+ <DetectIdentifier/>
+ <StringDetect attribute="Comment" context="Comment" String="&lt;!--" beginRegion="comment" />
+ <StringDetect attribute="CDATA" context="CDATA" String="&lt;![CDATA[" beginRegion="cdata" />
+ <RegExpr attribute="Doctype" context="Doctype" String="&lt;!DOCTYPE\s+" beginRegion="doctype" />
+ <RegExpr attribute="Processing Instruction" context="PI" String="&lt;\?[\w:-]*" beginRegion="pi" />
+ <RegExpr attribute="Element" context="CSS" String="&lt;style\b" insensitive="TRUE" beginRegion="style" />
+ <RegExpr attribute="Element" context="JS" String="&lt;script\b" insensitive="TRUE" beginRegion="script" />
+ <RegExpr attribute="Element" context="El Open" String="&lt;pre\b" insensitive="TRUE" beginRegion="pre" />
+ <RegExpr attribute="Element" context="El Open" String="&lt;div\b" insensitive="TRUE" beginRegion="div" />
+ <RegExpr attribute="Element" context="El Open" String="&lt;table\b" insensitive="TRUE" beginRegion="table" />
+ <RegExpr attribute="Element" context="El Open" String="&lt;&name;" />
+ <RegExpr attribute="Element" context="El Close" String="&lt;/pre\b" insensitive="TRUE" endRegion="pre" />
+ <RegExpr attribute="Element" context="El Close" String="&lt;/div\b" insensitive="TRUE" endRegion="div" />
+ <RegExpr attribute="Element" context="El Close" String="&lt;/table\b" insensitive="TRUE" endRegion="table" />
+ <RegExpr attribute="Element" context="El Close" String="&lt;/&name;" />
+ <!-- as long as kde gives DTDs the text/html mimetype--><IncludeRules context="FindDTDRules" />
+ <IncludeRules context="FindEntityRefs" />
+ </context>
+
+ <context name="FindEntityRefs" attribute="Normal Text" lineEndContext="#stay">
+ <RegExpr attribute="EntityRef" context="#stay" String="&entref;" />
+ <AnyChar attribute="Error" context="#stay" String="&amp;&lt;" />
+ </context>
+
+ <context name="FindPEntityRefs" attribute="Normal Text" lineEndContext="#stay">
+ <RegExpr attribute="EntityRef" context="#stay" String="&entref;" />
+ <RegExpr attribute="PEntityRef" context="#stay" String="%&name;;" />
+ <AnyChar attribute="Error" context="#stay" String="&amp;%" />
+ </context>
+
+ <context name="FindAttributes" attribute="Normal Text" lineEndContext="#stay">
+ <RegExpr attribute="Attribute" context="#stay" String="&name;" column="0"/>
+ <RegExpr attribute="Attribute" context="#stay" String="\s+&name;" />
+ <DetectChar attribute="Attribute" context="Value" char="=" />
+ </context>
+
+ <context name="FindDTDRules" attribute="Normal Text" lineEndContext="#stay">
+ <RegExpr attribute="Doctype" context="Doctype Markupdecl" String="&lt;!(ELEMENT|ENTITY|ATTLIST|NOTATION)\b" />
+ </context>
+
+
+ <context name="Comment" attribute="Comment" lineEndContext="#stay">
+ <DetectSpaces/>
+ <IncludeRules context="##Alerts" />
+ <DetectIdentifier/>
+ <StringDetect attribute="Comment" context="#pop" String="--&gt;" endRegion="comment" />
+ <RegExpr attribute="Error" context="#stay" String="-(-(?!-&gt;))+" />
+ </context>
+
+ <context name="CDATA" attribute="Normal Text" lineEndContext="#stay">
+ <DetectSpaces/>
+ <DetectIdentifier/>
+ <StringDetect attribute="CDATA" context="#pop" String="]]&gt;" endRegion="cdata" />
+ <StringDetect attribute="EntityRef" context="#stay" String="]]&amp;gt;" />
+ </context>
+
+ <context name="PI" attribute="Normal Text" lineEndContext="#stay">
+ <Detect2Chars attribute="Processing Instruction" context="#pop" char="?" char1="&gt;" endRegion="pi" />
+ </context>
+
+ <context name="Doctype" attribute="Normal Text" lineEndContext="#stay">
+ <DetectChar attribute="Doctype" context="#pop" char="&gt;" endRegion="doctype" />
+ <DetectChar attribute="Doctype" context="Doctype Internal Subset" char="[" beginRegion="int_subset" />
+ </context>
+
+ <context name="Doctype Internal Subset" attribute="Normal Text" lineEndContext="#stay">
+ <DetectChar attribute="Doctype" context="#pop" char="]" endRegion="int_subset" />
+ <IncludeRules context="FindDTDRules" />
+ <StringDetect attribute="Comment" context="Comment" String="&lt;!--" beginRegion="comment" />
+ <RegExpr attribute="Processing Instruction" context="PI" String="&lt;\?[\w:-]*" beginRegion="pi" />
+ <IncludeRules context="FindPEntityRefs" />
+ </context>
+
+ <context name="Doctype Markupdecl" attribute="Normal Text" lineEndContext="#stay">
+ <DetectChar attribute="Doctype" context="#pop" char="&gt;" />
+ <DetectChar attribute="Value" context="Doctype Markupdecl DQ" char="&quot;" />
+ <DetectChar attribute="Value" context="Doctype Markupdecl SQ" char="&apos;" />
+ </context>
+
+ <context name="Doctype Markupdecl DQ" attribute="Value" lineEndContext="#stay">
+ <DetectChar attribute="Value" context="#pop" char="&quot;" />
+ <IncludeRules context="FindPEntityRefs" />
+ </context>
+
+ <context name="Doctype Markupdecl SQ" attribute="Value" lineEndContext="#stay">
+ <DetectChar attribute="Value" context="#pop" char="&apos;" />
+ <IncludeRules context="FindPEntityRefs" />
+ </context>
+
+ <context name="El Open" attribute="Normal Text" lineEndContext="#stay">
+ <Detect2Chars attribute="Element" context="#pop" char="/" char1="&gt;" />
+ <DetectChar attribute="Element" context="#pop" char="&gt;" />
+ <IncludeRules context="FindAttributes" />
+ <RegExpr attribute="Error" context="#stay" String="\S" />
+ </context>
+
+ <context name="El Close" attribute="Normal Text" lineEndContext="#stay">
+ <DetectChar attribute="Element" context="#pop" char="&gt;" />
+ <RegExpr attribute="Error" context="#stay" String="\S" />
+ </context>
+
+ <context name="El Close 2" attribute="Normal Text" lineEndContext="#stay">
+ <DetectChar attribute="Element" context="#pop#pop#pop" char="&gt;" />
+ <RegExpr attribute="Error" context="#stay" String="\S" />
+ </context>
+
+ <context name="El Close 3" attribute="Normal Text" lineEndContext="#stay">
+ <DetectChar attribute="Element" context="#pop#pop#pop#pop" char="&gt;" />
+ <RegExpr attribute="Error" context="#stay" String="\S" />
+ </context>
+
+ <context name="CSS" attribute="Normal Text" lineEndContext="#stay">
+ <Detect2Chars attribute="Element" context="#pop" char="/" char1="&gt;" endRegion="style" />
+ <DetectChar attribute="Element" context="CSS content" char="&gt;" />
+ <IncludeRules context="FindAttributes" />
+ <RegExpr attribute="Error" context="#stay" String="\S" />
+ </context>
+
+ <context name="CSS content" attribute="Normal Text" lineEndContext="#stay">
+ <RegExpr attribute="Element" context="El Close 2" String="&lt;/style\b" insensitive="TRUE" endRegion="style" />
+ <IncludeRules context="##CSS" includeAttrib="true"/>
+ </context>
+
+ <context name="JS" attribute="Normal Text" lineEndContext="#stay">
+ <Detect2Chars attribute="Element" context="#pop" char="/" char1="&gt;" endRegion="script" />
+ <DetectChar attribute="Element" context="JS content" char="&gt;" />
+ <IncludeRules context="FindAttributes" />
+ <RegExpr attribute="Error" context="#stay" String="\S" />
+ </context>
+
+ <context name="JS content" attribute="Normal Text" lineEndContext="#stay">
+ <RegExpr attribute="Element" context="El Close 2" String="&lt;/script\b" insensitive="TRUE" endRegion="script" />
+ <RegExpr attribute="Comment" context="JS comment close" String="//(?=.*&lt;/script\b)" insensitive="TRUE" />
+ <IncludeRules context="##JavaScript" includeAttrib="true"/>
+ </context>
+
+ <context name="JS comment close" attribute="Comment" lineEndContext="#pop">
+ <RegExpr attribute="Element" context="El Close 3" String="&lt;/script\b" insensitive="TRUE" endRegion="script" />
+ <IncludeRules context="##Alerts" />
+ </context>
+
+ <context name="Value" attribute="Normal Text" lineEndContext="#stay" fallthrough="true" fallthroughContext="Value NQ">
+ <DetectChar attribute="Value" context="Value DQ" char="&quot;" />
+ <DetectChar attribute="Value" context="Value SQ" char="&apos;" />
+ <DetectSpaces />
+ </context>
+
+ <context name="Value NQ" attribute="Normal Text" lineEndContext="#pop#pop" fallthrough="true" fallthroughContext="#pop#pop">
+ <IncludeRules context="FindEntityRefs" />
+ <RegExpr attribute="Value" context="#stay" String="/(?!&gt;)" />
+ <RegExpr attribute="Value" context="#stay" String="[^/&gt;&lt;&quot;&apos;\s]" />
+ </context>
+
+ <context name="Value DQ" attribute="Value" lineEndContext="#stay">
+ <DetectChar attribute="Value" context="#pop#pop" char="&quot;" />
+ <IncludeRules context="FindEntityRefs" />
+ </context>
+
+ <context name="Value SQ" attribute="Value" lineEndContext="#stay">
+ <DetectChar attribute="Value" context="#pop#pop" char="&apos;" />
+ <IncludeRules context="FindEntityRefs" />
+ </context>
+
+</contexts>
+<itemDatas>
+ <itemData name="Normal Text" defStyleNum="dsNormal" />
+ <itemData name="Comment" defStyleNum="dsComment" />
+ <itemData name="CDATA" defStyleNum="dsBaseN" bold="1" />
+ <itemData name="Processing Instruction" defStyleNum="dsKeyword" />
+ <itemData name="Doctype" defStyleNum="dsDataType" bold="1" />
+ <itemData name="Element" defStyleNum="dsKeyword" />
+ <itemData name="Attribute" defStyleNum="dsOthers" />
+ <itemData name="Value" defStyleNum="dsString" color="#a00" />
+ <itemData name="EntityRef" defStyleNum="dsDecVal" />
+ <itemData name="PEntityRef" defStyleNum="dsDecVal" />
+ <itemData name="Error" defStyleNum="dsError" />
+</itemDatas>
+
+</highlighting>
+<general>
+ <comments>
+ <comment name="multiLine" start="&lt;!--" end="--&gt;" />
+ </comments>
+</general>
+</language>
diff --git a/kate/data/idconsole.xml b/kate/data/idconsole.xml
new file mode 100644
index 000000000..fa2a5cffd
--- /dev/null
+++ b/kate/data/idconsole.xml
@@ -0,0 +1,2146 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+<language name="Quake Script" version="1.02" kateversion="2.1" section="Scripts" extensions="*.cfg" mimetype="">
+
+<highlighting>
+<list name="Commands">
+<item> ForceCloseComman </item>
+<item> _config_com_baud </item>
+<item> _config_com_modem </item>
+<item> _vid_default_mode </item>
+<item> _vid_default_mode_win </item>
+<item> _vid_wait_override </item>
+<item> _windowed_mouse </item>
+<item> addip </item>
+<item> addressbook </item>
+<item> adjust_crosshair </item>
+<item> advancedupdate </item>
+<item> allow_download </item>
+<item> allow_download_maps </item>
+<item> allow_download_models </item>
+<item> allow_download_skins </item>
+<item> allow_download_sounds </item>
+<item> allskins </item>
+<item> appenddemo </item>
+<item> autosave </item>
+<item> ban </item>
+<item> banClient </item>
+<item> banUser </item>
+<item> banid </item>
+<item> baseskin </item>
+<item> begin </item>
+<item> bf </item>
+<item> bgetmod </item>
+<item> bindlist </item>
+<item> block_switch </item>
+<item> bottomcolor </item>
+<item> buyNow </item>
+<item> buyequip </item>
+<item> cache_endgather </item>
+<item> cache_flush </item>
+<item> cache_mapchange </item>
+<item> cache_print </item>
+<item> cache_profile </item>
+<item> cache_setindex </item>
+<item> cache_startgather </item>
+<item> cache_usedfile </item>
+<item> cancelselect </item>
+<item> cd </item>
+<item> centerview </item>
+<item> changeVectors </item>
+<item> changelevel </item>
+<item> changelevel2 </item>
+<item> changing </item>
+<item> chase_active </item>
+<item> cinematic </item>
+<item> cl_deadbodyfilter </item>
+<item> cl_gibfilter </item>
+<item> cl_hightrack </item>
+<item> cl_hudswap </item>
+<item> cl_messages </item>
+<item> cl_nodelta </item>
+<item> cl_nolerp </item>
+<item> cl_nopred </item>
+<item> cl_predict_players </item>
+<item> cl_rate </item>
+<item> cl_sbar </item>
+<item> cl_sbar_separator </item>
+<item> cl_shownet </item>
+<item> cl_sidespeed </item>
+<item> cl_solid_players </item>
+<item> cl_warncmd </item>
+<item> cl_writecfg </item>
+<item> clear </item>
+<item> clearplayers </item>
+<item> clientinfo </item>
+<item> clientkick </item>
+<item> cmd </item>
+<item> cmdline </item>
+<item> cmdlist </item>
+<item> color </item>
+<item> commands </item>
+<item> condebug </item>
+<item> condump </item>
+<item> configstrings </item>
+<item> confirm_quit </item>
+<item> connect </item>
+<item> contimes </item>
+<item> coop </item>
+<item> crash </item>
+<item> credits </item>
+<item> cropimages </item>
+<item> crosshair </item>
+<item> cvar_restart </item>
+<item> cvarlist </item>
+<item> d_mipcap </item>
+<item> d_subdiv16 </item>
+<item> deathmatch </item>
+<item> delta_clear </item>
+<item> delta_stats </item>
+<item> demo </item>
+<item> demolist </item>
+<item> demomap </item>
+<item> demos </item>
+<item> developer </item>
+<item> devmap </item>
+<item> dir </item>
+<item> disconnect </item>
+<item> dlfile </item>
+<item> dmoptions </item>
+<item> download </item>
+<item> drawradar </item>
+<item> drop </item>
+<item> dropclient </item>
+<item> dumpuser </item>
+<item> edict </item>
+<item> edictcount </item>
+<item> edicts </item>
+<item> endmovie </item>
+<item> entities </item>
+<item> envmap </item>
+<item> error </item>
+<item> escape </item>
+<item> exec </item>
+<item> exit </item>
+<item> fastsprites </item>
+<item> fdir </item>
+<item> filterban </item>
+<item> firstperson </item>
+<item> floodprot </item>
+<item> floodprotmsg </item>
+<item> flush </item>
+<item> fly </item>
+<item> force_centerview </item>
+<item> fov </item>
+<item> fraglogfile </item>
+<item> freelook </item>
+<item> freeze </item>
+<item> front </item>
+<item> fs_openedList </item>
+<item> fs_referencedList </item>
+<item> fullinfo </item>
+<item> fullserverinfo </item>
+<item> game </item>
+<item> gameCompleteStatus </item>
+<item> gamedir </item>
+<item> gamemap </item>
+<item> gameversion </item>
+<item> getcertificate </item>
+<item> gfxinfo </item>
+<item> gg </item>
+<item> gib </item>
+<item> gibload </item>
+<item> gibstats </item>
+<item> give </item>
+<item> gl_affinemodels </item>
+<item> gl_clear </item>
+<item> gl_colorlights </item>
+<item> gl_constretch </item>
+<item> gl_cull </item>
+<item> gl_dlight_lightmap </item>
+<item> gl_dlight_polyblend </item>
+<item> gl_dlight_smooth </item>
+<item> gl_fb_bmodels </item>
+<item> gl_fb_models </item>
+<item> gl_finish </item>
+<item> gl_fires </item>
+<item> gl_flashblend </item>
+<item> gl_keeptjunctions </item>
+<item> gl_lerp_anim </item>
+<item> gl_lightmode </item>
+<item> gl_max_size </item>
+<item> gl_multitexture </item>
+<item> gl_nobind </item>
+<item> gl_nocolors </item>
+<item> gl_picmip </item>
+<item> gl_playermip </item>
+<item> gl_polyblend </item>
+<item> gl_reportjunctions </item>
+<item> gl_sky_clip </item>
+<item> gl_skymultipass </item>
+<item> gl_smoothmodels </item>
+<item> gl_texsort </item>
+<item> gl_texturemode </item>
+<item> gl_triplebuffer </item>
+<item> gl_ztrick </item>
+<item> globalservers </item>
+<item> god </item>
+<item> gun </item>
+<item> gun_model </item>
+<item> gun_next </item>
+<item> gun_prev </item>
+<item> gunsmoke </item>
+<item> heartbeat </item>
+<item> help </item>
+<item> hideconsole </item>
+<item> hideradar </item>
+<item> host_speeds </item>
+<item> hostname </item>
+<item> hpkextract </item>
+<item> hpklist </item>
+<item> hpkremove </item>
+<item> hpkval </item>
+<item> hud_centerid </item>
+<item> imagelist </item>
+<item> impulse </item>
+<item> imt </item>
+<item> in_bind </item>
+<item> in_paste_buffer </item>
+<item> in_restart </item>
+<item> in_unbind </item>
+<item> info </item>
+<item> interp </item>
+<item> invdrop </item>
+<item> inven </item>
+<item> invnext </item>
+<item> invnextp </item>
+<item> invnextw </item>
+<item> invprev </item>
+<item> invprevp </item>
+<item> invprevw </item>
+<item> invuse </item>
+<item> joinserver </item>
+<item> joy </item>
+<item> joy_advancedupdate </item>
+<item> joy_enable </item>
+<item> joyadvanced </item>
+<item> joyadvancedupdat </item>
+<item> joyadvancedupdate </item>
+<item> joyname </item>
+<item> joystick </item>
+<item> keys </item>
+<item> kick </item>
+<item> kill </item>
+<item> killserver </item>
+<item> lefthand </item>
+<item> link </item>
+<item> list </item>
+<item> listdemo </item>
+<item> listen </item>
+<item> listid </item>
+<item> listip </item>
+<item> listmaps </item>
+<item> load </item>
+<item> loadas8bit </item>
+<item> loadgame </item>
+<item> loading </item>
+<item> loadsky </item>
+<item> loadtranslations </item>
+<item> loc </item>
+<item> localinfo </item>
+<item> localservers </item>
+<item> log </item>
+<item> logaddress </item>
+<item> logfile </item>
+<item> lookspring </item>
+<item> lookstrafe </item>
+<item> m_filter </item>
+<item> main </item>
+<item> map </item>
+<item> map_restart </item>
+<item> maplist </item>
+<item> maps </item>
+<item> maxplayers </item>
+<item> max_smokepuffs </item>
+<item> max_shells </item>
+<item> mcache </item>
+<item> meminfo </item>
+<item> menu </item>
+<item> menu_addressbook </item>
+<item> menu_credits </item>
+<item> menu_help </item>
+<item> menu_keys </item>
+<item> menu_load </item>
+<item> menu_loadgame </item>
+<item> menu_main </item>
+<item> menu_multiplayer </item>
+<item> menu_options </item>
+<item> menu_playerconfig </item>
+<item> menu_quit </item>
+<item> menu_save </item>
+<item> menu_savegame </item>
+<item> menu_setup </item>
+<item> menu_select </item>
+<item> menu_singleplayer </item>
+<item> menu_startserver </item>
+<item> menu_video </item>
+<item> menu_dmoptions </item>
+<item> menu_game </item>
+<item> menu_joinserver </item>
+<item> messagemode </item>
+<item> messagemode2 </item>
+<item> messagemode3 </item>
+<item> messagemode4 </item>
+<item> model </item>
+<item> modelist </item>
+<item> modellist </item>
+<item> msg </item>
+<item> multiplayer </item>
+<item> music </item>
+<item> name </item>
+<item> net_stats </item>
+<item> new </item>
+<item> next </item>
+<item> nextul </item>
+<item> nightvision </item>
+<item> no_pogo_stick </item>
+<item> noaim </item>
+<item> noclip </item>
+<item> noexit </item>
+<item> nomonsters </item>
+<item> noskins </item>
+<item> nosound </item>
+<item> notarget </item>
+<item> options </item>
+<item> packet </item>
+<item> password </item>
+<item> path </item>
+<item> pausable </item>
+<item> pause </item>
+<item> paused </item>
+<item> ping </item>
+<item> pingservers </item>
+<item> play </item>
+<item> playdemo </item>
+<item> playerconfig </item>
+<item> players </item>
+<item> playvol </item>
+<item> pushlatency </item>
+<item> pointfile </item>
+<item> ppdemostart </item>
+<item> pr_boundscheck </item>
+<item> precache </item>
+<item> prespawn </item>
+<item> prev </item>
+<item> profile </item>
+<item> profilequit </item>
+<item> prog </item>
+<item> quit </item>
+<item> r_drawentities </item>
+<item> r_drawflat </item>
+<item> r_draworder </item>
+<item> r_drawviewmodel </item>
+<item> r_dspeeds </item>
+<item> r_dynamic </item>
+<item> r_fullbright </item>
+<item> r_lightmap </item>
+<item> r_netgraph </item>
+<item> r_netgraph_box </item>
+<item> r_norefresh </item>
+<item> r_novis </item>
+<item> r_numedges </item>
+<item> r_numsurfs </item>
+<item> r_particles </item>
+<item> r_polymodelstats </item>
+<item> r_reportsurfout </item>
+<item> r_shadows </item>
+<item> r_speeds </item>
+<item> r_timegraph </item>
+<item> r_wateralpha </item>
+<item> r_waterripple </item>
+<item> r_waterwarp </item>
+<item> r_zgraph </item>
+<item> rcon </item>
+<item> rcon_password </item>
+<item> reconnect </item>
+<item> record </item>
+<item> registered </item>
+<item> reload </item>
+<item> removedemo </item>
+<item> removeid </item>
+<item> removeip </item>
+<item> rerecord </item>
+<item> reset </item>
+<item> resetrcon </item>
+<item> restart </item>
+<item> retry </item>
+<item> s_disable_a3d </item>
+<item> s_enable_a3d </item>
+<item> s_info </item>
+<item> s_list </item>
+<item> s_stop </item>
+<item> samelevel </item>
+<item> save </item>
+<item> savegame </item>
+<item> savetranslations </item>
+<item> score </item>
+<item> screenshot </item>
+<item> screenshotJPEG </item>
+<item> sectorlist </item>
+<item> sendents </item>
+<item> serverinfo </item>
+<item> serverprofile </item>
+<item> serverrecord </item>
+<item> serverstatus </item>
+<item> serverstop </item>
+<item> setRecommended </item>
+<item> setdemoinfo </item>
+<item> setenv </item>
+<item> setinfo </item>
+<item> setmaster </item>
+<item> setrom </item>
+<item> shaderlist </item>
+<item> show_fps </item>
+<item> show_time </item>
+<item> showdrop </item>
+<item> showinfo </item>
+<item> showip </item>
+<item> showpackets </item>
+<item> showpause </item>
+<item> showram </item>
+<item> showturtle </item>
+<item> shutdownserver </item>
+<item> singlePlayLink </item>
+<item> sizedown </item>
+<item> sizeup </item>
+<item> skill </item>
+<item> skin </item>
+<item> skinlist </item>
+<item> skins </item>
+<item> sky </item>
+<item> skyboxlist </item>
+<item> slist </item>
+<item> slot1 </item>
+<item> slot10 </item>
+<item> slot2 </item>
+<item> slot3 </item>
+<item> slot4 </item>
+<item> slot5 </item>
+<item> slot6 </item>
+<item> slot7 </item>
+<item> slot8 </item>
+<item> slot9 </item>
+<item> snap </item>
+<item> snapall </item>
+<item> snapshot </item>
+<item> snapto </item>
+<item> snd </item>
+<item> snd_noextraupdate </item>
+<item> snd_restart </item>
+<item> snd_show </item>
+<item> soundfade </item>
+<item> soundinfo </item>
+<item> soundlist </item>
+<item> spawn </item>
+<item> spdevmap </item>
+<item> speak </item>
+<item> special </item>
+<item> specmode </item>
+<item> spectator </item>
+<item> spectator_password </item>
+<item> spk </item>
+<item> spmap </item>
+<item> startLimboMode </item>
+<item> startSingleplayer </item>
+<item> startdemos </item>
+<item> startmovie </item>
+<item> startserver </item>
+<item> stat </item>
+<item> stats </item>
+<item> status </item>
+<item> stop </item>
+<item> stopLimboMode </item>
+<item> stopdemo </item>
+<item> stoprecord </item>
+<item> stopsound </item>
+<item> stopul </item>
+<item> streamingsound </item>
+<item> stuffcmd </item>
+<item> stuffcmds </item>
+<item> sv </item>
+<item> sv_allow_log </item>
+<item> sv_allow_pings </item>
+<item> sv_allow_status </item>
+<item> sv_gamedir </item>
+<item> sv_highchars </item>
+<item> sv_mapcheck </item>
+<item> sv_nostep </item>
+<item> sv_spectatormaxspeed </item>
+<item> sv_spetalk </item>
+<item> sv_maplist </item>
+<item> swapdemo </item>
+<item> sys_cpuid </item>
+<item> sys_dead_sleep </item>
+<item> sys_extrasleep </item>
+<item> sys_nostdout </item>
+<item> systeminfo </item>
+<item> taginfo </item>
+<item> team </item>
+<item> teamplay </item>
+<item> tell </item>
+<item> test </item>
+<item> test2 </item>
+<item> time </item>
+<item> thirdperson </item>
+<item> timedemo </item>
+<item> timeleft </item>
+<item> timerefresh </item>
+<item> toggle </item>
+<item> togglebrowser </item>
+<item> togglechat </item>
+<item> toggleconsole </item>
+<item> togglemenu </item>
+<item> topcolor </item>
+<item> touchFile </item>
+<item> trackplayer </item>
+<item> ui_restart </item>
+<item> unalias </item>
+<item> unbindall </item>
+<item> updatehunkusage </item>
+<item> updatescreen </item>
+<item> upload </item>
+<item> use </item>
+<item> user </item>
+<item> userinfo </item>
+<item> users </item>
+<item> v_centerspeed </item>
+<item> v_cshift </item>
+<item> v_idlescale </item>
+<item> version </item>
+<item> vid </item>
+<item> vid_center </item>
+<item> vid_config_x </item>
+<item> vid_describecurrentmode </item>
+<item> vid_describemode </item>
+<item> vid_describemodes </item>
+<item> vid_forcemode </item>
+<item> vid_fullscreen </item>
+<item> vid_fullscreen_mode </item>
+<item> vid_minimize </item>
+<item> vid_nopageflip </item>
+<item> vid_nummodes </item>
+<item> vid_restart </item>
+<item> vid_stretch_by_2 </item>
+<item> vid_testmode </item>
+<item> vid_windowed </item>
+<item> vid_windowed_mode </item>
+<item> vid_front </item>
+<item> video </item>
+<item> viewframe </item>
+<item> viewmodel </item>
+<item> viewnext </item>
+<item> viewpos </item>
+<item> viewprev </item>
+<item> vminfo </item>
+<item> vmprofile </item>
+<item> voice_showbanned </item>
+<item> votemap </item>
+<item> vstr </item>
+<item> wait </item>
+<item> watervis </item>
+<item> wave </item>
+<item> weapon </item>
+<item> weapon_knife </item>
+<item> weaplast </item>
+<item> weapnext </item>
+<item> weapprev </item>
+<item> windowsr_drawentities </item>
+<item> writecfg </item>
+<item> writeconfig </item>
+<item> writeid </item>
+<item> writeip </item>
+<item> z_stats </item>
+</list>
+
+
+<list name="Variables">
+<item> ah </item>
+<item> ActiveAction </item>
+<item> _cl_color </item>
+<item> _cl_name </item>
+<item> _config_com_baud </item>
+<item> _config_com_irq </item>
+<item> _config_com_modem </item>
+<item> _config_com_port </item>
+<item> _config_modem_clear </item>
+<item> _config_modem_dialtype </item>
+<item> _config_modem_hangup </item>
+<item> _config_modem_init </item>
+<item> _snd_mixahead </item>
+<item> _vid_default_mode </item>
+<item> _vid_default_mode_win </item>
+<item> _vid_wait_override </item>
+<item> _windowed_mouse </item>
+<item> address </item>
+<item> adr </item>
+<item> adr0 </item>
+<item> adr1 </item>
+<item> adr2 </item>
+<item> adr3 </item>
+<item> adr4 </item>
+<item> adr5 </item>
+<item> adr6 </item>
+<item> adr7 </item>
+<item> adr8 </item>
+<item> advanced </item>
+<item> advaxisr </item>
+<item> advaxisu </item>
+<item> advaxisv </item>
+<item> advaxisx </item>
+<item> advaxisy </item>
+<item> advaxisz </item>
+<item> airaccelerate </item>
+<item> allow </item>
+<item> allow_download_players </item>
+<item> ambient_fade </item>
+<item> ambient_level </item>
+<item> anglespeedkey </item>
+<item> arch </item>
+<item> array </item>
+<item> arrays </item>
+<item> att </item>
+<item> auto </item>
+<item> autoskins </item>
+<item> b </item>
+<item> bgmbuffer </item>
+<item> bgmvolume </item>
+<item> bit </item>
+<item> bitdepth </item>
+<item> blend </item>
+<item> bob </item>
+<item> bob_pitch </item>
+<item> bob_roll </item>
+<item> bob_up </item>
+<item> bot_aasoptimize </item>
+<item> bot_challenge </item>
+<item> bot_debug </item>
+<item> bot_developer </item>
+<item> bot_enable </item>
+<item> bot_fastchat </item>
+<item> bot_forceclustering </item>
+<item> bot_forcereachability </item>
+<item> bot_forcewrite </item>
+<item> bot_grapple </item>
+<item> bot_groundonly </item>
+<item> bot_interbreedbots </item>
+<item> bot_interbreedchar </item>
+<item> bot_interbreedcycle </item>
+<item> bot_interbreedwrite </item>
+<item> bot_maxdebugpolys </item>
+<item> bot_miniplayers </item>
+<item> bot_minplayers </item>
+<item> bot_nochat </item>
+<item> bot_pause </item>
+<item> bot_reachability </item>
+<item> bot_reloadcharacters </item>
+<item> bot_report </item>
+<item> bot_rocketjump </item>
+<item> bot_saveroutingcache </item>
+<item> bot_testclusters </item>
+<item> bot_testichat </item>
+<item> bot_testrchat </item>
+<item> bot_testsolid </item>
+<item> bot_thinktime </item>
+<item> bot_visualizejumppads </item>
+<item> brighten </item>
+<item> brightness </item>
+<item> broken </item>
+<item> cd </item>
+<item> cd_loopcount </item>
+<item> cd_looptrack </item>
+<item> cd_nocd </item>
+<item> cd_plugin </item>
+<item> centermove </item>
+<item> centerspeed </item>
+<item> centertime </item>
+<item> cg_autoactivate </item>
+<item> cg_autoswitch </item>
+<item> cg_blinktime </item>
+<item> cg_bloodTime </item>
+<item> cg_bobpitch </item>
+<item> cg_bobroll </item>
+<item> cg_bobup </item>
+<item> cg_brassTime </item>
+<item> cg_cameraOrbitDelay </item>
+<item> cg_clipboardName </item>
+<item> cg_coronafardist </item>
+<item> cg_coronas </item>
+<item> cg_crosshairAlpha </item>
+<item> cg_crosshairHealth </item>
+<item> cg_crosshairSize </item>
+<item> cg_crosshairX </item>
+<item> cg_crosshairY </item>
+<item> cg_currentSelectedPlayer </item>
+<item> cg_currentSelectedPlayerName </item>
+<item> cg_cursorHints </item>
+<item> cg_cycleAllWeaps </item>
+<item> cg_deferPlayers </item>
+<item> cg_descriptiveText </item>
+<item> cg_draw2D </item>
+<item> cg_draw3dIcons </item>
+<item> cg_drawAllWeaps </item>
+<item> cg_drawAmmoWarning </item>
+<item> cg_drawAttacker </item>
+<item> cg_drawCompass </item>
+<item> cg_drawCrosshair </item>
+<item> cg_drawCrosshairNames </item>
+<item> cg_drawCrosshairPickups </item>
+<item> cg_drawFPGun </item>
+<item> cg_drawFPS </item>
+<item> cg_drawFrags </item>
+<item> cg_drawGun </item>
+<item> cg_drawIcons </item>
+<item> cg_drawNotifyText </item>
+<item> cg_drawRewards </item>
+<item> cg_drawSnapshot </item>
+<item> cg_drawSpreadScale </item>
+<item> cg_drawStatus </item>
+<item> cg_drawTeamOverlay </item>
+<item> cg_drawTimer </item>
+<item> cg_emptyswitch </item>
+<item> cg_fov </item>
+<item> cg_forcemodel </item>
+<item> cg_gibs </item>
+<item> cg_hudAlpha </item>
+<item> cg_hudFiles </item>
+<item> cg_lagometer </item>
+<item> cg_marks </item>
+<item> cg_marktime </item>
+<item> cg_noplayeranims </item>
+<item> cg_nopredict </item>
+<item> cg_noTaunt </item>
+<item> cg_noVoiceChats </item>
+<item> cg_noVoiceText </item>
+<item> cg_particleDist </item>
+<item> cg_particleLOD </item>
+<item> cg_popupLimboMenu </item>
+<item> cg_predictItems </item>
+<item> cg_quickMessageAlt </item>
+<item> cg_railTrailTime </item>
+<item> cg_recoilPitch </item>
+<item> cg_reticleBrightness </item>
+<item> cg_reticleType </item>
+<item> cg_runpitch </item>
+<item> cg_runroll </item>
+<item> cg_scorePlums </item>
+<item> cg_selectedPlayer </item>
+<item> cg_selectedPlayerName </item>
+<item> cg_shadows </item>
+<item> cg_showblood </item>
+<item> cg_simpleItems </item>
+<item> cg_skybox </item>
+<item> cg_stereoSeparation </item>
+<item> cg_teamChatHeight </item>
+<item> cg_teamChatTime </item>
+<item> cg_teamChatsOnly </item>
+<item> cg_thirdperson </item>
+<item> cg_thirdpersonrange </item>
+<item> cg_thirdPersonAngle </item>
+<item> cg_useWeapsForZoom </item>
+<item> cg_uselessNostalgia </item>
+<item> cg_viewsize </item>
+<item> cg_voiceSpriteTime </item>
+<item> cg_weaponCycleDelay </item>
+<item> cg_wolfparticles </item>
+<item> cg_zoomDefaultBinoc </item>
+<item> cg_zoomDefaultFG </item>
+<item> cg_zoomDefaultSniper </item>
+<item> cg_zoomDefaultSnooper </item>
+<item> cg_zoomStepBinoc </item>
+<item> cg_zoomStepFG </item>
+<item> cg_zoomStepSnooper </item>
+<item> cg_zoomfov </item>
+<item> cg_zoomstepsniper </item>
+<item> chase_active </item>
+<item> chase_back </item>
+<item> chase_right </item>
+<item> chase_up </item>
+<item> cheats </item>
+<item> cl </item>
+<item> cl_allowDownload </item>
+<item> cl_anglespeedkey </item>
+<item> cl_anonymous </item>
+<item> cl_autoexec </item>
+<item> cl_autoskins </item>
+<item> cl_avidemo </item>
+<item> cl_backspeed </item>
+<item> cl_blend </item>
+<item> cl_bob </item>
+<item> cl_bobcycle </item>
+<item> cl_bobup </item>
+<item> cl_bypassMouseInput </item>
+<item> cl_cacheGathering </item>
+<item> cl_camera_maxpitch </item>
+<item> cl_camera_maxyaw </item>
+<item> cl_chasecam </item>
+<item> cl_chatmode </item>
+<item> cl_conXOffset </item>
+<item> cl_crossx </item>
+<item> cl_crossy </item>
+<item> cl_cshift_bonus </item>
+<item> cl_cshift_content </item>
+<item> cl_cshift_damage </item>
+<item> cl_cshift_powerup </item>
+<item> cl_debugMove </item>
+<item> cl_debugTranslation </item>
+<item> cl_demospeed </item>
+<item> cl_entities </item>
+<item> cl_footsteps </item>
+<item> cl_forceavidemo </item>
+<item> cl_forwardspeed </item>
+<item> cl_freelook </item>
+<item> cl_freezeDemo </item>
+<item> cl_gun </item>
+<item> cl_hidefrags </item>
+<item> cl_hightrack </item>
+<item> cl_hudswap </item>
+<item> cl_language </item>
+<item> cl_lights </item>
+<item> cl_maxPing </item>
+<item> cl_maxfps </item>
+<item> cl_maxpackets </item>
+<item> cl_motd </item>
+<item> cl_motdString </item>
+<item> cl_mouseAccel </item>
+<item> cl_movespeedkey </item>
+<item> cl_nodelta </item>
+<item> cl_nofake </item>
+<item> cl_nolerp </item>
+<item> cl_nopred </item>
+<item> cl_noprint </item>
+<item> cl_noskins </item>
+<item> cl_packetdup </item>
+<item> cl_parsesay </item>
+<item> cl_particles </item>
+<item> cl_paused </item>
+<item> cl_pitchspeed </item>
+<item> cl_predict </item>
+<item> cl_predict_players </item>
+<item> cl_predict_players2 </item>
+<item> cl_observercrosshair </item>
+<item> cl_quakerc </item>
+<item> cl_rollangle </item>
+<item> cl_rollspeed </item>
+<item> cl_run </item>
+<item> cl_running </item>
+<item> cl_serverStatusResendTime </item>
+<item> cl_showfps </item>
+<item> cl_showSend </item>
+<item> cl_showServerCommands </item>
+<item> cl_showTimeDelta </item>
+<item> cl_showmiss </item>
+<item> cl_showmouserate </item>
+<item> cl_shownet </item>
+<item> cl_shownuments </item>
+<item> cl_sidespeed </item>
+<item> cl_stats </item>
+<item> cl_stereo </item>
+<item> cl_stereo_separation </item>
+<item> cl_testblend </item>
+<item> cl_testentities </item>
+<item> cl_testlights </item>
+<item> cl_testparticles </item>
+<item> cl_timeNudge </item>
+<item> cl_timeout </item>
+<item> cl_upspeed </item>
+<item> cl_verstring </item>
+<item> cl_visibleClients </item>
+<item> cl_vwep </item>
+<item> cl_waitForFire </item>
+<item> cl_wavefilerecord </item>
+<item> cl_yawspeed </item>
+<item> clear </item>
+<item> clearcolor </item>
+<item> clientport </item>
+<item> cm_playerCurveClip </item>
+<item> cmd_highchars </item>
+<item> cmd_warncmd </item>
+<item> cmdlist </item>
+<item> color </item>
+<item> color1 </item>
+<item> color2 </item>
+<item> com_blood </item>
+<item> com_buildScript </item>
+<item> com_cameraMode </item>
+<item> com_dropsim </item>
+<item> com_hunkMegs </item>
+<item> com_hunkused </item>
+<item> com_introplayed </item>
+<item> com_maxfps </item>
+<item> com_recommendedSet </item>
+<item> com_showtrace </item>
+<item> com_soundMegs </item>
+<item> com_speeds </item>
+<item> com_zoneMegs </item>
+<item> compiled </item>
+<item> con_debug </item>
+<item> con_notifytime </item>
+<item> con_restricted </item>
+<item> conspeed </item>
+<item> contrast </item>
+<item> coop </item>
+<item> crosshair </item>
+<item> crosshaircolor </item>
+<item> cull </item>
+<item> d_mipcap </item>
+<item> d_mipscale </item>
+<item> deathmatch </item>
+<item> debug_protocol </item>
+<item> debuggraph </item>
+<item> dedicated </item>
+<item> devdll </item>
+<item> developer </item>
+<item> dlabs </item>
+<item> dmflags </item>
+<item> dm </item>
+<item> down </item>
+<item> download </item>
+<item> drawall </item>
+<item> drawbuffer </item>
+<item> drawentities </item>
+<item> drawflat </item>
+<item> draworder </item>
+<item> drawworld </item>
+<item> driver </item>
+<item> dspeeds </item>
+<item> dynamic </item>
+<item> easter_eggs </item>
+<item> edgefriction </item>
+<item> empty </item>
+<item> enforcetime </item>
+<item> entities </item>
+<item> entlatency </item>
+<item> ext </item>
+<item> filter </item>
+<item> filterban </item>
+<item> finish </item>
+<item> fixedtime </item>
+<item> flashblend </item>
+<item> flood </item>
+<item> flood_msgs </item>
+<item> flood_persecond </item>
+<item> flood_waitdelay </item>
+<item> flushmap </item>
+<item> footsteps </item>
+<item> forward </item>
+<item> forwardsensitivity </item>
+<item> forwardspeed </item>
+<item> forwardthreshold </item>
+<item> fov </item>
+<item> fraglimit </item>
+<item> freelook </item>
+<item> fs_basegame </item>
+<item> fs_basepath </item>
+<item> fs_cdpath </item>
+<item> fs_copyfiles </item>
+<item> fs_debug </item>
+<item> fs_game </item>
+<item> fs_globalcfg </item>
+<item> fs_homepath </item>
+<item> fs_pluginpath </item>
+<item> fs_restrict </item>
+<item> fs_sharepath </item>
+<item> fs_skinbase </item>
+<item> fs_usercfg </item>
+<item> fs_userpath </item>
+<item> fullbright </item>
+<item> fullscreen </item>
+<item> g_allowvote </item>
+<item> g_altStopwatchMode </item>
+<item> g_arenasFile </item>
+<item> g_blueTeam </item>
+<item> g_botsFile </item>
+<item> g_complaintlimit </item>
+<item> g_currentRound </item>
+<item> g_friendlyFire </item>
+<item> g_gameskill </item>
+<item> g_gametype </item>
+<item> g_maxlives </item>
+<item> g_minGameClients </item>
+<item> g_missionStats </item>
+<item> g_nextTimeLimit </item>
+<item> g_noTeamSwitching </item>
+<item> g_redTeam </item>
+<item> g_select_empty </item>
+<item> g_spAwards </item>
+<item> g_spScores1 </item>
+<item> g_spScores2 </item>
+<item> g_spScores3 </item>
+<item> g_spScores4 </item>
+<item> g_spScores5 </item>
+<item> g_spSkill </item>
+<item> g_spVideos </item>
+<item> g_userAlliedRespawnTime </item>
+<item> g_userAxisRespawnTime </item>
+<item> g_userTimeLimit </item>
+<item> game </item>
+<item> gamecfg </item>
+<item> gamedate </item>
+<item> gamedir </item>
+<item> gamename </item>
+<item> gamestate </item>
+<item> gamma </item>
+<item> gender </item>
+<item> gender_auto </item>
+<item> gl_3dlabs_broken </item>
+<item> gl_allow_software </item>
+<item> gl_bitdepth </item>
+<item> gl_clear </item>
+<item> gl_conalpha </item>
+<item> gl_conspin </item>
+<item> gl_cshiftpercent </item>
+<item> gl_cull </item>
+<item> gl_drawbuffer </item>
+<item> gl_driver </item>
+<item> gl_dynamic </item>
+<item> gl_ext_compiled_vertex_array </item>
+<item> gl_ext_multitexture </item>
+<item> gl_ext_palettedtexture </item>
+<item> gl_ext_pointparameters </item>
+<item> gl_ext_swapinterval </item>
+<item> gl_finish </item>
+<item> gl_flashblend </item>
+<item> gl_keeptjunctions </item>
+<item> gl_lightmap </item>
+<item> gl_lightmap_align </item>
+<item> gl_lightmap_subimage </item>
+<item> gl_lockpvs </item>
+<item> gl_log </item>
+<item> gl_max_size </item>
+<item> gl_mesh_cache </item>
+<item> gl_mode </item>
+<item> gl_modulate </item>
+<item> gl_monolightmap </item>
+<item> gl_nobind </item>
+<item> gl_nocolors </item>
+<item> gl_nosubimage </item>
+<item> gl_occlusion </item>
+<item> gl_particle_att_a </item>
+<item> gl_particle_att_b </item>
+<item> gl_particle_att_c </item>
+<item> gl_particle_max_size </item>
+<item> gl_particle_min_size </item>
+<item> gl_particle_mip </item>
+<item> gl_particle_size </item>
+<item> gl_picmip </item>
+<item> gl_playermip </item>
+<item> gl_polyblend </item>
+<item> gl_reporttjunctions </item>
+<item> gl_round_down </item>
+<item> gl_saturatelighting </item>
+<item> gl_screenshot_byte_swap </item>
+<item> gl_shadows </item>
+<item> gl_showtris </item>
+<item> gl_sky_debug </item>
+<item> gl_sky_divide </item>
+<item> gl_skymip </item>
+<item> gl_smoothmodels </item>
+<item> gl_subdivide_size </item>
+<item> gl_swapinterval </item>
+<item> gl_texsort </item>
+<item> gl_texturealphamode </item>
+<item> gl_texturemode </item>
+<item> gl_texturesolidmode </item>
+<item> gl_triplebuffer </item>
+<item> gl_vertex_arrays </item>
+<item> gl_ztrick </item>
+<item> graphheight </item>
+<item> graphscale </item>
+<item> graphshift </item>
+<item> gravity </item>
+<item> gun </item>
+<item> gun_x </item>
+<item> gun_y </item>
+<item> gun_z </item>
+<item> hand </item>
+<item> handicap </item>
+<item> head </item>
+<item> headModel </item>
+<item> headmodel </item>
+<item> host </item>
+<item> host_framerate </item>
+<item> host_speeds </item>
+<item> hostname </item>
+<item> hostport </item>
+<item> hud_fastswitch </item>
+<item> in </item>
+<item> in_amp </item>
+<item> in_bind_imt </item>
+<item> in_debugjoystick </item>
+<item> in_dga </item>
+<item> in_dga_mouseaccel </item>
+<item> in_dgamouse </item>
+<item> in_grab </item>
+<item> in_joystick </item>
+<item> in_midi </item>
+<item> in_mouse </item>
+<item> in_mouse_amp </item>
+<item> in_mouse_filter </item>
+<item> in_mouse_pre_amp </item>
+<item> in_pre_amp </item>
+<item> initsound </item>
+<item> intensity </item>
+<item> ip </item>
+<item> ip_clientport </item>
+<item> ip_hostport </item>
+<item> ipx </item>
+<item> ipx_clientport </item>
+<item> ipx_hostport </item>
+<item> journal </item>
+<item> joy </item>
+<item> joy_advanced </item>
+<item> joy_advaxisr </item>
+<item> joy_advaxisu </item>
+<item> joy_advaxisv </item>
+<item> joy_advaxisx </item>
+<item> joy_advaxisy </item>
+<item> joy_advaxisz </item>
+<item> joy_amp </item>
+<item> joy_device </item>
+<item> joy_forwardsensitivity </item>
+<item> joy_forwardthreshold </item>
+<item> joy_name </item>
+<item> joy_pitchsensitivity </item>
+<item> joy_pitchthreshold </item>
+<item> joy_pre_amp </item>
+<item> joy_sensitivity </item>
+<item> joy_sidesensitivity </item>
+<item> joy_sidethreshold </item>
+<item> joy_threshold </item>
+<item> joy_upsensitivity </item>
+<item> joy_upthreshold </item>
+<item> joy_yawsensitivity </item>
+<item> joy_yawthreshold </item>
+<item> joyadvanced </item>
+<item> joyadvaxisr </item>
+<item> joyadvaxisu </item>
+<item> joyadvaxisv </item>
+<item> joyadvaxisx </item>
+<item> joyadvaxisy </item>
+<item> joyadvaxisz </item>
+<item> joyaxis1 </item>
+<item> joyaxis2 </item>
+<item> joyaxis3 </item>
+<item> joyaxis4 </item>
+<item> joyaxis5 </item>
+<item> joyaxis6 </item>
+<item> joyaxis7 </item>
+<item> joyaxis8 </item>
+<item> joyforwardsensitivity </item>
+<item> joyforwardthreshold </item>
+<item> joyname </item>
+<item> joypitchsensitivity </item>
+<item> joypitchthreshold </item>
+<item> joysidesensitivity </item>
+<item> joysidethreshold </item>
+<item> joystick </item>
+<item> joywwhack1 </item>
+<item> joywwhack2 </item>
+<item> joyyawsensitivity </item>
+<item> joyyawthreshold </item>
+<item> khz </item>
+<item> lcd_x </item>
+<item> lcd_yaw </item>
+<item> lerpmodels </item>
+<item> lightmap </item>
+<item> lights </item>
+<item> limit </item>
+<item> listen </item>
+<item> loadas </item>
+<item> loadas8bit </item>
+<item> localid </item>
+<item> lockpvs </item>
+<item> log </item>
+<item> log_stats </item>
+<item> logfile </item>
+<item> lookspring </item>
+<item> lookstrafe </item>
+<item> loopcount </item>
+<item> looptrack </item>
+<item> m_filter </item>
+<item> m_forward </item>
+<item> m_pitch </item>
+<item> m_side </item>
+<item> m_yaw </item>
+<item> mapname </item>
+<item> maps </item>
+<item> max </item>
+<item> maxclients </item>
+<item> maxedges </item>
+<item> maxentities </item>
+<item> maxfps </item>
+<item> maxplayers </item>
+<item> maxspectators </item>
+<item> maxsurfs </item>
+<item> maxvelocity </item>
+<item> min </item>
+<item> mipcap </item>
+<item> mipscale </item>
+<item> mixahead </item>
+<item> mode </item>
+<item> model </item>
+<item> models </item>
+<item> modex </item>
+<item> modulate </item>
+<item> monolightmap </item>
+<item> mouse </item>
+<item> mp_currentPlayerType </item>
+<item> mp_currentTeam </item>
+<item> mp_playerType </item>
+<item> mp_team </item>
+<item> mp_weapon </item>
+<item> mp_autokick </item>
+<item> mp_autoteambalance </item>
+<item> mp_c4timer </item>
+<item> mp_flashlight </item>
+<item> mp_footsteps </item>
+<item> mp_forcechasecam </item>
+<item> mp_freezetime </item>
+<item> mp_friendlyfire </item>
+<item> mp_hostagepenalty </item>
+<item> mp_limitteams </item>
+<item> mp_logmessages </item>
+<item> mp_mapvoteration </item>
+<item> mp_roundtime </item>
+<item> mp_timelimit </item>
+<item> mp_tkpunish </item>
+<item> msg </item>
+<item> msgs </item>
+<item> multitexture </item>
+<item> name </item>
+<item> net_graph </item>
+<item> net_ip </item>
+<item> net_messagetimeout </item>
+<item> net_noudp </item>
+<item> net_port </item>
+<item> net_qport </item>
+<item> net_restart </item>
+<item> netdosexpire </item>
+<item> netdosvalues </item>
+<item> netgraph </item>
+<item> nextdemo </item>
+<item> nextmap </item>
+<item> nextserver </item>
+<item> noalttab </item>
+<item> nobind </item>
+<item> nocd </item>
+<item> nocull </item>
+<item> nodelta </item>
+<item> noexit </item>
+<item> nomonsters </item>
+<item> norefresh </item>
+<item> noreload </item>
+<item> noskins </item>
+<item> nosound </item>
+<item> nosubimage </item>
+<item> novis </item>
+<item> palettedtexture </item>
+<item> particle </item>
+<item> particles </item>
+<item> password </item>
+<item> pausable </item>
+<item> persecond </item>
+<item> picmip </item>
+<item> pitch </item>
+<item> pitchsensitivity </item>
+<item> pitchspeed </item>
+<item> pitchthreshold </item>
+<item> playermip </item>
+<item> players </item>
+<item> pointparameters </item>
+<item> polyblend </item>
+<item> polymodelstats </item>
+<item> port </item>
+<item> pr_checkextensions </item>
+<item> pr_deadbeef_ents </item>
+<item> pr_deadbeef_locals </item>
+<item> pr_debug </item>
+<item> pr_source_path </item>
+<item> precache </item>
+<item> predict </item>
+<item> primary </item>
+<item> printspeed </item>
+<item> protocol </item>
+<item> public </item>
+<item> pushlatency </item>
+<item> qport </item>
+<item> r_aliastransadj </item>
+<item> r_aliastransbase </item>
+<item> r_allowExtensions </item>
+<item> r_allowSoftwareGL </item>
+<item> r_ambient </item>
+<item> r_ambientScale </item>
+<item> r_bonesDebug </item>
+<item> r_cache </item>
+<item> r_cacheModels </item>
+<item> r_cacheShaders </item>
+<item> r_clear </item>
+<item> r_clearcolor </item>
+<item> r_colorMipLevels </item>
+<item> r_colorbits </item>
+<item> r_compressModels </item>
+<item> r_customaspect </item>
+<item> r_customheight </item>
+<item> r_customwidth </item>
+<item> r_debugSort </item>
+<item> r_debugSurface </item>
+<item> r_debuglight </item>
+<item> r_depthbits </item>
+<item> r_detailtextures </item>
+<item> r_directedScale </item>
+<item> r_displayRefresh </item>
+<item> r_dlightBacks </item>
+<item> r_dlight_lightmap </item>
+<item> r_dlight_max </item>
+<item> r_drawBuffer </item>
+<item> r_drawSun </item>
+<item> r_drawentities </item>
+<item> r_drawexplosions </item>
+<item> r_drawflat </item>
+<item> r_draworder </item>
+<item> r_drawviewmodel </item>
+<item> r_drawworld </item>
+<item> r_dspeeds </item>
+<item> r_dynamic </item>
+<item> r_dynamiclight </item>
+<item> r_explosionclip </item>
+<item> r_exportCompressedModels </item>
+<item> r_ext_compiled_vertex_array </item>
+<item> r_ext_compress_textures </item>
+<item> r_ext_compressed_textures </item>
+<item> r_ext_gamma_control </item>
+<item> r_ext_multitexture </item>
+<item> r_ext_texture_env_add </item>
+<item> r_facePlaneCull </item>
+<item> r_fastsky </item>
+<item> r_finish </item>
+<item> r_firecolor </item>
+<item> r_flareFade </item>
+<item> r_flareSize </item>
+<item> r_flares </item>
+<item> r_fullbright </item>
+<item> r_fullscreen </item>
+<item> r_gamma </item>
+<item> r_glDriver </item>
+<item> r_glIgnoreWicked3D </item>
+<item> r_graphheight </item>
+<item> r_highQualit </item>
+<item> r_highQualityVideo </item>
+<item> r_ignore </item>
+<item> r_ignoreFastPath </item>
+<item> r_ignoreGLErrors </item>
+<item> r_ignorehwgamma </item>
+<item> r_inGameVideo </item>
+<item> r_intensity </item>
+<item> r_lastValidRenderer </item>
+<item> r_lerpmodels </item>
+<item> r_lightmap </item>
+<item> r_lightmap_components </item>
+<item> r_lockpvs </item>
+<item> r_lodCurveError </item>
+<item> r_lodbias </item>
+<item> r_lodscale </item>
+<item> r_logFile </item>
+<item> r_lowMemTextureSize </item>
+<item> r_lowMemTextureThreshold </item>
+<item> r_mapOverBrightBits </item>
+<item> r_maxedges </item>
+<item> r_maxpolys </item>
+<item> r_maxpolyverts </item>
+<item> r_maxsurfs </item>
+<item> r_measureOverdraw </item>
+<item> r_mirroralpha </item>
+<item> r_mode </item>
+<item> r_netgraph </item>
+<item> r_netgraph_alpha </item>
+<item> r_nobind </item>
+<item> r_nocull </item>
+<item> r_nocurves </item>
+<item> r_noportals </item>
+<item> r_norefresh </item>
+<item> r_novis </item>
+<item> r_numedges </item>
+<item> r_numsurfs </item>
+<item> r_offsetfactor </item>
+<item> r_offsetunits </item>
+<item> r_overBrightBits </item>
+<item> r_particles_max </item>
+<item> r_particles_style </item>
+<item> r_picmip </item>
+<item> r_picmip2 </item>
+<item> r_polymodelstats </item>
+<item> r_portalOnly </item>
+<item> r_preloadTextures </item>
+<item> r_previousglDriver </item>
+<item> r_primitives </item>
+<item> r_printShaders </item>
+<item> r_railCoreWidth </item>
+<item> r_railSegmentLength </item>
+<item> r_railWidth </item>
+<item> r_reportedgeout </item>
+<item> r_reportsurfout </item>
+<item> r_rmse </item>
+<item> r_roundImagesDown </item>
+<item> r_saveFontData </item>
+<item> r_shadows </item>
+<item> r_showImages </item>
+<item> r_showSmp </item>
+<item> r_showcluster </item>
+<item> r_shownormals </item>
+<item> r_showsky </item>
+<item> r_showtris </item>
+<item> r_simpleMipMaps </item>
+<item> r_singleShader </item>
+<item> r_skipBackEnd </item>
+<item> r_skyname </item>
+<item> r_smp </item>
+<item> r_speeds </item>
+<item> r_stencilbits </item>
+<item> r_stereo </item>
+<item> r_subdivisions </item>
+<item> r_swapInterval </item>
+<item> r_textureMode </item>
+<item> r_texturebits </item>
+<item> r_timegraph </item>
+<item> r_uiFullScreen </item>
+<item> r_verbose </item>
+<item> r_vertexLight </item>
+<item> r_wateralpha </item>
+<item> r_waterwarp </item>
+<item> r_wolffog </item>
+<item> r_zfar </item>
+<item> r_znear </item>
+<item> rate </item>
+<item> rcon </item>
+<item> rconAddress </item>
+<item> rconPassword </item>
+<item> rcon_address </item>
+<item> rcon_password </item>
+<item> reconnect </item>
+<item> ref </item>
+<item> registered </item>
+<item> reportedgeout </item>
+<item> reportsurfout </item>
+<item> roll </item>
+<item> rollangle </item>
+<item> rollspeed </item>
+<item> round </item>
+<item> run </item>
+<item> run_pitch </item>
+<item> run_roll </item>
+<item> s_compression </item>
+<item> s_defaultsound </item>
+<item> s_doppler </item>
+<item> s_initsound </item>
+<item> s_khz </item>
+<item> s_loadas8bit </item>
+<item> s_mixPreStep </item>
+<item> s_mixahead </item>
+<item> s_musicvolume </item>
+<item> s_mute </item>
+<item> s_nocompressed </item>
+<item> s_usingA3D </item>
+<item> s_primary </item>
+<item> s_separation </item>
+<item> s_show </item>
+<item> s_testsound </item>
+<item> s_volume </item>
+<item> s_wavonly </item>
+<item> samelevel </item>
+<item> saturatelighting </item>
+<item> saved1 </item>
+<item> saved2 </item>
+<item> saved3 </item>
+<item> saved4 </item>
+<item> savedgamecfg </item>
+<item> scr </item>
+<item> scr_centertime </item>
+<item> scr_consize </item>
+<item> scr_conspeed </item>
+<item> scr_drawall </item>
+<item> scr_ofsx </item>
+<item> scr_ofsy </item>
+<item> scr_ofsz </item>
+<item> scr_printspeed </item>
+<item> scr_showpause </item>
+<item> scr_showturtle </item>
+<item> scratch1 </item>
+<item> scratch2 </item>
+<item> scratch3 </item>
+<item> scratch4 </item>
+<item> screenshot </item>
+<item> select </item>
+<item> sensitivity </item>
+<item> separation </item>
+<item> server1 </item>
+<item> server10 </item>
+<item> server11 </item>
+<item> server12 </item>
+<item> server13 </item>
+<item> server14 </item>
+<item> server15 </item>
+<item> server16 </item>
+<item> server2 </item>
+<item> server3 </item>
+<item> server4 </item>
+<item> server5 </item>
+<item> server6 </item>
+<item> server7 </item>
+<item> server8 </item>
+<item> server9 </item>
+<item> serverprofile </item>
+<item> sex </item>
+<item> shadows </item>
+<item> show </item>
+<item> showclamp </item>
+<item> showdrop </item>
+<item> showmiss </item>
+<item> shownet </item>
+<item> showpackets </item>
+<item> showpause </item>
+<item> showram </item>
+<item> showtrace </item>
+<item> showtris </item>
+<item> showturtle </item>
+<item> side </item>
+<item> sidesensitivity </item>
+<item> sidespeed </item>
+<item> sidethreshold </item>
+<item> size </item>
+<item> skill </item>
+<item> skin </item>
+<item> skymip </item>
+<item> snaps </item>
+<item> snd_bits </item>
+<item> snd_device </item>
+<item> snd_interp </item>
+<item> snd_loadas8bit </item>
+<item> snd_mixahead </item>
+<item> snd_noextraupdate </item>
+<item> snd_oss_mmaped </item>
+<item> snd_output </item>
+<item> snd_phasesep </item>
+<item> snd_rate </item>
+<item> snd_render </item>
+<item> snd_show </item>
+<item> snd_stereo </item>
+<item> snd_volumesep </item>
+<item> sndbits </item>
+<item> sndchannels </item>
+<item> snddevice </item>
+<item> sndspeed </item>
+<item> software </item>
+<item> sounds </item>
+<item> spectator </item>
+<item> spectator_password </item>
+<item> speeds </item>
+<item> stats </item>
+<item> stereo </item>
+<item> stipplealpha </item>
+<item> surfcacheoverride </item>
+<item> sv </item>
+<item> sv_accelerate </item>
+<item> sv_aim </item>
+<item> sv_airaccelerate </item>
+<item> sv_allowAnonymous </item>
+<item> sv_allowDownload </item>
+<item> sv_cheats </item>
+<item> sv_enforcetime </item>
+<item> sv_floodProtect </item>
+<item> sv_fps </item>
+<item> sv_friction </item>
+<item> sv_gravity </item>
+<item> sv_hostname </item>
+<item> sv_idealpitchscale </item>
+<item> sv_keywords </item>
+<item> sv_killserver </item>
+<item> sv_mapChecksum </item>
+<item> sv_master1 </item>
+<item> sv_master2 </item>
+<item> sv_master3 </item>
+<item> sv_master4 </item>
+<item> sv_master5 </item>
+<item> sv_maxPing </item>
+<item> sv_maxRate </item>
+<item> sv_maxclients </item>
+<item> sv_maxrate </item>
+<item> sv_maxspeed </item>
+<item> sv_maxtic </item>
+<item> sv_maxvelocity </item>
+<item> sv_minPing </item>
+<item> sv_minqfversion </item>
+<item> sv_mintic </item>
+<item> sv_netdosprotect </item>
+<item> sv_noreload </item>
+<item> sv_nostep </item>
+<item> sv_onlyVisibleClients </item>
+<item> sv_padPackets </item>
+<item> sv_pakNames </item>
+<item> sv_paks </item>
+<item> sv_paused </item>
+<item> sv_phs </item>
+<item> sv_privateClients </item>
+<item> sv_privatePassword </item>
+<item> sv_progs </item>
+<item> sv_pure </item>
+<item> sv_reconnect_limit </item>
+<item> sv_reconnectlimit </item>
+<item> sv_referencedPakNames </item>
+<item> sv_referencedPaks </item>
+<item> sv_restartround </item>
+<item> sv_rollangle </item>
+<item> sv_rollspeed </item>
+<item> sv_running </item>
+<item> sv_serverid </item>
+<item> sv_showAverageBPS </item>
+<item> sv_showloss </item>
+<item> sv_spectalk </item>
+<item> sv_stopspeed </item>
+<item> sv_timefmt </item>
+<item> sv_timekick </item>
+<item> sv_timekick_fuzz </item>
+<item> sv_timekick_interval </item>
+<item> sv_timeout </item>
+<item> sv_timestamps </item>
+<item> sv_wateraccelerate </item>
+<item> sv_waterfriction </item>
+<item> sv_zombietime </item>
+<item> sw </item>
+<item> sw_allow_modex </item>
+<item> sw_clearcolor </item>
+<item> sw_drawflat </item>
+<item> sw_draworder </item>
+<item> sw_maxedges </item>
+<item> sw_maxsurfs </item>
+<item> sw_mipcap </item>
+<item> sw_mipscale </item>
+<item> sw_mode </item>
+<item> sw_polymodelstats </item>
+<item> sw_reportedgeout </item>
+<item> sw_reportsurfout </item>
+<item> sw_stipplealpha </item>
+<item> sw_surfcacheoverride </item>
+<item> sw_waterwarp </item>
+<item> swapinterval </item>
+<item> sys_cpustring </item>
+<item> sys_nostdout </item>
+<item> sys_sleep </item>
+<item> sys_ticrate </item>
+<item> team </item>
+<item> team_headmodel </item>
+<item> team_model </item>
+<item> teamplay </item>
+<item> teamtask </item>
+<item> temp1 </item>
+<item> testblend </item>
+<item> testentities </item>
+<item> testlights </item>
+<item> testparticles </item>
+<item> testsound </item>
+<item> texturealphamode </item>
+<item> texturemode </item>
+<item> texturesolidmode </item>
+<item> timedemo </item>
+<item> timegraph </item>
+<item> timelimit </item>
+<item> timeout </item>
+<item> timescale </item>
+<item> topcolor </item>
+<item> triplebuffer </item>
+<item> ttycon </item>
+<item> ui_Q3Model </item>
+<item> ui_actualNetGametype </item>
+<item> ui_bigFont </item>
+<item> ui_browserGameType </item>
+<item> ui_browserMaster </item>
+<item> ui_browserShowEmpty </item>
+<item> ui_browserShowFriendlyFire </item>
+<item> ui_browserShowFull </item>
+<item> ui_browserShowMaxlives </item>
+<item> ui_browserShowTourney </item>
+<item> ui_browserSortKey </item>
+<item> ui_cdkeychecked </item>
+<item> ui_class </item>
+<item> ui_cmd </item>
+<item> ui_ctf_capturelimit </item>
+<item> ui_ctf_friendly </item>
+<item> ui_ctf_timelimit </item>
+<item> ui_currentMap </item>
+<item> ui_currentNetMap </item>
+<item> ui_dedicated </item>
+<item> ui_ffa_fraglimit </item>
+<item> ui_ffa_timelimit </item>
+<item> ui_gametype </item>
+<item> ui_glCustom </item>
+<item> ui_isSpectator </item>
+<item> ui_joinGametype </item>
+<item> ui_limboMode </item>
+<item> ui_limboObjective </item>
+<item> ui_limboOptions </item>
+<item> ui_limboPrevOptions </item>
+<item> ui_mapIndex </item>
+<item> ui_master </item>
+<item> ui_menuFiles </item>
+<item> ui_mousePitch </item>
+<item> ui_netGametype </item>
+<item> ui_netSource </item>
+<item> ui_notebookCurrentPage </item>
+<item> ui_objective </item>
+<item> ui_prevClass </item>
+<item> ui_prevTeam </item>
+<item> ui_prevWeapon </item>
+<item> ui_serverStatusTimeOut </item>
+<item> ui_singlePlayerActive </item>
+<item> ui_smallFont </item>
+<item> ui_spSelection </item>
+<item> ui_team </item>
+<item> ui_teamArenaFirstRun </item>
+<item> ui_team_fraglimit </item>
+<item> ui_team_friendly </item>
+<item> ui_team_timelimit </item>
+<item> ui_tourney_fraglimit </item>
+<item> ui_tourney_timelimit </item>
+<item> ui_userAlliedRespawnTime </item>
+<item> ui_userAxisRespawnTime </item>
+<item> ui_userTimeLimit </item>
+<item> ui_weapon </item>
+<item> up </item>
+<item> upsensitivity </item>
+<item> upspeed </item>
+<item> upthreshold </item>
+<item> username </item>
+<item> v_centermove </item>
+<item> v_centerspeed </item>
+<item> v_idlescale </item>
+<item> v_ipitch_cycle </item>
+<item> v_ipitch_level </item>
+<item> v_iroll_cycle </item>
+<item> v_iroll_level </item>
+<item> v_iuaw_cycle </item>
+<item> v_iyaw_cycle </item>
+<item> v_iyaw_level </item>
+<item> v_kickpitch </item>
+<item> v_kickroll </item>
+<item> v_kicktime </item>
+<item> version </item>
+<item> vertex </item>
+<item> vid </item>
+<item> vid_config_x </item>
+<item> vid_config_y </item>
+<item> vid_fullscreen </item>
+<item> vid_fullscreen_mode </item>
+<item> vid_gamma </item>
+<item> vid_height </item>
+<item> vid_mode </item>
+<item> vid_nopageflip </item>
+<item> vid_ref </item>
+<item> vid_system_gamma </item>
+<item> vid_use8bit </item>
+<item> vid_wait </item>
+<item> vid_width </item>
+<item> vid_window_x </item>
+<item> vid_window_y </item>
+<item> vid_windowed_mode </item>
+<item> vid_xpos </item>
+<item> vid_ypos </item>
+<item> viewlog </item>
+<item> viewsize </item>
+<item> vm_cgame </item>
+<item> vm_game </item>
+<item> vm_ui </item>
+<item> volume </item>
+<item> vwep </item>
+<item> waitdelay </item>
+<item> waterwarp </item>
+<item> wavonly </item>
+<item> win </item>
+<item> win_noalttab </item>
+<item> win_hinstance </item>
+<item> win_wndproc </item>
+<item> xpos </item>
+<item> yaw </item>
+<item> yawsensitivity </item>
+<item> yawspeed </item>
+<item> yawthreshold </item>
+<item> ypos </item>
+<item> zombietime </item>
+<item> ztrick </item>
+</list>
+
+
+<list name="Actions">
+<item> +attack </item>
+<item> +ttack2 </item>
+<item> +alt1 </item>
+<item> +activate </item>
+<item> +back </item>
+<item> +break </item>
+<item> +button0 </item>
+<item> +button1 </item>
+<item> +button10 </item>
+<item> +button11 </item>
+<item> +button12 </item>
+<item> +button13 </item>
+<item> +button14 </item>
+<item> +button2 </item>
+<item> +button3 </item>
+<item> +button4 </item>
+<item> +button5 </item>
+<item> +button6 </item>
+<item> +button7 </item>
+<item> +button8 </item>
+<item> +button9 </item>
+<item> +camdistance </item>
+<item> +camin </item>
+<item> +cammousemove </item>
+<item> +camout </item>
+<item> +campitchdown </item>
+<item> +campitchup </item>
+<item> +camyawleft </item>
+<item> +camyawright </item>
+<item> +commandmenu </item>
+<item> +dropweapon </item>
+<item> +duck </item>
+<item> +forward </item>
+<item> +graph </item>
+<item> +jlook </item>
+<item> +jump </item>
+<item> +kick </item>
+<item> +klook </item>
+<item> +leanleft </item>
+<item> +leanright </item>
+<item> +left </item>
+<item> +lookdown </item>
+<item> +lookup </item>
+<item> +mlook </item>
+<item> +movedown </item>
+<item> +moveleft </item>
+<item> +moveright </item>
+<item> +moveup </item>
+<item> +nvgadjust </item>
+<item> +quickgren </item>
+<item> +reload </item>
+<item> +right </item>
+<item> +salute </item>
+<item> +score </item>
+<item> +showscores </item>
+<item> +speed </item>
+<item> +sprint </item>
+<item> +strafe </item>
+<item> +use </item>
+<item> +useitem </item>
+<item> +voicerecord </item>
+<item> +wbutton7 </item>
+<item> +zoom </item>
+<item> -activate </item>
+<item> -alt1 </item>
+<item> -attack </item>
+<item> -attack2 </item>
+<item> -back </item>
+<item> -break </item>
+<item> -button0 </item>
+<item> -button1 </item>
+<item> -button10 </item>
+<item> -button11 </item>
+<item> -button12 </item>
+<item> -button13 </item>
+<item> -button14 </item>
+<item> -button2 </item>
+<item> -button3 </item>
+<item> -button4 </item>
+<item> -button5 </item>
+<item> -button6 </item>
+<item> -button7 </item>
+<item> -button8 </item>
+<item> -button9 </item>
+<item> -camdistance </item>
+<item> -camin </item>
+<item> -cammousemove </item>
+<item> -camout </item>
+<item> -campitchdown </item>
+<item> -campitchup </item>
+<item> -camyawleft </item>
+<item> -camyawright </item>
+<item> -commandmenu </item>
+<item> -dropweapon </item>
+<item> -duck </item>
+<item> -forward </item>
+<item> -graph </item>
+<item> -jlook </item>
+<item> -jump </item>
+<item> -kick </item>
+<item> -klook </item>
+<item> -leanleft </item>
+<item> -leanright </item>
+<item> -left </item>
+<item> -lookdown </item>
+<item> -lookup </item>
+<item> -mlook </item>
+<item> -movedown </item>
+<item> -moveleft </item>
+<item> -moveright </item>
+<item> -moveup </item>
+<item> -nvgadjust </item>
+<item> -quickgren </item>
+<item> -reload </item>
+<item> -right </item>
+<item> -salute </item>
+<item> -score </item>
+<item> -showscores </item>
+<item> -speed </item>
+<item> -sprint </item>
+<item> -strafe </item>
+<item> -use </item>
+<item> -useitem </item>
+<item> -voicerecord </item>
+<item> -wbutton7 </item>
+<item> -zoom </item>
+</list>
+
+
+<list name="KeyTypes">
+<item> * </item>
+<item> [ </item>
+<item> ] </item>
+<item> \ </item>
+<item> / </item>
+<item> ' </item>
+<item> = </item>
+<item> - </item>
+<item> + </item>
+<item> , </item>
+<item> . </item>
+<item> ` </item>
+<item> ~ </item>
+<item> 1 </item>
+<item> 2 </item>
+<item> 3 </item>
+<item> 4 </item>
+<item> 5 </item>
+<item> 6 </item>
+<item> 7 </item>
+<item> 8 </item>
+<item> 9 </item>
+<item> 0 </item>
+<item> a </item>
+<item> b </item>
+<item> c </item>
+<item> d </item>
+<item> e </item>
+<item> f </item>
+<item> g </item>
+<item> h </item>
+<item> i </item>
+<item> j </item>
+<item> k </item>
+<item> l </item>
+<item> m </item>
+<item> n </item>
+<item> o </item>
+<item> p </item>
+<item> q </item>
+<item> r </item>
+<item> s </item>
+<item> t </item>
+<item> u </item>
+<item> v </item>
+<item> x </item>
+<item> w </item>
+<item> y </item>
+<item> z </item>
+<item> ALT </item>
+<item> AUX1 </item>
+<item> AUX10 </item>
+<item> AUX11 </item>
+<item> AUX12 </item>
+<item> AUX13 </item>
+<item> AUX14 </item>
+<item> AUX15 </item>
+<item> AUX16 </item>
+<item> AUX17 </item>
+<item> AUX18 </item>
+<item> AUX2 </item>
+<item> AUX20 </item>
+<item> AUX21 </item>
+<item> AUX22 </item>
+<item> AUX23 </item>
+<item> AUX24 </item>
+<item> AUX25 </item>
+<item> AUX26 </item>
+<item> AUX27 </item>
+<item> AUX28 </item>
+<item> AUX29 </item>
+<item> AUX3 </item>
+<item> AUX30 </item>
+<item> AUX31 </item>
+<item> AUX32 </item>
+<item> AUX4 </item>
+<item> AUX5 </item>
+<item> AUX6 </item>
+<item> AUX7 </item>
+<item> AUX8 </item>
+<item> AUX9 </item>
+<item> BACKSPACE </item>
+<item> CTRL </item>
+<item> DEL </item>
+<item> DOWNARROW </item>
+<item> END </item>
+<item> ENTER </item>
+<item> ESCAPE </item>
+<item> F1 </item>
+<item> F10 </item>
+<item> F11 </item>
+<item> F12 </item>
+<item> F2 </item>
+<item> F3 </item>
+<item> F4 </item>
+<item> F5 </item>
+<item> F6 </item>
+<item> F7 </item>
+<item> F8 </item>
+<item> F9 </item>
+<item> HOME </item>
+<item> INS </item>
+<item> JOY1 </item>
+<item> JOY2 </item>
+<item> JOY3 </item>
+<item> JOY4 </item>
+<item> KP_SLASH </item>
+<item> KP_5 </item>
+<item> KP_UPARROW </item>
+<item> KP_LEFTARROW </item>
+<item> KP_RIGHTARROW </item>
+<item> KP_DOWNARROW </item>
+<item> KP_HOME </item>
+<item> KP_END </item>
+<item> KP_PGUP </item>
+<item> KP_PGDN </item>
+<item> KP_INS </item>
+<item> KP_DEL </item>
+<item> LEFTARROW </item>
+<item> MOUSE1 </item>
+<item> MOUSE2 </item>
+<item> MOUSE3 </item>
+<item> MWHEELDOWN </item>
+<item> MWHEELUP </item>
+<item> PAUSE </item>
+<item> PGDN </item>
+<item> PGUP </item>
+<item> RIGHTARROW </item>
+<item> SEMICOLON </item>
+<item> CAPSLOCK </item>
+<item> SHIFT </item>
+<item> SPACE </item>
+<item> TAB </item>
+<item> UPARROW </item>
+</list>
+
+ <list name="Symbols">
+ <item> ; </item>
+ <item> $ </item>
+ </list>
+ <list name="BindFamily">
+ <item> bind </item>
+ <item> unbind </item>
+ </list>
+ <list name="setFamily">
+ <item> set </item>
+ <item> seta </item>
+ <item> setu </item>
+ <item> sets </item>
+ </list>
+ <list name="PrintsString">
+ <item> echo </item>
+ <item> say_team </item>
+ <item> say </item>
+ </list>
+
+ <contexts>
+ <context attribute="Normal Text" lineEndContext="#stay" name="Normal Text">
+ <keyword attribute="Command" context="Arg area" String="Commands"/>
+ <keyword attribute="Variable" context="Arg area" String="Variables"/>
+ <keyword attribute="Action" context="#stay" String="Actions"/>
+ <keyword attribute="Symbol" context="#stay" String="Symbols"/>
+ <keyword attribute="Command" context="Bind phrase" String="BindFamily"/>
+ <keyword attribute="Command" context="Alias phrase" String="setFamily"/>
+ <keyword attribute="Command" context="Echo" String="PrintsString"/>
+ <StringDetect attribute="Command" context="Alias phrase" String="alias" insensitive="TRUE"/>
+ <keyword attribute="Command" context="Echo" String="PrintsString"/>
+ <DetectChar attribute="Symbol" context="#stay" char="$"/>
+ <Detect2Chars attribute="Comment" context="Comment" char="/" char1="/"/>
+ </context>
+ <context attribute="Comment" lineEndContext="Normal Text" name="Comment"/>
+ <context attribute="String" lineEndContext="Normal Text" name="String">
+ <DetectChar attribute="String" context="#pop" char="&quot;"/>
+ </context>
+ <context attribute="Normal Text" lineEndContext="Normal Text" name="Arg area">
+ <DetectChar attribute="String" context="String" char="&quot;"/>
+ <Float attribute="Float" context="#stay"/>
+ <Int attribute="Int" context="#stay"/>
+ <DetectChar attribute="Symbol" context="#pop" char=";"/>
+ <Detect2Chars attribute="Comment" context="Comment" char="/" char1="/"/>
+ <DetectChar attribute="Symbol" context="Normal Text" char="$"/>
+ </context>
+ <context attribute="Normal Text" lineEndContext="Normal Text" name="Arg area in sub phrase">
+ <Float attribute="Float" context="#stay"/>
+ <Int attribute="Int" context="#stay"/>
+ <Detect2Chars attribute="Comment" context="Comment" char="/" char1="/"/>
+ <DetectChar attribute="Symbol" context="#pop" char=";"/>
+ </context>
+ <context attribute="Normal Text" lineEndContext="Normal Text" name="Sub phrase">
+ <keyword attribute="Command" context="Arg area in sub phrase" String="Commands"/>
+ <keyword attribute="Variable" context="Arg area in sub phrase" String="Variables"/>
+ <keyword attribute="Action" context="#stay" String="Actions"/>
+ <keyword attribute="Symbol" context="#stay" String="Symbols"/>
+ <keyword attribute="Command" context="Bind phrase" String="BindFamily"/>
+ <keyword attribute="Command" context="Normal Text" String="setFamily"/>
+ <keyword attribute="Command" context="Echo" String="PrintsString"/>
+ <StringDetect attribute="Command" context="Alias phrase" String="alias"/>
+ <Detect2Chars attribute="Comment" context="Comment" char="/" char1="/"/>
+ <DetectChar attribute="Symbol" context="#stay" char=";"/>
+ <Int attribute="Int" context="#stay"/>
+ <DetectChar attribute="Symbol" context="#pop" char=";"/>
+ </context>
+ <context attribute="Normal Text" lineEndContext="Normal Text" name="Bind phrase">
+ <keyword attribute="Hex" context="Sub phrase" String="KeyTypes"/>
+ </context>
+ <context attribute="Identifier" lineEndContext="Normal Text" name="Alias phrase">
+ <DetectChar attribute="Identifier" context="Sub phrase" char=" "/>
+ </context>
+ <context attribute="String" lineEndContext="Normal Text" name="Echo">
+ <DetectChar attribute="Symbol" context="#pop" char=";"/>
+ <Detect2Chars attribute="Comment" context="Comment" char="/" char1="/"/>
+ </context>
+ </contexts>
+ <itemDatas>
+ <itemData name="Command" defStyleNum="dsKeyword" />
+ <itemData name="Action" defStyleNum="dsNormal" color="#ffcc00" italic="1" selColor="#00ff00" bold="1" />
+ <itemData name="Variable" defStyleNum="dsNormal" color="#0000ff" italic="1" selColor="#00ff00" bold="1" />
+ <itemData name="Normal Text" defStyleNum="dsNormal" />
+ <itemData name="Comment" defStyleNum="dsComment" />
+ <itemData name="Float" defStyleNum="dsFloat" />
+ <itemData name="Int" defStyleNum="dsFloat" />
+ <itemData name="String" defStyleNum="dsNormal" color="#ff0000" italic="1" selColor="#00ff00" bold="0" />
+ <itemData name="String Char" defStyleNum="dsChar" />
+ <itemData name="Hex" defStyleNum="dsBaseN" />
+ <itemData name="Symbol" defStyleNum="dsOthers" />
+ <itemData name="Identifier" defStyleNum="dsDataType" />
+ </itemDatas>
+ </highlighting>
+ <general>
+ <comments>
+ <comment name="singleLine" start="//"/>
+ </comments>
+ <keywords weakDeliminator=",+~-=/\.[]$" additionalDeliminator="&quot;;$" casesensitive="0"/>
+ </general>
+</language>
diff --git a/kate/data/idl.xml b/kate/data/idl.xml
new file mode 100644
index 000000000..d75f6713a
--- /dev/null
+++ b/kate/data/idl.xml
@@ -0,0 +1,116 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+<language name="IDL" version="1.07" kateversion="2.4" section="Sources" extensions="*.idl" mimetype="text/x-idl-src">
+ <highlighting>
+ <list name="keywords">
+ <item> any </item>
+ <item> attribute </item>
+ <item> case </item>
+ <item> const </item>
+ <item> context </item>
+ <item> default </item>
+ <item> enum </item>
+ <item> exception </item>
+ <item> FALSE </item>
+ <item> fixed </item>
+ <item> public </item>
+ <item> in </item>
+ <item> inout </item>
+ <item> interface </item>
+ <item> module </item>
+ <item> Object </item>
+ <item> oneway </item>
+ <item> out </item>
+ <item> raises </item>
+ <item> readonly </item>
+ <item> sequence </item>
+ <item> struct </item>
+ <item> switch </item>
+ <item> TRUE </item>
+ <item> typedef </item>
+ <item> unsigned </item>
+ <item> union </item>
+ </list>
+ <list name="types">
+ <item> boolean </item>
+ <item> char </item>
+ <item> double </item>
+ <item> float </item>
+ <item> long </item>
+ <item> octet </item>
+ <item> short </item>
+ <item> string </item>
+ <item> void </item>
+ <item> wchar </item>
+ <item> wstring </item>
+ </list>
+ <contexts>
+ <context attribute="Normal Text" lineEndContext="#stay" name="Normal">
+ <keyword attribute="Keyword" context="#stay" String="keywords" />
+ <keyword attribute="Data Type" context="#stay" String="types" />
+ <HlCOct attribute="Octal" context="#stay"/>
+ <HlCHex attribute="Hex" context="#stay"/>
+ <HlCChar attribute="Char" context="#stay"/>
+ <DetectChar attribute="String" context="String" char="&quot;"/>
+ <IncludeRules context="##Doxygen" />
+ <Detect2Chars attribute="Comment" context="Commentar 1" char="/" char1="/"/>
+ <Detect2Chars attribute="Comment" context="Commentar 2" char="/" char1="*"/>
+ <AnyChar attribute="Symbol" context="#stay" String="!%&amp;()+,-&lt;=&gt;?[]^{|}~"/>
+ <StringDetect attribute="Comment" context="Some Context3" String="#if 0" insensitive="FALSE"/>
+ <DetectChar attribute="Preprocessor" context="Preprocessor" char="#" column="0"/>
+ </context>
+ <context attribute="String" lineEndContext="#stay" name="String">
+ <LineContinue attribute="String" context="Some Context"/>
+ <HlCStringChar attribute="String Char" context="#stay"/>
+ <DetectChar attribute="String" context="#pop" char="&quot;"/>
+ </context>
+ <context attribute="Comment" lineEndContext="#pop" name="Commentar 1">
+ <RegExpr attribute="Alert" context="#stay" String="(FIXME|TODO)" />
+ </context>
+ <context attribute="Comment" lineEndContext="#stay" name="Commentar 2">
+ <RegExpr attribute="Alert" context="#stay" String="(FIXME|TODO)" />
+ <Detect2Chars attribute="Comment" context="#pop" char="*" char1="/"/>
+ </context>
+ <context attribute="Preprocessor" lineEndContext="#pop" name="Preprocessor">
+ <LineContinue attribute="Preprocessor" context="Some Context2"/>
+ <RangeDetect attribute="Prep. Lib" context="#stay" char="&quot;" char1="&quot;"/>
+ <RangeDetect attribute="Prep. Lib" context="#stay" char="&lt;" char1="&gt;"/>
+ <Detect2Chars attribute="Comment" context="Commentar 1" char="/" char1="/"/>
+ <Detect2Chars attribute="Comment" context="Commentar/Preprocessor" char="/" char1="*"/>
+ </context>
+ <context attribute="Comment" lineEndContext="#stay" name="Commentar/Preprocessor">
+ <Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" />
+ </context>
+ <context attribute="Normal Text" lineEndContext="#pop" name="Some Context"/>
+ <context attribute="Normal Text" lineEndContext="#pop" name="Some Context2"/>
+ <context attribute="Normal Text" lineEndContext="#stay" name="Some Context3">
+ <RegExpr attribute="Alert" context="#stay" String="(FIXME|TODO)" />
+ <StringDetect attribute="Comment" context="#pop" String="#endif" column="0"/>
+ </context>
+ </contexts>
+ <itemDatas>
+ <itemData name="Normal Text" defStyleNum="dsNormal"/>
+ <itemData name="Keyword" defStyleNum="dsKeyword"/>
+ <itemData name="Data Type" defStyleNum="dsDataType"/>
+ <itemData name="Decimal" defStyleNum="dsDecVal"/>
+ <itemData name="Octal" defStyleNum="dsBaseN"/>
+ <itemData name="Hex" defStyleNum="dsBaseN"/>
+ <itemData name="Float" defStyleNum="dsFloat"/>
+ <itemData name="Char" defStyleNum="dsChar"/>
+ <itemData name="String" defStyleNum="dsString"/>
+ <itemData name="String Char" defStyleNum="dsChar"/>
+ <itemData name="Comment" defStyleNum="dsComment"/>
+ <itemData name="Symbol" defStyleNum="dsNormal"/>
+ <itemData name="Preprocessor" defStyleNum="dsOthers"/>
+ <itemData name="Prep. Lib" defStyleNum="dsOthers"/> <!--,Qt::darkYellow,Qt::yellow,false,false)); -->
+ <itemData name="Alert" defStyleNum="dsAlert" />
+ </itemDatas>
+ </highlighting>
+ <general>
+ <comments>
+ <comment name="singleLine" start="//" />
+ <comment name="multiLine" start="/*" end="*/" />
+ </comments>
+ <keywords casesensitive="1" />
+ </general>
+</language>
diff --git a/kate/data/ilerpg.xml b/kate/data/ilerpg.xml
new file mode 100644
index 000000000..a7060f609
--- /dev/null
+++ b/kate/data/ilerpg.xml
@@ -0,0 +1,725 @@
+<!DOCTYPE language SYSTEM "language.dtd">
+<!--
+ *************************************************************************
+ * *
+ * Syntax highlighting for IBM iSeries ILE RPG *
+ * Copyright (C) 2003, Nick Roux *
+ * *
+ *************************************************************************
+
+ Updated: Nick Roux <nick@sundown.homeip.net>
+ Date: 2006/04/12
+ Version: 1.05
+ Added support for compiler directives and especially /free
+ Added positional check for opcodes and validation of conditioning indicators
+
+ Author: Nick Roux <nick@sundown.homeip.net>
+ Date: Sometime during 2003
+ Version: 1.0
+
+ This file contains the XML syntax highlighting description for the IBM
+ iSeries ILE RPG, for KATE, the KDE Advanced Editor.
+ Based on information from IBM publication SC09-2508-05
+
+ Known problems:
+ 1) Calculation Specification Factor1 does not get highlighted
+ 2) Calculation Specification Extended Factor2 Continuation Line does not work correctly
+ 3) Everything from the start of Factor2 is assumed free format
+ 4) Will make a total mess of compile time array data, but that seems rather fitting
+ 5) Operation Code Extenders are not check/highlighted
+ 6) It is slow
+
+ This program, including associated files, is free software. You may
+ distribute it and/or modify it under the terms of the GNU General Public
+ License as published by the Free Software Foundation; either Version 2 of
+ the license, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+-->
+
+<language name="ILERPG" version="1.05" kateversion="2.1" section="Sources" extensions="QRPG*.*;qrpg*.*" mimetype="text/x-ilerpg-src" casesensitive="0">
+ <highlighting>
+ <list name="dkeywords">
+ <item> EXTPROC </item>
+ <item> EXTPGM </item>
+ <item> OPDESC </item>
+ <item> DATFMT </item>
+ <item> DIM </item>
+ <item> LIKEDS </item>
+ <item> LIKEREC </item>
+ <item> LIKE </item>
+ <item> PROCPTR </item>
+ <item> TIMFMT </item>
+ <item> VARYING </item>
+ <item> ASCEND </item>
+ <item> CONST </item>
+ <item> NOOPT </item>
+ <item> OPTIONS </item>
+ <item> VALUE </item>
+ <item> QUALIFIED </item>
+ <item> INZ </item>
+ <item> BASED </item>
+ </list>
+ <list name="pkeywords">
+ <item> DATFMT </item>
+ <item> DIM </item>
+ <item> LIKE </item>
+ <item> LIKEDS </item>
+ <item> LIKEREC </item>
+ <item> PROCPTR </item>
+ <item> TIMFMT </item>
+ </list>
+ <list name="directives">
+ <item> FREE </item>
+ <item> END-FREE </item>
+ <item> TITLE </item>
+ <item> EJECT </item>
+ <item> SPACE </item>
+ <item> COPY </item>
+ <item> INCLUDE </item>
+ <item> DEFINE </item>
+ <item> UNDEFINE </item>
+ <item> IF </item>
+ <item> ELSE </item>
+ <item> EXEC </item>
+ <item> END-EXEC </item>
+ <item> ELSEIF </item>
+ <item> ENDIF </item>
+ <item> EOF </item>
+ </list>
+ <list name="directives2">
+ <item> NOT </item>
+ <item> DEFINED </item>
+ </list>
+ <list name="directives3">
+ <item> DEFINED </item>
+ </list>
+ <list name="biffs">
+ <item> ABS </item>
+ <item> ADDR </item>
+ <item> ALLOC </item>
+ <item> BITAND </item>
+ <item> BITNOT </item>
+ <item> BITOR </item>
+ <item> BITXOR </item>
+ <item> CHAR </item>
+ <item> CHECK </item>
+ <item> CHECKR </item>
+ <item> DATE </item>
+ <item> DAYS </item>
+ <item> DEC </item>
+ <item> DECH </item>
+ <item> DECPOS </item>
+ <item> DIFF </item>
+ <item> DIV </item>
+ <item> EDITC </item>
+ <item> EDITFLT </item>
+ <item> EDITW </item>
+ <item> ELEM </item>
+ <item> EOF </item>
+ <item> EQUAL </item>
+ <item> ERROR </item>
+ <item> FIELDS </item>
+ <item> FLOAT </item>
+ <item> FOUND </item>
+ <item> GRAPH </item>
+ <item> HOURS </item>
+ <item> INT </item>
+ <item> INTH </item>
+ <item> KDS </item>
+ <item> LEN </item>
+ <item> LOOKUP </item>
+ <item> LOOKUPLT </item>
+ <item> LOOKUPLE </item>
+ <item> LOOKUPGT </item>
+ <item> LOOKUPGE </item>
+ <item> MINUTES </item>
+ <item> MONTHS </item>
+ <item> MSECONDS </item>
+ <item> NULLIND </item>
+ <item> OCCUR </item>
+ <item> OPEN </item>
+ <item> PADDR </item>
+ <item> PARMS </item>
+ <item> REALLOC </item>
+ <item> REM </item>
+ <item> REPLACE </item>
+ <item> SCAN </item>
+ <item> SECONDS </item>
+ <item> SHTDN </item>
+ <item> SIZE </item>
+ <item> SQRT </item>
+ <item> STATUS </item>
+ <item> STR </item>
+ <item> SUBARR </item>
+ <item> SUBDT </item>
+ <item> SUBST </item>
+ <item> THIS </item>
+ <item> TIME </item>
+ <item> TIMESTAMP </item>
+ <item> TLOOKUP </item>
+ <item> TLOOKUPLT </item>
+ <item> TLOOKUPLE </item>
+ <item> TLOOKUPGT </item>
+ <item> TLOOKUPGE </item>
+ <item> TRIM </item>
+ <item> TRIML </item>
+ <item> TRIMR </item>
+ <item> UCS2 </item>
+ <item> UNS </item>
+ <item> UNSH </item>
+ <item> XFOOT </item>
+ <item> XLATE </item>
+ <item> YEARS </item>
+ </list>
+ <list name="evalopcodes2">
+ <item> IF </item>
+ </list>
+ <list name="evalopcodes3">
+ <item> DOW </item>
+ <item> DOU </item>
+ <item> FOR </item>
+ </list>
+ <list name="evalopcodes4">
+ <item> WHEN </item>
+ <item> EVAL </item>
+ </list>
+ <list name="evalopcodes5">
+ <item> EVALR </item>
+ </list>
+ <list name="evalopcodes6">
+ <item> RETURN </item>
+ </list>
+ <list name="evalopcodes8">
+ <item> ON-ERROR </item>
+ </list>
+ <list name="nonevalopcodes2">
+ <item> DO </item>
+ <item> IN </item>
+ <item> OR </item>
+ </list>
+ <list name="nonevalopcodes3">
+ <item> ACQ </item>
+ <item> ADD </item>
+ <item> AND </item>
+ <item> CAB </item>
+ <item> CAS </item>
+ <item> CAT </item>
+ <item> DIV </item>
+ <item> DOU </item>
+ <item> END </item>
+ <item> MVR </item>
+ <item> OUT </item>
+ <item> REL </item>
+ <item> SUB </item>
+ <item> TAG </item>
+ </list>
+ <list name="nonevalopcodes4">
+ <item> CALL </item>
+ <item> COMP </item>
+ <item> DUMP </item>
+ <item> ELSE </item>
+ <item> EXSR </item>
+ <item> FEOD </item>
+ <item> GOTO </item>
+ <item> IFGT </item>
+ <item> IFLT </item>
+ <item> IFEQ </item>
+ <item> IFNE </item>
+ <item> IFGE </item>
+ <item> IFLE </item>
+ <item> ITER </item>
+ <item> KFLD </item>
+ <item> MOVE </item>
+ <item> MULT </item>
+ <item> NEXT </item>
+ <item> OPEN </item>
+ <item> ORGT </item>
+ <item> ORLT </item>
+ <item> OREQ </item>
+ <item> ORNE </item>
+ <item> ORGE </item>
+ <item> ORLE </item>
+ <item> PARM </item>
+ <item> POST </item>
+ <item> READ </item>
+ <item> SCAN </item>
+ <item> SQRT </item>
+ <item> TEST </item>
+ <item> TIME </item>
+ </list>
+ <list name="nonevalopcodes5">
+ <item> ALLOC </item>
+ <item> ANDGT </item>
+ <item> ANDLT </item>
+ <item> ANDEQ </item>
+ <item> ANDNE </item>
+ <item> ANDGE </item>
+ <item> ANDLE </item>
+ <item> BEGSR </item>
+ <item> BITON </item>
+ <item> CABGT </item>
+ <item> CABLT </item>
+ <item> CABEQ </item>
+ <item> CABNE </item>
+ <item> CABGE </item>
+ <item> CABLE </item>
+ <item> CALLB </item>
+ <item> CALLP </item>
+ <item> CASGT </item>
+ <item> CASLT </item>
+ <item> CASEQ </item>
+ <item> CASNE </item>
+ <item> CASGE </item>
+ <item> CASLE </item>
+ <item> CHAIN </item>
+ <item> CHECK </item>
+ <item> CLEAR </item>
+ <item> CLOSE </item>
+ <item> CHECK </item>
+ <item> CLEAR </item>
+ <item> CLOSE </item>
+ <item> DOWGT </item>
+ <item> DOWLT </item>
+ <item> DOWEQ </item>
+ <item> DOWNE </item>
+ <item> DOWGE </item>
+ <item> DOWLE </item>
+ <item> DOUGT </item>
+ <item> DOULT </item>
+ <item> DOUEQ </item>
+ <item> DOUNE </item>
+ <item> DOUGE </item>
+ <item> DOULE </item>
+ <item> DSPLY </item>
+ <item> ENDCS </item>
+ <item> ENDDO </item>
+ <item> ENDIF </item>
+ <item> ENDSL </item>
+ <item> ENDSR </item>
+ <item> EXFMT </item>
+ <item> FORCE </item>
+ <item> KLIST </item>
+ <item> LEAVE </item>
+ <item> MHHZO </item>
+ <item> MHLZO </item>
+ <item> MLHZO </item>
+ <item> MLLZO </item>
+ <item> MOVEA </item>
+ <item> MOVEL </item>
+ <item> OCCUR </item>
+ <item> OTHER </item>
+ <item> PLIST </item>
+ <item> READC </item>
+ <item> READE </item>
+ <item> READP </item>
+ <item> RESET </item>
+ <item> ROLBK </item>
+ <item> SETGT </item>
+ <item> SETLL </item>
+ <item> SETON </item>
+ <item> SHTDN </item>
+ <item> SORTA </item>
+ <item> SUBST </item>
+ <item> TESTB </item>
+ <item> TESTN </item>
+ <item> TESTZ </item>
+ <item> WRITE </item>
+ <item> XFOOT </item>
+ <item> XLATE </item>
+ </list>
+ <list name="nonevalopcodes6">
+ <item> ADDDUR </item>
+ <item> BITOFF </item>
+ <item> CHECKR </item>
+ <item> COMMIT </item>
+ <item> DEFINE </item>
+ <item> DELETE </item>
+ <item> EXCEPT </item>
+ <item> EXTRCT </item>
+ <item> LOOKUP </item>
+ <item> READPE </item>
+ <item> RETURN </item>
+ <item> SELECT </item>
+ <item> SETOFF </item>
+ <item> SUBDUR </item>
+ <item> UNLOCK </item>
+ <item> UPDATE </item>
+ <item> WHENGT </item>
+ <item> WHENLT </item>
+ <item> WHENEQ </item>
+ <item> WHENNR </item>
+ <item> WHENGE </item>
+ <item> WHENLE </item>
+ </list>
+ <list name="nonevalopcodes7">
+ <item> DEALLOC </item>
+ <item> REALLOC </item>
+ </list>
+ <list name="freeopcodes">
+ <item> ACQ </item>
+ <item> BEGSR </item>
+ <item> CALLP </item>
+ <item> CHAIN </item>
+ <item> CLEAR </item>
+ <item> CLOSE </item>
+ <item> COMMIT </item>
+ <item> DEALLOC </item>
+ <item> DELETE </item>
+ <item> DOU </item>
+ <item> DOW </item>
+ <item> DSPLY </item>
+ <item> DUMP </item>
+ <item> ELSE </item>
+ <item> ELSEIF</item>
+ <item> ENDDO </item>
+ <item> ENDFOR </item>
+ <item> ENDIF </item>
+ <item> ENDMON </item>
+ <item> ENDSL </item>
+ <item> ENDSR </item>
+ <item> EVAL </item>
+ <item> EVALR </item>
+ <item> EXCEPT </item>
+ <item> EXFMT </item>
+ <item> EXSR </item>
+ <item> FEOD </item>
+ <item> FOR </item>
+ <item> FORCE </item>
+ <item> IF </item>
+ <item> IN </item>
+ <item> ITER </item>
+ <item> LEAVE </item>
+ <item> LEAVESR</item>
+ <item> MONITOR </item>
+ <item> NEXT </item>
+ <item> ON-ERROR </item>
+ <item> OPEN </item>
+ <item> OTHER </item>
+ <item> OUT </item>
+ <item> POST </item>
+ <item> READ </item>
+ <item> READC </item>
+ <item> READE </item>
+ <item> READP </item>
+ <item> READPE </item>
+ <item> REL </item>
+ <item> RESET </item>
+ <item> RETURN </item>
+ <item> ROLBK </item>
+ <item> SELECT </item>
+ <item> SETGT </item>
+ <item> SETLL </item>
+ <item> SORTA </item>
+ <item> TEST </item>
+ <item> UNLOCK </item>
+ <item> UPDATE </item>
+ <item> WHEN </item>
+ <item> WRITE </item>
+ </list>
+
+ <contexts>
+
+<!-- Start here -->
+ <!-- Form Type -->
+ <context name="Default" attribute="Normal Text" lineEndContext="#stay">
+ <RegExpr attribute="Comment" context="Comments" String="[PpOoIiHhFfDdCc ]?\*"/>
+ <RegExpr attribute="Directive" context="Directives" String="[PpOoIiHhFfDdCc ]?/"/>
+ <AnyChar attribute="Keyword" context="AnyCode" String="OoIiHhFf"/>
+ <AnyChar attribute="Keyword" context="D" String="Dd"/>
+ <AnyChar attribute="Keyword" context="P" String="Pp"/>
+ <AnyChar attribute="Keyword" context="CControlLevel" String="Cc"/>
+ </context>
+
+<!-- Calculation Specifications -->
+ <!-- Control Level -->
+ <context name="CControlLevel" attribute="Normal Text" lineEndContext="#pop">
+ <RegExpr attribute="Indicator" context="CIndicators" String="\ {2}"/>
+ <RegExpr attribute="Indicator" context="CIndicators" String="[L|l][0-9]"/>
+ <RegExpr attribute="Indicator" context="CIndicators" String="[O|o|L|l|S|s][R|r]"/>
+ <RegExpr attribute="Indicator" context="CIndicators" String="[A|a][N|n]"/>
+ <RegExpr attribute="Indicator" context="CIndicators" String="[L|l|S|s][R|r]"/>
+ <RegExpr attribute="Alert" context="CIndicators" String=".{2}"/>
+ </context>
+
+ <!-- Indicators -->
+ <context name="CIndicators" attribute="Normal Text" lineEndContext="#pop#pop">
+ <RegExpr attribute="Indicator" context="CFactor1" String="\ {3}"/>
+ <RegExpr attribute="Indicator" context="CFactor1" String="[\ |N|n][0-9]{2}"/>
+ <RegExpr attribute="Indicator" context="CFactor1" String="[\ |N|n][K|k][A-N|p-y]"/>
+ <RegExpr attribute="Indicator" context="CFactor1" String="[\ |N|n][K|k][P-Y|p-y]}"/>
+ <RegExpr attribute="Indicator" context="CFactor1" String="[\ |N|n][L|l][1-9]"/>
+ <RegExpr attribute="Indicator" context="CFactor1" String="[\ |N|n][L|l|M|m][R|r]"/>
+ <RegExpr attribute="Indicator" context="CFactor1" String="[\ |N|n][R|r][T|t]"/>
+ <RegExpr attribute="Indicator" context="CFactor1" String="[\ |N|n][U|u][1-8]"/>
+ <RegExpr attribute="Indicator" context="CFactor1" String="[\ |N|n][O|o][A-G|a-g]"/>
+ <RegExpr attribute="Indicator" context="CFactor1" String="[\ |N|n][O|o][V|v]"/>
+ <RegExpr attribute="Indicator" context="CFactor1" String="[\ |N|n][H|h][1-9]"/>
+ <RegExpr attribute="Alert" context="CFactor1" String=".{3}"/>
+ </context>
+
+ <!-- Factor1 -->
+ <context name="CFactor1" attribute="Normal Text" lineEndContext="#pop#pop#pop">
+ <!-- TODO -->
+ <RegExpr attribute="Normal Text" context="FindOC" String=".{14}"/>
+ </context>
+
+ <!-- FindOpcode -->
+ <context name="FindOC" attribute="Normal Text" lineEndContext="#pop#pop#pop#pop">
+ <keyword attribute="Keyword" context="NonEvalOC2" String="nonevalopcodes2"/>
+ <keyword attribute="Keyword" context="NonEvalOC3" String="nonevalopcodes3"/>
+ <keyword attribute="Keyword" context="NonEvalOC4" String="nonevalopcodes4"/>
+ <keyword attribute="Keyword" context="NonEvalOC5" String="nonevalopcodes5"/>
+ <keyword attribute="Keyword" context="NonEvalOC6" String="nonevalopcodes6"/>
+ <keyword attribute="Keyword" context="NonEvalOC7" String="nonevalopcodes7"/>
+ <RegExpr attribute="Keyword" context="NonEvalOC5" String="[Z|z]-([A|a][D|d]{2}|[S|s][U|u][B|b])"/>
+ <keyword attribute="Keyword" context="EvalOC2" String="evalopcodes2"/>
+ <keyword attribute="Keyword" context="EvalOC3" String="evalopcodes3"/>
+ <keyword attribute="Keyword" context="EvalOC4" String="evalopcodes4"/>
+ <keyword attribute="Keyword" context="EvalOC5" String="evalopcodes5"/>
+ <keyword attribute="Keyword" context="EvalOC6" String="evalopcodes6"/>
+ <RegExpr attribute="Keyword" context="EvalOC8" String="[O|o][N|n]-([E|e][R|r]{2}|[O|o][R|r])"/>
+ <RegExpr attribute="Normal Text" context="CFactor2" String="\ {10}"/>
+ <RegExpr attribute="Alert" context="CFactor2" String=".{10}"/>
+ </context>
+
+ <!-- Opcodes that can NOT be followed by evaluation expressions -->
+ <context name="NonEvalOC2" attribute="Normal Text" lineEndContext="Default">
+ <RegExpr attribute="Normal Text" context="CFactor2" String="\ {8}"/>
+ </context>
+ <context name="NonEvalOC3" attribute="Normal Text" lineEndContext="Default">
+ <RegExpr attribute="Normal Text" context="CFactor2" String="\ {7}"/>
+ </context>
+ <context name="NonEvalOC4" attribute="Normal Text" lineEndContext="Default">
+ <RegExpr attribute="Normal Text" context="CFactor2" String="\ {6}"/>
+ </context>
+ <context name="NonEvalOC5" attribute="Normal Text" lineEndContext="Default">
+ <RegExpr attribute="Normal Text" context="CFactor2" String="\ {5}"/>
+ </context>
+ <context name="NonEvalOC6" attribute="Normal Text" lineEndContext="Default">
+ <RegExpr attribute="Normal Text" context="CFactor2" String="\ {4}"/>
+ </context>
+ <context name="NonEvalOC7" attribute="Normal Text" lineEndContext="Default">
+ <RegExpr attribute="Normal Text" context="CFactor2" String="\ {3}"/>
+ </context>
+
+ <context name="CFactor2" attribute="Normal Text" lineEndContext="Default">
+ <DetectChar attribute="Biff" context="Biffs" char="%"/>
+ <IncludeRules context="CommonCode" />
+ </context>
+
+ <!-- Opcodes that can be followed by evaluation expressions -->
+ <context name="EvalOC2" attribute="Normal Text" lineEndContext="Default">
+ <RegExpr attribute="Normal Text" context="CExFactor2" String="\ {8}"/>
+ </context>
+ <context name="EvalOC3" attribute="Normal Text" lineEndContext="Default">
+ <RegExpr attribute="Normal Text" context="CExFactor2" String="\ {7}"/>
+ </context>
+ <context name="EvalOC4" attribute="Normal Text" lineEndContext="Default">
+ <RegExpr attribute="Normal Text" context="CExFactor2" String="\ {6}"/>
+ </context>
+ <context name="EvalOC5" attribute="Normal Text" lineEndContext="Default">
+ <RegExpr attribute="Normal Text" context="CExFactor2" String="\ {5}"/>
+ </context>
+ <context name="EvalOC6" attribute="Normal Text" lineEndContext="Default">
+ <RegExpr attribute="Normal Text" context="CExFactor2" String="\ {4}"/>
+ </context>
+ <context name="EvalOC8" attribute="Normal Text" lineEndContext="Default">
+ <RegExpr attribute="Normal Text" context="CExFactor2" String="\ {2}"/>
+ </context>
+
+ <context name="CExFactor2" attribute="Normal Text" lineEndContext="Default">
+ <DetectChar attribute="Biff" context="Biffs" char="%"/>
+ <IncludeRules context="CommonCode" />
+ </context>
+
+ <!-- Check for continuation of eval -->
+ <context name="EvalOCCont" attribute="Normal Text" lineEndContext="#stay">
+ <DetectChar attribute="Biff" context="Biffs" char="%"/>
+ <IncludeRules context="CommonCode" />
+ </context>
+
+ <!-- Comments -->
+ <context name="Comments" attribute="Comment" lineEndContext="#pop">
+ <RegExpr attribute="BoldComment" context="#stay" String="\(*(FIXME|TODO)\)*" />
+ <RegExpr attribute="BoldComment" context="#stay" String="\(*(NOTE:)\)*" />
+ <RegExpr attribute="DivideComment" context="#stay" String="-|="/>
+ </context>
+
+ <!-- String Constants -->
+ <context name="StringConstants" attribute="ConstantChar" lineEndContext="#pop">
+ <DetectChar attribute="ConstantChar" context="#pop" char="'"/>
+ </context>
+
+ <!-- Compiler Directives -->
+ <context name="Directives" attribute="Normal Text" lineEndContext="Default">
+ <RegExpr attribute="Directive" context="Free" String="[F|f][R|r][E|e][E|e]"/>
+ <RegExpr attribute="Directive" context="Exec" String="[E|e][X|x][E|e][C|c]"/>
+ <keyword attribute="Directive" context="Directives2" String="directives"/>
+ </context>
+ <context name="Directives2" attribute="Normal Text" lineEndContext="Default">
+ <keyword attribute="Directive" context="Directives3" String="directives2"/>
+ </context>
+ <context name="Directives3" attribute="Normal Text" lineEndContext="Default">
+ <keyword attribute="Directive" context="#stay" String="directives3"/>
+ </context>
+
+ <!-- Free -->
+ <context name="Free" attribute="Normal Text" lineEndContext="#stay">
+ <RegExpr attribute="Directive" context="#pop" String="[POIHFDC ]?/[E|e][N|n][D|d]-[F|f][R|r][E|e][E|e]"/>
+ <IncludeRules context="CommonCode" />
+ <DetectChar attribute="Biff" context="Biffs" char="%"/>
+ <RegExpr attribute="Comment" context="Comments" String="//"/>
+ <keyword attribute="Keyword" context="#stay" String="freeopcodes"/>
+ </context>
+
+ <!-- Exec -->
+ <context name="Exec" attribute="Normal Text" lineEndContext="#stay">
+ <RegExpr attribute="Directive" context="#pop" String="[POIHFDC ]?/[E|e][N|n][D|d]-[E|e][X|x][E|e][C|c]"/>
+ </context>
+
+ <context name="Biffs" attribute="Biff" lineEndContext="#pop">
+ <keyword attribute="Biff" context="#pop" String="biffs"/>
+ <RegExpr attribute="Normal Text" context="#pop" String="."/>
+ </context>
+
+ <!-- Stuff common to all code Use as Include -->
+ <context name="CommonCode" attribute="Normal Text" lineEndContext="#stay">
+ <IncludeRules context="ReservedWords" />
+ <IncludeRules context="Indicators" />
+ <DetectChar attribute="ConstantChar" context="StringConstants" char="'"/>
+ <Float attribute="Float" context="#stay"/>
+ <RegExpr attribute="Hex" context="#stay" String="[Xx]'[0-9a-fA-F]{2,}'"/>
+ <Int attribute="Decimal" context="#stay">
+ <StringDetect attribute="Decimal" context="#stay" String="ULL" insensitive="TRUE"/>
+ <StringDetect attribute="Decimal" context="#stay" String="LUL" insensitive="TRUE"/>
+ <StringDetect attribute="Decimal" context="#stay" String="LLU" insensitive="TRUE"/>
+ <StringDetect attribute="Decimal" context="#stay" String="UL" insensitive="TRUE"/>
+ <StringDetect attribute="Decimal" context="#stay" String="LU" insensitive="TRUE"/>
+ <StringDetect attribute="Decimal" context="#stay" String="LL" insensitive="TRUE"/>
+ <StringDetect attribute="Decimal" context="#stay" String="U" insensitive="TRUE"/>
+ <StringDetect attribute="Decimal" context="#stay" String="L" insensitive="TRUE"/>
+ </Int>
+ </context>
+
+ <!-- Reserved words - Use as include -->
+ <context name="Indicators" attribute="Normal Text" lineEndContext="#stay">
+ <RegExpr attribute="Indicator" context="#stay" String="\*[I|i][N|n]\(?[0-9][0-9]\)?"/>
+ <RegExpr attribute="Indicator" context="#stay" String="\*[I|i][N|n]\(?1[P|p]\)?"/>
+ <RegExpr attribute="Indicator" context="#stay" String="\*[I|i][N|n]\(?[H|h|L|l][1-9]\)?"/>
+ <RegExpr attribute="Indicator" context="#stay" String="\*[I|i][N|n]\(?[L|l|M|m][R|r]\)?"/>
+ <RegExpr attribute="Indicator" context="#stay" String="\*[I|i][N|n]\(?[O|o][A-G|a-g|V|v]\)?"/>
+ <RegExpr attribute="Indicator" context="#stay" String="\*[I|i][N|n]\(?[U|u][1-8]\)?"/>
+ <RegExpr attribute="Indicator" context="#stay" String="\*[I|i][N|n]\(?[K|k][A-N|a-n|P-Y|p-y]\)?"/>
+ <RegExpr attribute="Indicator" context="#stay" String="\*[I|i][N|n]\(?[R|r][T|t]\)?"/>
+ </context>
+
+ <!-- Reserved words - Use as include -->
+ <context name="ReservedWords" attribute="Normal Text" lineEndContext="#stay">
+ <RegExpr attribute="Reserved" context="#stay" String="[\*|U|u][D|d][A|a][T|t][E|e]"/>
+ <RegExpr attribute="Reserved" context="#stay" String="[\*|U|u][M|m][O|o][N|n][T|t][H|h]"/>
+ <RegExpr attribute="Reserved" context="#stay" String="[\*|U|u][Y|y][E|e][A|a][R|r]"/>
+ <RegExpr attribute="Reserved" context="#stay" String="[\*|U|u][D|d][A|a][Y|y]"/>
+ <RegExpr attribute="Reserved" context="#stay" String="\ [P|p][A|a][G|g][E|e][1-7]?"/>
+ <!-- *ALL(X/G) *BLANKS *ON *OFF *NULL *ZERO(s) *HIVAL *LOVAL *PSSR *END *START-->
+ <RegExpr attribute="Constant" context="#stay" String="\*([A|a][A|l]{2}[X|x|G|g]?|[B|b][L|l][A|a][N|n][K|k][S|s]?|[O|o][N|n]|[O|o][F|f]{2}|[N|n][U|u][L|l]{2}|[Z|z][E|e][R|r][O|o][S|s]?|[H|h][I|i][V|v][A|a][L|l]|[L|l][O|o][V|v][A|a][L|l]|[P|p][S|s]{2}[R|r]|[E|e][N|n][D|d]|[S|s][T|t][A|a][R|r][T|t])"/>
+ <!-- Date stuff -->
+ <RegExpr attribute="Reserved" context="#stay" String="\*[C|c][D|d][M|m][Y|y]"/>
+ <RegExpr attribute="Reserved" context="#stay" String="\*[C|c][M|m][D|d][Y|y]"/>
+ <RegExpr attribute="Reserved" context="#stay" String="\*[C|c][Y|y][M|m][D|d]"/>
+ <RegExpr attribute="Reserved" context="#stay" String="\*[D|d][M|m][Y|y]"/>
+ <RegExpr attribute="Reserved" context="#stay" String="\*[E|e][U|u][R|r]"/>
+ <RegExpr attribute="Reserved" context="#stay" String="\*[H|h][M|m][S|s]"/>
+ <RegExpr attribute="Reserved" context="#stay" String="\*[I|i][S|s][O|o]"/>
+ <RegExpr attribute="Reserved" context="#stay" String="\*[J|j][I|i][S|s]"/>
+ <RegExpr attribute="Reserved" context="#stay" String="\*[J|j][O|o][B|b]([R|r][U|u][N|n])?"/>
+ <RegExpr attribute="Reserved" context="#stay" String="\*([L|l][O|o][N|n][G|g])?[J|j][U|u][L|l]"/>
+ <RegExpr attribute="Reserved" context="#stay" String="\*[M|m][D|d][Y|y]"/>
+ <RegExpr attribute="Reserved" context="#stay" String="\*[S|s][Y|y][S|s]"/>
+ <RegExpr attribute="Reserved" context="#stay" String="\*[U|u][S|s][A|a]"/>
+ <RegExpr attribute="Reserved" context="#stay" String="\*[Y|y][M|m][D|d]"/>
+
+ <RegExpr attribute="Reserved" context="#stay" String="\*[A|a][L|l][T|t][S|s][E|e][Q|q]"/>
+ <RegExpr attribute="Reserved" context="#stay" String="\*[E|e][Q|q][U|u][A|a][T|t][E|e]"/>
+ <RegExpr attribute="Reserved" context="#stay" String="\*[F|f][I|i][L|l][E|e]"/>
+ <RegExpr attribute="Reserved" context="#stay" String="\*[F|f][T|t][R|r][A|a][N|n][S|s]"/>
+
+ <RegExpr attribute="Reserved" context="#stay" String="\*[I|i][L|l][E|e][R|r][P|p][G|g]"/>
+ <RegExpr attribute="Reserved" context="#stay" String="\*[C|c][R|r][T|t][B|b][N|n][D|d][R|r][P|p][G|g]"/>
+ <RegExpr attribute="Reserved" context="#stay" String="\*[C|c][R|r][T|t][R|r][P|p][G|g][M|m][O|o][D|d]"/>
+ <RegExpr attribute="Reserved" context="#stay" String="\*[V|v][0-9][R|r][0-9][M|m][0-9]"/>
+
+ </context>
+
+ <!-- AnyCode -->
+ <context name="AnyCode" attribute="Normal Text" lineEndContext="#pop">
+ <IncludeRules context="CommonCode" />
+ </context>
+
+ <!-- D -->
+ <context name="D" attribute="Normal Text" lineEndContext="#pop">
+ <keyword attribute="Keyword" context="#stay" String="dkeywords"/>
+ <RegExpr attribute="Reserved" context="#stay" String="\*[N|n][O|o][P|p][A|a][S|s]{2}"/>
+ <RegExpr attribute="Reserved" context="#stay" String="\*[O|o][M|m][I|i][T|t]"/>
+ <RegExpr attribute="Reserved" context="#stay" String="\*[V|v][A|a][R|r][S|s][I|i][Z|z][E|e]"/>
+ <RegExpr attribute="Reserved" context="#stay" String="\*[R|r][I|i][G|g][H|h][T|t][A|a][D|d][J|j]"/>
+ <RegExpr attribute="Reserved" context="#stay" String="\*[S|s][T|t][R|r][I|i][N|n][G|g]"/>
+ <RegExpr attribute="Reserved" context="#stay" String="\*[T|t][R|r][I|i][M|m]"/>
+ <DetectChar attribute="Biff" context="Biffs" char="%"/>
+ <IncludeRules context="CommonCode" />
+ </context>
+
+ <!-- P -->
+ <context name="P" attribute="Normal Text" lineEndContext="#pop">
+ <keyword attribute="Keyword" context="#stay" String="dkeywords"/>
+ <RegExpr attribute="Reserved" context="#stay" String="\*[N|n][O|o][P|p][A|a][S|s]{2}"/>
+ <RegExpr attribute="Reserved" context="#stay" String="\*[O|o][M|m][I|i][T|t]"/>
+ <RegExpr attribute="Reserved" context="#stay" String="\*[V|v][A|a][R|r][S|s][I|i][Z|z][E|e]"/>
+ <RegExpr attribute="Reserved" context="#stay" String="\*[R|r][I|i][G|g][H|h][T|t][A|a][D|d][J|j]"/>
+ <RegExpr attribute="Reserved" context="#stay" String="\*[S|s][T|t][R|r][I|i][N|n][G|g]"/>
+ <RegExpr attribute="Reserved" context="#stay" String="\*[T|t][R|r][I|i][M|m]"/>
+ <DetectChar attribute="Biff" context="Biffs" char="%"/>
+ <IncludeRules context="CommonCode" />
+ </context>
+
+
+ </contexts>
+ <itemDatas>
+ <itemData name="Alert" defStyleNum="dsAlert" />
+ <itemData name="Normal Text" defStyleNum="dsNormal" />
+ <itemData name="Keyword" defStyleNum="dsKeyword" />
+ <itemData name="Biff" defStyleNum="dsKeyword" />
+ <itemData name="RegExpr" defStyleNum="dsBaseN" />
+ <itemData name="Symbol" defStyleNum="dsNormal"/>
+ <itemData name="Decimal" defStyleNum="dsDecVal" />
+ <itemData name="Float" defStyleNum="dsFloat"/>
+ <itemData name="Octal" defStyleNum="dsBaseN"/>
+ <itemData name="Hex" defStyleNum="dsBaseN"/>
+ <itemData name="Float" defStyleNum="dsFloat"/>
+ <itemData name="Base-N" defStyleNum="dsBaseN" />
+ <itemData name="Float" defStyleNum="dsFloat" />
+ <itemData name="Char" defStyleNum="dsChar" />
+ <itemData name="ConstantChar" defStyleNum="dsNormal" color="#DD0022" selColor="#000000" bold="0" italic="0"/>
+ <itemData name="Constant" defStyleNum="dsNormal" color="#CC2222" selColor="#000000" bold="0" italic="0"/>
+ <itemData name="Reserved" defStyleNum="dsNormal" color="#BB1133" selColor="#000000" bold="0" italic="0"/>
+ <itemData name="Indicator" defStyleNum="dsNormal" color="#CC0000" selColor="#000000" bold="0" italic="0"/>
+ <itemData name="Fill" defStyleNum="dsNormal" color="#FF6347" selColor="#000000" bold="0" italic="0"/>
+ <itemData name="Comment" defStyleNum="dsComment"/>
+ <itemData name="BoldComment" defStyleNum="dsNormal" color="#CD853F" selColor="#808080" bold="1" italic="1"/>
+ <itemData name="DivideComment" defStyleNum="dsComment" bold="1"/>
+ <itemData name="Directive" defStyleNum="dsOthers"/>
+ </itemDatas>
+ </highlighting>
+ <general>
+ <keywords casesensitive="0" />
+ </general>
+</language>
+
diff --git a/kate/data/inform.xml b/kate/data/inform.xml
new file mode 100644
index 000000000..306ed2015
--- /dev/null
+++ b/kate/data/inform.xml
@@ -0,0 +1,406 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+<!-- author: Giancarlo Niccolai (giancarlo@niccolai.ws) -->
+<!-- This file is released under GPL license 2.0 or any later version at your choice. -->
+<!-- $Id$ -->
+<language name="Inform" version="1.23" kateversion="2.3" section="Sources" extensions="*.inf;*.h" mimetype="text/x-inform-src" author="Giancarlo Niccolai (giancarlo@niccolai.ws)" license="GPL">
+<highlighting>
+ <list name="keywords">
+ <item> if </item>
+ <item> for </item>
+ <item> else </item>
+ <item> box </item>
+ <item> break </item>
+ <item> continue </item>
+ <item> do </item>
+ <item> until </item>
+ <item> font </item>
+ <item> give </item>
+ <item> inversion </item>
+ <item> jump </item>
+ <item> on </item>
+ <item> to </item>
+ <item> move </item>
+ <item> new_line </item>
+ <item> objectloop </item>
+ <item> print </item>
+ <item> print_ret </item>
+ <item> quit </item>
+ <item> read </item>
+ <item> remove </item>
+ <item> restore </item>
+ <item> return </item>
+ <item> rtrue </item>
+ <item> rfalse </item>
+ <item> save </item>
+ <item> spaces </item>
+ <item> spring </item>
+ <item> style </item>
+ <item> switch </item>
+ </list>
+
+ <list name="functions">
+ <item> metaclass </item>
+ <item> parent </item>
+ <item> child </item>
+ <item> children </item>
+ <item> Achieved </item>
+ <item> AddToScope </item>
+ <item> allowpushdir </item>
+ <item> CDefArt </item>
+ <item> ChangeDefault </item>
+ <item> DefArt </item>
+ <item> DoMenu </item>
+ <item> EnglishNumber </item>
+ <item> HasLightSource </item>
+ <item> InDefArt </item>
+ <item> Locale </item>
+ <item> LoopOverScope </item>
+ <item> NextWord </item>
+ <item> NextWordStopped </item>
+ <item> NounDomain </item>
+ <item> ObjectIsUntouchable </item>
+ <item> OffersLight </item>
+ <item> PlaceInScope </item>
+ <item> PlayerTo </item>
+ <item> PrintShortName </item>
+ <item> ScopeWithin </item>
+ <item> SetTime </item>
+ <item> StartDaemon </item>
+ <item> StartTimer </item>
+ <item> StopDaemon </item>
+ <item> StopTimer </item>
+ <item> TestScope </item>
+ <item> TryNumber </item>
+ <item> UnsignedCompare </item>
+ <item> WordAddress </item>
+ <item> WordLenght </item>
+ <item> WriteListFrom </item>
+ <item> YesOrNo </item>
+ <item> ZRegion </item>
+ </list>
+ <list name="actions">
+ <item> Pronouns </item>
+ <item> Quit </item>
+ <item> Restore </item>
+ <item> Save </item>
+ <item> Verify </item>
+ <item> Restart </item>
+ <item> ScriptOn </item>
+ <item> ScriptOff </item>
+ <item> NotifyOn </item>
+ <item> NotifyOff </item>
+ <item> Places </item>
+ <item> Objects </item>
+ <item> Score </item>
+ <item> FullScore </item>
+ <item> Version </item>
+ <item> LMode1 </item>
+ <item> LMode2 </item>
+ <item> LMode3 </item>
+ <item> Inv </item>
+
+
+ <item> Inv </item>
+ <item> InvTall </item>
+ <item> InvWide </item>
+ <item> Take </item>
+ <item> Drop </item>
+ <item> Empty </item>
+ <item> Enter </item>
+ <item> Exit </item>
+ <item> GetOff </item>
+ <item> Go </item>
+ <item> GoIn </item>
+ <item> Look </item>
+ <item> Examine </item>
+ <item> Search </item>
+ <item> Give </item>
+ <item> Show </item>
+ <item> Unlock </item>
+ <item> Lock </item>
+ <item> SwitchOn </item>
+ <item> SwitchOff </item>
+ <item> Open </item>
+ <item> Close </item>
+ <item> Disrobe </item>
+ <item> Wear </item>
+ <item> Eat </item>
+
+ <item> LetGo </item>
+ <item> Receive </item>
+ <item> Insert </item>
+ <item> PutOn </item>
+ <item> Transfer </item>
+ <item> Empty </item>
+ <item> EmptyT </item>
+ <item> GetOff </item>
+ <item> GoIn </item>
+ <item> Listen </item>
+ <item> Taste </item>
+ <item> Touch </item>
+
+ <item> Pull </item>
+ <item> Push </item>
+ <item> Wave </item>
+ <item> Turn </item>
+ <item> PushDir </item>
+ <item> ThrowAt </item>
+ <item> ThrownAt </item>
+ <item> JumpOn </item>
+ <item> Drink </item>
+ <item> Attack </item>
+ <item> Tie </item>
+ <item> Fill </item>
+ <item> Swing </item>
+ <item> Blow </item>
+ <item> Rub </item>
+ <item> Set </item>
+ <item> SetTo </item>
+ <item> Buy </item>
+ <item> Climb </item>
+ <item> Squeeze </item>
+ <item> Climb </item>
+ <item> Burn </item>
+ <item> Cut </item>
+ <item> Dig </item>
+
+ <item> Consult </item>
+ <item> Tell </item>
+ <item> Answer </item>
+ <item> Ask </item>
+ <item> AskFor </item>
+ <item> Kiss </item>
+
+ <item> Sleep </item>
+ <item> Sing </item>
+ <item> WaveHands </item>
+ <item> Swim </item>
+ <item> Sorry </item>
+ <item> Sing </item>
+ <item> Strong </item>
+ <item> Mild </item>
+ <item> Smell </item>
+ <item> Pray </item>
+ <item> Jump </item>
+ <item> Think </item>
+ <item> VagueGo </item>
+ <item> Yes </item>
+ <item> No </item>
+ <item> Sing </item>
+ </list>
+
+ <list name="special_vals" >
+ <item> String </item>
+ <item> Routine </item>
+ <item> bold </item>
+ <item> roman </item>
+ <item> underline </item>
+ <item> fixed </item>
+ <item> nothing </item>
+ <item> true </item>
+ <item> false </item>
+ <item> on </item>
+ <item> off </item>
+ <item> sender </item>
+ <item> self </item>
+ <item> location </item>
+ <item> score </item>
+ <item> action </item>
+ <item> actor </item>
+ <item> noun </item>
+ <item> second </item>
+ <item> the_time </item>
+ <item> consult_from </item>
+ <item> consult_words </item>
+ <item> wn </item>
+ <item> actors_location </item>
+ <item> buffer </item>
+ <item> player </item>
+ </list>
+
+ <list name="pragmas" >
+ <item> Ifdef </item>
+ <item> Ifndef </item>
+ <item> Iftrue </item>
+ <item> Iffalse </item>
+ <item> Ifnot </item>
+ <item> Endif </item>
+ <item> End </item>
+ <item> Abbreviate </item>
+ <item> Array </item>
+ <item> Attribute </item>
+ <item> Constant </item>
+ <item> Default </item>
+ <item> Extend </item>
+ <item> Global </item>
+ <item> Ifnot </item>
+ <item> Iftrue </item>
+ <item> Iffalse </item>
+ <item> Import </item>
+ <item> Include </item>
+ <item> Link </item>
+ <item> Lowstring </item>
+ <item> Message </item>
+ <item> Property </item>
+ <item> Release </item>
+ <item> Replace </item>
+ <item> Serial </item>
+ <item> Switches </item>
+ <item> Statusline </item>
+ <item> score </item>
+ <item> System_file </item>
+ <item> Verb </item>
+ </list>
+
+ <list name="inline_pragmas" >
+ <item> #ifdef </item>
+ <item> #else </item>
+ <item> #ifndef </item>
+ <item> #endif </item>
+ </list>
+
+ <list name="operators">
+ <item> has </item>
+ <item> hasn't </item>
+ <item> in </item>
+ <item> notin </item>
+ <item> provides </item>
+ <item> ofclass </item>
+ <item> or </item>
+ </list>
+
+ <list name="ClassDeclOps">
+ <item> with </item>
+ <item> private </item>
+ <item> has </item>
+ </list>
+
+ <contexts>
+ <context attribute="Normal Text" lineEndContext="#stay" name="TopLevel">
+ <DetectChar attribute="Comment" context="comment" char="!" />
+ <DetectChar attribute="String" context="string" char="&quot;" />
+ <RegExpr attribute="Function" context="funcdef" beginRegion="reg_function"
+ String="[[]\s*[a-zA-Z_]+\w*" />
+
+ <RegExpr String=" *object | *class " attribute="Pragma"
+ context="ClassDecl"
+ insensitive="TRUE" beginRegion="reg_class" column="0"/>
+
+ <keyword attribute="Pragma" context="#stay" String="pragmas" />
+ <keyword attribute="Pragma" context="#stay" String="inline_pragmas" />
+
+ <RegExpr attribute="Operator" context="#stay" String="--?>" />
+ <RegExpr attribute="Normal Text" context="#stay" String="[a-zA-Z_]+\d*" />
+ <RegExpr attribute="Number" context="#stay" String="\$[0-9a-fA-F]{1,4}" />
+ <RegExpr attribute="Number" context="#stay" String="\d+" />
+ </context>
+
+ <context name="Normal" attribute="Normal Text" lineEndContext="#stay">
+ <DetectChar attribute="Comment" context="comment" char="!" />
+ <DetectChar attribute="String" context="string" char="&quot;" />
+ <DetectChar attribute="Word" context="word" char="'" />
+ <keyword attribute="Pragma" context="#stay" String="inline_pragmas" />
+ <RegExpr attribute="Operator" context="#stay" String="--?>" />
+ <keyword attribute="Keyword" context="#stay" String="keywords" />
+ <keyword attribute="Actions" context="#stay" String="actions" />
+ <keyword attribute="PredefFunction" context="#stay" String="functions" />
+ <keyword attribute="Values" context="#stay" String="special_vals" />
+ <keyword attribute="Operator" context="#stay" String="operators" />
+ <RegExpr attribute="Actions" context="#stay" String="##[a-zA-Z_]+\w*" />
+ <RegExpr attribute="OpCode" context="#stay" String="@[a-zA-Z_]+\w*" />
+ <RegExpr attribute="Number" context="#stay" String="\$[0-9a-fA-F]{1,4}" />
+ <RegExpr String="[a-zA-Z_]+\w*" attribute="Normal Text" context="#stay" />
+ <RegExpr attribute="Number" context="#stay" String="\d+" />
+ <DetectChar char="{" attribute="Keyword" context="#stay"
+ beginRegion="reg_compound" />
+ <DetectChar char="}" attribute="Keyword" context="#stay"
+ endRegion="reg_compound" />
+ <AnyChar attribute="Operator" context="#stay" String="%&amp;()+-&lt;=&gt;{|}~"/>
+ </context>
+
+ <context attribute="Normal Text" lineEndContext="#stay" name="PropDefVal rules">
+ <DetectChar attribute="Comment" context="comment" char="!" />
+ <DetectChar attribute="String" context="string" char="&quot;" />
+ <DetectChar attribute="Word" context="word" char="'" />
+ <DetectChar attribute="Function" context="prop_func_def" char="[" beginRegion="reg_prop_def_func" />
+ <DetectChar attribute="Operator" context="#pop" char="," />
+ <RegExpr attribute="Number" context="#stay" String="\$[0-9a-fA-F]{1,4}" />
+ <RegExpr attribute="Number" context="#stay" String="\d+" />
+ </context>
+
+
+ <context name="funcdef" attribute="Normal Text" lineEndContext="#stay" >
+ <IncludeRules context="Normal" />
+ <Detect2Chars attribute="Function" context="#pop" char="]" char1=";"
+ endRegion="reg_function"/>
+ </context>
+
+ <context name="ClassDecl" attribute="Normal Text" lineEndContext="ClassDecl_1">
+ <IncludeRules context="PropDefVal rules" />
+ </context>
+
+ <context name="ClassDecl_1" attribute="Normal Text" lineEndContext="#stay">
+ <RegExpr String="^[\t ]*has " attribute="Keyword" context="has_decl" insensitive="TRUE"/>
+ <keyword String="ClassDeclOps" attribute="Keyword" context="#stay" />
+ <RegExpr String="[a-zA-Z_]+\w*" context = "prop_def"
+ attribute="Function"/>
+ <DetectChar char=";" context="#pop" attribute="Pragma" endRegion="reg_class"/>
+ </context>
+
+
+ <context attribute="Word" lineEndContext="#pop" name="word">
+ <DetectChar attribute="Word" context="#pop" char="'" />
+ </context>
+
+ <context attribute="String" lineEndContext="#stay" name="string">
+ <DetectChar attribute="String" context="#pop" char="&quot;" />
+ </context>
+
+ <context name="prop_func_def" attribute="Normal Text" lineEndContext="#stay">
+ <DetectChar context="#pop" char="]" attribute="Function"
+ endRegion="reg_prop_func"/>
+ <IncludeRules context="Normal" />
+ </context>
+
+ <context name="prop_def" attribute="Normal Text" lineEndContext="#stay" >
+ <DetectChar char="," context="#pop" attribute="Function"
+ endRegion="reg_prop"/>
+ <DetectChar char=";" context="#pop#pop#pop" attribute="Pragma" endRegion="reg_class"/>
+ <DetectChar char="[" context="prop_func_def" attribute="Function"
+ beginRegion="reg_prop_func"/>
+ <IncludeRules context="PropDefVal rules" />
+ </context>
+
+ <context name="has_decl" attribute="Normal Text" lineEndContext="#stay" >
+ <DetectChar char=";" context="#pop#pop#pop" attribute="Pragma" endRegion="reg_class"/>
+ <IncludeRules context="PropDefVal rules" />
+ </context>
+
+ <context attribute="Comment" lineEndContext="#pop" name="comment"/>
+
+ </contexts>
+
+ <itemDatas>
+ <itemData name="Normal Text" defStyleNum="dsNormal"/>
+ <itemData name="Keyword" defStyleNum="dsKeyword"/>
+ <itemData name="Actions" defStyleNum="dsDataType" color="#E06060" selColor="#400000" bold="0" italic="0"/>
+ <itemData name="Operator" defStyleNum="dsBaseN" color="#A01060" selColor="#400040" bold="0" italic="0"/>
+ <itemData name="Number" defStyleNum="dsDecVal" color="#5050C0" selColor="#000000" bold="0" italic="0"/>
+ <itemData name="OpCode" defStyleNum="dsDecVal" color="#3015F0" selColor="#000000" bold="1" italic="0"/>
+ <itemData name="Values" defStyleNum="dsBaseN" color="#7020F0" selColor="#400000" bold="1" italic="0" />
+ <itemData name="Pragma" defStyleNum="dsOthers" color="#109010" selColor="#400000" bold="1" italic="0" />
+ <itemData name="PredefFunction" defStyleNum="dsFunction" />
+ <itemData name="Function" defStyleNum="dsFunction" />
+ <itemData name="Comment" defStyleNum="dsComment" color="#707070" selColor="#ffffff" bold="0" italic="1"/>
+ <itemData name="String" defStyleNum="dsString" color="#007000" selColor="#007000" bold="0" italic="0"/>
+ <itemData name="Word" defStyleNum="dsString" color="#007000" selColor="#007000" bold="0" italic="1"/>
+ </itemDatas>
+</highlighting>
+<general>
+ <comments>
+ <comment name="singleLine" start="!" />
+ </comments>
+ <keywords casesensitive="1" />
+</general>
+</language>
diff --git a/kate/data/ini.xml b/kate/data/ini.xml
new file mode 100644
index 000000000..af0808f8c
--- /dev/null
+++ b/kate/data/ini.xml
@@ -0,0 +1,80 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+<language name="INI Files" section="Configuration" extensions="*.ini;*.pls" mimetype="" version="1.0" author="Jan Janssen (medhefgo@web.de)" license="LGPL">
+
+<highlighting>
+<list name="keywords">
+<item>On</item>
+<item>Off</item>
+<item>Default</item>
+<item>Defaults</item>
+<item>Localhost</item>
+<item>Null</item>
+<item>True</item>
+<item>False</item>
+<item>Yes</item>
+<item>No</item>
+<item>Normal</item>
+
+<!-- PHP Keywords -->
+<item>E_ALL</item>
+<item>E_ERROR</item>
+<item>E_WARNING</item>
+<item>E_PARSE</item>
+<item>E_NOTICE</item>
+<item>E_STRICT</item>
+<item>E_CORE_ERROR</item>
+<item>E_CORE_WARNING</item>
+<item>E_COMPILE_ERROR</item>
+<item>E_COMPILE_WARNING</item>
+<item>E_USER_ERROR</item>
+<item>E_USER_WARNING</item>
+<item>E_USER_NOTICE</item>
+</list>
+
+<contexts>
+ <context name="ini" attribute="Normal Text" lineEndContext="#stay">
+ <RangeDetect attribute="Section" context="#pop" char="[" char1="]" beginRegion="Section" endRegion="Section" />
+ <DetectChar attribute="Assignment" context="Value" char="=" />
+ <DetectChar char=";" attribute="Comment" context="Comment" firstNonSpace="true" />
+ <DetectChar char="#" attribute="Comment" context="Comment" firstNonSpace="true" />
+ </context>
+
+ <context name="Value" attribute="Value" lineEndContext="#pop" >
+ <Float attribute="Float" />
+ <Int attribute="Int" />
+ <keyword attribute="Keyword" String="keywords" />
+ <RegExpr attribute="Comment" context="#pop" String=";.*$" />
+ <RegExpr attribute="Comment" context="#pop" String="#.*$" />
+ </context>
+
+ <context name="Comment" attribute="Comment" lineEndContext="#pop">
+ <DetectSpaces />
+ <IncludeRules context="##Alerts" />
+ <DetectIdentifier />
+ </context>
+</contexts>
+
+
+<itemDatas>
+ <itemData name="Normal Text" defStyleNum="dsDataType" />
+ <itemData name="Section" defStyleNum="dsKeyword" />
+ <itemData name="Comment" defStyleNum="dsComment" />
+ <itemData name="Assignment" defStyleNum="dsOthers" />
+ <itemData name="Value" defStyleNum="dsString" />
+ <itemData name="Float" defStyleNum="dsFloat" />
+ <itemData name="Int" defStyleNum="dsDecVal" />
+ <itemData name="Keyword" defStyleNum="dsKeyword" />
+</itemDatas>
+</highlighting>
+
+
+<general>
+ <comments>
+ <comment name="singleLine" start="#" />
+ <comment name="singleLine" start=";" />
+ </comments>
+ <keywords casesensitive="0" />
+</general>
+
+</language>
diff --git a/kate/data/java.xml b/kate/data/java.xml
new file mode 100644
index 000000000..4a8ed39f7
--- /dev/null
+++ b/kate/data/java.xml
@@ -0,0 +1,3428 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+<language name="Java" version="1.16" kateversion="2.4" section="Sources" extensions="*.java" mimetype="text/x-java" license="LGPL" author="Alfredo Luiz Foltran Fialho (alfoltran@ig.com.br)">
+ <highlighting>
+ <list name="java15">
+ <item> ACTIVE </item>
+ <item> ACTIVITY_COMPLETED </item>
+ <item> ACTIVITY_REQUIRED </item>
+ <item> ARG_IN </item>
+ <item> ARG_INOUT </item>
+ <item> ARG_OUT </item>
+ <item> AWTError </item>
+ <item> AWTEvent </item>
+ <item> AWTEventListener </item>
+ <item> AWTEventListenerProxy </item>
+ <item> AWTEventMulticaster </item>
+ <item> AWTException </item>
+ <item> AWTKeyStroke </item>
+ <item> AWTPermission </item>
+ <item> AbstractAction </item>
+ <item> AbstractBorder </item>
+ <item> AbstractButton </item>
+ <item> AbstractCellEditor </item>
+ <item> AbstractCollection </item>
+ <item> AbstractColorChooserPanel </item>
+ <item> AbstractDocument </item>
+ <item> AbstractDocument.AttributeContext </item>
+ <item> AbstractDocument.Content </item>
+ <item> AbstractDocument.ElementEdit </item>
+ <item> AbstractExecutorService </item>
+ <item> AbstractInterruptibleChannel </item>
+ <item> AbstractLayoutCache </item>
+ <item> AbstractLayoutCache.NodeDimensions </item>
+ <item> AbstractList </item>
+ <item> AbstractListModel </item>
+ <item> AbstractMap </item>
+ <item> AbstractMethodError </item>
+ <item> AbstractPreferences </item>
+ <item> AbstractQueue </item>
+ <item> AbstractQueuedSynchronizer </item>
+ <item> AbstractSelectableChannel </item>
+ <item> AbstractSelectionKey </item>
+ <item> AbstractSelector </item>
+ <item> AbstractSequentialList </item>
+ <item> AbstractSet </item>
+ <item> AbstractSpinnerModel </item>
+ <item> AbstractTableModel </item>
+ <item> AbstractUndoableEdit </item>
+ <item> AbstractWriter </item>
+ <item> AccessControlContext </item>
+ <item> AccessControlException </item>
+ <item> AccessController </item>
+ <item> AccessException </item>
+ <item> Accessible </item>
+ <item> AccessibleAction </item>
+ <item> AccessibleAttributeSequence </item>
+ <item> AccessibleBundle </item>
+ <item> AccessibleComponent </item>
+ <item> AccessibleContext </item>
+ <item> AccessibleEditableText </item>
+ <item> AccessibleExtendedComponent </item>
+ <item> AccessibleExtendedTable </item>
+ <item> AccessibleExtendedText </item>
+ <item> AccessibleHyperlink </item>
+ <item> AccessibleHypertext </item>
+ <item> AccessibleIcon </item>
+ <item> AccessibleKeyBinding </item>
+ <item> AccessibleObject </item>
+ <item> AccessibleRelation </item>
+ <item> AccessibleRelationSet </item>
+ <item> AccessibleResourceBundle </item>
+ <item> AccessibleRole </item>
+ <item> AccessibleSelection </item>
+ <item> AccessibleState </item>
+ <item> AccessibleStateSet </item>
+ <item> AccessibleStreamable </item>
+ <item> AccessibleTable </item>
+ <item> AccessibleTableModelChange </item>
+ <item> AccessibleText </item>
+ <item> AccessibleTextSequence </item>
+ <item> AccessibleValue </item>
+ <item> AccountException </item>
+ <item> AccountExpiredException </item>
+ <item> AccountLockedException </item>
+ <item> AccountNotFoundException </item>
+ <item> Acl </item>
+ <item> AclEntry </item>
+ <item> AclNotFoundException </item>
+ <item> Action </item>
+ <item> ActionEvent </item>
+ <item> ActionListener </item>
+ <item> ActionMap </item>
+ <item> ActionMapUIResource </item>
+ <item> Activatable </item>
+ <item> ActivateFailedException </item>
+ <item> ActivationDesc </item>
+ <item> ActivationException </item>
+ <item> ActivationGroup </item>
+ <item> ActivationGroupDesc </item>
+ <item> ActivationGroupDesc.CommandEnvironment </item>
+ <item> ActivationGroupID </item>
+ <item> ActivationGroup_Stub </item>
+ <item> ActivationID </item>
+ <item> ActivationInstantiator </item>
+ <item> ActivationMonitor </item>
+ <item> ActivationSystem </item>
+ <item> Activator </item>
+ <item> ActiveEvent </item>
+ <item> ActivityCompletedException </item>
+ <item> ActivityRequiredException </item>
+ <item> AdapterActivator </item>
+ <item> AdapterActivatorOperations </item>
+ <item> AdapterAlreadyExists </item>
+ <item> AdapterAlreadyExistsHelper </item>
+ <item> AdapterInactive </item>
+ <item> AdapterInactiveHelper </item>
+ <item> AdapterManagerIdHelper </item>
+ <item> AdapterNameHelper </item>
+ <item> AdapterNonExistent </item>
+ <item> AdapterNonExistentHelper </item>
+ <item> AdapterStateHelper </item>
+ <item> AddressHelper </item>
+ <item> Adjustable </item>
+ <item> AdjustmentEvent </item>
+ <item> AdjustmentListener </item>
+ <item> Adler32 </item>
+ <item> AffineTransform </item>
+ <item> AffineTransformOp </item>
+ <item> AlgorithmParameterGenerator </item>
+ <item> AlgorithmParameterGeneratorSpi </item>
+ <item> AlgorithmParameterSpec </item>
+ <item> AlgorithmParameters </item>
+ <item> AlgorithmParametersSpi </item>
+ <item> AllPermission </item>
+ <item> AlphaComposite </item>
+ <item> AlreadyBound </item>
+ <item> AlreadyBoundException </item>
+ <item> AlreadyBoundHelper </item>
+ <item> AlreadyBoundHolder </item>
+ <item> AlreadyConnectedException </item>
+ <item> AncestorEvent </item>
+ <item> AncestorListener </item>
+ <item> AnnotatedElement </item>
+ <item> Annotation </item>
+ <item> Annotation </item>
+ <item> AnnotationFormatError </item>
+ <item> AnnotationTypeMismatchException </item>
+ <item> Any </item>
+ <item> AnyHolder </item>
+ <item> AnySeqHelper </item>
+ <item> AnySeqHelper </item>
+ <item> AnySeqHolder </item>
+ <item> AppConfigurationEntry </item>
+ <item> AppConfigurationEntry.LoginModuleControlFlag </item>
+ <item> Appendable </item>
+ <item> Applet </item>
+ <item> AppletContext </item>
+ <item> AppletInitializer </item>
+ <item> AppletStub </item>
+ <item> ApplicationException </item>
+ <item> Arc2D </item>
+ <item> Arc2D.Double </item>
+ <item> Arc2D.Float </item>
+ <item> Area </item>
+ <item> AreaAveragingScaleFilter </item>
+ <item> ArithmeticException </item>
+ <item> Array </item>
+ <item> Array </item>
+ <item> ArrayBlockingQueue </item>
+ <item> ArrayIndexOutOfBoundsException </item>
+ <item> ArrayList </item>
+ <item> ArrayStoreException </item>
+ <item> ArrayType </item>
+ <item> Arrays </item>
+ <item> AssertionError </item>
+ <item> AsyncBoxView </item>
+ <item> AsynchronousCloseException </item>
+ <item> AtomicBoolean </item>
+ <item> AtomicInteger </item>
+ <item> AtomicIntegerArray </item>
+ <item> AtomicIntegerFieldUpdater </item>
+ <item> AtomicLong </item>
+ <item> AtomicLongArray </item>
+ <item> AtomicLongFieldUpdater </item>
+ <item> AtomicMarkableReference </item>
+ <item> AtomicReference </item>
+ <item> AtomicReferenceArray </item>
+ <item> AtomicReferenceFieldUpdater </item>
+ <item> AtomicStampedReference </item>
+ <item> Attr </item>
+ <item> Attribute </item>
+ <item> Attribute </item>
+ <item> Attribute </item>
+ <item> AttributeChangeNotification </item>
+ <item> AttributeChangeNotificationFilter </item>
+ <item> AttributeException </item>
+ <item> AttributeInUseException </item>
+ <item> AttributeList </item>
+ <item> AttributeList </item>
+ <item> AttributeList </item>
+ <item> AttributeListImpl </item>
+ <item> AttributeModificationException </item>
+ <item> AttributeNotFoundException </item>
+ <item> AttributeSet </item>
+ <item> AttributeSet </item>
+ <item> AttributeSet.CharacterAttribute </item>
+ <item> AttributeSet.ColorAttribute </item>
+ <item> AttributeSet.FontAttribute </item>
+ <item> AttributeSet.ParagraphAttribute </item>
+ <item> AttributeSetUtilities </item>
+ <item> AttributeValueExp </item>
+ <item> AttributedCharacterIterator </item>
+ <item> AttributedCharacterIterator.Attribute </item>
+ <item> AttributedString </item>
+ <item> Attributes </item>
+ <item> Attributes </item>
+ <item> Attributes </item>
+ <item> Attributes.Name </item>
+ <item> Attributes2 </item>
+ <item> Attributes2Impl </item>
+ <item> AttributesImpl </item>
+ <item> AudioClip </item>
+ <item> AudioFileFormat </item>
+ <item> AudioFileFormat.Type </item>
+ <item> AudioFileReader </item>
+ <item> AudioFileWriter </item>
+ <item> AudioFormat </item>
+ <item> AudioFormat.Encoding </item>
+ <item> AudioInputStream </item>
+ <item> AudioPermission </item>
+ <item> AudioSystem </item>
+ <item> AuthPermission </item>
+ <item> AuthProvider </item>
+ <item> AuthenticationException </item>
+ <item> AuthenticationException </item>
+ <item> AuthenticationNotSupportedException </item>
+ <item> Authenticator </item>
+ <item> Authenticator.RequestorType </item>
+ <item> AuthorizeCallback </item>
+ <item> Autoscroll </item>
+ <item> BAD_CONTEXT </item>
+ <item> BAD_INV_ORDER </item>
+ <item> BAD_OPERATION </item>
+ <item> BAD_PARAM </item>
+ <item> BAD_POLICY </item>
+ <item> BAD_POLICY_TYPE </item>
+ <item> BAD_POLICY_VALUE </item>
+ <item> BAD_QOS </item>
+ <item> BAD_TYPECODE </item>
+ <item> BMPImageWriteParam </item>
+ <item> BackingStoreException </item>
+ <item> BadAttributeValueExpException </item>
+ <item> BadBinaryOpValueExpException </item>
+ <item> BadKind </item>
+ <item> BadLocationException </item>
+ <item> BadPaddingException </item>
+ <item> BadStringOperationException </item>
+ <item> BandCombineOp </item>
+ <item> BandedSampleModel </item>
+ <item> BaseRowSet </item>
+ <item> BasicArrowButton </item>
+ <item> BasicAttribute </item>
+ <item> BasicAttributes </item>
+ <item> BasicBorders </item>
+ <item> BasicBorders.ButtonBorder </item>
+ <item> BasicBorders.FieldBorder </item>
+ <item> BasicBorders.MarginBorder </item>
+ <item> BasicBorders.MenuBarBorder </item>
+ <item> BasicBorders.RadioButtonBorder </item>
+ <item> BasicBorders.RolloverButtonBorder </item>
+ <item> BasicBorders.SplitPaneBorder </item>
+ <item> BasicBorders.ToggleButtonBorder </item>
+ <item> BasicButtonListener </item>
+ <item> BasicButtonUI </item>
+ <item> BasicCheckBoxMenuItemUI </item>
+ <item> BasicCheckBoxUI </item>
+ <item> BasicColorChooserUI </item>
+ <item> BasicComboBoxEditor </item>
+ <item> BasicComboBoxEditor.UIResource </item>
+ <item> BasicComboBoxRenderer </item>
+ <item> BasicComboBoxRenderer.UIResource </item>
+ <item> BasicComboBoxUI </item>
+ <item> BasicComboPopup </item>
+ <item> BasicControl </item>
+ <item> BasicDesktopIconUI </item>
+ <item> BasicDesktopPaneUI </item>
+ <item> BasicDirectoryModel </item>
+ <item> BasicEditorPaneUI </item>
+ <item> BasicFileChooserUI </item>
+ <item> BasicFormattedTextFieldUI </item>
+ <item> BasicGraphicsUtils </item>
+ <item> BasicHTML </item>
+ <item> BasicIconFactory </item>
+ <item> BasicInternalFrameTitlePane </item>
+ <item> BasicInternalFrameUI </item>
+ <item> BasicLabelUI </item>
+ <item> BasicListUI </item>
+ <item> BasicLookAndFeel </item>
+ <item> BasicMenuBarUI </item>
+ <item> BasicMenuItemUI </item>
+ <item> BasicMenuUI </item>
+ <item> BasicOptionPaneUI </item>
+ <item> BasicOptionPaneUI.ButtonAreaLayout </item>
+ <item> BasicPanelUI </item>
+ <item> BasicPasswordFieldUI </item>
+ <item> BasicPermission </item>
+ <item> BasicPopupMenuSeparatorUI </item>
+ <item> BasicPopupMenuUI </item>
+ <item> BasicProgressBarUI </item>
+ <item> BasicRadioButtonMenuItemUI </item>
+ <item> BasicRadioButtonUI </item>
+ <item> BasicRootPaneUI </item>
+ <item> BasicScrollBarUI </item>
+ <item> BasicScrollPaneUI </item>
+ <item> BasicSeparatorUI </item>
+ <item> BasicSliderUI </item>
+ <item> BasicSpinnerUI </item>
+ <item> BasicSplitPaneDivider </item>
+ <item> BasicSplitPaneUI </item>
+ <item> BasicStroke </item>
+ <item> BasicTabbedPaneUI </item>
+ <item> BasicTableHeaderUI </item>
+ <item> BasicTableUI </item>
+ <item> BasicTextAreaUI </item>
+ <item> BasicTextFieldUI </item>
+ <item> BasicTextPaneUI </item>
+ <item> BasicTextUI </item>
+ <item> BasicTextUI.BasicCaret </item>
+ <item> BasicTextUI.BasicHighlighter </item>
+ <item> BasicToggleButtonUI </item>
+ <item> BasicToolBarSeparatorUI </item>
+ <item> BasicToolBarUI </item>
+ <item> BasicToolTipUI </item>
+ <item> BasicTreeUI </item>
+ <item> BasicViewportUI </item>
+ <item> BatchUpdateException </item>
+ <item> BeanContext </item>
+ <item> BeanContextChild </item>
+ <item> BeanContextChildComponentProxy </item>
+ <item> BeanContextChildSupport </item>
+ <item> BeanContextContainerProxy </item>
+ <item> BeanContextEvent </item>
+ <item> BeanContextMembershipEvent </item>
+ <item> BeanContextMembershipListener </item>
+ <item> BeanContextProxy </item>
+ <item> BeanContextServiceAvailableEvent </item>
+ <item> BeanContextServiceProvider </item>
+ <item> BeanContextServiceProviderBeanInfo </item>
+ <item> BeanContextServiceRevokedEvent </item>
+ <item> BeanContextServiceRevokedListener </item>
+ <item> BeanContextServices </item>
+ <item> BeanContextServicesListener </item>
+ <item> BeanContextServicesSupport </item>
+ <item> BeanContextServicesSupport.BCSSServiceProvider </item>
+ <item> BeanContextSupport </item>
+ <item> BeanContextSupport.BCSIterator </item>
+ <item> BeanDescriptor </item>
+ <item> BeanInfo </item>
+ <item> Beans </item>
+ <item> BevelBorder </item>
+ <item> Bidi </item>
+ <item> BigDecimal </item>
+ <item> BigInteger </item>
+ <item> BinaryRefAddr </item>
+ <item> BindException </item>
+ <item> Binding </item>
+ <item> Binding </item>
+ <item> BindingHelper </item>
+ <item> BindingHolder </item>
+ <item> BindingIterator </item>
+ <item> BindingIteratorHelper </item>
+ <item> BindingIteratorHolder </item>
+ <item> BindingIteratorOperations </item>
+ <item> BindingIteratorPOA </item>
+ <item> BindingListHelper </item>
+ <item> BindingListHolder </item>
+ <item> BindingType </item>
+ <item> BindingTypeHelper </item>
+ <item> BindingTypeHolder </item>
+ <item> BitSet </item>
+ <item> Blob </item>
+ <item> BlockView </item>
+ <item> BlockingQueue </item>
+ <item> Book </item>
+ <item> Boolean </item>
+ <item> BooleanControl </item>
+ <item> BooleanControl.Type </item>
+ <item> BooleanHolder </item>
+ <item> BooleanSeqHelper </item>
+ <item> BooleanSeqHolder </item>
+ <item> Border </item>
+ <item> BorderFactory </item>
+ <item> BorderLayout </item>
+ <item> BorderUIResource </item>
+ <item> BorderUIResource.BevelBorderUIResource </item>
+ <item> BorderUIResource.CompoundBorderUIResource </item>
+ <item> BorderUIResource.EmptyBorderUIResource </item>
+ <item> BorderUIResource.EtchedBorderUIResource </item>
+ <item> BorderUIResource.LineBorderUIResource </item>
+ <item> BorderUIResource.MatteBorderUIResource </item>
+ <item> BorderUIResource.TitledBorderUIResource </item>
+ <item> BoundedRangeModel </item>
+ <item> Bounds </item>
+ <item> Bounds </item>
+ <item> Box </item>
+ <item> Box.Filler </item>
+ <item> BoxLayout </item>
+ <item> BoxView </item>
+ <item> BoxedValueHelper </item>
+ <item> BreakIterator </item>
+ <item> BrokenBarrierException </item>
+ <item> Buffer </item>
+ <item> BufferCapabilities </item>
+ <item> BufferCapabilities.FlipContents </item>
+ <item> BufferOverflowException </item>
+ <item> BufferStrategy </item>
+ <item> BufferUnderflowException </item>
+ <item> BufferedImage </item>
+ <item> BufferedImageFilter </item>
+ <item> BufferedImageOp </item>
+ <item> BufferedInputStream </item>
+ <item> BufferedOutputStream </item>
+ <item> BufferedReader </item>
+ <item> BufferedWriter </item>
+ <item> Button </item>
+ <item> ButtonGroup </item>
+ <item> ButtonModel </item>
+ <item> ButtonUI </item>
+ <item> Byte </item>
+ <item> ByteArrayInputStream </item>
+ <item> ByteArrayOutputStream </item>
+ <item> ByteBuffer </item>
+ <item> ByteChannel </item>
+ <item> ByteHolder </item>
+ <item> ByteLookupTable </item>
+ <item> ByteOrder </item>
+ <item> CDATASection </item>
+ <item> CMMException </item>
+ <item> CODESET_INCOMPATIBLE </item>
+ <item> COMM_FAILURE </item>
+ <item> CRC32 </item>
+ <item> CRL </item>
+ <item> CRLException </item>
+ <item> CRLSelector </item>
+ <item> CSS </item>
+ <item> CSS.Attribute </item>
+ <item> CTX_RESTRICT_SCOPE </item>
+ <item> CacheRequest </item>
+ <item> CacheResponse </item>
+ <item> CachedRowSet </item>
+ <item> Calendar </item>
+ <item> Callable </item>
+ <item> CallableStatement </item>
+ <item> Callback </item>
+ <item> CallbackHandler </item>
+ <item> CancelablePrintJob </item>
+ <item> CancellationException </item>
+ <item> CancelledKeyException </item>
+ <item> CannotProceed </item>
+ <item> CannotProceedException </item>
+ <item> CannotProceedHelper </item>
+ <item> CannotProceedHolder </item>
+ <item> CannotRedoException </item>
+ <item> CannotUndoException </item>
+ <item> Canvas </item>
+ <item> CardLayout </item>
+ <item> Caret </item>
+ <item> CaretEvent </item>
+ <item> CaretListener </item>
+ <item> CellEditor </item>
+ <item> CellEditorListener </item>
+ <item> CellRendererPane </item>
+ <item> CertPath </item>
+ <item> CertPath.CertPathRep </item>
+ <item> CertPathBuilder </item>
+ <item> CertPathBuilderException </item>
+ <item> CertPathBuilderResult </item>
+ <item> CertPathBuilderSpi </item>
+ <item> CertPathParameters </item>
+ <item> CertPathTrustManagerParameters </item>
+ <item> CertPathValidator </item>
+ <item> CertPathValidatorException </item>
+ <item> CertPathValidatorResult </item>
+ <item> CertPathValidatorSpi </item>
+ <item> CertSelector </item>
+ <item> CertStore </item>
+ <item> CertStoreException </item>
+ <item> CertStoreParameters </item>
+ <item> CertStoreSpi </item>
+ <item> Certificate </item>
+ <item> Certificate </item>
+ <item> Certificate </item>
+ <item> Certificate.CertificateRep </item>
+ <item> CertificateEncodingException </item>
+ <item> CertificateEncodingException </item>
+ <item> CertificateException </item>
+ <item> CertificateException </item>
+ <item> CertificateExpiredException </item>
+ <item> CertificateExpiredException </item>
+ <item> CertificateFactory </item>
+ <item> CertificateFactorySpi </item>
+ <item> CertificateNotYetValidException </item>
+ <item> CertificateNotYetValidException </item>
+ <item> CertificateParsingException </item>
+ <item> CertificateParsingException </item>
+ <item> ChangeEvent </item>
+ <item> ChangeListener </item>
+ <item> ChangedCharSetException </item>
+ <item> Channel </item>
+ <item> ChannelBinding </item>
+ <item> Channels </item>
+ <item> CharArrayReader </item>
+ <item> CharArrayWriter </item>
+ <item> CharBuffer </item>
+ <item> CharConversionException </item>
+ <item> CharHolder </item>
+ <item> CharSeqHelper </item>
+ <item> CharSeqHolder </item>
+ <item> CharSequence </item>
+ <item> Character </item>
+ <item> Character.Subset </item>
+ <item> Character.UnicodeBlock </item>
+ <item> CharacterCodingException </item>
+ <item> CharacterData </item>
+ <item> CharacterIterator </item>
+ <item> Charset </item>
+ <item> CharsetDecoder </item>
+ <item> CharsetEncoder </item>
+ <item> CharsetProvider </item>
+ <item> Checkbox </item>
+ <item> CheckboxGroup </item>
+ <item> CheckboxMenuItem </item>
+ <item> CheckedInputStream </item>
+ <item> CheckedOutputStream </item>
+ <item> Checksum </item>
+ <item> Choice </item>
+ <item> ChoiceCallback </item>
+ <item> ChoiceFormat </item>
+ <item> Chromaticity </item>
+ <item> Cipher </item>
+ <item> CipherInputStream </item>
+ <item> CipherOutputStream </item>
+ <item> CipherSpi </item>
+ <item> Class </item>
+ <item> ClassCastException </item>
+ <item> ClassCircularityError </item>
+ <item> ClassDefinition </item>
+ <item> ClassDesc </item>
+ <item> ClassFileTransformer </item>
+ <item> ClassFormatError </item>
+ <item> ClassLoader </item>
+ <item> ClassLoaderRepository </item>
+ <item> ClassLoadingMXBean </item>
+ <item> ClassNotFoundException </item>
+ <item> ClientRequestInfo </item>
+ <item> ClientRequestInfoOperations </item>
+ <item> ClientRequestInterceptor </item>
+ <item> ClientRequestInterceptorOperations </item>
+ <item> Clip </item>
+ <item> Clipboard </item>
+ <item> ClipboardOwner </item>
+ <item> Clob </item>
+ <item> CloneNotSupportedException </item>
+ <item> Cloneable </item>
+ <item> Closeable </item>
+ <item> ClosedByInterruptException </item>
+ <item> ClosedChannelException </item>
+ <item> ClosedSelectorException </item>
+ <item> CodeSets </item>
+ <item> CodeSigner </item>
+ <item> CodeSource </item>
+ <item> Codec </item>
+ <item> CodecFactory </item>
+ <item> CodecFactoryHelper </item>
+ <item> CodecFactoryOperations </item>
+ <item> CodecOperations </item>
+ <item> CoderMalfunctionError </item>
+ <item> CoderResult </item>
+ <item> CodingErrorAction </item>
+ <item> CollationElementIterator </item>
+ <item> CollationKey </item>
+ <item> Collator </item>
+ <item> Collection </item>
+ <item> CollectionCertStoreParameters </item>
+ <item> Collections </item>
+ <item> Color </item>
+ <item> ColorChooserComponentFactory </item>
+ <item> ColorChooserUI </item>
+ <item> ColorConvertOp </item>
+ <item> ColorModel </item>
+ <item> ColorSelectionModel </item>
+ <item> ColorSpace </item>
+ <item> ColorSupported </item>
+ <item> ColorType </item>
+ <item> ColorUIResource </item>
+ <item> ComboBoxEditor </item>
+ <item> ComboBoxModel </item>
+ <item> ComboBoxUI </item>
+ <item> ComboPopup </item>
+ <item> Comment </item>
+ <item> CommunicationException </item>
+ <item> Comparable </item>
+ <item> Comparator </item>
+ <item> CompilationMXBean </item>
+ <item> Compiler </item>
+ <item> CompletionService </item>
+ <item> CompletionStatus </item>
+ <item> CompletionStatusHelper </item>
+ <item> Component </item>
+ <item> ComponentAdapter </item>
+ <item> ComponentColorModel </item>
+ <item> ComponentEvent </item>
+ <item> ComponentIdHelper </item>
+ <item> ComponentInputMap </item>
+ <item> ComponentInputMapUIResource </item>
+ <item> ComponentListener </item>
+ <item> ComponentOrientation </item>
+ <item> ComponentSampleModel </item>
+ <item> ComponentUI </item>
+ <item> ComponentView </item>
+ <item> Composite </item>
+ <item> CompositeContext </item>
+ <item> CompositeData </item>
+ <item> CompositeDataSupport </item>
+ <item> CompositeName </item>
+ <item> CompositeType </item>
+ <item> CompositeView </item>
+ <item> CompoundBorder </item>
+ <item> CompoundControl </item>
+ <item> CompoundControl.Type </item>
+ <item> CompoundEdit </item>
+ <item> CompoundName </item>
+ <item> Compression </item>
+ <item> ConcurrentHashMap </item>
+ <item> ConcurrentLinkedQueue </item>
+ <item> ConcurrentMap </item>
+ <item> ConcurrentModificationException </item>
+ <item> Condition </item>
+ <item> Configuration </item>
+ <item> ConfigurationException </item>
+ <item> ConfirmationCallback </item>
+ <item> ConnectException </item>
+ <item> ConnectException </item>
+ <item> ConnectIOException </item>
+ <item> Connection </item>
+ <item> ConnectionEvent </item>
+ <item> ConnectionEventListener </item>
+ <item> ConnectionPendingException </item>
+ <item> ConnectionPoolDataSource </item>
+ <item> ConsoleHandler </item>
+ <item> Constructor </item>
+ <item> Container </item>
+ <item> ContainerAdapter </item>
+ <item> ContainerEvent </item>
+ <item> ContainerListener </item>
+ <item> ContainerOrderFocusTraversalPolicy </item>
+ <item> ContentHandler </item>
+ <item> ContentHandler </item>
+ <item> ContentHandlerFactory </item>
+ <item> ContentModel </item>
+ <item> Context </item>
+ <item> Context </item>
+ <item> ContextList </item>
+ <item> ContextNotEmptyException </item>
+ <item> ContextualRenderedImageFactory </item>
+ <item> Control </item>
+ <item> Control </item>
+ <item> Control.Type </item>
+ <item> ControlFactory </item>
+ <item> ControllerEventListener </item>
+ <item> ConvolveOp </item>
+ <item> CookieHandler </item>
+ <item> CookieHolder </item>
+ <item> Copies </item>
+ <item> CopiesSupported </item>
+ <item> CopyOnWriteArrayList </item>
+ <item> CopyOnWriteArraySet </item>
+ <item> CountDownLatch </item>
+ <item> CounterMonitor </item>
+ <item> CounterMonitorMBean </item>
+ <item> CredentialException </item>
+ <item> CredentialExpiredException </item>
+ <item> CredentialNotFoundException </item>
+ <item> CropImageFilter </item>
+ <item> CubicCurve2D </item>
+ <item> CubicCurve2D.Double </item>
+ <item> CubicCurve2D.Float </item>
+ <item> Currency </item>
+ <item> Current </item>
+ <item> Current </item>
+ <item> Current </item>
+ <item> CurrentHelper </item>
+ <item> CurrentHelper </item>
+ <item> CurrentHelper </item>
+ <item> CurrentHolder </item>
+ <item> CurrentOperations </item>
+ <item> CurrentOperations </item>
+ <item> CurrentOperations </item>
+ <item> Cursor </item>
+ <item> CustomMarshal </item>
+ <item> CustomValue </item>
+ <item> Customizer </item>
+ <item> CyclicBarrier </item>
+ <item> DATA_CONVERSION </item>
+ <item> DESKeySpec </item>
+ <item> DESedeKeySpec </item>
+ <item> DGC </item>
+ <item> DHGenParameterSpec </item>
+ <item> DHKey </item>
+ <item> DHParameterSpec </item>
+ <item> DHPrivateKey </item>
+ <item> DHPrivateKeySpec </item>
+ <item> DHPublicKey </item>
+ <item> DHPublicKeySpec </item>
+ <item> DISCARDING </item>
+ <item> DOMConfiguration </item>
+ <item> DOMError </item>
+ <item> DOMErrorHandler </item>
+ <item> DOMException </item>
+ <item> DOMImplementation </item>
+ <item> DOMImplementationLS </item>
+ <item> DOMImplementationList </item>
+ <item> DOMImplementationRegistry </item>
+ <item> DOMImplementationSource </item>
+ <item> DOMLocator </item>
+ <item> DOMLocator </item>
+ <item> DOMResult </item>
+ <item> DOMSource </item>
+ <item> DOMStringList </item>
+ <item> DSAKey </item>
+ <item> DSAKeyPairGenerator </item>
+ <item> DSAParameterSpec </item>
+ <item> DSAParams </item>
+ <item> DSAPrivateKey </item>
+ <item> DSAPrivateKeySpec </item>
+ <item> DSAPublicKey </item>
+ <item> DSAPublicKeySpec </item>
+ <item> DTD </item>
+ <item> DTDConstants </item>
+ <item> DTDHandler </item>
+ <item> DataBuffer </item>
+ <item> DataBufferByte </item>
+ <item> DataBufferDouble </item>
+ <item> DataBufferFloat </item>
+ <item> DataBufferInt </item>
+ <item> DataBufferShort </item>
+ <item> DataBufferUShort </item>
+ <item> DataFlavor </item>
+ <item> DataFormatException </item>
+ <item> DataInput </item>
+ <item> DataInputStream </item>
+ <item> DataInputStream </item>
+ <item> DataLine </item>
+ <item> DataLine.Info </item>
+ <item> DataOutput </item>
+ <item> DataOutputStream </item>
+ <item> DataOutputStream </item>
+ <item> DataSource </item>
+ <item> DataTruncation </item>
+ <item> DatabaseMetaData </item>
+ <item> DatagramChannel </item>
+ <item> DatagramPacket </item>
+ <item> DatagramSocket </item>
+ <item> DatagramSocketImpl </item>
+ <item> DatagramSocketImplFactory </item>
+ <item> DatatypeConfigurationException </item>
+ <item> DatatypeConstants </item>
+ <item> DatatypeConstants.Field </item>
+ <item> DatatypeFactory </item>
+ <item> Date </item>
+ <item> Date </item>
+ <item> DateFormat </item>
+ <item> DateFormat.Field </item>
+ <item> DateFormatSymbols </item>
+ <item> DateFormatter </item>
+ <item> DateTimeAtCompleted </item>
+ <item> DateTimeAtCreation </item>
+ <item> DateTimeAtProcessing </item>
+ <item> DateTimeSyntax </item>
+ <item> DebugGraphics </item>
+ <item> DecimalFormat </item>
+ <item> DecimalFormatSymbols </item>
+ <item> DeclHandler </item>
+ <item> DefaultBoundedRangeModel </item>
+ <item> DefaultButtonModel </item>
+ <item> DefaultCaret </item>
+ <item> DefaultCellEditor </item>
+ <item> DefaultColorSelectionModel </item>
+ <item> DefaultComboBoxModel </item>
+ <item> DefaultDesktopManager </item>
+ <item> DefaultEditorKit </item>
+ <item> DefaultEditorKit.BeepAction </item>
+ <item> DefaultEditorKit.CopyAction </item>
+ <item> DefaultEditorKit.CutAction </item>
+ <item> DefaultEditorKit.DefaultKeyTypedAction </item>
+ <item> DefaultEditorKit.InsertBreakAction </item>
+ <item> DefaultEditorKit.InsertContentAction </item>
+ <item> DefaultEditorKit.InsertTabAction </item>
+ <item> DefaultEditorKit.PasteAction </item>
+ <item> DefaultFocusManager </item>
+ <item> DefaultFocusTraversalPolicy </item>
+ <item> DefaultFormatter </item>
+ <item> DefaultFormatterFactory </item>
+ <item> DefaultHandler </item>
+ <item> DefaultHandler2 </item>
+ <item> DefaultHighlighter </item>
+ <item> DefaultHighlighter.DefaultHighlightPainter </item>
+ <item> DefaultKeyboardFocusManager </item>
+ <item> DefaultListCellRenderer </item>
+ <item> DefaultListCellRenderer.UIResource </item>
+ <item> DefaultListModel </item>
+ <item> DefaultListSelectionModel </item>
+ <item> DefaultLoaderRepository </item>
+ <item> DefaultLoaderRepository </item>
+ <item> DefaultMenuLayout </item>
+ <item> DefaultMetalTheme </item>
+ <item> DefaultMutableTreeNode </item>
+ <item> DefaultPersistenceDelegate </item>
+ <item> DefaultSingleSelectionModel </item>
+ <item> DefaultStyledDocument </item>
+ <item> DefaultStyledDocument.AttributeUndoableEdit </item>
+ <item> DefaultStyledDocument.ElementSpec </item>
+ <item> DefaultTableCellRenderer </item>
+ <item> DefaultTableCellRenderer.UIResource </item>
+ <item> DefaultTableColumnModel </item>
+ <item> DefaultTableModel </item>
+ <item> DefaultTextUI </item>
+ <item> DefaultTreeCellEditor </item>
+ <item> DefaultTreeCellRenderer </item>
+ <item> DefaultTreeModel </item>
+ <item> DefaultTreeSelectionModel </item>
+ <item> DefinitionKind </item>
+ <item> DefinitionKindHelper </item>
+ <item> Deflater </item>
+ <item> DeflaterOutputStream </item>
+ <item> DelayQueue </item>
+ <item> Delayed </item>
+ <item> Delegate </item>
+ <item> Delegate </item>
+ <item> Delegate </item>
+ <item> DelegationPermission </item>
+ <item> Deprecated </item>
+ <item> Descriptor </item>
+ <item> DescriptorAccess </item>
+ <item> DescriptorSupport </item>
+ <item> DesignMode </item>
+ <item> DesktopIconUI </item>
+ <item> DesktopManager </item>
+ <item> DesktopPaneUI </item>
+ <item> Destination </item>
+ <item> DestroyFailedException </item>
+ <item> Destroyable </item>
+ <item> Dialog </item>
+ <item> Dictionary </item>
+ <item> DigestException </item>
+ <item> DigestInputStream </item>
+ <item> DigestOutputStream </item>
+ <item> Dimension </item>
+ <item> Dimension2D </item>
+ <item> DimensionUIResource </item>
+ <item> DirContext </item>
+ <item> DirObjectFactory </item>
+ <item> DirStateFactory </item>
+ <item> DirStateFactory.Result </item>
+ <item> DirectColorModel </item>
+ <item> DirectoryManager </item>
+ <item> DisplayMode </item>
+ <item> DnDConstants </item>
+ <item> Doc </item>
+ <item> DocAttribute </item>
+ <item> DocAttributeSet </item>
+ <item> DocFlavor </item>
+ <item> DocFlavor.BYTE_ARRAY </item>
+ <item> DocFlavor.CHAR_ARRAY </item>
+ <item> DocFlavor.INPUT_STREAM </item>
+ <item> DocFlavor.READER </item>
+ <item> DocFlavor.SERVICE_FORMATTED </item>
+ <item> DocFlavor.STRING </item>
+ <item> DocFlavor.URL </item>
+ <item> DocPrintJob </item>
+ <item> Document </item>
+ <item> Document </item>
+ <item> DocumentBuilder </item>
+ <item> DocumentBuilderFactory </item>
+ <item> DocumentEvent </item>
+ <item> DocumentEvent.ElementChange </item>
+ <item> DocumentEvent.EventType </item>
+ <item> DocumentFilter </item>
+ <item> DocumentFilter.FilterBypass </item>
+ <item> DocumentFragment </item>
+ <item> DocumentHandler </item>
+ <item> DocumentListener </item>
+ <item> DocumentName </item>
+ <item> DocumentParser </item>
+ <item> DocumentType </item>
+ <item> Documented </item>
+ <item> DomainCombiner </item>
+ <item> DomainManager </item>
+ <item> DomainManagerOperations </item>
+ <item> Double </item>
+ <item> DoubleBuffer </item>
+ <item> DoubleHolder </item>
+ <item> DoubleSeqHelper </item>
+ <item> DoubleSeqHolder </item>
+ <item> DragGestureEvent </item>
+ <item> DragGestureListener </item>
+ <item> DragGestureRecognizer </item>
+ <item> DragSource </item>
+ <item> DragSourceAdapter </item>
+ <item> DragSourceContext </item>
+ <item> DragSourceDragEvent </item>
+ <item> DragSourceDropEvent </item>
+ <item> DragSourceEvent </item>
+ <item> DragSourceListener </item>
+ <item> DragSourceMotionListener </item>
+ <item> Driver </item>
+ <item> DriverManager </item>
+ <item> DriverPropertyInfo </item>
+ <item> DropTarget </item>
+ <item> DropTarget.DropTargetAutoScroller </item>
+ <item> DropTargetAdapter </item>
+ <item> DropTargetContext </item>
+ <item> DropTargetDragEvent </item>
+ <item> DropTargetDropEvent </item>
+ <item> DropTargetEvent </item>
+ <item> DropTargetListener </item>
+ <item> DuplicateFormatFlagsException </item>
+ <item> DuplicateName </item>
+ <item> DuplicateNameHelper </item>
+ <item> Duration </item>
+ <item> DynAny </item>
+ <item> DynAny </item>
+ <item> DynAnyFactory </item>
+ <item> DynAnyFactoryHelper </item>
+ <item> DynAnyFactoryOperations </item>
+ <item> DynAnyHelper </item>
+ <item> DynAnyOperations </item>
+ <item> DynAnySeqHelper </item>
+ <item> DynArray </item>
+ <item> DynArray </item>
+ <item> DynArrayHelper </item>
+ <item> DynArrayOperations </item>
+ <item> DynEnum </item>
+ <item> DynEnum </item>
+ <item> DynEnumHelper </item>
+ <item> DynEnumOperations </item>
+ <item> DynFixed </item>
+ <item> DynFixed </item>
+ <item> DynFixedHelper </item>
+ <item> DynFixedOperations </item>
+ <item> DynSequence </item>
+ <item> DynSequence </item>
+ <item> DynSequenceHelper </item>
+ <item> DynSequenceOperations </item>
+ <item> DynStruct </item>
+ <item> DynStruct </item>
+ <item> DynStructHelper </item>
+ <item> DynStructOperations </item>
+ <item> DynUnion </item>
+ <item> DynUnion </item>
+ <item> DynUnionHelper </item>
+ <item> DynUnionOperations </item>
+ <item> DynValue </item>
+ <item> DynValue </item>
+ <item> DynValueBox </item>
+ <item> DynValueBoxOperations </item>
+ <item> DynValueCommon </item>
+ <item> DynValueCommonOperations </item>
+ <item> DynValueHelper </item>
+ <item> DynValueOperations </item>
+ <item> DynamicImplementation </item>
+ <item> DynamicImplementation </item>
+ <item> DynamicMBean </item>
+ <item> ECField </item>
+ <item> ECFieldF2m </item>
+ <item> ECFieldFp </item>
+ <item> ECGenParameterSpec </item>
+ <item> ECKey </item>
+ <item> ECParameterSpec </item>
+ <item> ECPoint </item>
+ <item> ECPrivateKey </item>
+ <item> ECPrivateKeySpec </item>
+ <item> ECPublicKey </item>
+ <item> ECPublicKeySpec </item>
+ <item> ENCODING_CDR_ENCAPS </item>
+ <item> EOFException </item>
+ <item> EditorKit </item>
+ <item> Element </item>
+ <item> Element </item>
+ <item> Element </item>
+ <item> ElementIterator </item>
+ <item> ElementType </item>
+ <item> Ellipse2D </item>
+ <item> Ellipse2D.Double </item>
+ <item> Ellipse2D.Float </item>
+ <item> EllipticCurve </item>
+ <item> EmptyBorder </item>
+ <item> EmptyStackException </item>
+ <item> EncodedKeySpec </item>
+ <item> Encoder </item>
+ <item> Encoding </item>
+ <item> EncryptedPrivateKeyInfo </item>
+ <item> Entity </item>
+ <item> Entity </item>
+ <item> EntityReference </item>
+ <item> EntityResolver </item>
+ <item> EntityResolver2 </item>
+ <item> Enum </item>
+ <item> EnumConstantNotPresentException </item>
+ <item> EnumControl </item>
+ <item> EnumControl.Type </item>
+ <item> EnumMap </item>
+ <item> EnumSet </item>
+ <item> EnumSyntax </item>
+ <item> Enumeration </item>
+ <item> Environment </item>
+ <item> Error </item>
+ <item> ErrorHandler </item>
+ <item> ErrorListener </item>
+ <item> ErrorManager </item>
+ <item> EtchedBorder </item>
+ <item> Event </item>
+ <item> EventContext </item>
+ <item> EventDirContext </item>
+ <item> EventHandler </item>
+ <item> EventListener </item>
+ <item> EventListenerList </item>
+ <item> EventListenerProxy </item>
+ <item> EventObject </item>
+ <item> EventQueue </item>
+ <item> EventSetDescriptor </item>
+ <item> Exception </item>
+ <item> ExceptionDetailMessage </item>
+ <item> ExceptionInInitializerError </item>
+ <item> ExceptionList </item>
+ <item> ExceptionListener </item>
+ <item> Exchanger </item>
+ <item> ExecutionException </item>
+ <item> Executor </item>
+ <item> ExecutorCompletionService </item>
+ <item> ExecutorService </item>
+ <item> Executors </item>
+ <item> ExemptionMechanism </item>
+ <item> ExemptionMechanismException </item>
+ <item> ExemptionMechanismSpi </item>
+ <item> ExpandVetoException </item>
+ <item> ExportException </item>
+ <item> Expression </item>
+ <item> ExtendedRequest </item>
+ <item> ExtendedResponse </item>
+ <item> Externalizable </item>
+ <item> FREE_MEM </item>
+ <item> FactoryConfigurationError </item>
+ <item> FailedLoginException </item>
+ <item> FeatureDescriptor </item>
+ <item> Fidelity </item>
+ <item> Field </item>
+ <item> FieldNameHelper </item>
+ <item> FieldNameHelper </item>
+ <item> FieldPosition </item>
+ <item> FieldView </item>
+ <item> File </item>
+ <item> FileCacheImageInputStream </item>
+ <item> FileCacheImageOutputStream </item>
+ <item> FileChannel </item>
+ <item> FileChannel.MapMode </item>
+ <item> FileChooserUI </item>
+ <item> FileDescriptor </item>
+ <item> FileDialog </item>
+ <item> FileFilter </item>
+ <item> FileFilter </item>
+ <item> FileHandler </item>
+ <item> FileImageInputStream </item>
+ <item> FileImageOutputStream </item>
+ <item> FileInputStream </item>
+ <item> FileLock </item>
+ <item> FileLockInterruptionException </item>
+ <item> FileNameMap </item>
+ <item> FileNotFoundException </item>
+ <item> FileOutputStream </item>
+ <item> FilePermission </item>
+ <item> FileReader </item>
+ <item> FileSystemView </item>
+ <item> FileView </item>
+ <item> FileWriter </item>
+ <item> FilenameFilter </item>
+ <item> Filter </item>
+ <item> FilterInputStream </item>
+ <item> FilterOutputStream </item>
+ <item> FilterReader </item>
+ <item> FilterWriter </item>
+ <item> FilteredImageSource </item>
+ <item> FilteredRowSet </item>
+ <item> Finishings </item>
+ <item> FixedHeightLayoutCache </item>
+ <item> FixedHolder </item>
+ <item> FlatteningPathIterator </item>
+ <item> FlavorEvent </item>
+ <item> FlavorException </item>
+ <item> FlavorListener </item>
+ <item> FlavorMap </item>
+ <item> FlavorTable </item>
+ <item> Float </item>
+ <item> FloatBuffer </item>
+ <item> FloatControl </item>
+ <item> FloatControl.Type </item>
+ <item> FloatHolder </item>
+ <item> FloatSeqHelper </item>
+ <item> FloatSeqHolder </item>
+ <item> FlowLayout </item>
+ <item> FlowView </item>
+ <item> FlowView.FlowStrategy </item>
+ <item> Flushable </item>
+ <item> FocusAdapter </item>
+ <item> FocusEvent </item>
+ <item> FocusListener </item>
+ <item> FocusManager </item>
+ <item> FocusTraversalPolicy </item>
+ <item> Font </item>
+ <item> FontFormatException </item>
+ <item> FontMetrics </item>
+ <item> FontRenderContext </item>
+ <item> FontUIResource </item>
+ <item> FormSubmitEvent </item>
+ <item> FormSubmitEvent.MethodType </item>
+ <item> FormView </item>
+ <item> Format </item>
+ <item> Format.Field </item>
+ <item> FormatConversionProvider </item>
+ <item> FormatFlagsConversionMismatchException </item>
+ <item> FormatMismatch </item>
+ <item> FormatMismatchHelper </item>
+ <item> Formattable </item>
+ <item> FormattableFlags </item>
+ <item> Formatter </item>
+ <item> Formatter </item>
+ <item> FormatterClosedException </item>
+ <item> ForwardRequest </item>
+ <item> ForwardRequest </item>
+ <item> ForwardRequestHelper </item>
+ <item> ForwardRequestHelper </item>
+ <item> Frame </item>
+ <item> Future </item>
+ <item> FutureTask </item>
+ <item> GSSContext </item>
+ <item> GSSCredential </item>
+ <item> GSSException </item>
+ <item> GSSManager </item>
+ <item> GSSName </item>
+ <item> GZIPInputStream </item>
+ <item> GZIPOutputStream </item>
+ <item> GapContent </item>
+ <item> GarbageCollectorMXBean </item>
+ <item> GatheringByteChannel </item>
+ <item> GaugeMonitor </item>
+ <item> GaugeMonitorMBean </item>
+ <item> GeneralPath </item>
+ <item> GeneralSecurityException </item>
+ <item> GenericArrayType </item>
+ <item> GenericDeclaration </item>
+ <item> GenericSignatureFormatError </item>
+ <item> GlyphJustificationInfo </item>
+ <item> GlyphMetrics </item>
+ <item> GlyphVector </item>
+ <item> GlyphView </item>
+ <item> GlyphView.GlyphPainter </item>
+ <item> GradientPaint </item>
+ <item> GraphicAttribute </item>
+ <item> Graphics </item>
+ <item> Graphics2D </item>
+ <item> GraphicsConfigTemplate </item>
+ <item> GraphicsConfiguration </item>
+ <item> GraphicsDevice </item>
+ <item> GraphicsEnvironment </item>
+ <item> GrayFilter </item>
+ <item> GregorianCalendar </item>
+ <item> GridBagConstraints </item>
+ <item> GridBagLayout </item>
+ <item> GridLayout </item>
+ <item> Group </item>
+ <item> Guard </item>
+ <item> GuardedObject </item>
+ <item> HOLDING </item>
+ <item> HTML </item>
+ <item> HTML.Attribute </item>
+ <item> HTML.Tag </item>
+ <item> HTML.UnknownTag </item>
+ <item> HTMLDocument </item>
+ <item> HTMLDocument.Iterator </item>
+ <item> HTMLEditorKit </item>
+ <item> HTMLEditorKit.HTMLFactory </item>
+ <item> HTMLEditorKit.HTMLTextAction </item>
+ <item> HTMLEditorKit.InsertHTMLTextAction </item>
+ <item> HTMLEditorKit.LinkController </item>
+ <item> HTMLEditorKit.Parser </item>
+ <item> HTMLEditorKit.ParserCallback </item>
+ <item> HTMLFrameHyperlinkEvent </item>
+ <item> HTMLWriter </item>
+ <item> Handler </item>
+ <item> HandlerBase </item>
+ <item> HandshakeCompletedEvent </item>
+ <item> HandshakeCompletedListener </item>
+ <item> HasControls </item>
+ <item> HashAttributeSet </item>
+ <item> HashDocAttributeSet </item>
+ <item> HashMap </item>
+ <item> HashPrintJobAttributeSet </item>
+ <item> HashPrintRequestAttributeSet </item>
+ <item> HashPrintServiceAttributeSet </item>
+ <item> HashSet </item>
+ <item> Hashtable </item>
+ <item> HeadlessException </item>
+ <item> HierarchyBoundsAdapter </item>
+ <item> HierarchyBoundsListener </item>
+ <item> HierarchyEvent </item>
+ <item> HierarchyListener </item>
+ <item> Highlighter </item>
+ <item> Highlighter.Highlight </item>
+ <item> Highlighter.HighlightPainter </item>
+ <item> HostnameVerifier </item>
+ <item> HttpRetryException </item>
+ <item> HttpURLConnection </item>
+ <item> HttpsURLConnection </item>
+ <item> HyperlinkEvent </item>
+ <item> HyperlinkEvent.EventType </item>
+ <item> HyperlinkListener </item>
+ <item> ICC_ColorSpace </item>
+ <item> ICC_Profile </item>
+ <item> ICC_ProfileGray </item>
+ <item> ICC_ProfileRGB </item>
+ <item> IDLEntity </item>
+ <item> IDLType </item>
+ <item> IDLTypeHelper </item>
+ <item> IDLTypeOperations </item>
+ <item> ID_ASSIGNMENT_POLICY_ID </item>
+ <item> ID_UNIQUENESS_POLICY_ID </item>
+ <item> IIOByteBuffer </item>
+ <item> IIOException </item>
+ <item> IIOImage </item>
+ <item> IIOInvalidTreeException </item>
+ <item> IIOMetadata </item>
+ <item> IIOMetadataController </item>
+ <item> IIOMetadataFormat </item>
+ <item> IIOMetadataFormatImpl </item>
+ <item> IIOMetadataNode </item>
+ <item> IIOParam </item>
+ <item> IIOParamController </item>
+ <item> IIOReadProgressListener </item>
+ <item> IIOReadUpdateListener </item>
+ <item> IIOReadWarningListener </item>
+ <item> IIORegistry </item>
+ <item> IIOServiceProvider </item>
+ <item> IIOWriteProgressListener </item>
+ <item> IIOWriteWarningListener </item>
+ <item> IMPLICIT_ACTIVATION_POLICY_ID </item>
+ <item> IMP_LIMIT </item>
+ <item> INACTIVE </item>
+ <item> INITIALIZE </item>
+ <item> INTERNAL </item>
+ <item> INTF_REPOS </item>
+ <item> INVALID_ACTIVITY </item>
+ <item> INVALID_TRANSACTION </item>
+ <item> INV_FLAG </item>
+ <item> INV_IDENT </item>
+ <item> INV_OBJREF </item>
+ <item> INV_POLICY </item>
+ <item> IOException </item>
+ <item> IOR </item>
+ <item> IORHelper </item>
+ <item> IORHolder </item>
+ <item> IORInfo </item>
+ <item> IORInfoOperations </item>
+ <item> IORInterceptor </item>
+ <item> IORInterceptorOperations </item>
+ <item> IORInterceptor_3_0 </item>
+ <item> IORInterceptor_3_0Helper </item>
+ <item> IORInterceptor_3_0Holder </item>
+ <item> IORInterceptor_3_0Operations </item>
+ <item> IRObject </item>
+ <item> IRObjectOperations </item>
+ <item> Icon </item>
+ <item> IconUIResource </item>
+ <item> IconView </item>
+ <item> IdAssignmentPolicy </item>
+ <item> IdAssignmentPolicyOperations </item>
+ <item> IdAssignmentPolicyValue </item>
+ <item> IdUniquenessPolicy </item>
+ <item> IdUniquenessPolicyOperations </item>
+ <item> IdUniquenessPolicyValue </item>
+ <item> IdentifierHelper </item>
+ <item> Identity </item>
+ <item> IdentityHashMap </item>
+ <item> IdentityScope </item>
+ <item> IllegalAccessError </item>
+ <item> IllegalAccessException </item>
+ <item> IllegalArgumentException </item>
+ <item> IllegalBlockSizeException </item>
+ <item> IllegalBlockingModeException </item>
+ <item> IllegalCharsetNameException </item>
+ <item> IllegalClassFormatException </item>
+ <item> IllegalComponentStateException </item>
+ <item> IllegalFormatCodePointException </item>
+ <item> IllegalFormatConversionException </item>
+ <item> IllegalFormatException </item>
+ <item> IllegalFormatFlagsException </item>
+ <item> IllegalFormatPrecisionException </item>
+ <item> IllegalFormatWidthException </item>
+ <item> IllegalMonitorStateException </item>
+ <item> IllegalPathStateException </item>
+ <item> IllegalSelectorException </item>
+ <item> IllegalStateException </item>
+ <item> IllegalThreadStateException </item>
+ <item> Image </item>
+ <item> ImageCapabilities </item>
+ <item> ImageConsumer </item>
+ <item> ImageFilter </item>
+ <item> ImageGraphicAttribute </item>
+ <item> ImageIO </item>
+ <item> ImageIcon </item>
+ <item> ImageInputStream </item>
+ <item> ImageInputStreamImpl </item>
+ <item> ImageInputStreamSpi </item>
+ <item> ImageObserver </item>
+ <item> ImageOutputStream </item>
+ <item> ImageOutputStreamImpl </item>
+ <item> ImageOutputStreamSpi </item>
+ <item> ImageProducer </item>
+ <item> ImageReadParam </item>
+ <item> ImageReader </item>
+ <item> ImageReaderSpi </item>
+ <item> ImageReaderWriterSpi </item>
+ <item> ImageTranscoder </item>
+ <item> ImageTranscoderSpi </item>
+ <item> ImageTypeSpecifier </item>
+ <item> ImageView </item>
+ <item> ImageWriteParam </item>
+ <item> ImageWriter </item>
+ <item> ImageWriterSpi </item>
+ <item> ImagingOpException </item>
+ <item> ImplicitActivationPolicy </item>
+ <item> ImplicitActivationPolicyOperations </item>
+ <item> ImplicitActivationPolicyValue </item>
+ <item> IncompatibleClassChangeError </item>
+ <item> IncompleteAnnotationException </item>
+ <item> InconsistentTypeCode </item>
+ <item> InconsistentTypeCode </item>
+ <item> InconsistentTypeCodeHelper </item>
+ <item> IndexColorModel </item>
+ <item> IndexOutOfBoundsException </item>
+ <item> IndexedPropertyChangeEvent </item>
+ <item> IndexedPropertyDescriptor </item>
+ <item> IndirectionException </item>
+ <item> Inet4Address </item>
+ <item> Inet6Address </item>
+ <item> InetAddress </item>
+ <item> InetSocketAddress </item>
+ <item> Inflater </item>
+ <item> InflaterInputStream </item>
+ <item> InheritableThreadLocal </item>
+ <item> Inherited </item>
+ <item> InitialContext </item>
+ <item> InitialContextFactory </item>
+ <item> InitialContextFactoryBuilder </item>
+ <item> InitialDirContext </item>
+ <item> InitialLdapContext </item>
+ <item> InlineView </item>
+ <item> InputContext </item>
+ <item> InputEvent </item>
+ <item> InputMap </item>
+ <item> InputMapUIResource </item>
+ <item> InputMethod </item>
+ <item> InputMethodContext </item>
+ <item> InputMethodDescriptor </item>
+ <item> InputMethodEvent </item>
+ <item> InputMethodHighlight </item>
+ <item> InputMethodListener </item>
+ <item> InputMethodRequests </item>
+ <item> InputMismatchException </item>
+ <item> InputSource </item>
+ <item> InputStream </item>
+ <item> InputStream </item>
+ <item> InputStream </item>
+ <item> InputStreamReader </item>
+ <item> InputSubset </item>
+ <item> InputVerifier </item>
+ <item> Insets </item>
+ <item> InsetsUIResource </item>
+ <item> InstanceAlreadyExistsException </item>
+ <item> InstanceNotFoundException </item>
+ <item> InstantiationError </item>
+ <item> InstantiationException </item>
+ <item> Instrument </item>
+ <item> Instrumentation </item>
+ <item> InsufficientResourcesException </item>
+ <item> IntBuffer </item>
+ <item> IntHolder </item>
+ <item> Integer </item>
+ <item> IntegerSyntax </item>
+ <item> Interceptor </item>
+ <item> InterceptorOperations </item>
+ <item> InternalError </item>
+ <item> InternalFrameAdapter </item>
+ <item> InternalFrameEvent </item>
+ <item> InternalFrameFocusTraversalPolicy </item>
+ <item> InternalFrameListener </item>
+ <item> InternalFrameUI </item>
+ <item> InternationalFormatter </item>
+ <item> InterruptedException </item>
+ <item> InterruptedIOException </item>
+ <item> InterruptedNamingException </item>
+ <item> InterruptibleChannel </item>
+ <item> IntrospectionException </item>
+ <item> IntrospectionException </item>
+ <item> Introspector </item>
+ <item> Invalid </item>
+ <item> InvalidActivityException </item>
+ <item> InvalidAddress </item>
+ <item> InvalidAddressHelper </item>
+ <item> InvalidAddressHolder </item>
+ <item> InvalidAlgorithmParameterException </item>
+ <item> InvalidApplicationException </item>
+ <item> InvalidAttributeIdentifierException </item>
+ <item> InvalidAttributeValueException </item>
+ <item> InvalidAttributeValueException </item>
+ <item> InvalidAttributesException </item>
+ <item> InvalidClassException </item>
+ <item> InvalidDnDOperationException </item>
+ <item> InvalidKeyException </item>
+ <item> InvalidKeyException </item>
+ <item> InvalidKeySpecException </item>
+ <item> InvalidMarkException </item>
+ <item> InvalidMidiDataException </item>
+ <item> InvalidName </item>
+ <item> InvalidName </item>
+ <item> InvalidName </item>
+ <item> InvalidNameException </item>
+ <item> InvalidNameHelper </item>
+ <item> InvalidNameHelper </item>
+ <item> InvalidNameHolder </item>
+ <item> InvalidObjectException </item>
+ <item> InvalidOpenTypeException </item>
+ <item> InvalidParameterException </item>
+ <item> InvalidParameterSpecException </item>
+ <item> InvalidPolicy </item>
+ <item> InvalidPolicyHelper </item>
+ <item> InvalidPreferencesFormatException </item>
+ <item> InvalidPropertiesFormatException </item>
+ <item> InvalidRelationIdException </item>
+ <item> InvalidRelationServiceException </item>
+ <item> InvalidRelationTypeException </item>
+ <item> InvalidRoleInfoException </item>
+ <item> InvalidRoleValueException </item>
+ <item> InvalidSearchControlsException </item>
+ <item> InvalidSearchFilterException </item>
+ <item> InvalidSeq </item>
+ <item> InvalidSlot </item>
+ <item> InvalidSlotHelper </item>
+ <item> InvalidTargetObjectTypeException </item>
+ <item> InvalidTransactionException </item>
+ <item> InvalidTypeForEncoding </item>
+ <item> InvalidTypeForEncodingHelper </item>
+ <item> InvalidValue </item>
+ <item> InvalidValue </item>
+ <item> InvalidValueHelper </item>
+ <item> InvocationEvent </item>
+ <item> InvocationHandler </item>
+ <item> InvocationTargetException </item>
+ <item> InvokeHandler </item>
+ <item> IstringHelper </item>
+ <item> ItemEvent </item>
+ <item> ItemListener </item>
+ <item> ItemSelectable </item>
+ <item> Iterable </item>
+ <item> Iterator </item>
+ <item> IvParameterSpec </item>
+ <item> JApplet </item>
+ <item> JButton </item>
+ <item> JCheckBox </item>
+ <item> JCheckBoxMenuItem </item>
+ <item> JColorChooser </item>
+ <item> JComboBox </item>
+ <item> JComboBox.KeySelectionManager </item>
+ <item> JComponent </item>
+ <item> JDesktopPane </item>
+ <item> JDialog </item>
+ <item> JEditorPane </item>
+ <item> JFileChooser </item>
+ <item> JFormattedTextField </item>
+ <item> JFormattedTextField.AbstractFormatter </item>
+ <item> JFormattedTextField.AbstractFormatterFactory </item>
+ <item> JFrame </item>
+ <item> JInternalFrame </item>
+ <item> JInternalFrame.JDesktopIcon </item>
+ <item> JLabel </item>
+ <item> JLayeredPane </item>
+ <item> JList </item>
+ <item> JMException </item>
+ <item> JMRuntimeException </item>
+ <item> JMXAuthenticator </item>
+ <item> JMXConnectionNotification </item>
+ <item> JMXConnector </item>
+ <item> JMXConnectorFactory </item>
+ <item> JMXConnectorProvider </item>
+ <item> JMXConnectorServer </item>
+ <item> JMXConnectorServerFactory </item>
+ <item> JMXConnectorServerMBean </item>
+ <item> JMXConnectorServerProvider </item>
+ <item> JMXPrincipal </item>
+ <item> JMXProviderException </item>
+ <item> JMXServerErrorException </item>
+ <item> JMXServiceURL </item>
+ <item> JMenu </item>
+ <item> JMenuBar </item>
+ <item> JMenuItem </item>
+ <item> JOptionPane </item>
+ <item> JPEGHuffmanTable </item>
+ <item> JPEGImageReadParam </item>
+ <item> JPEGImageWriteParam </item>
+ <item> JPEGQTable </item>
+ <item> JPanel </item>
+ <item> JPasswordField </item>
+ <item> JPopupMenu </item>
+ <item> JPopupMenu.Separator </item>
+ <item> JProgressBar </item>
+ <item> JRadioButton </item>
+ <item> JRadioButtonMenuItem </item>
+ <item> JRootPane </item>
+ <item> JScrollBar </item>
+ <item> JScrollPane </item>
+ <item> JSeparator </item>
+ <item> JSlider </item>
+ <item> JSpinner </item>
+ <item> JSpinner.DateEditor </item>
+ <item> JSpinner.DefaultEditor </item>
+ <item> JSpinner.ListEditor </item>
+ <item> JSpinner.NumberEditor </item>
+ <item> JSplitPane </item>
+ <item> JTabbedPane </item>
+ <item> JTable </item>
+ <item> JTable.PrintMode </item>
+ <item> JTableHeader </item>
+ <item> JTextArea </item>
+ <item> JTextComponent </item>
+ <item> JTextComponent.KeyBinding </item>
+ <item> JTextField </item>
+ <item> JTextPane </item>
+ <item> JToggleButton </item>
+ <item> JToggleButton.ToggleButtonModel </item>
+ <item> JToolBar </item>
+ <item> JToolBar.Separator </item>
+ <item> JToolTip </item>
+ <item> JTree </item>
+ <item> JTree.DynamicUtilTreeNode </item>
+ <item> JTree.EmptySelectionModel </item>
+ <item> JViewport </item>
+ <item> JWindow </item>
+ <item> JarEntry </item>
+ <item> JarException </item>
+ <item> JarFile </item>
+ <item> JarInputStream </item>
+ <item> JarOutputStream </item>
+ <item> JarURLConnection </item>
+ <item> JdbcRowSet </item>
+ <item> JobAttributes </item>
+ <item> JobAttributes.DefaultSelectionType </item>
+ <item> JobAttributes.DestinationType </item>
+ <item> JobAttributes.DialogType </item>
+ <item> JobAttributes.MultipleDocumentHandlingType </item>
+ <item> JobAttributes.SidesType </item>
+ <item> JobHoldUntil </item>
+ <item> JobImpressions </item>
+ <item> JobImpressionsCompleted </item>
+ <item> JobImpressionsSupported </item>
+ <item> JobKOctets </item>
+ <item> JobKOctetsProcessed </item>
+ <item> JobKOctetsSupported </item>
+ <item> JobMediaSheets </item>
+ <item> JobMediaSheetsCompleted </item>
+ <item> JobMediaSheetsSupported </item>
+ <item> JobMessageFromOperator </item>
+ <item> JobName </item>
+ <item> JobOriginatingUserName </item>
+ <item> JobPriority </item>
+ <item> JobPrioritySupported </item>
+ <item> JobSheets </item>
+ <item> JobState </item>
+ <item> JobStateReason </item>
+ <item> JobStateReasons </item>
+ <item> JoinRowSet </item>
+ <item> Joinable </item>
+ <item> KerberosKey </item>
+ <item> KerberosPrincipal </item>
+ <item> KerberosTicket </item>
+ <item> Kernel </item>
+ <item> Key </item>
+ <item> KeyAdapter </item>
+ <item> KeyAgreement </item>
+ <item> KeyAgreementSpi </item>
+ <item> KeyAlreadyExistsException </item>
+ <item> KeyEvent </item>
+ <item> KeyEventDispatcher </item>
+ <item> KeyEventPostProcessor </item>
+ <item> KeyException </item>
+ <item> KeyFactory </item>
+ <item> KeyFactorySpi </item>
+ <item> KeyGenerator </item>
+ <item> KeyGeneratorSpi </item>
+ <item> KeyListener </item>
+ <item> KeyManagementException </item>
+ <item> KeyManager </item>
+ <item> KeyManagerFactory </item>
+ <item> KeyManagerFactorySpi </item>
+ <item> KeyPair </item>
+ <item> KeyPairGenerator </item>
+ <item> KeyPairGeneratorSpi </item>
+ <item> KeyRep </item>
+ <item> KeyRep.Type </item>
+ <item> KeySpec </item>
+ <item> KeyStore </item>
+ <item> KeyStore.Builder </item>
+ <item> KeyStore.CallbackHandlerProtection </item>
+ <item> KeyStore.Entry </item>
+ <item> KeyStore.LoadStoreParameter </item>
+ <item> KeyStore.PasswordProtection </item>
+ <item> KeyStore.PrivateKeyEntry </item>
+ <item> KeyStore.ProtectionParameter </item>
+ <item> KeyStore.SecretKeyEntry </item>
+ <item> KeyStore.TrustedCertificateEntry </item>
+ <item> KeyStoreBuilderParameters </item>
+ <item> KeyStoreException </item>
+ <item> KeyStoreSpi </item>
+ <item> KeyStroke </item>
+ <item> KeyboardFocusManager </item>
+ <item> Keymap </item>
+ <item> LDAPCertStoreParameters </item>
+ <item> LIFESPAN_POLICY_ID </item>
+ <item> LOCATION_FORWARD </item>
+ <item> LSException </item>
+ <item> LSInput </item>
+ <item> LSLoadEvent </item>
+ <item> LSOutput </item>
+ <item> LSParser </item>
+ <item> LSParserFilter </item>
+ <item> LSProgressEvent </item>
+ <item> LSResourceResolver </item>
+ <item> LSSerializer </item>
+ <item> LSSerializerFilter </item>
+ <item> Label </item>
+ <item> LabelUI </item>
+ <item> LabelView </item>
+ <item> LanguageCallback </item>
+ <item> LastOwnerException </item>
+ <item> LayeredHighlighter </item>
+ <item> LayeredHighlighter.LayerPainter </item>
+ <item> LayoutFocusTraversalPolicy </item>
+ <item> LayoutManager </item>
+ <item> LayoutManager2 </item>
+ <item> LayoutQueue </item>
+ <item> LdapContext </item>
+ <item> LdapName </item>
+ <item> LdapReferralException </item>
+ <item> Lease </item>
+ <item> Level </item>
+ <item> LexicalHandler </item>
+ <item> LifespanPolicy </item>
+ <item> LifespanPolicyOperations </item>
+ <item> LifespanPolicyValue </item>
+ <item> LimitExceededException </item>
+ <item> Line </item>
+ <item> Line.Info </item>
+ <item> Line2D </item>
+ <item> Line2D.Double </item>
+ <item> Line2D.Float </item>
+ <item> LineBorder </item>
+ <item> LineBreakMeasurer </item>
+ <item> LineEvent </item>
+ <item> LineEvent.Type </item>
+ <item> LineListener </item>
+ <item> LineMetrics </item>
+ <item> LineNumberInputStream </item>
+ <item> LineNumberReader </item>
+ <item> LineUnavailableException </item>
+ <item> LinkException </item>
+ <item> LinkLoopException </item>
+ <item> LinkRef </item>
+ <item> LinkageError </item>
+ <item> LinkedBlockingQueue </item>
+ <item> LinkedHashMap </item>
+ <item> LinkedHashSet </item>
+ <item> LinkedList </item>
+ <item> List </item>
+ <item> List </item>
+ <item> ListCellRenderer </item>
+ <item> ListDataEvent </item>
+ <item> ListDataListener </item>
+ <item> ListIterator </item>
+ <item> ListModel </item>
+ <item> ListResourceBundle </item>
+ <item> ListSelectionEvent </item>
+ <item> ListSelectionListener </item>
+ <item> ListSelectionModel </item>
+ <item> ListUI </item>
+ <item> ListView </item>
+ <item> ListenerNotFoundException </item>
+ <item> LoaderHandler </item>
+ <item> LocalObject </item>
+ <item> Locale </item>
+ <item> LocateRegistry </item>
+ <item> Locator </item>
+ <item> Locator2 </item>
+ <item> Locator2Impl </item>
+ <item> LocatorImpl </item>
+ <item> Lock </item>
+ <item> LockSupport </item>
+ <item> LogManager </item>
+ <item> LogRecord </item>
+ <item> LogStream </item>
+ <item> Logger </item>
+ <item> LoggingMXBean </item>
+ <item> LoggingPermission </item>
+ <item> LoginContext </item>
+ <item> LoginException </item>
+ <item> LoginModule </item>
+ <item> Long </item>
+ <item> LongBuffer </item>
+ <item> LongHolder </item>
+ <item> LongLongSeqHelper </item>
+ <item> LongLongSeqHolder </item>
+ <item> LongSeqHelper </item>
+ <item> LongSeqHolder </item>
+ <item> LookAndFeel </item>
+ <item> LookupOp </item>
+ <item> LookupTable </item>
+ <item> MARSHAL </item>
+ <item> MBeanAttributeInfo </item>
+ <item> MBeanConstructorInfo </item>
+ <item> MBeanException </item>
+ <item> MBeanFeatureInfo </item>
+ <item> MBeanInfo </item>
+ <item> MBeanNotificationInfo </item>
+ <item> MBeanOperationInfo </item>
+ <item> MBeanParameterInfo </item>
+ <item> MBeanPermission </item>
+ <item> MBeanRegistration </item>
+ <item> MBeanRegistrationException </item>
+ <item> MBeanServer </item>
+ <item> MBeanServerBuilder </item>
+ <item> MBeanServerConnection </item>
+ <item> MBeanServerDelegate </item>
+ <item> MBeanServerDelegateMBean </item>
+ <item> MBeanServerFactory </item>
+ <item> MBeanServerForwarder </item>
+ <item> MBeanServerInvocationHandler </item>
+ <item> MBeanServerNotification </item>
+ <item> MBeanServerNotificationFilter </item>
+ <item> MBeanServerPermission </item>
+ <item> MBeanTrustPermission </item>
+ <item> MGF1ParameterSpec </item>
+ <item> MLet </item>
+ <item> MLetMBean </item>
+ <item> Mac </item>
+ <item> MacSpi </item>
+ <item> MalformedInputException </item>
+ <item> MalformedLinkException </item>
+ <item> MalformedObjectNameException </item>
+ <item> MalformedParameterizedTypeException </item>
+ <item> MalformedURLException </item>
+ <item> ManageReferralControl </item>
+ <item> ManagementFactory </item>
+ <item> ManagementPermission </item>
+ <item> ManagerFactoryParameters </item>
+ <item> Manifest </item>
+ <item> Map </item>
+ <item> Map.Entry </item>
+ <item> MappedByteBuffer </item>
+ <item> MarshalException </item>
+ <item> MarshalledObject </item>
+ <item> MaskFormatter </item>
+ <item> MatchResult </item>
+ <item> Matcher </item>
+ <item> Math </item>
+ <item> MathContext </item>
+ <item> MatteBorder </item>
+ <item> Media </item>
+ <item> MediaName </item>
+ <item> MediaPrintableArea </item>
+ <item> MediaSize </item>
+ <item> MediaSize.Engineering </item>
+ <item> MediaSize.ISO </item>
+ <item> MediaSize.JIS </item>
+ <item> MediaSize.NA </item>
+ <item> MediaSize.Other </item>
+ <item> MediaSizeName </item>
+ <item> MediaTracker </item>
+ <item> MediaTray </item>
+ <item> Member </item>
+ <item> MemoryCacheImageInputStream </item>
+ <item> MemoryCacheImageOutputStream </item>
+ <item> MemoryHandler </item>
+ <item> MemoryImageSource </item>
+ <item> MemoryMXBean </item>
+ <item> MemoryManagerMXBean </item>
+ <item> MemoryNotificationInfo </item>
+ <item> MemoryPoolMXBean </item>
+ <item> MemoryType </item>
+ <item> MemoryUsage </item>
+ <item> Menu </item>
+ <item> MenuBar </item>
+ <item> MenuBarUI </item>
+ <item> MenuComponent </item>
+ <item> MenuContainer </item>
+ <item> MenuDragMouseEvent </item>
+ <item> MenuDragMouseListener </item>
+ <item> MenuElement </item>
+ <item> MenuEvent </item>
+ <item> MenuItem </item>
+ <item> MenuItemUI </item>
+ <item> MenuKeyEvent </item>
+ <item> MenuKeyListener </item>
+ <item> MenuListener </item>
+ <item> MenuSelectionManager </item>
+ <item> MenuShortcut </item>
+ <item> MessageDigest </item>
+ <item> MessageDigestSpi </item>
+ <item> MessageFormat </item>
+ <item> MessageFormat.Field </item>
+ <item> MessageProp </item>
+ <item> MetaEventListener </item>
+ <item> MetaMessage </item>
+ <item> MetalBorders </item>
+ <item> MetalBorders.ButtonBorder </item>
+ <item> MetalBorders.Flush3DBorder </item>
+ <item> MetalBorders.InternalFrameBorder </item>
+ <item> MetalBorders.MenuBarBorder </item>
+ <item> MetalBorders.MenuItemBorder </item>
+ <item> MetalBorders.OptionDialogBorder </item>
+ <item> MetalBorders.PaletteBorder </item>
+ <item> MetalBorders.PopupMenuBorder </item>
+ <item> MetalBorders.RolloverButtonBorder </item>
+ <item> MetalBorders.ScrollPaneBorder </item>
+ <item> MetalBorders.TableHeaderBorder </item>
+ <item> MetalBorders.TextFieldBorder </item>
+ <item> MetalBorders.ToggleButtonBorder </item>
+ <item> MetalBorders.ToolBarBorder </item>
+ <item> MetalButtonUI </item>
+ <item> MetalCheckBoxIcon </item>
+ <item> MetalCheckBoxUI </item>
+ <item> MetalComboBoxButton </item>
+ <item> MetalComboBoxEditor </item>
+ <item> MetalComboBoxEditor.UIResource </item>
+ <item> MetalComboBoxIcon </item>
+ <item> MetalComboBoxUI </item>
+ <item> MetalDesktopIconUI </item>
+ <item> MetalFileChooserUI </item>
+ <item> MetalIconFactory </item>
+ <item> MetalIconFactory.FileIcon16 </item>
+ <item> MetalIconFactory.FolderIcon16 </item>
+ <item> MetalIconFactory.PaletteCloseIcon </item>
+ <item> MetalIconFactory.TreeControlIcon </item>
+ <item> MetalIconFactory.TreeFolderIcon </item>
+ <item> MetalIconFactory.TreeLeafIcon </item>
+ <item> MetalInternalFrameTitlePane </item>
+ <item> MetalInternalFrameUI </item>
+ <item> MetalLabelUI </item>
+ <item> MetalLookAndFeel </item>
+ <item> MetalMenuBarUI </item>
+ <item> MetalPopupMenuSeparatorUI </item>
+ <item> MetalProgressBarUI </item>
+ <item> MetalRadioButtonUI </item>
+ <item> MetalRootPaneUI </item>
+ <item> MetalScrollBarUI </item>
+ <item> MetalScrollButton </item>
+ <item> MetalScrollPaneUI </item>
+ <item> MetalSeparatorUI </item>
+ <item> MetalSliderUI </item>
+ <item> MetalSplitPaneUI </item>
+ <item> MetalTabbedPaneUI </item>
+ <item> MetalTextFieldUI </item>
+ <item> MetalTheme </item>
+ <item> MetalToggleButtonUI </item>
+ <item> MetalToolBarUI </item>
+ <item> MetalToolTipUI </item>
+ <item> MetalTreeUI </item>
+ <item> Method </item>
+ <item> MethodDescriptor </item>
+ <item> MidiChannel </item>
+ <item> MidiDevice </item>
+ <item> MidiDevice.Info </item>
+ <item> MidiDeviceProvider </item>
+ <item> MidiEvent </item>
+ <item> MidiFileFormat </item>
+ <item> MidiFileReader </item>
+ <item> MidiFileWriter </item>
+ <item> MidiMessage </item>
+ <item> MidiSystem </item>
+ <item> MidiUnavailableException </item>
+ <item> MimeTypeParseException </item>
+ <item> MinimalHTMLWriter </item>
+ <item> MissingFormatArgumentException </item>
+ <item> MissingFormatWidthException </item>
+ <item> MissingResourceException </item>
+ <item> Mixer </item>
+ <item> Mixer.Info </item>
+ <item> MixerProvider </item>
+ <item> ModelMBean </item>
+ <item> ModelMBeanAttributeInfo </item>
+ <item> ModelMBeanConstructorInfo </item>
+ <item> ModelMBeanInfo </item>
+ <item> ModelMBeanInfoSupport </item>
+ <item> ModelMBeanNotificationBroadcaster </item>
+ <item> ModelMBeanNotificationInfo </item>
+ <item> ModelMBeanOperationInfo </item>
+ <item> ModificationItem </item>
+ <item> Modifier </item>
+ <item> Monitor </item>
+ <item> MonitorMBean </item>
+ <item> MonitorNotification </item>
+ <item> MonitorSettingException </item>
+ <item> MouseAdapter </item>
+ <item> MouseDragGestureRecognizer </item>
+ <item> MouseEvent </item>
+ <item> MouseInfo </item>
+ <item> MouseInputAdapter </item>
+ <item> MouseInputListener </item>
+ <item> MouseListener </item>
+ <item> MouseMotionAdapter </item>
+ <item> MouseMotionListener </item>
+ <item> MouseWheelEvent </item>
+ <item> MouseWheelListener </item>
+ <item> MultiButtonUI </item>
+ <item> MultiColorChooserUI </item>
+ <item> MultiComboBoxUI </item>
+ <item> MultiDesktopIconUI </item>
+ <item> MultiDesktopPaneUI </item>
+ <item> MultiDoc </item>
+ <item> MultiDocPrintJob </item>
+ <item> MultiDocPrintService </item>
+ <item> MultiFileChooserUI </item>
+ <item> MultiInternalFrameUI </item>
+ <item> MultiLabelUI </item>
+ <item> MultiListUI </item>
+ <item> MultiLookAndFeel </item>
+ <item> MultiMenuBarUI </item>
+ <item> MultiMenuItemUI </item>
+ <item> MultiOptionPaneUI </item>
+ <item> MultiPanelUI </item>
+ <item> MultiPixelPackedSampleModel </item>
+ <item> MultiPopupMenuUI </item>
+ <item> MultiProgressBarUI </item>
+ <item> MultiRootPaneUI </item>
+ <item> MultiScrollBarUI </item>
+ <item> MultiScrollPaneUI </item>
+ <item> MultiSeparatorUI </item>
+ <item> MultiSliderUI </item>
+ <item> MultiSpinnerUI </item>
+ <item> MultiSplitPaneUI </item>
+ <item> MultiTabbedPaneUI </item>
+ <item> MultiTableHeaderUI </item>
+ <item> MultiTableUI </item>
+ <item> MultiTextUI </item>
+ <item> MultiToolBarUI </item>
+ <item> MultiToolTipUI </item>
+ <item> MultiTreeUI </item>
+ <item> MultiViewportUI </item>
+ <item> MulticastSocket </item>
+ <item> MultipleComponentProfileHelper </item>
+ <item> MultipleComponentProfileHolder </item>
+ <item> MultipleDocumentHandling </item>
+ <item> MultipleMaster </item>
+ <item> MutableAttributeSet </item>
+ <item> MutableComboBoxModel </item>
+ <item> MutableTreeNode </item>
+ <item> NON_EXISTENT </item>
+ <item> NO_IMPLEMENT </item>
+ <item> NO_MEMORY </item>
+ <item> NO_PERMISSION </item>
+ <item> NO_RESOURCES </item>
+ <item> NO_RESPONSE </item>
+ <item> NVList </item>
+ <item> Name </item>
+ <item> NameAlreadyBoundException </item>
+ <item> NameCallback </item>
+ <item> NameClassPair </item>
+ <item> NameComponent </item>
+ <item> NameComponentHelper </item>
+ <item> NameComponentHolder </item>
+ <item> NameDynAnyPair </item>
+ <item> NameDynAnyPairHelper </item>
+ <item> NameDynAnyPairSeqHelper </item>
+ <item> NameHelper </item>
+ <item> NameHolder </item>
+ <item> NameList </item>
+ <item> NameNotFoundException </item>
+ <item> NameParser </item>
+ <item> NameValuePair </item>
+ <item> NameValuePair </item>
+ <item> NameValuePairHelper </item>
+ <item> NameValuePairHelper </item>
+ <item> NameValuePairSeqHelper </item>
+ <item> NamedNodeMap </item>
+ <item> NamedValue </item>
+ <item> NamespaceChangeListener </item>
+ <item> NamespaceContext </item>
+ <item> NamespaceSupport </item>
+ <item> Naming </item>
+ <item> NamingContext </item>
+ <item> NamingContextExt </item>
+ <item> NamingContextExtHelper </item>
+ <item> NamingContextExtHolder </item>
+ <item> NamingContextExtOperations </item>
+ <item> NamingContextExtPOA </item>
+ <item> NamingContextHelper </item>
+ <item> NamingContextHolder </item>
+ <item> NamingContextOperations </item>
+ <item> NamingContextPOA </item>
+ <item> NamingEnumeration </item>
+ <item> NamingEvent </item>
+ <item> NamingException </item>
+ <item> NamingExceptionEvent </item>
+ <item> NamingListener </item>
+ <item> NamingManager </item>
+ <item> NamingSecurityException </item>
+ <item> NavigationFilter </item>
+ <item> NavigationFilter.FilterBypass </item>
+ <item> NegativeArraySizeException </item>
+ <item> NetPermission </item>
+ <item> NetworkInterface </item>
+ <item> NoClassDefFoundError </item>
+ <item> NoConnectionPendingException </item>
+ <item> NoContext </item>
+ <item> NoContextHelper </item>
+ <item> NoInitialContextException </item>
+ <item> NoPermissionException </item>
+ <item> NoRouteToHostException </item>
+ <item> NoServant </item>
+ <item> NoServantHelper </item>
+ <item> NoSuchAlgorithmException </item>
+ <item> NoSuchAttributeException </item>
+ <item> NoSuchElementException </item>
+ <item> NoSuchFieldError </item>
+ <item> NoSuchFieldException </item>
+ <item> NoSuchMethodError </item>
+ <item> NoSuchMethodException </item>
+ <item> NoSuchObjectException </item>
+ <item> NoSuchPaddingException </item>
+ <item> NoSuchProviderException </item>
+ <item> Node </item>
+ <item> NodeChangeEvent </item>
+ <item> NodeChangeListener </item>
+ <item> NodeList </item>
+ <item> NonReadableChannelException </item>
+ <item> NonWritableChannelException </item>
+ <item> NoninvertibleTransformException </item>
+ <item> NotActiveException </item>
+ <item> NotBoundException </item>
+ <item> NotCompliantMBeanException </item>
+ <item> NotContextException </item>
+ <item> NotEmpty </item>
+ <item> NotEmptyHelper </item>
+ <item> NotEmptyHolder </item>
+ <item> NotFound </item>
+ <item> NotFoundHelper </item>
+ <item> NotFoundHolder </item>
+ <item> NotFoundReason </item>
+ <item> NotFoundReasonHelper </item>
+ <item> NotFoundReasonHolder </item>
+ <item> NotOwnerException </item>
+ <item> NotSerializableException </item>
+ <item> NotYetBoundException </item>
+ <item> NotYetConnectedException </item>
+ <item> Notation </item>
+ <item> Notification </item>
+ <item> NotificationBroadcaster </item>
+ <item> NotificationBroadcasterSupport </item>
+ <item> NotificationEmitter </item>
+ <item> NotificationFilter </item>
+ <item> NotificationFilterSupport </item>
+ <item> NotificationListener </item>
+ <item> NotificationResult </item>
+ <item> NullCipher </item>
+ <item> NullPointerException </item>
+ <item> Number </item>
+ <item> NumberFormat </item>
+ <item> NumberFormat.Field </item>
+ <item> NumberFormatException </item>
+ <item> NumberFormatter </item>
+ <item> NumberOfDocuments </item>
+ <item> NumberOfInterveningJobs </item>
+ <item> NumberUp </item>
+ <item> NumberUpSupported </item>
+ <item> NumericShaper </item>
+ <item> OAEPParameterSpec </item>
+ <item> OBJECT_NOT_EXIST </item>
+ <item> OBJ_ADAPTER </item>
+ <item> OMGVMCID </item>
+ <item> ORB </item>
+ <item> ORB </item>
+ <item> ORBIdHelper </item>
+ <item> ORBInitInfo </item>
+ <item> ORBInitInfoOperations </item>
+ <item> ORBInitializer </item>
+ <item> ORBInitializerOperations </item>
+ <item> ObjID </item>
+ <item> Object </item>
+ <item> Object </item>
+ <item> ObjectAlreadyActive </item>
+ <item> ObjectAlreadyActiveHelper </item>
+ <item> ObjectChangeListener </item>
+ <item> ObjectFactory </item>
+ <item> ObjectFactoryBuilder </item>
+ <item> ObjectHelper </item>
+ <item> ObjectHolder </item>
+ <item> ObjectIdHelper </item>
+ <item> ObjectIdHelper </item>
+ <item> ObjectImpl </item>
+ <item> ObjectImpl </item>
+ <item> ObjectInput </item>
+ <item> ObjectInputStream </item>
+ <item> ObjectInputStream.GetField </item>
+ <item> ObjectInputValidation </item>
+ <item> ObjectInstance </item>
+ <item> ObjectName </item>
+ <item> ObjectNotActive </item>
+ <item> ObjectNotActiveHelper </item>
+ <item> ObjectOutput </item>
+ <item> ObjectOutputStream </item>
+ <item> ObjectOutputStream.PutField </item>
+ <item> ObjectReferenceFactory </item>
+ <item> ObjectReferenceFactoryHelper </item>
+ <item> ObjectReferenceFactoryHolder </item>
+ <item> ObjectReferenceTemplate </item>
+ <item> ObjectReferenceTemplateHelper </item>
+ <item> ObjectReferenceTemplateHolder </item>
+ <item> ObjectReferenceTemplateSeqHelper </item>
+ <item> ObjectReferenceTemplateSeqHolder </item>
+ <item> ObjectStreamClass </item>
+ <item> ObjectStreamConstants </item>
+ <item> ObjectStreamException </item>
+ <item> ObjectStreamField </item>
+ <item> ObjectView </item>
+ <item> Observable </item>
+ <item> Observer </item>
+ <item> OceanTheme </item>
+ <item> OctetSeqHelper </item>
+ <item> OctetSeqHolder </item>
+ <item> Oid </item>
+ <item> OpenDataException </item>
+ <item> OpenMBeanAttributeInfo </item>
+ <item> OpenMBeanAttributeInfoSupport </item>
+ <item> OpenMBeanConstructorInfo </item>
+ <item> OpenMBeanConstructorInfoSupport </item>
+ <item> OpenMBeanInfo </item>
+ <item> OpenMBeanInfoSupport </item>
+ <item> OpenMBeanOperationInfo </item>
+ <item> OpenMBeanOperationInfoSupport </item>
+ <item> OpenMBeanParameterInfo </item>
+ <item> OpenMBeanParameterInfoSupport </item>
+ <item> OpenType </item>
+ <item> OpenType </item>
+ <item> OperatingSystemMXBean </item>
+ <item> Operation </item>
+ <item> OperationNotSupportedException </item>
+ <item> OperationsException </item>
+ <item> Option </item>
+ <item> OptionPaneUI </item>
+ <item> OptionalDataException </item>
+ <item> OrientationRequested </item>
+ <item> OutOfMemoryError </item>
+ <item> OutputDeviceAssigned </item>
+ <item> OutputKeys </item>
+ <item> OutputStream </item>
+ <item> OutputStream </item>
+ <item> OutputStream </item>
+ <item> OutputStreamWriter </item>
+ <item> OverlappingFileLockException </item>
+ <item> OverlayLayout </item>
+ <item> Override </item>
+ <item> Owner </item>
+ <item> PBEKey </item>
+ <item> PBEKeySpec </item>
+ <item> PBEParameterSpec </item>
+ <item> PDLOverrideSupported </item>
+ <item> PERSIST_STORE </item>
+ <item> PKCS8EncodedKeySpec </item>
+ <item> PKIXBuilderParameters </item>
+ <item> PKIXCertPathBuilderResult </item>
+ <item> PKIXCertPathChecker </item>
+ <item> PKIXCertPathValidatorResult </item>
+ <item> PKIXParameters </item>
+ <item> POA </item>
+ <item> POAHelper </item>
+ <item> POAManager </item>
+ <item> POAManagerOperations </item>
+ <item> POAOperations </item>
+ <item> PRIVATE_MEMBER </item>
+ <item> PSSParameterSpec </item>
+ <item> PSource </item>
+ <item> PSource.PSpecified </item>
+ <item> PUBLIC_MEMBER </item>
+ <item> Pack200 </item>
+ <item> Pack200.Packer </item>
+ <item> Pack200.Unpacker </item>
+ <item> Package </item>
+ <item> PackedColorModel </item>
+ <item> PageAttributes </item>
+ <item> PageAttributes.ColorType </item>
+ <item> PageAttributes.MediaType </item>
+ <item> PageAttributes.OrientationRequestedType </item>
+ <item> PageAttributes.OriginType </item>
+ <item> PageAttributes.PrintQualityType </item>
+ <item> PageFormat </item>
+ <item> PageRanges </item>
+ <item> Pageable </item>
+ <item> PagedResultsControl </item>
+ <item> PagedResultsResponseControl </item>
+ <item> PagesPerMinute </item>
+ <item> PagesPerMinuteColor </item>
+ <item> Paint </item>
+ <item> PaintContext </item>
+ <item> PaintEvent </item>
+ <item> Panel </item>
+ <item> PanelUI </item>
+ <item> Paper </item>
+ <item> ParagraphView </item>
+ <item> ParagraphView </item>
+ <item> Parameter </item>
+ <item> ParameterBlock </item>
+ <item> ParameterDescriptor </item>
+ <item> ParameterMetaData </item>
+ <item> ParameterMode </item>
+ <item> ParameterModeHelper </item>
+ <item> ParameterModeHolder </item>
+ <item> ParameterizedType </item>
+ <item> ParseException </item>
+ <item> ParsePosition </item>
+ <item> Parser </item>
+ <item> Parser </item>
+ <item> ParserAdapter </item>
+ <item> ParserConfigurationException </item>
+ <item> ParserDelegator </item>
+ <item> ParserFactory </item>
+ <item> PartialResultException </item>
+ <item> PasswordAuthentication </item>
+ <item> PasswordCallback </item>
+ <item> PasswordView </item>
+ <item> Patch </item>
+ <item> PathIterator </item>
+ <item> Pattern </item>
+ <item> PatternSyntaxException </item>
+ <item> Permission </item>
+ <item> Permission </item>
+ <item> PermissionCollection </item>
+ <item> Permissions </item>
+ <item> PersistenceDelegate </item>
+ <item> PersistentMBean </item>
+ <item> PhantomReference </item>
+ <item> Pipe </item>
+ <item> Pipe.SinkChannel </item>
+ <item> Pipe.SourceChannel </item>
+ <item> PipedInputStream </item>
+ <item> PipedOutputStream </item>
+ <item> PipedReader </item>
+ <item> PipedWriter </item>
+ <item> PixelGrabber </item>
+ <item> PixelInterleavedSampleModel </item>
+ <item> PlainDocument </item>
+ <item> PlainView </item>
+ <item> Point </item>
+ <item> Point2D </item>
+ <item> Point2D.Double </item>
+ <item> Point2D.Float </item>
+ <item> PointerInfo </item>
+ <item> Policy </item>
+ <item> Policy </item>
+ <item> Policy </item>
+ <item> PolicyError </item>
+ <item> PolicyErrorCodeHelper </item>
+ <item> PolicyErrorHelper </item>
+ <item> PolicyErrorHolder </item>
+ <item> PolicyFactory </item>
+ <item> PolicyFactoryOperations </item>
+ <item> PolicyHelper </item>
+ <item> PolicyHolder </item>
+ <item> PolicyListHelper </item>
+ <item> PolicyListHolder </item>
+ <item> PolicyNode </item>
+ <item> PolicyOperations </item>
+ <item> PolicyQualifierInfo </item>
+ <item> PolicyTypeHelper </item>
+ <item> Polygon </item>
+ <item> PooledConnection </item>
+ <item> Popup </item>
+ <item> PopupFactory </item>
+ <item> PopupMenu </item>
+ <item> PopupMenuEvent </item>
+ <item> PopupMenuListener </item>
+ <item> PopupMenuUI </item>
+ <item> Port </item>
+ <item> Port.Info </item>
+ <item> PortUnreachableException </item>
+ <item> PortableRemoteObject </item>
+ <item> PortableRemoteObjectDelegate </item>
+ <item> Position </item>
+ <item> Position.Bias </item>
+ <item> Predicate </item>
+ <item> PreferenceChangeEvent </item>
+ <item> PreferenceChangeListener </item>
+ <item> Preferences </item>
+ <item> PreferencesFactory </item>
+ <item> PreparedStatement </item>
+ <item> PresentationDirection </item>
+ <item> Principal </item>
+ <item> Principal </item>
+ <item> PrincipalHolder </item>
+ <item> PrintEvent </item>
+ <item> PrintException </item>
+ <item> PrintGraphics </item>
+ <item> PrintJob </item>
+ <item> PrintJobAdapter </item>
+ <item> PrintJobAttribute </item>
+ <item> PrintJobAttributeEvent </item>
+ <item> PrintJobAttributeListener </item>
+ <item> PrintJobAttributeSet </item>
+ <item> PrintJobEvent </item>
+ <item> PrintJobListener </item>
+ <item> PrintQuality </item>
+ <item> PrintRequestAttribute </item>
+ <item> PrintRequestAttributeSet </item>
+ <item> PrintService </item>
+ <item> PrintServiceAttribute </item>
+ <item> PrintServiceAttributeEvent </item>
+ <item> PrintServiceAttributeListener </item>
+ <item> PrintServiceAttributeSet </item>
+ <item> PrintServiceLookup </item>
+ <item> PrintStream </item>
+ <item> PrintWriter </item>
+ <item> Printable </item>
+ <item> PrinterAbortException </item>
+ <item> PrinterException </item>
+ <item> PrinterGraphics </item>
+ <item> PrinterIOException </item>
+ <item> PrinterInfo </item>
+ <item> PrinterIsAcceptingJobs </item>
+ <item> PrinterJob </item>
+ <item> PrinterLocation </item>
+ <item> PrinterMakeAndModel </item>
+ <item> PrinterMessageFromOperator </item>
+ <item> PrinterMoreInfo </item>
+ <item> PrinterMoreInfoManufacturer </item>
+ <item> PrinterName </item>
+ <item> PrinterResolution </item>
+ <item> PrinterState </item>
+ <item> PrinterStateReason </item>
+ <item> PrinterStateReasons </item>
+ <item> PrinterURI </item>
+ <item> PriorityBlockingQueue </item>
+ <item> PriorityQueue </item>
+ <item> PrivateClassLoader </item>
+ <item> PrivateCredentialPermission </item>
+ <item> PrivateKey </item>
+ <item> PrivateMLet </item>
+ <item> PrivilegedAction </item>
+ <item> PrivilegedActionException </item>
+ <item> PrivilegedExceptionAction </item>
+ <item> Process </item>
+ <item> ProcessBuilder </item>
+ <item> ProcessingInstruction </item>
+ <item> ProfileDataException </item>
+ <item> ProfileIdHelper </item>
+ <item> ProgressBarUI </item>
+ <item> ProgressMonitor </item>
+ <item> ProgressMonitorInputStream </item>
+ <item> Properties </item>
+ <item> PropertyChangeEvent </item>
+ <item> PropertyChangeListener </item>
+ <item> PropertyChangeListenerProxy </item>
+ <item> PropertyChangeSupport </item>
+ <item> PropertyDescriptor </item>
+ <item> PropertyEditor </item>
+ <item> PropertyEditorManager </item>
+ <item> PropertyEditorSupport </item>
+ <item> PropertyPermission </item>
+ <item> PropertyResourceBundle </item>
+ <item> PropertyVetoException </item>
+ <item> ProtectionDomain </item>
+ <item> ProtocolException </item>
+ <item> Provider </item>
+ <item> Provider.Service </item>
+ <item> ProviderException </item>
+ <item> Proxy </item>
+ <item> Proxy </item>
+ <item> Proxy.Type </item>
+ <item> ProxySelector </item>
+ <item> PublicKey </item>
+ <item> PushbackInputStream </item>
+ <item> PushbackReader </item>
+ <item> QName </item>
+ <item> QuadCurve2D </item>
+ <item> QuadCurve2D.Double </item>
+ <item> QuadCurve2D.Float </item>
+ <item> Query </item>
+ <item> QueryEval </item>
+ <item> QueryExp </item>
+ <item> Queue </item>
+ <item> QueuedJobCount </item>
+ <item> RC2ParameterSpec </item>
+ <item> RC5ParameterSpec </item>
+ <item> REBIND </item>
+ <item> REQUEST_PROCESSING_POLICY_ID </item>
+ <item> RGBImageFilter </item>
+ <item> RMIClassLoader </item>
+ <item> RMIClassLoaderSpi </item>
+ <item> RMIClientSocketFactory </item>
+ <item> RMIConnection </item>
+ <item> RMIConnectionImpl </item>
+ <item> RMIConnectionImpl_Stub </item>
+ <item> RMIConnector </item>
+ <item> RMIConnectorServer </item>
+ <item> RMICustomMaxStreamFormat </item>
+ <item> RMIFailureHandler </item>
+ <item> RMIIIOPServerImpl </item>
+ <item> RMIJRMPServerImpl </item>
+ <item> RMISecurityException </item>
+ <item> RMISecurityManager </item>
+ <item> RMIServer </item>
+ <item> RMIServerImpl </item>
+ <item> RMIServerImpl_Stub </item>
+ <item> RMIServerSocketFactory </item>
+ <item> RMISocketFactory </item>
+ <item> RSAKey </item>
+ <item> RSAKeyGenParameterSpec </item>
+ <item> RSAMultiPrimePrivateCrtKey </item>
+ <item> RSAMultiPrimePrivateCrtKeySpec </item>
+ <item> RSAOtherPrimeInfo </item>
+ <item> RSAPrivateCrtKey </item>
+ <item> RSAPrivateCrtKeySpec </item>
+ <item> RSAPrivateKey </item>
+ <item> RSAPrivateKeySpec </item>
+ <item> RSAPublicKey </item>
+ <item> RSAPublicKeySpec </item>
+ <item> RTFEditorKit </item>
+ <item> Random </item>
+ <item> RandomAccess </item>
+ <item> RandomAccessFile </item>
+ <item> Raster </item>
+ <item> RasterFormatException </item>
+ <item> RasterOp </item>
+ <item> Rdn </item>
+ <item> ReadOnlyBufferException </item>
+ <item> ReadWriteLock </item>
+ <item> Readable </item>
+ <item> ReadableByteChannel </item>
+ <item> Reader </item>
+ <item> RealmCallback </item>
+ <item> RealmChoiceCallback </item>
+ <item> Receiver </item>
+ <item> Rectangle </item>
+ <item> Rectangle2D </item>
+ <item> Rectangle2D.Double </item>
+ <item> Rectangle2D.Float </item>
+ <item> RectangularShape </item>
+ <item> ReentrantLock </item>
+ <item> ReentrantReadWriteLock </item>
+ <item> ReentrantReadWriteLock.ReadLock </item>
+ <item> ReentrantReadWriteLock.WriteLock </item>
+ <item> Ref </item>
+ <item> RefAddr </item>
+ <item> Reference </item>
+ <item> Reference </item>
+ <item> ReferenceQueue </item>
+ <item> ReferenceUriSchemesSupported </item>
+ <item> Referenceable </item>
+ <item> ReferralException </item>
+ <item> ReflectPermission </item>
+ <item> ReflectionException </item>
+ <item> RefreshFailedException </item>
+ <item> Refreshable </item>
+ <item> Region </item>
+ <item> RegisterableService </item>
+ <item> Registry </item>
+ <item> RegistryHandler </item>
+ <item> RejectedExecutionException </item>
+ <item> RejectedExecutionHandler </item>
+ <item> Relation </item>
+ <item> RelationException </item>
+ <item> RelationNotFoundException </item>
+ <item> RelationNotification </item>
+ <item> RelationService </item>
+ <item> RelationServiceMBean </item>
+ <item> RelationServiceNotRegisteredException </item>
+ <item> RelationSupport </item>
+ <item> RelationSupportMBean </item>
+ <item> RelationType </item>
+ <item> RelationTypeNotFoundException </item>
+ <item> RelationTypeSupport </item>
+ <item> RemarshalException </item>
+ <item> Remote </item>
+ <item> RemoteCall </item>
+ <item> RemoteException </item>
+ <item> RemoteObject </item>
+ <item> RemoteObjectInvocationHandler </item>
+ <item> RemoteRef </item>
+ <item> RemoteServer </item>
+ <item> RemoteStub </item>
+ <item> RenderContext </item>
+ <item> RenderableImage </item>
+ <item> RenderableImageOp </item>
+ <item> RenderableImageProducer </item>
+ <item> RenderedImage </item>
+ <item> RenderedImageFactory </item>
+ <item> Renderer </item>
+ <item> RenderingHints </item>
+ <item> RenderingHints.Key </item>
+ <item> RepaintManager </item>
+ <item> ReplicateScaleFilter </item>
+ <item> RepositoryIdHelper </item>
+ <item> Request </item>
+ <item> RequestInfo </item>
+ <item> RequestInfoOperations </item>
+ <item> RequestProcessingPolicy </item>
+ <item> RequestProcessingPolicyOperations </item>
+ <item> RequestProcessingPolicyValue </item>
+ <item> RequestingUserName </item>
+ <item> RequiredModelMBean </item>
+ <item> RescaleOp </item>
+ <item> ResolutionSyntax </item>
+ <item> ResolveResult </item>
+ <item> Resolver </item>
+ <item> ResourceBundle </item>
+ <item> ResponseCache </item>
+ <item> ResponseHandler </item>
+ <item> Result </item>
+ <item> ResultSet </item>
+ <item> ResultSetMetaData </item>
+ <item> Retention </item>
+ <item> RetentionPolicy </item>
+ <item> ReverbType </item>
+ <item> Robot </item>
+ <item> Role </item>
+ <item> RoleInfo </item>
+ <item> RoleInfoNotFoundException </item>
+ <item> RoleList </item>
+ <item> RoleNotFoundException </item>
+ <item> RoleResult </item>
+ <item> RoleStatus </item>
+ <item> RoleUnresolved </item>
+ <item> RoleUnresolvedList </item>
+ <item> RootPaneContainer </item>
+ <item> RootPaneUI </item>
+ <item> RoundRectangle2D </item>
+ <item> RoundRectangle2D.Double </item>
+ <item> RoundRectangle2D.Float </item>
+ <item> RoundingMode </item>
+ <item> RowMapper </item>
+ <item> RowSet </item>
+ <item> RowSetEvent </item>
+ <item> RowSetInternal </item>
+ <item> RowSetListener </item>
+ <item> RowSetMetaData </item>
+ <item> RowSetMetaDataImpl </item>
+ <item> RowSetReader </item>
+ <item> RowSetWarning </item>
+ <item> RowSetWriter </item>
+ <item> RuleBasedCollator </item>
+ <item> RunTime </item>
+ <item> RunTimeOperations </item>
+ <item> Runnable </item>
+ <item> Runtime </item>
+ <item> RuntimeErrorException </item>
+ <item> RuntimeException </item>
+ <item> RuntimeMBeanException </item>
+ <item> RuntimeMXBean </item>
+ <item> RuntimeOperationsException </item>
+ <item> RuntimePermission </item>
+ <item> SAXException </item>
+ <item> SAXNotRecognizedException </item>
+ <item> SAXNotSupportedException </item>
+ <item> SAXParseException </item>
+ <item> SAXParser </item>
+ <item> SAXParserFactory </item>
+ <item> SAXResult </item>
+ <item> SAXSource </item>
+ <item> SAXTransformerFactory </item>
+ <item> SERVANT_RETENTION_POLICY_ID </item>
+ <item> SQLData </item>
+ <item> SQLException </item>
+ <item> SQLInput </item>
+ <item> SQLInputImpl </item>
+ <item> SQLOutput </item>
+ <item> SQLOutputImpl </item>
+ <item> SQLPermission </item>
+ <item> SQLWarning </item>
+ <item> SSLContext </item>
+ <item> SSLContextSpi </item>
+ <item> SSLEngine </item>
+ <item> SSLEngineResult </item>
+ <item> SSLEngineResult.HandshakeStatus </item>
+ <item> SSLEngineResult.Status </item>
+ <item> SSLException </item>
+ <item> SSLHandshakeException </item>
+ <item> SSLKeyException </item>
+ <item> SSLPeerUnverifiedException </item>
+ <item> SSLPermission </item>
+ <item> SSLProtocolException </item>
+ <item> SSLServerSocket </item>
+ <item> SSLServerSocketFactory </item>
+ <item> SSLSession </item>
+ <item> SSLSessionBindingEvent </item>
+ <item> SSLSessionBindingListener </item>
+ <item> SSLSessionContext </item>
+ <item> SSLSocket </item>
+ <item> SSLSocketFactory </item>
+ <item> SUCCESSFUL </item>
+ <item> SYNC_WITH_TRANSPORT </item>
+ <item> SYSTEM_EXCEPTION </item>
+ <item> SampleModel </item>
+ <item> Sasl </item>
+ <item> SaslClient </item>
+ <item> SaslClientFactory </item>
+ <item> SaslException </item>
+ <item> SaslServer </item>
+ <item> SaslServerFactory </item>
+ <item> Savepoint </item>
+ <item> Scanner </item>
+ <item> ScatteringByteChannel </item>
+ <item> ScheduledExecutorService </item>
+ <item> ScheduledFuture </item>
+ <item> ScheduledThreadPoolExecutor </item>
+ <item> Schema </item>
+ <item> SchemaFactory </item>
+ <item> SchemaFactoryLoader </item>
+ <item> SchemaViolationException </item>
+ <item> ScrollBarUI </item>
+ <item> ScrollPane </item>
+ <item> ScrollPaneAdjustable </item>
+ <item> ScrollPaneConstants </item>
+ <item> ScrollPaneLayout </item>
+ <item> ScrollPaneLayout.UIResource </item>
+ <item> ScrollPaneUI </item>
+ <item> Scrollable </item>
+ <item> Scrollbar </item>
+ <item> SealedObject </item>
+ <item> SearchControls </item>
+ <item> SearchResult </item>
+ <item> SecretKey </item>
+ <item> SecretKeyFactory </item>
+ <item> SecretKeyFactorySpi </item>
+ <item> SecretKeySpec </item>
+ <item> SecureCacheResponse </item>
+ <item> SecureClassLoader </item>
+ <item> SecureRandom </item>
+ <item> SecureRandomSpi </item>
+ <item> Security </item>
+ <item> SecurityException </item>
+ <item> SecurityManager </item>
+ <item> SecurityPermission </item>
+ <item> Segment </item>
+ <item> SelectableChannel </item>
+ <item> SelectionKey </item>
+ <item> Selector </item>
+ <item> SelectorProvider </item>
+ <item> Semaphore </item>
+ <item> SeparatorUI </item>
+ <item> Sequence </item>
+ <item> SequenceInputStream </item>
+ <item> Sequencer </item>
+ <item> Sequencer.SyncMode </item>
+ <item> SerialArray </item>
+ <item> SerialBlob </item>
+ <item> SerialClob </item>
+ <item> SerialDatalink </item>
+ <item> SerialException </item>
+ <item> SerialJavaObject </item>
+ <item> SerialRef </item>
+ <item> SerialStruct </item>
+ <item> Serializable </item>
+ <item> SerializablePermission </item>
+ <item> Servant </item>
+ <item> ServantActivator </item>
+ <item> ServantActivatorHelper </item>
+ <item> ServantActivatorOperations </item>
+ <item> ServantActivatorPOA </item>
+ <item> ServantAlreadyActive </item>
+ <item> ServantAlreadyActiveHelper </item>
+ <item> ServantLocator </item>
+ <item> ServantLocatorHelper </item>
+ <item> ServantLocatorOperations </item>
+ <item> ServantLocatorPOA </item>
+ <item> ServantManager </item>
+ <item> ServantManagerOperations </item>
+ <item> ServantNotActive </item>
+ <item> ServantNotActiveHelper </item>
+ <item> ServantObject </item>
+ <item> ServantRetentionPolicy </item>
+ <item> ServantRetentionPolicyOperations </item>
+ <item> ServantRetentionPolicyValue </item>
+ <item> ServerCloneException </item>
+ <item> ServerError </item>
+ <item> ServerException </item>
+ <item> ServerIdHelper </item>
+ <item> ServerNotActiveException </item>
+ <item> ServerRef </item>
+ <item> ServerRequest </item>
+ <item> ServerRequestInfo </item>
+ <item> ServerRequestInfoOperations </item>
+ <item> ServerRequestInterceptor </item>
+ <item> ServerRequestInterceptorOperations </item>
+ <item> ServerRuntimeException </item>
+ <item> ServerSocket </item>
+ <item> ServerSocketChannel </item>
+ <item> ServerSocketFactory </item>
+ <item> ServiceContext </item>
+ <item> ServiceContextHelper </item>
+ <item> ServiceContextHolder </item>
+ <item> ServiceContextListHelper </item>
+ <item> ServiceContextListHolder </item>
+ <item> ServiceDetail </item>
+ <item> ServiceDetailHelper </item>
+ <item> ServiceIdHelper </item>
+ <item> ServiceInformation </item>
+ <item> ServiceInformationHelper </item>
+ <item> ServiceInformationHolder </item>
+ <item> ServiceNotFoundException </item>
+ <item> ServicePermission </item>
+ <item> ServiceRegistry </item>
+ <item> ServiceRegistry.Filter </item>
+ <item> ServiceUI </item>
+ <item> ServiceUIFactory </item>
+ <item> ServiceUnavailableException </item>
+ <item> Set </item>
+ <item> SetOfIntegerSyntax </item>
+ <item> SetOverrideType </item>
+ <item> SetOverrideTypeHelper </item>
+ <item> Severity </item>
+ <item> Shape </item>
+ <item> ShapeGraphicAttribute </item>
+ <item> SheetCollate </item>
+ <item> Short </item>
+ <item> ShortBuffer </item>
+ <item> ShortBufferException </item>
+ <item> ShortHolder </item>
+ <item> ShortLookupTable </item>
+ <item> ShortMessage </item>
+ <item> ShortSeqHelper </item>
+ <item> ShortSeqHolder </item>
+ <item> Sides </item>
+ <item> Signature </item>
+ <item> SignatureException </item>
+ <item> SignatureSpi </item>
+ <item> SignedObject </item>
+ <item> Signer </item>
+ <item> SimpleAttributeSet </item>
+ <item> SimpleBeanInfo </item>
+ <item> SimpleDateFormat </item>
+ <item> SimpleDoc </item>
+ <item> SimpleFormatter </item>
+ <item> SimpleTimeZone </item>
+ <item> SimpleType </item>
+ <item> SinglePixelPackedSampleModel </item>
+ <item> SingleSelectionModel </item>
+ <item> Size2DSyntax </item>
+ <item> SizeLimitExceededException </item>
+ <item> SizeRequirements </item>
+ <item> SizeSequence </item>
+ <item> Skeleton </item>
+ <item> SkeletonMismatchException </item>
+ <item> SkeletonNotFoundException </item>
+ <item> SliderUI </item>
+ <item> Socket </item>
+ <item> SocketAddress </item>
+ <item> SocketChannel </item>
+ <item> SocketException </item>
+ <item> SocketFactory </item>
+ <item> SocketHandler </item>
+ <item> SocketImpl </item>
+ <item> SocketImplFactory </item>
+ <item> SocketOptions </item>
+ <item> SocketPermission </item>
+ <item> SocketSecurityException </item>
+ <item> SocketTimeoutException </item>
+ <item> SoftBevelBorder </item>
+ <item> SoftReference </item>
+ <item> SortControl </item>
+ <item> SortKey </item>
+ <item> SortResponseControl </item>
+ <item> SortedMap </item>
+ <item> SortedSet </item>
+ <item> SortingFocusTraversalPolicy </item>
+ <item> Soundbank </item>
+ <item> SoundbankReader </item>
+ <item> SoundbankResource </item>
+ <item> Source </item>
+ <item> SourceDataLine </item>
+ <item> SourceLocator </item>
+ <item> SpinnerDateModel </item>
+ <item> SpinnerListModel </item>
+ <item> SpinnerModel </item>
+ <item> SpinnerNumberModel </item>
+ <item> SpinnerUI </item>
+ <item> SplitPaneUI </item>
+ <item> Spring </item>
+ <item> SpringLayout </item>
+ <item> SpringLayout.Constraints </item>
+ <item> SslRMIClientSocketFactory </item>
+ <item> SslRMIServerSocketFactory </item>
+ <item> Stack </item>
+ <item> StackOverflowError </item>
+ <item> StackTraceElement </item>
+ <item> StandardMBean </item>
+ <item> StartTlsRequest </item>
+ <item> StartTlsResponse </item>
+ <item> State </item>
+ <item> StateEdit </item>
+ <item> StateEditable </item>
+ <item> StateFactory </item>
+ <item> Statement </item>
+ <item> Statement </item>
+ <item> StreamCorruptedException </item>
+ <item> StreamHandler </item>
+ <item> StreamPrintService </item>
+ <item> StreamPrintServiceFactory </item>
+ <item> StreamResult </item>
+ <item> StreamSource </item>
+ <item> StreamTokenizer </item>
+ <item> Streamable </item>
+ <item> StreamableValue </item>
+ <item> StrictMath </item>
+ <item> String </item>
+ <item> StringBuffer </item>
+ <item> StringBufferInputStream </item>
+ <item> StringBuilder </item>
+ <item> StringCharacterIterator </item>
+ <item> StringContent </item>
+ <item> StringHolder </item>
+ <item> StringIndexOutOfBoundsException </item>
+ <item> StringMonitor </item>
+ <item> StringMonitorMBean </item>
+ <item> StringNameHelper </item>
+ <item> StringReader </item>
+ <item> StringRefAddr </item>
+ <item> StringSelection </item>
+ <item> StringSeqHelper </item>
+ <item> StringSeqHolder </item>
+ <item> StringTokenizer </item>
+ <item> StringValueExp </item>
+ <item> StringValueHelper </item>
+ <item> StringWriter </item>
+ <item> Stroke </item>
+ <item> Struct </item>
+ <item> StructMember </item>
+ <item> StructMemberHelper </item>
+ <item> Stub </item>
+ <item> StubDelegate </item>
+ <item> StubNotFoundException </item>
+ <item> Style </item>
+ <item> StyleConstants </item>
+ <item> StyleConstants.CharacterConstants </item>
+ <item> StyleConstants.ColorConstants </item>
+ <item> StyleConstants.FontConstants </item>
+ <item> StyleConstants.ParagraphConstants </item>
+ <item> StyleContext </item>
+ <item> StyleSheet </item>
+ <item> StyleSheet.BoxPainter </item>
+ <item> StyleSheet.ListPainter </item>
+ <item> StyledDocument </item>
+ <item> StyledEditorKit </item>
+ <item> StyledEditorKit.AlignmentAction </item>
+ <item> StyledEditorKit.BoldAction </item>
+ <item> StyledEditorKit.FontFamilyAction </item>
+ <item> StyledEditorKit.FontSizeAction </item>
+ <item> StyledEditorKit.ForegroundAction </item>
+ <item> StyledEditorKit.ItalicAction </item>
+ <item> StyledEditorKit.StyledTextAction </item>
+ <item> StyledEditorKit.UnderlineAction </item>
+ <item> Subject </item>
+ <item> SubjectDelegationPermission </item>
+ <item> SubjectDomainCombiner </item>
+ <item> SupportedValuesAttribute </item>
+ <item> SuppressWarnings </item>
+ <item> SwingConstants </item>
+ <item> SwingPropertyChangeSupport </item>
+ <item> SwingUtilities </item>
+ <item> SyncFactory </item>
+ <item> SyncFactoryException </item>
+ <item> SyncFailedException </item>
+ <item> SyncProvider </item>
+ <item> SyncProviderException </item>
+ <item> SyncResolver </item>
+ <item> SyncScopeHelper </item>
+ <item> SynchronousQueue </item>
+ <item> SynthConstants </item>
+ <item> SynthContext </item>
+ <item> SynthGraphicsUtils </item>
+ <item> SynthLookAndFeel </item>
+ <item> SynthPainter </item>
+ <item> SynthStyle </item>
+ <item> SynthStyleFactory </item>
+ <item> Synthesizer </item>
+ <item> SysexMessage </item>
+ <item> System </item>
+ <item> SystemColor </item>
+ <item> SystemException </item>
+ <item> SystemFlavorMap </item>
+ <item> TAG_ALTERNATE_IIOP_ADDRESS </item>
+ <item> TAG_CODE_SETS </item>
+ <item> TAG_INTERNET_IOP </item>
+ <item> TAG_JAVA_CODEBASE </item>
+ <item> TAG_MULTIPLE_COMPONENTS </item>
+ <item> TAG_ORB_TYPE </item>
+ <item> TAG_POLICIES </item>
+ <item> TAG_RMI_CUSTOM_MAX_STREAM_FORMAT </item>
+ <item> TCKind </item>
+ <item> THREAD_POLICY_ID </item>
+ <item> TIMEOUT </item>
+ <item> TRANSACTION_MODE </item>
+ <item> TRANSACTION_REQUIRED </item>
+ <item> TRANSACTION_ROLLEDBACK </item>
+ <item> TRANSACTION_UNAVAILABLE </item>
+ <item> TRANSIENT </item>
+ <item> TRANSPORT_RETRY </item>
+ <item> TabExpander </item>
+ <item> TabSet </item>
+ <item> TabStop </item>
+ <item> TabableView </item>
+ <item> TabbedPaneUI </item>
+ <item> TableCellEditor </item>
+ <item> TableCellRenderer </item>
+ <item> TableColumn </item>
+ <item> TableColumnModel </item>
+ <item> TableColumnModelEvent </item>
+ <item> TableColumnModelListener </item>
+ <item> TableHeaderUI </item>
+ <item> TableModel </item>
+ <item> TableModelEvent </item>
+ <item> TableModelListener </item>
+ <item> TableUI </item>
+ <item> TableView </item>
+ <item> TabularData </item>
+ <item> TabularDataSupport </item>
+ <item> TabularType </item>
+ <item> TagElement </item>
+ <item> TaggedComponent </item>
+ <item> TaggedComponentHelper </item>
+ <item> TaggedComponentHolder </item>
+ <item> TaggedProfile </item>
+ <item> TaggedProfileHelper </item>
+ <item> TaggedProfileHolder </item>
+ <item> Target </item>
+ <item> TargetDataLine </item>
+ <item> TargetedNotification </item>
+ <item> Templates </item>
+ <item> TemplatesHandler </item>
+ <item> Text </item>
+ <item> TextAction </item>
+ <item> TextArea </item>
+ <item> TextAttribute </item>
+ <item> TextComponent </item>
+ <item> TextEvent </item>
+ <item> TextField </item>
+ <item> TextHitInfo </item>
+ <item> TextInputCallback </item>
+ <item> TextLayout </item>
+ <item> TextLayout.CaretPolicy </item>
+ <item> TextListener </item>
+ <item> TextMeasurer </item>
+ <item> TextOutputCallback </item>
+ <item> TextSyntax </item>
+ <item> TextUI </item>
+ <item> TexturePaint </item>
+ <item> Thread </item>
+ <item> Thread.State </item>
+ <item> Thread.UncaughtExceptionHandler </item>
+ <item> ThreadDeath </item>
+ <item> ThreadFactory </item>
+ <item> ThreadGroup </item>
+ <item> ThreadInfo </item>
+ <item> ThreadLocal </item>
+ <item> ThreadMXBean </item>
+ <item> ThreadPolicy </item>
+ <item> ThreadPolicyOperations </item>
+ <item> ThreadPolicyValue </item>
+ <item> ThreadPoolExecutor </item>
+ <item> ThreadPoolExecutor.AbortPolicy </item>
+ <item> ThreadPoolExecutor.CallerRunsPolicy </item>
+ <item> ThreadPoolExecutor.DiscardOldestPolicy </item>
+ <item> ThreadPoolExecutor.DiscardPolicy </item>
+ <item> Throwable </item>
+ <item> Tie </item>
+ <item> TileObserver </item>
+ <item> Time </item>
+ <item> TimeLimitExceededException </item>
+ <item> TimeUnit </item>
+ <item> TimeZone </item>
+ <item> TimeoutException </item>
+ <item> Timer </item>
+ <item> Timer </item>
+ <item> Timer </item>
+ <item> TimerAlarmClockNotification </item>
+ <item> TimerMBean </item>
+ <item> TimerNotification </item>
+ <item> TimerTask </item>
+ <item> Timestamp </item>
+ <item> Timestamp </item>
+ <item> TitledBorder </item>
+ <item> TooManyListenersException </item>
+ <item> ToolBarUI </item>
+ <item> ToolTipManager </item>
+ <item> ToolTipUI </item>
+ <item> Toolkit </item>
+ <item> Track </item>
+ <item> TransactionRequiredException </item>
+ <item> TransactionRolledbackException </item>
+ <item> TransactionService </item>
+ <item> TransactionalWriter </item>
+ <item> TransferHandler </item>
+ <item> Transferable </item>
+ <item> TransformAttribute </item>
+ <item> Transformer </item>
+ <item> TransformerConfigurationException </item>
+ <item> TransformerException </item>
+ <item> TransformerFactory </item>
+ <item> TransformerFactoryConfigurationError </item>
+ <item> TransformerHandler </item>
+ <item> Transmitter </item>
+ <item> Transparency </item>
+ <item> TreeCellEditor </item>
+ <item> TreeCellRenderer </item>
+ <item> TreeExpansionEvent </item>
+ <item> TreeExpansionListener </item>
+ <item> TreeMap </item>
+ <item> TreeModel </item>
+ <item> TreeModelEvent </item>
+ <item> TreeModelListener </item>
+ <item> TreeNode </item>
+ <item> TreePath </item>
+ <item> TreeSelectionEvent </item>
+ <item> TreeSelectionListener </item>
+ <item> TreeSelectionModel </item>
+ <item> TreeSet </item>
+ <item> TreeUI </item>
+ <item> TreeWillExpandListener </item>
+ <item> TrustAnchor </item>
+ <item> TrustManager </item>
+ <item> TrustManagerFactory </item>
+ <item> TrustManagerFactorySpi </item>
+ <item> Type </item>
+ <item> TypeCode </item>
+ <item> TypeCodeHolder </item>
+ <item> TypeInfo </item>
+ <item> TypeInfoProvider </item>
+ <item> TypeMismatch </item>
+ <item> TypeMismatch </item>
+ <item> TypeMismatch </item>
+ <item> TypeMismatchHelper </item>
+ <item> TypeMismatchHelper </item>
+ <item> TypeNotPresentException </item>
+ <item> TypeVariable </item>
+ <item> Types </item>
+ <item> UID </item>
+ <item> UIDefaults </item>
+ <item> UIDefaults.ActiveValue </item>
+ <item> UIDefaults.LazyInputMap </item>
+ <item> UIDefaults.LazyValue </item>
+ <item> UIDefaults.ProxyLazyValue </item>
+ <item> UIManager </item>
+ <item> UIManager.LookAndFeelInfo </item>
+ <item> UIResource </item>
+ <item> ULongLongSeqHelper </item>
+ <item> ULongLongSeqHolder </item>
+ <item> ULongSeqHelper </item>
+ <item> ULongSeqHolder </item>
+ <item> UNKNOWN </item>
+ <item> UNKNOWN </item>
+ <item> UNSUPPORTED_POLICY </item>
+ <item> UNSUPPORTED_POLICY_VALUE </item>
+ <item> URI </item>
+ <item> URIException </item>
+ <item> URIResolver </item>
+ <item> URISyntax </item>
+ <item> URISyntaxException </item>
+ <item> URL </item>
+ <item> URLClassLoader </item>
+ <item> URLConnection </item>
+ <item> URLDecoder </item>
+ <item> URLEncoder </item>
+ <item> URLStreamHandler </item>
+ <item> URLStreamHandlerFactory </item>
+ <item> URLStringHelper </item>
+ <item> USER_EXCEPTION </item>
+ <item> UShortSeqHelper </item>
+ <item> UShortSeqHolder </item>
+ <item> UTFDataFormatException </item>
+ <item> UUID </item>
+ <item> UndeclaredThrowableException </item>
+ <item> UndoManager </item>
+ <item> UndoableEdit </item>
+ <item> UndoableEditEvent </item>
+ <item> UndoableEditListener </item>
+ <item> UndoableEditSupport </item>
+ <item> UnexpectedException </item>
+ <item> UnicastRemoteObject </item>
+ <item> UnionMember </item>
+ <item> UnionMemberHelper </item>
+ <item> UnknownEncoding </item>
+ <item> UnknownEncodingHelper </item>
+ <item> UnknownError </item>
+ <item> UnknownException </item>
+ <item> UnknownFormatConversionException </item>
+ <item> UnknownFormatFlagsException </item>
+ <item> UnknownGroupException </item>
+ <item> UnknownHostException </item>
+ <item> UnknownHostException </item>
+ <item> UnknownObjectException </item>
+ <item> UnknownServiceException </item>
+ <item> UnknownUserException </item>
+ <item> UnknownUserExceptionHelper </item>
+ <item> UnknownUserExceptionHolder </item>
+ <item> UnmappableCharacterException </item>
+ <item> UnmarshalException </item>
+ <item> UnmodifiableClassException </item>
+ <item> UnmodifiableSetException </item>
+ <item> UnrecoverableEntryException </item>
+ <item> UnrecoverableKeyException </item>
+ <item> Unreferenced </item>
+ <item> UnresolvedAddressException </item>
+ <item> UnresolvedPermission </item>
+ <item> UnsatisfiedLinkError </item>
+ <item> UnsolicitedNotification </item>
+ <item> UnsolicitedNotificationEvent </item>
+ <item> UnsolicitedNotificationListener </item>
+ <item> UnsupportedAddressTypeException </item>
+ <item> UnsupportedAudioFileException </item>
+ <item> UnsupportedCallbackException </item>
+ <item> UnsupportedCharsetException </item>
+ <item> UnsupportedClassVersionError </item>
+ <item> UnsupportedEncodingException </item>
+ <item> UnsupportedFlavorException </item>
+ <item> UnsupportedLookAndFeelException </item>
+ <item> UnsupportedOperationException </item>
+ <item> UserDataHandler </item>
+ <item> UserException </item>
+ <item> Util </item>
+ <item> UtilDelegate </item>
+ <item> Utilities </item>
+ <item> VMID </item>
+ <item> VM_ABSTRACT </item>
+ <item> VM_CUSTOM </item>
+ <item> VM_NONE </item>
+ <item> VM_TRUNCATABLE </item>
+ <item> Validator </item>
+ <item> ValidatorHandler </item>
+ <item> ValueBase </item>
+ <item> ValueBaseHelper </item>
+ <item> ValueBaseHolder </item>
+ <item> ValueExp </item>
+ <item> ValueFactory </item>
+ <item> ValueHandler </item>
+ <item> ValueHandlerMultiFormat </item>
+ <item> ValueInputStream </item>
+ <item> ValueMember </item>
+ <item> ValueMemberHelper </item>
+ <item> ValueOutputStream </item>
+ <item> VariableHeightLayoutCache </item>
+ <item> Vector </item>
+ <item> VerifyError </item>
+ <item> VersionSpecHelper </item>
+ <item> VetoableChangeListener </item>
+ <item> VetoableChangeListenerProxy </item>
+ <item> VetoableChangeSupport </item>
+ <item> View </item>
+ <item> ViewFactory </item>
+ <item> ViewportLayout </item>
+ <item> ViewportUI </item>
+ <item> VirtualMachineError </item>
+ <item> Visibility </item>
+ <item> VisibilityHelper </item>
+ <item> VoiceStatus </item>
+ <item> Void </item>
+ <item> VolatileImage </item>
+ <item> WCharSeqHelper </item>
+ <item> WCharSeqHolder </item>
+ <item> WStringSeqHelper </item>
+ <item> WStringSeqHolder </item>
+ <item> WStringValueHelper </item>
+ <item> WeakHashMap </item>
+ <item> WeakReference </item>
+ <item> WebRowSet </item>
+ <item> WildcardType </item>
+ <item> Window </item>
+ <item> WindowAdapter </item>
+ <item> WindowConstants </item>
+ <item> WindowEvent </item>
+ <item> WindowFocusListener </item>
+ <item> WindowListener </item>
+ <item> WindowStateListener </item>
+ <item> WrappedPlainView </item>
+ <item> WritableByteChannel </item>
+ <item> WritableRaster </item>
+ <item> WritableRenderedImage </item>
+ <item> WriteAbortedException </item>
+ <item> Writer </item>
+ <item> WrongAdapter </item>
+ <item> WrongAdapterHelper </item>
+ <item> WrongPolicy </item>
+ <item> WrongPolicyHelper </item>
+ <item> WrongTransaction </item>
+ <item> WrongTransactionHelper </item>
+ <item> WrongTransactionHolder </item>
+ <item> X500Principal </item>
+ <item> X500PrivateCredential </item>
+ <item> X509CRL </item>
+ <item> X509CRLEntry </item>
+ <item> X509CRLSelector </item>
+ <item> X509CertSelector </item>
+ <item> X509Certificate </item>
+ <item> X509Certificate </item>
+ <item> X509EncodedKeySpec </item>
+ <item> X509ExtendedKeyManager </item>
+ <item> X509Extension </item>
+ <item> X509KeyManager </item>
+ <item> X509TrustManager </item>
+ <item> XAConnection </item>
+ <item> XADataSource </item>
+ <item> XAException </item>
+ <item> XAResource </item>
+ <item> XMLConstants </item>
+ <item> XMLDecoder </item>
+ <item> XMLEncoder </item>
+ <item> XMLFilter </item>
+ <item> XMLFilterImpl </item>
+ <item> XMLFormatter </item>
+ <item> XMLGregorianCalendar </item>
+ <item> XMLParseException </item>
+ <item> XMLReader </item>
+ <item> XMLReaderAdapter </item>
+ <item> XMLReaderFactory </item>
+ <item> XPath </item>
+ <item> XPathConstants </item>
+ <item> XPathException </item>
+ <item> XPathExpression </item>
+ <item> XPathExpressionException </item>
+ <item> XPathFactory </item>
+ <item> XPathFactoryConfigurationException </item>
+ <item> XPathFunction </item>
+ <item> XPathFunctionException </item>
+ <item> XPathFunctionResolver </item>
+ <item> XPathVariableResolver </item>
+ <item> Xid </item>
+ <item> XmlReader </item>
+ <item> XmlWriter </item>
+ <item> ZipEntry </item>
+ <item> ZipException </item>
+ <item> ZipFile </item>
+ <item> ZipInputStream </item>
+ <item> ZipOutputStream </item>
+ <item> ZoneView </item>
+ <item> _BindingIteratorImplBase </item>
+ <item> _BindingIteratorStub </item>
+ <item> _DynAnyFactoryStub </item>
+ <item> _DynAnyStub </item>
+ <item> _DynArrayStub </item>
+ <item> _DynEnumStub </item>
+ <item> _DynFixedStub </item>
+ <item> _DynSequenceStub </item>
+ <item> _DynStructStub </item>
+ <item> _DynUnionStub </item>
+ <item> _DynValueStub </item>
+ <item> _IDLTypeStub </item>
+ <item> _NamingContextExtStub </item>
+ <item> _NamingContextImplBase </item>
+ <item> _NamingContextStub </item>
+ <item> _PolicyStub </item>
+ <item> _Remote_Stub </item>
+ <item> _ServantActivatorStub </item>
+ <item> _ServantLocatorStub </item>
+ </list>
+ <list name="keywords">
+ <item> abstract </item>
+ <item> break </item>
+ <item> case </item>
+ <item> catch </item>
+ <item> class </item>
+ <item> continue </item>
+ <item> default </item>
+ <item> do </item>
+ <item> else </item>
+ <item> enum </item>
+ <item> extends </item>
+ <item> false </item>
+ <item> finally </item>
+ <item> for </item>
+ <item> goto </item>
+ <item> if </item>
+ <item> implements </item>
+ <item> instanceof </item>
+ <item> @interface </item>
+ <item> interface </item>
+ <item> native </item>
+ <item> new </item>
+ <item> null </item>
+ <item> private </item>
+ <item> protected </item>
+ <item> public </item>
+ <item> return </item>
+ <item> super </item>
+ <item> strictfp </item>
+ <item> switch </item>
+ <item> synchronized </item>
+ <item> this </item>
+ <item> throws </item>
+ <item> throw </item>
+ <item> transient </item>
+ <item> true </item>
+ <item> try </item>
+ <item> volatile </item>
+ <item> while </item>
+ </list>
+ <list name="types">
+ <item> boolean </item>
+ <item> byte </item>
+ <item> char </item>
+ <item> const </item>
+ <item> double </item>
+ <item> final </item>
+ <item> float </item>
+ <item> int </item>
+ <item> long </item>
+ <item> short </item>
+ <item> static </item>
+ <item> void </item>
+ </list>
+ <contexts>
+ <context attribute="Normal Text" lineEndContext="#stay" name="Normal">
+ <!-- Comment next line if you don't use Javadoc tool -->
+ <IncludeRules context="##Javadoc"/>
+ <keyword attribute="Keyword" context="#stay" String="keywords"/>
+ <keyword attribute="Data Type" context="#stay" String="types"/>
+ <keyword attribute="Java15" context="#stay" String="java15"/>
+ <Float attribute="Float" context="#stay">
+ <AnyChar String="fF" attribute="Float" context="#stay"/>
+ </Float>
+ <HlCOct attribute="Octal" context="#stay"/>
+ <HlCHex attribute="Hex" context="#stay"/>
+ <Int attribute="Decimal" context="#stay">
+ <StringDetect attribute="Decimal" context="#stay" String="ULL" insensitive="TRUE"/>
+ <StringDetect attribute="Decimal" context="#stay" String="LUL" insensitive="TRUE"/>
+ <StringDetect attribute="Decimal" context="#stay" String="LLU" insensitive="TRUE"/>
+ <StringDetect attribute="Decimal" context="#stay" String="UL" insensitive="TRUE"/>
+ <StringDetect attribute="Decimal" context="#stay" String="LU" insensitive="TRUE"/>
+ <StringDetect attribute="Decimal" context="#stay" String="LL" insensitive="TRUE"/>
+ <StringDetect attribute="Decimal" context="#stay" String="U" insensitive="TRUE"/>
+ <StringDetect attribute="Decimal" context="#stay" String="L" insensitive="TRUE"/>
+ </Int>
+ <HlCChar attribute="Char" context="#stay"/>
+ <RegExpr attribute="Decimal" context="#stay" String="//\s*BEGIN.*$" beginRegion="Region1"/>
+ <RegExpr attribute="Decimal" context="#stay" String="//\s*END.*$" endRegion="Region1"/>
+ <DetectChar attribute="String" context="String" char="&quot;"/>
+ <RegExpr attribute="Function" context="Printf" String="\.(format|printf)\b" />
+ <Detect2Chars attribute="Comment" context="Commentar 1" char="/" char1="/"/>
+ <Detect2Chars attribute="Comment" context="Commentar 2" char="/" char1="*" beginRegion="Comment"/>
+ <DetectChar attribute="Symbol" context="#stay" char="{" beginRegion="Brace1"/>
+ <DetectChar attribute="Symbol" context="#stay" char="}" endRegion="Brace1"/>
+ <RegExpr attribute="Keyword" context="#stay" String="\.{3,3}\s+" />
+ <RegExpr attribute="Keyword" context="StaticImports" String="\b(import\s+static)\b" />
+ <RegExpr attribute="Keyword" context="Imports" String="\b(package|import)\b" />
+ <RegExpr attribute="Function" context="#stay" String="\b[_\w][_\w\d]*(?=[\s]*(/\*\s*\d+\s*\*/\s*)?[(])" />
+ <RegExpr attribute="Symbol" context="Member" String="[.]{1,1}" />
+ <AnyChar attribute="Symbol" context="#stay" String=":!%&amp;()+,-/.*&lt;=&gt;?[]|~^&#59;"/>
+ </context>
+ <context attribute="String" lineEndContext="#pop" name="String">
+ <LineContinue attribute="String" context="#stay"/>
+ <HlCStringChar attribute="String Char" context="#stay"/>
+ <DetectChar attribute="String" context="#pop" char="&quot;"/>
+ </context>
+ <context attribute="Printf" lineEndContext="#pop" name="Printf">
+ <DetectChar attribute="Normal Text" context="#pop" char="&#059;" />
+ <DetectChar attribute="String" context="PrintfString" char="&quot;"/>
+ </context>
+ <context attribute="PrintfString" lineEndContext="#pop" name="PrintfString">
+ <LineContinue attribute="String" context="#stay"/>
+ <HlCStringChar attribute="String Char" context="#stay"/>
+ <DetectChar attribute="String" context="#pop" char="&quot;"/>
+ <RegExpr attribute="String Char" context="#stay" String="%(\d+\$)?(-|#|\+|\ |0|,|\()*\d*(\.\d+)?[a-hosxA-CEGHSX]" />
+ <RegExpr attribute="String Char" context="#stay" String="%(\d+\$)?(-|#|\+|\ |0|,|\()*\d*(t|T)(a|A|b|B|c|C|d|D|e|F|h|H|I|j|k|l|L|m|M|N|p|P|Q|r|R|s|S|T|y|Y|z|Z)" />
+ <RegExpr attribute="String Char" context="#stay" String="%(%|n)" />
+ </context>
+ <context attribute="Normal Text" lineEndContext="#pop" name="Member" fallthrough="true" fallthroughContext="#pop">
+ <RegExpr attribute="Function" context="#pop" String="\b[_a-zA-Z]\w*(?=[\s]*)" />
+ </context>
+ <context attribute="Normal Text" lineEndContext="#pop" name="StaticImports">
+ <RegExpr attribute="StaticImports" context="#pop" String="\s*.*;" />
+ </context>
+ <context attribute="Normal Text" lineEndContext="#pop" name="Imports">
+ <RegExpr attribute="Imports" context="#pop" String="\s*.*;" />
+ </context>
+ <context attribute="Comment" lineEndContext="#pop" name="Commentar 1"/>
+ <context attribute="Comment" lineEndContext="#stay" name="Commentar 2">
+ <Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" endRegion="Comment"/>
+ </context>
+ </contexts>
+ <itemDatas>
+ <itemData name="Normal Text" defStyleNum="dsNormal"/>
+ <itemData name="Keyword" defStyleNum="dsKeyword"/>
+ <itemData name="Function" defStyleNum="dsFunction"/>
+ <itemData name="StaticImports" defStyleNum="dsKeyword" color="#800080" selColor="#FFFFFF" bold="0" italic="0"/>
+ <itemData name="Imports" defStyleNum="dsKeyword" color="#808000" selColor="#FFFFFF" bold="0" italic="0"/>
+ <itemData name="Data Type" defStyleNum="dsDataType"/>
+ <itemData name="Decimal" defStyleNum="dsDecVal"/>
+ <itemData name="Octal" defStyleNum="dsBaseN"/>
+ <itemData name="Hex" defStyleNum="dsBaseN"/>
+ <itemData name="Float" defStyleNum="dsFloat"/>
+ <itemData name="Char" defStyleNum="dsChar"/>
+ <itemData name="String" defStyleNum="dsString"/>
+ <itemData name="String Char" defStyleNum="dsChar"/>
+ <itemData name="PrintfString" defStyleNum="dsString"/>
+ <itemData name="Comment" defStyleNum="dsComment"/>
+ <itemData name="Symbol" defStyleNum="dsNormal"/>
+ <itemData name="Java15" defStyleNum="dsNormal" color="#0095FF" selColor="#FFFFFF" bold="1" italic="0"/>
+ </itemDatas>
+ </highlighting>
+ <general>
+ <comments>
+ <comment name="singleLine" start="//"/>
+ <comment name="multiLine" start="/*" end="*/"/>
+ </comments>
+ <keywords casesensitive="1"/>
+ </general>
+</language>
diff --git a/kate/data/javadoc.xml b/kate/data/javadoc.xml
new file mode 100644
index 000000000..5a89247c4
--- /dev/null
+++ b/kate/data/javadoc.xml
@@ -0,0 +1,107 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+<language name="Javadoc" version="1.03" kateversion="2.4" section="Markup" extensions="" license="LGPL" author="Alfredo Luiz Foltran Fialho (alfoltran@ig.com.br)">
+ <highlighting>
+ <contexts>
+ <context name="Start" attribute="Normal Text" lineEndContext="#stay">
+ <IncludeRules context="FindJavadoc" />
+ </context>
+ <context name="FindJavadoc" attribute="Normal Text" lineEndContext="#stay">
+ <StringDetect attribute="JavadocFS" context="JavadocFSar" String="/**" beginRegion="Javadoc"/>
+ </context>
+ <context attribute="JavadocFS" lineEndContext="#stay" name="JavadocFSar">
+ <Detect2Chars attribute="JavadocFS" context="#pop" char="*" char1="/" endRegion="Javadoc"/>
+ <RegExpr attribute="JavadocFS" context="Javadocar" String="(!|\?)" />
+ <RegExpr attribute="JavadocFS" context="Javadocar" String="(\.\s*$)" />
+ <RegExpr attribute="JavadocFS" context="Javadocar" String="(\.\s)(?![\da-z])" />
+ <RegExpr attribute="JavadocFS" context="Javadocar" String="\**\s*(?=@(author|deprecated|exception|param|return|see|serial|serialData|serialField|since|throws|version)(\s|$))" firstNonSpace="true"/>
+ <StringDetect attribute="InlineTag" context="LiteralTagar" String="{@code " />
+ <StringDetect attribute="InlineTag" context="LiteralTagar" String="{@code&#009;" />
+ <StringDetect attribute="InlineTag" context="#stay" String="{@docRoot}" />
+ <StringDetect attribute="InlineTag" context="#stay" String="{@inheritDoc}" />
+ <StringDetect attribute="InlineTag" context="InlineTagar" String="{@link " />
+ <StringDetect attribute="InlineTag" context="InlineTagar" String="{@link&#009;" />
+ <StringDetect attribute="InlineTag" context="InlineTagar" String="{@linkplain " />
+ <StringDetect attribute="InlineTag" context="InlineTagar" String="{@linkplain&#009;" />
+ <StringDetect attribute="InlineTag" context="LiteralTagar" String="{@literal " />
+ <StringDetect attribute="InlineTag" context="LiteralTagar" String="{@literal&#009;" />
+ <StringDetect attribute="InlineTag" context="#stay" String="{@value}" />
+ <StringDetect attribute="InlineTag" context="InlineTagar" String="{@value " />
+ <StringDetect attribute="InlineTag" context="InlineTagar" String="{@value&#009;" />
+ <IncludeRules context="##HTML"/>
+ </context>
+ <context attribute="Javadoc" lineEndContext="#stay" name="Javadocar">
+ <Detect2Chars attribute="JavadocFS" context="#pop#pop" char="*" char1="/" endRegion="Javadoc"/>
+ <RegExpr attribute="JavadocFS" context="#stay" String="\*+(?!/)" firstNonSpace="true"/>
+ <StringDetect attribute="BlockTag" context="#stay" String="@author " />
+ <StringDetect attribute="BlockTag" context="#stay" String="@deprecated " />
+ <StringDetect attribute="BlockTag" context="JavadocParam" String="@exception " />
+ <StringDetect attribute="BlockTag" context="JavadocParam" String="@param " />
+ <StringDetect attribute="BlockTag" context="#stay" String="@return " />
+ <StringDetect attribute="BlockTag" context="SeeTag" String="@see "/>
+ <StringDetect attribute="BlockTag" context="#stay" String="@serial " />
+ <StringDetect attribute="BlockTag" context="#stay" String="@serialData " />
+ <StringDetect attribute="BlockTag" context="#stay" String="@serialField " />
+ <StringDetect attribute="BlockTag" context="#stay" String="@since " />
+ <StringDetect attribute="BlockTag" context="JavadocParam" String="@throws " />
+ <StringDetect attribute="BlockTag" context="#stay" String="@version " />
+ <StringDetect attribute="BlockTag" context="#stay" String="@author&#009;" />
+ <StringDetect attribute="BlockTag" context="#stay" String="@deprecated&#009;" />
+ <StringDetect attribute="BlockTag" context="JavadocParam" String="@exception&#009;" />
+ <StringDetect attribute="BlockTag" context="JavadocParam" String="@param&#009;" />
+ <StringDetect attribute="BlockTag" context="#stay" String="@return&#009;" />
+ <StringDetect attribute="BlockTag" context="SeeTag" String="@see&#009;" />
+ <StringDetect attribute="BlockTag" context="#stay" String="@serial&#009;" />
+ <StringDetect attribute="BlockTag" context="#stay" String="@serialData&#009;" />
+ <StringDetect attribute="BlockTag" context="#stay" String="@serialField&#009;" />
+ <StringDetect attribute="BlockTag" context="#stay" String="@since&#009;" />
+ <StringDetect attribute="BlockTag" context="JavadocParam" String="@throws&#009;" />
+ <StringDetect attribute="BlockTag" context="#stay" String="@version&#009;" />
+ <StringDetect attribute="InlineTag" context="LiteralTagar" String="{@code " />
+ <StringDetect attribute="InlineTag" context="LiteralTagar" String="{@code&#009;" />
+ <StringDetect attribute="InlineTag" context="#stay" String="{@docRoot}" />
+ <StringDetect attribute="InlineTag" context="#stay" String="{@inheritDoc}" />
+ <StringDetect attribute="InlineTag" context="InlineTagar" String="{@link " />
+ <StringDetect attribute="InlineTag" context="InlineTagar" String="{@link&#009;" />
+ <StringDetect attribute="InlineTag" context="InlineTagar" String="{@linkplain " />
+ <StringDetect attribute="InlineTag" context="InlineTagar" String="{@linkplain&#009;" />
+ <StringDetect attribute="InlineTag" context="LiteralTagar" String="{@literal " />
+ <StringDetect attribute="InlineTag" context="LiteralTagar" String="{@literal&#009;" />
+ <StringDetect attribute="InlineTag" context="#stay" String="{@value}" />
+ <StringDetect attribute="InlineTag" context="InlineTagar" String="{@value " />
+ <StringDetect attribute="InlineTag" context="InlineTagar" String="{@value&#009;" />
+ <IncludeRules context="##HTML"/>
+ </context>
+ <context attribute="Javadoc" lineEndContext="#pop" name="JavadocParam">
+ <DetectSpaces />
+ <RegExpr attribute="JavadocParam" context="#pop#pop" String="\S*(?=\*/)" />
+ <RegExpr attribute="JavadocParam" context="#pop" String="\S*(\s|$)" />
+ </context>
+ <context attribute="InlineTag" lineEndContext="#pop" name="InlineTagar">
+ <DetectChar attribute="InlineTag" context="#pop" char="}" />
+ <Detect2Chars attribute="JavadocFS" context="#pop#pop#pop" char="*" char1="/" />
+ <IncludeRules context="##HTML"/>
+ </context>
+ <context attribute="InlineTag" lineEndContext="#pop" name="LiteralTagar">
+ <DetectChar attribute="InlineTag" context="#pop" char="}" />
+ <Detect2Chars attribute="JavadocFS" context="#pop#pop#pop" char="*" char1="/" />
+ </context>
+ <context attribute="SeeTag" lineEndContext="#pop" name="SeeTag">
+ <Detect2Chars attribute="JavadocFS" context="#pop#pop#pop" char="*" char1="/" />
+ <IncludeRules context="##HTML"/>
+ </context>
+ </contexts>
+ <itemDatas>
+ <itemData name="Normal Text" defStyleNum="dsNormal"/>
+ <itemData name="BlockTag" defStyleNum="dsKeyword" color="#808080" selColor="#FFFFFF" bold="1" italic="0"/>
+ <itemData name="InlineTag" defStyleNum="dsKeyword" color="#808080" selColor="#FFFFFF" bold="0" italic="0"/>
+ <itemData name="JavadocParam" defStyleNum="dsKeyword" color="#008080" selColor="#FFFFFF" bold="0" italic="1"/>
+ <itemData name="SeeTag" defStyleNum="dsKeyword" color="#008080" selColor="#FFFFFF" bold="0" italic="1"/>
+ <itemData name="JavadocFS" defStyleNum="dsComment" color="#008000" selColor="#FFFFFF" bold="1" italic="0"/>
+ <itemData name="Javadoc" defStyleNum="dsComment" color="#008000" selColor="#FFFFFF"/>
+ </itemDatas>
+ </highlighting>
+ <general>
+ <keywords casesensitive="1"/>
+ </general>
+</language>
diff --git a/kate/data/javascript.xml b/kate/data/javascript.xml
new file mode 100644
index 000000000..632cd0576
--- /dev/null
+++ b/kate/data/javascript.xml
@@ -0,0 +1,501 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+<!-- Author: Anders Lund <anders@alweb.dk> //-->
+<!-- Minor changes: Joseph Wenninger <jowenn@kde.org> //-->
+<!-- Full JavaScript 1.0 support by Whitehawk Stormchaser //-->
+<language name="JavaScript" version="1.10" kateversion="2.3" section="Scripts" extensions="*.js" mimetype="text/x-javascript" author="Anders Lund (anders@alweb.dk), Joseph Wenninger (jowenn@kde.org), Whitehawk Stormchaser (zerokode@gmx.net)" license="">
+ <highlighting>
+ <list name="keywords">
+ <item> if </item>
+ <item> else </item>
+ <item> for </item>
+ <item> in </item>
+ <item> while </item>
+ <item> do </item>
+ <item> continue </item>
+ <item> break </item>
+ <item> with </item>
+ <item> try </item>
+ <item> catch </item>
+ <item> finally </item>
+ <item> switch </item>
+ <item> case </item>
+ <item> new </item>
+ <item> var </item>
+ <item> function </item>
+ <item> return </item>
+ <item> delete </item>
+ <item> true </item>
+ <item> false </item>
+ <item> void </item>
+ <item> throw </item>
+ <item> typeof </item>
+ <item> const </item>
+ <item> default </item>
+ </list>
+ <list name="functions">
+ <item> escape </item>
+ <item> isFinite </item>
+ <item> isNaN </item>
+ <item> Number </item>
+ <item> parseFloat </item>
+ <item> parseInt </item>
+ <item> reload </item>
+ <item> taint </item>
+ <item> unescape </item>
+ <item> untaint </item>
+ <item> write </item>
+ </list>
+ <list name="objects">
+ <item>Anchor</item>
+ <item>Applet</item>
+ <item>Area</item>
+ <item>Array</item>
+ <item>Boolean</item>
+ <item>Button</item>
+ <item>Checkbox</item>
+ <item>Date</item>
+ <item>document</item>
+ <item>window</item>
+ <item>Image</item>
+ <item>FileUpload</item>
+ <item>Form</item>
+ <item>Frame</item>
+ <item>Function</item>
+ <item>Hidden</item>
+ <item>Link</item>
+ <item>MimeType</item>
+ <item>Math</item>
+ <item>Max</item>
+ <item>Min</item>
+ <item>Layer</item>
+ <item>navigator</item>
+ <item>Object</item>
+ <item>Password</item>
+ <item>Plugin</item>
+ <item>Radio</item>
+ <item>RegExp</item>
+ <item>Reset</item>
+ <item>Screen</item>
+ <item>Select</item>
+ <item>String</item>
+ <item>Text</item>
+ <item>Textarea</item>
+ <item>this</item>
+ <item>Window</item>
+ </list>
+ <list name="math">
+ <item> abs </item>
+ <item> acos </item>
+ <item> asin </item>
+ <item> atan </item>
+ <item> atan2 </item>
+ <item> ceil </item>
+ <item> cos </item>
+ <item> ctg </item>
+ <item> E </item>
+ <item> exp </item>
+ <item> floor </item>
+ <item> LN2 </item>
+ <item> LN10 </item>
+ <item> log </item>
+ <item> LOG2E </item>
+ <item> LOG10E </item>
+ <item> PI </item>
+ <item> pow </item>
+ <item> round </item>
+ <item> sin </item>
+ <item> sqrt </item>
+ <item> SQRT1_2 </item>
+ <item> SQRT2 </item>
+ <item> tan </item>
+ </list>
+ <list name="events">
+ <item>onAbort</item>
+ <item>onBlur</item>
+ <item>onChange</item>
+ <item>onClick</item>
+ <item>onError</item>
+ <item>onFocus</item>
+ <item>onLoad</item>
+ <item>onMouseOut</item>
+ <item>onMouseOver</item>
+ <item>onReset</item>
+ <item>onSelect</item>
+ <item>onSubmit</item>
+ <item>onUnload</item>
+ </list>
+ <list name="methods">
+ <item>above</item>
+ <item>action</item>
+ <item>alinkColor</item>
+ <item>alert</item>
+ <item>anchor</item>
+ <item>anchors</item>
+ <item>appCodeName</item>
+ <item>applets</item>
+ <item>apply</item>
+ <item>appName</item>
+ <item>appVersion</item>
+ <item>argument</item>
+ <item>arguments</item>
+ <item>arity</item>
+ <item>availHeight</item>
+ <item>availWidth</item>
+ <item>back</item>
+ <item>background</item>
+ <item>below</item>
+ <item>bgColor</item>
+ <item>border</item>
+ <item>big</item>
+ <item>blink</item>
+ <item>blur</item>
+ <item>bold</item>
+ <item>border</item>
+ <item>call</item>
+ <item>caller</item>
+ <item>charAt</item>
+ <item>charCodeAt</item>
+ <item>checked</item>
+ <item>clearInterval</item>
+ <item>clearTimeout</item>
+ <item>click</item>
+ <item>clip</item>
+ <item>close</item>
+ <item>closed</item>
+ <item>colorDepth</item>
+ <item>complete</item>
+ <item>compile</item>
+ <item>constructor</item>
+ <item>confirm</item>
+ <item>cookie</item>
+ <item>current</item>
+ <item>cursor</item>
+ <item>data</item>
+ <item>defaultChecked</item>
+ <item>defaultSelected</item>
+ <item>defaultStatus</item>
+ <item>defaultValue</item>
+ <item>description</item>
+ <item>disableExternalCapture</item>
+ <item>domain</item>
+ <item>elements</item>
+ <item>embeds</item>
+ <item>enabledPlugin</item>
+ <item>enableExternalCapture</item>
+ <item>encoding</item>
+ <item>eval</item>
+ <item>exec</item>
+ <item>fgColor</item>
+ <item>filename</item>
+ <item>find</item>
+ <item>fixed</item>
+ <item>focus</item>
+ <item>fontcolor</item>
+ <item>fontsize</item>
+ <item>form</item>
+ <item>forms</item>
+ <item>formName</item>
+ <item>forward</item>
+ <item>frames</item>
+ <item>fromCharCode</item>
+ <item>getDate</item>
+ <item>getDay</item>
+ <item>getHours</item>
+ <item>getMiliseconds</item>
+ <item>getMinutes</item>
+ <item>getMonth</item>
+ <item>getSeconds</item>
+ <item>getSelection</item>
+ <item>getTime</item>
+ <item>getTimezoneOffset</item>
+ <item>getUTCDate</item>
+ <item>getUTCDay</item>
+ <item>getUTCFullYear</item>
+ <item>getUTCHours</item>
+ <item>getUTCMilliseconds</item>
+ <item>getUTCMinutes</item>
+ <item>getUTCMonth</item>
+ <item>getUTCSeconds</item>
+ <item>getYear</item>
+ <item>global</item>
+ <item>go</item>
+ <item>hash</item>
+ <item>height</item>
+ <item>history</item>
+ <item>home</item>
+ <item>host</item>
+ <item>hostname</item>
+ <item>href</item>
+ <item>hspace</item>
+ <item>ignoreCase</item>
+ <item>images</item>
+ <item>index</item>
+ <item>indexOf</item>
+ <item>innerHeight</item>
+ <item>innerWidth</item>
+ <item>input</item>
+ <item>italics</item>
+ <item>javaEnabled</item>
+ <item>join</item>
+ <item>language</item>
+ <item>lastIndex</item>
+ <item>lastIndexOf</item>
+ <item>lastModified</item>
+ <item>lastParen</item>
+ <item>layers</item>
+ <item>layerX</item>
+ <item>layerY</item>
+ <item>left</item>
+ <item>leftContext</item>
+ <item>length</item>
+ <item>link</item>
+ <item>linkColor</item>
+ <item>links</item>
+ <item>location</item>
+ <item>locationbar</item>
+ <item>load</item>
+ <item>lowsrc</item>
+ <item>match</item>
+ <item>MAX_VALUE</item>
+ <item>menubar</item>
+ <item>method</item>
+ <item>mimeTypes</item>
+ <item>MIN_VALUE</item>
+ <item>modifiers</item>
+ <item>moveAbove</item>
+ <item>moveBelow</item>
+ <item>moveBy</item>
+ <item>moveTo</item>
+ <item>moveToAbsolute</item>
+ <item>multiline</item>
+ <item>name</item>
+ <item>NaN</item>
+ <item>NEGATIVE_INFINITY</item>
+ <item>negative_infinity</item>
+ <item>next</item>
+ <item>open</item>
+ <item>opener</item>
+ <item>options</item>
+ <item>outerHeight</item>
+ <item>outerWidth</item>
+ <item>pageX</item>
+ <item>pageY</item>
+ <item>pageXoffset</item>
+ <item>pageYoffset</item>
+ <item>parent</item>
+ <item>parse</item>
+ <item>pathname</item>
+ <item>personalbar</item>
+ <item>pixelDepth</item>
+ <item>platform</item>
+ <item>plugins</item>
+ <item>pop</item>
+ <item>port</item>
+ <item>POSITIVE_INFINITY</item>
+ <item>positive_infinity</item>
+ <item>preference</item>
+ <item>previous</item>
+ <item>print</item>
+ <item>prompt</item>
+ <item>protocol</item>
+ <item>prototype</item>
+ <item>push</item>
+ <item>referrer</item>
+ <item>refresh</item>
+ <item>releaseEvents</item>
+ <item>reload</item>
+ <item>replace</item>
+ <item>reset</item>
+ <item>resizeBy</item>
+ <item>resizeTo</item>
+ <item>reverse</item>
+ <item>rightContext</item>
+ <item>screenX</item>
+ <item>screenY</item>
+ <item>scroll</item>
+ <item>scrollbar</item>
+ <item>scrollBy</item>
+ <item>scrollTo</item>
+ <item>search</item>
+ <item>select</item>
+ <item>selected</item>
+ <item>selectedIndex</item>
+ <item>self</item>
+ <item>setDate</item>
+ <item>setHours</item>
+ <item>setMinutes</item>
+ <item>setMonth</item>
+ <item>setSeconds</item>
+ <item>setTime</item>
+ <item>setTimeout</item>
+ <item>setUTCDate</item>
+ <item>setUTCDay</item>
+ <item>setUTCFullYear</item>
+ <item>setUTCHours</item>
+ <item>setUTCMilliseconds</item>
+ <item>setUTCMinutes</item>
+ <item>setUTCMonth</item>
+ <item>setUTCSeconds</item>
+ <item>setYear</item>
+ <item>shift</item>
+ <item>siblingAbove</item>
+ <item>siblingBelow</item>
+ <item>small</item>
+ <item>sort</item>
+ <item>source</item>
+ <item>splice</item>
+ <item>split</item>
+ <item>src</item>
+ <item>status</item>
+ <item>statusbar</item>
+ <item>strike</item>
+ <item>sub</item>
+ <item>submit</item>
+ <item>substr</item>
+ <item>substring</item>
+ <item>suffixes</item>
+ <item>sup</item>
+ <item>taintEnabled</item>
+ <item>target</item>
+ <item>test</item>
+ <item>text</item>
+ <item>title</item>
+ <item>toGMTString</item>
+ <item>toLocaleString</item>
+ <item>toLowerCase</item>
+ <item>toolbar</item>
+ <item>toSource</item>
+ <item>toString</item>
+ <item>top</item>
+ <item>toUpperCase</item>
+ <item>toUTCString</item>
+ <item>type</item>
+ <item>URL</item>
+ <item>unshift</item>
+ <item>unwatch</item>
+ <item>userAgent</item>
+ <item>UTC</item>
+ <item>value</item>
+ <item>valueOf</item>
+ <item>visibility</item>
+ <item>vlinkColor</item>
+ <item>vspace</item>
+ <item>width</item>
+ <item>watch</item>
+ <item>which</item>
+ <item>width</item>
+ <item>write</item>
+ <item>writeln</item>
+ <item>x</item>
+ <item>y</item>
+ <item>zIndex</item>
+ </list>
+ <contexts>
+ <context attribute="Normal Text" lineEndContext="#stay" name="Normal">
+ <DetectSpaces/>
+ <StringDetect attribute="Region Marker" context="region_marker" String="//BEGIN" beginRegion="Region1"/>
+ <RegExpr attribute="Region Marker" context="region_marker" String="//END" endRegion="Region1"/>
+ <keyword attribute="Keyword" context="#stay" String="keywords" />
+ <keyword attribute="Function" context="#stay" String="functions" />
+ <keyword attribute="Objects" context="#stay" String="objects" />
+ <keyword attribute="Math" context="#stay" String="math" />
+ <keyword attribute="Events" context="#stay" String="events" />
+ <keyword attribute="Data Type" context="#stay" String="methods" />
+ <DetectIdentifier/>
+ <Float attribute="Float" context="#stay" />
+ <Int attribute="Decimal" context="#stay" />
+ <DetectChar attribute="String" context="String" char="&quot;"/>
+ <DetectChar attribute="String" context="String 1" char="'"/>
+ <Detect2Chars attribute="Comment" context="Comment" char="/" char1="/"/>
+ <Detect2Chars attribute="Comment" context="Multi/inline Comment" char="/" char1="*" beginRegion="Comment"/>
+ <RegExpr attribute="Normal Text" context="(Internal regex catch)" String="[=?:]" />
+ <RegExpr attribute="Normal Text" context="(Internal regex catch)" String="\(" />
+ <DetectChar attribute="Symbol" context="#stay" char="{" beginRegion="Brace1" />
+ <DetectChar attribute="Symbol" context="#stay" char="}" endRegion="Brace1" />
+ <AnyChar attribute="Symbol" context="#stay" String=":!%&amp;+,-/.*&lt;=&gt;?[]|~^&#59;"/>
+ </context>
+
+ <context attribute="String" lineEndContext="#pop" name="String">
+ <DetectIdentifier/>
+ <HlCStringChar attribute="String Char" context="#stay"/>
+ <DetectChar attribute="String" context="#pop" char="&quot;"/>
+ </context>
+ <context attribute="String Char" lineEndContext="#pop" name="String 1">
+ <DetectIdentifier/>
+ <DetectChar attribute="String" context="String" char="&quot;"/>
+ <DetectChar attribute="String Char" context="#pop" char="'"/>
+ </context>
+
+ <context attribute="Comment" lineEndContext="#pop" name="Comment">
+ <DetectSpaces />
+ <IncludeRules context="##Alerts" />
+ <DetectIdentifier />
+ </context>
+ <context attribute="Comment" lineEndContext="#stay" name="Multi/inline Comment">
+ <IncludeRules context="##Alerts" />
+ <Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" endRegion="Comment"/>
+ </context>
+
+ <context attribute="Regular Expression" lineEndContext="#stay" name="Regular Expression">
+ <RegExpr attribute="Regular Expression" context="#pop#pop#pop" String="/[ig]{0,2}" />
+ <RegExpr attribute="Pattern Internal Operator" context="#stay" String="\{[\d, ]+\}" />
+ <RegExpr attribute="Pattern Internal Operator" context="#stay" String="\\[bB]" />
+ <RegExpr attribute="Pattern Character Class" context="#stay" String="\\[nrtvfDdSsWw]" />
+ <DetectChar attribute="Pattern Character Class" context="(charclass caret first check)" char="[" />
+ <RegExpr attribute="Pattern Internal Operator" context="#stay" String="\\." />
+ <RegExpr attribute="Pattern Internal Operator" context="#stay" String="\$(?=/)" />
+ <AnyChar attribute="Pattern Internal Operator" context="#stay" String="?+*()|" />
+ </context>
+ <context attribute="Normal Text" lineEndContext="#stay" name="(Internal regex catch)" fallthrough="true" fallthroughContext="#pop">
+ <RegExpr attribute="Normal Text" context="#stay" String="\s*" />
+ <RegExpr attribute="Regular Expression" context="#pop" String="//(?=;)" />
+ <Detect2Chars attribute="Comment" context="Comment" char="/" char1="/" />
+ <Detect2Chars attribute="Comment" context="Multi/inline Comment" char="/" char1="*" />
+ <DetectChar attribute="Regular Expression" context="(regex caret first check)" char="/" />
+ </context>
+ <context attribute="Pattern Character Class" lineEndContext="#stay" name="Regular Expression Character Class">
+ <RegExpr attribute="Pattern Character Class" context="#stay" String="\\[\[\]]" />
+ <DetectChar attribute="Pattern Character Class" context="#pop#pop" char="]" />
+ </context>
+ <context attribute="Pattern Internal Operator" lineEndContext="#pop" name="(regex caret first check)" fallthrough="true" fallthroughContext="Regular Expression">
+ <DetectChar attribute="Pattern Internal Operator" context="Regular Expression" char="^" />
+ </context>
+ <context attribute="Pattern Internal Operator" lineEndContext="#pop" name="(charclass caret first check)" fallthrough="true" fallthroughContext="Regular Expression Character Class">
+ <DetectChar attribute="Pattern Internal Operator" context="Regular Expression Character Class" char="^" />
+ </context>
+
+ <context name="region_marker" attribute="Region Marker" lineEndContext="#pop" >
+ <DetectIdentifier />
+ <DetectSpaces />
+ </context>
+ </contexts>
+ <itemDatas>
+ <itemData name="Normal Text" defStyleNum="dsNormal"/>
+ <itemData name="Keyword" defStyleNum="dsKeyword"/>
+ <itemData name="Function" defStyleNum="dsFunction"/>
+ <itemData name="Objects" defStyleNum="dsKeyword" color="#008000" selColor="#00ffff" bold="0" italic="0"/>
+ <itemData name="Math" defStyleNum="dsKeyword" color="#DBA716" selColor="#00ffff" bold="0" italic="0"/>
+ <itemData name="Events" defStyleNum="dsKeyword" color="#F766D5" selColor="#00ffff" bold="0" italic="0"/>
+ <itemData name="Data Type" defStyleNum="dsDataType"/>
+ <itemData name="Decimal" defStyleNum="dsDecVal"/>
+ <itemData name="Float" defStyleNum="dsFloat"/>
+ <itemData name="Char" defStyleNum="dsChar"/>
+ <itemData name="String" defStyleNum="dsString"/>
+ <itemData name="String Char" defStyleNum="dsChar"/>
+ <itemData name="Comment" defStyleNum="dsComment"/>
+ <itemData name="Symbol" defStyleNum="dsNormal"/>
+ <itemData name="Regular Expression" defStyleNum="dsOthers" />
+ <itemData name="Pattern Internal Operator" defStyleNum="dsFloat" />
+ <itemData name="Pattern Character Class" defStyleNum="dsBaseN" />
+ <itemData name="Region Marker" defStyleNum="dsRegionMarker" />
+ </itemDatas>
+ </highlighting>
+ <general>
+ <comments>
+ <comment name="singleLine" start="//" />
+ <comment name="multiLine" start="/*" end="*/" />
+ </comments>
+ <keywords casesensitive="1" />
+ </general>
+</language>
diff --git a/kate/data/jsp.xml b/kate/data/jsp.xml
new file mode 100644
index 000000000..da448227e
--- /dev/null
+++ b/kate/data/jsp.xml
@@ -0,0 +1,3070 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+<language version="1.02" kateversion="2.4" name="JSP" section="Markup" extensions="*.jsp;*.JSP" mimetype="text/html" casesensitive="false" author="Rob Martin (rob@gamepimp.com)" license="LGPL">
+ <highlighting>
+
+ <list name="java-1.4.2-classes">
+ <item> ARG_IN </item>
+ <item> ARG_INOUT </item>
+ <item> ARG_OUT </item>
+ <item> AWTError </item>
+ <item> AWTEvent </item>
+ <item> AWTEventListener </item>
+ <item> AWTEventListenerProxy </item>
+ <item> AWTEventMulticaster </item>
+ <item> AWTException </item>
+ <item> AWTKeyStroke </item>
+ <item> AWTPermission </item>
+ <item> AbstractAction </item>
+ <item> AbstractBorder </item>
+ <item> AbstractButton </item>
+ <item> AbstractCellEditor </item>
+ <item> AbstractCollection </item>
+ <item> AbstractColorChooserPanel </item>
+ <item> AbstractDocument </item>
+ <item> AbstractFormatter </item>
+ <item> AbstractFormatterFactory </item>
+ <item> AbstractInterruptibleChannel </item>
+ <item> AbstractLayoutCache </item>
+ <item> AbstractList </item>
+ <item> AbstractListModel </item>
+ <item> AbstractMap </item>
+ <item> AbstractMethodError </item>
+ <item> AbstractPreferences </item>
+ <item> AbstractSelectableChannel </item>
+ <item> AbstractSelectionKey </item>
+ <item> AbstractSelector </item>
+ <item> AbstractSequentialList </item>
+ <item> AbstractSet </item>
+ <item> AbstractSpinnerModel </item>
+ <item> AbstractTableModel </item>
+ <item> AbstractUndoableEdit </item>
+ <item> AbstractWriter </item>
+ <item> AccessControlContext </item>
+ <item> AccessControlException </item>
+ <item> AccessController </item>
+ <item> AccessException </item>
+ <item> Accessible </item>
+ <item> AccessibleAction </item>
+ <item> AccessibleBundle </item>
+ <item> AccessibleComponent </item>
+ <item> AccessibleContext </item>
+ <item> AccessibleEditableText </item>
+ <item> AccessibleExtendedComponent </item>
+ <item> AccessibleExtendedTable </item>
+ <item> AccessibleHyperlink </item>
+ <item> AccessibleHypertext </item>
+ <item> AccessibleIcon </item>
+ <item> AccessibleKeyBinding </item>
+ <item> AccessibleObject </item>
+ <item> AccessibleRelation </item>
+ <item> AccessibleRelationSet </item>
+ <item> AccessibleResourceBundle </item>
+ <item> AccessibleRole </item>
+ <item> AccessibleSelection </item>
+ <item> AccessibleState </item>
+ <item> AccessibleStateSet </item>
+ <item> AccessibleTable </item>
+ <item> AccessibleTableModelChange </item>
+ <item> AccessibleText </item>
+ <item> AccessibleValue </item>
+ <item> AccountExpiredException </item>
+ <item> Acl </item>
+ <item> AclEntry </item>
+ <item> AclNotFoundException </item>
+ <item> Action </item>
+ <item> ActionEvent </item>
+ <item> ActionListener </item>
+ <item> ActionMap </item>
+ <item> ActionMapUIResource </item>
+ <item> Activatable </item>
+ <item> ActivateFailedException </item>
+ <item> ActivationDesc </item>
+ <item> ActivationException </item>
+ <item> ActivationGroup </item>
+ <item> ActivationGroupDesc </item>
+ <item> ActivationGroupID </item>
+ <item> ActivationGroup_Stub </item>
+ <item> ActivationID </item>
+ <item> ActivationInstantiator </item>
+ <item> ActivationMonitor </item>
+ <item> ActivationSystem </item>
+ <item> Activator </item>
+ <item> ActiveEvent </item>
+ <item> ActiveValue </item>
+ <item> AdapterActivator </item>
+ <item> AdapterActivatorOperations </item>
+ <item> AdapterAlreadyExists </item>
+ <item> AdapterAlreadyExistsHelper </item>
+ <item> AdapterInactive </item>
+ <item> AdapterInactiveHelper </item>
+ <item> AdapterNonExistent </item>
+ <item> AdapterNonExistentHelper </item>
+ <item> AddressHelper </item>
+ <item> Adjustable </item>
+ <item> AdjustmentEvent </item>
+ <item> AdjustmentListener </item>
+ <item> Adler32 </item>
+ <item> AffineTransform </item>
+ <item> AffineTransformOp </item>
+ <item> AlgorithmParameterGenerator </item>
+ <item> AlgorithmParameterGeneratorSpi </item>
+ <item> AlgorithmParameterSpec </item>
+ <item> AlgorithmParameters </item>
+ <item> AlgorithmParametersSpi </item>
+ <item> AlignmentAction </item>
+ <item> AllPermission </item>
+ <item> AlphaComposite </item>
+ <item> AlreadyBound </item>
+ <item> AlreadyBoundException </item>
+ <item> AlreadyBoundHelper </item>
+ <item> AlreadyBoundHolder </item>
+ <item> AlreadyConnectedException </item>
+ <item> AncestorEvent </item>
+ <item> AncestorListener </item>
+ <item> Annotation </item>
+ <item> Any </item>
+ <item> AnyHolder </item>
+ <item> AnySeqHelper </item>
+ <item> AnySeqHelper </item>
+ <item> AnySeqHolder </item>
+ <item> AppConfigurationEntry </item>
+ <item> Applet </item>
+ <item> AppletContext </item>
+ <item> AppletInitializer </item>
+ <item> AppletStub </item>
+ <item> ApplicationException </item>
+ <item> Arc2D </item>
+ <item> Area </item>
+ <item> AreaAveragingScaleFilter </item>
+ <item> ArithmeticException </item>
+ <item> Array </item>
+ <item> Array </item>
+ <item> ArrayIndexOutOfBoundsException </item>
+ <item> ArrayList </item>
+ <item> ArrayStoreException </item>
+ <item> Arrays </item>
+ <item> AssertionError </item>
+ <item> AsyncBoxView </item>
+ <item> AsynchronousCloseException </item>
+ <item> Attr </item>
+ <item> Attribute </item>
+ <item> Attribute </item>
+ <item> Attribute </item>
+ <item> Attribute </item>
+ <item> Attribute </item>
+ <item> AttributeContext </item>
+ <item> AttributeException </item>
+ <item> AttributeInUseException </item>
+ <item> AttributeList </item>
+ <item> AttributeList </item>
+ <item> AttributeListImpl </item>
+ <item> AttributeModificationException </item>
+ <item> AttributeSet </item>
+ <item> AttributeSet </item>
+ <item> AttributeSetUtilities </item>
+ <item> AttributeUndoableEdit </item>
+ <item> AttributedCharacterIterator </item>
+ <item> AttributedString </item>
+ <item> Attributes </item>
+ <item> Attributes </item>
+ <item> Attributes </item>
+ <item> AttributesImpl </item>
+ <item> AudioClip </item>
+ <item> AudioFileFormat </item>
+ <item> AudioFileReader </item>
+ <item> AudioFileWriter </item>
+ <item> AudioFormat </item>
+ <item> AudioInputStream </item>
+ <item> AudioPermission </item>
+ <item> AudioSystem </item>
+ <item> AuthPermission </item>
+ <item> AuthenticationException </item>
+ <item> AuthenticationNotSupportedException </item>
+ <item> Authenticator </item>
+ <item> Autoscroll </item>
+ <item> BAD_CONTEXT </item>
+ <item> BAD_INV_ORDER </item>
+ <item> BAD_OPERATION </item>
+ <item> BAD_PARAM </item>
+ <item> BAD_POLICY </item>
+ <item> BAD_POLICY_TYPE </item>
+ <item> BAD_POLICY_VALUE </item>
+ <item> BAD_TYPECODE </item>
+ <item> BCSIterator </item>
+ <item> BCSSServiceProvider </item>
+ <item> BYTE_ARRAY </item>
+ <item> BackingStoreException </item>
+ <item> BadKind </item>
+ <item> BadLocationException </item>
+ <item> BadPaddingException </item>
+ <item> BandCombineOp </item>
+ <item> BandedSampleModel </item>
+ <item> BasicArrowButton </item>
+ <item> BasicAttribute </item>
+ <item> BasicAttributes </item>
+ <item> BasicBorders </item>
+ <item> BasicButtonListener </item>
+ <item> BasicButtonUI </item>
+ <item> BasicCaret </item>
+ <item> BasicCheckBoxMenuItemUI </item>
+ <item> BasicCheckBoxUI </item>
+ <item> BasicColorChooserUI </item>
+ <item> BasicComboBoxEditor </item>
+ <item> BasicComboBoxRenderer </item>
+ <item> BasicComboBoxUI </item>
+ <item> BasicComboPopup </item>
+ <item> BasicDesktopIconUI </item>
+ <item> BasicDesktopPaneUI </item>
+ <item> BasicDirectoryModel </item>
+ <item> BasicEditorPaneUI </item>
+ <item> BasicFileChooserUI </item>
+ <item> BasicFormattedTextFieldUI </item>
+ <item> BasicGraphicsUtils </item>
+ <item> BasicHTML </item>
+ <item> BasicHighlighter </item>
+ <item> BasicIconFactory </item>
+ <item> BasicInternalFrameTitlePane </item>
+ <item> BasicInternalFrameUI </item>
+ <item> BasicLabelUI </item>
+ <item> BasicListUI </item>
+ <item> BasicLookAndFeel </item>
+ <item> BasicMenuBarUI </item>
+ <item> BasicMenuItemUI </item>
+ <item> BasicMenuUI </item>
+ <item> BasicOptionPaneUI </item>
+ <item> BasicPanelUI </item>
+ <item> BasicPasswordFieldUI </item>
+ <item> BasicPermission </item>
+ <item> BasicPopupMenuSeparatorUI </item>
+ <item> BasicPopupMenuUI </item>
+ <item> BasicProgressBarUI </item>
+ <item> BasicRadioButtonMenuItemUI </item>
+ <item> BasicRadioButtonUI </item>
+ <item> BasicRootPaneUI </item>
+ <item> BasicScrollBarUI </item>
+ <item> BasicScrollPaneUI </item>
+ <item> BasicSeparatorUI </item>
+ <item> BasicSliderUI </item>
+ <item> BasicSpinnerUI </item>
+ <item> BasicSplitPaneDivider </item>
+ <item> BasicSplitPaneUI </item>
+ <item> BasicStroke </item>
+ <item> BasicTabbedPaneUI </item>
+ <item> BasicTableHeaderUI </item>
+ <item> BasicTableUI </item>
+ <item> BasicTextAreaUI </item>
+ <item> BasicTextFieldUI </item>
+ <item> BasicTextPaneUI </item>
+ <item> BasicTextUI </item>
+ <item> BasicToggleButtonUI </item>
+ <item> BasicToolBarSeparatorUI </item>
+ <item> BasicToolBarUI </item>
+ <item> BasicToolTipUI </item>
+ <item> BasicTreeUI </item>
+ <item> BasicViewportUI </item>
+ <item> BatchUpdateException </item>
+ <item> BeanContext </item>
+ <item> BeanContextChild </item>
+ <item> BeanContextChildComponentProxy </item>
+ <item> BeanContextChildSupport </item>
+ <item> BeanContextContainerProxy </item>
+ <item> BeanContextEvent </item>
+ <item> BeanContextMembershipEvent </item>
+ <item> BeanContextMembershipListener </item>
+ <item> BeanContextProxy </item>
+ <item> BeanContextServiceAvailableEvent </item>
+ <item> BeanContextServiceProvider </item>
+ <item> BeanContextServiceProviderBeanInfo </item>
+ <item> BeanContextServiceRevokedEvent </item>
+ <item> BeanContextServiceRevokedListener </item>
+ <item> BeanContextServices </item>
+ <item> BeanContextServicesListener </item>
+ <item> BeanContextServicesSupport </item>
+ <item> BeanContextSupport </item>
+ <item> BeanDescriptor </item>
+ <item> BeanInfo </item>
+ <item> Beans </item>
+ <item> BeepAction </item>
+ <item> BevelBorder </item>
+ <item> BevelBorderUIResource </item>
+ <item> Bias </item>
+ <item> Bidi </item>
+ <item> BigDecimal </item>
+ <item> BigInteger </item>
+ <item> BinaryRefAddr </item>
+ <item> BindException </item>
+ <item> Binding </item>
+ <item> Binding </item>
+ <item> BindingHelper </item>
+ <item> BindingHolder </item>
+ <item> BindingIterator </item>
+ <item> BindingIteratorHelper </item>
+ <item> BindingIteratorHolder </item>
+ <item> BindingIteratorOperations </item>
+ <item> BindingIteratorPOA </item>
+ <item> BindingListHelper </item>
+ <item> BindingListHolder </item>
+ <item> BindingType </item>
+ <item> BindingTypeHelper </item>
+ <item> BindingTypeHolder </item>
+ <item> BitSet </item>
+ <item> Blob </item>
+ <item> BlockView </item>
+ <item> BoldAction </item>
+ <item> Book </item>
+ <item> Boolean </item>
+ <item> BooleanControl </item>
+ <item> BooleanHolder </item>
+ <item> BooleanSeqHelper </item>
+ <item> BooleanSeqHolder </item>
+ <item> Border </item>
+ <item> BorderFactory </item>
+ <item> BorderLayout </item>
+ <item> BorderUIResource </item>
+ <item> BoundedRangeModel </item>
+ <item> Bounds </item>
+ <item> Bounds </item>
+ <item> Box </item>
+ <item> BoxLayout </item>
+ <item> BoxPainter </item>
+ <item> BoxView </item>
+ <item> BoxedValueHelper </item>
+ <item> BreakIterator </item>
+ <item> Buffer </item>
+ <item> BufferCapabilities </item>
+ <item> BufferOverflowException </item>
+ <item> BufferStrategy </item>
+ <item> BufferUnderflowException </item>
+ <item> BufferedImage </item>
+ <item> BufferedImageFilter </item>
+ <item> BufferedImageOp </item>
+ <item> BufferedInputStream </item>
+ <item> BufferedOutputStream </item>
+ <item> BufferedReader </item>
+ <item> BufferedWriter </item>
+ <item> Button </item>
+ <item> ButtonAreaLayout </item>
+ <item> ButtonBorder </item>
+ <item> ButtonBorder </item>
+ <item> ButtonGroup </item>
+ <item> ButtonModel </item>
+ <item> ButtonUI </item>
+ <item> Byte </item>
+ <item> ByteArrayInputStream </item>
+ <item> ByteArrayOutputStream </item>
+ <item> ByteBuffer </item>
+ <item> ByteChannel </item>
+ <item> ByteHolder </item>
+ <item> ByteLookupTable </item>
+ <item> ByteOrder </item>
+ <item> CDATASection </item>
+ <item> CHAR_ARRAY </item>
+ <item> CMMException </item>
+ <item> COMM_FAILURE </item>
+ <item> CRC32 </item>
+ <item> CRL </item>
+ <item> CRLException </item>
+ <item> CRLSelector </item>
+ <item> CSS </item>
+ <item> CTX_RESTRICT_SCOPE </item>
+ <item> Calendar </item>
+ <item> CallableStatement </item>
+ <item> Callback </item>
+ <item> CallbackHandler </item>
+ <item> CancelablePrintJob </item>
+ <item> CancelledKeyException </item>
+ <item> CannotProceed </item>
+ <item> CannotProceedException </item>
+ <item> CannotProceedHelper </item>
+ <item> CannotProceedHolder </item>
+ <item> CannotRedoException </item>
+ <item> CannotUndoException </item>
+ <item> Canvas </item>
+ <item> CardLayout </item>
+ <item> Caret </item>
+ <item> CaretEvent </item>
+ <item> CaretListener </item>
+ <item> CaretPolicy </item>
+ <item> CellEditor </item>
+ <item> CellEditorListener </item>
+ <item> CellRendererPane </item>
+ <item> CertPath </item>
+ <item> CertPathBuilder </item>
+ <item> CertPathBuilderException </item>
+ <item> CertPathBuilderResult </item>
+ <item> CertPathBuilderSpi </item>
+ <item> CertPathParameters </item>
+ <item> CertPathRep </item>
+ <item> CertPathValidator </item>
+ <item> CertPathValidatorException </item>
+ <item> CertPathValidatorResult </item>
+ <item> CertPathValidatorSpi </item>
+ <item> CertSelector </item>
+ <item> CertStore </item>
+ <item> CertStoreException </item>
+ <item> CertStoreParameters </item>
+ <item> CertStoreSpi </item>
+ <item> Certificate </item>
+ <item> Certificate </item>
+ <item> Certificate </item>
+ <item> CertificateEncodingException </item>
+ <item> CertificateEncodingException </item>
+ <item> CertificateException </item>
+ <item> CertificateException </item>
+ <item> CertificateExpiredException </item>
+ <item> CertificateExpiredException </item>
+ <item> CertificateFactory </item>
+ <item> CertificateFactorySpi </item>
+ <item> CertificateNotYetValidException </item>
+ <item> CertificateNotYetValidException </item>
+ <item> CertificateParsingException </item>
+ <item> CertificateParsingException </item>
+ <item> CertificateRep </item>
+ <item> ChangeEvent </item>
+ <item> ChangeListener </item>
+ <item> ChangedCharSetException </item>
+ <item> Channel </item>
+ <item> ChannelBinding </item>
+ <item> Channels </item>
+ <item> CharArrayReader </item>
+ <item> CharArrayWriter </item>
+ <item> CharBuffer </item>
+ <item> CharConversionException </item>
+ <item> CharHolder </item>
+ <item> CharSeqHelper </item>
+ <item> CharSeqHolder </item>
+ <item> CharSequence </item>
+ <item> Character </item>
+ <item> CharacterAttribute </item>
+ <item> CharacterCodingException </item>
+ <item> CharacterConstants </item>
+ <item> CharacterData </item>
+ <item> CharacterIterator </item>
+ <item> Charset </item>
+ <item> CharsetDecoder </item>
+ <item> CharsetEncoder </item>
+ <item> CharsetProvider </item>
+ <item> Checkbox </item>
+ <item> CheckboxGroup </item>
+ <item> CheckboxMenuItem </item>
+ <item> CheckedInputStream </item>
+ <item> CheckedOutputStream </item>
+ <item> Checksum </item>
+ <item> Choice </item>
+ <item> ChoiceCallback </item>
+ <item> ChoiceFormat </item>
+ <item> Chromaticity </item>
+ <item> Cipher </item>
+ <item> CipherInputStream </item>
+ <item> CipherOutputStream </item>
+ <item> CipherSpi </item>
+ <item> Class </item>
+ <item> ClassCastException </item>
+ <item> ClassCircularityError </item>
+ <item> ClassDesc </item>
+ <item> ClassFormatError </item>
+ <item> ClassLoader </item>
+ <item> ClassNotFoundException </item>
+ <item> ClientRequestInfo </item>
+ <item> ClientRequestInfoOperations </item>
+ <item> ClientRequestInterceptor </item>
+ <item> ClientRequestInterceptorOperations </item>
+ <item> Clip </item>
+ <item> Clipboard </item>
+ <item> ClipboardOwner </item>
+ <item> Clob </item>
+ <item> CloneNotSupportedException </item>
+ <item> Cloneable </item>
+ <item> ClosedByInterruptException </item>
+ <item> ClosedChannelException </item>
+ <item> ClosedSelectorException </item>
+ <item> CodeSets </item>
+ <item> CodeSource </item>
+ <item> Codec </item>
+ <item> CodecFactory </item>
+ <item> CodecFactoryHelper </item>
+ <item> CodecFactoryOperations </item>
+ <item> CodecOperations </item>
+ <item> CoderMalfunctionError </item>
+ <item> CoderResult </item>
+ <item> CodingErrorAction </item>
+ <item> CollationElementIterator </item>
+ <item> CollationKey </item>
+ <item> Collator </item>
+ <item> Collection </item>
+ <item> CollectionCertStoreParameters </item>
+ <item> Collections </item>
+ <item> Color </item>
+ <item> ColorAttribute </item>
+ <item> ColorChooserComponentFactory </item>
+ <item> ColorChooserUI </item>
+ <item> ColorConstants </item>
+ <item> ColorConvertOp </item>
+ <item> ColorModel </item>
+ <item> ColorSelectionModel </item>
+ <item> ColorSpace </item>
+ <item> ColorSupported </item>
+ <item> ColorType </item>
+ <item> ColorUIResource </item>
+ <item> ComboBoxEditor </item>
+ <item> ComboBoxModel </item>
+ <item> ComboBoxUI </item>
+ <item> ComboPopup </item>
+ <item> CommandEnvironment </item>
+ <item> Comment </item>
+ <item> CommunicationException </item>
+ <item> Comparable </item>
+ <item> Comparator </item>
+ <item> Compiler </item>
+ <item> CompletionStatus </item>
+ <item> CompletionStatusHelper </item>
+ <item> Component </item>
+ <item> ComponentAdapter </item>
+ <item> ComponentColorModel </item>
+ <item> ComponentEvent </item>
+ <item> ComponentIdHelper </item>
+ <item> ComponentInputMap </item>
+ <item> ComponentInputMapUIResource </item>
+ <item> ComponentListener </item>
+ <item> ComponentOrientation </item>
+ <item> ComponentSampleModel </item>
+ <item> ComponentUI </item>
+ <item> ComponentView </item>
+ <item> Composite </item>
+ <item> CompositeContext </item>
+ <item> CompositeName </item>
+ <item> CompositeView </item>
+ <item> CompoundBorder </item>
+ <item> CompoundBorderUIResource </item>
+ <item> CompoundControl </item>
+ <item> CompoundEdit </item>
+ <item> CompoundName </item>
+ <item> Compression </item>
+ <item> ConcurrentModificationException </item>
+ <item> Configuration </item>
+ <item> ConfigurationException </item>
+ <item> ConfirmationCallback </item>
+ <item> ConnectException </item>
+ <item> ConnectException </item>
+ <item> ConnectIOException </item>
+ <item> Connection </item>
+ <item> ConnectionEvent </item>
+ <item> ConnectionEventListener </item>
+ <item> ConnectionPendingException </item>
+ <item> ConnectionPoolDataSource </item>
+ <item> ConsoleHandler </item>
+ <item> Constraints </item>
+ <item> Constructor </item>
+ <item> Container </item>
+ <item> ContainerAdapter </item>
+ <item> ContainerEvent </item>
+ <item> ContainerListener </item>
+ <item> ContainerOrderFocusTraversalPolicy </item>
+ <item> Content </item>
+ <item> ContentHandler </item>
+ <item> ContentHandler </item>
+ <item> ContentHandlerFactory </item>
+ <item> ContentModel </item>
+ <item> Context </item>
+ <item> Context </item>
+ <item> ContextList </item>
+ <item> ContextNotEmptyException </item>
+ <item> ContextualRenderedImageFactory </item>
+ <item> Control </item>
+ <item> Control </item>
+ <item> ControlFactory </item>
+ <item> ControllerEventListener </item>
+ <item> ConvolveOp </item>
+ <item> CookieHolder </item>
+ <item> Copies </item>
+ <item> CopiesSupported </item>
+ <item> CopyAction </item>
+ <item> CredentialExpiredException </item>
+ <item> CropImageFilter </item>
+ <item> CubicCurve2D </item>
+ <item> Currency </item>
+ <item> Current </item>
+ <item> Current </item>
+ <item> Current </item>
+ <item> CurrentHelper </item>
+ <item> CurrentHelper </item>
+ <item> CurrentHelper </item>
+ <item> CurrentHolder </item>
+ <item> CurrentOperations </item>
+ <item> CurrentOperations </item>
+ <item> CurrentOperations </item>
+ <item> Cursor </item>
+ <item> CustomMarshal </item>
+ <item> CustomValue </item>
+ <item> Customizer </item>
+ <item> CutAction </item>
+ <item> DATA_CONVERSION </item>
+ <item> DESKeySpec </item>
+ <item> DESedeKeySpec </item>
+ <item> DGC </item>
+ <item> DHGenParameterSpec </item>
+ <item> DHKey </item>
+ <item> DHParameterSpec </item>
+ <item> DHPrivateKey </item>
+ <item> DHPrivateKeySpec </item>
+ <item> DHPublicKey </item>
+ <item> DHPublicKeySpec </item>
+ <item> DOMException </item>
+ <item> DOMImplementation </item>
+ <item> DOMLocator </item>
+ <item> DOMResult </item>
+ <item> DOMSource </item>
+ <item> DSAKey </item>
+ <item> DSAKeyPairGenerator </item>
+ <item> DSAParameterSpec </item>
+ <item> DSAParams </item>
+ <item> DSAPrivateKey </item>
+ <item> DSAPrivateKeySpec </item>
+ <item> DSAPublicKey </item>
+ <item> DSAPublicKeySpec </item>
+ <item> DTD </item>
+ <item> DTDConstants </item>
+ <item> DTDHandler </item>
+ <item> DataBuffer </item>
+ <item> DataBufferByte </item>
+ <item> DataBufferDouble </item>
+ <item> DataBufferFloat </item>
+ <item> DataBufferInt </item>
+ <item> DataBufferShort </item>
+ <item> DataBufferUShort </item>
+ <item> DataFlavor </item>
+ <item> DataFormatException </item>
+ <item> DataInput </item>
+ <item> DataInputStream </item>
+ <item> DataInputStream </item>
+ <item> DataLine </item>
+ <item> DataOutput </item>
+ <item> DataOutputStream </item>
+ <item> DataOutputStream </item>
+ <item> DataSource </item>
+ <item> DataTruncation </item>
+ <item> DatabaseMetaData </item>
+ <item> DatagramChannel </item>
+ <item> DatagramPacket </item>
+ <item> DatagramSocket </item>
+ <item> DatagramSocketImpl </item>
+ <item> DatagramSocketImplFactory </item>
+ <item> Date </item>
+ <item> Date </item>
+ <item> DateEditor </item>
+ <item> DateFormat </item>
+ <item> DateFormatSymbols </item>
+ <item> DateFormatter </item>
+ <item> DateTimeAtCompleted </item>
+ <item> DateTimeAtCreation </item>
+ <item> DateTimeAtProcessing </item>
+ <item> DateTimeSyntax </item>
+ <item> DebugGraphics </item>
+ <item> DecimalFormat </item>
+ <item> DecimalFormatSymbols </item>
+ <item> DeclHandler </item>
+ <item> DefaultBoundedRangeModel </item>
+ <item> DefaultButtonModel </item>
+ <item> DefaultCaret </item>
+ <item> DefaultCellEditor </item>
+ <item> DefaultColorSelectionModel </item>
+ <item> DefaultComboBoxModel </item>
+ <item> DefaultDesktopManager </item>
+ <item> DefaultEditor </item>
+ <item> DefaultEditorKit </item>
+ <item> DefaultFocusManager </item>
+ <item> DefaultFocusTraversalPolicy </item>
+ <item> DefaultFormatter </item>
+ <item> DefaultFormatterFactory </item>
+ <item> DefaultHandler </item>
+ <item> DefaultHighlightPainter </item>
+ <item> DefaultHighlighter </item>
+ <item> DefaultKeyTypedAction </item>
+ <item> DefaultKeyboardFocusManager </item>
+ <item> DefaultListCellRenderer </item>
+ <item> DefaultListModel </item>
+ <item> DefaultListSelectionModel </item>
+ <item> DefaultMenuLayout </item>
+ <item> DefaultMetalTheme </item>
+ <item> DefaultMutableTreeNode </item>
+ <item> DefaultPersistenceDelegate </item>
+ <item> DefaultSelectionType </item>
+ <item> DefaultSingleSelectionModel </item>
+ <item> DefaultStyledDocument </item>
+ <item> DefaultTableCellRenderer </item>
+ <item> DefaultTableColumnModel </item>
+ <item> DefaultTableModel </item>
+ <item> DefaultTextUI </item>
+ <item> DefaultTreeCellEditor </item>
+ <item> DefaultTreeCellRenderer </item>
+ <item> DefaultTreeModel </item>
+ <item> DefaultTreeSelectionModel </item>
+ <item> DefinitionKind </item>
+ <item> DefinitionKindHelper </item>
+ <item> Deflater </item>
+ <item> DeflaterOutputStream </item>
+ <item> Delegate </item>
+ <item> Delegate </item>
+ <item> Delegate </item>
+ <item> DelegationPermission </item>
+ <item> DesignMode </item>
+ <item> DesktopIconUI </item>
+ <item> DesktopManager </item>
+ <item> DesktopPaneUI </item>
+ <item> Destination </item>
+ <item> DestinationType </item>
+ <item> DestroyFailedException </item>
+ <item> Destroyable </item>
+ <item> Dialog </item>
+ <item> DialogType </item>
+ <item> Dictionary </item>
+ <item> DigestException </item>
+ <item> DigestInputStream </item>
+ <item> DigestOutputStream </item>
+ <item> Dimension </item>
+ <item> Dimension2D </item>
+ <item> DimensionUIResource </item>
+ <item> DirContext </item>
+ <item> DirObjectFactory </item>
+ <item> DirStateFactory </item>
+ <item> DirectColorModel </item>
+ <item> DirectoryManager </item>
+ <item> DisplayMode </item>
+ <item> DnDConstants </item>
+ <item> Doc </item>
+ <item> DocAttribute </item>
+ <item> DocAttributeSet </item>
+ <item> DocFlavor </item>
+ <item> DocPrintJob </item>
+ <item> Document </item>
+ <item> Document </item>
+ <item> DocumentBuilder </item>
+ <item> DocumentBuilderFactory </item>
+ <item> DocumentEvent </item>
+ <item> DocumentFilter </item>
+ <item> DocumentFragment </item>
+ <item> DocumentHandler </item>
+ <item> DocumentListener </item>
+ <item> DocumentName </item>
+ <item> DocumentParser </item>
+ <item> DocumentType </item>
+ <item> DomainCombiner </item>
+ <item> DomainManager </item>
+ <item> DomainManagerOperations </item>
+ <item> Double </item>
+ <item> Double </item>
+ <item> Double </item>
+ <item> Double </item>
+ <item> Double </item>
+ <item> Double </item>
+ <item> Double </item>
+ <item> Double </item>
+ <item> Double </item>
+ <item> DoubleBuffer </item>
+ <item> DoubleHolder </item>
+ <item> DoubleSeqHelper </item>
+ <item> DoubleSeqHolder </item>
+ <item> DragGestureEvent </item>
+ <item> DragGestureListener </item>
+ <item> DragGestureRecognizer </item>
+ <item> DragSource </item>
+ <item> DragSourceAdapter </item>
+ <item> DragSourceContext </item>
+ <item> DragSourceDragEvent </item>
+ <item> DragSourceDropEvent </item>
+ <item> DragSourceEvent </item>
+ <item> DragSourceListener </item>
+ <item> DragSourceMotionListener </item>
+ <item> Driver </item>
+ <item> DriverManager </item>
+ <item> DriverPropertyInfo </item>
+ <item> DropTarget </item>
+ <item> DropTargetAdapter </item>
+ <item> DropTargetAutoScroller </item>
+ <item> DropTargetContext </item>
+ <item> DropTargetDragEvent </item>
+ <item> DropTargetDropEvent </item>
+ <item> DropTargetEvent </item>
+ <item> DropTargetListener </item>
+ <item> DuplicateName </item>
+ <item> DuplicateNameHelper </item>
+ <item> DynAny </item>
+ <item> DynAny </item>
+ <item> DynAnyFactory </item>
+ <item> DynAnyFactoryHelper </item>
+ <item> DynAnyFactoryOperations </item>
+ <item> DynAnyHelper </item>
+ <item> DynAnyOperations </item>
+ <item> DynAnySeqHelper </item>
+ <item> DynArray </item>
+ <item> DynArray </item>
+ <item> DynArrayHelper </item>
+ <item> DynArrayOperations </item>
+ <item> DynEnum </item>
+ <item> DynEnum </item>
+ <item> DynEnumHelper </item>
+ <item> DynEnumOperations </item>
+ <item> DynFixed </item>
+ <item> DynFixed </item>
+ <item> DynFixedHelper </item>
+ <item> DynFixedOperations </item>
+ <item> DynSequence </item>
+ <item> DynSequence </item>
+ <item> DynSequenceHelper </item>
+ <item> DynSequenceOperations </item>
+ <item> DynStruct </item>
+ <item> DynStruct </item>
+ <item> DynStructHelper </item>
+ <item> DynStructOperations </item>
+ <item> DynUnion </item>
+ <item> DynUnion </item>
+ <item> DynUnionHelper </item>
+ <item> DynUnionOperations </item>
+ <item> DynValue </item>
+ <item> DynValue </item>
+ <item> DynValueBox </item>
+ <item> DynValueBoxOperations </item>
+ <item> DynValueCommon </item>
+ <item> DynValueCommonOperations </item>
+ <item> DynValueHelper </item>
+ <item> DynValueOperations </item>
+ <item> DynamicImplementation </item>
+ <item> DynamicImplementation </item>
+ <item> DynamicUtilTreeNode </item>
+ <item> ENCODING_CDR_ENCAPS </item>
+ <item> EOFException </item>
+ <item> EditorKit </item>
+ <item> Element </item>
+ <item> Element </item>
+ <item> Element </item>
+ <item> ElementChange </item>
+ <item> ElementEdit </item>
+ <item> ElementIterator </item>
+ <item> ElementSpec </item>
+ <item> Ellipse2D </item>
+ <item> EmptyBorder </item>
+ <item> EmptyBorderUIResource </item>
+ <item> EmptySelectionModel </item>
+ <item> EmptyStackException </item>
+ <item> EncodedKeySpec </item>
+ <item> Encoder </item>
+ <item> Encoding </item>
+ <item> Encoding </item>
+ <item> EncryptedPrivateKeyInfo </item>
+ <item> Engineering </item>
+ <item> Entity </item>
+ <item> Entity </item>
+ <item> EntityReference </item>
+ <item> EntityResolver </item>
+ <item> Entry </item>
+ <item> EnumControl </item>
+ <item> EnumSyntax </item>
+ <item> Enumeration </item>
+ <item> Environment </item>
+ <item> Error </item>
+ <item> ErrorHandler </item>
+ <item> ErrorListener </item>
+ <item> ErrorManager </item>
+ <item> EtchedBorder </item>
+ <item> EtchedBorderUIResource </item>
+ <item> Event </item>
+ <item> EventContext </item>
+ <item> EventDirContext </item>
+ <item> EventHandler </item>
+ <item> EventListener </item>
+ <item> EventListenerList </item>
+ <item> EventListenerProxy </item>
+ <item> EventObject </item>
+ <item> EventQueue </item>
+ <item> EventSetDescriptor </item>
+ <item> EventType </item>
+ <item> EventType </item>
+ <item> Exception </item>
+ <item> ExceptionInInitializerError </item>
+ <item> ExceptionList </item>
+ <item> ExceptionListener </item>
+ <item> ExemptionMechanism </item>
+ <item> ExemptionMechanismException </item>
+ <item> ExemptionMechanismSpi </item>
+ <item> ExpandVetoException </item>
+ <item> ExportException </item>
+ <item> Expression </item>
+ <item> ExtendedRequest </item>
+ <item> ExtendedResponse </item>
+ <item> Externalizable </item>
+ <item> FREE_MEM </item>
+ <item> FactoryConfigurationError </item>
+ <item> FailedLoginException </item>
+ <item> FeatureDescriptor </item>
+ <item> Fidelity </item>
+ <item> Field </item>
+ <item> Field </item>
+ <item> Field </item>
+ <item> Field </item>
+ <item> Field </item>
+ <item> FieldBorder </item>
+ <item> FieldNameHelper </item>
+ <item> FieldNameHelper </item>
+ <item> FieldPosition </item>
+ <item> FieldView </item>
+ <item> File </item>
+ <item> FileCacheImageInputStream </item>
+ <item> FileCacheImageOutputStream </item>
+ <item> FileChannel </item>
+ <item> FileChooserUI </item>
+ <item> FileDescriptor </item>
+ <item> FileDialog </item>
+ <item> FileFilter </item>
+ <item> FileFilter </item>
+ <item> FileHandler </item>
+ <item> FileIcon16 </item>
+ <item> FileImageInputStream </item>
+ <item> FileImageOutputStream </item>
+ <item> FileInputStream </item>
+ <item> FileLock </item>
+ <item> FileLockInterruptionException </item>
+ <item> FileNameMap </item>
+ <item> FileNotFoundException </item>
+ <item> FileOutputStream </item>
+ <item> FilePermission </item>
+ <item> FileReader </item>
+ <item> FileSystemView </item>
+ <item> FileView </item>
+ <item> FileWriter </item>
+ <item> FilenameFilter </item>
+ <item> Filler </item>
+ <item> Filter </item>
+ <item> Filter </item>
+ <item> FilterBypass </item>
+ <item> FilterBypass </item>
+ <item> FilterInputStream </item>
+ <item> FilterOutputStream </item>
+ <item> FilterReader </item>
+ <item> FilterWriter </item>
+ <item> FilteredImageSource </item>
+ <item> Finishings </item>
+ <item> FixedHeightLayoutCache </item>
+ <item> FixedHolder </item>
+ <item> FlatteningPathIterator </item>
+ <item> FlavorException </item>
+ <item> FlavorMap </item>
+ <item> FlavorTable </item>
+ <item> FlipContents </item>
+ <item> Float </item>
+ <item> Float </item>
+ <item> Float </item>
+ <item> Float </item>
+ <item> Float </item>
+ <item> Float </item>
+ <item> Float </item>
+ <item> Float </item>
+ <item> Float </item>
+ <item> FloatBuffer </item>
+ <item> FloatControl </item>
+ <item> FloatHolder </item>
+ <item> FloatSeqHelper </item>
+ <item> FloatSeqHolder </item>
+ <item> FlowLayout </item>
+ <item> FlowStrategy </item>
+ <item> FlowView </item>
+ <item> Flush3DBorder </item>
+ <item> FocusAdapter </item>
+ <item> FocusEvent </item>
+ <item> FocusListener </item>
+ <item> FocusManager </item>
+ <item> FocusTraversalPolicy </item>
+ <item> FolderIcon16 </item>
+ <item> Font </item>
+ <item> FontAttribute </item>
+ <item> FontConstants </item>
+ <item> FontFamilyAction </item>
+ <item> FontFormatException </item>
+ <item> FontMetrics </item>
+ <item> FontRenderContext </item>
+ <item> FontSizeAction </item>
+ <item> FontUIResource </item>
+ <item> ForegroundAction </item>
+ <item> FormView </item>
+ <item> Format </item>
+ <item> FormatConversionProvider </item>
+ <item> FormatMismatch </item>
+ <item> FormatMismatchHelper </item>
+ <item> Formatter </item>
+ <item> ForwardRequest </item>
+ <item> ForwardRequest </item>
+ <item> ForwardRequestHelper </item>
+ <item> ForwardRequestHelper </item>
+ <item> Frame </item>
+ <item> GSSContext </item>
+ <item> GSSCredential </item>
+ <item> GSSException </item>
+ <item> GSSManager </item>
+ <item> GSSName </item>
+ <item> GZIPInputStream </item>
+ <item> GZIPOutputStream </item>
+ <item> GapContent </item>
+ <item> GatheringByteChannel </item>
+ <item> GeneralPath </item>
+ <item> GeneralSecurityException </item>
+ <item> GetField </item>
+ <item> GlyphJustificationInfo </item>
+ <item> GlyphMetrics </item>
+ <item> GlyphPainter </item>
+ <item> GlyphVector </item>
+ <item> GlyphView </item>
+ <item> GradientPaint </item>
+ <item> GraphicAttribute </item>
+ <item> Graphics </item>
+ <item> Graphics2D </item>
+ <item> GraphicsConfigTemplate </item>
+ <item> GraphicsConfiguration </item>
+ <item> GraphicsDevice </item>
+ <item> GraphicsEnvironment </item>
+ <item> GrayFilter </item>
+ <item> GregorianCalendar </item>
+ <item> GridBagConstraints </item>
+ <item> GridBagLayout </item>
+ <item> GridLayout </item>
+ <item> Group </item>
+ <item> Guard </item>
+ <item> GuardedObject </item>
+ <item> HTML </item>
+ <item> HTMLDocument </item>
+ <item> HTMLEditorKit </item>
+ <item> HTMLEditorKit </item>
+ <item> HTMLEditorKit </item>
+ <item> HTMLFrameHyperlinkEvent </item>
+ <item> HTMLWriter </item>
+ <item> Handler </item>
+ <item> HandlerBase </item>
+ <item> HandshakeCompletedEvent </item>
+ <item> HandshakeCompletedListener </item>
+ <item> HasControls </item>
+ <item> HashAttributeSet </item>
+ <item> HashDocAttributeSet </item>
+ <item> HashMap </item>
+ <item> HashPrintJobAttributeSet </item>
+ <item> HashPrintRequestAttributeSet </item>
+ <item> HashPrintServiceAttributeSet </item>
+ <item> HashSet </item>
+ <item> Hashtable </item>
+ <item> HeadlessException </item>
+ <item> HierarchyBoundsAdapter </item>
+ <item> HierarchyBoundsListener </item>
+ <item> HierarchyEvent </item>
+ <item> HierarchyListener </item>
+ <item> Highlight </item>
+ <item> HighlightPainter </item>
+ <item> Highlighter </item>
+ <item> HostnameVerifier </item>
+ <item> HttpURLConnection </item>
+ <item> HttpsURLConnection </item>
+ <item> HyperlinkEvent </item>
+ <item> HyperlinkListener </item>
+ <item> ICC_ColorSpace </item>
+ <item> ICC_Profile </item>
+ <item> ICC_ProfileGray </item>
+ <item> ICC_ProfileRGB </item>
+ <item> IDLEntity </item>
+ <item> IDLType </item>
+ <item> IDLTypeHelper </item>
+ <item> IDLTypeOperations </item>
+ <item> ID_ASSIGNMENT_POLICY_ID </item>
+ <item> ID_UNIQUENESS_POLICY_ID </item>
+ <item> IIOByteBuffer </item>
+ <item> IIOException </item>
+ <item> IIOImage </item>
+ <item> IIOInvalidTreeException </item>
+ <item> IIOMetadata </item>
+ <item> IIOMetadataController </item>
+ <item> IIOMetadataFormat </item>
+ <item> IIOMetadataFormatImpl </item>
+ <item> IIOMetadataNode </item>
+ <item> IIOParam </item>
+ <item> IIOParamController </item>
+ <item> IIOReadProgressListener </item>
+ <item> IIOReadUpdateListener </item>
+ <item> IIOReadWarningListener </item>
+ <item> IIORegistry </item>
+ <item> IIOServiceProvider </item>
+ <item> IIOWriteProgressListener </item>
+ <item> IIOWriteWarningListener </item>
+ <item> IMPLICIT_ACTIVATION_POLICY_ID </item>
+ <item> IMP_LIMIT </item>
+ <item> INITIALIZE </item>
+ <item> INPUT_STREAM </item>
+ <item> INTERNAL </item>
+ <item> INTF_REPOS </item>
+ <item> INVALID_TRANSACTION </item>
+ <item> INV_FLAG </item>
+ <item> INV_IDENT </item>
+ <item> INV_OBJREF </item>
+ <item> INV_POLICY </item>
+ <item> IOException </item>
+ <item> IOR </item>
+ <item> IORHelper </item>
+ <item> IORHolder </item>
+ <item> IORInfo </item>
+ <item> IORInfoOperations </item>
+ <item> IORInterceptor </item>
+ <item> IORInterceptorOperations </item>
+ <item> IRObject </item>
+ <item> IRObjectOperations </item>
+ <item> ISO </item>
+ <item> Icon </item>
+ <item> IconUIResource </item>
+ <item> IconView </item>
+ <item> IdAssignmentPolicy </item>
+ <item> IdAssignmentPolicyOperations </item>
+ <item> IdAssignmentPolicyValue </item>
+ <item> IdUniquenessPolicy </item>
+ <item> IdUniquenessPolicyOperations </item>
+ <item> IdUniquenessPolicyValue </item>
+ <item> IdentifierHelper </item>
+ <item> Identity </item>
+ <item> IdentityHashMap </item>
+ <item> IdentityScope </item>
+ <item> IllegalAccessError </item>
+ <item> IllegalAccessException </item>
+ <item> IllegalArgumentException </item>
+ <item> IllegalBlockSizeException </item>
+ <item> IllegalBlockingModeException </item>
+ <item> IllegalCharsetNameException </item>
+ <item> IllegalComponentStateException </item>
+ <item> IllegalMonitorStateException </item>
+ <item> IllegalPathStateException </item>
+ <item> IllegalSelectorException </item>
+ <item> IllegalStateException </item>
+ <item> IllegalThreadStateException </item>
+ <item> Image </item>
+ <item> ImageCapabilities </item>
+ <item> ImageConsumer </item>
+ <item> ImageFilter </item>
+ <item> ImageGraphicAttribute </item>
+ <item> ImageIO </item>
+ <item> ImageIcon </item>
+ <item> ImageInputStream </item>
+ <item> ImageInputStreamImpl </item>
+ <item> ImageInputStreamSpi </item>
+ <item> ImageObserver </item>
+ <item> ImageOutputStream </item>
+ <item> ImageOutputStreamImpl </item>
+ <item> ImageOutputStreamSpi </item>
+ <item> ImageProducer </item>
+ <item> ImageReadParam </item>
+ <item> ImageReader </item>
+ <item> ImageReaderSpi </item>
+ <item> ImageReaderWriterSpi </item>
+ <item> ImageTranscoder </item>
+ <item> ImageTranscoderSpi </item>
+ <item> ImageTypeSpecifier </item>
+ <item> ImageView </item>
+ <item> ImageWriteParam </item>
+ <item> ImageWriter </item>
+ <item> ImageWriterSpi </item>
+ <item> ImagingOpException </item>
+ <item> ImplicitActivationPolicy </item>
+ <item> ImplicitActivationPolicyOperations </item>
+ <item> ImplicitActivationPolicyValue </item>
+ <item> IncompatibleClassChangeError </item>
+ <item> InconsistentTypeCode </item>
+ <item> InconsistentTypeCode </item>
+ <item> InconsistentTypeCodeHelper </item>
+ <item> IndexColorModel </item>
+ <item> IndexOutOfBoundsException </item>
+ <item> IndexedPropertyDescriptor </item>
+ <item> IndirectionException </item>
+ <item> Inet4Address </item>
+ <item> Inet6Address </item>
+ <item> InetAddress </item>
+ <item> InetSocketAddress </item>
+ <item> Inflater </item>
+ <item> InflaterInputStream </item>
+ <item> Info </item>
+ <item> Info </item>
+ <item> Info </item>
+ <item> Info </item>
+ <item> Info </item>
+ <item> InheritableThreadLocal </item>
+ <item> InitialContext </item>
+ <item> InitialContextFactory </item>
+ <item> InitialContextFactoryBuilder </item>
+ <item> InitialDirContext </item>
+ <item> InitialLdapContext </item>
+ <item> InlineView </item>
+ <item> InputContext </item>
+ <item> InputEvent </item>
+ <item> InputMap </item>
+ <item> InputMapUIResource </item>
+ <item> InputMethod </item>
+ <item> InputMethodContext </item>
+ <item> InputMethodDescriptor </item>
+ <item> InputMethodEvent </item>
+ <item> InputMethodHighlight </item>
+ <item> InputMethodListener </item>
+ <item> InputMethodRequests </item>
+ <item> InputSource </item>
+ <item> InputStream </item>
+ <item> InputStream </item>
+ <item> InputStream </item>
+ <item> InputStreamReader </item>
+ <item> InputSubset </item>
+ <item> InputVerifier </item>
+ <item> InsertBreakAction </item>
+ <item> InsertContentAction </item>
+ <item> InsertHTMLTextAction </item>
+ <item> InsertTabAction </item>
+ <item> Insets </item>
+ <item> InsetsUIResource </item>
+ <item> InstantiationError </item>
+ <item> InstantiationException </item>
+ <item> Instrument </item>
+ <item> InsufficientResourcesException </item>
+ <item> IntBuffer </item>
+ <item> IntHolder </item>
+ <item> Integer </item>
+ <item> IntegerSyntax </item>
+ <item> Interceptor </item>
+ <item> InterceptorOperations </item>
+ <item> InternalError </item>
+ <item> InternalFrameAdapter </item>
+ <item> InternalFrameBorder </item>
+ <item> InternalFrameEvent </item>
+ <item> InternalFrameFocusTraversalPolicy </item>
+ <item> InternalFrameListener </item>
+ <item> InternalFrameUI </item>
+ <item> InternationalFormatter </item>
+ <item> InterruptedException </item>
+ <item> InterruptedIOException </item>
+ <item> InterruptedNamingException </item>
+ <item> InterruptibleChannel </item>
+ <item> IntrospectionException </item>
+ <item> Introspector </item>
+ <item> Invalid </item>
+ <item> InvalidAddress </item>
+ <item> InvalidAddressHelper </item>
+ <item> InvalidAddressHolder </item>
+ <item> InvalidAlgorithmParameterException </item>
+ <item> InvalidAttributeIdentifierException </item>
+ <item> InvalidAttributeValueException </item>
+ <item> InvalidAttributesException </item>
+ <item> InvalidClassException </item>
+ <item> InvalidDnDOperationException </item>
+ <item> InvalidKeyException </item>
+ <item> InvalidKeySpecException </item>
+ <item> InvalidMarkException </item>
+ <item> InvalidMidiDataException </item>
+ <item> InvalidName </item>
+ <item> InvalidName </item>
+ <item> InvalidName </item>
+ <item> InvalidNameException </item>
+ <item> InvalidNameHelper </item>
+ <item> InvalidNameHelper </item>
+ <item> InvalidNameHolder </item>
+ <item> InvalidObjectException </item>
+ <item> InvalidParameterException </item>
+ <item> InvalidParameterSpecException </item>
+ <item> InvalidPolicy </item>
+ <item> InvalidPolicyHelper </item>
+ <item> InvalidPreferencesFormatException </item>
+ <item> InvalidSearchControlsException </item>
+ <item> InvalidSearchFilterException </item>
+ <item> InvalidSeq </item>
+ <item> InvalidSlot </item>
+ <item> InvalidSlotHelper </item>
+ <item> InvalidTransactionException </item>
+ <item> InvalidTypeForEncoding </item>
+ <item> InvalidTypeForEncodingHelper </item>
+ <item> InvalidValue </item>
+ <item> InvalidValue </item>
+ <item> InvalidValueHelper </item>
+ <item> InvocationEvent </item>
+ <item> InvocationHandler </item>
+ <item> InvocationTargetException </item>
+ <item> InvokeHandler </item>
+ <item> IstringHelper </item>
+ <item> ItalicAction </item>
+ <item> ItemEvent </item>
+ <item> ItemListener </item>
+ <item> ItemSelectable </item>
+ <item> Iterator </item>
+ <item> Iterator </item>
+ <item> IvParameterSpec </item>
+ <item> JApplet </item>
+ <item> JButton </item>
+ <item> JCheckBox </item>
+ <item> JCheckBoxMenuItem </item>
+ <item> JColorChooser </item>
+ <item> JComboBox </item>
+ <item> JComponent </item>
+ <item> JDesktopIcon </item>
+ <item> JDesktopPane </item>
+ <item> JDialog </item>
+ <item> JEditorPane </item>
+ <item> JFileChooser </item>
+ <item> JFormattedTextField </item>
+ <item> JFrame </item>
+ <item> JIS </item>
+ <item> JInternalFrame </item>
+ <item> JLabel </item>
+ <item> JLayeredPane </item>
+ <item> JList </item>
+ <item> JMenu </item>
+ <item> JMenuBar </item>
+ <item> JMenuItem </item>
+ <item> JOptionPane </item>
+ <item> JPEGHuffmanTable </item>
+ <item> JPEGImageReadParam </item>
+ <item> JPEGImageWriteParam </item>
+ <item> JPEGQTable </item>
+ <item> JPanel </item>
+ <item> JPasswordField </item>
+ <item> JPopupMenu </item>
+ <item> JProgressBar </item>
+ <item> JRadioButton </item>
+ <item> JRadioButtonMenuItem </item>
+ <item> JRootPane </item>
+ <item> JScrollBar </item>
+ <item> JScrollPane </item>
+ <item> JSeparator </item>
+ <item> JSlider </item>
+ <item> JSpinner </item>
+ <item> JSplitPane </item>
+ <item> JTabbedPane </item>
+ <item> JTable </item>
+ <item> JTableHeader </item>
+ <item> JTextArea </item>
+ <item> JTextComponent </item>
+ <item> JTextField </item>
+ <item> JTextPane </item>
+ <item> JToggleButton </item>
+ <item> JToolBar </item>
+ <item> JToolTip </item>
+ <item> JTree </item>
+ <item> JViewport </item>
+ <item> JWindow </item>
+ <item> JarEntry </item>
+ <item> JarException </item>
+ <item> JarFile </item>
+ <item> JarInputStream </item>
+ <item> JarOutputStream </item>
+ <item> JarURLConnection </item>
+ <item> JobAttributes </item>
+ <item> JobHoldUntil </item>
+ <item> JobImpressions </item>
+ <item> JobImpressionsCompleted </item>
+ <item> JobImpressionsSupported </item>
+ <item> JobKOctets </item>
+ <item> JobKOctetsProcessed </item>
+ <item> JobKOctetsSupported </item>
+ <item> JobMediaSheets </item>
+ <item> JobMediaSheetsCompleted </item>
+ <item> JobMediaSheetsSupported </item>
+ <item> JobMessageFromOperator </item>
+ <item> JobName </item>
+ <item> JobOriginatingUserName </item>
+ <item> JobPriority </item>
+ <item> JobPrioritySupported </item>
+ <item> JobSheets </item>
+ <item> JobState </item>
+ <item> JobStateReason </item>
+ <item> JobStateReasons </item>
+ <item> KerberosKey </item>
+ <item> KerberosPrincipal </item>
+ <item> KerberosTicket </item>
+ <item> Kernel </item>
+ <item> Key </item>
+ <item> Key </item>
+ <item> KeyAdapter </item>
+ <item> KeyAgreement </item>
+ <item> KeyAgreementSpi </item>
+ <item> KeyBinding </item>
+ <item> KeyEvent </item>
+ <item> KeyEventDispatcher </item>
+ <item> KeyEventPostProcessor </item>
+ <item> KeyException </item>
+ <item> KeyFactory </item>
+ <item> KeyFactorySpi </item>
+ <item> KeyGenerator </item>
+ <item> KeyGeneratorSpi </item>
+ <item> KeyListener </item>
+ <item> KeyManagementException </item>
+ <item> KeyManager </item>
+ <item> KeyManagerFactory </item>
+ <item> KeyManagerFactorySpi </item>
+ <item> KeyPair </item>
+ <item> KeyPairGenerator </item>
+ <item> KeyPairGeneratorSpi </item>
+ <item> KeySelectionManager </item>
+ <item> KeySpec </item>
+ <item> KeyStore </item>
+ <item> KeyStoreException </item>
+ <item> KeyStoreSpi </item>
+ <item> KeyStroke </item>
+ <item> KeyboardFocusManager </item>
+ <item> Keymap </item>
+ <item> LDAPCertStoreParameters </item>
+ <item> LIFESPAN_POLICY_ID </item>
+ <item> LOCATION_FORWARD </item>
+ <item> Label </item>
+ <item> LabelUI </item>
+ <item> LabelView </item>
+ <item> LanguageCallback </item>
+ <item> LastOwnerException </item>
+ <item> LayerPainter </item>
+ <item> LayeredHighlighter </item>
+ <item> LayoutFocusTraversalPolicy </item>
+ <item> LayoutManager </item>
+ <item> LayoutManager2 </item>
+ <item> LayoutQueue </item>
+ <item> LazyInputMap </item>
+ <item> LazyValue </item>
+ <item> LdapContext </item>
+ <item> LdapReferralException </item>
+ <item> Lease </item>
+ <item> Level </item>
+ <item> LexicalHandler </item>
+ <item> LifespanPolicy </item>
+ <item> LifespanPolicyOperations </item>
+ <item> LifespanPolicyValue </item>
+ <item> LimitExceededException </item>
+ <item> Line </item>
+ <item> Line2D </item>
+ <item> LineBorder </item>
+ <item> LineBorderUIResource </item>
+ <item> LineBreakMeasurer </item>
+ <item> LineEvent </item>
+ <item> LineListener </item>
+ <item> LineMetrics </item>
+ <item> LineNumberInputStream </item>
+ <item> LineNumberReader </item>
+ <item> LineUnavailableException </item>
+ <item> LinkController </item>
+ <item> LinkException </item>
+ <item> LinkLoopException </item>
+ <item> LinkRef </item>
+ <item> LinkageError </item>
+ <item> LinkedHashMap </item>
+ <item> LinkedHashSet </item>
+ <item> LinkedList </item>
+ <item> List </item>
+ <item> List </item>
+ <item> ListCellRenderer </item>
+ <item> ListDataEvent </item>
+ <item> ListDataListener </item>
+ <item> ListEditor </item>
+ <item> ListIterator </item>
+ <item> ListModel </item>
+ <item> ListPainter </item>
+ <item> ListResourceBundle </item>
+ <item> ListSelectionEvent </item>
+ <item> ListSelectionListener </item>
+ <item> ListSelectionModel </item>
+ <item> ListUI </item>
+ <item> ListView </item>
+ <item> LoaderHandler </item>
+ <item> LocalObject </item>
+ <item> Locale </item>
+ <item> LocateRegistry </item>
+ <item> Locator </item>
+ <item> LocatorImpl </item>
+ <item> LogManager </item>
+ <item> LogRecord </item>
+ <item> LogStream </item>
+ <item> Logger </item>
+ <item> LoggingPermission </item>
+ <item> LoginContext </item>
+ <item> LoginException </item>
+ <item> LoginModule </item>
+ <item> LoginModuleControlFlag </item>
+ <item> Long </item>
+ <item> LongBuffer </item>
+ <item> LongHolder </item>
+ <item> LongLongSeqHelper </item>
+ <item> LongLongSeqHolder </item>
+ <item> LongSeqHelper </item>
+ <item> LongSeqHolder </item>
+ <item> LookAndFeel </item>
+ <item> LookAndFeelInfo </item>
+ <item> LookupOp </item>
+ <item> LookupTable </item>
+ <item> MARSHAL </item>
+ <item> Mac </item>
+ <item> MacSpi </item>
+ <item> MalformedInputException </item>
+ <item> MalformedLinkException </item>
+ <item> MalformedURLException </item>
+ <item> ManagerFactoryParameters </item>
+ <item> Manifest </item>
+ <item> Map </item>
+ <item> MapMode </item>
+ <item> MappedByteBuffer </item>
+ <item> MarginBorder </item>
+ <item> MarshalException </item>
+ <item> MarshalledObject </item>
+ <item> MaskFormatter </item>
+ <item> Matcher </item>
+ <item> Math </item>
+ <item> MatteBorder </item>
+ <item> MatteBorderUIResource </item>
+ <item> Media </item>
+ <item> MediaName </item>
+ <item> MediaPrintableArea </item>
+ <item> MediaSize </item>
+ <item> MediaSizeName </item>
+ <item> MediaTracker </item>
+ <item> MediaTray </item>
+ <item> MediaType </item>
+ <item> Member </item>
+ <item> MemoryCacheImageInputStream </item>
+ <item> MemoryCacheImageOutputStream </item>
+ <item> MemoryHandler </item>
+ <item> MemoryImageSource </item>
+ <item> Menu </item>
+ <item> MenuBar </item>
+ <item> MenuBarBorder </item>
+ <item> MenuBarBorder </item>
+ <item> MenuBarUI </item>
+ <item> MenuComponent </item>
+ <item> MenuContainer </item>
+ <item> MenuDragMouseEvent </item>
+ <item> MenuDragMouseListener </item>
+ <item> MenuElement </item>
+ <item> MenuEvent </item>
+ <item> MenuItem </item>
+ <item> MenuItemBorder </item>
+ <item> MenuItemUI </item>
+ <item> MenuKeyEvent </item>
+ <item> MenuKeyListener </item>
+ <item> MenuListener </item>
+ <item> MenuSelectionManager </item>
+ <item> MenuShortcut </item>
+ <item> MessageDigest </item>
+ <item> MessageDigestSpi </item>
+ <item> MessageFormat </item>
+ <item> MessageProp </item>
+ <item> MetaEventListener </item>
+ <item> MetaMessage </item>
+ <item> MetalBorders </item>
+ <item> MetalButtonUI </item>
+ <item> MetalCheckBoxIcon </item>
+ <item> MetalCheckBoxUI </item>
+ <item> MetalComboBoxButton </item>
+ <item> MetalComboBoxEditor </item>
+ <item> MetalComboBoxIcon </item>
+ <item> MetalComboBoxUI </item>
+ <item> MetalDesktopIconUI </item>
+ <item> MetalFileChooserUI </item>
+ <item> MetalIconFactory </item>
+ <item> MetalInternalFrameTitlePane </item>
+ <item> MetalInternalFrameUI </item>
+ <item> MetalLabelUI </item>
+ <item> MetalLookAndFeel </item>
+ <item> MetalPopupMenuSeparatorUI </item>
+ <item> MetalProgressBarUI </item>
+ <item> MetalRadioButtonUI </item>
+ <item> MetalRootPaneUI </item>
+ <item> MetalScrollBarUI </item>
+ <item> MetalScrollButton </item>
+ <item> MetalScrollPaneUI </item>
+ <item> MetalSeparatorUI </item>
+ <item> MetalSliderUI </item>
+ <item> MetalSplitPaneUI </item>
+ <item> MetalTabbedPaneUI </item>
+ <item> MetalTextFieldUI </item>
+ <item> MetalTheme </item>
+ <item> MetalToggleButtonUI </item>
+ <item> MetalToolBarUI </item>
+ <item> MetalToolTipUI </item>
+ <item> MetalTreeUI </item>
+ <item> Method </item>
+ <item> MethodDescriptor </item>
+ <item> MidiChannel </item>
+ <item> MidiDevice </item>
+ <item> MidiDeviceProvider </item>
+ <item> MidiEvent </item>
+ <item> MidiFileFormat </item>
+ <item> MidiFileReader </item>
+ <item> MidiFileWriter </item>
+ <item> MidiMessage </item>
+ <item> MidiSystem </item>
+ <item> MidiUnavailableException </item>
+ <item> MimeTypeParseException </item>
+ <item> MinimalHTMLWriter </item>
+ <item> MissingResourceException </item>
+ <item> Mixer </item>
+ <item> MixerProvider </item>
+ <item> ModificationItem </item>
+ <item> Modifier </item>
+ <item> MouseAdapter </item>
+ <item> MouseDragGestureRecognizer </item>
+ <item> MouseEvent </item>
+ <item> MouseInputAdapter </item>
+ <item> MouseInputListener </item>
+ <item> MouseListener </item>
+ <item> MouseMotionAdapter </item>
+ <item> MouseMotionListener </item>
+ <item> MouseWheelEvent </item>
+ <item> MouseWheelListener </item>
+ <item> MultiButtonUI </item>
+ <item> MultiColorChooserUI </item>
+ <item> MultiComboBoxUI </item>
+ <item> MultiDesktopIconUI </item>
+ <item> MultiDesktopPaneUI </item>
+ <item> MultiDoc </item>
+ <item> MultiDocPrintJob </item>
+ <item> MultiDocPrintService </item>
+ <item> MultiFileChooserUI </item>
+ <item> MultiInternalFrameUI </item>
+ <item> MultiLabelUI </item>
+ <item> MultiListUI </item>
+ <item> MultiLookAndFeel </item>
+ <item> MultiMenuBarUI </item>
+ <item> MultiMenuItemUI </item>
+ <item> MultiOptionPaneUI </item>
+ <item> MultiPanelUI </item>
+ <item> MultiPixelPackedSampleModel </item>
+ <item> MultiPopupMenuUI </item>
+ <item> MultiProgressBarUI </item>
+ <item> MultiRootPaneUI </item>
+ <item> MultiScrollBarUI </item>
+ <item> MultiScrollPaneUI </item>
+ <item> MultiSeparatorUI </item>
+ <item> MultiSliderUI </item>
+ <item> MultiSpinnerUI </item>
+ <item> MultiSplitPaneUI </item>
+ <item> MultiTabbedPaneUI </item>
+ <item> MultiTableHeaderUI </item>
+ <item> MultiTableUI </item>
+ <item> MultiTextUI </item>
+ <item> MultiToolBarUI </item>
+ <item> MultiToolTipUI </item>
+ <item> MultiTreeUI </item>
+ <item> MultiViewportUI </item>
+ <item> MulticastSocket </item>
+ <item> MultipleComponentProfileHelper </item>
+ <item> MultipleComponentProfileHolder </item>
+ <item> MultipleDocumentHandling </item>
+ <item> MultipleDocumentHandlingType </item>
+ <item> MultipleMaster </item>
+ <item> MutableAttributeSet </item>
+ <item> MutableComboBoxModel </item>
+ <item> MutableTreeNode </item>
+ <item> NA </item>
+ <item> NO_IMPLEMENT </item>
+ <item> NO_MEMORY </item>
+ <item> NO_PERMISSION </item>
+ <item> NO_RESOURCES </item>
+ <item> NO_RESPONSE </item>
+ <item> NVList </item>
+ <item> Name </item>
+ <item> Name </item>
+ <item> NameAlreadyBoundException </item>
+ <item> NameCallback </item>
+ <item> NameClassPair </item>
+ <item> NameComponent </item>
+ <item> NameComponentHelper </item>
+ <item> NameComponentHolder </item>
+ <item> NameDynAnyPair </item>
+ <item> NameDynAnyPairHelper </item>
+ <item> NameDynAnyPairSeqHelper </item>
+ <item> NameHelper </item>
+ <item> NameHolder </item>
+ <item> NameNotFoundException </item>
+ <item> NameParser </item>
+ <item> NameValuePair </item>
+ <item> NameValuePair </item>
+ <item> NameValuePairHelper </item>
+ <item> NameValuePairHelper </item>
+ <item> NameValuePairSeqHelper </item>
+ <item> NamedNodeMap </item>
+ <item> NamedValue </item>
+ <item> NamespaceChangeListener </item>
+ <item> NamespaceSupport </item>
+ <item> Naming </item>
+ <item> NamingContext </item>
+ <item> NamingContextExt </item>
+ <item> NamingContextExtHelper </item>
+ <item> NamingContextExtHolder </item>
+ <item> NamingContextExtOperations </item>
+ <item> NamingContextExtPOA </item>
+ <item> NamingContextHelper </item>
+ <item> NamingContextHolder </item>
+ <item> NamingContextOperations </item>
+ <item> NamingContextPOA </item>
+ <item> NamingEnumeration </item>
+ <item> NamingEvent </item>
+ <item> NamingException </item>
+ <item> NamingExceptionEvent </item>
+ <item> NamingListener </item>
+ <item> NamingManager </item>
+ <item> NamingSecurityException </item>
+ <item> NavigationFilter </item>
+ <item> NegativeArraySizeException </item>
+ <item> NetPermission </item>
+ <item> NetworkInterface </item>
+ <item> NoClassDefFoundError </item>
+ <item> NoConnectionPendingException </item>
+ <item> NoContext </item>
+ <item> NoContextHelper </item>
+ <item> NoInitialContextException </item>
+ <item> NoPermissionException </item>
+ <item> NoRouteToHostException </item>
+ <item> NoServant </item>
+ <item> NoServantHelper </item>
+ <item> NoSuchAlgorithmException </item>
+ <item> NoSuchAttributeException </item>
+ <item> NoSuchElementException </item>
+ <item> NoSuchFieldError </item>
+ <item> NoSuchFieldException </item>
+ <item> NoSuchMethodError </item>
+ <item> NoSuchMethodException </item>
+ <item> NoSuchObjectException </item>
+ <item> NoSuchPaddingException </item>
+ <item> NoSuchProviderException </item>
+ <item> Node </item>
+ <item> NodeChangeEvent </item>
+ <item> NodeChangeListener </item>
+ <item> NodeDimensions </item>
+ <item> NodeList </item>
+ <item> NonReadableChannelException </item>
+ <item> NonWritableChannelException </item>
+ <item> NoninvertibleTransformException </item>
+ <item> NotActiveException </item>
+ <item> NotBoundException </item>
+ <item> NotContextException </item>
+ <item> NotEmpty </item>
+ <item> NotEmptyHelper </item>
+ <item> NotEmptyHolder </item>
+ <item> NotFound </item>
+ <item> NotFoundHelper </item>
+ <item> NotFoundHolder </item>
+ <item> NotFoundReason </item>
+ <item> NotFoundReasonHelper </item>
+ <item> NotFoundReasonHolder </item>
+ <item> NotOwnerException </item>
+ <item> NotSerializableException </item>
+ <item> NotYetBoundException </item>
+ <item> NotYetConnectedException </item>
+ <item> Notation </item>
+ <item> NullCipher </item>
+ <item> NullPointerException </item>
+ <item> Number </item>
+ <item> NumberEditor </item>
+ <item> NumberFormat </item>
+ <item> NumberFormatException </item>
+ <item> NumberFormatter </item>
+ <item> NumberOfDocuments </item>
+ <item> NumberOfInterveningJobs </item>
+ <item> NumberUp </item>
+ <item> NumberUpSupported </item>
+ <item> NumericShaper </item>
+ <item> OBJECT_NOT_EXIST </item>
+ <item> OBJ_ADAPTER </item>
+ <item> OMGVMCID </item>
+ <item> ORB </item>
+ <item> ORB </item>
+ <item> ORBInitInfo </item>
+ <item> ORBInitInfoOperations </item>
+ <item> ORBInitializer </item>
+ <item> ORBInitializerOperations </item>
+ <item> ObjID </item>
+ <item> Object </item>
+ <item> Object </item>
+ <item> ObjectAlreadyActive </item>
+ <item> ObjectAlreadyActiveHelper </item>
+ <item> ObjectChangeListener </item>
+ <item> ObjectFactory </item>
+ <item> ObjectFactoryBuilder </item>
+ <item> ObjectHelper </item>
+ <item> ObjectHolder </item>
+ <item> ObjectIdHelper </item>
+ <item> ObjectImpl </item>
+ <item> ObjectImpl </item>
+ <item> ObjectInput </item>
+ <item> ObjectInputStream </item>
+ <item> ObjectInputValidation </item>
+ <item> ObjectNotActive </item>
+ <item> ObjectNotActiveHelper </item>
+ <item> ObjectOutput </item>
+ <item> ObjectOutputStream </item>
+ <item> ObjectStreamClass </item>
+ <item> ObjectStreamConstants </item>
+ <item> ObjectStreamException </item>
+ <item> ObjectStreamField </item>
+ <item> ObjectView </item>
+ <item> Observable </item>
+ <item> Observer </item>
+ <item> OctetSeqHelper </item>
+ <item> OctetSeqHolder </item>
+ <item> Oid </item>
+ <item> OpenType </item>
+ <item> Operation </item>
+ <item> OperationNotSupportedException </item>
+ <item> Option </item>
+ <item> OptionDialogBorder </item>
+ <item> OptionPaneUI </item>
+ <item> OptionalDataException </item>
+ <item> OrientationRequested </item>
+ <item> OrientationRequestedType </item>
+ <item> OriginType </item>
+ <item> Other </item>
+ <item> OutOfMemoryError </item>
+ <item> OutputDeviceAssigned </item>
+ <item> OutputKeys </item>
+ <item> OutputStream </item>
+ <item> OutputStream </item>
+ <item> OutputStream </item>
+ <item> OutputStreamWriter </item>
+ <item> OverlappingFileLockException </item>
+ <item> OverlayLayout </item>
+ <item> Owner </item>
+ <item> PBEKey </item>
+ <item> PBEKeySpec </item>
+ <item> PBEParameterSpec </item>
+ <item> PDLOverrideSupported </item>
+ <item> PERSIST_STORE </item>
+ <item> PKCS8EncodedKeySpec </item>
+ <item> PKIXBuilderParameters </item>
+ <item> PKIXCertPathBuilderResult </item>
+ <item> PKIXCertPathChecker </item>
+ <item> PKIXCertPathValidatorResult </item>
+ <item> PKIXParameters </item>
+ <item> POA </item>
+ <item> POAHelper </item>
+ <item> POAManager </item>
+ <item> POAManagerOperations </item>
+ <item> POAOperations </item>
+ <item> PRIVATE_MEMBER </item>
+ <item> PSSParameterSpec </item>
+ <item> PUBLIC_MEMBER </item>
+ <item> Package </item>
+ <item> PackedColorModel </item>
+ <item> PageAttributes </item>
+ <item> PageFormat </item>
+ <item> PageRanges </item>
+ <item> Pageable </item>
+ <item> PagesPerMinute </item>
+ <item> PagesPerMinuteColor </item>
+ <item> Paint </item>
+ <item> PaintContext </item>
+ <item> PaintEvent </item>
+ <item> PaletteBorder </item>
+ <item> PaletteCloseIcon </item>
+ <item> Panel </item>
+ <item> PanelUI </item>
+ <item> Paper </item>
+ <item> ParagraphAttribute </item>
+ <item> ParagraphConstants </item>
+ <item> ParagraphView </item>
+ <item> ParagraphView </item>
+ <item> Parameter </item>
+ <item> ParameterBlock </item>
+ <item> ParameterDescriptor </item>
+ <item> ParameterMetaData </item>
+ <item> ParameterMode </item>
+ <item> ParameterModeHelper </item>
+ <item> ParameterModeHolder </item>
+ <item> ParseException </item>
+ <item> ParsePosition </item>
+ <item> Parser </item>
+ <item> Parser </item>
+ <item> Parser </item>
+ <item> ParserAdapter </item>
+ <item> ParserCallback </item>
+ <item> ParserConfigurationException </item>
+ <item> ParserDelegator </item>
+ <item> ParserFactory </item>
+ <item> PartialResultException </item>
+ <item> PasswordAuthentication </item>
+ <item> PasswordCallback </item>
+ <item> PasswordView </item>
+ <item> PasteAction </item>
+ <item> Patch </item>
+ <item> PathIterator </item>
+ <item> Pattern </item>
+ <item> PatternSyntaxException </item>
+ <item> Permission </item>
+ <item> Permission </item>
+ <item> PermissionCollection </item>
+ <item> Permissions </item>
+ <item> PersistenceDelegate </item>
+ <item> PhantomReference </item>
+ <item> Pipe </item>
+ <item> PipedInputStream </item>
+ <item> PipedOutputStream </item>
+ <item> PipedReader </item>
+ <item> PipedWriter </item>
+ <item> PixelGrabber </item>
+ <item> PixelInterleavedSampleModel </item>
+ <item> PlainDocument </item>
+ <item> PlainView </item>
+ <item> Point </item>
+ <item> Point2D </item>
+ <item> Policy </item>
+ <item> Policy </item>
+ <item> Policy </item>
+ <item> PolicyError </item>
+ <item> PolicyErrorCodeHelper </item>
+ <item> PolicyErrorHelper </item>
+ <item> PolicyErrorHolder </item>
+ <item> PolicyFactory </item>
+ <item> PolicyFactoryOperations </item>
+ <item> PolicyHelper </item>
+ <item> PolicyHolder </item>
+ <item> PolicyListHelper </item>
+ <item> PolicyListHolder </item>
+ <item> PolicyNode </item>
+ <item> PolicyOperations </item>
+ <item> PolicyQualifierInfo </item>
+ <item> PolicyTypeHelper </item>
+ <item> Polygon </item>
+ <item> PooledConnection </item>
+ <item> Popup </item>
+ <item> PopupFactory </item>
+ <item> PopupMenu </item>
+ <item> PopupMenuBorder </item>
+ <item> PopupMenuEvent </item>
+ <item> PopupMenuListener </item>
+ <item> PopupMenuUI </item>
+ <item> Port </item>
+ <item> PortUnreachableException </item>
+ <item> PortableRemoteObject </item>
+ <item> PortableRemoteObjectDelegate </item>
+ <item> Position </item>
+ <item> PreferenceChangeEvent </item>
+ <item> PreferenceChangeListener </item>
+ <item> Preferences </item>
+ <item> PreferencesFactory </item>
+ <item> PreparedStatement </item>
+ <item> PresentationDirection </item>
+ <item> Principal </item>
+ <item> Principal </item>
+ <item> PrincipalHolder </item>
+ <item> PrintEvent </item>
+ <item> PrintException </item>
+ <item> PrintGraphics </item>
+ <item> PrintJob </item>
+ <item> PrintJobAdapter </item>
+ <item> PrintJobAttribute </item>
+ <item> PrintJobAttributeEvent </item>
+ <item> PrintJobAttributeListener </item>
+ <item> PrintJobAttributeSet </item>
+ <item> PrintJobEvent </item>
+ <item> PrintJobListener </item>
+ <item> PrintQuality </item>
+ <item> PrintQualityType </item>
+ <item> PrintRequestAttribute </item>
+ <item> PrintRequestAttributeSet </item>
+ <item> PrintService </item>
+ <item> PrintServiceAttribute </item>
+ <item> PrintServiceAttributeEvent </item>
+ <item> PrintServiceAttributeListener </item>
+ <item> PrintServiceAttributeSet </item>
+ <item> PrintServiceLookup </item>
+ <item> PrintStream </item>
+ <item> PrintWriter </item>
+ <item> Printable </item>
+ <item> PrinterAbortException </item>
+ <item> PrinterException </item>
+ <item> PrinterGraphics </item>
+ <item> PrinterIOException </item>
+ <item> PrinterInfo </item>
+ <item> PrinterIsAcceptingJobs </item>
+ <item> PrinterJob </item>
+ <item> PrinterLocation </item>
+ <item> PrinterMakeAndModel </item>
+ <item> PrinterMessageFromOperator </item>
+ <item> PrinterMoreInfo </item>
+ <item> PrinterMoreInfoManufacturer </item>
+ <item> PrinterName </item>
+ <item> PrinterResolution </item>
+ <item> PrinterState </item>
+ <item> PrinterStateReason </item>
+ <item> PrinterStateReasons </item>
+ <item> PrinterURI </item>
+ <item> PrivateCredentialPermission </item>
+ <item> PrivateKey </item>
+ <item> PrivilegedAction </item>
+ <item> PrivilegedActionException </item>
+ <item> PrivilegedExceptionAction </item>
+ <item> Process </item>
+ <item> ProcessingInstruction </item>
+ <item> ProfileDataException </item>
+ <item> ProfileIdHelper </item>
+ <item> ProgressBarUI </item>
+ <item> ProgressMonitor </item>
+ <item> ProgressMonitorInputStream </item>
+ <item> Properties </item>
+ <item> PropertyChangeEvent </item>
+ <item> PropertyChangeListener </item>
+ <item> PropertyChangeListenerProxy </item>
+ <item> PropertyChangeSupport </item>
+ <item> PropertyDescriptor </item>
+ <item> PropertyEditor </item>
+ <item> PropertyEditorManager </item>
+ <item> PropertyEditorSupport </item>
+ <item> PropertyPermission </item>
+ <item> PropertyResourceBundle </item>
+ <item> PropertyVetoException </item>
+ <item> ProtectionDomain </item>
+ <item> ProtocolException </item>
+ <item> Provider </item>
+ <item> ProviderException </item>
+ <item> Proxy </item>
+ <item> ProxyLazyValue </item>
+ <item> PublicKey </item>
+ <item> PushbackInputStream </item>
+ <item> PushbackReader </item>
+ <item> PutField </item>
+ <item> QuadCurve2D </item>
+ <item> QueuedJobCount </item>
+ <item> RC2ParameterSpec </item>
+ <item> RC5ParameterSpec </item>
+ <item> READER </item>
+ <item> REQUEST_PROCESSING_POLICY_ID </item>
+ <item> RGBImageFilter </item>
+ <item> RMIClassLoader </item>
+ <item> RMIClassLoaderSpi </item>
+ <item> RMIClientSocketFactory </item>
+ <item> RMIFailureHandler </item>
+ <item> RMISecurityException </item>
+ <item> RMISecurityManager </item>
+ <item> RMIServerSocketFactory </item>
+ <item> RMISocketFactory </item>
+ <item> RSAKey </item>
+ <item> RSAKeyGenParameterSpec </item>
+ <item> RSAMultiPrimePrivateCrtKey </item>
+ <item> RSAMultiPrimePrivateCrtKeySpec </item>
+ <item> RSAOtherPrimeInfo </item>
+ <item> RSAPrivateCrtKey </item>
+ <item> RSAPrivateCrtKeySpec </item>
+ <item> RSAPrivateKey </item>
+ <item> RSAPrivateKeySpec </item>
+ <item> RSAPublicKey </item>
+ <item> RSAPublicKeySpec </item>
+ <item> RTFEditorKit </item>
+ <item> RadioButtonBorder </item>
+ <item> Random </item>
+ <item> RandomAccess </item>
+ <item> RandomAccessFile </item>
+ <item> Raster </item>
+ <item> RasterFormatException </item>
+ <item> RasterOp </item>
+ <item> ReadOnlyBufferException </item>
+ <item> ReadableByteChannel </item>
+ <item> Reader </item>
+ <item> Receiver </item>
+ <item> Rectangle </item>
+ <item> Rectangle2D </item>
+ <item> RectangularShape </item>
+ <item> Ref </item>
+ <item> RefAddr </item>
+ <item> Reference </item>
+ <item> Reference </item>
+ <item> ReferenceQueue </item>
+ <item> ReferenceUriSchemesSupported </item>
+ <item> Referenceable </item>
+ <item> ReferralException </item>
+ <item> ReflectPermission </item>
+ <item> RefreshFailedException </item>
+ <item> Refreshable </item>
+ <item> RegisterableService </item>
+ <item> Registry </item>
+ <item> RegistryHandler </item>
+ <item> RemarshalException </item>
+ <item> Remote </item>
+ <item> RemoteCall </item>
+ <item> RemoteException </item>
+ <item> RemoteObject </item>
+ <item> RemoteRef </item>
+ <item> RemoteServer </item>
+ <item> RemoteStub </item>
+ <item> RenderContext </item>
+ <item> RenderableImage </item>
+ <item> RenderableImageOp </item>
+ <item> RenderableImageProducer </item>
+ <item> RenderedImage </item>
+ <item> RenderedImageFactory </item>
+ <item> Renderer </item>
+ <item> RenderingHints </item>
+ <item> RepaintManager </item>
+ <item> ReplicateScaleFilter </item>
+ <item> RepositoryIdHelper </item>
+ <item> Request </item>
+ <item> RequestInfo </item>
+ <item> RequestInfoOperations </item>
+ <item> RequestProcessingPolicy </item>
+ <item> RequestProcessingPolicyOperations </item>
+ <item> RequestProcessingPolicyValue </item>
+ <item> RequestingUserName </item>
+ <item> RescaleOp </item>
+ <item> ResolutionSyntax </item>
+ <item> ResolveResult </item>
+ <item> Resolver </item>
+ <item> ResourceBundle </item>
+ <item> ResponseHandler </item>
+ <item> Result </item>
+ <item> Result </item>
+ <item> ResultSet </item>
+ <item> ResultSetMetaData </item>
+ <item> ReverbType </item>
+ <item> Robot </item>
+ <item> RolloverButtonBorder </item>
+ <item> RolloverButtonBorder </item>
+ <item> RootPaneContainer </item>
+ <item> RootPaneUI </item>
+ <item> RoundRectangle2D </item>
+ <item> RowMapper </item>
+ <item> RowSet </item>
+ <item> RowSetEvent </item>
+ <item> RowSetInternal </item>
+ <item> RowSetListener </item>
+ <item> RowSetMetaData </item>
+ <item> RowSetReader </item>
+ <item> RowSetWriter </item>
+ <item> RuleBasedCollator </item>
+ <item> RunTime </item>
+ <item> RunTimeOperations </item>
+ <item> Runnable </item>
+ <item> Runtime </item>
+ <item> RuntimeException </item>
+ <item> RuntimePermission </item>
+ <item> SAXException </item>
+ <item> SAXNotRecognizedException </item>
+ <item> SAXNotSupportedException </item>
+ <item> SAXParseException </item>
+ <item> SAXParser </item>
+ <item> SAXParserFactory </item>
+ <item> SAXResult </item>
+ <item> SAXSource </item>
+ <item> SAXTransformerFactory </item>
+ <item> SERVANT_RETENTION_POLICY_ID </item>
+ <item> SERVICE_FORMATTED </item>
+ <item> SQLData </item>
+ <item> SQLException </item>
+ <item> SQLInput </item>
+ <item> SQLOutput </item>
+ <item> SQLPermission </item>
+ <item> SQLWarning </item>
+ <item> SSLContext </item>
+ <item> SSLContextSpi </item>
+ <item> SSLException </item>
+ <item> SSLHandshakeException </item>
+ <item> SSLKeyException </item>
+ <item> SSLPeerUnverifiedException </item>
+ <item> SSLPermission </item>
+ <item> SSLProtocolException </item>
+ <item> SSLServerSocket </item>
+ <item> SSLServerSocketFactory </item>
+ <item> SSLSession </item>
+ <item> SSLSessionBindingEvent </item>
+ <item> SSLSessionBindingListener </item>
+ <item> SSLSessionContext </item>
+ <item> SSLSocket </item>
+ <item> SSLSocketFactory </item>
+ <item> STRING </item>
+ <item> SUCCESSFUL </item>
+ <item> SYNC_WITH_TRANSPORT </item>
+ <item> SYSTEM_EXCEPTION </item>
+ <item> SampleModel </item>
+ <item> Savepoint </item>
+ <item> ScatteringByteChannel </item>
+ <item> SchemaViolationException </item>
+ <item> ScrollBarUI </item>
+ <item> ScrollPane </item>
+ <item> ScrollPaneAdjustable </item>
+ <item> ScrollPaneBorder </item>
+ <item> ScrollPaneConstants </item>
+ <item> ScrollPaneLayout </item>
+ <item> ScrollPaneUI </item>
+ <item> Scrollable </item>
+ <item> Scrollbar </item>
+ <item> SealedObject </item>
+ <item> SearchControls </item>
+ <item> SearchResult </item>
+ <item> SecretKey </item>
+ <item> SecretKeyFactory </item>
+ <item> SecretKeyFactorySpi </item>
+ <item> SecretKeySpec </item>
+ <item> SecureClassLoader </item>
+ <item> SecureRandom </item>
+ <item> SecureRandomSpi </item>
+ <item> Security </item>
+ <item> SecurityException </item>
+ <item> SecurityManager </item>
+ <item> SecurityPermission </item>
+ <item> Segment </item>
+ <item> SelectableChannel </item>
+ <item> SelectionKey </item>
+ <item> Selector </item>
+ <item> SelectorProvider </item>
+ <item> Separator </item>
+ <item> Separator </item>
+ <item> SeparatorUI </item>
+ <item> Sequence </item>
+ <item> SequenceInputStream </item>
+ <item> Sequencer </item>
+ <item> Serializable </item>
+ <item> SerializablePermission </item>
+ <item> Servant </item>
+ <item> ServantActivator </item>
+ <item> ServantActivatorHelper </item>
+ <item> ServantActivatorOperations </item>
+ <item> ServantActivatorPOA </item>
+ <item> ServantAlreadyActive </item>
+ <item> ServantAlreadyActiveHelper </item>
+ <item> ServantLocator </item>
+ <item> ServantLocatorHelper </item>
+ <item> ServantLocatorOperations </item>
+ <item> ServantLocatorPOA </item>
+ <item> ServantManager </item>
+ <item> ServantManagerOperations </item>
+ <item> ServantNotActive </item>
+ <item> ServantNotActiveHelper </item>
+ <item> ServantObject </item>
+ <item> ServantRetentionPolicy </item>
+ <item> ServantRetentionPolicyOperations </item>
+ <item> ServantRetentionPolicyValue </item>
+ <item> ServerCloneException </item>
+ <item> ServerError </item>
+ <item> ServerException </item>
+ <item> ServerNotActiveException </item>
+ <item> ServerRef </item>
+ <item> ServerRequest </item>
+ <item> ServerRequestInfo </item>
+ <item> ServerRequestInfoOperations </item>
+ <item> ServerRequestInterceptor </item>
+ <item> ServerRequestInterceptorOperations </item>
+ <item> ServerRuntimeException </item>
+ <item> ServerSocket </item>
+ <item> ServerSocketChannel </item>
+ <item> ServerSocketFactory </item>
+ <item> ServiceContext </item>
+ <item> ServiceContextHelper </item>
+ <item> ServiceContextHolder </item>
+ <item> ServiceContextListHelper </item>
+ <item> ServiceContextListHolder </item>
+ <item> ServiceDetail </item>
+ <item> ServiceDetailHelper </item>
+ <item> ServiceIdHelper </item>
+ <item> ServiceInformation </item>
+ <item> ServiceInformationHelper </item>
+ <item> ServiceInformationHolder </item>
+ <item> ServicePermission </item>
+ <item> ServiceRegistry </item>
+ <item> ServiceUI </item>
+ <item> ServiceUIFactory </item>
+ <item> ServiceUnavailableException </item>
+ <item> Set </item>
+ <item> SetOfIntegerSyntax </item>
+ <item> SetOverrideType </item>
+ <item> SetOverrideTypeHelper </item>
+ <item> Severity </item>
+ <item> Shape </item>
+ <item> ShapeGraphicAttribute </item>
+ <item> SheetCollate </item>
+ <item> Short </item>
+ <item> ShortBuffer </item>
+ <item> ShortBufferException </item>
+ <item> ShortHolder </item>
+ <item> ShortLookupTable </item>
+ <item> ShortMessage </item>
+ <item> ShortSeqHelper </item>
+ <item> ShortSeqHolder </item>
+ <item> Sides </item>
+ <item> SidesType </item>
+ <item> Signature </item>
+ <item> SignatureException </item>
+ <item> SignatureSpi </item>
+ <item> SignedObject </item>
+ <item> Signer </item>
+ <item> SimpleAttributeSet </item>
+ <item> SimpleBeanInfo </item>
+ <item> SimpleDateFormat </item>
+ <item> SimpleDoc </item>
+ <item> SimpleFormatter </item>
+ <item> SimpleTimeZone </item>
+ <item> SinglePixelPackedSampleModel </item>
+ <item> SingleSelectionModel </item>
+ <item> SinkChannel </item>
+ <item> Size2DSyntax </item>
+ <item> SizeLimitExceededException </item>
+ <item> SizeRequirements </item>
+ <item> SizeSequence </item>
+ <item> Skeleton </item>
+ <item> SkeletonMismatchException </item>
+ <item> SkeletonNotFoundException </item>
+ <item> SliderUI </item>
+ <item> Socket </item>
+ <item> SocketAddress </item>
+ <item> SocketChannel </item>
+ <item> SocketException </item>
+ <item> SocketFactory </item>
+ <item> SocketHandler </item>
+ <item> SocketImpl </item>
+ <item> SocketImplFactory </item>
+ <item> SocketOptions </item>
+ <item> SocketPermission </item>
+ <item> SocketSecurityException </item>
+ <item> SocketTimeoutException </item>
+ <item> SoftBevelBorder </item>
+ <item> SoftReference </item>
+ <item> SortedMap </item>
+ <item> SortedSet </item>
+ <item> SortingFocusTraversalPolicy </item>
+ <item> Soundbank </item>
+ <item> SoundbankReader </item>
+ <item> SoundbankResource </item>
+ <item> Source </item>
+ <item> SourceChannel </item>
+ <item> SourceDataLine </item>
+ <item> SourceLocator </item>
+ <item> SpinnerDateModel </item>
+ <item> SpinnerListModel </item>
+ <item> SpinnerModel </item>
+ <item> SpinnerNumberModel </item>
+ <item> SpinnerUI </item>
+ <item> SplitPaneBorder </item>
+ <item> SplitPaneUI </item>
+ <item> Spring </item>
+ <item> SpringLayout </item>
+ <item> Stack </item>
+ <item> StackOverflowError </item>
+ <item> StackTraceElement </item>
+ <item> StartTlsRequest </item>
+ <item> StartTlsResponse </item>
+ <item> State </item>
+ <item> StateEdit </item>
+ <item> StateEditable </item>
+ <item> StateFactory </item>
+ <item> Statement </item>
+ <item> Statement </item>
+ <item> StreamCorruptedException </item>
+ <item> StreamHandler </item>
+ <item> StreamPrintService </item>
+ <item> StreamPrintServiceFactory </item>
+ <item> StreamResult </item>
+ <item> StreamSource </item>
+ <item> StreamTokenizer </item>
+ <item> Streamable </item>
+ <item> StreamableValue </item>
+ <item> StrictMath </item>
+ <item> String </item>
+ <item> StringBuffer </item>
+ <item> StringBufferInputStream </item>
+ <item> StringCharacterIterator </item>
+ <item> StringContent </item>
+ <item> StringHolder </item>
+ <item> StringIndexOutOfBoundsException </item>
+ <item> StringNameHelper </item>
+ <item> StringReader </item>
+ <item> StringRefAddr </item>
+ <item> StringSelection </item>
+ <item> StringSeqHelper </item>
+ <item> StringSeqHolder </item>
+ <item> StringTokenizer </item>
+ <item> StringValueHelper </item>
+ <item> StringWriter </item>
+ <item> Stroke </item>
+ <item> Struct </item>
+ <item> StructMember </item>
+ <item> StructMemberHelper </item>
+ <item> Stub </item>
+ <item> StubDelegate </item>
+ <item> StubNotFoundException </item>
+ <item> Style </item>
+ <item> StyleConstants </item>
+ <item> StyleContext </item>
+ <item> StyleSheet </item>
+ <item> StyledDocument </item>
+ <item> StyledEditorKit </item>
+ <item> StyledTextAction </item>
+ <item> Subject </item>
+ <item> SubjectDomainCombiner </item>
+ <item> Subset </item>
+ <item> SupportedValuesAttribute </item>
+ <item> SwingConstants </item>
+ <item> SwingPropertyChangeSupport </item>
+ <item> SwingUtilities </item>
+ <item> SyncFailedException </item>
+ <item> SyncMode </item>
+ <item> SyncScopeHelper </item>
+ <item> Synthesizer </item>
+ <item> SysexMessage </item>
+ <item> System </item>
+ <item> SystemColor </item>
+ <item> SystemException </item>
+ <item> SystemFlavorMap </item>
+ <item> TAG_ALTERNATE_IIOP_ADDRESS </item>
+ <item> TAG_CODE_SETS </item>
+ <item> TAG_INTERNET_IOP </item>
+ <item> TAG_JAVA_CODEBASE </item>
+ <item> TAG_MULTIPLE_COMPONENTS </item>
+ <item> TAG_ORB_TYPE </item>
+ <item> TAG_POLICIES </item>
+ <item> TCKind </item>
+ <item> THREAD_POLICY_ID </item>
+ <item> TRANSACTION_REQUIRED </item>
+ <item> TRANSACTION_ROLLEDBACK </item>
+ <item> TRANSIENT </item>
+ <item> TRANSPORT_RETRY </item>
+ <item> TabExpander </item>
+ <item> TabSet </item>
+ <item> TabStop </item>
+ <item> TabableView </item>
+ <item> TabbedPaneUI </item>
+ <item> TableCellEditor </item>
+ <item> TableCellRenderer </item>
+ <item> TableColumn </item>
+ <item> TableColumnModel </item>
+ <item> TableColumnModelEvent </item>
+ <item> TableColumnModelListener </item>
+ <item> TableHeaderBorder </item>
+ <item> TableHeaderUI </item>
+ <item> TableModel </item>
+ <item> TableModelEvent </item>
+ <item> TableModelListener </item>
+ <item> TableUI </item>
+ <item> TableView </item>
+ <item> Tag </item>
+ <item> TagElement </item>
+ <item> TaggedComponent </item>
+ <item> TaggedComponentHelper </item>
+ <item> TaggedComponentHolder </item>
+ <item> TaggedProfile </item>
+ <item> TaggedProfileHelper </item>
+ <item> TaggedProfileHolder </item>
+ <item> TargetDataLine </item>
+ <item> Templates </item>
+ <item> TemplatesHandler </item>
+ <item> Text </item>
+ <item> TextAction </item>
+ <item> TextArea </item>
+ <item> TextAttribute </item>
+ <item> TextComponent </item>
+ <item> TextEvent </item>
+ <item> TextField </item>
+ <item> TextFieldBorder </item>
+ <item> TextHitInfo </item>
+ <item> TextInputCallback </item>
+ <item> TextLayout </item>
+ <item> TextListener </item>
+ <item> TextMeasurer </item>
+ <item> TextOutputCallback </item>
+ <item> TextSyntax </item>
+ <item> TextUI </item>
+ <item> TexturePaint </item>
+ <item> Thread </item>
+ <item> ThreadDeath </item>
+ <item> ThreadGroup </item>
+ <item> ThreadLocal </item>
+ <item> ThreadPolicy </item>
+ <item> ThreadPolicyOperations </item>
+ <item> ThreadPolicyValue </item>
+ <item> Throwable </item>
+ <item> Tie </item>
+ <item> TileObserver </item>
+ <item> Time </item>
+ <item> TimeLimitExceededException </item>
+ <item> TimeZone </item>
+ <item> Timer </item>
+ <item> Timer </item>
+ <item> TimerTask </item>
+ <item> Timestamp </item>
+ <item> TitledBorder </item>
+ <item> TitledBorderUIResource </item>
+ <item> ToggleButtonBorder </item>
+ <item> ToggleButtonBorder </item>
+ <item> ToggleButtonModel </item>
+ <item> TooManyListenersException </item>
+ <item> ToolBarBorder </item>
+ <item> ToolBarUI </item>
+ <item> ToolTipManager </item>
+ <item> ToolTipUI </item>
+ <item> Toolkit </item>
+ <item> Track </item>
+ <item> TransactionRequiredException </item>
+ <item> TransactionRolledbackException </item>
+ <item> TransactionService </item>
+ <item> TransferHandler </item>
+ <item> Transferable </item>
+ <item> TransformAttribute </item>
+ <item> Transformer </item>
+ <item> TransformerConfigurationException </item>
+ <item> TransformerException </item>
+ <item> TransformerFactory </item>
+ <item> TransformerFactoryConfigurationError </item>
+ <item> TransformerHandler </item>
+ <item> Transmitter </item>
+ <item> Transparency </item>
+ <item> TreeCellEditor </item>
+ <item> TreeCellRenderer </item>
+ <item> TreeControlIcon </item>
+ <item> TreeExpansionEvent </item>
+ <item> TreeExpansionListener </item>
+ <item> TreeFolderIcon </item>
+ <item> TreeLeafIcon </item>
+ <item> TreeMap </item>
+ <item> TreeModel </item>
+ <item> TreeModelEvent </item>
+ <item> TreeModelListener </item>
+ <item> TreeNode </item>
+ <item> TreePath </item>
+ <item> TreeSelectionEvent </item>
+ <item> TreeSelectionListener </item>
+ <item> TreeSelectionModel </item>
+ <item> TreeSet </item>
+ <item> TreeUI </item>
+ <item> TreeWillExpandListener </item>
+ <item> TrustAnchor </item>
+ <item> TrustManager </item>
+ <item> TrustManagerFactory </item>
+ <item> TrustManagerFactorySpi </item>
+ <item> Type </item>
+ <item> Type </item>
+ <item> Type </item>
+ <item> Type </item>
+ <item> Type </item>
+ <item> Type </item>
+ <item> Type </item>
+ <item> TypeCode </item>
+ <item> TypeCodeHolder </item>
+ <item> TypeMismatch </item>
+ <item> TypeMismatch </item>
+ <item> TypeMismatch </item>
+ <item> TypeMismatchHelper </item>
+ <item> TypeMismatchHelper </item>
+ <item> Types </item>
+ <item> UID </item>
+ <item> UIDefaults </item>
+ <item> UIManager </item>
+ <item> UIResource </item>
+ <item> UIResource </item>
+ <item> UIResource </item>
+ <item> UIResource </item>
+ <item> UIResource </item>
+ <item> UIResource </item>
+ <item> UIResource </item>
+ <item> ULongLongSeqHelper </item>
+ <item> ULongLongSeqHolder </item>
+ <item> ULongSeqHelper </item>
+ <item> ULongSeqHolder </item>
+ <item> UNKNOWN </item>
+ <item> UNSUPPORTED_POLICY </item>
+ <item> UNSUPPORTED_POLICY_VALUE </item>
+ <item> URI </item>
+ <item> URIException </item>
+ <item> URIResolver </item>
+ <item> URISyntax </item>
+ <item> URISyntaxException </item>
+ <item> URL </item>
+ <item> URL </item>
+ <item> URLClassLoader </item>
+ <item> URLConnection </item>
+ <item> URLDecoder </item>
+ <item> URLEncoder </item>
+ <item> URLStreamHandler </item>
+ <item> URLStreamHandlerFactory </item>
+ <item> URLStringHelper </item>
+ <item> USER_EXCEPTION </item>
+ <item> UShortSeqHelper </item>
+ <item> UShortSeqHolder </item>
+ <item> UTFDataFormatException </item>
+ <item> UndeclaredThrowableException </item>
+ <item> UnderlineAction </item>
+ <item> UndoManager </item>
+ <item> UndoableEdit </item>
+ <item> UndoableEditEvent </item>
+ <item> UndoableEditListener </item>
+ <item> UndoableEditSupport </item>
+ <item> UnexpectedException </item>
+ <item> UnicastRemoteObject </item>
+ <item> UnicodeBlock </item>
+ <item> UnionMember </item>
+ <item> UnionMemberHelper </item>
+ <item> UnknownEncoding </item>
+ <item> UnknownEncodingHelper </item>
+ <item> UnknownError </item>
+ <item> UnknownException </item>
+ <item> UnknownGroupException </item>
+ <item> UnknownHostException </item>
+ <item> UnknownHostException </item>
+ <item> UnknownObjectException </item>
+ <item> UnknownServiceException </item>
+ <item> UnknownTag </item>
+ <item> UnknownUserException </item>
+ <item> UnknownUserExceptionHelper </item>
+ <item> UnknownUserExceptionHolder </item>
+ <item> UnmappableCharacterException </item>
+ <item> UnmarshalException </item>
+ <item> UnmodifiableSetException </item>
+ <item> UnrecoverableKeyException </item>
+ <item> Unreferenced </item>
+ <item> UnresolvedAddressException </item>
+ <item> UnresolvedPermission </item>
+ <item> UnsatisfiedLinkError </item>
+ <item> UnsolicitedNotification </item>
+ <item> UnsolicitedNotificationEvent </item>
+ <item> UnsolicitedNotificationListener </item>
+ <item> UnsupportedAddressTypeException </item>
+ <item> UnsupportedAudioFileException </item>
+ <item> UnsupportedCallbackException </item>
+ <item> UnsupportedCharsetException </item>
+ <item> UnsupportedClassVersionError </item>
+ <item> UnsupportedEncodingException </item>
+ <item> UnsupportedFlavorException </item>
+ <item> UnsupportedLookAndFeelException </item>
+ <item> UnsupportedOperationException </item>
+ <item> UserException </item>
+ <item> Util </item>
+ <item> UtilDelegate </item>
+ <item> Utilities </item>
+ <item> VMID </item>
+ <item> VM_ABSTRACT </item>
+ <item> VM_CUSTOM </item>
+ <item> VM_NONE </item>
+ <item> VM_TRUNCATABLE </item>
+ <item> ValueBase </item>
+ <item> ValueBaseHelper </item>
+ <item> ValueBaseHolder </item>
+ <item> ValueFactory </item>
+ <item> ValueHandler </item>
+ <item> ValueMember </item>
+ <item> ValueMemberHelper </item>
+ <item> VariableHeightLayoutCache </item>
+ <item> Vector </item>
+ <item> VerifyError </item>
+ <item> VersionSpecHelper </item>
+ <item> VetoableChangeListener </item>
+ <item> VetoableChangeListenerProxy </item>
+ <item> VetoableChangeSupport </item>
+ <item> View </item>
+ <item> ViewFactory </item>
+ <item> ViewportLayout </item>
+ <item> ViewportUI </item>
+ <item> VirtualMachineError </item>
+ <item> Visibility </item>
+ <item> VisibilityHelper </item>
+ <item> VoiceStatus </item>
+ <item> Void </item>
+ <item> VolatileImage </item>
+ <item> WCharSeqHelper </item>
+ <item> WCharSeqHolder </item>
+ <item> WStringSeqHelper </item>
+ <item> WStringSeqHolder </item>
+ <item> WStringValueHelper </item>
+ <item> WeakHashMap </item>
+ <item> WeakReference </item>
+ <item> Window </item>
+ <item> WindowAdapter </item>
+ <item> WindowConstants </item>
+ <item> WindowEvent </item>
+ <item> WindowFocusListener </item>
+ <item> WindowListener </item>
+ <item> WindowStateListener </item>
+ <item> WrappedPlainView </item>
+ <item> WritableByteChannel </item>
+ <item> WritableRaster </item>
+ <item> WritableRenderedImage </item>
+ <item> WriteAbortedException </item>
+ <item> Writer </item>
+ <item> WrongAdapter </item>
+ <item> WrongAdapterHelper </item>
+ <item> WrongPolicy </item>
+ <item> WrongPolicyHelper </item>
+ <item> WrongTransaction </item>
+ <item> WrongTransactionHelper </item>
+ <item> WrongTransactionHolder </item>
+ <item> X500Principal </item>
+ <item> X500PrivateCredential </item>
+ <item> X509CRL </item>
+ <item> X509CRLEntry </item>
+ <item> X509CRLSelector </item>
+ <item> X509CertSelector </item>
+ <item> X509Certificate </item>
+ <item> X509Certificate </item>
+ <item> X509EncodedKeySpec </item>
+ <item> X509Extension </item>
+ <item> X509KeyManager </item>
+ <item> X509TrustManager </item>
+ <item> XAConnection </item>
+ <item> XADataSource </item>
+ <item> XAException </item>
+ <item> XAResource </item>
+ <item> XMLDecoder </item>
+ <item> XMLEncoder </item>
+ <item> XMLFilter </item>
+ <item> XMLFilterImpl </item>
+ <item> XMLFormatter </item>
+ <item> XMLReader </item>
+ <item> XMLReaderAdapter </item>
+ <item> XMLReaderFactory </item>
+ <item> Xid </item>
+ <item> ZipEntry </item>
+ <item> ZipException </item>
+ <item> ZipFile </item>
+ <item> ZipInputStream </item>
+ <item> ZipOutputStream </item>
+ <item> ZoneView </item>
+ <item> _BindingIteratorImplBase </item>
+ <item> _BindingIteratorStub </item>
+ <item> _DynAnyFactoryStub </item>
+ <item> _DynAnyStub </item>
+ <item> _DynArrayStub </item>
+ <item> _DynEnumStub </item>
+ <item> _DynFixedStub </item>
+ <item> _DynSequenceStub </item>
+ <item> _DynStructStub </item>
+ <item> _DynUnionStub </item>
+ <item> _DynValueStub </item>
+ <item> _IDLTypeStub </item>
+ <item> _NamingContextExtStub </item>
+ <item> _NamingContextImplBase </item>
+ <item> _NamingContextStub </item>
+ <item> _PolicyStub </item>
+ <item> _Remote_Stub </item>
+ <item> _ServantActivatorStub </item>
+ <item> _ServantLocatorStub </item>
+ </list>
+
+ <list name="java-1.4.2-keywords">
+ <item> abstract </item>
+ <item> assert </item>
+ <item> break </item>
+ <item> case </item>
+ <item> catch </item>
+ <item> class </item>
+ <item> continue </item>
+ <item> default </item>
+ <item> do </item>
+ <item> else </item>
+ <item> extends </item>
+ <item> false </item>
+ <item> finally </item>
+ <item> for </item>
+ <item> goto </item>
+ <item> if </item>
+ <item> implements </item>
+ <item> import </item>
+ <item> instanceof </item>
+ <item> interface </item>
+ <item> native </item>
+ <item> new </item>
+ <item> null </item>
+ <item> package </item>
+ <item> private </item>
+ <item> protected </item>
+ <item> public </item>
+ <item> return </item>
+ <item> super </item>
+ <item> strictfp </item>
+ <item> switch </item>
+ <item> synchronized </item>
+ <item> this </item>
+ <item> throws </item>
+ <item> throw </item>
+ <item> transient </item>
+ <item> true </item>
+ <item> try </item>
+ <item> volatile </item>
+ <item> while </item>
+ </list>
+
+ <list name="java-1.4.2-types">
+ <item> boolean </item>
+ <item> byte </item>
+ <item> char </item>
+ <item> const </item>
+ <item> double </item>
+ <item> final </item>
+ <item> float </item>
+ <item> int </item>
+ <item> long </item>
+ <item> short </item>
+ <item> static </item>
+ <item> void </item>
+ </list>
+
+ <list name="jsp-reserved-words">
+ <item> and </item>
+ <item> eq </item>
+ <item> gt </item>
+ <item> true </item>
+ <item> instanceof </item>
+ <item> or </item>
+ <item> ne </item>
+ <item> le </item>
+ <item> false </item>
+ <item> empty </item>
+ <item> not </item>
+ <item> lt </item>
+ <item> ge </item>
+ <item> null </item>
+ <item> div </item>
+ <item> mod </item>
+ </list>
+
+ <contexts>
+ <context name="Normal" attribute="Normal Text" lineEndContext="#stay">
+ <RegExpr String="&lt;%@\s*[a-zA-Z0-9_\.]*" attribute="Jsp Directive" context="Jsp Standard Directive"/>
+ <RegExpr String="&lt;\s*jsp:(declaration|expression|scriptlet)\s*&gt;" attribute="Jsp Scriptlet" context="Jsp Scriptlet"/>
+ <RegExpr String="&lt;\s*\/?s*jsp:[a-zA-Z0-9_\.]*" attribute="Jsp Directive" context="Jsp Xml Directive"/>
+ <StringDetect String="&lt;%--" attribute="Jsp Comment" context="Jsp Comment"/>
+ <RegExpr String="&lt;%(!|=)?" attribute="Jsp Scriptlet" context="Jsp Scriptlet"/>
+ <StringDetect String="&lt;!--" attribute="Html Comment" context="Html Comment"/>
+ <Detect2Chars char="$" char1="{" attribute="Jsp Expression" context="Jsp Expression"/>
+ <RegExpr String="&lt;\s*\/?\s*\$?[a-zA-Z0-9_]*:\$?[a-zA-Z0-9_]*" attribute="Keyword" context="Jsp Custom Tag"/>
+ <StringDetect String="&lt;![CDATA[" attribute="Normal Text" context="#stay"/>
+ <StringDetect String="]]&gt;" attribute="Normal Text" context="#stay"/>
+ <RegExpr String="&lt;\s*\/?\s*[a-zA-Z0-9_]*" attribute="Normal Text" context="Html Attribute"/>
+ </context>
+
+ <context name="Jsp Standard Directive" attribute="Jsp Param Name" lineEndContext="#stay">
+ <Detect2Chars char="%" char1="&gt;" attribute="Jsp Directive" context="#pop"/>
+ <RegExpr String="\s*=\s*" attribute="Normal Text" context="Jsp Standard Directive Value"/>
+ <StringDetect String="&lt;%--" attribute="Jsp Comment" context="Jsp Comment"/>
+ <RegExpr String="&lt;%(!|=)?" attribute="Jsp Scriptlet" context="Jsp Scriptlet"/>
+ <Detect2Chars char="$" char1="{" attribute="Jsp Expression" context="Jsp Expression"/>
+ <RegExpr String="&lt;\s*\/?\s*\$?\w*:\$?\w*" attribute="Keyword" context="Jsp Custom Tag"/>
+ </context>
+
+ <context name="Jsp Xml Directive" attribute="Jsp Param Name" lineEndContext="#stay">
+ <RegExpr String="\s*\/?\s*&gt;" attribute="Jsp Directive" context="#pop"/>
+ <RegExpr String="\s*=\s*" attribute="Normal Text" context="Jsp Xml Directive Value"/>
+ <StringDetect String="&lt;%--" attribute="Jsp Comment" context="Jsp Comment"/>
+ <RegExpr String="&lt;%(!|=)?" attribute="Jsp Scriptlet" context="Jsp Scriptlet"/>
+ <Detect2Chars char="$" char1="{" attribute="Jsp Expression" context="Jsp Expression"/>
+ </context>
+
+ <context name="Jsp Comment" attribute="Jsp Comment" lineEndContext="#stay">
+ <StringDetect String="--%&gt;" attribute="Jsp Comment" context="#pop"/>
+ </context>
+
+ <context name="Jsp Custom Tag" attribute="Identifier" lineEndContext="#stay">
+ <RegExpr String="\/?&gt;" attribute="Keyword" context="#pop"/>
+ <RegExpr String="\s*=\s*" attribute="Normal Text" context="Jsp Custom Tag Value"/>
+ <StringDetect String="&lt;%--" attribute="Jsp Comment" context="Jsp Comment"/>
+ <RegExpr String="&lt;%(!|=)?" attribute="Jsp Scriptlet" context="Jsp Scriptlet"/>
+ <Detect2Chars char="$" char1="{" attribute="Jsp Expression" context="Jsp Expression"/>
+ </context>
+
+ <context name="Jsp Standard Directive Value" attribute="Jsp Param Value" lineEndContext="#stay">
+ <StringDetect String="&lt;%--" attribute="Jsp Comment" context="Jsp Comment"/>
+ <RegExpr String="&lt;%(!|=)?" attribute="Jsp Scriptlet" context="Jsp Scriptlet"/>
+ <Detect2Chars char="$" char1="{" attribute="Jsp Expression" context="Jsp Expression"/>
+ <DetectChar char="&quot;" attribute="Jsp Param Value" context="Jsp Double Quoted Param Value"/>
+ <DetectChar char="'" attribute="Jsp Param Value" context="Jsp Single Quoted Param Value"/>
+ <Detect2Chars char="%" char1="&gt;" attribute="Jsp Directive" context="#pop#pop"/>
+ </context>
+
+ <context name="Jsp Xml Directive Value" attribute="Jsp Param Value" lineEndContext="#stay">
+ <StringDetect String="&lt;%--" attribute="Jsp Comment" context="Jsp Comment"/>
+ <RegExpr String="&lt;%(!|=)?" attribute="Jsp Scriptlet" context="Jsp Scriptlet"/>
+ <Detect2Chars char="$" char1="{" attribute="Jsp Expression" context="Jsp Expression"/>
+ <DetectChar char="&quot;" attribute="Jsp Param Value" context="Jsp Double Quoted Param Value"/>
+ <DetectChar char="'" attribute="Jsp Param Value" context="Jsp Single Quoted Param Value"/>
+ <RegExpr String="\s*\/?\s*&gt;" attribute="Jsp Directive" context="#pop#pop"/>
+ </context>
+
+ <context name="Jsp Custom Tag Value" attribute="Normal Text" lineEndContext="#stay">
+ <StringDetect String="&lt;%--" attribute="Jsp Comment" context="Jsp Comment"/>
+ <RegExpr String="&lt;%(!|=)?" attribute="Jsp Scriptlet" context="Jsp Scriptlet"/>
+ <Detect2Chars char="$" char1="{" attribute="Jsp Expression" context="Jsp Expression"/>
+ <DetectChar char="&quot;" attribute="Types" context="Jsp Double Quoted Custom Tag Value"/>
+ <DetectChar char="'" attribute="Types" context="Jsp Single Quoted Custom Tag Value"/>
+ <RegExpr String="\/?&gt;" attribute="Normal Text" context="#pop#pop"/>
+ </context>
+
+ <context name="Jsp Double Quoted Param Value" attribute="Jsp Param Value" lineEndContext="#stay">
+ <DetectChar char="&quot;" attribute="Jsp Param Value" context="#pop#pop"/>
+ <StringDetect String="&lt;%--" attribute="Jsp Comment" context="Jsp Comment"/>
+ <RegExpr String="&lt;%(!|=)?" attribute="Jsp Scriptlet" context="Jsp Scriptlet"/>
+ <Detect2Chars char="$" char1="{" attribute="Jsp Expression" context="Jsp Expression"/>
+ </context>
+
+ <context name="Jsp Single Quoted Param Value" attribute="Jsp Param Value" lineEndContext="#stay">
+ <DetectChar char="'" attribute="Jsp Param Value" context="#pop#pop"/>
+ <StringDetect String="&lt;%--" attribute="Jsp Comment" context="Jsp Comment"/>
+ <RegExpr String="&lt;%(!|=)?" attribute="Jsp Scriptlet" context="Jsp Scriptlet"/>
+ <Detect2Chars char="$" char1="{" attribute="Jsp Expression" context="Jsp Expression"/>
+ </context>
+
+ <context name="Jsp Double Quoted Custom Tag Value" attribute="Types" lineEndContext="#stay">
+ <DetectChar char="&quot;" attribute="Types" context="#pop#pop"/>
+ <StringDetect String="&lt;%--" attribute="Jsp Comment" context="Jsp Comment"/>
+ <RegExpr String="&lt;%(!|=)?" attribute="Jsp Scriptlet" context="Jsp Scriptlet"/>
+ <Detect2Chars char="$" char1="{" attribute="Jsp Expression" context="Jsp Expression"/>
+ </context>
+
+ <context name="Jsp Single Quoted Custom Tag Value" attribute="Types" lineEndContext="#stay">
+ <DetectChar char="'" attribute="Types" context="#pop#pop"/>
+ <StringDetect String="&lt;%--" attribute="Jsp Comment" context="Jsp Comment"/>
+ <RegExpr String="&lt;%(!|=)?" attribute="Jsp Scriptlet" context="Jsp Scriptlet"/>
+ <Detect2Chars char="$" char1="{" attribute="Jsp Expression" context="Jsp Expression"/>
+ </context>
+
+ <context name="Jsp Scriptlet" attribute="Normal Text" lineEndContext="#stay">
+ <Detect2Chars char="%" char1="&gt;" attribute="Jsp Scriptlet" context="#pop"/>
+ <RegExpr String="&lt;\s*jsp:(declaration|expression|scriptlet)\s*&gt;" attribute="Jsp Scriptlet" context="Jsp Scriptlet"/>
+ <keyword String="java-1.4.2-keywords" attribute="Keyword" context="#stay"/>
+ <keyword String="jsp-reserved-words" attribute="Keyword" context="#stay"/>
+ <keyword String="java-1.4.2-types" attribute="Types" context="#stay"/>
+ <keyword String="java-1.4.2-classes" attribute="Java 1.4.2 Classes" context="#stay"/>
+ <Float attribute="Float" context="#stay">
+ <AnyChar String="fF" attribute="Float" context="#stay"/>
+ </Float>
+ <HlCOct attribute="Octal" context="#stay"/>
+ <HlCHex attribute="Hex" context="#stay"/>
+ <Int attribute="Decimal" context="#stay">
+ <StringDetect String="ULL" attribute="Decimal" context="#stay" insensitive="true"/>
+ <StringDetect String="LUL" attribute="Decimal" context="#stay" insensitive="true"/>
+ <StringDetect String="LLU" attribute="Decimal" context="#stay" insensitive="true"/>
+ <StringDetect String="UL" attribute="Decimal" context="#stay" insensitive="true"/>
+ <StringDetect String="LU" attribute="Decimal" context="#stay" insensitive="true"/>
+ <StringDetect String="LL" attribute="Decimal" context="#stay" insensitive="true"/>
+ <StringDetect String="U" attribute="Decimal" context="#stay" insensitive="true"/>
+ <StringDetect String="L" attribute="Decimal" context="#stay" insensitive="true"/>
+ </Int>
+ <HlCChar attribute="Char" context="#stay"/>
+ <RegExpr String="//\s*BEGIN.*$" attribute="Decimal" context="#stay" beginRegion="Region1" firstNonSpace="true"/>
+ <RegExpr String="//\s*END.*$" attribute="Decimal" context="#stay" endRegion="Region1" firstNonSpace="true"/>
+ <DetectChar char="&quot;" attribute="String" context="Java String"/>
+ <DetectChar char="{" attribute="Normal Text" context="#stay" beginRegion="Brace1"/>
+ <DetectChar char="}" attribute="Normal Text" context="#stay" endRegion="Brace1"/>
+ <AnyChar String="!%&amp;()+,-&lt;=&gt;?[]^{|}~" attribute="Symbol" context="#stay"/>
+ <Detect2Chars char="/" char1="/" attribute="Java Comment" context="Java Single-Line Comment"/>
+ <Detect2Chars char="/" char1="*" attribute="Java Comment" context="Java Multi-Line Comment"/>
+ </context>
+
+ <context name="Jsp Expression" attribute="Normal Text" lineEndContext="#stay">
+ <StringDetect String="'${'" attribute="Normal Text" context="#stay"/>
+ <DetectChar char="}" attribute="Jsp Scriptlet" context="#pop"/>
+ <keyword String="java-1.4.2-keywords" attribute="Keyword" context="#stay"/>
+ <keyword String="jsp-reserved-words" attribute="Keyword" context="#stay"/>
+ <keyword String="java-1.4.2-types" attribute="Types" context="#stay"/>
+ <keyword String="java-1.4.2-classes" attribute="Java 1.4.2 Classes" context="#stay"/>
+ <Float attribute="Float" context="#stay">
+ <AnyChar String="fF" attribute="Float" context="#stay"/>
+ </Float>
+ <HlCOct attribute="Octal" context="#stay"/>
+ <HlCHex attribute="Hex" context="#stay"/>
+ <Int attribute="Decimal" context="#stay">
+ <StringDetect String="ULL" attribute="Decimal" context="#stay" insensitive="true"/>
+ <StringDetect String="LUL" attribute="Decimal" context="#stay" insensitive="true"/>
+ <StringDetect String="LLU" attribute="Decimal" context="#stay" insensitive="true"/>
+ <StringDetect String="UL" attribute="Decimal" context="#stay" insensitive="true"/>
+ <StringDetect String="LU" attribute="Decimal" context="#stay" insensitive="true"/>
+ <StringDetect String="LL" attribute="Decimal" context="#stay" insensitive="true"/>
+ <StringDetect String="U" attribute="Decimal" context="#stay" insensitive="true"/>
+ <StringDetect String="L" attribute="Decimal" context="#stay" insensitive="true"/>
+ </Int>
+ <HlCChar attribute="Char" context="#stay"/>
+ <DetectChar char="&quot;" attribute="String" context="Java String"/>
+ <AnyChar String="!%&amp;()+,-&lt;=&gt;?[]^{|}~" attribute="Symbol" context="#stay"/>
+ </context>
+
+ <context name="Java Single-Line Comment" attribute="Java Comment" lineEndContext="#pop"/>
+
+ <context name="Java Multi-Line Comment" attribute="Java Comment" lineEndContext="#stay">
+ <Detect2Chars char="*" char1="/" attribute="Java Comment" context="#pop"/>
+ </context>
+
+ <context name="Java String" attribute="String" lineEndContext="#stay">
+ <Detect2Chars char="\" char1="&quot;" attribute="String" context="#stay"/>
+ <DetectChar char="&quot;" attribute="String" context="#pop"/>
+ </context>
+
+ <context name="Html Attribute" attribute="Identifier" lineEndContext="#stay">
+ <RegExpr String="\/?&gt;" attribute="Normal Text" context="#pop"/>
+ <RegExpr String="\s*=\s*" attribute="Normal Text" context="Html Value"/>
+ <StringDetect String="&lt;%--" attribute="Jsp Comment" context="Jsp Comment"/>
+ <RegExpr String="&lt;%(!|=)?" attribute="Jsp Scriptlet" context="Jsp Scriptlet"/>
+ <Detect2Chars char="$" char1="{" attribute="Jsp Expression" context="Jsp Expression"/>
+ </context>
+
+ <context name="Html Value" attribute="Types" lineEndContext="#stay">
+ <StringDetect String="&lt;%--" attribute="Jsp Comment" context="Jsp Comment"/>
+ <RegExpr String="&lt;%(!|=)?" attribute="Jsp Scriptlet" context="Jsp Scriptlet"/>
+ <Detect2Chars char="$" char1="{" attribute="Jsp Expression" context="Jsp Expression"/>
+ <RegExpr String="&lt;\s*\/?\s*\$?\w*:\$?\w*" attribute="Keyword" context="Jsp Custom Tag"/>
+ <RegExpr String="(&quot;|&amp;quot;|&amp;#34;)" attribute="Types" context="Html Double Quoted Value"/>
+ <RegExpr String="('|&amp;#39;)" attribute="Types" context="Html Single Quoted Value"/>
+ <RegExpr String="\s*#?-?_?\.?[a-zA-Z0-9]*" attribute="Types" context="Html Unquoted Value"/>
+ <RegExpr String="\/?&gt;" attribute="Normal Text" context="#pop#pop"/>
+ </context>
+
+ <context name="Html Double Quoted Value" attribute="Types" lineEndContext="#stay">
+ <StringDetect String="&lt;%--" attribute="Jsp Comment" context="Jsp Comment"/>
+ <RegExpr String="&lt;%(!|=)?" attribute="Jsp Scriptlet" context="Jsp Scriptlet"/>
+ <Detect2Chars char="$" char1="{" attribute="Jsp Expression" context="Jsp Expression"/>
+ <RegExpr String="&lt;\s*\/?\s*\$?\w*:\$?\w*" attribute="Keyword" context="Jsp Custom Tag"/>
+ <RegExpr String="(&quot;|&amp;quot;|&amp;#34;)" attribute="Types" context="#pop#pop"/>
+ </context>
+
+ <context name="Html Single Quoted Value" attribute="Types" lineEndContext="#stay">
+ <StringDetect String="&lt;%--" attribute="Jsp Comment" context="Jsp Comment"/>
+ <RegExpr String="&lt;%(!|=)?" attribute="Jsp Scriptlet" context="Jsp Scriptlet"/>
+ <Detect2Chars char="$" char1="{" attribute="Jsp Expression" context="Jsp Expression"/>
+ <RegExpr String="&lt;\s*\/?\s*\$?\w*:\$?\w*" attribute="Keyword" context="Jsp Custom Tag"/>
+ <RegExpr String="('|&amp;#39;)" attribute="Types" context="#pop#pop"/>
+ </context>
+
+ <context name="Html Unquoted Value" attribute="Types" lineEndContext="#stay">
+ <StringDetect String="&lt;%--" attribute="Jsp Comment" context="Jsp Comment"/>
+ <RegExpr String="&lt;%(!|=)?" attribute="Jsp Scriptlet" context="Jsp Scriptlet"/>
+ <Detect2Chars char="$" char1="{" attribute="Jsp Expression" context="Jsp Expression"/>
+ <RegExpr String="&lt;\s*\/?\s*\$?\w*:\$?\w*" attribute="Keyword" context="Jsp Custom Tag"/>
+ <RegExpr String="\/?&gt;" attribute="Normal Text" context="#pop#pop#pop"/>
+ <RegExpr String="\s+" attribute="Types" context="#pop#pop"/>
+ </context>
+
+ <context name="Html Comment" attribute="Html Comment" lineEndContext="#stay">
+ <StringDetect String="&lt;%--" attribute="Jsp Comment" context="Jsp Comment"/>
+ <RegExpr String="&lt;%(!|=)?" attribute="Jsp Scriptlet" context="Jsp Scriptlet"/>
+ <Detect2Chars char="$" char1="{" attribute="Jsp Expression" context="Jsp Expression"/>
+ <RegExpr String="\/*--&gt;" attribute="Html Comment" context="#pop"/>
+ </context>
+
+ </contexts>
+
+
+ <itemDatas>
+ <itemData name="Normal Text" defStyleNum="dsNormal"/>
+ <itemData name="Keyword" defStyleNum="dsKeyword"/>
+ <itemData name="Identifier" defStyleNum="dsOthers"/>
+ <itemData name="Types" defStyleNum="dsDataType"/>
+ <itemData name="String" defStyleNum="dsString"/>
+ <itemData name="Comment" defStyleNum="dsComment"/>
+
+ <itemData name="Html Comment" defStyleNum="dsComment"/>
+
+ <itemData name="Decimal" defStyleNum="dsDecVal"/>
+ <itemData name="Octal" defStyleNum="dsBaseN"/>
+ <itemData name="Hex" defStyleNum="dsBaseN"/>
+ <itemData name="Float" defStyleNum="dsFloat"/>
+ <itemData name="Char" defStyleNum="dsChar"/>
+ <itemData name="String Char" defStyleNum="dsChar"/>
+ <itemData name="Symbol" defStyleNum="dsNormal"/>
+ <itemData name="Java 1.4.2 Classes" defStyleNum="dsNormal" color="#0095FF" selColor="#FFFFFF" bold="1" italic="0"/>
+
+ <itemData name="Jsp Directive" defStyleNum="dsNormal" color="#0000ff" selColor="#00ff00" bold="true" italic="true"/>
+ <itemData name="Jsp Scriptlet" defStyleNum="dsNormal" color="#000000" selColor="#ffffff" bold="true" italic="false"/>
+ <itemData name="Jsp Expression" defStyleNum="dsNormal" color="#000000" selColor="#ffffff" bold="true" italic="false"/>
+ <itemData name="Jsp Comment" defStyleNum="dsComment"/>
+
+ <itemData name="Jsp Param Name" defStyleNum="dsOthers"/>
+ <itemData name="Jsp Param Value" defStyleNum="dsString"/>
+
+ <itemData name="Java Comment" defStyleNum="dsComment"/>
+ </itemDatas>
+ </highlighting>
+
+ <general>
+ <comments>
+ <comment name="multiLine" start="&lt;%-- " end=" --%&gt;" />
+ </comments>
+ <keywords casesensitive="1" />
+ </general>
+</language>
diff --git a/kate/data/katefiletyperc b/kate/data/katefiletyperc
new file mode 100644
index 000000000..c9490d23b
--- /dev/null
+++ b/kate/data/katefiletyperc
@@ -0,0 +1,34 @@
+[Docbook]
+Mimetypes=text/docbook
+Priority=10
+Section=Markup
+Variables=kate: indent-mode none; encoding utf-8;
+Wildcards=*.docbook
+
+[GNU Gettext]
+Mimetypes=application/x-gettext
+Priority=1
+Section=Markup
+Variables=kate: encoding utf-8;
+Wildcards=*.po;*.pot
+
+[Makefiles]
+Mimetypes=text/x-makefile
+Priority=5
+Section=Other
+Variables=kate: space-indent off; indent-width 8; replace-tabs off; replace-tabs-save off;
+Wildcards=*Makefile*;*makefile*
+
+[Python]
+Mimetypes=application/x-python
+Priority=1
+Section=Scripts
+Variables=kate: indent-mode python;
+Wildcards=*.py
+
+[XML]
+Mimetypes=application/mathml+xml;application/smil;application/vnd.mozilla.xul+xml;application/x-designer;application/x-kugar;application/x-uml;application/xhtml+xml;text/mrml;text/rdf;text/sgml;text/vnd.wap.wml;text/xml;image/svg+xml
+Priority=1
+Section=Markup
+Variables=kate: indent-mode xml;
+Wildcards=*.mml;*.MML;*.smil;*.smi;*.xul;*.XUL;*.ui;*.kud;*.xmi;*.XMI;*.xmi.tgz;*.xmi.tar.bz2;*.mrml;*.MRML;*.rdf;*.RDF;*.sgml;*.SGML;*.wml;*.WML;*.xml;*.XML;*.xsd;*ui.rc;*.svg
diff --git a/kate/data/katepart.desktop b/kate/data/katepart.desktop
new file mode 100644
index 000000000..bc7c6fd9b
--- /dev/null
+++ b/kate/data/katepart.desktop
@@ -0,0 +1,90 @@
+[Desktop Entry]
+Name=Embedded Advanced Text Editor
+Name[af]=Ingebedde Gevorderde Teks Redigeerder
+Name[ar]=محرر نص كيدي متقدم و مدمج
+Name[az]=Daxili Mütəxəssis Mətn Editoru
+Name[be]=Унутраны адмыÑловы Ñ‚ÑкÑтавы Ñ€Ñдактар
+Name[bg]=Разширен текÑтов редактор
+Name[bn]=অভà§à¦¯à¦¨à§à¦¤à¦°à§€à¦¨ উনà§à¦¨à¦¤ টেকà§à¦¸à¦Ÿ সমà§à¦ªà¦¾à¦¦à¦•
+Name[br]=Aozer skrid barek enframmet
+Name[bs]=Umetnuti napredni tekst editor
+Name[ca]=Editor avançat de text, encastable
+Name[cs]=Zabudovaný rozšířený editor
+Name[csb]=Òbsôdzony awansowôny editora tekstu
+Name[cy]=Golygydd Testun Uwch Mewnol
+Name[da]=Indlejret avanceret teksteditor
+Name[de]=Erweiterte Editorkomponente
+Name[el]=Ενσωματωμένος Ï€ÏοχωÏημένος επεξεÏγαστής κειμένου
+Name[eo]=Enkorpigita altnivela tekstredaktilo
+Name[es]=Editor de texto avanzado empotrable
+Name[et]=Põimitud võimas tekstiredaktor
+Name[eu]=Kapsulatutako testu-editore aurreratua
+Name[fa]=ویرایشگر متن پیشرÙتۀ نهÙته
+Name[fi]=Upotettava kehittynyt tekstieditori
+Name[fr]=Éditeur de texte avancé intégré
+Name[fy]=Ynsletten avansearre tekstbewurker
+Name[ga]=Ard-eagarthóir téacs leabaithe
+Name[gl]=Editor de Textos Avanzado Incrustado
+Name[he]=עורך הטקסט ×”×ž×ª×§×“× ×”×ž×•×˜×‘×¢
+Name[hi]= अंतरà¥à¤¨à¤¿à¤¹à¤¿à¤¤ विकसित पाठ संपादक
+Name[hr]=Ugrađena napredna obrada teksta
+Name[hsb]=Integrowany lěpši wobdźěłar teksta
+Name[hu]=Beágyazott Kate szövegszerkesztő
+Name[id]=Komponen Editor Teks Embedded
+Name[is]=Ãvefjanlegur þróaður textaritill
+Name[it]=Editor di testi avanzato integrato
+Name[ja]=埋ã‚è¾¼ã¿é«˜æ©Ÿèƒ½ãƒ†ã‚­ã‚¹ãƒˆã‚¨ãƒ‡ã‚£ã‚¿
+Name[ka]=ჩáƒáƒ“გმული ტექსტური რედáƒáƒ¥áƒ¢áƒáƒ áƒ˜
+Name[kk]=Ендірілетін үздік мәтін редакторы
+Name[km]=កម្មវិធី​និពន្ធ​អážáŸ’ážáž”ទ​កម្រិážâ€‹ážáŸ’ពស់​ដែល​បាន​បង្កប់
+Name[ko]=ë¼ì›Œë„£ì€ 고급 글월 편집기
+Name[lb]=Agebetteten erweiderten Texteditor
+Name[lt]=Įdėtas sudėtingesnis tekstų redaktorius
+Name[lv]=Iegultais paplaÅ¡inÄtais tekstu redaktors
+Name[mk]=Вгнезден напреден текÑÑ‚ уредувач
+Name[mn]=Kate-Ñ…ÑÑ€ÑгÑÑл
+Name[ms]=Penyunting Teks Termaju Terimplan
+Name[mt]=Editur ta' test integrat avvanzat
+Name[nb]=Innebyggbart, avansert tekstredigerings-program
+Name[nds]=Inbett verwiedert Texteditor
+Name[ne]=समà¥à¤®à¤¿à¤²à¤¿à¤¤ उनà¥à¤¨à¤¤ पाठ समà¥à¤ªà¤¾à¤¦à¤•
+Name[nl]=Ingebed tekstinvoercomponent
+Name[nn]=Inkluderbart avansert skriveprogram
+Name[nso]=Mofetosi yo a Robaditswego wa Sengwalwana seo se Beetswegopele
+Name[pa]=ਸ਼ਾਮਿਲ ਤਕਨੀਕੀ ਪਾਠ ਸੰਪਾਦਕ
+Name[pl]=Osadzony zaawansowany edytor tekstu
+Name[pt]=Editor de Texto Avançado Embebido
+Name[pt_BR]=Componente integrado ao Editor de textos
+Name[ro]=Editor de text avansat înglobat
+Name[ru]=Ð’Ñтроенный текÑтовый редактор
+Name[rw]=Muhinduzi y'Umwandiko Ihanitse Ishyizwemo
+Name[se]=Nana buorre vuojuhanláhkái Äállinprográmma
+Name[sk]=Vložiteľný komponent pokroÄilého textového editora
+Name[sl]=Vgrajeni napredni urejevalnik besedil
+Name[sq]=Tekst Editori i avancuar i ngulur
+Name[sr]=Уграђени напредни уређивач текÑта
+Name[sr@Latn]=UgraÄ‘eni napredni ureÄ‘ivaÄ teksta
+Name[sv]=Inbäddningsbar avancerad texteditor
+Name[ta]=உடà¯à®ªà¯Šà®¤à®¿à®¨à¯à®¤ மேமà¯à®ªà®Ÿà¯à®Ÿ உரை தொகà¯à®ªà¯à®ªà®¾à®³à®°à¯
+Name[te]=ఆధà±à°¨à°¿à°• పొదగిన వాచకం సరిచేయà±à°¨à°¦à°¿
+Name[tg]=Таҳриргари матни дарунÑохти беҳбудшуда
+Name[th]=โปรà¹à¸à¸£à¸¡à¹à¸à¹‰à¹„ขข้อความขั้นสูงà¹à¸šà¸šà¸à¸±à¸‡à¸•à¸±à¸§
+Name[tr]=Gelişmiş Metin Düzenleyici
+Name[tt]=Mäten öçen Quşılma-Üzgärtkeç
+Name[uk]=Вмонтований потужний текÑтовий редактор
+Name[uz]=Matn tahrirchi
+Name[uz@cyrillic]=Матн таҳрирчи
+Name[ven]=Musengulusi wa manwalwa a nthesa o dzheniswaho
+Name[vi]=Bộ Soạn thảo Văn bản Cấp cao Nhúng
+Name[wa]=Ravalé aspougneu di tecse avancî
+Name[xh]=Umhleli Wombhalo Obhekisa phambili Olungiselweyo
+Name[zh_CN]=åµŒå…¥å¼ KDE 高级文本编辑器
+Name[zh_HK]=嵌入å¼é€²éšŽæ–‡å­—編輯器
+Name[zh_TW]=嵌入å¼é€²éšŽæ–‡å­—編輯器
+Name[zu]=Umlungisi Wezinga Eliphezulu Oshuthekiwe
+X-KDE-Library=libkatepart
+Icon=kate
+ServiceTypes=KParts/ReadOnlyPart,Browser/View,KParts/ReadWritePart,KTextEditor/Editor,KTextEditor/Document
+Type=Service
+InitialPreference=8
+MimeType=text/plain;text/x-makefile;text/x-c++hdr;text/x-c++src;text/x-chdr;text/x-csrc;text/x-java;text/x-moc;text/x-pascal;text/x-tcl;text/x-tex;application/x-shellscript;text/x-diff;text/x-adasrc;text/x-chdr;text/x-csrc;text/css;application/x-desktop;text/x-diff;text/x-fortran;text/html;text/x-java;text/x-tex;text/x-makefile;text/x-objcsrc;text/x-pascal;application/x-perl;application/x-perl-module;application/x-php;text/vnd.wap.wml;application/x-python;application/x-ruby;text/sgml;text/xml;model/vrml
diff --git a/kate/data/katepartreadonlyui.rc b/kate/data/katepartreadonlyui.rc
new file mode 100644
index 000000000..5c899dbfb
--- /dev/null
+++ b/kate/data/katepartreadonlyui.rc
@@ -0,0 +1,98 @@
+<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
+<kpartgui name="KatePartView" version="40">
+<MenuBar>
+ <Menu name="file" noMerge="1"><text>&amp;File</text>
+ <Action name="file_save_as" group="save_merge" />
+ <Action name="file_reload" group="revert_merge" />
+ <Separator group="print_merge" />
+ <Action name="file_export_html" group="print_merge"/>
+ </Menu>
+
+ <Menu name="edit" noMerge="1"><text>&amp;Edit</text>
+ <Action name="edit_copy_html" group="edit_paste_merge" />
+ <Separator group="edit_paste_merge" />
+ <Action name="edit_select_all" group="edit_select_merge" />
+ <Action name="edit_deselect" group="edit_select_merge" />
+ <Action name="set_verticalSelect" group="edit_select_merge" />
+ <Separator group="edit_select_merge" />
+ <Action name="edit_find" group="edit_find_merge" />
+ <Action name="edit_find_next" group="edit_find_merge" />
+ <Action name="edit_find_prev" group="edit_find_merge" />
+ <Separator group="edit_find_merge" />
+ <Action name="go_goto_line" group="edit_find_merge"/>
+ </Menu>
+
+ <Menu name="view" noMerge="1"><text>&amp;View</text>
+ <Action name="switch_to_cmd_line" group="view_operations" />
+ <Separator group="view_operations" />
+ <Action name="view_schemas" group="view_operations" />
+ <Separator group="view_operations" />
+ <Action name="view_dynamic_word_wrap" group="view_operations" />
+ <Action name="dynamic_word_wrap_indicators" group="view_operations" />
+ <Action name="view_word_wrap_marker" group="view_operations" />
+ <Separator group="view_operations" />
+ <Action name="view_border" group="view_operations" />
+ <Action name="view_line_numbers" group="view_operations" />
+ <Action name="view_scrollbar_marks" group="view_operations" />
+ <Separator group="view_operations" />
+ <Action name="view_folding_markers" group="view_operations" />
+ <Menu name="codefolding" group="view_operations"><text>&amp;Code Folding</text>
+ <Action name="folding_toplevel" group="view_operations" />
+ <Action name="folding_expandtoplevel" group="view_operations" />
+ <Action name="folding_collapselocal" group="view_operations" />
+ <Action name="folding_expandlocal" group="view_operations" />
+ </Menu>
+ <Separator group="view_operations" />
+ </Menu>
+
+
+ <Menu name="tools"><text>&amp;Tools</text>
+ <Action name="bookmarks" />
+ <Separator group="tools_operations" />
+ <Action name="set_filetype" group="tools_operations" />
+ <Action name="set_highlight" group="tools_operations" />
+ <Action name="set_encoding" group="tools_operations" />
+ <Action name="set_eol" group="tools_operations" />
+ <Separator group="tools_operations" />
+ <Action name="tools_spelling" group="tools_operations" />
+ <Separator group="tools_operations" />
+ <Action name="tools_indent" group="tools_operations" />
+ <Action name="tools_unindent" group="tools_operations" />
+ <Action name="tools_cleanIndent" group="tools_operations" />
+ <Action name="tools_align" group="tools_operations" />
+ <Separator group="tools_operations" />
+ <Action name="tools_comment" group="tools_operations" />
+ <Action name="tools_uncomment" group="tools_operations" />
+ <Separator group="tools_operations" />
+ <Action name="tools_uppercase" group="tools_operations" />
+ <Action name="tools_lowercase" group="tools_operations" />
+ <Action name="tools_capitalize" group="tools_operations" />
+ <Separator group="tools_operations" />
+ <Action name="tools_join_lines" group="tools_operations" />
+ <Action name="tools_apply_wordwrap" group="tools_operations" />
+ </Menu>
+
+ <Menu name="settings" noMerge="1"><text>&amp;Settings</text>
+ <Action name="set_confdlg" group="configure_merge" />
+ </Menu>
+</MenuBar>
+
+<Menu name="ktexteditor_popup" noMerge="1">
+ <Action name="edit_undo" group="popup_operations" />
+ <Action name="edit_redo" group="popup_operations" />
+ <Separator group="popup_operations" />
+ <Action name="edit_cut" group="popup_operations" />
+ <Action name="edit_copy" group="popup_operations" />
+ <Action name="edit_paste" group="popup_operations" />
+ <Separator group="popup_operations" />
+ <Action name="bookmarks" group="popup_operations" />
+ <Separator group="popup_operations" />
+</Menu>
+
+<ToolBar name="mainToolBar" noMerge="1"><text>Main Toolbar</text>
+ <Action name="edit_find" group="find_operations" />
+ <Action name="incFontSizes" group="zoom_operations" />
+ <Action name="decFontSizes" group="zoom_operations" />
+</ToolBar>
+
+</kpartgui>
diff --git a/kate/data/katepartui.rc b/kate/data/katepartui.rc
new file mode 100644
index 000000000..13908ad14
--- /dev/null
+++ b/kate/data/katepartui.rc
@@ -0,0 +1,124 @@
+<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
+<kpartgui name="KatePartView" version="40">
+<MenuBar>
+ <Menu name="file" noMerge="1"><text>&amp;File</text>
+ <Action name="file_save" group="save_merge" />
+ <Action name="file_save_as" group="save_merge" />
+ <Action name="file_reload" group="revert_merge" />
+ <Action name="file_print" group="print_merge" />
+ <Separator group="print_merge" />
+ <Action name="file_export_html" group="print_merge"/>
+ </Menu>
+
+ <Menu name="edit" noMerge="1"><text>&amp;Edit</text>
+ <Action name="edit_undo" group="edit_undo_merge" />
+ <Action name="edit_redo" group="edit_undo_merge" />
+ <Separator group="edit_undo_merge" />
+ <Action name="edit_cut" group="edit_paste_merge" />
+ <Action name="edit_copy" group="edit_paste_merge" />
+ <Action name="edit_copy_html" group="edit_paste_merge" />
+ <Action name="edit_paste" group="edit_paste_merge" />
+ <Separator group="edit_paste_merge" />
+ <Action name="edit_select_all" group="edit_select_merge" />
+ <Action name="edit_deselect" group="edit_select_merge" />
+ <Action name="set_verticalSelect" group="edit_select_merge" />
+ <Separator group="edit_select_merge" />
+ <Action name="set_insert" group="edit_select_merge" />
+ <Separator group="edit_select_merge" />
+ <Action name="edit_find" group="edit_find_merge" />
+ <Action name="edit_find_next" group="edit_find_merge" />
+ <Action name="edit_find_prev" group="edit_find_merge" />
+ <Action name="edit_replace" group="edit_find_merge" />
+ <Separator group="edit_find_merge" />
+ <Action name="go_goto_line" group="edit_find_merge"/>
+ </Menu>
+
+ <Menu name="view" noMerge="1"><text>&amp;View</text>
+ <Action name="switch_to_cmd_line" group="view_operations" />
+ <Separator group="view_operations" />
+ <Action name="view_schemas" group="view_operations" />
+ <Separator group="view_operations" />
+ <Action name="view_dynamic_word_wrap" group="view_operations" />
+ <Action name="dynamic_word_wrap_indicators" group="view_operations" />
+ <Action name="view_word_wrap_marker" group="view_operations" />
+ <Separator group="view_operations" />
+ <Action name="view_border" group="view_operations" />
+ <Action name="view_line_numbers" group="view_operations" />
+ <Action name="view_scrollbar_marks" group="view_operations" />
+ <Separator group="view_operations" />
+ <Action name="view_folding_markers" group="view_operations" />
+ <Menu name="codefolding" group="view_operations"><text>&amp;Code Folding</text>
+ <Action name="folding_toplevel" group="view_operations" />
+ <Action name="folding_expandtoplevel" group="view_operations" />
+ <Action name="folding_collapselocal" group="view_operations" />
+ <Action name="folding_expandlocal" group="view_operations" />
+ </Menu>
+ <Separator group="view_operations" />
+ </Menu>
+
+ <Action name="bookmarks" />
+
+ <Menu name="tools" noMerge="1"><text>&amp;Tools</text>
+ <Action name="tools_toggle_write_lock" group="tools_operations" />
+ <Separator group="tools_operations" />
+ <Action name="set_filetype" group="tools_operations" />
+ <Action name="set_highlight" group="tools_operations" />
+ <Action name="tools_indentation" group="tools_operations" />
+ <Action name="set_encoding" group="tools_operations" />
+ <Action name="set_eol" group="tools_operations" />
+ <Separator group="tools_operations" />
+ <Action name="tools_spelling" group="tools_operations" />
+ <Action name="tools_spelling_from_cursor" group="tools_operations" />
+ <Action name="tools_spelling_selection" group="tools_operations" />
+ <Separator group="tools_operations" />
+ <Action name="tools_indent" group="tools_operations" />
+ <Action name="tools_unindent" group="tools_operations" />
+ <Action name="tools_cleanIndent" group="tools_operations" />
+ <Action name="tools_align" group="tools_operations" />
+ <Separator group="tools_operations" />
+ <Action name="tools_comment" group="tools_operations" />
+ <Action name="tools_uncomment" group="tools_operations" />
+ <Separator group="tools_operations" />
+ <Action name="tools_uppercase" group="tools_operations" />
+ <Action name="tools_lowercase" group="tools_operations" />
+ <Action name="tools_capitalize" group="tools_operations" />
+ <Separator group="tools_operations" />
+ <Action name="tools_join_lines" group="tools_operations" />
+ <Action name="tools_apply_wordwrap" group="tools_operations" />
+ </Menu>
+
+ <Menu name="settings" noMerge="1"><text>&amp;Settings</text>
+ <Action name="set_confdlg" group="configure_merge" />
+ </Menu>
+</MenuBar>
+
+<Menu name="ktexteditor_popup" noMerge="0">
+ <Action name="edit_undo" group="popup_operations" />
+ <Action name="edit_redo" group="popup_operations" />
+ <Separator group="popup_operations" />
+ <Action name="edit_cut" group="popup_operations" />
+ <Action name="edit_copy" group="popup_operations" />
+ <Action name="edit_paste" group="popup_operations" />
+ <Separator group="popup_operations" />
+ <Action name="edit_select_all" group="popup_operations" />
+ <Action name="edit_deselect" group="popup_operations" />
+ <Separator group="popup_operations" />
+ <Action name="bookmarks" group="popup_operations" />
+ <Separator group="popup_operations" />
+</Menu>
+
+<ToolBar name="mainToolBar" noMerge="1"><text>Main Toolbar</text>
+ <Action name="file_save" group="file_operations" />
+ <Action name="file_save_as" group="file_operations" />
+ <Action name="file_print" group="print_merge" />
+ <Action name="edit_undo" group="edit_operations" />
+ <Action name="edit_redo" group="edit_operations" />
+ <Action name="edit_cut" group="edit_operations" />
+ <Action name="edit_copy" group="edit_operations" />
+ <Action name="edit_paste" group="edit_operations" />
+ <Action name="edit_find" group="find_operations" />
+ <Action name="incFontSizes" group="zoom_operations" />
+ <Action name="decFontSizes" group="zoom_operations" />
+</ToolBar>
+
+</kpartgui>
diff --git a/kate/data/katesyntaxhighlightingrc b/kate/data/katesyntaxhighlightingrc
new file mode 100644
index 000000000..9b73efd08
--- /dev/null
+++ b/kate/data/katesyntaxhighlightingrc
@@ -0,0 +1,3 @@
+[General]
+Version=14
+CachedVersion=0
diff --git a/kate/data/kbasic.xml b/kate/data/kbasic.xml
new file mode 100644
index 000000000..638cbe828
--- /dev/null
+++ b/kate/data/kbasic.xml
@@ -0,0 +1,97 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+<language name="KBasic" version="1.02" kateversion="2.1" section="Sources" extensions="*.kbasic" mimetype="text/x-kbasic-src">
+ <highlighting>
+ <list name="keywords">
+ <item> For </item>
+ <item> Next</item>
+ <item> Do </item>
+ <item> Loop </item>
+ <item> While </item>
+ <item> Wend </item>
+ <item> Until </item>
+ <item> If </item>
+ <item> Else </item>
+ <item> End </item>
+ <item> Function </item>
+ <item> Goto </item>
+ <item> Sub </item>
+ <item> Implements </item>
+ <item> In </item>
+ <item> Sub </item>
+ <item> Private </item>
+ <item> Public </item>
+ <item> Global </item>
+ <item> As </item>
+ <item> Dim </item>
+ <item> Set </item>
+ <item> Let </item>
+ <item> Get </item>
+ <item> To </item>
+ <item> Property </item>
+ <item> True </item>
+ <item> False </item>
+ <item> Or </item>
+ <item> Not </item>
+ <item> Xor </item>
+ <item> And </item>
+ <item> Then </item>
+ <item> Exit </item>
+ <item> Put </item>
+ <item> Open </item>
+ <item> Close </item>
+ <item> Seek </item>
+ <item> Print </item>
+ <item> Input</item>
+ <item> Output </item>
+ <item> Repeat </item>
+ <item> Load </item>
+ <item> Unload </item>
+ <item> Declare </item>
+ <item> Option </item>
+ <item> Explicit </item>
+ </list>
+ <list name="types">
+ <item>Integer </item>
+ <item>Long </item>
+ <item>Byte </item>
+ <item>Boolean </item>
+ <item>Variant </item>
+ <item>Single </item>
+ <item>Double </item>
+ <item>Currency </item>
+ <item>String </item>
+ <item>Object </item>
+ <item>Control </item>
+ </list>
+ <contexts>
+ <context attribute="Normal Text" lineEndContext="#stay" name="Normal">
+ <keyword attribute="Keyword" context="#stay" String="keywords"/>
+ <keyword attribute="Identifier" context="#stay" String="types"/>
+ <Float attribute="String" context="#stay"/>
+ <Int attribute="Types" context="#stay"/>
+ <DetectChar attribute="String" context="String" char="quot;"/>
+ <DetectChar attribute="Comment" context="Comment" char="'"/>
+ </context>
+ <context name="Comment" attribute="Comment" lineEndContext="#pop"/>
+ <context name="String" attribute="String" lineEndContext="#pop">
+ <DetectChar attribute="String" context="#pop" char="'"/>
+ </context>
+ </contexts>
+ <itemDatas>
+ <itemData name="Normal Text" defStyleNum="dsNormal"/>
+ <itemData name="Keyword" defStyleNum="dsKeyword"/>
+ <itemData name="Identifier" defStyleNum="dsOthers"/>
+ <itemData name="Types" defStyleNum="dsDataType"/>
+ <itemData name="String" defStyleNum="dsString"/>
+ <itemData name="Comment" defStyleNum="dsComment"/>
+ </itemDatas>
+ </highlighting>
+ <general>
+ <comments>
+ <comment name="singleLine" start="//" />
+ <comment name="multiLine" start="/*" end="*/" />
+ </comments>
+ <keywords casesensitive="1" />
+ </general>
+</language>
diff --git a/kate/data/language.dtd b/kate/data/language.dtd
new file mode 100644
index 000000000..8830837a6
--- /dev/null
+++ b/kate/data/language.dtd
@@ -0,0 +1,468 @@
+<!--
+ Copyright (c) 2001 Joseph Wenninger <jowenn@kde.org>
+ modified (c) 2002 Anders Lund <anders@alweb.dk>
+ modified (c) 2003 Simon Huerlimann <simon.huerlimann@access.unizh.ch>
+ modified (c) 2005 Dominik Haumann <dhdev@gmx.de>
+
+ This file describes the XML format used for syntax highlight descriptions
+ for the Kate text editor (http://kate.kde.org), which is part of the KDE
+ desktop environment (http://www.kde.org).
+ You'll find the "Writing a Kate Highlighting XML File HOWTO" at
+ http://kate.kde.org/doc/hlhowto.php
+
+ This format is identified using the SYSTEM identifier
+ SYSTEM "language.dtd"
+
+ Files using this format should include a DOCTYPE declaration like this:
+ <!DOCTYPE language SYSTEM "language.dtd">
+
+ You can validate your syntax files using checkXML from the development
+ package of kdelibs:
+ checkXML yourSyntax.xml
+ If you see any 'validity error' lines, you should fix them. If you get
+ a lot of 'No template matches' lines, everything's just fine. You've
+ produced a valid syntax file!
+
+ It's also possible to use the (much faster) xmllint which comes with the
+ GNOME (oops:-) XML Library libxml2:
+
+ xmllint - -dtdvalid language.dtd yourSyntax.xml
+ (don't use a space between the two - That's just because XML
+ comments don't allow that:-(
+
+ To use your syntax file, copy it to .kde/share/apps/katepart/syntax/ in
+ your home directory. You have to open a new instance of kwrite/kate to use
+ the new syntax file.
+
+TODO
+ - find a more readable way for the - -dtdvalid stuff, it's just annoying
+ xml comments don't allow it.
+-->
+
+<!-- Entity declarations
+ You can use '&per;' instead of '.'. This seems to be useful in <item> elements.
+
+TODO
+ - Are there any more such pre-defined entities?
+-->
+<!ENTITY per "." >
+
+<!-- Boolean type
+ Attributes that are of type boolean allow the following values:
+ 'true', 'TRUE' and '1' all meaning true,
+ 'false', FALSE' and '0' all meaning false.
+
+ It is encouraged to use 'true' and 'false' instead of the alternatives.
+-->
+<!ENTITY % boolean "true|false|TRUE|FALSE|0|1">
+
+<!-- Default Styles
+ Allowed predefined default styles for itemData, available are:
+ - dsNormal, used for normal text
+ - dsKeyword, used for keywords
+ - dsDataType, used for data types
+ - dsDecVal, used for decimal values
+ - dsBaseN, used for values with a base other than 10
+ - dsFloat, used for float values
+ - dsChar, used for a character
+ - dsString, used for strings
+ - dsComment, used for comments
+ - dsOthers, used for 'other' things
+ - dsAlert, used for warning messages
+ - dsFunction, used for function calls
+ - dsRegionMarker, used for region markers
+ - dsError, used for error highlighting.
+-->
+<!ENTITY % defStyles "dsNormal|dsKeyword|dsDataType|dsDecVal|dsBaseN|dsFloat|dsChar|dsString|dsComment|dsOthers|dsAlert|dsFunction|dsRegionMarker|dsError">
+
+<!-- Language specification
+ name: The name of this syntax description. Used in the Highlightning Mode menu
+ section: The logical group to which this syntax description belongs. Used for sub menus
+ extensions: A file glob or pattern to decide for which documents to use this syntax description
+ mimetype: A list of mimetypes to decide for which documents to use this syntax description [optional]
+ version: Version number of this syntax description [optional]
+ kateversion: Kate version required for using this file [optional]
+ casesensitive: Whether text is matched case sensitive. [boolean, optional, default=true] FIXME: This is not implemented yet
+ priority: Priority of this language, if more than one are usable for the file [optional]
+ author: Name of author of this hl file [optional]
+ license: License for this hl file [optional]
+ hidden: Should it be hidden in menu [boolean, optional, default=false]
+
+TODO
+ - Which matches are affected by casesensitive? keyword, RegExpr, StringDetect...?
+
+WARNING: due to helper scripts, the language opening tag must be on a
+*single line* and *cannot* be split in multiple lines.
+
+-->
+<!ELEMENT language (highlighting, general?)>
+<!ATTLIST language
+ name CDATA #REQUIRED
+ section NMTOKEN #REQUIRED
+ extensions CDATA #REQUIRED
+ mimetype CDATA #IMPLIED
+ version CDATA #IMPLIED
+ kateversion CDATA #IMPLIED
+ casesensitive (%boolean;) #IMPLIED
+ priority CDATA #IMPLIED
+ author CDATA #IMPLIED
+ license CDATA #IMPLIED
+ hidden (%boolean;) #IMPLIED
+>
+
+<!-- General options -->
+<!ELEMENT general (folding|comments|keywords|indentation)*>
+
+<!-- List of folding
+ indentationsensitive: If true, the code folding is indentation based.
+-->
+<!ELEMENT folding EMPTY>
+<!ATTLIST folding
+ indentationsensitive (%boolean;) #IMPLIED
+>
+
+<!-- List of comments -->
+<!ELEMENT comments (comment)+>
+
+<!-- Comment specification
+ name: Type of this comment. Allowed are 'singleLine' and 'multiLine'
+ start: The comment starts with this string
+ end: The comment ends with this string [optional]
+ region: The region name of the foldable multiline comment. If you have
+ beginRegion="Comment" ... endRegion="Comment" you should use
+ region="Comment". This way uncomment works even if you do not
+ select all the text of the multiline comment.
+ position: only availalbe for type singleLine. Default is column0, to insert
+ the single line comment characters after the whitespaces
+ (= before the first non space) set position to "afterwhitespace"
+-->
+<!ELEMENT comment EMPTY>
+<!ATTLIST comment
+ name (singleLine|multiLine) #REQUIRED
+ start CDATA #REQUIRED
+ end CDATA #IMPLIED
+ region CDATA #IMPLIED
+ position (afterwhitespace) #IMPLIED
+>
+
+<!-- Keyword options
+ casesensitive: Whether keywords are matched case sensitive. [boolean, optional, default=true]
+ weakDeliminator: Add weak deliminators [optional, default: ""]
+ additionalDeliminator: Add deliminators [optional]
+ wordWrapDeliminator: characters that are used to wrap long lines [optional]
+
+-->
+<!ELEMENT keywords EMPTY>
+<!ATTLIST keywords
+ casesensitive CDATA #IMPLIED
+ weakDeliminator CDATA #IMPLIED
+ additionalDeliminator CDATA #IMPLIED
+ wordWrapDeliminator CDATA #IMPLIED
+>
+
+<!-- Indentation options
+ mode: indentation mode to use
+
+TODO
+ - Explain (weak) deliminators
+-->
+<!ELEMENT indentation EMPTY>
+<!ATTLIST indentation
+ mode CDATA #IMPLIED
+>
+
+
+<!-- Highlighting specification -->
+<!ELEMENT highlighting (list*, contexts, itemDatas)>
+<!ATTLIST highlighting
+>
+
+<!-- List of items
+ name: Name of this list
+-->
+<!ELEMENT list (item)*>
+<!ATTLIST list
+ name CDATA #REQUIRED
+>
+
+<!-- List item
+ contains string used in <keyword>
+-->
+<!ELEMENT item (#PCDATA)>
+
+<!-- List of contexts -->
+<!ELEMENT contexts (context)+>
+
+<!-- context specification
+ name: The name of this context specification. Used in '*Context' attributes [optional]
+ attribute: The name of the ItemData to be used for matching text
+ lineEndContext: Next context if end of line is encountered
+ lineBeginContext: Next context if begin of line is encountered [optional]
+ fallthrough: Use a fallthrough context [optional]
+ fallthroughContext: Fall through to this context [optional]
+ dynamic: Dynamic context [boolean, optional]
+
+TODO:
+ - Explain fallthrough.
+ - Do we need fallthrough at all? It could be true, if fallthroughContext is set, false otherwhise.
+ - Make lineEndContext optional, defaults to '#stay'. Reasonable?
+-->
+<!ELEMENT context (keyword | Float | HlCOct | HlCHex | HlCFloat | Int | DetectChar | Detect2Chars | AnyChar | StringDetect | RegExpr | LineContinue | HlCStringChar | RangeDetect | HlCChar | IncludeRules | DetectSpaces | DetectIdentifier)*>
+<!ATTLIST context
+ name CDATA #IMPLIED
+ attribute CDATA #REQUIRED
+ lineEndContext CDATA #REQUIRED
+ lineBeginContext CDATA #IMPLIED
+ fallthrough (%boolean;) #IMPLIED
+ fallthroughContext CDATA #IMPLIED
+ dynamic (%boolean;) #IMPLIED
+>
+
+<!-- Common attributes
+ attribute: The name of the ItemData to be used for matching text
+ context: The name of the context to go to when this rule matches
+ beginRegion: Begin a region of type beginRegion [optional]
+ endRegion: End a region of type endRegion [optional]
+ firstNonSpace: should this rule only match at first non-space char in line?
+ column: should this rule only match at given column in line (column == count of chars in front)
+-->
+<!ENTITY % commonAttributes
+ "attribute CDATA #IMPLIED
+ context CDATA #IMPLIED
+ beginRegion CDATA #IMPLIED
+ endRegion CDATA #IMPLIED
+ lookAhead (%boolean;) #IMPLIED
+ firstNonSpace (%boolean;) #IMPLIED
+ column CDATA #IMPLIED"
+>
+
+<!-- Detect members of a keyword list
+ commonAttributes: Common attributes
+ String: Name of the list
+ weakDelimiter: Use weak deliminator
+
+TODO:
+ - Should be weakDeliminator
+ - Explain deliminator
+ - Doesn't seem to be suported in highligh.cpp
+-->
+<!ELEMENT keyword EMPTY>
+<!ATTLIST keyword
+ %commonAttributes;
+ String CDATA #REQUIRED
+ weakDelimiter CDATA #IMPLIED
+>
+
+<!-- Detect a floating point number
+ commonAttributes: Common attributes
+ AnyChar is allowed as a child rule. TODO: The source code allows
+ *all* rules to be child rules, shall we change the DTD in some way?
+-->
+<!ELEMENT Float (AnyChar)*>
+<!ATTLIST Float
+ %commonAttributes;
+>
+
+<!-- Detect an octal number
+ commonAttributes: Common attributes
+-->
+<!ELEMENT HlCOct EMPTY>
+<!ATTLIST HlCOct
+ %commonAttributes;
+>
+
+<!-- Detect a hexadecimal number
+ commonAttributes: Common attributes
+-->
+<!ELEMENT HlCHex EMPTY>
+<!ATTLIST HlCHex
+ %commonAttributes;
+>
+
+<!-- Detect a C-style floating point number
+ commonAttributes: Common attributes
+-->
+<!ELEMENT HlCFloat EMPTY>
+<!ATTLIST HlCFloat
+ %commonAttributes;
+>
+
+<!-- Detect C-style character
+ commonAttributes: Common attributes
+
+TODO
+ - Did I get this right?
+-->
+<!ELEMENT HlCChar EMPTY>
+<!ATTLIST HlCChar
+ %commonAttributes;
+>
+
+<!-- Detect an integer number
+ commonAttributes: Common attributes
+ StringDetect is allowed as a child rule. TODO: The source code allows
+ *all* rules to be child rules, shall we change the DTD in some way?
+-->
+<!ELEMENT Int (StringDetect)*>
+<!ATTLIST Int
+ %commonAttributes;
+>
+
+<!-- Detect a single character
+ commonAttributes: Common attributes
+ char: The character to look for
+ dynamic: Uses 0 ... 9 as placeholders for dynamic arguments (in fact, first char of arg...) [boolean, optional, default=false]
+-->
+<!ELEMENT DetectChar EMPTY>
+<!ATTLIST DetectChar
+ %commonAttributes;
+ char CDATA #REQUIRED
+ dynamic (%boolean;) #IMPLIED
+>
+
+<!-- Detect two characters
+ commonAttributes: Common attributes
+ char: The first character
+ char1: The second character
+ dynamic: Uses 0 ... 9 as placeholders for dynamic arguments (in fact, first char of arg...) [boolean, optional, default=false]
+-->
+<!ELEMENT Detect2Chars EMPTY>
+<!ATTLIST Detect2Chars
+ %commonAttributes;
+ char CDATA #REQUIRED
+ char1 CDATA #REQUIRED
+ dynamic (%boolean;) #IMPLIED
+>
+
+<!-- Detect any group of characters
+ commonAttributes: Common attributes
+ String: A string representing the characters to look for
+
+TODO
+ - Description is not descriptive enough, I'm not sure what it exactly does:-(
+-->
+<!ELEMENT AnyChar EMPTY>
+<!ATTLIST AnyChar
+ %commonAttributes;
+ String CDATA #REQUIRED
+>
+
+<!-- Detect a string
+ commonAttributes: Common attributes
+ String: The string to look for
+ insensitive: Whether the string is matched case INsensitive. [boolean, optional, default=false]
+ dynamic: Uses %0 ... %9 as placeholders for dynamic arguments [boolean, optional, default=false]
+
+TODO
+ - What's default of insensitive? I'm not sure...
+-->
+<!ELEMENT StringDetect EMPTY>
+<!ATTLIST StringDetect
+ %commonAttributes;
+ String CDATA #REQUIRED
+ insensitive (%boolean;) #IMPLIED
+ dynamic (%boolean;) #IMPLIED
+>
+
+<!-- Detect a match of a regular expression
+ commonAttributes: Common attributes
+ String: The regular expression pattern
+ insensitive: Whether the text is matched case INsensitive. [boolean, optional, default=false]
+ minimal: Wheather to use minimal matching for wild cards in the pattern [boolean, optional, default='false']
+ dynamic: Uses %0 ... %9 as placeholders for dynamic arguments [boolean, optional, default=false]
+-->
+<!ELEMENT RegExpr EMPTY>
+<!ATTLIST RegExpr
+ %commonAttributes;
+ String CDATA #REQUIRED
+ insensitive (%boolean;) #IMPLIED
+ minimal (%boolean;) #IMPLIED
+ dynamic (%boolean;) #IMPLIED
+>
+
+<!-- Detect a line continuation
+ commonAttributes: Common attributes
+-->
+<!ELEMENT LineContinue EMPTY>
+<!ATTLIST LineContinue
+ %commonAttributes;
+>
+
+<!-- Detect a C-style escaped character
+ commonAttributes: Common attributes
+
+TODO:
+ - Did I get this right? Only one character, or a string?
+-->
+<!ELEMENT HlCStringChar EMPTY>
+<!ATTLIST HlCStringChar
+ %commonAttributes;
+>
+
+<!-- Detect a range of characters
+ commonAttributes: Common attributes
+ char: The character starting the range
+ char1: The character terminating the range
+-->
+<!ELEMENT RangeDetect EMPTY>
+<!ATTLIST RangeDetect
+ %commonAttributes;
+ char CDATA #REQUIRED
+ char1 CDATA #REQUIRED
+>
+
+<!-- Include Rules of another context
+ context: The name of the context to include
+ includeAttrib: If this is true, the host context of the IncludeRules
+ will be given the attribute of the source context
+-->
+<!ELEMENT IncludeRules EMPTY>
+<!ATTLIST IncludeRules
+ context CDATA #REQUIRED
+ includeAttrib (%boolean;) #IMPLIED
+>
+
+<!-- Detect all following Spaces
+-->
+<!ELEMENT DetectSpaces EMPTY>
+<!ATTLIST DetectSpaces
+ %commonAttributes;
+>
+
+<!-- Detect an Identifier ( == LETTER(LETTER|NUMBER|_)*)
+ -->
+<!ELEMENT DetectIdentifier EMPTY>
+<!ATTLIST DetectIdentifier
+ %commonAttributes;
+>
+
+<!-- List of attributes -->
+<!ELEMENT itemDatas (itemData)+>
+<!ATTLIST itemDatas
+>
+
+<!-- Attribute specification
+ name CDATA #REQUIRED The name of this attribute
+ defStyleNum CDATA #REQUIRED The index of the default style to use
+ color CDATA #IMPLIED Color for this style, either a hex triplet, a name or some other format recognized by Qt [optional]
+ selColor CDATA #IMPLIED The color for this style when text is selected [optional]
+ italic CDATA #IMPLIED Whether this attribute should be rendered using an italic typeface [optional, boolean, default=false]
+ bold CDATA #IMPLIED Whether this attribute should be renederd using a bold typeface [optional, boolean, default=false]
+ underline CDATA #IMPLIED Whether this attribute should be underlined [optional, boolean, default=false]
+ strikeout CDATA #IMPLIED Whether this attribute should be striked out [optional, boolean, default=false]
+ backgroundColor CDATA #IMPLIED The background color for this style [optional]
+ selBackgroundColor CDATA #IMPLIED The background color for this style when text is selected [optional]
+-->
+<!ELEMENT itemData EMPTY>
+<!ATTLIST itemData
+ name CDATA #REQUIRED
+ defStyleNum (%defStyles;) #REQUIRED
+ color CDATA #IMPLIED
+ selColor CDATA #IMPLIED
+ italic (%boolean;) #IMPLIED
+ bold (%boolean;) #IMPLIED
+ underline (%boolean;) #IMPLIED
+ strikeout (%boolean;) #IMPLIED
+ backgroundColor CDATA #IMPLIED
+ selBackgroundColor CDATA #IMPLIED
+>
diff --git a/kate/data/latex.xml b/kate/data/latex.xml
new file mode 100644
index 000000000..fbbc9c784
--- /dev/null
+++ b/kate/data/latex.xml
@@ -0,0 +1,332 @@
+<?xml version="1.01" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+<language name="LaTeX" version="1.25" section="Markup" kateversion="2.3" extensions="*.tex; *.ltx; *.dtx; *.sty; *.cls;" mimetype="text/x-tex" casesensitive="1" author="Jeroen Wijnhout (Jeroen.Wijnhout@kdemail.net)+Holger Danielsson (holger.danielsson@versanet.de)+Michel Ludwig (michel.ludwig@kdemail.net)" license="LGPL" >
+ <highlighting>
+ <contexts>
+ <!-- Normal text -->
+ <context name="Normal Text" attribute="Normal Text" lineEndContext="#stay">
+ <RegExpr String="\\begin(?=[^a-zA-Z])" attribute="Structure" context="FindEnvironment" beginRegion="block" />
+ <RegExpr String="\\end(?=[^a-zA-Z])" attribute="Structure" context="FindEnvironment" endRegion="block" />
+ <RegExpr String="\\(label|pageref|ref|vpageref|vref|cite)(?=[^a-zA-Z])" attribute="Structure" context="Label"/>
+ <RegExpr String="\\(part|chapter|section|subsection|subsubsection|paragraph|subparagraph)\*?\s*(?=[\{\[])" attribute="Structure" context="Sectioning"/>
+ <RegExpr String="\\(re)?newcommand(?=[^a-zA-Z])" attribute="Keyword" context="NewCommand"/>
+ <RegExpr String="\\(e|g|x)?def(?=[^a-zA-Z])" attribute="Keyword" context="DefCommand"/>
+ <StringDetect String="\(" attribute="Math" context="MathMode" beginRegion="mathMode" />
+ <StringDetect String="\[" attribute="Math" context="MathModeEquation" beginRegion="mathMode" />
+ <DetectChar char="\" attribute="Keyword" context="ContrSeq"/>
+ <StringDetect String="$$" attribute="Math" context="MathModeDisplay" beginRegion="mathMode" />
+ <DetectChar char="$" attribute="Math" context="MathMode" beginRegion="mathMode" />
+ <DetectChar char="%" attribute="Comment" context="Comment"/>
+ <RegExpr String="%\s*BEGIN.*$" attribute="Region Marker" context="#stay" beginRegion="regionMarker" firstNonSpace="true" />
+ <RegExpr String="%\s*END.*$" attribute="Region Marker" context="#stay" endRegion="regionMarker" firstNonSpace="true" />
+ <DetectChar char="&#xd7;" attribute="Bullet" context="#stay"/>
+ </context>
+
+ <!-- LaTeX sectioning commands -->
+ <context name="Sectioning" attribute="Normal Text" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop">
+ <RegExpr String="\[[^\]]*\]" attribute="Normal Text" context="#stay"/>
+ <DetectChar char=" " attribute="Normal Text" context="#stay"/>
+ <DetectChar char="{" attribute="Normal Text" context="SectioningInside"/>
+ <DetectChar char="}" attribute="Normal Text" context="#pop"/>
+ <DetectChar char="%" attribute="Comment" context="Comment"/>
+ </context>
+ <context name="SectioningInside" attribute="Structure Text" lineEndContext="#stay">
+ <DetectChar char="{" attribute="Normal Text" context="SectioningInside"/>
+ <DetectChar char="}" attribute="Normal Text" context="#pop"/>
+ <StringDetect String="\(" attribute="Structure Math" context="SectioningMathMode" beginRegion="mathMode" />
+ <DetectChar char="\" attribute="Structure Keyword" context="SectioningContrSeq"/>
+ <DetectChar char="$" attribute="Structure Math" context="SectioningMathMode" beginRegion="mathMode" />
+ <DetectChar char="%" attribute="Comment" context="Comment"/>
+ <DetectChar char="&#xd7;" attribute="Bullet" context="#stay"/>
+ </context>
+ <context name="SectioningContrSeq" attribute="Keyword" lineEndContext="#pop">
+ <DetectChar char="&#xd7;" attribute="Bullet" context="#stay"/>
+ <RegExpr String="[a-zA-Z]+(\+?|\*{0,3})" attribute="Structure Keyword" context="#pop"/>
+ <RegExpr String="[^a-zA-Z]" attribute="Structure Keyword" context="#pop" />
+ </context>
+ <context name="SectioningMathMode" attribute="Structure Math" lineEndContext="#stay">
+ <StringDetect String="$$" attribute="Error" context="#stay" />
+ <DetectChar char="$" attribute="Structure Math" context="#pop" endRegion="mathMode" />
+ <Detect2Chars char="\" char1=")" attribute="Structure Math" context="#pop" endRegion="mathMode" />
+ <Detect2Chars char="\" char1="]" attribute="Error" context="#stay" />
+ <DetectChar char="\" attribute="Structure Keyword Mathmode" context="SectioningMathContrSeq"/>
+ <DetectChar char="%" attribute="Comment" context="Comment"/>
+ <DetectChar char="&#xd7;" attribute="Bullet" context="#stay"/>
+ </context>
+ <context name="SectioningMathContrSeq" attribute="Structure Keyword Mathmode" lineEndContext="#pop">
+ <DetectChar char="&#xd7;" attribute="Bullet" context="#stay"/>
+ <RegExpr String="[a-zA-Z]+\*?" attribute="Structure Keyword Mathmode" context="#pop"/>
+ <RegExpr String="[^a-zA-Z]" attribute="Structure Keyword Mathmode" context="#pop" />
+ </context>
+
+ <!-- LaTeX commands \newcommand and \renewcommand -->
+ <context name="NewCommand" attribute="Normal Text" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop">
+ <RegExpr String="\s*\{\s*\\[a-zA-Z]+\s*\}(\[\d\](\[[^\]]+\])?)?\{" attribute="Normal Text" context="CommandParameterStart"/>
+ <DetectChar char="}" attribute="Error" context="#pop"/>
+ </context>
+
+ <!-- LaTeX command \def -->
+ <context name="DefCommand" attribute="Normal Text" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop">
+ <RegExpr String="\s*\\[a-zA-Z]+[^\{]*\{" attribute="Normal Text" context="CommandParameterStart"/>
+ <DetectChar char="}" attribute="Error" context="#pop"/>
+ </context>
+
+ <!-- parse command argument -->
+ <context name="CommandParameterStart" attribute="Normal Text" lineEndContext="#stay">
+ <DetectChar char="{" attribute="Normal Text" context="CommandParameter"/>
+ <DetectChar char="}" attribute="Normal Text" context="#pop#pop"/>
+ <RegExpr String="\\." attribute="Normal Text" context="#stay" />
+ <DetectChar char="%" attribute="Comment" context="Comment"/>
+ </context>
+ <context name="CommandParameter" attribute="Normal Text" lineEndContext="#stay">
+ <DetectChar char="{" attribute="Normal Text" context="CommandParameter"/>
+ <DetectChar char="}" attribute="Normal Text" context="#pop"/>
+ <RegExpr String="\\." attribute="Normal Text" context="#stay" />
+ <DetectChar char="%" attribute="Comment" context="Comment"/>
+ </context>
+
+ <!-- LaTeX command in text mode -->
+ <context name="ContrSeq" attribute="Keyword" lineEndContext="#pop">
+ <StringDetect String="verb*" attribute="Keyword" context="Verb"/>
+ <RegExpr String="verb(?=[^a-zA-Z])" attribute="Keyword" context="Verb"/>
+ <DetectChar char="&#xd7;" attribute="Bullet" context="#stay"/>
+ <RegExpr String="[a-zA-Z]+(\+?|\*{0,3})" attribute="Keyword" context="#pop"/>
+ <RegExpr String="[^a-zA-Z]" attribute="Keyword" context="#pop" />
+ </context>
+ <context name="ToEndOfLine" attribute="Normal Text" lineEndContext="#pop">
+ </context>
+
+ <!-- verb command -->
+ <context name="Verb" attribute="Verbatim" lineEndContext="#pop#pop" >
+ <RegExpr String="(.)" attribute="Normal Text" dynamic="true" context="VerbEnd" />
+ </context>
+ <context name="VerbEnd" attribute="Verbatim" lineEndContext="#pop#pop#pop" dynamic="true" >
+ <StringDetect String="%1" attribute="Normal Text" context="#pop#pop#pop" dynamic="true" />
+ <DetectChar char="&#xd7;" attribute="Bullet" context="#stay"/>
+ <RegExpr String="[^%1\xd7]*" attribute="Verbatim" context="#stay" dynamic="true" />
+ </context>
+
+ <!-- label -->
+ <context name="Label" attribute="Normal Text" lineEndContext="#stay">
+ <RegExpr String="\s*\{\s*" attribute="Normal Text" context="LabelParameter"/>
+ <RegExpr String="\s*\[\s*" attribute="Normal Text" context="LabelOption"/>
+ <RegExpr String="[^\[\{]+" attribute="Error" context="#stay"/>
+ </context>
+
+ <context name="LabelOption" attribute="Normal Text" lineEndContext="#stay">
+ <StringDetect String="\(" attribute="Math" context="MathMode" beginRegion="mathMode" />
+ <DetectChar char="\" attribute="Keyword" context="ContrSeq"/>
+ <DetectChar char="$" attribute="Math" context="MathMode" beginRegion="mathMode" />
+ <DetectChar char="%" attribute="Comment" context="Comment"/>
+ <DetectChar char="&#xd7;" attribute="Bullet" context="#stay"/>
+ <RegExpr String="\s*\]\s*" attribute="Normal Text" context="#pop"/>
+ </context>
+
+ <context name="LabelParameter" attribute="Environment" lineEndContext="#stay">
+ <DetectChar char="&#xd7;" attribute="Bullet" context="#stay"/>
+ <RegExpr String="\s*\}\s*" attribute="Normal Text" context="#pop#pop"/>
+ </context>
+
+ <!-- start of an environment -->
+ <context name="FindEnvironment" attribute="Normal Text" lineEndContext="#stay">
+ <DetectChar char="{" attribute="Normal Text" context="Environment"/>
+ <RegExpr String="\S" attribute="Normal Text" context="#pop"/>
+ </context>
+
+ <!-- filter the environment name and check the type -->
+ <context name="Environment" attribute="Environment" lineEndContext="#stay">
+ <RegExpr String="(lstlisting|(B|L)?Verbatim)" attribute="Environment" context="VerbatimEnvParam"/>
+ <RegExpr String="(verbatim|boxedverbatim)" attribute="Environment" context="VerbatimEnv"/>
+ <RegExpr String="(equation|displaymath|eqnarray|subeqnarray|math|multline|gather|align|flalign)" attribute="Environment" context="MathEnv"/>
+ <RegExpr String="(alignat|xalignat|xxalignat)" attribute="Environment" context="MathEnvParam"/>
+ <DetectChar char="&#xd7;" attribute="Bullet" context="#stay"/>
+ <RegExpr String="[a-zA-Z]" attribute="Environment" context="LatexEnv"/>
+ <RegExpr String="\s+" attribute="Error" context="#pop"/>
+ <RegExpr String="[^a-zA-Z\xd7]" attribute="Error" context="#pop"/>
+ </context>
+
+ <!-- environment type 1: normal -->
+ <context name="LatexEnv" attribute="Environment" lineEndContext="#stay">
+ <DetectChar char="}" attribute="Normal Text" context="#pop#pop#pop"/>
+ <RegExpr String="[a-zA-Z]+" attribute="Environment" context="#stay"/>
+ <RegExpr String="\s+" attribute="Error" context="#stay"/>
+ <IncludeRules context="EnvCommon" />
+ </context>
+
+ <!-- environment type 2: verbatim without parameter -->
+ <context name="VerbatimEnv" attribute="Environment" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop#pop#pop">
+ <DetectChar char="}" attribute="Normal Text" context="Verbatim"/>
+ <RegExpr String="[a-zA-Z]" attribute="Environment" lookAhead="true" context="#pop"/>
+ <IncludeRules context="EnvCommon" />
+ </context>
+
+ <!-- environment type 3: verbatim with optional parameter -->
+ <context name="VerbatimEnvParam" attribute="Normal Text" lineEndContext="#stay">
+ <Detect2Chars char="}" char1="[" attribute="Normal Text" context="#stay" />
+ <DetectChar char="}" attribute="Normal Text" context="Verbatim"/>
+ <DetectChar char="]" attribute="Normal Text" context="Verbatim"/>
+ </context>
+
+ <!-- parse verbatim text -->
+ <context name="Verbatim" attribute="Verbatim" lineEndContext="#stay">
+ <DetectChar char="&#xd7;" attribute="Bullet" context="#stay"/>
+ <RegExpr String="\\end(?=\s*\{(verbatim|lstlisting|boxedverbatim|(B|L)?Verbatim)\*?\})" attribute="Structure" context="VerbFindEnd"/>
+ </context>
+
+ <!-- end of verbatim environment -->
+ <context name="VerbFindEnd" attribute="Normal Text" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop">
+ <RegExpr String="\s*\{" attribute="Normal Text" context="#stay"/>
+ <RegExpr String="(verbatim|lstlisting|boxedverbatim|(B|L)?Verbatim)\*?" attribute="Environment" context="#stay"/>
+ <DetectChar char="}" attribute="Normal Text" context="#pop#pop#pop#pop#pop" endRegion="block"/>
+ </context>
+
+ <!-- environment type 4: math environment with its own mathmode -->
+ <context name="MathEnv" attribute="Environment" lineEndContext="#stay">
+ <DetectChar char="}" attribute="Normal Text" context="MathModeEnv"/>
+ <RegExpr String="[a-zA-Z]" attribute="Environment" lookAhead="true" context="#pop"/>
+ <IncludeRules context="EnvCommon" />
+ </context>
+
+ <!-- environment type 5: math environment with its own mathmode and parameter -->
+ <context name="MathEnvParam" attribute="Normal Text" lineEndContext="#stay">
+ <RegExpr String="\}\{[^\}]*\}" attribute="Normal Text" context="MathModeEnv"/>
+ <DetectChar char="}" attribute="Normal Text" context="MathModeEnv"/>
+ <RegExpr String="[a-zA-Z]" attribute="Environment" lookAhead="true" context="#pop"/>
+ <IncludeRules context="EnvCommon" />
+ </context>
+
+ <!-- environment common -->
+ <context name="EnvCommon" attribute="Environment" lineEndContext="#stay">
+ <DetectChar char="&#xd7;" attribute="Bullet" context="#stay"/>
+ <RegExpr String="\*(?=\})" attribute="Environment" context="#stay"/>
+ <RegExpr String="\*[^\}]*" attribute="Error" context="#pop#pop#pop"/>
+ <RegExpr String="[^a-zA-Z\xd7][^\}]*" attribute="Error" context="#pop#pop#pop"/>
+ </context>
+
+ <!-- parse math environment -->
+ <context name="MathModeEnv" attribute="Math" lineEndContext="#stay">
+ <RegExpr String="\\end(?=\s*\{(equation|displaymath|eqnarray|subeqnarray|math|multline|gather|align|flalign|alignat|xalignat|xxalignat)\*?\})" attribute="Structure" context="MathFindEnd"/>
+ <RegExpr String="\\begin(?=[^a-zA-Z])" attribute="Keyword Mathmode" context="#stay" beginRegion="block" />
+ <RegExpr String="\\end(?=[^a-zA-Z])" attribute="Keyword Mathmode" context="#stay" endRegion="block" />
+ <StringDetect String="\(" attribute="Error" context="#stay" />
+ <StringDetect String="\[" attribute="Error" context="#stay" />
+ <StringDetect String="\)" attribute="Error" context="#stay" />
+ <StringDetect String="\]" attribute="Error" context="#stay" />
+ <RegExpr String="\\(text|intertext|mbox)\s*(?=\{)" attribute="Keyword Mathmode" context="MathModeText" />
+ <DetectChar char="\" attribute="Keyword Mathmode" context="MathContrSeq"/>
+ <StringDetect String="$$" attribute="Error" context="#stay" />
+ <DetectChar char="$" attribute="Error" context="#stay" />
+ <DetectChar char="%" attribute="Comment" context="Comment"/>
+ <RegExpr String="%\s*BEGIN.*$" attribute="Region Marker" context="#stay" beginRegion="regionMarker" firstNonSpace="true"/>
+ <RegExpr String="%\s*END.*$" attribute="Region Marker" context="#stay" endRegion="regionMarker" firstNonSpace="true"/>
+ </context>
+
+ <!-- end of math environment -->
+ <context name="MathFindEnd" attribute="Normal Text" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop">
+ <RegExpr String="\s*\{" attribute="Normal Text" context="#stay"/>
+ <RegExpr String="(equation|displaymath|eqnarray|subeqnarray|math|multline|gather|align|flalign|alignat|xalignat|xxalignat)\*?" attribute="Environment" context="#stay"/>
+ <DetectChar char="}" attribute="Normal Text" context="#pop#pop#pop#pop#pop" endRegion="block"/>
+ </context>
+
+ <!-- math mode: starting with $ or \( -->
+ <context name="MathMode" attribute="Math" lineEndContext="#stay">
+ <StringDetect String="$$" attribute="Error" context="#stay" />
+ <DetectChar char="$" attribute="Math" context="#pop" endRegion="mathMode" />
+ <Detect2Chars char="\" char1=")" attribute="Math" context="#pop" endRegion="mathMode" />
+ <Detect2Chars char="\" char1="]" attribute="Error" context="#stay" />
+ <IncludeRules context="MathModeCommon" />
+ </context>
+
+ <!-- math mode: starting with $$ -->
+ <context name="MathModeDisplay" attribute="Math" lineEndContext="#stay">
+ <StringDetect String="$$" attribute="Math" context="#pop" endRegion="mathMode" />
+ <DetectChar char="$" attribute="Error" context="#stay" />
+ <Detect2Chars char="\" char1="]" attribute="Error" context="#stay" />
+ <Detect2Chars char="\" char1=")" attribute="Error" context="#stay" />
+ <IncludeRules context="MathModeCommon" />
+ </context>
+
+ <!-- math mode: starting with \[ -->
+ <context name="MathModeEquation" attribute="Math" lineEndContext="#stay">
+ <Detect2Chars char="\" char1="]" attribute="Math" context="#pop" endRegion="mathMode" />
+ <StringDetect String="$$" attribute="Error" context="#stay" />
+ <DetectChar char="$" attribute="Error" context="#stay" />
+ <Detect2Chars char="\" char1=")" attribute="Error" context="#stay" />
+ <IncludeRules context="MathModeCommon" />
+ </context>
+
+ <!-- math mode common -->
+ <context name="MathModeCommon" attribute="Math" lineEndContext="#stay">
+ <RegExpr String="\\(begin|end)\s*\{(equation|displaymath|eqnarray|subeqnarray|math|multline|gather|align|flalign|alignat|xalignat|xxalignat)\*?\}" attribute="Error" context="#stay"/>
+ <RegExpr String="\\begin(?=[^a-zA-Z])" attribute="Keyword Mathmode" context="#stay" beginRegion="block" />
+ <RegExpr String="\\end(?=[^a-zA-Z])" attribute="Keyword Mathmode" context="#stay" endRegion="block" />
+ <RegExpr String="\\(text|intertext|mbox)\s*(?=\{)" attribute="Keyword Mathmode" context="MathModeText" />
+ <DetectChar char="\" attribute="Keyword Mathmode" context="MathContrSeq"/>
+ <DetectChar char="%" attribute="Comment" context="Comment"/>
+ <RegExpr String="%\s*BEGIN.*$" attribute="Region Marker" context="#stay" beginRegion="regionMarker" firstNonSpace="true"/>
+ <RegExpr String="%\s*END.*$" attribute="Region Marker" context="#stay" endRegion="regionMarker" firstNonSpace="true"/>
+ <DetectChar char="&#xd7;" attribute="Bullet" context="#stay"/>
+ </context>
+
+ <!-- command in mathmode -->
+ <context name="MathContrSeq" attribute="Keyword Mathmode" lineEndContext="#pop">
+ <DetectChar char="&#xd7;" attribute="Bullet" context="#stay"/>
+ <RegExpr String="[a-zA-Z]+\*?" attribute="Keyword Mathmode" context="#pop"/>
+ <RegExpr String="[^a-zA-Z]" attribute="Keyword Mathmode" context="#pop" />
+ </context>
+
+ <!-- text in mathmode -->
+ <context name="MathModeText" attribute="Normal Text" lineEndContext="#stay" >
+ <DetectChar char="{" attribute="Normal Text" context="MathModeTextParameterStart"/>
+ </context>
+
+ <context name="MathModeTextParameterStart" attribute="Normal Text" lineEndContext="#stay" >
+ <RegExpr String="\\." attribute="Normal Text" context="#stay"/>
+ <DetectChar char="&#xd7;" attribute="Bullet" context="#stay"/>
+ <DetectChar char="{" attribute="Normal Text" context="MathModeTextParameter"/>
+ <DetectChar char="}" attribute="Normal Text" context="#pop#pop"/>
+ <DetectChar char="%" attribute="Comment" context="Comment"/>
+ </context>
+
+ <context name="MathModeTextParameter" attribute="Normal Text" lineEndContext="#stay" >
+ <RegExpr String="\\." attribute="Normal Text" context="#stay"/>
+ <DetectChar char="{" attribute="Normal Text" context="MathModeTextParameter"/>
+ <DetectChar char="}" attribute="Normal Text" context="#pop"/>
+ <DetectChar char="&#xd7;" attribute="Bullet" context="#stay"/>
+ <DetectChar char="%" attribute="Comment" context="Comment"/>
+ </context>
+
+ <!-- comment -->
+ <context name="Comment" attribute="Comment" lineEndContext="#pop">
+ <RegExpr String="(FIXME|TODO):?" attribute="Alert" context="#stay"/>
+ <DetectChar char="&#xd7;" attribute="Bullet" context="#stay"/>
+ </context>
+ </contexts>
+
+ <itemDatas>
+ <itemData name="Normal Text" defStyleNum="dsNormal"/>
+ <itemData name="Keyword" defStyleNum="dsNormal" color="#800000" selColor="#60FFFF" bold="0" italic="0"/>
+ <itemData name="Comment" defStyleNum="dsComment"/>
+ <itemData name="Error" defStyleNum="dsAlert"/>
+ <itemData name="Math" defStyleNum="dsNormal" color="#00A000" selColor="#FF40FF" bold="0" italic="0"/>
+ <itemData name="Structure" defStyleNum="dsNormal" color="#F00000" selColor="#80FFD0" bold="0" italic="0"/>
+ <itemData name="Keyword Mathmode" defStyleNum="dsNormal" color="#606000" selColor="#FFD0FF" bold="0" italic="0"/>
+ <itemData name="Environment" defStyleNum="dsNormal" color="#0000D0" selColor="#FFFF90" bold="0" italic="0"/>
+ <itemData name="Verbatim" defStyleNum="dsNormal" color="#a08000" selColor="#80D0FF" bold="0" italic="0"/>
+ <itemData name="Region Marker" defStyleNum="dsRegionMarker" />
+ <itemData name="Bullet" defStyleNum="dsNormal" color="#FF00C4" bold="1" underline="1"/>
+ <itemData name="Alert" defStyleNum="dsAlert" />
+ <itemData name="Structure Text" defStyleNum="dsNormal" color="#000000" selColor="#FFFFFF" bold="1" italic="0"/>
+ <itemData name="Structure Keyword" defStyleNum="dsNormal" color="#800000" selColor="#60FFFF" bold="1" italic="0"/>
+ <itemData name="Structure Math" defStyleNum="dsNormal" color="#00A000" selColor="#FF40FF" bold="1" italic="0"/>
+ <itemData name="Structure Keyword Mathmode" defStyleNum="dsNormal" color="#606000" selColor="#FFD0FF" bold="1" italic="0"/>
+ </itemDatas>
+ </highlighting>
+
+ <general>
+ <keywords weakDeliminator="\" wordWrapDeliminator=",{}[]"/>
+ <comments>
+ <comment name="singleLine" start="%" />
+ </comments>
+ </general>
+</language>
diff --git a/kate/data/ldif.xml b/kate/data/ldif.xml
new file mode 100644
index 000000000..d0da293a1
--- /dev/null
+++ b/kate/data/ldif.xml
@@ -0,0 +1,305 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+<language name="LDIF" version="1.02" kateversion="2.4" section="Database" extensions="*.ldif" mimetype="application/directory" author="Andreas Hochsteger (e9625392@student.tuwien.ac.at)" license="">
+ <highlighting>
+ <list name="attributetypes">
+ <item>IPPhone</item>
+ <item>URL</item>
+ <item>aRecord</item>
+ <item>aliasedEntryName</item>
+ <item>aliasedObjectName</item>
+ <item>associatedDomain</item>
+ <item>associatedName</item>
+ <item>audio</item>
+ <item>authorityRevocationList</item>
+ <item>bootFile</item>
+ <item>bootParameter</item>
+ <item>buildingName</item>
+ <item>businessCategory</item>
+ <item>c</item>
+ <item>cACertificate</item>
+ <item>cNAMERecord</item>
+ <item>certificateRevocationList</item>
+ <item>cn</item>
+ <item>comment</item>
+ <item>commonName</item>
+ <item>conferenceInformation</item>
+ <item>corbaContainer</item>
+ <item>corbaRepositoryId</item>
+ <item>countryName</item>
+ <item>crossCertificatePair</item>
+ <item>custom1</item>
+ <item>custom2</item>
+ <item>custom3</item>
+ <item>custom4</item>
+ <item>dITRedirect</item>
+ <item>dSAQuality</item>
+ <item>dc</item>
+ <item>deltaRevocationList</item>
+ <item>description</item>
+ <item>destinationIndicator</item>
+ <item>distinguishedName</item>
+ <item>dmdName</item>
+ <item>dnQualifier</item>
+ <item>documentAuthor</item>
+ <item>documentIdentifier</item>
+ <item>documentLocation</item>
+ <item>documentPublisher</item>
+ <item>documentTitle</item>
+ <item>documentVersion</item>
+ <item>domainComponent</item>
+ <item>enhancedSearchGuide</item>
+ <item>facsimileTelephoneNumber</item>
+ <item>fax</item>
+ <item>gecos</item>
+ <item>generationQualifier</item>
+ <item>gidNumber</item>
+ <item>givenName</item>
+ <item>gn</item>
+ <item>homeDirectory</item>
+ <item>homePostalAddress</item>
+ <item>homeUrl</item>
+ <item>host</item>
+ <item>houseIdentifier</item>
+ <item>info</item>
+ <item>initials</item>
+ <item>internationaliSDNNumber</item>
+ <item>ipHostNumber</item>
+ <item>ipNetmaskNumber</item>
+ <item>ipNetworkNumber</item>
+ <item>ipProtocolNumber</item>
+ <item>ipServicePort</item>
+ <item>ipServiceProtocol</item>
+ <item>janetMailbox</item>
+ <item>javaClassNames</item>
+ <item>javaCodebase</item>
+ <item>javaContainer</item>
+ <item>javaDoc</item>
+ <item>javaFactory</item>
+ <item>javaReferenceAddress</item>
+ <item>javaSerializedData</item>
+ <item>knowledgeInformation</item>
+ <item>l</item>
+ <item>labeledURI</item>
+ <item>lastModifiedBy</item>
+ <item>lastModifiedTime</item>
+ <item>lmpassword</item>
+ <item>localityName</item>
+ <item>loginShell</item>
+ <item>mDRecord</item>
+ <item>mXRecord</item>
+ <item>macAddress</item>
+ <item>mail</item>
+ <item>manager</item>
+ <item>member</item>
+ <item>memberNisNetgroup</item>
+ <item>memberUid</item>
+ <item>mozillaHomeCountryName</item>
+ <item>mozillaHomeFriendlyCountryName</item>
+ <item>mozillaHomeLocalityName</item>
+ <item>mozillaHomePostalAddress2</item>
+ <item>mozillaHomePostalCode</item>
+ <item>mozillaHomeState</item>
+ <item>mozillaPostalAddress2</item>
+ <item>mozillaSecondemail</item>
+ <item>nSRecord</item>
+ <item>name</item>
+ <item>nisMapEntry</item>
+ <item>nisMapName</item>
+ <item>nisNetgroupTriple</item>
+ <item>ntpasswd</item>
+ <item>o</item>
+ <item>objectClass</item>
+ <item>oncRpcNumber</item>
+ <item>organizationName</item>
+ <item>organizationalStatus</item>
+ <item>organizationalUnitName</item>
+ <item>otherFacsimiletelephoneNumber</item>
+ <item>otherMailbox</item>
+ <item>ou</item>
+ <item>owner</item>
+ <item>personalSignature</item>
+ <item>personalTitle</item>
+ <item>photo</item>
+ <item>physicalDeliveryOfficeName</item>
+ <item>postOfficeBox</item>
+ <item>postalAddress</item>
+ <item>postalCode</item>
+ <item>preferredDeliveryMethod</item>
+ <item>presentationAddress</item>
+ <item>protocolInformation</item>
+ <item>rdn</item>
+ <item>registeredAddress</item>
+ <item>reports</item>
+ <item>rfc822Mailbox</item>
+ <item>roleOccupant</item>
+ <item>roomNumber</item>
+ <item>sOARecord</item>
+ <item>searchGuide</item>
+ <item>secretary</item>
+ <item>seeAlso</item>
+ <item>serialNumber</item>
+ <item>shadowExpire</item>
+ <item>shadowFlag</item>
+ <item>shadowInactive</item>
+ <item>shadowLastChange</item>
+ <item>shadowMax</item>
+ <item>shadowMin</item>
+ <item>shadowWarning</item>
+ <item>singleLevelQuality</item>
+ <item>sn</item>
+ <item>st</item>
+ <item>stateOrProvinceName</item>
+ <item>street</item>
+ <item>streetAddress</item>
+ <item>subtreeMaximumQuality</item>
+ <item>subtreeMinimumQuality</item>
+ <item>supportedAlgorithms</item>
+ <item>supportedApplicationContext</item>
+ <item>surname</item>
+ <item>telephoneNumber</item>
+ <item>teletexTerminalIdentifier</item>
+ <item>telexNumber</item>
+ <item>textEncodedORAddress</item>
+ <item>title</item>
+ <item>uid</item>
+ <item>uidNumber</item>
+ <item>uniqueIdentifier</item>
+ <item>uniqueMember</item>
+ <item>userCertificate</item>
+ <item>userClass</item>
+ <item>userPassword</item>
+ <item>userid</item>
+ <item>workUrl</item>
+ <item>x121Address</item>
+ <item>x500UniqueIdentifier</item>
+ <item>xmozillaNickname</item>
+ <item>xmozillaUseHtmlMail</item>
+ <item>xmozillanickname</item>
+ <item>xmozillausehtmlmail</item>
+ </list>
+ <list name="objectclasses">
+ <item>RFC822localPart</item>
+ <item>SUP</item>
+ <item>account</item>
+ <item>alias</item>
+ <item>applicationEntity</item>
+ <item>applicationProcess</item>
+ <item>bootableDevice</item>
+ <item>cRLDistributionPoint</item>
+ <item>certificationAuthority</item>
+ <item>certificationAuthority-V2</item>
+ <item>corbaObject</item>
+ <item>corbaObjectReference</item>
+ <item>country</item>
+ <item>dNSDomain</item>
+ <item>dSA</item>
+ <item>dcObject</item>
+ <item>deltaCRL</item>
+ <item>device</item>
+ <item>dmd</item>
+ <item>document</item>
+ <item>documentSeries</item>
+ <item>domain</item>
+ <item>domainRelatedObject</item>
+ <item>friendlyCountry</item>
+ <item>groupOfNames</item>
+ <item>groupOfUniqueNames</item>
+ <item>ieee802Device</item>
+ <item>inetOrgPerson</item>
+ <item>ipHost</item>
+ <item>ipNetwork</item>
+ <item>ipProtocol</item>
+ <item>ipService</item>
+ <item>javaClassName</item>
+ <item>javaMarshalledObject</item>
+ <item>javaNamingReference</item>
+ <item>javaObject</item>
+ <item>javaSerializedObject</item>
+ <item>labeledURIObject</item>
+ <item>locality</item>
+ <item>mozillaAbPersonObsolete</item>
+ <item>nisMap</item>
+ <item>nisNetgroup</item>
+ <item>nisObject</item>
+ <item>officePerson</item>
+ <item>oncRpc</item>
+ <item>organization</item>
+ <item>organizationalPerson</item>
+ <item>organizationalRole</item>
+ <item>organizationalUnit</item>
+ <item>pager</item>
+ <item>pagerTelephoneNumber</item>
+ <item>person</item>
+ <item>pilotDSA</item>
+ <item>pilotObject</item>
+ <item>pilotOrganization</item>
+ <item>pkiCA</item>
+ <item>pkiUser</item>
+ <item>posixAccount</item>
+ <item>posixGroup</item>
+ <item>qualityLabelledData</item>
+ <item>residentialPerson</item>
+ <item>rid</item>
+ <item>room</item>
+ <item>sambaAccount</item>
+ <item>shadowAccount</item>
+ <item>simpleSecurityObject</item>
+ <item>strongAuthenticationUser</item>
+ <item>telephoneNumber</item>
+ <item>top</item>
+ <item>uid</item>
+ <item>uidNumber</item>
+ <item>uidObject</item>
+ <item>userSecurityInformation</item>
+ <item>userid</item>
+ <item>xmozillaanyphone</item>
+ <item>zillaPerson</item>
+ </list>
+ <contexts>
+ <context name="ctxStart" attribute="Value (Standard)" lineEndContext="#stay">
+ <RegExpr String="#.*$" attribute="Comment" context="#stay"/>
+ <DetectChar char=":" attribute="Description Keyword" context="ctxEncoded"/>
+ <DetectChar char="&lt;" attribute="Description Keyword" context="ctxURL"/>
+ <RegExpr String="[^:&lt;]" attribute="Value (Standard)" context="ctxStandard"/>
+ <RegExpr String="[\w\-]+((;[\w\-]+)+)?:" attribute="Description Keyword" context="#stay" column="0"/>
+ </context>
+ <context name="ctxEncoded" attribute="Value (Encoded)" lineEndContext="#stay">
+ <RegExpr String="#.*$" attribute="Comment" context="#stay"/>
+ <RegExpr String="\s.*$" attribute="Value (Encoded)" context="#stay"/>
+ <RegExpr String="[\w\-]+((;[\w\-]+)+)?:" attribute="Description Keyword" context="#pop" column="0"/>
+ </context>
+ <context name="ctxURL" attribute="Value (URL)" lineEndContext="#stay">
+ <RegExpr String="#.*$" attribute="Comment" context="#stay"/>
+ <RegExpr String="\s+[\w]+://[\w/.]+" attribute="Value (URL)" context="#stay"/>
+ <RegExpr String="\s.*$" attribute="Value (URL)" context="#stay"/>
+ <RegExpr String="[\w\-]+((;[\w\-]+)+)?:" attribute="Description Keyword" context="#pop" column="0"/>
+ </context>
+ <context name="ctxStandard" attribute="Value (Standard)" lineEndContext="#stay">
+ <RegExpr String="#.*$" attribute="Comment" context="#stay"/>
+ <RegExpr String="\{\w+\}.*$" attribute="Value (Encrypted)" context="ctxEncrypted"/>
+ <keyword String="attributetypes" attribute="AttributeType" context="#stay"/>
+ <keyword String="objectclasses" attribute="ObjectClass" context="#stay"/>
+ <RegExpr String="[\w\-]+((;[\w\-]+)+)?:" attribute="Description Keyword" context="#pop" column="0"/>
+ <RegExpr String="[a-zA-Z0-9\-]+=" attribute="Value (Keyword)" context="#stay"/>
+ </context>
+ <context name="ctxEncrypted" attribute="Value (Encrypted)" lineEndContext="#stay">
+ <RegExpr String="#.*$" attribute="Comment" context="#stay"/>
+ <RegExpr String="\s.*$" attribute="Value (Encrypted)" context="#stay"/>
+ <RegExpr String="[\w\-]+((;[\w\-]+)+)?:" attribute="Description Keyword" context="#pop#pop" column="0"/>
+ </context>
+ </contexts>
+ <itemDatas>
+ <itemData name="Normal Text" defStyleNum="dsNormal" color="#000000" selColor="#FFFFFF" bold="0" italic="0"/>
+ <itemData name="Comment" defStyleNum="dsComment" color="#808080" selColor="#808080" bold="0" italic="0"/>
+ <itemData name="AttributeType" defStyleNum="dsKeyword" color="#404040" selColor="#FFFFFF" bold="1" italic="0"/>
+ <itemData name="ObjectClass" defStyleNum="dsKeyword" color="#800080" selColor="#FFFFFF" bold="1" italic="0"/>
+ <itemData name="Description Keyword" defStyleNum="dsKeyword" color="#000000" selColor="#FFFFFF" bold="1" italic="0"/>
+ <itemData name="Value (Standard)" defStyleNum="dsString" color="#008000" selColor="#008000" bold="0" italic="0"/>
+ <itemData name="Value (Encoded)" defStyleNum="dsString" color="#FF8000" selColor="#0080FF" bold="0" italic="0"/>
+ <itemData name="Value (Encrypted)" defStyleNum="dsString" color="#FF0000" selColor="#00FFFF" bold="0" italic="0"/>
+ <itemData name="Value (Keyword)" defStyleNum="dsString" color="#008000" selColor="#800080" bold="1" italic="0"/>
+ <itemData name="Value (URL)" defStyleNum="dsString" color="#0000FF" selColor="#FFFF00" bold="0" italic="0"/>
+ </itemDatas>
+ </highlighting>
+</language>
diff --git a/kate/data/lex.xml b/kate/data/lex.xml
new file mode 100644
index 000000000..f2daebbb4
--- /dev/null
+++ b/kate/data/lex.xml
@@ -0,0 +1,144 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+<!--
+ ========================================================================
+
+ LEX.XML supports syntax highlighting for Lex/Flex source under Kate.
+
+ Copyright (C) 2004 - Jan Villat <jan.villat@net2000.ch>
+ This code is released under the LGPL as part of kdelibs/kate.
+
+ ========================================================================
+
+ Updates for LEX.XML can be obtained from http://kate.kde.org/hl/
+
+ UPDATE HISTORY:-
+ 2004.05.25 - LEX.XML 1.00 - First released.
+
+ TODO:-
+ - Add a mime type (cannot find it !?)
+
+ ========================================================================
+-->
+<language name="Lex/Flex" version="1.01" kateversion="2.4" section="Sources" extensions="*.l;*.lex;*.flex" author="Jan Villat (jan.villat@net2000.ch)" license="LGPL">
+
+<highlighting>
+<contexts>
+ <context name="Pre Start" attribute="Normal Text" lineEndContext="#stay">
+ <RegExpr attribute="Normal Text" context="Definitions" String="." lookAhead="true" beginRegion="definitions" />
+ </context>
+ <context name="Definitions" attribute="Normal Text" lineEndContext="#stay">
+ <IncludeRules context="Detect C" />
+ <Detect2Chars attribute="Content-Type Delimiter" context="Rules" char="%" char1="%" beginRegion="rules" endRegion="definitions" />
+ <DetectChar attribute="Directive" context="Percent Command" char="%" />
+ <Detect2Chars attribute="Comment" context="Comment" char="/" char1="*" column="0"/>
+ <RegExpr attribute="Definition" context="Definition RegExpr" String="[A-Za-z_]\w*\s+" column="0"/>
+ </context>
+ <context name="Rules" attribute="Normal Text" lineEndContext="#stay" fallthrough="true" fallthroughContext="Rule RegExpr">
+ <IncludeRules context="Detect C" />
+ <Detect2Chars attribute="Content-Type Delimiter" context="User Code" char="%" char1="%" beginRegion="code" endRegion="rules" />
+ </context>
+ <context name="User Code" attribute="Normal Text" lineEndContext="#stay">
+ <IncludeRules context="##C++" />
+ </context>
+
+ <context name="Percent Command" attribute="Directive" lineEndContext="#pop">
+ </context>
+ <context name="Comment" attribute="Comment" lineEndContext="#stay">
+ <Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" />
+ </context>
+
+ <context name="Definition RegExpr" attribute="RegExpr" lineEndContext="#pop">
+ <IncludeRules context="RegExpr Base" />
+ <RegExpr attribute="RegExpr" context="#stay" String="\S" />
+ <RegExpr attribute="Alert" context="#stay" String=".*" />
+ </context>
+ <context name="Rule RegExpr" attribute="RegExpr" lineEndContext="#pop">
+ <RegExpr attribute="Content-Type Delimiter" context="Start Conditions Scope" String="\{$" beginRegion="SCscope" />
+ <IncludeRules context="RegExpr Base" />
+ <RegExpr attribute="RegExpr" context="#stay" String="\S" />
+ <RegExpr attribute="Normal Text" context="Action" String="\s+" />
+ </context>
+ <context name="RegExpr (" attribute="RegExpr" lineEndContext="#stay">
+ <IncludeRules context="RegExpr Base" />
+ <DetectChar attribute="RegExpr" context="#pop" char=")" />
+ <RegExpr attribute="RegExpr" context="#stay" String="." />
+ </context>
+ <context name="RegExpr [" attribute="RegExpr" lineEndContext="#stay">
+ <RegExpr attribute="Backslash Code" context="#stay" String="\\." />
+ <DetectChar attribute="RegExpr" context="#pop" char="]" />
+ <RegExpr attribute="RegExpr" context="#stay" String="." />
+ </context>
+ <context name="RegExpr {" attribute="RegExpr" lineEndContext="#stay">
+ <RegExpr attribute="Backslash Code" context="#stay" String="\\." />
+ <DetectChar attribute="RegExpr" context="#pop" char="}" />
+ <RegExpr attribute="RegExpr" context="#stay" String="." />
+ </context>
+ <context name="RegExpr Q" attribute="RegExpr" lineEndContext="#stay">
+ <RegExpr attribute="Backslash Code" context="#stay" String="\\." />
+ <DetectChar attribute="RegExpr" context="#pop" char="&quot;" />
+ <RegExpr attribute="RegExpr" context="#stay" String="." />
+ </context>
+ <context name="RegExpr Base" attribute="RegExpr" lineEndContext="#stay">
+ <RegExpr attribute="Backslash Code" context="#stay" String="\\." />
+ <DetectChar attribute="RegExpr" context="RegExpr (" char="(" />
+ <DetectChar attribute="RegExpr" context="RegExpr [" char="[" />
+ <DetectChar attribute="RegExpr" context="RegExpr {" char="{" />
+ <DetectChar attribute="RegExpr" context="RegExpr Q" char="&quot;" />
+ </context>
+
+ <context name="Start Conditions Scope" attribute="Normal Text" lineEndContext="#stay" fallthrough="true" fallthroughContext="Rule RegExpr">
+ <RegExpr attribute="Content-Type Delimiter" context="#pop" String="\s*\}" endRegion="SCscope" />
+ <RegExpr attribute="Normal Text" context="Rule RegExpr" String="\s*" />
+ </context>
+
+ <context name="Action" attribute="Normal Text" lineEndContext="#pop" fallthrough="true" fallthroughContext="Action C">
+ <RegExpr attribute="Directive" context="#stay" String="\|\s*$" />
+ <Detect2Chars attribute="Content-Type Delimiter" context="Lex Rule C Bloc" char="%" char1="{" beginRegion="lexCbloc" />
+ </context>
+
+ <context name="Detect C" attribute="Normal Text" lineEndContext="#stay">
+ <RegExpr attribute="Normal Text" context="Indented C" String="^\s" />
+ <Detect2Chars attribute="Content-Type Delimiter" context="Lex C Bloc" char="%" char1="{" beginRegion="lexCbloc" column="0"/>
+ </context>
+ <context name="Indented C" attribute="Normal Text" lineEndContext="#pop">
+ <IncludeRules context="##C++" />
+ </context>
+ <context name="Lex C Bloc" attribute="Normal Text" lineEndContext="#stay">
+ <Detect2Chars attribute="Content-Type Delimiter" context="#pop" char="%" char1="}" endRegion="lexCbloc" column="0"/>
+ <IncludeRules context="##C++" />
+ </context>
+ <context name="Lex Rule C Bloc" attribute="Normal Text" lineEndContext="#stay">
+ <Detect2Chars attribute="Content-Type Delimiter" context="#pop" char="%" char1="}" endRegion="lexCbloc" />
+ <IncludeRules context="##C++" />
+ </context>
+ <context name="Normal C Bloc" attribute="Normal Text" lineEndContext="#stay">
+ <DetectChar attribute="Normal Text" context="Normal C Bloc" char="{" beginRegion="bloc" />
+ <DetectChar attribute="Normal Text" context="#pop" char="}" endRegion="bloc" />
+ <IncludeRules context="##C++" />
+ </context>
+ <context name="Action C" attribute="Normal Text" lineEndContext="#pop">
+ <DetectChar attribute="Normal Text" context="Normal C Bloc" char="{" beginRegion="bloc" />
+ <DetectChar attribute="Alert" context="#stay" char="}" />
+ <IncludeRules context="##C++" />
+ </context>
+</contexts>
+
+<itemDatas>
+ <itemData name="Normal Text" defStyleNum="dsNormal" />
+ <itemData name="Definition" defStyleNum="dsDataType" />
+ <itemData name="Comment" defStyleNum="dsComment" />
+ <itemData name="Content-Type Delimiter" defStyleNum="dsBaseN" bold="1" />
+ <itemData name="Directive" defStyleNum="dsKeyword"/>
+ <itemData name="RegExpr" defStyleNum="dsString" />
+ <itemData name="Backslash Code" defStyleNum="dsString" bold="1" />
+ <itemData name="Alert" defStyleNum="dsAlert" />
+</itemDatas>
+
+</highlighting>
+<general>
+ <comments>
+ <comment name="multiLine" start="/*" end="*/" />
+ </comments>
+</general>
+</language>
diff --git a/kate/data/lilypond.xml b/kate/data/lilypond.xml
new file mode 100644
index 000000000..08b954d82
--- /dev/null
+++ b/kate/data/lilypond.xml
@@ -0,0 +1,1095 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd" [
+ <!ENTITY b "(?![A-Za-z])">
+ <!ENTITY rest "\b[srR]&b;">
+ <!ENTITY pitch "\b([a-h]((iss){1,2}|(ess){1,2}|(is){1,2}|(es){1,2}|(sharp){1,2}|(flat){1,2}|ss?|ff?)?|(do|re|mi|fa|sol|la|si)(dd?|bb?|ss?|kk?)?)('+|,+|&b;)">
+ <!ENTITY duration "(\\(longa|breve)\b|(1|2|4|8|16|32|64|128|256|512|1024|2048)(?!\d))(\s*\.+)?(\s*\*\s*\d+(/\d+)?)*">
+ <!ENTITY dynamics "p{1,5}|mp|mf|f{1,4}|s?fp|sff?|spp?|[sr]?fz">
+ <!ENTITY scripts "\d+|accent|marcato|staccat(issim)?o|espressivo|tenuto|portato|(up|down)(bow|mordent|prall)|flageolet|thumb|[lr](heel|toe)|open|stopped|turn|reverseturn|trill|mordent|prall(prall|mordent|down|up)?|lineprall|signumcongruentiae|(short|long|verylong)?fermata|segno|(var)?coda">
+ <!ENTITY keywords "accepts|alias|consists|defaultchild|denies|description|grobdescriptions|include|invalid|name|objectid|once|remove|sequential|simultaneous|type|version|score|book">
+ <!ENTITY deprecatedkeywords "consistsend">
+ <!ENTITY commands "acciaccatura|addQuote|afterGrace|aikenHeads|allowPageTurn|alternative|apply(Context|Music|Output)|appoggiatura|arpeggio(Bracket|Down|Neutral|Up)?|(a|de)scendens|auctum|augmentum|autoBeamO(ff|n)|autochange|balloon(Grob)?Text|bar|barNumberCheck|bendAfter|breathe|break|cadenzaO(ff|n)|caesura|cavum|clef(\s+(treble|violin|G|alto|C|(sub)?bass|F|french|(mezzo)?soprano|(var)?baritone|percussion|tab))?|compressMusic|(end)?(de)?cr|(cue|transposedCue)During|default|deminutum|display(Lily)?Music|divisio(Maior|Maxima|Minima)|(dynamic|dots|phrasingSlur|slur|stem|tie|tuplet)(Down|Neutral|Up)|textLengthO(ff|n)|featherDurations|figure(mode|s)|finalis|flexa|(french|german|italian|semiGerman)Chords|glissando|grace|harmonic|(unH|h)ideNotes|(hide|show)StaffSwitch|inclinatum|(keep|remove)WithTag|key(\s+&pitch;)?|killCues|label|laissezVibrer|linea|mark|maxima|melisma(End)?|newSpacingSection|no(Beam|Break|PageBreak|PageTurn)|normalsize|octave|oneVoice|oriscus|page(-ref|Break|Turn)|parallelMusic|parenthesize|partcombine|partial(\s*&duration;)?|pes|pitchedTrill|quilisma|quoteDuring|relative(\s+&pitch;)?|RemoveEmptyStaffContext|repeat(\s+(unfold|volta|tremolo|percent)(\s+\d+)?)?|repeatTie|resetRelativeOctave|rest|sacredHarpHeads|scoreTweak|easyHeadsO(ff|n)|set(Hairpin|Text)(Cresc|Decresc|Dim)|setTextDecr|shift(Durations|Off|On{1,3})|(slur|tie)(Both|Dashed|Dotted|Solid)|small|spacingTweaks|(start|stop)(Group|(Text|Trill)Span|Staff)|stemBoth|stropha|super|(sustain|sostenuto)(Down|Up)|table-of-contents|tag|tempo(\s*\d+\.*\s*=\s*\d+)?|times?(\s*\d+/\d+)?|tiny|tocItem|transpose(\s+&pitch;\s*&pitch;)?|transposition(\s+&pitch;)|tweak|unfoldRepeats|virg(ul)?a|voice(One|Two|Three|Four)|withMusicProperty|cm|mm|in|pt|major|minor|ionian|locrian|aeolian|mixolydian|lydian|phrygian|dorian">
+ <!ENTITY deprecatedcommands "newpage|script(Up|Down|Both)|(empty|fat)Text|setEasyHeads|(default|voice|modernVoice|piano|forget)Accidentals|(modern(Voice)?|piano)Cautionaries|noResetKey">
+ <!ENTITY markupnotextargs "arrow-head|beam|char|double(flat|sharp)|draw-(circle|line)|epsfile|filled-box|flat|fret-diagram(-terse|-verbose)?|fromproperty|justify-(field|string)|lookup|markalphabet|markletter|musicglyph|natural|note-by-number|note|null|semi(flat|sharp)|sesqui(flat|sharp)|sharp|simple|slashed-digit|stencil|strut|tied-lyric|triangle|verbatim-file|wordwrap-field">
+ <!ENTITY markupwithtextargs "markup|bigger|bold|box|bracket|caps|(center|general|left|right)-align|circle|column|combine|concat|dir-column|dynamic|fill-line|finger|fontCaps|fontsize|fraction|halign|hbracket|hcenter-in|hcenter|hspace|huge|italic|justify|larger?|line|lower|magnify|medium|normal-size-(sub|super)|normal-text|normalsize|number|on-the-fly|override|pad-(around|markup|to-box|x)|page-ref|postscript|put-adjacent|raise|roman|rotate|sans|small(er)?|smallCaps|sub|super|teeny|text|tiny|translate(-scaled)?|transparent|typewriter|underline|upright|vcenter|whiteout|with-(color|dimensions|url)|wordwrap(-string)?|(markup|column-|justified-|override-|wordwrap-)lines">
+ <!ENTITY deprecatedmarkup "center">
+ <!ENTITY headervars "dedication|(sub){,2}title|poet|composer|meter|opus|arranger|instrument|piece|breakbefore|copyright|tagline|mutopia(title|composer|poet|opus|instrument)|date|enteredby|source|style|maintainer(Email|Web)?|moreInfo|lastupdated|texidoc">
+ <!ENTITY papervars "annotate-spacing|(print-)?first-page-number|print-page-number|paper-(width|height)|(top|bottom|left|right)-margin|line-width|(head|foot)-separation|page-top-space|ragged-(bottom|last-bottom|right)|page-count|between-system-(space|padding)|page-breaking-between-system-padding|horizontal-shift|(before|after|between)-title-space|printallheaders|indent|force-assignment|input-encoding|output-scale|blank(-after-score|-last)?-page-force|page-limit-inter-system-space(-factor)?|(systemSeparator|(even|odd)(Footer|Header)|(book|score|toc)Title|tocItem)Markup">
+ <!ENTITY layoutvars "system-count|indent">
+ <!ENTITY toplevelvars "dash(Hat|Plus|Dash|Bar|Larger|Dot|Underscore)|fermataMarkup|pipeSymbol|slashSeparator">
+ <!ENTITY performer "Beam|Control_track|Drum_note|Dynamic|Key|Lyric|Note|Piano_pedal|Slur|Staff|Swallow|Tempo|Tie|Time_signature">
+ <!ENTITY translator "Note_swallow|Rest_swallow|Skip_event_swallow|Timing">
+ <!ENTITY engraver "Accidental|Ambitus|Arpeggio|Auto_beam|Axis_group|Balloon|Bar|Bar_number|Beam|Bend|Break_align|Breathing_sign|Chord_name|Chord_tremolo|Clef|Cluster_spanner|Collision|Completion_heads|Custos|Default_bar_line|Dot_column|Dots|Drum_notes|Dynamic|Engraver|Extender|Figured_bass|Figured_bass_position|Fingering|Font_size|Forbid_line_break|Fretboard|Glissando|Grace_beam|Grace|Grace_spacing|Grid_line_span|Grid_point|Grob_pq|Hara_kiri|Horizontal_bracket|Hyphen|Instrument_name|Instrument_switch|Key|Laissez_vibrer|Ledger_line|Ligature_bracket|Lyric|Mark|Measure_grouping|Melody|Mensural_ligature|Metronome_mark|Multi_measure_rest|New_fingering|Note_head_line|Note_heads|Note_name|Note_spacing|Ottava_spanner|Output_property|Page_turn|Paper_column|Parenthesis|Part_combine|Percent_repeat|Phrasing_slur|Piano_pedal_align|Piano_pedal|Pitch_squash|Pitched_trill|Repeat_acknowledge|Repeat_tie|Rest_collision|Rest|Rhythmic_column|Script_column|Script|Script_row|Separating_line_group|Slash_repeat|Slur|Spacing|Span_arpeggio|Span_bar|Spanner_break_forbid|Staff_collecting|Staff_symbol|Stanza_number_align|Stanza_number|Stem|String_number|Swallow|System_start_delimiter|Tab_harmonic|Tab_note_heads|Tab_staff_symbol|Text|Text_spanner|Tie|Time_signature|Translator|Trill_spanner|Tuplet|Tweak|Vaticana_ligature|Vertical_align|Vertically_spaced_contexts|Volta">
+ <!ENTITY engravers "(&engraver;)_engraver|(&performer;)_performer|(&translator;)_translator">
+ <!ENTITY schemename "[a-zA-Z#][^\s(){}[\];$&quot;]*">
+ <!ENTITY schemefunc "\b(define|defined\?|define\*(-public)?|define-(\*|builtin-markup-(list-)?command|class|(extra-)?display-method|fonts?|grob-property|ly-syntax(-loc|-simple)?|macro(-public)?|markup-(list-)command|method|module|music-function|post-event-display-method|public(-macro|-toplevel)?|safe-public|span-event-display-method)|defmacro(\*(-public)?)?|lambda\*?|and|or|if|cond|case|let\*?|letrec|begin|do|delay|set!|else|(quasi)?quote|unquote(-splicing)?|(define|let|letrec)-syntax|syntax-rules|not|boolean\?|eq\?|eqv\?|equal\?|pair\?|cons|set-c[ad]r!|c[ad]{1,4}r|null\?|list\?|list|length|append|reverse|list-ref|mem[qv]|member|ass[qv]|assoc|symbol\?|symbol-&gt;string|string-&gt;symbol|number\?|complex\?|real\?|rational\?|integer\?|exact\?|inexact\?|zero\?|positive\?|negative\?|odd\?|even\?|max|min|abs|quotient|remainder|modulo|gcd|lcm|numerator|denominator|floor|ceiling|truncate|round|rationalize|exp|log|sin|cos|tan|asin|acos|atan|sqrt|expt|make-rectangular|make-polar|real-part|imag-part|magnitude|angle|exact-&gt;inexact|inexact-&gt;exact|number-&gt;string|string-&gt;number|char((-ci)?(=\?|&lt;\?|&gt;\?|&lt;=\?|&gt;=\?)|-alphabetic\?|\?|-numeric\?|-whitespace\?|-upper-case\?|-lower-case\?|-&gt;integer|-upcase|-downcase|-ready\?)|integer-&gt;char|make-string|string(\?|-copy|-fill!|-length|-ref|-set!|(-ci)?(=\?|&lt;\?|&gt;\?|&lt;=\?|&gt;=\?)|-append)|substring|make-vector|vector(\?|-length|-ref|-set!|-fill!)?|procedure\?|apply|map|for-each|force|call-with-(current-continuation|(in|out)put-file)|(in|out)put-port\?|current-(in|out)put-port|open-(in|out)put-file|close-(in|out)put-port|eof-object\?|read|(read|peek)-char|write(-char)?|display|newline|call/cc|list-tail|string-&gt;list|list-&gt;string|vector-&gt;list|list-&gt;vector|with-input-from-file|with-output-to-file|load|transcript-(on|off)|eval|dynamic-wind|port\?|values|call-with-values|(scheme-report-|null-|interaction-)environment)(?=($|\s|\)))">
+]>
+<language name="LilyPond" section="Other" version="2.20" kateversion="2.4" extensions="*.ly;*.LY;*.ily;*.ILY;*.lyi;*.LYI" mimetype="text/x-lilypond" author="Wilbert Berendsen (info@wilbertberendsen.nl)" license="LGPL">
+
+ <!--
+
+ January, 2008
+ Fully rewritten by Wilbert Berendsen (info@wilbertberendsen.nl)
+
+ Changes:
+
+ - correctly parse pitches, chords, durations, etc. marking often made mistakes as invalid
+ - speed up by shortening contexts, e.g. branch out on a \, instead of RegExpr'ing all \commands
+ - recognize some contexts like \layout, \with, \header to colorcode variables, engravers, etc. only there
+ - recognize lilypond words like ChoirStaff etc. only in sections and after \set, \override etc.
+ - highlight some standard Scheme function names
+ - add \figuremode recognition
+ - all Scheme stuff has a nice, very light background, to show where Lilypond is in Scheme mode.
+ - mark some deprecated (pre 2.12) LilyPond commands and properties
+
+ October, 2007
+ New version by Wilbert Berendsen (info@wilbertberendsen.nl)
+
+ Changes:
+
+ - better recognition of being inside lyrics, drums, notes, chords and markup sections
+ - detect block comments %{ %}
+ - links to ##Alerts in comments (e.g. TODO, FIXME)
+ - detect lilypond inside scheme #{ #}
+ - detect \score inside \markup, etc.
+ - helps with some often made errors like forgetting spaces around lyric extenders and hyphens
+ - more scheme improvements: strings, numbers, $substitutions, lilypond objects
+ - highlights many variables, commands, lilypond objects, properties, engravers, etc.
+ - by using entities for many regexps the main syntax checking parts remain legible, and the file more maintainable.
+
+ I borrowed some colors and the drum names from Andrea Primiani's first version (August, 2004).
+
+ -->
+
+ <highlighting>
+ <list name="contexts">
+ <item> ChoirStaff </item>
+ <item> ChordNames </item>
+ <item> CueVoice </item>
+ <item> Devnull </item>
+ <item> DrumStaff </item>
+ <item> DrumVoice </item>
+ <item> FiguredBass </item>
+ <item> FretBoards </item>
+ <item> Global </item>
+ <item> GrandStaff </item>
+ <item> GregorianTranscriptionStaff </item>
+ <item> GregorianTranscriptionVoice </item>
+ <item> InnerChoirStaff </item>
+ <item> InnerStaffGroup </item>
+ <item> Lyrics </item>
+ <item> MensuralStaff </item>
+ <item> MensuralVoice </item>
+ <item> NoteNames </item>
+ <item> PianoStaff </item>
+ <item> RhythmicStaff </item>
+ <item> Score </item>
+ <item> Staff </item>
+ <item> StaffGroup </item>
+ <item> TabStaff </item>
+ <item> TabVoice </item>
+ <item> VaticanaStaff </item>
+ <item> VaticanaVoice </item>
+ <item> Voice </item>
+ </list>
+ <list name="layoutobjects">
+ <item> Accidental </item>
+ <item> AccidentalCautionary </item>
+ <item> AccidentalPlacement </item>
+ <item> AccidentalSuggestion </item>
+ <item> Ambitus </item>
+ <item> AmbitusAccidental </item>
+ <item> AmbitusLine </item>
+ <item> AmbitusNoteHead </item>
+ <item> Arpeggio </item>
+ <item> BalloonTextItem </item>
+ <item> BarLine </item>
+ <item> BarNumber </item>
+ <item> BassFigure </item>
+ <item> BassFigureAlignment </item>
+ <item> BassFigureAlignmentPositioning </item>
+ <item> BassFigureBracket </item>
+ <item> BassFigureContinuation </item>
+ <item> BassFigureLine </item>
+ <item> Beam </item>
+ <item> BendAfter </item>
+ <item> BreakAlignGroup </item>
+ <item> BreakAlignment </item>
+ <item> BreathingSign </item>
+ <item> ChordName </item>
+ <item> Clef </item>
+ <item> ClusterSpanner </item>
+ <item> ClusterSpannerBeacon </item>
+ <item> CombineTextScript </item>
+ <item> Custos </item>
+ <item> DotColumn </item>
+ <item> Dots </item>
+ <item> DoublePercentRepeat </item>
+ <item> DoublePercentRepeatCounter </item>
+ <item> DynamicLineSpanner </item>
+ <item> DynamicText </item>
+ <item> DynamicTextSpanner </item>
+ <item> Fingering </item>
+ <item> FretBoard </item>
+ <item> Glissando </item>
+ <item> GraceSpacing </item>
+ <item> GridLine </item>
+ <item> GridPoint </item>
+ <item> Hairpin </item>
+ <item> HarmonicParenthesesItem </item>
+ <item> HorizontalBracket </item>
+ <item> InstrumentName </item>
+ <item> InstrumentSwitch </item>
+ <item> KeyCancellation </item>
+ <item> KeySignature </item>
+ <item> LaissezVibrerTie </item>
+ <item> LaissezVibrerTieColumn </item>
+ <item> LedgerLineSpanner </item>
+ <item> LeftEdge </item>
+ <item> LigatureBracket </item>
+ <item> LyricExtender </item>
+ <item> LyricHyphen </item>
+ <item> LyricSpace </item>
+ <item> LyricText </item>
+ <item> MeasureGrouping </item>
+ <item> MelodyItem </item>
+ <item> MensuralLigature </item>
+ <item> MetronomeMark </item>
+ <item> MultiMeasureRest </item>
+ <item> MultiMeasureRestNumber </item>
+ <item> MultiMeasureRestText </item>
+ <item> NonMusicalPaperColumn </item>
+ <item> NoteCollision </item>
+ <item> NoteColumn </item>
+ <item> NoteHead </item>
+ <item> NoteName </item>
+ <item> NoteSpacing </item>
+ <item> OctavateEight </item>
+ <item> OttavaBracket </item>
+ <item> PaperColumn </item>
+ <item> ParenthesesItem </item>
+ <item> PercentRepeat </item>
+ <item> PercentRepeatCounter </item>
+ <item> PhrasingSlur </item>
+ <item> PianoPedalBracket </item>
+ <item> RehearsalMark </item>
+ <item> RepeatSlash </item>
+ <item> RepeatTie </item>
+ <item> RepeatTieColumn </item>
+ <item> Rest </item>
+ <item> RestCollision </item>
+ <item> Script </item>
+ <item> ScriptColumn </item>
+ <item> ScriptRow </item>
+ <item> SeparationItem </item>
+ <item> Slur </item>
+ <item> SostenutoPedal </item>
+ <item> SostenutoPedalLineSpanner </item>
+ <item> SpacingSpanner </item>
+ <item> SpanBar </item>
+ <item> StaffSpacing </item>
+ <item> StaffSymbol </item>
+ <item> StanzaNumber </item>
+ <item> Stem </item>
+ <item> StemTremolo </item>
+ <item> StringNumber </item>
+ <item> StrokeFinger </item>
+ <item> SustainPedal </item>
+ <item> SustainPedalLineSpanner </item>
+ <item> System </item>
+ <item> SystemStartBar </item>
+ <item> SystemStartBrace </item>
+ <item> SystemStartBracket </item>
+ <item> SystemStartSquare </item>
+ <item> TabNoteHead </item>
+ <item> TextScript </item>
+ <item> TextSpanner </item>
+ <item> Tie </item>
+ <item> TieColumn </item>
+ <item> TimeSignature </item>
+ <item> TrillPitchAccidental </item>
+ <item> TrillPitchGroup </item>
+ <item> TrillPitchHead </item>
+ <item> TrillSpanner </item>
+ <item> TupletBracket </item>
+ <item> TupletNumber </item>
+ <item> UnaCordaPedal </item>
+ <item> UnaCordaPedalLineSpanner </item>
+ <item> VaticanaLigature </item>
+ <item> VerticalAlignment </item>
+ <item> VerticalAxisGroup </item>
+ <item> VoiceFollower </item>
+ <item> VoltaBracket </item>
+ <item> VoltaBracketSpanner </item>
+ </list>
+ <list name="properties">
+ <item> aDueText </item>
+ <item> alignAboveContext </item>
+ <item> alignBassFigureAccidentals </item>
+ <item> alignBelowContext </item>
+ <item> allowBeamBreak </item>
+ <item> associatedVoice </item>
+ <item> autoAccidentals </item>
+ <item> autoBeamCheck </item>
+ <item> autoBeamSettings </item>
+ <item> autoBeaming </item>
+ <item> autoCautionaries </item>
+ <item> automaticBars </item>
+ <item> barAlways </item>
+ <item> barCheckSynchronize </item>
+ <item> barNumberVisibility </item>
+ <item> bassFigureFormatFunction </item>
+ <item> bassStaffProperties </item>
+ <item> beatGrouping </item>
+ <item> beatLength </item>
+ <item> chordChanges </item>
+ <item> chordNameExceptions </item>
+ <item> chordNameExceptionsFull </item>
+ <item> chordNameExceptionsPartial </item>
+ <item> chordNameFunction </item>
+ <item> chordNameSeparator </item>
+ <item> chordNoteNamer </item>
+ <item> chordPrefixSpacer </item>
+ <item> chordRootNamer </item>
+ <item> clefGlyph </item>
+ <item> clefOctavation </item>
+ <item> clefPosition </item>
+ <item> connectArpeggios </item>
+ <item> countPercentRepeats </item>
+ <item> createKeyOnClefChange </item>
+ <item> createSpacing </item>
+ <item> crescendoSpanner </item>
+ <item> crescendoText </item>
+ <item> currentBarNumber </item>
+ <item> decrescendoSpanner </item>
+ <item> decrescendoText </item>
+ <item> defaultBarType </item>
+ <item> doubleSlurs </item>
+ <item> drumPitchTable </item>
+ <item> drumStyleTable </item>
+ <item> dynamicAbsoluteVolumeFunction </item>
+ <item> explicitClefVisibility </item>
+ <item> explicitKeySignatureVisibility </item>
+ <item> extendersOverRests </item>
+ <item> extraNatural </item>
+ <item> figuredBassAlterationDirection </item>
+ <item> figuredBassCenterContinuations </item>
+ <item> figuredBassFormatter </item>
+ <item> figuredBassPlusDirection </item>
+ <item> fingeringOrientations </item>
+ <item> firstClef </item>
+ <item> followVoice </item>
+ <item> fontSize </item>
+ <item> forbidBreak </item>
+ <item> forceClef </item>
+ <item> gridInterval </item>
+ <item> hairpinToBarline </item>
+ <item> harmonicAccidentals </item>
+ <item> highStringOne </item>
+ <item> ignoreBarChecks </item>
+ <item> ignoreFiguredBassRest </item>
+ <item> ignoreMelismata </item>
+ <item> implicitBassFigures </item>
+ <item> implicitTimeSignatureVisibility </item>
+ <item> instrumentCueName </item>
+ <item> instrumentEqualizer </item>
+ <item> instrumentName </item>
+ <item> instrumentTransposition </item>
+ <item> internalBarNumber </item>
+ <item> keepAliveInterfaces </item>
+ <item> keyAlterationOrder </item>
+ <item> keySignature </item>
+ <item> lyricMelismaAlignment </item>
+ <item> majorSevenSymbol </item>
+ <item> markFormatter </item>
+ <item> maximumFretStretch </item>
+ <item> measureLength </item>
+ <item> measurePosition </item>
+ <item> melismaBusyProperties </item>
+ <item> metronomeMarkFormatter </item>
+ <item> middleCClefPosition </item>
+ <item> middleCOffset </item>
+ <item> middleCPosition </item>
+ <item> midiInstrument </item>
+ <item> midiMaximumVolume </item>
+ <item> midiMinimumVolume </item>
+ <item> minimumFret </item>
+ <item> minimumPageTurnLength </item>
+ <item> minimumRepeatLengthForPageTurn </item>
+ <item> noteToFretFunction </item>
+ <item> ottavation </item>
+ <item> output </item>
+ <item> pedalSostenutoStrings </item>
+ <item> pedalSostenutoStyle </item>
+ <item> pedalSustainStrings </item>
+ <item> pedalSustainStyle </item>
+ <item> pedalUnaCordaStrings </item>
+ <item> pedalUnaCordaStyle </item>
+ <item> printKeyCancellation </item>
+ <item> printOctaveNames </item>
+ <item> printPartCombineTexts </item>
+ <item> proportionalNotationDuration </item>
+ <item> recordEventSequence </item>
+ <item> rehearsalMark </item>
+ <item> repeatCommands </item>
+ <item> restNumberThreshold </item>
+ <item> scriptDefinitions </item>
+ <item> shapeNoteStyles </item>
+ <item> shortInstrumentName </item>
+ <item> shortVocalName </item>
+ <item> skipBars </item>
+ <item> skipTypesetting </item>
+ <item> soloIIText </item>
+ <item> soloText </item>
+ <item> squashedPosition </item>
+ <item> staffLineLayoutFunction </item>
+ <item> stanza </item>
+ <item> stemLeftBeamCount </item>
+ <item> stemRightBeamCount </item>
+ <item> stringNumberOrientations </item>
+ <item> stringOneTopmost </item>
+ <item> stringTunings </item>
+ <item> strokeFingerOrientations </item>
+ <item> subdivideBeams </item>
+ <item> suggestAccidentals </item>
+ <item> systemStartDelimiter </item>
+ <item> systemStartDelimiterHierarchy </item>
+ <item> tablatureFormat </item>
+ <item> tempoUnitCount </item>
+ <item> tempoUnitDuration </item>
+ <item> tempoWholesPerMinute </item>
+ <item> tieWaitForNote </item>
+ <item> timeSignatureFraction </item>
+ <item> timing </item>
+ <item> tonic </item>
+ <item> trebleStaffProperties </item>
+ <item> tremoloFlags </item>
+ <item> tupletFullLength </item>
+ <item> tupletFullLengthNote </item>
+ <item> tupletSpannerDuration </item>
+ <item> useBassFigureExtenders </item>
+ <item> verticallySpacedContexts </item>
+ <item> vocalName </item>
+ <item> voltaOnThisStaff </item>
+ <item> voltaSpannerDuration </item>
+ <item> whichBar </item>
+ </list>
+ <list name="deprecatedproperties">
+ <item> barNumberAlignSymbol </item>
+ <item> centralCPosition </item>
+ <item> extraVerticalExtent </item>
+ <item> fingerHorizontalDirection </item>
+ <item> instr </item>
+ <item> instrument </item>
+ <item> keyAccidentalOrder </item>
+ <item> minimumVerticalExtent </item>
+ <item> rehearsalMarkAlignSymbol </item>
+ <item> soloADue </item>
+ <item> tupletNumberFormatFunction </item>
+ <item> vocNam </item>
+ </list>
+ <list name="musicexpressions">
+ <item> AbsoluteDynamicEvent </item>
+ <item> AnnotateOutputEvent </item>
+ <item> ApplyContext </item>
+ <item> ApplyOutputEvent </item>
+ <item> ArpeggioEvent </item>
+ <item> ArticulationEvent </item>
+ <item> AutoChangeMusic </item>
+ <item> BarCheck </item>
+ <item> BassFigureEvent </item>
+ <item> BeamEvent </item>
+ <item> BeamForbidEvent </item>
+ <item> BendAfterEvent </item>
+ <item> BreathingEvent </item>
+ <item> ClusterNoteEvent </item>
+ <item> ContextChange </item>
+ <item> ContextSpeccedMusic </item>
+ <item> CrescendoEvent </item>
+ <item> DecrescendoEvent </item>
+ <item> Event </item>
+ <item> EventChord </item>
+ <item> ExtenderEvent </item>
+ <item> FingeringEvent </item>
+ <item> GlissandoEvent </item>
+ <item> GraceMusic </item>
+ <item> HarmonicEvent </item>
+ <item> HyphenEvent </item>
+ <item> KeyChangeEvent </item>
+ <item> LabelEvent </item>
+ <item> LaissezVibrerEvent </item>
+ <item> LigatureEvent </item>
+ <item> LineBreakEvent </item>
+ <item> LyricCombineMusic </item>
+ <item> LyricEvent </item>
+ <item> MarkEvent </item>
+ <item> MultiMeasureRestEvent </item>
+ <item> MultiMeasureRestMusic </item>
+ <item> MultiMeasureTextEvent </item>
+ <item> Music </item>
+ <item> NoteEvent </item>
+ <item> NoteGroupingEvent </item>
+ <item> OverrideProperty </item>
+ <item> PageBreakEvent </item>
+ <item> PageTurnEvent </item>
+ <item> PartCombineMusic </item>
+ <item> PercentEvent </item>
+ <item> PercentRepeatedMusic </item>
+ <item> PesOrFlexaEvent </item>
+ <item> PhrasingSlurEvent </item>
+ <item> PropertySet </item>
+ <item> PropertyUnset </item>
+ <item> QuoteMusic </item>
+ <item> RelativeOctaveCheck </item>
+ <item> RelativeOctaveMusic </item>
+ <item> RepeatTieEvent </item>
+ <item> RepeatedMusic </item>
+ <item> RestEvent </item>
+ <item> RevertProperty </item>
+ <item> ScriptEvent </item>
+ <item> SequentialMusic </item>
+ <item> SimultaneousMusic </item>
+ <item> SkipEvent </item>
+ <item> SkipMusic </item>
+ <item> SlurEvent </item>
+ <item> SoloOneEvent </item>
+ <item> SoloTwoEvent </item>
+ <item> SostenutoEvent </item>
+ <item> SpacingSectionEvent </item>
+ <item> SpanEvent </item>
+ <item> StaffSpanEvent </item>
+ <item> StringNumberEvent </item>
+ <item> StrokeFingerEvent </item>
+ <item> SustainEvent </item>
+ <item> TextScriptEvent </item>
+ <item> TextSpanEvent </item>
+ <item> TieEvent </item>
+ <item> TimeScaledMusic </item>
+ <item> TransposedMusic </item>
+ <item> TremoloEvent </item>
+ <item> TremoloRepeatedMusic </item>
+ <item> TremoloSpanEvent </item>
+ <item> TrillSpanEvent </item>
+ <item> TupletSpanEvent </item>
+ <item> UnaCordaEvent </item>
+ <item> UnfoldedRepeatedMusic </item>
+ <item> UnisonoEvent </item>
+ <item> UnrelativableMusic </item>
+ <item> VoiceSeparator </item>
+ <item> VoltaRepeatedMusic </item>
+ </list>
+ <list name="drumpitchnames">
+ <item> acousticbassdrum </item>
+ <item> acousticsnare </item>
+ <item> agh </item>
+ <item> agl </item>
+ <item> bassdrum </item>
+ <item> bd </item>
+ <item> bda </item>
+ <item> boh </item>
+ <item> bohm </item>
+ <item> boho </item>
+ <item> bol </item>
+ <item> bolm </item>
+ <item> bolo </item>
+ <item> cab </item>
+ <item> cabasa </item>
+ <item> cb </item>
+ <item> cgh </item>
+ <item> cghm </item>
+ <item> cgho </item>
+ <item> cgl </item>
+ <item> cglm </item>
+ <item> cglo </item>
+ <item> chinesecymbal </item>
+ <item> cl </item>
+ <item> claves </item>
+ <item> closedhihat </item>
+ <item> cowbell </item>
+ <item> crashcymbal </item>
+ <item> crashcymbala </item>
+ <item> crashcymbalb </item>
+ <item> cuim </item>
+ <item> cuio </item>
+ <item> cymc </item>
+ <item> cymca </item>
+ <item> cymcb </item>
+ <item> cymch </item>
+ <item> cymr </item>
+ <item> cymra </item>
+ <item> cymrb </item>
+ <item> cyms </item>
+ <item> da </item>
+ <item> db </item>
+ <item> dc </item>
+ <item> dd </item>
+ <item> de </item>
+ <item> electricsnare </item>
+ <item> fivedown </item>
+ <item> fiveup </item>
+ <item> fourdown </item>
+ <item> fourup </item>
+ <item> gui </item>
+ <item> guil </item>
+ <item> guiro </item>
+ <item> guis </item>
+ <item> halfopenhihat </item>
+ <item> handclap </item>
+ <item> hc </item>
+ <item> hh </item>
+ <item> hhc </item>
+ <item> hhho </item>
+ <item> hho </item>
+ <item> hhp </item>
+ <item> hiagogo </item>
+ <item> hibongo </item>
+ <item> hiconga </item>
+ <item> highfloortom </item>
+ <item> hightom </item>
+ <item> hihat </item>
+ <item> himidtom </item>
+ <item> hisidestick </item>
+ <item> hitimbale </item>
+ <item> hiwoodblock </item>
+ <item> loagogo </item>
+ <item> lobongo </item>
+ <item> loconga </item>
+ <item> longguiro </item>
+ <item> longwhistle </item>
+ <item> losidestick </item>
+ <item> lotimbale </item>
+ <item> lowfloortom </item>
+ <item> lowmidtom </item>
+ <item> lowoodblock </item>
+ <item> lowtom </item>
+ <item> mar </item>
+ <item> maracas </item>
+ <item> mutecuica </item>
+ <item> mutehibongo </item>
+ <item> mutehiconga </item>
+ <item> mutelobongo </item>
+ <item> muteloconga </item>
+ <item> mutetriangle </item>
+ <item> onedown </item>
+ <item> oneup </item>
+ <item> opencuica </item>
+ <item> openhibongo </item>
+ <item> openhiconga </item>
+ <item> openhihat </item>
+ <item> openlobongo </item>
+ <item> openloconga </item>
+ <item> opentriangle </item>
+ <item> pedalhihat </item>
+ <item> rb </item>
+ <item> ridebell </item>
+ <item> ridecymbal </item>
+ <item> ridecymbala </item>
+ <item> ridecymbalb </item>
+ <item> shortguiro </item>
+ <item> shortwhistle </item>
+ <item> sidestick </item>
+ <item> sn </item>
+ <item> sna </item>
+ <item> snare </item>
+ <item> sne </item>
+ <item> splashcymbal </item>
+ <item> ss </item>
+ <item> ssh </item>
+ <item> ssl </item>
+ <item> tamb </item>
+ <item> tambourine </item>
+ <item> tamtam </item>
+ <item> threedown </item>
+ <item> threeup </item>
+ <item> timh </item>
+ <item> timl </item>
+ <item> tomfh </item>
+ <item> tomfl </item>
+ <item> tomh </item>
+ <item> toml </item>
+ <item> tommh </item>
+ <item> tomml </item>
+ <item> tri </item>
+ <item> triangle </item>
+ <item> trim </item>
+ <item> trio </item>
+ <item> tt </item>
+ <item> twodown </item>
+ <item> twoup </item>
+ <item> ua </item>
+ <item> ub </item>
+ <item> uc </item>
+ <item> ud </item>
+ <item> ue </item>
+ <item> vibraslap </item>
+ <item> vibs </item>
+ <item> wbh </item>
+ <item> wbl </item>
+ <item> whl </item>
+ <item> whs </item>
+ </list>
+ <contexts>
+ <!-- Entry point -->
+ <context name="lilypond" attribute="Normal Text" lineEndContext="#stay">
+ <IncludeRules context="music"/>
+ <RegExpr String="\b[a-z]+\s*=" insensitive="true" lookAhead="true" context="assignment"/>
+ </context>
+
+ <!-- Music expressions -->
+ <context name="music" attribute="Normal Text" lineEndContext="#stay">
+ <AnyChar String="()~" attribute="Slur"/>
+ <AnyChar String="[]" attribute="Beam"/>
+ <AnyChar String="-_^" context="connect"/>
+ <DetectChar char="\" context="musiccommand" lookAhead="true"/>
+ <IncludeRules context="default"/>
+ <DetectChar char="&lt;" attribute="Chord" context="chord"/>
+ <DetectChar char="&gt;" attribute="Invalid"/><!-- chord terminator outsite chord -->
+ <RegExpr String="[a-z]+\d+\.*[,']+" attribute="Invalid"/><!-- pitch-dur-octave i.s.o. pitch-oct-dur -->
+ <RegExpr String="(&rest;|&pitch;)" context="pitch"/>
+ <RegExpr String=":\d*" attribute="Tremolo"/>
+ </context>
+
+ <!-- Default Lilypond code to be recognized e.g. also inside lyrics -->
+ <context name="default" attribute="Normal Text" lineEndContext="#stay">
+ <Detect2Chars char="&lt;" char1="&lt;" attribute="Keyword" beginRegion="simultaneous"/>
+ <Detect2Chars char="&gt;" char1="&gt;" attribute="Keyword" endRegion="simultaneous"/>
+ <DetectChar char="{" attribute="Keyword" beginRegion="sequential"/>
+ <DetectChar char="}" attribute="Keyword" endRegion="sequential"/>
+ <DetectChar char="|" attribute="Check"/>
+ <DetectChar char="\" context="command" lookAhead="true"/>
+ <IncludeRules context="basic"/>
+ </context>
+
+ <!-- Basic Lilypond syntax that also works inside markup -->
+ <context name="basic" attribute="Normal Text" lineEndContext="#stay">
+ <Detect2Chars char="%" char1="{" context="commentblock" beginRegion="comment"/>
+ <DetectChar char="%" context="commentline"/>
+ <DetectChar char="&quot;" context="string"/>
+ <DetectChar char="#" context="scheme"/>
+ <DetectChar char="$" context="schemesub"/>
+ </context>
+
+ <context name="musiccommand" attribute="Normal Text" lineEndContext="#pop"
+ fallthrough="true" fallthroughContext="#pop">
+ <RegExpr String="\\(&dynamics;)&b;" attribute="Dynamic"/>
+ <RegExpr String="\\[&lt;!&gt;]" attribute="Dynamic"/>
+ <RegExpr String="\\(&scripts;)&b;" attribute="Articulation"/>
+ <RegExpr String="\\[()]" attribute="Slur"/>
+ <RegExpr String="\\[][]" attribute="Beam"/>
+ <IncludeRules context="command"/>
+ </context>
+
+ <context name="command" attribute="Normal Text" lineEndContext="#pop"
+ fallthrough="true" fallthroughContext="#pop">
+ <Detect2Chars char="\" char1="\" attribute="Keyword"/>
+ <RegExpr String="\\note(mode|s)&b;" context="notemode"/>
+ <RegExpr String="\\drum(mode|s)&b;" context="drummode"/>
+ <RegExpr String="\\chord(mode|s)&b;" context="chordmode"/>
+ <RegExpr String="\\figure(mode|s)&b;" context="figuremode"/>
+ <RegExpr String="\\(lyric(mode|s)|addlyrics)&b;" context="lyricmode"/>
+ <RegExpr String="\\lyricsto&b;" context="lyricsto"/>
+ <RegExpr String="\\markup(lines)?&b;" attribute="Markup" context="markup"/>
+ <RegExpr String="\\(header|paper|layout|midi|with)\b" context="section"/>
+ <RegExpr String="\\(new|context|change)\b" attribute="Keyword" context="context"/>
+ <RegExpr String="\\(un)?set\b" attribute="Keyword" context="set"/>
+ <RegExpr String="\\(override(Property)?|revert)&b;" attribute="Keyword" context="override"/>
+ <RegExpr String="\\skip&b;" attribute="Command" context="duration"/>
+ <RegExpr String="\\(&keywords;)&b;" attribute="Keyword"/>
+ <RegExpr String="\\(&commands;)&b;" attribute="Command"/>
+ <RegExpr String="\\(&toplevelvars;)&b;" attribute="Variable"/>
+ <RegExpr String="\\(&deprecatedkeywords;)&b;" attribute="Deprecated Keyword"/>
+ <RegExpr String="\\(&deprecatedcommands;)&b;" attribute="Deprecated Command"/>
+ <RegExpr String="\\(translator|newcontext)\b" attribute="Deprecated Keyword" context="context"/>
+ <RegExpr String="\\property&b;" attribute="Deprecated Keyword" context="override"/>
+ <RegExpr String="\\[A-Za-z]+" attribute="User Command"/>
+ <DetectChar char="\" attribute="Invalid"/>
+ </context>
+
+ <context name="assignment" attribute="Normal Text" lineEndContext="#pop">
+ <RegExpr String="\b(&toplevelvars;)\b" attribute="Variable" context="#pop"/>
+ <RegExpr String="[a-z]+" insensitive="true" attribute="User Command" context="#pop"/>
+ </context>
+
+ <context name="pitch" attribute="Pitch" lineEndContext="#stay"
+ fallthrough="true" fallthroughContext="#pop">
+ <RegExpr String="=\s*('+|,+)?" attribute="Check"/>
+ <IncludeRules context="duration"/>
+ </context>
+
+ <context name="duration" attribute="Normal Text" lineEndContext="#stay"
+ fallthrough="true" fallthroughContext="#pop">
+ <DetectSpaces attribute="Normal Text"/>
+ <RegExpr String="&duration;" attribute="Duration" context="#pop"/>
+ <RegExpr String="\d+" attribute="Invalid" context="#pop"/><!-- uncaught (wrong) durations -->
+ </context>
+
+ <context name="chord" attribute="Normal Text" lineEndContext="#stay">
+ <DetectChar char="&gt;" context="chordend"/>
+ <RegExpr String="&pitch;" context="chordpitch"/>
+ <AnyChar String="&lt;{}srR" attribute="Invalid"/><!-- no rests in chord allowed -->
+ <IncludeRules context="music"/>
+ </context>
+
+ <context name="chordpitch" attribute="Pitch" lineEndContext="#stay"
+ fallthrough="true" fallthroughContext="#pop">
+ <DetectSpaces attribute="Normal Text"/>
+ <RegExpr String="=\s*('+|,+)?" attribute="Check"/>
+ <RegExpr String="&duration;" attribute="Invalid" context="#pop"/><!-- no duration in chord allowed -->
+ <RegExpr String="\d+" attribute="Invalid" context="#pop"/><!-- catch other (wrong) durations as well -->
+ </context>
+
+ <context name="chordend" attribute="Chord" lineEndContext="#stay"
+ fallthrough="true" fallthroughContext="#pop#pop">
+ <DetectSpaces attribute="Normal Text"/>
+ <RegExpr String="&duration;" attribute="Duration" context="#pop#pop"/>
+ </context>
+
+ <context name="commentline" attribute="Comment" lineEndContext="#pop">
+ <IncludeRules context="##Alerts"/>
+ </context>
+
+ <context name="commentblock" attribute="Comment" lineEndContext="#stay">
+ <Detect2Chars char="%" char1="}" attribute="Comment" context="#pop" endRegion="comment"/>
+ <IncludeRules context="##Alerts"/>
+ </context>
+
+ <context name="string" attribute="Quoted Text" lineEndContext="#stay">
+ <DetectChar char="&quot;" attribute="Quoted Text" context="#pop"/>
+ <Detect2Chars char="\" char1="\"/>
+ <Detect2Chars char="\" char1="&quot;"/>
+ </context>
+
+ <context name="connect" attribute="Articulation" lineEndContext="#stay"
+ fallthrough="true" fallthroughContext="#pop">
+ <AnyChar String=".-+|&gt;^_12345" attribute="Articulation" context="#pop"/>
+ </context>
+
+ <!-- Scheme -->
+ <context name="scheme" attribute="Scheme" lineEndContext="#stay"
+ fallthrough="true" fallthroughContext="scheme2">
+ <DetectSpaces/>
+ </context>
+
+ <context name="scheme2" attribute="Scheme" lineEndContext="#pop#pop">
+ <DetectChar char="(" attribute="Scheme Keyword" context="scheme3" beginRegion="scheme"/>
+ <IncludeRules context="schemerules"/>
+ <DetectSpaces lookAhead="true" context="#pop#pop"/>
+ </context>
+
+ <context name="scheme3" attribute="Scheme" lineEndContext="#stay">
+ <DetectChar char=")" attribute="Scheme Keyword" context="#pop#pop#pop" endRegion="scheme"/>
+ <IncludeRules context="schemerules"/>
+ </context>
+
+ <context name="schemerules" attribute="Scheme" lineEndContext="#stay">
+ <DetectChar char="(" context="schemerules" beginRegion="scheme"/>
+ <DetectChar char=")" context="#pop" endRegion="scheme"/>
+ <DetectChar char="&quot;" context="schemestring"/>
+ <DetectChar char=";" context="schemecommentline"/>
+ <DetectChar char="$" context="schemesub"/>
+ <DetectChar char="'" context="schemequote"/>
+ <Detect2Chars char="#" char1="!" context="schemecommentblock" beginRegion="schemecomment"/>
+ <Detect2Chars char="#" char1="{" attribute="Scheme Keyword" context="schemelily" beginRegion="schemelily"/>
+ <keyword String="musicexpressions" attribute="Scheme Keyword"/>
+ <keyword String="contexts" attribute="Scheme Keyword"/>
+ <keyword String="layoutobjects" attribute="Scheme Keyword"/>
+ <RegExpr String="[-+]?(\d+(\.\d+)?|\.\d+)" attribute="Scheme Value"/>
+ <RegExpr String="#(t|f|b[-+]?[01.]+|o[-+]?[0-7.]+|d[-+]?[0-9.]+|x[-+]?[0-9a-f.]+)"
+ insensitive="true" attribute="Scheme Value"/>
+ <RegExpr String="[+-](inf|nan)\.0" attribute="Scheme Value"/>
+ <RegExpr String="&schemefunc;" attribute="Scheme Keyword"/>
+ <RegExpr String="&schemename;"/>
+ </context>
+
+ <context name="schemequote" attribute="Scheme" lineEndContext="#pop"
+ fallthrough="true" fallthroughContext="#pop">
+ <RegExpr String="&schemefunc;"/>
+ </context>
+
+ <context name="schemelily" attribute="Normal Text" lineEndContext="#stay">
+ <Detect2Chars char="#" char1="}" attribute="Scheme Keyword" context="#pop" endRegion="schemelily"/>
+ <IncludeRules context="lilypond"/>
+ </context>
+
+ <context name="schemecommentline" attribute="Scheme Comment" lineEndContext="#pop">
+ <IncludeRules context="##Alerts"/>
+ </context>
+
+ <context name="schemecommentblock" attribute="Scheme Comment" lineEndContext="#stay">
+ <Detect2Chars char="!" char1="#" attribute="Scheme Comment" context="#pop" endRegion="schemecomment"/>
+ <IncludeRules context="##Alerts"/>
+ </context>
+
+ <context name="schemesub" attribute="Scheme Subst" lineEndContext="#pop"
+ fallthrough="true" fallthroughContext="#pop">
+ <RegExpr String="&schemename;" attribute="Scheme Subst" context="#pop"/>
+ </context>
+
+ <context name="schemestring" attribute="Scheme String" lineEndContext="#stay">
+ <DetectChar char="&quot;" attribute="Scheme String" context="#pop"/>
+ <RegExpr String="\\[0fnrtav\\&quot;]"/>
+ </context>
+
+ <!-- NoteMode -->
+ <context name="notemode" attribute="Other Mode" lineEndContext="#stay"
+ fallthrough="true" fallthroughContext="#pop">
+ <DetectChar char="{" attribute="Keyword" context="notemode2" beginRegion="sequential"/>
+ <DetectSpaces/>
+ </context>
+
+ <context name="notemode2" attribute="Normal Text" lineEndContext="#stay">
+ <DetectChar char="}" attribute="Keyword" context="#pop#pop" endRegion="sequential"/>
+ <IncludeRules context="noterules"/>
+ </context>
+
+ <context name="noterules" attribute="Normal Text" lineEndContext="#stay">
+ <DetectChar char="{" attribute="Keyword" context="noterules" beginRegion="sequential"/>
+ <DetectChar char="}" attribute="Keyword" context="#pop" endRegion="sequential"/>
+ <IncludeRules context="music"/>
+ </context>
+
+ <!-- Drummode -->
+ <context name="drummode" attribute="Other Mode" lineEndContext="#stay"
+ fallthrough="true" fallthroughContext="#pop">
+ <DetectChar char="{" attribute="Keyword" context="drummode2" beginRegion="sequential"/>
+ <DetectSpaces/>
+ </context>
+
+ <context name="drummode2" attribute="Normal Text" lineEndContext="#stay">
+ <DetectChar char="}" attribute="Keyword" context="#pop#pop" endRegion="sequential"/>
+ <IncludeRules context="drumrules"/>
+ </context>
+
+ <context name="drumrules" attribute="Normal Text" lineEndContext="#stay">
+ <DetectChar char="{" attribute="Keyword" context="drumrules" beginRegion="sequential"/>
+ <DetectChar char="}" attribute="Keyword" context="#pop" endRegion="sequential"/>
+ <keyword attribute="Other Text" String="drumpitchnames" context="duration"/>
+ <IncludeRules context="music"/>
+ </context>
+
+ <!-- Chordmode -->
+ <context name="chordmode" attribute="Other Mode" lineEndContext="#stay"
+ fallthrough="true" fallthroughContext="#pop">
+ <DetectChar char="{" attribute="Keyword" context="chordmode2" beginRegion="sequential"/>
+ <DetectSpaces/>
+ </context>
+
+ <context name="chordmode2" attribute="Normal Text" lineEndContext="#stay">
+ <DetectChar char="}" attribute="Keyword" context="#pop#pop" endRegion="sequential"/>
+ <IncludeRules context="chordrules"/>
+ </context>
+
+ <context name="chordrules" attribute="Normal Text" lineEndContext="#stay">
+ <DetectChar char="{" attribute="Keyword" context="chordrules" beginRegion="sequential"/>
+ <DetectChar char="}" attribute="Keyword" context="#pop" endRegion="sequential"/>
+ <RegExpr attribute="Other Text" String=":?([\.^]?\d+[-+]?|(m|dim|aug|maj|sus)&b;)*(/\+?&pitch;)?"/>
+ <IncludeRules context="music"/>
+ </context>
+
+ <!-- Figuremode -->
+ <context name="figuremode" attribute="Other Mode" lineEndContext="#stay"
+ fallthrough="true" fallthroughContext="#pop">
+ <DetectChar char="{" attribute="Keyword" context="figuremode2" beginRegion="sequential"/>
+ <DetectSpaces/>
+ </context>
+
+ <context name="figuremode2" attribute="Normal Text" lineEndContext="#stay">
+ <DetectChar char="}" attribute="Keyword" context="#pop#pop" endRegion="sequential"/>
+ <IncludeRules context="figurerules"/>
+ </context>
+
+ <context name="figurerules" attribute="Normal Text" lineEndContext="#stay">
+ <DetectChar char="{" attribute="Keyword" context="figurerules" beginRegion="sequential"/>
+ <DetectChar char="}" attribute="Keyword" context="#pop" endRegion="sequential"/>
+ <DetectChar char="&lt;" attribute="Chord" context="figure"/>
+ <RegExpr String="&rest;" attribute="Pitch" context="duration"/>
+ <IncludeRules context="default"/>
+ </context>
+
+ <context name="figure" attribute="Normal Text" lineEndContext="#stay">
+ <DetectChar char="&gt;" attribute="Chord" context="chordend"/>
+ <IncludeRules context="basic"/>
+ <RegExpr String="\\markup(lines)?&b;" attribute="Markup" context="markup"/>
+ <RegExpr String="\\skip&b;" attribute="Command" context="duration"/>
+ </context>
+
+ <!-- Lyrics -->
+ <context name="lyricmode" attribute="Lyricmode" lineEndContext="#stay"
+ fallthrough="true" fallthroughContext="#pop">
+ <DetectChar char="{" attribute="Keyword" context="lyricmode2" beginRegion="sequential"/>
+ <DetectSpaces/>
+ </context>
+
+ <context name="lyricmode2" attribute="Lyric Text" lineEndContext="#stay">
+ <DetectChar char="}" attribute="Keyword" context="#pop#pop" endRegion="sequential"/>
+ <IncludeRules context="lyricrules"/>
+ </context>
+
+ <!-- LyricsTo has extra parameter -->
+ <context name="lyricsto" attribute="Lyricmode" lineEndContext="#stay"
+ fallthrough="true" fallthroughContext="#pop">
+ <RegExpr String="&quot;(\\[&quot;\\]|[^&quot;\\])+&quot;" attribute="Quoted Text" context="lyricsto2"/>
+ <RegExpr String="[A-Za-z]+" attribute="Normal Text" context="lyricsto2"/>
+ <DetectSpaces/>
+ </context>
+
+ <context name="lyricsto2" attribute="Normal Text" lineEndContext="#stay"
+ fallthrough="true" fallthroughContext="#pop#pop">
+ <DetectChar char="{" attribute="Keyword" context="lyricsto3" beginRegion="sequential"/>
+ <DetectSpaces/>
+ </context>
+
+ <context name="lyricsto3" attribute="Lyric Text" lineEndContext="#stay">
+ <DetectChar char="}" attribute="Keyword" context="#pop#pop#pop" endRegion="sequential"/>
+ <IncludeRules context="lyricrules"/>
+ </context>
+
+ <context name="lyricrules" attribute="Lyric Text" lineEndContext="#stay">
+ <DetectChar char="{" attribute="Keyword" context="lyricrules" beginRegion="sequential"/>
+ <DetectChar char="}" attribute="Keyword" context="#pop" endRegion="sequential"/>
+ <RegExpr String="(\w+-{2,}|\w+_{2,}|-{2,}\w+|_{2,}\w+)" attribute="Invalid"/><!-- two hyphens or underscores run together with a word -->
+ <RegExpr String="&duration;" attribute="Duration"/>
+ <RegExpr String="(--|__|_)" attribute="Lyricmode"/>
+ <IncludeRules context="default"/>
+ <RegExpr String="\S+\}" attribute="Invalid" context="#pop" endRegion="sequential"/>
+ </context>
+
+ <!-- Markup -->
+ <context name="markup" attribute="Normal Text" lineEndContext="#stay"
+ fallthrough="true" fallthroughContext="#pop">
+ <DetectChar char="{" attribute="Keyword" context="markup2" beginRegion="markup"/>
+ <DetectSpaces/>
+ <RegExpr String="\\score\b" attribute="Markup" context="notemode"/>
+ <RegExpr String="\\(&markupwithtextargs;)&b;" attribute="Markup"/>
+ <RegExpr String="\\(&markupnotextargs;)&b;" attribute="Markup" context="#pop"/>
+ <DetectChar char="#" context="scheme"/>
+ <RegExpr String="[^&quot;\s\\#%{}$]+" attribute="Normal Text" context="#pop"/>
+ </context>
+
+ <context name="markup2" attribute="Normal Text" lineEndContext="#stay">
+ <DetectChar char="}" attribute="Keyword" context="#pop#pop" endRegion="markup"/>
+ <IncludeRules context="markuprules"/>
+ </context>
+
+ <context name="markuprules" attribute="Normal Text" lineEndContext="#stay">
+ <DetectChar char="}" attribute="Keyword" context="#pop" endRegion="markup"/>
+ <DetectChar char="{" attribute="Keyword" context="markuprules" beginRegion="markup"/>
+ <RegExpr String="\\score\b" attribute="Markup" context="notemode"/>
+ <RegExpr String="\\(&markupnotextargs;|&markupwithtextargs;)&b;" attribute="Markup"/>
+ <RegExpr String="\\(&deprecatedmarkup;)&b;" attribute="Deprecated Markup"/>
+ <RegExpr String="\\[A-Za-z]+(-[A-Za-z]+)*" attribute="User Command"/>
+ <IncludeRules context="basic"/>
+ </context>
+
+ <!-- \paper, \layout, \midi, \header, \with -->
+ <context name="section" attribute="Keyword" lineEndContext="#stay"
+ fallthrough="true" fallthroughContext="#pop">
+ <DetectChar char="{" attribute="Keyword" context="section2" beginRegion="section"/>
+ <DetectSpaces/>
+ </context>
+
+ <context name="section2" attribute="Normal Text" lineEndContext="#stay">
+ <DetectChar char="}" attribute="Keyword" context="#pop#pop" endRegion="section"/>
+ <IncludeRules context="sectionrules"/>
+ </context>
+
+ <context name="sectionrules" attribute="Normal Text" lineEndContext="#stay">
+ <DetectChar char="}" attribute="Keyword" context="#pop" endRegion="section"/>
+ <DetectChar char="{" attribute="Keyword" context="sectionrules" beginRegion="section"/>
+ <keyword String="contexts" attribute="Context"/>
+ <keyword String="layoutobjects" attribute="Layout Object"/>
+ <keyword String="properties" attribute="Property"/>
+ <keyword String="deprecatedproperties" attribute="Deprecated Property"/>
+ <RegExpr String="\b(&headervars;|&papervars;|&layoutvars;)\b" attribute="Variable"/>
+ <RegExpr String="(&quot;?)\b(&engravers;)\b\1" attribute="Engraver"/>
+ <IncludeRules context="default"/>
+ </context>
+
+ <!-- \new, \context, \change -->
+ <context name="context" attribute="Normal Text" lineEndContext="#stay"
+ fallthrough="true" fallthroughContext="#pop">
+ <DetectSpaces/>
+ <keyword String="contexts" attribute="Context" context="context2"/>
+ <RegExpr String="[A-Za-z]+" attribute="User Command" context="context2"/>
+ <DetectChar char="{" attribute="Keyword" context="section2" beginRegion="section"/>
+ </context>
+
+ <context name="context2" attribute="Normal Text" lineEndContext="#stay"
+ fallthrough="true" fallthroughContext="#pop#pop">
+ <DetectSpaces/>
+ <RegExpr String="=(\s*[A-Za-z]+)?" attribute="Normal Text" context="#pop#pop"/>
+ </context>
+
+ <!-- \set, \unset -->
+ <context name="set" attribute="Normal Text" lineEndContext="#stay"
+ fallthrough="true" fallthroughContext="#pop">
+ <DetectSpaces/>
+ <keyword String="contexts" attribute="Context"/>
+ <DetectChar char="."/>
+ <keyword String="properties" attribute="Property" context="#pop"/>
+ <keyword String="deprecatedproperties" attribute="Deprecated Property" context="#pop"/>
+ <RegExpr String="[A-Za-z]+" attribute="User Command" context="#pop"/>
+ </context>
+
+ <!-- \override, \overrideProperty, \revert -->
+ <context name="override" attribute="Normal Text" lineEndContext="#stay"
+ fallthrough="true" fallthroughContext="#pop">
+ <DetectSpaces/>
+ <keyword String="contexts" attribute="Context"/>
+ <DetectChar char="."/>
+ <keyword String="layoutobjects" attribute="Layout Object" context="#pop"/>
+ <RegExpr String="[A-Za-z]+(?=\s*\.)" attribute="User Command"/>
+ <RegExpr String="[A-Za-z]+" attribute="User Command" context="#pop"/>
+ </context>
+ </contexts>
+ <itemDatas>
+ <itemData name="Pitch" defStyleNum="dsNormal"/>
+ <itemData name="Duration" defStyleNum="dsDataType"/>
+ <itemData name="Slur" defStyleNum="dsChar" bold="true"/>
+ <itemData name="Dynamic" defStyleNum="dsString" color="#ee5000" bold="true"/>
+ <itemData name="Articulation" defStyleNum="dsString" color="#ee5000" bold="true"/>
+ <itemData name="Chord" defStyleNum="dsDataType" bold="true"/>
+ <itemData name="Beam" defStyleNum="dsDataType" bold="true"/>
+ <itemData name="Check" defStyleNum="dsDecVal"/>
+ <itemData name="Repeat" defStyleNum="dsDataType" italic="true"/>
+ <itemData name="Keyword" defStyleNum="dsKeyword"/>
+ <itemData name="Command" defStyleNum="dsFunction" bold="true"/>
+ <itemData name="User Command" defStyleNum="dsFunction"/>
+ <itemData name="Context" defStyleNum="dsDataType" bold="true"/>
+ <itemData name="Layout Object" defStyleNum="dsDataType"/>
+ <itemData name="Property" defStyleNum="dsDataType"/>
+ <itemData name="Variable" defStyleNum="dsDataType"/>
+ <itemData name="Engraver" defStyleNum="dsDataType"/>
+ <itemData name="Markup" defStyleNum="dsBaseN" color="#009817"/>
+ <itemData name="Lyricmode" defStyleNum="dsKeyword" color="#007010"/>
+ <itemData name="Lyric Text" defStyleNum="dsNormal" color="#007010"/>
+ <itemData name="Other Mode" defStyleNum="dsKeyword" color="#0094e4"/>
+ <itemData name="Other Text" defStyleNum="dsNormal" color="#0094e4"/>
+ <itemData name="Normal Text" defStyleNum="dsNormal"/>
+ <itemData name="Quoted Text" defStyleNum="dsString"/>
+ <itemData name="Comment" defStyleNum="dsComment"/>
+ <itemData name="Scheme" defStyleNum="dsFloat" backgroundColor="#fff6ff"/>
+ <itemData name="Scheme Keyword" defStyleNum="dsFloat" bold="true" backgroundColor="#fff6ff"/>
+ <itemData name="Scheme Subst" defStyleNum="dsDecVal" bold="true" backgroundColor="#fff6ff"/>
+ <itemData name="Scheme Value" defStyleNum="dsDecVal" backgroundColor="#fff6ff"/>
+ <itemData name="Scheme String" defStyleNum="dsString" backgroundColor="#fff6ff"/>
+ <itemData name="Scheme Comment" defStyleNum="dsComment" backgroundColor="#fff6ff"/>
+ <itemData name="Deprecated Keyword" defStyleNum="dsKeyword" backgroundColor="#fcc"/>
+ <itemData name="Deprecated Command" defStyleNum="dsFunction" backgroundColor="#fcc"/>
+ <itemData name="Deprecated Property" defStyleNum="dsDataType" backgroundColor="#fcc"/>
+ <itemData name="Deprecated Markup" defStyleNum="dsBaseN" color="#009817" backgroundColor="#fcc"/>
+ <itemData name="Invalid" defStyleNum="dsError"/>
+ </itemDatas>
+ </highlighting>
+ <general>
+ <comments>
+ <comment name="singleLine" start="%"/>
+ <comment name="multiLine" start="%{" end="%}" region="comment"/>
+ </comments>
+ <keywords casesensitive="true" additionalDeliminator="'_0123456789"/>
+ </general>
+
+</language>
+<!--
+ // kate: space-indent on; indent-width 2; replace-tabs on; dynamic-word-wrap off;
+ -->
diff --git a/kate/data/list-keywords-ldif.awk b/kate/data/list-keywords-ldif.awk
new file mode 100644
index 000000000..fc693c3c3
--- /dev/null
+++ b/kate/data/list-keywords-ldif.awk
@@ -0,0 +1,38 @@
+#!/bin/awk -f
+
+function printName (name)
+{
+ if ((name != "") && (name != "(") && (name != ")")) print type, name;
+}
+
+function printNames (str)
+{
+ s = substr(str,index(str,"NAME")+4);
+ split (s, a, " ");
+# for (i=0; i<length(a); i++) {
+# print type,a[i]
+# }
+ # ATTENTION: The loop above does not work for some strange reason.
+ # The following statements imitate it for a limited amount of elements.
+ # If you happen to have more then the ones given here, you have to extend it!
+ printName(a[0]);
+ printName(a[1]);
+ printName(a[2]);
+ printName(a[3]);
+}
+
+BEGIN {
+ type="";
+}
+
+/attributetype/ {
+ type="attributetype";
+}
+
+/objectclass/ {
+ type="objectclass";
+}
+
+/ NAME / {
+ printNames($0);
+}
diff --git a/kate/data/list-keywords-ldif.sh b/kate/data/list-keywords-ldif.sh
new file mode 100644
index 000000000..d2290f670
--- /dev/null
+++ b/kate/data/list-keywords-ldif.sh
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+list_keywords=./list-keywords-ldif.awk
+schemas="$@"
+
+echo " <list name=\"attributetypes\">"
+cat $schemas | $list_keywords | grep "attributetype" | grep -v '^#' | sed -e "s/'//g" | sort -u | awk '{print " <item>"$2"</item>"}'
+echo " </list>"
+echo " <list name=\"objectclasses\">"
+cat $schemas | $list_keywords | grep "objectclass" | grep -v '^#' | sed -e "s/'//g" | sort -u | awk '{print " <item>"$2"</item>"}'
+echo " </list>"
+
diff --git a/kate/data/literate-haskell.xml b/kate/data/literate-haskell.xml
new file mode 100644
index 000000000..5ed0f8893
--- /dev/null
+++ b/kate/data/literate-haskell.xml
@@ -0,0 +1,386 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+<language name="Literate Haskell" version="1.04" kateversion="2.4" section="Sources" extensions="*.lhs" author="Marcel Martin (mmar@freenet.de)" license="">
+ <highlighting>
+ <list name="keywords">
+ <item> case </item>
+ <item> class </item>
+ <item> data </item>
+ <item> deriving </item>
+ <item> do </item>
+ <item> else </item>
+ <item> if </item>
+ <item> in </item>
+ <item> infixl </item>
+ <item> infixr </item>
+ <item> instance </item>
+ <item> let </item>
+ <item> module </item>
+ <item> of </item>
+ <item> primitive </item>
+ <item> then </item>
+ <item> type </item>
+ <item> where </item>
+ </list>
+ <list name="infix operators">
+ <item> quot </item>
+ <item> rem </item>
+ <item> div </item>
+ <item> mod </item>
+ <item> elem </item>
+ <item> notElem </item>
+ <item> seq </item>
+ </list>
+ <list name="functions">
+ <!--
+ These operators are not handled yet.
+ <item> !! </item>
+ <item> % </item>
+ <item> && </item>
+ <item> $! </item>
+ <item> $ </item>
+ <item> * </item>
+ <item> ** </item>
+ <item> - </item>
+ <item> . </item>
+ <item> /= </item>
+ <item> < </item>
+ <item> <= </item>
+ <item> =<< </item>
+ <item> == </item>
+ <item> > </item>
+ <item> >= </item>
+ <item> >> </item>
+ <item> >>= </item>
+ <item> ^ </item>
+ <item> ^^ </item>
+ <item> ++ </item>
+ <item> || </item>
+ //-->
+
+ <item> FilePath </item>
+ <item> IOError </item>
+ <item> abs </item>
+ <item> acos </item>
+ <item> acosh </item>
+ <item> all </item>
+ <item> and </item>
+ <item> any </item>
+ <item> appendFile </item>
+ <item> approxRational </item>
+ <item> asTypeOf </item>
+ <item> asin </item>
+ <item> asinh </item>
+ <item> atan </item>
+ <item> atan2 </item>
+ <item> atanh </item>
+ <item> basicIORun </item>
+ <item> break </item>
+ <item> catch </item>
+ <item> ceiling </item>
+ <item> chr </item>
+ <item> compare </item>
+ <item> concat </item>
+ <item> concatMap </item>
+ <item> const </item>
+ <item> cos </item>
+ <item> cosh </item>
+ <item> curry </item>
+ <item> cycle </item>
+ <item> decodeFloat </item>
+ <item> denominator </item>
+ <item> digitToInt </item>
+ <item> div </item>
+ <item> divMod </item>
+ <item> drop </item>
+ <item> dropWhile </item>
+ <item> either </item>
+ <item> elem </item>
+ <item> encodeFloat </item>
+ <item> enumFrom </item>
+ <item> enumFromThen </item>
+ <item> enumFromThenTo </item>
+ <item> enumFromTo </item>
+ <item> error </item>
+ <item> even </item>
+ <item> exp </item>
+ <item> exponent </item>
+ <item> fail </item>
+ <item> filter </item>
+ <item> flip </item>
+ <item> floatDigits </item>
+ <item> floatRadix </item>
+ <item> floatRange </item>
+ <item> floor </item>
+ <item> fmap </item>
+ <item> foldl </item>
+ <item> foldl1 </item>
+ <item> foldr </item>
+ <item> foldr1 </item>
+ <item> fromDouble </item>
+ <item> fromEnum </item>
+ <item> fromInt </item>
+ <item> fromInteger </item>
+ <item> fromIntegral </item>
+ <item> fromRational </item>
+ <item> fst </item>
+ <item> gcd </item>
+ <item> getChar </item>
+ <item> getContents </item>
+ <item> getLine </item>
+ <item> head </item>
+ <item> id </item>
+ <item> inRange </item>
+ <item> index </item>
+ <item> init </item>
+ <item> intToDigit </item>
+ <item> interact </item>
+ <item> ioError </item>
+ <item> isAlpha </item>
+ <item> isAlphaNum </item>
+ <item> isAscii </item>
+ <item> isControl </item>
+ <item> isDenormalized </item>
+ <item> isDigit </item>
+ <item> isHexDigit </item>
+ <item> isIEEE </item>
+ <item> isInfinite </item>
+ <item> isLower </item>
+ <item> isNaN </item>
+ <item> isNegativeZero </item>
+ <item> isOctDigit </item>
+ <item> isPrint </item>
+ <item> isSpace </item>
+ <item> isUpper </item>
+ <item> iterate </item>
+ <item> last </item>
+ <item> lcm </item>
+ <item> length </item>
+ <item> lex </item>
+ <item> lexDigits </item>
+ <item> lexLitChar </item>
+ <item> lines </item>
+ <item> log </item>
+ <item> logBase </item>
+ <item> lookup </item>
+ <item> map </item>
+ <item> mapM </item>
+ <item> mapM_ </item>
+ <item> max </item>
+ <item> maxBound </item>
+ <item> maximum </item>
+ <item> maybe </item>
+ <item> min </item>
+ <item> minBound </item>
+ <item> minimum </item>
+ <item> mod </item>
+ <item> negate </item>
+ <item> not </item>
+ <item> notElem </item>
+ <item> null </item>
+ <item> numerator </item>
+ <item> odd </item>
+ <item> or </item>
+ <item> ord </item>
+ <item> otherwise </item>
+ <item> pi </item>
+ <item> pred </item>
+ <item> primExitWith </item>
+ <item> print </item>
+ <item> product </item>
+ <item> properFraction </item>
+ <item> putChar </item>
+ <item> putStr </item>
+ <item> putStrLn </item>
+ <item> quot </item>
+ <item> quotRem </item>
+ <item> range </item>
+ <item> rangeSize </item>
+ <item> read </item>
+ <item> readDec </item>
+ <item> readFile </item>
+ <item> readFloat </item>
+ <item> readHex </item>
+ <item> readIO </item>
+ <item> readInt </item>
+ <item> readList </item>
+ <item> readLitChar </item>
+ <item> readLn </item>
+ <item> readOct </item>
+ <item> readParen </item>
+ <item> readSigned </item>
+ <item> reads </item>
+ <item> readsPrec </item>
+ <item> realToFrac </item>
+ <item> recip </item>
+ <item> rem </item>
+ <item> repeat </item>
+ <item> replicate </item>
+ <item> return </item>
+ <item> reverse </item>
+ <item> round </item>
+ <item> scaleFloat </item>
+ <item> scanl </item>
+ <item> scanl1 </item>
+ <item> scanr </item>
+ <item> scanr1 </item>
+ <item> seq </item>
+ <item> sequence </item>
+ <item> sequence_ </item>
+ <item> show </item>
+ <item> showChar </item>
+ <item> showInt </item>
+ <item> showList </item>
+ <item> showLitChar </item>
+ <item> showParen </item>
+ <item> showSigned </item>
+ <item> showString </item>
+ <item> shows </item>
+ <item> showsPrec </item>
+ <item> significand </item>
+ <item> signum </item>
+ <item> sin </item>
+ <item> sinh </item>
+ <item> snd </item>
+ <item> span </item>
+ <item> splitAt </item>
+ <item> sqrt </item>
+ <item> subtract </item>
+ <item> succ </item>
+ <item> sum </item>
+ <item> tail </item>
+ <item> take </item>
+ <item> takeWhile </item>
+ <item> tan </item>
+ <item> tanh </item>
+ <item> threadToIOResult </item>
+ <item> toEnum </item>
+ <item> toInt </item>
+ <item> toInteger </item>
+ <item> toLower </item>
+ <item> toRational </item>
+ <item> toUpper </item>
+ <item> truncate </item>
+ <item> uncurry </item>
+ <item> undefined </item>
+ <item> unlines </item>
+ <item> until </item>
+ <item> unwords </item>
+ <item> unzip </item>
+ <item> unzip3 </item>
+ <item> userError </item>
+ <item> words </item>
+ <item> writeFile </item>
+ <item> zip </item>
+ <item> zip3 </item>
+ <item> zipWith </item>
+ <item> zipWith3 </item>
+ </list>
+ <list name="type constructors">
+ <item> Bool </item>
+ <item> Char </item>
+ <item> Double </item>
+ <item> Either </item>
+ <item> Float </item>
+ <item> IO </item>
+ <item> Integer </item>
+ <item> Int </item>
+ <item> Maybe </item>
+ <item> Ordering </item>
+ <item> Rational </item>
+ <item> Ratio </item>
+ <item> ReadS </item>
+ <item> ShowS </item>
+ <item> String </item>
+
+ </list>
+ <list name="classes">
+ <item> Bounded </item>
+ <item> Enum </item>
+ <item> Eq </item>
+ <item> Floating </item>
+ <item> Fractional </item>
+ <item> Functor </item>
+ <item> Integral </item>
+ <item> Ix </item>
+ <item> Monad </item>
+ <item> Num </item>
+ <item> Ord </item>
+ <item> Read </item>
+ <item> RealFloat </item>
+ <item> RealFrac </item>
+ <item> Real </item>
+ <item> Show </item>
+ </list>
+ <list name="data constructors">
+ <item> EQ </item>
+ <item> False </item>
+ <item> GT </item>
+ <item> Just </item>
+ <item> LT </item>
+ <item> Left </item>
+ <item> Nothing </item>
+ <item> Right </item>
+ <item> True </item>
+ </list>
+ <contexts>
+ <context attribute="Comment" lineEndContext="#stay" name="literate-normal">
+ <DetectChar attribute="Special" context="normal" char="&gt;" column="0"/>
+ </context>
+ <context attribute="Normal Text" lineEndContext="literate-normal" name="normal">
+ <Detect2Chars attribute="Comment" context="comment_multi_line" char="{" char1="-" />
+ <Detect2Chars attribute="Comment" context="comment_single_line" char="-" char1="-" />
+ <keyword attribute="Keyword" context="#stay" String="keywords" />
+ <keyword attribute="Class" context="#stay" String="classes" />
+ <keyword attribute="Type Constructor" context="#stay" String="type constructors" />
+ <keyword attribute="Function" context="#stay" String="functions" />
+ <keyword attribute="Data Constructor" context="#stay" String="data constructors" />
+ <DetectChar attribute="String" context="string" char="&quot;" />
+ <DetectChar attribute="Infix Operator" context="infix" char="`"/>
+ <RegExpr attribute="Normal Text" context="#stay" String="\w[']+" />
+ <DetectChar attribute="Char" context="single_char" char="'" />
+ <RegExpr attribute="Function Definition" context="#stay" String="\s*[a-z_]+\w*'*\s*::" />
+ <Float attribute="Float" context="#stay" />
+ <Int attribute="Decimal" context="#stay" />
+ </context>
+ <context attribute="Comment" lineEndContext="#pop" name="comment_single_line" />
+ <context attribute="Comment" lineEndContext="#stay" name="comment_multi_line">
+ <Detect2Chars attribute="Comment" context="#pop" char="-" char1="}" />
+ </context>
+ <context attribute="String" lineEndContext="#stay" name="string">
+ <RegExpr attribute="String" context="#stay" String="\\." />
+ <DetectChar attribute="String" context="#pop" char="&quot;" />
+ </context>
+ <context attribute="Infix Operator" lineEndContext="#stay" name="infix">
+ <DetectChar attribute="Infix Operator" context="#pop" char="`"/>
+ </context>
+ <context attribute="Char" lineEndContext="#pop" name="single_char">
+ <RegExpr attribute="Char" context="#stay" String="\\." />
+ <DetectChar attribute="Char" context="#pop" char="'" />
+ </context>
+ <context attribute="Function Definition" lineEndContext="#pop" name="function_definition">
+ <DetectChar attribute="Function Definition" context="#pop" char=";" />
+ </context>
+ </contexts>
+ <itemDatas>
+ <itemData name="Normal Text" defStyleNum="dsNormal"/>
+ <itemData name="Keyword" defStyleNum="dsKeyword"/>
+ <itemData name="Function" defStyleNum="dsFunction"/>
+ <itemData name="Function Definition" defStyleNum="dsFunction"/>
+ <itemData name="Class" defStyleNum="dsKeyword"/>
+ <itemData name="Decimal" defStyleNum="dsDecVal"/>
+ <itemData name="Float" defStyleNum="dsFloat"/>
+ <itemData name="Char" defStyleNum="dsChar"/>
+ <itemData name="String" defStyleNum="dsString"/>
+ <itemData name="Constructor" defStyleNum="dsOthers"/>
+ <itemData name="Comment" defStyleNum="dsComment"/>
+ <itemData name="Data Constructor" defStyleNum="dsKeyword"/>
+ <itemData name="Type Constructor" defStyleNum="dsDataType"/>
+ <itemData name="Infix Operator" defStyleNum="dsOthers"/>
+ <itemData name="Special" defStyleNum="dsChar"/>
+ </itemDatas>
+ </highlighting>
+ <general>
+ <keywords casesensitive="1" />
+ </general>
+</language>
diff --git a/kate/data/logtalk.xml b/kate/data/logtalk.xml
new file mode 100644
index 000000000..17e130c8f
--- /dev/null
+++ b/kate/data/logtalk.xml
@@ -0,0 +1,206 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+
+<language name="Logtalk" version="1.51" kateversion="2.4" section="Sources" extensions="*.lgt;*.config" mimetype="text/x-logtalk" author="Paulo Moura (pmoura@logtalk.org)" license="Artistic License 2.0">
+
+ <highlighting>
+
+ <contexts>
+
+ <context name = "normal" attribute = "Normal" lineEndContext = "#stay" >
+ <!-- Directives -->
+ <RegExpr String = "^\s*:-" attribute = "Normal" context = "directive" />
+ <!-- Event handlers -->
+ <RegExpr String = "\b(after|before)(?=[(])" attribute = "Built-in" context = "#stay" />
+ <!-- Method execution context -->
+ <RegExpr String = "\b(parameter|this|se(lf|nder))(?=[(])" attribute = "Built-in" context = "#stay" />
+ <!-- Reflection -->
+ <RegExpr String = "\b(current_predicate|predicate_property)(?=[(])" attribute = "Built-in" context = "#stay" />
+ <!-- DCGs -->
+ <RegExpr String = "\b(expand_term|term_expansion|phrase)(?=[(])" attribute = "Built-in" context = "#stay" />
+ <!-- Entity -->
+ <RegExpr String = "\b(abolish|c(reate|urrent))_(object|protocol|category)(?=[(])" attribute = "Built-in" context = "#stay" />
+ <RegExpr String = "\b(object|protocol|category)_property(?=[(])" attribute = "Built-in" context = "#stay" />
+ <!-- Entity relations -->
+ <RegExpr String = "\bextends_(object|protocol)(?=[(])" attribute = "Built-in" context = "#stay" />
+ <RegExpr String = "\bimplements_protocol(?=[(])" attribute = "Built-in" context = "#stay" />
+ <RegExpr String = "\b(instantiates|specializes)_class(?=[(])" attribute = "Built-in" context = "#stay" />
+ <RegExpr String = "\bimports_category(?=[(])" attribute = "Built-in" context = "#stay" />
+ <!-- Events -->
+ <RegExpr String = "\b(current_event|(abolish|define)_events)(?=[(])" attribute = "Built-in" context = "#stay" />
+ <!-- Flags -->
+ <RegExpr String = "\b(current|set)_logtalk_flag(?=[(])" attribute = "Built-in" context = "#stay" />
+ <!-- Compiling, loading, and library paths -->
+ <RegExpr String = "\blogtalk_(compile|l(ibrary_path|oad))(?=[(])" attribute = "Built-in" context = "#stay" />
+ <!-- Database -->
+ <RegExpr String = "\b(clause|retract(all)?)(?=[(])" attribute = "Built-in" context = "#stay" />
+ <RegExpr String = "\ba(bolish|ssert(a|z))(?=[(])" attribute = "Built-in" context = "#stay" />
+ <!-- Control -->
+ <RegExpr String = "\b(ca(ll|tch)|throw)(?=[(])" attribute = "Built-in" context = "#stay" />
+ <RegExpr String = "\b(fail|true)\b" attribute = "Built-in" context = "#stay" />
+ <!-- All solutions -->
+ <RegExpr String = "\b((bag|set)of|f(ind|or)all)(?=[(])" attribute = "Built-in" context = "#stay" />
+ <!-- Term unification -->
+ <RegExpr String = "\bunify_with_occurs_check(?=[(])" attribute = "Built-in" context = "#stay" />
+ <!-- Term creation and decomposition -->
+ <RegExpr String = "\b(functor|arg|copy_term)(?=[(])" attribute = "Built-in" context = "#stay" />
+ <!-- Evaluable functors -->
+ <RegExpr String = "\b(rem|mod|abs|sign)(?=[(])" attribute = "Built-in" context = "#stay" />
+ <RegExpr String = "\bfloat(_(integer|fractional)_part)?(?=[(])" attribute = "Built-in" context = "#stay" />
+ <RegExpr String = "\b(floor|truncate|round|ceiling)(?=[(])" attribute = "Built-in" context = "#stay" />
+ <!-- Other arithmetic functors -->
+ <RegExpr String = "\b(cos|atan|exp|log|s(in|qrt))(?=[(])" attribute = "Built-in" context = "#stay" />
+ <!-- Term testing -->
+ <RegExpr String = "\b(var|atom(ic)?|integer|float|compound|n(onvar|umber))(?=[(])" attribute = "Built-in" context = "#stay" />
+ <!-- Stream selection and control -->
+ <RegExpr String = "\b(current|set)_(in|out)put(?=[(])" attribute = "Built-in" context = "#stay" />
+ <RegExpr String = "\b(open|close)(?=[(])" attribute = "Built-in" context = "#stay" />
+ <RegExpr String = "\bflush_output(?=[(])" attribute = "Built-in" context = "#stay" />
+ <RegExpr String = "\bflush_output\b" attribute = "Built-in" context = "#stay" />
+ <RegExpr String = "\b(stream_property|at_end_of_stream|set_stream_position)(?=[(])" attribute = "Built-in" context = "#stay" />
+ <!-- Character and byte input/output -->
+ <RegExpr String = "\b(nl|(get|peek|put)_(byte|c(har|ode)))(?=[(])" attribute = "Built-in" context = "#stay" />
+ <RegExpr String = "\bnl\b" attribute = "Built-in" context = "#stay" />
+ <!-- Term input/output -->
+ <RegExpr String = "\bread(_term)?(?=[(])" attribute = "Built-in" context = "#stay" />
+ <RegExpr String = "\bwrite(q|_(canonical|term))?(?=[(])" attribute = "Built-in" context = "#stay" />
+ <RegExpr String = "\b(current_)?op(?=[(])" attribute = "Built-in" context = "#stay" />
+ <RegExpr String = "\b(current_)?char_conversion(?=[(])" attribute = "Built-in" context = "#stay" />
+ <!-- Atomic term processing -->
+ <RegExpr String = "\batom_(length|c(hars|o(ncat|des)))(?=[(])" attribute = "Built-in" context = "#stay" />
+ <RegExpr String = "\b(char_code|sub_atom)(?=[(])" attribute = "Built-in" context = "#stay" />
+ <RegExpr String = "\bnumber_c(hars|odes)(?=[(])" attribute = "Built-in" context = "#stay" />
+ <!-- Implementation defined hooks functions -->
+ <RegExpr String = "\b(set|current)_prolog_flag(?=[(])" attribute = "Built-in" context = "#stay" />
+ <RegExpr String = "\bhalt\b" attribute = "Built-in" context = "#stay" />
+ <RegExpr String = "\bhalt(?=[(])" attribute = "Built-in" context = "#stay" />
+ <!-- Variables -->
+ <RegExpr String = "\b[A-Z_]\w*" attribute = "Variable" context = "#stay" />
+ <!-- Comments -->
+ <DetectChar char = "%" attribute = "Comment" context = "single line comment" />
+ <Detect2Chars char = "/" char1 = "*" attribute = "Comment" context = "multiline comment" beginRegion = "Comment" />
+ <!-- Strings and quoted atoms -->
+ <DetectChar char = "&quot;" attribute = "String" context = "string" />
+ <DetectChar char = "'" attribute = "String" context = "atom" />
+ <!-- Numbers -->
+ <RegExpr String = "0'." attribute = "Number" context = "#stay" />
+ <RegExpr String = "0b[0-1]+" attribute = "Number" context = "#stay" />
+ <RegExpr String = "0o[0-7]+" attribute = "Number" context = "#stay" />
+ <RegExpr String = "0x[0-9a-fA-F]+" attribute = "Number" context = "#stay" />
+ <RegExpr String = "\d+(\.\d+)?([eE]([-+])?\d+)?" attribute = "Number" context = "#stay" />
+ <!-- Message sending operators -->
+ <Detect2Chars char = ":" char1 = ":" attribute = "Operator" context = "#stay" />
+ <Detect2Chars char = "^" char1 = "^" attribute = "Operator" context = "#stay" />
+ <!-- External call -->
+ <DetectChar char = "{" attribute = "Operator" context = "#stay" beginRegion="external" />
+ <DetectChar char = "}" attribute = "Operator" context = "#stay" endRegion="external" />
+ <!-- Logic and control -->
+ <RegExpr String = "\bonce(?=[(])" attribute = "Built-in" context = "#stay" />
+ <RegExpr String = "\brepeat\b" attribute = "Built-in" context = "#stay" />
+ <!-- Bitwise functors -->
+ <Detect2Chars char = "&gt;" char1 = "&gt;" attribute = "Operator" context = "#stay" />
+ <Detect2Chars char = "&lt;" char1 = "&lt;" attribute = "Operator" context = "#stay" />
+ <Detect2Chars char = "/" char1 = "\" attribute = "Operator" context = "#stay" />
+ <Detect2Chars char = "\" char1 = "/" attribute = "Operator" context = "#stay" />
+ <Detect2Chars char = "\" char1 = "\" attribute = "Operator" context = "#stay" />
+ <!-- Arithemtic evaluation -->
+ <RegExpr String = "\bis\b" attribute = "Operator" context = "#stay" />
+ <!-- Arithemtic comparison -->
+ <StringDetect String = "=:=" attribute = "Operator" context = "#stay" />
+ <StringDetect String = "=\=" attribute = "Operator" context = "#stay" />
+ <DetectChar char = "&lt;" attribute = "Operator" context = "#stay" />
+ <Detect2Chars char = "=" char1 = "&lt;" attribute = "Operator" context = "#stay" />
+ <DetectChar char = "&gt;" attribute = "Operator" context = "#stay" />
+ <Detect2Chars char = "&gt;" char1 = "=" attribute = "Operator" context = "#stay" />
+ <!-- Term creation and decomposition -->
+ <StringDetect String = "=.." attribute = "Operator" context = "#stay" />
+ <!-- Term unification -->
+ <DetectChar char = "=" attribute = "Operator" context = "#stay" />
+ <Detect2Chars char = "\" char1 = "=" attribute = "Operator" context = "#stay" />
+ <!-- Term comparison -->
+ <Detect2Chars char = "=" char1 = "=" attribute = "Operator" context = "#stay" />
+ <StringDetect String = "\==" attribute = "Operator" context = "#stay" />
+ <StringDetect String = "@=&lt;" attribute = "Operator" context = "#stay" />
+ <Detect2Chars char = "@" char1 = "&lt;" attribute = "Operator" context = "#stay" />
+ <StringDetect String = "@&gt;=" attribute = "Operator" context = "#stay" />
+ <Detect2Chars char = "@" char1 = "&gt;" attribute = "Operator" context = "#stay" />
+ <!-- Evaluable functors -->
+ <Detect2Chars char = "/" char1 = "/" attribute = "Operator" context = "#stay" />
+ <AnyChar String = "+-*/" attribute = "Operator" context = "#stay" />
+ <RegExpr String = "\b(mod|rem)\b" attribute = "Operator" context = "#stay" />
+ <!-- Other arithemtic functors -->
+ <Detect2Chars char = "*" char1 = "*" attribute = "Operator" context = "#stay" />
+ <!-- DCG rules -->
+ <StringDetect String = "--&gt;" attribute = "Operator" context = "#stay" />
+ <!-- Control constructs -->
+ <AnyChar String = "!;" attribute = "Operator" context = "#stay" />
+ <Detect2Chars char = "-" char1 = "&gt;" attribute = "Operator" context = "#stay" />
+ <!-- Logic and control -->
+ <Detect2Chars char = "\" char1 = "+" attribute = "Operator" context = "#stay" />
+ <!-- Mode operators -->
+ <AnyChar String = "?@" attribute = "Operator" context = "#stay" />
+ <!-- Clause operator -->
+ <Detect2Chars char = ":" char1 = "-" firstNonSpace = "false" attribute = "Normal" context = "#stay" />
+ <!-- Atoms -->
+ <RegExpr String = "\b[a-z]\w*" attribute = "Normal" context = "#stay" />
+ </context>
+
+ <context name = "directive" attribute = "Directive" lineEndContext = "#stay" >
+ <!-- Entity directives -->
+ <RegExpr String = "\b(category|object|protocol)(?=[(])" attribute = "Directive" context = "entityrelations" beginRegion = "Entity"/>
+ <RegExpr String = "\bend_(category|object|protocol)[.]" attribute = "Directive" context = "#pop" endRegion = "Entity" />
+ <RegExpr String = "\bmodule(?=[(])" attribute = "Directive" context = "#pop"/>
+ <!-- Predicate scope directives -->
+ <RegExpr String = "\bp(ublic|r(otected|ivate))(?=[(])" attribute = "Directive" context = "#pop" />
+ <!-- Other directives -->
+ <RegExpr String = "\be(ncoding|xport)(?=[(])" attribute = "Directive" context = "#pop" />
+ <RegExpr String = "\bin(fo|itialization)(?=[(])" attribute = "Directive" context = "#pop" />
+ <RegExpr String = "\bdynamic[.]" attribute = "Directive" context = "#pop" />
+ <RegExpr String = "\b(alias|d(ynamic|iscontiguous)|meta_predicate|m(etapredicate|ode|ultifile))(?=[(])" attribute = "Directive" context = "#pop" />
+ <RegExpr String = "\bop(?=[(])" attribute = "Directive" context = "#pop" />
+ <RegExpr String = "\b(calls|use(s|_module))(?=[(])" attribute = "Directive" context = "#pop" />
+ </context>
+
+ <context name = "entityrelations" attribute = "Normal" lineEndContext = "#stay" >
+ <RegExpr String = "\b(extends|i(nstantiates|mp(lements|orts))|specializes)(?=[(])" attribute = "Directive" context = "#stay" />
+ <Detect2Chars attribute = "Normal" context = "normal" char = ")" char1 = "." />
+ </context>
+
+ <context name = "single line comment" attribute = "Comment" lineEndContext = "#pop" />
+
+ <context name = "multiline comment" attribute = "Comment" lineEndContext = "#stay" >
+ <Detect2Chars char = "*" char1 = "/" attribute = "Comment" context = "#pop" endRegion = "Comment" />
+ </context>
+
+ <context name = "string" attribute = "String" lineEndContext = "#stay" >
+ <DetectChar char = "&quot;" attribute = "String" context = "#pop" />
+ </context>
+
+ <context name = "atom" attribute = "String" lineEndContext = "#stay" >
+ <DetectChar char = "'" attribute = "String" context = "#pop" />
+ </context>
+
+ </contexts>
+
+ <itemDatas>
+ <itemData name = "Normal" defStyleNum = "dsNormal" />
+ <itemData name = "Directive" defStyleNum = "dsKeyword" />
+ <itemData name = "Built-in" defStyleNum = "dsKeyword" />
+ <itemData name = "Operator" defStyleNum = "dsDataType" />
+ <itemData name = "Comment" defStyleNum = "dsComment" />
+ <itemData name = "Number" defStyleNum = "dsDecVal" />
+ <itemData name = "String" defStyleNum = "dsString" />
+ <itemData name = "Variable" defStyleNum = "dsOthers" />
+ </itemDatas>
+
+ </highlighting>
+
+ <general>
+ <comments>
+ <comment name = "singleLine" start = "%" />
+ <comment name = "multiLine" start = "/*" end = "*/" region = "Comment" />
+ </comments>
+ <keywords casesensitive="true" />
+ </general>
+
+</language>
diff --git a/kate/data/lpc.xml b/kate/data/lpc.xml
new file mode 100644
index 000000000..2b13ef7ff
--- /dev/null
+++ b/kate/data/lpc.xml
@@ -0,0 +1,166 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+
+<!--
+=============================================================================
+File: lpc.xml
+URL: http://www.metamorpher.de/files/lpc.xml
+Description: Syntax Highlighting for Lars Pensjo C (LPC)
+ It is used in Multi User Dungeons which use LDMud as Gamedriver.
+ For more information, see LDMud project: http://www.bearnip.com
+ For best highlighting results, configure colors yourself.
+Author: Andreas Klauer (Andreas.Klauer@metamorpher.de)
+Changed: 2004-04-26
+License: Artistic
+=============================================================================
+-->
+
+
+<language name="LPC" version="0.76" kateversion="2.4" section="Sources" extensions="*.c;*.h;*.inc;*.o" author="Andreas Klauer (Andreas.Klauer@metamorpher.de)" license="Artistic" >
+
+ <highlighting>
+
+ <!-- Keyword Lists: -->
+ <list name="modifiers">
+ <item> private </item>
+ <item> protected </item>
+ <item> static </item>
+ <item> public </item>
+ <item> nomask </item>
+ <item> varargs </item>
+ <item> nosave </item>
+ <item> virtual </item>
+ </list>
+ <list name="types">
+ <item> void </item>
+ <item> int </item>
+ <item> status </item>
+ <item> string </item>
+ <item> object </item>
+ <item> array </item>
+ <item> mapping </item>
+ <item> closure </item>
+ <item> symbol </item>
+ <item> float </item>
+ <item> mixed </item>
+ </list>
+ <list name="keywords">
+ <item> break </item>
+ <item> continue </item>
+ <item> return </item>
+ <item> if </item>
+ <item> else </item>
+ <item> for </item>
+ <item> foreach </item>
+ <item> do </item>
+ <item> while </item>
+ <item> switch </item>
+ <item> case </item>
+ <item> inherit </item>
+ <item> default </item>
+ <item> variables </item>
+ <item> functions </item>
+ <item> publish </item>
+ <item> nolog </item>
+ </list>
+ <list name="attention">
+ <item> FIXME </item>
+ <item> HACK </item>
+ <item> NOTE </item>
+ <item> NOTICE </item>
+ <item> TODO </item>
+ <item> WARNING </item>
+ <item> ### </item>
+ </list>
+
+ <!-- Parsing Rules: -->
+ <contexts>
+ <context name="Normal" attribute="Default" lineEndContext="#stay">
+ <RegExpr attribute="Region Marker" context="#stay" String="//\s*BEGIN.*$" beginRegion="regionMarker" firstNonSpace="true"/>
+ <RegExpr attribute="Region Marker" context="#stay" String="//\s*END.*$" endRegion="regionMarker" firstNonSpace="true"/>
+ <Detect2Chars attribute="Single-Line comments" context="Comment1" char="/" char1="/" />
+ <Detect2Chars attribute="Multi-Line comments" context="Comment2" char="/" char1="*" beginRegion="blockComment" />
+ <keyword String="modifiers" attribute="Modifier" context="#stay" />
+ <keyword String="types" attribute="Datatype" context="#stay" />
+ <keyword String="keywords" attribute="Keywords" context="#stay" />
+ <DetectChar char="#" context="Preprocessor" attribute="Preprocessor" column="0"/>
+ <Float attribute="Floats" context="#stay">
+ <AnyChar String="fFeE" context="#stay" />
+ </Float>
+ <RegExpr String="0b[01]+" attribute="Binary" context="#stay" />
+ <RegExpr String="0x[0-9a-fA-F]+" attribute="Hexadecimal" context="#stay" />
+ <RegExpr String="0o[0-7]+" attribute="Octal" context="#stay" />
+ <Int attribute="Integer" context="#stay" />
+ <RegExpr String="#'[^\t ][^\t ,);}\]/]*" attribute="Closure" context="#stay" />
+ <DetectChar attribute="Strings" context="String1" char="&quot;" />
+ <HlCStringChar attribute="Char" context="#stay" />
+ <DetectChar attribute="Default" context="#stay" char="{" beginRegion="brace" />
+ <DetectChar attribute="Default" context="#stay" char="}" endRegion="brace" />
+ </context>
+ <context name="Comment1" attribute="Single-Line comments" lineEndContext="#pop">
+ <LineContinue attribute="Single-Line comments" context="#stay" />
+ <keyword attribute="Alert" context="#stay" String="attention" />
+ </context>
+ <context name="Comment2" attribute="Multi-Line comments" lineEndContext="#stay">
+ <Detect2Chars attribute="Multi-Line comments" context="#pop" char="*" char1="/" endRegion="blockComment" />
+ <keyword attribute="Alert" context="#stay" String="attention" />
+ </context>
+ <context name="Preprocessor" attribute="Preprocessor" lineEndContext="#pop">
+ <LineContinue attribute="Preprocessor" context="#stay" />
+ <Detect2Chars attribute="Single-Line comments" context="Comment1" char="/" char1="/" />
+ <Detect2Chars attribute="Multi-Line comments" context="Comment2" char="/" char1="*" beginRegion="blockComment" />
+ <keyword String="modifiers" attribute="Modifier" context="#stay" />
+ <keyword String="types" attribute="Datatype" context="#stay" />
+ <keyword String="keywords" attribute="Keywords" context="#stay" />
+ <DetectChar attribute="Preprocessor-Strings" context="String2" char="&quot;" />
+ </context>
+ <context name="String1" attribute="Strings" lineEndContext="#pop">
+ <LineContinue attribute="Default" context="#stay" />
+ <Detect2Chars char="\" char1="\" attribute="Strings" context="#stay" />
+ <Detect2Chars char="\" char1="&quot;" attribute="Strings" context="#stay" />
+ <DetectChar char="&quot;" attribute="Strings" context="#pop" />
+ </context>
+ <context name="String2" attribute="Preprocessor-Strings" lineEndContext="#pop">
+ <LineContinue attribute="Default" context="#stay" />
+ <Detect2Chars char="\" char1="\" attribute="Preprocessor-Strings" context="#stay" />
+ <Detect2Chars char="\" char1="&quot;" attribute="Preprocessor-Strings" context="#stay" />
+ <DetectChar char="&quot;" attribute="Preprocessor-Strings" context="#pop" />
+ </context>
+ </contexts>
+
+ <!-- Color Settings: -->
+ <itemDatas>
+ <itemData name="Default" defStyleNum="dsNormal" />
+ <itemData name="Single-Line comments" defStyleNum="dsComment" />
+ <itemData name="Multi-Line comments" defStyleNum="dsComment" />
+ <itemData name="Alert" defStyleNum="dsAlert" />
+ <itemData name="Modifier" defStyleNum="dsDataType" />
+ <itemData name="Datatype" defStyleNum="dsDataType" />
+ <itemData name="Keywords" defStyleNum="dsKeyword" />
+ <itemData name="Preprocessor" defStyleNum="dsOthers" />
+ <itemData name="Floats" defStyleNum="dsFloat" />
+ <itemData name="Binary" defStyleNum="dsBaseN" />
+ <itemData name="Hexadecimal" defStyleNum="dsBaseN" />
+ <itemData name="Octal" defStyleNum="dsBaseN" />
+ <itemData name="Integer" defStyleNum="dsDecVal" />
+ <itemData name="Closure" defStyleNum="dsOthers" />
+ <itemData name="Strings" defStyleNum="dsString" />
+ <itemData name="Preprocessor-Strings" defStyleNum="dsString" />
+ <itemData name="Char" defStyleNum="dsChar" />
+ <itemData name="Region Marker" defStyleNum="dsRegionMarker" />
+ </itemDatas>
+ </highlighting>
+
+ <!-- This is not for highlighting, but for detecting comments.
+ It allows Kate to hide comments if the user wished to do so. -->
+ <general>
+ <comments>
+ <comment name="singleLine" start="//" />
+ <comment name="multiLine" start="/*" end="*/" />
+ </comments>
+ <keywords casesensitive="1" />
+ </general>
+
+</language>
+<!-- kate: space-indent on; indent-width 2; replace-tabs on; -->
+<!-- === End of file. === -->
diff --git a/kate/data/lua.xml b/kate/data/lua.xml
new file mode 100644
index 000000000..5b868aeec
--- /dev/null
+++ b/kate/data/lua.xml
@@ -0,0 +1,237 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+<language name="Lua" version="0.23" kateversion="2.3" section="Scripts" extensions="*.lua" mimetype="text/x-lua">
+ <highlighting>
+ <list name="keywords">
+ <item> and </item>
+ <item> end </item>
+ <item> local </item>
+ <item> return </item>
+ <item> break </item>
+ <item> for </item>
+ <item> do </item>
+ <item> if </item>
+ <item> nil </item>
+ <item> then </item>
+ <item> function </item>
+ <item> not </item>
+ <item> until </item>
+ <item> else </item>
+ <item> or </item>
+ <item> while </item>
+ <item> elseif </item>
+ <item> in </item>
+ <item> repeat </item>
+ </list>
+ <list name="basefunc">
+ <item> string.byte </item>
+ <item> string.char </item>
+ <item> string.find </item>
+ <item> string.len </item>
+ <item> string.lower </item>
+ <item> string.rep </item>
+ <item> string.sub </item>
+ <item> string.upper </item>
+ <item> string.format </item>
+ <item> string.gfind </item>
+ <item> string.gsub </item>
+ <item> table.concat </item>
+ <item> table.foreach </item>
+ <item> table.foreachi </item>
+ <item> table.getn </item>
+ <item> table.sort </item>
+ <item> table.insert </item>
+ <item> table.remove </item>
+ <item> table.setn </item>
+ <item> math.abs </item>
+ <item> math.sin </item>
+ <item> math.cos </item>
+ <item> math.tan </item>
+ <item> math.asin </item>
+ <item> math.acos </item>
+ <item> math.atan </item>
+ <item> math.atan2 </item>
+ <item> math.ceil </item>
+ <item> math.floor </item>
+ <item> math.mod </item>
+ <item> math.frexp </item>
+ <item> math.ldexp </item>
+ <item> math.squrt </item>
+ <item> math.min </item>
+ <item> math.max </item>
+ <item> math.log </item>
+ <item> math.log10 </item>
+ <item> math.exp </item>
+ <item> math.deg </item>
+ <item> math.rad </item>
+ <item> math.random </item>
+ <item> math.randomseed </item>
+ <item> io.close </item>
+ <item> io.flush </item>
+ <item> io.input </item>
+ <item> io.lines </item>
+ <item> io.open </item>
+ <item> io.output </item>
+ <item> io.read </item>
+ <item> io.stderr </item>
+ <item> io.stdin </item>
+ <item> io.stdout </item>
+ <item> io.tmpfile </item>
+ <item> io.write </item>
+ <item> os.clock </item>
+ <item> os.date </item>
+ <item> os.difftime </item>
+ <item> os.execute </item>
+ <item> os.exit </item>
+ <item> os.getenv </item>
+ <item> os.remove </item>
+ <item> os.rename </item>
+ <item> os.setlocale </item>
+ <item> os.time </item>
+ <item> os.tmpname </item>
+ <item> debug.getinfo </item>
+ <item> debug.getlocal </item>
+ <item> debug.setlocal </item>
+ <item> debug.sethook </item>
+ <item> debug.gethook </item>
+ <item> assert </item>
+ <item> collectgarbage </item>
+ <item> dofile </item>
+ <item> error </item>
+ <item> next </item>
+ <item> print </item>
+ <item> rawget </item>
+ <item> rawset </item>
+ <item> tonumber </item>
+ <item> tostring </item>
+ <item> type </item>
+ <item> _ALERT </item>
+ <item> _ERRORMESSAGE </item>
+ <item> call </item>
+ <item> copytagmethods </item>
+ <item> dostring </item>
+ <item> foreach </item>
+ <item> foreachi </item>
+ <item> getglobal </item>
+ <item> getn </item>
+ <item> gettagmethod </item>
+ <item> globals </item>
+ <item> newtag </item>
+ <item> setglobal </item>
+ <item> settag </item>
+ <item> settagmethod </item>
+ <item> sort </item>
+ <item> tag </item>
+ <item> tinsert </item>
+ <item> tremove </item>
+ <item> openfile </item>
+ <item> closefile </item>
+ <item> flush </item>
+ <item> seek </item>
+ <item> setlocale </item>
+ <item> execute </item>
+ <item> remove </item>
+ <item> rename </item>
+ <item> tmpname </item>
+ <item> getenv </item>
+ <item> date </item>
+ <item> clock </item>
+ <item> exit </item>
+ <item> readfrom </item>
+ <item> writeto </item>
+ <item> appendto </item>
+ <item> read </item>
+ <item> write </item>
+ <item> abs </item>
+ <item> sin </item>
+ <item> cos </item>
+ <item> tan </item>
+ <item> asin </item>
+ <item> acos </item>
+ <item> atan </item>
+ <item> atan2 </item>
+ <item> ceil </item>
+ <item> floor </item>
+ <item> mod </item>
+ <item> frexp </item>
+ <item> ldexp </item>
+ <item> squrt </item>
+ <item> min </item>
+ <item> max </item>
+ <item> log </item>
+ <item> log10 </item>
+ <item> exp </item>
+ <item> deg </item>
+ <item> rad </item>
+ <item> random </item>
+ <item> randomseed </item>
+ <item> strlen </item>
+ <item> strsub </item>
+ <item> strlower </item>
+ <item> strupper </item>
+ <item> strchar </item>
+ <item> strrep </item>
+ <item> ascii </item>
+ <item> strbyte </item>
+ <item> format </item>
+ <item> strfind </item>
+ <item> gsub </item>
+ <item> getinfo </item>
+ <item> getlocal </item>
+ <item> setlocal </item>
+ <item> setcallhook </item>
+ <item> setlinehook </item>
+ <item> getglobals </item>
+ <item> getmetatable </item>
+ <item> gcinfo </item>
+ <item> ipairs </item>
+ <item> loadfile </item>
+ <item> loadstring </item>
+ <item> pairs </item>
+ <item> pcall </item>
+ <item> require </item>
+ <item> setglobals </item>
+ <item> setmetatable </item>
+ <item> unpack </item>
+ <item> LUA_PATH </item>
+ <item> _LOADED </item>
+ <item> _VERSION </item>
+ </list>
+ <contexts>
+ <context attribute="Normal Text" lineEndContext="#stay" name="Normal">
+ <keyword attribute="Keyword" context="#stay" String="keywords" />
+ <keyword attribute="BaseFunc" context="#stay" String="basefunc"/>
+ <HlCChar attribute="Char" context="#stay"/>
+ <Detect2Chars attribute="Comment" context="Comment" char="-" char1="-"/>
+ <DetectChar attribute="Comment" context="Comment" char="#"/>
+ <DetectChar attribute="String" context="String" char="&quot;"/>
+ <AnyChar attribute="Symbol" context="#stay" String="!%&amp;()+,-&lt;=&gt;?[]^{|}~"/>
+ <RegExpr attribute="Number" context="#stay" String="\d*\.?\d*e?\d+"/>
+ </context>
+ <context attribute="Comment" lineEndContext="#pop" name="Comment">
+ <RegExpr attribute="Alert" context="#stay" String="(FIXME|TODO)" />
+ </context>
+ <context attribute="String" lineEndContext="#pop" name="String">
+ <DetectChar attribute="String" context="#pop" char="&quot;"/>
+ </context>
+ </contexts>
+ <itemDatas>
+ <itemData name="Normal Text" defStyleNum="dsNormal"/>
+ <itemData name="Keyword" defStyleNum="dsKeyword"/>
+ <itemData name="Comment" defStyleNum="dsComment"/>
+ <itemData name="String" defStyleNum="dsString"/>
+ <itemData name="Decimal" defStyleNum="dsDecVal"/>
+ <itemData name="Number" defStyleNum="dsBaseN"/>
+ <itemData name="Symbol" defStyleNum="dsNormal"/>
+ <itemData name="BaseFunc" defStyleNum="dsNormal" color="#0095FF" selColor="#FFFFFF" bold="1" italic="0"/>
+ <itemData name="Alert" defStyleNum="dsAlert" />
+ </itemDatas>
+ </highlighting>
+ <general>
+ <comments>
+ <comment name="singleLine" start="--" />
+ </comments>
+ <keywords casesensitive="1" weakDeliminator="&#46;" additionalDeliminator="&quot;"/>
+ </general>
+</language>
+<!-- kate: space-indent on; indent-width 2; replace-tabs on; -->
diff --git a/kate/data/m3u.xml b/kate/data/m3u.xml
new file mode 100644
index 000000000..dfa18e4e6
--- /dev/null
+++ b/kate/data/m3u.xml
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+
+<!-- Changelog:
+
+v1.1:
+- mimetype korrigiert zu "audio/mpegurl"
+- Syntax verbessert
+
+v1.0:
+-first Release
+-->
+
+<language name="M3U" section="Other" extensions="*.m3u" mimetype="audio/mpegurl" version="1.10" author="Jan Janssen (medhefgo@web.de)" license="LGPL" >
+
+<highlighting>
+<contexts>
+ <context name="M3U" attribute="Normal Text" lineEndContext="#stay">
+ <StringDetect attribute="M3USpec" context="#pop" String="#EXTM3U" column="0" />
+ <StringDetect attribute="EXTINF" context="FindEXTINF" String="#EXTINF" column="0" />
+ <RegExpr attribute="Comment" String="#.*$" firstNonSpace="true" />
+ </context>
+
+ <context name="FindEXTINF" attribute="Normal Text" lineEndContext="#stay">
+ <RegExpr attribute="Lenght" String=":\d+" />
+ <RegExpr attribute="Descr" context="#pop" String=",.*$" />
+ </context>
+</contexts>
+
+<itemDatas>
+ <itemData name="Normal Text" defStyleNum="dsNormal" />
+ <itemData name="M3USpec" defStyleNum="dsKeyword"/>
+ <itemData name="Comment" defStyleNum="dsComment" />
+
+ <itemData name="EXTINF" defStyleNum="dsOthers" />
+ <itemData name="Lenght" defStyleNum="dsDecVal" />
+ <itemData name="Descr" defStyleNum="dsString" />
+</itemDatas>
+</highlighting>
+
+
+<general>
+ <comments>
+ <comment name="singleLine" start="#" />
+ </comments>
+</general>
+
+</language>
diff --git a/kate/data/mab.xml b/kate/data/mab.xml
new file mode 100644
index 000000000..338d24070
--- /dev/null
+++ b/kate/data/mab.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+<language name="MAB-DB" version="1.03" kateversion="2.4" extensions="*.mab;*.MAB;*.Mab" section="Markup" mimetype="text/x-mab" casesensitive="0">
+ <highlighting>
+ <contexts>
+ <context attribute="Normal Text" name="Section" lineEndContext="#stay" >
+ <RegExpr String="\*I [a-zA-Z0-9]* " attribute="Mab I Field" context="#stay" column="0"/>
+ <RegExpr String="\*\*\*\**E.*" attribute="Header Piece" context="#stay" column="0"/>
+ <RegExpr String="\*\*\*\**M.*" attribute="Header Medium" context="#stay" column="0"/>
+ <RegExpr String="\*\*\*\* BIBLIOTHECA.*" attribute="Database Header" context="#stay" column="0"/>
+ <RegExpr String="\*M [a-zA-Z0-9]* " attribute="Mab M Field" context="#stay" column="0"/>
+ <RegExpr String="\*X TYP .*" attribute="Mab Comment Description" context="#stay" column="0"/>
+ <RegExpr String="\*X DESC .*" attribute="Mab Comment Type" context="#stay" column="0"/>
+ <RegExpr String="\*X .*" attribute="Comment" context="#stay" column="0"/>
+ </context>
+ </contexts>
+
+ <itemDatas>
+ <itemData name="Normal Text" defStyleNum="dsNormal" color="#FF0022" selColor="#ffffff" italic="0" bold="1" />
+ <itemData name="Header Piece" defStyleNum="dsKeyword" color="#993322" selColor="#ffffff" italic="0" bold="1" />
+ <itemData name="Header Medium" defStyleNum="dsKeyword" color="#339922" selColor="#ffffff" italic="0" bold="1" />
+ <itemData name="Database Header" defStyleNum="dsKeyword" color="#FF3322" selColor="#ffffff" italic="0" bold="1" />
+ <itemData name="Mab M Field" defStyleNum="dsKeyword" color="#003366" selColor="#ffffff" italic="0" bold="1" />
+ <itemData name="Mab I Field" defStyleNum="dsKeyword" color="#330066" selColor="#ffffff" italic="0" bold="1" />
+ <itemData name="Mab Comment Description" defStyleNum="dsComment" color="#3333FF" selColor="#ffffff" italic="1" bold="1" />
+ <itemData name="Mab Comment Type" defStyleNum="dsComment" color="#BB3333" selColor="#ffffff" italic="1" bold="1" />
+ <itemData name="Comment" defStyleNum="dsComment" color="#999999" selColor="#ffffff" italic="1" bold="1" />
+ </itemDatas>
+ </highlighting>
+</language>
diff --git a/kate/data/makefile.xml b/kate/data/makefile.xml
new file mode 100644
index 000000000..7931c5a6a
--- /dev/null
+++ b/kate/data/makefile.xml
@@ -0,0 +1,82 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+<!-- Makefile syntaxfile v0.9 by Per Wigren <wigren@home.se> -->
+<!-- Modified by Joseph Wenninger <jowenn@kde.org> -->
+<language name="Makefile" version="1.08" kateversion="2.4" section="Other" extensions="*makefile*;*Makefile*" mimetype="text/x-makefile" author="Per Wigren (wigren@home.se)" license="">
+ <highlighting>
+ <list name = "keywords">
+ <item> include </item>
+ <item> define </item>
+ <item> else </item>
+ <item> endef </item>
+ <item> endif </item>
+ <item> ifdef </item>
+ <item> ifeq </item>
+ <item> ifndef </item>
+ <item> ifneq </item>
+ </list>
+
+ <contexts>
+ <context name="Normal" attribute="Normal Text" lineEndContext="#stay">
+ <keyword attribute="Keyword" context="#stay" String="keywords"/>
+ <RegExpr attribute="Variable" context="Value" String="[_\w\d]*\s*(?=:=|=)"/>
+ <RegExpr attribute="Target" context="#stay" String="[_\w\d-]*\s*:" firstNonSpace="true"/>
+ <RegExpr attribute="Section" context="#stay" String="^[.].*:"/>
+ <DetectChar attribute="String" context="String" char="&quot;"/>
+ <RegExpr attribute="Operator" context="VarFromNormal" String="[$][\({]"/>
+ <Detect2Chars attribute="Special" context="#stay" char="\" char1="#"/>
+ <Detect2Chars attribute="Special" context="#stay" char="\" char1="\"/>
+ <AnyChar attribute="Operator" context="#stay" String="+*=%$():\&#059;"/>
+ <AnyChar attribute="Operator" context="Commands" String="@-" firstNonSpace="true"/>
+ <RegExpr attribute="Comment" context="#stay" String="#.*$"/>
+ </context>
+
+ <context attribute="String" lineEndContext="#pop" name="String">
+ <LineContinue attribute="String" context="#stay"/>
+ <DetectChar attribute="String" context="#pop" char="&quot;"/>
+ </context>
+
+ <context name="Value" attribute="String" lineEndContext="#stay">
+ <RegExpr attribute="Operator" String="\\$" context="#stay"/>
+ <RegExpr attribute="String" String="[^\\]?$" context="#pop"/>
+ <RegExpr attribute="Operator" String="[$][\({]" context="VarFromValue"/>
+ <RegExpr attribute="Special" context="#pop" String="@[-_\d\w]*@" />
+ <DetectChar attribute="Operator" char="&#059;" context="#pop"/>
+ </context>
+
+ <context name="VarFromValue" attribute="Variable" lineEndContext="#stay">
+ <RegExpr attribute="Operator" String="[\)}](?=/)" context="#pop"/>
+ <RegExpr attribute="Operator" String="[\)}][^$]" context="#pop"/>
+ <RegExpr attribute="Operator" String="[\)}]$" context="#pop#pop"/>
+ </context>
+
+ <context name="VarFromNormal" attribute="Variable" lineEndContext="#stay">
+ <AnyChar attribute="Operator" String=")}" context="#pop"/>
+ </context>
+
+ <context name="Commands" attribute="Normal Text" lineEndContext="#pop">
+ <RegExpr attribute="Operator" context="VarFromNormal" String="[$][\({]"/>
+ <RegExpr attribute="Commands" context="#pop" String="[_\w-]*\b"/>
+ </context>
+
+ </contexts>
+ <itemDatas>
+ <itemData name="Normal Text" defStyleNum="dsNormal"/>
+ <itemData name="Keyword" defStyleNum="dsKeyword"/>
+ <itemData name="Comment" defStyleNum="dsComment"/>
+ <itemData name="String" defStyleNum="dsString"/>
+ <itemData name="Variable" defStyleNum="dsDataType"/>
+ <itemData name="Target" defStyleNum="dsDecVal"/>
+ <itemData name="Section" defStyleNum="dsOthers"/>
+ <itemData name="Operator" defStyleNum="dsChar"/>
+ <itemData name="Commands" defStyleNum="dsBaseN"/>
+ <itemData name="Special" defStyleNum="dsFloat"/>
+ </itemDatas>
+ </highlighting>
+ <general>
+ <comments>
+ <comment name = "singleLine" start = "#"/>
+ </comments>
+ <keywords casesensitive = "1" />
+ </general>
+</language>
diff --git a/kate/data/mason.xml b/kate/data/mason.xml
new file mode 100644
index 000000000..3fd1b4992
--- /dev/null
+++ b/kate/data/mason.xml
@@ -0,0 +1,203 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+<language version="1.04" kateversion="2.1" name="Mason" section="Scripts" extensions="*.html;" mimetype="">
+<highlighting>
+ <list name="keywords">
+ <item> sub </item>
+ <item> bless </item>
+ <item> caller </item>
+ <item> cmp </item>
+ <item> print </item>
+ <item> echo </item>
+ <item> die </item>
+ <item> import </item>
+ <item> lt </item>
+ <item> le </item>
+ <item> local </item>
+ <item> last </item>
+ <item> ! </item>
+ <item> || </item>
+ <item> eq </item>
+ <item> ne </item>
+ <item> use </item>
+ <item> elsif </item>
+ <item> my </item>
+ <item> foreach </item>
+ <item> wantarray </item>
+ <item> push </item>
+ <item> pop </item>
+ <item> dbmclose </item>
+ <item> dbmopen </item>
+ <item> dump </item>
+ <item> each </item>
+ <item> ge </item>
+ <item> gt </item>
+ <item> split </item>
+ <item> open </item>
+ <item> close </item>
+ <item> eval </item>
+ <item> chomp </item>
+ <item> chop </item>
+ <item> unless </item>
+ <item> undef </item>
+ <item> next </item>
+ <item> unlink </item>
+ <item> new </item>
+ <item> and </item>
+ <item> not </item>
+ <item> no </item>
+ <item> ref </item>
+ <item> redo </item>
+ <item> require </item>
+ <item> tied </item>
+ <item> tie </item>
+ <item> untie </item>
+ <item> or </item>
+ <item> xor </item>
+ <item> continue </item>
+ <item> do </item>
+ <item> else </item>
+ <item> for </item>
+ <item> goto </item>
+ <item> if </item>
+ <item> return </item>
+ <item> switch </item>
+ <item> while </item>
+ </list>
+
+ <contexts>
+ <context attribute="HTML" lineEndContext="#stay" name="HTML">
+ <RegExpr attribute="Mason Tag" context="EmbeddedPerl" String="&lt;\%method[^&gt;]*&gt;" />
+ <StringDetect attribute="Mason Tag" context="EmbeddedPerl" String="&lt;%method&gt;" insensitive="FALSE" />
+ <StringDetect attribute="Comment" context="Documentation" String="&lt;%doc&gt;" insensitive="FALSE" />
+
+ <StringDetect attribute="Mason Tag" context="EmbeddedPerl" String="&lt;%perl&gt;" insensitive="FALSE" />
+ <Detect2Chars attribute="Mason Tag" context="EmbeddedPerl" char="&lt;" char1="%" />
+ <Detect2Chars attribute="Mason Method" context="MethodCall" char="&lt;" char1="&amp;" />
+ <RegExpr attribute="Mason Tag" context="PerlOneLiner" String="^%" />
+ </context>
+
+ <context attribute="normal" lineEndContext="#stay" name="EmbeddedPerl">
+ <Detect2Chars attribute="Mason Tag" context="#pop" char="%" char1="&gt;" />
+ <StringDetect attribute="Mason Tag" context="#pop" String="&lt;/%perl&gt;" insensitive="FALSE" />
+ <StringDetect attribute="Mason Tag" context="#pop" String="&lt;/%method&gt;" insensitive="FALSE" />
+ <keyword attribute="Keyword" context="#stay" String="keywords"/>
+ <keyword attribute="Data Type" context="#stay" String="types"/>
+ <HlCOct attribute="Octal" context="#stay"/>
+ <HlCHex attribute="Hex" context="#stay"/>
+ <Int attribute="Decimal" context="#stay" />
+ <HlCChar attribute="Char" context="#stay"/>
+ <RegExpr attribute="Keyword" context="#stay" String="^#!.*" />
+ <DetectChar attribute="String" context="String" char="&quot;"/>
+ <DetectChar attribute="String" context="String2" char="'"/>
+ <DetectChar attribute="String Char" context="String" char="`"/>
+ <Detect2Chars attribute="Comment" context="Commentar 1" char="/" char1="/"/>
+ <Detect2Chars attribute="Comment" context="Commentar 2" char="/" char1="*"/>
+ <Detect2Chars attribute="Pattern" context="Pattern2" char="s" char1="/" />
+ <DetectChar attribute="Pattern" context="Pattern" char="/" />
+ <AnyChar attribute="Symbol" context="#stay" String="!%&amp;()+,-&lt;=&gt;?[]^{|}~"/>
+ <RegExpr attribute="Decimal" context="#stay" String="\$[0-9]+" />
+ <RegExpr attribute="Data Type" context="#stay" String="\$\#?[a-zA-Z_]+[a-zA-Z0-9_]*" />
+ <RegExpr attribute="Pattern" context="#stay" String="\s+\:" />
+ <DetectChar attribute="Comment" context="Commentar 1" char="#" />
+ </context>
+
+ <context attribute="String" lineEndContext="#stay" name="String">
+ <LineContinue attribute="String" context="#stay"/>
+ <HlCStringChar attribute="String Char" context="#stay"/>
+ <DetectChar attribute="String" context="#pop" char="&quot;"/>
+ <RegExpr attribute="Decimal" context="#stay" String="\$[0-9]+" />
+ <RegExpr attribute="Data Type" context="#stay" String="\$[a-zA-Z_]*[a-zA-Z0-9_]*" />
+ </context>
+
+ <context attribute="Comment" lineEndContext="#pop" name="Commentar 1"/>
+
+ <context attribute="Comment" lineEndContext="#stay" name="Commentar 2">
+ <Detect2Chars attribute="Comment" context="#pop" char="*" char1="/"/>
+ </context>
+
+ <context attribute="Pattern" lineEndContext="#stay" name="Pattern">
+ <RegExpr attribute="String Char" context="#stay" String="\\[\/\[\]dDwWsSnrtfb0\$@]?" />
+ <RegExpr attribute="String Char" context="#stay" String="\^[\/\[\]]?" />
+ <DetectChar attribute="Pattern" context="#pop" char="/" />
+ </context>
+
+ <context attribute="Pattern" lineEndContext="#stay" name="Pattern2">
+ <RegExpr attribute="String Char" context="#stay" String="\\[\/\[\]dDwWsSnrtfb0\$@]?" />
+ <RegExpr attribute="String Char" context="#stay" String="\^[\/\[\]]?" />
+ <RegExpr attribute="Pattern" context="Pattern3" String="\/" />
+ </context>
+
+ <context attribute="Pattern" lineEndContext="#stay" name="Pattern3">
+ <RegExpr attribute="String Char" context="#stay" String="\\[\/\[\]dDwWsSnrtfb0\$@]?" />
+ <RegExpr attribute="String Char" context="#stay" String="\^[\/\[\]]?" />
+ <RegExpr attribute="Pattern" context="#pop#pop" String="\/g?" />
+ </context>
+
+ <context attribute="String Char" lineEndContext="#stay" name="Something">
+ <DetectChar attribute="String Char" context="#pop" char="`"/>
+ </context>
+
+ <context attribute="String" lineEndContext="#stay" name="String2">
+ <LineContinue attribute="String" context="#stay"/>
+ <Detect2Chars attribute="String Char" context="#stay" char="\" char1="'"/>
+ <DetectChar attribute="String" context="#pop" char="'"/>
+ </context>
+
+ <context attribute="String" lineEndContext="#pop" name="PerlOneLiner">
+ <keyword attribute="Keyword" context="#stay" String="keywords"/>
+ <keyword attribute="Data Type" context="#stay" String="types"/>
+ <HlCOct attribute="Octal" context="#stay"/>
+ <HlCHex attribute="Hex" context="#stay"/>
+ <Int attribute="Decimal" context="#stay" />
+ <HlCChar attribute="Char" context="#stay"/>
+ <RegExpr attribute="Keyword" context="#stay" String="^#!.*" />
+ <RegExpr attribute="String" context="#stay" String="&quot;[^&quot;]*&quot;"/>
+ <RegExpr attribute="String" context="#stay" String="'[^']*'"/>
+ <DetectChar attribute="String Char" context="Something" char="`"/>
+ <Detect2Chars attribute="Comment" context="Commentar 1" char="/" char1="/"/>
+ <Detect2Chars attribute="Comment" context="Commentar 2" char="/" char1="*"/>
+ <Detect2Chars attribute="Pattern" context="Pattern2" char="s" char1="/" />
+ <AnyChar attribute="Symbol" context="#stay" String="!%&amp;()+,-&lt;=&gt;?[]^{|}~"/>
+ <RegExpr attribute="Decimal" context="#stay" String="\$[0-9]+" />
+ <RegExpr attribute="Data Type" context="#stay" String="\$\#?[a-zA-Z_]+[a-zA-Z0-9_]*" />
+ <RegExpr attribute="Pattern" context="#stay" String="\s+\:" />
+ <RegExpr attribute="Comment" context="#stay" String="\#.*" />
+ </context>
+
+ <context attribute="Comment" lineEndContext="#stay" name="Documentation">
+ <StringDetect attribute="Comment" context="#pop" String="&lt;/%doc&gt;" insensitive="FALSE" />
+ </context>
+
+ <context attribute="Mason Method" lineEndContext="#stay" name="MethodCall">
+ <Detect2Chars attribute="Mason Method" context="#pop" char="&amp;" char1="&gt;" />
+ </context>
+ </contexts>
+
+ <itemDatas>
+ <itemData name="normal" defStyleNum="dsNormal"/>
+ <itemData name="Keyword" defStyleNum="dsKeyword"/>
+ <itemData name="Data Type" defStyleNum="dsDataType"/>
+ <itemData name="Decimal" defStyleNum="dsDecVal"/>
+ <itemData name="Octal" defStyleNum="dsBaseN"/>
+ <itemData name="Hex" defStyleNum="dsBaseN"/>
+ <itemData name="Float" defStyleNum="dsFloat"/>
+ <itemData name="Char" defStyleNum="dsChar"/>
+ <itemData name="String" defStyleNum="dsString"/>
+ <itemData name="String Char" defStyleNum="dsChar"/>
+ <itemData name="Comment" defStyleNum="dsComment"/>
+ <itemData name="Symbol" defStyleNum="dsNormal"/>
+ <itemData name="Pattern" defStyleNum="dsOthers"/>
+ <itemData name="Mason Tag" defStyleNum="dsKeyword"/>
+ <itemData name="Mason Method" defStyleNum="dsKeyword"/>
+ <itemData name="HTML" defStyleNum="dsString"/>
+ </itemDatas>
+ </highlighting>
+ <general>
+ <comments>
+ <comment name="singleLine" start="#" />
+ <comment name="multiLine" start="&lt;%doc&gt;" end="&lt;%doc&gt;"/>
+ </comments>
+ <keywords casesensitive="1" />
+ </general>
+</language>
diff --git a/kate/data/matlab.xml b/kate/data/matlab.xml
new file mode 100644
index 000000000..b4b6fbc0b
--- /dev/null
+++ b/kate/data/matlab.xml
@@ -0,0 +1,222 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ====================================================================
+ MATLAB syntax highlighting file for the KDE editors Kate and Kwrite
+ ====================================================================
+ works (at least) for MATLAB versions 5.3, 6.0, 6.1, 6.5, 6.5sp1
+ works with Kate 2.2 and with Kwrite 4.2 (KDE 3.2)
+
+ This file works only for syntactically correct MATLAB code. For incorrect
+ code, the behaviour is undefined. One exception is made: Incomplete strings
+ with missing closing delimiter are highlighted separately, just as in the
+ native editor of MATLAB does.
+
+ Highlighting errors never propagate across line breaks.
+
+ Most of this XML file is straight and simple. Only the character ' (&apos;)
+ needs nontrivial treatment, since it is both a postfix operator indicating
+ complex conjugate transpose (adjoint) and a string delimiter. It is an
+ adjoint operator in the following positions:
+ 1) immediately after an identifier (variable, function, but not keyword)
+ 2) immediately after a number literal
+ 3) immediately after the closing parenthesis ), ] and }
+ 4) immediately after a simple transpose operator .'
+ 5) immediately after another adjoint operator '
+ In all other cases it is a string delimiter.
+
+ This is implemented using look-ahead regexps. If one of the entities in the
+ above cases 1-4 (identifier, number literal, ...) matches and look-ahead
+ shows that it is followed by a ', the entity is highlighted and control is
+ passed to the special context _adjoint, whose sole purpose is to correctly
+ highlight a series of ' (thus covering case 5 as well). _adjoint immediately
+ returns to the default context _normal.
+
+ MATLAB number literals are different from those in C and similar languages:
+ a) All numbers literals are doubles. There is no distinction between float and int.
+ b) There is no notation of hex or oct base integers.
+ c) The symbols i or j may be attached to a number to indicate a multiplication
+ with the imaginary unit.
+
+ MATLAB identifiers have to start with a letter followed by any number of letters,
+ digits and underscores.
+
+ There is a small number of reserved keywords, which cannot be the target of an
+ assignment. All other identifiers (including all of the many 100s of MATLAB commands)
+ can be redefined. Consequently, only the reserved keywords are highlighted.
+
+ At the end of the XML file, there is MATLAB testing code for developers.
+
+ Change log:
+ 19-Nov-03 Created from scratch.
+ 08-Mar-04 Small corrections. Added default colors of MATLAB editor.
+
+ Author: Stefan Stoll, Swiss Federal Institute of Technology, Zurich
+-->
+
+<!DOCTYPE language SYSTEM "language.dtd">
+
+<language name="Matlab" version="1.20" kateversion="2.2" section="Scientific" extensions="*.m;*.M" mimetype="text/mfile" casesensitive="1">
+ <highlighting>
+
+ <!-- Reserved keywords in MATLAB -->
+ <list name="KeywordsList">
+ <item> break </item>
+ <item> case </item>
+ <item> catch </item>
+ <item> continue </item>
+ <item> else </item>
+ <item> elseif </item>
+ <item> end </item>
+ <item> for </item>
+ <item> function </item>
+ <item> global </item>
+ <item> if </item>
+ <item> otherwise </item>
+ <item> persistent </item>
+ <item> return </item>
+ <item> switch </item>
+ <item> try </item>
+ <item> while </item>
+ </list>
+
+ <contexts>
+
+ <context name="_normal" attribute="Normal Text" lineEndContext="#pop">
+
+ <!-- Look-ahead for adjoint ' after variable, number literal, closing braces and .' -->
+ <RegExpr context="_adjoint" attribute="Variable" String="[a-zA-Z]\w*(?=')" />
+ <RegExpr context="_adjoint" attribute="Number" String="(\d+(\.\d+)?|\.\d+)([eE][+-]?\d+)?[ij]?(?=')" />
+ <RegExpr context="_adjoint" attribute="Delimiter" String="[\)\]}](?=')" />
+ <RegExpr context="_adjoint" attribute="Operator" String="\.'(?=')" />
+
+ <!-- If ' is not the adjoint operator, it starts a string or an unterminated string -->
+ <RegExpr context="#stay" attribute="String" String="'[^']*(''[^']*)*'(?=[^']|$)" />
+ <RegExpr context="#stay" attribute="Incomplete String" String="'[^']*(''[^']*)*" />
+
+ <!-- Handling of keywords, comments, system commands, identifiers, numbers and braces -->
+ <keyword context="#stay" attribute="Keyword" String="KeywordsList" />
+ <RegExpr context="#stay" attribute="Comment" String="%.*$" />
+ <RegExpr context="#stay" attribute="System" String="!.*$" />
+ <RegExpr context="#stay" attribute="Variable" String="[a-zA-Z]\w*" />
+ <RegExpr context="#stay" attribute="Number" String="(\d+(\.\d+)?|\.\d+)([eE][+-]?\d+)?[ij]?" />
+ <AnyChar context="#stay" attribute="Delimiter" String="()[]{}"/>
+
+ <!-- Three and two-character operators -->
+ <StringDetect context="#stay" attribute="Operator" String="..."/>
+ <StringDetect context="#stay" attribute="Operator" String="=="/>
+ <StringDetect context="#stay" attribute="Operator" String="~="/>
+ <StringDetect context="#stay" attribute="Operator" String="&lt;="/>
+ <StringDetect context="#stay" attribute="Operator" String="&gt;="/>
+ <StringDetect context="#stay" attribute="Operator" String="&amp;&amp;"/>
+ <StringDetect context="#stay" attribute="Operator" String="||"/>
+ <StringDetect context="#stay" attribute="Operator" String=".*"/>
+ <StringDetect context="#stay" attribute="Operator" String=".^"/>
+ <StringDetect context="#stay" attribute="Operator" String="./"/>
+ <StringDetect context="#stay" attribute="Operator" String=".'"/>
+
+ <!-- Single-character operators -->
+ <AnyChar context="#stay" attribute="Operator" String="*+-/\&amp;|&lt;&gt;~^=,;:@"/>
+
+ </context>
+
+ <!-- Context entered after encountering an ' adjoint operator -->
+ <context name="_adjoint" attribute="Operator" lineEndContext="#pop">
+ <RegExpr context="#pop" attribute="Operator" String="'+" />
+ </context>
+
+ </contexts>
+
+ <itemDatas>
+ <itemData name="Normal Text" defStyleNum="dsNormal" />
+ <itemData name="Variable" defStyleNum="dsNormal" />
+ <itemData name="Operator" defStyleNum="dsNormal"/>
+ <itemData name="Number" defStyleNum="dsFloat" />
+ <itemData name="Delimiter" defStyleNum="dsNormal" />
+ <itemData name="String" defStyleNum="dsString" color="#b20000"/>
+ <itemData name="System" defStyleNum="dsBaseN" color="#b28c00"/>
+ <itemData name="Incomplete String" defStyleNum="dsChar" color="#a020f0"/>
+ <itemData name="Keyword" defStyleNum="dsNormal" color="#0000ff"/>
+ <itemData name="Comment" defStyleNum="dsComment" color="#009900"/>
+ </itemDatas>
+ <!-- MATLAB 6.5 default color scheme
+ keywords #0000ff
+ comments #228b22
+ strings #b20000
+ unterminated strings #a020f0
+ system commands #b28c00
+ errors #ff0000
+ all others #000000
+ -->
+
+ </highlighting>
+
+ <general>
+ <comments>
+ <comment name="singleLine" start="% " />
+ </comments>
+ <keywords casesensitive="1" weakDeliminator=""/>
+ </general>
+
+</language>
+<!--
+%%=====================================================
+% MATLAB test code for Kate/Kwrite syntax highlighting
+%%=====================================================
+
+% Numbers _____________________________________________
+5, 5.5, .1, 0.1, 0.4e5, 1.2e-5, 5i, 5.3i, 6j, .345+3i
+5', 5.5', .1', 0.1', 0.4e5', 1.2e-5', 5i', 5.3i', 6j', .345+3i'
+
+% Operators ___________________________________________
+% relational operators
+'asdf'~=4, c<=4, d>=4, a<b, a>b, a==b, b||c, b&&c
+% elementwise arithmetic operators
+a.^b, a.*b a./b, 1:4:5
+% single-character binary arithmetic
+a+3, a-3, a*2, a^3, a/3, a\3, a|b, a&b
+% unary operators
+a = ~g; g = @sfdgdsf(sdfsd,345); g.' + 1i.' - ('asdf').'
+% separators and delimiter
+(asd),[sadf];{asdf},;;,;;;()
+% continuation
+a = 1+ ...
+ 2;
+
+% Strings and adjoint _________________________________
+% incomplete strings
+'string
+'str''
+'str''ing
+% complete strings
+'string' % simple string
+'''' % string containing '
+'str''ing' % one string containing '
+'string' 'string' % two strings
+'asdf' 'asdf''' variable % two strings and a variable
+'asdf''asdf'' fsgdfg' + (asdf)' - 'asdf'.' + []''''.';''
+'sadf'.' % string transpose
+% adjoint
+{'asdf'}' + 1
+('asdf')' + 1
+['asdf']' + 1
+'' var''' % empty string, var with >1 adjoints
+[5]'*{5}'*('asd')'.'+(5)'*6'*asdf'*asdf'.' % many adjoints
+A'*B + 1 % adjoint
+A.'*B + 1 % transpose
+A.'.'*B + 1 % double transpose
+A'.' + 1 % adjoint, then transpose
+A.'' % transpose, then adjoint
+
+% System command ______________________________________
+!hostname
+!cp * /tmp
+
+% Reserved keywords ___________________________________
+function, persistent, global
+switch, case, otherwise
+if, else, elseif
+try, catch
+for, while, break, continue
+end, return
+function, FUNCTION, Function % case sensitive!
+-->
diff --git a/kate/data/mediawiki.xml b/kate/data/mediawiki.xml
new file mode 100644
index 000000000..f10fe6586
--- /dev/null
+++ b/kate/data/mediawiki.xml
@@ -0,0 +1,95 @@
+<?xml version = '1.0' encoding = 'UTF-8'?>
+<!DOCTYPE language SYSTEM "language.dtd">
+<language name="MediaWiki" section="Markup" version="1.01" kateversion="2.4" extensions="" mimetype="" license="FDL" >
+ <highlighting>
+ <contexts>
+ <context attribute="Normal" lineEndContext="#stay" name="normal" >
+ <StringDetect String="&lt;!--" context="comment" attribute="Comment" beginRegion="comment" />
+ <RegExpr String="([=]{2,2}[^=]+[=]{2,2}|[=]{3,3}[^=]+[=]{3,3}|[=]{4,4}[^=]+[=]{4,4}|[=]{5,5}[^=]+[=]{5,5})" attribute="Section" column="0" />
+ <RegExpr String="[~]{3,4}" attribute="Wiki-Tag" context="#stay" />
+ <RegExpr String="[*#;:\s]*[*#:]+" attribute="Wiki-Tag" context="#stay" column="0" />
+ <RegExpr String="[[](?![[])" attribute="Wiki-Tag" context="URL" />
+ <RegExpr String="(http:|ftp:|mailto:)[\S]*($|[\s])" attribute="URL" context="#stay" />
+ <RegExpr String="[']{2,}" attribute="Wiki-Tag" context="#stay" />
+ <Detect2Chars char="{" char1="|" context="Table" attribute="Wiki-Tag" column="0" beginRegion="table" />
+ <Detect2Chars char="{" char1="{" context="Template" attribute="Wiki-Tag" />
+ <Detect2Chars char="[" char1="[" context="WikiLink" attribute="Wiki-Tag" />
+ <RangeDetect char="&amp;" char1=";" attribute="HTML-Entity" context="#stay" />
+ <StringDetect String="&lt;nowiki&gt;" context="NoWiki" attribute="Wiki-Tag" />
+ <StringDetect String="&lt;pre&gt;" context="Pre" attribute="HTML-Tag" />
+ <RegExpr String="[&lt;][^&gt;]+[&gt;]" attribute="HTML-Tag" context="#stay" />
+ <RegExpr String="[\s]" context="Unformatted" column="0" />
+ </context>
+ <context attribute="Normal" lineEndContext="#stay" name="Table" >
+ <StringDetect String="&lt;!--" context="comment" attribute="Comment" />
+ <RegExpr String="([=]{2,2}[^=]+[=]{2,2}|[=]{3,3}[^=]+[=]{3,3}|[=]{4,4}[^=]+[=]{4,4}|[=]{5,5}[^=]+[=]{5,5})" attribute="Section" context="#stay" column="0" />
+ <RegExpr String="[*#;:\s]*[*#:]+" attribute="Wiki-Tag" context="#stay" column="0" />
+ <RegExpr String="[[](?![[])" context="URL" attribute="Wiki-Tag" />
+ <RegExpr String="(http:|ftp:|mailto:)[\S]*($|[\s])" attribute="URL" context="#stay" />
+ <RegExpr String="[']{2,}" attribute="Wiki-Tag" context="#stay" />
+ <Detect2Chars char="|" char1="}" context="#pop" attribute="Wiki-Tag" column="0" endRegion="table" />
+ <DetectChar char="|" attribute="Wiki-Tag" context="#stay"/>
+ <Detect2Chars char="{" char1="{" context="Template" attribute="Wiki-Tag" />
+ <Detect2Chars char="[" char1="[" context="WikiLink" attribute="Wiki-Tag" />
+ <RangeDetect char="&amp;" char1=";" attribute="HTML-Entity" context="#stay" />
+ <StringDetect String="&lt;nowiki&gt;" context="NoWiki" attribute="Wiki-Tag" />
+ <StringDetect String="&lt;pre&gt;" context="Pre" attribute="HTML-Tag" />
+ <RegExpr String="[&lt;][^&gt;]+[&gt;]" attribute="HTML-Tag" context="#stay" />
+ <RegExpr String="[\s]" context="Unformatted" column="0" />
+ <RegExpr String="[~]{3,4}" attribute="Wiki-Tag" context="#stay" />
+ <RegExpr String="[-]{4,}" attribute="Wiki-Tag" context="#stay" />
+ <DetectChar char="!" attribute="Wiki-Tag" context="#stay" column="0" />
+ </context>
+ <context attribute="Comment" lineEndContext="#stay" name="comment" >
+ <StringDetect String="--&gt;" context="#pop" attribute="Comment" endRegion="comment" />
+ </context>
+ <context attribute="Link" lineEndContext="#stay" name="URL" >
+ <DetectChar char="]" context="#pop" attribute="Wiki-Tag" />
+ <DetectChar char="'" context="Error" attribute="Error" />
+ </context>
+ <context attribute="Link" lineEndContext="#stay" name="WikiLink" >
+ <DetectChar char="|" attribute="Wiki-Tag" context="#stay" />
+ <Detect2Chars char="]" char1="]" context="#pop" attribute="Wiki-Tag" />
+ <DetectChar char="'" context="Error" attribute="Error" />
+ </context>
+ <context attribute="Template" lineEndContext="#stay" name="Link" >
+ <Detect2Chars char="}" char1="}" context="#pop" attribute="Wiki-Tag" />
+ <AnyChar String="'[]" context="Error" attribute="Error" />
+ </context>
+ <context attribute="Error" lineEndContext="#pop" name="Error" />
+ <context attribute="Link" lineEndContext="#stay" name="Template" >
+ <Detect2Chars char="}" char1="}" context="#pop" attribute="Wiki-Tag" />
+ <DetectChar char="'" context="Error" attribute="Error" />
+ </context>
+ <context attribute="NoWiki" lineEndContext="#stay" name="NoWiki" >
+ <RegExpr String="&lt;!--[^-]*--&gt;" attribute="NoWiki" />
+ <StringDetect String="&lt;/nowiki&gt;" context="#pop" attribute="Wiki-Tag" />
+ <RegExpr String="[&lt;][^&gt;]+[&gt;]" attribute="HTML-Tag" context="#stay" />
+ <StringDetect String="&lt;pre&gt;" context="Pre" attribute="HTML-Tag" />
+ </context>
+ <context attribute="Unformatted" lineEndContext="#pop" name="Unformatted" />
+ <context attribute="NoWiki" lineEndContext="#stay" name="Pre" >
+ <StringDetect String="&lt;/pre&gt;" context="#pop" attribute="Wiki-Tag" />
+ </context>
+ </contexts>
+ <itemDatas>
+ <itemData name="Normal" defStyleNum="dsNormal" />
+ <itemData name="Link" defStyleNum="dsOthers" />
+ <itemData name="URL" defStyleNum="dsOthers" />
+ <itemData name="Comment" defStyleNum="dsComment" />
+ <itemData name="Section" defStyleNum="dsKeyword" />
+ <itemData name="HTML-Entity" defStyleNum="dsDecVal" />
+ <itemData name="HTML-Tag" defStyleNum="dsKeyword" />
+ <itemData name="Wiki-Tag" defStyleNum="dsDecVal" bold="true" />
+ <itemData name="Error" defStyleNum="dsError" />
+ <itemData name="NoWiki" defStyleNum="dsNormal" />
+ <itemData name="Unformatted" defStyleNum="dsNormal" />
+ </itemDatas>
+ </highlighting>
+ <general>
+ <comments>
+ <comment end="//-->" start="&lt;!--" name="multiLine" />
+ </comments>
+ <keywords casesensitive="0" />
+ </general>
+</language>
diff --git a/kate/data/mips.xml b/kate/data/mips.xml
new file mode 100644
index 000000000..c08b89df4
--- /dev/null
+++ b/kate/data/mips.xml
@@ -0,0 +1,359 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+<language name="MIPS Assembler" version="1.03" kateversion="2.4" section="Assembler" extensions="*.s;" mimetype="text/x-mips" author="Dominik Haumann (dhdev@gmx.de)" license="LGPL" priority="-1">
+ <highlighting>
+ <list name="type">
+ <item> .align </item>
+ <item> .ascii </item>
+ <item> .asciiz </item>
+ <item> .byte </item>
+ <item> .double </item>
+ <item> .extern </item>
+ <item> .float </item>
+ <item> .globl </item>
+ <item> .half </item>
+ <item> .sdata </item>
+ <item> .set </item>
+ <item> .space </item>
+ <item> .word </item>
+ </list>
+ <list name="section">
+ <item> .data </item>
+ <item> .kdata </item>
+ <item> .ktext </item>
+ <item> .text </item>
+ </list>
+ <list name="hardware">
+ <item> abs.d </item>
+ <item> abs.s </item>
+ <item> add </item>
+ <item> add.d </item>
+ <item> add.s </item>
+ <item> addi </item>
+ <item> addiu </item>
+ <item> addu </item>
+ <item> and </item>
+ <item> andi </item>
+ <item> bc0f </item>
+ <item> bc0t </item>
+ <item> bc1f </item>
+ <item> bc1t </item>
+ <item> bc2f </item>
+ <item> bc2t </item>
+ <item> bc3f </item>
+ <item> bc3t </item>
+ <item> beq </item>
+ <item> bgez </item>
+ <item> bgezal </item>
+ <item> bgtz </item>
+ <item> blez </item>
+ <item> bltz </item>
+ <item> bltzal </item>
+ <item> bne </item>
+ <item> break </item>
+ <item> c.eq.d </item>
+ <item> c.eq.s </item>
+ <item> c.seq.s </item>
+ <item> c.seq.d </item>
+ <item> c.ueq.s </item>
+ <item> c.ueq.d </item>
+ <item> c.olt.d </item>
+ <item> c.olt.s </item>
+ <item> c.ole.d </item>
+ <item> c.ole.s </item>
+ <item> c.ult.d </item>
+ <item> c.ult.s </item>
+ <item> c.ule.d </item>
+ <item> c.ule.s </item>
+ <item> c.le.d </item>
+ <item> c.le.s </item>
+ <item> c.lt.d </item>
+ <item> c.lt.s </item>
+ <item> c.un.s </item>
+ <item> c.un.d </item>
+ <item> cvt.d.s </item>
+ <item> cvt.d.w </item>
+ <item> cvt.s.d </item>
+ <item> cvt.s.w </item>
+ <item> cvt.w.d </item>
+ <item> cvt.w.s </item>
+ <item> div.d </item>
+ <item> div.s </item>
+ <item> j </item>
+ <item> jal </item>
+ <item> jalr </item>
+ <item> jr </item>
+ <item> lb </item>
+ <item> lbu </item>
+ <item> lh </item>
+ <item> lhu </item>
+ <item> lui </item>
+ <item> lw </item>
+ <item> lwc0 </item>
+ <item> lwc1 </item>
+ <item> lwc2 </item>
+ <item> lwc3 </item>
+ <item> lwl </item>
+ <item> lwr </item>
+ <item> mfc0 </item>
+ <item> mfc1 </item>
+ <item> mfc2 </item>
+ <item> mfc3 </item>
+ <item> mfhi </item>
+ <item> mflo </item>
+ <item> mtc0 </item>
+ <item> mtc1 </item>
+ <item> mtc2 </item>
+ <item> mtc3 </item>
+ <item> mthi </item>
+ <item> mtlo </item>
+ <item> mul.d </item>
+ <item> mul.s </item>
+ <item> mult </item>
+ <item> multu </item>
+ <item> nor </item>
+ <item> or </item>
+ <item> ori </item>
+ <item> rfe </item>
+ <item> sb </item>
+ <item> sh </item>
+ <item> sw </item>
+ <item> swcl </item>
+ <item> swl </item>
+ <item> swr </item>
+ <item> sll </item>
+ <item> sllv </item>
+ <item> slt </item>
+ <item> slti </item>
+ <item> sltiu </item>
+ <item> sra </item>
+ <item> srav </item>
+ <item> srl </item>
+ <item> srlv </item>
+ <item> sub </item>
+ <item> sub.d </item>
+ <item> sub.s </item>
+ <item> subu </item>
+ <item> sw </item>
+ <item> swc0 </item>
+ <item> swc1 </item>
+ <item> swc2 </item>
+ <item> swc3 </item>
+ <item> swl </item>
+ <item> swr </item>
+ <item> syscall </item>
+ <item> xor </item>
+ <item> xori </item>
+ </list>
+ <list name="pseudo">
+ <item> abs </item>
+ <item> b </item>
+ <item> beqz </item>
+ <item> bge </item>
+ <item> bgeu </item>
+ <item> bgt </item>
+ <item> bgtu </item>
+ <item> ble </item>
+ <item> bleu </item>
+ <item> blt </item>
+ <item> bltu </item>
+ <item> bnez </item>
+ <item> div </item>
+ <item> divu </item>
+ <item> l.d </item>
+ <item> l.s </item>
+ <item> la </item>
+ <item> ld </item>
+ <item> li </item>
+ <item> li.d </item>
+ <item> li.s </item>
+ <item> mfc0.d </item>
+ <item> mfc1.d </item>
+ <item> mfc2.d </item>
+ <item> mfc3.d </item>
+ <item> mov.d </item>
+ <item> mov.s </item>
+ <item> move </item>
+ <item> mul </item>
+ <item> mulo </item>
+ <item> mulou </item>
+ <item> neg </item>
+ <item> neg.d </item>
+ <item> neg.s </item>
+ <item> negu </item>
+ <item> nop </item>
+ <item> not </item>
+ <item> rem </item>
+ <item> remu </item>
+ <item> rol </item>
+ <item> ror </item>
+ <item> s.d </item>
+ <item> s.s </item>
+ <item> sd </item>
+ <item> seq </item>
+ <item> sge </item>
+ <item> sgeu </item>
+ <item> sgt </item>
+ <item> sgtu </item>
+ <item> sle </item>
+ <item> sleu </item>
+ <item> sne </item>
+ <item> ulh </item>
+ <item> ulhu </item>
+ <item> ulw </item>
+ <item> ush </item>
+ <item> usw </item>
+ </list>
+ <list name="register1">
+ <item> $0 </item>
+ <item> $1 </item>
+ <item> $2 </item>
+ <item> $3 </item>
+ <item> $4 </item>
+ <item> $5 </item>
+ <item> $6 </item>
+ <item> $7 </item>
+ <item> $8 </item>
+ <item> $9 </item>
+ <item> $10 </item>
+ <item> $11 </item>
+ <item> $12 </item>
+ <item> $13 </item>
+ <item> $14 </item>
+ <item> $15 </item>
+ <item> $16 </item>
+ <item> $17 </item>
+ <item> $18 </item>
+ <item> $19 </item>
+ <item> $20 </item>
+ <item> $21 </item>
+ <item> $22 </item>
+ <item> $23 </item>
+ <item> $24 </item>
+ <item> $25 </item>
+ <item> $26 </item>
+ <item> $27 </item>
+ <item> $28 </item>
+ <item> $29 </item>
+ <item> $30 </item>
+ <item> $31 </item>
+ <item> $zero </item>
+ <item> $t0 </item>
+ <item> $t1 </item>
+ <item> $t2 </item>
+ <item> $t3 </item>
+ <item> $t4 </item>
+ <item> $t5 </item>
+ <item> $t6 </item>
+ <item> $t7 </item>
+ <item> $t8 </item>
+ <item> $t9 </item>
+ </list>
+ <list name="register2">
+ <item> $v0 </item>
+ <item> $v1 </item>
+ <item> $a0 </item>
+ <item> $a1 </item>
+ <item> $a2 </item>
+ <item> $a3 </item>
+ <item> $k0 </item>
+ <item> $k1 </item>
+ <item> $at </item>
+ <item> $gp </item>
+ <item> $sp </item>
+ <item> $fp </item>
+ <item> $s0 </item>
+ <item> $s1 </item>
+ <item> $s2 </item>
+ <item> $s3 </item>
+ <item> $s4 </item>
+ <item> $s5 </item>
+ <item> $s6 </item>
+ <item> $s7 </item>
+ <item> $ra </item>
+ </list>
+ <list name="fp">
+ <item> $f0 </item>
+ <item> $f1 </item>
+ <item> $f2 </item>
+ <item> $f3 </item>
+ <item> $f4 </item>
+ <item> $f5 </item>
+ <item> $f6 </item>
+ <item> $f7 </item>
+ <item> $f8 </item>
+ <item> $f9 </item>
+ <item> $f10 </item>
+ <item> $f11 </item>
+ <item> $f12 </item>
+ <item> $f13 </item>
+ <item> $f14 </item>
+ <item> $f15 </item>
+ <item> $f16 </item>
+ <item> $f17 </item>
+ <item> $f18 </item>
+ <item> $f19 </item>
+ <item> $f20 </item>
+ <item> $f21 </item>
+ <item> $f22 </item>
+ <item> $f23 </item>
+ <item> $f24 </item>
+ <item> $f25 </item>
+ <item> $f26 </item>
+ <item> $f27 </item>
+ <item> $f28 </item>
+ <item> $f29 </item>
+ <item> $f30 </item>
+ <item> $f31 </item>
+ </list>
+ <contexts>
+ <context name="normal" attribute="Normal Text" lineEndContext="#stay">
+ <keyword attribute="Hardware Instruction" context="#stay" String="hardware"/>
+ <keyword attribute="Pseudo Instruction" context="#stay" String="pseudo"/>
+ <keyword attribute="Other Register" context="#stay" String="register1"/>
+ <keyword attribute="Main Register" context="#stay" String="register2"/>
+ <keyword attribute="Floating Point Register" context="#stay" String="fp"/>
+ <keyword attribute="Type" context="#stay" String="section"/>
+ <keyword attribute="Section" context="#stay" String="type"/>
+ <RegExpr attribute="Region Marker" context="#stay" String="#\s*BEGIN.*$" beginRegion="region" firstNonSpace="true"/>
+ <RegExpr attribute="Region Marker" context="#stay" String="#\s*END.*$" endRegion="region" firstNonSpace="true"/>
+ <RegExpr attribute="Comment" context="#stay" String="#.*$" />
+ <RegExpr attribute="Label" context="#stay" String="[\w_\.]+:" firstNonSpace="true"/>
+ <DetectChar attribute="String" context="string" char="&quot;" />
+ <Float attribute="Float" context="#stay"/>
+ <HlCOct attribute="Octal" context="#stay"/>
+ <HlCHex attribute="Hex" context="#stay"/>
+ <Int attribute="Decimal" context="#stay"/>
+ </context>
+ <context name="string" attribute="String" lineEndContext="#stay" >
+ <RegExpr attribute="Char" context="#stay" String="\\." />
+ <DetectChar attribute="String" context="#pop" char="&quot;" />
+ </context>
+ </contexts>
+ <itemDatas>
+ <itemData name="Normal Text" defStyleNum="dsNormal" />
+ <itemData name="Hardware Instruction" defStyleNum="dsKeyword" />
+ <itemData name="Pseudo Instruction" defStyleNum="dsFunction"/>
+ <itemData name="Other Register" defStyleNum="dsDataType" color="#0000ff"/>
+ <itemData name="Main Register" defStyleNum="dsDataType"/>
+ <itemData name="Floating Point Register" defStyleNum="dsFloat"/>
+ <itemData name="Section" defStyleNum="dsDataType"/>
+ <itemData name="Type" defStyleNum="dsKeyword"/>
+ <itemData name="Comment" defStyleNum="dsComment" />
+ <itemData name="Char" defStyleNum="dsChar" />
+ <itemData name="String" defStyleNum="dsString" />
+ <itemData name="Label" defStyleNum="dsOthers" />
+ <itemData name="Decimal" defStyleNum="dsDecVal"/>
+ <itemData name="Octal" defStyleNum="dsBaseN"/>
+ <itemData name="Hex" defStyleNum="dsBaseN"/>
+ <itemData name="Float" defStyleNum="dsFloat"/>
+ <itemData name="Region Marker" defStyleNum="dsRegionMarker"/>
+ </itemDatas>
+ </highlighting>
+ <general>
+ <comments>
+ <comment name="singleLine" start="#" />
+ </comments>
+ <keywords casesensitive="0" weakDeliminator="."/>
+ </general>
+</language>
diff --git a/kate/data/modula-2.xml b/kate/data/modula-2.xml
new file mode 100644
index 000000000..c48fc09cd
--- /dev/null
+++ b/kate/data/modula-2.xml
@@ -0,0 +1,188 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+<language name="Modula-2" version="1.03" kateversion="2.1" section="Sources" extensions="*.mod;*.def;*.mi;*.md" mimetype="text/x-modula-2">
+ <highlighting>
+ <list name="directives">
+ <item> ASSEMBLER </item>
+ <item> ALLOCATE </item>
+ <item> DEALLOCATE </item>
+ <item> SIZE </item>
+ <item> Write </item>
+ <item> WriteString </item>
+ <item> WriteCard </item>
+ <item> WriteLn </item>
+ <item> WriteBf </item>
+ <item> WriteInt </item>
+ <item> WriteReal </item>
+ <item> WriteLongReal </item>
+ <item> Read </item>
+ <item> ReadString </item>
+ <item> ReadCard </item>
+ <item> ReadInt </item>
+ <item> ReadReal </item>
+ <item> ReadLongReal </item>
+ <item> Open </item>
+ <item> Close </item>
+ <item> OpenInput </item>
+ <item> OpenOutput </item>
+ <item> Accessible </item>
+ <item> Erase </item>
+ <item> EOF </item>
+ <item> Done </item>
+ <item> EmptyString </item>
+ <item> Assign </item>
+ <item> Append </item>
+ <item> Length </item>
+ <item> StrEq </item>
+ <item> Copy </item>
+ <item> Concat </item>
+ <item> pos </item>
+ <item> Delete </item>
+ <item> Insert </item>
+ <item> compare </item>
+ <item> CAPS </item>
+ <item> PutBf </item>
+ <item> GetArgs </item>
+ <item> GetEnv </item>
+ <item> ResetClock </item>
+ <item> UserTime </item>
+ <item> SystemTime </item>
+ <item> GetChar </item>
+ <item> GetInt </item>
+ <item> GetCard </item>
+ <item> GetString </item>
+ <item> GetReal </item>
+ <item> GetLongReal </item>
+ <item> PutChar </item>
+ <item> PutInt </item>
+ <item> PutCard </item>
+ <item> PutString </item>
+ <item> PutReal </item>
+ <item> PutLongReal </item>
+ <item> PutLn </item>
+ </list>
+ <list name="keywords">
+ <item> AND </item>
+ <item> ARRAY </item>
+ <item> ASM </item>
+ <item> BEGIN </item>
+ <item> CASE </item>
+ <item> CONST </item>
+ <item> DIV </item>
+ <item> DO </item>
+ <item> ELSE </item>
+ <item> ELSIF </item>
+ <item> END </item>
+ <item> FOR </item>
+ <item> IF </item>
+ <item> IMPLEMENTATION </item>
+ <item> IN </item>
+ <item> SET </item>
+ <item> INCL </item>
+ <item> EXCL </item>
+ <item> ABS </item>
+ <item> BITSET </item>
+ <item> CAP </item>
+ <item> CHR </item>
+ <item> DEC </item>
+ <item> HALT </item>
+ <item> HIGH </item>
+ <item> INC </item>
+ <item> MAX </item>
+ <item> MIN </item>
+ <item> ODD </item>
+ <item> ORD </item>
+ <item> PROC </item>
+ <item> TRUNC </item>
+ <item> VAL </item>
+ <item> MOD </item>
+ <item> NIL </item>
+ <item> NOT </item>
+ <item> OF </item>
+ <item> OR </item>
+ <item> PROCEDURE </item>
+ <item> MODULE </item>
+ <item> DEFINITION </item>
+ <item> RECORD </item>
+ <item> REPEAT </item>
+ <item> THEN </item>
+ <item> TO </item>
+ <item> TYPE </item>
+ <item> UNTIL </item>
+ <item> LOOP </item>
+ <item> VAR </item>
+ <item> WHILE </item>
+ <item> WITH </item>
+ <item> EXIT </item>
+ <item> FALSE </item>
+ <item> TRUE </item>
+ <item> BY </item>
+ <item> FROM </item>
+ <item> IMPORT </item>
+ <item> EXPORT </item>
+ <item> QUALIFIED </item>
+ <item> RETURN </item>
+ <item> NEWPROCESS </item>
+ <item> TRANSFER </item>
+ <item> IOTRANSFER </item>
+ <item> FOREIGN </item>
+ </list>
+ <list name="types">
+ <item> INTEGER </item>
+ <item> CARDINAL </item>
+ <item> SHORTINT </item>
+ <item> SHORTCARD </item>
+ <item> LONGINT </item>
+ <item> LONGREAL </item>
+ <item> CHAR </item>
+ <item> BOOLEAN </item>
+ <item> POINTER </item>
+ <item> ADDRESS </item>
+ <item> ADR </item>
+ <item> REAL </item>
+ <item> File </item>
+ </list>
+ <contexts>
+ <context attribute="Normal Text" lineEndContext="#stay" name="Normal">
+ <keyword attribute="Keyword" context="#stay" String="keywords"/>
+ <keyword attribute="Directive" context="#stay" String="directives"/>
+ <keyword attribute="Type" context="#stay" String="types"/>
+ <Float attribute="Number" context="#stay"/>
+ <Int attribute="Number" context="#stay"/>
+ <DetectChar attribute="String" context="String1" char="&quot;" />
+ <DetectChar attribute="String" context="String2" char="'" />
+ <StringDetect attribute="Directive" context="Prep1" String="(*$"/>
+ <Detect2Chars attribute="Comment" context="Comment2" char="(" char1="*"/>
+ </context>
+ <context attribute="String" lineEndContext="#pop" name="String1">
+ <DetectChar attribute="String" context="#pop" char="&quot;"/>
+ </context>
+ <context attribute="String" lineEndContext="#pop" name="String2">
+ <DetectChar attribute="String" context="#pop" char="'" />
+ </context>
+ <context attribute="Comment" lineEndContext="#stay" name="Comment2">
+ <Detect2Chars attribute="Comment" context="#pop" char="*" char1=")"/>
+ </context>
+ <context attribute="Comment" lineEndContext="#pop" name="Comment3" />
+ <context attribute="Directive" lineEndContext="#stay" name="Prep1">
+ <StringDetect attribute="Directive" context="Prep1" String="$*)"/>
+ </context>
+
+ </contexts>
+ <itemDatas>
+ <itemData name="Normal Text" defStyleNum="dsNormal" />
+ <itemData name="Keyword" defStyleNum="dsKeyword" />
+ <itemData name="Type" defStyleNum="dsDataType"/>
+ <itemData name="Number" defStyleNum="dsDecVal" />
+ <itemData name="String" defStyleNum="dsString" />
+ <itemData name="Directive" defStyleNum="dsOthers" />
+ <itemData name="Comment" defStyleNum="dsComment" />
+ </itemDatas>
+ </highlighting>
+ <general>
+ <keywords casesensitive="1" />
+ <comments>
+ <comment name="multiLine" start="(*" end="*)" />
+ </comments>
+ </general>
+</language>
diff --git a/kate/data/mup.xml b/kate/data/mup.xml
new file mode 100644
index 000000000..890cf8c40
--- /dev/null
+++ b/kate/data/mup.xml
@@ -0,0 +1,865 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+<language name="Music Publisher" version="1.06" kateversion="2.4" section="Other" extensions="*.mup;*.not" mimetype="text/x-mup;audio/x-mup;application/x-mup;audio/x-notes" casesensitive="1" author="Wilbert Berendsen (wilbert@kde.nl)" license="LGPL">
+
+ <highlighting>
+
+ <list name="mupcontexts">
+ <item> score </item>
+ <item> music </item>
+ <item> header </item>
+ <item> header2 </item>
+ <item> footer </item>
+ <item> footer2 </item>
+ <item> top </item>
+ <item> top2 </item>
+ <item> bottom </item>
+ <item> bottom2 </item>
+ <item> staff </item>
+ <item> voice </item>
+ <item> grids </item>
+ <item> music </item>
+ <item> headshapes </item>
+ <item> block </item>
+ </list>
+
+
+ <list name="mupparameters">
+ <item> aboveorder </item>
+ <item> addtranspose </item>
+ <item> barstyle </item>
+ <item> beamslope </item>
+ <item> beamstyle </item>
+ <item> beloworder </item>
+ <item> betweenorder </item>
+ <item> bottommargin </item>
+ <item> brace </item>
+ <item> bracket </item>
+ <item> cancelkey </item>
+ <item> chorddist </item>
+ <item> clef </item>
+ <item> crescdist </item>
+ <item> defoct </item>
+ <item> dist </item>
+ <item> division </item>
+ <item> dyndist </item>
+ <item> endingstyle </item>
+ <item> firstpage </item>
+ <item> font </item>
+ <item> fontfamily </item>
+ <item> gridfret </item>
+ <item> gridsatend </item>
+ <item> gridscale </item>
+ <item> gridswhereused </item>
+ <item> key </item>
+ <item> label </item>
+ <item> label2 </item>
+ <item> leftmargin </item>
+ <item> lyricsalign </item>
+ <item> lyricsfont </item>
+ <item> lyricsfontfamily </item>
+ <item> lyricssize </item>
+ <item> measnum </item>
+ <item> measnumfont </item>
+ <item> measnumfontfamily </item>
+ <item> measnumsize </item>
+ <item> noteheads </item>
+ <item> numbermrpt </item>
+ <item> ontheline </item>
+ <item> packexp </item>
+ <item> packfact </item>
+ <item> pad </item>
+ <item> pageheight </item>
+ <item> pagewidth </item>
+ <item> panelsperpage </item>
+ <item> pedstyle </item>
+ <item> printmultnum </item>
+ <item> rehstyle </item>
+ <item> release </item>
+ <item> restcombine </item>
+ <item> restsymmult </item>
+ <item> rightmargin </item>
+ <item> scale </item>
+ <item> scorepad </item>
+ <item> scoresep </item>
+ <item> size </item>
+ <item> stafflines </item>
+ <item> staffpad </item>
+ <item> staffs </item>
+ <item> staffscale </item>
+ <item> staffsep </item>
+ <item> stemlen </item>
+ <item> swingunit </item>
+ <item> sylposition </item>
+ <item> tabwhitebox </item>
+ <item> time </item>
+ <item> timeunit </item>
+ <item> topmargin </item>
+ <item> transpose </item>
+ <item> units </item>
+ <item> visible </item>
+ <item> vscheme </item>
+ <item> warn </item>
+ </list>
+
+
+ <list name="mupvalues">
+ <item> y </item>
+ <item> n </item>
+ <item> 2f </item>
+ <item> 2o </item>
+ <item> 3f </item>
+ <item> 3o </item>
+ <item> mussym </item>
+ <item> octave </item>
+ <item> dyn </item>
+ <item> othertext </item>
+ <item> chord </item>
+ <item> lyrics </item>
+ <item> ending </item>
+ <item> reh </item>
+ <item> up </item>
+ <item> down </item>
+ <item> major </item>
+ <item> minor </item>
+ <item> perfect </item>
+ <item> augmented </item>
+ <item> diminished </item>
+ <item> maj </item>
+ <item> min </item>
+ <item> per </item>
+ <item> aug </item>
+ <item> dim </item>
+ <item> pedal </item>
+ <item> 8treble </item>
+ <item> treble8 </item>
+ <item> treble </item>
+ <item> frenchviolin </item>
+ <item> soprano </item>
+ <item> mezzosoprano </item>
+ <item> alto </item>
+ <item> tenor </item>
+ <item> baritone </item>
+ <item> bass </item>
+ <item> cut </item>
+ <item> common </item>
+ <item> line </item>
+ <item> alt </item>
+ <item> pedstar </item>
+ <item> top </item>
+ <item> barred </item>
+ <item> grouped </item>
+ <item> times </item>
+ <item> boxed </item>
+ <item> circled </item>
+ <item> plain </item>
+ <item> 1n </item>
+ <item> 5n </item>
+ <item> 1drum </item>
+ <item> 5drum </item>
+ <item> drum </item>
+ <item> tab </item>
+ <item> inches </item>
+ <item> cm </item>
+ <item> whereused </item>
+ </list>
+
+
+ <list name="mupmacrodirectives_start">
+ <item> define </item>
+ <item> ifdef </item>
+ <item> ifndef </item>
+ </list>
+
+
+ <list name="mupmacrodirectives_end">
+ <item> @ </item>
+ <item> endif </item>
+ </list>
+
+
+ <list name="mupmacrodirectives">
+ <item> else </item>
+ <item> include </item>
+ <item> undef </item>
+ </list>
+
+
+ <list name="mupspecialchars">
+ <item> exclamdown </item>
+ <item> questiondown </item>
+ <item> sterling </item>
+ <item> yen </item>
+ <item> cent </item>
+ <item> quotedblbase </item>
+ <item> quotedblleft </item>
+ <item> `` </item>
+ <item> quotedblright </item>
+ <item> '' </item>
+ <item> guillemotleft </item>
+ <item> &lt;&lt; </item>
+ <item> guillemotright </item>
+ <item> &gt;&gt; </item>
+ <item> guildsinglleft </item>
+ <item> guilsinglright </item>
+ <item> dagger </item>
+ <item> daggerdbl </item>
+ <item> grave </item>
+ <item> acute </item>
+ <item> macron </item>
+ <item> breve </item>
+ <item> dotaccent </item>
+ <item> dieresis </item>
+ <item> ring </item>
+ <item> cedilla </item>
+ <item> hungarumlaut </item>
+ <item> ogonek </item>
+ <item> caron </item>
+ <item> emdash </item>
+ <item> AE </item>
+ <item> ae </item>
+ <item> ordfeminine </item>
+ <item> ordmasculine </item>
+ <item> Lslash </item>
+ <item> L/ </item>
+ <item> lslash </item>
+ <item> l/ </item>
+ <item> Oslash </item>
+ <item> O/ </item>
+ <item> oslash </item>
+ <item> o/ </item>
+ <item> OE </item>
+ <item> oe </item>
+ <item> dotlessi </item>
+ <item> germandbls </item>
+ <item> ss </item>
+ <item> Aacute </item>
+ <item> A' </item>
+ <item> aacute </item>
+ <item> a' </item>
+ <item> Acircumflex </item>
+ <item> A^ </item>
+ <item> acircumflex </item>
+ <item> a^ </item>
+ <item> Adieresis </item>
+ <item> A: </item>
+ <item> adieresis </item>
+ <item> a: </item>
+ <item> Agrave </item>
+ <item> A` </item>
+ <item> agrave </item>
+ <item> a` </item>
+ <item> Aring </item>
+ <item> Ao </item>
+ <item> aring </item>
+ <item> ao </item>
+ <item> Atilde </item>
+ <item> A~ </item>
+ <item> atilde </item>
+ <item> a~ </item>
+ <item> Ccedilla </item>
+ <item> C, </item>
+ <item> ccedilla </item>
+ <item> c, </item>
+ <item> Eacute </item>
+ <item> E' </item>
+ <item> eacute </item>
+ <item> e' </item>
+ <item> Ecircumflex </item>
+ <item> E^ </item>
+ <item> ecircumflex </item>
+ <item> e^ </item>
+ <item> Edieresis </item>
+ <item> E: </item>
+ <item> edieresis </item>
+ <item> e: </item>
+ <item> Egrave </item>
+ <item> E` </item>
+ <item> egrave </item>
+ <item> e` </item>
+ <item> Iacute </item>
+ <item> I' </item>
+ <item> iacute </item>
+ <item> i' </item>
+ <item> Icircumflex </item>
+ <item> I^ </item>
+ <item> icircumflex </item>
+ <item> i^ </item>
+ <item> Idieresis </item>
+ <item> i: </item>
+ <item> idieresis </item>
+ <item> i: </item>
+ <item> Igrave </item>
+ <item> I` </item>
+ <item> igrave </item>
+ <item> i` </item>
+ <item> Ntilde </item>
+ <item> N~ </item>
+ <item> ntilde </item>
+ <item> n~ </item>
+ <item> Oacute </item>
+ <item> O' </item>
+ <item> oacute </item>
+ <item> o' </item>
+ <item> Ocircumflex </item>
+ <item> O^ </item>
+ <item> ocircumflex </item>
+ <item> o^ </item>
+ <item> Odieresis </item>
+ <item> O: </item>
+ <item> odieresis </item>
+ <item> o: </item>
+ <item> Ograve </item>
+ <item> O` </item>
+ <item> ograve </item>
+ <item> o` </item>
+ <item> Otilde </item>
+ <item> O~ </item>
+ <item> otilde </item>
+ <item> o~ </item>
+ <item> Scaron </item>
+ <item> Sv </item>
+ <item> scaron </item>
+ <item> sv </item>
+ <item> Uacute </item>
+ <item> U' </item>
+ <item> uacute </item>
+ <item> u' </item>
+ <item> Ucircumflex </item>
+ <item> U^ </item>
+ <item> ucircumflex </item>
+ <item> u^ </item>
+ <item> Udieresis </item>
+ <item> U: </item>
+ <item> udieresis </item>
+ <item> u: </item>
+ <item> Ugrave </item>
+ <item> U` </item>
+ <item> ugrave </item>
+ <item> u` </item>
+ <item> Ydieresis </item>
+ <item> Y: </item>
+ <item> ydieresis </item>
+ <item> y: </item>
+ <item> Zcaron </item>
+ <item> Zv </item>
+ <item> zcaron </item>
+ <item> zv </item>
+ <item> bullet </item>
+ <item> space </item>
+ </list>
+
+
+ <list name="mupmusicchars">
+ <item> gclef </item>
+ <item> fclef </item>
+ <item> cclef </item>
+ <item> com </item>
+ <item> cut </item>
+ <item> flat </item>
+ <item> dblflat </item>
+ <item> sharp </item>
+ <item> dblsharp </item>
+ <item> nat </item>
+ <item> 4n </item>
+ <item> 2n </item>
+ <item> 1n </item>
+ <item> dblwhole </item>
+ <item> xnote </item>
+ <item> diamond </item>
+ <item> filldiamond </item>
+ <item> dwhdiamond </item>
+ <item> dn2n </item>
+ <item> dn4n </item>
+ <item> dn8n </item>
+ <item> dn16n </item>
+ <item> dn32n </item>
+ <item> dn64n </item>
+ <item> dn128n </item>
+ <item> dn256n </item>
+ <item> up2n </item>
+ <item> up4n </item>
+ <item> up8n </item>
+ <item> up16n </item>
+ <item> up32n </item>
+ <item> up64n </item>
+ <item> up128n </item>
+ <item> up256n </item>
+ <item> upflag </item>
+ <item> dnflag </item>
+ <item> qwhrest </item>
+ <item> dwhrest </item>
+ <item> 1rest </item>
+ <item> 2rest </item>
+ <item> 4rest </item>
+ <item> 8rest </item>
+ <item> 16rest </item>
+ <item> 32rest </item>
+ <item> 64rest </item>
+ <item> 128rest </item>
+ <item> 256rest </item>
+ <item> begped </item>
+ <item> endped </item>
+ <item> pedal </item>
+ <item> tr </item>
+ <item> mor </item>
+ <item> invmor </item>
+ <item> turn </item>
+ <item> invturn </item>
+ <item> ferm </item>
+ <item> uferm </item>
+ <item> acc_gt </item>
+ <item> acc_hat </item>
+ <item> acc_uhat </item>
+ <item> leg </item>
+ <item> dot </item>
+ <item> wedge </item>
+ <item> uwedge </item>
+ <item> sign </item>
+ <item> coda </item>
+ <item> upbow </item>
+ <item> dnbow </item>
+ <item> rr </item>
+ <item> measrpt </item>
+ <item> copyright </item>
+ <item> dim </item>
+ <item> halfdim </item>
+ <item> triangle </item>
+
+ <item> smgclef </item>
+ <item> smfclef </item>
+ <item> smcclef </item>
+ <item> smcom </item>
+ <item> smcut </item>
+ <item> smflat </item>
+ <item> smdblflat </item>
+ <item> smsharp </item>
+ <item> smdblsharp </item>
+ <item> smnat </item>
+ <item> sm4n </item>
+ <item> sm2n </item>
+ <item> sm1n </item>
+ <item> smdblwhole </item>
+ <item> smxnote </item>
+ <item> smdiamond </item>
+ <item> smfilldiamond </item>
+ <item> smdwhdiamond </item>
+ <item> smdn2n </item>
+ <item> smdn4n </item>
+ <item> smdn8n </item>
+ <item> smdn16n </item>
+ <item> smdn32n </item>
+ <item> smdn64n </item>
+ <item> smdn128n </item>
+ <item> smdn256n </item>
+ <item> smup2n </item>
+ <item> smup4n </item>
+ <item> smup8n </item>
+ <item> smup16n </item>
+ <item> smup32n </item>
+ <item> smup64n </item>
+ <item> smup128n </item>
+ <item> smup256n </item>
+ <item> smupflag </item>
+ <item> smdnflag </item>
+ <item> smqwhrest </item>
+ <item> smdwhrest </item>
+ <item> sm1rest </item>
+ <item> sm2rest </item>
+ <item> sm4rest </item>
+ <item> sm8rest </item>
+ <item> sm16rest </item>
+ <item> sm32rest </item>
+ <item> sm64rest </item>
+ <item> sm128rest </item>
+ <item> sm256rest </item>
+ <item> smbegped </item>
+ <item> smendped </item>
+ <item> smpedal </item>
+ <item> smtr </item>
+ <item> smmor </item>
+ <item> sminvmor </item>
+ <item> smturn </item>
+ <item> sminvturn </item>
+ <item> smferm </item>
+ <item> smuferm </item>
+ <item> smacc_gt </item>
+ <item> smacc_hat </item>
+ <item> smacc_uhat </item>
+ <item> smleg </item>
+ <item> smdot </item>
+ <item> smwedge </item>
+ <item> smuwedge </item>
+ <item> smsign </item>
+ <item> smcoda </item>
+ <item> smupbow </item>
+ <item> smdnbow </item>
+ <item> smrr </item>
+ <item> smmeasrpt </item>
+ <item> smcopyright </item>
+ <item> smdim </item>
+ <item> smhalfdim </item>
+ <item> smtriangle </item>
+ </list>
+
+
+ <list name="mupprintcommands">
+ <item> print </item>
+ <item> left </item>
+ <item> right </item>
+ <item> center </item>
+ <item> title </item>
+ <item> paragraph </item>
+ <item> postscript </item>
+ </list>
+
+
+ <list name="mupfontnames">
+ <item> avantgarde </item>
+ <item> bookman </item>
+ <item> courier </item>
+ <item> helvetica </item>
+ <item> newcentury </item>
+ <item> palatino </item>
+ <item> times </item>
+ </list>
+
+
+ <list name="mupfontstyles">
+ <item> rom </item>
+ <item> bold </item>
+ <item> ital </item>
+ <item> boldital </item>
+ </list>
+
+
+ <list name="mupprintspecifiers">
+ <item> chord </item>
+ <item> analysis </item>
+ <item> figbass </item>
+ <item> dyn </item>
+ </list>
+
+
+ <list name="mupgraphics">
+ <item> dotted </item>
+ <item> dashed </item>
+ <item> wavy </item>
+ <item> wide </item>
+ <item> medium </item>
+
+ <item> line </item>
+ <item> curve </item>
+ <item> to </item>
+ <item> bulge </item>
+
+ <item> octave </item>
+ <item> mussym </item>
+ <item> phrase </item>
+ <item> pedal </item>
+ <item> roll </item>
+ <item> to </item>
+
+ <item> down </item>
+ <item> up </item>
+ <item> with </item>
+
+ <item> midi </item>
+ </list>
+
+
+ <list name="muplocations">
+ <item> above </item>
+ <item> below </item>
+ <item> between </item>
+ <item> all </item>
+ </list>
+
+
+ <contexts>
+ <context attribute="Normal Text" lineEndContext="#stay" name="Normal">
+ <keyword attribute="Context" context="#stay" String="mupcontexts" />
+ <RegExpr attribute="Lyrics" context="#stay" String="\blyrics\b" />
+ <RegExpr attribute="Barline" context="Barline" String="\b((dashed|dotted)\s+)?(bar|endbar|dblbar|invisbar|repeatstart|repeatboth|repeatend|restart)\b" />
+ <RegExpr attribute="Newscore" context="#stay" String="\bnew(score|page)\b" />
+ <RegExpr attribute="Newscore" context="#stay" String="\bmultirest\s+[0-9]+\b" />
+ <RegExpr attribute="Unset Command" context="Unset" String="\bunset\b" />
+ <Detect2Chars attribute="Comment" context="Comment" char="/" char1="/"/>
+ <DetectChar attribute="String" context="String" char="&quot;"/>
+ <RegExpr attribute="Special Char" context="#stay" String="\\$" />
+ <keyword attribute="Print Command" context="Print Command" String="mupprintcommands" />
+ <keyword attribute="Print Command" context="Print Command" String="mupfontnames" />
+ <keyword attribute="Print Command" context="Print Command" String="mupfontstyles" />
+ <RegExpr attribute="Print Command" context="Print Command" String="\b((ragged|justified)\s+)?paragraph\b" />
+ <keyword attribute="Print Command" context="#stay" String="mupprintspecifiers" />
+ <keyword attribute="Print Command" context="#stay" String="mupgraphics" />
+ <keyword attribute="Print Command" context="#stay" String="muplocations" />
+ <RegExpr attribute="Print Command" context="#stay" String="\bdist(?=\s+[^=])" />
+ <keyword attribute="Parameter" context="Parameter" String="mupparameters" />
+ <RegExpr attribute="Special Char" context="Bracket" String="\[(?=(grace|xnote|cue|diam|with|slash|up|down|len|pad|ho|dist|hs|c\b|=))" />
+ <DetectChar attribute="Special Char" context="Tuplet" char="}" />
+ <AnyChar attribute="Special Char" context="#stay" String="[]{" />
+ <RegExpr attribute="Special Char" context="#stay" String="(&lt;&lt;|&gt;&gt;)" />
+ <RegExpr attribute="Note" context="Note"
+ String="(\(\s*)?((1/4|1/2|1|2|4|8|16|32|64|128|256)\.*\s*)?((\(\s*)?([a-grs]|us)(?!bm)([0-9'?\sxn]|[+-]+|[&amp;#]{1,2}|\(\s*[&amp;#]{1,2}\s*\)|\(\s*[xn]\s*\)|\(\s*[0-9]\s*\))*\)?\s*)*\s*(?=[;~=&quot;&lt;A-Z@^]|\b(bm|es?bm|dashed|dotted|tie|slur|alt|hs|ifn?def|else|elseif|endif|with|above)\b)" />
+ <RegExpr attribute="Normal Text" context="Note" String=";\s*(?=[~=&lt;]|\b(bm|es?bm|dashed|dotted|tie|slur|alt|hs|ifn?def|else|elseif|endif)\b)" />
+ <RegExpr attribute="Note" context="#stay" String="(1/4|1/2|1|2|4|8|16|32|64|128|256)?mu?[rs]+\s*(?=;)" />
+ <RegExpr attribute="Note" context="#stay" String="m\s*rpt\s*(?=;)" />
+ <RegExpr attribute="Location" context="#stay" String="=([a-z]|_[a-z][a-z_0-9]*)\b" />
+ <RegExpr attribute="Location" context="Location" String="([a-z]|_[a-z][a-z_0-9]*)\.[xynews]\b" />
+ <RegExpr attribute="Location Probably" context="#stay" String="([a-z]|_[a-z][a-z_0-9]*)\.(?=[A-Z])" />
+ <RegExpr attribute="Normal Text" context="Location Probably" String="[(,]\s*(?=([h-qt-z]|_[a-z][a-z_0-9]*)\s*[,)])" />
+ <RegExpr attribute="Normal Text" context="Note Probably" String="[(,]\s*(?=[a-grs]\s*[,)])" />
+ <IncludeRules context="Macro" />
+ <RegExpr attribute="Normal Text" context="#stay" String="[0-9.]*\s*til\s*(([0-9]+m(\s*\+\s*[0-9.]+)?)|[0-9.]+)\s*;" />
+ <RegExpr attribute="Error" context="#stay" String="[0-9]*[a-z_]+" />
+ </context>
+
+
+ <context attribute="Parameter" lineEndContext="#pop" name="Parameter"
+ fallthrough="true" fallthroughContext="#pop">
+ <DetectChar attribute="Normal Text" context="Value" char="=" />
+ <RegExpr attribute="Parameter" context="#stay" String="\s+" />
+ </context>
+
+
+ <context attribute="Value" lineEndContext="#pop" name="Value"
+ fallthrough="true" fallthroughContext="#pop">
+ <DetectChar attribute="Normal Text" context="#pop" char=";" />
+ <RegExpr attribute="Normal Text" context="#stay" String="[\s,&amp;()-]+" />
+ <keyword attribute="Value" context="#stay" String="mupvalues" />
+ <keyword attribute="Value" context="#pop" String="mupfontnames" />
+ <keyword attribute="Value" context="#pop" String="mupfontstyles" />
+ <RegExpr attribute="Value" context="#stay" String="\b[1-9][0-9]*/(1|2|4|8|16|32|64|128)n?\b" />
+ <RegExpr attribute="Value" context="#stay" String="\b[a-g][#&amp;]?'?([0-9]\b)?" />
+ <RegExpr attribute="Value" context="#stay" String="[0-7][#&amp;]" />
+ <RegExpr attribute="Value" context="#stay" String="r\b" />
+ <Float attribute="Value" context="#stay" />
+ <Int attribute="Value" context="#stay" />
+ <DetectChar attribute="String" context="String" char="&quot;"/>
+ <IncludeRules context="Macro" />
+ <RegExpr attribute="Error" context="#stay" String="[a-z][a-z0-9]*" />
+ </context>
+
+
+ <context attribute="Parameter" lineEndContext="#pop" name="Unset"
+ fallthrough="true" fallthroughContext="#pop">
+ <keyword attribute="Parameter" context="#stay" String="mupparameters" />
+ <RegExpr attribute="Normal Text" context="#stay" String="[\s,]+" />
+ <RegExpr attribute="Error" context="#pop" String="\w+" />
+ </context>
+
+
+ <context attribute="Print Command" lineEndContext="#pop" name="Print Command"
+ fallthrough="true" fallthroughContext="#pop">
+ <DetectSpaces />
+ <keyword attribute="Print Command" context="#stay" String="mupfontstyles" />
+ <RegExpr attribute="Print Command" context="#stay" String="\bnl\b" />
+ <RegExpr attribute="Print Command" context="#pop" String="\([0-9]+\)" />
+ </context>
+
+
+ <context attribute="Barline" lineEndContext="#pop" name="Barline"
+ fallthrough="true" fallthroughContext="#pop">
+ <DetectSpaces />
+ <RegExpr attribute="Barline" context="#stay" String="\b(ending|endending|hidechanges)\b" />
+ <RegExpr attribute="Barline" context="Bar Rehearsal" String="\breh(earsal)?\b" />
+ <RegExpr attribute="Barline" context="#stay" String="\bmnum\s*=\s*[0-9]+" />
+ <RegExpr attribute="Barline" context="#stay" String="\bnum\s*=\s*[0-9]+" />
+ <RegExpr attribute="Barline" context="#stay" String="\blet\s*=\s*(&quot;[A-Z]{1,2}&quot;)?" />
+ <RegExpr attribute="Barline" context="#stay" String="\bpad\s+[0-9]+" />
+ <RegExpr attribute="Location" context="#stay" String="=([a-z]|_[a-z][a-z_0-9]*)\b" />
+ <IncludeRules context="Macro" />
+ </context>
+
+
+ <context attribute="Barline" lineEndContext="#pop" name="Bar Rehearsal"
+ fallthrough="true" fallthroughContext="#pop">
+ <RegExpr attribute="Print Command" context="#stay" String="\s+" />
+ <keyword attribute="Print Command" context="Print Command" String="mupfontnames" />
+ <keyword attribute="Print Command" context="Print Command" String="mupfontstyles" />
+ <RegExpr attribute="Barline" context="#pop" String="\b(let|mnum|num)\b" />
+ <IncludeRules context="Macro" />
+ </context>
+
+
+ <context attribute="Note" lineEndContext="#pop" name="Note"
+ fallthrough="true" fallthroughContext="#pop">
+ <RegExpr attribute="Note Attribute" context="#stay" String="(\bdashed\s+|\bdotted\s+)?(&lt;(/n|\\n|n/|n\\|[a-g]([+-]*|[0-7]))?&gt;|tie|slur|[~])" />
+ <RegExpr attribute="Note Attribute" context="#stay" String="^(/|[a-g]([+-]*|[0-7]))" />
+ <RegExpr attribute="Note Attribute" context="#stay" String="\bbm\b(\s+with\s+staff\s+(below|above)\b)?" />
+ <RegExpr attribute="Note Attribute" context="#stay" String="\bes?bm\b" />
+ <RegExpr attribute="Note Attribute" context="#stay" String="\balt\s+[1-9]\b" />
+ <RegExpr attribute="Note Attribute" context="#stay" String="\bhs\s+" />
+ <DetectChar attribute="String" context="String" char="&quot;"/>
+ <IncludeRules context="Macro" />
+ </context>
+
+
+ <context attribute="Note Attribute" lineEndContext="#pop" name="Bracket"
+ fallthrough="true" fallthroughContext="#pop">
+ <DetectChar attribute="Special Char" context="#pop" char="]" />
+ <RegExpr attribute="Normal Text" context="#stay" String="[\s;,]+" />
+ <RegExpr attribute="Note Attribute" context="#stay" String="\b(grace|xnote|cue|diam|up|down)\b" />
+ <RegExpr attribute="Note Attribute" context="#stay" String="\b(slash|len|pad|ho|dist)\s*[0-9.+-]*" />
+ <RegExpr attribute="Note Attribute" context="Bracket With" String="\bwith\s*(?=[A-Z&quot;^&gt;.-])" />
+ <RegExpr attribute="Note Attribute" context="Bracket Hs" String="\bhs\s*(?=[A-Z&quot;])" />
+ <RegExpr attribute="Location" context="#stay" String="=([a-z]|_[a-z][a-z_0-9]*)\b" />
+ <RegExpr attribute="Normal Text" context="#stay" String="\bc\b" />
+ <IncludeRules context="Macro" />
+ </context>
+
+
+ <context attribute="Note Attribute" lineEndContext="#pop" name="Bracket With"
+ fallthrough="true" fallthroughContext="#pop">
+ <DetectChar attribute="String" context="String" char="&quot;" />
+ <RegExpr attribute="Note Attribute" context="#stay" String="[&gt;.^-]+" />
+ <RegExpr attribute="Normal Text" context="#stay" String="[\s,]+" />
+ <IncludeRules context="Macro" />
+ </context>
+
+
+ <context attribute="Note Attribute" lineEndContext="#pop" name="Bracket Hs"
+ fallthrough="true" fallthroughContext="#pop">
+ <DetectChar attribute="String" context="String" char="&quot;" />
+ <IncludeRules context="Macro" />
+ </context>
+
+
+ <context attribute="Note" lineEndContext="#pop" name="Note Probably"
+ fallthrough="true" fallthroughContext="#pop">
+ <RegExpr attribute="Note" context="#pop" String="[a-grs]*" />
+ </context>
+
+
+ <context attribute="Tuplet" lineEndContext="#pop" name="Tuplet"
+ fallthrough="true" fallthroughContext="#pop">
+ <RegExpr attribute="Tuplet" context="#pop" String="\s*(above|below)?\s*[0-9]{1,2}(y|n|num)?(\s*,\s*[0-9]{1,2}\.?([+][0-9]{1,2}\.?)*)?" />
+ </context>
+
+
+ <context attribute="Normal Text" lineEndContext="#pop" name="Location"
+ fallthrough="true" fallthroughContext="#pop">
+ <RegExpr attribute="Normal Text" context="#stay" String="[+-\s]+" />
+ <Float attribute="Normal Text" context="#stay" />
+ <RegExpr attribute="Location" context="#stay" String="\btime\b" />
+ <IncludeRules context="Macro" />
+ </context>
+
+
+ <context attribute="Location Problably" lineEndContext="#pop" name="Location Probably"
+ fallthrough="true" fallthroughContext="#pop">
+ <RegExpr attribute="Location Probably" context="#pop" String="[h-qt-z]|_[a-z][a-z_0-9]*" />
+ </context>
+
+
+ <context attribute="Comment" lineEndContext="#pop" name="Comment">
+ <IncludeRules context="##Alerts" />
+ </context>
+
+
+ <context attribute="String" lineEndContext="#stay" name="String">
+ <DetectChar attribute="String" context="#pop" char="&quot;" />
+ <RegExpr attribute="String Special" context="#stay" String="[\\][][{}%#&quot;nb|^:,\\/ ]" />
+ <StringDetect attribute="String Special" context="Special Char" String="\(" />
+ <StringDetect attribute="String Special" context="Font Name" String="\f(" />
+ <StringDetect attribute="String Special" context="Font Size" String="\s(" />
+ <RegExpr attribute="String Special" context="#stay" String="\\v\(-?[0-9]{1,3}\)" />
+ <RegExpr attribute="String Lyrics" context="#stay" String="[~&lt;&gt;|^]" />
+ <RegExpr attribute="String Lyrics" context="#stay" String="[-+]?[0-9]+\|" />
+ </context>
+
+
+ <context attribute="String Special" lineEndContext="#stay" name="Special Char"
+ fallthrough="true" fallthroughContext="#pop">
+ <DetectChar attribute="String Special" context="#pop" char=")" />
+ <keyword attribute="String Special" context="#stay" String="mupspecialchars" />
+ <keyword attribute="String Special" context="#stay" String="mupmusicchars" />
+ <RegExpr attribute="String Special" context="#stay" String="[AaEeOo]['`:^~](?=\))" />
+ <RegExpr attribute="String Special" context="#stay" String="[IiUu]['`:^](?=\))" />
+ <RegExpr attribute="String Special" context="#stay" String="[Nn]~(?=\))" />
+ <RegExpr attribute="String Special" context="#stay" String="[Yy]:(?=\))" />
+ <RegExpr attribute="String Special" context="#stay" String="[LlOo]/(?=\))" />
+ <RegExpr attribute="String Special" context="#stay" String="[Cc],(?=\))" />
+ <RegExpr attribute="String Special" context="#stay" String="(&gt;&gt;|&lt;&lt;|``|'')(?=\))" />
+ <RegExpr attribute="String Error" context="#stay" String="[^)&quot;]+" />
+ </context>
+
+
+ <context attribute="String Special" lineEndContext="#stay" name="Font Name"
+ fallthrough="true" fallthroughContext="#pop">
+ <DetectChar attribute="String Special" context="#pop" char=")" />
+ <RegExpr attribute="String Special" context="#stay" String="[ABCHNPT][RBIX](?=\))" />
+ <keyword attribute="String Special" context="Font Style" String="mupfontnames" />
+ <RegExpr attribute="String Special" context="#stay" String="(PV|previous)(?=\))" />
+ <RegExpr attribute="String Error" context="#stay" String="[^ )&quot;]+" />
+ </context>
+
+
+ <context attribute="String Special" lineEndContext="#stay" name="Font Style"
+ fallthrough="true" fallthroughContext="#pop">
+ <RegExpr attribute="String Special" context="#stay" String="\s+" />
+ <keyword attribute="String Special" context="#stay" String="mupfontstyles" />
+ <RegExpr attribute="String Error" context="#stay" String="[^ )&quot;]+" />
+ </context>
+
+
+ <context attribute="String Special" lineEndContext="#stay" name="Font Size"
+ fallthrough="true" fallthroughContext="#pop">
+ <DetectChar attribute="String Special" context="#pop" char=")" />
+ <RegExpr attribute="String Special" context="#stay" String="[-+]?[0-9]+(?=\))" />
+ <RegExpr attribute="String Special" context="#stay" String="(PV|previous)(?=\))" />
+ <RegExpr attribute="String Error" context="#stay" String="[^ )&quot;]+" />
+ </context>
+
+
+ <context attribute="Macro" lineEndContext="#pop" name="Macro">
+ <keyword attribute="Macro" context="#stay" String="mupmacrodirectives_start" beginRegion="macro" />
+ <keyword attribute="Macro" context="#stay" String="mupmacrodirectives_end" endRegion="macro" />
+ <keyword attribute="Macro" context="#stay" String="mupmacrodirectives" />
+ <RegExpr attribute="Macro" context="Macro Location" String="[A-Z][A-Z0-9_]*(?=\.[xynews]\b)" />
+ <RegExpr attribute="Macro" context="#stay" String="[A-Z][A-Z0-9_]*" />
+ <DetectChar attribute="Macro" context="#stay" char="@" endRegion="macro" />
+ </context>
+
+
+ <context attribute="Location" lineEndContext="#pop" name="Macro Location"
+ fallthrough="true" fallthroughContext="#pop">
+ <RegExpr attribute="Location Probably" context="#pop" String=".." />
+ </context>
+
+ </contexts>
+
+ <itemDatas>
+ <itemData name="Normal Text" defStyleNum="dsNormal" />
+ <itemData name="Context" defStyleNum="dsKeyword" />
+ <itemData name="Special Char" defStyleNum="dsKeyword" />
+ <itemData name="Parameter" defStyleNum="dsChar" />
+ <itemData name="Value" defStyleNum="dsFloat" />
+ <itemData name="Unset Command" defStyleNum="dsFloat" bold="1" />
+ <itemData name="Comment" defStyleNum="dsComment" />
+ <itemData name="Macro" defStyleNum="dsOthers" color="#11F" selColor="#1FF" />
+ <itemData name="Print Command" defStyleNum="dsBaseN" />
+ <itemData name="Barline" defStyleNum="dsDecVal" color="#c62" />
+ <itemData name="Newscore" defStyleNum="dsDecVal" color="#c62" bold="1" />
+ <itemData name="Note" defStyleNum="dsNormal" />
+ <itemData name="Note Attribute" defStyleNum="dsNormal" italic="1" color="#07b" />
+ <itemData name="Tuplet" defStyleNum="dsNormal" color="#035" />
+ <itemData name="Location" defStyleNum="dsKeyword" color="#0C4" bold="1" />
+ <itemData name="Location Probably" defStyleNum="dsKeyword" color="#0C4" bold="0" />
+ <itemData name="String" defStyleNum="dsString" />
+ <itemData name="String Special" defStyleNum="dsString" bold="1" />
+ <itemData name="String Error" defStyleNum="dsError" />
+ <itemData name="String Lyrics" defStyleNum="dsString" color="#800" />
+ <itemData name="Lyrics" defStyleNum="dsBaseN" bold="1" />
+ <itemData name="Error" defStyleNum="dsError" color="black" />
+ </itemDatas>
+
+ </highlighting>
+ <general>
+ <comments>
+ <comment name="singleLine" start="//"/>
+ </comments>
+ <keywords casesensitive="1" additionalDeliminator="~'`@#+-" />
+ </general>
+</language>
diff --git a/kate/data/nasm.xml b/kate/data/nasm.xml
new file mode 100644
index 000000000..8f0ef65ee
--- /dev/null
+++ b/kate/data/nasm.xml
@@ -0,0 +1,1321 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+<!--
+ NASM Intel x86 assembly syntax
+
+ Created: Nicola Gigante <nicola.gigante@gmail.com>
+ Version: 1.2
+
+ 15/01/2006: version 1.1
+ Added the rol instruction (bytewise rotate left) to the keywords list.
+ 17/01/2006: version 1.2
+ Remade the list of instructions directly from the nasm documentation.
+
+ GNU GENERAL PUBLIC LICENCE
+
+This program, including associated files, is free software. You may
+distribute it and/or modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either Version 2 of
+the license, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License along
+with this program; if not, write to the Free Software Foundation, Inc.,
+51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+-->
+
+<language name="Intel x86 (NASM)" section="Assembler" version="1.20" kateversion="2.3" extensions="*.asm" mimetype="" author="Nicola Gigante (nicola.gigante@gmail.com)" license="GPL">
+ <highlighting>
+ <list name="registers">
+ <!-- General purpose registers -->
+ <item>eax</item>
+ <item>ax</item>
+ <item>ah</item>
+ <item>al</item>
+ <item>ebx</item>
+ <item>bx</item>
+ <item>bh</item>
+ <item>bl</item>
+ <item>ecx</item>
+ <item>cx</item>
+ <item>ch</item>
+ <item>cl</item>
+ <item>edx</item>
+ <item>dx</item>
+ <item>dh</item>
+ <item>dl</item>
+ <item>ebp</item>
+ <item>bp</item>
+ <item>esi</item>
+ <item>si</item>
+ <item>edi</item>
+ <item>di</item>
+ <item>eip</item>
+ <item>ip</item>
+ <item>esp</item>
+ <item>sp</item>
+ <!-- Segmentation registers -->
+ <item>cs</item>
+ <item>ds</item>
+ <item>ss</item>
+ <item>es</item>
+ <item>gs</item>
+ <item>fs</item>
+ <!-- Control registers -->
+ <item>cr0</item>
+ <item>cr1</item>
+ <item>cr2</item>
+ <item>cr3</item>
+ <item>cr4</item>
+ <!-- x87 FPU Registers -->
+ <item>st</item>
+ <!-- MMX registers -->
+ <item>mm0</item>
+ <item>mm1</item>
+ <item>mm2</item>
+ <item>mm3</item>
+ <item>mm4</item>
+ <item>mm5</item>
+ <item>mm6</item>
+ <item>mm7</item>
+ <!-- XMM registers -->
+ <item>xmm0</item>
+ <item>xmm1</item>
+ <item>xmm2</item>
+ <item>xmm3</item>
+ <item>xmm4</item>
+ <item>xmm5</item>
+ <item>xmm6</item>
+ <item>xmm7</item>
+ </list>
+ <list name="instructions">
+ <item>aaa</item>
+ <item>aas</item>
+ <item>aad</item>
+ <item>aam</item>
+ <item>adc</item>
+ <item>add</item>
+ <item>addpd</item>
+ <item>addps</item>
+ <item>addsd</item>
+ <item>addss</item>
+ <item>and</item>
+ <item>andnpd</item>
+ <item>andnps</item>
+ <item>andpd</item>
+ <item>andps</item>
+ <item>arpl</item>
+ <item>bound</item>
+ <item>bsf</item>
+ <item>bsr</item>
+ <item>bswap</item>
+ <item>bt</item>
+ <item>btc</item>
+ <item>btr</item>
+ <item>bts</item>
+ <item>call</item>
+ <item>cbw</item>
+ <item>cwde</item>
+ <item>cwd</item>
+ <item>cdq</item>
+ <item>clc</item>
+ <item>cld</item>
+ <item>cli</item>
+ <item>clts</item>
+ <item>clflush</item>
+ <item>cmc</item>
+ <item>cmovcc</item>
+ <item>cmp</item>
+ <item>cmppd</item>
+ <item>cmpeqpd</item>
+ <item>cmpltpd</item>
+ <item>cmplepd</item>
+ <item>cmpunordpd</item>
+ <item>cmpneqpd</item>
+ <item>cmpnltpd</item>
+ <item>cmpnlepd</item>
+ <item>cmpordpd</item>
+ <item>cmpps</item>
+ <item>cmpeqps</item>
+ <item>cmpltps</item>
+ <item>cmpleps</item>
+ <item>cmpunordps</item>
+ <item>cmpneqps</item>
+ <item>cmpnltps</item>
+ <item>cmpnleps</item>
+ <item>cmpordps</item>
+ <item>cmpsb</item>
+ <item>cmpsw</item>
+ <item>cmpsd</item>
+ <item>cmpeqsd</item>
+ <item>cmpltsd</item>
+ <item>cmplesd</item>
+ <item>cmpunordsd</item>
+ <item>cmpneqsd</item>
+ <item>cmpnltsd</item>
+ <item>cmpnlesd</item>
+ <item>cmpordsd</item>
+ <item>cmpss</item>
+ <item>cmpeqss</item>
+ <item>cmpltss</item>
+ <item>cmpless</item>
+ <item>cmpunordss</item>
+ <item>cmpneqss</item>
+ <item>cmpnltss</item>
+ <item>cmpnless</item>
+ <item>cmpordss</item>
+ <item>cmpxchg</item>
+ <item>cmpxchg486</item>
+ <item>cmpxchg8b</item>
+ <item>comisd</item>
+ <item>comiss</item>
+ <item>cpuid</item>
+ <item>cvtdq2pd</item>
+ <item>cvtdq2ps</item>
+ <item>cvtpd2dq</item>
+ <item>cvtpd2pi</item>
+ <item>cvtpd2ps</item>
+ <item>cvtpi2pd</item>
+ <item>cvtpi2ps</item>
+ <item>cvtps2dq</item>
+ <item>cvtps2pd</item>
+ <item>cvtps2pi</item>
+ <item>cvtsd2si</item>
+ <item>cvtsd2ss</item>
+ <item>cvtsi2sd</item>
+ <item>cvtsi2ss</item>
+ <item>cvtss2sd</item>
+ <item>cvtss2si</item>
+ <item>cvttpd2dq</item>
+ <item>cvttpd2pi</item>
+ <item>cvttps2dq</item>
+ <item>cvttps2pi</item>
+ <item>cvttsd2si</item>
+ <item>daa</item>
+ <item>das</item>
+ <item>dec</item>
+ <item>div</item>
+ <item>divpd</item>
+ <item>divps</item>
+ <item>divsd</item>
+ <item>divss</item>
+ <item>emms</item>
+ <item>enter</item>
+ <item>f2xm1</item>
+ <item>fabs</item>
+ <item>fadd</item>
+ <item>faddp</item>
+ <item>fbld</item>
+ <item>fbstp</item>
+ <item>fchs</item>
+ <item>fclex</item>
+ <item>fnclex</item>
+ <item>fcmovb</item>
+ <item>fcmove</item>
+ <item>fcmovbe</item>
+ <item>fcmovu</item>
+ <item>fcmovnb</item>
+ <item>fcmovne</item>
+ <item>fcmovnbe</item>
+ <item>fcmovnu</item>
+ <item>fcom</item>
+ <item>fcomp</item>
+ <item>fcompp</item>
+ <item>fcomi</item>
+ <item>fcomip</item>
+ <item>fcos</item>
+ <item>fdecstp</item>
+ <item>fdisi</item>
+ <item>fndisi</item>
+ <item>feni</item>
+ <item>fneni</item>
+ <item>fdiv</item>
+ <item>fdivr</item>
+ <item>fdivp</item>
+ <item>fdivrp</item>
+ <item>femms</item>
+ <item>ffree</item>
+ <item>ffreep</item>
+ <item>fiadd</item>
+ <item>ficom</item>
+ <item>ficomp</item>
+ <item>fidiv</item>
+ <item>fidivr</item>
+ <item>fild</item>
+ <item>fist</item>
+ <item>fistp</item>
+ <item>fimul</item>
+ <item>fincstp</item>
+ <item>finit</item>
+ <item>fninit</item>
+ <item>fisub</item>
+ <item>fisubr</item>
+ <item>fld</item>
+ <item>fld1</item>
+ <item>fldl2e</item>
+ <item>fldl2t</item>
+ <item>fldlg2</item>
+ <item>fldln2</item>
+ <item>fldpi</item>
+ <item>fldz</item>
+ <item>fldcw</item>
+ <item>fldenv</item>
+ <item>fmul</item>
+ <item>fmulp</item>
+ <item>fnop</item>
+ <item>fpatan</item>
+ <item>fptan</item>
+ <item>fprem</item>
+ <item>fprem1</item>
+ <item>frndint</item>
+ <item>fsave</item>
+ <item>fnsave</item>
+ <item>frstor</item>
+ <item>fscale</item>
+ <item>fsetpm</item>
+ <item>fsin</item>
+ <item>fsincos</item>
+ <item>fsqrt</item>
+ <item>fst</item>
+ <item>fstp</item>
+ <item>fstcw</item>
+ <item>fnstcw</item>
+ <item>fstenv</item>
+ <item>fnstenv</item>
+ <item>fstsw</item>
+ <item>fnstsw</item>
+ <item>fsub</item>
+ <item>fsubr</item>
+ <item>fsubp</item>
+ <item>fsubrp</item>
+ <item>ftst</item>
+ <item>fucom</item>
+ <item>fucomp</item>
+ <item>fucompp</item>
+ <item>fucomi</item>
+ <item>fucomip</item>
+ <item>fxam</item>
+ <item>fxch</item>
+ <item>fxrstor</item>
+ <item>fxsave</item>
+ <item>fxtract</item>
+ <item>fyl2x</item>
+ <item>fyl2xp1</item>
+ <item>hlt</item>
+ <item>ibts</item>
+ <item>idiv</item>
+ <item>imul</item>
+ <item>in</item>
+ <item>inc</item>
+ <item>insb</item>
+ <item>insw</item>
+ <item>insd</item>
+ <item>int</item>
+ <item>int1</item>
+ <item>icebp</item>
+ <item>int01</item>
+ <item>int3</item>
+ <item>int03</item>
+ <item>into</item>
+ <item>invd</item>
+ <item>invlpg</item>
+ <item>iret</item>
+ <item>iretw</item>
+ <item>iretd</item>
+ <item>jcc</item>
+ <item>jcxz</item>
+ <item>jecxz</item>
+ <item>jmp</item>
+ <item>lahf</item>
+ <item>lar</item>
+ <item>ldmxcsr</item>
+ <item>lds</item>
+ <item>les</item>
+ <item>lfs</item>
+ <item>lgs</item>
+ <item>lss</item>
+ <item>lea</item>
+ <item>leave</item>
+ <item>lfence</item>
+ <item>lgdt</item>
+ <item>lidt</item>
+ <item>lldt</item>
+ <item>lmsw</item>
+ <item>loadall</item>
+ <item>loadall286</item>
+ <item>lodsb</item>
+ <item>lodsw</item>
+ <item>lodsd</item>
+ <item>loop</item>
+ <item>loope</item>
+ <item>loopz</item>
+ <item>loopne</item>
+ <item>loopnz</item>
+ <item>lsl</item>
+ <item>ltr</item>
+ <item>maskmovdqu</item>
+ <item>maskmovq</item>
+ <item>maxpd</item>
+ <item>maxps</item>
+ <item>maxsd</item>
+ <item>maxss</item>
+ <item>mfence</item>
+ <item>minpd</item>
+ <item>minps</item>
+ <item>minsd</item>
+ <item>minss</item>
+ <item>mov</item>
+ <item>movapd</item>
+ <item>movaps</item>
+ <item>movd</item>
+ <item>movdq2q</item>
+ <item>movdqa</item>
+ <item>movdqu</item>
+ <item>movhlps</item>
+ <item>movhpd</item>
+ <item>movhps</item>
+ <item>movlhps</item>
+ <item>movlpd</item>
+ <item>movlps</item>
+ <item>movmskpd</item>
+ <item>movmskps</item>
+ <item>movntdq</item>
+ <item>movnti</item>
+ <item>movntpd</item>
+ <item>movntps</item>
+ <item>movntq</item>
+ <item>movq</item>
+ <item>movq2dq</item>
+ <item>movsb</item>
+ <item>movsw</item>
+ <item>movsd</item>
+ <item>movss</item>
+ <item>movsx</item>
+ <item>movzx</item>
+ <item>movupd</item>
+ <item>movups</item>
+ <item>mul</item>
+ <item>mulpd</item>
+ <item>mulps</item>
+ <item>mulsd</item>
+ <item>mulss</item>
+ <item>neg</item>
+ <item>not</item>
+ <item>nop</item>
+ <item>or</item>
+ <item>orpd</item>
+ <item>orps</item>
+ <item>out</item>
+ <item>outsb</item>
+ <item>outsw</item>
+ <item>outsd</item>
+ <item>packssdw</item>
+ <item>packsswb</item>
+ <item>packuswb</item>
+ <item>packssdw</item>
+ <item>packsswb</item>
+ <item>packuswb</item>
+ <item>paddb</item>
+ <item>paddw</item>
+ <item>paddd</item>
+ <item>paddb</item>
+ <item>paddw</item>
+ <item>paddd</item>
+ <item>paddq</item>
+ <item>paddsb</item>
+ <item>paddsw</item>
+ <item>paddsb</item>
+ <item>paddsw</item>
+ <item>paddsiw</item>
+ <item>paddusb</item>
+ <item>paddusw</item>
+ <item>paddusb</item>
+ <item>paddusw</item>
+ <item>pand</item>
+ <item>pandn</item>
+ <item>pand</item>
+ <item>pandn</item>
+ <item>pause</item>
+ <item>paveb</item>
+ <item>pavgb</item>
+ <item>pavgw</item>
+ <item>pavgb</item>
+ <item>pavgw</item>
+ <item>pavgusb</item>
+ <item>pcmpeqb</item>
+ <item>pcmpeqw</item>
+ <item>pcmpeqd</item>
+ <item>pcmpgtb</item>
+ <item>pcmpgtw</item>
+ <item>pcmpgtd</item>
+ <item>pcmpeqb</item>
+ <item>pcmpeqw</item>
+ <item>pcmpeqd</item>
+ <item>pcmpgtb</item>
+ <item>pcmpgtw</item>
+ <item>pcmpgtd</item>
+ <item>pdistib</item>
+ <item>pextrw</item>
+ <item>pf2id</item>
+ <item>pf2iw</item>
+ <item>pfacc</item>
+ <item>pfadd</item>
+ <item>pfcmpeq</item>
+ <item>pfcmpge</item>
+ <item>pfcmpgt</item>
+ <item>pfmax</item>
+ <item>pfmin</item>
+ <item>pfmul</item>
+ <item>pfnacc</item>
+ <item>pfpnacc</item>
+ <item>pfrcp</item>
+ <item>pfrcpit1</item>
+ <item>pfrcpit2</item>
+ <item>pfrsqit1</item>
+ <item>pfrsqrt</item>
+ <item>pfsub</item>
+ <item>pfsubr</item>
+ <item>pi2fd</item>
+ <item>pi2fw</item>
+ <item>pinsrw</item>
+ <item>pmachriw</item>
+ <item>pmaddwd</item>
+ <item>pmagw</item>
+ <item>pmaxsw</item>
+ <item>pmaxub</item>
+ <item>pminsw</item>
+ <item>pminub</item>
+ <item>pmovmskb</item>
+ <item>pmulhrwc</item>
+ <item>pmulhriw</item>
+ <item>pmulhrwa</item>
+ <item>pmulhuw</item>
+ <item>pmulhw</item>
+ <item>pmullw</item>
+ <item>pmulhw</item>
+ <item>pmullw</item>
+ <item>pmuludq</item>
+ <item>pmvzb</item>
+ <item>pmvnzb</item>
+ <item>pmvlzb</item>
+ <item>pmvgezb</item>
+ <item>pop</item>
+ <item>popa</item>
+ <item>popaw</item>
+ <item>popad</item>
+ <item>popf</item>
+ <item>popfw</item>
+ <item>popfd</item>
+ <item>por</item>
+ <item>prefetch</item>
+ <item>prefetchw</item>
+ <item>prefetchnta</item>
+ <item>prefetcht0</item>
+ <item>prefetcht1</item>
+ <item>prefetcht2</item>
+ <item>psadbw</item>
+ <item>pshufd</item>
+ <item>pshufhw</item>
+ <item>pshuflw</item>
+ <item>pshufw</item>
+ <item>psllw</item>
+ <item>pslld</item>
+ <item>psllq</item>
+ <item>pslldq</item>
+ <item>psraw</item>
+ <item>psrad</item>
+ <item>psrlw</item>
+ <item>psrld</item>
+ <item>psrlq</item>
+ <item>psrldq</item>
+ <item>psubb</item>
+ <item>psubw</item>
+ <item>psubd</item>
+ <item>psubq</item>
+ <item>psubb</item>
+ <item>psubw</item>
+ <item>psubd</item>
+ <item>psubq</item>
+ <item>psubsb</item>
+ <item>psubsw</item>
+ <item>psubsb</item>
+ <item>psubsw</item>
+ <item>psubusb</item>
+ <item>psubusw</item>
+ <item>psubusb</item>
+ <item>psubusw</item>
+ <item>psubsiw</item>
+ <item>pswapd</item>
+ <item>punpckhbw</item>
+ <item>punpckhwd</item>
+ <item>punpckhdq</item>
+ <item>punpckhbw</item>
+ <item>punpckhwd</item>
+ <item>punpckhdq</item>
+ <item>punpckhqdq</item>
+ <item>punpcklbw</item>
+ <item>punpcklwd</item>
+ <item>punpckldq</item>
+ <item>punpcklbw</item>
+ <item>punpcklwd</item>
+ <item>punpckldq</item>
+ <item>punpcklqdq</item>
+ <item>push</item>
+ <item>pusha</item>
+ <item>pushad</item>
+ <item>pushaw</item>
+ <item>pushf</item>
+ <item>pushfd</item>
+ <item>pushfw</item>
+ <item>pxor</item>
+ <item>rcl</item>
+ <item>rcr</item>
+ <item>rcpps</item>
+ <item>rcpss</item>
+ <item>rdmsr</item>
+ <item>rdpmc</item>
+ <item>rdshr</item>
+ <item>rdtsc</item>
+ <item>ret</item>
+ <item>retf</item>
+ <item>retn</item>
+ <item>rol</item>
+ <item>ror</item>
+ <item>rsdc</item>
+ <item>rsldt</item>
+ <item>rsm</item>
+ <item>rsqrtps</item>
+ <item>rsqrtss</item>
+ <item>rsts</item>
+ <item>sahf</item>
+ <item>sal</item>
+ <item>sar</item>
+ <item>salc</item>
+ <item>sbb</item>
+ <item>scasb</item>
+ <item>scasw</item>
+ <item>scasd</item>
+ <item>setcc</item>
+ <item>sfence</item>
+ <item>sgdt</item>
+ <item>sidt</item>
+ <item>sldt</item>
+ <item>shl</item>
+ <item>shr</item>
+ <item>shld</item>
+ <item>shrd</item>
+ <item>shufpd</item>
+ <item>shufps</item>
+ <item>smi</item>
+ <item>smint</item>
+ <item>smintold</item>
+ <item>smsw</item>
+ <item>sqrtpd</item>
+ <item>sqrtps</item>
+ <item>sqrtsd</item>
+ <item>sqrtss</item>
+ <item>stc</item>
+ <item>std</item>
+ <item>sti</item>
+ <item>stmxcsr</item>
+ <item>stosb</item>
+ <item>stosw</item>
+ <item>stosd</item>
+ <item>str</item>
+ <item>sub</item>
+ <item>subpd</item>
+ <item>subps</item>
+ <item>subsd</item>
+ <item>subss</item>
+ <item>svdc</item>
+ <item>svldt</item>
+ <item>svts</item>
+ <item>syscall</item>
+ <item>sysenter</item>
+ <item>sysexit</item>
+ <item>sysret</item>
+ <item>test</item>
+ <item>ucomisd</item>
+ <item>ucomiss</item>
+ <item>ud0</item>
+ <item>ud1</item>
+ <item>ud2</item>
+ <item>umov</item>
+ <item>unpckhpd</item>
+ <item>unpckhps</item>
+ <item>unpcklpd</item>
+ <item>unpcklps</item>
+ <item>verr</item>
+ <item>verw</item>
+ <item>wait</item>
+ <item>fwait</item>
+ <item>wbinvd</item>
+ <item>wrmsr</item>
+ <item>wrshr</item>
+ <item>xadd</item>
+ <item>xbts</item>
+ <item>xchg</item>
+ <item>xlat</item>
+ <item>xlatb</item>
+ <item>xor</item>
+ <item>xorpd</item>
+ <item>xorps</item>
+ <item>aaa</item>
+ <item>aad</item>
+ <item>aam</item>
+ <item>aas</item>
+ <item>adc</item>
+ <item>add</item>
+ <item>addpd</item>
+ <item>addps</item>
+ <item>addsd</item>
+ <item>addss</item>
+ <item>and</item>
+ <item>andnpd</item>
+ <item>andnps</item>
+ <item>andpd</item>
+ <item>andps</item>
+ <item>arpl</item>
+ <item>bound</item>
+ <item>bsf</item>
+ <item>bsr</item>
+ <item>bswap</item>
+ <item>bt</item>
+ <item>btc</item>
+ <item>btr</item>
+ <item>bts</item>
+ <item>call</item>
+ <item>cbw</item>
+ <item>cdq</item>
+ <item>clc</item>
+ <item>cld</item>
+ <item>clflush</item>
+ <item>cli</item>
+ <item>clts</item>
+ <item>cmc</item>
+ <item>cmovcc</item>
+ <item>cmp</item>
+ <item>cmpeqpd</item>
+ <item>cmpeqps</item>
+ <item>cmpeqsd</item>
+ <item>cmpeqss</item>
+ <item>cmplepd</item>
+ <item>cmpleps</item>
+ <item>cmplesd</item>
+ <item>cmpless</item>
+ <item>cmpltpd</item>
+ <item>cmpltps</item>
+ <item>cmpltsd</item>
+ <item>cmpltss</item>
+ <item>cmpneqpd</item>
+ <item>cmpneqps</item>
+ <item>cmpneqsd</item>
+ <item>cmpneqss</item>
+ <item>cmpnlepd</item>
+ <item>cmpnleps</item>
+ <item>cmpnlesd</item>
+ <item>cmpnless</item>
+ <item>cmpnltpd</item>
+ <item>cmpnltps</item>
+ <item>cmpnltsd</item>
+ <item>cmpnltss</item>
+ <item>cmpordpd</item>
+ <item>cmpordps</item>
+ <item>cmpordsd</item>
+ <item>cmpordss</item>
+ <item>cmppd</item>
+ <item>cmpps</item>
+ <item>cmpsb</item>
+ <item>cmpsd</item>
+ <item>cmpss</item>
+ <item>cmpsw</item>
+ <item>cmpunordpd</item>
+ <item>cmpunordps</item>
+ <item>cmpunordsd</item>
+ <item>cmpunordss</item>
+ <item>cmpxchg</item>
+ <item>cmpxchg486</item>
+ <item>cmpxchg8b</item>
+ <item>comisd</item>
+ <item>comiss</item>
+ <item>cpuid</item>
+ <item>cvtdq2pd</item>
+ <item>cvtdq2ps</item>
+ <item>cvtpd2dq</item>
+ <item>cvtpd2pi</item>
+ <item>cvtpd2ps</item>
+ <item>cvtpi2pd</item>
+ <item>cvtpi2ps</item>
+ <item>cvtps2dq</item>
+ <item>cvtps2pd</item>
+ <item>cvtps2pi</item>
+ <item>cvtsd2si</item>
+ <item>cvtsd2ss</item>
+ <item>cvtsi2sd</item>
+ <item>cvtsi2ss</item>
+ <item>cvtss2sd</item>
+ <item>cvtss2si</item>
+ <item>cvttpd2dq</item>
+ <item>cvttpd2pi</item>
+ <item>cvttps2dq</item>
+ <item>cvttps2pi</item>
+ <item>cvttsd2si</item>
+ <item>cwd</item>
+ <item>cwde</item>
+ <item>daa</item>
+ <item>das</item>
+ <item>dec</item>
+ <item>div</item>
+ <item>divpd</item>
+ <item>divps</item>
+ <item>divsd</item>
+ <item>divss</item>
+ <item>emms</item>
+ <item>enter</item>
+ <item>f2xm1</item>
+ <item>fabs</item>
+ <item>fadd</item>
+ <item>faddp</item>
+ <item>fbld</item>
+ <item>fbstp</item>
+ <item>fchs</item>
+ <item>fclex</item>
+ <item>fcmovb</item>
+ <item>fcmovbe</item>
+ <item>fcmove</item>
+ <item>fcmovnb</item>
+ <item>fcmovnbe</item>
+ <item>fcmovne</item>
+ <item>fcmovnu</item>
+ <item>fcmovu</item>
+ <item>fcom</item>
+ <item>fcomi</item>
+ <item>fcomip</item>
+ <item>fcomp</item>
+ <item>fcompp</item>
+ <item>fcos</item>
+ <item>fdecstp</item>
+ <item>fdisi</item>
+ <item>fdiv</item>
+ <item>fdivp</item>
+ <item>fdivr</item>
+ <item>fdivrp</item>
+ <item>femms</item>
+ <item>feni</item>
+ <item>ffree</item>
+ <item>ffreep</item>
+ <item>fiadd</item>
+ <item>ficom</item>
+ <item>ficomp</item>
+ <item>fidiv</item>
+ <item>fidivr</item>
+ <item>fild</item>
+ <item>fimul</item>
+ <item>fincstp</item>
+ <item>finit</item>
+ <item>fist</item>
+ <item>fistp</item>
+ <item>fisub</item>
+ <item>fisubr</item>
+ <item>fld</item>
+ <item>fld1</item>
+ <item>fldcw</item>
+ <item>fldenv</item>
+ <item>fldl2e</item>
+ <item>fldl2t</item>
+ <item>fldlg2</item>
+ <item>fldln2</item>
+ <item>fldpi</item>
+ <item>fldz</item>
+ <item>fmul</item>
+ <item>fmulp</item>
+ <item>fnclex</item>
+ <item>fndisi</item>
+ <item>fneni</item>
+ <item>fninit</item>
+ <item>fnop</item>
+ <item>fnsave</item>
+ <item>fnstcw</item>
+ <item>fnstenv</item>
+ <item>fnstsw</item>
+ <item>fpatan</item>
+ <item>fprem</item>
+ <item>fprem1</item>
+ <item>fptan</item>
+ <item>frndint</item>
+ <item>frstor</item>
+ <item>fsave</item>
+ <item>fscale</item>
+ <item>fsetpm</item>
+ <item>fsin</item>
+ <item>fsincos</item>
+ <item>fsqrt</item>
+ <item>fst</item>
+ <item>fstcw</item>
+ <item>fstenv</item>
+ <item>fstp</item>
+ <item>fstsw</item>
+ <item>fsub</item>
+ <item>fsubp</item>
+ <item>fsubr</item>
+ <item>fsubrp</item>
+ <item>ftst</item>
+ <item>fucom</item>
+ <item>fucomi</item>
+ <item>fucomip</item>
+ <item>fucomp</item>
+ <item>fucompp</item>
+ <item>fwait</item>
+ <item>fxam</item>
+ <item>fxch</item>
+ <item>fxrstor</item>
+ <item>fxsave</item>
+ <item>fxtract</item>
+ <item>fyl2x</item>
+ <item>fyl2xp1</item>
+ <item>hlt</item>
+ <item>ibts</item>
+ <item>icebp</item>
+ <item>idiv</item>
+ <item>imul</item>
+ <item>in</item>
+ <item>inc</item>
+ <item>insb</item>
+ <item>insd</item>
+ <item>insw</item>
+ <item>int</item>
+ <item>int01</item>
+ <item>int03</item>
+ <item>int1</item>
+ <item>int3</item>
+ <item>into</item>
+ <item>invd</item>
+ <item>invlpg</item>
+ <item>iret</item>
+ <item>iretd</item>
+ <item>iretw</item>
+ <item>jcc</item>
+ <item>jcxz</item>
+ <item>jecxz</item>
+ <item>jmp</item>
+ <item>lahf</item>
+ <item>lar</item>
+ <item>ldmxcsr</item>
+ <item>lds</item>
+ <item>lea</item>
+ <item>leave</item>
+ <item>les</item>
+ <item>lfence</item>
+ <item>lfs</item>
+ <item>lgdt</item>
+ <item>lgs</item>
+ <item>lidt</item>
+ <item>lldt</item>
+ <item>lmsw</item>
+ <item>loadall</item>
+ <item>loadall286</item>
+ <item>lodsb</item>
+ <item>lodsd</item>
+ <item>lodsw</item>
+ <item>loop</item>
+ <item>loope</item>
+ <item>loopne</item>
+ <item>loopnz</item>
+ <item>loopz</item>
+ <item>lsl</item>
+ <item>lss</item>
+ <item>ltr</item>
+ <item>maskmovdqu</item>
+ <item>maskmovq</item>
+ <item>maxpd</item>
+ <item>maxps</item>
+ <item>maxsd</item>
+ <item>maxss</item>
+ <item>mfence</item>
+ <item>minpd</item>
+ <item>minps</item>
+ <item>minsd</item>
+ <item>minss</item>
+ <item>mov</item>
+ <item>movapd</item>
+ <item>movaps</item>
+ <item>movd</item>
+ <item>movdq2q</item>
+ <item>movdqa</item>
+ <item>movdqu</item>
+ <item>movhlps</item>
+ <item>movhpd</item>
+ <item>movhps</item>
+ <item>movlhps</item>
+ <item>movlpd</item>
+ <item>movlps</item>
+ <item>movmskpd</item>
+ <item>movmskps</item>
+ <item>movntdq</item>
+ <item>movnti</item>
+ <item>movntpd</item>
+ <item>movntps</item>
+ <item>movntq</item>
+ <item>movq</item>
+ <item>movq2dq</item>
+ <item>movsb</item>
+ <item>movsd</item>
+ <item>movss</item>
+ <item>movsw</item>
+ <item>movsx</item>
+ <item>movupd</item>
+ <item>movups</item>
+ <item>movzx</item>
+ <item>mul</item>
+ <item>mulpd</item>
+ <item>mulps</item>
+ <item>mulsd</item>
+ <item>mulss</item>
+ <item>neg</item>
+ <item>nop</item>
+ <item>not</item>
+ <item>or</item>
+ <item>orpd</item>
+ <item>orps</item>
+ <item>out</item>
+ <item>outsb</item>
+ <item>outsd</item>
+ <item>outsw</item>
+ <item>packssdw</item>
+ <item>packsswb</item>
+ <item>packuswb</item>
+ <item>paddb</item>
+ <item>paddd</item>
+ <item>paddq</item>
+ <item>paddsb</item>
+ <item>paddsiw</item>
+ <item>paddsw</item>
+ <item>paddusb</item>
+ <item>paddusw</item>
+ <item>paddw</item>
+ <item>pand</item>
+ <item>pandn</item>
+ <item>pause</item>
+ <item>paveb</item>
+ <item>pavgb</item>
+ <item>pavgusb</item>
+ <item>pavgw</item>
+ <item>pcmpeqb</item>
+ <item>pcmpeqd</item>
+ <item>pcmpeqw</item>
+ <item>pcmpgtb</item>
+ <item>pcmpgtd</item>
+ <item>pcmpgtw</item>
+ <item>pdistib</item>
+ <item>pextrw</item>
+ <item>pf2id</item>
+ <item>pf2iw</item>
+ <item>pfacc</item>
+ <item>pfadd</item>
+ <item>pfcmpeq</item>
+ <item>pfcmpge</item>
+ <item>pfcmpgt</item>
+ <item>pfmax</item>
+ <item>pfmin</item>
+ <item>pfmul</item>
+ <item>pfnacc</item>
+ <item>pfpnacc</item>
+ <item>pfrcp</item>
+ <item>pfrcpit1</item>
+ <item>pfrcpit2</item>
+ <item>pfrsqit1</item>
+ <item>pfrsqrt</item>
+ <item>pfsub</item>
+ <item>pfsubr</item>
+ <item>pi2fd</item>
+ <item>pi2fw</item>
+ <item>pinsrw</item>
+ <item>pmachriw</item>
+ <item>pmaddwd</item>
+ <item>pmagw</item>
+ <item>pmaxsw</item>
+ <item>pmaxub</item>
+ <item>pminsw</item>
+ <item>pminub</item>
+ <item>pmovmskb</item>
+ <item>pmulhriw</item>
+ <item>pmulhrwa</item>
+ <item>pmulhrwc</item>
+ <item>pmulhuw</item>
+ <item>pmulhw</item>
+ <item>pmullw</item>
+ <item>pmuludq</item>
+ <item>pmvgezb</item>
+ <item>pmvlzb</item>
+ <item>pmvnzb</item>
+ <item>pmvzb</item>
+ <item>pop</item>
+ <item>popa</item>
+ <item>popad</item>
+ <item>popaw</item>
+ <item>popf</item>
+ <item>popfd</item>
+ <item>popfw</item>
+ <item>por</item>
+ <item>prefetch</item>
+ <item>prefetchnta</item>
+ <item>prefetcht0</item>
+ <item>prefetcht1</item>
+ <item>prefetcht2</item>
+ <item>prefetchw</item>
+ <item>psadbw</item>
+ <item>pshufd</item>
+ <item>pshufhw</item>
+ <item>pshuflw</item>
+ <item>pshufw</item>
+ <item>pslld</item>
+ <item>pslldq</item>
+ <item>psllq</item>
+ <item>psllw</item>
+ <item>psrad</item>
+ <item>psraw</item>
+ <item>psrld</item>
+ <item>psrldq</item>
+ <item>psrlq</item>
+ <item>psrlw</item>
+ <item>psubb</item>
+ <item>psubd</item>
+ <item>psubq</item>
+ <item>psubsb</item>
+ <item>psubsiw</item>
+ <item>psubsw</item>
+ <item>psubusb</item>
+ <item>psubusw</item>
+ <item>psubw</item>
+ <item>pswapd</item>
+ <item>punpckhbw</item>
+ <item>punpckhdq</item>
+ <item>punpckhqdq</item>
+ <item>punpckhwd</item>
+ <item>punpcklbw</item>
+ <item>punpckldq</item>
+ <item>punpcklqdq</item>
+ <item>punpcklwd</item>
+ <item>push</item>
+ <item>pusha</item>
+ <item>pushad</item>
+ <item>pushaw</item>
+ <item>pushf</item>
+ <item>pushfd</item>
+ <item>pushfw</item>
+ <item>pxor</item>
+ <item>rcl</item>
+ <item>rcpps</item>
+ <item>rcpss</item>
+ <item>rcr</item>
+ <item>rdmsr</item>
+ <item>rdpmc</item>
+ <item>rdshr</item>
+ <item>rdtsc</item>
+ <item>ret</item>
+ <item>retf</item>
+ <item>retn</item>
+ <item>rol</item>
+ <item>ror</item>
+ <item>rsdc</item>
+ <item>rsldt</item>
+ <item>rsm</item>
+ <item>rsqrtps</item>
+ <item>rsqrtss</item>
+ <item>rsts</item>
+ <item>sahf</item>
+ <item>sal</item>
+ <item>salc</item>
+ <item>sar</item>
+ <item>sbb</item>
+ <item>scasb</item>
+ <item>scasd</item>
+ <item>scasw</item>
+ <item>setcc</item>
+ <item>sfence</item>
+ <item>sgdt</item>
+ <item>shl</item>
+ <item>shld</item>
+ <item>shr</item>
+ <item>shrd</item>
+ <item>shufpd</item>
+ <item>shufps</item>
+ <item>sidt</item>
+ <item>sldt</item>
+ <item>smi</item>
+ <item>smint</item>
+ <item>smintold</item>
+ <item>smsw</item>
+ <item>sqrtpd</item>
+ <item>sqrtps</item>
+ <item>sqrtsd</item>
+ <item>sqrtss</item>
+ <item>stc</item>
+ <item>std</item>
+ <item>sti</item>
+ <item>stmxcsr</item>
+ <item>stosb</item>
+ <item>stosd</item>
+ <item>stosw</item>
+ <item>str</item>
+ <item>sub</item>
+ <item>subpd</item>
+ <item>subps</item>
+ <item>subsd</item>
+ <item>subss</item>
+ <item>svdc</item>
+ <item>svldt</item>
+ <item>svts</item>
+ <item>syscall</item>
+ <item>sysenter</item>
+ <item>sysexit</item>
+ <item>sysret</item>
+ <item>test</item>
+ <item>ucomisd</item>
+ <item>ucomiss</item>
+ <item>ud0</item>
+ <item>ud1</item>
+ <item>ud2</item>
+ <item>umov</item>
+ <item>unpckhpd</item>
+ <item>unpckhps</item>
+ <item>unpcklpd</item>
+ <item>unpcklps</item>
+ <item>verr</item>
+ <item>verw</item>
+ <item>wait</item>
+ <item>wbinvd</item>
+ <item>wrmsr</item>
+ <item>wrshr</item>
+ <item>xadd</item>
+ <item>xbts</item>
+ <item>xchg</item>
+ <item>xlat</item>
+ <item>xlatb</item>
+ <item>xor</item>
+ <item>xorpd</item>
+ <item>xorps</item>
+ </list>
+ <list name="Data">
+ <!-- repeat some data declaration -->
+ <item>times</item>
+ <!-- constants -->
+ <item>equ</item>
+ <!-- Initialized data -->
+ <item>db</item>
+ <item>dw</item>
+ <item>dd</item>
+ <item>dq</item>
+ <item>dt</item>
+ <!-- Uninitialized data -->
+ <item>resb</item>
+ <item>resw</item>
+ <item>resd</item>
+ <item>resq</item>
+ <item>rest</item>
+ <!-- binary file include -->
+ <item>incbin</item>
+ <!-- operand size -->
+ <item>byte</item>
+ <item>word</item>
+ <item>dword</item>
+ <item>qword</item>
+ <item>short</item>
+ <item>ptr</item>
+ </list>
+ <list name="NASM Keywords">
+ <!-- NASM directives -->
+ <item>org</item>
+ <item>bits</item>
+ <item>use16</item>
+ <item>use32</item>
+ <item>section</item>
+ <item>segment</item>
+ <item>__sect__</item>
+ <item>absolute</item>
+ <item>extern</item>
+ <item>global</item>
+ <item>common</item>
+ <item>seg</item>
+ <item>wrt</item>
+ <item>strict</item>
+ <!-- NASM standard macros -->
+ <item>struc</item>
+ <item>endstruc</item>
+ <item>istruc</item>
+ <item>at</item>
+ <item>iend</item>
+ <item>align</item>
+ <item>alignb</item>
+
+ <item>__NASM_MAJOR__</item>
+ <item>__NASM_MINOR__</item>
+ <item>__NASM_SUBMINOR__</item>
+ <item>___NASM_PATCHLEVEL__</item>
+ <item>__NASM_VERSION_ID__</item>
+ <item>__NASM_VER__</item>
+ <item>__FILE__</item>
+ <item>__LINE__</item>
+ </list>
+ <contexts>
+ <context name="Normal" attribute="Normal Text" lineEndContext="#stay">
+ <keyword attribute="Registers" context="#stay" String="registers" />
+ <keyword attribute="Data" context="#stay" String="Data"/>
+ <keyword attribute="Instructions" context="#stay" String="instructions"/>
+ <keyword attribute="NASM Keywords" context="#stay" String="NASM Keywords"/>
+ <DetectChar attribute="Comment" context="Comment" char=";" />
+ <DetectChar attribute="Preprocessor" context="Preprocessor" char="%" />
+ <AnyChar attribute="String" context="String" String="&quot;'"/>
+ <RegExpr attribute="Label" context="#stay" String="^\s*[A-Za-z0-9_.$]+:" />
+ <!-- Conditional instructions -->
+ <RegExpr attribute="Instructions" context="#stay"
+ String="(cmov|fcmov|j|loop|set)(a|ae|b|be|c|e|g|ge|l|le|na|nae|nb|nbe|nc|ne|ng|nge|nl|nle|no|np|ns|nz|o|p|pe|po|s|z)" />
+ <!-- The NASM's CPU directive -->
+ <RegExpr attribute="NASM Keywords" context="#stay" String="cpu (pentium|ppro|p2|p3|katmai|p4|willamette|prescott|ia64)*"/>
+ <!-- hexadecimal numbers -->
+ <RegExpr attribute="BaseN" context="#stay" insensitive="TRUE" String="(\$[0-9]+[a-f0-9]*|[a-f0-9]+h)"/>
+ <!-- octal and binary numbers -->
+ <RegExpr attribute="BaseN" context="#stay" insensitive="TRUE" String="([0-7]+(q|o)|[01]+b)"/>
+ <DetectChar attribute="Number" context="#stay" char="$" />
+ <HlCOct attribute="BaseN" context="#stay"/>
+ <HlCHex attribute="BaseN" context="#stay"/>
+ <Float attribute="Float" context="#stay"/>
+ <Int attribute="Number" context="#stay"/>
+ <HlCChar attribute="Char" context="#stay"/>
+ </context>
+ <context name="Comment" attribute="Comment" lineEndContext="#pop"/>
+ <context name="Preprocessor" attribute="Preprocessor" lineEndContext="#pop"/>
+ <context name="String" attribute="String" lineEndContext="#pop">
+ <AnyChar attribute="String" context="#pop" String="&quot;'"/>
+ </context>
+ </contexts>
+
+ <itemDatas>
+ <itemData name="Normal Text" defStyleNum="dsNormal"/>
+ <itemData name="Registers" defStyleNum="dsKeyword"/>
+ <itemData name="Instructions" defStyleNum="dsKeyword"/>
+ <itemData name="NASM Keywords" defStyleNum="dsKeyword"/>
+ <itemData name="Comment" defStyleNum="dsComment"/>
+ <itemData name="Label" defStyleNum="dsFunction"/>
+ <itemData name="Data" defStyleNum="dsDataType"/>
+ <itemData name="BaseN" defStyleNum="dsBaseN"/>
+ <itemData name="Float" defStyleNum="dsFloat"/>
+ <itemData name="Number" defStyleNum="dsDecVal"/>
+ <itemData name="Char" defStyleNum="dsChar"/>
+ <itemData name="String" defStyleNum="dsString"/>
+ <itemData name="Preprocessor" defStyleNum="dsOthers"/>
+ </itemDatas>
+ </highlighting>
+ <general>
+ <keywords casesensitive="0" />
+ <comments>
+ <comment name="singleLine" start=";" />
+ </comments>
+ </general>
+</language>
+
+<!-- kate: space-indent on; indent-width 2; replace-tabs on; -->
diff --git a/kate/data/objectivec.xml b/kate/data/objectivec.xml
new file mode 100644
index 000000000..0e931f7f0
--- /dev/null
+++ b/kate/data/objectivec.xml
@@ -0,0 +1,128 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+<language name="Objective-C" version="1.07" kateversion="2.3" section="Sources" extensions="*.m;*.h" mimetype="text/x-objc-src;text/x-c-hdr">
+ <highlighting>
+ <list name="keywords">
+ <item> break </item>
+ <item> case </item>
+ <item> continue </item>
+ <item> default </item>
+ <item> do </item>
+ <item> else </item>
+ <item> enum </item>
+ <item> extern </item>
+ <item> for </item>
+ <item> goto </item>
+ <item> if </item>
+ <item> return </item>
+ <item> sizeof </item>
+ <item> struct </item>
+ <item> switch </item>
+ <item> typedef </item>
+ <item> union </item>
+ <item> while </item>
+ <item> @class </item>
+ <item> @defs </item>
+ <item> @encode </item>
+ <item> @end </item>
+ <item> @implementation </item>
+ <item> @interface </item>
+ <item> @private </item>
+ <item> @protected </item>
+ <item> @protocol </item>
+ <item> @public </item>
+ <item> @selector </item>
+ <item> self </item>
+ <item> super </item>
+ </list>
+ <list name="types">
+ <item> auto </item>
+ <item> char </item>
+ <item> const </item>
+ <item> double </item>
+ <item> float </item>
+ <item> int </item>
+ <item> long </item>
+ <item> register </item>
+ <item> short </item>
+ <item> signed </item>
+ <item> static </item>
+ <item> unsigned </item>
+ <item> void </item>
+ <item> volatile </item>
+ </list>
+ <contexts>
+ <context attribute="Normal Text" lineEndContext="#stay" name="Default">
+ <keyword attribute="Keyword" context="#stay" String="keywords"/>
+ <keyword attribute="Data Type" context="#stay" String="types"/>
+ <DetectChar attribute="Symbol" context="#stay" char="{" beginRegion="Brace1" />
+ <DetectChar attribute="Symbol" context="#stay" char="}" endRegion="Brace1" />
+ <Float attribute="Float" context="#stay">
+ <AnyChar String="fF" attribute="Float" context="#stay"/>
+ </Float>
+ <HlCOct attribute="Octal" context="#stay"/>
+ <HlCHex attribute="Hex" context="#stay"/>
+ <Int attribute="Decimal" context="#stay" >
+ <StringDetect attribute="Decimal" context="#stay" String="ULL" insensitive="TRUE"/>
+ <StringDetect attribute="Decimal" context="#stay" String="LUL" insensitive="TRUE"/>
+ <StringDetect attribute="Decimal" context="#stay" String="LLU" insensitive="TRUE"/>
+ <StringDetect attribute="Decimal" context="#stay" String="UL" insensitive="TRUE"/>
+ <StringDetect attribute="Decimal" context="#stay" String="LU" insensitive="TRUE"/>
+ <StringDetect attribute="Decimal" context="#stay" String="LL" insensitive="TRUE"/>
+ <StringDetect attribute="Decimal" context="#stay" String="U" insensitive="TRUE"/>
+ <StringDetect attribute="Decimal" context="#stay" String="L" insensitive="TRUE"/>
+ </Int>
+ <HlCChar attribute="Char" context="#stay"/>
+ <DetectChar attribute="String" context="String" char="&quot;"/>
+ <Detect2Chars attribute="Comment" context="SingleLineComment" char="/" char1="/"/>
+ <Detect2Chars attribute="Comment" context="MultiLineComment" char="/" char1="*"/>
+ <AnyChar attribute="Symbol" context="#stay" String=":!%&amp;()+,-/.*&lt;=&gt;?[]|~^&#59;"/>
+ <RegExpr attribute="Preprocessor" context="Preprocessor" String="^#"/>
+ <Detect2Chars attribute="String" context="String" char="@" char1="&quot;" />
+ </context>
+ <context attribute="String" lineEndContext="#pop" name="String">
+ <LineContinue attribute="String" context="#stay"/>
+ <HlCStringChar attribute="String Char" context="#stay"/>
+ <DetectChar attribute="String" context="#pop" char="&quot;"/>
+ </context>
+ <context attribute="Comment" lineEndContext="#pop" name="SingleLineComment"/>
+ <context attribute="Comment" lineEndContext="#stay" name="MultiLineComment">
+ <Detect2Chars attribute="Comment" context="#pop" char="*" char1="/"/>
+ </context>
+ <context attribute="Preprocessor" lineEndContext="Default" name="Preprocessor">
+ <LineContinue attribute="Preprocessor" context="#stay"/>
+ <RangeDetect attribute="Prep. Lib" context="#stay" char="&quot;" char1="&quot;"/>
+ <RangeDetect attribute="Prep. Lib" context="#stay" char="&lt;" char1="&gt;"/>
+ <IncludeRules context="##Doxygen" />
+ <Detect2Chars attribute="Comment" context="SingleLineComment" char="/" char1="/"/>
+ <Detect2Chars attribute="Comment" context="MultiLineCommentPrep" char="/" char1="*"/>
+ </context>
+ <context attribute="Comment" lineEndContext="#stay" name="MultiLineCommentPrep">
+ <Detect2Chars attribute="Comment" context="#pop#pop" char="*" char1="/"/>
+ </context>
+ </contexts>
+ <itemDatas>
+ <itemData name="Normal Text" defStyleNum="dsNormal"/>
+ <itemData name="Keyword" defStyleNum="dsKeyword"/>
+ <itemData name="Data Type" defStyleNum="dsDataType"/>
+ <itemData name="Decimal" defStyleNum="dsDecVal"/>
+ <itemData name="Octal" defStyleNum="dsBaseN"/>
+ <itemData name="Hex" defStyleNum="dsBaseN"/>
+ <itemData name="Float" defStyleNum="dsFloat"/>
+ <itemData name="Char" defStyleNum="dsChar"/>
+ <itemData name="String" defStyleNum="dsString"/>
+ <itemData name="String Char" defStyleNum="dsChar"/>
+ <itemData name="Comment" defStyleNum="dsComment"/>
+ <itemData name="Symbol" defStyleNum="dsNormal"/>
+ <itemData name="Preprocessor" defStyleNum="dsOthers"/>
+ <itemData name="Prep. Lib" defStyleNum="dsOthers"/> <!--,Qt::darkYellow,Qt::yellow,false,false)); -->
+ </itemDatas>
+ </highlighting>
+ <general>
+ <comments>
+ <comment name="singleLine" start="//" />
+ <comment name="multiLine" start="/*" end="*/" />
+ </comments>
+ <keywords casesensitive="1" />
+ </general>
+</language>
diff --git a/kate/data/ocaml.xml b/kate/data/ocaml.xml
new file mode 100644
index 000000000..6d7a07d49
--- /dev/null
+++ b/kate/data/ocaml.xml
@@ -0,0 +1,181 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Kate syntax highlighting for Objective Caml version 3.07 in the standard and revised syntaxes. -->
+<!DOCTYPE language SYSTEM "language.dtd"
+[
+<!-- Regular expresion constants: -->
+<!ENTITY LETTER "A-Za-z\0300-\0326\0330-\0366\0370-\0377"> <!-- Latin-1 letters. -->
+<!ENTITY IDENT "[&LETTER;_][&LETTER;0-9_']*"> <!-- OCaml identifiers. -->
+<!ENTITY ESC "(\\[ntbr'&quot;\\]|\\[0-9]{3}|\\x[0-9A-Fa-f]{2})"> <!-- OCaml character code escapes. -->
+<!ENTITY DEC "[0-9][0-9_]*"> <!-- Decimal digits with underscores. -->
+]>
+<language name="Objective Caml" version="1.04" kateversion="2.4" section="Sources" extensions="*.ml;*.mli" mimetype="" priority="10" author="Glyn Webster (glyn@wave.co.nz)" license="LGPL">
+
+ <highlighting>
+ <!-- Revised Syntax keywords are highlighted as identifiers by default. -->
+ <!-- Change their highlighting colour to match the standard keywords -->
+ <!-- if you intend to use the Camlp4 Revised Syntax. -->
+ <list name="revised syntax keywords">
+ <item> declare </item>
+ <item> value </item>
+ <item> where </item>
+ </list>
+ <list name="keywords">
+ <item> and </item>
+ <item> as </item>
+ <item> assert </item>
+ <item> asr </item>
+ <item> begin </item>
+ <item> class </item>
+ <item> closed </item>
+ <item> constraint </item>
+ <item> do </item>
+ <item> done </item>
+ <item> downto </item>
+ <item> else </item>
+ <item> end </item>
+ <item> exception </item>
+ <item> external </item>
+ <item> false </item>
+ <item> for </item>
+ <item> fun </item>
+ <item> function </item>
+ <item> functor </item>
+ <item> if </item>
+ <item> in </item>
+ <item> include </item>
+ <item> inherit </item>
+ <item> land </item>
+ <item> lazy </item>
+ <item> let </item>
+ <item> lor </item>
+ <item> lsl </item>
+ <item> lsr </item>
+ <item> lxor </item>
+ <item> match </item>
+ <item> method </item>
+ <item> mod </item>
+ <item> module </item>
+ <item> mutable </item>
+ <item> new </item>
+ <item> of </item>
+ <item> open </item>
+ <item> or </item>
+ <item> parser </item>
+ <item> private </item>
+ <item> rec </item>
+ <item> sig </item>
+ <item> struct </item>
+ <item> then </item>
+ <item> to </item>
+ <item> true </item>
+ <item> try </item>
+ <item> type </item>
+ <item> val </item>
+ <item> virtual </item>
+ <item> when </item>
+ <item> while </item>
+ <item> with </item>
+ </list>
+ <list name="core types">
+ <item> exn </item>
+ <item> lazy_t </item>
+ <item> format </item>
+ <item> unit </item>
+ <item> int </item>
+ <item> real </item>
+ <item> char </item>
+ <item> string </item>
+ <item> ref </item>
+ <item> array </item>
+ <item> bool </item>
+ <item> list </item>
+ <item> option </item>
+ </list>
+ <contexts>
+
+ <context attribute="Normal Text" lineEndContext="#stay" name="Normal">
+
+ <Detect2Chars attribute="Comment" context="Multiline Comment" char="(" char1="*" beginRegion="comment" />
+
+ <!-- Interpreter directives. -->
+ <!-- (These are lines where the first symbol is a '#' followed by an identifier. -->
+ <!-- Such lines could also be part of a method call split over two lines but -->
+ <!-- it's unlikey anyone would code like that.) -->
+ <RegExpr attribute="Directive" context="#stay" String="#&IDENT;.*$" firstNonSpace="true"/>
+
+ <!-- String, character and Camlp4 "quotation" constants. -->
+ <!-- Note: If you must modify the pattern for characters be precise: -->
+ <!-- single quotes have several meanings in Ocaml. -->
+ <DetectChar attribute="String" context="String Constant" char="&quot;" />
+ <RegExpr attribute="Character" context="#stay" String="'(&ESC;|[^'])'" />
+ <Detect2Chars attribute="Camlp4 Quotation" context="Camlp4 Quotation Constant" char="&lt;" char1="&lt;" />
+ <RegExpr attribute="Camlp4 Quotation" context="Camlp4 Quotation Constant" String="&lt;:&IDENT;&lt;" />
+
+ <!-- Identifiers and keywords. -->
+ <keyword attribute="Keyword" context="#stay" String="keywords" />
+ <keyword attribute="Revised Syntax Keyword" context="#stay" String="revised syntax keywords" />
+ <keyword attribute="Core Data Type" context="#stay" String="core types" />
+ <RegExpr attribute="Identifier" context="#stay" String="&IDENT;" />
+
+ <!-- Numeric constants. -->
+ <!-- Note that they may contain underscores. -->
+ <RegExpr attribute="Hexadecimal" context="#stay" String="-?0[xX][0-9A-Fa-f_]+" />
+ <RegExpr attribute="Octal" context="#stay" String="-?0[oO][0-7_]+" />
+ <RegExpr attribute="Binary" context="#stay" String="-?0[bB][01_]+" />
+ <RegExpr attribute="Float" context="#stay" String="-?&DEC;(\.&DEC;([eE][-+]?&DEC;)?|[eE][-+]?&DEC;)" />
+ <RegExpr attribute="Decimal" context="#stay" String="-?&DEC;" />
+ </context>
+
+ <context attribute="Comment" lineEndContext="#stay" name="Multiline Comment">
+ <!-- Support for nested comments -->
+ <Detect2Chars attribute="Comment" context="#pop" char="*" char1=")" endRegion="comment" />
+ <Detect2Chars attribute="Comment" context="Multiline Comment" char="(" char1="*" beginRegion="comment" />
+ </context>
+
+ <context attribute="String" lineEndContext="#stay" name="String Constant">
+ <DetectChar attribute="String" context="#pop" char="&quot;" />
+ <RegExpr attribute="Escaped characters" context="#stay" String="&ESC;" />
+ <!-- An underscore at the end of a line in a string indicates -->
+ <!-- that the string will continue on the next line. -->
+ <RegExpr attribute="Escaped characters" context="#stay" String="\\$" />
+ </context>
+
+ <!-- Camlp4 Quotations. These are source code literals used by the Campl4 preprocessor. -->
+ <!-- The only escapes allowed in a Camlp4 quotation are for the quotation start and stop symbols. -->
+ <context attribute="Camlp4 Quotation" lineEndContext="#stay" name="Camlp4 Quotation Constant">
+ <Detect2Chars attribute="Camlp4 Quotation" context="#pop" char="&gt;" char1="&gt;" />
+ <Detect2Chars attribute="Camlp4 Quotation" context="Camlp4 Quotation Constant" char="&lt;" char1="&lt;" />
+ <RegExpr attribute="Camlp4 Quotation" context="Camlp4 Quotation Constant" String="&lt;:&IDENT;&lt;" />
+ <RegExpr attribute="Escaped characters" context="#stay" String="\\(\\|&gt;&gt;|&lt;&lt;)" />
+ <RegExpr attribute="Escaped characters" context="#stay" String="\\&lt;:&IDENT;&lt;" />
+ </context>
+ </contexts>
+
+ <itemDatas>
+ <itemData name="Normal Text" defStyleNum="dsNormal"/>
+ <itemData name="Identifier" defStyleNum="dsNormal"/>
+ <itemData name="Keyword" defStyleNum="dsKeyword"/>
+ <itemData name="Revised Syntax Keyword" defStyleNum="dsNormal"/>
+ <itemData name="Core Data Type" defStyleNum="dsDataType"/>
+ <itemData name="Decimal" defStyleNum="dsDecVal"/>
+ <itemData name="Hexadecimal" defStyleNum="dsBaseN"/>
+ <itemData name="Octal" defStyleNum="dsBaseN"/>
+ <itemData name="Binary" defStyleNum="dsBaseN"/>
+ <itemData name="Float" defStyleNum="dsFloat"/>
+ <itemData name="Character" defStyleNum="dsChar"/>
+ <itemData name="String" defStyleNum="dsString"/>
+ <itemData name="Escaped characters" defStyleNum="dsChar"/>
+ <itemData name="Comment" defStyleNum="dsComment"/>
+ <itemData name="Camlp4 Quotation" defStyleNum="dsString"/>
+ <itemData name="Directive" defStyleNum="dsOthers"/>
+ </itemDatas>
+ </highlighting>
+
+ <general>
+ <keywords casesensitive="1" />
+ <comments>
+ <comment name="multiLine" start="(*" end="*)" />
+ </comments>
+ </general>
+</language>
+<!-- kate: space-indent on; indent-width 2; replace-tabs on; -->
diff --git a/kate/data/octave.xml b/kate/data/octave.xml
new file mode 100644
index 000000000..a01ed3eb4
--- /dev/null
+++ b/kate/data/octave.xml
@@ -0,0 +1,2219 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+<!--
+ ====================================================================
+ Octave syntax highlighting file for the KDE editors Kate and Kwrite
+ ====================================================================
+ based on Octave 2.1.64
+ function and variable list obtained by dispatch_help()'s output
+
+ Change log:
+ 16-Dec-04 Created from Matlab and Scilab files.
+
+ Author: Federico Zenith, Norwegian University of Science and Technology
+ Thanks to Luis Silvestre for previous version and suggestions
+-->
+
+
+<language name="Octave" version="1.01" kateversion="2.3" section="Scientific" extensions="*.octave;*.m;*.M" mimetype="text/octave" casesensitive="1" license="GPL" author="Luis Silvestre and Federico Zenith">
+
+ <highlighting>
+
+ <!-- Reserved keywords in Octave -->
+ <list name="keywords">
+ <item> all_va_args </item>
+ <item> break </item>
+ <item> case </item>
+ <item> continue </item>
+ <item> else </item>
+ <item> elseif </item>
+ <item> end_unwind_protect </item>
+ <item> global </item>
+ <item> gplot </item>
+ <item> gsplot </item>
+ <item> otherwise </item>
+ <item> persistent </item>
+ <item> replot </item>
+ <item> return </item>
+ <item> static </item>
+ <item> until </item>
+ <item> unwind_protect </item>
+ <item> unwind_protect_cleanup </item>
+ <item> varargin </item>
+ <item> varargout </item>
+ </list>
+
+ <list name="builtin">
+ <item> argv </item>
+ <item> e </item>
+ <item> eps </item>
+ <item> false </item>
+ <item> F_DUPFD </item>
+ <item> F_GETFD </item>
+ <item> F_GETFL </item>
+ <item> filesep </item>
+ <item> F_SETFD </item>
+ <item> F_SETFL </item>
+ <item> i </item>
+ <item> I </item>
+ <item> inf </item>
+ <item> Inf </item>
+ <item> j </item>
+ <item> J </item>
+ <item> NA </item>
+ <item> nan </item>
+ <item> NaN </item>
+ <item> O_APPEND </item>
+ <item> O_ASYNC </item>
+ <item> O_CREAT </item>
+ <item> OCTAVE_HOME </item>
+ <item> OCTAVE_VERSION </item>
+ <item> O_EXCL </item>
+ <item> O_NONBLOCK </item>
+ <item> O_RDONLY </item>
+ <item> O_RDWR </item>
+ <item> O_SYNC </item>
+ <item> O_TRUNC </item>
+ <item> O_WRONLY </item>
+ <item> pi </item>
+ <item> program_invocation_name </item>
+ <item> program_name </item>
+ <item> P_tmpdir </item>
+ <item> realmax </item>
+ <item> realmin </item>
+ <item> SEEK_CUR </item>
+ <item> SEEK_END </item>
+ <item> SEEK_SET </item>
+ <item> SIG </item>
+ <item> stderr </item>
+ <item> stdin </item>
+ <item> stdout </item>
+ <item> true </item>
+ <item> ans </item>
+ <item> automatic_replot </item>
+ <item> beep_on_error </item>
+ <item> completion_append_char </item>
+ <item> crash_dumps_octave_core </item>
+ <item> current_script_file_name </item>
+ <item> debug_on_error </item>
+ <item> debug_on_interrupt </item>
+ <item> debug_on_warning </item>
+ <item> debug_symtab_lookups </item>
+ <item> DEFAULT_EXEC_PATH </item>
+ <item> DEFAULT_LOADPATH </item>
+ <item> default_save_format </item>
+ <item> echo_executing_commands </item>
+ <item> EDITOR </item>
+ <item> EXEC_PATH </item>
+ <item> FFTW_WISDOM_PROGRAM </item>
+ <item> fixed_point_format </item>
+ <item> gnuplot_binary </item>
+ <item> gnuplot_command_axes </item>
+ <item> gnuplot_command_end </item>
+ <item> gnuplot_command_plot </item>
+ <item> gnuplot_command_replot </item>
+ <item> gnuplot_command_splot </item>
+ <item> gnuplot_command_title </item>
+ <item> gnuplot_command_using </item>
+ <item> gnuplot_command_with </item>
+ <item> gnuplot_has_frames </item>
+ <item> history_file </item>
+ <item> history_size </item>
+ <item> ignore_function_time_stamp </item>
+ <item> IMAGEPATH </item>
+ <item> INFO_FILE </item>
+ <item> INFO_PROGRAM </item>
+ <item> __kluge_procbuf_delay__ </item>
+ <item> LOADPATH </item>
+ <item> MAKEINFO_PROGRAM </item>
+ <item> max_recursion_depth </item>
+ <item> octave_core_file_format </item>
+ <item> octave_core_file_limit </item>
+ <item> octave_core_file_name </item>
+ <item> output_max_field_width </item>
+ <item> output_precision </item>
+ <item> page_output_immediately </item>
+ <item> PAGER </item>
+ <item> page_screen_output </item>
+ <item> print_answer_id_name </item>
+ <item> print_empty_dimensions </item>
+ <item> print_rhs_assign_val </item>
+ <item> PS1 </item>
+ <item> PS2 </item>
+ <item> PS4 </item>
+ <item> save_header_format_string </item>
+ <item> save_precision </item>
+ <item> saving_history </item>
+ <item> sighup_dumps_octave_core </item>
+ <item> sigterm_dumps_octave_core </item>
+ <item> silent_functions </item>
+ <item> split_long_rows </item>
+ <item> string_fill_char </item>
+ <item> struct_levels_to_print </item>
+ <item> suppress_verbose_help_message </item>
+ <item> variables_can_hide_functions </item>
+ <item> warn_assign_as_truth_value </item>
+ <item> warn_divide_by_zero </item>
+ <item> warn_empty_list_elements </item>
+ <item> warn_fortran_indexing </item>
+ <item> warn_function_name_clash </item>
+ <item> warn_future_time_stamp </item>
+ <item> warn_imag_to_real </item>
+ <item> warn_matlab_incompatible </item>
+ <item> warn_missing_semicolon </item>
+ <item> warn_neg_dim_as_zero </item>
+ <item> warn_num_to_str </item>
+ <item> warn_precedence_change </item>
+ <item> warn_reload_forces_clear </item>
+ <item> warn_resize_on_range_error </item>
+ <item> warn_separator_insert </item>
+ <item> warn_single_quote_string </item>
+ <item> warn_str_to_num </item>
+ <item> warn_undefined_return_values </item>
+ <item> warn_variable_switch_label </item>
+ <item> whos_line_format </item>
+ </list>
+
+ <list name="commands">
+ <item> casesen </item>
+ <item> cd </item>
+ <item> chdir </item>
+ <item> clear </item>
+ <item> dbclear </item>
+ <item> dbstatus </item>
+ <item> dbstop </item>
+ <item> dbtype </item>
+ <item> dbwhere </item>
+ <item> diary </item>
+ <item> echo </item>
+ <item> edit_history </item>
+ <item> __end__ </item>
+ <item> format </item>
+ <item> gset </item>
+ <item> gshow </item>
+ <item> help </item>
+ <item> history </item>
+ <item> hold </item>
+ <item> iskeyword </item>
+ <item> isvarname </item>
+ <item> load </item>
+ <item> ls </item>
+ <item> mark_as_command </item>
+ <item> mislocked </item>
+ <item> mlock </item>
+ <item> more </item>
+ <item> munlock </item>
+ <item> run_history </item>
+ <item> save </item>
+ <item> set </item>
+ <item> show </item>
+ <item> type </item>
+ <item> unmark_command </item>
+ <item> which </item>
+ <item> who </item>
+ <item> whos </item>
+ </list>
+
+ <list name="functions">
+ <item> abs </item>
+ <item> acos </item>
+ <item> acosh </item>
+ <item> all </item>
+ <item> angle </item>
+ <item> any </item>
+ <item> append </item>
+ <item> arg </item>
+ <item> argnames </item>
+ <item> asin </item>
+ <item> asinh </item>
+ <item> assignin </item>
+ <item> atan </item>
+ <item> atan2 </item>
+ <item> atanh </item>
+ <item> atexit </item>
+ <item> bitand </item>
+ <item> bitmax </item>
+ <item> bitor </item>
+ <item> bitshift </item>
+ <item> bitxor </item>
+ <item> casesen </item>
+ <item> cat </item>
+ <item> cd </item>
+ <item> ceil </item>
+ <item> cell </item>
+ <item> cell2struct </item>
+ <item> cellstr </item>
+ <item> char </item>
+ <item> chdir </item>
+ <item> class </item>
+ <item> clc </item>
+ <item> clear </item>
+ <item> clearplot </item>
+ <item> clg </item>
+ <item> closeplot </item>
+ <item> completion_matches </item>
+ <item> conj </item>
+ <item> conv </item>
+ <item> convmtx </item>
+ <item> cos </item>
+ <item> cosh </item>
+ <item> cumprod </item>
+ <item> cumsum </item>
+ <item> dbclear </item>
+ <item> dbstatus </item>
+ <item> dbstop </item>
+ <item> dbtype </item>
+ <item> dbwhere </item>
+ <item> deconv </item>
+ <item> det </item>
+ <item> dftmtx </item>
+ <item> diag </item>
+ <item> diary </item>
+ <item> disp </item>
+ <item> document </item>
+ <item> do_string_escapes </item>
+ <item> double </item>
+ <item> dup2 </item>
+ <item> echo </item>
+ <item> edit_history </item>
+ <item> __end__ </item>
+ <item> erf </item>
+ <item> erfc </item>
+ <item> ERRNO </item>
+ <item> error </item>
+ <item> __error_text__ </item>
+ <item> error_text </item>
+ <item> eval </item>
+ <item> evalin </item>
+ <item> exec </item>
+ <item> exist </item>
+ <item> exit </item>
+ <item> exp </item>
+ <item> eye </item>
+ <item> fclose </item>
+ <item> fcntl </item>
+ <item> fdisp </item>
+ <item> feof </item>
+ <item> ferror </item>
+ <item> feval </item>
+ <item> fflush </item>
+ <item> fft </item>
+ <item> fgetl </item>
+ <item> fgets </item>
+ <item> fieldnames </item>
+ <item> file_in_loadpath </item>
+ <item> file_in_path </item>
+ <item> filter </item>
+ <item> find </item>
+ <item> find_first_of_in_loadpath </item>
+ <item> finite </item>
+ <item> fix </item>
+ <item> floor </item>
+ <item> fmod </item>
+ <item> fnmatch </item>
+ <item> fopen </item>
+ <item> fork </item>
+ <item> format </item>
+ <item> formula </item>
+ <item> fprintf </item>
+ <item> fputs </item>
+ <item> fread </item>
+ <item> freport </item>
+ <item> frewind </item>
+ <item> fscanf </item>
+ <item> fseek </item>
+ <item> ftell </item>
+ <item> func2str </item>
+ <item> functions </item>
+ <item> fwrite </item>
+ <item> gamma </item>
+ <item> gammaln </item>
+ <item> getegid </item>
+ <item> getenv </item>
+ <item> geteuid </item>
+ <item> getgid </item>
+ <item> getpgrp </item>
+ <item> getpid </item>
+ <item> getppid </item>
+ <item> getuid </item>
+ <item> glob </item>
+ <item> graw </item>
+ <item> gset </item>
+ <item> gshow </item>
+ <item> help </item>
+ <item> history </item>
+ <item> hold </item>
+ <item> home </item>
+ <item> horzcat </item>
+ <item> ifft </item>
+ <item> imag </item>
+ <item> inline </item>
+ <item> input </item>
+ <item> input_event_hook </item>
+ <item> int16 </item>
+ <item> int32 </item>
+ <item> int64 </item>
+ <item> int8 </item>
+ <item> intmax </item>
+ <item> intmin </item>
+ <item> inv </item>
+ <item> inverse </item>
+ <item> ipermute </item>
+ <item> isalnum </item>
+ <item> isalpha </item>
+ <item> isascii </item>
+ <item> isbool </item>
+ <item> iscell </item>
+ <item> iscellstr </item>
+ <item> ischar </item>
+ <item> iscntrl </item>
+ <item> iscomplex </item>
+ <item> isdigit </item>
+ <item> isempty </item>
+ <item> isfield </item>
+ <item> isfinite </item>
+ <item> isglobal </item>
+ <item> isgraph </item>
+ <item> ishold </item>
+ <item> isieee </item>
+ <item> isinf </item>
+ <item> iskeyword </item>
+ <item> islist </item>
+ <item> islogical </item>
+ <item> islower </item>
+ <item> ismatrix </item>
+ <item> isna </item>
+ <item> isnan </item>
+ <item> is_nan_or_na </item>
+ <item> isnumeric </item>
+ <item> isprint </item>
+ <item> ispunct </item>
+ <item> isreal </item>
+ <item> isspace </item>
+ <item> isstream </item>
+ <item> isstreamoff </item>
+ <item> isstruct </item>
+ <item> isupper </item>
+ <item> isvarname </item>
+ <item> isxdigit </item>
+ <item> kbhit </item>
+ <item> keyboard </item>
+ <item> kill </item>
+ <item> lasterr </item>
+ <item> lastwarn </item>
+ <item> length </item>
+ <item> lgamma </item>
+ <item> link </item>
+ <item> linspace </item>
+ <item> list </item>
+ <item> load </item>
+ <item> log </item>
+ <item> log10 </item>
+ <item> ls </item>
+ <item> lstat </item>
+ <item> lu </item>
+ <item> mark_as_command </item>
+ <item> mislocked </item>
+ <item> mkdir </item>
+ <item> mkfifo </item>
+ <item> mkstemp </item>
+ <item> mlock </item>
+ <item> more </item>
+ <item> munlock </item>
+ <item> nargin </item>
+ <item> nargout </item>
+ <item> native_float_format </item>
+ <item> ndims </item>
+ <item> nth </item>
+ <item> numel </item>
+ <item> octave_config_info </item>
+ <item> octave_tmp_file_name </item>
+ <item> ones </item>
+ <item> pause </item>
+ <item> pclose </item>
+ <item> permute </item>
+ <item> pipe </item>
+ <item> popen </item>
+ <item> printf </item>
+ <item> __print_symbol_info__ </item>
+ <item> __print_symtab_info__ </item>
+ <item> prod </item>
+ <item> purge_tmp_files </item>
+ <item> putenv </item>
+ <item> puts </item>
+ <item> pwd </item>
+ <item> quit </item>
+ <item> rank </item>
+ <item> readdir </item>
+ <item> readlink </item>
+ <item> read_readline_init_file </item>
+ <item> real </item>
+ <item> rehash </item>
+ <item> rename </item>
+ <item> reshape </item>
+ <item> reverse </item>
+ <item> rmdir </item>
+ <item> rmfield </item>
+ <item> roots </item>
+ <item> round </item>
+ <item> run_history </item>
+ <item> save </item>
+ <item> scanf </item>
+ <item> set </item>
+ <item> shell_cmd </item>
+ <item> show </item>
+ <item> sign </item>
+ <item> sin </item>
+ <item> sinh </item>
+ <item> size </item>
+ <item> sizeof </item>
+ <item> sleep </item>
+ <item> sort </item>
+ <item> source </item>
+ <item> splice </item>
+ <item> sprintf </item>
+ <item> sqrt </item>
+ <item> squeeze </item>
+ <item> sscanf </item>
+ <item> stat </item>
+ <item> str2func </item>
+ <item> streamoff </item>
+ <item> struct </item>
+ <item> struct2cell </item>
+ <item> sum </item>
+ <item> sumsq </item>
+ <item> symlink </item>
+ <item> system </item>
+ <item> tan </item>
+ <item> tanh </item>
+ <item> tilde_expand </item>
+ <item> tmpfile </item>
+ <item> tmpnam </item>
+ <item> toascii </item>
+ <item> __token_count__ </item>
+ <item> tolower </item>
+ <item> toupper </item>
+ <item> type </item>
+ <item> typeinfo </item>
+ <item> uint16 </item>
+ <item> uint32 </item>
+ <item> uint64 </item>
+ <item> uint8 </item>
+ <item> umask </item>
+ <item> undo_string_escapes </item>
+ <item> unlink </item>
+ <item> unmark_command </item>
+ <item> usage </item>
+ <item> usleep </item>
+ <item> va_arg </item>
+ <item> va_start </item>
+ <item> vectorize </item>
+ <item> vertcat </item>
+ <item> vr_val </item>
+ <item> waitpid </item>
+ <item> warning </item>
+ <item> warranty </item>
+ <item> which </item>
+ <item> who </item>
+ <item> whos </item>
+ <item> zeros </item>
+ <item> airy </item>
+ <item> balance </item>
+ <item> besselh </item>
+ <item> besseli </item>
+ <item> besselj </item>
+ <item> besselk </item>
+ <item> bessely </item>
+ <item> betainc </item>
+ <item> chol </item>
+ <item> colloc </item>
+ <item> daspk </item>
+ <item> daspk_options </item>
+ <item> dasrt </item>
+ <item> dasrt_options </item>
+ <item> dassl </item>
+ <item> dassl_options </item>
+ <item> det </item>
+ <item> eig </item>
+ <item> endgrent </item>
+ <item> endpwent </item>
+ <item> expm </item>
+ <item> fft </item>
+ <item> fft2 </item>
+ <item> fftn </item>
+ <item> fftw_wisdom </item>
+ <item> filter </item>
+ <item> find </item>
+ <item> fsolve </item>
+ <item> fsolve_options </item>
+ <item> gammainc </item>
+ <item> gcd </item>
+ <item> getgrent </item>
+ <item> getgrgid </item>
+ <item> getgrnam </item>
+ <item> getpwent </item>
+ <item> getpwnam </item>
+ <item> getpwuid </item>
+ <item> getrusage </item>
+ <item> givens </item>
+ <item> gmtime </item>
+ <item> hess </item>
+ <item> ifft </item>
+ <item> ifft2 </item>
+ <item> ifftn </item>
+ <item> inv </item>
+ <item> inverse </item>
+ <item> kron </item>
+ <item> localtime </item>
+ <item> lpsolve </item>
+ <item> lpsolve_options </item>
+ <item> lsode </item>
+ <item> lsode_options </item>
+ <item> lu </item>
+ <item> max </item>
+ <item> min </item>
+ <item> minmax </item>
+ <item> mktime </item>
+ <item> odessa </item>
+ <item> odessa_options </item>
+ <item> pinv </item>
+ <item> qr </item>
+ <item> quad </item>
+ <item> quad_options </item>
+ <item> qz </item>
+ <item> rand </item>
+ <item> randn </item>
+ <item> schur </item>
+ <item> setgrent </item>
+ <item> setpwent </item>
+ <item> sort </item>
+ <item> sqrtm </item>
+ <item> strftime </item>
+ <item> strptime </item>
+ <item> svd </item>
+ <item> syl </item>
+ <item> time </item>
+ <item> abcddim </item>
+ <item> __abcddims__ </item>
+ <item> acot </item>
+ <item> acoth </item>
+ <item> acsc </item>
+ <item> acsch </item>
+ <item> analdemo </item>
+ <item> anova </item>
+ <item> arch_fit </item>
+ <item> arch_rnd </item>
+ <item> arch_test </item>
+ <item> are </item>
+ <item> arma_rnd </item>
+ <item> asctime </item>
+ <item> asec </item>
+ <item> asech </item>
+ <item> autocor </item>
+ <item> autocov </item>
+ <item> autoreg_matrix </item>
+ <item> axis </item>
+ <item> axis2dlim </item>
+ <item> __axis_label__ </item>
+ <item> bar </item>
+ <item> bartlett </item>
+ <item> bartlett_test </item>
+ <item> base2dec </item>
+ <item> bddemo </item>
+ <item> beep </item>
+ <item> bessel </item>
+ <item> beta </item>
+ <item> beta_cdf </item>
+ <item> betai </item>
+ <item> beta_inv </item>
+ <item> beta_pdf </item>
+ <item> beta_rnd </item>
+ <item> bin2dec </item>
+ <item> bincoeff </item>
+ <item> binomial_cdf </item>
+ <item> binomial_inv </item>
+ <item> binomial_pdf </item>
+ <item> binomial_rnd </item>
+ <item> bitcmp </item>
+ <item> bitget </item>
+ <item> bitset </item>
+ <item> blackman </item>
+ <item> blanks </item>
+ <item> bode </item>
+ <item> bode_bounds </item>
+ <item> __bodquist__ </item>
+ <item> bottom_title </item>
+ <item> bug_report </item>
+ <item> buildssic </item>
+ <item> c2d </item>
+ <item> cart2pol </item>
+ <item> cart2sph </item>
+ <item> cauchy_cdf </item>
+ <item> cauchy_inv </item>
+ <item> cauchy_pdf </item>
+ <item> cauchy_rnd </item>
+ <item> cellidx </item>
+ <item> center </item>
+ <item> chisquare_cdf </item>
+ <item> chisquare_inv </item>
+ <item> chisquare_pdf </item>
+ <item> chisquare_rnd </item>
+ <item> chisquare_test_homogeneity </item>
+ <item> chisquare_test_independence </item>
+ <item> circshift </item>
+ <item> clock </item>
+ <item> cloglog </item>
+ <item> close </item>
+ <item> colormap </item>
+ <item> columns </item>
+ <item> com2str </item>
+ <item> comma </item>
+ <item> common_size </item>
+ <item> commutation_matrix </item>
+ <item> compan </item>
+ <item> complement </item>
+ <item> computer </item>
+ <item> cond </item>
+ <item> contour </item>
+ <item> controldemo </item>
+ <item> conv </item>
+ <item> cor </item>
+ <item> corrcoef </item>
+ <item> cor_test </item>
+ <item> cot </item>
+ <item> coth </item>
+ <item> cov </item>
+ <item> cputime </item>
+ <item> create_set </item>
+ <item> cross </item>
+ <item> csc </item>
+ <item> csch </item>
+ <item> ctime </item>
+ <item> ctrb </item>
+ <item> cut </item>
+ <item> d2c </item>
+ <item> damp </item>
+ <item> dare </item>
+ <item> date </item>
+ <item> dcgain </item>
+ <item> deal </item>
+ <item> deblank </item>
+ <item> dec2base </item>
+ <item> dec2bin </item>
+ <item> dec2hex </item>
+ <item> deconv </item>
+ <item> delete </item>
+ <item> DEMOcontrol </item>
+ <item> demoquat </item>
+ <item> detrend </item>
+ <item> dezero </item>
+ <item> dgkfdemo </item>
+ <item> dgram </item>
+ <item> dhinfdemo </item>
+ <item> diff </item>
+ <item> diffpara </item>
+ <item> dir </item>
+ <item> discrete_cdf </item>
+ <item> discrete_inv </item>
+ <item> discrete_pdf </item>
+ <item> discrete_rnd </item>
+ <item> dkalman </item>
+ <item> dlqe </item>
+ <item> dlqg </item>
+ <item> dlqr </item>
+ <item> dlyap </item>
+ <item> dmr2d </item>
+ <item> dmult </item>
+ <item> dot </item>
+ <item> dre </item>
+ <item> dump_prefs </item>
+ <item> duplication_matrix </item>
+ <item> durbinlevinson </item>
+ <item> empirical_cdf </item>
+ <item> empirical_inv </item>
+ <item> empirical_pdf </item>
+ <item> empirical_rnd </item>
+ <item> erfinv </item>
+ <item> __errcomm__ </item>
+ <item> errorbar </item>
+ <item> __errplot__ </item>
+ <item> etime </item>
+ <item> exponential_cdf </item>
+ <item> exponential_inv </item>
+ <item> exponential_pdf </item>
+ <item> exponential_rnd </item>
+ <item> f_cdf </item>
+ <item> fftconv </item>
+ <item> fftfilt </item>
+ <item> fftshift </item>
+ <item> figure </item>
+ <item> fileparts </item>
+ <item> findstr </item>
+ <item> f_inv </item>
+ <item> fir2sys </item>
+ <item> flipdim </item>
+ <item> fliplr </item>
+ <item> flipud </item>
+ <item> flops </item>
+ <item> f_pdf </item>
+ <item> fractdiff </item>
+ <item> frdemo </item>
+ <item> freqchkw </item>
+ <item> __freqresp__ </item>
+ <item> freqz </item>
+ <item> freqz_plot </item>
+ <item> f_rnd </item>
+ <item> f_test_regression </item>
+ <item> fullfile </item>
+ <item> fv </item>
+ <item> fvl </item>
+ <item> gamma_cdf </item>
+ <item> gammai </item>
+ <item> gamma_inv </item>
+ <item> gamma_pdf </item>
+ <item> gamma_rnd </item>
+ <item> geometric_cdf </item>
+ <item> geometric_inv </item>
+ <item> geometric_pdf </item>
+ <item> geometric_rnd </item>
+ <item> gls </item>
+ <item> gram </item>
+ <item> gray </item>
+ <item> gray2ind </item>
+ <item> grid </item>
+ <item> h2norm </item>
+ <item> h2syn </item>
+ <item> hamming </item>
+ <item> hankel </item>
+ <item> hanning </item>
+ <item> hex2dec </item>
+ <item> hilb </item>
+ <item> hinf_ctr </item>
+ <item> hinfdemo </item>
+ <item> hinfnorm </item>
+ <item> hinfsyn </item>
+ <item> hinfsyn_chk </item>
+ <item> hinfsyn_ric </item>
+ <item> hist </item>
+ <item> hotelling_test </item>
+ <item> hotelling_test_2 </item>
+ <item> housh </item>
+ <item> hsv2rgb </item>
+ <item> hurst </item>
+ <item> hypergeometric_cdf </item>
+ <item> hypergeometric_inv </item>
+ <item> hypergeometric_pdf </item>
+ <item> hypergeometric_rnd </item>
+ <item> image </item>
+ <item> imagesc </item>
+ <item> impulse </item>
+ <item> imshow </item>
+ <item> ind2gray </item>
+ <item> ind2rgb </item>
+ <item> ind2sub </item>
+ <item> index </item>
+ <item> int2str </item>
+ <item> intersection </item>
+ <item> invhilb </item>
+ <item> iqr </item>
+ <item> irr </item>
+ <item> isa </item>
+ <item> is_abcd </item>
+ <item> is_bool </item>
+ <item> is_complex </item>
+ <item> is_controllable </item>
+ <item> isdefinite </item>
+ <item> is_detectable </item>
+ <item> is_dgkf </item>
+ <item> is_digital </item>
+ <item> is_duplicate_entry </item>
+ <item> is_global </item>
+ <item> is_leap_year </item>
+ <item> isletter </item>
+ <item> is_list </item>
+ <item> is_matrix </item>
+ <item> is_observable </item>
+ <item> ispc </item>
+ <item> is_sample </item>
+ <item> is_scalar </item>
+ <item> isscalar </item>
+ <item> is_signal_list </item>
+ <item> is_siso </item>
+ <item> is_square </item>
+ <item> issquare </item>
+ <item> is_stabilizable </item>
+ <item> is_stable </item>
+ <item> isstr </item>
+ <item> is_stream </item>
+ <item> is_struct </item>
+ <item> is_symmetric </item>
+ <item> issymmetric </item>
+ <item> isunix </item>
+ <item> is_vector </item>
+ <item> isvector </item>
+ <item> jet707 </item>
+ <item> kendall </item>
+ <item> kolmogorov_smirnov_cdf </item>
+ <item> kolmogorov_smirnov_test </item>
+ <item> kolmogorov_smirnov_test_2 </item>
+ <item> kruskal_wallis_test </item>
+ <item> krylov </item>
+ <item> krylovb </item>
+ <item> kurtosis </item>
+ <item> laplace_cdf </item>
+ <item> laplace_inv </item>
+ <item> laplace_pdf </item>
+ <item> laplace_rnd </item>
+ <item> lcm </item>
+ <item> lin2mu </item>
+ <item> listidx </item>
+ <item> list_primes </item>
+ <item> loadaudio </item>
+ <item> loadimage </item>
+ <item> log2 </item>
+ <item> logical </item>
+ <item> logistic_cdf </item>
+ <item> logistic_inv </item>
+ <item> logistic_pdf </item>
+ <item> logistic_regression </item>
+ <item> logistic_regression_derivatives </item>
+ <item> logistic_regression_likelihood </item>
+ <item> logistic_rnd </item>
+ <item> logit </item>
+ <item> loglog </item>
+ <item> loglogerr </item>
+ <item> logm </item>
+ <item> lognormal_cdf </item>
+ <item> lognormal_inv </item>
+ <item> lognormal_pdf </item>
+ <item> lognormal_rnd </item>
+ <item> logspace </item>
+ <item> lower </item>
+ <item> lqe </item>
+ <item> lqg </item>
+ <item> lqr </item>
+ <item> lsim </item>
+ <item> ltifr </item>
+ <item> lyap </item>
+ <item> mahalanobis </item>
+ <item> manova </item>
+ <item> mcnemar_test </item>
+ <item> mean </item>
+ <item> meansq </item>
+ <item> median </item>
+ <item> menu </item>
+ <item> mesh </item>
+ <item> meshdom </item>
+ <item> meshgrid </item>
+ <item> minfo </item>
+ <item> mod </item>
+ <item> moddemo </item>
+ <item> moment </item>
+ <item> mplot </item>
+ <item> mu2lin </item>
+ <item> multiplot </item>
+ <item> nargchk </item>
+ <item> nextpow2 </item>
+ <item> nichols </item>
+ <item> norm </item>
+ <item> normal_cdf </item>
+ <item> normal_inv </item>
+ <item> normal_pdf </item>
+ <item> normal_rnd </item>
+ <item> not </item>
+ <item> nper </item>
+ <item> npv </item>
+ <item> ntsc2rgb </item>
+ <item> null </item>
+ <item> num2str </item>
+ <item> nyquist </item>
+ <item> obsv </item>
+ <item> ocean </item>
+ <item> ols </item>
+ <item> oneplot </item>
+ <item> ord2 </item>
+ <item> orth </item>
+ <item> __outlist__ </item>
+ <item> pack </item>
+ <item> packedform </item>
+ <item> packsys </item>
+ <item> parallel </item>
+ <item> paren </item>
+ <item> pascal_cdf </item>
+ <item> pascal_inv </item>
+ <item> pascal_pdf </item>
+ <item> pascal_rnd </item>
+ <item> path </item>
+ <item> periodogram </item>
+ <item> perror </item>
+ <item> place </item>
+ <item> playaudio </item>
+ <item> plot </item>
+ <item> plot_border </item>
+ <item> __plr__ </item>
+ <item> __plr1__ </item>
+ <item> __plr2__ </item>
+ <item> __plt__ </item>
+ <item> __plt1__ </item>
+ <item> __plt2__ </item>
+ <item> __plt2mm__ </item>
+ <item> __plt2mv__ </item>
+ <item> __plt2ss__ </item>
+ <item> __plt2vm__ </item>
+ <item> __plt2vv__ </item>
+ <item> __pltopt__ </item>
+ <item> __pltopt1__ </item>
+ <item> pmt </item>
+ <item> poisson_cdf </item>
+ <item> poisson_inv </item>
+ <item> poisson_pdf </item>
+ <item> poisson_rnd </item>
+ <item> pol2cart </item>
+ <item> polar </item>
+ <item> poly </item>
+ <item> polyder </item>
+ <item> polyderiv </item>
+ <item> polyfit </item>
+ <item> polyinteg </item>
+ <item> polyout </item>
+ <item> polyreduce </item>
+ <item> polyval </item>
+ <item> polyvalm </item>
+ <item> popen2 </item>
+ <item> postpad </item>
+ <item> pow2 </item>
+ <item> ppplot </item>
+ <item> prepad </item>
+ <item> probit </item>
+ <item> prompt </item>
+ <item> prop_test_2 </item>
+ <item> pv </item>
+ <item> pvl </item>
+ <item> pzmap </item>
+ <item> qconj </item>
+ <item> qcoordinate_plot </item>
+ <item> qderiv </item>
+ <item> qderivmat </item>
+ <item> qinv </item>
+ <item> qmult </item>
+ <item> qqplot </item>
+ <item> qtrans </item>
+ <item> qtransv </item>
+ <item> qtransvmat </item>
+ <item> quaternion </item>
+ <item> qzhess </item>
+ <item> qzval </item>
+ <item> randperm </item>
+ <item> range </item>
+ <item> rank </item>
+ <item> ranks </item>
+ <item> rate </item>
+ <item> record </item>
+ <item> rectangle_lw </item>
+ <item> rectangle_sw </item>
+ <item> rem </item>
+ <item> repmat </item>
+ <item> residue </item>
+ <item> rgb2hsv </item>
+ <item> rgb2ind </item>
+ <item> rgb2ntsc </item>
+ <item> rindex </item>
+ <item> rldemo </item>
+ <item> rlocus </item>
+ <item> roots </item>
+ <item> rot90 </item>
+ <item> rotdim </item>
+ <item> rotg </item>
+ <item> rows </item>
+ <item> run_cmd </item>
+ <item> run_count </item>
+ <item> run_test </item>
+ <item> saveaudio </item>
+ <item> saveimage </item>
+ <item> sec </item>
+ <item> sech </item>
+ <item> semicolon </item>
+ <item> semilogx </item>
+ <item> semilogxerr </item>
+ <item> semilogy </item>
+ <item> semilogyerr </item>
+ <item> series </item>
+ <item> setaudio </item>
+ <item> setstr </item>
+ <item> shg </item>
+ <item> shift </item>
+ <item> shiftdim </item>
+ <item> sign_test </item>
+ <item> sinc </item>
+ <item> sinetone </item>
+ <item> sinewave </item>
+ <item> skewness </item>
+ <item> sombrero </item>
+ <item> sortcom </item>
+ <item> spearman </item>
+ <item> spectral_adf </item>
+ <item> spectral_xdf </item>
+ <item> spencer </item>
+ <item> sph2cart </item>
+ <item> split </item>
+ <item> ss </item>
+ <item> ss2sys </item>
+ <item> ss2tf </item>
+ <item> ss2zp </item>
+ <item> stairs </item>
+ <item> starp </item>
+ <item> statistics </item>
+ <item> std </item>
+ <item> stdnormal_cdf </item>
+ <item> stdnormal_inv </item>
+ <item> stdnormal_pdf </item>
+ <item> stdnormal_rnd </item>
+ <item> step </item>
+ <item> __stepimp__ </item>
+ <item> stft </item>
+ <item> str2mat </item>
+ <item> str2num </item>
+ <item> strappend </item>
+ <item> strcat </item>
+ <item> strcmp </item>
+ <item> strerror </item>
+ <item> strjust </item>
+ <item> strrep </item>
+ <item> struct_contains </item>
+ <item> struct_elements </item>
+ <item> studentize </item>
+ <item> sub2ind </item>
+ <item> subplot </item>
+ <item> substr </item>
+ <item> subwindow </item>
+ <item> swap </item>
+ <item> swapcols </item>
+ <item> swaprows </item>
+ <item> sylvester_matrix </item>
+ <item> synthesis </item>
+ <item> sys2fir </item>
+ <item> sys2ss </item>
+ <item> sys2tf </item>
+ <item> sys2zp </item>
+ <item> sysadd </item>
+ <item> sysappend </item>
+ <item> syschnames </item>
+ <item> __syschnamesl__ </item>
+ <item> syschtsam </item>
+ <item> __sysconcat__ </item>
+ <item> sysconnect </item>
+ <item> syscont </item>
+ <item> __syscont_disc__ </item>
+ <item> __sysdefioname__ </item>
+ <item> __sysdefstname__ </item>
+ <item> sysdimensions </item>
+ <item> sysdisc </item>
+ <item> sysdup </item>
+ <item> sysgetsignals </item>
+ <item> sysgettsam </item>
+ <item> sysgettype </item>
+ <item> sysgroup </item>
+ <item> __sysgroupn__ </item>
+ <item> sysidx </item>
+ <item> sysmin </item>
+ <item> sysmult </item>
+ <item> sysout </item>
+ <item> sysprune </item>
+ <item> sysreorder </item>
+ <item> sysrepdemo </item>
+ <item> sysscale </item>
+ <item> syssetsignals </item>
+ <item> syssub </item>
+ <item> sysupdate </item>
+ <item> table </item>
+ <item> t_cdf </item>
+ <item> tempdir </item>
+ <item> tempname </item>
+ <item> texas_lotto </item>
+ <item> tf </item>
+ <item> tf2ss </item>
+ <item> tf2sys </item>
+ <item> __tf2sysl__ </item>
+ <item> tf2zp </item>
+ <item> __tfl__ </item>
+ <item> tfout </item>
+ <item> tic </item>
+ <item> t_inv </item>
+ <item> title </item>
+ <item> toc </item>
+ <item> toeplitz </item>
+ <item> top_title </item>
+ <item> t_pdf </item>
+ <item> trace </item>
+ <item> triangle_lw </item>
+ <item> triangle_sw </item>
+ <item> tril </item>
+ <item> triu </item>
+ <item> t_rnd </item>
+ <item> t_test </item>
+ <item> t_test_2 </item>
+ <item> t_test_regression </item>
+ <item> tzero </item>
+ <item> tzero2 </item>
+ <item> ugain </item>
+ <item> uniform_cdf </item>
+ <item> uniform_inv </item>
+ <item> uniform_pdf </item>
+ <item> uniform_rnd </item>
+ <item> union </item>
+ <item> unix </item>
+ <item> unpacksys </item>
+ <item> unwrap </item>
+ <item> upper </item>
+ <item> u_test </item>
+ <item> values </item>
+ <item> vander </item>
+ <item> var </item>
+ <item> var_test </item>
+ <item> vec </item>
+ <item> vech </item>
+ <item> version </item>
+ <item> vol </item>
+ <item> weibull_cdf </item>
+ <item> weibull_inv </item>
+ <item> weibull_pdf </item>
+ <item> weibull_rnd </item>
+ <item> welch_test </item>
+ <item> wgt1o </item>
+ <item> wiener_rnd </item>
+ <item> wilcoxon_test </item>
+ <item> xlabel </item>
+ <item> xor </item>
+ <item> ylabel </item>
+ <item> yulewalker </item>
+ <item> zgfmul </item>
+ <item> zgfslv </item>
+ <item> zginit </item>
+ <item> __zgpbal__ </item>
+ <item> zgreduce </item>
+ <item> zgrownorm </item>
+ <item> zgscal </item>
+ <item> zgsgiv </item>
+ <item> zgshsr </item>
+ <item> zlabel </item>
+ <item> zp </item>
+ <item> zp2ss </item>
+ <item> __zp2ssg2__ </item>
+ <item> zp2sys </item>
+ <item> zp2tf </item>
+ <item> zpout </item>
+ <item> z_test </item>
+ <item> z_test_2 </item>
+ </list>
+
+ <list name="forge">
+ <item> airy_Ai </item>
+ <item> airy_Ai_deriv </item>
+ <item> airy_Ai_deriv_scaled </item>
+ <item> airy_Ai_scaled </item>
+ <item> airy_Bi </item>
+ <item> airy_Bi_deriv </item>
+ <item> airy_Bi_deriv_scaled </item>
+ <item> airy_Bi_scaled </item>
+ <item> airy_zero_Ai </item>
+ <item> airy_zero_Ai_deriv </item>
+ <item> airy_zero_Bi </item>
+ <item> airy_zero_Bi_deriv </item>
+ <item> atanint </item>
+ <item> bchdeco </item>
+ <item> bchenco </item>
+ <item> bessel_il_scaled </item>
+ <item> bessel_In </item>
+ <item> bessel_In_scaled </item>
+ <item> bessel_Inu </item>
+ <item> bessel_Inu_scaled </item>
+ <item> bessel_jl </item>
+ <item> bessel_Jn </item>
+ <item> bessel_Jnu </item>
+ <item> bessel_kl_scaled </item>
+ <item> bessel_Kn </item>
+ <item> bessel_Kn_scaled </item>
+ <item> bessel_Knu </item>
+ <item> bessel_Knu_scaled </item>
+ <item> bessel_lnKnu </item>
+ <item> bessel_yl </item>
+ <item> bessel_Yn </item>
+ <item> bessel_Ynu </item>
+ <item> bessel_zero_J0 </item>
+ <item> bessel_zero_J1 </item>
+ <item> beta_gsl </item>
+ <item> bfgsmin </item>
+ <item> bisectionstep </item>
+ <item> builtin </item>
+ <item> bwfill </item>
+ <item> bwlabel </item>
+ <item> cell2csv </item>
+ <item> celleval </item>
+ <item> Chi </item>
+ <item> chol </item>
+ <item> Ci </item>
+ <item> clausen </item>
+ <item> conicalP_0 </item>
+ <item> conicalP_1 </item>
+ <item> conicalP_half </item>
+ <item> conicalP_mhalf </item>
+ <item> conv2 </item>
+ <item> cordflt2 </item>
+ <item> coupling_3j </item>
+ <item> coupling_6j </item>
+ <item> coupling_9j </item>
+ <item> csv2cell </item>
+ <item> csvconcat </item>
+ <item> csvexplode </item>
+ <item> cyclgen </item>
+ <item> cyclpoly </item>
+ <item> dawson </item>
+ <item> debye_1 </item>
+ <item> debye_2 </item>
+ <item> debye_3 </item>
+ <item> debye_4 </item>
+ <item> deref </item>
+ <item> dispatch </item>
+ <item> dispatch_help </item>
+ <item> display_fixed_operations </item>
+ <item> dlmread </item>
+ <item> ellint_Ecomp </item>
+ <item> ellint_Kcomp </item>
+ <item> ellipj </item>
+ <item> erfc_gsl </item>
+ <item> erf_gsl </item>
+ <item> erf_Q </item>
+ <item> erf_Z </item>
+ <item> _errcore </item>
+ <item> eta </item>
+ <item> eta_int </item>
+ <item> expint_3 </item>
+ <item> expint_E1 </item>
+ <item> expint_E2 </item>
+ <item> expint_Ei </item>
+ <item> expm1 </item>
+ <item> exp_mult </item>
+ <item> exprel </item>
+ <item> exprel_2 </item>
+ <item> exprel_n </item>
+ <item> fabs </item>
+ <item> fangle </item>
+ <item> farg </item>
+ <item> fatan2 </item>
+ <item> fceil </item>
+ <item> fconj </item>
+ <item> fcos </item>
+ <item> fcosh </item>
+ <item> fcumprod </item>
+ <item> fcumsum </item>
+ <item> fdiag </item>
+ <item> fermi_dirac_3half </item>
+ <item> fermi_dirac_half </item>
+ <item> fermi_dirac_inc_0 </item>
+ <item> fermi_dirac_int </item>
+ <item> fermi_dirac_mhalf </item>
+ <item> fexp </item>
+ <item> ffloor </item>
+ <item> fimag </item>
+ <item> finitedifference </item>
+ <item> fixed </item>
+ <item> flog </item>
+ <item> flog10 </item>
+ <item> fprod </item>
+ <item> freal </item>
+ <item> freshape </item>
+ <item> fround </item>
+ <item> fsin </item>
+ <item> fsinh </item>
+ <item> fsqrt </item>
+ <item> fsum </item>
+ <item> fsumsq </item>
+ <item> ftan </item>
+ <item> ftanh </item>
+ <item> full </item>
+ <item> gamma_gsl </item>
+ <item> gamma_inc </item>
+ <item> gamma_inc_P </item>
+ <item> gamma_inc_Q </item>
+ <item> gammainv_gsl </item>
+ <item> gammastar </item>
+ <item> gdet </item>
+ <item> gdiag </item>
+ <item> gexp </item>
+ <item> gf </item>
+ <item> gfilter </item>
+ <item> _gfweight </item>
+ <item> ginv </item>
+ <item> ginverse </item>
+ <item> glog </item>
+ <item> glu </item>
+ <item> gpick </item>
+ <item> gprod </item>
+ <item> grab </item>
+ <item> grank </item>
+ <item> graycomatrix </item>
+ <item> __grcla__ </item>
+ <item> __grclf__ </item>
+ <item> __grcmd__ </item>
+ <item> greshape </item>
+ <item> __grexit__ </item>
+ <item> __grfigure__ </item>
+ <item> __grgetstat__ </item>
+ <item> __grhold__ </item>
+ <item> __grinit__ </item>
+ <item> __grishold__ </item>
+ <item> __grnewset__ </item>
+ <item> __grsetgraph__ </item>
+ <item> gsl_sf </item>
+ <item> gsqrt </item>
+ <item> gsum </item>
+ <item> gsumsq </item>
+ <item> gtext </item>
+ <item> gzoom </item>
+ <item> hazard </item>
+ <item> houghtf </item>
+ <item> hyperg_0F1 </item>
+ <item> hzeta </item>
+ <item> is_complex_sparse </item>
+ <item> isfixed </item>
+ <item> isgalois </item>
+ <item> isprimitive </item>
+ <item> is_real_sparse </item>
+ <item> is_sparse </item>
+ <item> jpgread </item>
+ <item> jpgwrite </item>
+ <item> lambert_W0 </item>
+ <item> lambert_Wm1 </item>
+ <item> legendre_Pl </item>
+ <item> legendre_Plm </item>
+ <item> legendre_Ql </item>
+ <item> legendre_sphPlm </item>
+ <item> legendre_sphPlm_array </item>
+ <item> leval </item>
+ <item> listen </item>
+ <item> lnbeta </item>
+ <item> lncosh </item>
+ <item> lngamma_gsl </item>
+ <item> lnpoch </item>
+ <item> lnsinh </item>
+ <item> log_1plusx </item>
+ <item> log_1plusx_mx </item>
+ <item> log_erfc </item>
+ <item> lp </item>
+ <item> make_sparse </item>
+ <item> mark_for_deletion </item>
+ <item> medfilt1 </item>
+ <item> newtonstep </item>
+ <item> nnz </item>
+ <item> numgradient </item>
+ <item> numhessian </item>
+ <item> pchip_deriv </item>
+ <item> pngread </item>
+ <item> pngwrite </item>
+ <item> poch </item>
+ <item> pochrel </item>
+ <item> pretty </item>
+ <item> primpoly </item>
+ <item> psi </item>
+ <item> psi_1_int </item>
+ <item> psi_1piy </item>
+ <item> psi_n </item>
+ <item> rand </item>
+ <item> rande </item>
+ <item> randn </item>
+ <item> randp </item>
+ <item> regexp </item>
+ <item> remez </item>
+ <item> reset_fixed_operations </item>
+ <item> rotate_scale </item>
+ <item> rsdec </item>
+ <item> rsenc </item>
+ <item> samin </item>
+ <item> SBBacksub </item>
+ <item> SBEig </item>
+ <item> SBFactor </item>
+ <item> SBProd </item>
+ <item> SBSolve </item>
+ <item> Shi </item>
+ <item> Si </item>
+ <item> sinc_gsl </item>
+ <item> spabs </item>
+ <item> sparse </item>
+ <item> spfind </item>
+ <item> spimag </item>
+ <item> spinv </item>
+ <item> splu </item>
+ <item> spreal </item>
+ <item> SymBand </item>
+ <item> synchrotron_1 </item>
+ <item> synchrotron_2 </item>
+ <item> syndtable </item>
+ <item> taylorcoeff </item>
+ <item> transport_2 </item>
+ <item> transport_3 </item>
+ <item> transport_4 </item>
+ <item> transport_5 </item>
+ <item> trisolve </item>
+ <item> waitbar </item>
+ <item> xmlread </item>
+ <item> zeta </item>
+ <item> zeta_int </item>
+ <item> aar </item>
+ <item> aarmam </item>
+ <item> ac2poly </item>
+ <item> ac2rc </item>
+ <item> acorf </item>
+ <item> acovf </item>
+ <item> addpath </item>
+ <item> ademodce </item>
+ <item> adim </item>
+ <item> adsmax </item>
+ <item> amodce </item>
+ <item> anderson_darling_cdf </item>
+ <item> anderson_darling_test </item>
+ <item> anovan </item>
+ <item> apkconst </item>
+ <item> append_save </item>
+ <item> applylut </item>
+ <item> ar2poly </item>
+ <item> ar2rc </item>
+ <item> arburg </item>
+ <item> arcext </item>
+ <item> arfit2 </item>
+ <item> ar_spa </item>
+ <item> aryule </item>
+ <item> assert </item>
+ <item> au </item>
+ <item> aucapture </item>
+ <item> auload </item>
+ <item> auplot </item>
+ <item> aurecord </item>
+ <item> ausave </item>
+ <item> autumn </item>
+ <item> average_moments </item>
+ <item> awgn </item>
+ <item> azimuth </item>
+ <item> BandToFull </item>
+ <item> BandToSparse </item>
+ <item> base64encode </item>
+ <item> battery </item>
+ <item> bchpoly </item>
+ <item> bestblk </item>
+ <item> best_dir </item>
+ <item> best_dir_cov </item>
+ <item> betaln </item>
+ <item> bfgs </item>
+ <item> bfgsmin_example </item>
+ <item> bi2de </item>
+ <item> biacovf </item>
+ <item> bilinear </item>
+ <item> bisdemo </item>
+ <item> bispec </item>
+ <item> biterr </item>
+ <item> blkdiag </item>
+ <item> blkproc </item>
+ <item> bmpwrite </item>
+ <item> bone </item>
+ <item> bound_convex </item>
+ <item> boxcar </item>
+ <item> boxplot </item>
+ <item> brighten </item>
+ <item> bs_gradient </item>
+ <item> butter </item>
+ <item> buttord </item>
+ <item> bwborder </item>
+ <item> bweuler </item>
+ <item> bwlabel </item>
+ <item> bwmorph </item>
+ <item> bwselect </item>
+ <item> calendar </item>
+ <item> cceps </item>
+ <item> cdiff </item>
+ <item> cellstr </item>
+ <item> char </item>
+ <item> cheb </item>
+ <item> cheb1ord </item>
+ <item> cheb2ord </item>
+ <item> chebwin </item>
+ <item> cheby1 </item>
+ <item> cheby2 </item>
+ <item> chirp </item>
+ <item> clf </item>
+ <item> clip </item>
+ <item> cmpermute </item>
+ <item> cmunique </item>
+ <item> cohere </item>
+ <item> col2im </item>
+ <item> colfilt </item>
+ <item> colorgradient </item>
+ <item> comms </item>
+ <item> compand </item>
+ <item> complex </item>
+ <item> concat </item>
+ <item> conndef </item>
+ <item> content </item>
+ <item> contents </item>
+ <item> Contents </item>
+ <item> contourf </item>
+ <item> convhull </item>
+ <item> convmtx </item>
+ <item> cool </item>
+ <item> copper </item>
+ <item> corr2 </item>
+ <item> cosets </item>
+ <item> count </item>
+ <item> covm </item>
+ <item> cplxpair </item>
+ <item> cquadnd </item>
+ <item> create_lookup_table </item>
+ <item> crule </item>
+ <item> crule2d </item>
+ <item> crule2dgen </item>
+ <item> csape </item>
+ <item> csapi </item>
+ <item> csd </item>
+ <item> csvread </item>
+ <item> csvwrite </item>
+ <item> ctranspose </item>
+ <item> cumtrapz </item>
+ <item> czt </item>
+ <item> d2_min </item>
+ <item> datenum </item>
+ <item> datestr </item>
+ <item> datevec </item>
+ <item> dct </item>
+ <item> dct2 </item>
+ <item> dctmtx </item>
+ <item> de2bi </item>
+ <item> deal </item>
+ <item> decimate </item>
+ <item> decode </item>
+ <item> deg2rad </item>
+ <item> del2 </item>
+ <item> delaunay </item>
+ <item> delaunay3 </item>
+ <item> delta_method </item>
+ <item> demo </item>
+ <item> demodmap </item>
+ <item> deriv </item>
+ <item> detrend </item>
+ <item> dfdp </item>
+ <item> dftmtx </item>
+ <item> dhbar </item>
+ <item> dilate </item>
+ <item> dispatch </item>
+ <item> distance </item>
+ <item> dlmread </item>
+ <item> dlmwrite </item>
+ <item> dos </item>
+ <item> double </item>
+ <item> drawnow </item>
+ <item> durlev </item>
+ <item> dxfwrite </item>
+ <item> edge </item>
+ <item> edit </item>
+ <item> ellip </item>
+ <item> ellipdemo </item>
+ <item> ellipj </item>
+ <item> ellipke </item>
+ <item> ellipord </item>
+ <item> __ellip_ws </item>
+ <item> __ellip_ws_min </item>
+ <item> encode </item>
+ <item> eomday </item>
+ <item> erode </item>
+ <item> example </item>
+ <item> ExampleEigenValues </item>
+ <item> ExampleGenEigenValues </item>
+ <item> expdemo </item>
+ <item> expfit </item>
+ <item> eyediagram </item>
+ <item> factor </item>
+ <item> factorial </item>
+ <item> fail </item>
+ <item> fcnchk </item>
+ <item> feedback </item>
+ <item> fem_test </item>
+ <item> ff2n </item>
+ <item> fftconv2 </item>
+ <item> fieldnames </item>
+ <item> fill </item>
+ <item> fill3 </item>
+ <item> filter2 </item>
+ <item> filtfilt </item>
+ <item> filtic </item>
+ <item> findsym </item>
+ <item> fir1 </item>
+ <item> fir2 </item>
+ <item> fixedpoint </item>
+ <item> flag </item>
+ <item> flag_implicit_samplerate </item>
+ <item> flattopwin </item>
+ <item> flix </item>
+ <item> float </item>
+ <item> fmin </item>
+ <item> fminbnd </item>
+ <item> fmins </item>
+ <item> fminunc </item>
+ <item> fnder </item>
+ <item> fnplt </item>
+ <item> fnval </item>
+ <item> fplot </item>
+ <item> freqs </item>
+ <item> freqs_plot </item>
+ <item> fsort </item>
+ <item> fullfact </item>
+ <item> FullToBand </item>
+ <item> funm </item>
+ <item> fzero </item>
+ <item> gammaln </item>
+ <item> gapTest </item>
+ <item> gaussian </item>
+ <item> gausswin </item>
+ <item> gconv </item>
+ <item> gconvmtx </item>
+ <item> gdeconv </item>
+ <item> gdftmtx </item>
+ <item> gen2par </item>
+ <item> geomean </item>
+ <item> getfield </item>
+ <item> getfields </item>
+ <item> gfft </item>
+ <item> gftable </item>
+ <item> gfweight </item>
+ <item> gget </item>
+ <item> gifft </item>
+ <item> ginput </item>
+ <item> gmm_estimate </item>
+ <item> gmm_example </item>
+ <item> gmm_obj </item>
+ <item> gmm_results </item>
+ <item> gmm_variance </item>
+ <item> gmm_variance_inefficient </item>
+ <item> gquad </item>
+ <item> gquad2d </item>
+ <item> gquad2d6 </item>
+ <item> gquad2dgen </item>
+ <item> gquad6 </item>
+ <item> gquadnd </item>
+ <item> grace_octave_path </item>
+ <item> gradient </item>
+ <item> grayslice </item>
+ <item> grep </item>
+ <item> grid </item>
+ <item> griddata </item>
+ <item> groots </item>
+ <item> grpdelay </item>
+ <item> grule </item>
+ <item> grule2d </item>
+ <item> grule2dgen </item>
+ <item> hadamard </item>
+ <item> hammgen </item>
+ <item> hankel </item>
+ <item> hann </item>
+ <item> harmmean </item>
+ <item> hilbert </item>
+ <item> histeq </item>
+ <item> histfit </item>
+ <item> histo </item>
+ <item> histo2 </item>
+ <item> histo3 </item>
+ <item> histo4 </item>
+ <item> hot </item>
+ <item> hsv </item>
+ <item> hup </item>
+ <item> idct </item>
+ <item> idct2 </item>
+ <item> idplot </item>
+ <item> idsim </item>
+ <item> ifftshift </item>
+ <item> im2bw </item>
+ <item> im2col </item>
+ <item> imadjust </item>
+ <item> imginfo </item>
+ <item> imhist </item>
+ <item> imnoise </item>
+ <item> impad </item>
+ <item> impz </item>
+ <item> imread </item>
+ <item> imrotate </item>
+ <item> imshear </item>
+ <item> imtranslate </item>
+ <item> imwrite </item>
+ <item> innerfun </item>
+ <item> inputname </item>
+ <item> interp </item>
+ <item> interp1 </item>
+ <item> interp2 </item>
+ <item> interpft </item>
+ <item> intersect </item>
+ <item> invest0 </item>
+ <item> invest1 </item>
+ <item> invfdemo </item>
+ <item> invfreq </item>
+ <item> invfreqs </item>
+ <item> invfreqz </item>
+ <item> inz </item>
+ <item> irsa_act </item>
+ <item> irsa_actcore </item>
+ <item> irsa_check </item>
+ <item> irsa_dft </item>
+ <item> irsa_dftfp </item>
+ <item> irsa_genreal </item>
+ <item> irsa_idft </item>
+ <item> irsa_isregular </item>
+ <item> irsa_jitsp </item>
+ <item> irsa_mdsp </item>
+ <item> irsa_normalize </item>
+ <item> irsa_plotdft </item>
+ <item> irsa_resample </item>
+ <item> irsa_rgenreal </item>
+ <item> isa </item>
+ <item> isbw </item>
+ <item> isdir </item>
+ <item> isequal </item>
+ <item> isfield </item>
+ <item> isgray </item>
+ <item> isind </item>
+ <item> ismember </item>
+ <item> isprime </item>
+ <item> isrgb </item>
+ <item> issparse </item>
+ <item> isunix </item>
+ <item> jet </item>
+ <item> kaiser </item>
+ <item> kaiserord </item>
+ <item> lambertw </item>
+ <item> lattice </item>
+ <item> lauchli </item>
+ <item> leasqr </item>
+ <item> leasqrdemo </item>
+ <item> legend </item>
+ <item> legendre </item>
+ <item> levinson </item>
+ <item> lin2mu </item>
+ <item> line_min </item>
+ <item> lloyds </item>
+ <item> lookup </item>
+ <item> lookup_table </item>
+ <item> lpc </item>
+ <item> lp_test </item>
+ <item> mad </item>
+ <item> magic </item>
+ <item> makelut </item>
+ <item> MakeShears </item>
+ <item> map </item>
+ <item> mat2gray </item>
+ <item> mat2str </item>
+ <item> mdsmax </item>
+ <item> mean2 </item>
+ <item> medfilt2 </item>
+ <item> meshc </item>
+ <item> minimize </item>
+ <item> minpol </item>
+ <item> mkpp </item>
+ <item> mktheta </item>
+ <item> mle_estimate </item>
+ <item> mle_example </item>
+ <item> mle_obj </item>
+ <item> mle_results </item>
+ <item> mle_variance </item>
+ <item> modmap </item>
+ <item> mu2lin </item>
+ <item> mvaar </item>
+ <item> mvar </item>
+ <item> mvfilter </item>
+ <item> mvfreqz </item>
+ <item> myfeval </item>
+ <item> nanmax </item>
+ <item> nanmean </item>
+ <item> nanmedian </item>
+ <item> nanmin </item>
+ <item> nanstd </item>
+ <item> nansum </item>
+ <item> ncauer </item>
+ <item> nchoosek </item>
+ <item> ncrule </item>
+ <item> ndims </item>
+ <item> nelder_mead_min </item>
+ <item> newmark </item>
+ <item> nlfilter </item>
+ <item> nlnewmark </item>
+ <item> __nlnewmark_fcn__ </item>
+ <item> nmsmax </item>
+ <item> nonzeros </item>
+ <item> normplot </item>
+ <item> now </item>
+ <item> nrm </item>
+ <item> nthroot </item>
+ <item> nze </item>
+ <item> OCTAVE_FORGE_VERSION </item>
+ <item> ode23 </item>
+ <item> ode45 </item>
+ <item> ode78 </item>
+ <item> optimset </item>
+ <item> ordfilt2 </item>
+ <item> orient </item>
+ <item> pacf </item>
+ <item> padarray </item>
+ <item> parameterize </item>
+ <item> parcor </item>
+ <item> pareto </item>
+ <item> pascal </item>
+ <item> patch </item>
+ <item> pburg </item>
+ <item> pcg </item>
+ <item> pchip </item>
+ <item> pcolor </item>
+ <item> pcr </item>
+ <item> peaks </item>
+ <item> penddot </item>
+ <item> pendulum </item>
+ <item> perms </item>
+ <item> pie </item>
+ <item> pink </item>
+ <item> plot3 </item>
+ <item> __plt3__ </item>
+ <item> poly2ac </item>
+ <item> poly2ar </item>
+ <item> poly_2_ex </item>
+ <item> poly2mask </item>
+ <item> poly2rc </item>
+ <item> poly2sym </item>
+ <item> poly2th </item>
+ <item> polyarea </item>
+ <item> polyconf </item>
+ <item> polyder </item>
+ <item> polyderiv </item>
+ <item> polygcd </item>
+ <item> polystab </item>
+ <item> __power </item>
+ <item> ppval </item>
+ <item> prctile </item>
+ <item> prettyprint </item>
+ <item> prettyprint_c </item>
+ <item> primes </item>
+ <item> princomp </item>
+ <item> print </item>
+ <item> prism </item>
+ <item> proplan </item>
+ <item> pulstran </item>
+ <item> pwelch </item>
+ <item> pyulear </item>
+ <item> qaskdeco </item>
+ <item> qaskenco </item>
+ <item> qtdecomp </item>
+ <item> qtgetblk </item>
+ <item> qtsetblk </item>
+ <item> quad2dc </item>
+ <item> quad2dcgen </item>
+ <item> quad2dg </item>
+ <item> quad2dggen </item>
+ <item> quadc </item>
+ <item> quadg </item>
+ <item> quadl </item>
+ <item> quadndg </item>
+ <item> quantiz </item>
+ <item> quiver </item>
+ <item> rad2deg </item>
+ <item> rainbow </item>
+ <item> randerr </item>
+ <item> randint </item>
+ <item> randsrc </item>
+ <item> rat </item>
+ <item> rats </item>
+ <item> rc2ac </item>
+ <item> rc2ar </item>
+ <item> rc2poly </item>
+ <item> rceps </item>
+ <item> read_options </item>
+ <item> read_pdb </item>
+ <item> rectpuls </item>
+ <item> resample </item>
+ <item> rgb2gray </item>
+ <item> rk2fixed </item>
+ <item> rk4fixed </item>
+ <item> rk8fixed </item>
+ <item> rmfield </item>
+ <item> rmle </item>
+ <item> rmpath </item>
+ <item> roicolor </item>
+ <item> rosser </item>
+ <item> rotparams </item>
+ <item> rotv </item>
+ <item> rref </item>
+ <item> rsdecof </item>
+ <item> rsencof </item>
+ <item> rsgenpoly </item>
+ <item> samin_example </item>
+ <item> save_vrml </item>
+ <item> sbispec </item>
+ <item> scale_data </item>
+ <item> scatter </item>
+ <item> scatterplot </item>
+ <item> select_3D_points </item>
+ <item> selmo </item>
+ <item> setdiff </item>
+ <item> setfield </item>
+ <item> setfields </item>
+ <item> setxor </item>
+ <item> sftrans </item>
+ <item> sgolay </item>
+ <item> sgolayfilt </item>
+ <item> sinvest1 </item>
+ <item> slurp_file </item>
+ <item> sortrows </item>
+ <item> sound </item>
+ <item> soundsc </item>
+ <item> spdiags </item>
+ <item> specgram </item>
+ <item> speed </item>
+ <item> speye </item>
+ <item> spfun </item>
+ <item> sphcat </item>
+ <item> spline </item>
+ <item> splot </item>
+ <item> spones </item>
+ <item> sprand </item>
+ <item> sprandn </item>
+ <item> spring </item>
+ <item> spstats </item>
+ <item> spsum </item>
+ <item> sp_test </item>
+ <item> sptest </item>
+ <item> spvcat </item>
+ <item> spy </item>
+ <item> std2 </item>
+ <item> stem </item>
+ <item> str2double </item>
+ <item> strcmpi </item>
+ <item> stretchlim </item>
+ <item> strfind </item>
+ <item> strmatch </item>
+ <item> strncmp </item>
+ <item> strncmpi </item>
+ <item> strsort </item>
+ <item> strtok </item>
+ <item> strtoz </item>
+ <item> struct </item>
+ <item> strvcat </item>
+ <item> summer </item>
+ <item> sumskipnan </item>
+ <item> surf </item>
+ <item> surfc </item>
+ <item> sym2poly </item>
+ <item> symerr </item>
+ <item> symfsolve </item>
+ <item> tabulate </item>
+ <item> tar </item>
+ <item> temp_name </item>
+ <item> test </item>
+ <item> test_d2_min_1 </item>
+ <item> test_d2_min_2 </item>
+ <item> test_d2_min_3 </item>
+ <item> test_ellipj </item>
+ <item> test_fminunc_1 </item>
+ <item> testimio </item>
+ <item> test_inline_1 </item>
+ <item> test_min_1 </item>
+ <item> test_min_2 </item>
+ <item> test_min_3 </item>
+ <item> test_min_4 </item>
+ <item> test_minimize_1 </item>
+ <item> test_nelder_mead_min_1 </item>
+ <item> test_nelder_mead_min_2 </item>
+ <item> test_sncndn </item>
+ <item> test_struct </item>
+ <item> test_vmesh </item>
+ <item> test_vrml_faces </item>
+ <item> test_wpolyfit </item>
+ <item> text </item>
+ <item> textread </item>
+ <item> tf2zp </item>
+ <item> tfe </item>
+ <item> thfm </item>
+ <item> tics </item>
+ <item> toeplitz </item>
+ <item> toggle_grace_use </item>
+ <item> transpose </item>
+ <item> trapz </item>
+ <item> triang </item>
+ <item> tril </item>
+ <item> trimmean </item>
+ <item> tripuls </item>
+ <item> trisolve </item>
+ <item> triu </item>
+ <item> tsademo </item>
+ <item> tsearchdemo </item>
+ <item> ucp </item>
+ <item> uintlut </item>
+ <item> unique </item>
+ <item> unix </item>
+ <item> unmkpp </item>
+ <item> unscale_parameters </item>
+ <item> vec2mat </item>
+ <item> view </item>
+ <item> vmesh </item>
+ <item> voronoi </item>
+ <item> voronoin </item>
+ <item> vrml_arrow </item>
+ <item> vrml_Background </item>
+ <item> vrml_browse </item>
+ <item> vrml_cyl </item>
+ <item> vrml_demo_tutorial_1 </item>
+ <item> vrml_demo_tutorial_2 </item>
+ <item> vrml_demo_tutorial_3 </item>
+ <item> vrml_demo_tutorial_4 </item>
+ <item> vrml_ellipsoid </item>
+ <item> vrml_faces </item>
+ <item> vrml_flatten </item>
+ <item> vrml_frame </item>
+ <item> vrml_group </item>
+ <item> vrml_kill </item>
+ <item> vrml_lines </item>
+ <item> vrml_material </item>
+ <item> vrml_parallelogram </item>
+ <item> vrml_PointLight </item>
+ <item> vrml_points </item>
+ <item> vrml_select_points </item>
+ <item> vrml_surf </item>
+ <item> vrml_text </item>
+ <item> vrml_thick_surf </item>
+ <item> vrml_transfo </item>
+ <item> wavread </item>
+ <item> wavwrite </item>
+ <item> weekday </item>
+ <item> wgn </item>
+ <item> white </item>
+ <item> wilkinson </item>
+ <item> winter </item>
+ <item> wpolyfit </item>
+ <item> wpolyfitdemo </item>
+ <item> write_pdb </item>
+ <item> wsolve </item>
+ <item> xcorr </item>
+ <item> xcorr2 </item>
+ <item> xcov </item>
+ <item> xlsread </item>
+ <item> xmlwrite </item>
+ <item> y2res </item>
+ <item> zero_count </item>
+ <item> zoom </item>
+ <item> zp2tf </item>
+ <item> zplane </item>
+ <item> zscore </item>
+ </list>
+
+ <contexts>
+
+ <context name="_normal" attribute="Normal Text" lineEndContext="#stay">
+
+ <!-- Code folding -->
+ <!--TODO: with this implementation, code folding will close a block also with a wrong
+ end*: for istance, for can be closed by endif. This is done because the catchall end
+ keyword is widely used to close a number of blocks (including if and for).
+ If you have an improvement, please contribute it!-->
+ <RegExpr context="#stay" attribute="Keyword" String="\b(for)\b" beginRegion="block" />
+ <RegExpr context="#stay" attribute="Keyword" String="\b(endfor)\b" endRegion="block" />
+ <RegExpr context="#stay" attribute="Keyword" String="\b(if)\b" beginRegion="block" />
+ <RegExpr context="#stay" attribute="Keyword" String="\b(endif)\b" endRegion="block" />
+ <RegExpr context="#stay" attribute="Keyword" String="\b(do)\b" beginRegion="block" />
+ <RegExpr context="#stay" attribute="Keyword" String="\b(until)\b" endRegion="block" />
+ <RegExpr context="#stay" attribute="Keyword" String="\b(while)\b" beginRegion="block" />
+ <RegExpr context="#stay" attribute="Keyword" String="\b(endwhile)\b" endRegion="block" />
+ <RegExpr context="#stay" attribute="Keyword" String="\b(function)\b" beginRegion="block" />
+ <RegExpr context="#stay" attribute="Keyword" String="\b(endfunction)\b" endRegion="block" />
+ <RegExpr context="#stay" attribute="Keyword" String="\b(switch)\b" beginRegion="Switch" />
+ <RegExpr context="#stay" attribute="Keyword" String="\b(endswitch)\b" endRegion="Switch" />
+ <RegExpr context="#stay" attribute="Keyword" String="\b(try)\b" beginRegion="Try" />
+ <RegExpr context="#stay" attribute="Keyword" String="\b(end_try_catch)\b" endRegion="Try" />
+ <!-- Catchall end keyword -->
+ <RegExpr context="#stay" attribute="Keyword" String="\b(end)\b" endRegion="block" />
+
+ <!-- Look-ahead for adjoint ' after variable, number literal, closing braces and .' -->
+ <RegExpr context="_adjoint" attribute="Variable" String="[a-zA-Z]\w*(?=')" />
+ <RegExpr context="_adjoint" attribute="Number" String="(\d+(\.\d+)?|\.\d+)([eE][+-]?\d+)?[ij]?(?=')" />
+ <RegExpr context="_adjoint" attribute="Delimiter" String="[\)\]}](?=')" />
+ <RegExpr context="_adjoint" attribute="Operator" String="\.'(?=')" />
+
+ <!-- If ' is not the adjoint operator, it starts a string or an unterminated string;
+ strings can be also with ", and accept the respective delimiter in them either
+ by doubling it ('', "") or by escaping it (\', \") -->
+ <RegExpr context="#stay" attribute="String" String="'([^'\\]|''|\\'|\\[^'])*'(?=[^']|$)" />
+ <RegExpr context="#stay" attribute="Incomplete String" String="'([^']|''|\\')*" />
+ <RegExpr context="#stay" attribute="String" String="&quot;([^&quot;\\]|&quot;&quot;|\\&quot;|\\[^&quot;])*&quot;(?=[^&quot;]|$)" />
+ <RegExpr context="#stay" attribute="Incomplete String" String="&quot;([^&quot;]|&quot;&quot;|\\&quot;)*" />
+
+ <!-- Handling of keywords, comments, functions, identifiers, numbers and braces -->
+ <keyword context="#stay" attribute="Keyword" String="keywords" />
+ <keyword context="#stay" attribute="Commands" String="commands" />
+ <keyword context="#stay" attribute="Functions" String="functions" />
+ <keyword context="#stay" attribute="Builtin" String="builtin"/>
+ <keyword context="#stay" attribute="Forge" String="forge" />
+ <RegExpr context="#stay" attribute="Comment" String="[%#].*$" />
+ <RegExpr context="#stay" attribute="Variable" String="[a-zA-Z]\w*" />
+ <RegExpr context="#stay" attribute="Number" String="(\d+(\.\d+)?|\.\d+)([eE][+-]?\d+)?[ij]?" />
+ <AnyChar context="#stay" attribute="Delimiter" String="()[]{}"/>
+
+ <!-- Three- and two-character operators -->
+ <StringDetect context="#stay" attribute="Operator" String="..."/>
+ <StringDetect context="#stay" attribute="Operator" String="=="/>
+ <StringDetect context="#stay" attribute="Operator" String="~="/>
+ <StringDetect context="#stay" attribute="Operator" String="!="/>
+ <StringDetect context="#stay" attribute="Operator" String="&lt;="/>
+ <StringDetect context="#stay" attribute="Operator" String="&gt;="/>
+ <StringDetect context="#stay" attribute="Operator" String="&lt;&gt;"/>
+ <StringDetect context="#stay" attribute="Operator" String="&amp;&amp;"/>
+ <StringDetect context="#stay" attribute="Operator" String="||"/>
+ <StringDetect context="#stay" attribute="Operator" String="++"/>
+ <StringDetect context="#stay" attribute="Operator" String="--"/>
+ <StringDetect context="#stay" attribute="Operator" String="**"/>
+ <StringDetect context="#stay" attribute="Operator" String=".*"/>
+ <StringDetect context="#stay" attribute="Operator" String=".**"/>
+ <StringDetect context="#stay" attribute="Operator" String=".^"/>
+ <StringDetect context="#stay" attribute="Operator" String="./"/>
+ <StringDetect context="#stay" attribute="Operator" String=".'"/>
+
+ <!-- Single-character operators -->
+ <AnyChar context="#stay" attribute="Operator" String="!&quot;%(*+,/;=>[]|~#&amp;)-:&lt;&gt;\^"/>
+
+ </context>
+
+
+ <!--Context entered after encountering an ' adjoint operator -->
+ <context name="_adjoint" attribute="Operator" lineEndContext="#pop">
+ <RegExpr context="#pop" attribute="Operator" String="'+" />
+ </context>
+
+
+ </contexts>
+
+ <itemDatas>
+ <itemData name="Normal Text" defStyleNum="dsNormal" />
+ <itemData name="Variable" defStyleNum="dsNormal" />
+ <itemData name="Operator" defStyleNum="dsNormal"/>
+ <itemData name="Number" defStyleNum="dsFloat" />
+ <itemData name="Delimiter" defStyleNum="dsNormal" />
+ <itemData name="String" defStyleNum="dsString" color="#b20000"/>
+ <itemData name="String Char" defStyleNum="dsChar"/>
+ <itemData name="Incomplete String" defStyleNum="dsChar" color="#a020f0"/>
+ <itemData name="Keyword" defStyleNum="dsNormal" color="#0000ff"/>
+ <itemData name="Comment" defStyleNum="dsComment" color="#009900"/>
+ <itemData name="Functions" defStyleNum="dsFunction" color="#0000ff" selColor="#00ff00" bold="1" italic="1" />
+ <itemData name="Forge" defStyleNum="dsFunction" color="#000099" selColor="#009900" bold="1" italic="1" />
+ <itemData name="Builtin" defStyleNum="dsBaseN" color="#b28c00" />
+ <itemData name="Commands" defStyleNum="dsFunction" color="#b28c00" />
+ </itemDatas>
+
+ </highlighting>
+
+ <general>
+ <comments>
+ <comment name="singleLine" start="%" />
+ <comment name="singleLine" start="#" />
+ </comments>
+ <keywords casesensitive="1"/>
+ </general>
+
+</language>
+<!-- kate: space-indent on; indent-width 2; replace-tabs on; -->
diff --git a/kate/data/pascal.xml b/kate/data/pascal.xml
new file mode 100644
index 000000000..6830c755e
--- /dev/null
+++ b/kate/data/pascal.xml
@@ -0,0 +1,193 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+<language name="Pascal" version="1.21" kateversion="2.3" section="Sources" extensions="*.pp;*.pas;*.p" mimetype="text/x-pascal">
+ <highlighting>
+ <list name="keywords">
+ <item> and </item>
+ <item> array </item>
+ <item> asm </item>
+ <item> case </item>
+ <item> const </item>
+ <item> div </item>
+ <item> do </item>
+ <item> downto </item>
+ <item> else </item>
+ <item> file </item>
+ <item> for </item>
+ <item> function </item>
+ <item> goto </item>
+ <item> if </item>
+ <item> in </item>
+ <item> label </item>
+ <item> mod </item>
+ <item> nil </item>
+ <item> not </item>
+ <item> of </item>
+ <item> operator </item>
+ <item> or </item>
+ <item> packed </item>
+ <item> procedure </item>
+ <item> program </item>
+ <item> record </item>
+ <item> repeat </item>
+ <item> set </item>
+ <item> then </item>
+ <item> to </item>
+ <item> type </item>
+ <item> unit </item>
+ <item> until </item>
+ <item> uses </item>
+ <item> var </item>
+ <item> while </item>
+ <item> with </item>
+ <item> xor </item>
+
+
+ <item> at </item>
+ <item> automated </item>
+ <item> break </item>
+ <item> continue </item>
+ <item> dispinterface </item>
+ <item> dispose </item>
+ <item> exit </item>
+ <item> false </item>
+ <item> finalization </item>
+ <item> initialization </item>
+ <item> library </item>
+ <item> new </item>
+ <item> published </item>
+ <item> resourcestring </item>
+ <item> self </item>
+ <item> true </item>
+ </list>
+ <list name="ISO/Delphi Extended">
+ <item> abstract </item>
+ <item> as </item>
+ <item> bindable </item>
+ <item> constructor </item>
+ <item> destructor </item>
+ <item> except </item>
+ <item> export </item>
+ <item> finally </item>
+ <item> import </item>
+ <item> implementation </item>
+ <item> inherited </item>
+ <item> inline </item>
+ <item> interface </item>
+ <item> is </item>
+ <item> module </item>
+ <item> on </item>
+ <item> only </item>
+ <item> otherwise </item>
+ <item> override </item>
+ <item> private </item>
+ <item> property </item>
+ <item> protected </item>
+ <item> public </item>
+ <item> read </item>
+ <item> qualified </item>
+ <item> raise </item>
+ <item> restricted </item>
+ <item> shl </item>
+ <item> shr </item>
+ <item> threadvar </item>
+ <item> try </item>
+ <item> virtual </item>
+ <item> write </item>
+ </list>
+ <list name="types">
+ <item> Integer </item>
+ <item> Cardinal </item>
+ <item> ShortInt </item>
+ <item> SmallInt </item>
+ <item> LongInt </item>
+ <item> Int64 </item>
+ <item> Byte </item>
+ <item> Word </item>
+ <item> LongWord </item>
+ <item> Char </item>
+ <item> AnsiChar </item>
+ <item> WideChar </item>
+ <item> Boolean </item>
+ <item> ByteBool </item>
+ <item> WordBool </item>
+ <item> LongBool </item>
+ <item> Single </item>
+ <item> Double </item>
+ <item> Extended </item>
+ <item> Comp </item>
+ <item> Currency </item>
+ <item> Real </item>
+ <item> Real48 </item>
+ <item> String </item>
+ <item> ShortString </item>
+ <item> AnsiString </item>
+ <item> WideString </item>
+ <item> Pointer </item>
+ <item> Variant</item>
+ <item> File </item>
+ <item> Text </item>
+ </list>
+ <list name="attention">
+ <item> FIXME </item>
+ <item> TODO </item>
+ <item> ### </item>
+ </list>
+ <contexts>
+ <context attribute="Normal Text" lineEndContext="#stay" name="Normal">
+ <RegExpr attribute="Keyword" context="#stay" String="\b(begin|case|record)(?=(\{[^}]*(\}|$)|\(\*.*(\*\)|$))*([\s]|$|//))" insensitive="true" beginRegion="Region1"/>
+ <RegExpr attribute="ISO/Delphi Extended" context="#stay" String="\b((object|class)(?=(\(.*\))?(\{[^}]*(\}|$)|\(\*.*(\*\)|$))*;?([\s]|$|//))|try(?=(\{[^}]*(\}|$)|\(\*.*(\*\)|$))*([\s]|$|//)))" insensitive="true" beginRegion="Region1"/>
+ <RegExpr attribute="Keyword" context="#stay" String="\bend(?=((\{[^}]*(\}|$)|\(\*.*(\*\)|$))*)([.;\s]|$)|//|$)" insensitive="true" endRegion="Region1"/>
+ <keyword attribute="Keyword" context="#stay" String="keywords"/>
+ <keyword attribute="ISO/Delphi Extended" context="#stay" String="ISO/Delphi Extended"/>
+ <keyword attribute="Type" context="#stay" String="types"/>
+ <Float attribute="Number" context="#stay"/>
+ <Int attribute="Number" context="#stay"/>
+ <DetectChar attribute="String" context="String" char="&apos;" />
+ <StringDetect attribute="Directive" context="Prep1" String="(*$"/>
+ <Detect2Chars attribute="Directive" context="Prep2" char="{" char1="$"/>
+ <DetectChar attribute="Comment" context="Comment1" char="{" beginRegion="Region2"/>
+ <Detect2Chars attribute="Comment" context="Comment2" char="(" char1="*" beginRegion="Region3"/>
+ <Detect2Chars attribute="Comment" context="Comment3" char="/" char1="/"/>
+ </context>
+ <context attribute="String" lineEndContext="#pop" name="String">
+ <DetectChar attribute="String" context="#pop" char="&apos;"/>
+ </context>
+ <context attribute="Directive" lineEndContext="#pop" name="Prep1">
+ <Detect2Chars attribute="Directive" context="#pop" char="*" char1=")"/>
+ </context>
+ <context attribute="Directive" lineEndContext="#pop" name="Prep2">
+ <DetectChar attribute="Directive" context="#pop" char="}"/>
+ </context>
+ <context attribute="Comment" lineEndContext="#stay" name="Comment1">
+ <keyword attribute="Alert" context="#stay" String="attention" />
+ <DetectChar attribute="Comment" context="#pop" char="}" endRegion="Region2"/>
+ </context>
+ <context attribute="Comment" lineEndContext="#stay" name="Comment2">
+ <keyword attribute="Alert" context="#stay" String="attention" />
+ <Detect2Chars attribute="Comment" context="#pop" char="*" char1=")" endRegion="Region3"/>
+ </context>
+ <context attribute="Comment" lineEndContext="#pop" name="Comment3">
+ <keyword attribute="Alert" context="#stay" String="attention" />
+ </context>
+ </contexts>
+ <itemDatas>
+ <itemData name="Normal Text" defStyleNum="dsNormal" />
+ <itemData name="Keyword" defStyleNum="dsKeyword" />
+ <itemData name="ISO/Delphi Extended" defStyleNum="dsKeyword" color="#000080" />
+ <itemData name="Type" defStyleNum="dsDataType"/>
+ <itemData name="Number" defStyleNum="dsDecVal" />
+ <itemData name="String" defStyleNum="dsString" />
+ <itemData name="Directive" defStyleNum="dsOthers" />
+ <itemData name="Comment" defStyleNum="dsComment" />
+ <itemData name="Alert" defStyleNum="dsAlert" />
+ </itemDatas>
+ </highlighting>
+ <general>
+ <keywords casesensitive="0" />
+ <comments>
+ <comment name="singleLine" start="//" />
+ <comment name="multiLine" start="{" end="}" />
+ </comments>
+ </general>
+</language>
diff --git a/kate/data/perl.xml b/kate/data/perl.xml
new file mode 100644
index 000000000..15212c376
--- /dev/null
+++ b/kate/data/perl.xml
@@ -0,0 +1,827 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+<!--
+ This file is part of the KDE project
+ Copyright (C) 2001, 2002, 2003, 2004 Anders Lund <anders@alweb.dk>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+
+ *** NOTICE ***
+ This file is maintained by Anders Lund <anders@alweb.dk>
+ Please do not commit changes without checking with me.
+
+ *** TODO ***
+
+ Work on the comment support in the REPLACEMENT part of s/// - we may support
+ the comment, if the line remainder does not contain the delimiter char.
+
+ Try to support ?PATTERN? (at least in one line, like if "\?(?=.*\?)" matches).
+
+ parse code behind '<<HEREDELIMITER' as code, or at least ignore it, to eol.
+ Requires the ability to pass the delimiter through a context level.
+
+ find a here delimiter like '*END*' (Shell.pm). Requires that when a regex is
+ inserting a dynamic string, it escapes [*(){}$[]
+
+ support for more regex extensions, such as (?>), (?{}), (?(cond)yes|no)
+
+ Enhance tr/// and y/// support.
+-->
+<language name="Perl" version="1.20" kateversion="2.4" section="Scripts" extensions="*.pl;*.pm" mimetype="application/x-perl;text/x-perl" author="Anders Lund (anders@alweb.dk)" license="LGPL">
+ <highlighting>
+ <list name="keywords">
+ <item> if </item>
+ <item> unless </item>
+ <item> else </item>
+ <item> elsif </item>
+ <item> while </item>
+ <item> until </item>
+ <item> for </item>
+ <item> each </item>
+ <item> foreach </item>
+ <item> next </item>
+ <item> last </item>
+ <item> break </item>
+ <item> continue </item>
+ <item> return </item>
+ <item> use </item>
+ <item> no </item>
+ <item> require </item>
+ <item> my </item>
+ <item> our </item>
+ <item> local </item>
+ <item> BEGIN </item>
+ <item> END </item>
+ <item>require</item>
+ <item> package </item>
+ <item> sub </item>
+ <item> do </item>
+ <item> __END__ </item>
+ <item> __DATA__ </item>
+ <item> __FILE__ </item>
+ <item> __LINE__ </item>
+ <item> __PACKAGE__ </item>
+ </list>
+ <list name="operators">
+ <item> = </item>
+ <item> != </item>
+ <item> ~= </item>
+ <item> += </item>
+ <item> -= </item>
+ <item> *= </item>
+ <item> /= </item>
+ <item> **= </item>
+ <item> |= </item>
+ <item> ||= </item>
+ <item> &amp;= </item>
+ <item> &amp;&amp;= </item>
+ <item> ?= </item>
+ <item> + </item>
+ <item> - </item>
+ <item> * </item>
+ <!-- <item> / </item>//-->
+ <item> % </item>
+ <item> || </item>
+ <item> &amp;&amp; </item>
+ <item> | </item>
+ <item> &amp; </item>
+ <item> &lt; </item>
+ <item> &lt;&lt; </item>
+ <item> &gt; </item>
+ <item> &gt;&gt; </item>
+ <item> ^ </item>
+ <item> -&gt; </item>
+ <item> =&gt; </item>
+ <item> . </item>
+ <item> , </item>
+ <item> ; </item>
+ <item> :: </item>
+ <item> \ </item>
+ <item> and </item>
+ <item> or </item>
+ <item> not </item>
+ <item> eq </item>
+ <item> ne </item>
+ </list>
+ <list name="functions">
+ <item>abs</item>
+ <item>accept</item>
+ <item>alarm</item>
+ <item>atan2</item>
+ <item>bind</item>
+ <item>binmode</item>
+ <item>bless</item>
+ <item>caller</item>
+ <item>chdir</item>
+ <item>chmod</item>
+ <item>chomp</item>
+ <item>chop</item>
+ <item>chown</item>
+ <item>chr</item>
+ <item>chroot</item>
+ <item>close</item>
+ <item>closedir</item>
+ <item>connect</item>
+ <item>cos</item>
+ <item>crypt</item>
+ <item>dbmclose</item>
+ <item>dbmopen</item>
+ <item>defined</item>
+ <item>delete</item>
+ <item>die</item>
+ <item>dump</item>
+ <item>endgrent</item>
+ <item>endhostent</item>
+ <item>endnetent</item>
+ <item>endprotoent</item>
+ <item>endpwent</item>
+ <item>endservent</item>
+ <item>eof</item>
+ <item>eval</item>
+ <item>exec</item>
+ <item>exists</item>
+ <item>exit</item>
+ <item>exp</item>
+ <item>fcntl</item>
+ <item>fileno</item>
+ <item>flock</item>
+ <item>fork</item>
+ <item>format</item>
+ <item>formline</item>
+ <item>getc</item>
+ <item>getgrent</item>
+ <item>getgrgid</item>
+ <item>getgrnam</item>
+ <item>gethostbyaddr</item>
+ <item>gethostbyname</item>
+ <item>gethostent</item>
+ <item>getlogin</item>
+ <item>getnetbyaddr</item>
+ <item>getnetbyname</item>
+ <item>getnetent</item>
+ <item>getpeername</item>
+ <item>getpgrp</item>
+ <item>getppid</item>
+ <item>getpriority</item>
+ <item>getprotobyname</item>
+ <item>getprotobynumber</item>
+ <item>getprotoent</item>
+ <item>getpwent</item>
+ <item>getpwnam</item>
+ <item>getpwuid</item>
+ <item>getservbyname</item>
+ <item>getservbyport</item>
+ <item>getservent</item>
+ <item>getsockname</item>
+ <item>getsockopt</item>
+ <item>glob</item>
+ <item>gmtime</item>
+ <item>goto</item>
+ <item>grep</item>
+ <item>hex</item>
+ <item>import</item>
+ <item>index</item>
+ <item>int</item>
+ <item>ioctl</item>
+ <item>join</item>
+ <item>keys</item>
+ <item>kill</item>
+ <item>last</item>
+ <item>lc</item>
+ <item>lcfirst</item>
+ <item>length</item>
+ <item>link</item>
+ <item>listen</item>
+ <item>localtime</item>
+ <item>lock</item>
+ <item>log</item>
+ <item>lstat</item>
+ <item>map</item>
+ <item>mkdir</item>
+ <item>msgctl</item>
+ <item>msgget</item>
+ <item>msgrcv</item>
+ <item>msgsnd</item>
+ <item>oct</item>
+ <item>open</item>
+ <item>opendir</item>
+ <item>ord</item>
+ <item>pack</item>
+ <item>package</item>
+ <item>pipe</item>
+ <item>pop</item>
+ <item>pos</item>
+ <item>print</item>
+ <item>printf</item>
+ <item>prototype</item>
+ <item>push</item>
+ <item>quotemeta</item>
+ <item>rand</item>
+ <item>read</item>
+ <item>readdir</item>
+ <item>readline</item>
+ <item>readlink</item>
+ <item>recv</item>
+ <item>redo</item>
+ <item>ref</item>
+ <item>rename</item>
+ <item>reset</item>
+ <item>return</item>
+ <item>reverse</item>
+ <item>rewinddir</item>
+ <item>rindex</item>
+ <item>rmdir</item>
+ <item>scalar</item>
+ <item>seek</item>
+ <item>seekdir</item>
+ <item>select</item>
+ <item>semctl</item>
+ <item>semget</item>
+ <item>semop</item>
+ <item>send</item>
+ <item>setgrent</item>
+ <item>sethostent</item>
+ <item>setnetent</item>
+ <item>setpgrp</item>
+ <item>setpriority</item>
+ <item>setprotoent</item>
+ <item>setpwent</item>
+ <item>setservent</item>
+ <item>setsockopt</item>
+ <item>shift</item>
+ <item>shmctl</item>
+ <item>shmget</item>
+ <item>shmread</item>
+ <item>shmwrite</item>
+ <item>shutdown</item>
+ <item>sin</item>
+ <item>sleep</item>
+ <item>socket</item>
+ <item>socketpair</item>
+ <item>sort</item>
+ <item>splice</item>
+ <item>split</item>
+ <item>sprintf</item>
+ <item>sqrt</item>
+ <item>srand</item>
+ <item>stat</item>
+ <item>study</item>
+ <item>sub</item>
+ <item>substr</item>
+ <item>symlink</item>
+ <item>syscall</item>
+ <item>sysread</item>
+ <item>sysseek</item>
+ <item>system</item>
+ <item>syswrite</item>
+ <item>tell</item>
+ <item>telldir</item>
+ <item>tie</item>
+ <item>time</item>
+ <item>times</item>
+ <item>truncate</item>
+ <item>uc</item>
+ <item>ucfirst</item>
+ <item>umask</item>
+ <item>undef</item>
+ <item>unlink</item>
+ <item>unpack</item>
+ <item>unshift</item>
+ <item>untie</item>
+ <item>utime</item>
+ <item>values</item>
+ <item>vec</item>
+ <item>wait</item>
+ <item>waitpid</item>
+ <item>wantarray</item>
+ <item>warn</item>
+ <item>write</item>
+ </list>
+ <list name="pragmas">
+ <item>strict</item>
+ <item>english</item>
+ <item>warnings</item>
+ <item>vars</item>
+ <item>subs</item>
+ <item>utf8</item>
+ <item>sigtrap</item>
+ <item>locale</item>
+ <item>open</item>
+ <item>less</item>
+ <item>integer</item>
+ <item>filetest</item>
+ <item>constant</item>
+ <item>bytes</item>
+ <item>diagnostics</item>
+ </list>
+ <contexts>
+ <context name="normal" attribute="Normal Text" lineEndContext="#stay">
+ <RegExpr attribute="Keyword" context="#stay" String="^#!\/.*" />
+ <StringDetect attribute="Keyword" context="data_handle" String="__DATA__" firstNonSpace="true" />
+ <StringDetect attribute="Keyword" context="#stay" String="__END__" firstNonSpace="true"/>
+ <RegExpr attribute="Keyword" context="sub_name_def" String="\bsub\s+" />
+ <keyword attribute="Keyword" context="#stay" String="keywords" />
+ <keyword attribute="Operator" context="#stay" String="operators" />
+ <keyword attribute="Function" context="#stay" String="functions" />
+ <keyword attribute="Pragma" context="#stay" String="pragmas" />
+ <RegExpr attribute="Pod" context="pod" String="\=(?:head[1-6]|over|back|item|for|begin|end|pod)(\s|$)" column="0" beginRegion="POD"/>
+ <DetectSpaces />
+ <DetectChar attribute="Comment" context="comment" char="#" />
+
+ <HlCOct attribute="Octal" context="slash_safe_escape" />
+ <HlCHex attribute="Hex" context="slash_safe_escape" />
+ <Float attribute="Float" context="slash_safe_escape" />
+ <Int attribute="Decimal" context="slash_safe_escape" />
+
+ <RegExpr attribute="Normal Text" context="#stay" String="\\([&quot;'])[^\1]" />
+ <Detect2Chars attribute="Normal Text" context="#stay" char="&amp;" char1="'" /><!-- ??? -->
+ <DetectChar attribute="Operator" context="ip_string" char="&quot;" beginRegion="String" />
+ <DetectChar attribute="Operator" context="string" char="'" beginRegion="String"/>
+ <DetectChar attribute="Operator" context="Backticked" char="`" />
+
+ <RegExpr attribute="Normal Text" context="find_variable" String="(?:[$@]\S|%[\w{]|\*[^\d\*{\$@%=(])" lookAhead="true" />
+
+ <RegExpr attribute="Keyword" context="#stay" String="&lt;[A-Z0-9_]+&gt;" />
+
+ <RegExpr attribute="Operator" context="find_here_document" String="\s*&lt;&lt;(?=\w+|\s*[&quot;'])" beginRegion="HereDocument" />
+
+ <RegExpr attribute="Normal Text" context="#stay" String="\s*\}\s*/" endRegion="Block"/>
+ <RegExpr attribute="Normal Text" context="#stay" String="\s*[)]\s*/" />
+ <RegExpr attribute="Function" context="sub_name_def" String="\w+::" />
+ <RegExpr attribute="Normal Text" context="#stay" String="\w+[=]" />
+
+ <RegExpr attribute="Operator" context="find_quoted" String="\bq(?=[qwx]?\s*[^\w\s])" />
+ <RegExpr attribute="Operator" context="find_subst" String="\bs(?=\s*[^\w\s])" />
+ <RegExpr attribute="Operator" context="tr" String="\b(?:tr|y)\s*(?=[^\w\s\]})])" />
+
+ <RegExpr attribute="Operator" context="find_pattern" String="\b(?:m|qr)(?=\s*[^\w\s\]})])" />
+
+ <RegExpr attribute="Normal Text" context="#stay" String="[\w_]+\s*/" />
+ <RegExpr attribute="Normal Text" context="#stay" String="[&lt;&gt;&quot;':]/" />
+ <DetectChar attribute="Operator" context="pattern_slash" char="/" beginRegion="Pattern" />
+ <RegExpr attribute="Operator" context="#stay" String="-[rwxoRWXOeszfdlpSbctugkTBMAC]" />
+
+ <DetectChar attribute="Normal Text" context="#stay" char="{" beginRegion="Block" />
+ <DetectChar attribute="Normal Text" context="#stay" char="}" endRegion="Block" />
+ </context>
+
+ <!-- ====== quoted construct central ===== -->
+ <context name="find_quoted" attribute="Normal Text" lineEndContext="#stay" >
+ <!-- NOTE - qx'not interpolated regex' does not cover newline between "qr" and "'" -->
+ <RegExpr attribute="Operator" context="string_6" String="x\s*(')" beginRegion="String" />
+ <AnyChar attribute="Operator" context="find_qqx" String="qx" />
+ <DetectChar attribute="Operator" context="find_qw" char="w" />
+ <DetectChar attribute="Operator" context="string_2" char="(" beginRegion="String" />
+ <DetectChar attribute="Operator" context="string_3" char="{" beginRegion="String" />
+ <DetectChar attribute="Operator" context="string_4" char="[" beginRegion="String" />
+ <DetectChar attribute="Operator" context="string_5" char="&lt;" beginRegion="String" />
+ <RegExpr attribute="Operator" context="string_6" String="([^a-zA-Z0-9_\s[\]{}()])" beginRegion="String" />
+ <RegExpr attribute="Comment" context="#stay" String="\s+#.*" /><!-- q[qwx] # == comment, look for the delim on the next line -->
+ </context>
+ <context name="find_qqx" attribute="Normal Text" lineEndContext="#stay" >
+ <DetectChar attribute="Operator" context="ip_string_2" char="(" beginRegion="String" />
+ <DetectChar attribute="Operator" context="ip_string_3" char="{" beginRegion="String" />
+ <DetectChar attribute="Operator" context="ip_string_4" char="[" beginRegion="String" />
+ <DetectChar attribute="Operator" context="ip_string_5" char="&lt;" beginRegion="String" />
+ <RegExpr attribute="Operator" context="ip_string_6" String="([^a-zA-Z0-9_\s[\]{}()])" beginRegion="String" />
+ <RegExpr attribute="Comment" context="#stay" String="\s+#.*" /><!-- q[qwx] # == comment, look for the delim on the next line -->
+ </context>
+ <context name="find_qw" attribute="Normal Text" lineEndContext="#stay" >
+ <DetectChar attribute="Operator" context="quote_word_paren" char="(" beginRegion="Wordlist" />
+ <DetectChar attribute="Operator" context="quote_word_brace" char="{" beginRegion="Wordlist" />
+ <DetectChar attribute="Operator" context="quote_word_bracket" char="[" beginRegion="Wordlist" />
+ <RegExpr attribute="Operator" context="quote_word" String="([^a-zA-Z0-9_\s[\]{}()])" beginRegion="Wordlist" />
+ <RegExpr attribute="Comment" context="#stay" String="\s+#.*" /><!-- q[qwx] # == comment, look for the delim on the next line -->
+ </context>
+
+ <!-- ====== Contexts for strings ===== -->
+ <context name="ipstring_internal" attribute="String (interpolated)" lineEndContext="#stay">
+ <DetectIdentifier />
+ <RegExpr attribute="String Special Character" context="#stay" String="\\[UuLlEtnaefr]" />
+ <RegExpr attribute="String (interpolated)" context="#stay" String="\\." />
+ <RegExpr attribute="Normal Text" context="find_variable_unsafe" String="(?:[\$@]\S|%[\w{])" lookAhead="true" />
+ </context>
+ <context name="ip_string" attribute="String (interpolated)" lineEndContext="#stay">
+ <DetectChar attribute="Operator" context="#pop" char="&quot;" endRegion="String"/>
+ <IncludeRules context="ipstring_internal" />
+ </context>
+ <context name="ip_string_2" attribute="String (interpolated)" lineEndContext="#stay">
+ <RangeDetect attribute="String (interpolated)" context="#stay" char="(" char1=")" />
+ <DetectChar attribute="Operator" context="#pop#pop#pop" char=")" endRegion="String" />
+ <IncludeRules context="ipstring_internal" />
+ </context>
+ <context name="ip_string_3" attribute="String (interpolated)" lineEndContext="#stay">
+ <RangeDetect attribute="String (interpolated)" context="#stay" char="{" char1="}" />
+ <DetectChar attribute="Operator" context="#pop#pop#pop" char="}" endRegion="String" />
+ <IncludeRules context="ipstring_internal" />
+ </context>
+ <context name="ip_string_4" attribute="String (interpolated)" lineEndContext="#stay">
+ <RangeDetect attribute="String (interpolated)" context="#stay" char="[" char1="]" />
+ <DetectChar attribute="Operator" context="#pop#pop#pop" char="]" endRegion="String" />
+ <IncludeRules context="ipstring_internal" />
+ </context>
+ <context name="ip_string_5" attribute="String (interpolated)" lineEndContext="#stay">
+ <RangeDetect attribute="String (interpolated)" context="#stay" char="&lt;" char1="&gt;" />
+ <DetectChar attribute="Operator" context="#pop#pop#pop" char="&gt;" endRegion="String" />
+ <IncludeRules context="ipstring_internal" />
+ </context>
+ <context name="ip_string_6" attribute="String (interpolated)" lineEndContext="#stay" dynamic="true">
+ <RegExpr attribute="String (interpolated)" context="#stay" String="\%1" dynamic="true" />
+ <DetectChar attribute="Operator" context="#pop#pop#pop" char="1" dynamic="true" endRegion="String"/>
+ <IncludeRules context="ipstring_internal" />
+ </context>
+
+ <context name="string" attribute="String" lineEndContext="#stay">
+ <DetectIdentifier />
+ <Detect2Chars attribute="String Special Character" context="#stay" char="\" char1="'" />
+ <Detect2Chars attribute="String Special Character" context="#stay" char="\" char1="\" />
+ <DetectChar attribute="Operator" context="#pop" char="'" endRegion="String" />
+ </context>
+ <context name="string_2" attribute="String" lineEndContext="#stay">
+ <DetectIdentifier />
+ <Detect2Chars attribute="String Special Character" context="#stay" char="\" char1=")" />
+ <Detect2Chars attribute="String Special Character" context="#stay" char="\" char1="\" />
+ <RangeDetect attribute="String" context="#stay" char="(" char1=")" />
+ <DetectChar attribute="Operator" context="#pop#pop" char=")" endRegion="String" />
+ </context>
+ <context name="string_3" attribute="String" lineEndContext="#stay">
+ <DetectIdentifier />
+ <Detect2Chars attribute="String Special Character" context="#stay" char="\" char1="}" />
+ <Detect2Chars attribute="String Special Character" context="#stay" char="\" char1="\" />
+ <RangeDetect attribute="String" context="#stay" char="{" char1="}" />
+ <DetectChar attribute="Operator" context="#pop#pop" char="}" endRegion="String" />
+ </context>
+ <context name="string_4" attribute="String" lineEndContext="#stay">
+ <DetectIdentifier />
+ <Detect2Chars attribute="String Special Character" context="#stay" char="\" char1="]" />
+ <Detect2Chars attribute="String Special Character" context="#stay" char="\" char1="\" />
+ <RangeDetect attribute="String" context="#stay" char="[" char1="]" />
+ <DetectChar attribute="Operator" context="#pop#pop" char="]" endRegion="String" />
+ </context>
+ <context name="string_5" attribute="String" lineEndContext="#stay">
+ <DetectIdentifier />
+ <Detect2Chars attribute="String Special Character" context="#stay" char="\" char1="&lt;" />
+ <Detect2Chars attribute="String Special Character" context="#stay" char="\" char1="\" />
+ <Detect2Chars attribute="String" context="#stay" char="\" char1="&gt;" />
+ <RangeDetect attribute="String" context="#stay" char="&lt;" char1="&gt;" />
+ <DetectChar attribute="Operator" context="#pop#pop" char="&gt;" endRegion="String" />
+ </context>
+ <context name="string_6" attribute="String" lineEndContext="#stay" dynamic="true">
+ <DetectIdentifier />
+ <Detect2Chars attribute="String Special Character" context="#stay" char="\" char1="\" />
+ <RegExpr attribute="String Special Character" context="#stay" String="\%1" dynamic="true"/>
+ <DetectChar attribute="Operator" context="#pop#pop" char="1" dynamic="true" endRegion="String" />
+ </context>
+
+ <!-- ====== contexts for s/// ====== -->
+ <context name="find_subst" attribute="Normal Text" lineEndContext="#stay" >
+ <RegExpr attribute="Comment" context="#stay" String="\s+#.*" /><!-- s # == comment, look for the delim on the next line -->
+ <DetectChar attribute="Operator" context="subst_curlybrace_pattern" char="{" beginRegion="Pattern" />
+ <DetectChar attribute="Operator" context="subst_paren_pattern" char="(" beginRegion="Pattern" />
+ <DetectChar attribute="Operator" context="subst_bracket_pattern" char="[" beginRegion="Pattern" />
+ <DetectChar attribute="Operator" context="subst_sq_pattern" char="'" beginRegion="Pattern" />
+ <RegExpr attribute="Operator" context="subst_slash_pattern" String="([^\w\s[\]{}()])" beginRegion="Pattern" />
+ </context>
+
+ <!-- Fully parse s {} {}.
+ This means that
+ - comments are legal between PATTERN and REPLACEMENT
+ - REPLACEMENT can contain resursive {} blocks -->
+ <context name="subst_curlybrace_pattern" attribute="Pattern" lineEndContext="#stay">
+ <RegExpr attribute="Comment" context="#stay" String="\s+#.*$" />
+ <IncludeRules context="regex_pattern_internal_ip" />
+ <DetectChar attribute="Operator" context="subst_curlybrace_middle" char="}" endRegion="Pattern" />
+ </context>
+ <context name="subst_curlybrace_middle" attribute="Normal Text" lineEndContext="#stay" >
+ <RegExpr attribute="Comment" context="#stay" String="#.*$" />
+ <DetectChar attribute="Operator" context="subst_curlybrace_replace" char="{" beginRegion="Replacement" />
+ </context>
+ <context name="subst_curlybrace_replace" attribute="String (interpolated)" lineEndContext="#stay">
+ <IncludeRules context="ipstring_internal" />
+ <DetectChar attribute="Normal Text" context="subst_curlybrace_replace_recursive" char="{" beginRegion="Block" />
+ <RegExpr attribute="Operator" context="#pop#pop#pop#pop" String="\}[cegimosx]*" endRegion="Replacement" />
+ </context>
+ <context name="subst_curlybrace_replace_recursive" attribute="String (interpolated)" lineEndContext="#stay" >
+ <DetectChar attribute="String (interpolated)" context="subst_curlybrace_replace_recursive" char="{" beginRegion="Block" />
+ <DetectChar attribute="Normal Text" context="#pop" char="}" endRegion="Block" />
+ <IncludeRules context="ipstring_internal" />
+ </context>
+
+ <context name="subst_paren_pattern" attribute="Pattern" lineEndContext="#stay">
+ <RegExpr attribute="Comment" context="#stay" String="\s+#.*$" />
+ <IncludeRules context="regex_pattern_internal_ip" />
+ <DetectChar attribute="Operator" context="subst_paren_replace" char="}" endRegion="Pattern" />
+ </context>
+ <context name="subst_paren_replace" attribute="String (interpolated)" lineEndContext="#stay">
+ <IncludeRules context="ipstring_internal" />
+ <DetectChar attribute="Operator" context="#stay" char="(" beginRegion="Replacement" />
+ <RegExpr attribute="Operator" context="#pop#pop#pop" String="\)[cegimosx]*" endRegion="Replacement" />
+ </context>
+
+ <context name="subst_bracket_pattern" attribute="Pattern" lineEndContext="#stay">
+ <RegExpr attribute="Comment" context="#stay" String="\s+#.*$" />
+ <IncludeRules context="regex_pattern_internal_ip" />
+ <DetectChar attribute="Operator" context="subst_bracket_replace" char="]" endRegion="Pattern" />
+ </context>
+ <context name="subst_bracket_replace" attribute="String (interpolated)" lineEndContext="#stay">
+ <IncludeRules context="ipstring_internal" />
+ <DetectChar attribute="Operator" context="#stay" char="[" beginRegion="Replacement" />
+ <RegExpr attribute="Operator" context="#pop#pop#pop" String="\][cegimosx]*" endRegion="Replacement" />
+ </context>
+
+ <context name="subst_slash_pattern" attribute="Pattern" lineEndContext="#stay" dynamic="true">
+ <RegExpr attribute="Pattern Internal Operator" context="#stay" String="\$(?=%1)" dynamic="true" />
+ <RegExpr attribute="Operator" context="subst_slash_replace" String="(%1)" dynamic="true" endRegion="Pattern" beginRegion="Replacement" />
+ <IncludeRules context="regex_pattern_internal_ip" />
+ </context>
+ <context name="subst_slash_replace" attribute="String (interpolated)" lineEndContext="#stay" dynamic="true">
+ <IncludeRules context="ipstring_internal" />
+ <RegExpr attribute="Operator" context="#pop#pop#pop" String="%1[cegimosx]*" dynamic="true" endRegion="Replacement" />
+ </context>
+
+ <context name="subst_sq_pattern" attribute="Pattern" lineEndContext="#stay">
+ <RegExpr attribute="Comment" context="#stay" String="\s+#.*$" />
+ <IncludeRules context="regex_pattern_internal" />
+ <DetectChar attribute="Operator" context="subst_sq_replace" char="'" endRegion="Pattern" beginRegion="Pattern" />
+ </context>
+ <context name="subst_sq_replace" attribute="String" lineEndContext="#stay">
+ <RegExpr attribute="Operator" context="#pop#pop#pop" String="'[cegimosx]*" endRegion="Replacement" />
+ </context>
+
+ <context name="tr" attribute="Pattern" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop" >
+ <RegExpr attribute="Pattern" context="#pop" String="([^)]*\)\s*\(?:[^)]*\)" />
+ <RegExpr attribute="Pattern" context="#pop" String="{[^}]*\}\s*\{[^}]*\}" />
+ <RegExpr attribute="Pattern" context="#pop" String="\[[^}]*\]\s*\[[^\]]*\]" />
+ <RegExpr attribute="Pattern" context="#pop" String="([^a-zA-Z0-9_\s[\]{}()]).*\1.*\1" minimal="true"/>
+ </context>
+
+ <!-- ====== PATTERNs ====== -->
+ <context name="find_pattern" attribute="Pattern" lineEndContext="#stay">
+ <RegExpr attribute="Comment" context="#stay" String="\s+#.*" /><!-- s # == comment, look for the delim on the next line -->
+ <DetectChar attribute="Operator" context="pattern_brace" char="{" beginRegion="Pattern" />
+ <DetectChar attribute="Operator" context="pattern_paren" char="(" beginRegion="Pattern" />
+ <DetectChar attribute="Operator" context="pattern_bracket" char="[" beginRegion="Pattern" />
+ <DetectChar attribute="Operator" context="pattern_sq" char="'" beginRegion="Pattern" />
+ <RegExpr attribute="Operator" context="pattern" String="([^\w\s])" beginRegion="Pattern" />
+ </context>
+ <context name="pattern_slash" attribute="Pattern" lineEndContext="#stay">
+ <RegExpr attribute="Pattern Internal Operator" context="#stay" String="\$(?=/)" />
+ <IncludeRules context="regex_pattern_internal_ip" />
+ <RegExpr attribute="Operator" context="#pop" String="/[cgimosx]*" endRegion="Pattern" />
+ </context>
+ <context name="pattern" attribute="Pattern" lineEndContext="#stay" dynamic="true">
+ <RegExpr attribute="Pattern Internal Operator" context="#stay" String="\$(?=%1)" dynamic="true" />
+ <RegExpr attribute="Operator" context="#pop#pop" String="%1[cgimosx]*" dynamic="true" endRegion="Pattern" />
+ <IncludeRules context="regex_pattern_internal_ip" />
+ <RegExpr attribute="Pattern Internal Operator" context="#stay" String="\$(?=\%1)" dynamic="true" />
+ </context>
+ <context name="pattern_brace" attribute="Pattern" lineEndContext="#stay">
+ <RegExpr attribute="Operator" context="#pop#pop" String="\}[cgimosx]*" endRegion="Pattern" />
+ <IncludeRules context="regex_pattern_internal_ip" />
+ </context>
+ <context name="pattern_bracket" attribute="Pattern" lineEndContext="#stay">
+ <RegExpr attribute="Operator" context="#pop#pop" String="\][cgimosx]*" endRegion="Pattern" />
+ <IncludeRules context="regex_pattern_internal_ip" />
+ </context>
+ <context name="pattern_paren" attribute="Pattern" lineEndContext="#stay">
+ <RegExpr attribute="Operator" context="#pop#pop" String="\)[cgimosx]*" endRegion="Pattern" />
+ <IncludeRules context="regex_pattern_internal_ip" />
+ </context>
+ <context name="pattern_sq" attribute="Pattern" lineEndContext="#stay">
+ <RegExpr attribute="Operator" context="#pop#pop" String="'[cgimosx]*" endRegion="Pattern" />
+ <IncludeRules context="regex_pattern_internal" />
+ </context>
+
+ <!-- rules internal stuff wrt regex patterns -->
+ <context name="regex_pattern_internal_rules_1" lineEndContext="#stay">
+ <RegExpr attribute="Comment" context="#stay" String="#.*$" firstNonSpace="true" />
+ <RegExpr attribute="Pattern Character Class" context="#stay" String="\\[anDdSsWw]" />
+ <RegExpr attribute="Pattern Internal Operator" context="#stay" String="\\[ABbEGLlNUuQdQZz]" />
+ <RegExpr attribute="Special Variable" context="#stay" String="\\[\d]+" />
+ <RegExpr attribute="Pattern" context="#stay" String="\\." />
+ </context>
+ <context name="regex_pattern_internal_rules_2" lineEndContext="#stay">
+ <Detect2Chars attribute="Pattern Internal Operator" context="pat_ext" char="(" char1="?" />
+ <DetectChar attribute="Pattern Internal Operator" context="pat_char_class" char="[" />
+ <RegExpr attribute="Pattern Internal Operator" context="#stay" String="[()?^*+|]" />
+ <RegExpr attribute="Pattern Internal Operator" context="#stay" String="\{[\d, ]+\}" />
+ <DetectChar attribute="Pattern Internal Operator" context="#stay" char="$" />
+ <RegExpr attribute="Comment" context="#stay" String="\s{3,}#.*$" />
+ </context>
+ <context name="regex_pattern_internal" attribute="Pattern" lineEndContext="#stay">
+ <IncludeRules context="regex_pattern_internal_rules_1" />
+ <IncludeRules context="regex_pattern_internal_rules_2" />
+ </context>
+ <context name="regex_pattern_internal_ip" attribute="Pattern" lineEndContext="#stay" >
+ <IncludeRules context="regex_pattern_internal_rules_1" />
+ <!-- NOTE the below means that the special variables $' $], $} and $> are not supported
+ within interpolated PATTERNs (apart from $(, $) and ${ and $| not supported by perl).
+ This is because perl considers
+ s{foo$} {bar} OK as well as s{foo$}} {bar}, and detecting that is a huge work overload
+ for something that is unlikely to happen. -->
+ <RegExpr attribute="Data Type" context="find_variable_unsafe" String="[$@][^]\s{}()|&gt;']" lookAhead="true" />
+ <IncludeRules context="regex_pattern_internal_rules_2" />
+ </context>
+ <context name="pat_ext" attribute="Pattern Internal Operator" lineEndContext="#stay">
+ <RegExpr attribute="Comment" context="#pop" String="\#[^)]*" />
+ <RegExpr attribute="Pattern Internal Operator" context="#pop" String="[:=!&gt;&lt;]+" />
+ <DetectChar attribute="Pattern Internal Operator" context="#pop" char=")" />
+ </context>
+ <context name="pat_char_class" attribute="Pattern Character Class" lineEndContext="#stay">
+ <DetectChar attribute="Pattern Internal Operator" context="#stay" char="^" />
+ <Detect2Chars attribute="Pattern Character Class" context="#stay" char="\" char1="\" />
+ <Detect2Chars attribute="Pattern Character Class" context="#stay" char="\" char1="]" />
+ <RegExpr attribute="Pattern Character Class" context="#stay" String="\[:^?[a-z]+:\]" />
+ <DetectChar attribute="Pattern Internal Operator" context="#pop" char="]" />
+ </context>
+
+ <!-- ====== Variables ====== -->
+ <context name="find_variable" attribute="Data Type" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop" >
+ <RegExpr attribute="Special Variable" context="var_detect" String="\$[0-9]+" />
+ <RegExpr attribute="Special Variable" context="var_detect" String="[@\$](?:[\+\-_]\B|ARGV\b|INC\b)" />
+ <RegExpr attribute="Special Variable" context="var_detect" String="[%\$](?:INC\b|ENV\b|SIG\b)" />
+ <RegExpr attribute="Data Type" context="var_detect" String="\$\$[\$\w_]" />
+ <RegExpr attribute="Data Type" context="var_detect" String="\$[#_][\w_]" />
+ <RegExpr attribute="Data Type" context="var_detect" String="\$+::" />
+ <RegExpr attribute="Special Variable" context="#stay" String="\$[^a-zA-Z0-9\s{][A-Z]?" />
+ <RegExpr attribute="Data Type" context="var_detect" String="[\$@%]\{[\w_]+\}" />
+ <AnyChar attribute="Data Type" context="var_detect" String="$@%" />
+ <RegExpr attribute="Data Type" context="var_detect" String="\*[a-zA-Z_]+" />
+ <RegExpr attribute="Special Variable" context="#stay" String="\*[^a-zA-Z0-9\s{][A-Z]?" />
+ <!-- this should be a rare case! -->
+ <AnyChar attribute="Operator" context="#pop" String="$@%*" />
+ </context>
+ <!-- This does not check fo a trailing slash, for usage in strings. -->
+ <context name="find_variable_unsafe" attribute="Data Type" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop" >
+ <RegExpr attribute="Special Variable" context="var_detect_unsafe" String="\$[0-9]+" />
+ <RegExpr attribute="Special Variable" context="var_detect_unsafe" String="[@\$](?:[\+\-_]\B|ARGV\b|INC\b)" />
+ <RegExpr attribute="Special Variable" context="var_detect_unsafe" String="[%\$](?:INC\b|ENV\b|SIG\b)" />
+ <RegExpr attribute="Data Type" context="var_detect_unsafe" String="\$\$[\$\w_]" />
+ <RegExpr attribute="Data Type" context="var_detect_unsafe" String="\$[#_][\w_]" />
+ <RegExpr attribute="Data Type" context="var_detect_unsafe" String="\$+::" />
+ <RegExpr attribute="Special Variable" context="#stay" String="\$[^a-zA-Z0-9\s{][A-Z]?" />
+ <RegExpr attribute="Data Type" context="var_detect_unsafe" String="[\$@%]\{[\w_]+\}" />
+ <RegExpr attribute="Data Type" context="var_detect_unsafe" String="[\$@%]" />
+ <RegExpr attribute="Data Type" context="var_detect_unsafe" String="\*\w+" />
+ <AnyChar attribute="Operator" context="#pop" String="$@%*" />
+ </context>
+ <context name="var_detect" attribute="Data Type" lineEndContext="#pop#pop" fallthrough="true" fallthroughContext="#pop#pop">
+ <IncludeRules context="var_detect_rules" />
+ <IncludeRules context="slash_safe_escape" />
+ </context>
+ <context name="var_detect_unsafe" attribute="Data Type" lineEndContext="#pop#pop" fallthrough="true" fallthroughContext="#pop#pop">
+ <IncludeRules context="var_detect_rules" />
+ </context>
+ <context name="var_detect_rules" attribute="Data Type" lineEndContext="#pop#pop" >
+ <RegExpr attribute="Data Type" context="#stay" String="[\w_]+" />
+ <Detect2Chars attribute="Normal Text" context="#stay" char=":" char1=":" />
+ <DetectChar attribute="Operator" context="#stay" char="'" />
+ <Detect2Chars attribute="Normal Text" context="#stay" char="-" char1="&gt;" />
+ <!-- safe with operator / -->
+ <Detect2Chars attribute="Normal Text" context="#stay" char="+" char1="+" />
+ <Detect2Chars attribute="Normal Text" context="#stay" char="-" char1="-" />
+ </context>
+
+
+ <!-- ====== Word lists ====== -->
+ <context name="quote_word" attribute="Normal Text" lineEndContext="#stay" dynamic="true">
+ <DetectSpaces />
+ <DetectIdentifier />
+ <RegExpr attribute="Normal Text" context="#stay" String="\\%1" dynamic="true" />
+ <DetectChar attribute="Operator" context="#pop#pop#pop" char="1" dynamic="true" endRegion="Wordlist" />
+ </context>
+ <context name="quote_word_paren" attribute="Normal Text" lineEndContext="#stay">
+ <DetectSpaces />
+ <DetectIdentifier />
+ <Detect2Chars attribute="Normal Text" context="#stay" char="\" char1=")" />
+ <DetectChar attribute="Operator" context="#pop#pop#pop" char=")" endRegion="Wordlist" />
+ </context>
+ <context name="quote_word_brace" attribute="Normal Text" lineEndContext="#stay">
+ <DetectSpaces />
+ <DetectIdentifier />
+ <Detect2Chars attribute="Normal Text" context="#stay" char="\" char1="}" />
+ <DetectChar attribute="Operator" context="#pop#pop#pop" char="}" endRegion="Wordlist" />
+ </context>
+ <context name="quote_word_bracket" attribute="Normal Text" lineEndContext="#stay">
+ <DetectSpaces />
+ <DetectIdentifier />
+ <Detect2Chars attribute="Normal Text" context="#stay" char="\" char1="]" />
+ <DetectChar attribute="Operator" context="#pop#pop#pop" char="]" endRegion="Wordlist" />
+ </context>
+
+ <!-- ====== Here Documents ====== -->
+ <context name="find_here_document" attribute="Normal Text" lineEndContext="#pop" >
+ <RegExpr attribute="Keyword" context="here_document" String="(\w+)\s*;?" />
+ <RegExpr attribute="Keyword" context="here_document" String="\s*&quot;([^&quot;]+)&quot;\s*;?" />
+ <RegExpr attribute="Keyword" context="here_document" String="\s*`([^`]+)`\s*;?" />
+ <RegExpr attribute="Keyword" context="here_document_dumb" String="\s*'([^']+)'\s*;?" />
+ </context>
+ <context name="here_document" attribute="String (interpolated)" lineEndContext="#stay" dynamic="true">
+ <DetectSpaces />
+ <RegExpr attribute="Keyword" context="#pop#pop" String="%1" column="0" dynamic="true" endRegion="HereDocument"/>
+ <RegExpr attribute="Keyword" context="here_document" String="\=\s*&lt;&lt;\s*[&quot;']?([A-Z0-9_\-]+)[&quot;']?" beginRegion="HEREDoc" />
+ <IncludeRules context="ipstring_internal" />
+ </context>
+ <context name="here_document_dumb" attribute="Normal Text" lineEndContext="#stay" dynamic="true">
+ <DetectSpaces />
+ <RegExpr attribute="Keyword" context="#pop#pop" String="%1" column="0" dynamic="true" endRegion="HereDocument"/>
+ <DetectIdentifier />
+ </context>
+
+ <!-- ====== Misc ====== -->
+ <context name="data_handle" attribute="Data" lineEndContext="#stay">
+ <RegExpr attribute="Pod" context="pod" String="\=(?:head[1-6]|over|back|item|for|begin|end|pod)\s+.*" column="0" beginRegion="POD"/>
+ <StringDetect attribute="Keyword" context="normal" String="__END__" firstNonSpace="true" />
+ </context>
+ <context name="end_handle" attribute="Nothing" lineEndContext="#stay">
+ <RegExpr attribute="Pod" context="pod" String="^\=(?:head[1-6]|over|back|item|for|begin|end|pod)\s*.*"/>
+ <StringDetect attribute="Keyword" context="data_handle" String="__DATA__" firstNonSpace="true" />
+ </context>
+
+ <context name="Backticked" attribute="String (interpolated)" lineEndContext="#stay">
+ <IncludeRules context="ipstring_internal"/>
+ <DetectChar attribute="Operator" context="#pop" char="`"/>
+ </context>
+
+ <context name="slash_safe_escape" attribute="Normal Text" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop">
+ <RegExpr attribute="Normal Text" context="#pop" String="\s*\]?\s*/" />
+ <RegExpr attribute="Normal Text" context="#pop" String="\s*\}?\s*/" endRegion="Block" />
+ <RegExpr attribute="Normal Text" context="#pop" String="\s*\)?\s*/" />
+ <keyword attribute="Keyword" context="#pop" String="keywords" />
+ </context>
+
+ <context name="package_qualified_blank" attribute="Normal Text" lineEndContext="#stay">
+ <RegExpr attribute="Normal Text" context="#pop" String="[\w_]+" />
+ </context>
+
+ <context name="sub_name_def" attribute="Normal Text" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop">
+ <RegExpr attribute="Function" context="#stay" String="\w+" />
+ <RegExpr attribute="Normal Text" context="find_variable" String="\$\S" lookAhead="true" />
+ <RegExpr attribute="Normal Text" context="sub_arg_definition" String="\s*\(" />
+ <Detect2Chars attribute="Normal Text" context="#stay" char=":" char1=":" />
+ </context>
+
+ <context name="sub_arg_definition" attribute="Normal Text" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop#pop">
+ <AnyChar attribute="Data Type" context="#stay" String="*$@%" />
+ <AnyChar attribute="Normal Text" context="#stay" String="&amp;\[];" />
+ <DetectChar attribute="Normal Text" context="slash_safe_escape" char=")" />
+ </context>
+
+ <context name="pod" attribute="Pod" lineEndContext="#stay">
+ <DetectSpaces />
+ <DetectIdentifier />
+ <RegExpr attribute="Pod" context="#stay" String="\=(?:head[1-6]|over|back|item|for|begin|end|pod)\s*.*" column="0" beginRegion="POD" endRegion="POD"/>
+ <RegExpr attribute="Pod" context="#pop" String="\=cut.*$" column="0" endRegion="POD"/>
+ </context>
+
+ <context name="comment" attribute="Comment" lineEndContext="#pop">
+ <DetectSpaces />
+ <IncludeRules context="##Alerts" />
+ <DetectIdentifier />
+ </context>
+
+ </contexts>
+ <itemDatas>
+ <itemData name="Normal Text" defStyleNum="dsNormal" />
+ <itemData name="Keyword" defStyleNum="dsKeyword" />
+ <itemData name="Pragma" defStyleNum="dsKeyword" />
+ <itemData name="Function" defStyleNum="dsFunction" />
+ <itemData name="Operator" defStyleNum="dsKeyword" color="#008000"/>
+ <itemData name="Data Type" defStyleNum="dsDataType" />
+ <itemData name="Special Variable" defStyleNum="dsDataType" color="#C00000" selColor="#C00000" bold="0" italic="0" />
+ <itemData name="Decimal" defStyleNum="dsDecVal" />
+ <itemData name="Octal" defStyleNum="dsBaseN" />
+ <itemData name="Hex" defStyleNum="dsBaseN" />
+ <itemData name="Float" defStyleNum="dsFloat" />
+ <itemData name="String" defStyleNum="dsString" color="#FF6C6C" selColor="#FF6C6C" bold="0" italic="0" />
+ <itemData name="String (interpolated)" defStyleNum="dsString" />
+ <itemData name="String Special Character" defStyleNum="dsChar" />
+ <itemData name="Pattern" defStyleNum="dsOthers" />
+ <itemData name="Pattern Internal Operator" defStyleNum="dsChar" />
+ <itemData name="Pattern Character Class" defStyleNum="dsBaseN" />
+ <itemData name="Data" defStyleNum="dsNormal" />
+ <itemData name="Comment" defStyleNum="dsComment" />
+ <itemData name="Pod" defStyleNum="dsComment" />
+ <itemData name="Nothing" defStyleNum="dsComment" />
+ </itemDatas>
+ </highlighting>
+ <general>
+ <comments>
+ <comment name="singleLine" start="#" />
+ </comments>
+ <keywords casesensitive="1" />
+ </general>
+</language>
+<!-- kate: space-indent on; indent-width 2; replace-tabs on; -->
diff --git a/kate/data/php.xml b/kate/data/php.xml
new file mode 100644
index 000000000..9819a2783
--- /dev/null
+++ b/kate/data/php.xml
@@ -0,0 +1,6549 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+Changes:
+
+[ Version 1.28 (2006-11-02) ]
+
+- Moved the special method names to a dedicated section (the coloration will default to the coloration of functions, but it can be customized independently, to revert to the previous coloration styles, that is, black, and bold).
+
+[ Version 1.27 (2006-11-01) ]
+
+- Added new special method names, from PHP 5.
+- Moved the special method names to the function list.
+
+[ Version 1.26 (2006-01-26) ]
+
+- Added alternative syntax control structures, and named logical operators ("and", "or", and "xor") (by Nicola Gigante).
+
+-->
+<!DOCTYPE language SYSTEM "language.dtd">
+<language name="PHP/PHP" version="1.28" kateversion="2.4" section="Scripts" extensions="" priority="5" mimetype="" hidden="true">
+ <highlighting>
+ <list name="control structures">
+ <item>as</item>
+ <item>case</item>
+ <item>default</item>
+ <item>if</item>
+ <item>else</item>
+ <item>elseif</item>
+ <item>while</item>
+ <item>do</item>
+ <item>for</item>
+ <item>foreach</item>
+ <item>break</item>
+ <item>continue</item>
+ <item>switch</item>
+ <item>declare</item>
+ <item>return</item>
+ <item>require</item>
+ <item>include</item>
+ <item>require_once</item>
+ <item>include_once</item>
+ <item>endif</item>
+ <item>endwhile</item>
+ <item>endfor</item>
+ <item>endforeach</item>
+ <item>endswitch</item>
+ </list>
+ <list name="keywords">
+ <item> abstract </item>
+ <item> catch </item>
+ <item> class </item>
+ <item> const </item>
+ <item> extends </item>
+ <item> final </item>
+ <item> function </item>
+ <item> implements </item>
+ <item> interface </item>
+ <item> new </item>
+ <item> self </item>
+ <item> static </item>
+ <item> parent </item>
+ <item> private </item>
+ <item> protected </item>
+ <item> public </item>
+ <item> throw </item>
+ <item> try </item>
+ <item> and </item>
+ <item> or </item>
+ <item> xor </item>
+ <item> var </item>
+ <item> __FILE__ </item>
+ <item> __LINE__ </item>
+ <item> E_ERROR </item>
+ <item> E_WARNING </item>
+ <item> E_PARSE </item>
+ <item> E_NOTICE </item>
+ <item> E_STRICT </item>
+ <item> E_CORE_ERROR </item>
+ <item> E_CORE_WARNING </item>
+ <item> E_COMPILE_ERROR </item>
+ <item> E_COMPILE_WARNING </item>
+ <item> E_USER_ERROR </item>
+ <item> E_USER_WARNING </item>
+ <item> E_USER_NOTICE </item>
+ <item> E_ALL </item>
+ <item> TRUE </item>
+ <item> FALSE </item>
+ <item> ZEND_THREAD_SAFE </item>
+ <item> NULL </item>
+ <item> PHP_VERSION </item>
+ <item> PHP_OS </item>
+ <item> PHP_SAPI </item>
+ <item> DEFAULT_INCLUDE_PATH </item>
+ <item> PEAR_INSTALL_DIR </item>
+ <item> PEAR_EXTENSION_DIR </item>
+ <item> PHP_EXTENSION_DIR </item>
+ <item> PHP_PREFIX </item>
+ <item> PHP_BINDIR </item>
+ <item> PHP_LIBDIR </item>
+ <item> PHP_DATADIR </item>
+ <item> PHP_SYSCONFDIR </item>
+ <item> PHP_LOCALSTATEDIR </item>
+ <item> PHP_CONFIG_FILE_PATH </item>
+ <item> PHP_CONFIG_FILE_SCAN_DIR </item>
+ <item> PHP_SHLIB_SUFFIX </item>
+ <item> PHP_EOL </item>
+ <item> PHP_OUTPUT_HANDLER_START </item>
+ <item> PHP_OUTPUT_HANDLER_CONT </item>
+ <item> PHP_OUTPUT_HANDLER_END </item>
+ <item> UPLOAD_ERR_OK </item>
+ <item> UPLOAD_ERR_INI_SIZE </item>
+ <item> UPLOAD_ERR_FORM_SIZE </item>
+ <item> UPLOAD_ERR_PARTIAL </item>
+ <item> UPLOAD_ERR_NO_FILE </item>
+ <item> UPLOAD_ERR_NO_TMP_DIR </item>
+ <item> P_STATIC </item>
+ <item> P_PUBLIC </item>
+ <item> P_PROTECTED </item>
+ <item> P_PRIVATE </item>
+ <item> M_STATIC </item>
+ <item> M_PUBLIC </item>
+ <item> M_PROTECTED </item>
+ <item> M_PRIVATE </item>
+ <item> M_ABSTRACT </item>
+ <item> M_FINAL </item>
+ <item> C_IMPLICIT_ABSTRACT </item>
+ <item> C_EXPLICIT_ABSTRACT </item>
+ <item> C_FINAL </item>
+ <item> XML_ERROR_NONE </item>
+ <item> XML_ERROR_NO_MEMORY </item>
+ <item> XML_ERROR_SYNTAX </item>
+ <item> XML_ERROR_NO_ELEMENTS </item>
+ <item> XML_ERROR_INVALID_TOKEN </item>
+ <item> XML_ERROR_UNCLOSED_TOKEN </item>
+ <item> XML_ERROR_PARTIAL_CHAR </item>
+ <item> XML_ERROR_TAG_MISMATCH </item>
+ <item> XML_ERROR_DUPLICATE_ATTRIBUTE </item>
+ <item> XML_ERROR_JUNK_AFTER_DOC_ELEMENT </item>
+ <item> XML_ERROR_PARAM_ENTITY_REF </item>
+ <item> XML_ERROR_UNDEFINED_ENTITY </item>
+ <item> XML_ERROR_RECURSIVE_ENTITY_REF </item>
+ <item> XML_ERROR_ASYNC_ENTITY </item>
+ <item> XML_ERROR_BAD_CHAR_REF </item>
+ <item> XML_ERROR_BINARY_ENTITY_REF </item>
+ <item> XML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF </item>
+ <item> XML_ERROR_MISPLACED_XML_PI </item>
+ <item> XML_ERROR_UNKNOWN_ENCODING </item>
+ <item> XML_ERROR_INCORRECT_ENCODING </item>
+ <item> XML_ERROR_UNCLOSED_CDATA_SECTION </item>
+ <item> XML_ERROR_EXTERNAL_ENTITY_HANDLING </item>
+ <item> XML_OPTION_CASE_FOLDING </item>
+ <item> XML_OPTION_TARGET_ENCODING </item>
+ <item> XML_OPTION_SKIP_TAGSTART </item>
+ <item> XML_OPTION_SKIP_WHITE </item>
+ <item> XML_SAX_IMPL </item>
+ <item> CONNECTION_ABORTED </item>
+ <item> CONNECTION_NORMAL </item>
+ <item> CONNECTION_TIMEOUT </item>
+ <item> INI_USER </item>
+ <item> INI_PERDIR </item>
+ <item> INI_SYSTEM </item>
+ <item> INI_ALL </item>
+ <item> SUNFUNCS_RET_TIMESTAMP </item>
+ <item> SUNFUNCS_RET_STRING </item>
+ <item> SUNFUNCS_RET_DOUBLE </item>
+ <item> M_E </item>
+ <item> M_LOG2E </item>
+ <item> M_LOG10E </item>
+ <item> M_LN2 </item>
+ <item> M_LN10 </item>
+ <item> M_PI </item>
+ <item> M_PI_2 </item>
+ <item> M_PI_4 </item>
+ <item> M_1_PI </item>
+ <item> M_2_PI </item>
+ <item> M_2_SQRTPI </item>
+ <item> M_SQRT2 </item>
+ <item> M_SQRT1_2 </item>
+ <item> INF </item>
+ <item> NAN </item>
+ <item> INFO_GENERAL </item>
+ <item> INFO_CREDITS </item>
+ <item> INFO_CONFIGURATION </item>
+ <item> INFO_MODULES </item>
+ <item> INFO_ENVIRONMENT </item>
+ <item> INFO_VARIABLES </item>
+ <item> INFO_LICENSE </item>
+ <item> INFO_ALL </item>
+ <item> CREDITS_GROUP </item>
+ <item> CREDITS_GENERAL </item>
+ <item> CREDITS_SAPI </item>
+ <item> CREDITS_MODULES </item>
+ <item> CREDITS_DOCS </item>
+ <item> CREDITS_FULLPAGE </item>
+ <item> CREDITS_QA </item>
+ <item> CREDITS_ALL </item>
+ <item> HTML_SPECIALCHARS </item>
+ <item> HTML_ENTITIES </item>
+ <item> ENT_COMPAT </item>
+ <item> ENT_QUOTES </item>
+ <item> ENT_NOQUOTES </item>
+ <item> STR_PAD_LEFT </item>
+ <item> STR_PAD_RIGHT </item>
+ <item> STR_PAD_BOTH </item>
+ <item> PATHINFO_DIRNAME </item>
+ <item> PATHINFO_BASENAME </item>
+ <item> PATHINFO_EXTENSION </item>
+ <item> CHAR_MAX </item>
+ <item> LC_CTYPE </item>
+ <item> LC_NUMERIC </item>
+ <item> LC_TIME </item>
+ <item> LC_COLLATE </item>
+ <item> LC_MONETARY </item>
+ <item> LC_ALL </item>
+ <item> LC_MESSAGES </item>
+ <item> SEEK_SET </item>
+ <item> SEEK_CUR </item>
+ <item> SEEK_END </item>
+ <item> LOCK_SH </item>
+ <item> LOCK_EX </item>
+ <item> LOCK_UN </item>
+ <item> LOCK_NB </item>
+ <item> STREAM_NOTIFY_CONNECT </item>
+ <item> STREAM_NOTIFY_AUTH_REQUIRED </item>
+ <item> STREAM_NOTIFY_AUTH_RESULT </item>
+ <item> STREAM_NOTIFY_MIME_TYPE_IS </item>
+ <item> STREAM_NOTIFY_FILE_SIZE_IS </item>
+ <item> STREAM_NOTIFY_REDIRECTED </item>
+ <item> STREAM_NOTIFY_PROGRESS </item>
+ <item> STREAM_NOTIFY_FAILURE </item>
+ <item> STREAM_NOTIFY_COMPLETED </item>
+ <item> STREAM_NOTIFY_RESOLVE </item>
+ <item> STREAM_NOTIFY_SEVERITY_INFO </item>
+ <item> STREAM_NOTIFY_SEVERITY_WARN </item>
+ <item> STREAM_NOTIFY_SEVERITY_ERR </item>
+ <item> STREAM_FILTER_READ </item>
+ <item> STREAM_FILTER_WRITE </item>
+ <item> STREAM_FILTER_ALL </item>
+ <item> STREAM_CLIENT_PERSISTENT </item>
+ <item> STREAM_CLIENT_ASYNC_CONNECT </item>
+ <item> STREAM_CLIENT_CONNECT </item>
+ <item> STREAM_PEEK </item>
+ <item> STREAM_OOB </item>
+ <item> STREAM_SERVER_BIND </item>
+ <item> STREAM_SERVER_LISTEN </item>
+ <item> FILE_USE_INCLUDE_PATH </item>
+ <item> FILE_IGNORE_NEW_LINES </item>
+ <item> FILE_SKIP_EMPTY_LINES </item>
+ <item> FILE_APPEND </item>
+ <item> FILE_NO_DEFAULT_CONTEXT </item>
+ <item> FNM_NOESCAPE </item>
+ <item> FNM_PATHNAME </item>
+ <item> FNM_PERIOD </item>
+ <item> FNM_CASEFOLD </item>
+ <item> PSFS_PASS_ON </item>
+ <item> PSFS_FEED_ME </item>
+ <item> PSFS_ERR_FATAL </item>
+ <item> PSFS_FLAG_NORMAL </item>
+ <item> PSFS_FLAG_FLUSH_INC </item>
+ <item> PSFS_FLAG_FLUSH_CLOSE </item>
+ <item> ABDAY_1 </item>
+ <item> ABDAY_2 </item>
+ <item> ABDAY_3 </item>
+ <item> ABDAY_4 </item>
+ <item> ABDAY_5 </item>
+ <item> ABDAY_6 </item>
+ <item> ABDAY_7 </item>
+ <item> DAY_1 </item>
+ <item> DAY_2 </item>
+ <item> DAY_3 </item>
+ <item> DAY_4 </item>
+ <item> DAY_5 </item>
+ <item> DAY_6 </item>
+ <item> DAY_7 </item>
+ <item> ABMON_1 </item>
+ <item> ABMON_2 </item>
+ <item> ABMON_3 </item>
+ <item> ABMON_4 </item>
+ <item> ABMON_5 </item>
+ <item> ABMON_6 </item>
+ <item> ABMON_7 </item>
+ <item> ABMON_8 </item>
+ <item> ABMON_9 </item>
+ <item> ABMON_10 </item>
+ <item> ABMON_11 </item>
+ <item> ABMON_12 </item>
+ <item> MON_1 </item>
+ <item> MON_2 </item>
+ <item> MON_3 </item>
+ <item> MON_4 </item>
+ <item> MON_5 </item>
+ <item> MON_6 </item>
+ <item> MON_7 </item>
+ <item> MON_8 </item>
+ <item> MON_9 </item>
+ <item> MON_10 </item>
+ <item> MON_11 </item>
+ <item> MON_12 </item>
+ <item> AM_STR </item>
+ <item> PM_STR </item>
+ <item> D_T_FMT </item>
+ <item> D_FMT </item>
+ <item> T_FMT </item>
+ <item> T_FMT_AMPM </item>
+ <item> ERA </item>
+ <item> ERA_D_T_FMT </item>
+ <item> ERA_D_FMT </item>
+ <item> ERA_T_FMT </item>
+ <item> ALT_DIGITS </item>
+ <item> CRNCYSTR </item>
+ <item> RADIXCHAR </item>
+ <item> THOUSEP </item>
+ <item> YESEXPR </item>
+ <item> NOEXPR </item>
+ <item> CODESET </item>
+ <item> CRYPT_SALT_LENGTH </item>
+ <item> CRYPT_STD_DES </item>
+ <item> CRYPT_EXT_DES </item>
+ <item> CRYPT_MD5 </item>
+ <item> CRYPT_BLOWFISH </item>
+ <item> DIRECTORY_SEPARATOR </item>
+ <item> PATH_SEPARATOR </item>
+ <item> GLOB_BRACE </item>
+ <item> GLOB_MARK </item>
+ <item> GLOB_NOSORT </item>
+ <item> GLOB_NOCHECK </item>
+ <item> GLOB_NOESCAPE </item>
+ <item> GLOB_ONLYDIR </item>
+ <item> LOG_EMERG </item>
+ <item> LOG_ALERT </item>
+ <item> LOG_CRIT </item>
+ <item> LOG_ERR </item>
+ <item> LOG_WARNING </item>
+ <item> LOG_NOTICE </item>
+ <item> LOG_INFO </item>
+ <item> LOG_DEBUG </item>
+ <item> LOG_KERN </item>
+ <item> LOG_USER </item>
+ <item> LOG_MAIL </item>
+ <item> LOG_DAEMON </item>
+ <item> LOG_AUTH </item>
+ <item> LOG_SYSLOG </item>
+ <item> LOG_LPR </item>
+ <item> LOG_NEWS </item>
+ <item> LOG_UUCP </item>
+ <item> LOG_CRON </item>
+ <item> LOG_AUTHPRIV </item>
+ <item> LOG_LOCAL0 </item>
+ <item> LOG_LOCAL1 </item>
+ <item> LOG_LOCAL2 </item>
+ <item> LOG_LOCAL3 </item>
+ <item> LOG_LOCAL4 </item>
+ <item> LOG_LOCAL5 </item>
+ <item> LOG_LOCAL6 </item>
+ <item> LOG_LOCAL7 </item>
+ <item> LOG_PID </item>
+ <item> LOG_CONS </item>
+ <item> LOG_ODELAY </item>
+ <item> LOG_NDELAY </item>
+ <item> LOG_NOWAIT </item>
+ <item> LOG_PERROR </item>
+ <item> EXTR_OVERWRITE </item>
+ <item> EXTR_SKIP </item>
+ <item> EXTR_PREFIX_SAME </item>
+ <item> EXTR_PREFIX_ALL </item>
+ <item> EXTR_PREFIX_INVALID </item>
+ <item> EXTR_PREFIX_IF_EXISTS </item>
+ <item> EXTR_IF_EXISTS </item>
+ <item> EXTR_REFS </item>
+ <item> SORT_ASC </item>
+ <item> SORT_DESC </item>
+ <item> SORT_REGULAR </item>
+ <item> SORT_NUMERIC </item>
+ <item> SORT_STRING </item>
+ <item> SORT_LOCALE_STRING </item>
+ <item> CASE_LOWER </item>
+ <item> CASE_UPPER </item>
+ <item> COUNT_NORMAL </item>
+ <item> COUNT_RECURSIVE </item>
+ <item> ASSERT_ACTIVE </item>
+ <item> ASSERT_CALLBACK </item>
+ <item> ASSERT_BAIL </item>
+ <item> ASSERT_WARNING </item>
+ <item> ASSERT_QUIET_EVAL </item>
+ <item> STREAM_USE_PATH </item>
+ <item> STREAM_IGNORE_URL </item>
+ <item> STREAM_ENFORCE_SAFE_MODE </item>
+ <item> STREAM_REPORT_ERRORS </item>
+ <item> STREAM_MUST_SEEK </item>
+ <item> STREAM_URL_STAT_LINK </item>
+ <item> STREAM_URL_STAT_QUIET </item>
+ <item> STREAM_MKDIR_RECURSIVE </item>
+ <item> IMAGETYPE_GIF </item>
+ <item> IMAGETYPE_JPEG </item>
+ <item> IMAGETYPE_PNG </item>
+ <item> IMAGETYPE_SWF </item>
+ <item> IMAGETYPE_PSD </item>
+ <item> IMAGETYPE_BMP </item>
+ <item> IMAGETYPE_TIFF_II </item>
+ <item> IMAGETYPE_TIFF_MM </item>
+ <item> IMAGETYPE_JPC </item>
+ <item> IMAGETYPE_JP2 </item>
+ <item> IMAGETYPE_JPX </item>
+ <item> IMAGETYPE_JB2 </item>
+ <item> IMAGETYPE_IFF </item>
+ <item> IMAGETYPE_WBMP </item>
+ <item> IMAGETYPE_JPEG2000 </item>
+ <item> IMAGETYPE_XBM </item>
+ <item> DNS_A </item>
+ <item> DNS_NS </item>
+ <item> DNS_CNAME </item>
+ <item> DNS_SOA </item>
+ <item> DNS_PTR </item>
+ <item> DNS_HINFO </item>
+ <item> DNS_MX </item>
+ <item> DNS_TXT </item>
+ <item> DNS_SRV </item>
+ <item> DNS_NAPTR </item>
+ <item> DNS_AAAA </item>
+ <item> DNS_ANY </item>
+ <item> DNS_ALL </item>
+ <item> RIT_LEAVES_ONLY </item>
+ <item> RIT_SELF_FIRST </item>
+ <item> RIT_CHILD_FIRST </item>
+ <item> CIT_CALL_TOSTRING </item>
+ <item> CIT_CATCH_GET_CHILD </item>
+ <item> PREG_PATTERN_ORDER </item>
+ <item> PREG_SET_ORDER </item>
+ <item> PREG_OFFSET_CAPTURE </item>
+ <item> PREG_SPLIT_NO_EMPTY </item>
+ <item> PREG_SPLIT_DELIM_CAPTURE </item>
+ <item> PREG_SPLIT_OFFSET_CAPTURE </item>
+ <item> PREG_GREP_INVERT </item>
+ <item> CAL_GREGORIAN </item>
+ <item> CAL_JULIAN </item>
+ <item> CAL_JEWISH </item>
+ <item> CAL_FRENCH </item>
+ <item> CAL_NUM_CALS </item>
+ <item> CAL_DOW_DAYNO </item>
+ <item> CAL_DOW_SHORT </item>
+ <item> CAL_DOW_LONG </item>
+ <item> CAL_MONTH_GREGORIAN_SHORT </item>
+ <item> CAL_MONTH_GREGORIAN_LONG </item>
+ <item> CAL_MONTH_JULIAN_SHORT </item>
+ <item> CAL_MONTH_JULIAN_LONG </item>
+ <item> CAL_MONTH_JEWISH </item>
+ <item> CAL_MONTH_FRENCH </item>
+ <item> CAL_EASTER_DEFAULT </item>
+ <item> CAL_EASTER_ROMAN </item>
+ <item> CAL_EASTER_ALWAYS_GREGORIAN </item>
+ <item> CAL_EASTER_ALWAYS_JULIAN </item>
+ <item> CAL_JEWISH_ADD_ALAFIM_GERESH </item>
+ <item> CAL_JEWISH_ADD_ALAFIM </item>
+ <item> CAL_JEWISH_ADD_GERESHAYIM </item>
+ <item> CURLOPT_DNS_USE_GLOBAL_CACHE </item>
+ <item> CURLOPT_DNS_CACHE_TIMEOUT </item>
+ <item> CURLOPT_PORT </item>
+ <item> CURLOPT_FILE </item>
+ <item> CURLOPT_READDATA </item>
+ <item> CURLOPT_INFILE </item>
+ <item> CURLOPT_INFILESIZE </item>
+ <item> CURLOPT_URL </item>
+ <item> CURLOPT_PROXY </item>
+ <item> CURLOPT_VERBOSE </item>
+ <item> CURLOPT_HEADER </item>
+ <item> CURLOPT_HTTPHEADER </item>
+ <item> CURLOPT_NOPROGRESS </item>
+ <item> CURLOPT_NOBODY </item>
+ <item> CURLOPT_FAILONERROR </item>
+ <item> CURLOPT_UPLOAD </item>
+ <item> CURLOPT_POST </item>
+ <item> CURLOPT_FTPLISTONLY </item>
+ <item> CURLOPT_FTPAPPEND </item>
+ <item> CURLOPT_NETRC </item>
+ <item> CURLOPT_FOLLOWLOCATION </item>
+ <item> CURLOPT_FTPASCII </item>
+ <item> CURLOPT_PUT </item>
+ <item> CURLOPT_MUTE </item>
+ <item> CURLOPT_USERPWD </item>
+ <item> CURLOPT_PROXYUSERPWD </item>
+ <item> CURLOPT_RANGE </item>
+ <item> CURLOPT_TIMEOUT </item>
+ <item> CURLOPT_POSTFIELDS </item>
+ <item> CURLOPT_REFERER </item>
+ <item> CURLOPT_USERAGENT </item>
+ <item> CURLOPT_FTPPORT </item>
+ <item> CURLOPT_FTP_USE_EPSV </item>
+ <item> CURLOPT_LOW_SPEED_LIMIT </item>
+ <item> CURLOPT_LOW_SPEED_TIME </item>
+ <item> CURLOPT_RESUME_FROM </item>
+ <item> CURLOPT_COOKIE </item>
+ <item> CURLOPT_SSLCERT </item>
+ <item> CURLOPT_SSLCERTPASSWD </item>
+ <item> CURLOPT_WRITEHEADER </item>
+ <item> CURLOPT_SSL_VERIFYHOST </item>
+ <item> CURLOPT_COOKIEFILE </item>
+ <item> CURLOPT_SSLVERSION </item>
+ <item> CURLOPT_TIMECONDITION </item>
+ <item> CURLOPT_TIMEVALUE </item>
+ <item> CURLOPT_CUSTOMREQUEST </item>
+ <item> CURLOPT_STDERR </item>
+ <item> CURLOPT_TRANSFERTEXT </item>
+ <item> CURLOPT_RETURNTRANSFER </item>
+ <item> CURLOPT_QUOTE </item>
+ <item> CURLOPT_POSTQUOTE </item>
+ <item> CURLOPT_INTERFACE </item>
+ <item> CURLOPT_KRB4LEVEL </item>
+ <item> CURLOPT_HTTPPROXYTUNNEL </item>
+ <item> CURLOPT_FILETIME </item>
+ <item> CURLOPT_WRITEFUNCTION </item>
+ <item> CURLOPT_READFUNCTION </item>
+ <item> CURLOPT_PASSWDFUNCTION </item>
+ <item> CURLOPT_HEADERFUNCTION </item>
+ <item> CURLOPT_MAXREDIRS </item>
+ <item> CURLOPT_MAXCONNECTS </item>
+ <item> CURLOPT_CLOSEPOLICY </item>
+ <item> CURLOPT_FRESH_CONNECT </item>
+ <item> CURLOPT_FORBID_REUSE </item>
+ <item> CURLOPT_RANDOM_FILE </item>
+ <item> CURLOPT_EGDSOCKET </item>
+ <item> CURLOPT_CONNECTTIMEOUT </item>
+ <item> CURLOPT_SSL_VERIFYPEER </item>
+ <item> CURLOPT_CAINFO </item>
+ <item> CURLOPT_CAPATH </item>
+ <item> CURLOPT_COOKIEJAR </item>
+ <item> CURLOPT_SSL_CIPHER_LIST </item>
+ <item> CURLOPT_BINARYTRANSFER </item>
+ <item> CURLOPT_NOSIGNAL </item>
+ <item> CURLOPT_PROXYTYPE </item>
+ <item> CURLOPT_BUFFERSIZE </item>
+ <item> CURLOPT_HTTPGET </item>
+ <item> CURLOPT_HTTP_VERSION </item>
+ <item> CURLOPT_SSLKEY </item>
+ <item> CURLOPT_SSLKEYTYPE </item>
+ <item> CURLOPT_SSLKEYPASSWD </item>
+ <item> CURLOPT_SSLENGINE </item>
+ <item> CURLOPT_SSLENGINE_DEFAULT </item>
+ <item> CURLOPT_SSLCERTTYPE </item>
+ <item> CURLOPT_CRLF </item>
+ <item> CURLOPT_ENCODING </item>
+ <item> CURLOPT_PROXYPORT </item>
+ <item> CURLOPT_UNRESTRICTED_AUTH </item>
+ <item> CURLOPT_FTP_USE_EPRT </item>
+ <item> CURLOPT_HTTP200ALIASES </item>
+ <item> CURL_TIMECOND_IFMODSINCE </item>
+ <item> CURL_TIMECOND_IFUNMODSINCE </item>
+ <item> CURL_TIMECOND_LASTMOD </item>
+ <item> CURLOPT_HTTPAUTH </item>
+ <item> CURLAUTH_BASIC </item>
+ <item> CURLAUTH_DIGEST </item>
+ <item> CURLAUTH_GSSNEGOTIATE </item>
+ <item> CURLAUTH_NTLM </item>
+ <item> CURLAUTH_ANY </item>
+ <item> CURLAUTH_ANYSAFE </item>
+ <item> CURLOPT_PROXYAUTH </item>
+ <item> CURLCLOSEPOLICY_LEAST_RECENTLY_USED </item>
+ <item> CURLCLOSEPOLICY_LEAST_TRAFFIC </item>
+ <item> CURLCLOSEPOLICY_SLOWEST </item>
+ <item> CURLCLOSEPOLICY_CALLBACK </item>
+ <item> CURLCLOSEPOLICY_OLDEST </item>
+ <item> CURLINFO_EFFECTIVE_URL </item>
+ <item> CURLINFO_HTTP_CODE </item>
+ <item> CURLINFO_HEADER_SIZE </item>
+ <item> CURLINFO_REQUEST_SIZE </item>
+ <item> CURLINFO_TOTAL_TIME </item>
+ <item> CURLINFO_NAMELOOKUP_TIME </item>
+ <item> CURLINFO_CONNECT_TIME </item>
+ <item> CURLINFO_PRETRANSFER_TIME </item>
+ <item> CURLINFO_SIZE_UPLOAD </item>
+ <item> CURLINFO_SIZE_DOWNLOAD </item>
+ <item> CURLINFO_SPEED_DOWNLOAD </item>
+ <item> CURLINFO_SPEED_UPLOAD </item>
+ <item> CURLINFO_FILETIME </item>
+ <item> CURLINFO_SSL_VERIFYRESULT </item>
+ <item> CURLINFO_CONTENT_LENGTH_DOWNLOAD </item>
+ <item> CURLINFO_CONTENT_LENGTH_UPLOAD </item>
+ <item> CURLINFO_STARTTRANSFER_TIME </item>
+ <item> CURLINFO_CONTENT_TYPE </item>
+ <item> CURLINFO_REDIRECT_TIME </item>
+ <item> CURLINFO_REDIRECT_COUNT </item>
+ <item> CURL_VERSION_IPV6 </item>
+ <item> CURL_VERSION_KERBEROS4 </item>
+ <item> CURL_VERSION_SSL </item>
+ <item> CURL_VERSION_LIBZ </item>
+ <item> CURLVERSION_NOW </item>
+ <item> CURLE_OK </item>
+ <item> CURLE_UNSUPPORTED_PROTOCOL </item>
+ <item> CURLE_FAILED_INIT </item>
+ <item> CURLE_URL_MALFORMAT </item>
+ <item> CURLE_URL_MALFORMAT_USER </item>
+ <item> CURLE_COULDNT_RESOLVE_PROXY </item>
+ <item> CURLE_COULDNT_RESOLVE_HOST </item>
+ <item> CURLE_COULDNT_CONNECT </item>
+ <item> CURLE_FTP_WEIRD_SERVER_REPLY </item>
+ <item> CURLE_FTP_ACCESS_DENIED </item>
+ <item> CURLE_FTP_USER_PASSWORD_INCORRECT </item>
+ <item> CURLE_FTP_WEIRD_PASS_REPLY </item>
+ <item> CURLE_FTP_WEIRD_USER_REPLY </item>
+ <item> CURLE_FTP_WEIRD_PASV_REPLY </item>
+ <item> CURLE_FTP_WEIRD_227_FORMAT </item>
+ <item> CURLE_FTP_CANT_GET_HOST </item>
+ <item> CURLE_FTP_CANT_RECONNECT </item>
+ <item> CURLE_FTP_COULDNT_SET_BINARY </item>
+ <item> CURLE_PARTIAL_FILE </item>
+ <item> CURLE_FTP_COULDNT_RETR_FILE </item>
+ <item> CURLE_FTP_WRITE_ERROR </item>
+ <item> CURLE_FTP_QUOTE_ERROR </item>
+ <item> CURLE_HTTP_NOT_FOUND </item>
+ <item> CURLE_WRITE_ERROR </item>
+ <item> CURLE_MALFORMAT_USER </item>
+ <item> CURLE_FTP_COULDNT_STOR_FILE </item>
+ <item> CURLE_READ_ERROR </item>
+ <item> CURLE_OUT_OF_MEMORY </item>
+ <item> CURLE_OPERATION_TIMEOUTED </item>
+ <item> CURLE_FTP_COULDNT_SET_ASCII </item>
+ <item> CURLE_FTP_PORT_FAILED </item>
+ <item> CURLE_FTP_COULDNT_USE_REST </item>
+ <item> CURLE_FTP_COULDNT_GET_SIZE </item>
+ <item> CURLE_HTTP_RANGE_ERROR </item>
+ <item> CURLE_HTTP_POST_ERROR </item>
+ <item> CURLE_SSL_CONNECT_ERROR </item>
+ <item> CURLE_FTP_BAD_DOWNLOAD_RESUME </item>
+ <item> CURLE_FILE_COULDNT_READ_FILE </item>
+ <item> CURLE_LDAP_CANNOT_BIND </item>
+ <item> CURLE_LDAP_SEARCH_FAILED </item>
+ <item> CURLE_LIBRARY_NOT_FOUND </item>
+ <item> CURLE_FUNCTION_NOT_FOUND </item>
+ <item> CURLE_ABORTED_BY_CALLBACK </item>
+ <item> CURLE_BAD_FUNCTION_ARGUMENT </item>
+ <item> CURLE_BAD_CALLING_ORDER </item>
+ <item> CURLE_HTTP_PORT_FAILED </item>
+ <item> CURLE_BAD_PASSWORD_ENTERED </item>
+ <item> CURLE_TOO_MANY_REDIRECTS </item>
+ <item> CURLE_UNKNOWN_TELNET_OPTION </item>
+ <item> CURLE_TELNET_OPTION_SYNTAX </item>
+ <item> CURLE_OBSOLETE </item>
+ <item> CURLE_SSL_PEER_CERTIFICATE </item>
+ <item> CURLE_GOT_NOTHING </item>
+ <item> CURLE_SSL_ENGINE_NOTFOUND </item>
+ <item> CURLE_SSL_ENGINE_SETFAILED </item>
+ <item> CURLE_SEND_ERROR </item>
+ <item> CURLE_RECV_ERROR </item>
+ <item> CURLE_SHARE_IN_USE </item>
+ <item> CURLE_SSL_CERTPROBLEM </item>
+ <item> CURLE_SSL_CIPHER </item>
+ <item> CURLE_SSL_CACERT </item>
+ <item> CURLE_BAD_CONTENT_ENCODING </item>
+ <item> CURLPROXY_HTTP </item>
+ <item> CURLPROXY_SOCKS5 </item>
+ <item> CURL_NETRC_OPTIONAL </item>
+ <item> CURL_NETRC_IGNORED </item>
+ <item> CURL_NETRC_REQUIRED </item>
+ <item> CURL_HTTP_VERSION_NONE </item>
+ <item> CURL_HTTP_VERSION_1_0 </item>
+ <item> CURL_HTTP_VERSION_1_1 </item>
+ <item> CURLM_CALL_MULTI_PERFORM </item>
+ <item> CURLM_OK </item>
+ <item> CURLM_BAD_HANDLE </item>
+ <item> CURLM_BAD_EASY_HANDLE </item>
+ <item> CURLM_OUT_OF_MEMORY </item>
+ <item> CURLM_INTERNAL_ERROR </item>
+ <item> CURLMSG_DONE </item>
+ <item> DBX_MYSQL </item>
+ <item> DBX_ODBC </item>
+ <item> DBX_PGSQL </item>
+ <item> DBX_MSSQL </item>
+ <item> DBX_FBSQL </item>
+ <item> DBX_OCI8 </item>
+ <item> DBX_SYBASECT </item>
+ <item> DBX_SQLITE </item>
+ <item> DBX_PERSISTENT </item>
+ <item> DBX_RESULT_INFO </item>
+ <item> DBX_RESULT_INDEX </item>
+ <item> DBX_RESULT_ASSOC </item>
+ <item> DBX_RESULT_UNBUFFERED </item>
+ <item> DBX_COLNAMES_UNCHANGED </item>
+ <item> DBX_COLNAMES_UPPERCASE </item>
+ <item> DBX_COLNAMES_LOWERCASE </item>
+ <item> DBX_CMP_NATIVE </item>
+ <item> DBX_CMP_TEXT </item>
+ <item> DBX_CMP_NUMBER </item>
+ <item> DBX_CMP_ASC </item>
+ <item> DBX_CMP_DESC </item>
+ <item> O_RDONLY </item>
+ <item> O_WRONLY </item>
+ <item> O_RDWR </item>
+ <item> O_CREAT </item>
+ <item> O_EXCL </item>
+ <item> O_TRUNC </item>
+ <item> O_APPEND </item>
+ <item> O_NONBLOCK </item>
+ <item> O_NDELAY </item>
+ <item> O_SYNC </item>
+ <item> O_ASYNC </item>
+ <item> O_NOCTTY </item>
+ <item> S_IRWXU </item>
+ <item> S_IRUSR </item>
+ <item> S_IWUSR </item>
+ <item> S_IXUSR </item>
+ <item> S_IRWXG </item>
+ <item> S_IRGRP </item>
+ <item> S_IWGRP </item>
+ <item> S_IXGRP </item>
+ <item> S_IRWXO </item>
+ <item> S_IROTH </item>
+ <item> S_IWOTH </item>
+ <item> S_IXOTH </item>
+ <item> F_DUPFD </item>
+ <item> F_GETFD </item>
+ <item> F_GETFL </item>
+ <item> F_SETFL </item>
+ <item> F_GETLK </item>
+ <item> F_SETLK </item>
+ <item> F_SETLKW </item>
+ <item> F_SETOWN </item>
+ <item> F_GETOWN </item>
+ <item> F_UNLCK </item>
+ <item> F_RDLCK </item>
+ <item> F_WRLCK </item>
+ <item> XML_ELEMENT_NODE </item>
+ <item> XML_ATTRIBUTE_NODE </item>
+ <item> XML_TEXT_NODE </item>
+ <item> XML_CDATA_SECTION_NODE </item>
+ <item> XML_ENTITY_REF_NODE </item>
+ <item> XML_ENTITY_NODE </item>
+ <item> XML_PI_NODE </item>
+ <item> XML_COMMENT_NODE </item>
+ <item> XML_DOCUMENT_NODE </item>
+ <item> XML_DOCUMENT_TYPE_NODE </item>
+ <item> XML_DOCUMENT_FRAG_NODE </item>
+ <item> XML_NOTATION_NODE </item>
+ <item> XML_HTML_DOCUMENT_NODE </item>
+ <item> XML_DTD_NODE </item>
+ <item> XML_ELEMENT_DECL_NODE </item>
+ <item> XML_ATTRIBUTE_DECL_NODE </item>
+ <item> XML_ENTITY_DECL_NODE </item>
+ <item> XML_NAMESPACE_DECL_NODE </item>
+ <item> XML_LOCAL_NAMESPACE </item>
+ <item> XML_ATTRIBUTE_CDATA </item>
+ <item> XML_ATTRIBUTE_ID </item>
+ <item> XML_ATTRIBUTE_IDREF </item>
+ <item> XML_ATTRIBUTE_IDREFS </item>
+ <item> XML_ATTRIBUTE_ENTITY </item>
+ <item> XML_ATTRIBUTE_NMTOKEN </item>
+ <item> XML_ATTRIBUTE_NMTOKENS </item>
+ <item> XML_ATTRIBUTE_ENUMERATION </item>
+ <item> XML_ATTRIBUTE_NOTATION </item>
+ <item> DOM_PHP_ERR </item>
+ <item> DOM_INDEX_SIZE_ERR </item>
+ <item> DOMSTRING_SIZE_ERR </item>
+ <item> DOM_HIERARCHY_REQUEST_ERR </item>
+ <item> DOM_WRONG_DOCUMENT_ERR </item>
+ <item> DOM_INVALID_CHARACTER_ERR </item>
+ <item> DOM_NO_DATA_ALLOWED_ERR </item>
+ <item> DOM_NO_MODIFICATION_ALLOWED_ERR </item>
+ <item> DOM_NOT_FOUND_ERR </item>
+ <item> DOM_NOT_SUPPORTED_ERR </item>
+ <item> DOM_INUSE_ATTRIBUTE_ERR </item>
+ <item> DOM_INVALID_STATE_ERR </item>
+ <item> DOM_SYNTAX_ERR </item>
+ <item> DOM_INVALID_MODIFICATION_ERR </item>
+ <item> DOM_NAMESPACE_ERR </item>
+ <item> DOM_INVALID_ACCESS_ERR </item>
+ <item> DOM_VALIDATION_ERR </item>
+ <item> EXIF_USE_MBSTRING </item>
+ <item> FAMChanged </item>
+ <item> FAMDeleted </item>
+ <item> FAMStartExecuting </item>
+ <item> FAMStopExecuting </item>
+ <item> FAMCreated </item>
+ <item> FAMMoved </item>
+ <item> FAMAcknowledge </item>
+ <item> FAMExists </item>
+ <item> FAMEndExist </item>
+ <item> FTP_ASCII </item>
+ <item> FTP_TEXT </item>
+ <item> FTP_BINARY </item>
+ <item> FTP_IMAGE </item>
+ <item> FTP_AUTORESUME </item>
+ <item> FTP_TIMEOUT_SEC </item>
+ <item> FTP_AUTOSEEK </item>
+ <item> FTP_FAILED </item>
+ <item> FTP_FINISHED </item>
+ <item> FTP_MOREDATA </item>
+ <item> IMG_GIF </item>
+ <item> IMG_JPG </item>
+ <item> IMG_JPEG </item>
+ <item> IMG_PNG </item>
+ <item> IMG_WBMP </item>
+ <item> IMG_XPM </item>
+ <item> IMG_COLOR_TILED </item>
+ <item> IMG_COLOR_STYLED </item>
+ <item> IMG_COLOR_BRUSHED </item>
+ <item> IMG_COLOR_STYLEDBRUSHED </item>
+ <item> IMG_COLOR_TRANSPARENT </item>
+ <item> IMG_ARC_ROUNDED </item>
+ <item> IMG_ARC_PIE </item>
+ <item> IMG_ARC_CHORD </item>
+ <item> IMG_ARC_NOFILL </item>
+ <item> IMG_ARC_EDGED </item>
+ <item> IMG_GD2_RAW </item>
+ <item> IMG_GD2_COMPRESSED </item>
+ <item> IMG_EFFECT_REPLACE </item>
+ <item> IMG_EFFECT_ALPHABLEND </item>
+ <item> IMG_EFFECT_NORMAL </item>
+ <item> IMG_EFFECT_OVERLAY </item>
+ <item> GD_BUNDLED </item>
+ <item> IMG_FILTER_NEGATE </item>
+ <item> IMG_FILTER_GRAYSCALE </item>
+ <item> IMG_FILTER_BRIGHTNESS </item>
+ <item> IMG_FILTER_CONTRAST </item>
+ <item> IMG_FILTER_COLORIZE </item>
+ <item> IMG_FILTER_EDGEDETECT </item>
+ <item> IMG_FILTER_GAUSSIAN_BLUR </item>
+ <item> IMG_FILTER_SELECTIVE_BLUR </item>
+ <item> IMG_FILTER_EMBOSS </item>
+ <item> IMG_FILTER_MEAN_REMOVAL </item>
+ <item> IMG_FILTER_SMOOTH </item>
+ <item> GMP_ROUND_ZERO </item>
+ <item> GMP_ROUND_PLUSINF </item>
+ <item> GMP_ROUND_MINUSINF </item>
+ <item> ICONV_IMPL </item>
+ <item> ICONV_VERSION </item>
+ <item> ICONV_MIME_DECODE_STRICT </item>
+ <item> ICONV_MIME_DECODE_CONTINUE_ON_ERROR </item>
+ <item> NIL </item>
+ <item> IMAP_OPENTIMEOUT </item>
+ <item> IMAP_READTIMEOUT </item>
+ <item> IMAP_WRITETIMEOUT </item>
+ <item> IMAP_CLOSETIMEOUT </item>
+ <item> OP_DEBUG </item>
+ <item> OP_READONLY </item>
+ <item> OP_ANONYMOUS </item>
+ <item> OP_SHORTCACHE </item>
+ <item> OP_SILENT </item>
+ <item> OP_PROTOTYPE </item>
+ <item> OP_HALFOPEN </item>
+ <item> OP_EXPUNGE </item>
+ <item> OP_SECURE </item>
+ <item> CL_EXPUNGE </item>
+ <item> FT_UID </item>
+ <item> FT_PEEK </item>
+ <item> FT_NOT </item>
+ <item> FT_INTERNAL </item>
+ <item> FT_PREFETCHTEXT </item>
+ <item> ST_UID </item>
+ <item> ST_SILENT </item>
+ <item> ST_SET </item>
+ <item> CP_UID </item>
+ <item> CP_MOVE </item>
+ <item> SE_UID </item>
+ <item> SE_FREE </item>
+ <item> SE_NOPREFETCH </item>
+ <item> SO_FREE </item>
+ <item> SO_NOSERVER </item>
+ <item> SA_MESSAGES </item>
+ <item> SA_RECENT </item>
+ <item> SA_UNSEEN </item>
+ <item> SA_UIDNEXT </item>
+ <item> SA_UIDVALIDITY </item>
+ <item> SA_ALL </item>
+ <item> LATT_NOINFERIORS </item>
+ <item> LATT_NOSELECT </item>
+ <item> LATT_MARKED </item>
+ <item> LATT_UNMARKED </item>
+ <item> LATT_REFERRAL </item>
+ <item> LATT_HASCHILDREN </item>
+ <item> LATT_HASNOCHILDREN </item>
+ <item> SORTDATE </item>
+ <item> SORTARRIVAL </item>
+ <item> SORTFROM </item>
+ <item> SORTSUBJECT </item>
+ <item> SORTTO </item>
+ <item> SORTCC </item>
+ <item> SORTSIZE </item>
+ <item> TYPETEXT </item>
+ <item> TYPEMULTIPART </item>
+ <item> TYPEMESSAGE </item>
+ <item> TYPEAPPLICATION </item>
+ <item> TYPEAUDIO </item>
+ <item> TYPEIMAGE </item>
+ <item> TYPEVIDEO </item>
+ <item> TYPEMODEL </item>
+ <item> TYPEOTHER </item>
+ <item> ENC7BIT </item>
+ <item> ENC8BIT </item>
+ <item> ENCBINARY </item>
+ <item> ENCBASE64 </item>
+ <item> ENCQUOTEDPRINTABLE </item>
+ <item> ENCOTHER </item>
+ <item> LDAP_DEREF_NEVER </item>
+ <item> LDAP_DEREF_SEARCHING </item>
+ <item> LDAP_DEREF_FINDING </item>
+ <item> LDAP_DEREF_ALWAYS </item>
+ <item> LDAP_OPT_DEREF </item>
+ <item> LDAP_OPT_SIZELIMIT </item>
+ <item> LDAP_OPT_TIMELIMIT </item>
+ <item> LDAP_OPT_PROTOCOL_VERSION </item>
+ <item> LDAP_OPT_ERROR_NUMBER </item>
+ <item> LDAP_OPT_REFERRALS </item>
+ <item> LDAP_OPT_RESTART </item>
+ <item> LDAP_OPT_HOST_NAME </item>
+ <item> LDAP_OPT_ERROR_STRING </item>
+ <item> LDAP_OPT_MATCHED_DN </item>
+ <item> LDAP_OPT_SERVER_CONTROLS </item>
+ <item> LDAP_OPT_CLIENT_CONTROLS </item>
+ <item> LDAP_OPT_DEBUG_LEVEL </item>
+ <item> MB_OVERLOAD_MAIL </item>
+ <item> MB_OVERLOAD_STRING </item>
+ <item> MB_OVERLOAD_REGEX </item>
+ <item> MB_CASE_UPPER </item>
+ <item> MB_CASE_LOWER </item>
+ <item> MB_CASE_TITLE </item>
+ <item> MCRYPT_ENCRYPT </item>
+ <item> MCRYPT_DECRYPT </item>
+ <item> MCRYPT_DEV_RANDOM </item>
+ <item> MCRYPT_DEV_URANDOM </item>
+ <item> MCRYPT_RAND </item>
+ <item> MCRYPT_3DES </item>
+ <item> MCRYPT_ARCFOUR_IV </item>
+ <item> MCRYPT_ARCFOUR </item>
+ <item> MCRYPT_BLOWFISH </item>
+ <item> MCRYPT_BLOWFISH_COMPAT </item>
+ <item> MCRYPT_CAST_128 </item>
+ <item> MCRYPT_CAST_256 </item>
+ <item> MCRYPT_CRYPT </item>
+ <item> MCRYPT_DES </item>
+ <item> MCRYPT_ENIGNA </item>
+ <item> MCRYPT_GOST </item>
+ <item> MCRYPT_LOKI97 </item>
+ <item> MCRYPT_PANAMA </item>
+ <item> MCRYPT_RC2 </item>
+ <item> MCRYPT_RIJNDAEL_128 </item>
+ <item> MCRYPT_RIJNDAEL_192 </item>
+ <item> MCRYPT_RIJNDAEL_256 </item>
+ <item> MCRYPT_SAFER64 </item>
+ <item> MCRYPT_SAFER128 </item>
+ <item> MCRYPT_SAFERPLUS </item>
+ <item> MCRYPT_SERPENT </item>
+ <item> MCRYPT_THREEWAY </item>
+ <item> MCRYPT_TRIPLEDES </item>
+ <item> MCRYPT_TWOFISH </item>
+ <item> MCRYPT_WAKE </item>
+ <item> MCRYPT_XTEA </item>
+ <item> MCRYPT_IDEA </item>
+ <item> MCRYPT_MARS </item>
+ <item> MCRYPT_RC6 </item>
+ <item> MCRYPT_SKIPJACK </item>
+ <item> MCRYPT_MODE_CBC </item>
+ <item> MCRYPT_MODE_CFB </item>
+ <item> MCRYPT_MODE_ECB </item>
+ <item> MCRYPT_MODE_NOFB </item>
+ <item> MCRYPT_MODE_OFB </item>
+ <item> MCRYPT_MODE_STREAM </item>
+ <item> MHASH_CRC32 </item>
+ <item> MHASH_MD5 </item>
+ <item> MHASH_SHA1 </item>
+ <item> MHASH_HAVAL256 </item>
+ <item> MHASH_RIPEMD160 </item>
+ <item> MHASH_TIGER </item>
+ <item> MHASH_GOST </item>
+ <item> MHASH_CRC32B </item>
+ <item> MHASH_HAVAL224 </item>
+ <item> MHASH_HAVAL192 </item>
+ <item> MHASH_HAVAL160 </item>
+ <item> MHASH_HAVAL128 </item>
+ <item> MHASH_TIGER128 </item>
+ <item> MHASH_TIGER160 </item>
+ <item> MHASH_MD4 </item>
+ <item> MHASH_SHA256 </item>
+ <item> MHASH_ADLER32 </item>
+ <item> MHASH_SHA224 </item>
+ <item> MHASH_SHA512 </item>
+ <item> MHASH_SHA384 </item>
+ <item> MHASH_WHIRLPOOL </item>
+ <item> MHASH_RIPEMD128 </item>
+ <item> MHASH_RIPEMD256 </item>
+ <item> MHASH_RIPEMD320 </item>
+ <item> MHASH_SNEFRU128 </item>
+ <item> MHASH_SNEFRU256 </item>
+ <item> MHASH_MD2 </item>
+ <item> MYSQL_ASSOC </item>
+ <item> MYSQL_NUM </item>
+ <item> MYSQL_BOTH </item>
+ <item> MYSQL_CLIENT_COMPRESS </item>
+ <item> MYSQL_CLIENT_SSL </item>
+ <item> MYSQL_CLIENT_INTERACTIVE </item>
+ <item> MYSQL_CLIENT_IGNORE_SPACE </item>
+ <item> MYSQLI_READ_DEFAULT_GROUP </item>
+ <item> MYSQLI_READ_DEFAULT_FILE </item>
+ <item> MYSQLI_OPT_CONNECT_TIMEOUT </item>
+ <item> MYSQLI_OPT_LOCAL_INFILE </item>
+ <item> MYSQLI_INIT_COMMAND </item>
+ <item> MYSQLI_CLIENT_SSL </item>
+ <item> MYSQLI_CLIENT_COMPRESS </item>
+ <item> MYSQLI_CLIENT_INTERACTIVE </item>
+ <item> MYSQLI_CLIENT_IGNORE_SPACE </item>
+ <item> MYSQLI_CLIENT_NO_SCHEMA </item>
+ <item> MYSQLI_CLIENT_FOUND_ROWS </item>
+ <item> MYSQLI_STORE_RESULT </item>
+ <item> MYSQLI_USE_RESULT </item>
+ <item> MYSQLI_ASSOC </item>
+ <item> MYSQLI_NUM </item>
+ <item> MYSQLI_BOTH </item>
+ <item> MYSQLI_STMT_ATTR_UPDATE_MAX_LENGTH </item>
+ <item> MYSQLI_NOT_NULL_FLAG </item>
+ <item> MYSQLI_PRI_KEY_FLAG </item>
+ <item> MYSQLI_UNIQUE_KEY_FLAG </item>
+ <item> MYSQLI_MULTIPLE_KEY_FLAG </item>
+ <item> MYSQLI_BLOB_FLAG </item>
+ <item> MYSQLI_UNSIGNED_FLAG </item>
+ <item> MYSQLI_ZEROFILL_FLAG </item>
+ <item> MYSQLI_AUTO_INCREMENT_FLAG </item>
+ <item> MYSQLI_TIMESTAMP_FLAG </item>
+ <item> MYSQLI_SET_FLAG </item>
+ <item> MYSQLI_NUM_FLAG </item>
+ <item> MYSQLI_PART_KEY_FLAG </item>
+ <item> MYSQLI_GROUP_FLAG </item>
+ <item> MYSQLI_TYPE_DECIMAL </item>
+ <item> MYSQLI_TYPE_TINY </item>
+ <item> MYSQLI_TYPE_SHORT </item>
+ <item> MYSQLI_TYPE_LONG </item>
+ <item> MYSQLI_TYPE_FLOAT </item>
+ <item> MYSQLI_TYPE_DOUBLE </item>
+ <item> MYSQLI_TYPE_NULL </item>
+ <item> MYSQLI_TYPE_TIMESTAMP </item>
+ <item> MYSQLI_TYPE_LONGLONG </item>
+ <item> MYSQLI_TYPE_INT24 </item>
+ <item> MYSQLI_TYPE_DATE </item>
+ <item> MYSQLI_TYPE_TIME </item>
+ <item> MYSQLI_TYPE_DATETIME </item>
+ <item> MYSQLI_TYPE_YEAR </item>
+ <item> MYSQLI_TYPE_NEWDATE </item>
+ <item> MYSQLI_TYPE_ENUM </item>
+ <item> MYSQLI_TYPE_SET </item>
+ <item> MYSQLI_TYPE_TINY_BLOB </item>
+ <item> MYSQLI_TYPE_MEDIUM_BLOB </item>
+ <item> MYSQLI_TYPE_LONG_BLOB </item>
+ <item> MYSQLI_TYPE_BLOB </item>
+ <item> MYSQLI_TYPE_VAR_STRING </item>
+ <item> MYSQLI_TYPE_STRING </item>
+ <item> MYSQLI_TYPE_CHAR </item>
+ <item> MYSQLI_TYPE_INTERVAL </item>
+ <item> MYSQLI_TYPE_GEOMETRY </item>
+ <item> MYSQLI_RPL_MASTER </item>
+ <item> MYSQLI_RPL_SLAVE </item>
+ <item> MYSQLI_RPL_ADMIN </item>
+ <item> MYSQLI_NO_DATA </item>
+ <item> MYSQLI_REPORT_INDEX </item>
+ <item> MYSQLI_REPORT_ERROR </item>
+ <item> MYSQLI_REPORT_ALL </item>
+ <item> MYSQLI_REPORT_OFF </item>
+ <item> NCURSES_COLOR_BLACK </item>
+ <item> NCURSES_COLOR_RED </item>
+ <item> NCURSES_COLOR_GREEN </item>
+ <item> NCURSES_COLOR_YELLOW </item>
+ <item> NCURSES_COLOR_BLUE </item>
+ <item> NCURSES_COLOR_MAGENTA </item>
+ <item> NCURSES_COLOR_CYAN </item>
+ <item> NCURSES_COLOR_WHITE </item>
+ <item> NCURSES_KEY_DOWN </item>
+ <item> NCURSES_KEY_UP </item>
+ <item> NCURSES_KEY_LEFT </item>
+ <item> NCURSES_KEY_RIGHT </item>
+ <item> NCURSES_KEY_BACKSPACE </item>
+ <item> NCURSES_KEY_MOUSE </item>
+ <item> NCURSES_KEY_F0 </item>
+ <item> NCURSES_KEY_F1 </item>
+ <item> NCURSES_KEY_F2 </item>
+ <item> NCURSES_KEY_F3 </item>
+ <item> NCURSES_KEY_F4 </item>
+ <item> NCURSES_KEY_F5 </item>
+ <item> NCURSES_KEY_F6 </item>
+ <item> NCURSES_KEY_F7 </item>
+ <item> NCURSES_KEY_F8 </item>
+ <item> NCURSES_KEY_F9 </item>
+ <item> NCURSES_KEY_F10 </item>
+ <item> NCURSES_KEY_F11 </item>
+ <item> NCURSES_KEY_F12 </item>
+ <item> NCURSES_KEY_DL </item>
+ <item> NCURSES_KEY_IL </item>
+ <item> NCURSES_KEY_DC </item>
+ <item> NCURSES_KEY_IC </item>
+ <item> NCURSES_KEY_EIC </item>
+ <item> NCURSES_KEY_CLEAR </item>
+ <item> NCURSES_KEY_EOS </item>
+ <item> NCURSES_KEY_EOL </item>
+ <item> NCURSES_KEY_SF </item>
+ <item> NCURSES_KEY_SR </item>
+ <item> NCURSES_KEY_NPAGE </item>
+ <item> NCURSES_KEY_PPAGE </item>
+ <item> NCURSES_KEY_STAB </item>
+ <item> NCURSES_KEY_CTAB </item>
+ <item> NCURSES_KEY_CATAB </item>
+ <item> NCURSES_KEY_ENTER </item>
+ <item> NCURSES_KEY_SRESET </item>
+ <item> NCURSES_KEY_RESET </item>
+ <item> NCURSES_KEY_PRINT </item>
+ <item> NCURSES_KEY_LL </item>
+ <item> NCURSES_KEY_A1 </item>
+ <item> NCURSES_KEY_A3 </item>
+ <item> NCURSES_KEY_B2 </item>
+ <item> NCURSES_KEY_C1 </item>
+ <item> NCURSES_KEY_C3 </item>
+ <item> NCURSES_KEY_BTAB </item>
+ <item> NCURSES_KEY_BEG </item>
+ <item> NCURSES_KEY_CANCEL </item>
+ <item> NCURSES_KEY_CLOSE </item>
+ <item> NCURSES_KEY_COMMAND </item>
+ <item> NCURSES_KEY_COPY </item>
+ <item> NCURSES_KEY_CREATE </item>
+ <item> NCURSES_KEY_END </item>
+ <item> NCURSES_KEY_EXIT </item>
+ <item> NCURSES_KEY_FIND </item>
+ <item> NCURSES_KEY_HELP </item>
+ <item> NCURSES_KEY_MARK </item>
+ <item> NCURSES_KEY_MESSAGE </item>
+ <item> NCURSES_KEY_MOVE </item>
+ <item> NCURSES_KEY_NEXT </item>
+ <item> NCURSES_KEY_OPEN </item>
+ <item> NCURSES_KEY_OPTIONS </item>
+ <item> NCURSES_KEY_PREVIOUS </item>
+ <item> NCURSES_KEY_REDO </item>
+ <item> NCURSES_KEY_REFERENCE </item>
+ <item> NCURSES_KEY_REFRESH </item>
+ <item> NCURSES_KEY_REPLACE </item>
+ <item> NCURSES_KEY_RESTART </item>
+ <item> NCURSES_KEY_RESUME </item>
+ <item> NCURSES_KEY_SAVE </item>
+ <item> NCURSES_KEY_SBEG </item>
+ <item> NCURSES_KEY_SCANCEL </item>
+ <item> NCURSES_KEY_SCOMMAND </item>
+ <item> NCURSES_KEY_SCOPY </item>
+ <item> NCURSES_KEY_SCREATE </item>
+ <item> NCURSES_KEY_SDC </item>
+ <item> NCURSES_KEY_SDL </item>
+ <item> NCURSES_KEY_SELECT </item>
+ <item> NCURSES_KEY_SEND </item>
+ <item> NCURSES_KEY_SEOL </item>
+ <item> NCURSES_KEY_SEXIT </item>
+ <item> NCURSES_KEY_SFIND </item>
+ <item> NCURSES_KEY_SHELP </item>
+ <item> NCURSES_KEY_SHOME </item>
+ <item> NCURSES_KEY_SIC </item>
+ <item> NCURSES_KEY_SLEFT </item>
+ <item> NCURSES_KEY_SMESSAGE </item>
+ <item> NCURSES_KEY_SMOVE </item>
+ <item> NCURSES_KEY_SNEXT </item>
+ <item> NCURSES_KEY_SOPTIONS </item>
+ <item> NCURSES_KEY_SPREVIOUS </item>
+ <item> NCURSES_KEY_SPRINT </item>
+ <item> NCURSES_KEY_SREDO </item>
+ <item> NCURSES_KEY_SREPLACE </item>
+ <item> NCURSES_KEY_SRIGHT </item>
+ <item> NCURSES_KEY_SRSUME </item>
+ <item> NCURSES_KEY_SSAVE </item>
+ <item> NCURSES_KEY_SSUSPEND </item>
+ <item> NCURSES_KEY_SUNDO </item>
+ <item> NCURSES_KEY_SUSPEND </item>
+ <item> NCURSES_KEY_UNDO </item>
+ <item> NCURSES_KEY_RESIZE </item>
+ <item> NCURSES_A_NORMAL </item>
+ <item> NCURSES_A_STANDOUT </item>
+ <item> NCURSES_A_UNDERLINE </item>
+ <item> NCURSES_A_REVERSE </item>
+ <item> NCURSES_A_BLINK </item>
+ <item> NCURSES_A_DIM </item>
+ <item> NCURSES_A_BOLD </item>
+ <item> NCURSES_A_PROTECT </item>
+ <item> NCURSES_A_INVIS </item>
+ <item> NCURSES_A_ALTCHARSET </item>
+ <item> NCURSES_A_CHARTEXT </item>
+ <item> NCURSES_BUTTON1_PRESSED </item>
+ <item> NCURSES_BUTTON1_RELEASED </item>
+ <item> NCURSES_BUTTON1_CLICKED </item>
+ <item> NCURSES_BUTTON1_DOUBLE_CLICKED </item>
+ <item> NCURSES_BUTTON1_TRIPLE_CLICKED </item>
+ <item> NCURSES_BUTTON2_PRESSED </item>
+ <item> NCURSES_BUTTON2_RELEASED </item>
+ <item> NCURSES_BUTTON2_CLICKED </item>
+ <item> NCURSES_BUTTON2_DOUBLE_CLICKED </item>
+ <item> NCURSES_BUTTON2_TRIPLE_CLICKED </item>
+ <item> NCURSES_BUTTON3_PRESSED </item>
+ <item> NCURSES_BUTTON3_RELEASED </item>
+ <item> NCURSES_BUTTON3_CLICKED </item>
+ <item> NCURSES_BUTTON3_DOUBLE_CLICKED </item>
+ <item> NCURSES_BUTTON3_TRIPLE_CLICKED </item>
+ <item> NCURSES_BUTTON4_PRESSED </item>
+ <item> NCURSES_BUTTON4_RELEASED </item>
+ <item> NCURSES_BUTTON4_CLICKED </item>
+ <item> NCURSES_BUTTON4_DOUBLE_CLICKED </item>
+ <item> NCURSES_BUTTON4_TRIPLE_CLICKED </item>
+ <item> NCURSES_BUTTON_SHIFT </item>
+ <item> NCURSES_BUTTON_CTRL </item>
+ <item> NCURSES_BUTTON_ALT </item>
+ <item> NCURSES_ALL_MOUSE_EVENTS </item>
+ <item> NCURSES_REPORT_MOUSE_POSITION </item>
+ <item> ODBC_TYPE </item>
+ <item> ODBC_BINMODE_PASSTHRU </item>
+ <item> ODBC_BINMODE_RETURN </item>
+ <item> ODBC_BINMODE_CONVERT </item>
+ <item> SQL_ODBC_CURSORS </item>
+ <item> SQL_CUR_USE_DRIVER </item>
+ <item> SQL_CUR_USE_IF_NEEDED </item>
+ <item> SQL_CUR_USE_ODBC </item>
+ <item> SQL_CONCURRENCY </item>
+ <item> SQL_CONCUR_READ_ONLY </item>
+ <item> SQL_CONCUR_LOCK </item>
+ <item> SQL_CONCUR_ROWVER </item>
+ <item> SQL_CONCUR_VALUES </item>
+ <item> SQL_CURSOR_TYPE </item>
+ <item> SQL_CURSOR_FORWARD_ONLY </item>
+ <item> SQL_CURSOR_KEYSET_DRIVEN </item>
+ <item> SQL_CURSOR_DYNAMIC </item>
+ <item> SQL_CURSOR_STATIC </item>
+ <item> SQL_KEYSET_SIZE </item>
+ <item> SQL_FETCH_FIRST </item>
+ <item> SQL_FETCH_NEXT </item>
+ <item> SQL_CHAR </item>
+ <item> SQL_VARCHAR </item>
+ <item> SQL_LONGVARCHAR </item>
+ <item> SQL_DECIMAL </item>
+ <item> SQL_NUMERIC </item>
+ <item> SQL_BIT </item>
+ <item> SQL_TINYINT </item>
+ <item> SQL_SMALLINT </item>
+ <item> SQL_INTEGER </item>
+ <item> SQL_BIGINT </item>
+ <item> SQL_REAL </item>
+ <item> SQL_FLOAT </item>
+ <item> SQL_DOUBLE </item>
+ <item> SQL_BINARY </item>
+ <item> SQL_VARBINARY </item>
+ <item> SQL_LONGVARBINARY </item>
+ <item> SQL_DATE </item>
+ <item> SQL_TIME </item>
+ <item> SQL_TIMESTAMP </item>
+ <item> X509_PURPOSE_SSL_CLIENT </item>
+ <item> X509_PURPOSE_SSL_SERVER </item>
+ <item> X509_PURPOSE_NS_SSL_SERVER </item>
+ <item> X509_PURPOSE_SMIME_SIGN </item>
+ <item> X509_PURPOSE_SMIME_ENCRYPT </item>
+ <item> X509_PURPOSE_CRL_SIGN </item>
+ <item> X509_PURPOSE_ANY </item>
+ <item> OPENSSL_ALGO_SHA1 </item>
+ <item> OPENSSL_ALGO_MD5 </item>
+ <item> OPENSSL_ALGO_MD4 </item>
+ <item> OPENSSL_ALGO_MD2 </item>
+ <item> PKCS7_DETACHED </item>
+ <item> PKCS7_TEXT </item>
+ <item> PKCS7_NOINTERN </item>
+ <item> PKCS7_NOVERIFY </item>
+ <item> PKCS7_NOCHAIN </item>
+ <item> PKCS7_NOCERTS </item>
+ <item> PKCS7_NOATTR </item>
+ <item> PKCS7_BINARY </item>
+ <item> PKCS7_NOSIGS </item>
+ <item> OPENSSL_PKCS1_PADDING </item>
+ <item> OPENSSL_SSLV23_PADDING </item>
+ <item> OPENSSL_NO_PADDING </item>
+ <item> OPENSSL_PKCS1_OAEP_PADDING </item>
+ <item> OPENSSL_CIPHER_RC2_40 </item>
+ <item> OPENSSL_CIPHER_RC2_128 </item>
+ <item> OPENSSL_CIPHER_RC2_64 </item>
+ <item> OPENSSL_CIPHER_DES </item>
+ <item> OPENSSL_CIPHER_3DES </item>
+ <item> OPENSSL_KEYTYPE_RSA </item>
+ <item> OPENSSL_KEYTYPE_DSA </item>
+ <item> OPENSSL_KEYTYPE_DH </item>
+ <item> WNOHANG </item>
+ <item> WUNTRACED </item>
+ <item> SIG_IGN </item>
+ <item> SIG_DFL </item>
+ <item> SIG_ERR </item>
+ <item> SIGHUP </item>
+ <item> SIGINT </item>
+ <item> SIGQUIT </item>
+ <item> SIGILL </item>
+ <item> SIGTRAP </item>
+ <item> SIGABRT </item>
+ <item> SIGIOT </item>
+ <item> SIGBUS </item>
+ <item> SIGFPE </item>
+ <item> SIGKILL </item>
+ <item> SIGUSR1 </item>
+ <item> SIGSEGV </item>
+ <item> SIGUSR2 </item>
+ <item> SIGPIPE </item>
+ <item> SIGALRM </item>
+ <item> SIGTERM </item>
+ <item> SIGSTKFLT </item>
+ <item> SIGCLD </item>
+ <item> SIGCHLD </item>
+ <item> SIGCONT </item>
+ <item> SIGSTOP </item>
+ <item> SIGTSTP </item>
+ <item> SIGTTIN </item>
+ <item> SIGTTOU </item>
+ <item> SIGURG </item>
+ <item> SIGXCPU </item>
+ <item> SIGXFSZ </item>
+ <item> SIGVTALRM </item>
+ <item> SIGPROF </item>
+ <item> SIGWINCH </item>
+ <item> SIGPOLL </item>
+ <item> SIGIO </item>
+ <item> SIGPWR </item>
+ <item> SIGSYS </item>
+ <item> SIGBABY </item>
+ <item> PRIO_PGRP </item>
+ <item> PRIO_USER </item>
+ <item> PRIO_PROCESS </item>
+ <item> PGSQL_CONNECT_FORCE_NEW </item>
+ <item> PGSQL_ASSOC </item>
+ <item> PGSQL_NUM </item>
+ <item> PGSQL_BOTH </item>
+ <item> PGSQL_CONNECTION_BAD </item>
+ <item> PGSQL_CONNECTION_OK </item>
+ <item> PGSQL_SEEK_SET </item>
+ <item> PGSQL_SEEK_CUR </item>
+ <item> PGSQL_SEEK_END </item>
+ <item> PGSQL_STATUS_LONG </item>
+ <item> PGSQL_STATUS_STRING </item>
+ <item> PGSQL_EMPTY_QUERY </item>
+ <item> PGSQL_COMMAND_OK </item>
+ <item> PGSQL_TUPLES_OK </item>
+ <item> PGSQL_COPY_OUT </item>
+ <item> PGSQL_COPY_IN </item>
+ <item> PGSQL_BAD_RESPONSE </item>
+ <item> PGSQL_NONFATAL_ERROR </item>
+ <item> PGSQL_FATAL_ERROR </item>
+ <item> PGSQL_CONV_IGNORE_DEFAULT </item>
+ <item> PGSQL_CONV_FORCE_NULL </item>
+ <item> PGSQL_CONV_IGNORE_NOT_NULL </item>
+ <item> PGSQL_DML_NO_CONV </item>
+ <item> PGSQL_DML_EXEC </item>
+ <item> PGSQL_DML_ASYNC </item>
+ <item> PGSQL_DML_STRING </item>
+ <item> SNMP_VALUE_LIBRARY </item>
+ <item> SNMP_VALUE_PLAIN </item>
+ <item> SNMP_VALUE_OBJECT </item>
+ <item> SNMP_BIT_STR </item>
+ <item> SNMP_OCTET_STR </item>
+ <item> SNMP_OPAQUE </item>
+ <item> SNMP_NULL </item>
+ <item> SNMP_OBJECT_ID </item>
+ <item> SNMP_IPADDRESS </item>
+ <item> SNMP_COUNTER </item>
+ <item> SNMP_UNSIGNED </item>
+ <item> SNMP_TIMETICKS </item>
+ <item> SNMP_UINTEGER </item>
+ <item> SNMP_INTEGER </item>
+ <item> SNMP_COUNTER64 </item>
+ <item> SOAP_1_1 </item>
+ <item> SOAP_1_2 </item>
+ <item> SOAP_PERSISTENCE_SESSION </item>
+ <item> SOAP_PERSISTENCE_REQUEST </item>
+ <item> SOAP_FUNCTIONS_ALL </item>
+ <item> SOAP_ENCODED </item>
+ <item> SOAP_LITERAL </item>
+ <item> SOAP_RPC </item>
+ <item> SOAP_DOCUMENT </item>
+ <item> SOAP_ACTOR_NEXT </item>
+ <item> SOAP_ACTOR_NONE </item>
+ <item> SOAP_ACTOR_UNLIMATERECEIVER </item>
+ <item> SOAP_COMPRESSION_ACCEPT </item>
+ <item> SOAP_COMPRESSION_GZIP </item>
+ <item> SOAP_COMPRESSION_DEFLATE </item>
+ <item> UNKNOWN_TYPE </item>
+ <item> XSD_STRING </item>
+ <item> XSD_BOOLEAN </item>
+ <item> XSD_DECIMAL </item>
+ <item> XSD_FLOAT </item>
+ <item> XSD_DOUBLE </item>
+ <item> XSD_DURATION </item>
+ <item> XSD_DATETIME </item>
+ <item> XSD_TIME </item>
+ <item> XSD_DATE </item>
+ <item> XSD_GYEARMONTH </item>
+ <item> XSD_GYEAR </item>
+ <item> XSD_GMONTHDAY </item>
+ <item> XSD_GDAY </item>
+ <item> XSD_GMONTH </item>
+ <item> XSD_HEXBINARY </item>
+ <item> XSD_BASE64BINARY </item>
+ <item> XSD_ANYURI </item>
+ <item> XSD_QNAME </item>
+ <item> XSD_NOTATION </item>
+ <item> XSD_NORMALIZEDSTRING </item>
+ <item> XSD_TOKEN </item>
+ <item> XSD_LANGUAGE </item>
+ <item> XSD_NMTOKEN </item>
+ <item> XSD_NAME </item>
+ <item> XSD_NCNAME </item>
+ <item> XSD_ID </item>
+ <item> XSD_IDREF </item>
+ <item> XSD_IDREFS </item>
+ <item> XSD_ENTITY </item>
+ <item> XSD_ENTITIES </item>
+ <item> XSD_INTEGER </item>
+ <item> XSD_NONPOSITIVEINTEGER </item>
+ <item> XSD_NEGATIVEINTEGER </item>
+ <item> XSD_LONG </item>
+ <item> XSD_INT </item>
+ <item> XSD_SHORT </item>
+ <item> XSD_BYTE </item>
+ <item> XSD_NONNEGATIVEINTEGER </item>
+ <item> XSD_UNSIGNEDLONG </item>
+ <item> XSD_UNSIGNEDINT </item>
+ <item> XSD_UNSIGNEDSHORT </item>
+ <item> XSD_UNSIGNEDBYTE </item>
+ <item> XSD_POSITIVEINTEGER </item>
+ <item> XSD_NMTOKENS </item>
+ <item> XSD_ANYTYPE </item>
+ <item> SOAP_ENC_OBJECT </item>
+ <item> SOAP_ENC_ARRAY </item>
+ <item> XSD_1999_TIMEINSTANT </item>
+ <item> XSD_NAMESPACE </item>
+ <item> XSD_1999_NAMESPACE </item>
+ <item> AF_UNIX </item>
+ <item> AF_INET </item>
+ <item> AF_INET6 </item>
+ <item> SOCK_STREAM </item>
+ <item> SOCK_DGRAM </item>
+ <item> SOCK_RAW </item>
+ <item> SOCK_SEQPACKET </item>
+ <item> SOCK_RDM </item>
+ <item> MSG_OOB </item>
+ <item> MSG_WAITALL </item>
+ <item> MSG_PEEK </item>
+ <item> MSG_DONTROUTE </item>
+ <item> SO_DEBUG </item>
+ <item> SO_REUSEADDR </item>
+ <item> SO_KEEPALIVE </item>
+ <item> SO_DONTROUTE </item>
+ <item> SO_LINGER </item>
+ <item> SO_BROADCAST </item>
+ <item> SO_OOBINLINE </item>
+ <item> SO_SNDBUF </item>
+ <item> SO_RCVBUF </item>
+ <item> SO_SNDLOWAT </item>
+ <item> SO_RCVLOWAT </item>
+ <item> SO_SNDTIMEO </item>
+ <item> SO_RCVTIMEO </item>
+ <item> SO_TYPE </item>
+ <item> SO_ERROR </item>
+ <item> SOL_SOCKET </item>
+ <item> SOMAXCONN </item>
+ <item> PHP_NORMAL_READ </item>
+ <item> PHP_BINARY_READ </item>
+ <item> SOCKET_EPERM </item>
+ <item> SOCKET_ENOENT </item>
+ <item> SOCKET_EINTR </item>
+ <item> SOCKET_EIO </item>
+ <item> SOCKET_ENXIO </item>
+ <item> SOCKET_E2BIG </item>
+ <item> SOCKET_EBADF </item>
+ <item> SOCKET_EAGAIN </item>
+ <item> SOCKET_ENOMEM </item>
+ <item> SOCKET_EACCES </item>
+ <item> SOCKET_EFAULT </item>
+ <item> SOCKET_ENOTBLK </item>
+ <item> SOCKET_EBUSY </item>
+ <item> SOCKET_EEXIST </item>
+ <item> SOCKET_EXDEV </item>
+ <item> SOCKET_ENODEV </item>
+ <item> SOCKET_ENOTDIR </item>
+ <item> SOCKET_EISDIR </item>
+ <item> SOCKET_EINVAL </item>
+ <item> SOCKET_ENFILE </item>
+ <item> SOCKET_EMFILE </item>
+ <item> SOCKET_ENOTTY </item>
+ <item> SOCKET_ENOSPC </item>
+ <item> SOCKET_ESPIPE </item>
+ <item> SOCKET_EROFS </item>
+ <item> SOCKET_EMLINK </item>
+ <item> SOCKET_EPIPE </item>
+ <item> SOCKET_ENAMETOOLONG </item>
+ <item> SOCKET_ENOLCK </item>
+ <item> SOCKET_ENOSYS </item>
+ <item> SOCKET_ENOTEMPTY </item>
+ <item> SOCKET_ELOOP </item>
+ <item> SOCKET_EWOULDBLOCK </item>
+ <item> SOCKET_ENOMSG </item>
+ <item> SOCKET_EIDRM </item>
+ <item> SOCKET_ECHRNG </item>
+ <item> SOCKET_EL2NSYNC </item>
+ <item> SOCKET_EL3HLT </item>
+ <item> SOCKET_EL3RST </item>
+ <item> SOCKET_ELNRNG </item>
+ <item> SOCKET_EUNATCH </item>
+ <item> SOCKET_ENOCSI </item>
+ <item> SOCKET_EL2HLT </item>
+ <item> SOCKET_EBADE </item>
+ <item> SOCKET_EBADR </item>
+ <item> SOCKET_EXFULL </item>
+ <item> SOCKET_ENOANO </item>
+ <item> SOCKET_EBADRQC </item>
+ <item> SOCKET_EBADSLT </item>
+ <item> SOCKET_ENOSTR </item>
+ <item> SOCKET_ENODATA </item>
+ <item> SOCKET_ETIME </item>
+ <item> SOCKET_ENOSR </item>
+ <item> SOCKET_ENONET </item>
+ <item> SOCKET_EREMOTE </item>
+ <item> SOCKET_ENOLINK </item>
+ <item> SOCKET_EADV </item>
+ <item> SOCKET_ESRMNT </item>
+ <item> SOCKET_ECOMM </item>
+ <item> SOCKET_EPROTO </item>
+ <item> SOCKET_EMULTIHOP </item>
+ <item> SOCKET_EBADMSG </item>
+ <item> SOCKET_ENOTUNIQ </item>
+ <item> SOCKET_EBADFD </item>
+ <item> SOCKET_EREMCHG </item>
+ <item> SOCKET_ERESTART </item>
+ <item> SOCKET_ESTRPIPE </item>
+ <item> SOCKET_EUSERS </item>
+ <item> SOCKET_ENOTSOCK </item>
+ <item> SOCKET_EDESTADDRREQ </item>
+ <item> SOCKET_EMSGSIZE </item>
+ <item> SOCKET_EPROTOTYPE </item>
+ <item> SOCKET_ENOPROTOOPT </item>
+ <item> SOCKET_EPROTONOSUPPORT </item>
+ <item> SOCKET_ESOCKTNOSUPPORT </item>
+ <item> SOCKET_EOPNOTSUPP </item>
+ <item> SOCKET_EPFNOSUPPORT </item>
+ <item> SOCKET_EAFNOSUPPORT </item>
+ <item> SOCKET_EADDRINUSE </item>
+ <item> SOCKET_EADDRNOTAVAIL </item>
+ <item> SOCKET_ENETDOWN </item>
+ <item> SOCKET_ENETUNREACH </item>
+ <item> SOCKET_ENETRESET </item>
+ <item> SOCKET_ECONNABORTED </item>
+ <item> SOCKET_ECONNRESET </item>
+ <item> SOCKET_ENOBUFS </item>
+ <item> SOCKET_EISCONN </item>
+ <item> SOCKET_ENOTCONN </item>
+ <item> SOCKET_ESHUTDOWN </item>
+ <item> SOCKET_ETOOMANYREFS </item>
+ <item> SOCKET_ETIMEDOUT </item>
+ <item> SOCKET_ECONNREFUSED </item>
+ <item> SOCKET_EHOSTDOWN </item>
+ <item> SOCKET_EHOSTUNREACH </item>
+ <item> SOCKET_EALREADY </item>
+ <item> SOCKET_EINPROGRESS </item>
+ <item> SOCKET_EISNAM </item>
+ <item> SOCKET_EREMOTEIO </item>
+ <item> SOCKET_EDQUOT </item>
+ <item> SOCKET_ENOMEDIUM </item>
+ <item> SOCKET_EMEDIUMTYPE </item>
+ <item> SOL_TCP </item>
+ <item> SOL_UDP </item>
+ <item> SQLITE_BOTH </item>
+ <item> SQLITE_NUM </item>
+ <item> SQLITE_ASSOC </item>
+ <item> SQLITE_OK </item>
+ <item> SQLITE_ERROR </item>
+ <item> SQLITE_INTERNAL </item>
+ <item> SQLITE_PERM </item>
+ <item> SQLITE_ABORT </item>
+ <item> SQLITE_BUSY </item>
+ <item> SQLITE_LOCKED </item>
+ <item> SQLITE_NOMEM </item>
+ <item> SQLITE_READONLY </item>
+ <item> SQLITE_INTERRUPT </item>
+ <item> SQLITE_IOERR </item>
+ <item> SQLITE_CORRUPT </item>
+ <item> SQLITE_NOTFOUND </item>
+ <item> SQLITE_FULL </item>
+ <item> SQLITE_CANTOPEN </item>
+ <item> SQLITE_PROTOCOL </item>
+ <item> SQLITE_EMPTY </item>
+ <item> SQLITE_SCHEMA </item>
+ <item> SQLITE_TOOBIG </item>
+ <item> SQLITE_CONSTRAINT </item>
+ <item> SQLITE_MISMATCH </item>
+ <item> SQLITE_MISUSE </item>
+ <item> SQLITE_NOLFS </item>
+ <item> SQLITE_AUTH </item>
+ <item> SQLITE_FORMAT </item>
+ <item> SQLITE_ROW </item>
+ <item> SQLITE_DONE </item>
+ <item> MSG_IPC_NOWAIT </item>
+ <item> MSG_NOERROR </item>
+ <item> MSG_EXCEPT </item>
+ <item> T_INCLUDE </item>
+ <item> T_INCLUDE_ONCE </item>
+ <item> T_EVAL </item>
+ <item> T_REQUIRE </item>
+ <item> T_REQUIRE_ONCE </item>
+ <item> T_LOGICAL_OR </item>
+ <item> T_LOGICAL_XOR </item>
+ <item> T_LOGICAL_AND </item>
+ <item> T_PRINT </item>
+ <item> T_PLUS_EQUAL </item>
+ <item> T_MINUS_EQUAL </item>
+ <item> T_MUL_EQUAL </item>
+ <item> T_DIV_EQUAL </item>
+ <item> T_CONCAT_EQUAL </item>
+ <item> T_MOD_EQUAL </item>
+ <item> T_AND_EQUAL </item>
+ <item> T_OR_EQUAL </item>
+ <item> T_XOR_EQUAL </item>
+ <item> T_SL_EQUAL </item>
+ <item> T_SR_EQUAL </item>
+ <item> T_BOOLEAN_OR </item>
+ <item> T_BOOLEAN_AND </item>
+ <item> T_IS_EQUAL </item>
+ <item> T_IS_NOT_EQUAL </item>
+ <item> T_IS_IDENTICAL </item>
+ <item> T_IS_NOT_IDENTICAL </item>
+ <item> T_IS_SMALLER_OR_EQUAL </item>
+ <item> T_IS_GREATER_OR_EQUAL </item>
+ <item> T_SL </item>
+ <item> T_SR </item>
+ <item> T_INC </item>
+ <item> T_DEC </item>
+ <item> T_INT_CAST </item>
+ <item> T_DOUBLE_CAST </item>
+ <item> T_STRING_CAST </item>
+ <item> T_ARRAY_CAST </item>
+ <item> T_OBJECT_CAST </item>
+ <item> T_BOOL_CAST </item>
+ <item> T_UNSET_CAST </item>
+ <item> T_NEW </item>
+ <item> T_EXIT </item>
+ <item> T_IF </item>
+ <item> T_ELSEIF </item>
+ <item> T_ELSE </item>
+ <item> T_ENDIF </item>
+ <item> T_LNUMBER </item>
+ <item> T_DNUMBER </item>
+ <item> T_STRING </item>
+ <item> T_STRING_VARNAME </item>
+ <item> T_VARIABLE </item>
+ <item> T_NUM_STRING </item>
+ <item> T_INLINE_HTML </item>
+ <item> T_CHARACTER </item>
+ <item> T_BAD_CHARACTER </item>
+ <item> T_ENCAPSED_AND_WHITESPACE </item>
+ <item> T_CONSTANT_ENCAPSED_STRING </item>
+ <item> T_ECHO </item>
+ <item> T_DO </item>
+ <item> T_WHILE </item>
+ <item> T_ENDWHILE </item>
+ <item> T_FOR </item>
+ <item> T_ENDFOR </item>
+ <item> T_FOREACH </item>
+ <item> T_ENDFOREACH </item>
+ <item> T_DECLARE </item>
+ <item> T_ENDDECLARE </item>
+ <item> T_AS </item>
+ <item> T_SWITCH </item>
+ <item> T_ENDSWITCH </item>
+ <item> T_CASE </item>
+ <item> T_DEFAULT </item>
+ <item> T_BREAK </item>
+ <item> T_CONTINUE </item>
+ <item> T_FUNCTION </item>
+ <item> T_CONST </item>
+ <item> T_RETURN </item>
+ <item> T_USE </item>
+ <item> T_GLOBAL </item>
+ <item> T_STATIC </item>
+ <item> T_VAR </item>
+ <item> T_UNSET </item>
+ <item> T_ISSET </item>
+ <item> T_EMPTY </item>
+ <item> T_CLASS </item>
+ <item> T_EXTENDS </item>
+ <item> T_INTERFACE </item>
+ <item> T_IMPLEMENTS </item>
+ <item> T_OBJECT_OPERATOR </item>
+ <item> T_DOUBLE_ARROW </item>
+ <item> T_LIST </item>
+ <item> T_ARRAY </item>
+ <item> T_CLASS_C </item>
+ <item> T_FUNC_C </item>
+ <item> T_METHOD_C </item>
+ <item> T_LINE </item>
+ <item> T_FILE </item>
+ <item> T_COMMENT </item>
+ <item> T_DOC_COMMENT </item>
+ <item> T_OPEN_TAG </item>
+ <item> T_OPEN_TAG_WITH_ECHO </item>
+ <item> T_CLOSE_TAG </item>
+ <item> T_WHITESPACE </item>
+ <item> T_START_HEREDOC </item>
+ <item> T_END_HEREDOC </item>
+ <item> T_DOLLAR_OPEN_CURLY_BRACES </item>
+ <item> T_CURLY_OPEN </item>
+ <item> T_PAAMAYIM_NEKUDOTAYIM </item>
+ <item> T_DOUBLE_COLON </item>
+ <item> T_ABSTRACT </item>
+ <item> T_CATCH </item>
+ <item> T_FINAL </item>
+ <item> T_INSTANCEOF </item>
+ <item> T_PRIVATE </item>
+ <item> T_PROTECTED </item>
+ <item> T_PUBLIC </item>
+ <item> T_THROW </item>
+ <item> T_TRY </item>
+ <item> T_CLONE </item>
+ <item> XSL_CLONE_AUTO </item>
+ <item> XSL_CLONE_NEVER </item>
+ <item> XSL_CLONE_ALWAYS </item>
+ <item> YPERR_BADARGS </item>
+ <item> YPERR_BADDB </item>
+ <item> YPERR_BUSY </item>
+ <item> YPERR_DOMAIN </item>
+ <item> YPERR_KEY </item>
+ <item> YPERR_MAP </item>
+ <item> YPERR_NODOM </item>
+ <item> YPERR_NOMORE </item>
+ <item> YPERR_PMAP </item>
+ <item> YPERR_RESRC </item>
+ <item> YPERR_RPC </item>
+ <item> YPERR_YPBIND </item>
+ <item> YPERR_YPERR </item>
+ <item> YPERR_YPSERV </item>
+ <item> YPERR_VERS </item>
+ <item> FORCE_GZIP </item>
+ <item> FORCE_DEFLATE </item>
+ <item> E_ERROR </item>
+ <item> E_WARNING </item>
+ <item> E_PARSE </item>
+ <item> E_NOTICE </item>
+ <item> E_STRICT </item>
+ <item> E_CORE_ERROR </item>
+ <item> E_CORE_WARNING </item>
+ <item> E_COMPILE_ERROR </item>
+ <item> E_COMPILE_WARNING </item>
+ <item> E_USER_ERROR </item>
+ <item> E_USER_WARNING </item>
+ <item> E_USER_NOTICE </item>
+ <item> E_ALL </item>
+ <item> TRUE </item>
+ <item> FALSE </item>
+ <item> ZEND_THREAD_SAFE </item>
+ <item> NULL </item>
+ <item> PHP_VERSION </item>
+ <item> PHP_OS </item>
+ <item> PHP_SAPI </item>
+ <item> DEFAULT_INCLUDE_PATH </item>
+ <item> PEAR_INSTALL_DIR </item>
+ <item> PEAR_EXTENSION_DIR </item>
+ <item> PHP_EXTENSION_DIR </item>
+ <item> PHP_PREFIX </item>
+ <item> PHP_BINDIR </item>
+ <item> PHP_LIBDIR </item>
+ <item> PHP_DATADIR </item>
+ <item> PHP_SYSCONFDIR </item>
+ <item> PHP_LOCALSTATEDIR </item>
+ <item> PHP_CONFIG_FILE_PATH </item>
+ <item> PHP_CONFIG_FILE_SCAN_DIR </item>
+ <item> PHP_SHLIB_SUFFIX </item>
+ <item> PHP_EOL </item>
+ <item> PHP_OUTPUT_HANDLER_START </item>
+ <item> PHP_OUTPUT_HANDLER_CONT </item>
+ <item> PHP_OUTPUT_HANDLER_END </item>
+ <item> UPLOAD_ERR_OK </item>
+ <item> UPLOAD_ERR_INI_SIZE </item>
+ <item> UPLOAD_ERR_FORM_SIZE </item>
+ <item> UPLOAD_ERR_PARTIAL </item>
+ <item> UPLOAD_ERR_NO_FILE </item>
+ <item> UPLOAD_ERR_NO_TMP_DIR </item>
+ <item> P_STATIC </item>
+ <item> P_PUBLIC </item>
+ <item> P_PROTECTED </item>
+ <item> P_PRIVATE </item>
+ <item> M_STATIC </item>
+ <item> M_PUBLIC </item>
+ <item> M_PROTECTED </item>
+ <item> M_PRIVATE </item>
+ <item> M_ABSTRACT </item>
+ <item> M_FINAL </item>
+ <item> C_IMPLICIT_ABSTRACT </item>
+ <item> C_EXPLICIT_ABSTRACT </item>
+ <item> C_FINAL </item>
+ <item> XML_ERROR_NONE </item>
+ <item> XML_ERROR_NO_MEMORY </item>
+ <item> XML_ERROR_SYNTAX </item>
+ <item> XML_ERROR_NO_ELEMENTS </item>
+ <item> XML_ERROR_INVALID_TOKEN </item>
+ <item> XML_ERROR_UNCLOSED_TOKEN </item>
+ <item> XML_ERROR_PARTIAL_CHAR </item>
+ <item> XML_ERROR_TAG_MISMATCH </item>
+ <item> XML_ERROR_DUPLICATE_ATTRIBUTE </item>
+ <item> XML_ERROR_JUNK_AFTER_DOC_ELEMENT </item>
+ <item> XML_ERROR_PARAM_ENTITY_REF </item>
+ <item> XML_ERROR_UNDEFINED_ENTITY </item>
+ <item> XML_ERROR_RECURSIVE_ENTITY_REF </item>
+ <item> XML_ERROR_ASYNC_ENTITY </item>
+ <item> XML_ERROR_BAD_CHAR_REF </item>
+ <item> XML_ERROR_BINARY_ENTITY_REF </item>
+ <item> XML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF </item>
+ <item> XML_ERROR_MISPLACED_XML_PI </item>
+ <item> XML_ERROR_UNKNOWN_ENCODING </item>
+ <item> XML_ERROR_INCORRECT_ENCODING </item>
+ <item> XML_ERROR_UNCLOSED_CDATA_SECTION </item>
+ <item> XML_ERROR_EXTERNAL_ENTITY_HANDLING </item>
+ <item> XML_OPTION_CASE_FOLDING </item>
+ <item> XML_OPTION_TARGET_ENCODING </item>
+ <item> XML_OPTION_SKIP_TAGSTART </item>
+ <item> XML_OPTION_SKIP_WHITE </item>
+ <item> XML_SAX_IMPL </item>
+ <item> CONNECTION_ABORTED </item>
+ <item> CONNECTION_NORMAL </item>
+ <item> CONNECTION_TIMEOUT </item>
+ <item> INI_USER </item>
+ <item> INI_PERDIR </item>
+ <item> INI_SYSTEM </item>
+ <item> INI_ALL </item>
+ <item> SUNFUNCS_RET_TIMESTAMP </item>
+ <item> SUNFUNCS_RET_STRING </item>
+ <item> SUNFUNCS_RET_DOUBLE </item>
+ <item> M_E </item>
+ <item> M_LOG2E </item>
+ <item> M_LOG10E </item>
+ <item> M_LN2 </item>
+ <item> M_LN10 </item>
+ <item> M_PI </item>
+ <item> M_PI_2 </item>
+ <item> M_PI_4 </item>
+ <item> M_1_PI </item>
+ <item> M_2_PI </item>
+ <item> M_2_SQRTPI </item>
+ <item> M_SQRT2 </item>
+ <item> M_SQRT1_2 </item>
+ <item> INF </item>
+ <item> NAN </item>
+ <item> INFO_GENERAL </item>
+ <item> INFO_CREDITS </item>
+ <item> INFO_CONFIGURATION </item>
+ <item> INFO_MODULES </item>
+ <item> INFO_ENVIRONMENT </item>
+ <item> INFO_VARIABLES </item>
+ <item> INFO_LICENSE </item>
+ <item> INFO_ALL </item>
+ <item> CREDITS_GROUP </item>
+ <item> CREDITS_GENERAL </item>
+ <item> CREDITS_SAPI </item>
+ <item> CREDITS_MODULES </item>
+ <item> CREDITS_DOCS </item>
+ <item> CREDITS_FULLPAGE </item>
+ <item> CREDITS_QA </item>
+ <item> CREDITS_ALL </item>
+ <item> HTML_SPECIALCHARS </item>
+ <item> HTML_ENTITIES </item>
+ <item> ENT_COMPAT </item>
+ <item> ENT_QUOTES </item>
+ <item> ENT_NOQUOTES </item>
+ <item> STR_PAD_LEFT </item>
+ <item> STR_PAD_RIGHT </item>
+ <item> STR_PAD_BOTH </item>
+ <item> PATHINFO_DIRNAME </item>
+ <item> PATHINFO_BASENAME </item>
+ <item> PATHINFO_EXTENSION </item>
+ <item> CHAR_MAX </item>
+ <item> LC_CTYPE </item>
+ <item> LC_NUMERIC </item>
+ <item> LC_TIME </item>
+ <item> LC_COLLATE </item>
+ <item> LC_MONETARY </item>
+ <item> LC_ALL </item>
+ <item> LC_MESSAGES </item>
+ <item> SEEK_SET </item>
+ <item> SEEK_CUR </item>
+ <item> SEEK_END </item>
+ <item> LOCK_SH </item>
+ <item> LOCK_EX </item>
+ <item> LOCK_UN </item>
+ <item> LOCK_NB </item>
+ <item> STREAM_NOTIFY_CONNECT </item>
+ <item> STREAM_NOTIFY_AUTH_REQUIRED </item>
+ <item> STREAM_NOTIFY_AUTH_RESULT </item>
+ <item> STREAM_NOTIFY_MIME_TYPE_IS </item>
+ <item> STREAM_NOTIFY_FILE_SIZE_IS </item>
+ <item> STREAM_NOTIFY_REDIRECTED </item>
+ <item> STREAM_NOTIFY_PROGRESS </item>
+ <item> STREAM_NOTIFY_FAILURE </item>
+ <item> STREAM_NOTIFY_COMPLETED </item>
+ <item> STREAM_NOTIFY_RESOLVE </item>
+ <item> STREAM_NOTIFY_SEVERITY_INFO </item>
+ <item> STREAM_NOTIFY_SEVERITY_WARN </item>
+ <item> STREAM_NOTIFY_SEVERITY_ERR </item>
+ <item> STREAM_FILTER_READ </item>
+ <item> STREAM_FILTER_WRITE </item>
+ <item> STREAM_FILTER_ALL </item>
+ <item> STREAM_CLIENT_PERSISTENT </item>
+ <item> STREAM_CLIENT_ASYNC_CONNECT </item>
+ <item> STREAM_CLIENT_CONNECT </item>
+ <item> STREAM_PEEK </item>
+ <item> STREAM_OOB </item>
+ <item> STREAM_SERVER_BIND </item>
+ <item> STREAM_SERVER_LISTEN </item>
+ <item> FILE_USE_INCLUDE_PATH </item>
+ <item> FILE_IGNORE_NEW_LINES </item>
+ <item> FILE_SKIP_EMPTY_LINES </item>
+ <item> FILE_APPEND </item>
+ <item> FILE_NO_DEFAULT_CONTEXT </item>
+ <item> FNM_NOESCAPE </item>
+ <item> FNM_PATHNAME </item>
+ <item> FNM_PERIOD </item>
+ <item> FNM_CASEFOLD </item>
+ <item> PSFS_PASS_ON </item>
+ <item> PSFS_FEED_ME </item>
+ <item> PSFS_ERR_FATAL </item>
+ <item> PSFS_FLAG_NORMAL </item>
+ <item> PSFS_FLAG_FLUSH_INC </item>
+ <item> PSFS_FLAG_FLUSH_CLOSE </item>
+ <item> ABDAY_1 </item>
+ <item> ABDAY_2 </item>
+ <item> ABDAY_3 </item>
+ <item> ABDAY_4 </item>
+ <item> ABDAY_5 </item>
+ <item> ABDAY_6 </item>
+ <item> ABDAY_7 </item>
+ <item> DAY_1 </item>
+ <item> DAY_2 </item>
+ <item> DAY_3 </item>
+ <item> DAY_4 </item>
+ <item> DAY_5 </item>
+ <item> DAY_6 </item>
+ <item> DAY_7 </item>
+ <item> ABMON_1 </item>
+ <item> ABMON_2 </item>
+ <item> ABMON_3 </item>
+ <item> ABMON_4 </item>
+ <item> ABMON_5 </item>
+ <item> ABMON_6 </item>
+ <item> ABMON_7 </item>
+ <item> ABMON_8 </item>
+ <item> ABMON_9 </item>
+ <item> ABMON_10 </item>
+ <item> ABMON_11 </item>
+ <item> ABMON_12 </item>
+ <item> MON_1 </item>
+ <item> MON_2 </item>
+ <item> MON_3 </item>
+ <item> MON_4 </item>
+ <item> MON_5 </item>
+ <item> MON_6 </item>
+ <item> MON_7 </item>
+ <item> MON_8 </item>
+ <item> MON_9 </item>
+ <item> MON_10 </item>
+ <item> MON_11 </item>
+ <item> MON_12 </item>
+ <item> AM_STR </item>
+ <item> PM_STR </item>
+ <item> D_T_FMT </item>
+ <item> D_FMT </item>
+ <item> T_FMT </item>
+ <item> T_FMT_AMPM </item>
+ <item> ERA </item>
+ <item> ERA_D_T_FMT </item>
+ <item> ERA_D_FMT </item>
+ <item> ERA_T_FMT </item>
+ <item> ALT_DIGITS </item>
+ <item> CRNCYSTR </item>
+ <item> RADIXCHAR </item>
+ <item> THOUSEP </item>
+ <item> YESEXPR </item>
+ <item> NOEXPR </item>
+ <item> CODESET </item>
+ <item> CRYPT_SALT_LENGTH </item>
+ <item> CRYPT_STD_DES </item>
+ <item> CRYPT_EXT_DES </item>
+ <item> CRYPT_MD5 </item>
+ <item> CRYPT_BLOWFISH </item>
+ <item> DIRECTORY_SEPARATOR </item>
+ <item> PATH_SEPARATOR </item>
+ <item> GLOB_BRACE </item>
+ <item> GLOB_MARK </item>
+ <item> GLOB_NOSORT </item>
+ <item> GLOB_NOCHECK </item>
+ <item> GLOB_NOESCAPE </item>
+ <item> GLOB_ONLYDIR </item>
+ <item> LOG_EMERG </item>
+ <item> LOG_ALERT </item>
+ <item> LOG_CRIT </item>
+ <item> LOG_ERR </item>
+ <item> LOG_WARNING </item>
+ <item> LOG_NOTICE </item>
+ <item> LOG_INFO </item>
+ <item> LOG_DEBUG </item>
+ <item> LOG_KERN </item>
+ <item> LOG_USER </item>
+ <item> LOG_MAIL </item>
+ <item> LOG_DAEMON </item>
+ <item> LOG_AUTH </item>
+ <item> LOG_SYSLOG </item>
+ <item> LOG_LPR </item>
+ <item> LOG_NEWS </item>
+ <item> LOG_UUCP </item>
+ <item> LOG_CRON </item>
+ <item> LOG_AUTHPRIV </item>
+ <item> LOG_LOCAL0 </item>
+ <item> LOG_LOCAL1 </item>
+ <item> LOG_LOCAL2 </item>
+ <item> LOG_LOCAL3 </item>
+ <item> LOG_LOCAL4 </item>
+ <item> LOG_LOCAL5 </item>
+ <item> LOG_LOCAL6 </item>
+ <item> LOG_LOCAL7 </item>
+ <item> LOG_PID </item>
+ <item> LOG_CONS </item>
+ <item> LOG_ODELAY </item>
+ <item> LOG_NDELAY </item>
+ <item> LOG_NOWAIT </item>
+ <item> LOG_PERROR </item>
+ <item> EXTR_OVERWRITE </item>
+ <item> EXTR_SKIP </item>
+ <item> EXTR_PREFIX_SAME </item>
+ <item> EXTR_PREFIX_ALL </item>
+ <item> EXTR_PREFIX_INVALID </item>
+ <item> EXTR_PREFIX_IF_EXISTS </item>
+ <item> EXTR_IF_EXISTS </item>
+ <item> EXTR_REFS </item>
+ <item> SORT_ASC </item>
+ <item> SORT_DESC </item>
+ <item> SORT_REGULAR </item>
+ <item> SORT_NUMERIC </item>
+ <item> SORT_STRING </item>
+ <item> SORT_LOCALE_STRING </item>
+ <item> CASE_LOWER </item>
+ <item> CASE_UPPER </item>
+ <item> COUNT_NORMAL </item>
+ <item> COUNT_RECURSIVE </item>
+ <item> ASSERT_ACTIVE </item>
+ <item> ASSERT_CALLBACK </item>
+ <item> ASSERT_BAIL </item>
+ <item> ASSERT_WARNING </item>
+ <item> ASSERT_QUIET_EVAL </item>
+ <item> STREAM_USE_PATH </item>
+ <item> STREAM_IGNORE_URL </item>
+ <item> STREAM_ENFORCE_SAFE_MODE </item>
+ <item> STREAM_REPORT_ERRORS </item>
+ <item> STREAM_MUST_SEEK </item>
+ <item> STREAM_URL_STAT_LINK </item>
+ <item> STREAM_URL_STAT_QUIET </item>
+ <item> STREAM_MKDIR_RECURSIVE </item>
+ <item> IMAGETYPE_GIF </item>
+ <item> IMAGETYPE_JPEG </item>
+ <item> IMAGETYPE_PNG </item>
+ <item> IMAGETYPE_SWF </item>
+ <item> IMAGETYPE_PSD </item>
+ <item> IMAGETYPE_BMP </item>
+ <item> IMAGETYPE_TIFF_II </item>
+ <item> IMAGETYPE_TIFF_MM </item>
+ <item> IMAGETYPE_JPC </item>
+ <item> IMAGETYPE_JP2 </item>
+ <item> IMAGETYPE_JPX </item>
+ <item> IMAGETYPE_JB2 </item>
+ <item> IMAGETYPE_IFF </item>
+ <item> IMAGETYPE_WBMP </item>
+ <item> IMAGETYPE_JPEG2000 </item>
+ <item> IMAGETYPE_XBM </item>
+ <item> DNS_A </item>
+ <item> DNS_NS </item>
+ <item> DNS_CNAME </item>
+ <item> DNS_SOA </item>
+ <item> DNS_PTR </item>
+ <item> DNS_HINFO </item>
+ <item> DNS_MX </item>
+ <item> DNS_TXT </item>
+ <item> DNS_SRV </item>
+ <item> DNS_NAPTR </item>
+ <item> DNS_AAAA </item>
+ <item> DNS_ANY </item>
+ <item> DNS_ALL </item>
+ <item> RIT_LEAVES_ONLY </item>
+ <item> RIT_SELF_FIRST </item>
+ <item> RIT_CHILD_FIRST </item>
+ <item> CIT_CALL_TOSTRING </item>
+ <item> CIT_CATCH_GET_CHILD </item>
+ <item> PREG_PATTERN_ORDER </item>
+ <item> PREG_SET_ORDER </item>
+ <item> PREG_OFFSET_CAPTURE </item>
+ <item> PREG_SPLIT_NO_EMPTY </item>
+ <item> PREG_SPLIT_DELIM_CAPTURE </item>
+ <item> PREG_SPLIT_OFFSET_CAPTURE </item>
+ <item> PREG_GREP_INVERT </item>
+ <item> CAL_GREGORIAN </item>
+ <item> CAL_JULIAN </item>
+ <item> CAL_JEWISH </item>
+ <item> CAL_FRENCH </item>
+ <item> CAL_NUM_CALS </item>
+ <item> CAL_DOW_DAYNO </item>
+ <item> CAL_DOW_SHORT </item>
+ <item> CAL_DOW_LONG </item>
+ <item> CAL_MONTH_GREGORIAN_SHORT </item>
+ <item> CAL_MONTH_GREGORIAN_LONG </item>
+ <item> CAL_MONTH_JULIAN_SHORT </item>
+ <item> CAL_MONTH_JULIAN_LONG </item>
+ <item> CAL_MONTH_JEWISH </item>
+ <item> CAL_MONTH_FRENCH </item>
+ <item> CAL_EASTER_DEFAULT </item>
+ <item> CAL_EASTER_ROMAN </item>
+ <item> CAL_EASTER_ALWAYS_GREGORIAN </item>
+ <item> CAL_EASTER_ALWAYS_JULIAN </item>
+ <item> CAL_JEWISH_ADD_ALAFIM_GERESH </item>
+ <item> CAL_JEWISH_ADD_ALAFIM </item>
+ <item> CAL_JEWISH_ADD_GERESHAYIM </item>
+ <item> CURLOPT_DNS_USE_GLOBAL_CACHE </item>
+ <item> CURLOPT_DNS_CACHE_TIMEOUT </item>
+ <item> CURLOPT_PORT </item>
+ <item> CURLOPT_FILE </item>
+ <item> CURLOPT_READDATA </item>
+ <item> CURLOPT_INFILE </item>
+ <item> CURLOPT_INFILESIZE </item>
+ <item> CURLOPT_URL </item>
+ <item> CURLOPT_PROXY </item>
+ <item> CURLOPT_VERBOSE </item>
+ <item> CURLOPT_HEADER </item>
+ <item> CURLOPT_HTTPHEADER </item>
+ <item> CURLOPT_NOPROGRESS </item>
+ <item> CURLOPT_NOBODY </item>
+ <item> CURLOPT_FAILONERROR </item>
+ <item> CURLOPT_UPLOAD </item>
+ <item> CURLOPT_POST </item>
+ <item> CURLOPT_FTPLISTONLY </item>
+ <item> CURLOPT_FTPAPPEND </item>
+ <item> CURLOPT_NETRC </item>
+ <item> CURLOPT_FOLLOWLOCATION </item>
+ <item> CURLOPT_FTPASCII </item>
+ <item> CURLOPT_PUT </item>
+ <item> CURLOPT_MUTE </item>
+ <item> CURLOPT_USERPWD </item>
+ <item> CURLOPT_PROXYUSERPWD </item>
+ <item> CURLOPT_RANGE </item>
+ <item> CURLOPT_TIMEOUT </item>
+ <item> CURLOPT_POSTFIELDS </item>
+ <item> CURLOPT_REFERER </item>
+ <item> CURLOPT_USERAGENT </item>
+ <item> CURLOPT_FTPPORT </item>
+ <item> CURLOPT_FTP_USE_EPSV </item>
+ <item> CURLOPT_LOW_SPEED_LIMIT </item>
+ <item> CURLOPT_LOW_SPEED_TIME </item>
+ <item> CURLOPT_RESUME_FROM </item>
+ <item> CURLOPT_COOKIE </item>
+ <item> CURLOPT_SSLCERT </item>
+ <item> CURLOPT_SSLCERTPASSWD </item>
+ <item> CURLOPT_WRITEHEADER </item>
+ <item> CURLOPT_SSL_VERIFYHOST </item>
+ <item> CURLOPT_COOKIEFILE </item>
+ <item> CURLOPT_SSLVERSION </item>
+ <item> CURLOPT_TIMECONDITION </item>
+ <item> CURLOPT_TIMEVALUE </item>
+ <item> CURLOPT_CUSTOMREQUEST </item>
+ <item> CURLOPT_STDERR </item>
+ <item> CURLOPT_TRANSFERTEXT </item>
+ <item> CURLOPT_RETURNTRANSFER </item>
+ <item> CURLOPT_QUOTE </item>
+ <item> CURLOPT_POSTQUOTE </item>
+ <item> CURLOPT_INTERFACE </item>
+ <item> CURLOPT_KRB4LEVEL </item>
+ <item> CURLOPT_HTTPPROXYTUNNEL </item>
+ <item> CURLOPT_FILETIME </item>
+ <item> CURLOPT_WRITEFUNCTION </item>
+ <item> CURLOPT_READFUNCTION </item>
+ <item> CURLOPT_PASSWDFUNCTION </item>
+ <item> CURLOPT_HEADERFUNCTION </item>
+ <item> CURLOPT_MAXREDIRS </item>
+ <item> CURLOPT_MAXCONNECTS </item>
+ <item> CURLOPT_CLOSEPOLICY </item>
+ <item> CURLOPT_FRESH_CONNECT </item>
+ <item> CURLOPT_FORBID_REUSE </item>
+ <item> CURLOPT_RANDOM_FILE </item>
+ <item> CURLOPT_EGDSOCKET </item>
+ <item> CURLOPT_CONNECTTIMEOUT </item>
+ <item> CURLOPT_SSL_VERIFYPEER </item>
+ <item> CURLOPT_CAINFO </item>
+ <item> CURLOPT_CAPATH </item>
+ <item> CURLOPT_COOKIEJAR </item>
+ <item> CURLOPT_SSL_CIPHER_LIST </item>
+ <item> CURLOPT_BINARYTRANSFER </item>
+ <item> CURLOPT_NOSIGNAL </item>
+ <item> CURLOPT_PROXYTYPE </item>
+ <item> CURLOPT_BUFFERSIZE </item>
+ <item> CURLOPT_HTTPGET </item>
+ <item> CURLOPT_HTTP_VERSION </item>
+ <item> CURLOPT_SSLKEY </item>
+ <item> CURLOPT_SSLKEYTYPE </item>
+ <item> CURLOPT_SSLKEYPASSWD </item>
+ <item> CURLOPT_SSLENGINE </item>
+ <item> CURLOPT_SSLENGINE_DEFAULT </item>
+ <item> CURLOPT_SSLCERTTYPE </item>
+ <item> CURLOPT_CRLF </item>
+ <item> CURLOPT_ENCODING </item>
+ <item> CURLOPT_PROXYPORT </item>
+ <item> CURLOPT_UNRESTRICTED_AUTH </item>
+ <item> CURLOPT_FTP_USE_EPRT </item>
+ <item> CURLOPT_HTTP200ALIASES </item>
+ <item> CURL_TIMECOND_IFMODSINCE </item>
+ <item> CURL_TIMECOND_IFUNMODSINCE </item>
+ <item> CURL_TIMECOND_LASTMOD </item>
+ <item> CURLOPT_HTTPAUTH </item>
+ <item> CURLAUTH_BASIC </item>
+ <item> CURLAUTH_DIGEST </item>
+ <item> CURLAUTH_GSSNEGOTIATE </item>
+ <item> CURLAUTH_NTLM </item>
+ <item> CURLAUTH_ANY </item>
+ <item> CURLAUTH_ANYSAFE </item>
+ <item> CURLOPT_PROXYAUTH </item>
+ <item> CURLCLOSEPOLICY_LEAST_RECENTLY_USED </item>
+ <item> CURLCLOSEPOLICY_LEAST_TRAFFIC </item>
+ <item> CURLCLOSEPOLICY_SLOWEST </item>
+ <item> CURLCLOSEPOLICY_CALLBACK </item>
+ <item> CURLCLOSEPOLICY_OLDEST </item>
+ <item> CURLINFO_EFFECTIVE_URL </item>
+ <item> CURLINFO_HTTP_CODE </item>
+ <item> CURLINFO_HEADER_SIZE </item>
+ <item> CURLINFO_REQUEST_SIZE </item>
+ <item> CURLINFO_TOTAL_TIME </item>
+ <item> CURLINFO_NAMELOOKUP_TIME </item>
+ <item> CURLINFO_CONNECT_TIME </item>
+ <item> CURLINFO_PRETRANSFER_TIME </item>
+ <item> CURLINFO_SIZE_UPLOAD </item>
+ <item> CURLINFO_SIZE_DOWNLOAD </item>
+ <item> CURLINFO_SPEED_DOWNLOAD </item>
+ <item> CURLINFO_SPEED_UPLOAD </item>
+ <item> CURLINFO_FILETIME </item>
+ <item> CURLINFO_SSL_VERIFYRESULT </item>
+ <item> CURLINFO_CONTENT_LENGTH_DOWNLOAD </item>
+ <item> CURLINFO_CONTENT_LENGTH_UPLOAD </item>
+ <item> CURLINFO_STARTTRANSFER_TIME </item>
+ <item> CURLINFO_CONTENT_TYPE </item>
+ <item> CURLINFO_REDIRECT_TIME </item>
+ <item> CURLINFO_REDIRECT_COUNT </item>
+ <item> CURL_VERSION_IPV6 </item>
+ <item> CURL_VERSION_KERBEROS4 </item>
+ <item> CURL_VERSION_SSL </item>
+ <item> CURL_VERSION_LIBZ </item>
+ <item> CURLVERSION_NOW </item>
+ <item> CURLE_OK </item>
+ <item> CURLE_UNSUPPORTED_PROTOCOL </item>
+ <item> CURLE_FAILED_INIT </item>
+ <item> CURLE_URL_MALFORMAT </item>
+ <item> CURLE_URL_MALFORMAT_USER </item>
+ <item> CURLE_COULDNT_RESOLVE_PROXY </item>
+ <item> CURLE_COULDNT_RESOLVE_HOST </item>
+ <item> CURLE_COULDNT_CONNECT </item>
+ <item> CURLE_FTP_WEIRD_SERVER_REPLY </item>
+ <item> CURLE_FTP_ACCESS_DENIED </item>
+ <item> CURLE_FTP_USER_PASSWORD_INCORRECT </item>
+ <item> CURLE_FTP_WEIRD_PASS_REPLY </item>
+ <item> CURLE_FTP_WEIRD_USER_REPLY </item>
+ <item> CURLE_FTP_WEIRD_PASV_REPLY </item>
+ <item> CURLE_FTP_WEIRD_227_FORMAT </item>
+ <item> CURLE_FTP_CANT_GET_HOST </item>
+ <item> CURLE_FTP_CANT_RECONNECT </item>
+ <item> CURLE_FTP_COULDNT_SET_BINARY </item>
+ <item> CURLE_PARTIAL_FILE </item>
+ <item> CURLE_FTP_COULDNT_RETR_FILE </item>
+ <item> CURLE_FTP_WRITE_ERROR </item>
+ <item> CURLE_FTP_QUOTE_ERROR </item>
+ <item> CURLE_HTTP_NOT_FOUND </item>
+ <item> CURLE_WRITE_ERROR </item>
+ <item> CURLE_MALFORMAT_USER </item>
+ <item> CURLE_FTP_COULDNT_STOR_FILE </item>
+ <item> CURLE_READ_ERROR </item>
+ <item> CURLE_OUT_OF_MEMORY </item>
+ <item> CURLE_OPERATION_TIMEOUTED </item>
+ <item> CURLE_FTP_COULDNT_SET_ASCII </item>
+ <item> CURLE_FTP_PORT_FAILED </item>
+ <item> CURLE_FTP_COULDNT_USE_REST </item>
+ <item> CURLE_FTP_COULDNT_GET_SIZE </item>
+ <item> CURLE_HTTP_RANGE_ERROR </item>
+ <item> CURLE_HTTP_POST_ERROR </item>
+ <item> CURLE_SSL_CONNECT_ERROR </item>
+ <item> CURLE_FTP_BAD_DOWNLOAD_RESUME </item>
+ <item> CURLE_FILE_COULDNT_READ_FILE </item>
+ <item> CURLE_LDAP_CANNOT_BIND </item>
+ <item> CURLE_LDAP_SEARCH_FAILED </item>
+ <item> CURLE_LIBRARY_NOT_FOUND </item>
+ <item> CURLE_FUNCTION_NOT_FOUND </item>
+ <item> CURLE_ABORTED_BY_CALLBACK </item>
+ <item> CURLE_BAD_FUNCTION_ARGUMENT </item>
+ <item> CURLE_BAD_CALLING_ORDER </item>
+ <item> CURLE_HTTP_PORT_FAILED </item>
+ <item> CURLE_BAD_PASSWORD_ENTERED </item>
+ <item> CURLE_TOO_MANY_REDIRECTS </item>
+ <item> CURLE_UNKNOWN_TELNET_OPTION </item>
+ <item> CURLE_TELNET_OPTION_SYNTAX </item>
+ <item> CURLE_OBSOLETE </item>
+ <item> CURLE_SSL_PEER_CERTIFICATE </item>
+ <item> CURLE_GOT_NOTHING </item>
+ <item> CURLE_SSL_ENGINE_NOTFOUND </item>
+ <item> CURLE_SSL_ENGINE_SETFAILED </item>
+ <item> CURLE_SEND_ERROR </item>
+ <item> CURLE_RECV_ERROR </item>
+ <item> CURLE_SHARE_IN_USE </item>
+ <item> CURLE_SSL_CERTPROBLEM </item>
+ <item> CURLE_SSL_CIPHER </item>
+ <item> CURLE_SSL_CACERT </item>
+ <item> CURLE_BAD_CONTENT_ENCODING </item>
+ <item> CURLPROXY_HTTP </item>
+ <item> CURLPROXY_SOCKS5 </item>
+ <item> CURL_NETRC_OPTIONAL </item>
+ <item> CURL_NETRC_IGNORED </item>
+ <item> CURL_NETRC_REQUIRED </item>
+ <item> CURL_HTTP_VERSION_NONE </item>
+ <item> CURL_HTTP_VERSION_1_0 </item>
+ <item> CURL_HTTP_VERSION_1_1 </item>
+ <item> CURLM_CALL_MULTI_PERFORM </item>
+ <item> CURLM_OK </item>
+ <item> CURLM_BAD_HANDLE </item>
+ <item> CURLM_BAD_EASY_HANDLE </item>
+ <item> CURLM_OUT_OF_MEMORY </item>
+ <item> CURLM_INTERNAL_ERROR </item>
+ <item> CURLMSG_DONE </item>
+ <item> DBX_MYSQL </item>
+ <item> DBX_ODBC </item>
+ <item> DBX_PGSQL </item>
+ <item> DBX_MSSQL </item>
+ <item> DBX_FBSQL </item>
+ <item> DBX_OCI8 </item>
+ <item> DBX_SYBASECT </item>
+ <item> DBX_SQLITE </item>
+ <item> DBX_PERSISTENT </item>
+ <item> DBX_RESULT_INFO </item>
+ <item> DBX_RESULT_INDEX </item>
+ <item> DBX_RESULT_ASSOC </item>
+ <item> DBX_RESULT_UNBUFFERED </item>
+ <item> DBX_COLNAMES_UNCHANGED </item>
+ <item> DBX_COLNAMES_UPPERCASE </item>
+ <item> DBX_COLNAMES_LOWERCASE </item>
+ <item> DBX_CMP_NATIVE </item>
+ <item> DBX_CMP_TEXT </item>
+ <item> DBX_CMP_NUMBER </item>
+ <item> DBX_CMP_ASC </item>
+ <item> DBX_CMP_DESC </item>
+ <item> O_RDONLY </item>
+ <item> O_WRONLY </item>
+ <item> O_RDWR </item>
+ <item> O_CREAT </item>
+ <item> O_EXCL </item>
+ <item> O_TRUNC </item>
+ <item> O_APPEND </item>
+ <item> O_NONBLOCK </item>
+ <item> O_NDELAY </item>
+ <item> O_SYNC </item>
+ <item> O_ASYNC </item>
+ <item> O_NOCTTY </item>
+ <item> S_IRWXU </item>
+ <item> S_IRUSR </item>
+ <item> S_IWUSR </item>
+ <item> S_IXUSR </item>
+ <item> S_IRWXG </item>
+ <item> S_IRGRP </item>
+ <item> S_IWGRP </item>
+ <item> S_IXGRP </item>
+ <item> S_IRWXO </item>
+ <item> S_IROTH </item>
+ <item> S_IWOTH </item>
+ <item> S_IXOTH </item>
+ <item> F_DUPFD </item>
+ <item> F_GETFD </item>
+ <item> F_GETFL </item>
+ <item> F_SETFL </item>
+ <item> F_GETLK </item>
+ <item> F_SETLK </item>
+ <item> F_SETLKW </item>
+ <item> F_SETOWN </item>
+ <item> F_GETOWN </item>
+ <item> F_UNLCK </item>
+ <item> F_RDLCK </item>
+ <item> F_WRLCK </item>
+ <item> XML_ELEMENT_NODE </item>
+ <item> XML_ATTRIBUTE_NODE </item>
+ <item> XML_TEXT_NODE </item>
+ <item> XML_CDATA_SECTION_NODE </item>
+ <item> XML_ENTITY_REF_NODE </item>
+ <item> XML_ENTITY_NODE </item>
+ <item> XML_PI_NODE </item>
+ <item> XML_COMMENT_NODE </item>
+ <item> XML_DOCUMENT_NODE </item>
+ <item> XML_DOCUMENT_TYPE_NODE </item>
+ <item> XML_DOCUMENT_FRAG_NODE </item>
+ <item> XML_NOTATION_NODE </item>
+ <item> XML_HTML_DOCUMENT_NODE </item>
+ <item> XML_DTD_NODE </item>
+ <item> XML_ELEMENT_DECL_NODE </item>
+ <item> XML_ATTRIBUTE_DECL_NODE </item>
+ <item> XML_ENTITY_DECL_NODE </item>
+ <item> XML_NAMESPACE_DECL_NODE </item>
+ <item> XML_LOCAL_NAMESPACE </item>
+ <item> XML_ATTRIBUTE_CDATA </item>
+ <item> XML_ATTRIBUTE_ID </item>
+ <item> XML_ATTRIBUTE_IDREF </item>
+ <item> XML_ATTRIBUTE_IDREFS </item>
+ <item> XML_ATTRIBUTE_ENTITY </item>
+ <item> XML_ATTRIBUTE_NMTOKEN </item>
+ <item> XML_ATTRIBUTE_NMTOKENS </item>
+ <item> XML_ATTRIBUTE_ENUMERATION </item>
+ <item> XML_ATTRIBUTE_NOTATION </item>
+ <item> DOM_PHP_ERR </item>
+ <item> DOM_INDEX_SIZE_ERR </item>
+ <item> DOMSTRING_SIZE_ERR </item>
+ <item> DOM_HIERARCHY_REQUEST_ERR </item>
+ <item> DOM_WRONG_DOCUMENT_ERR </item>
+ <item> DOM_INVALID_CHARACTER_ERR </item>
+ <item> DOM_NO_DATA_ALLOWED_ERR </item>
+ <item> DOM_NO_MODIFICATION_ALLOWED_ERR </item>
+ <item> DOM_NOT_FOUND_ERR </item>
+ <item> DOM_NOT_SUPPORTED_ERR </item>
+ <item> DOM_INUSE_ATTRIBUTE_ERR </item>
+ <item> DOM_INVALID_STATE_ERR </item>
+ <item> DOM_SYNTAX_ERR </item>
+ <item> DOM_INVALID_MODIFICATION_ERR </item>
+ <item> DOM_NAMESPACE_ERR </item>
+ <item> DOM_INVALID_ACCESS_ERR </item>
+ <item> DOM_VALIDATION_ERR </item>
+ <item> EXIF_USE_MBSTRING </item>
+ <item> FAMChanged </item>
+ <item> FAMDeleted </item>
+ <item> FAMStartExecuting </item>
+ <item> FAMStopExecuting </item>
+ <item> FAMCreated </item>
+ <item> FAMMoved </item>
+ <item> FAMAcknowledge </item>
+ <item> FAMExists </item>
+ <item> FAMEndExist </item>
+ <item> FTP_ASCII </item>
+ <item> FTP_TEXT </item>
+ <item> FTP_BINARY </item>
+ <item> FTP_IMAGE </item>
+ <item> FTP_AUTORESUME </item>
+ <item> FTP_TIMEOUT_SEC </item>
+ <item> FTP_AUTOSEEK </item>
+ <item> FTP_FAILED </item>
+ <item> FTP_FINISHED </item>
+ <item> FTP_MOREDATA </item>
+ <item> IMG_GIF </item>
+ <item> IMG_JPG </item>
+ <item> IMG_JPEG </item>
+ <item> IMG_PNG </item>
+ <item> IMG_WBMP </item>
+ <item> IMG_XPM </item>
+ <item> IMG_COLOR_TILED </item>
+ <item> IMG_COLOR_STYLED </item>
+ <item> IMG_COLOR_BRUSHED </item>
+ <item> IMG_COLOR_STYLEDBRUSHED </item>
+ <item> IMG_COLOR_TRANSPARENT </item>
+ <item> IMG_ARC_ROUNDED </item>
+ <item> IMG_ARC_PIE </item>
+ <item> IMG_ARC_CHORD </item>
+ <item> IMG_ARC_NOFILL </item>
+ <item> IMG_ARC_EDGED </item>
+ <item> IMG_GD2_RAW </item>
+ <item> IMG_GD2_COMPRESSED </item>
+ <item> IMG_EFFECT_REPLACE </item>
+ <item> IMG_EFFECT_ALPHABLEND </item>
+ <item> IMG_EFFECT_NORMAL </item>
+ <item> IMG_EFFECT_OVERLAY </item>
+ <item> GD_BUNDLED </item>
+ <item> IMG_FILTER_NEGATE </item>
+ <item> IMG_FILTER_GRAYSCALE </item>
+ <item> IMG_FILTER_BRIGHTNESS </item>
+ <item> IMG_FILTER_CONTRAST </item>
+ <item> IMG_FILTER_COLORIZE </item>
+ <item> IMG_FILTER_EDGEDETECT </item>
+ <item> IMG_FILTER_GAUSSIAN_BLUR </item>
+ <item> IMG_FILTER_SELECTIVE_BLUR </item>
+ <item> IMG_FILTER_EMBOSS </item>
+ <item> IMG_FILTER_MEAN_REMOVAL </item>
+ <item> IMG_FILTER_SMOOTH </item>
+ <item> GMP_ROUND_ZERO </item>
+ <item> GMP_ROUND_PLUSINF </item>
+ <item> GMP_ROUND_MINUSINF </item>
+ <item> ICONV_IMPL </item>
+ <item> ICONV_VERSION </item>
+ <item> ICONV_MIME_DECODE_STRICT </item>
+ <item> ICONV_MIME_DECODE_CONTINUE_ON_ERROR </item>
+ <item> NIL </item>
+ <item> IMAP_OPENTIMEOUT </item>
+ <item> IMAP_READTIMEOUT </item>
+ <item> IMAP_WRITETIMEOUT </item>
+ <item> IMAP_CLOSETIMEOUT </item>
+ <item> OP_DEBUG </item>
+ <item> OP_READONLY </item>
+ <item> OP_ANONYMOUS </item>
+ <item> OP_SHORTCACHE </item>
+ <item> OP_SILENT </item>
+ <item> OP_PROTOTYPE </item>
+ <item> OP_HALFOPEN </item>
+ <item> OP_EXPUNGE </item>
+ <item> OP_SECURE </item>
+ <item> CL_EXPUNGE </item>
+ <item> FT_UID </item>
+ <item> FT_PEEK </item>
+ <item> FT_NOT </item>
+ <item> FT_INTERNAL </item>
+ <item> FT_PREFETCHTEXT </item>
+ <item> ST_UID </item>
+ <item> ST_SILENT </item>
+ <item> ST_SET </item>
+ <item> CP_UID </item>
+ <item> CP_MOVE </item>
+ <item> SE_UID </item>
+ <item> SE_FREE </item>
+ <item> SE_NOPREFETCH </item>
+ <item> SO_FREE </item>
+ <item> SO_NOSERVER </item>
+ <item> SA_MESSAGES </item>
+ <item> SA_RECENT </item>
+ <item> SA_UNSEEN </item>
+ <item> SA_UIDNEXT </item>
+ <item> SA_UIDVALIDITY </item>
+ <item> SA_ALL </item>
+ <item> LATT_NOINFERIORS </item>
+ <item> LATT_NOSELECT </item>
+ <item> LATT_MARKED </item>
+ <item> LATT_UNMARKED </item>
+ <item> LATT_REFERRAL </item>
+ <item> LATT_HASCHILDREN </item>
+ <item> LATT_HASNOCHILDREN </item>
+ <item> SORTDATE </item>
+ <item> SORTARRIVAL </item>
+ <item> SORTFROM </item>
+ <item> SORTSUBJECT </item>
+ <item> SORTTO </item>
+ <item> SORTCC </item>
+ <item> SORTSIZE </item>
+ <item> TYPETEXT </item>
+ <item> TYPEMULTIPART </item>
+ <item> TYPEMESSAGE </item>
+ <item> TYPEAPPLICATION </item>
+ <item> TYPEAUDIO </item>
+ <item> TYPEIMAGE </item>
+ <item> TYPEVIDEO </item>
+ <item> TYPEMODEL </item>
+ <item> TYPEOTHER </item>
+ <item> ENC7BIT </item>
+ <item> ENC8BIT </item>
+ <item> ENCBINARY </item>
+ <item> ENCBASE64 </item>
+ <item> ENCQUOTEDPRINTABLE </item>
+ <item> ENCOTHER </item>
+ <item> LDAP_DEREF_NEVER </item>
+ <item> LDAP_DEREF_SEARCHING </item>
+ <item> LDAP_DEREF_FINDING </item>
+ <item> LDAP_DEREF_ALWAYS </item>
+ <item> LDAP_OPT_DEREF </item>
+ <item> LDAP_OPT_SIZELIMIT </item>
+ <item> LDAP_OPT_TIMELIMIT </item>
+ <item> LDAP_OPT_PROTOCOL_VERSION </item>
+ <item> LDAP_OPT_ERROR_NUMBER </item>
+ <item> LDAP_OPT_REFERRALS </item>
+ <item> LDAP_OPT_RESTART </item>
+ <item> LDAP_OPT_HOST_NAME </item>
+ <item> LDAP_OPT_ERROR_STRING </item>
+ <item> LDAP_OPT_MATCHED_DN </item>
+ <item> LDAP_OPT_SERVER_CONTROLS </item>
+ <item> LDAP_OPT_CLIENT_CONTROLS </item>
+ <item> LDAP_OPT_DEBUG_LEVEL </item>
+ <item> MB_OVERLOAD_MAIL </item>
+ <item> MB_OVERLOAD_STRING </item>
+ <item> MB_OVERLOAD_REGEX </item>
+ <item> MB_CASE_UPPER </item>
+ <item> MB_CASE_LOWER </item>
+ <item> MB_CASE_TITLE </item>
+ <item> MCRYPT_ENCRYPT </item>
+ <item> MCRYPT_DECRYPT </item>
+ <item> MCRYPT_DEV_RANDOM </item>
+ <item> MCRYPT_DEV_URANDOM </item>
+ <item> MCRYPT_RAND </item>
+ <item> MCRYPT_3DES </item>
+ <item> MCRYPT_ARCFOUR_IV </item>
+ <item> MCRYPT_ARCFOUR </item>
+ <item> MCRYPT_BLOWFISH </item>
+ <item> MCRYPT_BLOWFISH_COMPAT </item>
+ <item> MCRYPT_CAST_128 </item>
+ <item> MCRYPT_CAST_256 </item>
+ <item> MCRYPT_CRYPT </item>
+ <item> MCRYPT_DES </item>
+ <item> MCRYPT_ENIGNA </item>
+ <item> MCRYPT_GOST </item>
+ <item> MCRYPT_LOKI97 </item>
+ <item> MCRYPT_PANAMA </item>
+ <item> MCRYPT_RC2 </item>
+ <item> MCRYPT_RIJNDAEL_128 </item>
+ <item> MCRYPT_RIJNDAEL_192 </item>
+ <item> MCRYPT_RIJNDAEL_256 </item>
+ <item> MCRYPT_SAFER64 </item>
+ <item> MCRYPT_SAFER128 </item>
+ <item> MCRYPT_SAFERPLUS </item>
+ <item> MCRYPT_SERPENT </item>
+ <item> MCRYPT_THREEWAY </item>
+ <item> MCRYPT_TRIPLEDES </item>
+ <item> MCRYPT_TWOFISH </item>
+ <item> MCRYPT_WAKE </item>
+ <item> MCRYPT_XTEA </item>
+ <item> MCRYPT_IDEA </item>
+ <item> MCRYPT_MARS </item>
+ <item> MCRYPT_RC6 </item>
+ <item> MCRYPT_SKIPJACK </item>
+ <item> MCRYPT_MODE_CBC </item>
+ <item> MCRYPT_MODE_CFB </item>
+ <item> MCRYPT_MODE_ECB </item>
+ <item> MCRYPT_MODE_NOFB </item>
+ <item> MCRYPT_MODE_OFB </item>
+ <item> MCRYPT_MODE_STREAM </item>
+ <item> MHASH_CRC32 </item>
+ <item> MHASH_MD5 </item>
+ <item> MHASH_SHA1 </item>
+ <item> MHASH_HAVAL256 </item>
+ <item> MHASH_RIPEMD160 </item>
+ <item> MHASH_TIGER </item>
+ <item> MHASH_GOST </item>
+ <item> MHASH_CRC32B </item>
+ <item> MHASH_HAVAL224 </item>
+ <item> MHASH_HAVAL192 </item>
+ <item> MHASH_HAVAL160 </item>
+ <item> MHASH_HAVAL128 </item>
+ <item> MHASH_TIGER128 </item>
+ <item> MHASH_TIGER160 </item>
+ <item> MHASH_MD4 </item>
+ <item> MHASH_SHA256 </item>
+ <item> MHASH_ADLER32 </item>
+ <item> MHASH_SHA224 </item>
+ <item> MHASH_SHA512 </item>
+ <item> MHASH_SHA384 </item>
+ <item> MHASH_WHIRLPOOL </item>
+ <item> MHASH_RIPEMD128 </item>
+ <item> MHASH_RIPEMD256 </item>
+ <item> MHASH_RIPEMD320 </item>
+ <item> MHASH_SNEFRU128 </item>
+ <item> MHASH_SNEFRU256 </item>
+ <item> MHASH_MD2 </item>
+ <item> MYSQL_ASSOC </item>
+ <item> MYSQL_NUM </item>
+ <item> MYSQL_BOTH </item>
+ <item> MYSQL_CLIENT_COMPRESS </item>
+ <item> MYSQL_CLIENT_SSL </item>
+ <item> MYSQL_CLIENT_INTERACTIVE </item>
+ <item> MYSQL_CLIENT_IGNORE_SPACE </item>
+ <item> MYSQLI_READ_DEFAULT_GROUP </item>
+ <item> MYSQLI_READ_DEFAULT_FILE </item>
+ <item> MYSQLI_OPT_CONNECT_TIMEOUT </item>
+ <item> MYSQLI_OPT_LOCAL_INFILE </item>
+ <item> MYSQLI_INIT_COMMAND </item>
+ <item> MYSQLI_CLIENT_SSL </item>
+ <item> MYSQLI_CLIENT_COMPRESS </item>
+ <item> MYSQLI_CLIENT_INTERACTIVE </item>
+ <item> MYSQLI_CLIENT_IGNORE_SPACE </item>
+ <item> MYSQLI_CLIENT_NO_SCHEMA </item>
+ <item> MYSQLI_CLIENT_FOUND_ROWS </item>
+ <item> MYSQLI_STORE_RESULT </item>
+ <item> MYSQLI_USE_RESULT </item>
+ <item> MYSQLI_ASSOC </item>
+ <item> MYSQLI_NUM </item>
+ <item> MYSQLI_BOTH </item>
+ <item> MYSQLI_STMT_ATTR_UPDATE_MAX_LENGTH </item>
+ <item> MYSQLI_NOT_NULL_FLAG </item>
+ <item> MYSQLI_PRI_KEY_FLAG </item>
+ <item> MYSQLI_UNIQUE_KEY_FLAG </item>
+ <item> MYSQLI_MULTIPLE_KEY_FLAG </item>
+ <item> MYSQLI_BLOB_FLAG </item>
+ <item> MYSQLI_UNSIGNED_FLAG </item>
+ <item> MYSQLI_ZEROFILL_FLAG </item>
+ <item> MYSQLI_AUTO_INCREMENT_FLAG </item>
+ <item> MYSQLI_TIMESTAMP_FLAG </item>
+ <item> MYSQLI_SET_FLAG </item>
+ <item> MYSQLI_NUM_FLAG </item>
+ <item> MYSQLI_PART_KEY_FLAG </item>
+ <item> MYSQLI_GROUP_FLAG </item>
+ <item> MYSQLI_TYPE_DECIMAL </item>
+ <item> MYSQLI_TYPE_TINY </item>
+ <item> MYSQLI_TYPE_SHORT </item>
+ <item> MYSQLI_TYPE_LONG </item>
+ <item> MYSQLI_TYPE_FLOAT </item>
+ <item> MYSQLI_TYPE_DOUBLE </item>
+ <item> MYSQLI_TYPE_NULL </item>
+ <item> MYSQLI_TYPE_TIMESTAMP </item>
+ <item> MYSQLI_TYPE_LONGLONG </item>
+ <item> MYSQLI_TYPE_INT24 </item>
+ <item> MYSQLI_TYPE_DATE </item>
+ <item> MYSQLI_TYPE_TIME </item>
+ <item> MYSQLI_TYPE_DATETIME </item>
+ <item> MYSQLI_TYPE_YEAR </item>
+ <item> MYSQLI_TYPE_NEWDATE </item>
+ <item> MYSQLI_TYPE_ENUM </item>
+ <item> MYSQLI_TYPE_SET </item>
+ <item> MYSQLI_TYPE_TINY_BLOB </item>
+ <item> MYSQLI_TYPE_MEDIUM_BLOB </item>
+ <item> MYSQLI_TYPE_LONG_BLOB </item>
+ <item> MYSQLI_TYPE_BLOB </item>
+ <item> MYSQLI_TYPE_VAR_STRING </item>
+ <item> MYSQLI_TYPE_STRING </item>
+ <item> MYSQLI_TYPE_CHAR </item>
+ <item> MYSQLI_TYPE_INTERVAL </item>
+ <item> MYSQLI_TYPE_GEOMETRY </item>
+ <item> MYSQLI_RPL_MASTER </item>
+ <item> MYSQLI_RPL_SLAVE </item>
+ <item> MYSQLI_RPL_ADMIN </item>
+ <item> MYSQLI_NO_DATA </item>
+ <item> MYSQLI_REPORT_INDEX </item>
+ <item> MYSQLI_REPORT_ERROR </item>
+ <item> MYSQLI_REPORT_ALL </item>
+ <item> MYSQLI_REPORT_OFF </item>
+ <item> NCURSES_COLOR_BLACK </item>
+ <item> NCURSES_COLOR_RED </item>
+ <item> NCURSES_COLOR_GREEN </item>
+ <item> NCURSES_COLOR_YELLOW </item>
+ <item> NCURSES_COLOR_BLUE </item>
+ <item> NCURSES_COLOR_MAGENTA </item>
+ <item> NCURSES_COLOR_CYAN </item>
+ <item> NCURSES_COLOR_WHITE </item>
+ <item> NCURSES_KEY_DOWN </item>
+ <item> NCURSES_KEY_UP </item>
+ <item> NCURSES_KEY_LEFT </item>
+ <item> NCURSES_KEY_RIGHT </item>
+ <item> NCURSES_KEY_BACKSPACE </item>
+ <item> NCURSES_KEY_MOUSE </item>
+ <item> NCURSES_KEY_F0 </item>
+ <item> NCURSES_KEY_F1 </item>
+ <item> NCURSES_KEY_F2 </item>
+ <item> NCURSES_KEY_F3 </item>
+ <item> NCURSES_KEY_F4 </item>
+ <item> NCURSES_KEY_F5 </item>
+ <item> NCURSES_KEY_F6 </item>
+ <item> NCURSES_KEY_F7 </item>
+ <item> NCURSES_KEY_F8 </item>
+ <item> NCURSES_KEY_F9 </item>
+ <item> NCURSES_KEY_F10 </item>
+ <item> NCURSES_KEY_F11 </item>
+ <item> NCURSES_KEY_F12 </item>
+ <item> NCURSES_KEY_DL </item>
+ <item> NCURSES_KEY_IL </item>
+ <item> NCURSES_KEY_DC </item>
+ <item> NCURSES_KEY_IC </item>
+ <item> NCURSES_KEY_EIC </item>
+ <item> NCURSES_KEY_CLEAR </item>
+ <item> NCURSES_KEY_EOS </item>
+ <item> NCURSES_KEY_EOL </item>
+ <item> NCURSES_KEY_SF </item>
+ <item> NCURSES_KEY_SR </item>
+ <item> NCURSES_KEY_NPAGE </item>
+ <item> NCURSES_KEY_PPAGE </item>
+ <item> NCURSES_KEY_STAB </item>
+ <item> NCURSES_KEY_CTAB </item>
+ <item> NCURSES_KEY_CATAB </item>
+ <item> NCURSES_KEY_ENTER </item>
+ <item> NCURSES_KEY_SRESET </item>
+ <item> NCURSES_KEY_RESET </item>
+ <item> NCURSES_KEY_PRINT </item>
+ <item> NCURSES_KEY_LL </item>
+ <item> NCURSES_KEY_A1 </item>
+ <item> NCURSES_KEY_A3 </item>
+ <item> NCURSES_KEY_B2 </item>
+ <item> NCURSES_KEY_C1 </item>
+ <item> NCURSES_KEY_C3 </item>
+ <item> NCURSES_KEY_BTAB </item>
+ <item> NCURSES_KEY_BEG </item>
+ <item> NCURSES_KEY_CANCEL </item>
+ <item> NCURSES_KEY_CLOSE </item>
+ <item> NCURSES_KEY_COMMAND </item>
+ <item> NCURSES_KEY_COPY </item>
+ <item> NCURSES_KEY_CREATE </item>
+ <item> NCURSES_KEY_END </item>
+ <item> NCURSES_KEY_EXIT </item>
+ <item> NCURSES_KEY_FIND </item>
+ <item> NCURSES_KEY_HELP </item>
+ <item> NCURSES_KEY_MARK </item>
+ <item> NCURSES_KEY_MESSAGE </item>
+ <item> NCURSES_KEY_MOVE </item>
+ <item> NCURSES_KEY_NEXT </item>
+ <item> NCURSES_KEY_OPEN </item>
+ <item> NCURSES_KEY_OPTIONS </item>
+ <item> NCURSES_KEY_PREVIOUS </item>
+ <item> NCURSES_KEY_REDO </item>
+ <item> NCURSES_KEY_REFERENCE </item>
+ <item> NCURSES_KEY_REFRESH </item>
+ <item> NCURSES_KEY_REPLACE </item>
+ <item> NCURSES_KEY_RESTART </item>
+ <item> NCURSES_KEY_RESUME </item>
+ <item> NCURSES_KEY_SAVE </item>
+ <item> NCURSES_KEY_SBEG </item>
+ <item> NCURSES_KEY_SCANCEL </item>
+ <item> NCURSES_KEY_SCOMMAND </item>
+ <item> NCURSES_KEY_SCOPY </item>
+ <item> NCURSES_KEY_SCREATE </item>
+ <item> NCURSES_KEY_SDC </item>
+ <item> NCURSES_KEY_SDL </item>
+ <item> NCURSES_KEY_SELECT </item>
+ <item> NCURSES_KEY_SEND </item>
+ <item> NCURSES_KEY_SEOL </item>
+ <item> NCURSES_KEY_SEXIT </item>
+ <item> NCURSES_KEY_SFIND </item>
+ <item> NCURSES_KEY_SHELP </item>
+ <item> NCURSES_KEY_SHOME </item>
+ <item> NCURSES_KEY_SIC </item>
+ <item> NCURSES_KEY_SLEFT </item>
+ <item> NCURSES_KEY_SMESSAGE </item>
+ <item> NCURSES_KEY_SMOVE </item>
+ <item> NCURSES_KEY_SNEXT </item>
+ <item> NCURSES_KEY_SOPTIONS </item>
+ <item> NCURSES_KEY_SPREVIOUS </item>
+ <item> NCURSES_KEY_SPRINT </item>
+ <item> NCURSES_KEY_SREDO </item>
+ <item> NCURSES_KEY_SREPLACE </item>
+ <item> NCURSES_KEY_SRIGHT </item>
+ <item> NCURSES_KEY_SRSUME </item>
+ <item> NCURSES_KEY_SSAVE </item>
+ <item> NCURSES_KEY_SSUSPEND </item>
+ <item> NCURSES_KEY_SUNDO </item>
+ <item> NCURSES_KEY_SUSPEND </item>
+ <item> NCURSES_KEY_UNDO </item>
+ <item> NCURSES_KEY_RESIZE </item>
+ <item> NCURSES_A_NORMAL </item>
+ <item> NCURSES_A_STANDOUT </item>
+ <item> NCURSES_A_UNDERLINE </item>
+ <item> NCURSES_A_REVERSE </item>
+ <item> NCURSES_A_BLINK </item>
+ <item> NCURSES_A_DIM </item>
+ <item> NCURSES_A_BOLD </item>
+ <item> NCURSES_A_PROTECT </item>
+ <item> NCURSES_A_INVIS </item>
+ <item> NCURSES_A_ALTCHARSET </item>
+ <item> NCURSES_A_CHARTEXT </item>
+ <item> NCURSES_BUTTON1_PRESSED </item>
+ <item> NCURSES_BUTTON1_RELEASED </item>
+ <item> NCURSES_BUTTON1_CLICKED </item>
+ <item> NCURSES_BUTTON1_DOUBLE_CLICKED </item>
+ <item> NCURSES_BUTTON1_TRIPLE_CLICKED </item>
+ <item> NCURSES_BUTTON2_PRESSED </item>
+ <item> NCURSES_BUTTON2_RELEASED </item>
+ <item> NCURSES_BUTTON2_CLICKED </item>
+ <item> NCURSES_BUTTON2_DOUBLE_CLICKED </item>
+ <item> NCURSES_BUTTON2_TRIPLE_CLICKED </item>
+ <item> NCURSES_BUTTON3_PRESSED </item>
+ <item> NCURSES_BUTTON3_RELEASED </item>
+ <item> NCURSES_BUTTON3_CLICKED </item>
+ <item> NCURSES_BUTTON3_DOUBLE_CLICKED </item>
+ <item> NCURSES_BUTTON3_TRIPLE_CLICKED </item>
+ <item> NCURSES_BUTTON4_PRESSED </item>
+ <item> NCURSES_BUTTON4_RELEASED </item>
+ <item> NCURSES_BUTTON4_CLICKED </item>
+ <item> NCURSES_BUTTON4_DOUBLE_CLICKED </item>
+ <item> NCURSES_BUTTON4_TRIPLE_CLICKED </item>
+ <item> NCURSES_BUTTON_SHIFT </item>
+ <item> NCURSES_BUTTON_CTRL </item>
+ <item> NCURSES_BUTTON_ALT </item>
+ <item> NCURSES_ALL_MOUSE_EVENTS </item>
+ <item> NCURSES_REPORT_MOUSE_POSITION </item>
+ <item> ODBC_TYPE </item>
+ <item> ODBC_BINMODE_PASSTHRU </item>
+ <item> ODBC_BINMODE_RETURN </item>
+ <item> ODBC_BINMODE_CONVERT </item>
+ <item> SQL_ODBC_CURSORS </item>
+ <item> SQL_CUR_USE_DRIVER </item>
+ <item> SQL_CUR_USE_IF_NEEDED </item>
+ <item> SQL_CUR_USE_ODBC </item>
+ <item> SQL_CONCURRENCY </item>
+ <item> SQL_CONCUR_READ_ONLY </item>
+ <item> SQL_CONCUR_LOCK </item>
+ <item> SQL_CONCUR_ROWVER </item>
+ <item> SQL_CONCUR_VALUES </item>
+ <item> SQL_CURSOR_TYPE </item>
+ <item> SQL_CURSOR_FORWARD_ONLY </item>
+ <item> SQL_CURSOR_KEYSET_DRIVEN </item>
+ <item> SQL_CURSOR_DYNAMIC </item>
+ <item> SQL_CURSOR_STATIC </item>
+ <item> SQL_KEYSET_SIZE </item>
+ <item> SQL_FETCH_FIRST </item>
+ <item> SQL_FETCH_NEXT </item>
+ <item> SQL_CHAR </item>
+ <item> SQL_VARCHAR </item>
+ <item> SQL_LONGVARCHAR </item>
+ <item> SQL_DECIMAL </item>
+ <item> SQL_NUMERIC </item>
+ <item> SQL_BIT </item>
+ <item> SQL_TINYINT </item>
+ <item> SQL_SMALLINT </item>
+ <item> SQL_INTEGER </item>
+ <item> SQL_BIGINT </item>
+ <item> SQL_REAL </item>
+ <item> SQL_FLOAT </item>
+ <item> SQL_DOUBLE </item>
+ <item> SQL_BINARY </item>
+ <item> SQL_VARBINARY </item>
+ <item> SQL_LONGVARBINARY </item>
+ <item> SQL_DATE </item>
+ <item> SQL_TIME </item>
+ <item> SQL_TIMESTAMP </item>
+ <item> X509_PURPOSE_SSL_CLIENT </item>
+ <item> X509_PURPOSE_SSL_SERVER </item>
+ <item> X509_PURPOSE_NS_SSL_SERVER </item>
+ <item> X509_PURPOSE_SMIME_SIGN </item>
+ <item> X509_PURPOSE_SMIME_ENCRYPT </item>
+ <item> X509_PURPOSE_CRL_SIGN </item>
+ <item> X509_PURPOSE_ANY </item>
+ <item> OPENSSL_ALGO_SHA1 </item>
+ <item> OPENSSL_ALGO_MD5 </item>
+ <item> OPENSSL_ALGO_MD4 </item>
+ <item> OPENSSL_ALGO_MD2 </item>
+ <item> PKCS7_DETACHED </item>
+ <item> PKCS7_TEXT </item>
+ <item> PKCS7_NOINTERN </item>
+ <item> PKCS7_NOVERIFY </item>
+ <item> PKCS7_NOCHAIN </item>
+ <item> PKCS7_NOCERTS </item>
+ <item> PKCS7_NOATTR </item>
+ <item> PKCS7_BINARY </item>
+ <item> PKCS7_NOSIGS </item>
+ <item> OPENSSL_PKCS1_PADDING </item>
+ <item> OPENSSL_SSLV23_PADDING </item>
+ <item> OPENSSL_NO_PADDING </item>
+ <item> OPENSSL_PKCS1_OAEP_PADDING </item>
+ <item> OPENSSL_CIPHER_RC2_40 </item>
+ <item> OPENSSL_CIPHER_RC2_128 </item>
+ <item> OPENSSL_CIPHER_RC2_64 </item>
+ <item> OPENSSL_CIPHER_DES </item>
+ <item> OPENSSL_CIPHER_3DES </item>
+ <item> OPENSSL_KEYTYPE_RSA </item>
+ <item> OPENSSL_KEYTYPE_DSA </item>
+ <item> OPENSSL_KEYTYPE_DH </item>
+ <item> WNOHANG </item>
+ <item> WUNTRACED </item>
+ <item> SIG_IGN </item>
+ <item> SIG_DFL </item>
+ <item> SIG_ERR </item>
+ <item> SIGHUP </item>
+ <item> SIGINT </item>
+ <item> SIGQUIT </item>
+ <item> SIGILL </item>
+ <item> SIGTRAP </item>
+ <item> SIGABRT </item>
+ <item> SIGIOT </item>
+ <item> SIGBUS </item>
+ <item> SIGFPE </item>
+ <item> SIGKILL </item>
+ <item> SIGUSR1 </item>
+ <item> SIGSEGV </item>
+ <item> SIGUSR2 </item>
+ <item> SIGPIPE </item>
+ <item> SIGALRM </item>
+ <item> SIGTERM </item>
+ <item> SIGSTKFLT </item>
+ <item> SIGCLD </item>
+ <item> SIGCHLD </item>
+ <item> SIGCONT </item>
+ <item> SIGSTOP </item>
+ <item> SIGTSTP </item>
+ <item> SIGTTIN </item>
+ <item> SIGTTOU </item>
+ <item> SIGURG </item>
+ <item> SIGXCPU </item>
+ <item> SIGXFSZ </item>
+ <item> SIGVTALRM </item>
+ <item> SIGPROF </item>
+ <item> SIGWINCH </item>
+ <item> SIGPOLL </item>
+ <item> SIGIO </item>
+ <item> SIGPWR </item>
+ <item> SIGSYS </item>
+ <item> SIGBABY </item>
+ <item> PRIO_PGRP </item>
+ <item> PRIO_USER </item>
+ <item> PRIO_PROCESS </item>
+ <item> PGSQL_CONNECT_FORCE_NEW </item>
+ <item> PGSQL_ASSOC </item>
+ <item> PGSQL_NUM </item>
+ <item> PGSQL_BOTH </item>
+ <item> PGSQL_CONNECTION_BAD </item>
+ <item> PGSQL_CONNECTION_OK </item>
+ <item> PGSQL_SEEK_SET </item>
+ <item> PGSQL_SEEK_CUR </item>
+ <item> PGSQL_SEEK_END </item>
+ <item> PGSQL_STATUS_LONG </item>
+ <item> PGSQL_STATUS_STRING </item>
+ <item> PGSQL_EMPTY_QUERY </item>
+ <item> PGSQL_COMMAND_OK </item>
+ <item> PGSQL_TUPLES_OK </item>
+ <item> PGSQL_COPY_OUT </item>
+ <item> PGSQL_COPY_IN </item>
+ <item> PGSQL_BAD_RESPONSE </item>
+ <item> PGSQL_NONFATAL_ERROR </item>
+ <item> PGSQL_FATAL_ERROR </item>
+ <item> PGSQL_CONV_IGNORE_DEFAULT </item>
+ <item> PGSQL_CONV_FORCE_NULL </item>
+ <item> PGSQL_CONV_IGNORE_NOT_NULL </item>
+ <item> PGSQL_DML_NO_CONV </item>
+ <item> PGSQL_DML_EXEC </item>
+ <item> PGSQL_DML_ASYNC </item>
+ <item> PGSQL_DML_STRING </item>
+ <item> SNMP_VALUE_LIBRARY </item>
+ <item> SNMP_VALUE_PLAIN </item>
+ <item> SNMP_VALUE_OBJECT </item>
+ <item> SNMP_BIT_STR </item>
+ <item> SNMP_OCTET_STR </item>
+ <item> SNMP_OPAQUE </item>
+ <item> SNMP_NULL </item>
+ <item> SNMP_OBJECT_ID </item>
+ <item> SNMP_IPADDRESS </item>
+ <item> SNMP_COUNTER </item>
+ <item> SNMP_UNSIGNED </item>
+ <item> SNMP_TIMETICKS </item>
+ <item> SNMP_UINTEGER </item>
+ <item> SNMP_INTEGER </item>
+ <item> SNMP_COUNTER64 </item>
+ <item> SOAP_1_1 </item>
+ <item> SOAP_1_2 </item>
+ <item> SOAP_PERSISTENCE_SESSION </item>
+ <item> SOAP_PERSISTENCE_REQUEST </item>
+ <item> SOAP_FUNCTIONS_ALL </item>
+ <item> SOAP_ENCODED </item>
+ <item> SOAP_LITERAL </item>
+ <item> SOAP_RPC </item>
+ <item> SOAP_DOCUMENT </item>
+ <item> SOAP_ACTOR_NEXT </item>
+ <item> SOAP_ACTOR_NONE </item>
+ <item> SOAP_ACTOR_UNLIMATERECEIVER </item>
+ <item> SOAP_COMPRESSION_ACCEPT </item>
+ <item> SOAP_COMPRESSION_GZIP </item>
+ <item> SOAP_COMPRESSION_DEFLATE </item>
+ <item> UNKNOWN_TYPE </item>
+ <item> XSD_STRING </item>
+ <item> XSD_BOOLEAN </item>
+ <item> XSD_DECIMAL </item>
+ <item> XSD_FLOAT </item>
+ <item> XSD_DOUBLE </item>
+ <item> XSD_DURATION </item>
+ <item> XSD_DATETIME </item>
+ <item> XSD_TIME </item>
+ <item> XSD_DATE </item>
+ <item> XSD_GYEARMONTH </item>
+ <item> XSD_GYEAR </item>
+ <item> XSD_GMONTHDAY </item>
+ <item> XSD_GDAY </item>
+ <item> XSD_GMONTH </item>
+ <item> XSD_HEXBINARY </item>
+ <item> XSD_BASE64BINARY </item>
+ <item> XSD_ANYURI </item>
+ <item> XSD_QNAME </item>
+ <item> XSD_NOTATION </item>
+ <item> XSD_NORMALIZEDSTRING </item>
+ <item> XSD_TOKEN </item>
+ <item> XSD_LANGUAGE </item>
+ <item> XSD_NMTOKEN </item>
+ <item> XSD_NAME </item>
+ <item> XSD_NCNAME </item>
+ <item> XSD_ID </item>
+ <item> XSD_IDREF </item>
+ <item> XSD_IDREFS </item>
+ <item> XSD_ENTITY </item>
+ <item> XSD_ENTITIES </item>
+ <item> XSD_INTEGER </item>
+ <item> XSD_NONPOSITIVEINTEGER </item>
+ <item> XSD_NEGATIVEINTEGER </item>
+ <item> XSD_LONG </item>
+ <item> XSD_INT </item>
+ <item> XSD_SHORT </item>
+ <item> XSD_BYTE </item>
+ <item> XSD_NONNEGATIVEINTEGER </item>
+ <item> XSD_UNSIGNEDLONG </item>
+ <item> XSD_UNSIGNEDINT </item>
+ <item> XSD_UNSIGNEDSHORT </item>
+ <item> XSD_UNSIGNEDBYTE </item>
+ <item> XSD_POSITIVEINTEGER </item>
+ <item> XSD_NMTOKENS </item>
+ <item> XSD_ANYTYPE </item>
+ <item> SOAP_ENC_OBJECT </item>
+ <item> SOAP_ENC_ARRAY </item>
+ <item> XSD_1999_TIMEINSTANT </item>
+ <item> XSD_NAMESPACE </item>
+ <item> XSD_1999_NAMESPACE </item>
+ <item> AF_UNIX </item>
+ <item> AF_INET </item>
+ <item> AF_INET6 </item>
+ <item> SOCK_STREAM </item>
+ <item> SOCK_DGRAM </item>
+ <item> SOCK_RAW </item>
+ <item> SOCK_SEQPACKET </item>
+ <item> SOCK_RDM </item>
+ <item> MSG_OOB </item>
+ <item> MSG_WAITALL </item>
+ <item> MSG_PEEK </item>
+ <item> MSG_DONTROUTE </item>
+ <item> SO_DEBUG </item>
+ <item> SO_REUSEADDR </item>
+ <item> SO_KEEPALIVE </item>
+ <item> SO_DONTROUTE </item>
+ <item> SO_LINGER </item>
+ <item> SO_BROADCAST </item>
+ <item> SO_OOBINLINE </item>
+ <item> SO_SNDBUF </item>
+ <item> SO_RCVBUF </item>
+ <item> SO_SNDLOWAT </item>
+ <item> SO_RCVLOWAT </item>
+ <item> SO_SNDTIMEO </item>
+ <item> SO_RCVTIMEO </item>
+ <item> SO_TYPE </item>
+ <item> SO_ERROR </item>
+ <item> SOL_SOCKET </item>
+ <item> SOMAXCONN </item>
+ <item> PHP_NORMAL_READ </item>
+ <item> PHP_BINARY_READ </item>
+ <item> SOCKET_EPERM </item>
+ <item> SOCKET_ENOENT </item>
+ <item> SOCKET_EINTR </item>
+ <item> SOCKET_EIO </item>
+ <item> SOCKET_ENXIO </item>
+ <item> SOCKET_E2BIG </item>
+ <item> SOCKET_EBADF </item>
+ <item> SOCKET_EAGAIN </item>
+ <item> SOCKET_ENOMEM </item>
+ <item> SOCKET_EACCES </item>
+ <item> SOCKET_EFAULT </item>
+ <item> SOCKET_ENOTBLK </item>
+ <item> SOCKET_EBUSY </item>
+ <item> SOCKET_EEXIST </item>
+ <item> SOCKET_EXDEV </item>
+ <item> SOCKET_ENODEV </item>
+ <item> SOCKET_ENOTDIR </item>
+ <item> SOCKET_EISDIR </item>
+ <item> SOCKET_EINVAL </item>
+ <item> SOCKET_ENFILE </item>
+ <item> SOCKET_EMFILE </item>
+ <item> SOCKET_ENOTTY </item>
+ <item> SOCKET_ENOSPC </item>
+ <item> SOCKET_ESPIPE </item>
+ <item> SOCKET_EROFS </item>
+ <item> SOCKET_EMLINK </item>
+ <item> SOCKET_EPIPE </item>
+ <item> SOCKET_ENAMETOOLONG </item>
+ <item> SOCKET_ENOLCK </item>
+ <item> SOCKET_ENOSYS </item>
+ <item> SOCKET_ENOTEMPTY </item>
+ <item> SOCKET_ELOOP </item>
+ <item> SOCKET_EWOULDBLOCK </item>
+ <item> SOCKET_ENOMSG </item>
+ <item> SOCKET_EIDRM </item>
+ <item> SOCKET_ECHRNG </item>
+ <item> SOCKET_EL2NSYNC </item>
+ <item> SOCKET_EL3HLT </item>
+ <item> SOCKET_EL3RST </item>
+ <item> SOCKET_ELNRNG </item>
+ <item> SOCKET_EUNATCH </item>
+ <item> SOCKET_ENOCSI </item>
+ <item> SOCKET_EL2HLT </item>
+ <item> SOCKET_EBADE </item>
+ <item> SOCKET_EBADR </item>
+ <item> SOCKET_EXFULL </item>
+ <item> SOCKET_ENOANO </item>
+ <item> SOCKET_EBADRQC </item>
+ <item> SOCKET_EBADSLT </item>
+ <item> SOCKET_ENOSTR </item>
+ <item> SOCKET_ENODATA </item>
+ <item> SOCKET_ETIME </item>
+ <item> SOCKET_ENOSR </item>
+ <item> SOCKET_ENONET </item>
+ <item> SOCKET_EREMOTE </item>
+ <item> SOCKET_ENOLINK </item>
+ <item> SOCKET_EADV </item>
+ <item> SOCKET_ESRMNT </item>
+ <item> SOCKET_ECOMM </item>
+ <item> SOCKET_EPROTO </item>
+ <item> SOCKET_EMULTIHOP </item>
+ <item> SOCKET_EBADMSG </item>
+ <item> SOCKET_ENOTUNIQ </item>
+ <item> SOCKET_EBADFD </item>
+ <item> SOCKET_EREMCHG </item>
+ <item> SOCKET_ERESTART </item>
+ <item> SOCKET_ESTRPIPE </item>
+ <item> SOCKET_EUSERS </item>
+ <item> SOCKET_ENOTSOCK </item>
+ <item> SOCKET_EDESTADDRREQ </item>
+ <item> SOCKET_EMSGSIZE </item>
+ <item> SOCKET_EPROTOTYPE </item>
+ <item> SOCKET_ENOPROTOOPT </item>
+ <item> SOCKET_EPROTONOSUPPORT </item>
+ <item> SOCKET_ESOCKTNOSUPPORT </item>
+ <item> SOCKET_EOPNOTSUPP </item>
+ <item> SOCKET_EPFNOSUPPORT </item>
+ <item> SOCKET_EAFNOSUPPORT </item>
+ <item> SOCKET_EADDRINUSE </item>
+ <item> SOCKET_EADDRNOTAVAIL </item>
+ <item> SOCKET_ENETDOWN </item>
+ <item> SOCKET_ENETUNREACH </item>
+ <item> SOCKET_ENETRESET </item>
+ <item> SOCKET_ECONNABORTED </item>
+ <item> SOCKET_ECONNRESET </item>
+ <item> SOCKET_ENOBUFS </item>
+ <item> SOCKET_EISCONN </item>
+ <item> SOCKET_ENOTCONN </item>
+ <item> SOCKET_ESHUTDOWN </item>
+ <item> SOCKET_ETOOMANYREFS </item>
+ <item> SOCKET_ETIMEDOUT </item>
+ <item> SOCKET_ECONNREFUSED </item>
+ <item> SOCKET_EHOSTDOWN </item>
+ <item> SOCKET_EHOSTUNREACH </item>
+ <item> SOCKET_EALREADY </item>
+ <item> SOCKET_EINPROGRESS </item>
+ <item> SOCKET_EISNAM </item>
+ <item> SOCKET_EREMOTEIO </item>
+ <item> SOCKET_EDQUOT </item>
+ <item> SOCKET_ENOMEDIUM </item>
+ <item> SOCKET_EMEDIUMTYPE </item>
+ <item> SOL_TCP </item>
+ <item> SOL_UDP </item>
+ <item> SQLITE_BOTH </item>
+ <item> SQLITE_NUM </item>
+ <item> SQLITE_ASSOC </item>
+ <item> SQLITE_OK </item>
+ <item> SQLITE_ERROR </item>
+ <item> SQLITE_INTERNAL </item>
+ <item> SQLITE_PERM </item>
+ <item> SQLITE_ABORT </item>
+ <item> SQLITE_BUSY </item>
+ <item> SQLITE_LOCKED </item>
+ <item> SQLITE_NOMEM </item>
+ <item> SQLITE_READONLY </item>
+ <item> SQLITE_INTERRUPT </item>
+ <item> SQLITE_IOERR </item>
+ <item> SQLITE_CORRUPT </item>
+ <item> SQLITE_NOTFOUND </item>
+ <item> SQLITE_FULL </item>
+ <item> SQLITE_CANTOPEN </item>
+ <item> SQLITE_PROTOCOL </item>
+ <item> SQLITE_EMPTY </item>
+ <item> SQLITE_SCHEMA </item>
+ <item> SQLITE_TOOBIG </item>
+ <item> SQLITE_CONSTRAINT </item>
+ <item> SQLITE_MISMATCH </item>
+ <item> SQLITE_MISUSE </item>
+ <item> SQLITE_NOLFS </item>
+ <item> SQLITE_AUTH </item>
+ <item> SQLITE_FORMAT </item>
+ <item> SQLITE_ROW </item>
+ <item> SQLITE_DONE </item>
+ <item> MSG_IPC_NOWAIT </item>
+ <item> MSG_NOERROR </item>
+ <item> MSG_EXCEPT </item>
+ <item> T_INCLUDE </item>
+ <item> T_INCLUDE_ONCE </item>
+ <item> T_EVAL </item>
+ <item> T_REQUIRE </item>
+ <item> T_REQUIRE_ONCE </item>
+ <item> T_LOGICAL_OR </item>
+ <item> T_LOGICAL_XOR </item>
+ <item> T_LOGICAL_AND </item>
+ <item> T_PRINT </item>
+ <item> T_PLUS_EQUAL </item>
+ <item> T_MINUS_EQUAL </item>
+ <item> T_MUL_EQUAL </item>
+ <item> T_DIV_EQUAL </item>
+ <item> T_CONCAT_EQUAL </item>
+ <item> T_MOD_EQUAL </item>
+ <item> T_AND_EQUAL </item>
+ <item> T_OR_EQUAL </item>
+ <item> T_XOR_EQUAL </item>
+ <item> T_SL_EQUAL </item>
+ <item> T_SR_EQUAL </item>
+ <item> T_BOOLEAN_OR </item>
+ <item> T_BOOLEAN_AND </item>
+ <item> T_IS_EQUAL </item>
+ <item> T_IS_NOT_EQUAL </item>
+ <item> T_IS_IDENTICAL </item>
+ <item> T_IS_NOT_IDENTICAL </item>
+ <item> T_IS_SMALLER_OR_EQUAL </item>
+ <item> T_IS_GREATER_OR_EQUAL </item>
+ <item> T_SL </item>
+ <item> T_SR </item>
+ <item> T_INC </item>
+ <item> T_DEC </item>
+ <item> T_INT_CAST </item>
+ <item> T_DOUBLE_CAST </item>
+ <item> T_STRING_CAST </item>
+ <item> T_ARRAY_CAST </item>
+ <item> T_OBJECT_CAST </item>
+ <item> T_BOOL_CAST </item>
+ <item> T_UNSET_CAST </item>
+ <item> T_NEW </item>
+ <item> T_EXIT </item>
+ <item> T_IF </item>
+ <item> T_ELSEIF </item>
+ <item> T_ELSE </item>
+ <item> T_ENDIF </item>
+ <item> T_LNUMBER </item>
+ <item> T_DNUMBER </item>
+ <item> T_STRING </item>
+ <item> T_STRING_VARNAME </item>
+ <item> T_VARIABLE </item>
+ <item> T_NUM_STRING </item>
+ <item> T_INLINE_HTML </item>
+ <item> T_CHARACTER </item>
+ <item> T_BAD_CHARACTER </item>
+ <item> T_ENCAPSED_AND_WHITESPACE </item>
+ <item> T_CONSTANT_ENCAPSED_STRING </item>
+ <item> T_ECHO </item>
+ <item> T_DO </item>
+ <item> T_WHILE </item>
+ <item> T_ENDWHILE </item>
+ <item> T_FOR </item>
+ <item> T_ENDFOR </item>
+ <item> T_FOREACH </item>
+ <item> T_ENDFOREACH </item>
+ <item> T_DECLARE </item>
+ <item> T_ENDDECLARE </item>
+ <item> T_AS </item>
+ <item> T_SWITCH </item>
+ <item> T_ENDSWITCH </item>
+ <item> T_CASE </item>
+ <item> T_DEFAULT </item>
+ <item> T_BREAK </item>
+ <item> T_CONTINUE </item>
+ <item> T_FUNCTION </item>
+ <item> T_CONST </item>
+ <item> T_RETURN </item>
+ <item> T_USE </item>
+ <item> T_GLOBAL </item>
+ <item> T_STATIC </item>
+ <item> T_VAR </item>
+ <item> T_UNSET </item>
+ <item> T_ISSET </item>
+ <item> T_EMPTY </item>
+ <item> T_CLASS </item>
+ <item> T_EXTENDS </item>
+ <item> T_INTERFACE </item>
+ <item> T_IMPLEMENTS </item>
+ <item> T_OBJECT_OPERATOR </item>
+ <item> T_DOUBLE_ARROW </item>
+ <item> T_LIST </item>
+ <item> T_ARRAY </item>
+ <item> T_CLASS_C </item>
+ <item> T_FUNC_C </item>
+ <item> T_METHOD_C </item>
+ <item> T_LINE </item>
+ <item> T_FILE </item>
+ <item> T_COMMENT </item>
+ <item> T_DOC_COMMENT </item>
+ <item> T_OPEN_TAG </item>
+ <item> T_OPEN_TAG_WITH_ECHO </item>
+ <item> T_CLOSE_TAG </item>
+ <item> T_WHITESPACE </item>
+ <item> T_START_HEREDOC </item>
+ <item> T_END_HEREDOC </item>
+ <item> T_DOLLAR_OPEN_CURLY_BRACES </item>
+ <item> T_CURLY_OPEN </item>
+ <item> T_PAAMAYIM_NEKUDOTAYIM </item>
+ <item> T_DOUBLE_COLON </item>
+ <item> T_ABSTRACT </item>
+ <item> T_CATCH </item>
+ <item> T_FINAL </item>
+ <item> T_INSTANCEOF </item>
+ <item> T_PRIVATE </item>
+ <item> T_PROTECTED </item>
+ <item> T_PUBLIC </item>
+ <item> T_THROW </item>
+ <item> T_TRY </item>
+ <item> T_CLONE </item>
+ <item> XSL_CLONE_AUTO </item>
+ <item> XSL_CLONE_NEVER </item>
+ <item> XSL_CLONE_ALWAYS </item>
+ <item> YPERR_BADARGS </item>
+ <item> YPERR_BADDB </item>
+ <item> YPERR_BUSY </item>
+ <item> YPERR_DOMAIN </item>
+ <item> YPERR_KEY </item>
+ <item> YPERR_MAP </item>
+ <item> YPERR_NODOM </item>
+ <item> YPERR_NOMORE </item>
+ <item> YPERR_PMAP </item>
+ <item> YPERR_RESRC </item>
+ <item> YPERR_RPC </item>
+ <item> YPERR_YPBIND </item>
+ <item> YPERR_YPERR </item>
+ <item> YPERR_YPSERV </item>
+ <item> YPERR_VERS </item>
+ <item> FORCE_GZIP </item>
+ <item> FORCE_DEFLATE </item>
+
+
+ </list>
+
+ <list name="special_methods">
+ <item> __autoload </item>
+ <item> __call </item>
+ <item> __clone </item>
+ <item> __construct </item>
+ <item> __destruct </item>
+ <item> __get </item>
+ <item> __isset </item>
+ <item> __set </item>
+ <item> __set_state </item>
+ <item> __sleep </item>
+ <item> __toString </item>
+ <item> __unset </item>
+ <item> __wakeup </item>
+ </list>
+
+ <list name="functions">
+ <item> abs </item>
+ <item> acos </item>
+ <item> acosh </item>
+ <item> addcslashes </item>
+ <item> addslashes </item>
+ <item> apache_get_modules </item>
+ <item> apache_get_version </item>
+ <item> apache_getenv </item>
+ <item> apache_lookup_uri </item>
+ <item> apache_note </item>
+ <item> apache_request_headers </item>
+ <item> apache_response_headers </item>
+ <item> apache_setenv </item>
+ <item> array </item>
+ <item> array_change_key_case </item>
+ <item> array_chunk </item>
+ <item> array_combine </item>
+ <item> array_count_values </item>
+ <item> array_diff </item>
+ <item> array_diff_assoc </item>
+ <item> array_diff_key </item>
+ <item> array_diff_uassoc </item>
+ <item> array_diff_ukey </item>
+ <item> array_diff </item>
+ <item> array_fill </item>
+ <item> array_filter </item>
+ <item> array_flip </item>
+ <item> array_intersect </item>
+ <item> array_intersect_assoc </item>
+ <item> array_intersect_key </item>
+ <item> array_intersect_uassoc </item>
+ <item> array_intersect_ukey </item>
+ <item> array_intersect </item>
+ <item> array_key_exists </item>
+ <item> array_keys </item>
+ <item> array_map </item>
+ <item> array_merge </item>
+ <item> array_merge_recursive </item>
+ <item> array_multisort </item>
+ <item> array_pad </item>
+ <item> array_pop </item>
+ <item> array_product </item>
+ <item> array_push </item>
+ <item> array_rand </item>
+ <item> array_reduce </item>
+ <item> array_reverse </item>
+ <item> array_search </item>
+ <item> array_shift </item>
+ <item> array_slice </item>
+ <item> array_splice </item>
+ <item> array_sum </item>
+ <item> array_udiff </item>
+ <item> array_udiff_assoc </item>
+ <item> array_udiff_uassoc </item>
+ <item> array_uintersect </item>
+ <item> array_uintersect_assoc </item>
+ <item> array_uintersect_uassoc </item>
+ <item> array_uintersect </item>
+ <item> array_unique </item>
+ <item> array_unshift </item>
+ <item> array_values </item>
+ <item> array_walk </item>
+ <item> array_walk_recursive </item>
+ <item> arsort </item>
+ <item> ascii2ebcdic </item>
+ <item> asin </item>
+ <item> asinh </item>
+ <item> asort </item>
+ <item> aspell_check </item>
+ <item> aspell_check_raw </item>
+ <item> aspell_new </item>
+ <item> aspell_suggest </item>
+ <item> assert </item>
+ <item> assert_options </item>
+ <item> atan </item>
+ <item> atan2 </item>
+ <item> atanh </item>
+ <item> base64_decode </item>
+ <item> base64_encode </item>
+ <item> base_convert </item>
+ <item> basename </item>
+ <item> bcadd </item>
+ <item> bccomp </item>
+ <item> bcdiv </item>
+ <item> bcmod </item>
+ <item> bcmul </item>
+ <item> bcpow </item>
+ <item> bcpowmod </item>
+ <item> bcscale </item>
+ <item> bcsqrt </item>
+ <item> bcsub </item>
+ <item> bin2hex </item>
+ <item> bind_textdomain_codeset </item>
+ <item> bindec </item>
+ <item> bindtextdomain </item>
+ <item> bzclose </item>
+ <item> bzcompress </item>
+ <item> bzdecompress </item>
+ <item> bzerrno </item>
+ <item> bzerror </item>
+ <item> bzerrstr </item>
+ <item> bzflush </item>
+ <item> bzopen </item>
+ <item> bzread </item>
+ <item> bzwrite </item>
+ <item> cal_days_in_month </item>
+ <item> cal_from_jd </item>
+ <item> cal_info </item>
+ <item> cal_to_jd </item>
+ <item> call_user_func </item>
+ <item> call_user_func_array </item>
+ <item> call_user_method </item>
+ <item> call_user_method_array </item>
+ <item> ccvs_add </item>
+ <item> ccvs_auth </item>
+ <item> ccvs_command </item>
+ <item> ccvs_count </item>
+ <item> ccvs_delete </item>
+ <item> ccvs_done </item>
+ <item> ccvs_init </item>
+ <item> ccvs_lookup </item>
+ <item> ccvs_new </item>
+ <item> ccvs_report </item>
+ <item> ccvs_return </item>
+ <item> ccvs_reverse </item>
+ <item> ccvs_sale </item>
+ <item> ccvs_status </item>
+ <item> ccvs_textvalue </item>
+ <item> ccvs_void </item>
+ <item> ceil </item>
+ <item> chdir </item>
+ <item> checkdate </item>
+ <item> checkdnsrr </item>
+ <item> chgrp </item>
+ <item> chmod </item>
+ <item> chop </item>
+ <item> chown </item>
+ <item> chr </item>
+ <item> chroot </item>
+ <item> chunk_split </item>
+ <item> class_exists </item>
+ <item> class_implements </item>
+ <item> class_parents </item>
+ <item> clearstatcache </item>
+ <item> closedir </item>
+ <item> closelog </item>
+ <item> com </item>
+ <item> com_addref </item>
+ <item> com_get </item>
+ <item> com_invoke </item>
+ <item> com_isenum </item>
+ <item> com_load </item>
+ <item> com_load_typelib </item>
+ <item> com_propget </item>
+ <item> com_propput </item>
+ <item> com_propset </item>
+ <item> com_release </item>
+ <item> com_set </item>
+ <item> compact </item>
+ <item> connection_aborted </item>
+ <item> connection_status </item>
+ <item> connection_timeout </item>
+ <item> constant </item>
+ <item> convert_cyr_string </item>
+ <item> convert_uudecode </item>
+ <item> convert_uuencode </item>
+ <item> copy </item>
+ <item> cos </item>
+ <item> cosh </item>
+ <item> count </item>
+ <item> count_chars </item>
+ <item> cpdf_add_annotation </item>
+ <item> cpdf_add_outline </item>
+ <item> cpdf_arc </item>
+ <item> cpdf_begin_text </item>
+ <item> cpdf_circle </item>
+ <item> cpdf_clip </item>
+ <item> cpdf_close </item>
+ <item> cpdf_closepath </item>
+ <item> cpdf_closepath_fill_stroke </item>
+ <item> cpdf_closepath_stroke </item>
+ <item> cpdf_continue_text </item>
+ <item> cpdf_curveto </item>
+ <item> cpdf_end_text </item>
+ <item> cpdf_fill </item>
+ <item> cpdf_fill_stroke </item>
+ <item> cpdf_finalize </item>
+ <item> cpdf_finalize_page </item>
+ <item> cpdf_global_set_document_limits </item>
+ <item> cpdf_import_jpeg </item>
+ <item> cpdf_lineto </item>
+ <item> cpdf_moveto </item>
+ <item> cpdf_newpath </item>
+ <item> cpdf_open </item>
+ <item> cpdf_output_buffer </item>
+ <item> cpdf_page_init </item>
+ <item> cpdf_place_inline_image </item>
+ <item> cpdf_rect </item>
+ <item> cpdf_restore </item>
+ <item> cpdf_rlineto </item>
+ <item> cpdf_rmoveto </item>
+ <item> cpdf_rotate </item>
+ <item> cpdf_rotate_text </item>
+ <item> cpdf_save </item>
+ <item> cpdf_save_to_file </item>
+ <item> cpdf_scale </item>
+ <item> cpdf_set_action_url </item>
+ <item> cpdf_set_char_spacing </item>
+ <item> cpdf_set_creator </item>
+ <item> cpdf_set_current_page </item>
+ <item> cpdf_set_font </item>
+ <item> cpdf_set_font_directories </item>
+ <item> cpdf_set_font_map_file </item>
+ <item> cpdf_set_horiz_scaling </item>
+ <item> cpdf_set_keywords </item>
+ <item> cpdf_set_leading </item>
+ <item> cpdf_set_page_animation </item>
+ <item> cpdf_set_subject </item>
+ <item> cpdf_set_text_matrix </item>
+ <item> cpdf_set_text_pos </item>
+ <item> cpdf_set_text_rendering </item>
+ <item> cpdf_set_text_rise </item>
+ <item> cpdf_set_title </item>
+ <item> cpdf_set_viewer_preferences </item>
+ <item> cpdf_set_word_spacing </item>
+ <item> cpdf_setdash </item>
+ <item> cpdf_setflat </item>
+ <item> cpdf_setgray </item>
+ <item> cpdf_setgray_fill </item>
+ <item> cpdf_setgray_stroke </item>
+ <item> cpdf_setlinecap </item>
+ <item> cpdf_setlinejoin </item>
+ <item> cpdf_setlinewidth </item>
+ <item> cpdf_setmiterlimit </item>
+ <item> cpdf_setrgbcolor </item>
+ <item> cpdf_setrgbcolor_fill </item>
+ <item> cpdf_setrgbcolor_stroke </item>
+ <item> cpdf_show </item>
+ <item> cpdf_show_xy </item>
+ <item> cpdf_stringwidth </item>
+ <item> cpdf_stroke </item>
+ <item> cpdf_text </item>
+ <item> cpdf_translate </item>
+ <item> crack_check </item>
+ <item> crack_closedict </item>
+ <item> crack_getlastmessage </item>
+ <item> crack_opendict </item>
+ <item> crc32 </item>
+ <item> create_function </item>
+ <item> crypt </item>
+ <item> ctype_alnum </item>
+ <item> ctype_alpha </item>
+ <item> ctype_cntrl </item>
+ <item> ctype_digit </item>
+ <item> ctype_graph </item>
+ <item> ctype_lower </item>
+ <item> ctype_print </item>
+ <item> ctype_punct </item>
+ <item> ctype_space </item>
+ <item> ctype_upper </item>
+ <item> ctype_xdigit </item>
+ <item> curl_close </item>
+ <item> curl_copy_handle </item>
+ <item> curl_errno </item>
+ <item> curl_error </item>
+ <item> curl_exec </item>
+ <item> curl_getinfo </item>
+ <item> curl_init </item>
+ <item> curl_multi_add_handle </item>
+ <item> curl_multi_close </item>
+ <item> curl_multi_exec </item>
+ <item> curl_multi_getcontent </item>
+ <item> curl_multi_info_read </item>
+ <item> curl_multi_init </item>
+ <item> curl_multi_remove_handle </item>
+ <item> curl_multi_select </item>
+ <item> curl_setopt </item>
+ <item> curl_version </item>
+ <item> current </item>
+ <item> cybercash_base64_decode </item>
+ <item> cybercash_base64_encode </item>
+ <item> cybercash_decr </item>
+ <item> cybercash_encr </item>
+ <item> cybermut_creerformulairecm </item>
+ <item> cybermut_creerreponsecm </item>
+ <item> cybermut_testmac </item>
+ <item> cyrus_authenticate </item>
+ <item> cyrus_bind </item>
+ <item> cyrus_close </item>
+ <item> cyrus_connect </item>
+ <item> cyrus_query </item>
+ <item> cyrus_unbind </item>
+ <item> date </item>
+ <item> date_sunrise </item>
+ <item> date_sunset </item>
+ <item> dba_close </item>
+ <item> dba_delete </item>
+ <item> dba_exists </item>
+ <item> dba_fetch </item>
+ <item> dba_firstkey </item>
+ <item> dba_handlers </item>
+ <item> dba_insert </item>
+ <item> dba_key_split </item>
+ <item> dba_list </item>
+ <item> dba_nextkey </item>
+ <item> dba_open </item>
+ <item> dba_optimize </item>
+ <item> dba_popen </item>
+ <item> dba_replace </item>
+ <item> dba_sync </item>
+ <item> dbase_add_record </item>
+ <item> dbase_close </item>
+ <item> dbase_create </item>
+ <item> dbase_delete_record </item>
+ <item> dbase_get_header_info </item>
+ <item> dbase_get_record </item>
+ <item> dbase_get_record_with_names </item>
+ <item> dbase_numfields </item>
+ <item> dbase_numrecords </item>
+ <item> dbase_open </item>
+ <item> dbase_pack </item>
+ <item> dbase_replace_record </item>
+ <item> dblist </item>
+ <item> dbmclose </item>
+ <item> dbmdelete </item>
+ <item> dbmexists </item>
+ <item> dbmfetch </item>
+ <item> dbmfirstkey </item>
+ <item> dbminsert </item>
+ <item> dbmnextkey </item>
+ <item> dbmopen </item>
+ <item> dbmreplace </item>
+ <item> dbplus_add </item>
+ <item> dbplus_aql </item>
+ <item> dbplus_chdir </item>
+ <item> dbplus_close </item>
+ <item> dbplus_curr </item>
+ <item> dbplus_errcode </item>
+ <item> dbplus_errno </item>
+ <item> dbplus_find </item>
+ <item> dbplus_first </item>
+ <item> dbplus_flush </item>
+ <item> dbplus_freealllocks </item>
+ <item> dbplus_freelock </item>
+ <item> dbplus_freerlocks </item>
+ <item> dbplus_getlock </item>
+ <item> dbplus_getunique </item>
+ <item> dbplus_info </item>
+ <item> dbplus_last </item>
+ <item> dbplus_lockrel </item>
+ <item> dbplus_next </item>
+ <item> dbplus_open </item>
+ <item> dbplus_prev </item>
+ <item> dbplus_rchperm </item>
+ <item> dbplus_rcreate </item>
+ <item> dbplus_rcrtexact </item>
+ <item> dbplus_rcrtlike </item>
+ <item> dbplus_resolve </item>
+ <item> dbplus_restorepos </item>
+ <item> dbplus_rkeys </item>
+ <item> dbplus_ropen </item>
+ <item> dbplus_rquery </item>
+ <item> dbplus_rrename </item>
+ <item> dbplus_rsecindex </item>
+ <item> dbplus_runlink </item>
+ <item> dbplus_rzap </item>
+ <item> dbplus_savepos </item>
+ <item> dbplus_setindex </item>
+ <item> dbplus_setindexbynumber </item>
+ <item> dbplus_sql </item>
+ <item> dbplus_tcl </item>
+ <item> dbplus_tremove </item>
+ <item> dbplus_undo </item>
+ <item> dbplus_undoprepare </item>
+ <item> dbplus_unlockrel </item>
+ <item> dbplus_unselect </item>
+ <item> dbplus_update </item>
+ <item> dbplus_xlockrel </item>
+ <item> dbplus_xunlockrel </item>
+ <item> dbx_close </item>
+ <item> dbx_compare </item>
+ <item> dbx_connect </item>
+ <item> dbx_error </item>
+ <item> dbx_escape_string </item>
+ <item> dbx_fetch_row </item>
+ <item> dbx_query </item>
+ <item> dbx_sort </item>
+ <item> dcgettext </item>
+ <item> dcngettext </item>
+ <item> debug_backtrace </item>
+ <item> debug_print_backtrace </item>
+ <item> debug_zval_dump </item>
+ <item> dcgettext </item>
+ <item> dcngettext </item>
+ <item> debugger_off </item>
+ <item> debugger_on </item>
+ <item> decbin </item>
+ <item> dechex </item>
+ <item> decoct </item>
+ <item> define </item>
+ <item> define_syslog_variables </item>
+ <item> defined </item>
+ <item> deg2rad </item>
+ <item> delete </item>
+ <item> dgettext </item>
+ <item> die </item>
+ <item> dio_close </item>
+ <item> dio_fcntl </item>
+ <item> dio_open </item>
+ <item> dio_read </item>
+ <item> dio_seek </item>
+ <item> dio_stat </item>
+ <item> dio_tcsetattr </item>
+ <item> dio_truncate </item>
+ <item> dio_write </item>
+ <item> dir </item>
+ <item> dirname </item>
+ <item> disk_free_space </item>
+ <item> disk_total_space </item>
+ <item> diskfreespace </item>
+ <item> dl </item>
+ <item> dngettext </item>
+ <item> dns_check_record </item>
+ <item> dns_get_mx </item>
+ <item> dns_get_record </item>
+ <item> dom_import_simplexml </item>
+ <item> dngettext </item>
+ <item> domxml_add_root </item>
+ <item> domxml_attributes </item>
+ <item> domxml_children </item>
+ <item> domxml_dumpmem </item>
+ <item> domxml_get_attribute </item>
+ <item> domxml_new_child </item>
+ <item> domxml_new_xmldoc </item>
+ <item> domxml_node </item>
+ <item> domxml_node_set_content </item>
+ <item> domxml_node_unlink_node </item>
+ <item> domxml_root </item>
+ <item> domxml_set_attribute </item>
+ <item> domxml_version </item>
+ <item> dotnet_load </item>
+ <item> doubleval </item>
+ <item> each </item>
+ <item> easter_date </item>
+ <item> easter_days </item>
+ <item> ebcdic2ascii </item>
+ <item> echo </item>
+ <item> empty </item>
+ <item> end </item>
+ <item> ereg </item>
+ <item> ereg_replace </item>
+ <item> eregi </item>
+ <item> eregi_replace </item>
+ <item> error_log </item>
+ <item> error_reporting </item>
+ <item> escapeshellarg </item>
+ <item> escapeshellcmd </item>
+ <item> eval </item>
+ <item> exec </item>
+ <item> exif_imagetype </item>
+ <item> exif_read_data </item>
+ <item> exif_tagname </item>
+ <item> exif_thumbnail </item>
+ <item> exit </item>
+ <item> exp </item>
+ <item> explode </item>
+ <item> expm1 </item>
+ <item> extension_loaded </item>
+ <item> extract </item>
+ <item> ezmlm_hash </item>
+ <item> fam_cancel_monitor </item>
+ <item> fam_close </item>
+ <item> fam_monitor_collection </item>
+ <item> fam_monitor_directory </item>
+ <item> fam_monitor_file </item>
+ <item> fam_next_event </item>
+ <item> fam_open </item>
+ <item> fam_pending </item>
+ <item> fam_resume_monitor </item>
+ <item> fam_suspend_monitor </item>
+ <item> fbsql_affected_rows </item>
+ <item> fbsql_autocommit </item>
+ <item> fbsql_change_user </item>
+ <item> fbsql_close </item>
+ <item> fbsql_commit </item>
+ <item> fbsql_connect </item>
+ <item> fbsql_create_blob </item>
+ <item> fbsql_create_clob </item>
+ <item> fbsql_create_db </item>
+ <item> fbsql_data_seek </item>
+ <item> fbsql_database </item>
+ <item> fbsql_database_password </item>
+ <item> fbsql_db_query </item>
+ <item> fbsql_db_status </item>
+ <item> fbsql_drop_db </item>
+ <item> fbsql_errno </item>
+ <item> fbsql_error </item>
+ <item> fbsql_fetch_array </item>
+ <item> fbsql_fetch_assoc </item>
+ <item> fbsql_fetch_field </item>
+ <item> fbsql_fetch_lengths </item>
+ <item> fbsql_fetch_object </item>
+ <item> fbsql_fetch_row </item>
+ <item> fbsql_field_flags </item>
+ <item> fbsql_field_len </item>
+ <item> fbsql_field_name </item>
+ <item> fbsql_field_seek </item>
+ <item> fbsql_field_table </item>
+ <item> fbsql_field_type </item>
+ <item> fbsql_free_result </item>
+ <item> fbsql_get_autostart_info </item>
+ <item> fbsql_hostname </item>
+ <item> fbsql_insert_id </item>
+ <item> fbsql_list_dbs </item>
+ <item> fbsql_list_fields </item>
+ <item> fbsql_list_tables </item>
+ <item> fbsql_next_result </item>
+ <item> fbsql_num_fields </item>
+ <item> fbsql_num_rows </item>
+ <item> fbsql_password </item>
+ <item> fbsql_pconnect </item>
+ <item> fbsql_query </item>
+ <item> fbsql_read_blob </item>
+ <item> fbsql_read_clob </item>
+ <item> fbsql_result </item>
+ <item> fbsql_rollback </item>
+ <item> fbsql_select_db </item>
+ <item> fbsql_set_lob_mode </item>
+ <item> fbsql_set_transaction </item>
+ <item> fbsql_start_db </item>
+ <item> fbsql_stop_db </item>
+ <item> fbsql_tablename </item>
+ <item> fbsql_username </item>
+ <item> fbsql_warnings </item>
+ <item> fclose </item>
+ <item> fdf_add_template </item>
+ <item> fdf_close </item>
+ <item> fdf_create </item>
+ <item> fdf_get_file </item>
+ <item> fdf_get_status </item>
+ <item> fdf_get_value </item>
+ <item> fdf_next_field_name </item>
+ <item> fdf_open </item>
+ <item> fdf_save </item>
+ <item> fdf_set_ap </item>
+ <item> fdf_set_encoding </item>
+ <item> fdf_set_file </item>
+ <item> fdf_set_flags </item>
+ <item> fdf_set_javascript_action </item>
+ <item> fdf_set_opt </item>
+ <item> fdf_set_status </item>
+ <item> fdf_set_submit_form_action </item>
+ <item> fdf_set_value </item>
+ <item> feof </item>
+ <item> fflush </item>
+ <item> fgetc </item>
+ <item> fgetcsv </item>
+ <item> fgets </item>
+ <item> fgetss </item>
+ <item> fgetwrapperdata </item>
+ <item> file </item>
+ <item> file_exists </item>
+ <item> file_get_contents </item>
+ <item> file_put_contents </item>
+ <item> fileatime </item>
+ <item> filectime </item>
+ <item> filegroup </item>
+ <item> fileinode </item>
+ <item> filemtime </item>
+ <item> fileowner </item>
+ <item> fileperms </item>
+ <item> filepro </item>
+ <item> filepro_fieldcount </item>
+ <item> filepro_fieldname </item>
+ <item> filepro_fieldtype </item>
+ <item> filepro_fieldwidth </item>
+ <item> filepro_retrieve </item>
+ <item> filepro_rowcount </item>
+ <item> filesize </item>
+ <item> filetype </item>
+ <item> floatval </item>
+ <item> flock </item>
+ <item> floor </item>
+ <item> flush </item>
+ <item> fmod </item>
+ <item> fnmatch </item>
+ <item> fopen </item>
+ <item> fpassthru </item>
+ <item> fprintf </item>
+ <item> fputs </item>
+ <item> fread </item>
+ <item> frenchtojd </item>
+ <item> fribidi_log2vis </item>
+ <item> fscanf </item>
+ <item> fseek </item>
+ <item> fsockopen </item>
+ <item> fstat </item>
+ <item> ftell </item>
+ <item> ftok </item>
+ <item> ftp_alloc </item>
+ <item> ftp_cdup </item>
+ <item> ftp_chdir </item>
+ <item> ftp_chmod </item>
+ <item> ftp_close </item>
+ <item> ftp_connect </item>
+ <item> ftp_delete </item>
+ <item> ftp_exec </item>
+ <item> ftp_fget </item>
+ <item> ftp_fput </item>
+ <item> ftp_get </item>
+ <item> ftp_get_option </item>
+ <item> ftp_login </item>
+ <item> ftp_mdtm </item>
+ <item> ftp_mkdir </item>
+ <item> ftp_nb_continue </item>
+ <item> ftp_nb_fget </item>
+ <item> ftp_nb_fput </item>
+ <item> ftp_nb_get </item>
+ <item> ftp_nb_put </item>
+ <item> ftp_nlist </item>
+ <item> ftp_pasv </item>
+ <item> ftp_put </item>
+ <item> ftp_pwd </item>
+ <item> ftp_quit </item>
+ <item> ftp_raw </item>
+ <item> ftp_rawlist </item>
+ <item> ftp_rename </item>
+ <item> ftp_rmdir </item>
+ <item> ftp_set_option </item>
+ <item> ftp_site </item>
+ <item> ftp_size </item>
+ <item> ftp_ssl_connect </item>
+ <item> ftp_systype </item>
+ <item> ftruncate </item>
+ <item> func_get_arg </item>
+ <item> func_get_args </item>
+ <item> func_num_args </item>
+ <item> function_exists </item>
+ <item> fwrite </item>
+ <item> gd_info </item>
+ <item> get_browser </item>
+ <item> get_cfg_var </item>
+ <item> get_class </item>
+ <item> get_class_methods </item>
+ <item> get_class_vars </item>
+ <item> get_current_user </item>
+ <item> get_declared_classes </item>
+ <item> get_declared_interfaces </item>
+ <item> get_defined_constants </item>
+ <item> get_defined_functions </item>
+ <item> get_defined_vars </item>
+ <item> get_extension_funcs </item>
+ <item> get_headers </item>
+ <item> get_html_translation_table </item>
+ <item> get_include_path </item>
+ <item> get_included_files </item>
+ <item> get_loaded_extensions </item>
+ <item> get_magic_quotes_gpc </item>
+ <item> get_magic_quotes_runtime </item>
+ <item> get_meta_tags </item>
+ <item> get_object_vars </item>
+ <item> get_parent_class </item>
+ <item> get_required_files </item>
+ <item> get_resource_type </item>
+ <item> getallheaders </item>
+ <item> getcwd </item>
+ <item> getdate </item>
+ <item> getenv </item>
+ <item> gethostbyaddr </item>
+ <item> gethostbyname </item>
+ <item> gethostbynamel </item>
+ <item> getimagesize </item>
+ <item> getlastmod </item>
+ <item> getmxrr </item>
+ <item> getmygid </item>
+ <item> getmyinode </item>
+ <item> getmypid </item>
+ <item> getmyuid </item>
+ <item> getopt </item>
+ <item> getprotobyname </item>
+ <item> getprotobynumber </item>
+ <item> getrandmax </item>
+ <item> getrusage </item>
+ <item> getservbyname </item>
+ <item> getservbyport </item>
+ <item> gettext </item>
+ <item> gettimeofday </item>
+ <item> gettype </item>
+ <item> glob </item>
+ <item> global </item>
+ <item> gmdate </item>
+ <item> gmmktime </item>
+ <item> gmp_abs </item>
+ <item> gmp_add </item>
+ <item> gmp_and </item>
+ <item> gmp_clrbit </item>
+ <item> gmp_cmp </item>
+ <item> gmp_com </item>
+ <item> gmp_div </item>
+ <item> gmp_div_q </item>
+ <item> gmp_div_qr </item>
+ <item> gmp_div_r </item>
+ <item> gmp_divexact </item>
+ <item> gmp_fact </item>
+ <item> gmp_gcd </item>
+ <item> gmp_gcdext </item>
+ <item> gmp_hamdist </item>
+ <item> gmp_init </item>
+ <item> gmp_intval </item>
+ <item> gmp_invert </item>
+ <item> gmp_jacobi </item>
+ <item> gmp_legendre </item>
+ <item> gmp_mod </item>
+ <item> gmp_mul </item>
+ <item> gmp_neg </item>
+ <item> gmp_or </item>
+ <item> gmp_perfect_square </item>
+ <item> gmp_popcount </item>
+ <item> gmp_pow </item>
+ <item> gmp_powm </item>
+ <item> gmp_prob_prime </item>
+ <item> gmp_random </item>
+ <item> gmp_scan0 </item>
+ <item> gmp_scan1 </item>
+ <item> gmp_setbit </item>
+ <item> gmp_sign </item>
+ <item> gmp_sqrt </item>
+ <item> gmp_sqrtrem </item>
+ <item> gmp_strval </item>
+ <item> gmp_sub </item>
+ <item> gmp_xor </item>
+ <item> gmstrftime </item>
+ <item> gregoriantojd </item>
+ <item> gzclose </item>
+ <item> gzcompress </item>
+ <item> gzdeflate </item>
+ <item> gzencode </item>
+ <item> gzeof </item>
+ <item> gzfile </item>
+ <item> gzgetc </item>
+ <item> gzgets </item>
+ <item> gzgetss </item>
+ <item> gzinflate </item>
+ <item> gzopen </item>
+ <item> gzpassthru </item>
+ <item> gzputs </item>
+ <item> gzread </item>
+ <item> gzrewind </item>
+ <item> gzseek </item>
+ <item> gztell </item>
+ <item> gzuncompress </item>
+ <item> gzwrite </item>
+ <item> header </item>
+ <item> headers_list </item>
+ <item> headers_sent </item>
+ <item> hebrev </item>
+ <item> hebrevc </item>
+ <item> hexdec </item>
+ <item> highlight_file </item>
+ <item> highlight_string </item>
+ <item> html_entity_decode </item>
+ <item> htmlentities </item>
+ <item> htmlspecialchars </item>
+ <item> http_build_query </item>
+ <item> hw_array2objrec </item>
+ <item> hw_changeobject </item>
+ <item> hw_children </item>
+ <item> hw_childrenobj </item>
+ <item> hw_close </item>
+ <item> hw_connect </item>
+ <item> hw_connection_info </item>
+ <item> hw_cp </item>
+ <item> hw_deleteobject </item>
+ <item> hw_docbyanchor </item>
+ <item> hw_docbyanchorobj </item>
+ <item> hw_document_attributes </item>
+ <item> hw_document_bodytag </item>
+ <item> hw_document_content </item>
+ <item> hw_document_setcontent </item>
+ <item> hw_document_size </item>
+ <item> hw_dummy </item>
+ <item> hw_edittext </item>
+ <item> hw_error </item>
+ <item> hw_errormsg </item>
+ <item> hw_free_document </item>
+ <item> hw_getanchors </item>
+ <item> hw_getanchorsobj </item>
+ <item> hw_getandlock </item>
+ <item> hw_getchildcoll </item>
+ <item> hw_getchildcollobj </item>
+ <item> hw_getchilddoccoll </item>
+ <item> hw_getchilddoccollobj </item>
+ <item> hw_getobject </item>
+ <item> hw_getobjectbyquery </item>
+ <item> hw_getobjectbyquerycoll </item>
+ <item> hw_getobjectbyquerycollobj </item>
+ <item> hw_getobjectbyqueryobj </item>
+ <item> hw_getparents </item>
+ <item> hw_getparentsobj </item>
+ <item> hw_getrellink </item>
+ <item> hw_getremote </item>
+ <item> hw_getremotechildren </item>
+ <item> hw_getsrcbydestobj </item>
+ <item> hw_gettext </item>
+ <item> hw_getusername </item>
+ <item> hw_identify </item>
+ <item> hw_incollections </item>
+ <item> hw_info </item>
+ <item> hw_inscoll </item>
+ <item> hw_insdoc </item>
+ <item> hw_insertanchors </item>
+ <item> hw_insertdocument </item>
+ <item> hw_insertobject </item>
+ <item> hw_mapid </item>
+ <item> hw_modifyobject </item>
+ <item> hw_mv </item>
+ <item> hw_new_document </item>
+ <item> hw_objrec2array </item>
+ <item> hw_output_document </item>
+ <item> hw_pconnect </item>
+ <item> hw_pipedocument </item>
+ <item> hw_root </item>
+ <item> hw_setlinkroot </item>
+ <item> hw_stat </item>
+ <item> hw_unlock </item>
+ <item> hw_who </item>
+ <item> hypot </item>
+ <item> idate </item>
+ <item> ibase_blob_add </item>
+ <item> ibase_blob_cancel </item>
+ <item> ibase_blob_close </item>
+ <item> ibase_blob_create </item>
+ <item> ibase_blob_echo </item>
+ <item> ibase_blob_get </item>
+ <item> ibase_blob_import </item>
+ <item> ibase_blob_info </item>
+ <item> ibase_blob_open </item>
+ <item> ibase_close </item>
+ <item> ibase_commit </item>
+ <item> ibase_connect </item>
+ <item> ibase_errmsg </item>
+ <item> ibase_execute </item>
+ <item> ibase_fetch_object </item>
+ <item> ibase_fetch_row </item>
+ <item> ibase_field_info </item>
+ <item> ibase_free_query </item>
+ <item> ibase_free_result </item>
+ <item> ibase_num_fields </item>
+ <item> ibase_pconnect </item>
+ <item> ibase_prepare </item>
+ <item> ibase_query </item>
+ <item> ibase_rollback </item>
+ <item> ibase_timefmt </item>
+ <item> ibase_trans </item>
+ <item> icap_close </item>
+ <item> icap_create_calendar </item>
+ <item> icap_delete_calendar </item>
+ <item> icap_delete_event </item>
+ <item> icap_fetch_event </item>
+ <item> icap_list_alarms </item>
+ <item> icap_list_events </item>
+ <item> icap_open </item>
+ <item> icap_rename_calendar </item>
+ <item> icap_reopen </item>
+ <item> icap_snooze </item>
+ <item> icap_store_event </item>
+ <item> iconv </item>
+ <item> iconv_get_encoding </item>
+ <item> iconv_mime_decode </item>
+ <item> iconv_mime_decode_headers </item>
+ <item> iconv_mime_encode </item>
+ <item> iconv_set_encoding </item>
+ <item> ifx_affected_rows </item>
+ <item> ifx_blobinfile_mode </item>
+ <item> ifx_byteasvarchar </item>
+ <item> ifx_close </item>
+ <item> ifx_connect </item>
+ <item> ifx_copy_blob </item>
+ <item> ifx_create_blob </item>
+ <item> ifx_create_char </item>
+ <item> ifx_do </item>
+ <item> ifx_error </item>
+ <item> ifx_errormsg </item>
+ <item> ifx_fetch_row </item>
+ <item> ifx_fieldproperties </item>
+ <item> ifx_fieldtypes </item>
+ <item> ifx_free_blob </item>
+ <item> ifx_free_char </item>
+ <item> ifx_free_result </item>
+ <item> ifx_get_blob </item>
+ <item> ifx_get_char </item>
+ <item> ifx_getsqlca </item>
+ <item> ifx_htmltbl_result </item>
+ <item> ifx_nullformat </item>
+ <item> ifx_num_fields </item>
+ <item> ifx_num_rows </item>
+ <item> ifx_pconnect </item>
+ <item> ifx_prepare </item>
+ <item> ifx_query </item>
+ <item> ifx_textasvarchar </item>
+ <item> ifx_update_blob </item>
+ <item> ifx_update_char </item>
+ <item> ifxus_close_slob </item>
+ <item> ifxus_create_slob </item>
+ <item> ifxus_free_slob </item>
+ <item> ifxus_open_slob </item>
+ <item> ifxus_read_slob </item>
+ <item> ifxus_seek_slob </item>
+ <item> ifxus_tell_slob </item>
+ <item> ifxus_write_slob </item>
+ <item> ignore_user_abort </item>
+ <item> image2wbmp </item>
+ <item> image_type_to_mime_type </item>
+ <item> imagealphablending </item>
+ <item> imageantialias </item>
+ <item> imagearc </item>
+ <item> imagechar </item>
+ <item> imagecharup </item>
+ <item> imagecolorallocate </item>
+ <item> imagecolorallocatealpha </item>
+ <item> imagecolorat </item>
+ <item> imagecolorclosest </item>
+ <item> imagecolorclosestalpha </item>
+ <item> imagecolorclosesthwb </item>
+ <item> imagecolordeallocate </item>
+ <item> imagecolorexact </item>
+ <item> imagecolorexactalpha </item>
+ <item> imagecolormatch </item>
+ <item> imagecolorresolve </item>
+ <item> imagecolorresolvealpha </item>
+ <item> imagecolorset </item>
+ <item> imagecolorsforindex </item>
+ <item> imagecolorstotal </item>
+ <item> imagecolortransparent </item>
+ <item> imagecopy </item>
+ <item> imagecopymerge </item>
+ <item> imagecopymergegray </item>
+ <item> imagecopyresampled </item>
+ <item> imagecopyresized </item>
+ <item> imagecreate </item>
+ <item> imagecreatefromgd </item>
+ <item> imagecreatefromgd2 </item>
+ <item> imagecreatefromgd2part </item>
+ <item> imagecreatefromgif </item>
+ <item> imagecreatefromjpeg </item>
+ <item> imagecreatefrompng </item>
+ <item> imagecreatefromstring </item>
+ <item> imagecreatefromwbmp </item>
+ <item> imagecreatefromxbm </item>
+ <item> imagecreatefromxpm </item>
+ <item> imagecreatetruecolor </item>
+ <item> imagedashedline </item>
+ <item> imagedestroy </item>
+ <item> imageellipse </item>
+ <item> imagefill </item>
+ <item> imagefilledarc </item>
+ <item> imagefilledellipse </item>
+ <item> imagefilledpolygon </item>
+ <item> imagefilledrectangle </item>
+ <item> imagefilltoborder </item>
+ <item> imagefilter </item>
+ <item> imagefontheight </item>
+ <item> imagefontwidth </item>
+ <item> imageftbbox </item>
+ <item> imagefttext </item>
+ <item> imagegammacorrect </item>
+ <item> imagegd </item>
+ <item> imagegd2 </item>
+ <item> imagegif </item>
+ <item> imageinterlace </item>
+ <item> imageistruecolor </item>
+ <item> imagejpeg </item>
+ <item> imagelayereffect </item>
+ <item> imageline </item>
+ <item> imageloadfont </item>
+ <item> imagepalettecopy </item>
+ <item> imagepng </item>
+ <item> imagepolygon </item>
+ <item> imagepsbbox </item>
+ <item> imagepsencodefont </item>
+ <item> imagepsextendfont </item>
+ <item> imagepsfreefont </item>
+ <item> imagepsloadfont </item>
+ <item> imagepsslantfont </item>
+ <item> imagepstext </item>
+ <item> imagerectangle </item>
+ <item> imagerotate </item>
+ <item> imagesavealpha </item>
+ <item> imagesetbrush </item>
+ <item> imagesetpixel </item>
+ <item> imagesetstyle </item>
+ <item> imagesetthickness </item>
+ <item> imagesettile </item>
+ <item> imagestring </item>
+ <item> imagestringup </item>
+ <item> imagesx </item>
+ <item> imagesy </item>
+ <item> imagetruecolortopalette </item>
+ <item> imagettfbbox </item>
+ <item> imagettftext </item>
+ <item> imagetypes </item>
+ <item> imagewbmp </item>
+ <item> imagexbm </item>
+ <item> imap_8bit </item>
+ <item> imap_alerts </item>
+ <item> imap_append </item>
+ <item> imap_base64 </item>
+ <item> imap_binary </item>
+ <item> imap_body </item>
+ <item> imap_bodystruct </item>
+ <item> imap_check </item>
+ <item> imap_clearflag_full </item>
+ <item> imap_close </item>
+ <item> imap_create </item>
+ <item> imap_createmailbox </item>
+ <item> imap_delete </item>
+ <item> imap_deletemailbox </item>
+ <item> imap_errors </item>
+ <item> imap_expunge </item>
+ <item> imap_fetch_overview </item>
+ <item> imap_fetchbody </item>
+ <item> imap_fetchheader </item>
+ <item> imap_fetchstructure </item>
+ <item> imap_fetchtext </item>
+ <item> imap_get_quota </item>
+ <item> imap_get_quotaroot </item>
+ <item> imap_getacl </item>
+ <item> imap_getmailboxes </item>
+ <item> imap_getsubscribed </item>
+ <item> imap_header </item>
+ <item> imap_headerinfo </item>
+ <item> imap_headers </item>
+ <item> imap_last_error </item>
+ <item> imap_list </item>
+ <item> imap_listmailbox </item>
+ <item> imap_listsubscribed </item>
+ <item> imap_lsub </item>
+ <item> imap_mail </item>
+ <item> imap_mail_compose </item>
+ <item> imap_mail_copy </item>
+ <item> imap_mail_move </item>
+ <item> imap_mailboxmsginfo </item>
+ <item> imap_mime_header_decode </item>
+ <item> imap_msgno </item>
+ <item> imap_num_msg </item>
+ <item> imap_num_recent </item>
+ <item> imap_open </item>
+ <item> imap_ping </item>
+ <item> imap_popen </item>
+ <item> imap_qprint </item>
+ <item> imap_rename </item>
+ <item> imap_renamemailbox </item>
+ <item> imap_reopen </item>
+ <item> imap_rfc822_parse_adrlist </item>
+ <item> imap_rfc822_parse_headers </item>
+ <item> imap_rfc822_write_address </item>
+ <item> imap_scan </item>
+ <item> imap_scanmailbox </item>
+ <item> imap_search </item>
+ <item> imap_set_quota </item>
+ <item> imap_setacl </item>
+ <item> imap_setflag_full </item>
+ <item> imap_sort </item>
+ <item> imap_status </item>
+ <item> imap_subscribe </item>
+ <item> imap_thread </item>
+ <item> imap_timeout </item>
+ <item> imap_uid </item>
+ <item> imap_undelete </item>
+ <item> imap_unsubscribe </item>
+ <item> imap_utf7_decode </item>
+ <item> imap_utf7_encode </item>
+ <item> imap_utf8 </item>
+ <item> implode </item>
+ <item> import_request_variables </item>
+ <item> in_array </item>
+ <item> include </item>
+ <item> include_once </item>
+ <item> ingres_autocommit </item>
+ <item> ingres_close </item>
+ <item> ingres_commit </item>
+ <item> ingres_connect </item>
+ <item> ingres_fetch_array </item>
+ <item> ingres_fetch_object </item>
+ <item> ingres_fetch_row </item>
+ <item> ingres_field_length </item>
+ <item> ingres_field_name </item>
+ <item> ingres_field_nullable </item>
+ <item> ingres_field_precision </item>
+ <item> ingres_field_scale </item>
+ <item> ingres_field_type </item>
+ <item> ingres_num_fields </item>
+ <item> ingres_num_rows </item>
+ <item> ingres_pconnect </item>
+ <item> ingres_query </item>
+ <item> ingres_rollback </item>
+ <item> ini_alter </item>
+ <item> ini_get </item>
+ <item> ini_get_all </item>
+ <item> ini_restore </item>
+ <item> ini_set </item>
+ <item> interface_exists </item>
+ <item> intval </item>
+ <item> ip2long </item>
+ <item> iptcembed </item>
+ <item> iptcparse </item>
+ <item> ircg_channel_mode </item>
+ <item> ircg_disconnect </item>
+ <item> ircg_fetch_error_msg </item>
+ <item> ircg_get_username </item>
+ <item> ircg_html_encode </item>
+ <item> ircg_ignore_add </item>
+ <item> ircg_ignore_del </item>
+ <item> ircg_is_conn_alive </item>
+ <item> ircg_join </item>
+ <item> ircg_kick </item>
+ <item> ircg_lookup_format_messages </item>
+ <item> ircg_msg </item>
+ <item> ircg_nick </item>
+ <item> ircg_nickname_escape </item>
+ <item> ircg_nickname_unescape </item>
+ <item> ircg_notice </item>
+ <item> ircg_part </item>
+ <item> ircg_pconnect </item>
+ <item> ircg_register_format_messages </item>
+ <item> ircg_set_current </item>
+ <item> ircg_set_file </item>
+ <item> ircg_set_on_die </item>
+ <item> ircg_topic </item>
+ <item> ircg_whois </item>
+ <item> is_a </item>
+ <item> is_array </item>
+ <item> is_bool </item>
+ <item> is_callable </item>
+ <item> is_dir </item>
+ <item> is_double </item>
+ <item> is_executable </item>
+ <item> is_file </item>
+ <item> is_finite </item>
+ <item> is_float </item>
+ <item> is_infinite </item>
+ <item> is_int </item>
+ <item> is_integer </item>
+ <item> is_link </item>
+ <item> is_long </item>
+ <item> is_nan </item>
+ <item> is_null </item>
+ <item> is_numeric </item>
+ <item> is_object </item>
+ <item> is_readable </item>
+ <item> is_real </item>
+ <item> is_resource </item>
+ <item> is_scalar </item>
+ <item> is_string </item>
+ <item> is_subclass_of </item>
+ <item> is_uploaded_file </item>
+ <item> is_writable </item>
+ <item> is_writeable </item>
+ <item> isset </item>
+ <item> java_last_exception_clear </item>
+ <item> java_last_exception_get </item>
+ <item> jddayofweek </item>
+ <item> jdmonthname </item>
+ <item> jdtofrench </item>
+ <item> jdtogregorian </item>
+ <item> jdtojewish </item>
+ <item> jdtojulian </item>
+ <item> jdtounix </item>
+ <item> jewishtojd </item>
+ <item> join </item>
+ <item> jpeg2wbmp </item>
+ <item> juliantojd </item>
+ <item> key </item>
+ <item> key_exists </item>
+ <item> krsort </item>
+ <item> ksort </item>
+ <item> lcg_value </item>
+ <item> ldap_8859_to_t61 </item>
+ <item> ldap_add </item>
+ <item> ldap_bind </item>
+ <item> ldap_close </item>
+ <item> ldap_compare </item>
+ <item> ldap_connect </item>
+ <item> ldap_count_entries </item>
+ <item> ldap_delete </item>
+ <item> ldap_dn2ufn </item>
+ <item> ldap_err2str </item>
+ <item> ldap_errno </item>
+ <item> ldap_error </item>
+ <item> ldap_explode_dn </item>
+ <item> ldap_first_attribute </item>
+ <item> ldap_first_entry </item>
+ <item> ldap_first_reference </item>
+ <item> ldap_free_result </item>
+ <item> ldap_get_attributes </item>
+ <item> ldap_get_dn </item>
+ <item> ldap_get_entries </item>
+ <item> ldap_get_option </item>
+ <item> ldap_get_values </item>
+ <item> ldap_get_values_len </item>
+ <item> ldap_list </item>
+ <item> ldap_mod_add </item>
+ <item> ldap_mod_del </item>
+ <item> ldap_mod_replace </item>
+ <item> ldap_modify </item>
+ <item> ldap_next_attribute </item>
+ <item> ldap_next_entry </item>
+ <item> ldap_next_reference </item>
+ <item> ldap_parse_reference </item>
+ <item> ldap_parse_result </item>
+ <item> ldap_read </item>
+ <item> ldap_rename </item>
+ <item> ldap_search </item>
+ <item> ldap_set_option </item>
+ <item> ldap_set_rebind_proc </item>
+ <item> ldap_sort </item>
+ <item> ldap_start_tls </item>
+ <item> ldap_t61_to_8859 </item>
+ <item> ldap_unbind </item>
+ <item> leak </item>
+ <item> levenshtein </item>
+ <item> libxml_set_streams_context </item>
+ <item> link </item>
+ <item> linkinfo </item>
+ <item> list </item>
+ <item> localeconv </item>
+ <item> localtime </item>
+ <item> log </item>
+ <item> log10 </item>
+ <item> log1p </item>
+ <item> long2ip </item>
+ <item> lstat </item>
+ <item> ltrim </item>
+ <item> magic_quotes_runtime </item>
+ <item> mail </item>
+ <item> mailparse_determine_best_xfer_encoding </item>
+ <item> mailparse_msg_create </item>
+ <item> mailparse_msg_extract_part </item>
+ <item> mailparse_msg_extract_part_file </item>
+ <item> mailparse_msg_free </item>
+ <item> mailparse_msg_get_part </item>
+ <item> mailparse_msg_get_part_data </item>
+ <item> mailparse_msg_get_structure </item>
+ <item> mailparse_msg_parse </item>
+ <item> mailparse_msg_parse_file </item>
+ <item> mailparse_rfc822_parse_addresses </item>
+ <item> mailparse_stream_encode </item>
+ <item> mailparse_uudecode_all </item>
+ <item> max </item>
+ <item> mb_convert_case </item>
+ <item> mb_convert_encoding </item>
+ <item> mb_convert_kana </item>
+ <item> mb_convert_variables </item>
+ <item> mb_decode_mimeheader </item>
+ <item> mb_decode_numericentity </item>
+ <item> mb_detect_encoding </item>
+ <item> mb_detect_order </item>
+ <item> mb_encode_mimeheader </item>
+ <item> mb_encode_numericentity </item>
+ <item> mb_ereg </item>
+ <item> mb_ereg_match </item>
+ <item> mb_ereg_replace </item>
+ <item> mb_ereg_search </item>
+ <item> mb_ereg_search_getpos </item>
+ <item> mb_ereg_search_getregs </item>
+ <item> mb_ereg_search_init </item>
+ <item> mb_ereg_search_pos </item>
+ <item> mb_ereg_search_regs </item>
+ <item> mb_ereg_search_setpos </item>
+ <item> mb_eregi </item>
+ <item> mb_eregi_replace </item>
+ <item> mb_get_info </item>
+ <item> mb_http_input </item>
+ <item> mb_http_output </item>
+ <item> mb_internal_encoding </item>
+ <item> mb_language </item>
+ <item> mb_output_handler </item>
+ <item> mb_parse_str </item>
+ <item> mb_preferred_mime_name </item>
+ <item> mb_regex_encoding </item>
+ <item> mb_regex_set_options </item>
+ <item> mb_send_mail </item>
+ <item> mb_split </item>
+ <item> mb_strcut </item>
+ <item> mb_strimwidth </item>
+ <item> mb_strlen </item>
+ <item> mb_strpos </item>
+ <item> mb_strrpos </item>
+ <item> mb_strtolower </item>
+ <item> mb_strtoupper </item>
+ <item> mb_strwidth </item>
+ <item> mb_substitute_character </item>
+ <item> mb_substr </item>
+ <item> mcal_append_event </item>
+ <item> mcal_close </item>
+ <item> mcal_create_calendar </item>
+ <item> mcal_date_compare </item>
+ <item> mcal_date_valid </item>
+ <item> mcal_day_of_week </item>
+ <item> mcal_day_of_year </item>
+ <item> mcal_days_in_month </item>
+ <item> mcal_delete_calendar </item>
+ <item> mcal_delete_event </item>
+ <item> mcal_event_add_attribute </item>
+ <item> mcal_event_init </item>
+ <item> mcal_event_set_alarm </item>
+ <item> mcal_event_set_category </item>
+ <item> mcal_event_set_class </item>
+ <item> mcal_event_set_description </item>
+ <item> mcal_event_set_end </item>
+ <item> mcal_event_set_recur_daily </item>
+ <item> mcal_event_set_recur_monthly_mday </item>
+ <item> mcal_event_set_recur_monthly_wday </item>
+ <item> mcal_event_set_recur_none </item>
+ <item> mcal_event_set_recur_weekly </item>
+ <item> mcal_event_set_recur_yearly </item>
+ <item> mcal_event_set_start </item>
+ <item> mcal_event_set_title </item>
+ <item> mcal_expunge </item>
+ <item> mcal_fetch_current_stream_event </item>
+ <item> mcal_fetch_event </item>
+ <item> mcal_is_leap_year </item>
+ <item> mcal_list_alarms </item>
+ <item> mcal_list_events </item>
+ <item> mcal_next_recurrence </item>
+ <item> mcal_open </item>
+ <item> mcal_popen </item>
+ <item> mcal_rename_calendar </item>
+ <item> mcal_reopen </item>
+ <item> mcal_snooze </item>
+ <item> mcal_store_event </item>
+ <item> mcal_time_valid </item>
+ <item> mcal_week_of_year </item>
+ <item> mcrypt_cbc </item>
+ <item> mcrypt_cfb </item>
+ <item> mcrypt_create_iv </item>
+ <item> mcrypt_decrypt </item>
+ <item> mcrypt_ecb </item>
+ <item> mcrypt_enc_get_algorithms_name </item>
+ <item> mcrypt_enc_get_block_size </item>
+ <item> mcrypt_enc_get_iv_size </item>
+ <item> mcrypt_enc_get_key_size </item>
+ <item> mcrypt_enc_get_modes_name </item>
+ <item> mcrypt_enc_get_supported_key_sizes </item>
+ <item> mcrypt_enc_is_block_algorithm </item>
+ <item> mcrypt_enc_is_block_algorithm_mode </item>
+ <item> mcrypt_enc_is_block_mode </item>
+ <item> mcrypt_enc_self_test </item>
+ <item> mcrypt_encrypt </item>
+ <item> mcrypt_generic </item>
+ <item> mcrypt_generic_deinit </item>
+ <item> mcrypt_generic_end </item>
+ <item> mcrypt_generic_init </item>
+ <item> mcrypt_get_block_size </item>
+ <item> mcrypt_get_cipher_name </item>
+ <item> mcrypt_get_iv_size </item>
+ <item> mcrypt_get_key_size </item>
+ <item> mcrypt_list_algorithms </item>
+ <item> mcrypt_list_modes </item>
+ <item> mcrypt_module_close </item>
+ <item> mcrypt_module_get_algo_block_size </item>
+ <item> mcrypt_module_get_algo_key_size </item>
+ <item> mcrypt_module_get_supported_key_sizes </item>
+ <item> mcrypt_module_is_block_algorithm </item>
+ <item> mcrypt_module_is_block_algorithm_mode </item>
+ <item> mcrypt_module_is_block_mode </item>
+ <item> mcrypt_module_open </item>
+ <item> mcrypt_module_self_test </item>
+ <item> mcrypt_ofb </item>
+ <item> md5 </item>
+ <item> md5_file </item>
+ <item> mdecrypt_generic </item>
+ <item> memory_get_usage </item>
+ <item> metaphone </item>
+ <item> method_exists </item>
+ <item> mhash </item>
+ <item> mhash_count </item>
+ <item> mhash_get_block_size </item>
+ <item> mhash_get_hash_name </item>
+ <item> mhash_keygen_s2k </item>
+ <item> microtime </item>
+ <item> min </item>
+ <item> ming_setcubicthreshold </item>
+ <item> ming_setscale </item>
+ <item> ming_useswfversion </item>
+ <item> mkdir </item>
+ <item> mktime </item>
+ <item> money_format </item>
+ <item> move_uploaded_file </item>
+ <item> msg_get_queue </item>
+ <item> msg_receive </item>
+ <item> msg_remove_queue </item>
+ <item> msg_send </item>
+ <item> msg_set_queue </item>
+ <item> msg_stat_queue </item>
+ <item> msession_connect </item>
+ <item> msession_count </item>
+ <item> msession_create </item>
+ <item> msession_destroy </item>
+ <item> msession_disconnect </item>
+ <item> msession_find </item>
+ <item> msession_get </item>
+ <item> msession_get_array </item>
+ <item> msession_getdata </item>
+ <item> msession_inc </item>
+ <item> msession_list </item>
+ <item> msession_listvar </item>
+ <item> msession_lock </item>
+ <item> msession_plugin </item>
+ <item> msession_randstr </item>
+ <item> msession_set </item>
+ <item> msession_set_array </item>
+ <item> msession_setdata </item>
+ <item> msession_timeout </item>
+ <item> msession_uniq </item>
+ <item> msession_unlock </item>
+ <item> msql </item>
+ <item> msql_affected_rows </item>
+ <item> msql_close </item>
+ <item> msql_connect </item>
+ <item> msql_create_db </item>
+ <item> msql_createdb </item>
+ <item> msql_data_seek </item>
+ <item> msql_dbname </item>
+ <item> msql_drop_db </item>
+ <item> msql_dropdb </item>
+ <item> msql_error </item>
+ <item> msql_fetch_array </item>
+ <item> msql_fetch_field </item>
+ <item> msql_fetch_object </item>
+ <item> msql_fetch_row </item>
+ <item> msql_field_seek </item>
+ <item> msql_fieldflags </item>
+ <item> msql_fieldlen </item>
+ <item> msql_fieldname </item>
+ <item> msql_fieldtable </item>
+ <item> msql_fieldtype </item>
+ <item> msql_free_result </item>
+ <item> msql_freeresult </item>
+ <item> msql_list_dbs </item>
+ <item> msql_list_fields </item>
+ <item> msql_list_tables </item>
+ <item> msql_listdbs </item>
+ <item> msql_listfields </item>
+ <item> msql_listtables </item>
+ <item> msql_num_fields </item>
+ <item> msql_num_rows </item>
+ <item> msql_numfields </item>
+ <item> msql_numrows </item>
+ <item> msql_pconnect </item>
+ <item> msql_query </item>
+ <item> msql_regcase </item>
+ <item> msql_result </item>
+ <item> msql_select_db </item>
+ <item> msql_selectdb </item>
+ <item> msql_tablename </item>
+ <item> mssql_bind </item>
+ <item> mssql_close </item>
+ <item> mssql_connect </item>
+ <item> mssql_data_seek </item>
+ <item> mssql_execute </item>
+ <item> mssql_fetch_array </item>
+ <item> mssql_fetch_assoc </item>
+ <item> mssql_fetch_batch </item>
+ <item> mssql_fetch_field </item>
+ <item> mssql_fetch_object </item>
+ <item> mssql_fetch_row </item>
+ <item> mssql_field_length </item>
+ <item> mssql_field_name </item>
+ <item> mssql_field_seek </item>
+ <item> mssql_field_type </item>
+ <item> mssql_free_result </item>
+ <item> mssql_get_last_message </item>
+ <item> mssql_guid_string </item>
+ <item> mssql_init </item>
+ <item> mssql_min_error_severity </item>
+ <item> mssql_min_message_severity </item>
+ <item> mssql_next_result </item>
+ <item> mssql_num_fields </item>
+ <item> mssql_num_rows </item>
+ <item> mssql_pconnect </item>
+ <item> mssql_query </item>
+ <item> mssql_result </item>
+ <item> mssql_rows_affected </item>
+ <item> mssql_select_db </item>
+ <item> mt_getrandmax </item>
+ <item> mt_rand </item>
+ <item> mt_srand </item>
+ <item> muscat_close </item>
+ <item> muscat_get </item>
+ <item> muscat_give </item>
+ <item> muscat_setup </item>
+ <item> muscat_setup_net </item>
+ <item> mysql </item>
+ <item> mysql_affected_rows </item>
+ <item> mysql_client_encoding </item>
+ <item> mysql_change_user </item>
+ <item> mysql_character_set_name </item>
+ <item> mysql_close </item>
+ <item> mysql_connect </item>
+ <item> mysql_create_db </item>
+ <item> mysql_data_seek </item>
+ <item> mysql_db_name </item>
+ <item> mysql_db_query </item>
+ <item> mysql_dbname </item>
+ <item> mysql_drop_db </item>
+ <item> mysql_errno </item>
+ <item> mysql_error </item>
+ <item> mysql_escape_string </item>
+ <item> mysql_fetch_array </item>
+ <item> mysql_fetch_assoc </item>
+ <item> mysql_fetch_field </item>
+ <item> mysql_fetch_lengths </item>
+ <item> mysql_fetch_object </item>
+ <item> mysql_fetch_row </item>
+ <item> mysql_field_flags </item>
+ <item> mysql_field_len </item>
+ <item> mysql_field_name </item>
+ <item> mysql_field_seek </item>
+ <item> mysql_field_table </item>
+ <item> mysql_field_type </item>
+ <item> mysql_fieldflags </item>
+ <item> mysql_fieldlen </item>
+ <item> mysql_fieldname </item>
+ <item> mysql_fieldtable </item>
+ <item> mysql_fieldtype </item>
+ <item> mysql_free_result </item>
+ <item> mysql_freeresult </item>
+ <item> mysql_get_client_info </item>
+ <item> mysql_get_host_info </item>
+ <item> mysql_get_proto_info </item>
+ <item> mysql_get_server_info </item>
+ <item> mysql_info </item>
+ <item> mysql_insert_id </item>
+ <item> mysql_list_dbs </item>
+ <item> mysql_list_fields </item>
+ <item> mysql_list_processes </item>
+ <item> mysql_list_tables </item>
+ <item> mysql_listdbs </item>
+ <item> mysql_listfields </item>
+ <item> mysql_listtables </item>
+ <item> mysql_num_fields </item>
+ <item> mysql_num_rows </item>
+ <item> mysql_numfields </item>
+ <item> mysql_numrows </item>
+ <item> mysql_pconnect </item>
+ <item> mysql_ping </item>
+ <item> mysql_query </item>
+ <item> mysql_real_escape_string </item>
+ <item> mysql_result </item>
+ <item> mysql_select_db </item>
+ <item> mysql_selectdb </item>
+ <item> mysql_stat </item>
+ <item> mysql_table_name </item>
+ <item> mysql_tablename </item>
+ <item> mysql_thread_id </item>
+ <item> mysql_unbuffered_query </item>
+ <item> mysqli_affected_rows </item>
+ <item> mysqli_autocommit </item>
+ <item> mysqli_bind_param </item>
+ <item> mysqli_bind_result </item>
+ <item> mysqli_change_user </item>
+ <item> mysqli_character_set_name </item>
+ <item> mysqli_client_encoding </item>
+ <item> mysqli_close </item>
+ <item> mysqli_commit </item>
+ <item> mysqli_connect </item>
+ <item> mysqli_connect_errno </item>
+ <item> mysqli_connect_error </item>
+ <item> mysqli_data_seek </item>
+ <item> mysqli_debug </item>
+ <item> mysqli_disable_reads_from_master </item>
+ <item> mysqli_disable_rpl_parse </item>
+ <item> mysqli_dump_debug_info </item>
+ <item> mysqli_enable_reads_from_master </item>
+ <item> mysqli_enable_rpl_parse </item>
+ <item> mysqli_errno </item>
+ <item> mysqli_error </item>
+ <item> mysqli_escape_string </item>
+ <item> mysqli_execute </item>
+ <item> mysqli_fetch </item>
+ <item> mysqli_fetch_array </item>
+ <item> mysqli_fetch_assoc </item>
+ <item> mysqli_fetch_field </item>
+ <item> mysqli_fetch_field_direct </item>
+ <item> mysqli_fetch_fields </item>
+ <item> mysqli_fetch_lengths </item>
+ <item> mysqli_fetch_object </item>
+ <item> mysqli_fetch_row </item>
+ <item> mysqli_field_count </item>
+ <item> mysqli_field_seek </item>
+ <item> mysqli_field_tell </item>
+ <item> mysqli_free_result </item>
+ <item> mysqli_get_client_info </item>
+ <item> mysqli_get_client_version </item>
+ <item> mysqli_get_host_info </item>
+ <item> mysqli_get_metadata </item>
+ <item> mysqli_get_proto_info </item>
+ <item> mysqli_get_server_info </item>
+ <item> mysqli_get_server_version </item>
+ <item> mysqli_info </item>
+ <item> mysqli_init </item>
+ <item> mysqli_insert_id </item>
+ <item> mysqli_kill </item>
+ <item> mysqli_master_query </item>
+ <item> mysqli_more_results </item>
+ <item> mysqli_multi_query </item>
+ <item> mysqli_next_result </item>
+ <item> mysqli_num_fields </item>
+ <item> mysqli_num_rows </item>
+ <item> mysqli_options </item>
+ <item> mysqli_param_count </item>
+ <item> mysqli_ping </item>
+ <item> mysqli_prepare </item>
+ <item> mysqli_query </item>
+ <item> mysqli_real_connect </item>
+ <item> mysqli_real_escape_string </item>
+ <item> mysqli_real_query </item>
+ <item> mysqli_report </item>
+ <item> mysqli_rollback </item>
+ <item> mysqli_rpl_parse_enabled </item>
+ <item> mysqli_rpl_probe </item>
+ <item> mysqli_rpl_query_type </item>
+ <item> mysqli_select_db </item>
+ <item> mysqli_send_long_data </item>
+ <item> mysqli_send_query </item>
+ <item> mysqli_set_local_infile_default </item>
+ <item> mysqli_set_local_infile_handler </item>
+ <item> mysqli_set_opt </item>
+ <item> mysqli_slave_query </item>
+ <item> mysqli_sqlstate </item>
+ <item> mysqli_ssl_set </item>
+ <item> mysqli_stat </item>
+ <item> mysqli_stmt_affected_rows </item>
+ <item> mysqli_stmt_attr_get </item>
+ <item> mysqli_stmt_attr_set </item>
+ <item> mysqli_stmt_bind_param </item>
+ <item> mysqli_stmt_bind_result </item>
+ <item> mysqli_stmt_close </item>
+ <item> mysqli_stmt_data_seek </item>
+ <item> mysqli_stmt_errno </item>
+ <item> mysqli_stmt_error </item>
+ <item> mysqli_stmt_execute </item>
+ <item> mysqli_stmt_fetch </item>
+ <item> mysqli_stmt_field_count </item>
+ <item> mysqli_stmt_free_result </item>
+ <item> mysqli_stmt_init </item>
+ <item> mysqli_stmt_insert_id </item>
+ <item> mysqli_stmt_num_rows </item>
+ <item> mysqli_stmt_param_count </item>
+ <item> mysqli_stmt_prepare </item>
+ <item> mysqli_stmt_reset </item>
+ <item> mysqli_stmt_result_metadata </item>
+ <item> mysqli_stmt_send_long_data </item>
+ <item> mysqli_stmt_sqlstate </item>
+ <item> mysqli_stmt_store_result </item>
+ <item> mysqli_store_result </item>
+ <item> mysqli_thread_id </item>
+ <item> mysqli_thread_safe </item>
+ <item> mysqli_use_result </item>
+ <item> mysqli_warning_count </item>
+ <item> natcasesort </item>
+ <item> natsort </item>
+ <item> ncurses_addch </item>
+ <item> ncurses_addchnstr </item>
+ <item> ncurses_addchstr </item>
+ <item> ncurses_addnstr </item>
+ <item> ncurses_addstr </item>
+ <item> ncurses_assume_default_colors </item>
+ <item> ncurses_attroff </item>
+ <item> ncurses_attron </item>
+ <item> ncurses_attrset </item>
+ <item> ncurses_baudrate </item>
+ <item> ncurses_beep </item>
+ <item> ncurses_bkgd </item>
+ <item> ncurses_bkgdset </item>
+ <item> ncurses_border </item>
+ <item> ncurses_bottom_panel </item>
+ <item> ncurses_can_change_color </item>
+ <item> ncurses_cbreak </item>
+ <item> ncurses_clear </item>
+ <item> ncurses_clrtobot </item>
+ <item> ncurses_clrtoeol </item>
+ <item> ncurses_color_content </item>
+ <item> ncurses_color_set </item>
+ <item> ncurses_curs_set </item>
+ <item> ncurses_def_prog_mode </item>
+ <item> ncurses_def_shell_mode </item>
+ <item> ncurses_define_key </item>
+ <item> ncurses_del_panel </item>
+ <item> ncurses_delay_output </item>
+ <item> ncurses_delch </item>
+ <item> ncurses_deleteln </item>
+ <item> ncurses_delwin </item>
+ <item> ncurses_doupdate </item>
+ <item> ncurses_echo </item>
+ <item> ncurses_echochar </item>
+ <item> ncurses_end </item>
+ <item> ncurses_erase </item>
+ <item> ncurses_erasechar </item>
+ <item> ncurses_filter </item>
+ <item> ncurses_flash </item>
+ <item> ncurses_flushinp </item>
+ <item> ncurses_getch </item>
+ <item> ncurses_getmaxyx </item>
+ <item> ncurses_getmouse </item>
+ <item> ncurses_getyx </item>
+ <item> ncurses_halfdelay </item>
+ <item> ncurses_has_colors </item>
+ <item> ncurses_has_ic </item>
+ <item> ncurses_has_il </item>
+ <item> ncurses_has_key </item>
+ <item> ncurses_hide_panel </item>
+ <item> ncurses_hline </item>
+ <item> ncurses_inch </item>
+ <item> ncurses_init </item>
+ <item> ncurses_init_color </item>
+ <item> ncurses_init_pair </item>
+ <item> ncurses_insch </item>
+ <item> ncurses_insdelln </item>
+ <item> ncurses_insertln </item>
+ <item> ncurses_insstr </item>
+ <item> ncurses_instr </item>
+ <item> ncurses_isendwin </item>
+ <item> ncurses_keyok </item>
+ <item> ncurses_keypad </item>
+ <item> ncurses_killchar </item>
+ <item> ncurses_longname </item>
+ <item> ncurses_meta </item>
+ <item> ncurses_mouse_trafo </item>
+ <item> ncurses_mouseinterval </item>
+ <item> ncurses_mousemask </item>
+ <item> ncurses_move </item>
+ <item> ncurses_move_panel </item>
+ <item> ncurses_mvaddch </item>
+ <item> ncurses_mvaddchnstr </item>
+ <item> ncurses_mvaddchstr </item>
+ <item> ncurses_mvaddnstr </item>
+ <item> ncurses_mvaddstr </item>
+ <item> ncurses_mvcur </item>
+ <item> ncurses_mvdelch </item>
+ <item> ncurses_mvgetch </item>
+ <item> ncurses_mvhline </item>
+ <item> ncurses_mvinch </item>
+ <item> ncurses_mvvline </item>
+ <item> ncurses_mvwaddstr </item>
+ <item> ncurses_napms </item>
+ <item> ncurses_new_panel </item>
+ <item> ncurses_newpad </item>
+ <item> ncurses_newwin </item>
+ <item> ncurses_nl </item>
+ <item> ncurses_nocbreak </item>
+ <item> ncurses_noecho </item>
+ <item> ncurses_nonl </item>
+ <item> ncurses_noqiflush </item>
+ <item> ncurses_noraw </item>
+ <item> ncurses_pair_content </item>
+ <item> ncurses_panel_above </item>
+ <item> ncurses_panel_below </item>
+ <item> ncurses_panel_window </item>
+ <item> ncurses_pnoutrefresh </item>
+ <item> ncurses_prefresh </item>
+ <item> ncurses_putp </item>
+ <item> ncurses_qiflush </item>
+ <item> ncurses_raw </item>
+ <item> ncurses_refresh </item>
+ <item> ncurses_replace_panel </item>
+ <item> ncurses_reset_prog_mode </item>
+ <item> ncurses_reset_shell_mode </item>
+ <item> ncurses_resetty </item>
+ <item> ncurses_savetty </item>
+ <item> ncurses_scr_dump </item>
+ <item> ncurses_scr_init </item>
+ <item> ncurses_scr_restore </item>
+ <item> ncurses_scr_set </item>
+ <item> ncurses_scrl </item>
+ <item> ncurses_show_panel </item>
+ <item> ncurses_slk_attr </item>
+ <item> ncurses_slk_attroff </item>
+ <item> ncurses_slk_attron </item>
+ <item> ncurses_slk_attrset </item>
+ <item> ncurses_slk_clear </item>
+ <item> ncurses_slk_color </item>
+ <item> ncurses_slk_init </item>
+ <item> ncurses_slk_noutrefresh </item>
+ <item> ncurses_slk_refresh </item>
+ <item> ncurses_slk_restore </item>
+ <item> ncurses_slk_set </item>
+ <item> ncurses_slk_touch </item>
+ <item> ncurses_standend </item>
+ <item> ncurses_standout </item>
+ <item> ncurses_start_color </item>
+ <item> ncurses_termattrs </item>
+ <item> ncurses_termname </item>
+ <item> ncurses_timeout </item>
+ <item> ncurses_top_panel </item>
+ <item> ncurses_typeahead </item>
+ <item> ncurses_ungetch </item>
+ <item> ncurses_ungetmouse </item>
+ <item> ncurses_update_panels </item>
+ <item> ncurses_use_default_colors </item>
+ <item> ncurses_use_env </item>
+ <item> ncurses_use_extended_names </item>
+ <item> ncurses_vidattr </item>
+ <item> ncurses_vline </item>
+ <item> ncurses_waddch </item>
+ <item> ncurses_waddstr </item>
+ <item> ncurses_wattroff </item>
+ <item> ncurses_wattron </item>
+ <item> ncurses_wattrset </item>
+ <item> ncurses_wborder </item>
+ <item> ncurses_wclear </item>
+ <item> ncurses_wcolor_set </item>
+ <item> ncurses_werase </item>
+ <item> ncurses_wgetch </item>
+ <item> ncurses_whline </item>
+ <item> ncurses_wmouse_trafo </item>
+ <item> ncurses_wmove </item>
+ <item> ncurses_wnoutrefresh </item>
+ <item> ncurses_wrefresh </item>
+ <item> ncurses_wstandend </item>
+ <item> ncurses_wstandout </item>
+ <item> ncurses_wvline </item>
+ <item> next </item>
+ <item> ngettext </item>
+ <item> nl2br </item>
+ <item> nl_langinfo </item>
+ <item> notes_body </item>
+ <item> notes_copy_db </item>
+ <item> notes_create_db </item>
+ <item> notes_create_note </item>
+ <item> notes_drop_db </item>
+ <item> notes_find_note </item>
+ <item> notes_header_info </item>
+ <item> notes_list_msgs </item>
+ <item> notes_mark_read </item>
+ <item> notes_mark_unread </item>
+ <item> notes_nav_create </item>
+ <item> notes_search </item>
+ <item> notes_unread </item>
+ <item> notes_version </item>
+ <item> number_format </item>
+ <item> ob_clean </item>
+ <item> ob_end_clean </item>
+ <item> ob_end_flush </item>
+ <item> ob_flush </item>
+ <item> ob_get_clean </item>
+ <item> ob_get_contents </item>
+ <item> ob_get_flush </item>
+ <item> ob_get_length </item>
+ <item> ob_get_level </item>
+ <item> ob_get_status </item>
+ <item> ob_gzhandler </item>
+ <item> ob_iconv_handler </item>
+ <item> ob_implicit_flush </item>
+ <item> ob_list_handlers </item>
+ <item> ob_start </item>
+ <item> ocibindbyname </item>
+ <item> ocicancel </item>
+ <item> ocicollappend </item>
+ <item> ocicollassign </item>
+ <item> ocicollassignelem </item>
+ <item> ocicollgetelem </item>
+ <item> ocicollmax </item>
+ <item> ocicollsize </item>
+ <item> ocicolltrim </item>
+ <item> ocicolumnisnull </item>
+ <item> ocicolumnname </item>
+ <item> ocicolumnprecision </item>
+ <item> ocicolumnscale </item>
+ <item> ocicolumnsize </item>
+ <item> ocicolumntype </item>
+ <item> ocicolumntyperaw </item>
+ <item> ocicommit </item>
+ <item> ocidefinebyname </item>
+ <item> ocierror </item>
+ <item> ociexecute </item>
+ <item> ocifetch </item>
+ <item> ocifetchinto </item>
+ <item> ocifetchstatement </item>
+ <item> ocifreecollection </item>
+ <item> ocifreecursor </item>
+ <item> ocifreedesc </item>
+ <item> ocifreestatement </item>
+ <item> ociinternaldebug </item>
+ <item> ociloadlob </item>
+ <item> ocilogoff </item>
+ <item> ocilogon </item>
+ <item> ocinewcollection </item>
+ <item> ocinewcursor </item>
+ <item> ocinewdescriptor </item>
+ <item> ocinlogon </item>
+ <item> ocinumcols </item>
+ <item> ociparse </item>
+ <item> ociplogon </item>
+ <item> ociresult </item>
+ <item> ocirollback </item>
+ <item> ocirowcount </item>
+ <item> ocisavelob </item>
+ <item> ocisavelobfile </item>
+ <item> ociserverversion </item>
+ <item> ocisetprefetch </item>
+ <item> ocistatementtype </item>
+ <item> ociwritelobtofile </item>
+ <item> octdec </item>
+ <item> odbc_autocommit </item>
+ <item> odbc_binmode </item>
+ <item> odbc_close </item>
+ <item> odbc_close_all </item>
+ <item> odbc_columnprivileges </item>
+ <item> odbc_columns </item>
+ <item> odbc_commit </item>
+ <item> odbc_connect </item>
+ <item> odbc_cursor </item>
+ <item> odbc_data_source </item>
+ <item> odbc_do </item>
+ <item> odbc_error </item>
+ <item> odbc_errormsg </item>
+ <item> odbc_exec </item>
+ <item> odbc_execute </item>
+ <item> odbc_fetch_array </item>
+ <item> odbc_fetch_into </item>
+ <item> odbc_fetch_object </item>
+ <item> odbc_fetch_row </item>
+ <item> odbc_field_len </item>
+ <item> odbc_field_name </item>
+ <item> odbc_field_num </item>
+ <item> odbc_field_precision </item>
+ <item> odbc_field_scale </item>
+ <item> odbc_field_type </item>
+ <item> odbc_foreignkeys </item>
+ <item> odbc_free_result </item>
+ <item> odbc_gettypeinfo </item>
+ <item> odbc_longreadlen </item>
+ <item> odbc_next_result </item>
+ <item> odbc_num_fields </item>
+ <item> odbc_num_rows </item>
+ <item> odbc_pconnect </item>
+ <item> odbc_prepare </item>
+ <item> odbc_primarykeys </item>
+ <item> odbc_procedurecolumns </item>
+ <item> odbc_procedures </item>
+ <item> odbc_result </item>
+ <item> odbc_result_all </item>
+ <item> odbc_rollback </item>
+ <item> odbc_setoption </item>
+ <item> odbc_specialcolumns </item>
+ <item> odbc_statistics </item>
+ <item> odbc_tableprivileges </item>
+ <item> odbc_tables </item>
+ <item> opendir </item>
+ <item> openlog </item>
+ <item> openssl_csr_export </item>
+ <item> openssl_csr_export_to_file </item>
+ <item> openssl_csr_new </item>
+ <item> openssl_csr_sign </item>
+ <item> openssl_error_string </item>
+ <item> openssl_free_key </item>
+ <item> openssl_get_privatekey </item>
+ <item> openssl_get_publickey </item>
+ <item> openssl_open </item>
+ <item> openssl_pkcs7_decrypt </item>
+ <item> openssl_pkcs7_encrypt </item>
+ <item> openssl_pkcs7_sign </item>
+ <item> openssl_pkcs7_verify </item>
+ <item> openssl_pkey_export </item>
+ <item> openssl_pkey_export_to_file </item>
+ <item> openssl_pkey_free </item>
+ <item> openssl_pkey_get_private </item>
+ <item> openssl_pkey_get_public </item>
+ <item> openssl_pkey_new </item>
+ <item> openssl_private_decrypt </item>
+ <item> openssl_private_encrypt </item>
+ <item> openssl_public_decrypt </item>
+ <item> openssl_public_encrypt </item>
+ <item> openssl_seal </item>
+ <item> openssl_sign </item>
+ <item> openssl_verify </item>
+ <item> openssl_x509_check_private_key </item>
+ <item> openssl_x509_checkpurpose </item>
+ <item> openssl_x509_export </item>
+ <item> openssl_x509_export_to_file </item>
+ <item> openssl_x509_free </item>
+ <item> openssl_x509_parse </item>
+ <item> openssl_x509_read </item>
+ <item> ora_bind </item>
+ <item> ora_close </item>
+ <item> ora_columnname </item>
+ <item> ora_columnsize </item>
+ <item> ora_columntype </item>
+ <item> ora_commit </item>
+ <item> ora_commitoff </item>
+ <item> ora_commiton </item>
+ <item> ora_do </item>
+ <item> ora_error </item>
+ <item> ora_errorcode </item>
+ <item> ora_exec </item>
+ <item> ora_fetch </item>
+ <item> ora_fetch_into </item>
+ <item> ora_getcolumn </item>
+ <item> ora_logoff </item>
+ <item> ora_logon </item>
+ <item> ora_numcols </item>
+ <item> ora_numrows </item>
+ <item> ora_open </item>
+ <item> ora_parse </item>
+ <item> ora_plogon </item>
+ <item> ora_rollback </item>
+ <item> ord </item>
+ <item> output_add_rewrite_var </item>
+ <item> output_reset_rewrite_vars </item>
+ <item> overload </item>
+ <item> ovrimos_close </item>
+ <item> ovrimos_commit </item>
+ <item> ovrimos_connect </item>
+ <item> ovrimos_cursor </item>
+ <item> ovrimos_exec </item>
+ <item> ovrimos_execute </item>
+ <item> ovrimos_fetch_into </item>
+ <item> ovrimos_fetch_row </item>
+ <item> ovrimos_field_len </item>
+ <item> ovrimos_field_name </item>
+ <item> ovrimos_field_num </item>
+ <item> ovrimos_field_type </item>
+ <item> ovrimos_free_result </item>
+ <item> ovrimos_longreadlen </item>
+ <item> ovrimos_num_fields </item>
+ <item> ovrimos_num_rows </item>
+ <item> ovrimos_prepare </item>
+ <item> ovrimos_result </item>
+ <item> ovrimos_result_all </item>
+ <item> ovrimos_rollback </item>
+ <item> pack </item>
+ <item> parse_ini_file </item>
+ <item> parse_str </item>
+ <item> parse_url </item>
+ <item> passthru </item>
+ <item> pathinfo </item>
+ <item> pclose </item>
+ <item> pcntl_alarm </item>
+ <item> pcntl_exec </item>
+ <item> pcntl_fork </item>
+ <item> pcntl_getpriority </item>
+ <item> pcntl_setpriority </item>
+ <item> pcntl_signal </item>
+ <item> pcntl_wait </item>
+ <item> pcntl_waitpid </item>
+ <item> pcntl_wexitstatus </item>
+ <item> pcntl_wifexited </item>
+ <item> pcntl_wifsignaled </item>
+ <item> pcntl_wifstopped </item>
+ <item> pcntl_wstopsig </item>
+ <item> pcntl_wtermsig </item>
+ <item> pdf_add_annotation </item>
+ <item> pdf_add_bookmark </item>
+ <item> pdf_add_launchlink </item>
+ <item> pdf_add_locallink </item>
+ <item> pdf_add_note </item>
+ <item> pdf_add_outline </item>
+ <item> pdf_add_pdflink </item>
+ <item> pdf_add_thumbnail </item>
+ <item> pdf_add_weblink </item>
+ <item> pdf_arc </item>
+ <item> pdf_arcn </item>
+ <item> pdf_attach_file </item>
+ <item> pdf_begin_page </item>
+ <item> pdf_begin_pattern </item>
+ <item> pdf_begin_template </item>
+ <item> pdf_circle </item>
+ <item> pdf_clip </item>
+ <item> pdf_close </item>
+ <item> pdf_close_image </item>
+ <item> pdf_close_pdi </item>
+ <item> pdf_close_pdi_page </item>
+ <item> pdf_closepath </item>
+ <item> pdf_closepath_fill_stroke </item>
+ <item> pdf_closepath_stroke </item>
+ <item> pdf_concat </item>
+ <item> pdf_continue_text </item>
+ <item> pdf_curveto </item>
+ <item> pdf_delete </item>
+ <item> pdf_end_page </item>
+ <item> pdf_end_pattern </item>
+ <item> pdf_end_template </item>
+ <item> pdf_endpath </item>
+ <item> pdf_fill </item>
+ <item> pdf_fill_stroke </item>
+ <item> pdf_findfont </item>
+ <item> pdf_get_buffer </item>
+ <item> pdf_get_font </item>
+ <item> pdf_get_fontname </item>
+ <item> pdf_get_fontsize </item>
+ <item> pdf_get_image_height </item>
+ <item> pdf_get_image_width </item>
+ <item> pdf_get_majorversion </item>
+ <item> pdf_get_minorversion </item>
+ <item> pdf_get_parameter </item>
+ <item> pdf_get_pdi_parameter </item>
+ <item> pdf_get_pdi_value </item>
+ <item> pdf_get_value </item>
+ <item> pdf_initgraphics </item>
+ <item> pdf_lineto </item>
+ <item> pdf_makespotcolor </item>
+ <item> pdf_moveto </item>
+ <item> pdf_new </item>
+ <item> pdf_open </item>
+ <item> pdf_open_ccitt </item>
+ <item> pdf_open_file </item>
+ <item> pdf_open_gif </item>
+ <item> pdf_open_image </item>
+ <item> pdf_open_image_file </item>
+ <item> pdf_open_jpeg </item>
+ <item> pdf_open_memory_image </item>
+ <item> pdf_open_pdi </item>
+ <item> pdf_open_pdi_page </item>
+ <item> pdf_open_png </item>
+ <item> pdf_open_tiff </item>
+ <item> pdf_place_image </item>
+ <item> pdf_place_pdi_page </item>
+ <item> pdf_rect </item>
+ <item> pdf_restore </item>
+ <item> pdf_rotate </item>
+ <item> pdf_save </item>
+ <item> pdf_scale </item>
+ <item> pdf_set_border_color </item>
+ <item> pdf_set_border_dash </item>
+ <item> pdf_set_border_style </item>
+ <item> pdf_set_char_spacing </item>
+ <item> pdf_set_duration </item>
+ <item> pdf_set_font </item>
+ <item> pdf_set_horiz_scaling </item>
+ <item> pdf_set_info </item>
+ <item> pdf_set_info_author </item>
+ <item> pdf_set_info_creator </item>
+ <item> pdf_set_info_keywords </item>
+ <item> pdf_set_info_subject </item>
+ <item> pdf_set_info_title </item>
+ <item> pdf_set_leading </item>
+ <item> pdf_set_parameter </item>
+ <item> pdf_set_text_pos </item>
+ <item> pdf_set_text_rendering </item>
+ <item> pdf_set_text_rise </item>
+ <item> pdf_set_transition </item>
+ <item> pdf_set_value </item>
+ <item> pdf_set_word_spacing </item>
+ <item> pdf_setcolor </item>
+ <item> pdf_setdash </item>
+ <item> pdf_setflat </item>
+ <item> pdf_setfont </item>
+ <item> pdf_setgray </item>
+ <item> pdf_setgray_fill </item>
+ <item> pdf_setgray_stroke </item>
+ <item> pdf_setlinecap </item>
+ <item> pdf_setlinejoin </item>
+ <item> pdf_setlinewidth </item>
+ <item> pdf_setmatrix </item>
+ <item> pdf_setmiterlimit </item>
+ <item> pdf_setpolydash </item>
+ <item> pdf_setrgbcolor </item>
+ <item> pdf_setrgbcolor_fill </item>
+ <item> pdf_setrgbcolor_stroke </item>
+ <item> pdf_show </item>
+ <item> pdf_show_boxed </item>
+ <item> pdf_show_xy </item>
+ <item> pdf_skew </item>
+ <item> pdf_stringwidth </item>
+ <item> pdf_stroke </item>
+ <item> pdf_translate </item>
+ <item> pfpro_cleanup </item>
+ <item> pfpro_init </item>
+ <item> pfpro_process </item>
+ <item> pfpro_process_raw </item>
+ <item> pfpro_version </item>
+ <item> pfsockopen </item>
+ <item> pg_affected_rows </item>
+ <item> pg_cancel_query </item>
+ <item> pg_client_encoding </item>
+ <item> pg_clientencoding </item>
+ <item> pg_close </item>
+ <item> pg_cmdtuples </item>
+ <item> pg_connect </item>
+ <item> pg_connection_busy </item>
+ <item> pg_connection_reset </item>
+ <item> pg_connection_status </item>
+ <item> pg_convert </item>
+ <item> pg_copy_from </item>
+ <item> pg_copy_to </item>
+ <item> pg_dbname </item>
+ <item> pg_delete </item>
+ <item> pg_end_copy </item>
+ <item> pg_errormessage </item>
+ <item> pg_escape_bytea </item>
+ <item> pg_escape_string </item>
+ <item> pg_exec </item>
+ <item> pg_fetch_all </item>
+ <item> pg_fetch_array </item>
+ <item> pg_fetch_assoc </item>
+ <item> pg_fetch_object </item>
+ <item> pg_fetch_result </item>
+ <item> pg_fetch_row </item>
+ <item> pg_field_is_null </item>
+ <item> pg_field_name </item>
+ <item> pg_field_num </item>
+ <item> pg_field_prtlen </item>
+ <item> pg_field_size </item>
+ <item> pg_field_type </item>
+ <item> pg_fieldisnull </item>
+ <item> pg_fieldname </item>
+ <item> pg_fieldnum </item>
+ <item> pg_fieldprtlen </item>
+ <item> pg_fieldsize </item>
+ <item> pg_fieldtype </item>
+ <item> pg_free_result </item>
+ <item> pg_freeresult </item>
+ <item> pg_get_notify </item>
+ <item> pg_get_pid </item>
+ <item> pg_get_result </item>
+ <item> pg_getlastoid </item>
+ <item> pg_host </item>
+ <item> pg_insert </item>
+ <item> pg_last_error </item>
+ <item> pg_last_notice </item>
+ <item> pg_last_oid </item>
+ <item> pg_lo_close </item>
+ <item> pg_lo_create </item>
+ <item> pg_lo_export </item>
+ <item> pg_lo_import </item>
+ <item> pg_lo_open </item>
+ <item> pg_lo_read </item>
+ <item> pg_lo_read_all </item>
+ <item> pg_lo_seek </item>
+ <item> pg_lo_tell </item>
+ <item> pg_lo_unlink </item>
+ <item> pg_lo_write </item>
+ <item> pg_loclose </item>
+ <item> pg_locreate </item>
+ <item> pg_loexport </item>
+ <item> pg_loimport </item>
+ <item> pg_loopen </item>
+ <item> pg_loread </item>
+ <item> pg_loreadall </item>
+ <item> pg_lounlink </item>
+ <item> pg_lowrite </item>
+ <item> pg_meta_data </item>
+ <item> pg_num_fields </item>
+ <item> pg_num_rows </item>
+ <item> pg_numfields </item>
+ <item> pg_numrows </item>
+ <item> pg_options </item>
+ <item> pg_parameter_status </item>
+ <item> pg_pconnect </item>
+ <item> pg_ping </item>
+ <item> pg_port </item>
+ <item> pg_put_line </item>
+ <item> pg_query </item>
+ <item> pg_result </item>
+ <item> pg_result_error </item>
+ <item> pg_result_seek </item>
+ <item> pg_result_status </item>
+ <item> pg_select </item>
+ <item> pg_send_query </item>
+ <item> pg_set_client_encoding </item>
+ <item> pg_setclientencoding </item>
+ <item> pg_trace </item>
+ <item> pg_tty </item>
+ <item> pg_unescape_bytea </item>
+ <item> pg_untrace </item>
+ <item> pg_update </item>
+ <item> pg_version </item>
+ <item> php_check_syntax </item>
+ <item> php_egg_logo_guid </item>
+ <item> php_ini_scanned_files </item>
+ <item> php_logo_guid </item>
+ <item> php_real_logo_guid </item>
+ <item> php_sapi_name </item>
+ <item> php_strip_whitespace </item>
+ <item> php_uname </item>
+ <item> phpcredits </item>
+ <item> phpinfo </item>
+ <item> phpversion </item>
+ <item> pi </item>
+ <item> png2wbmp </item>
+ <item> popen </item>
+ <item> pos </item>
+ <item> posix_ctermid </item>
+ <item> posix_errno </item>
+ <item> posix_get_last_error </item>
+ <item> posix_getcwd </item>
+ <item> posix_getegid </item>
+ <item> posix_geteuid </item>
+ <item> posix_getgid </item>
+ <item> posix_getgrgid </item>
+ <item> posix_getgrnam </item>
+ <item> posix_getgroups </item>
+ <item> posix_getlogin </item>
+ <item> posix_getpgid </item>
+ <item> posix_getpgrp </item>
+ <item> posix_getpid </item>
+ <item> posix_getppid </item>
+ <item> posix_getpwnam </item>
+ <item> posix_getpwuid </item>
+ <item> posix_getrlimit </item>
+ <item> posix_getsid </item>
+ <item> posix_getuid </item>
+ <item> posix_isatty </item>
+ <item> posix_kill </item>
+ <item> posix_mkfifo </item>
+ <item> posix_setegid </item>
+ <item> posix_seteuid </item>
+ <item> posix_setgid </item>
+ <item> posix_setpgid </item>
+ <item> posix_setsid </item>
+ <item> posix_setuid </item>
+ <item> posix_strerror </item>
+ <item> posix_times </item>
+ <item> posix_ttyname </item>
+ <item> posix_uname </item>
+ <item> pow </item>
+ <item> preg_grep </item>
+ <item> preg_match </item>
+ <item> preg_match_all </item>
+ <item> preg_quote </item>
+ <item> preg_replace </item>
+ <item> preg_replace_callback </item>
+ <item> preg_split </item>
+ <item> prev </item>
+ <item> print </item>
+ <item> print_r </item>
+ <item> printer_abort </item>
+ <item> printer_close </item>
+ <item> printer_create_brush </item>
+ <item> printer_create_dc </item>
+ <item> printer_create_font </item>
+ <item> printer_create_pen </item>
+ <item> printer_delete_brush </item>
+ <item> printer_delete_dc </item>
+ <item> printer_delete_font </item>
+ <item> printer_delete_pen </item>
+ <item> printer_draw_bmp </item>
+ <item> printer_draw_chord </item>
+ <item> printer_draw_elipse </item>
+ <item> printer_draw_line </item>
+ <item> printer_draw_pie </item>
+ <item> printer_draw_rectangle </item>
+ <item> printer_draw_roundrect </item>
+ <item> printer_draw_text </item>
+ <item> printer_end_doc </item>
+ <item> printer_end_page </item>
+ <item> printer_get_option </item>
+ <item> printer_list </item>
+ <item> printer_logical_fontheight </item>
+ <item> printer_open </item>
+ <item> printer_select_brush </item>
+ <item> printer_select_font </item>
+ <item> printer_select_pen </item>
+ <item> printer_set_option </item>
+ <item> printer_start_doc </item>
+ <item> printer_start_page </item>
+ <item> printer_write </item>
+ <item> printf </item>
+ <item> proc_close </item>
+ <item> proc_get_status </item>
+ <item> proc_nice </item>
+ <item> proc_open </item>
+ <item> proc_terminate </item>
+ <item> pspell_add_to_personal </item>
+ <item> pspell_add_to_session </item>
+ <item> pspell_check </item>
+ <item> pspell_clear_session </item>
+ <item> pspell_config_create </item>
+ <item> pspell_config_ignore </item>
+ <item> pspell_config_mode </item>
+ <item> pspell_config_personal </item>
+ <item> pspell_config_repl </item>
+ <item> pspell_config_runtogether </item>
+ <item> pspell_config_save_repl </item>
+ <item> pspell_new </item>
+ <item> pspell_new_config </item>
+ <item> pspell_new_personal </item>
+ <item> pspell_save_wordlist </item>
+ <item> pspell_store_replacement </item>
+ <item> pspell_suggest </item>
+ <item> putenv </item>
+ <item> qdom_error </item>
+ <item> qdom_tree </item>
+ <item> quoted_printable_decode </item>
+ <item> quotemeta </item>
+ <item> rad2deg </item>
+ <item> rand </item>
+ <item> range </item>
+ <item> rawurldecode </item>
+ <item> rawurlencode </item>
+ <item> read_exif_data </item>
+ <item> readdir </item>
+ <item> readfile </item>
+ <item> readgzfile </item>
+ <item> readline </item>
+ <item> readline_add_history </item>
+ <item> readline_clear_history </item>
+ <item> readline_completion_function </item>
+ <item> readline_info </item>
+ <item> readline_list_history </item>
+ <item> readline_read_history </item>
+ <item> readline_write_history </item>
+ <item> readlink </item>
+ <item> realpath </item>
+ <item> recode </item>
+ <item> recode_file </item>
+ <item> recode_string </item>
+ <item> register_shutdown_function </item>
+ <item> register_tick_function </item>
+ <item> rename </item>
+ <item> require </item>
+ <item> require_once </item>
+ <item> reset </item>
+ <item> restore_error_handler </item>
+ <item> restore_exception_handler </item>
+ <item> restore_include_path </item>
+ <item> rewind </item>
+ <item> rewinddir </item>
+ <item> rmdir </item>
+ <item> round </item>
+ <item> rsort </item>
+ <item> rtrim </item>
+ <item> scandir </item>
+ <item> sem_acquire </item>
+ <item> sem_get </item>
+ <item> sem_release </item>
+ <item> sem_remove </item>
+ <item> serialize </item>
+ <item> sesam_affected_rows </item>
+ <item> sesam_commit </item>
+ <item> sesam_connect </item>
+ <item> sesam_diagnostic </item>
+ <item> sesam_disconnect </item>
+ <item> sesam_errormsg </item>
+ <item> sesam_execimm </item>
+ <item> sesam_fetch_array </item>
+ <item> sesam_fetch_result </item>
+ <item> sesam_fetch_row </item>
+ <item> sesam_field_array </item>
+ <item> sesam_field_name </item>
+ <item> sesam_free_result </item>
+ <item> sesam_num_fields </item>
+ <item> sesam_query </item>
+ <item> sesam_rollback </item>
+ <item> sesam_seek_row </item>
+ <item> sesam_settransaction </item>
+ <item> session_cache_expire </item>
+ <item> session_cache_limiter </item>
+ <item> session_commit </item>
+ <item> session_decode </item>
+ <item> session_destroy </item>
+ <item> session_encode </item>
+ <item> session_get_cookie_params </item>
+ <item> session_id </item>
+ <item> session_is_registered </item>
+ <item> session_module_name </item>
+ <item> session_name </item>
+ <item> session_regenerate_id </item>
+ <item> session_register </item>
+ <item> session_save_path </item>
+ <item> session_set_cookie_params </item>
+ <item> session_set_save_handler </item>
+ <item> session_start </item>
+ <item> session_unregister </item>
+ <item> session_unset </item>
+ <item> session_write_close </item>
+ <item> set_error_handler </item>
+ <item> set_exception_handler </item>
+ <item> set_file_buffer </item>
+ <item> set_include_path </item>
+ <item> set_magic_quotes_runtime </item>
+ <item> set_socket_blocking </item>
+ <item> set_time_limit </item>
+ <item> setcookie </item>
+ <item> setlocale </item>
+ <item> setrawcookie </item>
+ <item> settype </item>
+ <item> sha1 </item>
+ <item> sha1_file </item>
+ <item> shell_exec </item>
+ <item> shm_attach </item>
+ <item> shm_detach </item>
+ <item> shm_get_var </item>
+ <item> shm_put_var </item>
+ <item> shm_remove </item>
+ <item> shm_remove_var </item>
+ <item> shmop_close </item>
+ <item> shmop_delete </item>
+ <item> shmop_open </item>
+ <item> shmop_read </item>
+ <item> shmop_size </item>
+ <item> shmop_write </item>
+ <item> show_source </item>
+ <item> shuffle </item>
+ <item> similar_text </item>
+ <item> simplexml_load_file </item>
+ <item> simplexml_load_string </item>
+ <item> sin </item>
+ <item> sinh </item>
+ <item> sizeof </item>
+ <item> sleep </item>
+ <item> snmp3_get </item>
+ <item> snmp3_getnext </item>
+ <item> snmp3_real_walk </item>
+ <item> snmp3_set </item>
+ <item> snmp3_walk </item>
+ <item> snmp_get_quick_print </item>
+ <item> snmp_get_valueretrieval </item>
+ <item> snmp_read_mib </item>
+ <item> snmp_set_enum_print </item>
+ <item> snmp_set_oid_numeric_print </item>
+ <item> snmp_set_quick_print </item>
+ <item> snmp_set_valueretrieval </item>
+ <item> snmpget </item>
+ <item> snmpgetnext </item>
+ <item> snmprealwalk </item>
+ <item> snmpset </item>
+ <item> snmpwalk </item>
+ <item> snmpwalkoid </item>
+ <item> socket_accept </item>
+ <item> socket_bind </item>
+ <item> socket_clear_error </item>
+ <item> socket_close </item>
+ <item> socket_connect </item>
+ <item> socket_create </item>
+ <item> socket_create_listen </item>
+ <item> socket_create_pair </item>
+ <item> socket_get_option </item>
+ <item> socket_get_status </item>
+ <item> socket_getopt </item>
+ <item> socket_getpeername </item>
+ <item> socket_getsockname </item>
+ <item> socket_iovec_add </item>
+ <item> socket_iovec_alloc </item>
+ <item> socket_iovec_delete </item>
+ <item> socket_iovec_fetch </item>
+ <item> socket_iovec_free </item>
+ <item> socket_iovec_set </item>
+ <item> socket_last_error </item>
+ <item> socket_listen </item>
+ <item> socket_read </item>
+ <item> socket_readv </item>
+ <item> socket_recv </item>
+ <item> socket_recvfrom </item>
+ <item> socket_recvmsg </item>
+ <item> socket_select </item>
+ <item> socket_send </item>
+ <item> socket_sendmsg </item>
+ <item> socket_sendto </item>
+ <item> socket_set_block </item>
+ <item> socket_set_blocking </item>
+ <item> socket_set_nonblock </item>
+ <item> socket_set_option </item>
+ <item> socket_set_timeout </item>
+ <item> socket_setopt </item>
+ <item> socket_shutdown </item>
+ <item> socket_strerror </item>
+ <item> socket_write </item>
+ <item> socket_writev </item>
+ <item> sort </item>
+ <item> soundex </item>
+ <item> spl_classes </item>
+ <item> split </item>
+ <item> spliti </item>
+ <item> sprintf </item>
+ <item> sql_regcase </item>
+ <item> sqlite_array_query </item>
+ <item> sqlite_busy_timeout </item>
+ <item> sqlite_changes </item>
+ <item> sqlite_close </item>
+ <item> sqlite_column </item>
+ <item> sqlite_create_aggregate </item>
+ <item> sqlite_create_function </item>
+ <item> sqlite_current </item>
+ <item> sqlite_error_string </item>
+ <item> sqlite_escape_string </item>
+ <item> sqlite_exec </item>
+ <item> sqlite_factory </item>
+ <item> sqlite_fetch_all </item>
+ <item> sqlite_fetch_array </item>
+ <item> sqlite_fetch_column_types </item>
+ <item> sqlite_fetch_object </item>
+ <item> sqlite_fetch_single </item>
+ <item> sqlite_fetch_string </item>
+ <item> sqlite_field_name </item>
+ <item> sqlite_has_more </item>
+ <item> sqlite_has_prev </item>
+ <item> sqlite_last_error </item>
+ <item> sqlite_last_insert_rowid </item>
+ <item> sqlite_libencoding </item>
+ <item> sqlite_libversion </item>
+ <item> sqlite_next </item>
+ <item> sqlite_num_fields </item>
+ <item> sqlite_num_rows </item>
+ <item> sqlite_open </item>
+ <item> sqlite_popen </item>
+ <item> sqlite_prev </item>
+ <item> sqlite_query </item>
+ <item> sqlite_rewind </item>
+ <item> sqlite_seek </item>
+ <item> sqlite_single_query </item>
+ <item> sqlite_udf_decode_binary </item>
+ <item> sqlite_udf_encode_binary </item>
+ <item> sqlite_unbuffered_query </item>
+ <item> sqlite_valid </item>
+ <item> sqrt </item>
+ <item> srand </item>
+ <item> sscanf </item>
+ <item> stat </item>
+ <item> str_ireplace </item>
+ <item> str_pad </item>
+ <item> str_repeat </item>
+ <item> str_replace </item>
+ <item> str_rot13 </item>
+ <item> str_shuffle </item>
+ <item> str_split </item>
+ <item> str_word_count </item>
+ <item> strcasecmp </item>
+ <item> strchr </item>
+ <item> strcmp </item>
+ <item> strcoll </item>
+ <item> strcspn </item>
+ <item> stream_bucket_append </item>
+ <item> stream_bucket_make_writeable </item>
+ <item> stream_bucket_new </item>
+ <item> stream_bucket_prepend </item>
+ <item> stream_context_create </item>
+ <item> stream_context_get_options </item>
+ <item> stream_context_set_option </item>
+ <item> stream_context_set_params </item>
+ <item> stream_copy_to_stream </item>
+ <item> stream_filter_append </item>
+ <item> stream_filter_prepend </item>
+ <item> stream_filter_register </item>
+ <item> stream_get_contents </item>
+ <item> stream_get_filters </item>
+ <item> stream_get_line </item>
+ <item> stream_get_meta_data </item>
+ <item> stream_get_transports </item>
+ <item> stream_get_wrappers </item>
+ <item> stream_register_wrapper </item>
+ <item> stream_select </item>
+ <item> stream_set_blocking </item>
+ <item> stream_set_timeout </item>
+ <item> stream_set_write_buffer </item>
+ <item> stream_socket_accept </item>
+ <item> stream_socket_client </item>
+ <item> stream_socket_get_name </item>
+ <item> stream_socket_recvfrom </item>
+ <item> stream_socket_sendto </item>
+ <item> stream_socket_server </item>
+ <item> stream_wrapper_register </item>
+ <item> strftime </item>
+ <item> strip_tags </item>
+ <item> stripcslashes </item>
+ <item> stripos </item>
+ <item> stripslashes </item>
+ <item> stristr </item>
+ <item> strlen </item>
+ <item> strnatcasecmp </item>
+ <item> strnatcmp </item>
+ <item> strncasecmp </item>
+ <item> strncmp </item>
+ <item> strpbrk </item>
+ <item> strpos </item>
+ <item> strrchr </item>
+ <item> strrev </item>
+ <item> strripos </item>
+ <item> strrpos </item>
+ <item> strspn </item>
+ <item> strstr </item>
+ <item> strtok </item>
+ <item> strtolower </item>
+ <item> strtotime </item>
+ <item> strtoupper </item>
+ <item> strtr </item>
+ <item> strval </item>
+ <item> substr </item>
+ <item> substr_compare </item>
+ <item> substr_count </item>
+ <item> substr_replace </item>
+ <item> swf_actiongeturl </item>
+ <item> swf_actiongotoframe </item>
+ <item> swf_actiongotolabel </item>
+ <item> swf_actionnextframe </item>
+ <item> swf_actionplay </item>
+ <item> swf_actionprevframe </item>
+ <item> swf_actionsettarget </item>
+ <item> swf_actionstop </item>
+ <item> swf_actiontogglequality </item>
+ <item> swf_actionwaitforframe </item>
+ <item> swf_addbuttonrecord </item>
+ <item> swf_addcolor </item>
+ <item> swf_closefile </item>
+ <item> swf_definebitmap </item>
+ <item> swf_definefont </item>
+ <item> swf_defineline </item>
+ <item> swf_definepoly </item>
+ <item> swf_definerect </item>
+ <item> swf_definetext </item>
+ <item> swf_endbutton </item>
+ <item> swf_enddoaction </item>
+ <item> swf_endshape </item>
+ <item> swf_endsymbol </item>
+ <item> swf_fontsize </item>
+ <item> swf_fontslant </item>
+ <item> swf_fonttracking </item>
+ <item> swf_getbitmapinfo </item>
+ <item> swf_getfontinfo </item>
+ <item> swf_getframe </item>
+ <item> swf_labelframe </item>
+ <item> swf_lookat </item>
+ <item> swf_modifyobject </item>
+ <item> swf_mulcolor </item>
+ <item> swf_nextid </item>
+ <item> swf_oncondition </item>
+ <item> swf_openfile </item>
+ <item> swf_ortho </item>
+ <item> swf_ortho2 </item>
+ <item> swf_perspective </item>
+ <item> swf_placeobject </item>
+ <item> swf_polarview </item>
+ <item> swf_popmatrix </item>
+ <item> swf_posround </item>
+ <item> swf_pushmatrix </item>
+ <item> swf_removeobject </item>
+ <item> swf_rotate </item>
+ <item> swf_scale </item>
+ <item> swf_setfont </item>
+ <item> swf_setframe </item>
+ <item> swf_shapearc </item>
+ <item> swf_shapecurveto </item>
+ <item> swf_shapecurveto3 </item>
+ <item> swf_shapefillbitmapclip </item>
+ <item> swf_shapefillbitmaptile </item>
+ <item> swf_shapefilloff </item>
+ <item> swf_shapefillsolid </item>
+ <item> swf_shapelinesolid </item>
+ <item> swf_shapelineto </item>
+ <item> swf_shapemoveto </item>
+ <item> swf_showframe </item>
+ <item> swf_startbutton </item>
+ <item> swf_startdoaction </item>
+ <item> swf_startshape </item>
+ <item> swf_startsymbol </item>
+ <item> swf_textwidth </item>
+ <item> swf_translate </item>
+ <item> swf_viewport </item>
+ <item> swfaction </item>
+ <item> swfbitmap </item>
+ <item> swfbitmap.getheight </item>
+ <item> swfbitmap.getwidth </item>
+ <item> swfbutton </item>
+ <item> swfbutton.addaction </item>
+ <item> swfbutton.addshape </item>
+ <item> swfbutton.setaction </item>
+ <item> swfbutton.setdown </item>
+ <item> swfbutton.sethit </item>
+ <item> swfbutton.setover </item>
+ <item> swfbutton.setup </item>
+ <item> swfbutton_keypress </item>
+ <item> swfdisplayitem </item>
+ <item> swfdisplayitem.addcolor </item>
+ <item> swfdisplayitem.move </item>
+ <item> swfdisplayitem.moveto </item>
+ <item> swfdisplayitem.multcolor </item>
+ <item> swfdisplayitem.remove </item>
+ <item> swfdisplayitem.rotate </item>
+ <item> swfdisplayitem.rotateto </item>
+ <item> swfdisplayitem.scale </item>
+ <item> swfdisplayitem.scaleto </item>
+ <item> swfdisplayitem.setdepth </item>
+ <item> swfdisplayitem.setname </item>
+ <item> swfdisplayitem.setratio </item>
+ <item> swfdisplayitem.skewx </item>
+ <item> swfdisplayitem.skewxto </item>
+ <item> swfdisplayitem.skewy </item>
+ <item> swfdisplayitem.skewyto </item>
+ <item> swffill </item>
+ <item> swffill.moveto </item>
+ <item> swffill.rotateto </item>
+ <item> swffill.scaleto </item>
+ <item> swffill.skewxto </item>
+ <item> swffill.skewyto </item>
+ <item> swffont </item>
+ <item> swffont.getwidth </item>
+ <item> swfgradient </item>
+ <item> swfgradient.addentry </item>
+ <item> swfmorph </item>
+ <item> swfmorph.getshape1 </item>
+ <item> swfmorph.getshape2 </item>
+ <item> swfmovie </item>
+ <item> swfmovie.add </item>
+ <item> swfmovie.nextframe </item>
+ <item> swfmovie.output </item>
+ <item> swfmovie.remove </item>
+ <item> swfmovie.save </item>
+ <item> swfmovie.setbackground </item>
+ <item> swfmovie.setdimension </item>
+ <item> swfmovie.setframes </item>
+ <item> swfmovie.setrate </item>
+ <item> swfmovie.streammp3 </item>
+ <item> swfshape </item>
+ <item> swfshape.addfill </item>
+ <item> swfshape.drawcurve </item>
+ <item> swfshape.drawcurveto </item>
+ <item> swfshape.drawline </item>
+ <item> swfshape.drawlineto </item>
+ <item> swfshape.movepen </item>
+ <item> swfshape.movepento </item>
+ <item> swfshape.setleftfill </item>
+ <item> swfshape.setline </item>
+ <item> swfshape.setrightfill </item>
+ <item> swfsprite </item>
+ <item> swfsprite.add </item>
+ <item> swfsprite.nextframe </item>
+ <item> swfsprite.remove </item>
+ <item> swfsprite.setframes </item>
+ <item> swftext </item>
+ <item> swftext.addstring </item>
+ <item> swftext.getwidth </item>
+ <item> swftext.moveto </item>
+ <item> swftext.setcolor </item>
+ <item> swftext.setfont </item>
+ <item> swftext.setheight </item>
+ <item> swftext.setspacing </item>
+ <item> swftextfield </item>
+ <item> swftextfield.addstring </item>
+ <item> swftextfield.align </item>
+ <item> swftextfield.setbounds </item>
+ <item> swftextfield.setcolor </item>
+ <item> swftextfield.setfont </item>
+ <item> swftextfield.setheight </item>
+ <item> swftextfield.setindentation </item>
+ <item> swftextfield.setleftmargin </item>
+ <item> swftextfield.setlinespacing </item>
+ <item> swftextfield.setmargins </item>
+ <item> swftextfield.setname </item>
+ <item> swftextfield.setrightmargin </item>
+ <item> sybase_affected_rows </item>
+ <item> sybase_close </item>
+ <item> sybase_connect </item>
+ <item> sybase_data_seek </item>
+ <item> sybase_fetch_array </item>
+ <item> sybase_fetch_field </item>
+ <item> sybase_fetch_object </item>
+ <item> sybase_fetch_row </item>
+ <item> sybase_field_seek </item>
+ <item> sybase_free_result </item>
+ <item> sybase_get_last_message </item>
+ <item> sybase_min_client_severity </item>
+ <item> sybase_min_error_severity </item>
+ <item> sybase_min_message_severity </item>
+ <item> sybase_min_server_severity </item>
+ <item> sybase_num_fields </item>
+ <item> sybase_num_rows </item>
+ <item> sybase_pconnect </item>
+ <item> sybase_query </item>
+ <item> sybase_result </item>
+ <item> sybase_select_db </item>
+ <item> symlink </item>
+ <item> syslog </item>
+ <item> system </item>
+ <item> tan </item>
+ <item> tanh </item>
+ <item> tempnam </item>
+ <item> textdomain </item>
+ <item> time </item>
+ <item> time_nanosleep </item>
+ <item> tmpfile </item>
+ <item> token_get_all </item>
+ <item> token_name </item>
+ <item> touch </item>
+ <item> trigger_error </item>
+ <item> trim </item>
+ <item> uasort </item>
+ <item> ucfirst </item>
+ <item> ucwords </item>
+ <item> udm_add_search_limit </item>
+ <item> udm_alloc_agent </item>
+ <item> udm_api_version </item>
+ <item> udm_cat_list </item>
+ <item> udm_cat_path </item>
+ <item> udm_check_charset </item>
+ <item> udm_check_stored </item>
+ <item> udm_clear_search_limits </item>
+ <item> udm_close_stored </item>
+ <item> udm_crc32 </item>
+ <item> udm_errno </item>
+ <item> udm_error </item>
+ <item> udm_find </item>
+ <item> udm_free_agent </item>
+ <item> udm_free_ispell_data </item>
+ <item> udm_free_res </item>
+ <item> udm_get_doc_count </item>
+ <item> udm_get_res_field </item>
+ <item> udm_get_res_param </item>
+ <item> udm_load_ispell_data </item>
+ <item> udm_open_stored </item>
+ <item> udm_set_agent_param </item>
+ <item> uksort </item>
+ <item> umask </item>
+ <item> uniqid </item>
+ <item> unixtojd </item>
+ <item> unlink </item>
+ <item> unpack </item>
+ <item> unregister_tick_function </item>
+ <item> unserialize </item>
+ <item> unset </item>
+ <item> urldecode </item>
+ <item> urlencode </item>
+ <item> use_soap_error_handler </item>
+ <item> user_error </item>
+ <item> usleep </item>
+ <item> usort </item>
+ <item> utf8_decode </item>
+ <item> utf8_encode </item>
+ <item> var_dump </item>
+ <item> var_export </item>
+ <item> variant </item>
+ <item> version_compare </item>
+ <item> vfprintf </item>
+ <item> virtual </item>
+ <item> vpopmail_add_alias_domain </item>
+ <item> vpopmail_add_alias_domain_ex </item>
+ <item> vpopmail_add_domain </item>
+ <item> vpopmail_add_domain_ex </item>
+ <item> vpopmail_add_user </item>
+ <item> vpopmail_alias_add </item>
+ <item> vpopmail_alias_del </item>
+ <item> vpopmail_alias_del_domain </item>
+ <item> vpopmail_alias_get </item>
+ <item> vpopmail_alias_get_all </item>
+ <item> vpopmail_auth_user </item>
+ <item> vpopmail_del_domain </item>
+ <item> vpopmail_del_domain_ex </item>
+ <item> vpopmail_del_user </item>
+ <item> vpopmail_error </item>
+ <item> vpopmail_passwd </item>
+ <item> vpopmail_set_user_quota </item>
+ <item> vprintf </item>
+ <item> vsprintf </item>
+ <item> w32api_deftype </item>
+ <item> w32api_init_dtype </item>
+ <item> w32api_invoke_function </item>
+ <item> w32api_register_function </item>
+ <item> w32api_set_call_method </item>
+ <item> wddx_add_vars </item>
+ <item> wddx_deserialize </item>
+ <item> wddx_packet_end </item>
+ <item> wddx_packet_start </item>
+ <item> wddx_serialize_value </item>
+ <item> wddx_serialize_vars </item>
+ <item> wordwrap </item>
+ <item> xml_error_string </item>
+ <item> xml_get_current_byte_index </item>
+ <item> xml_get_current_column_number </item>
+ <item> xml_get_current_line_number </item>
+ <item> xml_get_error_code </item>
+ <item> xml_parse </item>
+ <item> xml_parse_into_struct </item>
+ <item> xml_parser_create </item>
+ <item> xml_parser_create_ns </item>
+ <item> xml_parser_free </item>
+ <item> xml_parser_get_option </item>
+ <item> xml_parser_set_option </item>
+ <item> xml_set_character_data_handler </item>
+ <item> xml_set_default_handler </item>
+ <item> xml_set_element_handler </item>
+ <item> xml_set_end_namespace_decl_handler </item>
+ <item> xml_set_external_entity_ref_handler </item>
+ <item> xml_set_notation_decl_handler </item>
+ <item> xml_set_object </item>
+ <item> xml_set_processing_instruction_handler </item>
+ <item> xml_set_start_namespace_decl_handler </item>
+ <item> xml_set_unparsed_entity_decl_handler </item>
+ <item> xmldoc </item>
+ <item> xmldocfile </item>
+ <item> xmlrpc_decode </item>
+ <item> xmlrpc_decode_request </item>
+ <item> xmlrpc_encode </item>
+ <item> xmlrpc_encode_request </item>
+ <item> xmlrpc_get_type </item>
+ <item> xmlrpc_is_fault </item>
+ <item> xmlrpc_parse_method_descriptions </item>
+ <item> xmlrpc_server_add_introspection_data </item>
+ <item> xmlrpc_server_call_method </item>
+ <item> xmlrpc_server_create </item>
+ <item> xmlrpc_server_destroy </item>
+ <item> xmlrpc_server_register_introspection_callback </item>
+ <item> xmlrpc_server_register_method </item>
+ <item> xmlrpc_set_type </item>
+ <item> xmltree </item>
+ <item> xpath_eval </item>
+ <item> xpath_eval_expression </item>
+ <item> xpath_new_context </item>
+ <item> xptr_eval </item>
+ <item> xptr_new_context </item>
+ <item> xslt_create </item>
+ <item> xslt_errno </item>
+ <item> xslt_error </item>
+ <item> xslt_free </item>
+ <item> xslt_process </item>
+ <item> xslt_set_base </item>
+ <item> xslt_set_encoding </item>
+ <item> xslt_set_error_handler </item>
+ <item> xslt_set_log </item>
+ <item> xslt_set_sax_handler </item>
+ <item> xslt_set_sax_handlers </item>
+ <item> xslt_set_scheme_handler </item>
+ <item> xslt_set_scheme_handlers </item>
+ <item> yaz_addinfo </item>
+ <item> yaz_ccl_conf </item>
+ <item> yaz_ccl_parse </item>
+ <item> yaz_close </item>
+ <item> yaz_connect </item>
+ <item> yaz_database </item>
+ <item> yaz_element </item>
+ <item> yaz_errno </item>
+ <item> yaz_error </item>
+ <item> yaz_hits </item>
+ <item> yaz_itemorder </item>
+ <item> yaz_present </item>
+ <item> yaz_range </item>
+ <item> yaz_record </item>
+ <item> yaz_scan </item>
+ <item> yaz_scan_result </item>
+ <item> yaz_search </item>
+ <item> yaz_sort </item>
+ <item> yaz_syntax </item>
+ <item> yaz_wait </item>
+ <item> yp_all </item>
+ <item> yp_cat </item>
+ <item> yp_err_string </item>
+ <item> yp_errno </item>
+ <item> yp_first </item>
+ <item> yp_get_default_domain </item>
+ <item> yp_master </item>
+ <item> yp_match </item>
+ <item> yp_next </item>
+ <item> yp_order </item>
+ <item> zend_logo_guid </item>
+ <item> zend_version </item>
+ <item> zip_close </item>
+ <item> zip_entry_close </item>
+ <item> zip_entry_compressedsize </item>
+ <item> zip_entry_compressionmethod </item>
+ <item> zip_entry_filesize </item>
+ <item> zip_entry_name </item>
+ <item> zip_entry_open </item>
+ <item> zip_entry_read </item>
+ <item> zip_open </item>
+ <item> zip_read </item>
+ <item> zlib_get_coding_type </item>
+ </list>
+ <contexts>
+ <context name="start" lineEndContext="#stay" attribute="Normal Text">
+ <RegExpr context="phpsource" attribute="Keyword" String="&lt;\?(?:=|php)?" beginRegion="php" />
+ </context>
+ <context name="phpsource" attribute="PHP Text" lineEndContext="#stay">
+ <DetectSpaces />
+ <StringDetect attribute="Keyword" context="#pop#pop" String="?&gt;" endRegion="php" />
+ <DetectChar attribute="Comment" context="onelinecomment" char="#" />
+ <IncludeRules context="##Doxygen" />
+ <Detect2Chars attribute="Comment" context="onelinecomment" char="/" char1="/" />
+ <Detect2Chars attribute="Comment" context="twolinecomment" char="/" char1="&#42;" beginRegion="Comment"/>
+ <keyword attribute="Control Structures" context="#stay" String="control structures" />
+ <keyword attribute="Keyword" context="#stay" String="keywords" />
+ <keyword attribute="Function" context="#stay" String="functions" />
+ <keyword attribute="Special method" context="#stay" String="special_methods" />
+ <DetectIdentifier />
+ <DetectChar attribute="String" context="doblequotestring" char="&quot;" />
+ <DetectChar attribute="String" context="singlequotestring" char="&#39;" />
+ <RegExpr attribute="Backslash Code" context="heredoc" String="&lt;&lt;&lt;([A-Za-z_][A-Za-z0-9_]*)" />
+ <RegExpr attribute="Variable" context="#stay" String="\$+[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*" />
+ <RegExpr attribute="String" context="#stay" String="[0123456789]*\.\.\.[0123456789]*" />
+ <HlCOct attribute="Octal" context="#stay" />
+ <HlCHex attribute="Hex" context="#stay" />
+ <Float attribute="Float" context="#stay" />
+ <Int attribute="Decimal" context="#stay" />
+ <DetectChar attribute="Symbol" context="#stay" char="{" beginRegion="Brace1" />
+ <DetectChar attribute="Symbol" context="#stay" char="}" endRegion="Brace1" />
+ <AnyChar attribute="Symbol" context="#stay" String=";()}{:,[]" />
+ </context>
+ <context name="onelinecomment" attribute="Comment" lineEndContext="#pop">
+ <StringDetect attribute="Keyword" context="#pop" lookAhead="true" String="?&gt;" />
+ </context>
+ <context name="twolinecomment" attribute="Comment" lineEndContext="#stay">
+ <Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" endRegion="Comment" />
+ </context>
+ <context name="doblequotestring" attribute="String" lineEndContext="#stay">
+<!-- URL: http://de3.php.net/manual/en/language.types.string.php#language.types.string.syntax.double -->
+ <Detect2Chars attribute="Backslash Code" context="#stay" char="\" char1="&quot;" />
+ <Detect2Chars attribute="Backslash Code" context="#stay" char="\" char1="\" />
+ <Detect2Chars attribute="Backslash Code" context="#stay" char="\" char1="n" />
+ <Detect2Chars attribute="Backslash Code" context="#stay" char="\" char1="r" />
+ <Detect2Chars attribute="Backslash Code" context="#stay" char="\" char1="t" />
+ <Detect2Chars attribute="Backslash Code" context="#stay" char="\" char1="$" />
+ <RegExpr attribute="Backslash Code" context="#stay" String="\\[0-7]{1,3}" />
+ <RegExpr attribute="Backslash Code" context="#stay" String="\\x[0-9A-Fa-f]{1,2}" />
+ <RegExpr attribute="Variable" context="#stay" String="\$[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*(\[[a-zA-Z0-9_]*\])*" />
+ <RegExpr attribute="Variable" context="#stay" String="\$\{[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*(\[[a-zA-Z0-9_]*\])*\}" />
+ <RegExpr attribute="Variable" context="#stay" String="\{\$[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*(\[([0-9]*|&quot;[^&quot;]*&quot;)|'[^']*'|\])*(->[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*(\[[a-zA-Z0-9_]*\])*(\[([0-9]*|&quot;[a-zA-Z_]*&quot;)|'[a-zA-Z_]*'|\])*)*\}" />
+ <DetectChar attribute="String" context="#pop" char="&quot;" />
+ </context>
+ <context name="singlequotestring" attribute="String" lineEndContext="#stay">
+ <Detect2Chars attribute="Backslash Code" context="#stay" char="\" char1="'"/>
+ <Detect2Chars attribute="Backslash Code" context="#stay" char="\" char1="\"/>
+ <DetectChar attribute="String" context="#pop" char="'" />
+ </context>
+ <context name="heredoc" attribute="String" lineEndContext="#stay" dynamic="true">
+ <RegExpr attribute="Backslash Code" context="#pop" String="^%1;?$" dynamic="true" />
+ <RegExpr attribute="Variable" context="#stay" String="\$[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*(\[[a-zA-Z0-9_]*\])*" />
+ <RegExpr attribute="Variable" context="#stay" String="\$\{[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*(\[[a-zA-Z0-9_]*\])*\}" />
+ <RegExpr attribute="Variable" context="#stay" String="\{\$[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*(\[([0-9]*|&quot;[a-zA-Z_]*&quot;)|'[a-zA-Z_]*'|\])*(->[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*(\[[a-zA-Z0-9_]*\])*(\[([0-9]*|&quot;[a-zA-Z_]*&quot;)|'[a-zA-Z_]*'|\])*)*\}" />
+ </context>
+ </contexts>
+ <itemDatas>
+ <itemData name="Normal Text" defStyleNum="dsNormal" />
+ <itemData name="Symbol" defStyleNum="dsNormal" />
+ <itemData name="PHP Text" defStyleNum="dsNormal" />
+ <itemData name="Keyword" defStyleNum="dsKeyword" />
+ <itemData name="Function" defStyleNum="dsFunction" />
+ <itemData name="Special method" defStyleNum="dsFunction" />
+ <itemData name="Decimal" defStyleNum="dsDecVal" />
+ <itemData name="Octal" defStyleNum="dsBaseN" />
+ <itemData name="Hex" defStyleNum="dsBaseN" />
+ <itemData name="Float" defStyleNum="dsFloat" />
+ <itemData name="String" defStyleNum="dsString" />
+ <itemData name="Comment" defStyleNum="dsComment" />
+ <itemData name="Variable" defStyleNum="dsKeyword" color="#5555FF" selColor="#ffffff" bold="0" italic="0" />
+ <itemData name="Control Structures" defStyleNum="dsKeyword" color="#A1A100" selColor="#ffffff" bold="0" italic="0" />
+ <itemData name="Backslash Code" defStyleNum="dsKeyword" color="#0F0F8F" selColor="#ffffff" bold="1" italic="0" />
+ <itemData name="Other" defStyleNum="dsOthers" />
+
+ <itemData name="HTML Tag" defStyleNum="dsKeyword" color="#0F0000" selColor="#ffffff" bold="1" italic="0" />
+ <itemData name="HTML Comment" defStyleNum="dsComment" />
+ <itemData name="Identifier" defStyleNum="dsOthers" />
+ <itemData name="Types" defStyleNum="dsDataType" />
+ </itemDatas>
+ </highlighting>
+ <general>
+ <comments>
+ <comment name="singleLine" start="//" />
+ <comment name="multiLine" start="/*" end="*/" />
+ </comments>
+ <keywords casesensitive="0" weakDeliminator=""/>
+ </general>
+</language>
diff --git a/kate/data/picsrc.xml b/kate/data/picsrc.xml
new file mode 100644
index 000000000..57386f559
--- /dev/null
+++ b/kate/data/picsrc.xml
@@ -0,0 +1,402 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+<!-- kate: space-indent on; indent-width 2; -->
+
+<!-- Microchip PIC assembler syntaxfile for gpasm/mpasm assembler by
+ * Original author: Alain GIBAUD (alain.gibaud@univ-valenciennes.fr)
+ * Small modifications for the new DTD: Joseph Wenninger <jowenn@kde.org>
+ * Updated for 16-bit devices, etc.: Laurence Withers <lwithers@users.sf.net>
+-->
+
+<language name="PicAsm" version="1.07" kateversion="2.3" section="Assembler" extensions="*.src;*.SRC;*.asm;*.ASM;*.pic;*.PIC" mimetype="text/x-PicSrc;text/x-PicHdr" author="Alain GIBAUD (alain.gibaud@univ-valenciennes.fr)" license="LGPL">
+
+ <highlighting>
+ <list name="directives">
+ <item> __BADRAM </item>
+ <item> __CONFIG </item>
+ <item> __IDLOCS </item>
+ <item> __MAXRAM </item>
+
+ <item> cblock </item>
+ <item> constant </item>
+ <item> da </item>
+ <item> data </item>
+ <item> db </item>
+ <item> de </item>
+ <item> dt </item>
+ <item> dw </item>
+ <item> endc </item>
+ <item> endm </item>
+ <item> equ </item>
+ <item> error </item>
+ <item> errorlevel </item>
+ <item> exitm </item>
+ <item> fill </item>
+ <item> list </item>
+ <item> local </item>
+ <item> macro </item>
+ <item> messg </item>
+ <item> noexpand </item>
+ <item> nolist </item>
+ <item> org </item>
+ <item> page </item>
+ <item> processor </item>
+ <item> radix </item>
+ <item> res </item>
+ <item> set </item>
+ <item> space </item>
+ <item> subtitle </item>
+ <item> title </item>
+ <item> variable </item>
+ <item> end </item>
+
+ <item> CBLOCK </item>
+ <item> CONSTANT </item>
+ <item> DA </item>
+ <item> DATA </item>
+ <item> DB </item>
+ <item> DE </item>
+ <item> DT </item>
+ <item> DW </item>
+ <item> ENDC </item>
+ <item> ENDM </item>
+ <item> EQU </item>
+ <item> ERROR </item>
+ <item> ERRORLEVEL </item>
+ <item> EXITM </item>
+ <item> FILL </item>
+ <item> LIST </item>
+ <item> LOCAL </item>
+ <item> MACRO </item>
+ <item> MESSG </item>
+ <item> NOEXPAND </item>
+ <item> NOLIST </item>
+ <item> ORG </item>
+ <item> PAGE </item>
+ <item> PROCESSOR </item>
+ <item> RADIX </item>
+ <item> RES </item>
+ <item> SET </item>
+ <item> SPACE </item>
+ <item> SUBTITLE </item>
+ <item> TITLE </item>
+ <item> VARIABLE </item>
+ <item> END </item>
+ </list>
+
+ <list name="conditional">
+ <item> if </item>
+ <item> else </item>
+ <item> idef </item>
+ <item> ifndef </item>
+ <item> endif </item>
+ <item> while </item>
+ <item> include </item>
+ <item> endw </item>
+ <item> { </item>
+ <item> } </item>
+ </list>
+
+ <list name="gpasm_macro">
+ <item> addcf </item>
+ <item> b </item>
+ <item> clrc </item>
+ <item> clrz </item>
+ <item> setc </item>
+ <item> setz </item>
+ <item> movfw </item>
+ <item> skpc </item>
+ <item> skpz </item>
+ <item> skpnc </item>
+ <item> skpnz </item>
+ <item> subcf </item>
+ <item> tstf </item>
+
+ <item> ADDCF </item>
+ <item> B </item>
+ <item> CLRC </item>
+ <item> CLRZ </item>
+ <item> SETC </item>
+ <item> SETZ </item>
+ <item> MOVFW </item>
+ <item> SKPC </item>
+ <item> SKPZ </item>
+ <item> SKPNC </item>
+ <item> SKPNZ </item>
+ <item> SUBCF </item>
+ <item> TSTF </item>
+ </list>
+
+ <list name="instructions">
+ <item> addlw </item>
+ <item> addwf </item>
+ <item> addwfc </item>
+ <item> andlw </item>
+ <item> andwf </item>
+ <item> bc </item>
+ <item> bcf </item>
+ <item> bn </item>
+ <item> bnc </item>
+ <item> bnov </item>
+ <item> bnz </item>
+ <item> bov </item>
+ <item> bra </item>
+ <item> bsf </item>
+ <item> btg </item>
+ <item> bz </item>
+ <item> btfsc </item>
+ <item> btfss </item>
+ <item> call </item>
+ <item> clrf </item>
+ <item> clrw </item>
+ <item> clrwdt </item>
+ <item> comf </item>
+ <item> cpfseq </item>
+ <item> cpfslt </item>
+ <item> cpfsgt </item>
+ <item> daw </item>
+ <item> decf </item>
+ <item> dcfsnz </item>
+ <item> decfsz </item>
+ <item> goto </item>
+ <item> incf </item>
+ <item> incfsz </item>
+ <item> infsnz </item>
+ <item> iorlw </item>
+ <item> iorwf </item>
+ <item> lfsr </item>
+ <item> movf </item>
+ <item> movff </item>
+ <item> movlb </item>
+ <item> movlw </item>
+ <item> movwf </item>
+ <item> mullw </item>
+ <item> mulwf </item>
+ <item> negf </item>
+ <item> nop </item>
+ <item> option </item>
+ <item> pop </item>
+ <item> push </item>
+ <item> rcall </item>
+ <item> reset </item>
+ <item> retfie </item>
+ <item> retlw </item>
+ <item> return </item>
+ <item> rlcf </item>
+ <item> rlf </item>
+ <item> rlncf </item>
+ <item> rrcf </item>
+ <item> rrf </item>
+ <item> rrncf </item>
+ <item> setf </item>
+ <item> sleep </item>
+ <item> subfwb </item>
+ <item> sublw </item>
+ <item> subwf </item>
+ <item> subwfb </item>
+ <item> swapf </item>
+ <item> tblrd </item>
+ <item> tblwt </item>
+ <item> tstfsz </item>
+ <item> xorlw </item>
+ <item> xorwf </item>
+
+ <item> ADDLW </item>
+ <item> ADDWF </item>
+ <item> ADDWFC </item>
+ <item> ANDLW </item>
+ <item> ANDWF </item>
+ <item> BC </item>
+ <item> BCF </item>
+ <item> BN </item>
+ <item> BNC </item>
+ <item> BNOV </item>
+ <item> BNZ </item>
+ <item> BOV </item>
+ <item> BRA </item>
+ <item> BSF </item>
+ <item> BTG </item>
+ <item> BZ </item>
+ <item> BTFSC </item>
+ <item> BTFSS </item>
+ <item> CALL </item>
+ <item> CLRF </item>
+ <item> CLRW </item>
+ <item> CLRWDT </item>
+ <item> COMF </item>
+ <item> CPFSEQ </item>
+ <item> CPFSLT </item>
+ <item> CPFSGT </item>
+ <item> DAW </item>
+ <item> DCFSNZ </item>
+ <item> DECF </item>
+ <item> DECFSZ </item>
+ <item> GOTO </item>
+ <item> INCF </item>
+ <item> INCFSZ </item>
+ <item> INFSNZ </item>
+ <item> IORLW </item>
+ <item> IORWF </item>
+ <item> LFSR </item>
+ <item> MOVF </item>
+ <item> MOVFF </item>
+ <item> MOVLB </item>
+ <item> MOVLW </item>
+ <item> MOVWF </item>
+ <item> MULLW </item>
+ <item> MULWF </item>
+ <item> NEGF </item>
+ <item> NOP </item>
+ <item> OPTION </item>
+ <item> POP </item>
+ <item> PUSH </item>
+ <item> RCALL </item>
+ <item> RESET </item>
+ <item> RETFIE </item>
+ <item> RETLW </item>
+ <item> RETURN </item>
+ <item> RLCF </item>
+ <item> RLF </item>
+ <item> RLNCF </item>
+ <item> RRCF </item>
+ <item> RRF </item>
+ <item> RRNCF </item>
+ <item> SETF </item>
+ <item> SLEEP </item>
+ <item> SUBFWB </item>
+ <item> SUBLW </item>
+ <item> SUBWF </item>
+ <item> SUBWFB </item>
+ <item> SWAPF </item>
+ <item> TBLRD </item>
+ <item> TBLWT </item>
+ <item> TSTFSZ </item>
+ <item> XORLW </item>
+ <item> XORWF </item>
+ </list>
+
+ <list name="instruction_attr">
+ <item> A </item>
+ <item> ACCESS </item>
+ <item> BANKED </item>
+ <item> W </item>
+ <item> F </item>
+ </list>
+
+ <contexts>
+
+ <!-- The main ('normal') context -->
+
+ <context name="normal" attribute="Normal Text" lineEndContext="#stay">
+ <keyword attribute="Directives" context="#stay" String="directives"/>
+ <keyword attribute="Instructions" context="#stay" String="instructions"/>
+ <keyword attribute="InstructionAttr" context="#stay" String="instruction_attr"/>
+ <keyword attribute="Preprocessor" context="#stay" String="conditional"/>
+ <keyword attribute="GPASM-macros" context="#stay" String="gpasm_macro"/>
+ <HlCHex attribute="Based Numbers" context="#stay"/>
+ <RegExpr attribute="Based Numbers" context="#stay" String="([ \t,][0-9A-F]+H[ \t,])" insensitive="TRUE" />
+ <RegExpr attribute="Based Numbers" context="#stay" String="([ \t,][0-9A-F]+H)$" insensitive="TRUE" />
+ <RegExpr attribute="Based Numbers" context="#stay" String="([ \t,][0-9]+D)" insensitive="TRUE" />
+ <RegExpr attribute="Based Numbers" context="#stay" String="([ \t,][0-7]+O)" insensitive="TRUE" />
+ <RegExpr attribute="Based Numbers" context="#stay" String="([ \t,][0-1]+B)" insensitive="TRUE" />
+ <Int attribute="Non Based Numbers" context="#stay" />
+ <HlCChar attribute="Char" context="#stay"/>
+ <Detect2Chars attribute="Char" context="ASCIIChar" char="A" char1="'" />
+ <Detect2Chars attribute="Char" context="ASCIIChar" char="a" char1="'" />
+ <Detect2Chars attribute="Based Numbers" context="binaryDigits" char="B" char1="'" />
+ <Detect2Chars attribute="Based Numbers" context="binaryDigits" char="b" char1="'" />
+ <Detect2Chars attribute="Based Numbers" context="hexDigits" char="H" char1="'" />
+ <Detect2Chars attribute="Based Numbers" context="hexDigits" char="h" char1="'" />
+ <Detect2Chars attribute="Based Numbers" context="octDigits" char="O" char1="'" />
+ <Detect2Chars attribute="Based Numbers" context="octDigits" char="o" char1="'" />
+ <Detect2Chars attribute="Based Numbers" context="decimalDigits" char="D" char1="'" />
+ <Detect2Chars attribute="Based Numbers" context="decimalDigits" char="d" char1="'" />
+ <DetectChar attribute="String" context="string" char="&quot;" />
+ <DetectChar attribute="Comment" context="comment" char=";" />
+ <AnyChar attribute="Symbol" context="#stay" String="-/*%+=&gt;&lt;&amp;|^!~" />
+ <StringDetect attribute="Preprocessor" context="#stay" String="#define" />
+ <StringDetect attribute="Preprocessor" context="#stay" String="#undefine" />
+ <StringDetect attribute="Preprocessor" context="#stay" String="#v" />
+ </context>
+
+
+
+ <!-- Additional contexts -->
+
+ <context name="string" attribute="String" lineEndContext="#pop">
+ <LineContinue attribute="String" context="#stay"/>
+ <HlCStringChar attribute="Char" context="#stay"/>
+ <DetectChar attribute="String" context="#pop" char="&quot;"/>
+ </context>
+
+ <context name="comment" attribute="Comment" lineEndContext="#pop">
+ <RegExpr attribute="Instructions" context="#stay"
+ String="(INPUT|OUTPUT|PARAMETERS|AUTHOR|EMAIL)" />
+ <RegExpr attribute="Alert" context="#stay" String="(FIXME|TODO)" />
+ </context>
+
+
+
+ <!-- Quoted numbers -->
+
+ <context name="decimalDigits" attribute="Based Numbers" lineEndContext="#pop">
+ <DetectChar attribute="Based Numbers" context="#pop" char="'"/>
+ <RegExpr attribute="Error" context="QuotedNumError" String="\D" />
+ </context>
+
+ <context name="binaryDigits" attribute="Based Numbers" lineEndContext="#pop">
+ <DetectChar attribute="Based Numbers" context="#pop" char="'"/>
+ <RegExpr attribute="Error" context="QuotedNumError" String="[^0-1]" />
+ </context>
+
+ <context name="hexDigits" attribute="Based Numbers" lineEndContext="#pop">
+ <DetectChar attribute="Based Numbers" context="#pop" char="'"/>
+ <RegExpr attribute="Error" context="QuotedNumError" String="[^0-9A-Fa-f]" />
+ </context>
+
+ <context name="octDigits" attribute="Based Numbers" lineEndContext="#pop">
+ <DetectChar attribute="Based Numbers" context="#pop" char="'"/>
+ <RegExpr attribute="Error" context="QuotedNumError" String="[^0-7]" />
+ </context>
+
+ <context name="ASCIIChar" attribute="Char" lineEndContext="#pop">
+ <DetectChar attribute="Char" context="#pop" char="'"/>
+ <RegExpr attribute="Error" context="QuotedNumError" String=".[^']" />
+ </context>
+
+ <context name="QuotedNumError" attribute="Error" lineEndContext="#pop#pop">
+ <DetectChar attribute="Error" context="#pop#pop" char="'" />
+ </context>
+
+ </contexts>
+
+
+ <itemDatas>
+ <itemData name="Normal Text" defStyleNum="dsNormal"/>
+ <itemData name="Directives" defStyleNum="dsOthers"/>
+ <itemData name="Preprocessor" defStyleNum="dsOthers"/>
+ <itemData name="Instructions" defStyleNum="dsKeyword"/>
+ <itemData name="InstructionAttr" defStyleNum="dsNormal" color="#000080" selColor="#000080" bold="0" italic="1"/>
+ <itemData name="Unbased Numbers" defStyleNum="dsDecVal"/>
+ <itemData name="Char" defStyleNum="dsChar"/>
+ <itemData name="String" defStyleNum="dsString"/>
+ <itemData name="Comment" defStyleNum="dsComment" />
+ <itemData name="Symbol" defStyleNum="dsNormal" color="#FF0000" selColor="#083194" bold="0" italic="0"/>
+ <itemData name="Prep. Lib" defStyleNum="dsOthers"/>
+ <itemData name="Based Numbers" defStyleNum="dsBaseN" />
+ <itemData name="GPASM-macros" defStyleNum="dsNormal" color="#000000" selColor="#000000" bold="1" italic="1"/>
+ <itemData name="Alert" defStyleNum="dsAlert" />
+ <itemData name="Error" defStyleNum="dsError" />
+ </itemDatas>
+
+ </highlighting>
+
+
+ <general>
+ <comments>
+ <comment name="singleLine" start=";" />
+ </comments>
+ <keywords casesensitive="1" />
+ </general>
+
+</language>
diff --git a/kate/data/pike.xml b/kate/data/pike.xml
new file mode 100644
index 000000000..461b0c17b
--- /dev/null
+++ b/kate/data/pike.xml
@@ -0,0 +1,121 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+<!-- FIXME: Find a way to prevent ranges (e.g. [1..] or [0..99]) from matching as floats. -pp -->
+<language name="Pike" version="1.07" kateversion="2.4" section="Scripts" extensions="*.pike" mimetype="application/x-pike;text/x-pike" casesensitive="1" author="Paul Pogonyshev" license="">
+ <highlighting>
+ <list name="keywords">
+ <item> break </item>
+ <item> case </item>
+ <item> class </item>
+ <item> continue </item>
+ <item> default </item>
+ <item> do </item>
+ <item> else </item>
+ <item> for </item>
+ <item> foreach </item>
+ <item> if </item>
+ <item> return </item>
+ <item> switch </item>
+ <item> while </item>
+ </list>
+ <list name="types">
+ <item> array </item>
+ <item> float </item>
+ <item> function </item>
+ <item> int </item>
+ <item> mapping </item>
+ <item> mixed </item>
+ <item> multiset> </item>
+ <item> object </item>
+ <item> program </item>
+ <item> static </item>
+ <item> string </item>
+ <item> void </item>
+ </list>
+ <list name="builtins">
+ <item> catch </item>
+ <item> gauge </item>
+ <item> sscanf </item>
+ <item> typeof </item>
+ </list>
+ <contexts>
+ <context attribute="Normal Text" lineEndContext="#stay" name="Normal">
+ <keyword attribute="Keyword" context="#stay" String="keywords"/>
+ <keyword attribute="Data Type" context="#stay" String="types"/>
+ <keyword attribute="Builtin Function" context="#stay" String="builtins"/>
+ <RegExpr attribute="Builtin Function" context="#stay" String="`([\+\-\*/%~&amp;\|^]|[!=&lt;&gt;]=|&lt;&lt;?|&gt;&gt;?|(\[\]|->)=?)"/>
+ <Float attribute="Float" context="#stay"/>
+ <RegExpr attribute="Binary" context="#stay" String="0[bB][01]+"/>
+ <HlCOct attribute="Octal" context="#stay"/>
+ <HlCHex attribute="Hex" context="#stay"/>
+ <Int attribute="Decimal" context="#stay"/>
+ <HlCChar attribute="Char" context="#stay"/>
+ <DetectChar attribute="Normal Text" context="#stay" char="{" beginRegion="Brace"/>
+ <DetectChar attribute="Normal Text" context="#stay" char="}" endRegion="Brace"/>
+ <DetectChar attribute="String" context="String" char="&quot;"/>
+ <Detect2Chars attribute="Comment" context="Line Comment" char="/" char1="/"/>
+ <Detect2Chars attribute="Comment" context="Line Comment" char="#" char1="!"/>
+ <Detect2Chars attribute="Comment" context="Block Comment" char="/" char1="*" beginRegion="Comment"/>
+ <RegExpr attribute="Preprocessor" context="Outscoped" String="#\s*if\s+0" beginRegion="Outscoped" firstNonSpace="true"/>
+ <DetectChar attribute="Preprocessor" context="Preprocessor" char="#" firstNonSpace="true"/>
+ </context>
+ <context attribute="String" lineEndContext="#pop" name="String">
+ <RegExpr attribute="String Char" context="#stay" String="\\d[0-9]+"/>
+ <HlCStringChar attribute="String Char" context="#stay"/>
+ <DetectChar attribute="String" context="#pop" char="&quot;"/>
+ <LineContinue attribute="String" context="#stay"/>
+ </context>
+ <context attribute="Comment" lineEndContext="#pop" name="Line Comment">
+ <RegExpr attribute="Note" context="#stay" String="(FIXME|TODO|NOT(IC)?E):?"/>
+ </context>
+ <context attribute="Comment" lineEndContext="#stay" name="Block Comment">
+ <Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" endRegion="Comment"/>
+ <RegExpr attribute="Note" context="#stay" String="(FIXME|TODO|NOT(IC)?E):?"/>
+ </context>
+ <context attribute="Preprocessor" lineEndContext="#pop" name="Preprocessor">
+ <RangeDetect attribute="Preprocessor Lib" context="#stay" char="&quot;" char1="&quot;"/>
+ <RangeDetect attribute="Preprocessor Lib" context="#stay" char="&lt;" char1="&gt;"/>
+ <Detect2Chars attribute="Comment" context="Line Comment" char="/" char1="/"/>
+ <Detect2Chars attribute="Comment" context="Block Comment" char="/" char1="*"/>
+ <LineContinue attribute="Preprocessor" context="#stay"/>
+ </context>
+ <context attribute="Comment" lineEndContext="#stay" name="Outscoped">
+ <RegExpr attribute="Note" context="#stay" String="(FIXME|TODO|NOT(IC)?E):?"/>
+ <Detect2Chars attribute="Comment" context="Block Comment" char="/" char1="*" beginRegion="Comment"/>
+ <RegExpr attribute="Comment" context="Outscoped intern" String="#\s*if" beginRegion="Outscoped" firstNonSpace="true"/>
+ <RegExpr attribute="Preprocessor" context="#pop" String="#\s*(endif|elif|else)" endRegion="Outscoped" firstNonSpace="true"/>
+ </context>
+ <context attribute="Comment" lineEndContext="#stay" name="Outscoped intern">
+ <Detect2Chars attribute="Comment" context="Block Comment" char="/" char1="*" beginRegion="Comment"/>
+ <RegExpr attribute="Comment" context="Outscoped intern" String="#\s*if" beginRegion="Outscoped" firstNonSpace="true"/>
+ <RegExpr attribute="Comment" context="#pop" String="#\s*endif" endRegion="Outscoped" firstNonSpace="true"/>
+ </context>
+ </contexts>
+ <itemDatas>
+ <itemData name="Normal Text" defStyleNum="dsNormal"/>
+ <itemData name="Keyword" defStyleNum="dsKeyword"/>
+ <itemData name="Builtin Function" defStyleNum="dsFunction"/>
+ <itemData name="Data Type" defStyleNum="dsDataType"/>
+ <itemData name="Decimal" defStyleNum="dsDecVal"/>
+ <itemData name="Hex" defStyleNum="dsBaseN"/>
+ <itemData name="Octal" defStyleNum="dsBaseN"/>
+ <itemData name="Binary" defStyleNum="dsBaseN"/>
+ <itemData name="Float" defStyleNum="dsFloat"/>
+ <itemData name="Char" defStyleNum="dsChar"/>
+ <itemData name="String" defStyleNum="dsString"/>
+ <itemData name="String Char" defStyleNum="dsChar"/>
+ <itemData name="Comment" defStyleNum="dsComment"/>
+ <itemData name="Note" defStyleNum="dsAlert"/>
+ <itemData name="Preprocessor" defStyleNum="dsOthers"/>
+ <itemData name="Preprocessor Lib" defStyleNum="dsString"/>
+ </itemDatas>
+ </highlighting>
+ <general>
+ <comments>
+ <comment name="singleLine" start="#!"/>
+ <comment name="singleLine" start="//"/>
+ <comment name="multiLine" start="/*" end="*/"/>
+ </comments>
+ <keywords casesensitive="1"/>
+ </general>
+</language>
diff --git a/kate/data/postscript.xml b/kate/data/postscript.xml
new file mode 100644
index 000000000..b590db232
--- /dev/null
+++ b/kate/data/postscript.xml
@@ -0,0 +1,434 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+<language name="PostScript" version="1.01" kateversion="2.1" section="Markup" extensions="*.ps;*.ai;*.eps" mimetype="application/postscript">
+<highlighting>
+ <list name="keywords">
+ <item> abs </item>
+ <item> add </item>
+ <item> aload </item>
+ <item> anchorsearch </item>
+ <item> and </item>
+ <item> arc </item>
+ <item> arcn </item>
+ <item> arct </item>
+ <item> arcto </item>
+ <item> array </item>
+ <item> ashow </item>
+ <item> astore </item>
+ <item> awidthshow </item>
+ <item> begin </item>
+ <item> bind </item>
+ <item> bitshift </item>
+ <item> ceiling </item>
+ <item> charpath </item>
+ <item> clear </item>
+ <item> cleartomark </item>
+ <item> clip </item>
+ <item> clippath </item>
+ <item> closepath </item>
+ <item> concat </item>
+ <item> concatmatrix </item>
+ <item> copy </item>
+ <item> count </item>
+ <item> counttomark </item>
+ <item> currentcmykcolor </item>
+ <item> currentdash </item>
+ <item> currentdict </item>
+ <item> currentfile </item>
+ <item> currentfont </item>
+ <item> currentgray </item>
+ <item> currentgstate </item>
+ <item> currenthsbcolor </item>
+ <item> currentlinecap </item>
+ <item> currentlinejoin </item>
+ <item> currentlinewidth </item>
+ <item> currentmatrix </item>
+ <item> currentpoint </item>
+ <item> currentrgbcolor </item>
+ <item> currentshared </item>
+ <item> curveto </item>
+ <item> cvi </item>
+ <item> cvlit </item>
+ <item> cvn </item>
+ <item> cvr </item>
+ <item> cvrs </item>
+ <item> cvs </item>
+ <item> cvx </item>
+ <item> def </item>
+ <item> defineusername </item>
+ <item> dict </item>
+ <item> div </item>
+ <item> dtransform </item>
+ <item> dup </item>
+ <item> end </item>
+ <item> eoclip </item>
+ <item> eofill </item>
+ <item> eoviewclip </item>
+ <item> eq </item>
+ <item> exch </item>
+ <item> exec </item>
+ <item> exit </item>
+ <item> file </item>
+ <item> fill </item>
+ <item> findfont </item>
+ <item> flattenpath </item>
+ <item> floor </item>
+ <item> flush </item>
+ <item> flushfile </item>
+ <item> for </item>
+ <item> forall </item>
+ <item> ge </item>
+ <item> get </item>
+ <item> getinterval </item>
+ <item> grestore </item>
+ <item> gsave </item>
+ <item> gstate </item>
+ <item> gt </item>
+ <item> identmatrix </item>
+ <item> idiv </item>
+ <item> idtransform </item>
+ <item> if </item>
+ <item> ifelse </item>
+ <item> image </item>
+ <item> imagemask </item>
+ <item> index </item>
+ <item> ineofill </item>
+ <item> infill </item>
+ <item> initviewclip </item>
+ <item> inueofill </item>
+ <item> inufill </item>
+ <item> invertmatrix </item>
+ <item> itransform </item>
+ <item> known </item>
+ <item> le </item>
+ <item> length </item>
+ <item> lineto </item>
+ <item> load </item>
+ <item> loop </item>
+ <item> lt </item>
+ <item> makefont </item>
+ <item> matrix </item>
+ <item> maxlength </item>
+ <item> mod </item>
+ <item> moveto </item>
+ <item> mul </item>
+ <item> ne </item>
+ <item> neg </item>
+ <item> newpath </item>
+ <item> not </item>
+ <item> null </item>
+ <item> or </item>
+ <item> pathbbox </item>
+ <item> pathforall </item>
+ <item> pop </item>
+ <item> print </item>
+ <item> printobject </item>
+ <item> put </item>
+ <item> putinterval </item>
+ <item> rcurveto </item>
+ <item> read </item>
+ <item> readhexstring </item>
+ <item> readline </item>
+ <item> readstring </item>
+ <item> rectclip </item>
+ <item> rectfill </item>
+ <item> rectstroke </item>
+ <item> rectviewclip </item>
+ <item> repeat </item>
+ <item> restore </item>
+ <item> rlineto </item>
+ <item> rmoveto </item>
+ <item> roll </item>
+ <item> rotate </item>
+ <item> round </item>
+ <item> save </item>
+ <item> scale </item>
+ <item> scalefont </item>
+ <item> search </item>
+ <item> selectfont </item>
+ <item> setbbox </item>
+ <item> setcachedevice </item>
+ <item> setcachedevice2 </item>
+ <item> setcharwidth </item>
+ <item> setcmykcolor </item>
+ <item> setdash </item>
+ <item> setfont </item>
+ <item> setgray </item>
+ <item> setgstate </item>
+ <item> sethsbcolor </item>
+ <item> setlinecap </item>
+ <item> setlinejoin </item>
+ <item> setlinewidth </item>
+ <item> setmatrix </item>
+ <item> setrgbcolor </item>
+ <item> setshared </item>
+ <item> shareddict </item>
+ <item> show </item>
+ <item> showpage </item>
+ <item> stop </item>
+ <item> stopped </item>
+ <item> store </item>
+ <item> string </item>
+ <item> stringwidth </item>
+ <item> stroke </item>
+ <item> strokepath </item>
+ <item> sub </item>
+ <item> systemdict </item>
+ <item> token </item>
+ <item> transform </item>
+ <item> translate </item>
+ <item> truncate </item>
+ <item> type </item>
+ <item> uappend </item>
+ <item> ucache </item>
+ <item> ueofill </item>
+ <item> ufill </item>
+ <item> undef </item>
+ <item> upath </item>
+ <item> userdict </item>
+ <item> ustroke </item>
+ <item> viewclip </item>
+ <item> viewclippath </item>
+ <item> where </item>
+ <item> widthshow </item>
+ <item> write </item>
+ <item> writehexstring </item>
+ <item> writeobject </item>
+ <item> writestring </item>
+ <item> wtranslation </item>
+ <item> xor </item>
+ <item> xshow </item>
+ <item> xyshow </item>
+ <item> yshow </item>
+ <item> FontDirectory </item>
+ <item> SharedFontDirectory </item>
+ <item> Courier </item>
+ <item> Courier-Bold </item>
+ <item> Courier-BoldOblique </item>
+ <item> Courier-Oblique </item>
+ <item> Helvetica </item>
+ <item> Helvetica-Bold </item>
+ <item> Helvetica-BoldOblique </item>
+ <item> Helvetica-Oblique </item>
+ <item> Symbol </item>
+ <item> Times-Bold </item>
+ <item> Times-BoldItalic </item>
+ <item> Times-Italic </item>
+ <item> Times-Roman </item>
+ <item> execuserobject </item>
+ <item> currentcolor </item>
+ <item> currentcolorspace </item>
+ <item> currentglobal </item>
+ <item> execform </item>
+ <item> filter </item>
+ <item> findresource </item>
+ <item> globaldict </item>
+ <item> makepattern </item>
+ <item> setcolor </item>
+ <item> setcolorspace </item>
+ <item> setglobal </item>
+ <item> setpagedevice </item>
+ <item> setpattern </item>
+ <item> ISOLatin1Encoding </item>
+ <item> StandardEncoding </item>
+ <item> atan </item>
+ <item> banddevice </item>
+ <item> bytesavailable </item>
+ <item> cachestatus </item>
+ <item> closefile </item>
+ <item> colorimage </item>
+ <item> condition </item>
+ <item> copypage </item>
+ <item> cos </item>
+ <item> countdictstack </item>
+ <item> countexecstack </item>
+ <item> cshow </item>
+ <item> currentblackgeneration </item>
+ <item> currentcacheparams </item>
+ <item> currentcolorscreen </item>
+ <item> currentcolortransfer </item>
+ <item> currentcontext </item>
+ <item> currentflat </item>
+ <item> currenthalftone </item>
+ <item> currenthalftonephase </item>
+ <item> currentmiterlimit </item>
+ <item> currentobjectformat </item>
+ <item> currentpacking </item>
+ <item> currentscreen </item>
+ <item> currentstrokeadjust </item>
+ <item> currenttransfer </item>
+ <item> currentundercolorremoval </item>
+ <item> defaultmatrix </item>
+ <item> definefont </item>
+ <item> deletefile </item>
+ <item> detach </item>
+ <item> deviceinfo </item>
+ <item> dictstack </item>
+ <item> echo </item>
+ <item> erasepage </item>
+ <item> errordict </item>
+ <item> execstack </item>
+ <item> executeonly </item>
+ <item> exp </item>
+ <item> false </item>
+ <item> filenameforall </item>
+ <item> fileposition </item>
+ <item> fork </item>
+ <item> framedevice </item>
+ <item> grestoreall </item>
+ <item> handleerror </item>
+ <item> initclip </item>
+ <item> initgraphics </item>
+ <item> initmatrix </item>
+ <item> instroke </item>
+ <item> inustroke </item>
+ <item> join </item>
+ <item> kshow </item>
+ <item> ln </item>
+ <item> lock </item>
+ <item> log </item>
+ <item> mark </item>
+ <item> monitor </item>
+ <item> noaccess </item>
+ <item> notify </item>
+ <item> nulldevice </item>
+ <item> packedarray </item>
+ <item> quit </item>
+ <item> rand </item>
+ <item> rcheck </item>
+ <item> readonly </item>
+ <item> realtime </item>
+ <item> renamefile </item>
+ <item> renderbands </item>
+ <item> resetfile </item>
+ <item> reversepath </item>
+ <item> rootfont </item>
+ <item> rrand </item>
+ <item> run </item>
+ <item> scheck </item>
+ <item> setblackgeneration </item>
+ <item> setcachelimit </item>
+ <item> setcacheparams </item>
+ <item> setcolorscreen </item>
+ <item> setcolortransfer </item>
+ <item> setfileposition </item>
+ <item> setflat </item>
+ <item> sethalftone </item>
+ <item> sethalftonephase </item>
+ <item> setmiterlimit </item>
+ <item> setobjectformat </item>
+ <item> setpacking </item>
+ <item> setscreen </item>
+ <item> setstrokeadjust </item>
+ <item> settransfer </item>
+ <item> setucacheparams </item>
+ <item> setundercolorremoval </item>
+ <item> sin </item>
+ <item> sqrt </item>
+ <item> srand </item>
+ <item> stack </item>
+ <item> status </item>
+ <item> statusdict </item>
+ <item> true </item>
+ <item> ucachestatus </item>
+ <item> undefinefont </item>
+ <item> usertime </item>
+ <item> ustrokepath </item>
+ <item> version </item>
+ <item> vmreclaim </item>
+ <item> vmstatus </item>
+ <item> wait </item>
+ <item> wcheck </item>
+ <item> xcheck </item>
+ <item> yield </item>
+ <item> defineuserobject </item>
+ <item> undefineuserobject </item>
+ <item> UserObjects </item>
+ <item> cleardictstack </item>
+ <item> setvmthreshold </item>
+ <item> currentcolorrendering </item>
+ <item> currentdevparams </item>
+ <item> currentoverprint </item>
+ <item> currentpagedevice </item>
+ <item> currentsystemparams </item>
+ <item> currentuserparams </item>
+ <item> defineresource </item>
+ <item> findencoding </item>
+ <item> gcheck </item>
+ <item> glyphshow </item>
+ <item> languagelevel </item>
+ <item> product </item>
+ <item> pstack </item>
+ <item> resourceforall </item>
+ <item> resourcestatus </item>
+ <item> revision </item>
+ <item> serialnumber </item>
+ <item> setcolorrendering </item>
+ <item> setdevparams </item>
+ <item> setoverprint </item>
+ <item> setsystemparams </item>
+ <item> setuserparams </item>
+ <item> startjob </item>
+ <item> undefineresource </item>
+ <item> GlobalFontDirectory </item>
+ <item> ASCII85Decode </item>
+ <item> ASCII85Encode </item>
+ <item> ASCIIHexDecode </item>
+ <item> ASCIIHexEncode </item>
+ <item> CCITTFaxDecode </item>
+ <item> CCITTFaxEncode </item>
+ <item> DCTDecode </item>
+ <item> DCTEncode </item>
+ <item> LZWDecode </item>
+ <item> LZWEncode </item>
+ <item> NullEncode </item>
+ <item> RunLengthDecode </item>
+ <item> RunLengthEncode </item>
+ <item> SubFileDecode </item>
+ <item> CIEBasedA </item>
+ <item> CIEBasedABC </item>
+ <item> DeviceCMYK </item>
+ <item> DeviceGray </item>
+ <item> DeviceRGB </item>
+ <item> Indexed </item>
+ <item> Pattern </item>
+ <item> Separation </item>
+ <item> CIEBasedDEF </item>
+ <item> CIEBasedDEFG </item>
+ <item> DeviceN </item>
+ </list>
+
+ <contexts>
+ <context name="Normal" attribute="Normal Text" lineEndContext="#stay">
+ <keyword attribute="Keyword" context="#stay" String="keywords"/>
+ <Detect2Chars attribute="Header" context="Header" char="%" char1="!"/>
+ <DetectChar attribute="Comment" context="Comment" char="%"/>
+ <Float attribute="Float" context="#stay"/>
+ <Int attribute="Decimal" context="#stay"/>
+ <DetectChar attribute="String" context="String" char="("/>
+ <RegExpr attribute="Data Type" context="#stay" String="\/{1,2}[^\s\(\)\{\}\[\]%/]*"/>
+ </context>
+ <context attribute="Comment" lineEndContext="#pop" name="Comment"/>
+ <context attribute="Header" lineEndContext="#pop" name="Header"/>
+ <context attribute="String" lineEndContext="#stay" name="String">
+ <DetectChar attribute="String" context="#pop" char=")" />
+ </context>
+ </contexts>
+ <itemDatas>
+ <itemData name="Normal Text" defStyleNum="dsNormal"/>
+ <itemData name="Keyword" defStyleNum="dsKeyword"/>
+ <itemData name="Comment" defStyleNum="dsComment"/>
+ <itemData name="Header" defStyleNum="dsOthers"/>
+ <itemData name="Float" defStyleNum="dsFloat"/>
+ <itemData name="Decimal" defStyleNum="dsDecVal"/>
+ <itemData name="String" defStyleNum="dsString"/>
+ <itemData name="Data Type" defStyleNum="dsDataType"/>
+ </itemDatas>
+</highlighting>
+<general>
+ <comments>
+ <comment name="singleLine" start="%" />
+ </comments>
+ <keywords casesensitive="0" />
+</general>
+</language>
diff --git a/kate/data/povray.xml b/kate/data/povray.xml
new file mode 100644
index 000000000..b1c3ab711
--- /dev/null
+++ b/kate/data/povray.xml
@@ -0,0 +1,883 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+<!-- Extended and updated by -->
+<!-- Christoph Hormann <chris_hormann@gmx.de>, March 2004 -->
+<!-- features full POV-Ray 3.6 syntax with special highlighting -->
+<!-- of variable and macro declarations -->
+<language name="POV-Ray" version="1.04" kateversion="2.4" section="Other" extensions="*.inc;*.pov" mimetype="text/x-povray-script;text/x-povray-include" priority="2">
+ <highlighting>
+ <list name="keywords">
+ <item> aa_threshold </item>
+ <item> aa_level </item>
+ <item> absorption </item>
+ <item> abs </item>
+ <item> accuracy </item>
+ <item> acosh </item>
+ <item> acos </item>
+ <item> adaptive </item>
+ <item> adc_bailout </item>
+ <item> agate </item>
+ <item> agate_turb </item>
+ <item> all_intersections </item>
+ <item> all </item>
+ <item> alpha </item>
+ <item> always_sample </item>
+ <item> altitude </item>
+ <item> ambient_light </item>
+ <item> ambient </item>
+ <item> angle </item>
+ <item> aperture </item>
+ <item> append </item>
+ <item> arc_angle </item>
+ <item> area_light </item>
+ <item> array </item>
+ <item> ascii </item>
+ <item> asc </item>
+ <item> asinh </item>
+ <item> asin </item>
+ <item> assumed_gamma </item>
+ <item> atan2 </item>
+ <item> atanh </item>
+ <item> atan </item>
+ <item> average </item>
+ <item> background </item>
+ <item> bezier_spline </item>
+ <item> bicubic_patch </item>
+ <item> black_hole </item>
+ <item> blob </item>
+ <item> blue </item>
+ <item> blur_samples </item>
+ <item> bounded_by </item>
+ <item> boxed </item>
+ <item> box </item>
+ <item> bozo </item>
+ <item> brick_size </item>
+ <item> brick </item>
+ <item> brightness </item>
+ <item> brilliance </item>
+ <item> bumps </item>
+ <item> bump_map </item>
+ <item> bump_size </item>
+ <item> b_spline </item>
+ <item> camera </item>
+ <item> caustics </item>
+ <item> ceil </item>
+ <item> cells </item>
+ <item> charset </item>
+ <item> checker </item>
+ <item> chr </item>
+ <item> circular </item>
+ <item> clipped_by </item>
+ <item> clock_delta </item>
+ <item> clock_on </item>
+ <item> clock </item>
+ <item> color_map </item>
+ <item> colour_map </item>
+ <item> color </item>
+ <item> colour </item>
+ <item> component </item>
+ <item> composite </item>
+ <item> concat </item>
+ <item> cone </item>
+ <item> confidence </item>
+ <item> conic_sweep </item>
+ <item> contained_by </item>
+ <item> control0 </item>
+ <item> control1 </item>
+ <item> coords </item>
+ <item> cosh </item>
+ <item> cos </item>
+ <item> count </item>
+ <item> crackle </item>
+ <item> crand </item>
+ <item> cube </item>
+ <item> cubic_spline </item>
+ <item> cubic </item>
+ <item> cubic_wave </item>
+ <item> cylinder </item>
+ <item> cylindrical </item>
+ <item> defined </item>
+ <item> degrees </item>
+ <item> density_file </item>
+ <item> density_map </item>
+ <item> density </item>
+ <item> dents </item>
+ <item> df3 </item>
+ <item> difference </item>
+ <item> diffuse </item>
+ <item> dimensions </item>
+ <item> dimension_size </item>
+ <item> direction </item>
+ <item> disc </item>
+ <item> dispersion </item>
+ <item> dispersion_samples </item>
+ <item> distance_maximum </item>
+ <item> distance </item>
+ <item> dist_exp </item>
+ <item> div </item>
+ <item> double_illuminate </item>
+ <item> eccentricity </item>
+ <item> emission </item>
+ <item> error_bound </item>
+ <item> evaluate </item>
+ <item> exp </item>
+ <item> exponent </item>
+ <item> exterior </item>
+ <item> extinction </item>
+ <item> facets </item>
+ <item> face_indices </item>
+ <item> fade_colour </item>
+ <item> fade_color </item>
+ <item> fade_distance </item>
+ <item> fade_power </item>
+ <item> falloff_angle </item>
+ <item> falloff </item>
+ <item> false </item>
+ <item> file_exists </item>
+ <item> shadowless </item>
+ <item> filter </item>
+ <item> final_clock </item>
+ <item> final_frame </item>
+ <item> finish </item>
+ <item> fisheye </item>
+ <item> flatness </item>
+ <item> flip </item>
+ <item> floor </item>
+ <item> focal_point </item>
+ <item> fog_alt </item>
+ <item> fog_offset </item>
+ <item> fog </item>
+ <item> fog_type </item>
+ <item> form </item>
+ <item> frame_number </item>
+ <item> frequency </item>
+ <item> fresnel </item>
+ <item> function </item>
+ <item> gif </item>
+ <item> global_settings </item>
+ <item> gradient </item>
+ <item> granite </item>
+ <item> gray </item>
+ <item> gray_threshold </item>
+ <item> green </item>
+ <item> height_field </item>
+ <item> hexagon </item>
+ <item> hf_gray_16 </item>
+ <item> hierarchy </item>
+ <item> hollow </item>
+ <item> hypercomplex </item>
+ <item> image_width </item>
+ <item> image_height </item>
+ <item> initial_clock </item>
+ <item> initial_frame </item>
+ <item> interior_texture </item>
+ <item> iff </item>
+ <item> image_map </item>
+ <item> image_pattern </item>
+ <item> inside </item>
+ <item> inside_vector </item>
+ <item> interior </item>
+ <item> interpolate </item>
+ <item> intersection </item>
+ <item> intervals </item>
+ <item> int </item>
+ <item> inverse </item>
+ <item> ior </item>
+ <item> irid </item>
+ <item> irid_wavelength </item>
+ <item> isosurface </item>
+ <item> jitter </item>
+ <item> julia </item>
+ <item> julia_fractal </item>
+ <item> jpeg </item>
+ <item> lambda </item>
+ <item> lathe </item>
+ <item> leopard </item>
+ <item> light_group </item>
+ <item> light_source </item>
+ <item> linear_spline </item>
+ <item> linear_sweep </item>
+ <item> ln </item>
+ <item> load_file </item>
+ <item> location </item>
+ <item> log </item>
+ <item> looks_like </item>
+ <item> look_at </item>
+ <item> low_error_factor </item>
+ <item> magnet </item>
+ <item> major_radius </item>
+ <item> mandel </item>
+ <item> map_type </item>
+ <item> marble </item>
+ <item> material_map </item>
+ <item> material </item>
+ <item> matrix </item>
+ <item> max_extent </item>
+ <item> max_gradient </item>
+ <item> max_intersections </item>
+ <item> max_iteration </item>
+ <item> max_sample </item>
+ <item> max </item>
+ <item> max_trace_level </item>
+ <item> max_trace </item>
+ <item> media_attenuation </item>
+ <item> media_interaction </item>
+ <item> media </item>
+ <item> merge </item>
+ <item> mesh2 </item>
+ <item> mesh </item>
+ <item> metallic </item>
+ <item> method </item>
+ <item> metric </item>
+ <item> minimum_reuse </item>
+ <item> min_extent </item>
+ <item> min </item>
+ <item> mod </item>
+ <item> mortar </item>
+ <item> natural_spline </item>
+ <item> nearest_count </item>
+ <item> normal </item>
+ <item> normal_indices </item>
+ <item> normal_map </item>
+ <item> normal_vectors </item>
+ <item> no_image </item>
+ <item> no_reflection </item>
+ <item> no_shadow </item>
+ <item> no </item>
+ <item> number_of_waves </item>
+ <item> object </item>
+ <item> octaves </item>
+ <item> offset </item>
+ <item> off </item>
+ <item> omega </item>
+ <item> omnimax </item>
+ <item> once </item>
+ <item> onion </item>
+ <item> on </item>
+ <item> open </item>
+ <item> orientation </item>
+ <item> orient </item>
+ <item> orthographic </item>
+ <item> panoramic </item>
+ <item> parallel </item>
+ <item> parametric </item>
+ <item> pattern </item>
+ <item> perspective </item>
+ <item> pgm </item>
+ <item> phase </item>
+ <item> phong_size </item>
+ <item> phong </item>
+ <item> pigment_map </item>
+ <item> pigment </item>
+ <item> pi </item>
+ <item> planar </item>
+ <item> plane </item>
+ <item> png </item>
+ <item> point_at </item>
+ <item> polygon </item>
+ <item> poly </item>
+ <item> poly_wave </item>
+ <item> pot </item>
+ <item> pow </item>
+ <item> ppm </item>
+ <item> precision </item>
+ <item> precompute </item>
+ <item> pretrace_start </item>
+ <item> pretrace_end </item>
+ <item> prism </item>
+ <item> prod </item>
+ <item> projected_through </item>
+ <item> pwr </item>
+ <item> quadratic_spline </item>
+ <item> quadric </item>
+ <item> quartic </item>
+ <item> quaternion </item>
+ <item> quick_color </item>
+ <item> quick_colour </item>
+ <item> quilted </item>
+ <item> radial </item>
+ <item> radians </item>
+ <item> radiosity </item>
+ <item> radius </item>
+ <item> rainbow </item>
+ <item> ramp_wave </item>
+ <item> rand </item>
+ <item> range </item>
+ <item> ratio </item>
+ <item> reciprocal </item>
+ <item> recursion_limit </item>
+ <item> red </item>
+ <item> reflection_exponent </item>
+ <item> reflection </item>
+ <item> refraction </item>
+ <item> repeat </item>
+ <item> rgbft </item>
+ <item> rgbf </item>
+ <item> rgbt </item>
+ <item> rgb </item>
+ <item> right </item>
+ <item> ripples </item>
+ <item> rotate </item>
+ <item> roughness </item>
+ <item> samples </item>
+ <item> save_file </item>
+ <item> scale </item>
+ <item> scallop_wave </item>
+ <item> scattering </item>
+ <item> seed </item>
+ <item> select </item>
+ <item> sine_wave </item>
+ <item> sinh </item>
+ <item> sin </item>
+ <item> size </item>
+ <item> sky_sphere </item>
+ <item> sky </item>
+ <item> slice </item>
+ <item> slope_map </item>
+ <item> slope </item>
+ <item> smooth </item>
+ <item> smooth_triangle </item>
+ <item> solid </item>
+ <item> sor </item>
+ <item> specular </item>
+ <item> sphere_sweep </item>
+ <item> sphere </item>
+ <item> spherical </item>
+ <item> spiral1 </item>
+ <item> spiral2 </item>
+ <item> spline </item>
+ <item> spotlight </item>
+ <item> spotted </item>
+ <item> sqrt </item>
+ <item> sqr </item>
+ <item> statistics </item>
+ <item> strcmp </item>
+ <item> strength </item>
+ <item> strlen </item>
+ <item> strlwr </item>
+ <item> strupr </item>
+ <item> str </item>
+ <item> sturm </item>
+ <item> substr </item>
+ <item> sum </item>
+ <item> superellipsoid </item>
+ <item> sys </item>
+ <item> tanh </item>
+ <item> tan </item>
+ <item> texture_list </item>
+ <item> texture_map </item>
+ <item> texture </item>
+ <item> text </item>
+ <item> tga </item>
+ <item> thickness </item>
+ <item> threshold </item>
+ <item> tiff </item>
+ <item> tightness </item>
+ <item> tile2 </item>
+ <item> tiles </item>
+ <item> normal </item>
+ <item> tolerance </item>
+ <item> toroidal </item>
+ <item> torus </item>
+ <item> trace </item>
+ <item> transform </item>
+ <item> translate </item>
+ <item> transmit </item>
+ <item> triangle </item>
+ <item> triangle_wave </item>
+ <item> true </item>
+ <item> ttf </item>
+ <item> turbulence </item>
+ <item> turb_depth </item>
+ <item> type </item>
+ <item> t </item>
+ <item> ultra_wide_angle </item>
+ <item> union </item>
+ <item> up </item>
+ <item> use_alpha </item>
+ <item> use_color </item>
+ <item> use_colour </item>
+ <item> use_index </item>
+ <item> utf8 </item>
+ <item> uv_indices </item>
+ <item> uv_mapping </item>
+ <item> uv_vectors </item>
+ <item> u_steps </item>
+ <item> u </item>
+ <item> val </item>
+ <item> variance </item>
+ <item> vaxis_rotate </item>
+ <item> vcross </item>
+ <item> vdot </item>
+ <item> vertex_vectors </item>
+ <item> vlength </item>
+ <item> vnormalize </item>
+ <item> vrotate </item>
+ <item> vstr </item>
+ <item> vturbulence </item>
+ <item> v_steps </item>
+ <item> v </item>
+ <item> warning </item>
+ <item> warp </item>
+ <item> water_level </item>
+ <item> waves </item>
+ <item> while </item>
+ <item> width </item>
+ <item> wood </item>
+ <item> wrinkles </item>
+ <item> write </item>
+ <item> x </item>
+ <item> yes </item>
+ <item> y </item>
+ <item> z </item>
+ <item> photons </item>
+ <item> steps </item>
+ <item> pass_through </item>
+ <item> collect </item>
+ <item> autostop </item>
+ <item> gather </item>
+ <item> split_union </item>
+ <item> expand_thresholds </item>
+ <item> spacing </item>
+ <item> global </item>
+ <item> target </item>
+ <item> conserve_energy </item>
+ <item> cutaway_textures </item>
+ <item> pigment_pattern </item>
+ <item> no_bump_scale </item>
+ <item> global_lights </item>
+ <item> internal </item>
+ <item> noise_generator </item>
+ </list>
+
+ <list name="objects">
+ <item> bicubic_patch </item>
+ <item> blob </item>
+ <item> box </item>
+ <item> cone </item>
+ <item> cubic </item>
+ <item> cylinder </item>
+ <item> difference </item>
+ <item> disc </item>
+ <item> height_field </item>
+ <item> intersection </item>
+ <item> isosurface </item>
+ <item> julia_fractal </item>
+ <item> lathe </item>
+ <item> light_source </item>
+ <item> merge </item>
+ <item> mesh </item>
+ <item> mesh2 </item>
+ <item> object </item>
+ <item> parametric </item>
+ <item> plane </item>
+ <item> poly </item>
+ <item> polygon </item>
+ <item> prism </item>
+ <item> quadric </item>
+ <item> quartic </item>
+ <item> smooth_triangle </item>
+ <item> sor </item>
+ <item> sphere </item>
+ <item> sphere_sweep </item>
+ <item> superellipsoid </item>
+ <item> text </item>
+ <item> torus </item>
+ <item> triangle </item>
+ <item> union </item>
+ </list>
+
+ <list name="texturing">
+ <item> aa_threshold </item>
+ <item> aa_level </item>
+ <item> absorption </item>
+ <item> agate </item>
+ <item> agate_turb </item>
+ <item> ambient </item>
+ <item> average </item>
+ <item> black_hole </item>
+ <item> blue </item>
+ <item> boxed </item>
+ <item> brick_size </item>
+ <item> brick </item>
+ <item> brilliance </item>
+ <item> bumps </item>
+ <item> bump_map </item>
+ <item> bump_size </item>
+ <item> caustics </item>
+ <item> cells </item>
+ <item> checker </item>
+ <item> color_map </item>
+ <item> colour_map </item>
+ <item> color </item>
+ <item> colour </item>
+ <item> conserve_energy </item>
+ <item> control0 </item>
+ <item> control1 </item>
+ <item> crackle </item>
+ <item> crand </item>
+ <item> cubic_wave </item>
+ <item> cylindrical </item>
+ <item> density_file </item>
+ <item> density_map </item>
+ <item> density </item>
+ <item> dents </item>
+ <item> diffuse </item>
+ <item> dist_exp </item>
+ <item> double_illuminate </item>
+ <item> eccentricity </item>
+ <item> emission </item>
+ <item> exponent </item>
+ <item> exterior </item>
+ <item> extinction </item>
+ <item> facets </item>
+ <item> fade_colour </item>
+ <item> fade_color </item>
+ <item> fade_distance </item>
+ <item> fade_power </item>
+ <item> filter </item>
+ <item> finish </item>
+ <item> form </item>
+ <item> frequency </item>
+ <item> fresnel </item>
+ <item> gradient </item>
+ <item> granite </item>
+ <item> gray </item>
+ <item> green </item>
+ <item> hexagon </item>
+ <item> hypercomplex </item>
+ <item> interior_texture </item>
+ <item> image_map </item>
+ <item> image_pattern </item>
+ <item> interior </item>
+ <item> interpolate </item>
+ <item> intervals </item>
+ <item> ior </item>
+ <item> irid </item>
+ <item> irid_wavelength </item>
+ <item> julia </item>
+ <item> lambda </item>
+ <item> leopard </item>
+ <item> magnet </item>
+ <item> mandel </item>
+ <item> map_type </item>
+ <item> marble </item>
+ <item> material_map </item>
+ <item> material </item>
+ <item> media </item>
+ <item> metallic </item>
+ <item> method </item>
+ <item> metric </item>
+ <item> mortar </item>
+ <item> normal </item>
+ <item> normal_map </item>
+ <item> number_of_waves </item>
+ <item> octaves </item>
+ <item> omega </item>
+ <item> once </item>
+ <item> onion </item>
+ <item> orientation </item>
+ <item> phase </item>
+ <item> phong_size </item>
+ <item> phong </item>
+ <item> pigment_map </item>
+ <item> pigment </item>
+ <item> planar </item>
+ <item> quaternion </item>
+ <item> quick_color </item>
+ <item> quick_colour </item>
+ <item> quilted </item>
+ <item> radial </item>
+ <item> ramp_wave </item>
+ <item> red </item>
+ <item> reflection_exponent </item>
+ <item> reflection </item>
+ <item> repeat </item>
+ <item> rgbft </item>
+ <item> rgbf </item>
+ <item> rgbt </item>
+ <item> rgb </item>
+ <item> ripples </item>
+ <item> roughness </item>
+ <item> samples </item>
+ <item> scallop_wave </item>
+ <item> scattering </item>
+ <item> sine_wave </item>
+ <item> slope_map </item>
+ <item> slope </item>
+ <item> solid </item>
+ <item> specular </item>
+ <item> spherical </item>
+ <item> spiral1 </item>
+ <item> spiral2 </item>
+ <item> spotted </item>
+ <item> texture_list </item>
+ <item> texture_map </item>
+ <item> texture </item>
+ <item> tile2 </item>
+ <item> tiles </item>
+ <item> normal </item>
+ <item> toroidal </item>
+ <item> transmit </item>
+ <item> triangle_wave </item>
+ <item> turbulence </item>
+ <item> turb_depth </item>
+ <item> use_alpha </item>
+ <item> use_color </item>
+ <item> use_colour </item>
+ <item> use_index </item>
+ <item> uv_mapping </item>
+ <item> warp </item>
+ <item> waves </item>
+ <item> wood </item>
+ <item> wrinkles </item>
+ <item> cutaway_textures </item>
+ <item> pigment_pattern </item>
+ <item> no_bump_scale </item>
+ </list>
+
+ <list name="transforms">
+ <item> matrix </item>
+ <item> rotate </item>
+ <item> scale </item>
+ <item> translate </item>
+ <item> transform </item>
+ </list>
+
+ <list name="filetypes">
+ <item> df3 </item>
+ <item> gif </item>
+ <item> iff </item>
+ <item> jpeg </item>
+ <item> pgm </item>
+ <item> png </item>
+ <item> pot </item>
+ <item> ppm </item>
+ <item> tga </item>
+ <item> tiff </item>
+ <item> ttf </item>
+ </list>
+
+ <list name="identifiers">
+ <item> clock </item>
+ <item> clock_delta </item>
+ <item> clock_on </item>
+ <item> final_clock </item>
+ <item> final_frame </item>
+ <item> frame_number </item>
+ <item> image_height </item>
+ <item> image_width </item>
+ <item> initial_clock </item>
+ <item> initial_frame </item>
+ <item> t </item>
+ <item> u </item>
+ <item> v </item>
+ <item> x </item>
+ <item> y </item>
+ <item> z </item>
+ </list>
+
+ <list name="constants">
+ <item> false </item>
+ <item> no </item>
+ <item> off </item>
+ <item> on </item>
+ <item> pi </item>
+ <item> true </item>
+ <item> yes </item>
+ </list>
+
+ <list name="functions">
+ <item> abs </item>
+ <item> acos </item>
+ <item> acosh </item>
+ <item> asc </item>
+ <item> asin </item>
+ <item> asinh </item>
+ <item> atan </item>
+ <item> atan2 </item>
+ <item> atanh </item>
+ <item> ceil </item>
+ <item> chr </item>
+ <item> concat </item>
+ <item> cos </item>
+ <item> cosh </item>
+ <item> cube </item>
+ <item> defined </item>
+ <item> degress </item>
+ <item> dimension_size </item>
+ <item> dimensions </item>
+ <item> div </item>
+ <item> exp </item>
+ <item> file_exists </item>
+ <item> floor </item>
+ <item> inside </item>
+ <item> int </item>
+ <item> ln </item>
+ <item> log </item>
+ <item> max </item>
+ <item> min </item>
+ <item> mod </item>
+ <item> pow </item>
+ <item> prod </item>
+ <item> pwr </item>
+ <item> radians </item>
+ <item> rand </item>
+ <item> seed </item>
+ <item> select </item>
+ <item> sin </item>
+ <item> sinh </item>
+ <item> sqrt </item>
+ <item> str </item>
+ <item> strcmp </item>
+ <item> strlen </item>
+ <item> strlwr </item>
+ <item> strupr </item>
+ <item> substr </item>
+ <item> sum </item>
+ <item> tan </item>
+ <item> tanh </item>
+ <item> trace </item>
+ <item> val </item>
+ <item> vaxis_rotate </item>
+ <item> vcross </item>
+ <item> vdot </item>
+ <item> vlength </item>
+ <item> vnormalize </item>
+ <item> vrotate </item>
+ <item> vstr </item>
+ <item> vturbulence </item>
+ </list>
+
+ <list name="directives">
+ <item> #debug </item>
+ <item> #default </item>
+ <item> #else </item>
+ <item> #end </item>
+ <item> #error </item>
+ <item> #fclose </item>
+ <item> #fopen </item>
+ <item> #if </item>
+ <item> #ifdef </item>
+ <item> #ifndef </item>
+ <item> #include </item>
+ <item> #range </item>
+ <item> #read </item>
+ <item> #render </item>
+ <item> #statistics </item>
+ <item> #switch </item>
+ <item> #undef </item>
+ <item> #version </item>
+ <item> #warning </item>
+ <item> #while </item>
+ <item> #write </item>
+ </list>
+
+ <list name="attention">
+ <item> FIXME </item>
+ <item> TODO </item>
+ <item> ### </item>
+ </list>
+
+ <contexts>
+ <context attribute="Normal Text" lineEndContext="#stay" name="Normal">
+ <StringDetect attribute="Declaration" context="Declaration" String="#declare" />
+ <StringDetect attribute="Declaration" context="Declaration" String="#local" />
+ <StringDetect attribute="Macro" context="Macro" String="#macro" />
+ <keyword attribute="Objects" context="#stay" String="objects" />
+ <keyword attribute="Texturing" context="#stay" String="texturing" />
+ <keyword attribute="Transforms" context="#stay" String="transforms" />
+ <keyword attribute="Filetype" context="#stay" String="filetypes" />
+ <keyword attribute="Keyword" context="#stay" String="identifiers" />
+ <keyword attribute="Constant" context="#stay" String="constants" />
+ <keyword attribute="Functions" context="#stay" String="functions" />
+ <keyword attribute="Directives" context="#stay" String="directives" />
+ <keyword attribute="Keyword" context="#stay" String="keywords" />
+ <Float attribute="Float" context="#stay"/>
+ <Int attribute="Float" context="#stay"/>
+ <HlCChar attribute="Char" context="#stay"/>
+ <DetectChar attribute="String" context="String" char="&quot;"/>
+ <RegExpr attribute="Region Marker" context="#stay" String="//\s*BEGIN.*$" beginRegion="Region1" firstNonSpace="true"/>
+ <RegExpr attribute="Region Marker" context="#stay" String="//\s*END.*$" endRegion="Region1" firstNonSpace="true"/>
+ <Detect2Chars attribute="Comment" context="Commentar 1" char="/" char1="/"/>
+ <Detect2Chars attribute="Comment" context="Commentar 2" char="/" char1="*" beginRegion="Comment"/>
+ <DetectChar attribute="Symbol" context="#stay" char="{" beginRegion="Brace1" />
+ <DetectChar attribute="Symbol" context="#stay" char="}" endRegion="Brace1" />
+ <AnyChar attribute="Symbol" context="#stay" String=":!%&amp;()+,-/.*&lt;=&gt;?[]{|}~^&#59;"/>
+ </context>
+
+ <context attribute="Declaration" lineEndContext="#pop" name="Declaration">
+ <RegExpr attribute="Declare Keyword" context="Declare_Keyword" String="\w+" />
+ <LineContinue attribute="Declaration" context="#stay"/>
+ <AnyChar attribute="Symbol" context="#pop#pop" String="=[("/>
+ </context>
+
+ <context attribute="Macro" lineEndContext="#pop" name="Macro">
+ <RegExpr attribute="Declare Macro" context="Declare_Macro" String="\w+" />
+ <LineContinue attribute="Macro" context="#stay"/>
+ <DetectChar attribute="Symbol" context="#pop#pop" char="("/>
+ </context>
+
+ <context attribute="Declare Keyword" lineEndContext="#pop" name="Declare_Keyword">
+ <LineContinue attribute="Declare Keyword" context="#stay"/>
+ <AnyChar attribute="Symbol" context="#pop#pop" String="=[("/>
+ </context>
+
+ <context attribute="Declare Macro" lineEndContext="#pop" name="Declare_Macro">
+ <LineContinue attribute="Declare Macro" context="#stay"/>
+ <DetectChar attribute="Symbol" context="#pop#pop" char="("/>
+ </context>
+
+ <context attribute="String" lineEndContext="#pop" name="String">
+ <LineContinue attribute="String" context="#stay"/>
+ <HlCStringChar attribute="String Char" context="#stay"/>
+ <DetectChar attribute="String" context="#pop" char="&quot;"/>
+ </context>
+
+ <context attribute="Comment" lineEndContext="#pop" name="Commentar 1">
+ <keyword attribute="Decimal" context="#stay" String="attention" />
+ </context>
+
+ <context attribute="Comment" lineEndContext="#stay" name="Commentar 2">
+ <keyword attribute="Decimal" context="#stay" String="attention" />
+ <Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" endRegion="Comment"/>
+ </context>
+
+ <context attribute="Comment" lineEndContext="#stay" name="Commentar">
+ <Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" />
+ </context>
+ </contexts>
+
+ <itemDatas>
+ <itemData name="Normal Text" defStyleNum="dsNormal" color="#000000" selColor="#ffffff" bold="0" italic="0"/>
+ <itemData name="Keyword" defStyleNum="dsKeyword" color="#000080" selColor="#ffffff" bold="0" italic="0"/>
+ <itemData name="Objects" defStyleNum="dsKeyword" color="#800000" selColor="#ffffff" bold="0" italic="0"/>
+ <itemData name="Texturing" defStyleNum="dsKeyword" color="#008080" selColor="#ffffff" bold="0" italic="0"/>
+ <itemData name="Transforms" defStyleNum="dsKeyword" color="#000080" selColor="#ffffff" bold="0" italic="0"/>
+ <itemData name="Declaration" defStyleNum="dsKeyword" color="#000080" selColor="#000080" bold="1" italic="0"/>
+ <itemData name="Macro" defStyleNum="dsKeyword" color="#000080" selColor="#000080" bold="1" italic="0"/>
+ <itemData name="Declare Keyword" defStyleNum="dsKeyword" color="#990099" selColor="#990099" bold="1" italic="0"/>
+ <itemData name="Declare Macro" defStyleNum="dsKeyword" color="#CC0000" selColor="#990099" bold="1" italic="0"/>
+ <itemData name="Functions" defStyleNum="dsKeyword" color="#000080" selColor="#ffffff" bold="0" italic="0"/>
+ <itemData name="Directives" defStyleNum="dsOthers" color="#3300ff" selColor="#3300ff" bold="1" italic="0"/>
+ <itemData name="Filetype" defStyleNum="dsDataType" color="#000080" selColor="#ffffff" bold="0" italic="0"/>
+ <itemData name="Constant" defStyleNum="dsFloat" color="#0000ff" selColor="#ffffff" bold="0" italic="0"/>
+ <itemData name="Float" defStyleNum="dsFloat" color="#0000ff" selColor="#ffffff" bold="0" italic="0"/>
+ <itemData name="Char" defStyleNum="dsChar" color="#000080" selColor="#ffffff" bold="0" italic="0"/>
+ <itemData name="String" defStyleNum="dsString" color="#ff0000" selColor="#ff0000" bold="0" italic="0"/>
+ <itemData name="String Char" defStyleNum="dsChar" color="#ff00ff" selColor="#ff00ff" bold="0" italic="0"/>
+ <itemData name="Comment" defStyleNum="dsComment" color="#008000" selColor="#008000" bold="0" italic="0"/>
+ <itemData name="Symbol" defStyleNum="dsNormal" color="#660099" selColor="#660099" bold="0" italic="0"/>
+ <itemData name="Region Marker" defStyleNum="dsRegionMarker"/>
+<!-- <itemData name="Region Marker" defStyleNum="dsRegionMarker" />-->
+ </itemDatas>
+ </highlighting>
+
+ <general>
+ <comments>
+ <comment name="singleLine" start="//" />
+ <comment name="multiLine" start="/*" end="*/" />
+ </comments>
+ <keywords casesensitive="1" />
+ </general>
+</language>
diff --git a/kate/data/progress.xml b/kate/data/progress.xml
new file mode 100644
index 000000000..b281e02dd
--- /dev/null
+++ b/kate/data/progress.xml
@@ -0,0 +1,1608 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+<language name="progress" version="1.09" kateversion="2.4" section="Database" extensions="*.p;*.w;*.i;*.cls" author="Rares Stanciulescu (rstanciu@operamail.com)" license="GPL">
+
+<highlighting>
+
+<list name="mytypes">
+ <item> CHAR </item>
+ <item> CHARACTER </item>
+ <item> COM-HANDLE </item>
+ <item> DECI </item>
+ <item> DECIMAL </item>
+ <item> DATE </item>
+ <item> INTE </item>
+ <item> INTEGER </item>
+ <item> ROWID </item>
+ <item> RECID </item>
+ <item> LOGI </item>
+ <item> LONGCHAR </item>
+ <item> LOGICAL </item>
+ <item> HANDLE </item>
+ <item> WIDGET-HANDLE </item>
+ <item> RAW </item>
+ <item> LONG </item>
+ <item> SHORT </item>
+ <item> BLOB </item>
+ <item> CLOB </item>
+ <item> LONGCHAR </item>
+ <item> DATETIME </item>
+ <item> DATETIME-TZ </item>
+ <item> TEMP-TABLE </item>
+ <item> BUFFER </item>
+ <item> STREAM </item>
+ <item> SAX-WRITER </item>
+ <item> MEMPTR </item>
+</list>
+
+ <list name="operators">
+ <item> AND </item>
+ <item> OR </item>
+ <item> NOT </item>
+ <item> BEGINS </item>
+ <item> MATCHES </item>
+ <item> MODULO </item>
+ <item> EQ </item>
+ <item> NE </item>
+ <item> LT </item>
+ <item> GT </item>
+ <item> GE </item>
+ <item> LE </item>
+ <item> FALSE </item>
+ <item> TRUE </item>
+ <item> YES </item>
+ <item> NO </item>
+</list>
+
+<list name="preprocvar">
+ <item> OUT </item>
+ <item> BATCH-MODE </item>
+ <item> FILE-NAME </item>
+ <item> GLOBAL-DEFINE </item>
+ <item> LINE-NUMBER </item>
+ <item> OPSYS </item>
+ <item> ENDIF </item>
+ <item> SCOPED-DEFINE </item>
+ <item> SEQUENCE </item>
+ <item> UNDEFINE </item>
+ <item> WINDOW-SYSTEM </item>
+ <item> ANALYZE-RESUME </item>
+ <item> ANALYZE-SUSPEND </item>
+ <item> WEBSTREAM </item>
+</list>
+
+<list name="phrases">
+ <item> AS </item>
+ <item> WORD-INDEX </item>
+ <item> LIKE </item>
+ <item> ALERT-BOX </item>
+ <item> AT </item>
+ <item> COLOR </item>
+ <item> COMBO-BOX </item>
+ <item> EDITING </item>
+ <item> EDITOR </item>
+ <item> FORMAT </item>
+ <item> FRAME </item>
+ <item> IMAGE </item>
+ <item> ENDKEY </item>
+ <item> ERROR </item>
+ <item> QUIT </item>
+ <item> STOP </item>
+ <item> PRESELECT </item>
+ <item> QUERY-TUNING </item>
+ <item> RADIO-SET </item>
+ <item> RECORD </item>
+ <item> SELECTION-LIST </item>
+ <item> SIZE </item>
+ <item> SLIDER </item>
+ <item> TRIGGER </item>
+ <item> WIDGET </item>
+ <item> VIEW-AS </item>
+ <item> NO-UNDO </item>
+ <item> NO-ERROR </item>
+ <item> OUT </item>
+ <item> WHERE </item>
+ <item> GLOBAL </item>
+ <item> SHARED </item>
+ <item> DEFINED </item>
+ <item> EXCLUSIVE-LOCK </item>
+ <item> SHARE-LOCK </item>
+ <item> NO-LOCK </item>
+ <item> EACH </item>
+ <item> FIRST </item>
+ <item> PREV </item>
+ <item> LAST </item>
+ <item> SKIP </item>
+ <item> FORWARD </item>
+ <item> UNIQUE </item>
+ <item> UNFORMATTED </item>
+ <item> APPEND </item>
+ <item> IN </item>
+ <item> OF </item>
+ <item> BEFORE-HIDE </item>
+ <item> NO-BOX </item>
+ <item> NO-UNDERLINE </item>
+ <item> KEEP-TAB-ORDER </item>
+ <item> UNBUFFERED </item>
+ <item> BINARY </item>
+ <item> NO-CONVERT </item>
+ <item> CONVERT </item>
+ <item> TARGET </item>
+ <item> NO-FILL </item>
+ <item> BY </item>
+ <item> NO-LABEL </item>
+ <item> GROUP </item>
+ <item> BREAK </item>
+ <item> COLON-ALIGNED </item>
+ <item> WITH </item>
+ <item> NO-LABELS </item>
+ <item> NO-PAUSE </item>
+ <item> NO-MESSAGE </item>
+ <item> NO-ECHO </item>
+ <item> NO-MAP </item>
+ <item> PRIVATE </item>
+ <item> PUBLIC </item>
+ <item> PROTECTED </item>
+</list>
+
+<list name="functions">
+ <item> output-content-type </item>
+ <item> get-value </item>
+ <item> get-cgi </item>
+ <item> get-field </item>
+ <item> html-encode </item>
+ <item> url-encode </item>
+ <item> ABSOLUTE </item>
+ <item> ACCUM </item>
+ <item> ADD-INTERVAL </item>
+ <item> ALIAS </item>
+ <item> AMBIGUOUS </item>
+ <item> ASC </item>
+ <item> AVAILABLE </item>
+ <item> BASE64-DECODE </item>
+ <item> BASE64-ENCODE </item>
+ <item> CAN-DO </item>
+ <item> CAN-FIND </item>
+ <item> CAN-QUERY </item>
+ <item> CAN-SET </item>
+ <item> CAPS </item>
+ <item> CHR </item>
+ <item> CODEPAGE-CONVERT </item>
+ <item> COMPARE </item>
+ <item> CONNECTED </item>
+ <item> COUNT-OF </item>
+ <item> CURRENT-CHANGED </item>
+ <item> CURRENT-LANGUAGE </item>
+ <item> CURRENT-RESULT-ROW </item>
+ <item> CURRENT-VALUE </item>
+ <item> DATASERVERS </item>
+ <item> DATA-SOURCE-MODIFIED </item>
+ <item> DATE </item>
+ <item> DATETIME </item>
+ <item> DATETIME-TZ </item>
+ <item> DAY </item>
+ <item> DBCODEPAGE </item>
+ <item> DBCOLLATION </item>
+ <item> DBNAME </item>
+ <item> DBPARAM </item>
+ <item> DBRESTRICTIONS </item>
+ <item> DBTASKID </item>
+ <item> DBTYPE </item>
+ <item> DBVERSION </item>
+ <item> DECIMAL </item>
+ <item> DECRYPT </item>
+ <item> DYNAMIC-CURRENT-VALUE </item>
+ <item> DYNAMIC-FUNCTION </item>
+ <item> DYNAMIC-NEXT-VALUE </item>
+ <item> ENCODE </item>
+ <item> ENCRYPT </item>
+ <item> ENTERED </item>
+ <item> ENTRY </item>
+ <item> ERROR </item>
+ <item> ETIME </item>
+ <item> EXP </item>
+ <item> EXTENT </item>
+ <item> FILL </item>
+ <item> FIRST </item>
+ <item> FIRST-OF </item>
+ <item> FIX-CODEPAGE </item>
+ <item> FRAME-COL </item>
+ <item> FRAME-DB </item>
+ <item> FRAME-DOWN </item>
+ <item> FRAME-FIELD </item>
+ <item> FRAME-FILE </item>
+ <item> FRAME-INDEX </item>
+ <item> FRAME-LINE </item>
+ <item> FRAME-NAME </item>
+ <item> FRAME-ROW </item>
+ <item> FRAME-VALUE </item>
+ <item> GATEWAYS </item>
+ <item> GENERATE-PBE-KEY </item>
+ <item> GENERATE-PBE-SALT </item>
+ <item> GENERATE-RANDOM-KEY </item>
+ <item> GET-BITS </item>
+ <item> GET-BYTE </item>
+ <item> GET-BYTE-ORDER </item>
+ <item> GET-BYTES </item>
+ <item> GET-CODEPAGE </item>
+ <item> GET-CODEPAGES </item>
+ <item> GET-COLLATION </item>
+ <item> GET-COLLATIONS </item>
+ <item> GET-DOUBLE </item>
+ <item> GET-FLOAT </item>
+ <item> GET-LONG </item>
+ <item> GET-POINTER-VALUE </item>
+ <item> GET-SHORT </item>
+ <item> GET-SIZE </item>
+ <item> GET-STRING </item>
+ <item> GET-UNSIGNED-SHORT </item>
+ <item> GO-PENDING </item>
+ <item> INDEX </item>
+ <item> INTEGER </item>
+ <item> INTERVAL </item>
+ <item> IS-ATTR-SPACE </item>
+ <item> IS-CODEPAGE-FIXED </item>
+ <item> IS-COLUMN-CODEPAGE </item>
+ <item> IS-LEAD-BYTE </item>
+ <item> ISO-DATE </item>
+ <item> KBLABEL </item>
+ <item> KEYCODE </item>
+ <item> KEYFUNCTION </item>
+ <item> KEYLABEL </item>
+ <item> KEYWORD </item>
+ <item> KEYWORD-ALL </item>
+ <item> LAST </item>
+ <item> LASTKEY </item>
+ <item> LAST-OF </item>
+ <item> LC </item>
+ <item> LDBNAME </item>
+ <item> LEFT-TRIM </item>
+ <item> LENGTH </item>
+ <item> LIBRARY </item>
+ <item> LINE-COUNTER </item>
+ <item> LIST-EVENTS </item>
+ <item> LIST-QUERY-ATTRS </item>
+ <item> LIST-SET-ATTRS </item>
+ <item> LIST-WIDGETS </item>
+ <item> LOCKED </item>
+ <item> LOG </item>
+ <item> LOGICAL </item>
+ <item> LOOKUP </item>
+ <item> MAXIMUM </item>
+ <item> MD5-DIGEST </item>
+ <item> MEMBER </item>
+ <item> MESSAGE-LINES </item>
+ <item> MINIMUM </item>
+ <item> MONTH </item>
+ <item> MTIME </item>
+ <item> NEW </item>
+ <item> NEXT-VALUE </item>
+ <item> NORMALIZE </item>
+ <item> NOT ENTERED </item>
+ <item> NOW </item>
+ <item> NUM-ALIASES </item>
+ <item> NUM-DBS </item>
+ <item> NUM-ENTRIES </item>
+ <item> NUM-RESULTS </item>
+ <item> OPSYS </item>
+ <item> OS-DRIVES </item>
+ <item> OS-ERROR </item>
+ <item> OS-GETENV </item>
+ <item> PAGE-NUMBER </item>
+ <item> PAGE-SIZE </item>
+ <item> PDBNAME </item>
+ <item> PROC-HANDLE </item>
+ <item> PROC-STATUS </item>
+ <item> PROGRAM-NAME </item>
+ <item> PROGRESS </item>
+ <item> PROMSGS </item>
+ <item> PROPATH </item>
+ <item> PROVERSION </item>
+ <item> QUERY-OFF-END </item>
+ <item> QUOTER </item>
+ <item> RANDOM </item>
+ <item> RAW </item>
+ <item> RECID </item>
+ <item> RECORD-LENGTH </item>
+ <item> REJECTED </item>
+ <item> REPLACE </item>
+ <item> RETRY </item>
+ <item> RETURN-VALUE </item>
+ <item> RGB-VALUE </item>
+ <item> RIGHT-TRIM </item>
+ <item> R-INDEX </item>
+ <item> ROUND </item>
+ <item> ROWID </item>
+ <item> ROW-STATE </item>
+ <item> SCREEN-LINES </item>
+ <item> SDBNAME </item>
+ <item> SEARCH </item>
+ <item> SEEK </item>
+ <item> SETUSERID </item>
+ <item> SHA1-DIGEST </item>
+ <item> SQRT </item>
+ <item> SSL-SERVER-NAME </item>
+ <item> STRING </item>
+ <item> SUBSTITUTE </item>
+ <item> SUBSTRING </item>
+ <item> SUPER </item>
+ <item> TERMINAL </item>
+ <item> TIME </item>
+ <item> TIMEZONE </item>
+ <item> TODAY </item>
+ <item> TO-ROWID </item>
+ <item> TRANSACTION </item>
+ <item> TRIM </item>
+ <item> TRUNCATE </item>
+ <item> USERID </item>
+ <item> VALID-EVENT </item>
+ <item> VALID-HANDLE </item>
+ <item> WEEKDAY </item>
+ <item> WIDGET-HANDLE </item>
+ <item> YEAR </item>
+</list>
+
+<list name="statements">
+ <item> IF </item>
+ <item> THEN </item>
+ <item> ELSE </item>
+ <item> WHEN </item>
+ <item> OTHERWISE </item>
+ <item> ACCUMULATE </item>
+ <item> APPLY </item>
+ <item> ASSIGN </item>
+ <item> BELL </item>
+ <item> BUFFER-COMPARE </item>
+ <item> BUFFER-COPY </item>
+ <item> CHOOSE </item>
+ <item> CLEAR </item>
+ <item> CLOSE </item>
+ <item> QUERY </item>
+ <item> STORED-PROCEDURE </item>
+ <item> COLOR </item>
+ <item> COMPILE </item>
+ <item> CONNECT </item>
+ <item> COPY-LOB </item>
+ <item> CREATE </item>
+ <item> ALIAS </item>
+ <item> BROWSE </item>
+ <item> BUFFER </item>
+ <item> CALL </item>
+ <item> DATABASE </item>
+ <item> DATASET </item>
+ <item> DATA-SOURCE </item>
+ <item> QUERY </item>
+ <item> SAX-READER </item>
+ <item> SERVER </item>
+ <item> SERVER-SOCKET </item>
+ <item> SOAP-HEADER </item>
+ <item> SOAP-HEADER-ENTRYREF </item>
+ <item> SOCKET </item>
+ <item> TEMP-TABLE </item>
+ <item> WIDGET </item>
+ <item> WIDGET-POOL </item>
+ <item> X-DOCUMENT </item>
+ <item> X-NODEREF </item>
+ <item> CURRENT-LANGUAGE </item>
+ <item> CURRENT-VALUE </item>
+ <item> DDE </item>
+ <item> ADVISE </item>
+ <item> EXECUTE </item>
+ <item> GET </item>
+ <item> INITIATE </item>
+ <item> REQUEST </item>
+ <item> SEND </item>
+ <item> TERMINATE </item>
+ <item> DEF </item>
+ <item> DEFINE </item>
+ <item> VAR </item>
+ <item> VARIABLE </item>
+ <item> BROWSE </item>
+ <item> BUFFER </item>
+ <item> BUTTON </item>
+ <item> DATASET </item>
+ <item> DATA-SOURCE </item>
+ <item> FRAME </item>
+ <item> IMAGE </item>
+ <item> MENU </item>
+ <item> PARAM </item>
+ <item> PARAMETER </item>
+ <item> QUERY </item>
+ <item> RECTANGLE </item>
+ <item> STREAM </item>
+ <item> SUB-MENU </item>
+ <item> TEMP-TABLE </item>
+ <item> VARIABLE </item>
+ <item> WORK-TABLE </item>
+ <item> WORKFILE </item>
+ <item> DELETE </item>
+ <item> ALIAS </item>
+ <item> OBJECT </item>
+ <item> WIDGET </item>
+ <item> WIDGET-POOL </item>
+ <item> DICTIONARY </item>
+ <item> DISABLE </item>
+ <item> TRIGGERS </item>
+ <item> DISCONNECT </item>
+ <item> DISPLAY </item>
+ <item> DOS </item>
+ <item> DOWN </item>
+ <item> DYNAMIC-CURRENT-VALUE </item>
+ <item> EMPTY </item>
+ <item> TEMP-TABLE </item>
+ <item> ENABLE </item>
+ <item> ENTRY </item>
+ <item> EXPORT </item>
+ <item> FIND </item>
+ <item> FORM </item>
+ <item> FRAME-VALUE </item>
+ <item> GET </item>
+ <item> GET-KEY-VALUE </item>
+ <item> HIDE </item>
+ <item> IMPORT </item>
+ <item> INPUT </item>
+ <item> CLEAR </item>
+ <item> CLOSE </item>
+ <item> FROM </item>
+ <item> TO </item>
+ <item> THROUGH </item>
+ <item> INPUT-OUTPUT</item>
+ <item> THROUGH </item>
+ <item> INSERT </item>
+ <item> LEAVE </item>
+ <item> LENGTH </item>
+ <item> LOAD </item>
+ <item> LOAD-PICTURE </item>
+ <item> MESSAGE </item>
+ <item> NEXT </item>
+ <item> NEXT-PROMPT </item>
+ <item> QUERY </item>
+ <item> OPEN </item>
+ <item> OS-APPEND </item>
+ <item> OS-COMMAND </item>
+ <item> OS-COPY </item>
+ <item> OS-CREATE-DIR </item>
+ <item> OS-DELETE </item>
+ <item> OS-RENAME </item>
+ <item> OUTPUT </item>
+ <item> OVERLAY </item>
+ <item> PAGE </item>
+ <item> PAUSE </item>
+ <item> PROCESS </item>
+ <item> EVENTS </item>
+ <item> PROMPT-FOR </item>
+ <item> PROMSGS </item>
+ <item> PROPATH </item>
+ <item> PUBLISH </item>
+ <item> CURSOR </item>
+ <item> PUT </item>
+ <item> SCREEN </item>
+ <item> PUT-BITS </item>
+ <item> PUT-BYTE </item>
+ <item> PUT-BYTES </item>
+ <item> PUT-DOUBLE </item>
+ <item> PUT-FLOAT </item>
+ <item> PUT-KEY-VALUE </item>
+ <item> PUT-LONG </item>
+ <item> PUT-SHORT </item>
+ <item> PUT-STRING </item>
+ <item> PUT-UNSIGNED-SHORT </item>
+ <item> QUIT </item>
+ <item> RAW </item>
+ <item> RAW-TRANSFER </item>
+ <item> READKEY </item>
+ <item> RELEASE </item>
+ <item> EXTERNAL </item>
+ <item> OBJECT </item>
+ <item> REPOSITION </item>
+ <item> RETURN </item>
+ <item> RETURNS </item>
+ <item> RUN </item>
+ <item> STORED-PROCEDURE </item>
+ <item> SUPER </item>
+ <item> SAVE </item>
+ <item> CACHE </item>
+ <item> SEEK </item>
+ <item> SET </item>
+ <item> SET-BYTE-ORDER </item>
+ <item> SET-POINTER-VALUE </item>
+ <item> SET-SIZE </item>
+ <item> SCROLL </item>
+ <item> SHOW-STATS </item>
+ <item> STATUS </item>
+ <item> STOP </item>
+ <item> SUBSCRIBE </item>
+ <item> SUBSTRING </item>
+ <item> COLOR </item>
+ <item> SYSTEM-DIALOG </item>
+ <item> FONT </item>
+ <item> GET-DIR </item>
+ <item> GET-FILE </item>
+ <item> PRINTER-SETUP </item>
+ <item> SYSTEM-HELP </item>
+ <item> TERMINAL </item>
+ <item> TRANSACTION-MODE </item>
+ <item> AUTOMATIC </item>
+ <item> TRIGGER </item>
+ <item> UNDERLINE </item>
+ <item> UNDO </item>
+ <item> UNIX </item>
+ <item> UNLOAD </item>
+ <item> UNSUBSCRIBE </item>
+ <item> UP </item>
+ <item> UPDATE </item>
+ <item> USE </item>
+ <item> VALIDATE </item>
+ <item> VIEW </item>
+ <item> WAIT-FOR </item>
+</list>
+
+<list name="widgets">
+ <item> BROWSE </item>
+ <item> BUTTON </item>
+ <item> COMBO-BOX </item>
+ <item> CONTROL-FRAME </item>
+ <item> DIALOG-BOX </item>
+ <item> EDITOR </item>
+ <item> FIELD-GROUP </item>
+ <item> FILL-IN </item>
+ <item> FRAME </item>
+ <item> IMAGE </item>
+ <item> LITERAL </item>
+ <item> MENU </item>
+ <item> MENU-ITEM </item>
+ <item> RADIO-SET </item>
+ <item> RECTANGLE </item>
+ <item> SELECTION-LIST </item>
+ <item> SLIDER </item>
+ <item> SUB-MENU </item>
+ <item> TEXT </item>
+ <item> TOGGLE-BOX </item>
+ <item> WINDOW </item>
+</list>
+
+<list name="handles">
+ <item> ACTIVE-WINDOW </item>
+ <item> BUFFER </item>
+ <item> BUFFER-FIELD </item>
+ <item> CALL </item>
+ <item> CLIPBOARD </item>
+ <item> CODEBASE-LOCATOR </item>
+ <item> COLOR-TABLE </item>
+ <item> COM-SELF </item>
+ <item> COMPILER </item>
+ <item> CURRENT-WINDOW </item>
+ <item> DATA-RELATION </item>
+ <item> DATE-SOURCE </item>
+ <item> DEBUGGER </item>
+ <item> DEFAULT-WINDOW </item>
+ <item> ERROR-STATUS </item>
+ <item> FILE-INFO </item>
+ <item> FIELD </item>
+ <item> FOCUS </item>
+ <item> FONT-TABLE </item>
+ <item> LAST-EVENT </item>
+ <item> LOG-MANAGER </item>
+ <item> PRODATASET </item>
+ <item> QUERY </item>
+ <item> RCODE-INFO </item>
+ <item> SAX-ATTRIBUTES </item>
+ <item> SAX-READER </item>
+ <item> SELF </item>
+ <item> SERVER SOCKET </item>
+ <item> SESSION </item>
+ <item> SOAP-FAULT </item>
+ <item> SOAP-FAULT-DETAIL </item>
+ <item> SOAP-HEADER </item>
+ <item> SOAP-HEADER-ENTRYREF </item>
+ <item> SOCKET </item>
+ <item> SOURCE-PROCEDURE </item>
+ <item> TARGET-PROCEDURE </item>
+ <item> TEMP-TABLE </item>
+ <item> THIS-PROCEDURE </item>
+ <item> TRANSACTION </item>
+ <item> WEB-CONTEXT </item>
+ <item> X-DOCUMENT </item>
+ <item> X-NODEREF </item>
+</list>
+
+<list name="properties">
+ <item> CONTROL-NAME </item>
+ <item> CONTROLS </item>
+ <item> HEIGHT </item>
+ <item> HONORPROKEYS </item>
+ <item> HONORRETURNKEY </item>
+ <item> LEFT </item>
+ <item> TOP </item>
+ <item> WIDTH </item>
+ <item> TAG </item>
+</list>
+
+<list name="attributes">
+ <item> ACCELERATOR </item>
+ <item> ACTIVE </item>
+ <item> ACTOR </item>
+ <item> ADM-DATA </item>
+ <item> AFTER-BUFFER </item>
+ <item> AFTER-ROWID </item>
+ <item> AFTER-TABLE </item>
+ <item> ALLOW-COLUMN-SEARCHING </item>
+ <item> ALWAYS-ON-TOP </item>
+ <item> AMBIGUOUS </item>
+ <item> APPL-ALERT-BOXES </item>
+ <item> APPSERVER-INFO </item>
+ <item> APPSERVER-PASSWORD </item>
+ <item> APPSERVER-USERID </item>
+ <item> ASYNCHRONOUS </item>
+ <item> ASYNC-REQUEST-COUNT </item>
+ <item> ASYNC-REQUEST-HANDLE </item>
+ <item> ATTRIBUTE-NAMES </item>
+ <item> ATTR-SPACE </item>
+ <item> AUTO-COMPLETION </item>
+ <item> AUTO-DELETE </item>
+ <item> AUTO-ENDKEY </item>
+ <item> AUTO-GO </item>
+ <item> AUTO-INDENT </item>
+ <item> AUTO-RESIZE </item>
+ <item> AUTO-RETURN </item>
+ <item> AUTO-VALIDATE </item>
+ <item> AUTO-ZAP </item>
+ <item> AVAILABLE </item>
+ <item> AVAILABLE-FORMATS </item>
+ <item> BACKGROUND </item>
+ <item> BASE-ADE </item>
+ <item> BASIC-LOGGING </item>
+ <item> BATCH-MODE </item>
+ <item> BEFORE-BUFFER </item>
+ <item> BEFORE-ROWID </item>
+ <item> BEFORE-TABLE </item>
+ <item> BGCOLOR </item>
+ <item> BLANK </item>
+ <item> BLOCK-ITERATION-DISPLAY </item>
+ <item> BORDER-BOTTOM-CHARS </item>
+ <item> BORDER-BOTTOM-PIXELS </item>
+ <item> BORDER-LEFT-CHARS </item>
+ <item> BORDER-LEFT-PIXELS </item>
+ <item> BORDER-RIGHT-CHARS </item>
+ <item> BORDER-RIGHT-PIXELS </item>
+ <item> BORDER-TOP-CHARS </item>
+ <item> BORDER-TOP-PIXELS </item>
+ <item> BOX </item>
+ <item> BOX-SELECTABLE </item>
+ <item> BUFFER-CHARS </item>
+ <item> BUFFER-VALUE </item>
+ <item> BYTES-READ </item>
+ <item> BYTES-WRITTEN </item>
+ <item> CACHE </item>
+ <item> CALL-NAME </item>
+ <item> CALL-TYPE </item>
+ <item> BUFFER-FIELD </item>
+ <item> BUFFER-HANDLE </item>
+ <item> BUFFER-LINES </item>
+ <item> BUFFER-NAME </item>
+ <item> CANCEL-BUTTON </item>
+ <item> CANCELLED </item>
+ <item> CAN-CREATE </item>
+ <item> CAN-DELETE </item>
+ <item> CAN-READ </item>
+ <item> CAN-WRITE </item>
+ <item> CAREFUL-PAINT </item>
+ <item> CASE-SENSITIVE </item>
+ <item> CENTERED </item>
+ <item> CHARSET </item>
+ <item> CHECKED </item>
+ <item> CHILD-BUFFER </item>
+ <item> CHILD-NUM </item>
+ <item> CLIENT-CONNECTION-ID </item>
+ <item> CLIENT-TYPE </item>
+ <item> CODE </item>
+ <item> CODEPAGE </item>
+ <item> COLUMN </item>
+ <item> COLUMN-BGCOLOR </item>
+ <item> COLUMN-DCOLOR </item>
+ <item> COLUMN-FGCOLOR </item>
+ <item> COLUMN-FONT </item>
+ <item> COLUMN-LABEL </item>
+ <item> COLUMN-MOVABLE </item>
+ <item> COLUMN-PFCOLOR </item>
+ <item> COLUMN-READ-ONLY </item>
+ <item> COLUMN-RESIZABLE </item>
+ <item> COLUMN-SCROLLING </item>
+ <item> COM-HANDLE </item>
+ <item> COMPLETE </item>
+ <item> CONTEXT-HELP </item>
+ <item> CONTEXT-HELP-FILE </item>
+ <item> CONTEXT-HELP-ID </item>
+ <item> CONTROL-BOX </item>
+ <item> CONVERT-D-COLORS </item>
+ <item> CPCASE </item>
+ <item> CPCOLL </item>
+ <item> CPINTERNAL </item>
+ <item> CPLOG </item>
+ <item> CPPRINT </item>
+ <item> CPRCODEIN </item>
+ <item> CPRCODEOUT </item>
+ <item> CPSTREAM </item>
+ <item> CPTERM </item>
+ <item> CRC-VALUE </item>
+ <item> CURRENT-CHANGED </item>
+ <item> CURRENT-COLUMN </item>
+ <item> CURRENT-ITERATION </item>
+ <item> CURRENT-RESULT-ROW </item>
+ <item> CURRENT-ROW-MODIFIED </item>
+ <item> CURRENT-WINDOW </item>
+ <item> CURSOR-CHAR </item>
+ <item> CURSOR-LINE </item>
+ <item> CURSOR-OFFSET </item>
+ <item> DATA-ENTRY-RETURN </item>
+ <item> DATA-SOURCE </item>
+ <item> DATA-TYPE </item>
+ <item> DATASET </item>
+ <item> DATE-FORMAT </item>
+ <item> DBNAME </item>
+ <item> DB-REFERENCES </item>
+ <item> DCOLOR </item>
+ <item> DDE-ERROR </item>
+ <item> DDE-ID </item>
+ <item> DDE-ITEM </item>
+ <item> DDE-NAME </item>
+ <item> DDE-TOPIC </item>
+ <item> DEBLANK </item>
+ <item> DEBUG-ALERT </item>
+ <item> DECIMALS </item>
+ <item> DEFAULT </item>
+ <item> DEFAULT-BUFFER-HANDLE </item>
+ <item> DEFAULT-BUTTON </item>
+ <item> DEFAULT-COMMIT </item>
+ <item> DELIMITER </item>
+ <item> DISABLE-AUTO-ZAP </item>
+ <item> DISPLAY-TIMEZONE </item>
+ <item> DISPLAY-TYPE </item>
+ <item> DOWN </item>
+ <item> DRAG-ENABLED </item>
+ <item> DROP-TARGET </item>
+ <item> DYNAMIC </item>
+ <item> EDGE-CHARS </item>
+ <item> EDGE-PIXELS </item>
+ <item> EDIT-CAN-PASTE </item>
+ <item> EDIT-CAN-UNDO </item>
+ <item> EMPTY </item>
+ <item> ENCODING </item>
+ <item> END-USER-PROMPT </item>
+ <item> ENTRY-TYPES-LIST </item>
+ <item> ERROR </item>
+ <item> ERROR-COLUMN </item>
+ <item> ERROR-OBJECT-DETAIL </item>
+ <item> ERROR-ROW </item>
+ <item> ERROR-STRING </item>
+ <item> EVENT-PROCEDURE </item>
+ <item> EVENT-PROCEDURE-CONTEXT </item>
+ <item> EVENT-TYPE </item>
+ <item> EXPAND </item>
+ <item> EXPANDABLE </item>
+ <item> EXTENT </item>
+ <item> FGCOLOR </item>
+ <item> FILE-CREATE-DATE </item>
+ <item> FILE-CREATE-TIME </item>
+ <item> FILE-MOD-DATE </item>
+ <item> FILE-MOD-TIME </item>
+ <item> FILE-NAME </item>
+ <item> FILE-OFFSET </item>
+ <item> FILE-SIZE </item>
+ <item> FILE-TYPE </item>
+ <item> FILLED </item>
+ <item> FILL-MODE </item>
+ <item> FILL-WHERE-STRING </item>
+ <item> FIRST-ASYNC-REQUEST </item>
+ <item> FIRST-BUFFER </item>
+ <item> FIRST-CHILD </item>
+ <item> FIRST-COLUMN </item>
+ <item> FIRST-DATASET </item>
+ <item> FIRST-DATA-SOURCE </item>
+ <item> FIRST-PROCEDURE </item>
+ <item> FIRST-QUERY </item>
+ <item> FIRST-SERVER </item>
+ <item> FIRST-SERVER-SOCKET </item>
+ <item> FIRST-SOCKET </item>
+ <item> FIRST-TAB-ITEM </item>
+ <item> FIT-LAST-COLUMN </item>
+ <item> FLAT-BUTTON </item>
+ <item> FOCUSED-ROW </item>
+ <item> FOCUSED-ROW-SELECTED </item>
+ <item> FONT </item>
+ <item> FOREGROUND </item>
+ <item> FORMAT </item>
+ <item> FORWARD-ONLY </item>
+ <item> FRAME </item>
+ <item> FRAME-COL </item>
+ <item> FRAME-NAME </item>
+ <item> FRAME-ROW </item>
+ <item> FRAME-SPACING </item>
+ <item> FRAME-X </item>
+ <item> FRAME-Y </item>
+ <item> FREQUENCY </item>
+ <item> FULL-HEIGHT-CHARS </item>
+ <item> FULL-HEIGHT-PIXELS </item>
+ <item> FULL-PATHNAME </item>
+ <item> FULL-WIDTH-CHARS </item>
+ <item> FULL-WIDTH-PIXELS </item>
+ <item> GRAPHIC-EDGE </item>
+ <item> GRID-FACTOR-HORIZONTAL </item>
+ <item> GRID-FACTOR-VERTICAL </item>
+ <item> GRID-SNAP </item>
+ <item> GRID-UNIT-HEIGHT-CHARS </item>
+ <item> GRID-UNIT-HEIGHT-PIXELS </item>
+ <item> GRID-UNIT-WIDTH-CHARS </item>
+ <item> GRID-UNIT-WIDTH-PIXELS </item>
+ <item> GRID-VISIBLE </item>
+ <item> HANDLER </item>
+ <item> HAS-LOBS </item>
+ <item> HAS-RECORDS </item>
+ <item> HEIGHT-CHARS </item>
+ <item> HEIGHT-PIXELS </item>
+ <item> HELP </item>
+ <item> HIDDEN </item>
+ <item> HORIZONTAL </item>
+ <item> HTML-CHARSET </item>
+ <item> HWND </item>
+ <item> ICFPARAMETER </item>
+ <item> ICON </item>
+ <item> IGNORE-CURRENT-MODIFIED </item>
+ <item> IMAGE </item>
+ <item> IMAGE-DOWN </item>
+ <item> IMAGE-INSENSITIVE </item>
+ <item> IMAGE-UP </item>
+ <item> IMMEDIATE-DISPLAY </item>
+ <item> INDEX </item>
+ <item> INDEX-INFORMATION </item>
+ <item> INIT </item>
+ <item> INITIAL </item>
+ <item> INNER-CHARS </item>
+ <item> INNER-LINES </item>
+ <item> INPUT-VALUE </item>
+ <item> INSTANTIATING-PROCEDURE </item>
+ <item> INTERNAL-ENTRIES </item>
+ <item> IN-HANDLE </item>
+ <item> IS-OPEN </item>
+ <item> IS-PARAMETER-SET </item>
+ <item> ITEMS-PER-ROW </item>
+ <item> KEEP-CONNECTION-OPEN </item>
+ <item> KEEP-FRAME-Z-ORDER </item>
+ <item> KEEP-SECURITY-CACHE </item>
+ <item> KEY </item>
+ <item> LABEL </item>
+ <item> LABEL-BGCOLOR </item>
+ <item> LABEL-DCOLOR </item>
+ <item> LABEL-FGCOLOR </item>
+ <item> LABEL-FONT </item>
+ <item> LABELS </item>
+ <item> LANGUAGES </item>
+ <item> LARGE </item>
+ <item> LARGE-TO-SMALL </item>
+ <item> LAST-ASYNC-REQUEST </item>
+ <item> LAST-CHILD </item>
+ <item> LAST-PROCEDURE </item>
+ <item> LAST-SERVER </item>
+ <item> LAST-SERVER-SOCKET </item>
+ <item> LAST-SOCKET </item>
+ <item> LAST-TAB-ITEM </item>
+ <item> LENGTH </item>
+ <item> LINE </item>
+ <item> LIST-ITEM-PAIRS </item>
+ <item> LIST-ITEMS </item>
+ <item> LITERAL-QUESTION </item>
+ <item> LOCAL-HOST </item>
+ <item> LOCAL-NAME </item>
+ <item> LOCAL-PORT </item>
+ <item> LOCATOR-COLUMN-NUMBER </item>
+ <item> LOCATOR-LINE-NUMBER </item>
+ <item> LOCATOR-PUBLIC-ID </item>
+ <item> LOCATOR-SYSTEM-ID </item>
+ <item> LOCATOR-TYPE </item>
+ <item> LOCKED </item>
+ <item> LOG-ENTRY-TYPES </item>
+ <item> LOG-THRESHOLD </item>
+ <item> LOGFILE-NAME </item>
+ <item> LOGGING-LEVEL </item>
+ <item> MANDATORY </item>
+ <item> MANUAL-HIGHLIGHT </item>
+ <item> MAX-BUTTON </item>
+ <item> MAX-CHARS </item>
+ <item> MAX-DATA-GUESS </item>
+ <item> MAX-HEIGHT-CHARS </item>
+ <item> MAX-HEIGHT-PIXELS </item>
+ <item> MAX-VALUE </item>
+ <item> MAX-WIDTH-CHARS </item>
+ <item> MAX-WIDTH-PIXELS </item>
+ <item> MD-VALUE </item>
+ <item> MENU-BAR </item>
+ <item> MENU-KEY </item>
+ <item> MENU-MOUSE </item>
+ <item> MESSAGE-AREA </item>
+ <item> MESSAGE-AREA-FONT </item>
+ <item> MIN-BUTTON </item>
+ <item> MIN-COLUMN-WIDTH-CHARS </item>
+ <item> MIN-COLUMN-WIDTH-PIXELS </item>
+ <item> MIN-HEIGHT-CHARS </item>
+ <item> MIN-HEIGHT-PIXELS </item>
+ <item> MIN-SCHEMA-MARSHAL </item>
+ <item> MIN-VALUE </item>
+ <item> MIN-WIDTH-CHARS </item>
+ <item> MIN-WIDTH-PIXELS </item>
+ <item> MODIFIED </item>
+ <item> MOUSE-POINTER </item>
+ <item> MOVABLE </item>
+ <item> MULTIPLE </item>
+ <item> MULTITASKING-INTERVAL </item>
+ <item> MUST-UNDERSTAND </item>
+ <item> NAMESPACE-PREFIX </item>
+ <item> NAMESPACE-URI </item>
+ <item> NEEDS-APPSERVER-PROMPT </item>
+ <item> NEEDS-PROMPT </item>
+ <item> NEW </item>
+ <item> NEW-ROW </item>
+ <item> NEXT-COLUMN </item>
+ <item> NEXT-SIBLING </item>
+ <item> NEXT-TAB-ITEM </item>
+ <item> NO-CURRENT-VALUE </item>
+ <item> NO-EMPTY-SPACE </item>
+ <item> NO-FOCUS </item>
+ <item> NO-SCHEMA-MARSHAL </item>
+ <item> NO-VALIDATE </item>
+ <item> NODE-VALUE </item>
+ <item> NUM-BUFFERS </item>
+ <item> NUM-BUTTONS </item>
+ <item> NUM-CHILD-RELATIONS </item>
+ <item> NUM-CHILDREN </item>
+ <item> NUM-COLUMNS </item>
+ <item> NUM-DROPPED-FILES </item>
+ <item> NUM-ENTRIES </item>
+ <item> NUM-FIELDS </item>
+ <item> NUM-FORMATS </item>
+ <item> NUM-HEADER-ENTRIES </item>
+ <item> NUM-ITEMS </item>
+ <item> NUM-ITERATIONS </item>
+ <item> NUM-LINES </item>
+ <item> NUM-LOCKED-COLUMNS </item>
+ <item> NUM-LOG-FILES </item>
+ <item> NUM-MESSAGES </item>
+ <item> NUM-PARAMETERS </item>
+ <item> NUM-RELATIONS </item>
+ <item> NUM-REPLACED </item>
+ <item> NUM-RESULTS </item>
+ <item> NUM-SELECTED-ROWS </item>
+ <item> NUM-SELECTED-WIDGETS </item>
+ <item> NUM-SOURCE-BUFFERS </item>
+ <item> NUM-TABS </item>
+ <item> NUM-TO-RETAIN </item>
+ <item> NUM-TOP-BUFFERS </item>
+ <item> NUM-VISIBLE-COLUMNS </item>
+ <item> NUMERIC-DECIMAL-POINT </item>
+ <item> NUMERIC-FORMAT </item>
+ <item> NUMERIC-SEPARATOR </item>
+ <item> ON-FRAME-BORDER </item>
+ <item> ORIGIN-HANDLE </item>
+ <item> ORIGIN-ROWID </item>
+ <item> OVERLAY </item>
+ <item> OWNER </item>
+ <item> OWNER-DOCUMENT </item>
+ <item> PAGE-BOTTOM </item>
+ <item> PAGE-TOP </item>
+ <item> PARAMETER </item>
+ <item> PARENT </item>
+ <item> PARENT-BUFFER </item>
+ <item> PARENT-RELATION </item>
+ <item> PARSE-STATUS </item>
+ <item> PASSWORD-FIELD </item>
+ <item> PATHNAME </item>
+ <item> PERSISTENT </item>
+ <item> PERSISTENT-CACHE-DISABLED </item>
+ <item> PERSISTENT-PROCEDURE </item>
+ <item> PFCOLOR </item>
+ <item> PIXELS-PER-COLUMN </item>
+ <item> PIXELS-PER-ROW </item>
+ <item> POPUP-MENU </item>
+ <item> POPUP-ONLY </item>
+ <item> POSITION </item>
+ <item> PREPARED </item>
+ <item> PREPARE-STRING </item>
+ <item> PREV-COLUMN </item>
+ <item> PREV-SIBLING </item>
+ <item> PREV-TAB-ITEM </item>
+ <item> PRIMARY </item>
+ <item> PRINTER-CONTROL-HANDLE </item>
+ <item> PRINTER-HDC </item>
+ <item> PRINTER-NAME </item>
+ <item> PRINTER-PORT </item>
+ <item> PRIVATE-DATA </item>
+ <item> PROCEDURE-NAME </item>
+ <item> PROGRESS-SOURCE </item>
+ <item> PROXY </item>
+ <item> PROXY-PASSWORD </item>
+ <item> PROXY-USERID </item>
+ <item> PUBLIC-ID </item>
+ <item> PUBLISHED-EVENTS </item>
+ <item> QUERY </item>
+ <item> QUERY-OFF-END </item>
+ <item> QUIT </item>
+ <item> RADIO-BUTTONS </item>
+ <item> READ-ONLY </item>
+ <item> RECID </item>
+ <item> RECORD-LENGTH </item>
+ <item> REFRESHABLE </item>
+ <item> REJECTED </item>
+ <item> RELATION-FIELDS </item>
+ <item> RELATIONS-ACTIVE </item>
+ <item> REMOTE </item>
+ <item> REMOTE-HOST </item>
+ <item> REMOTE-PORT </item>
+ <item> REPOSITION </item>
+ <item> RESIZABLE </item>
+ <item> RESIZE </item>
+ <item> RETAIN-SHAPE </item>
+ <item> RETURN-INSERTED </item>
+ <item> RETURN-VALUE </item>
+ <item> RETURN-VALUE-DATA-TYPE </item>
+ <item> ROW </item>
+ <item> COL </item>
+ <item> ROW-HEIGHT-CHARS </item>
+ <item> ROW-HEIGHT-PIXELS </item>
+ <item> ROW-STATE </item>
+ <item> ROWID </item>
+ <item> ROW-MARKERS </item>
+ <item> ROW-RESIZABLE </item>
+ <item> SAVE-WHERE-STRING </item>
+ <item> SCHEMA-CHANGE </item>
+ <item> SCHEMA-PATH </item>
+ <item> SCREEN-LINES </item>
+ <item> SCREEN-VALUE </item>
+ <item> SCROLL-BARS </item>
+ <item> SCROLLABLE </item>
+ <item> SCROLLBAR-HORIZONTAL </item>
+ <item> SCROLLBAR-VERTICAL </item>
+ <item> SELECTABLE </item>
+ <item> SELECTED </item>
+ <item> SELECTION-END </item>
+ <item> SELECTION-START </item>
+ <item> SELECTION-TEXT </item>
+ <item> SENSITIVE </item>
+ <item> SEPARATORS </item>
+ <item> SEPARATOR-FGCOLOR </item>
+ <item> SERVER </item>
+ <item> SERVER-CONNECTION-BOUND </item>
+ <item> SERVER-CONNECTION-BOUND-REQUEST </item>
+ <item> SERVER-CONNECTION-CONTEXT </item>
+ <item> SERVER-CONNECTION-ID </item>
+ <item> SERVER-OPERATING-MODE </item>
+ <item> SHOW-IN-TASKBAR </item>
+ <item> SIDE-LABEL-HANDLE </item>
+ <item> SIDE-LABELS </item>
+ <item> SKIP-DELETED-RECORD </item>
+ <item> SMALL-ICON </item>
+ <item> SMALL-TITLE </item>
+ <item> SOAP-FAULT-ACTOR </item>
+ <item> SOAP-FAULT-CODE </item>
+ <item> SOAP-FAULT-DETAIL </item>
+ <item> SOAP-FAULT-STRING </item>
+ <item> SORT </item>
+ <item> STARTUP-PARAMETERS </item>
+ <item> STATUS-AREA </item>
+ <item> STATUS-AREA-FONT </item>
+ <item> STOP </item>
+ <item> STOPPED </item>
+ <item> STREAM </item>
+ <item> STRETCH-TO-FIT </item>
+ <item> STRING-VALUE </item>
+ <item> SUBTYPE </item>
+ <item> SUPER-PROCEDURES </item>
+ <item> SUPPRESS-NAMESPACE-PROCESSING </item>
+ <item> SUPPRESS-WARNINGS </item>
+ <item> SYSTEM-ALERT-BOXES </item>
+ <item> SYSTEM-ID </item>
+ <item> TAB-POSITION </item>
+ <item> TAB-STOP </item>
+ <item> TABLE </item>
+ <item> TABLE-CRC-LIST </item>
+ <item> TABLE-HANDLE </item>
+ <item> TABLE-LIST </item>
+ <item> TABLE-NUMBER </item>
+ <item> TEMP-DIRECTORY </item>
+ <item> TEXT-SELECTED </item>
+ <item> THREE-D </item>
+ <item> TIC-MARKS </item>
+ <item> TIME-SOURCE </item>
+ <item> TITLE </item>
+ <item> TITLE-BGCOLOR </item>
+ <item> TITLE-DCOLOR </item>
+ <item> TITLE-FGCOLOR </item>
+ <item> TITLE-FONT </item>
+ <item> TOGGLE-BOX </item>
+ <item> TOOLTIP </item>
+ <item> TOOLTIPS </item>
+ <item> TOP-ONLY </item>
+ <item> TRACKING-CHANGES </item>
+ <item> TRANSACTION </item>
+ <item> TRANSPARENT </item>
+ <item> TRANS-INIT-PROCEDURE </item>
+ <item> TYPE </item>
+ <item> UNDO </item>
+ <item> UNIQUE-ID </item>
+ <item> UNIQUE-MATCH </item>
+ <item> URL </item>
+ <item> URL-PASSWORD </item>
+ <item> URL-USERID </item>
+ <item> DISPLAY </item>
+ <item> VALIDATE-EXPRESSION </item>
+ <item> VALIDATE-MESSAGE </item>
+ <item> VALIDATION-ENABLED </item>
+ <item> VALUE </item>
+ <item> VIEW-FIRST-COLUMN-ON-REOPEN </item>
+ <item> VIRTUAL-HEIGHT </item>
+ <item> VIRTUAL-WIDTH </item>
+ <item> VIRTUAL-HEIGHT-CHARS </item>
+ <item> VIRTUAL-HEIGHT-PIXELS </item>
+ <item> VIRTUAL-WIDTH-CHARS </item>
+ <item> VIRTUAL-WIDTH-PIXELS </item>
+ <item> VISIBLE </item>
+ <item> WARNING </item>
+ <item> WHERE-STRING </item>
+ <item> WIDGET-ENTER </item>
+ <item> WIDGET-LEAVE </item>
+ <item> WIDTH-CHARS </item>
+ <item> WIDTH-PIXELS </item>
+ <item> WINDOW </item>
+ <item> WINDOW-STATE </item>
+ <item> WINDOW-SYSTEM </item>
+ <item> WORD-WRAP </item>
+ <item> WORK-AREA-HEIGHT-PIXELS </item>
+ <item> WORK-AREA-WIDTH-PIXELS </item>
+ <item> WORK-AREA-X </item>
+ <item> WORK-AREA-Y </item>
+ <item> X </item>
+ <item> XML-SCHEMA-PATH </item>
+ <item> XML-SUPPRESS-NAMESPACE-PROCESSING </item>
+ <item> Y </item>
+ <item> YEAR-OFFSET </item>
+ <item> WRITE-XMLSCHEMA </item>
+ <item> WRITE-XML </item>
+ <item> READ-XML </item>
+ <item> NESTED </item>
+ <item> XML-DATA-TYPE </item>
+ <item> XML-NODE-TYPE </item>
+ <item> FORMATTED </item>
+ <item> SET-OUTPUT-DESTINATION </item>
+ <item> START-DOCUMENT </item>
+ <item> START-ELEMENT </item>
+ <item> WRITE-CHARACTERS </item>
+ <item> END-ELEMENT </item>
+ <item> END-DOCUMENT </item>
+ <item> WRITE-DATA-ELEMENT </item>
+ <item> INSERT-ATTRIBUTE </item>
+
+</list>
+
+<list name="methods">
+ <item> ACCEPT-CHANGES </item>
+ <item> ACCEPT-ROW-CHANGES </item>
+ <item> ADD-BUFFER </item>
+ <item> ADD-CALC-COLUMN </item>
+ <item> ADD-COLUMNS-FROM </item>
+ <item> ADD-EVENTS-PROCEDURE </item>
+ <item> ADD-FIELDS-FROM </item>
+ <item> ADD-FIRST </item>
+ <item> ADD-HEADER-ENTRY </item>
+ <item> ADD-INDEX-FIELD </item>
+ <item> ADD-LAST </item>
+ <item> ADD-LIKE-COLUMN </item>
+ <item> ADD-LIKE-FIELD </item>
+ <item> ADD-LIKE-INDEX </item>
+ <item> ADD-NEW-FIELD </item>
+ <item> ADD-NEW-INDEX </item>
+ <item> ADD-RELATION </item>
+ <item> ADD-SOURCE-BUFFER </item>
+ <item> ADD-SUPER-PROCEDURE </item>
+ <item> APPEND-CHILD </item>
+ <item> APPLY-CALLBACK </item>
+ <item> ATTACH-DATA-SOURCE </item>
+ <item> BUFFER-COMPARE </item>
+ <item> BUFFER-COPY </item>
+ <item> BUFFER-CREATE </item>
+ <item> BUFFER-DELETE </item>
+ <item> BUFFER-FIELD </item>
+ <item> BUFFER-RELEASE </item>
+ <item> BUFFER-VALIDATE </item>
+ <item> CANCEL-BREAK </item>
+ <item> CANCEL-REQUESTS </item>
+ <item> CLEAR </item>
+ <item> CLEAR-SELECTION </item>
+ <item> CLONE-NODE </item>
+ <item> CONNECT </item>
+ <item> CONNECTED </item>
+ <item> CONVERT-TO-OFFSET </item>
+ <item> CREATE-LIKE </item>
+ <item> CREATE-NODE </item>
+ <item> CREATE-NODE-NAMESPACE </item>
+ <item> CREATE-RESULT-LIST-ENTRY </item>
+ <item> DEBUG </item>
+ <item> DELETE </item>
+ <item> DELETE-CHAR </item>
+ <item> DELETE-CURRENT-ROW </item>
+ <item> DELETE-HEADER-ENTRY </item>
+ <item> DELETE-LINE </item>
+ <item> DELETE-NODE </item>
+ <item> DELETE-RESULT-LIST-ENTRY </item>
+ <item> DELETE-SELECTED-ROW </item>
+ <item> DELETE-SELECTED-ROWS </item>
+ <item> DESELECT-FOCUSED-ROW </item>
+ <item> DESELECT-ROWS </item>
+ <item> DESELECT-SELECTED-ROW </item>
+ <item> DETACH-DATA-SOURCE </item>
+ <item> DISABLE </item>
+ <item> DISABLE-CONNECTIONS </item>
+ <item> DISABLE-DUMP-TRIGGERS </item>
+ <item> DISABLE-LOAD-TRIGGERS </item>
+ <item> DISCONNECT </item>
+ <item> DISPLAY-MESSAGE </item>
+ <item> DUMP-LOGGING-NOW </item>
+ <item> EDIT-CLEAR </item>
+ <item> EDIT-COPY </item>
+ <item> EDIT-CUT </item>
+ <item> EDIT-PASTE </item>
+ <item> EDIT-UNDO </item>
+ <item> EMPTY-DATASET </item>
+ <item> EMPTY-TEMP-TABLE </item>
+ <item> ENABLE </item>
+ <item> ENABLE-CONNECTIONS </item>
+ <item> ENABLE-EVENTS </item>
+ <item> END-FILE-DROP </item>
+ <item> ENTRY </item>
+ <item> EXPORT </item>
+ <item> FETCH-SELECTED-ROW </item>
+ <item> FILL </item>
+ <item> FIND-BY-ROWID </item>
+ <item> FIND-CURRENT </item>
+ <item> FIND-FIRST </item>
+ <item> FIND-LAST </item>
+ <item> FIND-UNIQUE </item>
+ <item> GET-ATTRIBUTE </item>
+ <item> GET-ATTRIBUTE-NODE </item>
+ <item> GET-BLUE-VALUE </item>
+ <item> GET-BROWSE-COLUMN </item>
+ <item> GET-BUFFER-HANDLE </item>
+ <item> GET-BYTES-AVAILABLE </item>
+ <item> GET-CHANGES </item>
+ <item> GET-CHILD </item>
+ <item> GET-CHILD-RELATION </item>
+ <item> GET-CURRENT </item>
+ <item> GET-DATASET-BUFFER </item>
+ <item> GET-DOCUMENT-ELEMENT </item>
+ <item> GET-DROPPED-FILE </item>
+ <item> GET-DYNAMIC </item>
+ <item> GET-FIRST </item>
+ <item> GET-GREEN-VALUE </item>
+ <item> GET-HEADER-ENTRY </item>
+ <item> GET-INDEX-BY-NAMESPACE-NAME </item>
+ <item> GET-INDEX-BY-QNAME </item>
+ <item> GET-ITERATION </item>
+ <item> GET-LAST </item>
+ <item> GET-LOCALNAME-BY-INDEX </item>
+ <item> GET-MESSAGE </item>
+ <item> GET-NEXT </item>
+ <item> GET-NODE </item>
+ <item> GET-NUMBER </item>
+ <item> GET-PARENT </item>
+ <item> GET-PREV </item>
+ <item> GET-PRINTERS </item>
+ <item> GET-QNAME-BY-INDEX </item>
+ <item> GET-RED-VALUE </item>
+ <item> GET-RELATION </item>
+ <item> GET-REPOSITIONED-ROW </item>
+ <item> GET-RGB-VALUE </item>
+ <item> GET-SELECTED-WIDGET </item>
+ <item> GET-SERIALIZED </item>
+ <item> GET-SIGNATURE </item>
+ <item> GET-SOCKET-OPTION </item>
+ <item> GET-SOURCE-BUFFER </item>
+ <item> GET-TAB-ITEM </item>
+ <item> GET-TEXT-HEIGHT-CHARS </item>
+ <item> GET-TEXT-HEIGHT-PIXELS </item>
+ <item> GET-TEXT-WIDTH-CHARS </item>
+ <item> GET-TEXT-WIDTH-PIXELS </item>
+ <item> GET-TOP-BUFFER </item>
+ <item> GET-TYPE-BY-INDEX </item>
+ <item> GET-TYPE-BY-NAMESPACE-NAME </item>
+ <item> GET-TYPE-BY-QNAME </item>
+ <item> GET-URI-BY-INDEX </item>
+ <item> GET-VALUE-BY-INDEX </item>
+ <item> GET-VALUE-BY-NAMESPACE-NAME </item>
+ <item> GET-VALUE-BY-QNAME </item>
+ <item> GET-WAIT-STATE </item>
+ <item> IMPORT-NODE </item>
+ <item> INDEX-INFORMATION </item>
+ <item> INITIALIZE-DOCUMENT-TYPE </item>
+ <item> INITIATE </item>
+ <item> INSERT </item>
+ <item> INSERT-BACKTAB </item>
+ <item> INSERT-BEFORE </item>
+ <item> INSERT-FILE </item>
+ <item> INSERT-ROW </item>
+ <item> INSERT-STRING </item>
+ <item> INSERT-TAB </item>
+ <item> INVOKE </item>
+ <item> IS-ROW-SELECTED </item>
+ <item> IS-SELECTED </item>
+ <item> LOAD </item>
+ <item> LoadControls </item>
+ <item> LOAD-ICON </item>
+ <item> LOAD-IMAGE </item>
+ <item> LOAD-IMAGE-DOWN </item>
+ <item> LOAD-IMAGE-INSENSITIVE </item>
+ <item> LOAD-IMAGE-UP </item>
+ <item> LOAD-MOUSE-POINTER </item>
+ <item> LOAD-SMALL-ICON </item>
+ <item> LONGCHAR-TO-NODE-VALUE </item>
+ <item> LOOKUP </item>
+ <item> MEMPTR-TO-NODE-VALUE </item>
+ <item> MERGE-CHANGES </item>
+ <item> MERGE-ROW-CHANGES </item>
+ <item> MOVE-AFTER-TAB-ITEM </item>
+ <item> MOVE-BEFORE-TAB-ITEM </item>
+ <item> MOVE-COLUMN </item>
+ <item> MOVE-TO-BOTTOM </item>
+ <item> MOVE-TO-EOF </item>
+ <item> MOVE-TO-TOP </item>
+ <item> NODE-VALUE-TO-LONGCHAR </item>
+ <item> NODE-VALUE-TO-MEMPTR </item>
+ <item> NORMALIZE </item>
+ <item> QUERY-CLOSE </item>
+ <item> QUERY-OPEN </item>
+ <item> QUERY-PREPARE </item>
+ <item> RAW-TRANSFER </item>
+ <item> READ </item>
+ <item> READ-FILE </item>
+ <item> REFRESH </item>
+ <item> REJECT-CHANGES </item>
+ <item> REJECT-ROW-CHANGES </item>
+ <item> REMOVE-ATTRIBUTE </item>
+ <item> REMOVE-CHILD </item>
+ <item> REMOVE-EVENTS-PROCEDURE </item>
+ <item> REMOVE-SUPER-PROCEDURE </item>
+ <item> REPLACE </item>
+ <item> REPLACE-CHILD </item>
+ <item> REPLACE-SELECTION-TEXT </item>
+ <item> REPOSITION-BACKWARD </item>
+ <item> REPOSITION-FORWARD </item>
+ <item> REPOSITION-TO-ROW </item>
+ <item> REPOSITION-TO-ROWID </item>
+ <item> SAVE </item>
+ <item> SAVE-FILE </item>
+ <item> SAVE-ROW-CHANGES </item>
+ <item> SAX-PARSE </item>
+ <item> SAX-PARSE-FIRST </item>
+ <item> SAX-PARSE-NEXT </item>
+ <item> SCROLL-TO-CURRENT-ROW </item>
+ <item> SCROLL-TO-ITEM </item>
+ <item> SCROLL-TO-SELECTED-ROW </item>
+ <item> SEARCH </item>
+ <item> SELECT-ALL </item>
+ <item> SELECT-FOCUSED-ROW </item>
+ <item> SELECT-NEXT-ROW </item>
+ <item> SELECT-PREV-ROW </item>
+ <item> SELECT-ROW </item>
+ <item> SET-ACTOR </item>
+ <item> SET-ATTRIBUTE </item>
+ <item> SET-ATTRIBUTE-NODE </item>
+ <item> SET-BLUE-VALUE </item>
+ <item> SET-BREAK </item>
+ <item> SET-BUFFERS </item>
+ <item> SET-CALLBACK-PROCEDURE </item>
+ <item> SET-COMMIT </item>
+ <item> SET-CONNECT-PROCEDURE </item>
+ <item> SET-DYNAMIC </item>
+ <item> SET-GREEN-VALUE </item>
+ <item> SET-INPUT-SOURCE </item>
+ <item> SET-MUST-UNDERSTAND </item>
+ <item> SET-NODE </item>
+ <item> SET-NUMERIC-FORMAT </item>
+ <item> SET-PARAMETER </item>
+ <item> SET-READ-RESPONSE-PROCEDURE </item>
+ <item> SET-RED-VALUE </item>
+ <item> SET-REPOSITIONED-ROW </item>
+ <item> SET-RGB-VALUE </item>
+ <item> SET-ROLLBACK </item>
+ <item> SET-SELECTION </item>
+ <item> SET-SERIALIZED </item>
+ <item> SET-SOCKET-OPTION </item>
+ <item> SET-WAIT-STATE </item>
+ <item> STOP-PARSING </item>
+ <item> SYNCHRONIZE </item>
+ <item> TEMP-TABLE-PREPARE </item>
+ <item> VALIDATE </item>
+ <item> WRITE </item>
+ <item> MAX-HEIGHT </item>
+ <item> MAX-WIDTH </item>
+
+</list>
+
+<list name="envvariables">
+ <item> CLASSPATH </item>
+ <item> DLC </item>
+ <item> EVTLEVEL </item>
+ <item> JDKCP </item>
+ <item> JDKHOME </item>
+ <item> JFCCP </item>
+ <item> JFHOME </item>
+ <item> JIT </item>
+ <item> JRECP </item>
+ <item> JREHOME </item>
+ <item> JVMEXE </item>
+ <item> PATH </item>
+ <item> PROCFG </item>
+ <item> PROCONV </item>
+ <item> PROEXE </item>
+ <item> PROGRESSCP </item>
+ <item> PROLOAD </item>
+ <item> PROMSGS </item>
+ <item> PROPATH </item>
+ <item> PROSRV </item>
+ <item> PROSTARTUP </item>
+ <item> PROTERMCAP </item>
+ <item> TERM </item>
+ <item> TERMINAL </item>
+ <item> GATEWAY_INTERFACE </item>
+ <item> SERVER_SOFTWARE </item>
+ <item> SERVER_PROTOCOL </item>
+ <item> SERVER_NAME </item>
+ <item> SERVER_PORT </item>
+ <item> REQUEST_METHOD </item>
+ <item> SCRIPT_NAME </item>
+ <item> PATH_INFO </item>
+ <item> PATH_TRANSLATED </item>
+ <item> QUERY_STRING </item>
+ <item> REMOTE_ADDR </item>
+ <item> REMOTE_IDENT </item>
+ <item> REMOTE_USER </item>
+ <item> AUTH_TYPE </item>
+ <item> REMOTE_HOST </item>
+ <item> CONTENT_TYPE </item>
+ <item> CONTENT_LENGTH </item>
+ <item> HTTP_ACCEPT </item>
+ <item> HTTP_COOKIE </item>
+ <item> HTTP_REFERER </item>
+ <item> HTTP_USER_AGENT </item>
+ <item> HTTP_REFERER </item>
+ <item> HTTPS </item>
+ <item> HTTP_REFERER </item>
+ <item> HOSTURL </item>
+ <item> SELFURL </item>
+ <item> APPPROGRAM </item>
+ <item> APPURL </item>
+ <item> APPPROGRAM </item>
+ <item> OUTPUT-CONTENT-TYPE </item>
+ <item> WEB_SRC_PATH </item>
+
+</list>
+
+
+<contexts>
+ <context name="Normal" attribute="Normal Text" lineEndContext="#stay">
+ <keyword attribute="Preprocvar" context="#stay" String="envvariables"/>
+ <keyword attribute="Data_Type" context="#stay" String="mytypes"/>
+ <keyword attribute="Operators" context="#stay" String="operators"/>
+ <keyword attribute="Preprocvar" context="#stay" String="preprocvar"/>
+ <keyword attribute="Phrases" context="#stay" String="phrases"/>
+ <keyword attribute="Function" context="#stay" String="functions"/>
+ <keyword attribute="Statements" context="#stay" String="statements"/>
+ <keyword attribute="Widgets" context="#stay" String="widgets"/>
+ <keyword attribute="Handles" context="#stay" String="handles"/>
+ <keyword attribute="Properties" context="#stay" String="properties"/>
+ <keyword attribute="Attributes" context="#stay" String="attributes"/>
+ <keyword attribute="Methods" context="#stay" String="methods"/>
+ <Int attribute="Integer" context="#stay"/>
+ <DetectChar attribute="String" context="String" char="'"/>
+ <Detect2Chars attribute="Comment" context="MultiLineComment"
+ char="/" char1="*" beginRegion="Comment"/>
+ <DetectChar attribute="Comment" context="Identifier" char='"'/>
+ <DetectChar attribute="String" context="#stay" char='"'/>
+ <DetectChar attribute="String" context="#stay" char="'"/>
+ <AnyChar attribute="Symbol" context="#stay" String="+-*=/\?~{}[]():."/>
+
+ <StringDetect attribute="Region Marker" context="#stay"
+ String="PROCEDURE" insensitive="TRUE"
+ beginRegion="P1" firstNonSpace="TRUE"/>
+ <StringDetect attribute="Region Marker" context="#stay"
+ String="END PROCEDURE" insensitive="TRUE"
+ endRegion="P1" firstNonSpace="TRUE"/>
+
+ <StringDetect attribute="Region Marker" context="#stay"
+ String="FUNCTION" insensitive="TRUE"
+ beginRegion="F1" firstNonSpace="TRUE"/>
+ <StringDetect attribute="Region Marker" context="#stay"
+ String="END FUNCTION" insensitive="TRUE"
+ endRegion="F1" firstNonSpace="TRUE"/>
+
+ <StringDetect attribute="Region Marker" context="#stay"
+ String="CLASS" insensitive="TRUE"
+ beginRegion="C1" firstNonSpace="TRUE"/>
+ <StringDetect attribute="Region Marker" context="#stay"
+ String="END CLASS" insensitive="TRUE"
+ endRegion="C1" firstNonSpace="TRUE"/>
+
+ <StringDetect attribute="Region Marker" context="#stay"
+ String="METHOD" insensitive="TRUE"
+ beginRegion="M1" firstNonSpace="TRUE"/>
+ <StringDetect attribute="Region Marker" context="#stay"
+ String="END METHOD" insensitive="TRUE"
+ endRegion="M1" firstNonSpace="TRUE"/>
+ <StringDetect attribute="Region Marker" context="#stay"
+ String="CONSTRUCTOR" insensitive="TRUE"
+ beginRegion="CN1" firstNonSpace="TRUE"/>
+ <StringDetect attribute="Region Marker" context="#stay"
+ String="END CONSTRUCTOR" insensitive="TRUE"
+ endRegion="CN1" firstNonSpace="TRUE"/>
+
+ <StringDetect attribute="Function" context="#stay"
+ String="DO:" insensitive="TRUE"
+ beginRegion="L1" firstNonSpace="FALSE"/>
+ <StringDetect attribute="Function" context="#stay"
+ String="REPEAT" insensitive="TRUE"
+ beginRegion="L1" firstNonSpace="TRUE"/>
+ <StringDetect attribute="Function" context="#stay"
+ String="FOR" insensitive="TRUE"
+ beginRegion="L1" firstNonSpace="TRUE"/>
+ <StringDetect attribute="Function" context="#stay"
+ String="CASE" insensitive="TRUE"
+ beginRegion="L1" firstNonSpace="TRUE"/>
+ <StringDetect attribute="Function" context="#stay"
+ String="END" insensitive="TRUE"
+ endRegion="L1" firstNonSpace="TRUE"/>
+
+
+ </context>
+ <context name="String" attribute="String" lineEndContext="#stay">
+ <LineContinue attribute="String" context="#pop"/>
+ <HlCStringChar attribute="String Char" context="#stay"/>
+ <DetectChar attribute="String" context="#pop" char="'"/>
+ </context>
+ <context name="MultiLineComment" attribute="Comment"
+ lineEndContext="#stay">
+ <LineContinue attribute="Comment" context="#pop"/>
+ <Detect2Chars attribute="Comment" context="#pop" char="*" char1="/"
+ endRegion="Comment"/>
+ <IncludeRules context="##Alerts" />
+ </context>
+ <context name="Identifier" attribute="Identifier" lineEndContext="#pop">
+ <DetectChar attribute="Identifier" context="#pop" char='"'/>
+ </context>
+</contexts>
+ <itemDatas>
+ <itemData name="Phrases" defStyleNum="dsKeyword"/>
+ <itemData name="Statements" defStyleNum="dsKeyword"/>
+ <itemData name="Widgets" defStyleNum="dsKeyword"/>
+ <itemData name="Handles" defStyleNum="dsDecVal"/>
+ <itemData name="Properties" defStyleNum="dsOthers"/>
+ <itemData name="Attributes" defStyleNum="dsDataType"/>
+ <itemData name="Methods" defStyleNum="dsOthers"/>
+ <itemData name="Function" defStyleNum="dsFunction"/>
+ <itemData name="Normal Text" defStyleNum="dsNormal"/>
+ <itemData name="Decimal" defStyleNum="dsDecVal"/>
+ <itemData name="Integer" defStyleNum="dsBaseN"/>
+ <itemData name="String" defStyleNum="dsString"/>
+ <itemData name="String Char" defStyleNum="dsChar"/>
+ <itemData name="Comment" defStyleNum="dsComment"/>
+ <itemData name="Identifier" defStyleNum="dsOthers"/>
+ <itemData name="Symbol" defStyleNum="dsChar"/>
+ <itemData name="Data_Type" defStyleNum="dsDataType"/>
+ <itemData name="Preprocvar" defStyleNum="dsChar"/>
+ <itemData name="Operators" defStyleNum="dsDecVal"/>
+ <itemData name="Alert" defStyleNum="dsAlert"/>
+ <itemData name="Region Marker" defStyleNum="dsRegionMarker"/>
+ </itemDatas>
+</highlighting>
+ <general>
+ <comments>
+ <comment name="multiLine" start="/*" end="*/"/>
+ </comments>
+ <keywords casesensitive="0" weakDeliminator="-" />
+ </general>
+</language>
diff --git a/kate/data/prolog.xml b/kate/data/prolog.xml
new file mode 100644
index 000000000..2f6e468bf
--- /dev/null
+++ b/kate/data/prolog.xml
@@ -0,0 +1,230 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+<language name="Prolog" version="1.04" kateversion="2.1" section="Sources" extensions="*.prolog" mimetype="text/x-prolog">
+ <highlighting>
+ <list name="keywordl">
+ <item> abstract </item>
+ <item> align </item>
+ <item> as </item>
+ <item> and </item>
+ <item> class </item>
+ <item> clauses </item>
+ <item> constants </item>
+ <item> database </item>
+ <item> determ </item>
+ <item> domains </item>
+ <item> elsedef </item>
+ <item> endclass </item>
+ <item> enddef </item>
+ <item> erroneous </item>
+ <item> facts </item>
+ <item> failure </item>
+ <item> global </item>
+ <item> goal </item>
+ <item> if </item>
+ <item> ifdef </item>
+ <item> ifndef </item>
+ <item> implement </item>
+ <item> include </item>
+ <item> language </item>
+ <item> multi </item>
+ <item> nocopy </item>
+ <item> nondeterm </item>
+ <item> object </item>
+ <item> or </item>
+ <item> procedure </item>
+ <item> protected </item>
+ <item> predicates </item>
+ <item> reference </item>
+ <item> single </item>
+ <item> static </item>
+ <item> struct </item>
+ <item> this </item>
+ </list>
+
+ <list name="keywordu">
+ <item> ABSTRACT </item>
+ <item> ALIGN </item>
+ <item> AS </item>
+ <item> AND </item>
+ <item> CLASS </item>
+ <item> CLAUSES </item>
+ <item> CONSTANTS </item>
+ <item> DATABASE </item>
+ <item> DETERM </item>
+ <item> DOMAINS </item>
+ <item> ELSEDEF </item>
+ <item> ENDCLASS </item>
+ <item> ENDDEF </item>
+ <item> ERRONEOUS </item>
+ <item> FACTS </item>
+ <item> FAILURE </item>
+ <item> GLOBAL </item>
+ <item> GOAL </item>
+ <item> IF </item>
+ <item> IFDEF </item>
+ <item> IFNDEF </item>
+ <item> IMPLEMENT </item>
+ <item> INCLUDE </item>
+ <item> LANGUAGE </item>
+ <item> MULTI </item>
+ <item> NOCOPY </item>
+ <item> NONDETERM </item>
+ <item> OBJECT </item>
+ <item> OR </item>
+ <item> PROCEDURE </item>
+ <item> PROTECTED </item>
+ <item> PREDICATES </item>
+ <item> REFERENCE </item>
+ <item> SINGLE </item>
+ <item> STATIC </item>
+ <item> STRUCT </item>
+ <item> THIS </item>
+ </list>
+
+
+ <list name="special">
+ <item> assert </item>
+ <item> asserta </item>
+ <item> assertz </item>
+ <item> bound </item>
+ <item> chain_inserta </item>
+ <item> chain_insertafter </item>
+ <item> chain_insertz </item>
+ <item> chain_terms </item>
+ <item> consult </item>
+ <item> db_btrees </item>
+ <item> db_chains </item>
+ <item> fail </item>
+ <item> findall </item>
+ <item> format </item>
+ <item> free </item>
+ <item> msgrecv </item>
+ <item> msgsend </item>
+ <item> nl </item>
+ <item> not </item>
+ <item> readterm </item>
+ <item> ref_term </item>
+ <item> retract </item>
+ <item> retractall </item>
+ <item> save </item>
+ <item> term_bin </item>
+ <item> term_replace </item>
+ <item> term_str </item>
+ <item> trap </item>
+ <item> write </item>
+ <item> writef </item>
+ </list>
+
+ <list name="compiler">
+ <item> bgidriver </item>
+ <item> bgifont </item>
+ <item> check_determ </item>
+ <item> code </item>
+ <item> config </item>
+ <item> diagnostics </item>
+ <item> error </item>
+ <item> errorlevel </item>
+ <item> heap </item>
+ <item> gstacksize </item>
+ <item> nobreak </item>
+ <item> nowarnings </item>
+ <item> printermenu </item>
+ <item> project </item>
+ </list>
+
+ <list name="arith">
+ <item> mod </item>
+ <item> div </item>
+ <item> abs </item>
+ <item> exp </item>
+ <item> ln </item>
+ <item> log </item>
+ <item> sqrt </item>
+ <item> round </item>
+ <item> trunc </item>
+ <item> val </item>
+ <item> cos </item>
+ <item> sin </item>
+ <item> tan </item>
+ <item> arctan </item>
+ <item> random </item>
+ <item> randominit </item>
+ </list>
+
+ <list name="basetype">
+ <item> char </item>
+ <item> real </item>
+ <item> string </item>
+ <item> symbol </item>
+ <item> byte </item>
+ <item> sbyte </item>
+ <item> short </item>
+ <item> ushort </item>
+ <item> word </item>
+ <item> integer </item>
+ <item> unsigned </item>
+ <item> dword </item>
+ <item> long </item>
+ <item> ulong </item>
+ <item> binary </item>
+ <item> ref </item>
+ </list>
+
+ <list name="keywords">
+ <item> true </item>
+ <item> false </item>
+ </list>
+
+ <contexts>
+ <context name="normal" attribute="Symbol" lineEndContext="#stay">
+ <keyword attribute="Keyword" context="#stay" String="keywordl"/>
+ <keyword attribute="Keyword" context="#stay" String="keywordu"/>
+ <keyword attribute="Arithmetic" context="#stay" String="arith"/>
+ <keyword attribute="Keyword" context="#stay" String="compiler"/>
+ <keyword attribute="Keyword" context="#stay" String="special"/>
+ <keyword attribute="Data Type" context="#stay" String="basetype"/>
+ <RegExpr String = "[A-Z_][A-Za-z0-9_]*" attribute = "Variable" context="#stay"/>
+ <RegExpr String = "[a-z][A-Za-z0-9_]*" attribute = "Identifier" context="#stay"/>
+ <DetectChar attribute="Comment" context="comment" char="%"/>
+ <Detect2Chars attribute="Comment" context="comment region" char="/" char1="*"/>
+ <Int attribute="Integer" context="#stay" />
+ <DetectChar attribute="String" context="string" char="&quot;" />
+ <DetectChar attribute="String" context="string2" char="'" />
+ <AnyChar attribute="Symbol" context="#stay" String="~!^*()-+=[]|\:;,./?&amp;&lt;&gt;" />
+ </context>
+ <context name="comment" attribute="Comment" lineEndContext="#pop" />
+ <context name="string" attribute="String" lineEndContext="#stay" >
+ <DetectChar attribute="String" context="#pop" char="&quot;" />
+ </context>
+ <context name="string2" attribute="String" lineEndContext="#stay">
+ <DetectChar attribute="String" context="#pop" char="'" />
+ </context>
+ <context name="comment region" attribute="Comment" lineEndContext="#stay">
+ <Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" />
+ </context>
+ </contexts>
+ <itemDatas>
+ <itemData name="Normal Text" defStyleNum="dsNormal" />
+ <itemData name="Keyword" defStyleNum="dsKeyword" />
+ <itemData name="Data Type" defStyleNum="dsDataType" />
+ <itemData name="Comment" defStyleNum="dsComment" />
+ <itemData name="Integer" defStyleNum="dsDecVal" />
+ <itemData name="Symbol" defStyleNum="dsNormal" />
+ <itemData name="String" defStyleNum="dsString"/>
+ <itemData name="Identifier" defStyleNum="dsNormal"/>
+ <itemData name="Variable" defStyleNum="dsOthers"/>
+ <itemData name="Arithmetic" defStyleNum="dsKeyword" />
+
+ </itemDatas>
+ </highlighting>
+ <general>
+ <keywords casesensitive="1" />
+ <comments>
+ <comment name="singleLine" start="%" />
+ <comment name="multiLine" start="/*" end="*/" />
+ </comments>
+
+ </general>
+</language>
+
diff --git a/kate/data/purebasic.xml b/kate/data/purebasic.xml
new file mode 100644
index 000000000..b38daa56b
--- /dev/null
+++ b/kate/data/purebasic.xml
@@ -0,0 +1,918 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+<language name="PureBasic" version="3.91" kateversion="2.3" section="Sources" extensions="*.pb" mimetype="text/x-purebasic" author="Sven Langenkamp (ace@kylixforum.de)" license="LGPL">
+ <highlighting>
+ <list name="keywords">
+ <item> For </item>
+ <item> ForEach </item>
+ <item> To </item>
+ <item> Step </item>
+ <item> Next </item>
+ <item> Break </item>
+ <item> Continue </item>
+ <item> If </item>
+ <item> Else </item>
+ <item> ElseIf </item>
+ <item> EndIf </item>
+ <item> Debug </item>
+ <item> Repeat </item>
+ <item> Until </item>
+ <item> Select </item>
+ <item> Case </item>
+ <item> Default </item>
+ <item> EndSelect </item>
+ <item> While </item>
+ <item> Wend </item>
+ <item> End </item>
+ <item> Structure </item>
+ <item> EndStructure </item>
+ <item> Interface </item>
+ <item> EndInterface </item>
+ <item> Extends </item>
+ <item> DefType </item>
+ <item> Dim </item>
+ <item> Enumeration </item>
+ <item> EndEnumeration </item>
+ <item> Global </item>
+ <item> Procedure </item>
+ <item> EndProcedure </item>
+ <item> ProcedureReturn </item>
+ <item> Shared </item>
+ <item> Protected </item>
+ <item> Static </item>
+ <item> Declare </item>
+ <item> DataSection </item>
+ <item> EndDataSection </item>
+ <item> Data </item>
+ <item> Restore </item>
+ <item> Read </item>
+ <item> IncludeFile </item>
+ <item> XIncludeFile </item>
+ <item> IncludeBinary </item>
+ <item> IncludePath </item>
+ <item> CompilerIf </item>
+ <item> CompilerElse </item>
+ <item> CompilerEndIf </item>
+ <item> CompilerSelect </item>
+ <item> CompilerCase </item>
+ <item> CompilerDefault </item>
+ <item> CompilerEndSelect </item>
+ <item> ProcedureDLL </item>
+ <item> NewList </item>
+ <item> Goto </item>
+ <item> Gosub </item>
+ <item> Return </item>
+ <item> FakeReturn </item>
+ </list>
+ <list name="functions">
+ <item> Abs </item>
+ <item> ACos </item>
+ <item> ActivateGadget </item>
+ <item> ActivateRichEdit </item>
+ <item> ActivateWindow </item>
+ <item> Add3DArchive </item>
+ <item> AddBillboard </item>
+ <item> AddDate </item>
+ <item> AddElement </item>
+ <item> AddGadgetColumn </item>
+ <item> AddGadgetItem </item>
+ <item> AddKeyboardShortcut </item>
+ <item> AddMaterialLayer </item>
+ <item> AddPackFile </item>
+ <item> AddPackMemory </item>
+ <item> AddStatusBarField </item>
+ <item> AddSysTrayIcon </item>
+ <item> AdvancedGadgetEvents </item>
+ <item> AllocateMemory </item>
+ <item> AmbientColor </item>
+ <item> AnimateEntity </item>
+ <item> Asc </item>
+ <item> ASin </item>
+ <item> ATan </item>
+ <item> AvailableScreenMemory </item>
+ <item> BackColor </item>
+ <item> Base64Encoder </item>
+ <item> BillboardGroupLocate </item>
+ <item> BillboardGroupMaterial </item>
+ <item> BillboardGroupX </item>
+ <item> BillboardGroupY </item>
+ <item> BillboardGroupZ </item>
+ <item> BillboardHeight </item>
+ <item> BillboardLocate </item>
+ <item> BillboardWidth </item>
+ <item> BillboardX </item>
+ <item> BillboardY </item>
+ <item> BillboardZ </item>
+ <item> Bin </item>
+ <item> Blue </item>
+ <item> Box </item>
+ <item> ButtonGadget </item>
+ <item> ButtonImageGadget </item>
+ <item> CallCFunctionFast </item>
+ <item> CallCFunction </item>
+ <item> CallCOM </item>
+ <item> CallDX </item>
+ <item> CallFunctionFast </item>
+ <item> CallFunction </item>
+ <item> CameraBackColor </item>
+ <item> CameraFOV </item>
+ <item> CameraLocate </item>
+ <item> CameraLookAt </item>
+ <item> CameraProjection </item>
+ <item> CameraRange </item>
+ <item> CameraRenderMode </item>
+ <item> CameraX </item>
+ <item> CameraY </item>
+ <item> CameraZ </item>
+ <item> CatchImage </item>
+ <item> CatchSound </item>
+ <item> CatchSprite </item>
+ <item> CDAudioLength </item>
+ <item> CDAudioName </item>
+ <item> CDAudioStatus </item>
+ <item> CDAudioTrackLength </item>
+ <item> CDAudioTrackSeconds </item>
+ <item> CDAudioTracks </item>
+ <item> ChangeAlphaIntensity </item>
+ <item> ChangeAlphaIntensity </item>
+ <item> ChangeCurrentElement </item>
+ <item> ChangeGamma </item>
+ <item> ChangeListIconGadgetDisplay </item>
+ <item> ChangeRichEditOptions </item>
+ <item> ChangeSysTrayIcon </item>
+ <item> CheckBoxGadget </item>
+ <item> Chr </item>
+ <item> Circle </item>
+ <item> ClearBillboards </item>
+ <item> ClearClipboard </item>
+ <item> ClearConsole </item>
+ <item> ClearError </item>
+ <item> ClearGadgetItemList </item>
+ <item> ClearList </item>
+ <item> ClearScreen </item>
+ <item> ClipSprite </item>
+ <item> CloseConsole </item>
+ <item> CloseDatabase </item>
+ <item> CloseFile </item>
+ <item> CloseFont </item>
+ <item> CloseGadgetList </item>
+ <item> CloseHelp </item>
+ <item> CloseLibrary </item>
+ <item> CloseNetworkConnection </item>
+ <item> CloseNetworkServer </item>
+ <item> ClosePack </item>
+ <item> ClosePreferences </item>
+ <item> CloseRichEdit </item>
+ <item> CloseScreen </item>
+ <item> CloseSubMenu </item>
+ <item> CloseTreeGadgetNode </item>
+ <item> CloseWindow </item>
+ <item> ColorRequester </item>
+ <item> ComboBoxGadget </item>
+ <item> CompareMemory </item>
+ <item> CompareMemoryString </item>
+ <item> ConsoleColor </item>
+ <item> ConsoleCursor </item>
+ <item> ConsoleLocate </item>
+ <item> ConsoleTitle </item>
+ <item> ContainerGadget </item>
+ <item> CopyDirectory </item>
+ <item> CopyEntity </item>
+ <item> CopyFile </item>
+ <item> CopyImage </item>
+ <item> CopyLight </item>
+ <item> CopyMaterial </item>
+ <item> CopyMemory </item>
+ <item> CopyMemoryString </item>
+ <item> CopyMesh </item>
+ <item> CopySprite </item>
+ <item> CopyTexture </item>
+ <item> Cos </item>
+ <item> CountBillboards </item>
+ <item> CountGadgetItems </item>
+ <item> CountLibraryFunctions </item>
+ <item> CountList </item>
+ <item> CountMaterialLayers </item>
+ <item> CountRenderedTriangles </item>
+ <item> CountString </item>
+ <item> CountTreeGadgetNodeItems </item>
+ <item> CRC32Fingerprint </item>
+ <item> CreateBillboardGroup </item>
+ <item> CreateCamera </item>
+ <item> CreateDirectory </item>
+ <item> CreateEntity </item>
+ <item> CreateFile </item>
+ <item> CreateGadgetList </item>
+ <item> CreateImage </item>
+ <item> CreateLight </item>
+ <item> CreateMaterial </item>
+ <item> CreateMenu </item>
+ <item> CreateMesh </item>
+ <item> CreateNetworkServer </item>
+ <item> CreatePack </item>
+ <item> CreatePalette </item>
+ <item> CreateParticleEmitter </item>
+ <item> CreatePopupMenu </item>
+ <item> CreatePreferences </item>
+ <item> CreateSprite3D </item>
+ <item> CreateSprite </item>
+ <item> CreateStatusBar </item>
+ <item> CreateTerrain </item>
+ <item> CreateTexture </item>
+ <item> CreateThread </item>
+ <item> CreateToolBar </item>
+ <item> DatabaseColumnName </item>
+ <item> DatabaseColumns </item>
+ <item> DatabaseColumnType </item>
+ <item> DatabaseDriverDescription </item>
+ <item> DatabaseDriverName </item>
+ <item> DatabaseError </item>
+ <item> DatabaseQuery </item>
+ <item> DatabaseUpdate </item>
+ <item> Date </item>
+ <item> Day </item>
+ <item> DayOfWeek </item>
+ <item> DayOfYear </item>
+ <item> DefaultPrinter </item>
+ <item> Delay </item>
+ <item> DeleteDirectory </item>
+ <item> DeleteElement </item>
+ <item> DeleteFile </item>
+ <item> DESFingerprint </item>
+ <item> DetachMenu </item>
+ <item> DirectoryEntryAttributes </item>
+ <item> DirectoryEntryAttributes </item>
+ <item> DirectoryEntryName </item>
+ <item> DirectoryEntrySize </item>
+ <item> DisableGadget </item>
+ <item> DisableMaterialLighting </item>
+ <item> DisableMenuItem </item>
+ <item> DisableToolBarButton </item>
+ <item> DisASMCommand </item>
+ <item> DisplayAlphaSprite </item>
+ <item> DisplayAlphaSprite </item>
+ <item> DisplayPalette </item>
+ <item> DisplayPopupMenu </item>
+ <item> DisplayRGBFilter </item>
+ <item> DisplayShadowSprite </item>
+ <item> DisplayShadowSprite </item>
+ <item> DisplaySolidSprite </item>
+ <item> DisplaySprite3D </item>
+ <item> DisplaySprite </item>
+ <item> DisplayTranslucideSprite </item>
+ <item> DisplayTransparentSprite </item>
+ <item> DrawImage </item>
+ <item> DrawingBuffer </item>
+ <item> DrawingBufferPitch </item>
+ <item> DrawingBufferPixelFormat </item>
+ <item> DrawingFont </item>
+ <item> DrawingMode </item>
+ <item> DrawText </item>
+ <item> EditorGadget </item>
+ <item> EjectCDAudio </item>
+ <item> ElapsedMilliseconds </item>
+ <item> Ellipse </item>
+ <item> EndTimer </item>
+ <item> Engine3DFrameRate </item>
+ <item> EntityAnimationLength </item>
+ <item> EntityLocate </item>
+ <item> EntityMaterial </item>
+ <item> EntityMesh </item>
+ <item> EntityX </item>
+ <item> EntityY </item>
+ <item> EntityZ </item>
+ <item> Eof </item>
+ <item> EventGadgetID </item>
+ <item> EventlParam </item>
+ <item> EventMenuID </item>
+ <item> EventType </item>
+ <item> EventWindowID </item>
+ <item> EventwParam </item>
+ <item> ExamineDatabaseDrivers </item>
+ <item> ExamineDirectory </item>
+ <item> ExamineIPAddresses </item>
+ <item> ExamineJoystick </item>
+ <item> ExamineKeyboard </item>
+ <item> ExamineLibraryFunctions </item>
+ <item> ExamineMouse </item>
+ <item> ExamineScreenModes </item>
+ <item> ExplorerComboGadget </item>
+ <item> ExplorerListGadget </item>
+ <item> ExplorerTreeGadget </item>
+ <item> FileSeek </item>
+ <item> FileSize </item>
+ <item> FillArea </item>
+ <item> FindString </item>
+ <item> FindText </item>
+ <item> FirstDatabaseRow </item>
+ <item> FirstElement </item>
+ <item> FlipBuffers </item>
+ <item> Fog </item>
+ <item> FontDialog </item>
+ <item> FontID </item>
+ <item> FontRequester </item>
+ <item> FormatDate </item>
+ <item> Frame3DGadget </item>
+ <item> FreeBillboardGroup </item>
+ <item> FreeCamera </item>
+ <item> FreeEntity </item>
+ <item> FreeGadget </item>
+ <item> FreeImage </item>
+ <item> FreeLight </item>
+ <item> FreeMaterial </item>
+ <item> FreeMemory </item>
+ <item> FreeMenu </item>
+ <item> FreeMesh </item>
+ <item> FreeModule </item>
+ <item> FreeMovie </item>
+ <item> FreePalette </item>
+ <item> FreeParticleEmitter </item>
+ <item> FreeSound </item>
+ <item> FreeSprite3D </item>
+ <item> FreeSprite </item>
+ <item> FreeStatusBar </item>
+ <item> FreeTexture </item>
+ <item> FreeToolBar </item>
+ <item> FrontColor </item>
+ <item> GadgetHeight </item>
+ <item> GadgetID </item>
+ <item> GadgetItemID </item>
+ <item> GadgetToolTip </item>
+ <item> GadgetWidth </item>
+ <item> GadgetX </item>
+ <item> GadgetY </item>
+ <item> GetClipboardData </item>
+ <item> GetClipboardText </item>
+ <item> GetCurrentEIP </item>
+ <item> GetDatabaseFloat </item>
+ <item> GetDatabaseLong </item>
+ <item> GetDatabaseString </item>
+ <item> GetDisASMString </item>
+ <item> GetEntityAnimationTime </item>
+ <item> GetErrorAddress </item>
+ <item> GetErrorCounter </item>
+ <item> GetErrorDescription </item>
+ <item> GetErrorDLL </item>
+ <item> GetErrorLineNR </item>
+ <item> GetErrorModuleName </item>
+ <item> GetErrorNumber </item>
+ <item> GetErrorRegister </item>
+ <item> GetExtensionPart </item>
+ <item> GetFilePart </item>
+ <item> GetGadgetAttribute </item>
+ <item> GetGadgetItemAttribute </item>
+ <item> GetGadgetItemState </item>
+ <item> GetGadgetItemText </item>
+ <item> GetGadgetState </item>
+ <item> GetGadgetText </item>
+ <item> GetMaxTimerResolution </item>
+ <item> GetMenuItemState </item>
+ <item> GetMinTimerResolution </item>
+ <item> GetModulePosition </item>
+ <item> GetModuleRow </item>
+ <item> GetPaletteColor </item>
+ <item> GetPathPart </item>
+ <item> GetRichEditStyle </item>
+ <item> GetRichEditText </item>
+ <item> GetSelectedText </item>
+ <item> GetWindowTitle </item>
+ <item> GoToEIP </item>
+ <item> GrabImage </item>
+ <item> GrabSprite </item>
+ <item> Green </item>
+ <item> Hex </item>
+ <item> HideBillboardGroup </item>
+ <item> HideEntity </item>
+ <item> HideGadget </item>
+ <item> HideLight </item>
+ <item> HideMenu </item>
+ <item> HideParticleEmitter </item>
+ <item> HideWindow </item>
+ <item> Hostname </item>
+ <item> Hour </item>
+ <item> HyperLinkGadget </item>
+ <item> ImageDepth </item>
+ <item> ImageGadget </item>
+ <item> ImageHeight </item>
+ <item> ImageID </item>
+ <item> ImageOutput </item>
+ <item> ImageWidth </item>
+ <item> InitCDAudio </item>
+ <item> InitDatabase </item>
+ <item> InitEngine3D </item>
+ <item> InitJoystick </item>
+ <item> InitKeyboard </item>
+ <item> InitModule </item>
+ <item> InitMouse </item>
+ <item> InitMovie </item>
+ <item> InitNetwork </item>
+ <item> InitPalette </item>
+ <item> InitSound </item>
+ <item> InitSprite3D </item>
+ <item> InitSprite </item>
+ <item> Inkey </item>
+ <item> Input </item>
+ <item> InputRequester </item>
+ <item> InsertElement </item>
+ <item> Int </item>
+ <item> IPAddressField </item>
+ <item> IPAddressGadget </item>
+ <item> IPString </item>
+ <item> IPString </item>
+ <item> IsDatabase </item>
+ <item> IsDirectory </item>
+ <item> IsFile </item>
+ <item> IsFilename </item>
+ <item> IsFont </item>
+ <item> IsFunctionEntry </item>
+ <item> IsFunction </item>
+ <item> IsGadget </item>
+ <item> IsImage </item>
+ <item> IsLibrary </item>
+ <item> IsMenu </item>
+ <item> IsModule </item>
+ <item> IsMovie </item>
+ <item> IsPalette </item>
+ <item> IsScreenActive </item>
+ <item> IsSprite3D </item>
+ <item> IsSprite </item>
+ <item> IsStatusBar </item>
+ <item> IsSysTrayIcon </item>
+ <item> IsToolBar </item>
+ <item> IsWindow </item>
+ <item> JoystickAxisX </item>
+ <item> JoystickAxisY </item>
+ <item> JoystickButton </item>
+ <item> KeyboardInkey </item>
+ <item> KeyboardMode </item>
+ <item> KeyboardPushed </item>
+ <item> KeyboardReleased </item>
+ <item> KillThread </item>
+ <item> LastElement </item>
+ <item> LCase </item>
+ <item> Left </item>
+ <item> Len </item>
+ <item> LibraryFunctionAddress </item>
+ <item> LibraryFunctionName </item>
+ <item> LightColor </item>
+ <item> LightLocate </item>
+ <item> LightSpecularColor </item>
+ <item> Line </item>
+ <item> LineXY </item>
+ <item> ListIconGadget </item>
+ <item> ListIndex </item>
+ <item> ListViewGadget </item>
+ <item> LoadFont </item>
+ <item> LoadImage </item>
+ <item> LoadMesh </item>
+ <item> LoadModule </item>
+ <item> LoadMovie </item>
+ <item> LoadPalette </item>
+ <item> LoadSound </item>
+ <item> LoadSprite </item>
+ <item> LoadTexture </item>
+ <item> LoadWorld </item>
+ <item> Locate </item>
+ <item> Loc </item>
+ <item> Lof </item>
+ <item> Log10 </item>
+ <item> Log </item>
+ <item> LSet </item>
+ <item> LTrim </item>
+ <item> MakeIPAddress </item>
+ <item> MakeIPAddress </item>
+ <item> MaterialAmbientColor </item>
+ <item> MaterialBlendingMode </item>
+ <item> MaterialDiffuseColor </item>
+ <item> MaterialFilteringMode </item>
+ <item> MaterialID </item>
+ <item> MaterialShadingMode </item>
+ <item> MaterialSpecularColor </item>
+ <item> MD5FileFingerprint </item>
+ <item> MD5Fingerprint </item>
+ <item> MDIGadget </item>
+ <item> MemoryStringLength </item>
+ <item> MenuBar </item>
+ <item> MenuHeight </item>
+ <item> MenuID </item>
+ <item> MenuItem </item>
+ <item> MenuTitle </item>
+ <item> MeshID </item>
+ <item> MessageRequester </item>
+ <item> Mid </item>
+ <item> Minute </item>
+ <item> ModuleVolume </item>
+ <item> Month </item>
+ <item> MouseButton </item>
+ <item> MouseDeltaX </item>
+ <item> MouseDeltaY </item>
+ <item> MouseLocate </item>
+ <item> MouseWheel </item>
+ <item> MouseX </item>
+ <item> MouseY </item>
+ <item> MoveBillboardGroup </item>
+ <item> MoveBillboard </item>
+ <item> MoveCamera </item>
+ <item> MoveEntity </item>
+ <item> MoveLight </item>
+ <item> MoveParticleEmitter </item>
+ <item> MoveWindow </item>
+ <item> MovieAudio </item>
+ <item> MovieHeight </item>
+ <item> MovieInfo </item>
+ <item> MovieLength </item>
+ <item> MovieSeek </item>
+ <item> MovieStatus </item>
+ <item> MovieWidth </item>
+ <item> NetworkClientEvent </item>
+ <item> NetworkClientID </item>
+ <item> NetworkServerEvent </item>
+ <item> NewPrinterPage </item>
+ <item> NextDatabaseDriver </item>
+ <item> NextDatabaseRow </item>
+ <item> NextDirectoryEntry </item>
+ <item> NextElement </item>
+ <item> NextIPAddress </item>
+ <item> NextLibraryFunction </item>
+ <item> NextPackFile </item>
+ <item> NextScreenMode </item>
+ <item> NextSelectedFileName </item>
+ <item> OffsetOf </item>
+ <item> OnErrorExit </item>
+ <item> OnErrorGosub </item>
+ <item> OnErrorGoto </item>
+ <item> OnErrorResume </item>
+ <item> OpenComPort </item>
+ <item> OpenConsole </item>
+ <item> OpenDatabase </item>
+ <item> OpenDatabaseRequester </item>
+ <item> OpenFile </item>
+ <item> OpenFileRequester </item>
+ <item> OpenGadgetList </item>
+ <item> OpenHelp </item>
+ <item> OpenLibrary </item>
+ <item> OpenNetworkConnection </item>
+ <item> OpenPack </item>
+ <item> OpenPreferences </item>
+ <item> OpenRichEdit </item>
+ <item> OpenScreen </item>
+ <item> OpenSubMenu </item>
+ <item> OpenTreeGadgetNode </item>
+ <item> OpenWindowedScreen </item>
+ <item> OpenWindow </item>
+ <item> OptionGadget </item>
+ <item> OSVersion </item>
+ <item> PackerCallback </item>
+ <item> PackFileSize </item>
+ <item> PackMemory </item>
+ <item> PanelGadget </item>
+ <item> ParseDate </item>
+ <item> ParticleColorFader </item>
+ <item> ParticleColorRange </item>
+ <item> ParticleEmissionRate </item>
+ <item> ParticleEmitterLocate </item>
+ <item> ParticleEmitterX </item>
+ <item> ParticleEmitterY </item>
+ <item> ParticleEmitterZ </item>
+ <item> ParticleMaterial </item>
+ <item> ParticleSize </item>
+ <item> ParticleTimeToLive </item>
+ <item> ParticleVelocity </item>
+ <item> PathRequester </item>
+ <item> PauseCDAudio </item>
+ <item> PauseMovie </item>
+ <item> PauseThread </item>
+ <item> PeekB </item>
+ <item> PeekF </item>
+ <item> PeekL </item>
+ <item> PeekS </item>
+ <item> PeekW </item>
+ <item> PlayCDAudio </item>
+ <item> PlayModule </item>
+ <item> PlayMovie </item>
+ <item> PlaySound </item>
+ <item> Plot </item>
+ <item> Point </item>
+ <item> PokeB </item>
+ <item> PokeF </item>
+ <item> PokeL </item>
+ <item> PokeS </item>
+ <item> PokeW </item>
+ <item> Pow </item>
+ <item> PreferenceComment </item>
+ <item> PreferenceGroup </item>
+ <item> PreviousDatabaseRow </item>
+ <item> PreviousElement </item>
+ <item> PrinterOutput </item>
+ <item> PrinterPageHeight </item>
+ <item> PrinterPageWidth </item>
+ <item> Print </item>
+ <item> PrintN </item>
+ <item> PrintRequester </item>
+ <item> ProgramParameter </item>
+ <item> ProgressBarGadget </item>
+ <item> Random </item>
+ <item> RandomSeed </item>
+ <item> ReadByte </item>
+ <item> ReadData </item>
+ <item> ReadFile </item>
+ <item> ReadFloat </item>
+ <item> ReadLong </item>
+ <item> ReadPreferenceFloat </item>
+ <item> ReadPreferenceLong </item>
+ <item> ReadPreferenceString </item>
+ <item> ReadString </item>
+ <item> ReadWord </item>
+ <item> ReAllocateMemory </item>
+ <item> ReceiveNetworkData </item>
+ <item> ReceiveNetworkFile </item>
+ <item> Red </item>
+ <item> ReleaseMouse </item>
+ <item> RemoveBillboard </item>
+ <item> RemoveGadgetColumn </item>
+ <item> RemoveGadgetItem </item>
+ <item> RemoveKeyboardShortcut </item>
+ <item> RemoveMaterialLayer </item>
+ <item> RemoveString </item>
+ <item> RemoveSysTrayIcon </item>
+ <item> RenameFile </item>
+ <item> RenderMovieFrame </item>
+ <item> RenderWorld </item>
+ <item> ReplaceString </item>
+ <item> ReplaceText </item>
+ <item> ResetList </item>
+ <item> ResizeBillboard </item>
+ <item> ResizeEntity </item>
+ <item> ResizeGadget </item>
+ <item> ResizeImage </item>
+ <item> ResizeMovie </item>
+ <item> ResizeParticleEmitter </item>
+ <item> ResizeRichEdit </item>
+ <item> ResizeWindow </item>
+ <item> ResumeCDAudio </item>
+ <item> ResumeMovie </item>
+ <item> ResumeThread </item>
+ <item> RGB </item>
+ <item> RichEditBackgroundColor </item>
+ <item> RichEditBackground </item>
+ <item> RichEditFontFace </item>
+ <item> RichEditFont </item>
+ <item> RichEditFontSize </item>
+ <item> RichEditHeight </item>
+ <item> RichEditID </item>
+ <item> RichEditIndex </item>
+ <item> RichEditLocate </item>
+ <item> RichEditMouseX </item>
+ <item> RichEditMouseY </item>
+ <item> RichEditOptions </item>
+ <item> RichEditParent </item>
+ <item> RichEditTextColor </item>
+ <item> RichEditWidth </item>
+ <item> RichEditX </item>
+ <item> RichEditY </item>
+ <item> Right </item>
+ <item> RotateBillboardGroup </item>
+ <item> RotateCamera </item>
+ <item> RotateEntity </item>
+ <item> RotateMaterial </item>
+ <item> RotateParticleEmitter </item>
+ <item> RotateSprite3D </item>
+ <item> Round </item>
+ <item> RSet </item>
+ <item> RTrim </item>
+ <item> RunProgram </item>
+ <item> SaveFileRequester </item>
+ <item> SaveImage </item>
+ <item> SaveSprite </item>
+ <item> ScaleEntity </item>
+ <item> ScaleMaterial </item>
+ <item> ScreenID </item>
+ <item> ScreenModeDepth </item>
+ <item> ScreenModeHeight </item>
+ <item> ScreenModeRefreshRate </item>
+ <item> ScreenModeWidth </item>
+ <item> ScreenOutput </item>
+ <item> ScrollAreaGadget </item>
+ <item> ScrollBarGadget </item>
+ <item> ScrollMaterial </item>
+ <item> Second </item>
+ <item> SelectedFilePattern </item>
+ <item> SelectedFontColor </item>
+ <item> SelectedFontName </item>
+ <item> SelectedFontSize </item>
+ <item> SelectedFontStyle </item>
+ <item> SelectedRange </item>
+ <item> SelectElement </item>
+ <item> SelectText </item>
+ <item> SendNetworkData </item>
+ <item> SendNetworkFile </item>
+ <item> SendNetworkString </item>
+ <item> SetClipboardData </item>
+ <item> SetClipboardText </item>
+ <item> SetEntityAnimationTime </item>
+ <item> SetErrorNumber </item>
+ <item> SetFrameRate </item>
+ <item> SetGadgetAttribute </item>
+ <item> SetGadgetFont </item>
+ <item> SetGadgetItemAttribute </item>
+ <item> SetGadgetItemState </item>
+ <item> SetGadgetItemText </item>
+ <item> SetGadgetState </item>
+ <item> SetGadgetText </item>
+ <item> Set/GetWindowTitle </item>
+ <item> SetMenuItemState </item>
+ <item> SetMeshData </item>
+ <item> SetModulePosition </item>
+ <item> SetPaletteColor </item>
+ <item> SetRefreshRate </item>
+ <item> SetRichEditCallback </item>
+ <item> SetRichEditText </item>
+ <item> SetWindowCallback </item>
+ <item> SetWindowTitle </item>
+ <item> Sin </item>
+ <item> SizeOf </item>
+ <item> SkyBox </item>
+ <item> SkyDome </item>
+ <item> SortArray </item>
+ <item> SortList </item>
+ <item> SoundFrequency </item>
+ <item> SoundPan </item>
+ <item> SoundVolume </item>
+ <item> Space </item>
+ <item> SpinGadget </item>
+ <item> SplitterGadget </item>
+ <item> Sprite3DBlendingMode </item>
+ <item> Sprite3DQuality </item>
+ <item> SpriteCollision </item>
+ <item> SpriteDepth </item>
+ <item> SpriteHeight </item>
+ <item> SpriteOutput </item>
+ <item> SpritePixelCollision </item>
+ <item> SpriteWidth </item>
+ <item> Sqr </item>
+ <item> Start3D </item>
+ <item> StartDrawing </item>
+ <item> StartPrinting </item>
+ <item> StartSpecialFX </item>
+ <item> StartTimer </item>
+ <item> StatusBarIcon </item>
+ <item> StatusBarText </item>
+ <item> Stop3D </item>
+ <item> StopCDAudio </item>
+ <item> StopDrawing </item>
+ <item> StopModule </item>
+ <item> StopMovie </item>
+ <item> StopPrinting </item>
+ <item> StopSound </item>
+ <item> StopSpecialFX </item>
+ <item> StreamFileIn </item>
+ <item> StreamFileOut </item>
+ <item> StrF </item>
+ <item> StringField </item>
+ <item> StringGadget </item>
+ <item> Str </item>
+ <item> StrU </item>
+ <item> SysTrayIconToolTip </item>
+ <item> Tan </item>
+ <item> TerrainHeight </item>
+ <item> TextGadget </item>
+ <item> TextLength </item>
+ <item> TextureHeight </item>
+ <item> TextureID </item>
+ <item> TextureOutput </item>
+ <item> TextureWidth </item>
+ <item> ThreadPriority </item>
+ <item> ToolBarImageButton </item>
+ <item> ToolBarSeparator </item>
+ <item> ToolBarStandardButton </item>
+ <item> ToolBarToolTip </item>
+ <item> TrackBarGadget </item>
+ <item> TransformSprite3D </item>
+ <item> TransparentSpriteColor </item>
+ <item> TreeGadget </item>
+ <item> TreeGadgetItemNumber </item>
+ <item> Trim </item>
+ <item> UCase </item>
+ <item> UnpackMemory </item>
+ <item> UseBuffer </item>
+ <item> UseCDAudio </item>
+ <item> UseDatabase </item>
+ <item> UseDirectory </item>
+ <item> UseFile </item>
+ <item> UseFont </item>
+ <item> UseGadgetList </item>
+ <item> UseImage </item>
+ <item> UseJPEGImageDecoder </item>
+ <item> UseJPEGImageEncoder </item>
+ <item> UseMovie </item>
+ <item> UseOGGSoundDecoder </item>
+ <item> UsePalette </item>
+ <item> UsePNGImageDecoder </item>
+ <item> UsePNGImageEncoder </item>
+ <item> UseRichEdit </item>
+ <item> UseTGAImageDecoder </item>
+ <item> UseTIFFImageDecoder </item>
+ <item> UseWindow </item>
+ <item> ValF </item>
+ <item> Val </item>
+ <item> WaitThread </item>
+ <item> WaitWindowEvent </item>
+ <item> WebGadget </item>
+ <item> WindowEvent </item>
+ <item> WindowHeight </item>
+ <item> WindowID </item>
+ <item> WindowMouseX </item>
+ <item> WindowMouseY </item>
+ <item> WindowOutput </item>
+ <item> WindowWidth </item>
+ <item> WindowX </item>
+ <item> WindowY </item>
+ <item> WriteByte </item>
+ <item> WriteData </item>
+ <item> WriteFloat </item>
+ <item> WriteLong </item>
+ <item> WritePreferenceFloat </item>
+ <item> WritePreferenceLong </item>
+ <item> WritePreferenceString </item>
+ <item> WriteString </item>
+ <item> WriteStringN </item>
+ <item> WriteWord </item>
+ <item> Year </item>
+ <item> ZoomSprite3D </item>
+ </list>
+
+ <contexts>
+ <context attribute="Normal Text" lineEndContext="#stay" name="Normal">
+
+ <RegExpr attribute="Keyword" context="#stay" String="\b(if)([\s]|$)" insensitive="true" beginRegion="IfRegion"/>
+ <RegExpr attribute="Keyword" context="#stay" String="\b(endif)([\s]|$)" insensitive="true" endRegion="IfRegion"/>
+
+ <RegExpr attribute="Keyword" context="#stay" String="\b(while)([\s]|$)" insensitive="true" beginRegion="WhileRegion"/>
+ <RegExpr attribute="Keyword" context="#stay" String="\b(wend)([\s]|$)" insensitive="true" endRegion="WhileRegion"/>
+
+ <RegExpr attribute="Keyword" context="#stay" String="\b(repeat)([\s]|$)" insensitive="true" beginRegion="RepeatRegion"/>
+ <RegExpr attribute="Keyword" context="#stay" String="\b(until)([\s]|$)" insensitive="true" endRegion="RepeatRegion"/>
+
+ <RegExpr attribute="Keyword" context="#stay" String="\b(select)([\s]|$)" insensitive="true" beginRegion="SelectRegion"/>
+ <RegExpr attribute="Keyword" context="#stay" String="\b(endselect)([\s]|$)" insensitive="true" endRegion="SelectRegion"/>
+
+ <RegExpr attribute="Keyword" context="#stay" String="\b(for|foreach)([\s]|$)" insensitive="true" beginRegion="ForRegion"/>
+ <RegExpr attribute="Keyword" context="#stay" String="\b(next)([\s]|$)" insensitive="true" endRegion="ForRegion"/>
+
+ <RegExpr attribute="Keyword" context="#stay" String="\b(procedure|proceduredll)([.\s]|$)" insensitive="true" beginRegion="ProcedureRegion"/>
+ <RegExpr attribute="Keyword" context="#stay" String="\b(endprocedure)([\s]|$)" insensitive="true" endRegion="ProcedureRegion"/>
+
+ <RegExpr attribute="Keyword" context="#stay" String="\b(structure)([\s]|$)" insensitive="true" beginRegion="StructureRegion"/>
+ <RegExpr attribute="Keyword" context="#stay" String="\b(endstructure)([\s]|$)" insensitive="true" endRegion="StructureRegion"/>
+
+ <RegExpr attribute="Keyword" context="#stay" String="\b(interface)([\s]|$)" insensitive="true" beginRegion="InterfaceRegion"/>
+ <RegExpr attribute="Keyword" context="#stay" String="\b(endinterface)([\s]|$)" insensitive="true" endRegion="InterfaceRegion"/>
+
+ <RegExpr attribute="Keyword" context="#stay" String="\b(enumeration)([\s]|$)" insensitive="true" beginRegion="EnumerationRegion"/>
+ <RegExpr attribute="Keyword" context="#stay" String="\b(endenumeration)([\s]|$)" insensitive="true" endRegion="EnumerationRegion"/>
+
+ <RegExpr attribute="Keyword" context="#stay" String="\b(datasection)([\s]|$)" insensitive="true" beginRegion="DataSectionRegion"/>
+ <RegExpr attribute="Keyword" context="#stay" String="\b(enddatasection)([\s]|$)" insensitive="true" endRegion="DataSectionRegion"/>
+
+ <RegExpr attribute="Keyword" context="#stay" String="\b(compilerif)([\s]|$)" insensitive="true" beginRegion="CompilerIfRegion"/>
+ <RegExpr attribute="Keyword" context="#stay" String="\b(compilerendif)([\s]|$)" insensitive="true" endRegion="CompilerIfRegion"/>
+
+ <RegExpr attribute="Keyword" context="#stay" String="\b(compilerselect)([\s]|$)" insensitive="true" beginRegion="CompilerSelectRegion"/>
+ <RegExpr attribute="Keyword" context="#stay" String="\b(compilerendselect)([\s]|$)" insensitive="true" endRegion="CompilerEndSelectRegion"/>
+
+ <keyword attribute="Keyword" context="#stay" String="keywords"/>
+ <keyword attribute="Functions" context="#stay" String="functions"/>
+ <RegExpr attribute="Constant" context="#stay" String="\#+[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*"/>
+ <Float attribute="Number" context="#stay"/>
+ <Int attribute="Number" context="#stay"/>
+ <DetectChar attribute="String" context="String" char="&quot;" />
+ <RegExpr attribute="Region Marker" context="#stay" String="^\s*;+\s*BEGIN.*$" beginRegion="marker"/>
+ <RegExpr attribute="Region Marker" context="#stay" String="^\s*;+\s*END.*$" endRegion="marker"/>
+ <DetectChar attribute="Comment" context="Comment1" char=";"/>
+ </context>
+ <context attribute="String" lineEndContext="#pop" name="String">
+ <DetectChar attribute="String" context="#pop" char="&quot;"/>
+ </context>
+ <context attribute="Comment" lineEndContext="#pop" name="Comment1">
+ <keyword attribute="Number" context="#stay" String="attention" />
+ </context>
+ </contexts>
+ <itemDatas>
+ <itemData name="Normal Text" defStyleNum="dsNormal"/>
+ <itemData name="Keyword" defStyleNum="dsKeyword"/>
+ <itemData name="Functions" defStyleNum="dsFunction"/>
+ <itemData name="Constant" defStyleNum="dsDataType"/>
+ <itemData name="Number" defStyleNum="dsDecVal"/>
+ <itemData name="String" defStyleNum="dsString"/>
+ <itemData name="Comment" defStyleNum="dsComment"/>
+ <itemData name="Region Marker " defStyleNum="dsRegionMarker"/>
+ </itemDatas>
+ </highlighting>
+ <general>
+ <keywords casesensitive="0" />
+ <comments>
+ <comment name="singleLine" start=";" />
+ </comments>
+ </general>
+</language>
+<!-- // kate: space-indent on; indent-width 2; replace-tabs on; -->
diff --git a/kate/data/python.xml b/kate/data/python.xml
new file mode 100644
index 000000000..9296f4c7e
--- /dev/null
+++ b/kate/data/python.xml
@@ -0,0 +1,233 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language>
+<!-- Python syntax highlightning v0.9 by Per Wigren -->
+<language name="Python" version="1.24" kateversion="2.4" section="Scripts" extensions="*.py;*.pyw;SConstruct;SConscript" mimetype="application/x-python;text/x-python" casesensitive="1" author="Per Wigren" license="">
+ <highlighting>
+ <list name="prep">
+ <item> import </item>
+ <item> from </item>
+ <item> as </item>
+ </list>
+
+ <list name="statements">
+ <item> and </item>
+ <item> assert </item>
+ <item> break </item>
+ <item> class </item>
+ <item> continue </item>
+ <item> def </item>
+ <item> del </item>
+ <item> elif </item>
+ <item> else </item>
+ <item> except </item>
+ <item> exec </item>
+ <item> finally </item>
+ <item> for </item>
+ <item> global </item>
+ <item> if </item>
+ <item> in </item>
+ <item> is </item>
+ <item> lambda </item>
+ <item> not </item>
+ <item> or </item>
+ <item> pass </item>
+ <item> print </item>
+ <item> raise </item>
+ <item> return </item>
+ <item> try </item>
+ <item> while </item>
+ <item> yield </item>
+ </list>
+
+ <list name="builtinfuncs">
+ <item> abs </item>
+ <item> apply </item>
+ <item> buffer </item>
+ <item> callable </item>
+ <item> chr </item>
+ <item> cmp </item>
+ <item> coerce </item>
+ <item> compile </item>
+ <item> complex </item>
+ <item> copyright </item>
+ <item> credits </item>
+ <item> delattr </item>
+ <item> dir </item>
+ <item> divmod </item>
+ <item> eval </item>
+ <item> execfile </item>
+ <item> exit </item>
+ <item> filter </item>
+ <item> float </item>
+ <item> getattr </item>
+ <item> globals </item>
+ <item> hasattr </item>
+ <item> hash </item>
+ <item> hex </item>
+ <item> id </item>
+ <item> input </item>
+ <item> int </item>
+ <item> intern </item>
+ <item> isinstance </item>
+ <item> issubclass </item>
+ <item> iter </item>
+ <item> len </item>
+ <item> license </item>
+ <item> list </item>
+ <item> locals </item>
+ <item> long </item>
+ <item> map </item>
+ <item> max </item>
+ <item> min </item>
+ <item> oct </item>
+ <item> open </item>
+ <item> ord </item>
+ <item> pow </item>
+ <item> quit </item>
+ <item> range </item>
+ <item> raw_input </item>
+ <item> reduce </item>
+ <item> reload </item>
+ <item> repr </item>
+ <item> round </item>
+ <item> setattr </item>
+ <item> slice </item>
+ <item> str </item>
+ <item> tuple </item>
+ <item> type </item>
+ <item> unichr </item>
+ <item> unicode </item>
+ <item> vars </item>
+ <item> xrange </item>
+ <item> zip </item>
+ </list>
+
+ <list name="specialvars">
+ <item> None </item>
+ <item> self </item>
+ <item> cls </item>
+ <item> True </item>
+ <item> False </item>
+ <item> NotImplemented </item>
+ <item> Ellipsis </item>
+ </list>
+
+ <contexts>
+ <context name="Normal" attribute="Normal Text" lineEndContext="#stay">
+ <keyword attribute="Preprocessor" String="prep" context="#stay"/>
+ <keyword attribute="Keyword" String="statements" context="#stay"/>
+ <keyword attribute="Builtin Function" String="builtinfuncs" context="#stay"/>
+ <keyword attribute="Special Variable" String="specialvars" context="#stay"/>
+ <RegExpr attribute="Normal" String="[a-zA-Z_]\w+" context="#stay"/>
+
+ <RegExpr attribute="Complex" String=" (((\d*\.\d+|\d+\.)|(\d+|(\d*\.\d+|\d+\.))[eE][+-]?\d+)|\d+)[jJ]" context="#stay"/>
+ <RegExpr attribute="Float" String="(\d+\.\d*|\.\d+)([eE]\d+)?" context="#stay"/>
+ <RegExpr attribute="Int" String="([1-9]\d*([eE]\d+)?|0)" context="#stay"/>
+ <RegExpr attribute="Long" String="[1-9]\d*([eE][\d.]+)?[Ll]" context="#stay"/>
+ <RegExpr attribute="Hex" String="0[Xx][\da-fA-F]+" context="#stay"/>
+ <RegExpr attribute="Octal" String="0[1-9]\d*" context="#stay"/>
+
+ <RegExpr attribute="Raw String" String="[rR]'" context="Raw A-string"/>
+ <RegExpr attribute="Raw String" String="[rR]&quot;" context="Raw Q-string"/>
+
+ <RegExpr attribute="Comment" String="#.*$" context="#stay"/>
+ <StringDetect attribute="Comment" String="'''" context="Tripple A-comment" firstNonSpace="true" beginRegion="Tripple A-region"/>
+ <StringDetect attribute="Comment" String="&quot;&quot;&quot;" context="Tripple Q-comment" firstNonSpace="true" beginRegion="Tripple Q-region"/>
+
+ <StringDetect attribute="String" String="'''" context="Tripple A-string" beginRegion="Tripple A-region"/>
+ <StringDetect attribute="String" String="&quot;&quot;&quot;" context="Tripple Q-string" beginRegion="Tripple Q-region"/>
+ <DetectChar attribute="String" char="'" context="Single A-string"/>
+ <DetectChar attribute="String" char="&quot;" context="Single Q-string"/>
+
+ <DetectChar attribute="Operator" char="(" context="parenthesised" beginRegion="parenthesis"/>
+ <DetectChar attribute="Operator" char=")" context="#pop" endRegion="parenthesis"/>
+ <RegExpr attribute="Operator" String="[+*/\(\)%\|\[\]\{\}:=;\!&lt;&gt;!^&amp;~-]" context="#stay"/>
+
+ </context>
+
+ <context name="parenthesised" attribute="Normal Text" lineEndContext="#stay" noIndentationBasedFolding="True">
+ <IncludeRules context="Normal" />
+ </context>
+
+ <context name="Tripple A-comment" attribute="Comment" lineEndContext="#stay" noIndentationBasedFolding="True">
+ <HlCChar attribute="Comment" context="#stay"/>
+ <StringDetect attribute="Comment" String="'''" context="#pop" endRegion="Tripple A-region"/>
+ </context>
+
+ <context name="Tripple Q-comment" attribute="Comment" lineEndContext="#stay" noIndentationBasedFolding="True">
+ <HlCChar attribute="Comment" context="#stay"/>
+ <StringDetect attribute="Comment" String="&quot;&quot;&quot;" context="#pop" endRegion="Tripple Q-region"/>
+ </context>
+
+ <context name="Tripple A-string" attribute="String" lineEndContext="#stay" noIndentationBasedFolding="True">
+ <HlCChar attribute="String" context="#stay"/>
+ <RegExpr attribute="Operator" String="%[a-zA-Z]" context="#stay"/>
+ <StringDetect attribute="String" String="'''" context="#pop" endRegion="Tripple A-region"/>
+ </context>
+
+ <context name="Tripple Q-string" attribute="String" lineEndContext="#stay" noIndentationBasedFolding="True">
+ <HlCStringChar attribute="String" context="#stay"/>
+ <RegExpr attribute="Operator" String="%[a-zA-Z]" context="#stay"/>
+ <StringDetect attribute="String" String="&quot;&quot;&quot;" context="#pop" endRegion="Tripple Q-region"/>
+ </context>
+
+ <context name="Single A-comment" attribute="Comment" lineEndContext="#stay">
+ <HlCStringChar attribute="Comment" context="#stay"/>
+ <DetectChar attribute="Comment" char="'" context="#pop"/>
+ </context>
+
+ <context name="Single Q-comment" attribute="Comment" lineEndContext="#stay">
+ <HlCStringChar attribute="Comment" context="#stay"/>
+ <DetectChar attribute="Comment" char="&quot;" context="#pop"/>
+ </context>
+
+ <context name="Single A-string" attribute="String" lineEndContext="#stay">
+ <HlCStringChar attribute="String" context="#stay"/>
+ <RegExpr attribute="Operator" String="%[a-zA-Z]" context="#stay"/>
+ <DetectChar attribute="String" char="'" context="#pop"/>
+ </context>
+
+ <context name="Single Q-string" attribute="String" lineEndContext="#stay">
+ <HlCStringChar attribute="String" context="#stay"/>
+ <RegExpr attribute="Operator" String="%[a-zA-Z]" context="#stay"/>
+ <DetectChar attribute="String" char="&quot;" context="#pop"/>
+ </context>
+
+ <context name="Raw A-string" attribute="Raw String" lineEndContext="#stay">
+ <HlCStringChar attribute="Raw String" context="#stay"/>
+ <DetectChar attribute="Raw String" char="'" context="#pop"/>
+ </context>
+
+ <context name="Raw Q-string" attribute="Raw String" lineEndContext="#stay">
+ <HlCStringChar attribute="Raw String" context="#stay"/>
+ <DetectChar attribute="Raw String" char="&quot;" context="#pop"/>
+ </context>
+
+
+ </contexts>
+ <itemDatas>
+ <itemData name="Normal Text" defStyleNum="dsNormal"/>
+ <itemData name="Operator" defStyleNum="dsChar"/>
+ <itemData name="Keyword" defStyleNum="dsKeyword"/>
+ <itemData name="Builtin Function" defStyleNum="dsDataType"/>
+ <itemData name="Special Variable" defStyleNum="dsOthers"/>
+ <itemData name="Preprocessor" defStyleNum="dsChar"/>
+ <itemData name="Long" defStyleNum="dsOthers"/>
+ <itemData name="Float" defStyleNum="dsFloat"/>
+ <itemData name="Int" defStyleNum="dsDecVal"/>
+ <itemData name="Hex" defStyleNum="dsOthers"/>
+ <itemData name="Octal" defStyleNum="dsOthers"/>
+ <itemData name="Complex" defStyleNum="dsOthers"/>
+ <itemData name="Comment" defStyleNum="dsComment"/>
+ <itemData name="String" defStyleNum="dsString"/>
+ <itemData name="Raw String" defStyleNum="dsString"/>
+ </itemDatas>
+ </highlighting>
+ <general>
+ <folding indentationsensitive="1" />
+ <comments>
+ <comment name="singleLine" start="#" position="afterwhitespace"/>
+ </comments>
+ <keywords casesensitive="1" />
+ </general>
+</language>
diff --git a/kate/data/r.xml b/kate/data/r.xml
new file mode 100644
index 000000000..b9937ea58
--- /dev/null
+++ b/kate/data/r.xml
@@ -0,0 +1,136 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+<!-- Kate 2.5 (KDE 3.5) highlighting module for R
+ based on an earlier version by E.L. Willighagen. Code folding code by Ben Goodrich
+ version 2.0: (c) 2006 Thomas Friedrichsmeier, Arne Henningsen, and the RKWard Team
+ license: GPL v2
+ Kate : http://kate.kde.org/
+ R : http://www.r-project.org/
+ RKWard : http://rkward.sourceforge.net/
+ -->
+<language version="2.01" kateversion="2.5" name="R Script" section="Scripts" extensions="*.R;*.r;*.S;*.s;*.q" mimetype="" license="GPL">
+<highlighting>
+
+ <list name="controls">
+ <item> for </item>
+ <item> in </item>
+ <item> next </item>
+ <item> break </item>
+ <item> while </item>
+ <item> repeat </item>
+ <item> if </item>
+ <item> else </item>
+ <item> switch </item>
+ <item> function </item>
+ </list>
+ <list name="words">
+ <item> TRUE </item>
+ <item> FALSE </item>
+ <item> NULL </item>
+ <item> NA </item>
+ <item> Inf </item>
+ <item> NaN </item>
+ </list>
+
+ <contexts>
+ <!-- This context is really only good for detecting unexpected closing braces '}'. Since opening braces go to ctx0 (and nesting in there), this context is only active on the base level -->
+ <context attribute="Normal Text" lineEndContext="#stay" name="level0">
+ <IncludeRules context="CommonRules"/>
+
+ <DetectChar attribute="Error" context="#stay" char="}" />
+ <DetectChar attribute="Error" context="#stay" char=")"/>
+ </context>
+
+ <context attribute="Normal Text" lineEndContext="#stay" name="ctx0">
+ <IncludeRules context="CommonRules"/>
+
+ <DetectChar attribute="Symbol" context="#pop" char="}" endRegion="Brace1" />
+ <DetectChar attribute="Error" context="#stay" char=")"/>
+ </context>
+
+ <context attribute="In Parenthesis" lineEndContext="#stay" name="parenthesis">
+ <LineContinue attribute="Boolean" context="#stay"/>
+ <DetectChar attribute="Keyword" context="#pop" char=")"/>
+
+ <RegExpr attribute="Identifier" context="#stay" String="[a-zA-Z_\.][0-9a-zA-Z_\.]*[\s]*=(?=([^=]|$))"/>
+
+ <IncludeRules context="CommonRules"/>
+ <DetectChar attribute="Error" context="#stay" char="}" />
+ </context>
+
+ <context attribute="String" lineEndContext="#stay" name="string">
+ <DetectChar attribute="String" context="#pop" char="&quot;"/>
+ <DetectChar attribute="String" context="#pop" char="'"/>
+ <HlCStringChar attribute="String Char" context="#stay"/>
+ </context>
+
+ <context attribute="Identifier" lineEndContext="#stay" name="backquotedsymbol">
+ <DetectChar attribute="String" context="#pop" char="`"/>
+ <HlCStringChar attribute="String Char" context="#stay"/>
+ </context>
+
+ <context attribute="Headline" lineEndContext="#pop" name="Headline"/>
+ <context attribute="Comment" lineEndContext="#pop" name="Comment"/>
+
+ <!-- This context is not really used, but contains the common rules -->
+ <context name="CommonRules" lineEndContext="#stay" attribute="Normal Text" >
+ <DetectChar attribute="String" context="string" char="&quot;"/>
+ <DetectChar attribute="String" context="string" char="'"/>
+ <DetectChar attribute="String" context="backquotedsymbol" char="`"/>
+ <keyword attribute="Control Structure" context="#stay" String="controls"/>
+ <keyword attribute="Reserved Words" context="#stay" String="words"/>
+ <Float attribute="Float" context="#stay"/>
+ <Int attribute="Int" context="#stay"/>
+ <RegExpr attribute="Keyword" context="#stay" String="[a-zA-Z_]+[a-zA-Z_\.0-9]*(?=[\s]*[(])"/>
+ <RegExpr attribute="Keyword" context="#stay" String="\.[a-zA-Z_\.]+[a-zA-Z_\.0-9]*(?=[\s]*[(])"/>
+ <RegExpr attribute="Keyword" context="parenthesis" String="\("/>
+ <StringDetect attribute="Headline" context="Headline" String="##"/>
+ <DetectChar attribute="Comment" context="Comment" char="#"/>
+
+ <!-- The following three lines look worse than they are: If there are any other operators directly before or after -> and <-, this is a syntax error (expections: ->> and <<-) -->
+ <RegExpr attribute="Error" context="#stay" String="([\+\-\*/\^\:\$~!&amp;\|=&gt;@^])([&lt;]{1,2}\-|\-[&gt;]{1,2})"/>
+ <RegExpr attribute="Error" context="#stay" String="([&lt;]{1,2}\-|\-[&gt;]{1,2})([\+\-\*/\^\:\$~!&amp;\|=&lt;@])"/>
+ <RegExpr attribute="Error" context="#stay" String="([&lt;]{3}|[&gt;]{3})"/>
+ <RegExpr attribute="Assign" context="#stay" String="[&lt;]{1,2}\-"/>
+ <RegExpr attribute="Assign" context="#stay" String="\-[&gt;]{1,2}"/>
+ <!-- Much like above: Most other operators are forbidden around = -->
+ <RegExpr attribute="Error" context="#stay" String="([\+\-\*/\^\:\$~&amp;\|@^])="/>
+ <RegExpr attribute="Error" context="#stay" String="=([\+\-\*/\^\:\$~!&lt;&gt;&amp;\|@^])"/>
+ <RegExpr attribute="Assign" context="#stay" String="=(?!=)"/>
+
+ <!-- These operators are fine as long as they're followed by something else or end of line. Error otherwise -->
+ <RegExpr attribute="Operator" context="#stay" String="(\+|\-|\*|/|&lt;=|&gt;=|={1,2}|\!=|\|{1,2}|&amp;{1,2}|:{1,2}|\^|@|\$|~)((?!(\+|\-|\*|/|&lt;=|&gt;=|=|\!=|\||&amp;|:|\^|@|\$|~))|$)"/>
+ <RegExpr attribute="Error" context="#stay" String="(\+|\-|\*|/|&lt;=|&gt;=|={1,2}|\!=|\|{1,2}|&amp;{1,2}|:{1,2}|\^|@|\$|~){2,}"/>
+ <RegExpr attribute="Operator" context="#stay" String="%[^%]*%"/>
+
+ <DetectChar attribute="Symbol" context="ctx0" char="{" beginRegion="Brace1" />
+ </context>
+ </contexts>
+
+ <itemDatas>
+ <!-- KDE default colors: http://accessibility.kde.org/oxygen.php?color=white -->
+ <itemData name="Normal Text" defStyleNum="dsNormal"/>
+ <itemData name="Symbol" defStyleNum="dsNormal"/>
+ <itemData name="Keyword" defStyleNum="dsKeyword"/>
+ <itemData name="Identifier" defStyleNum="dsDataType"/>
+ <itemData name="String" defStyleNum="dsString"/>
+ <itemData name="Headline" defStyleNum="dsNormal" color="#b00000" selColor="#b00000" bold="1" italic="0"/> <!-- KDE default color: text 5 -->
+ <itemData name="Comment" defStyleNum="dsComment"/>
+ <itemData name="Assign" defStyleNum="dsNormal" color="#336366" selColor="#ccc099" bold="1" italic="0"/> <!-- KDE default color: text 7 -->
+ <itemData name="Control Structure" defStyleNum="dsNormal" color="#0000bf" selColor="#bfbf00"/> <!-- KDE default color: text 2 -->
+ <itemData name="Reserved Words" defStyleNum="dsOthers"/>
+ <itemData name="Error" defStyleNum="dsError"/>
+ <itemData name="Operator" defStyleNum="dsNormal" color="#803f00" selColor="#000077" bold="0" italic="0"/> <!-- KDE default color: focussed text -->
+ <itemData name="String Char" defStyleNum="dsChar"/>
+ <itemData name="Float" defStyleNum="dsFloat"/>
+ <itemData name="Int" defStyleNum="dsDecVal"/>
+ </itemDatas>
+</highlighting>
+
+<general>
+ <comments>
+ <comment name="singleLine" start="#" end=""/>
+ </comments>
+ <keywords casesensitive="1" />
+</general>
+</language>
diff --git a/kate/data/rexx.xml b/kate/data/rexx.xml
new file mode 100644
index 000000000..b22f65d0d
--- /dev/null
+++ b/kate/data/rexx.xml
@@ -0,0 +1,134 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+<language name="REXX" version="1.01" kateversion="2.3" section="Scripts" extensions="*.rex" mimetype="">
+ <highlighting>
+ <list name="instructions">
+ <item> arg </item>
+ <item> drop </item>
+ <item> else </item>
+ <item> end </item>
+ <item> exit </item>
+ <item> forever </item>
+ <item> if </item>
+ <item> interpret </item>
+ <item> iterate </item>
+ <item> leave </item>
+ <item> nop </item>
+ <item> options </item>
+ <item> otherwise </item>
+ <item> pull </item>
+ <item> push </item>
+ <item> queue </item>
+ <item> return </item>
+ <item> say </item>
+ <item> select </item>
+ <item> syntax </item>
+ <item> then </item>
+ </list>
+ <list name="builtin">
+ <item> abbrev </item>
+ <item> abs </item>
+ <item> address </item>
+ <item> bitand </item>
+ <item> bitor </item>
+ <item> bitxor </item>
+ <item> b2x </item>
+ <item> center </item>
+ <item> charin </item>
+ <item> charout </item>
+ <item> chars </item>
+ <item> c2d </item>
+ <item> c2x </item>
+ <item> compare </item>
+ <item> condition </item>
+ <item> copies </item>
+ <item> datatype </item>
+ <item> date </item>
+ <item> delstr </item>
+ <item> delword </item>
+ <item> digits </item>
+ <item> d2c </item>
+ <item> d2x </item>
+ <item> errortext </item>
+ <item> form </item>
+ <item> format </item>
+ <item> fuzz </item>
+ <item> insert </item>
+ <item> lastpos </item>
+ <item> left </item>
+ <item> linein </item>
+ <item> lineout </item>
+ <item> lines </item>
+ <item> max </item>
+ <item> min </item>
+ <item> overlay </item>
+ <item> pos </item>
+ <item> queued </item>
+ <item> random </item>
+ <item> reverse </item>
+ <item> right </item>
+ <item> sign </item>
+ <item> sourceline </item>
+ <item> space </item>
+ <item> stream </item>
+ <item> strip </item>
+ <item> substr </item>
+ <item> subword </item>
+ <item> symbol </item>
+ <item> time </item>
+ <item> trace </item>
+ <item> translate </item>
+ <item> trunc </item>
+ <item> value </item>
+ <item> verify </item>
+ <item> word </item>
+ <item> wordindex </item>
+ <item> wordlength </item>
+ <item> wordpos </item>
+ <item> words </item>
+ <item> xrange </item>
+ <item> x2b </item>
+ <item> x2c </item>
+ <item> x2d </item>
+ </list>
+ <contexts>
+ <context attribute="Normal Text" lineEndContext="#stay" name="Normal">
+ <keyword attribute="Instructions" context="#stay" String="instructions" />
+ <keyword attribute="Built In" context="#stay" String="builtin" />
+ <RegExpr attribute="Instructions" context="#stay" insensitive="true" String="\bsignal([\s]*(on|off)[\s]*(error|failure|halt|notready|novalue|syntax|lostdigits))*"/>
+ <RegExpr attribute="Instructions" context="#stay" insensitive="true" String="\bcall([\s]*(on|off)[\s]*(error|failure|halt|notready))*"/>
+ <RegExpr attribute="Instructions" context="#stay" insensitive="true" String="\b(trace|address)\s*[_\w\d]"/>
+ <RegExpr attribute="Instructions" context="#stay" insensitive="true" String="\bprocedure([\s]*expose)?"/>
+ <RegExpr attribute="Instructions" context="#stay" insensitive="true" String="\bdo([\s]*forever)?"/>
+ <DetectChar attribute="String" context="String" char="&apos;"/>
+ <Detect2Chars attribute="Comment" context="Commentar 1" char="/" char1="*" beginRegion="Comment"/>
+ <AnyChar attribute="Symbol" context="#stay" String=":!%&amp;()+,-/.*&lt;=&gt;?[]{|}~^&#59;"/>
+ <RegExpr attribute="Function" context="#stay" String="\b[_\w][_\w\d]*(?=[\s]*[(:])" />
+ </context>
+ <context attribute="String" lineEndContext="#pop" name="String">
+ <LineContinue attribute="String" context="#stay"/>
+ <DetectChar attribute="String" context="#pop" char="&apos;"/>
+ </context>
+ <context attribute="Comment" lineEndContext="#stay" name="Commentar 1">
+ <RegExpr attribute="Alert" context="#stay" String="(FIXME|TODO)" />
+ <Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" endRegion="Comment"/>
+ </context>
+ </contexts>
+ <itemDatas>
+ <itemData name="Normal Text" defStyleNum="dsNormal"/>
+ <itemData name="Instructions" defStyleNum="dsKeyword"/>
+ <itemData name="Built In" defStyleNum="dsNormal" color="#000090"/>
+ <itemData name="Function" defStyleNum="dsFunction" />
+ <itemData name="String" defStyleNum="dsString"/>
+ <itemData name="Comment" defStyleNum="dsComment"/>
+ <itemData name="Symbol" defStyleNum="dsNormal"/>
+ <itemData name="Alert" defStyleNum="dsAlert" />
+ </itemDatas>
+ </highlighting>
+ <general>
+ <comments>
+ <comment name="multiLine" start="/*" end="*/" />
+ </comments>
+ <keywords casesensitive="0" />
+ </general>
+</language>
diff --git a/kate/data/rhtml.xml b/kate/data/rhtml.xml
new file mode 100644
index 000000000..c78702954
--- /dev/null
+++ b/kate/data/rhtml.xml
@@ -0,0 +1,1235 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd"
+[
+ <!ENTITY name "[A-Za-z_:][\w.:_-]*">
+ <!ENTITY entref "&amp;(#[0-9]+|#[xX][0-9A-Fa-f]+|&name;);">
+]>
+
+<!--
+ RHTML syntax highlighting definition for Kate. It combines the ruby and
+ html syntax grammars. Some ideas, and the list of Rails method names were
+ taken from an rhtml kate grammar for Quanta based on earlier versions of
+ the syntax highlighters.
+
+ Copyright (C) 2004 by Sebastian Vuorinen (sebastian dot vuorinen at helsinki dot fi)
+ Copyright (C) 2004 by Stefan Lang (langstefan@gmx.at)
+ Copyright (C) 2006 by Wilbert Berendsen (wilbert@kde.nl
+ Copyright (C) 2005 by Chris Martin (linux@chriscodes.com
+ Copyright (C) 2006 by Richard Dale (rdale@foton.es)
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the
+ Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+-->
+
+<!--
+ TODO: * Regular expressions spanning over multiple lines
+ work only if newlines are escaped.
+ * "Nested" HERE documents aren't recognized.
+ * Division is detected correctly only, if whitespace
+ is around the "/" operator.
+ E.g.: detected correctly: 1 / 2
+ "/" interpreted as regex start: 1/2
+-->
+
+<!-- Hold the "language" opening tag on a single line, as mentioned in "language.dtd". -->
+<language name="Ruby/Rails/RHTML" version="1.00" kateversion="2.4" section="Markup" extensions="*.rhtml;*.html.erb" mimetype="" author="Richard Dale rdale@foton.es" license="LGPL">
+
+ <highlighting>
+
+ <list name="keywords">
+ <item> BEGIN </item>
+ <item> END </item>
+ <item> and </item>
+ <item> begin </item>
+ <item> break </item>
+ <item> case </item>
+ <item> defined? </item>
+ <item> do </item>
+ <item> else </item>
+ <item> elsif </item>
+ <item> end </item>
+ <item> ensure </item>
+ <item> for </item>
+ <item> if </item>
+ <item> in </item>
+ <item> include </item>
+ <item> next </item>
+ <item> not </item>
+ <item> or </item>
+ <item> redo </item>
+ <item> rescue </item>
+ <item> retry </item>
+ <item> return </item>
+ <item> then </item>
+ <item> unless </item>
+ <item> until </item>
+ <item> when </item>
+ <item> while </item>
+ <item> yield </item>
+ </list>
+
+ <list name="access-control">
+ <item> private_class_method </item>
+ <item> private </item>
+ <item> protected </item>
+ <item> public_class_method </item>
+ <item> public </item>
+ </list>
+
+ <list name="attribute-definitions">
+ <item> attr_reader </item>
+ <item> attr_writer </item>
+ <item> attr_accessor </item>
+ </list>
+
+ <list name="definitions">
+ <item> alias </item>
+ <item> module </item>
+ <item> class </item>
+ <item> def </item>
+ <item> undef </item>
+ </list>
+
+ <list name="pseudo-variables">
+ <item> self </item>
+ <item> super </item>
+ <item> nil </item>
+ <item> false </item>
+ <item> true </item>
+ <item> caller </item>
+ <item> __FILE__ </item>
+ <item> __LINE__ </item>
+ </list>
+
+ <list name="default-globals">
+ <item> $stdout </item>
+ <item> $defout </item>
+ <item> $stderr </item>
+ <item> $deferr </item>
+ <item> $stdin </item>
+ </list>
+
+ <!-- Kernel module methods.
+ NOTE: Methods ending in ? or !
+ are included below as regexes.
+ -->
+ <list name="kernel-methods">
+ <!-- backquote ` -->
+ <item> abort </item>
+ <item> at_exit </item>
+ <item> autoload </item>
+ <item> autoload? </item>
+ <item> binding </item>
+ <item> block_given? </item>
+ <item> callcc </item>
+ <item> caller </item>
+ <item> catch </item>
+ <item> chomp </item>
+ <item> chomp! </item>
+ <item> chop </item>
+ <item> chop! </item>
+ <item> eval </item>
+ <item> exec </item>
+ <item> exit </item>
+ <item> exit! </item>
+ <item> fail </item>
+ <item> fork </item>
+ <item> format </item>
+ <item> getc </item>
+ <item> gets </item>
+ <item> global_variables </item>
+ <item> gsub </item>
+ <item> gsub! </item>
+ <item> iterator? </item>
+ <item> lambda </item>
+ <item> load </item>
+ <item> local_variables </item>
+ <item> loop </item>
+ <item> method_missing </item>
+ <item> open </item>
+ <item> p </item>
+ <item> print </item>
+ <item> printf </item>
+ <item> proc </item>
+ <item> putc </item>
+ <item> puts </item>
+ <item> raise </item>
+ <item> rand </item>
+ <item> readline </item>
+ <item> readlines </item>
+ <item> require </item>
+ <item> scan </item>
+ <item> select </item>
+ <item> set_trace_func </item>
+ <item> sleep </item>
+ <item> split </item>
+ <item> sprintf </item>
+ <item> srand </item>
+ <item> sub </item>
+ <item> sub! </item>
+ <item> syscall </item>
+ <item> system </item>
+ <item> test </item>
+ <item> throw </item>
+ <item> trace_var </item>
+ <item> trap </item>
+ <item> untrace_var </item>
+ <item> warn </item>
+
+ <!-- ActionView methods from Rails docs -->
+ <item>auto_complete_field</item>
+ <item>auto_complete_result</item>
+ <item>auto_discovery_link_tag</item>
+ <item>auto_link</item>
+ <item>benchmark</item>
+ <item>button_to</item>
+ <item>cache</item>
+ <item>capture</item>
+ <item>check_box</item>
+ <item>check_box_tag</item>
+ <item>collection_select</item>
+ <item>concat</item>
+ <item>content_for</item>
+ <item>content_tag</item>
+ <item>country_options_for_select</item>
+ <item>country_select</item>
+ <item>current_page?</item>
+ <item>date_select</item>
+ <item>datetime_select</item>
+ <item>debug</item>
+ <item>define_javascript_functions</item>
+ <item>distance_of_time_in_words</item>
+ <item>distance_of_time_in_words_to_now</item>
+ <item>draggable_element</item>
+ <item>drop_receiving_element</item>
+ <item>end_form_tag</item>
+ <item>error_message_on</item>
+ <item>error_messages_for</item>
+ <item>escape_javascript</item>
+ <item>evaluate_remote_response</item>
+ <item>excerpt</item>
+ <item>file_field</item>
+ <item>file_field_tag</item>
+ <item>finish_upload_status</item>
+ <item>form</item>
+ <item>form_remote_tag</item>
+ <item>form_tag</item>
+ <item>form_tag_with_upload_progress</item>
+ <item>h</item>
+ <item>hidden_field</item>
+ <item>hidden_field_tag</item>
+ <item>highlight</item>
+ <item>human_size</item>
+ <item>image_path</item>
+ <item>image_submit_tag</item>
+ <item>image_tag</item>
+ <item>input</item>
+ <item>javascript_include_tag</item>
+ <item>javascript_path</item>
+ <item>javascript_tag</item>
+ <item>link_image_to</item>
+ <item>link_to</item>
+ <item>link_to_function</item>
+ <item>link_to_if</item>
+ <item>link_to_image</item>
+ <item>link_to_remote</item>
+ <item>link_to_unless</item>
+ <item>link_to_unless_current</item>
+ <item>mail_to</item>
+ <item>markdown</item>
+ <item>number_to_currency</item>
+ <item>number_to_human_size</item>
+ <item>number_to_percentage</item>
+ <item>number_to_phone</item>
+ <item>number_with_delimiter</item>
+ <item>number_with_precision</item>
+ <item>observe_field</item>
+ <item>observe_form</item>
+ <item>option_groups_from_collection_for_select</item>
+ <item>options_for_select</item>
+ <item>options_from_collection_for_select</item>
+ <item>pagination_links</item>
+ <item>password_field</item>
+ <item>password_field_tag</item>
+ <item>periodically_call_remote</item>
+ <item>pluralize</item>
+ <item>radio_button</item>
+ <item>radio_button_tag</item>
+ <item>register_template_handler</item>
+ <item>render</item>
+ <item>render_file</item>
+ <item>render_template</item>
+ <item>sanitize</item>
+ <item>select</item>
+ <item>select_date</item>
+ <item>select_datetime</item>
+ <item>select_day</item>
+ <item>select_hour</item>
+ <item>select_minute</item>
+ <item>select_month</item>
+ <item>select_second</item>
+ <item>select_tag</item>
+ <item>select_time</item>
+ <item>select_year</item>
+ <item>simple_format</item>
+ <item>sortable_element</item>
+ <item>start_form_tag</item>
+ <item>strip_links</item>
+ <item>stylesheet_link_tag</item>
+ <item>stylesheet_path</item>
+ <item>submit_tag</item>
+ <item>submit_to_remote</item>
+ <item>tag</item>
+ <item>text_area</item>
+ <item>text_area_tag</item>
+ <item>text_field</item>
+ <item>text_field_tag</item>
+ <item>text_field_with_auto_complete</item>
+ <item>textilize</item>
+ <item>textilize_without_paragraph</item>
+ <item>time_ago_in_words</item>
+ <item>time_zone_options_for_select</item>
+ <item>time_zone_select</item>
+ <item>truncate</item>
+ <item>update_element_function</item>
+ <item>upload_progress_status</item>
+ <item>upload_progress_text</item>
+ <item>upload_progress_update_bar_js</item>
+ <item>upload_status_progress_bar_tag</item>
+ <item>upload_status_tag</item>
+ <item>upload_status_text_tag</item>
+ <item>url_for</item>
+ <item>visual_effect</item>
+ <item>word_wrap</item>
+ </list>
+
+ <list name="attention">
+ <item> TODO </item>
+ <item> FIXME </item>
+ <item> NOTE </item>
+ </list>
+
+ <contexts>
+
+ <!-- BEGIN HTML contexts -->
+ <context name="Start" attribute="Normal Text" lineEndContext="#stay">
+ <IncludeRules context="FindHTML" />
+ </context>
+
+ <context name="FindHTML" attribute="Normal Text" lineEndContext="#stay">
+ <DetectSpaces/>
+ <DetectIdentifier/>
+
+ <RegExpr attribute="Keyword" context="rubysource" String="&lt;%=?" />
+ <StringDetect attribute="Keyword" context="rubysourceline" String="%" />
+
+ <StringDetect attribute="Comment" context="Comment" String="&lt;!--" beginRegion="comment" />
+ <StringDetect attribute="CDATA" context="CDATA" String="&lt;![CDATA[" beginRegion="cdata" />
+ <RegExpr attribute="Doctype" context="Doctype" String="&lt;!DOCTYPE\s+" beginRegion="doctype" />
+ <RegExpr attribute="Processing Instruction" context="PI" String="&lt;\?[\w:-]*" beginRegion="pi" />
+ <RegExpr attribute="Element" context="CSS" String="&lt;style\b" insensitive="TRUE" beginRegion="style" />
+ <RegExpr attribute="Element" context="JS" String="&lt;script\b" insensitive="TRUE" beginRegion="script" />
+ <RegExpr attribute="Element" context="El Open" String="&lt;pre\b" insensitive="TRUE" beginRegion="pre" />
+ <RegExpr attribute="Element" context="El Open" String="&lt;div\b" insensitive="TRUE" beginRegion="div" />
+ <RegExpr attribute="Element" context="El Open" String="&lt;table\b" insensitive="TRUE" beginRegion="table" />
+ <RegExpr attribute="Element" context="El Open" String="&lt;&name;" />
+ <RegExpr attribute="Element" context="El Close" String="&lt;/pre\b" insensitive="TRUE" endRegion="pre" />
+ <RegExpr attribute="Element" context="El Close" String="&lt;/div\b" insensitive="TRUE" endRegion="div" />
+ <RegExpr attribute="Element" context="El Close" String="&lt;/table\b" insensitive="TRUE" endRegion="table" />
+ <RegExpr attribute="Element" context="El Close" String="&lt;/&name;" />
+ <!-- as long as kde gives DTDs the text/html mimetype--><IncludeRules context="FindDTDRules" />
+ <IncludeRules context="FindEntityRefs" />
+ </context>
+
+ <context name="FindEntityRefs" attribute="Normal Text" lineEndContext="#stay">
+ <RegExpr attribute="EntityRef" context="#stay" String="&entref;" />
+ <AnyChar attribute="Error" context="#stay" String="&amp;&lt;" />
+ </context>
+
+ <context name="FindPEntityRefs" attribute="Normal Text" lineEndContext="#stay">
+ <RegExpr attribute="EntityRef" context="#stay" String="&entref;" />
+ <RegExpr attribute="PEntityRef" context="#stay" String="%&name;;" />
+ <AnyChar attribute="Error" context="#stay" String="&amp;%" />
+ </context>
+
+ <context name="FindAttributes" attribute="Normal Text" lineEndContext="#stay">
+ <RegExpr attribute="Attribute" context="#stay" String="&name;" column="0"/>
+ <RegExpr attribute="Attribute" context="#stay" String="\s+&name;" />
+ <DetectChar attribute="Attribute" context="Value" char="=" />
+ </context>
+
+ <context name="FindDTDRules" attribute="Normal Text" lineEndContext="#stay">
+ <RegExpr attribute="Doctype" context="Doctype Markupdecl" String="&lt;!(ELEMENT|ENTITY|ATTLIST|NOTATION)\b" />
+ </context>
+
+
+ <context name="Comment" attribute="Comment" lineEndContext="#stay">
+ <DetectSpaces/>
+ <IncludeRules context="##Alerts" />
+ <DetectIdentifier/>
+ <StringDetect attribute="Comment" context="#pop" String="--&gt;" endRegion="comment" />
+ <RegExpr attribute="Error" context="#stay" String="-(-(?!-&gt;))+" />
+ </context>
+
+ <context name="CDATA" attribute="Normal Text" lineEndContext="#stay">
+ <DetectSpaces/>
+ <DetectIdentifier/>
+ <StringDetect attribute="CDATA" context="#pop" String="]]&gt;" endRegion="cdata" />
+ <StringDetect attribute="EntityRef" context="#stay" String="]]&amp;gt;" />
+ </context>
+
+ <context name="PI" attribute="Normal Text" lineEndContext="#stay">
+ <Detect2Chars attribute="Processing Instruction" context="#pop" char="?" char1="&gt;" endRegion="pi" />
+ </context>
+
+ <context name="Doctype" attribute="Normal Text" lineEndContext="#stay">
+ <DetectChar attribute="Doctype" context="#pop" char="&gt;" endRegion="doctype" />
+ <DetectChar attribute="Doctype" context="Doctype Internal Subset" char="[" beginRegion="int_subset" />
+ </context>
+
+ <context name="Doctype Internal Subset" attribute="Normal Text" lineEndContext="#stay">
+ <DetectChar attribute="Doctype" context="#pop" char="]" endRegion="int_subset" />
+ <IncludeRules context="FindDTDRules" />
+ <StringDetect attribute="Comment" context="Comment" String="&lt;!--" beginRegion="comment" />
+ <RegExpr attribute="Processing Instruction" context="PI" String="&lt;\?[\w:-]*" beginRegion="pi" />
+ <IncludeRules context="FindPEntityRefs" />
+ </context>
+
+ <context name="Doctype Markupdecl" attribute="Normal Text" lineEndContext="#stay">
+ <DetectChar attribute="Doctype" context="#pop" char="&gt;" />
+ <DetectChar attribute="Value" context="Doctype Markupdecl DQ" char="&quot;" />
+ <DetectChar attribute="Value" context="Doctype Markupdecl SQ" char="&apos;" />
+ </context>
+
+ <context name="Doctype Markupdecl DQ" attribute="Value" lineEndContext="#stay">
+ <RegExpr attribute="Keyword" context="rubysource" String="&lt;%=?" />
+
+ <DetectChar attribute="Value" context="#pop" char="&quot;" />
+ <IncludeRules context="FindPEntityRefs" />
+ </context>
+
+ <context name="Doctype Markupdecl SQ" attribute="Value" lineEndContext="#stay">
+ <RegExpr attribute="Keyword" context="rubysource" String="&lt;%=?" />
+
+ <DetectChar attribute="Value" context="#pop" char="&apos;" />
+ <IncludeRules context="FindPEntityRefs" />
+ </context>
+
+ <context name="El Open" attribute="Normal Text" lineEndContext="#stay">
+ <RegExpr attribute="Keyword" context="rubysource" String="&lt;%=?" />
+
+ <Detect2Chars attribute="Element" context="#pop" char="/" char1="&gt;" />
+ <DetectChar attribute="Element" context="#pop" char="&gt;" />
+ <IncludeRules context="FindAttributes" />
+ <RegExpr attribute="Error" context="#stay" String="\S" />
+ </context>
+
+ <context name="El Close" attribute="Normal Text" lineEndContext="#stay">
+ <RegExpr attribute="Keyword" context="rubysource" String="&lt;%=?" />
+
+ <DetectChar attribute="Element" context="#pop" char="&gt;" />
+ <RegExpr attribute="Error" context="#stay" String="\S" />
+ </context>
+
+ <context name="El Close 2" attribute="Normal Text" lineEndContext="#stay">
+ <RegExpr attribute="Keyword" context="rubysource" String="&lt;%=?" />
+
+ <DetectChar attribute="Element" context="#pop#pop#pop" char="&gt;" />
+ <RegExpr attribute="Error" context="#stay" String="\S" />
+ </context>
+
+ <context name="El Close 3" attribute="Normal Text" lineEndContext="#stay">
+ <RegExpr attribute="Keyword" context="rubysource" String="&lt;%=?" />
+
+ <DetectChar attribute="Element" context="#pop#pop#pop#pop" char="&gt;" />
+ <RegExpr attribute="Error" context="#stay" String="\S" />
+ </context>
+
+ <context name="CSS" attribute="Normal Text" lineEndContext="#stay">
+ <RegExpr attribute="Keyword" context="rubysource" String="&lt;%=?" />
+
+ <Detect2Chars attribute="Element" context="#pop" char="/" char1="&gt;" endRegion="style" />
+ <DetectChar attribute="Element" context="CSS content" char="&gt;" />
+ <IncludeRules context="FindAttributes" />
+ <RegExpr attribute="Error" context="#stay" String="\S" />
+ </context>
+
+ <context name="CSS content" attribute="Normal Text" lineEndContext="#stay">
+ <RegExpr attribute="Keyword" context="rubysource" String="&lt;%=?" />
+
+ <RegExpr attribute="Element" context="El Close 2" String="&lt;/style\b" insensitive="TRUE" endRegion="style" />
+ <IncludeRules context="##CSS" includeAttrib="true"/>
+ </context>
+
+ <context name="JS" attribute="Normal Text" lineEndContext="#stay">
+ <RegExpr attribute="Keyword" context="rubysource" String="&lt;%=?" />
+
+ <Detect2Chars attribute="Element" context="#pop" char="/" char1="&gt;" endRegion="script" />
+ <DetectChar attribute="Element" context="JS content" char="&gt;" />
+ <IncludeRules context="FindAttributes" />
+ <RegExpr attribute="Error" context="#stay" String="\S" />
+ </context>
+
+ <context name="JS content" attribute="Normal Text" lineEndContext="#stay">
+ <RegExpr attribute="Keyword" context="rubysource" String="&lt;%=?" />
+
+ <RegExpr attribute="Element" context="El Close 2" String="&lt;/script\b" insensitive="TRUE" endRegion="script" />
+ <RegExpr attribute="Comment" context="JS comment close" String="//(?=.*&lt;/script\b)" insensitive="TRUE" />
+ <IncludeRules context="##JavaScript" includeAttrib="true"/>
+ </context>
+
+ <context name="JS comment close" attribute="Comment" lineEndContext="#pop">
+ <RegExpr attribute="Element" context="El Close 3" String="&lt;/script\b" insensitive="TRUE" endRegion="script" />
+ <IncludeRules context="##Alerts" />
+ </context>
+
+ <context name="Value" attribute="Normal Text" lineEndContext="#stay" fallthrough="true" fallthroughContext="Value NQ">
+ <RegExpr attribute="Keyword" context="rubysource" String="&lt;%=?" />
+
+ <DetectChar attribute="Value" context="Value DQ" char="&quot;" />
+ <DetectChar attribute="Value" context="Value SQ" char="&apos;" />
+ <DetectSpaces />
+ </context>
+
+ <context name="Value NQ" attribute="Normal Text" lineEndContext="#pop#pop" fallthrough="true" fallthroughContext="#pop#pop">
+ <RegExpr attribute="Keyword" context="rubysource" String="&lt;%=?" />
+
+ <IncludeRules context="FindEntityRefs" />
+ <RegExpr attribute="Value" context="#stay" String="/(?!&gt;)" />
+ <RegExpr attribute="Value" context="#stay" String="[^/&gt;&lt;&quot;&apos;\s]" />
+ </context>
+
+ <context name="Value DQ" attribute="Value" lineEndContext="#stay">
+ <RegExpr attribute="Keyword" context="rubysource" String="&lt;%=?" />
+
+ <DetectChar attribute="Value" context="#pop#pop" char="&quot;" />
+ <IncludeRules context="FindEntityRefs" />
+ </context>
+
+ <context name="Value SQ" attribute="Value" lineEndContext="#stay">
+ <RegExpr attribute="Keyword" context="rubysource" String="&lt;%=?" />
+
+ <DetectChar attribute="Value" context="#pop#pop" char="&apos;" />
+ <IncludeRules context="FindEntityRefs" />
+ </context>
+ <!-- END HTML contexts -->
+
+ <!-- BEGIN Ruby contexts -->
+
+ <!-- A single line of ruby source after a '%' ERB tag -->
+ <context name="rubysourceline" attribute="RUBY RAILS ERB Text" lineEndContext="#pop">
+ <IncludeRules context="rubysource" />
+ </context>
+
+ <context name="rubysource" attribute="RUBY RAILS ERB Text" lineEndContext="#stay">
+ <!-- ruby ignores newline after \ -->
+ <LineContinue attribute="Ruby Normal Text" context="Line Continue"/>
+
+ <RegExpr attribute="Keyword" context="#pop" String="-?%&gt;" />
+
+ <!-- __END__ token on own line. -->
+ <RegExpr attribute="Keyword" String="__END__$" context="DATA" column="0"/>
+
+ <!-- "shebang" line -->
+ <RegExpr attribute="Keyword" String="#!\/.*" context="#stay" column="0"/>
+
+ <!-- "def" - "end" blocks -->
+ <!-- check for statement modifiers with regexes -->
+ <RegExpr attribute="Keyword" String="(\=|\(|\[|\{)\s*(if|unless|while|until)\b" context="#stay" beginRegion="def block"/>
+ <RegExpr attribute="Keyword" String="(while|until)\b(?!.*\bdo\b)" context="#stay" beginRegion="def block" firstNonSpace="true"/>
+ <RegExpr attribute="Keyword" String="\;\s*(while|until)\b(?!.*\bdo\b)" context="#stay" beginRegion="def block"/>
+ <RegExpr attribute="Keyword" String="(if|unless)\b" context="#stay" beginRegion="def block" firstNonSpace="true"/>
+ <RegExpr attribute="Keyword" String="\;\s*(if|unless)\b" context="#stay" beginRegion="def block"/>
+ <RegExpr attribute="Keyword" String="\bclass\b" context="#stay" beginRegion="def block"/>
+ <RegExpr attribute="Keyword" String="\bmodule\b" context="#stay" beginRegion="def block"/>
+ <RegExpr attribute="Keyword" String="\bbegin\b" context="#stay" beginRegion="def block"/>
+ <RegExpr attribute="Keyword" String="\bfor\b(?!.*\bdo\b)" context="#stay" beginRegion="def block"/>
+ <RegExpr attribute="Keyword" String="\bcase\b" context="#stay" beginRegion="def block"/>
+ <RegExpr attribute="Keyword" String="\bdo\b" context="#stay" beginRegion="def block"/>
+ <RegExpr attribute="Keyword" String="\bdef\b" context="#stay" beginRegion="def block"/>
+ <RegExpr attribute="Keyword" String="\bend\b" context="#stay" endRegion="def block"/>
+ <!-- elsif/else close the current block and start a new one -->
+ <RegExpr attribute="Keyword" String="(\b|^\s*)(else|elsif|rescue|ensure)(\s+|$)" context="#stay" endRegion="def block" beginRegion="def block"/>
+
+ <StringDetect attribute="Operator" String="..." context="#stay"/>
+ <Detect2Chars attribute="Operator" char="." char1="." context="#stay"/>
+
+ <!-- marks a message (being sent, not defined) -->
+ <RegExpr attribute="Message" String="\.[_a-z][_a-zA-Z0-9]*(\?|\!|\b)" context="#stay"/>
+
+ <!-- Check for "ASCII code operator". e.g.: ?a -->
+ <RegExpr attribute="Dec" String="\s\?(\\M\-)?(\\C\-)?\\?\S" context="#stay"/>
+
+ <keyword attribute="Keyword" String="keywords" context="#stay"/>
+ <keyword attribute="Attribute Definition" String="attribute-definitions" context="#stay"/>
+ <keyword attribute="Access Control" String="access-control" context="#stay"/>
+ <keyword attribute="Definition" String="definitions" context="#stay" />
+ <keyword attribute="Pseudo variable" String="pseudo-variables" context="#stay"/>
+ <keyword attribute="Default globals" String="default-globals" context="#stay"/>
+ <keyword attribute="Kernel methods" String="kernel-methods" context="#stay"/>
+
+ <!-- (global) vars starting with $
+ Match them before $_.
+ -->
+ <RegExpr attribute="Global Variable" String="\$[a-zA-Z_0-9]+" context="#stay"/>
+ <RegExpr attribute="Global Variable" String="\$\-[a-zA-z_]\b" context="#stay"/>
+ <!-- special-character globals -->
+ <RegExpr attribute="Default globals" String="\$[\d_*`\!:?'/\\\-\&amp;]" context="#stay"/>
+ <RegExpr attribute="Global Constant" String="\b[_A-Z]+[A-Z_0-9]+\b" context="#stay"/>
+ <!-- Generally a module or class name like "File", "MyModule_1", .. -->
+ <RegExpr attribute="Constant" String="\b[A-Z]+_*([0-9]|[a-z])[_a-zA-Z0-9]*\b" context="#stay"/>
+
+ <RegExpr attribute="Hex" String="\b\-?0[xX][_0-9a-fA-F]+" context="#stay"/>
+ <RegExpr attribute="Bin" String="\b\-?0[bB][_01]+" context="#stay"/>
+ <RegExpr attribute="Octal" String="\b\-?0[1-7][_0-7]*" context="#stay"/>
+ <RegExpr attribute="Float" String="\b\-?[0-9][0-9_]*\.[0-9][0-9_]*([eE]\-?[1-9][0-9]*(\.[0-9]*)?)?" context="#stay"/>
+ <RegExpr attribute="Dec" String="\b\-?[1-9][0-9_]*\b" context="#stay"/>
+ <Int attribute="Dec" context="#stay"/>
+ <HlCChar attribute="Char" context="#stay"/>
+
+ <!-- Check for =begin before assignment operator. -->
+ <StringDetect attribute="Blockcomment" String="=begin" context="Embedded documentation" beginRegion="comment block" column="0"/>
+
+ <!-- recognize the beginning of a HEREDOC
+ This uses new features in Kate 2.3 and later
+
+ There is no other chance of keeping heredoc apart from the
+ push operator '<<' than requiring to put space between the operator
+ and the string.
+ -->
+ <RegExpr attribute="Operator" context="find_indented_heredoc" String="\s*&lt;&lt;-(?=\w+|[&quot;'])" beginRegion="HereDocument" />
+ <RegExpr attribute="Operator" context="find_heredoc" String="\s*&lt;&lt;(?=\w+|[&quot;'])" beginRegion="HereDocument" />
+
+ <DetectChar attribute="Operator" char="." context="#stay"/>
+ <Detect2Chars attribute="Operator" char="&amp;" char1="&amp;" context="#stay"/>
+ <Detect2Chars attribute="Operator" char="|" char1="|" context="#stay"/>
+ <RegExpr attribute="Operator" String="\s[\?\:\%/]\s" context="#stay"/>
+ <RegExpr attribute="Operator" String="[|&amp;&lt;&gt;\^\+*~\-=]+" context="#stay"/>
+ <!-- regexp hack -->
+ <RegExpr attribute="Operator" String="\s!" context="#stay"/>
+ <RegExpr attribute="Operator" String="/=\s" context="#stay" insensitive="0"/>
+ <StringDetect attribute="Operator" String="%=" context="#stay" insensitive="0"/>
+ <Detect2Chars attribute="Operator" char=":" char1=":" context="Member Access"/>
+
+ <RegExpr attribute="Symbol" String=":[a-zA-Z_][a-zA-Z0-9_]*" context="#stay"/>
+
+ <DetectChar attribute="String" char="&quot;" context="Quoted String"/>
+ <DetectChar attribute="Raw String" char="'" context="Apostrophed String"/>
+ <DetectChar attribute="Command" char="`" context="Command String"/>
+
+ <StringDetect attribute="Normal Text" String="?#" context="#stay"/>
+
+ <RegExpr attribute="Comment" String="#\s*BEGIN.*$" context="#stay" beginRegion="marker" column="0"/>
+ <RegExpr attribute="Comment" String="#\s*END.*$" context="#stay" endRegion="marker" column="0"/>
+ <RegExpr attribute="Comment" String="#" context="Comment Line" firstNonSpace="true"/>
+ <RegExpr attribute="Comment" String="\s#" context="General Comment"/>
+
+ <RegExpr attribute="Delimiter" String="[\[\]]+" context="#stay"/>
+ <DetectChar attribute="Delimiter" char="{" context="#stay" beginRegion="def block"/>
+ <DetectChar attribute="Delimiter" char="}" context="#stay" endRegion="def block"/>
+
+ <RegExpr attribute="Instance Variable" String="@[a-zA-Z_0-9]+" context="#stay"/>
+ <RegExpr attribute="Class Variable" String="@@[a-zA-Z_0-9]+" context="#stay"/>
+
+ <!-- handle the different regular expression formats -->
+ <DetectChar attribute="Regular Expression" char="/" context="RegEx 1"/>
+
+ <!-- recognize the beginning of a general delimited input format -->
+ <!-- this moves to the next context to separate out the exact nature of the GDL input -->
+ <RegExpr attribute="GDL input" context="find_gdl_input" String="\s*[%](?=[Qqxw]?[^\s&gt;])" beginRegion="GdlInput" />
+ </context>
+
+ <context name="Line Continue" attribute="Ruby Normal Text" lineEndContext="#pop">
+ <RegExpr attribute="Keyword" String="(while|until)\b(?!.*\bdo\b)" context="#stay" firstNonSpace="true"/>
+ <RegExpr attribute="Keyword" String="(if|unless)\b" context="#stay" firstNonSpace="true"/>
+ <IncludeRules context="rubysource"/>
+ </context>
+
+ <context name="Quoted String" attribute="String" lineEndContext="#stay">
+ <StringDetect attribute="String" String="\\" context="#stay"/>
+ <RegExpr attribute="String" String="\\\&quot;" context="#stay"/>
+ <RegExpr attribute="Substitution" String="#@{1,2}" context="Short Subst"/>
+ <Detect2Chars attribute="Substitution" char="#" char1="{" context="Subst"/>
+ <!--HlCChar attribute="Char" context="#pop"/-->
+ <DetectChar char="&quot;" attribute="String" context="#pop"/>
+ </context>
+
+ <context name="Apostrophed String" attribute="Raw String" lineEndContext="#stay">
+ <!-- <HlCChar attribute="Char" context="#pop"/> -->
+ <StringDetect attribute="String" String="\\" context="#stay"/>
+ <RegExpr attribute="String" String="\\\'" context="#stay"/>
+ <DetectChar char="'" attribute="Raw String" context="#pop"/>
+ </context>
+
+ <context name="Command String" attribute="Command" lineEndContext="#stay">
+ <StringDetect attribute="String" String="\\" context="#stay"/>
+ <RegExpr attribute="String" String="\\\`" context="#stay"/>
+ <RegExpr attribute="Substitution" String="#@{1,2}" context="Short Subst"/>
+ <Detect2Chars attribute="Substitution" char="#" char1="{" context="Subst"/>
+ <HlCChar attribute="Char" context="#pop"/>
+ <DetectChar char="`" attribute="Command" context="#pop"/>
+ </context>
+
+ <context name="Embedded documentation" attribute="Ruby Comment" lineEndContext="#stay">
+ <StringDetect attribute="Ruby Comment" String="=end" context="#pop" endRegion="comment block" column="0"/>
+ </context>
+
+ <context name="RegEx 1" attribute="Regular Expression" lineEndContext="#stay">
+ <RegExpr attribute="Regular Expression" String="\\\/" context="#stay"/>
+ <RegExpr attribute="Regular Expression" String="[^\\]$" context="#pop"/>
+ <RegExpr attribute="Substitution" String="#@{1,2}" context="Short Subst"/>
+ <Detect2Chars attribute="Substitution" char="#" char1="{" context="Subst"/>
+ <RegExpr attribute="Regular Expression" String="/[uiomxn]*" context="#pop"/>
+ </context>
+
+ <!-- Substitutions can be nested -->
+ <context name="Subst" attribute="Ruby Normal Text" lineEndContext="#stay">
+ <DetectChar attribute="Substitution" char="}" context="#pop"/>
+ <!-- Highlight substitution as code. -->
+ <IncludeRules context="rubysource"/>
+ </context>
+
+ <context name="Short Subst" attribute="Substitution" lineEndContext="#pop">
+ <!-- Check for e.g.: "#@var#@@xy" -->
+ <RegExpr attribute="Substitution" String="#@{1,2}" context="#stay"/>
+ <RegExpr attribute="Substitution" String="\w(?!\w)" context="#pop"/>
+ </context>
+
+ <!-- This handles access of nested module classes and class methods -->
+ <context name="Member Access" attribute="Member" lineEndContext="#pop">
+ <!-- marks a message (being sent, not defined) -->
+ <RegExpr attribute="Message" String="\.?[_a-z]\w*(\?|\!)?(?=[^\w\d\.\:])" context="#pop"/>
+ <RegExpr attribute="Message" String="\.?[_a-z]\w*(\?|\!)?" context="#stay"/>
+ <RegExpr attribute="Constant" String="[A-Z]+_*(\d|[a-z])\w*(?=[^\w\d\.\:])" context="#pop"/>
+ <RegExpr attribute="Constant" String="[A-Z]+_*([0-9]|[a-z])\w*" context="#stay"/>
+ <RegExpr attribute="Constant Value" String="[_A-Z][_A-Z0-9]*(?=[^\w\d\.\:])" context="#pop"/>
+ <RegExpr attribute="Constant Value" String="[_A-Z][_A-Z0-9]*" context="#stay"/>
+ <Detect2Chars attribute="Operator" char=":" char1=":" context="#stay"/>
+ <DetectChar attribute="Member" char="." context="#stay"/>
+
+ <AnyChar attribute="Operator" String="=+-*/%|&amp;[]{}~" context="#pop"/>
+ <DetectChar attribute="Ruby Comment" char="#" context="#pop"/>
+ <AnyChar attribute="Ruby Normal Text" String="()\" context="#pop"/>
+ <RegExpr attribute="Member" String="\W" context="#pop"/>
+ </context>
+
+ <context name="Comment Line" attribute="Ruby Comment" lineEndContext="#pop">
+ <RegExpr attribute="Ruby Comment" String="\w\:\:\s" context="RDoc Label"/>
+ <keyword attribute="Alert" String="attention" context="#stay"/>
+ <RegExpr attribute="Keyword" context="#pop#pop" String="-?%&gt;" />
+ </context>
+
+ <context name="General Comment" attribute="Ruby Comment" lineEndContext="#pop">
+ <keyword attribute="Dec" String="attention" context="#stay"/>
+ </context>
+
+ <context name="RDoc Label" attribute="RDoc Value" lineEndContext="#pop"/>
+
+ <!-- HEREDOC support
+ The contexts below support both normal and indented heredocs
+ -->
+ <!-- here we markup the heredoc markers -->
+ <context name="find_heredoc" attribute="Ruby Normal Text" lineEndContext="#pop" >
+ <RegExpr attribute="Keyword" context="apostrophed_normal_heredoc" String="'(\w+)'" />
+ <RegExpr attribute="Keyword" context="normal_heredoc" String="&quot;?(\w+)&quot;?" />
+ </context>
+ <context name="find_indented_heredoc" attribute="Ruby Normal Text" lineEndContext="#pop" >
+ <RegExpr attribute="Keyword" context="apostrophed_indented_heredoc" String="'(\w+)'" />
+ <RegExpr attribute="Keyword" context="indented_heredoc" String="&quot;?(\w+)&quot;?" />
+ </context>
+ <!-- these are the real heredoc contexts -->
+ <context name="indented_heredoc" attribute="Ruby Normal Text" lineEndContext="#stay" dynamic="true">
+ <!-- <RegExpr attribute="Keyword" context="#pop#pop" String="^\s*%1$" dynamic="true" endRegion="HereDocument"/>-->
+ <RegExpr attribute="Keyword" context="#pop#pop" String="%1$" dynamic="true" endRegion="HereDocument" firstNonSpace="true"/>
+ <IncludeRules context="heredoc_rules" />
+ </context>
+ <context name="apostrophed_indented_heredoc" attribute="Ruby Normal Text" lineEndContext="#stay" dynamic="true">
+ <!-- <RegExpr attribute="Keyword" context="#pop#pop" String="^\s*%1$" dynamic="true" endRegion="HereDocument"/>-->
+ <RegExpr attribute="Keyword" context="#pop#pop" String="%1$" dynamic="true" endRegion="HereDocument" firstNonSpace="true"/>
+ </context>
+
+ <context name="normal_heredoc" attribute="Ruby Normal Text" lineEndContext="#stay" dynamic="true">
+ <!-- <RegExpr attribute="Keyword" context="#pop#pop" String="^%1$" dynamic="true" endRegion="HereDocument"/>-->
+ <RegExpr attribute="Keyword" context="#pop#pop" String="%1$" dynamic="true" endRegion="HereDocument" column="0"/>
+ <IncludeRules context="heredoc_rules" />
+ </context>
+ <context name="apostrophed_normal_heredoc" attribute="Ruby Normal Text" lineEndContext="#stay" dynamic="true">
+ <!-- <RegExpr attribute="Keyword" context="#pop#pop" String="^%1$" dynamic="true" endRegion="HereDocument"/>-->
+ <RegExpr attribute="Keyword" context="#pop#pop" String="%1$" dynamic="true" endRegion="HereDocument" column="0"/>
+ </context>
+
+ <!-- rules for heredoc types -->
+ <context name="heredoc_rules" attribute="Ruby Normal Text" lineEndContext="#stay">
+ <RegExpr attribute="Substitution" String="#@{1,2}" context="Short Subst"/>
+ <Detect2Chars attribute="Substitution" char="#" char1="{" context="Subst"/>
+ </context>
+
+ <!-- General delimited input support
+ The contexts below handle the various gdl formats
+ -->
+ <context name="find_gdl_input" attribute="Ruby Normal Text" lineEndContext="#pop">
+
+ <!-- handle token arrays -->
+ <RegExpr attribute="GDL input" context="gdl_token_array_1" String="w\(" />
+ <RegExpr attribute="GDL input" context="gdl_token_array_2" String="w\{" />
+ <RegExpr attribute="GDL input" context="gdl_token_array_3" String="w\[" />
+ <RegExpr attribute="GDL input" context="gdl_token_array_4" String="w&lt;" />
+ <!-- then we handle the 'any char' format -->
+ <RegExpr attribute="GDL input" context="gdl_token_array_5" String="w([^\s\w])" />
+
+ <!-- handle apostrophed strings -->
+ <RegExpr attribute="GDL input" context="gdl_apostrophed_1" String="q\(" />
+ <RegExpr attribute="GDL input" context="gdl_apostrophed_2" String="q\{" />
+ <RegExpr attribute="GDL input" context="gdl_apostrophed_3" String="q\[" />
+ <RegExpr attribute="GDL input" context="gdl_apostrophed_4" String="q&lt;" />
+ <!-- then we handle the 'any char' format -->
+ <RegExpr attribute="GDL input" context="gdl_apostrophed_5" String="q([^\s\w])" />
+
+ <!-- handle shell commands -->
+ <RegExpr attribute="GDL input" context="gdl_shell_command_1" String="x\(" />
+ <RegExpr attribute="GDL input" context="gdl_shell_command_2" String="x\{" />
+ <RegExpr attribute="GDL input" context="gdl_shell_command_3" String="x\[" />
+ <RegExpr attribute="GDL input" context="gdl_shell_command_4" String="x&lt;" />
+ <!-- then we handle the 'any char' format -->
+ <RegExpr attribute="GDL input" context="gdl_shell_command_5" String="x([^\s\w])" />
+
+ <!-- handle regular expressions -->
+ <RegExpr attribute="GDL input" context="gdl_regexpr_1" String="r\(" />
+ <RegExpr attribute="GDL input" context="gdl_regexpr_2" String="r\{" />
+ <RegExpr attribute="GDL input" context="gdl_regexpr_3" String="r\[" />
+ <RegExpr attribute="GDL input" context="gdl_regexpr_4" String="r&lt;" />
+ <!-- then we handle the 'any char' format -->
+ <RegExpr attribute="GDL input" context="gdl_regexpr_5" String="r([^\s\w])" />
+
+ <!-- handle double-quoted strings -->
+ <!--
+ be careful to make this the last GDL ruleset, because the rule for
+ the short form %?foo? will otherwise catch any of the other formats
+ -->
+ <RegExpr attribute="GDL input" context="gdl_dq_string_1" String="Q?\(" />
+ <RegExpr attribute="GDL input" context="gdl_dq_string_2" String="Q?\{" />
+ <RegExpr attribute="GDL input" context="gdl_dq_string_3" String="Q?\[" />
+ <RegExpr attribute="GDL input" context="gdl_dq_string_4" String="Q?&lt;" />
+ <!-- then we handle the 'any char' format -->
+ <RegExpr attribute="GDL input" context="gdl_dq_string_5" String="Q?([^\s\w])" />
+
+ </context>
+ <!-- double-quoted string specific contexts follow -->
+ <context name="gdl_dq_string_1" attribute="String" lineEndContext="#stay" >
+ <IncludeRules context="dq_string_rules" />
+ <Detect2Chars attribute="String" char="\" char1=")" context="#stay"/>
+ <DetectChar attribute="String" context="gdl_dq_string_1_nested" char="(" />
+ <DetectChar attribute="GDL input" context="#pop#pop" char=")" endRegion="GdlInput" />
+ </context>
+ <context name="gdl_dq_string_1_nested" attribute="String" lineEndContext="#stay" >
+ <IncludeRules context="dq_string_rules" />
+ <DetectChar attribute="String" context="gdl_dq_string_1_nested" char="(" />
+ <DetectChar attribute="String" context="#pop" char=")" />
+ </context>
+ <!-- note that here substitution should win over nesting -->
+ <context name="gdl_dq_string_2" attribute="String" lineEndContext="#stay" >
+ <IncludeRules context="dq_string_rules" />
+ <Detect2Chars attribute="String" char="\" char1="}" context="#stay"/>
+ <DetectChar attribute="GDL input" context="#pop#pop" char="}" endRegion="GdlInput" />
+ <DetectChar attribute="String" context="gdl_dq_string_2_nested" char="{" />
+ </context>
+ <context name="gdl_dq_string_2_nested" attribute="String" lineEndContext="#stay" >
+ <DetectChar attribute="String" context="gdl_dq_string_2_nested" char="{" />
+ <DetectChar attribute="String" context="#pop" char="}" />
+ <IncludeRules context="dq_string_rules" />
+ </context>
+
+ <context name="gdl_dq_string_3" attribute="String" lineEndContext="#stay" >
+ <IncludeRules context="dq_string_rules" />
+ <Detect2Chars attribute="String" char="\" char1="]" context="#stay"/>
+ <DetectChar attribute="String" context="gdl_dq_string_3_nested" char="[" />
+ <DetectChar attribute="GDL input" context="#pop#pop" char="]" endRegion="GdlInput" />
+ </context>
+ <context name="gdl_dq_string_3_nested" attribute="String" lineEndContext="#stay" >
+ <DetectChar attribute="String" context="gdl_dq_string_3_nested" char="[" />
+ <DetectChar attribute="String" context="#pop" char="]" />
+ <IncludeRules context="dq_string_rules" />
+ </context>
+
+ <context name="gdl_dq_string_4" attribute="String" lineEndContext="#stay" >
+ <IncludeRules context="dq_string_rules" />
+ <Detect2Chars attribute="String" char="\" char1="&gt;" context="#stay"/>
+ <DetectChar attribute="String" context="gdl_dq_string_4_nested" char="&lt;" />
+ <DetectChar attribute="GDL input" context="#pop#pop" char="&gt;" endRegion="GdlInput" />
+ </context>
+ <context name="gdl_dq_string_4_nested" attribute="String" lineEndContext="#stay" >
+ <DetectChar attribute="String" context="gdl_dq_string_4_nested" char="&lt;" />
+ <DetectChar attribute="String" context="#pop" char="&gt;" />
+ <IncludeRules context="dq_string_rules" />
+ </context>
+
+ <!-- this format doesn't allow nesting. it is terminated by the next occurence of the
+ delimiter character
+ -->
+ <context name="gdl_dq_string_5" attribute="String" lineEndContext="#stay" dynamic="true">
+ <IncludeRules context="dq_string_rules" />
+ <RegExpr attribute="String" String="\\%1" context="#stay" dynamic="true" />
+ <RegExpr attribute="GDL input" context="#pop#pop" String="\s*%1" dynamic="true" endRegion="GdlInput" />
+ </context>
+ <!-- rules to be included in all dq_string contexts -->
+ <context name="dq_string_rules" attribute="String" lineEndContext="#stay" >
+ <Detect2Chars attribute="String" char="\" char1="\" context="#stay"/>
+ <RegExpr attribute="Substitution" String="#@{1,2}" context="Short Subst"/>
+ <Detect2Chars attribute="Substitution" char="#" char1="{" context="Subst"/>
+ </context>
+
+ <!-- token array specific contexts -->
+
+ <context name="gdl_token_array_1" attribute="String" lineEndContext="#stay" >
+ <IncludeRules context="token_array_rules" />
+ <Detect2Chars attribute="String" char="\" char1=")" context="#stay"/>
+ <DetectChar attribute="String" context="gdl_token_array_1_nested" char="(" />
+ <DetectChar attribute="GDL input" context="#pop#pop" char=")" endRegion="GdlInput" />
+ </context>
+ <context name="gdl_token_array_1_nested" attribute="String" lineEndContext="#stay" >
+ <IncludeRules context="token_array_rules" />
+ <DetectChar attribute="String" context="gdl_token_array_1_nested" char="(" />
+ <DetectChar attribute="String" context="#pop" char=")" />
+ </context>
+
+ <context name="gdl_token_array_2" attribute="String" lineEndContext="#stay" >
+ <IncludeRules context="token_array_rules" />
+ <Detect2Chars attribute="String" char="\" char1="}" context="#stay"/>
+ <DetectChar attribute="GDL input" context="#pop#pop" char="}" endRegion="GdlInput" />
+ <DetectChar attribute="String" context="gdl_token_array_2_nested" char="{" />
+ </context>
+ <context name="gdl_token_array_2_nested" attribute="String" lineEndContext="#stay" >
+ <IncludeRules context="token_array_rules" />
+ <DetectChar attribute="String" context="gdl_token_array_2_nested" char="{" />
+ <DetectChar attribute="String" context="#pop" char="}" />
+ </context>
+
+ <context name="gdl_token_array_3" attribute="String" lineEndContext="#stay" >
+ <IncludeRules context="token_array_rules" />
+ <Detect2Chars attribute="String" char="\" char1="]" context="#stay"/>
+ <DetectChar attribute="String" context="gdl_token_array_3_nested" char="[" />
+ <DetectChar attribute="GDL input" context="#pop#pop" char="]" endRegion="GdlInput" />
+ </context>
+ <context name="gdl_token_array_3_nested" attribute="String" lineEndContext="#stay" >
+ <IncludeRules context="token_array_rules" />
+ <DetectChar attribute="String" context="gdl_token_array_3_nested" char="[" />
+ <DetectChar attribute="String" context="#pop" char="]" />
+ </context>
+
+ <context name="gdl_token_array_4" attribute="String" lineEndContext="#stay" >
+ <IncludeRules context="token_array_rules" />
+ <Detect2Chars attribute="String" char="\" char1="&gt;" context="#stay"/>
+ <DetectChar attribute="String" context="gdl_token_array_4_nested" char="&lt;" />
+ <DetectChar attribute="GDL input" context="#pop#pop" char="&gt;" endRegion="GdlInput" />
+ </context>
+ <context name="gdl_token_array_4_nested" attribute="String" lineEndContext="#stay" >
+ <IncludeRules context="token_array_rules" />
+ <DetectChar attribute="String" context="gdl_token_array_4_nested" char="&lt;" />
+ <DetectChar attribute="String" context="#pop" char="&gt;" />
+ </context>
+
+ <!-- this format doesn't allow nesting. it is terminated by the next occurence of the
+ delimiter character
+ -->
+ <context name="gdl_token_array_5" attribute="String" lineEndContext="#stay" dynamic="true">
+ <IncludeRules context="token_array_rules" />
+ <RegExpr attribute="String" String="\\%1" context="#stay" dynamic="true"/>
+ <RegExpr attribute="GDL input" context="#pop#pop" String="\s*%1" dynamic="true" endRegion="GdlInput" />
+ </context>
+
+ <!-- rules to be included in all token_array contexts -->
+ <context name="token_array_rules" attribute="String" lineEndContext="#stay" >
+ <StringDetect attribute="String" String="\\" context="#stay"/>
+ </context>
+
+ <!-- apostrophed string specific contexts -->
+
+ <context name="gdl_apostrophed_1" attribute="Raw String" lineEndContext="#stay" >
+ <IncludeRules context="apostrophed_rules" />
+ <Detect2Chars attribute="Raw String" char="\" char1=")" context="#stay"/>
+ <DetectChar attribute="Raw String" context="gdl_apostrophed_1_nested" char="(" />
+ <DetectChar attribute="GDL input" context="#pop#pop" char=")" endRegion="GdlInput" />
+ </context>
+ <context name="gdl_apostrophed_1_nested" attribute="Raw String" lineEndContext="#stay" >
+ <IncludeRules context="apostrophed_rules" />
+ <DetectChar attribute="Raw String" context="gdl_apostrophed_1_nested" char="(" />
+ <DetectChar attribute="Raw String" context="#pop" char=")" />
+ </context>
+
+ <context name="gdl_apostrophed_2" attribute="Raw String" lineEndContext="#stay" >
+ <IncludeRules context="apostrophed_rules" />
+ <Detect2Chars attribute="Raw String" char="\" char1="}" context="#stay"/>
+ <DetectChar attribute="GDL input" context="#pop#pop" char="}" endRegion="GdlInput" />
+ <DetectChar attribute="Raw String" context="gdl_apostrophed_2_nested" char="{" />
+ </context>
+ <context name="gdl_apostrophed_2_nested" attribute="Raw String" lineEndContext="#stay" >
+ <IncludeRules context="apostrophed_rules" />
+ <DetectChar attribute="Raw String" context="gdl_apostrophed_2_nested" char="{" />
+ <DetectChar attribute="Raw String" context="#pop" char="}" />
+ </context>
+
+ <context name="gdl_apostrophed_3" attribute="Raw String" lineEndContext="#stay" >
+ <IncludeRules context="apostrophed_rules" />
+ <Detect2Chars attribute="Raw String" char="\" char1="]" context="#stay"/>
+ <DetectChar attribute="Raw String" context="gdl_apostrophed_3_nested" char="[" />
+ <DetectChar attribute="GDL input" context="#pop#pop" char="]" endRegion="GdlInput" />
+ </context>
+ <context name="gdl_apostrophed_3_nested" attribute="Raw String" lineEndContext="#stay" >
+ <IncludeRules context="apostrophed_rules" />
+ <DetectChar attribute="Raw String" context="gdl_apostrophed_3_nested" char="[" />
+ <DetectChar attribute="Raw String" context="#pop" char="]" />
+ </context>
+
+ <context name="gdl_apostrophed_4" attribute="Raw String" lineEndContext="#stay" >
+ <IncludeRules context="apostrophed_rules" />
+ <Detect2Chars attribute="Raw String" char="\" char1="&gt;" context="#stay"/>
+ <DetectChar attribute="Raw String" context="gdl_apostrophed_4_nested" char="&lt;" />
+ <DetectChar attribute="GDL input" context="#pop#pop" char="&gt;" endRegion="GdlInput" />
+ </context>
+ <context name="gdl_apostrophed_4_nested" attribute="Raw String" lineEndContext="#stay" >
+ <IncludeRules context="apostrophed_rules" />
+ <DetectChar attribute="Raw String" context="gdl_apostrophed_4_nested" char="&lt;" />
+ <DetectChar attribute="Raw String" context="#pop" char="&gt;" />
+ </context>
+
+ <!-- this format doesn't allow nesting. it is terminated by the next occurence of the
+ delimiter character
+ -->
+ <context name="gdl_apostrophed_5" attribute="Raw String" lineEndContext="#stay" dynamic="true">
+ <IncludeRules context="apostrophed_rules" />
+ <RegExpr attribute="Raw String" String="\\%1" context="#stay" dynamic="true"/>
+ <RegExpr attribute="GDL input" context="#pop#pop" String="\s*%1" dynamic="true" endRegion="GdlInput" />
+ </context>
+
+ <!-- rules to be included in all apostrophed contexts -->
+ <context name="apostrophed_rules" attribute="Raw String" lineEndContext="#stay" >
+ <Detect2Chars attribute="Raw String" char="\" char1="\" context="#stay"/>
+ </context>
+
+ <!-- shell command specific contexts -->
+
+ <context name="gdl_shell_command_1" attribute="Command" lineEndContext="#stay" >
+ <IncludeRules context="shell_command_rules" />
+ <Detect2Chars attribute="Command" char="\" char1=")" context="#stay"/>
+ <DetectChar attribute="Command" context="gdl_shell_command_1_nested" char="(" />
+ <DetectChar attribute="GDL input" context="#pop#pop" char=")" endRegion="GdlInput" />
+ </context>
+ <context name="gdl_shell_command_1_nested" attribute="Command" lineEndContext="#stay" >
+ <IncludeRules context="shell_command_rules" />
+ <DetectChar attribute="Command" context="gdl_shell_command_1_nested" char="(" />
+ <DetectChar attribute="Command" context="#pop" char=")" />
+ </context>
+
+ <context name="gdl_shell_command_2" attribute="Command" lineEndContext="#stay" >
+ <IncludeRules context="shell_command_rules" />
+ <Detect2Chars attribute="Command" char="\" char1="}" context="#stay"/>
+ <DetectChar attribute="GDL input" context="#pop#pop" char="}" endRegion="GdlInput" />
+ <DetectChar attribute="Command" context="gdl_shell_command_2_nested" char="{" />
+ </context>
+ <context name="gdl_shell_command_2_nested" attribute="Command" lineEndContext="#stay" >
+ <IncludeRules context="shell_command_rules" />
+ <DetectChar attribute="Command" context="gdl_shell_command_2_nested" char="{" />
+ <DetectChar attribute="Command" context="#pop" char="}" />
+ </context>
+
+ <context name="gdl_shell_command_3" attribute="Command" lineEndContext="#stay" >
+ <IncludeRules context="shell_command_rules" />
+ <Detect2Chars attribute="Command" char="\" char1="]" context="#stay"/>
+ <DetectChar attribute="Command" context="gdl_shell_command_3_nested" char="[" />
+ <DetectChar attribute="GDL input" context="#pop#pop" char="]" endRegion="GdlInput" />
+ </context>
+ <context name="gdl_shell_command_3_nested" attribute="Command" lineEndContext="#stay" >
+ <IncludeRules context="shell_command_rules" />
+ <DetectChar attribute="Command" context="gdl_shell_command_3_nested" char="[" />
+ <DetectChar attribute="Command" context="#pop" char="]" />
+ </context>
+
+ <context name="gdl_shell_command_4" attribute="Command" lineEndContext="#stay" >
+ <IncludeRules context="shell_command_rules" />
+ <Detect2Chars attribute="Command" char="\" char1="&gt;" context="#stay"/>
+ <DetectChar attribute="Command" context="gdl_shell_command_4_nested" char="&lt;" />
+ <DetectChar attribute="GDL input" context="#pop#pop" char="&gt;" endRegion="GdlInput" />
+ </context>
+ <context name="gdl_shell_command_4_nested" attribute="Command" lineEndContext="#stay" >
+ <IncludeRules context="shell_command_rules" />
+ <DetectChar attribute="Command" context="gdl_shell_command_4_nested" char="&lt;" />
+ <DetectChar attribute="Command" context="#pop" char="&gt;" />
+ </context>
+
+ <!-- this format doesn't allow nesting. it is terminated by the next occurence of the
+ delimiter character
+ -->
+ <context name="gdl_shell_command_5" attribute="Command" lineEndContext="#stay" dynamic="true">
+ <IncludeRules context="shell_command_rules" />
+ <RegExpr attribute="Command" String="\\%1" context="#stay" dynamic="true" />
+ <RegExpr attribute="GDL input" context="#pop#pop" String="\s*%1" dynamic="true" endRegion="GdlInput" />
+ </context>
+
+ <!-- rules to be included in all shell_command contexts -->
+ <context name="shell_command_rules" attribute="Command" lineEndContext="#stay" >
+ <Detect2Chars attribute="Command" char="\" char1="\" context="#stay"/>
+ <RegExpr attribute="Substitution" String="#@{1,2}" context="Short Subst"/>
+ <Detect2Chars attribute="Substitution" char="#" char1="{" context="Subst"/>
+ </context>
+
+ <!-- regular expression specific contexts -->
+
+ <context name="gdl_regexpr_1" attribute="Regular Expression" lineEndContext="#stay" >
+ <IncludeRules context="regexpr_rules" />
+ <Detect2Chars attribute="Regular Expression" char="\" char1=")" context="#stay"/>
+ <DetectChar attribute="Regular Expression" context="gdl_regexpr_1_nested" char="(" />
+ <RegExpr attribute="GDL input" context="#pop#pop" String="\)[uiomxn]*" endRegion="GdlInput" />
+ </context>
+ <context name="gdl_regexpr_1_nested" attribute="Regular Expression" lineEndContext="#stay" >
+ <IncludeRules context="regexpr_rules" />
+ <DetectChar attribute="Regular Expression" context="gdl_regexpr_1_nested" char="(" />
+ <DetectChar attribute="Regular Expression" context="#pop" char=")" />
+ </context>
+
+ <context name="gdl_regexpr_2" attribute="Regular Expression" lineEndContext="#stay" >
+ <IncludeRules context="regexpr_rules" />
+ <Detect2Chars attribute="Regular Expression" char="\" char1="}" context="#stay"/>
+ <RegExpr attribute="GDL input" context="#pop#pop" String="\}[uiomxn]*" endRegion="GdlInput" />
+ <DetectChar attribute="Regular Expression" context="gdl_regexpr_2_nested" char="{" />
+ </context>
+ <context name="gdl_regexpr_2_nested" attribute="Regular Expression" lineEndContext="#stay" >
+ <IncludeRules context="regexpr_rules" />
+ <DetectChar attribute="Regular Expression" context="gdl_regexpr_2_nested" char="{" />
+ <DetectChar attribute="Regular Expression" context="#pop" char="}" />
+ </context>
+
+ <context name="gdl_regexpr_3" attribute="Regular Expression" lineEndContext="#stay" >
+ <IncludeRules context="regexpr_rules" />
+ <Detect2Chars attribute="Regular Expression" char="\" char1="]" context="#stay"/>
+ <DetectChar attribute="Regular Expression" context="gdl_regexpr_3_nested" char="[" />
+ <RegExpr attribute="GDL input" context="#pop#pop" String="\][uiomxn]*" endRegion="GdlInput" />
+ </context>
+ <context name="gdl_regexpr_3_nested" attribute="Regular Expression" lineEndContext="#stay" >
+ <IncludeRules context="regexpr_rules" />
+ <DetectChar attribute="Regular Expression" context="gdl_regexpr_3_nested" char="[" />
+ <DetectChar attribute="Regular Expression" context="#pop" char="]" />
+ </context>
+
+ <context name="gdl_regexpr_4" attribute="Regular Expression" lineEndContext="#stay" >
+ <IncludeRules context="regexpr_rules" />
+ <Detect2Chars attribute="Regular Expression" char="\" char1="&gt;" context="#stay"/>
+ <DetectChar attribute="Regular Expression" context="gdl_regexpr_4_nested" char="&lt;" />
+ <RegExpr attribute="GDL input" context="#pop#pop" String="&gt;[uiomxn]*" endRegion="GdlInput" />
+ </context>
+ <context name="gdl_regexpr_4_nested" attribute="Regular Expression" lineEndContext="#stay" >
+ <IncludeRules context="regexpr_rules" />
+ <DetectChar attribute="Regular Expression" context="gdl_regexpr_4_nested" char="&lt;" />
+ <DetectChar attribute="Regular Expression" context="#pop" char="&gt;" />
+ </context>
+
+ <!-- this format doesn't allow nesting. it is terminated by the next occurence of the
+ delimiter character
+ -->
+ <context name="gdl_regexpr_5" attribute="Regular Expression" lineEndContext="#stay" dynamic="true">
+ <IncludeRules context="regexpr_rules" />
+ <RegExpr attribute="Regular Expression" String="\\%1" context="#stay" dynamic="true" />
+ <RegExpr attribute="GDL input" context="#pop#pop" String="\s*%1[uiomxn]*" dynamic="true" endRegion="GdlInput" />
+ </context>
+
+ <!-- rules to be included in all regexpr contexts -->
+ <context name="regexpr_rules" attribute="Regular Expression" lineEndContext="#stay" >
+ <Detect2Chars attribute="Regular Expression" char="\" char1="\" context="#stay"/>
+ <RegExpr attribute="Substitution" String="#@{1,2}" context="Short Subst"/>
+ <Detect2Chars attribute="Substitution" char="#" char1="{" context="Subst"/>
+ </context>
+
+ <!-- END of General delimited input support -->
+
+ <!-- handle data in script -->
+ <context name="DATA" attribute="Data" lineEndContext="#stay"/>
+ <!-- END Ruby contexts -->
+ </contexts>
+
+ <itemDatas>
+ <!-- BEGIN Ruby itemData -->
+ <itemData name="Ruby Normal Text" defStyleNum="dsNormal"/>
+
+ <itemData name="Keyword" defStyleNum="dsKeyword"/>
+ <itemData name="Attribute Definition" defStyleNum="dsOthers"/>
+ <itemData name="Access Control" defStyleNum="dsKeyword" color="#0000FF"/>
+ <itemData name="Definition" defStyleNum="dsKeyword"/>
+ <itemData name="Pseudo variable" defStyleNum="dsDecVal"/>
+
+ <itemData name="Dec" defStyleNum="dsDecVal"/>
+ <itemData name="Float" defStyleNum="dsFloat"/>
+ <itemData name="Char" defStyleNum="dsChar"/>
+ <itemData name="Octal" defStyleNum="dsBaseN"/>
+ <itemData name="Hex" defStyleNum="dsBaseN"/>
+ <itemData name="Bin" defStyleNum="dsBaseN"/>
+
+ <itemData name="Symbol" defStyleNum="dsString" color="#D40000"/>
+ <itemData name="String" defStyleNum="dsString"/>
+ <itemData name="Raw String" defStyleNum="dsString" color="#DD4A4A" selColor="#DD4A4A"/>
+ <itemData name="Command" defStyleNum="dsString" color="#AA3000"/>
+ <itemData name="Message" defStyleNum="dsNormal" color="#4000A7"/> <!-- #4A00C0 -->
+ <itemData name="Regular Expression" defStyleNum="dsOthers" color="#4A5704"/>
+ <itemData name="Substitution" defStyleNum="dsOthers"/>
+ <itemData name="Data" defStyleNum="dsNormal"/>
+ <!-- short for 'general delimited input' -->
+ <itemData name="GDL input" defStyleNum="dsOthers" />
+
+ <itemData name="Default globals" defStyleNum="dsDataType" color="#C00000" bold="1"/>
+ <itemData name="Global Variable" defStyleNum="dsDataType" color="#C00000"/>
+ <itemData name="Global Constant" defStyleNum="dsDataType" color="#bb1188" bold="1"/>
+ <itemData name="Constant" defStyleNum="dsDataType"/>
+ <itemData name="Constant Value" defStyleNum="dsDataType" color="#bb1188"/>
+ <itemData name="Kernel methods" defStyleNum="dsNormal" color="#000080" selColor="#ffffff"/> <!-- #CC0E86 -->
+ <itemData name="Member" defStyleNum="dsNormal"/>
+ <itemData name="Instance Variable" defStyleNum="dsOthers"/>
+ <itemData name="Class Variable" defStyleNum="dsOthers"/>
+
+ <itemData name="Ruby Comment" defStyleNum="dsComment"/>
+ <itemData name="Blockcomment" defStyleNum="dsComment"/>
+ <itemData name="Region Marker" defStyleNum="dsNormal" color="#0000ff"/>
+ <itemData name="RDoc Value" defStyleNum="dsOthers"/>
+
+ <!-- use these to mark errors and alerts things -->
+ <itemData name="Error" defStyleNum="dsError" />
+ <itemData name="Alert" defStyleNum="dsAlert" />
+
+ <itemData name="Delimiter" defStyleNum="dsChar"/>
+ <itemData name="Expression" defStyleNum="dsOthers"/>
+ <itemData name="Operator" defStyleNum="dsChar"/>
+ <!-- END Ruby itemData -->
+
+ <!-- BEGIN HTML itemData -->
+ <itemData name="Normal Text" defStyleNum="dsNormal" />
+ <itemData name="Comment" defStyleNum="dsComment" />
+ <itemData name="CDATA" defStyleNum="dsBaseN" bold="1" />
+ <itemData name="Processing Instruction" defStyleNum="dsKeyword" />
+ <itemData name="Doctype" defStyleNum="dsDataType" bold="1" />
+ <itemData name="Element" defStyleNum="dsKeyword" />
+ <itemData name="Attribute" defStyleNum="dsOthers" />
+ <itemData name="Value" defStyleNum="dsString" color="#a00" />
+ <itemData name="EntityRef" defStyleNum="dsDecVal" />
+ <itemData name="PEntityRef" defStyleNum="dsDecVal" />
+ <itemData name="Error" defStyleNum="dsError" />
+ <!-- END HTML itemData -->
+
+ </itemDatas>
+ </highlighting>
+ <general>
+ <comments>
+ <comment name="singleLine" start="#"/>
+ <comment name="multiLine" start="&lt;!--" end="--&gt;" />
+ </comments>
+ <keywords casesensitive="1" weakDeliminator="!?"/>
+ </general>
+</language>
diff --git a/kate/data/rib.xml b/kate/data/rib.xml
new file mode 100644
index 000000000..8472016a9
--- /dev/null
+++ b/kate/data/rib.xml
@@ -0,0 +1,143 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+
+<!--Kate syntax file for RenderMan Interface Byte stream-->
+<!--By David Williams-->
+<!--Email david@david-williams.info-->
+
+<language name="RenderMan RIB" version="1.00" kateversion="2.3" section="Other" mimetype="" extensions="*.rib" author="David Williams &lt;david@david-williams.info&gt;" license="LGPL">
+ <highlighting>
+ <list name="Graphics States">
+ <item> AreaLightSource </item>
+ <item> Attribute </item>
+ <item> AttributeBegin </item>
+ <item> AttributeEnd </item>
+ <item> Begin </item>
+ <item> Bound </item>
+ <item> Clipping </item>
+ <item> Color </item>
+ <item> ColorSamples </item>
+ <item> ConcatTransform </item>
+ <item> CoordinateSystem </item>
+ <item> CropWindow </item>
+ <item> Declare </item>
+ <item> DepthOfField </item>
+ <item> Detail </item>
+ <item> DetailRange </item>
+ <item> Displacement </item>
+ <item> Display </item>
+ <item> End </item>
+ <item> Exterior </item>
+ <item> Format </item>
+ <item> FrameAspectRatio </item>
+ <item> FrameBegin </item>
+ <item> FrameEnd </item>
+ <item> GeometricApproximation </item>
+ <item> Hider </item>
+ <item> Identity </item>
+ <item> Illuminance </item>
+ <item> Illuminate </item>
+ <item> Interior </item>
+ <item> LightSource </item>
+ <item> Matte </item>
+ <item> Opacity </item>
+ <item> Option </item>
+ <item> Orientation </item>
+ <item> Perspective </item>
+ <item> PixelFilter </item>
+ <item> PixelSamples </item>
+ <item> PixelVariance </item>
+ <item> Projection </item>
+ <item> Quantize </item>
+ <item> RelativeDetail </item>
+ <item> Rotate </item>
+ <item> Scale </item>
+ <item> ScreenWindow </item>
+ <item> ShadingInterpolation </item>
+ <item> ShadingRate </item>
+ <item> Shutter </item>
+ <item> Sides </item>
+ <item> Skew </item>
+ <item> Surface </item>
+ <item> TextureCoordinates </item>
+ <item> Transform </item>
+ <item> TransformBegin </item>
+ <item> TransformEnd </item>
+ <item> TransformPoints </item>
+ <item> Translate </item>
+ <item> version </item>
+ <item> WorldBegin </item>
+ <item> WorldEnd </item>
+ </list>
+ <list name="Geometric Primitives">
+ <item> Basis </item>
+ <item> Cylinder </item>
+ <item> Disk </item>
+ <item> GeneralPolygon </item>
+ <item> Geometry </item>
+ <item> Hyperboloid </item>
+ <item> NuPatch </item>
+ <item> ObjectBegin </item>
+ <item> ObjectEnd </item>
+ <item> ObjectInstance </item>
+ <item> Patch </item>
+ <item> Paraboloid </item>
+ <item> PointsPolygons </item>
+ <item> PointsGeneralPolygons </item>
+ <item> Polygon </item>
+ <item> Procedural </item>
+ <item> SolidBegin </item>
+ <item> SolidEnd </item>
+ <item> Sphere </item>
+ <item> Torus </item>
+ </list>
+ <list name="Motions">
+ <item> MotionBegin </item>
+ <item> MotionEnd </item>
+ </list>
+ <list name="External Resources">
+ <item> MakeBump </item>
+ <item> MakeCubeFaceEnvironment </item>
+ <item> MakeLatLongEnvironment </item>
+ <item> MakeTexture </item>
+ <item> ArchiveRecord </item>
+ <item> ErrorHandler </item>
+ </list>
+ <contexts>
+ <context attribute="Normal Text" lineEndContext="#stay" name="Normal">
+
+ <keyword attribute="Graphics State" context="#stay" String="Graphics States"/>
+ <keyword attribute="Geometric Primitive" context="#stay" String="Geometric Primitives"/>
+ <keyword attribute="Motion" context="#stay" String="Motions"/>
+ <keyword attribute="External Resource" context="#stay" String="External Resources"/>
+
+ <Float attribute="Float" context="#stay"/>
+ <Int attribute="Integer" context="#stay"/>
+ <DetectChar attribute="String" context="String" char="&quot;"/>
+ <DetectChar attribute="Comment" context="Comment" char="#"/>
+ </context>
+ <context name="String" attribute="String" lineEndContext="#pop">
+ <DetectChar attribute="String" context="#pop" char="&quot;"/>
+ </context>
+ <context name="Comment" attribute="Comment" lineEndContext="#pop"/>
+ </contexts>
+ <itemDatas>
+ <itemData name="Normal Text" defStyleNum="dsNormal"/>
+
+ <itemData name="Graphics State" defStyleNum="dsKeyword"/>
+ <itemData name="Geometric Primitive" defStyleNum="dsKeyword"/>
+ <itemData name="Motion" defStyleNum="dsKeyword"/>
+ <itemData name="External Resource" defStyleNum="dsKeyword"/>
+
+ <itemData name="Float" defStyleNum="dsFloat"/>
+ <itemData name="Integer" defStyleNum="dsDecVal"/>
+ <itemData name="String" defStyleNum="dsString"/>
+ <itemData name="Comment" defStyleNum="dsComment"/>
+ </itemDatas>
+ </highlighting>
+ <general>
+ <comments>
+ <comment name="singleLine" start="#" />
+ </comments>
+ </general>
+</language>
diff --git a/kate/data/rpmspec.xml b/kate/data/rpmspec.xml
new file mode 100644
index 000000000..246bb264d
--- /dev/null
+++ b/kate/data/rpmspec.xml
@@ -0,0 +1,80 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+<language name="RPM Spec" version="1.1" kateversion="2.4" section="Other" extensions="*.spec" mimetype="">
+ <highlighting>
+ <list name="keywords">
+ <item> Name </item>
+ <item> Summary </item>
+ <item> Version </item>
+ <item> Epoch </item>
+ <item> Serial </item>
+ <item> Release </item>
+ <item> Source </item>
+ <item> Group </item>
+ <item> Copyright </item>
+ <item> License </item>
+ <item> Vendor </item>
+ <item> Distribution </item>
+ <item> Packager </item>
+ <item> Url </item>
+ <item> URL </item>
+ <item> Prefix </item>
+ <item> Conflicts </item>
+ <item> Obsoletes </item>
+ <item> Provides </item>
+ <item> PreReq </item>
+ <item> Requires </item>
+ <item> BuildArch </item>
+ <item> BuildArchitectures </item>
+ <item> BuildConflicts </item>
+ <item> BuildRequires </item>
+ <item> BuildRoot </item>
+ <item> ExclusiveArch </item>
+ <item> ExclusiveOs </item>
+ <item> ExcludeArch </item>
+ <item> ExcludeOs </item>
+ </list>
+ <list name="types">
+ <item> GPL </item>
+ <item> LGPL </item>
+ <item> Artistic </item>
+ </list>
+ <contexts>
+
+ <context attribute="Normal Text" lineEndContext="#stay" name="Normal">
+ <keyword attribute="Keyword" context="#stay" String="keywords"/>
+ <keyword attribute="Data" context="#stay" String="types"/>
+ <RegExpr attribute="Red" context="#stay" String="%\w*" />
+ <DetectChar attribute="Comment" context="Comment" char="#" />
+ <RegExpr attribute="Keyword" context="Some Context" String="\{\w*" />
+ <RegExpr attribute="Blue" context="Some Context2" String="&lt;\s*[\w@\.]*" />
+ <RegExpr attribute="Data" context="#stay" String="\$\w*" />
+ <RegExpr attribute="Keyword" context="#stay" String="(Source|Patch)\d*" />
+ <RegExpr attribute="Keyword" context="#stay" String="\*.*" firstNonSpace="true"/> <!-- ChangeLog -->
+ <Int attribute="Blue" context="#stay" />
+ </context>
+
+ <context attribute="Comment" lineEndContext="#pop" name="Comment"/>
+
+ <context attribute="Keyword" lineEndContext="#pop" name="Some Context">
+ <DetectChar attribute="Keyword" char="}" context="#pop"/>
+ </context>
+
+ <context attribute="Blue" lineEndContext="#pop" name="Some Context2">
+ <DetectChar attribute="Blue" char="&gt;" context="#pop"/>
+ </context>
+
+ </contexts>
+ <itemDatas>
+ <itemData name="Normal Text" defStyleNum="dsNormal"/>
+ <itemData name="Keyword" defStyleNum="dsKeyword"/>
+ <itemData name="Red" defStyleNum="dsString"/>
+ <itemData name="Comment" defStyleNum="dsComment"/>
+ <itemData name="Blue" defStyleNum="dsDecVal"/>
+ <itemData name="Data" defStyleNum="dsDataType"/>
+ </itemDatas>
+ </highlighting>
+ <general>
+ <keywords casesensitive="1" />
+ </general>
+</language>
diff --git a/kate/data/rsiidl.xml b/kate/data/rsiidl.xml
new file mode 100644
index 000000000..574e19143
--- /dev/null
+++ b/kate/data/rsiidl.xml
@@ -0,0 +1,440 @@
+<?xml version="1.0" encoding="UTF-8"?> <!-- KATE Syntax Highlighting for RSI IDL -->
+<!DOCTYPE language SYSTEM "language.dtd"><!-- Created by Markus Fraenz,fraenz@linmpi.mpg.de Aug 2002 -->
+<language name="RSI IDL" version="1.04" kateversion="2.1" section="Sources" extensions="*.pro" mimetype="text/x-rsiidl-src" author="Markus Fraenz (fraenz@linmpi.mpg.de)" license="">
+ <highlighting>
+ <list name="reserved words">
+ <item> For </item>
+ <item> Do </item>
+ <item> Endfor </item>
+ <item> Repeat </item>
+ <item> Endrep </item>
+ <item> While </item>
+ <item> Endwhile </item>
+ <item> Until </item>
+ <item> Case </item>
+ <item> Endcase </item>
+ <item> If </item>
+ <item> Endif </item>
+ <item> Else </item>
+ <item> Endelse </item>
+ <item> Then </item>
+ <item> Begin </item>
+ <item> End </item>
+ <item> Function </item>
+ <item> Goto </item>
+ <item> Pro </item>
+ <item> Eq </item>
+ <item> Ge </item>
+ <item> Gt </item>
+ <item> Le </item>
+ <item> Lt </item>
+ <item> Ne </item>
+ <item> Mod </item>
+ <item> Or </item>
+ <item> Xor </item>
+ <item> Not </item>
+ <item> And </item>
+ <item> Then </item>
+ <item> Return </item>
+ <item> Common </item>
+ <item> Of </item>
+ <item> On_ioerror </item>
+ </list>
+ <list name="system variables">
+ <item>dpi</item>
+ <item>dtor</item>
+ <item>map</item>
+ <item>pi</item>
+ <item>radeg</item>
+ <item>values</item>
+ <item>err</item>
+ <item>error_state</item>
+ <item>error</item>
+ <item>err_string</item>
+ <item>except</item>
+ <item>mouse</item>
+ <item>msg_prefix</item>
+ <item>syserror</item>
+ <item>syserr_string</item>
+ <item>warn</item>
+ <item>dir</item>
+ <item>dlm_path</item>
+ <item>edit_input</item>
+ <item>help_path</item>
+ <item>journal</item>
+ <item>more</item>
+ <item>path</item>
+ <item>prompt</item>
+ <item>quiet</item>
+ <item>version</item>
+ <item>c</item>
+ <item>d</item>
+ <item>order</item>
+ <item>p</item>
+ <item>x</item>
+ <item>y</item>
+ <item>z</item>
+ <item>stime</item>
+ </list>
+ <list name="types"><!-- IDL5 Data types and variable creation -->
+ <item>Fix </item>
+ <item>Long </item>
+ <item>Long64 </item>
+ <item>uint </item>
+ <item>Byte </item>
+ <item>Float </item>
+ <item>Double </item>
+ <item>complex </item>
+ <item>dcomplex </item>
+ <item>complexarr </item>
+ <item>dcomplexarr </item>
+ <item>String </item>
+ <item>Intarr </item>
+ <item>lonarr </item>
+ <item>lon64arr </item>
+ <item>uintarr </item>
+ <item>ulong </item>
+ <item>ulonarr </item>
+ <item>ulon64arr </item>
+ <item>Bytarr </item>
+ <item>Bytscl </item>
+ <item>Fltarr </item>
+ <item>Dblarr </item>
+ <item>Strarr </item>
+ <item>Objarr </item>
+ <item>Indgen </item>
+ <item>Findgen </item>
+ <item>Dindgen </item>
+ <item>Dcindgen </item>
+ <item>cindgen </item>
+ <item>lindgen </item>
+ <item>bindgen </item>
+ <item>sindgen </item>
+ <item>uindgen </item>
+ <item>ul64indgen </item>
+ <item>l64indgen </item>
+ <item>ulindgen </item>
+ <item>Replicate </item>
+ <item>Ptrarr </item>
+ </list>
+ <list name="commands"><!-- IDL5.3 build in routines, excluding lib functions and io functions -->
+ <item>ABS </item>
+ <item>ACOS </item>
+ <item>ADAPT_HIST_EQUAL </item>
+ <item>ALOG </item>
+ <item>ALOG10 </item>
+ <item>ARG_PRESENT </item>
+ <item>ASIN </item>
+ <item>ASSOC </item>
+ <item>ATAN </item>
+ <item>AXIS </item>
+ <item>BESELI </item>
+ <item>BESELJ </item>
+ <item>BESELY </item>
+ <item>BLAS_AXPY </item>
+ <item>BREAKPOINT </item>
+ <item>BROYDEN </item>
+ <item>BYTEORDER </item>
+ <item>CALL_EXTERNAL </item>
+ <item>CALL_FUNCTION </item>
+ <item>CALL_METHOD </item>
+ <item>CALL_PROCEDURE </item>
+ <item>CATCH </item>
+ <item>CEIL </item>
+ <item>CHECK_MATH </item>
+ <item>CHOLDC </item>
+ <item>CHOLSOL </item>
+ <item>COLOR_CONVERT </item>
+ <item>COLOR_QUAN </item>
+ <item>COMPILE_OPT </item>
+ <item>COMPUTE_MESH_NORMALS </item>
+ <item>CONJ </item>
+ <item>CONSTRAINED_MIN </item>
+ <item>CONTOUR </item>
+ <item>CONVERT_COORD </item>
+ <item>CONVOL </item>
+ <item>CORRELATE </item>
+ <item>COS </item>
+ <item>COSH </item>
+ <item>CREATE_STRUCT </item>
+ <item>CURSOR </item>
+ <item>DEFINE_KEY </item>
+ <item>DEFSYSV </item>
+ <item>DELVAR </item>
+ <item>DEVICE </item>
+ <item>DFPMIN </item>
+ <item>DIALOG_MESSAGE </item>
+ <item>DIALOG_PICKFILE </item>
+ <item>DIALOG_PRINTERSETUP </item>
+ <item>DIALOG_PRINTJOB </item>
+ <item>DILATE </item>
+ <item>DLM_LOAD </item>
+ <item>DRAW_ROI </item>
+ <item>ELMHES </item>
+ <item>EMPTY </item>
+ <item>ENABLE_SYSRTN </item>
+ <item>ERASE </item>
+ <item>ERODE </item>
+ <item>ERRORF </item>
+ <item>EXECUTE </item>
+ <item>EXIT </item>
+ <item>EXP </item>
+ <item>EXPAND_PATH </item>
+ <item>EXPINT </item>
+ <item>FINDFILE </item>
+ <item>FINITE </item>
+ <item>FLOOR </item>
+ <item>FORMAT_AXIS_VALUES </item>
+ <item>FORWARD_FUNCTION </item>
+ <item>FSTAT </item>
+ <item>FULSTR </item>
+ <item>FZ_ROOTS </item>
+ <item>GAUSSINT </item>
+ <item>GET_KBRD </item>
+ <item>GETENV </item>
+ <item>GRID_TPS </item>
+ <item>GRID3 </item>
+ <item>HEAP_GC </item>
+ <item>HELP </item>
+ <item>HISTOGRAM </item>
+ <item>HQR </item>
+ <item>IMAGE_STATISTICS </item>
+ <item>IMAGINARY </item>
+ <item>INTERPOLATE </item>
+ <item>INVERT </item>
+ <item>ISHFT </item>
+ <item>ISOCONTOUR </item>
+ <item>ISOSURFACE </item>
+ <item>JOURNAL </item>
+ <item>KEYWORD_SET </item>
+ <item>LABEL_REGION </item>
+ <item>LINBCG </item>
+ <item>LINKIMAGE </item>
+ <item>LMGR </item>
+ <item>LNGAMMA </item>
+ <item>LNP_TEST </item>
+ <item>LOADCT </item>
+ <item>LOCALE_GET </item>
+ <item>LSODE </item>
+ <item>LUDC </item>
+ <item>LUMPROVE </item>
+ <item>LUSOL </item>
+ <item>MACHAR </item>
+ <item>MAKE_ARRAY </item>
+ <item>MAP_PROJ_INFO </item>
+ <item>MAX </item>
+ <item>MEDIAN </item>
+ <item>MESH_CLIP </item>
+ <item>MESH_DECIMATE </item>
+ <item>MESH_ISSOLID </item>
+ <item>MESH_MERGE </item>
+ <item>MESH_NUMTRIANGLES </item>
+ <item>MESH_SMOOTH </item>
+ <item>MESH_SURFACEAREA </item>
+ <item>MESH_VALIDATE </item>
+ <item>MESH_VOLUME </item>
+ <item>MESSAGE </item>
+ <item>MIN </item>
+ <item>N_ELEMENTS </item>
+ <item>N_PARAMS </item>
+ <item>N_TAGS </item>
+ <item>NEWTON </item>
+ <item>OBJ_CLASS </item>
+ <item>OBJ_DESTROY </item>
+ <item>OBJ_ISA </item>
+ <item>OBJ_NEW </item>
+ <item>OBJ_VALID </item>
+ <item>ON_ERROR </item>
+ <item>OPLOT </item>
+ <item>PARTICLE_TRACE </item>
+ <item>PLOT </item>
+ <item>PLOTS </item>
+ <item>POLY_2D </item>
+ <item>POLYFILL </item>
+ <item>POLYFILLV </item>
+ <item>POLYSHADE </item>
+ <item>POWELL </item>
+ <item>PROFILER </item>
+ <item>PTR_FREE </item>
+ <item>PTR_NEW </item>
+ <item>PTR_VALID </item>
+ <item>QROMB </item>
+ <item>QROMO </item>
+ <item>QSIMP </item>
+ <item>RANDOMN </item>
+ <item>RANDOMU </item>
+ <item>REBIN </item>
+ <item>REFORM </item>
+ <item>RETALL </item>
+ <item>RETURN </item>
+ <item>RIEMANN </item>
+ <item>RK4 </item>
+ <item>ROBERTS </item>
+ <item>ROTATE </item>
+ <item>ROUND </item>
+ <item>SET_PLOT </item>
+ <item>SET_SHADING </item>
+ <item>SETENV </item>
+ <item>SHADE_SURF </item>
+ <item>SHADE_VOLUME </item>
+ <item>SHIFT </item>
+ <item>SIN </item>
+ <item>SINH </item>
+ <item>SIZE </item>
+ <item>SMOOTH </item>
+ <item>SOBEL </item>
+ <item>SORT </item>
+ <item>SPL_INIT </item>
+ <item>SPL_INTERP </item>
+ <item>SPRSAB </item>
+ <item>SPRSAX </item>
+ <item>SPRSIN </item>
+ <item>SQRT </item>
+ <item>STOP </item>
+ <item>STRCMP </item>
+ <item>STRCOMPRESS </item>
+ <item>STREGEX </item>
+ <item>STRJOIN </item>
+ <item>STRLEN </item>
+ <item>STRLOWCASE </item>
+ <item>STRMATCH </item>
+ <item>STRMESSAGE </item>
+ <item>STRMID </item>
+ <item>STRPOS </item>
+ <item>STRPUT </item>
+ <item>STRTRIM </item>
+ <item>STRUCT_ASSIGN </item>
+ <item>STRUCT_HIDE </item>
+ <item>STRUPCASE </item>
+ <item>SURFACE </item>
+ <item>SVDC </item>
+ <item>SVSOL </item>
+ <item>SYSTIME </item>
+ <item>TAG_NAMES </item>
+ <item>TAN </item>
+ <item>TANH </item>
+ <item>TEMPORARY </item>
+ <item>TETRA_CLIP </item>
+ <item>TETRA_SURFACE </item>
+ <item>TETRA_VOLUME </item>
+ <item>THIN </item>
+ <item>THREED </item>
+ <item>TOTAL </item>
+ <item>TRANSPOSE </item>
+ <item>TRIANGULATE </item>
+ <item>TRIGRID </item>
+ <item>TRIQL </item>
+ <item>TRIRED </item>
+ <item>TRISOL </item>
+ <item>TV </item>
+ <item>TVCRS </item>
+ <item>TVLCT </item>
+ <item>TVRD </item>
+ <item>TVSCLU </item>
+ <item>USERSYM </item>
+ <item>VALUE_LOCATE </item>
+ <item>VOIGT </item>
+ <item>VOXEL_PROJ </item>
+ <item>WAIT </item>
+ <item>WATERSHED </item>
+ <item>WDELETE </item>
+ <item>WHERE </item>
+ <item>WIDGET_BASE </item>
+ <item>WIDGET_BUTTON </item>
+ <item>WIDGET_CONTROL </item>
+ <item>WIDGET_DRAW </item>
+ <item>WIDGET_DROPLIST </item>
+ <item>WIDGET_EVENT </item>
+ <item>WIDGET_INFO </item>
+ <item>WIDGET_LABEL </item>
+ <item>WIDGET_LIST </item>
+ <item>WIDGET_SLIDER </item>
+ <item>WIDGET_TABLE </item>
+ <item>WIDGET_TEXT </item>
+ <item>WINDOW </item>
+ <item>WSET </item>
+ <item>WSHOW </item>
+ <item>WTN </item>
+ <item>XYOUTS </item>
+ </list>
+ <list name="io commands"><!-- IDL5.3 build in I/O routines -->
+ <item>Open </item>
+ <item>FLUSH </item>
+ <item>IOCTL </item>
+ <item>RESTORE </item>
+ <item>SAVE </item>
+ <item>POINT_LUN </item>
+ <item>Openr </item>
+ <item>Openw </item>
+ <item>Openu </item>
+ <item>Close </item>
+ <item>Free_lun </item>
+ <item>get_lun </item>
+ <item>assoc </item>
+ <item>catch </item>
+ <item>cd </item>
+ <item>spawn </item>
+ <item>eof </item>
+ <item>print </item>
+ <item>printf </item>
+ <item>prints </item>
+ <item>read </item>
+ <item>readf </item>
+ <item>reads </item>
+ <item>writu </item>
+ </list>
+ <contexts>
+ <context attribute="Normal Text" lineEndContext="#stay" name="Normal">
+ <keyword attribute="Keyword" context="#stay" String="reserved words"/>
+ <keyword attribute="Data Type" context="#stay" String="types"/>
+ <keyword attribute="Command" context="#stay" String="commands"/>
+ <keyword attribute="IOCommand" context="#stay" String="io commands"/>
+ <Float attribute="Octal" context="#stay"/>
+ <Int attribute="Decimal" context="#stay"/>
+ <RangeDetect attribute="String" context="#stay" char="'" char1="'"/>
+ <RangeDetect attribute="String" context="#stay" char="&quot;" char1="&quot;"/>
+ <DetectChar attribute="Hex" context="#stay" char="(" />
+ <DetectChar attribute="Hex" context="#stay" char=")" />
+ <DetectChar attribute="Char" context="#stay" char="[" />
+ <DetectChar attribute="Char" context="#stay" char="]" />
+ <DetectChar attribute="Float" context="#stay" char="{" />
+ <DetectChar attribute="Float" context="#stay" char="}" />
+ <DetectChar attribute="Char" context="#stay" char="$" />
+ <DetectChar attribute="Char" context="#stay" char="@" />
+ <DetectChar attribute="Char" context="#stay" char=":" />
+ <DetectChar attribute="Char" context="Comment" char="&#59;"/>
+ <DetectChar attribute="Char" context="systemvarcontext" char="!" />
+ </context>
+ <context attribute="Comment" lineEndContext="#pop" name="Comment">
+ </context>
+ <context attribute="Char" lineEndContext="#pop" name="systemvarcontext">
+ <DetectChar attribute="Hex" context="#pop" char="(" />
+ <DetectChar attribute="Char" context="#pop" char="." />
+ <DetectChar attribute="Hex" context="#pop" char=" " />
+ <keyword attribute="Float" context="#pop" String="system variables"/>
+ </context>
+ </contexts>
+ <itemDatas>
+ <itemData name="Normal Text" defStyleNum="dsNormal"/>
+ <itemData name="Keyword" defStyleNum="dsKeyword" color="#1414e4" selColor="#ffd60b" bold="1"/>
+ <itemData name="Data Type" defStyleNum="dsDataType"/>
+ <itemData name="Decimal" defStyleNum="dsDecVal" color="#000000" selColor="#ffffff"/>
+ <itemData name="Octal" defStyleNum="dsDecVal"/>
+ <itemData name="Hex" defStyleNum="dsDecVal"/>
+ <itemData name="Float" defStyleNum="dsDecVal" color="#000000" selColor="#ffffff"/>
+ <itemData name="Char" defStyleNum="dsChar"/>
+ <itemData name="String" defStyleNum="dsString" color="#ff0000" selColor="#ff0000"/>
+ <itemData name="String Char" defStyleNum="dsChar" color="#ff0000" selColor="#ff0000"/>
+ <itemData name="Comment" defStyleNum="dsComment" color="#2b7805" selColor="#945ca4"/>
+ <itemData name="Command" defStyleNum="dsBaseN" color="#050505" selColor="#ffffff" bold="1"/>
+ <itemData name="IOCommand" defStyleNum="dsDataType" color="#050505" selColor="#ffffff" bold="1"/>
+ <itemData name="bracketed" defStyleNum="dsFloat" />
+ </itemDatas>
+ </highlighting>
+ <general>
+ <comments>
+ <comment name="singleLine" start="&#59;" />
+ </comments>
+ <keywords casesensitive="0" />
+ </general>
+</language>
diff --git a/kate/data/ruby.xml b/kate/data/ruby.xml
new file mode 100644
index 000000000..76b88f719
--- /dev/null
+++ b/kate/data/ruby.xml
@@ -0,0 +1,908 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+
+<!--
+ Ruby syntax highlighting definition for Kate.
+
+ Copyright (C) 2004 by Sebastian Vuorinen (sebastian dot vuorinen at helsinki dot fi)
+ Copyright (C) 2004 by Stefan Lang (langstefan@gmx.at)
+ Copyright (C) 2008 by Robin Pedersen (robin.pedersen@runbox.com)
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the
+ Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+-->
+
+<!--
+ TODO: * "Nested" HERE documents aren't recognized.
+ * Division after gdl contexts is interpreted as regexp
+-->
+
+<!-- Hold the "language" opening tag on a single line, as mentioned in "language.dtd". -->
+<language name="Ruby" version="1.17" kateversion="2.4" section="Scripts" extensions="*.rb;*.rjs;*.rxml;*.xml.erb;*.js.erb" mimetype="application/x-ruby" author="Stefan Lang (langstefan@gmx.at), Sebastian Vuorinen (sebastian.vuorinen@helsinki.fi), Robin Pedersen (robin.pedersen@runbox.com)" license="LGPL">
+
+ <highlighting>
+
+ <list name="keywords">
+ <item> BEGIN </item>
+ <item> END </item>
+ <item> and </item>
+ <item> begin </item>
+ <item> break </item>
+ <item> case </item>
+ <item> defined? </item>
+ <item> do </item>
+ <item> else </item>
+ <item> elsif </item>
+ <item> end </item>
+ <item> ensure </item>
+ <item> for </item>
+ <item> if </item>
+ <item> in </item>
+ <item> include </item>
+ <item> next </item>
+ <item> not </item>
+ <item> or </item>
+ <item> redo </item>
+ <item> rescue </item>
+ <item> retry </item>
+ <item> return </item>
+ <item> then </item>
+ <item> unless </item>
+ <item> until </item>
+ <item> when </item>
+ <item> while </item>
+ <item> yield </item>
+ </list>
+
+ <list name="access-control">
+ <item> private_class_method </item>
+ <item> private </item>
+ <item> protected </item>
+ <item> public_class_method </item>
+ <item> public </item>
+ </list>
+
+ <list name="attribute-definitions">
+ <item> attr_reader </item>
+ <item> attr_writer </item>
+ <item> attr_accessor </item>
+ </list>
+
+ <list name="definitions">
+ <item> alias </item>
+ <item> module </item>
+ <item> class </item>
+ <item> def </item>
+ <item> undef </item>
+ </list>
+
+ <list name="pseudo-variables">
+ <item> self </item>
+ <item> super </item>
+ <item> nil </item>
+ <item> false </item>
+ <item> true </item>
+ <item> caller </item>
+ <item> __FILE__ </item>
+ <item> __LINE__ </item>
+ </list>
+
+ <list name="default-globals">
+ <item> $stdout </item>
+ <item> $defout </item>
+ <item> $stderr </item>
+ <item> $deferr </item>
+ <item> $stdin </item>
+ </list>
+
+ <!-- Kernel module methods.
+ NOTE: Methods ending in ? or !
+ are included below as regexes.
+ -->
+ <list name="kernel-methods">
+ <!-- backquote ` -->
+ <item> abort </item>
+ <item> at_exit </item>
+ <item> autoload </item>
+ <item> autoload? </item>
+ <item> binding </item>
+ <item> block_given? </item>
+ <item> callcc </item>
+ <item> caller </item>
+ <item> catch </item>
+ <item> chomp </item>
+ <item> chomp! </item>
+ <item> chop </item>
+ <item> chop! </item>
+ <item> eval </item>
+ <item> exec </item>
+ <item> exit </item>
+ <item> exit! </item>
+ <item> fail </item>
+ <item> fork </item>
+ <item> format </item>
+ <item> getc </item>
+ <item> gets </item>
+ <item> global_variables </item>
+ <item> gsub </item>
+ <item> gsub! </item>
+ <item> iterator? </item>
+ <item> lambda </item>
+ <item> load </item>
+ <item> local_variables </item>
+ <item> loop </item>
+ <item> method_missing </item>
+ <item> open </item>
+ <item> p </item>
+ <item> print </item>
+ <item> printf </item>
+ <item> proc </item>
+ <item> putc </item>
+ <item> puts </item>
+ <item> raise </item>
+ <item> rand </item>
+ <item> readline </item>
+ <item> readlines </item>
+ <item> require </item>
+ <item> scan </item>
+ <item> select </item>
+ <item> set_trace_func </item>
+ <item> sleep </item>
+ <item> split </item>
+ <item> sprintf </item>
+ <item> srand </item>
+ <item> sub </item>
+ <item> sub! </item>
+ <item> syscall </item>
+ <item> system </item>
+ <item> test </item>
+ <item> throw </item>
+ <item> trace_var </item>
+ <item> trap </item>
+ <item> untrace_var </item>
+ <item> warn </item>
+ </list>
+
+ <list name="attention">
+ <item> TODO </item>
+ <item> FIXME </item>
+ <item> NOTE </item>
+ </list>
+
+ <contexts>
+ <context name="Normal" attribute="Normal Text" lineEndContext="#stay">
+ <!-- ruby ignores newline after \ -->
+ <LineContinue attribute="Normal Text" context="Line Continue"/>
+
+ <!-- __END__ token on own line. -->
+ <RegExpr attribute="Keyword" String="__END__$" context="DATA" column="0"/>
+
+ <!-- "shebang" line -->
+ <RegExpr attribute="Keyword" String="#!\/.*" context="#stay" column="0"/>
+
+ <!-- "def" - "end" blocks -->
+ <!-- check for statement modifiers with regexes -->
+ <DetectChar attribute="Operator" char="{" context="Find closing block brace" beginRegion="def block"/>
+ <RegExpr attribute="Keyword" String="(\=|\(|\[|\{)\s*(if|unless|while|until)\b" context="#stay" beginRegion="def block"/>
+ <RegExpr attribute="Keyword" String="(while|until)\b(?!.*\bdo\b)" context="#stay" beginRegion="def block" firstNonSpace="true"/>
+ <RegExpr attribute="Keyword" String="\;\s*(while|until)\b(?!.*\bdo\b)" context="#stay" beginRegion="def block"/>
+ <RegExpr attribute="Keyword" String="(if|unless)\b" context="#stay" beginRegion="def block" firstNonSpace="true"/>
+ <RegExpr attribute="Keyword" String="\;\s*(if|unless)\b" context="#stay" beginRegion="def block"/>
+ <RegExpr attribute="Keyword" String="\bclass\b" context="#stay" beginRegion="def block"/>
+ <RegExpr attribute="Keyword" String="\bmodule\b" context="#stay" beginRegion="def block"/>
+ <RegExpr attribute="Keyword" String="\bbegin\b" context="#stay" beginRegion="def block"/>
+ <RegExpr attribute="Keyword" String="\bfor\b(?!.*\bdo\b)" context="#stay" beginRegion="def block"/>
+ <RegExpr attribute="Keyword" String="\bcase\b" context="#stay" beginRegion="def block"/>
+ <RegExpr attribute="Keyword" String="\bdo\b" context="#stay" beginRegion="def block"/>
+ <RegExpr attribute="Keyword" String="\bdef\b" context="#stay" beginRegion="def block"/>
+ <RegExpr attribute="Keyword" String="\bend\b" context="#stay" endRegion="def block"/>
+ <!-- elsif/else close the current block and start a new one -->
+ <RegExpr attribute="Keyword" String="(\b|^\s*)(else|elsif|rescue|ensure)(\b|$)" context="#stay" endRegion="def block" beginRegion="def block"/>
+
+ <StringDetect attribute="Operator" String="..." context="#stay"/>
+ <Detect2Chars attribute="Operator" char="." char1="." context="#stay"/>
+
+ <!-- marks a message (being sent, not defined) -->
+ <RegExpr attribute="Message" String="\.[_a-z][_a-zA-Z0-9]*(\?|\!|\b)" context="check_div_2"/>
+
+ <!-- Check for "ASCII code operator". e.g.: ?a -->
+ <RegExpr attribute="Dec" String="\s\?(\\M\-)?(\\C\-)?\\?\S" context="check_div_1"/>
+
+ <keyword attribute="Keyword" String="keywords" context="#stay"/>
+ <keyword attribute="Attribute Definition" String="attribute-definitions" context="check_div_2"/>
+ <keyword attribute="Access Control" String="access-control" context="check_div_2"/>
+ <keyword attribute="Definition" String="definitions" context="#stay" />
+ <keyword attribute="Pseudo variable" String="pseudo-variables" context="check_div_1"/>
+ <keyword attribute="Default globals" String="default-globals" context="check_div_2"/>
+ <keyword attribute="Kernel methods" String="kernel-methods" context="check_div_2"/>
+
+ <!-- (global) vars starting with $
+ Match them before $_.
+ -->
+ <RegExpr attribute="Global Variable" String="\$[a-zA-Z_0-9]+" context="check_div_1"/>
+ <RegExpr attribute="Global Variable" String="\$\-[a-zA-z_]\b" context="check_div_1"/>
+ <!-- special-character globals -->
+ <RegExpr attribute="Default globals" String="\$[\d_*`\!:?'/\\\-\&amp;&quot;]" context="check_div_1"/>
+ <RegExpr attribute="Global Constant" String="\b[_A-Z]+[A-Z_0-9]+\b" context="check_div_2"/>
+ <!-- Generally a module or class name like "File", "MyModule_1", .. -->
+ <RegExpr attribute="Constant" String="\b[A-Z]+_*([0-9]|[a-z])[_a-zA-Z0-9]*\b" context="check_div_2"/>
+
+ <RegExpr attribute="Hex" String="\b\-?0[xX][_0-9a-fA-F]+" context="check_div_1"/>
+ <RegExpr attribute="Bin" String="\b\-?0[bB][_01]+" context="check_div_1"/>
+ <RegExpr attribute="Octal" String="\b\-?0[1-7][_0-7]*" context="check_div_1"/>
+ <RegExpr attribute="Float" String="\b\-?[0-9][0-9_]*\.[0-9][0-9_]*([eE]\-?[1-9][0-9]*(\.[0-9]*)?)?" context="check_div_1"/>
+ <RegExpr attribute="Dec" String="\b\-?[1-9][0-9_]*\b" context="check_div_1"/>
+ <Int attribute="Dec" context="check_div_1"/>
+ <HlCChar attribute="Char" context="check_div_1"/>
+
+ <!-- Check for =begin before assignment operator. -->
+ <StringDetect attribute="Blockcomment" String="=begin" context="Embedded documentation" beginRegion="comment block" column="0"/>
+
+ <!-- recognize the beginning of a HEREDOC
+ This uses new features in Kate 2.3 and later
+
+ There is no other chance of keeping heredoc apart from the
+ push operator '<<' than requiring to put space between the operator
+ and the string.
+ -->
+ <RegExpr attribute="Operator" context="find_indented_heredoc" String="\s*&lt;&lt;-(?=\w+|[&quot;'])" beginRegion="HereDocument" />
+ <RegExpr attribute="Operator" context="find_heredoc" String="\s*&lt;&lt;(?=\w+|[&quot;'])" beginRegion="HereDocument" />
+
+ <DetectChar attribute="Operator" char="." context="#stay"/>
+ <Detect2Chars attribute="Operator" char="&amp;" char1="&amp;" context="#stay"/>
+ <Detect2Chars attribute="Operator" char="|" char1="|" context="#stay"/>
+ <RegExpr attribute="Operator" String="\s[\?\:\%]\s" context="#stay"/>
+ <RegExpr attribute="Operator" String="[|&amp;&lt;&gt;\^\+*~\-=]+" context="#stay"/>
+ <!-- regexp hack -->
+ <RegExpr attribute="Operator" String="\s!" context="#stay"/>
+ <RegExpr attribute="Operator" String="/=\s" context="#stay" insensitive="0"/>
+ <StringDetect attribute="Operator" String="%=" context="#stay" insensitive="0"/>
+ <Detect2Chars attribute="Operator" char=":" char1=":" context="Member Access"/>
+
+ <RegExpr attribute="Symbol" String=":[a-zA-Z_][a-zA-Z0-9_]*" context="check_div_1"/>
+
+ <DetectChar attribute="String" char="&quot;" context="Quoted String"/>
+ <DetectChar attribute="Raw String" char="'" context="Apostrophed String"/>
+ <DetectChar attribute="Command" char="`" context="Command String"/>
+
+ <StringDetect attribute="Normal Text" String="?#" context="#stay"/>
+
+ <RegExpr attribute="Comment" String="#\s*BEGIN.*$" context="#stay" beginRegion="marker" column="0"/>
+ <RegExpr attribute="Comment" String="#\s*END.*$" context="#stay" endRegion="marker" column="0"/>
+ <DetectChar attribute="Comment" char="#" context="General Comment"/>
+
+ <DetectChar attribute="Delimiter" char="[" context="#stay"/>
+ <DetectChar attribute="Delimiter" char="]" context="check_div_1"/>
+ <DetectChar attribute="Delimiter" char="{" context="#stay" beginRegion="def block"/>
+ <DetectChar attribute="Delimiter" char="}" context="check_div_1" endRegion="def block"/>
+
+ <RegExpr attribute="Instance Variable" String="@[a-zA-Z_0-9]+" context="check_div_1"/>
+ <RegExpr attribute="Class Variable" String="@@[a-zA-Z_0-9]+" context="check_div_1"/>
+
+ <!-- handle the different regular expression formats -->
+ <DetectChar attribute="Regular Expression" char="/" context="RegEx 1"/>
+
+ <!-- recognize the beginning of a general delimited input format -->
+ <!-- this moves to the next context to separate out the exact nature of the GDL input -->
+ <RegExpr attribute="GDL input" context="find_gdl_input" String="\s*[%](?=[Qqxw]?[^\s])" beginRegion="GdlInput" />
+
+ <DetectChar attribute="Normal Text" char=")" context="check_div_1"/>
+ <DetectIdentifier attribute="Normal Text" context="check_div_2"/>
+
+ </context>
+
+ <!-- In the following contexts, a slash character ('/') is a division operator -->
+ <!-- Everywhere else, it's a regular expression delimiter -->
+
+ <!-- A slash is always a division operator, even if preceeded by whitespace -->
+ <context name="check_div_1" attribute="Normal Text" fallthrough="true" fallthroughContext="#pop" lineEndContext="#pop">
+ <RegExpr attribute="Normal Text" String="\s*" context="#stay"/>
+ <DetectChar attribute="Operator" char="/" context="#pop"/>
+ </context>
+
+ <!-- Same as check_div_1, but with double pop to exit the surrounding context -->
+ <context name="check_div_1_pop" attribute="Normal Text" fallthrough="true" fallthroughContext="#pop#pop" lineEndContext="#pop#pop">
+ <RegExpr attribute="Normal Text" String="\s*" context="#stay"/>
+ <DetectChar attribute="Operator" char="/" context="#pop#pop"/>
+ </context>
+
+ <!-- A slash is division operator if it's the first character, or if preceeded and followed by whitespace -->
+ <context name="check_div_2" attribute="Normal Text" fallthrough="true" fallthroughContext="#pop" lineEndContext="#pop">
+ <DetectChar attribute="Operator" char="/" context="#pop"/>
+ <RegExpr attribute="Normal Text" String="\s+" context="check_div_2_internal"/>
+ </context>
+
+ <!-- Internal context used by check_div_2 -->
+ <context name="check_div_2_internal" attribute="Normal Text" fallthrough="true" fallthroughContext="#pop#pop" lineEndContext="#pop#pop">
+ <RegExpr attribute="Operator" String="/(?=\s)" context="#pop#pop"/>
+ </context>
+
+ <!-- Same as check_div_2, but with double pop to exit the surrounding context -->
+ <context name="check_div_2_pop" attribute="Normal Text" fallthrough="true" fallthroughContext="#pop#pop" lineEndContext="#pop#pop">
+ <DetectChar attribute="Operator" char="/" context="#pop#pop"/>
+ <RegExpr attribute="Normal Text" String="\s+" context="check_div_2_pop_internal"/>
+ </context>
+
+ <!-- Internal context used by check_div_2_pop -->
+ <context name="check_div_2_pop_internal" attribute="Normal Text" fallthrough="true" fallthroughContext="#pop#pop#pop" lineEndContext="#pop#pop#pop">
+ <RegExpr attribute="Operator" String="/(?=\s)" context="#pop#pop#pop"/>
+ </context>
+
+ <context name="Line Continue" attribute="Normal Text" lineEndContext="#pop">
+ <RegExpr attribute="Keyword" String="(while|until)\b(?!.*\bdo\b)" context="#stay" firstNonSpace="true"/>
+ <RegExpr attribute="Keyword" String="(if|unless)\b" context="#stay" firstNonSpace="true"/>
+ <IncludeRules context="Normal"/>
+ </context>
+
+ <context name="Find closing block brace" attribute="Normal Text" lineEndContext="#stay">
+ <DetectChar attribute="Operator" char="}" context="check_div_1_pop" endRegion="def block"/>
+ <IncludeRules context="Normal"/>
+ </context>
+
+ <context name="Quoted String" attribute="String" lineEndContext="#stay">
+ <StringDetect attribute="String" String="\\" context="#stay"/>
+ <RegExpr attribute="String" String="\\\&quot;" context="#stay"/>
+ <RegExpr attribute="Substitution" String="#@{1,2}" context="Short Subst"/>
+ <Detect2Chars attribute="Substitution" char="#" char1="{" context="Subst"/>
+ <!--HlCChar attribute="Char" context="#pop"/-->
+ <DetectChar char="&quot;" attribute="String" context="check_div_1_pop"/>
+ </context>
+
+ <context name="Apostrophed String" attribute="Raw String" lineEndContext="#stay">
+ <!-- <HlCChar attribute="Char" context="#pop"/> -->
+ <StringDetect attribute="String" String="\\" context="#stay"/>
+ <RegExpr attribute="String" String="\\\'" context="#stay"/>
+ <DetectChar char="'" attribute="Raw String" context="check_div_1_pop"/>
+ </context>
+
+ <context name="Command String" attribute="Command" lineEndContext="#stay">
+ <StringDetect attribute="String" String="\\" context="#stay"/>
+ <RegExpr attribute="String" String="\\\`" context="#stay"/>
+ <RegExpr attribute="Substitution" String="#@{1,2}" context="Short Subst"/>
+ <Detect2Chars attribute="Substitution" char="#" char1="{" context="Subst"/>
+ <HlCChar attribute="Char" context="check_div_1_pop"/>
+ <DetectChar char="`" attribute="Command" context="check_div_1_pop"/>
+ </context>
+
+ <context name="Embedded documentation" attribute="Comment" lineEndContext="#stay">
+ <StringDetect attribute="Comment" String="=end" context="#pop" endRegion="comment block" column="0"/>
+ </context>
+
+ <context name="RegEx 1" attribute="Regular Expression" lineEndContext="#stay">
+ <RegExpr attribute="Regular Expression" String="\\\/" context="#stay"/>
+ <RegExpr attribute="Substitution" String="#@{1,2}" context="Short Subst"/>
+ <Detect2Chars attribute="Substitution" char="#" char1="{" context="Subst"/>
+ <RegExpr attribute="Regular Expression" String="/[uiomxn]*" context="check_div_1_pop"/>
+ </context>
+
+ <!-- Substitutions can be nested -->
+ <context name="Subst" attribute="Normal Text" lineEndContext="#stay">
+ <DetectChar attribute="Substitution" char="}" context="#pop"/>
+ <!-- Highlight substitution as code. -->
+ <IncludeRules context="Normal"/>
+ </context>
+
+ <context name="Short Subst" attribute="Substitution" lineEndContext="#pop">
+ <!-- Check for e.g.: "#@var#@@xy" -->
+ <RegExpr attribute="Substitution" String="#@{1,2}" context="#stay"/>
+ <RegExpr attribute="Substitution" String="\w(?!\w)" context="#pop"/>
+ </context>
+
+ <!-- This handles access of nested module classes and class methods -->
+ <context name="Member Access" attribute="Member" lineEndContext="#pop">
+ <!-- marks a message (being sent, not defined) -->
+ <RegExpr attribute="Message" String="\.?[_a-z]\w*(\?|\!)?(?=[^\w\d\.\:])" context="check_div_2_pop"/>
+ <RegExpr attribute="Message" String="\.?[_a-z]\w*(\?|\!)?" context="#stay"/>
+ <RegExpr attribute="Constant" String="[A-Z]+_*(\d|[a-z])\w*(?=[^\w\d\.\:])" context="check_div_2_pop"/>
+ <RegExpr attribute="Constant" String="[A-Z]+_*([0-9]|[a-z])\w*" context="#stay"/>
+ <RegExpr attribute="Constant Value" String="[_A-Z][_A-Z0-9]*(?=[^\w\d\.\:])" context="check_div_2_pop"/>
+ <RegExpr attribute="Constant Value" String="[_A-Z][_A-Z0-9]*" context="#stay"/>
+ <Detect2Chars attribute="Operator" char=":" char1=":" context="#stay"/>
+ <DetectChar attribute="Member" char="." context="#stay"/>
+
+ <AnyChar attribute="Operator" String="=+-*/%|&amp;[]{}~" context="#pop"/>
+ <DetectChar attribute="Comment" char="#" context="#pop"/>
+ <AnyChar attribute="Normal Text" String="()\" context="#pop"/>
+ <RegExpr attribute="Member" String="\W" context="#pop"/>
+ </context>
+
+ <context name="Comment Line" attribute="Comment" lineEndContext="#pop">
+ <RegExpr attribute="Comment" String="\w\:\:\s" context="RDoc Label"/>
+ <keyword attribute="Alert" String="attention" context="#stay"/>
+ </context>
+
+ <context name="General Comment" attribute="Comment" lineEndContext="#pop">
+ <keyword attribute="Dec" String="attention" context="#stay"/>
+ </context>
+
+ <context name="RDoc Label" attribute="RDoc Value" lineEndContext="#pop"/>
+
+ <!-- HEREDOC support
+ The contexts below support both normal and indented heredocs
+ -->
+ <!-- here we markup the heredoc markers -->
+ <context name="find_heredoc" attribute="Normal Text" lineEndContext="#pop" >
+ <RegExpr attribute="Keyword" context="apostrophed_normal_heredoc" String="'(\w+)'" />
+ <RegExpr attribute="Keyword" context="normal_heredoc" String="&quot;?(\w+)&quot;?" />
+ </context>
+ <context name="find_indented_heredoc" attribute="Normal Text" lineEndContext="#pop" >
+ <RegExpr attribute="Keyword" context="apostrophed_indented_heredoc" String="'(\w+)'" />
+ <RegExpr attribute="Keyword" context="indented_heredoc" String="&quot;?(\w+)&quot;?" />
+ </context>
+ <!-- these are the real heredoc contexts -->
+ <context name="indented_heredoc" attribute="Normal Text" lineEndContext="#stay" dynamic="true">
+<!-- <RegExpr attribute="Keyword" context="#pop#pop" String="^\s*%1$" dynamic="true" endRegion="HereDocument"/>-->
+ <RegExpr attribute="Keyword" context="#pop#pop" String="%1$" dynamic="true" endRegion="HereDocument" firstNonSpace="true"/>
+ <IncludeRules context="heredoc_rules" />
+ </context>
+ <context name="apostrophed_indented_heredoc" attribute="Normal Text" lineEndContext="#stay" dynamic="true">
+<!-- <RegExpr attribute="Keyword" context="#pop#pop" String="^\s*%1$" dynamic="true" endRegion="HereDocument"/>-->
+ <RegExpr attribute="Keyword" context="#pop#pop" String="%1$" dynamic="true" endRegion="HereDocument" firstNonSpace="true"/>
+ </context>
+
+ <context name="normal_heredoc" attribute="Normal Text" lineEndContext="#stay" dynamic="true">
+<!-- <RegExpr attribute="Keyword" context="#pop#pop" String="^%1$" dynamic="true" endRegion="HereDocument"/>-->
+ <RegExpr attribute="Keyword" context="#pop#pop" String="%1$" dynamic="true" endRegion="HereDocument" column="0"/>
+ <IncludeRules context="heredoc_rules" />
+ </context>
+ <context name="apostrophed_normal_heredoc" attribute="Normal Text" lineEndContext="#stay" dynamic="true">
+<!-- <RegExpr attribute="Keyword" context="#pop#pop" String="^%1$" dynamic="true" endRegion="HereDocument"/>-->
+ <RegExpr attribute="Keyword" context="#pop#pop" String="%1$" dynamic="true" endRegion="HereDocument" column="0"/>
+ </context>
+
+ <!-- rules for heredoc types -->
+ <context name="heredoc_rules" attribute="Normal Text" lineEndContext="#stay">
+ <RegExpr attribute="Substitution" String="#@{1,2}" context="Short Subst"/>
+ <Detect2Chars attribute="Substitution" char="#" char1="{" context="Subst"/>
+ </context>
+
+ <!-- General delimited input support
+ The contexts below handle the various gdl formats
+ -->
+ <context name="find_gdl_input" attribute="Normal Text" lineEndContext="#pop">
+
+ <!-- handle token arrays -->
+ <RegExpr attribute="GDL input" context="gdl_token_array_1" String="w\(" />
+ <RegExpr attribute="GDL input" context="gdl_token_array_2" String="w\{" />
+ <RegExpr attribute="GDL input" context="gdl_token_array_3" String="w\[" />
+ <RegExpr attribute="GDL input" context="gdl_token_array_4" String="w&lt;" />
+ <!-- then we handle the 'any char' format -->
+ <RegExpr attribute="GDL input" context="gdl_token_array_5" String="w([^\s\w])" />
+
+ <!-- handle apostrophed strings -->
+ <RegExpr attribute="GDL input" context="gdl_apostrophed_1" String="q\(" />
+ <RegExpr attribute="GDL input" context="gdl_apostrophed_2" String="q\{" />
+ <RegExpr attribute="GDL input" context="gdl_apostrophed_3" String="q\[" />
+ <RegExpr attribute="GDL input" context="gdl_apostrophed_4" String="q&lt;" />
+ <!-- then we handle the 'any char' format -->
+ <RegExpr attribute="GDL input" context="gdl_apostrophed_5" String="q([^\s\w])" />
+
+ <!-- handle shell commands -->
+ <RegExpr attribute="GDL input" context="gdl_shell_command_1" String="x\(" />
+ <RegExpr attribute="GDL input" context="gdl_shell_command_2" String="x\{" />
+ <RegExpr attribute="GDL input" context="gdl_shell_command_3" String="x\[" />
+ <RegExpr attribute="GDL input" context="gdl_shell_command_4" String="x&lt;" />
+ <!-- then we handle the 'any char' format -->
+ <RegExpr attribute="GDL input" context="gdl_shell_command_5" String="x([^\s\w])" />
+
+ <!-- handle regular expressions -->
+ <RegExpr attribute="GDL input" context="gdl_regexpr_1" String="r\(" />
+ <RegExpr attribute="GDL input" context="gdl_regexpr_2" String="r\{" />
+ <RegExpr attribute="GDL input" context="gdl_regexpr_3" String="r\[" />
+ <RegExpr attribute="GDL input" context="gdl_regexpr_4" String="r&lt;" />
+ <!-- then we handle the 'any char' format -->
+ <RegExpr attribute="GDL input" context="gdl_regexpr_5" String="r([^\s\w])" />
+
+ <!-- handle double-quoted strings -->
+ <!--
+ be careful to make this the last GDL ruleset, because the rule for
+ the short form %?foo? will otherwise catch any of the other formats
+ -->
+ <RegExpr attribute="GDL input" context="gdl_dq_string_1" String="Q?\(" />
+ <RegExpr attribute="GDL input" context="gdl_dq_string_2" String="Q?\{" />
+ <RegExpr attribute="GDL input" context="gdl_dq_string_3" String="Q?\[" />
+ <RegExpr attribute="GDL input" context="gdl_dq_string_4" String="Q?&lt;" />
+ <!-- then we handle the 'any char' format -->
+ <RegExpr attribute="GDL input" context="gdl_dq_string_5" String="Q?([^\s\w])" />
+
+ </context>
+ <!-- double-quoted string specific contexts follow -->
+ <context name="gdl_dq_string_1" attribute="String" lineEndContext="#stay" >
+ <IncludeRules context="dq_string_rules" />
+ <Detect2Chars attribute="String" char="\" char1=")" context="#stay"/>
+ <DetectChar attribute="String" context="gdl_dq_string_1_nested" char="(" />
+ <DetectChar attribute="GDL input" context="#pop#pop" char=")" endRegion="GdlInput" />
+ </context>
+ <context name="gdl_dq_string_1_nested" attribute="String" lineEndContext="#stay" >
+ <IncludeRules context="dq_string_rules" />
+ <DetectChar attribute="String" context="gdl_dq_string_1_nested" char="(" />
+ <DetectChar attribute="String" context="#pop" char=")" />
+ </context>
+ <!-- note that here substitution should win over nesting -->
+ <context name="gdl_dq_string_2" attribute="String" lineEndContext="#stay" >
+ <IncludeRules context="dq_string_rules" />
+ <Detect2Chars attribute="String" char="\" char1="}" context="#stay"/>
+ <DetectChar attribute="GDL input" context="#pop#pop" char="}" endRegion="GdlInput" />
+ <DetectChar attribute="String" context="gdl_dq_string_2_nested" char="{" />
+ </context>
+ <context name="gdl_dq_string_2_nested" attribute="String" lineEndContext="#stay" >
+ <DetectChar attribute="String" context="gdl_dq_string_2_nested" char="{" />
+ <DetectChar attribute="String" context="#pop" char="}" />
+ <IncludeRules context="dq_string_rules" />
+ </context>
+
+ <context name="gdl_dq_string_3" attribute="String" lineEndContext="#stay" >
+ <IncludeRules context="dq_string_rules" />
+ <Detect2Chars attribute="String" char="\" char1="]" context="#stay"/>
+ <DetectChar attribute="String" context="gdl_dq_string_3_nested" char="[" />
+ <DetectChar attribute="GDL input" context="#pop#pop" char="]" endRegion="GdlInput" />
+ </context>
+ <context name="gdl_dq_string_3_nested" attribute="String" lineEndContext="#stay" >
+ <DetectChar attribute="String" context="gdl_dq_string_3_nested" char="[" />
+ <DetectChar attribute="String" context="#pop" char="]" />
+ <IncludeRules context="dq_string_rules" />
+ </context>
+
+ <context name="gdl_dq_string_4" attribute="String" lineEndContext="#stay" >
+ <IncludeRules context="dq_string_rules" />
+ <Detect2Chars attribute="String" char="\" char1="&gt;" context="#stay"/>
+ <DetectChar attribute="String" context="gdl_dq_string_4_nested" char="&lt;" />
+ <DetectChar attribute="GDL input" context="#pop#pop" char="&gt;" endRegion="GdlInput" />
+ </context>
+ <context name="gdl_dq_string_4_nested" attribute="String" lineEndContext="#stay" >
+ <DetectChar attribute="String" context="gdl_dq_string_4_nested" char="&lt;" />
+ <DetectChar attribute="String" context="#pop" char="&gt;" />
+ <IncludeRules context="dq_string_rules" />
+ </context>
+
+ <!-- this format doesn't allow nesting. it is terminated by the next occurence of the
+ delimiter character
+ -->
+ <context name="gdl_dq_string_5" attribute="String" lineEndContext="#stay" dynamic="true">
+ <IncludeRules context="dq_string_rules" />
+ <RegExpr attribute="String" String="\\%1" context="#stay" dynamic="true" />
+ <RegExpr attribute="GDL input" context="#pop#pop" String="\s*%1" dynamic="true" endRegion="GdlInput" />
+ </context>
+ <!-- rules to be included in all dq_string contexts -->
+ <context name="dq_string_rules" attribute="String" lineEndContext="#stay" >
+ <Detect2Chars attribute="String" char="\" char1="\" context="#stay"/>
+ <RegExpr attribute="Substitution" String="#@{1,2}" context="Short Subst"/>
+ <Detect2Chars attribute="Substitution" char="#" char1="{" context="Subst"/>
+ </context>
+
+ <!-- token array specific contexts -->
+
+ <context name="gdl_token_array_1" attribute="String" lineEndContext="#stay" >
+ <IncludeRules context="token_array_rules" />
+ <Detect2Chars attribute="String" char="\" char1=")" context="#stay"/>
+ <DetectChar attribute="String" context="gdl_token_array_1_nested" char="(" />
+ <DetectChar attribute="GDL input" context="#pop#pop" char=")" endRegion="GdlInput" />
+ </context>
+ <context name="gdl_token_array_1_nested" attribute="String" lineEndContext="#stay" >
+ <IncludeRules context="token_array_rules" />
+ <DetectChar attribute="String" context="gdl_token_array_1_nested" char="(" />
+ <DetectChar attribute="String" context="#pop" char=")" />
+ </context>
+
+ <context name="gdl_token_array_2" attribute="String" lineEndContext="#stay" >
+ <IncludeRules context="token_array_rules" />
+ <Detect2Chars attribute="String" char="\" char1="}" context="#stay"/>
+ <DetectChar attribute="GDL input" context="#pop#pop" char="}" endRegion="GdlInput" />
+ <DetectChar attribute="String" context="gdl_token_array_2_nested" char="{" />
+ </context>
+ <context name="gdl_token_array_2_nested" attribute="String" lineEndContext="#stay" >
+ <IncludeRules context="token_array_rules" />
+ <DetectChar attribute="String" context="gdl_token_array_2_nested" char="{" />
+ <DetectChar attribute="String" context="#pop" char="}" />
+ </context>
+
+ <context name="gdl_token_array_3" attribute="String" lineEndContext="#stay" >
+ <IncludeRules context="token_array_rules" />
+ <Detect2Chars attribute="String" char="\" char1="]" context="#stay"/>
+ <DetectChar attribute="String" context="gdl_token_array_3_nested" char="[" />
+ <DetectChar attribute="GDL input" context="#pop#pop" char="]" endRegion="GdlInput" />
+ </context>
+ <context name="gdl_token_array_3_nested" attribute="String" lineEndContext="#stay" >
+ <IncludeRules context="token_array_rules" />
+ <DetectChar attribute="String" context="gdl_token_array_3_nested" char="[" />
+ <DetectChar attribute="String" context="#pop" char="]" />
+ </context>
+
+ <context name="gdl_token_array_4" attribute="String" lineEndContext="#stay" >
+ <IncludeRules context="token_array_rules" />
+ <Detect2Chars attribute="String" char="\" char1="&gt;" context="#stay"/>
+ <DetectChar attribute="String" context="gdl_token_array_4_nested" char="&lt;" />
+ <DetectChar attribute="GDL input" context="#pop#pop" char="&gt;" endRegion="GdlInput" />
+ </context>
+ <context name="gdl_token_array_4_nested" attribute="String" lineEndContext="#stay" >
+ <IncludeRules context="token_array_rules" />
+ <DetectChar attribute="String" context="gdl_token_array_4_nested" char="&lt;" />
+ <DetectChar attribute="String" context="#pop" char="&gt;" />
+ </context>
+
+ <!-- this format doesn't allow nesting. it is terminated by the next occurence of the
+ delimiter character
+ -->
+ <context name="gdl_token_array_5" attribute="String" lineEndContext="#stay" dynamic="true">
+ <IncludeRules context="token_array_rules" />
+ <RegExpr attribute="String" String="\\%1" context="#stay" dynamic="true"/>
+ <RegExpr attribute="GDL input" context="#pop#pop" String="\s*%1" dynamic="true" endRegion="GdlInput" />
+ </context>
+
+ <!-- rules to be included in all token_array contexts -->
+ <context name="token_array_rules" attribute="String" lineEndContext="#stay" >
+ <StringDetect attribute="String" String="\\" context="#stay"/>
+ </context>
+
+ <!-- apostrophed string specific contexts -->
+
+ <context name="gdl_apostrophed_1" attribute="Raw String" lineEndContext="#stay" >
+ <IncludeRules context="apostrophed_rules" />
+ <Detect2Chars attribute="Raw String" char="\" char1=")" context="#stay"/>
+ <DetectChar attribute="Raw String" context="gdl_apostrophed_1_nested" char="(" />
+ <DetectChar attribute="GDL input" context="#pop#pop" char=")" endRegion="GdlInput" />
+ </context>
+ <context name="gdl_apostrophed_1_nested" attribute="Raw String" lineEndContext="#stay" >
+ <IncludeRules context="apostrophed_rules" />
+ <DetectChar attribute="Raw String" context="gdl_apostrophed_1_nested" char="(" />
+ <DetectChar attribute="Raw String" context="#pop" char=")" />
+ </context>
+
+ <context name="gdl_apostrophed_2" attribute="Raw String" lineEndContext="#stay" >
+ <IncludeRules context="apostrophed_rules" />
+ <Detect2Chars attribute="Raw String" char="\" char1="}" context="#stay"/>
+ <DetectChar attribute="GDL input" context="#pop#pop" char="}" endRegion="GdlInput" />
+ <DetectChar attribute="Raw String" context="gdl_apostrophed_2_nested" char="{" />
+ </context>
+ <context name="gdl_apostrophed_2_nested" attribute="Raw String" lineEndContext="#stay" >
+ <IncludeRules context="apostrophed_rules" />
+ <DetectChar attribute="Raw String" context="gdl_apostrophed_2_nested" char="{" />
+ <DetectChar attribute="Raw String" context="#pop" char="}" />
+ </context>
+
+ <context name="gdl_apostrophed_3" attribute="Raw String" lineEndContext="#stay" >
+ <IncludeRules context="apostrophed_rules" />
+ <Detect2Chars attribute="Raw String" char="\" char1="]" context="#stay"/>
+ <DetectChar attribute="Raw String" context="gdl_apostrophed_3_nested" char="[" />
+ <DetectChar attribute="GDL input" context="#pop#pop" char="]" endRegion="GdlInput" />
+ </context>
+ <context name="gdl_apostrophed_3_nested" attribute="Raw String" lineEndContext="#stay" >
+ <IncludeRules context="apostrophed_rules" />
+ <DetectChar attribute="Raw String" context="gdl_apostrophed_3_nested" char="[" />
+ <DetectChar attribute="Raw String" context="#pop" char="]" />
+ </context>
+
+ <context name="gdl_apostrophed_4" attribute="Raw String" lineEndContext="#stay" >
+ <IncludeRules context="apostrophed_rules" />
+ <Detect2Chars attribute="Raw String" char="\" char1="&gt;" context="#stay"/>
+ <DetectChar attribute="Raw String" context="gdl_apostrophed_4_nested" char="&lt;" />
+ <DetectChar attribute="GDL input" context="#pop#pop" char="&gt;" endRegion="GdlInput" />
+ </context>
+ <context name="gdl_apostrophed_4_nested" attribute="Raw String" lineEndContext="#stay" >
+ <IncludeRules context="apostrophed_rules" />
+ <DetectChar attribute="Raw String" context="gdl_apostrophed_4_nested" char="&lt;" />
+ <DetectChar attribute="Raw String" context="#pop" char="&gt;" />
+ </context>
+
+ <!-- this format doesn't allow nesting. it is terminated by the next occurence of the
+ delimiter character
+ -->
+ <context name="gdl_apostrophed_5" attribute="Raw String" lineEndContext="#stay" dynamic="true">
+ <IncludeRules context="apostrophed_rules" />
+ <RegExpr attribute="Raw String" String="\\%1" context="#stay" dynamic="true"/>
+ <RegExpr attribute="GDL input" context="#pop#pop" String="\s*%1" dynamic="true" endRegion="GdlInput" />
+ </context>
+
+ <!-- rules to be included in all apostrophed contexts -->
+ <context name="apostrophed_rules" attribute="Raw String" lineEndContext="#stay" >
+ <Detect2Chars attribute="Raw String" char="\" char1="\" context="#stay"/>
+ </context>
+
+ <!-- shell command specific contexts -->
+
+ <context name="gdl_shell_command_1" attribute="Command" lineEndContext="#stay" >
+ <IncludeRules context="shell_command_rules" />
+ <Detect2Chars attribute="Command" char="\" char1=")" context="#stay"/>
+ <DetectChar attribute="Command" context="gdl_shell_command_1_nested" char="(" />
+ <DetectChar attribute="GDL input" context="#pop#pop" char=")" endRegion="GdlInput" />
+ </context>
+ <context name="gdl_shell_command_1_nested" attribute="Command" lineEndContext="#stay" >
+ <IncludeRules context="shell_command_rules" />
+ <DetectChar attribute="Command" context="gdl_shell_command_1_nested" char="(" />
+ <DetectChar attribute="Command" context="#pop" char=")" />
+ </context>
+
+ <context name="gdl_shell_command_2" attribute="Command" lineEndContext="#stay" >
+ <IncludeRules context="shell_command_rules" />
+ <Detect2Chars attribute="Command" char="\" char1="}" context="#stay"/>
+ <DetectChar attribute="GDL input" context="#pop#pop" char="}" endRegion="GdlInput" />
+ <DetectChar attribute="Command" context="gdl_shell_command_2_nested" char="{" />
+ </context>
+ <context name="gdl_shell_command_2_nested" attribute="Command" lineEndContext="#stay" >
+ <IncludeRules context="shell_command_rules" />
+ <DetectChar attribute="Command" context="gdl_shell_command_2_nested" char="{" />
+ <DetectChar attribute="Command" context="#pop" char="}" />
+ </context>
+
+ <context name="gdl_shell_command_3" attribute="Command" lineEndContext="#stay" >
+ <IncludeRules context="shell_command_rules" />
+ <Detect2Chars attribute="Command" char="\" char1="]" context="#stay"/>
+ <DetectChar attribute="Command" context="gdl_shell_command_3_nested" char="[" />
+ <DetectChar attribute="GDL input" context="#pop#pop" char="]" endRegion="GdlInput" />
+ </context>
+ <context name="gdl_shell_command_3_nested" attribute="Command" lineEndContext="#stay" >
+ <IncludeRules context="shell_command_rules" />
+ <DetectChar attribute="Command" context="gdl_shell_command_3_nested" char="[" />
+ <DetectChar attribute="Command" context="#pop" char="]" />
+ </context>
+
+ <context name="gdl_shell_command_4" attribute="Command" lineEndContext="#stay" >
+ <IncludeRules context="shell_command_rules" />
+ <Detect2Chars attribute="Command" char="\" char1="&gt;" context="#stay"/>
+ <DetectChar attribute="Command" context="gdl_shell_command_4_nested" char="&lt;" />
+ <DetectChar attribute="GDL input" context="#pop#pop" char="&gt;" endRegion="GdlInput" />
+ </context>
+ <context name="gdl_shell_command_4_nested" attribute="Command" lineEndContext="#stay" >
+ <IncludeRules context="shell_command_rules" />
+ <DetectChar attribute="Command" context="gdl_shell_command_4_nested" char="&lt;" />
+ <DetectChar attribute="Command" context="#pop" char="&gt;" />
+ </context>
+
+ <!-- this format doesn't allow nesting. it is terminated by the next occurence of the
+ delimiter character
+ -->
+ <context name="gdl_shell_command_5" attribute="Command" lineEndContext="#stay" dynamic="true">
+ <IncludeRules context="shell_command_rules" />
+ <RegExpr attribute="Command" String="\\%1" context="#stay" dynamic="true" />
+ <RegExpr attribute="GDL input" context="#pop#pop" String="\s*%1" dynamic="true" endRegion="GdlInput" />
+ </context>
+
+ <!-- rules to be included in all shell_command contexts -->
+ <context name="shell_command_rules" attribute="Command" lineEndContext="#stay" >
+ <Detect2Chars attribute="Command" char="\" char1="\" context="#stay"/>
+ <RegExpr attribute="Substitution" String="#@{1,2}" context="Short Subst"/>
+ <Detect2Chars attribute="Substitution" char="#" char1="{" context="Subst"/>
+ </context>
+
+ <!-- regular expression specific contexts -->
+
+ <context name="gdl_regexpr_1" attribute="Regular Expression" lineEndContext="#stay" >
+ <IncludeRules context="regexpr_rules" />
+ <Detect2Chars attribute="Regular Expression" char="\" char1=")" context="#stay"/>
+ <DetectChar attribute="Regular Expression" context="gdl_regexpr_1_nested" char="(" />
+ <RegExpr attribute="GDL input" context="#pop#pop" String="\)[uiomxn]*" endRegion="GdlInput" />
+ </context>
+ <context name="gdl_regexpr_1_nested" attribute="Regular Expression" lineEndContext="#stay" >
+ <IncludeRules context="regexpr_rules" />
+ <DetectChar attribute="Regular Expression" context="gdl_regexpr_1_nested" char="(" />
+ <DetectChar attribute="Regular Expression" context="#pop" char=")" />
+ </context>
+
+ <context name="gdl_regexpr_2" attribute="Regular Expression" lineEndContext="#stay" >
+ <IncludeRules context="regexpr_rules" />
+ <Detect2Chars attribute="Regular Expression" char="\" char1="}" context="#stay"/>
+ <RegExpr attribute="GDL input" context="#pop#pop" String="\}[uiomxn]*" endRegion="GdlInput" />
+ <DetectChar attribute="Regular Expression" context="gdl_regexpr_2_nested" char="{" />
+ </context>
+ <context name="gdl_regexpr_2_nested" attribute="Regular Expression" lineEndContext="#stay" >
+ <IncludeRules context="regexpr_rules" />
+ <DetectChar attribute="Regular Expression" context="gdl_regexpr_2_nested" char="{" />
+ <DetectChar attribute="Regular Expression" context="#pop" char="}" />
+ </context>
+
+ <context name="gdl_regexpr_3" attribute="Regular Expression" lineEndContext="#stay" >
+ <IncludeRules context="regexpr_rules" />
+ <Detect2Chars attribute="Regular Expression" char="\" char1="]" context="#stay"/>
+ <DetectChar attribute="Regular Expression" context="gdl_regexpr_3_nested" char="[" />
+ <RegExpr attribute="GDL input" context="#pop#pop" String="\][uiomxn]*" endRegion="GdlInput" />
+ </context>
+ <context name="gdl_regexpr_3_nested" attribute="Regular Expression" lineEndContext="#stay" >
+ <IncludeRules context="regexpr_rules" />
+ <DetectChar attribute="Regular Expression" context="gdl_regexpr_3_nested" char="[" />
+ <DetectChar attribute="Regular Expression" context="#pop" char="]" />
+ </context>
+
+ <context name="gdl_regexpr_4" attribute="Regular Expression" lineEndContext="#stay" >
+ <IncludeRules context="regexpr_rules" />
+ <Detect2Chars attribute="Regular Expression" char="\" char1="&gt;" context="#stay"/>
+ <DetectChar attribute="Regular Expression" context="gdl_regexpr_4_nested" char="&lt;" />
+ <RegExpr attribute="GDL input" context="#pop#pop" String="&gt;[uiomxn]*" endRegion="GdlInput" />
+ </context>
+ <context name="gdl_regexpr_4_nested" attribute="Regular Expression" lineEndContext="#stay" >
+ <IncludeRules context="regexpr_rules" />
+ <DetectChar attribute="Regular Expression" context="gdl_regexpr_4_nested" char="&lt;" />
+ <DetectChar attribute="Regular Expression" context="#pop" char="&gt;" />
+ </context>
+
+ <!-- this format doesn't allow nesting. it is terminated by the next occurence of the
+ delimiter character
+ -->
+ <context name="gdl_regexpr_5" attribute="Regular Expression" lineEndContext="#stay" dynamic="true">
+ <IncludeRules context="regexpr_rules" />
+ <RegExpr attribute="Regular Expression" String="\\%1" context="#stay" dynamic="true" />
+ <RegExpr attribute="GDL input" context="#pop#pop" String="\s*%1[uiomxn]*" dynamic="true" endRegion="GdlInput" />
+ </context>
+
+ <!-- rules to be included in all regexpr contexts -->
+ <context name="regexpr_rules" attribute="Regular Expression" lineEndContext="#stay" >
+ <Detect2Chars attribute="Regular Expression" char="\" char1="\" context="#stay"/>
+ <RegExpr attribute="Substitution" String="#@{1,2}" context="Short Subst"/>
+ <Detect2Chars attribute="Substitution" char="#" char1="{" context="Subst"/>
+ </context>
+
+ <!-- END of General delimited input support -->
+
+ <!-- handle data in script -->
+ <context name="DATA" attribute="Data" lineEndContext="#stay"/>
+ </contexts>
+
+ <itemDatas>
+ <itemData name="Normal Text" defStyleNum="dsNormal"/>
+
+ <itemData name="Keyword" defStyleNum="dsKeyword"/>
+ <itemData name="Attribute Definition" defStyleNum="dsOthers"/>
+ <itemData name="Access Control" defStyleNum="dsKeyword" color="#0000FF"/>
+ <itemData name="Definition" defStyleNum="dsKeyword"/>
+ <itemData name="Pseudo variable" defStyleNum="dsDecVal"/>
+
+ <itemData name="Dec" defStyleNum="dsDecVal"/>
+ <itemData name="Float" defStyleNum="dsFloat"/>
+ <itemData name="Char" defStyleNum="dsChar"/>
+ <itemData name="Octal" defStyleNum="dsBaseN"/>
+ <itemData name="Hex" defStyleNum="dsBaseN"/>
+ <itemData name="Bin" defStyleNum="dsBaseN"/>
+
+ <itemData name="Symbol" defStyleNum="dsString" color="#D40000"/>
+ <itemData name="String" defStyleNum="dsString"/>
+ <itemData name="Raw String" defStyleNum="dsString" color="#DD4A4A" selColor="#DD4A4A"/>
+ <itemData name="Command" defStyleNum="dsString" color="#AA3000"/>
+ <itemData name="Message" defStyleNum="dsNormal" color="#4000A7"/> <!-- #4A00C0 -->
+ <itemData name="Regular Expression" defStyleNum="dsOthers" color="#4A5704"/>
+ <itemData name="Substitution" defStyleNum="dsOthers"/>
+ <itemData name="Data" defStyleNum="dsNormal"/>
+ <!-- short for 'general delimited input' -->
+ <itemData name="GDL input" defStyleNum="dsOthers" />
+
+ <itemData name="Default globals" defStyleNum="dsDataType" color="#C00000" bold="1"/>
+ <itemData name="Global Variable" defStyleNum="dsDataType" color="#C00000"/>
+ <itemData name="Global Constant" defStyleNum="dsDataType" color="#bb1188" bold="1"/>
+ <itemData name="Constant" defStyleNum="dsDataType"/>
+ <itemData name="Constant Value" defStyleNum="dsDataType" color="#bb1188"/>
+ <itemData name="Kernel methods" defStyleNum="dsNormal" color="#000080" selColor="#ffffff"/> <!-- #CC0E86 -->
+ <itemData name="Member" defStyleNum="dsNormal"/>
+ <itemData name="Instance Variable" defStyleNum="dsOthers"/>
+ <itemData name="Class Variable" defStyleNum="dsOthers"/>
+
+ <itemData name="Comment" defStyleNum="dsComment"/>
+ <itemData name="Blockcomment" defStyleNum="dsComment"/>
+ <itemData name="Region Marker" defStyleNum="dsNormal" color="#0000ff"/>
+ <itemData name="RDoc Value" defStyleNum="dsOthers"/>
+
+ <!-- use these to mark errors and alerts things -->
+ <itemData name="Error" defStyleNum="dsError" />
+ <itemData name="Alert" defStyleNum="dsAlert" />
+
+ <itemData name="Delimiter" defStyleNum="dsChar"/>
+ <itemData name="Expression" defStyleNum="dsOthers"/>
+ <itemData name="Operator" defStyleNum="dsChar"/>
+ </itemDatas>
+ </highlighting>
+ <general>
+ <comments>
+ <comment name="singleLine" start="#"/>
+ </comments>
+ <keywords casesensitive="1" weakDeliminator="!?"/>
+ </general>
+</language>
diff --git a/kate/data/sather.xml b/kate/data/sather.xml
new file mode 100644
index 000000000..472ca8788
--- /dev/null
+++ b/kate/data/sather.xml
@@ -0,0 +1,141 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+<language name="Sather" version="1.03" kateversion="2.1" section="Sources" extensions="*.sa" mimetype="text/x-sather-src" casesensitive="1">
+ <highlighting>
+ <list name="keywords">
+ <item> and </item>
+ <item> assert </item>
+ <item> attr </item>
+ <item> break! </item>
+ <item> case </item>
+ <item> class </item>
+ <item> const </item>
+ <item> else </item>
+ <item> elsif </item>
+ <item> end </item>
+ <item> exception </item>
+ <item> external </item>
+ <item> false </item>
+ <item> if </item>
+ <item> include </item>
+ <item> initial </item>
+ <item> is </item>
+ <item> ITER </item>
+ <item> loop </item>
+ <item> new </item>
+ <item> or </item>
+ <item> post </item>
+ <item> pre </item>
+ <item> private </item>
+ <item> protect </item>
+ <item> quit </item>
+ <item> raise </item>
+ <item> readonly </item>
+ <item> result </item>
+ <item> return </item>
+ <item> ROUT </item>
+ <item> SAME </item>
+ <item> self </item>
+ <item> shared </item>
+ <item> then </item>
+ <item> true </item>
+ <item> typecase </item>
+ <item> type </item>
+ <item> until! </item>
+ <item> value </item>
+ <item> void </item>
+ <item> when </item>
+ <item> while! </item>
+ <item> yield </item>
+ <item> abstract </item>
+ <item> any </item>
+ <item> bind </item>
+ <item> fork </item>
+ <item> guard </item>
+ <item> immutable </item>
+ <item> inout </item>
+ <item> in </item>
+ <item> lock </item>
+ <item> once </item>
+ <item> out </item>
+ <item> parloop </item>
+ <item> partial </item>
+ <item> par </item>
+ <item> spread </item>
+ <item> stub </item>
+ </list>
+ <list name="types">
+ <item> $OB </item>
+ <item> ARRAY </item>
+ <item> AREF </item>
+ <item> AVAL </item>
+ <item> BOOL </item>
+ <item> CHAR </item>
+ <item> EXT_OB </item>
+ <item> FLTDX </item>
+ <item> FLTD </item>
+ <item> FLTX </item>
+ <item> FLTI </item>
+ <item> FLT </item>
+ <item> INTI </item>
+ <item> INT </item>
+ <item> $REHASH </item>
+ <item> STR </item>
+ <item> SYS </item>
+ </list>
+ <list name="features">
+ <item> create </item>
+ <item> invariant </item>
+ <item> main </item>
+ <item> aget </item>
+ <item> aset </item>
+ <item> div </item>
+ <item> is_eq </item>
+ <item> is_geq </item>
+ <item> is_gt </item>
+ <item> is_leq </item>
+ <item> is_lt </item>
+ <item> is_neq </item>
+ <item> minus </item>
+ <item> mod </item>
+ <item> negate </item>
+ <item> not </item>
+ <item> plus </item>
+ <item> pow </item>
+ <item> times </item>
+ </list>
+ <contexts>
+ <context attribute="Normal Text" lineEndContext="#stay" name="Normal">
+ <keyword attribute="Keyword" context="#stay" String="keywords"/>
+ <keyword attribute="Data Type" context="#stay" String="types"/>
+ <keyword attribute="Features" context="#stay" String="features"/>
+ <Float attribute="Float" context="#stay"/>
+ <Int attribute="Decimal" context="#stay"/>
+ <RegExpr attribute="Char" context="#stay" String="'.'"/>
+ <DetectChar attribute="String" context="String" char="&quot;"/>
+ <Detect2Chars attribute="Comment" context="Comment" char="-" char1="-"/>
+ </context>
+ <context attribute="String" lineEndContext="#stay" name="String">
+ <DetectChar attribute="String" context="#pop" char="&quot;"/>
+ </context>
+ <context attribute="Comment" lineEndContext="#pop" name="Comment"/>
+ </contexts>
+ <itemDatas>
+ <itemData name="Normal Text" defStyleNum="dsNormal" />
+ <itemData name="Keyword" defStyleNum="dsKeyword" />
+ <itemData name="Data Type" defStyleNum="dsDataType"/>
+ <itemData name="Features" defStyleNum="dsOthers" />
+ <itemData name="Decimal" defStyleNum="dsDecVal" />
+ <itemData name="Float" defStyleNum="dsFloat" />
+ <itemData name="Char" defStyleNum="dsChar" />
+ <itemData name="String" defStyleNum="dsString" />
+ <itemData name="Comment" defStyleNum="dsComment" />
+ </itemDatas>
+ </highlighting>
+ <general>
+ <comments>
+ <comment name="singleLine" start="--" />
+ </comments>
+ <keywords casesensitive="1" weakDeliminator="$!"/>
+ </general>
+</language>
diff --git a/kate/data/scheme.xml b/kate/data/scheme.xml
new file mode 100644
index 000000000..027989b90
--- /dev/null
+++ b/kate/data/scheme.xml
@@ -0,0 +1,436 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+<!--
+ This file is part of KDE's kate project.
+
+ copyright : (C) 2004-2005 by Dominik Haumann
+ email : dhdev at gmx dot de
+
+
+ copyright : (C) 2004 by Goffart Olivier
+ email : ogoffart @ kde.org
+ (brackets coloration)
+
+
+ **********************************************************************
+ * This library is free software; you can redistribute it and/or *
+ * modify it under the terms of the GNU Library General Public *
+ * License as published by the Free Software Foundation; either *
+ * version 2 of the License, or (at your option) any later version. *
+ * *
+ * This library is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Library General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this library; if not, write to the *
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, *
+ * Boston, MA 02110-1301, USA. *
+ **********************************************************************
+ NOTE:
+ This file defines highlighting rules for both Scheme AND Guile.
+ Scheme usually has no block comments. Guile has block comments: #! !#
+ I support these block comments: "Good design means good compromises" :)
+ Singleline comments are introduced through ';'. In reality EVERY
+ scheme/guile developer use ';;'. It is indented in emacs in a special way.
+ That's why I set <comment singleLine=";;">.
+
+ As a guile guru tole me it would not make sense to highlight all scheme and
+ guile procedures (cause then almost everything would be highlighted) I
+ removed some to have a rather small but "senseful" list of highlighted words.
+-->
+<language version="1.12" kateversion="2.4" name="Scheme" section="Scripts" extensions="*.scm;*.ss;*.scheme;*.guile" mimetype="text/x-scheme" author="Dominik Haumann (dhdev@gmx.de)" license="LGPL">
+ <highlighting>
+ <list name="operators">
+ <item> &lt;= </item>
+ <item> &lt; </item>
+ <item> = </item>
+ <item> =&gt; </item>
+ <item> &gt;= </item>
+ <item> &gt; </item>
+ <item> - </item>
+ <item> / </item>
+ <item> *,* </item>
+ <item> *) </item>
+ <item> + </item>
+ </list>
+ <list name="characters">
+ <item> #\nul </item>
+ <item> #\soh </item>
+ <item> #\stx </item>
+ <item> #\etx </item>
+ <item> #\eot </item>
+ <item> #\enq </item>
+ <item> #\ack </item>
+ <item> #\bel </item>
+ <item> #\bs </item>
+ <item> #\ht </item>
+ <item> #\nl </item>
+ <item> #\vt </item>
+ <item> #\np </item>
+ <item> #\cr </item>
+ <item> #\so </item>
+ <item> #\si </item>
+ <item> #\dle </item>
+ <item> #\dc1 </item>
+ <item> #\dc2 </item>
+ <item> #\dc3 </item>
+ <item> #\dc4 </item>
+ <item> #\nak </item>
+ <item> #\syn </item>
+ <item> #\etb </item>
+ <item> #\can </item>
+ <item> #\em </item>
+ <item> #\sub </item>
+ <item> #\esc </item>
+ <item> #\fs </item>
+ <item> #\gs </item>
+ <item> #\rs </item>
+ <item> #\us </item>
+ <item> #\space </item>
+ <item> #\sp </item>
+ <item> #\newline </item>
+ <item> #\nl </item>
+ <item> #\tab </item>
+ <item> #\ht </item>
+ <item> #\backspace </item>
+ <item> #\bs </item>
+ <item> #\return </item>
+ <item> #\cr </item>
+ <item> #\page </item>
+ <item> #\np </item>
+ <item> #\null </item>
+ <item> #\nul </item>
+ </list>
+ <list name="defines">
+ <item> define </item>
+ <item> define* </item>
+ <item> define-accessor </item>
+ <item> define-class </item>
+ <item> defined? </item>
+ <item> define-generic </item>
+ <item> define-macro </item>
+ <item> define-method </item>
+ <item> define-module </item>
+ <item> define-private </item>
+ <item> define-public </item>
+ <item> define*-public </item>
+ <item> define-reader-ctor </item>
+ <item> define-syntax </item>
+ <item> define-syntax-macro </item>
+ <item> defmacro </item>
+ <item> defmacro* </item>
+ <item> defmacro*-public </item>
+ </list>
+ <list name="keywords">
+ <item> abs </item>
+ <item> acos </item>
+ <item> and </item>
+ <item> angle </item>
+ <item> append </item>
+ <item> applymap </item>
+ <item> asin </item>
+ <item> assoc </item>
+ <item> assq </item>
+ <item> assv </item>
+ <item> atan </item>
+ <item> begin </item>
+ <item> boolean? </item>
+ <item> break </item>
+ <item> caaaar </item>
+ <item> caaadr </item>
+ <item> caaar </item>
+ <item> caadar </item>
+ <item> caaddr </item>
+ <item> caadr </item>
+ <item> caar </item>
+ <item> cadaar </item>
+ <item> cadadr </item>
+ <item> cadar </item>
+ <item> caddar </item>
+ <item> cadddr </item>
+ <item> caddr </item>
+ <item> cadr </item>
+ <item> call/cc </item>
+ <item> call-with-current-continuation </item>
+ <item> call-with-input-file </item>
+ <item> call-with-output-file </item>
+ <item> call-with-values </item>
+ <item> car </item>
+ <item> case </item>
+ <item> catch </item>
+ <item> cdaaar </item>
+ <item> cdaadr </item>
+ <item> cdaar </item>
+ <item> cdadar </item>
+ <item> cdaddr </item>
+ <item> cdadr </item>
+ <item> cdar </item>
+ <item> cddaar </item>
+ <item> cddadr </item>
+ <item> cddar </item>
+ <item> cdddar </item>
+ <item> cddddr </item>
+ <item> cdddr </item>
+ <item> cddr </item>
+ <item> cdr </item>
+ <item> ceiling </item>
+ <item> char-alphabetic? </item>
+ <item> char-ci&gt;=? </item>
+ <item> char-ci&gt;? </item>
+ <item> char-ci=? </item>
+ <item> char-ci&lt;=? </item>
+ <item> char-downcase </item>
+ <item> char-&gt;integer </item>
+ <item> char&gt;=? </item>
+ <item> char&gt;? </item>
+ <item> char=? </item>
+ <item> char? </item>
+ <item> char-lower-case? </item>
+ <item> char&lt;?c </item>
+ <item> char&lt;=? </item>
+ <item> char-numeric? </item>
+ <item> char-ready? </item>
+ <item> char-upcase </item>
+ <item> char-upper-case? </item>
+ <item> char-whitespace? </item>
+ <item> close-input-port </item>
+ <item> close-output-port </item>
+ <item> complex? </item>
+ <item> cond </item>
+ <item> cons </item>
+ <item> continue </item>
+ <item> cos </item>
+ <item> current-input-port </item>
+ <item> current-output-port </item>
+ <item> denominator </item>
+ <item> display </item>
+ <item> do </item>
+ <item> dynamic-wind </item>
+ <item> else </item>
+ <item> eof-object? </item>
+ <item> eq? </item>
+ <item> equal? </item>
+ <item> eqv? </item>
+ <item> eval </item>
+ <item> even? </item>
+ <item> exact->inexact </item>
+ <item> exact? </item>
+ <item> exp </item>
+ <item> expt </item>
+ <item> floor </item>
+ <item> force </item>
+ <item> for-each </item>
+ <item> gcd </item>
+ <item> har-ci&lt;? </item>
+ <item> if </item>
+ <item> imag-part </item>
+ <item> inexact-&gt;exact </item>
+ <item> inexact? </item>
+ <item> input-port? </item>
+ <item> integer-&gt;char </item>
+ <item> integer? </item>
+ <item> interaction-environment </item>
+ <item> lambda </item>
+ <item> lcm </item>
+ <item> length </item>
+ <item> let </item>
+ <item> let* </item>
+ <item> letrec </item>
+ <item> letrec-syntax </item>
+ <item> let-syntax </item>
+ <item> list-&gt;string </item>
+ <item> list </item>
+ <item> list? </item>
+ <item> list-ref </item>
+ <item> list-tail </item>
+ <item> load </item>
+ <item> log </item>
+ <item> magnitude </item>
+ <item> make-polar </item>
+ <item> make-rectangular </item>
+ <item> make-string </item>
+ <item> make-vector </item>
+ <item> max </item>
+ <item> member </item>
+ <item> memq </item>
+ <item> memv </item>
+ <item> min </item>
+ <item> modulo </item>
+ <item> negative? </item>
+ <item> newline </item>
+ <item> not </item>
+ <item> null-environment </item>
+ <item> null? </item>
+ <item> number? </item>
+ <item> number->string </item>
+ <item> numerator </item>
+ <item> odd? </item>
+ <item> open-input-file </item>
+ <item> open-output-file </item>
+ <item> or </item>
+ <item> output-port? </item>
+ <item> pair? </item>
+ <item> peek-char </item>
+ <item> port? </item>
+ <item> positive? </item>
+ <item> procedure? </item>
+ <item> quotient </item>
+ <item> rational? </item>
+ <item> rationalize </item>
+ <item> read-char </item>
+ <item> read </item>
+ <item> real? </item>
+ <item> real-part </item>
+ <item> remainder </item>
+ <item> reverse </item>
+ <item> round </item>
+ <item> scheme-report-environment </item>
+ <item> set-car! </item>
+ <item> set-cdr! </item>
+ <item> sin </item>
+ <item> sqrt </item>
+ <item> string-append </item>
+ <item> string-ci&gt;=? </item>
+ <item> string-ci&gt;? </item>
+ <item> string-ci=? </item>
+ <item> string-ci&lt;=? </item>
+ <item> string-ci&lt;? </item>
+ <item> string-copy </item>
+ <item> string-fill! </item>
+ <item> string&gt;=? </item>
+ <item> string&gt;? </item>
+ <item> string-&gt;list </item>
+ <item> string-&gt;number </item>
+ <item> string-&gt;symbol </item>
+ <item> string=? </item>
+ <item> string </item>
+ <item> string? </item>
+ <item> string-length </item>
+ <item> string&lt;=? </item>
+ <item> string&lt;? </item>
+ <item> string-ref </item>
+ <item> string-set! </item>
+ <item> substring </item>
+ <item> symbol-&gt;string </item>
+ <item> symbol? </item>
+ <item> syntax-rules </item>
+ <item> tan </item>
+ <item> transcript-off </item>
+ <item> transcript-on </item>
+ <item> truncate </item>
+ <item> values </item>
+ <item> vector-fill! </item>
+ <item> vector-&gt;listlist->vector </item>
+ <item> vector </item>
+ <item> vector? </item>
+ <item> vector-length </item>
+ <item> vector-ref </item>
+ <item> vector-set! </item>
+ <item> while </item>
+ <item> with-input-from-file </item>
+ <item> with-output-to-file </item>
+ <item> write-char </item>
+ <item> write </item>
+ <item> zero? </item>
+ </list>
+ <contexts>
+ <context name="Level0" attribute="Normal" lineEndContext="#stay">
+ <DetectChar attribute="Brackets1" context="Level1" char="("/>
+ <IncludeRules context="Default" />
+ </context>
+ <context name="Default" attribute="Normal" lineEndContext="#stay">
+ <RegExpr attribute="Region Marker" context="#stay" String=";+\s*BEGIN.*$" beginRegion="region"/>
+ <RegExpr attribute="Region Marker" context="#stay" String=";+\s*END.*$" endRegion="region"/>
+ <RegExpr attribute="Comment" context="#stay" String=";.*$"/>
+ <Detect2Chars attribute="Comment" context="MultiLineComment" char="#" char1="!" beginRegion="region"/>
+ <keyword attribute="Keyword" context="#stay" String="keywords"/>
+ <keyword attribute="Operator" context="#stay" String="operators"/>
+ <keyword attribute="Definition" context="function_decl" String="defines"/>
+ <keyword attribute="Char" context="#stay" String="characters"/>
+ <RegExpr attribute="Char" context="#stay" String="#\\."/>
+ <DetectChar attribute="String" context="String" char="&quot;"/>
+ <RegExpr attribute="Char" context="SpecialNumber" String="#[bodxei]"/>
+ <RegExpr attribute="Decimal" context="#stay" String="#[tf]"/>
+ <Float attribute="Float" context="#stay"/>
+ <Int attribute="Decimal" context="#stay"/>
+ <DetectChar attribute="Brackets1" context="Level1" char="("/>
+ </context>
+ <context name="MultiLineComment" attribute="Comment" lineEndContext="#stay">
+ <RegExpr attribute="Comment" context="#pop" String="!#\s*$" endRegion="region" column="0"/>
+ </context>
+ <context name="SpecialNumber" attribute="Normal" fallthrough="true" lineEndContext="#pop">
+ <RegExpr attribute="Decimal" context="#pop" String="\d*(\.\d+)?"/>
+ </context>
+ <context name="String" attribute="String" lineEndContext="#stay">
+ <keyword attribute="Char" context="#stay" String="characters"/>
+ <RegExpr attribute="Char" context="#stay" String="#\\."/>
+ <Detect2Chars attribute="Char" context="#stay" char="\" char1="&quot;"/>
+ <Detect2Chars attribute="Char" context="#stay" char="\" char1="\"/>
+ <DetectChar attribute="String" context="#pop" char="&quot;"/>
+ </context>
+ <context name="function_decl" attribute="Function" lineEndContext="#stay">
+ <RegExpr attribute="Function" context="#pop" String="\s*[A-Za-z0-9-+\&lt;\&gt;//\*]*\s*" />
+ </context>
+ <context name="Level1" attribute="Normal" lineEndContext="#stay">
+ <DetectChar attribute="Brackets2" context="Level2" char="("/>
+ <DetectChar attribute="Brackets1" context="#pop" char=")" />
+ <IncludeRules context="Default" />
+ </context>
+ <context name="Level2" attribute="Normal" lineEndContext="#stay">
+ <DetectChar attribute="Brackets3" context="Level3" char="("/>
+ <DetectChar attribute="Brackets2" context="#pop" char=")" />
+ <IncludeRules context="Default" />
+ </context>
+ <context name="Level3" attribute="Normal" lineEndContext="#stay">
+ <DetectChar attribute="Brackets4" context="Level4" char="("/>
+ <DetectChar attribute="Brackets3" context="#pop" char=")" />
+ <IncludeRules context="Default" />
+ </context>
+ <context name="Level4" attribute="Normal" lineEndContext="#stay">
+ <DetectChar attribute="Brackets5" context="Level5" char="("/>
+ <DetectChar attribute="Brackets4" context="#pop" char=")" />
+ <IncludeRules context="Default" />
+ </context>
+ <context name="Level5" attribute="Normal" lineEndContext="#stay">
+ <DetectChar attribute="Brackets6" context="Level6" char="("/>
+ <DetectChar attribute="Brackets5" context="#pop" char=")" />
+ <IncludeRules context="Default" />
+ </context>
+ <context name="Level6" attribute="Normal" lineEndContext="#stay">
+ <DetectChar attribute="Brackets1" context="Level1" char="("/>
+ <DetectChar attribute="Brackets6" context="#pop" char=")" />
+ <IncludeRules context="Default" />
+ </context>
+ </contexts>
+ <itemDatas>
+ <itemData name="Normal" defStyleNum="dsNormal"/>
+ <itemData name="Keyword" defStyleNum="dsKeyword"/>
+ <itemData name="Definition" defStyleNum="dsKeyword" color="#d22811"/>
+ <itemData name="Operator" defStyleNum="dsKeyword" color="#d22811"/>
+ <itemData name="Function" defStyleNum="dsFunction"/>
+ <itemData name="Data" defStyleNum="dsDataType"/>
+ <itemData name="Decimal" defStyleNum="dsDecVal"/>
+ <itemData name="BaseN" defStyleNum="dsBaseN"/>
+ <itemData name="Float" defStyleNum="dsFloat"/>
+ <itemData name="Char" defStyleNum="dsChar"/>
+ <itemData name="String" defStyleNum="dsString"/>
+ <itemData name="Comment" defStyleNum="dsComment"/>
+ <itemData name="Region Marker" defStyleNum="dsRegionMarker"/>
+ <itemData name="Brackets1" defStyleNum="dsNormal" color="#ff0000" selColor="#000000" bold="1" italic="0"/>
+ <itemData name="Brackets2" defStyleNum="dsNormal" color="#ff8800" selColor="#000000" bold="1" italic="0"/>
+ <itemData name="Brackets3" defStyleNum="dsNormal" color="#888800" selColor="#000000" bold="1" italic="0"/>
+ <itemData name="Brackets4" defStyleNum="dsNormal" color="#008800" selColor="#000000" bold="1" italic="0"/>
+ <itemData name="Brackets5" defStyleNum="dsNormal" color="#000088" selColor="#000000" bold="1" italic="0"/>
+ <itemData name="Brackets6" defStyleNum="dsNormal" color="#880088" selColor="#000000" bold="1" italic="0"/>
+ </itemDatas>
+ </highlighting>
+ <general>
+ <keywords casesensitive="1" weakDeliminator="-+*?!&lt;&gt;=/:#\"/>
+ <comments>
+ <comment name="singleLine" start=";;" />
+ <comment name="multiLine" start="#!" end="!#" />
+ </comments>
+ </general>
+</language>
diff --git a/kate/data/sci.xml b/kate/data/sci.xml
new file mode 100644
index 000000000..0a792e1bb
--- /dev/null
+++ b/kate/data/sci.xml
@@ -0,0 +1,1191 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+<language name="scilab" version="1.03" kateversion="2.3" section="Scientific" extensions="*.sci;*.sce" mimetype="text/x-sci">
+ <highlighting>
+ <list name="Structure-keywords">
+ <item> do </item>
+ <item> else </item>
+ <item> for </item>
+ <item> if </item>
+ <item> elseif </item>
+ <item> end </item>
+ <item> select </item>
+ <item> then </item>
+ <item> while </item>
+ </list>
+ <list name="Control-keywords">
+ <item> abort </item>
+ <item> break </item>
+ <item> quit </item>
+ <item> return </item>
+ <item> resume </item>
+ <item> pause </item>
+ </list>
+ <list name="Function-keywords">
+ <item> function </item>
+ <item> endfunction </item>
+ </list>
+ <list name="Warning-keywords">
+ <item> error </item>
+ <item> warning </item>
+ </list>
+ <list name="Constants-keyword">
+ <item> %F </item>
+ <item> %f </item>
+ <item> %T </item>
+ <item> %t </item>
+ <item> %e </item>
+ <item> %pi </item>
+ <item> %inf </item>
+ <item> %i </item>
+ <item> %z </item>
+ <item> %io </item>
+ <item> %s </item>
+ <item> %nan </item>
+ <item> $ </item>
+ <item> %eps </item>
+ <item> MSDOS </item>
+ </list>
+ <list name="functions">
+ <item> zpell </item>
+ <item> zpch2 </item>
+ <item> zpch1 </item>
+ <item> zpbutt </item>
+ <item> zgrid </item>
+ <item> zeros </item>
+ <item> zeropen </item>
+ <item> ZCROSS_f </item>
+ <item> yulewalk </item>
+ <item> xtitle </item>
+ <item> xtape </item>
+ <item> xstringl </item>
+ <item> xstringb </item>
+ <item> xstring </item>
+ <item> xsetm </item>
+ <item> xsetech </item>
+ <item> xset </item>
+ <item> xselect </item>
+ <item> xsegs </item>
+ <item> xsave </item>
+ <item> xs2fig </item>
+ <item> xrpoly </item>
+ <item> xrects </item>
+ <item> xrect </item>
+ <item> xpolys </item>
+ <item> xpoly </item>
+ <item> xpause </item>
+ <item> xnumb </item>
+ <item> xname </item>
+ <item> x_message_modeless </item>
+ <item> x_message </item>
+ <item> x_mdialog </item>
+ <item> x_matrix </item>
+ <item> xload </item>
+ <item> xlfont </item>
+ <item> xinit </item>
+ <item> xinfo </item>
+ <item> xgrid </item>
+ <item> xgraduate </item>
+ <item> xgetmouse </item>
+ <item> xgetfile </item>
+ <item> xgetech </item>
+ <item> xget </item>
+ <item> xfrect </item>
+ <item> xfpolys </item>
+ <item> xfpoly </item>
+ <item> xfarcs </item>
+ <item> xfarc </item>
+ <item> xend </item>
+ <item> x_dialog </item>
+ <item> xdel </item>
+ <item> xclip </item>
+ <item> xclick </item>
+ <item> xclear </item>
+ <item> xclea </item>
+ <item> x_choose </item>
+ <item> x_choices </item>
+ <item> xchange </item>
+ <item> xbasr </item>
+ <item> xbasimp </item>
+ <item> xbasc </item>
+ <item> xaxis </item>
+ <item> xarrows </item>
+ <item> xarcs </item>
+ <item> xarc </item>
+ <item> WRITEC_f </item>
+ <item> write4b </item>
+ <item> write </item>
+ <item> writb </item>
+ <item> winsid </item>
+ <item> window </item>
+ <item> wigner </item>
+ <item> wiener </item>
+ <item> whos </item>
+ <item> who </item>
+ <item> whereis </item>
+ <item> whereami </item>
+ <item> where </item>
+ <item> what </item>
+ <item> wfir </item>
+ <item> WFILE_f </item>
+ <item> wavwrite </item>
+ <item> wavread </item>
+ <item> warning </item>
+ <item> WaitMsg </item>
+ <item> varn </item>
+ <item> varargout </item>
+ <item> varargin </item>
+ <item> user </item>
+ <item> unsetmenu </item>
+ <item> unobs </item>
+ <item> unix_x </item>
+ <item> unix_w </item>
+ <item> unix_s </item>
+ <item> unix_g </item>
+ <item> unix </item>
+ <item> unique </item>
+ <item> union </item>
+ <item> ulink </item>
+ <item> ui_observer </item>
+ <item> uint8 </item>
+ <item> uint32 </item>
+ <item> uint16 </item>
+ <item> uimenu </item>
+ <item> uicontrol </item>
+ <item> typeof </item>
+ <item> typename </item>
+ <item> type </item>
+ <item> trzeros </item>
+ <item> triu </item>
+ <item> trisolve </item>
+ <item> tril </item>
+ <item> trianfml </item>
+ <item> trfmod </item>
+ <item> TRASH_f </item>
+ <item> translatepaths </item>
+ <item> trans_closure </item>
+ <item> trans </item>
+ <item> trace </item>
+ <item> toeplitz </item>
+ <item> tlist </item>
+ <item> TK_SetVar </item>
+ <item> TK_GetVar </item>
+ <item> TK_EvalStr </item>
+ <item> TK_EvalFile </item>
+ <item> titlepage </item>
+ <item> timer </item>
+ <item> time_id </item>
+ <item> TIME_f </item>
+ <item> tilda </item>
+ <item> tf2ss </item>
+ <item> tf2des </item>
+ <item> TEXT_f </item>
+ <item> texprint </item>
+ <item> testmatrix </item>
+ <item> tdinit </item>
+ <item> TCLSS_f </item>
+ <item> tanm </item>
+ <item> tanhm </item>
+ <item> tanh </item>
+ <item> tangent </item>
+ <item> TANBLK_f </item>
+ <item> tan </item>
+ <item> systmat </item>
+ <item> systems </item>
+ <item> system </item>
+ <item> syssize </item>
+ <item> syslin </item>
+ <item> sysfact- </item>
+ <item> sysdiag </item>
+ <item> sysconv </item>
+ <item> symbols </item>
+ <item> sylv </item>
+ <item> sylm </item>
+ <item> svplot </item>
+ <item> svd </item>
+ <item> sva </item>
+ <item> supernode </item>
+ <item> SUPER_f </item>
+ <item> sum </item>
+ <item> successors </item>
+ <item> subplot </item>
+ <item> subgraph </item>
+ <item> subf </item>
+ <item> strsubst </item>
+ <item> strong_con_nodes </item>
+ <item> strong_connex </item>
+ <item> stripblanks </item>
+ <item> strings </item>
+ <item> string </item>
+ <item> strindex </item>
+ <item> strcat </item>
+ <item> str2code </item>
+ <item> STOP_f </item>
+ <item> st_ility </item>
+ <item> st_deviation </item>
+ <item> startup </item>
+ <item> star </item>
+ <item> standard_output </item>
+ <item> standard_origin </item>
+ <item> standard_input </item>
+ <item> standard_draw </item>
+ <item> standard_define </item>
+ <item> stacksize </item>
+ <item> stabil </item>
+ <item> ssrand </item>
+ <item> ssprint </item>
+ <item> sskf </item>
+ <item> sscanf </item>
+ <item> ss2tf </item>
+ <item> ss2ss </item>
+ <item> ss2des </item>
+ <item> srkf </item>
+ <item> srfaur </item>
+ <item> squarewave </item>
+ <item> square </item>
+ <item> sqrtm </item>
+ <item> sqrt </item>
+ <item> sqroot </item>
+ <item> spzeros </item>
+ <item> sprintf </item>
+ <item> sprand </item>
+ <item> spones </item>
+ <item> SPLIT_f </item>
+ <item> split_edge </item>
+ <item> splin </item>
+ <item> spget </item>
+ <item> speye </item>
+ <item> specfact </item>
+ <item> spec </item>
+ <item> spcompack </item>
+ <item> spchol </item>
+ <item> sparse </item>
+ <item> spantwo </item>
+ <item> spanplus </item>
+ <item> spaninter </item>
+ <item> sp2adj </item>
+ <item> sound </item>
+ <item> sort </item>
+ <item> SOM_f </item>
+ <item> solve </item>
+ <item> %sn </item>
+ <item> smooth </item>
+ <item> sm2ss </item>
+ <item> sm2des </item>
+ <item> slash </item>
+ <item> size </item>
+ <item> sinm </item>
+ <item> sinhm </item>
+ <item> sinh </item>
+ <item> sincd </item>
+ <item> sinc </item>
+ <item> SINBLK_f </item>
+ <item> sin </item>
+ <item> simp_mode </item>
+ <item> simp </item>
+ <item> signm </item>
+ <item> sign </item>
+ <item> showprofile </item>
+ <item> show_nodes </item>
+ <item> show_graph </item>
+ <item> show_arcs </item>
+ <item> shortest_path </item>
+ <item> sgrid </item>
+ <item> Sgrayplot </item>
+ <item> Sfgrayplot </item>
+ <item> sfact </item>
+ <item> setscicosvars </item>
+ <item> setmenu </item>
+ <item> setfield </item>
+ <item> setbpt </item>
+ <item> set </item>
+ <item> sensi </item>
+ <item> SendMsg </item>
+ <item> semidef </item>
+ <item> semicolumn </item>
+ <item> semi </item>
+ <item> SELECT_f </item>
+ <item> secto3d </item>
+ <item> sd2sci </item>
+ <item> SCOPXY_f </item>
+ <item> SCOPE_f </item>
+ <item> scilink </item>
+ <item> ScilabEval </item>
+ <item> scilab </item>
+ <item> scifunc_block </item>
+ <item> scicos_model </item>
+ <item> scicos_menus </item>
+ <item> scicos_main </item>
+ <item> scicos_link </item>
+ <item> scicosim </item>
+ <item> scicos_graphics </item>
+ <item> scicos_cpr </item>
+ <item> scicos_block </item>
+ <item> scicos </item>
+ <item> sciargs </item>
+ <item> sci2map </item>
+ <item> sci2for </item>
+ <item> sci2exp </item>
+ <item> schur </item>
+ <item> scanf_conversion </item>
+ <item> scanf </item>
+ <item> scaling </item>
+ <item> SAWTOOTH_f </item>
+ <item> savewave </item>
+ <item> save_graph </item>
+ <item> save </item>
+ <item> SAT_f </item>
+ <item> SAMPLEHOLD_f </item>
+ <item> salesman </item>
+ <item> rtitr </item>
+ <item> rref </item>
+ <item> rpem </item>
+ <item> rowshuff </item>
+ <item> rowregul </item>
+ <item> rowinout </item>
+ <item> rowcompr </item>
+ <item> rowcomp </item>
+ <item> routh_t </item>
+ <item> round </item>
+ <item> rotate </item>
+ <item> roots </item>
+ <item> rlist </item>
+ <item> ric_desc </item>
+ <item> riccati </item>
+ <item> ricc </item>
+ <item> RFILE_f </item>
+ <item> residu </item>
+ <item> replot </item>
+ <item> repfreq </item>
+ <item> remezb </item>
+ <item> remez </item>
+ <item> RELAY_f </item>
+ <item> reglin </item>
+ <item> REGISTER_f </item>
+ <item> recur </item>
+ <item> real </item>
+ <item> readmps </item>
+ <item> READC_f </item>
+ <item> readc_ </item>
+ <item> readb </item>
+ <item> read4b </item>
+ <item> read </item>
+ <item> rdivf </item>
+ <item> rcond </item>
+ <item> rational </item>
+ <item> rat </item>
+ <item> rank </item>
+ <item> range </item>
+ <item> randpencil </item>
+ <item> RAND_f </item>
+ <item> rand </item>
+ <item> quote </item>
+ <item> quit </item>
+ <item> quaskro </item>
+ <item> quapro </item>
+ <item> QUANT_f </item>
+ <item> qr </item>
+ <item> qassign </item>
+ <item> pwd </item>
+ <item> pvm_tidtohost </item>
+ <item> pvm_start </item>
+ <item> pvm_spawn_independent </item>
+ <item> pvm_spawn </item>
+ <item> pvm_set_timer </item>
+ <item> pvm_send </item>
+ <item> pvm_sci2f77 </item>
+ <item> pvm_reduce </item>
+ <item> pvm_recv </item>
+ <item> pvm_probe </item>
+ <item> pvm_mytid </item>
+ <item> pvm_lvgroup </item>
+ <item> pvm_kill </item>
+ <item> pvm_joingroup </item>
+ <item> pvm_halt </item>
+ <item> pvm_gsize </item>
+ <item> pvm_get_timer </item>
+ <item> pvm_getinst </item>
+ <item> pvm_exit </item>
+ <item> pvm_error </item>
+ <item> pvm_delhosts </item>
+ <item> pvmd3 </item>
+ <item> pvm_config </item>
+ <item> pvm_bufinfo </item>
+ <item> pvm_bcast </item>
+ <item> pvm_addhosts </item>
+ <item> pvm </item>
+ <item> pspect </item>
+ <item> psmall </item>
+ <item> projspec </item>
+ <item> projsl </item>
+ <item> proj </item>
+ <item> profile </item>
+ <item> PROD_f </item>
+ <item> prod </item>
+ <item> printing </item>
+ <item> printf_conversion </item>
+ <item> printf </item>
+ <item> print </item>
+ <item> predef </item>
+ <item> predecessors </item>
+ <item> prbs_a </item>
+ <item> ppol </item>
+ <item> power </item>
+ <item> POWBLK_f </item>
+ <item> POSTONEG_f </item>
+ <item> portrait </item>
+ <item> portr3d </item>
+ <item> poly </item>
+ <item> polfact </item>
+ <item> polarplot </item>
+ <item> polar </item>
+ <item> pol2tex </item>
+ <item> pol2str </item>
+ <item> pol2des </item>
+ <item> pmodulo </item>
+ <item> p_margin </item>
+ <item> plzr </item>
+ <item> plus </item>
+ <item> plotprofile </item>
+ <item> plot_graph </item>
+ <item> plotframe </item>
+ <item> plot3d3 </item>
+ <item> plot3d2 </item>
+ <item> plot3d1 </item>
+ <item> plot3d </item>
+ <item> plot2d4 </item>
+ <item> plot2d3 </item>
+ <item> plot2d2 </item>
+ <item> plot2d1 </item>
+ <item> plot2d </item>
+ <item> plot </item>
+ <item> playsnd </item>
+ <item> pipe_network </item>
+ <item> pinv </item>
+ <item> phc </item>
+ <item> phasemag </item>
+ <item> pfss </item>
+ <item> pertrans </item>
+ <item> perfect_match </item>
+ <item> percent </item>
+ <item> penlaur </item>
+ <item> pencan </item>
+ <item> pen2ea </item>
+ <item> pdiv </item>
+ <item> pbig </item>
+ <item> path_2_nodes </item>
+ <item> part </item>
+ <item> parrot </item>
+ <item> parents </item>
+ <item> paramfplot2d </item>
+ <item> param3d1 </item>
+ <item> param3d </item>
+ <item> overloading </item>
+ <item> OUT_f </item>
+ <item> orth </item>
+ <item> or </item>
+ <item> optim </item>
+ <item> ones </item>
+ <item> oldsave </item>
+ <item> oldload </item>
+ <item> ode_root </item>
+ <item> odeoptions </item>
+ <item> ode_discrete </item>
+ <item> odedi </item>
+ <item> odedc </item>
+ <item> ode </item>
+ <item> obsvss </item>
+ <item> obsv_mat </item>
+ <item> obs_gram </item>
+ <item> observer </item>
+ <item> obscont1 </item>
+ <item> obscont </item>
+ <item> nyquist </item>
+ <item> numer </item>
+ <item> null </item>
+ <item> not </item>
+ <item> norm </item>
+ <item> noisegen </item>
+ <item> nodes_degrees </item>
+ <item> nodes_2_path </item>
+ <item> node_number </item>
+ <item> nnz </item>
+ <item> nlev </item>
+ <item> nf3d </item>
+ <item> newfun </item>
+ <item> newest </item>
+ <item> netwindows </item>
+ <item> netwindow </item>
+ <item> netclose </item>
+ <item> neighbors </item>
+ <item> nehari </item>
+ <item> NEGTOPOS_f </item>
+ <item> narsimul </item>
+ <item> names </item>
+ <item> MUX_f </item>
+ <item> mulf </item>
+ <item> mu2lin </item>
+ <item> mtlb_sparse </item>
+ <item> mtlb_save </item>
+ <item> mtlb_mode </item>
+ <item> mtlb_load </item>
+ <item> mtell </item>
+ <item> msscanf </item>
+ <item> msprintf </item>
+ <item> mseek </item>
+ <item> mscanf </item>
+ <item> mrfit </item>
+ <item> mputstr </item>
+ <item> mputl </item>
+ <item> mput </item>
+ <item> mps2linpro </item>
+ <item> mprintf </item>
+ <item> mopen </item>
+ <item> modulo </item>
+ <item> mode </item>
+ <item> mlist </item>
+ <item> min_weight_tree </item>
+ <item> minus </item>
+ <item> minss </item>
+ <item> minreal </item>
+ <item> min_qcost_flow </item>
+ <item> min_lcost_flow2 </item>
+ <item> min_lcost_flow1 </item>
+ <item> min_lcost_cflow </item>
+ <item> mini </item>
+ <item> MIN_f </item>
+ <item> mine </item>
+ <item> min </item>
+ <item> milk_drop </item>
+ <item> mgetstr </item>
+ <item> mgetl </item>
+ <item> mgeti </item>
+ <item> mget </item>
+ <item> mfscanf </item>
+ <item> mfprintf </item>
+ <item> mfile2sci </item>
+ <item> mfft </item>
+ <item> MFCLCK_f </item>
+ <item> metanet_sync </item>
+ <item> metanet </item>
+ <item> mesh2d </item>
+ <item> mese </item>
+ <item> meof </item>
+ <item> median </item>
+ <item> mean </item>
+ <item> mclose </item>
+ <item> MCLOCK_f </item>
+ <item> mclearerr </item>
+ <item> m_circle </item>
+ <item> maxi </item>
+ <item> max_flow </item>
+ <item> MAX_f </item>
+ <item> max_clique </item>
+ <item> max_cap_path </item>
+ <item> max </item>
+ <item> matrix </item>
+ <item> matrices </item>
+ <item> Matplot1 </item>
+ <item> Matplot </item>
+ <item> mat_2_graph </item>
+ <item> markp2ss </item>
+ <item> mapsound </item>
+ <item> manedit </item>
+ <item> man </item>
+ <item> make_graph </item>
+ <item> macrovar </item>
+ <item> macro </item>
+ <item> macr2lst </item>
+ <item> macglov </item>
+ <item> lyap </item>
+ <item> lusolve </item>
+ <item> luget </item>
+ <item> lufact </item>
+ <item> ludel </item>
+ <item> lu </item>
+ <item> ltitr </item>
+ <item> lstcat </item>
+ <item> lsslist </item>
+ <item> lqr </item>
+ <item> lqg_ltr </item>
+ <item> lqg2stan </item>
+ <item> lqg </item>
+ <item> lqe </item>
+ <item> lotest </item>
+ <item> LOOKUP_f </item>
+ <item> logspace </item>
+ <item> logm </item>
+ <item> LOGBLK_f </item>
+ <item> log2 </item>
+ <item> log10 </item>
+ <item> log </item>
+ <item> locate </item>
+ <item> loadwave </item>
+ <item> load_graph </item>
+ <item> load </item>
+ <item> lmitool </item>
+ <item> lmisolver </item>
+ <item> list </item>
+ <item> linspace </item>
+ <item> linsolve </item>
+ <item> linpro </item>
+ <item> link </item>
+ <item> linfn </item>
+ <item> linf </item>
+ <item> lines </item>
+ <item> line_graph </item>
+ <item> lindquist </item>
+ <item> lin2mu </item>
+ <item> lin </item>
+ <item> lib </item>
+ <item> lgfft </item>
+ <item> lft </item>
+ <item> lex_sort </item>
+ <item> levin </item>
+ <item> lev </item>
+ <item> less </item>
+ <item> leqr </item>
+ <item> length </item>
+ <item> legends </item>
+ <item> left </item>
+ <item> leastsq </item>
+ <item> ldivf </item>
+ <item> ldiv </item>
+ <item> lcmdiag </item>
+ <item> lcm </item>
+ <item> lcf </item>
+ <item> lattp </item>
+ <item> lattn </item>
+ <item> lasterror </item>
+ <item> kroneck </item>
+ <item> kron </item>
+ <item> krac2 </item>
+ <item> kpure </item>
+ <item> knapsack </item>
+ <item> keyboard </item>
+ <item> kernel </item>
+ <item> karmarkar </item>
+ <item> kalm </item>
+ <item> %k </item>
+ <item> jmat </item>
+ <item> isreal </item>
+ <item> isoview </item>
+ <item> isnan </item>
+ <item> isinf </item>
+ <item> isglobal </item>
+ <item> iserror </item>
+ <item> isdef </item>
+ <item> is_connex </item>
+ <item> invsyslin </item>
+ <item> invr </item>
+ <item> inv_coeff </item>
+ <item> INVBLK_f </item>
+ <item> inv </item>
+ <item> inttype </item>
+ <item> inttrap </item>
+ <item> intsplin </item>
+ <item> INTRPLBLK_f </item>
+ <item> INTRP2BLK_f </item>
+ <item> intppty </item>
+ <item> intl </item>
+ <item> intg </item>
+ <item> intersect </item>
+ <item> intersci </item>
+ <item> interpln </item>
+ <item> interp </item>
+ <item> integrate </item>
+ <item> INTEGRAL_f </item>
+ <item> intdec </item>
+ <item> intc </item>
+ <item> int8 </item>
+ <item> int3d </item>
+ <item> int32 </item>
+ <item> int2d </item>
+ <item> int16 </item>
+ <item> int </item>
+ <item> insertion </item>
+ <item> input </item>
+ <item> IN_f </item>
+ <item> imrep2ss </item>
+ <item> impl </item>
+ <item> im_inv </item>
+ <item> imag </item>
+ <item> ilib_gen_Make </item>
+ <item> ilib_gen_loader </item>
+ <item> ilib_gen_gateway </item>
+ <item> ilib_for_link </item>
+ <item> ilib_compile </item>
+ <item> ilib_build </item>
+ <item> iirlp </item>
+ <item> iirgroup </item>
+ <item> iir </item>
+ <item> IFTHEL_f </item>
+ <item> ieee </item>
+ <item> iconvert </item>
+ <item> hypermatrices </item>
+ <item> hypermat </item>
+ <item> htrianr </item>
+ <item> hrmt </item>
+ <item> householder </item>
+ <item> hotcolormap </item>
+ <item> host </item>
+ <item> horner </item>
+ <item> h_norm </item>
+ <item> histplot </item>
+ <item> hist3d </item>
+ <item> h_inf_st </item>
+ <item> h_inf </item>
+ <item> hilb </item>
+ <item> hex2dec </item>
+ <item> hess </item>
+ <item> hermit </item>
+ <item> %helps </item>
+ <item> help </item>
+ <item> h_cl </item>
+ <item> havewindow </item>
+ <item> hat </item>
+ <item> hankelsv </item>
+ <item> hank </item>
+ <item> hamilton </item>
+ <item> HALT_f </item>
+ <item> halt </item>
+ <item> h2norm </item>
+ <item> gtild </item>
+ <item> gstacksize </item>
+ <item> gspec </item>
+ <item> gsort </item>
+ <item> gschur </item>
+ <item> group </item>
+ <item> gr_menu </item>
+ <item> grep </item>
+ <item> graypolarplot </item>
+ <item> grayplot </item>
+ <item> graycolormap </item>
+ <item> graph_union </item>
+ <item> graph_sum </item>
+ <item> graph_simp </item>
+ <item> graph_power </item>
+ <item> graph-list </item>
+ <item> Graphics </item>
+ <item> graph_diameter </item>
+ <item> graph_complement </item>
+ <item> graph_center </item>
+ <item> graph_2_mat </item>
+ <item> grand </item>
+ <item> graduate </item>
+ <item> gpeche </item>
+ <item> g_margin </item>
+ <item> G_make </item>
+ <item> global </item>
+ <item> glist </item>
+ <item> glever </item>
+ <item> givens </item>
+ <item> girth </item>
+ <item> gfrancis </item>
+ <item> gfare </item>
+ <item> getversion </item>
+ <item> getvalue </item>
+ <item> getsymbol </item>
+ <item> getscicosvars </item>
+ <item> getpid </item>
+ <item> GetMsg </item>
+ <item> getmark </item>
+ <item> getlinestyle </item>
+ <item> getio </item>
+ <item> get_function_path </item>
+ <item> getfont </item>
+ <item> getfield </item>
+ <item> getf </item>
+ <item> getenv </item>
+ <item> getdate </item>
+ <item> getd </item>
+ <item> getcwd </item>
+ <item> getcolor </item>
+ <item> getblocklabel </item>
+ <item> get </item>
+ <item> geom3d </item>
+ <item> GENSQR_f </item>
+ <item> GENSIN_f </item>
+ <item> gen_net </item>
+ <item> genmarkov </item>
+ <item> genlib </item>
+ <item> genfac3d </item>
+ <item> GENERIC_f </item>
+ <item> GENERAL_f </item>
+ <item> gcf </item>
+ <item> gcd </item>
+ <item> gcare </item>
+ <item> gammaln </item>
+ <item> gamma </item>
+ <item> gamitg </item>
+ <item> gainplot </item>
+ <item> GAIN_f </item>
+ <item> GAINBLK_f </item>
+ <item> fusee </item>
+ <item> funptr </item>
+ <item> funcprot </item>
+ <item> fun2string </item>
+ <item> fullrfk </item>
+ <item> fullrf </item>
+ <item> full </item>
+ <item> fstair </item>
+ <item> fstabst </item>
+ <item> fspecg </item>
+ <item> fsolve </item>
+ <item> fsfirlin </item>
+ <item> fscanfMat </item>
+ <item> fscanf </item>
+ <item> frmag </item>
+ <item> frfit </item>
+ <item> frexp </item>
+ <item> freson </item>
+ <item> freq </item>
+ <item> frep2tf </item>
+ <item> fprintfMat </item>
+ <item> fprintf </item>
+ <item> fplot3d1 </item>
+ <item> fplot3d </item>
+ <item> fplot2d </item>
+ <item> fourplan </item>
+ <item> fort </item>
+ <item> formatman </item>
+ <item> format </item>
+ <item> flts </item>
+ <item> floor </item>
+ <item> fix </item>
+ <item> fit_dat </item>
+ <item> find_path </item>
+ <item> findobj </item>
+ <item> findm </item>
+ <item> find_freq </item>
+ <item> find </item>
+ <item> filter </item>
+ <item> fileinfo </item>
+ <item> file </item>
+ <item> figure </item>
+ <item> fgrayplot </item>
+ <item> fft </item>
+ <item> ffilt </item>
+ <item> feval </item>
+ <item> feedback </item>
+ <item> fec </item>
+ <item> fcontour2d </item>
+ <item> fcontour </item>
+ <item> fchamp </item>
+ <item> faurre </item>
+ <item> factors </item>
+ <item> fac3d </item>
+ <item> eye </item>
+ <item> extraction </item>
+ <item> external </item>
+ <item> expm </item>
+ <item> EXPBLK_f </item>
+ <item> exp </item>
+ <item> exit </item>
+ <item> exists </item>
+ <item> execstr </item>
+ <item> ExecScilab </item>
+ <item> ExeclScilab </item>
+ <item> ExecAppli </item>
+ <item> exec </item>
+ <item> excel2sci </item>
+ <item> Example </item>
+ <item> EVTGEN_f </item>
+ <item> EVTDLY_f </item>
+ <item> evstr </item>
+ <item> EVENTSCOPE_f </item>
+ <item> evans </item>
+ <item> eval3dp </item>
+ <item> eval3d </item>
+ <item> eval </item>
+ <item> error </item>
+ <item> errclear </item>
+ <item> errcatch </item>
+ <item> errbar </item>
+ <item> erfcx </item>
+ <item> erfc </item>
+ <item> erf </item>
+ <item> ereduc </item>
+ <item> equil1 </item>
+ <item> equil </item>
+ <item> equal </item>
+ <item> eqiir </item>
+ <item> eqfir </item>
+ <item> emptystr </item>
+ <item> empty </item>
+ <item> ell1mag </item>
+ <item> eigenmarkov </item>
+ <item> edit_curv </item>
+ <item> edit </item>
+ <item> edge_number </item>
+ <item> dtsi </item>
+ <item> dt_ility </item>
+ <item> dsimul </item>
+ <item> dscr </item>
+ <item> driver </item>
+ <item> drawaxis </item>
+ <item> dragrect </item>
+ <item> double </item>
+ <item> dot </item>
+ <item> DLSS_f </item>
+ <item> DLR_f </item>
+ <item> DLRADAPT_f </item>
+ <item> dlgamma </item>
+ <item> dispfile </item>
+ <item> dispbpt </item>
+ <item> disp </item>
+ <item> diophant </item>
+ <item> diary </item>
+ <item> diag </item>
+ <item> dhnorm </item>
+ <item> dft </item>
+ <item> detr </item>
+ <item> determ </item>
+ <item> det </item>
+ <item> DestroyLink </item>
+ <item> des2tf </item>
+ <item> des2ss </item>
+ <item> derivative- </item>
+ <item> derivat </item>
+ <item> denom </item>
+ <item> DEMUX_f </item>
+ <item> demos </item>
+ <item> delmenu </item>
+ <item> delip </item>
+ <item> delete_nodes </item>
+ <item> delete_arcs </item>
+ <item> delbpt </item>
+ <item> DELAYV_f </item>
+ <item> DELAY_f </item>
+ <item> degree </item>
+ <item> deff </item>
+ <item> dec2hex </item>
+ <item> debug </item>
+ <item> ddp </item>
+ <item> dcf </item>
+ <item> dbphi </item>
+ <item> date </item>
+ <item> datafit </item>
+ <item> dassl </item>
+ <item> dasrt </item>
+ <item> czt </item>
+ <item> cycle_basis </item>
+ <item> CURV_f </item>
+ <item> curblock </item>
+ <item> cumsum </item>
+ <item> cumprod </item>
+ <item> ctr_gram </item>
+ <item> cspect </item>
+ <item> csim </item>
+ <item> CreateLink </item>
+ <item> cothm </item>
+ <item> coth </item>
+ <item> cotg </item>
+ <item> cosm </item>
+ <item> coshm </item>
+ <item> cosh </item>
+ <item> COSBLK_f </item>
+ <item> cos </item>
+ <item> corr </item>
+ <item> copfac </item>
+ <item> convstr </item>
+ <item> convol </item>
+ <item> convex_hull </item>
+ <item> contrss </item>
+ <item> contract_edge </item>
+ <item> contr </item>
+ <item> contourf </item>
+ <item> contour2di </item>
+ <item> contour2d </item>
+ <item> contour </item>
+ <item> cont_mat </item>
+ <item> cont_frm </item>
+ <item> CONST_f </item>
+ <item> con_nodes </item>
+ <item> connex </item>
+ <item> conj </item>
+ <item> cond </item>
+ <item> companion </item>
+ <item> comp </item>
+ <item> Communications </item>
+ <item> colregul </item>
+ <item> colormap </item>
+ <item> colon </item>
+ <item> colnew </item>
+ <item> colinout </item>
+ <item> colcompr </item>
+ <item> colcomp </item>
+ <item> coffg </item>
+ <item> coff </item>
+ <item> coeff </item>
+ <item> code2str </item>
+ <item> cmndred </item>
+ <item> cmb_lin </item>
+ <item> CLSS_f </item>
+ <item> cls2dls </item>
+ <item> CLR_f </item>
+ <item> close </item>
+ <item> CLOCK_f </item>
+ <item> CLKSPLIT_f </item>
+ <item> CLKSOMV_f </item>
+ <item> CLKSOM_f </item>
+ <item> CLKOUTV_f </item>
+ <item> CLKOUT_f </item>
+ <item> CLKINV_f </item>
+ <item> CLKIN_f </item>
+ <item> c_link </item>
+ <item> CLINDUMMY_f </item>
+ <item> clearglobal </item>
+ <item> clearfun </item>
+ <item> clear </item>
+ <item> clean </item>
+ <item> classmarkov </item>
+ <item> circuit </item>
+ <item> chsolve </item>
+ <item> chol </item>
+ <item> chfact </item>
+ <item> chepol </item>
+ <item> check_graph </item>
+ <item> cheb2mag </item>
+ <item> cheb1mag </item>
+ <item> chdir </item>
+ <item> chart </item>
+ <item> champ1 </item>
+ <item> champ </item>
+ <item> chaintest </item>
+ <item> chain_struct </item>
+ <item> cepstrum </item>
+ <item> ceil </item>
+ <item> cdft </item>
+ <item> cdfpoi </item>
+ <item> cdfnor </item>
+ <item> cdfnbn </item>
+ <item> cdfgam </item>
+ <item> cdffnc </item>
+ <item> cdff </item>
+ <item> cdfchn </item>
+ <item> cdfchi </item>
+ <item> cdfbin </item>
+ <item> cdfbet </item>
+ <item> ccontrg </item>
+ <item> casc </item>
+ <item> canon </item>
+ <item> call </item>
+ <item> calfrq </item>
+ <item> calerf </item>
+ <item> cainv </item>
+ <item> bvode </item>
+ <item> buttmag </item>
+ <item> bstap </item>
+ <item> boucle </item>
+ <item> boolean </item>
+ <item> bool2s </item>
+ <item> bode </item>
+ <item> bloc2ss </item>
+ <item> bloc2exp </item>
+ <item> black </item>
+ <item> binomial </item>
+ <item> bilin </item>
+ <item> BIGSOM_f </item>
+ <item> bifish </item>
+ <item> bezout </item>
+ <item> best_match </item>
+ <item> bessely </item>
+ <item> besselk </item>
+ <item> besselj </item>
+ <item> besseli </item>
+ <item> bdiag </item>
+ <item> bandwr </item>
+ <item> balreal </item>
+ <item> balanc </item>
+ <item> backslash </item>
+ <item> auwrite </item>
+ <item> auread </item>
+ <item> augment </item>
+ <item> atanm </item>
+ <item> atanhm </item>
+ <item> atanh </item>
+ <item> atan </item>
+ <item> %asn </item>
+ <item> asinm </item>
+ <item> asinhm </item>
+ <item> asinh </item>
+ <item> asin </item>
+ <item> ascii </item>
+ <item> articul </item>
+ <item> artest </item>
+ <item> arsimul </item>
+ <item> armax1 </item>
+ <item> armax </item>
+ <item> armac </item>
+ <item> arma2p </item>
+ <item> arma </item>
+ <item> arl2 </item>
+ <item> arhnk </item>
+ <item> argn </item>
+ <item> arc_number </item>
+ <item> arc_graph </item>
+ <item> apropos </item>
+ <item> ans </item>
+ <item> ANIMXY_f </item>
+ <item> ANDLOG_f </item>
+ <item> and </item>
+ <item> analyze </item>
+ <item> analpf </item>
+ <item> amell </item>
+ <item> alufunctions </item>
+ <item> AFFICH_f </item>
+ <item> aff2ab </item>
+ <item> adj_lists </item>
+ <item> adj2sp </item>
+ <item> add_node </item>
+ <item> addmenu </item>
+ <item> addinter </item>
+ <item> addf </item>
+ <item> add_edge </item>
+ <item> addcolor </item>
+ <item> AdCommunications </item>
+ <item> acosm </item>
+ <item> acoshm </item>
+ <item> acosh </item>
+ <item> acos </item>
+ <item> ABSBLK_f </item>
+ <item> abs </item>
+ <item> abinv </item>
+ <item> abcd </item>
+ </list>
+ <contexts>
+ <context name="main" attribute="Normal Text" lineEndContext="#stay">
+ <keyword attribute="Structure-keywords" context="#stay" String="Structure-keywords"/>
+ <keyword attribute="Control-keywords" context="#stay" String="Control-keywords"/>
+ <keyword attribute="Function-keywords" context="#stay" String="Function-keywords"/>
+ <keyword attribute="Warning-keywords" context="#stay" String="Warning-keywords"/>
+ <keyword attribute="Constants-keyword" context="#stay" String="Constants-keyword"/>
+ <keyword attribute="functions" context="#stay" String="functions"/>
+ <Float attribute = "Flo" context="#stay"/>
+ <Int attribute = "Decimal" context="#stay"/>
+ <RegExpr String= "//.*$" attribute = "Comment" context="#stay"/>
+ <RangeDetect char = "&quot;" char1 = "&quot;" attribute = "String" context="#stay"/>
+ </context>
+ </contexts>
+ <itemDatas>
+ <itemData name="Normal Text" defStyleNum="dsNormal"/>
+ <itemData name="Structure-keywords" defStyleNum="dsNormal" color="#000080" selColor="#ffff00" bold="1" italic="0"/>
+ <itemData name="Control-keywords" defStyleNum="dsNormal" color="#800000" selColor="#ff0000" bold="1" italic="0"/>
+ <itemData name="Function-keywords" defStyleNum="dsFunction" color="#008000" selColor="#ffff00" bold="1" italic="0"/>
+ <itemData name="Warning-keywords" defStyleNum="dsNormal" color="#ff0000" selColor="#ff0000" bold="1" italic="0"/>
+ <itemData name="Constants-keyword" defStyleNum="dsNormal" color="#008080" selColor="#00ffff" bold="1" italic="0"/>
+ <itemData name="functions" defStyleNum="dsFunction" color="#0000ff" selColor="#00ff00" bold="1" italic="1"/>
+ <itemData name="Decimal" defStyleNum = "dsDecVal"/>
+ <itemData name="Float" defStyleNum = "dsFloat"/>
+ <itemData name="Comment" defStyleNum = "dsComment"/>
+ <itemData name="String" defStyleNum = "dsString"/>
+ </itemDatas>
+ </highlighting>
+ <general>
+ <comments>
+ <comment name="singleLine" start="//" />
+ </comments>
+ <keywords casesensitive="1" weakDeliminator="%$" />
+ </general>
+</language>
diff --git a/kate/data/sgml.xml b/kate/data/sgml.xml
new file mode 100644
index 000000000..2292c3195
--- /dev/null
+++ b/kate/data/sgml.xml
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+<language name="SGML" version="1.02" kateversion="2.1" section="Markup" extensions="*.sgml" mimetype="text/sgml">
+ <highlighting>
+ <contexts>
+ <context attribute="Normal Text" lineEndContext="#stay" name="Normal Text" >
+ <StringDetect attribute="Comment" context="Comment" String="&lt;!--"/>
+ <RegExpr attribute="Tag" context="Attribute" String="&lt;\s*\/?\s*[a-zA-Z_:][a-zA-Z0-9._:-]*" />
+ </context>
+
+ <context attribute="Attribute Name" lineEndContext="#stay" name="Attribute" >
+ <Detect2Chars attribute="Tag" context="#pop" char="/" char1="&gt;" />
+ <DetectChar attribute="Tag" context="#pop" char="&gt;" />
+ <RegExpr attribute="Normal Text" context="Value" String="\s*=\s*" />
+ </context>
+
+ <context attribute="Attribute Value" lineEndContext="#stay" name="Value" >
+ <Detect2Chars attribute="Tag" context="#pop#pop" char="/" char1="&gt;" />
+ <DetectChar attribute="Tag" context="#pop#pop" char="&gt;" />
+ <DetectChar attribute="Attribute Value" context="Value 2" char="&quot;" />
+ </context>
+
+ <context attribute="Attribute Value" lineEndContext="#stay" name="Value 2" >
+ <DetectChar attribute="Attribute Value" context="#pop#pop" char="&quot;" />
+ </context>
+
+ <context attribute="Comment" lineEndContext="#stay" name="Comment" >
+ <StringDetect attribute="Comment" context="#pop" String="--&gt;"/>
+ </context>
+
+ </contexts>
+ <itemDatas>
+ <itemData name="Normal Text" defStyleNum="dsNormal"/>
+ <itemData name="Tag" defStyleNum="dsKeyword"/>
+ <itemData name="Attribute Name" defStyleNum="dsOthers"/>
+ <itemData name="Attribute Value" defStyleNum="dsDataType"/>
+ <itemData name="Comment" defStyleNum="dsComment"/>
+ </itemDatas>
+ </highlighting>
+ <general>
+ <comments>
+ <comment name="multiLine" start="&lt;!--" end="//--&gt;" />
+ </comments>
+ <keywords casesensitive="0" />
+ </general>
+</language>
diff --git a/kate/data/sieve.xml b/kate/data/sieve.xml
new file mode 100644
index 000000000..95ef08b1d
--- /dev/null
+++ b/kate/data/sieve.xml
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+<!-- Highlighting for Sieve scripts (RFC 3028) written by Petter E. Stokke -->
+<language name="Sieve" version="1.05" kateversion="2.4" section="Scripts" extensions="*.siv" mimetype="application/sieve" priority="5" author="Petter E. Stokke" license="">
+ <highlighting>
+ <list name="keywords">
+ <item> require </item>
+ <item> if </item>
+ <item> elsif </item>
+ <item> else </item>
+ <item> discard </item>
+ <item> stop </item>
+ <item> fileinto </item>
+ <item> keep </item>
+ <item> reject </item>
+ <item> redirect </item>
+ </list>
+ <contexts>
+ <context attribute="Normal Text" lineEndContext="#stay" name="Normal">
+ <keyword attribute="Keyword" context="#stay" String="keywords"/>
+ <DetectChar attribute="Symbol" context="#stay" char="{" beginRegion="Brace1" />
+ <DetectChar attribute="Symbol" context="#stay" char="}" endRegion="Brace1" />
+ <RegExpr attribute="Decimal" context="#stay" String="\d+[KMG]?" />
+ <DetectChar attribute="String" context="String" char="&quot;"/>
+ <RegExpr attribute="String" context="MultilineString" String="text:$" beginRegion="String" />
+ <Detect2Chars attribute="Comment" context="Comment" char="/" char1="*" beginRegion="Comment"/>
+ <RegExpr attribute="Comment" String="#.*$" context="#stay"/>
+ <RegExpr attribute="Tagged Argument" context="#stay" String=":\w+"/>
+ <RegExpr attribute="Symbol" context="Member" String="[.]{1,1}" />
+ <AnyChar attribute="Symbol" context="#stay" String=":!%&amp;()+,-/.*&lt;=&gt;?[]|~^&#59;"/>
+ </context>
+ <context attribute="String" lineEndContext="#pop" name="String">
+ <LineContinue attribute="String" context="#stay"/>
+ <HlCStringChar attribute="String Char" context="#stay"/>
+ <DetectChar attribute="String" context="#pop" char="&quot;"/>
+ </context>
+ <context attribute="String" name="MultilineString" lineEndContext="#stay">
+ <RegExpr attribute="String" context="#pop" String="\.$" column="0"/>
+ <HlCStringChar attribute="String Char" context="#stay" />
+ </context>
+ <context attribute="Normal Text" lineEndContext="#pop" name="Member" fallthrough="true" fallthroughContext="#pop">
+ <RegExpr attribute="Function" context="#pop" String="\b[_a-zA-Z]\w*(?=[\s]*)" />
+ </context>
+ <context attribute="Comment" lineEndContext="#stay" name="Comment">
+ <Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" endRegion="Comment"/>
+ </context>
+ </contexts>
+ <itemDatas>
+ <itemData name="Normal Text" defStyleNum="dsNormal"/>
+ <itemData name="Keyword" defStyleNum="dsKeyword"/>
+ <itemData name="Decimal" defStyleNum="dsDecVal"/>
+ <itemData name="String" defStyleNum="dsString"/>
+ <itemData name="String Char" defStyleNum="dsChar"/>
+ <itemData name="Comment" defStyleNum="dsComment"/>
+ <itemData name="Symbol" defStyleNum="dsNormal"/>
+ <itemData name="Tagged Argument" defStyleNum="dsOthers"/>
+ <itemData name="Function" defStyleNum="dsFunction" />
+ </itemDatas>
+ </highlighting>
+ <general>
+ <comments>
+ <comment name="multiLine" start="/*" end="*/" />
+ <comment name="singleLine" start="#" />
+ </comments>
+ <keywords casesensitive="1" />
+ </general>
+</language>
diff --git a/kate/data/sml.xml b/kate/data/sml.xml
new file mode 100644
index 000000000..eeae780fc
--- /dev/null
+++ b/kate/data/sml.xml
@@ -0,0 +1,104 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+<language name="SML" version="1.06" kateversion="2.1" section="Sources" extensions="*.sml;*.ml" mimetype="" author="Christoph Cullmann (cullmann@kde.org)" license="LGPL">
+ <highlighting>
+ <list name="keywords">
+ <item> abstype </item>
+ <item> and </item>
+ <item> andalso </item>
+ <item> as </item>
+ <item> case </item>
+ <item> do </item>
+ <item> datatype </item>
+ <item> else </item>
+ <item> end </item>
+ <item> eqtype </item>
+ <item> exception </item>
+ <item> false </item>
+ <item> fn </item>
+ <item> fun </item>
+ <item> functor </item>
+ <item> handle </item>
+ <item> if </item>
+ <item> in </item>
+ <item> include </item>
+ <item> infix </item>
+ <item> infixr </item>
+ <item> let </item>
+ <item> local </item>
+ <item> nonfix </item>
+ <item> of </item>
+ <item> op </item>
+ <item> open </item>
+ <item> orelse </item>
+ <item> raise </item>
+ <item> rec </item>
+ <item> sharing </item>
+ <item> sig </item>
+ <item> signature </item>
+ <item> struct </item>
+ <item> structure </item>
+ <item> then </item>
+ <item> true </item>
+ <item> type </item>
+ <item> val </item>
+ <item> where </item>
+ <item> with </item>
+ <item> withtype </item>
+ <item> while </item>
+ </list>
+ <list name="types">
+ <item> unit </item>
+ <item> int </item>
+ <item> real </item>
+ <item> char </item>
+ <item> string </item>
+ <item> substring </item>
+ <item> word </item>
+ <item> ref </item>
+ <item> array </item>
+ <item> vector </item>
+ <item> bool </item>
+ <item> list </item>
+ <item> option </item>
+ <item> order </item>
+ </list>
+ <contexts>
+ <context attribute="Normal Text" lineEndContext="#stay" name="Normal">
+ <Detect2Chars attribute="Comment" context="Multiline/Inline Comment" char="(" char1="*" />
+ <DetectChar attribute="String" context="String" char="&quot;" />
+ <keyword attribute="Keyword" context="#stay" String="keywords" />
+ <keyword attribute="Data Type" context="#stay" String="types" />
+ <Float attribute="Float" context="#stay">
+ <AnyChar String="fF" attribute="Float" context="#stay"/>
+ </Float>
+ <HlCHex attribute="Decimal" context="#stay"/>
+ <Int attribute="Decimal" context="#stay" />
+ </context>
+ <context attribute="Comment" lineEndContext="#stay" name="Multiline/Inline Comment">
+ <Detect2Chars attribute="Comment" context="#pop" char="*" char1=")" />
+ </context>
+ <context attribute="String" lineEndContext="#stay" name="String">
+ <HlCStringChar attribute="String Char" context="#stay"/>
+ <DetectChar attribute="String" context="#pop" char="&quot;" />
+ </context>
+ </contexts>
+ <itemDatas>
+ <itemData name="Normal Text" defStyleNum="dsNormal"/>
+ <itemData name="Keyword" defStyleNum="dsKeyword"/>
+ <itemData name="Data Type" defStyleNum="dsDataType"/>
+ <itemData name="Decimal" defStyleNum="dsDecVal"/>
+ <itemData name="Float" defStyleNum="dsFloat"/>
+ <itemData name="String" defStyleNum="dsString"/>
+ <itemData name="Comment" defStyleNum="dsComment" />
+ <itemData name="Notice" defStyleNum="dsString" />
+ <itemData name="String Char" defStyleNum="dsChar" />
+ </itemDatas>
+ </highlighting>
+ <general>
+ <keywords casesensitive="1" />
+ <comments>
+ <comment name="multiLine" start="(*" end="*)" />
+ </comments>
+ </general>
+</language>
diff --git a/kate/data/spice.xml b/kate/data/spice.xml
new file mode 100644
index 000000000..03b183acf
--- /dev/null
+++ b/kate/data/spice.xml
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+
+<language name="Spice" section="Hardware" version="1.01" kateversion="2.3" extensions="*.sp;*.hsp" mimetype="text/spice" author="Steven Robson (s.a.robson@sms.ed.ac.uk) and Anders Lund" license="LGPL">
+ <highlighting>
+
+ <contexts>
+
+ <context attribute="Normal Text" lineEndContext="#stay" name="Normal">
+ <RegExpr attribute="Keyword" context="#stay" String="\B\.\w+" />
+ <Int attribute="Number" context="#stay"/>
+ <Float attribute="Number" context="#stay"/>
+ <AnyChar attribute="Comment" String="$*" context="Commentar 1" />
+ <DetectChar attribute="String" context="String" char="&quot;"/>
+ <DetectChar attribute="String" context="String" char="'"/>
+ </context>
+
+ <context attribute="Comment" lineEndContext="#pop" name="Commentar 1"/>
+
+ <context attribute="String" lineEndContext="#pop" name="String">
+ <LineContinue attribute="String" context="#stay"/>
+ <HlCStringChar attribute="String Char" context="#stay"/>
+ <DetectChar attribute="String" context="#pop" char="&quot;"/>
+ </context>
+
+ <context attribute="String" lineEndContext="#pop" name="String">
+ <LineContinue attribute="String" context="#stay"/>
+ <HlCStringChar attribute="String Char" context="#stay"/>
+ <DetectChar attribute="String" context="#pop" char="'"/>
+ </context>
+
+ </contexts>
+
+ <itemDatas>
+ <itemData name="Normal Text" defStyleNum="dsNormal"/>
+ <itemData name="Keyword" defStyleNum="dsKeyword"/>
+ <itemData name="String" defStyleNum="dsString"/>
+ <itemData name="Comment" defStyleNum="dsComment"/>
+ <itemData name="Number" defStyleNum="dsDecVal"/>
+ </itemDatas>
+
+ </highlighting>
+
+ <general>
+ <comments>
+ <comment name="singleLine" start="*" />
+ </comments>
+ <keywords casesensitive="1" weakDeliminator="."/>
+ </general>
+</language>
diff --git a/kate/data/sql-mysql.xml b/kate/data/sql-mysql.xml
new file mode 100644
index 000000000..4c0a99706
--- /dev/null
+++ b/kate/data/sql-mysql.xml
@@ -0,0 +1,476 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+<!--
+ MySQL syntax definition based on sql.xml by Yury Lebedev
+ original by Shane Wright (me@shanewright.co.uk)
+ modifications by Milian Wolff (mail@milianw.de)
+-->
+<language name="SQL (MySQL)" version="1.09" kateversion="2.5" section="Database" extensions="*.sql;*.SQL" mimetype="text/x-sql" casesensitive="0" author="Shane Wright (me@shanewright.co.uk)" license="">
+ <highlighting>
+ <list name="keywords">
+ <item> ACCESS </item>
+ <item> ADD </item>
+ <item> ALL </item>
+ <item> ALTER </item>
+ <item> ANALYZE </item>
+ <item> AND </item>
+ <item> AS </item>
+ <item> ASC </item>
+ <item> AUTO_INCREMENT </item>
+ <item> BDB </item>
+ <item> BERKELEYDB </item>
+ <item> BETWEEN </item>
+ <item> BOTH </item>
+ <item> BY </item>
+ <item> CASCADE </item>
+ <item> CASE </item>
+ <item> CHANGE </item>
+ <!-- <item> CHARACTER SET </item>
+ needs special regexp (see below) -->
+ <item> CHARSET </item>
+ <item> COLUMN </item>
+ <item> COLUMNS </item>
+ <item> CONSTRAINT </item>
+ <item> CREATE </item>
+ <item> CROSS </item>
+ <item> CURRENT_DATE </item>
+ <item> CURRENT_TIME </item>
+ <item> CURRENT_TIMESTAMP </item>
+ <item> DATABASE </item>
+ <item> DATABASES </item>
+ <item> DAY_HOUR </item>
+ <item> DAY_MINUTE </item>
+ <item> DAY_SECOND </item>
+ <item> DEC </item>
+ <item> DEFAULT </item>
+ <item> DELAYED </item>
+ <item> DELETE </item>
+ <item> DESC </item>
+ <item> DESCRIBE </item>
+ <item> DISTINCT </item>
+ <item> DISTINCTROW </item>
+ <item> DROP </item>
+ <item> ELSE </item>
+ <item> ENCLOSED </item>
+ <item> ESCAPED </item>
+ <item> EXISTS </item>
+ <item> EXPLAIN </item>
+ <item> FIELDS </item>
+ <item> FOR </item>
+ <item> FOREIGN </item>
+ <item> FROM </item>
+ <item> FULLTEXT </item>
+ <item> FUNCTION </item>
+ <item> GRANT </item>
+ <item> GROUP </item>
+ <item> HAVING </item>
+ <item> HIGH_PRIORITY </item>
+ <item> IF </item>
+ <item> IGNORE </item>
+ <item> IN </item>
+ <item> INDEX </item>
+ <item> INFILE </item>
+ <item> INNER </item>
+ <item> INNODB </item>
+ <item> INSERT </item>
+ <item> INTERVAL </item>
+ <item> INTO </item>
+ <item> IS </item>
+ <item> JOIN </item>
+ <item> KEY </item>
+ <item> KEYS </item>
+ <item> KILL </item>
+ <item> LEADING </item>
+ <item> LEFT </item>
+ <item> LIKE </item>
+ <item> LIMIT </item>
+ <item> LINES </item>
+ <item> LOAD </item>
+ <item> LOCK </item>
+ <item> LOW_PRIORITY </item>
+ <item> MASTER_SERVER_ID </item>
+ <item> MATCH </item>
+ <item> MRG_MYISAM </item>
+ <item> NATURAL </item>
+ <item> NATIONAL </item>
+ <item> NOT </item>
+ <item> NULL </item>
+ <item> NUMERIC </item>
+ <item> ON </item>
+ <item> OPTIMIZE </item>
+ <item> OPTION </item>
+ <item> OPTIONALLY </item>
+ <item> OR </item>
+ <item> ORDER </item>
+ <item> OUTER </item>
+ <item> OUTFILE </item>
+ <item> PARTIAL </item>
+ <item> PRECISION </item>
+ <item> PRIMARY </item>
+ <item> PRIVILEGES </item>
+ <item> PROCEDURE </item>
+ <item> PURGE </item>
+ <item> READ </item>
+ <item> REFERENCES </item>
+ <item> REGEXP </item>
+ <item> RENAME </item>
+ <item> REPLACE </item>
+ <item> REQUIRE </item>
+ <item> RESTRICT </item>
+ <item> RETURNS </item>
+ <item> REVOKE </item>
+ <item> RIGHT </item>
+ <item> RLIKE </item>
+ <item> SELECT </item>
+ <item> SET </item>
+ <item> SHOW </item>
+ <item> SONAME </item>
+ <item> SQL_BIG_RESULT </item>
+ <item> SQL_CALC_FOUND_ROWS </item>
+ <item> SQL_SMALL_RESULT </item>
+ <item> SSL </item>
+ <item> STARTING </item>
+ <item> STRAIGHT_JOIN </item>
+ <item> STRIPED </item>
+ <item> TABLE </item>
+ <item> TABLES </item>
+ <item> TERMINATED </item>
+ <item> THEN </item>
+ <item> TO </item>
+ <item> TRAILING </item>
+ <item> TRUNCATE </item>
+ <item> TYPE </item>
+ <item> UNION </item>
+ <item> UNIQUE </item>
+ <item> UNLOCK </item>
+ <item> UNSIGNED </item>
+ <item> UPDATE </item>
+ <item> USAGE </item>
+ <item> USE </item>
+ <item> USER_RESOURCES </item>
+ <item> USING </item>
+ <item> VALUES </item>
+ <item> VARYING </item>
+ <item> WHEN </item>
+ <item> WHERE </item>
+ <item> WITH </item>
+ <item> WRITE </item>
+ <item> XOR </item>
+ <item> YEAR_MONTH </item>
+ <item> ZEROFILL </item>
+ </list>
+ <list name="operators">
+ <item> + </item>
+ <item> - </item>
+ <item> * </item>
+ <item> / </item>
+ <item> || </item>
+ <item> = </item>
+ <item> != </item>
+ <item> &lt;&gt; </item>
+ <item> &lt; </item>
+ <item> &lt;= </item>
+ <item> &gt; </item>
+ <item> &gt;= </item>
+ <item> ~= </item>
+ <item> ^= </item>
+ <item> := </item>
+ <item> =&gt; </item>
+ <item> ** </item>
+ <item> .. </item>
+ </list>
+ <list name="functions">
+ <!-- string functions -->
+ <item> ASCII </item>
+ <item> ORD </item>
+ <item> CONV </item>
+ <item> BIN </item>
+ <item> OCT </item>
+ <item> HEX </item>
+ <item> CHAR </item>
+ <item> CONCAT </item>
+ <item> CONCAT_WS </item>
+ <item> LENGTH </item>
+ <item> OCTET_LENGTH </item>
+ <item> CHAR_LENGTH </item>
+ <item> CHARACTER_LENGTH </item>
+ <item> BIT_LENGTH </item>
+ <item> LOCATE </item>
+ <item> POSITION </item>
+ <item> INSTR </item>
+ <item> LPAD </item>
+ <item> RPAD </item>
+ <item> LEFT </item>
+ <item> RIGHT </item>
+ <item> SUBSTRING </item>
+ <item> SUBSTRING_INDEX </item>
+ <item> MID </item>
+ <item> LTRIM </item>
+ <item> RTRIM </item>
+ <item> TRIM </item>
+ <item> SOUNDEX </item>
+ <item> SPACE </item>
+ <item> REPLACE </item>
+ <item> REPEAT </item>
+ <item> REVERSE </item>
+ <item> INSERT </item>
+ <item> ELT </item>
+ <item> FIELD </item>
+ <item> FIND_IN_SET </item>
+ <item> MAKE_SET </item>
+ <item> EXPORT_SET </item>
+ <item> LCASE </item>
+ <item> LOWER </item>
+ <item> UCASE </item>
+ <item> UPPER </item>
+ <item> LOAD_FILE </item>
+ <item> QUOTE </item>
+ <!-- math functions -->
+ <item> ABS </item>
+ <item> SIGN </item>
+ <item> MOD </item>
+ <item> FLOOR </item>
+ <item> CEILING </item>
+ <item> ROUND </item>
+ <item> EXP </item>
+ <item> LN </item>
+ <item> LOG </item>
+ <item> LOG2 </item>
+ <item> LOG10 </item>
+ <item> POW </item>
+ <item> POWER </item>
+ <item> SQRT </item>
+ <item> PI </item>
+ <item> COS </item>
+ <item> SIN </item>
+ <item> TAN </item>
+ <item> ACOS </item>
+ <item> ASIN </item>
+ <item> ATAN </item>
+ <item> ATAN2 </item>
+ <item> COT </item>
+ <item> RAND </item>
+ <item> LEAST </item>
+ <item> GREATEST </item>
+ <item> DEGREES </item>
+ <item> RADIANS </item>
+ <!-- date/time functions -->
+ <item> DAYOFWEEK </item>
+ <item> WEEKDAY </item>
+ <item> DAYOFMONTH </item>
+ <item> DAYOFYEAR </item>
+ <item> MONTH </item>
+ <item> DAYNAME </item>
+ <item> MONTHNAME </item>
+ <item> QUARTER </item>
+ <item> WEEK </item>
+ <item> YEAR </item>
+ <item> YEARWEEK </item>
+ <item> HOUR </item>
+ <item> MINUTE </item>
+ <item> SECOND </item>
+ <item> PERIOD_ADD </item>
+ <item> PERIOD_DIFF </item>
+ <item> DATE_ADD </item>
+ <item> DATE_SUB </item>
+ <item> ADDDATE </item>
+ <item> SUBDATE </item>
+ <item> EXTRACT </item>
+ <item> TO_DAYS </item>
+ <item> FROM_DAYS </item>
+ <item> DATE_FORMAT </item>
+ <item> TIME_FORMAT </item>
+ <item> CURDATE </item>
+ <item> CURRENT_DATE </item>
+ <item> CURTIME </item>
+ <item> CURRENT_TIME </item>
+ <item> NOW </item>
+ <item> SYSDATE </item>
+ <item> CURRENT_TIMESTAMP </item>
+ <item> UNIX_TIMESTAMP </item>
+ <item> FROM_UNIXTIME </item>
+ <item> SEC_TO_TIME </item>
+ <item> TIME_TO_SEC </item>
+ <!-- cast functions -->
+ <item> CAST </item>
+ <item> CONVERT </item>
+ <!-- misc -->
+ <item> BIT_COUNT </item>
+ <item> DATABASE </item>
+ <item> USER </item>
+ <item> SYSTEM_USER </item>
+ <item> SESSION_USER </item>
+ <item> PASSWORD </item>
+ <item> ENCRYPT </item>
+ <item> ENCODE </item>
+ <item> DECODE </item>
+ <item> MD5 </item>
+ <item> SHA1 </item>
+ <item> SHA </item>
+ <item> AES_ENCRYPT </item>
+ <item> AES_DECRYPT </item>
+ <item> DES_ENCRYPT </item>
+ <item> DES_DECRYPT </item>
+ <item> LAST_INSERT_ID </item>
+ <item> FORMAT </item>
+ <item> VERSION </item>
+ <item> CONNECTION_ID </item>
+ <item> GET_LOCK </item>
+ <item> RELEASE_LOCK </item>
+ <item> IS_FREE_LOCK </item>
+ <item> BENCHMARK </item>
+ <item> INET_NTOA </item>
+ <item> INET_ATON </item>
+ <item> MASTER_POS_WAIT </item>
+ <item> FOUND_ROWS </item>
+ <!-- GROUP BY -->
+ <item> COUNT </item>
+ <item> AVG </item>
+ <item> MIN </item>
+ <item> MAX </item>
+ <item> SUM </item>
+ <item> STD </item>
+ <item> STDDEV </item>
+ <item> BIT_OR </item>
+ <item> BIT_AND </item>
+ </list>
+ <list name="types">
+ <!-- strings -->
+ <item> CHAR </item>
+ <item> CHARACTER </item>
+ <item> VARCHAR </item>
+ <item> BINARY </item>
+ <item> VARBINARY </item>
+ <item> TINYBLOB </item>
+ <item> MEDIUMBLOB </item>
+ <item> BLOB </item>
+ <item> LONGBLOB </item>
+ <item> TINYTEXT </item>
+ <item> MEDIUMTEXT </item>
+ <item> TEXT </item>
+ <item> LONGTEXT </item>
+ <item> ENUM </item>
+ <!-- <item> SET </item>
+ needs special regexp (see below) -->
+ <!-- numeric -->
+ <item> BIT </item>
+ <item> BOOL </item>
+ <item> BOOLEAN </item>
+ <item> TINYINT </item>
+ <item> SMALLINT </item>
+ <item> MEDIUMINT </item>
+ <item> MIDDLEINT </item>
+ <item> INT </item>
+ <item> INTEGER </item>
+ <item> BIGINT </item>
+ <item> FLOAT </item>
+ <item> DOUBLE </item>
+ <item> REAL </item>
+ <item> DECIMAL </item>
+ <item> DEC </item>
+ <item> FIXED </item>
+ <item> NUMERIC </item>
+ <item> LONG </item>
+ <item> SERIAL </item>
+ <!-- date and time -->
+ <item> DATE </item>
+ <item> DATETIME </item>
+ <item> TIME </item>
+ <item> TIMESTAMP </item>
+ <item> YEAR </item>
+ </list>
+ <contexts>
+ <context name="Normal" attribute="Normal Text" lineEndContext="#stay">
+ <!-- problematic special cases -->
+ <!-- SET type -->
+ <RegExpr attribute="Data Type" context="#stay" insensitive="true" String="SET(?=\s*\()"/>
+ <!-- keyword character set -->
+ <RegExpr attribute="Keyword" context="#stay" insensitive="true" String="\bCHARACTER SET\b"/>
+ <!-- using the lists -->
+ <keyword attribute="Keyword" context="#stay" String="keywords"/>
+ <keyword attribute="Operator" context="#stay" String="operators"/>
+ <keyword attribute="Function" context="#stay" String="functions"/>
+ <keyword attribute="Data Type" context="#stay" String="types"/>
+ <!-- extra data types -->
+ <RegExpr attribute="Data Type" context="#stay" String="%bulk_exceptions\b" insensitive="true"/>
+ <RegExpr attribute="Data Type" context="#stay" String="%bulk_rowcount\b" insensitive="true"/>
+ <RegExpr attribute="Data Type" context="#stay" String="%found\b" insensitive="true"/>
+ <RegExpr attribute="Data Type" context="#stay" String="%isopen\b" insensitive="true"/>
+ <RegExpr attribute="Data Type" context="#stay" String="%notfound\b" insensitive="true"/>
+ <RegExpr attribute="Data Type" context="#stay" String="%rowcount\b" insensitive="true"/>
+ <RegExpr attribute="Data Type" context="#stay" String="%rowtype\b" insensitive="true"/>
+ <RegExpr attribute="Data Type" context="#stay" String="%type\b" insensitive="true"/>
+ <!-- numbers -->
+ <Float attribute="Float" context="#stay"/>
+ <Int attribute="Decimal" context="#stay"/>
+ <!-- strings -->
+ <DetectChar attribute="String" context="String" char="'"/>
+ <DetectChar attribute="String" context="String2" char="&quot;"/>
+ <DetectChar attribute="Name" context="Name" char="`"/>
+ <!-- comments -->
+ <DetectChar attribute="Comment" context="SingleLineComment" char="#"/>
+ <Detect2Chars attribute="Comment" context="SingleLineComment" char="-" char1="-"/>
+ <Detect2Chars attribute="Comment" context="MultiLineComment" char="/" char1="*" beginRegion="Comment"/>
+ <RegExpr attribute="Comment" context="SingleLineComment" String="rem\b" insensitive="true" column="0"/>
+
+ <AnyChar attribute="Symbol" context="#stay" String=":&#38;"/>
+ <RegExpr attribute="Symbol" context="#stay" String="/$" column="0"/>
+ <RegExpr attribute="Preprocessor" context="Preprocessor" String="@@?[^@ \t\r\n]" column="0"/>
+ <!-- for something like : SELECT DB.TABLE.ROW ... -->
+ <DetectChar attribute="String Char" context="#stay" char="."/>
+ </context>
+ <!-- 'string' -->
+ <context name="String" attribute="String" lineEndContext="#stay">
+ <LineContinue attribute="String" context="#pop"/>
+ <HlCStringChar attribute="String Char" context="#stay"/>
+ <DetectChar attribute="Symbol" context="#stay" char="&#38;"/>
+ <DetectChar attribute="String" context="#pop" char="'"/>
+ </context>
+ <!-- "string", extra context needed to enable "str'ing" and 'str"ing' -->
+ <context name="String2" attribute="String" lineEndContext="#stay">
+ <LineContinue attribute="String" context="#pop"/>
+ <HlCStringChar attribute="String Char" context="#stay"/>
+ <DetectChar attribute="Symbol" context="#stay" char="&#38;"/>
+ <DetectChar attribute="String" context="#pop" char="&quot;"/>
+ </context>
+ <!-- `names` -->
+ <context name="Name" attribute="Name" lineEndContext="#stay">
+ <LineContinue attribute="Name" context="#pop"/>
+ <HlCStringChar attribute="String Char" context="#stay"/>
+ <DetectChar attribute="Name" context="#pop" char="`"/>
+ </context>
+ <!-- comments -->
+ <context name="SingleLineComment" attribute="Comment" lineEndContext="#pop"/>
+ <context name="MultiLineComment" attribute="Comment" lineEndContext="#stay">
+ <LineContinue attribute="Comment" context="#pop"/>
+ <Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" endRegion="Comment"/>
+ </context>
+ <!-- preprocessor -->
+ <context name="Preprocessor" attribute="Preprocessor" lineEndContext="#pop"/>
+ </contexts>
+ <itemDatas>
+ <itemData name="Normal Text" defStyleNum="dsNormal"/>
+ <itemData name="Keyword" defStyleNum="dsKeyword"/>
+ <itemData name="Operator" defStyleNum="dsNormal"/>
+ <itemData name="Function" defStyleNum="dsFunction"/>
+ <itemData name="Data Type" defStyleNum="dsDataType"/>
+ <itemData name="Decimal" defStyleNum="dsDecVal"/>
+ <itemData name="Float" defStyleNum="dsFloat"/>
+ <itemData name="String" defStyleNum="dsString"/>
+ <itemData name="Name" color="#080" defStyleNum="dsString"/>
+ <itemData name="String Char" defStyleNum="dsChar"/>
+ <itemData name="Comment" defStyleNum="dsComment"/>
+ <itemData name="Symbol" defStyleNum="dsChar"/>
+ <itemData name="Preprocessor" defStyleNum="dsOthers"/>
+ </itemDatas>
+ </highlighting>
+ <general>
+ <comments>
+ <comment name="singleLine" start="--"/>
+ <comment name="multiLine" start="/*" end="*/"/>
+ </comments>
+ <keywords casesensitive="0" weakDeliminator="+-*/|=!&lt;&gt;~^:."/>
+ <folding indentationsensitive="true"/>
+ </general>
+</language>
+
diff --git a/kate/data/sql-postgresql.xml b/kate/data/sql-postgresql.xml
new file mode 100644
index 000000000..d4b347533
--- /dev/null
+++ b/kate/data/sql-postgresql.xml
@@ -0,0 +1,797 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+<!-- PostgreSQL SQL, syntax definition based on sql.xml by Yury Lebedev -->
+<language name="SQL (PostgreSQL)" version="1.08" kateversion="2.4" section="Database" extensions="*.sql;*.SQL" mimetype="text/x-sql" casesensitive="0" author="Shane Wright (me@shanewright.co.uk)" license="">
+ <highlighting>
+ <list name="keywords">
+ <item> ABORT </item>
+ <item> ACCESS </item>
+ <item> ACTION </item>
+ <item> ADD </item>
+ <item> ADMIN </item>
+ <item> AFTER </item>
+ <item> AGGREGATE </item>
+ <item> ALIAS </item>
+ <item> ALL </item>
+ <item> ALLOCATE </item>
+ <item> ALTER </item>
+ <item> ANALYSE </item>
+ <item> ANALYZE </item>
+ <item> ANY </item>
+ <item> ARE </item>
+ <item> AS </item>
+ <item> ASC </item>
+ <item> ASENSITIVE </item>
+ <item> ASSERTION </item>
+ <item> ASSIGNMENT </item>
+ <item> ASYMMETRIC </item>
+ <item> AT </item>
+ <item> ATOMIC </item>
+ <item> AUTHORIZATION </item>
+ <item> BACKWARD </item>
+ <item> BEFORE </item>
+ <item> BEGIN </item>
+ <item> BETWEEN </item>
+ <item> BINARY </item>
+ <item> BOTH </item>
+ <item> BREADTH </item>
+ <item> BY </item>
+ <item> C </item>
+ <item> CACHE </item>
+ <item> CALL </item>
+ <item> CALLED </item>
+ <item> CARDINALITY </item>
+ <item> CASCADE </item>
+ <item> CASCADED </item>
+ <item> CASE </item>
+ <item> CAST </item>
+ <item> CATALOG </item>
+ <item> CATALOG_NAME </item>
+ <item> CHAIN </item>
+ <item> CHAR_LENGTH </item>
+ <item> CHARACTER_LENGTH </item>
+ <item> CHARACTER_SET_CATALOG </item>
+ <item> CHARACTER_SET_NAME </item>
+ <item> CHARACTER_SET_SCHEMA </item>
+ <item> CHARACTERISTICS </item>
+ <item> CHECK </item>
+ <item> CHECKED </item>
+ <item> CHECKPOINT </item>
+ <item> CLASS </item>
+ <item> CLASS_ORIGIN </item>
+ <item> CLOB </item>
+ <item> CLOSE </item>
+ <item> CLUSTER </item>
+ <item> COALESCE </item>
+ <item> COBOL </item>
+ <item> COLLATE </item>
+ <item> COLLATION </item>
+ <item> COLLATION_CATALOG </item>
+ <item> COLLATION_NAME </item>
+ <item> COLLATION_SCHEMA </item>
+ <item> COLUMN </item>
+ <item> COLUMN_NAME </item>
+ <item> COMMAND_FUNCTION </item>
+ <item> COMMAND_FUNCTION_CODE </item>
+ <item> COMMENT </item>
+ <item> COMMIT </item>
+ <item> COMMITTED </item>
+ <item> COMPLETION </item>
+ <item> CONDITION_NUMBER </item>
+ <item> CONNECT </item>
+ <item> CONNECTION </item>
+ <item> CONNECTION_NAME </item>
+ <item> CONSTRAINT </item>
+ <item> CONSTRAINT_CATALOG </item>
+ <item> CONSTRAINT_NAME </item>
+ <item> CONSTRAINT_SCHEMA </item>
+ <item> CONSTRAINTS </item>
+ <item> CONSTRUCTOR </item>
+ <item> CONTAINS </item>
+ <item> CONTINUE </item>
+ <item> CONVERT </item>
+ <item> COPY </item>
+ <item> CORRESPONDING </item>
+ <item> COUNT </item>
+ <item> CREATE </item>
+ <item> CREATEDB </item>
+ <item> CREATEUSER </item>
+ <item> CROSS </item>
+ <item> CUBE </item>
+ <item> CURRENT </item>
+ <item> CURRENT_DATE </item>
+ <item> CURRENT_PATH </item>
+ <item> CURRENT_ROLE </item>
+ <item> CURRENT_TIME </item>
+ <item> CURRENT_TIMESTAMP </item>
+ <item> CURRENT_USER </item>
+ <item> CURSOR </item>
+ <item> CURSOR_NAME </item>
+ <item> CYCLE </item>
+ <item> DATA </item>
+ <item> DATABASE </item>
+ <item> DATE </item>
+ <item> DATETIME_INTERVAL_CODE </item>
+ <item> DATETIME_INTERVAL_PRECISION </item>
+ <item> DAY </item>
+ <item> DEALLOCATE </item>
+ <item> DEC </item>
+ <item> DECIMAL </item>
+ <item> DECLARE </item>
+ <item> DEFAULT </item>
+ <item> DEFERRABLE </item>
+ <item> DEFERRED </item>
+ <item> DEFINED </item>
+ <item> DEFINER </item>
+ <item> DELETE </item>
+ <item> DELIMITERS </item>
+ <item> DEPTH </item>
+ <item> DEREF </item>
+ <item> DESC </item>
+ <item> DESCRIBE </item>
+ <item> DESCRIPTOR </item>
+ <item> DESTROY </item>
+ <item> DESTRUCTOR </item>
+ <item> DETERMINISTIC </item>
+ <item> DIAGNOSTICS </item>
+ <item> DICTIONARY </item>
+ <item> DISCONNECT </item>
+ <item> DISPATCH </item>
+ <item> DISTINCT </item>
+ <item> DO </item>
+ <item> DOMAIN </item>
+ <item> DOUBLE </item>
+ <item> DROP </item>
+ <item> DYNAMIC </item>
+ <item> DYNAMIC_FUNCTION </item>
+ <item> DYNAMIC_FUNCTION_CODE </item>
+ <item> EACH </item>
+ <item> ELSE </item>
+ <item> ENCODING </item>
+ <item> ENCRYPTED </item>
+ <item> END </item>
+ <item> END-EXEC </item>
+ <item> EQUALS </item>
+ <item> ESCAPE </item>
+ <item> EVERY </item>
+ <item> EXCEPT </item>
+ <item> EXCEPTION </item>
+ <item> EXCLUSIVE </item>
+ <item> EXEC </item>
+ <item> EXECUTE </item>
+ <item> EXISTING </item>
+ <item> EXISTS </item>
+ <item> EXPLAIN </item>
+ <item> EXTERNAL </item>
+ <item> FETCH </item>
+ <item> FINAL </item>
+ <item> FIRST </item>
+ <item> FOR </item>
+ <item> FORCE </item>
+ <item> FOREIGN </item>
+ <item> FORTRAN </item>
+ <item> FORWARD </item>
+ <item> FOUND </item>
+ <item> FREE </item>
+ <item> FREEZE </item>
+ <item> FROM </item>
+ <item> FULL </item>
+ <item> FUNCTION </item>
+ <item> G </item>
+ <item> GENERAL </item>
+ <item> GENERATED </item>
+ <item> GET </item>
+ <item> GLOBAL </item>
+ <item> GO </item>
+ <item> GOTO </item>
+ <item> GRANT </item>
+ <item> GRANTED </item>
+ <item> GROUP </item>
+ <item> GROUPING </item>
+ <item> HANDLER </item>
+ <item> HAVING </item>
+ <item> HIERARCHY </item>
+ <item> HOLD </item>
+ <item> HOST </item>
+ <item> HOUR </item>
+ <item> IDENTITY </item>
+ <item> IGNORE </item>
+ <item> ILIKE </item>
+ <item> IMMEDIATE </item>
+ <item> IMMUTABLE </item>
+ <item> IMPLEMENTATION </item>
+ <item> IN </item>
+ <item> INCREMENT </item>
+ <item> INDEX </item>
+ <item> INDICATOR </item>
+ <item> INFIX </item>
+ <item> INHERITS </item>
+ <item> INITIALIZE </item>
+ <item> INITIALLY </item>
+ <item> INNER </item>
+ <item> INOUT </item>
+ <item> INPUT </item>
+ <item> INSENSITIVE </item>
+ <item> INSERT </item>
+ <item> INSTANCE </item>
+ <item> INSTANTIABLE </item>
+ <item> INSTEAD </item>
+ <item> INTERSECT </item>
+ <item> INTERVAL </item>
+ <item> INTO </item>
+ <item> INVOKER </item>
+ <item> IS </item>
+ <item> ISNULL </item>
+ <item> ISOLATION </item>
+ <item> ITERATE </item>
+ <item> JOIN </item>
+ <item> K </item>
+ <item> KEY </item>
+ <item> KEY_MEMBER </item>
+ <item> KEY_TYPE </item>
+ <item> LANCOMPILER </item>
+ <item> LANGUAGE </item>
+ <item> LARGE </item>
+ <item> LAST </item>
+ <item> LATERAL </item>
+ <item> LEADING </item>
+ <item> LEFT </item>
+ <item> LENGTH </item>
+ <item> LESS </item>
+ <item> LEVEL </item>
+ <item> LIKE </item>
+ <item> LIMIT </item>
+ <item> LISTEN </item>
+ <item> LOAD </item>
+ <item> LOCAL </item>
+ <item> LOCALTIME </item>
+ <item> LOCALTIMESTAMP </item>
+ <item> LOCATION </item>
+ <item> LOCATOR </item>
+ <item> LOCK </item>
+ <item> LOWER </item>
+ <item> M </item>
+ <item> MAP </item>
+ <item> MATCH </item>
+ <item> MAX </item>
+ <item> MAXVALUE </item>
+ <item> MESSAGE_LENGTH </item>
+ <item> MESSAGE_OCTET_LENGTH </item>
+ <item> MESSAGE_TEXT </item>
+ <item> METHOD </item>
+ <item> MIN </item>
+ <item> MINUTE </item>
+ <item> MINVALUE </item>
+ <item> MOD </item>
+ <item> MODE </item>
+ <item> MODIFIES </item>
+ <item> MODIFY </item>
+ <item> MODULE </item>
+ <item> MONTH </item>
+ <item> MORE </item>
+ <item> MOVE </item>
+ <item> MUMPS </item>
+ <item> NAME </item>
+ <item> NAMES </item>
+ <item> NATIONAL </item>
+ <item> NATURAL </item>
+ <item> NEW </item>
+ <item> NEXT </item>
+ <item> NO </item>
+ <item> NOCREATEDB </item>
+ <item> NOCREATEUSER </item>
+ <item> NONE </item>
+ <item> NOT </item>
+ <item> NOTHING </item>
+ <item> NOTIFY </item>
+ <item> NOTNULL </item>
+ <item> NULL </item>
+ <item> NULLABLE </item>
+ <item> NULLIF </item>
+ <item> NUMBER </item>
+ <item> NUMERIC </item>
+ <item> OBJECT </item>
+ <item> OCTET_LENGTH </item>
+ <item> OF </item>
+ <item> OFF </item>
+ <item> OFFSET </item>
+ <item> OIDS </item>
+ <item> OLD </item>
+ <item> ON </item>
+ <item> ONLY </item>
+ <item> OPEN </item>
+ <item> OPERATION </item>
+ <item> OPERATOR </item>
+ <item> OPTION </item>
+ <item> OPTIONS </item>
+ <item> ORDER </item>
+ <item> ORDINALITY </item>
+ <item> OUT </item>
+ <item> OUTER </item>
+ <item> OUTPUT </item>
+ <item> OVERLAPS </item>
+ <item> OVERLAY </item>
+ <item> OVERRIDING </item>
+ <item> OWNER </item>
+ <item> PAD </item>
+ <item> PARAMETER </item>
+ <item> PARAMETER_MODE </item>
+ <item> PARAMETER_NAME </item>
+ <item> PARAMETER_ORDINAL_POSITION </item>
+ <item> PARAMETER_SPECIFIC_CATALOG </item>
+ <item> PARAMETER_SPECIFIC_NAME </item>
+ <item> PARAMETER_SPECIFIC_SCHEMA </item>
+ <item> PARAMETERS </item>
+ <item> PARTIAL </item>
+ <item> PASCAL </item>
+ <item> PASSWORD </item>
+ <item> PATH </item>
+ <item> PENDANT </item>
+ <item> PLI </item>
+ <item> POSITION </item>
+ <item> POSTFIX </item>
+ <item> PRECISION </item>
+ <item> PREFIX </item>
+ <item> PREORDER </item>
+ <item> PREPARE </item>
+ <item> PRESERVE </item>
+ <item> PRIMARY </item>
+ <item> PRIOR </item>
+ <item> PRIVILEGES </item>
+ <item> PROCEDURAL </item>
+ <item> PROCEDURE </item>
+ <item> PUBLIC </item>
+ <item> READ </item>
+ <item> READS </item>
+ <item> REAL </item>
+ <item> RECURSIVE </item>
+ <item> REF </item>
+ <item> REFERENCES </item>
+ <item> REFERENCING </item>
+ <item> REINDEX </item>
+ <item> RELATIVE </item>
+ <item> RENAME </item>
+ <item> REPEATABLE </item>
+ <item> REPLACE </item>
+ <item> RESET </item>
+ <item> RESTRICT </item>
+ <item> RESULT </item>
+ <item> RETURN </item>
+ <item> RETURNED_LENGTH </item>
+ <item> RETURNED_OCTET_LENGTH </item>
+ <item> RETURNED_SQLSTATE </item>
+ <item> RETURNS </item>
+ <item> REVOKE </item>
+ <item> RIGHT </item>
+ <item> ROLE </item>
+ <item> ROLLBACK </item>
+ <item> ROLLUP </item>
+ <item> ROUTINE </item>
+ <item> ROUTINE_CATALOG </item>
+ <item> ROUTINE_NAME </item>
+ <item> ROUTINE_SCHEMA </item>
+ <item> ROW </item>
+ <item> ROW_COUNT </item>
+ <item> ROWS </item>
+ <item> RULE </item>
+ <item> SAVEPOINT </item>
+ <item> SCALE </item>
+ <item> SCHEMA </item>
+ <item> SCHEMA_NAME </item>
+ <item> SCOPE </item>
+ <item> SCROLL </item>
+ <item> SEARCH </item>
+ <item> SECOND </item>
+ <item> SECTION </item>
+ <item> SECURITY </item>
+ <item> SELECT </item>
+ <item> SELF </item>
+ <item> SENSITIVE </item>
+ <item> SEQUENCE </item>
+ <item> SERIALIZABLE </item>
+ <item> SERVER_NAME </item>
+ <item> SESSION </item>
+ <item> SESSION_USER </item>
+ <item> SET </item>
+ <item> SETOF </item>
+ <item> SETS </item>
+ <item> SHARE </item>
+ <item> SHOW </item>
+ <item> SIMILAR </item>
+ <item> SIMPLE </item>
+ <item> SIZE </item>
+ <item> SOME </item>
+ <item> SOURCE </item>
+ <item> SPACE </item>
+ <item> SPECIFIC </item>
+ <item> SPECIFIC_NAME </item>
+ <item> SPECIFICTYPE </item>
+ <item> SQL </item>
+ <item> SQLCODE </item>
+ <item> SQLERROR </item>
+ <item> SQLEXCEPTION </item>
+ <item> SQLSTATE </item>
+ <item> SQLWARNING </item>
+ <item> STABLE </item>
+ <item> START </item>
+ <item> STATE </item>
+ <item> STATEMENT </item>
+ <item> STATIC </item>
+ <item> STATISTICS </item>
+ <item> STDIN </item>
+ <item> STDOUT </item>
+ <item> STRUCTURE </item>
+ <item> STYLE </item>
+ <item> SUBCLASS_ORIGIN </item>
+ <item> SUBLIST </item>
+ <item> SUBSTRING </item>
+ <item> SUM </item>
+ <item> SYMMETRIC </item>
+ <item> SYSID </item>
+ <item> SYSTEM </item>
+ <item> SYSTEM_USER </item>
+ <item> TABLE </item>
+ <item> TABLE_NAME </item>
+ <item> TEMP </item>
+ <item> TEMPLATE </item>
+ <item> TEMPORARY </item>
+ <item> TERMINATE </item>
+ <item> THAN </item>
+ <item> THEN </item>
+ <item> TIMEZONE_HOUR </item>
+ <item> TIMEZONE_MINUTE </item>
+ <item> TO </item>
+ <item> TOAST </item>
+ <item> TRAILING </item>
+ <item> TRANSACTION </item>
+ <item> TRANSACTION_ACTIVE </item>
+ <item> TRANSACTIONS_COMMITTED </item>
+ <item> TRANSACTIONS_ROLLED_BACK </item>
+ <item> TRANSFORM </item>
+ <item> TRANSFORMS </item>
+ <item> TRANSLATE </item>
+ <item> TRANSLATION </item>
+ <item> TREAT </item>
+ <item> TRIGGER </item>
+ <item> TRIGGER_CATALOG </item>
+ <item> TRIGGER_NAME </item>
+ <item> TRIGGER_SCHEMA </item>
+ <item> TRIM </item>
+ <item> TRUNCATE </item>
+ <item> TRUSTED </item>
+ <item> TYPE </item>
+ <item> UNCOMMITTED </item>
+ <item> UNDER </item>
+ <item> UNENCRYPTED </item>
+ <item> UNION </item>
+ <item> UNIQUE </item>
+ <item> UNKNOWN </item>
+ <item> UNLISTEN </item>
+ <item> UNNAMED </item>
+ <item> UNNEST </item>
+ <item> UNTIL </item>
+ <item> UPDATE </item>
+ <item> UPPER </item>
+ <item> USAGE </item>
+ <item> USER </item>
+ <item> USER_DEFINED_TYPE_CATALOG </item>
+ <item> USER_DEFINED_TYPE_NAME </item>
+ <item> USER_DEFINED_TYPE_SCHEMA </item>
+ <item> USING </item>
+ <item> VACUUM </item>
+ <item> VALID </item>
+ <item> VALUE </item>
+ <item> VALUES </item>
+ <item> VARIABLE </item>
+ <item> VARYING </item>
+ <item> VERBOSE </item>
+ <item> VERSION </item>
+ <item> VIEW </item>
+ <item> VOLATILE </item>
+ <item> WHEN </item>
+ <item> WHENEVER </item>
+ <item> WHERE </item>
+ <item> WITH </item>
+ <item> WITHOUT </item>
+ <item> WORK </item>
+ <item> WRITE </item>
+ <item> YEAR </item>
+ <item> ZONE </item>
+ <item> FALSE </item>
+ <item> TRUE </item>
+ </list>
+ <list name="operators">
+ <item> + </item>
+ <item> - </item>
+ <item> * </item>
+ <item> / </item>
+ <item> || </item>
+ <item> |/ </item>
+ <item> ||/ </item>
+ <item> ! </item>
+ <item> !! </item>
+ <item> @ </item>
+ <item> &amp; </item>
+ <item> | </item>
+ <item> # </item>
+ <item> &lt;&lt; </item>
+ <item> &gt;&gt; </item>
+ <item> % </item>
+ <item> ^ </item>
+ <item> = </item>
+ <item> != </item>
+ <item> &lt;&gt; </item>
+ <item> &lt; </item>
+ <item> &lt;= </item>
+ <item> &gt; </item>
+ <item> &gt;= </item>
+ <item> ~ </item>
+ <item> ~* </item>
+ <item> !~ </item>
+ <item> !~* </item>
+ <item> ^= </item>
+ <item> := </item>
+ <item> =&gt; </item>
+ <item> ** </item>
+ <item> .. </item>
+ <item> AND </item>
+ <item> OR </item>
+ <item> NOT </item>
+ <!-- geometric -->
+ <item> ## </item>
+ <item> &amp;&amp; </item>
+ <item> &amp;&lt; </item>
+ <item> &amp;&gt; </item>
+ <item> &lt;-&gt; </item>
+ <item> &lt;^ </item>
+ <item> &gt;^ </item>
+ <item> ?# </item>
+ <item> ?- </item>
+ <item> ?-| </item>
+ <item> @-@ </item>
+ <item> ?| </item>
+ <item> ?|| </item>
+ <item> @@ </item>
+ <item> ~= </item>
+ <!-- network address type -->
+ <item> &lt;&lt;= </item>
+ <item> &gt;&gt;= </item>
+ </list>
+ <list name="functions">
+ <!-- math -->
+ <item> ABS </item>
+ <item> CBRT </item>
+ <item> CEIL </item>
+ <item> DEGREES </item>
+ <item> EXP </item>
+ <item> FLOOR </item>
+ <item> LN </item>
+ <item> LOG </item>
+ <item> MOD </item>
+ <item> PI </item>
+ <item> POW </item>
+ <item> RADIANS </item>
+ <item> RANDOM </item>
+ <item> ROUND </item>
+ <item> SIGN </item>
+ <item> SQRT </item>
+ <item> TRUNC </item>
+ <!-- trig -->
+ <item> ACOS </item>
+ <item> ASIN </item>
+ <item> ATAN </item>
+ <item> ATAN2 </item>
+ <item> COS </item>
+ <item> COT </item>
+ <item> SIN </item>
+ <item> TAN </item>
+ <!-- string -->
+ <item> BIT_LENGTH </item>
+ <item> CHAR_LENGTH </item>
+ <item> CHARACTER_LENGTH </item>
+ <item> LOWER </item>
+ <item> OCTET_LENGTH </item>
+ <item> POSITION </item>
+ <item> SUBSTRING </item>
+ <item> TRIM </item>
+ <item> UPPER </item>
+ <!-- other string -->
+ <item> ASCII </item>
+ <item> BTRIM </item>
+ <item> CHR </item>
+ <item> CONVERT </item>
+ <item> INITCAP </item>
+ <item> LENGTH </item>
+ <item> LPAD </item>
+ <item> LTRIM </item>
+ <item> PG_CLIENT_ENCODING </item>
+ <item> REPEAT </item>
+ <item> RPAD </item>
+ <item> RTRIM </item>
+ <item> STRPOS </item>
+ <item> SUBSTR </item>
+ <item> TO_ASCII </item>
+ <item> TRANSLATE </item>
+ <item> ENCODE </item>
+ <item> DECODE </item>
+ <!-- data type formatting -->
+ <item> TO_CHAR </item>
+ <item> TO_DATE </item>
+ <item> TO_TIMESTAMP </item>
+ <item> TO_NUMBER </item>
+ <!-- date/time -->
+ <item> AGE </item>
+ <item> DATE_PART </item>
+ <item> DATE_TRUNC </item>
+ <item> EXTRACT </item>
+ <item> ISFINITE </item>
+ <item> NOW </item>
+ <item> TIMEOFDAY </item>
+ <item> TIMESTAMP </item>
+ <item> EXTRACT </item>
+ <!-- geometric -->
+ <item> AREA </item>
+ <item> BOX </item>
+ <item> CENTER </item>
+ <item> DIAMETER </item>
+ <item> HEIGHT </item>
+ <item> ISCLOSED </item>
+ <item> ISOPEN </item>
+ <item> PCLOSE </item>
+ <item> NPOINT </item>
+ <item> POPEN </item>
+ <item> RADIUS </item>
+ <item> WIDTH </item>
+ <!-- geometric type conversion -->
+ <item> BOX </item>
+ <item> CIRCLE </item>
+ <item> LSEG </item>
+ <item> PATH </item>
+ <item> POINT </item>
+ <item> POLYGON </item>
+ <!-- network address type, TEXT is omitted as its more commonly a data type -->
+ <item> BROADCAST </item>
+ <item> HOST </item>
+ <item> MASKLEN </item>
+ <item> SET_MASKLEN </item>
+ <item> NETMASK </item>
+ <item> NETWORK </item>
+ <item> ABBREV </item>
+ <!-- sequence manipulation -->
+ <item> NEXTVAL </item>
+ <item> CURRVAL </item>
+ <item> SETVAL </item>
+ <!-- conditional expressions -->
+ <item> COALESCE </item>
+ <item> NULLIF </item>
+ <!-- misc -->
+ <item> HAS_TABLE_PRIVILEGE </item>
+ <item> PG_GET_VIEWDEF </item>
+ <item> PG_GET_RULEDEF </item>
+ <item> PG_GET_INDEXDEF </item>
+ <item> PG_GET_USERBYID </item>
+ <item> OBJ_DESCRIPTION </item>
+ <item> COL_DESCRIPTION </item>
+ <!-- aggregate -->
+ <item> AVG </item>
+ <item> COUNT </item>
+ <item> MAX </item>
+ <item> MIN </item>
+ <item> STDDEV </item>
+ <item> SUM </item>
+ <item> VARIANCE </item>
+ </list>
+ <list name="types">
+ <item> LZTEXT </item>
+ <item> BIGINT </item>
+ <item> INT2 </item>
+ <item> INT8 </item>
+ <item> BIGSERIAL </item>
+ <item> SERIAL8 </item>
+ <item> BIT </item>
+ <item> BIT VARYING </item>
+ <item> VARBIT </item>
+ <item> BOOLEAN </item>
+ <item> BOOL </item>
+ <item> BOX </item>
+ <item> BYTEA </item>
+ <item> CHARACTER </item>
+ <item> CHAR </item>
+ <item> CHARACTER VARYING </item>
+ <item> VARCHAR </item>
+ <item> CIDR </item>
+ <item> CIRCLE </item>
+ <item> DATE </item>
+ <item> DOUBLE PRECISION </item>
+ <item> FLOAT8 </item>
+ <item> INET </item>
+ <item> INTEGER </item>
+ <item> INT </item>
+ <item> INT4 </item>
+ <item> INTERVAL </item>
+ <item> LINE </item>
+ <item> LSEG </item>
+ <item> MACADDR </item>
+ <item> MONEY </item>
+ <item> NUMERIC </item>
+ <item> DECIMAL </item>
+ <item> OID </item>
+ <item> PATH </item>
+ <item> POINT </item>
+ <item> POLYGON </item>
+ <item> REAL </item>
+ <item> SMALLINT </item>
+ <item> SERIAL </item>
+ <item> TEXT </item>
+ <item> TIME </item>
+ <item> TIMETZ </item>
+ <item> TIMESTAMP </item>
+ <item> TIMESTAMPTZ </item>
+ <item> TIMESTAMP WITH TIMEZONE </item>
+ </list>
+ <contexts>
+ <context name="Normal" attribute="Normal Text" lineEndContext="#stay">
+ <keyword attribute="Keyword" context="#stay" String="keywords"/>
+ <keyword attribute="Operator" context="#stay" String="operators"/>
+ <keyword attribute="Function" context="#stay" String="functions"/>
+ <keyword attribute="Data Type" context="#stay" String="types"/>
+ <RegExpr attribute="Data Type" context="#stay" String="%bulk_exceptions\b" insensitive="true"/>
+ <RegExpr attribute="Data Type" context="#stay" String="%bulk_rowcount\b" insensitive="true"/>
+ <RegExpr attribute="Data Type" context="#stay" String="%found\b" insensitive="true"/>
+ <RegExpr attribute="Data Type" context="#stay" String="%isopen\b" insensitive="true"/>
+ <RegExpr attribute="Data Type" context="#stay" String="%notfound\b" insensitive="true"/>
+ <RegExpr attribute="Data Type" context="#stay" String="%rowcount\b" insensitive="true"/>
+ <RegExpr attribute="Data Type" context="#stay" String="%rowtype\b" insensitive="true"/>
+ <RegExpr attribute="Data Type" context="#stay" String="%type\b" insensitive="true"/>
+ <Float attribute="Float" context="#stay"/>
+ <Int attribute="Decimal" context="#stay"/>
+ <DetectChar attribute="String" context="String" char="'"/>
+ <DetectChar attribute="Comment" context="SingleLineComment" char="#"/>
+ <Detect2Chars attribute="Comment" context="SingleLineComment" char="-" char1="-"/>
+ <Detect2Chars attribute="Comment" context="MultiLineComment" char="/" char1="*" beginRegion="Comment"/>
+ <RegExpr attribute="Comment" context="SingleLineComment" String="rem\b" insensitive="true" column="0"/>
+ <DetectChar attribute="Comment" context="Identifier" char="&quot;"/>
+ <AnyChar attribute="Symbol" context="#stay" String=":&#38;"/>
+ <RegExpr attribute="Symbol" context="#stay" String="/$" column="0"/>
+ <RegExpr attribute="Preprocessor" context="Preprocessor" String="@@?[^@ \t\r\n]" column="0"/>
+ </context>
+ <context name="String" attribute="String" lineEndContext="#stay">
+ <LineContinue attribute="String" context="#pop"/>
+ <HlCStringChar attribute="String Char" context="#stay"/>
+ <DetectChar attribute="Symbol" context="#stay" char="&#38;"/>
+ <DetectChar attribute="String" context="#pop" char="'"/>
+ </context>
+ <context name="SingleLineComment" attribute="Comment" lineEndContext="#pop"/>
+ <context name="MultiLineComment" attribute="Comment" lineEndContext="#stay">
+ <LineContinue attribute="Comment" context="#pop"/>
+ <Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" endRegion="Comment"/>
+ </context>
+ <context name="Identifier" attribute="Identifier" lineEndContext="#pop">
+ <DetectChar attribute="Identifier" context="#pop" char="&quot;"/>
+ </context>
+ <context name="Preprocessor" attribute="Preprocessor" lineEndContext="#pop"/>
+ </contexts>
+ <itemDatas>
+ <itemData name="Normal Text" defStyleNum="dsNormal"/>
+ <itemData name="Keyword" defStyleNum="dsKeyword"/>
+ <itemData name="Operator" defStyleNum="dsNormal"/>
+ <itemData name="Function" defStyleNum="dsFunction"/>
+ <itemData name="Data Type" defStyleNum="dsDataType"/>
+ <itemData name="Decimal" defStyleNum="dsDecVal"/>
+ <itemData name="Float" defStyleNum="dsFloat"/>
+ <itemData name="String" defStyleNum="dsString"/>
+ <itemData name="String Char" defStyleNum="dsChar"/>
+ <itemData name="Comment" defStyleNum="dsComment"/>
+ <itemData name="Identifier" defStyleNum="dsOthers"/>
+ <itemData name="Symbol" defStyleNum="dsChar"/>
+ <itemData name="Preprocessor" defStyleNum="dsOthers"/>
+ </itemDatas>
+ </highlighting>
+ <general>
+ <comments>
+ <comment name="singleLine" start="--"/>
+ <comment name="multiLine" start="/*" end="*/"/>
+ </comments>
+ <keywords casesensitive="0" weakDeliminator="+-*/|!@&amp;#&lt;&gt;%^=~:.?"/>
+ </general>
+</language>
diff --git a/kate/data/sql.xml b/kate/data/sql.xml
new file mode 100644
index 000000000..70a9f11ce
--- /dev/null
+++ b/kate/data/sql.xml
@@ -0,0 +1,951 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+<!-- Oracle10g SQL and PL/SQL syntax - ANSI SQL 2003 superset -->
+<!-- This file is maintained by Anders Lund <anders@alweb.dk> since 2005-11-06 -->
+<!-- kate: space-indent on; indent-width 2; replace-tabs on; -->
+<language name="SQL" version="1.13" kateversion="2.4" section="Database" extensions="*.sql;*.SQL" mimetype="text/x-sql" casesensitive="0" author="Yury Lebedev (yurylebedev@mail.ru)" license="LGPL">
+ <highlighting>
+ <list name="keywords">
+ <item> ACCESS </item>
+ <item> ACCOUNT </item>
+ <item> ADD </item>
+ <item> ADMIN </item>
+ <item> ADMINISTER </item>
+ <item> ADVISE </item>
+ <item> AFTER </item>
+ <item> AGENT </item>
+ <item> ALL </item>
+ <item> ALL_ROWS </item>
+ <item> ALLOCATE </item>
+ <item> ALTER </item>
+ <item> ANALYZE </item>
+ <item> ANCILLARY </item>
+ <item> AND </item>
+ <item> ANY </item>
+ <item> ARCHIVE </item>
+ <item> ARCHIVELOG </item>
+ <item> AS </item>
+ <item> ASC </item>
+ <item> ASSERTION </item>
+ <item> ASSOCIATE </item>
+ <item> AT </item>
+ <item> ATTRIBUTE </item>
+ <item> ATTRIBUTES </item>
+ <item> AUDIT </item>
+ <item> AUTHENTICATED </item>
+ <item> AUTHID </item>
+ <item> AUTHORIZATION </item>
+ <item> AUTOALLOCATE </item>
+ <item> AUTOEXTEND </item>
+ <item> AUTOMATIC </item>
+ <item> BACKUP </item>
+ <item> BECOME </item>
+ <item> BEFORE </item>
+ <item> BEGIN </item>
+ <item> BEHALF </item>
+ <item> BETWEEN </item>
+ <item> BINDING </item>
+ <item> BITMAP </item>
+ <item> BLOCK </item>
+ <item> BLOCK_RANGE </item>
+ <item> BODY </item>
+ <item> BOUND </item>
+ <item> BOTH </item>
+ <item> BREAK </item>
+ <item> BROADCAST </item>
+ <item> BTITLE </item>
+ <item> BUFFER_POOL </item>
+ <item> BUILD </item>
+ <item> BULK </item>
+ <item> BY </item>
+ <item> CACHE </item>
+ <item> CACHE_INSTANCES </item>
+ <item> CALL </item>
+ <item> CANCEL </item>
+ <item> CASCADE </item>
+ <item> CASE </item>
+ <item> CATEGORY </item>
+ <item> CHAINED </item>
+ <item> CHANGE </item>
+ <item> CHECK </item>
+ <item> CHECKPOINT </item>
+ <item> CHILD </item>
+ <item> CHOOSE </item>
+ <item> CHUNK </item>
+ <item> CLASS </item>
+ <item> CLEAR </item>
+ <item> CLONE </item>
+ <item> CLOSE </item>
+ <item> CLOSE_CACHED_OPEN_CURSORS </item>
+ <item> CLUSTER </item>
+ <item> COALESCE </item>
+ <item> COLUMN </item>
+ <item> COLUMNS </item>
+ <item> COLUMN_VALUE </item>
+ <item> COMMENT </item>
+ <item> COMMIT </item>
+ <item> COMMITTED </item>
+ <item> COMPATIBILITY </item>
+ <item> COMPILE </item>
+ <item> COMPLETE </item>
+ <item> COMPOSITE_LIMIT </item>
+ <item> COMPRESS </item>
+ <item> COMPUTE </item>
+ <item> CONNECT </item>
+ <item> CONNECT_TIME </item>
+ <item> CONSIDER </item>
+ <item> CONSISTENT </item>
+ <item> CONSTANT </item>
+ <item> CONSTRAINT </item>
+ <item> CONSTRAINTS </item>
+ <item> CONTAINER </item>
+ <item> CONTENTS </item>
+ <item> CONTEXT </item>
+ <item> CONTINUE </item>
+ <item> CONTROLFILE </item>
+ <item> COPY </item>
+ <item> COST </item>
+ <item> CPU_PER_CALL </item>
+ <item> CPU_PER_SESSION </item>
+ <item> CREATE </item>
+ <item> CREATE_STORED_OUTLINES </item>
+ <item> CROSS </item>
+ <item> CUBE </item>
+ <item> CURRENT </item>
+ <item> CURSOR </item>
+ <item> CYCLE </item>
+ <item> DANGLING </item>
+ <item> DATA </item>
+ <item> DATABASE </item>
+ <item> DATAFILE </item>
+ <item> DATAFILES </item>
+ <item> DBA </item>
+ <item> DDL </item>
+ <item> DEALLOCATE </item>
+ <item> DEBUG </item>
+ <item> DECLARE </item>
+ <item> DEFAULT </item>
+ <item> DEFERRABLE </item>
+ <item> DEFERRED </item>
+ <item> DEFINER </item>
+ <item> DEGREE </item>
+ <item> DELETE </item>
+ <item> DEMAND </item>
+ <item> DESC </item>
+ <item> DETERMINES </item>
+ <item> DICTIONARY </item>
+ <item> DIMENSION </item>
+ <item> DIRECTORY </item>
+ <item> DISABLE </item>
+ <item> DISASSOCIATE </item>
+ <item> DISCONNECT </item>
+ <item> DISKGROUP </item>
+ <item> DISMOUNT </item>
+ <item> DISTINCT </item>
+ <item> DISTRIBUTED </item>
+ <item> DOMAIN </item>
+ <item> DROP </item>
+ <item> DYNAMIC </item>
+ <item> EACH </item>
+ <item> ELSE </item>
+ <item> ELSIF </item>
+ <item> EMPTY </item>
+ <item> ENABLE </item>
+ <item> END </item>
+ <item> ENFORCE </item>
+ <item> ENTRY </item>
+ <item> ESCAPE </item>
+ <item> ESTIMATE </item>
+ <item> EVENTS </item>
+ <item> EXCEPT </item>
+ <item> EXCEPTION </item>
+ <item> EXCEPTIONS </item>
+ <item> EXCHANGE </item>
+ <item> EXCLUDING </item>
+ <item> EXCLUSIVE </item>
+ <item> EXEC </item>
+ <item> EXECUTE </item>
+ <item> EXISTS </item>
+ <item> EXPIRE </item>
+ <item> EXPLAIN </item>
+ <item> EXPLOSION </item>
+ <item> EXTENDS </item>
+ <item> EXTENT </item>
+ <item> EXTENTS </item>
+ <item> EXTERNALLY </item>
+ <item> FAILED_LOGIN_ATTEMPTS </item>
+ <item> FALSE </item>
+ <item> FAST </item>
+ <item> FILE </item>
+ <item> FILTER </item>
+ <item> FIRST_ROWS </item>
+ <item> FLAGGER </item>
+ <item> FLASHBACK </item>
+ <item> FLUSH </item>
+ <item> FOLLOWING </item>
+ <item> FOR </item>
+ <item> FORCE </item>
+ <item> FOREIGN </item>
+ <item> FREELIST </item>
+ <item> FREELISTS </item>
+ <item> FRESH </item>
+ <item> FROM </item>
+ <item> FULL </item>
+ <item> FUNCTION </item>
+ <item> FUNCTIONS </item>
+ <item> GENERATED </item>
+ <item> GLOBAL </item>
+ <item> GLOBALLY </item>
+ <item> GLOBAL_NAME </item>
+ <item> GRANT </item>
+ <item> GROUP </item>
+ <item> GROUPS </item>
+ <item> HASH </item>
+ <item> HASHKEYS </item>
+ <item> HAVING </item>
+ <item> HEADER </item>
+ <item> HEAP </item>
+ <item> HIERARCHY </item>
+ <item> HOUR </item>
+ <item> ID </item>
+ <item> IDENTIFIED </item>
+ <item> IDENTIFIER </item>
+ <item> IDGENERATORS </item>
+ <item> IDLE_TIME </item>
+ <item> IF </item>
+ <item> IMMEDIATE </item>
+ <item> IN </item>
+ <item> INCLUDING </item>
+ <item> INCREMENT </item>
+ <item> INCREMENTAL </item>
+ <item> INDEX </item>
+ <item> INDEXED </item>
+ <item> INDEXES </item>
+ <item> INDEXTYPE </item>
+ <item> INDEXTYPES </item>
+ <item> INDICATOR </item>
+ <item> INITIAL </item>
+ <item> INITIALIZED </item>
+ <item> INITIALLY </item>
+ <item> INITRANS </item>
+ <item> INNER </item>
+ <item> INSERT </item>
+ <item> INSTANCE </item>
+ <item> INSTANCES </item>
+ <item> INSTEAD </item>
+ <item> INTERMEDIATE </item>
+ <item> INTERSECT </item>
+ <item> INTO </item>
+ <item> INVALIDATE </item>
+ <item> IS </item>
+ <item> ISOLATION </item>
+ <item> ISOLATION_LEVEL </item>
+ <item> JAVA </item>
+ <item> JOIN </item>
+ <item> KEEP </item>
+ <item> KEY </item>
+ <item> KILL </item>
+ <item> LABEL </item>
+ <item> LAYER </item>
+ <item> LEADING </item>
+ <item> LEFT </item>
+ <item> LESS </item>
+ <item> LEVEL </item>
+ <item> LIBRARY </item>
+ <item> LIKE </item>
+ <item> LIMIT </item>
+ <item> LINK </item>
+ <item> LIST </item>
+ <item> LOCAL </item>
+ <item> LOCATOR </item>
+ <item> LOCK </item>
+ <item> LOCKED </item>
+ <item> LOGFILE </item>
+ <item> LOGGING </item>
+ <item> LOGICAL_READS_PER_CALL </item>
+ <item> LOGICAL_READS_PER_SESSION </item>
+ <item> LOGOFF </item>
+ <item> LOGON </item>
+ <item> LOOP </item>
+ <item> MANAGE </item>
+ <item> MANAGED </item>
+ <item> MANAGEMENT </item>
+ <item> MASTER </item>
+ <item> MATERIALIZED </item>
+ <item> MAXARCHLOGS </item>
+ <item> MAXDATAFILES </item>
+ <item> MAXEXTENTS </item>
+ <item> MAXINSTANCES </item>
+ <item> MAXLOGFILES </item>
+ <item> MAXLOGHISTORY </item>
+ <item> MAXLOGMEMBERS </item>
+ <item> MAXSIZE </item>
+ <item> MAXTRANS </item>
+ <item> MAXVALUE </item>
+ <item> METHOD </item>
+ <item> MEMBER </item>
+ <item> MERGE </item>
+ <item> MINIMIZE </item>
+ <item> MINIMUM </item>
+ <item> MINEXTENTS </item>
+ <item> MINUS </item>
+ <item> MINUTE </item>
+ <item> MINVALUE </item>
+ <item> MODE </item>
+ <item> MODIFY </item>
+ <item> MONITORING </item>
+ <item> MOUNT </item>
+ <item> MOVE </item>
+ <item> MOVEMENT </item>
+ <item> MTS_DISPATCHERS </item>
+ <item> MULTISET </item>
+ <item> NAMED </item>
+ <item> NATURAL </item>
+ <item> NEEDED </item>
+ <item> NESTED </item>
+ <item> NESTED_TABLE_ID </item>
+ <item> NETWORK </item>
+ <item> NEVER </item>
+ <item> NEW </item>
+ <item> NEXT </item>
+ <item> NLS_CALENDAR </item>
+ <item> NLS_CHARACTERSET </item>
+ <item> NLS_COMP </item>
+ <item> NLS_CURRENCY </item>
+ <item> NLS_DATE_FORMAT </item>
+ <item> NLS_DATE_LANGUAGE </item>
+ <item> NLS_ISO_CURRENCY </item>
+ <item> NLS_LANG </item>
+ <item> NLS_LANGUAGE </item>
+ <item> NLS_NUMERIC_CHARACTERS </item>
+ <item> NLS_SORT </item>
+ <item> NLS_SPECIAL_CHARS </item>
+ <item> NLS_TERRITORY </item>
+ <item> NO </item>
+ <item> NOARCHIVELOG </item>
+ <item> NOAUDIT </item>
+ <item> NOCACHE </item>
+ <item> NOCOMPRESS </item>
+ <item> NOCYCLE </item>
+ <item> NOFORCE </item>
+ <item> NOLOGGING </item>
+ <item> NOMAXVALUE </item>
+ <item> NOMINIMIZE </item>
+ <item> NOMINVALUE </item>
+ <item> NOMONITORING </item>
+ <item> NONE </item>
+ <item> NOORDER </item>
+ <item> NOOVERRIDE </item>
+ <item> NOPARALLEL </item>
+ <item> NORELY </item>
+ <item> NORESETLOGS </item>
+ <item> NOREVERSE </item>
+ <item> NORMAL </item>
+ <item> NOSEGMENT </item>
+ <item> NOSORT </item>
+ <item> NOT </item>
+ <item> NOTHING </item>
+ <item> NOVALIDATE </item>
+ <item> NOWAIT </item>
+ <item> NULL </item>
+ <item> NULLS </item>
+ <item> OBJNO </item>
+ <item> OBJNO_REUSE </item>
+ <item> OF </item>
+ <item> OFF </item>
+ <item> OFFLINE </item>
+ <item> OID </item>
+ <item> OIDINDEX </item>
+ <item> OLD </item>
+ <item> ON </item>
+ <item> ONLINE </item>
+ <item> ONLY </item>
+ <item> OPCODE </item>
+ <item> OPEN </item>
+ <item> OPERATOR </item>
+ <item> OPTIMAL </item>
+ <item> OPTIMIZER_GOAL </item>
+ <item> OPTION </item>
+ <item> OR </item>
+ <item> ORDER </item>
+ <item> ORGANIZATION </item>
+ <item> OUT </item>
+ <item> OUTER </item>
+ <item> OUTLINE </item>
+ <item> OVER </item>
+ <item> OVERFLOW </item>
+ <item> OVERLAPS </item>
+ <item> OWN </item>
+ <item> PACKAGE </item>
+ <item> PACKAGES </item>
+ <item> PARALLEL </item>
+ <item> PARAMETERS </item>
+ <item> PARENT </item>
+ <item> PARTITION </item>
+ <item> PARTITIONS </item>
+ <item> PARTITION_HASH </item>
+ <item> PARTITION_RANGE </item>
+ <item> PASSWORD </item>
+ <item> PASSWORD_GRACE_TIME </item>
+ <item> PASSWORD_LIFE_TIME </item>
+ <item> PASSWORD_LOCK_TIME </item>
+ <item> PASSWORD_REUSE_MAX </item>
+ <item> PASSWORD_REUSE_TIME </item>
+ <item> PASSWORD_VERIFY_FUNCTION </item>
+ <item> PCTFREE </item>
+ <item> PCTINCREASE </item>
+ <item> PCTTHRESHOLD </item>
+ <item> PCTUSED </item>
+ <item> PCTVERSION </item>
+ <item> PERCENT </item>
+ <item> PERMANENT </item>
+ <item> PLAN </item>
+ <item> PLSQL_DEBUG </item>
+ <item> POST_TRANSACTION </item>
+ <item> PREBUILT </item>
+ <item> PRECEDING </item>
+ <item> PREPARE </item>
+ <item> PRESENT </item>
+ <item> PRESERVE </item>
+ <item> PREVIOUS </item>
+ <item> PRIMARY </item>
+ <item> PRIOR </item>
+ <item> PRIVATE </item>
+ <item> PRIVATE_SGA </item>
+ <item> PRIVILEGE </item>
+ <item> PRIVILEGES </item>
+ <item> PROCEDURE </item>
+ <item> PROFILE </item>
+ <item> PUBLIC </item>
+ <item> PURGE </item>
+ <item> QUERY </item>
+ <item> QUEUE </item>
+ <item> QUOTA </item>
+ <item> RANDOM </item>
+ <item> RANGE </item>
+ <item> RBA </item>
+ <item> READ </item>
+ <item> READS </item>
+ <item> REBUILD </item>
+ <item> RECORDS_PER_BLOCK </item>
+ <item> RECOVER </item>
+ <item> RECOVERABLE </item>
+ <item> RECOVERY </item>
+ <item> RECYCLE </item>
+ <item> REDUCED </item>
+ <item> REFERENCES </item>
+ <item> REFERENCING </item>
+ <item> REFRESH </item>
+ <item> RELY </item>
+ <item> RENAME </item>
+ <item> REPLACE </item>
+ <item> RESET </item>
+ <item> RESETLOGS </item>
+ <item> RESIZE </item>
+ <item> RESOLVE </item>
+ <item> RESOLVER </item>
+ <item> RESOURCE </item>
+ <item> RESTRICT </item>
+ <item> RESTRICTED </item>
+ <item> RESUME </item>
+ <item> RETURN </item>
+ <item> RETURNING </item>
+ <item> REUSE </item>
+ <item> REVERSE </item>
+ <item> REVOKE </item>
+ <item> REWRITE </item>
+ <item> RIGHT </item>
+ <item> ROLE </item>
+ <item> ROLES </item>
+ <item> ROLLBACK </item>
+ <item> ROLLUP </item>
+ <item> ROW </item>
+ <item> ROWNUM </item>
+ <item> ROWS </item>
+ <item> RULE </item>
+ <item> SAMPLE </item>
+ <item> SAVEPOINT </item>
+ <item> SCAN </item>
+ <item> SCAN_INSTANCES </item>
+ <item> SCHEMA </item>
+ <item> SCN </item>
+ <item> SCOPE </item>
+ <item> SD_ALL </item>
+ <item> SD_INHIBIT </item>
+ <item> SD_SHOW </item>
+ <item> SEGMENT </item>
+ <item> SEG_BLOCK </item>
+ <item> SEG_FILE </item>
+ <item> SELECT </item>
+ <item> SELECTIVITY </item>
+ <item> SEQUENCE </item>
+ <item> SERIALIZABLE </item>
+ <item> SERVERERROR </item>
+ <item> SESSION </item>
+ <item> SESSION_CACHED_CURSORS </item>
+ <item> SESSIONS_PER_USER </item>
+ <item> SET </item>
+ <item> SHARE </item>
+ <item> SHARED </item>
+ <item> SHARED_POOL </item>
+ <item> SHRINK </item>
+ <item> SHUTDOWN </item>
+ <item> SINGLETASK </item>
+ <item> SIZE </item>
+ <item> SKIP </item>
+ <item> SKIP_UNUSABLE_INDEXES </item>
+ <item> SNAPSHOT </item>
+ <item> SOME </item>
+ <item> SORT </item>
+ <item> SOURCE </item>
+ <item> SPECIFICATION </item>
+ <item> SPLIT </item>
+ <item> SQL_TRACE </item>
+ <item> STANDBY </item>
+ <item> START </item>
+ <item> STARTUP </item>
+ <item> STATEMENT_ID </item>
+ <item> STATISTICS </item>
+ <item> STATIC </item>
+ <item> STOP </item>
+ <item> STORAGE </item>
+ <item> STORE </item>
+ <item> STRUCTURE </item>
+ <item> SUBMULTISET </item>
+ <item> SUBPARTITION </item>
+ <item> SUBPARTITIONS </item>
+ <item> SUCCESSFUL </item>
+ <item> SUMMARY </item>
+ <item> SUPPLEMENTAL </item>
+ <item> SUSPEND </item>
+ <item> SWITCH </item>
+ <item> SYS_OP_BITVEC </item>
+ <item> SYS_OP_ENFORCE_NOT_NULL$ </item>
+ <item> SYS_OP_NOEXPAND </item>
+ <item> SYS_OP_NTCIMG$ </item>
+ <item> SYNONYM </item>
+ <item> SYSDBA </item>
+ <item> SYSOPER </item>
+ <item> SYSTEM </item>
+ <item> TABLE </item>
+ <item> TABLES </item>
+ <item> TABLESPACE </item>
+ <item> TABLESPACE_NO </item>
+ <item> TABNO </item>
+ <item> TEMPFILE </item>
+ <item> TEMPORARY </item>
+ <item> THAN </item>
+ <item> THE </item>
+ <item> THEN </item>
+ <item> THREAD </item>
+ <item> THROUGH </item>
+ <item> TIMEOUT </item>
+ <item> TIMEZONE_HOUR </item>
+ <item> TIMEZONE_MINUTE </item>
+ <item> TIME_ZONE </item>
+ <item> TO </item>
+ <item> TOPLEVEL </item>
+ <item> TRACE </item>
+ <item> TRACING </item>
+ <item> TRAILING </item>
+ <item> TRANSACTION </item>
+ <item> TRANSITIONAL </item>
+ <item> TRIGGER </item>
+ <item> TRIGGERS </item>
+ <item> TRUE </item>
+ <item> TRUNCATE </item>
+ <item> TYPE </item>
+ <item> TYPES </item>
+ <item> UNARCHIVED </item>
+ <item> UNBOUND </item>
+ <item> UNBOUNDED </item>
+ <item> UNDO </item>
+ <item> UNIFORM </item>
+ <item> UNION </item>
+ <item> UNIQUE </item>
+ <item> UNLIMITED </item>
+ <item> UNLOCK </item>
+ <item> UNRECOVERABLE </item>
+ <item> UNTIL </item>
+ <item> UNUSABLE </item>
+ <item> UNUSED </item>
+ <item> UPD_INDEXES </item>
+ <item> UPDATABLE </item>
+ <item> UPDATE </item>
+ <item> UPPPER </item>
+ <item> USAGE </item>
+ <item> USE </item>
+ <item> USE_STORED_OUTLINES </item>
+ <item> USER_DEFINED </item>
+ <item> USING </item>
+ <item> VALIDATE </item>
+ <item> VALIDATION </item>
+ <item> VALUES </item>
+ <item> VIEW </item>
+ <item> WHEN </item>
+ <item> WHENEVER </item>
+ <item> WHERE </item>
+ <item> WITH </item>
+ <item> WITHOUT </item>
+ <item> WORK </item>
+ <item> WRITE </item>
+ </list>
+ <list name="operators">
+ <item> + </item>
+ <item> - </item>
+ <item> * </item>
+ <item> / </item>
+ <item> || </item>
+ <item> = </item>
+ <item> != </item>
+ <item> &lt;&gt; </item>
+ <item> &lt; </item>
+ <item> &lt;= </item>
+ <item> &gt; </item>
+ <item> &gt;= </item>
+ <item> ~= </item>
+ <item> ^= </item>
+ <item> := </item>
+ <item> =&gt; </item>
+ <item> ** </item>
+ <item> .. </item>
+ </list>
+ <list name="functions">
+ <item> ABS </item>
+ <item> ACOS </item>
+ <item> ADD_MONTHS </item>
+ <item> ASCII </item>
+ <item> ASCIISTR </item>
+ <item> ASIN </item>
+ <item> ATAN </item>
+ <item> ATAN2 </item>
+ <item> AVG </item>
+ <item> BFILENAME </item>
+ <item> BIN_TO_NUM </item>
+ <item> BITAND </item>
+ <item> CARDINALITY </item>
+ <item> CAST </item>
+ <item> CEIL </item>
+ <item> CHARTOROWID </item>
+ <item> CHR </item>
+ <item> COALESCE </item>
+ <item> COLLECT </item>
+ <item> COMPOSE </item>
+ <item> CONCAT </item>
+ <item> CONVERT </item>
+ <item> CORR </item>
+ <item> CORR_K </item>
+ <item> CORR_S </item>
+ <item> COS </item>
+ <item> COSH </item>
+ <item> COUNT </item>
+ <item> COVAR_POP </item>
+ <item> COVAR_SAMP </item>
+ <item> CUME_DIST </item>
+ <item> CURRENT_DATE </item>
+ <item> CURRENT_TIMESTAMP </item>
+ <item> CV </item>
+ <item> DBTIMEZONE </item>
+ <item> DECODE </item>
+ <item> DECOMPOSE </item>
+ <item> DENSE_RANK </item>
+ <item> DEPTH </item>
+ <item> DEREF </item>
+ <item> DUMP </item>
+ <item> EMPTY_BLOB </item>
+ <item> EMPTY_CLOB </item>
+ <item> EXISTSNODE </item>
+ <item> EXP </item>
+ <item> EXTRACT </item>
+ <item> EXTRACTVALUE </item>
+ <item> FIRST </item>
+ <item> FIRST_VALUE </item>
+ <item> FLOOR </item>
+ <item> FROM_TZ </item>
+ <item> GREATEST </item>
+ <item> GROUP_ID </item>
+ <item> GROUPING </item>
+ <item> GROUPING_ID </item>
+ <item> HEXTORAW </item>
+ <item> INITCAP </item>
+ <item> INSTR </item>
+ <item> INSTRB </item>
+ <item> LAG </item>
+ <item> LAST </item>
+ <item> LAST_DAY </item>
+ <item> LAST_VALUE </item>
+ <item> LEAD </item>
+ <item> LEAST </item>
+ <item> LENGTH </item>
+ <item> LENGTHB </item>
+ <item> LN </item>
+ <item> LNNVL </item>
+ <item> LOCALTIMESTAMP </item>
+ <item> LOG </item>
+ <item> LOWER </item>
+ <item> LPAD </item>
+ <item> LTRIM </item>
+ <item> MAKE_REF </item>
+ <item> MAX </item>
+ <item> MEDIAN </item>
+ <item> MIN </item>
+ <item> MOD </item>
+ <item> MONTHS_BETWEEN </item>
+ <item> NANVL </item>
+ <item> NCHR </item>
+ <item> NEW_TIME </item>
+ <item> NEXT_DAY </item>
+ <item> NLS_CHARSET_DECL_LEN </item>
+ <item> NLS_CHARSET_ID </item>
+ <item> NLS_CHARSET_NAME </item>
+ <item> NLS_INITCAP </item>
+ <item> NLS_LOWER </item>
+ <item> NLS_UPPER </item>
+ <item> NLSSORT </item>
+ <item> NTILE </item>
+ <item> NULLIF </item>
+ <item> NUMTODSINTERVAL </item>
+ <item> NUMTOYMINTERVAL </item>
+ <item> NVL </item>
+ <item> NVL2 </item>
+ <item> ORA_HASH </item>
+ <item> ORA_ROWSCN </item>
+ <item> PERCENT_RANK </item>
+ <item> PERCENTILE_CONT </item>
+ <item> PERCENTILE_DISC </item>
+ <item> POWER </item>
+ <item> POWERMULTISET </item>
+ <item> POWERMULTISET_BY_CARDINALITY </item>
+ <item> PRESENTNNV </item>
+ <item> PRESENTV </item>
+ <item> RANK </item>
+ <item> RATIO_TO_REPORT </item>
+ <item> RAWTOHEX </item>
+ <item> RAWTONHEX </item>
+ <item> REF </item>
+ <item> REFTOHEX </item>
+ <item> REGEXP_INSTR </item>
+ <item> REGEXP_LIKE </item>
+ <item> REGEXP_REPLACE </item>
+ <item> REGEXP_SUBSTR </item>
+ <item> REGR_SLOPE </item>
+ <item> REGR_INTERCEPT </item>
+ <item> REGR_COUNT </item>
+ <item> REGR_R2 </item>
+ <item> REGR_AVGX </item>
+ <item> REGR_AVGY </item>
+ <item> REGR_SXX </item>
+ <item> REGR_SYY </item>
+ <item> REGR_SXY </item>
+ <item> REMAINDER </item>
+ <item> ROUND </item>
+ <item> ROW_NUMBER </item>
+ <item> ROWIDTOCHAR </item>
+ <item> ROWIDTONCHAR </item>
+ <item> RPAD </item>
+ <item> RTRIM </item>
+ <item> SCN_TO_TIMESTAMP </item>
+ <item> SESSIONTIMEZONE </item>
+ <item> SIGN </item>
+ <item> SIN </item>
+ <item> SINH </item>
+ <item> SOUNDEX </item>
+ <item> SQRT </item>
+ <item> STATS_BINOMIAL_TEST </item>
+ <item> STATS_CROSSTAB </item>
+ <item> STATS_F_TEST </item>
+ <item> STATS_KS_TEST </item>
+ <item> STATS_MODE </item>
+ <item> STATS_MW_TEST </item>
+ <item> STATS_ONE_WAY_ANOVA </item>
+ <item> STATS_T_TEST_ONE </item>
+ <item> STATS_T_TEST_PAIRED </item>
+ <item> STATS_T_TEST_INDEP </item>
+ <item> STATS_T_TEST_INDEPU </item>
+ <item> STATS_WSR_TEST </item>
+ <item> STDDEV </item>
+ <item> STDDEV_POP </item>
+ <item> STDDEV_SAMP </item>
+ <item> SUBSTR </item>
+ <item> SUBSTRB </item>
+ <item> SUM </item>
+ <item> SYS_CONNECT_BY_PATH </item>
+ <item> SYS_CONTEXT </item>
+ <item> SYS_DBURIGEN </item>
+ <item> SYS_EXTRACT_UTC </item>
+ <item> SYS_GUID </item>
+ <item> SYS_TYPEID </item>
+ <item> SYS_XMLAGG </item>
+ <item> SYS_XMLGEN </item>
+ <item> SYSDATE </item>
+ <item> SYSTIMESTAMP </item>
+ <item> TAN </item>
+ <item> TANH </item>
+ <item> TIMESTAMP_TO_SCN </item>
+ <item> TO_BINARY_DOUBLE </item>
+ <item> TO_BINARY_FLOAT </item>
+ <item> TO_CHAR </item>
+ <item> TO_CLOB </item>
+ <item> TO_DATE </item>
+ <item> TO_DSINTERVAL </item>
+ <item> TO_LOB </item>
+ <item> TO_MULTI_BYTE </item>
+ <item> TO_NCHAR </item>
+ <item> TO_NCLOB </item>
+ <item> TO_NUMBER </item>
+ <item> TO_SINGLE_BYTE </item>
+ <item> TO_TIMESTAMP </item>
+ <item> TO_TIMESTAMP_TZ </item>
+ <item> TO_YMINTERVAL </item>
+ <item> TRANSLATE </item>
+ <item> TREAT </item>
+ <item> TRIM </item>
+ <item> TRUNC </item>
+ <item> TZ_OFFSET </item>
+ <item> UID </item>
+ <item> UNISTR </item>
+ <item> UPDATEXML </item>
+ <item> UPPER </item>
+ <item> USER </item>
+ <item> USERENV </item>
+ <item> VALUE </item>
+ <item> VAR_POP </item>
+ <item> VAR_SAMP </item>
+ <item> VARIANCE </item>
+ <item> VSIZE </item>
+ <item> WIDTH_BUCKET </item>
+ <item> XMLAGG </item>
+ <item> XMLCOLATTVAL </item>
+ <item> XMLCONCAT </item>
+ <item> XMLELEMENT </item>
+ <item> XMLFOREST </item>
+ <item> XMLSEQUENCE </item>
+ <item> XMLTRANSFORM </item>
+ </list>
+ <list name="types">
+ <item> ANYDATA </item>
+ <item> ANYDATASET </item>
+ <item> ANYTYPE </item>
+ <item> ARRAY </item>
+ <item> BFILE </item>
+ <item> BINARY_DOUBLE </item>
+ <item> BINARY_FLOAT </item>
+ <item> BINARY_INTEGER </item>
+ <item> BLOB </item>
+ <item> BOOLEAN </item>
+ <item> CFILE </item>
+ <item> CHAR </item>
+ <item> CHARACTER </item>
+ <item> CLOB </item>
+ <item> DATE </item>
+ <item> DAY </item>
+ <item> DBURITYPE </item>
+ <item> DEC </item>
+ <item> DECIMAL </item>
+ <item> DOUBLE </item>
+ <item> FLOAT </item>
+ <item> FLOB </item>
+ <item> HTTPURITYPE </item>
+ <item> INT </item>
+ <item> INTEGER </item>
+ <item> INTERVAL </item>
+ <item> LOB </item>
+ <item> LONG </item>
+ <item> MLSLABEL </item>
+ <item> MONTH </item>
+ <item> NATIONAL </item>
+ <item> NCHAR </item>
+ <item> NCLOB </item>
+ <item> NUMBER </item>
+ <item> NUMERIC </item>
+ <item> NVARCHAR </item>
+ <item> OBJECT </item>
+ <item> PLS_INTEGER </item>
+ <item> PRECISION </item>
+ <item> RAW </item>
+ <item> RECORD </item>
+ <item> REAL </item>
+ <item> ROWID </item>
+ <item> SECOND </item>
+ <item> SINGLE </item>
+ <item> SMALLINT </item>
+ <item> TIME </item>
+ <item> TIMESTAMP </item>
+ <item> URIFACTORYTYPE </item>
+ <item> URITYPE </item>
+ <item> UROWID </item>
+ <item> VARCHAR </item>
+ <item> VARCHAR2 </item>
+ <item> VARYING </item>
+ <item> VARRAY </item>
+ <item> XMLTYPE </item>
+ <item> YEAR </item>
+ <item> ZONE </item>
+ </list>
+ <contexts>
+ <context name="Normal" attribute="Normal Text" lineEndContext="#stay">
+ <keyword attribute="Keyword" String="keywords" context="#stay"/>
+ <keyword attribute="Operator" String="operators" context="#stay"/>
+ <keyword attribute="Function" String="functions" context="#stay"/>
+ <keyword attribute="Data Type" String="types" context="#stay"/>
+ <RegExpr attribute="Data Type" String="%bulk_exceptions\b" insensitive="true" context="#stay"/>
+ <RegExpr attribute="Data Type" String="%bulk_rowcount\b" insensitive="true" context="#stay"/>
+ <RegExpr attribute="Data Type" String="%found\b" insensitive="true" context="#stay"/>
+ <RegExpr attribute="Data Type" String="%isopen\b" insensitive="true" context="#stay"/>
+ <RegExpr attribute="Data Type" String="%notfound\b" insensitive="true" context="#stay"/>
+ <RegExpr attribute="Data Type" String="%rowcount\b" insensitive="true" context="#stay"/>
+ <RegExpr attribute="Data Type" String="%rowtype\b" insensitive="true" context="#stay"/>
+ <RegExpr attribute="Data Type" String="%type\b" insensitive="true" context="#stay"/>
+ <Float attribute="Float" context="#stay"/>
+ <Int attribute="Decimal" context="#stay"/>
+ <DetectChar attribute="String" context="String literal" char="'"/>
+ <Detect2Chars attribute="Comment" context="Singleline PL/SQL-style comment" char="-" char1="-"/>
+ <Detect2Chars attribute="Comment" context="Multiline C-style comment" char="/" char1="*"/>
+ <RegExpr attribute="Comment" context="SQL*Plus remark directive" String="^rem\b" insensitive="true" column="0"/>
+ <DetectChar attribute="Identifier" context="User-defined identifier" char="&quot;"/>
+ <RegExpr attribute="External Variable" context="#stay" String="(:|&amp;&amp;?)\w+"/>
+ <RegExpr attribute="Symbol" context="#stay" String="^/$" column="0"/>
+ <RegExpr attribute="Preprocessor" context="SQL*Plus directive to include file" String="^@@?[^@ \t\r\n]" column="0"/>
+ </context>
+ <context name="String literal" attribute="String" lineEndContext="#stay">
+ <Detect2Chars attribute="String" context="#pop" char="\" char1="'" />
+ <HlCStringChar attribute="String Char" context="#stay"/>
+ <RegExpr attribute="External Variable" context="#stay" String="&amp;&amp;?\w+"/>
+ <Detect2Chars attribute="String Char" context="#stay" char="'" char1="'" />
+ <DetectChar attribute="String" context="#pop" char="'"/>
+ </context>
+ <context name="Singleline PL/SQL-style comment" attribute="Comment" lineEndContext="#pop"/>
+ <context name="Multiline C-style comment" attribute="Comment" lineEndContext="#stay">
+ <Detect2Chars attribute="Comment" context="#pop" char="*" char1="/"/>
+ </context>
+ <context name="SQL*Plus remark directive" attribute="Comment" lineEndContext="#pop"/>
+ <context name="User-defined identifier" attribute="Identifier" lineEndContext="#pop">
+ <DetectChar attribute="Identifier" context="#pop" char="&quot;"/>
+ </context>
+ <context name="SQL*Plus directive to include file" attribute="Preprocessor" lineEndContext="#pop"/>
+ </contexts>
+ <itemDatas>
+ <itemData name="Normal Text" defStyleNum="dsNormal"/>
+ <itemData name="Keyword" defStyleNum="dsKeyword"/>
+ <itemData name="Operator" defStyleNum="dsNormal"/>
+ <itemData name="Function" defStyleNum="dsFunction"/>
+ <itemData name="Data Type" defStyleNum="dsDataType"/>
+ <itemData name="Decimal" defStyleNum="dsDecVal"/>
+ <itemData name="Float" defStyleNum="dsFloat"/>
+ <itemData name="String" defStyleNum="dsString"/>
+ <itemData name="String Char" defStyleNum="dsChar"/>
+ <itemData name="Comment" defStyleNum="dsComment"/>
+ <itemData name="Identifier" defStyleNum="dsOthers"/>
+ <itemData name="External Variable" defStyleNum="dsChar"/>
+ <itemData name="Symbol" defStyleNum="dsChar"/>
+ <itemData name="Preprocessor" defStyleNum="dsOthers"/>
+ </itemDatas>
+ </highlighting>
+ <general>
+ <comments>
+ <comment name="singleLine" start="--"/>
+ <comment name="multiLine" start="/*" end="*/"/>
+ </comments>
+ <keywords casesensitive="0" weakDeliminator="+-*/|=!&lt;&gt;~^:."/>
+ </general>
+</language>
diff --git a/kate/data/stata.xml b/kate/data/stata.xml
new file mode 100644
index 000000000..c8eb2499f
--- /dev/null
+++ b/kate/data/stata.xml
@@ -0,0 +1,478 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+<language name="Stata" version="1.01" kateversion="2.1" section="Sources" extensions="*.ado;*.do" mimetype="" author="Edwin Leuven (e.leuven@uva.nl)" license="LGPL">
+ <highlighting>
+ <list name="keywords">
+ <item> about </item>
+ <item> ado </item>
+ <item> adjust </item>
+ <item> alpha </item>
+ <item> anova </item>
+ <item> anovadef </item>
+ <item> append </item>
+ <item> assert </item>
+ <item> arch </item>
+ <item> areg </item>
+ <item> args </item>
+ <item> arima </item>
+ <item> bar </item>
+ <item> binreg </item>
+ <item> biprobit </item>
+ <item> bitest </item>
+ <item> boxcox </item>
+ <item> brier </item>
+ <item> break </item>
+ <item> browse </item>
+ <item> bstrap </item>
+ <item> by </item>
+ <item> canon </item>
+ <item> cap </item>
+ <item> capture </item>
+ <item> cat </item>
+ <item> cd </item>
+ <item> centile </item>
+ <item> cf </item>
+ <item> checksum </item>
+ <item> ci </item>
+ <item> clavg </item>
+ <item> class </item>
+ <item> clist </item>
+ <item> clcomp </item>
+ <item> clear </item>
+ <item> clgen </item>
+ <item> clkmeans </item>
+ <item> clkmed </item>
+ <item> clnote </item>
+ <item> clogit </item>
+ <item> cloglog </item>
+ <item> clsing </item>
+ <item> cltree </item>
+ <item> cluster </item>
+ <item> clutil </item>
+ <item> cmdlog </item>
+ <item> cnreg </item>
+ <item> cnsreg </item>
+ <item> creturn </item>
+ <item> codebook </item>
+ <item> collapse </item>
+ <item> compare </item>
+ <item> compress </item>
+ <item> confirm </item>
+ <item> constraint </item>
+ <item> contract </item>
+ <item> continue </item>
+ <item> copy </item>
+ <item> copyright </item>
+ <item> corr2data </item>
+ <item> corr </item>
+ <item> correlate </item>
+ <item> corrgram </item>
+ <item> count </item>
+ <item> cox </item>
+ <item> cross </item>
+ <item> ct </item>
+ <item> ctset </item>
+ <item> cttost </item>
+ <item> cumsp </item>
+ <item> cumul </item>
+ <item> cusum </item>
+ <item> datatypes </item>
+ <item> decode </item>
+ <item> define </item>
+ <item> describe </item>
+ <item> destring </item>
+ <item> dfuller </item>
+ <item> diagplots </item>
+ <item> dir </item>
+ <item> discard </item>
+ <item> di </item>
+ <item> display </item>
+ <item> do </item>
+ <item> doedit </item>
+ <item> dotplot </item>
+ <item> drawnorm </item>
+ <item> drop </item>
+ <item> dstdize </item>
+ <item> edit </item>
+ <item> egen </item>
+ <item> eivreg </item>
+ <item> else </item>
+ <item> encode </item>
+ <item> end </item>
+ <item> epitab </item>
+ <item> erase </item>
+ <item> ereturn </item>
+ <item> exit </item>
+ <item> expand </item>
+ <item> export </item>
+ <item> factor </item>
+ <item> fdadescribe </item>
+ <item> fdasave </item>
+ <item> fdause </item>
+ <item> fillin </item>
+ <item> file </item>
+ <item> filefilter </item>
+ <item> flist </item>
+ <item> for </item>
+ <item> foreach </item>
+ <item> forv </item>
+ <item> forval </item>
+ <item> forvalues </item>
+ <item> format </item>
+ <item> fracpoly </item>
+ <item> g </item>
+ <item> gen </item>
+ <item> generate </item>
+ <item> gettoken </item>
+ <item> glm </item>
+ <item> glogit </item>
+ <item> gprefs </item>
+ <item> gr7 </item>
+ <item> graph7 </item>
+ <item> gr </item>
+ <item> graph </item>
+ <item> grmeanby </item>
+ <item> gsort </item>
+ <item> hadimvo </item>
+ <item> hausman </item>
+ <item> haver </item>
+ <item> heckman </item>
+ <item> heckprob </item>
+ <item> help </item>
+ <item> hetprob </item>
+ <item> hexdump </item>
+ <item> hilite </item>
+ <item> hist </item>
+ <item> hotel </item>
+ <item> if </item>
+ <item> icd9 </item>
+ <item> impute </item>
+ <item> in </item>
+ <item> infile </item>
+ <item> infile1 </item>
+ <item> infile2 </item>
+ <item> infiling </item>
+ <item> infix </item>
+ <item> input </item>
+ <item> insheet </item>
+ <item> inspect </item>
+ <item> ipolate </item>
+ <item> ivreg </item>
+ <item> jknife </item>
+ <item> joinby </item>
+ <item> kappa </item>
+ <item> kdensity </item>
+ <item> keep </item>
+ <item> ksm </item>
+ <item> ksmirnov </item>
+ <item> kwallis </item>
+ <item> label </item>
+ <item> ladder </item>
+ <item> levels </item>
+ <item> limits </item>
+ <item> lincom </item>
+ <item> line </item>
+ <item> linktest </item>
+ <item> list </item>
+ <item> lnskew0 </item>
+ <item> log </item>
+ <item> logistic </item>
+ <item> lowess </item>
+ <item> lfit </item>
+ <item> lstat </item>
+ <item> lroc </item>
+ <item> lsens </item>
+ <item> logit </item>
+ <item> loneway </item>
+ <item> lrtest </item>
+ <item> ltable </item>
+ <item> lv </item>
+ <item> manova </item>
+ <item> manovatest </item>
+ <item> mark </item>
+ <item> markin </item>
+ <item> markout </item>
+ <item> marksample </item>
+ <item> matsize </item>
+ <item> maximize </item>
+ <item> means </item>
+ <item> median </item>
+ <item> memory </item>
+ <item> merge </item>
+ <item> mfx </item>
+ <item> mkdir </item>
+ <item> mkspline </item>
+ <item> ml </item>
+ <item> mleval </item>
+ <item> mlmatbysum </item>
+ <item> mlmatsum </item>
+ <item> mlsum </item>
+ <item> mlvecsum </item>
+ <item> mlogit </item>
+ <item> more </item>
+ <item> move </item>
+ <item> mvencode </item>
+ <item> mvreg </item>
+ <item> nbreg </item>
+ <item> net </item>
+ <item> newey </item>
+ <item> news </item>
+ <item> nl </item>
+ <item> nlogit </item>
+ <item> nobreak </item>
+ <item> nois </item>
+ <item> noisily </item>
+ <item> notes </item>
+ <item> nptrend </item>
+ <item> numlist </item>
+ <item> obs </item>
+ <item> odbc </item>
+ <item> ologit </item>
+ <item> oneway </item>
+ <item> oprobit </item>
+ <item> order </item>
+ <item> orthog </item>
+ <item> outfile </item>
+ <item> outsheet </item>
+ <item> parse </item>
+ <item> pcorr </item>
+ <item> _pctile </item>
+ <item> pctile </item>
+ <item> pergram </item>
+ <item> pk </item>
+ <item> pkcollapse </item>
+ <item> pkcross </item>
+ <item> pkequiv </item>
+ <item> pkexamine </item>
+ <item> pkshape </item>
+ <item> pksumm </item>
+ <item> plot </item>
+ <item> poisson </item>
+ <item> post </item>
+ <item> postclose </item>
+ <item> postfile </item>
+ <item> postutil </item>
+ <item> pperron </item>
+ <item> prais </item>
+ <item> predict </item>
+ <item> preserve </item>
+ <item> probit </item>
+ <item> program </item>
+ <item> prtest </item>
+ <item> pwcorr </item>
+ <item> qc </item>
+ <item> qreg </item>
+ <item> quadchk </item>
+ <item> query </item>
+ <item> qui </item>
+ <item> quietly </item>
+ <item> ranksum </item>
+ <item> range </item>
+ <item> recast </item>
+ <item> recode </item>
+ <item> reg3 </item>
+ <item> regdiag </item>
+ <item> reg </item>
+ <item> regress </item>
+ <item> rename </item>
+ <item> replace </item>
+ <item> reshape </item>
+ <item> restore </item>
+ <item> return </item>
+ <item> roc </item>
+ <item> rocplot </item>
+ <item> rotate </item>
+ <item> rreg </item>
+ <item> runtest </item>
+ <item> run </item>
+ <item> sample </item>
+ <item> sampsi </item>
+ <item> save </item>
+ <item> scatter </item>
+ <item> scobit </item>
+ <item> score </item>
+ <item> sdtest </item>
+ <item> search </item>
+ <item> separate </item>
+ <item> serrbar </item>
+ <item> set </item>
+ <item> shell </item>
+ <item> signrank </item>
+ <item> signtest </item>
+ <item> simul </item>
+ <item> sktest </item>
+ <item> smooth </item>
+ <item> snapspan </item>
+ <item> sort </item>
+ <item> spearman </item>
+ <item> spikeplot </item>
+ <item> sreturn </item>
+ <item> st </item>
+ <item> stack </item>
+ <item> statsby </item>
+ <item> stb </item>
+ <item> stbase </item>
+ <item> stci </item>
+ <item> stcox </item>
+ <item> stdes </item>
+ <item> stem </item>
+ <item> stfill </item>
+ <item> stgen </item>
+ <item> stir </item>
+ <item> stphplot </item>
+ <item> stptime </item>
+ <item> strate </item>
+ <item> streg </item>
+ <item> sts </item>
+ <item> stset </item>
+ <item> stsplit </item>
+ <item> stsum </item>
+ <item> sttocc </item>
+ <item> sttoct </item>
+ <item> stvary </item>
+ <item> sum </item>
+ <item> summarize </item>
+ <item> sureg </item>
+ <item> svy </item>
+ <item> svydes </item>
+ <item> svylc </item>
+ <item> svymean </item>
+ <item> svyset </item>
+ <item> svytab </item>
+ <item> svytest </item>
+ <item> sw </item>
+ <item> swilk </item>
+ <item> symmetry </item>
+ <item> syntax </item>
+ <item> tab </item>
+ <item> table </item>
+ <item> tabdisp </item>
+ <item> tabstat </item>
+ <item> tabsum </item>
+ <item> tabulate </item>
+ <item> tempname </item>
+ <item> tempvar </item>
+ <item> tempfile </item>
+ <item> test </item>
+ <item> testnl </item>
+ <item> tobit </item>
+ <item> tokenize </item>
+ <item> translate </item>
+ <item> translator </item>
+ <item> transmap </item>
+ <item> treatreg </item>
+ <item> truncreg </item>
+ <item> tsreport </item>
+ <item> tsrevar </item>
+ <item> tsset </item>
+ <item> ttest </item>
+ <item> tutorials </item>
+ <item> twoway </item>
+ <item> type </item>
+ <item> unabcmd </item>
+ <item> unabbr </item>
+ <item> update </item>
+ <item> use </item>
+ <item> using </item>
+ <item> version </item>
+ <item> vce </item>
+ <item> view </item>
+ <item> vwls </item>
+ <item> weibull </item>
+ <item> whelp </item>
+ <item> while </item>
+ <item> which </item>
+ <item> wntestb </item>
+ <item> wntestq </item>
+ <item> xcorr </item>
+ <item> xi </item>
+ <item> xpose </item>
+ <item> xt </item>
+ <item> xtabond </item>
+ <item> xtclog </item>
+ <item> xtdata </item>
+ <item> xtdes </item>
+ <item> xtgee </item>
+ <item> xtgls </item>
+ <item> xtintreg </item>
+ <item> xtile </item>
+ <item> xtivreg </item>
+ <item> xtlogit </item>
+ <item> xtnbreg </item>
+ <item> xtpcse </item>
+ <item> xtpois </item>
+ <item> xtprobit </item>
+ <item> xtrchh </item>
+ <item> xtreg </item>
+ <item> xtregar </item>
+ <item> xtsum </item>
+ <item> xttab </item>
+ <item> xttobit </item>
+ <item> zip </item>
+ </list>
+ <list name="types">
+ <item> char </item>
+ <item> double </item>
+ <item> error </item>
+ <item> text </item>
+ <item> result </item>
+ <item> float </item>
+ <item> int </item>
+ <item> long </item>
+ <item> local </item>
+ <item> global </item>
+ <item> macro </item>
+ <item> mat </item>
+ <item> matrix </item>
+ <item> scalar </item>
+ <item> variable </item>
+ <item> var </item>
+ <item> varlist </item>
+ <item> varname </item>
+ </list>
+
+ <contexts>
+
+ <context attribute="Normal Text" lineEndContext="#stay" name="Normal">
+ <keyword attribute="Keyword" context="#stay" String="keywords" />
+ <keyword attribute="Data Type" context="#stay" String="types" />
+ <DetectChar attribute="String" context="string" char="&quot;"/>
+ <RangeDetect char = "`" char1 = "'" attribute = "Macro" context="#stay"/>
+ <Detect2Chars attribute="Comment" context="Comment 1" char="/" char1="/"/>
+ <Detect2Chars attribute="Comment" context="Comment 2" char="/" char1="*" beginRegion="Comment"/>
+ <DetectChar attribute="Normal Text" context="#stay" char="{" beginRegion="block"/>
+ <DetectChar attribute="Normal Text" context="#stay" char="}" endRegion="block"/>
+ </context>
+
+ <context attribute="Comment" lineEndContext="#pop" name="Comment 1"/>
+
+ <context attribute="Comment" lineEndContext="#stay" name="Comment 2">
+ <Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" endRegion="Comment"/>
+ </context>
+
+ <context attribute="String" lineEndContext="#pop" name="string">
+ <HlCStringChar attribute="String Char" context="#stay"/>
+ <DetectChar attribute="String" context="#pop" char="&quot;"/>
+ </context>
+
+ </contexts>
+
+ <itemDatas>
+ <itemData name="Normal Text" defStyleNum="dsNormal"/>
+ <itemData name="Keyword" defStyleNum="dsKeyword"/>
+ <itemData name="String" defStyleNum="dsString"/>
+ <itemData name="Macro" defStyleNum="dsOthers"/>
+ <itemData name="Data Type" defStyleNum="dsDataType"/>
+ <itemData name="Comment" defStyleNum="dsComment"/>
+ </itemDatas>
+
+ </highlighting>
+ <general>
+ <comments>
+ <comment name="singleLine" start="//" />
+ <comment name="multiLine" start="/*" end="*/" />
+ </comments>
+ <keywords casesensitive="1" />
+ </general>
+</language>
+<!-- kate: space-indent on; indent-width 2; replace-tabs on; -->
diff --git a/kate/data/syntax.template b/kate/data/syntax.template
new file mode 100644
index 000000000..1e6e571a5
--- /dev/null
+++ b/kate/data/syntax.template
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+<!--
+ You'll find the "Writing a Kate Highlighting XML File HOWTO" at http://kate.kde.org/doc/hlhowto.php
+ This is a template for the XML format used for syntax highlight descriptions
+ for the Kate text editor (http://kate.kde.org), which is part of the KDE
+ desktop environment (http://www.kde.org).
+
+ Use it as the base for your own syntax files.
+
+ Look at language.dtd for some documentation of the allowed elements and their attributes.
+ There is also a description of how to validate your syntax file.
+
+ You'll find the "Writing a Kate Highlighting XML File HOWTO" at http://kate.kde.org/doc/hlhowto.php
+-->
+<language name="" section="" version="1.00" kateversion="2.3" extensions="" mimetype="" author="" license="">
+ <highlighting>
+ <contexts>
+ <context name="Normal" attribute="Normal Text" lineEndContext="#stay"/>
+ </contexts>
+ <itemDatas>
+ <itemData name="Normal Text" defStyleNum="dsNormal"/>
+ </itemDatas>
+ </highlighting>
+</language>
+<!--
+// kate: space-indent on; indent-width 2; replace-tabs on;
+-->
diff --git a/kate/data/tcl.xml b/kate/data/tcl.xml
new file mode 100644
index 000000000..18a270822
--- /dev/null
+++ b/kate/data/tcl.xml
@@ -0,0 +1,490 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+
+<!-- Authors: Alexander Dederer & JM. Philippe -->
+<!-- Copyright: BSD copyright & Irsid - Arcelor Innovation R&D -->
+<!-- Ported to Kate 2.0/ KWrite 4.0 by Joseph Wenninger (Updated by Simon Robins)-->
+
+<language name="Tcl/Tk" version="1.08" kateversion="2.4" section="Scripts" extensions="*.tcl;*.tk" mimetype="text/x-tcl">
+ <highlighting>
+ <list name="keywords">
+ <item> after </item>
+ <item> append </item>
+ <item> AppleScript </item>
+ <item> argv </item>
+ <item> argc </item>
+ <item> array </item>
+ <item> auto_execk </item>
+ <item> auto_load </item>
+ <item> auto_mkindex </item>
+ <item> auto_path </item>
+ <item> auto_reset </item>
+ <item> beep </item>
+ <item> bell </item>
+ <item> binary </item>
+ <item> bind </item>
+ <item> bindtags </item>
+ <item> bgerror </item>
+ <item> break </item>
+ <item> button </item>
+ <item> canvas </item>
+ <item> case </item>
+ <item> catch </item>
+ <item> cd </item>
+ <item> checkbutton </item>
+ <item> clipboard </item>
+ <item> clock </item>
+ <item> close </item>
+ <item> concat </item>
+ <item> console </item>
+ <item> continue </item>
+ <item> dde </item>
+ <item> destroy </item>
+ <item> else </item>
+ <item> elseif </item>
+ <item> encoding </item>
+ <item> entry </item>
+ <item> env </item>
+ <item> eof </item>
+ <item> error </item>
+ <item> errorCode </item>
+ <item> errorInfo </item>
+ <item> eval </item>
+ <item> event </item>
+ <item> exec </item>
+ <item> exit </item>
+ <item> expr </item>
+ <item> fblocked </item>
+ <item> fconfigure </item>
+ <item> fcopy </item>
+ <item> file </item>
+ <item> fileevent </item>
+ <item> flush </item>
+ <item> focus </item>
+ <item> font </item>
+ <item> for </item>
+ <item> foreach </item>
+ <item> format </item>
+ <item> frame </item>
+ <item> gets </item>
+ <item> glob </item>
+ <item> global </item>
+ <item> grab </item>
+ <item> grid </item>
+ <item> history </item>
+ <item> if </item>
+ <item> image </item>
+ <item> incr </item>
+ <item> info </item>
+ <item> interp </item>
+ <item> join </item>
+ <item> label </item>
+ <item> lappend </item>
+ <item> lindex </item>
+ <item> linsert </item>
+ <item> list </item>
+ <item> listbox </item>
+ <item> llength </item>
+ <item> load </item>
+ <item> lower </item>
+ <item> lrange </item>
+ <item> lreplace </item>
+ <item> lsearch </item>
+ <item> lsort </item>
+ <item> menu </item>
+ <item> menubutton </item>
+ <item> message </item>
+ <item> namespace </item>
+ <item> open </item>
+ <item> option </item>
+ <item> OptProc </item>
+ <item> pack </item>
+ <item> package </item>
+ <item> parray </item>
+ <item> pid </item>
+ <item> place </item>
+ <item> pkg_mkindex </item>
+ <item> proc </item>
+ <item> puts </item>
+ <item> pwd </item>
+ <item> radiobutton </item>
+ <item> raise </item>
+ <item> read </item>
+ <item> regexp </item>
+ <item> registry </item>
+ <item> regsub </item>
+ <item> rename </item>
+ <item> resource </item>
+ <item> return </item>
+ <item> scale </item>
+ <item> scan </item>
+ <item> scrollbar </item>
+ <item> seek </item>
+ <item> selection </item>
+ <item> send </item>
+ <item> set </item>
+ <item> socket </item>
+ <item> source </item>
+ <item> split </item>
+ <item> string </item>
+ <item> subst </item>
+ <item> switch </item>
+ <item> tclLog </item>
+ <item> tcl_endOfWord </item>
+ <item> tcl_findLibrary </item>
+ <item> tcl_library </item>
+ <item> tcl_patchLevel </item>
+ <item> tcl_platform </item>
+ <item> tcl_precision </item>
+ <item> tcl_rcFileName </item>
+ <item> tcl_rcRsrcName </item>
+ <item> tcl_startOfNextWord </item>
+ <item> tcl_startOfPreviousWord </item>
+ <item> tcl_traceCompile </item>
+ <item> tcl_traceExec </item>
+ <item> tcl_version </item>
+ <item> tcl_wordBreakAfter </item>
+ <item> tcl_wordBreakBefore </item>
+ <item> tell </item>
+ <item> text </item>
+ <item> time </item>
+ <item> tk </item>
+ <item> tkTabToWindow </item>
+ <item> tkwait </item>
+ <item> tk_chooseColor </item>
+ <item> tk_chooseDirectory </item>
+ <item> tk_focusFollowMouse </item>
+ <item> tk_focusNext </item>
+ <item> tk_focusPrev </item>
+ <item> tk_getOpenFile </item>
+ <item> tk_getSaveFile </item>
+ <item> tk_library </item>
+ <item> tk_messageBox </item>
+ <item> tk_optionMenu </item>
+ <item> tk_patchLevel </item>
+ <item> tk_popup </item>
+ <item> tk_strictMotif </item>
+ <item> tk_version </item>
+ <item> toplevel </item>
+ <item> trace </item>
+ <item> unknown </item>
+ <item> unset </item>
+ <item> update </item>
+ <item> uplevel </item>
+ <item> upvar </item>
+ <item> variable </item>
+ <item> vwait </item>
+ <item> while </item>
+ <item> winfo </item>
+ <item> wm </item>
+ </list>
+
+ <list name="keywords-opt">
+ <item> add </item>
+ <item> args </item>
+ <item> atime </item>
+ <item> attributes </item>
+ <item> body </item>
+ <item> bytelength </item>
+ <item> cancel </item>
+ <item> channels </item>
+ <item> clicks </item>
+ <item> cmdcount </item>
+ <item> commands </item>
+ <item> compare </item>
+ <item> complete </item>
+ <item> convertfrom </item>
+ <item> convertto </item>
+ <item> copy </item>
+ <item> default </item>
+ <item> delete </item>
+ <item> dirname </item>
+ <item> equal </item>
+ <item> executable </item>
+ <item> exists </item>
+ <item> extension </item>
+ <item> first </item>
+ <item> forget </item>
+ <item> format </item>
+ <item> functions </item>
+ <item> globals </item>
+ <item> hostname </item>
+ <item> idle </item>
+ <item> ifneeded </item>
+ <item> index </item>
+ <item> info </item>
+ <item> is </item>
+ <item> isdirectory </item>
+ <item> isfile </item>
+ <item> join </item>
+ <item> last </item>
+ <item> length </item>
+ <item> level </item>
+ <item> library </item>
+ <item> link </item>
+ <item> loaded </item>
+ <item> locals </item>
+ <item> lstat </item>
+ <item> map </item>
+ <item> match </item>
+ <item> mkdir </item>
+ <item> mtime </item>
+ <item> nameofexecutable </item>
+ <item> names </item>
+ <item> nativename </item>
+ <item> normalize </item>
+ <item> number </item>
+ <item> owned </item>
+ <item> patchlevel </item>
+ <item> pathtype </item>
+ <item> present </item>
+ <item> procs </item>
+ <item> provide </item>
+ <item> range </item>
+ <item> readable </item>
+ <item> readlink </item>
+ <item> remove </item>
+ <item> rename </item>
+ <item> repeat </item>
+ <item> replace </item>
+ <item> require </item>
+ <item> rootname </item>
+ <item> scan </item>
+ <item> script </item>
+ <item> seconds </item>
+ <item> separator </item>
+ <item> sharedlibextension </item>
+ <item> size </item>
+ <item> split </item>
+ <item> stat </item>
+ <item> system </item>
+ <item> tail </item>
+ <item> tclversion </item>
+ <item> tolower </item>
+ <item> totitle </item>
+ <item> toupper </item>
+ <item> trim </item>
+ <item> trimleft </item>
+ <item> trimright </item>
+ <item> type </item>
+ <item> unknown </item>
+ <item> variable </item>
+ <item> vars </item>
+ <item> vcompare </item>
+ <item> vdelete </item>
+ <item> versions </item>
+ <item> vinfo </item>
+ <item> volumes </item>
+ <item> vsatisfies </item>
+ <item> wordend </item>
+ <item> wordstart </item>
+ <item> writable </item>
+
+ <item> activate </item>
+ <item> actual </item>
+ <item> addtag </item>
+ <item> append </item>
+ <item> appname </item>
+ <item> aspect </item>
+ <item> atom </item>
+ <item> atomname </item>
+ <item> bbox </item>
+ <item> bind </item>
+ <item> broadcast </item>
+ <item> canvasx </item>
+ <item> canvasy </item>
+ <item> caret </item>
+ <item> cells </item>
+ <item> cget </item>
+ <item> children </item>
+ <item> class </item>
+ <item> clear </item>
+ <item> client </item>
+ <item> clone </item>
+ <item> colormapfull </item>
+ <item> colormapwindows </item>
+ <item> command </item>
+ <item> configure </item>
+ <item> containing </item>
+ <item> coords </item>
+ <item> create </item>
+ <item> current </item>
+ <item> curselection </item>
+ <item> dchars </item>
+ <item> debug </item>
+ <item> deiconify </item>
+ <item> delta </item>
+ <item> depth </item>
+ <item> deselect </item>
+ <item> dlineinfo </item>
+ <item> dtag </item>
+ <item> dump </item>
+ <item> edit </item>
+ <item> entrycget </item>
+ <item> entryconfigure </item>
+ <item> families </item>
+ <item> find </item>
+ <item> flash </item>
+ <item> focus </item>
+ <item> focusmodel </item>
+ <item> fpixels </item>
+ <item> fraction </item>
+ <item> frame </item>
+ <item> generate </item>
+ <item> geometry </item>
+ <item> get </item>
+ <item> gettags </item>
+ <item> grid </item>
+ <item> group </item>
+ <item> handle </item>
+ <item> height </item>
+ <item> hide </item>
+ <item> iconbitmap </item>
+ <item> iconify </item>
+ <item> iconmask </item>
+ <item> iconname </item>
+ <item> iconposition </item>
+ <item> iconwindow </item>
+ <item> icursor </item>
+ <item> id </item>
+ <item> identify </item>
+ <item> image </item>
+ <item> insert </item>
+ <item> interps </item>
+ <item> inuse </item>
+ <item> invoke </item>
+ <item> ismapped </item>
+ <item> itemcget </item>
+ <item> itemconfigure </item>
+ <item> keys </item>
+ <item> lower </item>
+ <item> manager </item>
+ <item> mark </item>
+ <item> maxsize </item>
+ <item> measure </item>
+ <item> metrics </item>
+ <item> minsize </item>
+ <item> move </item>
+ <item> name </item>
+ <item> nearest </item>
+ <item> overrideredirect </item>
+ <item> own </item>
+ <item> panecget </item>
+ <item> paneconfigure </item>
+ <item> panes </item>
+ <item> parent </item>
+ <item> pathname </item>
+ <item> pixels </item>
+ <item> pointerx </item>
+ <item> pointerxy </item>
+ <item> pointery </item>
+ <item> positionfrom </item>
+ <item> post </item>
+ <item> postcascade </item>
+ <item> postscript </item>
+ <item> protocol </item>
+ <item> proxy </item>
+ <item> raise </item>
+ <item> release </item>
+ <item> reqheight </item>
+ <item> reqwidth </item>
+ <item> resizable </item>
+ <item> rgb </item>
+ <item> rootx </item>
+ <item> rooty </item>
+ <item> scale </item>
+ <item> scaling </item>
+ <item> screen </item>
+ <item> screencells </item>
+ <item> screendepth </item>
+ <item> screenheight </item>
+ <item> screenmmheight </item>
+ <item> screenmmwidth </item>
+ <item> screenvisual </item>
+ <item> screenwidth </item>
+ <item> search </item>
+ <item> see </item>
+ <item> select </item>
+ <item> selection </item>
+ <item> server </item>
+ <item> set </item>
+ <item> show </item>
+ <item> sizefrom </item>
+ <item> stackorder </item>
+ <item> state </item>
+ <item> status </item>
+ <item> tag </item>
+ <item> title </item>
+ <item> toplevel </item>
+ <item> transient </item>
+ <item> types </item>
+ <item> unpost </item>
+ <item> useinputmethods </item>
+ <item> validate </item>
+ <item> values </item>
+ <item> viewable </item>
+ <item> visual </item>
+ <item> visualid </item>
+ <item> visualsavailable </item>
+ <item> vrootheight </item>
+ <item> vrootwidth </item>
+ <item> vrootx </item>
+ <item> vrooty </item>
+ <item> width </item>
+ <item> window </item>
+ <item> windowingsystem </item>
+ <item> withdraw </item>
+ <item> x </item>
+ <item> xview </item>
+ <item> y </item>
+ </list>
+
+ <contexts>
+ <context name = "Base" attribute = "Normal Text" lineEndContext="#stay">
+ <RegExpr attribute="Region Marker" context="#stay" String="#\s*BEGIN.*$" beginRegion="region" firstNonSpace="true"/>
+ <RegExpr attribute="Region Marker" context="#stay" String="#\s*END.*$" endRegion="region" firstNonSpace="true"/>
+ <keyword String = "keywords" attribute = "Keyword" context="#stay"/>
+ <keyword String = "keywords-opt" attribute = "Parameter" context="#stay"/>
+ <Float attribute = "Float" context="#stay"/>
+ <Int attribute ="Decimal" context="#stay"/>
+ <RegExpr String="\\." attribute = "Char" context = "#stay"/>
+ <RegExpr String = "\W-\w+" attribute = "Parameter" context="#stay"/>
+ <RegExpr String = "\$\{[^\}]+\}" attribute = "Variable" context="#stay"/>
+ <RegExpr String = "\$(::)?[\S\D]\w+" attribute = "Variable" context="#stay"/>
+ <RegExpr String = "[^\\]&quot;&quot;" attribute = "String" context="#stay"/>
+ <RegExpr String = "[^\\]&quot;" attribute = "String" context="String"/>
+ <RegExpr String= "#.*$" attribute = "Comment" context="#stay" firstNonSpace="true"/>
+ <RegExpr String= ";\s*#.*$" attribute = "Comment" context="#stay"/>
+ <DetectChar char = "{" attribute = "Keyword" context="#stay" beginRegion="block"/>
+ <DetectChar char = "}" attribute = "Keyword" context="#stay" endRegion="block"/>
+ <DetectChar char = "[" attribute = "Keyword" context="#stay"/>
+ <DetectChar char = "]" attribute = "Keyword" context="#stay"/>
+ </context>
+
+ <context name = "String" attribute = "String" lineEndContext="#stay">
+ <RegExpr String="\\." attribute = "Char" context = "#stay"/>
+ <DetectChar char="&quot;" attribute = "String" context = "#pop"/>
+ <DetectChar char = "$" attribute = "Variable" context="#stay"/>
+ </context>
+ </contexts>
+
+ <itemDatas>
+ <itemData name = "Normal Text" defStyleNum = "dsNormal"/>
+ <itemData name = "Keyword" defStyleNum = "dsKeyword"/>
+ <itemData name = "Decimal" defStyleNum = "dsDecVal"/>
+ <itemData name = "Float" defStyleNum = "dsFloat"/>
+ <itemData name = "String" defStyleNum = "dsString"/>
+ <itemData name = "Comment" defStyleNum = "dsComment"/>
+ <itemData name = "Parameter" defStyleNum = "dsOthers"/>
+ <itemData name = "Variable" defStyleNum = "dsDataType"/>
+ <itemData name = "Char" defStyleNum="dsChar"/>
+ <itemData name = "Region Marker" defStyleNum="dsRegionMarker"/>
+ </itemDatas>
+
+ </highlighting>
+
+ <general>
+ <keywords casesensitive="1"/>
+ </general>
+
+</language>
diff --git a/kate/data/tibasic.xml b/kate/data/tibasic.xml
new file mode 100644
index 000000000..0b2d67dbd
--- /dev/null
+++ b/kate/data/tibasic.xml
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+<language name="TI Basic" version="1.01" kateversion="2.3" section="Scientific" extensions="">
+ <highlighting>
+ <list name="keywords">
+ <item>If </item>
+ <item>Then </item>
+ <item>Else </item>
+ <item>For </item>
+ <item>While </item>
+ <item>Repeat </item>
+ <item>End </item>
+ <item>Pause </item>
+ <item>Lbl </item>
+ <item>Goto </item>
+ <item>IS&gt; </item>
+ <item>DS&lt; </item>
+ <item>Menu </item>
+ <item>prgm </item>
+ <item>Return </item>
+ <item>DelVar </item>
+ <item>GraphStyle </item>
+ <item>Input </item>
+ <item>Prompt </item>
+ <item>Disp </item>
+ <item>DispGraph </item>
+ <item>DispTable </item>
+ <item>Output </item>
+ <item>getKey </item>
+ <item>ClrHome </item>
+ <item>ClrTable </item>
+ <item>GetCalc </item>
+ <item>Get </item>
+ <item>Send</item>
+ <item>prgm</item>
+ </list>
+ <list name="special_sym">
+ <item>net</item>
+ <item>eogt</item>
+ <item>eolt</item>
+ <item>sqrt</item>
+ <item>%THETA</item>
+ </list>
+ <contexts>
+ <context attribute="Normal Text" lineEndContext="#stay" name="Normal">
+ <keyword attribute="Keyword" context="#stay" String="keywords"/>
+ <keyword attribute="Special operators" context="#stay" String="special_sym" />
+
+ <Detect2Chars attribute="Assignment" context="#stay" char="-" char1="&gt;"/>
+ <Detect2Chars attribute="Assignment" context="#stay" char="s" char1="t"/>
+
+ <RegExpr attribute="Matrix" context="#stay" String="\[\w\]" />
+ <DetectChar attribute="String" context="String" char="&quot;"/>
+ </context>
+ <context attribute="String" lineEndContext="#stay" name="String">
+ <DetectChar attribute="String" context="#pop" char="&quot;"/>
+ </context>
+ </contexts>
+ <itemDatas>
+ <itemData name="Normal Text" defStyleNum="dsNormal"/>
+ <itemData name="Assignment" defStyleNum="dsOthers" />
+ <itemData name="Keyword" defStyleNum="dsKeyword" />
+ <itemData name="String" defStyleNum="dsString" />
+ <itemData name="Special operators" defStyleNum="dsNormal" />
+ <itemData name="Matrix" defStyleNum="dsNormal" />
+ </itemDatas>
+ </highlighting>
+ <general>
+ <keywords casesensitive="0" weakDeliminator="%&lt;&gt;"/>
+ </general>
+</language>
diff --git a/kate/data/txt2tags.xml b/kate/data/txt2tags.xml
new file mode 100644
index 000000000..61dc77e62
--- /dev/null
+++ b/kate/data/txt2tags.xml
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+<!-- Created by Juliano Dorneles dos Santos <juliano_dorneles@yahoo.com.br> -->
+<!-- Fixed for 3.2 Helio Chissini de Castro <helio@kde.org> -->
+<language name="txt2tags" extensions="*.t2t" section="Markup" mimetype="text/txt2tags" version="1.01" kateversion="2.4" casesensitive="1">
+<highlighting>
+
+<contexts>
+ <context name="Context" attribute="Normal" lineEndContext="#stay">
+ <RegExpr attribute="Date" context="Context" String="%%date(\(.*\))?"/>
+ <RegExpr attribute="Comment" context="Context" String="%.*"/>
+ <RegExpr attribute="Bold" context="Context" String="\*\*.*\*\*"/>
+ <RegExpr attribute="Italic" context="Context" String="//.*//"/>
+ <RegExpr attribute="BoldItalic" context="Context" String="\*\*//.*//\*\*"/>
+ <RegExpr attribute="BoldItalic" context="Context" String="__.*__"/>
+ <RegExpr attribute="Monospaced" context="Context" String="``.*``"/>
+ <RegExpr attribute="Verbatim Line" context="Context" String="``` .*"/>
+ <RegExpr attribute="Title" context="Context" String=" *=[^=].*[^=]=\s*$" column="0"/>
+ <RegExpr attribute="Title" context="Context" String=" *==[^=].*[^=]==\s*$" column="0"/>
+ <RegExpr attribute="Title" context="Context" String=" *===[^=].*[^=]===\s*$" column="0"/>
+ <RegExpr attribute="Title" context="Context" String=" *====[^=].*[^=]====\s*$" column="0"/>
+ <RegExpr attribute="Title" context="Context" String=" *=====[^=].*[^=]=====\s*$" column="0"/>
+ <RegExpr attribute="Title" context="Context" String=" *\+[^=].*[^=]\+\s*$" column="0"/>
+ <RegExpr attribute="Title" context="Context" String=" *\+\+[^=].*[^=]\+\+\s*$" column="0"/>
+ <RegExpr attribute="Title" context="Context" String=" *\+\+\+[^=].*[^=]\+\+\+\s*$" column="0"/>
+ <RegExpr attribute="Title" context="Context" String=" *\+\+\+\+[^=].*[^=]\+\+\+\+\s*$" column="0"/>
+ <RegExpr attribute="Title" context="Context" String=" *\+\+\+\+\+[^=].*[^=]\+\+\+\+\+\s*$" column="0"/>
+ <RangeDetect attribute="Link" char="[" char1="]"/>
+ <RegExpr attribute="Tabel" context="Context" String=" *\|\| .*" column="0"/>
+ <RegExpr attribute="Tabel" context="Context" String=" *\| .*" column="0"/>
+ <RegExpr attribute="DefList" context="Context" String=" *\: .*" column="0"/>
+ <RegExpr attribute="List" context="Context" String=" *\- .*" column="0"/>
+ <RegExpr attribute="NumList" context="Context" String=" *\+ .*" column="0"/>
+ <RegExpr attribute="Quote" context="Context" String="\t.*"/>
+ <RegExpr attribute="Bar" context="Context" String="\s*([_=-]{20,})\s*$"/>
+ </context>
+</contexts>
+
+<itemDatas>
+ <itemData name="Normal" defStyleNum="dsNormal" />
+ <itemData name="Date" defStyleNum="dsNormal" color="#FF0000" italic="1" />
+ <itemData name="Comment" defStyleNum="dsNormal" color="#666666" italic="1" />
+ <itemData name="Bold" defStyleNum="dsNormal" bold="1" />
+ <itemData name="Italic" defStyleNum="dsNormal" italic="1" />
+ <itemData name="BoldItalic" defStyleNum="dsNormal" bold="1" italic="1" />
+ <itemData name="Monospaced" defStyleNum="dsNormal" color="#006600" />
+ <itemData name="Verbatim Line" defStyleNum="dsNormal" color="#006600" />
+ <itemData name="Verbatim Area" defStyleNum="dsNormal" color="#006600" />
+ <itemData name="Title" defStyleNum="dsNormal" color="#990000" />
+ <itemData name="Link" defStyleNum="dsNormal" color="#000099" />
+ <itemData name="Tabel" defStyleNum="dsNormal" color="#FF0000" />
+ <itemData name="DefList" defStyleNum="dsNormal" color="#FFCC66" />
+ <itemData name="List" defStyleNum="dsNormal" color="#FFCC66" />
+ <itemData name="NumList" defStyleNum="dsNormal" color="#FFCC66" />
+ <itemData name="Quote" defStyleNum="dsNormal" color="brown" />
+ <itemData name="Bar" defStyleNum="dsNormal" color="#C0C0C0" />
+</itemDatas>
+
+</highlighting>
+
+</language>
diff --git a/kate/data/uscript.xml b/kate/data/uscript.xml
new file mode 100644
index 000000000..5f4d6d8d9
--- /dev/null
+++ b/kate/data/uscript.xml
@@ -0,0 +1,186 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+<language name="UnrealScript" version="0.91" kateversion="2.3" section="Scripts" extensions="*.uc" mimetype="text/x-uscript">
+ <highlighting>
+ <list name="keywords">
+ <item> break </item>
+ <item> continue </item>
+ <item> if </item>
+ <item> else </item>
+ <item> switch </item>
+ <item> while </item>
+ <item> for </item>
+ <item> do </item>
+ <item> foreach </item>
+ <item> true </item>
+ <item> false </item>
+ <item> null </item>
+ <item> new </item>
+ <item> instanceof </item>
+ <item> state </item>
+ <item> auto </item>
+ <item> exec </item>
+ <item> function </item>
+ <item> defaultproperties </item>
+ <item> native </item>
+ <item> noexport</item>
+ <item> var </item>
+ <item> out </item>
+ <item> local </item>
+ <item> event </item>
+ <item> return </item>
+ <item> static </item>
+ <item> Static </item>
+ <item> synchronized </item>
+ <item> transient </item>
+ <item> volatile </item>
+ <item> final </item>
+ <item> throws </item>
+ <item> extends </item>
+ <item> expands </item>
+ <item> public </item>
+ <item> protected </item>
+ <item> private </item>
+ <item> abstract </item>
+ <item> case </item>
+ <item> default </item>
+ <item> final </item>
+ <item> simulated </item>
+ <item> Dot </item>
+ <item> nativereplication </item>
+ <item> replication </item>
+ <item> unreliable </item>
+ <item> reliable </item>
+ <item> ignores </item>
+ <item> localized </item>
+ <item> latent </item>
+ <item> singular </item>
+ <item> Cross </item>
+ <item> config </item>
+ <item> enum </item>
+ <item> struct </item>
+ <item> operator </item>
+ <item> preoperator </item>
+ <item> postoperator </item>
+ <item> iterator </item>
+ <item> coerce </item>
+ <item> optional </item>
+ <item> const </item>
+ <item> editconst </item>
+ <item> array </item>
+ <item> export </item>
+ <item> editinline </item>
+ <item> editinlinenew </item>
+ <item> editinlineuse </item>
+ <item> cpptext </item>
+ <item> placeable </item>
+ <item> virtual </item>
+ <item> hidecategories </item>
+ <item> super </item>
+ <item> global </item>
+ <item> none </item>
+ <item> self </item>
+ </list>
+
+ <list name="types">
+ <item> boolean </item>
+ <item> char </item>
+ <item> byte </item>
+ <item> short </item>
+ <item> int </item>
+ <item> long </item>
+ <item> float </item>
+ <item> double </item>
+ <item> void </item>
+ <item> Pawn </item>
+ <item> sound </item>
+ <item> ipaddr </item>
+ <item> ELightType </item>
+ <item> actor </item>
+ <item> ammo </item>
+ <item> bool </item>
+ <item> vector </item>
+ <item> rotator </item>
+ <item> name </item>
+ <item> string </item>
+ <item> object </item>
+ <item> plane </item>
+ <item> staticmesh </item>
+ <item> package </item>
+ <item> color </item>
+ <item> coords </item>
+ <item> material </item>
+ <item> class </item>
+ </list>
+ <contexts>
+ <context attribute="Normal Text" lineEndContext="#stay" name="Normal">
+ <keyword attribute="Keyword" context="#stay" String="keywords"/>
+ <keyword attribute="Data Type" context="#stay" String="types"/>
+ <Float attribute="Float" context="#stay">
+ <AnyChar String="fF" attribute="Float" context="#stay"/>
+ </Float>
+ <HlCOct attribute="Octal" context="#stay"/>
+ <HlCHex attribute="Hex" context="#stay"/>
+ <Int attribute="Decimal" context="#stay">
+ <StringDetect attribute="Decimal" context="#stay" String="ULL" insensitive="TRUE"/>
+ <StringDetect attribute="Decimal" context="#stay" String="LUL" insensitive="TRUE"/>
+ <StringDetect attribute="Decimal" context="#stay" String="LLU" insensitive="TRUE"/>
+ <StringDetect attribute="Decimal" context="#stay" String="UL" insensitive="TRUE"/>
+ <StringDetect attribute="Decimal" context="#stay" String="LU" insensitive="TRUE"/>
+ <StringDetect attribute="Decimal" context="#stay" String="LL" insensitive="TRUE"/>
+ <StringDetect attribute="Decimal" context="#stay" String="U" insensitive="TRUE"/>
+ <StringDetect attribute="Decimal" context="#stay" String="L" insensitive="TRUE"/>
+ </Int>
+ <HlCChar attribute="Char" context="#stay"/>
+ <RegExpr attribute="Region Marker" context="#stay" String="//BEGIN.*$" beginRegion="Region1"/>
+ <RegExpr attribute="Region Marker" context="#stay" String="//END.*$" endRegion="Region1"/>
+ <DetectChar attribute="String" context="String" char="&quot;"/>
+ <DetectChar attribute="String" context="String" char="&#39;"/>
+ <Detect2Chars attribute="Comment" context="Commentar 1" char="/" char1="/"/>
+ <Detect2Chars attribute="Comment" context="Commentar 2" char="/" char1="*" beginRegion="Comment"/>
+ <DetectChar attribute="Normal Text" context="#stay" char="{" beginRegion="Brace1"/>
+ <DetectChar attribute="Normal Text" context="#stay" char="}" endRegion="Brace1"/>
+ <AnyChar attribute="Symbol" context="#stay" String="!%&amp;()+,-&lt;=&gt;?[]^{|}~"/>
+ <RegExpr attribute="Preprocessor" context="Preprocessor" insensitive="TRUE" String="#exec"/>
+ </context>
+ <context attribute="String" lineEndContext="#pop" name="String">
+ <LineContinue attribute="String" context="#stay"/>
+ <HlCStringChar attribute="String Char" context="#stay"/>
+ <DetectChar attribute="String" context="#pop" char="&quot;"/>
+ <DetectChar attribute="String" context="#pop" char="&#39;"/>
+ </context>
+ <context attribute="Comment" lineEndContext="#pop" name="Commentar 1"/>
+ <context attribute="Comment" lineEndContext="#stay" name="Commentar 2">
+ <Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" endRegion="Comment"/>
+ </context>
+ <context attribute="Preprocessor" lineEndContext="#pop" name="Preprocessor">
+ <Detect2Chars attribute="Comment" context="Commentar 1" char="/" char1="/"/>
+ <Detect2Chars attribute="Comment" context="Commentar 2" char="/" char1="*"/>
+ </context>
+ </contexts>
+ <itemDatas>
+ <itemData name="Normal Text" defStyleNum="dsNormal"/>
+ <itemData name="Keyword" defStyleNum="dsKeyword"/>
+ <itemData name="Data Type" defStyleNum="dsDataType"/>
+ <itemData name="Decimal" defStyleNum="dsDecVal"/>
+ <itemData name="Octal" defStyleNum="dsBaseN"/>
+ <itemData name="Hex" defStyleNum="dsBaseN"/>
+ <itemData name="Float" defStyleNum="dsFloat"/>
+ <itemData name="Char" defStyleNum="dsChar"/>
+ <itemData name="String" defStyleNum="dsString"/>
+ <itemData name="String Char" defStyleNum="dsChar"/>
+ <itemData name="Comment" defStyleNum="dsComment"/>
+ <itemData name="Symbol" defStyleNum="dsNormal"/>
+ <itemData name="Preprocessor" defStyleNum="dsOthers"/>
+ <itemData name="Region Marker" defStyleNum="dsRegionMarker" />
+ </itemDatas>
+ </highlighting>
+ <general>
+ <comments>
+ <comment name="singleLine" start="//"/>
+ <comment name="multiLine" start="/*" end="*/"/>
+ </comments>
+ <keywords casesensitive="0" additionalDeliminator="&quot;&#39;"/>
+ </general>
+</language>
+
diff --git a/kate/data/velocity.xml b/kate/data/velocity.xml
new file mode 100644
index 000000000..dc2424ec5
--- /dev/null
+++ b/kate/data/velocity.xml
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+<language name="Velocity" version="1.04" kateversion="2.1" section="Scripts" extensions="*.vm;" mimetype="text/x-velocity-src;text/x-vm-src" author="John Christopher (John@animalsinneed.net)" license="">
+ <highlighting>
+ <list name="keywords">
+ <item> #set </item>
+ <item> #foreach </item>
+ <item> #end </item>
+ <item> #if </item>
+ <item> #else </item>
+ <item> #elseif </item>
+ <item> #parse </item>
+ <item> #macro </item>
+ <item> #stop </item>
+ <item> #include </item>
+ </list>
+ <contexts>
+ <context attribute="Normal Text" lineEndContext="#stay" name="Keyword">
+ <keyword attribute="Keyword" context="#stay" String="keywords" />
+ <RegExpr attribute="Variable" context="#stay" String="\$[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff\.\-]*(\[[a-zA-Z0-9_]*\])*" />
+ <RegExpr attribute="Variable" context="#stay" String="\$\{[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff\.\-]*(\[[a-zA-Z0-9_]*\])*\}" />
+ <RegExpr attribute="Variable" context="#stay" String="\$!\{[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff\.\-]*(\[[a-zA-Z0-9_]*\])*\}." />
+ <RegExpr attribute="Variable" context="#stay" String="\{\$[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff\.\-]*(\[([0-9]*|&quot;[a-zA-Z_]*&quot;)|'[a-zA-Z_]*'|\])*(->[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*(\[[a-zA-Z0-9_]*\])*(\[([0-9]*|&quot;[a-zA-Z_]*&quot;)|'[a-zA-Z_]*'|\])*)*\}" />
+ <RegExpr attribute="Properties" context="#stay" String="[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff\-]*(\[[a-zA-Z0-9_]*\])*\.[a-zA-Z0-9_\x7f-\xff\-]*" />
+ <AnyChar attribute="Other" context="#stay" String="(),[]" />
+ <Detect2Chars attribute="Comment" context="singleline comment" char="#" char1="#" />
+ <Detect2Chars attribute="Comment" context="multilinecomment" char="#" char1="&#42;" />
+ </context>
+ <context attribute="Comment" name="singleline comment" lineEndContext="#pop">
+ </context>
+ <context attribute="Comment" lineEndContext="#stay" name="multilinecomment" >
+ <Detect2Chars attribute="Comment" context="#pop" char="*" char1="#" />
+ </context>
+ </contexts>
+ <itemDatas>
+ <itemData name="Normal Text" defStyleNum="dsNormal" />
+ <itemData name="Keyword" defStyleNum="dsKeyword" />
+ <itemData name="Variable" defStyleNum="dsKeyword" color="#5555FF" selColor="#ffffff" bold="0" italic="0" />
+ <itemData name="Other" defStyleNum="dsOthers" />
+ <itemData name="Properties" defStyleNum="dsNormal" color="#8AC6FF" selColor="#ffffff" bold="0" italic="1"/>
+ <itemData name="Comment" defStyleNum="dsComment" />
+ </itemDatas>
+ </highlighting>
+ <general>
+ <comments>
+ <comment name="singleLine" start="##" />
+ <comment name="multiLine" start="#*" end="*#" />
+ </comments>
+ <keywords casesensitive="1" weakDeliminator="+"/>
+ </general>
+</language>
diff --git a/kate/data/verilog.xml b/kate/data/verilog.xml
new file mode 100644
index 000000000..c7795c1a0
--- /dev/null
+++ b/kate/data/verilog.xml
@@ -0,0 +1,227 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+<language name="Verilog" version="1.07" kateversion="2.4" section="Hardware" extensions="*.v;*.V;*.vl" mimetype="text/x-verilog-src" author="Yevgen Voronenko (ysv22@drexel.edu)" license="">
+ <highlighting>
+ <list name="keywords">
+ <item> module </item>
+ <item> macromodule </item>
+ <item> endmodule </item>
+ <item> task </item>
+ <item> endtask </item>
+ <item> function </item>
+ <item> endfunction </item>
+ <item> table </item>
+ <item> endtable </item>
+ <item> specify </item>
+ <item> specparam </item>
+ <item> endspecify </item>
+ <item> case </item>
+ <item> casex </item>
+ <item> casez </item>
+ <item> endcase </item>
+ <item> fork </item>
+ <item> join </item>
+
+ <item> defparam </item>
+ <item> default </item>
+ <item> begin </item>
+ <item> end </item>
+ <item> if </item>
+ <item> ifnone </item>
+ <item> else </item>
+ <item> forever </item>
+ <item> while </item>
+ <item> for </item>
+ <item> wait </item>
+ <item> repeat </item>
+ <item> disable </item>
+
+ <item> assign </item>
+ <item> deassign </item>
+ <item> force </item>
+ <item> release </item>
+
+ <item> always </item>
+ <item> initial </item>
+ <item> edge </item>
+ <item> posedge </item>
+ <item> negedge </item>
+ </list>
+
+ <list name="strength">
+ <!-- drive strength supply0/supply1 omitted, its in types.. -->
+ <item> strong0 </item>
+ <item> strong1 </item>
+ <item> pull0 </item>
+ <item> pull1 </item>
+ <item> weak0 </item>
+ <item> weak1 </item>
+ <item> highz0 </item>
+ <item> highz1 </item>
+ <!-- charge strength -->
+ <item> small </item>
+ <item> medium </item>
+ <item> large </item>
+ </list>
+
+ <list name="gates">
+ <item> pullup </item>
+ <item> pulldown </item>
+ <item> cmos </item>
+ <item> rcmos </item>
+ <item> nmos </item>
+ <item> pmos </item>
+ <item> rnmos </item>
+ <item> rpmos </item>
+ <item> and </item>
+ <item> nand </item>
+ <item> or </item>
+ <item> nor </item>
+ <item> xor </item>
+ <item> xnor </item>
+ <item> not </item>
+ <item> buf </item>
+ <item> tran </item>
+ <item> rtran </item>
+ <item> tranif0 </item>
+ <item> tranif1 </item>
+ <item> rtranif0 </item>
+ <item> rtranif1 </item>
+ <item> bufif0 </item>
+ <item> bufif1 </item>
+ <item> notif0 </item>
+ <item> notif1 </item>
+ </list>
+
+ <list name="types">
+ <!-- port direction -->
+ <item> input </item>
+ <item> output </item>
+ <item> inout </item>
+ <!-- net type -->
+ <item> wire </item>
+ <item> tri </item>
+ <item> tri0 </item>
+ <item> tri1 </item>
+ <item> wand </item>
+ <item> wor </item>
+ <item> triand </item>
+ <item> trior </item>
+ <item> supply0 </item>
+ <item> supply1 </item>
+ <!-- reg/variable -->
+ <item> reg </item>
+ <item> integer </item>
+ <item> real </item>
+ <item> realtime </item>
+ <item> time </item>
+ <!-- modifier -->
+ <item> vectored </item>
+ <item> scalared </item>
+ <item> trireg </item>
+ <!-- other -->
+ <item> parameter </item>
+ <item> event </item>
+ </list>
+
+ <contexts>
+ <context attribute="Normal Text" lineEndContext="#stay" name="Normal">
+ <RegExpr attribute="Keyword" context="Block name" String="begin\ *:"/>
+ <keyword attribute="Keyword" context="#stay" String="keywords" />
+ <keyword attribute="Data Type" context="#stay" String="types" />
+ <keyword attribute="Drive/charge strength" context="#stay" String="strength" />
+ <keyword attribute="Gate instantiation" context="#stay" String="gates" />
+
+ <RegExpr attribute="Normal Text" context="#stay" String="[a-zA-Z]+[\w$]*"/>
+ <RegExpr attribute="Normal Text" context="#stay" String="\\[^ ]+ "/>
+
+ <RegExpr attribute="Decimal" context="#stay" String="[\d_]*'d[\d_]+"/>
+ <RegExpr attribute="Octal" context="#stay" String="[\d_]*'o[0-7xXzZ_]+"/>
+ <RegExpr attribute="Hex" context="#stay" String="[\d_]*'h[\da-fA-FxXzZ_]+"/>
+ <RegExpr attribute="Binary" context="#stay" String="[\d_]*'b[01_zZxX]+"/>
+ <Float attribute="Float" context="#stay"/>
+ <Int attribute="Integer" context="#stay" />
+
+ <RegExpr attribute="Port connection" context="#stay" String="[^\w$]\.[a-zA-Z]+[\w$]*"/>
+
+ <DetectChar attribute="String" context="String" char="&quot;"/>
+ <Detect2Chars attribute="Comment" context="Commentar 1" char="/" char1="/"/>
+ <Detect2Chars attribute="Comment" context="Commentar 2" char="/" char1="*"/>
+ <AnyChar attribute="Symbol" context="#stay" String="!%&amp;()+,-&lt;=+/:;&gt;?[]^{|}~@"/>
+
+ <StringDetect attribute="Comment" context="Some Context2" String="#if 0" insensitive="FALSE" firstNonSpace="true"/>
+
+ <DetectChar attribute="Preprocessor" context="Preprocessor" char="`" column="0"/>
+ <RegExpr attribute="Preprocessor" context="#stay" String="\`[a-zA-Z_]+\w*" />
+ <RegExpr attribute="System Task" context="#stay" String="\$[a-zA-Z_]+\w*" />
+ <RegExpr attribute="Delay" context="#stay" String="#[\d_]+" />
+ </context>
+ <context attribute="String" lineEndContext="#pop" name="String">
+ <LineContinue attribute="String" context="Some Context"/>
+ <HlCStringChar attribute="String Char" context="#stay"/>
+ <DetectChar attribute="String" context="#pop" char="&quot;"/>
+ </context>
+ <context attribute="Comment" lineEndContext="#pop" name="Commentar 1">
+ <RegExpr attribute="Alert" context="#stay" String="(FIXME|TODO)" />
+ </context>
+ <context attribute="Comment" lineEndContext="#stay" name="Commentar 2">
+ <RegExpr attribute="Alert" context="#stay" String="(FIXME|TODO)" />
+ <Detect2Chars attribute="Comment" context="#pop" char="*" char1="/"/>
+ </context>
+ <context attribute="Preprocessor" lineEndContext="#pop" name="Preprocessor">
+ <LineContinue attribute="Preprocessor" context="Some Context"/>
+ <RangeDetect attribute="Prep. Lib" context="#stay" char="&quot;" char1="&quot;"/>
+ <RangeDetect attribute="Prep. Lib" context="#stay" char="&lt;" char1="&gt;"/>
+ <Detect2Chars attribute="Comment" context="Commentar 1" char="/" char1="/"/>
+ <Detect2Chars attribute="Comment" context="Commentar/Preprocessor" char="/" char1="*"/>
+ </context>
+ <context attribute="Comment" lineEndContext="#stay" name="Commentar/Preprocessor">
+ <Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" />
+ </context>
+ <context attribute="Normal Text" lineEndContext="#pop" name="Some Context"/>
+ <context attribute="Comment" lineEndContext="#stay" name="Some Context2">
+ <RegExpr attribute="Alert" context="#stay" String="(FIXME|TODO)" />
+ <StringDetect attribute="Comment" context="#pop" String="#endif" firstNonSpace="true"/>
+ </context>
+
+ <context attribute="Block name" lineEndContext="#pop" name="Block name">
+ <RegExpr attribute="Data Type" context="#pop" String="[^ ]+"/>
+ </context>
+ </contexts>
+
+ <itemDatas>
+ <itemData name="Normal Text" defStyleNum="dsNormal"/>
+ <itemData name="Keyword" defStyleNum="dsKeyword"/>
+ <itemData name="Data Type" defStyleNum="dsDataType"/>
+
+ <itemData name="Decimal" defStyleNum="dsBaseN"/>
+ <itemData name="Octal" defStyleNum="dsBaseN"/>
+ <itemData name="Hex" defStyleNum="dsBaseN"/>
+ <itemData name="Binary" defStyleNum="dsBaseN"/>
+ <itemData name="Float" defStyleNum="dsFloat"/>
+
+ <itemData name="String" defStyleNum="dsString"/>
+ <itemData name="String Char" defStyleNum="dsChar"/>
+ <itemData name="Comment" defStyleNum="dsComment"/>
+ <itemData name="Alert" defStyleNum="dsAlert" />
+ <itemData name="Symbol" defStyleNum="dsNormal"/>
+ <itemData name="Preprocessor" defStyleNum="dsOthers"/>
+ <itemData name="Prep. Lib" defStyleNum="dsFloat"/>
+ <itemData name="System Task" defStyleNum="dsDataType"/>
+
+ <itemData name="Integer" defStyleNum="dsDecVal"/>
+ <itemData name="Delay" defStyleNum="dsBaseN"/>
+ <itemData name="Block name" defStyleNum="dsDataType"/>
+ <itemData name="Drive/charge strength" defStyleNum="dsBaseN"/>
+ <itemData name="Gate instantiation" defStyleNum="dsDataType"/>
+ <itemData name="Port connection" defStyleNum="dsDataType"/>
+ </itemDatas>
+ </highlighting>
+ <general>
+ <comments>
+ <comment name="singleLine" start="//" />
+ <comment name="multiLine" start="/*" end="*/" />
+ </comments>
+ <keywords casesensitive="1" />
+ </general>
+</language>
diff --git a/kate/data/vhdl.xml b/kate/data/vhdl.xml
new file mode 100644
index 000000000..8dd836cd1
--- /dev/null
+++ b/kate/data/vhdl.xml
@@ -0,0 +1,286 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+<language name="VHDL" version="1.04" kateversion="2.1" section="Hardware" extensions="*.vhdl;*.vhd" mimetype="text/x-vhdl">
+ <highlighting>
+ <list name="keywords">
+ <item> access </item>
+ <item> after </item>
+ <item> alias </item>
+ <item> all </item>
+ <item> assert </item>
+ <item> architecture </item>
+ <item> begin </item>
+ <item> block </item>
+ <item> body </item>
+ <item> buffer </item>
+ <item> bus </item>
+ <item> case </item>
+ <item> component </item>
+ <item> configuration </item>
+ <item> constant </item>
+ <item> disconnect </item>
+ <item> downto </item>
+ <item> else </item>
+ <item> elsif </item>
+ <item> end </item>
+ <item> entity </item>
+ <item> exit </item>
+ <item> file </item>
+ <item> for </item>
+ <item> function </item>
+ <item> generate </item>
+ <item> generic </item>
+ <item> group </item>
+ <item> guarded </item>
+ <item> if </item>
+ <item> impure </item>
+ <item> in </item>
+ <item> inertial </item>
+ <item> inout </item>
+ <item> is </item>
+ <item> label </item>
+ <item> library </item>
+ <item> linkage </item>
+ <item> literal </item>
+ <item> loop </item>
+ <item> map </item>
+ <item> new </item>
+ <item> next </item>
+ <item> null </item>
+ <item> of </item>
+ <item> on </item>
+ <item> open </item>
+ <item> others </item>
+ <item> out </item>
+ <item> package </item>
+ <item> port </item>
+ <item> postponed </item>
+ <item> procedure </item>
+ <item> process </item>
+ <item> pure </item>
+ <item> range </item>
+ <item> record </item>
+ <item> register </item>
+ <item> reject </item>
+ <item> report </item>
+ <item> return </item>
+ <item> select </item>
+ <item> severity </item>
+ <item> signal </item>
+ <item> shared </item>
+ <item> subtype </item>
+ <item> then </item>
+ <item> to </item>
+ <item> transport </item>
+ <item> type </item>
+ <item> unaffected </item>
+ <item> units </item>
+ <item> until </item>
+ <item> use </item>
+ <item> variable </item>
+ <item> wait </item>
+ <item> when </item>
+ <item> while </item>
+ <item> with </item>
+ <item> note </item>
+ <item> warning </item>
+ <item> error </item>
+ <item> failure </item>
+ <item> ACCESS </item>
+ <item> AFTER </item>
+ <item> ALIAS </item>
+ <item> ALL </item>
+ <item> ASSERT </item>
+ <item> ARCHITECTURE </item>
+ <item> BEGIN </item>
+ <item> BLOCK </item>
+ <item> BODY </item>
+ <item> BUFFER </item>
+ <item> BUS </item>
+ <item> CASE </item>
+ <item> COMPONENT </item>
+ <item> CONFIGURATION </item>
+ <item> CONSTANT </item>
+ <item> DISCONNECT </item>
+ <item> DOWNTO </item>
+ <item> ELSE </item>
+ <item> ELSIF </item>
+ <item> END </item>
+ <item> ENTITY </item>
+ <item> EXIT </item>
+ <item> FILE </item>
+ <item> FOR </item>
+ <item> FUNCTION </item>
+ <item> GENERATE </item>
+ <item> GENERIC </item>
+ <item> GROUP </item>
+ <item> GUARDED </item>
+ <item> IF </item>
+ <item> IMPURE </item>
+ <item> IN </item>
+ <item> INERTIAL </item>
+ <item> INOUT </item>
+ <item> IS </item>
+ <item> LABEL </item>
+ <item> LIBRARY </item>
+ <item> LINKAGE </item>
+ <item> LITERAL </item>
+ <item> LOOP </item>
+ <item> MAP </item>
+ <item> NEW </item>
+ <item> NEXT </item>
+ <item> NULL </item>
+ <item> OF </item>
+ <item> ON </item>
+ <item> OPEN </item>
+ <item> OTHERS </item>
+ <item> OUT </item>
+ <item> PACKAGE </item>
+ <item> PORT </item>
+ <item> POSTPONED </item>
+ <item> PROCEDURE </item>
+ <item> PROCESS </item>
+ <item> PURE </item>
+ <item> RANGE </item>
+ <item> RECORD </item>
+ <item> REGISTER </item>
+ <item> REJECT </item>
+ <item> REPORT </item>
+ <item> RETURN </item>
+ <item> SELECT </item>
+ <item> SEVERITY </item>
+ <item> SIGNAL </item>
+ <item> SHARED </item>
+ <item> SUBTYPE </item>
+ <item> THEN </item>
+ <item> TO </item>
+ <item> TRANSPORT </item>
+ <item> TYPE </item>
+ <item> UNAFFECTED </item>
+ <item> UNITS </item>
+ <item> UNTIL </item>
+ <item> USE </item>
+ <item> VARIABLE </item>
+ <item> WAIT </item>
+ <item> WHEN </item>
+ <item> WHILE </item>
+ <item> WITH </item>
+ <item> NOTE </item>
+ <item> WARNING </item>
+ <item> ERROR </item>
+ <item> FAILURE </item>
+ <item> and </item>
+ <item> or </item>
+ <item> xor </item>
+ <item> not </item>
+ <item> AND </item>
+ <item> OR </item>
+ <item> XOR </item>
+ <item> NOT </item>
+ </list>
+ <list name="types">
+ <item> bit </item>
+ <item> bit_vector </item>
+ <item> character </item>
+ <item> boolean </item>
+ <item> integer </item>
+ <item> real </item>
+ <item> time </item>
+ <item> string </item>
+ <item> severity_level </item>
+ <item> positive </item>
+ <item> natural </item>
+ <item> signed </item>
+ <item> unsigned </item>
+ <item> line </item>
+ <item> text </item>
+ <item> std_logic </item>
+ <item> std_logic_vector </item>
+ <item> std_ulogic </item>
+ <item> std_ulogic_vector </item>
+ <item> qsim_state </item>
+ <item> qsim_state_vector </item>
+ <item> qsim_12state </item>
+ <item> qsim_12state_vector </item>
+ <item> qsim_strength </item>
+ <item> mux_bit </item>
+ <item> mux_vector </item>
+ <item> reg_bit </item>
+ <item> reg_vector </item>
+ <item> wor_bit </item>
+ <item> wor_vector </item>
+ <item> BIT </item>
+ <item> BIT_VECTOR </item>
+ <item> CHARACTER </item>
+ <item> BOOLEAN </item>
+ <item> INTEGER </item>
+ <item> REAL </item>
+ <item> TIME </item>
+ <item> STRING </item>
+ <item> SEVERITY_LEVEL </item>
+ <item> POSITIVE </item>
+ <item> NATURAL </item>
+ <item> SIGNED </item>
+ <item> UNSIGNED </item>
+ <item> LINE </item>
+ <item> TEXT </item>
+ <item> STD_LOGIC </item>
+ <item> STD_LOGIC_VECTOR </item>
+ <item> STD_ULOGIC </item>
+ <item> STD_ULOGIC_VECTOR </item>
+ <item> QSIM_STATE </item>
+ <item> QSIM_STATE_VECTOR </item>
+ <item> QSIM_12STATE </item>
+ <item> QSIM_12STATE_VECTOR </item>
+ <item> QSIM_STRENGTH </item>
+ <item> MUX_BIT </item>
+ <item> MUX_VECTOR </item>
+ <item> REG_BIT </item>
+ <item> REG_VECTOR </item>
+ <item> WOR_BIT </item>
+ <item> WOR_VECTOR </item>
+ </list>
+ <contexts>
+ <context name="normal" attribute="Normal Text" lineEndContext="#stay">
+ <keyword attribute="Keyword" context="#stay" String="keywords"/>
+ <keyword attribute="Data Type" context="#stay" String="types"/>
+ <Detect2Chars attribute="Comment" context="comment" char="-" char1="-" />
+ <Int attribute="Integer" context="#stay" />
+ <HlCChar attribute="Bit" context="#stay" />
+ <DetectChar attribute="Vector" context="string" char="&quot;" />
+ <AnyChar attribute="Operator" context="#stay" String="[&amp;&gt;&lt;=:+\-*\/|]().,;" />
+ <DetectChar attribute="Attribute" context="attribute" char="'" />
+ </context>
+ <context name="comment" attribute="Comment" lineEndContext="#pop" />
+ <context name="string" attribute="Vector" lineEndContext="#stay" >
+ <DetectChar attribute="Vector" context="#pop" char="&quot;" />
+ </context>
+ <context name="attribute" attribute="Attribute" lineEndContext="#pop">
+ <DetectChar attribute="Attribute" context="quot in att" char="&quot;" />
+ <DetectChar attribute="Normal Text" context="#pop" char=" " />
+ <AnyChar attribute="Attribute" context="#pop" String=")=&lt;&gt;" />
+ </context>
+ <context name="quot in att" attribute="Attribute" lineEndContext="#stay">
+ <DetectChar attribute="Attribute" context="#pop" char="&quot;" />
+ </context>
+ </contexts>
+ <itemDatas>
+ <itemData name="Normal Text" defStyleNum="dsNormal" />
+ <itemData name="Keyword" defStyleNum="dsKeyword" />
+ <itemData name="Data Type" defStyleNum="dsDataType" />
+ <itemData name="Comment" defStyleNum="dsComment" />
+ <itemData name="Integer" defStyleNum="dsDecVal" />
+ <itemData name="Bit" defStyleNum="dsChar" />
+ <itemData name="Vector" defStyleNum="dsString" />
+ <itemData name="Operator" defStyleNum="dsOthers" />
+ <itemData name="Attribute" defStyleNum="dsBaseN" />
+ </itemDatas>
+ </highlighting>
+ <general>
+ <comments>
+ <comment name="singleLine" start="--" />
+ </comments>
+ <keywords casesensitive="1" />
+ </general>
+</language>
+
diff --git a/kate/data/vrml.xml b/kate/data/vrml.xml
new file mode 100644
index 000000000..42012ca47
--- /dev/null
+++ b/kate/data/vrml.xml
@@ -0,0 +1,139 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+<language name="VRML" version="1.02" section="Markup" extensions="*.wrl" mimetype="model/vrml" author="Volker Krause (volker.krause@rwth-aachen.de)" license="LGPL">
+ <highlighting>
+ <list name="keywords">
+ <item>DEF</item>
+ <item>EXTERNPROTO</item>
+ <item>FALSE</item>
+ <item>IS</item>
+ <item>NULL</item>
+ <item>PROTO</item>
+ <item>ROUTE</item>
+ <item>TO</item>
+ <item>TRUE</item>
+ <item>USE</item>
+ <item>eventIn</item>
+ <item>eventOut</item>
+ <item>exposedField</item>
+ <item>field</item>
+ </list>
+ <list name="types">
+ <item>MFColor</item>
+ <item>MFFloat</item>
+ <item>MFInt32</item>
+ <item>MFNode</item>
+ <item>MFRotation</item>
+ <item>MFString</item>
+ <item>MFTime</item>
+ <item>MFVec2f</item>
+ <item>MFVec3f</item>
+ <item>SFBool</item>
+ <item>SFColor</item>
+ <item>SFFloat</item>
+ <item>SFImage</item>
+ <item>SFInt32</item>
+ <item>SFNode</item>
+ <item>SFRotation</item>
+ <item>SFString</item>
+ <item>SFTime</item>
+ <item>SFVec2f</item>
+ <item>SFVec3f</item>
+ </list>
+ <list name="nodes">
+ <item>Anchor</item>
+ <item>AudioClip</item>
+ <item>Appearance</item>
+ <item>Background</item>
+ <item>Billboard</item>
+ <item>Box</item>
+ <item>Collision</item>
+ <item>Color</item>
+ <item>ColorInterpolator</item>
+ <item>Cone</item>
+ <item>Coordinate</item>
+ <item>CoordinateInterpolator</item>
+ <item>Cylinder</item>
+ <item>CylinderSensor</item>
+ <item>DirectionalLight</item>
+ <item>ElevationGrid</item>
+ <item>Extrusion</item>
+ <item>Fog</item>
+ <item>FontStyle</item>
+ <item>Group</item>
+ <item>ImageTexture</item>
+ <item>IndexedFaceSet</item>
+ <item>IndexedLineSet</item>
+ <item>Inline</item>
+ <item>LOD</item>
+ <item>Material</item>
+ <item>MovieTexture</item>
+ <item>NavigationInfo</item>
+ <item>Normal</item>
+ <item>NormalInterpolator</item>
+ <item>OrientationInterpolator</item>
+ <item>PixelTexture</item>
+ <item>Plane</item>
+ <item>PlaneSensor</item>
+ <item>PointLight</item>
+ <item>PointSet</item>
+ <item>PositionInterpolator</item>
+ <item>ProximitySensor</item>
+ <item>ScalarInterpolator</item>
+ <item>Script</item>
+ <item>Shape</item>
+ <item>Sensor</item>
+ <item>Sound</item>
+ <item>Sphere</item>
+ <item>SphereSensor</item>
+ <item>SpotLight</item>
+ <item>Switch</item>
+ <item>Text</item>
+ <item>TextureCoordinate</item>
+ <item>TextureTransform</item>
+ <item>TimeSensor</item>
+ <item>TouchSensor</item>
+ <item>Transform</item>
+ <item>Viewpoint</item>
+ <item>VisibilitySensor</item>
+ <item>WorldInfo</item>
+ </list>
+ <contexts>
+ <context name="Normal" attribute="Normal Text" lineEndContext="#stay">
+ <keyword attribute="Keyword" context="#stay" String="keywords"/>
+ <keyword attribute="Node" context="#stay" String="nodes"/>
+ <keyword attribute="Data Type" context="#stay" String="types"/>
+ <Float attribute="Float" context="#stay"/>
+ <HlCHex attribute="Hex" context="#stay"/>
+ <Int attribute="Decimal" context="#stay"/>
+ <DetectChar attribute="Normal Text" context="#stay" char="{" beginRegion="Brace"/>
+ <DetectChar attribute="Normal Text" context="#stay" char="}" endRegion="Brace"/>
+ <DetectChar attribute="String" context="String" char="&quot;"/>
+ <DetectChar attribute="Comment" context="Comment" char="#"/>
+ </context>
+ <context name="Comment" attribute="Comment" lineEndContext="#pop"/>
+ <context attribute="String" lineEndContext="#stay" name="String">
+ <LineContinue attribute="String" context="#stay"/>
+ <HlCStringChar attribute="String Char" context="#stay"/>
+ <DetectChar attribute="String" context="#pop" char="&quot;"/>
+ </context>
+ </contexts>
+ <itemDatas>
+ <itemData name="Normal Text" defStyleNum="dsNormal"/>
+ <itemData name="Keyword" defStyleNum="dsKeyword"/>
+ <itemData name="Data Type" defStyleNum="dsDataType"/>
+ <itemData name="Decimal" defStyleNum="dsDecVal"/>
+ <itemData name="Hex" defStyleNum="dsBaseN"/>
+ <itemData name="Float" defStyleNum="dsFloat"/>
+ <itemData name="String" defStyleNum="dsString"/>
+ <itemData name="String Char" defStyleNum="dsChar"/>
+ <itemData name="Comment" defStyleNum="dsComment"/>
+ <itemData name="Node" defStyleNum="dsNormal" color="#000080" selColor="#FFFFFF" bold="1" italic="0"/>
+ </itemDatas>
+ </highlighting>
+ <general>
+ <comments>
+ <comment name="singleLine" start="#"/>
+ </comments>
+ </general>
+</language>
diff --git a/kate/data/winehq.xml b/kate/data/winehq.xml
new file mode 100644
index 000000000..07919a86a
--- /dev/null
+++ b/kate/data/winehq.xml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+<language name="WINE Config" version="1.03" kateversion="2.4" section="Configuration" extensions="*.reg" mimetype="">
+ <highlighting>
+ <contexts>
+ <context attribute="Normal Text" lineEndContext="#stay" name="Normal">
+ <RegExpr String="WINE REGISTRY Version.*$" attribute="RegistryBeginEnd" context="#stay" />
+ <RegExpr String="#\s*&lt;\s*wineconf\s*&gt;" attribute="RegistryBeginEnd" context="#stay" column="0"/>
+ <RegExpr String="#\s*&lt;\s*\/\s*wineconf\s*&gt;" attribute="RegistryBeginEnd" context="#stay" column="0"/>
+ <RegExpr String="\[.*\]$" attribute="Section" context="#stay" column="0"/>
+ <RegExpr String=";.*$" attribute="Comment" context="#stay"/>
+
+ <RegExpr String="\s*&quot;\s*[a-zA-Z0-9_.:*]*\s*&quot;" attribute="Key" context="#stay" />
+
+ <DetectChar char="=" attribute="Normal Text" context="Value"/>
+ </context>
+
+ <context attribute="Normal Text" lineEndContext="#pop" name="Value">
+ <RegExpr String="\s*&quot;.*&quot;" attribute="Value" context="#stay" />
+ <RegExpr String=";.*$" attribute="Comment" context="#stay"/>
+ </context>
+
+ </contexts>
+ <itemDatas>
+ <itemData name="Normal Text" defStyleNum="dsNormal"/>
+ <itemData name="Section" defStyleNum="dsKeyword"/>
+ <itemData name="Key" defStyleNum="dsDataType"/>
+ <itemData name="Value" defStyleNum="dsNormal" color="#0000FF" selColor="#ffffff" italic="0" bold="1"/>
+ <itemData name="Comment" defStyleNum="dsComment"/>
+ <itemData name="ValueFilesystem1" defStyleNum="dsNormal" color="#00AA00" selColor="#ffffff" italic="0" bold="1"/>
+ <itemData name="ValueFilesystem2" defStyleNum="dsNormal" color="#FF0000" selColor="#ffffff" italic="0" bold="1"/>
+ <itemData name="RegistryBeginEnd" defStyleNum="dsNormal" color="#00AAAA" selColor="#ffffff" italic="0" bold="1"/>
+ </itemDatas>
+ </highlighting>
+</language>
+<!-- kate: space-indent on; indent-width 2; replace-tabs on; -->
diff --git a/kate/data/xharbour.xml b/kate/data/xharbour.xml
new file mode 100644
index 000000000..02ed03ee0
--- /dev/null
+++ b/kate/data/xharbour.xml
@@ -0,0 +1,543 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+<language name="xHarbour" version="1.04" kateversion="2.4" section="Sources" extensions="*.prg;*.PRG;*.ch" mimetype="text/x-xharbour-src" priority="5" author="Giancarlo Niccolai (giancarlo@niccolai.ws)" license="GPL">
+<highlighting>
+
+ <list name="keywords">
+ <item> local </item>
+ <item> global </item>
+ <item> extern </item>
+ <item> field </item>
+ <item> each </item>
+ <item> as </item>
+ <item> set </item>
+ <item> clear </item>
+ <item> screen </item>
+ <item> databases </item>
+ <item> all </item>
+ <item> close </item>
+ <item> color </item>
+ <item> date </item>
+ <item> else </item>
+ <item> elseif </item>
+ <item> in </item>
+ <item> to </item>
+ <item> do </item>
+ <item> loop </item>
+ <item> catch </item>
+ <item> exit </item>
+ <item> box </item>
+ <item> say </item>
+ <item> case </item>
+ <item> switch </item>
+ <item> self </item>
+ <item> super </item>
+ <item> say </item>
+ <item> get </item>
+ <item> read </item>
+ <item> use </item>
+ <item> select </item>
+ <item> otherwise</item>
+ <item> index </item>
+ <item> alias </item>
+ <item> like </item>
+ <item> has </item>
+ <item> return </item>
+ <item> static </item>
+ <item> on </item>
+ <item> off </item>
+ <item> nil </item>
+ <item> ? </item>
+ <item> class </item>
+ <item> external</item>
+ </list>
+
+ <list name="context_beginners">
+ <item> FOR </item>
+ <item> IF </item>
+ <item> SWITCH </item>
+ <item> WHILE </item>
+ <item> TRY </item>
+ <item> BEGIN </item>
+ <item> PROCEDURE </item>
+ <item> FUNCTION </item>
+ <item> METHOD </item>
+ </list>
+
+ <list name="context_terminators">
+ <item> NEXT </item>
+ <item> END </item>
+ <item> ENDIF </item>
+ <item> ENDDO </item>
+ <item> ENDCASE </item>
+ </list>
+
+ <list name="class_keywords">
+ <item> data </item>
+ <item> inline </item>
+ <item> method </item>
+ <item> classdata </item>
+ <item> init </item>
+ <item> from </item>
+ <item> hidden </item>
+ </list>
+
+ <list name="set_commands">
+ <item> INVALID </item>
+ <item> EXACT </item>
+ <item> FIXED </item>
+ <item> DECIMALS </item>
+ <item> DATEFORMAT </item>
+ <item> EPOCH </item>
+ <item> PATH </item>
+ <item> DEFAULT </item>
+ <item> EXCLUSIVE </item>
+ <item> SOFTSEEK </item>
+ <item> UNIQUE </item>
+ <item> DELETED </item>
+ <item> CANCEL </item>
+ <item> DEBUG </item>
+ <item> TYPEAHEAD </item>
+ <item> COLOR </item>
+ <item> CURSOR </item>
+ <item> CONSOLE </item>
+ <item> ALTERNATE </item>
+ <item> ALTFILE </item>
+ <item> DEVICE </item>
+ <item> EXTRA </item>
+ <item> EXTRAFILE </item>
+ <item> PRINTER </item>
+ <item> PRINTFILE </item>
+ <item> MARGIN </item>
+ <item> BELL </item>
+ <item> CONFIRM </item>
+ <item> ESCAPE </item>
+ <item> INSERT </item>
+ <item> EXIT </item>
+ <item> INTENSITY </item>
+ <item> SCOREBOARD </item>
+ <item> DELIMITERS </item>
+ <item> DELIMCHARS </item>
+ <item> WRAP </item>
+ <item> MESSAGE </item>
+ <item> MCENTER </item>
+ <item> SCROLLBREAK </item>
+ <item> EVENTMASK </item>
+ <item> VIDEOMODE </item>
+ <item> MBLOCKSIZE </item>
+ <item> MFILEEXT </item>
+ <item> STRICTREAD </item>
+ <item> OPTIMIZE </item>
+ <item> AUTOPEN </item>
+ <item> AUTORDER </item>
+ <item> AUTOSHARE </item>
+ <item> LANGUAGE </item>
+ <item> IDLEREPEAT </item>
+ <item> TRACE </item>
+ <item> TRACEFILE </item>
+ <item> TRACESTACK </item>
+ <item> FILECASE </item>
+ <item> DIRCASE </item>
+ <item> DIRSEPARATOR </item>
+ </list>
+
+ <list name="functions">
+ <item> aadd </item>
+ <item> adel </item>
+ <item> achoice </item>
+ <item> aclone </item>
+ <item> aeval </item>
+ <item> ains </item>
+ <item> ascan </item>
+ <item> asize </item>
+ <item> adir </item>
+ <item> afill </item>
+ <item> atail </item>
+ <item> asort </item>
+ <item> array </item>
+ <item> TAssociativeArray </item>
+
+ <item> bin21 </item>
+ <item> bin2l </item>
+ <item> bin2u </item>
+ <item> bin2w </item>
+ <item> i2bin </item>
+ <item> l2bin </item>
+ <item> u2bin </item>
+ <item> w2bin </item>
+
+ <item> eval </item>
+ <item> fieldblock </item>
+ <item> fieldwblock </item>
+
+ <item> inkey </item>
+ <item> lastkey </item>
+ <item> mcol </item>
+ <item> mrow </item>
+ <item> nextkey </item>
+
+ <item> empty </item>
+ <item> word </item>
+ <item> descend </item>
+ <item> __dbdelim </item>
+ <item> __dbsdf </item>
+
+ <item> os </item>
+ <item> __run </item>
+
+ <item> alert </item>
+ <item> browse </item>
+ <item> dbedit </item>
+ <item> outerr </item>
+ <item> outstd </item>
+ <item> readkey </item>
+ <item> readvar </item>
+ <item> __atprompt </item>
+ <item> __input </item>
+ <item> __menuto </item>
+ <item> __nonoallert </item>
+ <item> __typefile </item>
+ <item> __xrestscreen </item>
+ <item> __xsavescreen </item>
+
+ <item> DBAPPEND </item>
+ <item> DBCLEARFILTER </item>
+ <item> DBCLOSEALL </item>
+ <item> DBCLOSEAREA </item>
+ <item> DBCOMMIT </item>
+ <item> DBCOMMITALL </item>
+ <item> DBCREATE </item>
+ <item> DBDELETE </item>
+ <item> DBEVAL </item>
+ <item> DBF </item>
+ <item> DBFILTER </item>
+ <item> DBGOBOTTOM </item>
+ <item> DBGOTO </item>
+ <item> DBGOTOP </item>
+ <item> DBRECALL </item>
+ <item> DBRLOCK </item>
+ <item> DBRLOCKLIST </item>
+ <item> DBRUNLOCK </item>
+ <item> DBSEEK </item>
+ <item> DBSELECTAREA </item>
+ <item> DBSETDRIVER </item>
+ <item> DBSETFILTER </item>
+ <item> DBSKIP </item>
+ <item> DBSTRUCT </item>
+ <item> DBUNLOCK </item>
+ <item> DBUNLOCKALL </item>
+ <item> DBUSEAREA </item>
+ <item> INDEXEXT </item>
+ <item> INDEXKEY </item>
+ <item> INDEXORD </item>
+ <item> ORDBAGEXT </item>
+ <item> ORDBAGNAME </item>
+ <item> ORDCONDSET </item>
+ <item> ORDCREATE </item>
+ <item> ORDDESTROY </item>
+ <item> ORDFOR </item>
+ <item> ORDKEY </item>
+ <item> ORDLISTADD </item>
+ <item> ORDLISTCLEAR </item>
+ <item> ORDLISTREBUILD </item>
+ <item> ORDNAME </item>
+ <item> ORDNUMBER </item>
+ <item> ORDSETFOCUS </item>
+ <item> RDDLIST </item>
+ <item> RDDNAME </item>
+ <item> RDDSETDEFAULT </item>
+ <item> __DBCONTINUE </item>
+ <item> __DBZAP </item>
+ <item> __FLEDIT </item>
+ <item> __RDDSETDEFAULT </item>
+ <item> __dbCopyStruct </item>
+ <item> __dbCopyXStruct </item>
+ <item> __dbCreate </item>
+ <item> __dbStructFilter </item>
+ <item> dbSkipper </item>
+ <item> CDOW </item>
+ <item> CMONTH </item>
+ <item> CTOD </item>
+ <item> DATE </item>
+ <item> DAY </item>
+ <item> DAYS </item>
+ <item> DOW </item>
+ <item> DTOC </item>
+ <item> DTOS </item>
+ <item> MONTH </item>
+ <item> YEAR </item>
+
+ <item> GETENV </item>
+ <item> SET </item>
+ <item> SETMODE </item>
+ <item> SETTYPEAHEAD </item>
+ <item> VERSION </item>
+ <item> __SETCENTURY </item>
+ <item> __SetFunction </item>
+
+ <item> break </item>
+ <item> errorsys </item>
+ <item> throw </item>
+ <item> errornew </item>
+
+ <item> HB_SETKEYSAVE </item>
+ <item> HB_SetKeyCheck </item>
+ <item> HB_SetKeyGet </item>
+ <item> SETKEY </item>
+ <item> __QUIT </item>
+ <item> __WAIT </item>
+
+ <item> file </item>
+ <item> frename </item>
+ <item> __dir </item>
+
+ <item> col </item>
+ <item> maxcol </item>
+ <item> maxrow </item>
+ <item> row </item>
+ <item> hb_colorindex </item>
+
+ <item> CURDIR </item>
+ <item> DIRCHANGE </item>
+ <item> DIRREMOVE </item>
+ <item> DISKSPACE </item>
+ <item> FCLOSE </item>
+ <item> FCREATE </item>
+ <item> FERASE </item>
+ <item> FERROR </item>
+ <item> FOPEN </item>
+ <item> FREAD </item>
+ <item> FREADSTR </item>
+ <item> FSEEK </item>
+ <item> FWRITE </item>
+ <item> HB_DISKSPACE </item>
+ <item> HB_FEOF </item>
+ <item> ISDISK </item>
+ <item> MAKEDIR </item>
+
+ <item> ABS </item>
+ <item> EXP </item>
+ <item> INT </item>
+ <item> LOG </item>
+ <item> MAX </item>
+ <item> MIN </item>
+ <item> MOD </item>
+ <item> ROUND </item>
+ <item> SQRT </item>
+
+ <item> HB_ISBYREF </item>
+ <item> PROCFILE </item>
+ <item> PROCLINE </item>
+ <item> PROCNAME </item>
+ <item> TYPE </item>
+ <item> VALTYPE </item>
+ <item> valtoprg </item>
+ <item> tone </item>
+
+ <item> HB_LANGNAME </item>
+ <item> HB_LANGSELECT </item>
+ <item> ISAFFIRM </item>
+ <item> ISNEGATIVE </item>
+ <item> NATIONMSG </item>
+
+ <item> pcount </item>
+ <item> HB_pvalue </item>
+
+ <item> ALLTRIM </item>
+ <item> ASC </item>
+ <item> AT </item>
+ <item> CHR </item>
+ <item> HARDCR </item>
+ <item> HB_ANSITOOEM </item>
+ <item> HB_OEMTOANSI </item>
+ <item> HB_VALTOSTR </item>
+ <item> ISALPHA </item>
+ <item> ISDIGIT </item>
+ <item> ISLOWER </item>
+ <item> ISUPPER </item>
+ <item> LEFT </item>
+ <item> LEN </item>
+ <item> LOWER </item>
+ <item> LTRIM </item>
+ <item> MEMOTRAN </item>
+ <item> PADC </item>
+ <item> PADL </item>
+ <item> PADR </item>
+ <item> RAT </item>
+ <item> REPLICATE </item>
+ <item> RIGHT </item>
+ <item> RTRIM </item>
+ <item> SPACE </item>
+ <item> STR </item>
+ <item> STRTRAN </item>
+ <item> STRZERO </item>
+ <item> SUBSTR </item>
+ <item> TRANSFORM </item>
+ <item> TRIM </item>
+ <item> UPPER </item>
+ <item> VAL </item>
+
+ <item> devoutpict </item>
+
+ <item> elaptime </item>
+ <item> seconds </item>
+ <item> secs </item>
+ <item> time </item>
+
+ <item> do </item>
+
+ <item> ThreadStart </item>
+ <item> ThreadStop </item>
+ <item> ThreadSleep </item>
+ <item> ThreadKill </item>
+ <item> ThreadJoin </item>
+ <item> CreateMutex </item>
+ <item> DestroyMutex </item>
+ <item> MutexLock </item>
+ <item> MutexUnlock </item>
+ <item> Subscribe </item>
+ <item> SubscribeNow </item>
+ <item> Notify </item>
+ <item> NotifyAll </item>
+ <item> WaitForThreads </item>
+ <item> KillAllThreads </item>
+
+ <item> InetInit </item>
+ <item> InetCleanup </item>
+ <item> InetCreate </item>
+ <item> InetDestroy </item>
+ <item> InetConnect </item>
+ <item> InetServer </item>
+ <item> InetAccept </item>
+ <item> InetSetTimeout </item>
+ <item> InetGetTimeout </item>
+ <item> InetClearTimeout </item>
+ <item> InetRecv </item>
+ <item> InetRecvAll </item>
+ <item> InetSend </item>
+ <item> InetSendAll </item>
+ <item> InetDGram </item>
+ <item> InetDGramRecv </item>
+ <item> InetDGramSend </item>
+ <item> InetAddress </item>
+ <item> InetPort </item>
+ <item> InetError </item>
+ <item> InetErrorDesc </item>
+ <item> InetGetHosts </item>
+ <item> InetConnectIP </item>
+
+ <item> hb_regex </item>
+ <item> hb_regexmatch </item>
+ <item> hb_regexsplit </item>
+ <item> hb_regexcomp </item>
+ <item> hb_readini </item>
+ <item> hb_writeini </item>
+ <item> hb_random </item>
+ <item> hb_chechsum </item>
+ <item> hb_crypt </item>
+ <item> hb_decrypt </item>
+ <item> hb_hextonum </item>
+ <item> hb_numtohex </item>
+ <item> hb_exec </item>
+ <item> hb_execfromarray </item>
+
+ <item> hb_class </item>
+ <item> hb_keyput </item>
+ <item> hb_osnewline </item>
+
+ </list>
+
+ <list name="pragma">
+ <item> #include </item>
+ <item> #if </item>
+ <item> #ifdef </item>
+ <item> #ifndef </item>
+ <item> #endif </item>
+ <item> #else </item>
+ <item> #define </item>
+ </list>
+
+ <contexts>
+ <context attribute="Normal Text" lineEndContext="#stay" name="TopLevel">
+
+ <Detect2Chars attribute="Comment" context="ml_comment" char="/" char1="*" beginRegion="comment_region"/>
+ <DetectChar attribute="Comment" context="comment" char="*" firstNonSpace="true"/>
+ <Detect2Chars attribute="Comment" context="comment" char="/" char1="/" />
+
+ <DetectChar attribute="String" context="string" char="&quot;" />
+ <DetectChar attribute="String" context="stringc" char="'" />
+
+ <StringDetect attribute="Operator" context="#stay" String=".and." insensitive="TRUE"/>
+ <StringDetect attribute="Operator" context="#stay" String=".or." insensitive="TRUE"/>
+ <StringDetect attribute="Operator" context="#stay" String=".not." insensitive="TRUE"/>
+ <StringDetect attribute="Operator" context="#stay" String=".f." insensitive="TRUE"/>
+ <StringDetect attribute="Operator" context="#stay" String=".t." insensitive="TRUE"/>
+
+ <AnyChar attribute="Operator" context="#stay" String=":=!" />
+ <DetectChar attribute="Keyword" context="#stay" char="@"/>
+
+ <RegExpr String="CLASS[\t ]+" attribute="Keyword" context="ClassContext" insensitive="TRUE" beginRegion="ClassDeclRegion" firstNonSpace="true"/>
+
+ <RegExpr String="DO[\t ]+CASE[\t ]*$" attribute="Keyword" context="#stay" insensitive="TRUE" beginRegion="IndentRegion" firstNonSpace="true"/>
+ <keyword attribute="Keyword" context="#stay" String="context_beginners" beginRegion="IndentRegion" />
+ <keyword attribute="Keyword" context="#stay" String="context_terminators" endRegion="IndentRegion" />
+ <RegExpr String="return ?" attribute="Keyword" context="#stay" insensitive="TRUE" endRegion="IndentRegion" column="0"/>
+
+ <keyword attribute="Keyword" context="#stay" String="keywords" />
+ <keyword attribute="Keyword" context="#stay" String="set_commands" />
+ <keyword attribute="Function" context="#stay" String="functions" />
+ <keyword attribute="Preprocessor" context="#stay" String="pragma" />
+ <Detect2Chars attribute="Operator" context="#stay" char="-" char1=">" />
+ <RegExpr attribute="Number" context="#stay" String="\d+" />
+ </context>
+
+ <context attribute="Comment" lineEndContext="#pop" name="comment"/>
+
+ <context attribute="Comment" lineEndContext="#stay" name="ml_comment">
+ <Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" endRegion="comment_region"/>
+ </context>
+
+ <context attribute="String" lineEndContext="#pop" name="string">
+ <DetectChar attribute="String" context="#pop" char="&quot;" />
+ </context>
+ <context attribute="String" lineEndContext="#pop" name="stringc">
+ <DetectChar attribute="String" context="#pop" char="'" />
+ </context>
+
+ <context attribute="Operator" lineEndContext="#pop" name="logic">
+ <DetectChar attribute="Operator" context="#pop" char="." />
+ </context>
+
+ <context attribute="Normal Text" lineEndContext="#stay" name="ClassContext">
+
+ <Detect2Chars attribute="Comment" context="ml_comment" char="/" char1="*" beginRegion="comment_region"/>
+ <DetectChar attribute="Comment" context="comment" char="*" firstNonSpace="true"/>
+ <Detect2Chars attribute="Comment" context="comment" char="/" char1="/" />
+
+ <keyword attribute="Keyword" context="#stay" String="class_keywords" />
+ <RegExpr String="END(CLASS)? *$" attribute="Keyword" context="#pop" insensitive="TRUE" endRegion="ClassDeclRegion" firstNonSpace="true"/>
+ </context>
+
+ </contexts>
+
+ <itemDatas>
+ <itemData name="Normal Text" defStyleNum="dsNormal"/>
+ <itemData name="Keyword" defStyleNum="dsKeyword"/>
+ <itemData name="Comment" defStyleNum="dsComment"/>
+ <itemData name="Operator" defStyleNum="dsBaseN" color="#A01060" selColor="#400040" bold="0" italic="0"/>
+ <itemData name="Number" defStyleNum="dsDecVal" color="#5050C0" selColor="#000000" bold="0" italic="0"/>
+ <itemData name="Function" defStyleNum="dsFunction" />
+ <itemData name="String" defStyleNum="dsString"/>
+ <itemData name="Preprocessor" defStyleNum="dsOthers"/>
+ </itemDatas>
+</highlighting>
+
+<general>
+ <comments>
+ <comment name="singleLine" start="*" />
+ <comment name="singleLine" start="//" />
+ <comment name="multiLine" start="/*" end="*/" />
+ </comments>
+ <keywords casesensitive="0" />
+</general>
+</language>
diff --git a/kate/data/xml.xml b/kate/data/xml.xml
new file mode 100644
index 000000000..22c284ae2
--- /dev/null
+++ b/kate/data/xml.xml
@@ -0,0 +1,147 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd"
+[
+ <!ENTITY name "[A-Za-z_:][\w.:_-]*">
+ <!ENTITY entref "&amp;(#[0-9]+|#[xX][0-9A-Fa-f]+|&name;);">
+]>
+<language name="XML" version="1.96" kateversion="2.4" section="Markup" extensions="*.docbook;*.xml;*.rc;*.daml;*.rdf" mimetype="text/xml;text/book;text/daml;text/rdf" casesensitive="1" author="Wilbert Berendsen (wilbert@kde.nl)" license="LGPL">
+
+<highlighting>
+<contexts>
+ <context name="Start" attribute="Normal Text" lineEndContext="#stay">
+ <IncludeRules context="FindXML" />
+ </context>
+
+ <context name="FindXML" attribute="Normal Text" lineEndContext="#stay">
+ <DetectSpaces />
+ <StringDetect attribute="Comment" context="Comment" String="&lt;!--" beginRegion="comment" />
+ <StringDetect attribute="CDATA" context="CDATA" String="&lt;![CDATA[" beginRegion="cdata" />
+ <RegExpr attribute="Doctype" context="Doctype" String="&lt;!DOCTYPE\s+" beginRegion="doctype" />
+ <RegExpr attribute="Processing Instruction" context="PI" String="&lt;\?[\w:_-]*" beginRegion="pi" />
+ <RegExpr attribute="Element" context="Element" String="&lt;&name;" beginRegion="element" />
+ <IncludeRules context="FindEntityRefs" />
+ <DetectIdentifier />
+ </context>
+
+ <context name="FindEntityRefs" attribute="Normal Text" lineEndContext="#stay">
+ <RegExpr attribute="EntityRef" context="#stay" String="&entref;" />
+ <AnyChar attribute="Error" context="#stay" String="&amp;&lt;" />
+ </context>
+
+ <context name="FindPEntityRefs" attribute="Normal Text" lineEndContext="#stay">
+ <RegExpr attribute="EntityRef" context="#stay" String="&entref;" />
+ <RegExpr attribute="PEntityRef" context="#stay" String="%&name;;" />
+ <AnyChar attribute="Error" context="#stay" String="&amp;%" />
+ </context>
+
+
+ <context name="Comment" attribute="Comment" lineEndContext="#stay">
+ <DetectSpaces />
+ <StringDetect attribute="Comment" context="#pop" String="--&gt;" endRegion="comment" />
+ <RegExpr attribute="Error" context="#stay" String="-(-(?!-&gt;))+" />
+ <IncludeRules context="##Alerts" />
+ <DetectIdentifier />
+ </context>
+
+ <context name="CDATA" attribute="Normal Text" lineEndContext="#stay">
+ <DetectSpaces />
+ <DetectIdentifier />
+ <StringDetect attribute="CDATA" context="#pop" String="]]&gt;" endRegion="cdata" />
+ <StringDetect attribute="EntityRef" context="#stay" String="]]&amp;gt;" />
+ </context>
+
+ <context name="PI" attribute="Normal Text" lineEndContext="#stay">
+ <Detect2Chars attribute="Processing Instruction" context="#pop" char="?" char1="&gt;" endRegion="pi" />
+ </context>
+
+ <context name="Doctype" attribute="Normal Text" lineEndContext="#stay">
+ <DetectChar attribute="Doctype" context="#pop" char="&gt;" endRegion="doctype" />
+ <DetectChar attribute="Doctype" context="Doctype Internal Subset" char="[" beginRegion="int_subset" />
+ </context>
+
+ <context name="Doctype Internal Subset" attribute="Normal Text" lineEndContext="#stay">
+ <DetectChar attribute="Doctype" context="#pop" char="]" endRegion="int_subset" />
+ <RegExpr attribute="Doctype" context="Doctype Markupdecl" String="&lt;!(ELEMENT|ENTITY|ATTLIST|NOTATION)\b" />
+ <StringDetect attribute="Comment" context="Comment" String="&lt;!--" beginRegion="comment" />
+ <RegExpr attribute="Processing Instruction" context="PI" String="&lt;\?[\w:_-]*" beginRegion="pi" />
+ <IncludeRules context="FindPEntityRefs" />
+ </context>
+
+ <context name="Doctype Markupdecl" attribute="Normal Text" lineEndContext="#stay">
+ <DetectChar attribute="Doctype" context="#pop" char="&gt;" />
+ <DetectChar attribute="Value" context="Doctype Markupdecl DQ" char="&quot;" />
+ <DetectChar attribute="Value" context="Doctype Markupdecl SQ" char="&apos;" />
+ </context>
+
+ <context name="Doctype Markupdecl DQ" attribute="Value" lineEndContext="#stay">
+ <DetectChar attribute="Value" context="#pop" char="&quot;" />
+ <IncludeRules context="FindPEntityRefs" />
+ </context>
+
+ <context name="Doctype Markupdecl SQ" attribute="Value" lineEndContext="#stay">
+ <DetectChar attribute="Value" context="#pop" char="&apos;" />
+ <IncludeRules context="FindPEntityRefs" />
+ </context>
+
+ <context name="Element" attribute="Normal Text" lineEndContext="#stay">
+ <Detect2Chars attribute="Element" context="#pop" char="/" char1="&gt;" endRegion="element" />
+ <DetectChar attribute="Element" context="El Content" char="&gt;" />
+ <RegExpr attribute="Attribute" context="Attribute" String="^&name;" />
+ <RegExpr attribute="Attribute" context="Attribute" String="\s+&name;" />
+ <RegExpr attribute="Error" context="#stay" String="\S" />
+ </context>
+
+ <context name="El Content" attribute="Normal Text" lineEndContext="#stay">
+ <RegExpr attribute="Element" context="El End" String="&lt;/&name;" />
+ <IncludeRules context="FindXML" />
+ </context>
+
+ <context name="El End" attribute="Normal Text" lineEndContext="#stay">
+ <DetectChar attribute="Element" context="#pop#pop#pop" char="&gt;" endRegion="element" />
+ <RegExpr attribute="Error" context="#stay" String="\S" />
+ </context>
+
+ <context name="Attribute" attribute="Normal Text" lineEndContext="#stay">
+ <DetectChar attribute="Attribute" context="Value" char="=" />
+ <RegExpr attribute="Error" context="#stay" String="\S" />
+ </context>
+
+ <context name="Value" attribute="Normal Text" lineEndContext="#stay">
+ <DetectChar attribute="Value" context="Value DQ" char="&quot;" />
+ <DetectChar attribute="Value" context="Value SQ" char="&apos;" />
+ <RegExpr attribute="Error" context="#stay" String="\S" />
+ </context>
+
+ <context name="Value DQ" attribute="Value" lineEndContext="#stay">
+ <DetectChar attribute="Value" context="#pop#pop#pop" char="&quot;" />
+ <IncludeRules context="FindEntityRefs" />
+ </context>
+
+ <context name="Value SQ" attribute="Value" lineEndContext="#stay">
+ <DetectChar attribute="Value" context="#pop#pop#pop" char="&apos;" />
+ <IncludeRules context="FindEntityRefs" />
+ </context>
+
+</contexts>
+<itemDatas>
+ <itemData name="Normal Text" defStyleNum="dsNormal" />
+ <itemData name="Comment" defStyleNum="dsComment" />
+ <itemData name="CDATA" defStyleNum="dsBaseN" bold="1" />
+ <itemData name="Processing Instruction" defStyleNum="dsKeyword" />
+ <itemData name="Doctype" defStyleNum="dsDataType" bold="1" />
+ <itemData name="Element" defStyleNum="dsKeyword" />
+ <itemData name="Attribute" defStyleNum="dsOthers" />
+ <itemData name="Value" defStyleNum="dsString" color="#a00" />
+ <itemData name="EntityRef" defStyleNum="dsDecVal" />
+ <itemData name="PEntityRef" defStyleNum="dsDecVal" />
+ <itemData name="Error" defStyleNum="dsError" />
+</itemDatas>
+
+</highlighting>
+<general>
+ <comments>
+ <comment name="multiLine" start="&lt;!--" end="--&gt;" />
+ </comments>
+ <indentation mode="xml" />
+</general>
+</language>
diff --git a/kate/data/xmldebug.xml b/kate/data/xmldebug.xml
new file mode 100644
index 000000000..07b7612f5
--- /dev/null
+++ b/kate/data/xmldebug.xml
@@ -0,0 +1,593 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+<language version="1.02" kateversion="2.3" name="XML (Debug)" section="Markup" extensions="" mimetype="">
+ <highlighting>
+ <list name="AttType">
+ <item>CDATA</item>
+ <item>ID</item>
+ <item>IDREF</item>
+ <item>IDREFS</item>
+ <item>ENTITY</item>
+ <item>ENTITIES</item>
+ <item>NMTOKEN</item>
+ <item>NMTOKENS</item>
+ </list>
+ <contexts>
+
+ <context name="0:prolog" attribute="Error" lineEndContext="#stay">
+ <RegExpr attribute="Doctype Declaration" context="1:XMLDecl Version" String="&lt;\?xml(\s+|$)"/>
+ </context>
+
+ <context name="1:XMLDecl Version" attribute="Error" lineEndContext="#stay">
+ <RegExpr attribute="Attribute" context="2:XMLDecl Version Eq" String="\s*version\s*"/>
+ <RegExpr attribute="Doctype Declaration" String="\s+" context="#stay"/>
+ </context>
+
+ <context name="2:XMLDecl Version Eq" attribute="Error" lineEndContext="5:XMLDecl Encoding Eq">
+ <RegExpr attribute="Attribute" context="3:XMLDecl Version" String="\s*=\s*"/>
+ <RegExpr attribute="Attribute" context="#stay" String="\s+"/>
+ </context>
+
+ <context name="3:XMLDecl Version" attribute="Error" lineEndContext="#stay">
+ <RegExpr attribute="Value" context="4:XMLDecl Encoding" String="\s*(&quot;[A-Za-z0-9:._-]*&quot;|'[A-Za-z0-9:._-]*')(?!e)\s*"/>
+ <RegExpr attribute="Attribute" context="#stay" String="\s+"/>
+ </context>
+
+ <context name="4:XMLDecl Encoding" attribute="Error" lineEndContext="#stay">
+ <RegExpr attribute="Attribute" context="5:XMLDecl Encoding Eq" String="\s*encoding\s*"/>
+ <RegExpr attribute="Doctype Declaration" context="#stay" String="\s+"/>
+ <RegExpr attribute="Doctype Declaration" context="11:Misc after XMLDecl" String="\?>"/>
+ </context>
+
+ <context name="5:XMLDecl Encoding Eq" attribute="Error" lineEndContext="#stay">
+ <RegExpr attribute="Attribute" context="6:XMLDecl Encoding" String="\s*=\s*"/>
+ <RegExpr attribute="Attribute" context="#stay" String="\s+"/>
+ </context>
+
+ <context name="6:XMLDecl Encoding" attribute="Error" lineEndContext="#stay">
+ <RegExpr attribute="Value" context="7:XMLDecl Standalone" String="\s*(&quot;[A-Za-z][A-Za-z0-9._-]*&quot;|'[A-Za-z][A-Za-z0-9._-]*')(?!s)\s*"/>
+ <RegExpr attribute="Attribute" context="#stay" String="\s+"/>
+ </context>
+
+ <context name="7:XMLDecl Standalone" attribute="Error" lineEndContext="#stay">
+ <RegExpr attribute="Attribute" context="8:XMLDecl Standalone Eq" String="\s*standalone\s*"/>
+ <RegExpr attribute="Doctype Declaration" context="#stay" String="\s+"/>
+ <RegExpr attribute="Doctype Declaration" context="11:Misc after XMLDecl" String="\?>"/>
+ </context>
+
+ <context name="8:XMLDecl Standalone Eq" attribute="Error" lineEndContext="#stay">
+ <RegExpr attribute="Attribute" context="9:XMLDecl Standalone" String="\s*=\s*"/>
+ <RegExpr attribute="Attribute" context="#stay" String="\s+"/>
+ </context>
+
+ <context name="9:XMLDecl Standalone" attribute="Error" lineEndContext="#stay">
+ <RegExpr attribute="Value" context="10:XMLDecl Standalone" String="\s*&quot;(yes|no)&quot;|'(yes|no)'\s*"/>
+ <RegExpr attribute="Attribute" context="#stay" String="\s+"/>
+ </context>
+
+ <context name="10:XMLDecl Standalone" attribute="Error" lineEndContext="#stay">
+ <RegExpr attribute="Doctype Declaration" context="#stay" String="\s+"/>
+ <RegExpr attribute="Doctype Declaration" context="11:Misc after XMLDecl" String="\?>"/>
+ </context>
+
+ <context name="11:Misc after XMLDecl" attribute="Error" lineEndContext="#stay">
+ <RegExpr attribute="Normal Text" context="#stay" String="\s+"/>
+ <RegExpr attribute="Comment" context="12:Comment after XMLDecl" String="\s*&lt;!--\s*"/>
+ <RegExpr attribute="Processing Instruction" context="13:PI after XMLDecl" String="\s*&lt;\?xml-stylesheet(\s+|$)"/>
+ <RegExpr attribute="Error" context="13:PI after XMLDecl" String="\s*&lt;\??[xX][mM][lL]"/>
+ <RegExpr attribute="Processing Instruction" context="13:PI after XMLDecl" String="\s*&lt;\?[a-zA-Z_][a-zA-Z0-9_-]*(:[a-zA-Z0-9_-]*)?(\s+|$)"/>
+ <RegExpr attribute="Doctype Declaration" context="14:Doctype Decl Name" String="&lt;!DOCTYPE(\s+|$)"/>
+ <RegExpr attribute="Error" context="80:STag" String="&lt;[xX][mM][lL](\w|[_.-])*(:(\w|[_.-])+)?"/>
+ <RegExpr attribute="Normal Tag" context="80:STag" String="&lt;(?![&#x0660;-&#x0669;&#x06F0;-&#x06F9;&#x0966;-&#x096F;&#x09E6;-&#x09EF;&#x0A66;-&#x0A6F;&#x0AE6;-&#x0AEF;&#x0B66;-&#x0B6F;&#x0BE7;-&#x0BEF;&#x0C66;-&#x0C6F;&#x0CE6;-&#x0CEF;&#x0D66;-&#x0D6F;&#x0E50;-&#x0E59;&#x0ED0;-&#x0ED9;&#x0F20;-&#x0F29;]|\d)(\w|_)(\w|[_.-])*(:(\w|[_.-])+)?"/>
+ <RegExpr attribute="Error" context="80:STag" String="&lt;(?![&#x0660;-&#x0669;&#x06F0;-&#x06F9;&#x0966;-&#x096F;&#x09E6;-&#x09EF;&#x0A66;-&#x0A6F;&#x0AE6;-&#x0AEF;&#x0B66;-&#x0B6F;&#x0BE7;-&#x0BEF;&#x0C66;-&#x0C6F;&#x0CE6;-&#x0CEF;&#x0D66;-&#x0D6F;&#x0E50;-&#x0E59;&#x0ED0;-&#x0ED9;&#x0F20;-&#x0F29;]|\d)(\w|[:_])(\w|[:_.-])*"/>
+ <RegExpr attribute="Error" context="85:ETag" String="&lt;/[xX][mM][lL](\w|[_.-])*(:(\w|[_.-])+)?"/>
+ <RegExpr attribute="Normal Tag" context="85:ETag" String="&lt;/(?![&#x0660;-&#x0669;&#x06F0;-&#x06F9;&#x0966;-&#x096F;&#x09E6;-&#x09EF;&#x0A66;-&#x0A6F;&#x0AE6;-&#x0AEF;&#x0B66;-&#x0B6F;&#x0BE7;-&#x0BEF;&#x0C66;-&#x0C6F;&#x0CE6;-&#x0CEF;&#x0D66;-&#x0D6F;&#x0E50;-&#x0E59;&#x0ED0;-&#x0ED9;&#x0F20;-&#x0F29;]|\d)(\w|_)(\w|[_.-])*(:(\w|[_.-])+)?"/>
+ <RegExpr attribute="Error" context="85:ETag" String="&lt;/(?![&#x0660;-&#x0669;&#x06F0;-&#x06F9;&#x0966;-&#x096F;&#x09E6;-&#x09EF;&#x0A66;-&#x0A6F;&#x0AE6;-&#x0AEF;&#x0B66;-&#x0B6F;&#x0BE7;-&#x0BEF;&#x0C66;-&#x0C6F;&#x0CE6;-&#x0CEF;&#x0D66;-&#x0D6F;&#x0E50;-&#x0E59;&#x0ED0;-&#x0ED9;&#x0F20;-&#x0F29;]|\d)(\w|[:_])(\w|[:_.-])*"/>
+ <RegExpr attribute="Entity" context="79:Outside" String="&amp;(?![&#x0660;-&#x0669;&#x06F0;-&#x06F9;&#x0966;-&#x096F;&#x09E6;-&#x09EF;&#x0A66;-&#x0A6F;&#x0AE6;-&#x0AEF;&#x0B66;-&#x0B6F;&#x0BE7;-&#x0BEF;&#x0C66;-&#x0C6F;&#x0CE6;-&#x0CEF;&#x0D66;-&#x0D6F;&#x0E50;-&#x0E59;&#x0ED0;-&#x0ED9;&#x0F20;-&#x0F29;]|\d)(\w|[_:])(\w|[_:.-])*;"/>
+ <RegExpr attribute="Entity" context="79:Outside" String="&amp;#(x[0-9a-fA-F]+|[0-9]+);"/>
+ <RegExpr attribute="Entity" context="86:CDSect" String="&lt;!\[CDATA\["/>
+ <RegExpr attribute="Comment" context="87:Comment inside IS" String="&lt;!--"/>
+ <RegExpr attribute="Normal Tag" context="88:PI inside IS" String="&lt;\?xml-stylesheet(\s|$)"/>
+ <RegExpr attribute="Error" context="88:PI inside IS" String="&lt;\?[xX][mM][lL](\w|[_.-])*(:(\w|[_.-])+)?"/>
+ <RegExpr attribute="Normal Tag" context="88:PI inside IS" String="&lt;\?(?![&#x0660;-&#x0669;&#x06F0;-&#x06F9;&#x0966;-&#x096F;&#x09E6;-&#x09EF;&#x0A66;-&#x0A6F;&#x0AE6;-&#x0AEF;&#x0B66;-&#x0B6F;&#x0BE7;-&#x0BEF;&#x0C66;-&#x0C6F;&#x0CE6;-&#x0CEF;&#x0D66;-&#x0D6F;&#x0E50;-&#x0E59;&#x0ED0;-&#x0ED9;&#x0F20;-&#x0F29;]|\d)(\w|_)(\w|[_.-])*(:(\w|[_.-])+)?"/>
+ <RegExpr attribute="Error" context="88:PI inside IS" String="&lt;\?(?![&#x0660;-&#x0669;&#x06F0;-&#x06F9;&#x0966;-&#x096F;&#x09E6;-&#x09EF;&#x0A66;-&#x0A6F;&#x0AE6;-&#x0AEF;&#x0B66;-&#x0B6F;&#x0BE7;-&#x0BEF;&#x0C66;-&#x0C6F;&#x0CE6;-&#x0CEF;&#x0D66;-&#x0D6F;&#x0E50;-&#x0E59;&#x0ED0;-&#x0ED9;&#x0F20;-&#x0F29;]|\d)(\w|[:_])(\w|[:_.-])*"/>
+ <DetectChar attribute="Error" context="79:Outside" char="&lt;"/>
+ <DetectChar attribute="Error" context="79:Outside" char="&amp;"/>
+ <RegExpr attribute="Error" context="79:Outside" String="\]\]>"/>
+ </context>
+
+ <context name="12:Comment after XMLDecl" attribute="Comment" lineEndContext="#stay">
+ <RegExpr attribute="Error" context="#pop" String="--->"/>
+ <RegExpr attribute="Comment" context="#pop" String="-->"/>
+ <Detect2Chars attribute="Error" context="#stay" char="-" char1="-"/>
+ </context>
+
+ <context name="13:PI after XMLDecl" attribute="Processing Instruction Body" lineEndContext="#stay">
+ <Detect2Chars attribute="Processing Instruction" context="#pop" char="?" char1="&gt;"/>
+ </context>
+
+ <context name="14:Doctype Decl Name" attribute="Error" lineEndContext="#stay">
+ <RegExpr attribute="Doctype Declaration" context="15:Doctype Decl ExternalID" String="(?![&#x0660;-&#x0669;&#x06F0;-&#x06F9;&#x0966;-&#x096F;&#x09E6;-&#x09EF;&#x0A66;-&#x0A6F;&#x0AE6;-&#x0AEF;&#x0B66;-&#x0B6F;&#x0BE7;-&#x0BEF;&#x0C66;-&#x0C6F;&#x0CE6;-&#x0CEF;&#x0D66;-&#x0D6F;&#x0E50;-&#x0E59;&#x0ED0;-&#x0ED9;&#x0F20;-&#x0F29;]|\d)(\w|[_:])(\w|[_:.-])*(\s+|$)"/>
+ <RegExpr attribute="Doctype Declaration" context="#stay" String="\s+"/>
+ </context>
+
+ <context name="15:Doctype Decl ExternalID" attribute="Error" lineEndContext="#stay">
+ <RegExpr attribute="Doctype Declaration" context="16:Doctype Decl PublicID" String="PUBLIC(\s+|$)"/>
+ <RegExpr attribute="Doctype Declaration" context="19:Doctype Decl SystemID" String="SYSTEM(\s+|$)"/>
+ <DetectChar attribute="Doctype Declaration" context="23:Doctype Decl IS" char="["/>
+ <!-- rodda: this was originally context="?", so my best guess... most likely wrong -->
+ <DetectChar attribute="Doctype Declaration" context="23:Doctype Decl IS" char=">"/>
+ <RegExpr attribute="Doctype Declaration" context="#stay" String="\s+"/>
+ </context>
+
+ <context name="16:Doctype Decl PublicID" attribute="Error" lineEndContext="#stay">
+ <DetectChar attribute="Value" context="17:Doctype Decl PublicID qq" char="&quot;"/>
+ <DetectChar attribute="Value" context="18:Doctype Decl PublicID q" char="'"/>
+ <RegExpr attribute="Doctype Declaration" context="#stay" String="\s+"/>
+ </context>
+
+ <context name="17:Doctype Decl PublicID qq" attribute="Error" lineEndContext="#stay">
+ <DetectChar attribute="Value" context="19:Doctype Decl SystemID" char="&quot;(\s+|$)"/>
+ <RegExpr attribute="Value" context="#stay" String="[&#x20;&#xD;&#xA;a-zA-Z0-9'()+,./:=?;!*#@$_%-]"/>
+ </context>
+
+ <context name="18:Doctype Decl PublicID q" attribute="Value" lineEndContext="#stay">
+ <DetectChar attribute="Value" context="19:Doctype Decl SystemID" char="'(\s+|$)"/>
+ <RegExpr attribute="Value" context="#stay" String="[&#x20;&#xD;&#xA;a-zA-Z0-9()+,./:=?;!*#@$_%-]"/>
+ </context>
+
+ <context name="19:Doctype Decl SystemID" attribute="Error" lineEndContext="#stay">
+ <DetectChar attribute="Value" context="20:Doctype Decl SystemID qq" char="&quot;"/>
+ <DetectChar attribute="Value" context="21:Doctype Decl SystemID q" char="'"/>
+ <RegExpr attribute="Doctype Declaration" context="#stay" String="\s+"/>
+ </context>
+
+ <context name="20:Doctype Decl SystemID qq" attribute="Value" lineEndContext="#stay">
+ <DetectChar attribute="Value" context="22:Doctype Decl IS or end" char="&quot;"/>
+ </context>
+
+ <context name="21:Doctype Decl SystemID q" attribute="Value" lineEndContext="#stay">
+ <DetectChar attribute="Value" context="22:Doctype Decl IS or end" char="'"/>
+ </context>
+
+ <context name="22:Doctype Decl IS or end" attribute="Error" lineEndContext="#stay">
+ <DetectChar attribute="Doctype Declaration" context="23:Doctype Decl IS" char="["/>
+ <DetectChar attribute="Doctype Declaration" context="79:Outside" char=">"/>
+ <RegExpr attribute="Doctype Declaration" context="#stay" String="\s+"/>
+ </context>
+
+ <context name="23:Doctype Decl IS" attribute="Error" lineEndContext="#stay">
+ <RegExpr attribute="Entity" context="#stay" String="%(?![&#x0660;-&#x0669;&#x06F0;-&#x06F9;&#x0966;-&#x096F;&#x09E6;-&#x09EF;&#x0A66;-&#x0A6F;&#x0AE6;-&#x0AEF;&#x0B66;-&#x0B6F;&#x0BE7;-&#x0BEF;&#x0C66;-&#x0C6F;&#x0CE6;-&#x0CEF;&#x0D66;-&#x0D6F;&#x0E50;-&#x0E59;&#x0ED0;-&#x0ED9;&#x0F20;-&#x0F29;]|\d)(\w|[_:])(\w|[_:.-])*;"/>
+ <RegExpr attribute="Doctype Declaration" context="#stay" String="\s+"/>
+ <RegExpr attribute="Doctype Declaration" context="24:elementdecl" String="&lt;!ELEMENT(\s+|$)"/>
+ <RegExpr attribute="Doctype Declaration" context="38:AttlistDecl" String="&lt;!ATTLIST(\s+|$)"/>
+ <RegExpr attribute="Doctype Declaration" context="50:EntityDecl" String="&lt;!ENTITY(\s+|$)"/>
+ <RegExpr attribute="Doctype Declaration" context="71:NotationDecl Name" String="&lt;!NOTATION(\s+|$)"/>
+ <RegExpr attribute="Comment" context="77:Comment inside IS" String="\s*&lt;!--\s*"/>
+ <RegExpr attribute="Processing Instruction" context="78:PI inside IS" String="\s*&lt;\?xml-stylesheet(\s+|$)"/>
+ <RegExpr attribute="Error" context="78:PI inside IS" String="\s*&lt;\??[xX][mM][lL]"/>
+ <RegExpr attribute="Processing Instruction" context="78:PI inside IS" String="\s*&lt;\?[a-zA-Z_][a-zA-Z0-9_-]*(:[a-zA-Z0-9_-]*)?(\s+|$)"/>
+ <Detect2Chars attribute="Doctype Declaration" context="79:Outside" char="]" char1=">"/>
+ </context>
+
+ <context name="24:elementdecl" attribute="Error" lineEndContext="#stay">
+ <RegExpr attribute="Normal Tag" context="25:contentspec" String="(?![&#x0660;-&#x0669;&#x06F0;-&#x06F9;&#x0966;-&#x096F;&#x09E6;-&#x09EF;&#x0A66;-&#x0A6F;&#x0AE6;-&#x0AEF;&#x0B66;-&#x0B6F;&#x0BE7;-&#x0BEF;&#x0C66;-&#x0C6F;&#x0CE6;-&#x0CEF;&#x0D66;-&#x0D6F;&#x0E50;-&#x0E59;&#x0ED0;-&#x0ED9;&#x0F20;-&#x0F29;]|\d)(\w|[_:])(\w|[_:.-])*"/>
+ <RegExpr attribute="Doctype Declaration" context="#stay" String="\s+"/>
+ </context>
+
+ <context name="25:contentspec" attribute="Error" lineEndContext="#stay">
+ <RegExpr attribute="Attribute" context="37:element end" String="(EMPTY|ANY)"/>
+ <DetectChar attribute="Attribute" context="26:MixedOrChildren" char="("/>
+ <RegExpr attribute="Doctype Declaration" context="#stay" String="\s+"/>
+ </context>
+
+ <context name="26:MixedOrChildren" attribute="Error" lineEndContext="#stay">
+ <RegExpr attribute="Attribute" context="27:MixedShort" String="#PCDATA"/>
+ <RegExpr attribute="Doctype Declaration" context="#stay" String="\s+"/>
+ <DetectChar attribute="Doctype Declaration" context="30:children unknown" char="("/>
+ <RegExpr attribute="Value" context="30:children unknown" String="(?![&#x0660;-&#x0669;&#x06F0;-&#x06F9;&#x0966;-&#x096F;&#x09E6;-&#x09EF;&#x0A66;-&#x0A6F;&#x0AE6;-&#x0AEF;&#x0B66;-&#x0B6F;&#x0BE7;-&#x0BEF;&#x0C66;-&#x0C6F;&#x0CE6;-&#x0CEF;&#x0D66;-&#x0D6F;&#x0E50;-&#x0E59;&#x0ED0;-&#x0ED9;&#x0F20;-&#x0F29;]|\d)(\w|[_:])(\w|[_:.-])*[\?\*\+]?"/>
+ </context>
+
+ <context name="27:MixedShort" attribute="Error" lineEndContext="#stay">
+ <DetectChar attribute="Doctype Declaration" context="28:MixedLong" char="|"/>
+ <RegExpr attribute="Doctype Declaration" context="#stay" String="\s+"/>
+ <DetectChar attribute="Doctype Declaration" context="37:element end" char=")"/>
+ </context>
+
+ <context name="28:MixedLong" attribute="Error" lineEndContext="#stay">
+ <RegExpr attribute="Value" context="29:MixedLong endOrContinue" String="(?![&#x0660;-&#x0669;&#x06F0;-&#x06F9;&#x0966;-&#x096F;&#x09E6;-&#x09EF;&#x0A66;-&#x0A6F;&#x0AE6;-&#x0AEF;&#x0B66;-&#x0B6F;&#x0BE7;-&#x0BEF;&#x0C66;-&#x0C6F;&#x0CE6;-&#x0CEF;&#x0D66;-&#x0D6F;&#x0E50;-&#x0E59;&#x0ED0;-&#x0ED9;&#x0F20;-&#x0F29;]|\d)(\w|[_:])(\w|[_:.-])*"/>
+ <RegExpr attribute="Doctype Declaration" context="#stay" String="\s+"/>
+ </context>
+
+ <context name="29:MixedLong endOrContinue" attribute="Error" lineEndContext="#stay">
+ <DetectChar attribute="Doctype Declaration" context="#pop" char="|"/>
+ <RegExpr attribute="Doctype Declaration" context="#pop#pop" String="\s+"/>
+ <Detect2Chars attribute="Doctype Declaration" context="37:element end" char=")" char1="*"/>
+ </context>
+
+ <context name="30:children unknown" attribute="Error" lineEndContext="#stay">
+ <DetectChar attribute="Doctype Declaration" context="33:children choice" char="|"/>
+ <DetectChar attribute="Doctype Declaration" context="35:children seq" char=","/>
+ <RegExpr attribute="Doctype Declaration" context="#stay" String="\s+"/>
+ <RegExpr attribute="Doctype Declaration" context="31:children unknownOrEnd" String="\)[\?\*\+]?"/>
+ </context>
+
+ <context name="31:children unknownOrEnd" attribute="Error" lineEndContext="#stay">
+ <DetectChar attribute="Doctype Declaration" context="33:children choice" char="|"/>
+ <DetectChar attribute="Doctype Declaration" context="35:children seq" char=","/>
+ <RegExpr attribute="Doctype Declaration" context="#stay" String="\s+"/>
+ <RegExpr attribute="Doctype Declaration" context="#stay" String="\)[\?\*\+]?"/>
+ <DetectChar attribute="Doctype Declaration" context="23:Doctype Decl IS" char=">"/>
+ </context>
+
+ <context name="32:children unknownName" attribute="Error" lineEndContext="#stay">
+ <RegExpr attribute="Value" context="30:children unknown" String="(?![&#x0660;-&#x0669;&#x06F0;-&#x06F9;&#x0966;-&#x096F;&#x09E6;-&#x09EF;&#x0A66;-&#x0A6F;&#x0AE6;-&#x0AEF;&#x0B66;-&#x0B6F;&#x0BE7;-&#x0BEF;&#x0C66;-&#x0C6F;&#x0CE6;-&#x0CEF;&#x0D66;-&#x0D6F;&#x0E50;-&#x0E59;&#x0ED0;-&#x0ED9;&#x0F20;-&#x0F29;]|\d)(\w|[_:])(\w|[_:.-])*[\?\*\+]?"/>
+ <DetectChar attribute="Doctype Declaration" context="#stay" char="("/>
+ <RegExpr attribute="Doctype Declaration" context="#stay" String="\s+"/>
+ </context>
+
+ <context name="33:children choice" attribute="Error" lineEndContext="#stay">
+ <RegExpr attribute="Value" context="34:children choiceOrEnd" String="(?![&#x0660;-&#x0669;&#x06F0;-&#x06F9;&#x0966;-&#x096F;&#x09E6;-&#x09EF;&#x0A66;-&#x0A6F;&#x0AE6;-&#x0AEF;&#x0B66;-&#x0B6F;&#x0BE7;-&#x0BEF;&#x0C66;-&#x0C6F;&#x0CE6;-&#x0CEF;&#x0D66;-&#x0D6F;&#x0E50;-&#x0E59;&#x0ED0;-&#x0ED9;&#x0F20;-&#x0F29;]|\d)(\w|[_:])(\w|[_:.-])*[\?\*\+]?"/>
+ <DetectChar attribute="Doctype Declaration" context="32:children unknownName" char="("/>
+ <RegExpr attribute="Doctype Declaration" context="#stay" String="\s+"/>
+ </context>
+
+ <context name="34:children choiceOrEnd" attribute="Error" lineEndContext="#stay">
+ <DetectChar attribute="Doctype Declaration" context="#pop" char="|"/>
+ <RegExpr attribute="Doctype Declaration" context="#stay" String="\s+"/>
+ <RegExpr attribute="Doctype Declaration" context="31:children unknownOrEnd" String="\)[\?\*\+]?"/>
+ </context>
+
+ <context name="35:children seq" attribute="Error" lineEndContext="#stay">
+ <RegExpr attribute="Value" context="36:children seqOrEnd" String="(?![&#x0660;-&#x0669;&#x06F0;-&#x06F9;&#x0966;-&#x096F;&#x09E6;-&#x09EF;&#x0A66;-&#x0A6F;&#x0AE6;-&#x0AEF;&#x0B66;-&#x0B6F;&#x0BE7;-&#x0BEF;&#x0C66;-&#x0C6F;&#x0CE6;-&#x0CEF;&#x0D66;-&#x0D6F;&#x0E50;-&#x0E59;&#x0ED0;-&#x0ED9;&#x0F20;-&#x0F29;]|\d)(\w|[_:])(\w|[_:.-])*[\?\*\+]?"/>
+ <DetectChar attribute="Doctype Declaration" context="32:children unknownName" char="("/>
+ <RegExpr attribute="Doctype Declaration" context="#stay" String="\s+"/>
+ </context>
+
+ <context name="36:children seqOrEnd" attribute="Error" lineEndContext="#stay">
+ <DetectChar attribute="Doctype Declaration" context="#pop" char=","/>
+ <RegExpr attribute="Doctype Declaration" context="#stay" String="\s+"/>
+ <RegExpr attribute="Doctype Declaration" context="31:children unknownOrEnd" String="\)[\?\*\+]?"/>
+ </context>
+
+ <context name="37:element end" attribute="Error" lineEndContext="#stay">
+ <DetectChar attribute="Doctype Declaration" context="23:Doctype Decl IS" char=">"/>
+ <RegExpr attribute="Doctype Declaration" context="#stay" String="\s+"/>
+ </context>
+
+ <context name="38:AttlistDecl" attribute="Error" lineEndContext="#stay">
+ <RegExpr attribute="Normal Tag" context="39:AttDef" String="(?![&#x0660;-&#x0669;&#x06F0;-&#x06F9;&#x0966;-&#x096F;&#x09E6;-&#x09EF;&#x0A66;-&#x0A6F;&#x0AE6;-&#x0AEF;&#x0B66;-&#x0B6F;&#x0BE7;-&#x0BEF;&#x0C66;-&#x0C6F;&#x0CE6;-&#x0CEF;&#x0D66;-&#x0D6F;&#x0E50;-&#x0E59;&#x0ED0;-&#x0ED9;&#x0F20;-&#x0F29;]|\d)(\w|[_:])(\w|[_:.-])*(\s+|$)"/>
+ <RegExpr attribute="Normal Tag" context="23:Doctype Decl IS" String="(?![&#x0660;-&#x0669;&#x06F0;-&#x06F9;&#x0966;-&#x096F;&#x09E6;-&#x09EF;&#x0A66;-&#x0A6F;&#x0AE6;-&#x0AEF;&#x0B66;-&#x0B6F;&#x0BE7;-&#x0BEF;&#x0C66;-&#x0C6F;&#x0CE6;-&#x0CEF;&#x0D66;-&#x0D6F;&#x0E50;-&#x0E59;&#x0ED0;-&#x0ED9;&#x0F20;-&#x0F29;]|\d)(\w|[_:])(\w|[_:.-])*>"/>
+ <RegExpr attribute="Doctype Declaration" context="#stay" String="\s+"/>
+ </context>
+
+ <context name="39:AttDef" attribute="Error" lineEndContext="#stay">
+ <RegExpr attribute="Attribute" context="40:AttType" String="(?![&#x0660;-&#x0669;&#x06F0;-&#x06F9;&#x0966;-&#x096F;&#x09E6;-&#x09EF;&#x0A66;-&#x0A6F;&#x0AE6;-&#x0AEF;&#x0B66;-&#x0B6F;&#x0BE7;-&#x0BEF;&#x0C66;-&#x0C6F;&#x0CE6;-&#x0CEF;&#x0D66;-&#x0D6F;&#x0E50;-&#x0E59;&#x0ED0;-&#x0ED9;&#x0F20;-&#x0F29;]|\d)(\w|[_:])(\w|[_:.-])*(\s+|$)"/>
+ <RegExpr attribute="Doctype Declaration" context="#stay" String="\s+"/>
+ <DetectChar attribute="Doctype Declaration" context="23:Doctype Decl IS" char=">"/>
+ </context>
+
+ <context name="40:AttType" attribute="Error" lineEndContext="#stay">
+ <keyword attribute="Doctype Declaration" context="46:DefaultDecl" String="AttType"/>
+ <RegExpr attribute="Doctype Declaration" context="41:NotationStart" String="NOTATION(\s+|$)"/>
+ <DetectChar attribute="Doctype Declaration" context="42:Notation" char="("/>
+ <RegExpr attribute="Doctype Declaration" context="#pop" String="\s+"/>
+ </context>
+
+ <context name="41:NotationStart" attribute="Error" lineEndContext="#stay">
+ <DetectChar attribute="Doctype Declaration" context="42:Notation" char="("/>
+ <RegExpr attribute="Doctype Declaration" context="#pop#pop" String="\s+"/>
+ </context>
+
+ <context name="42:Notation" attribute="Error" lineEndContext="#stay">
+ <RegExpr attribute="Value" context="43:Notation or End" String="(?![&#x0660;-&#x0669;&#x06F0;-&#x06F9;&#x0966;-&#x096F;&#x09E6;-&#x09EF;&#x0A66;-&#x0A6F;&#x0AE6;-&#x0AEF;&#x0B66;-&#x0B6F;&#x0BE7;-&#x0BEF;&#x0C66;-&#x0C6F;&#x0CE6;-&#x0CEF;&#x0D66;-&#x0D6F;&#x0E50;-&#x0E59;&#x0ED0;-&#x0ED9;&#x0F20;-&#x0F29;]|\d)(\w|[_:])(\w|[_:.-])*"/>
+ <RegExpr attribute="Doctype Declaration" context="#stay" String="\s+"/>
+ </context>
+
+ <context name="43:Notation or End" attribute="Error" lineEndContext="#stay">
+ <DetectChar attribute="Doctype Declaration" context="#pop" char="|"/>
+ <RegExpr attribute="Doctype Declaration" context="46:DefaultDecl" String="\)(\s+|$)"/>
+ <RegExpr attribute="Doctype Declaration" context="#stay" String="\s+"/>
+ </context>
+
+ <context name="44:Enumeration" attribute="Error" lineEndContext="#stay">
+ <RegExpr attribute="Value" context="#stay" String="(\w|[_:.-])+"/>
+ <RegExpr attribute="Doctype Declaration" context="#stay" String="\s+"/>
+ </context>
+
+ <context name="45:Enumeration or End" attribute="Error" lineEndContext="#stay">
+ <DetectChar attribute="Doctype Declaration" context="44:Enumeration" char="|"/>
+ <RegExpr attribute="Doctype Declaration" context="46:DefaultDecl" String="\)(\s+|$)"/>
+ <RegExpr attribute="Doctype Declaration" context="#stay" String="\s+"/>
+ </context>
+
+ <context name="46:DefaultDecl" attribute="Error" lineEndContext="#stay">
+ <RegExpr attribute="Attribute" context="39:AttDef" String="(#REQUIRED|#IMPLIED)(\s+|$)"/>
+ <RegExpr attribute="Attribute" context="47:DefaultDecl AttValue" String="#FIXED(\s+|$)"/>
+ <RegExpr attribute="Doctype Declaration" context="#stay" String="\s+"/>
+ <RegExpr attribute="Value" context="48:DefaultDecl AttValue qq" String="&quot;"/>
+ <RegExpr attribute="Value" context="49:DefaultDecl AttValue q" String="'"/>
+ </context>
+
+ <context name="47:DefaultDecl AttValue" attribute="Error" lineEndContext="#stay">
+ <RegExpr attribute="Value" context="48:DefaultDecl AttValue qq" String="&quot;"/>
+ <RegExpr attribute="Value" context="49:DefaultDecl AttValue q" String="'"/>
+ </context>
+
+ <context name="48:DefaultDecl AttValue qq" attribute="Value" lineEndContext="#stay">
+ <RegExpr attribute="Entity" context="#stay" String="&amp;(?![&#x0660;-&#x0669;&#x06F0;-&#x06F9;&#x0966;-&#x096F;&#x09E6;-&#x09EF;&#x0A66;-&#x0A6F;&#x0AE6;-&#x0AEF;&#x0B66;-&#x0B6F;&#x0BE7;-&#x0BEF;&#x0C66;-&#x0C6F;&#x0CE6;-&#x0CEF;&#x0D66;-&#x0D6F;&#x0E50;-&#x0E59;&#x0ED0;-&#x0ED9;&#x0F20;-&#x0F29;]|\d)(\w|[_:])(\w|[_:.-])*;"/>
+ <RegExpr attribute="Entity" context="#stay" String="&amp;#(x[0-9a-fA-F]+|[0-9]+);"/>
+ <DetectChar attribute="Error" context="#stay" char="&amp;"/>
+ <DetectChar attribute="Error" context="#stay" char="&lt;"/>
+ <DetectChar attribute="Value" context="39:AttDef" char="&quot;"/>
+ </context>
+
+ <context name="49:DefaultDecl AttValue q" attribute="Value" lineEndContext="#stay">
+ <RegExpr attribute="Entity" context="#stay" String="&amp;(?![&#x0660;-&#x0669;&#x06F0;-&#x06F9;&#x0966;-&#x096F;&#x09E6;-&#x09EF;&#x0A66;-&#x0A6F;&#x0AE6;-&#x0AEF;&#x0B66;-&#x0B6F;&#x0BE7;-&#x0BEF;&#x0C66;-&#x0C6F;&#x0CE6;-&#x0CEF;&#x0D66;-&#x0D6F;&#x0E50;-&#x0E59;&#x0ED0;-&#x0ED9;&#x0F20;-&#x0F29;]|\d)(\w|[_:])(\w|[_:.-])*;"/>
+ <RegExpr attribute="Entity" context="#stay" String="&amp;#(x[0-9a-fA-F]+|[0-9]+);"/>
+ <DetectChar attribute="Error" context="#stay" char="&amp;"/>
+ <DetectChar attribute="Error" context="#stay" char="&lt;"/>
+ <DetectChar attribute="Value" context="39:AttDef" char="&quot;"/>
+ </context>
+
+ <context name="50:EntityDecl" attribute="Error" lineEndContext="#stay">
+ <RegExpr attribute="Entity" context="52:GEDecl EntityValueOrExternalID" String="(?![&#x0660;-&#x0669;&#x06F0;-&#x06F9;&#x0966;-&#x096F;&#x09E6;-&#x09EF;&#x0A66;-&#x0A6F;&#x0AE6;-&#x0AEF;&#x0B66;-&#x0B6F;&#x0BE7;-&#x0BEF;&#x0C66;-&#x0C6F;&#x0CE6;-&#x0CEF;&#x0D66;-&#x0D6F;&#x0E50;-&#x0E59;&#x0ED0;-&#x0ED9;&#x0F20;-&#x0F29;]|\d)(\w|[_:])(\w|[_:.-])*(\s+|$)"/>
+ <DetectChar attribute="Entity" context="61:PEDecl" char="%"/>
+ <RegExpr attribute="Doctype Declaration" context="#stay" String="\s+"/>
+ </context>
+
+ <context name="51:unused" attribute="Error" lineEndContext="#stay">
+ </context>
+
+ <context name="52:GEDecl EntityValueOrExternalID" attribute="Error" lineEndContext="#stay">
+ <RegExpr attribute="Value" context="53:GEDecl EntityValue qq" String="&quot;"/>
+ <RegExpr attribute="Value" context="54:GEDecl EntityValue q" String="'"/>
+ <RegExpr attribute="Doctype Declaration" context="55:GEDecl PublicID" String="PUBLIC(\s+|$)"/>
+ <RegExpr attribute="Doctype Declaration" context="58:GEDecl SystemID" String="SYSTEM(\s+|$)"/>
+ </context>
+
+ <context name="53:GEDecl EntityValue qq" attribute="Value" lineEndContext="#stay">
+ <RegExpr attribute="Entity" context="#stay" String="[&amp;%](?![&#x0660;-&#x0669;&#x06F0;-&#x06F9;&#x0966;-&#x096F;&#x09E6;-&#x09EF;&#x0A66;-&#x0A6F;&#x0AE6;-&#x0AEF;&#x0B66;-&#x0B6F;&#x0BE7;-&#x0BEF;&#x0C66;-&#x0C6F;&#x0CE6;-&#x0CEF;&#x0D66;-&#x0D6F;&#x0E50;-&#x0E59;&#x0ED0;-&#x0ED9;&#x0F20;-&#x0F29;]|\d)(\w|[_:])(\w|[_:.-])*;"/>
+ <RegExpr attribute="Entity" context="#stay" String="&amp;#(x[0-9a-fA-F]+|[0-9]+);"/>
+ <DetectChar attribute="Error" context="#stay" char="&amp;"/>
+ <DetectChar attribute="Error" context="#stay" char="%"/>
+ <DetectChar attribute="Error" context="#stay" char="&lt;"/>
+ <DetectChar attribute="Value" context="69:GEDecl endOrNDATA" char="&quot;"/>
+ </context>
+
+ <context name="54:GEDecl EntityValue q" attribute="Value" lineEndContext="#stay">
+ <RegExpr attribute="Entity" context="#stay" String="[&amp;%](?![&#x0660;-&#x0669;&#x06F0;-&#x06F9;&#x0966;-&#x096F;&#x09E6;-&#x09EF;&#x0A66;-&#x0A6F;&#x0AE6;-&#x0AEF;&#x0B66;-&#x0B6F;&#x0BE7;-&#x0BEF;&#x0C66;-&#x0C6F;&#x0CE6;-&#x0CEF;&#x0D66;-&#x0D6F;&#x0E50;-&#x0E59;&#x0ED0;-&#x0ED9;&#x0F20;-&#x0F29;]|\d)(\w|[_:])(\w|[_:.-])*;"/>
+ <RegExpr attribute="Entity" context="#stay" String="&amp;#(x[0-9a-fA-F]+|[0-9]+);"/>
+ <DetectChar attribute="Error" context="#stay" char="&amp;"/>
+ <DetectChar attribute="Error" context="#stay" char="%"/>
+ <DetectChar attribute="Error" context="#stay" char="&lt;"/>
+ <DetectChar attribute="Value" context="69:GEDecl endOrNDATA" char="'"/>
+ </context>
+
+ <context name="55:GEDecl PublicID" attribute="Error" lineEndContext="#stay">
+ <DetectChar attribute="Value" context="56:GEDecl PublicID qq" char="&quot;"/>
+ <DetectChar attribute="Value" context="57:GEDecl PublicID q" char="'"/>
+ <RegExpr attribute="Doctype Declaration" context="#stay" String="\s+"/>
+ </context>
+
+ <context name="56:GEDecl PublicID qq" attribute="Error" lineEndContext="#stay">
+ <DetectChar attribute="Value" context="58:GEDecl SystemID" char="&quot;(\s+|$)"/>
+ <RegExpr attribute="Value" context="#stay" String="[&#x20;&#xD;&#xA;a-zA-Z0-9'()+,./:=?;!*#@$_%-]"/>
+ </context>
+
+ <context name="57:GEDecl PublicID q" attribute="Value" lineEndContext="#stay">
+ <DetectChar attribute="Value" context="58:GEDecl SystemID" char="'(\s+|$)"/>
+ <RegExpr attribute="Value" context="#stay" String="[&#x20;&#xD;&#xA;a-zA-Z0-9()+,./:=?;!*#@$_%-]"/>
+ </context>
+
+ <context name="58:GEDecl SystemID" attribute="Error" lineEndContext="#stay">
+ <DetectChar attribute="Value" context="59:GEDecl SystemID qq" char="&quot;"/>
+ <DetectChar attribute="Value" context="60:GEDecl SystemID q" char="'"/>
+ <RegExpr attribute="Doctype Declaration" context="#stay" String="\s+"/>
+ </context>
+
+ <context name="59:GEDecl SystemID qq" attribute="Value" lineEndContext="#stay">
+ <DetectChar attribute="Value" context="69:GEDecl endOrNDATA" char="&quot;"/>
+ </context>
+
+ <context name="60:GEDecl SystemID q" attribute="Value" lineEndContext="#stay">
+ <DetectChar attribute="Value" context="69:GEDecl endOrNDATA" char="'"/>
+ </context>
+
+ <context name="61:PEDecl" attribute="Error" lineEndContext="#stay">
+ <RegExpr attribute="Entity" context="62:PEDecl EntityValueOrExternalID" String="(?![&#x0660;-&#x0669;&#x06F0;-&#x06F9;&#x0966;-&#x096F;&#x09E6;-&#x09EF;&#x0A66;-&#x0A6F;&#x0AE6;-&#x0AEF;&#x0B66;-&#x0B6F;&#x0BE7;-&#x0BEF;&#x0C66;-&#x0C6F;&#x0CE6;-&#x0CEF;&#x0D66;-&#x0D6F;&#x0E50;-&#x0E59;&#x0ED0;-&#x0ED9;&#x0F20;-&#x0F29;]|\d)(\w|[_:])(\w|[_:.-])*(\s+|$)"/>
+ <RegExpr attribute="Doctype Declaration" context="#stay" String="\s+"/>
+ </context>
+
+ <context name="62:PEDecl EntityValueOrExternalID" attribute="Error" lineEndContext="#stay">
+ <RegExpr attribute="Value" context="53:GEDecl EntityValue qq" String="&quot;"/>
+ <RegExpr attribute="Value" context="54:GEDecl EntityValue q" String="'"/>
+ <RegExpr attribute="Doctype Declaration" context="63:PEDecl PublicID" String="PUBLIC(\s+|$)"/>
+ <RegExpr attribute="Doctype Declaration" context="66:PEDecl SystemID" String="SYSTEM(\s+|$)"/>
+ </context>
+
+ <context name="63:PEDecl PublicID" attribute="Error" lineEndContext="#stay">
+ <DetectChar attribute="Value" context="64:PEDecl PublicID qq" char="&quot;"/>
+ <DetectChar attribute="Value" context="65:PEDecl PublicID q" char="'"/>
+ <RegExpr attribute="Doctype Declaration" context="#stay" String="\s+"/>
+ </context>
+
+ <context name="64:PEDecl PublicID qq" attribute="Error" lineEndContext="#stay">
+ <DetectChar attribute="Value" context="66:PEDecl SystemID" char="&quot;(\s+|$)"/>
+ <RegExpr attribute="Value" context="#stay" String="[&#x20;&#xD;&#xA;a-zA-Z0-9'()+,./:=?;!*#@$_%-]"/>
+ </context>
+
+ <context name="65:PEDecl PublicID q" attribute="Value" lineEndContext="#stay">
+ <DetectChar attribute="Value" context="66:PEDecl SystemID" char="'(\s+|$)"/>
+ <RegExpr attribute="Value" context="#stay" String="[&#x20;&#xD;&#xA;a-zA-Z0-9()+,./:=?;!*#@$_%-]"/>
+ </context>
+
+ <context name="66:PEDecl SystemID" attribute="Error" lineEndContext="#stay">
+ <DetectChar attribute="Value" context="67:PEDecl SystemID qq" char="&quot;"/>
+ <DetectChar attribute="Value" context="68:PEDecl SystemID q" char="'"/>
+ <RegExpr attribute="Doctype Declaration" context="#stay" String="\s+"/>
+ </context>
+
+ <context name="67:PEDecl SystemID qq" attribute="Value" lineEndContext="#stay">
+ <DetectChar attribute="Value" context="37:element end" char="&quot;"/>
+ </context>
+
+ <context name="68:PEDecl SystemID q" attribute="Value" lineEndContext="#stay">
+ <DetectChar attribute="Value" context="37:element end" char="'"/>
+ </context>
+
+ <context name="69:GEDecl endOrNDATA" attribute="Error" lineEndContext="#stay">
+ <DetectChar attribute="Doctype Declaration" context="23:Doctype Decl IS" char=">"/>
+ <RegExpr attribute="Doctype Declaration" context="70:GEDecl NDATA" String="NDATA(\s+|$)"/>
+ <RegExpr attribute="Doctype Declaration" context="#stay" String="\s+"/>
+ </context>
+
+ <context name="70:GEDecl NDATA" attribute="Error" lineEndContext="#stay">
+ <RegExpr attribute="Entity" context="37:element end" String="(?![&#x0660;-&#x0669;&#x06F0;-&#x06F9;&#x0966;-&#x096F;&#x09E6;-&#x09EF;&#x0A66;-&#x0A6F;&#x0AE6;-&#x0AEF;&#x0B66;-&#x0B6F;&#x0BE7;-&#x0BEF;&#x0C66;-&#x0C6F;&#x0CE6;-&#x0CEF;&#x0D66;-&#x0D6F;&#x0E50;-&#x0E59;&#x0ED0;-&#x0ED9;&#x0F20;-&#x0F29;]|\d)(\w|[_:])(\w|[_:.-])*"/>
+ <RegExpr attribute="Doctype Declaration" context="#stay" String="\s+"/>
+ </context>
+
+ <context name="71:NotationDecl Name" attribute="Error" lineEndContext="#stay">
+ <RegExpr attribute="Entity" context="72:NotationDecl ExternalID" String="(?![&#x0660;-&#x0669;&#x06F0;-&#x06F9;&#x0966;-&#x096F;&#x09E6;-&#x09EF;&#x0A66;-&#x0A6F;&#x0AE6;-&#x0AEF;&#x0B66;-&#x0B6F;&#x0BE7;-&#x0BEF;&#x0C66;-&#x0C6F;&#x0CE6;-&#x0CEF;&#x0D66;-&#x0D6F;&#x0E50;-&#x0E59;&#x0ED0;-&#x0ED9;&#x0F20;-&#x0F29;]|\d)(\w|[_:])(\w|[_:.-])*(\s+|$)"/>
+ <RegExpr attribute="Doctype Declaration" context="#stay" String="\s+"/>
+ </context>
+
+ <context name="72:NotationDecl ExternalID" attribute="Error" lineEndContext="#stay">
+ <RegExpr attribute="Doctype Declaration" context="73:NotationDecl PublicID" String="PUBLIC(\s+|$)"/>
+ <RegExpr attribute="Doctype Declaration" context="66:PEDecl SystemID" String="SYSTEM(\s+|$)"/>
+ <RegExpr attribute="Doctype Declaration" context="#stay" String="\s+"/>
+ </context>
+
+ <context name="73:NotationDecl PublicID" attribute="Error" lineEndContext="#stay">
+ <DetectChar attribute="Value" context="74:NotationDecl PublicID qq" char="&quot;"/>
+ <DetectChar attribute="Value" context="75:NotationDecl PublicID q" char="'"/>
+ <RegExpr attribute="Doctype Declaration" context="#stay" String="\s+"/>
+ </context>
+
+ <context name="74:NotationDecl PublicID qq" attribute="Error" lineEndContext="#stay">
+ <DetectChar attribute="Value" context="76:NotationDecl SystemIDOrEnd" char="&quot;(\s+|$)"/>
+ <RegExpr attribute="Value" context="#stay" String="[&#x20;&#xD;&#xA;a-zA-Z0-9'()+,./:=?;!*#@$_%-]"/>
+ </context>
+
+ <context name="75:NotationDecl PublicID q" attribute="Value" lineEndContext="#stay">
+ <DetectChar attribute="Value" context="76:NotationDecl SystemIDOrEnd" char="'(\s+|$)"/>
+ <RegExpr attribute="Value" context="#stay" String="[&#x20;&#xD;&#xA;a-zA-Z0-9()+,./:=?;!*#@$_%-]"/>
+ </context>
+
+ <context name="76:NotationDecl SystemIDOrEnd" attribute="Error" lineEndContext="#stay">
+ <DetectChar attribute="Value" context="67:PEDecl SystemID qq" char="&quot;"/>
+ <DetectChar attribute="Value" context="68:PEDecl SystemID q" char="'"/>
+ <DetectChar attribute="Doctype Declaration" context="23:Doctype Decl IS" char=">"/>
+ <RegExpr attribute="Doctype Declaration" context="#stay" String="\s+"/>
+ </context>
+
+ <context name="77:Comment inside IS" attribute="Comment" lineEndContext="#stay">
+ <RegExpr attribute="Error" context="23:Doctype Decl IS" String="--->"/>
+ <RegExpr attribute="Comment" context="23:Doctype Decl IS" String="-->"/>
+ <Detect2Chars attribute="Error" context="#stay" char="-" char1="-"/>
+ </context>
+
+ <context name="78:PI inside IS" attribute="Processing Instruction Body" lineEndContext="#stay">
+ <Detect2Chars attribute="Processing Instruction" context="23:Doctype Decl IS" char="?" char1="&gt;"/>
+ </context>
+
+ <context name="79:Outside" attribute="Normal Text" lineEndContext="#stay">
+ <RegExpr attribute="Error" context="80:STag" String="&lt;[xX][mM][lL](\w|[_.-])*(:(\w|[_.-])+)?"/>
+ <RegExpr attribute="Normal Tag" context="80:STag" String="&lt;(?![&#x0660;-&#x0669;&#x06F0;-&#x06F9;&#x0966;-&#x096F;&#x09E6;-&#x09EF;&#x0A66;-&#x0A6F;&#x0AE6;-&#x0AEF;&#x0B66;-&#x0B6F;&#x0BE7;-&#x0BEF;&#x0C66;-&#x0C6F;&#x0CE6;-&#x0CEF;&#x0D66;-&#x0D6F;&#x0E50;-&#x0E59;&#x0ED0;-&#x0ED9;&#x0F20;-&#x0F29;]|\d)(\w|_)(\w|[_.-])*(:(\w|[_.-])+)?"/>
+ <RegExpr attribute="Error" context="80:STag" String="&lt;(?![&#x0660;-&#x0669;&#x06F0;-&#x06F9;&#x0966;-&#x096F;&#x09E6;-&#x09EF;&#x0A66;-&#x0A6F;&#x0AE6;-&#x0AEF;&#x0B66;-&#x0B6F;&#x0BE7;-&#x0BEF;&#x0C66;-&#x0C6F;&#x0CE6;-&#x0CEF;&#x0D66;-&#x0D6F;&#x0E50;-&#x0E59;&#x0ED0;-&#x0ED9;&#x0F20;-&#x0F29;]|\d)(\w|[:_])(\w|[:_.-])*"/>
+ <RegExpr attribute="Error" context="85:ETag" String="&lt;/[xX][mM][lL](\w|[_.-])*(:(\w|[_.-])+)?"/>
+ <RegExpr attribute="Normal Tag" context="85:ETag" String="&lt;/(?![&#x0660;-&#x0669;&#x06F0;-&#x06F9;&#x0966;-&#x096F;&#x09E6;-&#x09EF;&#x0A66;-&#x0A6F;&#x0AE6;-&#x0AEF;&#x0B66;-&#x0B6F;&#x0BE7;-&#x0BEF;&#x0C66;-&#x0C6F;&#x0CE6;-&#x0CEF;&#x0D66;-&#x0D6F;&#x0E50;-&#x0E59;&#x0ED0;-&#x0ED9;&#x0F20;-&#x0F29;]|\d)(\w|_)(\w|[_.-])*(:(\w|[_.-])+)?"/>
+ <RegExpr attribute="Error" context="85:ETag" String="&lt;/(?![&#x0660;-&#x0669;&#x06F0;-&#x06F9;&#x0966;-&#x096F;&#x09E6;-&#x09EF;&#x0A66;-&#x0A6F;&#x0AE6;-&#x0AEF;&#x0B66;-&#x0B6F;&#x0BE7;-&#x0BEF;&#x0C66;-&#x0C6F;&#x0CE6;-&#x0CEF;&#x0D66;-&#x0D6F;&#x0E50;-&#x0E59;&#x0ED0;-&#x0ED9;&#x0F20;-&#x0F29;]|\d)(\w|[:_])(\w|[:_.-])*"/>
+ <RegExpr attribute="Entity" context="#stay" String="&amp;(?![&#x0660;-&#x0669;&#x06F0;-&#x06F9;&#x0966;-&#x096F;&#x09E6;-&#x09EF;&#x0A66;-&#x0A6F;&#x0AE6;-&#x0AEF;&#x0B66;-&#x0B6F;&#x0BE7;-&#x0BEF;&#x0C66;-&#x0C6F;&#x0CE6;-&#x0CEF;&#x0D66;-&#x0D6F;&#x0E50;-&#x0E59;&#x0ED0;-&#x0ED9;&#x0F20;-&#x0F29;]|\d)(\w|[_:])(\w|[_:.-])*;"/>
+ <RegExpr attribute="Entity" context="#stay" String="&amp;#(x[0-9a-fA-F]+|[0-9]+);"/>
+ <RegExpr attribute="Entity" context="86:CDSect" String="&lt;!\[CDATA\["/>
+ <RegExpr attribute="Comment" context="87:Comment inside IS" String="&lt;!--"/>
+ <RegExpr attribute="Normal Tag" context="88:PI inside IS" String="&lt;\?xml-stylesheet(\s|$)"/>
+ <RegExpr attribute="Error" context="88:PI inside IS" String="&lt;\?[xX][mM][lL](\w|[_.-])*(:(\w|[_.-])+)?"/>
+ <RegExpr attribute="Normal Tag" context="88:PI inside IS" String="&lt;\?(?![&#x0660;-&#x0669;&#x06F0;-&#x06F9;&#x0966;-&#x096F;&#x09E6;-&#x09EF;&#x0A66;-&#x0A6F;&#x0AE6;-&#x0AEF;&#x0B66;-&#x0B6F;&#x0BE7;-&#x0BEF;&#x0C66;-&#x0C6F;&#x0CE6;-&#x0CEF;&#x0D66;-&#x0D6F;&#x0E50;-&#x0E59;&#x0ED0;-&#x0ED9;&#x0F20;-&#x0F29;]|\d)(\w|_)(\w|[_.-])*(:(\w|[_.-])+)?"/>
+ <RegExpr attribute="Error" context="88:PI inside IS" String="&lt;\?(?![&#x0660;-&#x0669;&#x06F0;-&#x06F9;&#x0966;-&#x096F;&#x09E6;-&#x09EF;&#x0A66;-&#x0A6F;&#x0AE6;-&#x0AEF;&#x0B66;-&#x0B6F;&#x0BE7;-&#x0BEF;&#x0C66;-&#x0C6F;&#x0CE6;-&#x0CEF;&#x0D66;-&#x0D6F;&#x0E50;-&#x0E59;&#x0ED0;-&#x0ED9;&#x0F20;-&#x0F29;]|\d)(\w|[:_])(\w|[:_.-])*"/>
+ <DetectChar attribute="Error" context="#stay" char="&lt;"/>
+ <DetectChar attribute="Error" context="#stay" char="&amp;"/>
+ <RegExpr attribute="Error" context="#stay" String="\]\]>"/>
+ </context>
+
+ <context name="80:STag" attribute="Error" lineEndContext="#stay">
+ <Detect2Chars attribute="Normal Tag" context="79:Outside" char="/" char1="&gt;"/>
+ <DetectChar attribute="Normal Tag" context="79:Outside" char="&gt;"/>
+ <RegExpr attribute="Attribute" context="81:STag Attribute" String="(xmlns:(\w|[_.-])*|xmlns|xml:(lang|base|space))"/>
+ <RegExpr attribute="Error" context="81:STag Attribute" String="[xX][mM][lL](\w|[_.-])*(:(\w|[_.-])+)?"/>
+ <RegExpr attribute="Attribute" context="81:STag Attribute" String="(?![&#x0660;-&#x0669;&#x06F0;-&#x06F9;&#x0966;-&#x096F;&#x09E6;-&#x09EF;&#x0A66;-&#x0A6F;&#x0AE6;-&#x0AEF;&#x0B66;-&#x0B6F;&#x0BE7;-&#x0BEF;&#x0C66;-&#x0C6F;&#x0CE6;-&#x0CEF;&#x0D66;-&#x0D6F;&#x0E50;-&#x0E59;&#x0ED0;-&#x0ED9;&#x0F20;-&#x0F29;]|\d)(\w|_)(\w|[_.-])*(:(\w|[_.-])+)?"/>
+ <RegExpr attribute="Error" context="81:STag Attribute" String="(?![&#x0660;-&#x0669;&#x06F0;-&#x06F9;&#x0966;-&#x096F;&#x09E6;-&#x09EF;&#x0A66;-&#x0A6F;&#x0AE6;-&#x0AEF;&#x0B66;-&#x0B6F;&#x0BE7;-&#x0BEF;&#x0C66;-&#x0C6F;&#x0CE6;-&#x0CEF;&#x0D66;-&#x0D6F;&#x0E50;-&#x0E59;&#x0ED0;-&#x0ED9;&#x0F20;-&#x0F29;]|\d)(\w|[:_])(\w|[:_.-])*"/>
+ <RegExpr attribute="Normal Tag" context="#stay" String="\s+"/>
+ </context>
+
+ <context name="81:STag Attribute" attribute="Error" lineEndContext="#stay">
+ <DetectChar attribute="Attribute" context="82:STag Attribute Value" char="="/>
+ <RegExpr attribute="Normal Tag" context="#stay" String="\s+"/>
+ </context>
+
+ <context name="82:STag Attribute Value" attribute="Error" lineEndContext="#stay">
+ <DetectChar attribute="Value" context="83:STag Value qq" char="&quot;"/>
+ <DetectChar attribute="Value" context="84:STag Value q" char="'"/>
+ <RegExpr attribute="Normal Tag" context="#stay" String="\s+"/>
+ </context>
+
+ <context name="83:STag Value qq" attribute="Value" lineEndContext="#stay">
+ <RegExpr attribute="Entity" context="#stay" String="&amp;(?![&#x0660;-&#x0669;&#x06F0;-&#x06F9;&#x0966;-&#x096F;&#x09E6;-&#x09EF;&#x0A66;-&#x0A6F;&#x0AE6;-&#x0AEF;&#x0B66;-&#x0B6F;&#x0BE7;-&#x0BEF;&#x0C66;-&#x0C6F;&#x0CE6;-&#x0CEF;&#x0D66;-&#x0D6F;&#x0E50;-&#x0E59;&#x0ED0;-&#x0ED9;&#x0F20;-&#x0F29;]|\d)(\w|[_:])(\w|[_:.-])*;"/>
+ <RegExpr attribute="Entity" context="#stay" String="&amp;#(x[0-9a-fA-F]+|[0-9]+);"/>
+ <DetectChar attribute="Error" context="#stay" char="&amp;"/>
+ <DetectChar attribute="Error" context="#stay" char="&lt;"/>
+ <RegExpr attribute="Error" context="80:STag" String="&quot;(?=(?![&#x0660;-&#x0669;&#x06F0;-&#x06F9;&#x0966;-&#x096F;&#x09E6;-&#x09EF;&#x0A66;-&#x0A6F;&#x0AE6;-&#x0AEF;&#x0B66;-&#x0B6F;&#x0BE7;-&#x0BEF;&#x0C66;-&#x0C6F;&#x0CE6;-&#x0CEF;&#x0D66;-&#x0D6F;&#x0E50;-&#x0E59;&#x0ED0;-&#x0ED9;&#x0F20;-&#x0F29;]|\d)(\w|[_:]))"/>
+ <RegExpr attribute="Value" context="80:STag" String="&quot;(?=>|/>|\s|$)"/>
+ </context>
+
+ <context name="84:STag Value q" attribute="Value" lineEndContext="#stay">
+ <RegExpr attribute="Entity" context="#stay" String="&amp;(?![&#x0660;-&#x0669;&#x06F0;-&#x06F9;&#x0966;-&#x096F;&#x09E6;-&#x09EF;&#x0A66;-&#x0A6F;&#x0AE6;-&#x0AEF;&#x0B66;-&#x0B6F;&#x0BE7;-&#x0BEF;&#x0C66;-&#x0C6F;&#x0CE6;-&#x0CEF;&#x0D66;-&#x0D6F;&#x0E50;-&#x0E59;&#x0ED0;-&#x0ED9;&#x0F20;-&#x0F29;]|\d)(\w|[_:])(\w|[_:.-])*;"/>
+ <RegExpr attribute="Entity" context="#stay" String="&amp;#(x[0-9a-fA-F]+|[0-9]+);"/>
+ <DetectChar attribute="Error" context="#stay" char="&amp;"/>
+ <DetectChar attribute="Error" context="#stay" char="&lt;"/>
+ <RegExpr attribute="Error" context="80:STag" String="'(?=(?![&#x0660;-&#x0669;&#x06F0;-&#x06F9;&#x0966;-&#x096F;&#x09E6;-&#x09EF;&#x0A66;-&#x0A6F;&#x0AE6;-&#x0AEF;&#x0B66;-&#x0B6F;&#x0BE7;-&#x0BEF;&#x0C66;-&#x0C6F;&#x0CE6;-&#x0CEF;&#x0D66;-&#x0D6F;&#x0E50;-&#x0E59;&#x0ED0;-&#x0ED9;&#x0F20;-&#x0F29;]|\d)(\w|[_:]))"/>
+ <RegExpr attribute="Value" context="80:STag" String="'(?=>|/>|\s|$)"/>
+ </context>
+
+ <context name="85:ETag" attribute="Error" lineEndContext="#stay">
+ <DetectChar attribute="Normal Tag" context="79:Outside" char="&gt;"/>
+ <RegExpr attribute="Normal Tag" context="#stay" String="\s+"/>
+ </context>
+
+ <context name="86:CDSect" attribute="Normal Text" lineEndContext="#stay">
+ <RegExpr attribute="Entity" context="79:Outside" String="\]\]>"/>
+ </context>
+
+ <context name="87:Comment inside IS" attribute="Comment" lineEndContext="#stay">
+ <RegExpr attribute="Error" context="79:Outside" String="--->"/>
+ <RegExpr attribute="Comment" context="79:Outside" String="-->"/>
+ <Detect2Chars attribute="Error" context="#stay" char="-" char1="-"/>
+ </context>
+
+ <context name="88:PI inside IS" attribute="Processing Instruction Body" lineEndContext="#stay">
+ <Detect2Chars attribute="Processing Instruction" context="79:Outside" char="?" char1="&gt;"/>
+ </context>
+
+ </contexts>
+ <itemDatas>
+ <itemData name="Normal Text" defStyleNum="dsNormal"/>
+ <itemData name="Entity" defStyleNum="dsChar"/>
+ <itemData name="Normal Tag" defStyleNum="dsKeyword"/>
+ <itemData name="Attribute" defStyleNum="dsDataType"/>
+ <itemData name="Value" defStyleNum="dsString"/>
+ <itemData name="Doctype Declaration" defStyleNum="dsKeyword"/>
+ <itemData name="Comment" defStyleNum="dsComment"/>
+ <itemData name="Processing Instruction" defStyleNum="dsKeyword"/>
+ <itemData name="PI content" defStyleNum="dsOthers"/>
+ <itemData name="Stylesheet" defStyleNum="dsKeyword"/>
+ <itemData name="Error" defStyleNum="dsError"/>
+ </itemDatas>
+ </highlighting>
+ <general>
+ <comments>
+ <comment name="multiLine" start="&lt;!--" end="--&gt;"/>
+ </comments>
+ <keywords casesensitive="1"/>
+ </general>
+</language>
diff --git a/kate/data/xslt.xml b/kate/data/xslt.xml
new file mode 100644
index 000000000..b0462c6f8
--- /dev/null
+++ b/kate/data/xslt.xml
@@ -0,0 +1,379 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd"
+[
+ <!ENTITY qname "[A-Za-z_:][\w.:_-]*">
+ <!ENTITY entref "&amp;(#[0-9]+|#[xX][0-9A-Fa-f]+|&qname;);">
+ <!ENTITY axisname "ancestor|ancestor-or-self|attribute|child|descendant|descendant-or-self|following|following-sibling|namespace|parent|preceding|preceding-sibling|self">
+]>
+
+<!--
+ Kate syntax highlighting for XSLT
+ 2004 by Peter Lammich (views@gmx.de)
+ Published under the LGPL
+
+ TODO/FIXME
+
+ - Is qname - entity correct ??
+
+ - Integrate latest XML highlighting, that supports !DOCTYPE, ![CDATA[, Processing Instructions, ...
+ This version is mainly based on kate 2.1 XML highlighting file
+
+ - highlight functions only if they are followed by a '('. (How to do that ??)
+ - use <IncludeRules> to make things a bit more modular and cleaner
+
+ - I'd like to properly comment this file, but kate 2.1 (I have to work with it) behaves strange whith comments.
+ It seems to immediately stop processing a tag's content when encountering a comment
+
+ - Define own highlighting rules for patterns (Currently a pattern is highlighted as XPath)
+
+ - Highlight also XPath keywords, such as 'cast as'
+
+
+ DONE: Added XSLT 2.0 tag- and XPath2.0 and XSLT2.0 function keywords
+
+ FIXED: axis highlighting does not work, if identifier continues directly behind axis: (self::someWord)
+
+ DONE: highlight entity references
+ Do not replace the <RegExpr> by <IncludeEntities>, this is a kate 2.1 workaround !
+
+ FIXED axis-names are even highlighted if there are characters in front of them, i.e. in "xxxself::", "self::" would
+ be highlighted.
+ Now matching any qnames in XPath by own matcher
+
+ &varname; entity, what exactly is allowed by xslt ?
+ &varname; entity not used any more, variable names can be qnames.
+
+ CHANGED: Use the Alert style for the highlighting of todo and fixme, etc.
+ Comments are foldable, two dashes inside comment hl as error,
+ use the dsError style for Invalid data (Wilbert Berendsen, wbsoft@xs4all.nl)
+
+
+-->
+
+<language version="1.03" kateversion="2.1" name="xslt" section="Markup" extensions="*.xsl;*.xslt" license="LGPL" author="Peter Lammich (views@gmx.de)">
+ <highlighting>
+ <list name="keytags">
+ <item> xsl:value-of </item>
+ <item> xsl:output </item>
+ <item> xsl:decimal-format </item>
+ <item> xsl:apply-templates </item>
+ <item> xsl:param </item>
+ <item> xsl:transform </item>
+ <item> xsl:namespace-alias </item>
+ <item> xsl:comment </item>
+ <item> xsl:element </item>
+ <item> xsl:attribute </item>
+ <item> xsl:apply-imports </item>
+ <item> xsl:text </item>
+ <item> xsl:when </item>
+ <item> xsl:template </item>
+ <item> xsl:processing-instruction </item>
+ <item> xsl:include </item>
+ <item> xsl:copy-of </item>
+ <item> xsl:copy </item>
+ <item> xsl:with-param </item>
+ <item> xsl:stylesheet </item>
+ <item> xsl:for-each </item>
+ <item> xsl:choose </item>
+ <item> xsl:sort </item>
+ <item> xsl:otherwise </item>
+ <item> xsl:key </item>
+ <item> xsl:variable </item>
+ <item> xsl:number </item>
+ <item> xsl:message </item>
+ <item> xsl:fallback </item>
+ <item> xsl:strip-space </item>
+ <item> xsl:import </item>
+ <item> xsl:preserve-space </item>
+ <item> xsl:if </item>
+ <item> xsl:call-template </item>
+ <item> xsl:attribute-set </item>
+ </list>
+
+ <list name="keytags_2.0">
+ <item> xsl:perform-sort </item>
+ <item> xsl:import-schema </item>
+ <item> xsl:for-each-group </item>
+ <item> xsl:sequence </item>
+ <item> xsl:non-matching-substring </item>
+ <item> xsl:namespace </item>
+ <item> xsl:next-match </item>
+ <item> xsl:function </item>
+ <item> xsl:analyze-string </item>
+ <item> xsl:output-character </item>
+ <item> xsl:matching-substring </item>
+ <item> xsl:result-document </item>
+ <item> xsl:character-map </item>
+ <item> xsl:document </item>
+ </list>
+
+ <list name="functions">
+ <item> format-number </item>
+ <item> position </item>
+ <item> lang </item>
+ <item> substring-before </item>
+ <item> substring </item>
+ <item> normalize-space </item>
+ <item> round </item>
+ <item> translate </item>
+ <item> starts-with </item>
+ <item> concat </item>
+ <item> local-name </item>
+ <item> key </item>
+ <item> count </item>
+ <item> document </item>
+ <item> system-property </item>
+ <item> current </item>
+ <item> boolean </item>
+ <item> number </item>
+ <item> contains </item>
+ <item> name </item>
+ <item> last </item>
+ <item> unparsed-entity-uri </item>
+ <item> sum </item>
+ <item> generate-id </item>
+ <item> function-available </item>
+ <item> element-available </item>
+ <item> false </item>
+ <item> substring-after </item>
+ <item> not </item>
+ <item> string-length </item>
+ <item> id </item>
+ <item> floor </item>
+ <item> ceiling </item>
+ <item> namespace-uri </item>
+ <item> true </item>
+ <item> string </item>
+ <item> text </item>
+ </list>
+
+ <list name="functions_2.0">
+ <item> zero-or-one </item>
+ <item> replace </item>
+ <item> namespace-uri-for-prefix </item>
+ <item> current-grouping-key </item>
+ <item> seconds-from-duration </item>
+ <item> resolve-uri </item>
+ <item> node-kind </item>
+ <item> minutes-from-dateTime </item>
+ <item> implicit-timezone </item>
+ <item> exactly-one </item>
+ <item> current-time </item>
+ <item> current-dateTime </item>
+ <item> unordered </item>
+ <item> subtract-dates-yielding-dayTimeDuration </item>
+ <item> string-join </item>
+ <item> static-base-uri </item>
+ <item> months-from-duration </item>
+ <item> input </item>
+ <item> exists </item>
+ <item> default-collation </item>
+ <item> dateTime </item>
+ <item> current-group </item>
+ <item> current-date </item>
+ <item> collection </item>
+ <item> timezone-from-time </item>
+ <item> matches </item>
+ <item> local-name-from-QName </item>
+ <item> day-from-date </item>
+ <item> timezone-from-date </item>
+ <item> round-half-to-even </item>
+ <item> month-from-dateTime </item>
+ <item> month-from-date </item>
+ <item> hours-from-duration </item>
+ <item> escape-uri </item>
+ <item> distinct-values </item>
+ <item> avg </item>
+ <item> years-from-duration </item>
+ <item> unparsed-text </item>
+ <item> unparsed-entity-public-id </item>
+ <item> subtract-dateTimes-yielding-dayTimeDuration </item>
+ <item> subtract-dates-yielding-yearMonthDuration </item>
+ <item> string-to-codepoints </item>
+ <item> sequence-node-identical </item>
+ <item> hours-from-time </item>
+ <item> hours-from-dateTime </item>
+ <item> format-time </item>
+ <item> codepoints-to-string </item>
+ <item> trace </item>
+ <item> tokenize </item>
+ <item> subtract-dateTimes-yielding-yearMonthDuration </item>
+ <item> subsequence </item>
+ <item> seconds-from-dateTime </item>
+ <item> regex-group </item>
+ <item> one-or-more </item>
+ <item> node-name </item>
+ <item> namespace-uri-from-QName </item>
+ <item> min </item>
+ <item> idref </item>
+ <item> format-dateTime </item>
+ <item> format-date </item>
+ <item> days-from-duration </item>
+ <item> compare </item>
+ <item> base-uri </item>
+ <item> seconds-from-time </item>
+ <item> in-scope-prefixes </item>
+ <item> expanded-QName </item>
+ <item> adjust-date-to-timezone </item>
+ <item> year-from-date </item>
+ <item> resolve-QName </item>
+ <item> remove </item>
+ <item> QName </item>
+ <item> minutes-from-time </item>
+ <item> max </item>
+ <item> lower-case </item>
+ <item> index-of </item>
+ <item> doc </item>
+ <item> deep-equal </item>
+ <item> data </item>
+ <item> minutes-from-duration </item>
+ <item> adjust-dateTime-to-timezone </item>
+ <item> abs </item>
+ <item> timezone-from-dateTime </item>
+ <item> reverse </item>
+ <item> error </item>
+ <item> ends-with </item>
+ <item> day-from-dateTime </item>
+ <item> year-from-dateTime </item>
+ <item> upper-case </item>
+ <item> root </item>
+ <item> normalize-unicode </item>
+ <item> empty </item>
+ <item> insert-before </item>
+ <item> document-uri </item>
+ <item> adjust-time-to-timezone </item>
+ </list>
+
+ <contexts>
+
+ <context name="normalText" attribute="Normal Text" lineEndContext="#stay">
+ <StringDetect attribute="Comment" context="comment" String="&lt;!--" beginRegion="comment"/>
+ <DetectChar attribute="Tag" context="tagname" char="&lt;" />
+ <RegExpr attribute="Entity Reference" context="#stay" String="&entref;" />
+ </context>
+
+ <context name="detectEntRef" attribute="Normal Text" lineEndContext="#stay">
+ <RegExpr attribute="Entity Reference" context="#stay" String="&entref;" />
+ </context>
+
+ <context name="tagname" attribute="Tag" lineEndContext="#stay">
+ <keyword attribute="XSLT Tag" context="xattributes" String="keytags" />
+ <keyword attribute="XSLT 2.0 Tag" context="xattributes" String="keytags_2.0" />
+ <RegExpr attribute="Attribute" context="attributes" String="\s*" />
+ <DetectChar attribute="Tag" context="#pop" char="&gt;" />
+ </context>
+
+ <context name="attributes" attribute="Attribute" lineEndContext="#stay">
+ <Detect2Chars attribute="Tag" context="#pop#pop" char="/" char1="&gt;" />
+ <DetectChar attribute="Tag" context="#pop#pop" char="&gt;" />
+ <RegExpr attribute="Normal Text" context="attrValue" String="\s*=\s*" />
+ </context>
+
+ <context name="attrValue" attribute="Invalid" lineEndContext="#stay">
+ <Detect2Chars attribute="Invalid" context="#pop#pop#pop" char="/" char1="&gt;" />
+ <DetectChar attribute="Invalid" context="#pop#pop#pop" char="&gt;" />
+ <DetectChar attribute="Attribute Value" context="string" char="&quot;" />
+ <DetectChar attribute="Attribute Value" context="sqstring" char="'" />
+ </context>
+
+ <context name="xattributes" attribute="Attribute" lineEndContext="#stay">
+ <Detect2Chars attribute="Tag" context="#pop#pop" char="/" char1="&gt;" />
+ <DetectChar attribute="Tag" context="#pop#pop" char="&gt;" />
+ <RegExpr attribute="Attribute" context="xattrValue" String="select\s*=\s*" />
+ <RegExpr attribute="Attribute" context="xattrValue" String="test\s*=\s*" />
+ <RegExpr attribute="Attribute" context="xattrValue" String="match\s*=\s*" />
+ <RegExpr attribute="Attribute" context="attrValue" String="\s*=\s*" />
+ </context>
+
+ <context name="xattrValue" attribute="Invalid" lineEndContext="#stay">
+ <Detect2Chars attribute="Invalid" context="#pop#pop#pop" char="/" char1="&gt;" />
+ <DetectChar attribute="Invalid" context="#pop#pop#pop" char="&gt;" />
+ <DetectChar attribute="XPath" context="xpath" char="&quot;" />
+ <DetectChar attribute="XPath" context="sqxpath" char="'" />
+ </context>
+
+
+ <context name="string" attribute="Attribute Value" lineEndContext="#stay">
+ <DetectChar attribute="XPath" context="xpath" char="{" />
+ <DetectChar attribute="Attribute Value" context="#pop#pop" char="&quot;" />
+ <IncludeRules context="detectEntRef" />
+ </context>
+
+ <context name="sqstring" attribute="Attribute Value" lineEndContext="#stay">
+ <DetectChar attribute="XPath" context="sqxpath" char="{" />
+ <DetectChar attribute="Attribute Value" context="#pop#pop" char="'" />
+ <IncludeRules context="detectEntRef" />
+ </context>
+
+ <context name="comment" attribute="Comment" lineEndContext="#stay">
+ <StringDetect attribute="Comment" context="#pop" String="--&gt;" endRegion="comment" />
+ <RegExpr attribute="Invalid" context="#stay" String="-(-(?!-&gt;))+" />
+ <RegExpr attribute="Alert" context="#stay" String="(FIXME|TODO|HACK)" />
+ </context>
+
+ <context name="xpath" attribute="XPath" lineEndContext="#stay">
+ <keyword attribute="XPath/ XSLT Function" context="#stay" String="functions" />
+ <keyword attribute="XPath 2.0/ XSLT 2.0 Function" context="#stay" String="functions_2.0" />
+ <RegExpr attribute="XPath Axis" context="#stay" String="(&axisname;)::" />
+ <DetectChar attribute="XPath" context="#pop" char="}" />
+ <DetectChar attribute="XPath String" context="sqxpathstring" char="'" />
+ <DetectChar attribute="XPath" context="#pop#pop" char="&quot;" />
+ <RegExpr attribute="XPath Attribute" context="#stay" String="@&qname;" />
+ <RegExpr attribute="Variable" context="#stay" String="\$&qname;" />
+ <RegExpr attribute="XPath" context="#stay" String="&qname;" />
+ <DetectChar attribute="Invalid" context="#stay" char="$" />
+ <IncludeRules context="detectEntRef" />
+ </context>
+
+ <context name="sqxpath" attribute="XPath" lineEndContext="#stay">
+ <keyword attribute="XPath/ XSLT Function" context="#stay" String="functions" />
+ <keyword attribute="XPath 2.0/ XSLT 2.0 Function" context="#stay" String="functions_2.0" />
+ <RegExpr attribute="XPath Axis" context="#stay" String="(&axisname;)::" />
+ <DetectChar attribute="XPath" context="#pop" char="}" />
+ <DetectChar attribute="XPath String" context="xpathstring" char="&quot;" />
+ <DetectChar attribute="XPath" context="#pop#pop" char="'" />
+ <RegExpr attribute="XPath Attribute" context="#stay" String="@&qname;" />
+ <RegExpr attribute="Variable" context="#stay" String="\$&qname;" />
+ <RegExpr attribute="XPath" context="#stay" String="&qname;" />
+ <DetectChar attribute="Invalid" context="#stay" char="$" />
+ <IncludeRules context="detectEntRef" />
+ </context>
+
+ <context name="sqxpathstring" attribute="XPath String" lineEndContext="#stay">
+ <DetectChar attribute="XPath String" context="#pop" char="'" />
+ <IncludeRules context="detectEntRef" />
+ </context>
+
+ <context name="xpathstring" attribute="XPath String" lineEndContext="#stay">
+ <DetectChar attribute="XPath String" context="#pop" char="&quot;" />
+ <IncludeRules context="detectEntRef" />
+ </context>
+
+ </contexts>
+ <itemDatas>
+ <itemData name="Normal Text" defStyleNum="dsNormal"/>
+ <itemData name="Tag" defStyleNum="dsKeyword"/>
+ <itemData name="Attribute" defStyleNum="dsOthers"/>
+ <itemData name="Invalid" defStyleNum="dsError"/>
+ <itemData name="Alert" defStyleNum="dsAlert"/>
+ <itemData name="Attribute Value" defStyleNum="dsString" color="#800000" selColor="#ffffff" bold="0" italic="0"/>
+ <itemData name="XPath" defStyleNum="dsOthers" color="#008080" selColor="#ffffff" bold="0" italic="0"/>
+ <itemData name="XPath String" defStyleNum="dsString" color="#800000" selColor="#ffffff" bold="0" italic="0"/>
+ <itemData name="XPath Axis" defStyleNum="dsKeyword" color="#008080" selColor="#ffffff" bold="0" italic="1"/>
+ <itemData name="XPath/ XSLT Function" defStyleNum="dsKeyword" color="#008080" selColor="#ffffff" bold="1" italic="0"/>
+ <itemData name="XPath 2.0/ XSLT 2.0 Function" defStyleNum="dsKeyword" color="#008080" selColor="#ffffff" bold="1" italic="0"/>
+ <itemData name="XPath Attribute" defStyleNum="dsNormal" color="#008080" selColor="#ffffff" bold="0" italic="1" />
+ <itemData name="Variable" defStyleNum="dsNormal" color="#008080" selColor="#ffffff" bold="0" italic="1" />
+ <itemData name="Comment" defStyleNum="dsComment"/>
+ <itemData name="XSLT Tag" defStyleNum="dsKeyword" color="#000080" selColor="#ffffff" bold="1" italic="0" />
+ <itemData name="XSLT 2.0 Tag" defStyleNum="dsKeyword" color="#000080" selColor="#ffffff" bold="1" italic="0" />
+ <itemData name="Entity Reference" defStyleNum="dsDecVal" />
+ </itemDatas>
+ </highlighting>
+ <general>
+ <comments>
+ <comment name="multiLine" start="&lt;!--" end="--&gt;" />
+ </comments>
+ <keywords casesensitive="0" weakDeliminator="-:" additionalDeliminator="&quot;{}"/>
+ </general>
+</language>
diff --git a/kate/data/yacas.xml b/kate/data/yacas.xml
new file mode 100644
index 000000000..f7d8ef5e4
--- /dev/null
+++ b/kate/data/yacas.xml
@@ -0,0 +1,237 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+<language name="yacas" version="1.02" kateversion="2.3" section="Sources" extensions="*.ys" mimetype="text/x-yacassrc">
+ <highlighting>
+ <list name="keywords">
+ <item> And </item>
+ <item> ApplyPure </item>
+ <item> ArrayCreate </item>
+ <item> ArrayGet </item>
+ <item> ArraySet </item>
+ <item> ArraySize </item>
+ <item> Atom </item>
+ <item> Berlekamp </item>
+ <item> BitAnd </item>
+ <item> BitOr </item>
+ <item> BitXor </item>
+ <item> Bodied </item>
+ <item> CTokenizer </item>
+ <item> Check </item>
+ <item> Clear </item>
+ <item> CommonLispTokenizer </item>
+ <item> Concat </item>
+ <item> ConcatStrings </item>
+ <item> CurrentFile </item>
+ <item> CurrentLine </item>
+ <item> CustomEval </item>
+ <item> CustomEval'Expression </item>
+ <item> CustomEval'Locals </item>
+ <item> CustomEval'Result </item>
+ <item> CustomEval'Stop </item>
+ <item> DefLoad </item>
+ <item> DefLoadFunction </item>
+ <item> DefMacroRuleBase </item>
+ <item> DefMacroRuleBaseListed </item>
+ <item> DefaultDirectory </item>
+ <item> DefaultTokenizer </item>
+ <item> Delete </item>
+ <item> DestructiveDelete </item>
+ <item> DestructiveInsert </item>
+ <item> DestructiveReplace </item>
+ <item> DestructiveReverse </item>
+ <item> DllEnumerate </item>
+ <item> DllLoad </item>
+ <item> DllUnload </item>
+ <item> Equals </item>
+ <item> Eval </item>
+ <item> FastArcCos </item>
+ <item> FastArcSin </item>
+ <item> FastArcTan </item>
+ <item> FastAssoc </item>
+ <item> FastCos </item>
+ <item> FastExp </item>
+ <item> FastIsPrime </item>
+ <item> FastLog </item>
+ <item> FastPower </item>
+ <item> FastSin </item>
+ <item> FastTan </item>
+ <item> FindFile </item>
+ <item> FindFunction </item>
+ <item> FlatCopy </item>
+ <item> FromBase </item>
+ <item> FromFile </item>
+ <item> FromString </item>
+ <item> FullForm </item>
+ <item> GarbageCollect </item>
+ <item> GenericTypeName </item>
+ <item> GetExtraInfo </item>
+ <item> GetPrecision </item>
+ <item> GreaterThan </item>
+ <item> Head </item>
+ <item> Hold </item>
+ <item> HoldArg </item>
+ <item> If </item>
+ <item> Infix </item>
+ <item> Insert </item>
+ <item> IsAtom </item>
+ <item> IsBodied </item>
+ <item> IsBound </item>
+ <item> IsFunction </item>
+ <item> IsGeneric </item>
+ <item> IsInfix </item>
+ <item> IsInteger </item>
+ <item> IsList </item>
+ <item> IsNumber </item>
+ <item> IsPostfix </item>
+ <item> IsPrefix </item>
+ <item> IsString </item>
+ <item> LazyGlobal </item>
+ <item> LeftPrecedence </item>
+ <item> Length </item>
+ <item> LessThan </item>
+ <item> LispRead </item>
+ <item> LispReadListed </item>
+ <item> List </item>
+ <item> Listify </item>
+ <item> Load </item>
+ <item> Local </item>
+ <item> LocalSymbols </item>
+ <item> MacroClear </item>
+ <item> MacroLocal </item>
+ <item> MacroRule </item>
+ <item> MacroRuleBase </item>
+ <item> MacroRuleBaseListed </item>
+ <item> MacroRulePattern </item>
+ <item> MacroSet </item>
+ <item> MathAbs </item>
+ <item> MathAdd </item>
+ <item> MathAnd </item>
+ <item> MathArcCos </item>
+ <item> MathArcSin </item>
+ <item> MathArcTan </item>
+ <item> MathCeil </item>
+ <item> MathCos </item>
+ <item> MathDiv </item>
+ <item> MathDivide </item>
+ <item> MathExp </item>
+ <item> MathFac </item>
+ <item> MathFloor </item>
+ <item> MathGcd </item>
+ <item> MathGetExactBits </item>
+ <item> MathLibrary </item>
+ <item> MathLog </item>
+ <item> MathMod </item>
+ <item> MathMultiply </item>
+ <item> MathNot </item>
+ <item> MathNth </item>
+ <item> MathOr </item>
+ <item> MathPi </item>
+ <item> MathPower </item>
+ <item> MathSetExactBits </item>
+ <item> MathSin </item>
+ <item> MathSqrt </item>
+ <item> MathSubtract </item>
+ <item> MathTan </item>
+ <item> MaxEvalDepth </item>
+ <item> Not </item>
+ <item> OpLeftPrecedence </item>
+ <item> OpPrecedence </item>
+ <item> OpRightPrecedence </item>
+ <item> Or </item>
+ <item> PatchLoad </item>
+ <item> PatchString </item>
+ <item> PatternCreate </item>
+ <item> PatternMatches </item>
+ <item> Postfix </item>
+ <item> Precision </item>
+ <item> Prefix </item>
+ <item> PrettyPrinter </item>
+ <item> Prog </item>
+ <item> Read </item>
+ <item> ReadToken </item>
+ <item> Replace </item>
+ <item> Retract </item>
+ <item> RightAssociative </item>
+ <item> RightPrecedence </item>
+ <item> Rule </item>
+ <item> RuleBase </item>
+ <item> RuleBaseArgList </item>
+ <item> RuleBaseDefined </item>
+ <item> RuleBaseListed </item>
+ <item> RulePattern </item>
+ <item> Secure </item>
+ <item> Set </item>
+ <item> SetExtraInfo </item>
+ <item> SetStringMid </item>
+ <item> ShiftLeft </item>
+ <item> ShiftRight </item>
+ <item> String </item>
+ <item> StringMid </item>
+ <item> Subst </item>
+ <item> SystemCall </item>
+ <item> Tail </item>
+ <item> ToBase </item>
+ <item> ToFile </item>
+ <item> ToString </item>
+ <item> TraceRule </item>
+ <item> TraceStack </item>
+ <item> Type </item>
+ <item> UnFence </item>
+ <item> UnList </item>
+ <item> Use </item>
+ <item> Version </item>
+ <item> While </item>
+ <item> Write </item>
+ <item> WriteString </item>
+ <item> XmlExplodeTag </item>
+ <item> XmlTokenizer </item>
+ <item> ` </item>
+ <item> = </item>
+ </list>
+ <contexts>
+ <context name="default" attribute="Normal Text" lineEndContext="#stay">
+ <DetectChar attribute="String" context="string" char="&quot;"/>
+ <Detect2Chars attribute="Comment" context="linecomment" char="/" char1="/"/>
+ <Detect2Chars attribute="Comment" context="multilinecomment" char="/" char1="*"/>
+ <keyword attribute="Keyword" context="#stay" String="keywords"/>
+ <AnyChar attribute="Parens" context="#stay" String="{[(" beginRegion="brace"/>
+ <AnyChar attribute="Parens" context="#stay" String="}])" endRegion="brace"/>
+ <AnyChar attribute="Symbol" context="#stay" String="+-*/=`~:!@#$^&amp;*_|&lt;&gt;"/>
+
+ <Float attribute="Float" context="#stay"/>
+ <Int attribute="Decimal" context="#stay"/>
+ </context>
+ <context name="string" attribute="String" lineEndContext="#pop">
+ <LineContinue attribute="String" context="#stay"/>
+ <DetectChar attribute="String" context="#pop" char="&quot;"/>
+ </context>
+ <context name="linecomment" attribute="Comment" lineEndContext="#pop">
+ <RegExpr attribute="Highlight" context="#stay" String="(FIXME|TODO)" />
+ </context>
+ <context name="multilinecomment" attribute="Comment" lineEndContext="#stay">
+ <Detect2Chars attribute="Comment" context="#pop" char="*" char1="/"/>
+ <RegExpr attribute="Highlight" context="#stay" String="(FIXME|TODO)" />
+ </context>
+ </contexts>
+ <itemDatas>
+ <itemData name="Normal Text" defStyleNum="dsNormal"/>
+ <itemData name="Keyword" defStyleNum="dsKeyword"/>
+ <itemData name="Decimal" defStyleNum="dsDecVal"/>
+ <itemData name="Float" defStyleNum="dsFloat"/>
+ <itemData name="Char" defStyleNum="dsChar"/>
+ <itemData name="String" defStyleNum="dsString"/>
+ <itemData name="Comment" defStyleNum="dsComment"/>
+ <itemData name="Symbol" defStyleNum="dsOthers"/>
+ <itemData name="Parens" defStyleNum="dsNormal"/>
+ <itemData name="Highlight" defStyleNum="dsAlert"/>
+ </itemDatas>
+ </highlighting>
+ <general>
+ <comments>
+ <comment name="singleLine" start="//" />
+ <comment name="multiLine" start="/*" end="*/" />
+ </comments>
+ <keywords casesensitive="1" weakDeliminator="=`"/>
+ </general>
+</language>
+<!-- kate: space-indent on; indent-width 2; replace-tabs on; -->
diff --git a/kate/data/yacc.xml b/kate/data/yacc.xml
new file mode 100644
index 000000000..db45ed42d
--- /dev/null
+++ b/kate/data/yacc.xml
@@ -0,0 +1,159 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+<!--
+ ========================================================================
+
+ YACC.XML supports syntax highlighting for Yacc/Bison source under Kate.
+
+ Copyright (C) 2004 - Jan Villat <jan.villat@net2000.ch>
+ This code is released under the LGPL as part of kdelibs/kate.
+
+ ========================================================================
+
+ Updates for YACC.XML can be obtained from http://kate.kde.org/hl/
+
+ UPDATE HISTORY:-
+ 2004.05.26 - YACC.XML 1.00 - First released.
+
+ TODO:-
+ - Add a mime type (cannot find it !?)
+
+ ========================================================================
+-->
+<language name="Yacc/Bison" version="1.03" kateversion="2.4" section="Sources" extensions="*.y" author="Jan Villat (jan.villat@net2000.ch)" license="LGPL">
+
+<highlighting>
+<contexts>
+ <context name="Pre Start" attribute="Normal Text" lineEndContext="#stay">
+ <IncludeRules context="Comment" />
+ <DetectSpaces />
+ <Detect2Chars attribute="Content-Type Delimiter" context="C Declarations" char="%" char1="{" beginRegion="cdeclarations" column="0" />
+ <RegExpr attribute="Normal Text" context="Declarations" String="." beginRegion="declarations" lookAhead="true" />
+ </context>
+
+ <context name="C Declarations" attribute="Normal Text" lineEndContext="#stay">
+ <IncludeRules context="Comment" />
+ <Detect2Chars attribute="Content-Type Delimiter" context="#pop" char="%" char1="}" endRegion="cdeclarations" column="0" />
+ <IncludeRules context="##C++" />
+ </context>
+
+ <context name="Declarations" attribute="Normal Text" lineEndContext="#stay">
+ <IncludeRules context="Comment" />
+ <StringDetect attribute="Directive" context="Union Start" String="%union" />
+ <Detect2Chars attribute="Content-Type Delimiter" context="Rules" char="%" char1="%" beginRegion="rules" endRegion="declarations" />
+
+ <!-- not sure that strict yacc allows that ... but it is commonly used -->
+ <Detect2Chars attribute="Content-Type Delimiter" context="C Declarations" char="%" char1="{" beginRegion="cdeclarations" column="0" />
+
+ <DetectChar attribute="Directive" context="Percent Command" char="%" />
+ </context>
+
+ <context name="Union Start" attribute="Normal Text" lineEndContext="#stay">
+ <IncludeRules context="Comment" />
+ <DetectSpaces />
+ <DetectChar attribute="Normal Text" context="Union In" char="{" beginRegion="union" />
+ <RegExpr attribute="Alert" context="#pop" String="." />
+ </context>
+ <context name="Union In" attribute="Normal Text" lineEndContext="#stay">
+ <DetectChar attribute="Normal Text" context="Union InIn" char="{" />
+ <DetectChar attribute="Normal Text" context="#pop#pop" char="}" endRegion="union" />
+ <IncludeRules context="##C++" />
+ </context>
+ <context name="Union InIn" attribute="Normal Text" lineEndContext="#stay">
+ <DetectChar attribute="Normal Text" context="Union InIn" char="{" />
+ <DetectChar attribute="Normal Text" context="#pop" char="}" />
+ <IncludeRules context="##C++" />
+ </context>
+
+ <context name="Rules" attribute="Rule" lineEndContext="#stay">
+ <IncludeRules context="Comment" />
+ <Detect2Chars attribute="Content-Type Delimiter" context="User Code" char="%" char1="%" beginRegion="code" endRegion="rules" />
+ <DetectChar attribute="Normal Text" context="Rule In" char=":" beginRegion="rule" />
+ </context>
+
+ <context name="Rule In" attribute="Definition" lineEndContext="#stay">
+ <IncludeRules context="Comment" />
+ <DetectChar attribute="Normal Text" context="#pop" char=";" endRegion="rule" />
+ <DetectChar attribute="Normal Text" context="Normal C Bloc" char="{" beginRegion="bloc" />
+ <DetectChar attribute="Normal Text" context="#stay" char="|" />
+ <IncludeRules context="StringOrChar" />
+ </context>
+
+ <context name="User Code" attribute="Normal Text" lineEndContext="#stay">
+ <IncludeRules context="##C++" />
+ </context>
+
+ <context name="Percent Command" attribute="Directive" lineEndContext="#pop">
+ <IncludeRules context="Comment" />
+ <RegExpr attribute="Normal Text" context="Percent Command In" String="\W" lookAhead="true" />
+ </context>
+ <context name="Percent Command In" attribute="NormalText" lineEndContext="#pop#pop">
+ <IncludeRules context="StringOrChar" />
+ <DetectChar attribute="Data Type" context="PC type" char="&lt;" />
+ </context>
+ <context name="PC type" attribute="Data Type" lineEndContext="#pop#pop#pop">
+ <DetectChar attribute="Data Type" context="#pop" char="&gt;" />
+ </context>
+
+ <context name="Comment" attribute="Comment">
+ <Detect2Chars attribute="Comment" context="CommentStar" char="/" char1="*" />
+ <!-- not sure that strict yacc allows that ... but I saw it in some sources ... -->
+ <Detect2Chars attribute="Comment" context="CommentSlash" char="/" char1="/" />
+ </context>
+ <context name="CommentStar" attribute="Comment" lineEndContext="#stay">
+ <Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" />
+ </context>
+ <context name="CommentSlash" attribute="Comment" lineEndContext="#stay">
+ <RegExpr attribute="Comment" context="#pop" String="[^\\]$" />
+ </context>
+
+ <context name="StringOrChar" attribute="NormalText">
+ <DetectChar attribute="String Char" context="Char" char="'" />
+ <DetectChar attribute="String" context="String" char="&quot;" />
+ </context>
+ <context name="String" attribute="String" lineEndContext="#pop">
+ <RegExpr attribute="Backslash Code" context="#stay" String="\\." />
+ <DetectChar attribute="String" context="#pop" char="&quot;" />
+ </context>
+ <context name="Char" attribute="String Char" lineEndContext="#pop">
+ <RegExpr attribute="Backslash Code" context="#stay" String="\\." />
+ <DetectChar attribute="String Char" context="#pop" char="'" />
+ </context>
+
+ <context name="Normal C Bloc" attribute="Normal Text" lineEndContext="#stay">
+ <DetectChar attribute="Normal Text" context="Normal C Bloc" char="{" beginRegion="bloc" />
+ <DetectChar attribute="Normal Text" context="#pop" char="}" endRegion="bloc" />
+ <IncludeRules context="##C++" />
+ <DetectChar attribute="Directive" context="Dol" char="$" />
+ </context>
+ <context name="Dol" attribute="Normal Text" fallthrough="true" fallthroughContext="DolEnd">
+ <RegExpr attribute="Data Type" context="DolEnd" String="&lt;[^&gt;]+&gt;" />
+ </context>
+ <context name="DolEnd" attribute="Normal Text">
+ <RegExpr attribute="Directive" context="#pop#pop" String="\d+" />
+ <DetectChar attribute="Directive" context="#pop#pop" char="$" />
+ </context>
+</contexts>
+
+<itemDatas>
+ <itemData name="Normal Text" defStyleNum="dsNormal" />
+ <itemData name="Definition" defStyleNum="dsNormal" />
+ <itemData name="Comment" defStyleNum="dsComment" />
+ <itemData name="Content-Type Delimiter" defStyleNum="dsBaseN" bold="1" />
+ <itemData name="Directive" defStyleNum="dsKeyword"/>
+ <itemData name="Rule" defStyleNum="dsString" />
+ <itemData name="Backslash Code" defStyleNum="dsString" bold="1" />
+ <itemData name="Alert" defStyleNum="dsAlert" />
+ <itemData name="String" defStyleNum="dsString"/>
+ <itemData name="String Char" defStyleNum="dsChar"/>
+ <itemData name="Data Type" defStyleNum="dsDataType"/>
+</itemDatas>
+
+</highlighting>
+<general>
+ <comments>
+ <comment name="multiLine" start="/*" end="*/" />
+ </comments>
+</general>
+</language>
+<!-- kate: space-indent on; indent-width 2; replace-tabs on; -->
diff --git a/kate/interfaces/.kateconfig b/kate/interfaces/.kateconfig
new file mode 100644
index 000000000..5b0885abe
--- /dev/null
+++ b/kate/interfaces/.kateconfig
@@ -0,0 +1 @@
+kate: space-indent on; indent-width 2; replace-tabs on;
diff --git a/kate/interfaces/Makefile.am b/kate/interfaces/Makefile.am
new file mode 100644
index 000000000..175dcf381
--- /dev/null
+++ b/kate/interfaces/Makefile.am
@@ -0,0 +1,12 @@
+METASOURCES = document.moc view.moc
+
+lib_LTLIBRARIES = libkatepartinterfaces.la
+
+libkatepartinterfaces_la_SOURCES = interfaces.cpp katecmd.cpp
+libkatepartinterfaces_la_LIBADD = $(top_builddir)/interfaces/ktexteditor/libktexteditor.la
+libkatepartinterfaces_la_LDFLAGS = $(all_libraries) $(KDE_RPATH) -no-undefined
+
+kateinclude_HEADERS = document.h view.h
+kateincludedir = $(includedir)/kate
+
+INCLUDES= -I$(top_srcdir)/interfaces -I$(top_srcdir)/kparts -I$(top_srcdir) $(all_includes)
diff --git a/kate/interfaces/document.h b/kate/interfaces/document.h
new file mode 100644
index 000000000..6e7cb9a56
--- /dev/null
+++ b/kate/interfaces/document.h
@@ -0,0 +1,407 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2001 Christoph Cullmann <cullmann@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef _KATE_DOCUMENT_INCLUDE_
+#define _KATE_DOCUMENT_INCLUDE_
+
+#include <ktexteditor/document.h>
+#include <ktexteditor/view.h>
+#include <ktexteditor/editinterface.h>
+#include <ktexteditor/undointerface.h>
+#include <ktexteditor/cursorinterface.h>
+#include <ktexteditor/documentinfo.h>
+#include <ktexteditor/selectioninterface.h>
+#include <ktexteditor/selectioninterfaceext.h>
+#include <ktexteditor/blockselectioninterface.h>
+#include <ktexteditor/searchinterface.h>
+#include <ktexteditor/highlightinginterface.h>
+#include <ktexteditor/configinterface.h>
+#include <ktexteditor/configinterfaceextension.h>
+#include <ktexteditor/markinterface.h>
+#include <ktexteditor/markinterfaceextension.h>
+#include <ktexteditor/wordwrapinterface.h>
+#include <ktexteditor/printinterface.h>
+#include <ktexteditor/variableinterface.h>
+
+#include <kaction.h>
+
+class KCompletion;
+
+/**
+ * Kate namespace
+ * All classes in this namespace must stay BC
+ * during one major release series (e.g. 3.x, 4.x, ...)
+ */
+namespace Kate
+{
+
+class View;
+
+class KATEPARTINTERFACES_EXPORT Cursor : public KTextEditor::Cursor
+{
+ public:
+ Cursor () { ; };
+ virtual ~Cursor () { ; };
+};
+
+class KATEPARTINTERFACES_EXPORT ConfigPage : public KTextEditor::ConfigPage
+{
+ Q_OBJECT
+
+ public:
+ ConfigPage ( QWidget *parent=0, const char *name=0 ) : KTextEditor::ConfigPage (parent, name) { ; };
+ virtual ~ConfigPage () { ; };
+
+ public slots:
+ virtual void apply () { ; };
+ virtual void reload () { ; };
+ virtual void reset () {};
+ virtual void defaults () {};
+
+ protected slots:
+ void slotChanged();
+};
+
+class KATEPARTINTERFACES_EXPORT ActionMenu : public KActionMenu
+{
+ Q_OBJECT
+
+ public:
+ ActionMenu ( const QString& text, QObject* parent = 0, const char* name = 0 )
+ : KActionMenu(text, parent, name) { ; };
+ virtual ~ActionMenu () { ; };
+
+ public:
+ virtual void updateMenu (class Document *) = 0;
+};
+
+/**
+ * Kate Commands
+ */
+class KATEPARTINTERFACES_EXPORT Command
+{
+ public:
+ Command () {};
+ virtual ~Command () {};
+
+ public:
+ /**
+ * Pure text start part of the commands which can be handled by this object
+ * which means i.e. for s/sdl/sdf/g => s or for char:1212 => char
+ */
+ virtual QStringList cmds () = 0;
+
+ /**
+ * Execute this command for the given view and cmd string, return a bool
+ * about success, msg for status
+ */
+ virtual bool exec (View *view, const QString &cmd, QString &msg) = 0;
+
+ /**
+ * Shows help for the given view and cmd string, return a bool
+ * about success, msg for status
+ */
+ virtual bool help (View *view, const QString &cmd, QString &msg) = 0;
+};
+
+/**
+ * Extension to the Command interface, allowing to interact with commands
+ * during typing. This allows for completion and for example the isearch
+ * plugin. If you develop a command that wants to complete or process text
+ * as thu user types the arguments, or that has flags, you can have
+ * your command inherit this class.
+ */
+class CommandExtension
+{
+ public:
+ CommandExtension() {;}
+ virtual ~CommandExtension() {;}
+
+ /**
+ * Fill in a list of flags to complete from. Each flag is a single letter,
+ * any following text in the string is taken to be a description of the
+ * flag's meaning, and showed to the user as a hint.
+ * Implement this method if your command has flags.
+ *
+ * This method is called each time the flag string in the typed command
+ * is changed, so that the available flags can be adjusted. When completions
+ * are displayed, existing flags are left out.
+ *
+ */ //### this is yet to be tried
+ virtual void flagCompletions( QStringList& /*list*/ ) {;}
+
+ /**
+ * @return a KCompletion object that will substitute the command line default
+ * one while typing the first argument to the command. The text will be
+ * added to the command seperated by one space character.
+ *
+ * Implement this method if your command can provide a completion object.
+ *
+ * @param cmdname The command name associated with this request.
+ */
+ virtual KCompletion *completionObject( const QString & cmdname, Kate::View * /*view*/ ) { Q_UNUSED(cmdname); return 0L; }
+
+ /**
+ * @return whether this command wants to process text interactively given the @p cmdname.
+ * If true, the command's processText() method is called when the
+ * text in the command line is changed.
+ *
+ * Reimplement this to return true, if your commands wants to process the
+ * text as typed.
+ *
+ * @param cmdname the command name associated with this query.
+ */
+ virtual bool wantsToProcessText( const QString &cmdname ) { Q_UNUSED(cmdname); return false; }
+
+ /**
+ * This is called by the commandline each time the argument text for the
+ * command changes, if wantsToProcessText() returns true.
+ * @param view The current view
+ * @param text The current command text typed by the user.
+ */ // ### yet to be tested. The obvious candidate is isearch.
+ virtual void processText( Kate::View *view, const QString &text ) { Q_UNUSED(view); Q_UNUSED(text); }
+};
+
+/** This interface provides access to the Kate Document class.
+*/
+class KATEPARTINTERFACES_EXPORT Document : public KTextEditor::Document, public KTextEditor::EditInterface,
+ public KTextEditor::UndoInterface, public KTextEditor::CursorInterface,
+ public KTextEditor::SelectionInterface, public KTextEditor::SearchInterface,
+ public KTextEditor::HighlightingInterface, public KTextEditor::BlockSelectionInterface,
+ public KTextEditor::ConfigInterface, public KTextEditor::MarkInterface,
+ public KTextEditor::PrintInterface, public KTextEditor::WordWrapInterface,
+ public KTextEditor::MarkInterfaceExtension,
+ public KTextEditor::SelectionInterfaceExt
+{
+ Q_OBJECT
+
+ public:
+ Document ();
+ Document ( QObject* parent, const char* name );
+ virtual ~Document ();
+
+ /**
+ * Commands handling
+ */
+ public:
+ static bool registerCommand (Command *cmd);
+ static bool unregisterCommand (Command *cmd);
+ static Command *queryCommand (const QString &cmd);
+
+ public:
+ /**
+ * deprecated for KDE 4.0, just does reloadFile, which will ask
+ * the normal "do you want it really" questions
+ * @deprecated
+ */
+ virtual void isModOnHD(bool =false) { ; };
+
+ /**
+ * Returns the document name.
+ */
+ virtual QString docName () { return 0L; };
+
+ /**
+ * Sets the document name.
+ * deprecated for KDE 4.0, is done internally, calling it won't hurt
+ * but changes nothing beside triggers signal
+ * @deprecated
+ */
+ virtual void setDocName (QString ) { ; };
+
+ virtual ActionMenu *hlActionMenu (const QString& , QObject* =0, const char* = 0) = 0;
+ virtual ActionMenu *exportActionMenu (const QString& , QObject* =0, const char* = 0) = 0;
+
+ public slots:
+ // clear buffer/filename - update the views
+ virtual void flush () { ; };
+
+ /**
+ * Reloads the current document from disk if possible
+ */
+ virtual void reloadFile() = 0;
+
+ /**
+ * Spellchecking
+ */
+ virtual void spellcheck() {};
+
+ virtual void exportAs(const QString &) = 0;
+
+ virtual void applyWordWrap () = 0;
+
+
+ public:
+ virtual void setWordWrap (bool ) = 0;
+ virtual bool wordWrap () = 0;
+
+ virtual void setWordWrapAt (unsigned int) = 0;
+ virtual uint wordWrapAt () = 0;
+
+
+ virtual void setEncoding (const QString &e) = 0;
+ virtual QString encoding() const = 0;
+
+ /** @deprecated */
+ // FIXME: Remove when BIC allowed.
+ public:
+ /** @deprecated */
+ virtual ConfigPage *colorConfigPage (QWidget *) = 0;
+ /** @deprecated */
+ virtual ConfigPage *fontConfigPage (QWidget *) = 0;
+ /** @deprecated */
+ virtual ConfigPage *indentConfigPage (QWidget *) = 0;
+ /** @deprecated */
+ virtual ConfigPage *selectConfigPage (QWidget *) = 0;
+ /** @deprecated */
+ virtual ConfigPage *editConfigPage (QWidget *) = 0;
+ /** @deprecated */
+ virtual ConfigPage *keysConfigPage (QWidget *) = 0;
+ /** @deprecated */
+ virtual ConfigPage *kSpellConfigPage (QWidget *) { return 0L; }
+ /** @deprecated */
+ virtual ConfigPage *hlConfigPage (QWidget *) = 0;
+
+ public:
+ virtual uint configFlags () = 0;
+ virtual void setConfigFlags (uint flags) = 0;
+
+ // Flags for katedocument config !
+ enum ConfigFlags
+ {
+ cfAutoIndent= 0x1,
+ cfBackspaceIndents= 0x2,
+ cfWordWrap= 0x4,
+ cfReplaceTabs= 0x8,
+ cfRemoveSpaces = 0x10,
+ cfWrapCursor= 0x20,
+ cfAutoBrackets= 0x40,
+ cfPersistent= 0x80,
+ cfKeepSelection= 0x100,
+ cfDelOnInput= 0x400,
+ cfXorSelect= 0x800,
+ cfOvr= 0x1000,
+ cfMark= 0x2000,
+ cfKeepIndentProfile= 0x8000,
+ cfKeepExtraSpaces= 0x10000,
+ cfTabIndents= 0x80000,
+ cfShowTabs= 0x200000,
+ cfSpaceIndent= 0x400000,
+ cfSmartHome = 0x800000
+ };
+
+ signals:
+ /**
+ * Indicate this file is modified on disk
+ * @param doc the Kate::Document object that represents the file on disk
+ * @param isModified indicates the file was modified rather than created or deleted
+ * @param reason the reason we are emitting the signal.
+ * @li 0 - nothing
+ * @li 1 - dirty
+ * @li 2 - created
+ * @li 3 - deleted
+ */
+ void modifiedOnDisc (Kate::Document *doc, bool isModified, unsigned char reason);
+
+ /*
+ * there static methodes are usefull to turn on/off the dialogs
+ * kate part shows up on open file errors + file changed warnings
+ * open file errors default on, file changed warnings default off, better
+ * for other apps beside kate app using the part
+ */
+ public:
+ // default true
+ static void setOpenErrorDialogsActivated (bool on);
+
+ // default false
+ static void setFileChangedDialogsActivated (bool on);
+
+ static const QString &defaultEncoding ();
+
+ protected:
+ static bool s_openErrorDialogsActivated;
+ static bool s_fileChangedDialogsActivated;
+
+ static QString s_defaultEncoding;
+};
+
+/**
+ * Extensions to the Document Interface
+ * @since 3.3
+ */
+class KATEPARTINTERFACES_EXPORT DocumentExt
+ : public KTextEditor::DocumentInfoInterface,
+ public KTextEditor::VariableInterface
+{
+ public:
+ DocumentExt ();
+ virtual ~DocumentExt ();
+
+ public:
+ /**
+ * Reasons why a document is modified on disk.
+ */
+ enum ModifiedOnDiskReason {
+ Unmodified = 0, ///< Not modified
+ Modified = 1, ///< The file was modified by another program
+ Created = 2, ///< The file was created by another program
+ Deleted = 3 ///< The file was deleted
+ };
+
+ public:
+ /**
+ * For client apps that want to deal with files modified on disk, it is
+ * nessecary to reset this property.
+ * @p reason is a ModifiedOnDiskReason.
+ */
+ virtual void setModifiedOnDisk( int reason ) = 0;
+
+ /**
+ * These stuff is implemented as slots in the real document
+ */
+ public:
+ /**
+ * Ask the user what to do, if the file is modified on disk.
+ * The @p v argument is used to avoid asking again, when the
+ * editor regains focus after the dialog is hidden.
+ */
+ virtual void slotModifiedOnDisk( View *v=0 ) = 0;
+};
+
+/**
+ * Check if given document is a Kate::Document
+ * @param doc KTextEditor document
+ * @return 0 if no success, else the Kate::Document
+ */
+KATEPARTINTERFACES_EXPORT Document *document (KTextEditor::Document *doc);
+
+/**
+ * Check if given document is a Kate::DocumentExt
+ * @param doc KTextEditor document
+ * @return 0 if no success, else the Kate::DocumentExt
+ */
+KATEPARTINTERFACES_EXPORT DocumentExt *documentExt (KTextEditor::Document *doc);
+
+/**
+ * Creates a new Kate::Document object
+ */
+KATEPARTINTERFACES_EXPORT Document *createDocument ( QObject *parent = 0, const char *name = 0 );
+
+}
+
+#endif
diff --git a/kate/interfaces/interfaces.cpp b/kate/interfaces/interfaces.cpp
new file mode 100644
index 000000000..42bd35b7e
--- /dev/null
+++ b/kate/interfaces/interfaces.cpp
@@ -0,0 +1,127 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2001 Christoph Cullmann <cullmann@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "document.h"
+#include "document.moc"
+
+#include "view.h"
+#include "view.moc"
+
+#include "katecmd.h"
+
+namespace Kate
+{
+
+bool Document::s_openErrorDialogsActivated = true;
+bool Document::s_fileChangedDialogsActivated = false;
+QString Document::s_defaultEncoding;
+
+Document::Document (QObject* parent, const char* name)
+ : KTextEditor::Document (parent, name)
+{
+}
+
+Document::Document () : KTextEditor::Document (0L, "Kate::Document")
+{
+}
+
+Document::~Document ()
+{
+}
+
+void Document::setOpenErrorDialogsActivated (bool on)
+{
+ s_openErrorDialogsActivated = on;
+}
+
+void Document::setFileChangedDialogsActivated (bool on)
+{
+ s_fileChangedDialogsActivated = on;
+}
+
+const QString &Document::defaultEncoding ()
+{
+ return s_defaultEncoding;
+}
+
+bool Document::registerCommand (Command *cmd)
+{
+ return KateCmd::self()->registerCommand (cmd);
+}
+
+bool Document::unregisterCommand (Command *cmd)
+{
+ return KateCmd::self()->unregisterCommand (cmd);
+}
+
+Command *Document::queryCommand (const QString &cmd)
+{
+ return KateCmd::self()->queryCommand (cmd);
+}
+
+View::View ( KTextEditor::Document *doc, QWidget *parent, const char *name ) : KTextEditor::View (doc, parent, name)
+{
+}
+
+View::~View ()
+{
+}
+
+void ConfigPage::slotChanged()
+{
+ emit changed();
+}
+
+DocumentExt::DocumentExt ()
+{
+}
+
+DocumentExt::~DocumentExt ()
+{
+}
+
+Document *document (KTextEditor::Document *doc)
+{
+ if (!doc)
+ return 0;
+
+ return static_cast<Document*>(doc->qt_cast("Kate::Document"));
+}
+
+DocumentExt *documentExt (KTextEditor::Document *doc)
+{
+ if (!doc)
+ return 0;
+
+ return static_cast<DocumentExt*>(doc->qt_cast("Kate::DocumentExt"));
+}
+
+Document *createDocument ( QObject *parent, const char *name )
+{
+ return (Document* ) KTextEditor::createDocument ("libkatepart", parent, name);
+}
+
+View *view (KTextEditor::View *view)
+{
+ if (!view)
+ return 0;
+
+ return static_cast<View*>(view->qt_cast("Kate::View"));
+}
+
+}
diff --git a/kate/interfaces/katecmd.cpp b/kate/interfaces/katecmd.cpp
new file mode 100644
index 000000000..e6a981dd5
--- /dev/null
+++ b/kate/interfaces/katecmd.cpp
@@ -0,0 +1,223 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2001, 2003 Christoph Cullmann <cullmann@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "katecmd.h"
+
+#include <kstaticdeleter.h>
+#include <kdebug.h>
+
+//BEGIN KateCmd
+#define CMD_HIST_LENGTH 256
+
+KateCmd *KateCmd::s_self = 0;
+
+KateCmd::KateCmd ()
+{
+}
+
+KateCmd::~KateCmd ()
+{
+}
+
+bool KateCmd::registerCommand (Kate::Command *cmd)
+{
+ QStringList l = cmd->cmds ();
+
+ for (uint z=0; z<l.count(); z++)
+ if (m_dict[l[z]])
+ return false;
+
+ for (uint z=0; z<l.count(); z++) {
+ m_dict.insert (l[z], cmd);
+ kdDebug()<<"Inserted command:"<<l[z]<<endl;
+ }
+
+ m_cmds += l;
+
+ return true;
+}
+
+bool KateCmd::unregisterCommand (Kate::Command *cmd)
+{
+ QStringList l;
+ QDictIterator<Kate::Command> it(m_dict);
+ for( ; it.current(); ++it )
+ if (it.current()==cmd) l<<it.currentKey();
+ for ( QStringList::Iterator it1 = l.begin(); it1 != l.end(); ++it1 ) {
+ m_dict.remove(*it1);
+ kdDebug()<<"Removed command:"<<*it1<<endl;
+ }
+ return true;
+}
+
+Kate::Command *KateCmd::queryCommand (const QString &cmd)
+{
+ // a command can be named ".*[\w\-]+" with the constrain that it must
+ // contain at least one letter.
+ uint f = 0;
+ bool b = false;
+ for ( ; f < cmd.length(); f++ )
+ {
+ if ( cmd[f].isLetter() )
+ b = true;
+ if ( b && ( ! cmd[f].isLetterOrNumber() && cmd[f] != '-' && cmd[f] != '_' ) )
+ break;
+ }
+ return m_dict[cmd.left(f)];
+}
+
+QStringList KateCmd::cmds ()
+{
+ return m_cmds;
+}
+
+static KStaticDeleter<KateCmd> sdCmd;
+
+KateCmd *KateCmd::self ()
+{
+ if (!s_self)
+ sdCmd.setObject(s_self, new KateCmd ());
+
+ return s_self;
+}
+
+void KateCmd::appendHistory( const QString &cmd )
+{
+ if ( !m_history.isEmpty() && m_history.last() == cmd )
+ return;
+
+ if ( m_history.count() == CMD_HIST_LENGTH )
+ m_history.remove( m_history.first() );
+
+ m_history.append( cmd );
+}
+
+const QString KateCmd::fromHistory( uint index ) const
+{
+ if ( index > m_history.count() - 1 )
+ return QString();
+ return m_history[ index ];
+}
+//END KateCmd
+
+//BEGIN KateCmdShellCompletion
+/*
+ A lot of the code in the below class is copied from
+ kdelibs/kio/kio/kshellcompletion.cpp
+ Copyright (C) 2000 David Smith <dsmith@algonet.se>
+ Copyright (C) 2004 Anders Lund <anders@alweb.dk>
+*/
+KateCmdShellCompletion::KateCmdShellCompletion()
+ : KCompletion()
+{
+ m_word_break_char = ' ';
+ m_quote_char1 = '\"';
+ m_quote_char2 = '\'';
+ m_escape_char = '\\';
+}
+
+QString KateCmdShellCompletion::makeCompletion( const QString &text )
+{
+ // Split text at the last unquoted space
+ //
+ splitText(text, m_text_start, m_text_compl);
+
+ // Make completion on the last part of text
+ //
+ return KCompletion::makeCompletion( m_text_compl );
+}
+
+void KateCmdShellCompletion::postProcessMatch( QString *match ) const
+{
+ if ( match->isNull() )
+ return;
+
+ match->prepend( m_text_start );
+}
+
+void KateCmdShellCompletion::postProcessMatches( QStringList *matches ) const
+{
+ for ( QStringList::Iterator it = matches->begin();
+ it != matches->end(); it++ )
+ if ( !(*it).isNull() )
+ (*it).prepend( m_text_start );
+}
+
+void KateCmdShellCompletion::postProcessMatches( KCompletionMatches *matches ) const
+{
+ for ( KCompletionMatches::Iterator it = matches->begin();
+ it != matches->end(); it++ )
+ if ( !(*it).value().isNull() )
+ (*it).value().prepend( m_text_start );
+}
+
+void KateCmdShellCompletion::splitText(const QString &text, QString &text_start,
+ QString &text_compl) const
+{
+ bool in_quote = false;
+ bool escaped = false;
+ QChar p_last_quote_char;
+ int last_unquoted_space = -1;
+ int end_space_len = 0;
+
+ for (uint pos = 0; pos < text.length(); pos++) {
+
+ end_space_len = 0;
+
+ if ( escaped ) {
+ escaped = false;
+ }
+ else if ( in_quote && text[pos] == p_last_quote_char ) {
+ in_quote = false;
+ }
+ else if ( !in_quote && text[pos] == m_quote_char1 ) {
+ p_last_quote_char = m_quote_char1;
+ in_quote = true;
+ }
+ else if ( !in_quote && text[pos] == m_quote_char2 ) {
+ p_last_quote_char = m_quote_char2;
+ in_quote = true;
+ }
+ else if ( text[pos] == m_escape_char ) {
+ escaped = true;
+ }
+ else if ( !in_quote && text[pos] == m_word_break_char ) {
+
+ end_space_len = 1;
+
+ while ( pos+1 < text.length() && text[pos+1] == m_word_break_char ) {
+ end_space_len++;
+ pos++;
+ }
+
+ if ( pos+1 == text.length() )
+ break;
+
+ last_unquoted_space = pos;
+ }
+ }
+
+ text_start = text.left( last_unquoted_space + 1 );
+
+ // the last part without trailing blanks
+ text_compl = text.mid( last_unquoted_space + 1 );
+}
+
+//END KateCmdShellCompletion
+
+
diff --git a/kate/interfaces/katecmd.h b/kate/interfaces/katecmd.h
new file mode 100644
index 000000000..8af9e1f6c
--- /dev/null
+++ b/kate/interfaces/katecmd.h
@@ -0,0 +1,99 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2001, 2003 Christoph Cullmann <cullmann@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef _KATE_CMD_H
+#define _KATE_CMD_H
+
+#include "document.h"
+
+#include <kcompletion.h>
+
+#include <qdict.h>
+#include <qstringlist.h>
+
+class KATEPARTINTERFACES_EXPORT KateCmd
+{
+ private:
+ KateCmd ();
+
+ public:
+ ~KateCmd ();
+
+ static KateCmd *self ();
+
+ bool registerCommand (Kate::Command *cmd);
+ bool unregisterCommand (Kate::Command *cmd);
+ Kate::Command *queryCommand (const QString &cmd);
+
+ QStringList cmds ();
+ void appendHistory( const QString &cmd );
+ const QString fromHistory( uint i ) const;
+ uint historyLength() const { return m_history.count(); }
+
+ private:
+ static KateCmd *s_self;
+ QDict<Kate::Command> m_dict;
+ QStringList m_cmds;
+ QStringList m_history;
+};
+
+/**
+ * A KCompletion object that completes last ?unquoted? word in the string
+ * passed. Dont mistake "shell" for anything related to quoting, this
+ * simply mimics shell tab completion by completing the last word in the
+ * provided text.
+ */
+class KATEPARTINTERFACES_EXPORT KateCmdShellCompletion : public KCompletion
+{
+ public:
+ KateCmdShellCompletion();
+
+ /**
+ * Finds completions to the given text.
+ * The first match is returned and emitted in the signal match().
+ * @param text the text to complete
+ * @return the first match, or QString::null if not found
+ */
+ QString makeCompletion(const QString &text);
+
+ protected:
+ // Called by KCompletion
+ void postProcessMatch( QString *match ) const;
+ void postProcessMatches( QStringList *matches ) const;
+ void postProcessMatches( KCompletionMatches *matches ) const;
+
+ private:
+ /**
+ * Split text at the last unquoted space
+ *
+ * @param text_start will be set to the text at the left, including the space
+ * @param text_compl Will be set to the text at the right. This is the text to complete.
+ */
+ void splitText( const QString &text, QString &text_start, QString &text_compl ) const;
+
+ QChar m_word_break_char;
+ QChar m_quote_char1;
+ QChar m_quote_char2;
+ QChar m_escape_char;
+
+ QString m_text_start;
+ QString m_text_compl;
+
+};
+
+#endif
diff --git a/kate/interfaces/view.h b/kate/interfaces/view.h
new file mode 100644
index 000000000..98290039e
--- /dev/null
+++ b/kate/interfaces/view.h
@@ -0,0 +1,303 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2001 Christoph Cullmann <cullmann@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef _KATE_VIEW_INCLUDE_
+#define _KATE_VIEW_INCLUDE_
+
+#include <ktexteditor/document.h>
+#include <ktexteditor/view.h>
+#include <ktexteditor/clipboardinterface.h>
+#include <ktexteditor/popupmenuinterface.h>
+#include <ktexteditor/markinterface.h>
+#include <ktexteditor/viewcursorinterface.h>
+#include <ktexteditor/codecompletioninterface.h>
+#include <ktexteditor/dynwordwrapinterface.h>
+
+class KConfig;
+
+namespace Kate
+{
+
+class Document;
+
+/**
+ The Kate::View text editor interface.
+ @author Cullmann Christoph, modified by rokrau (6/21/01)
+*/
+class KATEPARTINTERFACES_EXPORT View : public KTextEditor::View, public KTextEditor::ClipboardInterface,
+ public KTextEditor::PopupMenuInterface, public KTextEditor::ViewCursorInterface,
+ public KTextEditor::CodeCompletionInterface, public KTextEditor::DynWordWrapInterface
+{
+ Q_OBJECT
+
+ public:
+ /**
+ Return values for "save" related commands.
+ */
+ enum saveResult { SAVE_OK, SAVE_CANCEL, SAVE_RETRY, SAVE_ERROR };
+ /**
+ Constructor (should much rather take a reference to the document).
+ */
+ View ( KTextEditor::Document *, QWidget *, const char *name = 0 );
+ /**
+ Destructor, you need a destructor if Scott Meyers says so.
+ */
+ virtual ~View ();
+ /**
+ Set editor mode
+ */
+ virtual bool isOverwriteMode() const { return false; }
+ /**
+ Get editor mode
+ */
+ virtual void setOverwriteMode( bool ) { }
+ /**
+ Gets the text line where the cursor is on
+ */
+ virtual QString currentTextLine() { return 0L; }
+ /**
+ Gets the word where the cursor is on
+ */
+ virtual QString currentWord() { return 0L; }
+ /**
+ Gets the word at position x, y. Can be used to find
+ the word under the mouse cursor
+ */
+ virtual QString word(int , int ) { return 0L; }
+ /**
+ Insert text at the current cursor position.
+ @param mark is unused.
+ */
+ virtual void insertText(const QString &mark ) { Q_UNUSED(mark); }
+ /**
+ Works exactly like closeURL() of KParts::ReadWritePart
+ */
+ virtual bool canDiscard() { return false; }
+
+ public:
+ virtual int tabWidth() = 0;
+ virtual void setTabWidth(int) = 0;
+ virtual void setEncoding (QString e) = 0;
+
+ /**
+ Returns true if this editor is the only owner of its document
+ */
+ virtual bool isLastView() = 0;
+
+ public slots:
+ /**
+ Flushes the document of the text widget. The user is given
+ a chance to save the current document if the current document has
+ been modified.
+ */
+ virtual void flush () { ; };
+ /**
+ Saves the file under the current file name. If the current file
+ name is Untitled, as it is after a call to newFile(), this routine will
+ call saveAs().
+ */
+ virtual saveResult save() { return SAVE_CANCEL; };
+ /**
+ Allows the user to save the file under a new name.
+ */
+ virtual saveResult saveAs() { return SAVE_CANCEL; };
+ /**
+ Moves the current line or the selection one position to the right.
+ */
+ virtual void indent() { ; };
+ /**
+ Moves the current line or the selection one position to the left.
+ */
+ virtual void unIndent() { ; };
+ /**
+ Optimizes the selected indentation, replacing tabs and spaces as needed.
+ */
+ virtual void cleanIndent() { ; };
+ /**
+ Comments out current line.
+ */
+ virtual void comment() { ; };
+ /**
+ Removes comment signs in the current line.
+ */
+ virtual void uncomment() { ; };
+ /**
+ Some simply key commands.
+ */
+ virtual void keyReturn () { ; };
+ virtual void keyDelete () { ; };
+ virtual void backspace () { ; };
+ virtual void killLine () { ; };
+ /**
+ Move cursor in the view
+ */
+ virtual void cursorLeft () { ; };
+ virtual void shiftCursorLeft () { ; };
+ virtual void cursorRight () { ; };
+ virtual void shiftCursorRight () { ; };
+ virtual void wordLeft () { ; };
+ virtual void shiftWordLeft () { ; };
+ virtual void wordRight () { ; };
+ virtual void shiftWordRight () { ; };
+ virtual void home () { ; };
+ virtual void shiftHome () { ; };
+ virtual void end () { ; };
+ virtual void shiftEnd () { ; };
+ virtual void up () { ; };
+ virtual void shiftUp () { ; };
+ virtual void down () { ; };
+ virtual void shiftDown () { ; };
+ virtual void scrollUp () { ; };
+ virtual void scrollDown () { ; };
+ virtual void topOfView () { ; };
+ virtual void bottomOfView () { ; };
+ virtual void pageUp () { ; };
+ virtual void shiftPageUp () { ; };
+ virtual void pageDown () { ; };
+ virtual void shiftPageDown () { ; };
+ virtual void top () { ; };
+ virtual void shiftTop () { ; };
+ virtual void bottom () { ; };
+ virtual void shiftBottom () { ; };
+ /**
+ Presents a search dialog to the user.
+ */
+ virtual void find() { ; };
+ /**
+ Presents a replace dialog to the user.
+ */
+ virtual void replace() { ; };
+ /**
+ Presents a "Goto Line" dialog to the user.
+ */
+ virtual void gotoLine() { ; };
+
+ public:
+ /**
+ Reads session config out of the KConfig object. This also includes
+ the actual cursor position and the bookmarks.
+ */
+ virtual void readSessionConfig(KConfig *) { ; };
+ /**
+ Writes session config into the KConfig object.
+ */
+ virtual void writeSessionConfig(KConfig *) { ; };
+
+ public slots:
+ /**
+ Get the end of line mode (Unix, Macintosh or Dos).
+ */
+ virtual int getEol() { return 0L; }
+ /**
+ Set the end of line mode (Unix, Macintosh or Dos).
+ */
+ virtual void setEol(int) { }
+ /**
+ Set focus to the current window.
+ */
+ // Should remove this, it's redundant.
+ virtual void setFocus () { QWidget::setFocus(); }
+ /**
+ Searches for the last searched text forward from cursor position.
+ @param forward determines the search direction.
+ */
+ virtual void findAgain(bool forward ) { Q_UNUSED(forward); }
+ /**
+ Searches for the last searched text forward from cursor position.
+ Searches forward from current cursor position.
+ */
+ virtual void findAgain () { };
+ /**
+ Searches for the last searched text forward from cursor position.
+ Searches backward from current cursor position.
+ */
+ virtual void findPrev () { }
+ /**
+ Presents an edit command popup window, where the user can
+ apply a shell command to the contents of the current window.
+ */
+ virtual void slotEditCommand () { }
+
+ /**
+ Sets icon border on or off depending on
+ @param enable the flag
+ */
+ virtual void setIconBorder (bool enable ) { Q_UNUSED(enable); }
+ /**
+ Toggles icon border.
+ */
+ virtual void toggleIconBorder () { }
+ /**
+ Sets display of line numbers on/off depending on @p enable
+ @param enable the flag
+ */
+ virtual void setLineNumbersOn (bool enable) { Q_UNUSED(enable); }
+ /**
+ Toggles display of lineNumbers
+ */
+ virtual void toggleLineNumbersOn () {}
+
+ public:
+ /**
+ Returns whether iconborder is visible.
+ */
+ virtual bool iconBorder() { return false; }
+ /**
+ @return Wheather line numbers display is on
+ */
+ virtual bool lineNumbersOn() { return false; }
+ /**
+ Returns a pointer to the document of the view.
+ */
+ virtual Document *getDoc () { return 0L; }
+
+ public slots:
+ /**
+ Increase font size.
+ */
+ virtual void slotIncFontSizes () { }
+ /**
+ Decrease font size.
+ */
+ virtual void slotDecFontSizes () { }
+
+ virtual void gotoMark (KTextEditor::Mark *mark) = 0;
+
+ /**
+ * @deprecated No longer does anything. Use KTextEditor
+ * equivalents
+ */
+ // TODO: Remove when BIC is allowed
+ virtual void toggleBookmark () {}
+
+ virtual void gotoLineNumber( int ) = 0;
+
+ signals:
+ void gotFocus (View *);
+// void newStatus(); // Kate app connects to this signal, should be in the interface
+
+ public:
+ virtual void setActive (bool b) = 0;
+ virtual bool isActive () = 0;
+};
+
+KATEPARTINTERFACES_EXPORT View *view (KTextEditor::View *view);
+
+}
+
+#endif
diff --git a/kate/part/.kateconfig b/kate/part/.kateconfig
new file mode 100644
index 000000000..5b0885abe
--- /dev/null
+++ b/kate/part/.kateconfig
@@ -0,0 +1 @@
+kate: space-indent on; indent-width 2; replace-tabs on;
diff --git a/kate/part/Makefile.am b/kate/part/Makefile.am
new file mode 100644
index 000000000..4a182452e
--- /dev/null
+++ b/kate/part/Makefile.am
@@ -0,0 +1,44 @@
+kde_module_LTLIBRARIES = libkatepart.la
+
+noinst_LTLIBRARIES = libkate.la
+
+libkate_la_SOURCES = katesearch.cpp katebuffer.cpp katecmds.cpp \
+ kateundo.cpp katecursor.cpp katedialogs.cpp katedocument.cpp \
+ katefactory.cpp katehighlight.cpp katesyntaxdocument.cpp \
+ katetextline.cpp kateview.cpp kateconfig.cpp kateviewhelpers.cpp \
+ katecodecompletion.cpp katedocumenthelpers.cpp \
+ katecodefoldinghelpers.cpp kateviewinternal.cpp katebookmarks.cpp \
+ kateprinter.cpp katefont.cpp katelinerange.cpp katesupercursor.cpp \
+ katearbitraryhighlight.cpp katerenderer.cpp kateattribute.cpp \
+ kateautoindent.cpp katefiletype.cpp kateschema.cpp katedocument.skel \
+ katetemplatehandler.cpp katejscript.cpp katespell.cpp kateindentscriptabstracts.cpp \
+ kateluaindentscript.cpp
+
+libkatepart_la_SOURCES = dummy.cpp
+
+libkatepart_la_LIBADD = libkate.la ../interfaces/libkatepartinterfaces.la $(top_builddir)/kdeprint/libkdeprint.la $(top_builddir)/kutils/libkutils.la $(top_builddir)/kjs/libkjs.la $(LUA_LIBS)
+
+libkatepart_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN)
+
+INCLUDES= -I../interfaces -I$(top_srcdir) -I$(top_srcdir)/kdeprint -I$(top_srcdir)/interfaces -I$(top_srcdir)/interfaces/kregexpeditor -I$(top_srcdir)/kdefx -I$(top_srcdir)/kutils -I$(top_builddir)/kjs $(LUA_INCLUDES) $(all_includes)
+
+METASOURCES = AUTO
+
+LUT_FILES = katejscript.lut.h
+
+CREATE_HASH_TABLE = $(top_srcdir)/kjs/create_hash_table
+
+dummy.cpp: $(srcdir)/Makefile.am
+ touch $@
+
+katejscript.lut.h : $(srcdir)/katejscript.cpp $(CREATE_HASH_TABLE)
+ $(PERL) $(CREATE_HASH_TABLE) $(srcdir)/katejscript.cpp > $@
+katejscript.lo: katejscript.lut.h
+
+CLEANFILES = $(LUT_FILES)
+
+## test program
+TESTS = testkateregression
+check_PROGRAMS = testkateregression
+testkateregression_SOURCES = test_regression.cpp
+testkateregression_LDADD = $(libkatepart_la_LIBADD)
diff --git a/kate/part/configure.in.in b/kate/part/configure.in.in
new file mode 100644
index 000000000..faf0717e9
--- /dev/null
+++ b/kate/part/configure.in.in
@@ -0,0 +1,89 @@
+AC_DEFUN([AC_PATH_LUA], [
+
+dnl Based on the lua check used by yzis-M3
+
+ HAVE_LUA=""
+
+ AC_ARG_WITH([lua],
+ AC_HELP_STRING([--without-lua], [Build without Lua libraries (default: check)]))
+
+ AC_ARG_WITH(lua-dir,
+ AC_HELP_STRING([--with-lua-dir=DIR],[where the root of Lua 5.x is installed]),
+ [
+ LUA="$withval"
+ LUA_INCLUDES=-I"$withval"/include
+ LUA_LIBS="-L$withval/lib" ])
+
+ AC_ARG_WITH(lua-includes,
+ AC_HELP_STRING([--with-lua-includes=DIR],[where the Lua includes are]),
+ [ LUA_INCLUDES="-I$withval" ])
+
+ AC_ARG_WITH(lua-libraries,
+ AC_HELP_STRING([--with-lua-libraries=DIR],[where the Lua library is installed]),
+ [
+ LUA_LIBS="-L$withval" ])
+
+
+ if test "x$with_lua" = "xno"; then
+ AC_MSG_RESULT([Not using Lua])
+ else
+ if ! test "x$LUA" = "x"; then
+ AC_MSG_RESULT(using Lua from $LUA)
+ fi
+ if ! test "x$LUA_LIBS" = "x"; then
+ AC_MSG_RESULT(using Lua libraries in $LUA_LIBS)
+ fi
+ if ! test "x$LUA_INCLUDES" = "x"; then
+ AC_MSG_RESULT(using Lua includes in $LUA_INCLUDES)
+ fi
+
+ dnl checking some headers first
+ ac_save_CFLAGS="$CFLAGS"
+ ac_save_CPPFLAGS="$CPPFLAGS"
+ ac_save_LDFLAGS="$LDFLAGS"
+ CFLAGS="$LUA_INCLUDES $CFLAGS"
+ CPPFLAGS="$LUA_INCLUDES $CPPFLAGS"
+ LDFLAGS="$LUA_LIBS $LDFLAGS"
+
+ LUAH_FOUND=""
+ AC_CHECK_HEADER(lua.h,LUAH_FOUND="true",
+ [ AC_MSG_RESULT([lua.h was not found or was not usable, Lua 5.0 headers are required !]) ]
+ )
+ LUALIBH_FOUND=""
+ AC_CHECK_HEADER(lualib.h,LUALIBH_FOUND="true",
+ [ AC_MSG_RESULT([lualib.h was not found or was not usable, Lua 5.0 headers are required !]) ]
+ )
+
+
+ dnl find the libs name
+ if test -z "$LUALIBH_FOUND" -o -z "$LUAH_FOUND"; then
+ LUA_LIBS=""
+ else
+ AC_CHECK_LIB(lua50,lua_version, LUA_LIBS="$LUA_LIBS -llua50 -llualib50",
+ AC_CHECK_LIB(lua,lua_version, LUA_LIBS="$LUA_LIBS -llua -llualib",
+ [LUA_LIBS=""
+ AC_MSG_RESULT([Lua 5.0 libraries were not found !]) ]
+ )
+ )
+ fi
+ CFLAGS="$ac_save_CFLAGS"
+ CPPFLAGS="$ac_save_CPPFLAGS"
+ LDFLAGS="$ac_save_LDFLAGS"
+
+
+ if test -z "$LUA_LIBS"; then
+ LUA=""
+ LUA_INCLUDES=""
+ LUA_LIBS=""
+ else
+ AC_DEFINE_UNQUOTED(HAVE_LUA, 1, [Define if you have LUA > 5.0])
+ HAVE_LUA="yes"
+ fi
+ AC_SUBST(LUA)
+ AC_SUBST(LUA_INCLUDES)
+ AC_SUBST(LUA_LIBS)
+ fi
+
+])
+
+AC_PATH_LUA
diff --git a/kate/part/katearbitraryhighlight.cpp b/kate/part/katearbitraryhighlight.cpp
new file mode 100644
index 000000000..2ecbececc
--- /dev/null
+++ b/kate/part/katearbitraryhighlight.cpp
@@ -0,0 +1,162 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2003 Hamish Rodda <rodda@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "katearbitraryhighlight.h"
+#include "katearbitraryhighlight.moc"
+
+#include "katesupercursor.h"
+#include "katedocument.h"
+
+#include <kdebug.h>
+
+#include <qfont.h>
+
+KateArbitraryHighlightRange::KateArbitraryHighlightRange(KateSuperCursor* start,
+KateSuperCursor* end, QObject* parent, const char* name) :
+KateSuperRange(start, end, parent, name) {
+}
+
+KateArbitraryHighlightRange::KateArbitraryHighlightRange(KateDocument* doc, const KateRange& range, QObject* parent, const char* name)
+ : KateSuperRange(doc, range, parent, name)
+{
+}
+
+KateArbitraryHighlightRange::KateArbitraryHighlightRange(KateDocument* doc, const KateTextCursor& start, const KateTextCursor& end, QObject* parent, const char* name)
+ : KateSuperRange(doc, start, end, parent, name)
+{
+}
+
+KateArbitraryHighlightRange::~KateArbitraryHighlightRange()
+{
+}
+
+KateArbitraryHighlight::KateArbitraryHighlight(KateDocument* parent, const char* name)
+ : QObject(parent, name)
+{
+}
+
+KateAttribute KateArbitraryHighlightRange::merge(QPtrList<KateSuperRange> ranges)
+{
+ ranges.sort();
+
+ KateAttribute ret;
+
+ if (ranges.first() && ranges.current()->inherits("KateArbitraryHighlightRange"))
+ ret = *(static_cast<KateArbitraryHighlightRange*>(ranges.current()));
+
+ KateSuperRange* r;
+ while ((r = ranges.next())) {
+ if (r->inherits("KateArbitraryHighlightRange")) {
+ KateArbitraryHighlightRange* hl = static_cast<KateArbitraryHighlightRange*>(r);
+ ret += *hl;
+ }
+ }
+
+ return ret;
+}
+
+void KateArbitraryHighlight::addHighlightToDocument(KateSuperRangeList* list)
+{
+ m_docHLs.append(list);
+ connect(list, SIGNAL(rangeEliminated(KateSuperRange*)), SLOT(slotRangeEliminated(KateSuperRange*)));
+ connect(list, SIGNAL(destroyed(QObject*)),SLOT(slotRangeListDeleted(QObject*)));
+}
+
+void KateArbitraryHighlight::addHighlightToView(KateSuperRangeList* list, KateView* view)
+{
+ if (!m_viewHLs[view])
+ m_viewHLs.insert(view, new QPtrList<KateSuperRangeList>());
+
+ m_viewHLs[view]->append(list);
+
+ connect(list, SIGNAL(rangeEliminated(KateSuperRange*)), SLOT(slotTagRange(KateSuperRange*)));
+ connect(list, SIGNAL(tagRange(KateSuperRange*)), SLOT(slotTagRange(KateSuperRange*)));
+ connect(list, SIGNAL(destroyed(QObject*)),SLOT(slotRangeListDeleted(QObject*)));
+}
+
+void KateArbitraryHighlight::slotRangeListDeleted(QObject* obj) {
+ int id=m_docHLs.findRef(static_cast<KateSuperRangeList*>(obj));
+ if (id>=0) m_docHLs.take(id);
+
+ for (QMap<KateView*, QPtrList<KateSuperRangeList>* >::Iterator it = m_viewHLs.begin(); it != m_viewHLs.end(); ++it)
+ for (KateSuperRangeList* l = (*it)->first(); l; l = (*it)->next())
+ if (l==obj) {
+ l->take();
+ break; //should we check if one list is stored more than once for a view ?? I don't think adding the same list 2 or more times is sane, but who knows (jowenn)
+ }
+}
+
+KateSuperRangeList& KateArbitraryHighlight::rangesIncluding(uint line, KateView* view)
+{
+ // OPTIMISE make return value persistent
+
+ static KateSuperRangeList s_return(false);
+
+ Q_ASSERT(!s_return.autoDelete());
+ s_return.clear();
+
+ //--- TEMPORARY OPTIMISATION: return the actual range when there are none or one. ---
+ if (m_docHLs.count() + m_viewHLs.count() == 0)
+ return s_return;
+ else if (m_docHLs.count() + m_viewHLs.count() == 1)
+ if (m_docHLs.count())
+ return *(m_docHLs.first());
+ else
+ if (m_viewHLs.values().first() && m_viewHLs.values().first()->count() == 1)
+ if (m_viewHLs.keys().first() == view && m_viewHLs.values().first())
+ return *(m_viewHLs.values().first()->first());
+ //--- END Temporary optimisation ---
+
+ if (view) {
+ QPtrList<KateSuperRangeList>* list = m_viewHLs[view];
+ if (list)
+ for (KateSuperRangeList* l = list->first(); l; l = list->next())
+ if (l->count())
+ s_return.appendList(l->rangesIncluding(line));
+
+ } else {
+ for (QMap<KateView*, QPtrList<KateSuperRangeList>* >::Iterator it = m_viewHLs.begin(); it != m_viewHLs.end(); ++it)
+ for (KateSuperRangeList* l = (*it)->first(); l; l = (*it)->next())
+ if (l->count())
+ s_return.appendList(l->rangesIncluding(line));
+ }
+
+ for (KateSuperRangeList* l = m_docHLs.first(); l; l = m_docHLs.next())
+ if (l->count())
+ s_return.appendList(l->rangesIncluding(line));
+
+ return s_return;
+}
+
+void KateArbitraryHighlight::slotTagRange(KateSuperRange* range)
+{
+ emit tagLines(viewForRange(range), range);
+}
+
+KateView* KateArbitraryHighlight::viewForRange(KateSuperRange* range)
+{
+ for (QMap<KateView*, QPtrList<KateSuperRangeList>* >::Iterator it = m_viewHLs.begin(); it != m_viewHLs.end(); ++it)
+ for (KateSuperRangeList* l = (*it)->first(); l; l = (*it)->next())
+ if (l->contains(range))
+ return it.key();
+
+ // This must belong to a document-global highlight
+ return 0L;
+}
+
+// kate: space-indent on; indent-width 2; replace-tabs on;
diff --git a/kate/part/katearbitraryhighlight.h b/kate/part/katearbitraryhighlight.h
new file mode 100644
index 000000000..7955e7889
--- /dev/null
+++ b/kate/part/katearbitraryhighlight.h
@@ -0,0 +1,87 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2003 Hamish Rodda <rodda@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef KATEARBITRARYHIGHLIGHT_H
+#define KATEARBITRARYHIGHLIGHT_H
+
+#include "kateattribute.h"
+#include "katesupercursor.h"
+
+#include <qobject.h>
+#include <qptrlist.h>
+#include <qmap.h>
+
+class KateDocument;
+class KateView;
+
+class KateArbitraryHighlightRange : public KateSuperRange, public KateAttribute
+{
+ Q_OBJECT
+
+public:
+ KateArbitraryHighlightRange(KateSuperCursor* start, KateSuperCursor* end, QObject* parent = 0L, const char* name = 0L);
+ KateArbitraryHighlightRange(KateDocument* doc, const KateRange& range, QObject* parent = 0L, const char* name = 0L);
+ KateArbitraryHighlightRange(KateDocument* doc, const KateTextCursor& start, const KateTextCursor& end, QObject* parent = 0L, const char* name = 0L);
+
+ virtual ~KateArbitraryHighlightRange();
+
+ virtual void changed() { slotTagRange(); };
+
+ static KateAttribute merge(QPtrList<KateSuperRange> ranges);
+};
+
+/**
+ * An arbitrary highlighting interface for Kate.
+ *
+ * Ideas for more features:
+ * - integration with syntax highlighting:
+ * - eg. a signal for when a new context is created, destroyed, changed
+ * - hopefully make this extension more complimentary to the current syntax highlighting
+ * - signal for cursor movement
+ * - signal for mouse movement
+ * - identical highlight for whole list
+ * - signals for view movement
+ */
+class KateArbitraryHighlight : public QObject
+{
+ Q_OBJECT
+
+public:
+ KateArbitraryHighlight(KateDocument* parent = 0L, const char* name = 0L);
+
+ void addHighlightToDocument(KateSuperRangeList* list);
+ void addHighlightToView(KateSuperRangeList* list, KateView* view);
+
+ KateSuperRangeList& rangesIncluding(uint line, KateView* view = 0L);
+
+signals:
+ void tagLines(KateView* view, KateSuperRange* range);
+
+private slots:
+ void slotTagRange(KateSuperRange* range);
+ void slotRangeListDeleted(QObject* obj);
+private:
+ KateView* viewForRange(KateSuperRange* range);
+
+ QMap<KateView*, QPtrList<KateSuperRangeList>* > m_viewHLs;
+ QPtrList<KateSuperRangeList> m_docHLs;
+};
+
+#endif
+
+// kate: space-indent on; indent-width 2; replace-tabs on;
diff --git a/kate/part/kateattribute.cpp b/kate/part/kateattribute.cpp
new file mode 100644
index 000000000..5de93a406
--- /dev/null
+++ b/kate/part/kateattribute.cpp
@@ -0,0 +1,268 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2003 Hamish Rodda <rodda@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "kateattribute.h"
+
+KateAttribute::KateAttribute()
+ : m_weight(QFont::Normal)
+ , m_italic(false)
+ , m_underline(false)
+ , m_overline(false)
+ , m_strikeout(false)
+ , m_itemsSet(0)
+
+{
+}
+
+KateAttribute::~KateAttribute()
+{
+}
+
+void KateAttribute::clear()
+{
+ m_itemsSet=0;
+}
+
+KateAttribute& KateAttribute::operator+=(const KateAttribute& a)
+{
+ if (a.itemSet(Weight))
+ setWeight(a.weight());
+
+ if (a.itemSet(Italic))
+ setItalic(a.italic());
+
+ if (a.itemSet(Underline))
+ setUnderline(a.underline());
+
+ if (a.itemSet(Overline))
+ setOverline(a.overline());
+
+ if (a.itemSet(StrikeOut))
+ setStrikeOut(a.strikeOut());
+
+ if (a.itemSet(Outline))
+ setOutline(a.outline());
+
+ if (a.itemSet(TextColor))
+ setTextColor(a.textColor());
+
+ if (a.itemSet(SelectedTextColor))
+ setSelectedTextColor(a.selectedTextColor());
+
+ if (a.itemSet(BGColor))
+ setBGColor(a.bgColor());
+
+ if (a.itemSet(SelectedBGColor))
+ setSelectedBGColor(a.selectedBGColor());
+
+ return *this;
+}
+
+QFont KateAttribute::font(const QFont& ref)
+{
+ QFont ret = ref;
+
+ if (itemSet(Weight))
+ ret.setWeight(weight());
+ if (itemSet(Italic))
+ ret.setItalic(italic());
+ if (itemSet(Underline))
+ ret.setUnderline(underline());
+ if (itemSet(Overline))
+ ret.setOverline(overline());
+ if (itemSet(StrikeOut))
+ ret.setStrikeOut(strikeOut());
+
+ return ret;
+}
+
+void KateAttribute::setWeight(int weight)
+{
+ if (!(m_itemsSet & Weight) || m_weight != weight)
+ {
+ m_itemsSet |= Weight;
+
+ m_weight = weight;
+
+ changed();
+ }
+}
+
+void KateAttribute::setBold(bool enable)
+{
+ setWeight(enable ? QFont::Bold : QFont::Normal);
+}
+
+void KateAttribute::setItalic(bool enable)
+{
+ if (!(m_itemsSet & Italic) || m_italic != enable)
+ {
+ m_itemsSet |= Italic;
+
+ m_italic = enable;
+
+ changed();
+ }
+}
+
+void KateAttribute::setUnderline(bool enable)
+{
+ if (!(m_itemsSet & Underline) || m_underline != enable)
+ {
+ m_itemsSet |= Underline;
+
+ m_underline = enable;
+
+ changed();
+ }
+}
+
+void KateAttribute::setOverline(bool enable)
+{
+ if (!(m_itemsSet & Overline) || m_overline != enable)
+ {
+ m_itemsSet |= Overline;
+
+ m_overline = enable;
+
+ changed();
+ }
+}
+
+void KateAttribute::setStrikeOut(bool enable)
+{
+ if (!(m_itemsSet & StrikeOut) || m_strikeout != enable)
+ {
+ m_itemsSet |= StrikeOut;
+
+ m_strikeout = enable;
+
+ changed();
+ }
+}
+
+void KateAttribute::setOutline(const QColor& color)
+{
+ if (!(m_itemsSet & Outline) || m_outline != color)
+ {
+ m_itemsSet |= Outline;
+
+ m_outline = color;
+
+ changed();
+ }
+}
+
+void KateAttribute::setTextColor(const QColor& color)
+{
+ if (!(m_itemsSet & TextColor) || m_textColor != color)
+ {
+ m_itemsSet |= TextColor;
+
+ m_textColor = color;
+
+ changed();
+ }
+}
+
+void KateAttribute::setSelectedTextColor(const QColor& color)
+{
+ if (!(m_itemsSet & SelectedTextColor) || m_selectedTextColor != color)
+ {
+ m_itemsSet |= SelectedTextColor;
+
+ m_selectedTextColor = color;
+
+ changed();
+ }
+}
+
+void KateAttribute::setBGColor(const QColor& color)
+{
+ if (!(m_itemsSet & BGColor) || m_bgColor != color)
+ {
+ m_itemsSet |= BGColor;
+
+ m_bgColor = color;
+
+ changed();
+ }
+}
+
+void KateAttribute::setSelectedBGColor(const QColor& color)
+{
+ if (!(m_itemsSet & SelectedBGColor) || m_selectedBGColor != color)
+ {
+ m_itemsSet |= SelectedBGColor;
+
+ m_selectedBGColor = color;
+
+ changed();
+ }
+}
+
+bool operator ==(const KateAttribute& h1, const KateAttribute& h2)
+{
+ if (h1.m_itemsSet != h2.m_itemsSet)
+ return false;
+
+ if (h1.itemSet(KateAttribute::Weight))
+ if (h1.m_weight != h2.m_weight)
+ return false;
+
+ if (h1.itemSet(KateAttribute::Italic))
+ if (h1.m_italic != h2.m_italic)
+ return false;
+
+ if (h1.itemSet(KateAttribute::Underline))
+ if (h1.m_underline != h2.m_underline)
+ return false;
+
+ if (h1.itemSet(KateAttribute::StrikeOut))
+ if (h1.m_strikeout != h2.m_strikeout)
+ return false;
+
+ if (h1.itemSet(KateAttribute::Outline))
+ if (h1.m_outline != h2.m_outline)
+ return false;
+
+ if (h1.itemSet(KateAttribute::TextColor))
+ if (h1.m_textColor != h2.m_textColor)
+ return false;
+
+ if (h1.itemSet(KateAttribute::SelectedTextColor))
+ if (h1.m_selectedTextColor != h2.m_selectedTextColor)
+ return false;
+
+ if (h1.itemSet(KateAttribute::BGColor))
+ if (h1.m_bgColor != h2.m_bgColor)
+ return false;
+
+ if (h1.itemSet(KateAttribute::SelectedBGColor))
+ if (h1.m_selectedBGColor != h2.m_selectedBGColor)
+ return false;
+
+ return true;
+}
+
+bool operator !=(const KateAttribute& h1, const KateAttribute& h2)
+{
+ return !(h1 == h2);
+}
+
+// kate: space-indent on; indent-width 2; replace-tabs on;
diff --git a/kate/part/kateattribute.h b/kate/part/kateattribute.h
new file mode 100644
index 000000000..c4933e690
--- /dev/null
+++ b/kate/part/kateattribute.h
@@ -0,0 +1,147 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2003 Hamish Rodda <rodda@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef __KATE_ATTRIBUTE_H__
+#define __KATE_ATTRIBUTE_H__
+
+#include "katefont.h"
+
+#include <qcolor.h>
+
+/**
+ * The Attribute class incorporates all text decorations supported by Kate.
+ *
+ * TODO: store the actual font as well.
+ * TODO: update changed mechanism - use separate bitfield
+ */
+class KateAttribute
+{
+public:
+ enum items {
+ Weight = 0x1,
+ Bold = 0x2,
+ Italic = 0x4,
+ Underline = 0x8,
+ StrikeOut = 0x10,
+ Outline = 0x20,
+ TextColor = 0x40,
+ SelectedTextColor = 0x80,
+ BGColor = 0x100,
+ SelectedBGColor = 0x200,
+ Overline = 0x400
+ };
+
+ KateAttribute();
+ virtual ~KateAttribute();
+
+ QFont font(const QFont& ref);
+
+ inline int width(KateFontStruct& fs, const QString& text, int col, int tabWidth) const
+ { return fs.width(text, col, bold(), italic(), tabWidth); };
+
+ // Non-preferred function when you have a string and you want one char's width!!
+ inline int width(KateFontStruct& fs, const QChar& c, int tabWidth) const
+ { return fs.width(c, bold(), italic(), tabWidth); };
+
+ inline bool itemSet(int item) const
+ { return item & m_itemsSet; };
+
+ inline bool isSomethingSet() const
+ { return m_itemsSet; };
+
+ inline int itemsSet() const
+ { return m_itemsSet; };
+
+ inline void clearAttribute(int item)
+ { m_itemsSet &= (~item); }
+
+ inline int weight() const
+ { return m_weight; };
+
+ void setWeight(int weight);
+
+ inline bool bold() const
+ { return weight() >= QFont::Bold; };
+
+ void setBold(bool enable = true);
+
+ inline bool italic() const
+ { return m_italic; };
+
+ void setItalic(bool enable = true);
+
+ inline bool overline() const
+ { return m_overline; };
+
+ void setOverline(bool enable = true);
+
+ inline bool underline() const
+ { return m_underline; };
+
+ void setUnderline(bool enable = true);
+
+ inline bool strikeOut() const
+ { return m_strikeout; };
+
+ void setStrikeOut(bool enable = true);
+
+ inline const QColor& outline() const
+ { return m_outline; };
+
+ void setOutline(const QColor& color);
+
+ inline const QColor& textColor() const
+ { return m_textColor; };
+
+ void setTextColor(const QColor& color);
+
+ inline const QColor& selectedTextColor() const
+ { return m_selectedTextColor; };
+
+ void setSelectedTextColor(const QColor& color);
+
+ inline const QColor& bgColor() const
+ { return m_bgColor; };
+
+ void setBGColor(const QColor& color);
+
+ inline const QColor& selectedBGColor() const
+ { return m_selectedBGColor; };
+
+ void setSelectedBGColor(const QColor& color);
+
+ KateAttribute& operator+=(const KateAttribute& a);
+
+ friend bool operator ==(const KateAttribute& h1, const KateAttribute& h2);
+ friend bool operator !=(const KateAttribute& h1, const KateAttribute& h2);
+
+ virtual void changed() { m_changed = true; };
+ bool isChanged() { bool ret = m_changed; m_changed = false; return ret; };
+
+ void clear();
+
+private:
+ int m_weight;
+ bool m_italic, m_underline, m_overline,m_strikeout, m_changed;
+ QColor m_outline, m_textColor, m_selectedTextColor, m_bgColor, m_selectedBGColor;
+ int m_itemsSet;
+};
+
+#endif
+
+// kate: space-indent on; indent-width 2; replace-tabs on;
diff --git a/kate/part/kateautoindent.cpp b/kate/part/kateautoindent.cpp
new file mode 100644
index 000000000..7c58b6051
--- /dev/null
+++ b/kate/part/kateautoindent.cpp
@@ -0,0 +1,2543 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2003 Jesse Yurkovich <yurkjes@iit.edu>
+ Copyright (C) 2004 >Anders Lund <anders@alweb.dk> (KateVarIndent class)
+ Copyright (C) 2005 Dominik Haumann <dhdev@gmx.de> (basic support for config page)
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "kateautoindent.h"
+#include "kateautoindent.moc"
+
+#include "kateconfig.h"
+#include "katehighlight.h"
+#include "katefactory.h"
+#include "katejscript.h"
+#include "kateview.h"
+
+#include <klocale.h>
+#include <kdebug.h>
+#include <kpopupmenu.h>
+
+#include <cctype>
+
+//BEGIN KateAutoIndent
+
+KateAutoIndent *KateAutoIndent::createIndenter (KateDocument *doc, uint mode)
+{
+ if (mode == KateDocumentConfig::imNormal)
+ return new KateNormalIndent (doc);
+ else if (mode == KateDocumentConfig::imCStyle)
+ return new KateCSmartIndent (doc);
+ else if (mode == KateDocumentConfig::imPythonStyle)
+ return new KatePythonIndent (doc);
+ else if (mode == KateDocumentConfig::imXmlStyle)
+ return new KateXmlIndent (doc);
+ else if (mode == KateDocumentConfig::imCSAndS)
+ return new KateCSAndSIndent (doc);
+ else if ( mode == KateDocumentConfig::imVarIndent )
+ return new KateVarIndent ( doc );
+// else if ( mode == KateDocumentConfig::imScriptIndent)
+// return new KateScriptIndent ( doc );
+
+ return new KateAutoIndent (doc);
+}
+
+QStringList KateAutoIndent::listModes ()
+{
+ QStringList l;
+
+ l << modeDescription(KateDocumentConfig::imNone);
+ l << modeDescription(KateDocumentConfig::imNormal);
+ l << modeDescription(KateDocumentConfig::imCStyle);
+ l << modeDescription(KateDocumentConfig::imPythonStyle);
+ l << modeDescription(KateDocumentConfig::imXmlStyle);
+ l << modeDescription(KateDocumentConfig::imCSAndS);
+ l << modeDescription(KateDocumentConfig::imVarIndent);
+// l << modeDescription(KateDocumentConfig::imScriptIndent);
+
+ return l;
+}
+
+QString KateAutoIndent::modeName (uint mode)
+{
+ if (mode == KateDocumentConfig::imNormal)
+ return QString ("normal");
+ else if (mode == KateDocumentConfig::imCStyle)
+ return QString ("cstyle");
+ else if (mode == KateDocumentConfig::imPythonStyle)
+ return QString ("python");
+ else if (mode == KateDocumentConfig::imXmlStyle)
+ return QString ("xml");
+ else if (mode == KateDocumentConfig::imCSAndS)
+ return QString ("csands");
+ else if ( mode == KateDocumentConfig::imVarIndent )
+ return QString( "varindent" );
+// else if ( mode == KateDocumentConfig::imScriptIndent )
+// return QString( "scriptindent" );
+
+ return QString ("none");
+}
+
+QString KateAutoIndent::modeDescription (uint mode)
+{
+ if (mode == KateDocumentConfig::imNormal)
+ return i18n ("Normal");
+ else if (mode == KateDocumentConfig::imCStyle)
+ return i18n ("C Style");
+ else if (mode == KateDocumentConfig::imPythonStyle)
+ return i18n ("Python Style");
+ else if (mode == KateDocumentConfig::imXmlStyle)
+ return i18n ("XML Style");
+ else if (mode == KateDocumentConfig::imCSAndS)
+ return i18n ("S&S C Style");
+ else if ( mode == KateDocumentConfig::imVarIndent )
+ return i18n("Variable Based Indenter");
+// else if ( mode == KateDocumentConfig::imScriptIndent )
+// return i18n("JavaScript Indenter");
+
+ return i18n ("None");
+}
+
+uint KateAutoIndent::modeNumber (const QString &name)
+{
+ if (modeName(KateDocumentConfig::imNormal) == name)
+ return KateDocumentConfig::imNormal;
+ else if (modeName(KateDocumentConfig::imCStyle) == name)
+ return KateDocumentConfig::imCStyle;
+ else if (modeName(KateDocumentConfig::imPythonStyle) == name)
+ return KateDocumentConfig::imPythonStyle;
+ else if (modeName(KateDocumentConfig::imXmlStyle) == name)
+ return KateDocumentConfig::imXmlStyle;
+ else if (modeName(KateDocumentConfig::imCSAndS) == name)
+ return KateDocumentConfig::imCSAndS;
+ else if ( modeName( KateDocumentConfig::imVarIndent ) == name )
+ return KateDocumentConfig::imVarIndent;
+// else if ( modeName( KateDocumentConfig::imScriptIndent ) == name )
+// return KateDocumentConfig::imScriptIndent;
+
+ return KateDocumentConfig::imNone;
+}
+
+bool KateAutoIndent::hasConfigPage (uint mode)
+{
+// if ( mode == KateDocumentConfig::imScriptIndent )
+// return true;
+
+ return false;
+}
+
+IndenterConfigPage* KateAutoIndent::configPage(QWidget *parent, uint mode)
+{
+// if ( mode == KateDocumentConfig::imScriptIndent )
+// return new ScriptIndentConfigPage(parent, "script_indent_config_page");
+
+ return 0;
+}
+
+KateAutoIndent::KateAutoIndent (KateDocument *_doc)
+: QObject(), doc(_doc)
+{
+}
+KateAutoIndent::~KateAutoIndent ()
+{
+}
+
+//END KateAutoIndent
+
+//BEGIN KateViewIndentAction
+KateViewIndentationAction::KateViewIndentationAction(KateDocument *_doc, const QString& text, QObject* parent, const char* name)
+ : KActionMenu (text, parent, name), doc(_doc)
+{
+ connect(popupMenu(),SIGNAL(aboutToShow()),this,SLOT(slotAboutToShow()));
+}
+
+void KateViewIndentationAction::slotAboutToShow()
+{
+ QStringList modes = KateAutoIndent::listModes ();
+
+ popupMenu()->clear ();
+ for (uint z=0; z<modes.size(); ++z)
+ popupMenu()->insertItem ( '&' + KateAutoIndent::modeDescription(z).replace('&', "&&"), this, SLOT(setMode(int)), 0, z);
+
+ popupMenu()->setItemChecked (doc->config()->indentationMode(), true);
+}
+
+void KateViewIndentationAction::setMode (int mode)
+{
+ doc->config()->setIndentationMode((uint)mode);
+}
+//END KateViewIndentationAction
+
+//BEGIN KateNormalIndent
+
+KateNormalIndent::KateNormalIndent (KateDocument *_doc)
+ : KateAutoIndent (_doc)
+{
+ // if highlighting changes, update attributes
+ connect(_doc, SIGNAL(hlChanged()), this, SLOT(updateConfig()));
+}
+
+KateNormalIndent::~KateNormalIndent ()
+{
+}
+
+void KateNormalIndent::updateConfig ()
+{
+ KateDocumentConfig *config = doc->config();
+
+ useSpaces = config->configFlags() & KateDocument::cfSpaceIndent || config->configFlags() & KateDocumentConfig::cfReplaceTabsDyn;
+ mixedIndent = useSpaces && config->configFlags() & KateDocumentConfig::cfMixedIndent;
+ keepProfile = config->configFlags() & KateDocument::cfKeepIndentProfile;
+ tabWidth = config->tabWidth();
+ indentWidth = useSpaces? config->indentationWidth() : tabWidth;
+
+ commentAttrib = 255;
+ doxyCommentAttrib = 255;
+ regionAttrib = 255;
+ symbolAttrib = 255;
+ alertAttrib = 255;
+ tagAttrib = 255;
+ wordAttrib = 255;
+ keywordAttrib = 255;
+ normalAttrib = 255;
+ extensionAttrib = 255;
+ preprocessorAttrib = 255;
+ stringAttrib = 255;
+ charAttrib = 255;
+
+ KateHlItemDataList items;
+ doc->highlight()->getKateHlItemDataListCopy (0, items);
+
+ for (uint i=0; i<items.count(); i++)
+ {
+ QString name = items.at(i)->name;
+ if (name.find("Comment") != -1 && commentAttrib == 255)
+ {
+ commentAttrib = i;
+ }
+ else if (name.find("Region Marker") != -1 && regionAttrib == 255)
+ {
+ regionAttrib = i;
+ }
+ else if (name.find("Symbol") != -1 && symbolAttrib == 255)
+ {
+ symbolAttrib = i;
+ }
+ else if (name.find("Alert") != -1)
+ {
+ alertAttrib = i;
+ }
+ else if (name.find("Comment") != -1 && commentAttrib != 255 && doxyCommentAttrib == 255)
+ {
+ doxyCommentAttrib = i;
+ }
+ else if (name.find("Tags") != -1 && tagAttrib == 255)
+ {
+ tagAttrib = i;
+ }
+ else if (name.find("Word") != -1 && wordAttrib == 255)
+ {
+ wordAttrib = i;
+ }
+ else if (name.find("Keyword") != -1 && keywordAttrib == 255)
+ {
+ keywordAttrib = i;
+ }
+ else if (name.find("Normal") != -1 && normalAttrib == 255)
+ {
+ normalAttrib = i;
+ }
+ else if (name.find("Extensions") != -1 && extensionAttrib == 255)
+ {
+ extensionAttrib = i;
+ }
+ else if (name.find("Preprocessor") != -1 && preprocessorAttrib == 255)
+ {
+ preprocessorAttrib = i;
+ }
+ else if (name.find("String") != -1 && stringAttrib == 255)
+ {
+ stringAttrib = i;
+ }
+ else if (name.find("Char") != -1 && charAttrib == 255)
+ {
+ charAttrib = i;
+ }
+ }
+}
+
+bool KateNormalIndent::isBalanced (KateDocCursor &begin, const KateDocCursor &end, QChar open, QChar close, uint &pos) const
+{
+ int parenOpen = 0;
+ bool atLeastOne = false;
+ bool getNext = false;
+
+ pos = doc->plainKateTextLine(begin.line())->firstChar();
+
+ // Iterate one-by-one finding opening and closing chars
+ // Assume that open and close are 'Symbol' characters
+ while (begin < end)
+ {
+ QChar c = begin.currentChar();
+ if (begin.currentAttrib() == symbolAttrib)
+ {
+ if (c == open)
+ {
+ if (!atLeastOne)
+ {
+ atLeastOne = true;
+ getNext = true;
+ pos = measureIndent(begin) + 1;
+ }
+ parenOpen++;
+ }
+ else if (c == close)
+ {
+ parenOpen--;
+ }
+ }
+ else if (getNext && !c.isSpace())
+ {
+ getNext = false;
+ pos = measureIndent(begin);
+ }
+
+ if (atLeastOne && parenOpen <= 0)
+ return true;
+
+ if (!begin.moveForward(1))
+ break;
+ }
+
+ return (atLeastOne) ? false : true;
+}
+
+bool KateNormalIndent::skipBlanks (KateDocCursor &cur, KateDocCursor &max, bool newline) const
+{
+ int curLine = cur.line();
+ if (newline)
+ cur.moveForward(1);
+
+ if (cur >= max)
+ return false;
+
+ do
+ {
+ uchar attrib = cur.currentAttrib();
+ const QString hlFile = doc->highlight()->hlKeyForAttrib( attrib );
+
+ if (attrib != commentAttrib && attrib != regionAttrib && attrib != alertAttrib && attrib != preprocessorAttrib && !hlFile.endsWith("doxygen.xml"))
+ {
+ QChar c = cur.currentChar();
+ if (!c.isNull() && !c.isSpace())
+ break;
+ }
+
+ if (!cur.moveForward(1))
+ {
+ // not able to move forward, so set cur to max
+ cur = max;
+ break;
+ }
+ // Make sure col is 0 if we spill into next line i.e. count the '\n' as a character
+ if (curLine != cur.line())
+ {
+ if (!newline)
+ break;
+ curLine = cur.line();
+ cur.setCol(0);
+ }
+ } while (cur < max);
+
+ if (cur > max)
+ cur = max;
+ return true;
+}
+
+uint KateNormalIndent::measureIndent (KateDocCursor &cur) const
+{
+ // We cannot short-cut by checking for useSpaces because there may be
+ // tabs in the line despite this setting.
+
+ return doc->plainKateTextLine(cur.line())->cursorX(cur.col(), tabWidth);
+}
+
+QString KateNormalIndent::tabString(uint pos) const
+{
+ QString s;
+ pos = kMin (pos, 80U); // sanity check for large values of pos
+
+ if (!useSpaces || mixedIndent)
+ {
+ while (pos >= tabWidth)
+ {
+ s += '\t';
+ pos -= tabWidth;
+ }
+ }
+ while (pos > 0)
+ {
+ s += ' ';
+ pos--;
+ }
+ return s;
+}
+
+void KateNormalIndent::processNewline (KateDocCursor &begin, bool /*needContinue*/)
+{
+ int line = begin.line() - 1;
+ int pos = begin.col();
+
+ while ((line > 0) && (pos < 0)) // search a not empty text line
+ pos = doc->plainKateTextLine(--line)->firstChar();
+
+ if (pos > 0)
+ {
+ QString filler = doc->text(line, 0, line, pos);
+ doc->insertText(begin.line(), 0, filler);
+ begin.setCol(filler.length());
+ }
+ else
+ begin.setCol(0);
+}
+
+//END
+
+//BEGIN KateCSmartIndent
+
+KateCSmartIndent::KateCSmartIndent (KateDocument *doc)
+: KateNormalIndent (doc),
+ allowSemi (false),
+ processingBlock (false)
+{
+ kdDebug(13030)<<"CREATING KATECSMART INTDETER"<<endl;
+}
+
+KateCSmartIndent::~KateCSmartIndent ()
+{
+
+}
+
+void KateCSmartIndent::processLine (KateDocCursor &line)
+{
+ kdDebug(13030)<<"PROCESSING LINE "<<line.line()<<endl;
+ KateTextLine::Ptr textLine = doc->plainKateTextLine(line.line());
+
+ int firstChar = textLine->firstChar();
+ // Empty line is worthless ... but only when doing more than 1 line
+ if (firstChar == -1 && processingBlock)
+ return;
+
+ uint indent = 0;
+
+ // TODO Here we do not check for beginning and ending comments ...
+ QChar first = textLine->getChar(firstChar);
+ QChar last = textLine->getChar(textLine->lastChar());
+
+ if (first == '}')
+ {
+ indent = findOpeningBrace(line);
+ }
+ else if (first == ')')
+ {
+ indent = findOpeningParen(line);
+ }
+ else if (first == '{')
+ {
+ // If this is the first brace, we keep the indent at 0
+ KateDocCursor temp(line.line(), firstChar, doc);
+ if (!firstOpeningBrace(temp))
+ indent = calcIndent(temp, false);
+ }
+ else if (first == ':')
+ {
+ // Initialization lists (handle c++ and c#)
+ int pos = findOpeningBrace(line);
+ if (pos == 0)
+ indent = indentWidth;
+ else
+ indent = pos + (indentWidth * 2);
+ }
+ else if (last == ':')
+ {
+ if (textLine->stringAtPos (firstChar, "case") ||
+ textLine->stringAtPos (firstChar, "default") ||
+ textLine->stringAtPos (firstChar, "public") ||
+ textLine->stringAtPos (firstChar, "private") ||
+ textLine->stringAtPos (firstChar, "protected") ||
+ textLine->stringAtPos (firstChar, "signals") ||
+ textLine->stringAtPos (firstChar, "Q_SIGNALS") ||
+ textLine->stringAtPos (firstChar, "Q_SLOTS") ||
+ textLine->stringAtPos (firstChar, "slots"))
+ {
+ indent = findOpeningBrace(line) + indentWidth;
+ }
+ }
+ else if (first == '*')
+ {
+ if (last == '/')
+ {
+ int lineEnd = textLine->lastChar();
+ if (lineEnd > 0 && textLine->getChar(lineEnd - 1) == '*')
+ {
+ indent = findOpeningComment(line);
+ if (textLine->attribute(firstChar) == doxyCommentAttrib)
+ indent++;
+ }
+ else
+ return;
+ }
+ else
+ {
+ KateDocCursor temp = line;
+ if (textLine->attribute(firstChar) == doxyCommentAttrib)
+ indent = calcIndent(temp, false) + 1;
+ else
+ indent = calcIndent(temp, true);
+ }
+ }
+ else if (first == '#')
+ {
+ // c# regions
+ if (textLine->stringAtPos (firstChar, "#region") ||
+ textLine->stringAtPos (firstChar, "#endregion"))
+ {
+ KateDocCursor temp = line;
+ indent = calcIndent(temp, true);
+ }
+ }
+ else
+ {
+ // Everything else ...
+ if (first == '/' && last != '/')
+ return;
+
+ KateDocCursor temp = line;
+ indent = calcIndent(temp, true);
+ if (indent == 0)
+ {
+ KateNormalIndent::processNewline(line, true);
+ return;
+ }
+ }
+
+ // Slightly faster if we don't indent what we don't have to
+ if (indent != measureIndent(line) || first == '}' || first == '{' || first == '#')
+ {
+ doc->removeText(line.line(), 0, line.line(), firstChar);
+ QString filler = tabString(indent);
+ if (indent > 0) doc->insertText(line.line(), 0, filler);
+ if (!processingBlock) line.setCol(filler.length());
+ }
+}
+
+void KateCSmartIndent::processSection (const KateDocCursor &begin, const KateDocCursor &end)
+{
+ kdDebug(13030)<<"PROCESS SECTION"<<endl;
+ KateDocCursor cur = begin;
+ QTime t;
+ t.start();
+
+ processingBlock = (end.line() - cur.line() > 0) ? true : false;
+
+ while (cur.line() <= end.line())
+ {
+ processLine (cur);
+ if (!cur.gotoNextLine())
+ break;
+ }
+
+ processingBlock = false;
+ kdDebug(13030) << "+++ total: " << t.elapsed() << endl;
+}
+
+bool KateCSmartIndent::handleDoxygen (KateDocCursor &begin)
+{
+ // Factor out the rather involved Doxygen stuff here ...
+ int line = begin.line();
+ int first = -1;
+ while ((line > 0) && (first < 0))
+ first = doc->plainKateTextLine(--line)->firstChar();
+
+ if (first >= 0)
+ {
+ KateTextLine::Ptr textLine = doc->plainKateTextLine(line);
+ bool insideDoxygen = false;
+ bool justAfterDoxygen = false;
+ if (textLine->attribute(first) == doxyCommentAttrib || textLine->attribute(textLine->lastChar()) == doxyCommentAttrib)
+ {
+ const int last = textLine->lastChar();
+ if (last <= 0 || !(justAfterDoxygen = textLine->stringAtPos(last-1, "*/")))
+ insideDoxygen = true;
+ if (justAfterDoxygen)
+ justAfterDoxygen &= textLine->string().find("/**") < 0;
+ while (textLine->attribute(first) != doxyCommentAttrib && first <= textLine->lastChar())
+ first++;
+ if (textLine->stringAtPos(first, "//"))
+ return false;
+ }
+
+ // Align the *'s and then go ahead and insert one too ...
+ if (insideDoxygen)
+ {
+ textLine = doc->plainKateTextLine(begin.line());
+ first = textLine->firstChar();
+ int indent = findOpeningComment(begin);
+ QString filler = tabString (indent);
+
+ bool doxygenAutoInsert = doc->config()->configFlags() & KateDocumentConfig::cfDoxygenAutoTyping;
+
+ if ( doxygenAutoInsert &&
+ ((first < 0) || (!textLine->stringAtPos(first, "*/") && !textLine->stringAtPos(first, "*"))))
+ {
+ filler = filler + " * ";
+ }
+
+ doc->removeText (begin.line(), 0, begin.line(), first);
+ doc->insertText (begin.line(), 0, filler);
+ begin.setCol(filler.length());
+
+ return true;
+ }
+ // Align position with beginning of doxygen comment. Otherwise the
+ // indentation is one too much.
+ else if (justAfterDoxygen)
+ {
+ textLine = doc->plainKateTextLine(begin.line());
+ first = textLine->firstChar();
+ int indent = findOpeningComment(begin);
+ QString filler = tabString (indent);
+
+ doc->removeText (begin.line(), 0, begin.line(), first);
+ doc->insertText (begin.line(), 0, filler);
+ begin.setCol(filler.length());
+
+ return true;
+ }
+ }
+
+ return false;
+}
+
+void KateCSmartIndent::processNewline (KateDocCursor &begin, bool needContinue)
+{
+ if (!handleDoxygen (begin))
+ {
+ KateTextLine::Ptr textLine = doc->plainKateTextLine(begin.line());
+ bool inMiddle = textLine->firstChar() > -1;
+
+ int indent = calcIndent (begin, needContinue);
+
+ if (indent > 0 || inMiddle)
+ {
+ QString filler = tabString (indent);
+ doc->insertText (begin.line(), 0, filler);
+ begin.setCol(filler.length());
+
+ // Handles cases where user hits enter at the beginning or middle of text
+ if (inMiddle)
+ {
+ processLine(begin);
+ begin.setCol(textLine->firstChar());
+ }
+ }
+ else
+ {
+ KateNormalIndent::processNewline (begin, needContinue);
+ }
+
+ if (begin.col() < 0)
+ begin.setCol(0);
+ }
+}
+
+/**
+ * Returns true when the given attribute matches any "colon influence immune"
+ * attribute
+ * @param indenter indenter
+ * @param attr1 attribute of previous char
+ * @param attr2 attribute of char preceding previous char
+ * @param prev1 previous character (0 if none)
+ * @param prev2 character preceding previous character (0 if none)
+ */
+static inline bool isColonImmune(const KateNormalIndent &indenter,
+ uchar attr1, uchar attr2,
+ QChar prev1, QChar prev2)
+{
+ return attr1 == indenter.preprocessorAttrib
+ // FIXME: no way to discriminate against multiline comment and single
+ // line comment. Therefore, using prev? is futile.
+ || attr1 == indenter.commentAttrib /*&& prev2 != '*' && prev1 != '/'*/
+ || attr1 == indenter.doxyCommentAttrib
+ || attr1 == indenter.stringAttrib && (attr2 != indenter.stringAttrib
+ || (prev1 != '"' || prev2 == '\\' && attr2 == indenter.charAttrib))
+ || prev1 == '\'' && attr1 != indenter.charAttrib;
+}
+
+/**
+ * Returns true when the colon is allowed to reindent the current line
+ * @param indenter current indenter
+ * @param line current line
+ * @param curCol column of most recently input character
+ */
+static inline bool colonPermitsReindent(const KateNormalIndent &indenter,
+ const KateTextLine::Ptr &line,
+ int curCol
+ )
+{
+ const QString txt = line->string(0,curCol);
+ // do we have any significant preceding colon?
+ for (int pos = 0; (pos = txt.find(':', pos)) >= 0; pos++) {
+ if (line->attribute(pos) == indenter.symbolAttrib)
+ // yes, it has already contributed to this line's indentation, don't
+ // indent again
+ return false;
+ }
+
+ // otherwise, check whether this colon is not within an influence
+ // immune attribute range
+ return !isColonImmune(indenter, line->attribute(curCol - 1),
+ line->attribute(curCol - 2),
+ txt[curCol - 1], txt[curCol - 2]);
+}
+
+void KateCSmartIndent::processChar(QChar c)
+{
+ // You may be curious about 'n' among the triggers:
+ // It is used to discriminate C#'s #region/#endregion which are indented
+ // against normal preprocessing statements which aren't indented.
+ static const QString triggers("}{)/:#n");
+ static const QString firstTriggers("}{)/:#");
+ static const QString lastTriggers(":n");
+ if (triggers.find(c) < 0)
+ return;
+
+ KateView *view = doc->activeView();
+ int curCol = view->cursorColumnReal() - 1;
+ KateDocCursor begin(view->cursorLine(), 0, doc);
+
+ KateTextLine::Ptr textLine = doc->plainKateTextLine(begin.line());
+ const QChar curChar = textLine->getChar(curCol);
+ const int first = textLine->firstChar();
+ const QChar firstChar = textLine->getChar(first);
+
+#if 0 // nice try
+ // Only indent on symbols or preprocessing directives -- never on
+ // anything else
+ kdDebug() << "curChar " << curChar << " curCol " << curCol << " textlen " << textLine->length() << " a " << textLine->attribute( curCol ) << " sym " << symbolAttrib << " pp " << preprocessorAttrib << endl;
+ if (!(((curChar == '#' || curChar == 'n')
+ && textLine->attribute( curCol ) == preprocessorAttrib)
+ || textLine->attribute( curCol ) == symbolAttrib)
+ )
+ return;
+ kdDebug() << "curChar " << curChar << endl;
+#endif
+
+ if (c == 'n')
+ {
+ if (firstChar != '#' || textLine->string(curCol-5, 5) != QString::fromLatin1("regio"))
+ return;
+ }
+
+ if ( c == '/' )
+ {
+ // dominik: if line is "* /", change it to "*/"
+ if ( textLine->attribute( begin.col() ) == doxyCommentAttrib )
+ {
+ // if the first char exists and is a '*', and the next non-space-char
+ // is already the just typed '/', concatenate it to "*/".
+ if ( first != -1
+ && firstChar == '*'
+ && textLine->nextNonSpaceChar( first+1 ) == view->cursorColumnReal()-1 )
+ doc->removeText( view->cursorLine(), first+1, view->cursorLine(), view->cursorColumnReal()-1);
+ }
+
+ // ls: never have comments change the indentation.
+ return;
+ }
+
+ // ls: only reindent line if the user actually expects it
+ // I. e. take action on single braces on line or last colon, but inhibit
+ // any reindentation if any of those characters appear amidst some section
+ // of the line
+ const QChar lastChar = textLine->getChar(textLine->lastChar());
+ int pos;
+ if (((c == firstChar && firstTriggers.find(firstChar) >= 0)
+ || (c == lastChar && lastTriggers.find(lastChar) >= 0))
+ && (c != ':' || colonPermitsReindent(*this, textLine, curCol)))
+ processLine(begin);
+}
+
+
+uint KateCSmartIndent::calcIndent(KateDocCursor &begin, bool needContinue)
+{
+ KateTextLine::Ptr textLine;
+ KateDocCursor cur = begin;
+
+ uint anchorIndent = 0;
+ int anchorPos = 0;
+ int parenCount = 0; // Possibly in a multiline for stmt. Used to skip ';' ...
+ bool found = false;
+ bool isSpecial = false;
+ bool potentialAnchorSeen = false;
+ bool isArg = false; // ...arg,<newline>
+ bool parenthesizedArg = false; // ...(arg,<newline>
+
+ //kdDebug(13030) << "calcIndent begin line:" << begin.line() << " col:" << begin.col() << endl;
+
+ // Find Indent Anchor Point
+ while (cur.gotoPreviousLine())
+ {
+ isSpecial = found = false;
+ textLine = doc->plainKateTextLine(cur.line());
+
+ // Skip comments and handle cases like if (...) { stmt;
+ int pos = textLine->lastChar();
+ int openCount = 0;
+ int otherAnchor = -1;
+ do
+ {
+ if (textLine->attribute(pos) == symbolAttrib)
+ {
+ QChar tc = textLine->getChar (pos);
+ if ((tc == ';' || tc == ':' || tc == ',') && otherAnchor == -1 && parenCount <= 0) {
+ otherAnchor = pos, potentialAnchorSeen = true;
+ isArg = tc == ',';
+ } else if (tc == ')')
+ parenCount++;
+ else if (tc == '(')
+ parenCount--, parenthesizedArg = isArg, potentialAnchorSeen = true;
+ else if (tc == '}')
+ openCount--;
+ else if (tc == '{')
+ {
+ openCount++, potentialAnchorSeen = true;
+ if (openCount == 1)
+ break;
+ }
+ }
+ } while (--pos >= textLine->firstChar());
+
+ if (openCount != 0 || otherAnchor != -1)
+ {
+ found = true;
+ QChar c;
+ if (openCount > 0)
+ c = '{';
+ else if (openCount < 0)
+ c = '}';
+ else if (otherAnchor >= 0)
+ c = textLine->getChar (otherAnchor);
+
+ int specialIndent = 0;
+ if (c == ':' && needContinue)
+ {
+ QChar ch;
+ specialIndent = textLine->firstChar();
+ if (textLine->stringAtPos(specialIndent, "case"))
+ ch = textLine->getChar(specialIndent + 4);
+ else if (textLine->stringAtPos(specialIndent, "default"))
+ ch = textLine->getChar(specialIndent + 7);
+ else if (textLine->stringAtPos(specialIndent, "public"))
+ ch = textLine->getChar(specialIndent + 6);
+ else if (textLine->stringAtPos(specialIndent, "private"))
+ ch = textLine->getChar(specialIndent + 7);
+ else if (textLine->stringAtPos(specialIndent, "protected"))
+ ch = textLine->getChar(specialIndent + 9);
+ else if (textLine->stringAtPos(specialIndent, "signals"))
+ ch = textLine->getChar(specialIndent + 7);
+ else if (textLine->stringAtPos(specialIndent, "Q_SIGNALS"))
+ ch = textLine->getChar(specialIndent + 9);
+ else if (textLine->stringAtPos(specialIndent, "slots"))
+ ch = textLine->getChar(specialIndent + 5);
+ else if (textLine->stringAtPos(specialIndent, "Q_SLOTS"))
+ ch = textLine->getChar(specialIndent + 7);
+
+ if (ch.isNull() || (!ch.isSpace() && ch != '(' && ch != ':'))
+ continue;
+
+ KateDocCursor lineBegin = cur;
+ lineBegin.setCol(specialIndent);
+ specialIndent = measureIndent(lineBegin);
+ isSpecial = true;
+ }
+
+ // Move forward past blank lines
+ KateDocCursor skip = cur;
+ skip.setCol(textLine->lastChar());
+ bool result = skipBlanks(skip, begin, true);
+
+ anchorPos = skip.col();
+ anchorIndent = measureIndent(skip);
+
+ //kdDebug(13030) << "calcIndent anchorPos:" << anchorPos << " anchorIndent:" << anchorIndent << " at line:" << skip.line() << endl;
+
+ // Accept if it's before requested position or if it was special
+ if (result && skip < begin)
+ {
+ cur = skip;
+ break;
+ }
+ else if (isSpecial)
+ {
+ anchorIndent = specialIndent;
+ break;
+ }
+
+ // Are these on a line by themselves? (i.e. both last and first char)
+ if ((c == '{' || c == '}') && textLine->getChar(textLine->firstChar()) == c)
+ {
+ cur.setCol(anchorPos = textLine->firstChar());
+ anchorIndent = measureIndent (cur);
+ break;
+ }
+ }
+ }
+
+ // treat beginning of document as anchor position
+ if (cur.line() == 0 && cur.col() == 0 && potentialAnchorSeen)
+ found = true;
+
+ if (!found)
+ return 0;
+
+ uint continueIndent = (needContinue) ? calcContinue (cur, begin) : 0;
+ //kdDebug(13030) << "calcIndent continueIndent:" << continueIndent << endl;
+
+ // Move forward from anchor and determine last known reference character
+ // Braces take precedance over others ...
+ textLine = doc->plainKateTextLine(cur.line());
+ QChar lastChar = textLine->getChar (anchorPos);
+ int lastLine = cur.line();
+ if (lastChar == '#' || lastChar == '[')
+ {
+ // Never continue if # or [ is encountered at this point here
+ // A fail-safe really... most likely an #include, #region, or a c# attribute
+ continueIndent = 0;
+ }
+
+ int openCount = 0;
+ while (cur.validPosition() && cur < begin)
+ {
+ if (!skipBlanks(cur, begin, true))
+ return isArg && !parenthesizedArg ? begin.col() : 0;
+
+ QChar tc = cur.currentChar();
+ //kdDebug(13030) << " cur.line:" << cur.line() << " cur.col:" << cur.col() << " currentChar '" << tc << "' " << textLine->attribute(cur.col()) << endl;
+ if (cur == begin || tc.isNull())
+ break;
+
+ if (!tc.isSpace() && cur < begin)
+ {
+ uchar attrib = cur.currentAttrib();
+ if (tc == '{' && attrib == symbolAttrib)
+ openCount++;
+ else if (tc == '}' && attrib == symbolAttrib)
+ openCount--;
+
+ lastChar = tc;
+ lastLine = cur.line();
+ }
+ }
+ if (openCount > 0) // Open braces override
+ lastChar = '{';
+
+ uint indent = 0;
+ //kdDebug(13030) << "calcIndent lastChar '" << lastChar << "'" << endl;
+
+ if (lastChar == '{' || (lastChar == ':' && isSpecial && needContinue))
+ {
+ indent = anchorIndent + indentWidth;
+ }
+ else if (lastChar == '}')
+ {
+ indent = anchorIndent;
+ }
+ else if (lastChar == ';')
+ {
+ indent = anchorIndent + ((allowSemi && needContinue) ? continueIndent : 0);
+ }
+ else if (lastChar == ',' || lastChar == '(')
+ {
+ textLine = doc->plainKateTextLine(lastLine);
+ KateDocCursor start(lastLine, textLine->firstChar(), doc);
+ KateDocCursor finish(lastLine, textLine->lastChar() + 1, doc);
+ uint pos = 0;
+
+ if (isBalanced(start, finish, QChar('('), QChar(')'), pos) && false)
+ indent = anchorIndent;
+ else
+ {
+ // TODO: Config option. If we're below 48, go ahead and line them up
+ indent = ((pos < 48) ? pos : anchorIndent + (indentWidth * 2));
+ }
+ }
+ else if (!lastChar.isNull())
+ {
+ if (anchorIndent != 0)
+ indent = anchorIndent + continueIndent;
+ else
+ indent = continueIndent;
+ }
+
+ return indent;
+}
+
+uint KateCSmartIndent::calcContinue(KateDocCursor &start, KateDocCursor &end)
+{
+ KateDocCursor cur = start;
+
+ bool needsBalanced = true;
+ bool isFor = false;
+ allowSemi = false;
+
+ KateTextLine::Ptr textLine = doc->plainKateTextLine(cur.line());
+
+ // Handle cases such as } while (s ... by skipping the leading symbol
+ if (textLine->attribute(cur.col()) == symbolAttrib)
+ {
+ cur.moveForward(1);
+ skipBlanks(cur, end, false);
+ }
+
+ if (textLine->getChar(cur.col()) == '}')
+ {
+ skipBlanks(cur, end, true);
+ if (cur.line() != start.line())
+ textLine = doc->plainKateTextLine(cur.line());
+
+ if (textLine->stringAtPos(cur.col(), "else"))
+ cur.setCol(cur.col() + 4);
+ else
+ return indentWidth * 2;
+
+ needsBalanced = false;
+ }
+ else if (textLine->stringAtPos(cur.col(), "else"))
+ {
+ cur.setCol(cur.col() + 4);
+ needsBalanced = false;
+ int next = textLine->nextNonSpaceChar(cur.col());
+ if (next >= 0 && textLine->stringAtPos(next, "if"))
+ {
+ cur.setCol(next + 2);
+ needsBalanced = true;
+ }
+ }
+ else if (textLine->stringAtPos(cur.col(), "if"))
+ {
+ cur.setCol(cur.col() + 2);
+ }
+ else if (textLine->stringAtPos(cur.col(), "do"))
+ {
+ cur.setCol(cur.col() + 2);
+ needsBalanced = false;
+ }
+ else if (textLine->stringAtPos(cur.col(), "for"))
+ {
+ cur.setCol(cur.col() + 3);
+ isFor = true;
+ }
+ else if (textLine->stringAtPos(cur.col(), "while"))
+ {
+ cur.setCol(cur.col() + 5);
+ }
+ else if (textLine->stringAtPos(cur.col(), "switch"))
+ {
+ cur.setCol(cur.col() + 6);
+ }
+ else if (textLine->stringAtPos(cur.col(), "using"))
+ {
+ cur.setCol(cur.col() + 5);
+ }
+ else
+ {
+ return indentWidth * 2;
+ }
+
+ uint openPos = 0;
+ if (needsBalanced && !isBalanced (cur, end, QChar('('), QChar(')'), openPos))
+ {
+ allowSemi = isFor;
+ if (openPos > 0)
+ return (openPos - textLine->firstChar());
+ else
+ return indentWidth * 2;
+ }
+
+ // Check if this statement ends a line now
+ skipBlanks(cur, end, false);
+ if (cur == end)
+ return indentWidth;
+
+ if (skipBlanks(cur, end, true))
+ {
+ if (cur == end)
+ return indentWidth;
+ else
+ return indentWidth + calcContinue(cur, end);
+ }
+
+ return 0;
+}
+
+uint KateCSmartIndent::findOpeningBrace(KateDocCursor &start)
+{
+ KateDocCursor cur = start;
+ int count = 1;
+
+ // Move backwards 1 by 1 and find the opening brace
+ // Return the indent of that line
+ while (cur.moveBackward(1))
+ {
+ if (cur.currentAttrib() == symbolAttrib)
+ {
+ QChar ch = cur.currentChar();
+ if (ch == '{')
+ count--;
+ else if (ch == '}')
+ count++;
+
+ if (count == 0)
+ {
+ KateDocCursor temp(cur.line(), doc->plainKateTextLine(cur.line())->firstChar(), doc);
+ return measureIndent(temp);
+ }
+ }
+ }
+
+ return 0;
+}
+
+bool KateCSmartIndent::firstOpeningBrace(KateDocCursor &start)
+{
+ KateDocCursor cur = start;
+
+ // Are we the first opening brace at this level?
+ while(cur.moveBackward(1))
+ {
+ if (cur.currentAttrib() == symbolAttrib)
+ {
+ QChar ch = cur.currentChar();
+ if (ch == '{')
+ return false;
+ else if (ch == '}' && cur.col() == 0)
+ break;
+ }
+ }
+
+ return true;
+}
+
+uint KateCSmartIndent::findOpeningParen(KateDocCursor &start)
+{
+ KateDocCursor cur = start;
+ int count = 1;
+
+ // Move backwards 1 by 1 and find the opening (
+ // Return the indent of that line
+ while (cur.moveBackward(1))
+ {
+ if (cur.currentAttrib() == symbolAttrib)
+ {
+ QChar ch = cur.currentChar();
+ if (ch == '(')
+ count--;
+ else if (ch == ')')
+ count++;
+
+ if (count == 0)
+ return measureIndent(cur);
+ }
+ }
+
+ return 0;
+}
+
+uint KateCSmartIndent::findOpeningComment(KateDocCursor &start)
+{
+ KateDocCursor cur = start;
+
+ // Find the line with the opening /* and return the proper indent
+ do
+ {
+ KateTextLine::Ptr textLine = doc->plainKateTextLine(cur.line());
+
+ int pos = textLine->string().find("/*", false);
+ if (pos >= 0)
+ {
+ KateDocCursor temp(cur.line(), pos, doc);
+ return measureIndent(temp);
+ }
+
+ } while (cur.gotoPreviousLine());
+
+ return 0;
+}
+
+//END
+
+//BEGIN KatePythonIndent
+
+QRegExp KatePythonIndent::endWithColon = QRegExp( "^[^#]*:\\s*(#.*)?$" );
+QRegExp KatePythonIndent::stopStmt = QRegExp( "^\\s*(break|continue|raise|return|pass)\\b.*" );
+QRegExp KatePythonIndent::blockBegin = QRegExp( "^\\s*(class|def|if|elif|else|for|while|try)\\b.*" );
+
+KatePythonIndent::KatePythonIndent (KateDocument *doc)
+: KateNormalIndent (doc)
+{
+}
+KatePythonIndent::~KatePythonIndent ()
+{
+}
+
+void KatePythonIndent::processNewline (KateDocCursor &begin, bool /*newline*/)
+{
+ int prevLine = begin.line() - 1;
+ int prevPos = begin.col();
+
+ while ((prevLine > 0) && (prevPos < 0)) // search a not empty text line
+ prevPos = doc->plainKateTextLine(--prevLine)->firstChar();
+
+ int prevBlock = prevLine;
+ int prevBlockPos = prevPos;
+ int extraIndent = calcExtra (prevBlock, prevBlockPos, begin);
+
+ int indent = doc->plainKateTextLine(prevBlock)->cursorX(prevBlockPos, tabWidth);
+ if (extraIndent == 0)
+ {
+ if (!stopStmt.exactMatch(doc->plainKateTextLine(prevLine)->string()))
+ {
+ if (endWithColon.exactMatch(doc->plainKateTextLine(prevLine)->string()))
+ indent += indentWidth;
+ else
+ indent = doc->plainKateTextLine(prevLine)->cursorX(prevPos, tabWidth);
+ }
+ }
+ else
+ indent += extraIndent;
+
+ if (indent > 0)
+ {
+ QString filler = tabString (indent);
+ doc->insertText (begin.line(), 0, filler);
+ begin.setCol(filler.length());
+ }
+ else
+ begin.setCol(0);
+}
+
+int KatePythonIndent::calcExtra (int &prevBlock, int &pos, KateDocCursor &end)
+{
+ int nestLevel = 0;
+ bool levelFound = false;
+ while ((prevBlock > 0))
+ {
+ if (blockBegin.exactMatch(doc->plainKateTextLine(prevBlock)->string()))
+ {
+ if ((!levelFound && nestLevel == 0) || (levelFound && nestLevel - 1 <= 0))
+ {
+ pos = doc->plainKateTextLine(prevBlock)->firstChar();
+ break;
+ }
+
+ nestLevel --;
+ }
+ else if (stopStmt.exactMatch(doc->plainKateTextLine(prevBlock)->string()))
+ {
+ nestLevel ++;
+ levelFound = true;
+ }
+
+ --prevBlock;
+ }
+
+ KateDocCursor cur (prevBlock, pos, doc);
+ QChar c;
+ int extraIndent = 0;
+ while (cur.line() < end.line())
+ {
+ c = cur.currentChar();
+
+ if (c == '(')
+ extraIndent += indentWidth;
+ else if (c == ')')
+ extraIndent -= indentWidth;
+ else if (c == ':')
+ break;
+ else if (c == '\'' || c == '"' )
+ traverseString( c, cur, end );
+
+ if (c.isNull() || c == '#')
+ cur.gotoNextLine();
+ else
+ cur.moveForward(1);
+ }
+
+ return extraIndent;
+}
+
+void KatePythonIndent::traverseString( const QChar &stringChar, KateDocCursor &cur, KateDocCursor &end )
+{
+ QChar c;
+ bool escape = false;
+
+ cur.moveForward(1);
+ c = cur.currentChar();
+ while ( ( c != stringChar || escape ) && cur.line() < end.line() )
+ {
+ if ( escape )
+ escape = false;
+ else if ( c == '\\' )
+ escape = !escape;
+
+ cur.moveForward(1);
+ c = cur.currentChar();
+ }
+}
+
+//END
+
+//BEGIN KateXmlIndent
+
+/* Explanation
+
+The XML indenter simply inherits the indentation of the previous line,
+with the first line starting at 0 (of course!). For each element that
+is opened on the previous line, the indentation is increased by one
+level; for each element that is closed, it is decreased by one.
+
+We also have a special case of opening an element on one line and then
+entering attributes on the following lines, in which case we would like
+to see the following layout:
+<elem attr="..."
+ blah="..." />
+
+<x><a href="..."
+ title="..." />
+</x>
+
+This is accomplished by checking for lines that contain an unclosed open
+tag.
+
+*/
+
+const QRegExp KateXmlIndent::startsWithCloseTag("^[ \t]*</");
+const QRegExp KateXmlIndent::unclosedDoctype("<!DOCTYPE[^>]*$");
+
+KateXmlIndent::KateXmlIndent (KateDocument *doc)
+: KateNormalIndent (doc)
+{
+}
+
+KateXmlIndent::~KateXmlIndent ()
+{
+}
+
+void KateXmlIndent::processNewline (KateDocCursor &begin, bool /*newline*/)
+{
+ begin.setCol(processLine(begin.line()));
+}
+
+void KateXmlIndent::processChar (QChar c)
+{
+ if(c != '/') return;
+
+ // only alter lines that start with a close element
+ KateView *view = doc->activeView();
+ QString text = doc->plainKateTextLine(view->cursorLine())->string();
+ if(text.find(startsWithCloseTag) == -1) return;
+
+ // process it
+ processLine(view->cursorLine());
+}
+
+void KateXmlIndent::processLine (KateDocCursor &line)
+{
+ processLine (line.line());
+}
+
+void KateXmlIndent::processSection (const KateDocCursor &start, const KateDocCursor &end)
+{
+ KateDocCursor cur (start);
+ int endLine = end.line();
+
+ do {
+ processLine(cur.line());
+ if(!cur.gotoNextLine()) break;
+ } while(cur.line() < endLine);
+}
+
+void KateXmlIndent::getLineInfo (uint line, uint &prevIndent, int &numTags,
+ uint &attrCol, bool &unclosedTag)
+{
+ prevIndent = 0;
+ int firstChar;
+ KateTextLine::Ptr prevLine = 0;
+
+ // get the indentation of the first non-empty line
+ while(true) {
+ prevLine = doc->plainKateTextLine(line);
+ if( (firstChar = prevLine->firstChar()) < 0) {
+ if(!line--) return;
+ continue;
+ }
+ break;
+ }
+ prevIndent = prevLine->cursorX(prevLine->firstChar(), tabWidth);
+ QString text = prevLine->string();
+
+ // special case:
+ // <a>
+ // </a> <!-- indentation *already* decreased -->
+ // requires that we discount the </a> from the number of closed tags
+ if(text.find(startsWithCloseTag) != -1) ++numTags;
+
+ // count the number of open and close tags
+ int lastCh = 0;
+ uint pos, len = text.length();
+ bool seenOpen = false;
+ for(pos = 0; pos < len; ++pos) {
+ int ch = text.at(pos).unicode();
+ switch(ch) {
+ case '<':
+ seenOpen = true;
+ unclosedTag = true;
+ attrCol = pos;
+ ++numTags;
+ break;
+
+ // don't indent because of DOCTYPE, comment, CDATA, etc.
+ case '!':
+ if(lastCh == '<') --numTags;
+ break;
+
+ // don't indent because of xml decl or PI
+ case '?':
+ if(lastCh == '<') --numTags;
+ break;
+
+ case '>':
+ if(!seenOpen) {
+ // we are on a line like the second one here:
+ // <element attr="val"
+ // other="val">
+ // so we need to set prevIndent to the indent of the first line
+ //
+ // however, we need to special case "<!DOCTYPE" because
+ // it's not an open tag
+
+ prevIndent = 0;
+
+ for(uint backLine = line; backLine; ) {
+ // find first line with an open tag
+ KateTextLine::Ptr x = doc->plainKateTextLine(--backLine);
+ if(x->string().find('<') == -1) continue;
+
+ // recalculate the indent
+ if(x->string().find(unclosedDoctype) != -1) --numTags;
+ getLineInfo(backLine, prevIndent, numTags, attrCol, unclosedTag);
+ break;
+ }
+ }
+ if(lastCh == '/') --numTags;
+ unclosedTag = false;
+ break;
+
+ case '/':
+ if(lastCh == '<') numTags -= 2; // correct for '<', above
+ break;
+ }
+ lastCh = ch;
+ }
+
+ if(unclosedTag) {
+ // find the start of the next attribute, so we can align with it
+ do {
+ lastCh = text.at(++attrCol).unicode();
+ }while(lastCh && lastCh != ' ' && lastCh != '\t');
+
+ while(lastCh == ' ' || lastCh == '\t') {
+ lastCh = text.at(++attrCol).unicode();
+ }
+
+ attrCol = prevLine->cursorX(attrCol, tabWidth);
+ }
+}
+
+uint KateXmlIndent::processLine (uint line)
+{
+ KateTextLine::Ptr kateLine = doc->plainKateTextLine(line);
+ if(!kateLine) return 0; // sanity check
+
+ // get details from previous line
+ uint prevIndent = 0, attrCol = 0;
+ int numTags = 0;
+ bool unclosedTag = false; // for aligning attributes
+
+ if(line) {
+ getLineInfo(line - 1, prevIndent, numTags, attrCol, unclosedTag);
+ }
+
+ // compute new indent
+ int indent = 0;
+ if(unclosedTag) indent = attrCol;
+ else indent = prevIndent + numTags * indentWidth;
+ if(indent < 0) indent = 0;
+
+ // unindent lines that start with a close tag
+ if(kateLine->string().find(startsWithCloseTag) != -1) {
+ indent -= indentWidth;
+ }
+ if(indent < 0) indent = 0;
+
+ // apply new indent
+ doc->removeText(line, 0, line, kateLine->firstChar());
+ QString filler = tabString(indent);
+ doc->insertText(line, 0, filler);
+
+ return filler.length();
+}
+
+//END
+
+//BEGIN KateCSAndSIndent
+
+KateCSAndSIndent::KateCSAndSIndent (KateDocument *doc)
+: KateNormalIndent (doc)
+{
+}
+
+void KateCSAndSIndent::updateIndentString()
+{
+ if( useSpaces )
+ indentString.fill( ' ', indentWidth );
+ else
+ indentString = '\t';
+}
+
+KateCSAndSIndent::~KateCSAndSIndent ()
+{
+}
+
+void KateCSAndSIndent::processLine (KateDocCursor &line)
+{
+ KateTextLine::Ptr textLine = doc->plainKateTextLine(line.line());
+
+ if (!textLine)
+ return;
+
+ updateIndentString();
+
+ const int oldCol = line.col();
+ QString whitespace = calcIndent(line);
+ // strip off existing whitespace
+ int oldIndent = textLine->firstChar();
+ if ( oldIndent < 0 )
+ oldIndent = doc->lineLength( line.line() );
+ if( oldIndent > 0 )
+ doc->removeText(line.line(), 0, line.line(), oldIndent);
+ // add correct amount
+ doc->insertText(line.line(), 0, whitespace);
+
+ // try to preserve the cursor position in the line
+ if ( int(oldCol + whitespace.length()) >= oldIndent )
+ line.setCol( oldCol + whitespace.length() - oldIndent );
+ else
+ line.setCol( 0 );
+}
+
+void KateCSAndSIndent::processSection (const KateDocCursor &begin, const KateDocCursor &end)
+{
+ QTime t; t.start();
+ for( KateDocCursor cur = begin; cur.line() <= end.line(); )
+ {
+ processLine (cur);
+ if (!cur.gotoNextLine())
+ break;
+ }
+ kdDebug(13030) << "+++ total: " << t.elapsed() << endl;
+}
+
+/**
+ * Returns the first @p chars characters of @p line, converted to whitespace.
+ * If @p convert is set to false, characters at and after the first non-whitespace
+ * character are removed, not converted.
+ */
+static QString initialWhitespace(const KateTextLine::Ptr &line, int chars, bool convert = true)
+{
+ QString text = line->string(0, chars);
+ if( (int)text.length() < chars )
+ {
+ QString filler; filler.fill(' ',chars - text.length());
+ text += filler;
+ }
+ for( uint n = 0; n < text.length(); ++n )
+ {
+ if( text[n] != '\t' && text[n] != ' ' )
+ {
+ if( !convert )
+ return text.left( n );
+ text[n] = ' ';
+ }
+ }
+ return text;
+}
+
+QString KateCSAndSIndent::findOpeningCommentIndentation(const KateDocCursor &start)
+{
+ KateDocCursor cur = start;
+
+ // Find the line with the opening /* and return the indentation of it
+ do
+ {
+ KateTextLine::Ptr textLine = doc->plainKateTextLine(cur.line());
+
+ int pos = textLine->string().findRev("/*");
+ // FIXME: /* inside /* is possible. This screws up in that case...
+ if (pos >= 0)
+ return initialWhitespace(textLine, pos);
+ } while (cur.gotoPreviousLine());
+
+ // should never happen.
+ kdWarning( 13030 ) << " in a comment, but can't find the start of it" << endl;
+ return QString::null;
+}
+
+bool KateCSAndSIndent::handleDoxygen (KateDocCursor &begin)
+{
+ // Look backwards for a nonempty line
+ int line = begin.line();
+ int first = -1;
+ while ((line > 0) && (first < 0))
+ first = doc->plainKateTextLine(--line)->firstChar();
+
+ // no earlier nonempty line
+ if (first < 0)
+ return false;
+
+ KateTextLine::Ptr textLine = doc->plainKateTextLine(line);
+
+ // if the line doesn't end with a doxygen comment (that's not closed)
+ // and doesn't start with a doxygen comment (that's not closed), we don't care.
+ // note that we do need to check the start of the line, or lines ending with, say, @brief aren't
+ // recognised.
+ if ( !(textLine->attribute(textLine->lastChar()) == doxyCommentAttrib && !textLine->endingWith("*/")) &&
+ !(textLine->attribute(textLine->firstChar()) == doxyCommentAttrib && !textLine->string().contains("*/")) )
+ return false;
+
+ // our line is inside a doxygen comment. align the *'s and then maybe insert one too ...
+ textLine = doc->plainKateTextLine(begin.line());
+ first = textLine->firstChar();
+ QString indent = findOpeningCommentIndentation(begin);
+
+ bool doxygenAutoInsert = doc->config()->configFlags() & KateDocumentConfig::cfDoxygenAutoTyping;
+
+ // starts with *: indent one space more to line up *s
+ if ( first >= 0 && textLine->stringAtPos(first, "*") )
+ indent = indent + " ";
+ // does not start with *: insert one if user wants that
+ else if ( doxygenAutoInsert )
+ indent = indent + " * ";
+ // user doesn't want * inserted automatically: put in spaces?
+ //else
+ // indent = indent + " ";
+
+ doc->removeText (begin.line(), 0, begin.line(), first);
+ doc->insertText (begin.line(), 0, indent);
+ begin.setCol(indent.length());
+
+ return true;
+}
+
+/**
+ * @brief User pressed enter. Line has been split; begin is on the new line.
+ * @param begin Three unrelated variables: the new line number, where the first
+ * non-whitespace char was on the previous line, and the document.
+ * @param needContinue Something to do with indenting the current line; always true.
+ */
+void KateCSAndSIndent::processNewline (KateDocCursor &begin, bool /*needContinue*/)
+{
+ // in a comment, add a * doxygen-style.
+ if( handleDoxygen(begin) )
+ return;
+
+ // TODO: if the user presses enter in the middle of a label, maybe the first half of the
+ // label should be indented?
+
+ // where the cursor actually is...
+ int cursorPos = doc->plainKateTextLine( begin.line() )->firstChar();
+ if ( cursorPos < 0 )
+ cursorPos = doc->lineLength( begin.line() );
+ begin.setCol( cursorPos );
+
+ processLine( begin );
+}
+
+/**
+ * Does the line @p line start with a label?
+ * @note May also return @c true if the line starts in a continuation.
+ */
+bool KateCSAndSIndent::startsWithLabel( int line )
+{
+ // Get the current line.
+ KateTextLine::Ptr indentLine = doc->plainKateTextLine(line);
+ const int indentFirst = indentLine->firstChar();
+
+ // Not entirely sure what this check does.
+ int attrib = indentLine->attribute(indentFirst);
+ if (attrib != 0 && attrib != keywordAttrib && attrib != normalAttrib && attrib != extensionAttrib)
+ return false;
+
+ // Get the line text.
+ const QString lineContents = indentLine->string();
+ const int indentLast = indentLine->lastChar();
+ bool whitespaceFound = false;
+ for ( int n = indentFirst; n <= indentLast; ++n )
+ {
+ // Get the character as latin1. Can't use QChar::isLetterOrNumber()
+ // as that includes non 0-9 numbers.
+ char c = lineContents[n].latin1();
+ if ( c == ':' )
+ {
+ // See if the next character is ':' - if so, skip to the character after it.
+ if ( n < lineContents.length() - 1 )
+ {
+ if ( lineContents[n+1].latin1() == ':' )
+ {
+ n += 2;
+ continue;
+ }
+ }
+ // Right this is the relevent ':'.
+ if ( n == indentFirst)
+ {
+ // Just a line with a : on it.
+ return false;
+ }
+ // It is a label of some kind!
+ return true;
+ }
+ if (isspace(c))
+ {
+ if (!whitespaceFound)
+ {
+ if (lineContents.mid(indentFirst, n - indentFirst) == "case")
+ return true;
+ else if (lineContents.mid(indentFirst, n - indentFirst) == "class")
+ return false;
+ whitespaceFound = true;
+ }
+ }
+ // All other characters don't indent.
+ else if ( !isalnum(c) && c != '_' )
+ {
+ return false;
+ }
+ }
+ return false;
+}
+
+template<class T> T min(T a, T b) { return (a < b) ? a : b; }
+
+int KateCSAndSIndent::lastNonCommentChar( const KateDocCursor &line )
+{
+ KateTextLine::Ptr textLine = doc->plainKateTextLine( line.line() );
+ QString str = textLine->string();
+
+ // find a possible start-of-comment
+ int p = -2; // so the first find starts at position 0
+ do p = str.find( "//", p + 2 );
+ while ( p >= 0 && textLine->attribute(p) != commentAttrib && textLine->attribute(p) != doxyCommentAttrib );
+
+ // no // found? use whole string
+ if ( p < 0 )
+ p = str.length();
+
+ // ignore trailing blanks. p starts one-past-the-end.
+ while( p > 0 && str[p-1].isSpace() ) --p;
+ return p - 1;
+}
+
+bool KateCSAndSIndent::inForStatement( int line )
+{
+ // does this line end in a for ( ...
+ // with no closing ) ?
+ int parens = 0, semicolons = 0;
+ for ( ; line >= 0; --line )
+ {
+ KateTextLine::Ptr textLine = doc->plainKateTextLine(line);
+ const int first = textLine->firstChar();
+ const int last = textLine->lastChar();
+
+ // look backwards for a symbol: (){};
+ // match ()s, {...; and }...; => not in a for
+ // ; ; ; => not in a for
+ // ( ; and ( ; ; => a for
+ for ( int curr = last; curr >= first; --curr )
+ {
+ if ( textLine->attribute(curr) != symbolAttrib )
+ continue;
+
+ switch( textLine->getChar(curr) )
+ {
+ case ';':
+ if( ++semicolons > 2 )
+ return false;
+ break;
+ case '{': case '}':
+ return false;
+ case ')':
+ ++parens;
+ break;
+ case '(':
+ if( --parens < 0 )
+ return true;
+ break;
+ }
+ }
+ }
+ // no useful symbols before the ;?
+ // not in a for then
+ return false;
+}
+
+
+// is the start of the line containing 'begin' in a statement?
+bool KateCSAndSIndent::inStatement( const KateDocCursor &begin )
+{
+ // if the current line starts with an open brace, it's not a continuation.
+ // this happens after a function definition (which is treated as a continuation).
+ KateTextLine::Ptr textLine = doc->plainKateTextLine(begin.line());
+ const int first = textLine->firstChar();
+ // note that if we're being called from processChar the attribute has not yet been calculated
+ // should be reasonably safe to assume that unattributed {s are symbols; if the { is in a comment
+ // we don't want to touch it anyway.
+ const int attrib = textLine->attribute(first);
+ if( first >= 0 && (attrib == 0 || attrib == symbolAttrib) && textLine->getChar(first) == '{' )
+ return false;
+
+ int line;
+ for ( line = begin.line() - 1; line >= 0; --line )
+ {
+ textLine = doc->plainKateTextLine(line);
+ const int first = textLine->firstChar();
+ if ( first == -1 )
+ continue;
+
+ // starts with #: in a comment, don't care
+ // outside a comment: preprocessor, don't care
+ if ( textLine->getChar( first ) == '#' )
+ continue;
+ KateDocCursor currLine = begin;
+ currLine.setLine( line );
+ const int last = lastNonCommentChar( currLine );
+ if ( last < first )
+ continue;
+
+ // HACK: if we see a comment, assume boldly that this isn't a continuation.
+ // detecting comments (using attributes) is HARD, since they may have
+ // embedded alerts, or doxygen stuff, or just about anything. this is
+ // wrong, and needs fixing. note that only multi-line comments and
+ // single-line comments continued with \ are affected.
+ const int attrib = textLine->attribute(last);
+ if ( attrib == commentAttrib || attrib == doxyCommentAttrib )
+ return false;
+
+ char c = textLine->getChar(last);
+
+ // brace => not a continuation.
+ if ( attrib == symbolAttrib && c == '{' || c == '}' )
+ return false;
+
+ // ; => not a continuation, unless in a for (;;)
+ if ( attrib == symbolAttrib && c == ';' )
+ return inForStatement( line );
+
+ // found something interesting. maybe it's a label?
+ if ( attrib == symbolAttrib && c == ':' )
+ {
+ // the : above isn't necessarily the : in the label, eg in
+ // case 'x': a = b ? c :
+ // this will say no continuation incorrectly. but continued statements
+ // starting on a line with a label at the start is Bad Style (tm).
+ if( startsWithLabel( line ) )
+ {
+ // either starts with a label or a continuation. if the current line
+ // starts in a continuation, we're still in one. if not, this was
+ // a label, so we're not in one now. so continue to the next line
+ // upwards.
+ continue;
+ }
+ }
+
+ // any other character => in a continuation
+ return true;
+ }
+ // no non-comment text found before here - not a continuation.
+ return false;
+}
+
+QString KateCSAndSIndent::continuationIndent( const KateDocCursor &begin )
+{
+ if( !inStatement( begin ) )
+ return QString::null;
+ return indentString;
+}
+
+/**
+ * Figure out how indented the line containing @p begin should be.
+ */
+QString KateCSAndSIndent::calcIndent (const KateDocCursor &begin)
+{
+ KateTextLine::Ptr currLine = doc->plainKateTextLine(begin.line());
+ int currLineFirst = currLine->firstChar();
+
+ // if the line starts inside a comment, no change of indentation.
+ // FIXME: this unnecessarily copies the current indentation over itself.
+ // FIXME: on newline, this should copy from the previous line.
+ if ( currLineFirst >= 0 &&
+ (currLine->attribute(currLineFirst) == commentAttrib ||
+ currLine->attribute(currLineFirst) == doxyCommentAttrib) )
+ return currLine->string( 0, currLineFirst );
+
+ // if the line starts with # (but isn't a c# region thingy), no indentation at all.
+ if( currLineFirst >= 0 && currLine->getChar(currLineFirst) == '#' )
+ {
+ if( !currLine->stringAtPos( currLineFirst+1, QString::fromLatin1("region") ) &&
+ !currLine->stringAtPos( currLineFirst+1, QString::fromLatin1("endregion") ) )
+ return QString::null;
+ }
+
+ /* Strategy:
+ * Look for an open bracket or brace, or a keyword opening a new scope, whichever comes latest.
+ * Found a brace: indent one tab in.
+ * Found a bracket: indent to the first non-white after it.
+ * Found a keyword: indent one tab in. for try, catch and switch, if newline is set, also add
+ * an open brace, a newline, and indent two tabs in.
+ */
+ KateDocCursor cur = begin;
+ int pos, openBraceCount = 0, openParenCount = 0;
+ bool lookingForScopeKeywords = true;
+ const char * const scopeKeywords[] = { "for", "do", "while", "if", "else" };
+ const char * const blockScopeKeywords[] = { "try", "catch", "switch" };
+
+ while (cur.gotoPreviousLine())
+ {
+ KateTextLine::Ptr textLine = doc->plainKateTextLine(cur.line());
+ const int lastChar = textLine->lastChar();
+ const int firstChar = textLine->firstChar();
+
+ // look through line backwards for interesting characters
+ for( pos = lastChar; pos >= firstChar; --pos )
+ {
+ if (textLine->attribute(pos) == symbolAttrib)
+ {
+ char tc = textLine->getChar (pos);
+ switch( tc )
+ {
+ case '(': case '[':
+ if( ++openParenCount > 0 )
+ return calcIndentInBracket( begin, cur, pos );
+ break;
+ case ')': case ']': openParenCount--; break;
+ case '{':
+ if( ++openBraceCount > 0 )
+ return calcIndentInBrace( begin, cur, pos );
+ break;
+ case '}': openBraceCount--; lookingForScopeKeywords = false; break;
+ case ';':
+ if( openParenCount == 0 )
+ lookingForScopeKeywords = false;
+ break;
+ }
+ }
+
+ // if we've not had a close brace or a semicolon yet, and we're at the same parenthesis level
+ // as the cursor, and we're at the start of a scope keyword, indent from it.
+ if ( lookingForScopeKeywords && openParenCount == 0 &&
+ textLine->attribute(pos) == keywordAttrib &&
+ (pos == 0 || textLine->attribute(pos-1) != keywordAttrib ) )
+ {
+ #define ARRLEN( array ) ( sizeof(array)/sizeof(array[0]) )
+ for( uint n = 0; n < ARRLEN(scopeKeywords); ++n )
+ if( textLine->stringAtPos(pos, QString::fromLatin1(scopeKeywords[n]) ) )
+ return calcIndentAfterKeyword( begin, cur, pos, false );
+ for( uint n = 0; n < ARRLEN(blockScopeKeywords); ++n )
+ if( textLine->stringAtPos(pos, QString::fromLatin1(blockScopeKeywords[n]) ) )
+ return calcIndentAfterKeyword( begin, cur, pos, true );
+ #undef ARRLEN
+ }
+ }
+ }
+
+ // no active { in file.
+ return QString::null;
+}
+
+QString KateCSAndSIndent::calcIndentInBracket(const KateDocCursor &indentCursor, const KateDocCursor &bracketCursor, int bracketPos)
+{
+ KateTextLine::Ptr indentLine = doc->plainKateTextLine(indentCursor.line());
+ KateTextLine::Ptr bracketLine = doc->plainKateTextLine(bracketCursor.line());
+
+ // FIXME: hard-coded max indent to bracket width - use a kate variable
+ // FIXME: expand tabs first...
+ if ( bracketPos > 48 )
+ {
+ // how far to indent? we could look back for a brace or keyword, 2 from that.
+ // as it is, we just indent one more than the line with the ( on it.
+ // the potential problem with this is when
+ // you have code ( which does <-- continuation + start of func call
+ // something like this ); <-- extra indentation for func call
+ // then again (
+ // it works better than (
+ // the other method for (
+ // cases like this )));
+ // consequently, i think this method wins.
+ return indentString + initialWhitespace( bracketLine, bracketLine->firstChar() );
+ }
+
+ const int indentLineFirst = indentLine->firstChar();
+
+ int indentTo;
+ const int attrib = indentLine->attribute(indentLineFirst);
+ if( indentLineFirst >= 0 && (attrib == 0 || attrib == symbolAttrib) &&
+ ( indentLine->getChar(indentLineFirst) == ')' || indentLine->getChar(indentLineFirst) == ']' ) )
+ {
+ // If the line starts with a close bracket, line it up
+ indentTo = bracketPos;
+ }
+ else
+ {
+ // Otherwise, line up with the text after the open bracket
+ indentTo = bracketLine->nextNonSpaceChar( bracketPos + 1 );
+ if( indentTo == -1 )
+ indentTo = bracketPos + 2;
+ }
+ return initialWhitespace( bracketLine, indentTo );
+}
+
+QString KateCSAndSIndent::calcIndentAfterKeyword(const KateDocCursor &indentCursor, const KateDocCursor &keywordCursor, int keywordPos, bool blockKeyword)
+{
+ KateTextLine::Ptr keywordLine = doc->plainKateTextLine(keywordCursor.line());
+ KateTextLine::Ptr indentLine = doc->plainKateTextLine(indentCursor.line());
+
+ QString whitespaceToKeyword = initialWhitespace( keywordLine, keywordPos, false );
+ if( blockKeyword ) {
+ // FIXME: we could add the open brace and subsequent newline here since they're definitely needed.
+ }
+
+ // If the line starts with an open brace, don't indent...
+ int first = indentLine->firstChar();
+ // if we're being called from processChar attribute won't be set
+ const int attrib = indentLine->attribute(first);
+ if( first >= 0 && (attrib == 0 || attrib == symbolAttrib) && indentLine->getChar(first) == '{' )
+ return whitespaceToKeyword;
+
+ // don't check for a continuation. rules are simple here:
+ // if we're in a non-compound statement after a scope keyword, we indent all lines
+ // once. so:
+ // if ( some stuff
+ // goes here )
+ // apples, and <-- continuation here is ignored. but this is Bad Style (tm) anyway.
+ // oranges too;
+ return indentString + whitespaceToKeyword;
+}
+
+QString KateCSAndSIndent::calcIndentInBrace(const KateDocCursor &indentCursor, const KateDocCursor &braceCursor, int bracePos)
+{
+ KateTextLine::Ptr braceLine = doc->plainKateTextLine(braceCursor.line());
+ const int braceFirst = braceLine->firstChar();
+
+ QString whitespaceToOpenBrace = initialWhitespace( braceLine, bracePos, false );
+
+ // if the open brace is the start of a namespace, don't indent...
+ // FIXME: this is an extremely poor heuristic. it looks on the line with
+ // the { and the line before to see if they start with a keyword
+ // beginning 'namespace'. that's 99% of usage, I'd guess.
+ {
+ if( braceFirst >= 0 && braceLine->attribute(braceFirst) == keywordAttrib &&
+ braceLine->stringAtPos( braceFirst, QString::fromLatin1( "namespace" ) ) )
+ return continuationIndent(indentCursor) + whitespaceToOpenBrace;
+
+ if( braceCursor.line() > 0 )
+ {
+ KateTextLine::Ptr prevLine = doc->plainKateTextLine(braceCursor.line() - 1);
+ int firstPrev = prevLine->firstChar();
+ if( firstPrev >= 0 && prevLine->attribute(firstPrev) == keywordAttrib &&
+ prevLine->stringAtPos( firstPrev, QString::fromLatin1( "namespace" ) ) )
+ return continuationIndent(indentCursor) + whitespaceToOpenBrace;
+ }
+ }
+
+ KateTextLine::Ptr indentLine = doc->plainKateTextLine(indentCursor.line());
+ const int indentFirst = indentLine->firstChar();
+
+ // if the line starts with a close brace, don't indent...
+ if( indentFirst >= 0 && indentLine->getChar(indentFirst) == '}' )
+ return whitespaceToOpenBrace;
+
+ // if : is the first character (and not followed by another :), this is the start
+ // of an initialization list, or a continuation of a ?:. either way, indent twice.
+ if ( indentFirst >= 0 && indentLine->attribute(indentFirst) == symbolAttrib &&
+ indentLine->getChar(indentFirst) == ':' && indentLine->getChar(indentFirst+1) != ':' )
+ {
+ return indentString + indentString + whitespaceToOpenBrace;
+ }
+
+ const bool continuation = inStatement(indentCursor);
+ // if the current line starts with a label, don't indent...
+ if( !continuation && startsWithLabel( indentCursor.line() ) )
+ return whitespaceToOpenBrace;
+
+ // the normal case: indent once for the brace, again if it's a continuation
+ QString continuationIndent = continuation ? indentString : QString::null;
+ return indentString + continuationIndent + whitespaceToOpenBrace;
+}
+
+void KateCSAndSIndent::processChar(QChar c)
+{
+ // 'n' trigger is for c# regions.
+ static const QString triggers("}{)]/:;#n");
+ if (triggers.find(c) == -1)
+ return;
+
+ // for historic reasons, processChar doesn't get a cursor
+ // to work on. so fabricate one.
+ KateView *view = doc->activeView();
+ KateDocCursor begin(view->cursorLine(), 0, doc);
+
+ KateTextLine::Ptr textLine = doc->plainKateTextLine(begin.line());
+ if ( c == 'n' )
+ {
+ int first = textLine->firstChar();
+ if( first < 0 || textLine->getChar(first) != '#' )
+ return;
+ }
+
+ if ( textLine->attribute( begin.col() ) == doxyCommentAttrib )
+ {
+ // dominik: if line is "* /", change it to "*/"
+ if ( c == '/' )
+ {
+ int first = textLine->firstChar();
+ // if the first char exists and is a '*', and the next non-space-char
+ // is already the just typed '/', concatenate it to "*/".
+ if ( first != -1
+ && textLine->getChar( first ) == '*'
+ && textLine->nextNonSpaceChar( first+1 ) == view->cursorColumnReal()-1 )
+ doc->removeText( view->cursorLine(), first+1, view->cursorLine(), view->cursorColumnReal()-1);
+ }
+
+ // anders: don't change the indent of doxygen lines here.
+ return;
+ }
+
+ processLine(begin);
+}
+
+//END
+
+//BEGIN KateVarIndent
+class KateVarIndentPrivate {
+ public:
+ QRegExp reIndentAfter, reIndent, reUnindent;
+ QString triggers;
+ uint couples;
+ uchar coupleAttrib;
+};
+
+KateVarIndent::KateVarIndent( KateDocument *doc )
+: KateNormalIndent( doc )
+{
+ d = new KateVarIndentPrivate;
+ d->reIndentAfter = QRegExp( doc->variable( "var-indent-indent-after" ) );
+ d->reIndent = QRegExp( doc->variable( "var-indent-indent" ) );
+ d->reUnindent = QRegExp( doc->variable( "var-indent-unindent" ) );
+ d->triggers = doc->variable( "var-indent-triggerchars" );
+ d->coupleAttrib = 0;
+
+ slotVariableChanged( "var-indent-couple-attribute", doc->variable( "var-indent-couple-attribute" ) );
+ slotVariableChanged( "var-indent-handle-couples", doc->variable( "var-indent-handle-couples" ) );
+
+ // update if a setting is changed
+ connect( doc, SIGNAL(variableChanged( const QString&, const QString&) ),
+ this, SLOT(slotVariableChanged( const QString&, const QString& )) );
+}
+
+KateVarIndent::~KateVarIndent()
+{
+ delete d;
+}
+
+void KateVarIndent::processNewline ( KateDocCursor &begin, bool /*needContinue*/ )
+{
+ // process the line left, as well as the one entered
+ KateDocCursor left( begin.line()-1, 0, doc );
+ processLine( left );
+ processLine( begin );
+}
+
+void KateVarIndent::processChar ( QChar c )
+{
+ // process line if the c is in our list, and we are not in comment text
+ if ( d->triggers.contains( c ) )
+ {
+ KateTextLine::Ptr ln = doc->plainKateTextLine( doc->activeView()->cursorLine() );
+ if ( ln->attribute( doc->activeView()->cursorColumn()-1 ) == commentAttrib )
+ return;
+
+ KateView *view = doc->activeView();
+ KateDocCursor begin( view->cursorLine(), 0, doc );
+ kdDebug(13030)<<"variable indenter: process char '"<<c<<", line "<<begin.line()<<endl;
+ processLine( begin );
+ }
+}
+
+void KateVarIndent::processLine ( KateDocCursor &line )
+{
+ QString indent; // store the indent string here
+
+ // find the first line with content that is not starting with comment text,
+ // and take the position from that
+ int ln = line.line();
+ int pos = -1;
+ KateTextLine::Ptr ktl = doc->plainKateTextLine( ln );
+ if ( ! ktl ) return; // no line!?
+
+ // skip blank lines, except for the cursor line
+ KateView *v = doc->activeView();
+ if ( (ktl->firstChar() < 0) && (!v || (int)v->cursorLine() != ln ) )
+ return;
+
+ int fc;
+ if ( ln > 0 )
+ do
+ {
+
+ ktl = doc->plainKateTextLine( --ln );
+ fc = ktl->firstChar();
+ if ( ktl->attribute( fc ) != commentAttrib )
+ pos = fc;
+ }
+ while ( (ln > 0) && (pos < 0) ); // search a not empty text line
+
+ if ( pos < 0 )
+ pos = 0;
+ else
+ pos = ktl->cursorX( pos, tabWidth );
+
+ int adjustment = 0;
+
+ // try 'couples' for an opening on the above line first. since we only adjust by 1 unit,
+ // we only need 1 match.
+ if ( d->couples & Parens && coupleBalance( ln, '(', ')' ) > 0 )
+ adjustment++;
+ else if ( d->couples & Braces && coupleBalance( ln, '{', '}' ) > 0 )
+ adjustment++;
+ else if ( d->couples & Brackets && coupleBalance( ln, '[', ']' ) > 0 )
+ adjustment++;
+
+ // Try 'couples' for a closing on this line first. since we only adjust by 1 unit,
+ // we only need 1 match. For unindenting, we look for a closing character
+ // *at the beginning of the line*
+ // NOTE Assume that a closing brace with the configured attribute on the start
+ // of the line is closing.
+ // When acting on processChar, the character isn't highlighted. So I could
+ // either not check, assuming that the first char *is* meant to close, or do a
+ // match test if the attrib is 0. How ever, doing that is
+ // a potentially huge job, if the match is several hundred lines away.
+ // Currently, the check is done.
+ {
+ KateTextLine::Ptr tl = doc->plainKateTextLine( line.line() );
+ int i = tl->firstChar();
+ if ( i > -1 )
+ {
+ QChar ch = tl->getChar( i );
+ uchar at = tl->attribute( i );
+ kdDebug(13030)<<"attrib is "<<at<<endl;
+ if ( d->couples & Parens && ch == ')'
+ && ( at == d->coupleAttrib
+ || (! at && hasRelevantOpening( KateDocCursor( line.line(), i, doc ) ))
+ )
+ )
+ adjustment--;
+ else if ( d->couples & Braces && ch == '}'
+ && ( at == d->coupleAttrib
+ || (! at && hasRelevantOpening( KateDocCursor( line.line(), i, doc ) ))
+ )
+ )
+ adjustment--;
+ else if ( d->couples & Brackets && ch == ']'
+ && ( at == d->coupleAttrib
+ || (! at && hasRelevantOpening( KateDocCursor( line.line(), i, doc ) ))
+ )
+ )
+ adjustment--;
+ }
+ }
+#define ISCOMMENTATTR(attr) (attr==commentAttrib||attr==doxyCommentAttrib)
+#define ISCOMMENT (ISCOMMENTATTR(ktl->attribute(ktl->firstChar()))||ISCOMMENTATTR(ktl->attribute(matchpos)))
+ // check if we should indent, unless the line starts with comment text,
+ // or the match is in comment text
+ kdDebug(13030)<<"variable indenter: starting indent: "<<pos<<endl;
+ // check if the above line indicates that we shuld add indentation
+ int matchpos = 0;
+ if ( ktl && ! d->reIndentAfter.isEmpty()
+ && (matchpos = d->reIndentAfter.search( doc->textLine( ln ) )) > -1
+ && ! ISCOMMENT )
+ adjustment++;
+
+ // else, check if this line should indent unless ...
+ ktl = doc->plainKateTextLine( line.line() );
+ if ( ! d->reIndent.isEmpty()
+ && (matchpos = d->reIndent.search( doc->textLine( line.line() ) )) > -1
+ && ! ISCOMMENT )
+ adjustment++;
+
+ // else, check if the current line indicates if we should remove indentation unless ...
+ if ( ! d->reUnindent.isEmpty()
+ && (matchpos = d->reUnindent.search( doc->textLine( line.line() ) )) > -1
+ && ! ISCOMMENT )
+ adjustment--;
+
+ kdDebug(13030)<<"variable indenter: adjusting by "<<adjustment<<" units"<<endl;
+
+ if ( adjustment > 0 )
+ pos += indentWidth;
+ else if ( adjustment < 0 )
+ pos -= indentWidth;
+
+ ln = line.line();
+ fc = doc->plainKateTextLine( ln )->firstChar();
+
+ // dont change if there is no change.
+ // ### should I actually compare the strings?
+ // FIXME for some odd reason, the document gets marked as changed
+ // even if we don't change it !?
+ if ( fc == pos )
+ return;
+
+ if ( fc > 0 )
+ doc->removeText (ln, 0, ln, fc );
+
+ if ( pos > 0 )
+ indent = tabString( pos );
+
+ if ( pos > 0 )
+ doc->insertText (ln, 0, indent);
+
+ // try to restore cursor ?
+ line.setCol( pos );
+}
+
+void KateVarIndent::processSection (const KateDocCursor &begin, const KateDocCursor &end)
+{
+ KateDocCursor cur = begin;
+ while (cur.line() <= end.line())
+ {
+ processLine (cur);
+ if (!cur.gotoNextLine())
+ break;
+ }
+}
+
+void KateVarIndent::slotVariableChanged( const QString &var, const QString &val )
+{
+ if ( ! var.startsWith("var-indent") )
+ return;
+
+ if ( var == "var-indent-indent-after" )
+ d->reIndentAfter.setPattern( val );
+ else if ( var == "var-indent-indent" )
+ d->reIndent.setPattern( val );
+ else if ( var == "var-indent-unindent" )
+ d->reUnindent.setPattern( val );
+ else if ( var == "var-indent-triggerchars" )
+ d->triggers = val;
+ else if ( var == "var-indent-handle-couples" )
+ {
+ d->couples = 0;
+ QStringList l = QStringList::split( " ", val );
+ if ( l.contains("parens") ) d->couples |= Parens;
+ if ( l.contains("braces") ) d->couples |= Braces;
+ if ( l.contains("brackets") ) d->couples |= Brackets;
+ }
+ else if ( var == "var-indent-couple-attribute" )
+ {
+ //read a named attribute of the config.
+ KateHlItemDataList items;
+ doc->highlight()->getKateHlItemDataListCopy (0, items);
+
+ for (uint i=0; i<items.count(); i++)
+ {
+ if ( items.at(i)->name.section( ':', 1 ) == val )
+ {
+ d->coupleAttrib = i;
+ break;
+ }
+ }
+ }
+}
+
+int KateVarIndent::coupleBalance ( int line, const QChar &open, const QChar &close ) const
+{
+ int r = 0;
+
+ KateTextLine::Ptr ln = doc->plainKateTextLine( line );
+ if ( ! ln || ! ln->length() ) return 0;
+
+ for ( uint z=0; z < ln->length(); z++ )
+ {
+ QChar c = ln->getChar( z );
+ if ( ln->attribute(z) == d->coupleAttrib )
+ {
+ kdDebug(13030)<<z<<", "<<c<<endl;
+ if (c == open)
+ r++;
+ else if (c == close)
+ r--;
+ }
+ }
+ return r;
+}
+
+bool KateVarIndent::hasRelevantOpening( const KateDocCursor &end ) const
+{
+ KateDocCursor cur = end;
+ int count = 1;
+
+ QChar close = cur.currentChar();
+ QChar opener;
+ if ( close == '}' ) opener = '{';
+ else if ( close = ')' ) opener = '(';
+ else if (close = ']' ) opener = '[';
+ else return false;
+
+ //Move backwards 1 by 1 and find the opening partner
+ while (cur.moveBackward(1))
+ {
+ if (cur.currentAttrib() == d->coupleAttrib)
+ {
+ QChar ch = cur.currentChar();
+ if (ch == opener)
+ count--;
+ else if (ch == close)
+ count++;
+
+ if (count == 0)
+ return true;
+ }
+ }
+
+ return false;
+}
+
+
+//END KateVarIndent
+
+//BEGIN KateScriptIndent
+KateScriptIndent::KateScriptIndent( KateDocument *doc )
+ : KateNormalIndent( doc )
+{
+ m_script=KateFactory::self()->indentScript ("script-indent-c1-test");
+}
+
+KateScriptIndent::~KateScriptIndent()
+{
+}
+
+void KateScriptIndent::processNewline( KateDocCursor &begin, bool needContinue )
+{
+ kdDebug(13030) << "processNewline" << endl;
+ KateView *view = doc->activeView();
+
+ if (view)
+ {
+ QString errorMsg;
+
+ QTime t;
+ t.start();
+ kdDebug(13030)<<"calling m_script.processChar"<<endl;
+ if( !m_script.processNewline( view, begin, needContinue , errorMsg ) )
+ {
+ kdDebug(13030) << "Error in script-indent: " << errorMsg << endl;
+ }
+ kdDebug(13030) << "ScriptIndent::TIME in ms: " << t.elapsed() << endl;
+ }
+}
+
+void KateScriptIndent::processChar( QChar c )
+{
+ kdDebug(13030) << "processChar" << endl;
+ KateView *view = doc->activeView();
+
+ if (view)
+ {
+ QString errorMsg;
+
+ QTime t;
+ t.start();
+ kdDebug(13030)<<"calling m_script.processChar"<<endl;
+ if( !m_script.processChar( view, c , errorMsg ) )
+ {
+ kdDebug(13030) << "Error in script-indent: " << errorMsg << endl;
+ }
+ kdDebug(13030) << "ScriptIndent::TIME in ms: " << t.elapsed() << endl;
+ }
+}
+
+void KateScriptIndent::processLine (KateDocCursor &line)
+{
+ kdDebug(13030) << "processLine" << endl;
+ KateView *view = doc->activeView();
+
+ if (view)
+ {
+ QString errorMsg;
+
+ QTime t;
+ t.start();
+ kdDebug(13030)<<"calling m_script.processLine"<<endl;
+ if( !m_script.processLine( view, line , errorMsg ) )
+ {
+ kdDebug(13030) << "Error in script-indent: " << errorMsg << endl;
+ }
+ kdDebug(13030) << "ScriptIndent::TIME in ms: " << t.elapsed() << endl;
+ }
+}
+//END KateScriptIndent
+
+//BEGIN ScriptIndentConfigPage, THIS IS ONLY A TEST! :)
+#include <qlabel.h>
+ScriptIndentConfigPage::ScriptIndentConfigPage ( QWidget *parent, const char *name )
+ : IndenterConfigPage(parent, name)
+{
+ QLabel* hello = new QLabel("Hello world! Dummy for testing purpose.", this);
+ hello->show();
+}
+
+ScriptIndentConfigPage::~ScriptIndentConfigPage ()
+{
+}
+
+void ScriptIndentConfigPage::apply ()
+{
+ kdDebug(13030) << "ScriptIndentConfigPagE::apply() was called, save config options now!" << endl;
+}
+//END ScriptIndentConfigPage
+
+// kate: space-indent on; indent-width 2; replace-tabs on;
diff --git a/kate/part/kateautoindent.h b/kate/part/kateautoindent.h
new file mode 100644
index 000000000..76ba14ee6
--- /dev/null
+++ b/kate/part/kateautoindent.h
@@ -0,0 +1,581 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2003 Jesse Yurkovich <yurkjes@iit.edu>
+ Copyright (C) 2004 >Anders Lund <anders@alweb.dk> (KateVarIndent class)
+ Copyright (C) 2005 Dominik Haumann <dhdev@gmx.de> (basic support for config page)
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef __KATE_AUTO_INDENT_H__
+#define __KATE_AUTO_INDENT_H__
+
+#include <qobject.h>
+
+#include "katecursor.h"
+#include "kateconfig.h"
+#include "katejscript.h"
+class KateDocument;
+
+/**
+ * This widget will be embedded into a modal dialog when clicking
+ * the "Configure..." button in the indentation config page.
+ * To add a config page for an indenter there are several todos:
+ * - Derive a class from this class. This widget will be embedded into
+ * the config dialog.
+ * - Override the slot @p apply(), which is called when the configuration
+ * needs to be saved.
+ * - Override @p KateAutoIndent::configPage() to return an instance of
+ * this dialog.
+ * - Return @p true in @p KateAutoIndent::hasConfigPage() for the
+ * corresponding indenter id.
+ */
+class IndenterConfigPage : public QWidget
+{
+ Q_OBJECT
+
+ public:
+ /**
+ * Standard constructor
+ * @param parent parent widget
+ * @param name name
+ */
+ IndenterConfigPage ( QWidget *parent=0, const char *name=0 ) : QWidget(parent, name) {}
+ virtual ~IndenterConfigPage () {}
+
+ public slots:
+ /**
+ * Apply the changes. Save options here, use @p kapp->config() and
+ * group [Kate Indenter MyIndenter].
+ */
+ virtual void apply () = 0;
+};
+
+/**
+ * Provides Auto-Indent functionality for katepart.
+ * This baseclass is a real dummy, does nothing beside remembering the document it belongs too,
+ * only to have the object around
+ */
+class KateAutoIndent : public QObject
+{
+ Q_OBJECT
+
+ /**
+ * Static methods to create and list indention modes
+ */
+ public:
+ /**
+ * Create an indenter
+ * @param doc document for the indenter
+ * @param mode indention mode wanted
+ * @return created autoindention object
+ */
+ static KateAutoIndent *createIndenter (KateDocument *doc, uint mode);
+
+ /**
+ * List all possible modes by name
+ * @return list of modes
+ */
+ static QStringList listModes ();
+
+ /**
+ * Return the mode name given the mode
+ * @param mode mode index
+ * @return name for this mode index
+ */
+ static QString modeName (uint mode);
+
+ /**
+ * Return the mode description
+ * @param mode mode index
+ * @return mode index
+ */
+ static QString modeDescription (uint mode);
+
+ /**
+ * Maps name -> index
+ * @param name mode name
+ * @return mode index
+ */
+ static uint modeNumber (const QString &name);
+
+ /**
+ * Config page support
+ * @param mode mode index
+ * @return true, if the indenter @p mode has a configuration page
+ */
+ static bool hasConfigPage (uint mode);
+
+ /**
+ * Support for a config page.
+ * @return config page or 0 if not available.
+ */
+ static IndenterConfigPage* configPage(QWidget *parent, uint mode);
+
+ public:
+ /**
+ * Constructor
+ * @param doc parent document
+ */
+ KateAutoIndent (KateDocument *doc);
+
+ /**
+ * Virtual Destructor for the baseclass
+ */
+ virtual ~KateAutoIndent ();
+
+ public slots:
+ /**
+ * Update indenter's configuration (indention width, attributes etc.)
+ */
+ virtual void updateConfig () {};
+
+ public:
+ /**
+ * does this indenter support processNewLine
+ * @return can you do it?
+ */
+ virtual bool canProcessNewLine () const { return false; }
+
+ /**
+ * Called every time a newline character is inserted in the document.
+ *
+ * @param cur The position to start processing. Contains the new cursor position after the indention.
+ * @param needContinue Used to determine whether to calculate a continue indent or not.
+ */
+ virtual void processNewline (KateDocCursor &cur, bool needContinue) { Q_UNUSED(cur); Q_UNUSED(needContinue); }
+
+ /**
+ * Called every time a character is inserted into the document.
+ * @param c character inserted
+ */
+ virtual void processChar (QChar c) { Q_UNUSED(c); }
+
+ /**
+ * Aligns/indents the given line to the proper indent position.
+ */
+ virtual void processLine (KateDocCursor &/*line*/) { }
+
+ /**
+ * Processes a section of text, indenting each line in between.
+ */
+ virtual void processSection (const KateDocCursor &/*begin*/, const KateDocCursor &/*end*/) { }
+
+ /**
+ * Set to true if an actual implementation of 'processLine' is present.
+ * This is used to prevent a needless Undo action from being created.
+ */
+ virtual bool canProcessLine() const { return false; }
+
+ /**
+ * Mode index of this mode
+ * @return modeNumber
+ */
+ virtual uint modeNumber () const { return KateDocumentConfig::imNone; };
+
+ protected:
+ KateDocument *doc;
+};
+
+/**
+ * This action provides a list of available indenters and gets plugged
+ * into the KateView's KActionCollection.
+ */
+class KateViewIndentationAction : public KActionMenu
+{
+ Q_OBJECT
+
+ public:
+ KateViewIndentationAction(KateDocument *_doc, const QString& text, QObject* parent = 0, const char* name = 0);
+
+ ~KateViewIndentationAction(){;};
+
+ private:
+ KateDocument* doc;
+
+ public slots:
+ void slotAboutToShow();
+
+ private slots:
+ void setMode (int mode);
+};
+
+/**
+ * Provides Auto-Indent functionality for katepart.
+ */
+class KateNormalIndent : public KateAutoIndent
+{
+ Q_OBJECT
+
+public:
+ /**
+ * Constructor
+ * @param doc parent document
+ */
+ KateNormalIndent (KateDocument *doc);
+
+ /**
+ * Virtual Destructor for the baseclass
+ */
+ virtual ~KateNormalIndent ();
+
+public slots:
+ /**
+ * Update indenter's configuration (indention width, attributes etc.)
+ */
+ virtual void updateConfig ();
+
+public:
+ /**
+ * does this indenter support processNewLine
+ * @return can you do it?
+ */
+ virtual bool canProcessNewLine () const { return true; }
+
+ /**
+ * Called every time a newline character is inserted in the document.
+ *
+ * @param cur The position to start processing. Contains the new cursor position after the indention.
+ * @param needContinue Used to determine whether to calculate a continue indent or not.
+ */
+ virtual void processNewline (KateDocCursor &cur, bool needContinue);
+
+ /**
+ * Called every time a character is inserted into the document.
+ * @param c character inserted
+ */
+ virtual void processChar (QChar c) { Q_UNUSED(c); }
+
+ /**
+ * Aligns/indents the given line to the proper indent position.
+ */
+ virtual void processLine (KateDocCursor &/*line*/) { }
+
+ /**
+ * Processes a section of text, indenting each line in between.
+ */
+ virtual void processSection (const KateDocCursor &/*begin*/, const KateDocCursor &/*end*/) { }
+
+ /**
+ * Set to true if an actual implementation of 'processLine' is present.
+ * This is used to prevent a needless Undo action from being created.
+ */
+ virtual bool canProcessLine() const { return false; }
+
+ /**
+ * Mode index of this mode
+ * @return modeNumber
+ */
+ virtual uint modeNumber () const { return KateDocumentConfig::imNormal; };
+
+protected:
+
+ /**
+ * Determines if the characters open and close are balanced between @p begin and @p end
+ * Fills in @p pos with the column position of first opened character if found.
+ *
+ * @param begin Beginning cursor position.
+ * @param end Ending cursor position where the processing will stop.
+ * @param open The open character.
+ * @param close The closing character which should be matched against @p open.
+ * @param pos Contains the position of the first @p open character in the line.
+ * @return True if @p open and @p close have an equal number of occurances between @p begin and @p end. False otherwise.
+ */
+ bool isBalanced (KateDocCursor &begin, const KateDocCursor &end, QChar open, QChar close, uint &pos) const;
+
+ /**
+ * Skip all whitespace starting at @p cur and ending at @p max. Spans lines if @p newline is set.
+ * @p cur is set to the current position afterwards.
+ *
+ * @param cur The current cursor position to start from.
+ * @param max The furthest cursor position that will be used for processing
+ * @param newline Whether we are allowed to span multiple lines when skipping blanks
+ * @return True if @p cur < @p max after processing. False otherwise.
+ */
+ bool skipBlanks (KateDocCursor &cur, KateDocCursor &max, bool newline) const;
+
+ /**
+ * Measures the indention of the current textline marked by cur
+ * @param cur The cursor position to measure the indent to.
+ * @return The length of the indention in characters.
+ */
+ uint measureIndent (KateDocCursor &cur) const;
+
+ /**
+ * Produces a string with the proper indentation characters for its length.
+ *
+ * @param length The length of the indention in characters.
+ * @return A QString representing @p length characters (factoring in tabs and spaces)
+ */
+ QString tabString(uint length) const;
+
+ uint tabWidth; //!< The number of characters simulated for a tab
+ uint indentWidth; //!< The number of characters used when tabs are replaced by spaces
+
+public:
+ // Attributes that we should skip over or otherwise know about
+ uchar commentAttrib;
+ uchar doxyCommentAttrib;
+ uchar regionAttrib;
+ uchar symbolAttrib;
+ uchar alertAttrib;
+ uchar tagAttrib;
+ uchar wordAttrib;
+ uchar keywordAttrib;
+ uchar normalAttrib;
+ uchar extensionAttrib;
+ uchar preprocessorAttrib;
+ uchar stringAttrib;
+ uchar charAttrib;
+
+protected:
+ bool useSpaces; //!< Should we use spaces or tabs to indent
+ bool mixedIndent; //!< Optimize indent by mixing spaces and tabs, ala emacs
+ bool keepProfile; //!< Always try to honor the leading whitespace of lines already in the file
+};
+
+class KateCSmartIndent : public KateNormalIndent
+{
+ Q_OBJECT
+
+ public:
+ KateCSmartIndent (KateDocument *doc);
+ ~KateCSmartIndent ();
+
+ virtual void processNewline (KateDocCursor &cur, bool needContinue);
+ virtual void processChar (QChar c);
+
+ virtual void processLine (KateDocCursor &line);
+ virtual void processSection (const KateDocCursor &begin, const KateDocCursor &end);
+
+ virtual bool canProcessLine() const { return true; }
+
+ virtual uint modeNumber () const { return KateDocumentConfig::imCStyle; };
+
+ private:
+ uint calcIndent (KateDocCursor &begin, bool needContinue);
+ uint calcContinue (KateDocCursor &begin, KateDocCursor &end);
+ uint findOpeningBrace (KateDocCursor &start);
+ uint findOpeningParen (KateDocCursor &start);
+ uint findOpeningComment (KateDocCursor &start);
+ bool firstOpeningBrace (KateDocCursor &start);
+ bool handleDoxygen (KateDocCursor &begin);
+
+ bool allowSemi;
+ bool processingBlock;
+};
+
+class KatePythonIndent : public KateNormalIndent
+{
+ Q_OBJECT
+
+ public:
+ KatePythonIndent (KateDocument *doc);
+ ~KatePythonIndent ();
+
+ virtual void processNewline (KateDocCursor &cur, bool needContinue);
+
+ virtual uint modeNumber () const { return KateDocumentConfig::imPythonStyle; };
+
+ private:
+ int calcExtra (int &prevBlock, int &pos, KateDocCursor &end);
+ void traverseString( const QChar &stringChar, KateDocCursor &cur, KateDocCursor &end );
+
+ static QRegExp endWithColon;
+ static QRegExp stopStmt;
+ static QRegExp blockBegin;
+};
+
+class KateXmlIndent : public KateNormalIndent
+{
+ Q_OBJECT
+
+ public:
+ KateXmlIndent (KateDocument *doc);
+ ~KateXmlIndent ();
+
+ virtual uint modeNumber () const { return KateDocumentConfig::imXmlStyle; }
+ virtual void processNewline (KateDocCursor &cur, bool needContinue);
+ virtual void processChar (QChar c);
+ virtual void processLine (KateDocCursor &line);
+ virtual bool canProcessLine() const { return true; }
+ virtual void processSection (const KateDocCursor &begin, const KateDocCursor &end);
+
+ private:
+ // sets the indentation of a single line based on previous line
+ // (returns indentation width)
+ uint processLine (uint line);
+
+ // gets information about a line
+ void getLineInfo (uint line, uint &prevIndent, int &numTags,
+ uint &attrCol, bool &unclosedTag);
+
+ // useful regular expressions
+ static const QRegExp startsWithCloseTag;
+ static const QRegExp unclosedDoctype;
+};
+
+class KateCSAndSIndent : public KateNormalIndent
+{
+ Q_OBJECT
+
+ public:
+ KateCSAndSIndent (KateDocument *doc);
+ ~KateCSAndSIndent ();
+
+ virtual void processNewline (KateDocCursor &begin, bool needContinue);
+ virtual void processChar (QChar c);
+
+ virtual void processLine (KateDocCursor &line);
+ virtual void processSection (const KateDocCursor &begin, const KateDocCursor &end);
+
+ virtual bool canProcessLine() const { return true; }
+
+ virtual uint modeNumber () const { return KateDocumentConfig::imCSAndS; };
+
+ private:
+ void updateIndentString();
+
+ bool inForStatement( int line );
+ int lastNonCommentChar( const KateDocCursor &line );
+ bool startsWithLabel( int line );
+ bool inStatement( const KateDocCursor &begin );
+ QString continuationIndent( const KateDocCursor &begin );
+
+ QString calcIndent (const KateDocCursor &begin);
+ QString calcIndentAfterKeyword(const KateDocCursor &indentCursor, const KateDocCursor &keywordCursor, int keywordPos, bool blockKeyword);
+ QString calcIndentInBracket(const KateDocCursor &indentCursor, const KateDocCursor &bracketCursor, int bracketPos);
+ QString calcIndentInBrace(const KateDocCursor &indentCursor, const KateDocCursor &braceCursor, int bracePos);
+
+ bool handleDoxygen (KateDocCursor &begin);
+ QString findOpeningCommentIndentation (const KateDocCursor &start);
+
+ QString indentString;
+};
+
+/**
+ * This indenter uses document variables to determine when to add/remove indents.
+ *
+ * It attempts to get the following variables from the document:
+ * - var-indent-indent-after: A rerular expression which will cause a line to
+ * be indented by one unit, if the first non-whitespace-only line above matches.
+ * - var-indent-indent: A regular expression, which will cause a matching line
+ * to be indented by one unit.
+ * - var-indent-unindent: A regular expression which will cause the line to be
+ * unindented by one unit if matching.
+ * - var-indent-triggerchars: a list of characters that should cause the
+ * indentiou to be recalculated immediately when typed.
+ * - var-indent-handle-couples: a list of paren sets to handle. Any combination
+ * of 'parens' 'braces' and 'brackets'. Each set type is handled
+ * the following way: If there are unmatched opening instances on the above line,
+ * one indent unit is added, if there are unmatched closing instances on the
+ * current line, one indent unit is removed.
+ * - var-indent-couple-attribute: When looking for unmatched couple openings/closings,
+ * only characters with this attribute is considered. The value must be the
+ * attribute name from the syntax xml file, for example "Symbol". If it's not
+ * specified, attribute 0 is used (usually 'Normal Text').
+ *
+ * The idea is to provide a somewhat intelligent indentation for perl, php,
+ * bash, scheme and in general formats with humble indentation needs.
+ */
+class KateVarIndent : public KateNormalIndent
+{
+ Q_OBJECT
+
+ public:
+ /**
+ * Purely for readability, couples we know and love
+ */
+ enum pairs {
+ Parens=1,
+ Braces=2,
+ Brackets=4,
+ AngleBrackets=8
+ };
+
+ KateVarIndent( KateDocument *doc );
+ virtual ~KateVarIndent();
+
+ virtual void processNewline (KateDocCursor &cur, bool needContinue);
+ virtual void processChar (QChar c);
+
+ virtual void processLine (KateDocCursor &line);
+ virtual void processSection (const KateDocCursor &begin, const KateDocCursor &end);
+
+ virtual bool canProcessLine() const { return true; }
+
+ virtual uint modeNumber () const { return KateDocumentConfig::imVarIndent; };
+
+ private slots:
+ void slotVariableChanged(const QString&, const QString&);
+
+ private:
+ /**
+ * Check if coupled characters are in balance within one line.
+ * @param line the line to check
+ * @param open the opening character
+ * @param close the closing character
+ * @param attrib the attribute the characters must have, defaults to
+ * KateAutoIndent::symbolAttrib
+ */
+ int coupleBalance( int line, const QChar &open, const QChar &close ) const;
+
+ /**
+ * @return true if there is a matching opening with the correct attribute
+ * @param end a cursor pointing to the closing character
+ */
+ bool hasRelevantOpening( const KateDocCursor &end ) const;
+
+ class KateVarIndentPrivate *d;
+};
+
+class KateScriptIndent : public KateNormalIndent
+{
+ Q_OBJECT
+
+ public:
+ KateScriptIndent( KateDocument *doc );
+ ~KateScriptIndent();
+
+ virtual void processNewline( KateDocCursor &cur, bool needContinue );
+ virtual void processChar( QChar c );
+
+ virtual void processLine (KateDocCursor &line);
+// virtual void processSection (const KateDocCursor &begin, const KateDocCursor &end);
+
+ virtual bool canProcessLine() const { return true; }
+
+ virtual uint modeNumber () const { return KateDocumentConfig::imScriptIndent; };
+ private:
+ KateIndentScript m_script;
+};
+
+class ScriptIndentConfigPage : public IndenterConfigPage
+{
+ Q_OBJECT
+
+ public:
+ ScriptIndentConfigPage ( QWidget *parent=0, const char *name=0 );
+ virtual ~ScriptIndentConfigPage ();
+
+ public slots:
+ /**
+ * Apply changes.
+ */
+ virtual void apply ();
+};
+
+#endif
+
+// kate: space-indent on; indent-width 2; replace-tabs on;
diff --git a/kate/part/katebookmarks.cpp b/kate/part/katebookmarks.cpp
new file mode 100644
index 000000000..f92fb4282
--- /dev/null
+++ b/kate/part/katebookmarks.cpp
@@ -0,0 +1,287 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2002, 2003, 2004 Anders Lund <anders.lund@lund.tdcadsl.dk>
+ Copyright (C) 2002 John Firebaugh <jfirebaugh@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "katebookmarks.h"
+#include "katebookmarks.moc"
+
+#include "katedocument.h"
+#include "kateview.h"
+
+#include <klocale.h>
+#include <kaction.h>
+#include <kpopupmenu.h>
+#include <kstringhandler.h>
+#include <kxmlguiclient.h>
+#include <kxmlguifactory.h>
+
+#include <qregexp.h>
+#include <qmemarray.h>
+#include <qevent.h>
+
+/**
+ Utility: selection sort
+ sort a QMemArray<uint> in ascending order.
+ max it the largest (zerobased) index to sort.
+ To sort the entire array: ssort( *array, array.size() -1 );
+ This is only efficient if ran only once.
+*/
+static void ssort( QMemArray<uint> &a, int max )
+{
+ uint tmp, j, maxpos;
+ for ( uint h = max; h >= 1; h-- )
+ {
+ maxpos = 0;
+ for ( j = 0; j <= h; j++ )
+ maxpos = a[j] > a[maxpos] ? j : maxpos;
+ tmp = a[maxpos];
+ a[maxpos] = a[h];
+ a[h] = tmp;
+ }
+}
+
+// TODO add a insort() or bubble_sort - more efficient for aboutToShow() ?
+
+KateBookmarks::KateBookmarks( KateView* view, Sorting sort )
+ : QObject( view, "kate bookmarks" )
+ , m_view( view )
+ , m_sorting( sort )
+{
+ connect (view->getDoc(), SIGNAL(marksChanged()), this, SLOT(marksChanged()));
+ _tries=0;
+ m_bookmarksMenu = 0L;
+}
+
+KateBookmarks::~KateBookmarks()
+{
+}
+
+void KateBookmarks::createActions( KActionCollection* ac )
+{
+ m_bookmarkToggle = new KToggleAction(
+ i18n("Set &Bookmark"), "bookmark", CTRL+Key_B,
+ this, SLOT(toggleBookmark()),
+ ac, "bookmarks_toggle" );
+ m_bookmarkToggle->setWhatsThis(i18n("If a line has no bookmark then add one, otherwise remove it."));
+ m_bookmarkToggle->setCheckedState( i18n("Clear &Bookmark") );
+
+ m_bookmarkClear = new KAction(
+ i18n("Clear &All Bookmarks"), 0,
+ this, SLOT(clearBookmarks()),
+ ac, "bookmarks_clear");
+ m_bookmarkClear->setWhatsThis(i18n("Remove all bookmarks of the current document."));
+
+ m_goNext = new KAction(
+ i18n("Next Bookmark"), "next", ALT + Key_PageDown,
+ this, SLOT(goNext()),
+ ac, "bookmarks_next");
+ m_goNext->setWhatsThis(i18n("Go to the next bookmark."));
+
+ m_goPrevious = new KAction(
+ i18n("Previous Bookmark"), "previous", ALT + Key_PageUp,
+ this, SLOT(goPrevious()),
+ ac, "bookmarks_previous");
+ m_goPrevious->setWhatsThis(i18n("Go to the previous bookmark."));
+
+ m_bookmarksMenu = (new KActionMenu(i18n("&Bookmarks"), ac, "bookmarks"))->popupMenu();
+
+ //connect the aboutToShow() and aboutToHide() signals with
+ //the bookmarkMenuAboutToShow() and bookmarkMenuAboutToHide() slots
+ connect( m_bookmarksMenu, SIGNAL(aboutToShow()), this, SLOT(bookmarkMenuAboutToShow()));
+ connect( m_bookmarksMenu, SIGNAL(aboutToHide()), this, SLOT(bookmarkMenuAboutToHide()) );
+
+ marksChanged ();
+ bookmarkMenuAboutToHide();
+
+ connect( m_view, SIGNAL( gotFocus( Kate::View * ) ), this, SLOT( slotViewGotFocus( Kate::View * ) ) );
+ connect( m_view, SIGNAL( lostFocus( Kate::View * ) ), this, SLOT( slotViewLostFocus( Kate::View * ) ) );
+}
+
+void KateBookmarks::toggleBookmark ()
+{
+ uint mark = m_view->getDoc()->mark( m_view->cursorLine() );
+ if( mark & KTextEditor::MarkInterface::markType01 )
+ m_view->getDoc()->removeMark( m_view->cursorLine(),
+ KTextEditor::MarkInterface::markType01 );
+ else
+ m_view->getDoc()->addMark( m_view->cursorLine(),
+ KTextEditor::MarkInterface::markType01 );
+}
+
+void KateBookmarks::clearBookmarks ()
+{
+
+ QPtrList<KTextEditor::Mark> m = m_view->getDoc()->marks();
+ for (uint i=0; i < m.count(); i++)
+ m_view->getDoc()->removeMark( m.at(i)->line, KTextEditor::MarkInterface::markType01 );
+
+ // just to be sure ;)
+ marksChanged ();
+}
+
+void KateBookmarks::slotViewGotFocus( Kate::View *v )
+{
+ if ( v == (Kate::View*)m_view )
+ bookmarkMenuAboutToHide();
+}
+
+void KateBookmarks::slotViewLostFocus( Kate::View *v )
+{
+ if ( v == (Kate::View*)m_view )
+ m_bookmarksMenu->clear();
+}
+
+void KateBookmarks::insertBookmarks( QPopupMenu& menu )
+{
+ uint line = m_view->cursorLine();
+ const QRegExp re("&(?!&)");
+ int idx( -1 );
+ int old_menu_count = menu.count();
+ KTextEditor::Mark *next = 0;
+ KTextEditor::Mark *prev = 0;
+
+ QPtrList<KTextEditor::Mark> m = m_view->getDoc()->marks();
+ QMemArray<uint> sortArray( m.count() );
+ QPtrListIterator<KTextEditor::Mark> it( m );
+
+ if ( it.count() > 0 )
+ menu.insertSeparator();
+
+ for( int i = 0; *it; ++it, ++i )
+ {
+ if( (*it)->type & KTextEditor::MarkInterface::markType01 )
+ {
+ QString bText = KStringHandler::rEmSqueeze
+ ( m_view->getDoc()->textLine( (*it)->line ),
+ menu.fontMetrics(), 32 );
+ bText.replace(re, "&&"); // kill undesired accellerators!
+ bText.replace('\t', ' '); // kill tabs, as they are interpreted as shortcuts
+
+ if ( m_sorting == Position )
+ {
+ sortArray[i] = (*it)->line;
+ ssort( sortArray, i );
+ idx = sortArray.find( (*it)->line ) + 3;
+ }
+
+ menu.insertItem(
+ QString("%1 - \"%2\"").arg( (*it)->line+1 ).arg( bText ),
+ m_view, SLOT(gotoLineNumber(int)), 0, (*it)->line, idx );
+
+ if ( (*it)->line < line )
+ {
+ if ( ! prev || prev->line < (*it)->line )
+ prev = (*it);
+ }
+
+ else if ( (*it)->line > line )
+ {
+ if ( ! next || next->line > (*it)->line )
+ next = (*it);
+ }
+ }
+ }
+
+ idx = ++old_menu_count;
+ if ( next )
+ {
+ m_goNext->setText( i18n("&Next: %1 - \"%2\"").arg( next->line + 1 )
+ .arg( KStringHandler::rsqueeze( m_view->getDoc()->textLine( next->line ), 24 ) ) );
+ m_goNext->plug( &menu, idx );
+ idx++;
+ }
+ if ( prev )
+ {
+ m_goPrevious->setText( i18n("&Previous: %1 - \"%2\"").arg(prev->line + 1 )
+ .arg( KStringHandler::rsqueeze( m_view->getDoc()->textLine( prev->line ), 24 ) ) );
+ m_goPrevious->plug( &menu, idx );
+ idx++;
+ }
+ if ( next || prev )
+ menu.insertSeparator( idx );
+
+}
+
+void KateBookmarks::bookmarkMenuAboutToShow()
+{
+
+ QPtrList<KTextEditor::Mark> m = m_view->getDoc()->marks();
+
+ m_bookmarksMenu->clear();
+ m_bookmarkToggle->setChecked( m_view->getDoc()->mark( m_view->cursorLine() )
+ & KTextEditor::MarkInterface::markType01 );
+ m_bookmarkToggle->plug( m_bookmarksMenu );
+ m_bookmarkClear->plug( m_bookmarksMenu );
+
+
+ insertBookmarks(*m_bookmarksMenu);
+}
+
+/*
+ Make sure next/prev actions are plugged, and have a clean text
+*/
+void KateBookmarks::bookmarkMenuAboutToHide()
+{
+ m_bookmarkToggle->plug( m_bookmarksMenu );
+ m_bookmarkClear->plug( m_bookmarksMenu );
+ m_goNext->setText( i18n("Next Bookmark") );
+ m_goNext->plug( m_bookmarksMenu );
+ m_goPrevious->setText( i18n("Previous Bookmark") );
+ m_goPrevious->plug( m_bookmarksMenu );
+}
+
+void KateBookmarks::goNext()
+{
+ QPtrList<KTextEditor::Mark> m = m_view->getDoc()->marks();
+ if (m.isEmpty())
+ return;
+
+ uint line = m_view->cursorLine();
+ int found = -1;
+
+ for (uint z=0; z < m.count(); z++)
+ if ( (m.at(z)->line > line) && ((found == -1) || (uint(found) > m.at(z)->line)) )
+ found = m.at(z)->line;
+
+ if (found != -1)
+ m_view->gotoLineNumber ( found );
+}
+
+void KateBookmarks::goPrevious()
+{
+ QPtrList<KTextEditor::Mark> m = m_view->getDoc()->marks();
+ if (m.isEmpty())
+ return;
+
+ uint line = m_view->cursorLine();
+ int found = -1;
+
+ for (uint z=0; z < m.count(); z++)
+ if ((m.at(z)->line < line) && ((found == -1) || (uint(found) < m.at(z)->line)))
+ found = m.at(z)->line;
+
+ if (found != -1)
+ m_view->gotoLineNumber ( found );
+}
+
+void KateBookmarks::marksChanged ()
+{
+ m_bookmarkClear->setEnabled( !m_view->getDoc()->marks().isEmpty() );
+}
+
+// kate: space-indent on; indent-width 2; replace-tabs on;
diff --git a/kate/part/katebookmarks.h b/kate/part/katebookmarks.h
new file mode 100644
index 000000000..0d72c0ccc
--- /dev/null
+++ b/kate/part/katebookmarks.h
@@ -0,0 +1,86 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2002, 2003 Anders Lund <anders.lund@lund.tdcadsl.dk>
+ Copyright (C) 2002 John Firebaugh <jfirebaugh@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef __KATE_BOOKMARKS_H__
+#define __KATE_BOOKMARKS_H__
+
+#include <qobject.h>
+#include <qptrlist.h>
+
+class KateView;
+
+namespace KTextEditor { class Mark; }
+
+namespace Kate { class View; }
+
+class KAction;
+class KToggleAction;
+class KActionCollection;
+class QPopupMenu;
+class QMenuData;
+
+class KateBookmarks : public QObject
+{
+ Q_OBJECT
+
+ public:
+ enum Sorting { Position, Creation };
+ KateBookmarks( KateView* parent, Sorting sort=Position );
+ virtual ~KateBookmarks();
+
+ void createActions( KActionCollection* );
+
+ KateBookmarks::Sorting sorting() { return m_sorting; };
+ void setSorting( Sorting s ) { m_sorting = s; };
+
+ protected:
+ void insertBookmarks( QPopupMenu& menu);
+
+ private slots:
+ void toggleBookmark();
+ void clearBookmarks();
+
+ void slotViewGotFocus( Kate::View * );
+ void slotViewLostFocus( Kate::View * );
+
+ void bookmarkMenuAboutToShow();
+ void bookmarkMenuAboutToHide();
+
+ void goNext();
+ void goPrevious();
+
+ void marksChanged ();
+
+ private:
+ KateView* m_view;
+ KToggleAction* m_bookmarkToggle;
+ KAction* m_bookmarkClear;
+ KAction* m_goNext;
+ KAction* m_goPrevious;
+
+ Sorting m_sorting;
+ QPopupMenu* m_bookmarksMenu;
+
+ uint _tries;
+};
+
+#endif
+
+// kate: space-indent on; indent-width 2; replace-tabs on;
+// vim: noet ts=2
diff --git a/kate/part/katebuffer.cpp b/kate/part/katebuffer.cpp
new file mode 100644
index 000000000..06c919f96
--- /dev/null
+++ b/kate/part/katebuffer.cpp
@@ -0,0 +1,1660 @@
+/* This file is part of the KDE libraries
+ Copyright (c) 2000 Waldo Bastian <bastian@kde.org>
+ Copyright (C) 2002-2004 Christoph Cullmann <cullmann@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+
+#include "katebuffer.h"
+#include "katebuffer.moc"
+
+#include "katedocument.h"
+#include "katehighlight.h"
+#include "kateconfig.h"
+#include "katefactory.h"
+#include "kateautoindent.h"
+
+#include <kdebug.h>
+#include <kglobal.h>
+#include <kcharsets.h>
+
+#include <qpopupmenu.h>
+#include <qfile.h>
+#include <qtextstream.h>
+#include <qtimer.h>
+#include <qtextcodec.h>
+#include <qcstring.h>
+#include <qdatetime.h>
+
+/**
+ * loader block size, load 256 kb at once per default
+ * if file size is smaller, fall back to file size
+ */
+static const Q_ULONG KATE_FILE_LOADER_BS = 256 * 1024;
+
+/**
+ * KATE_AVG_BLOCK_SIZE is in characters !
+ * (internaly we calc with approx 80 chars per line !)
+ * block will max contain around BLOCK_SIZE chars or
+ * BLOCK_LINES lines (after load, later that won't be tracked)
+ */
+static const Q_ULONG KATE_AVG_BLOCK_SIZE = 2048 * 80;
+static const Q_ULONG KATE_MAX_BLOCK_LINES = 2048;
+
+/**
+ * hl will look at the next KATE_HL_LOOKAHEAD lines
+ * or until the current block ends if a line is requested
+ * will avoid to run doHighlight too often
+ */
+static const uint KATE_HL_LOOKAHEAD = 64;
+
+/**
+ * KATE_MAX_BLOCKS_LOADED should be at least 4, as some
+ * methodes will cause heavy trashing, if not at least the
+ * latest 2-3 used blocks are alive
+ */
+uint KateBuffer::m_maxLoadedBlocks = 16;
+
+/**
+ * Initial value for m_maxDynamicContexts
+ */
+static const uint KATE_MAX_DYNAMIC_CONTEXTS = 512;
+
+void KateBuffer::setMaxLoadedBlocks (uint count)
+{
+ m_maxLoadedBlocks = kMax (4U, count);
+}
+
+class KateFileLoader
+{
+ public:
+ KateFileLoader (const QString &filename, QTextCodec *codec, bool removeTrailingSpaces)
+ : m_file (filename)
+ , m_buffer (kMin (m_file.size(), KATE_FILE_LOADER_BS))
+ , m_codec (codec)
+ , m_decoder (m_codec->makeDecoder())
+ , m_position (0)
+ , m_lastLineStart (0)
+ , m_eof (false) // default to not eof
+ , lastWasEndOfLine (true) // at start of file, we had a virtual newline
+ , lastWasR (false) // we have not found a \r as last char
+ , m_eol (-1) // no eol type detected atm
+ , m_twoByteEncoding (QString(codec->name()) == "ISO-10646-UCS-2")
+ , m_binary (false)
+ , m_removeTrailingSpaces (removeTrailingSpaces)
+ {
+ kdDebug (13020) << "OPEN USES ENCODING: " << m_codec->name() << endl;
+ }
+
+ ~KateFileLoader ()
+ {
+ delete m_decoder;
+ }
+
+ /**
+ * open file, read first chunk of data, detect eol
+ */
+ bool open ()
+ {
+ if (m_file.open (IO_ReadOnly))
+ {
+ int c = m_file.readBlock (m_buffer.data(), m_buffer.size());
+
+ if (c > 0)
+ {
+ // fix utf16 LE, stolen from khtml ;)
+ if ((c >= 2) && (m_codec->mibEnum() == 1000) && (m_buffer[1] == 0x00))
+ {
+ // utf16LE, we need to put the decoder in LE mode
+ char reverseUtf16[3] = {0xFF, 0xFE, 0x00};
+ m_decoder->toUnicode(reverseUtf16, 2);
+ }
+
+ processNull (c);
+ m_text = m_decoder->toUnicode (m_buffer, c);
+ }
+
+ m_eof = (c == -1) || (c == 0) || (m_text.length() == 0) || m_file.atEnd();
+
+ for (uint i=0; i < m_text.length(); i++)
+ {
+ if (m_text[i] == '\n')
+ {
+ m_eol = KateDocumentConfig::eolUnix;
+ break;
+ }
+ else if ((m_text[i] == '\r'))
+ {
+ if (((i+1) < m_text.length()) && (m_text[i+1] == '\n'))
+ {
+ m_eol = KateDocumentConfig::eolDos;
+ break;
+ }
+ else
+ {
+ m_eol = KateDocumentConfig::eolMac;
+ break;
+ }
+ }
+ }
+
+ return true;
+ }
+
+ return false;
+ }
+
+ // no new lines around ?
+ inline bool eof () const { return m_eof && !lastWasEndOfLine && (m_lastLineStart == m_text.length()); }
+
+ // eol mode ? autodetected on open(), -1 for no eol found in the first block!
+ inline int eol () const { return m_eol; }
+
+ // binary ?
+ inline bool binary () const { return m_binary; }
+
+ // should spaces be ignored at end of line?
+ inline bool removeTrailingSpaces () const { return m_removeTrailingSpaces; }
+
+ // internal unicode data array
+ inline const QChar *unicode () const { return m_text.unicode(); }
+
+ // read a line, return length + offset in unicode data
+ void readLine (uint &offset, uint &length)
+ {
+ length = 0;
+ offset = 0;
+
+ while (m_position <= m_text.length())
+ {
+ if (m_position == m_text.length())
+ {
+ // try to load more text if something is around
+ if (!m_eof)
+ {
+ int c = m_file.readBlock (m_buffer.data(), m_buffer.size());
+
+ uint readString = 0;
+ if (c > 0)
+ {
+ processNull (c);
+
+ QString str (m_decoder->toUnicode (m_buffer, c));
+ readString = str.length();
+
+ m_text = m_text.mid (m_lastLineStart, m_position-m_lastLineStart)
+ + str;
+ }
+ else
+ m_text = m_text.mid (m_lastLineStart, m_position-m_lastLineStart);
+
+ // is file completly read ?
+ m_eof = (c == -1) || (c == 0) || (readString == 0) || m_file.atEnd();
+
+ // recalc current pos and last pos
+ m_position -= m_lastLineStart;
+ m_lastLineStart = 0;
+ }
+
+ // oh oh, end of file, escape !
+ if (m_eof && (m_position == m_text.length()))
+ {
+ lastWasEndOfLine = false;
+
+ // line data
+ offset = m_lastLineStart;
+ length = m_position-m_lastLineStart;
+
+ m_lastLineStart = m_position;
+
+ return;
+ }
+ }
+
+ if (m_text[m_position] == '\n')
+ {
+ lastWasEndOfLine = true;
+
+ if (lastWasR)
+ {
+ m_lastLineStart++;
+ lastWasR = false;
+ }
+ else
+ {
+ // line data
+ offset = m_lastLineStart;
+ length = m_position-m_lastLineStart;
+
+ m_lastLineStart = m_position+1;
+ m_position++;
+
+ return;
+ }
+ }
+ else if (m_text[m_position] == '\r')
+ {
+ lastWasEndOfLine = true;
+ lastWasR = true;
+
+ // line data
+ offset = m_lastLineStart;
+ length = m_position-m_lastLineStart;
+
+ m_lastLineStart = m_position+1;
+ m_position++;
+
+ return;
+ }
+ else
+ {
+ lastWasEndOfLine = false;
+ lastWasR = false;
+ }
+
+ m_position++;
+ }
+ }
+
+ // this nice methode will kill all 0 bytes (or double bytes)
+ // and remember if this was a binary or not ;)
+ void processNull (uint length)
+ {
+ if (m_twoByteEncoding)
+ {
+ for (uint i=1; i < length; i+=2)
+ {
+ if ((m_buffer[i] == 0) && (m_buffer[i-1] == 0))
+ {
+ m_binary = true;
+ m_buffer[i] = ' ';
+ }
+ }
+ }
+ else
+ {
+ for (uint i=0; i < length; i++)
+ {
+ if (m_buffer[i] == 0)
+ {
+ m_binary = true;
+ m_buffer[i] = ' ';
+ }
+ }
+ }
+ }
+
+ private:
+ QFile m_file;
+ QByteArray m_buffer;
+ QTextCodec *m_codec;
+ QTextDecoder *m_decoder;
+ QString m_text;
+ uint m_position;
+ uint m_lastLineStart;
+ bool m_eof;
+ bool lastWasEndOfLine;
+ bool lastWasR;
+ int m_eol;
+ bool m_twoByteEncoding;
+ bool m_binary;
+ bool m_removeTrailingSpaces;
+};
+
+/**
+ * Create an empty buffer. (with one block with one empty line)
+ */
+KateBuffer::KateBuffer(KateDocument *doc)
+ : QObject (doc),
+ editSessionNumber (0),
+ editIsRunning (false),
+ editTagLineStart (0xffffffff),
+ editTagLineEnd (0),
+ editTagLineFrom (false),
+ editChangesDone (false),
+ m_doc (doc),
+ m_lines (0),
+ m_lastInSyncBlock (0),
+ m_lastFoundBlock (0),
+ m_cacheReadError(false),
+ m_cacheWriteError(false),
+ m_loadingBorked (false),
+ m_binary (false),
+ m_highlight (0),
+ m_regionTree (this),
+ m_tabWidth (8),
+ m_lineHighlightedMax (0),
+ m_lineHighlighted (0),
+ m_maxDynamicContexts (KATE_MAX_DYNAMIC_CONTEXTS)
+{
+ clear();
+}
+
+/**
+ * Cleanup on destruction
+ */
+KateBuffer::~KateBuffer()
+{
+ // DELETE ALL BLOCKS, will free mem
+ for (uint i=0; i < m_blocks.size(); i++)
+ delete m_blocks[i];
+
+ // release HL
+ if (m_highlight)
+ m_highlight->release();
+}
+
+void KateBuffer::editStart ()
+{
+ editSessionNumber++;
+
+ if (editSessionNumber > 1)
+ return;
+
+ editIsRunning = true;
+
+ editTagLineStart = 0xffffffff;
+ editTagLineEnd = 0;
+ editTagLineFrom = false;
+
+ editChangesDone = false;
+}
+
+void KateBuffer::editEnd ()
+{
+ if (editSessionNumber == 0)
+ return;
+
+ editSessionNumber--;
+
+ if (editSessionNumber > 0)
+ return;
+
+ if (editChangesDone)
+ {
+ // hl update !!!
+ if ( m_highlight && !m_highlight->noHighlighting()
+ && (editTagLineStart <= editTagLineEnd)
+ && (editTagLineEnd <= m_lineHighlighted))
+ {
+ // look one line too far, needed for linecontinue stuff
+ editTagLineEnd++;
+
+ // look one line before, needed nearly 100% only for indentation based folding !
+ if (editTagLineStart > 0)
+ editTagLineStart--;
+
+ KateBufBlock *buf2 = 0;
+ bool needContinue = false;
+ while ((buf2 = findBlock(editTagLineStart)))
+ {
+ needContinue = doHighlight (buf2,
+ (editTagLineStart > buf2->startLine()) ? editTagLineStart : buf2->startLine(),
+ (editTagLineEnd > buf2->endLine()) ? buf2->endLine() : editTagLineEnd,
+ true);
+
+ editTagLineStart = (editTagLineEnd > buf2->endLine()) ? buf2->endLine() : editTagLineEnd;
+
+ if ((editTagLineStart >= m_lines) || (editTagLineStart >= editTagLineEnd))
+ break;
+ }
+
+ if (needContinue)
+ m_lineHighlighted = editTagLineStart;
+
+ if (editTagLineStart > m_lineHighlightedMax)
+ m_lineHighlightedMax = editTagLineStart;
+ }
+ else if (editTagLineStart < m_lineHighlightedMax)
+ m_lineHighlightedMax = editTagLineStart;
+ }
+
+ editIsRunning = false;
+}
+
+void KateBuffer::clear()
+{
+ m_regionTree.clear();
+
+ // cleanup the blocks
+ for (uint i=0; i < m_blocks.size(); i++)
+ delete m_blocks[i];
+
+ m_blocks.clear ();
+
+ // create a bufblock with one line, we need that, only in openFile we won't have that
+ KateBufBlock *block = new KateBufBlock(this, 0, 0);
+ m_blocks.append (block);
+
+ // reset the state
+ m_lines = block->lines();
+ m_lastInSyncBlock = 0;
+ m_lastFoundBlock = 0;
+ m_cacheWriteError = false;
+ m_cacheReadError = false;
+ m_loadingBorked = false;
+ m_binary = false;
+
+ m_lineHighlightedMax = 0;
+ m_lineHighlighted = 0;
+}
+
+bool KateBuffer::openFile (const QString &m_file)
+{
+ KateFileLoader file (m_file, m_doc->config()->codec(), m_doc->configFlags() & KateDocument::cfRemoveSpaces);
+
+ bool ok = false;
+ struct stat sbuf;
+ if (stat(QFile::encodeName(m_file), &sbuf) == 0)
+ {
+ if (S_ISREG(sbuf.st_mode) && file.open())
+ ok = true;
+ }
+
+ if (!ok)
+ {
+ clear();
+ return false; // Error
+ }
+
+ // set eol mode, if a eol char was found in the first 256kb block and we allow this at all!
+ if (m_doc->config()->allowEolDetection() && (file.eol() != -1))
+ m_doc->config()->setEol (file.eol());
+
+ // flush current content
+ clear ();
+
+ // cleanup the blocks
+ for (uint i=0; i < m_blocks.size(); i++)
+ delete m_blocks[i];
+
+ m_blocks.clear ();
+
+ // do the real work
+ KateBufBlock *block = 0;
+ m_lines = 0;
+ while (!file.eof() && !m_cacheWriteError)
+ {
+ block = new KateBufBlock (this, block, 0, &file);
+
+ m_lines = block->endLine ();
+
+ if (m_cacheWriteError || (block->lines() == 0))
+ {
+ delete block;
+ break;
+ }
+ else
+ m_blocks.append (block);
+ }
+
+ // we had a cache write error, this load is really borked !
+ if (m_cacheWriteError)
+ m_loadingBorked = true;
+
+ if (m_blocks.isEmpty() || (m_lines == 0))
+ {
+ // file was really empty, clean the buffers + emit the line changed
+ // loadingBorked will be false for such files, not matter what happened
+ // before
+ clear ();
+ }
+ else
+ {
+ // fix region tree
+ m_regionTree.fixRoot (m_lines);
+ }
+
+ // if we have no hl or the "None" hl activated, whole file is correct highlighted
+ // after loading, which wonder ;)
+ if (!m_highlight || m_highlight->noHighlighting())
+ {
+ m_lineHighlighted = m_lines;
+ m_lineHighlightedMax = m_lines;
+ }
+
+ // binary?
+ m_binary = file.binary ();
+
+ kdDebug (13020) << "LOADING DONE" << endl;
+
+ return !m_loadingBorked;
+}
+
+bool KateBuffer::canEncode ()
+{
+ QTextCodec *codec = m_doc->config()->codec();
+
+ kdDebug(13020) << "ENC NAME: " << codec->name() << endl;
+
+ // hardcode some unicode encodings which can encode all chars
+ if ((QString(codec->name()) == "UTF-8") || (QString(codec->name()) == "ISO-10646-UCS-2"))
+ return true;
+
+ for (uint i=0; i < m_lines; i++)
+ {
+ if (!codec->canEncode (plainLine(i)->string()))
+ {
+ kdDebug(13020) << "STRING LINE: " << plainLine(i)->string() << endl;
+ kdDebug(13020) << "ENC WORKING: FALSE" << endl;
+
+ return false;
+ }
+ }
+
+ return true;
+}
+
+bool KateBuffer::saveFile (const QString &m_file)
+{
+ QFile file (m_file);
+ QTextStream stream (&file);
+
+ if ( !file.open( IO_WriteOnly ) )
+ {
+ return false; // Error
+ }
+
+ QTextCodec *codec = m_doc->config()->codec();
+
+ // disable Unicode headers
+ stream.setEncoding(QTextStream::RawUnicode);
+
+ // this line sets the mapper to the correct codec
+ stream.setCodec(codec);
+
+ // our loved eol string ;)
+ QString eol = m_doc->config()->eolString ();
+
+ // should we strip spaces?
+ bool removeTrailingSpaces = m_doc->configFlags() & KateDocument::cfRemoveSpaces;
+
+ // just dump the lines out ;)
+ for (uint i=0; i < m_lines; i++)
+ {
+ KateTextLine::Ptr textline = plainLine(i);
+
+ // strip spaces
+ if (removeTrailingSpaces)
+ {
+ int lastChar = textline->lastChar();
+
+ if (lastChar > -1)
+ {
+ stream << QConstString (textline->text(), lastChar+1).string();
+ }
+ }
+ else // simple, dump the line
+ stream << textline->string();
+
+ if ((i+1) < m_lines)
+ stream << eol;
+ }
+
+ file.close ();
+
+ m_loadingBorked = false;
+
+ return (file.status() == IO_Ok);
+}
+
+KateTextLine::Ptr KateBuffer::line_internal (KateBufBlock *buf, uint i)
+{
+ // update hl until this line + max KATE_HL_LOOKAHEAD
+ KateBufBlock *buf2 = 0;
+ while ((i >= m_lineHighlighted) && (buf2 = findBlock(m_lineHighlighted)))
+ {
+ uint end = kMin(i + KATE_HL_LOOKAHEAD, buf2->endLine());
+
+ doHighlight ( buf2,
+ kMax(m_lineHighlighted, buf2->startLine()),
+ end,
+ false );
+
+ m_lineHighlighted = end;
+ }
+
+ // update hl max
+ if (m_lineHighlighted > m_lineHighlightedMax)
+ m_lineHighlightedMax = m_lineHighlighted;
+
+ return buf->line (i - buf->startLine());
+}
+
+KateBufBlock *KateBuffer::findBlock_internal (uint i, uint *index)
+{
+ uint lastLine = m_blocks[m_lastInSyncBlock]->endLine ();
+
+ if (lastLine > i) // we are in a allready known area !
+ {
+ while (true)
+ {
+ KateBufBlock *buf = m_blocks[m_lastFoundBlock];
+
+ if ( (buf->startLine() <= i)
+ && (buf->endLine() > i) )
+ {
+ if (index)
+ (*index) = m_lastFoundBlock;
+
+ return m_blocks[m_lastFoundBlock];
+ }
+
+ if (i < buf->startLine())
+ m_lastFoundBlock--;
+ else
+ m_lastFoundBlock++;
+ }
+ }
+ else // we need first to resync the startLines !
+ {
+ if ((m_lastInSyncBlock+1) < m_blocks.size())
+ m_lastInSyncBlock++;
+ else
+ return 0;
+
+ for (; m_lastInSyncBlock < m_blocks.size(); m_lastInSyncBlock++)
+ {
+ // get next block
+ KateBufBlock *buf = m_blocks[m_lastInSyncBlock];
+
+ // sync startLine !
+ buf->setStartLine (lastLine);
+
+ // is it allready the searched block ?
+ if ((i >= lastLine) && (i < buf->endLine()))
+ {
+ // remember this block as last found !
+ m_lastFoundBlock = m_lastInSyncBlock;
+
+ if (index)
+ (*index) = m_lastFoundBlock;
+
+ return buf;
+ }
+
+ // increase lastLine with blocklinecount
+ lastLine += buf->lines ();
+ }
+ }
+
+ // no block found !
+ // index will not be set to any useful value in this case !
+ return 0;
+}
+
+void KateBuffer::changeLine(uint i)
+{
+ KateBufBlock *buf = findBlock(i);
+
+ if (!buf)
+ return;
+
+ // mark this block dirty
+ buf->markDirty ();
+
+ // mark buffer changed
+ editChangesDone = true;
+
+ // tag this line as changed
+ if (i < editTagLineStart)
+ editTagLineStart = i;
+
+ if (i > editTagLineEnd)
+ editTagLineEnd = i;
+}
+
+void KateBuffer::insertLine(uint i, KateTextLine::Ptr line)
+{
+ uint index = 0;
+ KateBufBlock *buf;
+ if (i == m_lines)
+ buf = findBlock(i-1, &index);
+ else
+ buf = findBlock(i, &index);
+
+ if (!buf)
+ return;
+
+ buf->insertLine(i - buf->startLine(), line);
+
+ if (m_lineHighlightedMax > i)
+ m_lineHighlightedMax++;
+
+ if (m_lineHighlighted > i)
+ m_lineHighlighted++;
+
+ m_lines++;
+
+ // last sync block adjust
+ if (m_lastInSyncBlock > index)
+ m_lastInSyncBlock = index;
+
+ // last found
+ if (m_lastInSyncBlock < m_lastFoundBlock)
+ m_lastFoundBlock = m_lastInSyncBlock;
+
+ // mark buffer changed
+ editChangesDone = true;
+
+ // tag this line as inserted
+ if (i < editTagLineStart)
+ editTagLineStart = i;
+
+ if (i <= editTagLineEnd)
+ editTagLineEnd++;
+
+ if (i > editTagLineEnd)
+ editTagLineEnd = i;
+
+ // line inserted
+ editTagLineFrom = true;
+
+ m_regionTree.lineHasBeenInserted (i);
+}
+
+void KateBuffer::removeLine(uint i)
+{
+ uint index = 0;
+ KateBufBlock *buf = findBlock(i, &index);
+
+ if (!buf)
+ return;
+
+ buf->removeLine(i - buf->startLine());
+
+ if (m_lineHighlightedMax > i)
+ m_lineHighlightedMax--;
+
+ if (m_lineHighlighted > i)
+ m_lineHighlighted--;
+
+ m_lines--;
+
+ // trash away a empty block
+ if (buf->lines() == 0)
+ {
+ // we need to change which block is last in sync
+ if (m_lastInSyncBlock >= index)
+ {
+ m_lastInSyncBlock = index;
+
+ if (buf->next())
+ {
+ if (buf->prev())
+ buf->next()->setStartLine (buf->prev()->endLine());
+ else
+ buf->next()->setStartLine (0);
+ }
+ }
+
+ // cu block !
+ delete buf;
+ m_blocks.erase (m_blocks.begin()+index);
+
+ // make sure we don't keep a pointer to the deleted block
+ if( m_lastInSyncBlock >= index )
+ m_lastInSyncBlock = index - 1;
+ }
+ else
+ {
+ // last sync block adjust
+ if (m_lastInSyncBlock > index)
+ m_lastInSyncBlock = index;
+ }
+
+ // last found
+ if (m_lastInSyncBlock < m_lastFoundBlock)
+ m_lastFoundBlock = m_lastInSyncBlock;
+
+ // mark buffer changed
+ editChangesDone = true;
+
+ // tag this line as removed
+ if (i < editTagLineStart)
+ editTagLineStart = i;
+
+ if (i < editTagLineEnd)
+ editTagLineEnd--;
+
+ if (i > editTagLineEnd)
+ editTagLineEnd = i;
+
+ // line removed
+ editTagLineFrom = true;
+
+ m_regionTree.lineHasBeenRemoved (i);
+}
+
+void KateBuffer::setTabWidth (uint w)
+{
+ if ((m_tabWidth != w) && (m_tabWidth > 0))
+ {
+ m_tabWidth = w;
+
+ if (m_highlight && m_highlight->foldingIndentationSensitive())
+ invalidateHighlighting();
+ }
+}
+
+void KateBuffer::setHighlight(uint hlMode)
+{
+ KateHighlighting *h = KateHlManager::self()->getHl(hlMode);
+
+ // aha, hl will change
+ if (h != m_highlight)
+ {
+ bool invalidate = !h->noHighlighting();
+
+ if (m_highlight)
+ {
+ m_highlight->release();
+ invalidate = true;
+ }
+
+ h->use();
+
+ // Clear code folding tree (see bug #124102)
+ m_regionTree.clear();
+ m_regionTree.fixRoot(m_lines);
+
+ // try to set indentation
+ if (!h->indentation().isEmpty())
+ m_doc->config()->setIndentationMode (KateAutoIndent::modeNumber(h->indentation()));
+
+ m_highlight = h;
+
+ if (invalidate)
+ invalidateHighlighting();
+
+ // inform the document that the hl was really changed
+ // needed to update attributes and more ;)
+ m_doc->bufferHlChanged ();
+ }
+}
+
+void KateBuffer::invalidateHighlighting()
+{
+ m_lineHighlightedMax = 0;
+ m_lineHighlighted = 0;
+}
+
+
+void KateBuffer::updatePreviousNotEmptyLine(KateBufBlock *blk,uint current_line,bool addindent,uint deindent)
+{
+ KateTextLine::Ptr textLine;
+ do {
+ if (current_line>0) current_line--;
+ else
+ {
+ uint line=blk->startLine()+current_line;
+ if (line==0) return;
+ line--;
+ blk=findBlock(line);
+ if (!blk) {
+ kdDebug(13020)<<"updatePreviousNotEmptyLine: block not found, this must not happen"<<endl;
+ return;
+ }
+ current_line=line-blk->startLine();
+ }
+ textLine = blk->line(current_line);
+ } while (textLine->firstChar()==-1);
+ kdDebug(13020)<<"updatePreviousNotEmptyLine: updating line:"<<(blk->startLine()+current_line)<<endl;
+ QMemArray<uint> foldingList=textLine->foldingListArray();
+ while ( (foldingList.size()>0) && ( abs(foldingList[foldingList.size()-2])==1)) {
+ foldingList.resize(foldingList.size()-2,QGArray::SpeedOptim);
+ }
+ addIndentBasedFoldingInformation(foldingList,addindent,deindent);
+ textLine->setFoldingList(foldingList);
+ bool retVal_folding = false;
+ m_regionTree.updateLine (current_line + blk->startLine(), &foldingList, &retVal_folding, true,false);
+ emit tagLines (blk->startLine()+current_line, blk->startLine()+current_line);
+}
+
+void KateBuffer::addIndentBasedFoldingInformation(QMemArray<uint> &foldingList,bool addindent,uint deindent)
+{
+ if (addindent) {
+ //kdDebug(13020)<<"adding indent for line :"<<current_line + buf->startLine()<<" textLine->noIndentBasedFoldingAtStart"<<textLine->noIndentBasedFoldingAtStart()<<endl;
+ kdDebug(13020)<<"adding ident"<<endl;
+ foldingList.resize (foldingList.size() + 2, QGArray::SpeedOptim);
+ foldingList[foldingList.size()-2] = 1;
+ foldingList[foldingList.size()-1] = 0;
+ }
+ kdDebug(13020)<<"DEINDENT: "<<deindent<<endl;
+ if (deindent > 0)
+ {
+ foldingList.resize (foldingList.size() + (deindent*2), QGArray::SpeedOptim);
+
+ for (uint z= foldingList.size()-(deindent*2); z < foldingList.size(); z=z+2)
+ {
+ foldingList[z] = -1;
+ foldingList[z+1] = 0;
+ }
+ }
+}
+
+bool KateBuffer::doHighlight (KateBufBlock *buf, uint startLine, uint endLine, bool invalidate)
+{
+ // no hl around, no stuff to do
+ if (!m_highlight)
+ return false;
+
+ /*if (m_highlight->foldingIndentationSensitive())
+ {
+ startLine=0;
+ endLine=50;
+ }*/
+
+ // we tried to start in a line behind this buf block !
+ if (startLine >= (buf->startLine()+buf->lines()))
+ return false;
+
+ //QTime t;
+ //t.start();
+ //kdDebug (13020) << "HIGHLIGHTED START --- NEED HL, LINESTART: " << startLine << " LINEEND: " << endLine << endl;
+ //kdDebug (13020) << "HL UNTIL LINE: " << m_lineHighlighted << " MAX: " << m_lineHighlightedMax << endl;
+ //kdDebug (13020) << "HL DYN COUNT: " << KateHlManager::self()->countDynamicCtxs() << " MAX: " << m_maxDynamicContexts << endl;
+
+ // see if there are too many dynamic contexts; if yes, invalidate HL of all documents
+ if (KateHlManager::self()->countDynamicCtxs() >= m_maxDynamicContexts)
+ {
+ {
+ if (KateHlManager::self()->resetDynamicCtxs())
+ {
+ kdDebug (13020) << "HL invalidated - too many dynamic contexts ( >= " << m_maxDynamicContexts << ")" << endl;
+
+ // avoid recursive invalidation
+ KateHlManager::self()->setForceNoDCReset(true);
+
+ for (KateDocument *doc = KateFactory::self()->documents()->first(); doc; doc = KateFactory::self()->documents()->next())
+ doc->makeAttribs();
+
+ // doHighlight *shall* do his work. After invalidation, some highlight has
+ // been recalculated, but *maybe not* until endLine ! So we shall force it manually...
+ KateBufBlock *buf = 0;
+ while ((endLine > m_lineHighlighted) && (buf = findBlock(m_lineHighlighted)))
+ {
+ uint end = kMin(endLine, buf->endLine());
+
+ doHighlight ( buf,
+ kMax(m_lineHighlighted, buf->startLine()),
+ end,
+ false );
+
+ m_lineHighlighted = end;
+ }
+
+ KateHlManager::self()->setForceNoDCReset(false);
+
+ return false;
+ }
+ else
+ {
+ m_maxDynamicContexts *= 2;
+ kdDebug (13020) << "New dynamic contexts limit: " << m_maxDynamicContexts << endl;
+ }
+ }
+ }
+
+ // get the previous line, if we start at the beginning of this block
+ // take the last line of the previous block
+ KateTextLine::Ptr prevLine = 0;
+
+ if ((startLine == buf->startLine()) && buf->prev() && (buf->prev()->lines() > 0))
+ prevLine = buf->prev()->line (buf->prev()->lines() - 1);
+ else if ((startLine > buf->startLine()) && (startLine <= buf->endLine()))
+ prevLine = buf->line(startLine - buf->startLine() - 1);
+ else
+ prevLine = new KateTextLine ();
+
+ // does we need to emit a signal for the folding changes ?
+ bool codeFoldingUpdate = false;
+
+ // here we are atm, start at start line in the block
+ uint current_line = startLine - buf->startLine();
+
+ // do we need to continue
+ bool stillcontinue=false;
+ bool indentContinueWhitespace=false;
+ bool indentContinueNextWhitespace=false;
+ // loop over the lines of the block, from startline to endline or end of block
+ // if stillcontinue forces us to do so
+ while ( (current_line < buf->lines())
+ && (stillcontinue || ((current_line + buf->startLine()) <= endLine)) )
+ {
+ // current line
+ KateTextLine::Ptr textLine = buf->line(current_line);
+
+ QMemArray<uint> foldingList;
+ bool ctxChanged = false;
+
+ m_highlight->doHighlight (prevLine, textLine, &foldingList, &ctxChanged);
+
+ //
+ // indentation sensitive folding
+ //
+ bool indentChanged = false;
+ if (m_highlight->foldingIndentationSensitive())
+ {
+ // get the indentation array of the previous line to start with !
+ QMemArray<unsigned short> indentDepth;
+ indentDepth.duplicate (prevLine->indentationDepthArray());
+
+ // current indentation of this line
+ uint iDepth = textLine->indentDepth(m_tabWidth);
+ if ((current_line+buf->startLine())==0)
+ {
+ indentDepth.resize (1, QGArray::SpeedOptim);
+ indentDepth[0] = iDepth;
+ }
+
+ textLine->setNoIndentBasedFoldingAtStart(prevLine->noIndentBasedFolding());
+ // this line is empty, beside spaces, or has indentaion based folding disabled, use indentation depth of the previous line !
+ kdDebug(13020)<<"current_line:"<<current_line + buf->startLine()<<" textLine->noIndentBasedFoldingAtStart"<<textLine->noIndentBasedFoldingAtStart()<<endl;
+ if ( (textLine->firstChar() == -1) || textLine->noIndentBasedFoldingAtStart())
+ {
+ // do this to get skipped empty lines indent right, which was given in the indenation array
+ if (!prevLine->indentationDepthArray().isEmpty())
+ {
+ iDepth = (prevLine->indentationDepthArray())[prevLine->indentationDepthArray().size()-1];
+ kdDebug(13020)<<"reusing old depth as current"<<endl;
+ }
+ else
+ {
+ iDepth = prevLine->indentDepth(m_tabWidth);
+ kdDebug(13020)<<"creating indentdepth for previous line"<<endl;
+ }
+ }
+
+ kdDebug(13020)<<"iDepth:"<<iDepth<<endl;
+
+ // query the next line indentation, if we are at the end of the block
+ // use the first line of the next buf block
+ uint nextLineIndentation = 0;
+ bool nextLineIndentationValid=true;
+ indentContinueNextWhitespace=false;
+ if ((current_line+1) < buf->lines())
+ {
+ if (buf->line(current_line+1)->firstChar() == -1)
+ {
+ nextLineIndentation = iDepth;
+ indentContinueNextWhitespace=true;
+ }
+ else
+ nextLineIndentation = buf->line(current_line+1)->indentDepth(m_tabWidth);
+ }
+ else
+ {
+ KateBufBlock *blk = buf->next();
+
+ if (blk && (blk->lines() > 0))
+ {
+ if (blk->line (0)->firstChar() == -1)
+ {
+ nextLineIndentation = iDepth;
+ indentContinueNextWhitespace=true;
+ }
+ else
+ nextLineIndentation = blk->line (0)->indentDepth(m_tabWidth);
+ }
+ else nextLineIndentationValid=false;
+ }
+
+ if (!textLine->noIndentBasedFoldingAtStart()) {
+
+ if ((iDepth > 0) && (indentDepth.isEmpty() || (indentDepth[indentDepth.size()-1] < iDepth)))
+ {
+ kdDebug(13020)<<"adding depth to \"stack\":"<<iDepth<<endl;
+ indentDepth.resize (indentDepth.size()+1, QGArray::SpeedOptim);
+ indentDepth[indentDepth.size()-1] = iDepth;
+ } else {
+ if (!indentDepth.isEmpty())
+ {
+ for (int z=indentDepth.size()-1; z > -1; z--)
+ if (indentDepth[z]>iDepth)
+ indentDepth.resize(z, QGArray::SpeedOptim);
+ if ((iDepth > 0) && (indentDepth.isEmpty() || (indentDepth[indentDepth.size()-1] < iDepth)))
+ {
+ kdDebug(13020)<<"adding depth to \"stack\":"<<iDepth<<endl;
+ indentDepth.resize (indentDepth.size()+1, QGArray::SpeedOptim);
+ indentDepth[indentDepth.size()-1] = iDepth;
+ if (prevLine->firstChar()==-1) {
+
+ }
+ }
+ }
+ }
+ }
+
+ if (!textLine->noIndentBasedFolding())
+ {
+ if (nextLineIndentationValid)
+ {
+ //if (textLine->firstChar()!=-1)
+ {
+ kdDebug(13020)<<"nextLineIndentation:"<<nextLineIndentation<<endl;
+ bool addindent=false;
+ uint deindent=0;
+ if (!indentDepth.isEmpty())
+ kdDebug()<<"indentDepth[indentDepth.size()-1]:"<<indentDepth[indentDepth.size()-1]<<endl;
+ if ((nextLineIndentation>0) && ( indentDepth.isEmpty() || (indentDepth[indentDepth.size()-1]<nextLineIndentation)))
+ {
+ kdDebug(13020)<<"addindent==true"<<endl;
+ addindent=true;
+ } else {
+ if ((!indentDepth.isEmpty()) && (indentDepth[indentDepth.size()-1]>nextLineIndentation))
+ {
+ kdDebug(13020)<<"...."<<endl;
+ for (int z=indentDepth.size()-1; z > -1; z--)
+ {
+ kdDebug(13020)<<indentDepth[z]<<" "<<nextLineIndentation<<endl;
+ if (indentDepth[z]>nextLineIndentation)
+ deindent++;
+ }
+ }
+ }
+/* }
+ if (textLine->noIndentBasedFolding()) kdDebug(13020)<<"=============================indentation based folding disabled======================"<<endl;
+ if (!textLine->noIndentBasedFolding()) {*/
+ if ((textLine->firstChar()==-1)) {
+ updatePreviousNotEmptyLine(buf,current_line,addindent,deindent);
+ codeFoldingUpdate=true;
+ }
+ else
+ {
+ addIndentBasedFoldingInformation(foldingList,addindent,deindent);
+ }
+ }
+ }
+ }
+ indentChanged = !(indentDepth == textLine->indentationDepthArray());
+
+ // assign the new array to the textline !
+ if (indentChanged)
+ textLine->setIndentationDepth (indentDepth);
+
+ indentContinueWhitespace=textLine->firstChar()==-1;
+ }
+ bool foldingColChanged=false;
+ bool foldingChanged = false; //!(foldingList == textLine->foldingListArray());
+ if (foldingList.size()!=textLine->foldingListArray().size()) {
+ foldingChanged=true;
+ } else {
+ QMemArray<uint>::ConstIterator it=foldingList.begin();
+ QMemArray<uint>::ConstIterator it1=textLine->foldingListArray();
+ bool markerType=true;
+ for(;it!=foldingList.end();++it,++it1) {
+ if (markerType) {
+ if ( ((*it)!=(*it1))) {
+ foldingChanged=true;
+ foldingColChanged=false;
+ break;
+ }
+ } else {
+ if ((*it)!=(*it1)) {
+ foldingColChanged=true;
+ }
+ }
+ markerType=!markerType;
+ }
+ }
+
+ if (foldingChanged || foldingColChanged) {
+ textLine->setFoldingList(foldingList);
+ if (foldingChanged==false){
+ textLine->setFoldingColumnsOutdated(textLine->foldingColumnsOutdated() | foldingColChanged);
+ } else textLine->setFoldingColumnsOutdated(false);
+ }
+ bool retVal_folding = false;
+ //perhaps make en enums out of the change flags
+ m_regionTree.updateLine (current_line + buf->startLine(), &foldingList, &retVal_folding, foldingChanged,foldingColChanged);
+
+ codeFoldingUpdate = codeFoldingUpdate | retVal_folding;
+
+ // need we to continue ?
+ stillcontinue = ctxChanged || indentChanged || indentContinueWhitespace || indentContinueNextWhitespace;
+
+ // move around the lines
+ prevLine = textLine;
+
+ // increment line
+ current_line++;
+ }
+
+ buf->markDirty ();
+
+ // tag the changed lines !
+ if (invalidate)
+ emit tagLines (startLine, current_line + buf->startLine());
+
+ // emit that we have changed the folding
+ if (codeFoldingUpdate)
+ emit codeFoldingUpdated();
+
+ //kdDebug (13020) << "HIGHLIGHTED END --- NEED HL, LINESTART: " << startLine << " LINEEND: " << endLine << endl;
+ //kdDebug (13020) << "HL UNTIL LINE: " << m_lineHighlighted << " MAX: " << m_lineHighlightedMax << endl;
+ //kdDebug (13020) << "HL DYN COUNT: " << KateHlManager::self()->countDynamicCtxs() << " MAX: " << m_maxDynamicContexts << endl;
+ //kdDebug (13020) << "TIME TAKEN: " << t.elapsed() << endl;
+
+ // if we are at the last line of the block + we still need to continue
+ // return the need of that !
+ return stillcontinue && ((current_line+1) == buf->lines());
+}
+
+void KateBuffer::codeFoldingColumnUpdate(unsigned int lineNr) {
+ KateTextLine::Ptr line=plainLine(lineNr);
+ if (!line) return;
+ if (line->foldingColumnsOutdated()) {
+ line->setFoldingColumnsOutdated(false);
+ bool tmp;
+ QMemArray<uint> folding=line->foldingListArray();
+ m_regionTree.updateLine(lineNr,&folding,&tmp,true,false);
+ }
+}
+
+//BEGIN KateBufBlock
+
+KateBufBlock::KateBufBlock ( KateBuffer *parent, KateBufBlock *prev, KateBufBlock *next,
+ KateFileLoader *stream )
+: m_state (KateBufBlock::stateDirty),
+ m_startLine (0),
+ m_lines (0),
+ m_vmblock (0),
+ m_vmblockSize (0),
+ m_parent (parent),
+ m_prev (prev),
+ m_next (next),
+ list (0),
+ listPrev (0),
+ listNext (0)
+{
+ // init startline + the next pointers of the neighbour blocks
+ if (m_prev)
+ {
+ m_startLine = m_prev->endLine ();
+ m_prev->m_next = this;
+ }
+
+ if (m_next)
+ m_next->m_prev = this;
+
+ // we have a stream, use it to fill the block !
+ // this can lead to 0 line blocks which are invalid !
+ if (stream)
+ {
+ // this we lead to either dirty or swapped state
+ fillBlock (stream);
+ }
+ else // init the block if no stream given !
+ {
+ // fill in one empty line !
+ KateTextLine::Ptr textLine = new KateTextLine ();
+ m_stringList.push_back (textLine);
+ m_lines++;
+
+ // if we have allready enough blocks around, swap one
+ if (m_parent->m_loadedBlocks.count() >= KateBuffer::maxLoadedBlocks())
+ m_parent->m_loadedBlocks.first()->swapOut();
+
+ // we are a new nearly empty dirty block
+ m_state = KateBufBlock::stateDirty;
+ m_parent->m_loadedBlocks.append (this);
+ }
+}
+
+KateBufBlock::~KateBufBlock ()
+{
+ // sync prev/next pointers
+ if (m_prev)
+ m_prev->m_next = m_next;
+
+ if (m_next)
+ m_next->m_prev = m_prev;
+
+ // if we have some swapped data allocated, free it now or never
+ if (m_vmblock)
+ KateFactory::self()->vm()->free(m_vmblock);
+
+ // remove me from the list I belong
+ KateBufBlockList::remove (this);
+}
+
+void KateBufBlock::fillBlock (KateFileLoader *stream)
+{
+ // is allready too much stuff around in mem ?
+ bool swap = m_parent->m_loadedBlocks.count() >= KateBuffer::maxLoadedBlocks();
+
+ QByteArray rawData;
+
+ // calcs the approx size for KATE_AVG_BLOCK_SIZE chars !
+ if (swap)
+ rawData.resize ((KATE_AVG_BLOCK_SIZE * sizeof(QChar)) + ((KATE_AVG_BLOCK_SIZE/80) * 8));
+
+ char *buf = rawData.data ();
+ uint size = 0;
+ uint blockSize = 0;
+ while (!stream->eof() && (blockSize < KATE_AVG_BLOCK_SIZE) && (m_lines < KATE_MAX_BLOCK_LINES))
+ {
+ uint offset = 0, length = 0;
+ stream->readLine(offset, length);
+ const QChar *unicodeData = stream->unicode () + offset;
+
+ // strip spaces at end of line
+ if ( stream->removeTrailingSpaces() )
+ {
+ while (length > 0)
+ {
+ if (unicodeData[length-1].isSpace())
+ --length;
+ else
+ break;
+ }
+ }
+
+ blockSize += length;
+
+ if (swap)
+ {
+ // create the swapped data on the fly, no need to waste time
+ // via going over the textline classes and dump them !
+ char attr = KateTextLine::flagNoOtherData;
+ uint pos = size;
+
+ // calc new size
+ size = size + 1 + sizeof(uint) + (sizeof(QChar)*length);
+
+ if (size > rawData.size ())
+ {
+ rawData.resize (size);
+ buf = rawData.data ();
+ }
+
+ memcpy(buf+pos, (char *) &attr, 1);
+ pos += 1;
+
+ memcpy(buf+pos, (char *) &length, sizeof(uint));
+ pos += sizeof(uint);
+
+ memcpy(buf+pos, (char *) unicodeData, sizeof(QChar)*length);
+ pos += sizeof(QChar)*length;
+ }
+ else
+ {
+ KateTextLine::Ptr textLine = new KateTextLine ();
+ textLine->insertText (0, length, unicodeData);
+ m_stringList.push_back (textLine);
+ }
+
+ m_lines++;
+ }
+
+ if (swap)
+ {
+ m_vmblock = KateFactory::self()->vm()->allocate(size);
+ m_vmblockSize = size;
+
+ if (!rawData.isEmpty())
+ {
+ if (!KateFactory::self()->vm()->copyBlock(m_vmblock, rawData.data(), 0, size))
+ {
+ if (m_vmblock)
+ KateFactory::self()->vm()->free(m_vmblock);
+
+ m_vmblock = 0;
+ m_vmblockSize = 0;
+
+ m_parent->m_cacheWriteError = true;
+ }
+ }
+
+ // fine, we are swapped !
+ m_state = KateBufBlock::stateSwapped;
+ }
+ else
+ {
+ // we are a new dirty block without any swap data
+ m_state = KateBufBlock::stateDirty;
+ m_parent->m_loadedBlocks.append (this);
+ }
+
+ kdDebug (13020) << "A BLOCK LOADED WITH LINES: " << m_lines << endl;
+}
+
+KateTextLine::Ptr KateBufBlock::line(uint i)
+{
+ // take care that the string list is around !!!
+ if (m_state == KateBufBlock::stateSwapped)
+ swapIn ();
+
+ // LRU
+ if (!m_parent->m_loadedBlocks.isLast(this))
+ m_parent->m_loadedBlocks.append (this);
+
+ return m_stringList[i];
+}
+
+void KateBufBlock::insertLine(uint i, KateTextLine::Ptr line)
+{
+ // take care that the string list is around !!!
+ if (m_state == KateBufBlock::stateSwapped)
+ swapIn ();
+
+ m_stringList.insert (m_stringList.begin()+i, line);
+ m_lines++;
+
+ markDirty ();
+}
+
+void KateBufBlock::removeLine(uint i)
+{
+ // take care that the string list is around !!!
+ if (m_state == KateBufBlock::stateSwapped)
+ swapIn ();
+
+ m_stringList.erase (m_stringList.begin()+i);
+ m_lines--;
+
+ markDirty ();
+}
+
+void KateBufBlock::markDirty ()
+{
+ if (m_state != KateBufBlock::stateSwapped)
+ {
+ // LRU
+ if (!m_parent->m_loadedBlocks.isLast(this))
+ m_parent->m_loadedBlocks.append (this);
+
+ if (m_state == KateBufBlock::stateClean)
+ {
+ // if we have some swapped data allocated which is dirty, free it now
+ if (m_vmblock)
+ KateFactory::self()->vm()->free(m_vmblock);
+
+ m_vmblock = 0;
+ m_vmblockSize = 0;
+
+ // we are dirty
+ m_state = KateBufBlock::stateDirty;
+ }
+ }
+}
+
+void KateBufBlock::swapIn ()
+{
+ if (m_state != KateBufBlock::stateSwapped)
+ return;
+
+ QByteArray rawData (m_vmblockSize);
+
+ // what to do if that fails ?
+ if (!KateFactory::self()->vm()->copyBlock(rawData.data(), m_vmblock, 0, rawData.size()))
+ m_parent->m_cacheReadError = true;
+
+ // reserve mem, keep realloc away on push_back
+ m_stringList.reserve (m_lines);
+
+ char *buf = rawData.data();
+ for (uint i=0; i < m_lines; i++)
+ {
+ KateTextLine::Ptr textLine = new KateTextLine ();
+ buf = textLine->restore (buf);
+ m_stringList.push_back (textLine);
+ }
+
+ // if we have allready enough blocks around, swap one
+ if (m_parent->m_loadedBlocks.count() >= KateBuffer::maxLoadedBlocks())
+ m_parent->m_loadedBlocks.first()->swapOut();
+
+ // fine, we are now clean again, save state + append to clean list
+ m_state = KateBufBlock::stateClean;
+ m_parent->m_loadedBlocks.append (this);
+}
+
+void KateBufBlock::swapOut ()
+{
+ if (m_state == KateBufBlock::stateSwapped)
+ return;
+
+ if (m_state == KateBufBlock::stateDirty)
+ {
+ bool haveHl = m_parent->m_highlight && !m_parent->m_highlight->noHighlighting();
+
+ // Calculate size.
+ uint size = 0;
+ for (uint i=0; i < m_lines; i++)
+ size += m_stringList[i]->dumpSize (haveHl);
+
+ QByteArray rawData (size);
+ char *buf = rawData.data();
+
+ // Dump textlines
+ for (uint i=0; i < m_lines; i++)
+ buf = m_stringList[i]->dump (buf, haveHl);
+
+ m_vmblock = KateFactory::self()->vm()->allocate(rawData.size());
+ m_vmblockSize = rawData.size();
+
+ if (!rawData.isEmpty())
+ {
+ if (!KateFactory::self()->vm()->copyBlock(m_vmblock, rawData.data(), 0, rawData.size()))
+ {
+ if (m_vmblock)
+ KateFactory::self()->vm()->free(m_vmblock);
+
+ m_vmblock = 0;
+ m_vmblockSize = 0;
+
+ m_parent->m_cacheWriteError = true;
+
+ return;
+ }
+ }
+ }
+
+ m_stringList.clear();
+
+ // we are now swapped out, set state + remove us out of the lists !
+ m_state = KateBufBlock::stateSwapped;
+ KateBufBlockList::remove (this);
+}
+
+//END KateBufBlock
+
+//BEGIN KateBufBlockList
+
+KateBufBlockList::KateBufBlockList ()
+ : m_count (0),
+ m_first (0),
+ m_last (0)
+{
+}
+
+void KateBufBlockList::append (KateBufBlock *buf)
+{
+ if (buf->list)
+ buf->list->removeInternal (buf);
+
+ m_count++;
+
+ // append a element
+ if (m_last)
+ {
+ m_last->listNext = buf;
+
+ buf->listPrev = m_last;
+ buf->listNext = 0;
+
+ m_last = buf;
+
+ buf->list = this;
+
+ return;
+ }
+
+ // insert the first element
+ m_last = buf;
+ m_first = buf;
+
+ buf->listPrev = 0;
+ buf->listNext = 0;
+
+ buf->list = this;
+}
+
+void KateBufBlockList::removeInternal (KateBufBlock *buf)
+{
+ if (buf->list != this)
+ return;
+
+ m_count--;
+
+ if ((buf == m_first) && (buf == m_last))
+ {
+ // last element removed !
+ m_first = 0;
+ m_last = 0;
+ }
+ else if (buf == m_first)
+ {
+ // first element removed
+ m_first = buf->listNext;
+ m_first->listPrev = 0;
+ }
+ else if (buf == m_last)
+ {
+ // last element removed
+ m_last = buf->listPrev;
+ m_last->listNext = 0;
+ }
+ else
+ {
+ buf->listPrev->listNext = buf->listNext;
+ buf->listNext->listPrev = buf->listPrev;
+ }
+
+ buf->listPrev = 0;
+ buf->listNext = 0;
+
+ buf->list = 0;
+}
+
+//END KateBufBlockList
+
+// kate: space-indent on; indent-width 2; replace-tabs on;
diff --git a/kate/part/katebuffer.h b/kate/part/katebuffer.h
new file mode 100644
index 000000000..6b2d48ead
--- /dev/null
+++ b/kate/part/katebuffer.h
@@ -0,0 +1,709 @@
+/* This file is part of the KDE libraries
+ Copyright (c) 2000 Waldo Bastian <bastian@kde.org>
+ Copyright (C) 2002-2004 Christoph Cullmann <cullmann@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef __KATE_BUFFER_H__
+#define __KATE_BUFFER_H__
+
+#include "katetextline.h"
+#include "katecodefoldinghelpers.h"
+
+#include <kvmallocator.h>
+
+#include <qptrlist.h>
+#include <qobject.h>
+#include <qtimer.h>
+#include <qvaluevector.h>
+
+class KateLineInfo;
+class KateDocument;
+class KateHighlighting;
+class KateBufBlockList;
+class KateBuffer;
+class KateFileLoader;
+
+class QTextCodec;
+
+/**
+ * The KateBufBlock class contains an amount of data representing
+ * a certain number of lines.
+ *
+ * @author Waldo Bastian <bastian@kde.org>
+ * @author Christoph Cullmann <cullmann@kde.org>
+ */
+class KateBufBlock
+{
+ friend class KateBufBlockList;
+
+ public:
+ /**
+ * Create an empty block. (empty == ONE line)
+ * @param parent buffer the block belongs to
+ * @param prev previous bufblock in the list
+ * @param next next bufblock in the list
+ * @param stream stream to load the content from, if any given
+ */
+ KateBufBlock ( KateBuffer *parent, KateBufBlock *prev = 0, KateBufBlock *next = 0,
+ KateFileLoader *stream = 0 );
+
+ /**
+ * destroy this block and take care of freeing all mem
+ */
+ ~KateBufBlock ();
+
+ private:
+ /**
+ * fill the block with the lines from the given stream
+ * @param stream stream to load data from
+ */
+ void fillBlock (KateFileLoader *stream);
+
+ public:
+ /**
+ * state flags
+ */
+ enum State
+ {
+ stateSwapped = 0,
+ stateClean = 1,
+ stateDirty = 2
+ };
+
+ /**
+ * returns the current state of this block
+ * @return state
+ */
+ State state () const { return m_state; }
+
+ public:
+ /**
+ * return line @p i
+ * The first line of this block is line 0.
+ * if you modifiy this line, please mark the block as dirty
+ * @param i line to return
+ * @return line pointer
+ */
+ KateTextLine::Ptr line(uint i);
+
+ /**
+ * insert @p line in front of line @p i
+ * marks the block dirty
+ * @param i where to insert
+ * @param line line pointer
+ */
+ void insertLine(uint i, KateTextLine::Ptr line);
+
+ /**
+ * remove line @p i
+ * marks the block dirty
+ * @param i line to remove
+ */
+ void removeLine(uint i);
+
+ /**
+ * mark this block as dirty, will invalidate the swap data
+ * insert/removeLine will mark the block dirty itself
+ */
+ void markDirty ();
+
+ public:
+ /**
+ * startLine
+ * @return first line in block
+ */
+ inline uint startLine () const { return m_startLine; };
+
+ /**
+ * update the first line, needed to keep it up to date
+ * @param line new startLine
+ */
+ inline void setStartLine (uint line) { m_startLine = line; }
+
+ /**
+ * first line behind this block
+ * @return line behind block
+ */
+ inline uint endLine () const { return m_startLine + m_lines; }
+
+ /**
+ * lines in this block
+ * @return lines
+ */
+ inline uint lines () const { return m_lines; }
+
+ /**
+ * prev block
+ * @return previous block
+ */
+ inline KateBufBlock *prev () { return m_prev; }
+
+ /**
+ * next block
+ * @return next block
+ */
+ inline KateBufBlock *next () { return m_next; }
+
+ /**
+ * methodes to swap in/out
+ */
+ private:
+ /**
+ * swap in the kvmallocater data, create string list
+ */
+ void swapIn ();
+
+ /**
+ * swap our string list out, delete it !
+ */
+ void swapOut ();
+
+ private:
+ /**
+ * VERY IMPORTANT, state of this block
+ * this uchar indicates if the block is swapped, loaded, clean or dirty
+ */
+ KateBufBlock::State m_state;
+
+ /**
+ * IMPORTANT, start line
+ */
+ uint m_startLine;
+
+ /**
+ * IMPORTANT, line count
+ */
+ uint m_lines;
+
+ /**
+ * here we swap our stuff
+ */
+ KVMAllocator::Block *m_vmblock;
+
+ /**
+ * swapped size
+ */
+ uint m_vmblockSize;
+
+ /**
+ * list of textlines
+ */
+ QValueVector<KateTextLine::Ptr> m_stringList;
+
+ /**
+ * parent buffer.
+ */
+ KateBuffer* m_parent;
+
+ /**
+ * prev block
+ */
+ KateBufBlock *m_prev;
+
+ /**
+ * next block
+ */
+ KateBufBlock *m_next;
+
+ private:
+ /**
+ * list pointer, to which list I belong
+ * list element pointers for the KateBufBlockList ONLY !!!
+ */
+ KateBufBlockList *list;
+
+ /**
+ * prev list item
+ */
+ KateBufBlock *listPrev;
+
+ /**
+ * next list item
+ */
+ KateBufBlock *listNext;
+};
+
+/**
+ * list which allows O(1) inserts/removes
+ * will not delete the elements on remove
+ * will use the next/prevNode pointers in the KateBufBlocks !
+ * internal use: loaded/clean/dirty block lists
+ *
+ * @author Christoph Cullmann <cullmann@kde.org>
+ */
+class KateBufBlockList
+{
+ public:
+ /**
+ * Default Constructor
+ */
+ KateBufBlockList ();
+
+ public:
+ /**
+ * count of blocks in this list
+ * @return count of blocks
+ */
+ inline uint count() const { return m_count; }
+
+ /**
+ * first block in this list or 0
+ * @return head of list
+ */
+ inline KateBufBlock *first () { return m_first; };
+
+ /**
+ * last block in this list or 0
+ * @return end of list
+ */
+ inline KateBufBlock *last () { return m_last; };
+
+ /**
+ * is buf the last block?
+ * @param buf block to test
+ * @return is this block the first one?
+ */
+ inline bool isFirst (KateBufBlock *buf) { return m_first == buf; };
+
+ /**
+ * is buf the last block?
+ * @param buf block to test
+ * @return is this block the last one?
+ */
+ inline bool isLast (KateBufBlock *buf) { return m_last == buf; };
+
+ /**
+ * append a block to this list !
+ * will remove it from the list it belonged before !
+ * @param buf block to append
+ */
+ void append (KateBufBlock *buf);
+
+ /**
+ * remove the block from the list it belongs to !
+ * @param buf block to remove
+ */
+ inline static void remove (KateBufBlock *buf)
+ {
+ if (buf->list)
+ buf->list->removeInternal (buf);
+ }
+
+ private:
+ /**
+ * internal helper for remove
+ * @param buf block to remove
+ */
+ void removeInternal (KateBufBlock *buf);
+
+ private:
+ /**
+ * count of blocks in list
+ */
+ uint m_count;
+
+ /**
+ * first block
+ */
+ KateBufBlock *m_first;
+
+ /**
+ * last block
+ */
+ KateBufBlock *m_last;
+};
+
+/**
+ * The KateBuffer class maintains a collections of lines.
+ * It allows to maintain state information in a lazy way.
+ * It handles swapping out of data using secondary storage.
+ *
+ * It is designed to handle large amounts of text-data efficiently
+ * with respect to CPU and memory usage.
+ *
+ * @author Waldo Bastian <bastian@kde.org>
+ * @author Christoph Cullmann <cullmann@kde.org>
+ */
+class KateBuffer : public QObject
+{
+ Q_OBJECT
+
+ friend class KateBufBlock;
+
+ public:
+ /**
+ * maximal loaded block count
+ * @return max loaded blocks
+ */
+ inline static uint maxLoadedBlocks () { return m_maxLoadedBlocks; }
+
+ /**
+ * modifier for max loaded blocks limit
+ * @param count new limit
+ */
+ static void setMaxLoadedBlocks (uint count);
+
+ private:
+ /**
+ * global max loaded blocks limit
+ */
+ static uint m_maxLoadedBlocks;
+
+ public:
+ /**
+ * Create an empty buffer.
+ * @param doc parent document
+ */
+ KateBuffer (KateDocument *doc);
+
+ /**
+ * Goodbye buffer
+ */
+ ~KateBuffer ();
+
+ public:
+ /**
+ * start some editing action
+ */
+ void editStart ();
+
+ /**
+ * finish some editing action
+ */
+ void editEnd ();
+
+ /**
+ * were there changes in the current running
+ * editing session?
+ * @return changes done?
+ */
+ inline bool editChanged () const { return editChangesDone; }
+
+ /**
+ * dirty lines start
+ * @return start line
+ */
+ inline uint editTagStart () const { return editTagLineStart; }
+
+ /**
+ * dirty lines end
+ * @return end line
+ */
+ inline uint editTagEnd () const { return editTagLineEnd; }
+
+ /**
+ * line inserted/removed?
+ * @return line inserted/removed?
+ */
+ inline bool editTagFrom () const { return editTagLineFrom; }
+
+ private:
+ /**
+ * edit session recursion
+ */
+ uint editSessionNumber;
+
+ /**
+ * is a edit session running
+ */
+ bool editIsRunning;
+
+ /**
+ * dirty lines start at line
+ */
+ uint editTagLineStart;
+
+ /**
+ * dirty lines end at line
+ */
+ uint editTagLineEnd;
+
+ /**
+ * a line was inserted or removed
+ */
+ bool editTagLineFrom;
+
+ /**
+ * changes done?
+ */
+ bool editChangesDone;
+
+ public:
+ /**
+ * Clear the buffer.
+ */
+ void clear();
+
+ /**
+ * Open a file, use the given filename
+ * @param m_file filename to open
+ * @return success
+ */
+ bool openFile (const QString &m_file);
+
+ /**
+ * was the last loading broken because of not enough tmp disk space ?
+ * (will be reseted on successful save of the file, user gets warning if he really wants to do it)
+ * @return was loading borked?
+ */
+ bool loadingBorked () const { return m_loadingBorked; }
+
+ /**
+ * is this file a binary?
+ * @return binary file?
+ */
+ bool binary () const { return m_binary; }
+
+ /**
+ * Can the current codec handle all chars
+ * @return chars can be encoded
+ */
+ bool canEncode ();
+
+ /**
+ * Save the buffer to a file, use the given filename + codec + end of line chars (internal use of qtextstream)
+ * @param m_file filename to save to
+ * @return success
+ */
+ bool saveFile (const QString &m_file);
+
+ public:
+ /**
+ * Return line @p i
+ */
+ inline KateTextLine::Ptr line(uint i)
+ {
+ KateBufBlock *buf = findBlock(i);
+ if (!buf)
+ return 0;
+
+ if (i < m_lineHighlighted)
+ return buf->line (i - buf->startLine());
+
+ return line_internal (buf, i);
+ }
+
+ private:
+ /**
+ * line needs hl
+ */
+ KateTextLine::Ptr line_internal (KateBufBlock *buf, uint i);
+
+ inline void addIndentBasedFoldingInformation(QMemArray<uint> &foldingList,bool addindent,uint deindent);
+ inline void updatePreviousNotEmptyLine(KateBufBlock *blk,uint current_line,bool addindent,uint deindent);
+ public:
+ /**
+ * Return line @p i without triggering highlighting
+ */
+ inline KateTextLine::Ptr plainLine(uint i)
+ {
+ KateBufBlock *buf = findBlock(i);
+ if (!buf)
+ return 0;
+
+ return buf->line(i - buf->startLine());
+ }
+
+ /**
+ * Return the total number of lines in the buffer.
+ */
+ inline uint count() const { return m_lines; }
+
+ private:
+ /**
+ * Find the block containing line @p i
+ * index pointer gets filled with index of block in m_blocks
+ * index only valid if returned block != 0 !
+ */
+ KateBufBlock *findBlock (uint i, uint *index = 0)
+ {
+ // out of range !
+ if (i >= m_lines)
+ return 0;
+
+ if ((m_blocks[m_lastFoundBlock]->startLine() <= i) && (m_blocks[m_lastFoundBlock]->endLine() > i))
+ {
+ if (index)
+ (*index) = m_lastFoundBlock;
+
+ return m_blocks[m_lastFoundBlock];
+ }
+
+ return findBlock_internal (i, index);
+ }
+
+ KateBufBlock *findBlock_internal (uint i, uint *index = 0);
+
+ public:
+ /**
+ * Mark line @p i as changed !
+ */
+ void changeLine(uint i);
+
+ /**
+ * Insert @p line in front of line @p i
+ */
+ void insertLine(uint i, KateTextLine::Ptr line);
+
+ /**
+ * Remove line @p i
+ */
+ void removeLine(uint i);
+
+ public:
+ inline uint countVisible () { return m_lines - m_regionTree.getHiddenLinesCount(m_lines); }
+
+ inline uint lineNumber (uint visibleLine) { return m_regionTree.getRealLine (visibleLine); }
+
+ inline uint lineVisibleNumber (uint line) { return m_regionTree.getVirtualLine (line); }
+
+ inline void lineInfo (KateLineInfo *info, unsigned int line) { m_regionTree.getLineInfo(info,line); }
+
+ inline uint tabWidth () const { return m_tabWidth; }
+
+ public:
+ void setTabWidth (uint w);
+
+ /**
+ * Use @p highlight for highlighting
+ *
+ * @p highlight may be 0 in which case highlighting
+ * will be disabled.
+ */
+ void setHighlight (uint hlMode);
+
+ KateHighlighting *highlight () { return m_highlight; };
+
+ /**
+ * Invalidate highlighting of whole buffer.
+ */
+ void invalidateHighlighting();
+
+ KateCodeFoldingTree *foldingTree () { return &m_regionTree; };
+
+ public slots:
+ void codeFoldingColumnUpdate(unsigned int lineNr);
+
+ private:
+ /**
+ * Highlight information needs to be updated.
+ *
+ * @param buf The buffer being processed.
+ * @param startState highlighting state of last line before range
+ * @param from first line in range
+ * @param to last line in range
+ * @param invalidat should the rehighlighted lines be tagged ?
+ *
+ * @returns true when the highlighting in the next block needs to be updated,
+ * false otherwise.
+ */
+ bool doHighlight (KateBufBlock *buf, uint from, uint to, bool invalidate);
+
+ signals:
+ /**
+ * Emittend if codefolding returned with a changed list
+ */
+ void codeFoldingUpdated();
+
+ /**
+ * Emitted when the highlighting of a certain range has
+ * changed.
+ */
+ void tagLines(int start, int end);
+
+ private:
+ /**
+ * document we belong too
+ */
+ KateDocument *m_doc;
+
+ /**
+ * current line count
+ */
+ uint m_lines;
+
+ /**
+ * ALL blocks
+ * in order of linenumbers
+ */
+ QValueVector<KateBufBlock*> m_blocks;
+
+ /**
+ * last block where the start/end line is in sync with real life
+ */
+ uint m_lastInSyncBlock;
+
+ /**
+ * last block found by findBlock, there to make searching faster
+ */
+ uint m_lastFoundBlock;
+
+ /**
+ * status of the cache read/write errors
+ * write errors get handled, read errors not really atm
+ */
+ bool m_cacheReadError;
+ bool m_cacheWriteError;
+
+ /**
+ * had we cache error while loading ?
+ */
+ bool m_loadingBorked;
+
+ /**
+ * binary file loaded ?
+ */
+ bool m_binary;
+
+ /**
+ * highlighting & folding relevant stuff
+ */
+ private:
+ /**
+ * current highlighting mode or 0
+ */
+ KateHighlighting *m_highlight;
+
+ /**
+ * folding tree
+ */
+ KateCodeFoldingTree m_regionTree;
+
+ // for the scrapty indent sensitive langs
+ uint m_tabWidth;
+
+ uint m_lineHighlightedMax;
+ uint m_lineHighlighted;
+
+ /**
+ * number of dynamic contexts causing a full invalidation
+ */
+ uint m_maxDynamicContexts;
+
+ /**
+ * only used from the KateBufBlocks !
+ */
+ private:
+ /**
+ * all not swapped blocks !
+ */
+ KateBufBlockList m_loadedBlocks;
+};
+
+#endif
+
+// kate: space-indent on; indent-width 2; replace-tabs on;
diff --git a/kate/part/katecmds.cpp b/kate/part/katecmds.cpp
new file mode 100644
index 000000000..17846dd7d
--- /dev/null
+++ b/kate/part/katecmds.cpp
@@ -0,0 +1,605 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2003 - 2005 Anders Lund <anders@alweb.dk>
+ Copyright (C) 2001-2004 Christoph Cullmann <cullmann@kde.org>
+ Copyright (C) 2001 Charles Samuels <charles@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "katecmds.h"
+
+#include "katedocument.h"
+#include "kateview.h"
+#include "kateconfig.h"
+#include "kateautoindent.h"
+#include "katetextline.h"
+#include "katefactory.h"
+#include "katejscript.h"
+#include "katerenderer.h"
+
+#include "../interfaces/katecmd.h"
+
+#include <kdebug.h>
+#include <klocale.h>
+#include <kurl.h>
+#include <kshellcompletion.h>
+
+#include <qregexp.h>
+
+
+//BEGIN CoreCommands
+// syncs a config flag in the document with a boolean value
+static void setDocFlag( KateDocumentConfig::ConfigFlags flag, bool enable,
+ KateDocument *doc )
+{
+ doc->config()->setConfigFlags( flag, enable );
+}
+
+// this returns wheather the string s could be converted to
+// a bool value, one of on|off|1|0|true|false. the argument val is
+// set to the extracted value in case of success
+static bool getBoolArg( QString s, bool *val )
+{
+ bool res( false );
+ s = s.lower();
+ res = (s == "on" || s == "1" || s == "true");
+ if ( res )
+ {
+ *val = true;
+ return true;
+ }
+ res = (s == "off" || s == "0" || s == "false");
+ if ( res )
+ {
+ *val = false;
+ return true;
+ }
+ return false;
+}
+
+QStringList KateCommands::CoreCommands::cmds()
+{
+ QStringList l;
+ l << "indent" << "unindent" << "cleanindent"
+ << "comment" << "uncomment" << "goto" << "kill-line"
+ << "set-tab-width" << "set-replace-tabs" << "set-show-tabs"
+ << "set-remove-trailing-space"
+ << "set-indent-spaces" << "set-indent-width" << "set-mixed-indent"
+ << "set-indent-mode" << "set-auto-indent"
+ << "set-line-numbers" << "set-folding-markers" << "set-icon-border"
+ << "set-wrap-cursor"
+ << "set-word-wrap" << "set-word-wrap-column"
+ << "set-replace-tabs-save" << "set-remove-trailing-space-save"
+ << "set-highlight" << "run-myself" << "set-show-indent";
+ return l;
+}
+
+bool KateCommands::CoreCommands::exec(Kate::View *view,
+ const QString &_cmd,
+ QString &errorMsg)
+{
+#define KCC_ERR(s) { errorMsg=s; return false; }
+ // cast it hardcore, we know that it is really a kateview :)
+ KateView *v = (KateView*) view;
+
+ if ( ! v )
+ KCC_ERR( i18n("Could not access view") );
+
+ //create a list of args
+ QStringList args( QStringList::split( QRegExp("\\s+"), _cmd ) );
+ QString cmd ( args.first() );
+ args.remove( args.first() );
+
+ // ALL commands that takes no arguments.
+ if ( cmd == "indent" )
+ {
+ v->indent();
+ return true;
+ }
+ else if ( cmd == "run-myself" )
+ {
+#ifndef Q_WS_WIN //todo
+ return KateFactory::self()->jscript()->execute(v, v->doc()->text(), errorMsg);
+#else
+ return 0;
+#endif
+ }
+ else if ( cmd == "unindent" )
+ {
+ v->unIndent();
+ return true;
+ }
+ else if ( cmd == "cleanindent" )
+ {
+ v->cleanIndent();
+ return true;
+ }
+ else if ( cmd == "comment" )
+ {
+ v->comment();
+ return true;
+ }
+ else if ( cmd == "uncomment" )
+ {
+ v->uncomment();
+ return true;
+ }
+ else if ( cmd == "kill-line" )
+ {
+ v->killLine();
+ return true;
+ }
+ else if ( cmd == "set-indent-mode" )
+ {
+ bool ok(false);
+ int val ( args.first().toInt( &ok ) );
+ if ( ok )
+ {
+ if ( val < 0 )
+ KCC_ERR( i18n("Mode must be at least 0.") );
+ v->doc()->config()->setIndentationMode( val );
+ }
+ else
+ v->doc()->config()->setIndentationMode( KateAutoIndent::modeNumber( args.first() ) );
+ return true;
+ }
+ else if ( cmd == "set-highlight" )
+ {
+ QString val = _cmd.section( ' ', 1 ).lower();
+ for ( uint i=0; i < v->doc()->hlModeCount(); i++ )
+ {
+ if ( v->doc()->hlModeName( i ).lower() == val )
+ {
+ v->doc()->setHlMode( i );
+ return true;
+ }
+ }
+ KCC_ERR( i18n("No such highlight '%1'").arg( args.first() ) );
+ }
+
+ // ALL commands that takes exactly one integer argument.
+ else if ( cmd == "set-tab-width" ||
+ cmd == "set-indent-width" ||
+ cmd == "set-word-wrap-column" ||
+ cmd == "goto" )
+ {
+ // find a integer value > 0
+ if ( ! args.count() )
+ KCC_ERR( i18n("Missing argument. Usage: %1 <value>").arg( cmd ) );
+ bool ok;
+ int val ( args.first().toInt( &ok ) );
+ if ( !ok )
+ KCC_ERR( i18n("Failed to convert argument '%1' to integer.")
+ .arg( args.first() ) );
+
+ if ( cmd == "set-tab-width" )
+ {
+ if ( val < 1 )
+ KCC_ERR( i18n("Width must be at least 1.") );
+ v->setTabWidth( val );
+ }
+ else if ( cmd == "set-indent-width" )
+ {
+ if ( val < 1 )
+ KCC_ERR( i18n("Width must be at least 1.") );
+ v->doc()->config()->setIndentationWidth( val );
+ }
+ else if ( cmd == "set-word-wrap-column" )
+ {
+ if ( val < 2 )
+ KCC_ERR( i18n("Column must be at least 1.") );
+ v->doc()->setWordWrapAt( val );
+ }
+ else if ( cmd == "goto" )
+ {
+ if ( val < 1 )
+ KCC_ERR( i18n("Line must be at least 1") );
+ if ( (uint)val > v->doc()->numLines() )
+ KCC_ERR( i18n("There is not that many lines in this document") );
+ v->gotoLineNumber( val - 1 );
+ }
+ return true;
+ }
+
+ // ALL commands that takes 1 boolean argument.
+ else if ( cmd == "set-icon-border" ||
+ cmd == "set-folding-markers" ||
+ cmd == "set-line-numbers" ||
+ cmd == "set-replace-tabs" ||
+ cmd == "set-remove-trailing-space" ||
+ cmd == "set-show-tabs" ||
+ cmd == "set-indent-spaces" ||
+ cmd == "set-mixed-indent" ||
+ cmd == "set-word-wrap" ||
+ cmd == "set-wrap-cursor" ||
+ cmd == "set-replace-tabs-save" ||
+ cmd == "set-remove-trailing-space-save" ||
+ cmd == "set-show-indent" )
+ {
+ if ( ! args.count() )
+ KCC_ERR( i18n("Usage: %1 on|off|1|0|true|false").arg( cmd ) );
+ bool enable;
+ if ( getBoolArg( args.first(), &enable ) )
+ {
+ if ( cmd == "set-icon-border" )
+ v->setIconBorder( enable );
+ else if (cmd == "set-folding-markers")
+ v->setFoldingMarkersOn( enable );
+ else if ( cmd == "set-line-numbers" )
+ v->setLineNumbersOn( enable );
+ else if ( cmd == "set-show-indent" )
+ v->renderer()->setShowIndentLines( enable );
+ else if ( cmd == "set-replace-tabs" )
+ setDocFlag( KateDocumentConfig::cfReplaceTabsDyn, enable, v->doc() );
+ else if ( cmd == "set-remove-trailing-space" )
+ setDocFlag( KateDocumentConfig::cfRemoveTrailingDyn, enable, v->doc() );
+ else if ( cmd == "set-show-tabs" )
+ setDocFlag( KateDocumentConfig::cfShowTabs, enable, v->doc() );
+ else if ( cmd == "set-indent-spaces" )
+ setDocFlag( KateDocumentConfig::cfSpaceIndent, enable, v->doc() );
+ else if ( cmd == "set-mixed-indent" )
+ {
+ // this is special, in that everything is set up -- space-indent is enabled,
+ // and a indent-width is set if it is 0 (to tabwidth/2)
+ setDocFlag( KateDocumentConfig::cfMixedIndent, enable, v->doc() );
+ if ( enable )
+ {
+ setDocFlag( KateDocumentConfig::cfSpaceIndent, enable, v->doc() );
+ if ( ! v->doc()->config()->indentationWidth() )
+ v->doc()->config()->setIndentationWidth( v->tabWidth()/2 );
+ }
+ }
+ else if ( cmd == "set-word-wrap" )
+ v->doc()->setWordWrap( enable );
+ else if ( cmd == "set-remove-trailing-space-save" )
+ setDocFlag( KateDocumentConfig::cfRemoveSpaces, enable, v->doc() );
+ else if ( cmd == "set-wrap-cursor" )
+ setDocFlag( KateDocumentConfig::cfWrapCursor, enable, v->doc() );
+
+ return true;
+ }
+ else
+ KCC_ERR( i18n("Bad argument '%1'. Usage: %2 on|off|1|0|true|false")
+ .arg( args.first() ).arg( cmd ) );
+ }
+
+ // unlikely..
+ KCC_ERR( i18n("Unknown command '%1'").arg(cmd) );
+}
+
+KCompletion *KateCommands::CoreCommands::completionObject( const QString &cmd, Kate::View *view )
+{
+ if ( cmd == "set-highlight" )
+ {
+ KateView *v = (KateView*)view;
+ QStringList l;
+ for ( uint i = 0; i < v->doc()->hlModeCount(); i++ )
+ l << v->doc()->hlModeName( i );
+
+ KateCmdShellCompletion *co = new KateCmdShellCompletion();
+ co->setItems( l );
+ co->setIgnoreCase( true );
+ return co;
+ }
+ return 0L;
+}
+//END CoreCommands
+
+//BEGIN SedReplace
+static void replace(QString &s, const QString &needle, const QString &with)
+{
+ int pos=0;
+ while (1)
+ {
+ pos=s.find(needle, pos);
+ if (pos==-1) break;
+ s.replace(pos, needle.length(), with);
+ pos+=with.length();
+ }
+
+}
+
+static int backslashString(const QString &haystack, const QString &needle, int index)
+{
+ int len=haystack.length();
+ int searchlen=needle.length();
+ bool evenCount=true;
+ while (index<len)
+ {
+ if (haystack[index]=='\\')
+ {
+ evenCount=!evenCount;
+ }
+ else
+ { // isn't a slash
+ if (!evenCount)
+ {
+ if (haystack.mid(index, searchlen)==needle)
+ return index-1;
+ }
+ evenCount=true;
+ }
+ index++;
+
+ }
+
+ return -1;
+}
+
+// exchange "\t" for the actual tab character, for example
+static void exchangeAbbrevs(QString &str)
+{
+ // the format is (findreplace)*[nullzero]
+ const char *magic="a\x07t\tn\n";
+
+ while (*magic)
+ {
+ int index=0;
+ char replace=magic[1];
+ while ((index=backslashString(str, QChar(*magic), index))!=-1)
+ {
+ str.replace(index, 2, QChar(replace));
+ index++;
+ }
+ magic++;
+ magic++;
+ }
+}
+
+int KateCommands::SedReplace::sedMagic( KateDocument *doc, int &line,
+ const QString &find, const QString &repOld, const QString &delim,
+ bool noCase, bool repeat,
+ uint startcol, int endcol )
+{
+ KateTextLine *ln = doc->kateTextLine( line );
+ if ( ! ln || ! ln->length() ) return 0;
+
+ // HANDLING "\n"s in PATTERN
+ // * Create a list of patterns, splitting PATTERN on (unescaped) "\n"
+ // * insert $s and ^s to match line ends/beginnings
+ // * When matching patterhs after the first one, replace \N with the captured
+ // text.
+ // * If all patterns in the list match sequentiel lines, there is a match, so
+ // * remove line/start to line + patterns.count()-1/patterns.last.length
+ // * handle capatures by putting them in one list.
+ // * the existing insertion is fine, including the line calculation.
+
+ QStringList patterns = QStringList::split( QRegExp("(^\\\\n|(?![^\\\\])\\\\n)"), find, true );
+
+ if ( patterns.count() > 1 )
+ {
+ for ( uint i = 0; i < patterns.count(); i++ )
+ {
+ if ( i < patterns.count() - 1 )
+ patterns[i].append("$");
+ if ( i )
+ patterns[i].prepend("^");
+
+ kdDebug(13025)<<"patterns["<<i<<"] ="<<patterns[i]<<endl;
+ }
+ }
+
+ QRegExp matcher(patterns[0], noCase);
+
+ uint len;
+ int matches = 0;
+
+ while ( ln->searchText( startcol, matcher, &startcol, &len ) )
+ {
+
+ if ( endcol >= 0 && startcol + len > (uint)endcol )
+ break;
+
+ matches++;
+
+
+ QString rep=repOld;
+
+ // now set the backreferences in the replacement
+ QStringList backrefs=matcher.capturedTexts();
+ int refnum=1;
+
+ QStringList::Iterator i = backrefs.begin();
+ ++i;
+
+ for (; i!=backrefs.end(); ++i)
+ {
+ // I need to match "\\" or "", but not "\"
+ QString number=QString::number(refnum);
+
+ int index=0;
+ while (index!=-1)
+ {
+ index=backslashString(rep, number, index);
+ if (index>=0)
+ {
+ rep.replace(index, 2, *i);
+ index+=(*i).length();
+ }
+ }
+
+ refnum++;
+ }
+
+ replace(rep, "\\\\", "\\");
+ replace(rep, "\\" + delim, delim);
+
+ doc->removeText( line, startcol, line, startcol + len );
+ doc->insertText( line, startcol, rep );
+
+ // TODO if replace contains \n,
+ // change the line number and
+ // check for text that needs be searched behind the last inserted newline.
+ int lns = rep.contains('\n');
+ if ( lns )
+ {
+ line += lns;
+
+ if ( doc->lineLength( line ) > 0 && ( endcol < 0 || (uint)endcol >= startcol + len ) )
+ {
+ // if ( endcol >= startcol + len )
+ endcol -= (startcol + len);
+ uint sc = rep.length() - rep.findRev('\n') - 1;
+ matches += sedMagic( doc, line, find, repOld, delim, noCase, repeat, sc, endcol );
+ }
+ }
+
+ if (!repeat) break;
+ startcol+=rep.length();
+
+ // sanity check -- avoid infinite loops eg with %s,.*,,g ;)
+ uint ll = ln->length();
+ if ( ! ll || startcol > ll )
+ break;
+ }
+
+ return matches;
+}
+
+bool KateCommands::SedReplace::exec (Kate::View *view, const QString &cmd, QString &msg)
+{
+ kdDebug(13025)<<"SedReplace::execCmd( "<<cmd<<" )"<<endl;
+
+ QRegExp delim("^[$%]?s\\s*([^\\w\\s])");
+ if ( delim.search( cmd ) < 0 ) return false;
+
+ bool fullFile=cmd[0]=='%';
+ bool noCase=cmd[cmd.length()-1]=='i' || cmd[cmd.length()-2]=='i';
+ bool repeat=cmd[cmd.length()-1]=='g' || cmd[cmd.length()-2]=='g';
+ bool onlySelect=cmd[0]=='$';
+
+ QString d = delim.cap(1);
+ kdDebug(13025)<<"SedReplace: delimiter is '"<<d<<"'"<<endl;
+
+ QRegExp splitter( QString("^[$%]?s\\s*") + d + "((?:[^\\\\\\" + d + "]|\\\\.)*)\\" + d +"((?:[^\\\\\\" + d + "]|\\\\.)*)\\" + d + "[ig]{0,2}$" );
+ if (splitter.search(cmd)<0) return false;
+
+ QString find=splitter.cap(1);
+ kdDebug(13025)<< "SedReplace: find=" << find.latin1() <<endl;
+
+ QString replace=splitter.cap(2);
+ exchangeAbbrevs(replace);
+ kdDebug(13025)<< "SedReplace: replace=" << replace.latin1() <<endl;
+
+ if ( find.contains("\\n") )
+ {
+ msg = i18n("Sorry, but Kate is not able to replace newlines, yet");
+ return false;
+ }
+
+ KateDocument *doc = ((KateView*)view)->doc();
+ if ( ! doc ) return false;
+
+ doc->editStart();
+
+ int res = 0;
+
+ if (fullFile)
+ {
+ uint numLines=doc->numLines();
+ for (int line=0; (uint)line < numLines; line++)
+ {
+ res += sedMagic( doc, line, find, replace, d, !noCase, repeat );
+ if ( ! repeat && res ) break;
+ }
+ }
+ else if (onlySelect)
+ {
+ int startline = doc->selStartLine();
+ uint startcol = doc->selStartCol();
+ int endcol = -1;
+ do {
+ if ( startline == doc->selEndLine() )
+ endcol = doc->selEndCol();
+
+ res += sedMagic( doc, startline, find, replace, d, !noCase, repeat, startcol, endcol );
+
+ /*if ( startcol )*/ startcol = 0;
+
+ startline++;
+ } while ( (int)startline <= doc->selEndLine() );
+ }
+ else // just this line
+ {
+ int line=view->cursorLine();
+ res += sedMagic(doc, line, find, replace, d, !noCase, repeat);
+ }
+
+ msg = i18n("1 replacement done", "%n replacements done",res );
+
+ doc->editEnd();
+
+ return true;
+}
+//END SedReplace
+
+//BEGIN Character
+bool KateCommands::Character::exec (Kate::View *view, const QString &_cmd, QString &)
+{
+ QString cmd = _cmd;
+
+ // hex, octal, base 9+1
+ QRegExp num("^char *(0?x[0-9A-Fa-f]{1,4}|0[0-7]{1,6}|[0-9]{1,3})$");
+ if (num.search(cmd)==-1) return false;
+
+ cmd=num.cap(1);
+
+ // identify the base
+
+ unsigned short int number=0;
+ int base=10;
+ if (cmd[0]=='x' || cmd.left(2)=="0x")
+ {
+ cmd.replace(QRegExp("^0?x"), "");
+ base=16;
+ }
+ else if (cmd[0]=='0')
+ base=8;
+ bool ok;
+ number=cmd.toUShort(&ok, base);
+ if (!ok || number==0) return false;
+ if (number<=255)
+ {
+ char buf[2];
+ buf[0]=(char)number;
+ buf[1]=0;
+ view->insertText(QString(buf));
+ }
+ else
+ { // do the unicode thing
+ QChar c(number);
+ view->insertText(QString(&c, 1));
+ }
+
+ return true;
+}
+//END Character
+
+//BEGIN Date
+bool KateCommands::Date::exec (Kate::View *view, const QString &cmd, QString &)
+{
+ if (cmd.left(4) != "date")
+ return false;
+
+ if (QDateTime::currentDateTime().toString(cmd.mid(5, cmd.length()-5)).length() > 0)
+ view->insertText(QDateTime::currentDateTime().toString(cmd.mid(5, cmd.length()-5)));
+ else
+ view->insertText(QDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm:ss"));
+
+ return true;
+}
+//END Date
+
+// kate: space-indent on; indent-width 2; replace-tabs on;
diff --git a/kate/part/katecmds.h b/kate/part/katecmds.h
new file mode 100644
index 000000000..84f7919d8
--- /dev/null
+++ b/kate/part/katecmds.h
@@ -0,0 +1,178 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2003 Anders Lund <anders@alweb.dk>
+ Copyright (C) 2001-2004 Christoph Cullmann <cullmann@kde.org>
+ Copyright (C) 2001 Charles Samuels <charles@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef __KATE_CMDS_H__
+#define __KATE_CMDS_H__
+
+#include "../interfaces/document.h"
+#include "../interfaces/view.h"
+
+class KateDocument;
+class KCompletion;
+
+namespace KateCommands
+{
+
+/**
+ * This Kate::Command provides access to a lot of the core functionality
+ * of kate part, settings, utilities, navigation etc.
+ * it needs to get a kateview pointer, it will cast the kate::view pointer
+ * hard to kateview
+ */
+class CoreCommands : public Kate::Command, public Kate::CommandExtension
+{
+ public:
+ /**
+ * execute command
+ * @param view view to use for execution
+ * @param cmd cmd string
+ * @param errorMsg error to return if no success
+ * @return success
+ */
+ bool exec( class Kate::View *view, const QString &cmd, QString &errorMsg );
+
+ bool help( class Kate::View *, const QString &, QString & ) {return false;};
+
+ /**
+ * supported commands as prefixes
+ * @return prefix list
+ */
+ QStringList cmds();
+
+ /**
+ * override completionObject from interfaces/document.h .
+ */
+ KCompletion *completionObject( const QString &cmd, Kate::View *view );
+};
+
+/**
+ * -- Charles Samuels <charles@kde.org>
+ * Support vim/sed find and replace
+ * s/search/replace/ find search, replace with replace on this line
+ * %s/search/replace/ do the same to the whole file
+ * s/search/replace/i do the S. and R., but case insensitively
+ * $s/search/replace/ do the search are replacement to the selection only
+ *
+ * $s/// is currently unsupported
+ **/
+class SedReplace : public Kate::Command
+{
+ public:
+ /**
+ * execute command
+ * @param view view to use for execution
+ * @param cmd cmd string
+ * @param errorMsg error to return if no success
+ * @return success
+ */
+ bool exec (class Kate::View *view, const QString &cmd, QString &errorMsg);
+
+ bool help (class Kate::View *, const QString &, QString &) { return false; };
+
+ /**
+ * supported commands as prefixes
+ * @return prefix list
+ */
+ QStringList cmds () { QStringList l("s"); l << "%s" << "$s"; return l; };
+
+ private:
+ /**
+ * Searches one line and does the replacement in the document.
+ * If @p replace contains any newline characters, the reamaining part of the
+ * line is searched, and the @p line set to the last line number searched.
+ * @return the number of replacements performed.
+ * @param doc a pointer to the document to work on
+ * @param line the number of the line to search. This may be changed by the
+ * function, if newlines are inserted.
+ * @param find A regular expression pattern to use for searching
+ * @param replace a template for replacement. Backspaced integers are
+ * replaced with captured texts from the regular expression.
+ * @param delim the delimiter character from the command. In the replacement
+ * text backsplashes preceeding this character are removed.
+ * @param nocase parameter for matching the reqular expression.
+ * @param repeat If false, the search is stopped after the first match.
+ * @param startcol The position in the line to start the search.
+ * @param endcol The last collumn in the line allowed in a match.
+ * If it is -1, the whole line is used.
+ */
+ static int sedMagic(KateDocument *doc, int &line,
+ const QString &find, const QString &replace, const QString &delim,
+ bool noCase, bool repeat,
+ uint startcol=0, int endcol=-1);
+};
+
+/**
+ * insert a unicode or ascii character
+ * base 9+1: 1234
+ * hex: 0x1234 or x1234
+ * octal: 01231
+ *
+ * prefixed with "char:"
+ **/
+class Character : public Kate::Command
+{
+ public:
+ /**
+ * execute command
+ * @param view view to use for execution
+ * @param cmd cmd string
+ * @param errorMsg error to return if no success
+ * @return success
+ */
+ bool exec (class Kate::View *view, const QString &cmd, QString &errorMsg);
+
+ bool help (class Kate::View *, const QString &, QString &) { return false; };
+
+ /**
+ * supported commands as prefixes
+ * @return prefix list
+ */
+ QStringList cmds () { return QStringList("char"); };
+};
+
+/**
+ * insert the current date/time in the given format
+ */
+class Date : public Kate::Command
+{
+ public:
+ /**
+ * execute command
+ * @param view view to use for execution
+ * @param cmd cmd string
+ * @param errorMsg error to return if no success
+ * @return success
+ */
+ bool exec (class Kate::View *view, const QString &cmd, QString &errorMsg);
+
+ bool help (class Kate::View *, const QString &, QString &) { return false; };
+
+ /**
+ * supported commands as prefixes
+ * @return prefix list
+ */
+ QStringList cmds () { return QStringList("date"); };
+};
+
+
+} // namespace KateCommands
+#endif
+
+// kate: space-indent on; indent-width 2; replace-tabs on;
diff --git a/kate/part/katecodecompletion.cpp b/kate/part/katecodecompletion.cpp
new file mode 100644
index 000000000..bbc34dfca
--- /dev/null
+++ b/kate/part/katecodecompletion.cpp
@@ -0,0 +1,566 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2001 Joseph Wenninger <jowenn@kde.org>
+ Copyright (C) 2002 John Firebaugh <jfirebaugh@kde.org>
+ Copyright (C) 2001 by Victor Röder <Victor_Roeder@GMX.de>
+ Copyright (C) 2002 by Roberto Raggi <roberto@kdevelop.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+/******** Partly based on the ArgHintWidget of Qt3 by Trolltech AS *********/
+/* Trolltech doesn't mind, if we license that piece of code as LGPL, because there isn't much
+ * left from the desigener code */
+
+#include "katecodecompletion.h"
+#include "katecodecompletion.moc"
+
+#include "katedocument.h"
+#include "kateview.h"
+#include "katerenderer.h"
+#include "kateconfig.h"
+#include "katefont.h"
+
+#include <kdebug.h>
+
+#include <qwhatsthis.h>
+#include <qvbox.h>
+#include <qlistbox.h>
+#include <qtimer.h>
+#include <qtooltip.h>
+#include <qapplication.h>
+#include <qsizegrip.h>
+#include <qfontmetrics.h>
+#include <qlayout.h>
+#include <qregexp.h>
+
+/**
+ * This class is used as the codecompletion listbox. It can be resized according to its contents,
+ * therfor the needed size is provided by sizeHint();
+ *@short Listbox showing codecompletion
+ *@author Jonas B. Jacobi <j.jacobi@gmx.de>
+ */
+class KateCCListBox : public QListBox
+{
+ public:
+ /**
+ @short Create a new CCListBox
+ */
+ KateCCListBox (QWidget* parent = 0, const char* name = 0, WFlags f = 0):QListBox(parent, name, f)
+ {
+ }
+
+ QSize sizeHint() const
+ {
+ int count = this->count();
+ int height = 20;
+ int tmpwidth = 8;
+ //FIXME the height is for some reasons at least 3 items heigh, even if there is only one item in the list
+ if (count > 0)
+ if(count < 11)
+ height = count * itemHeight(0);
+ else {
+ height = 10 * itemHeight(0);
+ tmpwidth += verticalScrollBar()->width();
+ }
+
+ int maxcount = 0, tmpcount = 0;
+ for (int i = 0; i < count; ++i)
+ if ( (tmpcount = fontMetrics().width(text(i)) ) > maxcount)
+ maxcount = tmpcount;
+
+ if (maxcount > QApplication::desktop()->width()){
+ tmpwidth = QApplication::desktop()->width() - 5;
+ height += horizontalScrollBar()->height();
+ } else
+ tmpwidth += maxcount;
+ return QSize(tmpwidth,height);
+
+ }
+};
+
+class KateCompletionItem : public QListBoxText
+{
+ public:
+ KateCompletionItem( QListBox* lb, KTextEditor::CompletionEntry entry )
+ : QListBoxText( lb )
+ , m_entry( entry )
+ {
+ if( entry.postfix == "()" ) { // should be configurable
+ setText( entry.prefix + " " + entry.text + entry.postfix );
+ } else {
+ setText( entry.prefix + " " + entry.text + " " + entry.postfix);
+ }
+ }
+
+ KTextEditor::CompletionEntry m_entry;
+};
+
+
+KateCodeCompletion::KateCodeCompletion( KateView* view )
+ : QObject( view, "Kate Code Completion" )
+ , m_view( view )
+ , m_commentLabel( 0 )
+{
+ m_completionPopup = new QVBox( 0, 0, WType_Popup );
+ m_completionPopup->setFrameStyle( QFrame::Box | QFrame::Plain );
+ m_completionPopup->setLineWidth( 1 );
+
+ m_completionListBox = new KateCCListBox( m_completionPopup );
+ m_completionListBox->setFrameStyle( QFrame::NoFrame );
+ //m_completionListBox->setCornerWidget( new QSizeGrip( m_completionListBox) );
+ m_completionListBox->setFocusProxy( m_view->m_viewInternal );
+
+ m_completionListBox->installEventFilter( this );
+
+ m_completionPopup->resize(m_completionListBox->sizeHint() + QSize(2,2));
+ m_completionPopup->installEventFilter( this );
+ m_completionPopup->setFocusProxy( m_view->m_viewInternal );
+
+ m_pArgHint = new KateArgHint( m_view );
+ connect( m_pArgHint, SIGNAL(argHintHidden()),
+ this, SIGNAL(argHintHidden()) );
+
+ connect( m_view, SIGNAL(cursorPositionChanged()),
+ this, SLOT(slotCursorPosChanged()) );
+}
+
+KateCodeCompletion::~KateCodeCompletion()
+{
+ delete m_completionPopup;
+}
+
+bool KateCodeCompletion::codeCompletionVisible () {
+ return m_completionPopup->isVisible();
+}
+
+void KateCodeCompletion::showCompletionBox(
+ QValueList<KTextEditor::CompletionEntry> complList, int offset, bool casesensitive )
+{
+ kdDebug(13035) << "showCompletionBox " << endl;
+
+ if ( codeCompletionVisible() ) return;
+
+ m_caseSensitive = casesensitive;
+ m_complList = complList;
+ m_offset = offset;
+ m_view->cursorPositionReal( &m_lineCursor, &m_colCursor );
+ m_colCursor -= offset;
+
+ updateBox( true );
+}
+
+bool KateCodeCompletion::eventFilter( QObject *o, QEvent *e )
+{
+ if ( o != m_completionPopup &&
+ o != m_completionListBox &&
+ o != m_completionListBox->viewport() )
+ return false;
+
+ if( e->type() == QEvent::Hide )
+ {
+ //don't use abortCompletion() as aborting here again will send abort signal
+ //even on successfull completion we will emit completionAborted() twice...
+ m_completionPopup->hide();
+ delete m_commentLabel;
+ m_commentLabel = 0;
+ return false;
+ }
+
+
+ if ( e->type() == QEvent::MouseButtonDblClick ) {
+ doComplete();
+ return false;
+ }
+
+ if ( e->type() == QEvent::MouseButtonPress ) {
+ QTimer::singleShot(0, this, SLOT(showComment()));
+ return false;
+ }
+
+ return false;
+}
+
+void KateCodeCompletion::handleKey (QKeyEvent *e)
+{
+ // close completion if you move out of range
+ if ((e->key() == Key_Up) && (m_completionListBox->currentItem() == 0))
+ {
+ abortCompletion();
+ m_view->setFocus();
+ return;
+ }
+
+ // keyboard movement
+ if( (e->key() == Key_Up) || (e->key() == Key_Down ) ||
+ (e->key() == Key_Home ) || (e->key() == Key_End) ||
+ (e->key() == Key_Prior) || (e->key() == Key_Next ))
+ {
+ QTimer::singleShot(0,this,SLOT(showComment()));
+ QApplication::sendEvent( m_completionListBox, (QEvent*)e );
+ return;
+ }
+
+ // update the box
+ updateBox();
+}
+
+void KateCodeCompletion::doComplete()
+{
+ KateCompletionItem* item = static_cast<KateCompletionItem*>(
+ m_completionListBox->item(m_completionListBox->currentItem()));
+
+ if( item == 0 )
+ return;
+
+ QString text = item->m_entry.text;
+ QString currentLine = m_view->currentTextLine();
+ int len = m_view->cursorColumnReal() - m_colCursor;
+ QString currentComplText = currentLine.mid(m_colCursor,len);
+ QString add = text.mid(currentComplText.length());
+ if( item->m_entry.postfix == "()" )
+ add += "(";
+
+ emit filterInsertString(&(item->m_entry),&add);
+ m_view->insertText(add);
+
+ complete( item->m_entry );
+ m_view->setFocus();
+}
+
+void KateCodeCompletion::abortCompletion()
+{
+ m_completionPopup->hide();
+ delete m_commentLabel;
+ m_commentLabel = 0;
+ emit completionAborted();
+}
+
+void KateCodeCompletion::complete( KTextEditor::CompletionEntry entry )
+{
+ m_completionPopup->hide();
+ delete m_commentLabel;
+ m_commentLabel = 0;
+ emit completionDone( entry );
+ emit completionDone();
+}
+
+void KateCodeCompletion::updateBox( bool )
+{
+ if( m_colCursor > m_view->cursorColumnReal() ) {
+ // the cursor is too far left
+ kdDebug(13035) << "Aborting Codecompletion after sendEvent" << endl;
+ kdDebug(13035) << m_view->cursorColumnReal() << endl;
+ abortCompletion();
+ m_view->setFocus();
+ return;
+ }
+
+ m_completionListBox->clear();
+
+ QString currentLine = m_view->currentTextLine();
+ int len = m_view->cursorColumnReal() - m_colCursor;
+ QString currentComplText = currentLine.mid(m_colCursor,len);
+/* No-one really badly wants those, or?
+ kdDebug(13035) << "Column: " << m_colCursor << endl;
+ kdDebug(13035) << "Line: " << currentLine << endl;
+ kdDebug(13035) << "CurrentColumn: " << m_view->cursorColumnReal() << endl;
+ kdDebug(13035) << "Len: " << len << endl;
+ kdDebug(13035) << "Text: '" << currentComplText << "'" << endl;
+ kdDebug(13035) << "Count: " << m_complList.count() << endl;
+*/
+ QValueList<KTextEditor::CompletionEntry>::Iterator it;
+ if( m_caseSensitive ) {
+ for( it = m_complList.begin(); it != m_complList.end(); ++it ) {
+ if( (*it).text.startsWith(currentComplText) ) {
+ new KateCompletionItem(m_completionListBox,*it);
+ }
+ }
+ } else {
+ currentComplText = currentComplText.upper();
+ for( it = m_complList.begin(); it != m_complList.end(); ++it ) {
+ if( (*it).text.upper().startsWith(currentComplText) ) {
+ new KateCompletionItem(m_completionListBox,*it);
+ }
+ }
+ }
+
+ if( m_completionListBox->count() == 0 ||
+ ( m_completionListBox->count() == 1 && // abort if we equaled the last item
+ currentComplText == m_completionListBox->text(0).stripWhiteSpace() ) ) {
+ abortCompletion();
+ m_view->setFocus();
+ return;
+ }
+
+ kdDebug(13035)<<"KateCodeCompletion::updateBox: Resizing widget"<<endl;
+ m_completionPopup->resize(m_completionListBox->sizeHint() + QSize(2,2));
+ QPoint p = m_view->mapToGlobal( m_view->cursorCoordinates() );
+ int x = p.x();
+ int y = p.y() ;
+ if ( y + m_completionPopup->height() + m_view->renderer()->config()->fontMetrics( )->height() > QApplication::desktop()->height() )
+ y -= (m_completionPopup->height() );
+ else
+ y += m_view->renderer()->config()->fontMetrics( )->height();
+
+ if (x + m_completionPopup->width() > QApplication::desktop()->width())
+ x = QApplication::desktop()->width() - m_completionPopup->width();
+
+ m_completionPopup->move( QPoint(x,y) );
+
+ m_completionListBox->setCurrentItem( 0 );
+ m_completionListBox->setSelected( 0, true );
+ m_completionListBox->setFocus();
+ m_completionPopup->show();
+
+ QTimer::singleShot(0,this,SLOT(showComment()));
+}
+
+void KateCodeCompletion::showArgHint ( QStringList functionList, const QString& strWrapping, const QString& strDelimiter )
+{
+ unsigned int line, col;
+ m_view->cursorPositionReal( &line, &col );
+ m_pArgHint->reset( line, col );
+ m_pArgHint->setArgMarkInfos( strWrapping, strDelimiter );
+
+ int nNum = 0;
+ QStringList::Iterator end(functionList.end());
+ for( QStringList::Iterator it = functionList.begin(); it != end; ++it )
+ {
+ kdDebug(13035) << "Insert function text: " << *it << endl;
+
+ m_pArgHint->addFunction( nNum, ( *it ) );
+
+ nNum++;
+ }
+
+ m_pArgHint->move(m_view->mapToGlobal(m_view->cursorCoordinates() + QPoint(0,m_view->renderer()->config()->fontMetrics( )->height())) );
+ m_pArgHint->show();
+}
+
+void KateCodeCompletion::slotCursorPosChanged()
+{
+ m_pArgHint->cursorPositionChanged ( m_view, m_view->cursorLine(), m_view->cursorColumnReal() );
+}
+
+void KateCodeCompletion::showComment()
+{
+ if (!m_completionPopup->isVisible())
+ return;
+
+ KateCompletionItem* item = static_cast<KateCompletionItem*>(m_completionListBox->item(m_completionListBox->currentItem()));
+
+ if( !item )
+ return;
+
+ if( item->m_entry.comment.isEmpty() )
+ return;
+
+ delete m_commentLabel;
+ m_commentLabel = new KateCodeCompletionCommentLabel( 0, item->m_entry.comment );
+ m_commentLabel->setFont(QToolTip::font());
+ m_commentLabel->setPalette(QToolTip::palette());
+
+ QPoint rightPoint = m_completionPopup->mapToGlobal(QPoint(m_completionPopup->width(),0));
+ QPoint leftPoint = m_completionPopup->mapToGlobal(QPoint(0,0));
+ QRect screen = QApplication::desktop()->screenGeometry ( m_commentLabel );
+ QPoint finalPoint;
+ if (rightPoint.x()+m_commentLabel->width() > screen.x() + screen.width())
+ finalPoint.setX(leftPoint.x()-m_commentLabel->width());
+ else
+ finalPoint.setX(rightPoint.x());
+
+ m_completionListBox->ensureCurrentVisible();
+
+ finalPoint.setY(
+ m_completionListBox->viewport()->mapToGlobal(m_completionListBox->itemRect(
+ m_completionListBox->item(m_completionListBox->currentItem())).topLeft()).y());
+
+ m_commentLabel->move(finalPoint);
+ m_commentLabel->show();
+}
+
+KateArgHint::KateArgHint( KateView* parent, const char* name )
+ : QFrame( parent, name, WType_Popup )
+{
+ setBackgroundColor( black );
+ setPaletteForegroundColor( Qt::black );
+
+ labelDict.setAutoDelete( true );
+ layout = new QVBoxLayout( this, 1, 2 );
+ layout->setAutoAdd( true );
+ editorView = parent;
+
+ m_markCurrentFunction = true;
+
+ setFocusPolicy( StrongFocus );
+ setFocusProxy( parent );
+
+ reset( -1, -1 );
+}
+
+KateArgHint::~KateArgHint()
+{
+}
+
+void KateArgHint::setArgMarkInfos( const QString& wrapping, const QString& delimiter )
+{
+ m_wrapping = wrapping;
+ m_delimiter = delimiter;
+ m_markCurrentFunction = true;
+}
+
+void KateArgHint::reset( int line, int col )
+{
+ m_functionMap.clear();
+ m_currentFunction = -1;
+ labelDict.clear();
+
+ m_currentLine = line;
+ m_currentCol = col - 1;
+}
+
+void KateArgHint::slotDone(bool completed)
+{
+ hide();
+
+ m_currentLine = m_currentCol = -1;
+
+ emit argHintHidden();
+ if (completed)
+ emit argHintCompleted();
+ else
+ emit argHintAborted();
+}
+
+void KateArgHint::cursorPositionChanged( KateView* view, int line, int col )
+{
+ if( m_currentCol == -1 || m_currentLine == -1 ){
+ slotDone(false);
+ return;
+ }
+
+ int nCountDelimiter = 0;
+ int count = 0;
+
+ QString currentTextLine = view->doc()->textLine( line );
+ QString text = currentTextLine.mid( m_currentCol, col - m_currentCol );
+ QRegExp strconst_rx( "\"[^\"]*\"" );
+ QRegExp chrconst_rx( "'[^']*'" );
+
+ text = text
+ .replace( strconst_rx, "\"\"" )
+ .replace( chrconst_rx, "''" );
+
+ int index = 0;
+ while( index < (int)text.length() ){
+ if( text[index] == m_wrapping[0] ){
+ ++count;
+ } else if( text[index] == m_wrapping[1] ){
+ --count;
+ } else if( count > 0 && text[index] == m_delimiter[0] ){
+ ++nCountDelimiter;
+ }
+ ++index;
+ }
+
+ if( (m_currentLine > 0 && m_currentLine != line) || (m_currentLine < col) || (count == 0) ){
+ slotDone(count == 0);
+ return;
+ }
+
+ // setCurArg ( nCountDelimiter + 1 );
+
+}
+
+void KateArgHint::addFunction( int id, const QString& prot )
+{
+ m_functionMap[ id ] = prot;
+ QLabel* label = new QLabel( prot.stripWhiteSpace().simplifyWhiteSpace(), this );
+ label->setBackgroundColor( QColor(255, 255, 238) );
+ label->show();
+ labelDict.insert( id, label );
+
+ if( m_currentFunction < 0 )
+ setCurrentFunction( id );
+}
+
+void KateArgHint::setCurrentFunction( int currentFunction )
+{
+ if( m_currentFunction != currentFunction ){
+
+ if( currentFunction < 0 )
+ currentFunction = (int)m_functionMap.size() - 1;
+
+ if( currentFunction > (int)m_functionMap.size()-1 )
+ currentFunction = 0;
+
+ if( m_markCurrentFunction && m_currentFunction >= 0 ){
+ QLabel* label = labelDict[ m_currentFunction ];
+ label->setFont( font() );
+ }
+
+ m_currentFunction = currentFunction;
+
+ if( m_markCurrentFunction ){
+ QLabel* label = labelDict[ currentFunction ];
+ QFont fnt( font() );
+ fnt.setBold( true );
+ label->setFont( fnt );
+ }
+
+ adjustSize();
+ }
+}
+
+void KateArgHint::show()
+{
+ QFrame::show();
+ adjustSize();
+}
+
+bool KateArgHint::eventFilter( QObject*, QEvent* e )
+{
+ if( isVisible() && e->type() == QEvent::KeyPress ){
+ QKeyEvent* ke = static_cast<QKeyEvent*>( e );
+ if( (ke->state() & ControlButton) && ke->key() == Key_Left ){
+ setCurrentFunction( currentFunction() - 1 );
+ ke->accept();
+ return true;
+ } else if( ke->key() == Key_Escape ){
+ slotDone(false);
+ return false;
+ } else if( (ke->state() & ControlButton) && ke->key() == Key_Right ){
+ setCurrentFunction( currentFunction() + 1 );
+ ke->accept();
+ return true;
+ }
+ }
+
+ return false;
+}
+
+void KateArgHint::adjustSize( )
+{
+ QRect screen = QApplication::desktop()->screenGeometry( pos() );
+
+ QFrame::adjustSize();
+ if( width() > screen.width() )
+ resize( screen.width(), height() );
+
+ if( x() + width() > screen.x() + screen.width() )
+ move( screen.x() + screen.width() - width(), y() );
+}
+
+// kate: space-indent on; indent-width 2; replace-tabs on;
diff --git a/kate/part/katecodecompletion.h b/kate/part/katecodecompletion.h
new file mode 100644
index 000000000..81279d929
--- /dev/null
+++ b/kate/part/katecodecompletion.h
@@ -0,0 +1,164 @@
+/* This file is part of the KDE libraries
+
+ Copyright (C) 2001 Joseph Wenninger <jowenn@kde.org>
+ Copyright (C) 2002 John Firebaugh <jfirebaugh@kde.org>
+ Copyright (C) 2001 by Victor Röder <Victor_Roeder@GMX.de>
+ Copyright (C) 2002 by Roberto Raggi <roberto@kdevelop.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+/******** Partly based on the ArgHintWidget of Qt3 by Trolltech AS *********/
+/* Trolltech doesn't mind, if we license that piece of code as LGPL, because there isn't much
+ * left from the desigener code */
+
+
+#ifndef __KateCodeCompletion_H__
+#define __KateCodeCompletion_H__
+
+#include <ktexteditor/codecompletioninterface.h>
+
+#include <qvaluelist.h>
+#include <qstringlist.h>
+#include <qlabel.h>
+#include <qframe.h>
+#include <qmap.h>
+#include <qintdict.h>
+
+class KateView;
+class KateArgHint;
+class KateCCListBox;
+
+class QLayout;
+class QVBox;
+
+class KateCodeCompletionCommentLabel : public QLabel
+{
+ Q_OBJECT
+
+ public:
+ KateCodeCompletionCommentLabel( QWidget* parent, const QString& text) : QLabel( parent, "toolTipTip",
+ WStyle_StaysOnTop | WStyle_Customize | WStyle_NoBorder | WStyle_Tool | WX11BypassWM )
+ {
+ setMargin(1);
+ setIndent(0);
+ setAutoMask( false );
+ setFrameStyle( QFrame::Plain | QFrame::Box );
+ setLineWidth( 1 );
+ setAlignment( AlignAuto | AlignTop );
+ polish();
+ setText(text);
+ adjustSize();
+ }
+};
+
+class KateCodeCompletion : public QObject
+{
+ Q_OBJECT
+
+ friend class KateViewInternal;
+
+ public:
+ KateCodeCompletion(KateView *view);
+ ~KateCodeCompletion();
+
+ bool codeCompletionVisible ();
+
+ void showArgHint(
+ QStringList functionList, const QString& strWrapping, const QString& strDelimiter );
+ void showCompletionBox(
+ QValueList<KTextEditor::CompletionEntry> entries, int offset = 0, bool casesensitive = true );
+ bool eventFilter( QObject* o, QEvent* e );
+
+ void handleKey (QKeyEvent *e);
+
+ public slots:
+ void slotCursorPosChanged();
+ void showComment();
+ void updateBox () { updateBox(false); }
+
+ signals:
+ void completionAborted();
+ void completionDone();
+ void argHintHidden();
+ void completionDone(KTextEditor::CompletionEntry);
+ void filterInsertString(KTextEditor::CompletionEntry*,QString *);
+
+ private:
+ void doComplete();
+ void abortCompletion();
+ void complete( KTextEditor::CompletionEntry );
+ void updateBox( bool newCoordinate );
+
+ KateArgHint* m_pArgHint;
+ KateView* m_view;
+ QVBox* m_completionPopup;
+ KateCCListBox* m_completionListBox;
+ QValueList<KTextEditor::CompletionEntry> m_complList;
+ uint m_lineCursor;
+ uint m_colCursor;
+ int m_offset;
+ bool m_caseSensitive;
+ KateCodeCompletionCommentLabel* m_commentLabel;
+};
+
+class KateArgHint: public QFrame
+{
+ Q_OBJECT
+
+ public:
+ KateArgHint( KateView* =0, const char* =0 );
+ virtual ~KateArgHint();
+
+ virtual void setCurrentFunction( int );
+ virtual int currentFunction() const { return m_currentFunction; }
+
+ void setArgMarkInfos( const QString&, const QString& );
+
+ virtual void addFunction( int, const QString& );
+ QString functionAt( int id ) const { return m_functionMap[ id ]; }
+
+ virtual void show();
+ virtual void adjustSize();
+ virtual bool eventFilter( QObject*, QEvent* );
+
+ signals:
+ void argHintHidden();
+ void argHintCompleted();
+ void argHintAborted();
+
+ public slots:
+ virtual void reset( int, int );
+ virtual void cursorPositionChanged( KateView*, int, int );
+
+ private slots:
+ void slotDone(bool completed);
+
+ private:
+ QMap<int, QString> m_functionMap;
+ int m_currentFunction;
+ QString m_wrapping;
+ QString m_delimiter;
+ bool m_markCurrentFunction;
+ int m_currentLine;
+ int m_currentCol;
+ KateView* editorView;
+ QIntDict<QLabel> labelDict;
+ QLayout* layout;
+};
+
+#endif
+
+// kate: space-indent on; indent-width 2; replace-tabs on;
diff --git a/kate/part/katecodefoldinghelpers.cpp b/kate/part/katecodefoldinghelpers.cpp
new file mode 100644
index 000000000..49090820b
--- /dev/null
+++ b/kate/part/katecodefoldinghelpers.cpp
@@ -0,0 +1,1662 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2002 Joseph Wenninger <jowenn@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "katecodefoldinghelpers.h"
+#include "katecodefoldinghelpers.moc"
+
+#include "katebuffer.h"
+#include "katecursor.h"
+#include <kdebug.h>
+
+#include <qstring.h>
+
+#define JW_DEBUG 0
+
+bool KateCodeFoldingTree::trueVal = true;
+
+KateCodeFoldingNode::KateCodeFoldingNode() :
+ parentNode(0),
+ startLineRel(0),
+ endLineRel(0),
+ startCol(0),
+ endCol(0),
+ startLineValid(false),
+ endLineValid(false),
+ type(0),
+ visible(true),
+ deleteOpening(false),
+ deleteEnding(false)
+{
+}//the endline fields should be initialised to not valid
+
+KateCodeFoldingNode::KateCodeFoldingNode(KateCodeFoldingNode *par, signed char typ, unsigned int sLRel):
+ parentNode(par),
+ startLineRel(sLRel),
+ endLineRel(10000),
+ startCol(0),
+ endCol(0),
+ startLineValid(true),
+ endLineValid(false),
+ type(typ),
+ visible(true),
+ deleteOpening(false),
+ deleteEnding(false)
+{
+}//the endline fields should be initialised to not valid
+
+KateCodeFoldingNode::~KateCodeFoldingNode()
+{
+ // delete all child nodes
+ clearChildren ();
+}
+
+bool KateCodeFoldingNode::getBegin(KateCodeFoldingTree *tree, KateTextCursor* begin) {
+ if (!startLineValid) return false;
+ unsigned int line=startLineRel;
+ for (KateCodeFoldingNode *n=parentNode;n;n=n->parentNode)
+ line+=n->startLineRel;
+
+ tree->m_buffer->codeFoldingColumnUpdate(line);
+ begin->setLine(line);
+ begin->setCol(startCol);
+
+ return true;
+}
+
+bool KateCodeFoldingNode::getEnd(KateCodeFoldingTree *tree, KateTextCursor *end) {
+ if (!endLineValid) return false;
+ unsigned int line=startLineRel+endLineRel;
+ for (KateCodeFoldingNode *n=parentNode;n;n=n->parentNode)
+ line+=n->startLineRel;
+
+ tree->m_buffer->codeFoldingColumnUpdate(line);
+ end->setLine(line);
+ end->setCol(endCol);
+
+ return true;
+}
+
+int KateCodeFoldingNode::cmpPos(KateCodeFoldingTree *tree, uint line,uint col) {
+ KateTextCursor cur(line,col);
+ KateTextCursor start,end;
+ kdDebug(13000)<<"KateCodeFoldingNode::cmpPos (1)"<<endl;
+ bool startValid=getBegin(tree, &start);
+ kdDebug(13000)<<"KateCodeFoldingNode::cmpPos (2)"<<endl;
+ bool endValid=getEnd(tree, &end);
+ kdDebug(13000)<<"KateCodeFoldingNode::cmpPos (3)"<<endl;
+ if ((!endValid) && startValid) {
+ return ((start>cur)?-1:0);
+ }
+ if ((!startValid) && endValid) {
+ return ((cur>end)?1:0);
+ }
+ //here both have to be valid, both invalid must not happen
+ Q_ASSERT(startValid && endValid);
+ return ( (cur<start)?(-1):( (cur>end) ? 1:0));
+}
+
+void KateCodeFoldingNode::insertChild (uint index, KateCodeFoldingNode *node)
+{
+ uint s = m_children.size ();
+
+ if (index > s)
+ return;
+
+ m_children.resize (++s);
+
+ for (uint i=s-1; i > index; --i)
+ m_children[i] = m_children[i-1];
+
+ m_children[index] = node;
+}
+
+KateCodeFoldingNode *KateCodeFoldingNode::takeChild (uint index)
+{
+ uint s = m_children.size ();
+
+ if (index >= s)
+ return 0;
+
+ KateCodeFoldingNode *n = m_children[index];
+
+ for (uint i=index; (i+1) < s; ++i)
+ m_children[i] = m_children[i+1];
+
+ m_children.resize (s-1);
+
+ return n;
+}
+
+void KateCodeFoldingNode::clearChildren ()
+{
+ for (uint i=0; i < m_children.size(); ++i)
+ delete m_children[i];
+
+ m_children.resize (0);
+}
+
+KateCodeFoldingTree::KateCodeFoldingTree(KateBuffer *buffer): QObject(buffer), m_buffer (buffer)
+{
+ clear();
+}
+
+void KateCodeFoldingTree::fixRoot(int endLRel)
+{
+ m_root.endLineRel = endLRel;
+}
+
+void KateCodeFoldingTree::clear()
+{
+ m_root.clearChildren();
+
+ // initialize the root "special" node
+ m_root.startLineValid=true;
+ m_root.endLineValid=true; // temporary, should be false;
+ m_root.endLineRel=1; // temporary;
+
+ hiddenLinesCountCacheValid=false;
+ lineMapping.setAutoDelete(true);
+ hiddenLines.clear();
+ lineMapping.clear();
+ nodesForLine.clear();
+ markedForDeleting.clear();
+ dontIgnoreUnchangedLines.clear();
+}
+
+KateCodeFoldingTree::~KateCodeFoldingTree()
+{
+}
+
+bool KateCodeFoldingTree::isTopLevel(unsigned int line)
+{
+ if (m_root.noChildren())
+ return true; // no childs
+
+ // look if a given lines belongs to a sub node
+ for ( uint i=0; i < m_root.childCount(); ++i )
+ {
+ KateCodeFoldingNode *node = m_root.child(i);
+
+ if ((node->startLineRel<=line) && (line<=node->startLineRel+node->endLineRel))
+ return false; // the line is within the range of a subnode -> return toplevel=false
+ }
+
+ return true; // the root node is the only node containing the given line, return toplevel=true
+}
+
+void KateCodeFoldingTree::getLineInfo(KateLineInfo *info, unsigned int line)
+{
+ // Initialze the returned structure, this will also be returned if the root node has no child nodes
+ // or the line is not within a childnode's range.
+ info->topLevel = true;
+ info->startsVisibleBlock = false;
+ info->startsInVisibleBlock = false;
+ info->endsBlock = false;
+ info->invalidBlockEnd = false;
+
+ if (m_root.noChildren())
+ return;
+
+ //let's look for some information
+ for ( uint i=0; i < m_root.childCount(); ++i )
+ {
+ KateCodeFoldingNode *node = m_root.child(i);
+
+ if ((node->startLineRel<=line) && (line<=node->startLineRel+node->endLineRel)) // we found a node, which contains the given line -> do a complete lookup
+ {
+ info->topLevel = false; //we are definitly not toplevel
+ findAllNodesOpenedOrClosedAt(line); //lookup all nodes, which start or and at the given line
+
+ for ( KateCodeFoldingNode *node = nodesForLine.first(); node; node = nodesForLine.next() )
+ {
+ uint startLine = getStartLine(node);
+
+ // type<0 means, that a region has been closed, but not opened
+ // eg. parantheses missmatch
+ if (node->type < 0)
+ info->invalidBlockEnd=true;
+ else
+ {
+ if (startLine != line) // does the region we look at not start at the given line
+ info->endsBlock = true; // than it has to be an ending
+ else
+ {
+ // The line starts a new region, now determine, if it's a visible or a hidden region
+ if (node->visible)
+ info->startsVisibleBlock=true;
+ else
+ info->startsInVisibleBlock=true;
+ }
+ }
+ }
+
+ return;
+ }
+ }
+
+ return;
+}
+
+
+KateCodeFoldingNode *KateCodeFoldingTree::findNodeForLine(unsigned int line)
+{
+ if (m_root.noChildren()) // does we have child list + nodes ?
+ return &m_root;
+
+ // lets look, if given line is within a subnode range, and then return the deepest one.
+ for ( uint i=0; i < m_root.childCount(); ++i )
+ {
+ KateCodeFoldingNode *node = m_root.child(i);
+
+ if ((node->startLineRel<=line) && (line<=node->startLineRel+node->endLineRel))
+ {
+ // a region surounds the line, look in the next deeper hierarchy step
+ return findNodeForLineDescending(node,line,0);
+ }
+ }
+
+ return &m_root;
+}
+
+
+KateCodeFoldingNode *KateCodeFoldingTree::findNodeForLineDescending ( KateCodeFoldingNode *node,
+ unsigned int line, unsigned int offset, bool oneStepOnly )
+{
+ if (node->noChildren())
+ return node;
+
+ // calculate the offset, between a subnodes real start line and its relative start
+ offset += node->startLineRel;
+
+ for ( uint i=0; i < node->childCount(); ++i )
+ {
+ KateCodeFoldingNode *subNode = node->child(i);
+
+ if ((subNode->startLineRel+offset<=line) && (line<=subNode->endLineRel+subNode->startLineRel+offset)) //warning fix me for invalid ends
+ {
+ // a subnode contains the line.
+ // if oneStepOnly is true, we don't want to search for the deepest node, just return the found one
+
+ if (oneStepOnly)
+ return subNode;
+ else
+ return findNodeForLineDescending (subNode,line,offset); // look into the next deeper hierarchy step
+ }
+ }
+
+ return node; // the current node has no sub nodes, or the line couldn'te be found within a subregion
+}
+
+KateCodeFoldingNode *KateCodeFoldingTree::findNodeForPosition(unsigned int line, unsigned int column)
+{
+ KateCodeFoldingNode *node=findNodeForLine(line);
+
+ if (node==&m_root) return &m_root;
+
+ kdDebug(13000)<<"initial cmpPos"<<endl;
+
+ KateCodeFoldingNode *tmp;
+ int leq=node->cmpPos(this, line,column);
+ while (true) {
+ switch (leq) {
+ case 0: {
+ if (node->noChildren())
+ return node;
+ else
+ {
+ tmp=node;
+ for ( uint i=0; i < node->childCount(); ++i )
+ {
+ KateCodeFoldingNode *subNode = node->child(i);
+ kdDebug(13000)<<"cmdPos(case0):calling"<<endl;
+ leq=subNode->cmpPos(this, line,column);
+ kdDebug(13000)<<"cmdPos(case0):returned"<<endl;
+ if (leq==0) {
+ tmp=subNode;
+ break;
+ } else if (leq==-1) break;
+ }
+ if (tmp!=node) node=tmp; else return node;
+ }
+ break;
+ }
+ //this could be optimized a littlebit
+ case -1:
+ case 1: {
+ if (!(node->parentNode)) return &m_root;
+ kdDebug(13000)<<"current node type"<<node->type<<endl;
+ node=node->parentNode;
+ kdDebug(13000)<<"cmdPos(case-1/1):calling:"<<node<<endl;
+ leq=node->cmpPos(this, line,column);
+ kdDebug(13000)<<"cmdPos(case-1/1):returned"<<endl;
+ break;
+ }
+ }
+
+ }
+ Q_ASSERT(false);
+ return &m_root;
+}
+
+void KateCodeFoldingTree::debugDump()
+{
+ //dump all nodes for debugging
+ kdDebug(13000)<<"The parsed region/block tree for code folding"<<endl;
+ dumpNode(&m_root, "");
+}
+
+void KateCodeFoldingTree::dumpNode(KateCodeFoldingNode *node, const QString &prefix)
+{
+ //output node properties
+ kdDebug(13000)<<prefix<<QString("Type: %1, startLineValid %2, startLineRel %3, endLineValid %4, endLineRel %5, visible %6").
+ arg(node->type).arg(node->startLineValid).arg(node->startLineRel).arg(node->endLineValid).
+ arg(node->endLineRel).arg(node->visible)<<endl;
+
+ //output child node properties recursive
+ if (node->noChildren())
+ return;
+
+ QString newprefix(prefix + " ");
+ for ( uint i=0; i < node->childCount(); ++i )
+ dumpNode (node->child(i),newprefix);
+}
+
+/*
+ That's one of the most important functions ;)
+*/
+void KateCodeFoldingTree::updateLine(unsigned int line,
+ QMemArray<uint> *regionChanges, bool *updated,bool changed,bool colsChanged)
+{
+ if ( (!changed) || colsChanged)
+ {
+ if (dontIgnoreUnchangedLines.isEmpty())
+ return;
+
+ if (dontIgnoreUnchangedLines[line])
+ dontIgnoreUnchangedLines.remove(line);
+ else
+ return;
+ }
+
+ something_changed = false;
+
+ findAndMarkAllNodesforRemovalOpenedOrClosedAt(line);
+
+ if (regionChanges->isEmpty())
+ {
+ // KateCodeFoldingNode *node=findNodeForLine(line);
+ // if (node->type!=0)
+ // if (getStartLine(node)+node->endLineRel==line) removeEnding(node,line);
+ }
+ else
+ {
+ for (unsigned int i=0;i<regionChanges->size() / 4;i++)
+ {
+ signed char tmp=(*regionChanges)[regionChanges->size()-2-i*2];
+ uint tmppos=(*regionChanges)[regionChanges->size()-1-i*2];
+ (*regionChanges)[regionChanges->size()-2-i*2]=(*regionChanges)[i*2];
+ (*regionChanges)[regionChanges->size()-1-i*2]=(*regionChanges)[i*2+1];
+ (*regionChanges)[i*2]=tmp;
+ (*regionChanges)[i*2+1]=tmppos;
+ }
+
+
+ signed char data= (*regionChanges)[regionChanges->size()-2];
+ uint charPos=(*regionChanges)[regionChanges->size()-1];
+ regionChanges->resize (regionChanges->size()-2);
+
+ int insertPos=-1;
+ KateCodeFoldingNode *node = findNodeForLine(line);
+
+ if (data<0)
+ {
+ // if (insertPos==-1)
+ {
+ unsigned int tmpLine=line-getStartLine(node);
+
+ for ( uint i=0; i < node->childCount(); ++i )
+ {
+ if (node->child(i)->startLineRel >= tmpLine)
+ {
+ insertPos=i;
+ break;
+ }
+ }
+ }
+ }
+ else
+ {
+ for (; (node->parentNode) && (getStartLine(node->parentNode)==line) && (node->parentNode->type!=0); node=node->parentNode);
+
+ if ((getStartLine(node)==line) && (node->type!=0))
+ {
+ insertPos=node->parentNode->findChild(node);
+ node = node->parentNode;
+ }
+ else
+ {
+ for ( uint i=0; i < node->childCount(); ++i )
+ {
+ if (getStartLine(node->child(i))>=line)
+ {
+ insertPos=i;
+ break;
+ }
+ }
+ }
+ }
+
+ do
+ {
+ if (data<0)
+ {
+ if (correctEndings(data,node,line,charPos,insertPos))
+ {
+ insertPos=node->parentNode->findChild(node)+1;
+ node=node->parentNode;
+ }
+ else
+ {
+ if (insertPos!=-1) insertPos++;
+ }
+ }
+ else
+ {
+ int startLine=getStartLine(node);
+ if ((insertPos==-1) || (insertPos>=(int)node->childCount()))
+ {
+ KateCodeFoldingNode *newNode = new KateCodeFoldingNode (node,data,line-startLine);
+ something_changed = true;
+ node->appendChild(newNode);
+ addOpening(newNode, data, regionChanges, line,charPos);
+ insertPos = node->findChild(newNode)+1;
+ }
+ else
+ {
+ if (node->child(insertPos)->startLineRel == line-startLine)
+ {
+ addOpening(node->child(insertPos), data, regionChanges, line,charPos);
+ insertPos++;
+ }
+ else
+ {
+// kdDebug(13000)<<"ADDING NODE "<<endl;
+ KateCodeFoldingNode *newNode = new KateCodeFoldingNode (node,data,line-startLine);
+ something_changed = true;
+ node->insertChild(insertPos, newNode);
+ addOpening(newNode, data, regionChanges, line,charPos);
+ insertPos++;
+ }
+ }
+ }
+
+ if (regionChanges->isEmpty())
+ data = 0;
+ else
+ {
+ data = (*regionChanges)[regionChanges->size()-2];
+ charPos=(*regionChanges)[regionChanges->size()-1];
+ regionChanges->resize (regionChanges->size()-2);
+ }
+ } while (data!=0);
+ }
+
+ cleanupUnneededNodes(line);
+// if (something_changed) emit regionBeginEndAddedRemoved(line);
+ (*updated) = something_changed;
+}
+
+
+bool KateCodeFoldingTree::removeOpening(KateCodeFoldingNode *node,unsigned int line)
+{
+ signed char type;
+ if ((type=node->type) == 0)
+ {
+ dontDeleteOpening(node);
+ dontDeleteEnding(node);
+ return false;
+ }
+
+ if (!node->visible)
+ {
+ toggleRegionVisibility(getStartLine(node));
+ }
+
+ KateCodeFoldingNode *parent = node->parentNode;
+ int mypos = parent->findChild(node);
+
+ if (mypos > -1)
+ {
+ //move childnodes() up
+ for(; node->childCount()>0 ;)
+ {
+ KateCodeFoldingNode *tmp;
+ parent->insertChild(mypos, tmp=node->takeChild(0));
+ tmp->parentNode = parent;
+ tmp->startLineRel += node->startLineRel;
+ mypos++;
+ }
+
+ // remove the node
+ //mypos = parent->findChild(node);
+ bool endLineValid = node->endLineValid;
+ int endLineRel = node->endLineRel;
+ uint endCol=node->endCol;
+
+ // removes + deletes
+ KateCodeFoldingNode *child = parent->takeChild(mypos);
+ markedForDeleting.removeRef(child);
+ delete child;
+
+ if ((type>0) && (endLineValid))
+ correctEndings(-type, parent, line+endLineRel/*+1*/,endCol, mypos); // why the hell did I add a +1 here ?
+ }
+
+ return true;
+}
+
+bool KateCodeFoldingTree::removeEnding(KateCodeFoldingNode *node,unsigned int /* line */)
+{
+ KateCodeFoldingNode *parent = node->parentNode;
+
+ if (!parent)
+ return false;
+
+ if (node->type == 0)
+ return false;
+
+ if (node->type < 0)
+ {
+ // removes + deletes
+ int i = parent->findChild (node);
+ if (i >= 0)
+ {
+ KateCodeFoldingNode *child = parent->takeChild(i);
+ markedForDeleting.removeRef(child);
+ delete child;
+ }
+
+ return true;
+ }
+
+ int mypos = parent->findChild(node);
+ int count = parent->childCount();
+
+ for (int i=mypos+1; i<count; i++)
+ {
+ if (parent->child(i)->type == -node->type)
+ {
+ node->endLineValid = true;
+ node->endLineRel = parent->child(i)->startLineRel - node->startLineRel;
+
+ KateCodeFoldingNode *child = parent->takeChild(i);
+ markedForDeleting.removeRef(child);
+ delete child;
+
+ count = i-mypos-1;
+ if (count > 0)
+ {
+ for (int i=0; i<count; i++)
+ {
+ KateCodeFoldingNode *tmp = parent->takeChild(mypos+1);
+ tmp->startLineRel -= node->startLineRel;
+ tmp->parentNode = node; //should help 16.04.2002
+ node->appendChild(tmp);
+ }
+ }
+ return false;
+ }
+ }
+
+ if ( (parent->type == node->type) || /*temporary fix */ (!parent->parentNode))
+ {
+ for (int i=mypos+1; i<(int)parent->childCount(); i++)
+ {
+ KateCodeFoldingNode *tmp = parent->takeChild(mypos+1);
+ tmp->startLineRel -= node->startLineRel;
+ tmp->parentNode = node; // SHOULD HELP 16.04.2002
+ node->appendChild(tmp);
+ }
+
+ // this should fix the bug of wrongly closed nodes
+ if (!parent->parentNode)
+ node->endLineValid=false;
+ else
+ node->endLineValid = parent->endLineValid;
+
+ node->endLineRel = parent->endLineRel-node->startLineRel;
+
+ if (node->endLineValid)
+ return removeEnding(parent, getStartLine(parent)+parent->endLineRel);
+
+ return false;
+ }
+
+ node->endLineValid = false;
+ node->endLineRel = parent->endLineRel - node->startLineRel;
+
+ return false;
+}
+
+
+bool KateCodeFoldingTree::correctEndings(signed char data, KateCodeFoldingNode *node,unsigned int line,unsigned int endCol,int insertPos)
+{
+// if (node->type==0) {kdError()<<"correct Ending should never be called with the root node"<<endl; return true;}
+ uint startLine = getStartLine(node);
+ if (data != -node->type)
+ {
+#if JW_DEBUG
+ kdDebug(13000)<<"data!=-node->type (correctEndings)"<<endl;
+#endif
+ //invalid close -> add to unopend list
+ dontDeleteEnding(node);
+ if (data == node->type) {
+ node->endCol=endCol;
+ return false;
+ }
+ KateCodeFoldingNode *newNode = new KateCodeFoldingNode (node,data,line-startLine);
+ something_changed = true;
+ newNode->startLineValid = false;
+ newNode->endLineValid = true;
+ newNode->endLineRel = 0;
+ newNode->endCol=endCol;
+
+ if ((insertPos==-1) || (insertPos==(int)node->childCount()))
+ node->appendChild(newNode);
+ else
+ node->insertChild(insertPos,newNode);
+
+ // find correct position
+ return false;
+ }
+ else
+ {
+ something_changed = true;
+ dontDeleteEnding(node);
+
+ // valid closing region
+ if (!node->endLineValid)
+ {
+ node->endLineValid = true;
+ node->endLineRel = line - startLine;
+ node->endCol=endCol;
+ //moving
+
+ moveSubNodesUp(node);
+ }
+ else
+ {
+#if JW_DEBUG
+ kdDebug(13000)<<"Closing a node which had already a valid end"<<endl;
+#endif
+ // block has already an ending
+ if (startLine+node->endLineRel == line)
+ {
+ node->endCol=endCol;
+ // we won, just skip
+#if JW_DEBUG
+ kdDebug(13000)<< "We won, just skipping (correctEndings)"<<endl;
+#endif
+ }
+ else
+ {
+ int bakEndLine = node->endLineRel+startLine;
+ uint bakEndCol = node->endCol;
+ node->endLineRel = line-startLine;
+ node->endCol=endCol;
+
+#if JW_DEBUG
+ kdDebug(13000)<< "reclosed node had childnodes()"<<endl;
+ kdDebug(13000)<<"It could be, that childnodes() need to be moved up"<<endl;
+#endif
+ moveSubNodesUp(node);
+
+ if (node->parentNode)
+ {
+ correctEndings(data,node->parentNode,bakEndLine, bakEndCol,node->parentNode->findChild(node)+1); // ????
+ }
+ else
+ {
+ //add to unopened list (bakEndLine)
+ }
+ }
+ }
+ }
+ return true;
+}
+
+void KateCodeFoldingTree::moveSubNodesUp(KateCodeFoldingNode *node)
+{
+ int mypos = node->parentNode->findChild(node);
+ int removepos=-1;
+ int count = node->childCount();
+ for (int i=0; i<count; i++)
+ if (node->child(i)->startLineRel >= node->endLineRel)
+ {
+ removepos=i;
+ break;
+ }
+#if JW_DEBUG
+ kdDebug(13000)<<QString("remove pos: %1").arg(removepos)<<endl;
+#endif
+ if (removepos>-1)
+ {
+#if JW_DEBUG
+ kdDebug(13000)<<"Children need to be moved"<<endl;
+#endif
+ KateCodeFoldingNode *moveNode;
+ if (mypos == (int)node->parentNode->childCount()-1)
+ {
+ while (removepos<(int)node->childCount())
+ {
+ node->parentNode->appendChild(moveNode=node->takeChild(removepos));
+ moveNode->parentNode = node->parentNode;
+ moveNode->startLineRel += node->startLineRel;
+ }
+ }
+ else
+ {
+ int insertPos=mypos;
+ while (removepos < (int)node->childCount())
+ {
+ insertPos++;
+ node->parentNode->insertChild(insertPos, moveNode=node->takeChild(removepos));
+ moveNode->parentNode = node->parentNode; // That should solve a crash
+ moveNode->startLineRel += node->startLineRel;
+ }
+ }
+ }
+
+}
+
+
+
+void KateCodeFoldingTree::addOpening(KateCodeFoldingNode *node,signed char nType, QMemArray<uint>* list,unsigned int line,unsigned int charPos)
+{
+ uint startLine = getStartLine(node);
+ if ((startLine==line) && (node->type!=0))
+ {
+#if JW_DEBUG
+ kdDebug(13000)<<"startLine equals line"<<endl;
+#endif
+ if (nType == node->type)
+ {
+#if JW_DEBUG
+ kdDebug(13000)<<"Node exists"<<endl;
+#endif
+ node->deleteOpening = false;
+ node->startCol=charPos;
+ KateCodeFoldingNode *parent = node->parentNode;
+
+ if (!node->endLineValid)
+ {
+ int current = parent->findChild(node);
+ int count = parent->childCount()-(current+1);
+ node->endLineRel = parent->endLineRel - node->startLineRel;
+
+// EXPERIMENTAL TEST BEGIN
+// move this afte the test for unopened, but closed regions within the parent node, or if there are no siblings, bubble up
+ if (parent)
+ if (parent->type == node->type)
+ {
+ if (parent->endLineValid)
+ {
+ removeEnding(parent, line);
+ node->endLineValid = true;
+ }
+ }
+
+// EXPERIMENTAL TEST BEGIN
+
+ if (current != (int)parent->childCount()-1)
+ {
+ //search for an unopened but closed region, even if the parent is of the same type
+#ifdef __GNUC__
+#warning "FIXME: why does this seem to work?"
+#endif
+// if (node->type != parent->type)
+ {
+ for (int i=current+1; i<(int)parent->childCount(); i++)
+ {
+ if (parent->child(i)->type == -node->type)
+ {
+ count = (i-current-1);
+ node->endLineValid = true;
+ node->endLineRel = getStartLine(parent->child(i))-line;
+ node->endCol = parent->child(i)->endCol;
+ KateCodeFoldingNode *child = parent->takeChild(i);
+ markedForDeleting.removeRef( child );
+ delete child;
+ break;
+ }
+ }
+ }
+// else
+// {
+// parent->endLineValid = false;
+// parent->endLineRel = 20000;
+// }
+
+ if (count>0)
+ {
+ for (int i=0;i<count;i++)
+ {
+ KateCodeFoldingNode *tmp;
+ node->appendChild(tmp=parent->takeChild(current+1));
+ tmp->startLineRel -= node->startLineRel;
+ tmp->parentNode = node;
+ }
+ }
+ }
+
+ }
+
+ addOpening_further_iterations(node, nType, list, line, 0, startLine,node->startCol);
+
+ } //else ohoh, much work to do same line, but other region type
+ }
+ else
+ { // create a new region
+ KateCodeFoldingNode *newNode = new KateCodeFoldingNode (node,nType,line-startLine);
+ something_changed = true;
+
+ int insert_position=-1;
+ for (int i=0; i<(int)node->childCount(); i++)
+ {
+ if (startLine+node->child(i)->startLineRel > line)
+ {
+ insert_position=i;
+ break;
+ }
+ }
+
+ int current;
+ if (insert_position==-1)
+ {
+ node->appendChild(newNode);
+ current = node->childCount()-1;
+ }
+ else
+ {
+ node->insertChild(insert_position, newNode);
+ current = insert_position;
+ }
+
+// if (node->type==newNode->type)
+// {
+// newNode->endLineValid=true;
+// node->endLineValid=false;
+// newNode->endLineRel=node->endLineRel-newNode->startLineRel;
+// node->endLineRel=20000; //FIXME
+
+ int count = node->childCount() - (current+1);
+ newNode->endLineRel -= newNode->startLineRel;
+ if (current != (int)node->childCount()-1)
+ {
+ if (node->type != newNode->type)
+ {
+ for (int i=current+1; i<(int)node->childCount(); i++)
+ {
+ if (node->child(i)->type == -newNode->type)
+ {
+ count = node->childCount() - i - 1;
+ newNode->endLineValid = true;
+ newNode->endLineRel = line - getStartLine(node->child(i));
+ KateCodeFoldingNode *child = node->takeChild(i);
+ markedForDeleting.removeRef( child );
+ delete child;
+ break;
+ }
+ }
+ }
+ else
+ {
+ node->endLineValid = false;
+ node->endLineRel = 10000;
+ }
+ if (count > 0)
+ {
+ for (int i=0;i<count;i++)
+ {
+ KateCodeFoldingNode *tmp;
+ newNode->appendChild(tmp=node->takeChild(current+1));
+ tmp->parentNode=newNode;
+ }
+ }
+// }
+ }
+
+ addOpening(newNode, nType, list, line,charPos);
+
+ addOpening_further_iterations(node, node->type, list, line, current, startLine,node->startCol);
+ }
+}
+
+
+void KateCodeFoldingTree::addOpening_further_iterations(KateCodeFoldingNode *node,signed char /* nType */, QMemArray<uint>*
+ list,unsigned int line,int current, unsigned int startLine,unsigned int charPos)
+{
+ while (!(list->isEmpty()))
+ {
+ if (list->isEmpty())
+ return;
+ else
+ {
+ signed char data = (*list)[list->size()-2];
+ uint charPos=(*list)[list->size()-1];
+ list->resize (list->size()-2);
+
+ if (data<0)
+ {
+#if JW_DEBUG
+ kdDebug(13000)<<"An ending was found"<<endl;
+#endif
+
+ if (correctEndings(data,node,line,charPos,-1))
+ return; // -1 ?
+
+#if 0
+ if(data == -nType)
+ {
+ if (node->endLineValid)
+ {
+ if (node->endLineRel+startLine==line) // We've won again
+ {
+ //handle next node;
+ }
+ else
+ { // much moving
+ node->endLineRel=line-startLine;
+ node->endLineValid=true;
+ }
+ return; // next higher level should do the rest
+ }
+ else
+ {
+ node->endLineRel=line-startLine;
+ node->endLineValid=true;
+ //much moving
+ }
+ } //else add to unopened list
+#endif
+ }
+ else
+ {
+ bool needNew = true;
+ if (current < (int)node->childCount())
+ {
+ if (getStartLine(node->child(current)) == line)
+ needNew=false;
+ }
+ if (needNew)
+ {
+ something_changed = true;
+ KateCodeFoldingNode *newNode = new KateCodeFoldingNode(node, data, line-startLine);
+ node->insertChild(current, newNode); //find the correct position later
+ }
+
+ addOpening(node->child(current), data, list, line,charPos);
+ current++;
+ //lookup node or create subnode
+ }
+ }
+ } // end while
+}
+
+unsigned int KateCodeFoldingTree::getStartLine(KateCodeFoldingNode *node)
+{
+ unsigned int lineStart=0;
+ for (KateCodeFoldingNode *iter=node; iter->type != 0; iter=iter->parentNode)
+ lineStart += iter->startLineRel;
+
+ return lineStart;
+}
+
+
+void KateCodeFoldingTree::lineHasBeenRemoved(unsigned int line)
+{
+ lineMapping.clear();
+ dontIgnoreUnchangedLines.insert(line, &trueVal);
+ dontIgnoreUnchangedLines.insert(line-1, &trueVal);
+ dontIgnoreUnchangedLines.insert(line+1, &trueVal);
+ hiddenLinesCountCacheValid = false;
+#if JW_DEBUG
+ kdDebug(13000)<<QString("KateCodeFoldingTree::lineHasBeenRemoved: %1").arg(line)<<endl;
+#endif
+
+//line ++;
+ findAndMarkAllNodesforRemovalOpenedOrClosedAt(line); //It's an ugly solution
+ cleanupUnneededNodes(line); //It's an ugly solution
+
+ KateCodeFoldingNode *node = findNodeForLine(line);
+//????? if (node->endLineValid)
+ {
+ int startLine = getStartLine(node);
+ if (startLine == (int)line)
+ node->startLineRel--;
+ else
+ {
+ if (node->endLineRel == 0)
+ node->endLineValid = false;
+ node->endLineRel--;
+ }
+
+ int count = node->childCount();
+ for (int i=0; i<count; i++)
+ {
+ if (node->child(i)->startLineRel+startLine >= line)
+ node->child(i)->startLineRel--;
+ }
+ }
+
+ if (node->parentNode)
+ decrementBy1(node->parentNode, node);
+
+ for (QValueList<KateHiddenLineBlock>::Iterator it=hiddenLines.begin(); it!=hiddenLines.end(); ++it)
+ {
+ if ((*it).start > line)
+ (*it).start--;
+ else if ((*it).start+(*it).length > line)
+ (*it).length--;
+ }
+}
+
+
+void KateCodeFoldingTree::decrementBy1(KateCodeFoldingNode *node, KateCodeFoldingNode *after)
+{
+ if (node->endLineRel == 0)
+ node->endLineValid = false;
+ node->endLineRel--;
+
+ for (uint i=node->findChild(after)+1; i < node->childCount(); ++i)
+ node->child(i)->startLineRel--;
+
+ if (node->parentNode)
+ decrementBy1(node->parentNode,node);
+}
+
+
+void KateCodeFoldingTree::lineHasBeenInserted(unsigned int line)
+{
+ lineMapping.clear();
+ dontIgnoreUnchangedLines.insert(line, &trueVal);
+ dontIgnoreUnchangedLines.insert(line-1, &trueVal);
+ dontIgnoreUnchangedLines.insert(line+1, &trueVal);
+ hiddenLinesCountCacheValid = false;
+//return;
+#if JW_DEBUG
+ kdDebug(13000)<<QString("KateCodeFoldingTree::lineHasBeenInserted: %1").arg(line)<<endl;
+#endif
+
+// findAndMarkAllNodesforRemovalOpenedOrClosedAt(line);
+// cleanupUnneededNodes(line);
+
+ KateCodeFoldingNode *node = findNodeForLine(line);
+// ???????? if (node->endLineValid)
+ {
+ int startLine=getStartLine(node);
+ if (node->type < 0)
+ node->startLineRel++;
+ else
+ node->endLineRel++;
+
+ for (uint i=0; i < node->childCount(); ++i)
+ {
+ KateCodeFoldingNode *iter = node->child(i);
+
+ if (iter->startLineRel+startLine >= line)
+ iter->startLineRel++;
+ }
+ }
+
+ if (node->parentNode)
+ incrementBy1(node->parentNode, node);
+
+ for (QValueList<KateHiddenLineBlock>::Iterator it=hiddenLines.begin(); it!=hiddenLines.end(); ++it)
+ {
+ if ((*it).start > line)
+ (*it).start++;
+ else if ((*it).start+(*it).length > line)
+ (*it).length++;
+ }
+}
+
+void KateCodeFoldingTree::incrementBy1(KateCodeFoldingNode *node, KateCodeFoldingNode *after)
+{
+ node->endLineRel++;
+
+ for (uint i=node->findChild(after)+1; i < node->childCount(); ++i)
+ node->child(i)->startLineRel++;
+
+ if (node->parentNode)
+ incrementBy1(node->parentNode,node);
+}
+
+
+void KateCodeFoldingTree::findAndMarkAllNodesforRemovalOpenedOrClosedAt(unsigned int line)
+{
+#ifdef __GNUC__
+#warning "FIXME: make this multiple region changes per line save";
+#endif
+// return;
+ markedForDeleting.clear();
+ KateCodeFoldingNode *node = findNodeForLine(line);
+ if (node->type == 0)
+ return;
+
+ addNodeToRemoveList(node, line);
+
+ while (((node->parentNode) && (node->parentNode->type!=0)) && (getStartLine(node->parentNode)==line))
+ {
+ node = node->parentNode;
+ addNodeToRemoveList(node, line);
+ }
+#if JW_DEBUG
+ kdDebug(13000)<<" added line to markedForDeleting list"<<endl;
+#endif
+}
+
+
+void KateCodeFoldingTree::addNodeToRemoveList(KateCodeFoldingNode *node,unsigned int line)
+{
+ bool add=false;
+#ifdef __GNUC__
+#warning "FIXME: make this multiple region changes per line save";
+#endif
+ unsigned int startLine=getStartLine(node);
+ if ((startLine==line) && (node->startLineValid))
+ {
+ add=true;
+ node->deleteOpening = true;
+ }
+ if ((startLine+node->endLineRel==line) || ((node->endLineValid==false) && (node->deleteOpening)))
+ {
+ int myPos=node->parentNode->findChild(node); // this has to be implemented nicely
+ if ((int)node->parentNode->childCount()>myPos+1)
+ addNodeToRemoveList(node->parentNode->child(myPos+1),line);
+ add=true;
+ node->deleteEnding = true;
+ }
+
+ if(add)
+ markedForDeleting.append(node);
+
+}
+
+
+void KateCodeFoldingTree::findAllNodesOpenedOrClosedAt(unsigned int line)
+{
+ nodesForLine.clear();
+ KateCodeFoldingNode *node = findNodeForLine(line);
+ if (node->type == 0)
+ return;
+
+ unsigned int startLine = getStartLine(node);
+ if (startLine == line)
+ nodesForLine.append(node);
+ else if ((startLine+node->endLineRel == line))
+ nodesForLine.append(node);
+
+ while (node->parentNode)
+ {
+ addNodeToFoundList(node->parentNode, line, node->parentNode->findChild(node));
+ node = node->parentNode;
+ }
+#if JW_DEBUG
+ kdDebug(13000)<<" added line to nodesForLine list"<<endl;
+#endif
+}
+
+
+void KateCodeFoldingTree::addNodeToFoundList(KateCodeFoldingNode *node,unsigned int line,int childpos)
+{
+ unsigned int startLine = getStartLine(node);
+
+ if ((startLine==line) && (node->type!=0))
+ nodesForLine.append(node);
+ else if ((startLine+node->endLineRel==line) && (node->type!=0))
+ nodesForLine.append(node);
+
+ for (int i=childpos+1; i<(int)node->childCount(); i++)
+ {
+ KateCodeFoldingNode *child = node->child(i);
+
+ if (startLine+child->startLineRel == line)
+ {
+ nodesForLine.append(child);
+ addNodeToFoundList(child, line, 0);
+ }
+ else
+ break;
+ }
+}
+
+
+void KateCodeFoldingTree::cleanupUnneededNodes(unsigned int line)
+{
+#if JW_DEBUG
+ kdDebug(13000)<<"void KateCodeFoldingTree::cleanupUnneededNodes(unsigned int line)"<<endl;
+#endif
+
+// return;
+ if (markedForDeleting.isEmpty())
+ return;
+
+ for (int i=0; i<(int)markedForDeleting.count(); i++)
+ {
+ KateCodeFoldingNode *node = markedForDeleting.at(i);
+ if (node->deleteOpening)
+ kdDebug(13000)<<"DELETE OPENING SET"<<endl;
+ if (node->deleteEnding)
+ kdDebug(13000)<<"DELETE ENDING SET"<<endl;
+
+ if ((node->deleteOpening) && (node->deleteEnding))
+ {
+#if JW_DEBUG
+ kdDebug(13000)<<"Deleting complete node"<<endl;
+#endif
+ if (node->endLineValid) // just delete it, it has been opened and closed on this line
+ {
+ int f = node->parentNode->findChild (node);
+
+ if (f >= 0)
+ delete node->parentNode->takeChild(f);
+ }
+ else
+ {
+ removeOpening(node, line);
+ // the node has subnodes which need to be moved up and this one has to be deleted
+ }
+ something_changed = true;
+ }
+ else
+ {
+ if ((node->deleteOpening) && (node->startLineValid))
+ {
+#if JW_DEBUG
+ kdDebug(13000)<<"calling removeOpening"<<endl;
+#endif
+ removeOpening(node, line);
+ something_changed = true;
+ }
+ else
+ {
+ dontDeleteOpening(node);
+
+ if ((node->deleteEnding) && (node->endLineValid))
+ {
+ dontDeleteEnding(node);
+ removeEnding(node, line);
+ something_changed = true;
+ }
+ else
+ dontDeleteEnding(node);
+ }
+ }
+ }
+}
+
+void KateCodeFoldingTree::dontDeleteEnding(KateCodeFoldingNode* node)
+{
+ node->deleteEnding = false;
+}
+
+
+void KateCodeFoldingTree::dontDeleteOpening(KateCodeFoldingNode* node)
+{
+ node->deleteOpening = false;
+}
+
+
+void KateCodeFoldingTree::toggleRegionVisibility(unsigned int line)
+{
+ // hl whole file
+ m_buffer->line (m_buffer->count()-1);
+
+ lineMapping.clear();
+ hiddenLinesCountCacheValid = false;
+ kdDebug(13000)<<QString("KateCodeFoldingTree::toggleRegionVisibility() %1").arg(line)<<endl;
+
+ findAllNodesOpenedOrClosedAt(line);
+ for (int i=0; i<(int)nodesForLine.count(); i++)
+ {
+ KateCodeFoldingNode *node=nodesForLine.at(i);
+ if ( (!node->startLineValid) || (getStartLine(node) != line) )
+ {
+ nodesForLine.remove(i);
+ i--;
+ }
+ }
+
+ if (nodesForLine.isEmpty())
+ return;
+
+ nodesForLine.at(0)->visible = !nodesForLine.at(0)->visible;
+
+ if (!nodesForLine.at(0)->visible)
+ addHiddenLineBlock(nodesForLine.at(0),line);
+ else
+ {
+ for (QValueList<KateHiddenLineBlock>::Iterator it=hiddenLines.begin(); it!=hiddenLines.end();++it)
+ if ((*it).start == line+1)
+ {
+ hiddenLines.remove(it);
+ break;
+ }
+
+ updateHiddenSubNodes(nodesForLine.at(0));
+ }
+
+ emit regionVisibilityChangedAt(line);
+}
+
+void KateCodeFoldingTree::updateHiddenSubNodes(KateCodeFoldingNode *node)
+{
+ for (uint i=0; i < node->childCount(); ++i)
+ {
+ KateCodeFoldingNode *iter = node->child(i);
+
+ if (!iter->visible)
+ addHiddenLineBlock(iter, getStartLine(iter));
+ else
+ updateHiddenSubNodes(iter);
+ }
+}
+
+void KateCodeFoldingTree::addHiddenLineBlock(KateCodeFoldingNode *node,unsigned int line)
+{
+ KateHiddenLineBlock data;
+ data.start = line+1;
+ data.length = node->endLineRel-(existsOpeningAtLineAfter(line+node->endLineRel,node)?1:0); // without -1;
+ bool inserted = false;
+
+ for (QValueList<KateHiddenLineBlock>::Iterator it=hiddenLines.begin(); it!=hiddenLines.end(); ++it)
+ {
+ if (((*it).start>=data.start) && ((*it).start<=data.start+data.length-1)) // another hidden block starting at the within this block already exits -> adapt new block
+ {
+ // the existing block can't have lines behind the new one, because a newly hidden
+ // block has to encapsulate already hidden ones
+ it=hiddenLines.remove(it);
+ --it;
+ }
+ else
+ {
+ if ((*it).start > line)
+ {
+ hiddenLines.insert(it, data);
+ inserted = true;
+
+ break;
+ }
+ }
+ }
+
+ if (!inserted)
+ hiddenLines.append(data);
+}
+
+bool KateCodeFoldingTree::existsOpeningAtLineAfter(unsigned int line, KateCodeFoldingNode *node)
+{
+ for(KateCodeFoldingNode *tmp = node->parentNode; tmp; tmp=tmp->parentNode)
+ {
+ KateCodeFoldingNode *tmp2;
+ unsigned int startLine=getStartLine(tmp);
+
+ if ((tmp2 = tmp->child(tmp->findChild(node) + 1))
+ && ((tmp2->startLineRel + startLine) == line))
+ return true;
+
+ if ((startLine + tmp->endLineRel) > line)
+ return false;
+ }
+
+ return false;
+}
+
+
+//
+// get the real line number for a virtual line
+//
+unsigned int KateCodeFoldingTree::getRealLine(unsigned int virtualLine)
+{
+ // he, if nothing is hidden, why look at it ;)
+ if (hiddenLines.isEmpty())
+ return virtualLine;
+
+ // kdDebug(13000)<<QString("VirtualLine %1").arg(virtualLine)<<endl;
+
+ unsigned int *real=lineMapping[virtualLine];
+ if (real)
+ return (*real);
+
+ unsigned int tmp = virtualLine;
+ for (QValueList<KateHiddenLineBlock>::ConstIterator it=hiddenLines.begin();it!=hiddenLines.end();++it)
+ {
+ if ((*it).start<=virtualLine)
+ virtualLine += (*it).length;
+ else
+ break;
+ }
+
+ // kdDebug(13000)<<QString("Real Line %1").arg(virtualLine)<<endl;
+
+ lineMapping.insert(tmp, new unsigned int(virtualLine));
+ return virtualLine;
+}
+
+//
+// get the virtual line number for a real line
+//
+unsigned int KateCodeFoldingTree::getVirtualLine(unsigned int realLine)
+{
+ // he, if nothing is hidden, why look at it ;)
+ if (hiddenLines.isEmpty())
+ return realLine;
+
+ // kdDebug(13000)<<QString("RealLine--> %1").arg(realLine)<<endl;
+
+ for (QValueList<KateHiddenLineBlock>::ConstIterator it=hiddenLines.fromLast(); it!=hiddenLines.end(); --it)
+ {
+ if ((*it).start <= realLine)
+ realLine -= (*it).length;
+ // else
+ // break;
+ }
+
+ // kdDebug(13000)<<QString("-->virtual Line %1").arg(realLine)<<endl;
+
+ return realLine;
+}
+
+//
+// get the number of hidden lines
+//
+unsigned int KateCodeFoldingTree::getHiddenLinesCount(unsigned int doclen)
+{
+ // he, if nothing is hidden, why look at it ;)
+ if (hiddenLines.isEmpty())
+ return 0;
+
+ if (hiddenLinesCountCacheValid)
+ return hiddenLinesCountCache;
+
+ hiddenLinesCountCacheValid = true;
+ hiddenLinesCountCache = 0;
+
+ for (QValueList<KateHiddenLineBlock>::ConstIterator it=hiddenLines.begin(); it!=hiddenLines.end(); ++it)
+ {
+ if ((*it).start+(*it).length<=doclen)
+ hiddenLinesCountCache += (*it).length;
+ else
+ {
+ hiddenLinesCountCache += ((*it).length- ((*it).length + (*it).start - doclen));
+ break;
+ }
+ }
+
+ return hiddenLinesCountCache;
+}
+
+void KateCodeFoldingTree::collapseToplevelNodes()
+{
+ // hl whole file
+ m_buffer->line (m_buffer->count()-1);
+
+ if (m_root.noChildren ())
+ return;
+
+ for ( uint i=0; i < m_root.childCount(); ++i )
+ {
+ KateCodeFoldingNode *node = m_root.child(i);
+
+ if (node->visible && node->startLineValid && node->endLineValid)
+ {
+ node->visible=false;
+ lineMapping.clear();
+ hiddenLinesCountCacheValid = false;
+ addHiddenLineBlock(node,node->startLineRel);
+ emit regionVisibilityChangedAt(node->startLineRel);
+ }
+ }
+}
+
+void KateCodeFoldingTree::expandToplevelNodes(int numLines)
+{
+ // hl whole file
+ m_buffer->line (m_buffer->count()-1);
+
+ KateLineInfo line;
+ for (int i = 0; i < numLines; i++) {
+ getLineInfo(&line, i);
+
+ if (line.startsInVisibleBlock)
+ toggleRegionVisibility(i);
+ }
+}
+
+int KateCodeFoldingTree::collapseOne(int realLine)
+{
+ // hl whole file
+ m_buffer->line (m_buffer->count()-1);
+
+ KateLineInfo line;
+ int unrelatedBlocks = 0;
+ for (int i = realLine; i >= 0; i--) {
+ getLineInfo(&line, i);
+
+ if (line.topLevel && !line.endsBlock)
+ // optimisation
+ break;
+
+ if (line.endsBlock && ( line.invalidBlockEnd ) && (i != realLine)) {
+ unrelatedBlocks++;
+ }
+
+ if (line.startsVisibleBlock) {
+ unrelatedBlocks--;
+ if (unrelatedBlocks == -1) {
+ toggleRegionVisibility(i);
+ return i;
+ }
+ }
+ }
+ return -1;
+}
+
+void KateCodeFoldingTree::expandOne(int realLine, int numLines)
+{
+ // hl whole file
+ m_buffer->line (m_buffer->count()-1);
+
+ KateLineInfo line;
+ int blockTrack = 0;
+ for (int i = realLine; i >= 0; i--) {
+ getLineInfo(&line, i);
+
+ if (line.topLevel)
+ // done
+ break;
+
+ if (line.startsInVisibleBlock && i != realLine) {
+ if (blockTrack == 0)
+ toggleRegionVisibility(i);
+
+ blockTrack--;
+ }
+
+ if (line.endsBlock)
+ blockTrack++;
+
+ if (blockTrack < 0)
+ // too shallow
+ break;
+ }
+
+ blockTrack = 0;
+ for (int i = realLine; i < numLines; i++) {
+ getLineInfo(&line, i);
+
+ if (line.topLevel)
+ // done
+ break;
+
+ if (line.startsInVisibleBlock) {
+ if (blockTrack == 0)
+ toggleRegionVisibility(i);
+
+ blockTrack++;
+ }
+
+ if (line.endsBlock)
+ blockTrack--;
+
+ if (blockTrack < 0)
+ // too shallow
+ break;
+ }
+}
+
+void KateCodeFoldingTree::ensureVisible( uint line )
+{
+ // first have a look, if the line is really hidden
+ bool found=false;
+ for (QValueList<KateHiddenLineBlock>::ConstIterator it=hiddenLines.begin();it!=hiddenLines.end();++it)
+ {
+ if ( ((*it).start<=line) && ((*it).start+(*it).length>line) )
+ {
+ found=true;
+ break;
+ }
+ }
+
+
+ if (!found) return;
+
+ kdDebug(13000)<<"line "<<line<<" is really hidden ->show block"<<endl;
+
+ // it looks like we really have to ensure visibility
+ KateCodeFoldingNode *n = findNodeForLine( line );
+ do {
+ if ( ! n->visible )
+ toggleRegionVisibility( getStartLine( n ) );
+ n = n->parentNode;
+ } while( n );
+
+}
+
+// kate: space-indent on; indent-width 2; replace-tabs on;
diff --git a/kate/part/katecodefoldinghelpers.h b/kate/part/katecodefoldinghelpers.h
new file mode 100644
index 000000000..bd5e5e8d5
--- /dev/null
+++ b/kate/part/katecodefoldinghelpers.h
@@ -0,0 +1,222 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2002 Joseph Wenninger <jowenn@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef _KATE_CODEFOLDING_HELPERS_
+#define _KATE_CODEFOLDING_HELPERS_
+
+//BEGIN INCLUDES + FORWARDS
+#include <qptrlist.h>
+#include <qvaluelist.h>
+#include <qobject.h>
+#include <qintdict.h>
+#include <qmemarray.h>
+
+class KateCodeFoldingTree;
+class KateTextCursor;
+class KateBuffer;
+
+class QString;
+//END
+
+class KateHiddenLineBlock
+{
+ public:
+ unsigned int start;
+ unsigned int length;
+};
+
+class KateLineInfo
+{
+ public:
+ bool topLevel;
+ bool startsVisibleBlock;
+ bool startsInVisibleBlock;
+ bool endsBlock;
+ bool invalidBlockEnd;
+};
+
+class KateCodeFoldingNode
+{
+ friend class KateCodeFoldingTree;
+
+ public:
+ KateCodeFoldingNode ();
+ KateCodeFoldingNode (KateCodeFoldingNode *par, signed char typ, unsigned int sLRel);
+
+ ~KateCodeFoldingNode ();
+
+ inline int nodeType () { return type;}
+
+ inline bool isVisible () {return visible;}
+
+ inline KateCodeFoldingNode *getParentNode () {return parentNode;}
+
+ bool getBegin (KateCodeFoldingTree *tree, KateTextCursor* begin);
+ bool getEnd (KateCodeFoldingTree *tree, KateTextCursor *end);
+
+ /**
+ * accessors for the child nodes
+ */
+ protected:
+ inline bool noChildren () const { return m_children.isEmpty(); }
+
+ inline uint childCount () const { return m_children.size(); }
+
+ inline KateCodeFoldingNode *child (uint index) const { return m_children[index]; }
+
+ inline int findChild (KateCodeFoldingNode *node, uint start = 0) const { return m_children.find (node, start); }
+
+ inline void appendChild (KateCodeFoldingNode *node) { m_children.resize(m_children.size()+1); m_children[m_children.size()-1] = node; }
+
+ void insertChild (uint index, KateCodeFoldingNode *node);
+
+ KateCodeFoldingNode *takeChild (uint index);
+
+ void clearChildren ();
+
+ int cmpPos(KateCodeFoldingTree *tree, uint line, uint col);
+
+ /**
+ * data members
+ */
+ private:
+ KateCodeFoldingNode *parentNode;
+ unsigned int startLineRel;
+ unsigned int endLineRel;
+
+ unsigned int startCol;
+ unsigned int endCol;
+
+ bool startLineValid;
+ bool endLineValid;
+
+ signed char type; // 0 -> toplevel / invalid
+ bool visible;
+ bool deleteOpening;
+ bool deleteEnding;
+
+ QMemArray<KateCodeFoldingNode*> m_children;
+};
+
+class KateCodeFoldingTree : public QObject
+{
+ friend class KateCodeFoldingNode;
+
+ Q_OBJECT
+
+ public:
+ KateCodeFoldingTree (KateBuffer *buffer);
+ ~KateCodeFoldingTree ();
+
+ KateCodeFoldingNode *findNodeForLine (unsigned int line);
+
+ unsigned int getRealLine (unsigned int virtualLine);
+ unsigned int getVirtualLine (unsigned int realLine);
+ unsigned int getHiddenLinesCount (unsigned int docLine);
+
+ bool isTopLevel (unsigned int line);
+
+ void lineHasBeenInserted (unsigned int line);
+ void lineHasBeenRemoved (unsigned int line);
+ void debugDump ();
+ void getLineInfo (KateLineInfo *info,unsigned int line);
+
+ unsigned int getStartLine (KateCodeFoldingNode *node);
+
+ void fixRoot (int endLRel);
+ void clear ();
+
+ KateCodeFoldingNode *findNodeForPosition(unsigned int line, unsigned int column);
+ private:
+
+ KateCodeFoldingNode m_root;
+
+ KateBuffer *m_buffer;
+
+ QIntDict<unsigned int> lineMapping;
+ QIntDict<bool> dontIgnoreUnchangedLines;
+
+ QPtrList<KateCodeFoldingNode> markedForDeleting;
+ QPtrList<KateCodeFoldingNode> nodesForLine;
+ QValueList<KateHiddenLineBlock> hiddenLines;
+
+ unsigned int hiddenLinesCountCache;
+ bool something_changed;
+ bool hiddenLinesCountCacheValid;
+
+ static bool trueVal;
+
+ KateCodeFoldingNode *findNodeForLineDescending (KateCodeFoldingNode *, unsigned int, unsigned int, bool oneStepOnly=false);
+
+ bool correctEndings (signed char data, KateCodeFoldingNode *node, unsigned int line, unsigned int endCol, int insertPos);
+
+ void dumpNode (KateCodeFoldingNode *node, const QString &prefix);
+ void addOpening (KateCodeFoldingNode *node, signed char nType,QMemArray<uint>* list, unsigned int line,unsigned int charPos);
+ void addOpening_further_iterations (KateCodeFoldingNode *node,signed char nType, QMemArray<uint>*
+ list,unsigned int line,int current,unsigned int startLine,unsigned int charPos);
+
+ void incrementBy1 (KateCodeFoldingNode *node, KateCodeFoldingNode *after);
+ void decrementBy1 (KateCodeFoldingNode *node, KateCodeFoldingNode *after);
+
+ void cleanupUnneededNodes (unsigned int line);
+
+ /**
+ * if returns true, this node has been deleted !!
+ */
+ bool removeEnding (KateCodeFoldingNode *node,unsigned int line);
+
+ /**
+ * if returns true, this node has been deleted !!
+ */
+ bool removeOpening (KateCodeFoldingNode *node,unsigned int line);
+
+ void findAndMarkAllNodesforRemovalOpenedOrClosedAt (unsigned int line);
+ void findAllNodesOpenedOrClosedAt (unsigned int line);
+
+ void addNodeToFoundList (KateCodeFoldingNode *node,unsigned int line,int childpos);
+ void addNodeToRemoveList (KateCodeFoldingNode *node,unsigned int line);
+ void addHiddenLineBlock (KateCodeFoldingNode *node,unsigned int line);
+
+ bool existsOpeningAtLineAfter(unsigned int line, KateCodeFoldingNode *node);
+
+ void dontDeleteEnding (KateCodeFoldingNode*);
+ void dontDeleteOpening (KateCodeFoldingNode*);
+
+ void updateHiddenSubNodes (KateCodeFoldingNode *node);
+ void moveSubNodesUp (KateCodeFoldingNode *node);
+
+ public slots:
+ void updateLine (unsigned int line,QMemArray<uint>* regionChanges, bool *updated, bool changed,bool colschanged);
+ void toggleRegionVisibility (unsigned int);
+ void collapseToplevelNodes ();
+ void expandToplevelNodes (int numLines);
+ int collapseOne (int realLine);
+ void expandOne (int realLine, int numLines);
+ /**
+ Ensures that all nodes surrounding @p line are open
+ */
+ void ensureVisible( uint line );
+
+ signals:
+ void regionVisibilityChangedAt (unsigned int);
+ void regionBeginEndAddedRemoved (unsigned int);
+};
+
+#endif
+
+// kate: space-indent on; indent-width 2; replace-tabs on;
diff --git a/kate/part/kateconfig.cpp b/kate/part/kateconfig.cpp
new file mode 100644
index 000000000..c580ed5c1
--- /dev/null
+++ b/kate/part/kateconfig.cpp
@@ -0,0 +1,1429 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2003 Christoph Cullmann <cullmann@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "kateconfig.h"
+
+#include "katefactory.h"
+#include "katerenderer.h"
+#include "kateview.h"
+#include "katedocument.h"
+#include "katefont.h"
+#include "kateschema.h"
+
+#include <math.h>
+
+#include <kapplication.h>
+#include <kconfig.h>
+#include <kglobalsettings.h>
+#include <kcharsets.h>
+#include <klocale.h>
+#include <kfinddialog.h>
+#include <kreplacedialog.h>
+#include <kinstance.h>
+#include <kstaticdeleter.h>
+
+#include <qpopupmenu.h>
+#include <qtextcodec.h>
+
+#include <kdebug.h>
+
+//BEGIN KateConfig
+KateConfig::KateConfig ()
+ : configSessionNumber (0), configIsRunning (false)
+{
+}
+
+KateConfig::~KateConfig ()
+{
+}
+
+void KateConfig::configStart ()
+{
+ configSessionNumber++;
+
+ if (configSessionNumber > 1)
+ return;
+
+ configIsRunning = true;
+}
+
+void KateConfig::configEnd ()
+{
+ if (configSessionNumber == 0)
+ return;
+
+ configSessionNumber--;
+
+ if (configSessionNumber > 0)
+ return;
+
+ configIsRunning = false;
+
+ updateConfig ();
+}
+//END
+
+//BEGIN KateDocumentConfig
+KateDocumentConfig *KateDocumentConfig::s_global = 0;
+KateViewConfig *KateViewConfig::s_global = 0;
+KateRendererConfig *KateRendererConfig::s_global = 0;
+
+KateDocumentConfig::KateDocumentConfig ()
+ : m_tabWidth (8),
+ m_indentationWidth (2),
+ m_wordWrapAt (80),
+ m_configFlags (0),
+ m_plugins (KateFactory::self()->plugins().count()),
+ m_tabWidthSet (true),
+ m_indentationWidthSet (true),
+ m_indentationModeSet (true),
+ m_wordWrapSet (true),
+ m_wordWrapAtSet (true),
+ m_pageUpDownMovesCursorSet (true),
+ m_undoStepsSet (true),
+ m_configFlagsSet (0xFFFF),
+ m_encodingSet (true),
+ m_eolSet (true),
+ m_allowEolDetectionSet (true),
+ m_backupFlagsSet (true),
+ m_searchDirConfigDepthSet (true),
+ m_backupPrefixSet (true),
+ m_backupSuffixSet (true),
+ m_pluginsSet (m_plugins.size()),
+ m_doc (0)
+{
+ s_global = this;
+
+ // init plugin array
+ m_plugins.fill (false);
+ m_pluginsSet.fill (true);
+
+ // init with defaults from config or really hardcoded ones
+ KConfig *config = kapp->config();
+ config->setGroup("Kate Document Defaults");
+ readConfig (config);
+}
+
+KateDocumentConfig::KateDocumentConfig (KateDocument *doc)
+ : m_configFlags (0),
+ m_plugins (KateFactory::self()->plugins().count()),
+ m_tabWidthSet (false),
+ m_indentationWidthSet (false),
+ m_indentationModeSet (false),
+ m_wordWrapSet (false),
+ m_wordWrapAtSet (false),
+ m_pageUpDownMovesCursorSet (false),
+ m_undoStepsSet (false),
+ m_configFlagsSet (0),
+ m_encodingSet (false),
+ m_eolSet (false),
+ m_allowEolDetectionSet (false),
+ m_backupFlagsSet (false),
+ m_searchDirConfigDepthSet (false),
+ m_backupPrefixSet (false),
+ m_backupSuffixSet (false),
+ m_pluginsSet (m_plugins.size()),
+ m_doc (doc)
+{
+ // init plugin array
+ m_plugins.fill (false);
+ m_pluginsSet.fill (false);
+}
+
+KateDocumentConfig::~KateDocumentConfig ()
+{
+}
+
+void KateDocumentConfig::readConfig (KConfig *config)
+{
+ configStart ();
+
+ setTabWidth (config->readNumEntry("Tab Width", 8));
+
+ setIndentationWidth (config->readNumEntry("Indentation Width", 2));
+
+ setIndentationMode (config->readNumEntry("Indentation Mode", KateDocumentConfig::imNone));
+
+ setWordWrap (config->readBoolEntry("Word Wrap", false));
+ setWordWrapAt (config->readNumEntry("Word Wrap Column", 80));
+ setPageUpDownMovesCursor (config->readBoolEntry("PageUp/PageDown Moves Cursor", false));
+ setUndoSteps(config->readNumEntry("Undo Steps", 0));
+
+ setConfigFlags (config->readNumEntry("Basic Config Flags", KateDocumentConfig::cfTabIndents
+ | KateDocumentConfig::cfKeepIndentProfile
+ | KateDocumentConfig::cfWrapCursor
+ | KateDocumentConfig::cfShowTabs
+ | KateDocumentConfig::cfSmartHome
+ | KateDocumentConfig::cfIndentPastedText));
+
+ setEncoding (config->readEntry("Encoding", ""));
+
+ setEol (config->readNumEntry("End of Line", 0));
+ setAllowEolDetection (config->readBoolEntry("Allow End of Line Detection", true));
+
+ setBackupFlags (config->readNumEntry("Backup Config Flags", 1));
+
+ setSearchDirConfigDepth (config->readNumEntry("Search Dir Config Depth", 3));
+
+ setBackupPrefix (config->readEntry("Backup Prefix", QString ("")));
+
+ setBackupSuffix (config->readEntry("Backup Suffix", QString ("~")));
+
+ // plugins
+ for (uint i=0; i<KateFactory::self()->plugins().count(); i++)
+ setPlugin (i, config->readBoolEntry("KTextEditor Plugin " + (KateFactory::self()->plugins())[i]->library(), false));
+
+ configEnd ();
+}
+
+void KateDocumentConfig::writeConfig (KConfig *config)
+{
+ config->writeEntry("Tab Width", tabWidth());
+
+ config->writeEntry("Indentation Width", indentationWidth());
+ config->writeEntry("Indentation Mode", indentationMode());
+
+ config->writeEntry("Word Wrap", wordWrap());
+ config->writeEntry("Word Wrap Column", wordWrapAt());
+
+ config->writeEntry("PageUp/PageDown Moves Cursor", pageUpDownMovesCursor());
+
+ config->writeEntry("Undo Steps", undoSteps());
+
+ config->writeEntry("Basic Config Flags", configFlags());
+
+ config->writeEntry("Encoding", encoding());
+
+ config->writeEntry("End of Line", eol());
+ config->writeEntry("Allow End of Line Detection", allowEolDetection());
+
+ config->writeEntry("Backup Config Flags", backupFlags());
+
+ config->writeEntry("Search Dir Config Depth", searchDirConfigDepth());
+
+ config->writeEntry("Backup Prefix", backupPrefix());
+
+ config->writeEntry("Backup Suffix", backupSuffix());
+
+ // plugins
+ for (uint i=0; i<KateFactory::self()->plugins().count(); i++)
+ config->writeEntry("KTextEditor Plugin " + (KateFactory::self()->plugins())[i]->library(), plugin(i));
+}
+
+void KateDocumentConfig::updateConfig ()
+{
+ if (m_doc)
+ {
+ m_doc->updateConfig ();
+ return;
+ }
+
+ if (isGlobal())
+ {
+ for (uint z=0; z < KateFactory::self()->documents()->count(); z++)
+ {
+ KateFactory::self()->documents()->at(z)->updateConfig ();
+ }
+ }
+}
+
+int KateDocumentConfig::tabWidth () const
+{
+ if (m_tabWidthSet || isGlobal())
+ return m_tabWidth;
+
+ return s_global->tabWidth();
+}
+
+void KateDocumentConfig::setTabWidth (int tabWidth)
+{
+ if (tabWidth < 1)
+ return;
+
+ configStart ();
+
+ m_tabWidthSet = true;
+ m_tabWidth = tabWidth;
+
+ configEnd ();
+}
+
+int KateDocumentConfig::indentationWidth () const
+{
+ if (m_indentationWidthSet || isGlobal())
+ return m_indentationWidth;
+
+ return s_global->indentationWidth();
+}
+
+void KateDocumentConfig::setIndentationWidth (int indentationWidth)
+{
+ if (indentationWidth < 1)
+ return;
+
+ configStart ();
+
+ m_indentationWidthSet = true;
+ m_indentationWidth = indentationWidth;
+
+ configEnd ();
+}
+
+uint KateDocumentConfig::indentationMode () const
+{
+ if (m_indentationModeSet || isGlobal())
+ return m_indentationMode;
+
+ return s_global->indentationMode();
+}
+
+void KateDocumentConfig::setIndentationMode (uint indentationMode)
+{
+ configStart ();
+
+ m_indentationModeSet = true;
+ m_indentationMode = indentationMode;
+
+ configEnd ();
+}
+
+bool KateDocumentConfig::wordWrap () const
+{
+ if (m_wordWrapSet || isGlobal())
+ return m_wordWrap;
+
+ return s_global->wordWrap();
+}
+
+void KateDocumentConfig::setWordWrap (bool on)
+{
+ configStart ();
+
+ m_wordWrapSet = true;
+ m_wordWrap = on;
+
+ configEnd ();
+}
+
+unsigned int KateDocumentConfig::wordWrapAt () const
+{
+ if (m_wordWrapAtSet || isGlobal())
+ return m_wordWrapAt;
+
+ return s_global->wordWrapAt();
+}
+
+void KateDocumentConfig::setWordWrapAt (unsigned int col)
+{
+ if (col < 1)
+ return;
+
+ configStart ();
+
+ m_wordWrapAtSet = true;
+ m_wordWrapAt = col;
+
+ configEnd ();
+}
+
+uint KateDocumentConfig::undoSteps () const
+{
+ if (m_undoStepsSet || isGlobal())
+ return m_undoSteps;
+
+ return s_global->undoSteps();
+}
+
+void KateDocumentConfig::setUndoSteps (uint undoSteps)
+{
+ configStart ();
+
+ m_undoStepsSet = true;
+ m_undoSteps = undoSteps;
+
+ configEnd ();
+}
+
+bool KateDocumentConfig::pageUpDownMovesCursor () const
+{
+ if (m_pageUpDownMovesCursorSet || isGlobal())
+ return m_pageUpDownMovesCursor;
+
+ return s_global->pageUpDownMovesCursor();
+}
+
+void KateDocumentConfig::setPageUpDownMovesCursor (bool on)
+{
+ configStart ();
+
+ m_pageUpDownMovesCursorSet = true;
+ m_pageUpDownMovesCursor = on;
+
+ configEnd ();
+}
+
+uint KateDocumentConfig::configFlags () const
+{
+ if (isGlobal())
+ return m_configFlags;
+
+ return ((s_global->configFlags() & ~ m_configFlagsSet) | m_configFlags);
+}
+
+void KateDocumentConfig::setConfigFlags (KateDocumentConfig::ConfigFlags flag, bool enable)
+{
+ configStart ();
+
+ m_configFlagsSet |= flag;
+
+ if (enable)
+ m_configFlags = m_configFlags | flag;
+ else
+ m_configFlags = m_configFlags & ~ flag;
+
+ configEnd ();
+}
+
+void KateDocumentConfig::setConfigFlags (uint fullFlags)
+{
+ configStart ();
+
+ m_configFlagsSet = 0xFFFF;
+ m_configFlags = fullFlags;
+
+ configEnd ();
+}
+
+const QString &KateDocumentConfig::encoding () const
+{
+ if (m_encodingSet || isGlobal())
+ return m_encoding;
+
+ return s_global->encoding();
+}
+
+QTextCodec *KateDocumentConfig::codec ()
+{
+ if (m_encodingSet || isGlobal())
+ {
+ if (m_encoding.isEmpty() && isGlobal())
+ return KGlobal::charsets()->codecForName (QString::fromLatin1(KGlobal::locale()->encoding()));
+ else if (m_encoding.isEmpty())
+ return s_global->codec ();
+ else
+ return KGlobal::charsets()->codecForName (m_encoding);
+ }
+
+ return s_global->codec ();
+}
+
+void KateDocumentConfig::setEncoding (const QString &encoding)
+{
+ QString enc = encoding;
+
+ if (!enc.isEmpty())
+ {
+ bool found = false;
+ QTextCodec *codec = KGlobal::charsets()->codecForName (encoding, found);
+
+ if (!found || !codec)
+ return;
+
+ enc = codec->name();
+ }
+
+ configStart ();
+
+ if (isGlobal())
+ KateDocument::setDefaultEncoding (enc);
+
+ m_encodingSet = true;
+ m_encoding = enc;
+
+ configEnd ();
+}
+
+bool KateDocumentConfig::isSetEncoding () const
+{
+ return m_encodingSet;
+}
+
+int KateDocumentConfig::eol () const
+{
+ if (m_eolSet || isGlobal())
+ return m_eol;
+
+ return s_global->eol();
+}
+
+QString KateDocumentConfig::eolString ()
+{
+ if (eol() == KateDocumentConfig::eolUnix)
+ return QString ("\n");
+ else if (eol() == KateDocumentConfig::eolDos)
+ return QString ("\r\n");
+ else if (eol() == KateDocumentConfig::eolMac)
+ return QString ("\r");
+
+ return QString ("\n");
+}
+
+void KateDocumentConfig::setEol (int mode)
+{
+ configStart ();
+
+ m_eolSet = true;
+ m_eol = mode;
+
+ configEnd ();
+}
+
+bool KateDocumentConfig::allowEolDetection () const
+{
+ if (m_allowEolDetectionSet || isGlobal())
+ return m_allowEolDetection;
+
+ return s_global->allowEolDetection();
+}
+
+void KateDocumentConfig::setAllowEolDetection (bool on)
+{
+ configStart ();
+
+ m_allowEolDetectionSet = true;
+ m_allowEolDetection = on;
+
+ configEnd ();
+}
+
+uint KateDocumentConfig::backupFlags () const
+{
+ if (m_backupFlagsSet || isGlobal())
+ return m_backupFlags;
+
+ return s_global->backupFlags();
+}
+
+void KateDocumentConfig::setBackupFlags (uint flags)
+ {
+ configStart ();
+
+ m_backupFlagsSet = true;
+ m_backupFlags = flags;
+
+ configEnd ();
+}
+
+const QString &KateDocumentConfig::backupPrefix () const
+{
+ if (m_backupPrefixSet || isGlobal())
+ return m_backupPrefix;
+
+ return s_global->backupPrefix();
+}
+
+const QString &KateDocumentConfig::backupSuffix () const
+{
+ if (m_backupSuffixSet || isGlobal())
+ return m_backupSuffix;
+
+ return s_global->backupSuffix();
+}
+
+void KateDocumentConfig::setBackupPrefix (const QString &prefix)
+{
+ configStart ();
+
+ m_backupPrefixSet = true;
+ m_backupPrefix = prefix;
+
+ configEnd ();
+}
+
+void KateDocumentConfig::setBackupSuffix (const QString &suffix)
+{
+ configStart ();
+
+ m_backupSuffixSet = true;
+ m_backupSuffix = suffix;
+
+ configEnd ();
+}
+
+bool KateDocumentConfig::plugin (uint index) const
+{
+ if (index >= m_plugins.size())
+ return false;
+
+ if (m_pluginsSet.at(index) || isGlobal())
+ return m_plugins.at(index);
+
+ return s_global->plugin (index);
+}
+
+void KateDocumentConfig::setPlugin (uint index, bool load)
+{
+ if (index >= m_plugins.size())
+ return;
+
+ configStart ();
+
+ m_pluginsSet.setBit(index);
+ m_plugins.setBit(index, load);
+
+ configEnd ();
+}
+
+int KateDocumentConfig::searchDirConfigDepth () const
+{
+ if (m_searchDirConfigDepthSet || isGlobal())
+ return m_searchDirConfigDepth;
+
+ return s_global->searchDirConfigDepth ();
+}
+
+void KateDocumentConfig::setSearchDirConfigDepth (int depth)
+{
+ configStart ();
+
+ m_searchDirConfigDepthSet = true;
+ m_searchDirConfigDepth = depth;
+
+ configEnd ();
+}
+
+//END
+
+//BEGIN KateViewConfig
+KateViewConfig::KateViewConfig ()
+ :
+ m_dynWordWrapSet (true),
+ m_dynWordWrapIndicatorsSet (true),
+ m_dynWordWrapAlignIndentSet (true),
+ m_lineNumbersSet (true),
+ m_scrollBarMarksSet (true),
+ m_iconBarSet (true),
+ m_foldingBarSet (true),
+ m_bookmarkSortSet (true),
+ m_autoCenterLinesSet (true),
+ m_searchFlagsSet (true),
+ m_cmdLineSet (true),
+ m_defaultMarkTypeSet (true),
+ m_persistentSelectionSet (true),
+ m_textToSearchModeSet (true),
+ m_view (0)
+{
+ s_global = this;
+
+ // init with defaults from config or really hardcoded ones
+ KConfig *config = kapp->config();
+ config->setGroup("Kate View Defaults");
+ readConfig (config);
+}
+
+KateViewConfig::KateViewConfig (KateView *view)
+ :
+ m_dynWordWrapSet (false),
+ m_dynWordWrapIndicatorsSet (false),
+ m_dynWordWrapAlignIndentSet (false),
+ m_lineNumbersSet (false),
+ m_scrollBarMarksSet (false),
+ m_iconBarSet (false),
+ m_foldingBarSet (false),
+ m_bookmarkSortSet (false),
+ m_autoCenterLinesSet (false),
+ m_searchFlagsSet (false),
+ m_cmdLineSet (false),
+ m_defaultMarkTypeSet (false),
+ m_persistentSelectionSet (false),
+ m_textToSearchModeSet (false),
+ m_view (view)
+{
+}
+
+KateViewConfig::~KateViewConfig ()
+{
+}
+
+void KateViewConfig::readConfig (KConfig *config)
+{
+ configStart ();
+
+ setDynWordWrap (config->readBoolEntry( "Dynamic Word Wrap", true ));
+ setDynWordWrapIndicators (config->readNumEntry( "Dynamic Word Wrap Indicators", 1 ));
+ setDynWordWrapAlignIndent (config->readNumEntry( "Dynamic Word Wrap Align Indent", 80 ));
+
+ setLineNumbers (config->readBoolEntry( "Line Numbers", false));
+
+ setScrollBarMarks (config->readBoolEntry( "Scroll Bar Marks", false));
+
+ setIconBar (config->readBoolEntry( "Icon Bar", false ));
+
+ setFoldingBar (config->readBoolEntry( "Folding Bar", true));
+
+ setBookmarkSort (config->readNumEntry( "Bookmark Menu Sorting", 0 ));
+
+ setAutoCenterLines (config->readNumEntry( "Auto Center Lines", 0 ));
+
+ setSearchFlags (config->readNumEntry("Search Config Flags", KFindDialog::FromCursor | KFindDialog::CaseSensitive | KReplaceDialog::PromptOnReplace));
+
+ setCmdLine (config->readBoolEntry( "Command Line", false));
+
+ setDefaultMarkType (config->readNumEntry( "Default Mark Type", KTextEditor::MarkInterface::markType01 ));
+
+ setPersistentSelection (config->readNumEntry( "Persistent Selection", false ));
+
+ setTextToSearchMode (config->readNumEntry( "Text To Search Mode", KateViewConfig::SelectionWord));
+
+ configEnd ();
+}
+
+void KateViewConfig::writeConfig (KConfig *config)
+{
+ config->writeEntry( "Dynamic Word Wrap", dynWordWrap() );
+ config->writeEntry( "Dynamic Word Wrap Indicators", dynWordWrapIndicators() );
+ config->writeEntry( "Dynamic Word Wrap Align Indent", dynWordWrapAlignIndent() );
+
+ config->writeEntry( "Line Numbers", lineNumbers() );
+
+ config->writeEntry( "Scroll Bar Marks", scrollBarMarks() );
+
+ config->writeEntry( "Icon Bar", iconBar() );
+
+ config->writeEntry( "Folding Bar", foldingBar() );
+
+ config->writeEntry( "Bookmark Menu Sorting", bookmarkSort() );
+
+ config->writeEntry( "Auto Center Lines", autoCenterLines() );
+
+ config->writeEntry("Search Config Flags", searchFlags());
+
+ config->writeEntry("Command Line", cmdLine());
+
+ config->writeEntry("Default Mark Type", defaultMarkType());
+
+ config->writeEntry("Persistent Selection", persistentSelection());
+
+ config->writeEntry("Text To Search Mode", textToSearchMode());
+}
+
+void KateViewConfig::updateConfig ()
+{
+ if (m_view)
+ {
+ m_view->updateConfig ();
+ return;
+ }
+
+ if (isGlobal())
+ {
+ for (uint z=0; z < KateFactory::self()->views()->count(); z++)
+ {
+ KateFactory::self()->views()->at(z)->updateConfig ();
+ }
+ }
+}
+
+bool KateViewConfig::dynWordWrap () const
+{
+ if (m_dynWordWrapSet || isGlobal())
+ return m_dynWordWrap;
+
+ return s_global->dynWordWrap();
+}
+
+void KateViewConfig::setDynWordWrap (bool wrap)
+{
+ configStart ();
+
+ m_dynWordWrapSet = true;
+ m_dynWordWrap = wrap;
+
+ configEnd ();
+}
+
+int KateViewConfig::dynWordWrapIndicators () const
+{
+ if (m_dynWordWrapIndicatorsSet || isGlobal())
+ return m_dynWordWrapIndicators;
+
+ return s_global->dynWordWrapIndicators();
+}
+
+void KateViewConfig::setDynWordWrapIndicators (int mode)
+{
+ configStart ();
+
+ m_dynWordWrapIndicatorsSet = true;
+ m_dynWordWrapIndicators = kMin(80, kMax(0, mode));
+
+ configEnd ();
+}
+
+int KateViewConfig::dynWordWrapAlignIndent () const
+{
+ if (m_dynWordWrapAlignIndentSet || isGlobal())
+ return m_dynWordWrapAlignIndent;
+
+ return s_global->dynWordWrapAlignIndent();
+}
+
+void KateViewConfig::setDynWordWrapAlignIndent (int indent)
+{
+ configStart ();
+
+ m_dynWordWrapAlignIndentSet = true;
+ m_dynWordWrapAlignIndent = indent;
+
+ configEnd ();
+}
+
+bool KateViewConfig::lineNumbers () const
+{
+ if (m_lineNumbersSet || isGlobal())
+ return m_lineNumbers;
+
+ return s_global->lineNumbers();
+}
+
+void KateViewConfig::setLineNumbers (bool on)
+{
+ configStart ();
+
+ m_lineNumbersSet = true;
+ m_lineNumbers = on;
+
+ configEnd ();
+}
+
+bool KateViewConfig::scrollBarMarks () const
+{
+ if (m_scrollBarMarksSet || isGlobal())
+ return m_scrollBarMarks;
+
+ return s_global->scrollBarMarks();
+}
+
+void KateViewConfig::setScrollBarMarks (bool on)
+{
+ configStart ();
+
+ m_scrollBarMarksSet = true;
+ m_scrollBarMarks = on;
+
+ configEnd ();
+}
+
+bool KateViewConfig::iconBar () const
+{
+ if (m_iconBarSet || isGlobal())
+ return m_iconBar;
+
+ return s_global->iconBar();
+}
+
+void KateViewConfig::setIconBar (bool on)
+{
+ configStart ();
+
+ m_iconBarSet = true;
+ m_iconBar = on;
+
+ configEnd ();
+}
+
+bool KateViewConfig::foldingBar () const
+{
+ if (m_foldingBarSet || isGlobal())
+ return m_foldingBar;
+
+ return s_global->foldingBar();
+}
+
+void KateViewConfig::setFoldingBar (bool on)
+{
+ configStart ();
+
+ m_foldingBarSet = true;
+ m_foldingBar = on;
+
+ configEnd ();
+}
+
+int KateViewConfig::bookmarkSort () const
+{
+ if (m_bookmarkSortSet || isGlobal())
+ return m_bookmarkSort;
+
+ return s_global->bookmarkSort();
+}
+
+void KateViewConfig::setBookmarkSort (int mode)
+{
+ configStart ();
+
+ m_bookmarkSortSet = true;
+ m_bookmarkSort = mode;
+
+ configEnd ();
+}
+
+int KateViewConfig::autoCenterLines () const
+{
+ if (m_autoCenterLinesSet || isGlobal())
+ return m_autoCenterLines;
+
+ return s_global->autoCenterLines();
+}
+
+void KateViewConfig::setAutoCenterLines (int lines)
+{
+ if (lines < 0)
+ return;
+
+ configStart ();
+
+ m_autoCenterLinesSet = true;
+ m_autoCenterLines = lines;
+
+ configEnd ();
+}
+
+long KateViewConfig::searchFlags () const
+{
+ if (m_searchFlagsSet || isGlobal())
+ return m_searchFlags;
+
+ return s_global->searchFlags();
+}
+
+void KateViewConfig::setSearchFlags (long flags)
+ {
+ configStart ();
+
+ m_searchFlagsSet = true;
+ m_searchFlags = flags;
+
+ configEnd ();
+}
+
+bool KateViewConfig::cmdLine () const
+{
+ if (m_cmdLineSet || isGlobal())
+ return m_cmdLine;
+
+ return s_global->cmdLine();
+}
+
+void KateViewConfig::setCmdLine (bool on)
+{
+ configStart ();
+
+ m_cmdLineSet = true;
+ m_cmdLine = on;
+
+ configEnd ();
+}
+
+uint KateViewConfig::defaultMarkType () const
+{
+ if (m_defaultMarkTypeSet || isGlobal())
+ return m_defaultMarkType;
+
+ return s_global->defaultMarkType();
+}
+
+void KateViewConfig::setDefaultMarkType (uint type)
+{
+ configStart ();
+
+ m_defaultMarkTypeSet = true;
+ m_defaultMarkType = type;
+
+ configEnd ();
+}
+
+bool KateViewConfig::persistentSelection () const
+{
+ if (m_persistentSelectionSet || isGlobal())
+ return m_persistentSelection;
+
+ return s_global->persistentSelection();
+}
+
+void KateViewConfig::setPersistentSelection (bool on)
+{
+ configStart ();
+
+ m_persistentSelectionSet = true;
+ m_persistentSelection = on;
+
+ configEnd ();
+}
+
+int KateViewConfig::textToSearchMode () const
+{
+ if (m_textToSearchModeSet || isGlobal())
+ return m_textToSearchMode;
+
+ return s_global->textToSearchMode();
+}
+
+void KateViewConfig::setTextToSearchMode (int mode)
+{
+ configStart ();
+
+ m_textToSearchModeSet = true;
+ m_textToSearchMode = mode;
+
+ configEnd ();
+}
+
+//END
+
+//BEGIN KateRendererConfig
+KateRendererConfig::KateRendererConfig ()
+ :
+ m_font (new KateFontStruct ()),
+ m_lineMarkerColor (KTextEditor::MarkInterface::reservedMarkersCount()),
+ m_schemaSet (true),
+ m_fontSet (true),
+ m_wordWrapMarkerSet (true),
+ m_showIndentationLinesSet (true),
+ m_backgroundColorSet (true),
+ m_selectionColorSet (true),
+ m_highlightedLineColorSet (true),
+ m_highlightedBracketColorSet (true),
+ m_wordWrapMarkerColorSet (true),
+ m_tabMarkerColorSet(true),
+ m_iconBarColorSet (true),
+ m_lineNumberColorSet (true),
+ m_lineMarkerColorSet (m_lineMarkerColor.size()),
+ m_renderer (0)
+{
+ // init bitarray
+ m_lineMarkerColorSet.fill (true);
+
+ s_global = this;
+
+ // init with defaults from config or really hardcoded ones
+ KConfig *config = kapp->config();
+ config->setGroup("Kate Renderer Defaults");
+ readConfig (config);
+}
+
+KateRendererConfig::KateRendererConfig (KateRenderer *renderer)
+ : m_font (0),
+ m_lineMarkerColor (KTextEditor::MarkInterface::reservedMarkersCount()),
+ m_schemaSet (false),
+ m_fontSet (false),
+ m_wordWrapMarkerSet (false),
+ m_showIndentationLinesSet (false),
+ m_backgroundColorSet (false),
+ m_selectionColorSet (false),
+ m_highlightedLineColorSet (false),
+ m_highlightedBracketColorSet (false),
+ m_wordWrapMarkerColorSet (false),
+ m_tabMarkerColorSet(false),
+ m_iconBarColorSet (false),
+ m_lineNumberColorSet (false),
+ m_lineMarkerColorSet (m_lineMarkerColor.size()),
+ m_renderer (renderer)
+{
+ // init bitarray
+ m_lineMarkerColorSet.fill (false);
+}
+
+KateRendererConfig::~KateRendererConfig ()
+{
+ delete m_font;
+}
+
+void KateRendererConfig::readConfig (KConfig *config)
+{
+ configStart ();
+
+ setSchema (KateFactory::self()->schemaManager()->number (config->readEntry("Schema", KateSchemaManager::normalSchema())));
+
+ setWordWrapMarker (config->readBoolEntry("Word Wrap Marker", false ));
+
+ setShowIndentationLines (config->readBoolEntry( "Show Indentation Lines", false));
+
+ configEnd ();
+}
+
+void KateRendererConfig::writeConfig (KConfig *config)
+{
+ config->writeEntry ("Schema", KateFactory::self()->schemaManager()->name(schema()));
+
+ config->writeEntry("Word Wrap Marker", wordWrapMarker() );
+
+ config->writeEntry("Show Indentation Lines", showIndentationLines());
+}
+
+void KateRendererConfig::updateConfig ()
+{
+ if (m_renderer)
+ {
+ m_renderer->updateConfig ();
+ return;
+ }
+
+ if (isGlobal())
+ {
+ for (uint z=0; z < KateFactory::self()->renderers()->count(); z++)
+ {
+ KateFactory::self()->renderers()->at(z)->updateConfig ();
+ }
+ }
+}
+
+uint KateRendererConfig::schema () const
+{
+ if (m_schemaSet || isGlobal())
+ return m_schema;
+
+ return s_global->schema();
+}
+
+void KateRendererConfig::setSchema (uint schema)
+{
+ configStart ();
+ m_schemaSet = true;
+ m_schema = schema;
+ setSchemaInternal( schema );
+ configEnd ();
+}
+
+void KateRendererConfig::reloadSchema()
+{
+ if ( isGlobal() )
+ for ( uint z=0; z < KateFactory::self()->renderers()->count(); z++ )
+ KateFactory::self()->renderers()->at(z)->config()->reloadSchema();
+
+ else if ( m_renderer && m_schemaSet )
+ setSchemaInternal( m_schema );
+}
+
+void KateRendererConfig::setSchemaInternal( int schema )
+{
+ m_schemaSet = true;
+ m_schema = schema;
+
+ KConfig *config (KateFactory::self()->schemaManager()->schema(schema));
+
+ QColor tmp0 (KGlobalSettings::baseColor());
+ QColor tmp1 (KGlobalSettings::highlightColor());
+ QColor tmp2 (KGlobalSettings::alternateBackgroundColor());
+ QColor tmp3 ( "#FFFF99" );
+ QColor tmp4 (tmp2.dark());
+ QColor tmp5 ( KGlobalSettings::textColor() );
+ QColor tmp6 ( "#EAE9E8" );
+ QColor tmp7 ( "#000000" );
+
+ m_backgroundColor = config->readColorEntry("Color Background", &tmp0);
+ m_backgroundColorSet = true;
+ m_selectionColor = config->readColorEntry("Color Selection", &tmp1);
+ m_selectionColorSet = true;
+ m_highlightedLineColor = config->readColorEntry("Color Highlighted Line", &tmp2);
+ m_highlightedLineColorSet = true;
+ m_highlightedBracketColor = config->readColorEntry("Color Highlighted Bracket", &tmp3);
+ m_highlightedBracketColorSet = true;
+ m_wordWrapMarkerColor = config->readColorEntry("Color Word Wrap Marker", &tmp4);
+ m_wordWrapMarkerColorSet = true;
+ m_tabMarkerColor = config->readColorEntry("Color Tab Marker", &tmp5);
+ m_tabMarkerColorSet = true;
+ m_iconBarColor = config->readColorEntry("Color Icon Bar", &tmp6);
+ m_iconBarColorSet = true;
+ m_lineNumberColor = config->readColorEntry("Color Line Number", &tmp7);
+ m_lineNumberColorSet = true;
+
+ // same std colors like in KateDocument::markColor
+ QColor mark[7];
+ mark[0] = Qt::blue;
+ mark[1] = Qt::red;
+ mark[2] = Qt::yellow;
+ mark[3] = Qt::magenta;
+ mark[4] = Qt::gray;
+ mark[5] = Qt::green;
+ mark[6] = Qt::red;
+
+ for (int i = 1; i <= KTextEditor::MarkInterface::reservedMarkersCount(); i++) {
+ QColor col = config->readColorEntry(QString("Color MarkType%1").arg(i), &mark[i - 1]);
+ int index = i-1;
+ m_lineMarkerColorSet[index] = true;
+ m_lineMarkerColor[index] = col;
+ }
+
+ QFont f (KGlobalSettings::fixedFont());
+
+ if (!m_fontSet)
+ {
+ m_fontSet = true;
+ m_font = new KateFontStruct ();
+ }
+
+ m_font->setFont(config->readFontEntry("Font", &f));
+}
+
+KateFontStruct *KateRendererConfig::fontStruct ()
+{
+ if (m_fontSet || isGlobal())
+ return m_font;
+
+ return s_global->fontStruct ();
+}
+
+QFont *KateRendererConfig::font()
+{
+ return &(fontStruct ()->myFont);
+}
+
+KateFontMetrics *KateRendererConfig::fontMetrics()
+{
+ return &(fontStruct ()->myFontMetrics);
+}
+
+void KateRendererConfig::setFont(const QFont &font)
+{
+ configStart ();
+
+ if (!m_fontSet)
+ {
+ m_fontSet = true;
+ m_font = new KateFontStruct ();
+ }
+
+ m_font->setFont(font);
+
+ configEnd ();
+}
+
+bool KateRendererConfig::wordWrapMarker () const
+{
+ if (m_wordWrapMarkerSet || isGlobal())
+ return m_wordWrapMarker;
+
+ return s_global->wordWrapMarker();
+}
+
+void KateRendererConfig::setWordWrapMarker (bool on)
+{
+ configStart ();
+
+ m_wordWrapMarkerSet = true;
+ m_wordWrapMarker = on;
+
+ configEnd ();
+}
+
+const QColor& KateRendererConfig::backgroundColor() const
+{
+ if (m_backgroundColorSet || isGlobal())
+ return m_backgroundColor;
+
+ return s_global->backgroundColor();
+}
+
+void KateRendererConfig::setBackgroundColor (const QColor &col)
+{
+ configStart ();
+
+ m_backgroundColorSet = true;
+ m_backgroundColor = col;
+
+ configEnd ();
+}
+
+const QColor& KateRendererConfig::selectionColor() const
+{
+ if (m_selectionColorSet || isGlobal())
+ return m_selectionColor;
+
+ return s_global->selectionColor();
+}
+
+void KateRendererConfig::setSelectionColor (const QColor &col)
+{
+ configStart ();
+
+ m_selectionColorSet = true;
+ m_selectionColor = col;
+
+ configEnd ();
+}
+
+const QColor& KateRendererConfig::highlightedLineColor() const
+{
+ if (m_highlightedLineColorSet || isGlobal())
+ return m_highlightedLineColor;
+
+ return s_global->highlightedLineColor();
+}
+
+void KateRendererConfig::setHighlightedLineColor (const QColor &col)
+{
+ configStart ();
+
+ m_highlightedLineColorSet = true;
+ m_highlightedLineColor = col;
+
+ configEnd ();
+}
+
+const QColor& KateRendererConfig::lineMarkerColor(KTextEditor::MarkInterface::MarkTypes type) const
+{
+ int index = 0;
+ if (type > 0) { while((type >> index++) ^ 1) {} }
+ index -= 1;
+
+ if ( index < 0 || index >= KTextEditor::MarkInterface::reservedMarkersCount() )
+ {
+ static QColor dummy;
+ return dummy;
+ }
+
+ if (m_lineMarkerColorSet[index] || isGlobal())
+ return m_lineMarkerColor[index];
+
+ return s_global->lineMarkerColor( type );
+}
+
+void KateRendererConfig::setLineMarkerColor (const QColor &col, KTextEditor::MarkInterface::MarkTypes type)
+{
+ int index = static_cast<int>( log(static_cast<double>(type)) / log(2.0) );
+ Q_ASSERT( index >= 0 && index < KTextEditor::MarkInterface::reservedMarkersCount() );
+ configStart ();
+
+ m_lineMarkerColorSet[index] = true;
+ m_lineMarkerColor[index] = col;
+
+ configEnd ();
+}
+
+const QColor& KateRendererConfig::highlightedBracketColor() const
+{
+ if (m_highlightedBracketColorSet || isGlobal())
+ return m_highlightedBracketColor;
+
+ return s_global->highlightedBracketColor();
+}
+
+void KateRendererConfig::setHighlightedBracketColor (const QColor &col)
+{
+ configStart ();
+
+ m_highlightedBracketColorSet = true;
+ m_highlightedBracketColor = col;
+
+ configEnd ();
+}
+
+const QColor& KateRendererConfig::wordWrapMarkerColor() const
+{
+ if (m_wordWrapMarkerColorSet || isGlobal())
+ return m_wordWrapMarkerColor;
+
+ return s_global->wordWrapMarkerColor();
+}
+
+void KateRendererConfig::setWordWrapMarkerColor (const QColor &col)
+{
+ configStart ();
+
+ m_wordWrapMarkerColorSet = true;
+ m_wordWrapMarkerColor = col;
+
+ configEnd ();
+}
+
+const QColor& KateRendererConfig::tabMarkerColor() const
+{
+ if (m_tabMarkerColorSet || isGlobal())
+ return m_tabMarkerColor;
+
+ return s_global->tabMarkerColor();
+}
+
+void KateRendererConfig::setTabMarkerColor (const QColor &col)
+{
+ configStart ();
+
+ m_tabMarkerColorSet = true;
+ m_tabMarkerColor = col;
+
+ configEnd ();
+}
+
+const QColor& KateRendererConfig::iconBarColor() const
+{
+ if (m_iconBarColorSet || isGlobal())
+ return m_iconBarColor;
+
+ return s_global->iconBarColor();
+}
+
+void KateRendererConfig::setIconBarColor (const QColor &col)
+{
+ configStart ();
+
+ m_iconBarColorSet = true;
+ m_iconBarColor = col;
+
+ configEnd ();
+}
+
+const QColor& KateRendererConfig::lineNumberColor() const
+{
+ if (m_lineNumberColorSet || isGlobal())
+ return m_lineNumberColor;
+
+ return s_global->lineNumberColor();
+}
+
+void KateRendererConfig::setLineNumberColor (const QColor &col)
+{
+ configStart ();
+
+ m_lineNumberColorSet = true;
+ m_lineNumberColor = col;
+
+ configEnd ();
+}
+
+bool KateRendererConfig::showIndentationLines () const
+{
+ if (m_showIndentationLinesSet || isGlobal())
+ return m_showIndentationLines;
+
+ return s_global->showIndentationLines();
+}
+
+void KateRendererConfig::setShowIndentationLines (bool on)
+{
+ configStart ();
+
+ m_showIndentationLinesSet = true;
+ m_showIndentationLines = on;
+
+ configEnd ();
+}
+
+//END
+
+// kate: space-indent on; indent-width 2; replace-tabs on;
diff --git a/kate/part/kateconfig.h b/kate/part/kateconfig.h
new file mode 100644
index 000000000..e81234826
--- /dev/null
+++ b/kate/part/kateconfig.h
@@ -0,0 +1,537 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2003 Christoph Cullmann <cullmann@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef __KATE_CONFIG_H__
+#define __KATE_CONFIG_H__
+
+#include <ktexteditor/markinterface.h>
+
+#include <qbitarray.h>
+#include <qcolor.h>
+#include <qobject.h>
+#include <qvaluevector.h>
+
+class KateView;
+class KateDocument;
+class KateRenderer;
+class KateFontStruct;
+class KateFontMetrics;
+
+class KConfig;
+
+class QFont;
+class QTextCodec;
+
+/**
+ * Base Class for the Kate Config Classes
+ */
+class KateConfig
+{
+ public:
+ /**
+ * Default Constructor
+ */
+ KateConfig ();
+
+ /**
+ * Virtual Destructor
+ */
+ virtual ~KateConfig ();
+
+ public:
+ /**
+ * start some config changes
+ * this method is needed to init some kind of transaction
+ * for config changes, update will only be done once, at
+ * configEnd() call
+ */
+ void configStart ();
+
+ /**
+ * end a config change transaction, update the concerned
+ * documents/views/renderers
+ */
+ void configEnd ();
+
+ protected:
+ /**
+ * do the real update
+ */
+ virtual void updateConfig () = 0;
+
+ private:
+ /**
+ * recursion depth
+ */
+ uint configSessionNumber;
+
+ /**
+ * is a config session running
+ */
+ bool configIsRunning;
+};
+
+class KateDocumentConfig : public KateConfig
+{
+ private:
+ friend class KateFactory;
+
+ /**
+ * only used in KateFactory for the static global fallback !!!
+ */
+ KateDocumentConfig ();
+
+ public:
+ /**
+ * Construct a DocumentConfig
+ */
+ KateDocumentConfig (KateDocument *doc);
+
+ /**
+ * Cu DocumentConfig
+ */
+ ~KateDocumentConfig ();
+
+ inline static KateDocumentConfig *global () { return s_global; }
+
+ inline bool isGlobal () const { return (this == global()); }
+
+ public:
+ /**
+ * Read config from object
+ */
+ void readConfig (KConfig *config);
+
+ /**
+ * Write config to object
+ */
+ void writeConfig (KConfig *config);
+
+ protected:
+ void updateConfig ();
+
+ public:
+ int tabWidth () const;
+ void setTabWidth (int tabWidth);
+
+ int indentationWidth () const;
+ void setIndentationWidth (int indentationWidth);
+
+ enum IndentationMode
+ {
+ imNone = 0,
+ imNormal = 1,
+ imCStyle = 2,
+ imPythonStyle = 3,
+ imXmlStyle = 4,
+ imCSAndS = 5,
+ imVarIndent = 6,
+ imScriptIndent = 7
+ };
+
+ uint indentationMode () const;
+ void setIndentationMode (uint identationMode);
+
+ bool wordWrap () const;
+ void setWordWrap (bool on);
+
+ unsigned int wordWrapAt () const;
+ void setWordWrapAt (unsigned int col);
+
+ uint undoSteps () const;
+ void setUndoSteps ( uint undoSteps );
+
+ bool pageUpDownMovesCursor () const;
+ void setPageUpDownMovesCursor (bool on);
+
+ enum ConfigFlags
+ {
+ cfBackspaceIndents= 0x2,
+ cfWordWrap= 0x4,
+ cfRemoveSpaces = 0x10,
+ cfWrapCursor= 0x20,
+ cfAutoBrackets= 0x40,
+ cfTabIndentsMode = 0x200,
+ cfOvr= 0x1000,
+ cfKeepIndentProfile= 0x8000,
+ cfKeepExtraSpaces= 0x10000,
+ cfTabIndents= 0x80000,
+ cfShowTabs= 0x200000,
+ cfSpaceIndent= 0x400000,
+ cfSmartHome = 0x800000,
+ cfTabInsertsTab = 0x1000000,
+ cfReplaceTabsDyn= 0x2000000,
+ cfRemoveTrailingDyn=0x4000000,
+ cfDoxygenAutoTyping=0x8000000 , // Remove for KDE 4.0 (put in indenters)
+ cfMixedIndent = 0x10000000,
+ cfIndentPastedText = 0x20000000
+ };
+
+ uint configFlags () const;
+ void setConfigFlags (KateDocumentConfig::ConfigFlags flag, bool enable);
+ void setConfigFlags (uint fullFlags);
+
+ const QString &encoding () const;
+ QTextCodec *codec ();
+
+ void setEncoding (const QString &encoding);
+
+ bool isSetEncoding () const;
+
+ enum Eol
+ {
+ eolUnix = 0,
+ eolDos = 1,
+ eolMac = 2
+ };
+
+ int eol () const;
+ QString eolString ();
+
+ void setEol (int mode);
+
+ bool allowEolDetection () const;
+ void setAllowEolDetection (bool on);
+
+ enum BackupFlags
+ {
+ LocalFiles=1,
+ RemoteFiles=2
+ };
+
+ uint backupFlags () const;
+ void setBackupFlags (uint flags);
+
+ const QString &backupPrefix () const;
+ void setBackupPrefix (const QString &prefix);
+
+ const QString &backupSuffix () const;
+ void setBackupSuffix (const QString &suffix);
+
+ bool plugin (uint index) const;
+ void setPlugin (uint index, bool load);
+
+ /**
+ * Should Kate Part search for dir wide config file
+ * and if, how depth?
+ * @return search depth (< 0 no search)
+ */
+ int searchDirConfigDepth () const;
+
+ void setSearchDirConfigDepth (int depth);
+
+ private:
+ int m_tabWidth;
+ int m_indentationWidth;
+ uint m_indentationMode;
+ bool m_wordWrap;
+ int m_wordWrapAt;
+ uint m_undoSteps;
+ bool m_pageUpDownMovesCursor;
+ uint m_configFlags;
+ QString m_encoding;
+ int m_eol;
+ bool m_allowEolDetection;
+ uint m_backupFlags;
+ int m_searchDirConfigDepth;
+ QString m_backupPrefix;
+ QString m_backupSuffix;
+ QBitArray m_plugins;
+
+ bool m_tabWidthSet : 1;
+ bool m_indentationWidthSet : 1;
+ bool m_indentationModeSet : 1;
+ bool m_wordWrapSet : 1;
+ bool m_wordWrapAtSet : 1;
+ bool m_pageUpDownMovesCursorSet : 1;
+ bool m_undoStepsSet : 1;
+ uint m_configFlagsSet;
+ bool m_encodingSet : 1;
+ bool m_eolSet : 1;
+ bool m_allowEolDetectionSet : 1;
+ bool m_backupFlagsSet : 1;
+ bool m_searchDirConfigDepthSet : 1;
+ bool m_backupPrefixSet : 1;
+ bool m_backupSuffixSet : 1;
+ QBitArray m_pluginsSet;
+
+ private:
+ static KateDocumentConfig *s_global;
+ KateDocument *m_doc;
+};
+
+class KateViewConfig : public KateConfig
+{
+ private:
+ friend class KateFactory;
+
+ /**
+ * only used in KateFactory for the static global fallback !!!
+ */
+ KateViewConfig ();
+
+ public:
+ /**
+ * Construct a DocumentConfig
+ */
+ KateViewConfig (KateView *view);
+
+ /**
+ * Cu DocumentConfig
+ */
+ ~KateViewConfig ();
+
+ inline static KateViewConfig *global () { return s_global; }
+
+ inline bool isGlobal () const { return (this == global()); }
+
+ public:
+ /**
+ * Read config from object
+ */
+ void readConfig (KConfig *config);
+
+ /**
+ * Write config to object
+ */
+ void writeConfig (KConfig *config);
+
+ protected:
+ void updateConfig ();
+
+ public:
+ bool dynWordWrap () const;
+ void setDynWordWrap (bool wrap);
+
+ int dynWordWrapIndicators () const;
+ void setDynWordWrapIndicators (int mode);
+
+ int dynWordWrapAlignIndent () const;
+ void setDynWordWrapAlignIndent (int indent);
+
+ bool lineNumbers () const;
+ void setLineNumbers (bool on);
+
+ bool scrollBarMarks () const;
+ void setScrollBarMarks (bool on);
+
+ bool iconBar () const;
+ void setIconBar (bool on);
+
+ bool foldingBar () const;
+ void setFoldingBar (bool on);
+
+ int bookmarkSort () const;
+ void setBookmarkSort (int mode);
+
+ int autoCenterLines() const;
+ void setAutoCenterLines (int lines);
+
+ long searchFlags () const;
+ void setSearchFlags (long flags);
+
+ bool cmdLine () const;
+ void setCmdLine (bool on);
+
+ uint defaultMarkType () const;
+ void setDefaultMarkType (uint type);
+
+ bool persistentSelection () const;
+ void setPersistentSelection (bool on);
+
+ enum TextToSearch
+ {
+ Nowhere = 0,
+ SelectionOnly = 1,
+ SelectionWord = 2,
+ WordOnly = 3,
+ WordSelection = 4
+ };
+
+ int textToSearchMode () const;
+ void setTextToSearchMode (int mode);
+
+ private:
+ bool m_dynWordWrap;
+ int m_dynWordWrapIndicators;
+ int m_dynWordWrapAlignIndent;
+ bool m_lineNumbers;
+ bool m_scrollBarMarks;
+ bool m_iconBar;
+ bool m_foldingBar;
+ int m_bookmarkSort;
+ int m_autoCenterLines;
+ long m_searchFlags;
+ bool m_cmdLine;
+ uint m_defaultMarkType;
+ bool m_persistentSelection;
+ int m_textToSearchMode;
+
+ bool m_dynWordWrapSet : 1;
+ bool m_dynWordWrapIndicatorsSet : 1;
+ bool m_dynWordWrapAlignIndentSet : 1;
+ bool m_lineNumbersSet : 1;
+ bool m_scrollBarMarksSet : 1;
+ bool m_iconBarSet : 1;
+ bool m_foldingBarSet : 1;
+ bool m_bookmarkSortSet : 1;
+ bool m_autoCenterLinesSet : 1;
+ bool m_searchFlagsSet : 1;
+ bool m_cmdLineSet : 1;
+ bool m_defaultMarkTypeSet : 1;
+ bool m_persistentSelectionSet : 1;
+ bool m_textToSearchModeSet : 1;
+
+ private:
+ static KateViewConfig *s_global;
+ KateView *m_view;
+};
+
+class KateRendererConfig : public KateConfig
+{
+ private:
+ friend class KateFactory;
+
+ /**
+ * only used in KateFactory for the static global fallback !!!
+ */
+ KateRendererConfig ();
+
+
+ public:
+ /**
+ * Construct a DocumentConfig
+ */
+ KateRendererConfig (KateRenderer *renderer);
+
+ /**
+ * Cu DocumentConfig
+ */
+ ~KateRendererConfig ();
+
+ inline static KateRendererConfig *global () { return s_global; }
+
+ inline bool isGlobal () const { return (this == global()); }
+
+ public:
+ /**
+ * Read config from object
+ */
+ void readConfig (KConfig *config);
+
+ /**
+ * Write config to object
+ */
+ void writeConfig (KConfig *config);
+
+ protected:
+ void updateConfig ();
+
+ public:
+ uint schema () const;
+ void setSchema (uint schema);
+ /**
+ * Reload the schema from the schema manager.
+ * For the global instance, have all other instances reload.
+ * Used by the schema config page to apply changes.
+ */
+ void reloadSchema();
+
+ KateFontStruct *fontStruct ();
+ QFont *font();
+ KateFontMetrics *fontMetrics();
+
+ void setFont(const QFont &font);
+
+ bool wordWrapMarker () const;
+ void setWordWrapMarker (bool on);
+
+ const QColor& backgroundColor() const;
+ void setBackgroundColor (const QColor &col);
+
+ const QColor& selectionColor() const;
+ void setSelectionColor (const QColor &col);
+
+ const QColor& highlightedLineColor() const;
+ void setHighlightedLineColor (const QColor &col);
+
+ const QColor& lineMarkerColor(KTextEditor::MarkInterface::MarkTypes type = KTextEditor::MarkInterface::markType01) const; // markType01 == Bookmark
+ void setLineMarkerColor (const QColor &col, KTextEditor::MarkInterface::MarkTypes type = KTextEditor::MarkInterface::markType01);
+
+ const QColor& highlightedBracketColor() const;
+ void setHighlightedBracketColor (const QColor &col);
+
+ const QColor& wordWrapMarkerColor() const;
+ void setWordWrapMarkerColor (const QColor &col);
+
+ const QColor& tabMarkerColor() const;
+ void setTabMarkerColor (const QColor &col);
+
+ const QColor& iconBarColor() const;
+ void setIconBarColor (const QColor &col);
+
+ // the line number color is used for the line numbers on the left bar and
+ // for vertical separator lines and for code folding lines.
+ const QColor& lineNumberColor() const;
+ void setLineNumberColor (const QColor &col);
+
+ bool showIndentationLines () const;
+ void setShowIndentationLines (bool on);
+
+ private:
+ /**
+ * Read the schema properties from the config file.
+ */
+ void setSchemaInternal(int schema);
+
+ uint m_schema;
+ KateFontStruct *m_font;
+ bool m_wordWrapMarker;
+ bool m_showIndentationLines;
+ QColor m_backgroundColor;
+ QColor m_selectionColor;
+ QColor m_highlightedLineColor;
+ QColor m_highlightedBracketColor;
+ QColor m_wordWrapMarkerColor;
+ QColor m_tabMarkerColor;
+ QColor m_iconBarColor;
+ QColor m_lineNumberColor;
+ QValueVector<QColor> m_lineMarkerColor;
+
+ bool m_schemaSet : 1;
+ bool m_fontSet : 1;
+ bool m_wordWrapMarkerSet : 1;
+ bool m_showIndentationLinesSet : 1;
+ bool m_backgroundColorSet : 1;
+ bool m_selectionColorSet : 1;
+ bool m_highlightedLineColorSet : 1;
+ bool m_highlightedBracketColorSet : 1;
+ bool m_wordWrapMarkerColorSet : 1;
+ bool m_tabMarkerColorSet : 1;
+ bool m_iconBarColorSet : 1;
+ bool m_lineNumberColorSet : 1;
+ QBitArray m_lineMarkerColorSet;
+
+ private:
+ static KateRendererConfig *s_global;
+ KateRenderer *m_renderer;
+};
+
+#endif
+
+// kate: space-indent on; indent-width 2; replace-tabs on;
diff --git a/kate/part/katecursor.cpp b/kate/part/katecursor.cpp
new file mode 100644
index 000000000..a67b7e475
--- /dev/null
+++ b/kate/part/katecursor.cpp
@@ -0,0 +1,192 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2002 Christian Couder <christian@kdevelop.org>
+ Copyright (C) 2001, 2003 Christoph Cullmann <cullmann@kde.org>
+ Copyright (C) 2001 Joseph Wenninger <jowenn@kde.org>
+ Copyright (C) 1999 Jochen Wilhelmy <digisnap@cs.tu-berlin.de>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "katecursor.h"
+
+#include "katedocument.h"
+#include "katetextline.h"
+
+//
+// KateDocCursor implementation
+//
+
+KateDocCursor::KateDocCursor(KateDocument *doc) : KateTextCursor(), m_doc(doc)
+{
+}
+
+KateDocCursor::KateDocCursor(int line, int col, KateDocument *doc)
+ : KateTextCursor(line, col), m_doc(doc)
+{
+}
+
+bool KateDocCursor::validPosition(uint line, uint col)
+{
+ return line < m_doc->numLines() && (int)col <= m_doc->lineLength(line);
+}
+
+bool KateDocCursor::validPosition()
+{
+ return validPosition(line(), col());
+}
+
+void KateDocCursor::position(uint *pline, uint *pcol) const
+{
+ if (pline)
+ *pline = (uint)line();
+
+ if (pcol)
+ *pcol = (uint)col();
+}
+
+bool KateDocCursor::setPosition(uint line, uint col)
+{
+ bool ok = validPosition(line, col);
+
+ if(ok)
+ setPos(line, col);
+
+ return ok;
+}
+
+bool KateDocCursor::gotoNextLine()
+{
+ bool ok = (line() + 1 < (int)m_doc->numLines());
+
+ if (ok) {
+ m_line++;
+ m_col = 0;
+ }
+
+ return ok;
+}
+
+bool KateDocCursor::gotoPreviousLine()
+{
+ bool ok = (line() > 0);
+
+ if (ok) {
+ m_line--;
+ m_col = 0;
+ }
+
+ return ok;
+}
+
+bool KateDocCursor::gotoEndOfNextLine()
+{
+ bool ok = gotoNextLine();
+ if(ok)
+ m_col = m_doc->lineLength(line());
+
+ return ok;
+}
+
+bool KateDocCursor::gotoEndOfPreviousLine()
+{
+ bool ok = gotoPreviousLine();
+ if(ok)
+ m_col = m_doc->lineLength(line());
+
+ return ok;
+}
+
+int KateDocCursor::nbCharsOnLineAfter()
+{
+ return ((int)m_doc->lineLength(line()) - col());
+}
+
+bool KateDocCursor::moveForward(uint nbChar)
+{
+ int nbCharLeft = nbChar - nbCharsOnLineAfter();
+
+ if(nbCharLeft > 0) {
+ return gotoNextLine() && moveForward((uint)nbCharLeft);
+ } else {
+ m_col += nbChar;
+ return true;
+ }
+}
+
+bool KateDocCursor::moveBackward(uint nbChar)
+{
+ int nbCharLeft = nbChar - m_col;
+ if(nbCharLeft > 0) {
+ return gotoEndOfPreviousLine() && moveBackward((uint)nbCharLeft);
+ } else {
+ m_col -= nbChar;
+ return true;
+ }
+}
+
+bool KateDocCursor::insertText(const QString& s)
+{
+ return m_doc->insertText(line(), col(), s);
+}
+
+bool KateDocCursor::removeText(uint nbChar)
+{
+ // Get a cursor at the end of the removed area
+ KateDocCursor endCursor = *this;
+ endCursor.moveForward(nbChar);
+
+ // Remove the text
+ return m_doc->removeText((uint)line(), (uint)col(),
+ (uint)endCursor.line(), (uint)endCursor.col());
+}
+
+QChar KateDocCursor::currentChar() const
+{
+ return m_doc->plainKateTextLine(line())->getChar(col());
+}
+
+uchar KateDocCursor::currentAttrib() const
+{
+ return m_doc->plainKateTextLine(line())->attribute(col());
+}
+
+bool KateDocCursor::nextNonSpaceChar()
+{
+ for(; m_line < (int)m_doc->numLines(); m_line++) {
+ m_col = m_doc->plainKateTextLine(line())->nextNonSpaceChar(col());
+ if(m_col != -1)
+ return true; // Next non-space char found
+ m_col = 0;
+ }
+ // No non-space char found
+ setPos(-1, -1);
+ return false;
+}
+
+bool KateDocCursor::previousNonSpaceChar()
+{
+ while (true) {
+ m_col = m_doc->plainKateTextLine(line())->previousNonSpaceChar(col());
+ if(m_col != -1) return true; // Previous non-space char found
+ if(m_line == 0) return false;
+ --m_line;
+ m_col = m_doc->plainKateTextLine(m_line)->length();
+ }
+ // No non-space char found
+ setPos(-1, -1);
+ return false;
+}
+
+// kate: space-indent on; indent-width 2; replace-tabs on;
diff --git a/kate/part/katecursor.h b/kate/part/katecursor.h
new file mode 100644
index 000000000..20a86d5d9
--- /dev/null
+++ b/kate/part/katecursor.h
@@ -0,0 +1,250 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2002 Christian Couder <christian@kdevelop.org>
+ Copyright (C) 2001, 2003 Christoph Cullmann <cullmann@kde.org>
+ Copyright (C) 2001 Joseph Wenninger <jowenn@kde.org>
+ Copyright (C) 1999 Jochen Wilhelmy <digisnap@cs.tu-berlin.de>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef kate_cursor_h
+#define kate_cursor_h
+
+#include "../interfaces/document.h"
+#include <kdebug.h>
+
+class KateDocument;
+
+/**
+ Simple cursor class with no document pointer.
+*/
+class KateTextCursor
+{
+ public:
+ KateTextCursor() : m_line(0), m_col(0) {};
+ KateTextCursor(int line, int col) : m_line(line), m_col(col) {};
+ virtual ~KateTextCursor () {};
+
+ friend bool operator==(const KateTextCursor& c1, const KateTextCursor& c2)
+ { return c1.m_line == c2.m_line && c1.m_col == c2.m_col; }
+
+ friend bool operator!=(const KateTextCursor& c1, const KateTextCursor& c2)
+ { return !(c1 == c2); }
+
+ friend bool operator>(const KateTextCursor& c1, const KateTextCursor& c2)
+ { return c1.m_line > c2.m_line || (c1.m_line == c2.m_line && c1.m_col > c2.m_col); }
+
+ friend bool operator>=(const KateTextCursor& c1, const KateTextCursor& c2)
+ { return c1.m_line > c2.m_line || (c1.m_line == c2.m_line && c1.m_col >= c2.m_col); }
+
+ friend bool operator<(const KateTextCursor& c1, const KateTextCursor& c2)
+ { return !(c1 >= c2); }
+
+ friend bool operator<=(const KateTextCursor& c1, const KateTextCursor& c2)
+ { return !(c1 > c2); }
+
+ friend kdbgstream& operator<<(kdbgstream& stream, const KateTextCursor& c) {
+ stream << c.m_line << "," << c.m_col;
+ return stream;
+ }
+
+#ifndef Q_WS_WIN //not needed
+ friend void qSwap(KateTextCursor & c1, KateTextCursor & c2) {
+ KateTextCursor tmp = c1;
+ c1 = c2;
+ c2 = tmp;
+ }
+#endif
+
+ inline void pos(int *pline, int *pcol) const {
+ if(pline) *pline = m_line;
+ if(pcol) *pcol = m_col;
+ }
+
+ inline int line() const { return m_line; };
+ inline int col() const { return m_col; };
+
+ virtual void setLine(int line) { m_line = line; };
+ virtual void setCol(int col) { m_col = col; };
+ virtual void setPos(const KateTextCursor& pos) { m_line = pos.line(); m_col = pos.col(); };
+ virtual void setPos(int line, int col) { m_line = line; m_col = col; };
+
+ protected:
+ int m_line;
+ int m_col;
+};
+
+/**
+ Cursor class with a pointer to its document.
+*/
+class KateDocCursor : public KateTextCursor
+{
+ public:
+ KateDocCursor(KateDocument *doc);
+ KateDocCursor(int line, int col, KateDocument *doc);
+ virtual ~KateDocCursor() {};
+
+ bool validPosition(uint line, uint col);
+ bool validPosition();
+
+ bool gotoNextLine();
+ bool gotoPreviousLine();
+ bool gotoEndOfNextLine();
+ bool gotoEndOfPreviousLine();
+
+ int nbCharsOnLineAfter();
+ bool moveForward(uint nbChar);
+ bool moveBackward(uint nbChar);
+
+ // KTextEditor::Cursor interface
+ void position(uint *line, uint *col) const;
+ bool setPosition(uint line, uint col);
+ bool insertText(const QString& text);
+ bool removeText(uint numberOfCharacters);
+ QChar currentChar() const;
+
+ uchar currentAttrib() const;
+
+ /**
+ Find the position (line and col) of the next char
+ that is not a space. If found KateDocCursor points to the
+ found character. Otherwise to a invalid Position such that
+ validPosition() returns false.
+ @return True if the specified or a following character is not a space
+ Otherwise false.
+ */
+ bool nextNonSpaceChar();
+
+ /**
+ Find the position (line and col) of the previous char
+ that is not a space. If found KateDocCursor points to the
+ found character. Otherwise to a invalid Position such that
+ validPosition() returns false.
+ @return True if the specified or a preceding character is not a space
+ Otherwise false.
+ */
+ bool previousNonSpaceChar();
+
+ protected:
+ KateDocument *m_doc;
+};
+
+class KateRange
+{
+ public:
+ KateRange () {};
+ virtual ~KateRange () {};
+
+ virtual bool isValid() const = 0;
+ virtual KateTextCursor& start() = 0;
+ virtual KateTextCursor& end() = 0;
+ virtual const KateTextCursor& start() const = 0;
+ virtual const KateTextCursor& end() const = 0;
+};
+
+class KateTextRange : public KateRange
+{
+ public:
+ KateTextRange()
+ : m_valid(false)
+ {
+ };
+
+ KateTextRange(int startline, int startcol, int endline, int endcol)
+ : m_start(startline, startcol)
+ , m_end(endline, endcol)
+ , m_valid(true)
+ {
+ normalize();
+ };
+
+ KateTextRange(const KateTextCursor& start, const KateTextCursor& end)
+ : m_start(start)
+ , m_end(end)
+ , m_valid(true)
+ {
+ normalize();
+ };
+
+ virtual ~KateTextRange () {};
+
+ virtual bool isValid() const { return m_valid; };
+ void setValid(bool valid) {
+ m_valid = valid;
+ if( valid )
+ normalize();
+ };
+
+ virtual KateTextCursor& start() { return m_start; };
+ virtual KateTextCursor& end() { return m_end; };
+ virtual const KateTextCursor& start() const { return m_start; };
+ virtual const KateTextCursor& end() const { return m_end; };
+
+ /* if range is not valid, the result is undefined
+ if cursor is before start -1 is returned, if cursor is within range 0 is returned if cursor is after end 1 is returned*/
+ inline int cursorInRange(const KateTextCursor &cursor) const {
+ return ((cursor<m_start)?(-1):((cursor>m_end)?1:0));
+ }
+
+ inline void normalize() {
+ if( m_start > m_end )
+ qSwap(m_start, m_end);
+ }
+
+ protected:
+ KateTextCursor m_start, m_end;
+ bool m_valid;
+};
+
+
+class KateBracketRange : public KateTextRange
+{
+ public:
+ KateBracketRange()
+ : KateTextRange()
+ , m_minIndent(0)
+ {
+ };
+
+ KateBracketRange(int startline, int startcol, int endline, int endcol, int minIndent)
+ : KateTextRange(startline, startcol, endline, endcol)
+ , m_minIndent(minIndent)
+ {
+ };
+
+ KateBracketRange(const KateTextCursor& start, const KateTextCursor& end, int minIndent)
+ : KateTextRange(start, end)
+ , m_minIndent(minIndent)
+ {
+ };
+
+ int getMinIndent() const
+ {
+ return m_minIndent;
+ }
+
+ void setIndentMin(int m)
+ {
+ m_minIndent = m;
+ }
+
+ protected:
+ int m_minIndent;
+};
+
+
+#endif
+
+// kate: space-indent on; indent-width 2; replace-tabs on;
diff --git a/kate/part/katedialogs.cpp b/kate/part/katedialogs.cpp
new file mode 100644
index 000000000..91da42e8f
--- /dev/null
+++ b/kate/part/katedialogs.cpp
@@ -0,0 +1,1740 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2002, 2003 Anders Lund <anders.lund@lund.tdcadsl.dk>
+ Copyright (C) 2003 Christoph Cullmann <cullmann@kde.org>
+ Copyright (C) 2001 Joseph Wenninger <jowenn@kde.org>
+
+ Based on work of:
+ Copyright (C) 1999 Jochen Wilhelmy <digisnap@cs.tu-berlin.de>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+//BEGIN Includes
+#include "katedialogs.h"
+#include "katedialogs.moc"
+
+#include "kateautoindent.h"
+#include "katebuffer.h"
+#include "kateconfig.h"
+#include "katedocument.h"
+#include "katefactory.h"
+#include "kateschema.h"
+#include "katesyntaxdocument.h"
+#include "kateview.h"
+
+
+#include <ktexteditor/configinterfaceextension.h>
+#include <ktexteditor/plugin.h>
+
+#include <kio/job.h>
+#include <kio/jobclasses.h>
+#include <kio/netaccess.h>
+
+#include <kaccel.h>
+#include <kapplication.h>
+#include <kbuttonbox.h>
+#include <kcharsets.h>
+#include <kcolorbutton.h>
+#include <kcolorcombo.h>
+#include <kcolordialog.h>
+#include <kcombobox.h>
+#include <kconfig.h>
+#include <kdebug.h>
+#include <kfontdialog.h>
+#include <kglobal.h>
+#include <kglobalsettings.h>
+#include <kiconloader.h>
+#include <kkeybutton.h>
+#include <kkeydialog.h>
+#include <klineedit.h>
+#include <klistview.h>
+#include <klocale.h>
+#include <kmessagebox.h>
+#include <kmimetypechooser.h>
+#include <knuminput.h>
+#include <kparts/componentfactory.h>
+#include <kpopupmenu.h>
+#include <kprocess.h>
+#include <kprocio.h>
+#include <kregexpeditorinterface.h>
+#include <krun.h>
+#include <kseparator.h>
+#include <kstandarddirs.h>
+#include <ktempfile.h>
+
+#include <qbuttongroup.h>
+#include <qcheckbox.h>
+#include <qcombobox.h>
+#include <qdialog.h>
+#include <qdom.h>
+#include <qfile.h>
+#include <qgrid.h>
+#include <qgroupbox.h>
+#include <qhbox.h>
+#include <qheader.h>
+#include <qhgroupbox.h>
+#include <qlabel.h>
+#include <qlayout.h>
+#include <qlineedit.h>
+#include <qlistbox.h>
+#include <qlistview.h>
+#include <qmap.h>
+#include <qobjectlist.h>
+#include <qpainter.h>
+#include <qpointarray.h>
+#include <qptrcollection.h>
+#include <qpushbutton.h>
+#include <qradiobutton.h>
+#include <qslider.h>
+#include <qspinbox.h>
+#include <qstringlist.h>
+#include <qtabwidget.h>
+#include <qtextcodec.h>
+#include <qtoolbutton.h>
+#include <qvbox.h>
+#include <qvgroupbox.h>
+#include <qwhatsthis.h>
+#include <qwidgetstack.h>
+
+// trailing slash is important
+#define HLDOWNLOADPATH "http://kate.kde.org/syntax/"
+
+//END
+
+//BEGIN KateConfigPage
+KateConfigPage::KateConfigPage ( QWidget *parent, const char *name )
+ : Kate::ConfigPage (parent, name)
+ , m_changed (false)
+{
+ connect (this, SIGNAL(changed()), this, SLOT(somethingHasChanged ()));
+}
+
+KateConfigPage::~KateConfigPage ()
+{
+}
+
+void KateConfigPage::somethingHasChanged ()
+{
+ m_changed = true;
+ kdDebug (13000) << "TEST: something changed on the config page: " << this << endl;
+}
+//END KateConfigPage
+
+//BEGIN KateIndentConfigTab
+const int KateIndentConfigTab::flags[] = {
+ KateDocument::cfSpaceIndent,
+ KateDocument::cfKeepIndentProfile,
+ KateDocument::cfKeepExtraSpaces,
+ KateDocument::cfTabIndents,
+ KateDocument::cfBackspaceIndents,
+ KateDocumentConfig::cfDoxygenAutoTyping,
+ KateDocumentConfig::cfMixedIndent,
+ KateDocumentConfig::cfIndentPastedText
+};
+
+KateIndentConfigTab::KateIndentConfigTab(QWidget *parent)
+ : KateConfigPage(parent)
+{
+ QVBoxLayout *layout = new QVBoxLayout(this, 0, KDialog::spacingHint() );
+ int configFlags = KateDocumentConfig::global()->configFlags();
+
+ QVGroupBox *gbAuto = new QVGroupBox(i18n("Automatic Indentation"), this);
+
+ QHBox *indentLayout = new QHBox(gbAuto);
+ indentLayout->setSpacing(KDialog::spacingHint());
+ QLabel *indentLabel = new QLabel(i18n("&Indentation mode:"), indentLayout);
+ m_indentMode = new KComboBox (indentLayout);
+ m_indentMode->insertStringList (KateAutoIndent::listModes());
+ indentLabel->setBuddy(m_indentMode);
+ m_configPage = new QPushButton(SmallIconSet("configure"), i18n("Configure..."), indentLayout);
+
+ opt[5] = new QCheckBox(i18n("Insert leading Doxygen \"*\" when typing"), gbAuto);
+ opt[7] = new QCheckBox(i18n("Adjust indentation of code pasted from the clipboard"), gbAuto);
+
+ QVGroupBox *gbSpaces = new QVGroupBox(i18n("Indentation with Spaces"), this);
+ QVBox *spaceLayout = new QVBox(gbSpaces);
+ opt[0] = new QCheckBox(i18n("Use &spaces instead of tabs to indent"), spaceLayout );
+ opt[6] = new QCheckBox(i18n("Emacs style mixed mode"), spaceLayout);
+
+ indentationWidth = new KIntNumInput(KateDocumentConfig::global()->indentationWidth(), spaceLayout);
+ indentationWidth->setRange(1, 16, 1, false);
+ indentationWidth->setLabel(i18n("Number of spaces:"), AlignVCenter);
+
+ opt[1] = new QCheckBox(i18n("Keep indent &profile"), this);
+ opt[2] = new QCheckBox(i18n("&Keep extra spaces"), this);
+
+ QVGroupBox *keys = new QVGroupBox(i18n("Keys to Use"), this);
+ opt[3] = new QCheckBox(i18n("&Tab key indents"), keys);
+ opt[4] = new QCheckBox(i18n("&Backspace key indents"), keys);
+
+ QRadioButton *rb1, *rb2, *rb3;
+ m_tabs = new QButtonGroup( 1, Qt::Horizontal, i18n("Tab Key Mode if Nothing Selected"), this );
+ m_tabs->setRadioButtonExclusive( true );
+ m_tabs->insert( rb1=new QRadioButton( i18n("Insert indent &characters"), m_tabs ), 0 );
+ m_tabs->insert( rb2=new QRadioButton( i18n("I&nsert tab character"), m_tabs ), 1 );
+ m_tabs->insert( rb3=new QRadioButton( i18n("Indent current &line"), m_tabs ), 2 );
+
+ opt[0]->setChecked(configFlags & flags[0]);
+ opt[1]->setChecked(configFlags & flags[1]);
+ opt[2]->setChecked(configFlags & flags[2]);
+ opt[3]->setChecked(configFlags & flags[3]);
+ opt[4]->setChecked(configFlags & flags[4]);
+ opt[5]->setChecked(configFlags & flags[5]);
+ opt[6]->setChecked(configFlags & flags[6]);
+ opt[7]->setChecked(configFlags & flags[7]);
+
+ layout->addWidget(gbAuto);
+ layout->addWidget(gbSpaces);
+ layout->addWidget(opt[1]);
+ layout->addWidget(opt[2]);
+ layout->addWidget(keys);
+ layout->addWidget(m_tabs, 0);
+
+ layout->addStretch();
+
+ // What is this? help
+ QWhatsThis::add(opt[0], i18n(
+ "Check this if you want to indent with spaces rather than tabs."));
+ QWhatsThis::add(opt[2], i18n(
+ "Indentations of more than the selected number of spaces will not be "
+ "shortened."));
+ QWhatsThis::add(opt[3], i18n(
+ "This allows the <b>Tab</b> key to be used to increase the indentation "
+ "level."));
+ QWhatsThis::add(opt[4], i18n(
+ "This allows the <b>Backspace</b> key to be used to decrease the "
+ "indentation level."));
+ QWhatsThis::add(opt[5], i18n(
+ "Automatically inserts a leading \"*\" while typing within a Doxygen "
+ "style comment."));
+ QWhatsThis::add( opt[6], i18n(
+ "Use a mix of tab and space characters for indentation.") );
+ QWhatsThis::add( opt[7], i18n(
+ "If this option is selected, pasted code from the clipboard is indented. "
+ "Triggering the <b>undo</b>-action removes the indentation.") );
+ QWhatsThis::add(indentationWidth, i18n("The number of spaces to indent with."));
+
+ QWhatsThis::add(m_configPage, i18n(
+ "If this button is enabled, additional indenter specific options are "
+ "available and can be configured in an extra dialog.") );
+
+ reload ();
+
+ //
+ // after initial reload, connect the stuff for the changed () signal
+ //
+
+ connect(m_indentMode, SIGNAL(activated(int)), this, SLOT(slotChanged()));
+ connect(m_indentMode, SIGNAL(activated(int)), this, SLOT(indenterSelected(int)));
+
+ connect( opt[0], SIGNAL(toggled(bool)), this, SLOT(somethingToggled()));
+
+ connect( opt[0], SIGNAL( toggled(bool) ), this, SLOT( slotChanged() ) );
+ connect( opt[1], SIGNAL( toggled(bool) ), this, SLOT( slotChanged() ) );
+ connect( opt[2], SIGNAL( toggled(bool) ), this, SLOT( slotChanged() ) );
+ connect( opt[3], SIGNAL( toggled(bool) ), this, SLOT( slotChanged() ) );
+ connect( opt[4], SIGNAL( toggled(bool) ), this, SLOT( slotChanged() ) );
+ connect( opt[5], SIGNAL( toggled(bool) ), this, SLOT( slotChanged() ) );
+ connect( opt[6], SIGNAL( toggled(bool) ), this, SLOT( slotChanged() ) );
+ connect( opt[7], SIGNAL( toggled(bool) ), this, SLOT( slotChanged() ) );
+
+ connect(indentationWidth, SIGNAL(valueChanged(int)), this, SLOT(slotChanged()));
+
+ connect(rb1, SIGNAL(toggled(bool)), this, SLOT(slotChanged()));
+ connect(rb2, SIGNAL(toggled(bool)), this, SLOT(slotChanged()));
+ connect(rb3, SIGNAL(toggled(bool)), this, SLOT(slotChanged()));
+
+ connect(m_configPage, SIGNAL(clicked()), this, SLOT(configPage()));
+}
+
+void KateIndentConfigTab::somethingToggled() {
+ indentationWidth->setEnabled(opt[0]->isChecked());
+ opt[6]->setEnabled(opt[0]->isChecked());
+}
+
+void KateIndentConfigTab::indenterSelected (int index)
+{
+ if (index == KateDocumentConfig::imCStyle || index == KateDocumentConfig::imCSAndS)
+ opt[5]->setEnabled(true);
+ else
+ opt[5]->setEnabled(false);
+
+ m_configPage->setEnabled( KateAutoIndent::hasConfigPage(index) );
+}
+
+void KateIndentConfigTab::configPage()
+{
+ uint index = m_indentMode->currentItem();
+ if ( KateAutoIndent::hasConfigPage(index) )
+ {
+ KDialogBase dlg(this, "indenter_config_dialog", true, i18n("Configure Indenter"),
+ KDialogBase::Ok|KDialogBase::Cancel, KDialogBase::Cancel, true);
+
+ QVBox *box = new QVBox(&dlg);
+ box->setSpacing( KDialog::spacingHint() );
+ dlg.setMainWidget(box);
+ new QLabel("<qt><b>" + KateAutoIndent::modeDescription(index) + "</b></qt>", box);
+ new KSeparator(KSeparator::HLine, box);
+
+ IndenterConfigPage* page = KateAutoIndent::configPage(box, index);
+
+ if (!page) return;
+ box->setStretchFactor(page, 1);
+
+ connect( &dlg, SIGNAL(okClicked()), page, SLOT(apply()) );
+
+ dlg.resize(400, 300);
+ dlg.exec();
+ }
+}
+
+void KateIndentConfigTab::apply ()
+{
+ // nothing changed, no need to apply stuff
+ if (!changed())
+ return;
+ m_changed = false;
+
+ KateDocumentConfig::global()->configStart ();
+
+ int configFlags, z;
+
+ configFlags = KateDocumentConfig::global()->configFlags();
+ for (z = 0; z < numFlags; z++) {
+ configFlags &= ~flags[z];
+ if (opt[z]->isChecked()) configFlags |= flags[z];
+ }
+
+ KateDocumentConfig::global()->setConfigFlags(configFlags);
+ KateDocumentConfig::global()->setIndentationWidth(indentationWidth->value());
+
+ KateDocumentConfig::global()->setIndentationMode(m_indentMode->currentItem());
+
+ KateDocumentConfig::global()->setConfigFlags (KateDocumentConfig::cfTabIndentsMode, 2 == m_tabs->id (m_tabs->selected()));
+ KateDocumentConfig::global()->setConfigFlags (KateDocumentConfig::cfTabInsertsTab, 1 == m_tabs->id (m_tabs->selected()));
+
+ KateDocumentConfig::global()->configEnd ();
+}
+
+void KateIndentConfigTab::reload ()
+{
+ if (KateDocumentConfig::global()->configFlags() & KateDocumentConfig::cfTabIndentsMode)
+ m_tabs->setButton (2);
+ else if (KateDocumentConfig::global()->configFlags() & KateDocumentConfig::cfTabInsertsTab)
+ m_tabs->setButton (1);
+ else
+ m_tabs->setButton (0);
+
+ m_indentMode->setCurrentItem (KateDocumentConfig::global()->indentationMode());
+
+ somethingToggled ();
+ indenterSelected (m_indentMode->currentItem());
+}
+//END KateIndentConfigTab
+
+//BEGIN KateSelectConfigTab
+const int KateSelectConfigTab::flags[] = {};
+
+KateSelectConfigTab::KateSelectConfigTab(QWidget *parent)
+ : KateConfigPage(parent)
+{
+ int configFlags = KateDocumentConfig::global()->configFlags();
+
+ QVBoxLayout *layout = new QVBoxLayout(this, 0, KDialog::spacingHint() );
+
+ QVGroupBox *gbCursor = new QVGroupBox(i18n("Text Cursor Movement"), this);
+
+ opt[0] = new QCheckBox(i18n("Smart ho&me and smart end"), gbCursor);
+ opt[0]->setChecked(configFlags & KateDocumentConfig::cfSmartHome);
+ connect(opt[0], SIGNAL(toggled(bool)), this, SLOT(slotChanged()));
+
+ opt[1] = new QCheckBox(i18n("Wrap c&ursor"), gbCursor);
+ opt[1]->setChecked(configFlags & KateDocumentConfig::cfWrapCursor);
+ connect(opt[1], SIGNAL(toggled(bool)), this, SLOT(slotChanged()));
+
+ e6 = new QCheckBox(i18n("&PageUp/PageDown moves cursor"), gbCursor);
+ e6->setChecked(KateDocumentConfig::global()->pageUpDownMovesCursor());
+ connect(e6, SIGNAL(toggled(bool)), this, SLOT(slotChanged()));
+
+ e4 = new KIntNumInput(KateViewConfig::global()->autoCenterLines(), gbCursor);
+ e4->setRange(0, 1000000, 1, false);
+ e4->setLabel(i18n("Autocenter cursor (lines):"), AlignVCenter);
+ connect(e4, SIGNAL(valueChanged(int)), this, SLOT(slotChanged()));
+
+ layout->addWidget(gbCursor);
+
+ QRadioButton *rb1, *rb2;
+
+ m_tabs = new QButtonGroup( 1, Qt::Horizontal, i18n("Selection Mode"), this );
+ layout->add (m_tabs);
+
+ m_tabs->setRadioButtonExclusive( true );
+ m_tabs->insert( rb1=new QRadioButton( i18n("&Normal"), m_tabs ), 0 );
+ m_tabs->insert( rb2=new QRadioButton( i18n("&Persistent"), m_tabs ), 1 );
+
+ layout->addStretch();
+
+ QWhatsThis::add(rb1, i18n(
+ "Selections will be overwritten by typed text and will be lost on "
+ "cursor movement."));
+ QWhatsThis::add(rb2, i18n(
+ "Selections will stay even after cursor movement and typing."));
+
+ QWhatsThis::add(e4, i18n(
+ "Sets the number of lines to maintain visible above and below the "
+ "cursor when possible."));
+
+ QWhatsThis::add(opt[0], i18n(
+ "When selected, pressing the home key will cause the cursor to skip "
+ "whitespace and go to the start of a line's text. "
+ "The same applies for the end key."));
+
+ QWhatsThis::add(opt[1], i18n(
+ "When on, moving the insertion cursor using the <b>Left</b> and "
+ "<b>Right</b> keys will go on to previous/next line at beginning/end of "
+ "the line, similar to most editors.<p>When off, the insertion cursor "
+ "cannot be moved left of the line start, but it can be moved off the "
+ "line end, which can be very handy for programmers."));
+
+ QWhatsThis::add(e6, i18n("Selects whether the PageUp and PageDown keys should alter the vertical position of the cursor relative to the top of the view."));
+
+
+ reload ();
+
+ //
+ // after initial reload, connect the stuff for the changed () signal
+ //
+
+ connect(rb1, SIGNAL(toggled(bool)), this, SLOT(slotChanged()));
+ connect(rb2, SIGNAL(toggled(bool)), this, SLOT(slotChanged()));
+}
+
+void KateSelectConfigTab::apply ()
+{
+ // nothing changed, no need to apply stuff
+ if (!changed())
+ return;
+ m_changed = false;
+
+ KateViewConfig::global()->configStart ();
+ KateDocumentConfig::global()->configStart ();
+
+ int configFlags = KateDocumentConfig::global()->configFlags();
+
+ configFlags &= ~KateDocumentConfig::cfSmartHome;
+ configFlags &= ~KateDocumentConfig::cfWrapCursor;
+
+ if (opt[0]->isChecked()) configFlags |= KateDocumentConfig::cfSmartHome;
+ if (opt[1]->isChecked()) configFlags |= KateDocumentConfig::cfWrapCursor;
+
+ KateDocumentConfig::global()->setConfigFlags(configFlags);
+
+ KateViewConfig::global()->setAutoCenterLines(kMax(0, e4->value()));
+ KateDocumentConfig::global()->setPageUpDownMovesCursor(e6->isChecked());
+
+ KateViewConfig::global()->setPersistentSelection (m_tabs->id (m_tabs->selected()) == 1);
+
+ KateDocumentConfig::global()->configEnd ();
+ KateViewConfig::global()->configEnd ();
+}
+
+void KateSelectConfigTab::reload ()
+{
+ if (KateViewConfig::global()->persistentSelection())
+ m_tabs->setButton (1);
+ else
+ m_tabs->setButton (0);
+}
+//END KateSelectConfigTab
+
+//BEGIN KateEditConfigTab
+const int KateEditConfigTab::flags[] = {KateDocument::cfWordWrap,
+ KateDocument::cfAutoBrackets, KateDocument::cfShowTabs,
+ KateDocumentConfig::cfReplaceTabsDyn, KateDocumentConfig::cfRemoveTrailingDyn};
+
+KateEditConfigTab::KateEditConfigTab(QWidget *parent)
+ : KateConfigPage(parent)
+{
+ QVBoxLayout *mainLayout = new QVBoxLayout(this, 0, KDialog::spacingHint() );
+ int configFlags = KateDocumentConfig::global()->configFlags();
+
+ QVGroupBox *gbWhiteSpace = new QVGroupBox(i18n("Tabulators"), this);
+
+ opt[3] = new QCheckBox( i18n("&Insert spaces instead of tabulators"), gbWhiteSpace );
+ opt[3]->setChecked( configFlags & KateDocumentConfig::cfReplaceTabsDyn );
+ connect( opt[3], SIGNAL(toggled(bool)), this, SLOT(slotChanged()) );
+
+ opt[2] = new QCheckBox(i18n("&Show tabulators"), gbWhiteSpace);
+ opt[2]->setChecked(configFlags & flags[2]);
+ connect(opt[2], SIGNAL(toggled(bool)), this, SLOT(slotChanged()));
+
+ e2 = new KIntNumInput(KateDocumentConfig::global()->tabWidth(), gbWhiteSpace);
+ e2->setRange(1, 16, 1, false);
+ e2->setLabel(i18n("Tab width:"), AlignVCenter);
+ connect(e2, SIGNAL(valueChanged(int)), this, SLOT(slotChanged()));
+
+ mainLayout->addWidget(gbWhiteSpace);
+
+ QVGroupBox *gbWordWrap = new QVGroupBox(i18n("Static Word Wrap"), this);
+
+ opt[0] = new QCheckBox(i18n("Enable static &word wrap"), gbWordWrap);
+ opt[0]->setChecked(KateDocumentConfig::global()->wordWrap());
+ connect(opt[0], SIGNAL(toggled(bool)), this, SLOT(slotChanged()));
+
+ m_wwmarker = new QCheckBox( i18n("&Show static word wrap marker (if applicable)"), gbWordWrap );
+ m_wwmarker->setChecked( KateRendererConfig::global()->wordWrapMarker() );
+ connect(m_wwmarker, SIGNAL(toggled(bool)), this, SLOT(slotChanged()));
+
+ e1 = new KIntNumInput(KateDocumentConfig::global()->wordWrapAt(), gbWordWrap);
+ e1->setRange(20, 200, 1, false);
+ e1->setLabel(i18n("Wrap words at:"), AlignVCenter);
+ connect(e1, SIGNAL(valueChanged(int)), this, SLOT(slotChanged()));
+
+ mainLayout->addWidget(gbWordWrap);
+
+ opt[4] = new QCheckBox( i18n("Remove &trailing spaces"), this );
+ mainLayout->addWidget( opt[4] );
+ opt[4]->setChecked( configFlags & KateDocumentConfig::cfRemoveTrailingDyn );
+ connect( opt[4], SIGNAL(toggled(bool)), this, SLOT(slotChanged()) );
+
+ opt[1] = new QCheckBox(i18n("Auto &brackets"), this);
+ mainLayout->addWidget(opt[1]);
+ opt[1]->setChecked(configFlags & flags[1]);
+ connect(opt[1], SIGNAL(toggled(bool)), this, SLOT(slotChanged()));
+
+ e3 = new KIntNumInput(e2, KateDocumentConfig::global()->undoSteps(), this);
+ e3->setRange(0, 1000000, 1, false);
+ e3->setSpecialValueText( i18n("Unlimited") );
+ e3->setLabel(i18n("Maximum undo steps:"), AlignVCenter);
+ mainLayout->addWidget(e3);
+ connect(e3, SIGNAL(valueChanged(int)), this, SLOT(slotChanged()));
+
+ QHBoxLayout *e5Layout = new QHBoxLayout(mainLayout);
+ QLabel *e5Label = new QLabel(i18n("Smart search t&ext from:"), this);
+ e5Layout->addWidget(e5Label);
+ e5 = new KComboBox (this);
+ e5->insertItem( i18n("Nowhere") );
+ e5->insertItem( i18n("Selection Only") );
+ e5->insertItem( i18n("Selection, then Current Word") );
+ e5->insertItem( i18n("Current Word Only") );
+ e5->insertItem( i18n("Current Word, then Selection") );
+ e5->setCurrentItem(KateViewConfig::global()->textToSearchMode());
+ e5Layout->addWidget(e5);
+ e5Label->setBuddy(e5);
+ connect(e5, SIGNAL(activated(int)), this, SLOT(slotChanged()));
+
+ mainLayout->addStretch();
+
+ // What is this? help
+ QWhatsThis::add(opt[0], i18n(
+ "Automatically start a new line of text when the current line exceeds "
+ "the length specified by the <b>Wrap words at:</b> option."
+ "<p>This option does not wrap existing lines of text - use the <b>Apply "
+ "Static Word Wrap</b> option in the <b>Tools</b> menu for that purpose."
+ "<p>If you want lines to be <i>visually wrapped</i> instead, according "
+ "to the width of the view, enable <b>Dynamic Word Wrap</b> in the "
+ "<b>View Defaults</b> config page."));
+ QWhatsThis::add(e1, i18n(
+ "If the Word Wrap option is selected this entry determines the length "
+ "(in characters) at which the editor will automatically start a new line."));
+ QWhatsThis::add(opt[1], i18n(
+ "When the user types a left bracket ([,(, or {) KateView automatically "
+ "enters the right bracket (}, ), or ]) to the right of the cursor."));
+ QWhatsThis::add(opt[2], i18n(
+ "The editor will display a symbol to indicate the presence of a tab in "
+ "the text."));
+
+ QWhatsThis::add(e3, i18n(
+ "Sets the number of undo/redo steps to record. More steps uses more memory."));
+
+ QString gstfwt = i18n(
+ "This determines where KateView will get the search text from "
+ "(this will be automatically entered into the Find Text dialog): "
+ "<br>"
+ "<ul>"
+ "<li><b>Nowhere:</b> Don't guess the search text."
+ "</li>"
+ "<li><b>Selection Only:</b> Use the current text selection, "
+ "if available."
+ "</li>"
+ "<li><b>Selection, then Current Word:</b> Use the current "
+ "selection if available, otherwise use the current word."
+ "</li>"
+ "<li><b>Current Word Only:</b> Use the word that the cursor "
+ "is currently resting on, if available."
+ "</li>"
+ "<li><b>Current Word, then Selection:</b> Use the current "
+ "word if available, otherwise use the current selection."
+ "</li>"
+ "</ul>"
+ "Note that, in all the above modes, if a search string has "
+ "not been or cannot be determined, then the Find Text Dialog "
+ "will fall back to the last search text.");
+ QWhatsThis::add(e5Label, gstfwt);
+ QWhatsThis::add(e5, gstfwt);
+ QWhatsThis::add( opt[3], i18n(
+ "If this is enabled, the editor will calculate the number of spaces up to "
+ "the next tab position as defined by the tab width, and insert that number "
+ "of spaces instead of a TAB character." ) );
+ QWhatsThis::add( opt[4], i18n(
+ "If this is enabled, the editor will remove any trailing whitespace on "
+ "lines when they are left by the insertion cursor.") );
+ QWhatsThis::add( m_wwmarker, i18n(
+ "<p>If this option is checked, a vertical line will be drawn at the word "
+ "wrap column as defined in the <strong>Editing</strong> properties."
+ "<p>Note that the word wrap marker is only drawn if you use a fixed "
+ "pitch font." ));
+}
+
+void KateEditConfigTab::apply ()
+{
+ // nothing changed, no need to apply stuff
+ if (!changed())
+ return;
+ m_changed = false;
+
+ KateViewConfig::global()->configStart ();
+ KateDocumentConfig::global()->configStart ();
+
+ int configFlags, z;
+
+ configFlags = KateDocumentConfig::global()->configFlags();
+ for (z = 1; z < numFlags; z++) {
+ configFlags &= ~flags[z];
+ if (opt[z]->isChecked()) configFlags |= flags[z];
+ }
+ KateDocumentConfig::global()->setConfigFlags(configFlags);
+
+ KateDocumentConfig::global()->setWordWrapAt(e1->value());
+ KateDocumentConfig::global()->setWordWrap (opt[0]->isChecked());
+ KateDocumentConfig::global()->setTabWidth(e2->value());
+
+ if (e3->value() <= 0)
+ KateDocumentConfig::global()->setUndoSteps(0);
+ else
+ KateDocumentConfig::global()->setUndoSteps(e3->value());
+
+ KateViewConfig::global()->setTextToSearchMode(e5->currentItem());
+
+ KateRendererConfig::global()->setWordWrapMarker (m_wwmarker->isChecked());
+
+ KateDocumentConfig::global()->configEnd ();
+ KateViewConfig::global()->configEnd ();
+}
+
+void KateEditConfigTab::reload ()
+{
+}
+//END KateEditConfigTab
+
+//BEGIN KateViewDefaultsConfig
+KateViewDefaultsConfig::KateViewDefaultsConfig(QWidget *parent)
+ :KateConfigPage(parent)
+{
+ QRadioButton *rb1;
+ QRadioButton *rb2;
+
+ QVBoxLayout *blay=new QVBoxLayout(this,0,KDialog::spacingHint());
+
+ QVGroupBox *gbWordWrap = new QVGroupBox(i18n("Word Wrap"), this);
+
+ m_dynwrap=new QCheckBox(i18n("&Dynamic word wrap"),gbWordWrap);
+
+ QHBox *m_dynwrapIndicatorsLay = new QHBox (gbWordWrap);
+ m_dynwrapIndicatorsLabel = new QLabel( i18n("Dynamic word wrap indicators (if applicable):"), m_dynwrapIndicatorsLay );
+ m_dynwrapIndicatorsCombo = new KComboBox( m_dynwrapIndicatorsLay );
+ m_dynwrapIndicatorsCombo->insertItem( i18n("Off") );
+ m_dynwrapIndicatorsCombo->insertItem( i18n("Follow Line Numbers") );
+ m_dynwrapIndicatorsCombo->insertItem( i18n("Always On") );
+ m_dynwrapIndicatorsLabel->setBuddy(m_dynwrapIndicatorsCombo);
+
+ m_dynwrapAlignLevel = new KIntNumInput(gbWordWrap);
+ m_dynwrapAlignLevel->setLabel(i18n("Vertically align dynamically wrapped lines to indentation depth:"));
+ m_dynwrapAlignLevel->setRange(0, 80, 10);
+ // xgettext:no-c-format
+ m_dynwrapAlignLevel->setSuffix(i18n("% of View Width"));
+ m_dynwrapAlignLevel->setSpecialValueText(i18n("Disabled"));
+
+ blay->addWidget(gbWordWrap);
+
+ QVGroupBox *gbFold = new QVGroupBox(i18n("Code Folding"), this);
+
+ m_folding=new QCheckBox(i18n("Show &folding markers (if available)"), gbFold );
+ m_collapseTopLevel = new QCheckBox( i18n("Collapse toplevel folding nodes"), gbFold );
+ m_collapseTopLevel->hide ();
+
+ blay->addWidget(gbFold);
+
+ QVGroupBox *gbBar = new QVGroupBox(i18n("Borders"), this);
+
+ m_icons=new QCheckBox(i18n("Show &icon border"),gbBar);
+ m_line=new QCheckBox(i18n("Show &line numbers"),gbBar);
+ m_scrollBarMarks=new QCheckBox(i18n("Show &scrollbar marks"),gbBar);
+
+ blay->addWidget(gbBar);
+
+ m_bmSort = new QButtonGroup( 1, Qt::Horizontal, i18n("Sort Bookmarks Menu"), this );
+ m_bmSort->setRadioButtonExclusive( true );
+ m_bmSort->insert( rb1=new QRadioButton( i18n("By &position"), m_bmSort ), 0 );
+ m_bmSort->insert( rb2=new QRadioButton( i18n("By c&reation"), m_bmSort ), 1 );
+
+ blay->addWidget(m_bmSort, 0 );
+
+ m_showIndentLines = new QCheckBox(i18n("Show indentation lines"), this);
+ m_showIndentLines->setChecked(KateRendererConfig::global()->showIndentationLines());
+ blay->addWidget(m_showIndentLines);
+
+ blay->addStretch(1000);
+
+ QWhatsThis::add(m_dynwrap,i18n(
+ "If this option is checked, the text lines will be wrapped at the view "
+ "border on the screen."));
+ QString wtstr = i18n("Choose when the Dynamic Word Wrap Indicators should be displayed");
+ QWhatsThis::add(m_dynwrapIndicatorsLabel, wtstr);
+ QWhatsThis::add(m_dynwrapIndicatorsCombo, wtstr);
+ // xgettext:no-c-format
+ QWhatsThis::add(m_dynwrapAlignLevel, i18n(
+ "<p>Enables the start of dynamically wrapped lines to be aligned "
+ "vertically to the indentation level of the first line. This can help "
+ "to make code and markup more readable.</p><p>Additionally, this allows "
+ "you to set a maximum width of the screen, as a percentage, after which "
+ "dynamically wrapped lines will no longer be vertically aligned. For "
+ "example, at 50%, lines whose indentation levels are deeper than 50% of "
+ "the width of the screen will not have vertical alignment applied to "
+ "subsequent wrapped lines.</p>"));
+ QWhatsThis::add(m_line,i18n(
+ "If this option is checked, every new view will display line numbers "
+ "on the left hand side."));
+ QWhatsThis::add(m_icons,i18n(
+ "If this option is checked, every new view will display an icon border "
+ "on the left hand side.<br><br>The icon border shows bookmark signs, "
+ "for instance."));
+ QWhatsThis::add(m_scrollBarMarks,i18n(
+ "If this option is checked, every new view will show marks on the "
+ "vertical scrollbar.<br><br>These marks will, for instance, show "
+ "bookmarks."));
+ QWhatsThis::add(m_folding,i18n(
+ "If this option is checked, every new view will display marks for code "
+ "folding, if code folding is available."));
+ QWhatsThis::add(m_bmSort,i18n(
+ "Choose how the bookmarks should be ordered in the <b>Bookmarks</b> menu."));
+ QWhatsThis::add(rb1,i18n(
+ "The bookmarks will be ordered by the line numbers they are placed at."));
+ QWhatsThis::add(rb2,i18n(
+ "Each new bookmark will be added to the bottom, independently from "
+ "where it is placed in the document."));
+ QWhatsThis::add(m_showIndentLines, i18n(
+ "If this is enabled, the editor will display vertical lines to help "
+ "identify indent lines.") );
+
+ reload();
+
+ //
+ // after initial reload, connect the stuff for the changed () signal
+ //
+
+ connect(m_dynwrap, SIGNAL(toggled(bool)), this, SLOT(slotChanged()));
+ connect(m_dynwrapIndicatorsCombo, SIGNAL(activated(int)), this, SLOT(slotChanged()));
+ connect(m_dynwrapAlignLevel, SIGNAL(valueChanged(int)), this, SLOT(slotChanged()));
+ connect(m_icons, SIGNAL(toggled(bool)), this, SLOT(slotChanged()));
+ connect(m_scrollBarMarks, SIGNAL(toggled(bool)), this, SLOT(slotChanged()));
+ connect(m_line, SIGNAL(toggled(bool)), this, SLOT(slotChanged()));
+ connect(m_folding, SIGNAL(toggled(bool)), this, SLOT(slotChanged()));
+ connect(m_collapseTopLevel, SIGNAL(toggled(bool)), this, SLOT(slotChanged()) );
+ connect(rb1, SIGNAL(toggled(bool)), this, SLOT(slotChanged()));
+ connect(rb2, SIGNAL(toggled(bool)), this, SLOT(slotChanged()));
+ connect(m_showIndentLines, SIGNAL(toggled(bool)), this, SLOT(slotChanged()));
+}
+
+KateViewDefaultsConfig::~KateViewDefaultsConfig()
+{
+}
+
+void KateViewDefaultsConfig::apply ()
+{
+ // nothing changed, no need to apply stuff
+ if (!changed())
+ return;
+ m_changed = false;
+
+ KateViewConfig::global()->configStart ();
+ KateRendererConfig::global()->configStart ();
+
+ KateViewConfig::global()->setDynWordWrap (m_dynwrap->isChecked());
+ KateViewConfig::global()->setDynWordWrapIndicators (m_dynwrapIndicatorsCombo->currentItem ());
+ KateViewConfig::global()->setDynWordWrapAlignIndent(m_dynwrapAlignLevel->value());
+ KateViewConfig::global()->setLineNumbers (m_line->isChecked());
+ KateViewConfig::global()->setIconBar (m_icons->isChecked());
+ KateViewConfig::global()->setScrollBarMarks (m_scrollBarMarks->isChecked());
+ KateViewConfig::global()->setFoldingBar (m_folding->isChecked());
+ KateViewConfig::global()->setBookmarkSort (m_bmSort->id (m_bmSort->selected()));
+
+ KateRendererConfig::global()->setShowIndentationLines(m_showIndentLines->isChecked());
+
+ KateRendererConfig::global()->configEnd ();
+ KateViewConfig::global()->configEnd ();
+}
+
+void KateViewDefaultsConfig::reload ()
+{
+ m_dynwrap->setChecked(KateViewConfig::global()->dynWordWrap());
+ m_dynwrapIndicatorsCombo->setCurrentItem( KateViewConfig::global()->dynWordWrapIndicators() );
+ m_dynwrapAlignLevel->setValue(KateViewConfig::global()->dynWordWrapAlignIndent());
+ m_line->setChecked(KateViewConfig::global()->lineNumbers());
+ m_icons->setChecked(KateViewConfig::global()->iconBar());
+ m_scrollBarMarks->setChecked(KateViewConfig::global()->scrollBarMarks());
+ m_folding->setChecked(KateViewConfig::global()->foldingBar());
+ m_bmSort->setButton( KateViewConfig::global()->bookmarkSort() );
+ m_showIndentLines->setChecked(KateRendererConfig::global()->showIndentationLines());
+}
+
+void KateViewDefaultsConfig::reset () {;}
+
+void KateViewDefaultsConfig::defaults (){;}
+//END KateViewDefaultsConfig
+
+//BEGIN KateEditKeyConfiguration
+
+KateEditKeyConfiguration::KateEditKeyConfiguration( QWidget* parent, KateDocument* doc )
+ : KateConfigPage( parent )
+{
+ m_doc = doc;
+ m_ready = false;
+}
+
+void KateEditKeyConfiguration::showEvent ( QShowEvent * )
+{
+ if (!m_ready)
+ {
+ (new QVBoxLayout(this))->setAutoAdd(true);
+ KateView* view = (KateView*)m_doc->views().at(0);
+ m_ac = view->editActionCollection();
+ m_keyChooser = new KKeyChooser( m_ac, this, false );
+ connect( m_keyChooser, SIGNAL( keyChange() ), this, SLOT( slotChanged() ) );
+ m_keyChooser->show ();
+
+ m_ready = true;
+ }
+
+ QWidget::show ();
+}
+
+void KateEditKeyConfiguration::apply()
+{
+ if ( ! changed() )
+ return;
+ m_changed = false;
+
+ if (m_ready)
+ {
+ m_keyChooser->commitChanges();
+ m_ac->writeShortcutSettings( "Katepart Shortcuts" );
+ }
+}
+//END KateEditKeyConfiguration
+
+//BEGIN KateSaveConfigTab
+KateSaveConfigTab::KateSaveConfigTab( QWidget *parent )
+ : KateConfigPage( parent )
+{
+ int configFlags = KateDocumentConfig::global()->configFlags();
+ QVBoxLayout *layout = new QVBoxLayout(this, 0, KDialog::spacingHint() );
+
+ QVGroupBox *gbEnc = new QVGroupBox(i18n("File Format"), this);
+ layout->addWidget( gbEnc );
+
+ QHBox *e5Layout = new QHBox(gbEnc);
+ QLabel *e5Label = new QLabel(i18n("&Encoding:"), e5Layout);
+ m_encoding = new KComboBox (e5Layout);
+ e5Label->setBuddy(m_encoding);
+
+ e5Layout = new QHBox(gbEnc);
+ e5Label = new QLabel(i18n("End &of line:"), e5Layout);
+ m_eol = new KComboBox (e5Layout);
+ e5Label->setBuddy(m_eol);
+
+ allowEolDetection = new QCheckBox(i18n("&Automatic end of line detection"), gbEnc);
+
+ m_eol->insertItem (i18n("UNIX"));
+ m_eol->insertItem (i18n("DOS/Windows"));
+ m_eol->insertItem (i18n("Macintosh"));
+
+ QVGroupBox *gbMem = new QVGroupBox(i18n("Memory Usage"), this);
+ layout->addWidget( gbMem );
+
+ e5Layout = new QHBox(gbMem);
+ e5Layout->setSpacing (32);
+ blockCountLabel = new QLabel(i18n("Maximum loaded &blocks per file:"), e5Layout);
+ blockCount = new QSpinBox (4, 512, 4, e5Layout);
+
+ blockCount->setValue (KateBuffer::maxLoadedBlocks());
+ blockCountLabel->setBuddy(blockCount);
+
+ QVGroupBox *gbWhiteSpace = new QVGroupBox(i18n("Automatic Cleanups on Load/Save"), this);
+ layout->addWidget( gbWhiteSpace );
+
+ removeSpaces = new QCheckBox(i18n("Re&move trailing spaces"), gbWhiteSpace);
+ removeSpaces->setChecked(configFlags & KateDocument::cfRemoveSpaces);
+
+ QVGroupBox *dirConfigBox = new QVGroupBox(i18n("Folder Config File"), this);
+ layout->addWidget( dirConfigBox );
+
+ dirSearchDepth = new KIntNumInput(KateDocumentConfig::global()->searchDirConfigDepth(), dirConfigBox);
+ dirSearchDepth->setRange(-1, 64, 1, false);
+ dirSearchDepth->setSpecialValueText( i18n("Do not use config file") );
+ dirSearchDepth->setLabel(i18n("Se&arch depth for config file:"), AlignVCenter);
+
+ QGroupBox *gb = new QGroupBox( 1, Qt::Horizontal, i18n("Backup on Save"), this );
+ layout->addWidget( gb );
+ cbLocalFiles = new QCheckBox( i18n("&Local files"), gb );
+ cbRemoteFiles = new QCheckBox( i18n("&Remote files"), gb );
+
+ QHBox *hbBuPrefix = new QHBox( gb );
+ QLabel *lBuPrefix = new QLabel( i18n("&Prefix:"), hbBuPrefix );
+ leBuPrefix = new QLineEdit( hbBuPrefix );
+ lBuPrefix->setBuddy( leBuPrefix );
+
+ QHBox *hbBuSuffix = new QHBox( gb );
+ QLabel *lBuSuffix = new QLabel( i18n("&Suffix:"), hbBuSuffix );
+ leBuSuffix = new QLineEdit( hbBuSuffix );
+ lBuSuffix->setBuddy( leBuSuffix );
+
+ layout->addStretch();
+
+ QWhatsThis::add(removeSpaces, i18n(
+ "The editor will automatically eliminate extra spaces at the ends of "
+ "lines of text while loading/saving the file."));
+ QWhatsThis::add( gb, i18n(
+ "<p>Backing up on save will cause Kate to copy the disk file to "
+ "'&lt;prefix&gt;&lt;filename&gt;&lt;suffix&gt;' before saving changes."
+ "<p>The suffix defaults to <strong>~</strong> and prefix is empty by default" ) );
+ QWhatsThis::add( allowEolDetection, i18n(
+ "Check this if you want the editor to autodetect the end of line type."
+ "The first found end of line type will be used for the whole file.") );
+ QWhatsThis::add( cbLocalFiles, i18n(
+ "Check this if you want backups of local files when saving") );
+ QWhatsThis::add( cbRemoteFiles, i18n(
+ "Check this if you want backups of remote files when saving") );
+ QWhatsThis::add( leBuPrefix, i18n(
+ "Enter the prefix to prepend to the backup file names" ) );
+ QWhatsThis::add( leBuSuffix, i18n(
+ "Enter the suffix to add to the backup file names" ) );
+ QWhatsThis::add(dirSearchDepth, i18n(
+ "The editor will search the given number of folder levels upwards for .kateconfig file"
+ " and load the settings line from it." ));
+ QWhatsThis::add(blockCount, i18n(
+ "The editor will load given number of blocks (of around 2048 lines) of text into memory;"
+ " if the filesize is bigger than this the other blocks are swapped "
+ " to disk and loaded transparently as-needed.<br>"
+ " This can cause little delays while navigating in the document; a larger block count"
+ " increases the editing speed at the cost of memory. <br>For normal usage, just choose the highest possible"
+ " block count: limit it only if you have problems with the memory usage."));
+
+ reload();
+
+ //
+ // after initial reload, connect the stuff for the changed () signal
+ //
+
+ connect(m_encoding, SIGNAL(activated(int)), this, SLOT(slotChanged()));
+ connect(m_eol, SIGNAL(activated(int)), this, SLOT(slotChanged()));
+ connect( allowEolDetection, SIGNAL( toggled(bool) ), this, SLOT( slotChanged() ) );
+ connect(blockCount, SIGNAL(valueChanged(int)), this, SLOT(slotChanged()));
+ connect(removeSpaces, SIGNAL(toggled(bool)), this, SLOT(slotChanged()));
+ connect( cbLocalFiles, SIGNAL( toggled(bool) ), this, SLOT( slotChanged() ) );
+ connect( cbRemoteFiles, SIGNAL( toggled(bool) ), this, SLOT( slotChanged() ) );
+ connect(dirSearchDepth, SIGNAL(valueChanged(int)), this, SLOT(slotChanged()));
+ connect( leBuPrefix, SIGNAL( textChanged ( const QString & ) ), this, SLOT( slotChanged() ) );
+ connect( leBuSuffix, SIGNAL( textChanged ( const QString & ) ), this, SLOT( slotChanged() ) );
+}
+
+void KateSaveConfigTab::apply()
+{
+ // nothing changed, no need to apply stuff
+ if (!changed())
+ return;
+ m_changed = false;
+
+ KateBuffer::setMaxLoadedBlocks (blockCount->value());
+
+ KateDocumentConfig::global()->configStart ();
+
+ if ( leBuSuffix->text().isEmpty() && leBuPrefix->text().isEmpty() ) {
+ KMessageBox::information(
+ this,
+ i18n("You did not provide a backup suffix or prefix. Using default suffix: '~'"),
+ i18n("No Backup Suffix or Prefix")
+ );
+ leBuSuffix->setText( "~" );
+ }
+
+ uint f( 0 );
+ if ( cbLocalFiles->isChecked() )
+ f |= KateDocumentConfig::LocalFiles;
+ if ( cbRemoteFiles->isChecked() )
+ f |= KateDocumentConfig::RemoteFiles;
+
+ KateDocumentConfig::global()->setBackupFlags(f);
+ KateDocumentConfig::global()->setBackupPrefix(leBuPrefix->text());
+ KateDocumentConfig::global()->setBackupSuffix(leBuSuffix->text());
+
+ KateDocumentConfig::global()->setSearchDirConfigDepth(dirSearchDepth->value());
+
+ int configFlags = KateDocumentConfig::global()->configFlags();
+
+ configFlags &= ~KateDocument::cfRemoveSpaces; // clear flag
+ if (removeSpaces->isChecked()) configFlags |= KateDocument::cfRemoveSpaces; // set flag if checked
+
+ KateDocumentConfig::global()->setConfigFlags(configFlags);
+
+ KateDocumentConfig::global()->setEncoding((m_encoding->currentItem() == 0) ? "" : KGlobal::charsets()->encodingForName(m_encoding->currentText()));
+
+ KateDocumentConfig::global()->setEol(m_eol->currentItem());
+ KateDocumentConfig::global()->setAllowEolDetection(allowEolDetection->isChecked());
+
+ KateDocumentConfig::global()->configEnd ();
+}
+
+void KateSaveConfigTab::reload()
+{
+ // encoding
+ m_encoding->clear ();
+ m_encoding->insertItem (i18n("KDE Default"));
+ m_encoding->setCurrentItem(0);
+ QStringList encodings (KGlobal::charsets()->descriptiveEncodingNames());
+ int insert = 1;
+ for (uint i=0; i < encodings.count(); i++)
+ {
+ bool found = false;
+ QTextCodec *codecForEnc = KGlobal::charsets()->codecForName(KGlobal::charsets()->encodingForName(encodings[i]), found);
+
+ if (found)
+ {
+ m_encoding->insertItem (encodings[i]);
+
+ if ( codecForEnc->name() == KateDocumentConfig::global()->encoding() )
+ {
+ m_encoding->setCurrentItem(insert);
+ }
+
+ insert++;
+ }
+ }
+
+ // eol
+ m_eol->setCurrentItem(KateDocumentConfig::global()->eol());
+ allowEolDetection->setChecked(KateDocumentConfig::global()->allowEolDetection());
+
+ dirSearchDepth->setValue(KateDocumentConfig::global()->searchDirConfigDepth());
+
+ // other stuff
+ uint f ( KateDocumentConfig::global()->backupFlags() );
+ cbLocalFiles->setChecked( f & KateDocumentConfig::LocalFiles );
+ cbRemoteFiles->setChecked( f & KateDocumentConfig::RemoteFiles );
+ leBuPrefix->setText( KateDocumentConfig::global()->backupPrefix() );
+ leBuSuffix->setText( KateDocumentConfig::global()->backupSuffix() );
+}
+
+void KateSaveConfigTab::reset()
+{
+}
+
+void KateSaveConfigTab::defaults()
+{
+ cbLocalFiles->setChecked( true );
+ cbRemoteFiles->setChecked( false );
+ leBuPrefix->setText( "" );
+ leBuSuffix->setText( "~" );
+}
+
+//END KateSaveConfigTab
+
+//BEGIN PluginListItem
+class KatePartPluginListItem : public QCheckListItem
+{
+ public:
+ KatePartPluginListItem(bool checked, uint i, const QString &name, QListView *parent);
+ uint pluginIndex () const { return index; }
+
+ protected:
+ void stateChange(bool);
+
+ private:
+ uint index;
+ bool silentStateChange;
+};
+
+KatePartPluginListItem::KatePartPluginListItem(bool checked, uint i, const QString &name, QListView *parent)
+ : QCheckListItem(parent, name, CheckBox)
+ , index(i)
+ , silentStateChange(false)
+{
+ silentStateChange = true;
+ setOn(checked);
+ silentStateChange = false;
+}
+
+void KatePartPluginListItem::stateChange(bool b)
+{
+ if(!silentStateChange)
+ static_cast<KatePartPluginListView *>(listView())->stateChanged(this, b);
+}
+//END
+
+//BEGIN PluginListView
+KatePartPluginListView::KatePartPluginListView(QWidget *parent, const char *name)
+ : KListView(parent, name)
+{
+}
+
+void KatePartPluginListView::stateChanged(KatePartPluginListItem *item, bool b)
+{
+ emit stateChange(item, b);
+}
+//END
+
+//BEGIN KatePartPluginConfigPage
+KatePartPluginConfigPage::KatePartPluginConfigPage (QWidget *parent) : KateConfigPage (parent, "")
+{
+ // sizemanagment
+ QGridLayout *grid = new QGridLayout( this, 1, 1 );
+ grid->setSpacing( KDialogBase::spacingHint() );
+
+ listView = new KatePartPluginListView(this);
+ listView->addColumn(i18n("Name"));
+ listView->addColumn(i18n("Comment"));
+
+ grid->addWidget( listView, 0, 0);
+
+ for (uint i=0; i<KateFactory::self()->plugins().count(); i++)
+ {
+ KatePartPluginListItem *item = new KatePartPluginListItem(KateDocumentConfig::global()->plugin(i), i, (KateFactory::self()->plugins())[i]->name(), listView);
+ item->setText(0, (KateFactory::self()->plugins())[i]->name());
+ item->setText(1, (KateFactory::self()->plugins())[i]->comment());
+
+ m_items.append (item);
+ }
+
+ // configure button
+
+ btnConfigure = new QPushButton( i18n("Configure..."), this );
+ btnConfigure->setEnabled( false );
+ grid->addWidget( btnConfigure, 1, 0, Qt::AlignRight );
+ connect( btnConfigure, SIGNAL(clicked()), this, SLOT(slotConfigure()) );
+
+ connect( listView, SIGNAL(selectionChanged(QListViewItem*)), this, SLOT(slotCurrentChanged(QListViewItem*)) );
+ connect( listView, SIGNAL(stateChange(KatePartPluginListItem *, bool)),
+ this, SLOT(slotStateChanged(KatePartPluginListItem *, bool)));
+ connect(listView, SIGNAL(stateChange(KatePartPluginListItem *, bool)), this, SLOT(slotChanged()));
+}
+
+KatePartPluginConfigPage::~KatePartPluginConfigPage ()
+{
+}
+
+void KatePartPluginConfigPage::apply ()
+{
+ // nothing changed, no need to apply stuff
+ if (!changed())
+ return;
+ m_changed = false;
+
+ KateDocumentConfig::global()->configStart ();
+
+ for (uint i=0; i < m_items.count(); i++)
+ KateDocumentConfig::global()->setPlugin (m_items.at(i)->pluginIndex(), m_items.at(i)->isOn());
+
+ KateDocumentConfig::global()->configEnd ();
+}
+
+void KatePartPluginConfigPage::slotStateChanged( KatePartPluginListItem *item, bool b )
+{
+ if ( b )
+ slotCurrentChanged( (QListViewItem*)item );
+}
+
+void KatePartPluginConfigPage::slotCurrentChanged( QListViewItem* i )
+{
+ KatePartPluginListItem *item = static_cast<KatePartPluginListItem *>(i);
+ if ( ! item ) return;
+
+ bool b = false;
+ if ( item->isOn() )
+ {
+
+ // load this plugin, and see if it has config pages
+ KTextEditor::Plugin *plugin = KTextEditor::createPlugin(QFile::encodeName((KateFactory::self()->plugins())[item->pluginIndex()]->library()));
+ if ( plugin ) {
+ KTextEditor::ConfigInterfaceExtension *cie = KTextEditor::configInterfaceExtension( plugin );
+ b = ( cie && cie->configPages() );
+ }
+
+ }
+ btnConfigure->setEnabled( b );
+}
+
+void KatePartPluginConfigPage::slotConfigure()
+{
+ KatePartPluginListItem *item = static_cast<KatePartPluginListItem*>(listView->currentItem());
+ KTextEditor::Plugin *plugin =
+ KTextEditor::createPlugin(QFile::encodeName((KateFactory::self()->plugins())[item->pluginIndex()]->library()));
+
+ if ( ! plugin ) return;
+
+ KTextEditor::ConfigInterfaceExtension *cife =
+ KTextEditor::configInterfaceExtension( plugin );
+
+ if ( ! cife )
+ return;
+
+ if ( ! cife->configPages() )
+ return;
+
+ // If we have only one page, we use a simple dialog, else an icon list type
+ KDialogBase::DialogType dt =
+ cife->configPages() > 1 ?
+ KDialogBase::IconList : // still untested
+ KDialogBase::Plain;
+
+ QString name = (KateFactory::self()->plugins())[item->pluginIndex()]->name();
+ KDialogBase *kd = new KDialogBase ( dt,
+ i18n("Configure %1").arg( name ),
+ KDialogBase::Ok | KDialogBase::Cancel | KDialogBase::Help,
+ KDialogBase::Ok,
+ this );
+
+ QPtrList<KTextEditor::ConfigPage> editorPages;
+
+ for (uint i = 0; i < cife->configPages (); i++)
+ {
+ QWidget *page;
+ if ( dt == KDialogBase::IconList )
+ {
+ QStringList path;
+ path.clear();
+ path << cife->configPageName( i );
+ page = kd->addVBoxPage( path, cife->configPageFullName (i),
+ cife->configPagePixmap(i, KIcon::SizeMedium) );
+ }
+ else
+ {
+ page = kd->plainPage();
+ QVBoxLayout *_l = new QVBoxLayout( page );
+ _l->setAutoAdd( true );
+ }
+
+ editorPages.append( cife->configPage( i, page ) );
+ }
+
+ if (kd->exec())
+ {
+
+ for( uint i=0; i<editorPages.count(); i++ )
+ {
+ editorPages.at( i )->apply();
+ }
+ }
+
+ delete kd;
+}
+//END KatePartPluginConfigPage
+
+//BEGIN KateHlConfigPage
+KateHlConfigPage::KateHlConfigPage (QWidget *parent, KateDocument *doc)
+ : KateConfigPage (parent, "")
+ , hlData (0)
+ , m_doc (doc)
+{
+ QVBoxLayout *layout = new QVBoxLayout(this, 0, KDialog::spacingHint() );
+
+ // hl chooser
+ QHBox *hbHl = new QHBox( this );
+ layout->add (hbHl);
+
+ hbHl->setSpacing( KDialog::spacingHint() );
+ QLabel *lHl = new QLabel( i18n("H&ighlight:"), hbHl );
+ hlCombo = new QComboBox( false, hbHl );
+ lHl->setBuddy( hlCombo );
+ connect( hlCombo, SIGNAL(activated(int)),
+ this, SLOT(hlChanged(int)) );
+
+ for( int i = 0; i < KateHlManager::self()->highlights(); i++) {
+ if (KateHlManager::self()->hlSection(i).length() > 0)
+ hlCombo->insertItem(KateHlManager::self()->hlSection(i) + QString ("/") + KateHlManager::self()->hlNameTranslated(i));
+ else
+ hlCombo->insertItem(KateHlManager::self()->hlNameTranslated(i));
+ }
+
+ QGroupBox *gbInfo = new QGroupBox( 1, Qt::Horizontal, i18n("Information"), this );
+ layout->add (gbInfo);
+
+ // author
+ QHBox *hb1 = new QHBox( gbInfo);
+ new QLabel( i18n("Author:"), hb1 );
+ author = new QLabel (hb1);
+ author->setTextFormat (Qt::RichText);
+
+ // license
+ QHBox *hb2 = new QHBox( gbInfo);
+ new QLabel( i18n("License:"), hb2 );
+ license = new QLabel (hb2);
+
+ QGroupBox *gbProps = new QGroupBox( 1, Qt::Horizontal, i18n("Properties"), this );
+ layout->add (gbProps);
+
+ // file & mime types
+ QHBox *hbFE = new QHBox( gbProps);
+ QLabel *lFileExts = new QLabel( i18n("File e&xtensions:"), hbFE );
+ wildcards = new QLineEdit( hbFE );
+ lFileExts->setBuddy( wildcards );
+
+ QHBox *hbMT = new QHBox( gbProps );
+ QLabel *lMimeTypes = new QLabel( i18n("MIME &types:"), hbMT);
+ mimetypes = new QLineEdit( hbMT );
+ lMimeTypes->setBuddy( mimetypes );
+
+ QHBox *hbMT2 = new QHBox( gbProps );
+ QLabel *lprio = new QLabel( i18n("Prio&rity:"), hbMT2);
+ priority = new KIntNumInput( hbMT2 );
+
+ lprio->setBuddy( priority );
+
+ QToolButton *btnMTW = new QToolButton(hbMT);
+ btnMTW->setIconSet(QIconSet(SmallIcon("wizard")));
+ connect(btnMTW, SIGNAL(clicked()), this, SLOT(showMTDlg()));
+
+ // download/new buttons
+ QHBox *hbBtns = new QHBox( this );
+ layout->add (hbBtns);
+
+ ((QBoxLayout*)hbBtns->layout())->addStretch(1); // hmm.
+ hbBtns->setSpacing( KDialog::spacingHint() );
+ QPushButton *btnDl = new QPushButton(i18n("Do&wnload..."), hbBtns);
+ connect( btnDl, SIGNAL(clicked()), this, SLOT(hlDownload()) );
+
+ int currentHl = m_doc ? m_doc->hlMode() : 0;
+ hlCombo->setCurrentItem( currentHl );
+ hlChanged( currentHl );
+
+ QWhatsThis::add( hlCombo, i18n(
+ "Choose a <em>Syntax Highlight mode</em> from this list to view its "
+ "properties below.") );
+ QWhatsThis::add( wildcards, i18n(
+ "The list of file extensions used to determine which files to highlight "
+ "using the current syntax highlight mode.") );
+ QWhatsThis::add( mimetypes, i18n(
+ "The list of Mime Types used to determine which files to highlight "
+ "using the current highlight mode.<p>Click the wizard button on the "
+ "left of the entry field to display the MimeType selection dialog.") );
+ QWhatsThis::add( btnMTW, i18n(
+ "Display a dialog with a list of all available mime types to choose from."
+ "<p>The <strong>File Extensions</strong> entry will automatically be "
+ "edited as well.") );
+ QWhatsThis::add( btnDl, i18n(
+ "Click this button to download new or updated syntax highlight "
+ "descriptions from the Kate website.") );
+
+ layout->addStretch ();
+
+ connect( wildcards, SIGNAL( textChanged ( const QString & ) ), this, SLOT( slotChanged() ) );
+ connect( mimetypes, SIGNAL( textChanged ( const QString & ) ), this, SLOT( slotChanged() ) );
+ connect( priority, SIGNAL( valueChanged ( int ) ), this, SLOT( slotChanged() ) );
+}
+
+KateHlConfigPage::~KateHlConfigPage ()
+{
+}
+
+void KateHlConfigPage::apply ()
+{
+ // nothing changed, no need to apply stuff
+ if (!changed())
+ return;
+ m_changed = false;
+
+ writeback();
+
+ for ( QIntDictIterator<KateHlData> it( hlDataDict ); it.current(); ++it )
+ KateHlManager::self()->getHl( it.currentKey() )->setData( it.current() );
+
+ KateHlManager::self()->getKConfig()->sync ();
+}
+
+void KateHlConfigPage::reload ()
+{
+}
+
+void KateHlConfigPage::hlChanged(int z)
+{
+ writeback();
+
+ KateHighlighting *hl = KateHlManager::self()->getHl( z );
+
+ if (!hl)
+ {
+ hlData = 0;
+ return;
+ }
+
+ if ( !hlDataDict.find( z ) )
+ hlDataDict.insert( z, hl->getData() );
+
+ hlData = hlDataDict.find( z );
+ wildcards->setText(hlData->wildcards);
+ mimetypes->setText(hlData->mimetypes);
+ priority->setValue(hlData->priority);
+
+ // split author string if needed into multiple lines !
+ QStringList l= QStringList::split (QRegExp("[,;]"), hl->author());
+ author->setText (l.join ("<br>"));
+
+ license->setText (hl->license());
+}
+
+void KateHlConfigPage::writeback()
+{
+ if (hlData)
+ {
+ hlData->wildcards = wildcards->text();
+ hlData->mimetypes = mimetypes->text();
+ hlData->priority = priority->value();
+ }
+}
+
+void KateHlConfigPage::hlDownload()
+{
+ KateHlDownloadDialog diag(this,"hlDownload",true);
+ diag.exec();
+}
+
+void KateHlConfigPage::showMTDlg()
+{
+ QString text = i18n("Select the MimeTypes you want highlighted using the '%1' syntax highlight rules.\nPlease note that this will automatically edit the associated file extensions as well.").arg( hlCombo->currentText() );
+ QStringList list = QStringList::split( QRegExp("\\s*;\\s*"), mimetypes->text() );
+ KMimeTypeChooserDialog d( i18n("Select Mime Types"), text, list, "text", this );
+
+ if ( d.exec() == KDialogBase::Accepted ) {
+ // do some checking, warn user if mime types or patterns are removed.
+ // if the lists are empty, and the fields not, warn.
+ wildcards->setText(d.chooser()->patterns().join(";"));
+ mimetypes->setText(d.chooser()->mimeTypes().join(";"));
+ }
+}
+//END KateHlConfigPage
+
+//BEGIN KateHlDownloadDialog
+KateHlDownloadDialog::KateHlDownloadDialog(QWidget *parent, const char *name, bool modal)
+ :KDialogBase(KDialogBase::Swallow, i18n("Highlight Download"), User1|Close, User1, parent, name, modal, true, i18n("&Install"))
+{
+ QVBox* vbox = new QVBox(this);
+ setMainWidget(vbox);
+ vbox->setSpacing(spacingHint());
+ new QLabel(i18n("Select the syntax highlighting files you want to update:"), vbox);
+ list = new QListView(vbox);
+ list->addColumn("");
+ list->addColumn(i18n("Name"));
+ list->addColumn(i18n("Installed"));
+ list->addColumn(i18n("Latest"));
+ list->setSelectionMode(QListView::Multi);
+ list->setAllColumnsShowFocus(true);
+
+ new QLabel(i18n("<b>Note:</b> New versions are selected automatically."), vbox);
+ actionButton (User1)->setIconSet(SmallIconSet("ok"));
+
+ transferJob = KIO::get(
+ KURL(QString(HLDOWNLOADPATH)
+ + QString("update-")
+ + QString(KATEPART_VERSION)
+ + QString(".xml")), true, true );
+ connect(transferJob, SIGNAL(data(KIO::Job *, const QByteArray &)),
+ this, SLOT(listDataReceived(KIO::Job *, const QByteArray &)));
+// void data( KIO::Job *, const QByteArray &data);
+ resize(450, 400);
+}
+
+KateHlDownloadDialog::~KateHlDownloadDialog(){}
+
+void KateHlDownloadDialog::listDataReceived(KIO::Job *, const QByteArray &data)
+{
+ if (!transferJob || transferJob->isErrorPage())
+ {
+ actionButton(User1)->setEnabled(false);
+ return;
+ }
+
+ listData+=QString(data);
+ kdDebug(13000)<<QString("CurrentListData: ")<<listData<<endl<<endl;
+ kdDebug(13000)<<QString("Data length: %1").arg(data.size())<<endl;
+ kdDebug(13000)<<QString("listData length: %1").arg(listData.length())<<endl;
+ if (data.size()==0)
+ {
+ if (listData.length()>0)
+ {
+ QString installedVersion;
+ KateHlManager *hlm=KateHlManager::self();
+ QDomDocument doc;
+ doc.setContent(listData);
+ QDomElement DocElem=doc.documentElement();
+ QDomNode n=DocElem.firstChild();
+ KateHighlighting *hl = 0;
+
+ if (n.isNull()) kdDebug(13000)<<"There is no usable childnode"<<endl;
+ while (!n.isNull())
+ {
+ installedVersion=" --";
+
+ QDomElement e=n.toElement();
+ if (!e.isNull())
+ kdDebug(13000)<<QString("NAME: ")<<e.tagName()<<QString(" - ")<<e.attribute("name")<<endl;
+ n=n.nextSibling();
+
+ QString Name=e.attribute("name");
+
+ for (int i=0;i<hlm->highlights();i++)
+ {
+ hl=hlm->getHl(i);
+ if (hl && hl->name()==Name)
+ {
+ installedVersion=" "+hl->version();
+ break;
+ }
+ else hl = 0;
+ }
+
+ // autoselect entry if new or updated.
+ QListViewItem* entry = new QListViewItem(
+ list, "", e.attribute("name"), installedVersion,
+ e.attribute("version"),e.attribute("url"));
+ if (!hl || hl->version() < e.attribute("version"))
+ {
+ entry->setSelected(true);
+ entry->setPixmap(0, SmallIcon(("knewstuff")));
+ }
+ }
+ }
+ }
+}
+
+void KateHlDownloadDialog::slotUser1()
+{
+ QString destdir=KGlobal::dirs()->saveLocation("data","katepart/syntax/");
+ for (QListViewItem *it=list->firstChild();it;it=it->nextSibling())
+ {
+ if (list->isSelected(it))
+ {
+ KURL src(it->text(4));
+ QString filename=src.fileName(false);
+ QString dest = destdir+filename;
+
+ KIO::NetAccess::download(src,dest, this);
+ }
+ }
+
+ // update Config !!
+ KateSyntaxDocument doc (true);
+}
+//END KateHlDownloadDialog
+
+//BEGIN KateGotoLineDialog
+KateGotoLineDialog::KateGotoLineDialog(QWidget *parent, int line, int max)
+ : KDialogBase(parent, 0L, true, i18n("Go to Line"), Ok | Cancel, Ok) {
+
+ QWidget *page = new QWidget(this);
+ setMainWidget(page);
+
+ QVBoxLayout *topLayout = new QVBoxLayout( page, 0, spacingHint() );
+ e1 = new KIntNumInput(line, page);
+ e1->setRange(1, max);
+ e1->setEditFocus(true);
+
+ QLabel *label = new QLabel( e1,i18n("&Go to line:"), page );
+ topLayout->addWidget(label);
+ topLayout->addWidget(e1);
+ topLayout->addSpacing(spacingHint()); // A little bit extra space
+ topLayout->addStretch(10);
+ e1->setFocus();
+}
+
+int KateGotoLineDialog::getLine() {
+ return e1->value();
+}
+//END KateGotoLineDialog
+
+//BEGIN KateModOnHdPrompt
+KateModOnHdPrompt::KateModOnHdPrompt( KateDocument *doc,
+ int modtype,
+ const QString &reason,
+ QWidget *parent )
+ : KDialogBase( parent, "", true, "", Ok|Apply|Cancel|User1 ),
+ m_doc( doc ),
+ m_modtype ( modtype ),
+ m_tmpfile( 0 )
+{
+ QString title, btnOK, whatisok;
+ if ( modtype == 3 ) // deleted
+ {
+ title = i18n("File Was Deleted on Disk");
+ btnOK = i18n("&Save File As...");
+ whatisok = i18n("Lets you select a location and save the file again.");
+ } else {
+ title = i18n("File Changed on Disk");
+ btnOK = i18n("&Reload File");
+ whatisok = i18n("Reload the file from disk. If you have unsaved changes, "
+ "they will be lost.");
+ }
+
+ setButtonText( Ok, btnOK);
+ setButtonText( Apply, i18n("&Ignore") );
+
+ setButtonWhatsThis( Ok, whatisok );
+ setButtonWhatsThis( Apply, i18n("Ignore the changes. You will not be prompted again.") );
+ setButtonWhatsThis( Cancel, i18n("Do nothing. Next time you focus the file, "
+ "or try to save it or close it, you will be prompted again.") );
+
+ enableButtonSeparator( true );
+ setCaption( title );
+
+ QFrame *w = makeMainWidget();
+ QVBoxLayout *lo = new QVBoxLayout( w );
+ QHBoxLayout *lo1 = new QHBoxLayout( lo );
+ QLabel *icon = new QLabel( w );
+ icon->setPixmap( DesktopIcon("messagebox_warning" ) );
+ lo1->addWidget( icon );
+ lo1->addWidget( new QLabel( reason + "\n\n" + i18n("What do you want to do?"), w ) );
+
+ // If the file isn't deleted, present a diff button, and a overwrite action.
+ if ( modtype != 3 )
+ {
+ QHBoxLayout *lo2 = new QHBoxLayout( lo );
+ QPushButton *btnDiff = new QPushButton( i18n("&View Difference"), w );
+ lo2->addStretch( 1 );
+ lo2->addWidget( btnDiff );
+ connect( btnDiff, SIGNAL(clicked()), this, SLOT(slotDiff()) );
+ QWhatsThis::add( btnDiff, i18n(
+ "Calculates the difference between the editor contents and the disk "
+ "file using diff(1) and opens the diff file with the default application "
+ "for that.") );
+
+ setButtonText( User1, i18n("Overwrite") );
+ setButtonWhatsThis( User1, i18n("Overwrite the disk file with the editor content.") );
+ }
+ else
+ showButton( User1, false );
+}
+
+KateModOnHdPrompt::~KateModOnHdPrompt()
+{
+}
+
+void KateModOnHdPrompt::slotDiff()
+{
+ // Start a KProcess that creates a diff
+ KProcIO *p = new KProcIO();
+ p->setComm( KProcess::All );
+ *p << "diff" << "-u" << "-" << m_doc->url().path();
+ connect( p, SIGNAL(processExited(KProcess*)), this, SLOT(slotPDone(KProcess*)) );
+ connect( p, SIGNAL(readReady(KProcIO*)), this, SLOT(slotPRead(KProcIO*)) );
+
+ setCursor( WaitCursor );
+
+ p->start( KProcess::NotifyOnExit, true );
+
+ uint lastln = m_doc->numLines();
+ for ( uint l = 0; l < lastln; l++ )
+ p->writeStdin( m_doc->textLine( l ) );
+
+ p->closeWhenDone();
+}
+
+void KateModOnHdPrompt::slotPRead( KProcIO *p)
+{
+ // create a file for the diff if we haven't one allready
+ if ( ! m_tmpfile )
+ m_tmpfile = new KTempFile();
+ // put all the data we have in it
+ QString stmp;
+ bool dataRead = false;
+ while ( p->readln( stmp, false ) > -1 )
+ {
+ *m_tmpfile->textStream() << stmp << endl;
+ dataRead = true;
+ }
+
+ // dominik: only ackRead(), when we *really* read data, otherwise, this slot
+ // is called initity times, which leads to a crash
+ if( dataRead )
+ p->ackRead();
+}
+
+void KateModOnHdPrompt::slotPDone( KProcess *p )
+{
+ setCursor( ArrowCursor );
+ if( ! m_tmpfile )
+ {
+ // dominik: there were only whitespace changes, so that the diff returned by
+ // diff(1) has 0 bytes. So slotPRead() is never called, as there is
+ // no data, so that m_tmpfile was never created and thus is NULL.
+ // NOTE: would be nice, if we could produce a fake-diff, so that kompare
+ // tells us "The files are identical". Right now, we get an ugly
+ // "Could not parse diff output".
+ m_tmpfile = new KTempFile();
+ }
+ m_tmpfile->close();
+
+ if ( ! p->normalExit() /*|| p->exitStatus()*/ )
+ {
+ KMessageBox::sorry( this,
+ i18n("The diff command failed. Please make sure that "
+ "diff(1) is installed and in your PATH."),
+ i18n("Error Creating Diff") );
+ delete m_tmpfile;
+ m_tmpfile = 0;
+ return;
+ }
+
+ KRun::runURL( m_tmpfile->name(), "text/x-diff", true );
+ delete m_tmpfile;
+ m_tmpfile = 0;
+}
+
+void KateModOnHdPrompt::slotApply()
+{
+ if ( KMessageBox::warningContinueCancel(
+ this,
+ i18n("Ignoring means that you will not be warned again (unless "
+ "the disk file changes once more): if you save the document, you "
+ "will overwrite the file on disk; if you do not save then the disk file "
+ "(if present) is what you have."),
+ i18n("You Are on Your Own"),
+ KStdGuiItem::cont(),
+ "kate_ignore_modonhd" ) != KMessageBox::Continue )
+ return;
+
+ done(Ignore);
+}
+
+void KateModOnHdPrompt::slotOk()
+{
+ done( m_modtype == 3 ? Save : Reload );
+}
+
+void KateModOnHdPrompt::slotUser1()
+{
+ done( Overwrite );
+}
+
+//END KateModOnHdPrompt
+
+// kate: space-indent on; indent-width 2; replace-tabs on;
diff --git a/kate/part/katedialogs.h b/kate/part/katedialogs.h
new file mode 100644
index 000000000..ba03d5eff
--- /dev/null
+++ b/kate/part/katedialogs.h
@@ -0,0 +1,406 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2002, 2003 Anders Lund <anders.lund@lund.tdcadsl.dk>
+ Copyright (C) 2003 Christoph Cullmann <cullmann@kde.org>
+ Copyright (C) 2001 Joseph Wenninger <jowenn@kde.org>
+
+ Based on work of:
+ Copyright (C) 1999 Jochen Wilhelmy <digisnap@cs.tu-berlin.de>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef __KATE_DIALOGS_H__
+#define __KATE_DIALOGS_H__
+
+#include "katehighlight.h"
+#include "kateattribute.h"
+
+#include "../interfaces/document.h"
+
+#include <klistview.h>
+#include <kdialogbase.h>
+#include <kmimetype.h>
+
+#include <qstringlist.h>
+#include <qcolor.h>
+#include <qintdict.h>
+#include <qvbox.h>
+#include <qtabwidget.h>
+
+class KatePartPluginListItem;
+
+struct syntaxContextData;
+
+class KateDocument;
+class KateView;
+
+namespace KIO
+{
+ class Job;
+ class TransferJob;
+}
+
+class KAccel;
+class KColorButton;
+class KComboBox;
+class KIntNumInput;
+class KKeyButton;
+class KKeyChooser;
+class KMainWindow;
+class KPushButton;
+class KRegExpDialog;
+class KIntNumInput;
+
+class QButtonGroup;
+class QCheckBox;
+class QHBoxLayout;
+class QLabel;
+class QLineEdit;
+class QPushButton;
+class QRadioButton;
+class QSpinBox;
+class QListBoxItem;
+class QWidgetStack;
+class QVBox;
+class QListViewItem;
+class QCheckBox;
+
+class KateConfigPage : public Kate::ConfigPage
+{
+ Q_OBJECT
+
+ public:
+ KateConfigPage ( QWidget *parent=0, const char *name=0 );
+ virtual ~KateConfigPage ();
+
+ public:
+ bool changed () { return m_changed; }
+
+ private slots:
+ void somethingHasChanged ();
+
+ protected:
+ bool m_changed;
+};
+
+class KateGotoLineDialog : public KDialogBase
+{
+ Q_OBJECT
+
+ public:
+
+ KateGotoLineDialog(QWidget *parent, int line, int max);
+ int getLine();
+
+ protected:
+
+ KIntNumInput *e1;
+ QPushButton *btnOK;
+};
+
+class KateIndentConfigTab : public KateConfigPage
+{
+ Q_OBJECT
+
+ public:
+ KateIndentConfigTab(QWidget *parent);
+
+ protected slots:
+ void somethingToggled();
+ void indenterSelected (int);
+
+ protected:
+ enum { numFlags = 8 };
+ static const int flags[numFlags];
+ QCheckBox *opt[numFlags];
+ KIntNumInput *indentationWidth;
+ QButtonGroup *m_tabs;
+ KComboBox *m_indentMode;
+ QPushButton *m_configPage;
+
+ public slots:
+ void configPage();
+
+ void apply ();
+ void reload ();
+ void reset () {};
+ void defaults () {};
+};
+
+class KateSelectConfigTab : public KateConfigPage
+{
+ Q_OBJECT
+
+ public:
+ KateSelectConfigTab(QWidget *parent);
+
+ protected:
+ enum { numFlags = 2 };
+ static const int flags[numFlags];
+ QCheckBox *opt[numFlags];
+
+ QButtonGroup *m_tabs;
+ KIntNumInput *e4;
+ QCheckBox *e6;
+
+ public slots:
+ void apply ();
+ void reload ();
+ void reset () {};
+ void defaults () {};
+};
+
+class KateEditConfigTab : public KateConfigPage
+{
+ Q_OBJECT
+
+ public:
+ KateEditConfigTab(QWidget *parent);
+
+ protected:
+ enum { numFlags = 5 };
+ static const int flags[numFlags];
+ QCheckBox *opt[numFlags];
+
+ KIntNumInput *e1;
+ KIntNumInput *e2;
+ KIntNumInput *e3;
+ KComboBox *e5;
+ QCheckBox *m_wwmarker;
+
+ public slots:
+ void apply ();
+ void reload ();
+ void reset () {};
+ void defaults () {};
+};
+
+class KateViewDefaultsConfig : public KateConfigPage
+{
+ Q_OBJECT
+
+ public:
+ KateViewDefaultsConfig( QWidget *parent );
+ ~KateViewDefaultsConfig();
+
+ private:
+ QCheckBox *m_line;
+ QCheckBox *m_folding;
+ QCheckBox *m_collapseTopLevel;
+ QCheckBox *m_icons;
+ QCheckBox *m_scrollBarMarks;
+ QCheckBox *m_dynwrap;
+ QCheckBox *m_showIndentLines;
+ KIntNumInput *m_dynwrapAlignLevel;
+ QLabel *m_dynwrapIndicatorsLabel;
+ KComboBox *m_dynwrapIndicatorsCombo;
+ QButtonGroup *m_bmSort;
+
+ public slots:
+ void apply ();
+ void reload ();
+ void reset ();
+ void defaults ();
+};
+
+class KateEditKeyConfiguration: public KateConfigPage
+{
+ Q_OBJECT
+
+ public:
+ KateEditKeyConfiguration( QWidget* parent, KateDocument* doc );
+
+ public slots:
+ void apply();
+ void reload() {};
+ void reset() {};
+ void defaults() {};
+
+ protected:
+ void showEvent ( QShowEvent * );
+
+ private:
+ bool m_ready;
+ class KateDocument *m_doc;
+ KKeyChooser* m_keyChooser;
+ class KActionCollection *m_ac;
+};
+
+class KateSaveConfigTab : public KateConfigPage
+{
+ Q_OBJECT
+ public:
+ KateSaveConfigTab( QWidget *parent );
+
+ public slots:
+ void apply();
+ void reload();
+ void reset();
+ void defaults();
+
+ protected:
+ KComboBox *m_encoding, *m_eol;
+ QCheckBox *cbLocalFiles, *cbRemoteFiles;
+ QCheckBox *replaceTabs, *removeSpaces, *allowEolDetection;
+ QLineEdit *leBuPrefix;
+ QLineEdit *leBuSuffix;
+ KIntNumInput *dirSearchDepth;
+ class QSpinBox *blockCount;
+ class QLabel *blockCountLabel;
+};
+
+class KatePartPluginListItem;
+
+class KatePartPluginListView : public KListView
+{
+ Q_OBJECT
+
+ friend class KatePartPluginListItem;
+
+ public:
+ KatePartPluginListView (QWidget *parent = 0, const char *name = 0);
+
+ signals:
+ void stateChange(KatePartPluginListItem *, bool);
+
+ private:
+ void stateChanged(KatePartPluginListItem *, bool);
+};
+
+class QListViewItem;
+class KatePartPluginConfigPage : public KateConfigPage
+{
+ Q_OBJECT
+
+ public:
+ KatePartPluginConfigPage (QWidget *parent);
+ ~KatePartPluginConfigPage ();
+
+ public slots:
+ void apply ();
+ void reload () {};
+ void reset () {};
+ void defaults () {};
+
+ private slots:
+ void slotCurrentChanged( QListViewItem * );
+ void slotConfigure();
+ void slotStateChanged( KatePartPluginListItem *, bool );
+
+ private:
+ KatePartPluginListView *listView;
+ QPtrList<KatePartPluginListItem> m_items;
+ class QPushButton *btnConfigure;
+};
+
+class KateHlConfigPage : public KateConfigPage
+{
+ Q_OBJECT
+
+ public:
+ KateHlConfigPage (QWidget *parent, KateDocument *doc);
+ ~KateHlConfigPage ();
+
+ public slots:
+ void apply ();
+ void reload ();
+ void reset () {};
+ void defaults () {};
+
+ protected slots:
+ void hlChanged(int);
+ void hlDownload();
+ void showMTDlg();
+
+ private:
+ void writeback ();
+
+ QComboBox *hlCombo;
+ QLineEdit *wildcards;
+ QLineEdit *mimetypes;
+ class KIntNumInput *priority;
+ class QLabel *author, *license;
+
+ QIntDict<KateHlData> hlDataDict;
+ KateHlData *hlData;
+
+ KateDocument *m_doc;
+};
+
+class KateHlDownloadDialog: public KDialogBase
+{
+ Q_OBJECT
+
+ public:
+ KateHlDownloadDialog(QWidget *parent, const char *name, bool modal);
+ ~KateHlDownloadDialog();
+
+ private:
+ class QListView *list;
+ class QString listData;
+ KIO::TransferJob *transferJob;
+
+ private slots:
+ void listDataReceived(KIO::Job *, const QByteArray &data);
+
+ public slots:
+ void slotUser1();
+};
+
+class KProcIO;
+class KProcess;
+/**
+ * This dialog will prompt the user for what do with a file that is
+ * modified on disk.
+ * If the file wasn't deleted, it has a 'diff' button, which will create
+ * a diff file (uing diff(1)) and launch that using KRun.
+ */
+class KateModOnHdPrompt : public KDialogBase
+{
+ Q_OBJECT
+ public:
+ enum Status {
+ Reload=1, // 0 is KDialogBase::Cancel
+ Save,
+ Overwrite,
+ Ignore
+ };
+ KateModOnHdPrompt( KateDocument *doc, int modtype, const QString &reason, QWidget *parent );
+ ~KateModOnHdPrompt();
+
+ public slots:
+ /**
+ * Show a diff between the document text and the disk file.
+ * This will not close the dialog, since we still need a
+ * decision from the user.
+ */
+ void slotDiff();
+
+ void slotOk();
+ void slotApply();
+ void slotUser1();
+
+ private slots:
+ void slotPRead(KProcIO*); ///< Read from the diff process
+ void slotPDone(KProcess*); ///< Runs the diff file when done
+
+ private:
+ KateDocument *m_doc;
+ int m_modtype;
+ class KTempFile *m_tmpfile; ///< The diff file. Deleted by KRun when the viewer is exited.
+
+};
+
+#endif
diff --git a/kate/part/katedocument.cpp b/kate/part/katedocument.cpp
new file mode 100644
index 000000000..68374ebe1
--- /dev/null
+++ b/kate/part/katedocument.cpp
@@ -0,0 +1,5174 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2001-2004 Christoph Cullmann <cullmann@kde.org>
+ Copyright (C) 2001 Joseph Wenninger <jowenn@kde.org>
+ Copyright (C) 1999 Jochen Wilhelmy <digisnap@cs.tu-berlin.de>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02111-13020, USA.
+*/
+
+//BEGIN includes
+#include "katedocument.h"
+#include "katedocument.moc"
+#include "katekeyinterceptorfunctor.h"
+#include "katefactory.h"
+#include "katedialogs.h"
+#include "katehighlight.h"
+#include "kateview.h"
+#include "katesearch.h"
+#include "kateautoindent.h"
+#include "katetextline.h"
+#include "katedocumenthelpers.h"
+#include "kateprinter.h"
+#include "katelinerange.h"
+#include "katesupercursor.h"
+#include "katearbitraryhighlight.h"
+#include "katerenderer.h"
+#include "kateattribute.h"
+#include "kateconfig.h"
+#include "katefiletype.h"
+#include "kateschema.h"
+#include "katetemplatehandler.h"
+#include <ktexteditor/plugin.h>
+
+#include <kio/job.h>
+#include <kio/netaccess.h>
+#include <kio/kfileitem.h>
+
+
+#include <kparts/event.h>
+
+#include <klocale.h>
+#include <kglobal.h>
+#include <kapplication.h>
+#include <kpopupmenu.h>
+#include <kconfig.h>
+#include <kfiledialog.h>
+#include <kmessagebox.h>
+#include <kstdaction.h>
+#include <kiconloader.h>
+#include <kxmlguifactory.h>
+#include <kdialogbase.h>
+#include <kdebug.h>
+#include <kglobalsettings.h>
+#include <klibloader.h>
+#include <kdirwatch.h>
+#include <kwin.h>
+#include <kencodingfiledialog.h>
+#include <ktempfile.h>
+#include <kmdcodec.h>
+#include <kstandarddirs.h>
+
+#include <qtimer.h>
+#include <qfile.h>
+#include <qclipboard.h>
+#include <qtextstream.h>
+#include <qtextcodec.h>
+#include <qmap.h>
+//END includes
+
+//BEGIN PRIVATE CLASSES
+class KatePartPluginItem
+{
+ public:
+ KTextEditor::Plugin *plugin;
+};
+//END PRIVATE CLASSES
+
+//BEGIN d'tor, c'tor
+//
+// KateDocument Constructor
+//
+KateDocument::KateDocument ( bool bSingleViewMode, bool bBrowserView,
+ bool bReadOnly, QWidget *parentWidget,
+ const char *widgetName, QObject *parent, const char *name)
+: Kate::Document(parent, name),
+ m_plugins (KateFactory::self()->plugins().count()),
+ m_undoDontMerge(false),
+ m_undoIgnoreCancel(false),
+ lastUndoGroupWhenSaved( 0 ),
+ lastRedoGroupWhenSaved( 0 ),
+ docWasSavedWhenUndoWasEmpty( true ),
+ docWasSavedWhenRedoWasEmpty( true ),
+ m_modOnHd (false),
+ m_modOnHdReason (0),
+ m_job (0),
+ m_tempFile (0),
+ m_tabInterceptor(0)
+{
+ m_undoComplexMerge=false;
+ m_isInUndo = false;
+ // my dcop object
+ setObjId ("KateDocument#"+documentDCOPSuffix());
+
+ // ktexteditor interfaces
+ setBlockSelectionInterfaceDCOPSuffix (documentDCOPSuffix());
+ setConfigInterfaceDCOPSuffix (documentDCOPSuffix());
+ setConfigInterfaceExtensionDCOPSuffix (documentDCOPSuffix());
+ setCursorInterfaceDCOPSuffix (documentDCOPSuffix());
+ setEditInterfaceDCOPSuffix (documentDCOPSuffix());
+ setEncodingInterfaceDCOPSuffix (documentDCOPSuffix());
+ setHighlightingInterfaceDCOPSuffix (documentDCOPSuffix());
+ setMarkInterfaceDCOPSuffix (documentDCOPSuffix());
+ setMarkInterfaceExtensionDCOPSuffix (documentDCOPSuffix());
+ setPrintInterfaceDCOPSuffix (documentDCOPSuffix());
+ setSearchInterfaceDCOPSuffix (documentDCOPSuffix());
+ setSelectionInterfaceDCOPSuffix (documentDCOPSuffix());
+ setSelectionInterfaceExtDCOPSuffix (documentDCOPSuffix());
+ setSessionConfigInterfaceDCOPSuffix (documentDCOPSuffix());
+ setUndoInterfaceDCOPSuffix (documentDCOPSuffix());
+ setWordWrapInterfaceDCOPSuffix (documentDCOPSuffix());
+
+ // init local plugin array
+ m_plugins.fill (0);
+
+ // register doc at factory
+ KateFactory::self()->registerDocument (this);
+
+ m_reloading = false;
+ m_loading = false;
+ m_encodingSticky = false;
+
+ m_buffer = new KateBuffer (this);
+
+ // init the config object, be careful not to use it
+ // until the initial readConfig() call is done
+ m_config = new KateDocumentConfig (this);
+
+ // init some more vars !
+ m_activeView = 0L;
+
+ hlSetByUser = false;
+ m_fileType = -1;
+ m_fileTypeSetByUser = false;
+ setInstance( KateFactory::self()->instance() );
+
+ editSessionNumber = 0;
+ editIsRunning = false;
+ m_editCurrentUndo = 0L;
+ editWithUndo = false;
+
+ m_docNameNumber = 0;
+
+ m_bSingleViewMode = bSingleViewMode;
+ m_bBrowserView = bBrowserView;
+ m_bReadOnly = bReadOnly;
+
+ m_marks.setAutoDelete( true );
+ m_markPixmaps.setAutoDelete( true );
+ m_markDescriptions.setAutoDelete( true );
+ setMarksUserChangable( markType01 );
+
+ m_undoMergeTimer = new QTimer(this);
+ connect(m_undoMergeTimer, SIGNAL(timeout()), SLOT(undoCancel()));
+
+ clearMarks ();
+ clearUndo ();
+ clearRedo ();
+ setModified (false);
+ docWasSavedWhenUndoWasEmpty = true;
+
+ // normal hl
+ m_buffer->setHighlight (0);
+
+ m_extension = new KateBrowserExtension( this );
+ m_arbitraryHL = new KateArbitraryHighlight();
+ m_indenter = KateAutoIndent::createIndenter ( this, 0 );
+
+ m_indenter->updateConfig ();
+
+ // some nice signals from the buffer
+ connect(m_buffer, SIGNAL(tagLines(int,int)), this, SLOT(tagLines(int,int)));
+ connect(m_buffer, SIGNAL(codeFoldingUpdated()),this,SIGNAL(codeFoldingUpdated()));
+
+ // if the user changes the highlight with the dialog, notify the doc
+ connect(KateHlManager::self(),SIGNAL(changed()),SLOT(internalHlChanged()));
+
+ // signal for the arbitrary HL
+ connect(m_arbitraryHL, SIGNAL(tagLines(KateView*, KateSuperRange*)), SLOT(tagArbitraryLines(KateView*, KateSuperRange*)));
+
+ // signals for mod on hd
+ connect( KateFactory::self()->dirWatch(), SIGNAL(dirty (const QString &)),
+ this, SLOT(slotModOnHdDirty (const QString &)) );
+
+ connect( KateFactory::self()->dirWatch(), SIGNAL(created (const QString &)),
+ this, SLOT(slotModOnHdCreated (const QString &)) );
+
+ connect( KateFactory::self()->dirWatch(), SIGNAL(deleted (const QString &)),
+ this, SLOT(slotModOnHdDeleted (const QString &)) );
+
+ // update doc name
+ setDocName ("");
+
+ // if single view mode, like in the konqui embedding, create a default view ;)
+ if ( m_bSingleViewMode )
+ {
+ KTextEditor::View *view = createView( parentWidget, widgetName );
+ insertChildClient( view );
+ view->show();
+ setWidget( view );
+ }
+
+ connect(this,SIGNAL(sigQueryClose(bool *, bool*)),this,SLOT(slotQueryClose_save(bool *, bool*)));
+
+ m_isasking = 0;
+
+ // plugins
+ for (uint i=0; i<KateFactory::self()->plugins().count(); i++)
+ {
+ if (config()->plugin (i))
+ loadPlugin (i);
+ }
+}
+
+//
+// KateDocument Destructor
+//
+KateDocument::~KateDocument()
+{
+ // remove file from dirwatch
+ deactivateDirWatch ();
+
+ if (!singleViewMode())
+ {
+ // clean up remaining views
+ m_views.setAutoDelete( true );
+ m_views.clear();
+ }
+
+ delete m_editCurrentUndo;
+
+ delete m_arbitraryHL;
+
+ // cleanup the undo items, very important, truee :/
+ undoItems.setAutoDelete(true);
+ undoItems.clear();
+
+ // clean up plugins
+ unloadAllPlugins ();
+
+ delete m_config;
+ delete m_indenter;
+ KateFactory::self()->deregisterDocument (this);
+}
+//END
+
+//BEGIN Plugins
+void KateDocument::unloadAllPlugins ()
+{
+ for (uint i=0; i<m_plugins.count(); i++)
+ unloadPlugin (i);
+}
+
+void KateDocument::enableAllPluginsGUI (KateView *view)
+{
+ for (uint i=0; i<m_plugins.count(); i++)
+ enablePluginGUI (m_plugins[i], view);
+}
+
+void KateDocument::disableAllPluginsGUI (KateView *view)
+{
+ for (uint i=0; i<m_plugins.count(); i++)
+ disablePluginGUI (m_plugins[i], view);
+}
+
+void KateDocument::loadPlugin (uint pluginIndex)
+{
+ if (m_plugins[pluginIndex]) return;
+
+ m_plugins[pluginIndex] = KTextEditor::createPlugin (QFile::encodeName((KateFactory::self()->plugins())[pluginIndex]->library()), this);
+
+ enablePluginGUI (m_plugins[pluginIndex]);
+}
+
+void KateDocument::unloadPlugin (uint pluginIndex)
+{
+ if (!m_plugins[pluginIndex]) return;
+
+ disablePluginGUI (m_plugins[pluginIndex]);
+
+ delete m_plugins[pluginIndex];
+ m_plugins[pluginIndex] = 0L;
+}
+
+void KateDocument::enablePluginGUI (KTextEditor::Plugin *plugin, KateView *view)
+{
+ if (!plugin) return;
+ if (!KTextEditor::pluginViewInterface(plugin)) return;
+
+ KXMLGUIFactory *factory = view->factory();
+ if ( factory )
+ factory->removeClient( view );
+
+ KTextEditor::pluginViewInterface(plugin)->addView(view);
+
+ if ( factory )
+ factory->addClient( view );
+}
+
+void KateDocument::enablePluginGUI (KTextEditor::Plugin *plugin)
+{
+ if (!plugin) return;
+ if (!KTextEditor::pluginViewInterface(plugin)) return;
+
+ for (uint i=0; i< m_views.count(); i++)
+ enablePluginGUI (plugin, m_views.at(i));
+}
+
+void KateDocument::disablePluginGUI (KTextEditor::Plugin *plugin, KateView *view)
+{
+ if (!plugin) return;
+ if (!KTextEditor::pluginViewInterface(plugin)) return;
+
+ KXMLGUIFactory *factory = view->factory();
+ if ( factory )
+ factory->removeClient( view );
+
+ KTextEditor::pluginViewInterface( plugin )->removeView( view );
+
+ if ( factory )
+ factory->addClient( view );
+}
+
+void KateDocument::disablePluginGUI (KTextEditor::Plugin *plugin)
+{
+ if (!plugin) return;
+ if (!KTextEditor::pluginViewInterface(plugin)) return;
+
+ for (uint i=0; i< m_views.count(); i++)
+ disablePluginGUI (plugin, m_views.at(i));
+}
+//END
+
+//BEGIN KTextEditor::Document stuff
+
+KTextEditor::View *KateDocument::createView( QWidget *parent, const char *name )
+{
+ KateView* newView = new KateView( this, parent, name);
+ connect(newView, SIGNAL(cursorPositionChanged()), SLOT(undoCancel()));
+ if ( s_fileChangedDialogsActivated )
+ connect( newView, SIGNAL(gotFocus( Kate::View * )), this, SLOT(slotModifiedOnDisk()) );
+ return newView;
+}
+
+QPtrList<KTextEditor::View> KateDocument::views () const
+{
+ return m_textEditViews;
+}
+
+void KateDocument::setActiveView( KateView *view )
+{
+ if ( m_activeView == view ) return;
+
+ m_activeView = view;
+}
+//END
+
+//BEGIN KTextEditor::ConfigInterfaceExtension stuff
+
+uint KateDocument::configPages () const
+{
+ return 10;
+}
+
+KTextEditor::ConfigPage *KateDocument::configPage (uint number, QWidget *parent, const char * )
+{
+ switch( number )
+ {
+ case 0:
+ return new KateViewDefaultsConfig (parent);
+
+ case 1:
+ return new KateSchemaConfigPage (parent, this);
+
+ case 2:
+ return new KateSelectConfigTab (parent);
+
+ case 3:
+ return new KateEditConfigTab (parent);
+
+ case 4:
+ return new KateIndentConfigTab (parent);
+
+ case 5:
+ return new KateSaveConfigTab (parent);
+
+ case 6:
+ return new KateHlConfigPage (parent, this);
+
+ case 7:
+ return new KateFileTypeConfigTab (parent);
+
+ case 8:
+ return new KateEditKeyConfiguration (parent, this);
+
+ case 9:
+ return new KatePartPluginConfigPage (parent);
+
+ default:
+ return 0;
+ }
+
+ return 0;
+}
+
+QString KateDocument::configPageName (uint number) const
+{
+ switch( number )
+ {
+ case 0:
+ return i18n ("Appearance");
+
+ case 1:
+ return i18n ("Fonts & Colors");
+
+ case 2:
+ return i18n ("Cursor & Selection");
+
+ case 3:
+ return i18n ("Editing");
+
+ case 4:
+ return i18n ("Indentation");
+
+ case 5:
+ return i18n("Open/Save");
+
+ case 6:
+ return i18n ("Highlighting");
+
+ case 7:
+ return i18n("Filetypes");
+
+ case 8:
+ return i18n ("Shortcuts");
+
+ case 9:
+ return i18n ("Plugins");
+
+ default:
+ return QString ("");
+ }
+
+ return QString ("");
+}
+
+QString KateDocument::configPageFullName (uint number) const
+{
+ switch( number )
+ {
+ case 0:
+ return i18n("Appearance");
+
+ case 1:
+ return i18n ("Font & Color Schemas");
+
+ case 2:
+ return i18n ("Cursor & Selection Behavior");
+
+ case 3:
+ return i18n ("Editing Options");
+
+ case 4:
+ return i18n ("Indentation Rules");
+
+ case 5:
+ return i18n("File Opening & Saving");
+
+ case 6:
+ return i18n ("Highlighting Rules");
+
+ case 7:
+ return i18n("Filetype Specific Settings");
+
+ case 8:
+ return i18n ("Shortcuts Configuration");
+
+ case 9:
+ return i18n ("Plugin Manager");
+
+ default:
+ return QString ("");
+ }
+
+ return QString ("");
+}
+
+QPixmap KateDocument::configPagePixmap (uint number, int size) const
+{
+ switch( number )
+ {
+ case 0:
+ return BarIcon("view_text",size);
+
+ case 1:
+ return BarIcon("colorize", size);
+
+ case 2:
+ return BarIcon("frame_edit", size);
+
+ case 3:
+ return BarIcon("edit", size);
+
+ case 4:
+ return BarIcon("rightjust", size);
+
+ case 5:
+ return BarIcon("filesave", size);
+
+ case 6:
+ return BarIcon("source", size);
+
+ case 7:
+ return BarIcon("edit", size);
+
+ case 8:
+ return BarIcon("key_enter", size);
+
+ case 9:
+ return BarIcon("connect_established", size);
+
+ default:
+ return BarIcon("edit", size);
+ }
+
+ return BarIcon("edit", size);
+}
+//END
+
+//BEGIN KTextEditor::EditInterface stuff
+
+QString KateDocument::text() const
+{
+ QString s;
+
+ for (uint i = 0; i < m_buffer->count(); i++)
+ {
+ KateTextLine::Ptr textLine = m_buffer->plainLine(i);
+
+ if (textLine)
+ {
+ s.append (textLine->string());
+
+ if ((i+1) < m_buffer->count())
+ s.append('\n');
+ }
+ }
+
+ return s;
+}
+
+QString KateDocument::text ( uint startLine, uint startCol, uint endLine, uint endCol ) const
+{
+ return text(startLine, startCol, endLine, endCol, false);
+}
+
+QString KateDocument::text ( uint startLine, uint startCol, uint endLine, uint endCol, bool blockwise) const
+{
+ if ( blockwise && (startCol > endCol) )
+ return QString ();
+
+ QString s;
+
+ if (startLine == endLine)
+ {
+ if (startCol > endCol)
+ return QString ();
+
+ KateTextLine::Ptr textLine = m_buffer->plainLine(startLine);
+
+ if ( !textLine )
+ return QString ();
+
+ return textLine->string(startCol, endCol-startCol);
+ }
+ else
+ {
+
+ for (uint i = startLine; (i <= endLine) && (i < m_buffer->count()); i++)
+ {
+ KateTextLine::Ptr textLine = m_buffer->plainLine(i);
+
+ if ( !blockwise )
+ {
+ if (i == startLine)
+ s.append (textLine->string(startCol, textLine->length()-startCol));
+ else if (i == endLine)
+ s.append (textLine->string(0, endCol));
+ else
+ s.append (textLine->string());
+ }
+ else
+ {
+ s.append( textLine->string( startCol, endCol-startCol));
+ }
+
+ if ( i < endLine )
+ s.append('\n');
+ }
+ }
+
+ return s;
+}
+
+QString KateDocument::textLine( uint line ) const
+{
+ KateTextLine::Ptr l = m_buffer->plainLine(line);
+
+ if (!l)
+ return QString();
+
+ return l->string();
+}
+
+bool KateDocument::setText(const QString &s)
+{
+ if (!isReadWrite())
+ return false;
+
+ QPtrList<KTextEditor::Mark> m = marks ();
+ QValueList<KTextEditor::Mark> msave;
+
+ for (uint i=0; i < m.count(); i++)
+ msave.append (*m.at(i));
+
+ editStart ();
+
+ // delete the text
+ clear();
+
+ // insert the new text
+ insertText (0, 0, s);
+
+ editEnd ();
+
+ for (uint i=0; i < msave.count(); i++)
+ setMark (msave[i].line, msave[i].type);
+
+ return true;
+}
+
+bool KateDocument::clear()
+{
+ if (!isReadWrite())
+ return false;
+
+ for (KateView * view = m_views.first(); view != 0L; view = m_views.next() ) {
+ view->clear();
+ view->tagAll();
+ view->update();
+ }
+
+ clearMarks ();
+
+ return removeText (0,0,lastLine()+1, 0);
+}
+
+bool KateDocument::insertText( uint line, uint col, const QString &s)
+{
+ return insertText (line, col, s, false);
+}
+
+bool KateDocument::insertText( uint line, uint col, const QString &s, bool blockwise )
+{
+ if (!isReadWrite())
+ return false;
+
+ if (s.isEmpty())
+ return true;
+
+ if (line == numLines())
+ editInsertLine(line,"");
+ else if (line > lastLine())
+ return false;
+
+ editStart ();
+
+ uint insertPos = col;
+ uint len = s.length();
+
+ QString buf;
+
+ bool replacetabs = ( config()->configFlags() & KateDocumentConfig::cfReplaceTabsDyn && ! m_isInUndo );
+ uint tw = config()->tabWidth();
+ uint insertPosExpanded = insertPos;
+ KateTextLine::Ptr l = m_buffer->line( line );
+ if (l != 0)
+ insertPosExpanded = l->cursorX( insertPos, tw );
+
+ for (uint pos = 0; pos < len; pos++)
+ {
+ QChar ch = s[pos];
+
+ if (ch == '\n')
+ {
+ editInsertText (line, insertPos, buf);
+
+ if ( !blockwise )
+ {
+ editWrapLine (line, insertPos + buf.length());
+ insertPos = insertPosExpanded = 0;
+ }
+ else
+ {
+ if ( line == lastLine() )
+ editWrapLine (line, insertPos + buf.length());
+ }
+
+ line++;
+ buf.truncate(0);
+ l = m_buffer->line( line );
+ if (l)
+ insertPosExpanded = l->cursorX( insertPos, tw );
+ }
+ else
+ {
+ if ( replacetabs && ch == '\t' )
+ {
+ uint tr = tw - ( insertPosExpanded+buf.length() )%tw;
+ for ( uint i=0; i < tr; i++ )
+ buf += ' ';
+ }
+ else
+ buf += ch; // append char to buffer
+ }
+ }
+
+ editInsertText (line, insertPos, buf);
+
+ editEnd ();
+ emit textInserted(line,insertPos);
+ return true;
+}
+
+bool KateDocument::removeText ( uint startLine, uint startCol, uint endLine, uint endCol )
+{
+ return removeText (startLine, startCol, endLine, endCol, false);
+}
+
+bool KateDocument::removeText ( uint startLine, uint startCol, uint endLine, uint endCol, bool blockwise)
+{
+ if (!isReadWrite())
+ return false;
+
+ if ( blockwise && (startCol > endCol) )
+ return false;
+
+ if ( startLine > endLine )
+ return false;
+
+ if ( startLine > lastLine() )
+ return false;
+
+ if (!blockwise) {
+ emit aboutToRemoveText(KateTextRange(startLine,startCol,endLine,endCol));
+ }
+ editStart ();
+
+ if ( !blockwise )
+ {
+ if ( endLine > lastLine() )
+ {
+ endLine = lastLine()+1;
+ endCol = 0;
+ }
+
+ if (startLine == endLine)
+ {
+ editRemoveText (startLine, startCol, endCol-startCol);
+ }
+ else if ((startLine+1) == endLine)
+ {
+ if ( (m_buffer->plainLine(startLine)->length()-startCol) > 0 )
+ editRemoveText (startLine, startCol, m_buffer->plainLine(startLine)->length()-startCol);
+
+ editRemoveText (startLine+1, 0, endCol);
+ editUnWrapLine (startLine);
+ }
+ else
+ {
+ for (uint line = endLine; line >= startLine; line--)
+ {
+ if ((line > startLine) && (line < endLine))
+ {
+ editRemoveLine (line);
+ }
+ else
+ {
+ if (line == endLine)
+ {
+ if ( endLine <= lastLine() )
+ editRemoveText (line, 0, endCol);
+ }
+ else
+ {
+ if ( (m_buffer->plainLine(line)->length()-startCol) > 0 )
+ editRemoveText (line, startCol, m_buffer->plainLine(line)->length()-startCol);
+
+ editUnWrapLine (startLine);
+ }
+ }
+
+ if ( line == 0 )
+ break;
+ }
+ }
+ } // if ( ! blockwise )
+ else
+ {
+ if ( endLine > lastLine() )
+ endLine = lastLine ();
+
+ for (uint line = endLine; line >= startLine; line--)
+ {
+
+ editRemoveText (line, startCol, endCol-startCol);
+
+ if ( line == 0 )
+ break;
+ }
+ }
+
+ editEnd ();
+ emit textRemoved();
+ return true;
+}
+
+bool KateDocument::insertLine( uint l, const QString &str )
+{
+ if (!isReadWrite())
+ return false;
+
+ if (l > numLines())
+ return false;
+
+ return editInsertLine (l, str);
+}
+
+bool KateDocument::removeLine( uint line )
+{
+ if (!isReadWrite())
+ return false;
+
+ if (line > lastLine())
+ return false;
+
+ return editRemoveLine (line);
+}
+
+uint KateDocument::length() const
+{
+ uint l = 0;
+
+ for (uint i = 0; i < m_buffer->count(); i++)
+ {
+ KateTextLine::Ptr line = m_buffer->plainLine(i);
+
+ if (line)
+ l += line->length();
+ }
+
+ return l;
+}
+
+uint KateDocument::numLines() const
+{
+ return m_buffer->count();
+}
+
+uint KateDocument::numVisLines() const
+{
+ return m_buffer->countVisible ();
+}
+
+int KateDocument::lineLength ( uint line ) const
+{
+ KateTextLine::Ptr l = m_buffer->plainLine(line);
+
+ if (!l)
+ return -1;
+
+ return l->length();
+}
+//END
+
+//BEGIN KTextEditor::EditInterface internal stuff
+//
+// Starts an edit session with (or without) undo, update of view disabled during session
+//
+void KateDocument::editStart (bool withUndo)
+{
+ editSessionNumber++;
+
+ if (editSessionNumber > 1)
+ return;
+
+ editIsRunning = true;
+ editWithUndo = withUndo;
+
+ if (editWithUndo)
+ undoStart();
+ else
+ undoCancel();
+
+ for (uint z = 0; z < m_views.count(); z++)
+ {
+ m_views.at(z)->editStart ();
+ }
+
+ m_buffer->editStart ();
+}
+
+void KateDocument::undoStart()
+{
+ if (m_editCurrentUndo || (m_activeView && m_activeView->imComposeEvent())) return;
+
+ // Make sure the buffer doesn't get bigger than requested
+ if ((config()->undoSteps() > 0) && (undoItems.count() > config()->undoSteps()))
+ {
+ undoItems.setAutoDelete(true);
+ undoItems.removeFirst();
+ undoItems.setAutoDelete(false);
+ docWasSavedWhenUndoWasEmpty = false;
+ }
+
+ // new current undo item
+ m_editCurrentUndo = new KateUndoGroup(this);
+}
+
+void KateDocument::undoEnd()
+{
+ if (m_activeView && m_activeView->imComposeEvent())
+ return;
+
+ if (m_editCurrentUndo)
+ {
+ bool changedUndo = false;
+
+ if (m_editCurrentUndo->isEmpty())
+ delete m_editCurrentUndo;
+ else if (!m_undoDontMerge && undoItems.last() && undoItems.last()->merge(m_editCurrentUndo,m_undoComplexMerge))
+ delete m_editCurrentUndo;
+ else
+ {
+ undoItems.append(m_editCurrentUndo);
+ changedUndo = true;
+ }
+
+ m_undoDontMerge = false;
+ m_undoIgnoreCancel = true;
+
+ m_editCurrentUndo = 0L;
+
+ // (Re)Start the single-shot timer to cancel the undo merge
+ // the user has 5 seconds to input more data, or undo merging gets canceled for the current undo item.
+ m_undoMergeTimer->start(5000, true);
+
+ if (changedUndo)
+ emit undoChanged();
+ }
+}
+
+void KateDocument::undoCancel()
+{
+ if (m_undoIgnoreCancel) {
+ m_undoIgnoreCancel = false;
+ return;
+ }
+
+ m_undoDontMerge = true;
+
+ Q_ASSERT(!m_editCurrentUndo);
+
+ // As you can see by the above assert, neither of these should really be required
+ delete m_editCurrentUndo;
+ m_editCurrentUndo = 0L;
+}
+
+void KateDocument::undoSafePoint() {
+ Q_ASSERT(m_editCurrentUndo);
+ if (!m_editCurrentUndo) return;
+ m_editCurrentUndo->safePoint();
+}
+
+//
+// End edit session and update Views
+//
+void KateDocument::editEnd ()
+{
+ if (editSessionNumber == 0)
+ return;
+
+ // wrap the new/changed text, if something really changed!
+ if (m_buffer->editChanged() && (editSessionNumber == 1))
+ if (editWithUndo && config()->wordWrap())
+ wrapText (m_buffer->editTagStart(), m_buffer->editTagEnd());
+
+ editSessionNumber--;
+
+ if (editSessionNumber > 0)
+ return;
+
+ // end buffer edit, will trigger hl update
+ // this will cause some possible adjustment of tagline start/end
+ m_buffer->editEnd ();
+
+ if (editWithUndo)
+ undoEnd();
+
+ // edit end for all views !!!!!!!!!
+ for (uint z = 0; z < m_views.count(); z++)
+ m_views.at(z)->editEnd (m_buffer->editTagStart(), m_buffer->editTagEnd(), m_buffer->editTagFrom());
+
+ if (m_buffer->editChanged())
+ {
+ setModified(true);
+ emit textChanged ();
+ }
+
+ editIsRunning = false;
+}
+
+bool KateDocument::wrapText (uint startLine, uint endLine)
+{
+ uint col = config()->wordWrapAt();
+
+ if (col == 0)
+ return false;
+
+ editStart ();
+
+ for (uint line = startLine; (line <= endLine) && (line < numLines()); line++)
+ {
+ KateTextLine::Ptr l = m_buffer->line(line);
+
+ if (!l)
+ return false;
+
+ kdDebug (13020) << "try wrap line: " << line << endl;
+
+ if (l->lengthWithTabs(m_buffer->tabWidth()) > col)
+ {
+ KateTextLine::Ptr nextl = m_buffer->line(line+1);
+
+ kdDebug (13020) << "do wrap line: " << line << endl;
+
+ const QChar *text = l->text();
+ uint eolPosition = l->length()-1;
+
+ // take tabs into account here, too
+ uint x = 0;
+ const QString & t = l->string();
+ uint z2 = 0;
+ for ( ; z2 < l->length(); z2++)
+ {
+ if (t[z2] == QChar('\t'))
+ x += m_buffer->tabWidth() - (x % m_buffer->tabWidth());
+ else
+ x++;
+
+ if (x > col)
+ break;
+ }
+
+ uint searchStart = kMin (z2, l->length()-1);
+
+ // If where we are wrapping is an end of line and is a space we don't
+ // want to wrap there
+ if (searchStart == eolPosition && text[searchStart].isSpace())
+ searchStart--;
+
+ // Scan backwards looking for a place to break the line
+ // We are not interested in breaking at the first char
+ // of the line (if it is a space), but we are at the second
+ // anders: if we can't find a space, try breaking on a word
+ // boundry, using KateHighlight::canBreakAt().
+ // This could be a priority (setting) in the hl/filetype/document
+ int z = 0;
+ uint nw = 0; // alternative position, a non word character
+ for (z=searchStart; z > 0; z--)
+ {
+ if (text[z].isSpace()) break;
+ if ( ! nw && highlight()->canBreakAt( text[z] , l->attribute(z) ) )
+ nw = z;
+ }
+
+ if (z > 0)
+ {
+ // cu space
+ editRemoveText (line, z, 1);
+ }
+ else
+ {
+ // There was no space to break at so break at a nonword character if
+ // found, or at the wrapcolumn ( that needs be configurable )
+ // Don't try and add any white space for the break
+ if ( nw && nw < col ) nw++; // break on the right side of the character
+ z = nw ? nw : col;
+ }
+
+ if (nextl && !nextl->isAutoWrapped())
+ {
+ editWrapLine (line, z, true);
+ editMarkLineAutoWrapped (line+1, true);
+
+ endLine++;
+ }
+ else
+ {
+ if (nextl && (nextl->length() > 0) && !nextl->getChar(0).isSpace() && ((l->length() < 1) || !l->getChar(l->length()-1).isSpace()))
+ editInsertText (line+1, 0, QString (" "));
+
+ bool newLineAdded = false;
+ editWrapLine (line, z, false, &newLineAdded);
+
+ editMarkLineAutoWrapped (line+1, true);
+
+ endLine++;
+ }
+ }
+ }
+
+ editEnd ();
+
+ return true;
+}
+
+void KateDocument::editAddUndo (KateUndoGroup::UndoType type, uint line, uint col, uint len, const QString &text)
+{
+ if (editIsRunning && editWithUndo && m_editCurrentUndo) {
+ m_editCurrentUndo->addItem(type, line, col, len, text);
+
+ // Clear redo buffer
+ if (redoItems.count()) {
+ redoItems.setAutoDelete(true);
+ redoItems.clear();
+ redoItems.setAutoDelete(false);
+ }
+ }
+}
+
+bool KateDocument::editInsertText ( uint line, uint col, const QString &str )
+{
+ if (!isReadWrite())
+ return false;
+
+ QString s = str;
+
+ KateTextLine::Ptr l = m_buffer->line(line);
+
+ if (!l)
+ return false;
+
+ if ( config()->configFlags() & KateDocumentConfig::cfReplaceTabsDyn && ! m_isInUndo )
+ {
+ uint tw = config()->tabWidth();
+ int pos = 0;
+ uint l = 0;
+ while ( (pos = s.find('\t')) > -1 )
+ {
+ l = tw - ( (col + pos)%tw );
+ s.replace( pos, 1, QString().fill( ' ', l ) );
+ }
+ }
+
+ editStart ();
+
+ editAddUndo (KateUndoGroup::editInsertText, line, col, s.length(), s);
+
+ l->insertText (col, s.length(), s.unicode());
+// removeTrailingSpace(line); // ### nessecary?
+
+ m_buffer->changeLine(line);
+
+ for( QPtrListIterator<KateSuperCursor> it (m_superCursors); it.current(); ++it )
+ it.current()->editTextInserted (line, col, s.length());
+
+ editEnd ();
+
+ return true;
+}
+
+bool KateDocument::editRemoveText ( uint line, uint col, uint len )
+{
+ if (!isReadWrite())
+ return false;
+
+ KateTextLine::Ptr l = m_buffer->line(line);
+
+ if (!l)
+ return false;
+
+ editStart ();
+
+ editAddUndo (KateUndoGroup::editRemoveText, line, col, len, l->string().mid(col, len));
+
+ l->removeText (col, len);
+ removeTrailingSpace( line );
+
+ m_buffer->changeLine(line);
+
+ for( QPtrListIterator<KateSuperCursor> it (m_superCursors); it.current(); ++it )
+ it.current()->editTextRemoved (line, col, len);
+
+ editEnd ();
+
+ return true;
+}
+
+bool KateDocument::editMarkLineAutoWrapped ( uint line, bool autowrapped )
+{
+ if (!isReadWrite())
+ return false;
+
+ KateTextLine::Ptr l = m_buffer->line(line);
+
+ if (!l)
+ return false;
+
+ editStart ();
+
+ editAddUndo (KateUndoGroup::editMarkLineAutoWrapped, line, autowrapped ? 1 : 0, 0, QString::null);
+
+ l->setAutoWrapped (autowrapped);
+
+ m_buffer->changeLine(line);
+
+ editEnd ();
+
+ return true;
+}
+
+bool KateDocument::editWrapLine ( uint line, uint col, bool newLine, bool *newLineAdded)
+{
+ if (!isReadWrite())
+ return false;
+
+ KateTextLine::Ptr l = m_buffer->line(line);
+
+ if (!l)
+ return false;
+
+ editStart ();
+
+ KateTextLine::Ptr nextLine = m_buffer->line(line+1);
+
+ int pos = l->length() - col;
+
+ if (pos < 0)
+ pos = 0;
+
+ editAddUndo (KateUndoGroup::editWrapLine, line, col, pos, (!nextLine || newLine) ? "1" : "0");
+
+ if (!nextLine || newLine)
+ {
+ KateTextLine::Ptr textLine = new KateTextLine();
+
+ textLine->insertText (0, pos, l->text()+col, l->attributes()+col);
+ l->truncate(col);
+
+ m_buffer->insertLine (line+1, textLine);
+ m_buffer->changeLine(line);
+
+ QPtrList<KTextEditor::Mark> list;
+ for( QIntDictIterator<KTextEditor::Mark> it( m_marks ); it.current(); ++it )
+ {
+ if( it.current()->line >= line )
+ {
+ if ((col == 0) || (it.current()->line > line))
+ list.append( it.current() );
+ }
+ }
+
+ for( QPtrListIterator<KTextEditor::Mark> it( list ); it.current(); ++it )
+ {
+ KTextEditor::Mark* mark = m_marks.take( it.current()->line );
+ mark->line++;
+ m_marks.insert( mark->line, mark );
+ }
+
+ if( !list.isEmpty() )
+ emit marksChanged();
+
+ // yes, we added a new line !
+ if (newLineAdded)
+ (*newLineAdded) = true;
+ }
+ else
+ {
+ nextLine->insertText (0, pos, l->text()+col, l->attributes()+col);
+ l->truncate(col);
+
+ m_buffer->changeLine(line);
+ m_buffer->changeLine(line+1);
+
+ // no, no new line added !
+ if (newLineAdded)
+ (*newLineAdded) = false;
+ }
+
+ for( QPtrListIterator<KateSuperCursor> it (m_superCursors); it.current(); ++it )
+ it.current()->editLineWrapped (line, col, !nextLine || newLine);
+
+ editEnd ();
+
+ return true;
+}
+
+bool KateDocument::editUnWrapLine ( uint line, bool removeLine, uint length )
+{
+ if (!isReadWrite())
+ return false;
+
+ KateTextLine::Ptr l = m_buffer->line(line);
+ KateTextLine::Ptr nextLine = m_buffer->line(line+1);
+
+ if (!l || !nextLine)
+ return false;
+
+ editStart ();
+
+ uint col = l->length ();
+
+ editAddUndo (KateUndoGroup::editUnWrapLine, line, col, length, removeLine ? "1" : "0");
+
+ if (removeLine)
+ {
+ l->insertText (col, nextLine->length(), nextLine->text(), nextLine->attributes());
+
+ m_buffer->changeLine(line);
+ m_buffer->removeLine(line+1);
+ }
+ else
+ {
+ l->insertText (col, (nextLine->length() < length) ? nextLine->length() : length,
+ nextLine->text(), nextLine->attributes());
+ nextLine->removeText (0, (nextLine->length() < length) ? nextLine->length() : length);
+
+ m_buffer->changeLine(line);
+ m_buffer->changeLine(line+1);
+ }
+
+ QPtrList<KTextEditor::Mark> list;
+ for( QIntDictIterator<KTextEditor::Mark> it( m_marks ); it.current(); ++it )
+ {
+ if( it.current()->line >= line+1 )
+ list.append( it.current() );
+
+ if ( it.current()->line == line+1 )
+ {
+ KTextEditor::Mark* mark = m_marks.take( line );
+
+ if (mark)
+ {
+ it.current()->type |= mark->type;
+ }
+ }
+ }
+
+ for( QPtrListIterator<KTextEditor::Mark> it( list ); it.current(); ++it )
+ {
+ KTextEditor::Mark* mark = m_marks.take( it.current()->line );
+ mark->line--;
+ m_marks.insert( mark->line, mark );
+ }
+
+ if( !list.isEmpty() )
+ emit marksChanged();
+
+ for( QPtrListIterator<KateSuperCursor> it (m_superCursors); it.current(); ++it )
+ it.current()->editLineUnWrapped (line, col, removeLine, length);
+
+ editEnd ();
+
+ return true;
+}
+
+bool KateDocument::editInsertLine ( uint line, const QString &s )
+{
+ if (!isReadWrite())
+ return false;
+
+ if ( line > numLines() )
+ return false;
+
+ editStart ();
+
+ editAddUndo (KateUndoGroup::editInsertLine, line, 0, s.length(), s);
+
+ removeTrailingSpace( line ); // old line
+
+ KateTextLine::Ptr tl = new KateTextLine();
+ tl->insertText (0, s.length(), s.unicode(), 0);
+ m_buffer->insertLine(line, tl);
+ m_buffer->changeLine(line);
+
+ removeTrailingSpace( line ); // new line
+
+ QPtrList<KTextEditor::Mark> list;
+ for( QIntDictIterator<KTextEditor::Mark> it( m_marks ); it.current(); ++it )
+ {
+ if( it.current()->line >= line )
+ list.append( it.current() );
+ }
+
+ for( QPtrListIterator<KTextEditor::Mark> it( list ); it.current(); ++it )
+ {
+ KTextEditor::Mark* mark = m_marks.take( it.current()->line );
+ mark->line++;
+ m_marks.insert( mark->line, mark );
+ }
+
+ if( !list.isEmpty() )
+ emit marksChanged();
+
+ for( QPtrListIterator<KateSuperCursor> it (m_superCursors); it.current(); ++it )
+ it.current()->editLineInserted (line);
+
+ editEnd ();
+
+ return true;
+}
+
+bool KateDocument::editRemoveLine ( uint line )
+{
+ if (!isReadWrite())
+ return false;
+
+ if ( line > lastLine() )
+ return false;
+
+ if ( numLines() == 1 )
+ return editRemoveText (0, 0, m_buffer->line(0)->length());
+
+ editStart ();
+
+ editAddUndo (KateUndoGroup::editRemoveLine, line, 0, lineLength(line), textLine(line));
+
+ m_buffer->removeLine(line);
+
+ QPtrList<KTextEditor::Mark> list;
+ KTextEditor::Mark* rmark = 0;
+ for( QIntDictIterator<KTextEditor::Mark> it( m_marks ); it.current(); ++it )
+ {
+ if ( (it.current()->line > line) )
+ list.append( it.current() );
+ else if ( (it.current()->line == line) )
+ rmark = it.current();
+ }
+
+ if (rmark)
+ delete (m_marks.take (rmark->line));
+
+ for( QPtrListIterator<KTextEditor::Mark> it( list ); it.current(); ++it )
+ {
+ KTextEditor::Mark* mark = m_marks.take( it.current()->line );
+ mark->line--;
+ m_marks.insert( mark->line, mark );
+ }
+
+ if( !list.isEmpty() )
+ emit marksChanged();
+
+ for( QPtrListIterator<KateSuperCursor> it (m_superCursors); it.current(); ++it )
+ it.current()->editLineRemoved (line);
+
+ editEnd();
+
+ return true;
+}
+//END
+
+//BEGIN KTextEditor::UndoInterface stuff
+
+uint KateDocument::undoCount () const
+{
+ return undoItems.count ();
+}
+
+uint KateDocument::redoCount () const
+{
+ return redoItems.count ();
+}
+
+uint KateDocument::undoSteps () const
+{
+ return m_config->undoSteps();
+}
+
+void KateDocument::setUndoSteps(uint steps)
+{
+ m_config->setUndoSteps (steps);
+}
+
+void KateDocument::undo()
+{
+ m_isInUndo = true;
+ if ((undoItems.count() > 0) && undoItems.last())
+ {
+ clearSelection ();
+
+ undoItems.last()->undo();
+ redoItems.append (undoItems.last());
+ undoItems.removeLast ();
+ updateModified();
+
+ emit undoChanged ();
+ }
+ m_isInUndo = false;
+}
+
+void KateDocument::redo()
+{
+ m_isInUndo = true;
+ if ((redoItems.count() > 0) && redoItems.last())
+ {
+ clearSelection ();
+
+ redoItems.last()->redo();
+ undoItems.append (redoItems.last());
+ redoItems.removeLast ();
+ updateModified();
+
+ emit undoChanged ();
+ }
+ m_isInUndo = false;
+}
+
+void KateDocument::updateModified()
+{
+ /*
+ How this works:
+
+ After noticing that there where to many scenarios to take into
+ consideration when using 'if's to toggle the "Modified" flag
+ I came up with this baby, flexible and repetitive calls are
+ minimal.
+
+ A numeric unique pattern is generated by toggleing a set of bits,
+ each bit symbolizes a different state in the Undo Redo structure.
+
+ undoItems.isEmpty() != null BIT 1
+ redoItems.isEmpty() != null BIT 2
+ docWasSavedWhenUndoWasEmpty == true BIT 3
+ docWasSavedWhenRedoWasEmpty == true BIT 4
+ lastUndoGroupWhenSavedIsLastUndo BIT 5
+ lastUndoGroupWhenSavedIsLastRedo BIT 6
+ lastRedoGroupWhenSavedIsLastUndo BIT 7
+ lastRedoGroupWhenSavedIsLastRedo BIT 8
+
+ If you find a new pattern, please add it to the patterns array
+ */
+
+ unsigned char currentPattern = 0;
+ const unsigned char patterns[] = {5,16,24,26,88,90,93,133,144,149,165};
+ const unsigned char patternCount = sizeof(patterns);
+ KateUndoGroup* undoLast = 0;
+ KateUndoGroup* redoLast = 0;
+
+ if (undoItems.isEmpty())
+ {
+ currentPattern |= 1;
+ }
+ else
+ {
+ undoLast = undoItems.last();
+ }
+
+ if (redoItems.isEmpty())
+ {
+ currentPattern |= 2;
+ }
+ else
+ {
+ redoLast = redoItems.last();
+ }
+
+ if (docWasSavedWhenUndoWasEmpty) currentPattern |= 4;
+ if (docWasSavedWhenRedoWasEmpty) currentPattern |= 8;
+ if (lastUndoGroupWhenSaved == undoLast) currentPattern |= 16;
+ if (lastUndoGroupWhenSaved == redoLast) currentPattern |= 32;
+ if (lastRedoGroupWhenSaved == undoLast) currentPattern |= 64;
+ if (lastRedoGroupWhenSaved == redoLast) currentPattern |= 128;
+
+ // This will print out the pattern information
+
+ kdDebug(13020) << k_funcinfo
+ << "Pattern:" << static_cast<unsigned int>(currentPattern) << endl;
+
+ for (uint patternIndex = 0; patternIndex < patternCount; ++patternIndex)
+ {
+ if ( currentPattern == patterns[patternIndex] )
+ {
+ setModified( false );
+ kdDebug(13020) << k_funcinfo << "setting modified to false!" << endl;
+ break;
+ }
+ }
+}
+
+void KateDocument::clearUndo()
+{
+ undoItems.setAutoDelete (true);
+ undoItems.clear ();
+ undoItems.setAutoDelete (false);
+
+ lastUndoGroupWhenSaved = 0;
+ docWasSavedWhenUndoWasEmpty = false;
+
+ emit undoChanged ();
+}
+
+void KateDocument::clearRedo()
+{
+ redoItems.setAutoDelete (true);
+ redoItems.clear ();
+ redoItems.setAutoDelete (false);
+
+ lastRedoGroupWhenSaved = 0;
+ docWasSavedWhenRedoWasEmpty = false;
+
+ emit undoChanged ();
+}
+
+QPtrList<KTextEditor::Cursor> KateDocument::cursors () const
+{
+ return myCursors;
+}
+//END
+
+//BEGIN KTextEditor::SearchInterface stuff
+
+bool KateDocument::searchText (unsigned int startLine, unsigned int startCol, const QString &text, unsigned int *foundAtLine, unsigned int *foundAtCol, unsigned int *matchLen, bool casesensitive, bool backwards)
+{
+ if (text.isEmpty())
+ return false;
+
+ int line = startLine;
+ int col = startCol;
+
+ if (!backwards)
+ {
+ int searchEnd = lastLine();
+
+ while (line <= searchEnd)
+ {
+ KateTextLine::Ptr textLine = m_buffer->plainLine(line);
+
+ if (!textLine)
+ return false;
+
+ uint foundAt, myMatchLen;
+ bool found = textLine->searchText (col, text, &foundAt, &myMatchLen, casesensitive, false);
+
+ if (found)
+ {
+ (*foundAtLine) = line;
+ (*foundAtCol) = foundAt;
+ (*matchLen) = myMatchLen;
+ return true;
+ }
+
+ col = 0;
+ line++;
+ }
+ }
+ else
+ {
+ // backward search
+ int searchEnd = 0;
+
+ while (line >= searchEnd)
+ {
+ KateTextLine::Ptr textLine = m_buffer->plainLine(line);
+
+ if (!textLine)
+ return false;
+
+ uint foundAt, myMatchLen;
+ bool found = textLine->searchText (col, text, &foundAt, &myMatchLen, casesensitive, true);
+
+ if (found)
+ {
+ /* if ((uint) line == startLine && foundAt + myMatchLen >= (uint) col
+ && line == selectStart.line() && foundAt == (uint) selectStart.col()
+ && line == selectEnd.line() && foundAt + myMatchLen == (uint) selectEnd.col())
+ {
+ // To avoid getting stuck at one match we skip a match if it is already
+ // selected (most likely because it has just been found).
+ if (foundAt > 0)
+ col = foundAt - 1;
+ else {
+ if (--line >= 0)
+ col = lineLength(line);
+ }
+ continue;
+ }*/
+
+ (*foundAtLine) = line;
+ (*foundAtCol) = foundAt;
+ (*matchLen) = myMatchLen;
+ return true;
+ }
+
+ if (line >= 1)
+ col = lineLength(line-1);
+
+ line--;
+ }
+ }
+
+ return false;
+}
+
+bool KateDocument::searchText (unsigned int startLine, unsigned int startCol, const QRegExp &regexp, unsigned int *foundAtLine, unsigned int *foundAtCol, unsigned int *matchLen, bool backwards)
+{
+ kdDebug(13020)<<"KateDocument::searchText( "<<startLine<<", "<<startCol<<", "<<regexp.pattern()<<", "<<backwards<<" )"<<endl;
+ if (regexp.isEmpty() || !regexp.isValid())
+ return false;
+
+ int line = startLine;
+ int col = startCol;
+
+ if (!backwards)
+ {
+ int searchEnd = lastLine();
+
+ while (line <= searchEnd)
+ {
+ KateTextLine::Ptr textLine = m_buffer->plainLine(line);
+
+ if (!textLine)
+ return false;
+
+ uint foundAt, myMatchLen;
+ bool found = textLine->searchText (col, regexp, &foundAt, &myMatchLen, false);
+
+ if (found)
+ {
+ // A special case which can only occur when searching with a regular expression consisting
+ // only of a lookahead (e.g. ^(?=\{) for a function beginning without selecting '{').
+ if (myMatchLen == 0 && (uint) line == startLine && foundAt == (uint) col)
+ {
+ if (col < lineLength(line))
+ col++;
+ else {
+ line++;
+ col = 0;
+ }
+ continue;
+ }
+
+ (*foundAtLine) = line;
+ (*foundAtCol) = foundAt;
+ (*matchLen) = myMatchLen;
+ return true;
+ }
+
+ col = 0;
+ line++;
+ }
+ }
+ else
+ {
+ // backward search
+ int searchEnd = 0;
+
+ while (line >= searchEnd)
+ {
+ KateTextLine::Ptr textLine = m_buffer->plainLine(line);
+
+ if (!textLine)
+ return false;
+
+ uint foundAt, myMatchLen;
+ bool found = textLine->searchText (col, regexp, &foundAt, &myMatchLen, true);
+
+ if (found)
+ {
+ /*if ((uint) line == startLine && foundAt + myMatchLen >= (uint) col
+ && line == selectStart.line() && foundAt == (uint) selectStart.col()
+ && line == selectEnd.line() && foundAt + myMatchLen == (uint) selectEnd.col())
+ {
+ // To avoid getting stuck at one match we skip a match if it is already
+ // selected (most likely because it has just been found).
+ if (foundAt > 0)
+ col = foundAt - 1;
+ else {
+ if (--line >= 0)
+ col = lineLength(line);
+ }
+ continue;
+ }*/
+
+ (*foundAtLine) = line;
+ (*foundAtCol) = foundAt;
+ (*matchLen) = myMatchLen;
+ return true;
+ }
+
+ if (line >= 1)
+ col = lineLength(line-1);
+
+ line--;
+ }
+ }
+
+ return false;
+}
+//END
+
+//BEGIN KTextEditor::HighlightingInterface stuff
+
+uint KateDocument::hlMode ()
+{
+ return KateHlManager::self()->findHl(highlight());
+}
+
+bool KateDocument::setHlMode (uint mode)
+{
+ m_buffer->setHighlight (mode);
+
+ if (true)
+ {
+ setDontChangeHlOnSave();
+ return true;
+ }
+
+ return false;
+}
+
+void KateDocument::bufferHlChanged ()
+{
+ // update all views
+ makeAttribs(false);
+
+ emit hlChanged();
+}
+
+uint KateDocument::hlModeCount ()
+{
+ return KateHlManager::self()->highlights();
+}
+
+QString KateDocument::hlModeName (uint mode)
+{
+ return KateHlManager::self()->hlName (mode);
+}
+
+QString KateDocument::hlModeSectionName (uint mode)
+{
+ return KateHlManager::self()->hlSection (mode);
+}
+
+void KateDocument::setDontChangeHlOnSave()
+{
+ hlSetByUser = true;
+}
+//END
+
+//BEGIN KTextEditor::ConfigInterface stuff
+void KateDocument::readConfig(KConfig *config)
+{
+ config->setGroup("Kate Document Defaults");
+
+ // read max loadable blocks, more blocks will be swapped out
+ KateBuffer::setMaxLoadedBlocks (config->readNumEntry("Maximal Loaded Blocks", KateBuffer::maxLoadedBlocks()));
+
+ KateDocumentConfig::global()->readConfig (config);
+
+ config->setGroup("Kate View Defaults");
+ KateViewConfig::global()->readConfig (config);
+
+ config->setGroup("Kate Renderer Defaults");
+ KateRendererConfig::global()->readConfig (config);
+}
+
+void KateDocument::writeConfig(KConfig *config)
+{
+ config->setGroup("Kate Document Defaults");
+
+ // write max loadable blocks, more blocks will be swapped out
+ config->writeEntry("Maximal Loaded Blocks", KateBuffer::maxLoadedBlocks());
+
+ KateDocumentConfig::global()->writeConfig (config);
+
+ config->setGroup("Kate View Defaults");
+ KateViewConfig::global()->writeConfig (config);
+
+ config->setGroup("Kate Renderer Defaults");
+ KateRendererConfig::global()->writeConfig (config);
+}
+
+void KateDocument::readConfig()
+{
+ KConfig *config = kapp->config();
+ readConfig (config);
+}
+
+void KateDocument::writeConfig()
+{
+ KConfig *config = kapp->config();
+ writeConfig (config);
+ config->sync();
+}
+
+void KateDocument::readSessionConfig(KConfig *kconfig)
+{
+ // restore the url
+ KURL url (kconfig->readEntry("URL"));
+
+ // get the encoding
+ QString tmpenc=kconfig->readEntry("Encoding");
+ if (!tmpenc.isEmpty() && (tmpenc != encoding()))
+ setEncoding(tmpenc);
+
+ // open the file if url valid
+ if (!url.isEmpty() && url.isValid())
+ openURL (url);
+
+ // restore the hl stuff
+ m_buffer->setHighlight(KateHlManager::self()->nameFind(kconfig->readEntry("Highlighting")));
+
+ if (hlMode() > 0)
+ hlSetByUser = true;
+
+ // indent mode
+ config()->setIndentationMode( (uint)kconfig->readNumEntry("Indentation Mode", config()->indentationMode() ) );
+
+ // Restore Bookmarks
+ QValueList<int> marks = kconfig->readIntListEntry("Bookmarks");
+ for( uint i = 0; i < marks.count(); i++ )
+ addMark( marks[i], KateDocument::markType01 );
+}
+
+void KateDocument::writeSessionConfig(KConfig *kconfig)
+{
+ if ( m_url.isLocalFile() && !KGlobal::dirs()->relativeLocation("tmp", m_url.path()).startsWith("/"))
+ return;
+ // save url
+ kconfig->writeEntry("URL", m_url.prettyURL() );
+
+ // save encoding
+ kconfig->writeEntry("Encoding",encoding());
+
+ // save hl
+ kconfig->writeEntry("Highlighting", highlight()->name());
+
+ kconfig->writeEntry("Indentation Mode", config()->indentationMode() );
+
+ // Save Bookmarks
+ QValueList<int> marks;
+ for( QIntDictIterator<KTextEditor::Mark> it( m_marks );
+ it.current() && it.current()->type & KTextEditor::MarkInterface::markType01;
+ ++it )
+ marks << it.current()->line;
+
+ kconfig->writeEntry( "Bookmarks", marks );
+}
+
+void KateDocument::configDialog()
+{
+ KDialogBase *kd = new KDialogBase ( KDialogBase::IconList,
+ i18n("Configure"),
+ KDialogBase::Ok | KDialogBase::Cancel | KDialogBase::Help,
+ KDialogBase::Ok,
+ kapp->mainWidget() );
+
+#ifndef Q_WS_WIN //TODO: reenable
+ KWin::setIcons( kd->winId(), kapp->icon(), kapp->miniIcon() );
+#endif
+
+ QPtrList<KTextEditor::ConfigPage> editorPages;
+
+ for (uint i = 0; i < KTextEditor::configInterfaceExtension (this)->configPages (); i++)
+ {
+ QStringList path;
+ path.clear();
+ path << KTextEditor::configInterfaceExtension (this)->configPageName (i);
+ QVBox *page = kd->addVBoxPage(path, KTextEditor::configInterfaceExtension (this)->configPageFullName (i),
+ KTextEditor::configInterfaceExtension (this)->configPagePixmap(i, KIcon::SizeMedium) );
+
+ editorPages.append (KTextEditor::configInterfaceExtension (this)->configPage(i, page));
+ }
+
+ if (kd->exec())
+ {
+ KateDocumentConfig::global()->configStart ();
+ KateViewConfig::global()->configStart ();
+ KateRendererConfig::global()->configStart ();
+
+ for (uint i=0; i<editorPages.count(); i++)
+ {
+ editorPages.at(i)->apply();
+ }
+
+ KateDocumentConfig::global()->configEnd ();
+ KateViewConfig::global()->configEnd ();
+ KateRendererConfig::global()->configEnd ();
+
+ writeConfig ();
+ }
+
+ delete kd;
+}
+
+uint KateDocument::mark( uint line )
+{
+ if( !m_marks[line] )
+ return 0;
+ return m_marks[line]->type;
+}
+
+void KateDocument::setMark( uint line, uint markType )
+{
+ clearMark( line );
+ addMark( line, markType );
+}
+
+void KateDocument::clearMark( uint line )
+{
+ if( line > lastLine() )
+ return;
+
+ if( !m_marks[line] )
+ return;
+
+ KTextEditor::Mark* mark = m_marks.take( line );
+ emit markChanged( *mark, MarkRemoved );
+ emit marksChanged();
+ delete mark;
+ tagLines( line, line );
+ repaintViews(true);
+}
+
+void KateDocument::addMark( uint line, uint markType )
+{
+ if( line > lastLine())
+ return;
+
+ if( markType == 0 )
+ return;
+
+ if( m_marks[line] ) {
+ KTextEditor::Mark* mark = m_marks[line];
+
+ // Remove bits already set
+ markType &= ~mark->type;
+
+ if( markType == 0 )
+ return;
+
+ // Add bits
+ mark->type |= markType;
+ } else {
+ KTextEditor::Mark *mark = new KTextEditor::Mark;
+ mark->line = line;
+ mark->type = markType;
+ m_marks.insert( line, mark );
+ }
+
+ // Emit with a mark having only the types added.
+ KTextEditor::Mark temp;
+ temp.line = line;
+ temp.type = markType;
+ emit markChanged( temp, MarkAdded );
+
+ emit marksChanged();
+ tagLines( line, line );
+ repaintViews(true);
+}
+
+void KateDocument::removeMark( uint line, uint markType )
+{
+ if( line > lastLine() )
+ return;
+ if( !m_marks[line] )
+ return;
+
+ KTextEditor::Mark* mark = m_marks[line];
+
+ // Remove bits not set
+ markType &= mark->type;
+
+ if( markType == 0 )
+ return;
+
+ // Subtract bits
+ mark->type &= ~markType;
+
+ // Emit with a mark having only the types removed.
+ KTextEditor::Mark temp;
+ temp.line = line;
+ temp.type = markType;
+ emit markChanged( temp, MarkRemoved );
+
+ if( mark->type == 0 )
+ m_marks.remove( line );
+
+ emit marksChanged();
+ tagLines( line, line );
+ repaintViews(true);
+}
+
+QPtrList<KTextEditor::Mark> KateDocument::marks()
+{
+ QPtrList<KTextEditor::Mark> list;
+
+ for( QIntDictIterator<KTextEditor::Mark> it( m_marks );
+ it.current(); ++it ) {
+ list.append( it.current() );
+ }
+
+ return list;
+}
+
+void KateDocument::clearMarks()
+{
+ for( QIntDictIterator<KTextEditor::Mark> it( m_marks );
+ it.current(); ++it ) {
+ KTextEditor::Mark* mark = it.current();
+ emit markChanged( *mark, MarkRemoved );
+ tagLines( mark->line, mark->line );
+ }
+
+ m_marks.clear();
+
+ emit marksChanged();
+ repaintViews(true);
+}
+
+void KateDocument::setPixmap( MarkInterface::MarkTypes type, const QPixmap& pixmap )
+{
+ m_markPixmaps.replace( type, new QPixmap( pixmap ) );
+}
+
+void KateDocument::setDescription( MarkInterface::MarkTypes type, const QString& description )
+{
+ m_markDescriptions.replace( type, new QString( description ) );
+}
+
+QPixmap *KateDocument::markPixmap( MarkInterface::MarkTypes type )
+{
+ return m_markPixmaps[type];
+}
+
+QColor KateDocument::markColor( MarkInterface::MarkTypes type )
+{
+ uint reserved = (0x1 << KTextEditor::MarkInterface::reservedMarkersCount()) - 1;
+ if ((uint)type >= (uint)markType01 && (uint)type <= reserved) {
+ return KateRendererConfig::global()->lineMarkerColor(type);
+ } else {
+ return QColor();
+ }
+}
+
+QString KateDocument::markDescription( MarkInterface::MarkTypes type )
+{
+ if( m_markDescriptions[type] )
+ return *m_markDescriptions[type];
+ return QString::null;
+}
+
+void KateDocument::setMarksUserChangable( uint markMask )
+{
+ m_editableMarks = markMask;
+}
+
+uint KateDocument::editableMarks()
+{
+ return m_editableMarks;
+}
+//END
+
+//BEGIN KTextEditor::PrintInterface stuff
+bool KateDocument::printDialog ()
+{
+ return KatePrinter::print (this);
+}
+
+bool KateDocument::print ()
+{
+ return KatePrinter::print (this);
+}
+//END
+
+//BEGIN KTextEditor::DocumentInfoInterface (### unfinished)
+QString KateDocument::mimeType()
+{
+ KMimeType::Ptr result = KMimeType::defaultMimeTypePtr();
+
+ // if the document has a URL, try KMimeType::findByURL
+ if ( ! m_url.isEmpty() )
+ result = KMimeType::findByURL( m_url );
+
+ else if ( m_url.isEmpty() || ! m_url.isLocalFile() )
+ result = mimeTypeForContent();
+
+ return result->name();
+}
+
+// TODO implement this -- how to calculate?
+long KateDocument::fileSize()
+{
+ return 0;
+}
+
+// TODO implement this
+QString KateDocument::niceFileSize()
+{
+ return "UNKNOWN";
+}
+
+KMimeType::Ptr KateDocument::mimeTypeForContent()
+{
+ QByteArray buf (1024);
+ uint bufpos = 0;
+
+ for (uint i=0; i < numLines(); i++)
+ {
+ QString line = textLine( i );
+ uint len = line.length() + 1;
+
+ if (bufpos + len > 1024)
+ len = 1024 - bufpos;
+
+ memcpy(&buf[bufpos], (line + "\n").latin1(), len);
+
+ bufpos += len;
+
+ if (bufpos >= 1024)
+ break;
+ }
+ buf.resize( bufpos );
+
+ int accuracy = 0;
+ return KMimeType::findByContent( buf, &accuracy );
+}
+//END KTextEditor::DocumentInfoInterface
+
+
+//BEGIN KParts::ReadWrite stuff
+
+bool KateDocument::openURL( const KURL &url )
+{
+// kdDebug(13020)<<"KateDocument::openURL( "<<url.prettyURL()<<")"<<endl;
+ // no valid URL
+ if ( !url.isValid() )
+ return false;
+
+ // could not close old one
+ if ( !closeURL() )
+ return false;
+
+ // set my url
+ m_url = url;
+
+ if ( m_url.isLocalFile() )
+ {
+ // local mode, just like in kpart
+
+ m_file = m_url.path();
+
+ emit started( 0 );
+
+ if (openFile())
+ {
+ emit completed();
+ emit setWindowCaption( m_url.prettyURL() );
+
+ return true;
+ }
+
+ return false;
+ }
+ else
+ {
+ // remote mode
+
+ m_bTemp = true;
+
+ m_tempFile = new KTempFile ();
+ m_file = m_tempFile->name();
+
+ m_job = KIO::get ( url, false, isProgressInfoEnabled() );
+
+ // connect to slots
+ connect( m_job, SIGNAL( data( KIO::Job*, const QByteArray& ) ),
+ SLOT( slotDataKate( KIO::Job*, const QByteArray& ) ) );
+
+ connect( m_job, SIGNAL( result( KIO::Job* ) ),
+ SLOT( slotFinishedKate( KIO::Job* ) ) );
+
+ QWidget *w = widget ();
+ if (!w && !m_views.isEmpty ())
+ w = m_views.first();
+
+ if (w)
+ m_job->setWindow (w->topLevelWidget());
+
+ emit started( m_job );
+
+ return true;
+ }
+}
+
+void KateDocument::slotDataKate ( KIO::Job *, const QByteArray &data )
+{
+// kdDebug(13020) << "KateDocument::slotData" << endl;
+
+ if (!m_tempFile || !m_tempFile->file())
+ return;
+
+ m_tempFile->file()->writeBlock (data);
+}
+
+void KateDocument::slotFinishedKate ( KIO::Job * job )
+{
+// kdDebug(13020) << "KateDocument::slotJobFinished" << endl;
+
+ if (!m_tempFile)
+ return;
+
+ delete m_tempFile;
+ m_tempFile = 0;
+ m_job = 0;
+
+ if (job->error())
+ emit canceled( job->errorString() );
+ else
+ {
+ if ( openFile(job) )
+ emit setWindowCaption( m_url.prettyURL() );
+ emit completed();
+ }
+}
+
+void KateDocument::abortLoadKate()
+{
+ if ( m_job )
+ {
+ kdDebug(13020) << "Aborting job " << m_job << endl;
+ m_job->kill();
+ m_job = 0;
+ }
+
+ delete m_tempFile;
+ m_tempFile = 0;
+}
+
+bool KateDocument::openFile()
+{
+ return openFile (0);
+}
+
+bool KateDocument::openFile(KIO::Job * job)
+{
+ m_loading = true;
+ // add new m_file to dirwatch
+ activateDirWatch ();
+
+ //
+ // use metadata
+ //
+ if (job)
+ {
+ QString metaDataCharset = job->queryMetaData("charset");
+
+ // only overwrite config if nothing set
+ if (!metaDataCharset.isEmpty () && (!m_config->isSetEncoding() || m_config->encoding().isEmpty()))
+ setEncoding (metaDataCharset);
+ }
+
+ //
+ // service type magic to get encoding right
+ //
+ QString serviceType = m_extension->urlArgs().serviceType.simplifyWhiteSpace();
+ int pos = serviceType.find(';');
+ if (pos != -1)
+ setEncoding (serviceType.mid(pos+1));
+
+ // if the encoding is set here - on the command line/from the dialog/from KIO
+ // we prevent file type and document variables from changing it
+ bool encodingSticky = m_encodingSticky;
+ m_encodingSticky = m_config->isSetEncoding();
+
+ // Try getting the filetype here, so that variables does not have to be reset.
+ int fileTypeFound = KateFactory::self()->fileTypeManager()->fileType (this);
+ if ( fileTypeFound > -1 )
+ updateFileType( fileTypeFound );
+
+ // do we have success ?
+ bool success = m_buffer->openFile (m_file);
+ //
+ // yeah, success
+ //
+ m_loading = false; // done reading file.
+ if (success)
+ {
+ /*if (highlight() && !m_url.isLocalFile()) {
+ // The buffer's highlighting gets nuked by KateBuffer::clear()
+ m_buffer->setHighlight(m_highlight);
+ }*/
+
+ // update our hl type if needed
+ if (!hlSetByUser)
+ {
+ int hl (KateHlManager::self()->detectHighlighting (this));
+
+ if (hl >= 0)
+ m_buffer->setHighlight(hl);
+ }
+
+ // update file type if we haven't allready done so.
+ if ( fileTypeFound < 0 )
+ updateFileType (KateFactory::self()->fileTypeManager()->fileType (this));
+
+ // read dir config (if possible and wanted)
+ readDirConfig ();
+
+ // read vars
+ readVariables();
+
+ // update the md5 digest
+ createDigest( m_digest );
+ }
+
+ //
+ // update views
+ //
+ for (KateView * view = m_views.first(); view != 0L; view = m_views.next() )
+ {
+ view->updateView(true);
+ }
+
+ //
+ // emit the signal we need for example for kate app
+ //
+ emit fileNameChanged ();
+
+ //
+ // set doc name, dummy value as arg, don't need it
+ //
+ setDocName (QString::null);
+
+ //
+ // to houston, we are not modified
+ //
+ if (m_modOnHd)
+ {
+ m_modOnHd = false;
+ m_modOnHdReason = 0;
+ emit modifiedOnDisc (this, m_modOnHd, 0);
+ }
+
+ //
+ // display errors
+ //
+ if (s_openErrorDialogsActivated)
+ {
+ if (!success && m_buffer->loadingBorked())
+ KMessageBox::error (widget(), i18n ("The file %1 could not be loaded completely, as there is not enough temporary disk storage for it.").arg(m_url.url()));
+ else if (!success)
+ KMessageBox::error (widget(), i18n ("The file %1 could not be loaded, as it was not possible to read from it.\n\nCheck if you have read access to this file.").arg(m_url.url()));
+ }
+
+ // warn -> opened binary file!!!!!!!
+ if (m_buffer->binary())
+ {
+ // this file can't be saved again without killing it
+ setReadWrite( false );
+
+ KMessageBox::information (widget()
+ , i18n ("The file %1 is a binary, saving it will result in a corrupt file.").arg(m_url.url())
+ , i18n ("Binary File Opened")
+ , "Binary File Opened Warning");
+ }
+
+ m_encodingSticky = encodingSticky;
+
+ //
+ // return the success
+ //
+ return success;
+}
+
+bool KateDocument::save()
+{
+ bool l ( url().isLocalFile() );
+
+ if ( ( l && config()->backupFlags() & KateDocumentConfig::LocalFiles )
+ || ( ! l && config()->backupFlags() & KateDocumentConfig::RemoteFiles ) )
+ {
+ KURL u( url() );
+ u.setFileName( config()->backupPrefix() + url().fileName() + config()->backupSuffix() );
+
+ kdDebug () << "backup src file name: " << url() << endl;
+ kdDebug () << "backup dst file name: " << u << endl;
+
+ // get the right permissions, start with safe default
+ mode_t perms = 0600;
+ KIO::UDSEntry fentry;
+ if (KIO::NetAccess::stat (url(), fentry, kapp->mainWidget()))
+ {
+ kdDebug () << "stating succesfull: " << url() << endl;
+ KFileItem item (fentry, url());
+ perms = item.permissions();
+ }
+
+ // first del existing file if any, than copy over the file we have
+ // failure if a: the existing file could not be deleted, b: the file could not be copied
+ if ( (!KIO::NetAccess::exists( u, false, kapp->mainWidget() ) || KIO::NetAccess::del( u, kapp->mainWidget() ))
+ && KIO::NetAccess::file_copy( url(), u, perms, true, false, kapp->mainWidget() ) )
+ {
+ kdDebug(13020)<<"backing up successfull ("<<url().prettyURL()<<" -> "<<u.prettyURL()<<")"<<endl;
+ }
+ else
+ {
+ kdDebug(13020)<<"backing up failed ("<<url().prettyURL()<<" -> "<<u.prettyURL()<<")"<<endl;
+ // FIXME: notify user for real ;)
+ }
+ }
+
+ return KParts::ReadWritePart::save();
+}
+
+bool KateDocument::saveFile()
+{
+ //
+ // we really want to save this file ?
+ //
+ if (m_buffer->loadingBorked() && (KMessageBox::warningContinueCancel(widget(),
+ i18n("This file could not be loaded correctly due to lack of temporary disk space. Saving it could cause data loss.\n\nDo you really want to save it?"),i18n("Possible Data Loss"),i18n("Save Nevertheless")) != KMessageBox::Continue))
+ return false;
+
+ //
+ // warn -> try to save binary file!!!!!!!
+ //
+ if (m_buffer->binary() && (KMessageBox::warningContinueCancel (widget()
+ , i18n ("The file %1 is a binary, saving it will result in a corrupt file.").arg(m_url.url())
+ , i18n ("Trying to Save Binary File")
+ , i18n("Save Nevertheless"), "Binary File Save Warning") != KMessageBox::Continue))
+ return false;
+
+ if ( !url().isEmpty() )
+ {
+ if (s_fileChangedDialogsActivated && m_modOnHd)
+ {
+ QString str = reasonedMOHString() + "\n\n";
+
+ if (!isModified())
+ {
+ if (KMessageBox::warningContinueCancel(0,
+ str + i18n("Do you really want to save this unmodified file? You could overwrite changed data in the file on disk."),i18n("Trying to Save Unmodified File"),i18n("Save Nevertheless")) != KMessageBox::Continue)
+ return false;
+ }
+ else
+ {
+ if (KMessageBox::warningContinueCancel(0,
+ str + i18n("Do you really want to save this file? Both your open file and the file on disk were changed. There could be some data lost."),i18n("Possible Data Loss"),i18n("Save Nevertheless")) != KMessageBox::Continue)
+ return false;
+ }
+ }
+ }
+
+ //
+ // can we encode it if we want to save it ?
+ //
+ if (!m_buffer->canEncode ()
+ && (KMessageBox::warningContinueCancel(0,
+ i18n("The selected encoding cannot encode every unicode character in this document. Do you really want to save it? There could be some data lost."),i18n("Possible Data Loss"),i18n("Save Nevertheless")) != KMessageBox::Continue))
+ {
+ return false;
+ }
+
+ // remove file from dirwatch
+ deactivateDirWatch ();
+
+ //
+ // try to save
+ //
+ bool success = m_buffer->saveFile (m_file);
+
+ // update the md5 digest
+ createDigest( m_digest );
+
+ // add m_file again to dirwatch
+ activateDirWatch ();
+
+ //
+ // hurray, we had success, do stuff we need
+ //
+ if (success)
+ {
+ // update our hl type if needed
+ if (!hlSetByUser)
+ {
+ int hl (KateHlManager::self()->detectHighlighting (this));
+
+ if (hl >= 0)
+ m_buffer->setHighlight(hl);
+ }
+
+ // read our vars
+ readVariables();
+ }
+
+ //
+ // we are not modified
+ //
+ if (success && m_modOnHd)
+ {
+ m_modOnHd = false;
+ m_modOnHdReason = 0;
+ emit modifiedOnDisc (this, m_modOnHd, 0);
+ }
+
+ //
+ // display errors
+ //
+ if (!success)
+ KMessageBox::error (widget(), i18n ("The document could not be saved, as it was not possible to write to %1.\n\nCheck that you have write access to this file or that enough disk space is available.").arg(m_url.url()));
+
+ //
+ // return success
+ //
+ return success;
+}
+
+bool KateDocument::saveAs( const KURL &u )
+{
+ QString oldDir = url().directory();
+
+ if ( KParts::ReadWritePart::saveAs( u ) )
+ {
+ // null means base on filename
+ setDocName( QString::null );
+
+ if ( u.directory() != oldDir )
+ readDirConfig();
+
+ emit fileNameChanged();
+ emit nameChanged((Kate::Document *) this);
+
+ return true;
+ }
+
+ return false;
+}
+
+void KateDocument::readDirConfig ()
+{
+ int depth = config()->searchDirConfigDepth ();
+
+ if (m_url.isLocalFile() && (depth > -1))
+ {
+ QString currentDir = QFileInfo (m_file).dirPath();
+
+ // only search as deep as specified or not at all ;)
+ while (depth > -1)
+ {
+ kdDebug (13020) << "search for config file in path: " << currentDir << endl;
+
+ // try to open config file in this dir
+ QFile f (currentDir + "/.kateconfig");
+
+ if (f.open (IO_ReadOnly))
+ {
+ QTextStream stream (&f);
+
+ uint linesRead = 0;
+ QString line = stream.readLine();
+ while ((linesRead < 32) && !line.isNull())
+ {
+ readVariableLine( line );
+
+ line = stream.readLine();
+
+ linesRead++;
+ }
+
+ break;
+ }
+
+ QString newDir = QFileInfo (currentDir).dirPath();
+
+ // bail out on looping (for example reached /)
+ if (currentDir == newDir)
+ break;
+
+ currentDir = newDir;
+ --depth;
+ }
+ }
+}
+
+void KateDocument::activateDirWatch ()
+{
+ // same file as we are monitoring, return
+ if (m_file == m_dirWatchFile)
+ return;
+
+ // remove the old watched file
+ deactivateDirWatch ();
+
+ // add new file if needed
+ if (m_url.isLocalFile() && !m_file.isEmpty())
+ {
+ KateFactory::self()->dirWatch ()->addFile (m_file);
+ m_dirWatchFile = m_file;
+ }
+}
+
+void KateDocument::deactivateDirWatch ()
+{
+ if (!m_dirWatchFile.isEmpty())
+ KateFactory::self()->dirWatch ()->removeFile (m_dirWatchFile);
+
+ m_dirWatchFile = QString::null;
+}
+
+bool KateDocument::closeURL()
+{
+ abortLoadKate();
+
+ //
+ // file mod on hd
+ //
+ if ( !m_reloading && !url().isEmpty() )
+ {
+ if (s_fileChangedDialogsActivated && m_modOnHd)
+ {
+ if (!(KMessageBox::warningContinueCancel(
+ widget(),
+ reasonedMOHString() + "\n\n" + i18n("Do you really want to continue to close this file? Data loss may occur."),
+ i18n("Possible Data Loss"), i18n("Close Nevertheless"),
+ QString("kate_close_modonhd_%1").arg( m_modOnHdReason ) ) == KMessageBox::Continue))
+ return false;
+ }
+ }
+
+ //
+ // first call the normal kparts implementation
+ //
+ if (!KParts::ReadWritePart::closeURL ())
+ return false;
+
+ // remove file from dirwatch
+ deactivateDirWatch ();
+
+ //
+ // empty url + filename
+ //
+ m_url = KURL ();
+ m_file = QString::null;
+
+ // we are not modified
+ if (m_modOnHd)
+ {
+ m_modOnHd = false;
+ m_modOnHdReason = 0;
+ emit modifiedOnDisc (this, m_modOnHd, 0);
+ }
+
+ // clear the buffer
+ m_buffer->clear();
+
+ // remove all marks
+ clearMarks ();
+
+ // clear undo/redo history
+ clearUndo();
+ clearRedo();
+
+ // no, we are no longer modified
+ setModified(false);
+
+ // we have no longer any hl
+ m_buffer->setHighlight(0);
+
+ // update all our views
+ for (KateView * view = m_views.first(); view != 0L; view = m_views.next() )
+ {
+ // Explicitly call the internal version because we don't want this to look like
+ // an external request (and thus have the view not QWidget::scroll()ed.
+ view->setCursorPositionInternal(0, 0, 1, false);
+ view->clearSelection();
+ view->updateView(true);
+ }
+
+ // uh, filename changed
+ emit fileNameChanged ();
+
+ // update doc name
+ setDocName (QString::null);
+
+ // success
+ return true;
+}
+
+void KateDocument::setReadWrite( bool rw )
+{
+ if (isReadWrite() != rw)
+ {
+ KParts::ReadWritePart::setReadWrite (rw);
+
+ for( KateView* view = m_views.first(); view != 0L; view = m_views.next() )
+ {
+ view->slotUpdate();
+ view->slotReadWriteChanged ();
+ }
+ }
+}
+
+void KateDocument::setModified(bool m) {
+
+ if (isModified() != m) {
+ KParts::ReadWritePart::setModified (m);
+
+ for( KateView* view = m_views.first(); view != 0L; view = m_views.next() )
+ {
+ view->slotUpdate();
+ }
+
+ emit modifiedChanged ();
+ emit modStateChanged ((Kate::Document *)this);
+ }
+ if ( m == false )
+ {
+ if ( ! undoItems.isEmpty() )
+ {
+ lastUndoGroupWhenSaved = undoItems.last();
+ }
+
+ if ( ! redoItems.isEmpty() )
+ {
+ lastRedoGroupWhenSaved = redoItems.last();
+ }
+
+ docWasSavedWhenUndoWasEmpty = undoItems.isEmpty();
+ docWasSavedWhenRedoWasEmpty = redoItems.isEmpty();
+ }
+}
+//END
+
+//BEGIN Kate specific stuff ;)
+
+void KateDocument::makeAttribs(bool needInvalidate)
+{
+ for (uint z = 0; z < m_views.count(); z++)
+ m_views.at(z)->renderer()->updateAttributes ();
+
+ if (needInvalidate)
+ m_buffer->invalidateHighlighting();
+
+ tagAll ();
+}
+
+// the attributes of a hl have changed, update
+void KateDocument::internalHlChanged()
+{
+ makeAttribs();
+}
+
+void KateDocument::addView(KTextEditor::View *view) {
+ if (!view)
+ return;
+
+ m_views.append( (KateView *) view );
+ m_textEditViews.append( view );
+
+ // apply the view & renderer vars from the file type
+ const KateFileType *t = 0;
+ if ((m_fileType > -1) && (t = KateFactory::self()->fileTypeManager()->fileType(m_fileType)))
+ readVariableLine (t->varLine, true);
+
+ // apply the view & renderer vars from the file
+ readVariables (true);
+
+ m_activeView = (KateView *) view;
+}
+
+void KateDocument::removeView(KTextEditor::View *view) {
+ if (!view)
+ return;
+
+ if (m_activeView == view)
+ m_activeView = 0L;
+
+ m_views.removeRef( (KateView *) view );
+ m_textEditViews.removeRef( view );
+}
+
+void KateDocument::addSuperCursor(KateSuperCursor *cursor, bool privateC) {
+ if (!cursor)
+ return;
+
+ m_superCursors.append( cursor );
+
+ if (!privateC)
+ myCursors.append( cursor );
+}
+
+void KateDocument::removeSuperCursor(KateSuperCursor *cursor, bool privateC) {
+ if (!cursor)
+ return;
+
+ if (!privateC)
+ myCursors.removeRef( cursor );
+
+ m_superCursors.removeRef( cursor );
+}
+
+bool KateDocument::ownedView(KateView *view) {
+ // do we own the given view?
+ return (m_views.containsRef(view) > 0);
+}
+
+bool KateDocument::isLastView(int numViews) {
+ return ((int) m_views.count() == numViews);
+}
+
+uint KateDocument::currentColumn( const KateTextCursor& cursor )
+{
+ KateTextLine::Ptr textLine = m_buffer->plainLine(cursor.line());
+
+ if (textLine)
+ return textLine->cursorX(cursor.col(), config()->tabWidth());
+ else
+ return 0;
+}
+
+bool KateDocument::typeChars ( KateView *view, const QString &chars )
+{
+ KateTextLine::Ptr textLine = m_buffer->plainLine(view->cursorLine ());
+
+ if (!textLine)
+ return false;
+
+ bool bracketInserted = false;
+ QString buf;
+ QChar c;
+
+ for( uint z = 0; z < chars.length(); z++ )
+ {
+ QChar ch = c = chars[z];
+ if (ch.isPrint() || ch == '\t')
+ {
+ buf.append (ch);
+
+ if (!bracketInserted && (config()->configFlags() & KateDocument::cfAutoBrackets))
+ {
+ QChar end_ch;
+ bool complete = true;
+ QChar prevChar = textLine->getChar(view->cursorColumnReal()-1);
+ QChar nextChar = textLine->getChar(view->cursorColumnReal());
+ switch(ch) {
+ case '(': end_ch = ')'; break;
+ case '[': end_ch = ']'; break;
+ case '{': end_ch = '}'; break;
+ case '\'':end_ch = '\'';break;
+ case '"': end_ch = '"'; break;
+ default: complete = false;
+ }
+ if (complete)
+ {
+ if (view->hasSelection())
+ { // there is a selection, enclose the selection
+ buf.append (view->selection());
+ buf.append (end_ch);
+ bracketInserted = true;
+ }
+ else
+ { // no selection, check whether we should better refuse to complete
+ if ( ( (ch == '\'' || ch == '"') &&
+ (prevChar.isLetterOrNumber() || prevChar == ch) )
+ || nextChar.isLetterOrNumber()
+ || (nextChar == end_ch && prevChar != ch) )
+ {
+ kdDebug(13020) << "AutoBracket refused before: " << nextChar << "\n";
+ }
+ else
+ {
+ buf.append (end_ch);
+ bracketInserted = true;
+ }
+ }
+ }
+ }
+ }
+ }
+
+ if (buf.isEmpty())
+ return false;
+
+ editStart ();
+
+ if (!view->config()->persistentSelection() && view->hasSelection() )
+ view->removeSelectedText();
+
+ int oldLine = view->cursorLine ();
+ int oldCol = view->cursorColumnReal ();
+
+
+ if (config()->configFlags() & KateDocument::cfOvr)
+ removeText (view->cursorLine(), view->cursorColumnReal(), view->cursorLine(), kMin( view->cursorColumnReal()+buf.length(), textLine->length() ) );
+
+ insertText (view->cursorLine(), view->cursorColumnReal(), buf);
+ m_indenter->processChar(c);
+
+ editEnd ();
+
+ if (bracketInserted)
+ view->setCursorPositionInternal (view->cursorLine(), view->cursorColumnReal()-1);
+
+ emit charactersInteractivelyInserted (oldLine, oldCol, chars);
+
+ return true;
+}
+
+void KateDocument::newLine( KateTextCursor& c, KateViewInternal *v )
+{
+ editStart();
+
+ if( !v->view()->config()->persistentSelection() && v->view()->hasSelection() )
+ v->view()->removeSelectedText();
+
+ // temporary hack to get the cursor pos right !!!!!!!!!
+ c = v->getCursor ();
+
+ if (c.line() > (int)lastLine())
+ c.setLine(lastLine());
+
+ if ( c.line() < 0 )
+ c.setLine( 0 );
+
+ uint ln = c.line();
+
+ KateTextLine::Ptr textLine = kateTextLine(c.line());
+
+ if (c.col() > (int)textLine->length())
+ c.setCol(textLine->length());
+
+ if (m_indenter->canProcessNewLine ())
+ {
+ int pos = textLine->firstChar();
+
+ // length should do the job better
+ if (pos < 0)
+ pos = textLine->length();
+
+ if (c.col() < pos)
+ c.setCol(pos); // place cursor on first char if before
+
+ editWrapLine (c.line(), c.col());
+
+ KateDocCursor cursor (c.line() + 1, pos, this);
+ m_indenter->processNewline(cursor, true);
+
+ c.setPos(cursor);
+ }
+ else
+ {
+ editWrapLine (c.line(), c.col());
+ c.setPos(c.line() + 1, 0);
+ }
+
+ removeTrailingSpace( ln );
+
+ editEnd();
+}
+
+void KateDocument::transpose( const KateTextCursor& cursor)
+{
+ KateTextLine::Ptr textLine = m_buffer->plainLine(cursor.line());
+
+ if (!textLine || (textLine->length() < 2))
+ return;
+
+ uint col = cursor.col();
+
+ if (col > 0)
+ col--;
+
+ if ((textLine->length() - col) < 2)
+ return;
+
+ uint line = cursor.line();
+ QString s;
+
+ //clever swap code if first character on the line swap right&left
+ //otherwise left & right
+ s.append (textLine->getChar(col+1));
+ s.append (textLine->getChar(col));
+ //do the swap
+
+ // do it right, never ever manipulate a textline
+ editStart ();
+ editRemoveText (line, col, 2);
+ editInsertText (line, col, s);
+ editEnd ();
+}
+
+void KateDocument::backspace( KateView *view, const KateTextCursor& c )
+{
+ if ( !view->config()->persistentSelection() && view->hasSelection() ) {
+ view->removeSelectedText();
+ return;
+ }
+
+ uint col = kMax( c.col(), 0 );
+ uint line = kMax( c.line(), 0 );
+
+ if ((col == 0) && (line == 0))
+ return;
+
+ int complement = 0;
+ if (col > 0)
+ {
+ if (config()->configFlags() & KateDocument::cfAutoBrackets)
+ {
+ // if inside empty (), {}, [], '', "" delete both
+ KateTextLine::Ptr tl = m_buffer->plainLine(line);
+ if(!tl) return;
+ QChar prevChar = tl->getChar(col-1);
+ QChar nextChar = tl->getChar(col);
+
+ if ( (prevChar == '"' && nextChar == '"') ||
+ (prevChar == '\'' && nextChar == '\'') ||
+ (prevChar == '(' && nextChar == ')') ||
+ (prevChar == '[' && nextChar == ']') ||
+ (prevChar == '{' && nextChar == '}') )
+ {
+ complement = 1;
+ }
+ }
+ if (!(config()->configFlags() & KateDocument::cfBackspaceIndents))
+ {
+ // ordinary backspace
+ //c.cursor.col--;
+ removeText(line, col-1, line, col+complement);
+ }
+ else
+ {
+ // backspace indents: erase to next indent position
+ KateTextLine::Ptr textLine = m_buffer->plainLine(line);
+
+ // don't forget this check!!!! really!!!!
+ if (!textLine)
+ return;
+
+ int colX = textLine->cursorX(col, config()->tabWidth());
+ int pos = textLine->firstChar();
+ if (pos > 0)
+ pos = textLine->cursorX(pos, config()->tabWidth());
+
+ if (pos < 0 || pos >= (int)colX)
+ {
+ // only spaces on left side of cursor
+ indent( view, line, -1);
+ }
+ else
+ removeText(line, col-1, line, col+complement);
+ }
+ }
+ else
+ {
+ // col == 0: wrap to previous line
+ if (line >= 1)
+ {
+ KateTextLine::Ptr textLine = m_buffer->plainLine(line-1);
+
+ // don't forget this check!!!! really!!!!
+ if (!textLine)
+ return;
+
+ if (config()->wordWrap() && textLine->endingWith(QString::fromLatin1(" ")))
+ {
+ // gg: in hard wordwrap mode, backspace must also eat the trailing space
+ removeText (line-1, textLine->length()-1, line, 0);
+ }
+ else
+ removeText (line-1, textLine->length(), line, 0);
+ }
+ }
+
+ emit backspacePressed();
+}
+
+void KateDocument::del( KateView *view, const KateTextCursor& c )
+{
+ if ( !view->config()->persistentSelection() && view->hasSelection() ) {
+ view->removeSelectedText();
+ return;
+ }
+
+ if( c.col() < (int) m_buffer->plainLine(c.line())->length())
+ {
+ removeText(c.line(), c.col(), c.line(), c.col()+1);
+ }
+ else if ( (uint)c.line() < lastLine() )
+ {
+ removeText(c.line(), c.col(), c.line()+1, 0);
+ }
+}
+
+void KateDocument::paste ( KateView* view )
+{
+ QString s = QApplication::clipboard()->text();
+
+ if (s.isEmpty())
+ return;
+
+ uint lines = s.contains (QChar ('\n'));
+
+ m_undoDontMerge = true;
+
+ editStart ();
+
+ if (!view->config()->persistentSelection() && view->hasSelection() )
+ view->removeSelectedText();
+
+ uint line = view->cursorLine ();
+ uint column = view->cursorColumnReal ();
+
+ insertText ( line, column, s, view->blockSelectionMode() );
+
+ editEnd();
+
+ // move cursor right for block select, as the user is moved right internal
+ // even in that case, but user expects other behavior in block selection
+ // mode !
+ if (view->blockSelectionMode())
+ view->setCursorPositionInternal (line+lines, column);
+
+ if (m_indenter->canProcessLine()
+ && config()->configFlags() & KateDocumentConfig::cfIndentPastedText)
+ {
+ editStart();
+
+ KateDocCursor begin(line, 0, this);
+ KateDocCursor end(line + lines, 0, this);
+
+ m_indenter->processSection (begin, end);
+
+ editEnd();
+ }
+
+ if (!view->blockSelectionMode()) emit charactersSemiInteractivelyInserted (line, column, s);
+ m_undoDontMerge = true;
+}
+
+void KateDocument::insertIndentChars ( KateView *view )
+{
+ editStart ();
+
+ QString s;
+ if (config()->configFlags() & KateDocument::cfSpaceIndent)
+ {
+ int width = config()->indentationWidth();
+ s.fill (' ', width - (view->cursorColumnReal() % width));
+ }
+ else
+ s.append ('\t');
+
+ insertText (view->cursorLine(), view->cursorColumnReal(), s);
+
+ editEnd ();
+}
+
+void KateDocument::indent ( KateView *v, uint line, int change)
+{
+ editStart ();
+
+ if (!hasSelection())
+ {
+ // single line
+ optimizeLeadingSpace(line, config()->configFlags(), change);
+ }
+ else
+ {
+ int sl = v->selStartLine();
+ int el = v->selEndLine();
+ int ec = v->selEndCol();
+
+ if ((ec == 0) && ((el-1) >= 0))
+ {
+ el--; /* */
+ }
+
+ if (config()->configFlags() & KateDocument::cfKeepIndentProfile && change < 0) {
+ // unindent so that the existing indent profile doesn't get screwed
+ // if any line we may unindent is already full left, don't do anything
+ int adjustedChange = -change;
+
+ for (line = sl; (int) line <= el && adjustedChange > 0; line++) {
+ KateTextLine::Ptr textLine = m_buffer->plainLine(line);
+ int firstChar = textLine->firstChar();
+ if (firstChar >= 0 && (v->lineSelected(line) || v->lineHasSelected(line))) {
+ int maxUnindent = textLine->cursorX(firstChar, config()->tabWidth()) / config()->indentationWidth();
+ if (maxUnindent < adjustedChange)
+ adjustedChange = maxUnindent;
+ }
+ }
+
+ change = -adjustedChange;
+ }
+
+ const bool rts = config()->configFlags() & KateDocumentConfig::cfRemoveTrailingDyn;
+ for (line = sl; (int) line <= el; line++) {
+ if ((v->lineSelected(line) || v->lineHasSelected(line))
+ && (!rts || lineLength(line) > 0)) {
+ optimizeLeadingSpace(line, config()->configFlags(), change);
+ }
+ }
+ }
+
+ editEnd ();
+}
+
+void KateDocument::align(KateView *view, uint line)
+{
+ if (m_indenter->canProcessLine())
+ {
+ editStart ();
+
+ if (!view->hasSelection())
+ {
+ KateDocCursor curLine(line, 0, this);
+ m_indenter->processLine (curLine);
+ editEnd ();
+ activeView()->setCursorPosition (line, curLine.col());
+ }
+ else
+ {
+ m_indenter->processSection (view->selStart(), view->selEnd());
+ editEnd ();
+ }
+ }
+}
+
+/*
+ Optimize the leading whitespace for a single line.
+ If change is > 0, it adds indentation units (indentationChars)
+ if change is == 0, it only optimizes
+ If change is < 0, it removes indentation units
+ This will be used to indent, unindent, and optimal-fill a line.
+ If excess space is removed depends on the flag cfKeepExtraSpaces
+ which has to be set by the user
+*/
+void KateDocument::optimizeLeadingSpace(uint line, int flags, int change)
+{
+ KateTextLine::Ptr textline = m_buffer->plainLine(line);
+
+ int first_char = textline->firstChar();
+
+ int w = 0;
+ if (flags & KateDocument::cfSpaceIndent)
+ w = config()->indentationWidth();
+ else
+ w = config()->tabWidth();
+
+ if (first_char < 0)
+ first_char = textline->length();
+
+ int space = textline->cursorX(first_char, config()->tabWidth()) + change * w;
+ if (space < 0)
+ space = 0;
+
+ if (!(flags & KateDocument::cfKeepExtraSpaces))
+ {
+ uint extra = space % w;
+
+ space -= extra;
+ if (extra && change < 0) {
+ // otherwise it unindents too much (e.g. 12 chars when indentation is 8 chars wide)
+ space += w;
+ }
+ }
+
+ //kdDebug(13020) << "replace With Op: " << line << " " << first_char << " " << space << endl;
+ replaceWithOptimizedSpace(line, first_char, space, flags);
+}
+
+void KateDocument::replaceWithOptimizedSpace(uint line, uint upto_column, uint space, int flags)
+{
+ uint length;
+ QString new_space;
+
+ if (flags & KateDocument::cfSpaceIndent && ! (flags & KateDocumentConfig::cfMixedIndent) ) {
+ length = space;
+ new_space.fill(' ', length);
+ }
+ else {
+ length = space / config()->tabWidth();
+ new_space.fill('\t', length);
+
+ QString extra_space;
+ extra_space.fill(' ', space % config()->tabWidth());
+ length += space % config()->tabWidth();
+ new_space += extra_space;
+ }
+
+ KateTextLine::Ptr textline = m_buffer->plainLine(line);
+ uint change_from;
+ for (change_from = 0; change_from < upto_column && change_from < length; change_from++) {
+ if (textline->getChar(change_from) != new_space[change_from])
+ break;
+ }
+
+ editStart();
+
+ if (change_from < upto_column)
+ removeText(line, change_from, line, upto_column);
+
+ if (change_from < length)
+ insertText(line, change_from, new_space.right(length - change_from));
+
+ editEnd();
+}
+
+/*
+ Remove a given string at the begining
+ of the current line.
+*/
+bool KateDocument::removeStringFromBegining(int line, QString &str)
+{
+ KateTextLine::Ptr textline = m_buffer->plainLine(line);
+
+ int index = 0;
+ bool there = false;
+
+ if (textline->startingWith(str))
+ there = true;
+ else
+ {
+ index = textline->firstChar ();
+
+ if ((index >= 0) && (textline->length() >= (index + str.length())) && (textline->string(index, str.length()) == str))
+ there = true;
+ }
+
+ if (there)
+ {
+ // Remove some chars
+ removeText (line, index, line, index+str.length());
+ }
+
+ return there;
+}
+
+/*
+ Remove a given string at the end
+ of the current line.
+*/
+bool KateDocument::removeStringFromEnd(int line, QString &str)
+{
+ KateTextLine::Ptr textline = m_buffer->plainLine(line);
+
+ int index = 0;
+ bool there = false;
+
+ if(textline->endingWith(str))
+ {
+ index = textline->length() - str.length();
+ there = true;
+ }
+ else
+ {
+ index = textline->lastChar ()-str.length()+1;
+
+ if ((index >= 0) && (textline->length() >= (index + str.length())) && (textline->string(index, str.length()) == str))
+ there = true;
+ }
+
+ if (there)
+ {
+ // Remove some chars
+ removeText (line, index, line, index+str.length());
+ }
+
+ return there;
+}
+
+/*
+ Add to the current line a comment line mark at
+ the begining.
+*/
+void KateDocument::addStartLineCommentToSingleLine( int line, int attrib )
+{
+ if (highlight()->getCommentSingleLinePosition(attrib)==KateHighlighting::CSLPosColumn0)
+ {
+ QString commentLineMark = highlight()->getCommentSingleLineStart( attrib ) + " ";
+ insertText (line, 0, commentLineMark);
+ }
+ else
+ {
+ QString commentLineMark=highlight()->getCommentSingleLineStart(attrib);
+ KateTextLine::Ptr l = m_buffer->line(line);
+ int pos=l->firstChar();
+ if (pos >=0)
+ insertText(line,pos,commentLineMark);
+ }
+}
+
+/*
+ Remove from the current line a comment line mark at
+ the begining if there is one.
+*/
+bool KateDocument::removeStartLineCommentFromSingleLine( int line, int attrib )
+{
+ QString shortCommentMark = highlight()->getCommentSingleLineStart( attrib );
+ QString longCommentMark = shortCommentMark + " ";
+
+ editStart();
+
+ // Try to remove the long comment mark first
+ bool removed = (removeStringFromBegining(line, longCommentMark)
+ || removeStringFromBegining(line, shortCommentMark));
+
+ editEnd();
+
+ return removed;
+}
+
+/*
+ Add to the current line a start comment mark at the
+ begining and a stop comment mark at the end.
+*/
+void KateDocument::addStartStopCommentToSingleLine( int line, int attrib )
+{
+ QString startCommentMark = highlight()->getCommentStart( attrib ) + " ";
+ QString stopCommentMark = " " + highlight()->getCommentEnd( attrib );
+
+ editStart();
+
+ // Add the start comment mark
+ insertText (line, 0, startCommentMark);
+
+ // Go to the end of the line
+ int col = m_buffer->plainLine(line)->length();
+
+ // Add the stop comment mark
+ insertText (line, col, stopCommentMark);
+
+ editEnd();
+}
+
+/*
+ Remove from the current line a start comment mark at
+ the begining and a stop comment mark at the end.
+*/
+bool KateDocument::removeStartStopCommentFromSingleLine( int line, int attrib )
+{
+ QString shortStartCommentMark = highlight()->getCommentStart( attrib );
+ QString longStartCommentMark = shortStartCommentMark + " ";
+ QString shortStopCommentMark = highlight()->getCommentEnd( attrib );
+ QString longStopCommentMark = " " + shortStopCommentMark;
+
+ editStart();
+
+#ifdef __GNUC__
+#warning "that's a bad idea, can lead to stray endings, FIXME"
+#endif
+ // Try to remove the long start comment mark first
+ bool removedStart = (removeStringFromBegining(line, longStartCommentMark)
+ || removeStringFromBegining(line, shortStartCommentMark));
+
+ bool removedStop = false;
+ if (removedStart)
+ {
+ // Try to remove the long stop comment mark first
+ removedStop = (removeStringFromEnd(line, longStopCommentMark)
+ || removeStringFromEnd(line, shortStopCommentMark));
+ }
+
+ editEnd();
+
+ return (removedStart || removedStop);
+}
+
+/*
+ Add to the current selection a start comment
+ mark at the begining and a stop comment mark
+ at the end.
+*/
+void KateDocument::addStartStopCommentToSelection( KateView *view, int attrib )
+{
+ QString startComment = highlight()->getCommentStart( attrib );
+ QString endComment = highlight()->getCommentEnd( attrib );
+
+ int sl = view->selStartLine();
+ int el = view->selEndLine();
+ int sc = view->selStartCol();
+ int ec = view->selEndCol();
+
+ if ((ec == 0) && ((el-1) >= 0))
+ {
+ el--;
+ ec = m_buffer->plainLine (el)->length();
+ }
+
+ editStart();
+
+ insertText (el, ec, endComment);
+ insertText (sl, sc, startComment);
+
+ editEnd ();
+
+ // Set the new selection
+ ec += endComment.length() + ( (el == sl) ? startComment.length() : 0 );
+ view->setSelection(sl, sc, el, ec);
+}
+
+/*
+ Add to the current selection a comment line
+ mark at the begining of each line.
+*/
+void KateDocument::addStartLineCommentToSelection( KateView *view, int attrib )
+{
+ QString commentLineMark = highlight()->getCommentSingleLineStart( attrib ) + " ";
+
+ int sl = view->selStartLine();
+ int el = view->selEndLine();
+
+ if ((view->selEndCol() == 0) && ((el-1) >= 0))
+ {
+ el--;
+ }
+
+ editStart();
+
+ // For each line of the selection
+ for (int z = el; z >= sl; z--) {
+ //insertText (z, 0, commentLineMark);
+ addStartLineCommentToSingleLine(z, attrib );
+ }
+
+ editEnd ();
+
+ // Set the new selection
+
+ KateDocCursor end (view->selEnd());
+ end.setCol(view->selEndCol() + ((el == view->selEndLine()) ? commentLineMark.length() : 0) );
+
+ view->setSelection(view->selStartLine(), 0, end.line(), end.col());
+}
+
+bool KateDocument::nextNonSpaceCharPos(int &line, int &col)
+{
+ for(; line < (int)m_buffer->count(); line++) {
+ KateTextLine::Ptr textLine = m_buffer->plainLine(line);
+
+ if (!textLine)
+ break;
+
+ col = textLine->nextNonSpaceChar(col);
+ if(col != -1)
+ return true; // Next non-space char found
+ col = 0;
+ }
+ // No non-space char found
+ line = -1;
+ col = -1;
+ return false;
+}
+
+bool KateDocument::previousNonSpaceCharPos(int &line, int &col)
+{
+ while(true)
+ {
+ KateTextLine::Ptr textLine = m_buffer->plainLine(line);
+
+ if (!textLine)
+ break;
+
+ col = textLine->previousNonSpaceChar(col);
+ if(col != -1) return true;
+ if(line == 0) return false;
+ --line;
+ col = textLine->length();
+}
+ // No non-space char found
+ line = -1;
+ col = -1;
+ return false;
+}
+
+/*
+ Remove from the selection a start comment mark at
+ the begining and a stop comment mark at the end.
+*/
+bool KateDocument::removeStartStopCommentFromSelection( KateView *view, int attrib )
+{
+ QString startComment = highlight()->getCommentStart( attrib );
+ QString endComment = highlight()->getCommentEnd( attrib );
+
+ int sl = kMax<int> (0, view->selStartLine());
+ int el = kMin<int> (view->selEndLine(), lastLine());
+ int sc = view->selStartCol();
+ int ec = view->selEndCol();
+
+ // The selection ends on the char before selectEnd
+ if (ec != 0) {
+ ec--;
+ } else {
+ if (el > 0) {
+ el--;
+ ec = m_buffer->plainLine(el)->length() - 1;
+ }
+ }
+
+ int startCommentLen = startComment.length();
+ int endCommentLen = endComment.length();
+
+ // had this been perl or sed: s/^\s*$startComment(.+?)$endComment\s*/$1/
+
+ bool remove = nextNonSpaceCharPos(sl, sc)
+ && m_buffer->plainLine(sl)->stringAtPos(sc, startComment)
+ && previousNonSpaceCharPos(el, ec)
+ && ( (ec - endCommentLen + 1) >= 0 )
+ && m_buffer->plainLine(el)->stringAtPos(ec - endCommentLen + 1, endComment);
+
+ if (remove) {
+ editStart();
+
+ removeText (el, ec - endCommentLen + 1, el, ec + 1);
+ removeText (sl, sc, sl, sc + startCommentLen);
+
+ editEnd ();
+ // set new selection not necessary, as the selection cursors are KateSuperCursors
+ }
+
+ return remove;
+}
+
+bool KateDocument::removeStartStopCommentFromRegion(const KateTextCursor &start,const KateTextCursor &end,int attrib)
+{
+ QString startComment = highlight()->getCommentStart( attrib );
+ QString endComment = highlight()->getCommentEnd( attrib );
+ int startCommentLen = startComment.length();
+ int endCommentLen = endComment.length();
+
+ bool remove = m_buffer->plainLine(start.line())->stringAtPos(start.col(), startComment)
+ && ( (end.col() - endCommentLen ) >= 0 )
+ && m_buffer->plainLine(end.line())->stringAtPos(end.col() - endCommentLen , endComment);
+ if (remove) {
+ editStart();
+ removeText(end.line(),end.col()-endCommentLen,end.line(),end.col());
+ removeText(start.line(),start.col(),start.line(),start.col()+startCommentLen);
+ editEnd();
+ }
+ return remove;
+}
+
+/*
+ Remove from the begining of each line of the
+ selection a start comment line mark.
+*/
+bool KateDocument::removeStartLineCommentFromSelection( KateView *view, int attrib )
+{
+ QString shortCommentMark = highlight()->getCommentSingleLineStart( attrib );
+ QString longCommentMark = shortCommentMark + " ";
+
+ int sl = view->selStartLine();
+ int el = view->selEndLine();
+
+ if ((view->selEndCol() == 0) && ((el-1) >= 0))
+ {
+ el--;
+ }
+
+ // Find out how many char will be removed from the last line
+ int removeLength = 0;
+ if (m_buffer->plainLine(el)->startingWith(longCommentMark))
+ removeLength = longCommentMark.length();
+ else if (m_buffer->plainLine(el)->startingWith(shortCommentMark))
+ removeLength = shortCommentMark.length();
+
+ bool removed = false;
+
+ editStart();
+
+ // For each line of the selection
+ for (int z = el; z >= sl; z--)
+ {
+ // Try to remove the long comment mark first
+ removed = (removeStringFromBegining(z, longCommentMark)
+ || removeStringFromBegining(z, shortCommentMark)
+ || removed);
+ }
+
+ editEnd();
+ // updating selection already done by the KateSuperCursors
+ return removed;
+}
+
+/*
+ Comment or uncomment the selection or the current
+ line if there is no selection.
+*/
+void KateDocument::comment( KateView *v, uint line,uint column, int change)
+{
+ // We need to check that we can sanely comment the selectino or region.
+ // It is if the attribute of the first and last character of the range to
+ // comment belongs to the same language definition.
+ // for lines with no text, we need the attribute for the lines context.
+ bool hassel = v->hasSelection();
+ int startAttrib, endAttrib;
+ if ( hassel )
+ {
+ KateTextLine::Ptr ln = kateTextLine( v->selStartLine() );
+ int l = v->selStartLine(), c = v->selStartCol();
+ startAttrib = nextNonSpaceCharPos( l, c ) ? kateTextLine( l )->attribute( c ) : 0;
+
+ ln = kateTextLine( v->selEndLine() );
+ l = v->selEndLine(), c = v->selEndCol();
+ endAttrib = previousNonSpaceCharPos( l, c ) ? kateTextLine( l )->attribute( c ) : 0;
+ }
+ else
+ {
+ KateTextLine::Ptr ln = kateTextLine( line );
+ if ( ln->length() )
+ {
+ startAttrib = ln->attribute( ln->firstChar() );
+ endAttrib = ln->attribute( ln->lastChar() );
+ }
+ else
+ {
+ int l = line, c = 0;
+ if ( nextNonSpaceCharPos( l, c ) || previousNonSpaceCharPos( l, c ) )
+ startAttrib = endAttrib = kateTextLine( l )->attribute( c );
+ else
+ startAttrib = endAttrib = 0;
+ }
+ }
+
+ if ( ! highlight()->canComment( startAttrib, endAttrib ) )
+ {
+ kdDebug(13020)<<"canComment( "<<startAttrib<<", "<<endAttrib<<" ) returned false!"<<endl;
+ return;
+ }
+
+ bool hasStartLineCommentMark = !(highlight()->getCommentSingleLineStart( startAttrib ).isEmpty());
+ bool hasStartStopCommentMark = ( !(highlight()->getCommentStart( startAttrib ).isEmpty())
+ && !(highlight()->getCommentEnd( endAttrib ).isEmpty()) );
+
+ bool removed = false;
+
+ if (change > 0) // comment
+ {
+ if ( !hassel )
+ {
+ if ( hasStartLineCommentMark )
+ addStartLineCommentToSingleLine( line, startAttrib );
+ else if ( hasStartStopCommentMark )
+ addStartStopCommentToSingleLine( line, startAttrib );
+ }
+ else
+ {
+ // anders: prefer single line comment to avoid nesting probs
+ // If the selection starts after first char in the first line
+ // or ends before the last char of the last line, we may use
+ // multiline comment markers.
+ // TODO We should try to detect nesting.
+ // - if selection ends at col 0, most likely she wanted that
+ // line ignored
+ if ( hasStartStopCommentMark &&
+ ( !hasStartLineCommentMark || (
+ ( v->selStartCol() > m_buffer->plainLine( v->selStartLine() )->firstChar() ) ||
+ ( v->selEndCol() < ((int)m_buffer->plainLine( v->selEndLine() )->length()) )
+ ) ) )
+ addStartStopCommentToSelection( v, startAttrib );
+ else if ( hasStartLineCommentMark )
+ addStartLineCommentToSelection( v, startAttrib );
+ }
+ }
+ else // uncomment
+ {
+ if ( !hassel )
+ {
+ removed = ( hasStartLineCommentMark
+ && removeStartLineCommentFromSingleLine( line, startAttrib ) )
+ || ( hasStartStopCommentMark
+ && removeStartStopCommentFromSingleLine( line, startAttrib ) );
+ if ((!removed) && foldingTree()) {
+ kdDebug(13020)<<"easy approach for uncommenting did not work, trying harder (folding tree)"<<endl;
+ int commentRegion=(highlight()->commentRegion(startAttrib));
+ if (commentRegion){
+ KateCodeFoldingNode *n=foldingTree()->findNodeForPosition(line,column);
+ if (n) {
+ KateTextCursor start,end;
+ if ((n->nodeType()==commentRegion) && n->getBegin(foldingTree(), &start) && n->getEnd(foldingTree(), &end)) {
+ kdDebug(13020)<<"Enclosing region found:"<<start.col()<<"/"<<start.line()<<"-"<<end.col()<<"/"<<end.line()<<endl;
+ removeStartStopCommentFromRegion(start,end,startAttrib);
+ } else {
+ kdDebug(13020)<<"Enclosing region found, but not valid"<<endl;
+ kdDebug(13020)<<"Region found: "<<n->nodeType()<<" region needed: "<<commentRegion<<endl;
+ }
+ //perhaps nested regions should be hadled here too...
+ } else kdDebug(13020)<<"No enclosing region found"<<endl;
+ } else kdDebug(13020)<<"No comment region specified for current hl"<<endl;
+ }
+ }
+ else
+ {
+ // anders: this seems like it will work with above changes :)
+ removed = ( hasStartLineCommentMark
+ && removeStartLineCommentFromSelection( v, startAttrib ) )
+ || ( hasStartStopCommentMark
+ && removeStartStopCommentFromSelection( v, startAttrib ) );
+ }
+ }
+}
+
+void KateDocument::transform( KateView *v, const KateTextCursor &c,
+ KateDocument::TextTransform t )
+{
+ editStart();
+ uint cl( c.line() ), cc( c.col() );
+ bool selectionRestored = false;
+
+ if ( hasSelection() )
+ {
+ // cache the selection and cursor, so we can be sure to restore.
+ KateTextCursor selstart = v->selStart();
+ KateTextCursor selend = v->selEnd();
+
+ int ln = v->selStartLine();
+ while ( ln <= selend.line() )
+ {
+ uint start, end;
+ start = (ln == selstart.line() || v->blockSelectionMode()) ?
+ selstart.col() : 0;
+ end = (ln == selend.line() || v->blockSelectionMode()) ?
+ selend.col() : lineLength( ln );
+ if ( start > end )
+ {
+ uint t = start;
+ start = end;
+ end = t;
+ }
+ QString s = text( ln, start, ln, end );
+ QString o = s;
+
+ if ( t == Uppercase )
+ s = s.upper();
+ else if ( t == Lowercase )
+ s = s.lower();
+ else // Capitalize
+ {
+ KateTextLine::Ptr l = m_buffer->plainLine( ln );
+ uint p ( 0 );
+ while( p < s.length() )
+ {
+ // If bol or the character before is not in a word, up this one:
+ // 1. if both start and p is 0, upper char.
+ // 2. if blockselect or first line, and p == 0 and start-1 is not in a word, upper
+ // 3. if p-1 is not in a word, upper.
+ if ( ( ! start && ! p ) ||
+ ( ( ln == selstart.line() || v->blockSelectionMode() ) &&
+ ! p && ! highlight()->isInWord( l->getChar( start - 1 )) ) ||
+ ( p && ! highlight()->isInWord( s.at( p-1 ) ) )
+ )
+ s[p] = s.at(p).upper();
+ p++;
+ }
+ }
+
+ if ( o != s )
+ {
+ removeText( ln, start, ln, end );
+ insertText( ln, start, s );
+ }
+
+ ln++;
+ }
+
+ // restore selection
+ v->setSelection( selstart, selend );
+ selectionRestored = true;
+
+ } else { // no selection
+ QString o = text( cl, cc, cl, cc + 1 );
+ QString s;
+ int n ( cc );
+ switch ( t ) {
+ case Uppercase:
+ s = o.upper();
+ break;
+ case Lowercase:
+ s = o.lower();
+ break;
+ case Capitalize:
+ {
+ KateTextLine::Ptr l = m_buffer->plainLine( cl );
+ while ( n > 0 && highlight()->isInWord( l->getChar( n-1 ), l->attribute( n-1 ) ) )
+ n--;
+ o = text( cl, n, cl, n + 1 );
+ s = o.upper();
+ }
+ break;
+ default:
+ break;
+ }
+
+ if ( s != o )
+ {
+ removeText( cl, n, cl, n+1 );
+ insertText( cl, n, s );
+ }
+ }
+ editEnd();
+
+ if ( ! selectionRestored )
+ v->setCursorPosition( cl, cc );
+}
+
+void KateDocument::joinLines( uint first, uint last )
+{
+// if ( first == last ) last += 1;
+ editStart();
+ int line( first );
+ while ( first < last )
+ {
+ // Normalize the whitespace in the joined lines by making sure there's
+ // always exactly one space between the joined lines
+ // This cannot be done in editUnwrapLine, because we do NOT want this
+ // behaviour when deleting from the start of a line, just when explicitly
+ // calling the join command
+ KateTextLine::Ptr l = m_buffer->line( line );
+ KateTextLine::Ptr tl = m_buffer->line( line + 1 );
+
+ if ( !l || !tl )
+ {
+ editEnd();
+ return;
+ }
+
+ int pos = tl->firstChar();
+ if ( pos >= 0 )
+ {
+ if (pos != 0)
+ editRemoveText( line + 1, 0, pos );
+ if ( !( l->length() == 0 || l->getChar( l->length() - 1 ).isSpace() ) )
+ editInsertText( line + 1, 0, " " );
+ }
+ else
+ {
+ // Just remove the whitespace and let Kate handle the rest
+ editRemoveText( line + 1, 0, tl->length() );
+ }
+
+ editUnWrapLine( line );
+ first++;
+ }
+ editEnd();
+}
+
+QString KateDocument::getWord( const KateTextCursor& cursor ) {
+ int start, end, len;
+
+ KateTextLine::Ptr textLine = m_buffer->plainLine(cursor.line());
+ len = textLine->length();
+ start = end = cursor.col();
+ if (start > len) // Probably because of non-wrapping cursor mode.
+ return QString("");
+
+ while (start > 0 && highlight()->isInWord(textLine->getChar(start - 1), textLine->attribute(start - 1))) start--;
+ while (end < len && highlight()->isInWord(textLine->getChar(end), textLine->attribute(end))) end++;
+ len = end - start;
+ return QString(&textLine->text()[start], len);
+}
+
+void KateDocument::tagLines(int start, int end)
+{
+ for (uint z = 0; z < m_views.count(); z++)
+ m_views.at(z)->tagLines (start, end, true);
+}
+
+void KateDocument::tagLines(KateTextCursor start, KateTextCursor end)
+{
+ // May need to switch start/end cols if in block selection mode
+ if (blockSelectionMode() && start.col() > end.col()) {
+ int sc = start.col();
+ start.setCol(end.col());
+ end.setCol(sc);
+ }
+
+ for (uint z = 0; z < m_views.count(); z++)
+ m_views.at(z)->tagLines(start, end, true);
+}
+
+void KateDocument::repaintViews(bool paintOnlyDirty)
+{
+ for (uint z = 0; z < m_views.count(); z++)
+ m_views.at(z)->repaintText(paintOnlyDirty);
+}
+
+void KateDocument::tagAll()
+{
+ for (uint z = 0; z < m_views.count(); z++)
+ {
+ m_views.at(z)->tagAll();
+ m_views.at(z)->updateView (true);
+ }
+}
+
+uint KateDocument::configFlags ()
+{
+ return config()->configFlags();
+}
+
+void KateDocument::setConfigFlags (uint flags)
+{
+ config()->setConfigFlags(flags);
+}
+
+inline bool isStartBracket( const QChar& c ) { return c == '{' || c == '[' || c == '('; }
+inline bool isEndBracket ( const QChar& c ) { return c == '}' || c == ']' || c == ')'; }
+inline bool isBracket ( const QChar& c ) { return isStartBracket( c ) || isEndBracket( c ); }
+
+/*
+ Bracket matching uses the following algorithm:
+ If in overwrite mode, match the bracket currently underneath the cursor.
+ Otherwise, if the character to the right of the cursor is an starting bracket,
+ match it. Otherwise if the character to the left of the cursor is a
+ ending bracket, match it. Otherwise, if the the character to the left
+ of the cursor is an starting bracket, match it. Otherwise, if the character
+ to the right of the cursor is an ending bracket, match it. Otherwise, don't
+ match anything.
+*/
+void KateDocument::newBracketMark( const KateTextCursor& cursor, KateBracketRange& bm, int maxLines )
+{
+ bm.setValid(false);
+
+ bm.start() = cursor;
+
+ if( !findMatchingBracket( bm.start(), bm.end(), maxLines ) )
+ return;
+
+ bm.setValid(true);
+
+ const int tw = config()->tabWidth();
+ const int indentStart = m_buffer->plainLine(bm.start().line())->indentDepth(tw);
+ const int indentEnd = m_buffer->plainLine(bm.end().line())->indentDepth(tw);
+ bm.setIndentMin(kMin(indentStart, indentEnd));
+}
+
+bool KateDocument::findMatchingBracket( KateTextCursor& start, KateTextCursor& end, int maxLines )
+{
+ KateTextLine::Ptr textLine = m_buffer->plainLine( start.line() );
+ if( !textLine )
+ return false;
+
+ QChar right = textLine->getChar( start.col() );
+ QChar left = textLine->getChar( start.col() - 1 );
+ QChar bracket;
+
+ if ( config()->configFlags() & cfOvr ) {
+ if( isBracket( right ) ) {
+ bracket = right;
+ } else {
+ return false;
+ }
+ } else if ( isStartBracket( right ) ) {
+ bracket = right;
+ } else if ( isEndBracket( left ) ) {
+ start.setCol(start.col() - 1);
+ bracket = left;
+ } else if ( isBracket( left ) ) {
+ start.setCol(start.col() - 1);
+ bracket = left;
+ } else if ( isBracket( right ) ) {
+ bracket = right;
+ } else {
+ return false;
+ }
+
+ QChar opposite;
+
+ switch( bracket ) {
+ case '{': opposite = '}'; break;
+ case '}': opposite = '{'; break;
+ case '[': opposite = ']'; break;
+ case ']': opposite = '['; break;
+ case '(': opposite = ')'; break;
+ case ')': opposite = '('; break;
+ default: return false;
+ }
+
+ bool forward = isStartBracket( bracket );
+ int startAttr = textLine->attribute( start.col() );
+ uint count = 0;
+ int lines = 0;
+ end = start;
+
+ while( true ) {
+ /* Increment or decrement, check base cases */
+ if( forward ) {
+ end.setCol(end.col() + 1);
+ if( end.col() >= lineLength( end.line() ) ) {
+ if( end.line() >= (int)lastLine() )
+ return false;
+ end.setPos(end.line() + 1, 0);
+ textLine = m_buffer->plainLine( end.line() );
+ lines++;
+ }
+ } else {
+ end.setCol(end.col() - 1);
+ if( end.col() < 0 ) {
+ if( end.line() <= 0 )
+ return false;
+ end.setLine(end.line() - 1);
+ end.setCol(lineLength( end.line() ) - 1);
+ textLine = m_buffer->plainLine( end.line() );
+ lines++;
+ }
+ }
+
+ if ((maxLines != -1) && (lines > maxLines))
+ return false;
+
+ /* Easy way to skip comments */
+ if( textLine->attribute( end.col() ) != startAttr )
+ continue;
+
+ /* Check for match */
+ QChar c = textLine->getChar( end.col() );
+ if( c == bracket ) {
+ count++;
+ } else if( c == opposite ) {
+ if( count == 0 )
+ return true;
+ count--;
+ }
+
+ }
+}
+
+void KateDocument::guiActivateEvent( KParts::GUIActivateEvent *ev )
+{
+ KParts::ReadWritePart::guiActivateEvent( ev );
+ if ( ev->activated() )
+ emit selectionChanged();
+}
+
+void KateDocument::setDocName (QString name )
+{
+ if ( name == m_docName )
+ return;
+
+ if ( !name.isEmpty() )
+ {
+ // TODO check for similarly named documents
+ m_docName = name;
+ updateFileType (KateFactory::self()->fileTypeManager()->fileType (this));
+ emit nameChanged((Kate::Document *) this);
+ return;
+ }
+
+ // if the name is set, and starts with FILENAME, it should not be changed!
+ if ( ! url().isEmpty() && m_docName.startsWith( url().filename() ) ) return;
+
+ int count = -1;
+
+ for (uint z=0; z < KateFactory::self()->documents()->count(); z++)
+ {
+ if ( (KateFactory::self()->documents()->at(z) != this) && (KateFactory::self()->documents()->at(z)->url().filename() == url().filename()) )
+ if ( KateFactory::self()->documents()->at(z)->m_docNameNumber > count )
+ count = KateFactory::self()->documents()->at(z)->m_docNameNumber;
+ }
+
+ m_docNameNumber = count + 1;
+
+ m_docName = url().filename();
+
+ if (m_docName.isEmpty())
+ m_docName = i18n ("Untitled");
+
+ if (m_docNameNumber > 0)
+ m_docName = QString(m_docName + " (%1)").arg(m_docNameNumber+1);
+
+ updateFileType (KateFactory::self()->fileTypeManager()->fileType (this));
+ emit nameChanged ((Kate::Document *) this);
+}
+
+void KateDocument::slotModifiedOnDisk( Kate::View * /*v*/ )
+{
+ if ( m_isasking < 0 )
+ {
+ m_isasking = 0;
+ return;
+ }
+
+ if ( !s_fileChangedDialogsActivated || m_isasking )
+ return;
+
+ if (m_modOnHd && !url().isEmpty())
+ {
+ m_isasking = 1;
+
+ KateModOnHdPrompt p( this, m_modOnHdReason, reasonedMOHString(), widget() );
+ switch ( p.exec() )
+ {
+ case KateModOnHdPrompt::Save:
+ {
+ m_modOnHd = false;
+ KEncodingFileDialog::Result res=KEncodingFileDialog::getSaveURLAndEncoding(config()->encoding(),
+ url().url(),QString::null,widget(),i18n("Save File"));
+
+ kdDebug(13020)<<"got "<<res.URLs.count()<<" URLs"<<endl;
+ if( ! res.URLs.isEmpty() && ! res.URLs.first().isEmpty() && checkOverwrite( res.URLs.first() ) )
+ {
+ setEncoding( res.encoding );
+
+ if( ! saveAs( res.URLs.first() ) )
+ {
+ KMessageBox::error( widget(), i18n("Save failed") );
+ m_modOnHd = true;
+ }
+ else
+ emit modifiedOnDisc( this, false, 0 );
+ }
+ else // the save as dialog was cancelled, we are still modified on disk
+ {
+ m_modOnHd = true;
+ }
+
+ m_isasking = 0;
+ break;
+ }
+
+ case KateModOnHdPrompt::Reload:
+ m_modOnHd = false;
+ emit modifiedOnDisc( this, false, 0 );
+ reloadFile();
+ m_isasking = 0;
+ break;
+
+ case KateModOnHdPrompt::Ignore:
+ m_modOnHd = false;
+ emit modifiedOnDisc( this, false, 0 );
+ m_isasking = 0;
+ break;
+
+ case KateModOnHdPrompt::Overwrite:
+ m_modOnHd = false;
+ emit modifiedOnDisc( this, false, 0 );
+ m_isasking = 0;
+ save();
+ break;
+
+ default: // cancel: ignore next focus event
+ m_isasking = -1;
+ }
+ }
+}
+
+void KateDocument::setModifiedOnDisk( int reason )
+{
+ m_modOnHdReason = reason;
+ m_modOnHd = (reason > 0);
+ emit modifiedOnDisc( this, (reason > 0), reason );
+}
+
+class KateDocumentTmpMark
+{
+ public:
+ QString line;
+ KTextEditor::Mark mark;
+};
+
+void KateDocument::reloadFile()
+{
+ if ( !url().isEmpty() )
+ {
+ if (m_modOnHd && s_fileChangedDialogsActivated)
+ {
+ int i = KMessageBox::warningYesNoCancel
+ (0, reasonedMOHString() + "\n\n" + i18n("What do you want to do?"),
+ i18n("File Was Changed on Disk"), i18n("&Reload File"), i18n("&Ignore Changes"));
+
+ if ( i != KMessageBox::Yes)
+ {
+ if (i == KMessageBox::No)
+ {
+ m_modOnHd = false;
+ m_modOnHdReason = 0;
+ emit modifiedOnDisc (this, m_modOnHd, 0);
+ }
+
+ return;
+ }
+ }
+
+ QValueList<KateDocumentTmpMark> tmp;
+
+ for( QIntDictIterator<KTextEditor::Mark> it( m_marks ); it.current(); ++it )
+ {
+ KateDocumentTmpMark m;
+
+ m.line = textLine (it.current()->line);
+ m.mark = *it.current();
+
+ tmp.append (m);
+ }
+
+ uint mode = hlMode ();
+ bool byUser = hlSetByUser;
+
+ m_storedVariables.clear();
+
+ m_reloading = true;
+
+ QValueList<int> lines, cols;
+ for ( uint i=0; i < m_views.count(); i++ )
+ {
+ lines.append( m_views.at( i )->cursorLine() );
+ cols.append( m_views.at( i )->cursorColumn() );
+ }
+
+ KateDocument::openURL( url() );
+
+ for ( uint i=0; i < m_views.count(); i++ )
+ m_views.at( i )->setCursorPositionInternal( lines[ i ], cols[ i ], m_config->tabWidth(), false );
+
+ m_reloading = false;
+
+ for ( QValueList<int>::size_type z=0; z < tmp.size(); z++ )
+ {
+ if (z < numLines())
+ {
+ if (textLine(tmp[z].mark.line) == tmp[z].line)
+ setMark (tmp[z].mark.line, tmp[z].mark.type);
+ }
+ }
+
+ if (byUser)
+ setHlMode (mode);
+ }
+}
+
+void KateDocument::flush ()
+{
+ closeURL ();
+}
+
+void KateDocument::setWordWrap (bool on)
+{
+ config()->setWordWrap (on);
+}
+
+bool KateDocument::wordWrap ()
+{
+ return config()->wordWrap ();
+}
+
+void KateDocument::setWordWrapAt (uint col)
+{
+ config()->setWordWrapAt (col);
+}
+
+unsigned int KateDocument::wordWrapAt ()
+{
+ return config()->wordWrapAt ();
+}
+
+void KateDocument::applyWordWrap ()
+{
+ // dummy to make the API happy
+}
+
+void KateDocument::setPageUpDownMovesCursor (bool on)
+{
+ config()->setPageUpDownMovesCursor (on);
+}
+
+bool KateDocument::pageUpDownMovesCursor ()
+{
+ return config()->pageUpDownMovesCursor ();
+}
+
+void KateDocument::dumpRegionTree()
+{
+ m_buffer->foldingTree()->debugDump();
+}
+//END
+
+//BEGIN KTextEditor::CursorInterface stuff
+
+KTextEditor::Cursor *KateDocument::createCursor ( )
+{
+ return new KateSuperCursor (this, false, 0, 0, this);
+}
+
+void KateDocument::tagArbitraryLines(KateView* view, KateSuperRange* range)
+{
+ if (view)
+ view->tagLines(range->start(), range->end());
+ else
+ tagLines(range->start(), range->end());
+}
+
+void KateDocument::lineInfo (KateLineInfo *info, unsigned int line)
+{
+ m_buffer->lineInfo(info,line);
+}
+
+KateCodeFoldingTree *KateDocument::foldingTree ()
+{
+ return m_buffer->foldingTree();
+}
+
+void KateDocument::setEncoding (const QString &e)
+{
+ if ( m_encodingSticky )
+ return;
+
+ QString ce = m_config->encoding().lower();
+ if ( e.lower() == ce )
+ return;
+
+ m_config->setEncoding( e );
+ if ( ! m_loading )
+ reloadFile();
+}
+
+QString KateDocument::encoding() const
+{
+ return m_config->encoding();
+}
+
+void KateDocument::updateConfig ()
+{
+ emit undoChanged ();
+ tagAll();
+
+ for (KateView * view = m_views.first(); view != 0L; view = m_views.next() )
+ {
+ view->updateDocumentConfig ();
+ }
+
+ // switch indenter if needed
+ if (m_indenter->modeNumber() != m_config->indentationMode())
+ {
+ delete m_indenter;
+ m_indenter = KateAutoIndent::createIndenter ( this, m_config->indentationMode() );
+ }
+
+ m_indenter->updateConfig();
+
+ m_buffer->setTabWidth (config()->tabWidth());
+
+ // plugins
+ for (uint i=0; i<KateFactory::self()->plugins().count(); i++)
+ {
+ if (config()->plugin (i))
+ loadPlugin (i);
+ else
+ unloadPlugin (i);
+ }
+}
+
+//BEGIN Variable reader
+// "local variable" feature by anders, 2003
+/* TODO
+ add config options (how many lines to read, on/off)
+ add interface for plugins/apps to set/get variables
+ add view stuff
+*/
+QRegExp KateDocument::kvLine = QRegExp("kate:(.*)");
+QRegExp KateDocument::kvLineWildcard = QRegExp("kate-wildcard\\((.*)\\):(.*)");
+QRegExp KateDocument::kvLineMime = QRegExp("kate-mimetype\\((.*)\\):(.*)");
+QRegExp KateDocument::kvVar = QRegExp("([\\w\\-]+)\\s+([^;]+)");
+
+void KateDocument::readVariables(bool onlyViewAndRenderer)
+{
+ if (!onlyViewAndRenderer)
+ m_config->configStart();
+
+ // views!
+ KateView *v;
+ for (v = m_views.first(); v != 0L; v= m_views.next() )
+ {
+ v->config()->configStart();
+ v->renderer()->config()->configStart();
+ }
+ // read a number of lines in the top/bottom of the document
+ for (uint i=0; i < kMin( 9U, numLines() ); ++i )
+ {
+ readVariableLine( textLine( i ), onlyViewAndRenderer );
+ }
+ if ( numLines() > 10 )
+ {
+ for ( uint i = kMax(10U, numLines() - 10); i < numLines(); ++i )
+ {
+ readVariableLine( textLine( i ), onlyViewAndRenderer );
+ }
+ }
+
+ if (!onlyViewAndRenderer)
+ m_config->configEnd();
+
+ for (v = m_views.first(); v != 0L; v= m_views.next() )
+ {
+ v->config()->configEnd();
+ v->renderer()->config()->configEnd();
+ }
+}
+
+void KateDocument::readVariableLine( QString t, bool onlyViewAndRenderer )
+{
+ // simple check first, no regex
+ // no kate inside, no vars, simple...
+ if (t.find("kate") < 0)
+ return;
+
+ // found vars, if any
+ QString s;
+
+ if ( kvLine.search( t ) > -1 )
+ {
+ s = kvLine.cap(1);
+
+ kdDebug (13020) << "normal variable line kate: matched: " << s << endl;
+ }
+ else if (kvLineWildcard.search( t ) > -1) // regex given
+ {
+ QStringList wildcards (QStringList::split(';', kvLineWildcard.cap(1)));
+ QString nameOfFile = url().fileName();
+
+ bool found = false;
+ for (QStringList::size_type i = 0; !found && i < wildcards.size(); ++i)
+ {
+ QRegExp wildcard (wildcards[i], true/*Qt::CaseSensitive*/, true/*QRegExp::Wildcard*/);
+
+ found = wildcard.exactMatch (nameOfFile);
+ }
+
+ // nothing usable found...
+ if (!found)
+ return;
+
+ s = kvLineWildcard.cap(2);
+
+ kdDebug (13020) << "guarded variable line kate-wildcard: matched: " << s << endl;
+ }
+ else if (kvLineMime.search( t ) > -1) // mime-type given
+ {
+ QStringList types (QStringList::split(';', kvLineMime.cap(1)));
+
+ // no matching type found
+ if (!types.contains (mimeType ()))
+ return;
+
+ s = kvLineMime.cap(2);
+
+ kdDebug (13020) << "guarded variable line kate-mimetype: matched: " << s << endl;
+ }
+ else // nothing found
+ {
+ return;
+ }
+
+ QStringList vvl; // view variable names
+ vvl << "dynamic-word-wrap" << "dynamic-word-wrap-indicators"
+ << "line-numbers" << "icon-border" << "folding-markers"
+ << "bookmark-sorting" << "auto-center-lines"
+ << "icon-bar-color"
+ // renderer
+ << "background-color" << "selection-color"
+ << "current-line-color" << "bracket-highlight-color"
+ << "word-wrap-marker-color"
+ << "font" << "font-size" << "scheme";
+ int p( 0 );
+
+ QString var, val;
+ while ( (p = kvVar.search( s, p )) > -1 )
+ {
+ p += kvVar.matchedLength();
+ var = kvVar.cap( 1 );
+ val = kvVar.cap( 2 ).stripWhiteSpace();
+ bool state; // store booleans here
+ int n; // store ints here
+
+ // only apply view & renderer config stuff
+ if (onlyViewAndRenderer)
+ {
+ if ( vvl.contains( var ) ) // FIXME define above
+ setViewVariable( var, val );
+ }
+ else
+ {
+ // BOOL SETTINGS
+ if ( var == "word-wrap" && checkBoolValue( val, &state ) )
+ setWordWrap( state ); // ??? FIXME CHECK
+ else if ( var == "block-selection" && checkBoolValue( val, &state ) )
+ setBlockSelectionMode( state );
+ // KateConfig::configFlags
+ // FIXME should this be optimized to only a few calls? how?
+ else if ( var == "backspace-indents" && checkBoolValue( val, &state ) )
+ m_config->setConfigFlags( KateDocumentConfig::cfBackspaceIndents, state );
+ else if ( var == "replace-tabs" && checkBoolValue( val, &state ) )
+ m_config->setConfigFlags( KateDocumentConfig::cfReplaceTabsDyn, state );
+ else if ( var == "remove-trailing-space" && checkBoolValue( val, &state ) )
+ m_config->setConfigFlags( KateDocumentConfig::cfRemoveTrailingDyn, state );
+ else if ( var == "wrap-cursor" && checkBoolValue( val, &state ) )
+ m_config->setConfigFlags( KateDocumentConfig::cfWrapCursor, state );
+ else if ( var == "auto-brackets" && checkBoolValue( val, &state ) )
+ m_config->setConfigFlags( KateDocumentConfig::cfAutoBrackets, state );
+ else if ( var == "overwrite-mode" && checkBoolValue( val, &state ) )
+ m_config->setConfigFlags( KateDocumentConfig::cfOvr, state );
+ else if ( var == "keep-indent-profile" && checkBoolValue( val, &state ) )
+ m_config->setConfigFlags( KateDocumentConfig::cfKeepIndentProfile, state );
+ else if ( var == "keep-extra-spaces" && checkBoolValue( val, &state ) )
+ m_config->setConfigFlags( KateDocumentConfig::cfKeepExtraSpaces, state );
+ else if ( var == "tab-indents" && checkBoolValue( val, &state ) )
+ m_config->setConfigFlags( KateDocumentConfig::cfTabIndents, state );
+ else if ( var == "show-tabs" && checkBoolValue( val, &state ) )
+ m_config->setConfigFlags( KateDocumentConfig::cfShowTabs, state );
+ else if ( var == "space-indent" && checkBoolValue( val, &state ) )
+ m_config->setConfigFlags( KateDocumentConfig::cfSpaceIndent, state );
+ else if ( var == "smart-home" && checkBoolValue( val, &state ) )
+ m_config->setConfigFlags( KateDocumentConfig::cfSmartHome, state );
+ else if ( var == "replace-trailing-space-save" && checkBoolValue( val, &state ) )
+ m_config->setConfigFlags( KateDocumentConfig::cfRemoveSpaces, state );
+ else if ( var == "auto-insert-doxygen" && checkBoolValue( val, &state) )
+ m_config->setConfigFlags( KateDocumentConfig::cfDoxygenAutoTyping, state);
+ else if ( var == "mixed-indent" && checkBoolValue( val, &state ) )
+ m_config->setConfigFlags( KateDocumentConfig::cfMixedIndent, state );
+
+ // INTEGER SETTINGS
+ else if ( var == "tab-width" && checkIntValue( val, &n ) )
+ m_config->setTabWidth( n );
+ else if ( var == "indent-width" && checkIntValue( val, &n ) )
+ m_config->setIndentationWidth( n );
+ else if ( var == "indent-mode" )
+ {
+ if ( checkIntValue( val, &n ) )
+ m_config->setIndentationMode( n );
+ else
+ m_config->setIndentationMode( KateAutoIndent::modeNumber( val) );
+ }
+ else if ( var == "word-wrap-column" && checkIntValue( val, &n ) && n > 0 ) // uint, but hard word wrap at 0 will be no fun ;)
+ m_config->setWordWrapAt( n );
+ else if ( var == "undo-steps" && checkIntValue( val, &n ) && n >= 0 )
+ setUndoSteps( n );
+
+ // STRING SETTINGS
+ else if ( var == "eol" || var == "end-of-line" )
+ {
+ QStringList l;
+ l << "unix" << "dos" << "mac";
+ if ( (n = l.findIndex( val.lower() )) != -1 )
+ m_config->setEol( n );
+ }
+ else if ( var == "encoding" )
+ m_config->setEncoding( val );
+ else if ( var == "syntax" || var == "hl" )
+ {
+ for ( uint i=0; i < hlModeCount(); i++ )
+ {
+ if ( hlModeName( i ).lower() == val.lower() )
+ {
+ setHlMode( i );
+ break;
+ }
+ }
+ }
+
+ // VIEW SETTINGS
+ else if ( vvl.contains( var ) )
+ setViewVariable( var, val );
+ else
+ {
+ m_storedVariables.insert( var, val );
+ emit variableChanged( var, val );
+ }
+ }
+ }
+}
+
+void KateDocument::setViewVariable( QString var, QString val )
+{
+ KateView *v;
+ bool state;
+ int n;
+ QColor c;
+ for (v = m_views.first(); v != 0L; v= m_views.next() )
+ {
+ if ( var == "dynamic-word-wrap" && checkBoolValue( val, &state ) )
+ v->config()->setDynWordWrap( state );
+ else if ( var == "persistent-selection" && checkBoolValue( val, &state ) )
+ v->config()->setPersistentSelection( state );
+ //else if ( var = "dynamic-word-wrap-indicators" )
+ else if ( var == "line-numbers" && checkBoolValue( val, &state ) )
+ v->config()->setLineNumbers( state );
+ else if (var == "icon-border" && checkBoolValue( val, &state ) )
+ v->config()->setIconBar( state );
+ else if (var == "folding-markers" && checkBoolValue( val, &state ) )
+ v->config()->setFoldingBar( state );
+ else if ( var == "auto-center-lines" && checkIntValue( val, &n ) )
+ v->config()->setAutoCenterLines( n ); // FIXME uint, > N ??
+ else if ( var == "icon-bar-color" && checkColorValue( val, c ) )
+ v->renderer()->config()->setIconBarColor( c );
+ // RENDERER
+ else if ( var == "background-color" && checkColorValue( val, c ) )
+ v->renderer()->config()->setBackgroundColor( c );
+ else if ( var == "selection-color" && checkColorValue( val, c ) )
+ v->renderer()->config()->setSelectionColor( c );
+ else if ( var == "current-line-color" && checkColorValue( val, c ) )
+ v->renderer()->config()->setHighlightedLineColor( c );
+ else if ( var == "bracket-highlight-color" && checkColorValue( val, c ) )
+ v->renderer()->config()->setHighlightedBracketColor( c );
+ else if ( var == "word-wrap-marker-color" && checkColorValue( val, c ) )
+ v->renderer()->config()->setWordWrapMarkerColor( c );
+ else if ( var == "font" || ( var == "font-size" && checkIntValue( val, &n ) ) )
+ {
+ QFont _f( *v->renderer()->config()->font( ) );
+
+ if ( var == "font" )
+ {
+ _f.setFamily( val );
+ _f.setFixedPitch( QFont( val ).fixedPitch() );
+ }
+ else
+ _f.setPointSize( n );
+
+ v->renderer()->config()->setFont( _f );
+ }
+ else if ( var == "scheme" )
+ {
+ v->renderer()->config()->setSchema( KateFactory::self()->schemaManager()->number( val ) );
+ }
+ }
+}
+
+bool KateDocument::checkBoolValue( QString val, bool *result )
+{
+ val = val.stripWhiteSpace().lower();
+ QStringList l;
+ l << "1" << "on" << "true";
+ if ( l.contains( val ) )
+ {
+ *result = true;
+ return true;
+ }
+ l.clear();
+ l << "0" << "off" << "false";
+ if ( l.contains( val ) )
+ {
+ *result = false;
+ return true;
+ }
+ return false;
+}
+
+bool KateDocument::checkIntValue( QString val, int *result )
+{
+ bool ret( false );
+ *result = val.toInt( &ret );
+ return ret;
+}
+
+bool KateDocument::checkColorValue( QString val, QColor &c )
+{
+ c.setNamedColor( val );
+ return c.isValid();
+}
+
+// KTextEditor::variable
+QString KateDocument::variable( const QString &name ) const
+{
+ if ( m_storedVariables.contains( name ) )
+ return m_storedVariables[ name ];
+
+ return "";
+}
+
+//END
+
+void KateDocument::slotModOnHdDirty (const QString &path)
+{
+ if ((path == m_dirWatchFile) && (!m_modOnHd || m_modOnHdReason != 1))
+ {
+ // compare md5 with the one we have (if we have one)
+ if ( ! m_digest.isEmpty() )
+ {
+ QCString tmp;
+ if ( createDigest( tmp ) && tmp == m_digest )
+ return;
+ }
+
+ m_modOnHd = true;
+ m_modOnHdReason = 1;
+
+ // reenable dialog if not running atm
+ if (m_isasking == -1)
+ m_isasking = false;
+
+ emit modifiedOnDisc (this, m_modOnHd, m_modOnHdReason);
+ }
+}
+
+void KateDocument::slotModOnHdCreated (const QString &path)
+{
+ if ((path == m_dirWatchFile) && (!m_modOnHd || m_modOnHdReason != 2))
+ {
+ m_modOnHd = true;
+ m_modOnHdReason = 2;
+
+ // reenable dialog if not running atm
+ if (m_isasking == -1)
+ m_isasking = false;
+
+ emit modifiedOnDisc (this, m_modOnHd, m_modOnHdReason);
+ }
+}
+
+void KateDocument::slotModOnHdDeleted (const QString &path)
+{
+ if ((path == m_dirWatchFile) && (!m_modOnHd || m_modOnHdReason != 3))
+ {
+ m_modOnHd = true;
+ m_modOnHdReason = 3;
+
+ // reenable dialog if not running atm
+ if (m_isasking == -1)
+ m_isasking = false;
+
+ emit modifiedOnDisc (this, m_modOnHd, m_modOnHdReason);
+ }
+}
+
+bool KateDocument::createDigest( QCString &result )
+{
+ bool ret = false;
+ result = "";
+ if ( url().isLocalFile() )
+ {
+ QFile f ( url().path() );
+ if ( f.open( IO_ReadOnly) )
+ {
+ KMD5 md5;
+ ret = md5.update( f );
+ md5.hexDigest( result );
+ f.close();
+ ret = true;
+ }
+ }
+ return ret;
+}
+
+QString KateDocument::reasonedMOHString() const
+{
+ switch( m_modOnHdReason )
+ {
+ case 1:
+ return i18n("The file '%1' was modified by another program.").arg( url().prettyURL() );
+ break;
+ case 2:
+ return i18n("The file '%1' was created by another program.").arg( url().prettyURL() );
+ break;
+ case 3:
+ return i18n("The file '%1' was deleted by another program.").arg( url().prettyURL() );
+ break;
+ default:
+ return QString();
+ }
+}
+
+void KateDocument::removeTrailingSpace( uint line )
+{
+ // remove trailing spaces from left line if required
+ if ( config()->configFlags() & KateDocumentConfig::cfRemoveTrailingDyn )
+ {
+ KateTextLine::Ptr ln = kateTextLine( line );
+
+ if ( ! ln ) return;
+
+ if ( line == activeView()->cursorLine()
+ && activeView()->cursorColumnReal() >= (uint)kMax(0,ln->lastChar()) )
+ return;
+
+ if ( ln->length() )
+ {
+ uint p = ln->lastChar() + 1;
+ uint l = ln->length() - p;
+ if ( l )
+ editRemoveText( line, p, l);
+ }
+ }
+}
+
+void KateDocument::updateFileType (int newType, bool user)
+{
+ if (user || !m_fileTypeSetByUser)
+ {
+ const KateFileType *t = 0;
+ if ((newType == -1) || (t = KateFactory::self()->fileTypeManager()->fileType (newType)))
+ {
+ m_fileType = newType;
+
+ if (t)
+ {
+ m_config->configStart();
+ // views!
+ KateView *v;
+ for (v = m_views.first(); v != 0L; v= m_views.next() )
+ {
+ v->config()->configStart();
+ v->renderer()->config()->configStart();
+ }
+
+ readVariableLine( t->varLine );
+
+ m_config->configEnd();
+ for (v = m_views.first(); v != 0L; v= m_views.next() )
+ {
+ v->config()->configEnd();
+ v->renderer()->config()->configEnd();
+ }
+ }
+ }
+ }
+}
+
+uint KateDocument::documentNumber () const
+{
+ return KTextEditor::Document::documentNumber ();
+}
+
+
+
+
+void KateDocument::slotQueryClose_save(bool *handled, bool* abortClosing) {
+ *handled=true;
+ *abortClosing=true;
+ if (m_url.isEmpty())
+ {
+ KEncodingFileDialog::Result res=KEncodingFileDialog::getSaveURLAndEncoding(config()->encoding(),
+ QString::null,QString::null,0,i18n("Save File"));
+
+ if( res.URLs.isEmpty() || !checkOverwrite( res.URLs.first() ) ) {
+ *abortClosing=true;
+ return;
+ }
+ setEncoding( res.encoding );
+ saveAs( res.URLs.first() );
+ *abortClosing=false;
+ }
+ else
+ {
+ save();
+ *abortClosing=false;
+ }
+
+}
+
+bool KateDocument::checkOverwrite( KURL u )
+{
+ if( !u.isLocalFile() )
+ return true;
+
+ QFileInfo info( u.path() );
+ if( !info.exists() )
+ return true;
+
+ return KMessageBox::Cancel != KMessageBox::warningContinueCancel( 0,
+ i18n( "A file named \"%1\" already exists. "
+ "Are you sure you want to overwrite it?" ).arg( info.fileName() ),
+ i18n( "Overwrite File?" ),
+ i18n( "&Overwrite" ) );
+}
+
+void KateDocument::setDefaultEncoding (const QString &encoding)
+{
+ s_defaultEncoding = encoding;
+}
+
+//BEGIN KTextEditor::TemplateInterface
+bool KateDocument::insertTemplateTextImplementation ( uint line, uint column, const QString &templateString, const QMap<QString,QString> &initialValues, QWidget *) {
+ return (new KateTemplateHandler(this,line,column,templateString,initialValues))->initOk();
+}
+
+void KateDocument::testTemplateCode() {
+ int col=activeView()->cursorColumn();
+ int line=activeView()->cursorLine();
+ insertTemplateText(line,col,"for ${index} \\${NOPLACEHOLDER} ${index} ${blah} ${fullname} \\$${Placeholder} \\${${PLACEHOLDER2}}\n next line:${ANOTHERPLACEHOLDER} $${DOLLARBEFOREPLACEHOLDER} {NOTHING} {\n${cursor}\n}",QMap<QString,QString>());
+}
+
+bool KateDocument::invokeTabInterceptor(KKey key) {
+ if (m_tabInterceptor) return (*m_tabInterceptor)(key);
+ return false;
+}
+
+bool KateDocument::setTabInterceptor(KateKeyInterceptorFunctor *interceptor) {
+ if (m_tabInterceptor) return false;
+ m_tabInterceptor=interceptor;
+ return true;
+}
+
+bool KateDocument::removeTabInterceptor(KateKeyInterceptorFunctor *interceptor) {
+ if (m_tabInterceptor!=interceptor) return false;
+ m_tabInterceptor=0;
+ return true;
+}
+//END KTextEditor::TemplateInterface
+
+//BEGIN DEPRECATED STUFF
+ bool KateDocument::setSelection ( uint startLine, uint startCol, uint endLine, uint endCol )
+{ if (m_activeView) return m_activeView->setSelection (startLine, startCol, endLine, endCol); return false; }
+
+ bool KateDocument::clearSelection ()
+ { if (m_activeView) return m_activeView->clearSelection(); return false; }
+
+ bool KateDocument::hasSelection () const
+ { if (m_activeView) return m_activeView->hasSelection (); return false; }
+
+ QString KateDocument::selection () const
+ { if (m_activeView) return m_activeView->selection (); return QString(""); }
+
+ bool KateDocument::removeSelectedText ()
+ { if (m_activeView) return m_activeView->removeSelectedText (); return false; }
+
+ bool KateDocument::selectAll()
+ { if (m_activeView) return m_activeView->selectAll (); return false; }
+
+ int KateDocument::selStartLine()
+ { if (m_activeView) return m_activeView->selStartLine (); return 0; }
+
+ int KateDocument::selStartCol()
+ { if (m_activeView) return m_activeView->selStartCol (); return 0; }
+
+ int KateDocument::selEndLine()
+ { if (m_activeView) return m_activeView->selEndLine (); return 0; }
+
+ int KateDocument::selEndCol()
+ { if (m_activeView) return m_activeView->selEndCol (); return 0; }
+
+ bool KateDocument::blockSelectionMode ()
+ { if (m_activeView) return m_activeView->blockSelectionMode (); return false; }
+
+bool KateDocument::setBlockSelectionMode (bool on)
+ { if (m_activeView) return m_activeView->setBlockSelectionMode (on); return false; }
+
+bool KateDocument::toggleBlockSelectionMode ()
+ { if (m_activeView) return m_activeView->toggleBlockSelectionMode (); return false; }
+//END DEPRECATED
+
+//END DEPRECATED STUFF
+
+// kate: space-indent on; indent-width 2; replace-tabs on;
diff --git a/kate/part/katedocument.h b/kate/part/katedocument.h
new file mode 100644
index 000000000..c1c5ab169
--- /dev/null
+++ b/kate/part/katedocument.h
@@ -0,0 +1,1073 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2001-2004 Christoph Cullmann <cullmann@kde.org>
+ Copyright (C) 2001 Joseph Wenninger <jowenn@kde.org>
+ Copyright (C) 1999 Jochen Wilhelmy <digisnap@cs.tu-berlin.de>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef _KATE_DOCUMENT_H_
+#define _KATE_DOCUMENT_H_
+
+#include "katesupercursor.h"
+#include "katetextline.h"
+#include "kateundo.h"
+#include "katebuffer.h"
+#include "katecodefoldinghelpers.h"
+
+#include "../interfaces/document.h"
+
+#include <ktexteditor/configinterfaceextension.h>
+#include <ktexteditor/encodinginterface.h>
+#include <ktexteditor/sessionconfiginterface.h>
+#include <ktexteditor/editinterfaceext.h>
+#include <ktexteditor/templateinterface.h>
+
+#include <dcopobject.h>
+
+#include <kmimetype.h>
+#include <klocale.h>
+
+#include <qintdict.h>
+#include <qmap.h>
+#include <qdatetime.h>
+
+namespace KTextEditor { class Plugin; }
+
+namespace KIO { class TransferJob; }
+
+class KateUndoGroup;
+class KateCmd;
+class KateAttribute;
+class KateAutoIndent;
+class KateCodeFoldingTree;
+class KateBuffer;
+class KateView;
+class KateViewInternal;
+class KateArbitraryHighlight;
+class KateSuperRange;
+class KateLineInfo;
+class KateBrowserExtension;
+class KateDocumentConfig;
+class KateHighlighting;
+class KatePartPluginItem;
+class KatePartPluginInfo;
+
+class KTempFile;
+
+class QTimer;
+
+class KateKeyInterceptorFunctor;
+
+//
+// Kate KTextEditor::Document class (and even KTextEditor::Editor ;)
+//
+class KateDocument : public Kate::Document,
+ public Kate::DocumentExt,
+ public KTextEditor::ConfigInterfaceExtension,
+ public KTextEditor::EncodingInterface,
+ public KTextEditor::SessionConfigInterface,
+ public KTextEditor::EditInterfaceExt,
+ public KTextEditor::TemplateInterface,
+ public DCOPObject
+{
+ K_DCOP
+ Q_OBJECT
+
+ friend class KateViewInternal;
+ friend class KateRenderer;
+
+ public:
+ KateDocument (bool bSingleViewMode=false, bool bBrowserView=false, bool bReadOnly=false,
+ QWidget *parentWidget = 0, const char *widgetName = 0, QObject * = 0, const char * = 0);
+ ~KateDocument ();
+
+ bool closeURL();
+
+ //
+ // Plugins section
+ //
+ public:
+ void unloadAllPlugins ();
+
+ void enableAllPluginsGUI (KateView *view);
+ void disableAllPluginsGUI (KateView *view);
+
+ void loadPlugin (uint pluginIndex);
+ void unloadPlugin (uint pluginIndex);
+
+ void enablePluginGUI (KTextEditor::Plugin *plugin, KateView *view);
+ void enablePluginGUI (KTextEditor::Plugin *plugin);
+
+ void disablePluginGUI (KTextEditor::Plugin *plugin, KateView *view);
+ void disablePluginGUI (KTextEditor::Plugin *plugin);
+
+ private:
+ QMemArray<KTextEditor::Plugin *> m_plugins;
+
+ public:
+ bool readOnly () const { return m_bReadOnly; }
+ bool browserView () const { return m_bBrowserView; }
+ bool singleViewMode () const { return m_bSingleViewMode; }
+ KateBrowserExtension *browserExtension () { return m_extension; }
+
+ private:
+ // only to make part work, don't change it !
+ bool m_bSingleViewMode;
+ bool m_bBrowserView;
+ bool m_bReadOnly;
+ KateBrowserExtension *m_extension;
+
+ //
+ // KTextEditor::Document stuff
+ //
+ public:
+ KTextEditor::View *createView( QWidget *parent, const char *name );
+ QPtrList<KTextEditor::View> views () const;
+
+ inline KateView *activeView () const { return m_activeView; }
+
+ private:
+ QPtrList<KateView> m_views;
+ QPtrList<KTextEditor::View> m_textEditViews;
+ KateView *m_activeView;
+
+ /**
+ * set the active view.
+ *
+ * If @p view is allready the active view, nothing is done.
+ *
+ * If the document is modified on disk, ask the user what to do.
+ *
+ * @since Kate 2.4
+ */
+ void setActiveView( KateView *view );
+
+ //
+ // KTextEditor::ConfigInterfaceExtension stuff
+ //
+ public slots:
+ uint configPages () const;
+ KTextEditor::ConfigPage *configPage (uint number = 0, QWidget *parent = 0, const char *name=0 );
+ QString configPageName (uint number = 0) const;
+ QString configPageFullName (uint number = 0) const;
+ QPixmap configPagePixmap (uint number = 0, int size = KIcon::SizeSmall) const;
+
+ //
+ // KTextEditor::EditInterface stuff
+ //
+ public slots:
+ QString text() const;
+
+ QString text ( uint startLine, uint startCol, uint endLine, uint endCol ) const;
+ QString text ( uint startLine, uint startCol, uint endLine, uint endCol, bool blockwise ) const;
+
+ QString textLine ( uint line ) const;
+
+ bool setText(const QString &);
+ bool clear ();
+
+ bool insertText ( uint line, uint col, const QString &s );
+ bool insertText ( uint line, uint col, const QString &s, bool blockwise );
+
+ bool removeText ( uint startLine, uint startCol, uint endLine, uint endCol );
+ bool removeText ( uint startLine, uint startCol, uint endLine, uint endCol, bool blockwise );
+
+ bool insertLine ( uint line, const QString &s );
+ bool removeLine ( uint line );
+
+ uint numLines() const;
+ uint numVisLines() const;
+ uint length () const;
+ int lineLength ( uint line ) const;
+
+ signals:
+ void textChanged ();
+ void charactersInteractivelyInserted(int ,int ,const QString&);
+ void charactersSemiInteractivelyInserted(int ,int ,const QString&);
+ void backspacePressed();
+
+ public:
+//BEGIN editStart/editEnd (start, end, undo, cursor update, view update)
+ /**
+ * Enclose editor actions with @p editStart() and @p editEnd() to group
+ * them.
+ * @param withUndo if true, add undo history
+ */
+ void editStart (bool withUndo = true);
+ /** Same as editStart() with undo */
+ void editBegin () { editStart(); }
+ /**
+ * End a editor operation.
+ * @see editStart()
+ */
+ void editEnd ();
+ private:
+ bool m_isInUndo; ///< set to true in undo/redo
+
+//END editStart/editEnd
+
+//BEGIN LINE BASED INSERT/REMOVE STUFF (editStart() and editEnd() included)
+ public:
+ /**
+ * Add a string in the given line/column
+ * @param line line number
+ * @param col column
+ * @param s string to be inserted
+ * @return true on success
+ */
+ bool editInsertText ( uint line, uint col, const QString &s );
+ /**
+ * Remove a string in the given line/column
+ * @param line line number
+ * @param col column
+ * @param len length of text to be removed
+ * @return true on success
+ */
+ bool editRemoveText ( uint line, uint col, uint len );
+
+ /**
+ * Mark @p line as @p autowrapped. This is necessary if static word warp is
+ * enabled, because we have to know whether to insert a new line or add the
+ * wrapped words to the followin line.
+ * @param line line number
+ * @param autowrapped autowrapped?
+ * @return true on success
+ */
+ bool editMarkLineAutoWrapped ( uint line, bool autowrapped );
+
+ /**
+ * Wrap @p line. If @p newLine is true, ignore the textline's flag
+ * KateTextLine::flagAutoWrapped and force a new line. Whether a new line
+ * was needed/added you can grab with @p newLineAdded.
+ * @param line line number
+ * @param col column
+ * @param newLine if true, force a new line
+ * @param newLineAdded return value is true, if new line was added (may be 0)
+ * @return true on success
+ */
+ bool editWrapLine ( uint line, uint col, bool newLine = true, bool *newLineAdded = 0 );
+ /**
+ * Unwrap @p line. If @p removeLine is true, we force to join the lines. If
+ * @p removeLine is true, @p length is ignored (eg not needed).
+ * @param line line number
+ * @param removeLine if true, force to remove the next line
+ * @param length length of the line
+ * @return true on success
+ */
+ bool editUnWrapLine ( uint line, bool removeLine = true, uint length = 0 );
+
+ /**
+ * Insert a string at the given line.
+ * @param line line number
+ * @param s string to insert
+ * @return true on success
+ */
+ bool editInsertLine ( uint line, const QString &s );
+ /**
+ * Remove a line
+ * @param line line number
+ * @return true on success
+ */
+ bool editRemoveLine ( uint line );
+
+ /**
+ * Remove a line
+ * @param startLine line to begin wrapping
+ * @param endLine line to stop wrapping
+ * @return true on success
+ */
+ bool wrapText (uint startLine, uint endLine);
+//END LINE BASED INSERT/REMOVE STUFF
+
+ signals:
+ /**
+ * Emitted each time text is inserted into a pre-existing line, including appends.
+ * Does not include newly inserted lines at the moment. ### needed?
+ */
+ void editTextInserted ( uint line, uint col, uint len);
+
+ /**
+ * Emitted each time text is removed from a line, including truncates and space removal.
+ */
+ void editTextRemoved ( uint line, uint col, uint len);
+
+ /**
+ * Emmitted when text from @p line was wrapped at position pos onto line @p nextLine.
+ */
+ void editLineWrapped ( uint line, uint col, uint len );
+
+ /**
+ * Emitted each time text from @p nextLine was upwrapped onto @p line.
+ */
+ void editLineUnWrapped ( uint line, uint col );
+
+ /**
+ * Emitted whenever a line is inserted before @p line, becoming itself line @ line.
+ */
+ void editLineInserted ( uint line );
+
+ /**
+ * Emitted when a line is deleted.
+ */
+ void editLineRemoved ( uint line );
+
+ private:
+ void undoStart();
+ void undoEnd();
+ void undoSafePoint();
+
+ private slots:
+ void undoCancel();
+
+ private:
+ void editAddUndo (KateUndoGroup::UndoType type, uint line, uint col, uint len, const QString &text);
+
+ uint editSessionNumber;
+ bool editIsRunning;
+ bool editWithUndo;
+ bool m_undoComplexMerge;
+ KateUndoGroup* m_editCurrentUndo;
+
+ //
+ // KTextEditor::UndoInterface stuff
+ //
+ public slots:
+ void undo ();
+ void redo ();
+ void clearUndo ();
+ void clearRedo ();
+
+ uint undoCount () const;
+ uint redoCount () const;
+
+ uint undoSteps () const;
+ void setUndoSteps ( uint steps );
+
+ private:
+ friend class KateTemplateHandler;
+
+ private:
+ QPtrList<KateSuperCursor> m_superCursors;
+
+ //
+ // some internals for undo/redo
+ //
+ QPtrList<KateUndoGroup> undoItems;
+ QPtrList<KateUndoGroup> redoItems;
+ bool m_undoDontMerge; //create a setter later on and remove the friend declaration
+ bool m_undoIgnoreCancel;
+ QTimer* m_undoMergeTimer;
+ // these two variables are for resetting the document to
+ // non-modified if all changes have been undone...
+ KateUndoGroup* lastUndoGroupWhenSaved;
+ KateUndoGroup* lastRedoGroupWhenSaved;
+ bool docWasSavedWhenUndoWasEmpty;
+ bool docWasSavedWhenRedoWasEmpty;
+
+ // this sets
+ void updateModified();
+
+ signals:
+ void undoChanged ();
+ void textInserted(int line,int column);
+
+ //
+ // KTextEditor::CursorInterface stuff
+ //
+ public slots:
+ KTextEditor::Cursor *createCursor ();
+ QPtrList<KTextEditor::Cursor> cursors () const;
+
+ private:
+ QPtrList<KTextEditor::Cursor> myCursors;
+
+ //
+ // KTextEditor::SearchInterface stuff
+ //
+ public slots:
+ bool searchText (unsigned int startLine, unsigned int startCol,
+ const QString &text, unsigned int *foundAtLine, unsigned int *foundAtCol,
+ unsigned int *matchLen, bool casesensitive = true, bool backwards = false);
+ bool searchText (unsigned int startLine, unsigned int startCol,
+ const QRegExp &regexp, unsigned int *foundAtLine, unsigned int *foundAtCol,
+ unsigned int *matchLen, bool backwards = false);
+
+ //
+ // KTextEditor::HighlightingInterface stuff
+ //
+ public slots:
+ uint hlMode ();
+ bool setHlMode (uint mode);
+ uint hlModeCount ();
+ QString hlModeName (uint mode);
+ QString hlModeSectionName (uint mode);
+
+ public:
+ void bufferHlChanged ();
+
+ private:
+ void setDontChangeHlOnSave();
+
+ signals:
+ void hlChanged ();
+
+ //
+ // Kate::ArbitraryHighlightingInterface stuff
+ //
+ public:
+ KateArbitraryHighlight* arbitraryHL() const { return m_arbitraryHL; };
+
+ private slots:
+ void tagArbitraryLines(KateView* view, KateSuperRange* range);
+
+ //
+ // KTextEditor::ConfigInterface stuff
+ //
+ public slots:
+ void readConfig ();
+ void writeConfig ();
+ void readConfig (KConfig *);
+ void writeConfig (KConfig *);
+ void readSessionConfig (KConfig *);
+ void writeSessionConfig (KConfig *);
+ void configDialog ();
+
+ //
+ // KTextEditor::MarkInterface and MarkInterfaceExtension
+ //
+ public slots:
+ uint mark( uint line );
+
+ void setMark( uint line, uint markType );
+ void clearMark( uint line );
+
+ void addMark( uint line, uint markType );
+ void removeMark( uint line, uint markType );
+
+ QPtrList<KTextEditor::Mark> marks();
+ void clearMarks();
+
+ void setPixmap( MarkInterface::MarkTypes, const QPixmap& );
+ void setDescription( MarkInterface::MarkTypes, const QString& );
+ QString markDescription( MarkInterface::MarkTypes );
+ QPixmap *markPixmap( MarkInterface::MarkTypes );
+ QColor markColor( MarkInterface::MarkTypes );
+
+ void setMarksUserChangable( uint markMask );
+ uint editableMarks();
+
+ signals:
+ void marksChanged();
+ void markChanged( KTextEditor::Mark, KTextEditor::MarkInterfaceExtension::MarkChangeAction );
+
+ private:
+ QIntDict<KTextEditor::Mark> m_marks;
+ QIntDict<QPixmap> m_markPixmaps;
+ QIntDict<QString> m_markDescriptions;
+ uint m_editableMarks;
+
+ //
+ // KTextEditor::PrintInterface
+ //
+ public slots:
+ bool printDialog ();
+ bool print ();
+
+ //
+ // KTextEditor::DocumentInfoInterface ( ### unfinished )
+ //
+ public:
+ /**
+ * @return the name of the mimetype for the document.
+ *
+ * This method is using KMimeType::findByURL, and if the pointer
+ * is then still the default MimeType for a nonlocal or unsaved file,
+ * uses mimeTypeForContent().
+ *
+ * @since Kate 2.3
+ */
+ QString mimeType();
+
+ /**
+ * @return the calculated size in bytes that the document would have when saved to
+ * disk.
+ *
+ * @since Kate 2.3
+ * @todo implement this (it returns 0 right now)
+ */
+ long fileSize();
+
+ /**
+ * @return the calculated size the document would have when saved to disk
+ * as a human readable string.
+ *
+ * @since Kate 2.3
+ * @todo implement this (it returns "UNKNOWN")
+ */
+ QString niceFileSize();
+
+ /**
+ * @return a pointer to the KMimeType for this document, found by analyzing the
+ * actual content.
+ *
+ * Note that this method is *not* part of the DocumentInfoInterface.
+ *
+ * @since Kate 2.3
+ */
+ KMimeType::Ptr mimeTypeForContent();
+
+ //
+ // KTextEditor::VariableInterface
+ //
+ public:
+ QString variable( const QString &name ) const;
+
+ signals:
+ void variableChanged( const QString &, const QString & );
+
+ private:
+ QMap<QString, QString> m_storedVariables;
+
+ //
+ // KParts::ReadWrite stuff
+ //
+ public:
+ bool openURL( const KURL &url );
+
+ /* Anders:
+ I reimplemented this, since i need to check if backup succeeded
+ if requested */
+ bool save();
+
+ /* Anders: Reimplemented to do kate specific stuff */
+ bool saveAs( const KURL &url );
+
+ bool openFile (KIO::Job * job);
+ bool openFile ();
+
+ bool saveFile ();
+
+ void setReadWrite ( bool readwrite = true );
+
+ void setModified( bool m );
+
+ private slots:
+ void slotDataKate ( KIO::Job* kio_job, const QByteArray &data );
+ void slotFinishedKate ( KIO::Job * job );
+
+ private:
+ void abortLoadKate();
+
+ void activateDirWatch ();
+ void deactivateDirWatch ();
+
+ QString m_dirWatchFile;
+
+ //
+ // Kate::Document stuff, this is all deprecated!!!!!!!!!!
+ //
+ public:
+ Kate::ConfigPage *colorConfigPage (QWidget *) { return 0; }
+ Kate::ConfigPage *fontConfigPage (QWidget *) { return 0; }
+ Kate::ConfigPage *indentConfigPage (QWidget *) { return 0; }
+ Kate::ConfigPage *selectConfigPage (QWidget *) { return 0; }
+ Kate::ConfigPage *editConfigPage (QWidget *) { return 0; }
+ Kate::ConfigPage *keysConfigPage (QWidget *) { return 0; }
+ Kate::ConfigPage *hlConfigPage (QWidget *) { return 0; }
+ Kate::ConfigPage *viewDefaultsConfigPage (QWidget *) { return 0; }
+ Kate::ConfigPage *saveConfigPage( QWidget * ) { return 0; }
+
+ Kate::ActionMenu *hlActionMenu (const QString& /* text */, QObject* /* parent */ = 0, const char* /* name */ = 0) { return 0; }
+ Kate::ActionMenu *exportActionMenu (const QString& /* text */, QObject* /* parent */ = 0, const char* /* name */ = 0) { return 0; }
+
+ public:
+ /**
+ * Type chars in a view
+ */
+ bool typeChars ( KateView *type, const QString &chars );
+
+ /**
+ * gets the last line number (numLines() -1)
+ */
+ inline uint lastLine() const { return numLines()-1; }
+
+ uint configFlags ();
+ void setConfigFlags (uint flags);
+
+ // Repaint all of all of the views
+ void repaintViews(bool paintOnlyDirty = true);
+
+ inline KateHighlighting *highlight () { return m_buffer->highlight(); }
+
+ inline KateHighlighting *highlight () const { return m_buffer->highlight(); }
+
+ public slots: //please keep prototypes and implementations in same order
+ void tagLines(int start, int end);
+ void tagLines(KateTextCursor start, KateTextCursor end);
+
+ //export feature, obsolute
+ public slots:
+ void exportAs(const QString&) { };
+
+ signals:
+ void modifiedChanged ();
+ void preHighlightChanged(uint);
+
+ private slots:
+ void internalHlChanged();
+
+ public:
+ void addView(KTextEditor::View *);
+ void removeView(KTextEditor::View *);
+
+ void addSuperCursor(class KateSuperCursor *, bool privateC);
+ void removeSuperCursor(class KateSuperCursor *, bool privateC);
+
+ bool ownedView(KateView *);
+ bool isLastView(int numViews);
+
+ uint currentColumn( const KateTextCursor& );
+ void newLine( KateTextCursor&, KateViewInternal * ); // Changes input
+ void backspace( KateView *view, const KateTextCursor& );
+ void del( KateView *view, const KateTextCursor& );
+ void transpose( const KateTextCursor& );
+
+ void paste ( KateView* view );
+
+ public:
+ void insertIndentChars ( KateView *view );
+
+ void indent ( KateView *view, uint line, int change );
+ void comment ( KateView *view, uint line, uint column, int change );
+ void align ( KateView *view, uint line );
+
+ enum TextTransform { Uppercase, Lowercase, Capitalize };
+
+ /**
+ Handling uppercase, lowercase and capitalize for the view.
+
+ If there is a selection, that is transformed, otherwise for uppercase or
+ lowercase the character right of the cursor is transformed, for capitalize
+ the word under the cursor is transformed.
+ */
+ void transform ( KateView *view, const KateTextCursor &, TextTransform );
+ /**
+ Unwrap a range of lines.
+ */
+ void joinLines( uint first, uint last );
+
+ private:
+ void optimizeLeadingSpace( uint line, int flags, int change );
+ void replaceWithOptimizedSpace( uint line, uint upto_column, uint space, int flags );
+
+ bool removeStringFromBegining(int line, QString &str);
+ bool removeStringFromEnd(int line, QString &str);
+
+ /**
+ Find the position (line and col) of the next char
+ that is not a space. If found line and col point to the found character.
+ Otherwise they have both the value -1.
+ @param line Line of the character which is examined first.
+ @param col Column of the character which is examined first.
+ @return True if the specified or a following character is not a space
+ Otherwise false.
+ */
+ bool nextNonSpaceCharPos(int &line, int &col);
+
+ /**
+ Find the position (line and col) of the previous char
+ that is not a space. If found line and col point to the found character.
+ Otherwise they have both the value -1.
+ @return True if the specified or a preceding character is not a space.
+ Otherwise false.
+ */
+ bool previousNonSpaceCharPos(int &line, int &col);
+
+ /**
+ * Sets a comment marker as defined by the language providing the attribute
+ * @p attrib on the line @p line
+ */
+ void addStartLineCommentToSingleLine(int line, int attrib=0);
+ /**
+ * Removes a comment marker as defined by the language providing the attribute
+ * @p attrib on the line @p line
+ */
+ bool removeStartLineCommentFromSingleLine(int line, int attrib=0);
+
+ /**
+ * @see addStartLineCommentToSingleLine.
+ */
+ void addStartStopCommentToSingleLine(int line, int attrib=0);
+ /**
+ *@see removeStartLineCommentFromSingleLine.
+ */
+ bool removeStartStopCommentFromSingleLine(int line, int attrib=0);
+ /**
+ *@see removeStartLineCommentFromSingleLine.
+ */
+ bool removeStartStopCommentFromRegion(const KateTextCursor &start, const KateTextCursor &end, int attrib=0);
+
+ /**
+ * Add a comment marker as defined by the language providing the attribute
+ * @p attrib to each line in the selection.
+ */
+ void addStartStopCommentToSelection( KateView *view, int attrib=0 );
+ /**
+ * @see addStartStopCommentToSelection.
+ */
+ void addStartLineCommentToSelection( KateView *view, int attrib=0 );
+
+ /**
+ * Removes comment markers relevant to the language providing
+ * the attribuge @p attrib from each line in the selection.
+ *
+ * @return whether the operation succeded.
+ */
+ bool removeStartStopCommentFromSelection( KateView *view, int attrib=0 );
+ /**
+ * @see removeStartStopCommentFromSelection.
+ */
+ bool removeStartLineCommentFromSelection( KateView *view, int attrib=0 );
+
+ public:
+ QString getWord( const KateTextCursor& cursor );
+
+ public:
+ void tagAll();
+
+ void newBracketMark( const KateTextCursor& start, KateBracketRange& bm, int maxLines = -1 );
+ bool findMatchingBracket( KateTextCursor& start, KateTextCursor& end, int maxLines = -1 );
+
+ private:
+ void guiActivateEvent( KParts::GUIActivateEvent *ev );
+
+ public:
+
+ QString docName () {return m_docName;};
+
+ void setDocName (QString docName);
+
+ void lineInfo (KateLineInfo *info, unsigned int line);
+
+ KateCodeFoldingTree *foldingTree ();
+
+ public:
+ /**
+ * @return wheather the document is modified on disc since last saved.
+ *
+ * @since 3.3
+ */
+ bool isModifiedOnDisc() { return m_modOnHd; };
+
+ /** @deprecated */
+ void isModOnHD( bool =false ) {};
+
+ void setModifiedOnDisk( int reason );
+
+ public slots:
+ /**
+ * Ask the user what to do, if the file has been modified on disc.
+ * Reimplemented from Kate::Document.
+ *
+ * @since 3.3
+ */
+ void slotModifiedOnDisk( Kate::View *v=0 );
+
+ /**
+ * Reloads the current document from disc if possible
+ */
+ void reloadFile();
+
+ private:
+ int m_isasking; // don't reenter slotModifiedOnDisk when this is true
+ // -1: ignore once, 0: false, 1: true
+
+ public slots:
+ void setEncoding (const QString &e);
+ QString encoding() const;
+
+ public slots:
+ void setWordWrap (bool on);
+ bool wordWrap ();
+
+ void setWordWrapAt (uint col);
+ uint wordWrapAt ();
+
+ public slots:
+ void setPageUpDownMovesCursor(bool on);
+ bool pageUpDownMovesCursor();
+
+ signals:
+ void modStateChanged (Kate::Document *doc);
+ void nameChanged (Kate::Document *doc);
+
+ public slots:
+ // clear buffer/filename - update the views
+ void flush ();
+
+ signals:
+ /**
+ * The file has been saved (perhaps the name has changed). The main window
+ * can use this to change its caption
+ */
+ void fileNameChanged ();
+
+ public slots:
+ void applyWordWrap ();
+
+ // code folding
+ public:
+ inline uint getRealLine(unsigned int virtualLine)
+ {
+ return m_buffer->lineNumber (virtualLine);
+ }
+
+ inline uint getVirtualLine(unsigned int realLine)
+ {
+ return m_buffer->lineVisibleNumber (realLine);
+ }
+
+ inline uint visibleLines ()
+ {
+ return m_buffer->countVisible ();
+ }
+
+ inline KateTextLine::Ptr kateTextLine(uint i)
+ {
+ return m_buffer->line (i);
+ }
+
+ inline KateTextLine::Ptr plainKateTextLine(uint i)
+ {
+ return m_buffer->plainLine (i);
+ }
+
+ signals:
+ void codeFoldingUpdated();
+ void aboutToRemoveText(const KateTextRange&);
+ void textRemoved();
+
+ private slots:
+ void slotModOnHdDirty (const QString &path);
+ void slotModOnHdCreated (const QString &path);
+ void slotModOnHdDeleted (const QString &path);
+
+ private:
+ /**
+ * create a MD5 digest of the file, if it is a local file,
+ * and fill it into the string @p result.
+ * This is using KMD5::hexDigest().
+ *
+ * @return wheather the operation was attempted and succeded.
+ *
+ * @since 3.3
+ */
+ bool createDigest ( QCString &result );
+
+ /**
+ * create a string for the modonhd warnings, giving the reason.
+ *
+ * @since 3.3
+ */
+ QString reasonedMOHString() const;
+
+ /**
+ * Removes all trailing whitespace form @p line, if
+ * the cfRemoveTrailingDyn confg flag is set,
+ * and the active view cursor is not on line and behind
+ * the last nonspace character.
+ *
+ * @since 3.3
+ */
+ void removeTrailingSpace( uint line );
+
+ public:
+ void updateFileType (int newType, bool user = false);
+
+ int fileType () const { return m_fileType; };
+
+ //
+ // REALLY internal data ;)
+ //
+ private:
+ // text buffer
+ KateBuffer *m_buffer;
+
+ KateArbitraryHighlight* m_arbitraryHL;
+
+ KateAutoIndent *m_indenter;
+
+ bool hlSetByUser;
+
+ bool m_modOnHd;
+ unsigned char m_modOnHdReason;
+ QCString m_digest; // MD5 digest, updated on load/save
+
+ QString m_docName;
+ int m_docNameNumber;
+
+ // file type !!!
+ int m_fileType;
+ bool m_fileTypeSetByUser;
+
+ /**
+ * document is still reloading a file
+ */
+ bool m_reloading;
+ bool m_loading; ///< true in openFile() untill the data is read.
+ bool m_encodingSticky; ///< true when requests to set encoding should be ignored.
+
+ public slots:
+ void slotQueryClose_save(bool *handled, bool* abortClosing);
+
+ public:
+ void makeAttribs (bool needInvalidate = true);
+
+ static bool checkOverwrite( KURL u );
+
+ static void setDefaultEncoding (const QString &encoding);
+
+ void setEncodingSticky( bool e ) { m_encodingSticky = e; }
+
+ /**
+ * Configuration
+ */
+ public:
+ inline KateDocumentConfig *config () { return m_config; };
+
+ void updateConfig ();
+
+ private:
+ KateDocumentConfig *m_config;
+
+ /**
+ * Variable Reader
+ * TODO add register functionality/ktexteditor interface
+ */
+ private:
+ /**
+ * read dir config file
+ */
+ void readDirConfig ();
+
+ /**
+ Reads all the variables in the document.
+ Called when opening/saving a document
+ */
+ void readVariables(bool onlyViewAndRenderer = false);
+
+ /**
+ Reads and applies the variables in a single line
+ TODO registered variables gets saved in a [map]
+ */
+ void readVariableLine( QString t, bool onlyViewAndRenderer = false );
+ /**
+ Sets a view variable in all the views.
+ */
+ void setViewVariable( QString var, QString val );
+ /**
+ @return weather a string value could be converted
+ to a bool value as supported.
+ The value is put in *result.
+ */
+ static bool checkBoolValue( QString value, bool *result );
+ /**
+ @return weather a string value could be converted
+ to a integer value.
+ The value is put in *result.
+ */
+ static bool checkIntValue( QString value, int *result );
+ /**
+ Feeds value into @p col using QColor::setNamedColor() and returns
+ wheather the color is valid
+ */
+ static bool checkColorValue( QString value, QColor &col );
+
+ /**
+ * helper regex to capture the document variables
+ */
+ static QRegExp kvLine;
+ static QRegExp kvLineWildcard;
+ static QRegExp kvLineMime;
+ static QRegExp kvVar;
+
+ KIO::TransferJob *m_job;
+ KTempFile *m_tempFile;
+
+ // TemplateInterface
+ public:
+ bool setTabInterceptor(KateKeyInterceptorFunctor *interceptor); /* perhaps make it moregeneral like an eventfilter*/
+ bool removeTabInterceptor(KateKeyInterceptorFunctor *interceptor);
+ bool invokeTabInterceptor(KKey);
+
+ protected:
+ virtual bool insertTemplateTextImplementation ( uint line, uint column, const QString &templateString, const QMap<QString,QString> &initialValues, QWidget *parentWindow=0 );
+ KateKeyInterceptorFunctor *m_tabInterceptor;
+
+ protected slots:
+ void testTemplateCode();
+ void dumpRegionTree();
+
+ //BEGIN DEPRECATED
+ //
+ // KTextEditor::SelectionInterface stuff
+ // DEPRECATED, this will be removed for KDE 4.x !!!!!!!!!!!!!!!!!!!!
+ //
+ public slots:
+ bool setSelection ( uint startLine, uint startCol, uint endLine, uint endCol );
+ bool clearSelection ();
+ bool hasSelection () const;
+ QString selection () const;
+ bool removeSelectedText ();
+ bool selectAll();
+
+ //
+ // KTextEditor::SelectionInterfaceExt
+ //
+ int selStartLine();
+ int selStartCol();
+ int selEndLine();
+ int selEndCol();
+
+
+ // hack, only there to still support the deprecated stuff, will be removed for KDE 4.x
+ #undef signals
+ #define signals public
+ signals:
+ #undef signals
+ #define signals protected
+ void selectionChanged ();
+
+ //
+ // KTextEditor::BlockSelectionInterface stuff
+ // DEPRECATED, this will be removed for KDE 4.x !!!!!!!!!!!!!!!!!!!!
+ //
+ public slots:
+ bool blockSelectionMode ();
+ bool setBlockSelectionMode (bool on);
+ bool toggleBlockSelectionMode ();
+
+ private:
+//END DEPRECATED
+
+ k_dcop:
+ uint documentNumber () const;
+};
+
+#endif
+
+// kate: space-indent on; indent-width 2; replace-tabs on;
+
diff --git a/kate/part/katedocumenthelpers.cpp b/kate/part/katedocumenthelpers.cpp
new file mode 100644
index 000000000..9055e7ec3
--- /dev/null
+++ b/kate/part/katedocumenthelpers.cpp
@@ -0,0 +1,56 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2001 Christoph Cullmann <cullmann@kde.org>
+ Copyright (C) 2001 Joseph Wenninger <jowenn@kde.org>
+ Copyright (C) 1999 Jochen Wilhelmy <digisnap@cs.tu-berlin.de>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "katedocumenthelpers.h"
+#include "katedocumenthelpers.moc"
+
+#include "katedocument.h"
+#include "kateview.h"
+
+#include <kpopupmenu.h>
+#include <klocale.h>
+
+KateBrowserExtension::KateBrowserExtension( KateDocument* doc )
+: KParts::BrowserExtension( doc, "katepartbrowserextension" ),
+ m_doc (doc)
+{
+ connect( doc, SIGNAL( selectionChanged() ),
+ this, SLOT( slotSelectionChanged() ) );
+ emit enableAction( "print", true );
+}
+
+void KateBrowserExtension::copy()
+{
+ if (m_doc->activeView())
+ m_doc->activeView()->copy();
+}
+
+void KateBrowserExtension::print()
+{
+ m_doc->printDialog();
+}
+
+void KateBrowserExtension::slotSelectionChanged()
+{
+ if (m_doc->activeView())
+ emit enableAction( "copy", m_doc->activeView()->hasSelection() );
+}
+
+// kate: space-indent on; indent-width 2; replace-tabs on;
diff --git a/kate/part/katedocumenthelpers.h b/kate/part/katedocumenthelpers.h
new file mode 100644
index 000000000..8346ffa18
--- /dev/null
+++ b/kate/part/katedocumenthelpers.h
@@ -0,0 +1,71 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2001 Christoph Cullmann <cullmann@kde.org>
+ Copyright (C) 2001 Joseph Wenninger <jowenn@kde.org>
+ Copyright (C) 1999 Jochen Wilhelmy <digisnap@cs.tu-berlin.de>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef __KATE_DOCUMENT_HELPERS__
+#define __KATE_DOCUMENT_HELPERS__
+
+#include "../interfaces/document.h"
+
+#include <kparts/browserextension.h>
+
+#include <qstringlist.h>
+#include <qguardedptr.h>
+
+class KateDocument;
+
+/**
+ * Interface for embedding KateDocument into a browser
+ */
+class KateBrowserExtension : public KParts::BrowserExtension
+{
+ Q_OBJECT
+
+ public:
+ /**
+ * Constructor
+ * @param doc parent document
+ */
+ KateBrowserExtension( KateDocument* doc );
+
+ public slots:
+ /**
+ * copy text to clipboard
+ */
+ void copy();
+
+ /**
+ * selection has changed
+ */
+ void slotSelectionChanged();
+
+ /**
+ * print the current file
+ */
+ void print();
+
+ private:
+ /**
+ * parent document
+ */
+ KateDocument* m_doc;
+};
+
+#endif
+
diff --git a/kate/part/katefactory.cpp b/kate/part/katefactory.cpp
new file mode 100644
index 000000000..a02d00fe7
--- /dev/null
+++ b/kate/part/katefactory.cpp
@@ -0,0 +1,276 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2001-2004 Christoph Cullmann <cullmann@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "config.h"
+#include "katefactory.h"
+
+#include "katedocument.h"
+#include "kateview.h"
+#include "katerenderer.h"
+#include "katecmds.h"
+#include "katefiletype.h"
+#include "kateschema.h"
+#include "katesearch.h"
+#include "kateconfig.h"
+#ifndef Q_WS_WIN //todo
+#include "katejscript.h"
+#endif
+#include "kateluaindentscript.h"
+#include "../interfaces/katecmd.h"
+
+#include <kvmallocator.h>
+#include <klocale.h>
+#include <kdirwatch.h>
+#include <kstaticdeleter.h>
+
+#include <qapplication.h>
+
+/**
+ * dummy wrapper factory to be sure nobody external deletes our katefactory
+ */
+class KateFactoryPublic : public KParts::Factory
+{
+ public:
+ /**
+ * reimplemented create object method
+ * @param parentWidget parent widget
+ * @param widgetName widget name
+ * @param parent QObject parent
+ * @param name object name
+ * @param classname class name
+ * @param args additional arguments
+ * @return constructed part object
+ */
+ KParts::Part *createPartObject ( QWidget *parentWidget, const char *widgetName, QObject *parent, const char *name, const char *classname, const QStringList &args )
+ {
+ return KateFactory::self()->createPartObject (parentWidget, widgetName, parent, name, classname, args);
+ }
+};
+
+K_EXPORT_COMPONENT_FACTORY( libkatepart, KateFactoryPublic )
+
+KateFactory *KateFactory::s_self = 0;
+
+KateFactory::KateFactory ()
+ : m_aboutData ("katepart", I18N_NOOP("Kate Part"), KATEPART_VERSION,
+ I18N_NOOP( "Embeddable editor component" ), KAboutData::License_LGPL_V2,
+ I18N_NOOP( "(c) 2000-2004 The Kate Authors" ), 0, "http://kate.kde.org")
+ , m_instance (&m_aboutData)
+ , m_plugins (KTrader::self()->query("KTextEditor/Plugin"))
+ , m_jscript (0)
+{
+ // set s_self
+ s_self = this;
+
+ //
+ // fill about data
+ //
+ m_aboutData.addAuthor ("Christoph Cullmann", I18N_NOOP("Maintainer"), "cullmann@kde.org", "http://www.babylon2k.de");
+ m_aboutData.addAuthor ("Anders Lund", I18N_NOOP("Core Developer"), "anders@alweb.dk", "http://www.alweb.dk");
+ m_aboutData.addAuthor ("Joseph Wenninger", I18N_NOOP("Core Developer"), "jowenn@kde.org","http://stud3.tuwien.ac.at/~e9925371");
+ m_aboutData.addAuthor ("Hamish Rodda",I18N_NOOP("Core Developer"), "rodda@kde.org");
+ m_aboutData.addAuthor ("Waldo Bastian", I18N_NOOP( "The cool buffersystem" ), "bastian@kde.org" );
+ m_aboutData.addAuthor ("Charles Samuels", I18N_NOOP("The Editing Commands"), "charles@kde.org");
+ m_aboutData.addAuthor ("Matt Newell", I18N_NOOP("Testing, ..."), "newellm@proaxis.com");
+ m_aboutData.addAuthor ("Michael Bartl", I18N_NOOP("Former Core Developer"), "michael.bartl1@chello.at");
+ m_aboutData.addAuthor ("Michael McCallum", I18N_NOOP("Core Developer"), "gholam@xtra.co.nz");
+ m_aboutData.addAuthor ("Jochen Wilhemly", I18N_NOOP( "KWrite Author" ), "digisnap@cs.tu-berlin.de" );
+ m_aboutData.addAuthor ("Michael Koch",I18N_NOOP("KWrite port to KParts"), "koch@kde.org");
+ m_aboutData.addAuthor ("Christian Gebauer", 0, "gebauer@kde.org" );
+ m_aboutData.addAuthor ("Simon Hausmann", 0, "hausmann@kde.org" );
+ m_aboutData.addAuthor ("Glen Parker",I18N_NOOP("KWrite Undo History, Kspell integration"), "glenebob@nwlink.com");
+ m_aboutData.addAuthor ("Scott Manson",I18N_NOOP("KWrite XML Syntax highlighting support"), "sdmanson@alltel.net");
+ m_aboutData.addAuthor ("John Firebaugh",I18N_NOOP("Patches and more"), "jfirebaugh@kde.org");
+ m_aboutData.addAuthor ("Dominik Haumann", I18N_NOOP("Developer & Highlight wizard"), "dhdev@gmx.de");
+
+ m_aboutData.addCredit ("Matteo Merli",I18N_NOOP("Highlighting for RPM Spec-Files, Perl, Diff and more"), "merlim@libero.it");
+ m_aboutData.addCredit ("Rocky Scaletta",I18N_NOOP("Highlighting for VHDL"), "rocky@purdue.edu");
+ m_aboutData.addCredit ("Yury Lebedev",I18N_NOOP("Highlighting for SQL"),"");
+ m_aboutData.addCredit ("Chris Ross",I18N_NOOP("Highlighting for Ferite"),"");
+ m_aboutData.addCredit ("Nick Roux",I18N_NOOP("Highlighting for ILERPG"),"");
+ m_aboutData.addCredit ("Carsten Niehaus", I18N_NOOP("Highlighting for LaTeX"),"");
+ m_aboutData.addCredit ("Per Wigren", I18N_NOOP("Highlighting for Makefiles, Python"),"");
+ m_aboutData.addCredit ("Jan Fritz", I18N_NOOP("Highlighting for Python"),"");
+ m_aboutData.addCredit ("Daniel Naber","","");
+ m_aboutData.addCredit ("Roland Pabel",I18N_NOOP("Highlighting for Scheme"),"");
+ m_aboutData.addCredit ("Cristi Dumitrescu",I18N_NOOP("PHP Keyword/Datatype list"),"");
+ m_aboutData.addCredit ("Carsten Pfeiffer", I18N_NOOP("Very nice help"), "");
+ m_aboutData.addCredit (I18N_NOOP("All people who have contributed and I have forgotten to mention"),"","");
+
+ m_aboutData.setTranslator(I18N_NOOP("_: NAME OF TRANSLATORS\nYour names"), I18N_NOOP("_: EMAIL OF TRANSLATORS\nYour emails"));
+
+ //
+ // dir watch
+ //
+ m_dirWatch = new KDirWatch ();
+
+ //
+ // filetype man
+ //
+ m_fileTypeManager = new KateFileTypeManager ();
+
+ //
+ // schema man
+ //
+ m_schemaManager = new KateSchemaManager ();
+
+ // config objects
+ m_documentConfig = new KateDocumentConfig ();
+ m_viewConfig = new KateViewConfig ();
+ m_rendererConfig = new KateRendererConfig ();
+
+ // vm allocator
+ m_vm = new KVMAllocator ();
+
+#ifndef Q_WS_WIN //todo
+ // create script man (search scripts) + register commands
+ m_jscriptManager = new KateJScriptManager ();
+ KateCmd::self()->registerCommand (m_jscriptManager);
+ m_indentScriptManagers.append(new KateIndentJScriptManager());
+#else
+ m_jscriptManager = 0;
+#endif
+#ifdef HAVE_LUA
+ m_indentScriptManagers.append(new KateLUAIndentScriptManager());
+#endif
+ //
+ // init the cmds
+ //
+ m_cmds.push_back (new KateCommands::CoreCommands());
+ m_cmds.push_back (new KateCommands::SedReplace ());
+ m_cmds.push_back (new KateCommands::Character ());
+ m_cmds.push_back (new KateCommands::Date ());
+ m_cmds.push_back (new SearchCommand());
+
+ for ( QValueList<Kate::Command *>::iterator it = m_cmds.begin(); it != m_cmds.end(); ++it )
+ KateCmd::self()->registerCommand (*it);
+}
+
+KateFactory::~KateFactory()
+{
+ /* ?hack? If MainApplication-Interface::quit is called by dcop the factory gets destroyed before all documents are destroyed eg in kwrite.
+ This could happen in other apps too. Since the documents try to unregister a new factory is created (in the ::self call) and registered with a
+ KStaticDeleter which causes a crash. That's why I ensure here that all documents are destroyed before the factory goes down (JOWENN)*/
+ while (KateDocument *doc=m_documents.first()) {
+ s_self=this; /* this is needed because the KStaticDeleter sets the global reference to 0, before it deletes the object it handles.
+ To prevent a crash again restore the factory pointer temporarily. (jowenn)*/
+ delete doc;
+ s_self=0;
+ }
+ /*another solution would be to set a flag in the documents, and inhibit calling of the deregistering methods, but I don't see a problem
+ if all created objects are deleted before their factory. If somebody sees a problem, let me know*/
+
+ delete m_documentConfig;
+ delete m_viewConfig;
+ delete m_rendererConfig;
+
+ delete m_fileTypeManager;
+ delete m_schemaManager;
+
+ delete m_dirWatch;
+
+ delete m_vm;
+
+ for ( QValueList<Kate::Command *>::iterator it = m_cmds.begin(); it != m_cmds.end(); ++it )
+ delete *it;
+
+ // cu manager
+ delete m_jscriptManager;
+ m_indentScriptManagers.setAutoDelete(true);
+ // cu jscript
+ delete m_jscript;
+}
+
+static KStaticDeleter<KateFactory> sdFactory;
+
+KateFactory *KateFactory::self ()
+{
+ if (!s_self) {
+ sdFactory.setObject(s_self, new KateFactory ());
+ }
+ return s_self;
+}
+
+KParts::Part *KateFactory::createPartObject ( QWidget *parentWidget, const char *widgetName, QObject *parent, const char *name, const char *_classname, const QStringList & )
+{
+ QCString classname( _classname );
+ bool bWantSingleView = ( classname != "KTextEditor::Document" && classname != "Kate::Document" );
+ bool bWantBrowserView = ( classname == "Browser/View" );
+ bool bWantReadOnly = (bWantBrowserView || ( classname == "KParts::ReadOnlyPart" ));
+
+ KParts::ReadWritePart *part = new KateDocument (bWantSingleView, bWantBrowserView, bWantReadOnly, parentWidget, widgetName, parent, name);
+ part->setReadWrite( !bWantReadOnly );
+
+ return part;
+}
+
+void KateFactory::registerDocument ( KateDocument *doc )
+{
+ m_documents.append( doc );
+}
+
+void KateFactory::deregisterDocument ( KateDocument *doc )
+{
+ m_documents.removeRef( doc );
+}
+
+void KateFactory::registerView ( KateView *view )
+{
+ m_views.append( view );
+}
+
+void KateFactory::deregisterView ( KateView *view )
+{
+ m_views.removeRef( view );
+}
+
+void KateFactory::registerRenderer ( KateRenderer *renderer )
+{
+ m_renderers.append( renderer );
+}
+
+void KateFactory::deregisterRenderer ( KateRenderer *renderer )
+{
+ m_renderers.removeRef( renderer );
+}
+
+KateJScript *KateFactory::jscript ()
+{
+#ifndef Q_WS_WIN //todo
+ if (m_jscript)
+ return m_jscript;
+
+ return m_jscript = new KateJScript ();
+#else
+ return 0;
+#endif
+}
+
+
+KateIndentScript KateFactory::indentScript (const QString &scriptname)
+{
+ KateIndentScript result;
+ for(uint i=0;i<m_indentScriptManagers.count();i++)
+ {
+ result=m_indentScriptManagers.at(i)->script(scriptname);
+ if (!result.isNull()) return result;
+ }
+ return result;
+}
+
+// kate: space-indent on; indent-width 2; replace-tabs on;
diff --git a/kate/part/katefactory.h b/kate/part/katefactory.h
new file mode 100644
index 000000000..5e3986161
--- /dev/null
+++ b/kate/part/katefactory.h
@@ -0,0 +1,312 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2001-2004 Christoph Cullmann <cullmann@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef __KATE_FACTORY_H__
+#define __KATE_FACTORY_H__
+
+#include "katejscript.h"
+#include <kparts/factory.h>
+
+#include <ktrader.h>
+#include <kinstance.h>
+#include <kaboutdata.h>
+
+// katepart version must be a string in double quotes, format: "x.x"
+#define KATEPART_VERSION "2.5"
+
+class KateCmd;
+class KateFileTypeManager;
+class KateSchemaManager;
+class KateDocumentConfig;
+class KateViewConfig;
+class KateRendererConfig;
+class KateDocument;
+class KateRenderer;
+class KateView;
+class KateJScript;
+class KateJScriptManager;
+class KateIndentScriptManagerAbstract;
+class KDirWatch;
+class KVMAllocator;
+
+namespace Kate {
+ class Command;
+}
+
+
+class KateFactory
+{
+ private:
+ /**
+ * Default constructor, private, as singleton
+ */
+ KateFactory ();
+
+ public:
+ /**
+ * Destructor
+ */
+ ~KateFactory ();
+
+ /**
+ * singleton accessor
+ * @return instance of the factory
+ */
+ static KateFactory *self ();
+
+ /**
+ * reimplemented create object method
+ * @param parentWidget parent widget
+ * @param widgetName widget name
+ * @param parent QObject parent
+ * @param name object name
+ * @param classname class parent
+ * @param args additional arguments
+ * @return constructed part object
+ */
+ KParts::Part *createPartObject ( QWidget *parentWidget, const char *widgetName,
+ QObject *parent, const char *name, const char *classname,
+ const QStringList &args );
+
+ /**
+ * public accessor to the instance
+ * @return instance
+ */
+ inline KInstance *instance () { return &m_instance; };
+
+ /**
+ * register document at the factory
+ * this allows us to loop over all docs for example on config changes
+ * @param doc document to register
+ */
+ void registerDocument ( KateDocument *doc );
+
+ /**
+ * unregister document at the factory
+ * @param doc document to register
+ */
+ void deregisterDocument ( KateDocument *doc );
+
+ /**
+ * register view at the factory
+ * this allows us to loop over all views for example on config changes
+ * @param view view to register
+ */
+ void registerView ( KateView *view );
+
+ /**
+ * unregister view at the factory
+ * @param view view to unregister
+ */
+ void deregisterView ( KateView *view );
+
+ /**
+ * register renderer at the factory
+ * this allows us to loop over all views for example on config changes
+ * @param renderer renderer to register
+ */
+ void registerRenderer ( KateRenderer *renderer );
+
+ /**
+ * unregister renderer at the factory
+ * @param renderer renderer to unregister
+ */
+ void deregisterRenderer ( KateRenderer *renderer );
+
+ /**
+ * return a list of all registered docs
+ * @return all known documents
+ */
+ inline QPtrList<KateDocument> *documents () { return &m_documents; };
+
+ /**
+ * return a list of all registered views
+ * @return all known views
+ */
+ inline QPtrList<KateView> *views () { return &m_views; };
+
+ /**
+ * return a list of all registered renderers
+ * @return all known renderers
+ */
+ inline QPtrList<KateRenderer> *renderers () { return &m_renderers; };
+
+ /**
+ * on start detected plugins
+ * @return list of all at launch detected ktexteditor::plugins
+ */
+ inline const KTrader::OfferList &plugins () { return m_plugins; };
+
+ /**
+ * global dirwatch
+ * @return dirwatch instance
+ */
+ inline KDirWatch *dirWatch () { return m_dirWatch; };
+
+ /**
+ * global filetype manager
+ * used to manage the file types centrally
+ * @return filetype manager
+ */
+ inline KateFileTypeManager *fileTypeManager () { return m_fileTypeManager; };
+
+ /**
+ * manager for the katepart schemas
+ * @return schema manager
+ */
+ inline KateSchemaManager *schemaManager () { return m_schemaManager; };
+
+ /**
+ * fallback document config
+ * @return default config for all documents
+ */
+ inline KateDocumentConfig *documentConfig () { return m_documentConfig; }
+
+ /**
+ * fallback view config
+ * @return default config for all views
+ */
+ inline KateViewConfig *viewConfig () { return m_viewConfig; }
+
+ /**
+ * fallback renderer config
+ * @return default config for all renderers
+ */
+ inline KateRendererConfig *rendererConfig () { return m_rendererConfig; }
+
+ /**
+ * Global allocator for swapping
+ * @return allocator
+ */
+ inline KVMAllocator *vm () { return m_vm; }
+
+ /**
+ * global interpreter, for nice js stuff
+ */
+ KateJScript *jscript ();
+
+ /**
+ * Global javascript collection
+ */
+ KateJScriptManager *jscriptManager () { return m_jscriptManager; }
+
+
+ /**
+ * looks up a script given by name. If there are more than
+ * one matching, the first found will be taken
+ */
+ KateIndentScript indentScript (const QString &scriptname);
+
+ private:
+ /**
+ * instance of this factory
+ */
+ static KateFactory *s_self;
+
+ /**
+ * about data (authors and more)
+ */
+ KAboutData m_aboutData;
+
+ /**
+ * our kinstance
+ */
+ KInstance m_instance;
+
+ /**
+ * registered docs
+ */
+ QPtrList<KateDocument> m_documents;
+
+ /**
+ * registered views
+ */
+ QPtrList<KateView> m_views;
+
+ /**
+ * registered renderers
+ */
+ QPtrList<KateRenderer> m_renderers;
+
+ /**
+ * global dirwatch object
+ */
+ KDirWatch *m_dirWatch;
+
+ /**
+ * filetype manager
+ */
+ KateFileTypeManager *m_fileTypeManager;
+
+ /**
+ * schema manager
+ */
+ KateSchemaManager *m_schemaManager;
+
+ /**
+ * at start found plugins
+ */
+ KTrader::OfferList m_plugins;
+
+ /**
+ * fallback document config
+ */
+ KateDocumentConfig *m_documentConfig;
+
+ /**
+ * fallback view config
+ */
+ KateViewConfig *m_viewConfig;
+
+ /**
+ * fallback renderer config
+ */
+ KateRendererConfig *m_rendererConfig;
+
+ /**
+ * vm allocator
+ */
+ KVMAllocator *m_vm;
+
+ /**
+ * internal commands
+ */
+ QValueList<Kate::Command *> m_cmds;
+
+ /**
+ * js interpreter
+ */
+ KateJScript *m_jscript;
+
+
+ /**
+ * js script manager
+ */
+ KateJScriptManager *m_jscriptManager;
+
+
+ /**
+ * manager for js based indenters
+ */
+ QPtrList<KateIndentScriptManagerAbstract> m_indentScriptManagers;
+
+};
+
+#endif
+
+// kate: space-indent on; indent-width 2; replace-tabs on;
diff --git a/kate/part/katefiletype.cpp b/kate/part/katefiletype.cpp
new file mode 100644
index 000000000..ea3a487cb
--- /dev/null
+++ b/kate/part/katefiletype.cpp
@@ -0,0 +1,596 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2001-2003 Christoph Cullmann <cullmann@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+//BEGIN Includes
+#include "katefiletype.h"
+#include "katefiletype.moc"
+
+#include "katedocument.h"
+#include "kateconfig.h"
+#include "kateview.h"
+#include "katefactory.h"
+
+#include <kconfig.h>
+#include <kmimemagic.h>
+#include <kmimetype.h>
+#include <kmimetypechooser.h>
+#include <kdebug.h>
+#include <kiconloader.h>
+#include <knuminput.h>
+#include <klocale.h>
+#include <kpopupmenu.h>
+
+#include <qregexp.h>
+#include <qcheckbox.h>
+#include <qcombobox.h>
+#include <qgroupbox.h>
+#include <qhbox.h>
+#include <qheader.h>
+#include <qhgroupbox.h>
+#include <qlabel.h>
+#include <qlayout.h>
+#include <qlineedit.h>
+#include <qpushbutton.h>
+#include <qtoolbutton.h>
+#include <qvbox.h>
+#include <qvgroupbox.h>
+#include <qwhatsthis.h>
+#include <qwidgetstack.h>
+
+#define KATE_FT_HOWMANY 1024
+//END Includes
+
+//BEGIN KateFileTypeManager
+KateFileTypeManager::KateFileTypeManager ()
+{
+ m_types.setAutoDelete (true);
+
+ update ();
+}
+
+KateFileTypeManager::~KateFileTypeManager ()
+{
+}
+
+//
+// read the types from config file and update the internal list
+//
+void KateFileTypeManager::update ()
+{
+ KConfig config ("katefiletyperc", false, false);
+
+ QStringList g (config.groupList());
+ g.sort ();
+
+ m_types.clear ();
+ for (uint z=0; z < g.count(); z++)
+ {
+ config.setGroup (g[z]);
+
+ KateFileType *type = new KateFileType ();
+
+ type->number = z;
+ type->name = g[z];
+ type->section = config.readEntry ("Section");
+ type->wildcards = config.readListEntry ("Wildcards", ';');
+ type->mimetypes = config.readListEntry ("Mimetypes", ';');
+ type->priority = config.readNumEntry ("Priority");
+ type->varLine = config.readEntry ("Variables");
+
+ m_types.append (type);
+ }
+}
+
+//
+// save the given list to config file + update
+//
+void KateFileTypeManager::save (QPtrList<KateFileType> *v)
+{
+ KConfig config ("katefiletyperc", false, false);
+
+ QStringList newg;
+ for (uint z=0; z < v->count(); z++)
+ {
+ config.setGroup (v->at(z)->name);
+
+ config.writeEntry ("Section", v->at(z)->section);
+ config.writeEntry ("Wildcards", v->at(z)->wildcards, ';');
+ config.writeEntry ("Mimetypes", v->at(z)->mimetypes, ';');
+ config.writeEntry ("Priority", v->at(z)->priority);
+
+ QString varLine = v->at(z)->varLine;
+ if (QRegExp("kate:(.*)").search(varLine) < 0)
+ varLine.prepend ("kate: ");
+
+ config.writeEntry ("Variables", varLine);
+
+ newg << v->at(z)->name;
+ }
+
+ QStringList g (config.groupList());
+
+ for (uint z=0; z < g.count(); z++)
+ {
+ if (newg.findIndex (g[z]) == -1)
+ config.deleteGroup (g[z]);
+ }
+
+ config.sync ();
+
+ update ();
+}
+
+int KateFileTypeManager::fileType (KateDocument *doc)
+{
+ kdDebug(13020)<<k_funcinfo<<endl;
+ if (!doc)
+ return -1;
+
+ if (m_types.isEmpty())
+ return -1;
+
+ QString fileName = doc->url().prettyURL();
+ int length = doc->url().prettyURL().length();
+
+ int result;
+
+ // Try wildcards
+ if ( ! fileName.isEmpty() )
+ {
+ static QStringList commonSuffixes = QStringList::split (";", ".orig;.new;~;.bak;.BAK");
+
+ if ((result = wildcardsFind(fileName)) != -1)
+ return result;
+
+ QString backupSuffix = KateDocumentConfig::global()->backupSuffix();
+ if (fileName.endsWith(backupSuffix)) {
+ if ((result = wildcardsFind(fileName.left(length - backupSuffix.length()))) != -1)
+ return result;
+ }
+
+ for (QStringList::Iterator it = commonSuffixes.begin(); it != commonSuffixes.end(); ++it) {
+ if (*it != backupSuffix && fileName.endsWith(*it)) {
+ if ((result = wildcardsFind(fileName.left(length - (*it).length()))) != -1)
+ return result;
+ }
+ }
+ }
+
+ // Even try the document name, if the URL is empty
+ // This is usefull if the document name is set for example by a plugin which
+ // created the document
+ else if ( (result = wildcardsFind(doc->docName())) != -1)
+ {
+ kdDebug(13020)<<"KateFiletype::filetype(): got type "<<result<<" using docName '"<<doc->docName()<<"'"<<endl;
+ return result;
+ }
+
+ // Try content-based mimetype
+ KMimeType::Ptr mt = doc->mimeTypeForContent();
+
+ QPtrList<KateFileType> types;
+
+ for (uint z=0; z < m_types.count(); z++)
+ {
+ if (m_types.at(z)->mimetypes.findIndex (mt->name()) > -1)
+ types.append (m_types.at(z));
+ }
+
+ if ( !types.isEmpty() )
+ {
+ int pri = -1;
+ int hl = -1;
+
+ for (KateFileType *type = types.first(); type != 0L; type = types.next())
+ {
+ if (type->priority > pri)
+ {
+ pri = type->priority;
+ hl = type->number;
+ }
+ }
+
+ return hl;
+ }
+
+
+ return -1;
+}
+
+int KateFileTypeManager::wildcardsFind (const QString &fileName)
+{
+ QPtrList<KateFileType> types;
+
+ for (uint z=0; z < m_types.count(); z++)
+ {
+ for( QStringList::Iterator it = m_types.at(z)->wildcards.begin(); it != m_types.at(z)->wildcards.end(); ++it )
+ {
+ // anders: we need to be sure to match the end of string, as eg a css file
+ // would otherwise end up with the c hl
+ QRegExp re(*it, true, true);
+ if ( ( re.search( fileName ) > -1 ) && ( re.matchedLength() == (int)fileName.length() ) )
+ types.append (m_types.at(z));
+ }
+ }
+
+ if ( !types.isEmpty() )
+ {
+ int pri = -1;
+ int hl = -1;
+
+ for (KateFileType *type = types.first(); type != 0L; type = types.next())
+ {
+ if (type->priority > pri)
+ {
+ pri = type->priority;
+ hl = type->number;
+ }
+ }
+
+ return hl;
+ }
+
+ return -1;
+}
+
+const KateFileType *KateFileTypeManager::fileType (uint number)
+{
+ if (number < m_types.count())
+ return m_types.at(number);
+
+ return 0;
+}
+//END KateFileTypeManager
+
+//BEGIN KateFileTypeConfigTab
+KateFileTypeConfigTab::KateFileTypeConfigTab( QWidget *parent )
+ : KateConfigPage( parent )
+{
+ m_types.setAutoDelete (true);
+ m_lastType = 0;
+
+ QVBoxLayout *layout = new QVBoxLayout(this, 0, KDialog::spacingHint() );
+
+ // hl chooser
+ QHBox *hbHl = new QHBox( this );
+ layout->add (hbHl);
+ hbHl->setSpacing( KDialog::spacingHint() );
+ QLabel *lHl = new QLabel( i18n("&Filetype:"), hbHl );
+ typeCombo = new QComboBox( false, hbHl );
+ lHl->setBuddy( typeCombo );
+ connect( typeCombo, SIGNAL(activated(int)),
+ this, SLOT(typeChanged(int)) );
+
+ QPushButton *btnnew = new QPushButton( i18n("&New"), hbHl );
+ connect( btnnew, SIGNAL(clicked()), this, SLOT(newType()) );
+
+ btndel = new QPushButton( i18n("&Delete"), hbHl );
+ connect( btndel, SIGNAL(clicked()), this, SLOT(deleteType()) );
+
+ gbProps = new QGroupBox( 2, Qt::Horizontal, i18n("Properties"), this );
+ layout->add (gbProps);
+
+ // file & mime types
+ QLabel *lname = new QLabel( i18n("N&ame:"), gbProps );
+ name = new QLineEdit( gbProps );
+ lname->setBuddy( name );
+
+ // file & mime types
+ QLabel *lsec = new QLabel( i18n("&Section:"), gbProps );
+ section = new QLineEdit( gbProps );
+ lsec->setBuddy( section );
+
+ // file & mime types
+ QLabel *lvar = new QLabel( i18n("&Variables:"), gbProps );
+ varLine = new QLineEdit( gbProps );
+ lvar->setBuddy( varLine );
+
+ // file & mime types
+ QLabel *lFileExts = new QLabel( i18n("File e&xtensions:"), gbProps );
+ wildcards = new QLineEdit( gbProps );
+ lFileExts->setBuddy( wildcards );
+
+ QLabel *lMimeTypes = new QLabel( i18n("MIME &types:"), gbProps);
+ QHBox *hbMT = new QHBox (gbProps);
+ mimetypes = new QLineEdit( hbMT );
+ lMimeTypes->setBuddy( mimetypes );
+
+ QToolButton *btnMTW = new QToolButton(hbMT);
+ btnMTW->setIconSet(QIconSet(SmallIcon("wizard")));
+ connect(btnMTW, SIGNAL(clicked()), this, SLOT(showMTDlg()));
+
+ QLabel *lprio = new QLabel( i18n("Prio&rity:"), gbProps);
+ priority = new KIntNumInput( gbProps );
+ lprio->setBuddy( priority );
+
+ layout->addStretch();
+
+ reload();
+
+ connect( name, SIGNAL( textChanged ( const QString & ) ), this, SLOT( slotChanged() ) );
+ connect( section, SIGNAL( textChanged ( const QString & ) ), this, SLOT( slotChanged() ) );
+ connect( varLine, SIGNAL( textChanged ( const QString & ) ), this, SLOT( slotChanged() ) );
+ connect( wildcards, SIGNAL( textChanged ( const QString & ) ), this, SLOT( slotChanged() ) );
+ connect( mimetypes, SIGNAL( textChanged ( const QString & ) ), this, SLOT( slotChanged() ) );
+ connect( priority, SIGNAL( valueChanged ( int ) ), this, SLOT( slotChanged() ) );
+
+ QWhatsThis::add( btnnew, i18n("Create a new file type.") );
+ QWhatsThis::add( btndel, i18n("Delete the current file type.") );
+ QWhatsThis::add( name, i18n(
+ "The name of the filetype will be the text of the corresponding menu item.") );
+ QWhatsThis::add( section, i18n(
+ "The section name is used to organize the file types in menus.") );
+ QWhatsThis::add( varLine, i18n(
+ "<p>This string allows you to configure Kate's settings for the files "
+ "selected by this mimetype using Kate variables. You can set almost any "
+ "configuration option, such as highlight, indent-mode, encoding, etc.</p>"
+ "<p>For a full list of known variables, see the manual.</p>") );
+ QWhatsThis::add( wildcards, i18n(
+ "The wildcards mask allows you to select files by filename. A typical "
+ "mask uses an asterisk and the file extension, for example "
+ "<code>*.txt; *.text</code>. The string is a semicolon-separated list "
+ "of masks.") );
+ QWhatsThis::add( mimetypes, i18n(
+ "The mime type mask allows you to select files by mimetype. The string is "
+ "a semicolon-separated list of mimetypes, for example "
+ "<code>text/plain; text/english</code>.") );
+ QWhatsThis::add( btnMTW, i18n(
+ "Displays a wizard that helps you easily select mimetypes.") );
+ QWhatsThis::add( priority, i18n(
+ "Sets a priority for this file type. If more than one file type selects the same "
+ "file, the one with the highest priority will be used." ) );
+}
+
+void KateFileTypeConfigTab::apply()
+{
+ if (!changed())
+ return;
+
+ save ();
+
+ KateFactory::self()->fileTypeManager()->save(&m_types);
+}
+
+void KateFileTypeConfigTab::reload()
+{
+ m_types.clear();
+ for (uint z=0; z < KateFactory::self()->fileTypeManager()->list()->count(); z++)
+ {
+ KateFileType *type = new KateFileType ();
+
+ *type = *KateFactory::self()->fileTypeManager()->list()->at(z);
+
+ m_types.append (type);
+ }
+
+ update ();
+}
+
+void KateFileTypeConfigTab::reset()
+{
+ reload ();
+}
+
+void KateFileTypeConfigTab::defaults()
+{
+ reload ();
+}
+
+void KateFileTypeConfigTab::update ()
+{
+ m_lastType = 0;
+
+ typeCombo->clear ();
+
+ for( uint i = 0; i < m_types.count(); i++) {
+ if (m_types.at(i)->section.length() > 0)
+ typeCombo->insertItem(m_types.at(i)->section + QString ("/") + m_types.at(i)->name);
+ else
+ typeCombo->insertItem(m_types.at(i)->name);
+ }
+
+ typeCombo->setCurrentItem (0);
+
+ typeChanged (0);
+
+ typeCombo->setEnabled (typeCombo->count() > 0);
+}
+
+void KateFileTypeConfigTab::deleteType ()
+{
+ int type = typeCombo->currentItem ();
+
+ if ((type > -1) && ((uint)type < m_types.count()))
+ {
+ m_types.remove (type);
+ update ();
+ }
+}
+
+void KateFileTypeConfigTab::newType ()
+{
+ QString newN = i18n("New Filetype");
+
+ for( uint i = 0; i < m_types.count(); i++) {
+ if (m_types.at(i)->name == newN)
+ {
+ typeCombo->setCurrentItem (i);
+ typeChanged (i);
+ return;
+ }
+ }
+
+ KateFileType *newT = new KateFileType ();
+ newT->priority = 0;
+ newT->name = newN;
+
+ m_types.prepend (newT);
+
+ update ();
+}
+
+void KateFileTypeConfigTab::save ()
+{
+ if (m_lastType)
+ {
+ m_lastType->name = name->text ();
+ m_lastType->section = section->text ();
+ m_lastType->varLine = varLine->text ();
+ m_lastType->wildcards = QStringList::split (";", wildcards->text ());
+ m_lastType->mimetypes = QStringList::split (";", mimetypes->text ());
+ m_lastType->priority = priority->value();
+ }
+}
+
+void KateFileTypeConfigTab::typeChanged (int type)
+{
+ save ();
+
+ KateFileType *t = 0;
+
+ if ((type > -1) && ((uint)type < m_types.count()))
+ t = m_types.at(type);
+
+ if (t)
+ {
+ gbProps->setTitle (i18n("Properties of %1").arg (typeCombo->currentText()));
+
+ gbProps->setEnabled (true);
+ btndel->setEnabled (true);
+
+ name->setText(t->name);
+ section->setText(t->section);
+ varLine->setText(t->varLine);
+ wildcards->setText(t->wildcards.join (";"));
+ mimetypes->setText(t->mimetypes.join (";"));
+ priority->setValue(t->priority);
+ }
+ else
+ {
+ gbProps->setTitle (i18n("Properties"));
+
+ gbProps->setEnabled (false);
+ btndel->setEnabled (false);
+
+ name->clear();
+ section->clear();
+ varLine->clear();
+ wildcards->clear();
+ mimetypes->clear();
+ priority->setValue(0);
+ }
+
+ m_lastType = t;
+}
+
+void KateFileTypeConfigTab::showMTDlg()
+{
+
+ QString text = i18n("Select the MimeTypes you want for this file type.\nPlease note that this will automatically edit the associated file extensions as well.");
+ QStringList list = QStringList::split( QRegExp("\\s*;\\s*"), mimetypes->text() );
+ KMimeTypeChooserDialog d( i18n("Select Mime Types"), text, list, "text", this );
+ if ( d.exec() == KDialogBase::Accepted ) {
+ // do some checking, warn user if mime types or patterns are removed.
+ // if the lists are empty, and the fields not, warn.
+ wildcards->setText( d.chooser()->patterns().join(";") );
+ mimetypes->setText( d.chooser()->mimeTypes().join(";") );
+ }
+}
+//END KateFileTypeConfigTab
+
+//BEGIN KateViewFileTypeAction
+void KateViewFileTypeAction::init()
+{
+ m_doc = 0;
+ subMenus.setAutoDelete( true );
+
+ popupMenu()->insertItem ( i18n("None"), this, SLOT(setType(int)), 0, 0);
+
+ connect(popupMenu(),SIGNAL(aboutToShow()),this,SLOT(slotAboutToShow()));
+}
+
+void KateViewFileTypeAction::updateMenu (Kate::Document *doc)
+{
+ m_doc = (KateDocument *)doc;
+}
+
+void KateViewFileTypeAction::slotAboutToShow()
+{
+ KateDocument *doc=m_doc;
+ int count = KateFactory::self()->fileTypeManager()->list()->count();
+
+ for (int z=0; z<count; z++)
+ {
+ QString hlName = KateFactory::self()->fileTypeManager()->list()->at(z)->name;
+ QString hlSection = KateFactory::self()->fileTypeManager()->list()->at(z)->section;
+
+ if ( !hlSection.isEmpty() && (names.contains(hlName) < 1) )
+ {
+ if (subMenusName.contains(hlSection) < 1)
+ {
+ subMenusName << hlSection;
+ QPopupMenu *menu = new QPopupMenu ();
+ subMenus.append(menu);
+ popupMenu()->insertItem (hlSection, menu);
+ }
+
+ int m = subMenusName.findIndex (hlSection);
+ names << hlName;
+ subMenus.at(m)->insertItem ( hlName, this, SLOT(setType(int)), 0, z+1);
+ }
+ else if (names.contains(hlName) < 1)
+ {
+ names << hlName;
+ popupMenu()->insertItem ( hlName, this, SLOT(setType(int)), 0, z+1);
+ }
+ }
+
+ if (!doc) return;
+
+ for (uint i=0;i<subMenus.count();i++)
+ {
+ for (uint i2=0;i2<subMenus.at(i)->count();i2++)
+ subMenus.at(i)->setItemChecked(subMenus.at(i)->idAt(i2),false);
+ }
+ popupMenu()->setItemChecked (0, false);
+
+ if (doc->fileType() == -1)
+ popupMenu()->setItemChecked (0, true);
+ else
+ {
+ const KateFileType *t = 0;
+ if ((t = KateFactory::self()->fileTypeManager()->fileType (doc->fileType())))
+ {
+ int i = subMenusName.findIndex (t->section);
+ if (i >= 0 && subMenus.at(i))
+ subMenus.at(i)->setItemChecked (doc->fileType()+1, true);
+ else
+ popupMenu()->setItemChecked (0, true);
+ }
+ }
+}
+
+void KateViewFileTypeAction::setType (int mode)
+{
+ KateDocument *doc=m_doc;
+
+ if (doc)
+ doc->updateFileType(mode-1, true);
+}
+//END KateViewFileTypeAction
+// kate: space-indent on; indent-width 2; replace-tabs on;
diff --git a/kate/part/katefiletype.h b/kate/part/katefiletype.h
new file mode 100644
index 000000000..cd343019c
--- /dev/null
+++ b/kate/part/katefiletype.h
@@ -0,0 +1,142 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2001-2003 Christoph Cullmann <cullmann@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef __kate_filetype_h__
+#define __kate_filetype_h__
+
+#include <qstringlist.h>
+#include <qptrlist.h>
+#include <qpopupmenu.h> // for QPtrList<QPopupMenu>, compile with gcc 3.4
+#include <qguardedptr.h>
+
+#include "katedialogs.h"
+
+class KateDocument;
+
+class KateFileType
+{
+ public:
+ int number;
+ QString name;
+ QString section;
+ QStringList wildcards;
+ QStringList mimetypes;
+ int priority;
+ QString varLine;
+};
+
+class KateFileTypeManager
+{
+ public:
+ KateFileTypeManager ();
+ ~KateFileTypeManager ();
+
+ /**
+ * File Type Config changed, update all docs (which will take care of views/renderers)
+ */
+ void update ();
+
+ void save (QPtrList<KateFileType> *v);
+
+ /**
+ * get the right fileType for the given document
+ * -1 if none found !
+ */
+ int fileType (KateDocument *doc);
+
+ /**
+ * Don't store the pointer somewhere longer times, won't be valid after the next update()
+ */
+ const KateFileType *fileType (uint number);
+
+ /**
+ * Don't modify
+ */
+ QPtrList<KateFileType> *list () { return &m_types; }
+
+ private:
+ int wildcardsFind (const QString &fileName);
+
+ private:
+ QPtrList<KateFileType> m_types;
+};
+
+class KateFileTypeConfigTab : public KateConfigPage
+{
+ Q_OBJECT
+
+ public:
+ KateFileTypeConfigTab( QWidget *parent );
+
+ public slots:
+ void apply();
+ void reload();
+ void reset();
+ void defaults();
+
+ private slots:
+ void update ();
+ void deleteType ();
+ void newType ();
+ void typeChanged (int type);
+ void showMTDlg();
+ void save ();
+
+ private:
+ class QGroupBox *gbProps;
+ class QPushButton *btndel;
+ class QComboBox *typeCombo;
+ class QLineEdit *wildcards;
+ class QLineEdit *mimetypes;
+ class KIntNumInput *priority;
+ class QLineEdit *name;
+ class QLineEdit *section;
+ class QLineEdit *varLine;
+
+ QPtrList<KateFileType> m_types;
+ KateFileType *m_lastType;
+};
+
+class KateViewFileTypeAction : public Kate::ActionMenu
+{
+ Q_OBJECT
+
+ public:
+ KateViewFileTypeAction(const QString& text, QObject* parent = 0, const char* name = 0)
+ : Kate::ActionMenu(text, parent, name) { init(); };
+
+ ~KateViewFileTypeAction(){;};
+
+ void updateMenu (Kate::Document *doc);
+
+ private:
+ void init();
+
+ QGuardedPtr<KateDocument> m_doc;
+ QStringList subMenusName;
+ QStringList names;
+ QPtrList<QPopupMenu> subMenus;
+
+ public slots:
+ void slotAboutToShow();
+
+ private slots:
+ void setType (int mode);
+};
+
+#endif
diff --git a/kate/part/katefont.cpp b/kate/part/katefont.cpp
new file mode 100644
index 000000000..efab0268c
--- /dev/null
+++ b/kate/part/katefont.cpp
@@ -0,0 +1,127 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2002 Christian Couder <christian@kdevelop.org>
+ Copyright (C) 2001 Christoph Cullmann <cullmann@kde.org>
+ Copyright (C) 2001 Joseph Wenninger <jowenn@kde.org>
+ Copyright (C) 1999 Jochen Wilhelmy <digisnap@cs.tu-berlin.de>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "katefont.h"
+
+#include <kglobalsettings.h>
+
+#include <qfontinfo.h>
+
+//
+// KateFontMetrics implementation
+//
+
+KateFontMetrics::KateFontMetrics(const QFont& f) : QFontMetrics(f)
+{
+ for (int i=0; i<256; i++) warray[i]=0;
+}
+
+KateFontMetrics::~KateFontMetrics()
+{
+ for (int i=0; i<256; i++)
+ delete[] warray[i];
+}
+
+short * KateFontMetrics::createRow (short *wa, uchar row)
+{
+ wa=warray[row]=new short[256];
+
+ for (int i=0; i<256; i++) wa[i]=-1;
+
+ return wa;
+}
+
+int KateFontMetrics::width(QChar c)
+{
+ uchar cell=c.cell();
+ uchar row=c.row();
+ short *wa=warray[row];
+
+ if (!wa)
+ wa = createRow (wa, row);
+
+ if (wa[cell]<0) wa[cell]=(short) QFontMetrics::width(c);
+
+ return (int)wa[cell];
+}
+
+//
+// KateFontStruct implementation
+//
+
+KateFontStruct::KateFontStruct()
+: myFont(KGlobalSettings::fixedFont()),
+ myFontBold(KGlobalSettings::fixedFont()),
+ myFontItalic(KGlobalSettings::fixedFont()),
+ myFontBI(KGlobalSettings::fixedFont()),
+ myFontMetrics(myFont),
+ myFontMetricsBold(myFontBold),
+ myFontMetricsItalic(myFontItalic),
+ myFontMetricsBI(myFontBI),
+ m_fixedPitch (false)
+{
+ updateFontData ();
+}
+
+KateFontStruct::~KateFontStruct()
+{
+}
+
+void KateFontStruct::updateFontData ()
+{
+ int maxAscent = myFontMetrics.ascent();
+ int maxDescent = myFontMetrics.descent();
+
+ fontHeight = maxAscent + maxDescent + 1;
+ fontAscent = maxAscent;
+
+ m_fixedPitch = QFontInfo( myFont ).fixedPitch();
+}
+
+void KateFontStruct::setFont (const QFont & font)
+{
+ QFontMetrics testFM (font);
+
+ // no valid font tried
+ if ((testFM.ascent() + testFM.descent() + 1) < 1)
+ return;
+
+ myFont = font;
+
+ myFontBold = QFont (font);
+ myFontBold.setBold (true);
+
+ myFontItalic = QFont (font);
+ myFontItalic.setItalic (true);
+
+ myFontBI = QFont (font);
+ myFontBI.setBold (true);
+ myFontBI.setItalic (true);
+
+ myFontMetrics = KateFontMetrics (myFont);
+ myFontMetricsBold = KateFontMetrics (myFontBold);
+ myFontMetricsItalic = KateFontMetrics (myFontItalic);
+ myFontMetricsBI = KateFontMetrics (myFontBI);
+
+ updateFontData ();
+}
+
+// kate: space-indent on; indent-width 2; replace-tabs on;
diff --git a/kate/part/katefont.h b/kate/part/katefont.h
new file mode 100644
index 000000000..02c2106c4
--- /dev/null
+++ b/kate/part/katefont.h
@@ -0,0 +1,114 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2002 Christian Couder <christian@kdevelop.org>
+ Copyright (C) 2001 Christoph Cullmann <cullmann@kde.org>
+ Copyright (C) 2001 Joseph Wenninger <jowenn@kde.org>
+ Copyright (C) 1999 Jochen Wilhelmy <digisnap@cs.tu-berlin.de>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef __kate_font_h__
+#define __kate_font_h__
+
+#include <qfont.h>
+#include <qfontmetrics.h>
+
+//
+// KateFontMetrics implementation
+//
+
+class KateFontMetrics : public QFontMetrics
+{
+ public:
+ KateFontMetrics(const QFont& f);
+ ~KateFontMetrics();
+
+ int width(QChar c);
+
+ int width(QString s) { return QFontMetrics::width(s); }
+
+ private:
+ short *createRow (short *wa, uchar row);
+
+ private:
+ short *warray[256];
+};
+
+//
+// KateFontStruct definition
+//
+
+class KateFontStruct
+{
+ public:
+ KateFontStruct();
+ ~KateFontStruct();
+
+ void setFont(const QFont & font);
+
+ private:
+ void updateFontData ();
+
+ public:
+ inline int width (const QString& text, int col, bool bold, bool italic, int tabWidth)
+ {
+ if (text[col] == QChar('\t'))
+ return tabWidth * myFontMetrics.width(' ');
+
+ return (bold) ?
+ ( (italic) ?
+ myFontMetricsBI.charWidth(text, col) :
+ myFontMetricsBold.charWidth(text, col) ) :
+ ( (italic) ?
+ myFontMetricsItalic.charWidth(text, col) :
+ myFontMetrics.charWidth(text, col) );
+ }
+
+ inline int width (const QChar& c, bool bold, bool italic, int tabWidth)
+ {
+ if (c == QChar('\t'))
+ return tabWidth * myFontMetrics.width(' ');
+
+ return (bold) ?
+ ( (italic) ?
+ myFontMetricsBI.width(c) :
+ myFontMetricsBold.width(c) ) :
+ ( (italic) ?
+ myFontMetricsItalic.width(c) :
+ myFontMetrics.width(c) );
+ }
+
+ inline const QFont& font(bool bold, bool italic) const
+ {
+ return (bold) ?
+ ( (italic) ? myFontBI : myFontBold ) :
+ ( (italic) ? myFontItalic : myFont );
+ }
+
+ inline bool fixedPitch() const { return m_fixedPitch; }
+
+ public:
+ QFont myFont, myFontBold, myFontItalic, myFontBI;
+
+ KateFontMetrics myFontMetrics, myFontMetricsBold, myFontMetricsItalic, myFontMetricsBI;
+
+ int fontHeight;
+ int fontAscent;
+
+ private:
+ bool m_fixedPitch;
+};
+
+#endif
diff --git a/kate/part/katehighlight.cpp b/kate/part/katehighlight.cpp
new file mode 100644
index 000000000..84bfc67fd
--- /dev/null
+++ b/kate/part/katehighlight.cpp
@@ -0,0 +1,3473 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2003, 2004 Anders Lund <anders@alweb.dk>
+ Copyright (C) 2003 Hamish Rodda <rodda@kde.org>
+ Copyright (C) 2001,2002 Joseph Wenninger <jowenn@kde.org>
+ Copyright (C) 2001 Christoph Cullmann <cullmann@kde.org>
+ Copyright (C) 1999 Jochen Wilhelmy <digisnap@cs.tu-berlin.de>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+//BEGIN INCLUDES
+#include "katehighlight.h"
+#include "katehighlight.moc"
+
+#include "katetextline.h"
+#include "katedocument.h"
+#include "katesyntaxdocument.h"
+#include "katerenderer.h"
+#include "katefactory.h"
+#include "kateschema.h"
+#include "kateconfig.h"
+
+#include <kconfig.h>
+#include <kglobal.h>
+#include <kinstance.h>
+#include <kmimetype.h>
+#include <klocale.h>
+#include <kregexp.h>
+#include <kpopupmenu.h>
+#include <kglobalsettings.h>
+#include <kdebug.h>
+#include <kstandarddirs.h>
+#include <kmessagebox.h>
+#include <kstaticdeleter.h>
+#include <kapplication.h>
+
+#include <qstringlist.h>
+#include <qtextstream.h>
+//END
+
+//BEGIN defines
+// same as in kmimemagic, no need to feed more data
+#define KATE_HL_HOWMANY 1024
+
+// min. x seconds between two dynamic contexts reset
+static const int KATE_DYNAMIC_CONTEXTS_RESET_DELAY = 30 * 1000;
+
+// x is a QString. if x is "true" or "1" this expression returns "true"
+#define IS_TRUE(x) x.lower() == QString("true") || x.toInt() == 1
+//END defines
+
+//BEGIN Prviate HL classes
+
+inline bool kateInsideString (const QString &str, QChar ch)
+{
+ const QChar *unicode = str.unicode();
+ const uint len = str.length();
+ for (uint i=0; i < len; i++)
+ if (unicode[i] == ch)
+ return true;
+
+ return false;
+}
+
+class KateHlItem
+{
+ public:
+ KateHlItem(int attribute, int context,signed char regionId, signed char regionId2);
+ virtual ~KateHlItem();
+
+ public:
+ // caller must keep in mind: LEN > 0 is a must !!!!!!!!!!!!!!!!!!!!!1
+ // Now, the function returns the offset detected, or 0 if no match is found.
+ // bool linestart isn't needed, this is equivalent to offset == 0.
+ virtual int checkHgl(const QString& text, int offset, int len) = 0;
+
+ virtual bool lineContinue(){return false;}
+
+ virtual QStringList *capturedTexts() {return 0;}
+ virtual KateHlItem *clone(const QStringList *) {return this;}
+
+ static void dynamicSubstitute(QString& str, const QStringList *args);
+
+ QMemArray<KateHlItem*> subItems;
+ int attr;
+ int ctx;
+ signed char region;
+ signed char region2;
+
+ bool lookAhead;
+
+ bool dynamic;
+ bool dynamicChild;
+ bool firstNonSpace;
+ bool onlyConsume;
+ int column;
+
+ // start enable flags, nicer than the virtual methodes
+ // saves function calls
+ bool alwaysStartEnable;
+ bool customStartEnable;
+};
+
+class KateHlContext
+{
+ public:
+ KateHlContext(const QString &_hlId, int attribute, int lineEndContext,int _lineBeginContext,
+ bool _fallthrough, int _fallthroughContext, bool _dynamic,bool _noIndentationBasedFolding);
+ virtual ~KateHlContext();
+ KateHlContext *clone(const QStringList *args);
+
+ QValueVector<KateHlItem*> items;
+ QString hlId; ///< A unique highlight identifier. Used to look up correct properties.
+ int attr;
+ int ctx;
+ int lineBeginContext;
+ /** @internal anders: possible escape if no rules matches.
+ false unless 'fallthrough="1|true"' (insensitive)
+ if true, go to ftcxt w/o eating of string.
+ ftctx is "fallthroughContext" in xml files, valid values are int or #pop[..]
+ see in KateHighlighting::doHighlight */
+ bool fallthrough;
+ int ftctx; // where to go after no rules matched
+
+ bool dynamic;
+ bool dynamicChild;
+ bool noIndentationBasedFolding;
+};
+
+class KateEmbeddedHlInfo
+{
+ public:
+ KateEmbeddedHlInfo() {loaded=false;context0=-1;}
+ KateEmbeddedHlInfo(bool l, int ctx0) {loaded=l;context0=ctx0;}
+
+ public:
+ bool loaded;
+ int context0;
+};
+
+class KateHlIncludeRule
+{
+ public:
+ KateHlIncludeRule(int ctx_=0, uint pos_=0, const QString &incCtxN_="", bool incAttrib=false)
+ : ctx(ctx_)
+ , pos( pos_)
+ , incCtxN( incCtxN_ )
+ , includeAttrib( incAttrib )
+ {
+ incCtx=-1;
+ }
+ //KateHlIncludeRule(int ctx_, uint pos_, bool incAttrib) {ctx=ctx_;pos=pos_;incCtx=-1;incCtxN="";includeAttrib=incAttrib}
+
+ public:
+ int ctx;
+ uint pos;
+ int incCtx;
+ QString incCtxN;
+ bool includeAttrib;
+};
+
+class KateHlCharDetect : public KateHlItem
+{
+ public:
+ KateHlCharDetect(int attribute, int context,signed char regionId,signed char regionId2, QChar);
+
+ virtual int checkHgl(const QString& text, int offset, int len);
+ virtual KateHlItem *clone(const QStringList *args);
+
+ private:
+ QChar sChar;
+};
+
+class KateHl2CharDetect : public KateHlItem
+{
+ public:
+ KateHl2CharDetect(int attribute, int context, signed char regionId,signed char regionId2, QChar ch1, QChar ch2);
+ KateHl2CharDetect(int attribute, int context,signed char regionId,signed char regionId2, const QChar *ch);
+
+ virtual int checkHgl(const QString& text, int offset, int len);
+ virtual KateHlItem *clone(const QStringList *args);
+
+ private:
+ QChar sChar1;
+ QChar sChar2;
+};
+
+class KateHlStringDetect : public KateHlItem
+{
+ public:
+ KateHlStringDetect(int attribute, int context, signed char regionId,signed char regionId2, const QString &, bool inSensitive=false);
+
+ virtual int checkHgl(const QString& text, int offset, int len);
+ virtual KateHlItem *clone(const QStringList *args);
+
+ private:
+ const QString str;
+ const int strLen;
+ const bool _inSensitive;
+};
+
+class KateHlRangeDetect : public KateHlItem
+{
+ public:
+ KateHlRangeDetect(int attribute, int context, signed char regionId,signed char regionId2, QChar ch1, QChar ch2);
+
+ virtual int checkHgl(const QString& text, int offset, int len);
+
+ private:
+ QChar sChar1;
+ QChar sChar2;
+};
+
+class KateHlKeyword : public KateHlItem
+{
+ public:
+ KateHlKeyword(int attribute, int context,signed char regionId,signed char regionId2, bool insensitive, const QString& delims);
+ virtual ~KateHlKeyword ();
+
+ void addList(const QStringList &);
+ virtual int checkHgl(const QString& text, int offset, int len);
+
+ private:
+ QMemArray< QDict<bool>* > dict;
+ bool _insensitive;
+ const QString& deliminators;
+ int minLen;
+ int maxLen;
+};
+
+class KateHlInt : public KateHlItem
+{
+ public:
+ KateHlInt(int attribute, int context, signed char regionId,signed char regionId2);
+
+ virtual int checkHgl(const QString& text, int offset, int len);
+};
+
+class KateHlFloat : public KateHlItem
+{
+ public:
+ KateHlFloat(int attribute, int context, signed char regionId,signed char regionId2);
+ virtual ~KateHlFloat () {}
+
+ virtual int checkHgl(const QString& text, int offset, int len);
+};
+
+class KateHlCFloat : public KateHlFloat
+{
+ public:
+ KateHlCFloat(int attribute, int context, signed char regionId,signed char regionId2);
+
+ virtual int checkHgl(const QString& text, int offset, int len);
+ int checkIntHgl(const QString& text, int offset, int len);
+};
+
+class KateHlCOct : public KateHlItem
+{
+ public:
+ KateHlCOct(int attribute, int context, signed char regionId,signed char regionId2);
+
+ virtual int checkHgl(const QString& text, int offset, int len);
+};
+
+class KateHlCHex : public KateHlItem
+{
+ public:
+ KateHlCHex(int attribute, int context, signed char regionId,signed char regionId2);
+
+ virtual int checkHgl(const QString& text, int offset, int len);
+};
+
+class KateHlLineContinue : public KateHlItem
+{
+ public:
+ KateHlLineContinue(int attribute, int context, signed char regionId,signed char regionId2);
+
+ virtual bool endEnable(QChar c) {return c == '\0';}
+ virtual int checkHgl(const QString& text, int offset, int len);
+ virtual bool lineContinue(){return true;}
+};
+
+class KateHlCStringChar : public KateHlItem
+{
+ public:
+ KateHlCStringChar(int attribute, int context, signed char regionId,signed char regionId2);
+
+ virtual int checkHgl(const QString& text, int offset, int len);
+};
+
+class KateHlCChar : public KateHlItem
+{
+ public:
+ KateHlCChar(int attribute, int context,signed char regionId,signed char regionId2);
+
+ virtual int checkHgl(const QString& text, int offset, int len);
+};
+
+class KateHlAnyChar : public KateHlItem
+{
+ public:
+ KateHlAnyChar(int attribute, int context, signed char regionId,signed char regionId2, const QString& charList);
+
+ virtual int checkHgl(const QString& text, int offset, int len);
+
+ private:
+ const QString _charList;
+};
+
+class KateHlRegExpr : public KateHlItem
+{
+ public:
+ KateHlRegExpr(int attribute, int context,signed char regionId,signed char regionId2 ,QString expr, bool insensitive, bool minimal);
+ ~KateHlRegExpr() { delete Expr; };
+
+ virtual int checkHgl(const QString& text, int offset, int len);
+ virtual QStringList *capturedTexts();
+ virtual KateHlItem *clone(const QStringList *args);
+
+ private:
+ QRegExp *Expr;
+ bool handlesLinestart;
+ QString _regexp;
+ bool _insensitive;
+ bool _minimal;
+};
+
+class KateHlDetectSpaces : public KateHlItem
+{
+ public:
+ KateHlDetectSpaces (int attribute, int context,signed char regionId,signed char regionId2)
+ : KateHlItem(attribute,context,regionId,regionId2) {}
+
+ virtual int checkHgl(const QString& text, int offset, int len)
+ {
+ int len2 = offset + len;
+ while ((offset < len2) && text[offset].isSpace()) offset++;
+ return offset;
+ }
+};
+
+class KateHlDetectIdentifier : public KateHlItem
+{
+ public:
+ KateHlDetectIdentifier (int attribute, int context,signed char regionId,signed char regionId2)
+ : KateHlItem(attribute,context,regionId,regionId2) { alwaysStartEnable = false; }
+
+ virtual int checkHgl(const QString& text, int offset, int len)
+ {
+ // first char should be a letter or underscore
+ if ( text[offset].isLetter() || text[offset] == QChar ('_') )
+ {
+ // memorize length
+ int len2 = offset+len;
+
+ // one char seen
+ offset++;
+
+ // now loop for all other thingies
+ while (
+ (offset < len2)
+ && (text[offset].isLetterOrNumber() || (text[offset] == QChar ('_')))
+ )
+ offset++;
+
+ return offset;
+ }
+
+ return 0;
+ }
+};
+
+//END
+
+//BEGIN STATICS
+KateHlManager *KateHlManager::s_self = 0;
+
+static const bool trueBool = true;
+static const QString stdDeliminator = QString (" \t.():!+,-<=>%&*/;?[]^{|}~\\");
+//END
+
+//BEGIN NON MEMBER FUNCTIONS
+static KateHlItemData::ItemStyles getDefStyleNum(QString name)
+{
+ if (name=="dsNormal") return KateHlItemData::dsNormal;
+ else if (name=="dsKeyword") return KateHlItemData::dsKeyword;
+ else if (name=="dsDataType") return KateHlItemData::dsDataType;
+ else if (name=="dsDecVal") return KateHlItemData::dsDecVal;
+ else if (name=="dsBaseN") return KateHlItemData::dsBaseN;
+ else if (name=="dsFloat") return KateHlItemData::dsFloat;
+ else if (name=="dsChar") return KateHlItemData::dsChar;
+ else if (name=="dsString") return KateHlItemData::dsString;
+ else if (name=="dsComment") return KateHlItemData::dsComment;
+ else if (name=="dsOthers") return KateHlItemData::dsOthers;
+ else if (name=="dsAlert") return KateHlItemData::dsAlert;
+ else if (name=="dsFunction") return KateHlItemData::dsFunction;
+ else if (name=="dsRegionMarker") return KateHlItemData::dsRegionMarker;
+ else if (name=="dsError") return KateHlItemData::dsError;
+
+ return KateHlItemData::dsNormal;
+}
+//END
+
+//BEGIN KateHlItem
+KateHlItem::KateHlItem(int attribute, int context,signed char regionId,signed char regionId2)
+ : attr(attribute),
+ ctx(context),
+ region(regionId),
+ region2(regionId2),
+ lookAhead(false),
+ dynamic(false),
+ dynamicChild(false),
+ firstNonSpace(false),
+ onlyConsume(false),
+ column (-1),
+ alwaysStartEnable (true),
+ customStartEnable (false)
+{
+}
+
+KateHlItem::~KateHlItem()
+{
+ //kdDebug(13010)<<"In hlItem::~KateHlItem()"<<endl;
+ for (uint i=0; i < subItems.size(); i++)
+ delete subItems[i];
+}
+
+void KateHlItem::dynamicSubstitute(QString &str, const QStringList *args)
+{
+ for (uint i = 0; i < str.length() - 1; ++i)
+ {
+ if (str[i] == '%')
+ {
+ char c = str[i + 1].latin1();
+ if (c == '%')
+ str.replace(i, 1, "");
+ else if (c >= '0' && c <= '9')
+ {
+ if ((uint)(c - '0') < args->size())
+ {
+ str.replace(i, 2, (*args)[c - '0']);
+ i += ((*args)[c - '0']).length() - 1;
+ }
+ else
+ {
+ str.replace(i, 2, "");
+ --i;
+ }
+ }
+ }
+ }
+}
+//END
+
+//BEGIN KateHlCharDetect
+KateHlCharDetect::KateHlCharDetect(int attribute, int context, signed char regionId,signed char regionId2, QChar c)
+ : KateHlItem(attribute,context,regionId,regionId2)
+ , sChar(c)
+{
+}
+
+int KateHlCharDetect::checkHgl(const QString& text, int offset, int /*len*/)
+{
+ if (text[offset] == sChar)
+ return offset + 1;
+
+ return 0;
+}
+
+KateHlItem *KateHlCharDetect::clone(const QStringList *args)
+{
+ char c = sChar.latin1();
+
+ if (c < '0' || c > '9' || (unsigned)(c - '0') >= args->size())
+ return this;
+
+ KateHlCharDetect *ret = new KateHlCharDetect(attr, ctx, region, region2, (*args)[c - '0'][0]);
+ ret->dynamicChild = true;
+ return ret;
+}
+//END
+
+//BEGIN KateHl2CharDetect
+KateHl2CharDetect::KateHl2CharDetect(int attribute, int context, signed char regionId,signed char regionId2, QChar ch1, QChar ch2)
+ : KateHlItem(attribute,context,regionId,regionId2)
+ , sChar1 (ch1)
+ , sChar2 (ch2)
+{
+}
+
+int KateHl2CharDetect::checkHgl(const QString& text, int offset, int len)
+{
+ if ((len >= 2) && text[offset++] == sChar1 && text[offset++] == sChar2)
+ return offset;
+
+ return 0;
+}
+
+KateHlItem *KateHl2CharDetect::clone(const QStringList *args)
+{
+ char c1 = sChar1.latin1();
+ char c2 = sChar2.latin1();
+
+ if (c1 < '0' || c1 > '9' || (unsigned)(c1 - '0') >= args->size())
+ return this;
+
+ if (c2 < '0' || c2 > '9' || (unsigned)(c2 - '0') >= args->size())
+ return this;
+
+ KateHl2CharDetect *ret = new KateHl2CharDetect(attr, ctx, region, region2, (*args)[c1 - '0'][0], (*args)[c2 - '0'][0]);
+ ret->dynamicChild = true;
+ return ret;
+}
+//END
+
+//BEGIN KateHlStringDetect
+KateHlStringDetect::KateHlStringDetect(int attribute, int context, signed char regionId,signed char regionId2,const QString &s, bool inSensitive)
+ : KateHlItem(attribute, context,regionId,regionId2)
+ , str(inSensitive ? s.upper() : s)
+ , strLen (str.length())
+ , _inSensitive(inSensitive)
+{
+}
+
+int KateHlStringDetect::checkHgl(const QString& text, int offset, int len)
+{
+ if (len < strLen)
+ return 0;
+
+ if (_inSensitive)
+ {
+ for (int i=0; i < strLen; i++)
+ if (text[offset++].upper() != str[i])
+ return 0;
+
+ return offset;
+ }
+ else
+ {
+ for (int i=0; i < strLen; i++)
+ if (text[offset++] != str[i])
+ return 0;
+
+ return offset;
+ }
+
+ return 0;
+}
+
+KateHlItem *KateHlStringDetect::clone(const QStringList *args)
+{
+ QString newstr = str;
+
+ dynamicSubstitute(newstr, args);
+
+ if (newstr == str)
+ return this;
+
+ KateHlStringDetect *ret = new KateHlStringDetect(attr, ctx, region, region2, newstr, _inSensitive);
+ ret->dynamicChild = true;
+ return ret;
+}
+//END
+
+//BEGIN KateHlRangeDetect
+KateHlRangeDetect::KateHlRangeDetect(int attribute, int context, signed char regionId,signed char regionId2, QChar ch1, QChar ch2)
+ : KateHlItem(attribute,context,regionId,regionId2)
+ , sChar1 (ch1)
+ , sChar2 (ch2)
+{
+}
+
+int KateHlRangeDetect::checkHgl(const QString& text, int offset, int len)
+{
+ if (text[offset] == sChar1)
+ {
+ do
+ {
+ offset++;
+ len--;
+ if (len < 1) return 0;
+ }
+ while (text[offset] != sChar2);
+
+ return offset + 1;
+ }
+ return 0;
+}
+//END
+
+//BEGIN KateHlKeyword
+KateHlKeyword::KateHlKeyword (int attribute, int context, signed char regionId,signed char regionId2, bool insensitive, const QString& delims)
+ : KateHlItem(attribute,context,regionId,regionId2)
+ , _insensitive(insensitive)
+ , deliminators(delims)
+ , minLen (0xFFFFFF)
+ , maxLen (0)
+{
+ alwaysStartEnable = false;
+ customStartEnable = true;
+}
+
+KateHlKeyword::~KateHlKeyword ()
+{
+ for (uint i=0; i < dict.size(); ++i)
+ delete dict[i];
+}
+
+void KateHlKeyword::addList(const QStringList& list)
+{
+ for(uint i=0; i < list.count(); ++i)
+ {
+ int len = list[i].length();
+
+ if (minLen > len)
+ minLen = len;
+
+ if (maxLen < len)
+ maxLen = len;
+
+ if ((uint)len >= dict.size())
+ {
+ uint oldSize = dict.size();
+ dict.resize (len+1);
+
+ for (uint m=oldSize; m < dict.size(); ++m)
+ dict[m] = 0;
+ }
+
+ if (!dict[len])
+ dict[len] = new QDict<bool> (17, !_insensitive);
+
+ dict[len]->insert(list[i], &trueBool);
+ }
+}
+
+int KateHlKeyword::checkHgl(const QString& text, int offset, int len)
+{
+ int offset2 = offset;
+ int wordLen = 0;
+
+ while ((len > wordLen) && !kateInsideString (deliminators, text[offset2]))
+ {
+ offset2++;
+ wordLen++;
+
+ if (wordLen > maxLen) return 0;
+ }
+
+ if (wordLen < minLen) return 0;
+
+ if ( dict[wordLen] && dict[wordLen]->find(QConstString(text.unicode() + offset, wordLen).string()) )
+ return offset2;
+
+ return 0;
+}
+//END
+
+//BEGIN KateHlInt
+KateHlInt::KateHlInt(int attribute, int context, signed char regionId,signed char regionId2)
+ : KateHlItem(attribute,context,regionId,regionId2)
+{
+ alwaysStartEnable = false;
+}
+
+int KateHlInt::checkHgl(const QString& text, int offset, int len)
+{
+ int offset2 = offset;
+
+ while ((len > 0) && text[offset2].isDigit())
+ {
+ offset2++;
+ len--;
+ }
+
+ if (offset2 > offset)
+ {
+ if (len > 0)
+ {
+ for (uint i=0; i < subItems.size(); i++)
+ {
+ if ( (offset = subItems[i]->checkHgl(text, offset2, len)) )
+ return offset;
+ }
+ }
+
+ return offset2;
+ }
+
+ return 0;
+}
+//END
+
+//BEGIN KateHlFloat
+KateHlFloat::KateHlFloat(int attribute, int context, signed char regionId,signed char regionId2)
+ : KateHlItem(attribute,context, regionId,regionId2)
+{
+ alwaysStartEnable = false;
+}
+
+int KateHlFloat::checkHgl(const QString& text, int offset, int len)
+{
+ bool b = false;
+ bool p = false;
+
+ while ((len > 0) && text[offset].isDigit())
+ {
+ offset++;
+ len--;
+ b = true;
+ }
+
+ if ((len > 0) && (p = (text[offset] == '.')))
+ {
+ offset++;
+ len--;
+
+ while ((len > 0) && text[offset].isDigit())
+ {
+ offset++;
+ len--;
+ b = true;
+ }
+ }
+
+ if (!b)
+ return 0;
+
+ if ((len > 0) && ((text[offset] & 0xdf) == 'E'))
+ {
+ offset++;
+ len--;
+ }
+ else
+ {
+ if (!p)
+ return 0;
+ else
+ {
+ if (len > 0)
+ {
+ for (uint i=0; i < subItems.size(); i++)
+ {
+ int offset2 = subItems[i]->checkHgl(text, offset, len);
+
+ if (offset2)
+ return offset2;
+ }
+ }
+
+ return offset;
+ }
+ }
+
+ if ((len > 0) && (text[offset] == '-' || text[offset] =='+'))
+ {
+ offset++;
+ len--;
+ }
+
+ b = false;
+
+ while ((len > 0) && text[offset].isDigit())
+ {
+ offset++;
+ len--;
+ b = true;
+ }
+
+ if (b)
+ {
+ if (len > 0)
+ {
+ for (uint i=0; i < subItems.size(); i++)
+ {
+ int offset2 = subItems[i]->checkHgl(text, offset, len);
+
+ if (offset2)
+ return offset2;
+ }
+ }
+
+ return offset;
+ }
+
+ return 0;
+}
+//END
+
+//BEGIN KateHlCOct
+KateHlCOct::KateHlCOct(int attribute, int context, signed char regionId,signed char regionId2)
+ : KateHlItem(attribute,context,regionId,regionId2)
+{
+ alwaysStartEnable = false;
+}
+
+int KateHlCOct::checkHgl(const QString& text, int offset, int len)
+{
+ if (text[offset] == '0')
+ {
+ offset++;
+ len--;
+
+ int offset2 = offset;
+
+ while ((len > 0) && (text[offset2] >= '0' && text[offset2] <= '7'))
+ {
+ offset2++;
+ len--;
+ }
+
+ if (offset2 > offset)
+ {
+ if ((len > 0) && ((text[offset2] & 0xdf) == 'L' || (text[offset] & 0xdf) == 'U' ))
+ offset2++;
+
+ return offset2;
+ }
+ }
+
+ return 0;
+}
+//END
+
+//BEGIN KateHlCHex
+KateHlCHex::KateHlCHex(int attribute, int context,signed char regionId,signed char regionId2)
+ : KateHlItem(attribute,context,regionId,regionId2)
+{
+ alwaysStartEnable = false;
+}
+
+int KateHlCHex::checkHgl(const QString& text, int offset, int len)
+{
+ if ((len > 1) && (text[offset++] == '0') && ((text[offset++] & 0xdf) == 'X' ))
+ {
+ len -= 2;
+
+ int offset2 = offset;
+
+ while ((len > 0) && (text[offset2].isDigit() || ((text[offset2] & 0xdf) >= 'A' && (text[offset2] & 0xdf) <= 'F')))
+ {
+ offset2++;
+ len--;
+ }
+
+ if (offset2 > offset)
+ {
+ if ((len > 0) && ((text[offset2] & 0xdf) == 'L' || (text[offset2] & 0xdf) == 'U' ))
+ offset2++;
+
+ return offset2;
+ }
+ }
+
+ return 0;
+}
+//END
+
+//BEGIN KateHlCFloat
+KateHlCFloat::KateHlCFloat(int attribute, int context, signed char regionId,signed char regionId2)
+ : KateHlFloat(attribute,context,regionId,regionId2)
+{
+ alwaysStartEnable = false;
+}
+
+int KateHlCFloat::checkIntHgl(const QString& text, int offset, int len)
+{
+ int offset2 = offset;
+
+ while ((len > 0) && text[offset].isDigit()) {
+ offset2++;
+ len--;
+ }
+
+ if (offset2 > offset)
+ return offset2;
+
+ return 0;
+}
+
+int KateHlCFloat::checkHgl(const QString& text, int offset, int len)
+{
+ int offset2 = KateHlFloat::checkHgl(text, offset, len);
+
+ if (offset2)
+ {
+ if ((text[offset2] & 0xdf) == 'F' )
+ offset2++;
+
+ return offset2;
+ }
+ else
+ {
+ offset2 = checkIntHgl(text, offset, len);
+
+ if (offset2 && ((text[offset2] & 0xdf) == 'F' ))
+ return ++offset2;
+ else
+ return 0;
+ }
+}
+//END
+
+//BEGIN KateHlAnyChar
+KateHlAnyChar::KateHlAnyChar(int attribute, int context, signed char regionId,signed char regionId2, const QString& charList)
+ : KateHlItem(attribute, context,regionId,regionId2)
+ , _charList(charList)
+{
+}
+
+int KateHlAnyChar::checkHgl(const QString& text, int offset, int)
+{
+ if (kateInsideString (_charList, text[offset]))
+ return ++offset;
+
+ return 0;
+}
+//END
+
+//BEGIN KateHlRegExpr
+KateHlRegExpr::KateHlRegExpr( int attribute, int context, signed char regionId,signed char regionId2, QString regexp, bool insensitive, bool minimal)
+ : KateHlItem(attribute, context, regionId,regionId2)
+ , handlesLinestart (regexp.startsWith("^"))
+ , _regexp(regexp)
+ , _insensitive(insensitive)
+ , _minimal(minimal)
+{
+ if (!handlesLinestart)
+ regexp.prepend("^");
+
+ Expr = new QRegExp(regexp, !_insensitive);
+ Expr->setMinimal(_minimal);
+}
+
+int KateHlRegExpr::checkHgl(const QString& text, int offset, int /*len*/)
+{
+ if (offset && handlesLinestart)
+ return 0;
+
+ int offset2 = Expr->search( text, offset, QRegExp::CaretAtOffset );
+
+ if (offset2 == -1) return 0;
+
+ return (offset + Expr->matchedLength());
+}
+
+QStringList *KateHlRegExpr::capturedTexts()
+{
+ return new QStringList(Expr->capturedTexts());
+}
+
+KateHlItem *KateHlRegExpr::clone(const QStringList *args)
+{
+ QString regexp = _regexp;
+ QStringList escArgs = *args;
+
+ for (QStringList::Iterator it = escArgs.begin(); it != escArgs.end(); ++it)
+ {
+ (*it).replace(QRegExp("(\\W)"), "\\\\1");
+ }
+
+ dynamicSubstitute(regexp, &escArgs);
+
+ if (regexp == _regexp)
+ return this;
+
+ // kdDebug (13010) << "clone regexp: " << regexp << endl;
+
+ KateHlRegExpr *ret = new KateHlRegExpr(attr, ctx, region, region2, regexp, _insensitive, _minimal);
+ ret->dynamicChild = true;
+ return ret;
+}
+//END
+
+//BEGIN KateHlLineContinue
+KateHlLineContinue::KateHlLineContinue(int attribute, int context, signed char regionId,signed char regionId2)
+ : KateHlItem(attribute,context,regionId,regionId2) {
+}
+
+int KateHlLineContinue::checkHgl(const QString& text, int offset, int len)
+{
+ if ((len == 1) && (text[offset] == '\\'))
+ return ++offset;
+
+ return 0;
+}
+//END
+
+//BEGIN KateHlCStringChar
+KateHlCStringChar::KateHlCStringChar(int attribute, int context,signed char regionId,signed char regionId2)
+ : KateHlItem(attribute,context,regionId,regionId2) {
+}
+
+// checks for C escaped chars \n and escaped hex/octal chars
+static int checkEscapedChar(const QString& text, int offset, int& len)
+{
+ int i;
+ if (text[offset] == '\\' && len > 1)
+ {
+ offset++;
+ len--;
+
+ switch(text[offset])
+ {
+ case 'a': // checks for control chars
+ case 'b': // we want to fall through
+ case 'e':
+ case 'f':
+
+ case 'n':
+ case 'r':
+ case 't':
+ case 'v':
+ case '\'':
+ case '\"':
+ case '?' : // added ? ANSI C classifies this as an escaped char
+ case '\\':
+ offset++;
+ len--;
+ break;
+
+ case 'x': // if it's like \xff
+ offset++; // eat the x
+ len--;
+ // these for loops can probably be
+ // replaced with something else but
+ // for right now they work
+ // check for hexdigits
+ for (i = 0; (len > 0) && (i < 2) && (text[offset] >= '0' && text[offset] <= '9' || (text[offset] & 0xdf) >= 'A' && (text[offset] & 0xdf) <= 'F'); i++)
+ {
+ offset++;
+ len--;
+ }
+
+ if (i == 0)
+ return 0; // takes care of case '\x'
+
+ break;
+
+ case '0': case '1': case '2': case '3' :
+ case '4': case '5': case '6': case '7' :
+ for (i = 0; (len > 0) && (i < 3) && (text[offset] >='0'&& text[offset] <='7'); i++)
+ {
+ offset++;
+ len--;
+ }
+ break;
+
+ default:
+ return 0;
+ }
+
+ return offset;
+ }
+
+ return 0;
+}
+
+int KateHlCStringChar::checkHgl(const QString& text, int offset, int len)
+{
+ return checkEscapedChar(text, offset, len);
+}
+//END
+
+//BEGIN KateHlCChar
+KateHlCChar::KateHlCChar(int attribute, int context,signed char regionId,signed char regionId2)
+ : KateHlItem(attribute,context,regionId,regionId2) {
+}
+
+int KateHlCChar::checkHgl(const QString& text, int offset, int len)
+{
+ if ((len > 1) && (text[offset] == '\'') && (text[offset+1] != '\''))
+ {
+ int oldl;
+ oldl = len;
+
+ len--;
+
+ int offset2 = checkEscapedChar(text, offset + 1, len);
+
+ if (!offset2)
+ {
+ if (oldl > 2)
+ {
+ offset2 = offset + 2;
+ len = oldl - 2;
+ }
+ else
+ {
+ return 0;
+ }
+ }
+
+ if ((len > 0) && (text[offset2] == '\''))
+ return ++offset2;
+ }
+
+ return 0;
+}
+//END
+
+//BEGIN KateHl2CharDetect
+KateHl2CharDetect::KateHl2CharDetect(int attribute, int context, signed char regionId,signed char regionId2, const QChar *s)
+ : KateHlItem(attribute,context,regionId,regionId2) {
+ sChar1 = s[0];
+ sChar2 = s[1];
+ }
+//END KateHl2CharDetect
+
+KateHlItemData::KateHlItemData(const QString name, int defStyleNum)
+ : name(name), defStyleNum(defStyleNum) {
+}
+
+KateHlData::KateHlData(const QString &wildcards, const QString &mimetypes, const QString &identifier, int priority)
+ : wildcards(wildcards), mimetypes(mimetypes), identifier(identifier), priority(priority)
+{
+}
+
+//BEGIN KateHlContext
+KateHlContext::KateHlContext (const QString &_hlId, int attribute, int lineEndContext, int _lineBeginContext, bool _fallthrough,
+ int _fallthroughContext, bool _dynamic, bool _noIndentationBasedFolding)
+{
+ hlId = _hlId;
+ attr = attribute;
+ ctx = lineEndContext;
+ lineBeginContext = _lineBeginContext;
+ fallthrough = _fallthrough;
+ ftctx = _fallthroughContext;
+ dynamic = _dynamic;
+ dynamicChild = false;
+ noIndentationBasedFolding=_noIndentationBasedFolding;
+ if (_noIndentationBasedFolding) kdDebug(13010)<<QString("**********************_noIndentationBasedFolding is TRUE*****************")<<endl;
+
+}
+
+KateHlContext *KateHlContext::clone(const QStringList *args)
+{
+ KateHlContext *ret = new KateHlContext(hlId, attr, ctx, lineBeginContext, fallthrough, ftctx, false,noIndentationBasedFolding);
+
+ for (uint n=0; n < items.size(); ++n)
+ {
+ KateHlItem *item = items[n];
+ KateHlItem *i = (item->dynamic ? item->clone(args) : item);
+ ret->items.append(i);
+ }
+
+ ret->dynamicChild = true;
+
+ return ret;
+}
+
+KateHlContext::~KateHlContext()
+{
+ if (dynamicChild)
+ {
+ for (uint n=0; n < items.size(); ++n)
+ {
+ if (items[n]->dynamicChild)
+ delete items[n];
+ }
+ }
+}
+//END
+
+//BEGIN KateHighlighting
+KateHighlighting::KateHighlighting(const KateSyntaxModeListItem *def) : refCount(0)
+{
+ m_attributeArrays.setAutoDelete (true);
+
+ errorsAndWarnings = "";
+ building=false;
+ noHl = false;
+ m_foldingIndentationSensitive = false;
+ folding=false;
+ internalIDList.setAutoDelete(true);
+
+ if (def == 0)
+ {
+ noHl = true;
+ iName = "None"; // not translated internal name (for config and more)
+ iNameTranslated = i18n("None"); // user visible name
+ iSection = "";
+ m_priority = 0;
+ iHidden = false;
+ m_additionalData.insert( "none", new HighlightPropertyBag );
+ m_additionalData["none"]->deliminator = stdDeliminator;
+ m_additionalData["none"]->wordWrapDeliminator = stdDeliminator;
+ m_hlIndex[0] = "none";
+ }
+ else
+ {
+ iName = def->name;
+ iNameTranslated = def->nameTranslated;
+ iSection = def->section;
+ iHidden = def->hidden;
+ iWildcards = def->extension;
+ iMimetypes = def->mimetype;
+ identifier = def->identifier;
+ iVersion=def->version;
+ iAuthor=def->author;
+ iLicense=def->license;
+ m_priority=def->priority.toInt();
+ }
+
+ deliminator = stdDeliminator;
+}
+
+KateHighlighting::~KateHighlighting()
+{
+ // cu contexts
+ for (uint i=0; i < m_contexts.size(); ++i)
+ delete m_contexts[i];
+ m_contexts.clear ();
+}
+
+void KateHighlighting::generateContextStack(int *ctxNum, int ctx, QMemArray<short>* ctxs, int *prevLine)
+{
+ //kdDebug(13010)<<QString("Entering generateContextStack with %1").arg(ctx)<<endl;
+ while (true)
+ {
+ if (ctx >= 0)
+ {
+ (*ctxNum) = ctx;
+
+ ctxs->resize (ctxs->size()+1, QGArray::SpeedOptim);
+ (*ctxs)[ctxs->size()-1]=(*ctxNum);
+
+ return;
+ }
+ else
+ {
+ if (ctx == -1)
+ {
+ (*ctxNum)=( (ctxs->isEmpty() ) ? 0 : (*ctxs)[ctxs->size()-1]);
+ }
+ else
+ {
+ int size = ctxs->size() + ctx + 1;
+
+ if (size > 0)
+ {
+ ctxs->resize (size, QGArray::SpeedOptim);
+ (*ctxNum)=(*ctxs)[size-1];
+ }
+ else
+ {
+ ctxs->resize (0, QGArray::SpeedOptim);
+ (*ctxNum)=0;
+ }
+
+ ctx = 0;
+
+ if ((*prevLine) >= (int)(ctxs->size()-1))
+ {
+ *prevLine=ctxs->size()-1;
+
+ if ( ctxs->isEmpty() )
+ return;
+
+ KateHlContext *c = contextNum((*ctxs)[ctxs->size()-1]);
+ if (c && (c->ctx != -1))
+ {
+ //kdDebug(13010)<<"PrevLine > size()-1 and ctx!=-1)"<<endl;
+ ctx = c->ctx;
+
+ continue;
+ }
+ }
+ }
+
+ return;
+ }
+ }
+}
+
+/**
+ * Creates a new dynamic context or reuse an old one if it has already been created.
+ */
+int KateHighlighting::makeDynamicContext(KateHlContext *model, const QStringList *args)
+{
+ QPair<KateHlContext *, QString> key(model, args->front());
+ short value;
+
+ if (dynamicCtxs.contains(key))
+ value = dynamicCtxs[key];
+ else
+ {
+ kdDebug(13010) << "new stuff: " << startctx << endl;
+
+ KateHlContext *newctx = model->clone(args);
+
+ m_contexts.push_back (newctx);
+
+ value = startctx++;
+ dynamicCtxs[key] = value;
+ KateHlManager::self()->incDynamicCtxs();
+ }
+
+ // kdDebug(13010) << "Dynamic context: using context #" << value << " (for model " << model << " with args " << *args << ")" << endl;
+
+ return value;
+}
+
+/**
+ * Drop all dynamic contexts. Shall be called with extreme care, and shall be immediatly
+ * followed by a full HL invalidation.
+ */
+void KateHighlighting::dropDynamicContexts()
+{
+ for (uint i=base_startctx; i < m_contexts.size(); ++i)
+ delete m_contexts[i];
+
+ m_contexts.resize (base_startctx);
+
+ dynamicCtxs.clear();
+ startctx = base_startctx;
+}
+
+/**
+ * Parse the text and fill in the context array and folding list array
+ *
+ * @param prevLine The previous line, the context array is picked up from that if present.
+ * @param textLine The text line to parse
+ * @param foldingList will be filled
+ * @param ctxChanged will be set to reflect if the context changed
+ */
+void KateHighlighting::doHighlight ( KateTextLine *prevLine,
+ KateTextLine *textLine,
+ QMemArray<uint>* foldingList,
+ bool *ctxChanged )
+{
+ if (!textLine)
+ return;
+
+ if (noHl)
+ {
+ if (textLine->length() > 0)
+ memset (textLine->attributes(), 0, textLine->length());
+
+ return;
+ }
+
+ // duplicate the ctx stack, only once !
+ QMemArray<short> ctx;
+ ctx.duplicate (prevLine->ctxArray());
+
+ int ctxNum = 0;
+ int previousLine = -1;
+ KateHlContext *context;
+
+ if (ctx.isEmpty())
+ {
+ // If the stack is empty, we assume to be in Context 0 (Normal)
+ context = contextNum(ctxNum);
+ }
+ else
+ {
+ // There does an old context stack exist -> find the context at the line start
+ ctxNum = ctx[ctx.size()-1]; //context ID of the last character in the previous line
+
+ //kdDebug(13010) << "\t\tctxNum = " << ctxNum << " contextList[ctxNum] = " << contextList[ctxNum] << endl; // ellis
+
+ //if (lineContinue) kdDebug(13010)<<QString("The old context should be %1").arg((int)ctxNum)<<endl;
+
+ if (!(context = contextNum(ctxNum)))
+ context = contextNum(0);
+
+ //kdDebug(13010)<<"test1-2-1-text2"<<endl;
+
+ previousLine=ctx.size()-1; //position of the last context ID of th previous line within the stack
+
+ // hl continue set or not ???
+ if (prevLine->hlLineContinue())
+ {
+ prevLine--;
+ }
+ else
+ {
+ generateContextStack(&ctxNum, context->ctx, &ctx, &previousLine); //get stack ID to use
+
+ if (!(context = contextNum(ctxNum)))
+ context = contextNum(0);
+ }
+
+ //kdDebug(13010)<<"test1-2-1-text4"<<endl;
+
+ //if (lineContinue) kdDebug(13010)<<QString("The new context is %1").arg((int)ctxNum)<<endl;
+ }
+
+ // text, for programming convenience :)
+ QChar lastChar = ' ';
+ const QString& text = textLine->string();
+ const int len = textLine->length();
+
+ // calc at which char the first char occurs, set it to lenght of line if never
+ const int firstChar = textLine->firstChar();
+ const int startNonSpace = (firstChar == -1) ? len : firstChar;
+
+ // last found item
+ KateHlItem *item = 0;
+
+ // loop over the line, offset gives current offset
+ int offset = 0;
+ while (offset < len)
+ {
+ bool anItemMatched = false;
+ bool standardStartEnableDetermined = false;
+ bool customStartEnableDetermined = false;
+
+ uint index = 0;
+ for (item = context->items.empty() ? 0 : context->items[0]; item; item = (++index < context->items.size()) ? context->items[index] : 0 )
+ {
+ // does we only match if we are firstNonSpace?
+ if (item->firstNonSpace && (offset > startNonSpace))
+ continue;
+
+ // have we a column specified? if yes, only match at this column
+ if ((item->column != -1) && (item->column != offset))
+ continue;
+
+ if (!item->alwaysStartEnable)
+ {
+ if (item->customStartEnable)
+ {
+ if (customStartEnableDetermined || kateInsideString (m_additionalData[context->hlId]->deliminator, lastChar))
+ customStartEnableDetermined = true;
+ else
+ continue;
+ }
+ else
+ {
+ if (standardStartEnableDetermined || kateInsideString (stdDeliminator, lastChar))
+ standardStartEnableDetermined = true;
+ else
+ continue;
+ }
+ }
+
+ int offset2 = item->checkHgl(text, offset, len-offset);
+
+ if (offset2 <= offset)
+ continue;
+ // BUG 144599: Ignore a context change that would push the same context
+ // without eating anything... this would be an infinite loop!
+ if ( item->lookAhead && item->ctx == ctxNum )
+ continue;
+
+ if (item->region2)
+ {
+ // kdDebug(13010)<<QString("Region mark 2 detected: %1").arg(item->region2)<<endl;
+ if ( !foldingList->isEmpty() && ((item->region2 < 0) && (*foldingList)[foldingList->size()-2] == -item->region2 ) )
+ {
+ foldingList->resize (foldingList->size()-2, QGArray::SpeedOptim);
+ }
+ else
+ {
+ foldingList->resize (foldingList->size()+2, QGArray::SpeedOptim);
+ (*foldingList)[foldingList->size()-2] = (uint)item->region2;
+ if (item->region2<0) //check not really needed yet
+ (*foldingList)[foldingList->size()-1] = offset2;
+ else
+ (*foldingList)[foldingList->size()-1] = offset;
+ }
+
+ }
+
+ if (item->region)
+ {
+ // kdDebug(13010)<<QString("Region mark detected: %1").arg(item->region)<<endl;
+
+ /* if ( !foldingList->isEmpty() && ((item->region < 0) && (*foldingList)[foldingList->size()-1] == -item->region ) )
+ {
+ foldingList->resize (foldingList->size()-1, QGArray::SpeedOptim);
+ }
+ else*/
+ {
+ foldingList->resize (foldingList->size()+2, QGArray::SpeedOptim);
+ (*foldingList)[foldingList->size()-2] = item->region;
+ if (item->region<0) //check not really needed yet
+ (*foldingList)[foldingList->size()-1] = offset2;
+ else
+ (*foldingList)[foldingList->size()-1] = offset;
+ }
+
+ }
+
+ // regenerate context stack if needed
+ if (item->ctx != -1)
+ {
+ generateContextStack (&ctxNum, item->ctx, &ctx, &previousLine);
+ context = contextNum(ctxNum);
+ }
+
+ // dynamic context: substitute the model with an 'instance'
+ if (context->dynamic)
+ {
+ QStringList *lst = item->capturedTexts();
+ if (lst != 0)
+ {
+ // Replace the top of the stack and the current context
+ int newctx = makeDynamicContext(context, lst);
+ if (ctx.size() > 0)
+ ctx[ctx.size() - 1] = newctx;
+ ctxNum = newctx;
+ context = contextNum(ctxNum);
+ }
+ delete lst;
+ }
+
+ // dominik: look ahead w/o changing offset?
+ if (!item->lookAhead)
+ {
+ if (offset2 > len)
+ offset2 = len;
+
+ // even set attributes ;)
+ memset ( textLine->attributes()+offset
+ , item->onlyConsume ? context->attr : item->attr
+ , offset2-offset);
+
+ offset = offset2;
+ lastChar = text[offset-1];
+ }
+
+ anItemMatched = true;
+ break;
+ }
+
+ // something matched, continue loop
+ if (anItemMatched)
+ continue;
+
+ // nothing found: set attribute of one char
+ // anders: unless this context does not want that!
+ if ( context->fallthrough )
+ {
+ // set context to context->ftctx.
+ generateContextStack(&ctxNum, context->ftctx, &ctx, &previousLine); //regenerate context stack
+ context=contextNum(ctxNum);
+ //kdDebug(13010)<<"context num after fallthrough at col "<<z<<": "<<ctxNum<<endl;
+ // the next is nessecary, as otherwise keyword (or anything using the std delimitor check)
+ // immediately after fallthrough fails. Is it bad?
+ // jowenn, can you come up with a nicer way to do this?
+ /* if (offset)
+ lastChar = text[offset - 1];
+ else
+ lastChar = '\\';*/
+ continue;
+ }
+ else
+ {
+ *(textLine->attributes() + offset) = context->attr;
+ lastChar = text[offset];
+ offset++;
+ }
+ }
+
+ // has the context stack changed ?
+ if (ctx == textLine->ctxArray())
+ {
+ if (ctxChanged)
+ (*ctxChanged) = false;
+ }
+ else
+ {
+ if (ctxChanged)
+ (*ctxChanged) = true;
+
+ // assign ctx stack !
+ textLine->setContext(ctx);
+ }
+
+ // write hl continue flag
+ textLine->setHlLineContinue (item && item->lineContinue());
+
+ if (m_foldingIndentationSensitive) {
+ bool noindent=false;
+ for(int i=ctx.size()-1; i>=0; --i) {
+ if (contextNum(ctx[i])->noIndentationBasedFolding) {
+ noindent=true;
+ break;
+ }
+ }
+ textLine->setNoIndentBasedFolding(noindent);
+ }
+}
+
+void KateHighlighting::loadWildcards()
+{
+ KConfig *config = KateHlManager::self()->getKConfig();
+ config->setGroup("Highlighting " + iName);
+
+ QString extensionString = config->readEntry("Wildcards", iWildcards);
+
+ if (extensionSource != extensionString) {
+ regexpExtensions.clear();
+ plainExtensions.clear();
+
+ extensionSource = extensionString;
+
+ static QRegExp sep("\\s*;\\s*");
+
+ QStringList l = QStringList::split( sep, extensionSource );
+
+ static QRegExp boringExpression("\\*\\.[\\d\\w]+");
+
+ for( QStringList::Iterator it = l.begin(); it != l.end(); ++it )
+ if (boringExpression.exactMatch(*it))
+ plainExtensions.append((*it).mid(1));
+ else
+ regexpExtensions.append(QRegExp((*it), true, true));
+ }
+}
+
+QValueList<QRegExp>& KateHighlighting::getRegexpExtensions()
+{
+ return regexpExtensions;
+}
+
+QStringList& KateHighlighting::getPlainExtensions()
+{
+ return plainExtensions;
+}
+
+QString KateHighlighting::getMimetypes()
+{
+ KConfig *config = KateHlManager::self()->getKConfig();
+ config->setGroup("Highlighting " + iName);
+
+ return config->readEntry("Mimetypes", iMimetypes);
+}
+
+int KateHighlighting::priority()
+{
+ KConfig *config = KateHlManager::self()->getKConfig();
+ config->setGroup("Highlighting " + iName);
+
+ return config->readNumEntry("Priority", m_priority);
+}
+
+KateHlData *KateHighlighting::getData()
+{
+ KConfig *config = KateHlManager::self()->getKConfig();
+ config->setGroup("Highlighting " + iName);
+
+ KateHlData *hlData = new KateHlData(
+ config->readEntry("Wildcards", iWildcards),
+ config->readEntry("Mimetypes", iMimetypes),
+ config->readEntry("Identifier", identifier),
+ config->readNumEntry("Priority", m_priority));
+
+ return hlData;
+}
+
+void KateHighlighting::setData(KateHlData *hlData)
+{
+ KConfig *config = KateHlManager::self()->getKConfig();
+ config->setGroup("Highlighting " + iName);
+
+ config->writeEntry("Wildcards",hlData->wildcards);
+ config->writeEntry("Mimetypes",hlData->mimetypes);
+ config->writeEntry("Priority",hlData->priority);
+}
+
+void KateHighlighting::getKateHlItemDataList (uint schema, KateHlItemDataList &list)
+{
+ KConfig *config = KateHlManager::self()->getKConfig();
+ config->setGroup("Highlighting " + iName + " - Schema " + KateFactory::self()->schemaManager()->name(schema));
+
+ list.clear();
+ createKateHlItemData(list);
+
+ for (KateHlItemData *p = list.first(); p != 0L; p = list.next())
+ {
+ QStringList s = config->readListEntry(p->name);
+
+// kdDebug(13010)<<p->name<<s.count()<<endl;
+ if (s.count()>0)
+ {
+
+ while(s.count()<9) s<<"";
+ p->clear();
+
+ QString tmp=s[0]; if (!tmp.isEmpty()) p->defStyleNum=tmp.toInt();
+
+ QRgb col;
+
+ tmp=s[1]; if (!tmp.isEmpty()) {
+ col=tmp.toUInt(0,16); p->setTextColor(col); }
+
+ tmp=s[2]; if (!tmp.isEmpty()) {
+ col=tmp.toUInt(0,16); p->setSelectedTextColor(col); }
+
+ tmp=s[3]; if (!tmp.isEmpty()) p->setBold(tmp!="0");
+
+ tmp=s[4]; if (!tmp.isEmpty()) p->setItalic(tmp!="0");
+
+ tmp=s[5]; if (!tmp.isEmpty()) p->setStrikeOut(tmp!="0");
+
+ tmp=s[6]; if (!tmp.isEmpty()) p->setUnderline(tmp!="0");
+
+ tmp=s[7]; if (!tmp.isEmpty()) {
+ col=tmp.toUInt(0,16); p->setBGColor(col); }
+
+ tmp=s[8]; if (!tmp.isEmpty()) {
+ col=tmp.toUInt(0,16); p->setSelectedBGColor(col); }
+
+ }
+ }
+}
+
+/**
+ * Saves the KateHlData attribute definitions to the config file.
+ *
+ * @param schema The id of the schema group to save
+ * @param list KateHlItemDataList containing the data to be used
+ */
+void KateHighlighting::setKateHlItemDataList(uint schema, KateHlItemDataList &list)
+{
+ KConfig *config = KateHlManager::self()->getKConfig();
+ config->setGroup("Highlighting " + iName + " - Schema "
+ + KateFactory::self()->schemaManager()->name(schema));
+
+ QStringList settings;
+
+ for (KateHlItemData *p = list.first(); p != 0L; p = list.next())
+ {
+ settings.clear();
+ settings<<QString::number(p->defStyleNum,10);
+ settings<<(p->itemSet(KateAttribute::TextColor)?QString::number(p->textColor().rgb(),16):"");
+ settings<<(p->itemSet(KateAttribute::SelectedTextColor)?QString::number(p->selectedTextColor().rgb(),16):"");
+ settings<<(p->itemSet(KateAttribute::Weight)?(p->bold()?"1":"0"):"");
+ settings<<(p->itemSet(KateAttribute::Italic)?(p->italic()?"1":"0"):"");
+ settings<<(p->itemSet(KateAttribute::StrikeOut)?(p->strikeOut()?"1":"0"):"");
+ settings<<(p->itemSet(KateAttribute::Underline)?(p->underline()?"1":"0"):"");
+ settings<<(p->itemSet(KateAttribute::BGColor)?QString::number(p->bgColor().rgb(),16):"");
+ settings<<(p->itemSet(KateAttribute::SelectedBGColor)?QString::number(p->selectedBGColor().rgb(),16):"");
+ settings<<"---";
+ config->writeEntry(p->name,settings);
+ }
+}
+
+/**
+ * Increase the usage count, and trigger initialization if needed.
+ */
+void KateHighlighting::use()
+{
+ if (refCount == 0)
+ init();
+
+ refCount++;
+}
+
+/**
+ * Decrease the usage count, and trigger cleanup if needed.
+ */
+void KateHighlighting::release()
+{
+ refCount--;
+
+ if (refCount == 0)
+ done();
+}
+
+/**
+ * Initialize a context for the first time.
+ */
+
+void KateHighlighting::init()
+{
+ if (noHl)
+ return;
+
+ // cu contexts
+ for (uint i=0; i < m_contexts.size(); ++i)
+ delete m_contexts[i];
+ m_contexts.clear ();
+
+ makeContextList();
+}
+
+
+/**
+ * If the there is no document using the highlighting style free the complete
+ * context structure.
+ */
+void KateHighlighting::done()
+{
+ if (noHl)
+ return;
+
+ // cu contexts
+ for (uint i=0; i < m_contexts.size(); ++i)
+ delete m_contexts[i];
+ m_contexts.clear ();
+
+ internalIDList.clear();
+}
+
+/**
+ * KateHighlighting - createKateHlItemData
+ * This function reads the itemData entries from the config file, which specifies the
+ * default attribute styles for matched items/contexts.
+ *
+ * @param list A reference to the internal list containing the parsed default config
+ */
+void KateHighlighting::createKateHlItemData(KateHlItemDataList &list)
+{
+ // If no highlighting is selected we need only one default.
+ if (noHl)
+ {
+ list.append(new KateHlItemData(i18n("Normal Text"), KateHlItemData::dsNormal));
+ return;
+ }
+
+ // If the internal list isn't already available read the config file
+ if (internalIDList.isEmpty())
+ makeContextList();
+
+ list=internalIDList;
+}
+
+/**
+ * Adds the styles of the currently parsed highlight to the itemdata list
+ */
+void KateHighlighting::addToKateHlItemDataList()
+{
+ //Tell the syntax document class which file we want to parse and which data group
+ KateHlManager::self()->syntax->setIdentifier(buildIdentifier);
+ KateSyntaxContextData *data = KateHlManager::self()->syntax->getGroupInfo("highlighting","itemData");
+
+ //begin with the real parsing
+ while (KateHlManager::self()->syntax->nextGroup(data))
+ {
+ // read all attributes
+ QString color = KateHlManager::self()->syntax->groupData(data,QString("color"));
+ QString selColor = KateHlManager::self()->syntax->groupData(data,QString("selColor"));
+ QString bold = KateHlManager::self()->syntax->groupData(data,QString("bold"));
+ QString italic = KateHlManager::self()->syntax->groupData(data,QString("italic"));
+ QString underline = KateHlManager::self()->syntax->groupData(data,QString("underline"));
+ QString strikeOut = KateHlManager::self()->syntax->groupData(data,QString("strikeOut"));
+ QString bgColor = KateHlManager::self()->syntax->groupData(data,QString("backgroundColor"));
+ QString selBgColor = KateHlManager::self()->syntax->groupData(data,QString("selBackgroundColor"));
+
+ KateHlItemData* newData = new KateHlItemData(
+ buildPrefix+KateHlManager::self()->syntax->groupData(data,QString("name")).simplifyWhiteSpace(),
+ getDefStyleNum(KateHlManager::self()->syntax->groupData(data,QString("defStyleNum"))));
+
+ /* here the custom style overrides are specified, if needed */
+ if (!color.isEmpty()) newData->setTextColor(QColor(color));
+ if (!selColor.isEmpty()) newData->setSelectedTextColor(QColor(selColor));
+ if (!bold.isEmpty()) newData->setBold( IS_TRUE(bold) );
+ if (!italic.isEmpty()) newData->setItalic( IS_TRUE(italic) );
+ // new attributes for the new rendering view
+ if (!underline.isEmpty()) newData->setUnderline( IS_TRUE(underline) );
+ if (!strikeOut.isEmpty()) newData->setStrikeOut( IS_TRUE(strikeOut) );
+ if (!bgColor.isEmpty()) newData->setBGColor(QColor(bgColor));
+ if (!selBgColor.isEmpty()) newData->setSelectedBGColor(QColor(selBgColor));
+
+ internalIDList.append(newData);
+ }
+
+ //clean up
+ if (data)
+ KateHlManager::self()->syntax->freeGroupInfo(data);
+}
+
+/**
+ * KateHighlighting - lookupAttrName
+ * This function is a helper for makeContextList and createKateHlItem. It looks the given
+ * attribute name in the itemData list up and returns it's index
+ *
+ * @param name the attribute name to lookup
+ * @param iDl the list containing all available attributes
+ *
+ * @return The index of the attribute, or 0 if the attribute isn't found
+ */
+int KateHighlighting::lookupAttrName(const QString& name, KateHlItemDataList &iDl)
+{
+ for (uint i = 0; i < iDl.count(); i++)
+ if (iDl.at(i)->name == buildPrefix+name)
+ return i;
+
+ kdDebug(13010)<<"Couldn't resolve itemDataName:"<<name<<endl;
+ return 0;
+}
+
+/**
+ * KateHighlighting - createKateHlItem
+ * This function is a helper for makeContextList. It parses the xml file for
+ * information.
+ *
+ * @param data Data about the item read from the xml file
+ * @param iDl List of all available itemData entries.
+ * Needed for attribute name->index translation
+ * @param RegionList list of code folding region names
+ * @param ContextNameList list of context names
+ *
+ * @return A pointer to the newly created item object
+ */
+KateHlItem *KateHighlighting::createKateHlItem(KateSyntaxContextData *data,
+ KateHlItemDataList &iDl,
+ QStringList *RegionList,
+ QStringList *ContextNameList)
+{
+ // No highlighting -> exit
+ if (noHl)
+ return 0;
+
+ // get the (tagname) itemd type
+ QString dataname=KateHlManager::self()->syntax->groupItemData(data,QString(""));
+
+ // code folding region handling:
+ QString beginRegionStr=KateHlManager::self()->syntax->groupItemData(data,QString("beginRegion"));
+ QString endRegionStr=KateHlManager::self()->syntax->groupItemData(data,QString("endRegion"));
+
+ signed char regionId=0;
+ signed char regionId2=0;
+
+ if (!beginRegionStr.isEmpty())
+ {
+ regionId = RegionList->findIndex(beginRegionStr);
+
+ if (regionId==-1) // if the region name doesn't already exist, add it to the list
+ {
+ (*RegionList)<<beginRegionStr;
+ regionId = RegionList->findIndex(beginRegionStr);
+ }
+
+ regionId++;
+
+ kdDebug(13010) << "########### BEG REG: " << beginRegionStr << " NUM: " << regionId << endl;
+ }
+
+ if (!endRegionStr.isEmpty())
+ {
+ regionId2 = RegionList->findIndex(endRegionStr);
+
+ if (regionId2==-1) // if the region name doesn't already exist, add it to the list
+ {
+ (*RegionList)<<endRegionStr;
+ regionId2 = RegionList->findIndex(endRegionStr);
+ }
+
+ regionId2 = -regionId2 - 1;
+
+ kdDebug(13010) << "########### END REG: " << endRegionStr << " NUM: " << regionId2 << endl;
+ }
+
+ int attr = 0;
+ QString tmpAttr=KateHlManager::self()->syntax->groupItemData(data,QString("attribute")).simplifyWhiteSpace();
+ bool onlyConsume = tmpAttr.isEmpty();
+
+ // only relevant for non consumer
+ if (!onlyConsume)
+ {
+ if (QString("%1").arg(tmpAttr.toInt())==tmpAttr)
+ {
+ errorsAndWarnings+=i18n(
+ "<B>%1</B>: Deprecated syntax. Attribute (%2) not addressed by symbolic name<BR>").
+ arg(buildIdentifier).arg(tmpAttr);
+ attr=tmpAttr.toInt();
+ }
+ else
+ attr=lookupAttrName(tmpAttr,iDl);
+ }
+
+ // Info about context switch
+ int context = -1;
+ QString unresolvedContext;
+ QString tmpcontext=KateHlManager::self()->syntax->groupItemData(data,QString("context"));
+ if (!tmpcontext.isEmpty())
+ context=getIdFromString(ContextNameList, tmpcontext,unresolvedContext);
+
+ // Get the char parameter (eg DetectChar)
+ char chr;
+ if (! KateHlManager::self()->syntax->groupItemData(data,QString("char")).isEmpty())
+ chr= (KateHlManager::self()->syntax->groupItemData(data,QString("char")).latin1())[0];
+ else
+ chr=0;
+
+ // Get the String parameter (eg. StringDetect)
+ QString stringdata=KateHlManager::self()->syntax->groupItemData(data,QString("String"));
+
+ // Get a second char parameter (char1) (eg Detect2Chars)
+ char chr1;
+ if (! KateHlManager::self()->syntax->groupItemData(data,QString("char1")).isEmpty())
+ chr1= (KateHlManager::self()->syntax->groupItemData(data,QString("char1")).latin1())[0];
+ else
+ chr1=0;
+
+ // Will be removed eventually. Atm used for StringDetect, keyword and RegExp
+ const QString & insensitive_str = KateHlManager::self()->syntax->groupItemData(data,QString("insensitive"));
+ bool insensitive = IS_TRUE( insensitive_str );
+
+ // for regexp only
+ bool minimal = IS_TRUE( KateHlManager::self()->syntax->groupItemData(data,QString("minimal")) );
+
+ // dominik: look ahead and do not change offset. so we can change contexts w/o changing offset1.
+ bool lookAhead = IS_TRUE( KateHlManager::self()->syntax->groupItemData(data,QString("lookAhead")) );
+
+ bool dynamic= IS_TRUE(KateHlManager::self()->syntax->groupItemData(data,QString("dynamic")) );
+
+ bool firstNonSpace = IS_TRUE(KateHlManager::self()->syntax->groupItemData(data,QString("firstNonSpace")) );
+
+ int column = -1;
+ QString colStr = KateHlManager::self()->syntax->groupItemData(data,QString("column"));
+ if (!colStr.isEmpty())
+ column = colStr.toInt();
+
+ //Create the item corresponding to it's type and set it's parameters
+ KateHlItem *tmpItem;
+
+ if (dataname=="keyword")
+ {
+ bool keywordInsensitive = insensitive_str.isEmpty() ? !casesensitive : insensitive;
+ KateHlKeyword *keyword=new KateHlKeyword(attr,context,regionId,regionId2,keywordInsensitive,
+ m_additionalData[ buildIdentifier ]->deliminator);
+
+ //Get the entries for the keyword lookup list
+ keyword->addList(KateHlManager::self()->syntax->finddata("highlighting",stringdata));
+ tmpItem=keyword;
+ }
+ else if (dataname=="Float") tmpItem= (new KateHlFloat(attr,context,regionId,regionId2));
+ else if (dataname=="Int") tmpItem=(new KateHlInt(attr,context,regionId,regionId2));
+ else if (dataname=="DetectChar") tmpItem=(new KateHlCharDetect(attr,context,regionId,regionId2,chr));
+ else if (dataname=="Detect2Chars") tmpItem=(new KateHl2CharDetect(attr,context,regionId,regionId2,chr,chr1));
+ else if (dataname=="RangeDetect") tmpItem=(new KateHlRangeDetect(attr,context,regionId,regionId2, chr, chr1));
+ else if (dataname=="LineContinue") tmpItem=(new KateHlLineContinue(attr,context,regionId,regionId2));
+ else if (dataname=="StringDetect") tmpItem=(new KateHlStringDetect(attr,context,regionId,regionId2,stringdata,insensitive));
+ else if (dataname=="AnyChar") tmpItem=(new KateHlAnyChar(attr,context,regionId,regionId2,stringdata));
+ else if (dataname=="RegExpr") tmpItem=(new KateHlRegExpr(attr,context,regionId,regionId2,stringdata, insensitive, minimal));
+ else if (dataname=="HlCChar") tmpItem= ( new KateHlCChar(attr,context,regionId,regionId2));
+ else if (dataname=="HlCHex") tmpItem= (new KateHlCHex(attr,context,regionId,regionId2));
+ else if (dataname=="HlCOct") tmpItem= (new KateHlCOct(attr,context,regionId,regionId2));
+ else if (dataname=="HlCFloat") tmpItem= (new KateHlCFloat(attr,context,regionId,regionId2));
+ else if (dataname=="HlCStringChar") tmpItem= (new KateHlCStringChar(attr,context,regionId,regionId2));
+ else if (dataname=="DetectSpaces") tmpItem= (new KateHlDetectSpaces(attr,context,regionId,regionId2));
+ else if (dataname=="DetectIdentifier") tmpItem= (new KateHlDetectIdentifier(attr,context,regionId,regionId2));
+ else
+ {
+ // oops, unknown type. Perhaps a spelling error in the xml file
+ return 0;
+ }
+
+ // set lookAhead & dynamic properties
+ tmpItem->lookAhead = lookAhead;
+ tmpItem->dynamic = dynamic;
+ tmpItem->firstNonSpace = firstNonSpace;
+ tmpItem->column = column;
+ tmpItem->onlyConsume = onlyConsume;
+
+ if (!unresolvedContext.isEmpty())
+ {
+ unresolvedContextReferences.insert(&(tmpItem->ctx),unresolvedContext);
+ }
+
+ return tmpItem;
+}
+
+QString KateHighlighting::hlKeyForAttrib( int i ) const
+{
+ // find entry. This is faster than QMap::find. m_hlIndex always has an entry
+ // for key '0' (it is "none"), so the result is always valid.
+ int k = 0;
+ QMap<int,QString>::const_iterator it = m_hlIndex.constEnd();
+ while ( it != m_hlIndex.constBegin() )
+ {
+ --it;
+ k = it.key();
+ if ( i >= k )
+ break;
+ }
+ return it.data();
+}
+
+bool KateHighlighting::isInWord( QChar c, int attrib ) const
+{
+ return m_additionalData[ hlKeyForAttrib( attrib ) ]->deliminator.find(c) < 0
+ && !c.isSpace() && c != '"' && c != '\'';
+}
+
+bool KateHighlighting::canBreakAt( QChar c, int attrib ) const
+{
+ static const QString& sq = KGlobal::staticQString("\"'");
+ return (m_additionalData[ hlKeyForAttrib( attrib ) ]->wordWrapDeliminator.find(c) != -1) && (sq.find(c) == -1);
+}
+
+signed char KateHighlighting::commentRegion(int attr) const {
+ QString commentRegion=m_additionalData[ hlKeyForAttrib( attr ) ]->multiLineRegion;
+ return (commentRegion.isEmpty()?0:(commentRegion.toShort()));
+}
+
+bool KateHighlighting::canComment( int startAttrib, int endAttrib ) const
+{
+ QString k = hlKeyForAttrib( startAttrib );
+ return ( k == hlKeyForAttrib( endAttrib ) &&
+ ( ( !m_additionalData[k]->multiLineCommentStart.isEmpty() && !m_additionalData[k]->multiLineCommentEnd.isEmpty() ) ||
+ ! m_additionalData[k]->singleLineCommentMarker.isEmpty() ) );
+}
+
+QString KateHighlighting::getCommentStart( int attrib ) const
+{
+ return m_additionalData[ hlKeyForAttrib( attrib) ]->multiLineCommentStart;
+}
+
+QString KateHighlighting::getCommentEnd( int attrib ) const
+{
+ return m_additionalData[ hlKeyForAttrib( attrib ) ]->multiLineCommentEnd;
+}
+
+QString KateHighlighting::getCommentSingleLineStart( int attrib ) const
+{
+ return m_additionalData[ hlKeyForAttrib( attrib) ]->singleLineCommentMarker;
+}
+
+KateHighlighting::CSLPos KateHighlighting::getCommentSingleLinePosition( int attrib ) const
+{
+ return m_additionalData[ hlKeyForAttrib( attrib) ]->singleLineCommentPosition;
+}
+
+
+/**
+ * Helper for makeContextList. It parses the xml file for
+ * information, how single or multi line comments are marked
+ */
+void KateHighlighting::readCommentConfig()
+{
+ KateHlManager::self()->syntax->setIdentifier(buildIdentifier);
+ KateSyntaxContextData *data=KateHlManager::self()->syntax->getGroupInfo("general","comment");
+
+ QString cmlStart="", cmlEnd="", cmlRegion="", cslStart="";
+ CSLPos cslPosition=CSLPosColumn0;
+
+ if (data)
+ {
+ while (KateHlManager::self()->syntax->nextGroup(data))
+ {
+ if (KateHlManager::self()->syntax->groupData(data,"name")=="singleLine")
+ {
+ cslStart=KateHlManager::self()->syntax->groupData(data,"start");
+ QString cslpos=KateHlManager::self()->syntax->groupData(data,"position");
+ if (cslpos=="afterwhitespace")
+ cslPosition=CSLPosAfterWhitespace;
+ else
+ cslPosition=CSLPosColumn0;
+ }
+ else if (KateHlManager::self()->syntax->groupData(data,"name")=="multiLine")
+ {
+ cmlStart=KateHlManager::self()->syntax->groupData(data,"start");
+ cmlEnd=KateHlManager::self()->syntax->groupData(data,"end");
+ cmlRegion=KateHlManager::self()->syntax->groupData(data,"region");
+ }
+ }
+
+ KateHlManager::self()->syntax->freeGroupInfo(data);
+ }
+
+ m_additionalData[buildIdentifier]->singleLineCommentMarker = cslStart;
+ m_additionalData[buildIdentifier]->singleLineCommentPosition = cslPosition;
+ m_additionalData[buildIdentifier]->multiLineCommentStart = cmlStart;
+ m_additionalData[buildIdentifier]->multiLineCommentEnd = cmlEnd;
+ m_additionalData[buildIdentifier]->multiLineRegion = cmlRegion;
+}
+
+/**
+ * Helper for makeContextList. It parses the xml file for information,
+ * if keywords should be treated case(in)sensitive and creates the keyword
+ * delimiter list. Which is the default list, without any given weak deliminiators
+ */
+void KateHighlighting::readGlobalKeywordConfig()
+{
+ deliminator = stdDeliminator;
+ // Tell the syntax document class which file we want to parse
+ kdDebug(13010)<<"readGlobalKeywordConfig:BEGIN"<<endl;
+
+ KateHlManager::self()->syntax->setIdentifier(buildIdentifier);
+ KateSyntaxContextData *data = KateHlManager::self()->syntax->getConfig("general","keywords");
+
+ if (data)
+ {
+ kdDebug(13010)<<"Found global keyword config"<<endl;
+
+ if ( IS_TRUE( KateHlManager::self()->syntax->groupItemData(data,QString("casesensitive")) ) )
+ casesensitive=true;
+ else
+ casesensitive=false;
+
+ //get the weak deliminators
+ weakDeliminator=(KateHlManager::self()->syntax->groupItemData(data,QString("weakDeliminator")));
+
+ kdDebug(13010)<<"weak delimiters are: "<<weakDeliminator<<endl;
+
+ // remove any weakDelimitars (if any) from the default list and store this list.
+ for (uint s=0; s < weakDeliminator.length(); s++)
+ {
+ int f = deliminator.find (weakDeliminator[s]);
+
+ if (f > -1)
+ deliminator.remove (f, 1);
+ }
+
+ QString addDelim = (KateHlManager::self()->syntax->groupItemData(data,QString("additionalDeliminator")));
+
+ if (!addDelim.isEmpty())
+ deliminator=deliminator+addDelim;
+
+ KateHlManager::self()->syntax->freeGroupInfo(data);
+ }
+ else
+ {
+ //Default values
+ casesensitive=true;
+ weakDeliminator=QString("");
+ }
+
+ kdDebug(13010)<<"readGlobalKeywordConfig:END"<<endl;
+
+ kdDebug(13010)<<"delimiterCharacters are: "<<deliminator<<endl;
+
+ m_additionalData[buildIdentifier]->deliminator = deliminator;
+}
+
+/**
+ * Helper for makeContextList. It parses the xml file for any wordwrap
+ * deliminators, characters * at which line can be broken. In case no keyword
+ * tag is found in the xml file, the wordwrap deliminators list defaults to the
+ * standard denominators. In case a keyword tag is defined, but no
+ * wordWrapDeliminator attribute is specified, the deliminator list as computed
+ * in readGlobalKeywordConfig is used.
+ *
+ * @return the computed delimiter string.
+ */
+void KateHighlighting::readWordWrapConfig()
+{
+ // Tell the syntax document class which file we want to parse
+ kdDebug(13010)<<"readWordWrapConfig:BEGIN"<<endl;
+
+ KateHlManager::self()->syntax->setIdentifier(buildIdentifier);
+ KateSyntaxContextData *data = KateHlManager::self()->syntax->getConfig("general","keywords");
+
+ QString wordWrapDeliminator = stdDeliminator;
+ if (data)
+ {
+ kdDebug(13010)<<"Found global keyword config"<<endl;
+
+ wordWrapDeliminator = (KateHlManager::self()->syntax->groupItemData(data,QString("wordWrapDeliminator")));
+ //when no wordWrapDeliminator is defined use the deliminator list
+ if ( wordWrapDeliminator.length() == 0 ) wordWrapDeliminator = deliminator;
+
+ kdDebug(13010) << "word wrap deliminators are " << wordWrapDeliminator << endl;
+
+ KateHlManager::self()->syntax->freeGroupInfo(data);
+ }
+
+ kdDebug(13010)<<"readWordWrapConfig:END"<<endl;
+
+ m_additionalData[buildIdentifier]->wordWrapDeliminator = wordWrapDeliminator;
+}
+
+void KateHighlighting::readIndentationConfig()
+{
+ m_indentation = "";
+
+ KateHlManager::self()->syntax->setIdentifier(buildIdentifier);
+ KateSyntaxContextData *data = KateHlManager::self()->syntax->getConfig("general","indentation");
+
+ if (data)
+ {
+ m_indentation = (KateHlManager::self()->syntax->groupItemData(data,QString("mode")));
+
+ KateHlManager::self()->syntax->freeGroupInfo(data);
+ }
+}
+
+void KateHighlighting::readFoldingConfig()
+{
+ // Tell the syntax document class which file we want to parse
+ kdDebug(13010)<<"readfoldignConfig:BEGIN"<<endl;
+
+ KateHlManager::self()->syntax->setIdentifier(buildIdentifier);
+ KateSyntaxContextData *data = KateHlManager::self()->syntax->getConfig("general","folding");
+
+ if (data)
+ {
+ kdDebug(13010)<<"Found global keyword config"<<endl;
+
+ if ( IS_TRUE( KateHlManager::self()->syntax->groupItemData(data,QString("indentationsensitive")) ) )
+ m_foldingIndentationSensitive=true;
+ else
+ m_foldingIndentationSensitive=false;
+
+ KateHlManager::self()->syntax->freeGroupInfo(data);
+ }
+ else
+ {
+ //Default values
+ m_foldingIndentationSensitive = false;
+ }
+
+ kdDebug(13010)<<"readfoldingConfig:END"<<endl;
+
+ kdDebug(13010)<<"############################ use indent for fold are: "<<m_foldingIndentationSensitive<<endl;
+}
+
+void KateHighlighting::createContextNameList(QStringList *ContextNameList,int ctx0)
+{
+ kdDebug(13010)<<"creatingContextNameList:BEGIN"<<endl;
+
+ if (ctx0 == 0)
+ ContextNameList->clear();
+
+ KateHlManager::self()->syntax->setIdentifier(buildIdentifier);
+
+ KateSyntaxContextData *data=KateHlManager::self()->syntax->getGroupInfo("highlighting","context");
+
+ int id=ctx0;
+
+ if (data)
+ {
+ while (KateHlManager::self()->syntax->nextGroup(data))
+ {
+ QString tmpAttr=KateHlManager::self()->syntax->groupData(data,QString("name")).simplifyWhiteSpace();
+ if (tmpAttr.isEmpty())
+ {
+ tmpAttr=QString("!KATE_INTERNAL_DUMMY! %1").arg(id);
+ errorsAndWarnings +=i18n("<B>%1</B>: Deprecated syntax. Context %2 has no symbolic name<BR>").arg(buildIdentifier).arg(id-ctx0);
+ }
+ else tmpAttr=buildPrefix+tmpAttr;
+ (*ContextNameList)<<tmpAttr;
+ id++;
+ }
+ KateHlManager::self()->syntax->freeGroupInfo(data);
+ }
+ kdDebug(13010)<<"creatingContextNameList:END"<<endl;
+
+}
+
+int KateHighlighting::getIdFromString(QStringList *ContextNameList, QString tmpLineEndContext, /*NO CONST*/ QString &unres)
+{
+ unres="";
+ int context;
+ if ((tmpLineEndContext=="#stay") || (tmpLineEndContext.simplifyWhiteSpace().isEmpty()))
+ context=-1;
+
+ else if (tmpLineEndContext.startsWith("#pop"))
+ {
+ context=-1;
+ for(;tmpLineEndContext.startsWith("#pop");context--)
+ {
+ tmpLineEndContext.remove(0,4);
+ kdDebug(13010)<<"#pop found"<<endl;
+ }
+ }
+
+ else if ( tmpLineEndContext.contains("##"))
+ {
+ int o = tmpLineEndContext.find("##");
+ // FIXME at least with 'foo##bar'-style contexts the rules are picked up
+ // but the default attribute is not
+ QString tmp=tmpLineEndContext.mid(o+2);
+ if (!embeddedHls.contains(tmp)) embeddedHls.insert(tmp,KateEmbeddedHlInfo());
+ unres=tmp+':'+tmpLineEndContext.left(o);
+ context=0;
+ }
+
+ else
+ {
+ context=ContextNameList->findIndex(buildPrefix+tmpLineEndContext);
+ if (context==-1)
+ {
+ context=tmpLineEndContext.toInt();
+ errorsAndWarnings+=i18n(
+ "<B>%1</B>:Deprecated syntax. Context %2 not addressed by a symbolic name"
+ ).arg(buildIdentifier).arg(tmpLineEndContext);
+ }
+//#warning restructure this the name list storage.
+// context=context+buildContext0Offset;
+ }
+ return context;
+}
+
+/**
+ * The most important initialization function for each highlighting. It's called
+ * each time a document gets a highlighting style assigned. parses the xml file
+ * and creates a corresponding internal structure
+ */
+void KateHighlighting::makeContextList()
+{
+ if (noHl) // if this a highlighting for "normal texts" only, tere is no need for a context list creation
+ return;
+
+ embeddedHls.clear();
+ unresolvedContextReferences.clear();
+ RegionList.clear();
+ ContextNameList.clear();
+
+ // prepare list creation. To reuse as much code as possible handle this
+ // highlighting the same way as embedded onces
+ embeddedHls.insert(iName,KateEmbeddedHlInfo());
+
+ bool something_changed;
+ // the context "0" id is 0 for this hl, all embedded context "0"s have offsets
+ startctx=base_startctx=0;
+ // inform everybody that we are building the highlighting contexts and itemlists
+ building=true;
+
+ do
+ {
+ kdDebug(13010)<<"**************** Outer loop in make ContextList"<<endl;
+ kdDebug(13010)<<"**************** Hl List count:"<<embeddedHls.count()<<endl;
+ something_changed=false; //assume all "embedded" hls have already been loaded
+ for (KateEmbeddedHlInfos::const_iterator it=embeddedHls.begin(); it!=embeddedHls.end();++it)
+ {
+ if (!it.data().loaded) // we found one, we still have to load
+ {
+ kdDebug(13010)<<"**************** Inner loop in make ContextList"<<endl;
+ QString identifierToUse;
+ kdDebug(13010)<<"Trying to open highlighting definition file: "<< it.key()<<endl;
+ if (iName==it.key()) // the own identifier is known
+ identifierToUse=identifier;
+ else // all others have to be looked up
+ identifierToUse=KateHlManager::self()->identifierForName(it.key());
+
+ kdDebug(13010)<<"Location is:"<< identifierToUse<<endl;
+
+ buildPrefix=it.key()+':'; // attribute names get prefixed by the names
+ // of the highlighting definitions they belong to
+
+ if (identifierToUse.isEmpty() )
+ kdDebug(13010)<<"OHOH, unknown highlighting description referenced"<<endl;
+
+ kdDebug(13010)<<"setting ("<<it.key()<<") to loaded"<<endl;
+
+ //mark hl as loaded
+ it=embeddedHls.insert(it.key(),KateEmbeddedHlInfo(true,startctx));
+ //set class member for context 0 offset, so we don't need to pass it around
+ buildContext0Offset=startctx;
+ //parse one hl definition file
+ startctx=addToContextList(identifierToUse,startctx);
+
+ if (noHl) return; // an error occurred
+
+ base_startctx = startctx;
+ something_changed=true; // something has been loaded
+ }
+ }
+ } while (something_changed); // as long as there has been another file parsed
+ // repeat everything, there could be newly added embedded hls.
+
+
+ // at this point all needed highlighing (sub)definitions are loaded. It's time
+ // to resolve cross file references (if there are any)
+ kdDebug(13010)<<"Unresolved contexts, which need attention: "<<unresolvedContextReferences.count()<<endl;
+
+ //optimize this a littlebit
+ for (KateHlUnresolvedCtxRefs::iterator unresIt=unresolvedContextReferences.begin();
+ unresIt!=unresolvedContextReferences.end();++unresIt)
+ {
+ QString incCtx = unresIt.data();
+ kdDebug(13010)<<"Context "<<incCtx<<" is unresolved"<<endl;
+ // only resolve '##Name' contexts here; handleKateHlIncludeRules() can figure
+ // out 'Name##Name'-style inclusions, but we screw it up
+ if (incCtx.endsWith(":")) {
+ kdDebug(13010)<<"Looking up context0 for ruleset "<<incCtx<<endl;
+ incCtx = incCtx.left(incCtx.length()-1);
+ //try to find the context0 id for a given unresolvedReference
+ KateEmbeddedHlInfos::const_iterator hlIt=embeddedHls.find(incCtx);
+ if (hlIt!=embeddedHls.end())
+ *(unresIt.key())=hlIt.data().context0;
+ }
+ }
+
+ // eventually handle KateHlIncludeRules items, if they exist.
+ // This has to be done after the cross file references, because it is allowed
+ // to include the context0 from a different definition, than the one the rule
+ // belongs to
+ handleKateHlIncludeRules();
+
+ embeddedHls.clear(); //save some memory.
+ unresolvedContextReferences.clear(); //save some memory
+ RegionList.clear(); // I think you get the idea ;)
+ ContextNameList.clear();
+
+
+ // if there have been errors show them
+ if (!errorsAndWarnings.isEmpty())
+ KMessageBox::detailedSorry(0L,i18n(
+ "There were warning(s) and/or error(s) while parsing the syntax "
+ "highlighting configuration."),
+ errorsAndWarnings, i18n("Kate Syntax Highlighting Parser"));
+
+ // we have finished
+ building=false;
+}
+
+void KateHighlighting::handleKateHlIncludeRules()
+{
+ // if there are noe include rules to take care of, just return
+ kdDebug(13010)<<"KateHlIncludeRules, which need attention: " <<includeRules.count()<<endl;
+ if (includeRules.isEmpty()) return;
+
+ buildPrefix="";
+ QString dummy;
+
+ // By now the context0 references are resolved, now more or less only inner
+ // file references are resolved. If we decide that arbitrary inclusion is
+ // needed, this doesn't need to be changed, only the addToContextList
+ // method.
+
+ //resolove context names
+ for (KateHlIncludeRules::iterator it=includeRules.begin();it!=includeRules.end();)
+ {
+ if ((*it)->incCtx==-1) // context unresolved ?
+ {
+
+ if ((*it)->incCtxN.isEmpty())
+ {
+ // no context name given, and no valid context id set, so this item is
+ // going to be removed
+ KateHlIncludeRules::iterator it1=it;
+ ++it1;
+ delete (*it);
+ includeRules.remove(it);
+ it=it1;
+ }
+ else
+ {
+ // resolve name to id
+ (*it)->incCtx=getIdFromString(&ContextNameList,(*it)->incCtxN,dummy);
+ kdDebug(13010)<<"Resolved "<<(*it)->incCtxN<< " to "<<(*it)->incCtx<<" for include rule"<<endl;
+ // It would be good to look here somehow, if the result is valid
+ }
+ }
+ else ++it; //nothing to do, already resolved (by the cross defintion reference resolver)
+ }
+
+ // now that all KateHlIncludeRule items should be valid and completely resolved,
+ // do the real inclusion of the rules.
+ // recursiveness is needed, because context 0 could include context 1, which
+ // itself includes context 2 and so on.
+ // In that case we have to handle context 2 first, then 1, 0
+ //TODO: catch circular references: eg 0->1->2->3->1
+ while (!includeRules.isEmpty())
+ handleKateHlIncludeRulesRecursive(includeRules.begin(),&includeRules);
+}
+
+void KateHighlighting::handleKateHlIncludeRulesRecursive(KateHlIncludeRules::iterator it, KateHlIncludeRules *list)
+{
+ if (it==list->end()) return; //invalid iterator, shouldn't happen, but better have a rule prepared ;)
+
+ KateHlIncludeRules::iterator it1=it;
+ int ctx=(*it1)->ctx;
+
+ // find the last entry for the given context in the KateHlIncludeRules list
+ // this is need if one context includes more than one. This saves us from
+ // updating all insert positions:
+ // eg: context 0:
+ // pos 3 - include context 2
+ // pos 5 - include context 3
+ // During the building of the includeRules list the items are inserted in
+ // ascending order, now we need it descending to make our life easier.
+ while ((it!=list->end()) && ((*it)->ctx==ctx))
+ {
+ it1=it;
+ ++it;
+ }
+
+ // iterate over each include rule for the context the function has been called for.
+ while ((it1!=list->end()) && ((*it1)->ctx==ctx))
+ {
+ int ctx1=(*it1)->incCtx;
+
+ //let's see, if the the included context includes other contexts
+ for (KateHlIncludeRules::iterator it2=list->begin();it2!=list->end();++it2)
+ {
+ if ((*it2)->ctx==ctx1)
+ {
+ //yes it does, so first handle that include rules, since we want to
+ // include those subincludes too
+ handleKateHlIncludeRulesRecursive(it2,list);
+ break;
+ }
+ }
+
+ // if the context we want to include had sub includes, they are already inserted there.
+ KateHlContext *dest=m_contexts[ctx];
+ KateHlContext *src=m_contexts[ctx1];
+// kdDebug(3010)<<"linking included rules from "<<ctx<<" to "<<ctx1<<endl;
+
+ // If so desired, change the dest attribute to the one of the src.
+ // Required to make commenting work, if text matched by the included context
+ // is a different highlight than the host context.
+ if ( (*it1)->includeAttrib )
+ dest->attr = src->attr;
+
+ // insert the included context's rules starting at position p
+ int p=(*it1)->pos;
+
+ // remember some stuff
+ int oldLen = dest->items.size();
+ uint itemsToInsert = src->items.size();
+
+ // resize target
+ dest->items.resize (oldLen + itemsToInsert);
+
+ // move old elements
+ for (int i=oldLen-1; i >= p; --i)
+ dest->items[i+itemsToInsert] = dest->items[i];
+
+ // insert new stuff
+ for (uint i=0; i < itemsToInsert; ++i )
+ dest->items[p+i] = src->items[i];
+
+ it=it1; //backup the iterator
+ --it1; //move to the next entry, which has to be take care of
+ delete (*it); //free the already handled data structure
+ list->remove(it); // remove it from the list
+ }
+}
+
+/**
+ * Add one highlight to the contextlist.
+ *
+ * @return the number of contexts after this is added.
+ */
+int KateHighlighting::addToContextList(const QString &ident, int ctx0)
+{
+ kdDebug(13010)<<"=== Adding hl with ident '"<<ident<<"'"<<endl;
+
+ buildIdentifier=ident;
+ KateSyntaxContextData *data, *datasub;
+ KateHlItem *c;
+
+ QString dummy;
+
+ // Let the syntax document class know, which file we'd like to parse
+ if (!KateHlManager::self()->syntax->setIdentifier(ident))
+ {
+ noHl=true;
+ KMessageBox::information(0L,i18n(
+ "Since there has been an error parsing the highlighting description, "
+ "this highlighting will be disabled"));
+ return 0;
+ }
+
+ // only read for the own stuff
+ if (identifier == ident)
+ {
+ readIndentationConfig ();
+ }
+
+ RegionList<<"!KateInternal_TopLevel!";
+
+ m_hlIndex[internalIDList.count()] = ident;
+ m_additionalData.insert( ident, new HighlightPropertyBag );
+
+ // fill out the propertybag
+ readCommentConfig();
+ readGlobalKeywordConfig();
+ readWordWrapConfig();
+
+ readFoldingConfig ();
+
+ QString ctxName;
+
+ // This list is needed for the translation of the attribute parameter,
+ // if the itemData name is given instead of the index
+ addToKateHlItemDataList();
+ KateHlItemDataList iDl = internalIDList;
+
+ createContextNameList(&ContextNameList,ctx0);
+
+
+ kdDebug(13010)<<"Parsing Context structure"<<endl;
+ //start the real work
+ data=KateHlManager::self()->syntax->getGroupInfo("highlighting","context");
+ uint i=buildContext0Offset;
+ if (data)
+ {
+ while (KateHlManager::self()->syntax->nextGroup(data))
+ {
+ kdDebug(13010)<<"Found a context in file, building structure now"<<endl;
+ //BEGIN - Translation of the attribute parameter
+ QString tmpAttr=KateHlManager::self()->syntax->groupData(data,QString("attribute")).simplifyWhiteSpace();
+ int attr;
+ if (QString("%1").arg(tmpAttr.toInt())==tmpAttr)
+ attr=tmpAttr.toInt();
+ else
+ attr=lookupAttrName(tmpAttr,iDl);
+ //END - Translation of the attribute parameter
+
+ ctxName=buildPrefix+KateHlManager::self()->syntax->groupData(data,QString("lineEndContext")).simplifyWhiteSpace();
+
+ QString tmpLineEndContext=KateHlManager::self()->syntax->groupData(data,QString("lineEndContext")).simplifyWhiteSpace();
+ int context;
+
+ context=getIdFromString(&ContextNameList, tmpLineEndContext,dummy);
+
+ QString tmpNIBF = KateHlManager::self()->syntax->groupData(data, QString("noIndentationBasedFolding") );
+ bool noIndentationBasedFolding=IS_TRUE(tmpNIBF);
+
+ //BEGIN get fallthrough props
+ bool ft = false;
+ int ftc = 0; // fallthrough context
+ if ( i > 0 ) // fallthrough is not smart in context 0
+ {
+ QString tmpFt = KateHlManager::self()->syntax->groupData(data, QString("fallthrough") );
+ if ( IS_TRUE(tmpFt) )
+ ft = true;
+ if ( ft )
+ {
+ QString tmpFtc = KateHlManager::self()->syntax->groupData( data, QString("fallthroughContext") );
+
+ ftc=getIdFromString(&ContextNameList, tmpFtc,dummy);
+ if (ftc == -1) ftc =0;
+
+ kdDebug(13010)<<"Setting fall through context (context "<<i<<"): "<<ftc<<endl;
+ }
+ }
+ //END falltrhough props
+
+ bool dynamic = false;
+ QString tmpDynamic = KateHlManager::self()->syntax->groupData(data, QString("dynamic") );
+ if ( tmpDynamic.lower() == "true" || tmpDynamic.toInt() == 1 )
+ dynamic = true;
+
+ KateHlContext *ctxNew = new KateHlContext (
+ ident,
+ attr,
+ context,
+ (KateHlManager::self()->syntax->groupData(data,QString("lineBeginContext"))).isEmpty()?-1:
+ (KateHlManager::self()->syntax->groupData(data,QString("lineBeginContext"))).toInt(),
+ ft, ftc, dynamic,noIndentationBasedFolding);
+
+ m_contexts.push_back (ctxNew);
+
+ kdDebug(13010) << "INDEX: " << i << " LENGTH " << m_contexts.size()-1 << endl;
+
+ //Let's create all items for the context
+ while (KateHlManager::self()->syntax->nextItem(data))
+ {
+// kdDebug(13010)<< "In make Contextlist: Item:"<<endl;
+
+ // KateHlIncludeRules : add a pointer to each item in that context
+ // TODO add a attrib includeAttrib
+ QString tag = KateHlManager::self()->syntax->groupItemData(data,QString(""));
+ if ( tag == "IncludeRules" ) //if the new item is an Include rule, we have to take special care
+ {
+ QString incCtx = KateHlManager::self()->syntax->groupItemData( data, QString("context"));
+ QString incAttrib = KateHlManager::self()->syntax->groupItemData( data, QString("includeAttrib"));
+ bool includeAttrib = IS_TRUE( incAttrib );
+ // only context refernces of type Name, ##Name, and Subname##Name are allowed
+ if (incCtx.startsWith("##") || (!incCtx.startsWith("#")))
+ {
+ int incCtxi = incCtx.find("##");
+ //#stay, #pop is not interesting here
+ if (incCtxi >= 0)
+ {
+ QString incSet = incCtx.mid(incCtxi + 2);
+ QString incCtxN = incSet + ":" + incCtx.left(incCtxi);
+
+ //a cross highlighting reference
+ kdDebug(13010)<<"Cross highlight reference <IncludeRules>, context "<<incCtxN<<endl;
+ KateHlIncludeRule *ir=new KateHlIncludeRule(i,m_contexts[i]->items.count(),incCtxN,includeAttrib);
+
+ //use the same way to determine cross hl file references as other items do
+ if (!embeddedHls.contains(incSet))
+ embeddedHls.insert(incSet,KateEmbeddedHlInfo());
+ else
+ kdDebug(13010)<<"Skipping embeddedHls.insert for "<<incCtxN<<endl;
+
+ unresolvedContextReferences.insert(&(ir->incCtx), incCtxN);
+
+ includeRules.append(ir);
+ }
+ else
+ {
+ // a local reference -> just initialize the include rule structure
+ incCtx=buildPrefix+incCtx.simplifyWhiteSpace();
+ includeRules.append(new KateHlIncludeRule(i,m_contexts[i]->items.count(),incCtx, includeAttrib));
+ }
+ }
+
+ continue;
+ }
+ // TODO -- can we remove the block below??
+#if 0
+ QString tag = KateHlManager::self()->syntax->groupKateHlItemData(data,QString(""));
+ if ( tag == "IncludeRules" ) {
+ // attrib context: the index (jowenn, i think using names here
+ // would be a cool feat, goes for mentioning the context in
+ // any item. a map or dict?)
+ int ctxId = getIdFromString(&ContextNameList,
+ KateHlManager::self()->syntax->groupKateHlItemData( data, QString("context")),dummy); // the index is *required*
+ if ( ctxId > -1) { // we can even reuse rules of 0 if we want to:)
+ kdDebug(13010)<<"makeContextList["<<i<<"]: including all items of context "<<ctxId<<endl;
+ if ( ctxId < (int) i ) { // must be defined
+ for ( c = m_contexts[ctxId]->items.first(); c; c = m_contexts[ctxId]->items.next() )
+ m_contexts[i]->items.append(c);
+ }
+ else
+ kdDebug(13010)<<"Context "<<ctxId<<"not defined. You can not include the rules of an undefined context"<<endl;
+ }
+ continue; // while nextItem
+ }
+#endif
+ c=createKateHlItem(data,iDl,&RegionList,&ContextNameList);
+ if (c)
+ {
+ m_contexts[i]->items.append(c);
+
+ // Not supported completely atm and only one level. Subitems.(all have
+ // to be matched to at once)
+ datasub=KateHlManager::self()->syntax->getSubItems(data);
+ bool tmpbool;
+ if (tmpbool=KateHlManager::self()->syntax->nextItem(datasub))
+ {
+ for (;tmpbool;tmpbool=KateHlManager::self()->syntax->nextItem(datasub))
+ {
+ c->subItems.resize (c->subItems.size()+1);
+ c->subItems[c->subItems.size()-1] = createKateHlItem(datasub,iDl,&RegionList,&ContextNameList);
+ } }
+ KateHlManager::self()->syntax->freeGroupInfo(datasub);
+ // end of sublevel
+ }
+ }
+ i++;
+ }
+ }
+
+ KateHlManager::self()->syntax->freeGroupInfo(data);
+
+ if (RegionList.count()!=1)
+ folding=true;
+
+ folding = folding || m_foldingIndentationSensitive;
+
+ //BEGIN Resolve multiline region if possible
+ if (!m_additionalData[ ident ]->multiLineRegion.isEmpty()) {
+ long commentregionid=RegionList.findIndex( m_additionalData[ ident ]->multiLineRegion );
+ if (-1==commentregionid) {
+ errorsAndWarnings+=i18n(
+ "<B>%1</B>: Specified multiline comment region (%2) could not be resolved<BR>"
+ ).arg(buildIdentifier).arg( m_additionalData[ ident ]->multiLineRegion );
+ m_additionalData[ ident ]->multiLineRegion = QString();
+ kdDebug(13010)<<"ERROR comment region attribute could not be resolved"<<endl;
+
+ } else {
+ m_additionalData[ ident ]->multiLineRegion=QString::number(commentregionid+1);
+ kdDebug(13010)<<"comment region resolved to:"<<m_additionalData[ ident ]->multiLineRegion<<endl;
+ }
+ }
+ //END Resolve multiline region if possible
+ return i;
+}
+
+void KateHighlighting::clearAttributeArrays ()
+{
+ for ( QIntDictIterator< QMemArray<KateAttribute> > it( m_attributeArrays ); it.current(); ++it )
+ {
+ // k, schema correct, let create the data
+ KateAttributeList defaultStyleList;
+ defaultStyleList.setAutoDelete(true);
+ KateHlManager::self()->getDefaults(it.currentKey(), defaultStyleList);
+
+ KateHlItemDataList itemDataList;
+ getKateHlItemDataList(it.currentKey(), itemDataList);
+
+ uint nAttribs = itemDataList.count();
+ QMemArray<KateAttribute> *array = it.current();
+ array->resize (nAttribs);
+
+ for (uint z = 0; z < nAttribs; z++)
+ {
+ KateHlItemData *itemData = itemDataList.at(z);
+ KateAttribute n = *defaultStyleList.at(itemData->defStyleNum);
+
+ if (itemData && itemData->isSomethingSet())
+ n += *itemData;
+
+ array->at(z) = n;
+ }
+ }
+}
+
+QMemArray<KateAttribute> *KateHighlighting::attributes (uint schema)
+{
+ QMemArray<KateAttribute> *array;
+
+ // found it, allready floating around
+ if ((array = m_attributeArrays[schema]))
+ return array;
+
+ // ohh, not found, check if valid schema number
+ if (!KateFactory::self()->schemaManager()->validSchema(schema))
+ {
+ // uhh, not valid :/, stick with normal default schema, it's always there !
+ return attributes (0);
+ }
+
+ // k, schema correct, let create the data
+ KateAttributeList defaultStyleList;
+ defaultStyleList.setAutoDelete(true);
+ KateHlManager::self()->getDefaults(schema, defaultStyleList);
+
+ KateHlItemDataList itemDataList;
+ getKateHlItemDataList(schema, itemDataList);
+
+ uint nAttribs = itemDataList.count();
+ array = new QMemArray<KateAttribute> (nAttribs);
+
+ for (uint z = 0; z < nAttribs; z++)
+ {
+ KateHlItemData *itemData = itemDataList.at(z);
+ KateAttribute n = *defaultStyleList.at(itemData->defStyleNum);
+
+ if (itemData && itemData->isSomethingSet())
+ n += *itemData;
+
+ array->at(z) = n;
+ }
+
+ m_attributeArrays.insert(schema, array);
+
+ return array;
+}
+
+void KateHighlighting::getKateHlItemDataListCopy (uint schema, KateHlItemDataList &outlist)
+{
+ KateHlItemDataList itemDataList;
+ getKateHlItemDataList(schema, itemDataList);
+
+ outlist.clear ();
+ outlist.setAutoDelete (true);
+ for (uint z=0; z < itemDataList.count(); z++)
+ outlist.append (new KateHlItemData (*itemDataList.at(z)));
+}
+
+//END
+
+//BEGIN KateHlManager
+KateHlManager::KateHlManager()
+ : QObject()
+ , m_config ("katesyntaxhighlightingrc", false, false)
+ , commonSuffixes (QStringList::split(";", ".orig;.new;~;.bak;.BAK"))
+ , syntax (new KateSyntaxDocument())
+ , dynamicCtxsCount(0)
+ , forceNoDCReset(false)
+{
+ hlList.setAutoDelete(true);
+ hlDict.setAutoDelete(false);
+
+ KateSyntaxModeList modeList = syntax->modeList();
+ for (uint i=0; i < modeList.count(); i++)
+ {
+ KateHighlighting *hl = new KateHighlighting(modeList[i]);
+
+ uint insert = 0;
+ for (; insert <= hlList.count(); insert++)
+ {
+ if (insert == hlList.count())
+ break;
+
+ if ( QString(hlList.at(insert)->section() + hlList.at(insert)->nameTranslated()).lower()
+ > QString(hl->section() + hl->nameTranslated()).lower() )
+ break;
+ }
+
+ hlList.insert (insert, hl);
+ hlDict.insert (hl->name(), hl);
+ }
+
+ // Normal HL
+ KateHighlighting *hl = new KateHighlighting(0);
+ hlList.prepend (hl);
+ hlDict.insert (hl->name(), hl);
+
+ lastCtxsReset.start();
+}
+
+KateHlManager::~KateHlManager()
+{
+ delete syntax;
+}
+
+static KStaticDeleter<KateHlManager> sdHlMan;
+
+KateHlManager *KateHlManager::self()
+{
+ if ( !s_self )
+ sdHlMan.setObject(s_self, new KateHlManager ());
+
+ return s_self;
+}
+
+KateHighlighting *KateHlManager::getHl(int n)
+{
+ if (n < 0 || n >= (int) hlList.count())
+ n = 0;
+
+ return hlList.at(n);
+}
+
+int KateHlManager::nameFind(const QString &name)
+{
+ int z (hlList.count() - 1);
+ for (; z > 0; z--)
+ if (hlList.at(z)->name() == name)
+ return z;
+
+ return z;
+}
+
+int KateHlManager::detectHighlighting (KateDocument *doc)
+{
+ int hl = wildcardFind( doc->url().filename() );
+ if ( hl < 0 )
+ hl = mimeFind ( doc );
+
+ return hl;
+}
+
+int KateHlManager::wildcardFind(const QString &fileName)
+{
+ int result = -1;
+ if ((result = realWildcardFind(fileName)) != -1)
+ return result;
+
+ int length = fileName.length();
+ QString backupSuffix = KateDocumentConfig::global()->backupSuffix();
+ if (fileName.endsWith(backupSuffix)) {
+ if ((result = realWildcardFind(fileName.left(length - backupSuffix.length()))) != -1)
+ return result;
+ }
+
+ for (QStringList::Iterator it = commonSuffixes.begin(); it != commonSuffixes.end(); ++it) {
+ if (*it != backupSuffix && fileName.endsWith(*it)) {
+ if ((result = realWildcardFind(fileName.left(length - (*it).length()))) != -1)
+ return result;
+ }
+ }
+
+ return -1;
+}
+
+int KateHlManager::realWildcardFind(const QString &fileName)
+{
+ static QRegExp sep("\\s*;\\s*");
+
+ QPtrList<KateHighlighting> highlights;
+
+ for (KateHighlighting *highlight = hlList.first(); highlight != 0L; highlight = hlList.next()) {
+ highlight->loadWildcards();
+
+ for (QStringList::Iterator it = highlight->getPlainExtensions().begin(); it != highlight->getPlainExtensions().end(); ++it)
+ if (fileName.endsWith((*it)))
+ highlights.append(highlight);
+
+ for (int i = 0; i < (int)highlight->getRegexpExtensions().count(); i++) {
+ QRegExp re = highlight->getRegexpExtensions()[i];
+ if (re.exactMatch(fileName))
+ highlights.append(highlight);
+ }
+ }
+
+ if ( !highlights.isEmpty() )
+ {
+ int pri = -1;
+ int hl = -1;
+
+ for (KateHighlighting *highlight = highlights.first(); highlight != 0L; highlight = highlights.next())
+ {
+ if (highlight->priority() > pri)
+ {
+ pri = highlight->priority();
+ hl = hlList.findRef (highlight);
+ }
+ }
+ return hl;
+ }
+
+ return -1;
+}
+
+int KateHlManager::mimeFind( KateDocument *doc )
+{
+ static QRegExp sep("\\s*;\\s*");
+
+ KMimeType::Ptr mt = doc->mimeTypeForContent();
+
+ QPtrList<KateHighlighting> highlights;
+
+ for (KateHighlighting *highlight = hlList.first(); highlight != 0L; highlight = hlList.next())
+ {
+ QStringList l = QStringList::split( sep, highlight->getMimetypes() );
+
+ for( QStringList::Iterator it = l.begin(); it != l.end(); ++it )
+ {
+ if ( *it == mt->name() ) // faster than a regexp i guess?
+ highlights.append (highlight);
+ }
+ }
+
+ if ( !highlights.isEmpty() )
+ {
+ int pri = -1;
+ int hl = -1;
+
+ for (KateHighlighting *highlight = highlights.first(); highlight != 0L; highlight = highlights.next())
+ {
+ if (highlight->priority() > pri)
+ {
+ pri = highlight->priority();
+ hl = hlList.findRef (highlight);
+ }
+ }
+
+ return hl;
+ }
+
+ return -1;
+}
+
+uint KateHlManager::defaultStyles()
+{
+ return 14;
+}
+
+QString KateHlManager::defaultStyleName(int n, bool translateNames)
+{
+ static QStringList names;
+ static QStringList translatedNames;
+
+ if (names.isEmpty())
+ {
+ names << "Normal";
+ names << "Keyword";
+ names << "Data Type";
+ names << "Decimal/Value";
+ names << "Base-N Integer";
+ names << "Floating Point";
+ names << "Character";
+ names << "String";
+ names << "Comment";
+ names << "Others";
+ names << "Alert";
+ names << "Function";
+ // this next one is for denoting the beginning/end of a user defined folding region
+ names << "Region Marker";
+ // this one is for marking invalid input
+ names << "Error";
+
+ translatedNames << i18n("Normal");
+ translatedNames << i18n("Keyword");
+ translatedNames << i18n("Data Type");
+ translatedNames << i18n("Decimal/Value");
+ translatedNames << i18n("Base-N Integer");
+ translatedNames << i18n("Floating Point");
+ translatedNames << i18n("Character");
+ translatedNames << i18n("String");
+ translatedNames << i18n("Comment");
+ translatedNames << i18n("Others");
+ translatedNames << i18n("Alert");
+ translatedNames << i18n("Function");
+ // this next one is for denoting the beginning/end of a user defined folding region
+ translatedNames << i18n("Region Marker");
+ // this one is for marking invalid input
+ translatedNames << i18n("Error");
+ }
+
+ return translateNames ? translatedNames[n] : names[n];
+}
+
+void KateHlManager::getDefaults(uint schema, KateAttributeList &list)
+{
+ list.setAutoDelete(true);
+
+ KateAttribute* normal = new KateAttribute();
+ normal->setTextColor(Qt::black);
+ normal->setSelectedTextColor(Qt::white);
+ list.append(normal);
+
+ KateAttribute* keyword = new KateAttribute();
+ keyword->setTextColor(Qt::black);
+ keyword->setSelectedTextColor(Qt::white);
+ keyword->setBold(true);
+ list.append(keyword);
+
+ KateAttribute* dataType = new KateAttribute();
+ dataType->setTextColor(Qt::darkRed);
+ dataType->setSelectedTextColor(Qt::white);
+ list.append(dataType);
+
+ KateAttribute* decimal = new KateAttribute();
+ decimal->setTextColor(Qt::blue);
+ decimal->setSelectedTextColor(Qt::cyan);
+ list.append(decimal);
+
+ KateAttribute* basen = new KateAttribute();
+ basen->setTextColor(Qt::darkCyan);
+ basen->setSelectedTextColor(Qt::cyan);
+ list.append(basen);
+
+ KateAttribute* floatAttribute = new KateAttribute();
+ floatAttribute->setTextColor(Qt::darkMagenta);
+ floatAttribute->setSelectedTextColor(Qt::cyan);
+ list.append(floatAttribute);
+
+ KateAttribute* charAttribute = new KateAttribute();
+ charAttribute->setTextColor(Qt::magenta);
+ charAttribute->setSelectedTextColor(Qt::magenta);
+ list.append(charAttribute);
+
+ KateAttribute* string = new KateAttribute();
+ string->setTextColor(QColor::QColor("#D00"));
+ string->setSelectedTextColor(Qt::red);
+ list.append(string);
+
+ KateAttribute* comment = new KateAttribute();
+ comment->setTextColor(Qt::darkGray);
+ comment->setSelectedTextColor(Qt::gray);
+ comment->setItalic(true);
+ list.append(comment);
+
+ KateAttribute* others = new KateAttribute();
+ others->setTextColor(Qt::darkGreen);
+ others->setSelectedTextColor(Qt::green);
+ list.append(others);
+
+ KateAttribute* alert = new KateAttribute();
+ alert->setTextColor(Qt::black);
+ alert->setSelectedTextColor( QColor::QColor("#FCC") );
+ alert->setBold(true);
+ alert->setBGColor( QColor::QColor("#FCC") );
+ list.append(alert);
+
+ KateAttribute* functionAttribute = new KateAttribute();
+ functionAttribute->setTextColor(Qt::darkBlue);
+ functionAttribute->setSelectedTextColor(Qt::white);
+ list.append(functionAttribute);
+
+ KateAttribute* regionmarker = new KateAttribute();
+ regionmarker->setTextColor(Qt::white);
+ regionmarker->setBGColor(Qt::gray);
+ regionmarker->setSelectedTextColor(Qt::gray);
+ list.append(regionmarker);
+
+ KateAttribute* error = new KateAttribute();
+ error->setTextColor(Qt::red);
+ error->setUnderline(true);
+ error->setSelectedTextColor(Qt::red);
+ list.append(error);
+
+ KConfig *config = KateHlManager::self()->self()->getKConfig();
+ config->setGroup("Default Item Styles - Schema " + KateFactory::self()->schemaManager()->name(schema));
+
+ for (uint z = 0; z < defaultStyles(); z++)
+ {
+ KateAttribute *i = list.at(z);
+ QStringList s = config->readListEntry(defaultStyleName(z));
+ if (!s.isEmpty())
+ {
+ while( s.count()<8)
+ s << "";
+
+ QString tmp;
+ QRgb col;
+
+ tmp=s[0]; if (!tmp.isEmpty()) {
+ col=tmp.toUInt(0,16); i->setTextColor(col); }
+
+ tmp=s[1]; if (!tmp.isEmpty()) {
+ col=tmp.toUInt(0,16); i->setSelectedTextColor(col); }
+
+ tmp=s[2]; if (!tmp.isEmpty()) i->setBold(tmp!="0");
+
+ tmp=s[3]; if (!tmp.isEmpty()) i->setItalic(tmp!="0");
+
+ tmp=s[4]; if (!tmp.isEmpty()) i->setStrikeOut(tmp!="0");
+
+ tmp=s[5]; if (!tmp.isEmpty()) i->setUnderline(tmp!="0");
+
+ tmp=s[6]; if (!tmp.isEmpty()) {
+ if ( tmp != "-" )
+ {
+ col=tmp.toUInt(0,16);
+ i->setBGColor(col);
+ }
+ else
+ i->clearAttribute(KateAttribute::BGColor);
+ }
+ tmp=s[7]; if (!tmp.isEmpty()) {
+ if ( tmp != "-" )
+ {
+ col=tmp.toUInt(0,16);
+ i->setSelectedBGColor(col);
+ }
+ else
+ i->clearAttribute(KateAttribute::SelectedBGColor);
+ }
+ }
+ }
+}
+
+void KateHlManager::setDefaults(uint schema, KateAttributeList &list)
+{
+ KConfig *config = KateHlManager::self()->self()->getKConfig();
+ config->setGroup("Default Item Styles - Schema " + KateFactory::self()->schemaManager()->name(schema));
+
+ for (uint z = 0; z < defaultStyles(); z++)
+ {
+ QStringList settings;
+ KateAttribute *i = list.at(z);
+
+ settings<<(i->itemSet(KateAttribute::TextColor)?QString::number(i->textColor().rgb(),16):"");
+ settings<<(i->itemSet(KateAttribute::SelectedTextColor)?QString::number(i->selectedTextColor().rgb(),16):"");
+ settings<<(i->itemSet(KateAttribute::Weight)?(i->bold()?"1":"0"):"");
+ settings<<(i->itemSet(KateAttribute::Italic)?(i->italic()?"1":"0"):"");
+ settings<<(i->itemSet(KateAttribute::StrikeOut)?(i->strikeOut()?"1":"0"):"");
+ settings<<(i->itemSet(KateAttribute::Underline)?(i->underline()?"1":"0"):"");
+ settings<<(i->itemSet(KateAttribute::BGColor)?QString::number(i->bgColor().rgb(),16):"-");
+ settings<<(i->itemSet(KateAttribute::SelectedBGColor)?QString::number(i->selectedBGColor().rgb(),16):"-");
+ settings<<"---";
+
+ config->writeEntry(defaultStyleName(z),settings);
+ }
+
+ emit changed();
+}
+
+int KateHlManager::highlights()
+{
+ return (int) hlList.count();
+}
+
+QString KateHlManager::hlName(int n)
+{
+ return hlList.at(n)->name();
+}
+
+QString KateHlManager::hlNameTranslated(int n)
+{
+ return hlList.at(n)->nameTranslated();
+}
+
+QString KateHlManager::hlSection(int n)
+{
+ return hlList.at(n)->section();
+}
+
+bool KateHlManager::hlHidden(int n)
+{
+ return hlList.at(n)->hidden();
+}
+
+QString KateHlManager::identifierForName(const QString& name)
+{
+ KateHighlighting *hl = 0;
+
+ if ((hl = hlDict[name]))
+ return hl->getIdentifier ();
+
+ return QString();
+}
+
+bool KateHlManager::resetDynamicCtxs()
+{
+ if (forceNoDCReset)
+ return false;
+
+ if (lastCtxsReset.elapsed() < KATE_DYNAMIC_CONTEXTS_RESET_DELAY)
+ return false;
+
+ KateHighlighting *hl;
+ for (hl = hlList.first(); hl; hl = hlList.next())
+ hl->dropDynamicContexts();
+
+ dynamicCtxsCount = 0;
+ lastCtxsReset.start();
+
+ return true;
+}
+//END
+
+//BEGIN KateHighlightAction
+void KateViewHighlightAction::init()
+{
+ m_doc = 0;
+ subMenus.setAutoDelete( true );
+
+ connect(popupMenu(),SIGNAL(aboutToShow()),this,SLOT(slotAboutToShow()));
+}
+
+void KateViewHighlightAction::updateMenu (Kate::Document *doc)
+{
+ m_doc = doc;
+}
+
+void KateViewHighlightAction::slotAboutToShow()
+{
+ Kate::Document *doc=m_doc;
+ int count = KateHlManager::self()->highlights();
+
+ for (int z=0; z<count; z++)
+ {
+ QString hlName = KateHlManager::self()->hlNameTranslated (z);
+ QString hlSection = KateHlManager::self()->hlSection (z);
+
+ if (!KateHlManager::self()->hlHidden(z))
+ {
+ if ( !hlSection.isEmpty() && (names.contains(hlName) < 1) )
+ {
+ if (subMenusName.contains(hlSection) < 1)
+ {
+ subMenusName << hlSection;
+ QPopupMenu *menu = new QPopupMenu ();
+ subMenus.append(menu);
+ popupMenu()->insertItem ( '&' + hlSection, menu);
+ }
+
+ int m = subMenusName.findIndex (hlSection);
+ names << hlName;
+ subMenus.at(m)->insertItem ( '&' + hlName, this, SLOT(setHl(int)), 0, z);
+ }
+ else if (names.contains(hlName) < 1)
+ {
+ names << hlName;
+ popupMenu()->insertItem ( '&' + hlName, this, SLOT(setHl(int)), 0, z);
+ }
+ }
+ }
+
+ if (!doc) return;
+
+ for (uint i=0;i<subMenus.count();i++)
+ {
+ for (uint i2=0;i2<subMenus.at(i)->count();i2++)
+ {
+ subMenus.at(i)->setItemChecked(subMenus.at(i)->idAt(i2),false);
+ }
+ }
+ popupMenu()->setItemChecked (0, false);
+
+ int i = subMenusName.findIndex (KateHlManager::self()->hlSection(doc->hlMode()));
+ if (i >= 0 && subMenus.at(i))
+ subMenus.at(i)->setItemChecked (doc->hlMode(), true);
+ else
+ popupMenu()->setItemChecked (0, true);
+}
+
+void KateViewHighlightAction::setHl (int mode)
+{
+ Kate::Document *doc=m_doc;
+
+ if (doc)
+ doc->setHlMode((uint)mode);
+}
+//END KateViewHighlightAction
+
+// kate: space-indent on; indent-width 2; replace-tabs on;
diff --git a/kate/part/katehighlight.h b/kate/part/katehighlight.h
new file mode 100644
index 000000000..70b7016a3
--- /dev/null
+++ b/kate/part/katehighlight.h
@@ -0,0 +1,438 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2001,2002 Joseph Wenninger <jowenn@kde.org>
+ Copyright (C) 2001 Christoph Cullmann <cullmann@kde.org>
+ Copyright (C) 1999 Jochen Wilhelmy <digisnap@cs.tu-berlin.de>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef __KATE_HIGHLIGHT_H__
+#define __KATE_HIGHLIGHT_H__
+
+#include "katetextline.h"
+#include "kateattribute.h"
+
+#include "../interfaces/document.h"
+
+#include <kconfig.h>
+
+#include <qptrlist.h>
+#include <qvaluelist.h>
+#include <qvaluevector.h>
+#include <qregexp.h>
+#include <qdict.h>
+#include <qintdict.h>
+#include <qmap.h>
+#include <qobject.h>
+#include <qstringlist.h>
+#include <qguardedptr.h>
+#include <qdatetime.h>
+#include <qpopupmenu.h>
+
+class KateHlContext;
+class KateHlItem;
+class KateHlItemData;
+class KateHlData;
+class KateEmbeddedHlInfo;
+class KateHlIncludeRule;
+class KateSyntaxDocument;
+class KateTextLine;
+class KateSyntaxModeListItem;
+class KateSyntaxContextData;
+
+// some typedefs
+typedef QPtrList<KateAttribute> KateAttributeList;
+typedef QValueList<KateHlIncludeRule*> KateHlIncludeRules;
+typedef QPtrList<KateHlItemData> KateHlItemDataList;
+typedef QPtrList<KateHlData> KateHlDataList;
+typedef QMap<QString,KateEmbeddedHlInfo> KateEmbeddedHlInfos;
+typedef QMap<int*,QString> KateHlUnresolvedCtxRefs;
+typedef QValueList<int> IntList;
+
+//Item Properties: name, Item Style, Item Font
+class KateHlItemData : public KateAttribute
+{
+ public:
+ KateHlItemData(const QString name, int defStyleNum);
+
+ enum ItemStyles {
+ dsNormal,
+ dsKeyword,
+ dsDataType,
+ dsDecVal,
+ dsBaseN,
+ dsFloat,
+ dsChar,
+ dsString,
+ dsComment,
+ dsOthers,
+ dsAlert,
+ dsFunction,
+ dsRegionMarker,
+ dsError };
+
+ public:
+ const QString name;
+ int defStyleNum;
+};
+
+class KateHlData
+{
+ public:
+ KateHlData(const QString &wildcards, const QString &mimetypes,const QString &identifier, int priority);
+
+ public:
+ QString wildcards;
+ QString mimetypes;
+ QString identifier;
+ int priority;
+};
+
+class KateHighlighting
+{
+ public:
+ KateHighlighting(const KateSyntaxModeListItem *def);
+ ~KateHighlighting();
+
+ public:
+ void doHighlight ( KateTextLine *prevLine,
+ KateTextLine *textLine,
+ QMemArray<uint> *foldingList,
+ bool *ctxChanged );
+
+ void loadWildcards();
+ QValueList<QRegExp>& getRegexpExtensions();
+ QStringList& getPlainExtensions();
+
+ QString getMimetypes();
+
+ // this pointer needs to be deleted !!!!!!!!!!
+ KateHlData *getData();
+ void setData(KateHlData *);
+
+ void setKateHlItemDataList(uint schema, KateHlItemDataList &);
+
+ // both methodes return hard copies of the internal lists
+ // the lists are cleared first + autodelete is set !
+ // keep track that you delete them, or mem will be lost
+ void getKateHlItemDataListCopy (uint schema, KateHlItemDataList &);
+
+ const QString &name() const {return iName;}
+ const QString &nameTranslated() const {return iNameTranslated;}
+ const QString &section() const {return iSection;}
+ bool hidden() const {return iHidden;}
+ const QString &version() const {return iVersion;}
+ const QString &author () const { return iAuthor; }
+ const QString &license () const { return iLicense; }
+ int priority();
+ const QString &getIdentifier() const {return identifier;}
+ void use();
+ void release();
+
+ /**
+ * @return true if the character @p c is not a deliminator character
+ * for the corresponding highlight.
+ */
+ bool isInWord( QChar c, int attrib=0 ) const;
+
+ /**
+ * @return true if the character @p c is a wordwrap deliminator as specified
+ * in the general keyword section of the xml file.
+ */
+ bool canBreakAt( QChar c, int attrib=0 ) const;
+
+ /**
+ * @return true if @p beginAttr and @p endAttr are members of the same
+ * highlight, and there are comment markers of either type in that.
+ */
+ bool canComment( int startAttr, int endAttr ) const;
+
+ /**
+ * @return 0 if highlighting which attr is a member of does not
+ * define a comment region, otherwise the region is returned
+ */
+ signed char commentRegion(int attr) const;
+
+ /**
+ * @return the mulitiline comment start marker for the highlight
+ * corresponding to @p attrib.
+ */
+ QString getCommentStart( int attrib=0 ) const;
+
+ /**
+ * @return the muiltiline comment end marker for the highlight corresponding
+ * to @p attrib.
+ */
+ QString getCommentEnd( int attrib=0 ) const;
+
+ /**
+ * @return the single comment marker for the highlight corresponding
+ * to @p attrib.
+ */
+ QString getCommentSingleLineStart( int attrib=0 ) const;
+
+
+ /**
+ * This enum is used for storing the information where a single line comment marker should be inserted
+ */
+ enum CSLPos { CSLPosColumn0=0,CSLPosAfterWhitespace=1};
+
+ /**
+ * @return the single comment marker position for the highlight corresponding
+ * to @p attrib.
+ */
+ CSLPos getCommentSingleLinePosition( int attrib=0 ) const;
+
+ /**
+ * @return the attribute for @p context.
+ */
+ int attribute( int context ) const;
+
+ /**
+ * map attribute to its highlighting file.
+ * the returned string is used as key for m_additionalData.
+ */
+ QString hlKeyForAttrib( int attrib ) const;
+
+
+ void clearAttributeArrays ();
+
+ QMemArray<KateAttribute> *attributes (uint schema);
+
+ inline bool noHighlighting () const { return noHl; };
+
+ // be carefull: all documents hl should be invalidated after calling this method!
+ void dropDynamicContexts();
+
+ QString indentation () { return m_indentation; }
+
+ private:
+ // make this private, nobody should play with the internal data pointers
+ void getKateHlItemDataList(uint schema, KateHlItemDataList &);
+
+ void init();
+ void done();
+ void makeContextList ();
+ int makeDynamicContext(KateHlContext *model, const QStringList *args);
+ void handleKateHlIncludeRules ();
+ void handleKateHlIncludeRulesRecursive(KateHlIncludeRules::iterator it, KateHlIncludeRules *list);
+ int addToContextList(const QString &ident, int ctx0);
+ void addToKateHlItemDataList();
+ void createKateHlItemData (KateHlItemDataList &list);
+ void readGlobalKeywordConfig();
+ void readWordWrapConfig();
+ void readCommentConfig();
+ void readIndentationConfig ();
+ void readFoldingConfig ();
+
+ // manipulates the ctxs array directly ;)
+ void generateContextStack(int *ctxNum, int ctx, QMemArray<short> *ctxs, int *posPrevLine);
+
+ KateHlItem *createKateHlItem(KateSyntaxContextData *data, KateHlItemDataList &iDl, QStringList *RegionList, QStringList *ContextList);
+ int lookupAttrName(const QString& name, KateHlItemDataList &iDl);
+
+ void createContextNameList(QStringList *ContextNameList, int ctx0);
+ int getIdFromString(QStringList *ContextNameList, QString tmpLineEndContext,/*NO CONST*/ QString &unres);
+
+ KateHlItemDataList internalIDList;
+
+ QValueVector<KateHlContext*> m_contexts;
+ inline KateHlContext *contextNum (uint n) { if (n < m_contexts.size()) return m_contexts[n]; return 0; }
+
+ QMap< QPair<KateHlContext *, QString>, short> dynamicCtxs;
+
+ // make them pointers perhaps
+ KateEmbeddedHlInfos embeddedHls;
+ KateHlUnresolvedCtxRefs unresolvedContextReferences;
+ QStringList RegionList;
+ QStringList ContextNameList;
+
+ bool noHl;
+ bool folding;
+ bool casesensitive;
+ QString weakDeliminator;
+ QString deliminator;
+
+ QString iName;
+ QString iNameTranslated;
+ QString iSection;
+ bool iHidden;
+ QString iWildcards;
+ QString iMimetypes;
+ QString identifier;
+ QString iVersion;
+ QString iAuthor;
+ QString iLicense;
+ QString m_indentation;
+ int m_priority;
+ int refCount;
+ int startctx, base_startctx;
+
+ QString errorsAndWarnings;
+ QString buildIdentifier;
+ QString buildPrefix;
+ bool building;
+ uint itemData0;
+ uint buildContext0Offset;
+ KateHlIncludeRules includeRules;
+ bool m_foldingIndentationSensitive;
+
+ QIntDict< QMemArray<KateAttribute> > m_attributeArrays;
+
+
+ /**
+ * This class holds the additional properties for one highlight
+ * definition, such as comment strings, deliminators etc.
+ *
+ * When a highlight is added, a instance of this class is appended to
+ * m_additionalData, and the current position in the attrib and context
+ * arrays are stored in the indexes for look up. You can then use
+ * hlKeyForAttrib or hlKeyForContext to find the relevant instance of this
+ * class from m_additionalData.
+ *
+ * If you need to add a property to a highlight, add it here.
+ */
+ class HighlightPropertyBag {
+ public:
+ QString singleLineCommentMarker;
+ QString multiLineCommentStart;
+ QString multiLineCommentEnd;
+ QString multiLineRegion;
+ CSLPos singleLineCommentPosition;
+ QString deliminator;
+ QString wordWrapDeliminator;
+ };
+
+ /**
+ * Highlight properties for each included highlight definition.
+ * The key is the identifier
+ */
+ QDict<HighlightPropertyBag> m_additionalData;
+
+ /**
+ * Fast lookup of hl properties, based on attribute index
+ * The key is the starting index in the attribute array for each file.
+ * @see hlKeyForAttrib
+ */
+ QMap<int, QString> m_hlIndex;
+
+
+ QString extensionSource;
+ QValueList<QRegExp> regexpExtensions;
+ QStringList plainExtensions;
+
+ public:
+ inline bool foldingIndentationSensitive () { return m_foldingIndentationSensitive; }
+ inline bool allowsFolding(){return folding;}
+};
+
+class KateHlManager : public QObject
+{
+ Q_OBJECT
+
+ private:
+ KateHlManager();
+
+ public:
+ ~KateHlManager();
+
+ static KateHlManager *self();
+
+ inline KConfig *getKConfig() { return &m_config; };
+
+ KateHighlighting *getHl(int n);
+ int nameFind(const QString &name);
+
+ int detectHighlighting (class KateDocument *doc);
+
+ int findHl(KateHighlighting *h) {return hlList.find(h);}
+ QString identifierForName(const QString&);
+
+ // methodes to get the default style count + names
+ static uint defaultStyles();
+ static QString defaultStyleName(int n, bool translateNames = false);
+
+ void getDefaults(uint schema, KateAttributeList &);
+ void setDefaults(uint schema, KateAttributeList &);
+
+ int highlights();
+ QString hlName(int n);
+ QString hlNameTranslated (int n);
+ QString hlSection(int n);
+ bool hlHidden(int n);
+
+ void incDynamicCtxs() { ++dynamicCtxsCount; };
+ uint countDynamicCtxs() { return dynamicCtxsCount; };
+ void setForceNoDCReset(bool b) { forceNoDCReset = b; };
+
+ // be carefull: all documents hl should be invalidated after having successfully called this method!
+ bool resetDynamicCtxs();
+
+ signals:
+ void changed();
+
+ private:
+ int wildcardFind(const QString &fileName);
+ int mimeFind(KateDocument *);
+ int realWildcardFind(const QString &fileName);
+
+ private:
+ friend class KateHighlighting;
+
+ QPtrList<KateHighlighting> hlList;
+ QDict<KateHighlighting> hlDict;
+
+ static KateHlManager *s_self;
+
+ KConfig m_config;
+ QStringList commonSuffixes;
+
+ KateSyntaxDocument *syntax;
+
+ uint dynamicCtxsCount;
+ QTime lastCtxsReset;
+ bool forceNoDCReset;
+};
+
+class KateViewHighlightAction: public Kate::ActionMenu
+{
+ Q_OBJECT
+
+ public:
+ KateViewHighlightAction(const QString& text, QObject* parent = 0, const char* name = 0)
+ : Kate::ActionMenu(text, parent, name) { init(); };
+
+ ~KateViewHighlightAction(){;};
+
+ void updateMenu (Kate::Document *doc);
+
+ private:
+ void init();
+
+ QGuardedPtr<Kate::Document> m_doc;
+ QStringList subMenusName;
+ QStringList names;
+ QPtrList<QPopupMenu> subMenus;
+
+ public slots:
+ void slotAboutToShow();
+
+ private slots:
+ void setHl (int mode);
+};
+
+#endif
+
+// kate: space-indent on; indent-width 2; replace-tabs on;
diff --git a/kate/part/kateindentscriptabstracts.cpp b/kate/part/kateindentscriptabstracts.cpp
new file mode 100644
index 000000000..f30dd9ebd
--- /dev/null
+++ b/kate/part/kateindentscriptabstracts.cpp
@@ -0,0 +1,49 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2005 Joseph Wenninger <jowenn@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "kateindentscriptabstracts.h"
+
+#include <kdebug.h>
+#include <qstring.h>
+
+//BEGIN KateIndentScriptImplAbstractImpl
+
+KateIndentScriptImplAbstract::KateIndentScriptImplAbstract(const QString& internalName,
+ const QString &filePath, const QString &niceName,
+ const QString &copyright, double version):m_refcount(0),m_filePath(filePath),m_niceName(niceName),
+ m_copyright(copyright),m_version(version)
+{
+}
+
+KateIndentScriptImplAbstract::~KateIndentScriptImplAbstract()
+{
+}
+
+void KateIndentScriptImplAbstract::incRef()
+{
+ kdDebug(13050)<<"KateIndentScriptImplAbstract::incRef()"<<endl;
+ m_refcount++;
+}
+
+void KateIndentScriptImplAbstract::decRef()
+{
+ kdDebug(13050)<<"KateIndentScriptImplAbstract::decRef()"<<endl;
+ m_refcount--;
+}
+
+//END
diff --git a/kate/part/kateindentscriptabstracts.h b/kate/part/kateindentscriptabstracts.h
new file mode 100644
index 000000000..a47a8431a
--- /dev/null
+++ b/kate/part/kateindentscriptabstracts.h
@@ -0,0 +1,99 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2005 Joseph Wenninger <jowenn@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef _KATEINDENTSCRIPTABSTRACTS_H_
+#define _KATEINDENTSCRIPTABSTRACTS_H_
+
+#include <qstring.h>
+#include <kdebug.h>
+
+namespace Kate {
+ class View;
+}
+
+class KateDocCursor;
+
+
+class KateIndentScriptImplAbstract {
+ public:
+ friend class KateIndentScript;
+ KateIndentScriptImplAbstract(const QString& internalName,
+ const QString &filePath, const QString &niceName,
+ const QString &copyright, double version);
+ virtual ~KateIndentScriptImplAbstract();
+
+ virtual bool processChar( class Kate::View *view, QChar c, QString &errorMsg )=0;
+ virtual bool processLine( class Kate::View *view, const KateDocCursor &line, QString &errorMsg )=0;
+ virtual bool processNewline( class Kate::View *view, const KateDocCursor &begin, bool needcontinue, QString &errorMsg )=0;
+ protected:
+ virtual void decRef();
+ long refCount() {return m_refcount;}
+ QString filePath() const {return m_filePath;}
+ private:
+ void incRef();
+ long m_refcount;
+ QString m_internalName;
+ QString m_filePath;
+ QString m_niceName;
+ QString m_copyright;
+ double m_version;
+};
+
+
+class KateIndentScript {
+ public:
+ KateIndentScript(KateIndentScriptImplAbstract *scr):m_scr(scr) { if (scr) scr->incRef(); }
+ ~KateIndentScript() {if (m_scr) m_scr->decRef();}
+ KateIndentScript():m_scr(0) {}
+ KateIndentScript(const KateIndentScript &p):m_scr(p.m_scr){if (m_scr) m_scr->incRef();}
+ KateIndentScript &operator=(const KateIndentScript &p) {
+ if (m_scr==p.m_scr) return *this;
+ if (m_scr) m_scr->decRef();
+ m_scr=p.m_scr;
+ if (m_scr) m_scr->incRef();
+ return *this;
+ }
+ /*operator KateIndentJScript*() const { return m_scr; }*/
+ bool processChar( class Kate::View *view, QChar c, QString &errorMsg ) {
+ kdDebug(13050)<<"KateIndentScript::processChar: m_scr:"<<m_scr<<endl;
+ if (m_scr) return m_scr->processChar(view,c,errorMsg); else return true;
+ }
+ bool processLine( class Kate::View *view, const KateDocCursor& line, QString &errorMsg ) {
+ kdDebug(13050)<<"KateIndentScript::processLine: m_scr:"<<m_scr<<endl;
+ if (m_scr) return m_scr->processLine(view,line,errorMsg); else return true;
+ }
+ bool processNewline( class Kate::View *view, const KateDocCursor& begin, bool needcontinue, QString &errorMsg ) {
+ kdDebug(13050)<<"KateIndentScript::processNewLine: m_scr:"<<m_scr<<endl;
+ if (m_scr) return m_scr->processNewline(view,begin,needcontinue,errorMsg); else return true;
+ }
+
+ bool isNull () const {return (m_scr==0);}
+ private:
+ KateIndentScriptImplAbstract *m_scr;
+};
+
+class KateIndentScriptManagerAbstract
+{
+
+ public:
+ KateIndentScriptManagerAbstract () {};
+ virtual ~KateIndentScriptManagerAbstract () {};
+ virtual KateIndentScript script(const QString &scriptname)=0;
+};
+
+#endif
diff --git a/kate/part/katejscript.cpp b/kate/part/katejscript.cpp
new file mode 100644
index 000000000..024f36500
--- /dev/null
+++ b/kate/part/katejscript.cpp
@@ -0,0 +1,1169 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2005 Christoph Cullmann <cullmann@kde.org>
+ Copyright (C) 2005 Joseph Wenninger <jowenn@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "katejscript.h"
+
+#include "katedocument.h"
+#include "kateview.h"
+#include "katefactory.h"
+#include "kateconfig.h"
+#include "kateautoindent.h"
+#include "katehighlight.h"
+#include "katetextline.h"
+
+#include "kateindentscriptabstracts.h"
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+
+#include <kdebug.h>
+#include <kstandarddirs.h>
+#include <klocale.h>
+#include <kmessagebox.h>
+#include <kconfig.h>
+
+#include <kjs/function_object.h>
+#include <kjs/interpreter.h>
+#include <kjs/lookup.h>
+
+#include <qfile.h>
+#include <qfileinfo.h>
+#include <qpopupmenu.h>
+#include <qregexp.h>
+#include <qtextstream.h>
+
+
+namespace KJS {
+
+// taken from khtml
+// therefor thx to:
+// Copyright (C) 1999-2003 Harri Porten (porten@kde.org)
+// Copyright (C) 2001-2003 David Faure (faure@kde.org)
+// Copyright (C) 2003 Apple Computer, Inc.
+
+UString::UString(const QString &d)
+{
+ unsigned int len = d.length();
+ UChar *dat = new UChar[len];
+ memcpy(dat, d.unicode(), len * sizeof(UChar));
+ rep = UString::Rep::create(dat, len);
+}
+
+QString UString::qstring() const
+{
+ return QString((QChar*) data(), size());
+}
+
+QConstString UString::qconststring() const
+{
+ return QConstString((QChar*) data(), size());
+}
+
+//BEGIN global methods
+class KateJSGlobalFunctions : public ObjectImp
+{
+ public:
+ KateJSGlobalFunctions(int i, int length);
+ virtual bool implementsCall() const { return true; }
+ virtual Value call(ExecState *exec, Object &thisObj, const List &args);
+
+ enum {
+ Debug
+ };
+
+ private:
+ int id;
+};
+KateJSGlobalFunctions::KateJSGlobalFunctions(int i, int length) : ObjectImp(), id(i)
+{
+ putDirect(lengthPropertyName,length,DontDelete|ReadOnly|DontEnum);
+}
+Value KateJSGlobalFunctions::call(ExecState *exec, Object &/*thisObj*/, const List &args)
+{
+ switch (id) {
+ case Debug:
+ qDebug("Kate (KJS Scripting): %s", args[0].toString(exec).ascii());
+ return Undefined();
+ default:
+ break;
+ }
+
+ return Undefined();
+}
+//END global methods
+
+} // namespace KJS
+
+//BEGIN JS API STUFF
+
+class KateJSGlobal : public KJS::ObjectImp {
+public:
+ virtual KJS::UString className() const { return "global"; }
+};
+
+class KateJSDocument : public KJS::ObjectImp
+{
+ public:
+ KateJSDocument (KJS::ExecState *exec, KateDocument *_doc);
+
+ KJS::Value get( KJS::ExecState *exec, const KJS::Identifier &propertyName) const;
+
+ KJS::Value getValueProperty(KJS::ExecState *exec, int token) const;
+
+ void put(KJS::ExecState *exec, const KJS::Identifier &propertyName, const KJS::Value& value, int attr = KJS::None);
+
+ void putValueProperty(KJS::ExecState *exec, int token, const KJS::Value& value, int attr);
+
+ const KJS::ClassInfo* classInfo() const { return &info; }
+
+ enum { FullText,
+ Text,
+ TextLine,
+ Lines,
+ Length,
+ LineLength,
+ SetText,
+ Clear,
+ InsertText,
+ RemoveText,
+ InsertLine,
+ RemoveLine,
+ EditBegin,
+ EditEnd,
+ IndentWidth,
+ IndentMode,
+ SpaceIndent,
+ MixedIndent,
+ HighlightMode,
+ IsInWord,
+ CanBreakAt,
+ CanComment,
+ CommentMarker,
+ CommentStart,
+ CommentEnd,
+ Attribute
+ };
+
+ public:
+ KateDocument *doc;
+
+ static const KJS::ClassInfo info;
+};
+
+class KateJSView : public KJS::ObjectImp
+{
+ public:
+ KateJSView (KJS::ExecState *exec, KateView *_view);
+
+ KJS::Value get( KJS::ExecState *exec, const KJS::Identifier &propertyName) const;
+
+ KJS::Value getValueProperty(KJS::ExecState *exec, int token) const;
+
+ void put(KJS::ExecState *exec, const KJS::Identifier &propertyName, const KJS::Value& value, int attr = KJS::None);
+
+ void putValueProperty(KJS::ExecState *exec, int token, const KJS::Value& value, int attr);
+
+ const KJS::ClassInfo* classInfo() const { return &info; }
+
+ enum { CursorLine,
+ CursorColumn,
+ CursorColumnReal,
+ SetCursorPosition,
+ SetCursorPositionReal,
+ Selection,
+ HasSelection,
+ SetSelection,
+ RemoveSelectedText,
+ SelectAll,
+ ClearSelection,
+ SelStartLine,
+ SelStartCol,
+ SelEndLine,
+ SelEndCol
+ };
+
+ public:
+ KateView *view;
+
+ static const KJS::ClassInfo info;
+};
+
+class KateJSIndenter : public KJS::ObjectImp
+{
+ public:
+ KateJSIndenter (KJS::ExecState *exec);
+ /*
+ KJS::Value get( KJS::ExecState *exec, const KJS::Identifier &propertyName) const;
+
+ KJS::Value getValueProperty(KJS::ExecState *exec, int token) const;
+
+ void put(KJS::ExecState *exec, const KJS::Identifier &propertyName, const KJS::Value& value, int attr = KJS::None);
+
+ void putValueProperty(KJS::ExecState *exec, int token, const KJS::Value& value, int attr);
+ */
+ const KJS::ClassInfo* classInfo() const { return &info; }
+
+ enum { OnChar,
+ OnLine,
+ OnNewline,
+ Dummy
+ };
+
+ public:
+
+ static const KJS::ClassInfo info;
+};
+
+#include "katejscript.lut.h"
+
+//END
+
+KateJScript::KateJScript ()
+ : m_global (new KJS::Object (new KateJSGlobal ()))
+ , m_interpreter (new KJS::Interpreter (*m_global))
+ , m_document (new KJS::Object(wrapDocument(m_interpreter->globalExec(), 0)))
+ , m_view (new KJS::Object (wrapView(m_interpreter->globalExec(), 0)))
+{
+ // put some stuff into env., this should stay for all executions, as we keep external
+ // references to the inserted KJS::Objects, this should avoid any garbage collection
+ m_interpreter->globalObject().put(m_interpreter->globalExec(), "document", *m_document);
+ m_interpreter->globalObject().put(m_interpreter->globalExec(), "view", *m_view);
+ m_interpreter->globalObject().put(m_interpreter->globalExec(), "debug",
+ KJS::Object(new KateJSGlobalFunctions(KateJSGlobalFunctions::Debug,1)));
+}
+
+KateJScript::~KateJScript ()
+{
+ delete m_view;
+ delete m_document;
+ delete m_interpreter;
+ delete m_global;
+}
+
+KJS::ObjectImp *KateJScript::wrapDocument (KJS::ExecState *exec, KateDocument *doc)
+{
+ return new KateJSDocument(exec, doc);
+}
+
+KJS::ObjectImp *KateJScript::wrapView (KJS::ExecState *exec, KateView *view)
+{
+ return new KateJSView(exec, view);
+}
+
+bool KateJScript::execute (KateView *view, const QString &script, QString &errorMsg)
+{
+ // no view, no fun
+ if (!view)
+ {
+ errorMsg = i18n("Could not access view");
+ return false;
+ }
+
+ // init doc & view with new pointers!
+ static_cast<KateJSDocument *>( m_document->imp() )->doc = view->doc();
+ static_cast<KateJSView *>( m_view->imp() )->view = view;
+
+ // run the script for real
+ KJS::Completion comp (m_interpreter->evaluate(script));
+
+ if (comp.complType() == KJS::Throw)
+ {
+ KJS::ExecState *exec = m_interpreter->globalExec();
+
+ KJS::Value exVal = comp.value();
+
+ char *msg = exVal.toString(exec).ascii();
+
+ int lineno = -1;
+
+ if (exVal.type() == KJS::ObjectType)
+ {
+ KJS::Value lineVal = KJS::Object::dynamicCast(exVal).get(exec,"line");
+
+ if (lineVal.type() == KJS::NumberType)
+ lineno = int(lineVal.toNumber(exec));
+ }
+
+ errorMsg = i18n("Exception, line %1: %2").arg(lineno).arg(msg);
+ return false;
+ }
+
+ return true;
+}
+
+//BEGIN KateJSDocument
+
+// -------------------------------------------------------------------------
+/* Source for KateJSDocumentProtoTable.
+@begin KateJSDocumentProtoTable 21
+#
+# edit interface stuff + editBegin/End, this is nice start
+#
+ textFull KateJSDocument::FullText DontDelete|Function 0
+ textRange KateJSDocument::Text DontDelete|Function 4
+ textLine KateJSDocument::TextLine DontDelete|Function 1
+ lines KateJSDocument::Lines DontDelete|Function 0
+ length KateJSDocument::Length DontDelete|Function 0
+ lineLength KateJSDocument::LineLength DontDelete|Function 1
+ setText KateJSDocument::SetText DontDelete|Function 1
+ clear KateJSDocument::Clear DontDelete|Function 0
+ insertText KateJSDocument::InsertText DontDelete|Function 3
+ removeText KateJSDocument::RemoveText DontDelete|Function 4
+ insertLine KateJSDocument::InsertLine DontDelete|Function 2
+ removeLine KateJSDocument::RemoveLine DontDelete|Function 1
+ editBegin KateJSDocument::EditBegin DontDelete|Function 0
+ editEnd KateJSDocument::EditEnd DontDelete|Function 0
+#
+# methods from highlight (and around)
+#
+ isInWord KateJSDocument::IsInWord DontDelete|Function 2
+ canBreakAt KateJSDocument::CanBreakAt DontDelete|Function 2
+ canComment KateJSDocument::CanComment DontDelete|Function 2
+ commentMarker KateJSDocument::CommentMarker DontDelete|Function 1
+ commentStart KateJSDocument::CommentStart DontDelete|Function 1
+ commentEnd KateJSDocument::CommentEnd DontDelete|Function 1
+ attribute KateJSDocument::Attribute DontDelete|Function 2
+@end
+
+@begin KateJSDocumentTable 6
+#
+# Configuration properties
+#
+ indentWidth KateJSDocument::IndentWidth DontDelete|ReadOnly
+ indentMode KateJSDocument::IndentMode DontDelete|ReadOnly
+ spaceIndent KateJSDocument::SpaceIndent DontDelete|ReadOnly
+ mixedIndent KateJSDocument::MixedIndent DontDelete|ReadOnly
+ highlightMode KateJSDocument::HighlightMode DontDelete|ReadOnly
+@end
+*/
+
+DEFINE_PROTOTYPE("KateJSDocument",KateJSDocumentProto)
+IMPLEMENT_PROTOFUNC(KateJSDocumentProtoFunc)
+IMPLEMENT_PROTOTYPE(KateJSDocumentProto,KateJSDocumentProtoFunc)
+
+const KJS::ClassInfo KateJSDocument::info = { "KateJSDocument", 0, 0, 0 };
+
+KJS::Value KJS::KateJSDocumentProtoFunc::call(KJS::ExecState *exec, KJS::Object &thisObj, const KJS::List &args)
+{
+ KJS_CHECK_THIS( KateJSDocument, thisObj );
+
+ KateDocument *doc = static_cast<KateJSDocument *>( thisObj.imp() )->doc;
+
+ if (!doc)
+ return KJS::Undefined();
+
+ switch (id)
+ {
+ case KateJSDocument::FullText:
+ return KJS::String (doc->text());
+
+ case KateJSDocument::Text:
+ return KJS::String (doc->text(args[0].toUInt32(exec), args[1].toUInt32(exec), args[2].toUInt32(exec), args[3].toUInt32(exec)));
+
+ case KateJSDocument::TextLine:
+ return KJS::String (doc->textLine (args[0].toUInt32(exec)));
+
+ case KateJSDocument::Lines:
+ return KJS::Number (doc->numLines());
+
+ case KateJSDocument::Length:
+ return KJS::Number (doc->length());
+
+ case KateJSDocument::LineLength:
+ return KJS::Number (doc->lineLength(args[0].toUInt32(exec)));
+
+ case KateJSDocument::SetText:
+ return KJS::Boolean (doc->setText(args[0].toString(exec).qstring()));
+
+ case KateJSDocument::Clear:
+ return KJS::Boolean (doc->clear());
+
+ case KateJSDocument::InsertText:
+ return KJS::Boolean (doc->insertText (args[0].toUInt32(exec), args[1].toUInt32(exec), args[2].toString(exec).qstring()));
+
+ case KateJSDocument::RemoveText:
+ return KJS::Boolean (doc->removeText(args[0].toUInt32(exec), args[1].toUInt32(exec), args[2].toUInt32(exec), args[3].toUInt32(exec)));
+
+ case KateJSDocument::InsertLine:
+ return KJS::Boolean (doc->insertLine (args[0].toUInt32(exec), args[1].toString(exec).qstring()));
+
+ case KateJSDocument::RemoveLine:
+ return KJS::Boolean (doc->removeLine (args[0].toUInt32(exec)));
+
+ case KateJSDocument::EditBegin:
+ doc->editBegin();
+ return KJS::Null ();
+
+ case KateJSDocument::EditEnd:
+ doc->editEnd ();
+ return KJS::Null ();
+
+ case KateJSDocument::IsInWord:
+ return KJS::Boolean( doc->highlight()->isInWord( args[0].toString(exec).qstring().at(0), args[1].toUInt32(exec) ) );
+
+ case KateJSDocument::CanBreakAt:
+ return KJS::Boolean( doc->highlight()->canBreakAt( args[0].toString(exec).qstring().at(0), args[1].toUInt32(exec) ) );
+
+ case KateJSDocument::CanComment:
+ return KJS::Boolean( doc->highlight()->canComment( args[0].toUInt32(exec), args[1].toUInt32(exec) ) );
+
+ case KateJSDocument::CommentMarker:
+ return KJS::String( doc->highlight()->getCommentSingleLineStart( args[0].toUInt32(exec) ) );
+
+ case KateJSDocument::CommentStart:
+ return KJS::String( doc->highlight()->getCommentStart( args[0].toUInt32(exec) ) );
+
+ case KateJSDocument::CommentEnd:
+ return KJS::String( doc->highlight()->getCommentEnd( args[0].toUInt32(exec) ) );
+
+ case KateJSDocument::Attribute:
+ return KJS::Number( doc->kateTextLine(args[0].toUInt32(exec))->attribute(args[1].toUInt32(exec)) );
+ }
+
+ return KJS::Undefined();
+}
+
+KJS::Value KateJSDocument::get( KJS::ExecState *exec, const KJS::Identifier &propertyName) const
+{
+ return KJS::lookupGetValue<KateJSDocument,KJS::ObjectImp>(exec, propertyName, &KateJSDocumentTable, this );
+}
+
+KJS::Value KateJSDocument::getValueProperty(KJS::ExecState *exec, int token) const
+{
+ if (!doc)
+ return KJS::Undefined ();
+
+ switch (token) {
+ case KateJSDocument::IndentWidth:
+ return KJS::Number( doc->config()->indentationWidth() );
+
+ case KateJSDocument::IndentMode:
+ return KJS::String( KateAutoIndent::modeName( doc->config()->indentationMode() ) );
+
+ case KateJSDocument::SpaceIndent:
+ return KJS::Boolean( doc->config()->configFlags() & KateDocumentConfig::cfSpaceIndent );
+
+ case KateJSDocument::MixedIndent:
+ return KJS::Boolean( doc->config()->configFlags() & KateDocumentConfig::cfMixedIndent );
+
+ case KateJSDocument::HighlightMode:
+ return KJS::String( doc->hlModeName( doc->hlMode() ) );
+ }
+
+ return KJS::Undefined ();
+}
+
+void KateJSDocument::put(KJS::ExecState *exec, const KJS::Identifier &propertyName, const KJS::Value& value, int attr)
+{
+ KJS::lookupPut<KateJSDocument,KJS::ObjectImp>(exec, propertyName, value, attr, &KateJSDocumentTable, this );
+}
+
+void KateJSDocument::putValueProperty(KJS::ExecState *exec, int token, const KJS::Value& value, int attr)
+{
+ if (!doc)
+ return;
+}
+
+KateJSDocument::KateJSDocument (KJS::ExecState *exec, KateDocument *_doc)
+ : KJS::ObjectImp (KateJSDocumentProto::self(exec))
+ , doc (_doc)
+{
+}
+
+//END
+
+//BEGIN KateJSView
+
+// -------------------------------------------------------------------------
+/* Source for KateJSViewProtoTable.
+@begin KateJSViewProtoTable 14
+ cursorLine KateJSView::CursorLine DontDelete|Function 0
+ cursorColumn KateJSView::CursorColumn DontDelete|Function 0
+ cursorColumnReal KateJSView::CursorColumnReal DontDelete|Function 0
+ setCursorPosition KateJSView::SetCursorPosition DontDelete|Function 2
+ setCursorPositionReal KateJSView::SetCursorPositionReal DontDelete|Function 2
+ selection KateJSView::Selection DontDelete|Function 0
+ hasSelection KateJSView::HasSelection DontDelete|Function 0
+ setSelection KateJSView::SetSelection DontDelete|Function 4
+ removeSelectedText KateJSView::RemoveSelectedText DontDelete|Function 0
+ selectAll KateJSView::SelectAll DontDelete|Function 0
+ clearSelection KateJSView::ClearSelection DontDelete|Function 0
+@end
+*/
+
+/* Source for KateJSViewTable.
+@begin KateJSViewTable 5
+ selectionStartLine KateJSView::SelStartLine DontDelete|ReadOnly
+ selectionStartColumn KateJSView::SelStartCol DontDelete|ReadOnly
+ selectionEndLine KateJSView::SelEndLine DontDelete|ReadOnly
+ selectionEndColumn KateJSView::SelEndCol DontDelete|ReadOnly
+@end
+*/
+
+DEFINE_PROTOTYPE("KateJSView",KateJSViewProto)
+IMPLEMENT_PROTOFUNC(KateJSViewProtoFunc)
+IMPLEMENT_PROTOTYPE(KateJSViewProto,KateJSViewProtoFunc)
+
+const KJS::ClassInfo KateJSView::info = { "KateJSView", 0, &KateJSViewTable, 0 };
+
+KJS::Value KJS::KateJSViewProtoFunc::call(KJS::ExecState *exec, KJS::Object &thisObj, const KJS::List &args)
+{
+ KJS_CHECK_THIS( KateJSView, thisObj );
+
+ KateView *view = static_cast<KateJSView *>( thisObj.imp() )->view;
+
+ if (!view)
+ return KJS::Undefined();
+
+ switch (id)
+ {
+ case KateJSView::CursorLine:
+ return KJS::Number (view->cursorLine());
+
+ case KateJSView::CursorColumn:
+ return KJS::Number (view->cursorColumn());
+
+ case KateJSView::CursorColumnReal:
+ return KJS::Number (view->cursorColumnReal());
+
+ case KateJSView::SetCursorPosition:
+ return KJS::Boolean( view->setCursorPosition( args[0].toUInt32(exec), args[1].toUInt32(exec) ) );
+
+ case KateJSView::SetCursorPositionReal:
+ return KJS::Boolean( view->setCursorPositionReal( args[0].toUInt32(exec), args[1].toUInt32(exec) ) );
+
+ // SelectionInterface goes in the view, in anticipation of the future
+ case KateJSView::Selection:
+ return KJS::String( view->selection() );
+
+ case KateJSView::HasSelection:
+ return KJS::Boolean( view->hasSelection() );
+
+ case KateJSView::SetSelection:
+ return KJS::Boolean( view->setSelection(args[0].toUInt32(exec),
+ args[1].toUInt32(exec),
+ args[2].toUInt32(exec),
+ args[3].toUInt32(exec)) );
+
+ case KateJSView::RemoveSelectedText:
+ return KJS::Boolean( view->removeSelectedText() );
+
+ case KateJSView::SelectAll:
+ return KJS::Boolean( view->selectAll() );
+
+ case KateJSView::ClearSelection:
+ return KJS::Boolean( view->clearSelection() );
+ }
+
+ return KJS::Undefined();
+}
+
+KateJSView::KateJSView (KJS::ExecState *exec, KateView *_view)
+ : KJS::ObjectImp (KateJSViewProto::self(exec))
+ , view (_view)
+{
+}
+
+KJS::Value KateJSView::get( KJS::ExecState *exec, const KJS::Identifier &propertyName) const
+{
+ return KJS::lookupGetValue<KateJSView,KJS::ObjectImp>(exec, propertyName, &KateJSViewTable, this );
+}
+
+KJS::Value KateJSView::getValueProperty(KJS::ExecState *exec, int token) const
+{
+ if (!view)
+ return KJS::Undefined ();
+
+ switch (token) {
+ case KateJSView::SelStartLine:
+ return KJS::Number( view->selStartLine() );
+
+ case KateJSView::SelStartCol:
+ return KJS::Number( view->selStartCol() );
+
+ case KateJSView::SelEndLine:
+ return KJS::Number( view->selEndLine() );
+
+ case KateJSView::SelEndCol:
+ return KJS::Number( view->selEndCol() );
+ }
+
+ return KJS::Undefined ();
+}
+
+void KateJSView::put(KJS::ExecState *exec, const KJS::Identifier &propertyName, const KJS::Value& value, int attr)
+{
+ KJS::lookupPut<KateJSView,KJS::ObjectImp>(exec, propertyName, value, attr, &KateJSViewTable, this );
+}
+
+void KateJSView::putValueProperty(KJS::ExecState *exec, int token, const KJS::Value& value, int attr)
+{
+ if (!view)
+ return;
+
+
+}
+
+//END
+
+//BEGIN KateJScriptManager
+
+KateJScriptManager::KateJScriptManager ()
+{
+ m_scripts.setAutoDelete (true);
+ collectScripts ();
+}
+
+KateJScriptManager::~KateJScriptManager ()
+{
+}
+
+void KateJScriptManager::collectScripts (bool force)
+{
+// If there's something in myModeList the Mode List was already built so, don't do it again
+ if (!m_scripts.isEmpty())
+ return;
+
+ // We'll store the scripts list in this config
+ KConfig config("katepartjscriptrc", false, false);
+
+ // figure out if the kate install is too new
+ config.setGroup ("General");
+ if (config.readNumEntry ("Version") > config.readNumEntry ("CachedVersion"))
+ {
+ config.writeEntry ("CachedVersion", config.readNumEntry ("Version"));
+ force = true;
+ }
+
+ // Let's get a list of all the .js files
+ QStringList list = KGlobal::dirs()->findAllResources("data","katepart/scripts/*.js",false,true);
+
+ // Let's iterate through the list and build the Mode List
+ for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it )
+ {
+ // Each file has a group called:
+ QString Group="Cache "+ *it;
+
+ // Let's go to this group
+ config.setGroup(Group);
+
+ // stat the file
+ struct stat sbuf;
+ memset (&sbuf, 0, sizeof(sbuf));
+ stat(QFile::encodeName(*it), &sbuf);
+
+ // If the group exist and we're not forced to read the .js file, let's build myModeList for katepartjscriptrc
+ if (!force && config.hasGroup(Group) && (sbuf.st_mtime == config.readNumEntry("lastModified")))
+ {
+ }
+ else
+ {
+ kdDebug (13050) << "add script: " << *it << endl;
+
+ QString desktopFile = (*it).left((*it).length()-2).append ("desktop");
+
+ kdDebug (13050) << "add script (desktop file): " << desktopFile << endl;
+
+ QFileInfo dfi (desktopFile);
+
+ if (dfi.exists())
+ {
+ KConfig df (desktopFile, true, false);
+ df.setDesktopGroup ();
+
+ // get cmdname, fallback to baseName, if it is empty, therefor not use the kconfig fallback
+ QString cmdname = df.readEntry ("X-Kate-Command");
+ if (cmdname.isEmpty())
+ {
+ QFileInfo fi (*it);
+ cmdname = fi.baseName();
+ }
+
+ if (m_scripts[cmdname])
+ continue;
+
+ KateJScriptManager::Script *s = new KateJScriptManager::Script ();
+
+ s->name = cmdname;
+ s->filename = *it;
+ s->desktopFileExists = true;
+
+ m_scripts.insert (s->name, s);
+ }
+ else // no desktop file around, fall back to scriptfilename == commandname
+ {
+ kdDebug (13050) << "add script: fallback, no desktop file around!" << endl;
+
+ QFileInfo fi (*it);
+
+ if (m_scripts[fi.baseName()])
+ continue;
+
+ KateJScriptManager::Script *s = new KateJScriptManager::Script ();
+
+ s->name = fi.baseName();
+ s->filename = *it;
+ s->desktopFileExists = false;
+
+ m_scripts.insert (s->name, s);
+ }
+ }
+ }
+
+ // Syncronize with the file katepartjscriptrc
+ config.sync();
+}
+
+bool KateJScriptManager::exec( Kate::View *view, const QString &_cmd, QString &errorMsg )
+{
+ // cast it hardcore, we know that it is really a kateview :)
+ KateView *v = (KateView*) view;
+
+ if ( !v )
+ {
+ errorMsg = i18n("Could not access view");
+ return false;
+ }
+
+ //create a list of args
+ QStringList args( QStringList::split( QRegExp("\\s+"), _cmd ) );
+ QString cmd ( args.first() );
+ args.remove( args.first() );
+
+ kdDebug(13050) << "try to exec: " << cmd << endl;
+
+ if (!m_scripts[cmd])
+ {
+ errorMsg = i18n("Command not found");
+ return false;
+ }
+
+ QFile file (m_scripts[cmd]->filename);
+
+ if ( !file.open( IO_ReadOnly ) )
+ {
+ errorMsg = i18n("JavaScript file not found");
+ return false;
+ }
+
+ QTextStream stream( &file );
+ stream.setEncoding (QTextStream::UnicodeUTF8);
+
+ QString source = stream.read ();
+
+ file.close();
+
+ return KateFactory::self()->jscript()->execute(v, source, errorMsg);
+}
+
+bool KateJScriptManager::help( Kate::View *, const QString &cmd, QString &msg )
+{
+ if (!m_scripts[cmd] || !m_scripts[cmd]->desktopFileExists)
+ return false;
+
+ KConfig df (m_scripts[cmd]->desktopFilename(), true, false);
+ df.setDesktopGroup ();
+
+ msg = df.readEntry ("X-Kate-Help");
+
+ if (msg.isEmpty())
+ return false;
+
+ return true;
+}
+
+QStringList KateJScriptManager::cmds()
+{
+ QStringList l;
+
+ QDictIterator<KateJScriptManager::Script> it( m_scripts );
+ for( ; it.current(); ++it )
+ l << it.current()->name;
+
+ return l;
+}
+
+//END
+
+
+
+
+//BEGIN KateJSIndenter
+
+// -------------------------------------------------------------------------
+/* Source for KateJSIndenterProtoTable.
+@begin KateJSIndenterProtoTable 1
+ Dummy KateJSIndenter::Dummy DontDelete
+@end
+*/
+
+/* Source for KateJSIndenterTable.
+@begin KateJSIndenterTable 3
+ onchar KateJSIndenter::OnChar DontDelete
+ onnewline KateJSIndenter::OnNewline DontDelete
+ online KateJSIndenter::OnLine DontDelete
+
+@end
+*/
+
+KateJSIndenter::KateJSIndenter (KJS::ExecState *exec)
+ : KJS::ObjectImp (KateJSViewProto::self(exec))
+{
+}
+
+DEFINE_PROTOTYPE("KateJSIndenter",KateJSIndenterProto)
+IMPLEMENT_PROTOFUNC(KateJSIndenterProtoFunc)
+IMPLEMENT_PROTOTYPE(KateJSIndenterProto,KateJSIndenterProtoFunc)
+
+const KJS::ClassInfo KateJSIndenter::info = { "KateJSIndenter", 0, &KateJSIndenterTable, 0 };
+
+KJS::Value KJS::KateJSIndenterProtoFunc::call(KJS::ExecState *exec, KJS::Object &thisObj, const KJS::List &args)
+{
+ KJS_CHECK_THIS( KateJSIndenter, thisObj );
+
+ return KJS::Undefined();
+}
+
+//END
+
+//BEGIN KateIndentJScriptImpl
+KateIndentJScriptImpl::KateIndentJScriptImpl(const QString& internalName,
+ const QString &filePath, const QString &niceName,
+ const QString &copyright, double version):
+ KateIndentScriptImplAbstract(internalName,filePath,niceName,copyright,version),m_interpreter(0),m_indenter(0)
+{
+}
+
+
+KateIndentJScriptImpl::~KateIndentJScriptImpl()
+{
+ deleteInterpreter();
+}
+
+void KateIndentJScriptImpl::decRef()
+{
+ KateIndentScriptImplAbstract::decRef();
+ if (refCount()==0)
+ {
+ deleteInterpreter();
+ }
+}
+
+void KateIndentJScriptImpl::deleteInterpreter()
+{
+ m_docWrapper=0;
+ m_viewWrapper=0;
+ delete m_indenter;
+ m_indenter=0;
+ delete m_interpreter;
+ m_interpreter=0;
+}
+
+bool KateIndentJScriptImpl::setupInterpreter(QString &errorMsg)
+{
+ if (!m_interpreter)
+ {
+ kdDebug(13050)<<"Setting up interpreter"<<endl;
+ m_interpreter=new KJS::Interpreter(KJS::Object(new KateJSGlobal()));
+ m_docWrapper=new KateJSDocument(m_interpreter->globalExec(),0);
+ m_viewWrapper=new KateJSView(m_interpreter->globalExec(),0);
+ m_indenter=new KJS::Object(new KateJSIndenter(m_interpreter->globalExec()));
+ m_interpreter->globalObject().put(m_interpreter->globalExec(),"document",KJS::Object(m_docWrapper),KJS::DontDelete | KJS::ReadOnly);
+ m_interpreter->globalObject().put(m_interpreter->globalExec(),"view",KJS::Object(m_viewWrapper),KJS::DontDelete | KJS::ReadOnly);
+ m_interpreter->globalObject().put(m_interpreter->globalExec(),"debug", KJS::Object(new
+ KateJSGlobalFunctions(KateJSGlobalFunctions::Debug,1)));
+ m_interpreter->globalObject().put(m_interpreter->globalExec(),"indenter",*m_indenter,KJS::DontDelete | KJS::ReadOnly);
+ QFile file (filePath());
+
+ if ( !file.open( IO_ReadOnly ) )
+ {
+ errorMsg = i18n("JavaScript file not found");
+ deleteInterpreter();
+ return false;
+ }
+
+ QTextStream stream( &file );
+ stream.setEncoding (QTextStream::UnicodeUTF8);
+
+ QString source = stream.read ();
+
+ file.close();
+
+ KJS::Completion comp (m_interpreter->evaluate(source));
+ if (comp.complType() == KJS::Throw)
+ {
+ KJS::ExecState *exec = m_interpreter->globalExec();
+
+ KJS::Value exVal = comp.value();
+
+ char *msg = exVal.toString(exec).ascii();
+
+ int lineno = -1;
+
+ if (exVal.type() == KJS::ObjectType)
+ {
+ KJS::Value lineVal = KJS::Object::dynamicCast(exVal).get(exec,"line");
+
+ if (lineVal.type() == KJS::NumberType)
+ lineno = int(lineVal.toNumber(exec));
+ }
+
+ errorMsg = i18n("Exception, line %1: %2").arg(lineno).arg(msg);
+ deleteInterpreter();
+ return false;
+ } else {
+ return true;
+ }
+ } else return true;
+}
+
+
+inline static bool KateIndentJScriptCall(Kate::View *view, QString &errorMsg, KateJSDocument *docWrapper, KateJSView *viewWrapper,
+ KJS::Interpreter *interpreter, KJS::Object lookupobj,const KJS::Identifier& func,KJS::List params)
+{
+ // no view, no fun
+ if (!view)
+ {
+ errorMsg = i18n("Could not access view");
+ return false;
+ }
+
+ KateView *v=(KateView*)view;
+
+ KJS::Object o=lookupobj.get(interpreter->globalExec(),func).toObject(interpreter->globalExec());
+ if (interpreter->globalExec()->hadException())
+ {
+ errorMsg=interpreter->globalExec()->exception().toString(interpreter->globalExec()).qstring();
+ kdDebug(13050)<<"Exception(1):"<<errorMsg<<endl;
+ interpreter->globalExec()->clearException();
+ return false;
+ }
+
+ // init doc & view with new pointers!
+ docWrapper->doc = v->doc();
+ viewWrapper->view = v;
+
+ /*kdDebug(13050)<<"Call Object:"<<o.toString(interpreter->globalExec()).ascii()<<endl;*/
+ o.call(interpreter->globalExec(),interpreter->globalObject(),params);
+ if (interpreter->globalExec()->hadException())
+ {
+ errorMsg=interpreter->globalExec()->exception().toString(interpreter->globalExec()).ascii();
+ kdDebug(13050)<<"Exception(2):"<<errorMsg<<endl;
+ interpreter->globalExec()->clearException();
+ return false;
+ }
+ return true;
+}
+
+bool KateIndentJScriptImpl::processChar(Kate::View *view, QChar c, QString &errorMsg )
+{
+
+ kdDebug(13050)<<"KateIndentJScriptImpl::processChar"<<endl;
+ if (!setupInterpreter(errorMsg)) return false;
+ KJS::List params;
+ params.append(KJS::String(QString(c)));
+ return KateIndentJScriptCall(view,errorMsg,m_docWrapper,m_viewWrapper,m_interpreter,*m_indenter,KJS::Identifier("onchar"),params);
+}
+
+bool KateIndentJScriptImpl::processLine(Kate::View *view, const KateDocCursor &line, QString &errorMsg )
+{
+ kdDebug(13050)<<"KateIndentJScriptImpl::processLine"<<endl;
+ if (!setupInterpreter(errorMsg)) return false;
+ return KateIndentJScriptCall(view,errorMsg,m_docWrapper,m_viewWrapper,m_interpreter,*m_indenter,KJS::Identifier("online"),KJS::List());
+}
+
+bool KateIndentJScriptImpl::processNewline( class Kate::View *view, const KateDocCursor &begin, bool needcontinue, QString &errorMsg )
+{
+ kdDebug(13050)<<"KateIndentJScriptImpl::processNewline"<<endl;
+ if (!setupInterpreter(errorMsg)) return false;
+ return KateIndentJScriptCall(view,errorMsg,m_docWrapper,m_viewWrapper,m_interpreter,*m_indenter,KJS::Identifier("onnewline"),KJS::List());
+}
+//END
+
+//BEGIN KateIndentJScriptManager
+KateIndentJScriptManager::KateIndentJScriptManager():KateIndentScriptManagerAbstract()
+{
+ m_scripts.setAutoDelete (true);
+ collectScripts ();
+}
+
+KateIndentJScriptManager::~KateIndentJScriptManager ()
+{
+}
+
+void KateIndentJScriptManager::collectScripts (bool force)
+{
+// If there's something in myModeList the Mode List was already built so, don't do it again
+ if (!m_scripts.isEmpty())
+ return;
+
+
+ // We'll store the scripts list in this config
+ KConfig config("katepartindentjscriptrc", false, false);
+#if 0
+ // figure out if the kate install is too new
+ config.setGroup ("General");
+ if (config.readNumEntry ("Version") > config.readNumEntry ("CachedVersion"))
+ {
+ config.writeEntry ("CachedVersion", config.readNumEntry ("Version"));
+ force = true;
+ }
+#endif
+
+ // Let's get a list of all the .js files
+ QStringList list = KGlobal::dirs()->findAllResources("data","katepart/scripts/indent/*.js",false,true);
+
+ // Let's iterate through the list and build the Mode List
+ for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it )
+ {
+ // Each file has a group ed:
+ QString Group="Cache "+ *it;
+
+ // Let's go to this group
+ config.setGroup(Group);
+
+ // stat the file
+ struct stat sbuf;
+ memset (&sbuf, 0, sizeof(sbuf));
+ stat(QFile::encodeName(*it), &sbuf);
+
+ // If the group exist and we're not forced to read the .js file, let's build myModeList for katepartjscriptrc
+ bool readnew=false;
+ if (!force && config.hasGroup(Group) && (sbuf.st_mtime == config.readNumEntry("lastModified")))
+ {
+ config.setGroup(Group);
+ QString filePath=*it;
+ QString internalName=config.readEntry("internlName","KATE-ERROR");
+ if (internalName=="KATE-ERROR") readnew=true;
+ else
+ {
+ QString niceName=config.readEntry("niceName",internalName);
+ QString copyright=config.readEntry("copyright",i18n("(Unknown)"));
+ double version=config.readDoubleNumEntry("version",0.0);
+ KateIndentJScriptImpl *s=new KateIndentJScriptImpl(
+ internalName,filePath,niceName,copyright,version);
+ m_scripts.insert (internalName, s);
+ }
+ }
+ else readnew=true;
+ if (readnew)
+ {
+ QFileInfo fi (*it);
+
+ if (m_scripts[fi.baseName()])
+ continue;
+
+ QString internalName=fi.baseName();
+ QString filePath=*it;
+ QString niceName=internalName;
+ QString copyright=i18n("(Unknown)");
+ double version=0.0;
+ parseScriptHeader(filePath,&niceName,&copyright,&version);
+ /*save the information for retrieval*/
+ config.setGroup(Group);
+ config.writeEntry("lastModified",sbuf.st_mtime);
+ config.writeEntry("internalName",internalName);
+ config.writeEntry("niceName",niceName);
+ config.writeEntry("copyright",copyright);
+ config.writeEntry("version",version);
+ KateIndentJScriptImpl *s=new KateIndentJScriptImpl(
+ internalName,filePath,niceName,copyright,version);
+ m_scripts.insert (internalName, s);
+ }
+ }
+
+ // Syncronize with the file katepartjscriptrc
+ config.sync();
+}
+
+KateIndentScript KateIndentJScriptManager::script(const QString &scriptname) {
+ KateIndentJScriptImpl *s=m_scripts[scriptname];
+ kdDebug(13050)<<scriptname<<"=="<<s<<endl;
+ return KateIndentScript(s);
+}
+
+void KateIndentJScriptManager::parseScriptHeader(const QString &filePath,
+ QString *niceName,QString *copyright,double *version)
+{
+ QFile f(QFile::encodeName(filePath));
+ if (!f.open(IO_ReadOnly) ) {
+ kdDebug(13050)<<"Header could not be parsed, because file could not be opened"<<endl;
+ return;
+ }
+ QTextStream st(&f);
+ st.setEncoding (QTextStream::UnicodeUTF8);
+ if (!st.readLine().upper().startsWith("/**KATE")) {
+ kdDebug(13050)<<"No header found"<<endl;
+ f.close();
+ return;
+ }
+ // here the real parsing begins
+ kdDebug(13050)<<"Parsing indent script header"<<endl;
+ enum {NOTHING=0,COPYRIGHT=1} currentState=NOTHING;
+ QString line;
+ QString tmpblockdata="";
+ QRegExp endExpr("[\\s\\t]*\\*\\*\\/[\\s\\t]*$");
+ QRegExp keyValue("[\\s\\t]*\\*\\s*(.+):(.*)$");
+ QRegExp blockContent("[\\s\\t]*\\*(.*)$");
+ while ((line=st.readLine())!=QString::null) {
+ if (endExpr.exactMatch(line)) {
+ kdDebug(13050)<<"end of config block"<<endl;
+ if (currentState==NOTHING) break;
+ if (currentState==COPYRIGHT) {
+ *copyright=tmpblockdata;
+ break;
+ }
+ Q_ASSERT(0);
+ }
+ if (currentState==NOTHING)
+ {
+ if (keyValue.exactMatch(line)) {
+ QStringList sl=keyValue.capturedTexts();
+ kdDebug(13050)<<"key:"<<sl[1]<<endl<<"value:"<<sl[2]<<endl;
+ kdDebug(13050)<<"key-length:"<<sl[1].length()<<endl<<"value-length:"<<sl[2].length()<<endl;
+ QString key=sl[1];
+ QString value=sl[2];
+ if (key=="NAME") (*niceName)=value.stripWhiteSpace();
+ else if (key=="VERSION") (*version)=value.stripWhiteSpace().toDouble(0);
+ else if (key=="COPYRIGHT")
+ {
+ tmpblockdata="";
+ if (value.stripWhiteSpace().length()>0) tmpblockdata=value;
+ currentState=COPYRIGHT;
+ } else kdDebug(13050)<<"ignoring key"<<endl;
+ }
+ } else {
+ if (blockContent.exactMatch(line))
+ {
+ QString bl=blockContent.capturedTexts()[1];
+ //kdDebug(13050)<<"block content line:"<<bl<<endl<<bl.length()<<" "<<bl.isEmpty()<<endl;
+ if (bl.isEmpty())
+ {
+ (*copyright)=tmpblockdata;
+ kdDebug(13050)<<"Copyright block:"<<endl<<(*copyright)<<endl;
+ currentState=NOTHING;
+ } else tmpblockdata=tmpblockdata+"\n"+bl;
+ }
+ }
+ }
+ f.close();
+}
+//END
+// kate: space-indent on; indent-width 2; replace-tabs on;
diff --git a/kate/part/katejscript.h b/kate/part/katejscript.h
new file mode 100644
index 000000000..ac9e20246
--- /dev/null
+++ b/kate/part/katejscript.h
@@ -0,0 +1,233 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2005 Christoph Cullmann <cullmann@kde.org>
+ Copyright (C) 2005 Joseph Wenninger <jowenn@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef __kate_jscript_h__
+#define __kate_jscript_h__
+
+#include "../interfaces/document.h"
+#include "kateindentscriptabstracts.h"
+#include <qdict.h>
+#include <kdebug.h>
+/**
+ * Some common stuff
+ */
+class KateDocument;
+class KateView;
+class QString;
+class KateJSDocument;
+class KateJSView;
+class KateJSIndenter;
+class KateDocCursor;
+
+/**
+ * Cool, this is all we need here
+ */
+namespace KJS {
+ class Object;
+ class ObjectImp;
+ class Interpreter;
+ class ExecState;
+}
+
+/**
+ * Whole Kate Part scripting in one classs
+ * Allow subclassing to allow specialized scripting engine for indenters
+ */
+class KateJScript
+{
+ public:
+ /**
+ * generate new global interpreter for part scripting
+ */
+ KateJScript ();
+
+ /**
+ * be destructive
+ */
+ virtual ~KateJScript ();
+
+ /**
+ * creates a JS wrapper object for given KateDocument
+ * @param exec execution state, to find out interpreter to use
+ * @param doc document object to wrap
+ * @return new js wrapper object
+ */
+ KJS::ObjectImp *wrapDocument (KJS::ExecState *exec, KateDocument *doc);
+
+ /**
+ * creates a JS wrapper object for given KateView
+ * @param exec execution state, to find out interpreter to use
+ * @param view view object to wrap
+ * @return new js wrapper object
+ */
+ KJS::ObjectImp *wrapView (KJS::ExecState *exec, KateView *view);
+
+ /**
+ * execute given script
+ * the script will get the doc and view exposed via document and view object
+ * in global scope
+ * @param view view to expose
+ * @param script source code of script to execute
+ * @param errorMsg error to return if no success
+ * @return success or not?
+ */
+ bool execute (KateView *view, const QString &script, QString &errorMsg);
+
+ protected:
+ /**
+ * global object of interpreter
+ */
+ KJS::Object *m_global;
+
+ /**
+ * js interpreter
+ */
+ KJS::Interpreter *m_interpreter;
+
+ /**
+ * object for document
+ */
+ KJS::Object *m_document;
+
+ /**
+ * object for view
+ */
+ KJS::Object *m_view;
+};
+
+class KateJScriptManager : public Kate::Command
+{
+ private:
+ /**
+ * Internal used Script Representation
+ */
+ class Script
+ {
+ public:
+ /**
+ * get desktop filename
+ * @return desktop filename
+ */
+ inline QString desktopFilename () { return filename.left(filename.length()-2).append ("desktop"); }
+
+ public:
+ /**
+ * command name, as used for command line and more
+ */
+ QString name;
+
+ /**
+ * filename of the script
+ */
+ QString filename;
+
+ /**
+ * has it a desktop file?
+ */
+ bool desktopFileExists;
+ };
+
+ public:
+ KateJScriptManager ();
+ ~KateJScriptManager ();
+
+ private:
+ /**
+ * go, search our scripts
+ * @param force force cache updating?
+ */
+ void collectScripts (bool force = false);
+
+ //
+ // Here we deal with the Kate::Command stuff
+ //
+ public:
+ /**
+ * execute command
+ * @param view view to use for execution
+ * @param cmd cmd string
+ * @param errorMsg error to return if no success
+ * @return success
+ */
+ bool exec( class Kate::View *view, const QString &cmd, QString &errorMsg );
+
+ /**
+ * get help for a command
+ * @param view view to use
+ * @param cmd cmd name
+ * @param msg help message
+ * @return help available or not
+ */
+ bool help( class Kate::View *view, const QString &cmd, QString &msg );
+
+ /**
+ * supported commands as prefixes
+ * @return prefix list
+ */
+ QStringList cmds();
+
+ private:
+ /**
+ * we need to know somewhere which scripts are around
+ */
+ QDict<KateJScriptManager::Script> m_scripts;
+};
+
+class KateIndentJScriptImpl: public KateIndentScriptImplAbstract {
+ public:
+ KateIndentJScriptImpl(const QString& internalName,
+ const QString &filePath, const QString &niceName,
+ const QString &copyright, double version);
+ ~KateIndentJScriptImpl();
+
+ virtual bool processChar( class Kate::View *view, QChar c, QString &errorMsg );
+ virtual bool processLine( class Kate::View *view, const KateDocCursor &line, QString &errorMsg );
+ virtual bool processNewline( class Kate::View *view, const KateDocCursor &begin, bool needcontinue, QString &errorMsg );
+ protected:
+ virtual void decRef();
+ private:
+ KateJSView *m_viewWrapper;
+ KateJSDocument *m_docWrapper;
+ KJS::Object *m_indenter;
+ KJS::Interpreter *m_interpreter;
+ bool setupInterpreter(QString &errorMsg);
+ void deleteInterpreter();
+};
+
+class KateIndentJScriptManager: public KateIndentScriptManagerAbstract
+{
+
+ public:
+ KateIndentJScriptManager ();
+ virtual ~KateIndentJScriptManager ();
+ virtual KateIndentScript script(const QString &scriptname);
+ private:
+ /**
+ * go, search our scripts
+ * @param force force cache updating?
+ */
+ void collectScripts (bool force = false);
+ void parseScriptHeader(const QString &filePath,
+ QString *niceName,QString *copyright,double *version);
+ QDict<KateIndentJScriptImpl> m_scripts;
+};
+
+#endif
+
+// kate: space-indent on; indent-width 2; replace-tabs on;
diff --git a/kate/part/katekeyinterceptorfunctor.h b/kate/part/katekeyinterceptorfunctor.h
new file mode 100644
index 000000000..0126ff814
--- /dev/null
+++ b/kate/part/katekeyinterceptorfunctor.h
@@ -0,0 +1,25 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2004 Joseph Wenninger <jowenn@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+#ifndef _KATE_KEY_INTERCEPTOR_FUNCTOR_H
+#define _KATE_KEY_INTERCEPTOR_FUNCTOR_H
+#include <kshortcut.h>
+class KateKeyInterceptorFunctor {
+ public:
+ virtual bool operator()(KKey key)=0;
+};
+#endif
diff --git a/kate/part/katelinerange.cpp b/kate/part/katelinerange.cpp
new file mode 100644
index 000000000..7500b4e8a
--- /dev/null
+++ b/kate/part/katelinerange.cpp
@@ -0,0 +1,75 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2002,2003 Hamish Rodda <rodda@kde.org>
+ Copyright (C) 2003 Anakim Border <aborder@sources.sourceforge.net>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "katelinerange.h"
+
+KateLineRange::KateLineRange()
+ : line(-1)
+ , virtualLine(-1)
+ , startCol(-1)
+ , endCol(-1)
+ , startX(-1)
+ , endX(-1)
+ , dirty(false)
+ , viewLine(-1)
+ , wrap(false)
+ , startsInvisibleBlock(false)
+ , shiftX(0)
+{
+}
+
+KateLineRange::~KateLineRange ()
+{
+}
+
+void KateLineRange::clear()
+{
+ line = -1;
+ virtualLine = -1;
+ startCol = -1;
+ endCol = -1;
+ startX = -1;
+ shiftX = 0;
+ endX = -1;
+ viewLine = -1;
+ wrap = false;
+ startsInvisibleBlock = false;
+}
+
+bool operator> (const KateLineRange& r, const KateTextCursor& c)
+{
+ return r.line > c.line() || r.endCol > c.col();
+}
+
+bool operator>= (const KateLineRange& r, const KateTextCursor& c)
+{
+ return r.line > c.line() || r.endCol >= c.col();
+}
+
+bool operator< (const KateLineRange& r, const KateTextCursor& c)
+{
+ return r.line < c.line() || r.startCol < c.col();
+}
+
+bool operator<= (const KateLineRange& r, const KateTextCursor& c)
+{
+ return r.line < c.line() || r.startCol <= c.col();
+}
+
+// kate: space-indent on; indent-width 2; replace-tabs on;
diff --git a/kate/part/katelinerange.h b/kate/part/katelinerange.h
new file mode 100644
index 000000000..0557d565d
--- /dev/null
+++ b/kate/part/katelinerange.h
@@ -0,0 +1,70 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2002,2003 Hamish Rodda <rodda@kde.org>
+ Copyright (C) 2003 Anakim Border <aborder@sources.sourceforge.net>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef _KATE_LINERANGE_H_
+#define _KATE_LINERANGE_H_
+
+#include "katecursor.h"
+
+class KateLineRange
+{
+ public:
+ KateLineRange();
+ virtual ~KateLineRange ();
+
+ void clear();
+
+ inline bool includesCursor (const KateTextCursor& realCursor) const
+ {
+ return realCursor.line() == line && realCursor.col() >= startCol && (!wrap || realCursor.col() < endCol);
+ }
+
+ inline int xOffset () const
+ {
+ return startX ? shiftX : 0;
+ }
+
+ friend bool operator> (const KateLineRange& r, const KateTextCursor& c);
+ friend bool operator>= (const KateLineRange& r, const KateTextCursor& c);
+ friend bool operator< (const KateLineRange& r, const KateTextCursor& c);
+ friend bool operator<= (const KateLineRange& r, const KateTextCursor& c);
+
+ int line;
+ int virtualLine;
+ int startCol;
+ int endCol;
+ int startX;
+ int endX;
+
+ bool dirty;
+ int viewLine;
+ bool wrap;
+ bool startsInvisibleBlock;
+
+ // This variable is used as follows:
+ // non-dynamic-wrapping mode: unused
+ // dynamic wrapping mode:
+ // first viewLine of a line: the X position of the first non-whitespace char
+ // subsequent viewLines: the X offset from the left of the display.
+ //
+ // this is used to provide a dynamic-wrapping-retains-indent feature.
+ int shiftX;
+};
+
+#endif
diff --git a/kate/part/kateluaindentscript.cpp b/kate/part/kateluaindentscript.cpp
new file mode 100644
index 000000000..a8872c0e8
--- /dev/null
+++ b/kate/part/kateluaindentscript.cpp
@@ -0,0 +1,528 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2005 Joseph Wenninger <jowenn@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "config.h"
+#ifdef HAVE_LUA
+
+#include "kateluaindentscript.h"
+#include "katedocument.h"
+#include "kateview.h"
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+
+#include <qfile.h>
+#include <qfileinfo.h>
+#include <kstandarddirs.h>
+
+#include <kconfig.h>
+#include <kglobal.h>
+#include <klocale.h>
+
+extern "C" {
+#include <lua.h>
+#include <lualib.h>
+}
+
+#define ONCHAR 1
+#define ONNEWLINE 2
+#define ONCHARSTR "kateonchar"
+#define ONNEWLINESTR "kateonnewline"
+
+#define katelua_registerFunc(n,f,t) \
+ (lua_pushstring(m_interpreter, n), \
+ lua_pushcfunction(m_interpreter, f), \
+ lua_settable(m_interpreter, t))
+
+#define katelua_registerNumConst(n,v,t) \
+ (lua_pushstring(m_interpreter, n), \
+ lua_pushnumber(m_interpreter, v), \
+ lua_settable(m_interpreter, t))
+
+//BEGIN temporary, try to use registry later
+static KateDocument *katelua_doc;
+static Kate::View *katelua_view;
+//END
+
+
+
+//BEGIN STATIC BINDING FUNCTIONS
+typedef struct KATELUA_FUNCTIONS {
+ char *name;
+ lua_CFunction func;
+} KATELUA_FUNCTIONS;
+
+static int katelua_katedebug(lua_State *L) {
+ int n=lua_gettop(L);
+ for (int i=1;i<=n;i++) {
+ if (lua_isnil(L,i)) kdDebug()<<"NIL VALUE"<<endl;
+ else if (lua_isstring(L,i)) kdDebug()<<lua_tostring(L,i)<<endl;
+ else if (lua_isboolean(L,i)) kdDebug()<<(bool)lua_toboolean(L,i)<<endl;
+ else if (lua_isnumber(L,i)) kdDebug()<<lua_tonumber(L,i)<<endl;
+ else kdDebug()<<"Invalid type for katedebug:"<<lua_type(L,i)<<endl;
+ }
+ return 0;
+}
+
+static int katelua_indenter_register(lua_State *L) {
+ int n=lua_gettop(L);
+ if (n!=2) {
+ lua_pushstring(L,i18n("indenter.register requires 2 parameters (event id, function to call)").utf8().data());
+ lua_error(L);
+ }
+ if ( (!lua_isfunction(L,2)) || (!lua_isnumber(L,1)))
+ {
+ /*if (lua_isnumber(L,1)) kdDebug()<<"A"<<endl;
+ if (lua_isfunction(L,2)) kdDebug()<<"B"<<endl;
+ kdDebug()<<lua_type(L,2)<<endl;*/
+ lua_pushstring(L,i18n("indenter.register requires 2 parameters (event id (number), function to call (function))").utf8().data());
+ lua_error(L);
+ }
+ switch ((int)lua_tonumber(L,1))
+ {
+ case ONCHAR:
+ lua_pushstring(L,ONCHARSTR);
+ lua_pushstring(L,ONCHARSTR);
+ break;
+ case ONNEWLINE:
+ lua_pushstring(L,ONNEWLINESTR);
+ lua_pushstring(L,ONNEWLINESTR);
+ break;
+ default:
+ lua_pushstring(L,i18n("indenter.register:invalid event id").utf8().data());
+ lua_error(L);
+ }
+ lua_gettable(L,LUA_REGISTRYINDEX);
+ if (!lua_isnil(L,lua_gettop(L))) {
+ lua_pushstring(L,i18n("indenter.register:there is already a function set for given").utf8().data());
+ lua_error(L);
+ }
+ lua_pop(L,1);
+ lua_pushvalue(L,2);
+ lua_settable(L,LUA_REGISTRYINDEX);
+ kdDebug()<<"katelua_indenter_register: Success"<<endl;
+ return 0;
+}
+
+
+static int katelua_document_textline(lua_State *L) {
+ if (lua_gettop(L)!=1) {
+ lua_pushstring(L,i18n("document.textLine:One parameter (line number) required").utf8().data());
+ lua_error(L);
+ }
+ if (!lua_isnumber(L,1)) {
+ lua_pushstring(L,i18n("document.textLine:One parameter (line number) required (number)").utf8().data());
+ lua_error(L);
+ }
+ lua_pushstring(L,katelua_doc->textLine((uint)lua_tonumber(L,1)).utf8().data());
+ return 1;
+}
+
+static int katelua_document_removeText(lua_State *L) {
+ if (lua_gettop(L)!=4) {
+ lua_pushstring(L,i18n("document.removeText:Four parameters needed (start line, start col,end line, end col)").utf8().data());
+ lua_error(L);
+ }
+ if ((!lua_isnumber(L,1)) || (!lua_isnumber(L,2)) ||(!lua_isnumber(L,3)) || (!lua_isnumber(L,4))) {
+ lua_pushstring(L,i18n("document.removeText:Four parameters needed (start line, start col,end line, end col) (4x number)").utf8().data());
+ lua_error(L);
+ }
+ lua_pushboolean(L,katelua_doc->removeText((uint)lua_tonumber(L,1),(uint)lua_tonumber(L,2),(uint)lua_tonumber(L,3),(uint)lua_tonumber(L,4)));
+ return 1;
+}
+
+static int katelua_document_insertText(lua_State *L) {
+ if (lua_gettop(L)!=3) {
+ lua_pushstring(L,i18n("document.insertText:Three parameters needed (line,col,text)").utf8().data());
+ lua_error(L);
+ }
+ if ((!lua_isnumber(L,1)) || (!lua_isnumber(L,2)) ||(!lua_isstring(L,3)) ) {
+ lua_pushstring(L,i18n("document.removeText:Three parameters needed (line,col,text) (number,number,string)").utf8().data());
+ lua_error(L);
+ }
+ lua_pushboolean(L,katelua_doc->insertText((uint)lua_tonumber(L,1),(uint)lua_tonumber(L,2),QString::fromUtf8(lua_tostring(L,3))));
+ return 1;
+}
+
+static int katelua_view_cursorline(lua_State *L) {
+ lua_pushnumber(L,katelua_view->cursorLine());
+ return 1;
+}
+static int katelua_view_cursorcolumn(lua_State *L) {
+ lua_pushnumber(L,katelua_view->cursorColumn());
+ return 1;
+}
+static int katelua_view_cursorposition(lua_State *L) {
+ lua_pushnumber(L,katelua_view->cursorLine());
+ lua_pushnumber(L,katelua_view->cursorColumn());
+ return 2;
+
+}
+static int katelua_view_setcursorpositionreal(lua_State *L) {
+ return 0;
+}
+
+static const struct KATELUA_FUNCTIONS katelua_documenttable[4]= {
+{"textLine",katelua_document_textline},
+{"removeText",katelua_document_removeText},
+{"insertText",katelua_document_insertText},
+{0,0}
+};
+
+static const struct KATELUA_FUNCTIONS katelua_viewtable[5]= {
+{"cursorLine",katelua_view_cursorline},
+{"cursorColumn",katelua_view_cursorcolumn},
+{"cursorPosition",katelua_view_cursorposition},
+{"setCursorPositionReal",katelua_view_setcursorpositionreal},
+{0,0}
+};
+
+static void kateregistertable(lua_State* m_interpreter,const KATELUA_FUNCTIONS funcs[],char * tablename) {
+ lua_newtable(m_interpreter);
+ int table=lua_gettop(m_interpreter);
+ for (uint i=0;funcs[i].name!=0;i++)
+ {
+ katelua_registerFunc(funcs[i].name,funcs[i].func,table);
+ }
+
+ lua_pushstring(m_interpreter,tablename);
+ lua_pushvalue(m_interpreter,table);
+ lua_settable(m_interpreter,LUA_GLOBALSINDEX);
+ lua_pop(m_interpreter,1);
+
+}
+
+//END STATIC BINDING FUNCTIONS
+
+
+//BEGIN KateLUAIndentScriptImpl
+KateLUAIndentScriptImpl::KateLUAIndentScriptImpl(const QString& internalName,
+ const QString &filePath, const QString &niceName,
+ const QString &copyright, double version):
+ KateIndentScriptImplAbstract(internalName,filePath,niceName,copyright,version),m_interpreter(0)/*,m_indenter(0)*/
+{
+}
+
+
+KateLUAIndentScriptImpl::~KateLUAIndentScriptImpl()
+{
+ deleteInterpreter();
+}
+
+void KateLUAIndentScriptImpl::decRef()
+{
+ KateIndentScriptImplAbstract::decRef();
+ if (refCount()==0)
+ {
+ deleteInterpreter();
+ }
+}
+
+void KateLUAIndentScriptImpl::deleteInterpreter()
+{
+ if (m_interpreter)
+ {
+ lua_close(m_interpreter);
+ m_interpreter=0;
+ }
+}
+
+bool KateLUAIndentScriptImpl::setupInterpreter(QString &errorMsg)
+{
+ if (m_interpreter) return true;
+ m_interpreter=lua_open();
+
+ if (!m_interpreter)
+ {
+ errorMsg=i18n("LUA interpreter could not be initialized");
+ return false;
+ }
+ luaopen_base(m_interpreter);
+ luaopen_string( m_interpreter );
+ luaopen_table( m_interpreter );
+ luaopen_math( m_interpreter );
+ luaopen_io( m_interpreter );
+ luaopen_debug( m_interpreter );
+
+
+ /*indenter callback setup table*/
+ lua_newtable(m_interpreter);
+ int indentertable=lua_gettop(m_interpreter);
+ katelua_registerFunc("register",katelua_indenter_register,indentertable);
+ katelua_registerNumConst("OnChar",ONCHAR,indentertable);
+ katelua_registerNumConst("OnNewline",ONNEWLINE,indentertable);
+ lua_pushstring(m_interpreter,"indenter");
+ lua_pushvalue(m_interpreter,indentertable);
+ lua_settable(m_interpreter,LUA_GLOBALSINDEX);
+ lua_pop(m_interpreter,1);
+
+ /*debug*/
+ katelua_registerFunc("katedebug",katelua_katedebug,LUA_GLOBALSINDEX);
+
+ /*document interface*/
+ kateregistertable(m_interpreter,katelua_documenttable,"document");
+ /*view interface*/
+ kateregistertable(m_interpreter,katelua_viewtable,"view");
+
+ /*open script*/
+ lua_pushstring(m_interpreter,"dofile");
+ lua_gettable(m_interpreter,LUA_GLOBALSINDEX);
+ QCString fn=QFile::encodeName(filePath());
+ lua_pushstring(m_interpreter,fn.data());
+ int execresult=lua_pcall(m_interpreter,1,1,0);
+ if (execresult==0) {
+ kdDebug()<<"Lua script has been loaded successfully. Lua interpreter version:"<<lua_version()<<endl;
+ return true;
+ } else {
+ errorMsg=i18n("Lua indenting script had errors: %1").arg(lua_tostring(m_interpreter,lua_gettop(m_interpreter)));
+ kdDebug()<<errorMsg<<endl;
+ deleteInterpreter();
+
+ return false;
+ }
+}
+
+
+bool KateLUAIndentScriptImpl::processChar(Kate::View *view, QChar c, QString &errorMsg )
+{
+ if (!setupInterpreter(errorMsg)) return false;
+ katelua_doc=((KateView*)view)->doc();
+ katelua_view=view;
+ int oldtop=lua_gettop(m_interpreter);
+ lua_pushstring(m_interpreter,ONCHARSTR);
+ lua_gettable(m_interpreter,LUA_REGISTRYINDEX);
+ bool result=true;
+ if (!lua_isnil(m_interpreter,lua_gettop(m_interpreter)))
+ {
+ lua_pushstring(m_interpreter,QString(c).utf8().data());
+ if (lua_pcall(m_interpreter,1,0,0)!=0)
+ {
+ errorMsg=i18n("Lua indenting script had errors: %1").arg(lua_tostring(m_interpreter,lua_gettop(m_interpreter)));
+ kdDebug()<<errorMsg<<endl;
+ result=false;
+ }
+ }
+ lua_settop(m_interpreter,oldtop);
+ return result;
+}
+
+bool KateLUAIndentScriptImpl::processLine(Kate::View *view, const KateDocCursor &line, QString &errorMsg )
+{
+ if (!setupInterpreter(errorMsg)) return false;
+ return true;
+}
+
+bool KateLUAIndentScriptImpl::processNewline( class Kate::View *view, const KateDocCursor &begin, bool needcontinue, QString &errorMsg )
+{
+ if (!setupInterpreter(errorMsg)) return false;
+ katelua_doc=((KateView*)view)->doc();
+ katelua_view=view;
+ int oldtop=lua_gettop(m_interpreter);
+ lua_pushstring(m_interpreter,ONNEWLINESTR);
+ lua_gettable(m_interpreter,LUA_REGISTRYINDEX);
+ bool result=true;
+ if (!lua_isnil(m_interpreter,lua_gettop(m_interpreter)))
+ {
+ if (lua_pcall(m_interpreter,0,0,0)!=0)
+ {
+ errorMsg=i18n("Lua indenting script had errors: %1").arg(lua_tostring(m_interpreter,lua_gettop(m_interpreter)));
+ kdDebug()<<errorMsg<<endl;
+ result=false;
+ }
+ }
+ lua_settop(m_interpreter,oldtop);
+ return result;
+}
+//END
+
+//BEGIN KateLUAIndentScriptManager
+KateLUAIndentScriptManager::KateLUAIndentScriptManager():KateIndentScriptManagerAbstract()
+{
+ collectScripts();
+}
+
+KateLUAIndentScriptManager::~KateLUAIndentScriptManager ()
+{
+}
+
+void KateLUAIndentScriptManager::collectScripts (bool force)
+{
+// If there's something in myModeList the Mode List was already built so, don't do it again
+ if (!m_scripts.isEmpty())
+ return;
+
+ kdDebug()<<"================================================="<<endl<<"Trying to find Lua scripts"<<endl
+ <<"================================================="<<endl;
+
+ // We'll store the scripts list in this config
+ KConfig config("katepartluaindentscriptrc", false, false);
+#if 0
+ // figure out if the kate install is too new
+ config.setGroup ("General");
+ if (config.readNumEntry ("Version") > config.readNumEntry ("CachedVersion"))
+ {
+ config.writeEntry ("CachedVersion", config.readNumEntry ("Version"));
+ force = true;
+ }
+#endif
+
+ // Let's get a list of all the .js files
+ QStringList list = KGlobal::dirs()->findAllResources("data","katepart/scripts/indent/*.lua",false,true);
+
+ // Let's iterate through the list and build the Mode List
+ for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it )
+ {
+ // Each file has a group ed:
+ QString Group="Cache "+ *it;
+
+ // Let's go to this group
+ config.setGroup(Group);
+
+ // stat the file
+ struct stat sbuf;
+ memset (&sbuf, 0, sizeof(sbuf));
+ stat(QFile::encodeName(*it), &sbuf);
+ kdDebug()<<"Lua script file:"<<(*it)<<endl;
+ // If the group exist and we're not forced to read the .js file, let's build myModeList for katepartjscriptrc
+ bool readnew=false;
+ if (!force && config.hasGroup(Group) && (sbuf.st_mtime == config.readNumEntry("lastModified")))
+ {
+ config.setGroup(Group);
+ QString filePath=*it;
+ QString internalName=config.readEntry("internlName","KATE-ERROR");
+ if (internalName=="KATE-ERROR") readnew=true;
+ else
+ {
+ QString niceName=config.readEntry("niceName",internalName);
+ QString copyright=config.readEntry("copyright",i18n("(Unknown)"));
+ double version=config.readDoubleNumEntry("version",0.0);
+ KateLUAIndentScriptImpl *s=new KateLUAIndentScriptImpl(
+ internalName,filePath,niceName,copyright,version);
+ m_scripts.insert (internalName, s);
+ }
+ }
+ else readnew=true;
+ if (readnew)
+ {
+ QFileInfo fi (*it);
+
+ if (m_scripts[fi.baseName()])
+ continue;
+
+ QString internalName=fi.baseName();
+ QString filePath=*it;
+ QString niceName=internalName;
+ QString copyright=i18n("(Unknown)");
+ double version=0.0;
+ parseScriptHeader(filePath,&niceName,&copyright,&version);
+ /*save the information for retrieval*/
+ config.setGroup(Group);
+ config.writeEntry("lastModified",sbuf.st_mtime);
+ config.writeEntry("internalName",internalName);
+ config.writeEntry("niceName",niceName);
+ config.writeEntry("copyright",copyright);
+ config.writeEntry("version",version);
+ KateLUAIndentScriptImpl *s=new KateLUAIndentScriptImpl(
+ internalName,filePath,niceName,copyright,version);
+ m_scripts.insert (internalName, s);
+ }
+ }
+
+ // Syncronize with the file katepartjscriptrc
+ config.sync();
+}
+
+KateIndentScript KateLUAIndentScriptManager::script(const QString &scriptname) {
+ KateLUAIndentScriptImpl *s=m_scripts[scriptname];
+ kdDebug(13050)<<scriptname<<"=="<<s<<endl;
+ return KateIndentScript(s);
+}
+
+void KateLUAIndentScriptManager::parseScriptHeader(const QString &filePath,
+ QString *niceName,QString *copyright,double *version)
+{
+#if 0
+ QFile f(QFile::encodeName(filePath));
+ if (!f.open(IO_ReadOnly) ) {
+ kdDebug(13050)<<"Header could not be parsed, because file could not be opened"<<endl;
+ return;
+ }
+ QTextStream st(&f);
+ st.setEncoding (QTextStream::UnicodeUTF8);
+ if (!st.readLine().upper().startsWith("/**KATE")) {
+ kdDebug(13050)<<"No header found"<<endl;
+ f.close();
+ return;
+ }
+ // here the real parsing begins
+ kdDebug(13050)<<"Parsing indent script header"<<endl;
+ enum {NOTHING=0,COPYRIGHT=1} currentState=NOTHING;
+ QString line;
+ QString tmpblockdata="";
+ QRegExp endExpr("[\\s\\t]*\\*\\*\\/[\\s\\t]*$");
+ QRegExp keyValue("[\\s\\t]*\\*\\s*(.+):(.*)$");
+ QRegExp blockContent("[\\s\\t]*\\*(.*)$");
+ while ((line=st.readLine())!=QString::null) {
+ if (endExpr.exactMatch(line)) {
+ kdDebug(13050)<<"end of config block"<<endl;
+ if (currentState==NOTHING) break;
+ if (currentState==COPYRIGHT) {
+ *copyright=tmpblockdata;
+ break;
+ }
+ Q_ASSERT(0);
+ }
+ if (currentState==NOTHING)
+ {
+ if (keyValue.exactMatch(line)) {
+ QStringList sl=keyValue.capturedTexts();
+ kdDebug(13050)<<"key:"<<sl[1]<<endl<<"value:"<<sl[2]<<endl;
+ kdDebug(13050)<<"key-length:"<<sl[1].length()<<endl<<"value-length:"<<sl[2].length()<<endl;
+ QString key=sl[1];
+ QString value=sl[2];
+ if (key=="NAME") (*niceName)=value.stripWhiteSpace();
+ else if (key=="VERSION") (*version)=value.stripWhiteSpace().toDouble(0);
+ else if (key=="COPYRIGHT")
+ {
+ tmpblockdata="";
+ if (value.stripWhiteSpace().length()>0) tmpblockdata=value;
+ currentState=COPYRIGHT;
+ } else kdDebug(13050)<<"ignoring key"<<endl;
+ }
+ } else {
+ if (blockContent.exactMatch(line))
+ {
+ QString bl=blockContent.capturedTexts()[1];
+ //kdDebug(13050)<<"block content line:"<<bl<<endl<<bl.length()<<" "<<bl.isEmpty()<<endl;
+ if (bl.isEmpty())
+ {
+ (*copyright)=tmpblockdata;
+ kdDebug(13050)<<"Copyright block:"<<endl<<(*copyright)<<endl;
+ currentState=NOTHING;
+ } else tmpblockdata=tmpblockdata+"\n"+bl;
+ }
+ }
+ }
+ f.close();
+#endif
+}
+//END
+
+#endif
+// kate: space-indent on; indent-width 2; replace-tabs on;
diff --git a/kate/part/kateluaindentscript.h b/kate/part/kateluaindentscript.h
new file mode 100644
index 000000000..4cccf85ba
--- /dev/null
+++ b/kate/part/kateluaindentscript.h
@@ -0,0 +1,69 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2005 Joseph Wenninger <jowenn@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "config.h"
+#ifdef HAVE_LUA
+
+#ifndef _KATELUAINDENTSCRIPT_H_
+#define _KATELUAINDENTSCRIPT_H_
+
+#include "kateindentscriptabstracts.h"
+#include <qdict.h>
+
+struct lua_State;
+
+class KateLUAIndentScriptImpl: public KateIndentScriptImplAbstract {
+ public:
+ KateLUAIndentScriptImpl(const QString& internalName,
+ const QString &filePath, const QString &niceName,
+ const QString &copyright, double version);
+ ~KateLUAIndentScriptImpl();
+
+ virtual bool processChar( class Kate::View *view, QChar c, QString &errorMsg );
+ virtual bool processLine( class Kate::View *view, const KateDocCursor &line, QString &errorMsg );
+ virtual bool processNewline( class Kate::View *view, const KateDocCursor &begin, bool needcontinue, QString &errorMsg );
+ protected:
+ virtual void decRef();
+ private:
+ bool setupInterpreter(QString &errorMsg);
+ void deleteInterpreter();
+ struct lua_State *m_interpreter;
+};
+
+class KateLUAIndentScriptManager: public KateIndentScriptManagerAbstract
+{
+
+ public:
+ KateLUAIndentScriptManager ();
+ virtual ~KateLUAIndentScriptManager ();
+ virtual KateIndentScript script(const QString &scriptname);
+ private:
+ /**
+ * go, search our scripts
+ * @param force force cache updating?
+ */
+ void collectScripts (bool force = false);
+ void parseScriptHeader(const QString &filePath,
+ QString *niceName,QString *copyright,double *version);
+ QDict<KateLUAIndentScriptImpl> m_scripts;
+};
+
+#endif
+
+#endif
+// kate: space-indent on; indent-width 2; replace-tabs on;
diff --git a/kate/part/kateprinter.cpp b/kate/part/kateprinter.cpp
new file mode 100644
index 000000000..380c50216
--- /dev/null
+++ b/kate/part/kateprinter.cpp
@@ -0,0 +1,1005 @@
+/*
+ * This file is part of the KDE libraries
+ * Copyright (c) 2001-2002 Michael Goffioul <kdeprint@swing.be>
+ * Complete rewrite on Sat Jun 15 2002 (c) Anders Lund <anders@alweb.dk>
+ * Copyright (c) 2002, 2003 Anders Lund <anders@alweb.dk>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License version 2 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ **/
+
+#include "kateprinter.h"
+
+#include <kateconfig.h>
+#include <katedocument.h>
+#include <katefactory.h>
+#include <katehighlight.h>
+#include <katelinerange.h>
+#include <katerenderer.h>
+#include <kateschema.h>
+#include <katetextline.h>
+
+#include <kapplication.h>
+#include <kcolorbutton.h>
+#include <kdebug.h>
+#include <kdialog.h> // for spacingHint()
+#include <kfontdialog.h>
+#include <klocale.h>
+#include <kprinter.h>
+#include <kurl.h>
+#include <kuser.h> // for loginName
+
+#include <qpainter.h>
+#include <qpopupmenu.h>
+#include <qpaintdevicemetrics.h>
+#include <qcheckbox.h>
+#include <qcombobox.h>
+#include <qgroupbox.h>
+#include <qhbox.h>
+#include <qlabel.h>
+#include <qlayout.h>
+#include <qlineedit.h>
+#include <qspinbox.h>
+#include <qstringlist.h>
+#include <qwhatsthis.h>
+
+//BEGIN KatePrinter
+bool KatePrinter::print (KateDocument *doc)
+{
+#ifndef Q_WS_WIN //TODO: reenable
+ KPrinter printer;
+
+ // docname is now always there, including the right Untitled name
+ printer.setDocName(doc->docName());
+
+ KatePrintTextSettings *kpts = new KatePrintTextSettings(&printer, NULL);
+ kpts->enableSelection( doc->hasSelection() );
+ printer.addDialogPage( kpts );
+ printer.addDialogPage( new KatePrintHeaderFooter(&printer, NULL) );
+ printer.addDialogPage( new KatePrintLayout(&printer, NULL) );
+
+ if ( printer.setup( kapp->mainWidget(), i18n("Print %1").arg(printer.docName()) ) )
+ {
+ KateRenderer renderer(doc);
+ //renderer.config()->setSchema (1);
+ renderer.setPrinterFriendly(true);
+
+ QPainter paint( &printer );
+ QPaintDeviceMetrics pdm( &printer );
+ /*
+ We work in tree cycles:
+ 1) initialize variables and retrieve print settings
+ 2) prepare data according to those settings
+ 3) draw to the printer
+ */
+ uint pdmWidth = pdm.width();
+ uint y = 0;
+ uint xstart = 0; // beginning point for painting lines
+ uint lineCount = 0;
+ uint maxWidth = pdmWidth;
+ uint headerWidth = pdmWidth;
+ int startCol = 0;
+ int endCol = 0;
+ bool needWrap = true;
+ bool pageStarted = true;
+
+ // Text Settings Page
+ bool selectionOnly = ( doc->hasSelection() &&
+ ( printer.option("app-kate-printselection") == "true" ) );
+ int selStartCol = 0;
+ int selEndCol = 0;
+
+ bool useGuide = ( printer.option("app-kate-printguide") == "true" );
+ int guideHeight = 0;
+ int guideCols = 0;
+
+ bool printLineNumbers = ( printer.option("app-kate-printlinenumbers") == "true" );
+ uint lineNumberWidth( 0 );
+
+ // Header/Footer Page
+ QFont headerFont; // used for header/footer
+ QString f = printer.option("app-kate-hffont");
+ if (!f.isEmpty())
+ headerFont.fromString( f );
+
+ bool useHeader = (printer.option("app-kate-useheader") == "true");
+ QColor headerBgColor(printer.option("app-kate-headerbg"));
+ QColor headerFgColor(printer.option("app-kate-headerfg"));
+ uint headerHeight( 0 ); // further init only if needed
+ QStringList headerTagList; // do
+ bool headerDrawBg = false; // do
+
+ bool useFooter = (printer.option("app-kate-usefooter") == "true");
+ QColor footerBgColor(printer.option("app-kate-footerbg"));
+ QColor footerFgColor(printer.option("app-kate-footerfg"));
+ uint footerHeight( 0 ); // further init only if needed
+ QStringList footerTagList = 0; // do
+ bool footerDrawBg = 0; // do
+
+ // Layout Page
+ renderer.config()->setSchema( KateFactory::self()->schemaManager()->number(
+ printer.option("app-kate-colorscheme") ) );
+ bool useBackground = ( printer.option("app-kate-usebackground") == "true" );
+ bool useBox = (printer.option("app-kate-usebox") == "true");
+ int boxWidth(printer.option("app-kate-boxwidth").toInt());
+ QColor boxColor(printer.option("app-kate-boxcolor"));
+ int innerMargin = useBox ? printer.option("app-kate-boxmargin").toInt() : 6;
+
+ // Post initialization
+ uint maxHeight = (useBox ? pdm.height()-innerMargin : pdm.height());
+ uint currentPage( 1 );
+ uint lastline = doc->lastLine(); // nessecary to print selection only
+ uint firstline( 0 );
+
+ KateHlItemDataList ilist;
+
+ if (useGuide)
+ doc->highlight()->getKateHlItemDataListCopy (renderer.config()->schema(), ilist);
+
+ /*
+ Now on for preparations...
+ during preparations, variable names starting with a "_" means
+ those variables are local to the enclosing block.
+ */
+ {
+ if ( selectionOnly )
+ {
+ // set a line range from the first selected line to the last
+ firstline = doc->selStartLine();
+ selStartCol = doc->selStartCol();
+ lastline = doc->selEndLine();
+ selEndCol = doc->selEndCol();
+
+ lineCount = firstline;
+ }
+
+ if ( printLineNumbers )
+ {
+ // figure out the horiizontal space required
+ QString s( QString("%1 ").arg( doc->numLines() ) );
+ s.fill('5', -1); // some non-fixed fonts haven't equally wide numbers
+ // FIXME calculate which is actually the widest...
+ lineNumberWidth = renderer.currentFontMetrics()->width( s );
+ // a small space between the line numbers and the text
+ int _adj = renderer.currentFontMetrics()->width( "5" );
+ // adjust available width and set horizontal start point for data
+ maxWidth -= (lineNumberWidth + _adj);
+ xstart += lineNumberWidth + _adj;
+ }
+
+ if ( useHeader || useFooter )
+ {
+ // Set up a tag map
+ // This retrieves all tags, ued or not, but
+ // none of theese operations should be expensive,
+ // and searcing each tag in the format strings is avoided.
+ QDateTime dt = QDateTime::currentDateTime();
+ QMap<QString,QString> tags;
+
+ KUser u (KUser::UseRealUserID);
+ tags["u"] = u.loginName();
+
+ tags["d"] = KGlobal::locale()->formatDateTime(dt, true, false);
+ tags["D"] = KGlobal::locale()->formatDateTime(dt, false, false);
+ tags["h"] = KGlobal::locale()->formatTime(dt.time(), false);
+ tags["y"] = KGlobal::locale()->formatDate(dt.date(), true);
+ tags["Y"] = KGlobal::locale()->formatDate(dt.date(), false);
+ tags["f"] = doc->url().fileName();
+ tags["U"] = doc->url().prettyURL();
+ if ( selectionOnly )
+ {
+ QString s( i18n("(Selection of) ") );
+ tags["f"].prepend( s );
+ tags["U"].prepend( s );
+ }
+
+ QRegExp reTags( "%([dDfUhuyY])" ); // TODO tjeck for "%%<TAG>"
+
+ if (useHeader)
+ {
+ headerDrawBg = ( printer.option("app-kate-headerusebg") == "true" );
+ headerHeight = QFontMetrics( headerFont ).height();
+ if ( useBox || headerDrawBg )
+ headerHeight += innerMargin * 2;
+ else
+ headerHeight += 1 + QFontMetrics( headerFont ).leading();
+
+ QString headerTags = printer.option("app-kate-headerformat");
+ int pos = reTags.search( headerTags );
+ QString rep;
+ while ( pos > -1 )
+ {
+ rep = tags[reTags.cap( 1 )];
+ headerTags.replace( (uint)pos, 2, rep );
+ pos += rep.length();
+ pos = reTags.search( headerTags, pos );
+ }
+ headerTagList = QStringList::split('|', headerTags, true);
+
+ if (!headerBgColor.isValid())
+ headerBgColor = Qt::lightGray;
+ if (!headerFgColor.isValid())
+ headerFgColor = Qt::black;
+ }
+
+ if (useFooter)
+ {
+ footerDrawBg = ( printer.option("app-kate-footerusebg") == "true" );
+ footerHeight = QFontMetrics( headerFont ).height();
+ if ( useBox || footerDrawBg )
+ footerHeight += 2*innerMargin;
+ else
+ footerHeight += 1; // line only
+
+ QString footerTags = printer.option("app-kate-footerformat");
+ int pos = reTags.search( footerTags );
+ QString rep;
+ while ( pos > -1 )
+ {
+ rep = tags[reTags.cap( 1 )];
+ footerTags.replace( (uint)pos, 2, rep );
+ pos += rep.length();
+ pos = reTags.search( footerTags, pos );
+ }
+
+ footerTagList = QStringList::split('|', footerTags, true);
+ if (!footerBgColor.isValid())
+ footerBgColor = Qt::lightGray;
+ if (!footerFgColor.isValid())
+ footerFgColor = Qt::black;
+ // adjust maxheight, so we can know when/where to print footer
+ maxHeight -= footerHeight;
+ }
+ } // if ( useHeader || useFooter )
+
+ if ( useBackground )
+ {
+ if ( ! useBox )
+ {
+ xstart += innerMargin;
+ maxWidth -= innerMargin * 2;
+ }
+ }
+
+ if ( useBox )
+ {
+ if (!boxColor.isValid())
+ boxColor = Qt::black;
+ if (boxWidth < 1) // shouldn't be pssible no more!
+ boxWidth = 1;
+ // set maxwidth to something sensible
+ maxWidth -= ( ( boxWidth + innerMargin ) * 2 );
+ xstart += boxWidth + innerMargin;
+ // maxheight too..
+ maxHeight -= boxWidth;
+ }
+ else
+ boxWidth = 0;
+
+ if ( useGuide )
+ {
+ // calculate the height required
+ // the number of columns is a side effect, saved for drawing time
+ // first width is needed
+ int _w = pdmWidth - innerMargin * 2;
+ if ( useBox )
+ _w -= boxWidth * 2;
+ else
+ {
+ if ( useBackground )
+ _w -= ( innerMargin * 2 );
+ _w -= 2; // 1 px line on each side
+ }
+
+ // base of height: margins top/bottom, above and below tetle sep line
+ guideHeight = ( innerMargin * 4 ) + 1;
+
+ // get a title and add the height required to draw it
+ QString _title = i18n("Typographical Conventions for %1").arg(doc->highlight()->name());
+ guideHeight += paint.boundingRect( 0, 0, _w, 1000, Qt::AlignTop|Qt::AlignHCenter, _title ).height();
+
+ // see how many columns we can fit in
+ int _widest( 0 );
+
+ QPtrListIterator<KateHlItemData> it( ilist );
+ KateHlItemData *_d;
+
+ int _items ( 0 );
+ while ( ( _d = it.current()) != 0 )
+ {
+ _widest = kMax( _widest, ((QFontMetrics)(
+ _d->bold() ?
+ _d->italic() ?
+ renderer.config()->fontStruct()->myFontMetricsBI :
+ renderer.config()->fontStruct()->myFontMetricsBold :
+ _d->italic() ?
+ renderer.config()->fontStruct()->myFontMetricsItalic :
+ renderer.config()->fontStruct()->myFontMetrics
+ ) ).width( _d->name ) );
+ _items++;
+ ++it;
+ }
+ guideCols = _w/( _widest + innerMargin );
+ // add height for required number of lines needed given columns
+ guideHeight += renderer.fontHeight() * ( _items/guideCols );
+ if ( _items%guideCols )
+ guideHeight += renderer.fontHeight();
+ }
+
+ // now that we know the vertical amount of space needed,
+ // it is possible to calculate the total number of pages
+ // if needed, that is if any header/footer tag contains "%P".
+ if ( headerTagList.grep("%P").count() || footerTagList.grep("%P").count() )
+ {
+ kdDebug(13020)<<"'%P' found! calculating number of pages..."<<endl;
+ uint _pages = 0;
+ uint _ph = maxHeight;
+ if ( useHeader )
+ _ph -= ( headerHeight + innerMargin );
+ if ( useFooter )
+ _ph -= innerMargin;
+ int _lpp = _ph / renderer.fontHeight();
+ uint _lt = 0, _c=0;
+
+ // add space for guide if required
+ if ( useGuide )
+ _lt += (guideHeight + (renderer.fontHeight() /2)) / renderer.fontHeight();
+ long _lw;
+ for ( uint i = firstline; i < lastline; i++ )
+ {
+ _lw = renderer.textWidth( doc->kateTextLine( i ), -1 );
+ while ( _lw >= 0 )
+ {
+ _c++;
+ _lt++;
+ if ( (int)_lt == _lpp )
+ {
+ _pages++;
+ _lt = 0;
+ }
+ _lw -= maxWidth;
+ if ( ! _lw ) _lw--; // skip lines matching exactly!
+ }
+ }
+ if ( _lt ) _pages++; // last page
+
+ // substitute both tag lists
+ QString re("%P");
+ QStringList::Iterator it;
+ for ( it=headerTagList.begin(); it!=headerTagList.end(); ++it )
+ (*it).replace( re, QString( "%1" ).arg( _pages ) );
+ for ( it=footerTagList.begin(); it!=footerTagList.end(); ++it )
+ (*it).replace( re, QString( "%1" ).arg( _pages ) );
+ }
+ } // end prepare block
+
+ /*
+ On to draw something :-)
+ */
+ uint _count = 0;
+ while ( lineCount <= lastline )
+ {
+ startCol = 0;
+ endCol = 0;
+ needWrap = true;
+
+ while (needWrap)
+ {
+ if ( y + renderer.fontHeight() >= (uint)(maxHeight) )
+ {
+ kdDebug(13020)<<"Starting new page, "<<_count<<" lines up to now."<<endl;
+ printer.newPage();
+ currentPage++;
+ pageStarted = true;
+ y=0;
+ }
+
+ if ( pageStarted )
+ {
+
+ if ( useHeader )
+ {
+ paint.setPen(headerFgColor);
+ paint.setFont(headerFont);
+ if ( headerDrawBg )
+ paint.fillRect(0, 0, headerWidth, headerHeight, headerBgColor);
+ if (headerTagList.count() == 3)
+ {
+ int valign = ( (useBox||headerDrawBg||useBackground) ?
+ Qt::AlignVCenter : Qt::AlignTop );
+ int align = valign|Qt::AlignLeft;
+ int marg = ( useBox || headerDrawBg ) ? innerMargin : 0;
+ if ( useBox ) marg += boxWidth;
+ QString s;
+ for (int i=0; i<3; i++)
+ {
+ s = headerTagList[i];
+ if (s.find("%p") != -1) s.replace("%p", QString::number(currentPage));
+ paint.drawText(marg, 0, headerWidth-(marg*2), headerHeight, align, s);
+ align = valign|(i == 0 ? Qt::AlignHCenter : Qt::AlignRight);
+ }
+ }
+ if ( ! ( headerDrawBg || useBox || useBackground ) ) // draw a 1 px (!?) line to separate header from contents
+ {
+ paint.drawLine( 0, headerHeight-1, headerWidth, headerHeight-1 );
+ //y += 1; now included in headerHeight
+ }
+ y += headerHeight + innerMargin;
+ }
+
+ if ( useFooter )
+ {
+ if ( ! ( footerDrawBg || useBox || useBackground ) ) // draw a 1 px (!?) line to separate footer from contents
+ paint.drawLine( 0, maxHeight + innerMargin - 1, headerWidth, maxHeight + innerMargin - 1 );
+ if ( footerDrawBg )
+ paint.fillRect(0, maxHeight+innerMargin+boxWidth, headerWidth, footerHeight, footerBgColor);
+ if (footerTagList.count() == 3)
+ {
+ int align = Qt::AlignVCenter|Qt::AlignLeft;
+ int marg = ( useBox || footerDrawBg ) ? innerMargin : 0;
+ if ( useBox ) marg += boxWidth;
+ QString s;
+ for (int i=0; i<3; i++)
+ {
+ s = footerTagList[i];
+ if (s.find("%p") != -1) s.replace("%p", QString::number(currentPage));
+ paint.drawText(marg, maxHeight+innerMargin, headerWidth-(marg*2), footerHeight, align, s);
+ align = Qt::AlignVCenter|(i == 0 ? Qt::AlignHCenter : Qt::AlignRight);
+ }
+ }
+ } // done footer
+
+ if ( useBackground )
+ {
+ // If we have a box, or the header/footer has backgrounds, we want to paint
+ // to the border of those. Otherwise just the contents area.
+ int _y = y, _h = maxHeight - y;
+ if ( useBox )
+ {
+ _y -= innerMargin;
+ _h += 2 * innerMargin;
+ }
+ else
+ {
+ if ( headerDrawBg )
+ {
+ _y -= innerMargin;
+ _h += innerMargin;
+ }
+ if ( footerDrawBg )
+ {
+ _h += innerMargin;
+ }
+ }
+ paint.fillRect( 0, _y, pdmWidth, _h, renderer.config()->backgroundColor());
+ }
+
+ if ( useBox )
+ {
+ paint.setPen(QPen(boxColor, boxWidth));
+ paint.drawRect(0, 0, pdmWidth, pdm.height());
+ if (useHeader)
+ paint.drawLine(0, headerHeight, headerWidth, headerHeight);
+ else
+ y += innerMargin;
+
+ if ( useFooter ) // drawline is not trustable, grr.
+ paint.fillRect( 0, maxHeight+innerMargin, headerWidth, boxWidth, boxColor );
+ }
+
+ if ( useGuide && currentPage == 1 )
+ { // FIXME - this may span more pages...
+ // draw a box unless we have boxes, in which case we end with a box line
+
+ // use color of dsNormal for the title string and the hline
+ KateAttributeList _dsList;
+ KateHlManager::self()->getDefaults ( renderer.config()->schema(), _dsList );
+ paint.setPen( _dsList.at(0)->textColor() );
+ int _marg = 0; // this could be available globally!??
+ if ( useBox )
+ {
+ _marg += (2*boxWidth) + (2*innerMargin);
+ paint.fillRect( 0, y+guideHeight-innerMargin-boxWidth, headerWidth, boxWidth, boxColor );
+ }
+ else
+ {
+ if ( useBackground )
+ _marg += 2*innerMargin;
+ paint.drawRect( _marg, y, pdmWidth-(2*_marg), guideHeight );
+ _marg += 1;
+ y += 1 + innerMargin;
+ }
+ // draw a title string
+ paint.setFont( renderer.config()->fontStruct()->myFontBold );
+ QRect _r;
+ paint.drawText( _marg, y, pdmWidth-(2*_marg), maxHeight - y,
+ Qt::AlignTop|Qt::AlignHCenter,
+ i18n("Typographical Conventions for %1").arg(doc->highlight()->name()), -1, &_r );
+ int _w = pdmWidth - (_marg*2) - (innerMargin*2);
+ int _x = _marg + innerMargin;
+ y += _r.height() + innerMargin;
+ paint.drawLine( _x, y, _x + _w, y );
+ y += 1 + innerMargin;
+ // draw attrib names using their styles
+
+ QPtrListIterator<KateHlItemData> _it( ilist );
+ KateHlItemData *_d;
+ int _cw = _w/guideCols;
+ int _i(0);
+
+ while ( ( _d = _it.current() ) != 0 )
+ {
+ paint.setPen( renderer.attribute(_i)->textColor() );
+ paint.setFont( renderer.attribute(_i)->font( *renderer.currentFont() ) );
+ paint.drawText(( _x + ((_i%guideCols)*_cw)), y, _cw, renderer.fontHeight(),
+ Qt::AlignVCenter|Qt::AlignLeft, _d->name, -1, &_r );
+ _i++;
+ if ( _i && ! ( _i%guideCols ) ) y += renderer.fontHeight();
+ ++_it;
+ }
+ if ( _i%guideCols ) y += renderer.fontHeight();// last row not full
+ y += ( useBox ? boxWidth : 1 ) + (innerMargin*2);
+ }
+
+ pageStarted = false;
+ } // pageStarted; move on to contents:)
+
+ if ( printLineNumbers && ! startCol ) // don't repeat!
+ {
+ paint.setFont( renderer.config()->fontStruct()->font( false, false ) );
+ paint.setPen( renderer.config()->lineNumberColor() );
+ paint.drawText( (( useBox || useBackground ) ? innerMargin : 0), y,
+ lineNumberWidth, renderer.fontHeight(),
+ Qt::AlignRight, QString("%1").arg( lineCount + 1 ) );
+ }
+ endCol = renderer.textWidth(doc->kateTextLine(lineCount), startCol, maxWidth, &needWrap);
+
+ if ( endCol < startCol )
+ {
+ //kdDebug(13020)<<"--- Skipping garbage, line: "<<lineCount<<" start: "<<startCol<<" end: "<<endCol<<" real EndCol; "<< buffer->line(lineCount)->length()<< " !?"<<endl;
+ lineCount++;
+ continue; // strange case...
+ // Happens if the line fits exactly.
+ // When it happens, a line of garbage would be printed.
+ // FIXME Most likely this is an error in textWidth(),
+ // failing to correctly set needWrap to false in this case?
+ }
+
+ // if we print only selection:
+ // print only selected range of chars.
+ bool skip = false;
+ if ( selectionOnly )
+ {
+ bool inBlockSelection = ( doc->blockSelectionMode() && lineCount >= firstline && lineCount <= lastline );
+ if ( lineCount == firstline || inBlockSelection )
+ {
+ if ( startCol < selStartCol )
+ startCol = selStartCol;
+ }
+ if ( lineCount == lastline || inBlockSelection )
+ {
+ if ( endCol > selEndCol )
+ {
+ endCol = selEndCol;
+ skip = true;
+ }
+ }
+ }
+
+ // HA! this is where we print [part of] a line ;]]
+ // FIXME Convert this function + related functionality to a separate KatePrintView
+ KateLineRange range;
+ range.line = lineCount;
+ range.startCol = startCol;
+ range.endCol = endCol;
+ range.wrap = needWrap;
+ paint.translate(xstart, y);
+ renderer.paintTextLine(paint, &range, 0, maxWidth);
+ paint.resetXForm();
+ if ( skip )
+ {
+ needWrap = false;
+ startCol = 0;
+ }
+ else
+ {
+ startCol = endCol;
+ }
+
+ y += renderer.fontHeight();
+ _count++;
+ } // done while ( needWrap )
+
+ lineCount++;
+ } // done lineCount <= lastline
+ return true;
+ }
+
+#endif //!Q_WS_WIN
+ return false;
+}
+//END KatePrinter
+
+#ifndef Q_WS_WIN //TODO: reenable
+//BEGIN KatePrintTextSettings
+KatePrintTextSettings::KatePrintTextSettings( KPrinter * /*printer*/, QWidget *parent, const char *name )
+ : KPrintDialogPage( parent, name )
+{
+ setTitle( i18n("Te&xt Settings") );
+
+ QVBoxLayout *lo = new QVBoxLayout ( this );
+ lo->setSpacing( KDialog::spacingHint() );
+
+ cbSelection = new QCheckBox( i18n("Print &selected text only"), this );
+ lo->addWidget( cbSelection );
+
+ cbLineNumbers = new QCheckBox( i18n("Print &line numbers"), this );
+ lo->addWidget( cbLineNumbers );
+
+ cbGuide = new QCheckBox( i18n("Print syntax &guide"), this );
+ lo->addWidget( cbGuide );
+
+ lo->addStretch( 1 );
+
+ // set defaults - nothing to do :-)
+
+ // whatsthis
+ QWhatsThis::add( cbSelection, i18n(
+ "<p>This option is only available if some text is selected in the document.</p>"
+ "<p>If available and enabled, only the selected text is printed.</p>") );
+ QWhatsThis::add( cbLineNumbers, i18n(
+ "<p>If enabled, line numbers will be printed on the left side of the page(s).</p>") );
+ QWhatsThis::add( cbGuide, i18n(
+ "<p>Print a box displaying typographical conventions for the document type, as "
+ "defined by the syntax highlighting being used.") );
+}
+
+void KatePrintTextSettings::getOptions( QMap<QString,QString>& opts, bool )
+{
+ opts["app-kate-printselection"] = cbSelection->isChecked() ? "true" : "false";
+ opts["app-kate-printlinenumbers"] = cbLineNumbers->isChecked() ? "true" : "false";
+ opts["app-kate-printguide"] = cbGuide->isChecked() ? "true" : "false" ;
+}
+
+void KatePrintTextSettings::setOptions( const QMap<QString,QString>& opts )
+{
+ QString v;
+ v = opts["app-kate-printselection"];
+ if ( ! v.isEmpty() )
+ cbSelection->setChecked( v == "true" );
+ v = opts["app-kate-printlinenumbers"];
+ if ( ! v.isEmpty() )
+ cbLineNumbers->setChecked( v == "true" );
+ v = opts["app-kate-printguide"];
+ if ( ! v.isEmpty() )
+ cbGuide->setChecked( v == "true" );
+}
+
+void KatePrintTextSettings::enableSelection( bool enable )
+{
+ cbSelection->setEnabled( enable );
+}
+
+//END KatePrintTextSettings
+
+//BEGIN KatePrintHeaderFooter
+KatePrintHeaderFooter::KatePrintHeaderFooter( KPrinter * /*printer*/, QWidget *parent, const char *name )
+ : KPrintDialogPage( parent, name )
+{
+ setTitle( i18n("Hea&der && Footer") );
+
+ QVBoxLayout *lo = new QVBoxLayout ( this );
+ uint sp = KDialog::spacingHint();
+ lo->setSpacing( sp );
+
+ // enable
+ QHBoxLayout *lo1 = new QHBoxLayout ( lo );
+ cbEnableHeader = new QCheckBox( i18n("Pr&int header"), this );
+ lo1->addWidget( cbEnableHeader );
+ cbEnableFooter = new QCheckBox( i18n("Pri&nt footer"), this );
+ lo1->addWidget( cbEnableFooter );
+
+ // font
+ QHBoxLayout *lo2 = new QHBoxLayout( lo );
+ lo2->addWidget( new QLabel( i18n("Header/footer font:"), this ) );
+ lFontPreview = new QLabel( this );
+ lFontPreview->setFrameStyle( QFrame::Panel|QFrame::Sunken );
+ lo2->addWidget( lFontPreview );
+ lo2->setStretchFactor( lFontPreview, 1 );
+ QPushButton *btnChooseFont = new QPushButton( i18n("Choo&se Font..."), this );
+ lo2->addWidget( btnChooseFont );
+ connect( btnChooseFont, SIGNAL(clicked()), this, SLOT(setHFFont()) );
+ // header
+ gbHeader = new QGroupBox( 2, Qt::Horizontal, i18n("Header Properties"), this );
+ lo->addWidget( gbHeader );
+
+ QLabel *lHeaderFormat = new QLabel( i18n("&Format:"), gbHeader );
+ QHBox *hbHeaderFormat = new QHBox( gbHeader );
+ hbHeaderFormat->setSpacing( sp );
+ leHeaderLeft = new QLineEdit( hbHeaderFormat );
+ leHeaderCenter = new QLineEdit( hbHeaderFormat );
+ leHeaderRight = new QLineEdit( hbHeaderFormat );
+ lHeaderFormat->setBuddy( leHeaderLeft );
+ new QLabel( i18n("Colors:"), gbHeader );
+ QHBox *hbHeaderColors = new QHBox( gbHeader );
+ hbHeaderColors->setSpacing( sp );
+ QLabel *lHeaderFgCol = new QLabel( i18n("Foreground:"), hbHeaderColors );
+ kcbtnHeaderFg = new KColorButton( hbHeaderColors );
+ lHeaderFgCol->setBuddy( kcbtnHeaderFg );
+ cbHeaderEnableBgColor = new QCheckBox( i18n("Bac&kground"), hbHeaderColors );
+ kcbtnHeaderBg = new KColorButton( hbHeaderColors );
+
+ gbFooter = new QGroupBox( 2, Qt::Horizontal, i18n("Footer Properties"), this );
+ lo->addWidget( gbFooter );
+
+ // footer
+ QLabel *lFooterFormat = new QLabel( i18n("For&mat:"), gbFooter );
+ QHBox *hbFooterFormat = new QHBox( gbFooter );
+ hbFooterFormat->setSpacing( sp );
+ leFooterLeft = new QLineEdit( hbFooterFormat );
+ leFooterCenter = new QLineEdit( hbFooterFormat );
+ leFooterRight = new QLineEdit( hbFooterFormat );
+ lFooterFormat->setBuddy( leFooterLeft );
+
+ new QLabel( i18n("Colors:"), gbFooter );
+ QHBox *hbFooterColors = new QHBox( gbFooter );
+ hbFooterColors->setSpacing( sp );
+ QLabel *lFooterBgCol = new QLabel( i18n("Foreground:"), hbFooterColors );
+ kcbtnFooterFg = new KColorButton( hbFooterColors );
+ lFooterBgCol->setBuddy( kcbtnFooterFg );
+ cbFooterEnableBgColor = new QCheckBox( i18n("&Background"), hbFooterColors );
+ kcbtnFooterBg = new KColorButton( hbFooterColors );
+
+ lo->addStretch( 1 );
+
+ // user friendly
+ connect( cbEnableHeader, SIGNAL(toggled(bool)), gbHeader, SLOT(setEnabled(bool)) );
+ connect( cbEnableFooter, SIGNAL(toggled(bool)), gbFooter, SLOT(setEnabled(bool)) );
+ connect( cbHeaderEnableBgColor, SIGNAL(toggled(bool)), kcbtnHeaderBg, SLOT(setEnabled(bool)) );
+ connect( cbFooterEnableBgColor, SIGNAL(toggled(bool)), kcbtnFooterBg, SLOT(setEnabled(bool)) );
+
+ // set defaults
+ cbEnableHeader->setChecked( true );
+ leHeaderLeft->setText( "%y" );
+ leHeaderCenter->setText( "%f" );
+ leHeaderRight->setText( "%p" );
+ kcbtnHeaderFg->setColor( QColor("black") );
+ cbHeaderEnableBgColor->setChecked( true );
+ kcbtnHeaderBg->setColor( QColor("lightgrey") );
+
+ cbEnableFooter->setChecked( true );
+ leFooterRight->setText( "%U" );
+ kcbtnFooterFg->setColor( QColor("black") );
+ cbFooterEnableBgColor->setChecked( true );
+ kcbtnFooterBg->setColor( QColor("lightgrey") );
+
+ // whatsthis
+ QString s = i18n("<p>Format of the page header. The following tags are supported:</p>");
+ QString s1 = i18n(
+ "<ul><li><tt>%u</tt>: current user name</li>"
+ "<li><tt>%d</tt>: complete date/time in short format</li>"
+ "<li><tt>%D</tt>: complete date/time in long format</li>"
+ "<li><tt>%h</tt>: current time</li>"
+ "<li><tt>%y</tt>: current date in short format</li>"
+ "<li><tt>%Y</tt>: current date in long format</li>"
+ "<li><tt>%f</tt>: file name</li>"
+ "<li><tt>%U</tt>: full URL of the document</li>"
+ "<li><tt>%p</tt>: page number</li>"
+ "</ul><br>"
+ "<u>Note:</u> Do <b>not</b> use the '|' (vertical bar) character.");
+ QWhatsThis::add(leHeaderRight, s + s1 );
+ QWhatsThis::add(leHeaderCenter, s + s1 );
+ QWhatsThis::add(leHeaderLeft, s + s1 );
+ s = i18n("<p>Format of the page footer. The following tags are supported:</p>");
+ QWhatsThis::add(leFooterRight, s + s1 );
+ QWhatsThis::add(leFooterCenter, s + s1 );
+ QWhatsThis::add(leFooterLeft, s + s1 );
+
+
+}
+
+void KatePrintHeaderFooter::getOptions(QMap<QString,QString>& opts, bool )
+{
+ opts["app-kate-hffont"] = strFont;
+
+ opts["app-kate-useheader"] = (cbEnableHeader->isChecked() ? "true" : "false");
+ opts["app-kate-headerfg"] = kcbtnHeaderFg->color().name();
+ opts["app-kate-headerusebg"] = (cbHeaderEnableBgColor->isChecked() ? "true" : "false");
+ opts["app-kate-headerbg"] = kcbtnHeaderBg->color().name();
+ opts["app-kate-headerformat"] = leHeaderLeft->text() + "|" + leHeaderCenter->text() + "|" + leHeaderRight->text();
+
+ opts["app-kate-usefooter"] = (cbEnableFooter->isChecked() ? "true" : "false");
+ opts["app-kate-footerfg"] = kcbtnFooterFg->color().name();
+ opts["app-kate-footerusebg"] = (cbFooterEnableBgColor->isChecked() ? "true" : "false");
+ opts["app-kate-footerbg"] = kcbtnFooterBg->color().name();
+ opts["app-kate-footerformat"] = leFooterLeft->text() + "|" + leFooterCenter->text() + "|" + leFooterRight->text();
+}
+
+void KatePrintHeaderFooter::setOptions( const QMap<QString,QString>& opts )
+{
+ QString v;
+ v = opts["app-kate-hffont"];
+ strFont = v;
+ QFont f = font();
+ if ( ! v.isEmpty() )
+ {
+ if (!strFont.isEmpty())
+ f.fromString( strFont );
+
+ lFontPreview->setFont( f );
+ }
+ lFontPreview->setText( (f.family() + ", %1pt").arg( f.pointSize() ) );
+
+ v = opts["app-kate-useheader"];
+ if ( ! v.isEmpty() )
+ cbEnableHeader->setChecked( v == "true" );
+ v = opts["app-kate-headerfg"];
+ if ( ! v.isEmpty() )
+ kcbtnHeaderFg->setColor( QColor( v ) );
+ v = opts["app-kate-headerusebg"];
+ if ( ! v.isEmpty() )
+ cbHeaderEnableBgColor->setChecked( v == "true" );
+ v = opts["app-kate-headerbg"];
+ if ( ! v.isEmpty() )
+ kcbtnHeaderBg->setColor( QColor( v ) );
+
+ QStringList tags = QStringList::split('|', opts["app-kate-headerformat"], "true");
+ if (tags.count() == 3)
+ {
+ leHeaderLeft->setText(tags[0]);
+ leHeaderCenter->setText(tags[1]);
+ leHeaderRight->setText(tags[2]);
+ }
+
+ v = opts["app-kate-usefooter"];
+ if ( ! v.isEmpty() )
+ cbEnableFooter->setChecked( v == "true" );
+ v = opts["app-kate-footerfg"];
+ if ( ! v.isEmpty() )
+ kcbtnFooterFg->setColor( QColor( v ) );
+ v = opts["app-kate-footerusebg"];
+ if ( ! v.isEmpty() )
+ cbFooterEnableBgColor->setChecked( v == "true" );
+ v = opts["app-kate-footerbg"];
+ if ( ! v.isEmpty() )
+ kcbtnFooterBg->setColor( QColor( v ) );
+
+ tags = QStringList::split('|', opts["app-kate-footerformat"], "true");
+ if (tags.count() == 3)
+ {
+ leFooterLeft->setText(tags[0]);
+ leFooterCenter->setText(tags[1]);
+ leFooterRight->setText(tags[2]);
+ }
+}
+
+void KatePrintHeaderFooter::setHFFont()
+{
+ QFont fnt( lFontPreview->font() );
+ // display a font dialog
+ if ( KFontDialog::getFont( fnt, false, this ) == KFontDialog::Accepted )
+ {
+ // change strFont
+ strFont = fnt.toString();
+ // set preview
+ lFontPreview->setFont( fnt );
+ lFontPreview->setText( (fnt.family() + ", %1pt").arg( fnt.pointSize() ) );
+ }
+}
+
+//END KatePrintHeaderFooter
+
+//BEGIN KatePrintLayout
+
+KatePrintLayout::KatePrintLayout( KPrinter * /*printer*/, QWidget *parent, const char *name )
+ : KPrintDialogPage( parent, name )
+{
+ setTitle( i18n("L&ayout") );
+
+ QVBoxLayout *lo = new QVBoxLayout ( this );
+ lo->setSpacing( KDialog::spacingHint() );
+
+ QHBox *hb = new QHBox( this );
+ lo->addWidget( hb );
+ QLabel *lSchema = new QLabel( i18n("&Schema:"), hb );
+ cmbSchema = new QComboBox( false, hb );
+ lSchema->setBuddy( cmbSchema );
+
+ cbDrawBackground = new QCheckBox( i18n("Draw bac&kground color"), this );
+ lo->addWidget( cbDrawBackground );
+
+ cbEnableBox = new QCheckBox( i18n("Draw &boxes"), this );
+ lo->addWidget( cbEnableBox );
+
+ gbBoxProps = new QGroupBox( 2, Qt::Horizontal, i18n("Box Properties"), this );
+ lo->addWidget( gbBoxProps );
+
+ QLabel *lBoxWidth = new QLabel( i18n("W&idth:"), gbBoxProps );
+ sbBoxWidth = new QSpinBox( 1, 100, 1, gbBoxProps );
+ lBoxWidth->setBuddy( sbBoxWidth );
+
+ QLabel *lBoxMargin = new QLabel( i18n("&Margin:"), gbBoxProps );
+ sbBoxMargin = new QSpinBox( 0, 100, 1, gbBoxProps );
+ lBoxMargin->setBuddy( sbBoxMargin );
+
+ QLabel *lBoxColor = new QLabel( i18n("Co&lor:"), gbBoxProps );
+ kcbtnBoxColor = new KColorButton( gbBoxProps );
+ lBoxColor->setBuddy( kcbtnBoxColor );
+
+ connect( cbEnableBox, SIGNAL(toggled(bool)), gbBoxProps, SLOT(setEnabled(bool)) );
+
+ lo->addStretch( 1 );
+ // set defaults:
+ sbBoxMargin->setValue( 6 );
+ gbBoxProps->setEnabled( false );
+ cmbSchema->insertStringList (KateFactory::self()->schemaManager()->list ());
+ cmbSchema->setCurrentItem( 1 );
+
+ // whatsthis
+ // FIXME uncomment when string freeze is over
+// QWhatsThis::add ( cmbSchema, i18n(
+// "Select the color scheme to use for the print." ) );
+ QWhatsThis::add( cbDrawBackground, i18n(
+ "<p>If enabled, the background color of the editor will be used.</p>"
+ "<p>This may be useful if your color scheme is designed for a dark background.</p>") );
+ QWhatsThis::add( cbEnableBox, i18n(
+ "<p>If enabled, a box as defined in the properties below will be drawn "
+ "around the contents of each page. The Header and Footer will be separated "
+ "from the contents with a line as well.</p>") );
+ QWhatsThis::add( sbBoxWidth, i18n(
+ "The width of the box outline" ) );
+ QWhatsThis::add( sbBoxMargin, i18n(
+ "The margin inside boxes, in pixels") );
+ QWhatsThis::add( kcbtnBoxColor, i18n(
+ "The line color to use for boxes") );
+}
+
+void KatePrintLayout::getOptions(QMap<QString,QString>& opts, bool )
+{
+ opts["app-kate-colorscheme"] = cmbSchema->currentText();
+ opts["app-kate-usebackground"] = cbDrawBackground->isChecked() ? "true" : "false";
+ opts["app-kate-usebox"] = cbEnableBox->isChecked() ? "true" : "false";
+ opts["app-kate-boxwidth"] = sbBoxWidth->cleanText();
+ opts["app-kate-boxmargin"] = sbBoxMargin->cleanText();
+ opts["app-kate-boxcolor"] = kcbtnBoxColor->color().name();
+}
+
+void KatePrintLayout::setOptions( const QMap<QString,QString>& opts )
+{
+ QString v;
+ v = opts["app-kate-colorscheme"];
+ if ( ! v.isEmpty() )
+ cmbSchema->setCurrentItem( KateFactory::self()->schemaManager()->number( v ) );
+ v = opts["app-kate-usebackground"];
+ if ( ! v.isEmpty() )
+ cbDrawBackground->setChecked( v == "true" );
+ v = opts["app-kate-usebox"];
+ if ( ! v.isEmpty() )
+ cbEnableBox->setChecked( v == "true" );
+ v = opts["app-kate-boxwidth"];
+ if ( ! v.isEmpty() )
+ sbBoxWidth->setValue( v.toInt() );
+ v = opts["app-kate-boxmargin"];
+ if ( ! v.isEmpty() )
+ sbBoxMargin->setValue( v.toInt() );
+ v = opts["app-kate-boxcolor"];
+ if ( ! v.isEmpty() )
+ kcbtnBoxColor->setColor( QColor( v ) );
+}
+//END KatePrintLayout
+
+#include "kateprinter.moc"
+#endif //!Q_WS_WIN
+
+// kate: space-indent on; indent-width 2; replace-tabs on;
diff --git a/kate/part/kateprinter.h b/kate/part/kateprinter.h
new file mode 100644
index 000000000..f2fb0bc87
--- /dev/null
+++ b/kate/part/kateprinter.h
@@ -0,0 +1,136 @@
+/*
+ * This file is part of the KDE libraries
+ * Copyright (c) 2002 Michael Goffioul <kdeprint@swing.be>
+ * Complete rewrite on Sat Jun 15 2002 (c) Anders Lund <anders@alweb.dk>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License version 2 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ **/
+
+#ifndef __KATE_PRINTER_H__
+#define __KATE_PRINTER_H__
+
+#include <kprintdialogpage.h>
+
+class KateDocument;
+
+class KColorButton;
+class KPrinter;
+class QCheckBox;
+class QComboBox;
+class QGroupBox;
+class QLabel;
+class QLineEdit;
+class QSpinBox;
+
+class KatePrinter
+{
+ public:
+ static bool print (KateDocument *doc);
+};
+
+#ifndef Q_WS_WIN //TODO: reenable
+//BEGIN Text settings
+/*
+ Text settings page:
+ - [ ] Print Selection (enabled if there is a selection in the view)
+ - Print Line Numbers
+ () Smart () Yes () No
+*/
+class KatePrintTextSettings : public KPrintDialogPage
+{
+ Q_OBJECT
+ public:
+ KatePrintTextSettings( KPrinter *printer, QWidget *parent=0, const char *name=0 );
+ ~KatePrintTextSettings(){};
+
+ void getOptions(QMap<QString,QString>& opts, bool incldef = false);
+ void setOptions(const QMap<QString,QString>& opts);
+
+ /* call if view has a selection, enables the seelction checkbox according to the arg */
+ void enableSelection( bool );
+
+ private:
+ QCheckBox *cbSelection, *cbLineNumbers, *cbGuide;
+};
+//END Text Settings
+
+//BEGIN Header/Footer
+/*
+ Header & Footer page:
+ - enable header/footer
+ - header/footer props
+ o formats
+ o colors
+*/
+
+class KatePrintHeaderFooter : public KPrintDialogPage
+{
+ Q_OBJECT
+ public:
+ KatePrintHeaderFooter( KPrinter *printer, QWidget *parent=0, const char *name=0 );
+ ~KatePrintHeaderFooter(){};
+
+ void getOptions(QMap<QString,QString>& opts, bool incldef = false);
+ void setOptions(const QMap<QString,QString>& opts);
+
+ public slots:
+ void setHFFont();
+
+ private:
+ QCheckBox *cbEnableHeader, *cbEnableFooter;
+ QLabel *lFontPreview;
+ QString strFont;
+ QGroupBox *gbHeader, *gbFooter;
+ QLineEdit *leHeaderLeft, *leHeaderCenter, *leHeaderRight;
+ KColorButton *kcbtnHeaderFg, *kcbtnHeaderBg;
+ QCheckBox *cbHeaderEnableBgColor;
+ QLineEdit *leFooterLeft, *leFooterCenter, *leFooterRight;
+ KColorButton *kcbtnFooterFg, *kcbtnFooterBg;
+ QCheckBox *cbFooterEnableBgColor;
+};
+
+//END Header/Footer
+
+//BEGIN Layout
+/*
+ Layout page:
+ - Color scheme
+ - Use Box
+ - Box properties
+ o Width
+ o Margin
+ o Color
+*/
+class KatePrintLayout : public KPrintDialogPage
+{
+ Q_OBJECT
+ public:
+ KatePrintLayout( KPrinter *printer, QWidget *parent=0, const char *name=0 );
+ ~KatePrintLayout(){};
+
+ void getOptions(QMap<QString,QString>& opts, bool incldef = false);
+ void setOptions(const QMap<QString,QString>& opts);
+
+ private:
+ QComboBox *cmbSchema;
+ QCheckBox *cbEnableBox, *cbDrawBackground;
+ QGroupBox *gbBoxProps;
+ QSpinBox *sbBoxWidth, *sbBoxMargin;
+ KColorButton* kcbtnBoxColor;
+};
+//END Layout
+#endif //!Q_WS_WIN
+
+#endif
diff --git a/kate/part/katerenderer.cpp b/kate/part/katerenderer.cpp
new file mode 100644
index 000000000..60851481d
--- /dev/null
+++ b/kate/part/katerenderer.cpp
@@ -0,0 +1,1032 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2003 Hamish Rodda <rodda@kde.org>
+ Copyright (C) 2001 Christoph Cullmann <cullmann@kde.org>
+ Copyright (C) 2001 Joseph Wenninger <jowenn@kde.org>
+ Copyright (C) 1999 Jochen Wilhelmy <digisnap@cs.tu-berlin.de>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "katerenderer.h"
+
+#include "katelinerange.h"
+#include "katedocument.h"
+#include "katearbitraryhighlight.h"
+#include "kateconfig.h"
+#include "katehighlight.h"
+#include "katefactory.h"
+#include "kateview.h"
+
+#include <kdebug.h>
+
+#include <qpainter.h>
+#include <qpopupmenu.h>
+
+KateRenderer::KateRenderer(KateDocument* doc, KateView *view)
+ : m_doc(doc), m_view (view), m_caretStyle(KateRenderer::Insert)
+ , m_drawCaret(true)
+ , m_showSelections(true)
+ , m_showTabs(true)
+ , m_printerFriendly(false)
+{
+ KateFactory::self()->registerRenderer ( this );
+ m_config = new KateRendererConfig (this);
+
+ m_tabWidth = m_doc->config()->tabWidth();
+ m_indentWidth = m_tabWidth;
+ if (m_doc->config()->configFlags() & KateDocumentConfig::cfSpaceIndent)
+ {
+ m_indentWidth = m_doc->config()->indentationWidth();
+ }
+
+ updateAttributes ();
+}
+
+KateRenderer::~KateRenderer()
+{
+ delete m_config;
+ KateFactory::self()->deregisterRenderer ( this );
+}
+
+void KateRenderer::updateAttributes ()
+{
+ m_schema = config()->schema ();
+ m_attributes = m_doc->highlight()->attributes (m_schema);
+}
+
+KateAttribute* KateRenderer::attribute(uint pos)
+{
+ if (pos < m_attributes->size())
+ return &m_attributes->at(pos);
+
+ return &m_attributes->at(0);
+}
+
+void KateRenderer::setDrawCaret(bool drawCaret)
+{
+ m_drawCaret = drawCaret;
+}
+
+void KateRenderer::setCaretStyle(KateRenderer::caretStyles style)
+{
+ m_caretStyle = style;
+}
+
+void KateRenderer::setShowTabs(bool showTabs)
+{
+ m_showTabs = showTabs;
+}
+
+void KateRenderer::setTabWidth(int tabWidth)
+{
+ m_tabWidth = tabWidth;
+}
+
+bool KateRenderer::showIndentLines() const
+{
+ return m_config->showIndentationLines();
+}
+
+void KateRenderer::setShowIndentLines(bool showIndentLines)
+{
+ m_config->setShowIndentationLines(showIndentLines);
+}
+
+void KateRenderer::setIndentWidth(int indentWidth)
+{
+ m_indentWidth = m_tabWidth;
+ if (m_doc->config()->configFlags() & KateDocumentConfig::cfSpaceIndent)
+ {
+ m_indentWidth = indentWidth;
+ }
+}
+
+void KateRenderer::setShowSelections(bool showSelections)
+{
+ m_showSelections = showSelections;
+}
+
+void KateRenderer::increaseFontSizes()
+{
+ QFont f ( *config()->font () );
+ f.setPointSize (f.pointSize ()+1);
+
+ config()->setFont (f);
+}
+
+void KateRenderer::decreaseFontSizes()
+{
+ QFont f ( *config()->font () );
+
+ if ((f.pointSize ()-1) > 0)
+ f.setPointSize (f.pointSize ()-1);
+
+ config()->setFont (f);
+}
+
+bool KateRenderer::isPrinterFriendly() const
+{
+ return m_printerFriendly;
+}
+
+void KateRenderer::setPrinterFriendly(bool printerFriendly)
+{
+ m_printerFriendly = printerFriendly;
+ setShowTabs(false);
+ setShowSelections(false);
+ setDrawCaret(false);
+}
+
+bool KateRenderer::paintTextLineBackground(QPainter& paint, int line, bool isCurrentLine, int xStart, int xEnd)
+{
+ if (isPrinterFriendly())
+ return false;
+
+ // font data
+ KateFontStruct *fs = config()->fontStruct();
+
+ // Normal background color
+ QColor backgroundColor( config()->backgroundColor() );
+
+ bool selectionPainted = false;
+ if (showSelections() && m_view->lineSelected(line))
+ {
+ backgroundColor = config()->selectionColor();
+ selectionPainted = true;
+ }
+ else
+ {
+ // paint the current line background if we're on the current line
+ if (isCurrentLine)
+ backgroundColor = config()->highlightedLineColor();
+
+ // Check for mark background
+ int markRed = 0, markGreen = 0, markBlue = 0, markCount = 0;
+
+ // Retrieve marks for this line
+ uint mrk = m_doc->mark( line );
+ if (mrk)
+ {
+ for (uint bit = 0; bit < 32; bit++)
+ {
+ KTextEditor::MarkInterface::MarkTypes markType = (KTextEditor::MarkInterface::MarkTypes)(1<<bit);
+ if (mrk & markType)
+ {
+ QColor markColor = config()->lineMarkerColor(markType);
+
+ if (markColor.isValid()) {
+ markCount++;
+ markRed += markColor.red();
+ markGreen += markColor.green();
+ markBlue += markColor.blue();
+ }
+ }
+ } // for
+ } // Marks
+
+ if (markCount) {
+ markRed /= markCount;
+ markGreen /= markCount;
+ markBlue /= markCount;
+ backgroundColor.setRgb(
+ int((backgroundColor.red() * 0.9) + (markRed * 0.1)),
+ int((backgroundColor.green() * 0.9) + (markGreen * 0.1)),
+ int((backgroundColor.blue() * 0.9) + (markBlue * 0.1))
+ );
+ }
+ } // background preprocessing
+
+ // Draw line background
+ paint.fillRect(0, 0, xEnd - xStart, fs->fontHeight, backgroundColor);
+
+ return selectionPainted;
+}
+
+void KateRenderer::paintWhitespaceMarker(QPainter &paint, uint x, uint y)
+{
+ QPen penBackup( paint.pen() );
+ paint.setPen( config()->tabMarkerColor() );
+ paint.drawPoint(x, y);
+ paint.drawPoint(x + 1, y);
+ paint.drawPoint(x, y - 1);
+ paint.setPen( penBackup );
+}
+
+
+void KateRenderer::paintIndentMarker(QPainter &paint, uint x, uint row)
+{
+ QPen penBackup( paint.pen() );
+ paint.setPen( config()->tabMarkerColor() );
+
+ const int top = paint.window().top();
+ const int bottom = paint.window().bottom();
+ const int h = bottom - top + 1;
+
+ // Dot padding.
+ int pad = 0;
+ if(row & 1 && h & 1) pad = 1;
+
+ for(int i = top; i <= bottom; i++)
+ {
+ if((i + pad) & 1)
+ {
+ paint.drawPoint(x + 2, i);
+ }
+ }
+
+ paint.setPen( penBackup );
+}
+
+
+void KateRenderer::paintTextLine(QPainter& paint, const KateLineRange* range, int xStart, int xEnd, const KateTextCursor* cursor, const KateBracketRange* bracketmark)
+{
+ int line = range->line;
+
+ // textline
+ KateTextLine::Ptr textLine = m_doc->kateTextLine(line);
+ if (!textLine)
+ return;
+
+ bool showCursor = drawCaret() && cursor && range->includesCursor(*cursor);
+
+ KateSuperRangeList& superRanges = m_doc->arbitraryHL()->rangesIncluding(range->line, 0);
+
+ int minIndent = 0;
+
+ // A bit too verbose for my tastes
+ // Re-write a bracketmark class? put into its own function? add more helper constructors to the range stuff?
+ // Also, need a light-weight arbitraryhighlightrange class for static stuff
+ KateArbitraryHighlightRange* bracketStartRange (0L);
+ KateArbitraryHighlightRange* bracketEndRange (0L);
+ if (bracketmark && bracketmark->isValid()) {
+ if (range->includesCursor(bracketmark->start())) {
+ KateTextCursor startend = bracketmark->start();
+ startend.setCol(startend.col()+1);
+ bracketStartRange = new KateArbitraryHighlightRange(m_doc, bracketmark->start(), startend);
+ bracketStartRange->setBGColor(config()->highlightedBracketColor());
+ bracketStartRange->setBold(true);
+ superRanges.append(bracketStartRange);
+ }
+
+ if (range->includesCursor(bracketmark->end())) {
+ KateTextCursor endend = bracketmark->end();
+ endend.setCol(endend.col()+1);
+ bracketEndRange = new KateArbitraryHighlightRange(m_doc, bracketmark->end(), endend);
+ bracketEndRange->setBGColor(config()->highlightedBracketColor());
+ bracketEndRange->setBold(true);
+ superRanges.append(bracketEndRange);
+ }
+
+ Q_ASSERT(bracketmark->start().line() <= bracketmark->end().line());
+ if (bracketmark->start().line() < line && bracketmark->end().line() >= line)
+ {
+ minIndent = bracketmark->getMinIndent();
+ }
+ }
+
+
+ // length, chars + raw attribs
+ uint len = textLine->length();
+ uint oldLen = len;
+
+ // should the cursor be painted (if it is in the current xstart - xend range)
+ bool cursorVisible = false;
+ int cursorMaxWidth = 0;
+
+ // font data
+ KateFontStruct * fs = config()->fontStruct();
+
+ // Paint selection background as the whole line is selected
+ // selection startcol/endcol calc
+ bool hasSel = false;
+ uint startSel = 0;
+ uint endSel = 0;
+
+ // was the selection background already completely painted ?
+ bool selectionPainted = false;
+ bool isCurrentLine = (cursor && range->includesCursor(*cursor));
+ selectionPainted = paintTextLineBackground(paint, line, isCurrentLine, xStart, xEnd);
+ if (selectionPainted)
+ {
+ hasSel = true;
+ startSel = 0;
+ endSel = len + 1;
+ }
+
+ int startcol = range->startCol;
+ if (startcol > (int)len)
+ startcol = len;
+
+ if (startcol < 0)
+ startcol = 0;
+
+ int endcol = range->wrap ? range->endCol : -1;
+ if (endcol < 0)
+ len = len - startcol;
+ else
+ len = endcol - startcol;
+
+ // text attribs font/style data
+ KateAttribute* attr = m_doc->highlight()->attributes(m_schema)->data();
+
+ const QColor *cursorColor = &attr[0].textColor();
+
+ // Start arbitrary highlighting
+ KateTextCursor currentPos(line, startcol);
+ superRanges.firstBoundary(&currentPos);
+
+ if (showSelections() && !selectionPainted)
+ hasSel = getSelectionBounds(line, oldLen, startSel, endSel);
+
+ // Draws the dashed underline at the start of a folded block of text.
+ if (range->startsInvisibleBlock) {
+ paint.setPen(QPen(config()->wordWrapMarkerColor(), 1, Qt::DashLine));
+ paint.drawLine(0, fs->fontHeight - 1, xEnd - xStart, fs->fontHeight - 1);
+ }
+
+ // draw word-wrap-honor-indent filling
+ if (range->xOffset() && range->xOffset() > xStart)
+ {
+ paint.fillRect(0, 0, range->xOffset() - xStart, fs->fontHeight,
+ QBrush(config()->wordWrapMarkerColor(), QBrush::DiagCrossPattern));
+ }
+
+ // painting loop
+ uint xPos = range->xOffset();
+ int cursorXPos = 0;
+
+ // Optimisation to quickly draw an empty line of text
+ if (len < 1)
+ {
+ if (showCursor && (cursor->col() >= int(startcol)))
+ {
+ cursorVisible = true;
+ cursorXPos = xPos + cursor->col() * fs->myFontMetrics.width(QChar(' '));
+ }
+ }
+ else
+ {
+ bool isIMSel = false;
+ bool isIMEdit = false;
+
+ bool isSel = false;
+
+ KateAttribute customHL;
+
+ const QColor *curColor = 0;
+ const QColor *oldColor = 0;
+
+ KateAttribute* oldAt = &attr[0];
+
+ uint oldXPos = xPos;
+ uint xPosAfter = xPos;
+
+ KateAttribute currentHL;
+
+ uint blockStartCol = startcol;
+ uint curCol = startcol;
+ uint nextCol = curCol + 1;
+
+ // text + attrib data from line
+ const uchar *textAttributes = textLine->attributes ();
+ bool noAttribs = !textAttributes;
+
+ // adjust to startcol ;)
+ textAttributes = textAttributes + startcol;
+
+ uint atLen = m_doc->highlight()->attributes(m_schema)->size();
+
+ // Determine if we have trailing whitespace and store the column
+ // if lastChar == -1, set to 0, if lastChar exists, increase by one
+ uint trailingWhitespaceColumn = textLine->lastChar() + 1;
+ const uint lastIndentColumn = textLine->firstChar();
+
+ // Could be precomputed.
+ const uint spaceWidth = fs->width (QChar(' '), false, false, m_tabWidth);
+
+ // Get current x position.
+ int curPos = textLine->cursorX(curCol, m_tabWidth);
+
+ while (curCol - startcol < len)
+ {
+ // make sure curPos is updated correctly.
+ // ### if uncommented, causes an O(n^2) behaviour
+ //Q_ASSERT(curPos == textLine->cursorX(curCol, m_tabWidth));
+
+ QChar curChar = textLine->string()[curCol];
+ // Decide if this character is a tab - we treat the spacing differently
+ // TODO: move tab width calculation elsewhere?
+ bool isTab = curChar == QChar('\t');
+
+ // Determine current syntax highlighting attribute
+ // A bit legacy but doesn't need to change
+ KateAttribute* curAt = (noAttribs || ((*textAttributes) >= atLen)) ? &attr[0] : &attr[*textAttributes];
+
+ // X position calculation. Incorrect for fonts with non-zero leftBearing() and rightBearing() results.
+ // TODO: make internal charWidth() function, use QFontMetrics::charWidth().
+ xPosAfter += curAt->width(*fs, curChar, m_tabWidth);
+
+ // Tab special treatment, move to charWidth().
+ if (isTab)
+ xPosAfter -= (xPosAfter % curAt->width(*fs, curChar, m_tabWidth));
+
+ // Only draw after the starting X value
+ // Haha, this was always wrong, due to the use of individual char width calculations...?? :(
+ if ((int)xPosAfter >= xStart)
+ {
+ // Determine if we're in a selection and should be drawing it
+ isSel = (showSelections() && hasSel && (curCol >= startSel) && (curCol < endSel));
+
+ // input method edit area
+ isIMEdit = m_view && m_view->isIMEdit( line, curCol );
+
+ // input method selection
+ isIMSel = m_view && m_view->isIMSelection( line, curCol );
+
+ // Determine current color, taking into account selection
+ curColor = isSel ? &(curAt->selectedTextColor()) : &(curAt->textColor());
+
+ // Incorporate in arbitrary highlighting
+ if (curAt != oldAt || curColor != oldColor || (superRanges.count() && superRanges.currentBoundary() && *(superRanges.currentBoundary()) == currentPos)) {
+ if (superRanges.count() && superRanges.currentBoundary() && *(superRanges.currentBoundary()) == currentPos)
+ customHL = KateArbitraryHighlightRange::merge(superRanges.rangesIncluding(currentPos));
+
+ KateAttribute hl = customHL;
+
+ hl += *curAt;
+
+ // use default highlighting color if we haven't defined one above.
+ if (!hl.itemSet(KateAttribute::TextColor))
+ hl.setTextColor(*curColor);
+
+ if (!isSel)
+ paint.setPen(hl.textColor());
+ else
+ paint.setPen(hl.selectedTextColor());
+
+ paint.setFont(hl.font(*currentFont()));
+
+ if (superRanges.currentBoundary() && *(superRanges.currentBoundary()) == currentPos)
+ superRanges.nextBoundary();
+
+ currentHL = hl;
+ }
+
+ // Determine whether we can delay painting to draw a block of similarly formatted
+ // characters or not
+ // Reasons for NOT delaying the drawing until the next character
+ // You have to detect the change one character in advance.
+ // TODO: KateAttribute::canBatchRender()
+ bool renderNow = false;
+ if ((isTab)
+ // formatting has changed OR
+ || (superRanges.count() && superRanges.currentBoundary() && *(superRanges.currentBoundary()) == KateTextCursor(line, nextCol))
+
+ // it is the end of the line OR
+ || (curCol - startcol >= len - 1)
+
+ // the rest of the line is trailing whitespace OR
+ || (curCol + 1 >= trailingWhitespaceColumn)
+
+ // indentation lines OR
+ || (showIndentLines() && curCol < lastIndentColumn)
+
+ // the x position is past the end OR
+ || ((int)xPos > xEnd)
+
+ // it is a different attribute OR
+ || (!noAttribs && curAt != &attr[*(textAttributes+1)])
+
+ // the selection boundary was crossed OR
+ || (isSel != (hasSel && (nextCol >= startSel) && (nextCol < endSel)))
+
+ // the next char is a tab (removed the "and this isn't" because that's dealt with above)
+ // i.e. we have to draw the current text so the tab can be rendered as above.
+ || (textLine->string()[nextCol] == QChar('\t'))
+
+ // input method edit area
+ || ( m_view && (isIMEdit != m_view->isIMEdit( line, nextCol )) )
+
+ // input method selection
+ || ( m_view && (isIMSel != m_view->isIMSelection( line, nextCol )) )
+ )
+ {
+ renderNow = true;
+ }
+
+ if (renderNow)
+ {
+ if (!isPrinterFriendly())
+ {
+ bool paintBackground = true;
+ uint width = xPosAfter - oldXPos;
+ QColor fillColor;
+
+ if (isIMSel && !isTab)
+ {
+ // input method selection
+ fillColor = m_view->colorGroup().color(QColorGroup::Foreground);
+ }
+ else if (isIMEdit && !isTab)
+ {
+ // XIM support
+ // input method edit area
+ const QColorGroup& cg = m_view->colorGroup();
+ int h1, s1, v1, h2, s2, v2;
+ cg.color( QColorGroup::Base ).hsv( &h1, &s1, &v1 );
+ cg.color( QColorGroup::Background ).hsv( &h2, &s2, &v2 );
+ fillColor.setHsv( h1, s1, ( v1 + v2 ) / 2 );
+ }
+ else if (!selectionPainted && (isSel || currentHL.itemSet(KateAttribute::BGColor)))
+ {
+ if (isSel)
+ {
+ fillColor = config()->selectionColor();
+
+ // If this is the last block of text, fill up to the end of the line if the
+ // selection stretches that far
+ if ((curCol >= len - 1) && m_view->lineEndSelected (line, endcol))
+ width = xEnd - oldXPos;
+ }
+ else
+ {
+ fillColor = currentHL.bgColor();
+ }
+ }
+ else
+ {
+ paintBackground = false;
+ }
+
+ if (paintBackground)
+ paint.fillRect(oldXPos - xStart, 0, width, fs->fontHeight, fillColor);
+
+ if (isIMSel && paintBackground && !isTab)
+ {
+ paint.save();
+ paint.setPen( m_view->colorGroup().color( QColorGroup::BrightText ) );
+ }
+
+ // Draw indentation markers.
+ if (showIndentLines() && curCol < lastIndentColumn)
+ {
+ // Draw multiple guides when tab width greater than indent width.
+ const int charWidth = isTab ? m_tabWidth - curPos % m_tabWidth : 1;
+
+ // Do not draw indent guides on the first line.
+ int i = 0;
+ if (curPos == 0 || curPos % m_indentWidth > 0)
+ i = m_indentWidth - curPos % m_indentWidth;
+
+ for (; i < charWidth; i += m_indentWidth)
+ {
+ // In most cases this is done one or zero times.
+ paintIndentMarker(paint, xPos - xStart + i * spaceWidth, line);
+
+ // Draw highlighted line.
+ if (curPos+i == minIndent)
+ {
+ paintIndentMarker(paint, xPos - xStart + 1 + i * spaceWidth, line+1);
+ }
+ }
+ }
+ }
+
+ // or we will see no text ;)
+ int y = fs->fontAscent;
+
+ // make sure we redraw the right character groups on attrib/selection changes
+ // Special case... de-special case some of it
+ if (isTab || (curCol >= trailingWhitespaceColumn))
+ {
+ // Draw spaces too, because it might be eg. underlined
+ static QString spaces;
+ if (int(spaces.length()) != m_tabWidth)
+ spaces.fill(' ', m_tabWidth);
+
+ paint.drawText(oldXPos-xStart, y, isTab ? spaces : QString(" "));
+
+ if (showTabs())
+ {
+ // trailing spaces and tabs may also have to be different options.
+ // if( curCol >= lastIndentColumn )
+ paintWhitespaceMarker(paint, xPos - xStart, y);
+ }
+
+ // variable advancement
+ blockStartCol = nextCol;
+ oldXPos = xPosAfter;
+ }
+ else
+ {
+ // Here's where the money is...
+ paint.drawText(oldXPos-xStart, y, textLine->string(), blockStartCol, nextCol-blockStartCol);
+
+ // Draw preedit's underline
+ if (isIMEdit) {
+ QRect r( oldXPos - xStart, 0, xPosAfter - oldXPos, fs->fontHeight );
+ paint.drawLine( r.bottomLeft(), r.bottomRight() );
+ }
+
+ // Put pen color back
+ if (isIMSel) paint.restore();
+
+ // We're done drawing?
+ if ((int)xPos > xEnd)
+ break;
+
+ // variable advancement
+ blockStartCol = nextCol;
+ oldXPos = xPosAfter;
+ //oldS = s+1;
+ }
+ } // renderNow
+
+ // determine cursor X position
+ if (showCursor && (cursor->col() == int(curCol)))
+ {
+ cursorVisible = true;
+ cursorXPos = xPos;
+ cursorMaxWidth = xPosAfter - xPos;
+ cursorColor = &curAt->textColor();
+ }
+ } // xPosAfter >= xStart
+ else
+ {
+ // variable advancement
+ blockStartCol = nextCol;
+ oldXPos = xPosAfter;
+ }
+
+ // increase xPos
+ xPos = xPosAfter;
+
+ // increase attribs pos
+ textAttributes++;
+
+ // to only switch font/color if needed
+ oldAt = curAt;
+ oldColor = curColor;
+
+ // col move
+ curCol++;
+ nextCol++;
+ currentPos.setCol(currentPos.col() + 1);
+
+ // Update the current indentation pos.
+ if (isTab)
+ {
+ curPos += m_tabWidth - (curPos % m_tabWidth);
+ }
+ else
+ {
+ curPos++;
+ }
+ }
+
+ // If this line has a partial selection that's the start of a multi-line selection,
+ // we have to fill areas on the right side of the text with the selection color.
+ if (showSelections() && hasSel && !selectionPainted && xStart >= (int)xPos && m_view->lineEndSelected(line, -1))
+ {
+ paint.fillRect(0, 0, xEnd-xStart, fs->fontHeight, config()->selectionColor());
+ }
+
+ // Determine cursor position (if it is not within the range being drawn)
+ if (showCursor && (cursor->col() >= int(curCol)))
+ {
+ cursorVisible = true;
+ cursorXPos = xPos + (cursor->col() - int(curCol)) * fs->myFontMetrics.width(QChar(' '));
+ cursorMaxWidth = xPosAfter - xPos;
+ cursorColor = &oldAt->textColor();
+ }
+ }
+
+ // Paint cursor
+ if (cursorVisible)
+ {
+ uint cursorWidth = (caretStyle() == Replace && (cursorMaxWidth > 2)) ? cursorMaxWidth : 2;
+ paint.fillRect(cursorXPos-xStart, 0, cursorWidth, fs->fontHeight, *cursorColor);
+ }
+
+ // show word wrap marker if desirable
+ if (!isPrinterFriendly() && config()->wordWrapMarker() && fs->fixedPitch())
+ {
+ paint.setPen( config()->wordWrapMarkerColor() );
+ int _x = m_doc->config()->wordWrapAt() * fs->myFontMetrics.width('x') - xStart;
+ paint.drawLine( _x,0,_x,fs->fontHeight );
+ }
+
+ // cleanup ;)
+ delete bracketStartRange;
+ delete bracketEndRange;
+}
+
+uint KateRenderer::textWidth(const KateTextLine::Ptr &textLine, int cursorCol)
+{
+ if (!textLine)
+ return 0;
+
+ const int len = textLine->length();
+
+ if (cursorCol < 0)
+ cursorCol = len;
+
+ KateFontStruct *fs = config()->fontStruct();
+
+ const QChar *unicode = textLine->text();
+ const QString &textString = textLine->string();
+
+ int x = 0;
+ int width;
+ for (int z = 0; z < cursorCol; z++) {
+ KateAttribute* a = attribute(textLine->attribute(z));
+
+ if (z < len) {
+ width = a->width(*fs, textString, z, m_tabWidth);
+ } else {
+ // DF: commented out. It happens all the time.
+ //Q_ASSERT(!m_doc->wrapCursor());
+ width = a->width(*fs, QChar(' '), m_tabWidth);
+ }
+
+ x += width;
+
+ if (z < len && unicode[z] == QChar('\t'))
+ x -= x % width;
+ }
+
+ return x;
+}
+
+uint KateRenderer::textWidth(const KateTextLine::Ptr &textLine, uint startcol, uint maxwidth, bool *needWrap, int *endX)
+{
+ KateFontStruct *fs = config()->fontStruct();
+ uint x = 0;
+ uint endcol = startcol;
+ int endX2 = 0;
+ int lastWhiteSpace = -1;
+ int lastWhiteSpaceX = -1;
+
+ // used to not wrap a solitary word off the first line, ie. the
+ // first line should not wrap until some characters have been displayed if possible
+ bool foundNonWhitespace = startcol != 0;
+ bool foundWhitespaceAfterNonWhitespace = startcol != 0;
+
+ *needWrap = false;
+
+ const uint len = textLine->length();
+ const QChar *unicode = textLine->text();
+ const QString &textString = textLine->string();
+
+ uint z = startcol;
+ for (; z < len; z++)
+ {
+ KateAttribute* a = attribute(textLine->attribute(z));
+ int width = a->width(*fs, textString, z, m_tabWidth);
+ Q_ASSERT(width);
+ x += width;
+
+ // How should tabs be treated when they word-wrap on a print-out?
+ // if startcol != 0, this messes up (then again, word wrapping messes up anyway)
+ if (unicode[z] == QChar('\t'))
+ x -= x % width;
+
+ if (unicode[z].isSpace())
+ {
+ lastWhiteSpace = z+1;
+ lastWhiteSpaceX = x;
+
+ if (foundNonWhitespace)
+ foundWhitespaceAfterNonWhitespace = true;
+ }
+ else
+ {
+ if (!foundWhitespaceAfterNonWhitespace) {
+ foundNonWhitespace = true;
+
+ lastWhiteSpace = z+1;
+ lastWhiteSpaceX = x;
+ }
+ }
+
+ if (x <= maxwidth)
+ {
+ if (lastWhiteSpace > -1)
+ {
+ endcol = lastWhiteSpace;
+ endX2 = lastWhiteSpaceX;
+ }
+ else
+ {
+ endcol = z+1;
+ endX2 = x;
+ }
+ }
+ else if (z == startcol)
+ {
+ // require a minimum of 1 character advancement per call, even if it means drawing gets cut off
+ // (geez gideon causes troubles with starting the views very small)
+ endcol = z+1;
+ endX2 = x;
+ }
+
+ if (x >= maxwidth)
+ {
+ *needWrap = true;
+ break;
+ }
+ }
+
+ if (*needWrap)
+ {
+ if (endX)
+ *endX = endX2;
+
+ return endcol;
+ }
+ else
+ {
+ if (endX)
+ *endX = x;
+
+ return z+1;
+ }
+}
+
+uint KateRenderer::textWidth(const KateTextCursor &cursor)
+{
+ int line = kMin(kMax(0, cursor.line()), (int)m_doc->numLines() - 1);
+ int col = kMax(0, cursor.col());
+
+ return textWidth(m_doc->kateTextLine(line), col);
+}
+
+uint KateRenderer::textWidth( KateTextCursor &cursor, int xPos, uint startCol)
+{
+ bool wrapCursor = m_view->wrapCursor();
+ int x, oldX;
+
+ KateFontStruct *fs = config()->fontStruct();
+
+ if (cursor.line() < 0) cursor.setLine(0);
+ if (cursor.line() > (int)m_doc->lastLine()) cursor.setLine(m_doc->lastLine());
+ KateTextLine::Ptr textLine = m_doc->kateTextLine(cursor.line());
+
+ if (!textLine) return 0;
+
+ const uint len = textLine->length();
+ const QChar *unicode = textLine->text();
+ const QString &textString = textLine->string();
+
+ x = oldX = 0;
+ uint z = startCol;
+ while (x < xPos && (!wrapCursor || z < len)) {
+ oldX = x;
+
+ KateAttribute* a = attribute(textLine->attribute(z));
+
+ int width = 0;
+
+ if (z < len)
+ width = a->width(*fs, textString, z, m_tabWidth);
+ else
+ width = a->width(*fs, QChar(' '), m_tabWidth);
+
+ x += width;
+
+ if (z < len && unicode[z] == QChar('\t'))
+ x -= x % width;
+
+ z++;
+ }
+ if (xPos - oldX < x - xPos && z > 0) {
+ z--;
+ x = oldX;
+ }
+ cursor.setCol(z);
+ return x;
+}
+
+const QFont *KateRenderer::currentFont()
+{
+ return config()->font();
+}
+
+const QFontMetrics* KateRenderer::currentFontMetrics()
+{
+ return config()->fontMetrics();
+}
+
+uint KateRenderer::textPos(uint line, int xPos, uint startCol, bool nearest)
+{
+ return textPos(m_doc->kateTextLine(line), xPos, startCol, nearest);
+}
+
+uint KateRenderer::textPos(const KateTextLine::Ptr &textLine, int xPos, uint startCol, bool nearest)
+{
+ Q_ASSERT(textLine);
+ if (!textLine)
+ return 0;
+
+ KateFontStruct *fs = config()->fontStruct();
+
+ int x, oldX;
+ x = oldX = 0;
+
+ uint z = startCol;
+ const uint len = textLine->length();
+ const QString &textString = textLine->string();
+
+ while ( (x < xPos) && (z < len)) {
+ oldX = x;
+
+ KateAttribute* a = attribute(textLine->attribute(z));
+ x += a->width(*fs, textString, z, m_tabWidth);
+
+ z++;
+ }
+ if ( ( (! nearest) || xPos - oldX < x - xPos ) && z > 0 ) {
+ z--;
+ // newXPos = oldX;
+ }// else newXPos = x;
+ return z;
+}
+
+uint KateRenderer::fontHeight()
+{
+ return config()->fontStruct ()->fontHeight;
+}
+
+uint KateRenderer::documentHeight()
+{
+ return m_doc->numLines() * fontHeight();
+}
+
+bool KateRenderer::getSelectionBounds(uint line, uint lineLength, uint &start, uint &end)
+{
+ bool hasSel = false;
+
+ if (m_view->hasSelection() && !m_view->blockSelectionMode())
+ {
+ if (m_view->lineIsSelection(line))
+ {
+ start = m_view->selStartCol();
+ end = m_view->selEndCol();
+ hasSel = true;
+ }
+ else if ((int)line == m_view->selStartLine())
+ {
+ start = m_view->selStartCol();
+ end = lineLength;
+ hasSel = true;
+ }
+ else if ((int)line == m_view->selEndLine())
+ {
+ start = 0;
+ end = m_view->selEndCol();
+ hasSel = true;
+ }
+ }
+ else if (m_view->lineHasSelected(line))
+ {
+ start = m_view->selStartCol();
+ end = m_view->selEndCol();
+ hasSel = true;
+ }
+
+ if (start > end) {
+ int temp = end;
+ end = start;
+ start = temp;
+ }
+
+ return hasSel;
+}
+
+void KateRenderer::updateConfig ()
+{
+ // update the attibute list pointer
+ updateAttributes ();
+
+ if (m_view)
+ m_view->updateRendererConfig();
+}
+
+uint KateRenderer::spaceWidth()
+{
+ return attribute(0)->width(*config()->fontStruct(), QChar(' '), m_tabWidth);
+}
+
+// kate: space-indent on; indent-width 2; replace-tabs on;
diff --git a/kate/part/katerenderer.h b/kate/part/katerenderer.h
new file mode 100644
index 000000000..fc4865ab1
--- /dev/null
+++ b/kate/part/katerenderer.h
@@ -0,0 +1,272 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2003 Hamish Rodda <rodda@kde.org>
+ Copyright (C) 2001 Christoph Cullmann <cullmann@kde.org>
+ Copyright (C) 2001 Joseph Wenninger <jowenn@kde.org>
+ Copyright (C) 1999 Jochen Wilhelmy <digisnap@cs.tu-berlin.de>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef __KATE_RENDERER_H__
+#define __KATE_RENDERER_H__
+
+#include "katecursor.h"
+#include "kateattribute.h"
+#include "katetextline.h"
+
+#include <qfont.h>
+#include <qfontmetrics.h>
+
+class KateDocument;
+class KateView;
+class KateLineRange;
+class KateRendererConfig;
+
+/**
+ * Handles all of the work of rendering the text
+ * (used for the views and printing)
+ *
+ **/
+class KateRenderer
+{
+public:
+ /**
+ * Style of Caret (Insert or Replace mode)
+ */
+ enum caretStyles {
+ Insert,
+ Replace
+ };
+
+ /**
+ * Constructor
+ * @param doc document to render
+ * @param view view which is output (0 for example for rendering to print)
+ */
+ KateRenderer(KateDocument* doc, KateView *view = 0);
+
+ /**
+ * Destructor
+ */
+ ~KateRenderer();
+
+ /**
+ * update the highlighting attributes
+ * (for example after an hl change or after hl config changed)
+ */
+ void updateAttributes ();
+
+ /**
+ * Determine whether the caret (text cursor) will be drawn.
+ * @return should it be drawn?
+ */
+ inline bool drawCaret() const { return m_drawCaret; }
+
+ /**
+ * Set whether the caret (text cursor) will be drawn.
+ * @param drawCaret should caret be drawn?
+ */
+ void setDrawCaret(bool drawCaret);
+
+ /**
+ * The style of the caret (text cursor) to be painted.
+ * @return caretStyle
+ */
+ inline KateRenderer::caretStyles caretStyle() const { return m_caretStyle; }
+
+ /**
+ * Set the style of caret to be painted.
+ * @param style style to set
+ */
+ void setCaretStyle(KateRenderer::caretStyles style);
+
+ /**
+ * @returns whether tabs should be shown (ie. a small mark
+ * drawn to identify a tab)
+ * @return tabs should be shown
+ */
+ inline bool showTabs() const { return m_showTabs; }
+
+ /**
+ * Set whether a mark should be painted to help identifying tabs.
+ * @param showTabs show the tabs?
+ */
+ void setShowTabs(bool showTabs);
+
+ /**
+ * Sets the width of the tab. Helps performance.
+ * @param tabWidth new tab width
+ */
+ void setTabWidth(int tabWidth);
+
+ /**
+ * @returns whether indent lines should be shown
+ * @return indent lines should be shown
+ */
+ bool showIndentLines() const;
+
+ /**
+ * Set whether a guide should be painted to help identifying indent lines.
+ * @param showLines show the indent lines?
+ */
+ void setShowIndentLines(bool showLines);
+
+ /**
+ * Sets the width of the tab. Helps performance.
+ * @param indentWidth new indent width
+ */
+ void setIndentWidth(int indentWidth);
+
+ /**
+ * Show the view's selection?
+ * @return show sels?
+ */
+ inline bool showSelections() const { return m_showSelections; }
+
+ /**
+ * Set whether the view's selections should be shown.
+ * The default is true.
+ * @param showSelections show the selections?
+ */
+ void setShowSelections(bool showSelections);
+
+ /**
+ * Change to a different font (soon to be font set?)
+ */
+ void increaseFontSizes();
+ void decreaseFontSizes();
+ const QFont* currentFont();
+ const QFontMetrics* currentFontMetrics();
+
+ /**
+ * @return whether the renderer is configured to paint in a
+ * printer-friendly fashion.
+ */
+ bool isPrinterFriendly() const;
+
+ /**
+ * Configure this renderer to paint in a printer-friendly fashion.
+ *
+ * Sets the other options appropriately if true.
+ */
+ void setPrinterFriendly(bool printerFriendly);
+
+ /**
+ * Text width & height calculation functions...
+ */
+
+ // Width calculators
+ uint spaceWidth();
+ uint textWidth(const KateTextLine::Ptr &, int cursorCol);
+ uint textWidth(const KateTextLine::Ptr &textLine, uint startcol, uint maxwidth, bool *needWrap, int *endX = 0);
+ uint textWidth(const KateTextCursor &cursor);
+
+ // Cursor constrainer
+ uint textWidth(KateTextCursor &cursor, int xPos, uint startCol = 0);
+
+ // Column calculators
+ /**
+ * @return the index of the character at the horixontal position @p xpos
+ * in @p line.
+ *
+ * If @p nearest is true, the character starting nearest to
+ * @p xPos is returned. If @p nearest is false, the index of the character
+ * containing @p xPos is returned.
+ **/
+ uint textPos(uint line, int xPos, uint startCol = 0, bool nearest=true);
+ /**
+ * @overload
+ */
+ uint textPos(const KateTextLine::Ptr &, int xPos, uint startCol = 0, bool nearest=true);
+
+ // Font height
+ uint fontHeight();
+
+ // Document height
+ uint documentHeight();
+
+ // Selection boundaries
+ bool getSelectionBounds(uint line, uint lineLength, uint &start, uint &end);
+
+ /**
+ * This is the ultimate function to perform painting of a text line.
+ * (supports startcol/endcol, startx/endx)
+ *
+ * The text line is painted from the upper limit of (0,0). To move that,
+ * apply a transform to your painter.
+ */
+ void paintTextLine(QPainter& paint, const KateLineRange* range, int xStart, int xEnd, const KateTextCursor* cursor = 0L, const KateBracketRange* bracketmark = 0L);
+
+ /**
+ * Paint the background of a line
+ *
+ * Split off from the main @ref paintTextLine method to make it smaller. As it's being
+ * called only once per line it shouldn't noticably affect performance and it
+ * helps readability a LOT.
+ *
+ * @return whether the selection has been painted or not
+ */
+ bool paintTextLineBackground(QPainter& paint, int line, bool isCurrentLine, int xStart, int xEnd);
+
+ /**
+ * This takes an in index, and returns all the attributes for it.
+ * For example, if you have a ktextline, and want the KateAttribute
+ * for a given position, do:
+ *
+ * attribute(myktextline->attribute(position));
+ */
+ KateAttribute* attribute(uint pos);
+
+ private:
+ /**
+ * Paint a whitespace marker on position (x, y).
+ *
+ * Currently only used by the tabs, but it will also be used for highlighting trailing whitespace
+ */
+ void paintWhitespaceMarker(QPainter &paint, uint x, uint y);
+
+ /** Paint a SciTE-like indent marker. */
+ void paintIndentMarker(QPainter &paint, uint x, uint y);
+
+ KateDocument* m_doc;
+ KateView *m_view;
+
+ // cache of config values
+ int m_tabWidth;
+ int m_indentWidth;
+ uint m_schema;
+
+ // some internal flags
+ KateRenderer::caretStyles m_caretStyle;
+ bool m_drawCaret;
+ bool m_showSelections;
+ bool m_showTabs;
+ bool m_printerFriendly;
+
+ QMemArray<KateAttribute> *m_attributes;
+
+ /**
+ * Configuration
+ */
+ public:
+ inline KateRendererConfig *config () { return m_config; };
+
+ void updateConfig ();
+
+ private:
+ KateRendererConfig *m_config;
+};
+
+#endif
diff --git a/kate/part/kateschema.cpp b/kate/part/kateschema.cpp
new file mode 100644
index 000000000..e0a5d5dba
--- /dev/null
+++ b/kate/part/kateschema.cpp
@@ -0,0 +1,1611 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2001-2003 Christoph Cullmann <cullmann@kde.org>
+ Copyright (C) 2002, 2003 Anders Lund <anders.lund@lund.tdcadsl.dk>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+//BEGIN Includes
+#include "kateschema.h"
+#include "kateschema.moc"
+
+#include "kateconfig.h"
+#include "katedocument.h"
+#include "katefactory.h"
+#include "kateview.h"
+#include "katerenderer.h"
+
+#include <klocale.h>
+#include <kdialogbase.h>
+#include <kcolorbutton.h>
+#include <kcombobox.h>
+#include <kinputdialog.h>
+#include <kfontdialog.h>
+#include <kdebug.h>
+#include <kiconloader.h>
+#include <kmessagebox.h>
+#include <kpopupmenu.h>
+#include <kcolordialog.h>
+#include <kapplication.h>
+#include <kaboutdata.h>
+#include <ktexteditor/markinterface.h>
+
+#include <qbuttongroup.h>
+#include <qcheckbox.h>
+#include <qptrcollection.h>
+#include <qdialog.h>
+#include <qgrid.h>
+#include <qgroupbox.h>
+#include <qlabel.h>
+#include <qtextcodec.h>
+#include <qlayout.h>
+#include <qlineedit.h>
+#include <qheader.h>
+#include <qlistbox.h>
+#include <qhbox.h>
+#include <qpainter.h>
+#include <qobjectlist.h>
+#include <qpixmap.h>
+#include <qpushbutton.h>
+#include <qradiobutton.h>
+#include <qspinbox.h>
+#include <qstringlist.h>
+#include <qtabwidget.h>
+#include <qvbox.h>
+#include <qvgroupbox.h>
+#include <qwhatsthis.h>
+//END
+
+//BEGIN KateStyleListViewItem decl
+/*
+ QListViewItem subclass to display/edit a style, bold/italic is check boxes,
+ normal and selected colors are boxes, which will display a color chooser when
+ activated.
+ The context name for the style will be drawn using the editor default font and
+ the chosen colors.
+ This widget id designed to handle the default as well as the individual hl style
+ lists.
+ This widget is designed to work with the KateStyleListView class exclusively.
+ Added by anders, jan 23 2002.
+*/
+class KateStyleListItem : public QListViewItem
+{
+ public:
+ KateStyleListItem( QListViewItem *parent=0, const QString & stylename=0,
+ class KateAttribute* defaultstyle=0, class KateHlItemData *data=0 );
+ KateStyleListItem( QListView *parent, const QString & stylename=0,
+ class KateAttribute* defaultstyle=0, class KateHlItemData *data=0 );
+ ~KateStyleListItem() { if (st) delete is; };
+
+ /* mainly for readability */
+ enum Property { ContextName, Bold, Italic, Underline, Strikeout, Color, SelColor, BgColor, SelBgColor, UseDefStyle };
+
+ /* initializes the style from the default and the hldata */
+ void initStyle();
+ /* updates the hldata's style */
+ void updateStyle();
+ /* reimp */
+ virtual int width ( const QFontMetrics & fm, const QListView * lv, int c ) const;
+ /* calls changeProperty() if it makes sense considering pos. */
+ void activate( int column, const QPoint &localPos );
+ /* For bool fields, toggles them, for color fields, display a color chooser */
+ void changeProperty( Property p );
+ /** unset a color.
+ * c is 100 (BGColor) or 101 (SelectedBGColor) for now.
+ */
+ void unsetColor( int c );
+ /* style context name */
+ QString contextName() { return text(0); };
+ /* only true for a hl mode item using it's default style */
+ bool defStyle();
+ /* true for default styles */
+ bool isDefault();
+ /* whichever style is active (st for hl mode styles not using
+ the default style, ds otherwise) */
+ class KateAttribute* style() { return is; };
+
+ protected:
+ /* reimp */
+ void paintCell(QPainter *p, const QColorGroup& cg, int col, int width, int align);
+
+ private:
+ /* private methods to change properties */
+ void toggleDefStyle();
+ void setColor( int );
+ /* helper function to copy the default style into the KateHlItemData,
+ when a property is changed and we are using default style. */
+
+ class KateAttribute *is, // the style currently in use
+ *ds; // default style for hl mode contexts and default styles
+ class KateHlItemData *st; // itemdata for hl mode contexts
+};
+//END
+
+//BEGIN KateStyleListCaption decl
+/*
+ This is a simple subclass for drawing the language names in a nice treeview
+ with the styles. It is needed because we do not like to mess with the default
+ palette of the containing ListView. Only the paintCell method is overwritten
+ to use our own palette (that is set on the viewport rather than on the listview
+ itself).
+*/
+class KateStyleListCaption : public QListViewItem
+{
+ public:
+ KateStyleListCaption( QListView *parent, const QString & name );
+ ~KateStyleListCaption() {};
+
+ protected:
+ void paintCell(QPainter *p, const QColorGroup& cg, int col, int width, int align);
+};
+//END
+
+//BEGIN KateSchemaManager
+QString KateSchemaManager::normalSchema ()
+{
+ return KApplication::kApplication()->aboutData()->appName () + QString (" - Normal");
+}
+
+QString KateSchemaManager::printingSchema ()
+{
+ return KApplication::kApplication()->aboutData()->appName () + QString (" - Printing");
+}
+
+KateSchemaManager::KateSchemaManager ()
+ : m_config ("kateschemarc", false, false)
+{
+ update ();
+}
+
+KateSchemaManager::~KateSchemaManager ()
+{
+}
+
+//
+// read the types from config file and update the internal list
+//
+void KateSchemaManager::update (bool readfromfile)
+{
+ if (readfromfile)
+ m_config.reparseConfiguration ();
+
+ m_schemas = m_config.groupList();
+ m_schemas.sort ();
+
+ m_schemas.remove (printingSchema());
+ m_schemas.remove (normalSchema());
+ m_schemas.prepend (printingSchema());
+ m_schemas.prepend (normalSchema());
+}
+
+//
+// get the right group
+// special handling of the default schemas ;)
+//
+KConfig *KateSchemaManager::schema (uint number)
+{
+ if ((number>1) && (number < m_schemas.count()))
+ m_config.setGroup (m_schemas[number]);
+ else if (number == 1)
+ m_config.setGroup (printingSchema());
+ else
+ m_config.setGroup (normalSchema());
+
+ return &m_config;
+}
+
+void KateSchemaManager::addSchema (const QString &t)
+{
+ m_config.setGroup (t);
+ m_config.writeEntry("Color Background", KGlobalSettings::baseColor());
+
+ update (false);
+}
+
+void KateSchemaManager::removeSchema (uint number)
+{
+ if (number >= m_schemas.count())
+ return;
+
+ if (number < 2)
+ return;
+
+ m_config.deleteGroup (name (number));
+
+ update (false);
+}
+
+bool KateSchemaManager::validSchema (uint number)
+{
+ if (number < m_schemas.count())
+ return true;
+
+ return false;
+}
+
+uint KateSchemaManager::number (const QString &name)
+{
+ if (name == normalSchema())
+ return 0;
+
+ if (name == printingSchema())
+ return 1;
+
+ int i;
+ if ((i = m_schemas.findIndex(name)) > -1)
+ return i;
+
+ return 0;
+}
+
+QString KateSchemaManager::name (uint number)
+{
+ if ((number>1) && (number < m_schemas.count()))
+ return m_schemas[number];
+ else if (number == 1)
+ return printingSchema();
+
+ return normalSchema();
+}
+//END
+
+//
+// DIALOGS !!!
+//
+
+//BEGIN KateSchemaConfigColorTab -- 'Colors' tab
+KateSchemaConfigColorTab::KateSchemaConfigColorTab( QWidget *parent, const char * )
+ : QWidget (parent)
+{
+ m_schema = -1;
+
+ QHBox *b;
+ QLabel *label;
+
+ QVBoxLayout *blay=new QVBoxLayout(this, 0, KDialog::spacingHint());
+
+ QVGroupBox *gbTextArea = new QVGroupBox(i18n("Text Area Background"), this);
+
+ b = new QHBox (gbTextArea);
+ b->setSpacing(KDialog::spacingHint());
+ label = new QLabel( i18n("Normal text:"), b);
+ label->setAlignment( AlignLeft|AlignVCenter);
+ m_back = new KColorButton(b);
+
+ b = new QHBox (gbTextArea);
+ b->setSpacing(KDialog::spacingHint());
+ label = new QLabel( i18n("Selected text:"), b);
+ label->setAlignment( AlignLeft|AlignVCenter);
+ m_selected = new KColorButton(b);
+
+ b = new QHBox (gbTextArea);
+ b->setSpacing(KDialog::spacingHint());
+ label = new QLabel( i18n("Current line:"), b);
+ label->setAlignment( AlignLeft|AlignVCenter);
+ m_current = new KColorButton(b);
+
+ // Markers from kdelibs/interfaces/ktextinterface/markinterface.h
+ b = new QHBox (gbTextArea);
+ b->setSpacing(KDialog::spacingHint());
+ m_combobox = new KComboBox(b, "color_combo_box");
+ // add the predefined mark types as defined in markinterface.h
+ m_combobox->insertItem(i18n("Bookmark")); // markType01
+ m_combobox->insertItem(i18n("Active Breakpoint")); // markType02
+ m_combobox->insertItem(i18n("Reached Breakpoint")); // markType03
+ m_combobox->insertItem(i18n("Disabled Breakpoint")); // markType04
+ m_combobox->insertItem(i18n("Execution")); // markType05
+ m_combobox->insertItem(i18n("Warning")); // markType06
+ m_combobox->insertItem(i18n("Error")); // markType07
+ m_combobox->setCurrentItem(0);
+ m_markers = new KColorButton(b, "marker_color_button");
+ connect( m_combobox, SIGNAL( activated( int ) ), SLOT( slotComboBoxChanged( int ) ) );
+
+ blay->addWidget(gbTextArea);
+
+ QVGroupBox *gbBorder = new QVGroupBox(i18n("Additional Elements"), this);
+
+ b = new QHBox (gbBorder);
+ b->setSpacing(KDialog::spacingHint());
+ label = new QLabel( i18n("Left border background:"), b);
+ label->setAlignment( AlignLeft|AlignVCenter);
+ m_iconborder = new KColorButton(b);
+
+ b = new QHBox (gbBorder);
+ b->setSpacing(KDialog::spacingHint());
+ label = new QLabel( i18n("Line numbers:"), b);
+ label->setAlignment( AlignLeft|AlignVCenter);
+ m_linenumber = new KColorButton(b);
+
+ b = new QHBox (gbBorder);
+ b->setSpacing(KDialog::spacingHint());
+ label = new QLabel( i18n("Bracket highlight:"), b);
+ label->setAlignment( AlignLeft|AlignVCenter);
+ m_bracket = new KColorButton(b);
+
+ b = new QHBox (gbBorder);
+ b->setSpacing(KDialog::spacingHint());
+ label = new QLabel( i18n("Word wrap markers:"), b);
+ label->setAlignment( AlignLeft|AlignVCenter);
+ m_wwmarker = new KColorButton(b);
+
+ b = new QHBox (gbBorder);
+ b->setSpacing(KDialog::spacingHint());
+ label = new QLabel( i18n("Tab markers:"), b);
+ label->setAlignment( AlignLeft|AlignVCenter);
+ m_tmarker = new KColorButton(b);
+
+ blay->addWidget(gbBorder);
+
+ blay->addStretch();
+
+ // connect signal changed(); changed is emitted by a ColorButton change!
+ connect( this, SIGNAL( changed() ), parent->parentWidget(), SLOT( slotChanged() ) );
+
+ // QWhatsThis help
+ QWhatsThis::add(m_back, i18n("<p>Sets the background color of the editing area.</p>"));
+ QWhatsThis::add(m_selected, i18n("<p>Sets the background color of the selection.</p>"
+ "<p>To set the text color for selected text, use the \"<b>Configure "
+ "Highlighting</b>\" dialog.</p>"));
+ QWhatsThis::add(m_markers, i18n("<p>Sets the background color of the selected "
+ "marker type.</p><p><b>Note</b>: The marker color is displayed lightly because "
+ "of transparency.</p>"));
+ QWhatsThis::add(m_combobox, i18n("<p>Select the marker type you want to change.</p>"));
+ QWhatsThis::add(m_current, i18n("<p>Sets the background color of the currently "
+ "active line, which means the line where your cursor is positioned.</p>"));
+ QWhatsThis::add( m_linenumber, i18n(
+ "<p>This color will be used to draw the line numbers (if enabled) and the "
+ "lines in the code-folding pane.</p>" ) );
+ QWhatsThis::add(m_bracket, i18n("<p>Sets the bracket matching color. This means, "
+ "if you place the cursor e.g. at a <b>(</b>, the matching <b>)</b> will "
+ "be highlighted with this color.</p>"));
+ QWhatsThis::add(m_wwmarker, i18n(
+ "<p>Sets the color of Word Wrap-related markers:</p>"
+ "<dl><dt>Static Word Wrap</dt><dd>A vertical line which shows the column where "
+ "text is going to be wrapped</dd>"
+ "<dt>Dynamic Word Wrap</dt><dd>An arrow shown to the left of "
+ "visually-wrapped lines</dd></dl>"));
+ QWhatsThis::add(m_tmarker, i18n(
+ "<p>Sets the color of the tabulator marks:</p>"));
+}
+
+KateSchemaConfigColorTab::~KateSchemaConfigColorTab()
+{
+}
+
+void KateSchemaConfigColorTab::schemaChanged ( int newSchema )
+{
+ // save curent schema
+ if ( m_schema > -1 )
+ {
+ m_schemas[ m_schema ].back = m_back->color();
+ m_schemas[ m_schema ].selected = m_selected->color();
+ m_schemas[ m_schema ].current = m_current->color();
+ m_schemas[ m_schema ].bracket = m_bracket->color();
+ m_schemas[ m_schema ].wwmarker = m_wwmarker->color();
+ m_schemas[ m_schema ].iconborder = m_iconborder->color();
+ m_schemas[ m_schema ].tmarker = m_tmarker->color();
+ m_schemas[ m_schema ].linenumber = m_linenumber->color();
+ }
+
+ if ( newSchema == m_schema ) return;
+
+ // switch
+ m_schema = newSchema;
+
+ // first disconnect all signals otherwise setColor emits changed
+ m_back ->disconnect( SIGNAL( changed( const QColor & ) ) );
+ m_selected ->disconnect( SIGNAL( changed( const QColor & ) ) );
+ m_current ->disconnect( SIGNAL( changed( const QColor & ) ) );
+ m_bracket ->disconnect( SIGNAL( changed( const QColor & ) ) );
+ m_wwmarker ->disconnect( SIGNAL( changed( const QColor & ) ) );
+ m_iconborder->disconnect( SIGNAL( changed( const QColor & ) ) );
+ m_tmarker ->disconnect( SIGNAL( changed( const QColor & ) ) );
+ m_markers ->disconnect( SIGNAL( changed( const QColor & ) ) );
+ m_linenumber->disconnect( SIGNAL( changed( const QColor & ) ) );
+
+ // If we havent this schema, read in from config file
+ if ( ! m_schemas.contains( newSchema ) )
+ {
+ // fallback defaults
+ QColor tmp0 (KGlobalSettings::baseColor());
+ QColor tmp1 (KGlobalSettings::highlightColor());
+ QColor tmp2 (KGlobalSettings::alternateBackgroundColor());
+ QColor tmp3 ( "#FFFF99" );
+ QColor tmp4 (tmp2.dark());
+ QColor tmp5 ( KGlobalSettings::textColor() );
+ QColor tmp6 ( "#EAE9E8" );
+ QColor tmp7 ( "#000000" );
+
+ // same std colors like in KateDocument::markColor
+ QValueVector <QColor> mark(KTextEditor::MarkInterface::reservedMarkersCount());
+ Q_ASSERT(mark.size() > 6);
+ mark[0] = Qt::blue;
+ mark[1] = Qt::red;
+ mark[2] = Qt::yellow;
+ mark[3] = Qt::magenta;
+ mark[4] = Qt::gray;
+ mark[5] = Qt::green;
+ mark[6] = Qt::red;
+
+ SchemaColors c;
+ KConfig *config = KateFactory::self()->schemaManager()->schema(newSchema);
+
+ c.back= config->readColorEntry("Color Background", &tmp0);
+ c.selected = config->readColorEntry("Color Selection", &tmp1);
+ c.current = config->readColorEntry("Color Highlighted Line", &tmp2);
+ c.bracket = config->readColorEntry("Color Highlighted Bracket", &tmp3);
+ c.wwmarker = config->readColorEntry("Color Word Wrap Marker", &tmp4);
+ c.tmarker = config->readColorEntry("Color Tab Marker", &tmp5);
+ c.iconborder = config->readColorEntry("Color Icon Bar", &tmp6);
+ c.linenumber = config->readColorEntry("Color Line Number", &tmp7);
+
+ for (int i = 0; i < KTextEditor::MarkInterface::reservedMarkersCount(); i++)
+ c.markerColors[i] = config->readColorEntry( QString("Color MarkType%1").arg(i+1), &mark[i] );
+
+ m_schemas[ newSchema ] = c;
+ }
+
+ m_back->setColor( m_schemas[ newSchema ].back);
+ m_selected->setColor( m_schemas [ newSchema ].selected );
+ m_current->setColor( m_schemas [ newSchema ].current );
+ m_bracket->setColor( m_schemas [ newSchema ].bracket );
+ m_wwmarker->setColor( m_schemas [ newSchema ].wwmarker );
+ m_tmarker->setColor( m_schemas [ newSchema ].tmarker );
+ m_iconborder->setColor( m_schemas [ newSchema ].iconborder );
+ m_linenumber->setColor( m_schemas [ newSchema ].linenumber );
+
+ // map from 0..reservedMarkersCount()-1 - the same index as in markInterface
+ for (int i = 0; i < KTextEditor::MarkInterface::reservedMarkersCount(); i++)
+ {
+ QPixmap pix(16, 16);
+ pix.fill( m_schemas [ newSchema ].markerColors[i]);
+ m_combobox->changeItem(pix, m_combobox->text(i), i);
+ }
+ m_markers->setColor( m_schemas [ newSchema ].markerColors[ m_combobox->currentItem() ] );
+
+ connect( m_back , SIGNAL( changed( const QColor& ) ), SIGNAL( changed() ) );
+ connect( m_selected , SIGNAL( changed( const QColor& ) ), SIGNAL( changed() ) );
+ connect( m_current , SIGNAL( changed( const QColor& ) ), SIGNAL( changed() ) );
+ connect( m_bracket , SIGNAL( changed( const QColor& ) ), SIGNAL( changed() ) );
+ connect( m_wwmarker , SIGNAL( changed( const QColor& ) ), SIGNAL( changed() ) );
+ connect( m_iconborder, SIGNAL( changed( const QColor& ) ), SIGNAL( changed() ) );
+ connect( m_tmarker , SIGNAL( changed( const QColor& ) ), SIGNAL( changed() ) );
+ connect( m_linenumber, SIGNAL( changed( const QColor& ) ), SIGNAL( changed() ) );
+ connect( m_markers , SIGNAL( changed( const QColor& ) ), SLOT( slotMarkerColorChanged( const QColor& ) ) );
+}
+
+void KateSchemaConfigColorTab::apply ()
+{
+ schemaChanged( m_schema );
+ QMap<int,SchemaColors>::Iterator it;
+ for ( it = m_schemas.begin(); it != m_schemas.end(); ++it )
+ {
+ kdDebug(13030)<<"APPLY scheme = "<<it.key()<<endl;
+ KConfig *config = KateFactory::self()->schemaManager()->schema( it.key() );
+ kdDebug(13030)<<"Using config group "<<config->group()<<endl;
+ SchemaColors c = it.data();
+
+ config->writeEntry("Color Background", c.back);
+ config->writeEntry("Color Selection", c.selected);
+ config->writeEntry("Color Highlighted Line", c.current);
+ config->writeEntry("Color Highlighted Bracket", c.bracket);
+ config->writeEntry("Color Word Wrap Marker", c.wwmarker);
+ config->writeEntry("Color Tab Marker", c.tmarker);
+ config->writeEntry("Color Icon Bar", c.iconborder);
+ config->writeEntry("Color Line Number", c.linenumber);
+
+ for (int i = 0; i < KTextEditor::MarkInterface::reservedMarkersCount(); i++)
+ {
+ config->writeEntry(QString("Color MarkType%1").arg(i + 1), c.markerColors[i]);
+ }
+ }
+}
+
+void KateSchemaConfigColorTab::slotMarkerColorChanged( const QColor& color)
+{
+ int index = m_combobox->currentItem();
+ m_schemas[ m_schema ].markerColors[ index ] = color;
+ QPixmap pix(16, 16);
+ pix.fill(color);
+ m_combobox->changeItem(pix, m_combobox->text(index), index);
+
+ emit changed();
+}
+
+void KateSchemaConfigColorTab::slotComboBoxChanged(int index)
+{
+ // temporarily disconnect the changed-signal because setColor emits changed as well
+ m_markers->disconnect( SIGNAL( changed( const QColor& ) ) );
+ m_markers->setColor( m_schemas[m_schema].markerColors[index] );
+ connect( m_markers, SIGNAL( changed( const QColor& ) ), SLOT( slotMarkerColorChanged( const QColor& ) ) );
+}
+
+//END KateSchemaConfigColorTab
+
+//BEGIN FontConfig -- 'Fonts' tab
+KateSchemaConfigFontTab::KateSchemaConfigFontTab( QWidget *parent, const char * )
+ : QWidget (parent)
+{
+ // sizemanagment
+ QGridLayout *grid = new QGridLayout( this, 1, 1 );
+
+ m_fontchooser = new KFontChooser ( this, 0L, false, QStringList(), false );
+ m_fontchooser->enableColumn(KFontChooser::StyleList, false);
+ grid->addWidget( m_fontchooser, 0, 0);
+
+ connect (this, SIGNAL( changed()), parent->parentWidget(), SLOT (slotChanged()));
+ m_schema = -1;
+}
+
+KateSchemaConfigFontTab::~KateSchemaConfigFontTab()
+{
+}
+
+void KateSchemaConfigFontTab::slotFontSelected( const QFont &font )
+{
+ if ( m_schema > -1 )
+ {
+ m_fonts[m_schema] = font;
+ emit changed();
+ }
+}
+
+void KateSchemaConfigFontTab::apply()
+{
+ FontMap::Iterator it;
+ for ( it = m_fonts.begin(); it != m_fonts.end(); ++it )
+ {
+ KateFactory::self()->schemaManager()->schema( it.key() )->writeEntry( "Font", it.data() );
+ }
+}
+
+void KateSchemaConfigFontTab::schemaChanged( int newSchema )
+{
+ if ( m_schema > -1 )
+ m_fonts[ m_schema ] = m_fontchooser->font();
+
+ m_schema = newSchema;
+
+ QFont f (KGlobalSettings::fixedFont());
+
+ m_fontchooser->disconnect ( this );
+ m_fontchooser->setFont ( KateFactory::self()->schemaManager()->schema( newSchema )->readFontEntry("Font", &f) );
+ m_fonts[ newSchema ] = m_fontchooser->font();
+ connect (m_fontchooser, SIGNAL (fontSelected( const QFont & )), this, SLOT (slotFontSelected( const QFont & )));
+}
+//END FontConfig
+
+//BEGIN FontColorConfig -- 'Normal Text Styles' tab
+KateSchemaConfigFontColorTab::KateSchemaConfigFontColorTab( QWidget *parent, const char * )
+ : QWidget (parent)
+{
+ m_defaultStyleLists.setAutoDelete(true);
+
+ // sizemanagment
+ QGridLayout *grid = new QGridLayout( this, 1, 1 );
+
+ m_defaultStyles = new KateStyleListView( this, false );
+ grid->addWidget( m_defaultStyles, 0, 0);
+
+ connect (m_defaultStyles, SIGNAL (changed()), parent->parentWidget(), SLOT (slotChanged()));
+
+ QWhatsThis::add( m_defaultStyles, i18n(
+ "This list displays the default styles for the current schema and "
+ "offers the means to edit them. The style name reflects the current "
+ "style settings."
+ "<p>To edit the colors, click the colored squares, or select the color "
+ "to edit from the popup menu.<p>You can unset the Background and Selected "
+ "Background colors from the popup menu when appropriate.") );
+}
+
+KateSchemaConfigFontColorTab::~KateSchemaConfigFontColorTab()
+{
+}
+
+KateAttributeList *KateSchemaConfigFontColorTab::attributeList (uint schema)
+{
+ if (!m_defaultStyleLists[schema])
+ {
+ KateAttributeList *list = new KateAttributeList ();
+ KateHlManager::self()->getDefaults(schema, *list);
+
+ m_defaultStyleLists.insert (schema, list);
+ }
+
+ return m_defaultStyleLists[schema];
+}
+
+void KateSchemaConfigFontColorTab::schemaChanged (uint schema)
+{
+ m_defaultStyles->clear ();
+
+ KateAttributeList *l = attributeList (schema);
+
+ // set colors
+ QPalette p ( m_defaultStyles->palette() );
+ QColor _c ( KGlobalSettings::baseColor() );
+ p.setColor( QColorGroup::Base,
+ KateFactory::self()->schemaManager()->schema(schema)->
+ readColorEntry( "Color Background", &_c ) );
+ _c = KGlobalSettings::highlightColor();
+ p.setColor( QColorGroup::Highlight,
+ KateFactory::self()->schemaManager()->schema(schema)->
+ readColorEntry( "Color Selection", &_c ) );
+ _c = l->at(0)->textColor(); // not quite as much of an assumption ;)
+ p.setColor( QColorGroup::Text, _c );
+ m_defaultStyles->viewport()->setPalette( p );
+
+ // insert the default styles backwards to get them in the right order
+ for ( int i = KateHlManager::self()->defaultStyles() - 1; i >= 0; i-- )
+ {
+ new KateStyleListItem( m_defaultStyles, KateHlManager::self()->defaultStyleName(i, true), l->at( i ) );
+ }
+}
+
+void KateSchemaConfigFontColorTab::reload ()
+{
+ m_defaultStyles->clear ();
+ m_defaultStyleLists.clear ();
+}
+
+void KateSchemaConfigFontColorTab::apply ()
+{
+ for ( QIntDictIterator<KateAttributeList> it( m_defaultStyleLists ); it.current(); ++it )
+ KateHlManager::self()->setDefaults(it.currentKey(), *(it.current()));
+}
+
+//END FontColorConfig
+
+//BEGIN KateSchemaConfigHighlightTab -- 'Highlighting Text Styles' tab
+KateSchemaConfigHighlightTab::KateSchemaConfigHighlightTab( QWidget *parent, const char *, KateSchemaConfigFontColorTab *page, uint hl )
+ : QWidget (parent)
+{
+ m_defaults = page;
+
+ m_schema = 0;
+ m_hl = 0;
+
+ m_hlDict.setAutoDelete (true);
+
+ QVBoxLayout *layout = new QVBoxLayout(this, 0, KDialog::spacingHint() );
+
+ // hl chooser
+ QHBox *hbHl = new QHBox( this );
+ layout->add (hbHl);
+
+ hbHl->setSpacing( KDialog::spacingHint() );
+ QLabel *lHl = new QLabel( i18n("H&ighlight:"), hbHl );
+ hlCombo = new QComboBox( false, hbHl );
+ lHl->setBuddy( hlCombo );
+ connect( hlCombo, SIGNAL(activated(int)),
+ this, SLOT(hlChanged(int)) );
+
+ for( int i = 0; i < KateHlManager::self()->highlights(); i++) {
+ if (KateHlManager::self()->hlSection(i).length() > 0)
+ hlCombo->insertItem(KateHlManager::self()->hlSection(i) + QString ("/") + KateHlManager::self()->hlNameTranslated(i));
+ else
+ hlCombo->insertItem(KateHlManager::self()->hlNameTranslated(i));
+ }
+ hlCombo->setCurrentItem(0);
+
+ // styles listview
+ m_styles = new KateStyleListView( this, true );
+ layout->addWidget (m_styles, 999);
+
+ hlCombo->setCurrentItem ( hl );
+ hlChanged ( hl );
+
+ QWhatsThis::add( m_styles, i18n(
+ "This list displays the contexts of the current syntax highlight mode and "
+ "offers the means to edit them. The context name reflects the current "
+ "style settings.<p>To edit using the keyboard, press "
+ "<strong>&lt;SPACE&gt;</strong> and choose a property from the popup menu."
+ "<p>To edit the colors, click the colored squares, or select the color "
+ "to edit from the popup menu.<p>You can unset the Background and Selected "
+ "Background colors from the context menu when appropriate.") );
+
+ connect (m_styles, SIGNAL (changed()), parent->parentWidget(), SLOT (slotChanged()));
+}
+
+KateSchemaConfigHighlightTab::~KateSchemaConfigHighlightTab()
+{
+}
+
+void KateSchemaConfigHighlightTab::hlChanged(int z)
+{
+ m_hl = z;
+
+ schemaChanged (m_schema);
+}
+
+void KateSchemaConfigHighlightTab::schemaChanged (uint schema)
+{
+ m_schema = schema;
+
+ kdDebug(13030) << "NEW SCHEMA: " << m_schema << " NEW HL: " << m_hl << endl;
+
+ m_styles->clear ();
+
+ if (!m_hlDict[m_schema])
+ {
+ kdDebug(13030) << "NEW SCHEMA, create dict" << endl;
+
+ m_hlDict.insert (schema, new QIntDict<KateHlItemDataList>);
+ m_hlDict[m_schema]->setAutoDelete (true);
+ }
+
+ if (!m_hlDict[m_schema]->find(m_hl))
+ {
+ kdDebug(13030) << "NEW HL, create list" << endl;
+
+ KateHlItemDataList *list = new KateHlItemDataList ();
+ KateHlManager::self()->getHl( m_hl )->getKateHlItemDataListCopy (m_schema, *list);
+ m_hlDict[m_schema]->insert (m_hl, list);
+ }
+
+ KateAttributeList *l = m_defaults->attributeList (schema);
+
+ // Set listview colors
+ // We do that now, because we can now get the "normal text" color.
+ // TODO this reads of the KConfig object, which should be changed when
+ // the color tab is fixed.
+ QPalette p ( m_styles->palette() );
+ QColor _c ( KGlobalSettings::baseColor() );
+ p.setColor( QColorGroup::Base,
+ KateFactory::self()->schemaManager()->schema(m_schema)->
+ readColorEntry( "Color Background", &_c ) );
+ _c = KGlobalSettings::highlightColor();
+ p.setColor( QColorGroup::Highlight,
+ KateFactory::self()->schemaManager()->schema(m_schema)->
+ readColorEntry( "Color Selection", &_c ) );
+ _c = l->at(0)->textColor(); // not quite as much of an assumption ;)
+ p.setColor( QColorGroup::Text, _c );
+ m_styles->viewport()->setPalette( p );
+
+ QDict<KateStyleListCaption> prefixes;
+ for ( KateHlItemData *itemData = m_hlDict[m_schema]->find(m_hl)->last();
+ itemData != 0L;
+ itemData = m_hlDict[m_schema]->find(m_hl)->prev())
+ {
+ kdDebug(13030) << "insert items " << itemData->name << endl;
+
+ // All stylenames have their language mode prefixed, e.g. HTML:Comment
+ // split them and put them into nice substructures.
+ int c = itemData->name.find(':');
+ if ( c > 0 ) {
+ QString prefix = itemData->name.left(c);
+ QString name = itemData->name.mid(c+1);
+
+ KateStyleListCaption *parent = prefixes.find( prefix );
+ if ( ! parent )
+ {
+ parent = new KateStyleListCaption( m_styles, prefix );
+ parent->setOpen(true);
+ prefixes.insert( prefix, parent );
+ }
+ new KateStyleListItem( parent, name, l->at(itemData->defStyleNum), itemData );
+ } else {
+ new KateStyleListItem( m_styles, itemData->name, l->at(itemData->defStyleNum), itemData );
+ }
+ }
+}
+
+void KateSchemaConfigHighlightTab::reload ()
+{
+ m_styles->clear ();
+ m_hlDict.clear ();
+
+ hlChanged (0);
+}
+
+void KateSchemaConfigHighlightTab::apply ()
+{
+ for ( QIntDictIterator< QIntDict<KateHlItemDataList> > it( m_hlDict ); it.current(); ++it )
+ for ( QIntDictIterator< KateHlItemDataList > it2( *it.current() ); it2.current(); ++it2 )
+ {
+ KateHlManager::self()->getHl( it2.currentKey() )->setKateHlItemDataList (it.currentKey(), *(it2.current()));
+ }
+}
+
+//END KateSchemaConfigHighlightTab
+
+//BEGIN KateSchemaConfigPage -- Main dialog page
+KateSchemaConfigPage::KateSchemaConfigPage( QWidget *parent, KateDocument *doc )
+ : KateConfigPage( parent ),
+ m_lastSchema (-1)
+{
+ QVBoxLayout *layout = new QVBoxLayout(this, 0, KDialog::spacingHint() );
+
+ QHBox *hbHl = new QHBox( this );
+ layout->add (hbHl);
+ hbHl->setSpacing( KDialog::spacingHint() );
+ QLabel *lHl = new QLabel( i18n("&Schema:"), hbHl );
+ schemaCombo = new QComboBox( false, hbHl );
+ lHl->setBuddy( schemaCombo );
+ connect( schemaCombo, SIGNAL(activated(int)),
+ this, SLOT(schemaChanged(int)) );
+
+ QPushButton *btnnew = new QPushButton( i18n("&New..."), hbHl );
+ connect( btnnew, SIGNAL(clicked()), this, SLOT(newSchema()) );
+
+ btndel = new QPushButton( i18n("&Delete"), hbHl );
+ connect( btndel, SIGNAL(clicked()), this, SLOT(deleteSchema()) );
+
+ m_tabWidget = new QTabWidget ( this );
+ m_tabWidget->setMargin (KDialog::marginHint());
+ layout->add (m_tabWidget);
+
+ connect (m_tabWidget, SIGNAL (currentChanged (QWidget *)), this, SLOT (newCurrentPage (QWidget *)));
+
+ m_colorTab = new KateSchemaConfigColorTab (m_tabWidget);
+ m_tabWidget->addTab (m_colorTab, i18n("Colors"));
+
+ m_fontTab = new KateSchemaConfigFontTab (m_tabWidget);
+ m_tabWidget->addTab (m_fontTab, i18n("Font"));
+
+ m_fontColorTab = new KateSchemaConfigFontColorTab (m_tabWidget);
+ m_tabWidget->addTab (m_fontColorTab, i18n("Normal Text Styles"));
+
+ uint hl = doc ? doc->hlMode() : 0;
+ m_highlightTab = new KateSchemaConfigHighlightTab (m_tabWidget, "", m_fontColorTab, hl );
+ m_tabWidget->addTab (m_highlightTab, i18n("Highlighting Text Styles"));
+
+ hbHl = new QHBox( this );
+ layout->add (hbHl);
+ hbHl->setSpacing( KDialog::spacingHint() );
+ lHl = new QLabel( i18n("&Default schema for %1:").arg(KApplication::kApplication()->aboutData()->programName ()), hbHl );
+ defaultSchemaCombo = new QComboBox( false, hbHl );
+ lHl->setBuddy( defaultSchemaCombo );
+
+
+ m_defaultSchema = (doc && doc->activeView()) ? doc->activeView()->renderer()->config()->schema() : KateRendererConfig::global()->schema();
+
+ reload();
+
+ connect( defaultSchemaCombo, SIGNAL(activated(int)),
+ this, SLOT(slotChanged()) );
+}
+
+KateSchemaConfigPage::~KateSchemaConfigPage ()
+{
+ // just reload config from disc
+ KateFactory::self()->schemaManager()->update ();
+}
+
+void KateSchemaConfigPage::apply()
+{
+ m_colorTab->apply();
+ m_fontTab->apply();
+ m_fontColorTab->apply ();
+ m_highlightTab->apply ();
+
+ // just sync the config
+ KateFactory::self()->schemaManager()->schema (0)->sync();
+
+ KateFactory::self()->schemaManager()->update ();
+
+ // clear all attributes
+ for (int i = 0; i < KateHlManager::self()->highlights(); ++i)
+ KateHlManager::self()->getHl (i)->clearAttributeArrays ();
+
+ // than reload the whole stuff
+ KateRendererConfig::global()->setSchema (defaultSchemaCombo->currentItem());
+ KateRendererConfig::global()->reloadSchema();
+
+ // sync the hl config for real
+ KateHlManager::self()->getKConfig()->sync ();
+}
+
+void KateSchemaConfigPage::reload()
+{
+ // just reload the config from disc
+ KateFactory::self()->schemaManager()->update ();
+
+ // special for the highlighting stuff
+ m_fontColorTab->reload ();
+
+ update ();
+
+ defaultSchemaCombo->setCurrentItem (KateRendererConfig::global()->schema());
+
+ // initialize to the schema in the current document, or default schema
+ schemaCombo->setCurrentItem( m_defaultSchema );
+ schemaChanged( m_defaultSchema );
+}
+
+void KateSchemaConfigPage::reset()
+{
+ reload ();
+}
+
+void KateSchemaConfigPage::defaults()
+{
+ reload ();
+}
+
+void KateSchemaConfigPage::update ()
+{
+ // soft update, no load from disk
+ KateFactory::self()->schemaManager()->update (false);
+
+ schemaCombo->clear ();
+ schemaCombo->insertStringList (KateFactory::self()->schemaManager()->list ());
+
+ defaultSchemaCombo->clear ();
+ defaultSchemaCombo->insertStringList (KateFactory::self()->schemaManager()->list ());
+
+ schemaCombo->setCurrentItem (0);
+ schemaChanged (0);
+
+ schemaCombo->setEnabled (schemaCombo->count() > 0);
+}
+
+void KateSchemaConfigPage::deleteSchema ()
+{
+ int t = schemaCombo->currentItem ();
+
+ KateFactory::self()->schemaManager()->removeSchema (t);
+
+ update ();
+}
+
+void KateSchemaConfigPage::newSchema ()
+{
+ QString t = KInputDialog::getText (i18n("Name for New Schema"), i18n ("Name:"), i18n("New Schema"), 0, this);
+
+ KateFactory::self()->schemaManager()->addSchema (t);
+
+ // soft update, no load from disk
+ KateFactory::self()->schemaManager()->update (false);
+ int i = KateFactory::self()->schemaManager()->list ().findIndex (t);
+
+ update ();
+ if (i > -1)
+ {
+ schemaCombo->setCurrentItem (i);
+ schemaChanged (i);
+ }
+}
+
+void KateSchemaConfigPage::schemaChanged (int schema)
+{
+ btndel->setEnabled( schema > 1 );
+
+ m_colorTab->schemaChanged( schema );
+ m_fontTab->schemaChanged( schema );
+ m_fontColorTab->schemaChanged (schema);
+ m_highlightTab->schemaChanged (schema);
+
+ m_lastSchema = schema;
+}
+
+void KateSchemaConfigPage::newCurrentPage (QWidget *w)
+{
+ if (w == m_highlightTab)
+ m_highlightTab->schemaChanged (m_lastSchema);
+}
+//END KateSchemaConfigPage
+
+//BEGIN SCHEMA ACTION -- the 'View->Schema' menu action
+void KateViewSchemaAction::init()
+{
+ m_view = 0;
+ last = 0;
+
+ connect(popupMenu(),SIGNAL(aboutToShow()),this,SLOT(slotAboutToShow()));
+}
+
+void KateViewSchemaAction::updateMenu (KateView *view)
+{
+ m_view = view;
+}
+
+void KateViewSchemaAction::slotAboutToShow()
+{
+ KateView *view=m_view;
+ int count = KateFactory::self()->schemaManager()->list().count();
+
+ for (int z=0; z<count; z++)
+ {
+ QString hlName = KateFactory::self()->schemaManager()->list().operator[](z);
+
+ if (names.contains(hlName) < 1)
+ {
+ names << hlName;
+ popupMenu()->insertItem ( hlName, this, SLOT(setSchema(int)), 0, z+1);
+ }
+ }
+
+ if (!view) return;
+
+ popupMenu()->setItemChecked (last, false);
+ popupMenu()->setItemChecked (view->renderer()->config()->schema()+1, true);
+
+ last = view->renderer()->config()->schema()+1;
+}
+
+void KateViewSchemaAction::setSchema (int mode)
+{
+ KateView *view=m_view;
+
+ if (view)
+ view->renderer()->config()->setSchema (mode-1);
+}
+//END SCHEMA ACTION
+
+//BEGIN KateStyleListView
+KateStyleListView::KateStyleListView( QWidget *parent, bool showUseDefaults )
+ : QListView( parent )
+{
+ setSorting( -1 ); // disable sorting, let the styles appear in their defined order
+ addColumn( i18n("Context") );
+ addColumn( SmallIconSet("text_bold"), QString::null );
+ addColumn( SmallIconSet("text_italic"), QString::null );
+ addColumn( SmallIconSet("text_under"), QString::null );
+ addColumn( SmallIconSet("text_strike"), QString::null );
+ addColumn( i18n("Normal") );
+ addColumn( i18n("Selected") );
+ addColumn( i18n("Background") );
+ addColumn( i18n("Background Selected") );
+ if ( showUseDefaults )
+ addColumn( i18n("Use Default Style") );
+ connect( this, SIGNAL(mouseButtonPressed(int, QListViewItem*, const QPoint&, int)),
+ this, SLOT(slotMousePressed(int, QListViewItem*, const QPoint&, int)) );
+ connect( this, SIGNAL(contextMenuRequested(QListViewItem*,const QPoint&, int)),
+ this, SLOT(showPopupMenu(QListViewItem*, const QPoint&)) );
+ // grap the bg color, selected color and default font
+ normalcol = KGlobalSettings::textColor();
+ bgcol = KateRendererConfig::global()->backgroundColor();
+ selcol = KateRendererConfig::global()->selectionColor();
+ docfont = *KateRendererConfig::global()->font();
+
+ viewport()->setPaletteBackgroundColor( bgcol );
+}
+
+void KateStyleListView::showPopupMenu( KateStyleListItem *i, const QPoint &globalPos, bool showtitle )
+{
+ if ( !dynamic_cast<KateStyleListItem*>(i) ) return;
+
+ KPopupMenu m( this );
+ KateAttribute *is = i->style();
+ int id;
+ // the title is used, because the menu obscures the context name when
+ // displayed on behalf of spacePressed().
+ QPixmap cl(16,16);
+ cl.fill( i->style()->textColor() );
+ QPixmap scl(16,16);
+ scl.fill( i->style()->selectedTextColor() );
+ QPixmap bgcl(16,16);
+ bgcl.fill( i->style()->itemSet(KateAttribute::BGColor) ? i->style()->bgColor() : viewport()->colorGroup().base() );
+ QPixmap sbgcl(16,16);
+ sbgcl.fill( i->style()->itemSet(KateAttribute::SelectedBGColor) ? i->style()->selectedBGColor() : viewport()->colorGroup().base() );
+
+ if ( showtitle )
+ m.insertTitle( i->contextName(), KateStyleListItem::ContextName );
+ id = m.insertItem( i18n("&Bold"), this, SLOT(mSlotPopupHandler(int)), 0, KateStyleListItem::Bold );
+ m.setItemChecked( id, is->bold() );
+ id = m.insertItem( i18n("&Italic"), this, SLOT(mSlotPopupHandler(int)), 0, KateStyleListItem::Italic );
+ m.setItemChecked( id, is->italic() );
+ id = m.insertItem( i18n("&Underline"), this, SLOT(mSlotPopupHandler(int)), 0, KateStyleListItem::Underline );
+ m.setItemChecked( id, is->underline() );
+ id = m.insertItem( i18n("S&trikeout"), this, SLOT(mSlotPopupHandler(int)), 0, KateStyleListItem::Strikeout );
+ m.setItemChecked( id, is->strikeOut() );
+
+ m.insertSeparator();
+
+ m.insertItem( QIconSet(cl), i18n("Normal &Color..."), this, SLOT(mSlotPopupHandler(int)), 0, KateStyleListItem::Color );
+ m.insertItem( QIconSet(scl), i18n("&Selected Color..."), this, SLOT(mSlotPopupHandler(int)), 0, KateStyleListItem::SelColor );
+ m.insertItem( QIconSet(bgcl), i18n("&Background Color..."), this, SLOT(mSlotPopupHandler(int)), 0, KateStyleListItem::BgColor );
+ m.insertItem( QIconSet(sbgcl), i18n("S&elected Background Color..."), this, SLOT(mSlotPopupHandler(int)), 0, KateStyleListItem::SelBgColor );
+
+ // Unset [some] colors. I could show one only if that button was clicked, but that
+ // would disable setting this with the keyboard (how many aren't doing just
+ // that every day? ;)
+ // ANY ideas for doing this in a nicer way will be warmly wellcomed.
+ KateAttribute *style = i->style();
+ if ( style->itemSet( KateAttribute::BGColor) || style->itemSet( KateAttribute::SelectedBGColor ) )
+ {
+ m.insertSeparator();
+ if ( style->itemSet( KateAttribute::BGColor) )
+ m.insertItem( i18n("Unset Background Color"), this, SLOT(unsetColor(int)), 0, 100 );
+ if ( style->itemSet( KateAttribute::SelectedBGColor ) )
+ m.insertItem( i18n("Unset Selected Background Color"), this, SLOT(unsetColor(int)), 0, 101 );
+ }
+
+ if ( ! i->isDefault() && ! i->defStyle() ) {
+ m.insertSeparator();
+ id = m.insertItem( i18n("Use &Default Style"), this, SLOT(mSlotPopupHandler(int)), 0, KateStyleListItem::UseDefStyle );
+ m.setItemChecked( id, i->defStyle() );
+ }
+ m.exec( globalPos );
+}
+
+void KateStyleListView::showPopupMenu( QListViewItem *i, const QPoint &pos )
+{
+ if ( dynamic_cast<KateStyleListItem*>(i) )
+ showPopupMenu( (KateStyleListItem*)i, pos, true );
+}
+
+void KateStyleListView::mSlotPopupHandler( int z )
+{
+ ((KateStyleListItem*)currentItem())->changeProperty( (KateStyleListItem::Property)z );
+}
+
+void KateStyleListView::unsetColor( int c )
+{
+ ((KateStyleListItem*)currentItem())->unsetColor( c );
+ emitChanged();
+}
+
+// Because QListViewItem::activatePos() is going to become deprecated,
+// and also because this attempt offers more control, I connect mousePressed to this.
+void KateStyleListView::slotMousePressed(int btn, QListViewItem* i, const QPoint& pos, int c)
+{
+ if ( dynamic_cast<KateStyleListItem*>(i) ) {
+ if ( btn == Qt::LeftButton && c > 0 ) {
+ // map pos to item/column and call KateStyleListItem::activate(col, pos)
+ ((KateStyleListItem*)i)->activate( c, viewport()->mapFromGlobal( pos ) - QPoint( 0, itemRect(i).top() ) );
+ }
+ }
+}
+
+//END
+
+//BEGIN KateStyleListItem
+static const int BoxSize = 16;
+static const int ColorBtnWidth = 32;
+
+KateStyleListItem::KateStyleListItem( QListViewItem *parent, const QString & stylename,
+ KateAttribute *style, KateHlItemData *data )
+ : QListViewItem( parent, stylename ),
+ ds( style ),
+ st( data )
+{
+ initStyle();
+}
+
+KateStyleListItem::KateStyleListItem( QListView *parent, const QString & stylename,
+ KateAttribute *style, KateHlItemData *data )
+ : QListViewItem( parent, stylename ),
+ ds( style ),
+ st( data )
+{
+ initStyle();
+}
+
+void KateStyleListItem::initStyle()
+{
+ if (!st)
+ is = ds;
+ else
+ {
+ is = new KateAttribute (*ds);
+
+ if (st->isSomethingSet())
+ *is += *st;
+ }
+}
+
+void KateStyleListItem::updateStyle()
+{
+ // nothing there, not update it, will crash
+ if (!st)
+ return;
+
+ if ( is->itemSet(KateAttribute::Weight) )
+ {
+ if ( is->weight() != st->weight())
+ st->setWeight( is->weight() );
+ }
+ else st->clearAttribute( KateAttribute::Weight );
+
+ if ( is->itemSet(KateAttribute::Italic) )
+ {
+ if ( is->italic() != st->italic())
+ st->setItalic( is->italic() );
+ }
+ else st->clearAttribute( KateAttribute::Italic );
+
+ if ( is->itemSet(KateAttribute::StrikeOut) )
+ {
+ if ( is->strikeOut() != st->strikeOut())
+
+ st->setStrikeOut( is->strikeOut() );
+ }
+ else st->clearAttribute( KateAttribute::StrikeOut );
+
+ if ( is->itemSet(KateAttribute::Underline) )
+ {
+ if ( is->underline() != st->underline())
+ st->setUnderline( is->underline() );
+ }
+ else st->clearAttribute( KateAttribute::Underline );
+
+ if ( is->itemSet(KateAttribute::Outline) )
+ {
+ if ( is->outline() != st->outline())
+ st->setOutline( is->outline() );
+ }
+ else st->clearAttribute( KateAttribute::Outline );
+
+ if ( is->itemSet(KateAttribute::TextColor) )
+ {
+ if ( is->textColor() != st->textColor())
+ st->setTextColor( is->textColor() );
+ }
+ else st->clearAttribute( KateAttribute::TextColor );
+
+ if ( is->itemSet(KateAttribute::SelectedTextColor) )
+ {
+ if ( is->selectedTextColor() != st->selectedTextColor())
+ st->setSelectedTextColor( is->selectedTextColor() );
+ }
+ else st->clearAttribute( KateAttribute::SelectedTextColor);
+
+ if ( is->itemSet(KateAttribute::BGColor) )
+ {
+ if ( is->bgColor() != st->bgColor())
+ st->setBGColor( is->bgColor() );
+ }
+ else st->clearAttribute( KateAttribute::BGColor );
+
+ if ( is->itemSet(KateAttribute::SelectedBGColor) )
+ {
+ if ( is->selectedBGColor() != st->selectedBGColor())
+ st->setSelectedBGColor( is->selectedBGColor() );
+ }
+ else st->clearAttribute( KateAttribute::SelectedBGColor );
+}
+
+/* only true for a hl mode item using it's default style */
+bool KateStyleListItem::defStyle() { return st && st->itemsSet() != ds->itemsSet(); }
+
+/* true for default styles */
+bool KateStyleListItem::isDefault() { return st ? false : true; }
+
+int KateStyleListItem::width( const QFontMetrics & /*fm*/, const QListView * lv, int col ) const
+{
+ int m = lv->itemMargin() * 2;
+ switch ( col ) {
+ case ContextName:
+ // FIXME: width for name column should reflect bold/italic
+ // (relevant for non-fixed fonts only - nessecary?)
+ return QListViewItem::width( QFontMetrics( ((KateStyleListView*)lv)->docfont), lv, col);
+ case Bold:
+ case Italic:
+ case UseDefStyle:
+ return BoxSize + m;
+ case Color:
+ case SelColor:
+ case BgColor:
+ case SelBgColor:
+ return ColorBtnWidth +m;
+ default:
+ return 0;
+ }
+}
+
+void KateStyleListItem::activate( int column, const QPoint &localPos )
+{
+ QListView *lv = listView();
+ int x = 0;
+ for( int c = 0; c < column-1; c++ )
+ x += lv->columnWidth( c );
+ int w;
+ switch( column ) {
+ case Bold:
+ case Italic:
+ case Underline:
+ case Strikeout:
+ case UseDefStyle:
+ w = BoxSize;
+ break;
+ case Color:
+ case SelColor:
+ case BgColor:
+ case SelBgColor:
+ w = ColorBtnWidth;
+ break;
+ default:
+ return;
+ }
+ if ( !QRect( x, 0, w, BoxSize ).contains( localPos ) )
+ changeProperty( (Property)column );
+}
+
+void KateStyleListItem::changeProperty( Property p )
+{
+ if ( p == Bold )
+ is->setBold( ! is->bold() );
+ else if ( p == Italic )
+ is->setItalic( ! is->italic() );
+ else if ( p == Underline )
+ is->setUnderline( ! is->underline() );
+ else if ( p == Strikeout )
+ is->setStrikeOut( ! is->strikeOut() );
+ else if ( p == UseDefStyle )
+ toggleDefStyle();
+ else
+ setColor( p );
+
+ updateStyle ();
+
+ ((KateStyleListView*)listView())->emitChanged();
+}
+
+void KateStyleListItem::toggleDefStyle()
+{
+ if ( *is == *ds ) {
+ KMessageBox::information( listView(),
+ i18n("\"Use Default Style\" will be automatically unset when you change any style properties."),
+ i18n("Kate Styles"),
+ "Kate hl config use defaults" );
+ }
+ else {
+ delete is;
+ is = new KateAttribute( *ds );
+ updateStyle();
+ repaint();
+ }
+}
+
+void KateStyleListItem::setColor( int column )
+{
+ QColor c; // use this
+ QColor d; // default color
+ if ( column == Color)
+ {
+ c = is->textColor();
+ d = ds->textColor();
+ }
+ else if ( column == SelColor )
+ {
+ c = is->selectedTextColor();
+ d = is->selectedTextColor();
+ }
+ else if ( column == BgColor )
+ {
+ c = is->bgColor();
+ d = ds->bgColor();
+ }
+ else if ( column == SelBgColor )
+ {
+ c = is->selectedBGColor();
+ d = ds->selectedBGColor();
+ }
+
+ if ( KColorDialog::getColor( c, d, listView() ) != QDialog::Accepted) return;
+
+ bool def = ! c.isValid();
+
+ // if set default, and the attrib is set in the default style use it
+ // else if set default, unset it
+ // else set the selected color
+ switch (column)
+ {
+ case Color:
+ if ( def )
+ {
+ if ( ds->itemSet(KateAttribute::TextColor) )
+ is->setTextColor( ds->textColor());
+ else
+ is->clearAttribute(KateAttribute::TextColor);
+ }
+ else
+ is->setTextColor( c );
+ break;
+ case SelColor:
+ if ( def )
+ {
+ if ( ds->itemSet(KateAttribute::SelectedTextColor) )
+ is->setSelectedTextColor( ds->selectedTextColor());
+ else
+ is->clearAttribute(KateAttribute::SelectedTextColor);
+ }
+ else
+ is->setSelectedTextColor( c );
+ break;
+ case BgColor:
+ if ( def )
+ {
+ if ( ds->itemSet(KateAttribute::BGColor) )
+ is->setBGColor( ds->bgColor());
+ else
+ is->clearAttribute(KateAttribute::BGColor);
+ }
+ else
+ is->setBGColor( c );
+ break;
+ case SelBgColor:
+ if ( def )
+ {
+ if ( ds->itemSet(KateAttribute::SelectedBGColor) )
+ is->setSelectedBGColor( ds->selectedBGColor());
+ else
+ is->clearAttribute(KateAttribute::SelectedBGColor);
+ }
+ else
+ is->setSelectedBGColor( c );
+ break;
+ }
+
+ repaint();
+}
+
+void KateStyleListItem::unsetColor( int c )
+{
+ if ( c == 100 && is->itemSet(KateAttribute::BGColor) )
+ is->clearAttribute(KateAttribute::BGColor);
+ else if ( c == 101 && is->itemSet(KateAttribute::SelectedBGColor) )
+ is->clearAttribute(KateAttribute::SelectedBGColor);
+ updateStyle();
+}
+
+void KateStyleListItem::paintCell( QPainter *p, const QColorGroup& /*cg*/, int col, int width, int align )
+{
+
+ if ( !p )
+ return;
+
+ QListView *lv = listView();
+ if ( !lv )
+ return;
+ Q_ASSERT( lv ); //###
+
+ // use a private color group and set the text/highlighted text colors
+ QColorGroup mcg = lv->viewport()->colorGroup();
+
+ if ( col ) // col 0 is drawn by the superclass method
+ p->fillRect( 0, 0, width, height(), QBrush( mcg.base() ) );
+
+ int marg = lv->itemMargin();
+
+ QColor c;
+
+ switch ( col )
+ {
+ case ContextName:
+ {
+ mcg.setColor(QColorGroup::Text, is->textColor());
+ mcg.setColor(QColorGroup::HighlightedText, is->selectedTextColor());
+ // text background color
+ c = is->bgColor();
+ if ( c.isValid() && is->itemSet(KateAttribute::BGColor) )
+ mcg.setColor( QColorGroup::Base, c );
+ if ( isSelected() && is->itemSet(KateAttribute::SelectedBGColor) )
+ {
+ c = is->selectedBGColor();
+ if ( c.isValid() )
+ mcg.setColor( QColorGroup::Highlight, c );
+ }
+ QFont f ( ((KateStyleListView*)lv)->docfont );
+ p->setFont( is->font(f) );
+ // FIXME - repainting when text is cropped, and the column is enlarged is buggy.
+ // Maybe I need painting the string myself :(
+ // (wilbert) it depends on the font used
+ QListViewItem::paintCell( p, mcg, col, width, align );
+ }
+ break;
+ case Bold:
+ case Italic:
+ case Underline:
+ case Strikeout:
+ case UseDefStyle:
+ {
+ // Bold/Italic/use default checkboxes
+ // code allmost identical to QCheckListItem
+ int x = 0;
+ int y = (height() - BoxSize) / 2;
+
+ if ( isEnabled() )
+ p->setPen( QPen( mcg.text(), 2 ) );
+ else
+ p->setPen( QPen( lv->palette().color( QPalette::Disabled, QColorGroup::Text ), 2 ) );
+
+ p->drawRect( x+marg, y+2, BoxSize-4, BoxSize-4 );
+ x++;
+ y++;
+ if ( (col == Bold && is->bold()) ||
+ (col == Italic && is->italic()) ||
+ (col == Underline && is->underline()) ||
+ (col == Strikeout && is->strikeOut()) ||
+ (col == UseDefStyle && *is == *ds ) )
+ {
+ QPointArray a( 7*2 );
+ int i, xx, yy;
+ xx = x+1+marg;
+ yy = y+5;
+ for ( i=0; i<3; i++ ) {
+ a.setPoint( 2*i, xx, yy );
+ a.setPoint( 2*i+1, xx, yy+2 );
+ xx++; yy++;
+ }
+ yy -= 2;
+ for ( i=3; i<7; i++ ) {
+ a.setPoint( 2*i, xx, yy );
+ a.setPoint( 2*i+1, xx, yy+2 );
+ xx++; yy--;
+ }
+ p->drawLineSegments( a );
+ }
+ }
+ break;
+ case Color:
+ case SelColor:
+ case BgColor:
+ case SelBgColor:
+ {
+ bool set( false );
+ if ( col == Color)
+ {
+ c = is->textColor();
+ set = is->itemSet(KateAttribute::TextColor);
+ }
+ else if ( col == SelColor )
+ {
+ c = is->selectedTextColor();
+ set = is->itemSet( KateAttribute::SelectedTextColor);
+ }
+ else if ( col == BgColor )
+ {
+ set = is->itemSet(KateAttribute::BGColor);
+ c = set ? is->bgColor() : mcg.base();
+ }
+ else if ( col == SelBgColor )
+ {
+ set = is->itemSet(KateAttribute::SelectedBGColor);
+ c = set ? is->selectedBGColor(): mcg.base();
+ }
+
+ // color "buttons"
+ int x = 0;
+ int y = (height() - BoxSize) / 2;
+ if ( isEnabled() )
+ p->setPen( QPen( mcg.text(), 2 ) );
+ else
+ p->setPen( QPen( lv->palette().color( QPalette::Disabled, QColorGroup::Text ), 2 ) );
+
+ p->drawRect( x+marg, y+2, ColorBtnWidth-4, BoxSize-4 );
+ p->fillRect( x+marg+1,y+3,ColorBtnWidth-7,BoxSize-7,QBrush( c ) );
+ // if this item is unset, draw a diagonal line over the button
+ if ( ! set )
+ p->drawLine( x+marg-1, BoxSize-3, ColorBtnWidth-4, y+1 );
+ }
+ //case default: // no warning...
+ }
+}
+//END
+
+//BEGIN KateStyleListCaption
+KateStyleListCaption::KateStyleListCaption( QListView *parent, const QString & name )
+ : QListViewItem( parent, name )
+{
+}
+
+void KateStyleListCaption::paintCell( QPainter *p, const QColorGroup& /*cg*/, int col, int width, int align )
+{
+ QListView *lv = listView();
+ if ( !lv )
+ return;
+ Q_ASSERT( lv ); //###
+
+ // use the same colorgroup as the other items in the viewport
+ QColorGroup mcg = lv->viewport()->colorGroup();
+
+ QListViewItem::paintCell( p, mcg, col, width, align );
+}
+//END
+
+// kate: space-indent on; indent-width 2; replace-tabs on;
diff --git a/kate/part/kateschema.h b/kate/part/kateschema.h
new file mode 100644
index 000000000..917530fcc
--- /dev/null
+++ b/kate/part/kateschema.h
@@ -0,0 +1,323 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2001-2003 Christoph Cullmann <cullmann@kde.org>
+ Copyright (C) 2002, 2003 Anders Lund <anders.lund@lund.tdcadsl.dk>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef __KATE_SCHEMA_H__
+#define __KATE_SCHEMA_H__
+
+#include "katehighlight.h"
+#include "katedialogs.h"
+
+#include <qstringlist.h>
+#include <qintdict.h>
+#include <qmap.h>
+#include <qlistview.h>
+#include <qfont.h>
+
+#include <kconfig.h>
+#include <kaction.h>
+
+class KateView;
+class KateStyleListItem;
+class KateStyleListCaption;
+
+class KColorButton;
+
+class QPopupMenu;
+class KComboBox;
+
+class KateSchemaManager
+{
+ public:
+ KateSchemaManager ();
+ ~KateSchemaManager ();
+
+ /**
+ * Schema Config changed, update all renderers
+ */
+ void update (bool readfromfile = true);
+
+ /**
+ * return kconfig with right group set or set to Normal if not there
+ */
+ KConfig *schema (uint number);
+
+ void addSchema (const QString &t);
+
+ void removeSchema (uint number);
+
+ /**
+ * is this schema valid ? (does it exist ?)
+ */
+ bool validSchema (uint number);
+
+ /**
+ * if not found, defaults to 0
+ */
+ uint number (const QString &name);
+
+ /**
+ * group names in the end, no i18n involved
+ */
+ QString name (uint number);
+
+ /**
+ * Don't modify, list with the names of the schemas (i18n name for the default ones)
+ */
+ const QStringList &list () { return m_schemas; }
+
+ static QString normalSchema ();
+ static QString printingSchema ();
+
+ private:
+ KConfig m_config;
+ QStringList m_schemas;
+};
+
+
+class KateViewSchemaAction : public KActionMenu
+{
+ Q_OBJECT
+
+ public:
+ KateViewSchemaAction(const QString& text, QObject* parent = 0, const char* name = 0)
+ : KActionMenu(text, parent, name) { init(); };
+
+ ~KateViewSchemaAction(){;};
+
+ void updateMenu (KateView *view);
+
+ private:
+ void init();
+
+ QGuardedPtr<KateView> m_view;
+ QStringList names;
+ int last;
+
+ public slots:
+ void slotAboutToShow();
+
+ private slots:
+ void setSchema (int mode);
+};
+
+//
+// DIALOGS
+//
+
+/*
+ QListView that automatically adds columns for KateStyleListItems and provides a
+ popup menu and a slot to edit a style using the keyboard.
+ Added by anders, jan 23 2002.
+*/
+class KateStyleListView : public QListView
+{
+ Q_OBJECT
+
+ friend class KateStyleListItem;
+
+ public:
+ KateStyleListView( QWidget *parent=0, bool showUseDefaults=false);
+ ~KateStyleListView() {};
+ /* Display a popupmenu for item i at the specified global position, eventually with a title,
+ promoting the context name of that item */
+ void showPopupMenu( KateStyleListItem *i, const QPoint &globalPos, bool showtitle=false );
+ void emitChanged() { emit changed(); };
+
+ void setBgCol( const QColor &c ) { bgcol = c; }
+ void setSelCol( const QColor &c ) { selcol = c; }
+ void setNormalCol( const QColor &c ) { normalcol = c; }
+
+ private slots:
+ /* Display a popupmenu for item i at item position */
+ void showPopupMenu( QListViewItem *i, const QPoint &globalPos );
+ /* call item to change a property, or display a menu */
+ void slotMousePressed( int, QListViewItem*, const QPoint&, int );
+ /* asks item to change the property in q */
+ void mSlotPopupHandler( int z );
+ void unsetColor( int );
+
+ signals:
+ void changed();
+
+ private:
+ QColor bgcol, selcol, normalcol;
+ QFont docfont;
+};
+
+class KateSchemaConfigColorTab : public QWidget
+{
+ Q_OBJECT
+
+ public:
+ KateSchemaConfigColorTab( QWidget *parent = 0, const char *name = 0 );
+ ~KateSchemaConfigColorTab();
+
+ private:
+ KColorButton *m_back;
+ KColorButton *m_selected;
+ KColorButton *m_current;
+ KColorButton *m_bracket;
+ KColorButton *m_wwmarker;
+ KColorButton *m_iconborder;
+ KColorButton *m_tmarker;
+ KColorButton *m_linenumber;
+
+ KColorButton *m_markers; // bg color for current selected marker
+ KComboBox* m_combobox; // switch marker type
+
+ // Class for storing the properties on 1 schema.
+ class SchemaColors {
+ public:
+ QColor back, selected, current, bracket, wwmarker, iconborder, tmarker, linenumber;
+ QMap<int, QColor> markerColors; // stores all markerColors
+ };
+
+ // schemaid=data, created when a schema is entered
+ QMap<int,SchemaColors> m_schemas;
+ // current schema
+ int m_schema;
+
+ public slots:
+ void apply();
+ void schemaChanged( int newSchema );
+
+ signals:
+ void changed(); // connected to parentWidget()->parentWidget() SLOT(slotChanged)
+
+ protected slots:
+ void slotMarkerColorChanged(const QColor&);
+ void slotComboBoxChanged(int index);
+};
+
+typedef QMap<int,QFont> FontMap; // ### remove it
+
+class KateSchemaConfigFontTab : public QWidget
+{
+ Q_OBJECT
+
+ public:
+ KateSchemaConfigFontTab( QWidget *parent = 0, const char *name = 0 );
+ ~KateSchemaConfigFontTab();
+
+ public:
+ void readConfig (KConfig *config);
+
+ public slots:
+ void apply();
+ void schemaChanged( int newSchema );
+
+ signals:
+ void changed(); // connected to parentWidget()->parentWidget() SLOT(slotChanged)
+
+ private:
+ class KFontChooser *m_fontchooser;
+ FontMap m_fonts;
+ int m_schema;
+
+ private slots:
+ void slotFontSelected( const QFont &font );
+};
+
+class KateSchemaConfigFontColorTab : public QWidget
+{
+ Q_OBJECT
+
+ public:
+ KateSchemaConfigFontColorTab( QWidget *parent = 0, const char *name = 0 );
+ ~KateSchemaConfigFontColorTab();
+
+ public:
+ void schemaChanged (uint schema);
+ void reload ();
+ void apply ();
+
+ KateAttributeList *attributeList (uint schema);
+
+ private:
+ KateStyleListView *m_defaultStyles;
+ QIntDict<KateAttributeList> m_defaultStyleLists;
+};
+
+class KateSchemaConfigHighlightTab : public QWidget
+{
+ Q_OBJECT
+
+ public:
+ KateSchemaConfigHighlightTab( QWidget *parent = 0, const char *name = 0, KateSchemaConfigFontColorTab *page = 0, uint hl = 0 );
+ ~KateSchemaConfigHighlightTab();
+
+ public:
+ void schemaChanged (uint schema);
+ void reload ();
+ void apply ();
+
+ protected slots:
+ void hlChanged(int z);
+
+ private:
+ KateSchemaConfigFontColorTab *m_defaults;
+
+ QComboBox *hlCombo;
+ KateStyleListView *m_styles;
+
+ uint m_schema;
+ int m_hl;
+
+ QIntDict< QIntDict<KateHlItemDataList> > m_hlDict;
+};
+
+class KateSchemaConfigPage : public KateConfigPage
+{
+ Q_OBJECT
+
+ public:
+ KateSchemaConfigPage ( QWidget *parent, class KateDocument *doc=0 );
+ ~KateSchemaConfigPage ();
+
+ public slots:
+ void apply();
+ void reload();
+ void reset();
+ void defaults();
+
+ private slots:
+ void update ();
+ void deleteSchema ();
+ void newSchema ();
+ void schemaChanged (int schema);
+
+ void newCurrentPage (QWidget *w);
+
+ private:
+ int m_lastSchema;
+ int m_defaultSchema;
+
+ class QTabWidget *m_tabWidget;
+ class QPushButton *btndel;
+ class QComboBox *defaultSchemaCombo;
+ class QComboBox *schemaCombo;
+ KateSchemaConfigColorTab *m_colorTab;
+ KateSchemaConfigFontTab *m_fontTab;
+ KateSchemaConfigFontColorTab *m_fontColorTab;
+ KateSchemaConfigHighlightTab *m_highlightTab;
+};
+
+#endif
+
+// kate: space-indent on; indent-width 2; replace-tabs on;
diff --git a/kate/part/katesearch.cpp b/kate/part/katesearch.cpp
new file mode 100644
index 000000000..8f4911137
--- /dev/null
+++ b/kate/part/katesearch.cpp
@@ -0,0 +1,1012 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2004-2005 Anders Lund <anders@alweb.dk>
+ Copyright (C) 2003 Clarence Dang <dang@kde.org>
+ Copyright (C) 2002 John Firebaugh <jfirebaugh@kde.org>
+ Copyright (C) 2001-2004 Christoph Cullmann <cullmann@kde.org>
+ Copyright (C) 2001 Joseph Wenninger <jowenn@kde.org>
+ Copyright (C) 1999 Jochen Wilhelmy <digisnap@cs.tu-berlin.de>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "katesearch.h"
+#include "katesearch.moc"
+
+#include "kateview.h"
+#include "katedocument.h"
+#include "katesupercursor.h"
+#include "katearbitraryhighlight.h"
+#include "kateconfig.h"
+#include "katehighlight.h"
+
+#include <klocale.h>
+#include <kstdaction.h>
+#include <kmessagebox.h>
+#include <kstringhandler.h>
+#include <kdebug.h>
+#include <kfinddialog.h>
+#include <kreplacedialog.h>
+#include <kpushbutton.h>
+
+#include <qlayout.h>
+#include <qlabel.h>
+
+//BEGIN KateSearch
+QStringList KateSearch::s_searchList = QStringList();
+QStringList KateSearch::s_replaceList = QStringList();
+QString KateSearch::s_pattern = QString();
+static const bool arbitraryHLExample = false;
+
+KateSearch::KateSearch( KateView* view )
+ : QObject( view, "kate search" )
+ , m_view( view )
+ , m_doc( view->doc() )
+ , replacePrompt( new KateReplacePrompt( view ) )
+{
+ m_arbitraryHLList = new KateSuperRangeList();
+ if (arbitraryHLExample) m_doc->arbitraryHL()->addHighlightToView(m_arbitraryHLList, m_view);
+
+ connect(replacePrompt,SIGNAL(clicked()),this,SLOT(replaceSlot()));
+}
+
+KateSearch::~KateSearch()
+{
+ delete m_arbitraryHLList;
+}
+
+void KateSearch::createActions( KActionCollection* ac )
+{
+ KStdAction::find( this, SLOT(find()), ac )->setWhatsThis(
+ i18n("Look up the first occurrence of a piece of text or regular expression."));
+ KStdAction::findNext( this, SLOT(slotFindNext()), ac )->setWhatsThis(
+ i18n("Look up the next occurrence of the search phrase."));
+ KStdAction::findPrev( this, SLOT(slotFindPrev()), ac, "edit_find_prev" )->setWhatsThis(
+ i18n("Look up the previous occurrence of the search phrase."));
+ KStdAction::replace( this, SLOT(replace()), ac )->setWhatsThis(
+ i18n("Look up a piece of text or regular expression and replace the result with some given text."));
+}
+
+void KateSearch::addToList( QStringList& list, const QString& s )
+{
+ if( list.count() > 0 ) {
+ QStringList::Iterator it = list.find( s );
+ if( *it != 0L )
+ list.remove( it );
+ if( list.count() >= 16 )
+ list.remove( list.fromLast() );
+ }
+ list.prepend( s );
+}
+
+void KateSearch::find()
+{
+ // if multiline selection around, search in it
+ long searchf = KateViewConfig::global()->searchFlags();
+ if (m_view->hasSelection() && m_view->selStartLine() != m_view->selEndLine())
+ searchf |= KFindDialog::SelectedText;
+
+ KFindDialog *findDialog = new KFindDialog ( m_view, "", searchf,
+ s_searchList, m_view->hasSelection() );
+
+ findDialog->setPattern (getSearchText());
+
+
+ if( findDialog->exec() == QDialog::Accepted ) {
+ s_searchList = findDialog->findHistory () ;
+ // Do *not* remove the QString() wrapping, it fixes a nasty crash
+ find( QString(s_searchList.first()), findDialog->options(), true, true );
+ }
+
+ delete findDialog;
+ m_view->repaintText ();
+}
+
+void KateSearch::find( const QString &pattern, long flags, bool add, bool shownotfound )
+{
+ KateViewConfig::global()->setSearchFlags( flags );
+ if( add )
+ addToList( s_searchList, pattern );
+
+ s_pattern = pattern;
+
+ SearchFlags searchFlags;
+
+ searchFlags.caseSensitive = KateViewConfig::global()->searchFlags() & KFindDialog::CaseSensitive;
+ searchFlags.wholeWords = KateViewConfig::global()->searchFlags() & KFindDialog::WholeWordsOnly;
+ searchFlags.fromBeginning = !(KateViewConfig::global()->searchFlags() & KFindDialog::FromCursor)
+ && !(KateViewConfig::global()->searchFlags() & KFindDialog::SelectedText);
+ searchFlags.backward = KateViewConfig::global()->searchFlags() & KFindDialog::FindBackwards;
+ searchFlags.selected = KateViewConfig::global()->searchFlags() & KFindDialog::SelectedText;
+ searchFlags.prompt = false;
+ searchFlags.replace = false;
+ searchFlags.finished = false;
+ searchFlags.regExp = KateViewConfig::global()->searchFlags() & KFindDialog::RegularExpression;
+ searchFlags.useBackRefs = KateViewConfig::global()->searchFlags() & KReplaceDialog::BackReference;
+
+ if ( searchFlags.selected )
+ {
+ s.selBegin = KateTextCursor( m_view->selStartLine(), m_view->selStartCol() );
+ s.selEnd = KateTextCursor( m_view->selEndLine(), m_view->selEndCol() );
+ s.cursor = s.flags.backward ? s.selEnd : s.selBegin;
+ } else {
+ s.cursor = getCursor( searchFlags );
+ }
+
+ s.wrappedEnd = s.cursor;
+ s.wrapped = false;
+ s.showNotFound = shownotfound;
+
+ search( searchFlags );
+}
+
+void KateSearch::replace()
+{
+ if (!doc()->isReadWrite()) return;
+
+ // if multiline selection around, search in it
+ long searchf = KateViewConfig::global()->searchFlags();
+ if (m_view->hasSelection() && m_view->selStartLine() != m_view->selEndLine())
+ searchf |= KFindDialog::SelectedText;
+
+ KReplaceDialog *replaceDialog = new KReplaceDialog ( m_view, "", searchf,
+ s_searchList, s_replaceList, m_view->hasSelection() );
+
+ replaceDialog->setPattern (getSearchText());
+
+ if( replaceDialog->exec() == QDialog::Accepted ) {
+ long opts = replaceDialog->options();
+ m_replacement = replaceDialog->replacement();
+ s_searchList = replaceDialog->findHistory () ;
+ s_replaceList = replaceDialog->replacementHistory () ;
+
+ // Do *not* remove the QString() wrapping, it fixes a nasty crash
+ replace( QString(s_searchList.first()), m_replacement, opts );
+ }
+
+ delete replaceDialog;
+ m_view->update ();
+}
+
+void KateSearch::replace( const QString& pattern, const QString &replacement, long flags )
+{
+ if (!doc()->isReadWrite()) return;
+
+ addToList( s_searchList, pattern );
+ s_pattern = pattern;
+ addToList( s_replaceList, replacement );
+ m_replacement = replacement;
+ KateViewConfig::global()->setSearchFlags( flags );
+
+ SearchFlags searchFlags;
+ searchFlags.caseSensitive = KateViewConfig::global()->searchFlags() & KFindDialog::CaseSensitive;
+ searchFlags.wholeWords = KateViewConfig::global()->searchFlags() & KFindDialog::WholeWordsOnly;
+ searchFlags.fromBeginning = !(KateViewConfig::global()->searchFlags() & KFindDialog::FromCursor)
+ && !(KateViewConfig::global()->searchFlags() & KFindDialog::SelectedText);
+ searchFlags.backward = KateViewConfig::global()->searchFlags() & KFindDialog::FindBackwards;
+ searchFlags.selected = KateViewConfig::global()->searchFlags() & KFindDialog::SelectedText;
+ searchFlags.prompt = KateViewConfig::global()->searchFlags() & KReplaceDialog::PromptOnReplace;
+ searchFlags.replace = true;
+ searchFlags.finished = false;
+ searchFlags.regExp = KateViewConfig::global()->searchFlags() & KFindDialog::RegularExpression;
+ searchFlags.useBackRefs = KateViewConfig::global()->searchFlags() & KReplaceDialog::BackReference;
+ if ( searchFlags.selected )
+ {
+ s.selBegin = KateTextCursor( m_view->selStartLine(), m_view->selStartCol() );
+ s.selEnd = KateTextCursor( m_view->selEndLine(), m_view->selEndCol() );
+ s.cursor = s.flags.backward ? s.selEnd : s.selBegin;
+ } else {
+ s.cursor = getCursor( searchFlags );
+ }
+
+ s.wrappedEnd = s.cursor;
+ s.wrapped = false;
+
+ search( searchFlags );
+}
+
+void KateSearch::findAgain( bool reverseDirection )
+{
+ SearchFlags searchFlags;
+ searchFlags.caseSensitive = KateViewConfig::global()->searchFlags() & KFindDialog::CaseSensitive;
+ searchFlags.wholeWords = KateViewConfig::global()->searchFlags() & KFindDialog::WholeWordsOnly;
+ searchFlags.fromBeginning = !(KateViewConfig::global()->searchFlags() & KFindDialog::FromCursor)
+ && !(KateViewConfig::global()->searchFlags() & KFindDialog::SelectedText);
+ searchFlags.backward = KateViewConfig::global()->searchFlags() & KFindDialog::FindBackwards;
+ searchFlags.selected = KateViewConfig::global()->searchFlags() & KFindDialog::SelectedText;
+ searchFlags.prompt = KateViewConfig::global()->searchFlags() & KReplaceDialog::PromptOnReplace;
+ searchFlags.replace = false;
+ searchFlags.finished = false;
+ searchFlags.regExp = KateViewConfig::global()->searchFlags() & KFindDialog::RegularExpression;
+ searchFlags.useBackRefs = KateViewConfig::global()->searchFlags() & KReplaceDialog::BackReference;
+
+ if (reverseDirection)
+ searchFlags.backward = !searchFlags.backward;
+
+ searchFlags.fromBeginning = false;
+ searchFlags.prompt = true; // ### why is the above assignment there?
+
+ s.cursor = getCursor( searchFlags );
+ search( searchFlags );
+}
+
+void KateSearch::search( SearchFlags flags )
+{
+ s.flags = flags;
+
+ if( s.flags.fromBeginning ) {
+ if( !s.flags.backward ) {
+ s.cursor.setPos(0, 0);
+ } else {
+ s.cursor.setLine(doc()->numLines() - 1);
+ s.cursor.setCol(doc()->lineLength( s.cursor.line() ));
+ }
+ }
+
+ if((!s.flags.backward &&
+ s.cursor.col() == 0 &&
+ s.cursor.line() == 0 ) ||
+ ( s.flags.backward &&
+ s.cursor.col() == doc()->lineLength( s.cursor.line() ) &&
+ s.cursor.line() == (((int)doc()->numLines()) - 1) ) ) {
+ s.flags.finished = true;
+ }
+
+ if( s.flags.replace ) {
+ replaces = 0;
+ if( s.flags.prompt )
+ promptReplace();
+ else
+ replaceAll();
+ } else {
+ findAgain();
+ }
+}
+
+void KateSearch::wrapSearch()
+{
+ if( s.flags.selected )
+ {
+ KateTextCursor start (s.selBegin);
+ KateTextCursor end (s.selEnd);
+
+ // recalc for block sel, to have start with lowest col, end with highest
+ if (m_view->blockSelectionMode())
+ {
+ start.setCol (kMin(s.selBegin.col(), s.selEnd.col()));
+ end.setCol (kMax(s.selBegin.col(), s.selEnd.col()));
+ }
+
+ s.cursor = s.flags.backward ? end : start;
+ }
+ else
+ {
+ if( !s.flags.backward ) {
+ s.cursor.setPos(0, 0);
+ } else {
+ s.cursor.setLine(doc()->numLines() - 1);
+ s.cursor.setCol(doc()->lineLength( s.cursor.line() ) );
+ }
+ }
+
+ // oh, we wrapped around one time allready now !
+ // only check that on replace
+ s.wrapped = s.flags.replace;
+
+ replaces = 0;
+ s.flags.finished = true;
+}
+
+void KateSearch::findAgain()
+{
+ if( s_pattern.isEmpty() ) {
+ find();
+ return;
+ }
+
+ if ( doSearch( s_pattern ) ) {
+ exposeFound( s.cursor, s.matchedLength );
+ } else if( !s.flags.finished ) {
+ if( askContinue() ) {
+ wrapSearch();
+ findAgain();
+ } else {
+ if (arbitraryHLExample) m_arbitraryHLList->clear();
+ }
+ } else {
+ if (arbitraryHLExample) m_arbitraryHLList->clear();
+ if ( s.showNotFound )
+ KMessageBox::sorry( view(),
+ i18n("Search string '%1' not found!")
+ .arg( KStringHandler::csqueeze( s_pattern ) ),
+ i18n("Find"));
+ }
+}
+
+void KateSearch::replaceAll()
+{
+ doc()->editStart ();
+
+ while( doSearch( s_pattern ) )
+ replaceOne();
+
+ doc()->editEnd ();
+
+ if( !s.flags.finished ) {
+ if( askContinue() ) {
+ wrapSearch();
+ replaceAll();
+ }
+ } else {
+ KMessageBox::information( view(),
+ i18n("%n replacement made.","%n replacements made.",replaces),
+ i18n("Replace") );
+ }
+}
+
+void KateSearch::promptReplace()
+{
+ if ( doSearch( s_pattern ) ) {
+ exposeFound( s.cursor, s.matchedLength );
+ replacePrompt->show();
+ replacePrompt->setFocus ();
+ } else if( !s.flags.finished && askContinue() ) {
+ wrapSearch();
+ promptReplace();
+ } else {
+ if (arbitraryHLExample) m_arbitraryHLList->clear();
+ replacePrompt->hide();
+ KMessageBox::information( view(),
+ i18n("%n replacement made.","%n replacements made.",replaces),
+ i18n("Replace") );
+ }
+}
+
+void KateSearch::replaceOne()
+{
+ QString replaceWith = m_replacement;
+ if ( s.flags.regExp && s.flags.useBackRefs ) {
+ // replace each "(?!\)\d+" with the corresponding capture
+ QRegExp br("\\\\(\\d+)");
+ int pos = br.search( replaceWith );
+ int ncaps = m_re.numCaptures();
+ while ( pos >= 0 ) {
+ QString sc;
+ if ( !pos || replaceWith.at( pos-1) != '\\' ) {
+ int ccap = br.cap(1).toInt();
+ if (ccap <= ncaps ) {
+ sc = m_re.cap( ccap );
+ replaceWith.replace( pos, br.matchedLength(), sc );
+ }
+ else {
+ kdDebug()<<"KateSearch::replaceOne(): you don't have "<<ccap<<" backreferences in regexp '"<<m_re.pattern()<<"'"<<endl;
+ }
+ }
+ pos = br.search( replaceWith, pos + (int)sc.length() );
+ }
+ }
+
+ doc()->editStart();
+ doc()->removeText( s.cursor.line(), s.cursor.col(),
+ s.cursor.line(), s.cursor.col() + s.matchedLength );
+ doc()->insertText( s.cursor.line(), s.cursor.col(), replaceWith );
+ doc()->editEnd(),
+
+ replaces++;
+
+ // if we inserted newlines, we better adjust.
+ uint newlines = replaceWith.contains('\n');
+ if ( newlines )
+ {
+ if ( ! s.flags.backward )
+ {
+ s.cursor.setLine( s.cursor.line() + newlines );
+ s.cursor.setCol( replaceWith.length() - replaceWith.findRev('\n') );
+ }
+ // selection?
+ if ( s.flags.selected )
+ s.selEnd.setLine( s.selEnd.line() + newlines );
+ }
+
+
+ // adjust selection endcursor if needed
+ if( s.flags.selected && s.cursor.line() == s.selEnd.line() )
+ {
+ s.selEnd.setCol(s.selEnd.col() + replaceWith.length() - s.matchedLength );
+ }
+
+ // adjust wrap cursor if needed
+ if( s.cursor.line() == s.wrappedEnd.line() && s.cursor.col() <= s.wrappedEnd.col())
+ {
+ s.wrappedEnd.setCol(s.wrappedEnd.col() + replaceWith.length() - s.matchedLength );
+ }
+
+ if( !s.flags.backward ) {
+ s.cursor.setCol(s.cursor.col() + replaceWith.length());
+ } else if( s.cursor.col() > 0 ) {
+ s.cursor.setCol(s.cursor.col() - 1);
+ } else {
+ s.cursor.setLine(s.cursor.line() - 1);
+ if( s.cursor.line() >= 0 ) {
+ s.cursor.setCol(doc()->lineLength( s.cursor.line() ));
+ }
+ }
+}
+
+void KateSearch::skipOne()
+{
+ if( !s.flags.backward ) {
+ s.cursor.setCol(s.cursor.col() + s.matchedLength);
+ } else if( s.cursor.col() > 0 ) {
+ s.cursor.setCol(s.cursor.col() - 1);
+ } else {
+ s.cursor.setLine(s.cursor.line() - 1);
+ if( s.cursor.line() >= 0 ) {
+ s.cursor.setCol(doc()->lineLength(s.cursor.line()));
+ }
+ }
+}
+
+void KateSearch::replaceSlot() {
+ switch( (Dialog_results)replacePrompt->result() ) {
+ case srCancel: replacePrompt->hide(); break;
+ case srAll: replacePrompt->hide(); replaceAll(); break;
+ case srYes: replaceOne(); promptReplace(); break;
+ case srLast: replacePrompt->hide(), replaceOne(); break;
+ case srNo: skipOne(); promptReplace(); break;
+ }
+}
+
+bool KateSearch::askContinue()
+{
+ QString made =
+ i18n( "%n replacement made.",
+ "%n replacements made.",
+ replaces );
+
+ QString reached = !s.flags.backward ?
+ i18n( "End of document reached." ) :
+ i18n( "Beginning of document reached." );
+
+ if (KateViewConfig::global()->searchFlags() & KFindDialog::SelectedText)
+ {
+ reached = !s.flags.backward ?
+ i18n( "End of selection reached." ) :
+ i18n( "Beginning of selection reached." );
+ }
+
+ QString question = !s.flags.backward ?
+ i18n( "Continue from the beginning?" ) :
+ i18n( "Continue from the end?" );
+
+ QString text = s.flags.replace ?
+ made + "\n" + reached + "\n" + question :
+ reached + "\n" + question;
+
+ return KMessageBox::Yes == KMessageBox::questionYesNo(
+ view(), text, s.flags.replace ? i18n("Replace") : i18n("Find"),
+ KStdGuiItem::cont(), i18n("&Stop") );
+}
+
+QString KateSearch::getSearchText()
+{
+ // SelectionOnly: use selection
+ // WordOnly: use word under cursor
+ // SelectionWord: use selection if available, else use word under cursor
+ // WordSelection: use word if available, else use selection
+ QString str;
+
+ int getFrom = view()->config()->textToSearchMode();
+ switch (getFrom)
+ {
+ case KateViewConfig::SelectionOnly: // (Windows)
+ //kdDebug() << "getSearchText(): SelectionOnly" << endl;
+ if( m_view->hasSelection() )
+ str = m_view->selection();
+ break;
+
+ case KateViewConfig::SelectionWord: // (classic Kate behavior)
+ //kdDebug() << "getSearchText(): SelectionWord" << endl;
+ if( m_view->hasSelection() )
+ str = m_view->selection();
+ else
+ str = view()->currentWord();
+ break;
+
+ case KateViewConfig::WordOnly: // (weird?)
+ //kdDebug() << "getSearchText(): WordOnly" << endl;
+ str = view()->currentWord();
+ break;
+
+ case KateViewConfig::WordSelection: // (persistent selection lover)
+ //kdDebug() << "getSearchText(): WordSelection" << endl;
+ str = view()->currentWord();
+ if (str.isEmpty() && m_view->hasSelection() )
+ str = m_view->selection();
+ break;
+
+ default: // (nowhere)
+ //kdDebug() << "getSearchText(): Nowhere" << endl;
+ break;
+ }
+
+ str.replace( QRegExp("^\\n"), "" );
+ str.replace( QRegExp("\\n.*"), "" );
+
+ return str;
+}
+
+KateTextCursor KateSearch::getCursor( SearchFlags flags )
+{
+ if (flags.backward && !flags.selected && view()->hasSelection())
+ {
+ // We're heading backwards (and not within a selection),
+ // the selection might start before the cursor.
+ return kMin( KateTextCursor(view()->selStartLine(), view()->selStartCol()),
+ KateTextCursor(view()->cursorLine(), view()->cursorColumnReal()));
+ }
+ return KateTextCursor(view()->cursorLine(), view()->cursorColumnReal());
+}
+
+bool KateSearch::doSearch( const QString& text )
+{
+/*
+ rodda: Still Working on this... :)
+
+ bool result = false;
+
+ if (m_searchResults.count()) {
+ m_resultIndex++;
+ if (m_resultIndex < (int)m_searchResults.count()) {
+ s = m_searchResults[m_resultIndex];
+ result = true;
+ }
+
+ } else {
+ int temp = 0;
+ do {*/
+
+#if 0
+ static int oldLine = -1;
+ static int oldCol = -1;
+#endif
+
+ uint line = s.cursor.line();
+ uint col = s.cursor.col();// + (result ? s.matchedLength : 0);
+ bool backward = s.flags.backward;
+ bool caseSensitive = s.flags.caseSensitive;
+ bool regExp = s.flags.regExp;
+ bool wholeWords = s.flags.wholeWords;
+ uint foundLine, foundCol, matchLen;
+ bool found = false;
+ //kdDebug() << "Searching at " << line << ", " << col << endl;
+// kdDebug()<<"KateSearch::doSearch: "<<line<<", "<<col<<", "<<backward<<endl;
+
+ if (backward)
+ {
+ KateDocCursor docCursor(line, col, doc());
+
+ // If we're at the top of the document, we're not gonna find anything, so bail.
+ if (docCursor.line() == 0 && docCursor.col() == 0)
+ return false;
+
+ // Move one step backward before searching, if this is a "find again", we don't
+ // want to find the same match.
+ docCursor.moveBackward(1);
+ line = docCursor.line();
+ col = docCursor.col();
+ }
+
+ do {
+ if( regExp ) {
+ m_re = QRegExp( text, caseSensitive );
+ found = doc()->searchText( line, col, m_re,
+ &foundLine, &foundCol,
+ &matchLen, backward );
+ }
+ else if ( wholeWords )
+ {
+ bool maybefound = false;
+ do
+ {
+ maybefound = doc()->searchText( line, col, text,
+ &foundLine, &foundCol,
+ &matchLen, caseSensitive, backward );
+ if ( maybefound )
+ {
+ found = (
+ ( foundCol == 0 ||
+ ! doc()->highlight()->isInWord( doc()->textLine( foundLine ).at( foundCol - 1 ) ) ) &&
+ ( foundCol + matchLen == doc()->lineLength( foundLine ) ||
+ ! doc()->highlight()->isInWord( doc()->textLine( foundLine ).at( foundCol + matchLen ) ) )
+ );
+ if ( found )
+ {
+ break;
+ }
+ else if ( backward && foundCol == 0 ) // we are done on this line and want to avoid endless loops like in #137312
+ {
+ if ( line == 0 ) // we are completely done...
+ break;
+ else
+ line--;
+ }
+ else
+ {
+ line = foundLine;
+ col = foundCol + 1;
+ }
+ }
+ } while ( maybefound );
+ }
+ else {
+ found = doc()->searchText( line, col, text,
+ &foundLine, &foundCol,
+ &matchLen, caseSensitive, backward );
+ }
+
+ if ( found && s.flags.selected )
+ {
+ KateTextCursor start (s.selBegin);
+ KateTextCursor end (s.selEnd);
+
+ // recalc for block sel, to have start with lowest col, end with highest
+ if (m_view->blockSelectionMode())
+ {
+ start.setCol (kMin(s.selBegin.col(), s.selEnd.col()));
+ end.setCol (kMax(s.selBegin.col(), s.selEnd.col()));
+ }
+
+ if ( !s.flags.backward && KateTextCursor( foundLine, foundCol ) >= end
+ || s.flags.backward && KateTextCursor( foundLine, foundCol ) < start )
+ {
+ found = false;
+ }
+ else if (m_view->blockSelectionMode())
+ {
+ if ((int)foundCol >= start.col() && (int)foundCol < end.col())
+ break;
+ }
+ }
+
+ line = foundLine;
+ col = foundCol+1;
+ }
+ while (s.flags.selected && m_view->blockSelectionMode() && found);
+ // in the case we want to search in selection + blockselection we need to loop
+
+ if( !found ) return false;
+
+ // save the search result
+ s.cursor.setPos(foundLine, foundCol);
+ s.matchedLength = matchLen;
+
+ // we allready wrapped around one time
+ if (s.wrapped)
+ {
+ if (s.flags.backward)
+ {
+ if ( (s.cursor.line() < s.wrappedEnd.line())
+ || ( (s.cursor.line() == s.wrappedEnd.line()) && ((s.cursor.col()+matchLen) <= uint(s.wrappedEnd.col())) ) )
+ return false;
+ }
+ else
+ {
+ if ( (s.cursor.line() > s.wrappedEnd.line())
+ || ( (s.cursor.line() == s.wrappedEnd.line()) && (s.cursor.col() > s.wrappedEnd.col()) ) )
+ return false;
+ }
+ }
+
+// kdDebug() << "Found at " << s.cursor.line() << ", " << s.cursor.col() << endl;
+
+
+ //m_searchResults.append(s);
+
+ if (arbitraryHLExample) {
+ KateArbitraryHighlightRange* hl = new KateArbitraryHighlightRange(new KateSuperCursor(m_doc, true, s.cursor), new KateSuperCursor(m_doc, true, s.cursor.line(), s.cursor.col() + s.matchedLength), this);
+ hl->setBold();
+ hl->setTextColor(Qt::white);
+ hl->setBGColor(Qt::black);
+ // destroy the highlight upon change
+ connect(hl, SIGNAL(contentsChanged()), hl, SIGNAL(eliminated()));
+ m_arbitraryHLList->append(hl);
+ }
+
+ return true;
+
+ /* rodda: more of my search highlighting work
+
+ } while (++temp < 100);
+
+ if (result) {
+ s = m_searchResults.first();
+ m_resultIndex = 0;
+ }
+ }
+
+ return result;*/
+}
+
+void KateSearch::exposeFound( KateTextCursor &cursor, int slen )
+{
+ view()->setCursorPositionInternal ( cursor.line(), cursor.col() + slen, 1 );
+ view()->setSelection( cursor.line(), cursor.col(), cursor.line(), cursor.col() + slen );
+ view()->syncSelectionCache();
+}
+//END KateSearch
+
+//BEGIN KateReplacePrompt
+// this dialog is not modal
+KateReplacePrompt::KateReplacePrompt ( QWidget *parent )
+ : KDialogBase ( parent, 0L, false, i18n( "Replace Confirmation" ),
+ User3 | User2 | User1 | Close | Ok , Ok, true,
+ i18n("Replace &All"), i18n("Re&place && Close"), i18n("&Replace") )
+{
+ setButtonOK( i18n("&Find Next") );
+ QWidget *page = new QWidget(this);
+ setMainWidget(page);
+
+ QBoxLayout *topLayout = new QVBoxLayout( page, 0, spacingHint() );
+ QLabel *label = new QLabel(i18n("Found an occurrence of your search term. What do you want to do?"),page);
+ topLayout->addWidget(label );
+}
+
+void KateReplacePrompt::slotOk ()
+{ // Search Next
+ done(KateSearch::srNo);
+ actionButton(Ok)->setFocus();
+}
+
+void KateReplacePrompt::slotClose ()
+{ // Close
+ done(KateSearch::srCancel);
+ actionButton(Close)->setFocus();
+}
+
+void KateReplacePrompt::slotUser1 ()
+{ // Replace All
+ done(KateSearch::srAll);
+ actionButton(User1)->setFocus();
+}
+
+void KateReplacePrompt::slotUser2 ()
+{ // Replace & Close
+ done(KateSearch::srLast);
+ actionButton(User2)->setFocus();
+}
+
+void KateReplacePrompt::slotUser3 ()
+{ // Replace
+ done(KateSearch::srYes);
+ actionButton(User3)->setFocus();
+}
+
+void KateReplacePrompt::done (int result)
+{
+ setResult(result);
+
+ emit clicked();
+}
+//END KateReplacePrompt
+
+//BEGIN SearchCommand
+bool SearchCommand::exec(class Kate::View *view, const QString &cmd, QString &msg)
+{
+ QString flags, pattern, replacement;
+ if ( cmd.startsWith( "find" ) )
+ {
+
+ static QRegExp re_find("find(?::([bcersw]*))?\\s+(.+)");
+ if ( re_find.search( cmd ) < 0 )
+ {
+ msg = i18n("Usage: find[:[bcersw]] PATTERN");
+ return false;
+ }
+ flags = re_find.cap( 1 );
+ pattern = re_find.cap( 2 );
+ }
+
+ else if ( cmd.startsWith( "ifind" ) )
+ {
+ static QRegExp re_ifind("ifind(?::([bcrs]*))?\\s+(.*)");
+ if ( re_ifind.search( cmd ) < 0 )
+ {
+ msg = i18n("Usage: ifind[:[bcrs]] PATTERN");
+ return false;
+ }
+ ifindClear();
+ return true;
+ }
+
+ else if ( cmd.startsWith( "replace" ) )
+ {
+ // Try if the pattern and replacement is quoted, using a quote character ["']
+ static QRegExp re_rep("replace(?::([bceprsw]*))?\\s+([\"'])((?:[^\\\\\\\\2]|\\\\.)*)\\2\\s+\\2((?:[^\\\\\\\\2]|\\\\.)*)\\2\\s*$");
+ // Or one quoted argument
+ QRegExp re_rep1("replace(?::([bceprsw]*))?\\s+([\"'])((?:[^\\\\\\\\2]|\\\\.)*)\\2\\s*$");
+ // Else, it's just one or two (space separated) words
+ QRegExp re_rep2("replace(?::([bceprsw]*))?\\s+(\\S+)(.*)");
+#define unbackslash(s) p=0;\
+while ( (p = pattern.find( '\\' + delim, p )) > -1 )\
+{\
+ if ( !p || pattern[p-1] != '\\' )\
+ pattern.remove( p, 1 );\
+ p++;\
+}
+
+ if ( re_rep.search( cmd ) >= 0 )
+ {
+ flags = re_rep.cap(1);
+ pattern = re_rep.cap( 3 );
+ replacement = re_rep.cap( 4 );
+
+ int p(0);
+ // unbackslash backslashed delimiter strings
+ // in pattern ..
+ QString delim = re_rep.cap( 2 );
+ unbackslash(pattern);
+ // .. and in replacement
+ unbackslash(replacement);
+ }
+ else if ( re_rep1.search( cmd ) >= 0 )
+ {
+ flags = re_rep1.cap(1);
+ pattern = re_rep1.cap( 3 );
+
+ int p(0);
+ QString delim = re_rep1.cap( 2 );
+ unbackslash(pattern);
+ }
+ else if ( re_rep2.search( cmd ) >= 0 )
+ {
+ flags = re_rep2.cap( 1 );
+ pattern = re_rep2.cap( 2 );
+ replacement = re_rep2.cap( 3 ).stripWhiteSpace();
+ }
+ else
+ {
+ msg = i18n("Usage: replace[:[bceprsw]] PATTERN [REPLACEMENT]");
+ return false;
+ }
+ kdDebug()<<"replace '"<<pattern<<"' with '"<<replacement<<"'"<<endl;
+#undef unbackslash
+ }
+
+ long f = 0;
+ if ( flags.contains( 'b' ) ) f |= KFindDialog::FindBackwards;
+ if ( flags.contains( 'c' ) ) f |= KFindDialog::FromCursor;
+ if ( flags.contains( 'e' ) ) f |= KFindDialog::SelectedText;
+ if ( flags.contains( 'r' ) ) f |= KFindDialog::RegularExpression;
+ if ( flags.contains( 'p' ) ) f |= KReplaceDialog::PromptOnReplace;
+ if ( flags.contains( 's' ) ) f |= KFindDialog::CaseSensitive;
+ if ( flags.contains( 'w' ) ) f |= KFindDialog::WholeWordsOnly;
+
+ if ( cmd.startsWith( "find" ) )
+ {
+ ((KateView*)view)->find( pattern, f );
+ return true;
+ }
+ else if ( cmd.startsWith( "replace" ) )
+ {
+ f |= KReplaceDialog::BackReference; // mandatory here?
+ ((KateView*)view)->replace( pattern, replacement, f );
+ return true;
+ }
+
+ return false;
+}
+
+bool SearchCommand::help(class Kate::View *, const QString &cmd, QString &msg)
+{
+ if ( cmd == "find" )
+ msg = i18n("<p>Usage: <code>find[:bcersw] PATTERN</code></p>");
+
+ else if ( cmd == "ifind" )
+ msg = i18n("<p>Usage: <code>ifind:[:bcrs] PATTERN</code>"
+ "<br>ifind does incremental or 'as-you-type' search</p>");
+
+ else
+ msg = i18n("<p>Usage: <code>replace[:bceprsw] PATTERN REPLACEMENT</code></p>");
+
+ msg += i18n(
+ "<h4><caption>Options</h4><p>"
+ "<b>b</b> - Search backward"
+ "<br><b>c</b> - Search from cursor"
+ "<br><b>r</b> - Pattern is a regular expression"
+ "<br><b>s</b> - Case sensitive search"
+ );
+
+ if ( cmd == "find" )
+ msg += i18n(
+ "<br><b>e</b> - Search in selected text only"
+ "<br><b>w</b> - Search whole words only"
+ );
+
+ if ( cmd == "replace" )
+ msg += i18n(
+ "<br><b>p</b> - Prompt for replace</p>"
+ "<p>If REPLACEMENT is not present, an empty string is used.</p>"
+ "<p>If you want to have whitespace in your PATTERN, you need to "
+ "quote both PATTERN and REPLACEMENT with either single or double "
+ "quotes. To have the quote characters in the strings, prepend them "
+ "with a backslash.");
+
+ msg += "</p>";
+ return true;
+}
+
+QStringList SearchCommand::cmds()
+{
+ QStringList l;
+ l << "find" << "replace" << "ifind";
+ return l;
+}
+
+bool SearchCommand::wantsToProcessText( const QString &cmdname )
+{
+ return cmdname == "ifind";
+}
+
+void SearchCommand::processText( Kate::View *view, const QString &cmd )
+{
+ static QRegExp re_ifind("ifind(?::([bcrs]*))?\\s(.*)");
+ if ( re_ifind.search( cmd ) > -1 )
+ {
+ QString flags = re_ifind.cap( 1 );
+ QString pattern = re_ifind.cap( 2 );
+
+
+ // if there is no setup, or the text length is 0, set up the properties
+ if ( ! m_ifindFlags || pattern.isEmpty() )
+ ifindInit( flags );
+ // if there is no fromCursor, add it if this is not the first character
+ else if ( ! ( m_ifindFlags & KFindDialog::FromCursor ) && ! pattern.isEmpty() )
+ m_ifindFlags |= KFindDialog::FromCursor;
+
+ // search..
+ if ( ! pattern.isEmpty() )
+ {
+ KateView *v = (KateView*)view;
+
+ // If it *looks like* we are continuing, place the cursor
+ // at the beginning of the selection, so that the search continues.
+ // ### check more carefully, like is the cursor currently at the end
+ // of the selection.
+ if ( pattern.startsWith( v->selection() ) &&
+ v->selection().length() + 1 == pattern.length() )
+ v->setCursorPositionInternal( v->selStartLine(), v->selStartCol() );
+
+ v->find( pattern, m_ifindFlags, false );
+ }
+ }
+}
+
+void SearchCommand::ifindInit( const QString &flags )
+{
+ long f = 0;
+ if ( flags.contains( 'b' ) ) f |= KFindDialog::FindBackwards;
+ if ( flags.contains( 'c' ) ) f |= KFindDialog::FromCursor;
+ if ( flags.contains( 'r' ) ) f |= KFindDialog::RegularExpression;
+ if ( flags.contains( 's' ) ) f |= KFindDialog::CaseSensitive;
+ m_ifindFlags = f;
+}
+
+void SearchCommand::ifindClear()
+{
+ m_ifindFlags = 0;
+}
+//END SearchCommand
+
+// kate: space-indent on; indent-width 2; replace-tabs on;
diff --git a/kate/part/katesearch.h b/kate/part/katesearch.h
new file mode 100644
index 000000000..3f2ce2ec6
--- /dev/null
+++ b/kate/part/katesearch.h
@@ -0,0 +1,243 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2004-2005 Anders Lund <anders@alweb.dk>
+ Copyright (C) 2002 John Firebaugh <jfirebaugh@kde.org>
+ Copyright (C) 2001-2004 Christoph Cullmann <cullmann@kde.org>
+ Copyright (C) 2001 Joseph Wenninger <jowenn@kde.org>
+ Copyright (C) 1999 Jochen Wilhelmy <digisnap@cs.tu-berlin.de>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef __KATE_SEARCH_H__
+#define __KATE_SEARCH_H__
+
+#include "katecursor.h"
+#include "../interfaces/document.h"
+
+#include <kdialogbase.h>
+
+#include <qstring.h>
+#include <qregexp.h>
+#include <qstringlist.h>
+#include <qvaluelist.h>
+
+class KateView;
+class KateDocument;
+class KateSuperRangeList;
+
+class KActionCollection;
+
+class KateSearch : public QObject
+{
+ Q_OBJECT
+
+ friend class KateDocument;
+
+ private:
+ class SearchFlags
+ {
+ public:
+ bool caseSensitive :1;
+ bool wholeWords :1;
+ bool fromBeginning :1;
+ bool backward :1;
+ bool selected :1;
+ bool prompt :1;
+ bool replace :1;
+ bool finished :1;
+ bool regExp :1;
+ bool useBackRefs :1;
+ };
+
+ class SConfig
+ {
+ public:
+ SearchFlags flags;
+ KateTextCursor cursor;
+ KateTextCursor wrappedEnd; // after wraping around, search/replace until here
+ bool wrapped; // have we allready wrapped around ?
+ bool showNotFound; // pop up annoying dialogs?
+ uint matchedLength;
+ KateTextCursor selBegin;
+ KateTextCursor selEnd;
+ };
+
+ public:
+ enum Dialog_results {
+ srCancel = KDialogBase::Cancel,
+ srAll = KDialogBase::User1,
+ srLast = KDialogBase::User2,
+ srNo = KDialogBase::User3,
+ srYes = KDialogBase::Ok
+ };
+
+ public:
+ KateSearch( KateView* );
+ ~KateSearch();
+
+ void createActions( KActionCollection* );
+
+ public slots:
+ void find();
+ /**
+ * Search for @p pattern given @p flags
+ * This is for the commandline "find", and is forwarded by
+ * KateView.
+ * @param pattern string or regex pattern to search for.
+ * @param flags a OR'ed combination of KFindDialog::Options
+ * @param add wether this string should be added to the recent search list
+ * @param shownotfound wether to pop up "Not round: PATTERN" when that happens.
+ * That must now be explicitly required -- the find dialog does, but the commandline
+ * incremental search does not.
+ */
+ void find( const QString &pattern, long flags, bool add=true, bool shownotfound=false );
+ void replace();
+ /**
+ * Replace @p pattern with @p replacement given @p flags.
+ * This is for the commandline "replace" and is forwarded
+ * by KateView.
+ * @param pattern string or regular expression to search for
+ * @param replacement Replacement string.
+ * @param flags OR'd combination of KFindDialog::Options
+ */
+ void replace( const QString &pattern, const QString &replacement, long flags );
+ void findAgain( bool reverseDirection );
+
+ private slots:
+ void replaceSlot();
+ void slotFindNext() { findAgain( false ); }
+ void slotFindPrev() { findAgain( true ); }
+
+ private:
+ static void addToList( QStringList&, const QString& );
+ static void addToSearchList( const QString& s ) { addToList( s_searchList, s ); }
+ static void addToReplaceList( const QString& s ) { addToList( s_replaceList, s ); }
+ static QStringList s_searchList; ///< recent patterns
+ static QStringList s_replaceList; ///< recent replacement strings
+ static QString s_pattern; ///< the string to search for
+
+ void search( SearchFlags flags );
+ void wrapSearch();
+ bool askContinue();
+
+ void findAgain();
+ void promptReplace();
+ void replaceAll();
+ void replaceOne();
+ void skipOne();
+
+ QString getSearchText();
+ KateTextCursor getCursor( SearchFlags flags );
+ bool doSearch( const QString& text );
+ void exposeFound( KateTextCursor &cursor, int slen );
+
+ inline KateView* view() { return m_view; }
+ inline KateDocument* doc() { return m_doc; }
+
+ KateView* m_view;
+ KateDocument* m_doc;
+
+ KateSuperRangeList* m_arbitraryHLList;
+
+ SConfig s;
+
+ QValueList<SConfig> m_searchResults;
+ int m_resultIndex;
+
+ int replaces;
+ QDialog* replacePrompt;
+ QString m_replacement;
+ QRegExp m_re;
+};
+
+/**
+ * simple replace prompt dialog
+ */
+class KateReplacePrompt : public KDialogBase
+{
+ Q_OBJECT
+
+ public:
+ /**
+ * Constructor
+ * @param parent parent widget for the dialog
+ */
+ KateReplacePrompt(QWidget *parent);
+
+ signals:
+ /**
+ * button clicked
+ */
+ void clicked();
+
+ protected slots:
+ /**
+ * ok pressed
+ */
+ void slotOk ();
+
+ /**
+ * close pressed
+ */
+ void slotClose ();
+
+ /**
+ * replace all pressed
+ */
+ void slotUser1 ();
+
+ /**
+ * last pressed
+ */
+ void slotUser2 ();
+
+ /**
+ * Yes pressed
+ */
+ void slotUser3 ();
+
+ /**
+ * dialog done
+ * @param result dialog result
+ */
+ void done (int result);
+};
+
+class SearchCommand : public Kate::Command, public Kate::CommandExtension
+{
+ public:
+ SearchCommand() : m_ifindFlags(0) {;}
+ bool exec(class Kate::View *view, const QString &cmd, QString &errorMsg);
+ bool help(class Kate::View *, const QString &, QString &);
+ QStringList cmds();
+ bool wantsToProcessText( const QString &/*cmdname*/ );
+ void processText( Kate::View *view, const QString& text );
+
+ private:
+ /**
+ * set up properties for incremental find
+ */
+ void ifindInit( const QString &cmd );
+ /**
+ * clear properties for incremental find
+ */
+ void ifindClear();
+
+ long m_ifindFlags;
+};
+
+#endif
+
+// kate: space-indent on; indent-width 2; replace-tabs on;
diff --git a/kate/part/katespell.cpp b/kate/part/katespell.cpp
new file mode 100644
index 000000000..1afd8d53f
--- /dev/null
+++ b/kate/part/katespell.cpp
@@ -0,0 +1,221 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2004-2005 Anders Lund <anders@alweb.dk>
+ Copyright (C) 2003 Clarence Dang <dang@kde.org>
+ Copyright (C) 2002 John Firebaugh <jfirebaugh@kde.org>
+ Copyright (C) 2001-2004 Christoph Cullmann <cullmann@kde.org>
+ Copyright (C) 2001 Joseph Wenninger <jowenn@kde.org>
+ Copyright (C) 1999 Jochen Wilhelmy <digisnap@cs.tu-berlin.de>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "katespell.h"
+#include "katespell.moc"
+
+#include "kateview.h"
+
+#include <kaction.h>
+#include <kstdaction.h>
+#include <kspell.h>
+#include <ksconfig.h>
+#include <kdebug.h>
+#include <kmessagebox.h>
+
+KateSpell::KateSpell( KateView* view )
+ : QObject( view )
+ , m_view (view)
+ , m_kspell (0)
+{
+}
+
+KateSpell::~KateSpell()
+{
+ // kspell stuff
+ if( m_kspell )
+ {
+ m_kspell->setAutoDelete(true);
+ m_kspell->cleanUp(); // need a way to wait for this to complete
+ delete m_kspell;
+ }
+}
+
+void KateSpell::createActions( KActionCollection* ac )
+{
+ KStdAction::spelling( this, SLOT(spellcheck()), ac );
+ KAction *a = new KAction( i18n("Spelling (from cursor)..."), "spellcheck", 0, this, SLOT(spellcheckFromCursor()), ac, "tools_spelling_from_cursor" );
+ a->setWhatsThis(i18n("Check the document's spelling from the cursor and forward"));
+
+ m_spellcheckSelection = new KAction( i18n("Spellcheck Selection..."), "spellcheck", 0, this, SLOT(spellcheckSelection()), ac, "tools_spelling_selection" );
+ m_spellcheckSelection->setWhatsThis(i18n("Check spelling of the selected text"));
+}
+
+void KateSpell::updateActions ()
+{
+ m_spellcheckSelection->setEnabled (m_view->hasSelection ());
+}
+
+void KateSpell::spellcheckFromCursor()
+{
+ spellcheck( KateTextCursor(m_view->cursorLine(), m_view->cursorColumnReal()) );
+}
+
+void KateSpell::spellcheckSelection()
+{
+ KateTextCursor from( m_view->selStartLine(), m_view->selStartCol() );
+ KateTextCursor to( m_view->selEndLine(), m_view->selEndCol() );
+ spellcheck( from, to );
+}
+
+void KateSpell::spellcheck()
+{
+ spellcheck( KateTextCursor( 0, 0 ) );
+}
+
+void KateSpell::spellcheck( const KateTextCursor &from, const KateTextCursor &to )
+{
+ m_spellStart = from;
+ m_spellEnd = to;
+
+ if ( to.line() == 0 && to.col() == 0 )
+ {
+ int lln = m_view->doc()->lastLine();
+ m_spellEnd.setLine( lln );
+ m_spellEnd.setCol( m_view->doc()->lineLength( lln ) );
+ }
+
+ m_spellPosCursor = from;
+ m_spellLastPos = 0;
+
+ QString mt = m_view->doc()->mimeType()/*->name()*/;
+
+ KSpell::SpellerType type = KSpell::Text;
+ if ( mt == "text/x-tex" || mt == "text/x-latex" )
+ type = KSpell::TeX;
+ else if ( mt == "text/html" || mt == "text/xml" || mt == "text/docbook" || mt == "application/x-php")
+ type = KSpell::HTML;
+
+ KSpellConfig *ksc = new KSpellConfig;
+ QStringList ksEncodings;
+ ksEncodings << "US-ASCII" << "ISO 8859-1" << "ISO 8859-2" << "ISO 8859-3"
+ << "ISO 8859-4" << "ISO 8859-5" << "ISO 8859-7" << "ISO 8859-8"
+ << "ISO 8859-9" << "ISO 8859-13" << "ISO 8859-15" << "UTF-8"
+ << "KOI8-R" << "KOI8-U" << "CP1251" << "CP1255";
+
+ int enc = ksEncodings.findIndex( m_view->doc()->encoding() );
+ if ( enc > -1 )
+ {
+ ksc->setEncoding( enc );
+ kdDebug(13020)<<"KateSpell::spellCheck(): using encoding: "<<enc<<" ("<<ksEncodings[enc]<<") and KSpell::Type "<<type<<" (for '"<<mt<<"')"<<endl;
+ }
+ else
+ kdDebug(13020)<<"KateSpell::spellCheck(): using encoding: "<<enc<<" and KSpell::Type "<<type<<" (for '"<<mt<<"')"<<endl;
+
+ m_kspell = new KSpell( m_view, i18n("Spellcheck"),
+ this, SLOT(ready(KSpell *)), ksc, true, true, type );
+
+ connect( m_kspell, SIGNAL(death()),
+ this, SLOT(spellCleanDone()) );
+
+ connect( m_kspell, SIGNAL(misspelling(const QString&, const QStringList&, unsigned int)),
+ this, SLOT(misspelling(const QString&, const QStringList&, unsigned int)) );
+ connect( m_kspell, SIGNAL(corrected(const QString&, const QString&, unsigned int)),
+ this, SLOT(corrected(const QString&, const QString&, unsigned int)) );
+ connect( m_kspell, SIGNAL(done(const QString&)),
+ this, SLOT(spellResult(const QString&)) );
+}
+
+void KateSpell::ready(KSpell *)
+{
+ m_kspell->setProgressResolution( 1 );
+
+ m_kspell->check( m_view->doc()->text( m_spellStart.line(), m_spellStart.col(), m_spellEnd.line(), m_spellEnd.col() ) );
+
+ kdDebug (13020) << "SPELLING READY STATUS: " << m_kspell->status () << endl;
+}
+
+void KateSpell::locatePosition( uint pos, uint& line, uint& col )
+{
+ uint remains;
+
+ while ( m_spellLastPos < pos )
+ {
+ remains = pos - m_spellLastPos;
+ uint l = m_view->doc()->lineLength( m_spellPosCursor.line() ) - m_spellPosCursor.col();
+ if ( l > remains )
+ {
+ m_spellPosCursor.setCol( m_spellPosCursor.col() + remains );
+ m_spellLastPos = pos;
+ }
+ else
+ {
+ m_spellPosCursor.setLine( m_spellPosCursor.line() + 1 );
+ m_spellPosCursor.setCol(0);
+ m_spellLastPos += l + 1;
+ }
+ }
+
+ line = m_spellPosCursor.line();
+ col = m_spellPosCursor.col();
+}
+
+void KateSpell::misspelling( const QString& origword, const QStringList&, unsigned int pos )
+{
+ uint line, col;
+
+ locatePosition( pos, line, col );
+
+ m_view->setCursorPositionInternal (line, col, 1);
+ m_view->setSelection( line, col, line, col + origword.length() );
+}
+
+void KateSpell::corrected( const QString& originalword, const QString& newword, unsigned int pos )
+{
+ uint line, col;
+
+ locatePosition( pos, line, col );
+
+ m_view->doc()->removeText( line, col, line, col + originalword.length() );
+ m_view->doc()->insertText( line, col, newword );
+}
+
+void KateSpell::spellResult( const QString& )
+{
+ m_view->clearSelection();
+ m_kspell->cleanUp();
+}
+
+void KateSpell::spellCleanDone()
+{
+ KSpell::spellStatus status = m_kspell->status();
+
+ if( status == KSpell::Error ) {
+ KMessageBox::sorry( 0,
+ i18n("The spelling program could not be started. "
+ "Please make sure you have set the correct spelling program "
+ "and that it is properly configured and in your PATH."));
+ } else if( status == KSpell::Crashed ) {
+ KMessageBox::sorry( 0,
+ i18n("The spelling program seems to have crashed."));
+ }
+
+ delete m_kspell;
+ m_kspell = 0;
+
+ kdDebug (13020) << "SPELLING END" << endl;
+}
+//END
+
+
+// kate: space-indent on; indent-width 2; replace-tabs on;
diff --git a/kate/part/katespell.h b/kate/part/katespell.h
new file mode 100644
index 000000000..db7dfe0ed
--- /dev/null
+++ b/kate/part/katespell.h
@@ -0,0 +1,86 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2004-2005 Anders Lund <anders@alweb.dk>
+ Copyright (C) 2002 John Firebaugh <jfirebaugh@kde.org>
+ Copyright (C) 2001-2004 Christoph Cullmann <cullmann@kde.org>
+ Copyright (C) 2001 Joseph Wenninger <jowenn@kde.org>
+ Copyright (C) 1999 Jochen Wilhelmy <digisnap@cs.tu-berlin.de>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef __KATE_SPELL_H__
+#define __KATE_SPELL_H__
+
+#include "katecursor.h"
+
+class KateView;
+
+class KAction;
+class KSpell;
+
+class KateSpell : public QObject
+{
+ Q_OBJECT
+
+ public:
+ KateSpell( KateView* );
+ ~KateSpell();
+
+ void createActions( KActionCollection* );
+
+ void updateActions ();
+
+ // spellcheck from cursor, selection
+ private slots:
+ void spellcheckFromCursor();
+
+ // defined here in anticipation of pr view selections ;)
+ void spellcheckSelection();
+
+ void spellcheck();
+
+ /**
+ * Spellcheck a defined portion of the text.
+ *
+ * @param from Where to start the check
+ * @param to Where to end. If this is (0,0), it will be set to the end of the document.
+ */
+ void spellcheck( const KateTextCursor &from, const KateTextCursor &to=KateTextCursor() );
+
+ void ready(KSpell *);
+ void misspelling( const QString&, const QStringList&, unsigned int );
+ void corrected ( const QString&, const QString&, unsigned int);
+ void spellResult( const QString& );
+ void spellCleanDone();
+
+ void locatePosition( uint pos, uint& line, uint& col );
+
+ private:
+ KateView *m_view;
+ KAction *m_spellcheckSelection;
+
+ KSpell *m_kspell;
+
+ // define the part of the text to check
+ KateTextCursor m_spellStart, m_spellEnd;
+
+ // keep track of where we are.
+ KateTextCursor m_spellPosCursor;
+ uint m_spellLastPos;
+};
+
+#endif
+
+// kate: space-indent on; indent-width 2; replace-tabs on;
diff --git a/kate/part/katesupercursor.cpp b/kate/part/katesupercursor.cpp
new file mode 100644
index 000000000..774b695db
--- /dev/null
+++ b/kate/part/katesupercursor.cpp
@@ -0,0 +1,746 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2003 Hamish Rodda <rodda@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "katesupercursor.h"
+#include "katesupercursor.moc"
+
+#include "katedocument.h"
+
+#include <kdebug.h>
+
+#include <qobjectlist.h>
+
+KateSuperCursor::KateSuperCursor(KateDocument* doc, bool privateC, const KateTextCursor& cursor, QObject* parent, const char* name)
+ : QObject(parent, name)
+ , KateDocCursor(cursor.line(), cursor.col(), doc)
+ , Kate::Cursor ()
+ , m_doc (doc)
+{
+ m_moveOnInsert = false;
+ m_lineRemoved = false;
+ m_privateCursor = privateC;
+
+ m_doc->addSuperCursor (this, privateC);
+}
+
+KateSuperCursor::KateSuperCursor(KateDocument* doc, bool privateC, int lineNum, int col, QObject* parent, const char* name)
+ : QObject(parent, name)
+ , KateDocCursor(lineNum, col, doc)
+ , Kate::Cursor ()
+ , m_doc (doc)
+{
+ m_moveOnInsert = false;
+ m_lineRemoved = false;
+ m_privateCursor = privateC;
+
+ m_doc->addSuperCursor (this, privateC);
+}
+
+KateSuperCursor::~KateSuperCursor ()
+{
+ m_doc->removeSuperCursor (this, m_privateCursor);
+}
+
+void KateSuperCursor::position(uint *pline, uint *pcol) const
+{
+ KateDocCursor::position(pline, pcol);
+}
+
+bool KateSuperCursor::setPosition(uint line, uint col)
+{
+ if (line == uint(-2) && col == uint(-2)) { delete this; return true; }
+ return KateDocCursor::setPosition(line, col);
+}
+
+bool KateSuperCursor::insertText(const QString& s)
+{
+ return KateDocCursor::insertText(s);
+}
+
+bool KateSuperCursor::removeText(uint nbChar)
+{
+ return KateDocCursor::removeText(nbChar);
+}
+
+QChar KateSuperCursor::currentChar() const
+{
+ return KateDocCursor::currentChar();
+}
+
+bool KateSuperCursor::atStartOfLine() const
+{
+ return col() == 0;
+}
+
+bool KateSuperCursor::atEndOfLine() const
+{
+ return col() >= (int)m_doc->kateTextLine(line())->length();
+}
+
+bool KateSuperCursor::moveOnInsert() const
+{
+ return m_moveOnInsert;
+}
+
+void KateSuperCursor::setMoveOnInsert(bool moveOnInsert)
+{
+ m_moveOnInsert = moveOnInsert;
+}
+
+void KateSuperCursor::setLine(int lineNum)
+{
+ int tempLine = line(), tempcol = col();
+ KateDocCursor::setLine(lineNum);
+
+ if (tempLine != line() || tempcol != col())
+ emit positionDirectlyChanged();
+}
+
+void KateSuperCursor::setCol(int colNum)
+{
+ KateDocCursor::setCol(colNum);
+}
+
+void KateSuperCursor::setPos(const KateTextCursor& pos)
+{
+ KateDocCursor::setPos(pos);
+}
+
+void KateSuperCursor::setPos(int lineNum, int colNum)
+{
+ KateDocCursor::setPos(lineNum, colNum);
+}
+
+void KateSuperCursor::editTextInserted(uint line, uint col, uint len)
+{
+ if (m_line == int(line))
+ {
+ if ((m_col > int(col)) || (m_moveOnInsert && (m_col == int(col))))
+ {
+ bool insertedAt = m_col == int(col);
+
+ m_col += len;
+
+ if (insertedAt)
+ emit charInsertedAt();
+
+ emit positionChanged();
+ return;
+ }
+ }
+
+ emit positionUnChanged();
+}
+
+void KateSuperCursor::editTextRemoved(uint line, uint col, uint len)
+{
+ if (m_line == int(line))
+ {
+ if (m_col > int(col))
+ {
+ if (m_col > int(col + len))
+ {
+ m_col -= len;
+ }
+ else
+ {
+ bool prevCharDeleted = m_col == int(col + len);
+
+ m_col = col;
+
+ if (prevCharDeleted)
+ emit charDeletedBefore();
+ else
+ emit positionDeleted();
+ }
+
+ emit positionChanged();
+ return;
+
+ }
+ else if (m_col == int(col))
+ {
+ emit charDeletedAfter();
+ }
+ }
+
+ emit positionUnChanged();
+}
+
+void KateSuperCursor::editLineWrapped(uint line, uint col, bool newLine)
+{
+ if (newLine)
+ {
+ if (m_line > int(line) || (m_line == int(line) && m_col >= int(col)))
+ {
+ if(m_line == int(line))
+ m_col -= col;
+ m_line++;
+
+ emit positionChanged();
+ return;
+ }
+ }
+ else if ( (m_line == int(line)) && (m_col > int(col)) || (m_moveOnInsert && (m_col == int(col))) )
+ {
+ m_line++;
+ m_col -= col;
+
+ emit positionChanged();
+ return;
+ }
+
+ emit positionUnChanged();
+}
+
+void KateSuperCursor::editLineUnWrapped(uint line, uint col, bool removeLine, uint length)
+{
+ if (removeLine && (m_line > int(line+1)))
+ {
+ m_line--;
+
+ emit positionChanged();
+ return;
+ }
+ else if ( (m_line == int(line+1)) && (removeLine || (m_col < int(length))) )
+ {
+ m_line = line;
+ m_col += col;
+
+ emit positionChanged();
+ return;
+ }
+ else if ( (m_line == int(line+1)) && (m_col >= int(length)) )
+ {
+ m_col -= length;
+
+ emit positionChanged();
+ return;
+ }
+
+ emit positionUnChanged();
+}
+
+void KateSuperCursor::editLineInserted (uint line)
+{
+ if (m_line >= int(line))
+ {
+ m_line++;
+
+ emit positionChanged();
+ return;
+ }
+
+ emit positionUnChanged();
+}
+
+void KateSuperCursor::editLineRemoved(uint line)
+{
+ if (m_line > int(line))
+ {
+ m_line--;
+
+ emit positionChanged();
+ return;
+ }
+ else if (m_line == int(line))
+ {
+ m_line = (line <= m_doc->lastLine()) ? line : (line - 1);
+ m_col = 0;
+
+ emit positionDeleted();
+
+ emit positionChanged();
+ return;
+ }
+
+ emit positionUnChanged();
+}
+
+KateSuperCursor::operator QString()
+{
+ return QString("[%1,%1]").arg(line()).arg(col());
+}
+
+KateSuperRange::KateSuperRange(KateSuperCursor* start, KateSuperCursor* end, QObject* parent, const char* name)
+ : QObject(parent, name)
+ , m_start(start)
+ , m_end(end)
+ , m_evaluate(false)
+ , m_startChanged(false)
+ , m_endChanged(false)
+ , m_deleteCursors(false)
+ , m_allowZeroLength(false)
+{
+ init();
+}
+
+KateSuperRange::KateSuperRange(KateDocument* doc, const KateRange& range, QObject* parent, const char* name)
+ : QObject(parent, name)
+ , m_start(new KateSuperCursor(doc, true, range.start()))
+ , m_end(new KateSuperCursor(doc, true, range.end()))
+ , m_evaluate(false)
+ , m_startChanged(false)
+ , m_endChanged(false)
+ , m_deleteCursors(true)
+ , m_allowZeroLength(false)
+{
+ init();
+}
+
+KateSuperRange::KateSuperRange(KateDocument* doc, const KateTextCursor& start, const KateTextCursor& end, QObject* parent, const char* name)
+ : QObject(parent, name)
+ , m_start(new KateSuperCursor(doc, true, start))
+ , m_end(new KateSuperCursor(doc, true, end))
+ , m_evaluate(false)
+ , m_startChanged(false)
+ , m_endChanged(false)
+ , m_deleteCursors(true)
+ , m_allowZeroLength(false)
+{
+ init();
+}
+
+void KateSuperRange::init()
+{
+ Q_ASSERT(isValid());
+ if (!isValid())
+ kdDebug(13020) << superStart() << " " << superEnd() << endl;
+
+ insertChild(m_start);
+ insertChild(m_end);
+
+ setBehaviour(DoNotExpand);
+
+ // Not necessarily the best implementation
+ connect(m_start, SIGNAL(positionDirectlyChanged()), SIGNAL(contentsChanged()));
+ connect(m_end, SIGNAL(positionDirectlyChanged()), SIGNAL(contentsChanged()));
+
+ connect(m_start, SIGNAL(positionChanged()), SLOT(slotEvaluateChanged()));
+ connect(m_end, SIGNAL(positionChanged()), SLOT(slotEvaluateChanged()));
+ connect(m_start, SIGNAL(positionUnChanged()), SLOT(slotEvaluateUnChanged()));
+ connect(m_end, SIGNAL(positionUnChanged()), SLOT(slotEvaluateUnChanged()));
+ connect(m_start, SIGNAL(positionDeleted()), SIGNAL(boundaryDeleted()));
+ connect(m_end, SIGNAL(positionDeleted()), SIGNAL(boundaryDeleted()));
+}
+
+KateSuperRange::~KateSuperRange()
+{
+ if (m_deleteCursors)
+ {
+ //insertChild(m_start);
+ //insertChild(m_end);
+ delete m_start;
+ delete m_end;
+ }
+}
+
+KateTextCursor& KateSuperRange::start()
+{
+ return *m_start;
+}
+
+const KateTextCursor& KateSuperRange::start() const
+{
+ return *m_start;
+}
+
+KateTextCursor& KateSuperRange::end()
+{
+ return *m_end;
+}
+
+const KateTextCursor& KateSuperRange::end() const
+{
+ return *m_end;
+}
+
+KateSuperCursor& KateSuperRange::superStart()
+{
+ return *m_start;
+}
+
+const KateSuperCursor& KateSuperRange::superStart() const
+{
+ return *m_start;
+}
+
+KateSuperCursor& KateSuperRange::superEnd()
+{
+ return *m_end;
+}
+
+const KateSuperCursor& KateSuperRange::superEnd() const
+{
+ return *m_end;
+}
+
+int KateSuperRange::behaviour() const
+{
+ return (m_start->moveOnInsert() ? DoNotExpand : ExpandLeft) | (m_end->moveOnInsert() ? ExpandRight : DoNotExpand);
+}
+
+void KateSuperRange::setBehaviour(int behaviour)
+{
+ m_start->setMoveOnInsert(behaviour & ExpandLeft);
+ m_end->setMoveOnInsert(!(behaviour & ExpandRight));
+}
+
+bool KateSuperRange::isValid() const
+{
+ return superStart() <= superEnd();
+}
+
+bool KateSuperRange::owns(const KateTextCursor& cursor) const
+{
+ if (!includes(cursor)) return false;
+
+ if (children())
+ for (QObjectListIt it(*children()); *it; ++it)
+ if ((*it)->inherits("KateSuperRange"))
+ if (static_cast<KateSuperRange*>(*it)->owns(cursor))
+ return false;
+
+ return true;
+}
+
+bool KateSuperRange::includes(const KateTextCursor& cursor) const
+{
+ return isValid() && cursor >= superStart() && cursor < superEnd();
+}
+
+bool KateSuperRange::includes(uint lineNum) const
+{
+ return isValid() && (int)lineNum >= superStart().line() && (int)lineNum <= superEnd().line();
+}
+
+bool KateSuperRange::includesWholeLine(uint lineNum) const
+{
+ return isValid() && ((int)lineNum > superStart().line() || ((int)lineNum == superStart().line() && superStart().atStartOfLine())) && ((int)lineNum < superEnd().line() || ((int)lineNum == superEnd().line() && superEnd().atEndOfLine()));
+}
+
+bool KateSuperRange::boundaryAt(const KateTextCursor& cursor) const
+{
+ return isValid() && (cursor == superStart() || cursor == superEnd());
+}
+
+bool KateSuperRange::boundaryOn(uint lineNum) const
+{
+ return isValid() && (superStart().line() == (int)lineNum || superEnd().line() == (int)lineNum);
+}
+
+void KateSuperRange::slotEvaluateChanged()
+{
+ if (sender() == static_cast<QObject*>(m_start)) {
+ if (m_evaluate) {
+ if (!m_endChanged) {
+ // Only one was changed
+ evaluateEliminated();
+
+ } else {
+ // Both were changed
+ evaluatePositionChanged();
+ m_endChanged = false;
+ }
+
+ } else {
+ m_startChanged = true;
+ }
+
+ } else {
+ if (m_evaluate) {
+ if (!m_startChanged) {
+ // Only one was changed
+ evaluateEliminated();
+
+ } else {
+ // Both were changed
+ evaluatePositionChanged();
+ m_startChanged = false;
+ }
+
+ } else {
+ m_endChanged = true;
+ }
+ }
+
+ m_evaluate = !m_evaluate;
+}
+
+void KateSuperRange::slotEvaluateUnChanged()
+{
+ if (sender() == static_cast<QObject*>(m_start)) {
+ if (m_evaluate) {
+ if (m_endChanged) {
+ // Only one changed
+ evaluateEliminated();
+ m_endChanged = false;
+
+ } else {
+ // Neither changed
+ emit positionUnChanged();
+ }
+ }
+
+ } else {
+ if (m_evaluate) {
+ if (m_startChanged) {
+ // Only one changed
+ evaluateEliminated();
+ m_startChanged = false;
+
+ } else {
+ // Neither changed
+ emit positionUnChanged();
+ }
+ }
+ }
+
+ m_evaluate = !m_evaluate;
+}
+
+void KateSuperRange::slotTagRange()
+{
+ emit tagRange(this);
+}
+
+void KateSuperRange::evaluateEliminated()
+{
+ if (superStart() == superEnd()) {
+ if (!m_allowZeroLength) emit eliminated();
+ }
+ else
+ emit contentsChanged();
+}
+
+void KateSuperRange::evaluatePositionChanged()
+{
+ if (superStart() == superEnd())
+ emit eliminated();
+ else
+ emit positionChanged();
+}
+
+int KateSuperCursorList::compareItems(QPtrCollection::Item item1, QPtrCollection::Item item2)
+{
+ if (*(static_cast<KateSuperCursor*>(item1)) == *(static_cast<KateSuperCursor*>(item2)))
+ return 0;
+
+ return *(static_cast<KateSuperCursor*>(item1)) < *(static_cast<KateSuperCursor*>(item2)) ? -1 : 1;
+}
+
+KateSuperRangeList::KateSuperRangeList(bool autoManage, QObject* parent, const char* name)
+ : QObject(parent, name)
+ , m_autoManage(autoManage)
+ , m_connect(true)
+ , m_trackingBoundaries(false)
+{
+ setAutoManage(autoManage);
+}
+
+KateSuperRangeList::KateSuperRangeList(const QPtrList<KateSuperRange>& rangeList, QObject* parent, const char* name)
+ : QObject(parent, name)
+ , m_autoManage(false)
+ , m_connect(false)
+ , m_trackingBoundaries(false)
+{
+ appendList(rangeList);
+}
+
+void KateSuperRangeList::appendList(const QPtrList<KateSuperRange>& rangeList)
+{
+ for (QPtrListIterator<KateSuperRange> it = rangeList; *it; ++it)
+ append(*it);
+}
+
+void KateSuperRangeList::clear()
+{
+ for (KateSuperRange* range = first(); range; range = next())
+ emit rangeEliminated(range);
+
+ QPtrList<KateSuperRange>::clear();
+}
+
+void KateSuperRangeList::connectAll()
+{
+ if (!m_connect) {
+ m_connect = true;
+ for (KateSuperRange* range = first(); range; range = next()) {
+ connect(range, SIGNAL(destroyed(QObject*)), SLOT(slotDeleted(QObject*)));
+ connect(range, SIGNAL(eliminated()), SLOT(slotEliminated()));
+ }
+ }
+}
+
+bool KateSuperRangeList::autoManage() const
+{
+ return m_autoManage;
+}
+
+void KateSuperRangeList::setAutoManage(bool autoManage)
+{
+ m_autoManage = autoManage;
+ setAutoDelete(m_autoManage);
+}
+
+QPtrList<KateSuperRange> KateSuperRangeList::rangesIncluding(const KateTextCursor& cursor)
+{
+ sort();
+
+ QPtrList<KateSuperRange> ret;
+
+ for (KateSuperRange* r = first(); r; r = next())
+ if (r->includes(cursor))
+ ret.append(r);
+
+ return ret;
+}
+
+QPtrList<KateSuperRange> KateSuperRangeList::rangesIncluding(uint line)
+{
+ sort();
+
+ QPtrList<KateSuperRange> ret;
+
+ for (KateSuperRange* r = first(); r; r = next())
+ if (r->includes(line))
+ ret.append(r);
+
+ return ret;
+}
+
+bool KateSuperRangeList::rangesInclude(const KateTextCursor& cursor)
+{
+ for (KateSuperRange* r = first(); r; r = next())
+ if (r->includes(cursor))
+ return true;
+
+ return false;
+}
+
+void KateSuperRangeList::slotEliminated()
+{
+ if (sender()) {
+ KateSuperRange* range = static_cast<KateSuperRange*>(const_cast<QObject*>(sender()));
+ emit rangeEliminated(range);
+
+ if (m_trackingBoundaries) {
+ m_columnBoundaries.removeRef(range->m_start);
+ m_columnBoundaries.removeRef(range->m_end);
+ }
+
+ if (m_autoManage)
+ removeRef(range);
+
+ if (!count())
+ emit listEmpty();
+ }
+}
+
+void KateSuperRangeList::slotDeleted(QObject* range)
+{
+ //kdDebug(13020)<<"KateSuperRangeList::slotDeleted"<<endl;
+ KateSuperRange* r = static_cast<KateSuperRange*>(range);
+
+ if (m_trackingBoundaries) {
+ m_columnBoundaries.removeRef(r->m_start);
+ m_columnBoundaries.removeRef(r->m_end);
+ }
+
+ int index = findRef(r);
+ if (index != -1)
+ take(index);
+ //else kdDebug(13020)<<"Range not found in list"<<endl;
+
+ if (!count())
+ emit listEmpty();
+}
+
+KateSuperCursor* KateSuperRangeList::firstBoundary(const KateTextCursor* start)
+{
+ if (!m_trackingBoundaries) {
+ m_trackingBoundaries = true;
+
+ for (KateSuperRange* r = first(); r; r = next()) {
+ m_columnBoundaries.append(&(r->superStart()));
+ m_columnBoundaries.append(&(r->superEnd()));
+ }
+ }
+
+ m_columnBoundaries.sort();
+
+ if (start)
+ // OPTIMISE: QMap with QPtrList for each line? (==> sorting issues :( )
+ for (KateSuperCursor* c = m_columnBoundaries.first(); c; c = m_columnBoundaries.next())
+ if (*start <= *c)
+ break;
+
+ return m_columnBoundaries.current();
+}
+
+KateSuperCursor* KateSuperRangeList::nextBoundary()
+{
+ KateSuperCursor* current = m_columnBoundaries.current();
+
+ // make sure the new cursor is after the current cursor; multiple cursors with the same position can be in the list.
+ if (current)
+ while (m_columnBoundaries.next())
+ if (*(m_columnBoundaries.current()) != *current)
+ break;
+
+ return m_columnBoundaries.current();
+}
+
+KateSuperCursor* KateSuperRangeList::currentBoundary()
+{
+ return m_columnBoundaries.current();
+}
+
+int KateSuperRangeList::compareItems(QPtrCollection::Item item1, QPtrCollection::Item item2)
+{
+ if (static_cast<KateSuperRange*>(item1)->superStart() == static_cast<KateSuperRange*>(item2)->superStart()) {
+ if (static_cast<KateSuperRange*>(item1)->superEnd() == static_cast<KateSuperRange*>(item2)->superEnd()) {
+ return 0;
+ } else {
+ return static_cast<KateSuperRange*>(item1)->superEnd() < static_cast<KateSuperRange*>(item2)->superEnd() ? -1 : 1;
+ }
+ }
+
+ return static_cast<KateSuperRange*>(item1)->superStart() < static_cast<KateSuperRange*>(item2)->superStart() ? -1 : 1;
+}
+
+QPtrCollection::Item KateSuperRangeList::newItem(QPtrCollection::Item d)
+{
+ if (m_connect) {
+ connect(static_cast<KateSuperRange*>(d), SIGNAL(destroyed(QObject*)), SLOT(slotDeleted(QObject*)));
+ connect(static_cast<KateSuperRange*>(d), SIGNAL(eliminated()), SLOT(slotEliminated()));
+ connect(static_cast<KateSuperRange*>(d), SIGNAL(tagRange(KateSuperRange*)), SIGNAL(tagRange(KateSuperRange*)));
+
+ // HACK HACK
+ static_cast<KateSuperRange*>(d)->slotTagRange();
+ }
+
+ if (m_trackingBoundaries) {
+ m_columnBoundaries.append(&(static_cast<KateSuperRange*>(d)->superStart()));
+ m_columnBoundaries.append(&(static_cast<KateSuperRange*>(d)->superEnd()));
+ }
+
+ return QPtrList<KateSuperRange>::newItem(d);
+}
+
+// kate: space-indent on; indent-width 2; replace-tabs on;
diff --git a/kate/part/katesupercursor.h b/kate/part/katesupercursor.h
new file mode 100644
index 000000000..e6b16baa8
--- /dev/null
+++ b/kate/part/katesupercursor.h
@@ -0,0 +1,463 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2003 Hamish Rodda <rodda@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef KATESUPERCURSOR_H
+#define KATESUPERCURSOR_H
+
+#include "katecursor.h"
+
+class KateDocument;
+class KateView;
+
+/**
+ * Possible additional features:
+ * - Notification when a cursor enters or exits a view
+ * - suggest something :)
+ *
+ * Unresolved issues:
+ * - testing, testing, testing
+ * - ie. everything which hasn't already been tested, you can see that which has inside the #ifdefs
+ * - api niceness
+ */
+
+/**
+ * A cursor which updates and gives off various interesting signals.
+ *
+ * This aims to be a working version of what KateCursor was originally intended to be.
+ *
+ * @author Hamish Rodda
+ **/
+class KateSuperCursor : public QObject, public KateDocCursor, public Kate::Cursor
+{
+ Q_OBJECT
+
+public:
+ /**
+ * bool privateC says: if private, than don't show to apps using the cursorinterface in the list,
+ * all internally only used SuperCursors should be private or people could modify them from the
+ * outside breaking kate's internals
+ */
+ KateSuperCursor(KateDocument* doc, bool privateC, const KateTextCursor& cursor, QObject* parent = 0L, const char* name = 0L);
+ KateSuperCursor(KateDocument* doc, bool privateC, int lineNum = 0, int col = 0, QObject* parent = 0L, const char* name = 0L);
+
+ ~KateSuperCursor ();
+
+ public:
+ // KTextEditor::Cursor interface
+ void position(uint *line, uint *col) const;
+ bool setPosition(uint line, uint col);
+ bool insertText(const QString& text);
+ bool removeText(uint numberOfCharacters);
+ QChar currentChar() const;
+
+ /**
+ * @returns true if the cursor is situated at the start of the line, false if it isn't.
+ */
+ bool atStartOfLine() const;
+
+ /**
+ * @returns true if the cursor is situated at the end of the line, false if it isn't.
+ */
+ bool atEndOfLine() const;
+
+ /**
+ * Returns how this cursor behaves when text is inserted at the cursor.
+ * Defaults to not moving on insert.
+ */
+ bool moveOnInsert() const;
+
+ /**
+ * Change the behavior of the cursor when text is inserted at the cursor.
+ *
+ * If @p moveOnInsert is true, the cursor will end up at the end of the insert.
+ */
+ void setMoveOnInsert(bool moveOnInsert);
+
+ /**
+ * Debug: output the position.
+ */
+ operator QString();
+
+ // Reimplementations;
+ virtual void setLine(int lineNum);
+ virtual void setCol(int colNum);
+ virtual void setPos(const KateTextCursor& pos);
+ virtual void setPos(int lineNum, int colNum);
+
+ signals:
+ /**
+ * The cursor's position was directly changed by the program.
+ */
+ void positionDirectlyChanged();
+
+ /**
+ * The cursor's position was changed.
+ */
+ void positionChanged();
+
+ /**
+ * Athough an edit took place, the cursor's position was unchanged.
+ */
+ void positionUnChanged();
+
+ /**
+ * The cursor's surrounding characters were both deleted simultaneously.
+ * The cursor is automatically placed at the start of the deleted region.
+ */
+ void positionDeleted();
+
+ /**
+ * A character was inserted immediately before the cursor.
+ *
+ * Whether the char was inserted before or after this cursor depends on
+ * moveOnInsert():
+ * @li true -> the char was inserted before
+ * @li false -> the char was inserted after
+ */
+ void charInsertedAt();
+
+ /**
+ * The character immediately before the cursor was deleted.
+ */
+ void charDeletedBefore();
+
+ /**
+ * The character immediately after the cursor was deleted.
+ */
+ void charDeletedAfter();
+
+ //BEGIN METHODES TO CALL FROM KATE DOCUMENT TO KEEP CURSOR UP TO DATE
+ public:
+ void editTextInserted ( uint line, uint col, uint len);
+ void editTextRemoved ( uint line, uint col, uint len);
+
+ void editLineWrapped ( uint line, uint col, bool newLine = true );
+ void editLineUnWrapped ( uint line, uint col, bool removeLine = true, uint length = 0 );
+
+ void editLineInserted ( uint line );
+ void editLineRemoved ( uint line );
+ //END
+
+ private:
+ KateDocument *m_doc;
+ bool m_moveOnInsert : 1;
+ bool m_lineRemoved : 1;
+ bool m_privateCursor : 1;
+};
+
+/**
+ * Represents a range of text, from the start() to the end().
+ *
+ * Also tracks its position and emits useful signals.
+ */
+class KateSuperRange : public QObject, public KateRange
+{
+ friend class KateSuperRangeList;
+
+ Q_OBJECT
+
+public:
+ /// Determine how the range reacts to characters inserted immediately outside the range.
+ enum InsertBehaviour {
+ /// Don't expand to encapsulate new characters in either direction. This is the default.
+ DoNotExpand = 0,
+ /// Expand to encapsulate new characters to the left of the range.
+ ExpandLeft = 0x1,
+ /// Expand to encapsulate new characters to the right of the range.
+ ExpandRight = 0x2
+ };
+
+ /**
+ * Constructor. Takes posession of @p start and @p end.
+ */
+ KateSuperRange(KateSuperCursor* start, KateSuperCursor* end, QObject* parent = 0L, const char* name = 0L);
+ KateSuperRange(KateDocument* doc, const KateRange& range, QObject* parent = 0L, const char* name = 0L);
+ KateSuperRange(KateDocument* doc, const KateTextCursor& start, const KateTextCursor& end, QObject* parent = 0L, const char* name = 0L);
+
+ virtual ~KateSuperRange();
+
+ // fulfill KateRange requirements
+ virtual KateTextCursor& start();
+ virtual KateTextCursor& end();
+ virtual const KateTextCursor& start() const;
+ virtual const KateTextCursor& end() const;
+
+ void allowZeroLength(bool yes=true){m_allowZeroLength=yes;}
+ /**
+ * Returns the super start cursor.
+ */
+ KateSuperCursor& superStart();
+ const KateSuperCursor& superStart() const;
+
+ /**
+ * Returns the super end cursor.
+ */
+ KateSuperCursor& superEnd();
+ const KateSuperCursor& superEnd() const;
+
+ /**
+ * Returns how this range reacts to characters inserted immediately outside the range.
+ */
+ int behaviour() const;
+
+ /**
+ * Determine how the range should react to characters inserted immediately outside the range.
+ *
+ * TODO does this need a custom function to enable determining of the behavior based on the
+ * text that is inserted / deleted?
+ *
+ * @sa InsertBehaviour
+ */
+ void setBehaviour(int behaviour);
+
+ /**
+ * Start and end must be valid and start <= end.
+ */
+ virtual bool isValid() const;
+
+ /**
+ * This is for use where the ranges are used in a heirachy,
+ * ie. their parents are KateSuperRanges which completely
+ * encapsulate them.
+ *
+ * @todo constrain children when their position changes deliberately;
+ * eliminate() children when they are equivalent to their parents
+ *
+ * @returns true if the range contains the cursor and no children
+ * also contain it; false otherwise.
+ */
+ bool owns(const KateTextCursor& cursor) const;
+
+ /**
+ * Returns true if the range includes @p cursor 's character.
+ * Returns false if @p cursor == end().
+ */
+ bool includes(const KateTextCursor& cursor) const;
+
+ /**
+ * Returns true if the range includes @p line
+ */
+ bool includes(uint lineNum) const;
+
+ /**
+ * Returns true if the range totally encompasses @p line
+ */
+ bool includesWholeLine(uint lineNum) const;
+
+ /**
+ * Returns whether @p cursor is the site of a boundary of this range.
+ */
+ bool boundaryAt(const KateTextCursor& cursor) const;
+
+ /**
+ * Returns whether there is a boundary of this range on @p line.
+ */
+ bool boundaryOn(uint lineNum) const;
+
+signals:
+ /**
+ * More interesting signals that aren't worth implementing here:
+ * firstCharDeleted: start()::charDeleted()
+ * lastCharDeleted: end()::previousCharDeleted()
+ */
+
+ /**
+ * The range's position changed.
+ */
+ void positionChanged();
+
+ /**
+ * The range's position was unchanged.
+ */
+ void positionUnChanged();
+
+ /**
+ * The contents of the range changed.
+ */
+ void contentsChanged();
+
+ /**
+ * Either cursor's surrounding characters were both deleted.
+ */
+ void boundaryDeleted();
+
+ /**
+ * The range now contains no characters (ie. the start and end cursors are the same).
+ *
+ * To eliminate this range under different conditions, connect the other signal directly
+ * to this signal.
+ */
+ void eliminated();
+
+ /**
+ * Indicates the region needs re-drawing.
+ */
+ void tagRange(KateSuperRange* range);
+
+public slots:
+ void slotTagRange();
+
+private slots:
+ void slotEvaluateChanged();
+ void slotEvaluateUnChanged();
+
+private:
+ void init();
+ void evaluateEliminated();
+ void evaluatePositionChanged();
+
+ KateSuperCursor* m_start;
+ KateSuperCursor* m_end;
+ bool m_evaluate;
+ bool m_startChanged;
+ bool m_endChanged;
+ bool m_deleteCursors;
+ bool m_allowZeroLength;
+};
+
+class KateSuperCursorList : public QPtrList<KateSuperCursor>
+{
+protected:
+ virtual int compareItems(QPtrCollection::Item item1, QPtrCollection::Item item2);
+};
+
+class KateSuperRangeList : public QObject, public QPtrList<KateSuperRange>
+{
+ Q_OBJECT
+
+public:
+ /**
+ * @sa autoManage()
+ */
+ KateSuperRangeList(bool autoManage = true, QObject* parent = 0L, const char* name = 0L);
+
+ /**
+ * Semi-copy constructor.
+ *
+ * Does not copy auto-manage value, as that would make it too easy to perform
+ * double-deletions.
+ *
+ * Also, does not connect signals and slots to save time, as this is mainly
+ * used by the document itself while drawing (call connectAll() to re-constitute)
+ */
+ KateSuperRangeList(const QPtrList<KateSuperRange>& rangeList, QObject* parent = 0L, const char* name = 0L);
+
+ virtual ~KateSuperRangeList() {}
+ /**
+ * Append another list.
+ * If this object was created by the semi-copy constructor, it may not connect items
+ * (unless connectAll() has already been called), call connectAll().
+ */
+ void appendList(const QPtrList<KateSuperRange>& rangeList);
+
+ /**
+ * Connect items that are not connected. This only needs to be called once,
+ * and only if this was created with the semi-copy constructor.
+ */
+ void connectAll();
+
+ /**
+ * Override to emit rangeEliminated() signals.
+ */
+ virtual void clear();
+
+ /**
+ * Automanage is a combination of autodeleting of the objects and
+ * removing of any eliminated() ranges.
+ */
+ bool autoManage() const;
+
+ /**
+ * @sa autoManage()
+ */
+ void setAutoManage(bool autoManage);
+
+ /**
+ * This is just a straight-forward list so that there is no confusion about whether
+ * this list should be auto-managed (ie. it shouldn't, to avoid double deletions).
+ */
+ QPtrList<KateSuperRange> rangesIncluding(const KateTextCursor& cursor);
+ QPtrList<KateSuperRange> rangesIncluding(uint line);
+
+ /**
+ * @retval true if one of the ranges in the list includes @p cursor
+ * @retval false otherwise
+ */
+ bool rangesInclude(const KateTextCursor& cursor);
+
+ /**
+ * Construct a list of boundaries, and return the first, or 0L if there are none.
+ * If @p start is defined, the first boundary returned will be at or after @p start.
+ *
+ * @returns the first boundary location
+ */
+ KateSuperCursor* firstBoundary(const KateTextCursor* start = 0L);
+
+ /**
+ * @returns the next boundary, or 0L if there are no more.
+ */
+ KateSuperCursor* nextBoundary();
+
+ /**
+ * @returns the current boundary
+ */
+ KateSuperCursor* currentBoundary();
+
+signals:
+ /**
+ * The range now contains no characters (ie. the start and end cursors are the same).
+ * If autoManage() is true, the range will be deleted after the signal has processed.
+ */
+ void rangeEliminated(KateSuperRange* range);
+
+ /**
+ * There are no ranges left.
+ */
+ void listEmpty();
+
+ /**
+ * Connected to all ranges if connect()ed.
+ */
+ void tagRange(KateSuperRange* range);
+
+protected:
+ /**
+ * internal reimplementation
+ */
+ virtual int compareItems(QPtrCollection::Item item1, QPtrCollection::Item item2);
+
+ /**
+ * internal reimplementation
+ */
+ virtual QPtrCollection::Item newItem(QPtrCollection::Item d);
+
+private slots:
+ void slotEliminated();
+ void slotDeleted(QObject* range);
+
+private:
+ bool m_autoManage;
+ bool m_connect;
+
+ KateSuperCursorList m_columnBoundaries;
+ bool m_trackingBoundaries;
+};
+
+#endif
+
+// kate: space-indent on; indent-width 2; replace-tabs on;
diff --git a/kate/part/katesyntaxdocument.cpp b/kate/part/katesyntaxdocument.cpp
new file mode 100644
index 000000000..e5c18c8ef
--- /dev/null
+++ b/kate/part/katesyntaxdocument.cpp
@@ -0,0 +1,475 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2001 Joseph Wenninger <jowenn@kde.org>
+ Copyright (C) 2000 Scott Manson <sdmanson@alltel.net>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "katesyntaxdocument.h"
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+
+#include <kdebug.h>
+#include <kstandarddirs.h>
+#include <klocale.h>
+#include <kmessagebox.h>
+#include <kconfig.h>
+
+#include <qfile.h>
+
+KateSyntaxDocument::KateSyntaxDocument(bool force)
+ : QDomDocument()
+{
+ // Let's build the Mode List (katesyntaxhighlightingrc)
+ setupModeList(force);
+}
+
+KateSyntaxDocument::~KateSyntaxDocument()
+{
+ for (uint i=0; i < myModeList.size(); i++)
+ delete myModeList[i];
+}
+
+/** If the open hl file is different from the one needed, it opens
+ the new one and assign some other things.
+ identifier = File name and path of the new xml needed
+*/
+bool KateSyntaxDocument::setIdentifier(const QString& identifier)
+{
+ // if the current file is the same as the new one don't do anything.
+ if(currentFile != identifier)
+ {
+ // let's open the new file
+ QFile f( identifier );
+
+ if ( f.open(IO_ReadOnly) )
+ {
+ // Let's parse the contets of the xml file
+ /* The result of this function should be check for robustness,
+ a false returned means a parse error */
+ QString errorMsg;
+ int line, col;
+ bool success=setContent(&f,&errorMsg,&line,&col);
+
+ // Ok, now the current file is the pretended one (identifier)
+ currentFile = identifier;
+
+ // Close the file, is not longer needed
+ f.close();
+
+ if (!success)
+ {
+ KMessageBox::error(0L,i18n("<qt>The error <b>%4</b><br> has been detected in the file %1 at %2/%3</qt>").arg(identifier)
+ .arg(line).arg(col).arg(i18n("QXml",errorMsg.utf8())));
+ return false;
+ }
+ }
+ else
+ {
+ // Oh o, we couldn't open the file.
+ KMessageBox::error( 0L, i18n("Unable to open %1").arg(identifier) );
+ return false;
+ }
+ }
+ return true;
+}
+
+/**
+ * Jump to the next group, KateSyntaxContextData::currentGroup will point to the next group
+ */
+bool KateSyntaxDocument::nextGroup( KateSyntaxContextData* data)
+{
+ if(!data)
+ return false;
+
+ // No group yet so go to first child
+ if (data->currentGroup.isNull())
+ {
+ // Skip over non-elements. So far non-elements are just comments
+ QDomNode node = data->parent.firstChild();
+ while (node.isComment())
+ node = node.nextSibling();
+
+ data->currentGroup = node.toElement();
+ }
+ else
+ {
+ // common case, iterate over siblings, skipping comments as we go
+ QDomNode node = data->currentGroup.nextSibling();
+ while (node.isComment())
+ node = node.nextSibling();
+
+ data->currentGroup = node.toElement();
+ }
+
+ return !data->currentGroup.isNull();
+}
+
+/**
+ * Jump to the next item, KateSyntaxContextData::item will point to the next item
+ */
+bool KateSyntaxDocument::nextItem( KateSyntaxContextData* data)
+{
+ if(!data)
+ return false;
+
+ if (data->item.isNull())
+ {
+ QDomNode node = data->currentGroup.firstChild();
+ while (node.isComment())
+ node = node.nextSibling();
+
+ data->item = node.toElement();
+ }
+ else
+ {
+ QDomNode node = data->item.nextSibling();
+ while (node.isComment())
+ node = node.nextSibling();
+
+ data->item = node.toElement();
+ }
+
+ return !data->item.isNull();
+}
+
+/**
+ * This function is used to fetch the atributes of the tags of the item in a KateSyntaxContextData.
+ */
+QString KateSyntaxDocument::groupItemData( const KateSyntaxContextData* data, const QString& name){
+ if(!data)
+ return QString::null;
+
+ // If there's no name just return the tag name of data->item
+ if ( (!data->item.isNull()) && (name.isEmpty()))
+ {
+ return data->item.tagName();
+ }
+
+ // if name is not empty return the value of the attribute name
+ if (!data->item.isNull())
+ {
+ return data->item.attribute(name);
+ }
+
+ return QString::null;
+
+}
+
+QString KateSyntaxDocument::groupData( const KateSyntaxContextData* data,const QString& name)
+{
+ if(!data)
+ return QString::null;
+
+ if (!data->currentGroup.isNull())
+ {
+ return data->currentGroup.attribute(name);
+ }
+ else
+ {
+ return QString::null;
+ }
+}
+
+void KateSyntaxDocument::freeGroupInfo( KateSyntaxContextData* data)
+{
+ if (data)
+ delete data;
+}
+
+KateSyntaxContextData* KateSyntaxDocument::getSubItems(KateSyntaxContextData* data)
+{
+ KateSyntaxContextData *retval = new KateSyntaxContextData;
+
+ if (data != 0)
+ {
+ retval->parent = data->currentGroup;
+ retval->currentGroup = data->item;
+ }
+
+ return retval;
+}
+
+bool KateSyntaxDocument::getElement (QDomElement &element, const QString &mainGroupName, const QString &config)
+{
+ kdDebug(13010) << "Looking for \"" << mainGroupName << "\" -> \"" << config << "\"." << endl;
+
+ QDomNodeList nodes = documentElement().childNodes();
+
+ // Loop over all these child nodes looking for mainGroupName
+ for (unsigned int i=0; i<nodes.count(); i++)
+ {
+ QDomElement elem = nodes.item(i).toElement();
+ if (elem.tagName() == mainGroupName)
+ {
+ // Found mainGroupName ...
+ QDomNodeList subNodes = elem.childNodes();
+
+ // ... so now loop looking for config
+ for (unsigned int j=0; j<subNodes.count(); j++)
+ {
+ QDomElement subElem = subNodes.item(j).toElement();
+ if (subElem.tagName() == config)
+ {
+ // Found it!
+ element = subElem;
+ return true;
+ }
+ }
+
+ kdDebug(13010) << "WARNING: \""<< config <<"\" wasn't found!" << endl;
+ return false;
+ }
+ }
+
+ kdDebug(13010) << "WARNING: \""<< mainGroupName <<"\" wasn't found!" << endl;
+ return false;
+}
+
+/**
+ * Get the KateSyntaxContextData of the QDomElement Config inside mainGroupName
+ * KateSyntaxContextData::item will contain the QDomElement found
+ */
+KateSyntaxContextData* KateSyntaxDocument::getConfig(const QString& mainGroupName, const QString &config)
+{
+ QDomElement element;
+ if (getElement(element, mainGroupName, config))
+ {
+ KateSyntaxContextData *data = new KateSyntaxContextData;
+ data->item = element;
+ return data;
+ }
+ return 0;
+}
+
+/**
+ * Get the KateSyntaxContextData of the QDomElement Config inside mainGroupName
+ * KateSyntaxContextData::parent will contain the QDomElement found
+ */
+KateSyntaxContextData* KateSyntaxDocument::getGroupInfo(const QString& mainGroupName, const QString &group)
+{
+ QDomElement element;
+ if (getElement(element, mainGroupName, group+"s"))
+ {
+ KateSyntaxContextData *data = new KateSyntaxContextData;
+ data->parent = element;
+ return data;
+ }
+ return 0;
+}
+
+/**
+ * Returns a list with all the keywords inside the list type
+ */
+QStringList& KateSyntaxDocument::finddata(const QString& mainGroup, const QString& type, bool clearList)
+{
+ kdDebug(13010)<<"Create a list of keywords \""<<type<<"\" from \""<<mainGroup<<"\"."<<endl;
+ if (clearList)
+ m_data.clear();
+
+ for(QDomNode node = documentElement().firstChild(); !node.isNull(); node = node.nextSibling())
+ {
+ QDomElement elem = node.toElement();
+ if (elem.tagName() == mainGroup)
+ {
+ kdDebug(13010)<<"\""<<mainGroup<<"\" found."<<endl;
+ QDomNodeList nodelist1 = elem.elementsByTagName("list");
+
+ for (uint l=0; l<nodelist1.count(); l++)
+ {
+ if (nodelist1.item(l).toElement().attribute("name") == type)
+ {
+ kdDebug(13010)<<"List with attribute name=\""<<type<<"\" found."<<endl;
+ QDomNodeList childlist = nodelist1.item(l).toElement().childNodes();
+
+ for (uint i=0; i<childlist.count(); i++)
+ {
+ QString element = childlist.item(i).toElement().text().stripWhiteSpace();
+ if (element.isEmpty())
+ continue;
+#ifndef NDEBUG
+ if (i<6)
+ {
+ kdDebug(13010)<<"\""<<element<<"\" added to the list \""<<type<<"\""<<endl;
+ }
+ else if(i==6)
+ {
+ kdDebug(13010)<<"... The list continues ..."<<endl;
+ }
+#endif
+ m_data += element;
+ }
+
+ break;
+ }
+ }
+ break;
+ }
+ }
+
+ return m_data;
+}
+
+// Private
+/** Generate the list of hl modes, store them in myModeList
+ force: if true forces to rebuild the Mode List from the xml files (instead of katesyntax...rc)
+*/
+void KateSyntaxDocument::setupModeList (bool force)
+{
+ // If there's something in myModeList the Mode List was already built so, don't do it again
+ if (!myModeList.isEmpty())
+ return;
+
+ // We'll store the ModeList in katesyntaxhighlightingrc
+ KConfig config("katesyntaxhighlightingrc", false, false);
+
+ // figure our if the kate install is too new
+ config.setGroup ("General");
+ if (config.readNumEntry ("Version") > config.readNumEntry ("CachedVersion"))
+ {
+ config.writeEntry ("CachedVersion", config.readNumEntry ("Version"));
+ force = true;
+ }
+
+ // Let's get a list of all the xml files for hl
+ QStringList list = KGlobal::dirs()->findAllResources("data","katepart/syntax/*.xml",false,true);
+
+ // Let's iterate through the list and build the Mode List
+ for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it )
+ {
+ // Each file has a group called:
+ QString Group="Cache "+ *it;
+
+ // Let's go to this group
+ config.setGroup(Group);
+
+ // stat the file
+ struct stat sbuf;
+ memset (&sbuf, 0, sizeof(sbuf));
+ stat(QFile::encodeName(*it), &sbuf);
+
+ // If the group exist and we're not forced to read the xml file, let's build myModeList for katesyntax..rc
+ if (!force && config.hasGroup(Group) && (sbuf.st_mtime == config.readNumEntry("lastModified")))
+ {
+ // Let's make a new KateSyntaxModeListItem to instert in myModeList from the information in katesyntax..rc
+ KateSyntaxModeListItem *mli=new KateSyntaxModeListItem;
+ mli->name = config.readEntry("name");
+ mli->nameTranslated = i18n("Language",mli->name.utf8());
+ mli->section = i18n("Language Section",config.readEntry("section").utf8());
+ mli->mimetype = config.readEntry("mimetype");
+ mli->extension = config.readEntry("extension");
+ mli->version = config.readEntry("version");
+ mli->priority = config.readEntry("priority");
+ mli->author = config.readEntry("author");
+ mli->license = config.readEntry("license");
+ mli->hidden = config.readBoolEntry("hidden");
+ mli->identifier = *it;
+
+ // Apend the item to the list
+ myModeList.append(mli);
+ }
+ else
+ {
+ kdDebug (13010) << "UPDATE hl cache for: " << *it << endl;
+
+ // We're forced to read the xml files or the mode doesn't exist in the katesyntax...rc
+ QFile f(*it);
+
+ if (f.open(IO_ReadOnly))
+ {
+ // Ok we opened the file, let's read the contents and close the file
+ /* the return of setContent should be checked because a false return shows a parsing error */
+ QString errMsg;
+ int line, col;
+
+ bool success = setContent(&f,&errMsg,&line,&col);
+
+ f.close();
+
+ if (success)
+ {
+ QDomElement root = documentElement();
+
+ if (!root.isNull())
+ {
+ // If the 'first' tag is language, go on
+ if (root.tagName()=="language")
+ {
+ // let's make the mode list item.
+ KateSyntaxModeListItem *mli = new KateSyntaxModeListItem;
+
+ mli->name = root.attribute("name");
+ mli->section = root.attribute("section");
+ mli->mimetype = root.attribute("mimetype");
+ mli->extension = root.attribute("extensions");
+ mli->version = root.attribute("version");
+ mli->priority = root.attribute("priority");
+ mli->author = root.attribute("author");
+ mli->license = root.attribute("license");
+
+ QString hidden = root.attribute("hidden");
+ mli->hidden = (hidden == "true" || hidden == "TRUE");
+
+ mli->identifier = *it;
+
+ // Now let's write or overwrite (if force==true) the entry in katesyntax...rc
+ config.setGroup(Group);
+ config.writeEntry("name",mli->name);
+ config.writeEntry("section",mli->section);
+ config.writeEntry("mimetype",mli->mimetype);
+ config.writeEntry("extension",mli->extension);
+ config.writeEntry("version",mli->version);
+ config.writeEntry("priority",mli->priority);
+ config.writeEntry("author",mli->author);
+ config.writeEntry("license",mli->license);
+ config.writeEntry("hidden",mli->hidden);
+
+ // modified time to keep cache in sync
+ config.writeEntry("lastModified", sbuf.st_mtime);
+
+ // Now that the data is in the config file, translate section
+ mli->section = i18n("Language Section",mli->section.utf8());
+ mli->nameTranslated = i18n("Language",mli->name.utf8());
+
+ // Append the new item to the list.
+ myModeList.append(mli);
+ }
+ }
+ }
+ else
+ {
+ KateSyntaxModeListItem *emli=new KateSyntaxModeListItem;
+
+ emli->section=i18n("Errors!");
+ emli->mimetype="invalid_file/invalid_file";
+ emli->extension="invalid_file.invalid_file";
+ emli->version="1.";
+ emli->name=QString ("Error: %1").arg(*it); // internal
+ emli->nameTranslated=i18n("Error: %1").arg(*it); // translated
+ emli->identifier=(*it);
+
+ myModeList.append(emli);
+ }
+ }
+ }
+ }
+
+ // Syncronize with the file katesyntax...rc
+ config.sync();
+}
+
+// kate: space-indent on; indent-width 2; replace-tabs on;
diff --git a/kate/part/katesyntaxdocument.h b/kate/part/katesyntaxdocument.h
new file mode 100644
index 000000000..1e5171390
--- /dev/null
+++ b/kate/part/katesyntaxdocument.h
@@ -0,0 +1,164 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2001 Joseph Wenninger <jowenn@kde.org>
+ Copyright (C) 2000 Scott Manson <sdmanson@alltel.net>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef __KATE_SYNTAXDOCUMENT_H__
+#define __KATE_SYNTAXDOCUMENT_H__
+
+#include <qdom.h>
+#include <qstringlist.h>
+
+/**
+ * Information about each syntax hl Mode
+ */
+class KateSyntaxModeListItem
+{
+ public:
+ QString name;
+ QString nameTranslated;
+ QString section;
+ QString mimetype;
+ QString extension;
+ QString identifier;
+ QString version;
+ QString priority;
+ QString author;
+ QString license;
+ bool hidden;
+};
+
+/**
+ * List of the KateSyntaxModeListItems holding all the syntax mode list items
+ */
+typedef QValueList<KateSyntaxModeListItem*> KateSyntaxModeList;
+
+/**
+ * Class holding the data around the current QDomElement
+ */
+class KateSyntaxContextData
+{
+ public:
+ QDomElement parent;
+ QDomElement currentGroup;
+ QDomElement item;
+};
+
+/**
+ * Store and manage the information about Syntax Highlighting.
+ */
+class KateSyntaxDocument : public QDomDocument
+{
+ public:
+ /**
+ * Constructor
+ * Sets the current file to nothing and build the ModeList (katesyntaxhighlightingrc)
+ * @param force fore the update of the hl cache
+ */
+ KateSyntaxDocument(bool force = false);
+
+ /**
+ * Desctructor
+ */
+ ~KateSyntaxDocument();
+
+ /**
+ * If the open hl file is different from the one needed, it opens
+ * the new one and assign some other things.
+ * @param identifier file name and path of the new xml needed
+ * @return success
+ */
+ bool setIdentifier(const QString& identifier);
+
+ /**
+ * Get the mode list
+ * @return mode list
+ */
+ const KateSyntaxModeList &modeList() { return myModeList; }
+
+ /**
+ * Jump to the next group, KateSyntaxContextData::currentGroup will point to the next group
+ * @param data context
+ * @return success
+ */
+ bool nextGroup(KateSyntaxContextData* data);
+
+ /**
+ * Jump to the next item, KateSyntaxContextData::item will point to the next item
+ * @param data context
+ * @return success
+ */
+ bool nextItem(KateSyntaxContextData* data);
+
+ /**
+ * This function is used to fetch the atributes of the tags.
+ */
+ QString groupItemData(const KateSyntaxContextData* data,const QString& name);
+ QString groupData(const KateSyntaxContextData* data,const QString& name);
+
+ void freeGroupInfo(KateSyntaxContextData* data);
+ KateSyntaxContextData* getSubItems(KateSyntaxContextData* data);
+
+ /**
+ * Get the KateSyntaxContextData of the DomElement Config inside mainGroupName
+ * It just fills KateSyntaxContextData::item
+ */
+ KateSyntaxContextData* getConfig(const QString& mainGroupName, const QString &config);
+
+ /**
+ * Get the KateSyntaxContextData of the QDomElement Config inside mainGroupName
+ * KateSyntaxContextData::parent will contain the QDomElement found
+ */
+ KateSyntaxContextData* getGroupInfo(const QString& mainGroupName, const QString &group);
+
+ /**
+ * Returns a list with all the keywords inside the list type
+ */
+ QStringList& finddata(const QString& mainGroup,const QString& type,bool clearList=true);
+
+ private:
+ /**
+ * Generate the list of hl modes, store them in myModeList
+ * @param force if true forces to rebuild the Mode List from the xml files (instead of katesyntax...rc)
+ */
+ void setupModeList(bool force);
+
+ /**
+ * Used by getConfig and getGroupInfo to traverse the xml nodes and
+ * evenually return the found element
+ */
+ bool getElement (QDomElement &element, const QString &mainGroupName, const QString &config);
+
+ /**
+ * List of mode items
+ */
+ KateSyntaxModeList myModeList;
+
+ /**
+ * current parsed filename
+ */
+ QString currentFile;
+
+ /**
+ * last found data out of the xml
+ */
+ QStringList m_data;
+};
+
+#endif
+
+// kate: space-indent on; indent-width 2; replace-tabs on;
diff --git a/kate/part/katetemplatehandler.cpp b/kate/part/katetemplatehandler.cpp
new file mode 100644
index 000000000..3ca86ff70
--- /dev/null
+++ b/kate/part/katetemplatehandler.cpp
@@ -0,0 +1,342 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2004 Joseph Wenninger <jowenn@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+#include "katetemplatehandler.h"
+#include "katetemplatehandler.moc"
+#include "katedocument.h"
+#include "katesupercursor.h"
+#include "katearbitraryhighlight.h"
+#include "kateview.h"
+#include <qregexp.h>
+#include <kdebug.h>
+#include <qvaluelist.h>
+
+KateTemplateHandler::KateTemplateHandler(
+ KateDocument *doc,
+ uint line, uint column,
+ const QString &templateString,
+ const QMap<QString, QString> &initialValues )
+ : QObject( doc )
+ , KateKeyInterceptorFunctor()
+ , m_doc( doc )
+ , m_currentTabStop( -1 )
+ , m_currentRange( 0 )
+ , m_initOk( false )
+ , m_recursion( false )
+{
+ connect( m_doc, SIGNAL( destroyed() ), this, SLOT( slotDocumentDestroyed() ) );
+ m_ranges = new KateSuperRangeList( false, this ); //false/*,this*/);
+
+ if ( !m_doc->setTabInterceptor( this ) )
+ {
+ deleteLater();
+ return ;
+ }
+
+ KateArbitraryHighlight *kah = doc->arbitraryHL();
+ /*KateArbitraryHighlightRange *hlr=new KateArbitraryHighlightRange(doc,KateTextCursor(line,column),
+ KateTextCursor(line,column+3));
+ hlr->setUnderline(true);
+ hlr->setOverline(true);
+ l->append(hlr);*/
+ QValueList<KateTemplateHandlerPlaceHolderInfo> buildList;
+ QRegExp rx( "([$%])\\{([^}\\s]+)\\}" );
+ rx.setMinimal( true );
+ int pos = 0;
+ int opos = 0;
+ QString insertString = templateString;
+
+ while ( pos >= 0 )
+ {
+ pos = rx.search( insertString, pos );
+
+ if ( pos > -1 )
+ {
+ if ( ( pos - opos ) > 0 )
+ {
+ if ( insertString[ pos - 1 ] == '\\' )
+ {
+ insertString.remove( pos - 1, 1 );
+ opos = pos;
+ continue;
+ }
+ }
+
+ QString placeholder = rx.cap( 2 );
+ QString value = initialValues[ placeholder ];
+
+ // don't add %{MACRO} to the tab navigation, unless there was not value
+ if ( rx.cap( 1 ) != "%" || placeholder == value )
+ buildList.append( KateTemplateHandlerPlaceHolderInfo( pos, value.length(), placeholder ) );
+
+ insertString.replace( pos, rx.matchedLength(), value );
+ pos += value.length();
+ opos = pos;
+ }
+ }
+
+ doc->editStart();
+
+ if ( !doc->insertText( line, column, insertString ) )
+ {
+ deleteLater();
+ doc->editEnd();
+ return ;
+ }
+
+ if ( buildList.isEmpty() )
+ {
+ m_initOk = true;
+ deleteLater();
+ doc->editEnd();
+ return ;
+ }
+
+ doc->undoSafePoint();
+ doc->editEnd();
+ generateRangeTable( line, column, insertString, buildList );
+ kah->addHighlightToDocument( m_ranges );
+
+ for ( KateSuperRangeList::const_iterator it = m_ranges->begin();it != m_ranges->end();++it )
+ {
+ m_doc->tagLines( ( *it ) ->start().line(), ( *it ) ->end().line() );
+ }
+
+ /* connect(doc,SIGNAL(charactersInteractivelyInserted(int ,int ,const QString&)),this,
+ SLOT(slotCharactersInteractivlyInserted(int,int,const QString&)));
+ connect(doc,SIGNAL(charactersSemiInteractivelyInserted(int ,int ,const QString&)),this,
+ SLOT(slotCharactersInteractivlyInserted(int,int,const QString&)));*/
+ connect( doc, SIGNAL( textInserted( int, int ) ), this, SLOT( slotTextInserted( int, int ) ) );
+ connect( doc, SIGNAL( aboutToRemoveText( const KateTextRange& ) ), this, SLOT( slotAboutToRemoveText( const KateTextRange& ) ) );
+ connect( doc, SIGNAL( textRemoved() ), this, SLOT( slotTextRemoved() ) );
+
+ ( *this ) ( Qt::Key_Tab );
+}
+
+KateTemplateHandler::~KateTemplateHandler()
+{
+ m_ranges->setAutoManage( true );
+
+ if ( m_doc )
+ {
+ m_doc->removeTabInterceptor( this );
+
+ for ( KateSuperRangeList::const_iterator it = m_ranges->begin();it != m_ranges->end();++it )
+ {
+ m_doc->tagLines( ( *it ) ->start().line(), ( *it ) ->end().line() );
+ }
+ }
+
+ m_ranges->clear();
+}
+
+void KateTemplateHandler::slotDocumentDestroyed() {m_doc = 0;}
+
+void KateTemplateHandler::generateRangeTable( uint insertLine, uint insertCol, const QString& insertString, const QValueList<KateTemplateHandlerPlaceHolderInfo> &buildList )
+{
+ uint line = insertLine;
+ uint col = insertCol;
+ uint colInText = 0;
+
+ for ( QValueList<KateTemplateHandlerPlaceHolderInfo>::const_iterator it = buildList.begin();it != buildList.end();++it )
+ {
+ KateTemplatePlaceHolder *ph = m_dict[ ( *it ).placeholder ];
+
+ if ( !ph )
+ {
+ ph = new KateTemplatePlaceHolder;
+ ph->isInitialValue = true;
+ ph->isCursor = ( ( *it ).placeholder == "cursor" );
+ m_dict.insert( ( *it ).placeholder, ph );
+
+ if ( !ph->isCursor ) m_tabOrder.append( ph );
+
+ ph->ranges.setAutoManage( false );
+ }
+
+ // FIXME handle space/tab replacement correctly make it use of the indenter
+ while ( colInText < ( *it ).begin )
+ {
+ ++col;
+
+ if ( insertString.at( colInText ) == '\n' )
+ {
+ col = 0;
+ line++;
+ }
+
+ ++colInText;
+ }
+
+ KateArbitraryHighlightRange *hlr = new KateArbitraryHighlightRange( m_doc, KateTextCursor( line, col ),
+ KateTextCursor( line, ( *it ).len + col ) );
+ colInText += ( *it ).len;
+ col += ( *it ).len;
+ hlr->allowZeroLength();
+ hlr->setUnderline( true );
+ hlr->setOverline( true );
+ //hlr->setBehaviour(KateSuperRange::ExpandRight);
+ ph->ranges.append( hlr );
+ m_ranges->append( hlr );
+ }
+
+ KateTemplatePlaceHolder *cursor = m_dict[ "cursor" ];
+
+ if ( cursor ) m_tabOrder.append( cursor );
+}
+
+void KateTemplateHandler::slotTextInserted( int line, int col )
+{
+#ifdef __GNUC__
+#warning FIXME undo/redo detection
+#endif
+
+ if ( m_recursion ) return ;
+
+ //if (m_editSessionNumber!=0) return; // assume that this is due an udno/redo operation right now
+ KateTextCursor cur( line, col );
+
+ if ( ( !m_currentRange ) ||
+ ( ( !m_currentRange->includes( cur ) ) && ( ! ( ( m_currentRange->start() == m_currentRange->end() ) && m_currentRange->end() == cur ) )
+ ) ) locateRange( cur );
+
+ if ( !m_currentRange ) return ;
+
+ KateTemplatePlaceHolder *ph = m_tabOrder.at( m_currentTabStop );
+
+ QString sourceText = m_doc->text ( m_currentRange->start().line(), m_currentRange->start().col(),
+ m_currentRange->end().line(), m_currentRange->end().col(), false );
+
+ ph->isInitialValue = false;
+ bool undoDontMerge = m_doc->m_undoDontMerge;
+ Q_ASSERT( m_doc->editSessionNumber == 0 );
+ m_recursion = true;
+
+ m_doc->editStart( /*false*/ );
+
+ for ( KateSuperRangeList::const_iterator it = ph->ranges.begin();it != ph->ranges.end();++it )
+ {
+ if ( ( *it ) == m_currentRange ) continue;
+
+ KateTextCursor start = ( *it ) ->start();
+ KateTextCursor end = ( *it ) ->end();
+ m_doc->removeText( start.line(), start.col(), end.line(), end.col(), false );
+ m_doc->insertText( start.line(), start.col(), sourceText );
+ }
+
+ m_doc->m_undoDontMerge = false;
+ m_doc->m_undoComplexMerge = true;
+ m_doc->undoSafePoint();
+ m_doc->editEnd();
+ m_doc->m_undoDontMerge = undoDontMerge;
+ m_recursion = false;
+
+ if ( ph->isCursor ) deleteLater();
+}
+
+void KateTemplateHandler::locateRange( const KateTextCursor& cursor )
+{
+ /* if (m_currentRange) {
+ m_doc->tagLines(m_currentRange->start().line(),m_currentRange->end().line());
+
+ }*/
+
+ for ( uint i = 0;i < m_tabOrder.count();i++ )
+ {
+ KateTemplatePlaceHolder *ph = m_tabOrder.at( i );
+
+ for ( KateSuperRangeList::const_iterator it = ph->ranges.begin();it != ph->ranges.end();++it )
+ {
+ if ( ( *it ) ->includes( cursor ) )
+ {
+ m_currentTabStop = i;
+ m_currentRange = ( *it );
+ //m_doc->tagLines(m_currentRange->start().line(),m_currentRange->end().line());
+ return ;
+ }
+ }
+
+ }
+
+ m_currentRange = 0;
+ /*while (m_ranges->count()>0)
+ delete (m_ranges->take(0));
+ disconnect(m_ranges,0,0,0);
+ delete m_ranges;*/
+ deleteLater();
+}
+
+
+bool KateTemplateHandler::operator() ( KKey key )
+{
+ if ( key==Qt::Key_Tab )
+ {
+ m_currentTabStop++;
+
+ if ( m_currentTabStop >= ( int ) m_tabOrder.count() )
+ m_currentTabStop = 0;
+ }
+ else
+ {
+ m_currentTabStop--;
+
+ if ( m_currentTabStop < 0 ) m_currentTabStop = m_tabOrder.count() - 1;
+ }
+
+ m_currentRange = m_tabOrder.at( m_currentTabStop ) ->ranges.at( 0 );
+
+ if ( m_tabOrder.at( m_currentTabStop ) ->isInitialValue )
+ {
+ m_doc->activeView()->setSelection( m_currentRange->start(), m_currentRange->end() );
+ }
+ else m_doc->activeView()->setSelection( m_currentRange->end(), m_currentRange->end() );
+
+ m_doc->activeView() ->setCursorPositionReal( m_currentRange->end().line(), m_currentRange->end().col() );
+ m_doc->activeView() ->tagLine( m_currentRange->end() );
+
+ return true;
+}
+
+void KateTemplateHandler::slotAboutToRemoveText( const KateTextRange &range )
+{
+ if ( m_recursion ) return ;
+
+ if ( m_currentRange && ( !m_currentRange->includes( range.start() ) ) ) locateRange( range.start() );
+
+ if ( m_currentRange != 0 )
+ {
+ if ( m_currentRange->end() <= range.end() ) return ;
+ }
+
+ if ( m_doc )
+ {
+ disconnect( m_doc, SIGNAL( textInserted( int, int ) ), this, SLOT( slotTextInserted( int, int ) ) );
+ disconnect( m_doc, SIGNAL( aboutToRemoveText( const KateTextRange& ) ), this, SLOT( slotAboutToRemoveText( const KateTextRange& ) ) );
+ disconnect( m_doc, SIGNAL( textRemoved() ), this, SLOT( slotTextRemoved() ) );
+ }
+
+ deleteLater();
+}
+
+void KateTemplateHandler::slotTextRemoved()
+{
+ if ( m_recursion ) return ;
+ if ( !m_currentRange ) return ;
+
+ slotTextInserted( m_currentRange->start().line(), m_currentRange->start().col() );
+}
+
diff --git a/kate/part/katetemplatehandler.h b/kate/part/katetemplatehandler.h
new file mode 100644
index 000000000..a2f41f518
--- /dev/null
+++ b/kate/part/katetemplatehandler.h
@@ -0,0 +1,68 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2004 Joseph Wenninger <jowenn@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+#ifndef _KATE_TEMPLATE_HANDLER_H_
+#define _KATE_TEMPLATE_HANDLER_H_
+
+#include "katesupercursor.h"
+#include "katekeyinterceptorfunctor.h"
+#include <qobject.h>
+#include <qmap.h>
+#include <qdict.h>
+#include <qptrlist.h>
+#include <qstring.h>
+
+class KateDocument;
+
+class KateTemplateHandler: public QObject, public KateKeyInterceptorFunctor {
+ Q_OBJECT
+ public:
+ KateTemplateHandler(KateDocument *doc,uint line,uint column, const QString &templateString, const QMap<QString,QString> &initialValues);
+ virtual ~KateTemplateHandler();
+ inline bool initOk() {return m_initOk;}
+ virtual bool operator()(KKey key);
+ private:
+ struct KateTemplatePlaceHolder {
+ KateSuperRangeList ranges;
+ bool isCursor;
+ bool isInitialValue;
+ };
+ class KateTemplateHandlerPlaceHolderInfo{
+ public:
+ KateTemplateHandlerPlaceHolderInfo():begin(0),len(0),placeholder(""){};
+ KateTemplateHandlerPlaceHolderInfo(uint begin_,uint len_,const QString& placeholder_):begin(begin_),len(len_),placeholder(placeholder_){}
+ uint begin;
+ uint len;
+ QString placeholder;
+ };
+ class KateSuperRangeList *m_ranges;
+ class KateDocument *m_doc;
+ QPtrList<KateTemplatePlaceHolder> m_tabOrder;
+ QDict<KateTemplatePlaceHolder> m_dict;
+ void generateRangeTable(uint insertLine,uint insertCol, const QString& insertString, const QValueList<KateTemplateHandlerPlaceHolderInfo> &buildList);
+ int m_currentTabStop;
+ KateSuperRange *m_currentRange;
+ void locateRange(const KateTextCursor &cursor );
+ bool m_initOk;
+ bool m_recursion;
+ private slots:
+ void slotTextInserted(int,int);
+ void slotDocumentDestroyed();
+ void slotAboutToRemoveText(const KateTextRange &range);
+ void slotTextRemoved();
+};
+#endif
diff --git a/kate/part/katetextline.cpp b/kate/part/katetextline.cpp
new file mode 100644
index 000000000..250be5236
--- /dev/null
+++ b/kate/part/katetextline.cpp
@@ -0,0 +1,443 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2001-2003 Christoph Cullmann <cullmann@kde.org>
+ Copyright (C) 2002 Joseph Wenninger <jowenn@kde.org>
+
+ Based on:
+ KateTextLine : Copyright (C) 1999 Jochen Wilhelmy <digisnap@cs.tu-berlin.de>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "katetextline.h"
+#include "katerenderer.h"
+
+#include <kglobal.h>
+
+#include <qregexp.h>
+
+KateTextLine::KateTextLine ()
+ : m_flags(0)
+{
+}
+
+KateTextLine::~KateTextLine()
+{
+}
+
+void KateTextLine::insertText (uint pos, uint insLen, const QChar *insText, uchar *insAttribs)
+{
+ // nothing to do
+ if (insLen == 0)
+ return;
+
+ // calc new textLen, store old
+ uint oldTextLen = m_text.length();
+ m_text.insert (pos, insText, insLen);
+ uint textLen = m_text.length();
+
+ // resize the array
+ m_attributes.resize (textLen);
+
+ // HA, insert behind text end, fill with spaces
+ if (pos >= oldTextLen)
+ {
+ for (uint z = oldTextLen; z < pos; z++)
+ m_attributes[z] = 0;
+ }
+ // HA, insert in text, move the old text behind pos
+ else if (oldTextLen > 0)
+ {
+ for (int z = oldTextLen -1; z >= (int) pos; z--)
+ m_attributes[z+insLen] = m_attributes[z];
+ }
+
+ // BUH, actually insert the new text
+ for (uint z = 0; z < insLen; z++)
+ {
+ if (insAttribs == 0)
+ m_attributes[z+pos] = 0;
+ else
+ m_attributes[z+pos] = insAttribs[z];
+ }
+}
+
+void KateTextLine::removeText (uint pos, uint delLen)
+{
+ // nothing to do
+ if (delLen == 0)
+ return;
+
+ uint textLen = m_text.length();
+
+ if (textLen == 0)
+ return; // uh, again nothing real to do ;)
+
+ if (pos >= textLen)
+ return;
+
+ if ((pos + delLen) > textLen)
+ delLen = textLen - pos;
+
+ // BU, MOVE THE OLD TEXT AROUND
+ for (uint z = pos; z < textLen - delLen; z++)
+ m_attributes[z] = m_attributes[z+delLen];
+
+ m_text.remove (pos, delLen);
+ m_attributes.resize (m_text.length ());
+}
+
+void KateTextLine::truncate(uint newLen)
+{
+ if (newLen < m_text.length())
+ {
+ m_text.truncate (newLen);
+ m_attributes.truncate (newLen);
+ }
+}
+
+int KateTextLine::nextNonSpaceChar(uint pos) const
+{
+ const uint len = m_text.length();
+ const QChar *unicode = m_text.unicode();
+
+ for(uint i = pos; i < len; i++)
+ {
+ if(!unicode[i].isSpace())
+ return i;
+ }
+
+ return -1;
+}
+
+int KateTextLine::previousNonSpaceChar(uint pos) const
+{
+ const int len = m_text.length();
+
+ if (pos >= (uint)len)
+ pos = len - 1;
+
+ const QChar *unicode = m_text.unicode();
+
+ for(int i = pos; i >= 0; i--)
+ {
+ if(!unicode[i].isSpace())
+ return i;
+ }
+
+ return -1;
+}
+
+int KateTextLine::firstChar() const
+{
+ return nextNonSpaceChar(0);
+}
+
+int KateTextLine::lastChar() const
+{
+ return previousNonSpaceChar(m_text.length() - 1);
+}
+
+const QChar *KateTextLine::firstNonSpace() const
+{
+ int first = firstChar();
+ return (first > -1) ? ((QChar*)m_text.unicode())+first : m_text.unicode();
+}
+
+uint KateTextLine::indentDepth (uint tabwidth) const
+{
+ uint d = 0;
+ const uint len = m_text.length();
+ const QChar *unicode = m_text.unicode();
+
+ for(uint i = 0; i < len; i++)
+ {
+ if(unicode[i].isSpace())
+ {
+ if (unicode[i] == QChar('\t'))
+ d += tabwidth - (d % tabwidth);
+ else
+ d++;
+ }
+ else
+ return d;
+ }
+
+ return d;
+}
+
+bool KateTextLine::stringAtPos(uint pos, const QString& match) const
+{
+ const uint len = m_text.length();
+ const uint matchlen = match.length();
+
+ if ((pos+matchlen) > len)
+ return false;
+
+ // (pos > len) in case the uint pos was assigned a signed -1, pos+matchlen can
+ // overflow again which (pos+matchlen > len) does not catch; see bugs #129263 and #129580
+ Q_ASSERT(pos < len);
+
+ const QChar *unicode = m_text.unicode();
+ const QChar *matchUnicode = match.unicode();
+
+ for (uint i=0; i < matchlen; i++)
+ if (unicode[i+pos] != matchUnicode[i])
+ return false;
+
+ return true;
+}
+
+bool KateTextLine::startingWith(const QString& match) const
+{
+ const uint matchlen = match.length();
+
+ if (matchlen > m_text.length())
+ return false;
+
+ const QChar *unicode = m_text.unicode();
+ const QChar *matchUnicode = match.unicode();
+
+ for (uint i=0; i < matchlen; i++)
+ if (unicode[i] != matchUnicode[i])
+ return false;
+
+ return true;
+}
+
+bool KateTextLine::endingWith(const QString& match) const
+{
+ const uint matchlen = match.length();
+
+ if (matchlen > m_text.length())
+ return false;
+
+ const QChar *unicode = m_text.unicode();
+ const QChar *matchUnicode = match.unicode();
+
+ uint start = m_text.length() - matchlen;
+ for (uint i=0; i < matchlen; i++)
+ if (unicode[start+i] != matchUnicode[i])
+ return false;
+
+ return true;
+}
+
+int KateTextLine::cursorX(uint pos, uint tabChars) const
+{
+ uint x = 0;
+
+ const uint n = kMin (pos, m_text.length());
+ const QChar *unicode = m_text.unicode();
+
+ for ( uint z = 0; z < n; z++)
+ {
+ if (unicode[z] == QChar('\t'))
+ x += tabChars - (x % tabChars);
+ else
+ x++;
+ }
+
+ return x;
+}
+
+
+uint KateTextLine::lengthWithTabs (uint tabChars) const
+{
+ uint x = 0;
+ const uint len = m_text.length();
+ const QChar *unicode = m_text.unicode();
+
+ for ( uint z = 0; z < len; z++)
+ {
+ if (unicode[z] == QChar('\t'))
+ x += tabChars - (x % tabChars);
+ else
+ x++;
+ }
+
+ return x;
+}
+
+bool KateTextLine::searchText (uint startCol, const QString &text, uint *foundAtCol, uint *matchLen, bool casesensitive, bool backwards)
+{
+ int index;
+
+ if (backwards)
+ {
+ int col = startCol;
+ uint l = text.length();
+ // allow finding the string ending at eol
+ if ( col == (int) m_text.length() ) ++startCol;
+
+ do {
+ index = m_text.findRev( text, col, casesensitive );
+ col--;
+ } while ( col >= 0 && l + index >= startCol );
+ }
+ else
+ index = m_text.find (text, startCol, casesensitive);
+
+ if (index > -1)
+ {
+ if (foundAtCol)
+ (*foundAtCol) = index;
+ if (matchLen)
+ (*matchLen)=text.length();
+ return true;
+ }
+
+ return false;
+}
+
+bool KateTextLine::searchText (uint startCol, const QRegExp &regexp, uint *foundAtCol, uint *matchLen, bool backwards)
+{
+ int index;
+
+ if (backwards)
+ {
+ int col = startCol;
+
+ // allow finding the string ending at eol
+ if ( col == (int) m_text.length() ) ++startCol;
+ do {
+ index = regexp.searchRev (m_text, col);
+ col--;
+ } while ( col >= 0 && regexp.matchedLength() + index >= (int)startCol );
+ }
+ else
+ index = regexp.search (m_text, startCol);
+
+ if (index > -1)
+ {
+ if (foundAtCol)
+ (*foundAtCol) = index;
+
+ if (matchLen)
+ (*matchLen)=regexp.matchedLength();
+ return true;
+ }
+
+ return false;
+}
+
+char *KateTextLine::dump (char *buf, bool withHighlighting) const
+{
+ uint l = m_text.length();
+ char f = m_flags;
+
+ if (!withHighlighting)
+ f = f | KateTextLine::flagNoOtherData;
+
+ memcpy(buf, (char *) &f, 1);
+ buf += 1;
+
+ memcpy(buf, &l, sizeof(uint));
+ buf += sizeof(uint);
+
+ memcpy(buf, (char *) m_text.unicode(), sizeof(QChar)*l);
+ buf += sizeof(QChar) * l;
+
+ if (!withHighlighting)
+ return buf;
+
+ memcpy(buf, (char *)m_attributes.data(), sizeof(uchar) * l);
+ buf += sizeof (uchar) * l;
+
+ uint lctx = m_ctx.size();
+ uint lfold = m_foldingList.size();
+ uint lind = m_indentationDepth.size();
+
+ memcpy(buf, &lctx, sizeof(uint));
+ buf += sizeof(uint);
+
+ memcpy(buf, &lfold, sizeof(uint));
+ buf += sizeof(uint);
+
+ memcpy(buf, &lind, sizeof(uint));
+ buf += sizeof(uint);
+
+ memcpy(buf, (char *)m_ctx.data(), sizeof(short) * lctx);
+ buf += sizeof (short) * lctx;
+
+ memcpy(buf, (char *)m_foldingList.data(), sizeof(uint)*lfold);
+ buf += sizeof (uint) * lfold;
+
+ memcpy(buf, (char *)m_indentationDepth.data(), sizeof(unsigned short) * lind);
+ buf += sizeof (unsigned short) * lind;
+
+ return buf;
+}
+
+char *KateTextLine::restore (char *buf)
+{
+ uint l = 0;
+ char f = 0;
+
+ memcpy((char *) &f, buf, 1);
+ buf += 1;
+
+ // text + context length read
+ memcpy((char *) &l, buf, sizeof(uint));
+ buf += sizeof(uint);
+
+ // text + attributes
+ m_text.setUnicode ((QChar *) buf, l);
+ buf += sizeof(QChar) * l;
+
+ // we just restore a KateTextLine from a buffer first time
+ if (f & KateTextLine::flagNoOtherData)
+ {
+ m_flags = 0;
+
+ if (f & KateTextLine::flagAutoWrapped)
+ m_flags = m_flags | KateTextLine::flagAutoWrapped;
+
+ // fill with clean empty attribs !
+ m_attributes.fill (0, l);
+
+ return buf;
+ }
+ else
+ m_flags = f;
+
+ m_attributes.duplicate ((uchar *) buf, l);
+ buf += sizeof(uchar) * l;
+
+ uint lctx = 0;
+ uint lfold = 0;
+ uint lind = 0;
+
+ memcpy((char *) &lctx, buf, sizeof(uint));
+ buf += sizeof(uint);
+
+ memcpy((char *) &lfold, buf, sizeof(uint));
+ buf += sizeof(uint);
+
+ memcpy((char *) &lind, buf, sizeof(uint));
+ buf += sizeof(uint);
+
+ m_ctx.duplicate ((short *) buf, lctx);
+ buf += sizeof(short) * lctx;
+
+ m_foldingList.duplicate ((uint *) buf, lfold);
+ buf += sizeof(uint)*lfold;
+
+ m_indentationDepth.duplicate ((unsigned short *) buf, lind);
+ buf += sizeof(unsigned short) * lind;
+
+ return buf;
+}
+
+// kate: space-indent on; indent-width 2; replace-tabs on;
diff --git a/kate/part/katetextline.h b/kate/part/katetextline.h
new file mode 100644
index 000000000..9a6ed5e4d
--- /dev/null
+++ b/kate/part/katetextline.h
@@ -0,0 +1,456 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2001-2003 Christoph Cullmann <cullmann@kde.org>
+ Copyright (C) 2002 Joseph Wenninger <jowenn@kde.org>
+
+ Based on:
+ KateTextLine : Copyright (C) 1999 Jochen Wilhelmy <digisnap@cs.tu-berlin.de>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef __KATE_TEXTLINE_H__
+#define __KATE_TEXTLINE_H__
+
+#include <ksharedptr.h>
+
+#include <qmemarray.h>
+#include <qstring.h>
+
+class KateRenderer;
+class QTextStream;
+
+/**
+ * The KateTextLine represents a line of text. A text line that contains the
+ * text, an attribute for each character, an attribute for the free space
+ * behind the last character and a context number for the syntax highlight.
+ * The attribute stores the index to a table that contains fonts and colors
+ * and also if a character is selected.
+ */
+class KateTextLine : public KShared
+{
+ public:
+ /**
+ * Define a Shared-Pointer type
+ */
+ typedef KSharedPtr<KateTextLine> Ptr;
+
+ public:
+ /**
+ * Used Flags
+ */
+ enum Flags
+ {
+ flagNoOtherData = 1, // ONLY INTERNAL USE, NEVER EVER SET THAT !!!!
+ flagHlContinue = 2,
+ flagAutoWrapped = 4,
+ flagFoldingColumnsOutdated = 8,
+ flagNoIndentationBasedFolding = 16,
+ flagNoIndentationBasedFoldingAtStart = 32
+ };
+
+ public:
+ /**
+ * Constructor
+ * Creates an empty text line with given attribute and syntax highlight
+ * context
+ */
+ KateTextLine ();
+
+ /**
+ * Destructor
+ */
+ ~KateTextLine ();
+
+ /**
+ * Methods to get data
+ */
+ public:
+ /**
+ * Set the flag that only positions have changed, not folding region begins/ends themselve
+ */
+ inline void setFoldingColumnsOutdated(bool set) { if (set) m_flags |= KateTextLine::flagFoldingColumnsOutdated; else m_flags&=
+ (~KateTextLine::flagFoldingColumnsOutdated);}
+
+ /**
+ * folding columns outdated ?
+ * @return folding columns outdated?
+ */
+ inline bool foldingColumnsOutdated() { return m_flags & KateTextLine::flagFoldingColumnsOutdated; }
+
+
+ /**
+ * Returns the length
+ * @return length of text in line
+ */
+ inline uint length() const { return m_text.length(); }
+
+ /**
+ * has the line the hl continue flag set
+ * @return hl continue set?
+ */
+ inline bool hlLineContinue () const { return m_flags & KateTextLine::flagHlContinue; }
+
+ /**
+ * was this line automagically wrapped
+ * @return line auto-wrapped
+ */
+ inline bool isAutoWrapped () const { return m_flags & KateTextLine::flagAutoWrapped; }
+
+ /**
+ * Returns the position of the first non-whitespace character
+ * @return position of first non-whitespace char or -1 if there is none
+ */
+ int firstChar() const;
+
+ /**
+ * Returns the position of the last non-whitespace character
+ * @return position of last non-whitespace char or -1 if there is none
+ */
+ int lastChar() const;
+
+ /**
+ * Find the position of the next char that is not a space.
+ * @param pos Column of the character which is examined first.
+ * @return True if the specified or a following character is not a space
+ * Otherwise false.
+ */
+ int nextNonSpaceChar(uint pos) const;
+
+ /**
+ * Find the position of the previous char that is not a space.
+ * @param pos Column of the character which is examined first.
+ * @return The position of the first none-whitespace character preceeding pos,
+ * or -1 if none is found.
+ */
+ int previousNonSpaceChar(uint pos) const;
+
+ /**
+ * Gets the char at the given position
+ * @param pos position
+ * @return character at the given position or QChar::null if position is
+ * beyond the length of the string
+ */
+ inline QChar getChar (uint pos) const { return m_text[pos]; }
+
+ /**
+ * Gets the text as a unicode representation
+ * @return text of this line as QChar array
+ */
+ inline const QChar *text() const { return m_text.unicode(); }
+
+ /**
+ * Highlighting array
+ * The size of this is string().length()
+ *
+ * This contains the index for the attributes (so you can only
+ * have a maximum of 2^8 different highlighting styles in a document)
+ *
+ * To turn this into actual attributes (bold, green, etc),
+ * you need to feed these values into KRenderer::attributes
+ *
+ * e.g: m_renderer->attributes(attributes[3]);
+ *
+ * @return hl-attributes array
+ */
+ inline uchar *attributes () const { return m_attributes.data(); }
+
+ /**
+ * Gets a QString
+ * @return text of line as QString reference
+ */
+ inline const QString& string() const { return m_text; }
+
+ /**
+ * Gets a substring.
+ * @param startCol start column of substring
+ * @param length length of substring
+ * @return wanted substring
+ */
+ inline QString string(uint startCol, uint length) const
+ { return m_text.mid(startCol, length); }
+
+ /**
+ * Gets a null terminated pointer to first non space char
+ * @return array of QChars starting at first non-whitespace char
+ */
+ const QChar *firstNonSpace() const;
+
+ /**
+ * indentation depth of this line
+ * @param tabwidth width of the tabulators
+ * @return indentation width
+ */
+ uint indentDepth (uint tabwidth) const;
+
+ /**
+ * Returns the x position of the cursor at the given position, which
+ * depends on the number of tab characters
+ * @param pos position in chars
+ * @param tabChars tabulator width in chars
+ * @return position with tabulators calculated
+ */
+ int cursorX(uint pos, uint tabChars) const;
+
+ /**
+ * Returns the text length with tabs calced in
+ * @param tabChars tabulator width in chars
+ * @return text length
+ */
+ uint lengthWithTabs (uint tabChars) const;
+
+ /**
+ * Can we find the given string at the given position
+ * @param pos startpostion of given string
+ * @param match string to match at given pos
+ * @return did the string match?
+ */
+ bool stringAtPos(uint pos, const QString& match) const;
+
+ /**
+ * Is the line starting with the given string
+ * @param match string to test
+ * @return does line start with given string?
+ */
+ bool startingWith(const QString& match) const;
+
+ /**
+ * Is the line ending with the given string
+ * @param match string to test
+ * @return does the line end with given string?
+ */
+ bool endingWith(const QString& match) const;
+
+ /**
+ * search given string
+ * @param startCol column to start search
+ * @param text string to search for
+ * @param foundAtCol column where text was found
+ * @param matchLen length of matching
+ * @param casesensitive should search be case-sensitive
+ * @param backwards search backwards?
+ * @return string found?
+ */
+ bool searchText (uint startCol, const QString &text,
+ uint *foundAtCol, uint *matchLen,
+ bool casesensitive = true,
+ bool backwards = false);
+
+ /**
+ * search given regexp
+ * @param startCol column to start search
+ * @param regexp regex to search for
+ * @param foundAtCol column where text was found
+ * @param matchLen length of matching
+ * @param backwards search backwards?
+ * @return regexp found?
+ */
+ bool searchText (uint startCol, const QRegExp &regexp,
+ uint *foundAtCol, uint *matchLen,
+ bool backwards = false);
+
+ /**
+ * Gets the attribute at the given position
+ * use KRenderer::attributes to get the KTextAttribute for this.
+ *
+ * @param pos position of attribute requested
+ * @return value of attribute
+ * @see attributes
+ */
+ inline uchar attribute (uint pos) const
+ {
+ if (pos < m_attributes.size()) return m_attributes[pos];
+ return 0;
+ }
+
+ /**
+ * context stack
+ * @return context stack
+ */
+ inline const QMemArray<short> &ctxArray () const { return m_ctx; };
+
+ /**
+ * @return true if any context at the line end has the noIndentBasedFolding flag set
+ */
+ inline const bool noIndentBasedFolding() const { return m_flags & KateTextLine::flagNoIndentationBasedFolding; };
+ inline const bool noIndentBasedFoldingAtStart() const { return m_flags & KateTextLine::flagNoIndentationBasedFoldingAtStart; };
+ /**
+ * folding list
+ * @return folding array
+ */
+ inline const QMemArray<uint> &foldingListArray () const { return m_foldingList; };
+
+ /**
+ * indentation stack
+ * @return indentation array
+ */
+ inline const QMemArray<unsigned short> &indentationDepthArray () const { return m_indentationDepth; };
+
+ /**
+ * insert text into line
+ * @param pos insert position
+ * @param insLen insert length
+ * @param insText text to insert
+ * @param insAttribs attributes for the insert text
+ */
+ void insertText (uint pos, uint insLen, const QChar *insText, uchar *insAttribs = 0);
+
+ /**
+ * remove text at given position
+ * @param pos start position of remove
+ * @param delLen length to remove
+ */
+ void removeText (uint pos, uint delLen);
+
+ /**
+ * Truncates the textline to the new length
+ * @param newLen new length of line
+ */
+ void truncate(uint newLen);
+
+ /**
+ * set hl continue flag
+ * @param cont continue flag?
+ */
+ inline void setHlLineContinue (bool cont)
+ {
+ if (cont) m_flags = m_flags | KateTextLine::flagHlContinue;
+ else m_flags = m_flags & ~ KateTextLine::flagHlContinue;
+ }
+
+ /**
+ * auto-wrapped
+ * @param wrapped line was wrapped?
+ */
+ inline void setAutoWrapped (bool wrapped)
+ {
+ if (wrapped) m_flags = m_flags | KateTextLine::flagAutoWrapped;
+ else m_flags = m_flags & ~ KateTextLine::flagAutoWrapped;
+ }
+
+ /**
+ * Sets the syntax highlight context number
+ * @param val new context array
+ */
+ inline void setContext (QMemArray<short> &val) { m_ctx.assign (val); }
+
+ /**
+ * sets if for the next line indent based folding should be disabled
+ */
+ inline void setNoIndentBasedFolding(bool val)
+ {
+ if (val) m_flags = m_flags | KateTextLine::flagNoIndentationBasedFolding;
+ else m_flags = m_flags & ~ KateTextLine::flagNoIndentationBasedFolding;
+ }
+
+ inline void setNoIndentBasedFoldingAtStart(bool val)
+ {
+ if (val) m_flags = m_flags | KateTextLine::flagNoIndentationBasedFoldingAtStart;
+ else m_flags = m_flags & ~ KateTextLine::flagNoIndentationBasedFoldingAtStart;
+ }
+
+ /**
+ * update folding list
+ * @param val new folding list
+ */
+ inline void setFoldingList (QMemArray<uint> &val) { m_foldingList.assign (val); m_foldingList.detach(); }
+
+ /**
+ * update indentation stack
+ * @param val new indentation stack
+ */
+ inline void setIndentationDepth (QMemArray<unsigned short> &val) { m_indentationDepth.assign (val); }
+
+ /**
+ * Methodes for dump/restore of the line in the buffer
+ */
+ public:
+ /**
+ * Dumpsize in bytes
+ * @param withHighlighting should we dump the hl, too?
+ * @return size of line for dumping
+ */
+ inline uint dumpSize (bool withHighlighting) const
+ {
+ return ( 1
+ + sizeof(uint)
+ + (m_text.length() * sizeof(QChar))
+ + ( withHighlighting ?
+ ( (3 * sizeof(uint))
+ + (m_text.length() * sizeof(uchar))
+ + (m_ctx.size() * sizeof(short))
+ + (m_foldingList.size() * sizeof(uint))
+ + (m_indentationDepth.size() * sizeof(unsigned short))
+ ) : 0
+ )
+ );
+ }
+
+ /**
+ * Dumps the line to *buf and counts buff dumpSize bytes up
+ * as return value
+ * @param buf buffer to dump to
+ * @param withHighlighting dump hl data, too?
+ * @return buffer index after dumping
+ */
+ char *dump (char *buf, bool withHighlighting) const;
+
+ /**
+ * Restores the line from *buf and counts buff dumpSize bytes up
+ * as return value
+ * @param buf buffer to restore from
+ * @return buffer index after restoring
+ */
+ char *restore (char *buf);
+
+ /**
+ * REALLY PRIVATE ;) please no new friend classes
+ */
+ private:
+ /**
+ * text of line as unicode
+ */
+ QString m_text;
+
+ /**
+ * array of highlighting attributes
+ * This is exactly the same size as m_text.length()
+ * Each letter in m_text has a uchar attribute
+ */
+ QMemArray<uchar> m_attributes;
+
+ /**
+ * context stack
+ */
+ QMemArray<short> m_ctx;
+
+ /**
+ * list of folding starts/ends
+ */
+ QMemArray<uint> m_foldingList;
+
+ /**
+ * indentation stack
+ */
+ QMemArray<unsigned short> m_indentationDepth;
+
+ /**
+ * flags
+ */
+ uchar m_flags;
+};
+
+#endif
+
+// kate: space-indent on; indent-width 2; replace-tabs on;
diff --git a/kate/part/kateundo.cpp b/kate/part/kateundo.cpp
new file mode 100644
index 000000000..0f8d3599f
--- /dev/null
+++ b/kate/part/kateundo.cpp
@@ -0,0 +1,392 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2002 John Firebaugh <jfirebaugh@kde.org>
+ Copyright (C) 2001 Christoph Cullmann <cullmann@kde.org>
+ Copyright (C) 2001 Joseph Wenninger <jowenn@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "kateundo.h"
+
+#include "katedocument.h"
+#include "kateview.h"
+#include "katecursor.h"
+
+/**
+ * Private class, only for KateUndoGroup, no need to use it elsewhere
+ */
+ class KateUndo
+{
+ public:
+ /**
+ * Constructor
+ * @param type undo item type
+ * @param line line affected
+ * @param col start column
+ * @param len lenght of change
+ * @param text text removed/inserted
+ */
+ KateUndo (KateUndoGroup::UndoType type, uint line, uint col, uint len, const QString &text);
+
+ /**
+ * Destructor
+ */
+ ~KateUndo ();
+
+ public:
+ /**
+ * Invalid examples: insert / remove 0 length text
+ * I could probably fix this in KateDocument, but it's more work there
+ * (and probably better here too)
+ * @return validity
+ */
+ bool isValid();
+
+ /**
+ * merge an undo item
+ * Saves a bit of memory and potentially many calls when undo/redoing.
+ * @param u undo item to merge
+ * @return success
+ */
+ bool merge(KateUndo* u);
+
+ /**
+ * undo this item at given doc
+ * @param doc document
+ */
+ void undo (KateDocument *doc);
+
+ /**
+ * redo this item at given doc
+ * @param doc document
+ */
+ void redo (KateDocument *doc);
+
+ /**
+ * The cursor before the action took place
+ */
+ KateTextCursor cursorBefore() const;
+
+ /**
+ * The cursor after the action took place
+ */
+ KateTextCursor cursorAfter() const;
+
+ /**
+ * type of item
+ * @return type
+ */
+ inline KateUndoGroup::UndoType type() const { return m_type; }
+
+ /**
+ * line of changes
+ * @return line
+ */
+ inline uint line () const { return m_line; }
+
+ /**
+ * startcol of changes
+ * @return column
+ */
+ inline uint col () const { return m_col; }
+
+ /**
+ * length of changes
+ * @return length
+ */
+ inline uint len() const { return m_len; }
+
+ /**
+ * text inserted/removed
+ * @return text
+ */
+ inline const QString& text() const { return m_text; };
+
+ private:
+ /**
+ * type
+ */
+ KateUndoGroup::UndoType m_type;
+
+ /**
+ * line
+ */
+ uint m_line;
+
+ /**
+ * column
+ */
+ uint m_col;
+
+ /**
+ * length
+ */
+ uint m_len;
+
+ /**
+ * text
+ */
+ QString m_text;
+};
+
+KateUndo::KateUndo (KateUndoGroup::UndoType type, uint line, uint col, uint len, const QString &text)
+: m_type (type),
+ m_line (line),
+ m_col (col),
+ m_len (len),
+ m_text (text)
+{
+}
+
+KateUndo::~KateUndo ()
+{
+}
+
+bool KateUndo::isValid()
+{
+ if (m_type == KateUndoGroup::editInsertText || m_type == KateUndoGroup::editRemoveText)
+ if (len() == 0)
+ return false;
+
+ return true;
+}
+
+bool KateUndo::merge(KateUndo* u)
+{
+ if (m_type != u->type())
+ return false;
+
+ if (m_type == KateUndoGroup::editInsertText
+ && m_line == u->line()
+ && (m_col + m_len) == u->col())
+ {
+ m_text += u->text();
+ m_len += u->len();
+ return true;
+ }
+ else if (m_type == KateUndoGroup::editRemoveText
+ && m_line == u->line()
+ && m_col == (u->col() + u->len()))
+ {
+ m_text.prepend(u->text());
+ m_col = u->col();
+ m_len += u->len();
+ return true;
+ }
+
+ return false;
+}
+
+void KateUndo::undo (KateDocument *doc)
+{
+ if (m_type == KateUndoGroup::editInsertText)
+ {
+ doc->editRemoveText (m_line, m_col, m_len);
+ }
+ else if (m_type == KateUndoGroup::editRemoveText)
+ {
+ doc->editInsertText (m_line, m_col, m_text);
+ }
+ else if (m_type == KateUndoGroup::editWrapLine)
+ {
+ doc->editUnWrapLine (m_line, (m_text == "1"), m_len);
+ }
+ else if (m_type == KateUndoGroup::editUnWrapLine)
+ {
+ doc->editWrapLine (m_line, m_col, (m_text == "1"));
+ }
+ else if (m_type == KateUndoGroup::editInsertLine)
+ {
+ doc->editRemoveLine (m_line);
+ }
+ else if (m_type == KateUndoGroup::editRemoveLine)
+ {
+ doc->editInsertLine (m_line, m_text);
+ }
+ else if (m_type == KateUndoGroup::editMarkLineAutoWrapped)
+ {
+ doc->editMarkLineAutoWrapped (m_line, m_col == 0);
+ }
+}
+
+void KateUndo::redo (KateDocument *doc)
+{
+ if (m_type == KateUndoGroup::editRemoveText)
+ {
+ doc->editRemoveText (m_line, m_col, m_len);
+ }
+ else if (m_type == KateUndoGroup::editInsertText)
+ {
+ doc->editInsertText (m_line, m_col, m_text);
+ }
+ else if (m_type == KateUndoGroup::editUnWrapLine)
+ {
+ doc->editUnWrapLine (m_line, (m_text == "1"), m_len);
+ }
+ else if (m_type == KateUndoGroup::editWrapLine)
+ {
+ doc->editWrapLine (m_line, m_col, (m_text == "1"));
+ }
+ else if (m_type == KateUndoGroup::editRemoveLine)
+ {
+ doc->editRemoveLine (m_line);
+ }
+ else if (m_type == KateUndoGroup::editInsertLine)
+ {
+ doc->editInsertLine (m_line, m_text);
+ }
+ else if (m_type == KateUndoGroup::editMarkLineAutoWrapped)
+ {
+ doc->editMarkLineAutoWrapped (m_line, m_col == 1);
+ }
+}
+
+KateTextCursor KateUndo::cursorBefore() const
+{
+ if (m_type == KateUndoGroup::editInsertLine || m_type == KateUndoGroup::editUnWrapLine)
+ return KateTextCursor(m_line+1, m_col);
+ else if (m_type == KateUndoGroup::editRemoveText)
+ return KateTextCursor(m_line, m_col+m_len);
+
+ return KateTextCursor(m_line, m_col);
+}
+
+KateTextCursor KateUndo::cursorAfter() const
+{
+ if (m_type == KateUndoGroup::editRemoveLine || m_type == KateUndoGroup::editWrapLine)
+ return KateTextCursor(m_line+1, m_col);
+ else if (m_type == KateUndoGroup::editInsertText)
+ return KateTextCursor(m_line, m_col+m_len);
+
+ return KateTextCursor(m_line, m_col);
+}
+
+KateUndoGroup::KateUndoGroup (KateDocument *doc)
+: m_doc (doc),m_safePoint(false)
+{
+ m_items.setAutoDelete (true);
+}
+
+KateUndoGroup::~KateUndoGroup ()
+{
+}
+
+void KateUndoGroup::undo ()
+{
+ if (m_items.count() == 0)
+ return;
+
+ m_doc->editStart (false);
+
+ for (KateUndo* u = m_items.last(); u; u = m_items.prev())
+ u->undo(m_doc);
+
+ if (m_doc->activeView())
+ {
+ for (uint z=0; z < m_items.count(); z++)
+ if (m_items.at(z)->type() != KateUndoGroup::editMarkLineAutoWrapped)
+ {
+ m_doc->activeView()->editSetCursor (m_items.at(z)->cursorBefore());
+ break;
+ }
+ }
+
+ m_doc->editEnd ();
+}
+
+void KateUndoGroup::redo ()
+{
+ if (m_items.count() == 0)
+ return;
+
+ m_doc->editStart (false);
+
+ for (KateUndo* u = m_items.first(); u; u = m_items.next())
+ u->redo(m_doc);
+
+ if (m_doc->activeView())
+ {
+ for (uint z=0; z < m_items.count(); z++)
+ if (m_items.at(z)->type() != KateUndoGroup::editMarkLineAutoWrapped)
+ {
+ m_doc->activeView()->editSetCursor (m_items.at(z)->cursorAfter());
+ break;
+ }
+ }
+
+ m_doc->editEnd ();
+}
+
+void KateUndoGroup::addItem (KateUndoGroup::UndoType type, uint line, uint col, uint len, const QString &text)
+{
+ addItem(new KateUndo(type, line, col, len, text));
+}
+
+void KateUndoGroup::addItem(KateUndo* u)
+{
+ if (!u->isValid())
+ delete u;
+ else if (m_items.last() && m_items.last()->merge(u))
+ delete u;
+ else
+ m_items.append(u);
+}
+
+bool KateUndoGroup::merge(KateUndoGroup* newGroup,bool complex)
+{
+ if (m_safePoint) return false;
+ if (newGroup->isOnlyType(singleType()) || complex) {
+ // Take all of its items first -> last
+ KateUndo* u = newGroup->m_items.take(0);
+ while (u) {
+ addItem(u);
+ u = newGroup->m_items.take(0);
+ }
+ if (newGroup->m_safePoint) safePoint();
+ return true;
+ }
+ return false;
+}
+
+void KateUndoGroup::safePoint (bool safePoint) {
+ m_safePoint=safePoint;
+}
+
+KateUndoGroup::UndoType KateUndoGroup::singleType()
+{
+ KateUndoGroup::UndoType ret = editInvalid;
+
+ for (KateUndo* u = m_items.first(); u; u = m_items.next()) {
+ if (ret == editInvalid)
+ ret = u->type();
+ else if (ret != u->type())
+ return editInvalid;
+ }
+
+ return ret;
+}
+
+bool KateUndoGroup::isOnlyType(KateUndoGroup::UndoType type)
+{
+ if (type == editInvalid) return false;
+
+ for (KateUndo* u = m_items.first(); u; u = m_items.next())
+ if (u->type() != type)
+ return false;
+
+ return true;
+}
+
+// kate: space-indent on; indent-width 2; replace-tabs on;
diff --git a/kate/part/kateundo.h b/kate/part/kateundo.h
new file mode 100644
index 000000000..66905f5cd
--- /dev/null
+++ b/kate/part/kateundo.h
@@ -0,0 +1,141 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2002 John Firebaugh <jfirebaugh@kde.org>
+ Copyright (C) 2001 Christoph Cullmann <cullmann@kde.org>
+ Copyright (C) 2001 Joseph Wenninger <jowenn@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef kate_undo_h
+#define kate_undo_h
+
+#include <qptrlist.h>
+#include <qstring.h>
+
+class KateDocument;
+class KateUndo;
+
+/**
+ * Class to manage a group of undo items
+ */
+class KateUndoGroup
+{
+ public:
+ /**
+ * Constructor
+ * @param doc document to belong to
+ */
+ KateUndoGroup (KateDocument *doc);
+
+ /**
+ * Destructor
+ */
+ ~KateUndoGroup ();
+
+ public:
+ /**
+ * Undo the contained undo items
+ */
+ void undo ();
+
+ /**
+ * Redo the contained undo items
+ */
+ void redo ();
+
+ public:
+ /**
+ * Types for undo items
+ */
+ enum UndoType
+ {
+ editInsertText,
+ editRemoveText,
+ editWrapLine,
+ editUnWrapLine,
+ editInsertLine,
+ editRemoveLine,
+ editMarkLineAutoWrapped,
+ editInvalid
+ };
+
+ /**
+ * add an item to the group
+ * @param type undo item type
+ * @param line line affected
+ * @param col start column
+ * @param len lenght of change
+ * @param text text removed/inserted
+ */
+ void addItem (KateUndoGroup::UndoType type, uint line, uint col, uint len, const QString &text);
+
+ /**
+ * merge this group with an other
+ * @param newGroup group to merge into this one
+ * @param complex set if a complex undo
+ * @return success
+ */
+ bool merge(KateUndoGroup* newGroup,bool complex);
+
+ /**
+ * set group as as savepoint. the next group will not merge with this one
+ */
+ void safePoint (bool safePoint=true);
+
+ /**
+ * is this undogroup empty?
+ */
+ bool isEmpty () const { return m_items.isEmpty(); }
+
+ private:
+ /**
+ * singleType
+ * @return the type if it's only one type, or editInvalid if it contains multiple types.
+ */
+ KateUndoGroup::UndoType singleType();
+
+ /**
+ * are we only of this type ?
+ * @param type type to query
+ * @return we contain only the given type
+ */
+ bool isOnlyType(KateUndoGroup::UndoType type);
+
+ /**
+ * add an undo item
+ * @param u item to add
+ */
+ void addItem (KateUndo *u);
+
+ private:
+ /**
+ * Document we belong to
+ */
+ KateDocument *m_doc;
+
+ /**
+ * list of items contained
+ */
+ QPtrList<KateUndo> m_items;
+
+ /**
+ * prohibit merging with the next group
+ */
+ bool m_safePoint;
+};
+
+#endif
+
+// kate: space-indent on; indent-width 2; replace-tabs on;
diff --git a/kate/part/kateview.cpp b/kate/part/kateview.cpp
new file mode 100644
index 000000000..6592bc8cc
--- /dev/null
+++ b/kate/part/kateview.cpp
@@ -0,0 +1,1920 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2003 Hamish Rodda <rodda@kde.org>
+ Copyright (C) 2002 John Firebaugh <jfirebaugh@kde.org>
+ Copyright (C) 2001-2004 Christoph Cullmann <cullmann@kde.org>
+ Copyright (C) 2001 Joseph Wenninger <jowenn@kde.org>
+ Copyright (C) 1999 Jochen Wilhelmy <digisnap@cs.tu-berlin.de>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#define DEBUGACCELS
+
+//BEGIN includes
+#include "kateview.h"
+#include "kateview.moc"
+
+#include "kateviewinternal.h"
+#include "kateviewhelpers.h"
+#include "katerenderer.h"
+#include "katedocument.h"
+#include "katedocumenthelpers.h"
+#include "katefactory.h"
+#include "katehighlight.h"
+#include "katedialogs.h"
+#include "katetextline.h"
+#include "katecodefoldinghelpers.h"
+#include "katecodecompletion.h"
+#include "katesearch.h"
+#include "kateschema.h"
+#include "katebookmarks.h"
+#include "katesearch.h"
+#include "kateconfig.h"
+#include "katefiletype.h"
+#include "kateautoindent.h"
+#include "katespell.h"
+
+#include <ktexteditor/plugin.h>
+
+#include <kparts/event.h>
+
+#include <kio/netaccess.h>
+
+#include <kconfig.h>
+#include <kurldrag.h>
+#include <kdebug.h>
+#include <kapplication.h>
+#include <kcursor.h>
+#include <klocale.h>
+#include <kglobal.h>
+#include <kcharsets.h>
+#include <kmessagebox.h>
+#include <kaction.h>
+#include <kstdaction.h>
+#include <kxmlguifactory.h>
+#include <kaccel.h>
+#include <klibloader.h>
+#include <kencodingfiledialog.h>
+#include <kmultipledrag.h>
+#include <ktempfile.h>
+#include <ksavefile.h>
+
+#include <qfont.h>
+#include <qfileinfo.h>
+#include <qstyle.h>
+#include <qevent.h>
+#include <qpopupmenu.h>
+#include <qlayout.h>
+#include <qclipboard.h>
+#include <qstylesheet.h>
+//END includes
+
+KateView::KateView( KateDocument *doc, QWidget *parent, const char * name )
+ : Kate::View( doc, parent, name )
+ , m_doc( doc )
+ , m_search( new KateSearch( this ) )
+ , m_spell( new KateSpell( this ) )
+ , m_bookmarks( new KateBookmarks( this ) )
+ , m_cmdLine (0)
+ , m_cmdLineOn (false)
+ , m_active( false )
+ , m_hasWrap( false )
+ , m_startingUp (true)
+ , m_updatingDocumentConfig (false)
+ , selectStart (m_doc, true)
+ , selectEnd (m_doc, true)
+ , blockSelect (false)
+ , m_imStartLine( 0 )
+ , m_imStart( 0 )
+ , m_imEnd( 0 )
+ , m_imSelStart( 0 )
+ , m_imSelEnd( 0 )
+ , m_imComposeEvent( false )
+{
+ KateFactory::self()->registerView( this );
+ m_config = new KateViewConfig (this);
+
+ m_renderer = new KateRenderer(doc, this);
+
+ m_grid = new QGridLayout (this, 3, 3);
+
+ m_grid->setRowStretch ( 0, 10 );
+ m_grid->setRowStretch ( 1, 0 );
+ m_grid->setColStretch ( 0, 0 );
+ m_grid->setColStretch ( 1, 10 );
+ m_grid->setColStretch ( 2, 0 );
+
+ m_viewInternal = new KateViewInternal( this, doc );
+ m_grid->addWidget (m_viewInternal, 0, 1);
+
+ setClipboardInterfaceDCOPSuffix (viewDCOPSuffix());
+ setCodeCompletionInterfaceDCOPSuffix (viewDCOPSuffix());
+ setDynWordWrapInterfaceDCOPSuffix (viewDCOPSuffix());
+ setPopupMenuInterfaceDCOPSuffix (viewDCOPSuffix());
+ setSessionConfigInterfaceDCOPSuffix (viewDCOPSuffix());
+ setViewCursorInterfaceDCOPSuffix (viewDCOPSuffix());
+ setViewStatusMsgInterfaceDCOPSuffix (viewDCOPSuffix());
+
+ setInstance( KateFactory::self()->instance() );
+ doc->addView( this );
+
+ setFocusProxy( m_viewInternal );
+ setFocusPolicy( StrongFocus );
+
+ if (!doc->singleViewMode()) {
+ setXMLFile( "katepartui.rc" );
+ } else {
+ if( doc->readOnly() )
+ setXMLFile( "katepartreadonlyui.rc" );
+ else
+ setXMLFile( "katepartui.rc" );
+ }
+
+ setupConnections();
+ setupActions();
+ setupEditActions();
+ setupCodeFolding();
+ setupCodeCompletion();
+
+ // enable the plugins of this view
+ m_doc->enableAllPluginsGUI (this);
+
+ // update the enabled state of the undo/redo actions...
+ slotNewUndo();
+
+ m_startingUp = false;
+ updateConfig ();
+
+ slotHlChanged();
+ /*test texthint
+ connect(this,SIGNAL(needTextHint(int, int, QString &)),
+ this,SLOT(slotNeedTextHint(int, int, QString &)));
+ enableTextHints(1000);
+ test texthint*/
+}
+
+KateView::~KateView()
+{
+ if (!m_doc->singleViewMode())
+ m_doc->disableAllPluginsGUI (this);
+
+ m_doc->removeView( this );
+
+ // its a QObject. don't double-delete
+ //delete m_viewInternal;
+ //delete m_codeCompletion;
+
+ delete m_renderer;
+ m_renderer = 0;
+
+ delete m_config;
+ m_config = 0;
+ KateFactory::self()->deregisterView (this);
+}
+
+void KateView::setupConnections()
+{
+ connect( m_doc, SIGNAL(undoChanged()),
+ this, SLOT(slotNewUndo()) );
+ connect( m_doc, SIGNAL(hlChanged()),
+ this, SLOT(slotHlChanged()) );
+ connect( m_doc, SIGNAL(canceled(const QString&)),
+ this, SLOT(slotSaveCanceled(const QString&)) );
+ connect( m_viewInternal, SIGNAL(dropEventPass(QDropEvent*)),
+ this, SIGNAL(dropEventPass(QDropEvent*)) );
+ connect(this,SIGNAL(cursorPositionChanged()),this,SLOT(slotStatusMsg()));
+ connect(this,SIGNAL(newStatus()),this,SLOT(slotStatusMsg()));
+ connect(m_doc, SIGNAL(undoChanged()), this, SLOT(slotStatusMsg()));
+
+ if ( m_doc->browserView() )
+ {
+ connect( this, SIGNAL(dropEventPass(QDropEvent*)),
+ this, SLOT(slotDropEventPass(QDropEvent*)) );
+ }
+}
+
+void KateView::setupActions()
+{
+ KActionCollection *ac = this->actionCollection ();
+ KAction *a;
+
+ m_toggleWriteLock = 0;
+
+ m_cut = a=KStdAction::cut(this, SLOT(cut()), ac);
+ a->setWhatsThis(i18n("Cut the selected text and move it to the clipboard"));
+
+ m_paste = a=KStdAction::pasteText(this, SLOT(paste()), ac);
+ a->setWhatsThis(i18n("Paste previously copied or cut clipboard contents"));
+
+ m_copy = a=KStdAction::copy(this, SLOT(copy()), ac);
+ a->setWhatsThis(i18n( "Use this command to copy the currently selected text to the system clipboard."));
+
+ m_copyHTML = a = new KAction(i18n("Copy as &HTML"), "editcopy", 0, this, SLOT(copyHTML()), ac, "edit_copy_html");
+ a->setWhatsThis(i18n( "Use this command to copy the currently selected text as HTML to the system clipboard."));
+
+ if (!m_doc->readOnly())
+ {
+ a=KStdAction::save(this, SLOT(save()), ac);
+ a->setWhatsThis(i18n("Save the current document"));
+
+ a=m_editUndo = KStdAction::undo(m_doc, SLOT(undo()), ac);
+ a->setWhatsThis(i18n("Revert the most recent editing actions"));
+
+ a=m_editRedo = KStdAction::redo(m_doc, SLOT(redo()), ac);
+ a->setWhatsThis(i18n("Revert the most recent undo operation"));
+
+ (new KAction(i18n("&Word Wrap Document"), "", 0, this, SLOT(applyWordWrap()), ac, "tools_apply_wordwrap"))->setWhatsThis(
+ i18n("Use this command to wrap all lines of the current document which are longer than the width of the"
+ " current view, to fit into this view.<br><br> This is a static word wrap, meaning it is not updated"
+ " when the view is resized."));
+
+ // setup Tools menu
+ a=new KAction(i18n("&Indent"), "indent", Qt::CTRL+Qt::Key_I, this, SLOT(indent()), ac, "tools_indent");
+ a->setWhatsThis(i18n("Use this to indent a selected block of text.<br><br>"
+ "You can configure whether tabs should be honored and used or replaced with spaces, in the configuration dialog."));
+ a=new KAction(i18n("&Unindent"), "unindent", Qt::CTRL+Qt::SHIFT+Qt::Key_I, this, SLOT(unIndent()), ac, "tools_unindent");
+ a->setWhatsThis(i18n("Use this to unindent a selected block of text."));
+
+ a=new KAction(i18n("&Clean Indentation"), 0, this, SLOT(cleanIndent()), ac, "tools_cleanIndent");
+ a->setWhatsThis(i18n("Use this to clean the indentation of a selected block of text (only tabs/only spaces)<br><br>"
+ "You can configure whether tabs should be honored and used or replaced with spaces, in the configuration dialog."));
+
+ a=new KAction(i18n("&Align"), 0, this, SLOT(align()), ac, "tools_align");
+ a->setWhatsThis(i18n("Use this to align the current line or block of text to its proper indent level."));
+
+ a=new KAction(i18n("C&omment"), CTRL+Qt::Key_D, this, SLOT(comment()),
+ ac, "tools_comment");
+ a->setWhatsThis(i18n("This command comments out the current line or a selected block of text.<BR><BR>"
+ "The characters for single/multiple line comments are defined within the language's highlighting."));
+
+ a=new KAction(i18n("Unco&mment"), CTRL+SHIFT+Qt::Key_D, this, SLOT(uncomment()),
+ ac, "tools_uncomment");
+ a->setWhatsThis(i18n("This command removes comments from the current line or a selected block of text.<BR><BR>"
+ "The characters for single/multiple line comments are defined within the language's highlighting."));
+ a = m_toggleWriteLock = new KToggleAction(
+ i18n("&Read Only Mode"), 0, 0,
+ this, SLOT( toggleWriteLock() ),
+ ac, "tools_toggle_write_lock" );
+ a->setWhatsThis( i18n("Lock/unlock the document for writing") );
+
+ a = new KAction( i18n("Uppercase"), CTRL + Qt::Key_U, this,
+ SLOT(uppercase()), ac, "tools_uppercase" );
+ a->setWhatsThis( i18n("Convert the selection to uppercase, or the character to the "
+ "right of the cursor if no text is selected.") );
+
+ a = new KAction( i18n("Lowercase"), CTRL + SHIFT + Qt::Key_U, this,
+ SLOT(lowercase()), ac, "tools_lowercase" );
+ a->setWhatsThis( i18n("Convert the selection to lowercase, or the character to the "
+ "right of the cursor if no text is selected.") );
+
+ a = new KAction( i18n("Capitalize"), CTRL + ALT + Qt::Key_U, this,
+ SLOT(capitalize()), ac, "tools_capitalize" );
+ a->setWhatsThis( i18n("Capitalize the selection, or the word under the "
+ "cursor if no text is selected.") );
+
+ a = new KAction( i18n("Join Lines"), CTRL + Qt::Key_J, this,
+ SLOT( joinLines() ), ac, "tools_join_lines" );
+ }
+ else
+ {
+ m_cut->setEnabled (false);
+ m_paste->setEnabled (false);
+ m_editUndo = 0;
+ m_editRedo = 0;
+ }
+
+ a=KStdAction::print( m_doc, SLOT(print()), ac );
+ a->setWhatsThis(i18n("Print the current document."));
+
+ a=new KAction(i18n("Reloa&d"), "reload", KStdAccel::reload(), this, SLOT(reloadFile()), ac, "file_reload");
+ a->setWhatsThis(i18n("Reload the current document from disk."));
+
+ a=KStdAction::saveAs(this, SLOT(saveAs()), ac);
+ a->setWhatsThis(i18n("Save the current document to disk, with a name of your choice."));
+
+ a=KStdAction::gotoLine(this, SLOT(gotoLine()), ac);
+ a->setWhatsThis(i18n("This command opens a dialog and lets you choose a line that you want the cursor to move to."));
+
+ a=new KAction(i18n("&Configure Editor..."), 0, m_doc, SLOT(configDialog()),ac, "set_confdlg");
+ a->setWhatsThis(i18n("Configure various aspects of this editor."));
+
+ KateViewHighlightAction *menu = new KateViewHighlightAction (i18n("&Highlighting"), ac, "set_highlight");
+ menu->setWhatsThis(i18n("Here you can choose how the current document should be highlighted."));
+ menu->updateMenu (m_doc);
+
+ KateViewFileTypeAction *ftm = new KateViewFileTypeAction (i18n("&Filetype"),ac,"set_filetype");
+ ftm->updateMenu (m_doc);
+
+ KateViewSchemaAction *schemaMenu = new KateViewSchemaAction (i18n("&Schema"),ac,"view_schemas");
+ schemaMenu->updateMenu (this);
+
+ // indentation menu
+ new KateViewIndentationAction (m_doc, i18n("&Indentation"),ac,"tools_indentation");
+
+ // html export
+ a = new KAction(i18n("E&xport as HTML..."), 0, 0, this, SLOT(exportAsHTML()), ac, "file_export_html");
+ a->setWhatsThis(i18n("This command allows you to export the current document"
+ " with all highlighting information into a HTML document."));
+
+ m_selectAll = a=KStdAction::selectAll(this, SLOT(selectAll()), ac);
+ a->setWhatsThis(i18n("Select the entire text of the current document."));
+
+ m_deSelect = a=KStdAction::deselect(this, SLOT(clearSelection()), ac);
+ a->setWhatsThis(i18n("If you have selected something within the current document, this will no longer be selected."));
+
+ a=new KAction(i18n("Enlarge Font"), "viewmag+", 0, m_viewInternal, SLOT(slotIncFontSizes()), ac, "incFontSizes");
+ a->setWhatsThis(i18n("This increases the display font size."));
+
+ a=new KAction(i18n("Shrink Font"), "viewmag-", 0, m_viewInternal, SLOT(slotDecFontSizes()), ac, "decFontSizes");
+ a->setWhatsThis(i18n("This decreases the display font size."));
+
+ a= m_toggleBlockSelection = new KToggleAction(
+ i18n("Bl&ock Selection Mode"), CTRL + SHIFT + Key_B,
+ this, SLOT(toggleBlockSelectionMode()),
+ ac, "set_verticalSelect");
+ a->setWhatsThis(i18n("This command allows switching between the normal (line based) selection mode and the block selection mode."));
+
+ a= m_toggleInsert = new KToggleAction(
+ i18n("Overwr&ite Mode"), Key_Insert,
+ this, SLOT(toggleInsert()),
+ ac, "set_insert" );
+ a->setWhatsThis(i18n("Choose whether you want the text you type to be inserted or to overwrite existing text."));
+
+ KToggleAction *toggleAction;
+ a= m_toggleDynWrap = toggleAction = new KToggleAction(
+ i18n("&Dynamic Word Wrap"), Key_F10,
+ this, SLOT(toggleDynWordWrap()),
+ ac, "view_dynamic_word_wrap" );
+ a->setWhatsThis(i18n("If this option is checked, the text lines will be wrapped at the view border on the screen."));
+
+ a= m_setDynWrapIndicators = new KSelectAction(i18n("Dynamic Word Wrap Indicators"), 0, ac, "dynamic_word_wrap_indicators");
+ a->setWhatsThis(i18n("Choose when the Dynamic Word Wrap Indicators should be displayed"));
+
+ connect(m_setDynWrapIndicators, SIGNAL(activated(int)), this, SLOT(setDynWrapIndicators(int)));
+ QStringList list2;
+ list2.append(i18n("&Off"));
+ list2.append(i18n("Follow &Line Numbers"));
+ list2.append(i18n("&Always On"));
+ m_setDynWrapIndicators->setItems(list2);
+
+ a= toggleAction=m_toggleFoldingMarkers = new KToggleAction(
+ i18n("Show Folding &Markers"), Key_F9,
+ this, SLOT(toggleFoldingMarkers()),
+ ac, "view_folding_markers" );
+ a->setWhatsThis(i18n("You can choose if the codefolding marks should be shown, if codefolding is possible."));
+ toggleAction->setCheckedState(i18n("Hide Folding &Markers"));
+
+ a= m_toggleIconBar = toggleAction = new KToggleAction(
+ i18n("Show &Icon Border"), Key_F6,
+ this, SLOT(toggleIconBorder()),
+ ac, "view_border");
+ a=toggleAction;
+ a->setWhatsThis(i18n("Show/hide the icon border.<BR><BR> The icon border shows bookmark symbols, for instance."));
+ toggleAction->setCheckedState(i18n("Hide &Icon Border"));
+
+ a= toggleAction=m_toggleLineNumbers = new KToggleAction(
+ i18n("Show &Line Numbers"), Key_F11,
+ this, SLOT(toggleLineNumbersOn()),
+ ac, "view_line_numbers" );
+ a->setWhatsThis(i18n("Show/hide the line numbers on the left hand side of the view."));
+ toggleAction->setCheckedState(i18n("Hide &Line Numbers"));
+
+ a= m_toggleScrollBarMarks = toggleAction = new KToggleAction(
+ i18n("Show Scroll&bar Marks"), 0,
+ this, SLOT(toggleScrollBarMarks()),
+ ac, "view_scrollbar_marks");
+ a->setWhatsThis(i18n("Show/hide the marks on the vertical scrollbar.<BR><BR>The marks, for instance, show bookmarks."));
+ toggleAction->setCheckedState(i18n("Hide Scroll&bar Marks"));
+
+ a = toggleAction = m_toggleWWMarker = new KToggleAction(
+ i18n("Show Static &Word Wrap Marker"), 0,
+ this, SLOT( toggleWWMarker() ),
+ ac, "view_word_wrap_marker" );
+ a->setWhatsThis( i18n(
+ "Show/hide the Word Wrap Marker, a vertical line drawn at the word "
+ "wrap column as defined in the editing properties" ));
+ toggleAction->setCheckedState(i18n("Hide Static &Word Wrap Marker"));
+
+ a= m_switchCmdLine = new KAction(
+ i18n("Switch to Command Line"), Key_F7,
+ this, SLOT(switchToCmdLine()),
+ ac, "switch_to_cmd_line" );
+ a->setWhatsThis(i18n("Show/hide the command line on the bottom of the view."));
+
+ a=m_setEndOfLine = new KSelectAction(i18n("&End of Line"), 0, ac, "set_eol");
+ a->setWhatsThis(i18n("Choose which line endings should be used, when you save the document"));
+ QStringList list;
+ list.append("&UNIX");
+ list.append("&Windows/DOS");
+ list.append("&Macintosh");
+ m_setEndOfLine->setItems(list);
+ m_setEndOfLine->setCurrentItem (m_doc->config()->eol());
+ connect(m_setEndOfLine, SIGNAL(activated(int)), this, SLOT(setEol(int)));
+
+ // encoding menu
+ new KateViewEncodingAction (m_doc, this, i18n("E&ncoding"), ac, "set_encoding");
+
+ m_search->createActions( ac );
+ m_spell->createActions( ac );
+ m_bookmarks->createActions( ac );
+
+ slotSelectionChanged ();
+
+ connect (this, SIGNAL(selectionChanged()), this, SLOT(slotSelectionChanged()));
+}
+
+void KateView::setupEditActions()
+{
+ m_editActions = new KActionCollection( m_viewInternal, this, "edit_actions" );
+ KActionCollection* ac = m_editActions;
+
+ new KAction(
+ i18n("Move Word Left"), CTRL + Key_Left,
+ this,SLOT(wordLeft()),
+ ac, "word_left" );
+ new KAction(
+ i18n("Select Character Left"), SHIFT + Key_Left,
+ this,SLOT(shiftCursorLeft()),
+ ac, "select_char_left" );
+ new KAction(
+ i18n("Select Word Left"), SHIFT + CTRL + Key_Left,
+ this, SLOT(shiftWordLeft()),
+ ac, "select_word_left" );
+
+ new KAction(
+ i18n("Move Word Right"), CTRL + Key_Right,
+ this, SLOT(wordRight()),
+ ac, "word_right" );
+ new KAction(
+ i18n("Select Character Right"), SHIFT + Key_Right,
+ this, SLOT(shiftCursorRight()),
+ ac, "select_char_right" );
+ new KAction(
+ i18n("Select Word Right"), SHIFT + CTRL + Key_Right,
+ this,SLOT(shiftWordRight()),
+ ac, "select_word_right" );
+
+ new KAction(
+ i18n("Move to Beginning of Line"), Key_Home,
+ this, SLOT(home()),
+ ac, "beginning_of_line" );
+ new KAction(
+ i18n("Move to Beginning of Document"), KStdAccel::home(),
+ this, SLOT(top()),
+ ac, "beginning_of_document" );
+ new KAction(
+ i18n("Select to Beginning of Line"), SHIFT + Key_Home,
+ this, SLOT(shiftHome()),
+ ac, "select_beginning_of_line" );
+ new KAction(
+ i18n("Select to Beginning of Document"), SHIFT + CTRL + Key_Home,
+ this, SLOT(shiftTop()),
+ ac, "select_beginning_of_document" );
+
+ new KAction(
+ i18n("Move to End of Line"), Key_End,
+ this, SLOT(end()),
+ ac, "end_of_line" );
+ new KAction(
+ i18n("Move to End of Document"), KStdAccel::end(),
+ this, SLOT(bottom()),
+ ac, "end_of_document" );
+ new KAction(
+ i18n("Select to End of Line"), SHIFT + Key_End,
+ this, SLOT(shiftEnd()),
+ ac, "select_end_of_line" );
+ new KAction(
+ i18n("Select to End of Document"), SHIFT + CTRL + Key_End,
+ this, SLOT(shiftBottom()),
+ ac, "select_end_of_document" );
+
+ new KAction(
+ i18n("Select to Previous Line"), SHIFT + Key_Up,
+ this, SLOT(shiftUp()),
+ ac, "select_line_up" );
+ new KAction(
+ i18n("Scroll Line Up"),"", CTRL + Key_Up,
+ this, SLOT(scrollUp()),
+ ac, "scroll_line_up" );
+
+ new KAction(i18n("Move to Next Line"), Key_Down, this, SLOT(down()),
+ ac, "move_line_down");
+
+ new KAction(i18n("Move to Previous Line"), Key_Up, this, SLOT(up()),
+ ac, "move_line_up");
+
+ new KAction(i18n("Move Character Right"), Key_Right, this,
+ SLOT(cursorRight()), ac, "move_cursor_right");
+
+ new KAction(i18n("Move Character Left"), Key_Left, this, SLOT(cursorLeft()),
+ ac, "move_cusor_left");
+
+ new KAction(
+ i18n("Select to Next Line"), SHIFT + Key_Down,
+ this, SLOT(shiftDown()),
+ ac, "select_line_down" );
+ new KAction(
+ i18n("Scroll Line Down"), CTRL + Key_Down,
+ this, SLOT(scrollDown()),
+ ac, "scroll_line_down" );
+
+ new KAction(
+ i18n("Scroll Page Up"), KStdAccel::prior(),
+ this, SLOT(pageUp()),
+ ac, "scroll_page_up" );
+ new KAction(
+ i18n("Select Page Up"), SHIFT + Key_PageUp,
+ this, SLOT(shiftPageUp()),
+ ac, "select_page_up" );
+ new KAction(
+ i18n("Move to Top of View"), CTRL + Key_PageUp,
+ this, SLOT(topOfView()),
+ ac, "move_top_of_view" );
+ new KAction(
+ i18n("Select to Top of View"), CTRL + SHIFT + Key_PageUp,
+ this, SLOT(shiftTopOfView()),
+ ac, "select_top_of_view" );
+
+ new KAction(
+ i18n("Scroll Page Down"), KStdAccel::next(),
+ this, SLOT(pageDown()),
+ ac, "scroll_page_down" );
+ new KAction(
+ i18n("Select Page Down"), SHIFT + Key_PageDown,
+ this, SLOT(shiftPageDown()),
+ ac, "select_page_down" );
+ new KAction(
+ i18n("Move to Bottom of View"), CTRL + Key_PageDown,
+ this, SLOT(bottomOfView()),
+ ac, "move_bottom_of_view" );
+ new KAction(
+ i18n("Select to Bottom of View"), CTRL + SHIFT + Key_PageDown,
+ this, SLOT(shiftBottomOfView()),
+ ac, "select_bottom_of_view" );
+ new KAction(
+ i18n("Move to Matching Bracket"), CTRL + Key_6,
+ this, SLOT(toMatchingBracket()),
+ ac, "to_matching_bracket" );
+ new KAction(
+ i18n("Select to Matching Bracket"), SHIFT + CTRL + Key_6,
+ this, SLOT(shiftToMatchingBracket()),
+ ac, "select_matching_bracket" );
+
+ // anders: shortcuts doing any changes should not be created in browserextension
+ if ( !m_doc->readOnly() )
+ {
+ new KAction(
+ i18n("Transpose Characters"), CTRL + Key_T,
+ this, SLOT(transpose()),
+ ac, "transpose_char" );
+
+ new KAction(
+ i18n("Delete Line"), CTRL + Key_K,
+ this, SLOT(killLine()),
+ ac, "delete_line" );
+
+ new KAction(
+ i18n("Delete Word Left"), KStdAccel::deleteWordBack(),
+ this, SLOT(deleteWordLeft()),
+ ac, "delete_word_left" );
+
+ new KAction(
+ i18n("Delete Word Right"), KStdAccel::deleteWordForward(),
+ this, SLOT(deleteWordRight()),
+ ac, "delete_word_right" );
+
+ new KAction(i18n("Delete Next Character"), Key_Delete,
+ this, SLOT(keyDelete()),
+ ac, "delete_next_character");
+
+ KAction *a = new KAction(i18n("Backspace"), Key_Backspace,
+ this, SLOT(backspace()),
+ ac, "backspace");
+ KShortcut cut = a->shortcut();
+ cut.append( KKey( SHIFT + Key_Backspace ) );
+ a->setShortcut( cut );
+ }
+
+ connect( this, SIGNAL(gotFocus(Kate::View*)),
+ this, SLOT(slotGotFocus()) );
+ connect( this, SIGNAL(lostFocus(Kate::View*)),
+ this, SLOT(slotLostFocus()) );
+
+ m_editActions->readShortcutSettings( "Katepart Shortcuts" );
+
+ if( hasFocus() )
+ slotGotFocus();
+ else
+ slotLostFocus();
+
+
+}
+
+void KateView::setupCodeFolding()
+{
+ KActionCollection *ac=this->actionCollection();
+ new KAction( i18n("Collapse Toplevel"), CTRL+SHIFT+Key_Minus,
+ m_doc->foldingTree(),SLOT(collapseToplevelNodes()),ac,"folding_toplevel");
+ new KAction( i18n("Expand Toplevel"), CTRL+SHIFT+Key_Plus,
+ this,SLOT(slotExpandToplevel()),ac,"folding_expandtoplevel");
+ new KAction( i18n("Collapse One Local Level"), CTRL+Key_Minus,
+ this,SLOT(slotCollapseLocal()),ac,"folding_collapselocal");
+ new KAction( i18n("Expand One Local Level"), CTRL+Key_Plus,
+ this,SLOT(slotExpandLocal()),ac,"folding_expandlocal");
+
+#ifdef DEBUGACCELS
+ KAccel* debugAccels = new KAccel(this,this);
+ debugAccels->insert("KATE_DUMP_REGION_TREE",i18n("Show the code folding region tree"),"","Ctrl+Shift+Alt+D",m_doc,SLOT(dumpRegionTree()));
+ debugAccels->insert("KATE_TEMPLATE_TEST",i18n("Basic template code test"),"","Ctrl+Shift+Alt+T",m_doc,SLOT(testTemplateCode()));
+ debugAccels->setEnabled(true);
+#endif
+}
+
+void KateView::slotExpandToplevel()
+{
+ m_doc->foldingTree()->expandToplevelNodes(m_doc->numLines());
+}
+
+void KateView::slotCollapseLocal()
+{
+ int realLine = m_doc->foldingTree()->collapseOne(cursorLine());
+ if (realLine != -1)
+ // TODO rodda: fix this to only set line and allow internal view to chose column
+ // Explicitly call internal because we want this to be registered as an internal call
+ setCursorPositionInternal(realLine, cursorColumn(), tabWidth(), false);
+}
+
+void KateView::slotExpandLocal()
+{
+ m_doc->foldingTree()->expandOne(cursorLine(), m_doc->numLines());
+}
+
+void KateView::setupCodeCompletion()
+{
+ m_codeCompletion = new KateCodeCompletion(this);
+ connect( m_codeCompletion, SIGNAL(completionAborted()),
+ this, SIGNAL(completionAborted()));
+ connect( m_codeCompletion, SIGNAL(completionDone()),
+ this, SIGNAL(completionDone()));
+ connect( m_codeCompletion, SIGNAL(argHintHidden()),
+ this, SIGNAL(argHintHidden()));
+ connect( m_codeCompletion, SIGNAL(completionDone(KTextEditor::CompletionEntry)),
+ this, SIGNAL(completionDone(KTextEditor::CompletionEntry)));
+ connect( m_codeCompletion, SIGNAL(filterInsertString(KTextEditor::CompletionEntry*,QString*)),
+ this, SIGNAL(filterInsertString(KTextEditor::CompletionEntry*,QString*)));
+}
+
+void KateView::slotGotFocus()
+{
+ m_editActions->accel()->setEnabled( true );
+
+ slotStatusMsg ();
+}
+
+void KateView::slotLostFocus()
+{
+ m_editActions->accel()->setEnabled( false );
+}
+
+void KateView::setDynWrapIndicators(int mode)
+{
+ config()->setDynWordWrapIndicators (mode);
+}
+
+void KateView::slotStatusMsg ()
+{
+ QString ovrstr;
+ if (m_doc->isReadWrite())
+ {
+ if (m_doc->config()->configFlags() & KateDocument::cfOvr)
+ ovrstr = i18n(" OVR ");
+ else
+ ovrstr = i18n(" INS ");
+ }
+ else
+ ovrstr = i18n(" R/O ");
+
+ uint r = cursorLine() + 1;
+ uint c = cursorColumn() + 1;
+
+ QString s1 = i18n(" Line: %1").arg(KGlobal::locale()->formatNumber(r, 0));
+ QString s2 = i18n(" Col: %1").arg(KGlobal::locale()->formatNumber(c, 0));
+
+ QString modstr = m_doc->isModified() ? QString (" * ") : QString (" ");
+ QString blockstr = blockSelectionMode() ? i18n(" BLK ") : i18n(" NORM ");
+
+ emit viewStatusMsg (s1 + s2 + " " + ovrstr + blockstr + modstr);
+}
+
+void KateView::slotSelectionTypeChanged()
+{
+ m_toggleBlockSelection->setChecked( blockSelectionMode() );
+
+ emit newStatus();
+}
+
+bool KateView::isOverwriteMode() const
+{
+ return m_doc->config()->configFlags() & KateDocument::cfOvr;
+}
+
+void KateView::reloadFile()
+{
+ m_doc->reloadFile();
+ emit newStatus();
+}
+
+void KateView::slotUpdate()
+{
+ emit newStatus();
+
+ slotNewUndo();
+}
+
+void KateView::slotReadWriteChanged ()
+{
+ if ( m_toggleWriteLock )
+ m_toggleWriteLock->setChecked( ! m_doc->isReadWrite() );
+
+ m_cut->setEnabled (m_doc->isReadWrite());
+ m_paste->setEnabled (m_doc->isReadWrite());
+
+ QStringList l;
+
+ l << "edit_replace" << "set_insert" << "tools_spelling" << "tools_indent"
+ << "tools_unindent" << "tools_cleanIndent" << "tools_align" << "tools_comment"
+ << "tools_uncomment" << "tools_uppercase" << "tools_lowercase"
+ << "tools_capitalize" << "tools_join_lines" << "tools_apply_wordwrap"
+ << "edit_undo" << "edit_redo" << "tools_spelling_from_cursor"
+ << "tools_spelling_selection";
+
+ KAction *a = 0;
+ for (uint z = 0; z < l.size(); z++)
+ if ((a = actionCollection()->action( l[z].ascii() )))
+ a->setEnabled (m_doc->isReadWrite());
+}
+
+void KateView::slotNewUndo()
+{
+ if (m_doc->readOnly())
+ return;
+
+ if ((m_doc->undoCount() > 0) != m_editUndo->isEnabled())
+ m_editUndo->setEnabled(m_doc->undoCount() > 0);
+
+ if ((m_doc->redoCount() > 0) != m_editRedo->isEnabled())
+ m_editRedo->setEnabled(m_doc->redoCount() > 0);
+}
+
+void KateView::slotDropEventPass( QDropEvent * ev )
+{
+ KURL::List lstDragURLs;
+ bool ok = KURLDrag::decode( ev, lstDragURLs );
+
+ KParts::BrowserExtension * ext = KParts::BrowserExtension::childObject( doc() );
+ if ( ok && ext )
+ emit ext->openURLRequest( lstDragURLs.first() );
+}
+
+void KateView::contextMenuEvent( QContextMenuEvent *ev )
+{
+ if ( !m_doc || !m_doc->browserExtension() )
+ return;
+ emit m_doc->browserExtension()->popupMenu( /*this, */ev->globalPos(), m_doc->url(),
+ QString::fromLatin1( "text/plain" ) );
+ ev->accept();
+}
+
+bool KateView::setCursorPositionInternal( uint line, uint col, uint tabwidth, bool calledExternally )
+{
+ KateTextLine::Ptr l = m_doc->kateTextLine( line );
+
+ if (!l)
+ return false;
+
+ QString line_str = m_doc->textLine( line );
+
+ uint z;
+ uint x = 0;
+ for (z = 0; z < line_str.length() && z < col; z++) {
+ if (line_str[z] == QChar('\t')) x += tabwidth - (x % tabwidth); else x++;
+ }
+
+ m_viewInternal->updateCursor( KateTextCursor( line, x ), false, true, calledExternally );
+
+ return true;
+}
+
+void KateView::setOverwriteMode( bool b )
+{
+ if ( isOverwriteMode() && !b )
+ m_doc->setConfigFlags( m_doc->config()->configFlags() ^ KateDocument::cfOvr );
+ else
+ m_doc->setConfigFlags( m_doc->config()->configFlags() | KateDocument::cfOvr );
+
+ m_toggleInsert->setChecked (isOverwriteMode ());
+}
+
+void KateView::toggleInsert()
+{
+ m_doc->setConfigFlags(m_doc->config()->configFlags() ^ KateDocument::cfOvr);
+ m_toggleInsert->setChecked (isOverwriteMode ());
+
+ emit newStatus();
+}
+
+bool KateView::canDiscard()
+{
+ return m_doc->closeURL();
+}
+
+void KateView::flush()
+{
+ m_doc->closeURL();
+}
+
+KateView::saveResult KateView::save()
+{
+ if( !m_doc->url().isValid() || !doc()->isReadWrite() )
+ return saveAs();
+
+ if( m_doc->save() )
+ return SAVE_OK;
+
+ return SAVE_ERROR;
+}
+
+KateView::saveResult KateView::saveAs()
+{
+
+ KEncodingFileDialog::Result res=KEncodingFileDialog::getSaveURLAndEncoding(doc()->config()->encoding(),
+ m_doc->url().url(),QString::null,this,i18n("Save File"));
+
+// kdDebug()<<"urllist is emtpy?"<<res.URLs.isEmpty()<<endl;
+// kdDebug()<<"url is:"<<res.URLs.first()<<endl;
+ if( res.URLs.isEmpty() || !checkOverwrite( res.URLs.first() ) )
+ return SAVE_CANCEL;
+
+ m_doc->config()->setEncoding( res.encoding );
+
+ if( m_doc->saveAs( res.URLs.first() ) )
+ return SAVE_OK;
+
+ return SAVE_ERROR;
+}
+
+bool KateView::checkOverwrite( KURL u )
+{
+ if( !u.isLocalFile() )
+ return true;
+
+ QFileInfo info( u.path() );
+ if( !info.exists() )
+ return true;
+
+ return KMessageBox::Continue
+ == KMessageBox::warningContinueCancel
+ ( this,
+ i18n( "A file named \"%1\" already exists. Are you sure you want to overwrite it?" ).arg( info.fileName() ),
+ i18n( "Overwrite File?" ),
+ KGuiItem( i18n( "&Overwrite" ), "filesave", i18n( "Overwrite the file" ) )
+ );
+}
+
+void KateView::slotSaveCanceled( const QString& error )
+{
+ if ( !error.isEmpty() ) // happens when cancelling a job
+ KMessageBox::error( this, error );
+}
+
+void KateView::gotoLine()
+{
+ KateGotoLineDialog *dlg = new KateGotoLineDialog (this, m_viewInternal->getCursor().line() + 1, m_doc->numLines());
+
+ if (dlg->exec() == QDialog::Accepted)
+ gotoLineNumber( dlg->getLine() - 1 );
+
+ delete dlg;
+}
+
+void KateView::gotoLineNumber( int line )
+{
+ // clear selection, unless we are in persistent selection mode
+ if ( !config()->persistentSelection() )
+ clearSelection();
+ setCursorPositionInternal ( line, 0, 1 );
+}
+
+void KateView::joinLines()
+{
+ int first = selStartLine();
+ int last = selEndLine();
+ //int left = m_doc->textLine( last ).length() - m_doc->selEndCol();
+ if ( first == last )
+ {
+ first = cursorLine();
+ last = first + 1;
+ }
+ m_doc->joinLines( first, last );
+}
+
+void KateView::readSessionConfig(KConfig *config)
+{
+ setCursorPositionInternal (config->readNumEntry("CursorLine"), config->readNumEntry("CursorColumn"), 1);
+}
+
+void KateView::writeSessionConfig(KConfig *config)
+{
+ config->writeEntry("CursorLine",m_viewInternal->cursor.line());
+ config->writeEntry("CursorColumn",m_viewInternal->cursor.col());
+}
+
+int KateView::getEol()
+{
+ return m_doc->config()->eol();
+}
+
+void KateView::setEol(int eol)
+{
+ if (!doc()->isReadWrite())
+ return;
+
+ if (m_updatingDocumentConfig)
+ return;
+
+ m_doc->config()->setEol (eol);
+}
+
+void KateView::setIconBorder( bool enable )
+{
+ config()->setIconBar (enable);
+}
+
+void KateView::toggleIconBorder()
+{
+ config()->setIconBar (!config()->iconBar());
+}
+
+void KateView::setLineNumbersOn( bool enable )
+{
+ config()->setLineNumbers (enable);
+}
+
+void KateView::toggleLineNumbersOn()
+{
+ config()->setLineNumbers (!config()->lineNumbers());
+}
+
+void KateView::setScrollBarMarks( bool enable )
+{
+ config()->setScrollBarMarks (enable);
+}
+
+void KateView::toggleScrollBarMarks()
+{
+ config()->setScrollBarMarks (!config()->scrollBarMarks());
+}
+
+void KateView::toggleDynWordWrap()
+{
+ config()->setDynWordWrap( !config()->dynWordWrap() );
+}
+
+void KateView::setDynWordWrap( bool b )
+{
+ config()->setDynWordWrap( b );
+}
+
+void KateView::toggleWWMarker()
+{
+ m_renderer->config()->setWordWrapMarker (!m_renderer->config()->wordWrapMarker());
+}
+
+void KateView::setFoldingMarkersOn( bool enable )
+{
+ config()->setFoldingBar ( enable );
+}
+
+void KateView::toggleFoldingMarkers()
+{
+ config()->setFoldingBar ( !config()->foldingBar() );
+}
+
+bool KateView::iconBorder() {
+ return m_viewInternal->leftBorder->iconBorderOn();
+}
+
+bool KateView::lineNumbersOn() {
+ return m_viewInternal->leftBorder->lineNumbersOn();
+}
+
+bool KateView::scrollBarMarks() {
+ return m_viewInternal->m_lineScroll->showMarks();
+}
+
+int KateView::dynWrapIndicators() {
+ return m_viewInternal->leftBorder->dynWrapIndicators();
+}
+
+bool KateView::foldingMarkersOn() {
+ return m_viewInternal->leftBorder->foldingMarkersOn();
+}
+
+void KateView::showCmdLine ( bool enabled )
+{
+ if (enabled == m_cmdLineOn)
+ return;
+
+ if (enabled)
+ {
+ if (!m_cmdLine)
+ {
+ m_cmdLine = new KateCmdLine (this);
+ m_grid->addMultiCellWidget (m_cmdLine, 2, 2, 0, 2);
+ }
+
+ m_cmdLine->show ();
+ m_cmdLine->setFocus();
+ }
+ else {
+ m_cmdLine->hide ();
+ //m_toggleCmdLine->setChecked(false);
+ }
+
+ m_cmdLineOn = enabled;
+}
+
+void KateView::toggleCmdLine ()
+{
+ m_config->setCmdLine (!m_config->cmdLine ());
+}
+
+void KateView::toggleWriteLock()
+{
+ m_doc->setReadWrite( ! m_doc->isReadWrite() );
+}
+
+void KateView::enableTextHints(int timeout)
+{
+ m_viewInternal->enableTextHints(timeout);
+}
+
+void KateView::disableTextHints()
+{
+ m_viewInternal->disableTextHints();
+}
+
+void KateView::applyWordWrap ()
+{
+ if (hasSelection())
+ m_doc->wrapText (selectStart.line(), selectEnd.line());
+ else
+ m_doc->wrapText (0, m_doc->lastLine());
+}
+
+void KateView::slotNeedTextHint(int line, int col, QString &text)
+{
+ text=QString("test %1 %2").arg(line).arg(col);
+}
+
+void KateView::find()
+{
+ m_search->find();
+}
+
+void KateView::find( const QString& pattern, long flags, bool add )
+{
+ m_search->find( pattern, flags, add );
+}
+
+void KateView::replace()
+{
+ m_search->replace();
+}
+
+void KateView::replace( const QString &pattern, const QString &replacement, long flags )
+{
+ m_search->replace( pattern, replacement, flags );
+}
+
+void KateView::findAgain( bool back )
+{
+ m_search->findAgain( back );
+}
+
+void KateView::slotSelectionChanged ()
+{
+ m_copy->setEnabled (hasSelection());
+ m_copyHTML->setEnabled (hasSelection());
+ m_deSelect->setEnabled (hasSelection());
+
+ if (m_doc->readOnly())
+ return;
+
+ m_cut->setEnabled (hasSelection());
+
+ m_spell->updateActions ();
+}
+
+void KateView::switchToCmdLine ()
+{
+ if (!m_cmdLineOn)
+ m_config->setCmdLine (true);
+ else {
+ if (m_cmdLine->hasFocus()) {
+ this->setFocus();
+ return;
+ }
+ }
+ m_cmdLine->setFocus ();
+}
+
+void KateView::showArgHint( QStringList arg1, const QString& arg2, const QString& arg3 )
+{
+ m_codeCompletion->showArgHint( arg1, arg2, arg3 );
+}
+
+void KateView::showCompletionBox( QValueList<KTextEditor::CompletionEntry> arg1, int offset, bool cs )
+{
+ emit aboutToShowCompletionBox();
+ m_codeCompletion->showCompletionBox( arg1, offset, cs );
+}
+
+KateRenderer *KateView::renderer ()
+{
+ return m_renderer;
+}
+
+void KateView::updateConfig ()
+{
+ if (m_startingUp)
+ return;
+
+ m_editActions->readShortcutSettings( "Katepart Shortcuts" );
+
+ // dyn. word wrap & markers
+ if (m_hasWrap != config()->dynWordWrap()) {
+ m_viewInternal->prepareForDynWrapChange();
+
+ m_hasWrap = config()->dynWordWrap();
+
+ m_viewInternal->dynWrapChanged();
+
+ m_setDynWrapIndicators->setEnabled(config()->dynWordWrap());
+ m_toggleDynWrap->setChecked( config()->dynWordWrap() );
+ }
+
+ m_viewInternal->leftBorder->setDynWrapIndicators( config()->dynWordWrapIndicators() );
+ m_setDynWrapIndicators->setCurrentItem( config()->dynWordWrapIndicators() );
+
+ // line numbers
+ m_viewInternal->leftBorder->setLineNumbersOn( config()->lineNumbers() );
+ m_toggleLineNumbers->setChecked( config()->lineNumbers() );
+
+ // icon bar
+ m_viewInternal->leftBorder->setIconBorderOn( config()->iconBar() );
+ m_toggleIconBar->setChecked( config()->iconBar() );
+
+ // scrollbar marks
+ m_viewInternal->m_lineScroll->setShowMarks( config()->scrollBarMarks() );
+ m_toggleScrollBarMarks->setChecked( config()->scrollBarMarks() );
+
+ // cmd line
+ showCmdLine (config()->cmdLine());
+ //m_toggleCmdLine->setChecked( config()->cmdLine() );
+
+ // misc edit
+ m_toggleBlockSelection->setChecked( blockSelectionMode() );
+ m_toggleInsert->setChecked( isOverwriteMode() );
+
+ updateFoldingConfig ();
+
+ // bookmark
+ m_bookmarks->setSorting( (KateBookmarks::Sorting) config()->bookmarkSort() );
+
+ m_viewInternal->setAutoCenterLines(config()->autoCenterLines ());
+}
+
+void KateView::updateDocumentConfig()
+{
+ if (m_startingUp)
+ return;
+
+ m_updatingDocumentConfig = true;
+
+ m_setEndOfLine->setCurrentItem (m_doc->config()->eol());
+
+ m_updatingDocumentConfig = false;
+
+ m_viewInternal->updateView (true);
+
+ m_renderer->setTabWidth (m_doc->config()->tabWidth());
+ m_renderer->setIndentWidth (m_doc->config()->indentationWidth());
+}
+
+void KateView::updateRendererConfig()
+{
+ if (m_startingUp)
+ return;
+
+ m_toggleWWMarker->setChecked( m_renderer->config()->wordWrapMarker() );
+
+ // update the text area
+ m_viewInternal->updateView (true);
+ m_viewInternal->repaint ();
+
+ // update the left border right, for example linenumbers
+ m_viewInternal->leftBorder->updateFont();
+ m_viewInternal->leftBorder->repaint ();
+
+// @@ showIndentLines is not cached anymore.
+// m_renderer->setShowIndentLines (m_renderer->config()->showIndentationLines());
+}
+
+void KateView::updateFoldingConfig ()
+{
+ // folding bar
+ bool doit = config()->foldingBar() && m_doc->highlight() && m_doc->highlight()->allowsFolding();
+ m_viewInternal->leftBorder->setFoldingMarkersOn(doit);
+ m_toggleFoldingMarkers->setChecked( doit );
+ m_toggleFoldingMarkers->setEnabled( m_doc->highlight() && m_doc->highlight()->allowsFolding() );
+
+ QStringList l;
+
+ l << "folding_toplevel" << "folding_expandtoplevel"
+ << "folding_collapselocal" << "folding_expandlocal";
+
+ KAction *a = 0;
+ for (uint z = 0; z < l.size(); z++)
+ if ((a = actionCollection()->action( l[z].ascii() )))
+ a->setEnabled (m_doc->highlight() && m_doc->highlight()->allowsFolding());
+}
+
+//BEGIN EDIT STUFF
+void KateView::editStart ()
+{
+ m_viewInternal->editStart ();
+}
+
+void KateView::editEnd (int editTagLineStart, int editTagLineEnd, bool tagFrom)
+{
+ m_viewInternal->editEnd (editTagLineStart, editTagLineEnd, tagFrom);
+}
+
+void KateView::editSetCursor (const KateTextCursor &cursor)
+{
+ m_viewInternal->editSetCursor (cursor);
+}
+//END
+
+//BEGIN TAG & CLEAR
+bool KateView::tagLine (const KateTextCursor& virtualCursor)
+{
+ return m_viewInternal->tagLine (virtualCursor);
+}
+
+bool KateView::tagLines (int start, int end, bool realLines)
+{
+ return m_viewInternal->tagLines (start, end, realLines);
+}
+
+bool KateView::tagLines (KateTextCursor start, KateTextCursor end, bool realCursors)
+{
+ return m_viewInternal->tagLines (start, end, realCursors);
+}
+
+void KateView::tagAll ()
+{
+ m_viewInternal->tagAll ();
+}
+
+void KateView::clear ()
+{
+ m_viewInternal->clear ();
+}
+
+void KateView::repaintText (bool paintOnlyDirty)
+{
+ m_viewInternal->paintText(0,0,m_viewInternal->width(),m_viewInternal->height(), paintOnlyDirty);
+}
+
+void KateView::updateView (bool changed)
+{
+ m_viewInternal->updateView (changed);
+ m_viewInternal->leftBorder->update();
+}
+
+//END
+
+void KateView::slotHlChanged()
+{
+ KateHighlighting *hl = m_doc->highlight();
+ bool ok ( !hl->getCommentStart(0).isEmpty() || !hl->getCommentSingleLineStart(0).isEmpty() );
+
+ if (actionCollection()->action("tools_comment"))
+ actionCollection()->action("tools_comment")->setEnabled( ok );
+
+ if (actionCollection()->action("tools_uncomment"))
+ actionCollection()->action("tools_uncomment")->setEnabled( ok );
+
+ // show folding bar if "view defaults" says so, otherwise enable/disable only the menu entry
+ updateFoldingConfig ();
+}
+
+uint KateView::cursorColumn()
+{
+ uint r = m_doc->currentColumn(m_viewInternal->getCursor());
+ if ( !( m_doc->config()->configFlags() & KateDocumentConfig::cfWrapCursor ) &&
+ (uint)m_viewInternal->getCursor().col() > m_doc->textLine( m_viewInternal->getCursor().line() ).length() )
+ r += m_viewInternal->getCursor().col() - m_doc->textLine( m_viewInternal->getCursor().line() ).length();
+
+ return r;
+}
+
+//BEGIN KTextEditor::SelectionInterface stuff
+
+bool KateView::setSelection( const KateTextCursor& start, const KateTextCursor& end )
+{
+ KateTextCursor oldSelectStart = selectStart;
+ KateTextCursor oldSelectEnd = selectEnd;
+
+ if (start <= end) {
+ selectStart.setPos(start);
+ selectEnd.setPos(end);
+ } else {
+ selectStart.setPos(end);
+ selectEnd.setPos(start);
+ }
+
+ tagSelection(oldSelectStart, oldSelectEnd);
+
+ repaintText(true);
+
+ emit selectionChanged ();
+ emit m_doc->selectionChanged ();
+
+ return true;
+}
+
+bool KateView::setSelection( uint startLine, uint startCol, uint endLine, uint endCol )
+{
+ if (hasSelection())
+ clearSelection(false, false);
+
+ return setSelection( KateTextCursor(startLine, startCol), KateTextCursor(endLine, endCol) );
+}
+
+void KateView::syncSelectionCache()
+{
+ m_viewInternal->selStartCached = selectStart;
+ m_viewInternal->selEndCached = selectEnd;
+ m_viewInternal->selectAnchor = selectEnd;
+}
+
+bool KateView::clearSelection()
+{
+ return clearSelection(true);
+}
+
+bool KateView::clearSelection(bool redraw, bool finishedChangingSelection)
+{
+ if( !hasSelection() )
+ return false;
+
+ KateTextCursor oldSelectStart = selectStart;
+ KateTextCursor oldSelectEnd = selectEnd;
+
+ selectStart.setPos(-1, -1);
+ selectEnd.setPos(-1, -1);
+
+ tagSelection(oldSelectStart, oldSelectEnd);
+
+ oldSelectStart = selectStart;
+ oldSelectEnd = selectEnd;
+
+ if (redraw)
+ repaintText(true);
+
+ if (finishedChangingSelection)
+ {
+ emit selectionChanged();
+ emit m_doc->selectionChanged ();
+ }
+
+ return true;
+}
+
+bool KateView::hasSelection() const
+{
+ return selectStart != selectEnd;
+}
+
+QString KateView::selection() const
+{
+ int sc = selectStart.col();
+ int ec = selectEnd.col();
+
+ if ( blockSelect )
+ {
+ if (sc > ec)
+ {
+ uint tmp = sc;
+ sc = ec;
+ ec = tmp;
+ }
+ }
+ return m_doc->text (selectStart.line(), sc, selectEnd.line(), ec, blockSelect);
+}
+
+bool KateView::removeSelectedText ()
+{
+ if (!hasSelection())
+ return false;
+
+ m_doc->editStart ();
+
+ int sc = selectStart.col();
+ int ec = selectEnd.col();
+
+ if ( blockSelect )
+ {
+ if (sc > ec)
+ {
+ uint tmp = sc;
+ sc = ec;
+ ec = tmp;
+ }
+ }
+
+ m_doc->removeText (selectStart.line(), sc, selectEnd.line(), ec, blockSelect);
+
+ // don't redraw the cleared selection - that's done in editEnd().
+ clearSelection(false);
+
+ m_doc->editEnd ();
+
+ return true;
+}
+
+bool KateView::selectAll()
+{
+ setBlockSelectionMode (false);
+
+ return setSelection (0, 0, m_doc->lastLine(), m_doc->lineLength(m_doc->lastLine()));
+}
+
+bool KateView::lineColSelected (int line, int col)
+{
+ if ( (!blockSelect) && (col < 0) )
+ col = 0;
+
+ KateTextCursor cursor(line, col);
+
+ if (blockSelect)
+ return cursor.line() >= selectStart.line() && cursor.line() <= selectEnd.line() && cursor.col() >= selectStart.col() && cursor.col() < selectEnd.col();
+ else
+ return (cursor >= selectStart) && (cursor < selectEnd);
+}
+
+bool KateView::lineSelected (int line)
+{
+ return (!blockSelect)
+ && (selectStart <= KateTextCursor(line, 0))
+ && (line < selectEnd.line());
+}
+
+bool KateView::lineEndSelected (int line, int endCol)
+{
+ return (!blockSelect)
+ && (line > selectStart.line() || (line == selectStart.line() && (selectStart.col() < endCol || endCol == -1)))
+ && (line < selectEnd.line() || (line == selectEnd.line() && (endCol <= selectEnd.col() && endCol != -1)));
+}
+
+bool KateView::lineHasSelected (int line)
+{
+ return (selectStart < selectEnd)
+ && (line >= selectStart.line())
+ && (line <= selectEnd.line());
+}
+
+bool KateView::lineIsSelection (int line)
+{
+ return (line == selectStart.line() && line == selectEnd.line());
+}
+
+void KateView::tagSelection(const KateTextCursor &oldSelectStart, const KateTextCursor &oldSelectEnd)
+{
+ if (hasSelection()) {
+ if (oldSelectStart.line() == -1) {
+ // We have to tag the whole lot if
+ // 1) we have a selection, and:
+ // a) it's new; or
+ tagLines(selectStart, selectEnd, true);
+
+ } else if (blockSelectionMode() && (oldSelectStart.col() != selectStart.col() || oldSelectEnd.col() != selectEnd.col())) {
+ // b) we're in block selection mode and the columns have changed
+ tagLines(selectStart, selectEnd, true);
+ tagLines(oldSelectStart, oldSelectEnd, true);
+
+ } else {
+ if (oldSelectStart != selectStart) {
+ if (oldSelectStart < selectStart)
+ tagLines(oldSelectStart, selectStart, true);
+ else
+ tagLines(selectStart, oldSelectStart, true);
+ }
+
+ if (oldSelectEnd != selectEnd) {
+ if (oldSelectEnd < selectEnd)
+ tagLines(oldSelectEnd, selectEnd, true);
+ else
+ tagLines(selectEnd, oldSelectEnd, true);
+ }
+ }
+
+ } else {
+ // No more selection, clean up
+ tagLines(oldSelectStart, oldSelectEnd, true);
+ }
+}
+
+void KateView::selectWord( const KateTextCursor& cursor )
+{
+ int start, end, len;
+
+ KateTextLine::Ptr textLine = m_doc->plainKateTextLine(cursor.line());
+
+ if (!textLine)
+ return;
+
+ len = textLine->length();
+ start = end = cursor.col();
+ while (start > 0 && m_doc->highlight()->isInWord(textLine->getChar(start - 1), textLine->attribute(start - 1))) start--;
+ while (end < len && m_doc->highlight()->isInWord(textLine->getChar(end), textLine->attribute(start - 1))) end++;
+ if (end <= start) return;
+
+ setSelection (cursor.line(), start, cursor.line(), end);
+}
+
+void KateView::selectLine( const KateTextCursor& cursor )
+{
+ if (cursor.line()+1 >= m_doc->numLines())
+ setSelection (cursor.line(), 0, cursor.line(), m_doc->lineLength(cursor.line()));
+ else
+ setSelection (cursor.line(), 0, cursor.line()+1, 0);
+}
+
+void KateView::selectLength( const KateTextCursor& cursor, int length )
+{
+ int start, end;
+
+ KateTextLine::Ptr textLine = m_doc->plainKateTextLine(cursor.line());
+
+ if (!textLine)
+ return;
+
+ start = cursor.col();
+ end = start + length;
+ if (end <= start) return;
+
+ setSelection (cursor.line(), start, cursor.line(), end);
+}
+
+void KateView::paste()
+{
+ m_doc->paste( this );
+ emit selectionChanged();
+ m_viewInternal->repaint();
+}
+
+void KateView::cut()
+{
+ if (!hasSelection())
+ return;
+
+ copy();
+ removeSelectedText();
+}
+
+void KateView::copy() const
+{
+ if (!hasSelection())
+ return;
+
+ QApplication::clipboard()->setText(selection ());
+}
+
+void KateView::copyHTML()
+{
+ if (!hasSelection())
+ return;
+
+ KMultipleDrag *drag = new KMultipleDrag();
+
+ QTextDrag *htmltextdrag = new QTextDrag(selectionAsHtml()) ;
+ htmltextdrag->setSubtype("html");
+
+ drag->addDragObject( htmltextdrag);
+ drag->addDragObject( new QTextDrag( selection()));
+
+ QApplication::clipboard()->setData(drag);
+}
+
+QString KateView::selectionAsHtml()
+{
+ int sc = selectStart.col();
+ int ec = selectEnd.col();
+
+ if ( blockSelect )
+ {
+ if (sc > ec)
+ {
+ uint tmp = sc;
+ sc = ec;
+ ec = tmp;
+ }
+ }
+
+ return textAsHtml (selectStart.line(), sc, selectEnd.line(), ec, blockSelect);
+}
+
+QString KateView::textAsHtml ( uint startLine, uint startCol, uint endLine, uint endCol, bool blockwise)
+{
+ kdDebug(13020) << "textAsHtml" << endl;
+ if ( blockwise && (startCol > endCol) )
+ return QString ();
+
+ QString s;
+ QTextStream ts( &s, IO_WriteOnly );
+ ts.setEncoding(QTextStream::UnicodeUTF8);
+ ts << "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"DTD/xhtml1-strict.dtd\">" << endl;
+ ts << "<html xmlns=\"http://www.w3.org/1999/xhtml\">" << endl;
+ ts << "<head>" << endl;
+ ts << "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />" << endl;
+ ts << "<meta name=\"Generator\" content=\"Kate, the KDE Advanced Text Editor\" />" << endl;
+ ts << "</head>" << endl;
+
+ ts << "<body>" << endl;
+ textAsHtmlStream(startLine, startCol, endLine, endCol, blockwise, &ts);
+
+ ts << "</body>" << endl;
+ ts << "</html>" << endl;
+ kdDebug(13020) << "html is: " << s << endl;
+ return s;
+}
+
+void KateView::textAsHtmlStream ( uint startLine, uint startCol, uint endLine, uint endCol, bool blockwise, QTextStream *ts)
+{
+ if ( (blockwise || startLine == endLine) && (startCol > endCol) )
+ return;
+
+ if (startLine == endLine)
+ {
+ KateTextLine::Ptr textLine = m_doc->kateTextLine(startLine);
+ if ( !textLine )
+ return;
+
+ (*ts) << "<pre>" << endl;
+
+ lineAsHTML(textLine, startCol, endCol-startCol, ts);
+ }
+ else
+ {
+ (*ts) << "<pre>" << endl;
+
+ for (uint i = startLine; (i <= endLine) && (i < m_doc->numLines()); i++)
+ {
+ KateTextLine::Ptr textLine = m_doc->kateTextLine(i);
+
+ if ( !blockwise )
+ {
+ if (i == startLine)
+ lineAsHTML(textLine, startCol, textLine->length()-startCol, ts);
+ else if (i == endLine)
+ lineAsHTML(textLine, 0, endCol, ts);
+ else
+ lineAsHTML(textLine, 0, textLine->length(), ts);
+ }
+ else
+ {
+ lineAsHTML( textLine, startCol, endCol-startCol, ts);
+ }
+
+ if ( i < endLine )
+ (*ts) << "\n"; //we are inside a <pre>, so a \n is a new line
+ }
+ }
+ (*ts) << "</pre>";
+}
+
+// fully rewritten to use only inline CSS and support all used attribs.
+// anders, 2005-11-01 23:39:43
+void KateView::lineAsHTML (KateTextLine::Ptr line, uint startCol, uint length, QTextStream *outputStream)
+{
+ if(length == 0)
+ return;
+
+ // do not recalculate the style strings again and again
+ QMap<uchar,QString> stylecache;
+ // do not insert equally styled characters one by one
+ QString textcache;
+
+ KateAttribute *charAttributes = 0;
+
+ for (uint curPos=startCol;curPos<(length+startCol);curPos++)
+ {
+ if ( curPos == 0 || line->attribute( curPos ) != line->attribute( curPos - 1 ) &&
+ // Since many highlight files contains itemdatas that have the exact
+ // same styles, join those to keep the HTML text size down
+ KateAttribute(*charAttributes) != KateAttribute(*m_renderer->attribute(line->attribute(curPos))) )
+ {
+ (*outputStream) << textcache;
+ textcache.truncate(0);
+
+ if ( curPos > startCol )
+ (*outputStream) << "</span>";
+
+ charAttributes = m_renderer->attribute(line->attribute(curPos));
+
+ if ( ! stylecache.contains( line->attribute(curPos) ) )
+ {
+ QString textdecoration;
+ QString style;
+
+ if ( charAttributes->bold() )
+ style.append("font-weight: bold;");
+ if ( charAttributes->italic() )
+ style.append("font-style: italic;");
+ if ( charAttributes->underline() )
+ textdecoration = "underline";
+ if ( charAttributes->overline() )
+ textdecoration.append(" overline" );
+ if ( charAttributes->strikeOut() )
+ textdecoration.append(" line-trough" );
+ if ( !textdecoration.isEmpty() )
+ style.append("text-decoration: %1;").arg(textdecoration);
+ // QColor::name() returns a string in the form "#RRGGBB" in Qt 3.
+ // NOTE Qt 4 returns "#AARRGGBB"
+ if ( charAttributes->itemSet(KateAttribute::BGColor) )
+ style.append(QString("background-color: %1;").arg(charAttributes->bgColor().name()));
+ if ( charAttributes->itemSet(KateAttribute::TextColor) )
+ style.append(QString("color: %1;").arg(charAttributes->textColor().name()));
+
+ stylecache[line->attribute(curPos)] = style;
+ }
+ (*outputStream)<<"<span style=\""
+ << stylecache[line->attribute(curPos)]
+ << "\">";
+ }
+
+ QString s( line->getChar(curPos) );
+ if ( s == "&" ) s = "&amp;";
+ else if ( s == "<" ) s = "&lt;";
+ else if ( s == ">" ) s = "&gt;";
+ textcache.append( s );
+ }
+
+ (*outputStream) << textcache << "</span>";
+}
+
+void KateView::exportAsHTML ()
+{
+ KURL url = KFileDialog::getSaveURL(m_doc->docName(),"text/html",0,i18n("Export File as HTML"));
+
+ if ( url.isEmpty() )
+ return;
+
+ QString filename;
+ KTempFile tmp; // ### only used for network export
+
+ if ( url.isLocalFile() )
+ filename = url.path();
+ else
+ filename = tmp.name();
+
+ KSaveFile *savefile=new KSaveFile(filename);
+ if (!savefile->status())
+ {
+ QTextStream *outputStream = savefile->textStream();
+
+ outputStream->setEncoding(QTextStream::UnicodeUTF8);
+
+ // let's write the HTML header :
+ (*outputStream) << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" << endl;
+ (*outputStream) << "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"DTD/xhtml1-strict.dtd\">" << endl;
+ (*outputStream) << "<html xmlns=\"http://www.w3.org/1999/xhtml\">" << endl;
+ (*outputStream) << "<head>" << endl;
+ (*outputStream) << "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />" << endl;
+ (*outputStream) << "<meta name=\"Generator\" content=\"Kate, the KDE Advanced Text Editor\" />" << endl;
+ // for the title, we write the name of the file (/usr/local/emmanuel/myfile.cpp -> myfile.cpp)
+ (*outputStream) << "<title>" << m_doc->docName () << "</title>" << endl;
+ (*outputStream) << "</head>" << endl;
+ (*outputStream) << "<body>" << endl;
+
+ textAsHtmlStream(0,0, m_doc->lastLine(), m_doc->lineLength(m_doc->lastLine()), false, outputStream);
+
+ (*outputStream) << "</body>" << endl;
+ (*outputStream) << "</html>" << endl;
+
+
+ savefile->close();
+ //if (!savefile->status()) --> Error
+ }
+// else
+// {/*ERROR*/}
+ delete savefile;
+
+ if ( url.isLocalFile() )
+ return;
+
+ KIO::NetAccess::upload( filename, url, 0 );
+}
+//END
+
+//BEGIN KTextEditor::BlockSelectionInterface stuff
+
+bool KateView::blockSelectionMode ()
+{
+ return blockSelect;
+}
+
+bool KateView::setBlockSelectionMode (bool on)
+{
+ if (on != blockSelect)
+ {
+ blockSelect = on;
+
+ KateTextCursor oldSelectStart = selectStart;
+ KateTextCursor oldSelectEnd = selectEnd;
+
+ clearSelection(false, false);
+
+ setSelection(oldSelectStart, oldSelectEnd);
+
+ slotSelectionTypeChanged();
+ }
+
+ return true;
+}
+
+bool KateView::toggleBlockSelectionMode ()
+{
+ m_toggleBlockSelection->setChecked (!blockSelect);
+ return setBlockSelectionMode (!blockSelect);
+}
+
+bool KateView::wrapCursor ()
+{
+ return !blockSelectionMode() && (m_doc->configFlags() & KateDocument::cfWrapCursor);
+}
+
+//END
+
+//BEGIN IM INPUT STUFF
+void KateView::setIMSelectionValue( uint imStartLine, uint imStart, uint imEnd,
+ uint imSelStart, uint imSelEnd, bool imComposeEvent )
+{
+ m_imStartLine = imStartLine;
+ m_imStart = imStart;
+ m_imEnd = imEnd;
+ m_imSelStart = imSelStart;
+ m_imSelEnd = imSelEnd;
+ m_imComposeEvent = imComposeEvent;
+}
+
+bool KateView::isIMSelection( int _line, int _column )
+{
+ return ( ( int( m_imStartLine ) == _line ) && ( m_imSelStart < m_imSelEnd ) && ( _column >= int( m_imSelStart ) ) &&
+ ( _column < int( m_imSelEnd ) ) );
+}
+
+bool KateView::isIMEdit( int _line, int _column )
+{
+ return ( ( int( m_imStartLine ) == _line ) && ( m_imStart < m_imEnd ) && ( _column >= int( m_imStart ) ) &&
+ ( _column < int( m_imEnd ) ) );
+}
+
+void KateView::getIMSelectionValue( uint *imStartLine, uint *imStart, uint *imEnd,
+ uint *imSelStart, uint *imSelEnd )
+{
+ *imStartLine = m_imStartLine;
+ *imStart = m_imStart;
+ *imEnd = m_imEnd;
+ *imSelStart = m_imSelStart;
+ *imSelEnd = m_imSelEnd;
+}
+//END IM INPUT STUFF
+
+// kate: space-indent on; indent-width 2; replace-tabs on;
diff --git a/kate/part/kateview.h b/kate/part/kateview.h
new file mode 100644
index 000000000..0e2f310b8
--- /dev/null
+++ b/kate/part/kateview.h
@@ -0,0 +1,571 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2002 John Firebaugh <jfirebaugh@kde.org>
+ Copyright (C) 2001 Christoph Cullmann <cullmann@kde.org>
+ Copyright (C) 2001 Joseph Wenninger <jowenn@kde.org>
+ Copyright (C) 1999 Jochen Wilhelmy <digisnap@cs.tu-berlin.de>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef kate_view_h
+#define kate_view_h
+
+#include "katedocument.h"
+#include "kateviewinternal.h"
+#include "kateconfig.h"
+
+#include "../interfaces/view.h"
+
+#include <ktexteditor/sessionconfiginterface.h>
+#include <ktexteditor/viewstatusmsginterface.h>
+#include <ktexteditor/texthintinterface.h>
+
+#include <qguardedptr.h>
+
+class KateDocument;
+class KateBookmarks;
+class KateSearch;
+class KateCmdLine;
+class KateCodeCompletion;
+class KateViewConfig;
+class KateViewSchemaAction;
+class KateRenderer;
+class KateSpell;
+
+class KToggleAction;
+class KAction;
+class KRecentFilesAction;
+class KSelectAction;
+
+class QGridLayout;
+
+//
+// Kate KTextEditor::View class ;)
+//
+class KateView : public Kate::View,
+ public KTextEditor::SessionConfigInterface,
+ public KTextEditor::ViewStatusMsgInterface,
+ public KTextEditor::TextHintInterface,
+ public KTextEditor::SelectionInterface,
+ public KTextEditor::SelectionInterfaceExt,
+ public KTextEditor::BlockSelectionInterface
+{
+ Q_OBJECT
+
+ friend class KateViewInternal;
+ friend class KateIconBorder;
+ friend class KateCodeCompletion;
+
+ public:
+ KateView( KateDocument* doc, QWidget* parent = 0L, const char* name = 0 );
+ ~KateView ();
+
+ //
+ // KTextEditor::View
+ //
+ public:
+ KTextEditor::Document* document() const { return m_doc; }
+
+ //
+ // KTextEditor::ClipboardInterface
+ //
+ public slots:
+ // TODO: Factor out of m_viewInternal
+ void paste();
+ void cut();
+ void copy() const;
+
+ /**
+ * internal use, copy text as HTML to clipboard
+ */
+ void copyHTML();
+
+ // helper to export text as html stuff
+ private:
+ QString selectionAsHtml ();
+ QString textAsHtml ( uint startLine, uint startCol, uint endLine, uint endCol, bool blockwise);
+ void textAsHtmlStream ( uint startLine, uint startCol, uint endLine, uint endCol, bool blockwise, QTextStream *ts);
+
+ /**
+ * Gets a substring in valid-xml html.
+ * Example: "<b>const</b> b = <i>34</i>"
+ * It won't contain <p> or <body> or <html> or anything like that.
+ *
+ * @param startCol start column of substring
+ * @param length length of substring
+ * @param renderer The katerenderer. This will have the schema
+ * information that describes how to render the
+ * attributes.
+ * @param outputStream A stream to write the html to
+ */
+ void lineAsHTML (KateTextLine::Ptr line, uint startCol, uint length, QTextStream *outputStream);
+
+ public slots:
+ void exportAsHTML ();
+
+ //
+ // KTextEditor::PopupMenuInterface
+ //
+ public:
+ void installPopup( QPopupMenu* menu ) { m_rmbMenu = menu; }
+ QPopupMenu* popup() const { return m_rmbMenu; }
+
+ //
+ // KTextEditor::ViewCursorInterface
+ //
+ public slots:
+ QPoint cursorCoordinates()
+ { return m_viewInternal->cursorCoordinates(); }
+ void cursorPosition( uint* l, uint* c )
+ { if( l ) *l = cursorLine(); if( c ) *c = cursorColumn(); }
+ void cursorPositionReal( uint* l, uint* c )
+ { if( l ) *l = cursorLine(); if( c ) *c = cursorColumnReal(); }
+ bool setCursorPosition( uint line, uint col )
+ { return setCursorPositionInternal( line, col, tabWidth(), true ); }
+ bool setCursorPositionReal( uint line, uint col)
+ { return setCursorPositionInternal( line, col, 1, true ); }
+ uint cursorLine()
+ { return m_viewInternal->getCursor().line(); }
+ uint cursorColumn();
+ uint cursorColumnReal()
+ { return m_viewInternal->getCursor().col(); }
+
+ signals:
+ void cursorPositionChanged();
+
+ //
+ // KTextEditor::CodeCompletionInterface
+ //
+ public slots:
+ void showArgHint( QStringList arg1, const QString& arg2, const QString& arg3 );
+ void showCompletionBox( QValueList<KTextEditor::CompletionEntry> arg1, int offset = 0, bool cs = true );
+
+ signals:
+ void completionAborted();
+ void completionDone();
+ void argHintHidden();
+ void completionDone(KTextEditor::CompletionEntry);
+ void filterInsertString(KTextEditor::CompletionEntry*,QString *);
+ void aboutToShowCompletionBox();
+
+ //
+ // KTextEditor::TextHintInterface
+ //
+ public:
+ void enableTextHints(int timeout);
+ void disableTextHints();
+
+ signals:
+ void needTextHint(int line, int col, QString &text);
+
+ //
+ // KTextEditor::DynWordWrapInterface
+ //
+ public:
+ void setDynWordWrap( bool b );
+ bool dynWordWrap() const { return m_hasWrap; }
+
+ //
+ // KTextEditor::SelectionInterface stuff
+ //
+ public slots:
+ bool setSelection ( const KateTextCursor & start,
+ const KateTextCursor & end );
+ bool setSelection ( uint startLine, uint startCol,
+ uint endLine, uint endCol );
+ bool clearSelection ();
+ bool clearSelection (bool redraw, bool finishedChangingSelection = true);
+
+ bool hasSelection () const;
+ QString selection () const ;
+
+ bool removeSelectedText ();
+
+ bool selectAll();
+
+ //
+ // KTextEditor::SelectionInterfaceExt
+ //
+ int selStartLine() { return selectStart.line(); };
+ int selStartCol() { return selectStart.col(); };
+ int selEndLine() { return selectEnd.line(); };
+ int selEndCol() { return selectEnd.col(); };
+
+ signals:
+ void selectionChanged ();
+
+ //
+ // internal helper stuff, for katerenderer and so on
+ //
+ public:
+ /**
+ * accessors to the selection start
+ * @return selection start cursor (read-only)
+ */
+ inline const KateSuperCursor &selStart () const { return selectStart; }
+
+ /**
+ * accessors to the selection end
+ * @return selection end cursor (read-only)
+ */
+ inline const KateSuperCursor &selEnd () const { return selectEnd; }
+
+ // should cursor be wrapped ? take config + blockselection state in account
+ bool wrapCursor ();
+
+ // some internal functions to get selection state of a line/col
+ bool lineColSelected (int line, int col);
+ bool lineSelected (int line);
+ bool lineEndSelected (int line, int endCol);
+ bool lineHasSelected (int line);
+ bool lineIsSelection (int line);
+
+ void tagSelection (const KateTextCursor &oldSelectStart, const KateTextCursor &oldSelectEnd);
+
+ void selectWord( const KateTextCursor& cursor );
+ void selectLine( const KateTextCursor& cursor );
+ void selectLength( const KateTextCursor& cursor, int length );
+
+ // this method will sync the KateViewInternal's sel{Start,End}Cached and selectAnchor
+ // with the current selection, to make it "stick" instead of reverting back to sel*Cached
+ void syncSelectionCache();
+
+ //
+ // KTextEditor::BlockSelectionInterface stuff
+ //
+ public slots:
+ bool blockSelectionMode ();
+ bool setBlockSelectionMode (bool on);
+ bool toggleBlockSelectionMode ();
+
+
+ //BEGIN EDIT STUFF
+ public:
+ void editStart ();
+ void editEnd (int editTagLineStart, int editTagLineEnd, bool tagFrom);
+
+ void editSetCursor (const KateTextCursor &cursor);
+ //END
+
+ //BEGIN TAG & CLEAR
+ public:
+ bool tagLine (const KateTextCursor& virtualCursor);
+
+ bool tagLines (int start, int end, bool realLines = false );
+ bool tagLines (KateTextCursor start, KateTextCursor end, bool realCursors = false);
+
+ void tagAll ();
+
+ void clear ();
+
+ void repaintText (bool paintOnlyDirty = false);
+
+ void updateView (bool changed = false);
+ //END
+
+ //
+ // Kate::View
+ //
+ public:
+ bool isOverwriteMode() const;
+ void setOverwriteMode( bool b );
+
+ QString currentTextLine()
+ { return getDoc()->textLine( cursorLine() ); }
+ QString currentWord()
+ { return m_doc->getWord( m_viewInternal->getCursor() ); }
+ void insertText( const QString& mark )
+ { getDoc()->insertText( cursorLine(), cursorColumnReal(), mark ); }
+ bool canDiscard();
+ int tabWidth() { return m_doc->config()->tabWidth(); }
+ void setTabWidth( int w ) { m_doc->config()->setTabWidth(w); }
+ void setEncoding( QString e ) { m_doc->setEncoding(e); }
+ bool isLastView() { return m_doc->isLastView(1); }
+
+ public slots:
+ void flush();
+ saveResult save();
+ saveResult saveAs();
+
+ void indent() { m_doc->indent( this, cursorLine(), 1 ); }
+ void unIndent() { m_doc->indent( this, cursorLine(), -1 ); }
+ void cleanIndent() { m_doc->indent( this, cursorLine(), 0 ); }
+ void align() { m_doc->align( this, cursorLine() ); }
+ void comment() { m_doc->comment( this, cursorLine(), cursorColumnReal(), 1 ); }
+ void uncomment() { m_doc->comment( this, cursorLine(), cursorColumnReal(),-1 ); }
+ void killLine() { m_doc->removeLine( cursorLine() ); }
+
+ /**
+ Uppercases selected text, or an alphabetic character next to the cursor.
+ */
+ void uppercase() { m_doc->transform( this, m_viewInternal->cursor, KateDocument::Uppercase ); }
+ /**
+ Lowercases selected text, or an alphabetic character next to the cursor.
+ */
+ void lowercase() { m_doc->transform( this, m_viewInternal->cursor, KateDocument::Lowercase ); }
+ /**
+ Capitalizes the selection (makes each word start with an uppercase) or
+ the word under the cursor.
+ */
+ void capitalize() { m_doc->transform( this, m_viewInternal->cursor, KateDocument::Capitalize ); }
+ /**
+ Joins lines touched by the selection
+ */
+ void joinLines();
+
+
+ void keyReturn() { m_viewInternal->doReturn(); }
+ void backspace() { m_viewInternal->doBackspace(); }
+ void deleteWordLeft() { m_viewInternal->doDeleteWordLeft(); }
+ void keyDelete() { m_viewInternal->doDelete(); }
+ void deleteWordRight() { m_viewInternal->doDeleteWordRight(); }
+ void transpose() { m_viewInternal->doTranspose(); }
+ void cursorLeft() { m_viewInternal->cursorLeft(); }
+ void shiftCursorLeft() { m_viewInternal->cursorLeft(true); }
+ void cursorRight() { m_viewInternal->cursorRight(); }
+ void shiftCursorRight() { m_viewInternal->cursorRight(true); }
+ void wordLeft() { m_viewInternal->wordLeft(); }
+ void shiftWordLeft() { m_viewInternal->wordLeft(true); }
+ void wordRight() { m_viewInternal->wordRight(); }
+ void shiftWordRight() { m_viewInternal->wordRight(true); }
+ void home() { m_viewInternal->home(); }
+ void shiftHome() { m_viewInternal->home(true); }
+ void end() { m_viewInternal->end(); }
+ void shiftEnd() { m_viewInternal->end(true); }
+ void up() { m_viewInternal->cursorUp(); }
+ void shiftUp() { m_viewInternal->cursorUp(true); }
+ void down() { m_viewInternal->cursorDown(); }
+ void shiftDown() { m_viewInternal->cursorDown(true); }
+ void scrollUp() { m_viewInternal->scrollUp(); }
+ void scrollDown() { m_viewInternal->scrollDown(); }
+ void topOfView() { m_viewInternal->topOfView(); }
+ void shiftTopOfView() { m_viewInternal->topOfView(true); }
+ void bottomOfView() { m_viewInternal->bottomOfView(); }
+ void shiftBottomOfView() { m_viewInternal->bottomOfView(true); }
+ void pageUp() { m_viewInternal->pageUp(); }
+ void shiftPageUp() { m_viewInternal->pageUp(true); }
+ void pageDown() { m_viewInternal->pageDown(); }
+ void shiftPageDown() { m_viewInternal->pageDown(true); }
+ void top() { m_viewInternal->top_home(); }
+ void shiftTop() { m_viewInternal->top_home(true); }
+ void bottom() { m_viewInternal->bottom_end(); }
+ void shiftBottom() { m_viewInternal->bottom_end(true); }
+ void toMatchingBracket() { m_viewInternal->cursorToMatchingBracket();}
+ void shiftToMatchingBracket() { m_viewInternal->cursorToMatchingBracket(true);}
+
+ void gotoLine();
+ void gotoLineNumber( int linenumber );
+
+ // config file / session management functions
+ public:
+ void readSessionConfig(KConfig *);
+ void writeSessionConfig(KConfig *);
+
+ public slots:
+ int getEol();
+ void setEol( int eol );
+ void find();
+ void find( const QString&, long, bool add=true ); ///< proxy for KateSearch
+ void replace();
+ void replace( const QString&, const QString &, long ); ///< proxy for KateSearch
+ /** Highly confusing but KateSearch::findAgain() is backwards too. */
+ void findAgain( bool back );
+ void findAgain() { findAgain( false ); }
+ void findPrev() { findAgain( true ); }
+
+ void setFoldingMarkersOn( bool enable ); // Not in Kate::View, but should be
+ void setIconBorder( bool enable );
+ void setLineNumbersOn( bool enable );
+ void setScrollBarMarks( bool enable );
+ void showCmdLine ( bool enable );
+ void toggleFoldingMarkers();
+ void toggleIconBorder();
+ void toggleLineNumbersOn();
+ void toggleScrollBarMarks();
+ void toggleDynWordWrap ();
+ void toggleCmdLine ();
+ void setDynWrapIndicators(int mode);
+
+ void applyWordWrap ();
+
+ public:
+ KateRenderer *renderer ();
+
+ bool iconBorder();
+ bool lineNumbersOn();
+ bool scrollBarMarks();
+ int dynWrapIndicators();
+ bool foldingMarkersOn();
+ Kate::Document* getDoc() { return m_doc; }
+
+ void setActive( bool b ) { m_active = b; }
+ bool isActive() { return m_active; }
+
+ public slots:
+ void gotoMark( KTextEditor::Mark* mark ) { setCursorPositionInternal ( mark->line, 0, 1 ); }
+ void slotSelectionChanged ();
+
+ signals:
+ void gotFocus( Kate::View* );
+ void lostFocus( Kate::View* );
+ void newStatus(); // Not in Kate::View, but should be (Kate app connects to it)
+
+ //
+ // Extras
+ //
+ public:
+ // Is it really necessary to have 3 methods for this?! :)
+ KateDocument* doc() const { return m_doc; }
+
+ KActionCollection* editActionCollection() const { return m_editActions; }
+
+ public slots:
+ void slotNewUndo();
+ void slotUpdate();
+ void toggleInsert();
+ void reloadFile();
+ void toggleWWMarker();
+ void toggleWriteLock();
+ void switchToCmdLine ();
+ void slotReadWriteChanged ();
+
+ signals:
+ void dropEventPass(QDropEvent*);
+ void viewStatusMsg (const QString &msg);
+
+ public:
+ bool setCursorPositionInternal( uint line, uint col, uint tabwidth = 1, bool calledExternally = false );
+
+ protected:
+ void contextMenuEvent( QContextMenuEvent* );
+ bool checkOverwrite( KURL );
+
+ public slots:
+ void slotSelectionTypeChanged();
+
+ private slots:
+ void slotGotFocus();
+ void slotLostFocus();
+ void slotDropEventPass( QDropEvent* ev );
+ void slotStatusMsg();
+ void slotSaveCanceled( const QString& error );
+ void slotExpandToplevel();
+ void slotCollapseLocal();
+ void slotExpandLocal();
+
+ private:
+ void setupConnections();
+ void setupActions();
+ void setupEditActions();
+ void setupCodeFolding();
+ void setupCodeCompletion();
+
+ KActionCollection* m_editActions;
+ KAction* m_editUndo;
+ KAction* m_editRedo;
+ KRecentFilesAction* m_fileRecent;
+ KToggleAction* m_toggleFoldingMarkers;
+ KToggleAction* m_toggleIconBar;
+ KToggleAction* m_toggleLineNumbers;
+ KToggleAction* m_toggleScrollBarMarks;
+ KToggleAction* m_toggleDynWrap;
+ KSelectAction* m_setDynWrapIndicators;
+ KToggleAction* m_toggleWWMarker;
+ KAction* m_switchCmdLine;
+
+ KSelectAction* m_setEndOfLine;
+
+ KAction *m_cut;
+ KAction *m_copy;
+ KAction *m_copyHTML;
+ KAction *m_paste;
+ KAction *m_selectAll;
+ KAction *m_deSelect;
+
+ KToggleAction *m_toggleBlockSelection;
+ KToggleAction *m_toggleInsert;
+ KToggleAction *m_toggleWriteLock;
+
+ KateDocument* m_doc;
+ KateViewInternal* m_viewInternal;
+ KateRenderer* m_renderer;
+ KateSearch* m_search;
+ KateSpell *m_spell;
+ KateBookmarks* m_bookmarks;
+ QGuardedPtr<QPopupMenu> m_rmbMenu;
+ KateCodeCompletion* m_codeCompletion;
+
+ KateCmdLine *m_cmdLine;
+ bool m_cmdLineOn;
+
+ QGridLayout *m_grid;
+
+ bool m_active;
+ bool m_hasWrap;
+
+ private slots:
+ void slotNeedTextHint(int line, int col, QString &text);
+ void slotHlChanged();
+
+ /**
+ * Configuration
+ */
+ public:
+ inline KateViewConfig *config () { return m_config; };
+
+ void updateConfig ();
+
+ void updateDocumentConfig();
+
+ void updateRendererConfig();
+
+ private slots:
+ void updateFoldingConfig ();
+
+ private:
+ KateViewConfig *m_config;
+ bool m_startingUp;
+ bool m_updatingDocumentConfig;
+
+ private:
+ // stores the current selection
+ KateSuperCursor selectStart;
+ KateSuperCursor selectEnd;
+
+ // do we select normal or blockwise ?
+ bool blockSelect;
+
+ /**
+ * IM input stuff
+ */
+ public:
+ void setIMSelectionValue( uint imStartLine, uint imStart, uint imEnd,
+ uint imSelStart, uint imSelEnd, bool m_imComposeEvent );
+ void getIMSelectionValue( uint *imStartLine, uint *imStart, uint *imEnd,
+ uint *imSelStart, uint *imSelEnd );
+ bool isIMSelection( int _line, int _column );
+ bool isIMEdit( int _line, int _column );
+ bool imComposeEvent () const { return m_imComposeEvent; }
+
+ private:
+ uint m_imStartLine;
+ uint m_imStart;
+ uint m_imEnd;
+ uint m_imSelStart;
+ uint m_imSelEnd;
+ bool m_imComposeEvent;
+};
+
+#endif
diff --git a/kate/part/kateviewhelpers.cpp b/kate/part/kateviewhelpers.cpp
new file mode 100644
index 000000000..4ca753486
--- /dev/null
+++ b/kate/part/kateviewhelpers.cpp
@@ -0,0 +1,1205 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2002 John Firebaugh <jfirebaugh@kde.org>
+ Copyright (C) 2001 Anders Lund <anders@alweb.dk>
+ Copyright (C) 2001 Christoph Cullmann <cullmann@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "kateviewhelpers.h"
+#include "kateviewhelpers.moc"
+
+#include "../interfaces/document.h"
+#include "../interfaces/katecmd.h"
+#include "kateattribute.h"
+#include "katecodefoldinghelpers.h"
+#include "kateconfig.h"
+#include "katedocument.h"
+#include "katefactory.h"
+#include "katerenderer.h"
+#include "kateview.h"
+#include "kateviewinternal.h"
+
+#include <kapplication.h>
+#include <kglobalsettings.h>
+#include <klocale.h>
+#include <knotifyclient.h>
+#include <kglobal.h>
+#include <kcharsets.h>
+#include <kpopupmenu.h>
+
+#include <qcursor.h>
+#include <qpainter.h>
+#include <qpopupmenu.h>
+#include <qstyle.h>
+#include <qtimer.h>
+#include <qwhatsthis.h>
+#include <qregexp.h>
+#include <qtextcodec.h>
+
+#include <math.h>
+
+#include <kdebug.h>
+
+//BEGIN KateScrollBar
+KateScrollBar::KateScrollBar (Orientation orientation, KateViewInternal* parent, const char* name)
+ : QScrollBar (orientation, parent->m_view, name)
+ , m_middleMouseDown (false)
+ , m_view(parent->m_view)
+ , m_doc(parent->m_doc)
+ , m_viewInternal(parent)
+ , m_topMargin(-1)
+ , m_bottomMargin(-1)
+ , m_savVisibleLines(0)
+ , m_showMarks(false)
+{
+ connect(this, SIGNAL(valueChanged(int)), SLOT(sliderMaybeMoved(int)));
+ connect(m_doc, SIGNAL(marksChanged()), this, SLOT(marksChanged()));
+
+ m_lines.setAutoDelete(true);
+}
+
+void KateScrollBar::mousePressEvent(QMouseEvent* e)
+{
+ if (e->button() == MidButton)
+ m_middleMouseDown = true;
+
+ QScrollBar::mousePressEvent(e);
+
+ redrawMarks();
+}
+
+void KateScrollBar::mouseReleaseEvent(QMouseEvent* e)
+{
+ QScrollBar::mouseReleaseEvent(e);
+
+ m_middleMouseDown = false;
+
+ redrawMarks();
+}
+
+void KateScrollBar::mouseMoveEvent(QMouseEvent* e)
+{
+ QScrollBar::mouseMoveEvent(e);
+
+ if (e->state() | LeftButton)
+ redrawMarks();
+}
+
+void KateScrollBar::paintEvent(QPaintEvent *e)
+{
+ QScrollBar::paintEvent(e);
+ redrawMarks();
+}
+
+void KateScrollBar::resizeEvent(QResizeEvent *e)
+{
+ QScrollBar::resizeEvent(e);
+ recomputeMarksPositions();
+}
+
+void KateScrollBar::styleChange(QStyle &s)
+{
+ QScrollBar::styleChange(s);
+ m_topMargin = -1;
+ recomputeMarksPositions();
+}
+
+void KateScrollBar::valueChange()
+{
+ QScrollBar::valueChange();
+ redrawMarks();
+}
+
+void KateScrollBar::rangeChange()
+{
+ QScrollBar::rangeChange();
+ recomputeMarksPositions();
+}
+
+void KateScrollBar::marksChanged()
+{
+ recomputeMarksPositions(true);
+}
+
+void KateScrollBar::redrawMarks()
+{
+ if (!m_showMarks)
+ return;
+
+ QPainter painter(this);
+ QRect rect = sliderRect();
+ for (QIntDictIterator<QColor> it(m_lines); it.current(); ++it)
+ {
+ if (it.currentKey() < rect.top() || it.currentKey() > rect.bottom())
+ {
+ painter.setPen(*it.current());
+ painter.drawLine(0, it.currentKey(), width(), it.currentKey());
+ }
+ }
+}
+
+void KateScrollBar::recomputeMarksPositions(bool forceFullUpdate)
+{
+ if (m_topMargin == -1)
+ watchScrollBarSize();
+
+ m_lines.clear();
+ m_savVisibleLines = m_doc->visibleLines();
+
+ int realHeight = frameGeometry().height() - m_topMargin - m_bottomMargin;
+
+ QPtrList<KTextEditor::Mark> marks = m_doc->marks();
+ KateCodeFoldingTree *tree = m_doc->foldingTree();
+
+ for (KTextEditor::Mark *mark = marks.first(); mark; mark = marks.next())
+ {
+ uint line = mark->line;
+
+ if (tree)
+ {
+ KateCodeFoldingNode *node = tree->findNodeForLine(line);
+
+ while (node)
+ {
+ if (!node->isVisible())
+ line = tree->getStartLine(node);
+ node = node->getParentNode();
+ }
+ }
+
+ line = m_doc->getVirtualLine(line);
+
+ double d = (double)line / (m_savVisibleLines - 1);
+ m_lines.insert(m_topMargin + (int)(d * realHeight),
+ new QColor(KateRendererConfig::global()->lineMarkerColor((KTextEditor::MarkInterface::MarkTypes)mark->type)));
+ }
+
+ if (forceFullUpdate)
+ update();
+ else
+ redrawMarks();
+}
+
+void KateScrollBar::watchScrollBarSize()
+{
+ int savMax = maxValue();
+ setMaxValue(0);
+ QRect rect = sliderRect();
+ setMaxValue(savMax);
+
+ m_topMargin = rect.top();
+ m_bottomMargin = frameGeometry().height() - rect.bottom();
+}
+
+void KateScrollBar::sliderMaybeMoved(int value)
+{
+ if (m_middleMouseDown)
+ emit sliderMMBMoved(value);
+}
+//END
+
+//BEGIN KateCmdLnWhatsThis
+class KateCmdLnWhatsThis : public QWhatsThis
+{
+ public:
+ KateCmdLnWhatsThis( KateCmdLine *parent )
+ : QWhatsThis( parent )
+ , m_parent( parent ) {;}
+
+ QString text( const QPoint & )
+ {
+ QString beg = "<qt background=\"white\"><div><table width=\"100%\"><tr><td bgcolor=\"brown\"><font color=\"white\"><b>Help: <big>";
+ QString mid = "</big></b></font></td></tr><tr><td>";
+ QString end = "</td></tr></table></div><qt>";
+
+ QString t = m_parent->text();
+ QRegExp re( "\\s*help\\s+(.*)" );
+ if ( re.search( t ) > -1 )
+ {
+ QString s;
+ // get help for command
+ QString name = re.cap( 1 );
+ if ( name == "list" )
+ {
+ return beg + i18n("Available Commands") + mid
+ + KateCmd::self()->cmds().join(" ")
+ + i18n("<p>For help on individual commands, do <code>'help &lt;command&gt;'</code></p>")
+ + end;
+ }
+ else if ( ! name.isEmpty() )
+ {
+ Kate::Command *cmd = KateCmd::self()->queryCommand( name );
+ if ( cmd )
+ {
+ if ( cmd->help( (Kate::View*)m_parent->parentWidget(), name, s ) )
+ return beg + name + mid + s + end;
+ else
+ return beg + name + mid + i18n("No help for '%1'").arg( name ) + end;
+ }
+ else
+ return beg + mid + i18n("No such command <b>%1</b>").arg(name) + end;
+ }
+ }
+
+ return beg + mid + i18n(
+ "<p>This is the Katepart <b>command line</b>.<br>"
+ "Syntax: <code><b>command [ arguments ]</b></code><br>"
+ "For a list of available commands, enter <code><b>help list</b></code><br>"
+ "For help for individual commands, enter <code><b>help &lt;command&gt;</b></code></p>")
+ + end;
+ }
+
+ private:
+ KateCmdLine *m_parent;
+};
+//END KateCmdLnWhatsThis
+
+//BEGIN KateCmdLineFlagCompletion
+/**
+ * This class provide completion of flags. It shows a short description of
+ * each flag, and flags are appended.
+ */
+class KateCmdLineFlagCompletion : public KCompletion
+{
+ public:
+ KateCmdLineFlagCompletion() {;}
+
+ QString makeCompletion( const QString & string )
+ {
+ return QString::null;
+ }
+
+};
+//END KateCmdLineFlagCompletion
+
+//BEGIN KateCmdLine
+KateCmdLine::KateCmdLine (KateView *view)
+ : KLineEdit (view)
+ , m_view (view)
+ , m_msgMode (false)
+ , m_histpos( 0 )
+ , m_cmdend( 0 )
+ , m_command( 0L )
+ , m_oldCompletionObject( 0L )
+{
+ connect (this, SIGNAL(returnPressed(const QString &)),
+ this, SLOT(slotReturnPressed(const QString &)));
+
+ completionObject()->insertItems (KateCmd::self()->cmds());
+ setAutoDeleteCompletionObject( false );
+ m_help = new KateCmdLnWhatsThis( this );
+}
+
+void KateCmdLine::slotReturnPressed ( const QString& text )
+{
+
+ // silently ignore leading space
+ uint n = 0;
+ while( text[n].isSpace() )
+ n++;
+
+ QString cmd = text.mid( n );
+
+ // Built in help: if the command starts with "help", [try to] show some help
+ if ( cmd.startsWith( "help" ) )
+ {
+ m_help->display( m_help->text( QPoint() ), mapToGlobal(QPoint(0,0)) );
+ clear();
+ KateCmd::self()->appendHistory( cmd );
+ m_histpos = KateCmd::self()->historyLength();
+ m_oldText = QString ();
+ return;
+ }
+
+ if (cmd.length () > 0)
+ {
+ Kate::Command *p = KateCmd::self()->queryCommand (cmd);
+
+ m_oldText = cmd;
+ m_msgMode = true;
+
+ if (p)
+ {
+ QString msg;
+
+ if (p->exec (m_view, cmd, msg))
+ {
+ KateCmd::self()->appendHistory( cmd );
+ m_histpos = KateCmd::self()->historyLength();
+ m_oldText = QString ();
+
+ if (msg.length() > 0)
+ setText (i18n ("Success: ") + msg);
+ else
+ setText (i18n ("Success"));
+ }
+ else
+ {
+ if (msg.length() > 0)
+ setText (i18n ("Error: ") + msg);
+ else
+ setText (i18n ("Command \"%1\" failed.").arg (cmd));
+ KNotifyClient::beep();
+ }
+ }
+ else
+ {
+ setText (i18n ("No such command: \"%1\"").arg (cmd));
+ KNotifyClient::beep();
+ }
+ }
+
+ // clean up
+ if ( m_oldCompletionObject )
+ {
+ KCompletion *c = completionObject();
+ setCompletionObject( m_oldCompletionObject );
+ m_oldCompletionObject = 0;
+ delete c;
+ c = 0;
+ }
+ m_command = 0;
+ m_cmdend = 0;
+
+ m_view->setFocus ();
+ QTimer::singleShot( 4000, this, SLOT(hideMe()) );
+}
+
+void KateCmdLine::hideMe () // unless i have focus ;)
+{
+ if ( isVisibleTo(parentWidget()) && ! hasFocus() ) {
+ m_view->toggleCmdLine ();
+ }
+}
+
+void KateCmdLine::focusInEvent ( QFocusEvent *ev )
+{
+ if (m_msgMode)
+ {
+ m_msgMode = false;
+ setText (m_oldText);
+ selectAll();
+ }
+
+ KLineEdit::focusInEvent (ev);
+}
+
+void KateCmdLine::keyPressEvent( QKeyEvent *ev )
+{
+ if (ev->key() == Key_Escape)
+ {
+ m_view->setFocus ();
+ hideMe();
+ }
+ else if ( ev->key() == Key_Up )
+ fromHistory( true );
+ else if ( ev->key() == Key_Down )
+ fromHistory( false );
+
+ uint cursorpos = cursorPosition();
+ KLineEdit::keyPressEvent (ev);
+
+ // during typing, let us see if we have a valid command
+ if ( ! m_cmdend || cursorpos <= m_cmdend )
+ {
+ QChar c;
+ if ( ! ev->text().isEmpty() )
+ c = ev->text()[0];
+
+ if ( ! m_cmdend && ! c.isNull() ) // we have no command, so lets see if we got one
+ {
+ if ( ! c.isLetterOrNumber() && c != '-' && c != '_' )
+ {
+ m_command = KateCmd::self()->queryCommand( text().stripWhiteSpace() );
+ if ( m_command )
+ {
+ //kdDebug(13025)<<"keypress in commandline: We have a command! "<<m_command<<". text is '"<<text()<<"'"<<endl;
+ // if the typed character is ":",
+ // we try if the command has flag completions
+ m_cmdend = cursorpos;
+ //kdDebug(13025)<<"keypress in commandline: Set m_cmdend to "<<m_cmdend<<endl;
+ }
+ else
+ m_cmdend = 0;
+ }
+ }
+ else // since cursor is inside the command name, we reconsider it
+ {
+ kdDebug(13025)<<"keypress in commandline: \\W -- text is "<<text()<<endl;
+ m_command = KateCmd::self()->queryCommand( text().stripWhiteSpace() );
+ if ( m_command )
+ {
+ //kdDebug(13025)<<"keypress in commandline: We have a command! "<<m_command<<endl;
+ QString t = text();
+ m_cmdend = 0;
+ bool b = false;
+ for ( ; m_cmdend < t.length(); m_cmdend++ )
+ {
+ if ( t[m_cmdend].isLetter() )
+ b = true;
+ if ( b && ( ! t[m_cmdend].isLetterOrNumber() && t[m_cmdend] != '-' && t[m_cmdend] != '_' ) )
+ break;
+ }
+
+ if ( c == ':' && cursorpos == m_cmdend )
+ {
+ // check if this command wants to complete flags
+ //kdDebug(13025)<<"keypress in commandline: Checking if flag completion is desired!"<<endl;
+ }
+ }
+ else
+ {
+ // clean up if needed
+ if ( m_oldCompletionObject )
+ {
+ KCompletion *c = completionObject();
+ setCompletionObject( m_oldCompletionObject );
+ m_oldCompletionObject = 0;
+ delete c;
+ c = 0;
+ }
+
+ m_cmdend = 0;
+ }
+ }
+
+ // if we got a command, check if it wants to do semething.
+ if ( m_command )
+ {
+ //kdDebug(13025)<<"Checking for CommandExtension.."<<endl;
+ Kate::CommandExtension *ce = dynamic_cast<Kate::CommandExtension*>(m_command);
+ if ( ce )
+ {
+ KCompletion *cmpl = ce->completionObject( text().left( m_cmdend ).stripWhiteSpace(), m_view );
+ if ( cmpl )
+ {
+ // save the old completion object and use what the command provides
+ // instead. We also need to prepend the current command name + flag string
+ // when completion is done
+ //kdDebug(13025)<<"keypress in commandline: Setting completion object!"<<endl;
+ if ( ! m_oldCompletionObject )
+ m_oldCompletionObject = completionObject();
+
+ setCompletionObject( cmpl );
+ }
+ }
+ }
+ }
+ else if ( m_command )// check if we should call the commands processText()
+ {
+ Kate::CommandExtension *ce = dynamic_cast<Kate::CommandExtension*>( m_command );
+ if ( ce && ce->wantsToProcessText( text().left( m_cmdend ).stripWhiteSpace() )
+ && ! ( ev->text().isNull() || ev->text().isEmpty() ) )
+ ce->processText( m_view, text() );
+ }
+}
+
+void KateCmdLine::fromHistory( bool up )
+{
+ if ( ! KateCmd::self()->historyLength() )
+ return;
+
+ QString s;
+
+ if ( up )
+ {
+ if ( m_histpos > 0 )
+ {
+ m_histpos--;
+ s = KateCmd::self()->fromHistory( m_histpos );
+ }
+ }
+ else
+ {
+ if ( m_histpos < ( KateCmd::self()->historyLength() - 1 ) )
+ {
+ m_histpos++;
+ s = KateCmd::self()->fromHistory( m_histpos );
+ }
+ else
+ {
+ m_histpos = KateCmd::self()->historyLength();
+ setText( m_oldText );
+ }
+ }
+ if ( ! s.isEmpty() )
+ {
+ // Select the argument part of the command, so that it is easy to overwrite
+ setText( s );
+ static QRegExp reCmd = QRegExp(".*[\\w\\-]+(?:[^a-zA-Z0-9_-]|:\\w+)(.*)");
+ if ( reCmd.search( text() ) == 0 )
+ setSelection( text().length() - reCmd.cap(1).length(), reCmd.cap(1).length() );
+ }
+}
+//END KateCmdLine
+
+//BEGIN KateIconBorder
+using namespace KTextEditor;
+
+static const char* const plus_xpm[] = {
+"11 11 3 1",
+" c None",
+". c #000000",
+"+ c #FFFFFF",
+"...........",
+".+++++++++.",
+".+++++++++.",
+".++++.++++.",
+".++++.++++.",
+".++.....++.",
+".++++.++++.",
+".++++.++++.",
+".+++++++++.",
+".+++++++++.",
+"..........."};
+
+static const char* const minus_xpm[] = {
+"11 11 3 1",
+" c None",
+". c #000000",
+"+ c #FFFFFF",
+"...........",
+".+++++++++.",
+".+++++++++.",
+".+++++++++.",
+".+++++++++.",
+".++.....++.",
+".+++++++++.",
+".+++++++++.",
+".+++++++++.",
+".+++++++++.",
+"..........."};
+
+static const char * const bookmark_xpm[] = {
+"14 13 82 1",
+" c None",
+". c #F27D01",
+"+ c #EF7901",
+"@ c #F3940F",
+"# c #EE8F12",
+"$ c #F9C834",
+"% c #F5C33A",
+"& c #F09110",
+"* c #FCEE3E",
+"= c #FBEB3F",
+"- c #E68614",
+"; c #FA8700",
+"> c #F78703",
+", c #F4920E",
+"' c #F19113",
+") c #F6C434",
+"! c #FDF938",
+"~ c #FDF839",
+"{ c #F1BC3A",
+"] c #E18017",
+"^ c #DA7210",
+"/ c #D5680B",
+"( c #CA5404",
+"_ c #FD8F06",
+": c #FCB62D",
+"< c #FDE049",
+"[ c #FCE340",
+"} c #FBE334",
+"| c #FDF035",
+"1 c #FEF834",
+"2 c #FCEF36",
+"3 c #F8DF32",
+"4 c #F7DC3D",
+"5 c #F5CE3E",
+"6 c #DE861B",
+"7 c #C64C03",
+"8 c #F78C07",
+"9 c #F8B019",
+"0 c #FDE12D",
+"a c #FEE528",
+"b c #FEE229",
+"c c #FBD029",
+"d c #E18814",
+"e c #CB5605",
+"f c #EF8306",
+"g c #F3A00E",
+"h c #FBC718",
+"i c #FED31C",
+"j c #FED11D",
+"k c #F8B91C",
+"l c #E07D0D",
+"m c #CB5301",
+"n c #ED8A0E",
+"o c #F7A90D",
+"p c #FEC113",
+"q c #FEC013",
+"r c #F09B0E",
+"s c #D35E03",
+"t c #EF9213",
+"u c #F9A208",
+"v c #FEAA0C",
+"w c #FCA10B",
+"x c #FCA70B",
+"y c #FEAF0B",
+"z c #F39609",
+"A c #D86203",
+"B c #F08C0D",
+"C c #FA9004",
+"D c #F17F04",
+"E c #E36D04",
+"F c #E16F03",
+"G c #EE8304",
+"H c #F88C04",
+"I c #DC6202",
+"J c #E87204",
+"K c #E66A01",
+"L c #DC6001",
+"M c #D15601",
+"N c #DA5D01",
+"O c #D25200",
+"P c #DA5F00",
+"Q c #BC3C00",
+" .+ ",
+" @# ",
+" $% ",
+" &*=- ",
+" ;>,')!~{]^/( ",
+"_:<[}|11234567",
+" 890aaaaabcde ",
+" fghiiijklm ",
+" nopqpqrs ",
+" tuvwxyzA ",
+" BCDEFGHI ",
+" JKL MNO ",
+" P Q "};
+
+const int iconPaneWidth = 16;
+const int halfIPW = 8;
+
+KateIconBorder::KateIconBorder ( KateViewInternal* internalView, QWidget *parent )
+ : QWidget(parent, "", Qt::WStaticContents | Qt::WRepaintNoErase | Qt::WResizeNoErase )
+ , m_view( internalView->m_view )
+ , m_doc( internalView->m_doc )
+ , m_viewInternal( internalView )
+ , m_iconBorderOn( false )
+ , m_lineNumbersOn( false )
+ , m_foldingMarkersOn( false )
+ , m_dynWrapIndicatorsOn( false )
+ , m_dynWrapIndicators( 0 )
+ , m_cachedLNWidth( 0 )
+ , m_maxCharWidth( 0 )
+{
+ setSizePolicy( QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Minimum ) );
+
+ setBackgroundMode( NoBackground );
+
+ m_doc->setDescription( MarkInterface::markType01, i18n("Bookmark") );
+ m_doc->setPixmap( MarkInterface::markType01, QPixmap((const char**)bookmark_xpm) );
+
+ updateFont();
+}
+
+void KateIconBorder::setIconBorderOn( bool enable )
+{
+ if( enable == m_iconBorderOn )
+ return;
+
+ m_iconBorderOn = enable;
+
+ updateGeometry();
+
+ QTimer::singleShot( 0, this, SLOT(update()) );
+}
+
+void KateIconBorder::setLineNumbersOn( bool enable )
+{
+ if( enable == m_lineNumbersOn )
+ return;
+
+ m_lineNumbersOn = enable;
+ m_dynWrapIndicatorsOn = (m_dynWrapIndicators == 1) ? enable : m_dynWrapIndicators;
+
+ updateGeometry();
+
+ QTimer::singleShot( 0, this, SLOT(update()) );
+}
+
+void KateIconBorder::setDynWrapIndicators( int state )
+{
+ if (state == m_dynWrapIndicators )
+ return;
+
+ m_dynWrapIndicators = state;
+ m_dynWrapIndicatorsOn = (state == 1) ? m_lineNumbersOn : state;
+
+ updateGeometry ();
+
+ QTimer::singleShot( 0, this, SLOT(update()) );
+}
+
+void KateIconBorder::setFoldingMarkersOn( bool enable )
+{
+ if( enable == m_foldingMarkersOn )
+ return;
+
+ m_foldingMarkersOn = enable;
+
+ updateGeometry();
+
+ QTimer::singleShot( 0, this, SLOT(update()) );
+}
+
+QSize KateIconBorder::sizeHint() const
+{
+ int w = 0;
+
+ if (m_iconBorderOn)
+ w += iconPaneWidth + 1;
+
+ if (m_lineNumbersOn || (m_view->dynWordWrap() && m_dynWrapIndicatorsOn)) {
+ w += lineNumberWidth();
+ }
+
+ if (m_foldingMarkersOn)
+ w += iconPaneWidth;
+
+ w += 4;
+
+ return QSize( w, 0 );
+}
+
+// This function (re)calculates the maximum width of any of the digit characters (0 -> 9)
+// for graceful handling of variable-width fonts as the linenumber font.
+void KateIconBorder::updateFont()
+{
+ const QFontMetrics *fm = m_view->renderer()->config()->fontMetrics();
+ m_maxCharWidth = 0;
+ // Loop to determine the widest numeric character in the current font.
+ // 48 is ascii '0'
+ for (int i = 48; i < 58; i++) {
+ int charWidth = fm->width( QChar(i) );
+ m_maxCharWidth = kMax(m_maxCharWidth, charWidth);
+ }
+}
+
+int KateIconBorder::lineNumberWidth() const
+{
+ int width = m_lineNumbersOn ? ((int)log10((double)(m_view->doc()->numLines())) + 1) * m_maxCharWidth + 4 : 0;
+
+ if (m_view->dynWordWrap() && m_dynWrapIndicatorsOn) {
+ width = kMax(style().scrollBarExtent().width() + 4, width);
+
+ if (m_cachedLNWidth != width || m_oldBackgroundColor != m_view->renderer()->config()->iconBarColor()) {
+ int w = style().scrollBarExtent().width();
+ int h = m_view->renderer()->config()->fontMetrics()->height();
+
+ QSize newSize(w, h);
+ if ((m_arrow.size() != newSize || m_oldBackgroundColor != m_view->renderer()->config()->iconBarColor()) && !newSize.isEmpty()) {
+ m_arrow.resize(newSize);
+
+ QPainter p(&m_arrow);
+ p.fillRect( 0, 0, w, h, m_view->renderer()->config()->iconBarColor() );
+
+ h = m_view->renderer()->config()->fontMetrics()->ascent();
+
+ p.setPen(m_view->renderer()->attribute(0)->textColor());
+ p.drawLine(w/2, h/2, w/2, 0);
+#if 1
+ p.lineTo(w/4, h/4);
+ p.lineTo(0, 0);
+ p.lineTo(0, h/2);
+ p.lineTo(w/2, h-1);
+ p.lineTo(w*3/4, h-1);
+ p.lineTo(w-1, h*3/4);
+ p.lineTo(w*3/4, h/2);
+ p.lineTo(0, h/2);
+#else
+ p.lineTo(w*3/4, h/4);
+ p.lineTo(w-1,0);
+ p.lineTo(w-1, h/2);
+ p.lineTo(w/2, h-1);
+ p.lineTo(w/4,h-1);
+ p.lineTo(0, h*3/4);
+ p.lineTo(w/4, h/2);
+ p.lineTo(w-1, h/2);
+#endif
+ }
+ }
+ }
+
+ return width;
+}
+
+void KateIconBorder::paintEvent(QPaintEvent* e)
+{
+ paintBorder(e->rect().x(), e->rect().y(), e->rect().width(), e->rect().height());
+}
+
+void KateIconBorder::paintBorder (int /*x*/, int y, int /*width*/, int height)
+{
+ static QPixmap minus_px ((const char**)minus_xpm);
+ static QPixmap plus_px ((const char**)plus_xpm);
+
+ uint h = m_view->renderer()->config()->fontStruct()->fontHeight;
+ uint startz = (y / h);
+ uint endz = startz + 1 + (height / h);
+ uint lineRangesSize = m_viewInternal->lineRanges.size();
+
+ // center the folding boxes
+ int m_px = (h - 11) / 2;
+ if (m_px < 0)
+ m_px = 0;
+
+ int lnWidth( 0 );
+ if ( m_lineNumbersOn || (m_view->dynWordWrap() && m_dynWrapIndicatorsOn) ) // avoid calculating unless needed ;-)
+ {
+ lnWidth = lineNumberWidth();
+ if ( lnWidth != m_cachedLNWidth || m_oldBackgroundColor != m_view->renderer()->config()->iconBarColor() )
+ {
+ // we went from n0 ->n9 lines or vice verca
+ // this causes an extra updateGeometry() first time the line numbers
+ // are displayed, but sizeHint() is supposed to be const so we can't set
+ // the cached value there.
+ m_cachedLNWidth = lnWidth;
+ m_oldBackgroundColor = m_view->renderer()->config()->iconBarColor();
+ updateGeometry();
+ update ();
+ return;
+ }
+ }
+
+ int w( this->width() ); // sane value/calc only once
+
+ QPainter p ( this );
+ p.setFont ( *m_view->renderer()->config()->font() ); // for line numbers
+ // the line number color is for the line numbers, vertical separator lines
+ // and for for the code folding lines.
+ p.setPen ( m_view->renderer()->config()->lineNumberColor() );
+
+ KateLineInfo oldInfo;
+ if (startz < lineRangesSize)
+ {
+ if ((m_viewInternal->lineRanges[startz].line-1) < 0)
+ oldInfo.topLevel = true;
+ else
+ m_doc->lineInfo(&oldInfo,m_viewInternal->lineRanges[startz].line-1);
+ }
+
+ for (uint z=startz; z <= endz; z++)
+ {
+ int y = h * z;
+ int realLine = -1;
+
+ if (z < lineRangesSize)
+ realLine = m_viewInternal->lineRanges[z].line;
+
+ int lnX ( 0 );
+
+ p.fillRect( 0, y, w-4, h, m_view->renderer()->config()->iconBarColor() );
+ p.fillRect( w-4, y, 4, h, m_view->renderer()->config()->backgroundColor() );
+
+ // icon pane
+ if( m_iconBorderOn )
+ {
+ p.drawLine(lnX+iconPaneWidth, y, lnX+iconPaneWidth, y+h);
+
+ if( (realLine > -1) && (m_viewInternal->lineRanges[z].startCol == 0) )
+ {
+ uint mrk ( m_doc->mark( realLine ) ); // call only once
+
+ if ( mrk )
+ {
+ for( uint bit = 0; bit < 32; bit++ )
+ {
+ MarkInterface::MarkTypes markType = (MarkInterface::MarkTypes)(1<<bit);
+ if( mrk & markType )
+ {
+ QPixmap *px_mark (m_doc->markPixmap( markType ));
+
+ if (px_mark)
+ {
+ // center the mark pixmap
+ int x_px = (iconPaneWidth - px_mark->width()) / 2;
+ if (x_px < 0)
+ x_px = 0;
+
+ int y_px = (h - px_mark->height()) / 2;
+ if (y_px < 0)
+ y_px = 0;
+
+ p.drawPixmap( lnX+x_px, y+y_px, *px_mark);
+ }
+ }
+ }
+ }
+ }
+
+ lnX += iconPaneWidth + 1;
+ }
+
+ // line number
+ if( m_lineNumbersOn || (m_view->dynWordWrap() && m_dynWrapIndicatorsOn) )
+ {
+ lnX +=2;
+
+ if (realLine > -1)
+ if (m_viewInternal->lineRanges[z].startCol == 0) {
+ if (m_lineNumbersOn)
+ p.drawText( lnX + 1, y, lnWidth-4, h, Qt::AlignRight|Qt::AlignVCenter, QString("%1").arg( realLine + 1 ) );
+ } else if (m_view->dynWordWrap() && m_dynWrapIndicatorsOn) {
+ p.drawPixmap(lnX + lnWidth - m_arrow.width() - 4, y, m_arrow);
+ }
+
+ lnX += lnWidth;
+ }
+
+ // folding markers
+ if( m_foldingMarkersOn )
+ {
+ if( realLine > -1 )
+ {
+ KateLineInfo info;
+ m_doc->lineInfo(&info,realLine);
+
+ if (!info.topLevel)
+ {
+ if (info.startsVisibleBlock && (m_viewInternal->lineRanges[z].startCol == 0))
+ {
+ if (oldInfo.topLevel)
+ p.drawLine(lnX+halfIPW,y+m_px,lnX+halfIPW,y+h-1);
+ else
+ p.drawLine(lnX+halfIPW,y,lnX+halfIPW,y+h-1);
+
+ p.drawPixmap(lnX+3,y+m_px,minus_px);
+ }
+ else if (info.startsInVisibleBlock)
+ {
+ if (m_viewInternal->lineRanges[z].startCol == 0)
+ {
+ if (oldInfo.topLevel)
+ p.drawLine(lnX+halfIPW,y+m_px,lnX+halfIPW,y+h-1);
+ else
+ p.drawLine(lnX+halfIPW,y,lnX+halfIPW,y+h-1);
+
+ p.drawPixmap(lnX+3,y+m_px,plus_px);
+ }
+ else
+ {
+ p.drawLine(lnX+halfIPW,y,lnX+halfIPW,y+h-1);
+ }
+
+ if (!m_viewInternal->lineRanges[z].wrap)
+ p.drawLine(lnX+halfIPW,y+h-1,lnX+iconPaneWidth-2,y+h-1);
+ }
+ else
+ {
+ p.drawLine(lnX+halfIPW,y,lnX+halfIPW,y+h-1);
+
+ if (info.endsBlock && !m_viewInternal->lineRanges[z].wrap)
+ p.drawLine(lnX+halfIPW,y+h-1,lnX+iconPaneWidth-2,y+h-1);
+ }
+ }
+
+ oldInfo = info;
+ }
+
+ lnX += iconPaneWidth;
+ }
+ }
+}
+
+KateIconBorder::BorderArea KateIconBorder::positionToArea( const QPoint& p ) const
+{
+ int x = 0;
+ if( m_iconBorderOn ) {
+ x += iconPaneWidth;
+ if( p.x() <= x )
+ return IconBorder;
+ }
+ if( m_lineNumbersOn || m_dynWrapIndicators ) {
+ x += lineNumberWidth();
+ if( p.x() <= x )
+ return LineNumbers;
+ }
+ if( m_foldingMarkersOn ) {
+ x += iconPaneWidth;
+ if( p.x() <= x )
+ return FoldingMarkers;
+ }
+ return None;
+}
+
+void KateIconBorder::mousePressEvent( QMouseEvent* e )
+{
+ m_lastClickedLine = m_viewInternal->yToKateLineRange(e->y()).line;
+
+ if ( positionToArea( e->pos() ) != IconBorder )
+ {
+ QMouseEvent forward( QEvent::MouseButtonPress,
+ QPoint( 0, e->y() ), e->button(), e->state() );
+ m_viewInternal->mousePressEvent( &forward );
+ }
+ e->accept();
+}
+
+void KateIconBorder::mouseMoveEvent( QMouseEvent* e )
+{
+ if ( positionToArea( e->pos() ) != IconBorder )
+ {
+ QMouseEvent forward( QEvent::MouseMove,
+ QPoint( 0, e->y() ), e->button(), e->state() );
+ m_viewInternal->mouseMoveEvent( &forward );
+ }
+}
+
+void KateIconBorder::mouseReleaseEvent( QMouseEvent* e )
+{
+ uint cursorOnLine = m_viewInternal->yToKateLineRange(e->y()).line;
+
+ if (cursorOnLine == m_lastClickedLine &&
+ cursorOnLine <= m_doc->lastLine() )
+ {
+ BorderArea area = positionToArea( e->pos() );
+ if( area == IconBorder) {
+ if (e->button() == LeftButton) {
+ if( m_doc->editableMarks() & KateViewConfig::global()->defaultMarkType() ) {
+ if( m_doc->mark( cursorOnLine ) & KateViewConfig::global()->defaultMarkType() )
+ m_doc->removeMark( cursorOnLine, KateViewConfig::global()->defaultMarkType() );
+ else
+ m_doc->addMark( cursorOnLine, KateViewConfig::global()->defaultMarkType() );
+ } else {
+ showMarkMenu( cursorOnLine, QCursor::pos() );
+ }
+ }
+ else
+ if (e->button() == RightButton) {
+ showMarkMenu( cursorOnLine, QCursor::pos() );
+ }
+ }
+
+ if ( area == FoldingMarkers) {
+ KateLineInfo info;
+ m_doc->lineInfo(&info,cursorOnLine);
+ if ((info.startsVisibleBlock) || (info.startsInVisibleBlock)) {
+ emit toggleRegionVisibility(cursorOnLine);
+ }
+ }
+ }
+
+ QMouseEvent forward( QEvent::MouseButtonRelease,
+ QPoint( 0, e->y() ), e->button(), e->state() );
+ m_viewInternal->mouseReleaseEvent( &forward );
+}
+
+void KateIconBorder::mouseDoubleClickEvent( QMouseEvent* e )
+{
+ QMouseEvent forward( QEvent::MouseButtonDblClick,
+ QPoint( 0, e->y() ), e->button(), e->state() );
+ m_viewInternal->mouseDoubleClickEvent( &forward );
+}
+
+void KateIconBorder::showMarkMenu( uint line, const QPoint& pos )
+{
+ QPopupMenu markMenu;
+ QPopupMenu selectDefaultMark;
+
+ typedef QValueVector<int> MarkTypeVector;
+ MarkTypeVector vec( 33 );
+ int i=1;
+
+ for( uint bit = 0; bit < 32; bit++ ) {
+ MarkInterface::MarkTypes markType = (MarkInterface::MarkTypes)(1<<bit);
+ if( !(m_doc->editableMarks() & markType) )
+ continue;
+
+ if( !m_doc->markDescription( markType ).isEmpty() ) {
+ markMenu.insertItem( m_doc->markDescription( markType ), i );
+ selectDefaultMark.insertItem( m_doc->markDescription( markType ), i+100);
+ } else {
+ markMenu.insertItem( i18n("Mark Type %1").arg( bit + 1 ), i );
+ selectDefaultMark.insertItem( i18n("Mark Type %1").arg( bit + 1 ), i+100);
+ }
+
+ if( m_doc->mark( line ) & markType )
+ markMenu.setItemChecked( i, true );
+
+ if( markType & KateViewConfig::global()->defaultMarkType() )
+ selectDefaultMark.setItemChecked( i+100, true );
+
+ vec[i++] = markType;
+ }
+
+ if( markMenu.count() == 0 )
+ return;
+
+ if( markMenu.count() > 1 )
+ markMenu.insertItem( i18n("Set Default Mark Type" ), &selectDefaultMark);
+
+ int result = markMenu.exec( pos );
+ if( result <= 0 )
+ return;
+
+ if ( result > 100)
+ {
+ KateViewConfig::global()->setDefaultMarkType (vec[result-100]);
+ // flush config, otherwise it isn't nessecarily done
+ KConfig *config = kapp->config();
+ config->setGroup("Kate View Defaults");
+ KateViewConfig::global()->writeConfig( config );
+ }
+ else
+ {
+ MarkInterface::MarkTypes markType = (MarkInterface::MarkTypes) vec[result];
+ if( m_doc->mark( line ) & markType ) {
+ m_doc->removeMark( line, markType );
+ } else {
+ m_doc->addMark( line, markType );
+ }
+ }
+}
+//END KateIconBorder
+
+KateViewEncodingAction::KateViewEncodingAction(KateDocument *_doc, KateView *_view, const QString& text, QObject* parent, const char* name)
+ : KActionMenu (text, parent, name), doc(_doc), view (_view)
+{
+ connect(popupMenu(),SIGNAL(aboutToShow()),this,SLOT(slotAboutToShow()));
+}
+
+void KateViewEncodingAction::slotAboutToShow()
+{
+ QStringList modes (KGlobal::charsets()->descriptiveEncodingNames());
+
+ popupMenu()->clear ();
+ for (uint z=0; z<modes.size(); ++z)
+ {
+ popupMenu()->insertItem ( modes[z], this, SLOT(setMode(int)), 0, z);
+
+ bool found = false;
+ QTextCodec *codecForEnc = KGlobal::charsets()->codecForName(KGlobal::charsets()->encodingForName(modes[z]), found);
+
+ if (found && codecForEnc)
+ {
+ if (codecForEnc->name() == doc->config()->codec()->name())
+ popupMenu()->setItemChecked (z, true);
+ }
+ }
+}
+
+void KateViewEncodingAction::setMode (int mode)
+{
+ QStringList modes (KGlobal::charsets()->descriptiveEncodingNames());
+ doc->config()->setEncoding( KGlobal::charsets()->encodingForName( modes[mode] ) );
+ // now we don't want the encoding changed again unless the user does so using the menu.
+ doc->setEncodingSticky( true );
+ doc->reloadFile();
+}
+
+// kate: space-indent on; indent-width 2; replace-tabs on;
diff --git a/kate/part/kateviewhelpers.h b/kate/part/kateviewhelpers.h
new file mode 100644
index 000000000..4687365f6
--- /dev/null
+++ b/kate/part/kateviewhelpers.h
@@ -0,0 +1,207 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2002 John Firebaugh <jfirebaugh@kde.org>
+ Copyright (C) 2001 Anders Lund <anders@alweb.dk>
+ Copyright (C) 2001 Christoph Cullmann <cullmann@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef __KATE_VIEW_HELPERS_H__
+#define __KATE_VIEW_HELPERS_H__
+
+#include <kaction.h>
+#include <klineedit.h>
+
+#include <qwidget.h>
+#include <qpixmap.h>
+#include <qcolor.h>
+#include <qscrollbar.h>
+#include <qintdict.h>
+
+class KateDocument;
+class KateView;
+class KateViewInternal;
+
+namespace Kate {
+ class Command;
+}
+
+/**
+ * This class is required because QScrollBar's sliderMoved() signal is
+ * really supposed to be a sliderDragged() signal... so this way we can capture
+ * MMB slider moves as well
+ *
+ * Also, it adds some usefull indicators on the scrollbar.
+ */
+class KateScrollBar : public QScrollBar
+{
+ Q_OBJECT
+
+ public:
+ KateScrollBar(Orientation orientation, class KateViewInternal *parent, const char* name = 0L);
+
+ inline bool showMarks() { return m_showMarks; };
+ inline void setShowMarks(bool b) { m_showMarks = b; update(); };
+
+ signals:
+ void sliderMMBMoved(int value);
+
+ protected:
+ virtual void mousePressEvent(QMouseEvent* e);
+ virtual void mouseReleaseEvent(QMouseEvent* e);
+ virtual void mouseMoveEvent (QMouseEvent* e);
+ virtual void paintEvent(QPaintEvent *);
+ virtual void resizeEvent(QResizeEvent *);
+ virtual void styleChange(QStyle &oldStyle);
+ virtual void valueChange();
+ virtual void rangeChange();
+
+ protected slots:
+ void sliderMaybeMoved(int value);
+ void marksChanged();
+
+ private:
+ void redrawMarks();
+ void recomputeMarksPositions(bool forceFullUpdate = false);
+ void watchScrollBarSize();
+
+ bool m_middleMouseDown;
+
+ KateView *m_view;
+ KateDocument *m_doc;
+ class KateViewInternal *m_viewInternal;
+
+ int m_topMargin;
+ int m_bottomMargin;
+ uint m_savVisibleLines;
+
+ QIntDict<QColor> m_lines;
+
+ bool m_showMarks;
+};
+
+class KateCmdLine : public KLineEdit
+{
+ Q_OBJECT
+
+ public:
+ KateCmdLine (KateView *view);
+
+ private slots:
+ void slotReturnPressed ( const QString& cmd );
+ void hideMe ();
+
+ protected:
+ void focusInEvent ( QFocusEvent *ev );
+ void keyPressEvent( QKeyEvent *ev );
+
+ private:
+ void fromHistory( bool up );
+ KateView *m_view;
+ bool m_msgMode;
+ QString m_oldText;
+ uint m_histpos; ///< position in the history
+ uint m_cmdend; ///< the point where a command ends in the text, if we have a valid one.
+ Kate::Command *m_command; ///< For completing flags/args and interactiveness
+ class KCompletion *m_oldCompletionObject; ///< save while completing command args.
+ class KateCmdLnWhatsThis *m_help;
+};
+
+class KateIconBorder : public QWidget
+{
+ Q_OBJECT
+
+ public:
+ KateIconBorder( KateViewInternal* internalView, QWidget *parent );
+
+ // VERY IMPORTANT ;)
+ virtual QSize sizeHint() const;
+
+ void updateFont();
+ int lineNumberWidth() const;
+
+ void setIconBorderOn( bool enable );
+ void setLineNumbersOn( bool enable );
+ void setDynWrapIndicators(int state );
+ int dynWrapIndicators() const { return m_dynWrapIndicators; }
+ bool dynWrapIndicatorsOn() const { return m_dynWrapIndicatorsOn; }
+ void setFoldingMarkersOn( bool enable );
+ void toggleIconBorder() { setIconBorderOn( !iconBorderOn() ); }
+ void toggleLineNumbers() { setLineNumbersOn( !lineNumbersOn() ); }
+ void toggleFoldingMarkers() { setFoldingMarkersOn( !foldingMarkersOn() ); }
+ bool iconBorderOn() const { return m_iconBorderOn; }
+ bool lineNumbersOn() const { return m_lineNumbersOn; }
+ bool foldingMarkersOn() const { return m_foldingMarkersOn; }
+
+ enum BorderArea { None, LineNumbers, IconBorder, FoldingMarkers };
+ BorderArea positionToArea( const QPoint& ) const;
+
+ signals:
+ void toggleRegionVisibility( unsigned int );
+
+ private:
+ void paintEvent( QPaintEvent* );
+ void paintBorder (int x, int y, int width, int height);
+
+ void mousePressEvent( QMouseEvent* );
+ void mouseMoveEvent( QMouseEvent* );
+ void mouseReleaseEvent( QMouseEvent* );
+ void mouseDoubleClickEvent( QMouseEvent* );
+
+ void showMarkMenu( uint line, const QPoint& pos );
+
+ KateView *m_view;
+ KateDocument *m_doc;
+ KateViewInternal *m_viewInternal;
+
+ bool m_iconBorderOn:1;
+ bool m_lineNumbersOn:1;
+ bool m_foldingMarkersOn:1;
+ bool m_dynWrapIndicatorsOn:1;
+ int m_dynWrapIndicators;
+
+ uint m_lastClickedLine;
+
+ int m_cachedLNWidth;
+
+ int m_maxCharWidth;
+
+ mutable QPixmap m_arrow;
+ mutable QColor m_oldBackgroundColor;
+};
+
+class KateViewEncodingAction : public KActionMenu
+{
+ Q_OBJECT
+
+ public:
+ KateViewEncodingAction(KateDocument *_doc, KateView *_view, const QString& text, QObject* parent = 0, const char* name = 0);
+
+ ~KateViewEncodingAction(){;};
+
+ private:
+ KateDocument* doc;
+ KateView *view;
+
+ public slots:
+ void slotAboutToShow();
+
+ private slots:
+ void setMode (int mode);
+};
+
+#endif
+
+// kate: space-indent on; indent-width 2; replace-tabs on;
diff --git a/kate/part/kateviewinternal.cpp b/kate/part/kateviewinternal.cpp
new file mode 100644
index 000000000..96edc1a9c
--- /dev/null
+++ b/kate/part/kateviewinternal.cpp
@@ -0,0 +1,3496 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2002 John Firebaugh <jfirebaugh@kde.org>
+ Copyright (C) 2002 Joseph Wenninger <jowenn@kde.org>
+ Copyright (C) 2002,2003 Christoph Cullmann <cullmann@kde.org>
+ Copyright (C) 2002,2003 Hamish Rodda <rodda@kde.org>
+ Copyright (C) 2003 Anakim Border <aborder@sources.sourceforge.net>
+
+ Based on:
+ KWriteView : Copyright (C) 1999 Jochen Wilhelmy <digisnap@cs.tu-berlin.de>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "kateviewinternal.h"
+#include "kateviewinternal.moc"
+
+#include "kateview.h"
+#include "katecodefoldinghelpers.h"
+#include "kateviewhelpers.h"
+#include "katehighlight.h"
+#include "katesupercursor.h"
+#include "katerenderer.h"
+#include "katecodecompletion.h"
+#include "kateconfig.h"
+
+#include <kcursor.h>
+#include <kdebug.h>
+#include <kapplication.h>
+#include <kglobalsettings.h>
+#include <kurldrag.h>
+
+#include <qstyle.h>
+#include <qdragobject.h>
+#include <qpopupmenu.h>
+#include <qdropsite.h>
+#include <qpainter.h>
+#include <qlayout.h>
+#include <qclipboard.h>
+#include <qpixmap.h>
+#include <qvbox.h>
+
+KateViewInternal::KateViewInternal(KateView *view, KateDocument *doc)
+ : QWidget (view, "", Qt::WStaticContents | Qt::WRepaintNoErase | Qt::WResizeNoErase )
+ , editSessionNumber (0)
+ , editIsRunning (false)
+ , m_view (view)
+ , m_doc (doc)
+ , cursor (doc, true, 0, 0, this)
+ , possibleTripleClick (false)
+ , m_dummy (0)
+ , m_startPos(doc, true, 0,0)
+ , m_madeVisible(false)
+ , m_shiftKeyPressed (false)
+ , m_autoCenterLines (false)
+ , m_selChangedByUser (false)
+ , selectAnchor (-1, -1)
+ , m_selectionMode( Default )
+ , m_preserveMaxX(false)
+ , m_currentMaxX(0)
+ , m_usePlainLines(false)
+ , m_updatingView(true)
+ , m_cachedMaxStartPos(-1, -1)
+ , m_dragScrollTimer(this)
+ , m_scrollTimer (this)
+ , m_cursorTimer (this)
+ , m_textHintTimer (this)
+ , m_textHintEnabled(false)
+ , m_textHintMouseX(-1)
+ , m_textHintMouseY(-1)
+ , m_imPreeditStartLine(0)
+ , m_imPreeditStart(0)
+ , m_imPreeditLength(0)
+ , m_imPreeditSelStart(0)
+{
+ setMinimumSize (0,0);
+
+ // cursor
+ cursor.setMoveOnInsert (true);
+
+ // invalidate selStartCached, or keyb selection is screwed initially
+ selStartCached.setLine( -1 );
+ //
+ // scrollbar for lines
+ //
+ m_lineScroll = new KateScrollBar(QScrollBar::Vertical, this);
+ m_lineScroll->show();
+ m_lineScroll->setTracking (true);
+
+ m_lineLayout = new QVBoxLayout();
+ m_colLayout = new QHBoxLayout();
+
+ m_colLayout->addWidget(m_lineScroll);
+ m_lineLayout->addLayout(m_colLayout);
+
+ // bottom corner box
+ m_dummy = new QWidget(m_view);
+ m_dummy->setFixedHeight(style().scrollBarExtent().width());
+
+ if (m_view->dynWordWrap())
+ m_dummy->hide();
+ else
+ m_dummy->show();
+
+ m_lineLayout->addWidget(m_dummy);
+
+ // Hijack the line scroller's controls, so we can scroll nicely for word-wrap
+ connect(m_lineScroll, SIGNAL(prevPage()), SLOT(scrollPrevPage()));
+ connect(m_lineScroll, SIGNAL(nextPage()), SLOT(scrollNextPage()));
+
+ connect(m_lineScroll, SIGNAL(prevLine()), SLOT(scrollPrevLine()));
+ connect(m_lineScroll, SIGNAL(nextLine()), SLOT(scrollNextLine()));
+
+ connect(m_lineScroll, SIGNAL(sliderMoved(int)), SLOT(scrollLines(int)));
+ connect(m_lineScroll, SIGNAL(sliderMMBMoved(int)), SLOT(scrollLines(int)));
+
+ // catch wheel events, completing the hijack
+ m_lineScroll->installEventFilter(this);
+
+ //
+ // scrollbar for columns
+ //
+ m_columnScroll = new QScrollBar(QScrollBar::Horizontal,m_view);
+
+ // hide the column scrollbar in the dynamic word wrap mode
+ if (m_view->dynWordWrap())
+ m_columnScroll->hide();
+ else
+ m_columnScroll->show();
+
+ m_columnScroll->setTracking(true);
+ m_startX = 0;
+
+ connect( m_columnScroll, SIGNAL( valueChanged (int) ),
+ this, SLOT( scrollColumns (int) ) );
+
+ //
+ // iconborder ;)
+ //
+ leftBorder = new KateIconBorder( this, m_view );
+ leftBorder->show ();
+
+ connect( leftBorder, SIGNAL(toggleRegionVisibility(unsigned int)),
+ m_doc->foldingTree(), SLOT(toggleRegionVisibility(unsigned int)));
+
+ connect( doc->foldingTree(), SIGNAL(regionVisibilityChangedAt(unsigned int)),
+ this, SLOT(slotRegionVisibilityChangedAt(unsigned int)));
+ connect( doc, SIGNAL(codeFoldingUpdated()),
+ this, SLOT(slotCodeFoldingChanged()) );
+
+ displayCursor.setPos(0, 0);
+ cursor.setPos(0, 0);
+ cXPos = 0;
+
+ setAcceptDrops( true );
+ setBackgroundMode( NoBackground );
+
+ // event filter
+ installEventFilter(this);
+
+ // im
+ setInputMethodEnabled(true);
+
+ // set initial cursor
+ setCursor( KCursor::ibeamCursor() );
+ m_mouseCursor = IbeamCursor;
+
+ // call mouseMoveEvent also if no mouse button is pressed
+ setMouseTracking(true);
+
+ dragInfo.state = diNone;
+
+ // timers
+ connect( &m_dragScrollTimer, SIGNAL( timeout() ),
+ this, SLOT( doDragScroll() ) );
+
+ connect( &m_scrollTimer, SIGNAL( timeout() ),
+ this, SLOT( scrollTimeout() ) );
+
+ connect( &m_cursorTimer, SIGNAL( timeout() ),
+ this, SLOT( cursorTimeout() ) );
+
+ connect( &m_textHintTimer, SIGNAL( timeout() ),
+ this, SLOT( textHintTimeout() ) );
+
+ // selection changed to set anchor
+ connect( m_view, SIGNAL( selectionChanged() ),
+ this, SLOT( viewSelectionChanged() ) );
+
+
+// this is a work arround for RTL desktops
+// should be changed in kde 3.3
+// BTW: this comment has been "ported" from 3.1.X tree
+// any hacker with BIDI knowlege is welcomed to fix kate problems :)
+ if (QApplication::reverseLayout()){
+ m_view->m_grid->addMultiCellWidget(leftBorder, 0, 1, 2, 2);
+ m_view->m_grid->addMultiCellWidget(m_columnScroll, 1, 1, 0, 1);
+ m_view->m_grid->addMultiCellLayout(m_lineLayout, 0, 0, 0, 0);
+ }
+ else{
+ m_view->m_grid->addMultiCellLayout(m_lineLayout, 0, 1, 2, 2);
+ m_view->m_grid->addMultiCellWidget(m_columnScroll, 1, 1, 0, 1);
+ m_view->m_grid->addWidget(leftBorder, 0, 0);
+ }
+
+ updateView ();
+}
+
+KateViewInternal::~KateViewInternal ()
+{
+}
+
+void KateViewInternal::prepareForDynWrapChange()
+{
+ // Which is the current view line?
+ m_wrapChangeViewLine = displayViewLine(displayCursor, true);
+}
+
+void KateViewInternal::dynWrapChanged()
+{
+ if (m_view->dynWordWrap())
+ {
+ m_columnScroll->hide();
+ m_dummy->hide ();
+ }
+ else
+ {
+ m_columnScroll->show();
+ m_dummy->show ();
+ }
+
+ tagAll();
+ updateView();
+
+ if (m_view->dynWordWrap())
+ scrollColumns(0);
+
+ // Determine where the cursor should be to get the cursor on the same view line
+ if (m_wrapChangeViewLine != -1) {
+ KateTextCursor newStart = viewLineOffset(displayCursor, -m_wrapChangeViewLine);
+ makeVisible(newStart, newStart.col(), true);
+ } else {
+ update();
+ }
+}
+
+KateTextCursor KateViewInternal::endPos() const
+{
+ int viewLines = linesDisplayed() - 1;
+
+ if (viewLines < 0) {
+ kdDebug(13030) << "WARNING: viewLines wrong!" << endl;
+ viewLines = 0;
+ }
+
+ // Check to make sure that lineRanges isn't invalid
+ if (!lineRanges.count() || lineRanges[0].line == -1 || viewLines >= (int)lineRanges.count()) {
+ // Switch off use of the cache
+ return KateTextCursor(m_doc->numVisLines() - 1, m_doc->lineLength(m_doc->getRealLine(m_doc->numVisLines() - 1)));
+ }
+
+ for (int i = viewLines; i >= 0; i--) {
+ KateLineRange& thisRange = lineRanges[i];
+
+ if (thisRange.line == -1) continue;
+
+ if (thisRange.virtualLine >= (int)m_doc->numVisLines()) {
+ // Cache is too out of date
+ return KateTextCursor(m_doc->numVisLines() - 1, m_doc->lineLength(m_doc->getRealLine(m_doc->numVisLines() - 1)));
+ }
+
+ return KateTextCursor(thisRange.virtualLine, thisRange.wrap ? thisRange.endCol - 1 : thisRange.endCol);
+ }
+
+ Q_ASSERT(false);
+ kdDebug(13030) << "WARNING: could not find a lineRange at all" << endl;
+ return KateTextCursor(-1, -1);
+}
+
+uint KateViewInternal::endLine() const
+{
+ return endPos().line();
+}
+
+KateLineRange KateViewInternal::yToKateLineRange(uint y) const
+{
+ uint range = y / m_view->renderer()->fontHeight();
+
+ // lineRanges is always bigger than 0, after the initial updateView call
+ if (range >= lineRanges.size())
+ return lineRanges[lineRanges.size()-1];
+
+ return lineRanges[range];
+}
+
+int KateViewInternal::lineToY(uint viewLine) const
+{
+ return (viewLine-startLine()) * m_view->renderer()->fontHeight();
+}
+
+void KateViewInternal::slotIncFontSizes()
+{
+ m_view->renderer()->increaseFontSizes();
+}
+
+void KateViewInternal::slotDecFontSizes()
+{
+ m_view->renderer()->decreaseFontSizes();
+}
+
+/**
+ * Line is the real line number to scroll to.
+ */
+void KateViewInternal::scrollLines ( int line )
+{
+ KateTextCursor newPos(line, 0);
+ scrollPos(newPos);
+}
+
+// This can scroll less than one true line
+void KateViewInternal::scrollViewLines(int offset)
+{
+ KateTextCursor c = viewLineOffset(startPos(), offset);
+ scrollPos(c);
+
+ m_lineScroll->blockSignals(true);
+ m_lineScroll->setValue(startLine());
+ m_lineScroll->blockSignals(false);
+}
+
+void KateViewInternal::scrollNextPage()
+{
+ scrollViewLines(kMax( (int)linesDisplayed() - 1, 0 ));
+}
+
+void KateViewInternal::scrollPrevPage()
+{
+ scrollViewLines(-kMax( (int)linesDisplayed() - 1, 0 ));
+}
+
+void KateViewInternal::scrollPrevLine()
+{
+ scrollViewLines(-1);
+}
+
+void KateViewInternal::scrollNextLine()
+{
+ scrollViewLines(1);
+}
+
+KateTextCursor KateViewInternal::maxStartPos(bool changed)
+{
+ m_usePlainLines = true;
+
+ if (m_cachedMaxStartPos.line() == -1 || changed)
+ {
+ KateTextCursor end(m_doc->numVisLines() - 1, m_doc->lineLength(m_doc->getRealLine(m_doc->numVisLines() - 1)));
+
+ m_cachedMaxStartPos = viewLineOffset(end, -((int)linesDisplayed() - 1));
+ }
+
+ m_usePlainLines = false;
+
+ return m_cachedMaxStartPos;
+}
+
+// c is a virtual cursor
+void KateViewInternal::scrollPos(KateTextCursor& c, bool force, bool calledExternally)
+{
+ if (!force && ((!m_view->dynWordWrap() && c.line() == (int)startLine()) || c == startPos()))
+ return;
+
+ if (c.line() < 0)
+ c.setLine(0);
+
+ KateTextCursor limit = maxStartPos();
+ if (c > limit) {
+ c = limit;
+
+ // Re-check we're not just scrolling to the same place
+ if (!force && ((!m_view->dynWordWrap() && c.line() == (int)startLine()) || c == startPos()))
+ return;
+ }
+
+ int viewLinesScrolled = 0;
+
+ // only calculate if this is really used and usefull, could be wrong here, please recheck
+ // for larger scrolls this makes 2-4 seconds difference on my xeon with dyn. word wrap on
+ // try to get it really working ;)
+ bool viewLinesScrolledUsable = !force
+ && (c.line() >= (int)startLine()-(int)linesDisplayed()-1)
+ && (c.line() <= (int)endLine()+(int)linesDisplayed()+1);
+
+ if (viewLinesScrolledUsable)
+ viewLinesScrolled = displayViewLine(c);
+
+ m_startPos.setPos(c);
+
+ // set false here but reversed if we return to makeVisible
+ m_madeVisible = false;
+
+ if (viewLinesScrolledUsable)
+ {
+ int lines = linesDisplayed();
+ if ((int)m_doc->numVisLines() < lines) {
+ KateTextCursor end(m_doc->numVisLines() - 1, m_doc->lineLength(m_doc->getRealLine(m_doc->numVisLines() - 1)));
+ lines = kMin((int)linesDisplayed(), displayViewLine(end) + 1);
+ }
+
+ Q_ASSERT(lines >= 0);
+
+ if (!calledExternally && QABS(viewLinesScrolled) < lines)
+ {
+ updateView(false, viewLinesScrolled);
+
+ int scrollHeight = -(viewLinesScrolled * (int)m_view->renderer()->fontHeight());
+ int scrollbarWidth = style().scrollBarExtent().width();
+
+ //
+ // updates are for working around the scrollbar leaving blocks in the view
+ //
+ scroll(0, scrollHeight);
+ update(0, height()+scrollHeight-scrollbarWidth, width(), 2*scrollbarWidth);
+
+ leftBorder->scroll(0, scrollHeight);
+ leftBorder->update(0, leftBorder->height()+scrollHeight-scrollbarWidth, leftBorder->width(), 2*scrollbarWidth);
+
+ return;
+ }
+ }
+
+ updateView();
+ update();
+ leftBorder->update();
+}
+
+void KateViewInternal::scrollColumns ( int x )
+{
+ if (x == m_startX)
+ return;
+
+ if (x < 0)
+ x = 0;
+
+ int dx = m_startX - x;
+ m_startX = x;
+
+ if (QABS(dx) < width())
+ scroll(dx, 0);
+ else
+ update();
+
+ m_columnScroll->blockSignals(true);
+ m_columnScroll->setValue(m_startX);
+ m_columnScroll->blockSignals(false);
+}
+
+// If changed is true, the lines that have been set dirty have been updated.
+void KateViewInternal::updateView(bool changed, int viewLinesScrolled)
+{
+ m_updatingView = true;
+
+ uint contentLines = m_doc->visibleLines();
+
+ m_lineScroll->blockSignals(true);
+
+ KateTextCursor maxStart = maxStartPos(changed);
+ int maxLineScrollRange = maxStart.line();
+ if (m_view->dynWordWrap() && maxStart.col() != 0)
+ maxLineScrollRange++;
+ m_lineScroll->setRange(0, maxLineScrollRange);
+
+ m_lineScroll->setValue(startPos().line());
+ m_lineScroll->setSteps(1, height() / m_view->renderer()->fontHeight());
+ m_lineScroll->blockSignals(false);
+
+ uint oldSize = lineRanges.size ();
+ uint newSize = (height() / m_view->renderer()->fontHeight()) + 1;
+ if (oldSize != newSize) {
+ lineRanges.resize((height() / m_view->renderer()->fontHeight()) + 1);
+ if (newSize > oldSize) {
+ static KateLineRange blank;
+ for (uint i = oldSize; i < newSize; i++) {
+ lineRanges[i] = blank;
+ }
+ }
+ }
+
+ if (oldSize < lineRanges.size ())
+ {
+ for (uint i=oldSize; i < lineRanges.size(); i++)
+ lineRanges[i].dirty = true;
+ }
+
+ // Move the lineRanges data if we've just scrolled...
+ if (viewLinesScrolled != 0) {
+ // loop backwards if we've just scrolled up...
+ bool forwards = viewLinesScrolled >= 0 ? true : false;
+ for (uint z = forwards ? 0 : lineRanges.count() - 1; z < lineRanges.count(); forwards ? z++ : z--) {
+ uint oldZ = z + viewLinesScrolled;
+ if (oldZ < lineRanges.count()) {
+ lineRanges[z] = lineRanges[oldZ];
+ } else {
+ lineRanges[z].dirty = true;
+ }
+ }
+ }
+
+ if (m_view->dynWordWrap())
+ {
+ KateTextCursor realStart = startPos();
+ realStart.setLine(m_doc->getRealLine(realStart.line()));
+
+ KateLineRange startRange = range(realStart);
+ uint line = startRange.virtualLine;
+ int realLine = startRange.line;
+ uint oldLine = line;
+ int startCol = startRange.startCol;
+ int startX = startRange.startX;
+ int endX = startRange.startX;
+ int shiftX = startRange.startCol ? startRange.shiftX : 0;
+ bool wrap = false;
+ int newViewLine = startRange.viewLine;
+ // z is the current display view line
+ KateTextLine::Ptr text = textLine(realLine);
+
+ bool alreadyDirty = false;
+
+ for (uint z = 0; z < lineRanges.size(); z++)
+ {
+ if (oldLine != line) {
+ realLine = (int)m_doc->getRealLine(line);
+
+ if (z)
+ lineRanges[z-1].startsInvisibleBlock = (realLine != lineRanges[z-1].line + 1);
+
+ text = textLine(realLine);
+ startCol = 0;
+ startX = 0;
+ endX = 0;
+ shiftX = 0;
+ newViewLine = 0;
+ oldLine = line;
+ }
+
+ if (line >= contentLines || !text)
+ {
+ if (lineRanges[z].line != -1)
+ lineRanges[z].dirty = true;
+
+ lineRanges[z].clear();
+
+ line++;
+ }
+ else
+ {
+ if (lineRanges[z].line != realLine || lineRanges[z].startCol != startCol)
+ alreadyDirty = lineRanges[z].dirty = true;
+
+ if (lineRanges[z].dirty || changed || alreadyDirty) {
+ alreadyDirty = true;
+
+ lineRanges[z].virtualLine = line;
+ lineRanges[z].line = realLine;
+ lineRanges[z].startsInvisibleBlock = false;
+
+ int tempEndX = 0;
+
+ int endCol = m_view->renderer()->textWidth(text, startCol, width() - shiftX, &wrap, &tempEndX);
+
+ endX += tempEndX;
+
+ if (wrap)
+ {
+ if (m_view->config()->dynWordWrapAlignIndent() > 0)
+ {
+ if (startX == 0)
+ {
+ int pos = text->nextNonSpaceChar(0);
+
+ if (pos > 0)
+ shiftX = m_view->renderer()->textWidth(text, pos);
+
+ if (shiftX > ((double)width() / 100 * m_view->config()->dynWordWrapAlignIndent()))
+ shiftX = 0;
+ }
+ }
+
+ if ((lineRanges[z].startX != startX) || (lineRanges[z].endX != endX) ||
+ (lineRanges[z].startCol != startCol) || (lineRanges[z].endCol != endCol) ||
+ (lineRanges[z].shiftX != shiftX))
+ lineRanges[z].dirty = true;
+
+ lineRanges[z].startCol = startCol;
+ lineRanges[z].endCol = endCol;
+ lineRanges[z].startX = startX;
+ lineRanges[z].endX = endX;
+ lineRanges[z].viewLine = newViewLine;
+ lineRanges[z].wrap = true;
+
+ startCol = endCol;
+ startX = endX;
+ }
+ else
+ {
+ if ((lineRanges[z].startX != startX) || (lineRanges[z].endX != endX) ||
+ (lineRanges[z].startCol != startCol) || (lineRanges[z].endCol != endCol))
+ lineRanges[z].dirty = true;
+
+ lineRanges[z].startCol = startCol;
+ lineRanges[z].endCol = endCol;
+ lineRanges[z].startX = startX;
+ lineRanges[z].endX = endX;
+ lineRanges[z].viewLine = newViewLine;
+ lineRanges[z].wrap = false;
+
+ line++;
+ }
+
+ lineRanges[z].shiftX = shiftX;
+
+ } else {
+ // The cached data is still intact
+ if (lineRanges[z].wrap) {
+ startCol = lineRanges[z].endCol;
+ startX = lineRanges[z].endX;
+ endX = lineRanges[z].endX;
+ } else {
+ line++;
+ }
+ shiftX = lineRanges[z].shiftX;
+ }
+ }
+ newViewLine++;
+ }
+ }
+ else
+ {
+ uint z = 0;
+
+ for(; (z + startLine() < contentLines) && (z < lineRanges.size()); z++)
+ {
+ if (lineRanges[z].dirty || lineRanges[z].line != (int)m_doc->getRealLine(z + startLine())) {
+ lineRanges[z].dirty = true;
+
+ lineRanges[z].line = m_doc->getRealLine( z + startLine() );
+ if (z)
+ lineRanges[z-1].startsInvisibleBlock = (lineRanges[z].line != lineRanges[z-1].line + 1);
+
+ lineRanges[z].virtualLine = z + startLine();
+ lineRanges[z].startCol = 0;
+ lineRanges[z].endCol = m_doc->lineLength(lineRanges[z].line);
+ lineRanges[z].startX = 0;
+ lineRanges[z].endX = m_view->renderer()->textWidth( textLine( lineRanges[z].line ), -1 );
+ lineRanges[z].shiftX = 0;
+ lineRanges[z].viewLine = 0;
+ lineRanges[z].wrap = false;
+ }
+ else if (z && lineRanges[z-1].dirty)
+ {
+ lineRanges[z-1].startsInvisibleBlock = (lineRanges[z].line != lineRanges[z-1].line + 1);
+ }
+ }
+
+ for (; z < lineRanges.size(); z++)
+ {
+ if (lineRanges[z].line != -1)
+ lineRanges[z].dirty = true;
+
+ lineRanges[z].clear();
+ }
+
+ int max = maxLen(startLine()) - width();
+ if (max < 0)
+ max = 0;
+
+ // if we lose the ability to scroll horizontally, move view to the far-left
+ if (max == 0)
+ {
+ scrollColumns(0);
+ }
+
+ m_columnScroll->blockSignals(true);
+
+ // disable scrollbar
+ m_columnScroll->setDisabled (max == 0);
+
+ m_columnScroll->setRange(0, max);
+
+ m_columnScroll->setValue(m_startX);
+
+ // Approximate linescroll
+ m_columnScroll->setSteps(m_view->renderer()->config()->fontMetrics()->width('a'), width());
+
+ m_columnScroll->blockSignals(false);
+ }
+
+ m_updatingView = false;
+
+ if (changed)
+ paintText(0, 0, width(), height(), true);
+}
+
+void KateViewInternal::paintText (int x, int y, int width, int height, bool paintOnlyDirty)
+{
+ //kdDebug() << k_funcinfo << x << " " << y << " " << width << " " << height << " " << paintOnlyDirty << endl;
+ int xStart = startX() + x;
+ int xEnd = xStart + width;
+ uint h = m_view->renderer()->fontHeight();
+ uint startz = (y / h);
+ uint endz = startz + 1 + (height / h);
+ uint lineRangesSize = lineRanges.size();
+
+ static QPixmap drawBuffer;
+
+ if (drawBuffer.width() < KateViewInternal::width() || drawBuffer.height() < (int)h)
+ drawBuffer.resize(KateViewInternal::width(), (int)h);
+
+ if (drawBuffer.isNull())
+ return;
+
+ QPainter paint(this);
+ QPainter paintDrawBuffer(&drawBuffer);
+
+ // TODO put in the proper places
+ m_view->renderer()->setCaretStyle(m_view->isOverwriteMode() ? KateRenderer::Replace : KateRenderer::Insert);
+ m_view->renderer()->setShowTabs(m_doc->configFlags() & KateDocument::cfShowTabs);
+
+ for (uint z=startz; z <= endz; z++)
+ {
+ if ( (z >= lineRangesSize) || ((lineRanges[z].line == -1) && (!paintOnlyDirty || lineRanges[z].dirty)) )
+ {
+ if (!(z >= lineRangesSize))
+ lineRanges[z].dirty = false;
+
+ paint.fillRect( x, z * h, width, h, m_view->renderer()->config()->backgroundColor() );
+ }
+ else if (!paintOnlyDirty || lineRanges[z].dirty)
+ {
+ lineRanges[z].dirty = false;
+
+ m_view->renderer()->paintTextLine(paintDrawBuffer, &lineRanges[z], xStart, xEnd, &cursor, &bm);
+
+ paint.drawPixmap (x, z * h, drawBuffer, 0, 0, width, h);
+ }
+ }
+}
+
+/**
+ * this function ensures a certain location is visible on the screen.
+ * if endCol is -1, ignore making the columns visible.
+ */
+void KateViewInternal::makeVisible (const KateTextCursor& c, uint endCol, bool force, bool center, bool calledExternally)
+{
+ //kdDebug() << "MakeVisible start [" << startPos().line << "," << startPos().col << "] end [" << endPos().line << "," << endPos().col << "] -> request: [" << c.line << "," << c.col << "]" <<endl;// , new start [" << scroll.line << "," << scroll.col << "] lines " << (linesDisplayed() - 1) << " height " << height() << endl;
+ // if the line is in a folded region, unfold all the way up
+ //if ( m_doc->foldingTree()->findNodeForLine( c.line )->visible )
+ // kdDebug()<<"line ("<<c.line<<") should be visible"<<endl;
+
+ if ( force )
+ {
+ KateTextCursor scroll = c;
+ scrollPos(scroll, force, calledExternally);
+ }
+ else if (center && (c < startPos() || c > endPos()))
+ {
+ KateTextCursor scroll = viewLineOffset(c, -int(linesDisplayed()) / 2);
+ scrollPos(scroll, false, calledExternally);
+ }
+ else if ( c > viewLineOffset(endPos(), -m_minLinesVisible) )
+ {
+ KateTextCursor scroll = viewLineOffset(c, -((int)linesDisplayed() - m_minLinesVisible - 1));
+ scrollPos(scroll, false, calledExternally);
+ }
+ else if ( c < viewLineOffset(startPos(), m_minLinesVisible) )
+ {
+ KateTextCursor scroll = viewLineOffset(c, -m_minLinesVisible);
+ scrollPos(scroll, false, calledExternally);
+ }
+ else
+ {
+ // Check to see that we're not showing blank lines
+ KateTextCursor max = maxStartPos();
+ if (startPos() > max) {
+ scrollPos(max, max.col(), calledExternally);
+ }
+ }
+
+ if (!m_view->dynWordWrap() && endCol != (uint)-1)
+ {
+ int sX = (int)m_view->renderer()->textWidth (textLine( m_doc->getRealLine( c.line() ) ), c.col() );
+
+ int sXborder = sX-8;
+ if (sXborder < 0)
+ sXborder = 0;
+
+ if (sX < m_startX)
+ scrollColumns (sXborder);
+ else if (sX > m_startX + width())
+ scrollColumns (sX - width() + 8);
+ }
+
+ m_madeVisible = !force;
+}
+
+void KateViewInternal::slotRegionVisibilityChangedAt(unsigned int)
+{
+ kdDebug(13030) << "slotRegionVisibilityChangedAt()" << endl;
+ m_cachedMaxStartPos.setLine(-1);
+ KateTextCursor max = maxStartPos();
+ if (startPos() > max)
+ scrollPos(max);
+
+ updateView();
+ update();
+ leftBorder->update();
+}
+
+void KateViewInternal::slotCodeFoldingChanged()
+{
+ leftBorder->update();
+}
+
+void KateViewInternal::slotRegionBeginEndAddedRemoved(unsigned int)
+{
+ kdDebug(13030) << "slotRegionBeginEndAddedRemoved()" << endl;
+ // FIXME: performance problem
+ leftBorder->update();
+}
+
+void KateViewInternal::showEvent ( QShowEvent *e )
+{
+ updateView ();
+
+ QWidget::showEvent (e);
+}
+
+uint KateViewInternal::linesDisplayed() const
+{
+ int h = height();
+ int fh = m_view->renderer()->fontHeight();
+
+ return (h - (h % fh)) / fh;
+}
+
+QPoint KateViewInternal::cursorCoordinates()
+{
+ int viewLine = displayViewLine(displayCursor, true);
+
+ if (viewLine == -1)
+ return QPoint(-1, -1);
+
+ uint y = viewLine * m_view->renderer()->fontHeight();
+ uint x = cXPos - m_startX - lineRanges[viewLine].startX + leftBorder->width() + lineRanges[viewLine].xOffset();
+
+ return QPoint(x, y);
+}
+
+void KateViewInternal::updateMicroFocusHint()
+{
+ int line = displayViewLine(displayCursor, true);
+ /* Check for hasFocus() to avoid crashes in QXIMInputContext as in bug #131266.
+ This is only a workaround until somebody can find the real reason of the crash
+ (probably it's in Qt). */
+ if (line == -1 || !hasFocus())
+ return;
+
+ KateRenderer *renderer = m_view->renderer();
+
+ // Cursor placement code is changed for Asian input method that
+ // shows candidate window. This behavior is same as Qt/E 2.3.7
+ // which supports Asian input methods. Asian input methods need
+ // start point of IM selection text to place candidate window as
+ // adjacent to the selection text.
+ uint preeditStrLen = renderer->textWidth(textLine(m_imPreeditStartLine), cursor.col()) - renderer->textWidth(textLine(m_imPreeditStartLine), m_imPreeditSelStart);
+ uint x = cXPos - m_startX - lineRanges[line].startX + lineRanges[line].xOffset() - preeditStrLen;
+ uint y = line * renderer->fontHeight();
+
+ setMicroFocusHint(x, y, 0, renderer->fontHeight());
+}
+
+void KateViewInternal::doReturn()
+{
+ KateTextCursor c = cursor;
+ m_doc->newLine( c, this );
+ updateCursor( c );
+ updateView();
+}
+
+void KateViewInternal::doDelete()
+{
+ m_doc->del( m_view, cursor );
+ if (m_view->m_codeCompletion->codeCompletionVisible()) {
+ m_view->m_codeCompletion->updateBox();
+ }
+}
+
+void KateViewInternal::doBackspace()
+{
+ m_doc->backspace( m_view, cursor );
+ if (m_view->m_codeCompletion->codeCompletionVisible()) {
+ m_view->m_codeCompletion->updateBox();
+ }
+}
+
+void KateViewInternal::doTranspose()
+{
+ m_doc->transpose( cursor );
+}
+
+void KateViewInternal::doDeleteWordLeft()
+{
+ wordLeft( true );
+ m_view->removeSelectedText();
+ update();
+}
+
+void KateViewInternal::doDeleteWordRight()
+{
+ wordRight( true );
+ m_view->removeSelectedText();
+ update();
+}
+
+class CalculatingCursor : public KateTextCursor {
+public:
+ CalculatingCursor(KateViewInternal* vi)
+ : KateTextCursor()
+ , m_vi(vi)
+ {
+ Q_ASSERT(valid());
+ }
+
+ CalculatingCursor(KateViewInternal* vi, const KateTextCursor& c)
+ : KateTextCursor(c)
+ , m_vi(vi)
+ {
+ Q_ASSERT(valid());
+ }
+
+ // This one constrains its arguments to valid positions
+ CalculatingCursor(KateViewInternal* vi, uint line, uint col)
+ : KateTextCursor(line, col)
+ , m_vi(vi)
+ {
+ makeValid();
+ }
+
+
+ virtual CalculatingCursor& operator+=( int n ) = 0;
+
+ virtual CalculatingCursor& operator-=( int n ) = 0;
+
+ CalculatingCursor& operator++() { return operator+=( 1 ); }
+
+ CalculatingCursor& operator--() { return operator-=( 1 ); }
+
+ void makeValid() {
+ m_line = kMax( 0, kMin( int( m_vi->m_doc->numLines() - 1 ), line() ) );
+ if (m_vi->m_view->wrapCursor())
+ m_col = kMax( 0, kMin( m_vi->m_doc->lineLength( line() ), col() ) );
+ else
+ m_col = kMax( 0, col() );
+ Q_ASSERT( valid() );
+ }
+
+ void toEdge( Bias bias ) {
+ if( bias == left ) m_col = 0;
+ else if( bias == right ) m_col = m_vi->m_doc->lineLength( line() );
+ }
+
+ bool atEdge() const { return atEdge( left ) || atEdge( right ); }
+
+ bool atEdge( Bias bias ) const {
+ switch( bias ) {
+ case left: return col() == 0;
+ case none: return atEdge();
+ case right: return col() == m_vi->m_doc->lineLength( line() );
+ default: Q_ASSERT(false); return false;
+ }
+ }
+
+protected:
+ bool valid() const {
+ return line() >= 0 &&
+ uint( line() ) < m_vi->m_doc->numLines() &&
+ col() >= 0 &&
+ (!m_vi->m_view->wrapCursor() || col() <= m_vi->m_doc->lineLength( line() ));
+ }
+ KateViewInternal* m_vi;
+};
+
+class BoundedCursor : public CalculatingCursor {
+public:
+ BoundedCursor(KateViewInternal* vi)
+ : CalculatingCursor( vi ) {};
+ BoundedCursor(KateViewInternal* vi, const KateTextCursor& c )
+ : CalculatingCursor( vi, c ) {};
+ BoundedCursor(KateViewInternal* vi, uint line, uint col )
+ : CalculatingCursor( vi, line, col ) {};
+ virtual CalculatingCursor& operator+=( int n ) {
+ m_col += n;
+
+ if (n > 0 && m_vi->m_view->dynWordWrap()) {
+ // Need to constrain to current visible text line for dynamic wrapping mode
+ if (m_col > m_vi->m_doc->lineLength(m_line)) {
+ KateLineRange currentRange = m_vi->range(*this);
+
+ int endX;
+ bool crap;
+ m_vi->m_view->renderer()->textWidth(m_vi->textLine(m_line), currentRange.startCol, m_vi->width() - currentRange.xOffset(), &crap, &endX);
+ endX += (m_col - currentRange.endCol + 1) * m_vi->m_view->renderer()->spaceWidth();
+
+ // Constraining if applicable NOTE: some code duplication in KateViewInternal::resize()
+ if (endX >= m_vi->width() - currentRange.xOffset()) {
+ m_col -= n;
+ if ( uint( line() ) < m_vi->m_doc->numLines() - 1 ) {
+ m_line++;
+ m_col = 0;
+ }
+ }
+ }
+
+ } else if (n < 0 && col() < 0 && line() > 0 ) {
+ m_line--;
+ m_col = m_vi->m_doc->lineLength( line() );
+ }
+
+ m_col = kMax( 0, col() );
+
+ Q_ASSERT( valid() );
+ return *this;
+ }
+ virtual CalculatingCursor& operator-=( int n ) {
+ return operator+=( -n );
+ }
+};
+
+class WrappingCursor : public CalculatingCursor {
+public:
+ WrappingCursor(KateViewInternal* vi)
+ : CalculatingCursor( vi) {};
+ WrappingCursor(KateViewInternal* vi, const KateTextCursor& c )
+ : CalculatingCursor( vi, c ) {};
+ WrappingCursor(KateViewInternal* vi, uint line, uint col )
+ : CalculatingCursor( vi, line, col ) {};
+
+ virtual CalculatingCursor& operator+=( int n ) {
+ if( n < 0 ) return operator-=( -n );
+ int len = m_vi->m_doc->lineLength( line() );
+ if( col() + n <= len ) {
+ m_col += n;
+ } else if( uint( line() ) < m_vi->m_doc->numLines() - 1 ) {
+ n -= len - col() + 1;
+ m_col = 0;
+ m_line++;
+ operator+=( n );
+ } else {
+ m_col = len;
+ }
+ Q_ASSERT( valid() );
+ return *this;
+ }
+ virtual CalculatingCursor& operator-=( int n ) {
+ if( n < 0 ) return operator+=( -n );
+ if( col() - n >= 0 ) {
+ m_col -= n;
+ } else if( line() > 0 ) {
+ n -= col() + 1;
+ m_line--;
+ m_col = m_vi->m_doc->lineLength( line() );
+ operator-=( n );
+ } else {
+ m_col = 0;
+ }
+ Q_ASSERT( valid() );
+ return *this;
+ }
+};
+
+void KateViewInternal::moveChar( Bias bias, bool sel )
+{
+ KateTextCursor c;
+ if ( m_view->wrapCursor() ) {
+ c = WrappingCursor( this, cursor ) += bias;
+ } else {
+ c = BoundedCursor( this, cursor ) += bias;
+ }
+
+ updateSelection( c, sel );
+ updateCursor( c );
+}
+
+void KateViewInternal::cursorLeft( bool sel )
+{
+ if ( ! m_view->wrapCursor() && cursor.col() == 0 )
+ return;
+
+ moveChar( left, sel );
+ if (m_view->m_codeCompletion->codeCompletionVisible()) {
+ m_view->m_codeCompletion->updateBox();
+ }
+}
+
+void KateViewInternal::cursorRight( bool sel )
+{
+ moveChar( right, sel );
+ if (m_view->m_codeCompletion->codeCompletionVisible()) {
+ m_view->m_codeCompletion->updateBox();
+ }
+}
+
+void KateViewInternal::wordLeft ( bool sel )
+{
+ WrappingCursor c( this, cursor );
+
+ // First we skip backwards all space.
+ // Then we look up into which category the current position falls:
+ // 1. a "word" character
+ // 2. a "non-word" character (except space)
+ // 3. the beginning of the line
+ // and skip all preceding characters that fall into this class.
+ // The code assumes that space is never part of the word character class.
+
+ KateHighlighting* h = m_doc->highlight();
+ if( !c.atEdge( left ) ) {
+
+ while( !c.atEdge( left ) && m_doc->textLine( c.line() )[ c.col() - 1 ].isSpace() )
+ --c;
+ }
+ if( c.atEdge( left ) )
+ {
+ --c;
+ }
+ else if( h->isInWord( m_doc->textLine( c.line() )[ c.col() - 1 ] ) )
+ {
+ while( !c.atEdge( left ) && h->isInWord( m_doc->textLine( c.line() )[ c.col() - 1 ] ) )
+ --c;
+ }
+ else
+ {
+ while( !c.atEdge( left )
+ && !h->isInWord( m_doc->textLine( c.line() )[ c.col() - 1 ] )
+ // in order to stay symmetric to wordLeft()
+ // we must not skip space preceding a non-word sequence
+ && !m_doc->textLine( c.line() )[ c.col() - 1 ].isSpace() )
+ {
+ --c;
+ }
+ }
+
+ updateSelection( c, sel );
+ updateCursor( c );
+}
+
+void KateViewInternal::wordRight( bool sel )
+{
+ WrappingCursor c( this, cursor );
+
+ // We look up into which category the current position falls:
+ // 1. a "word" character
+ // 2. a "non-word" character (except space)
+ // 3. the end of the line
+ // and skip all following characters that fall into this class.
+ // If the skipped characters are followed by space, we skip that too.
+ // The code assumes that space is never part of the word character class.
+
+ KateHighlighting* h = m_doc->highlight();
+ if( c.atEdge( right ) )
+ {
+ ++c;
+ }
+ else if( h->isInWord( m_doc->textLine( c.line() )[ c.col() ] ) )
+ {
+ while( !c.atEdge( right ) && h->isInWord( m_doc->textLine( c.line() )[ c.col() ] ) )
+ ++c;
+ }
+ else
+ {
+ while( !c.atEdge( right )
+ && !h->isInWord( m_doc->textLine( c.line() )[ c.col() ] )
+ // we must not skip space, because if that space is followed
+ // by more non-word characters, we would skip them, too
+ && !m_doc->textLine( c.line() )[ c.col() ].isSpace() )
+ {
+ ++c;
+ }
+ }
+
+ while( !c.atEdge( right ) && m_doc->textLine( c.line() )[ c.col() ].isSpace() )
+ ++c;
+
+ updateSelection( c, sel );
+ updateCursor( c );
+}
+
+void KateViewInternal::moveEdge( Bias bias, bool sel )
+{
+ BoundedCursor c( this, cursor );
+ c.toEdge( bias );
+ updateSelection( c, sel );
+ updateCursor( c );
+}
+
+void KateViewInternal::home( bool sel )
+{
+ if (m_view->m_codeCompletion->codeCompletionVisible()) {
+ QKeyEvent e(QEvent::KeyPress, Qt::Key_Home, 0, 0);
+ m_view->m_codeCompletion->handleKey(&e);
+ return;
+ }
+
+ if (m_view->dynWordWrap() && currentRange().startCol) {
+ // Allow us to go to the real start if we're already at the start of the view line
+ if (cursor.col() != currentRange().startCol) {
+ KateTextCursor c(cursor.line(), currentRange().startCol);
+ updateSelection( c, sel );
+ updateCursor( c );
+ return;
+ }
+ }
+
+ if( !(m_doc->configFlags() & KateDocument::cfSmartHome) ) {
+ moveEdge( left, sel );
+ return;
+ }
+
+ KateTextLine::Ptr l = textLine( cursor.line() );
+
+ if (!l)
+ return;
+
+ KateTextCursor c = cursor;
+ int lc = l->firstChar();
+
+ if( lc < 0 || c.col() == lc ) {
+ c.setCol(0);
+ } else {
+ c.setCol(lc);
+ }
+
+ updateSelection( c, sel );
+ updateCursor( c, true );
+}
+
+void KateViewInternal::end( bool sel )
+{
+ if (m_view->m_codeCompletion->codeCompletionVisible()) {
+ QKeyEvent e(QEvent::KeyPress, Qt::Key_End, 0, 0);
+ m_view->m_codeCompletion->handleKey(&e);
+ return;
+ }
+
+ KateLineRange range = currentRange();
+
+ if (m_view->dynWordWrap() && range.wrap) {
+ // Allow us to go to the real end if we're already at the end of the view line
+ if (cursor.col() < range.endCol - 1) {
+ KateTextCursor c(cursor.line(), range.endCol - 1);
+ updateSelection( c, sel );
+ updateCursor( c );
+ return;
+ }
+ }
+
+ if( !(m_doc->configFlags() & KateDocument::cfSmartHome) ) {
+ moveEdge( right, sel );
+ return;
+ }
+
+ KateTextLine::Ptr l = textLine( cursor.line() );
+
+ if (!l)
+ return;
+
+ // "Smart End", as requested in bugs #78258 and #106970
+ KateTextCursor c = cursor;
+
+ // If the cursor is already the real end, jump to last non-space character.
+ // Otherwise, go to the real end ... obviously.
+ if (c.col() == m_doc->lineLength(c.line())) {
+ c.setCol(l->lastChar() + 1);
+ updateSelection(c, sel);
+ updateCursor(c, true);
+ } else {
+ moveEdge(right, sel);
+ }
+}
+
+KateLineRange KateViewInternal::range(int realLine, const KateLineRange* previous)
+{
+ // look at the cache first
+ if (!m_updatingView && realLine >= lineRanges[0].line && realLine <= lineRanges[lineRanges.count() - 1].line)
+ for (uint i = 0; i < lineRanges.count(); i++)
+ if (realLine == lineRanges[i].line)
+ if (!m_view->dynWordWrap() || (!previous && lineRanges[i].startCol == 0) || (previous && lineRanges[i].startCol == previous->endCol))
+ return lineRanges[i];
+
+ // Not in the cache, we have to create it
+ KateLineRange ret;
+
+ KateTextLine::Ptr text = textLine(realLine);
+ if (!text) {
+ return KateLineRange();
+ }
+
+ if (!m_view->dynWordWrap()) {
+ Q_ASSERT(!previous);
+ ret.line = realLine;
+ ret.virtualLine = m_doc->getVirtualLine(realLine);
+ ret.startCol = 0;
+ ret.endCol = m_doc->lineLength(realLine);
+ ret.startX = 0;
+ ret.endX = m_view->renderer()->textWidth(text, -1);
+ ret.viewLine = 0;
+ ret.wrap = false;
+ return ret;
+ }
+
+ ret.endCol = (int)m_view->renderer()->textWidth(text, previous ? previous->endCol : 0, width() - (previous ? previous->shiftX : 0), &ret.wrap, &ret.endX);
+
+ Q_ASSERT(ret.endCol > ret.startCol);
+
+ ret.line = realLine;
+
+ if (previous) {
+ ret.virtualLine = previous->virtualLine;
+ ret.startCol = previous->endCol;
+ ret.startX = previous->endX;
+ ret.endX += previous->endX;
+ ret.shiftX = previous->shiftX;
+ ret.viewLine = previous->viewLine + 1;
+
+ } else {
+ // TODO worthwhile optimising this to get the data out of the initial textWidth call?
+ if (m_view->config()->dynWordWrapAlignIndent() > 0) {
+ int pos = text->nextNonSpaceChar(0);
+
+ if (pos > 0)
+ ret.shiftX = m_view->renderer()->textWidth(text, pos);
+
+ if (ret.shiftX > ((double)width() / 100 * m_view->config()->dynWordWrapAlignIndent()))
+ ret.shiftX = 0;
+ }
+
+ ret.virtualLine = m_doc->getVirtualLine(realLine);
+ ret.startCol = 0;
+ ret.startX = 0;
+ ret.viewLine = 0;
+ }
+
+ return ret;
+}
+
+KateLineRange KateViewInternal::currentRange()
+{
+// Q_ASSERT(m_view->dynWordWrap());
+
+ return range(cursor);
+}
+
+KateLineRange KateViewInternal::previousRange()
+{
+ uint currentViewLine = viewLine(cursor);
+
+ if (currentViewLine)
+ return range(cursor.line(), currentViewLine - 1);
+ else
+ return range(m_doc->getRealLine(displayCursor.line() - 1), -1);
+}
+
+KateLineRange KateViewInternal::nextRange()
+{
+ uint currentViewLine = viewLine(cursor) + 1;
+
+ if (currentViewLine >= viewLineCount(cursor.line())) {
+ currentViewLine = 0;
+ return range(cursor.line() + 1, currentViewLine);
+ } else {
+ return range(cursor.line(), currentViewLine);
+ }
+}
+
+KateLineRange KateViewInternal::range(const KateTextCursor& realCursor)
+{
+// Q_ASSERT(m_view->dynWordWrap());
+
+ KateLineRange thisRange;
+ bool first = true;
+
+ do {
+ thisRange = range(realCursor.line(), first ? 0L : &thisRange);
+ first = false;
+ } while (thisRange.wrap && !(realCursor.col() >= thisRange.startCol && realCursor.col() < thisRange.endCol) && thisRange.startCol != thisRange.endCol);
+
+ return thisRange;
+}
+
+KateLineRange KateViewInternal::range(uint realLine, int viewLine)
+{
+// Q_ASSERT(m_view->dynWordWrap());
+
+ KateLineRange thisRange;
+ bool first = true;
+
+ do {
+ thisRange = range(realLine, first ? 0L : &thisRange);
+ first = false;
+ } while (thisRange.wrap && viewLine != thisRange.viewLine && thisRange.startCol != thisRange.endCol);
+
+ if (viewLine != -1 && viewLine != thisRange.viewLine)
+ kdDebug(13030) << "WARNING: viewLine " << viewLine << " of line " << realLine << " does not exist." << endl;
+
+ return thisRange;
+}
+
+/**
+ * This returns the view line upon which realCursor is situated.
+ * The view line is the number of lines in the view from the first line
+ * The supplied cursor should be in real lines.
+ */
+uint KateViewInternal::viewLine(const KateTextCursor& realCursor)
+{
+ if (!m_view->dynWordWrap()) return 0;
+
+ if (realCursor.col() == 0) return 0;
+
+ KateLineRange thisRange;
+ bool first = true;
+
+ do {
+ thisRange = range(realCursor.line(), first ? 0L : &thisRange);
+ first = false;
+ } while (thisRange.wrap && !(realCursor.col() >= thisRange.startCol && realCursor.col() < thisRange.endCol) && thisRange.startCol != thisRange.endCol);
+
+ return thisRange.viewLine;
+}
+
+int KateViewInternal::displayViewLine(const KateTextCursor& virtualCursor, bool limitToVisible)
+{
+ KateTextCursor work = startPos();
+
+ int limit = linesDisplayed();
+
+ // Efficient non-word-wrapped path
+ if (!m_view->dynWordWrap()) {
+ int ret = virtualCursor.line() - startLine();
+ if (limitToVisible && (ret < 0 || ret > limit))
+ return -1;
+ else
+ return ret;
+ }
+
+ if (work == virtualCursor) {
+ return 0;
+ }
+
+ int ret = -(int)viewLine(work);
+ bool forwards = (work < virtualCursor) ? true : false;
+
+ // FIXME switch to using ranges? faster?
+ if (forwards) {
+ while (work.line() != virtualCursor.line()) {
+ ret += viewLineCount(m_doc->getRealLine(work.line()));
+ work.setLine(work.line() + 1);
+ if (limitToVisible && ret > limit)
+ return -1;
+ }
+ } else {
+ while (work.line() != virtualCursor.line()) {
+ work.setLine(work.line() - 1);
+ ret -= viewLineCount(m_doc->getRealLine(work.line()));
+ if (limitToVisible && ret < 0)
+ return -1;
+ }
+ }
+
+ // final difference
+ KateTextCursor realCursor = virtualCursor;
+ realCursor.setLine(m_doc->getRealLine(realCursor.line()));
+ if (realCursor.col() == -1) realCursor.setCol(m_doc->lineLength(realCursor.line()));
+ ret += viewLine(realCursor);
+
+ if (limitToVisible && (ret < 0 || ret > limit))
+ return -1;
+
+ return ret;
+}
+
+uint KateViewInternal::lastViewLine(uint realLine)
+{
+ if (!m_view->dynWordWrap()) return 0;
+
+ KateLineRange thisRange;
+ bool first = true;
+
+ do {
+ thisRange = range(realLine, first ? 0L : &thisRange);
+ first = false;
+ } while (thisRange.wrap && thisRange.startCol != thisRange.endCol);
+
+ return thisRange.viewLine;
+}
+
+uint KateViewInternal::viewLineCount(uint realLine)
+{
+ return lastViewLine(realLine) + 1;
+}
+
+/*
+ * This returns the cursor which is offset by (offset) view lines.
+ * This is the main function which is called by code not specifically dealing with word-wrap.
+ * The opposite conversion (cursor to offset) can be done with displayViewLine.
+ *
+ * The cursors involved are virtual cursors (ie. equivalent to displayCursor)
+ */
+KateTextCursor KateViewInternal::viewLineOffset(const KateTextCursor& virtualCursor, int offset, bool keepX)
+{
+ if (!m_view->dynWordWrap()) {
+ KateTextCursor ret(kMin((int)m_doc->visibleLines() - 1, virtualCursor.line() + offset), 0);
+
+ if (ret.line() < 0)
+ ret.setLine(0);
+
+ if (keepX) {
+ int realLine = m_doc->getRealLine(ret.line());
+ ret.setCol(m_doc->lineLength(realLine) - 1);
+
+ if (m_currentMaxX > cXPos)
+ cXPos = m_currentMaxX;
+
+ if (m_view->wrapCursor())
+ cXPos = kMin(cXPos, (int)m_view->renderer()->textWidth(textLine(realLine), m_doc->lineLength(realLine)));
+
+ m_view->renderer()->textWidth(ret, cXPos);
+ }
+
+ return ret;
+ }
+
+ KateTextCursor realCursor = virtualCursor;
+ realCursor.setLine(m_doc->getRealLine(virtualCursor.line()));
+
+ uint cursorViewLine = viewLine(realCursor);
+
+ int currentOffset = 0;
+ int virtualLine = 0;
+
+ bool forwards = (offset > 0) ? true : false;
+
+ if (forwards) {
+ currentOffset = lastViewLine(realCursor.line()) - cursorViewLine;
+ if (offset <= currentOffset) {
+ // the answer is on the same line
+ KateLineRange thisRange = range(realCursor.line(), cursorViewLine + offset);
+ Q_ASSERT(thisRange.virtualLine == virtualCursor.line());
+ return KateTextCursor(virtualCursor.line(), thisRange.startCol);
+ }
+
+ virtualLine = virtualCursor.line() + 1;
+
+ } else {
+ offset = -offset;
+ currentOffset = cursorViewLine;
+ if (offset <= currentOffset) {
+ // the answer is on the same line
+ KateLineRange thisRange = range(realCursor.line(), cursorViewLine - offset);
+ Q_ASSERT(thisRange.virtualLine == virtualCursor.line());
+ return KateTextCursor(virtualCursor.line(), thisRange.startCol);
+ }
+
+ virtualLine = virtualCursor.line() - 1;
+ }
+
+ currentOffset++;
+
+ while (virtualLine >= 0 && virtualLine < (int)m_doc->visibleLines())
+ {
+ KateLineRange thisRange;
+ bool first = true;
+ int realLine = m_doc->getRealLine(virtualLine);
+
+ do {
+ thisRange = range(realLine, first ? 0L : &thisRange);
+ first = false;
+
+ if (offset == currentOffset) {
+ if (!forwards) {
+ // We actually want it the other way around
+ int requiredViewLine = lastViewLine(realLine) - thisRange.viewLine;
+ if (requiredViewLine != thisRange.viewLine) {
+ thisRange = range(realLine, requiredViewLine);
+ }
+ }
+
+ KateTextCursor ret(virtualLine, thisRange.startCol);
+
+ // keep column position
+ if (keepX) {
+ ret.setCol(thisRange.endCol - 1);
+ KateTextCursor realCursorTemp(m_doc->getRealLine(virtualCursor.line()), virtualCursor.col());
+ int visibleX = m_view->renderer()->textWidth(realCursorTemp) - range(realCursorTemp).startX;
+ int xOffset = thisRange.startX;
+
+ if (m_currentMaxX > visibleX)
+ visibleX = m_currentMaxX;
+
+ cXPos = xOffset + visibleX;
+
+ cXPos = kMin(cXPos, lineMaxCursorX(thisRange));
+
+ m_view->renderer()->textWidth(ret, cXPos);
+ }
+
+ return ret;
+ }
+
+ currentOffset++;
+
+ } while (thisRange.wrap);
+
+ if (forwards)
+ virtualLine++;
+ else
+ virtualLine--;
+ }
+
+ // Looks like we were asked for something a bit exotic.
+ // Return the max/min valid position.
+ if (forwards)
+ return KateTextCursor(m_doc->visibleLines() - 1, m_doc->lineLength(m_doc->visibleLines() - 1));
+ else
+ return KateTextCursor(0, 0);
+}
+
+int KateViewInternal::lineMaxCursorX(const KateLineRange& range)
+{
+ if (!m_view->wrapCursor() && !range.wrap)
+ return INT_MAX;
+
+ int maxX = range.endX;
+
+ if (maxX && range.wrap) {
+ QChar lastCharInLine = textLine(range.line)->getChar(range.endCol - 1);
+
+ if (lastCharInLine == QChar('\t')) {
+ int lineSize = 0;
+ int lastTabSize = 0;
+ for(int i = range.startCol; i < range.endCol; i++) {
+ if (textLine(range.line)->getChar(i) == QChar('\t')) {
+ lastTabSize = m_view->tabWidth() - (lineSize % m_view->tabWidth());
+ lineSize += lastTabSize;
+ } else {
+ lineSize++;
+ }
+ }
+ maxX -= lastTabSize * m_view->renderer()->spaceWidth();
+ } else {
+ maxX -= m_view->renderer()->config()->fontMetrics()->width(lastCharInLine);
+ }
+ }
+
+ return maxX;
+}
+
+int KateViewInternal::lineMaxCol(const KateLineRange& range)
+{
+ int maxCol = range.endCol;
+
+ if (maxCol && range.wrap)
+ maxCol--;
+
+ return maxCol;
+}
+
+void KateViewInternal::cursorUp(bool sel)
+{
+ if (m_view->m_codeCompletion->codeCompletionVisible()) {
+ QKeyEvent e(QEvent::KeyPress, Qt::Key_Up, 0, 0);
+ m_view->m_codeCompletion->handleKey(&e);
+ return;
+ }
+
+ if (displayCursor.line() == 0 && (!m_view->dynWordWrap() || viewLine(cursor) == 0))
+ return;
+
+ int newLine = cursor.line(), newCol = 0, xOffset = 0, startCol = 0;
+ m_preserveMaxX = true;
+
+ if (m_view->dynWordWrap()) {
+ // Dynamic word wrapping - navigate on visual lines rather than real lines
+ KateLineRange thisRange = currentRange();
+ // This is not the first line because that is already simplified out above
+ KateLineRange pRange = previousRange();
+
+ // Ensure we're in the right spot
+ Q_ASSERT((cursor.line() == thisRange.line) &&
+ (cursor.col() >= thisRange.startCol) &&
+ (!thisRange.wrap || cursor.col() < thisRange.endCol));
+
+ // VisibleX is the distance from the start of the text to the cursor on the current line.
+ int visibleX = m_view->renderer()->textWidth(cursor) - thisRange.startX;
+ int currentLineVisibleX = visibleX;
+
+ // Translate to new line
+ visibleX += thisRange.xOffset();
+ visibleX -= pRange.xOffset();
+
+ // Limit to >= 0
+ visibleX = kMax(0, visibleX);
+
+ startCol = pRange.startCol;
+ xOffset = pRange.startX;
+ newLine = pRange.line;
+
+ // Take into account current max X (ie. if the current line was smaller
+ // than the last definitely specified width)
+ if (thisRange.xOffset() && !pRange.xOffset() && currentLineVisibleX == 0) // Special case for where xOffset may be > m_currentMaxX
+ visibleX = m_currentMaxX;
+ else if (visibleX < m_currentMaxX - pRange.xOffset())
+ visibleX = m_currentMaxX - pRange.xOffset();
+
+ cXPos = xOffset + visibleX;
+
+ cXPos = kMin(cXPos, lineMaxCursorX(pRange));
+
+ newCol = kMin((int)m_view->renderer()->textPos(newLine, visibleX, startCol), lineMaxCol(pRange));
+
+ } else {
+ newLine = m_doc->getRealLine(displayCursor.line() - 1);
+
+ if ((m_view->wrapCursor()) && m_currentMaxX > cXPos)
+ cXPos = m_currentMaxX;
+ }
+
+ KateTextCursor c(newLine, newCol);
+ m_view->renderer()->textWidth(c, cXPos);
+
+ updateSelection( c, sel );
+ updateCursor( c );
+}
+
+void KateViewInternal::cursorDown(bool sel)
+{
+ if (m_view->m_codeCompletion->codeCompletionVisible()) {
+ QKeyEvent e(QEvent::KeyPress, Qt::Key_Down, 0, 0);
+ m_view->m_codeCompletion->handleKey(&e);
+ return;
+ }
+
+ if ((displayCursor.line() >= (int)m_doc->numVisLines() - 1) && (!m_view->dynWordWrap() || viewLine(cursor) == lastViewLine(cursor.line())))
+ return;
+
+ int newLine = cursor.line(), newCol = 0, xOffset = 0, startCol = 0;
+ m_preserveMaxX = true;
+
+ if (m_view->dynWordWrap()) {
+ // Dynamic word wrapping - navigate on visual lines rather than real lines
+ KateLineRange thisRange = currentRange();
+ // This is not the last line because that is already simplified out above
+ KateLineRange nRange = nextRange();
+
+ // Ensure we're in the right spot
+ Q_ASSERT((cursor.line() == thisRange.line) &&
+ (cursor.col() >= thisRange.startCol) &&
+ (!thisRange.wrap || cursor.col() < thisRange.endCol));
+
+ // VisibleX is the distance from the start of the text to the cursor on the current line.
+ int visibleX = m_view->renderer()->textWidth(cursor) - thisRange.startX;
+ int currentLineVisibleX = visibleX;
+
+ // Translate to new line
+ visibleX += thisRange.xOffset();
+ visibleX -= nRange.xOffset();
+
+ // Limit to >= 0
+ visibleX = kMax(0, visibleX);
+
+ if (!thisRange.wrap) {
+ newLine = m_doc->getRealLine(displayCursor.line() + 1);
+ } else {
+ startCol = thisRange.endCol;
+ xOffset = thisRange.endX;
+ }
+
+ // Take into account current max X (ie. if the current line was smaller
+ // than the last definitely specified width)
+ if (thisRange.xOffset() && !nRange.xOffset() && currentLineVisibleX == 0) // Special case for where xOffset may be > m_currentMaxX
+ visibleX = m_currentMaxX;
+ else if (visibleX < m_currentMaxX - nRange.xOffset())
+ visibleX = m_currentMaxX - nRange.xOffset();
+
+ cXPos = xOffset + visibleX;
+
+ cXPos = kMin(cXPos, lineMaxCursorX(nRange));
+
+ newCol = kMin((int)m_view->renderer()->textPos(newLine, visibleX, startCol), lineMaxCol(nRange));
+
+ } else {
+ newLine = m_doc->getRealLine(displayCursor.line() + 1);
+
+ if ((m_view->wrapCursor()) && m_currentMaxX > cXPos)
+ cXPos = m_currentMaxX;
+ }
+
+ KateTextCursor c(newLine, newCol);
+ m_view->renderer()->textWidth(c, cXPos);
+
+ updateSelection(c, sel);
+ updateCursor(c);
+}
+
+void KateViewInternal::cursorToMatchingBracket( bool sel )
+{
+ KateTextCursor start( cursor ), end;
+
+ if( !m_doc->findMatchingBracket( start, end ) )
+ return;
+
+ // The cursor is now placed just to the left of the matching bracket.
+ // If it's an ending bracket, put it to the right (so we can easily
+ // get back to the original bracket).
+ if( end > start )
+ end.setCol(end.col() + 1);
+
+ updateSelection( end, sel );
+ updateCursor( end );
+}
+
+void KateViewInternal::topOfView( bool sel )
+{
+ KateTextCursor c = viewLineOffset(startPos(), m_minLinesVisible);
+ updateSelection( c, sel );
+ updateCursor( c );
+}
+
+void KateViewInternal::bottomOfView( bool sel )
+{
+ // FIXME account for wordwrap
+ KateTextCursor c = viewLineOffset(endPos(), -m_minLinesVisible);
+ updateSelection( c, sel );
+ updateCursor( c );
+}
+
+// lines is the offset to scroll by
+void KateViewInternal::scrollLines( int lines, bool sel )
+{
+ KateTextCursor c = viewLineOffset(displayCursor, lines, true);
+
+ // Fix the virtual cursor -> real cursor
+ c.setLine(m_doc->getRealLine(c.line()));
+
+ updateSelection( c, sel );
+ updateCursor( c );
+}
+
+// This is a bit misleading... it's asking for the view to be scrolled, not the cursor
+void KateViewInternal::scrollUp()
+{
+ KateTextCursor newPos = viewLineOffset(m_startPos, -1);
+ scrollPos(newPos);
+}
+
+void KateViewInternal::scrollDown()
+{
+ KateTextCursor newPos = viewLineOffset(m_startPos, 1);
+ scrollPos(newPos);
+}
+
+void KateViewInternal::setAutoCenterLines(int viewLines, bool updateView)
+{
+ m_autoCenterLines = viewLines;
+ m_minLinesVisible = kMin(int((linesDisplayed() - 1)/2), m_autoCenterLines);
+ if (updateView)
+ KateViewInternal::updateView();
+}
+
+void KateViewInternal::pageUp( bool sel )
+{
+ if (m_view->m_codeCompletion->codeCompletionVisible()) {
+ QKeyEvent e(QEvent::KeyPress, Qt::Key_PageUp, 0, 0);
+ m_view->m_codeCompletion->handleKey(&e);
+ return;
+ }
+
+ // remember the view line and x pos
+ int viewLine = displayViewLine(displayCursor);
+ bool atTop = (startPos().line() == 0 && startPos().col() == 0);
+
+ // Adjust for an auto-centering cursor
+ int lineadj = 2 * m_minLinesVisible;
+ int cursorStart = (linesDisplayed() - 1) - viewLine;
+ if (cursorStart < m_minLinesVisible)
+ lineadj -= m_minLinesVisible - cursorStart;
+
+ int linesToScroll = -kMax( ((int)linesDisplayed() - 1) - lineadj, 0 );
+ m_preserveMaxX = true;
+
+ if (!m_doc->pageUpDownMovesCursor () && !atTop) {
+ int xPos = m_view->renderer()->textWidth(cursor) - currentRange().startX;
+
+ KateTextCursor newStartPos = viewLineOffset(startPos(), linesToScroll - 1);
+ scrollPos(newStartPos);
+
+ // put the cursor back approximately where it was
+ KateTextCursor newPos = viewLineOffset(newStartPos, viewLine, true);
+ newPos.setLine(m_doc->getRealLine(newPos.line()));
+
+ KateLineRange newLine = range(newPos);
+
+ if (m_currentMaxX - newLine.xOffset() > xPos)
+ xPos = m_currentMaxX - newLine.xOffset();
+
+ cXPos = kMin(newLine.startX + xPos, lineMaxCursorX(newLine));
+
+ m_view->renderer()->textWidth( newPos, cXPos );
+
+ m_preserveMaxX = true;
+ updateSelection( newPos, sel );
+ updateCursor(newPos);
+
+ } else {
+ scrollLines( linesToScroll, sel );
+ }
+}
+
+void KateViewInternal::pageDown( bool sel )
+{
+ if (m_view->m_codeCompletion->codeCompletionVisible()) {
+ QKeyEvent e(QEvent::KeyPress, Qt::Key_PageDown, 0, 0);
+ m_view->m_codeCompletion->handleKey(&e);
+ return;
+ }
+
+ // remember the view line
+ int viewLine = displayViewLine(displayCursor);
+ bool atEnd = startPos() >= m_cachedMaxStartPos;
+
+ // Adjust for an auto-centering cursor
+ int lineadj = 2 * m_minLinesVisible;
+ int cursorStart = m_minLinesVisible - viewLine;
+ if (cursorStart > 0)
+ lineadj -= cursorStart;
+
+ int linesToScroll = kMax( ((int)linesDisplayed() - 1) - lineadj, 0 );
+ m_preserveMaxX = true;
+
+ if (!m_doc->pageUpDownMovesCursor () && !atEnd) {
+ int xPos = m_view->renderer()->textWidth(cursor) - currentRange().startX;
+
+ KateTextCursor newStartPos = viewLineOffset(startPos(), linesToScroll + 1);
+ scrollPos(newStartPos);
+
+ // put the cursor back approximately where it was
+ KateTextCursor newPos = viewLineOffset(newStartPos, viewLine, true);
+ newPos.setLine(m_doc->getRealLine(newPos.line()));
+
+ KateLineRange newLine = range(newPos);
+
+ if (m_currentMaxX - newLine.xOffset() > xPos)
+ xPos = m_currentMaxX - newLine.xOffset();
+
+ cXPos = kMin(newLine.startX + xPos, lineMaxCursorX(newLine));
+
+ m_view->renderer()->textWidth( newPos, cXPos );
+
+ m_preserveMaxX = true;
+ updateSelection( newPos, sel );
+ updateCursor(newPos);
+
+ } else {
+ scrollLines( linesToScroll, sel );
+ }
+}
+
+int KateViewInternal::maxLen(uint startLine)
+{
+// Q_ASSERT(!m_view->dynWordWrap());
+
+ int displayLines = (m_view->height() / m_view->renderer()->fontHeight()) + 1;
+
+ int maxLen = 0;
+
+ for (int z = 0; z < displayLines; z++) {
+ int virtualLine = startLine + z;
+
+ if (virtualLine < 0 || virtualLine >= (int)m_doc->visibleLines())
+ break;
+
+ KateLineRange thisRange = range((int)m_doc->getRealLine(virtualLine));
+
+ maxLen = kMax(maxLen, thisRange.endX);
+ }
+
+ return maxLen;
+}
+
+void KateViewInternal::top( bool sel )
+{
+ KateTextCursor c( 0, cursor.col() );
+ m_view->renderer()->textWidth( c, cXPos );
+ updateSelection( c, sel );
+ updateCursor( c );
+}
+
+void KateViewInternal::bottom( bool sel )
+{
+ KateTextCursor c( m_doc->lastLine(), cursor.col() );
+ m_view->renderer()->textWidth( c, cXPos );
+ updateSelection( c, sel );
+ updateCursor( c );
+}
+
+void KateViewInternal::top_home( bool sel )
+{
+ if (m_view->m_codeCompletion->codeCompletionVisible()) {
+ QKeyEvent e(QEvent::KeyPress, Qt::Key_Home, 0, 0);
+ m_view->m_codeCompletion->handleKey(&e);
+ return;
+ }
+ KateTextCursor c( 0, 0 );
+ updateSelection( c, sel );
+ updateCursor( c );
+}
+
+void KateViewInternal::bottom_end( bool sel )
+{
+ if (m_view->m_codeCompletion->codeCompletionVisible()) {
+ QKeyEvent e(QEvent::KeyPress, Qt::Key_End, 0, 0);
+ m_view->m_codeCompletion->handleKey(&e);
+ return;
+ }
+ KateTextCursor c( m_doc->lastLine(), m_doc->lineLength( m_doc->lastLine() ) );
+ updateSelection( c, sel );
+ updateCursor( c );
+}
+
+void KateViewInternal::updateSelection( const KateTextCursor& _newCursor, bool keepSel )
+{
+ KateTextCursor newCursor = _newCursor;
+ if( keepSel )
+ {
+ if ( !m_view->hasSelection() || (selectAnchor.line() == -1)
+ || (m_view->config()->persistentSelection()
+ && ((cursor < m_view->selectStart) || (cursor > m_view->selectEnd))) )
+ {
+ selectAnchor = cursor;
+ m_view->setSelection( cursor, newCursor );
+ }
+ else
+ {
+ bool doSelect = true;
+ switch (m_selectionMode)
+ {
+ case Word:
+ {
+ // Restore selStartCached if needed. It gets nuked by
+ // viewSelectionChanged if we drag the selection into non-existence,
+ // which can legitimately happen if a shift+DC selection is unable to
+ // set a "proper" (i.e. non-empty) cached selection, e.g. because the
+ // start was on something that isn't a word. Word select mode relies
+ // on the cached selection being set properly, even if it is empty
+ // (i.e. selStartCached == selEndCached).
+ if ( selStartCached.line() == -1 )
+ selStartCached = selEndCached;
+
+ int c;
+ if ( newCursor > selEndCached )
+ {
+ selectAnchor = selStartCached;
+
+ KateTextLine::Ptr l = m_doc->kateTextLine( newCursor.line() );
+
+ c = newCursor.col();
+ if ( c > 0 && m_doc->highlight()->isInWord( l->getChar( c-1 ) ) ) {
+ for (; c < l->length(); c++ )
+ if ( !m_doc->highlight()->isInWord( l->getChar( c ) ) )
+ break;
+ }
+
+ newCursor.setCol( c );
+ }
+ else if ( newCursor < selStartCached )
+ {
+ selectAnchor = selEndCached;
+
+ KateTextLine::Ptr l = m_doc->kateTextLine( newCursor.line() );
+
+ c = newCursor.col();
+ if ( c > 0 && c < m_doc->textLine( newCursor.line() ).length()
+ && m_doc->highlight()->isInWord( l->getChar( c ) )
+ && m_doc->highlight()->isInWord( l->getChar( c-1 ) ) ) {
+ for ( c -= 2; c >= 0; c-- )
+ if ( !m_doc->highlight()->isInWord( l->getChar( c ) ) )
+ break;
+ newCursor.setCol( c+1 );
+ }
+
+ }
+ else
+ doSelect = false;
+
+ }
+ break;
+ case Line:
+ if ( newCursor.line() > selStartCached.line() )
+ {
+ if ( newCursor.line()+1 >= m_doc->numLines() )
+ newCursor.setCol( m_doc->textLine( newCursor.line() ).length() );
+ else
+ newCursor.setPos( newCursor.line() + 1, 0 );
+ // Grow to include entire line
+ selectAnchor = selStartCached;
+ selectAnchor.setCol( 0 );
+ }
+ else if ( newCursor.line() < selStartCached.line() )
+ {
+ newCursor.setCol( 0 );
+ // Grow to include entire line
+ selectAnchor = selEndCached;
+ if ( selectAnchor.col() > 0 )
+ {
+ if ( selectAnchor.line()+1 >= m_doc->numLines() )
+ selectAnchor.setCol( m_doc->textLine( selectAnchor.line() ).length() );
+ else
+ selectAnchor.setPos( selectAnchor.line() + 1, 0 );
+ }
+ }
+ else // same line, ignore
+ doSelect = false;
+ break;
+ case Mouse:
+ {
+ if ( selStartCached.line() < 0 ) // invalid
+ break;
+
+ if ( newCursor > selEndCached )
+ selectAnchor = selStartCached;
+ else if ( newCursor < selStartCached )
+ selectAnchor = selEndCached;
+ else
+ doSelect = false;
+ }
+ break;
+ default:
+ {
+ if ( selectAnchor.line() < 0 ) // invalid
+ break;
+ }
+ }
+
+ if ( doSelect )
+ m_view->setSelection( selectAnchor, newCursor);
+ else if ( selStartCached.line() >= 0 ) // we have a cached selection, so we restore that
+ m_view->setSelection( selStartCached, selEndCached );
+ }
+
+ m_selChangedByUser = true;
+ }
+ else if ( !m_view->config()->persistentSelection() )
+ {
+ m_view->clearSelection();
+ selStartCached.setLine( -1 );
+ selectAnchor.setLine( -1 );
+ }
+}
+
+void KateViewInternal::updateCursor( const KateTextCursor& newCursor, bool force, bool center, bool calledExternally )
+{
+ if ( !force && (cursor == newCursor) )
+ {
+ if ( !m_madeVisible && m_view == m_doc->activeView() )
+ {
+ // unfold if required
+ m_doc->foldingTree()->ensureVisible( newCursor.line() );
+
+ makeVisible ( displayCursor, displayCursor.col(), false, center, calledExternally );
+ }
+
+ return;
+ }
+
+ // unfold if required
+ m_doc->foldingTree()->ensureVisible( newCursor.line() );
+
+ KateTextCursor oldDisplayCursor = displayCursor;
+
+ cursor.setPos (newCursor);
+ displayCursor.setPos (m_doc->getVirtualLine(cursor.line()), cursor.col());
+
+ cXPos = m_view->renderer()->textWidth( cursor );
+ if (m_view == m_doc->activeView())
+ makeVisible ( displayCursor, displayCursor.col(), false, center, calledExternally );
+
+ updateBracketMarks();
+
+ // It's efficient enough to just tag them both without checking to see if they're on the same view line
+ tagLine(oldDisplayCursor);
+ tagLine(displayCursor);
+
+ updateMicroFocusHint();
+
+ if (m_cursorTimer.isActive ())
+ {
+ if ( KApplication::cursorFlashTime() > 0 )
+ m_cursorTimer.start( KApplication::cursorFlashTime() / 2 );
+ m_view->renderer()->setDrawCaret(true);
+ }
+
+ // Remember the maximum X position if requested
+ if (m_preserveMaxX)
+ m_preserveMaxX = false;
+ else
+ if (m_view->dynWordWrap())
+ m_currentMaxX = m_view->renderer()->textWidth(displayCursor) - currentRange().startX + currentRange().xOffset();
+ else
+ m_currentMaxX = cXPos;
+
+ //kdDebug() << "m_currentMaxX: " << m_currentMaxX << " (was "<< oldmaxx << "), cXPos: " << cXPos << endl;
+ //kdDebug(13030) << "Cursor now located at real " << cursor.line << "," << cursor.col << ", virtual " << displayCursor.line << ", " << displayCursor.col << "; Top is " << startLine() << ", " << startPos().col << endl;
+
+ paintText(0, 0, width(), height(), true);
+
+ emit m_view->cursorPositionChanged();
+}
+
+void KateViewInternal::updateBracketMarks()
+{
+ if ( bm.isValid() ) {
+ KateTextCursor bmStart(m_doc->getVirtualLine(bm.start().line()), bm.start().col());
+ KateTextCursor bmEnd(m_doc->getVirtualLine(bm.end().line()), bm.end().col());
+
+ if( bm.getMinIndent() != 0 )
+ {
+ // @@ Do this only when cursor near start/end.
+ if( bmStart > bmEnd )
+ {
+ tagLines(bmEnd, bmStart);
+ }
+ else
+ {
+ tagLines(bmStart, bmEnd);
+ }
+ }
+ else
+ {
+ tagLine(bmStart);
+ tagLine(bmEnd);
+ }
+ }
+
+ // add some limit to this, this is really endless on big files without limit
+ int maxLines = linesDisplayed () * 3;
+ m_doc->newBracketMark( cursor, bm, maxLines );
+
+ if ( bm.isValid() ) {
+ KateTextCursor bmStart(m_doc->getVirtualLine(bm.start().line()), bm.start().col());
+ KateTextCursor bmEnd(m_doc->getVirtualLine(bm.end().line()), bm.end().col());
+
+ if( bm.getMinIndent() != 0 )
+ {
+ // @@ Do this only when cursor near start/end.
+ if( bmStart > bmEnd )
+ {
+ tagLines(bmEnd, bmStart);
+ }
+ else
+ {
+ tagLines(bmStart, bmEnd);
+ }
+ }
+ else
+ {
+ tagLine(bmStart);
+ tagLine(bmEnd);
+ }
+ }
+}
+
+bool KateViewInternal::tagLine(const KateTextCursor& virtualCursor)
+{
+ int viewLine = displayViewLine(virtualCursor, true);
+ if (viewLine >= 0 && viewLine < (int)lineRanges.count()) {
+ lineRanges[viewLine].dirty = true;
+ leftBorder->update (0, lineToY(viewLine), leftBorder->width(), m_view->renderer()->fontHeight());
+ return true;
+ }
+ return false;
+}
+
+bool KateViewInternal::tagLines( int start, int end, bool realLines )
+{
+ return tagLines(KateTextCursor(start, 0), KateTextCursor(end, -1), realLines);
+}
+
+bool KateViewInternal::tagLines(KateTextCursor start, KateTextCursor end, bool realCursors)
+{
+ if (realCursors)
+ {
+ //kdDebug()<<"realLines is true"<<endl;
+ start.setLine(m_doc->getVirtualLine( start.line() ));
+ end.setLine(m_doc->getVirtualLine( end.line() ));
+ }
+
+ if (end.line() < (int)startLine())
+ {
+ //kdDebug()<<"end<startLine"<<endl;
+ return false;
+ }
+ if (start.line() > (int)endLine())
+ {
+ //kdDebug()<<"start> endLine"<<start<<" "<<((int)endLine())<<endl;
+ return false;
+ }
+
+ //kdDebug(13030) << "tagLines( [" << start.line << "," << start.col << "], [" << end.line << "," << end.col << "] )\n";
+
+ bool ret = false;
+
+ for (uint z = 0; z < lineRanges.size(); z++)
+ {
+ if ((lineRanges[z].virtualLine > start.line() || (lineRanges[z].virtualLine == start.line() && lineRanges[z].endCol >= start.col() && start.col() != -1)) && (lineRanges[z].virtualLine < end.line() || (lineRanges[z].virtualLine == end.line() && (lineRanges[z].startCol <= end.col() || end.col() == -1)))) {
+ ret = lineRanges[z].dirty = true;
+ //kdDebug() << "Tagged line " << lineRanges[z].line << endl;
+ }
+ }
+
+ if (!m_view->dynWordWrap())
+ {
+ int y = lineToY( start.line() );
+ // FIXME is this enough for when multiple lines are deleted
+ int h = (end.line() - start.line() + 2) * m_view->renderer()->fontHeight();
+ if (end.line() == (int)m_doc->numVisLines() - 1)
+ h = height();
+
+ leftBorder->update (0, y, leftBorder->width(), h);
+ }
+ else
+ {
+ // FIXME Do we get enough good info in editRemoveText to optimise this more?
+ //bool justTagged = false;
+ for (uint z = 0; z < lineRanges.size(); z++)
+ {
+ if ((lineRanges[z].virtualLine > start.line() || (lineRanges[z].virtualLine == start.line() && lineRanges[z].endCol >= start.col() && start.col() != -1)) && (lineRanges[z].virtualLine < end.line() || (lineRanges[z].virtualLine == end.line() && (lineRanges[z].startCol <= end.col() || end.col() == -1))))
+ {
+ //justTagged = true;
+ leftBorder->update (0, z * m_view->renderer()->fontHeight(), leftBorder->width(), leftBorder->height());
+ break;
+ }
+ /*else if (justTagged)
+ {
+ justTagged = false;
+ leftBorder->update (0, z * m_doc->viewFont.fontHeight, leftBorder->width(), m_doc->viewFont.fontHeight);
+ break;
+ }*/
+ }
+ }
+
+ return ret;
+}
+
+void KateViewInternal::tagAll()
+{
+ //kdDebug(13030) << "tagAll()" << endl;
+ for (uint z = 0; z < lineRanges.size(); z++)
+ {
+ lineRanges[z].dirty = true;
+ }
+
+ leftBorder->updateFont();
+ leftBorder->update ();
+}
+
+void KateViewInternal::paintCursor()
+{
+ if (tagLine(displayCursor))
+ paintText (0,0,width(), height(), true);
+}
+
+// Point in content coordinates
+void KateViewInternal::placeCursor( const QPoint& p, bool keepSelection, bool updateSelection )
+{
+ KateLineRange thisRange = yToKateLineRange(p.y());
+
+ if (thisRange.line == -1) {
+ for (int i = (p.y() / m_view->renderer()->fontHeight()); i >= 0; i--) {
+ thisRange = lineRanges[i];
+ if (thisRange.line != -1)
+ break;
+ }
+ Q_ASSERT(thisRange.line != -1);
+ }
+
+ int realLine = thisRange.line;
+ int visibleLine = thisRange.virtualLine;
+ uint startCol = thisRange.startCol;
+
+ visibleLine = kMax( 0, kMin( visibleLine, int(m_doc->numVisLines()) - 1 ) );
+
+ KateTextCursor c(realLine, 0);
+
+ int x = kMin(kMax(-m_startX, p.x() - thisRange.xOffset()), lineMaxCursorX(thisRange) - thisRange.startX);
+
+ m_view->renderer()->textWidth( c, startX() + x, startCol);
+
+ if (updateSelection)
+ KateViewInternal::updateSelection( c, keepSelection );
+
+ updateCursor( c );
+}
+
+// Point in content coordinates
+bool KateViewInternal::isTargetSelected( const QPoint& p )
+{
+ KateLineRange thisRange = yToKateLineRange(p.y());
+
+ KateTextLine::Ptr l = textLine( thisRange.line );
+ if( !l )
+ return false;
+
+ int col = m_view->renderer()->textPos( l, startX() + p.x() - thisRange.xOffset(), thisRange.startCol, false );
+
+ return m_view->lineColSelected( thisRange.line, col );
+}
+
+//BEGIN EVENT HANDLING STUFF
+
+bool KateViewInternal::eventFilter( QObject *obj, QEvent *e )
+{
+ if (obj == m_lineScroll)
+ {
+ // the second condition is to make sure a scroll on the vertical bar doesn't cause a horizontal scroll ;)
+ if (e->type() == QEvent::Wheel && m_lineScroll->minValue() != m_lineScroll->maxValue())
+ {
+ wheelEvent((QWheelEvent*)e);
+ return true;
+ }
+
+ // continue processing
+ return QWidget::eventFilter( obj, e );
+ }
+
+ switch( e->type() )
+ {
+ case QEvent::KeyPress:
+ {
+ QKeyEvent *k = (QKeyEvent *)e;
+
+ if (m_view->m_codeCompletion->codeCompletionVisible ())
+ {
+ kdDebug (13030) << "hint around" << endl;
+
+ if( k->key() == Key_Escape )
+ m_view->m_codeCompletion->abortCompletion();
+ }
+
+ if ((k->key() == Qt::Key_Escape) && !m_view->config()->persistentSelection() )
+ {
+ m_view->clearSelection();
+ return true;
+ }
+ else if ( !((k->state() & ControlButton) || (k->state() & AltButton)) )
+ {
+ keyPressEvent( k );
+ return k->isAccepted();
+ }
+
+ } break;
+
+ case QEvent::DragMove:
+ {
+ QPoint currentPoint = ((QDragMoveEvent*) e)->pos();
+
+ QRect doNotScrollRegion( scrollMargin, scrollMargin,
+ width() - scrollMargin * 2,
+ height() - scrollMargin * 2 );
+
+ if ( !doNotScrollRegion.contains( currentPoint ) )
+ {
+ startDragScroll();
+ // Keep sending move events
+ ( (QDragMoveEvent*)e )->accept( QRect(0,0,0,0) );
+ }
+
+ dragMoveEvent((QDragMoveEvent*)e);
+ } break;
+
+ case QEvent::DragLeave:
+ // happens only when pressing ESC while dragging
+ stopDragScroll();
+ break;
+
+ case QEvent::WindowBlocked:
+ // next focus originates from an internal dialog:
+ // don't show the modonhd prompt
+ m_doc->m_isasking = -1;
+ break;
+
+ default:
+ break;
+ }
+
+ return QWidget::eventFilter( obj, e );
+}
+
+void KateViewInternal::keyPressEvent( QKeyEvent* e )
+{
+ KKey key(e);
+
+ bool codeComp = m_view->m_codeCompletion->codeCompletionVisible ();
+
+ if (codeComp)
+ {
+ kdDebug (13030) << "hint around" << endl;
+
+ if( e->key() == Key_Enter || e->key() == Key_Return ||
+ (key == SHIFT + Qt::Key_Return) || (key == SHIFT + Qt::Key_Enter)) {
+ m_view->m_codeCompletion->doComplete();
+ e->accept();
+ return;
+ }
+ }
+
+ if( !m_doc->isReadWrite() )
+ {
+ e->ignore();
+ return;
+ }
+
+ if ((key == Qt::Key_Return) || (key == Qt::Key_Enter))
+ {
+ m_view->keyReturn();
+ e->accept();
+ return;
+ }
+
+ if ((key == SHIFT + Qt::Key_Return) || (key == SHIFT + Qt::Key_Enter))
+ {
+ uint ln = cursor.line();
+ int col = cursor.col();
+ KateTextLine::Ptr line = m_doc->kateTextLine( ln );
+ int pos = line->firstChar();
+ if (pos > cursor.col()) pos = cursor.col();
+ if (pos != -1) {
+ while ((int)line->length() > pos &&
+ !line->getChar(pos).isLetterOrNumber() &&
+ pos < cursor.col()) ++pos;
+ } else {
+ pos = line->length(); // stay indented
+ }
+ m_doc->editStart();
+ m_doc->insertText( cursor.line(), line->length(), "\n" + line->string(0, pos)
+ + line->string().right( line->length() - cursor.col() ) );
+ cursor.setPos(ln + 1, pos);
+ if (col < int(line->length()))
+ m_doc->editRemoveText(ln, col, line->length() - col);
+ m_doc->editEnd();
+ updateCursor(cursor, true);
+ updateView();
+ e->accept();
+
+ return;
+ }
+
+ if (key == Qt::Key_Backspace || key == SHIFT + Qt::Key_Backspace)
+ {
+ m_view->backspace();
+ e->accept();
+
+ if (codeComp)
+ m_view->m_codeCompletion->updateBox ();
+
+ return;
+ }
+
+ if (key == Qt::Key_Tab || key == SHIFT+Qt::Key_Backtab || key == Qt::Key_Backtab)
+ {
+ if (m_doc->invokeTabInterceptor(key)) {
+ e->accept();
+ return;
+ } else
+ if (m_doc->configFlags() & KateDocumentConfig::cfTabIndents)
+ {
+ if( key == Qt::Key_Tab )
+ {
+ if (m_view->hasSelection() || (m_doc->configFlags() & KateDocumentConfig::cfTabIndentsMode))
+ m_doc->indent( m_view, cursor.line(), 1 );
+ else if (m_doc->configFlags() & KateDocumentConfig::cfTabInsertsTab)
+ m_doc->typeChars ( m_view, QString ("\t") );
+ else
+ m_doc->insertIndentChars ( m_view );
+
+ e->accept();
+
+ if (codeComp)
+ m_view->m_codeCompletion->updateBox ();
+
+ return;
+ }
+
+ if (key == SHIFT+Qt::Key_Backtab || key == Qt::Key_Backtab)
+ {
+ m_doc->indent( m_view, cursor.line(), -1 );
+ e->accept();
+
+ if (codeComp)
+ m_view->m_codeCompletion->updateBox ();
+
+ return;
+ }
+ }
+}
+ if ( !(e->state() & ControlButton) && !(e->state() & AltButton)
+ && m_doc->typeChars ( m_view, e->text() ) )
+ {
+ e->accept();
+
+ if (codeComp)
+ m_view->m_codeCompletion->updateBox ();
+
+ return;
+ }
+
+ e->ignore();
+}
+
+void KateViewInternal::keyReleaseEvent( QKeyEvent* e )
+{
+ KKey key(e);
+
+ if (key == SHIFT)
+ m_shiftKeyPressed = true;
+ else
+ {
+ if (m_shiftKeyPressed)
+ {
+ m_shiftKeyPressed = false;
+
+ if (m_selChangedByUser)
+ {
+ QApplication::clipboard()->setSelectionMode( true );
+ m_view->copy();
+ QApplication::clipboard()->setSelectionMode( false );
+
+ m_selChangedByUser = false;
+ }
+ }
+ }
+
+ e->ignore();
+ return;
+}
+
+void KateViewInternal::contextMenuEvent ( QContextMenuEvent * e )
+{
+ // try to show popup menu
+
+ QPoint p = e->pos();
+
+ if ( m_view->m_doc->browserView() )
+ {
+ m_view->contextMenuEvent( e );
+ return;
+ }
+
+ if ( e->reason() == QContextMenuEvent::Keyboard )
+ {
+ makeVisible( cursor, 0 );
+ p = cursorCoordinates();
+ }
+ else if ( ! m_view->hasSelection() || m_view->config()->persistentSelection() )
+ placeCursor( e->pos() );
+
+ // popup is a qguardedptr now
+ if (m_view->popup()) {
+ m_view->popup()->popup( mapToGlobal( p ) );
+ e->accept ();
+ }
+}
+
+void KateViewInternal::mousePressEvent( QMouseEvent* e )
+{
+ switch (e->button())
+ {
+ case LeftButton:
+ m_selChangedByUser = false;
+
+ if (possibleTripleClick)
+ {
+ possibleTripleClick = false;
+
+ m_selectionMode = Line;
+
+ if ( e->state() & Qt::ShiftButton )
+ {
+ updateSelection( cursor, true );
+ }
+ else
+ {
+ m_view->selectLine( cursor );
+ }
+
+ QApplication::clipboard()->setSelectionMode( true );
+ m_view->copy();
+ QApplication::clipboard()->setSelectionMode( false );
+
+ // Keep the line at the select anchor selected during further
+ // mouse selection
+ if ( selectAnchor.line() > m_view->selectStart.line() )
+ {
+ // Preserve the last selected line
+ if ( selectAnchor == m_view->selectEnd && selectAnchor.col() == 0 )
+ selStartCached = KateTextCursor( selectAnchor.line()-1, 0 );
+ else
+ selStartCached = KateTextCursor( selectAnchor.line(), 0 );
+ selEndCached = m_view->selectEnd;
+ }
+ else
+ {
+ // Preserve the first selected line
+ selStartCached = m_view->selectStart;
+ if ( m_view->selectEnd.line() > m_view->selectStart.line() )
+ selEndCached = KateTextCursor( m_view->selectStart.line()+1, 0 );
+ else
+ selEndCached = m_view->selectEnd;
+ }
+
+ // Set cursor to edge of selection... which edge depends on what
+ // "direction" the selection was made in
+ if ( m_view->selectStart < selectAnchor
+ && selectAnchor.line() != m_view->selectStart.line() )
+ updateCursor( m_view->selectStart );
+ else
+ updateCursor( m_view->selectEnd );
+
+ e->accept ();
+ return;
+ }
+ else if (m_selectionMode == Default)
+ {
+ m_selectionMode = Mouse;
+ }
+
+ if ( e->state() & Qt::ShiftButton )
+ {
+ if (selectAnchor.line() < 0)
+ selectAnchor = cursor;
+ }
+ else
+ {
+ selStartCached.setLine( -1 ); // invalidate
+ }
+
+ if( !( e->state() & Qt::ShiftButton ) && isTargetSelected( e->pos() ) )
+ {
+ dragInfo.state = diPending;
+ dragInfo.start = e->pos();
+ }
+ else
+ {
+ dragInfo.state = diNone;
+
+ if ( e->state() & Qt::ShiftButton )
+ {
+ placeCursor( e->pos(), true, false );
+ if ( selStartCached.line() >= 0 )
+ {
+ if ( cursor > selEndCached )
+ {
+ m_view->setSelection( selStartCached, cursor );
+ selectAnchor = selStartCached;
+ }
+ else if ( cursor < selStartCached )
+ {
+ m_view->setSelection( cursor, selEndCached );
+ selectAnchor = selEndCached;
+ }
+ else
+ {
+ m_view->setSelection( selStartCached, cursor );
+ }
+ }
+ else
+ {
+ m_view->setSelection( selectAnchor, cursor );
+ }
+ }
+ else
+ {
+ placeCursor( e->pos() );
+ }
+
+ scrollX = 0;
+ scrollY = 0;
+
+ m_scrollTimer.start (50);
+ }
+
+ e->accept ();
+ break;
+
+ default:
+ e->ignore ();
+ break;
+ }
+}
+
+void KateViewInternal::mouseDoubleClickEvent(QMouseEvent *e)
+{
+ switch (e->button())
+ {
+ case LeftButton:
+ m_selectionMode = Word;
+
+ if ( e->state() & Qt::ShiftButton )
+ {
+ KateTextCursor oldSelectStart = m_view->selectStart;
+ KateTextCursor oldSelectEnd = m_view->selectEnd;
+
+ // Now select the word under the select anchor
+ int cs, ce;
+ KateTextLine::Ptr l = m_doc->kateTextLine( selectAnchor.line() );
+
+ ce = selectAnchor.col();
+ if ( ce > 0 && m_doc->highlight()->isInWord( l->getChar( ce ) ) ) {
+ for (; ce < l->length(); ce++ )
+ if ( !m_doc->highlight()->isInWord( l->getChar( ce ) ) )
+ break;
+ }
+
+ cs = selectAnchor.col() - 1;
+ if ( cs < m_doc->textLine( selectAnchor.line() ).length()
+ && m_doc->highlight()->isInWord( l->getChar( cs ) ) ) {
+ for ( cs--; cs >= 0; cs-- )
+ if ( !m_doc->highlight()->isInWord( l->getChar( cs ) ) )
+ break;
+ }
+
+ // ...and keep it selected
+ if (cs+1 < ce)
+ {
+ selStartCached = KateTextCursor( selectAnchor.line(), cs+1 );
+ selEndCached = KateTextCursor( selectAnchor.line(), ce );
+ }
+ else
+ {
+ selStartCached = selectAnchor;
+ selEndCached = selectAnchor;
+ }
+ // Now word select to the mouse cursor
+ placeCursor( e->pos(), true );
+ }
+ else
+ {
+ // first clear the selection, otherwise we run into bug #106402
+ // ...and set the cursor position, for the same reason (otherwise there
+ // are *other* idiosyncrasies we can't fix without reintroducing said
+ // bug)
+ // Parameters: 1st false: don't redraw
+ // 2nd false: don't emit selectionChanged signals, as
+ // selectWord() emits this already
+ m_view->clearSelection( false, false );
+ placeCursor( e->pos() );
+ m_view->selectWord( cursor );
+ if (m_view->hasSelection())
+ {
+ selectAnchor = selStartCached = m_view->selectStart;
+ selEndCached = m_view->selectEnd;
+ }
+ else
+ {
+ // if we didn't actually select anything, restore the selection mode
+ // -- see bug #131369 (kling)
+ m_selectionMode = Default;
+ }
+ }
+
+ // Move cursor to end (or beginning) of selected word
+ if (m_view->hasSelection())
+ {
+ QApplication::clipboard()->setSelectionMode( true );
+ m_view->copy();
+ QApplication::clipboard()->setSelectionMode( false );
+
+ // Shift+DC before the "cached" word should move the cursor to the
+ // beginning of the selection, not the end
+ if (m_view->selectStart < selStartCached)
+ updateCursor( m_view->selectStart );
+ else
+ updateCursor( m_view->selectEnd );
+ }
+
+ possibleTripleClick = true;
+ QTimer::singleShot ( QApplication::doubleClickInterval(), this, SLOT(tripleClickTimeout()) );
+
+ scrollX = 0;
+ scrollY = 0;
+
+ m_scrollTimer.start (50);
+
+ e->accept ();
+ break;
+
+ default:
+ e->ignore ();
+ break;
+ }
+}
+
+void KateViewInternal::tripleClickTimeout()
+{
+ possibleTripleClick = false;
+}
+
+void KateViewInternal::mouseReleaseEvent( QMouseEvent* e )
+{
+ switch (e->button())
+ {
+ case LeftButton:
+ m_selectionMode = Default;
+// selStartCached.setLine( -1 );
+
+ if (m_selChangedByUser)
+ {
+ QApplication::clipboard()->setSelectionMode( true );
+ m_view->copy();
+ QApplication::clipboard()->setSelectionMode( false );
+ // Set cursor to edge of selection... which edge depends on what
+ // "direction" the selection was made in
+ if ( m_view->selectStart < selectAnchor )
+ updateCursor( m_view->selectStart );
+ else
+ updateCursor( m_view->selectEnd );
+
+ m_selChangedByUser = false;
+ }
+
+ if (dragInfo.state == diPending)
+ placeCursor( e->pos(), e->state() & ShiftButton );
+ else if (dragInfo.state == diNone)
+ m_scrollTimer.stop ();
+
+ dragInfo.state = diNone;
+
+ e->accept ();
+ break;
+
+ case MidButton:
+ placeCursor( e->pos() );
+
+ if( m_doc->isReadWrite() )
+ {
+ QApplication::clipboard()->setSelectionMode( true );
+ m_view->paste ();
+ QApplication::clipboard()->setSelectionMode( false );
+ }
+
+ e->accept ();
+ break;
+
+ default:
+ e->ignore ();
+ break;
+ }
+}
+
+void KateViewInternal::mouseMoveEvent( QMouseEvent* e )
+{
+ if( e->state() & LeftButton )
+ {
+ if (dragInfo.state == diPending)
+ {
+ // we had a mouse down, but haven't confirmed a drag yet
+ // if the mouse has moved sufficiently, we will confirm
+ QPoint p( e->pos() - dragInfo.start );
+
+ // we've left the drag square, we can start a real drag operation now
+ if( p.manhattanLength() > KGlobalSettings::dndEventDelay() )
+ doDrag();
+
+ return;
+ }
+ else if (dragInfo.state == diDragging)
+ {
+ // Don't do anything after a canceled drag until the user lets go of
+ // the mouse button!
+ return;
+ }
+
+ mouseX = e->x();
+ mouseY = e->y();
+
+ scrollX = 0;
+ scrollY = 0;
+ int d = m_view->renderer()->fontHeight();
+
+ if (mouseX < 0)
+ scrollX = -d;
+
+ if (mouseX > width())
+ scrollX = d;
+
+ if (mouseY < 0)
+ {
+ mouseY = 0;
+ scrollY = -d;
+ }
+
+ if (mouseY > height())
+ {
+ mouseY = height();
+ scrollY = d;
+ }
+
+ placeCursor( QPoint( mouseX, mouseY ), true );
+
+ }
+ else
+ {
+ if (isTargetSelected( e->pos() ) ) {
+ // mouse is over selected text. indicate that the text is draggable by setting
+ // the arrow cursor as other Qt text editing widgets do
+ if (m_mouseCursor != ArrowCursor) {
+ setCursor( KCursor::arrowCursor() );
+ m_mouseCursor = ArrowCursor;
+ }
+ } else {
+ // normal text cursor
+ if (m_mouseCursor != IbeamCursor) {
+ setCursor( KCursor::ibeamCursor() );
+ m_mouseCursor = IbeamCursor;
+ }
+ }
+
+ if (m_textHintEnabled)
+ {
+ m_textHintTimer.start(m_textHintTimeout);
+ m_textHintMouseX=e->x();
+ m_textHintMouseY=e->y();
+ }
+ }
+}
+
+void KateViewInternal::paintEvent(QPaintEvent *e)
+{
+ paintText(e->rect().x(), e->rect().y(), e->rect().width(), e->rect().height());
+}
+
+void KateViewInternal::resizeEvent(QResizeEvent* e)
+{
+ bool expandedHorizontally = width() > e->oldSize().width();
+ bool expandedVertically = height() > e->oldSize().height();
+ bool heightChanged = height() != e->oldSize().height();
+
+ m_madeVisible = false;
+
+ if (heightChanged) {
+ setAutoCenterLines(m_autoCenterLines, false);
+ m_cachedMaxStartPos.setPos(-1, -1);
+ }
+
+ if (m_view->dynWordWrap()) {
+ bool dirtied = false;
+
+ for (uint i = 0; i < lineRanges.count(); i++) {
+ // find the first dirty line
+ // the word wrap updateView algorithm is forced to check all lines after a dirty one
+ if (lineRanges[i].wrap ||
+ (!expandedHorizontally && (lineRanges[i].endX - lineRanges[i].startX) > width())) {
+ dirtied = lineRanges[i].dirty = true;
+ break;
+ }
+ }
+
+ if (dirtied || heightChanged) {
+ updateView(true);
+ leftBorder->update();
+ }
+
+ if (width() < e->oldSize().width()) {
+ if (!m_view->wrapCursor()) {
+ // May have to restrain cursor to new smaller width...
+ if (cursor.col() > m_doc->lineLength(cursor.line())) {
+ KateLineRange thisRange = currentRange();
+
+ KateTextCursor newCursor(cursor.line(), thisRange.endCol + ((width() - thisRange.xOffset() - (thisRange.endX - thisRange.startX)) / m_view->renderer()->spaceWidth()) - 1);
+ updateCursor(newCursor);
+ }
+ }
+ }
+
+ } else {
+ updateView();
+
+ if (expandedHorizontally && startX() > 0)
+ scrollColumns(startX() - (width() - e->oldSize().width()));
+ }
+
+ if (expandedVertically) {
+ KateTextCursor max = maxStartPos();
+ if (startPos() > max)
+ scrollPos(max);
+ }
+}
+
+void KateViewInternal::scrollTimeout ()
+{
+ if (scrollX || scrollY)
+ {
+ scrollLines (startPos().line() + (scrollY / (int)m_view->renderer()->fontHeight()));
+ placeCursor( QPoint( mouseX, mouseY ), true );
+ }
+}
+
+void KateViewInternal::cursorTimeout ()
+{
+ m_view->renderer()->setDrawCaret(!m_view->renderer()->drawCaret());
+ paintCursor();
+}
+
+void KateViewInternal::textHintTimeout ()
+{
+ m_textHintTimer.stop ();
+
+ KateLineRange thisRange = yToKateLineRange(m_textHintMouseY);
+
+ if (thisRange.line == -1) return;
+
+ if (m_textHintMouseX> (lineMaxCursorX(thisRange) - thisRange.startX)) return;
+
+ int realLine = thisRange.line;
+ int startCol = thisRange.startCol;
+
+ KateTextCursor c(realLine, 0);
+ m_view->renderer()->textWidth( c, startX() + m_textHintMouseX, startCol);
+
+ QString tmp;
+
+ emit m_view->needTextHint(c.line(), c.col(), tmp);
+
+ if (!tmp.isEmpty()) kdDebug(13030)<<"Hint text: "<<tmp<<endl;
+}
+
+void KateViewInternal::focusInEvent (QFocusEvent *)
+{
+ if (KApplication::cursorFlashTime() > 0)
+ m_cursorTimer.start ( KApplication::cursorFlashTime() / 2 );
+
+ if (m_textHintEnabled)
+ m_textHintTimer.start( m_textHintTimeout );
+
+ paintCursor();
+
+ m_doc->setActiveView( m_view );
+
+ emit m_view->gotFocus( m_view );
+}
+
+void KateViewInternal::focusOutEvent (QFocusEvent *)
+{
+ if( m_view->renderer() && ! m_view->m_codeCompletion->codeCompletionVisible() )
+ {
+ m_cursorTimer.stop();
+
+ m_view->renderer()->setDrawCaret(true);
+ paintCursor();
+ emit m_view->lostFocus( m_view );
+ }
+
+ m_textHintTimer.stop();
+}
+
+void KateViewInternal::doDrag()
+{
+ dragInfo.state = diDragging;
+ dragInfo.dragObject = new QTextDrag(m_view->selection(), this);
+ dragInfo.dragObject->drag();
+}
+
+void KateViewInternal::dragEnterEvent( QDragEnterEvent* event )
+{
+ event->accept( (QTextDrag::canDecode(event) && m_doc->isReadWrite()) ||
+ KURLDrag::canDecode(event) );
+}
+
+void KateViewInternal::dragMoveEvent( QDragMoveEvent* event )
+{
+ // track the cursor to the current drop location
+ placeCursor( event->pos(), true, false );
+
+ // important: accept action to switch between copy and move mode
+ // without this, the text will always be copied.
+ event->acceptAction();
+}
+
+void KateViewInternal::dropEvent( QDropEvent* event )
+{
+ if ( KURLDrag::canDecode(event) ) {
+
+ emit dropEventPass(event);
+
+ } else if ( QTextDrag::canDecode(event) && m_doc->isReadWrite() ) {
+
+ QString text;
+
+ if (!QTextDrag::decode(event, text))
+ return;
+
+ // is the source our own document?
+ bool priv = false;
+ if (event->source() && event->source()->inherits("KateViewInternal"))
+ priv = m_doc->ownedView( ((KateViewInternal*)(event->source()))->m_view );
+
+ // dropped on a text selection area?
+ bool selected = isTargetSelected( event->pos() );
+
+ if( priv && selected ) {
+ // this is a drag that we started and dropped on our selection
+ // ignore this case
+ return;
+ }
+
+ // use one transaction
+ m_doc->editStart ();
+
+ // on move: remove selected text; on copy: duplicate text
+ if ( event->action() != QDropEvent::Copy )
+ m_view->removeSelectedText();
+
+ m_doc->insertText( cursor.line(), cursor.col(), text );
+
+ m_doc->editEnd ();
+
+ placeCursor( event->pos() );
+
+ event->acceptAction();
+ updateView();
+ }
+
+ // finally finish drag and drop mode
+ dragInfo.state = diNone;
+ // important, because the eventFilter`s DragLeave does not occur
+ stopDragScroll();
+}
+//END EVENT HANDLING STUFF
+
+void KateViewInternal::clear()
+{
+ cursor.setPos(0, 0);
+ displayCursor.setPos(0, 0);
+}
+
+void KateViewInternal::wheelEvent(QWheelEvent* e)
+{
+ if (m_lineScroll->minValue() != m_lineScroll->maxValue() && e->orientation() != Qt::Horizontal) {
+ // React to this as a vertical event
+ if ( ( e->state() & ControlButton ) || ( e->state() & ShiftButton ) ) {
+ if (e->delta() > 0)
+ scrollPrevPage();
+ else
+ scrollNextPage();
+ } else {
+ scrollViewLines(-((e->delta() / 120) * QApplication::wheelScrollLines()));
+ // maybe a menu was opened or a bubbled window title is on us -> we shall erase it
+ update();
+ leftBorder->update();
+ }
+
+ } else if (columnScrollingPossible()) {
+ QWheelEvent copy = *e;
+ QApplication::sendEvent(m_columnScroll, &copy);
+
+ } else {
+ e->ignore();
+ }
+}
+
+void KateViewInternal::startDragScroll()
+{
+ if ( !m_dragScrollTimer.isActive() ) {
+ m_dragScrollTimer.start( scrollTime );
+ }
+}
+
+void KateViewInternal::stopDragScroll()
+{
+ m_dragScrollTimer.stop();
+ updateView();
+}
+
+void KateViewInternal::doDragScroll()
+{
+ QPoint p = this->mapFromGlobal( QCursor::pos() );
+
+ int dx = 0, dy = 0;
+ if ( p.y() < scrollMargin ) {
+ dy = p.y() - scrollMargin;
+ } else if ( p.y() > height() - scrollMargin ) {
+ dy = scrollMargin - (height() - p.y());
+ }
+
+ if ( p.x() < scrollMargin ) {
+ dx = p.x() - scrollMargin;
+ } else if ( p.x() > width() - scrollMargin ) {
+ dx = scrollMargin - (width() - p.x());
+ }
+
+ dy /= 4;
+
+ if (dy)
+ scrollLines(startPos().line() + dy);
+
+ if (columnScrollingPossible () && dx)
+ scrollColumns(kMin (m_startX + dx, m_columnScroll->maxValue()));
+
+ if (!dy && !dx)
+ stopDragScroll();
+}
+
+void KateViewInternal::enableTextHints(int timeout)
+{
+ m_textHintTimeout=timeout;
+ m_textHintEnabled=true;
+ m_textHintTimer.start(timeout);
+}
+
+void KateViewInternal::disableTextHints()
+{
+ m_textHintEnabled=false;
+ m_textHintTimer.stop ();
+}
+
+bool KateViewInternal::columnScrollingPossible ()
+{
+ return !m_view->dynWordWrap() && m_columnScroll->isEnabled() && (m_columnScroll->maxValue() > 0);
+}
+
+//BEGIN EDIT STUFF
+void KateViewInternal::editStart()
+{
+ editSessionNumber++;
+
+ if (editSessionNumber > 1)
+ return;
+
+ editIsRunning = true;
+ editOldCursor = cursor;
+}
+
+void KateViewInternal::editEnd(int editTagLineStart, int editTagLineEnd, bool tagFrom)
+{
+ if (editSessionNumber == 0)
+ return;
+
+ editSessionNumber--;
+
+ if (editSessionNumber > 0)
+ return;
+
+ if (tagFrom && (editTagLineStart <= int(m_doc->getRealLine(startLine()))))
+ tagAll();
+ else
+ tagLines (editTagLineStart, tagFrom ? m_doc->lastLine() : editTagLineEnd, true);
+
+ if (editOldCursor == cursor)
+ updateBracketMarks();
+
+ if (m_imPreeditLength <= 0)
+ updateView(true);
+
+ if ((editOldCursor != cursor) && (m_imPreeditLength <= 0))
+ {
+ m_madeVisible = false;
+ updateCursor ( cursor, true );
+ }
+ else if ( m_view == m_doc->activeView() )
+ {
+ makeVisible(displayCursor, displayCursor.col());
+ }
+
+ editIsRunning = false;
+}
+
+void KateViewInternal::editSetCursor (const KateTextCursor &cursor)
+{
+ if (this->cursor != cursor)
+ {
+ this->cursor.setPos (cursor);
+ }
+}
+//END
+
+void KateViewInternal::viewSelectionChanged ()
+{
+ if (!m_view->hasSelection())
+ {
+ selectAnchor.setPos (-1, -1);
+ selStartCached.setPos (-1, -1);
+ }
+}
+
+//BEGIN IM INPUT STUFF
+void KateViewInternal::imStartEvent( QIMEvent *e )
+{
+ if ( m_doc->m_bReadOnly ) {
+ e->ignore();
+ return;
+ }
+
+ if ( m_view->hasSelection() )
+ m_view->removeSelectedText();
+
+ m_imPreeditStartLine = cursor.line();
+ m_imPreeditStart = cursor.col();
+ m_imPreeditLength = 0;
+ m_imPreeditSelStart = m_imPreeditStart;
+
+ m_view->setIMSelectionValue( m_imPreeditStartLine, m_imPreeditStart, 0, 0, 0, true );
+}
+
+void KateViewInternal::imComposeEvent( QIMEvent *e )
+{
+ if ( m_doc->m_bReadOnly ) {
+ e->ignore();
+ return;
+ }
+
+ // remove old preedit
+ if ( m_imPreeditLength > 0 ) {
+ cursor.setPos( m_imPreeditStartLine, m_imPreeditStart );
+ m_doc->removeText( m_imPreeditStartLine, m_imPreeditStart,
+ m_imPreeditStartLine, m_imPreeditStart + m_imPreeditLength );
+ }
+
+ m_imPreeditLength = e->text().length();
+ m_imPreeditSelStart = m_imPreeditStart + e->cursorPos();
+
+ // update selection
+ m_view->setIMSelectionValue( m_imPreeditStartLine, m_imPreeditStart, m_imPreeditStart + m_imPreeditLength,
+ m_imPreeditSelStart, m_imPreeditSelStart + e->selectionLength(),
+ true );
+
+ // insert new preedit
+ m_doc->insertText( m_imPreeditStartLine, m_imPreeditStart, e->text() );
+
+
+ // update cursor
+ cursor.setPos( m_imPreeditStartLine, m_imPreeditSelStart );
+ updateCursor( cursor, true );
+
+ updateView( true );
+}
+
+void KateViewInternal::imEndEvent( QIMEvent *e )
+{
+ if ( m_doc->m_bReadOnly ) {
+ e->ignore();
+ return;
+ }
+
+ if ( m_imPreeditLength > 0 ) {
+ cursor.setPos( m_imPreeditStartLine, m_imPreeditStart );
+ m_doc->removeText( m_imPreeditStartLine, m_imPreeditStart,
+ m_imPreeditStartLine, m_imPreeditStart + m_imPreeditLength );
+ }
+
+ m_view->setIMSelectionValue( m_imPreeditStartLine, m_imPreeditStart, 0, 0, 0, false );
+
+ if ( e->text().length() > 0 ) {
+ m_doc->insertText( cursor.line(), cursor.col(), e->text() );
+
+ if ( !m_cursorTimer.isActive() && KApplication::cursorFlashTime() > 0 )
+ m_cursorTimer.start ( KApplication::cursorFlashTime() / 2 );
+
+ updateView( true );
+ updateCursor( cursor, true );
+ }
+
+ m_imPreeditStart = 0;
+ m_imPreeditLength = 0;
+ m_imPreeditSelStart = 0;
+}
+//END IM INPUT STUFF
+
+// kate: space-indent on; indent-width 2; replace-tabs on;
diff --git a/kate/part/kateviewinternal.h b/kate/part/kateviewinternal.h
new file mode 100644
index 000000000..c5004d6be
--- /dev/null
+++ b/kate/part/kateviewinternal.h
@@ -0,0 +1,397 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2002 John Firebaugh <jfirebaugh@kde.org>
+ Copyright (C) 2002 Joseph Wenninger <jowenn@kde.org>
+ Copyright (C) 2002 Christoph Cullmann <cullmann@kde.org>
+
+ Based on:
+ KWriteView : Copyright (C) 1999 Jochen Wilhelmy <digisnap@cs.tu-berlin.de>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef _KATE_VIEW_INTERNAL_
+#define _KATE_VIEW_INTERNAL_
+
+#include "katecursor.h"
+#include "katesupercursor.h"
+#include "katelinerange.h"
+#include "katetextline.h"
+#include "katedocument.h"
+
+#include <qpoint.h>
+#include <qtimer.h>
+#include <qintdict.h>
+
+class KateView;
+class KateIconBorder;
+class KateScrollBar;
+
+class QHBoxLayout;
+class QVBoxLayout;
+class QScrollBar;
+
+enum Bias
+{
+ left = -1,
+ none = 0,
+ right = 1
+};
+
+class KateViewInternal : public QWidget
+{
+ Q_OBJECT
+
+ friend class KateView;
+ friend class KateIconBorder;
+ friend class KateScrollBar;
+ friend class CalculatingCursor;
+ friend class BoundedCursor;
+ friend class WrappingCursor;
+
+ public:
+ KateViewInternal ( KateView *view, KateDocument *doc );
+ ~KateViewInternal ();
+
+ //BEGIN EDIT STUFF
+ public:
+ void editStart ();
+ void editEnd (int editTagLineStart, int editTagLineEnd, bool tagFrom);
+
+ void editSetCursor (const KateTextCursor &cursor);
+
+ private:
+ uint editSessionNumber;
+ bool editIsRunning;
+ KateTextCursor editOldCursor;
+ //END
+
+ //BEGIN TAG & CLEAR & UPDATE STUFF
+ public:
+ bool tagLine (const KateTextCursor& virtualCursor);
+
+ bool tagLines (int start, int end, bool realLines = false);
+ bool tagLines (KateTextCursor start, KateTextCursor end, bool realCursors = false);
+
+ void tagAll ();
+
+ void clear ();
+ //END
+
+ private:
+ void updateView (bool changed = false, int viewLinesScrolled = 0);
+ void makeVisible (const KateTextCursor& c, uint endCol, bool force = false, bool center = false, bool calledExternally = false);
+
+ public:
+ inline const KateTextCursor& startPos() const { return m_startPos; }
+ inline uint startLine () const { return m_startPos.line(); }
+ inline uint startX () const { return m_startX; }
+
+ KateTextCursor endPos () const;
+ uint endLine () const;
+
+ KateLineRange yToKateLineRange(uint y) const;
+
+ void prepareForDynWrapChange();
+ void dynWrapChanged();
+
+ KateView *view () { return m_view; }
+
+ public slots:
+ void slotIncFontSizes();
+ void slotDecFontSizes();
+
+ private slots:
+ void scrollLines(int line); // connected to the sliderMoved of the m_lineScroll
+ void scrollViewLines(int offset);
+ void scrollNextPage();
+ void scrollPrevPage();
+ void scrollPrevLine();
+ void scrollNextLine();
+ void scrollColumns (int x); // connected to the valueChanged of the m_columnScroll
+ void viewSelectionChanged ();
+
+ public:
+ void doReturn();
+ void doDelete();
+ void doBackspace();
+ void doTranspose();
+ void doDeleteWordLeft();
+ void doDeleteWordRight();
+
+ void cursorLeft(bool sel=false);
+ void cursorRight(bool sel=false);
+ void wordLeft(bool sel=false);
+ void wordRight(bool sel=false);
+ void home(bool sel=false);
+ void end(bool sel=false);
+ void cursorUp(bool sel=false);
+ void cursorDown(bool sel=false);
+ void cursorToMatchingBracket(bool sel=false);
+ void scrollUp();
+ void scrollDown();
+ void topOfView(bool sel=false);
+ void bottomOfView(bool sel=false);
+ void pageUp(bool sel=false);
+ void pageDown(bool sel=false);
+ void top(bool sel=false);
+ void bottom(bool sel=false);
+ void top_home(bool sel=false);
+ void bottom_end(bool sel=false);
+
+ inline const KateTextCursor& getCursor() { return cursor; }
+ QPoint cursorCoordinates();
+
+ void paintText (int x, int y, int width, int height, bool paintOnlyDirty = false);
+
+ // EVENT HANDLING STUFF - IMPORTANT
+ protected:
+ void paintEvent(QPaintEvent *e);
+ bool eventFilter( QObject *obj, QEvent *e );
+ void keyPressEvent( QKeyEvent* );
+ void keyReleaseEvent( QKeyEvent* );
+ void resizeEvent( QResizeEvent* );
+ void mousePressEvent( QMouseEvent* );
+ void mouseDoubleClickEvent( QMouseEvent* );
+ void mouseReleaseEvent( QMouseEvent* );
+ void mouseMoveEvent( QMouseEvent* );
+ void dragEnterEvent( QDragEnterEvent* );
+ void dragMoveEvent( QDragMoveEvent* );
+ void dropEvent( QDropEvent* );
+ void showEvent ( QShowEvent *);
+ void wheelEvent(QWheelEvent* e);
+ void focusInEvent (QFocusEvent *);
+ void focusOutEvent (QFocusEvent *);
+
+ void contextMenuEvent ( QContextMenuEvent * e );
+
+ private slots:
+ void tripleClickTimeout();
+
+ signals:
+ // emitted when KateViewInternal is not handling its own URI drops
+ void dropEventPass(QDropEvent*);
+
+ private slots:
+ void slotRegionVisibilityChangedAt(unsigned int);
+ void slotRegionBeginEndAddedRemoved(unsigned int);
+ void slotCodeFoldingChanged();
+
+ private:
+ void moveChar( Bias bias, bool sel );
+ void moveEdge( Bias bias, bool sel );
+ KateTextCursor maxStartPos(bool changed = false);
+ void scrollPos(KateTextCursor& c, bool force = false, bool calledExternally = false);
+ void scrollLines( int lines, bool sel );
+
+ uint linesDisplayed() const;
+
+ int lineToY(uint viewLine) const;
+
+ void updateSelection( const KateTextCursor&, bool keepSel );
+ void updateCursor( const KateTextCursor& newCursor, bool force = false, bool center = false, bool calledExternally = false );
+ void updateBracketMarks();
+
+ void paintCursor();
+
+ void updateMicroFocusHint();
+
+ void placeCursor( const QPoint& p, bool keepSelection = false, bool updateSelection = true );
+ bool isTargetSelected( const QPoint& p );
+
+ void doDrag();
+
+ KateView *m_view;
+ KateDocument* m_doc;
+ class KateIconBorder *leftBorder;
+
+ int mouseX;
+ int mouseY;
+ int scrollX;
+ int scrollY;
+
+ Qt::CursorShape m_mouseCursor;
+
+ KateSuperCursor cursor;
+ KateTextCursor displayCursor;
+ int cXPos;
+
+ bool possibleTripleClick;
+
+ // Bracket mark
+ KateBracketRange bm;
+
+ enum DragState { diNone, diPending, diDragging };
+
+ struct _dragInfo {
+ DragState state;
+ QPoint start;
+ QTextDrag* dragObject;
+ } dragInfo;
+
+ uint iconBorderHeight;
+
+ //
+ // line scrollbar + first visible (virtual) line in the current view
+ //
+ KateScrollBar *m_lineScroll;
+ QWidget* m_dummy;
+ QVBoxLayout* m_lineLayout;
+ QHBoxLayout* m_colLayout;
+
+ // These are now cursors to account for word-wrap.
+ KateSuperCursor m_startPos;
+
+ // This is set to false on resize or scroll (other than that called by makeVisible),
+ // so that makeVisible is again called when a key is pressed and the cursor is in the same spot
+ bool m_madeVisible;
+ bool m_shiftKeyPressed;
+
+ // How many lines to should be kept visible above/below the cursor when possible
+ void setAutoCenterLines(int viewLines, bool updateView = true);
+ int m_autoCenterLines;
+ int m_minLinesVisible;
+
+ //
+ // column scrollbar + x position
+ //
+ QScrollBar *m_columnScroll;
+ int m_startX;
+
+ // has selection changed while your mouse or shift key is pressed
+ bool m_selChangedByUser;
+ KateTextCursor selectAnchor;
+
+ enum SelectionMode { Default=0, Word, Line, Mouse }; ///< for drag selection. @since 2.3
+ uint m_selectionMode;
+ // when drag selecting after double/triple click, keep the initial selected
+ // word/line independant of direction.
+ // They get set in the event of a double click, and is used with mouse move + leftbutton
+ KateTextCursor selStartCached;
+ KateTextCursor selEndCached;
+
+ //
+ // lines Ranges, mostly useful to speedup + dyn. word wrap
+ //
+ QMemArray<KateLineRange> lineRanges;
+
+ // maximal lenght of textlines visible from given startLine
+ int maxLen(uint startLine);
+
+ // are we allowed to scroll columns?
+ bool columnScrollingPossible ();
+
+ // returns the maximum X value / col value a cursor can take for a specific line range
+ int lineMaxCursorX(const KateLineRange& range);
+ int lineMaxCol(const KateLineRange& range);
+
+ // get the values for a specific range.
+ // specify lastLine to get the next line of a range.
+ KateLineRange range(int realLine, const KateLineRange* previous = 0L);
+
+ KateLineRange currentRange();
+ KateLineRange previousRange();
+ KateLineRange nextRange();
+
+ // Finds the lineRange currently occupied by the cursor.
+ KateLineRange range(const KateTextCursor& realCursor);
+
+ // Returns the lineRange of the specified realLine + viewLine.
+ KateLineRange range(uint realLine, int viewLine);
+
+ // find the view line of cursor c (0 = same line, 1 = down one, etc.)
+ uint viewLine(const KateTextCursor& realCursor);
+
+ // find the view line of the cursor, relative to the display (0 = top line of view, 1 = second line, etc.)
+ // if limitToVisible is true, only lines which are currently visible will be searched for, and -1 returned if the line is not visible.
+ int displayViewLine(const KateTextCursor& virtualCursor, bool limitToVisible = false);
+
+ // find the index of the last view line for a specific line
+ uint lastViewLine(uint realLine);
+
+ // count the number of view lines for a real line
+ uint viewLineCount(uint realLine);
+
+ // find the cursor offset by (offset) view lines from a cursor.
+ // when keepX is true, the column position will be calculated based on the x
+ // position of the specified cursor.
+ KateTextCursor viewLineOffset(const KateTextCursor& virtualCursor, int offset, bool keepX = false);
+
+ // These variable holds the most recent maximum real & visible column number
+ bool m_preserveMaxX;
+ int m_currentMaxX;
+
+ bool m_usePlainLines; // accept non-highlighted lines if this is set
+
+ inline KateTextLine::Ptr textLine( int realLine )
+ {
+ if (m_usePlainLines)
+ return m_doc->plainKateTextLine(realLine);
+ else
+ return m_doc->kateTextLine(realLine);
+ }
+
+ bool m_updatingView;
+ int m_wrapChangeViewLine;
+ KateTextCursor m_cachedMaxStartPos;
+
+ private slots:
+ void doDragScroll();
+ void startDragScroll();
+ void stopDragScroll();
+
+ private:
+ // Timers
+ QTimer m_dragScrollTimer;
+ QTimer m_scrollTimer;
+ QTimer m_cursorTimer;
+ QTimer m_textHintTimer;
+
+ static const int scrollTime = 30;
+ static const int scrollMargin = 16;
+
+ private slots:
+ void scrollTimeout ();
+ void cursorTimeout ();
+ void textHintTimeout ();
+
+ //TextHint
+ public:
+ void enableTextHints(int timeout);
+ void disableTextHints();
+
+ private:
+ bool m_textHintEnabled;
+ int m_textHintTimeout;
+ int m_textHintMouseX;
+ int m_textHintMouseY;
+
+ /**
+ * IM input stuff
+ */
+ protected:
+ void imStartEvent( QIMEvent *e );
+ void imComposeEvent( QIMEvent *e );
+ void imEndEvent( QIMEvent *e );
+
+ private:
+ int m_imPreeditStartLine;
+ int m_imPreeditStart;
+ int m_imPreeditLength;
+ int m_imPreeditSelStart;
+};
+
+#endif
+
+// kate: space-indent on; indent-width 2; replace-tabs on;
diff --git a/kate/part/test_regression.cpp b/kate/part/test_regression.cpp
new file mode 100644
index 000000000..af36f65f9
--- /dev/null
+++ b/kate/part/test_regression.cpp
@@ -0,0 +1,1344 @@
+/**
+ * This file is part of the KDE project
+ *
+ * Copyright (C) 2001,2003 Peter Kelly (pmk@post.com)
+ * Copyright (C) 2003,2004 Stephan Kulow (coolo@kde.org)
+ * Copyright (C) 2004 Dirk Mueller ( mueller@kde.org )
+ * Copyright 2006 Leo Savernik (l.savernik@aon.at)
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include <stdlib.h>
+#include <sys/time.h>
+#include <sys/resource.h>
+#include <sys/types.h>
+#include <unistd.h>
+#include <pwd.h>
+#include <signal.h>
+
+#include <kapplication.h>
+#include <kstandarddirs.h>
+#include <qimage.h>
+#include <qfile.h>
+#include "test_regression.h"
+#include <unistd.h>
+#include <stdio.h>
+
+#include <kaction.h>
+#include <kcmdlineargs.h>
+#include "katefactory.h"
+#include <kio/job.h>
+#include <kmainwindow.h>
+#include <ksimpleconfig.h>
+#include <kglobalsettings.h>
+
+#include <qcolor.h>
+#include <qcursor.h>
+#include <qdir.h>
+#include <qevent.h>
+#include <qobject.h>
+#include <qpushbutton.h>
+#include <qscrollview.h>
+#include <qstring.h>
+#include <qregexp.h>
+#include <qtextstream.h>
+#include <qvaluelist.h>
+#include <qwidget.h>
+#include <qfileinfo.h>
+#include <qtimer.h>
+#include <kstatusbar.h>
+#include <qfileinfo.h>
+
+#include "katedocument.h"
+#include "kateview.h"
+#include <kparts/browserextension.h>
+#include "katejscript.h"
+#include "katedocumenthelpers.h"
+#include "kateconfig.h"
+#include "../interfaces/katecmd.h"
+
+using namespace KJS;
+
+#define BASE_DIR_CONFIG "/.testkateregression-3.5"
+
+//BEGIN TestJScriptEnv
+
+TestJScriptEnv::TestJScriptEnv(KateDocument *part) {
+ ExecState *exec = m_interpreter->globalExec();
+
+ KJS::ObjectImp *wd = wrapDocument(m_interpreter->globalExec(), part);
+ KateView *v = static_cast<KateView *>(part->widget());
+ KJS::ObjectImp *wv = new KateViewObject(exec, v, wrapView(m_interpreter->globalExec(), v));
+
+ *m_view = KJS::Object(wv);
+ *m_document = KJS::Object(wd);
+ m_output = new OutputObject(exec, part, v);
+ m_output->ref();
+
+ // recreate properties
+ m_interpreter->globalObject().put(exec, "document", *m_document);
+ m_interpreter->globalObject().put(exec, "view", *m_view);
+ // create new properties
+ m_interpreter->globalObject().put(exec, "output", KJS::Object(m_output));
+ // add convenience shortcuts
+ m_interpreter->globalObject().put(exec, "d", *m_document);
+ m_interpreter->globalObject().put(exec, "v", *m_view);
+ m_interpreter->globalObject().put(exec, "out", KJS::Object(m_output));
+ m_interpreter->globalObject().put(exec, "o", KJS::Object(m_output));
+}
+
+TestJScriptEnv::~TestJScriptEnv() {
+ m_output->deref();
+}
+
+//END TestJScriptEnv
+
+//BEGIN KateViewObject
+
+KateViewObject::KateViewObject(ExecState *exec, KateView *v, ObjectImp *fallback)
+ : view(v), fallback(fallback)
+{
+// put a function
+#define PUT_FUNC(name, enumval) \
+ putDirect(#name, new KateViewFunction(exec,v,KateViewFunction::enumval,1), DontEnum)
+ fallback->ref();
+
+ PUT_FUNC(keyReturn, KeyReturn);
+ PUT_FUNC(enter, KeyReturn);
+ PUT_FUNC(type, Type);
+ PUT_FUNC(keyDelete, KeyDelete);
+ PUT_FUNC(deleteWordRight, DeleteWordRight);
+ PUT_FUNC(transpose, Transpose);
+ PUT_FUNC(cursorLeft, CursorLeft);
+ PUT_FUNC(cursorPrev, CursorLeft);
+ PUT_FUNC(left, CursorLeft);
+ PUT_FUNC(prev, CursorLeft);
+ PUT_FUNC(shiftCursorLeft, ShiftCursorLeft);
+ PUT_FUNC(shiftCursorPrev, ShiftCursorLeft);
+ PUT_FUNC(shiftLeft, ShiftCursorLeft);
+ PUT_FUNC(shiftPrev, ShiftCursorLeft);
+ PUT_FUNC(cursorRight, CursorRight);
+ PUT_FUNC(cursorNext, CursorRight);
+ PUT_FUNC(right, CursorRight);
+ PUT_FUNC(next, CursorRight);
+ PUT_FUNC(shiftCursorRight, ShiftCursorRight);
+ PUT_FUNC(shiftCursorNext, ShiftCursorRight);
+ PUT_FUNC(shiftRight, ShiftCursorRight);
+ PUT_FUNC(shiftNext, ShiftCursorRight);
+ PUT_FUNC(wordLeft, WordLeft);
+ PUT_FUNC(wordPrev, WordLeft);
+ PUT_FUNC(shiftWordLeft, ShiftWordLeft);
+ PUT_FUNC(shiftWordPrev, ShiftWordLeft);
+ PUT_FUNC(wordRight, WordRight);
+ PUT_FUNC(wordNext, WordRight);
+ PUT_FUNC(shiftWordRight, ShiftWordRight);
+ PUT_FUNC(shiftWordNext, ShiftWordRight);
+ PUT_FUNC(home, Home);
+ PUT_FUNC(shiftHome, ShiftHome);
+ PUT_FUNC(end, End);
+ PUT_FUNC(shiftEnd, ShiftEnd);
+ PUT_FUNC(up, Up);
+ PUT_FUNC(shiftUp, ShiftUp);
+ PUT_FUNC(down, Down);
+ PUT_FUNC(shiftDown, ShiftDown);
+ PUT_FUNC(scrollUp, ScrollUp);
+ PUT_FUNC(scrollDown, ScrollDown);
+ PUT_FUNC(topOfView, TopOfView);
+ PUT_FUNC(shiftTopOfView, ShiftTopOfView);
+ PUT_FUNC(bottomOfView, BottomOfView);
+ PUT_FUNC(shiftBottomOfView, ShiftBottomOfView);
+ PUT_FUNC(pageUp, PageUp);
+ PUT_FUNC(shiftPageUp, ShiftPageUp);
+ PUT_FUNC(pageDown, PageDown);
+ PUT_FUNC(shiftPageDown, ShiftPageDown);
+ PUT_FUNC(top, Top);
+ PUT_FUNC(shiftTop, ShiftTop);
+ PUT_FUNC(bottom, Bottom);
+ PUT_FUNC(shiftBottom, ShiftBottom);
+ PUT_FUNC(toMatchingBracket, ToMatchingBracket);
+ PUT_FUNC(shiftToMatchingBracket, ShiftToMatchingBracket);
+#undef PUT_FUNC
+}
+
+KateViewObject::~KateViewObject()
+{
+ fallback->deref();
+}
+
+const ClassInfo *KateViewObject::classInfo() const {
+ // evil hack II: disguise as fallback, otherwise we can't fall back
+ return fallback->classInfo();
+}
+
+Value KateViewObject::get(ExecState *exec, const Identifier &propertyName) const
+{
+ ValueImp *val = getDirect(propertyName);
+ if (val)
+ return Value(val);
+
+ return fallback->get(exec, propertyName);
+}
+
+//END KateViewObject
+
+//BEGIN KateViewFunction
+
+KateViewFunction::KateViewFunction(ExecState */*exec*/, KateView *v, int _id, int length)
+{
+ m_view = v;
+ id = _id;
+ putDirect("length",length);
+}
+
+bool KateViewFunction::implementsCall() const
+{
+ return true;
+}
+
+Value KateViewFunction::call(ExecState *exec, Object &/*thisObj*/, const List &args)
+{
+ // calls a function repeatedly as specified by its first parameter (once
+ // if not specified).
+#define REP_CALL(enumval, func) \
+ case enumval: {\
+ int cnt = 1;\
+ if (args.size() > 0) cnt = args[0].toInt32(exec);\
+ while (cnt-- > 0) { m_view->func(); }\
+ return Undefined();\
+ }
+ switch (id) {
+ REP_CALL(KeyReturn, keyReturn);
+ REP_CALL(KeyDelete, keyDelete);
+ REP_CALL(DeleteWordRight, deleteWordRight);
+ REP_CALL(Transpose, transpose);
+ REP_CALL(CursorLeft, cursorLeft);
+ REP_CALL(ShiftCursorLeft, shiftCursorLeft);
+ REP_CALL(CursorRight, cursorRight);
+ REP_CALL(ShiftCursorRight, shiftCursorRight);
+ REP_CALL(WordLeft, wordLeft);
+ REP_CALL(ShiftWordLeft, shiftWordLeft);
+ REP_CALL(WordRight, wordRight);
+ REP_CALL(ShiftWordRight, shiftWordRight);
+ REP_CALL(Home, home);
+ REP_CALL(ShiftHome, shiftHome);
+ REP_CALL(End, end);
+ REP_CALL(ShiftEnd, shiftEnd);
+ REP_CALL(Up, up);
+ REP_CALL(ShiftUp, shiftUp);
+ REP_CALL(Down, down);
+ REP_CALL(ShiftDown, shiftDown);
+ REP_CALL(ScrollUp, scrollUp);
+ REP_CALL(ScrollDown, scrollDown);
+ REP_CALL(TopOfView, topOfView);
+ REP_CALL(ShiftTopOfView, shiftTopOfView);
+ REP_CALL(BottomOfView, bottomOfView);
+ REP_CALL(ShiftBottomOfView, shiftBottomOfView);
+ REP_CALL(PageUp, pageUp);
+ REP_CALL(ShiftPageUp, shiftPageUp);
+ REP_CALL(PageDown, pageDown);
+ REP_CALL(ShiftPageDown, shiftPageDown);
+ REP_CALL(Top, top);
+ REP_CALL(ShiftTop, shiftTop);
+ REP_CALL(Bottom, bottom);
+ REP_CALL(ShiftBottom, shiftBottom);
+ REP_CALL(ToMatchingBracket, toMatchingBracket);
+ REP_CALL(ShiftToMatchingBracket, shiftToMatchingBracket);
+ case Type: {
+ UString str = args[0].toString(exec);
+ QString res = str.qstring();
+ return Boolean(m_view->doc()->typeChars(m_view, res));
+ }
+ }
+
+ return Undefined();
+#undef REP_CALL
+}
+
+//END KateViewFunction
+
+//BEGIN OutputObject
+
+OutputObject::OutputObject(KJS::ExecState *exec, KateDocument *d, KateView *v) : doc(d), view(v), changed(0), outstr(0) {
+ putDirect("write", new OutputFunction(exec,this,OutputFunction::Write,-1), DontEnum);
+ putDirect("print", new OutputFunction(exec,this,OutputFunction::Write,-1), DontEnum);
+ putDirect("writeln", new OutputFunction(exec,this,OutputFunction::Writeln,-1), DontEnum);
+ putDirect("println", new OutputFunction(exec,this,OutputFunction::Writeln,-1), DontEnum);
+ putDirect("writeLn", new OutputFunction(exec,this,OutputFunction::Writeln,-1), DontEnum);
+ putDirect("printLn", new OutputFunction(exec,this,OutputFunction::Writeln,-1), DontEnum);
+
+ putDirect("writeCursorPosition", new OutputFunction(exec,this,OutputFunction::WriteCursorPosition,-1), DontEnum);
+ putDirect("cursorPosition", new OutputFunction(exec,this,OutputFunction::WriteCursorPosition,-1), DontEnum);
+ putDirect("pos", new OutputFunction(exec,this,OutputFunction::WriteCursorPosition,-1), DontEnum);
+ putDirect("writeCursorPositionln", new OutputFunction(exec,this,OutputFunction::WriteCursorPositionln,-1), DontEnum);
+ putDirect("cursorPositionln", new OutputFunction(exec,this,OutputFunction::WriteCursorPositionln,-1), DontEnum);
+ putDirect("posln", new OutputFunction(exec,this,OutputFunction::WriteCursorPositionln,-1), DontEnum);
+
+}
+
+OutputObject::~OutputObject() {
+}
+
+KJS::UString OutputObject::className() const {
+ return UString("OutputObject");
+}
+
+//END OutputObject
+
+//BEGIN OutputFunction
+
+OutputFunction::OutputFunction(KJS::ExecState *exec, OutputObject *output, int _id, int length)
+ : o(output)
+{
+ id = _id;
+ if (length >= 0)
+ putDirect("length",length);
+}
+
+bool OutputFunction::implementsCall() const
+{
+ return true;
+}
+
+KJS::Value OutputFunction::call(KJS::ExecState *exec, KJS::Object &thisObj, const KJS::List &args)
+{
+ if (!*o->changed) *o->outstr = QString();
+
+ switch (id) {
+ case Write:
+ case Writeln: {
+ // Gather all parameters and concatenate to string
+ QString res;
+ for (int i = 0; i < args.size(); i++) {
+ res += args[i].toString(exec).qstring();
+ }
+
+ if (id == Writeln)
+ res += "\n";
+
+ *o->outstr += res;
+ break;
+ }
+ case WriteCursorPositionln:
+ case WriteCursorPosition: {
+ // Gather all parameters and concatenate to string
+ QString res;
+ for (int i = 0; i < args.size(); i++) {
+ res += args[i].toString(exec).qstring();
+ }
+
+ // Append cursor position
+ uint l, c;
+ o->view->cursorPosition(&l, &c);
+ res += "(" + QString::number(l) + "," + QString::number(c) + ")";
+
+ if (id == WriteCursorPositionln)
+ res += "\n";
+
+ *o->outstr += res;
+ break;
+ }
+ }
+
+ *o->changed = true;
+ return Undefined();
+}
+
+//END OutputFunction
+
+// -------------------------------------------------------------------------
+
+const char failureSnapshotPrefix[] = "testkateregressionrc-FS.";
+
+static QString findMostRecentFailureSnapshot() {
+ QDir dir(kapp->dirs()->saveLocation("config"),
+ QString(failureSnapshotPrefix)+"*",
+ QDir::Time, QDir::Files);
+ return dir[0].mid(sizeof failureSnapshotPrefix - 1);
+}
+
+static KCmdLineOptions options[] =
+{
+ { "b", 0, 0 },
+ { "base <base_dir>", "Directory containing tests, basedir and output directories.", 0},
+ { "cmp-failures <snapshot>", "Compare failures of this testrun against snapshot <snapshot>. Defaults to the most recently captured failure snapshot or none if none exists.", 0 },
+ { "d", 0, 0 },
+ { "debug", "Do not supress debug output", 0},
+ { "g", 0, 0 } ,
+ { "genoutput", "Regenerate baseline (instead of checking)", 0 } ,
+ { "keep-output", "Keep output files even on success", 0 },
+ { "save-failures <snapshot>", "Save failures of this testrun as failure snapshot <snapshot>", 0 },
+ { "s", 0, 0 } ,
+ { "show", "Show the window while running tests", 0 } ,
+ { "t", 0, 0 } ,
+ { "test <filename>", "Only run a single test. Multiple options allowed.", 0 } ,
+ { "o", 0, 0 },
+ { "output <directory>", "Put output in <directory> instead of <base_dir>/output", 0 } ,
+ { "+[base_dir]", "Directory containing tests,basedir and output directories. Only regarded if -b is not specified.", 0 } ,
+ { "+[testcases]", "Relative path to testcase, or directory of testcases to be run (equivalent to -t).", 0 } ,
+ KCmdLineLastOption
+};
+
+int main(int argc, char *argv[])
+{
+ // forget about any settings
+ passwd* pw = getpwuid( getuid() );
+ if (!pw) {
+ fprintf(stderr, "dang, I don't even know who I am.\n");
+ exit(1);
+ }
+
+ QString kh("/var/tmp/%1_kate_non_existent");
+ kh = kh.arg( pw->pw_name );
+ setenv( "KDEHOME", kh.latin1(), 1 );
+ setenv( "LC_ALL", "C", 1 );
+ setenv( "LANG", "C", 1 );
+
+// signal( SIGALRM, signal_handler );
+
+ KCmdLineArgs::init(argc, argv, "testregression", "TestRegression",
+ "Regression tester for kate", "1.0");
+ KCmdLineArgs::addCmdLineOptions(options);
+
+ KCmdLineArgs *args = KCmdLineArgs::parsedArgs( );
+
+ QCString baseDir = args->getOption("base");
+ QCString baseDirConfigFile(::getenv("HOME") + QCString(BASE_DIR_CONFIG));
+ {
+ QFile baseDirConfig(baseDirConfigFile);
+ if (baseDirConfig.open(IO_ReadOnly)) {
+ QTextStream bds(&baseDirConfig);
+ baseDir = bds.readLine().latin1();
+ }
+ }
+
+ if ( args->count() < 1 && baseDir.isEmpty() ) {
+ printf("For regression testing, make sure to have checked out the kate regression\n"
+ "testsuite from svn:\n"
+ "\tsvn co \"https://<user>@svn.kde.org:/home/kde/trunk/tests/katetests/regression\"\n"
+ "Remember the root path into which you checked out the testsuite.\n"
+ "\n");
+ printf("%s needs the root path of the kate regression\n"
+ "testsuite to function properly\n"
+ "By default, the root path is looked up in the file\n"
+ "\t%s\n"
+ "If it doesn't exist yet, create it by invoking\n"
+ "\techo \"<root-path>\" > %s\n"
+ "You may override the location by specifying the root explicitly on the\n"
+ "command line with option -b\n"
+ "", KCmdLineArgs::appName(),
+ (const char *)baseDirConfigFile,
+ (const char *)baseDirConfigFile);
+ ::exit( 1 );
+ }
+
+ int testcase_index = 0;
+ if (baseDir.isEmpty()) baseDir = args->arg(testcase_index++);
+
+ QFileInfo bdInfo(baseDir);
+ baseDir = QFile::encodeName(bdInfo.absFilePath());
+
+ const char *subdirs[] = {"tests", "baseline", "output", "resources"};
+ for ( int i = 0; i < 2; i++ ) {
+ QFileInfo sourceDir(QFile::encodeName( baseDir ) + "/" + subdirs[i]);
+ if ( !sourceDir.exists() || !sourceDir.isDir() ) {
+ fprintf(stderr,"ERROR: Source directory \"%s/%s\": no such directory.\n", (const char *)baseDir, subdirs[i]);
+ exit(1);
+ }
+ }
+
+ KApplication a;
+ a.disableAutoDcopRegistration();
+ a.setStyle("windows");
+ KSimpleConfig cfg( "testkateregressionrc" );
+ cfg.setGroup("Kate Document Defaults");
+ cfg.writeEntry("Basic Config Flags",
+ KateDocumentConfig::cfBackspaceIndents
+// | KateDocumentConfig::cfWordWrap
+// | KateDocumentConfig::cfRemoveSpaces
+ | KateDocumentConfig::cfWrapCursor
+// | KateDocumentConfig::cfAutoBrackets
+// | KateDocumentConfig::cfTabIndentsMode
+// | KateDocumentConfig::cfOvr
+ | KateDocumentConfig::cfKeepIndentProfile
+ | KateDocumentConfig::cfKeepExtraSpaces
+ | KateDocumentConfig::cfTabIndents
+ | KateDocumentConfig::cfShowTabs
+ | KateDocumentConfig::cfSpaceIndent
+ | KateDocumentConfig::cfSmartHome
+ | KateDocumentConfig::cfTabInsertsTab
+// | KateDocumentConfig::cfReplaceTabsDyn
+// | KateDocumentConfig::cfRemoveTrailingDyn
+ | KateDocumentConfig::cfDoxygenAutoTyping
+// | KateDocumentConfig::cfMixedIndent
+ | KateDocumentConfig::cfIndentPastedText
+ );
+ cfg.sync();
+
+ int rv = 1;
+
+ {
+ KSimpleConfig dc( "kdebugrc" );
+ // FIXME adapt to kate
+ static int areas[] = { 1000, 13000, 13001, 13002, 13010,
+ 13020, 13025, 13030, 13033, 13035,
+ 13040, 13050, 13051, 7000, 7006, 170,
+ 171, 7101, 7002, 7019, 7027, 7014,
+ 7001, 7011, 6070, 6080, 6090, 0};
+ int channel = args->isSet( "debug" ) ? 2 : 4;
+ for ( int i = 0; areas[i]; ++i ) {
+ dc.setGroup( QString::number( areas[i] ) );
+ dc.writeEntry( "InfoOutput", channel );
+ }
+ dc.sync();
+
+ kdClearDebugConfig();
+ }
+
+ // create widgets
+ KateFactory *fac = KateFactory::self();
+ KMainWindow *toplevel = new KMainWindow();
+ KateDocument *part = new KateDocument(/*bSingleViewMode*/true,
+ /*bBrowserView*/false,
+ /*bReadOnly*/false,
+ /*parentWidget*/toplevel,
+ /*widgetName*/"testkate");
+ part->readConfig(&cfg);
+
+ toplevel->setCentralWidget( part->widget() );
+
+ Q_ASSERT(part->config()->configFlags() & KateDocumentConfig::cfDoxygenAutoTyping);
+
+ bool visual = false;
+ if (args->isSet("show"))
+ visual = true;
+
+ a.setTopWidget(part->widget());
+ a.setMainWidget( toplevel );
+ if ( visual )
+ toplevel->show();
+
+ // we're not interested
+ toplevel->statusBar()->hide();
+
+ if (!getenv("KDE_DEBUG")) {
+ // set ulimits
+ rlimit vmem_limit = { 256*1024*1024, RLIM_INFINITY }; // 256Mb Memory should suffice
+ setrlimit(RLIMIT_AS, &vmem_limit);
+ rlimit stack_limit = { 8*1024*1024, RLIM_INFINITY }; // 8Mb Memory should suffice
+ setrlimit(RLIMIT_STACK, &stack_limit);
+ }
+
+ // run the tests
+ RegressionTest *regressionTest = new RegressionTest(part,
+ &cfg,
+ baseDir,
+ args->getOption("output"),
+ args->isSet("genoutput"));
+ QObject::connect(part->browserExtension(), SIGNAL(openURLRequest(const KURL &, const KParts::URLArgs &)),
+ regressionTest, SLOT(slotOpenURL(const KURL&, const KParts::URLArgs &)));
+ QObject::connect(part->browserExtension(), SIGNAL(resizeTopLevelWidget( int, int )),
+ regressionTest, SLOT(resizeTopLevelWidget( int, int )));
+
+ regressionTest->m_keepOutput = args->isSet("keep-output");
+ regressionTest->m_showGui = args->isSet("show");
+
+ {
+ QString failureSnapshot = args->getOption("cmp-failures");
+ if (failureSnapshot.isEmpty())
+ failureSnapshot = findMostRecentFailureSnapshot();
+ if (!failureSnapshot.isEmpty())
+ regressionTest->setFailureSnapshotConfig(
+ new KSimpleConfig(failureSnapshotPrefix + failureSnapshot, true),
+ failureSnapshot);
+ }
+
+ if (args->isSet("save-failures")) {
+ QString failureSaver = args->getOption("save-failures");
+ regressionTest->setFailureSnapshotSaver(
+ new KSimpleConfig(failureSnapshotPrefix + failureSaver, false),
+ failureSaver);
+ }
+
+ bool result = false;
+ QCStringList tests = args->getOptionList("test");
+ // merge testcases specified on command line
+ for (; testcase_index < args->count(); testcase_index++)
+ tests << args->arg(testcase_index);
+ if (tests.count() > 0)
+ for (QValueListConstIterator<QCString> it = tests.begin(); it != tests.end(); ++it) {
+ result = regressionTest->runTests(*it,true);
+ if (!result) break;
+ }
+ else
+ result = regressionTest->runTests();
+
+ if (result) {
+ if (args->isSet("genoutput")) {
+ printf("\nOutput generation completed.\n");
+ }
+ else {
+ printf("\nTests completed.\n");
+ printf("Total: %d\n",
+ regressionTest->m_passes_work+
+ regressionTest->m_passes_fail+
+ regressionTest->m_failures_work+
+ regressionTest->m_failures_fail+
+ regressionTest->m_errors);
+ printf("Passes: %d",regressionTest->m_passes_work);
+ if ( regressionTest->m_passes_fail )
+ printf( " (%d unexpected passes)", regressionTest->m_passes_fail );
+ if (regressionTest->m_passes_new)
+ printf(" (%d new since %s)", regressionTest->m_passes_new, regressionTest->m_failureComp->group().latin1());
+ printf( "\n" );
+ printf("Failures: %d",regressionTest->m_failures_work);
+ if ( regressionTest->m_failures_fail )
+ printf( " (%d expected failures)", regressionTest->m_failures_fail );
+ if ( regressionTest->m_failures_new )
+ printf(" (%d new since %s)", regressionTest->m_failures_new, regressionTest->m_failureComp->group().latin1());
+ printf( "\n" );
+ if ( regressionTest->m_errors )
+ printf("Errors: %d\n",regressionTest->m_errors);
+
+ QFile list( regressionTest->m_outputDir + "/links.html" );
+ list.open( IO_WriteOnly|IO_Append );
+ QString link, cl;
+ link = QString( "<hr>%1 failures. (%2 expected failures)" )
+ .arg(regressionTest->m_failures_work )
+ .arg( regressionTest->m_failures_fail );
+ if (regressionTest->m_failures_new)
+ link += QString(" <span style=\"color:red;font-weight:bold\">(%1 new failures since %2)</span>")
+ .arg(regressionTest->m_failures_new)
+ .arg(regressionTest->m_failureComp->group());
+ if (regressionTest->m_passes_new)
+ link += QString(" <p style=\"color:green;font-weight:bold\">%1 new passes since %2</p>")
+ .arg(regressionTest->m_passes_new)
+ .arg(regressionTest->m_failureComp->group());
+ list.writeBlock( link.latin1(), link.length() );
+ list.close();
+ }
+ }
+
+ // Only return a 0 exit code if all tests were successful
+ if (regressionTest->m_failures_work == 0 && regressionTest->m_errors == 0)
+ rv = 0;
+
+ // cleanup
+ delete regressionTest;
+ delete part;
+ delete toplevel;
+// delete fac;
+
+ return rv;
+}
+
+// -------------------------------------------------------------------------
+
+RegressionTest *RegressionTest::curr = 0;
+
+RegressionTest::RegressionTest(KateDocument *part, KConfig *baseConfig,
+ const QString &baseDir,
+ const QString &outputDir, bool _genOutput)
+ : QObject(part)
+{
+ m_part = part;
+ m_view = static_cast<KateView *>(m_part->widget());
+ m_baseConfig = baseConfig;
+ m_baseDir = baseDir;
+ m_baseDir = m_baseDir.replace( "//", "/" );
+ if ( m_baseDir.endsWith( "/" ) )
+ m_baseDir = m_baseDir.left( m_baseDir.length() - 1 );
+ if (outputDir.isEmpty())
+ m_outputDir = m_baseDir + "/output";
+ else
+ m_outputDir = outputDir;
+ createMissingDirs(m_outputDir + "/");
+ m_keepOutput = false;
+ m_genOutput = _genOutput;
+ m_failureComp = 0;
+ m_failureSave = 0;
+ m_showGui = false;
+ m_passes_work = m_passes_fail = m_passes_new = 0;
+ m_failures_work = m_failures_fail = m_failures_new = 0;
+ m_errors = 0;
+
+ ::unlink( QFile::encodeName( m_outputDir + "/links.html" ) );
+ QFile f( m_outputDir + "/empty.html" );
+ QString s;
+ f.open( IO_WriteOnly | IO_Truncate );
+ s = "<html><body>Follow the white rabbit";
+ f.writeBlock( s.latin1(), s.length() );
+ f.close();
+ f.setName( m_outputDir + "/index.html" );
+ f.open( IO_WriteOnly | IO_Truncate );
+ s = "<html><frameset cols=150,*><frame src=links.html><frame name=content src=empty.html>";
+ f.writeBlock( s.latin1(), s.length() );
+ f.close();
+
+ curr = this;
+}
+
+#include <qobjectlist.h>
+
+static QStringList readListFile( const QString &filename )
+{
+ // Read ignore file for this directory
+ QString ignoreFilename = filename;
+ QFileInfo ignoreInfo(ignoreFilename);
+ QStringList ignoreFiles;
+ if (ignoreInfo.exists()) {
+ QFile ignoreFile(ignoreFilename);
+ if (!ignoreFile.open(IO_ReadOnly)) {
+ fprintf(stderr,"Can't open %s\n",ignoreFilename.latin1());
+ exit(1);
+ }
+ QTextStream ignoreStream(&ignoreFile);
+ QString line;
+ while (!(line = ignoreStream.readLine()).isNull())
+ ignoreFiles.append(line);
+ ignoreFile.close();
+ }
+ return ignoreFiles;
+}
+
+RegressionTest::~RegressionTest()
+{
+ // Important! Delete comparison config *first* as saver config
+ // might point to the same physical file.
+ delete m_failureComp;
+ delete m_failureSave;
+}
+
+void RegressionTest::setFailureSnapshotConfig(KConfig *cfg, const QString &sname)
+{
+ Q_ASSERT(cfg);
+ m_failureComp = cfg;
+ m_failureComp->setGroup(sname);
+}
+
+void RegressionTest::setFailureSnapshotSaver(KConfig *cfg, const QString &sname)
+{
+ Q_ASSERT(cfg);
+ m_failureSave = cfg;
+ m_failureSave->setGroup(sname);
+}
+
+QStringList RegressionTest::concatListFiles(const QString &relPath, const QString &filename)
+{
+ QStringList cmds;
+ int pos = relPath.findRev('/');
+ if (pos >= 0)
+ cmds += concatListFiles(relPath.left(pos), filename);
+ cmds += readListFile(m_baseDir + "/tests/" + relPath + "/" + filename);
+ return cmds;
+}
+
+bool RegressionTest::runTests(QString relPath, bool mustExist, int known_failure)
+{
+ m_currentOutput = QString::null;
+
+ if (!QFile(m_baseDir + "/tests/"+relPath).exists()) {
+ fprintf(stderr,"%s: No such file or directory\n",relPath.latin1());
+ return false;
+ }
+
+ QString fullPath = m_baseDir + "/tests/"+relPath;
+ QFileInfo info(fullPath);
+
+ if (!info.exists() && mustExist) {
+ fprintf(stderr,"%s: No such file or directory\n",relPath.latin1());
+ return false;
+ }
+
+ if (!info.isReadable() && mustExist) {
+ fprintf(stderr,"%s: Access denied\n",relPath.latin1());
+ return false;
+ }
+
+ if (info.isDir()) {
+ QStringList ignoreFiles = readListFile( m_baseDir + "/tests/"+relPath+"/ignore" );
+ QStringList failureFiles = readListFile( m_baseDir + "/tests/"+relPath+"/KNOWN_FAILURES" );
+
+ // Run each test in this directory, recusively
+ QDir sourceDir(m_baseDir + "/tests/"+relPath);
+ for (uint fileno = 0; fileno < sourceDir.count(); fileno++) {
+ QString filename = sourceDir[fileno];
+ QString relFilename = relPath.isEmpty() ? filename : relPath+"/"+filename;
+
+ if (filename.startsWith(".") || ignoreFiles.contains(filename) )
+ continue;
+ int failure_type = NoFailure;
+ if ( failureFiles.contains( filename ) )
+ failure_type |= AllFailure;
+ if ( failureFiles.contains ( filename + "-result" ) )
+ failure_type |= ResultFailure;
+ runTests(relFilename, false, failure_type);
+ }
+ }
+ else if (info.isFile()) {
+
+ QString relativeDir = QFileInfo(relPath).dirPath();
+ QString filename = info.fileName();
+ m_currentBase = m_baseDir + "/tests/"+relativeDir;
+ m_currentCategory = relativeDir;
+ m_currentTest = filename;
+ m_known_failures = known_failure;
+ m_outputCustomised = false;
+ // gather commands
+ // directory-specific commands
+ QStringList commands = concatListFiles(relPath, ".kateconfig-commands");
+ // testcase-specific commands
+ commands += readListFile(m_currentBase + "/" + filename + "-commands");
+
+ rereadConfig(); // reset options to default
+ if ( filename.endsWith(".txt") ) {
+#if 0
+ if ( relPath.startsWith( "domts/" ) && !m_runJS )
+ return true;
+ if ( relPath.startsWith( "ecma/" ) && !m_runJS )
+ return true;
+#endif
+// if ( m_runHTML )
+ testStaticFile(relPath, commands);
+ }
+ else if (mustExist) {
+ fprintf(stderr,"%s: Not a valid test file (must be .txt)\n",relPath.latin1());
+ return false;
+ }
+ } else if (mustExist) {
+ fprintf(stderr,"%s: Not a regular file\n",relPath.latin1());
+ return false;
+ }
+
+ return true;
+}
+
+void RegressionTest::createLink( const QString& test, int failures )
+{
+ createMissingDirs( m_outputDir + "/" + test + "-compare.html" );
+
+ QFile list( m_outputDir + "/links.html" );
+ list.open( IO_WriteOnly|IO_Append );
+ QString link;
+ link = QString( "<a href=\"%1\" target=\"content\" title=\"%2\">" )
+ .arg( test + "-compare.html" )
+ .arg( test );
+ link += m_currentTest;
+ link += "</a> ";
+ if (failures & NewFailure)
+ link += "<span style=\"font-weight:bold;color:red\">";
+ link += "[";
+ if ( failures & ResultFailure )
+ link += "R";
+ link += "]";
+ if (failures & NewFailure)
+ link += "</span>";
+ link += "<br>\n";
+ list.writeBlock( link.latin1(), link.length() );
+ list.close();
+}
+
+/** returns the path in a way that is relatively reachable from base.
+ * @param base base directory (must not include trailing slash)
+ * @param path directory/file to be relatively reached by base
+ * @return path with all elements replaced by .. and concerning path elements
+ * to be relatively reachable from base.
+ */
+static QString makeRelativePath(const QString &base, const QString &path)
+{
+ QString absBase = QFileInfo(base).absFilePath();
+ QString absPath = QFileInfo(path).absFilePath();
+// kdDebug() << "absPath: \"" << absPath << "\"" << endl;
+// kdDebug() << "absBase: \"" << absBase << "\"" << endl;
+
+ // walk up to common ancestor directory
+ int pos = 0;
+ do {
+ pos++;
+ int newpos = absBase.find('/', pos);
+ if (newpos == -1) newpos = absBase.length();
+ QConstString cmpPathComp(absPath.unicode() + pos, newpos - pos);
+ QConstString cmpBaseComp(absBase.unicode() + pos, newpos - pos);
+// kdDebug() << "cmpPathComp: \"" << cmpPathComp.string() << "\"" << endl;
+// kdDebug() << "cmpBaseComp: \"" << cmpBaseComp.string() << "\"" << endl;
+// kdDebug() << "pos: " << pos << " newpos: " << newpos << endl;
+ if (cmpPathComp.string() != cmpBaseComp.string()) { pos--; break; }
+ pos = newpos;
+ } while (pos < (int)absBase.length() && pos < (int)absPath.length());
+ int basepos = pos < (int)absBase.length() ? pos + 1 : pos;
+ int pathpos = pos < (int)absPath.length() ? pos + 1 : pos;
+
+// kdDebug() << "basepos " << basepos << " pathpos " << pathpos << endl;
+
+ QString rel;
+ {
+ QConstString relBase(absBase.unicode() + basepos, absBase.length() - basepos);
+ QConstString relPath(absPath.unicode() + pathpos, absPath.length() - pathpos);
+ // generate as many .. as there are path elements in relBase
+ if (relBase.string().length() > 0) {
+ for (int i = relBase.string().contains('/'); i > 0; --i)
+ rel += "../";
+ rel += "..";
+ if (relPath.string().length() > 0) rel += "/";
+ }
+ rel += relPath.string();
+ }
+ return rel;
+}
+
+/** processes events for at least \c msec milliseconds */
+static void pause(int msec)
+{
+ QTime t;
+ t.start();
+ do {
+ kapp->processEvents();
+ } while (t.elapsed() < msec);
+}
+
+void RegressionTest::doFailureReport( const QString& test, int failures )
+{
+ if ( failures == NoFailure ) {
+ ::unlink( QFile::encodeName( m_outputDir + "/" + test + "-compare.html" ) );
+ return;
+ }
+
+ createLink( test, failures );
+
+ QFile compare( m_outputDir + "/" + test + "-compare.html" );
+
+ QString testFile = QFileInfo(test).fileName();
+
+ QString renderDiff;
+ QString domDiff;
+
+ QString relOutputDir = makeRelativePath(m_baseDir, m_outputDir);
+
+ // are blocking reads possible with KProcess?
+ char pwd[PATH_MAX];
+ (void) getcwd( pwd, PATH_MAX );
+ chdir( QFile::encodeName( m_baseDir ) );
+
+ if ( failures & ResultFailure ) {
+ domDiff += "<pre>";
+ FILE *pipe = popen( QString::fromLatin1( "diff -u baseline/%1-result %3/%2-result" )
+ .arg ( test, test, relOutputDir ).latin1(), "r" );
+ QTextIStream *is = new QTextIStream( pipe );
+ for ( int line = 0; line < 100 && !is->eof(); ++line ) {
+ QString line = is->readLine();
+ line = line.replace( '<', "&lt;" );
+ line = line.replace( '>', "&gt;" );
+ domDiff += line + "\n";
+ }
+ delete is;
+ pclose( pipe );
+ domDiff += "</pre>";
+ }
+
+ chdir( pwd );
+
+ // create a relative path so that it works via web as well. ugly
+ QString relpath = makeRelativePath(m_outputDir + "/"
+ + QFileInfo(test).dirPath(), m_baseDir);
+
+ compare.open( IO_WriteOnly|IO_Truncate );
+ QString cl;
+ cl = QString( "<html><head><title>%1</title>" ).arg( test );
+ cl += QString( "<script>\n"
+ "var pics = new Array();\n"
+ "pics[0]=new Image();\n"
+ "pics[0].src = '%1';\n"
+ "pics[1]=new Image();\n"
+ "pics[1].src = '%2';\n"
+ "var doflicker = 1;\n"
+ "var t = 1;\n"
+ "var lastb=0;\n" )
+ .arg( relpath+"/baseline/"+test+"-dump.png" )
+ .arg( testFile+"-dump.png" );
+ cl += QString( "function toggleVisible(visible) {\n"
+ " document.getElementById('render').style.visibility= visible == 'render' ? 'visible' : 'hidden';\n"
+ " document.getElementById('image').style.visibility= visible == 'image' ? 'visible' : 'hidden';\n"
+ " document.getElementById('dom').style.visibility= visible == 'dom' ? 'visible' : 'hidden';\n"
+ "}\n"
+ "function show() { document.getElementById('image').src = pics[t].src; "
+ "document.getElementById('image').style.borderColor = t && !doflicker ? 'red' : 'gray';\n"
+ "toggleVisible('image');\n"
+ "}" );
+ cl += QString ( "function runSlideShow(){\n"
+ " document.getElementById('image').src = pics[t].src;\n"
+ " if (doflicker)\n"
+ " t = 1 - t;\n"
+ " setTimeout('runSlideShow()', 200);\n"
+ "}\n"
+ "function m(b) { if (b == lastb) return; document.getElementById('b'+b).className='buttondown';\n"
+ " var e = document.getElementById('b'+lastb);\n"
+ " if(e) e.className='button';\n"
+ " lastb = b;\n"
+ "}\n"
+ "function showRender() { doflicker=0;toggleVisible('render')\n"
+ "}\n"
+ "function showDom() { doflicker=0;toggleVisible('dom')\n"
+ "}\n"
+ "</script>\n");
+
+ cl += QString ("<style>\n"
+ ".buttondown { cursor: pointer; padding: 0px 20px; color: white; background-color: blue; border: inset blue 2px;}\n"
+ ".button { cursor: pointer; padding: 0px 20px; color: black; background-color: white; border: outset blue 2px;}\n"
+ ".diff { position: absolute; left: 10px; top: 100px; visibility: hidden; border: 1px black solid; background-color: white; color: black; /* width: 800; height: 600; overflow: scroll; */ }\n"
+ "</style>\n" );
+
+ cl += QString( "<body onload=\"m(5); toggleVisible('dom');\"" );
+ cl += QString(" text=black bgcolor=gray>\n<h1>%3</h1>\n" ).arg( test );
+ if ( renderDiff.length() )
+ cl += "<span id='b4' class='button' onclick='showRender();m(4)'>R-DIFF</span>&nbsp;\n";
+ if ( domDiff.length() )
+ cl += "<span id='b5' class='button' onclick='showDom();m(5);'>D-DIFF</span>&nbsp;\n";
+ // The test file always exists - except for checkOutput called from *.js files
+ if ( QFile::exists( m_baseDir + "/tests/"+ test ) )
+ cl += QString( "<a class=button href=\"%1\">HTML</a>&nbsp;" )
+ .arg( relpath+"/tests/"+test );
+
+ cl += QString( "<hr>"
+ "<img style='border: solid 5px gray' src=\"%1\" id='image'>" )
+ .arg( relpath+"/baseline/"+test+"-dump.png" );
+
+ cl += "<div id='render' class='diff'>" + renderDiff + "</div>";
+ cl += "<div id='dom' class='diff'>" + domDiff + "</div>";
+
+ cl += "</body></html>";
+ compare.writeBlock( cl.latin1(), cl.length() );
+ compare.close();
+}
+
+void RegressionTest::testStaticFile(const QString & filename, const QStringList &commands)
+{
+ qApp->mainWidget()->resize( 800, 600); // restore size
+
+ // Set arguments
+ KParts::URLArgs args;
+ if (filename.endsWith(".txt")) args.serviceType = "text/plain";
+ m_part->browserExtension()->setURLArgs(args);
+ // load page
+ KURL url;
+ url.setProtocol("file");
+ url.setPath(QFileInfo(m_baseDir + "/tests/"+filename).absFilePath());
+ m_part->openURL(url);
+
+ // inject commands
+ for (QStringList::ConstIterator cit = commands.begin(); cit != commands.end(); ++cit) {
+ QString str = (*cit).stripWhiteSpace();
+ if (str.isEmpty() || str.startsWith("#")) continue;
+ Kate::Command *cmd = KateCmd::self()->queryCommand(str);
+ if (cmd) {
+ QString msg;
+ if (!cmd->exec(m_view, str, msg))
+ fprintf(stderr, "ERROR executing command '%s': %s\n", str.latin1(), msg.latin1());
+ }
+ }
+
+ pause(200);
+
+ Q_ASSERT(m_part->config()->configFlags() & KateDocumentConfig::cfDoxygenAutoTyping);
+
+ bool script_error = false;
+ {
+ // Execute script
+ TestJScriptEnv jsenv(m_part);
+ jsenv.output()->setChangedFlag(&m_outputCustomised);
+ jsenv.output()->setOutputString(&m_outputString);
+ script_error = evalJS(jsenv.interpreter(), m_baseDir + "/tests/"+QFileInfo(filename).dirPath()+"/.kateconfig-script", true)
+ && evalJS(jsenv.interpreter(), m_baseDir + "/tests/"+filename+"-script");
+ }
+
+ int back_known_failures = m_known_failures;
+
+ if (!script_error) goto bail_out;
+
+ if (m_showGui) kapp->processEvents();
+
+ if ( m_genOutput ) {
+ reportResult(checkOutput(filename+"-result"), "result");
+ } else {
+ int failures = NoFailure;
+
+ // compare with output file
+ if ( m_known_failures & ResultFailure)
+ m_known_failures = AllFailure;
+ bool newfail;
+ if ( !reportResult( checkOutput(filename+"-result"), "result", &newfail ) )
+ failures |= ResultFailure;
+ if (newfail)
+ failures |= NewFailure;
+
+ doFailureReport(filename, failures );
+ }
+
+bail_out:
+ m_known_failures = back_known_failures;
+ m_part->setModified(false);
+ m_part->closeURL();
+}
+
+bool RegressionTest::evalJS(Interpreter &interp, const QString &filename, bool ignore_nonexistent)
+{
+ QString fullSourceName = filename;
+ QFile sourceFile(fullSourceName);
+
+ if (!sourceFile.open(IO_ReadOnly)) {
+ if (!ignore_nonexistent) {
+ fprintf(stderr,"ERROR reading file %s\n",fullSourceName.latin1());
+ m_errors++;
+ }
+ return ignore_nonexistent;
+ }
+
+ QTextStream stream ( &sourceFile );
+ stream.setEncoding( QTextStream::UnicodeUTF8 );
+ QString code = stream.read();
+ sourceFile.close();
+
+ saw_failure = false;
+ ignore_errors = false;
+ Completion c = interp.evaluate(UString( code ) );
+
+ if ( /*report_result &&*/ !ignore_errors) {
+ if (c.complType() == Throw) {
+ QString errmsg = c.value().toString(interp.globalExec()).qstring();
+ printf( "ERROR: %s (%s)\n",filename.latin1(), errmsg.latin1());
+ m_errors++;
+ return false;
+ }
+ }
+ return true;
+}
+
+class GlobalImp : public ObjectImp {
+public:
+ virtual UString className() const { return "global"; }
+};
+
+RegressionTest::CheckResult RegressionTest::checkOutput(const QString &againstFilename)
+{
+ QString absFilename = QFileInfo(m_baseDir + "/baseline/" + againstFilename).absFilePath();
+ if ( svnIgnored( absFilename ) ) {
+ m_known_failures = NoFailure;
+ return Ignored;
+ }
+
+ CheckResult result = Success;
+
+ // compare result to existing file
+ QString outputFilename = QFileInfo(m_outputDir + "/" + againstFilename).absFilePath();
+ bool kf = false;
+ if ( m_known_failures & AllFailure )
+ kf = true;
+ if ( kf )
+ outputFilename += "-KF";
+
+ if ( m_genOutput )
+ outputFilename = absFilename;
+
+ // get existing content
+ QString data;
+ if (m_outputCustomised) {
+ data = m_outputString;
+ } else {
+ data = m_part->text();
+ }
+
+ QFile file(absFilename);
+ if (file.open(IO_ReadOnly)) {
+ QTextStream stream ( &file );
+ stream.setEncoding( QTextStream::UnicodeUTF8 );
+
+ QString fileData = stream.read();
+
+ result = ( fileData == data ) ? Success : Failure;
+ if ( !m_genOutput && result == Success && !m_keepOutput ) {
+ ::unlink( QFile::encodeName( outputFilename ) );
+ return Success;
+ }
+ } else if (!m_genOutput) {
+ fprintf(stderr, "Error reading file %s\n", absFilename.latin1());
+ result = Failure;
+ }
+
+ // generate result file
+ createMissingDirs( outputFilename );
+ QFile file2(outputFilename);
+ if (!file2.open(IO_WriteOnly)) {
+ fprintf(stderr,"Error writing to file %s\n",outputFilename.latin1());
+ exit(1);
+ }
+
+ QTextStream stream2(&file2);
+ stream2.setEncoding( QTextStream::UnicodeUTF8 );
+ stream2 << data;
+ if ( m_genOutput )
+ printf("Generated %s\n", outputFilename.latin1());
+
+ return result;
+}
+
+void RegressionTest::rereadConfig()
+{
+ m_baseConfig->setGroup("Kate Document Defaults");
+ m_part->config()->readConfig(m_baseConfig);
+ m_baseConfig->setGroup("Kate View Defaults");
+ m_view->config()->readConfig(m_baseConfig);
+}
+
+bool RegressionTest::reportResult(CheckResult result, const QString & description, bool *newfail)
+{
+ if ( result == Ignored ) {
+ //printf("IGNORED: ");
+ //printDescription( description );
+ return true; // no error
+ } else
+ return reportResult( result == Success, description, newfail );
+}
+
+bool RegressionTest::reportResult(bool passed, const QString & description, bool *newfail)
+{
+ if (newfail) *newfail = false;
+
+ if (m_genOutput)
+ return true;
+
+ QString filename(m_currentTest + "-" + description);
+ if (!m_currentCategory.isEmpty())
+ filename = m_currentCategory + "/" + filename;
+
+ const bool oldfailed = m_failureComp && m_failureComp->readNumEntry(filename);
+ if (passed) {
+ if ( m_known_failures & AllFailure ) {
+ printf("PASS (unexpected!)");
+ m_passes_fail++;
+ } else {
+ printf("PASS");
+ m_passes_work++;
+ }
+ if (oldfailed) {
+ printf(" (new)");
+ m_passes_new++;
+ }
+ if (m_failureSave)
+ m_failureSave->deleteEntry(filename);
+ }
+ else {
+ if ( m_known_failures & AllFailure ) {
+ printf("FAIL (known)");
+ m_failures_fail++;
+ passed = true; // we knew about it
+ } else {
+ printf("FAIL");
+ m_failures_work++;
+ }
+ if (!oldfailed && m_failureComp) {
+ printf(" (new)");
+ m_failures_new++;
+ if (newfail) *newfail = true;
+ }
+ if (m_failureSave)
+ m_failureSave->writeEntry(filename, 1);
+ }
+ printf(": ");
+
+ printDescription( description );
+ return passed;
+}
+
+void RegressionTest::printDescription(const QString& description)
+{
+ if (!m_currentCategory.isEmpty())
+ printf("%s/", m_currentCategory.latin1());
+
+ printf("%s", m_currentTest.latin1());
+
+ if (!description.isEmpty()) {
+ QString desc = description;
+ desc.replace( '\n', ' ' );
+ printf(" [%s]", desc.latin1());
+ }
+
+ printf("\n");
+ fflush(stdout);
+}
+
+void RegressionTest::createMissingDirs(const QString & filename)
+{
+ QFileInfo dif(filename);
+ QFileInfo dirInfo( dif.dirPath() );
+ if (dirInfo.exists())
+ return;
+
+ QStringList pathComponents;
+ QFileInfo parentDir = dirInfo;
+ pathComponents.prepend(parentDir.absFilePath());
+ while (!parentDir.exists()) {
+ QString parentPath = parentDir.absFilePath();
+ int slashPos = parentPath.findRev('/');
+ if (slashPos < 0)
+ break;
+ parentPath = parentPath.left(slashPos);
+ pathComponents.prepend(parentPath);
+ parentDir = QFileInfo(parentPath);
+ }
+ for (uint pathno = 1; pathno < pathComponents.count(); pathno++) {
+ if (!QFileInfo(pathComponents[pathno]).exists() &&
+ !QDir(pathComponents[pathno-1]).mkdir(pathComponents[pathno])) {
+ fprintf(stderr,"Error creating directory %s\n",pathComponents[pathno].latin1());
+ exit(1);
+ }
+ }
+}
+
+void RegressionTest::slotOpenURL(const KURL &url, const KParts::URLArgs &args)
+{
+ m_part->browserExtension()->setURLArgs( args );
+
+ m_part->openURL(url);
+}
+
+bool RegressionTest::svnIgnored( const QString &filename )
+{
+ QFileInfo fi( filename );
+ QString ignoreFilename = fi.dirPath() + "/svnignore";
+ QFile ignoreFile(ignoreFilename);
+ if (!ignoreFile.open(IO_ReadOnly))
+ return false;
+
+ QTextStream ignoreStream(&ignoreFile);
+ QString line;
+ while (!(line = ignoreStream.readLine()).isNull()) {
+ if ( line == fi.fileName() )
+ return true;
+ }
+ ignoreFile.close();
+ return false;
+}
+
+void RegressionTest::resizeTopLevelWidget( int w, int h )
+{
+ qApp->mainWidget()->resize( w, h );
+ // Since we're not visible, this doesn't have an immediate effect, QWidget posts the event
+ QApplication::sendPostedEvents( 0, QEvent::Resize );
+}
+
+#include "test_regression.moc"
+
+// kate: indent-width 4
diff --git a/kate/part/test_regression.h b/kate/part/test_regression.h
new file mode 100644
index 000000000..bc528b4bc
--- /dev/null
+++ b/kate/part/test_regression.h
@@ -0,0 +1,249 @@
+/**
+ * This file is part of the KDE project
+ *
+ * Copyright (C) 2001,2003 Peter Kelly (pmk@post.com)
+ * Copyright 2006 Leo Savernik (l.savernik@aon.at)
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TEST_REGRESSION_H
+#define TEST_REGRESSION_H
+
+#include <katejscript.h>
+#include <kateview.h>
+#include <kurl.h>
+#include <qobject.h>
+#include <qstringlist.h>
+#include <kjs/ustring.h>
+#include <kjs/object.h>
+#include <kjs/interpreter.h>
+
+class KateDocument;
+class KateView;
+class RegressionTest;
+class QTimer;
+
+namespace KParts {
+ class URLArgs;
+}
+
+class OutputObject;
+
+/**
+ * @internal
+ * The backbone of Kate's automatic regression tests.
+ */
+class TestJScriptEnv : public KateJScript
+{
+ public:
+ TestJScriptEnv(KateDocument *part);
+ virtual ~TestJScriptEnv();
+
+ /** returns the global scope */
+ KJS::Object global() const { return *m_global; }
+ /** returns the script interpreter */
+ KJS::Interpreter &interpreter() { return *m_interpreter; }
+ /** returns the document scope */
+ KJS::Object document() const { return *m_document; }
+ /** returns the view scope */
+ KJS::Object view() const { return *m_view; }
+ /** returns the output object */
+ OutputObject *output() const { return m_output; }
+
+ protected:
+ OutputObject *m_output;
+};
+
+/**
+ * @internal
+ */
+class KateViewObject : public KJS::ObjectImp
+{
+ public:
+ KateViewObject(KJS::ExecState *exec, KateView *v, KJS::ObjectImp *fallback);
+ virtual ~KateViewObject();
+
+ virtual const KJS::ClassInfo *classInfo() const;
+ virtual KJS::Value get(KJS::ExecState *exec, const KJS::Identifier &propertyName) const;
+
+ private:
+ // evil hack I: class layout of katejscript/KateJSView must be duplicated
+ // here, structurally as well as functionally
+ KateView *view;
+ // end evil hack
+ KJS::ObjectImp *fallback;
+};
+
+/**
+ * @internal
+ */
+class KateViewFunction : public KJS::ObjectImp
+{
+ public:
+ KateViewFunction(KJS::ExecState *exec, KateView *v, int _id, int length);
+
+ bool implementsCall() const;
+ KJS::Value call(KJS::ExecState *exec, KJS::Object &thisObj, const KJS::List &args);
+
+ enum { KeyReturn, Type, Backspace, DeleteWordLeft, KeyDelete,
+ DeleteWordRight, Transpose, CursorLeft, ShiftCursorLeft, CursorRight,
+ ShiftCursorRight, WordLeft, ShiftWordLeft, WordRight, ShiftWordRight,
+ Home, ShiftHome, End, ShiftEnd, Up, ShiftUp, Down, ShiftDown, ScrollUp,
+ ScrollDown, TopOfView, ShiftTopOfView, BottomOfView, ShiftBottomOfView,
+ PageUp, ShiftPageUp, PageDown, ShiftPageDown, Top, ShiftTop, Bottom,
+ ShiftBottom, ToMatchingBracket, ShiftToMatchingBracket };
+ private:
+ KateView *m_view;
+ int id;
+};
+
+class OutputFunction;
+
+/**
+ * Customizing output to result-files. Writing any output into result files
+ * inhibits outputting the content of the katepart after script execution, enabling one to check for coordinates and the like.
+ * @internal
+ */
+class OutputObject : public KJS::ObjectImp
+{
+ public:
+ OutputObject(KJS::ExecState *exec, KateDocument *d, KateView *v);
+ virtual ~OutputObject();
+
+ virtual KJS::UString className() const;
+
+ void setChangedFlag(bool *flag) { changed = flag; }
+ void setOutputString(QString *s) { outstr = s; }
+
+ private:
+ KateDocument *doc;
+ KateView *view;
+ bool *changed;
+ QString *outstr;
+
+ friend class OutputFunction;
+};
+
+/**
+ * Customizing output to result-files.
+ * @internal
+ */
+class OutputFunction : public KJS::ObjectImp
+{
+ public:
+ OutputFunction(KJS::ExecState *exec, OutputObject *obj, int _id, int length);
+
+ bool implementsCall() const;
+ virtual KJS::Value call(KJS::ExecState *exec, KJS::Object &thisObj, const KJS::List &args);
+
+ enum { Write, Writeln, WriteCursorPosition, WriteCursorPositionln };
+ private:
+ OutputObject *o;
+ int id;
+};
+
+/**
+ * @internal
+ */
+class RegressionTest : public QObject
+{
+ Q_OBJECT
+public:
+
+ RegressionTest(KateDocument *part, KConfig *baseConfig,
+ const QString &baseDir, const QString &outputDir,
+ bool _genOutput);
+ ~RegressionTest();
+
+ enum OutputType { ResultDocument };
+ void testStaticFile(const QString& filename, const QStringList &commands);
+ enum CheckResult { Failure = 0, Success = 1, Ignored = 2 };
+ CheckResult checkOutput(const QString& againstFilename);
+ enum FailureType { NoFailure = 0, AllFailure = 1, ResultFailure = 4, NewFailure = 65536 };
+ bool runTests(QString relPath = QString::null, bool mustExist = false, int known_failure = NoFailure);
+ bool reportResult( bool passed, const QString & description = QString::null, bool *newfailure = 0 );
+ bool reportResult(CheckResult result, const QString & description = QString::null, bool *newfailure = 0 );
+ void rereadConfig();
+ static void createMissingDirs(const QString &path);
+
+ void setFailureSnapshotConfig(KConfig *cfg, const QString &snapshotname);
+ void setFailureSnapshotSaver(KConfig *cfg, const QString &snapshotname);
+
+ void createLink( const QString& test, int failures );
+ void doFailureReport( const QString& test, int failures );
+
+ KateDocument *m_part;
+ KateView *m_view;
+ KConfig *m_baseConfig;
+ QString m_baseDir;
+ QString m_outputDir;
+ bool m_genOutput;
+ QString m_currentBase;
+ KConfig *m_failureComp;
+ KConfig *m_failureSave;
+
+ QString m_currentOutput;
+ QString m_currentCategory;
+ QString m_currentTest;
+
+ bool m_keepOutput;
+ bool m_getOutput;
+ bool m_showGui;
+ int m_passes_work;
+ int m_passes_fail;
+ int m_passes_new;
+ int m_failures_work;
+ int m_failures_fail;
+ int m_failures_new;
+ int m_errors;
+ bool saw_failure;
+ bool ignore_errors;
+ int m_known_failures;
+ bool m_outputCustomised;
+ QString m_outputString;
+
+ static RegressionTest *curr;
+
+private:
+ void printDescription(const QString& description);
+
+ static bool svnIgnored( const QString &filename );
+
+private:
+ /**
+ * evaluate script given by \c filename within the context of \c interp.
+ * @param ignore if \c true don't evaluate if script does not exist but
+ * return true nonetheless.
+ * @return true if script was valid, false otherwise
+ */
+ bool evalJS( KJS::Interpreter &interp, const QString &filename, bool ignore = false);
+ /**
+ * concatenate contents of all list files down to but not including the
+ * tests directory.
+ * @param relPath relative path against tests-directory
+ * @param filename file name of the list files
+ */
+ QStringList concatListFiles(const QString &relPath, const QString &filename);
+
+private slots:
+ void slotOpenURL(const KURL &url, const KParts::URLArgs &args);
+ void resizeTopLevelWidget( int, int );
+
+};
+
+#endif
diff --git a/kate/plugins/Makefile.am b/kate/plugins/Makefile.am
new file mode 100644
index 000000000..fb3b91ea5
--- /dev/null
+++ b/kate/plugins/Makefile.am
@@ -0,0 +1,2 @@
+SUBDIRS = isearch insertfile kdatatool wordcompletion
+
diff --git a/kate/plugins/autobookmarker/Makefile.am b/kate/plugins/autobookmarker/Makefile.am
new file mode 100644
index 000000000..748dbb2e5
--- /dev/null
+++ b/kate/plugins/autobookmarker/Makefile.am
@@ -0,0 +1,17 @@
+INCLUDES = -I$(top_srcdir)/interfaces $(all_includes)
+METASOURCES = AUTO
+
+# Install this plugin in the KDE modules directory
+kde_module_LTLIBRARIES = ktexteditor_autobookmarker.la
+
+ktexteditor_autobookmarker_la_SOURCES = autobookmarker.cpp
+ktexteditor_autobookmarker_la_LIBADD = $(top_builddir)/interfaces/ktexteditor/libktexteditor.la
+ktexteditor_autobookmarker_la_LDFLAGS = -module $(KDE_PLUGIN) $(all_libraries)
+
+kde_services_DATA = ktexteditor_autobookmarker.desktop
+
+confdir=$(kde_confdir)
+conf_DATA = ktexteditor_autobookmarkerrc
+
+messages: rc.cpp
+ $(XGETTEXT) *.cpp *.h -o $(podir)/ktexteditor_autobookmarker.pot
diff --git a/kate/plugins/autobookmarker/autobookmarker.cpp b/kate/plugins/autobookmarker/autobookmarker.cpp
new file mode 100644
index 000000000..af3acbc32
--- /dev/null
+++ b/kate/plugins/autobookmarker/autobookmarker.cpp
@@ -0,0 +1,521 @@
+/*
+ This library is free software you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+
+ ---
+ file: autobookmarker.cpp
+
+ KTextEditor plugin to add bookmarks to documents.
+ Copyright Anders Lund <anders.lund@lund.tdcadsl.dk>, 2003
+*/
+
+//BEGIN includes
+#include "autobookmarker.h"
+
+#include <ktexteditor/markinterfaceextension.h>
+#include <ktexteditor/editinterface.h>
+#include <ktexteditor/documentinfo.h>
+#include <ktexteditor/document.h>
+
+#include <kaction.h>
+#include <kapplication.h>
+#include <kconfig.h>
+#include <kgenericfactory.h>
+#include <kiconloader.h>
+#include <klistview.h>
+#include <klocale.h>
+#include <kmimetype.h>
+#include <kmimetypechooser.h>
+#include <kprocess.h>
+#include <krun.h>
+#include <kstaticdeleter.h>
+#include <kurl.h>
+
+#include <qcheckbox.h>
+#include <qlabel.h>
+#include <qlayout.h>
+#include <qlineedit.h>
+#include <qlistview.h>
+#include <qpopupmenu.h>
+#include <qpushbutton.h>
+#include <qtoolbutton.h>
+#include <qwhatsthis.h>
+#include <qregexp.h>
+
+//#include <kdebug.h>
+//END includes
+
+//BEGIN AutoBookmarker
+K_EXPORT_COMPONENT_FACTORY( ktexteditor_autobookmarker, KGenericFactory<AutoBookmarker>( "ktexteditor_autobookmarker" ) )
+
+AutoBookmarker::AutoBookmarker( QObject *parent,
+ const char* name,
+ const QStringList& /*args*/ )
+ : KTextEditor::Plugin ( (KTextEditor::Document*) parent, name ),
+ KTextEditor::ConfigInterfaceExtension()
+{
+ if ( parent )
+ connect( parent, SIGNAL( completed() ), this, SLOT( slotCompleted() ) );
+}
+
+void AutoBookmarker::addView(KTextEditor::View */*view*/)
+{
+}
+
+void AutoBookmarker::removeView(KTextEditor::View */*view*/)
+{
+}
+
+KTextEditor::ConfigPage * AutoBookmarker::configPage( uint /*number*/, QWidget *parent, const char *name )
+{
+ return new AutoBookmarkerConfigPage( parent, name );
+}
+
+QString AutoBookmarker::configPageName( uint /*p*/ ) const
+{
+// switch (p)
+// {
+// case 0:
+ return i18n("AutoBookmarks");
+// default:
+// return "";
+// }
+}
+
+QString AutoBookmarker::configPageFullName( uint /*p*/ ) const
+{
+// switch (p)
+// {
+// case 0:
+ return i18n("Configure AutoBookmarks");
+// default:
+// return "";
+// }
+}
+
+QPixmap AutoBookmarker::configPagePixmap( uint /*p*/, int size ) const
+{
+ return UserIcon("kte_bookmark", size);
+}
+
+void AutoBookmarker::slotCompleted()
+{
+ // get the document info
+ KTextEditor::DocumentInfoInterface *di =
+ static_cast<KTextEditor::DocumentInfoInterface*>(document()->
+ qt_cast("KTextEditor::DocumentInfoInterface"));
+ QString mt;
+ if ( di ) // we can still try match the URL otherwise
+ mt = di->mimeType();
+
+ QString fileName;
+ if ( document()->url().isValid() )
+ fileName = document()->url().fileName();
+
+ ABEntityList *l = ABGlobal::self()->entities();
+ // for each item, if either mask matches
+ // * apply if onLoad is true
+ ABEntityListIterator it( *l );
+ int n( 0 );
+ bool found;
+ AutoBookmarkEnt *e;
+ while ( ( e = it.current() ) != 0 )
+ {
+ found = ( !e->mimemask.count() && !e->filemask.count() ); // no preferences
+ if ( ! found )
+ found = ( ! mt.isEmpty() && e->mimemask.contains( mt ) );
+ if ( ! found )
+ for( QStringList::Iterator it1 = e->filemask.begin(); it1 != e->filemask.end(); ++it1 )
+ {
+ QRegExp re(*it1, true, true);
+ if ( ( found = ( ( re.search( fileName ) > -1 ) && ( re.matchedLength() == (int)fileName.length() ) ) ) )
+ break;
+ }
+
+ if ( found )
+ applyEntity( e );
+
+ n++;
+ ++it;
+ }
+
+}
+
+void AutoBookmarker::applyEntity( AutoBookmarkEnt *e )
+{
+ KTextEditor::Document *doc = document();
+ KTextEditor::EditInterface *ei = KTextEditor::editInterface( doc );
+ KTextEditor::MarkInterface *mi = KTextEditor::markInterface( doc );
+
+ if ( ! ( ei && mi ) ) return;
+
+ QRegExp re( e->pattern, e->flags & AutoBookmarkEnt::CaseSensitive );
+ re.setMinimal( e->flags & AutoBookmarkEnt::MinimalMatching );
+
+ for ( uint l( 0 ); l < ei->numLines(); l++ )
+ if ( re.search( ei->textLine( l ) ) > -1 )
+ mi->setMark( l, KTextEditor::MarkInterface::Bookmark );
+}
+
+//END
+
+//BEGIN ABGlobal
+ABGlobal *ABGlobal::s_self = 0;
+
+ABGlobal::ABGlobal()
+{
+ m_ents = new ABEntityList;
+ readConfig();
+}
+
+ABGlobal::~ABGlobal()
+{
+ delete m_ents;
+}
+
+static KStaticDeleter<ABGlobal> sdSelf;
+
+ABGlobal *ABGlobal::self()
+{
+ if ( ! s_self )
+ sdSelf.setObject(s_self, new ABGlobal());
+
+ return s_self;
+}
+
+void ABGlobal::readConfig()
+{
+ if ( ! m_ents )
+ m_ents = new ABEntityList;
+ else
+ m_ents->clear();
+ KConfig *config = new KConfig("ktexteditor_autobookmarkerrc");
+
+ uint n( 0 );
+ while ( config->hasGroup( QString("autobookmark%1").arg( n ) ) )
+ {
+ config->setGroup( QString("autobookmark%1").arg( n ) );
+ QStringList filemask = config->readListEntry( "filemask", ';' );
+ QStringList mimemask = config->readListEntry( "mimemask", ';' );
+ int flags = config->readNumEntry( "flags", 1 );
+ AutoBookmarkEnt *e = new AutoBookmarkEnt(
+ config->readEntry( "pattern", "" ),
+ filemask,
+ mimemask,
+ flags
+ );
+
+ m_ents->append( e );
+
+ ++n;
+ }
+
+ delete config;
+}
+
+void ABGlobal::writeConfig()
+{
+ KConfig *config = new KConfig("ktexteditor_autobookmarkerrc");
+
+ // clean the config object
+ QStringList l = config->groupList();
+ for ( QStringList::Iterator it = l.begin(); it != l.end(); ++it )
+ config->deleteGroup( *it );
+
+ // fill in the current list
+ for ( uint i = 0; i < m_ents->count(); i++ )
+ {
+ AutoBookmarkEnt *e = m_ents->at( i );
+ config->setGroup( QString("autobookmark%1").arg( i ) );
+ config->writeEntry( "pattern", e->pattern );
+ config->writeEntry( "filemask", e->filemask, ';' );
+ config->writeEntry( "mimemask", e->mimemask, ';' );
+ config->writeEntry( "flags", e->flags );
+ }
+
+ config->sync(); // explicit -- this is supposedly handled by the d'tor
+ delete config;
+}
+//END ABGlobal
+
+//BEGIN AutoBookmarkEntItem
+// A QListviewItem which can hold a AutoBookmarkEnt pointer
+class AutoBookmarkEntItem : public QListViewItem
+{
+ public:
+ AutoBookmarkEntItem( KListView *lv, AutoBookmarkEnt *e )
+ : QListViewItem( lv ),
+ ent( e )
+ {
+ redo();
+ };
+ ~AutoBookmarkEntItem(){};
+ void redo()
+ {
+ setText( 0, ent->pattern );
+ setText( 1, ent->mimemask.join("; ") );
+ setText( 2, ent->filemask.join("; ") );
+ }
+ AutoBookmarkEnt *ent;
+};
+//END
+
+//BEGIN AutoBookmarkerEntEditor
+// Dialog for editing a single autobookmark entity
+// * edit the pattern
+// * set the file/mime type masks
+AutoBookmarkerEntEditor::AutoBookmarkerEntEditor( QWidget *parent, AutoBookmarkEnt *e )
+ : KDialogBase( parent, "autobookmark_ent_editor",
+ true, i18n("Edit Entry"),
+ KDialogBase::Ok|KDialogBase::Cancel ),
+ e( e )
+{
+ QFrame *w = makeMainWidget();
+ QGridLayout * lo = new QGridLayout( w, 5, 3 );
+ lo->setSpacing( KDialogBase::spacingHint() );
+
+ QLabel *l = new QLabel( i18n("&Pattern:"), w );
+ lePattern = new QLineEdit( e->pattern, w );
+ l->setBuddy( lePattern );
+ lo->addWidget( l, 0, 0 );
+ lo->addMultiCellWidget( lePattern, 0, 0, 1, 2 );
+ QWhatsThis::add( lePattern, i18n(
+ "<p>A regular expression. Matching lines will be bookmarked.</p>" ) );
+
+ connect( lePattern, SIGNAL(textChanged ( const QString & ) ),this, SLOT( slotPatternChanged( const QString& ) ) );
+
+ cbCS = new QCheckBox( i18n("Case &sensitive"), w );
+ lo->addMultiCellWidget( cbCS, 1, 1, 0, 2 );
+ cbCS->setChecked( e->flags & AutoBookmarkEnt::CaseSensitive );
+ QWhatsThis::add( cbCS, i18n(
+ "<p>If enabled, the pattern matching will be case sensitive, otherwise "
+ "not.</p>") );
+
+ cbMM = new QCheckBox( i18n("&Minimal matching"), w );
+ lo->addMultiCellWidget( cbMM, 2, 2, 0 ,2 );
+ cbMM->setChecked( e->flags & AutoBookmarkEnt::MinimalMatching );
+ QWhatsThis::add( cbMM, i18n(
+ "<p>If enabled, the pattern matching will use minimal matching; if you "
+ "do not know what that is, please read the appendix on regular expressions "
+ "in the kate manual.</p>") );
+
+ l = new QLabel( i18n("&File mask:"), w );
+ leFileMask = new QLineEdit( e->filemask.join( "; " ), w );
+ l->setBuddy( leFileMask );
+ lo->addWidget( l, 3, 0 );
+ lo->addMultiCellWidget( leFileMask, 3, 3, 1, 2 );
+ QWhatsThis::add( leFileMask, i18n(
+ "<p>A list of filename masks, separated by semicolons. This can be used "
+ "to limit the usage of this entity to files with matching names.</p>"
+ "<p>Use the wizard button to the right of the mimetype entry below to "
+ "easily fill out both lists.</p>" ) );
+
+ l = new QLabel( i18n("MIME &types:"), w );
+ leMimeTypes = new QLineEdit( e->mimemask.join( "; " ), w );
+ l->setBuddy( leMimeTypes );
+ lo->addWidget( l, 4, 0 );
+ lo->addWidget( leMimeTypes, 4, 1 );
+ QWhatsThis::add( leMimeTypes, i18n(
+ "<p>A list of mime types, separated by semicolon. This can be used to "
+ "limit the usage of this entity to files with matching mime types.</p>"
+ "<p>Use the wizard button on the right to get a list of existing file "
+ "types to choose from, using it will fill in the file masks as well.</p>" ) );
+
+ QToolButton *btnMTW = new QToolButton(w);
+ lo->addWidget( btnMTW, 4, 2 );
+ btnMTW->setIconSet(QIconSet(SmallIcon("wizard")));
+ connect(btnMTW, SIGNAL(clicked()), this, SLOT(showMTDlg()));
+ QWhatsThis::add( btnMTW, i18n(
+ "<p>Click this button to display a checkable list of mimetypes available "
+ "on your system. When used, the file masks entry above will be filled in "
+ "with the corresponding masks.</p>") );
+ slotPatternChanged( lePattern->text() );
+}
+
+void AutoBookmarkerEntEditor::slotPatternChanged( const QString&_pattern )
+{
+ enableButtonOK( !_pattern.isEmpty() );
+}
+
+void AutoBookmarkerEntEditor::apply()
+{
+ if ( lePattern->text().isEmpty() ) return;
+
+ e->pattern = lePattern->text();
+ e->filemask = QStringList::split( QRegExp("\\s*;\\s*"), leFileMask->text() );
+ e->mimemask = QStringList::split( QRegExp("\\s*;\\s*"), leMimeTypes->text() );
+ e->flags = 0;
+ if ( cbCS->isOn() ) e->flags |= AutoBookmarkEnt::CaseSensitive;
+ if ( cbMM->isOn() ) e->flags |= AutoBookmarkEnt::MinimalMatching;
+}
+
+void AutoBookmarkerEntEditor::showMTDlg()
+{
+ QString text = i18n("Select the MimeTypes for this pattern.\nPlease note that this will automatically edit the associated file extensions as well.");
+ QStringList list = QStringList::split( QRegExp("\\s*;\\s*"), leMimeTypes->text() );
+ KMimeTypeChooserDialog d( i18n("Select Mime Types"), text, list, "text", this );
+ if ( d.exec() == KDialogBase::Accepted ) {
+ // do some checking, warn user if mime types or patterns are removed.
+ // if the lists are empty, and the fields not, warn.
+ leFileMask->setText(d.chooser()->patterns().join("; "));
+ leMimeTypes->setText(d.chooser()->mimeTypes().join("; "));
+ }
+}
+//END
+
+//BEGIN AutoBookmarkerConfigPage
+// TODO allow custom mark types with icons
+AutoBookmarkerConfigPage::AutoBookmarkerConfigPage( QWidget *parent, const char *name )
+ : KTextEditor::ConfigPage( parent, name )
+{
+ QVBoxLayout *lo = new QVBoxLayout( this );
+ lo->setSpacing( KDialogBase::spacingHint() );
+
+ QLabel *l = new QLabel( i18n("&Patterns"), this );
+ lo->addWidget( l );
+ lvPatterns = new KListView( this );
+ lvPatterns->addColumn( i18n("Pattern") );
+ lvPatterns->addColumn( i18n("Mime Types") );
+ lvPatterns->addColumn( i18n("File Masks") );
+ lo->addWidget( lvPatterns );
+ l->setBuddy( lvPatterns );
+ QWhatsThis::add( lvPatterns, i18n(
+ "<p>This list shows your configured autobookmark entities. When a document "
+ "is opened, each entity is used in the following way: "
+ "<ol>"
+ "<li>The entity is dismissed, if a mime and/or filename mask is defined, "
+ "and neither matches the document.</li>"
+ "<li>Otherwise each line of the document is tried against the pattern, "
+ "and a bookmark is set on matching lines.</li></ul>"
+ "<p>Use the buttons below to manage your collection of entities.</p>") );
+
+ QHBoxLayout *lo1 = new QHBoxLayout ( lo );
+ lo1->setSpacing( KDialogBase::spacingHint() );
+
+ btnNew = new QPushButton( i18n("&New..."), this );
+ lo1->addWidget( btnNew );
+ QWhatsThis::add( btnNew, i18n(
+ "Press this button to create a new autobookmark entity.") );
+
+ btnDel = new QPushButton( i18n("&Delete"), this );
+ lo1->addWidget( btnDel );
+ QWhatsThis::add( btnDel, i18n(
+ "Press this button to delete the currently selected entity.") );
+
+ btnEdit = new QPushButton( i18n("&Edit..."), this );
+ lo1->addWidget( btnEdit );
+ QWhatsThis::add( btnEdit, i18n(
+ "Press this button to edit the currently selected entity.") );
+
+ lo1->addStretch( 1 );
+
+ connect( btnNew, SIGNAL(clicked()), this, SLOT(slotNew()) );
+ connect( btnDel, SIGNAL(clicked()), this, SLOT(slotDel()) );
+ connect( btnEdit, SIGNAL(clicked()), this, SLOT(slotEdit()) );
+ connect( lvPatterns, SIGNAL(doubleClicked(QListViewItem *)), this, SLOT(slotEdit()) );
+
+ m_ents = new ABEntityList();
+ m_ents->setAutoDelete( true );
+ reset();
+}
+
+// replace the global list with the new one
+void AutoBookmarkerConfigPage::apply()
+{
+ ABGlobal::self()->entities()->clear();
+
+ ABEntityListIterator it ( *m_ents );
+ AutoBookmarkEnt *e;
+
+ while ( (e = it.current()) != 0 )
+ {
+ ABGlobal::self()->entities()->append( e );
+ ++it;
+ }
+
+ ABGlobal::self()->writeConfig();
+
+ // TODO -- how do i refresh all the view menus
+}
+
+// renew our copy of the global list
+void AutoBookmarkerConfigPage::reset()
+{
+ m_ents->clear(); // unused - no reset button currently
+
+ ABEntityListIterator it ( *ABGlobal::self()->entities() );
+ AutoBookmarkEnt *e;
+ while ( (e = it.current()) != 0 )
+ {
+ AutoBookmarkEnt *me = new AutoBookmarkEnt( *e );
+ m_ents->append( me );
+ new AutoBookmarkEntItem( lvPatterns, me );
+ ++it;
+ }
+}
+
+// TODO (so far not used) we have no defaults (except deleting all items??)
+void AutoBookmarkerConfigPage::defaults()
+{
+ // if KMessageBox::warningYesNo()
+ // clear all
+}
+
+// open the edit dialog with a new entity,
+// and add it if the dialog is accepted
+void AutoBookmarkerConfigPage::slotNew()
+{
+ AutoBookmarkEnt *e = new AutoBookmarkEnt();
+ AutoBookmarkerEntEditor dlg( this, e );
+ if ( dlg.exec() )
+ {
+ dlg.apply();
+ new AutoBookmarkEntItem( lvPatterns, e );
+ m_ents->append( e );
+ }
+}
+
+// delete the selected item and remove it from the list view and internal list
+void AutoBookmarkerConfigPage::slotDel()
+{
+ AutoBookmarkEntItem *i = (AutoBookmarkEntItem*)lvPatterns->currentItem();
+ int idx = m_ents->findRef( i->ent );
+ m_ents->remove( idx );
+ delete i;
+}
+
+// open the edit dialog with the selected item
+void AutoBookmarkerConfigPage::slotEdit()
+{
+ AutoBookmarkEnt *e = ((AutoBookmarkEntItem*)lvPatterns->currentItem())->ent;
+ AutoBookmarkerEntEditor dlg( this, e );
+ if ( dlg.exec() )
+ {
+ dlg.apply();
+ ((AutoBookmarkEntItem*)lvPatterns->currentItem())->redo();
+ }
+}
+//END AutoBookmarkerConfigPage
+
+//BEGIN AutoBookmarkEnt
+AutoBookmarkEnt::AutoBookmarkEnt( const QString &p, const QStringList &f, const QStringList &m, int fl )
+ : pattern( p ),
+ filemask( f ),
+ mimemask( m ),
+ flags( fl )
+{;
+}
+//END
+//
+#include "autobookmarker.moc"
diff --git a/kate/plugins/autobookmarker/autobookmarker.h b/kate/plugins/autobookmarker/autobookmarker.h
new file mode 100644
index 000000000..188c8a360
--- /dev/null
+++ b/kate/plugins/autobookmarker/autobookmarker.h
@@ -0,0 +1,137 @@
+/*
+ This library is free software you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+
+ ---
+ file: autobookmarker.h
+
+ KTextEditor plugin to add bookmarks to documents.
+ Copyright Anders Lund <anders.lund@lund.tdcadsl.dk>, 2003
+*/
+
+#ifndef _AUTOBOOKMARKER_H_
+#define _AUTOBOOKMARKER_H_
+
+#include <ktexteditor/plugin.h>
+#include <ktexteditor/configinterfaceextension.h>
+
+#include <kdialogbase.h>
+
+#include <qptrlist.h>
+#include <qvbox.h>
+
+class AutoBookmarkEnt
+{
+ public:
+ enum REFlags { CaseSensitive=1, MinimalMatching=2 };
+ AutoBookmarkEnt(const QString &p=QString::null,
+ const QStringList &f=QStringList(),
+ const QStringList &m=QStringList(),
+ int flags=1 );
+ ~AutoBookmarkEnt(){};
+ QString pattern;
+ QStringList filemask;
+ QStringList mimemask;
+ int flags;
+};
+
+class AutoBookmarker
+ : public KTextEditor::Plugin, public KTextEditor::PluginViewInterface,
+ public KTextEditor::ConfigInterfaceExtension
+{
+ Q_OBJECT
+ public:
+ AutoBookmarker( QObject *parent = 0,
+ const char* name = 0,
+ const QStringList &args = QStringList() );
+ virtual ~AutoBookmarker() {};
+
+ void addView (KTextEditor::View *view);
+ void removeView (KTextEditor::View *view);
+
+ // ConfigInterfaceExtention
+ uint configPages() const { return 1; };
+ KTextEditor::ConfigPage * configPage( uint number, QWidget *parent, const char *name );
+ QString configPageName( uint ) const;
+ QString configPageFullName( uint ) const;
+ QPixmap configPagePixmap( uint, int ) const;
+ bool abDone;
+
+ private slots:
+ void slotCompleted();
+ void applyEntity( AutoBookmarkEnt *e );
+};
+
+typedef QPtrList<AutoBookmarkEnt> ABEntityList;
+typedef QPtrListIterator<AutoBookmarkEnt> ABEntityListIterator;
+
+/* singleton to keep the data */
+class ABGlobal
+{
+ public:
+ ABGlobal();
+ ~ABGlobal();
+
+ static ABGlobal* self();
+
+ ABEntityList* entities() { return m_ents; };
+ void readConfig();
+ void writeConfig();
+
+ private:
+ ABEntityList *m_ents;
+ static ABGlobal *s_self;
+};
+
+class AutoBookmarkerConfigPage : public KTextEditor::ConfigPage
+{
+ Q_OBJECT
+ public:
+ AutoBookmarkerConfigPage( QWidget *parent, const char *name );
+ virtual ~AutoBookmarkerConfigPage() {};
+
+ virtual void apply();
+ virtual void reset();
+ virtual void defaults();
+
+ private slots:
+ void slotNew();
+ void slotDel();
+ void slotEdit();
+
+ private:
+ class KListView *lvPatterns;
+ class QPushButton *btnNew, *btnDel, *btnEdit;
+ ABEntityList *m_ents;
+};
+
+class AutoBookmarkerEntEditor : public KDialogBase
+{
+ Q_OBJECT
+ public:
+ AutoBookmarkerEntEditor( QWidget *parent, AutoBookmarkEnt *e );
+ ~AutoBookmarkerEntEditor(){};
+
+ void apply();
+
+ private slots:
+ void showMTDlg();
+ void slotPatternChanged( const QString& );
+ private:
+ class QLineEdit *lePattern, *leMimeTypes, *leFileMask;
+ class QCheckBox *cbCS, *cbMM;
+ AutoBookmarkEnt *e;
+};
+
+#endif //_AUTOBOOKMARKER_H_
diff --git a/kate/plugins/autobookmarker/ktexteditor_autobookmarker.desktop b/kate/plugins/autobookmarker/ktexteditor_autobookmarker.desktop
new file mode 100644
index 000000000..a71dbc6be
--- /dev/null
+++ b/kate/plugins/autobookmarker/ktexteditor_autobookmarker.desktop
@@ -0,0 +1,135 @@
+[Desktop Entry]
+Name=KTextEditor Autobookmarker
+Name[af]=KTextEditor OutoBoekmerker
+Name[be]=Ðўтаматычны закладкі
+Name[bn]=কে-টেকà§à¦¸à¦Ÿ-à¦à¦¡à¦¿à¦Ÿà¦° অটো-মà§à¦•à¦®à¦¾à¦°à§à¦•à¦¾à¦°
+Name[br]=Sinedoù emgefreek evit KTextEditor
+Name[bs]=KTextEditor automatske zabilješke
+Name[ca]=Punts automàtics per al KTextEditor
+Name[cs]=Modul automatických odkazů
+Name[csb]=Aùtomatné wstôwianié załóżków dlô KTextEditor
+Name[de]=KTextEditor: Autom. Lesezeichenmarkierung
+Name[el]=ΠÏόσθετο αυτόματων σελιδοδεικτών του KTextEditor
+Name[eo]=KTextEditor AÅ­tomata legosignigilo
+Name[es]=Automarcadores de KTextEditor
+Name[et]=KTextEditori järjehoidjate märkija
+Name[eu]=KTextEditor-en laster-markatzaile automatikoa
+Name[fa]=چوب ال٠خودکار KTextEditor
+Name[fi]=KTextEditorin automaattinen kirjanmerkkien tekijä
+Name[fr]=Signets automatiques KTextEditor
+Name[fy]=Automatyske blêdwizer foar de KTekstbewurker
+Name[ga]=Leabharmharcálaí Uathoibríoch KTextEditor
+Name[gl]=Auto-marcador de KTextEditor
+Name[he]= תוסף סימניות ×וטומטיות של KTextEditor
+Name[hi]=के-टेकà¥à¤¸à¥à¤Ÿ-à¤à¤¡à¤¿à¤Ÿà¤° ऑटोबà¥à¤•à¤®à¤¾à¤°à¥à¤•à¤°
+Name[hr]=KTextEditor automatske oznake
+Name[hu]=KTextEditor automatikus könyvjelzők
+Name[id]=Penandabuku Otomatis KTextEditor
+Name[is]=KTextEditor sjálfvirkur bókamerkjari
+Name[it]=Segnalibri automatici di KTextEditor
+Name[ja]=KTextEditor 自動ブックマーク
+Name[ka]=KTextEditor-ის áƒáƒ•áƒ¢áƒáƒ¡áƒáƒœáƒ˜áƒ¨áƒœáƒ”
+Name[kk]=KTextEditor автобетбелгігіші
+Name[km]=ážœážáŸ’ážáž»â€‹áž…ំណាំ​ស្វáŸáž™â€‹áž”្រវážáŸ’ážáž· KTextEditor
+Name[lb]=Automateschen Lieszeechesetzer fir den KTextEditor
+Name[lt]=KTextEditor automatinis žymelių įterpėjas
+Name[lv]=KTextEditor automÄtiskais grÄmatzÄ«mju licÄ“js
+Name[mk]=KTextEditor Ðвтообележувач
+Name[ms]=Penanda buku auto KTextEditor
+Name[nb]=Automatisk bokmerke for KTextEditor
+Name[nds]=KTextEditor -Leestekensetter
+Name[nl]=KTextEditor Autobladwijzers
+Name[nn]=Automatisk bokmerke for KTextEditor
+Name[pa]=ਕੇਪਾਠਸੰਪਾਦਕ ਸਵੈਬà©à©±à¨•à¨®à¨¾à¨°à¨•à¨°
+Name[pl]=Automatyczne wstawianie zakładek dla KTextEditor
+Name[pt]=Auto-favoritos do KTextEditor
+Name[pt_BR]=Marca favoritos automático para Editor de textos
+Name[ro]=Semne de carte automate pentru KTextEditor
+Name[ru]=Ðвтозакладки KTextEditor
+Name[rw]=Mushyirahokimenyetsoyikoresha ya KMuhinduziMwandiko
+Name[se]=KTextEditor:a automáhtalaš girjemerkejeaddji
+Name[sk]=Automatické záložky pre KTextEditor
+Name[sl]=Samodejni zaznamki za KTextEditor
+Name[sr]=KTextEditor-ов аутомаркер
+Name[sr@Latn]=KTextEditor-ov automarker
+Name[sv]=Automatiska bokmärken för Ktexteditor
+Name[ta]=கேஉரைதொகà¯à®ªà¯à®ªà®¾à®³à®°à¯ தானியகà¯à®• பà¯à®¤à¯à®¤à®• உரà¯à®µà®¾à®•à¯à®•à®¿
+Name[te]=కెటెకà±à°¸à±à°Ÿà± ఎడిటరౠఆటొబà±à°•à± మారà±à°•à°°à±
+Name[tg]=Хатчӯбмонии худкори KTextEditor
+Name[th]=ตั้งที่คั่นหน้าอัตโนมัติ ของ KTextEditor
+Name[tr]=KTextEditor Otomatik Sıkkullanılanlar Ekleyici
+Name[tt]=KTextEditor'nıñ Aqıllı Bitbilge
+Name[uk]=Втулок автоматичних закладок KTextEditor
+Name[vi]=Bá»™ Tá»± Ä‘á»™ng Äánh dấu KTextEditor
+Name[zh_CN]=KTextEditor 自动书签器
+Comment=Set bookmarks on lines matching a pattern when documents are loaded
+Comment[af]=Stel boekmerke op lyne wat met 'n patroon ooreenstem wanneer dokumente gelaai word.
+Comment[be]=Стварае закладкі Ð´Ð»Ñ Ñ€Ð°Ð´ÐºÐ¾Ñž, ÑÐºÑ–Ñ Ð°Ð´Ð¿Ð°Ð²Ñдаюць шаблону
+Comment[bg]=УÑтановÑване на отметки на редовете, които отговарÑÑ‚ на зададен шаблон по време на зареждане на файла
+Comment[bn]=ডকà§à¦®à§‡à¦¨à§à¦Ÿ লোড করাকালীন পà§à¦°à¦¦à¦¤à§à¦¤ নকশার সাথে মেলে à¦à¦®à¦¨ সমসà§à¦¤ লাইন বà§à¦•à¦®à¦¾à¦°à§à¦• করে
+Comment[bs]=PodeÅ¡ava zabiljeÅ¡ke na linijama koje odgovaraju uzorku pri uÄitavanju dokumenta
+Comment[ca]=Estableix punts a les línies coincidents amb un patró quan es carreguen documents
+Comment[cs]=Nastavení záložek do řádek vyhovujících vzoru po nahrání dokumentu
+Comment[csb]=Wstôwiô, òb czas wczëtëwaniô, załóżczi w pasownëch liniach do dónegò mùstra
+Comment[da]=Sæt bogmærker på linjer der matcher et mønster når dokumenter er indlæst
+Comment[de]=Lesezeichen nach bestimmten Mustern auf Zeilen setzen, sobald ein Dokument geladen wird
+Comment[el]=ΟÏίζει σελιδοδείκτες σε γÏαμμές που ταιÏιάζουν σε ένα μοτίβο όταν τα έγγÏαφα φοÏτώνονται
+Comment[eo]=Igas legosignojn en linioj, kiuj konvenas Åablonon, kiam dokumentoj estas ÅarÄataj
+Comment[es]=Pone marcadores en las líneas que coinciden con un patrón definido al cargar documentos.
+Comment[et]=Määrab dokumendi avamisel vastavalt mustrile ridadele järjehoidjad
+Comment[eu]=Eredu batekin bat datozen lerroen laster-markak ezartzen ditu dokumentuak kargatzean
+Comment[fa]=وقتی Ú©Ù‡ مستندات بار می‌شود، چوب الÙها را روی خطوط مطابق با الگو تنظیم کنید
+Comment[fi]=Määrittele kirjanmerkkejä riveille, jotka vastaavat kuviota, kun asiakirjoja avataan
+Comment[fr]=Positionne des signets sur les lignes qui correspondent à un motif quand les documents sont chargés
+Comment[fy]=Blêdwizer ynstelle om by it laden fan dokuminten oerienkomstige patroanen
+Comment[ga]=Cruthaigh leabharmharcanna ar línte a mheaitseálann patrún nuair a luchtaítear cáipéisí
+Comment[gl]=Pon marcadores en liñas que se axusten a un patrón durante a carga de documentos
+Comment[he]=קובע סימניות בשורות המת××™× ×œ×ª×‘× ×™×ª מסוימת בעת טעינת מסמך
+Comment[hi]=जब दसà¥à¤¤à¤¾à¤µà¥‡à¤œà¤¼ लोड हों तो किसी पैटरà¥à¤¨ से मेल खाती पंकà¥à¤¤à¤¿à¤¯à¥‹ में पà¥à¤¸à¥à¤¤à¤šà¤¿à¤¹à¥à¤¨ सेट करें
+Comment[hr]=Pri uÄitavanju dokumenta postavlja oznake na redovima koji odgovaraju odreÄ‘enom uzorku.
+Comment[hsb]=Staja pÅ™i zaÄitanju dokumenta znamjenja na linki, kiž wÄ›stemu mustrej wotpowÄ›duja,
+Comment[hu]=Fájl betöltésekor könyvjelzők automatikus létrehozása minta alapján
+Comment[id]=Set bookmark in baris yang cocok dengan sebuah pola jika dokumen dimuatkan
+Comment[is]=Setur bókamerki á línur sem passa ákveðnu mynstri, þegar skjöl eru lesin
+Comment[it]=Imposta dei segnalibri sulle righe corrispondenti a uno schema quando si caricano dei documenti
+Comment[ja]=文書ãŒèª­ã¿è¾¼ã¾ã‚ŒãŸã¨ãã«ã€ãƒ‘ターンã«ãƒžãƒƒãƒã—ãŸè¡Œã«ãƒ–ックマークを設定ã—ã¾ã™
+Comment[ka]=დáƒáƒ™áƒ£áƒ›áƒ”ნტის ჩáƒáƒ¢áƒ•áƒ˜áƒ áƒ—ვისáƒáƒ¡ სáƒáƒœáƒ˜áƒ¨áƒœáƒ”ების ნიმუშის მიხედვით მითითებáƒ
+Comment[kk]=Құжатта үлгі бойынша бетбелгілерді коÑды
+Comment[km]=កំណážáŸ‹â€‹áž€áž¶ážšáž…ំណាំ​ážáŸ’រង់​បន្ទាážáŸ‹â€‹ážŠáŸ‚ល​ដូច​នឹង​ឃ្លា áž–áŸáž›â€‹áž¯áž€ážŸáž¶ážšâ€‹ážáŸ’រូវ​បាន​ផ្ទុក
+Comment[lb]=Setzt Lieszeechen op d'Zeilen, déi ee bestëmmtent Muster enthalen, wann d'Dokument geluede gëtt
+Comment[lt]=Įterpia žymeles eilutėse, kurios atitinka tam tikrą derinį, dokumento įkėlimo metu
+Comment[lv]=IelÄdÄ“jot dokumentu, liek grÄmatzÄ«mes rindÄm, kuras atbilst norÄdÄ«tajam paraugam
+Comment[mk]=ПоÑтава обележувачи на линиите кои Ñе поклопуваат Ñо шема кога документите Ñе вчитуваат
+Comment[ms]=Tetapkan penanda buku pada baris yang padan dengan paten apabila dokumen dimuatkan
+Comment[nb]=Bestem bokmerke på linjer som passer til et mønster når dokument blir åpnet
+Comment[nds]=Sett al bi't Laden Leestekens för Regen, op de en Muster passt
+Comment[ne]=कागजात लोड हà¥à¤à¤¦à¤¾ बाà¤à¤¨à¥à¤•à¥€ मिलà¥à¤¦à¥‹ पà¥à¤¸à¥à¤¤à¤•à¤šà¤¿à¤¨à¥‹à¤¹à¤°à¥‚ लाइनमा सेट गरà¥à¤¨à¥à¤¹à¥‹à¤¸à¥
+Comment[nl]=Plaatsen van bladwijzers op regels die voldoen aan een bepaald patroon zodra het document geopend wordt
+Comment[nn]=Set bokmerke på linjer som passar til eit mønster når dokument vert opna
+Comment[pa]=ਜਦੋਂ ਵੀ ਦਸਤਾਵੇਜ਼ ਨੂੰ ਲੋਡ ਕੀਤਾ ਜਾ ਰਿਹਾ ਹੋਵੇ ਤਾਂ ਬà©à©±à¨•à¨®à¨¾à¨°à¨• ਨੂੰ ਸਤਰ-ਮੇਲ ਤਰਤੀਬ ਨਿਰਧਾਰਿਤ ਕਰੋ
+Comment[pl]=W czasie wczytywanie dokumentu ustawia zakładki w liniach pasujących do podanego wzorca
+Comment[pt]=Coloca favoritos em linhas que condizem com um padrão quando os documentos são carregados.
+Comment[pt_BR]=Configura os favoritos em linhas que combinam com um padrão, quando os documentos forem carregados
+Comment[ro]=La încărcarea documentului setează semne de carte la liniile care se potrivesc cu un model de text
+Comment[ru]=УÑтановка закладок в текÑтовом документе по шаблону
+Comment[rw]=Gushyiraho ibimenyetso ku mirongo mu guhuza ishusho igihe inyandiko zitangizwa
+Comment[se]=Bidjá girjemearkkaid linnjáide mat heivehit dihto minsttáriid go dokumeanttat rahpejuvvot.
+Comment[sk]=Nastavuje záložky pri naÄítaní dokumentu na riadky zodpovedajúce vzorke
+Comment[sl]=Nastavi zaznamke v vrsticah, ki se ujemajo vzorcu, ko so dokumenti naloženi
+Comment[sr]=ПоÑтавља маркере на линијама које Ñе уклапају у узорак када Ñе учитавају документи
+Comment[sr@Latn]=Postavlja markere na linijama koje se uklapaju u uzorak kada se uÄitavaju dokumenti
+Comment[sv]=Lägg till bokmärken på rader som motsvarar ett mönster när dokument laddas
+Comment[ta]= ஆவணஙà¯à®•à®³à¯ பதிவாகà¯à®®à¯ போத௠அமைபà¯à®ªà¯ பà¯à®¤à¯à®¤à®•à®•à¯à®•à¯à®±à®¿à®ªà¯à®ªà¯ கோடà¯à®•à®³à¯ பொரà¯à®¤à¯à®¤à¯à®®à¯ மாதிரி
+Comment[te]=పతà±à°°à°¾à°²à± à°Žà°•à±à°•à°¿à°‚à°šà°¿à°¨ తరà±à°µà°¾à°¤ బాణీకి సరిపొయిన వరà±à°¸à°² మీద à°¬à±à°•à± మారà±à°•à±à°²à°¨à± à°à°°à±à°ªà°°à±à°šà±à°¨à±
+Comment[tg]=Хатчӯбмонӣ дар Ñтарҳои мувофиқи қолиб ҳангоми боркунии ҳуҷҷати матнӣ
+Comment[th]=ตั้งที่คั่นหน้าที่à¸à¸²à¸£à¸ˆà¸±à¸šà¸„ู่บรรทัดà¹à¸¥à¸°à¸£à¸¹à¸›à¹à¸šà¸š เมื่อมีà¸à¸²à¸£à¹‚หลดเอà¸à¸ªà¸²à¸£
+Comment[tt]=İstälek açqan çaqta sözgeçkä kileşkän yullarına bitbilgelär quya
+Comment[uk]=Ð’Ñтановлює закладки на Ñ€Ñдках, що відповідають взірцю, під Ñ‡Ð°Ñ Ð·Ð°Ð²Ð°Ð½Ñ‚Ð°Ð¶ÐµÐ½Ð½Ñ Ð´Ð¾ÐºÑƒÐ¼ÐµÐ½Ñ‚Ñ–Ð²
+Comment[vi]=Äặt đánh dấu trên các dòng khá»›p má»™t mẫu nào đó khi tải tài liệu.
+Comment[zh_CN]=文档装入时根æ®åŒ¹é…模å¼è‡ªåŠ¨è®¾ç½®ä¹¦ç­¾
+Comment[zh_TW]=文件載入時以字串比å°æ¼”算法來設定書籤。
+X-KDE-Library=ktexteditor_autobookmarker
+ServiceTypes=KTextEditor/Plugin
+Type=Service
+InitialPreference=8
+MimeType=text/plain
diff --git a/kate/plugins/autobookmarker/ktexteditor_autobookmarkerrc b/kate/plugins/autobookmarker/ktexteditor_autobookmarkerrc
new file mode 100644
index 000000000..3ed8fe8c5
--- /dev/null
+++ b/kate/plugins/autobookmarker/ktexteditor_autobookmarkerrc
@@ -0,0 +1,18 @@
+[autobookmark0]
+filemask=*.pl;*.pm
+flags=1
+mimemask=text/x-perl
+pattern=sub \\w+
+
+[autobookmark1]
+filemask=*.hh;*.h
+flags=1
+mimemask=text/x-c++hdr
+pattern=^class\\s+[^;]+$
+
+[autobookmark2]
+filemask=*.js;*.html;*.HTML;*.htm;*.HTM;*.xhtml;*.asp
+flags=1
+mimemask=application/x-javascript;text/html
+pattern=\\s*function\\s+\\w+
+
diff --git a/kate/plugins/insertfile/Makefile.am b/kate/plugins/insertfile/Makefile.am
new file mode 100644
index 000000000..783e93e0f
--- /dev/null
+++ b/kate/plugins/insertfile/Makefile.am
@@ -0,0 +1,17 @@
+INCLUDES = -I$(top_srcdir)/interfaces $(all_includes)
+METASOURCES = AUTO
+
+# Install this plugin in the KDE modules directory
+kde_module_LTLIBRARIES = ktexteditor_insertfile.la
+
+ktexteditor_insertfile_la_SOURCES = insertfileplugin.cpp
+ktexteditor_insertfile_la_LIBADD = $(top_builddir)/interfaces/ktexteditor/libktexteditor.la
+ktexteditor_insertfile_la_LDFLAGS = -module $(KDE_PLUGIN) $(all_libraries)
+
+insertfiledatadir = $(kde_datadir)/ktexteditor_insertfile
+insertfiledata_DATA = ktexteditor_insertfileui.rc
+
+kde_services_DATA = ktexteditor_insertfile.desktop
+
+messages: rc.cpp
+ $(XGETTEXT) *.cpp *.h -o $(podir)/ktexteditor_insertfile.pot
diff --git a/kate/plugins/insertfile/insertfileplugin.cpp b/kate/plugins/insertfile/insertfileplugin.cpp
new file mode 100644
index 000000000..e25df8bd5
--- /dev/null
+++ b/kate/plugins/insertfile/insertfileplugin.cpp
@@ -0,0 +1,185 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2002 Anders Lund <anders@alweb.dk>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "insertfileplugin.h"
+#include "insertfileplugin.moc"
+
+#include <ktexteditor/document.h>
+#include <ktexteditor/viewcursorinterface.h>
+#include <ktexteditor/editinterface.h>
+
+#include <assert.h>
+#include <kio/job.h>
+#include <kaction.h>
+#include <kfiledialog.h>
+#include <kgenericfactory.h>
+#include <klocale.h>
+#include <kmessagebox.h>
+#include <kpushbutton.h>
+#include <ktempfile.h>
+#include <kurl.h>
+
+#include <qfile.h>
+#include <qtextstream.h>
+
+K_EXPORT_COMPONENT_FACTORY( ktexteditor_insertfile, KGenericFactory<InsertFilePlugin>( "ktexteditor_insertfile" ) )
+
+
+//BEGIN InsertFilePlugin
+InsertFilePlugin::InsertFilePlugin( QObject *parent, const char* name, const QStringList& )
+ : KTextEditor::Plugin ( (KTextEditor::Document*) parent, name )
+{
+}
+
+InsertFilePlugin::~InsertFilePlugin()
+{
+}
+
+void InsertFilePlugin::addView(KTextEditor::View *view)
+{
+ InsertFilePluginView *nview = new InsertFilePluginView (view, "Insert File Plugin");
+ m_views.append (nview);
+}
+
+void InsertFilePlugin::removeView(KTextEditor::View *view)
+{
+ for (uint z=0; z < m_views.count(); z++)
+ if (m_views.at(z)->parentClient() == view)
+ {
+ InsertFilePluginView *nview = m_views.at(z);
+ m_views.remove (nview);
+ delete nview;
+ }
+}
+//END InsertFilePlugin
+
+//BEGIN InsertFilePluginView
+InsertFilePluginView::InsertFilePluginView( KTextEditor::View *view, const char *name )
+ : QObject( view, name ),
+ KXMLGUIClient( view )
+{
+ view->insertChildClient( this );
+ setInstance( KGenericFactory<InsertFilePlugin>::instance() );
+ _job = 0;
+ (void) new KAction( i18n("Insert File..."), 0, this, SLOT(slotInsertFile()), actionCollection(), "tools_insert_file" );
+ setXMLFile( "ktexteditor_insertfileui.rc" );
+}
+
+void InsertFilePluginView::slotInsertFile()
+{
+ KFileDialog dlg("::insertfile", "", (QWidget*)parent(), "filedialog", true);
+ dlg.setOperationMode( KFileDialog::Opening );
+
+ dlg.setCaption(i18n("Choose File to Insert"));
+ dlg.okButton()->setText(i18n("&Insert"));
+ dlg.setMode( KFile::File );
+ dlg.exec();
+
+ _file = dlg.selectedURL().url();
+ if ( _file.isEmpty() ) return;
+
+ if ( _file.isLocalFile() ) {
+ _tmpfile = _file.path();
+ insertFile();
+ }
+ else {
+ KTempFile tempFile( QString::null );
+ _tmpfile = tempFile.name();
+
+ KURL destURL;
+ destURL.setPath( _tmpfile );
+ _job = KIO::file_copy( _file, destURL, 0600, true, false, true );
+ connect( _job, SIGNAL( result( KIO::Job * ) ), this, SLOT( slotFinished ( KIO::Job * ) ) );
+ }
+}
+
+void InsertFilePluginView::slotFinished( KIO::Job *job )
+{
+ assert( job == _job );
+ _job = 0;
+ if ( job->error() )
+ KMessageBox::error( (QWidget*)parent(), i18n("Failed to load file:\n\n") + job->errorString(), i18n("Insert File Error") );
+ else
+ insertFile();
+}
+
+void InsertFilePluginView::insertFile()
+{
+ QString error;
+ if ( _tmpfile.isEmpty() )
+ return;
+
+ QFileInfo fi;
+ fi.setFile( _tmpfile );
+ if (!fi.exists() || !fi.isReadable())
+ error = i18n("<p>The file <strong>%1</strong> does not exist or is not readable, aborting.").arg(_file.fileName());
+
+ QFile f( _tmpfile );
+ if ( !f.open(IO_ReadOnly) )
+ error = i18n("<p>Unable to open file <strong>%1</strong>, aborting.").arg(_file.fileName());
+
+ if ( ! error.isEmpty() ) {
+ KMessageBox::sorry( (QWidget*)parent(), error, i18n("Insert File Error") );
+ return;
+ }
+
+ // now grab file contents
+ QTextStream stream(&f);
+ QString str, tmp;
+ uint numlines = 0;
+ uint len = 0;
+ while (!stream.eof()) {
+ if ( numlines )
+ str += "\n";
+ tmp = stream.readLine();
+ str += tmp;
+ len = tmp.length();
+ numlines++;
+ }
+ f.close();
+
+ if ( str.isEmpty() )
+ error = i18n("<p>File <strong>%1</strong> had no contents.").arg(_file.fileName());
+ if ( ! error.isEmpty() ) {
+ KMessageBox::sorry( (QWidget*)parent(), error, i18n("Insert File Error") );
+ return;
+ }
+
+ // insert !!
+ KTextEditor::EditInterface *ei;
+ KTextEditor::ViewCursorInterface *ci;
+ KTextEditor::View *v = (KTextEditor::View*)parent();
+ ei = KTextEditor::editInterface( v->document() );
+ ci = KTextEditor::viewCursorInterface( v );
+ uint line, col;
+ ci->cursorPositionReal( &line, &col );
+ ei->insertText( line, col, str );
+
+ // move the cursor
+ ci->setCursorPositionReal( line + numlines - 1, numlines > 1 ? len : col + len );
+
+ // clean up
+ _file = KURL ();
+ _tmpfile.truncate( 0 );
+ v = 0;
+ ei = 0;
+ ci = 0;
+}
+
+//END InsertFilePluginView
+
diff --git a/kate/plugins/insertfile/insertfileplugin.h b/kate/plugins/insertfile/insertfileplugin.h
new file mode 100644
index 000000000..3e882416c
--- /dev/null
+++ b/kate/plugins/insertfile/insertfileplugin.h
@@ -0,0 +1,70 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2002 Anders Lund <anders@alweb.dk>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+
+ $Id$
+*/
+
+
+#ifndef _INSERT_FILE_PLUGIN_H_
+#define _INSERT_FILE_PLUGIN_H_
+
+#include <ktexteditor/plugin.h>
+#include <ktexteditor/view.h>
+
+#include <kxmlguiclient.h>
+#include <qobject.h>
+#include <jobclasses.h>
+#include <kurl.h>
+
+class InsertFilePlugin : public KTextEditor::Plugin, public KTextEditor::PluginViewInterface
+{
+ Q_OBJECT
+
+ public:
+ InsertFilePlugin( QObject *parent = 0,
+ const char* name = 0,
+ const QStringList &args = QStringList() );
+ virtual ~InsertFilePlugin();
+
+ void addView (KTextEditor::View *view);
+ void removeView (KTextEditor::View *view);
+
+
+ private:
+ QPtrList<class InsertFilePluginView> m_views;
+};
+
+class InsertFilePluginView : public QObject, public KXMLGUIClient
+{
+ Q_OBJECT
+ public:
+ InsertFilePluginView( KTextEditor::View *view, const char *name=0 );
+ ~InsertFilePluginView() {};
+ public slots:
+ /* display a file dialog, and insert the chosen file */
+ void slotInsertFile();
+ private slots:
+ void slotFinished( KIO::Job *job );
+ //slotAborted( KIO::Job *job );
+ private:
+ void insertFile();
+ KURL _file;
+ QString _tmpfile;
+ KIO::FileCopyJob *_job;
+};
+
+#endif // _INSERT_FILE_PLUGIN_H_
diff --git a/kate/plugins/insertfile/ktexteditor_insertfile.desktop b/kate/plugins/insertfile/ktexteditor_insertfile.desktop
new file mode 100644
index 000000000..1854ea95f
--- /dev/null
+++ b/kate/plugins/insertfile/ktexteditor_insertfile.desktop
@@ -0,0 +1,156 @@
+[Desktop Entry]
+Name=KTextEditor Insert File Plugin
+Name[af]=KTextEditor Voeg Lêer Inprop Module
+Name[ar]=ملحق إدراج مل٠لمحرر النصوص
+Name[az]=KTextEditor Fayl ÆlavÉ™si Daxil El
+Name[be]=Модуль уÑтаўкі файла
+Name[bn]=কে-টেকà§à¦¸à¦Ÿ-à¦à¦¡à¦¿à¦Ÿà¦° ফাইল অনà§à¦¤à¦°à§à¦­à§à¦•à§à¦¤à¦¿ পà§à¦²à¦¾à¦—-ইন
+Name[bs]=KTextEditor dodatak za ubacivanje datoteke
+Name[ca]=Connector del KTextEditor per a inserir fitxers
+Name[cs]=Modul pro vkládání souborů
+Name[csb]=Plugins editorë wstôwianiô lopków
+Name[cy]=Ategyn Mewnosod Ffeil KTextEditor
+Name[da]=KTextEditor 'indsæt fil'-plugin
+Name[de]=KTextEditor-Erweiterung zum Einfügen von Dateien
+Name[el]=ΠÏόσθετο εισαγωγής αÏχείου του KTextEditor
+Name[eo]=KTextEditor Enmeti-Dosieron-kromaĵeto
+Name[es]=Plugin de inserción de archivos de KTextEditor
+Name[et]=KTextEditori faili lisamise plugin
+Name[eu]=Fitxategiak txertatzeko KTextEditor-en plugin-a
+Name[fa]=وصلۀ پروندۀ درج KTextEditor
+Name[fi]=KTextEditorin 'Lisää tiedosto'-laajennus
+Name[fr]=Module externe du fichier d'insertion de KTextEditor
+Name[fy]=KTextEditor-plugin foar it ynfoegjen fan triemmen
+Name[ga]=Breiseán KTextEditor chun comhad a ionsá
+Name[gl]=Plugin de Inserción de Ficheiro de KTextEditor
+Name[he]=תוסף הוספת קובץ ל־KTextEditor
+Name[hi]=के-टेकà¥à¤¸à¥à¤Ÿ-à¤à¤¡à¤¿à¤Ÿà¤° फ़ाइल घà¥à¤¸à¤¾à¤¨à¥‡ का पà¥à¤²à¤—िन
+Name[hr]=KTextEditor dodatak za umetanje datoteka
+Name[hu]=KTextEditor fájlbeszúró bővítőmodul
+Name[id]=Plugin Penyisipan Berkas KTextEditor
+Name[is]=KTextEditor setja inn skrá íforrit
+Name[it]=Plugin inserimento file di KTextEditor
+Name[ja]=KTextEditor ファイル挿入プラグイン
+Name[ka]=ფáƒáƒ˜áƒšáƒ˜áƒ¡ ჩáƒáƒ“გმის KTextEditor-ის მáƒáƒ“ული
+Name[kk]=KTextEditor файлды ендіру модулі
+Name[km]=កម្មវិធី​ជំនួយ​របស់ KTextEditor Insert File
+Name[ko]=K글월편집기 íŒŒì¼ ë¼ì›Œë„£ëŠ” 플러그ì¸
+Name[lb]=KTextEditor-Plugin fir Dateien anzefügen
+Name[lt]=KTextEditor bylos įterpimo priedas
+Name[lv]=KTextEditor faila ievietošanas spraudnis
+Name[mk]=KTextEditor приклучок за Ð²Ð½ÐµÑ Ð½Ð° датотеки
+Name[mn]=XML-Plugin Ð—Ð°Ð»Ð³Ð°Ð°Ñ Ñ„Ð°Ð¹Ð»ÑƒÑƒÐ´Ñ‹Ð½ хувьд
+Name[ms]=Plug masuk Fail KTextEditor
+Name[mt]=Plagin ta' KTextEditor biex iddaħħal fajl
+Name[nb]=Programtillegg for 'sett inn fil' i KTextEditor
+Name[nds]=KTextEditor-Plugin för't Datei-Infögen
+Name[ne]=KTextEditor घà¥à¤¸à¤¾à¤‰à¤¨à¥‡ फाइल पà¥à¤²à¤—इन
+Name[nl]=KTextEditor-plugin voor het invoegen van bestanden
+Name[nn]=Programtillegg for innsetjing av fil i skriveprogram
+Name[nso]=Tsenyo ya Faele ya Mofetosi wa Sengwalwana sa K
+Name[pa]=KTextEditor ਸ਼ਾਮਿਲ ਫਾਇਲ ਪਲੱਗਿੰਨ
+Name[pl]=Wtyczka edytora wstawiania plików
+Name[pt]='Plugin' de Inserção de Ficheiros do KTextEditor
+Name[pt_BR]=Plug-in de Inserção de Arquivos para o Editor de textos
+Name[ro]=Modul inserare fiÅŸier pentru KTextEditor
+Name[ru]=Модуль вÑтавки файла KTextEditor
+Name[rw]=Icomeka ryo Kongeramo Idosiye rya KMuhinduziMwandiko
+Name[se]=KTextEditor-fiillalasiheami lassemoduvla
+Name[sk]=Module pre vloženie súboru KTextEditor
+Name[sl]=Vstavek KTextEditor za vstavljanje datotek
+Name[sq]=KTextEditor Shtojca: Fute skedën
+Name[sr]=KTextEditor прикључак за уметање фајла
+Name[sr@Latn]=KTextEditor prikljuÄak za umetanje fajla
+Name[ss]=I-KTextEditor yingenisa i-plugin yelifayela
+Name[sv]=Ktexteditor-insticksprogram för att infoga filer
+Name[ta]=கேஉரைதொகà¯à®ªà¯à®ªà®¾à®³à®°à¯ கோபà¯à®ªà¯ உளà¯à®³à¯€à®Ÿà¯à®Ÿà¯à®šà¯ சொரà¯à®•à¯à®ªà¯à®ªà¯Šà®°à¯à®³à¯
+Name[te]=కెటెకà±à°¸à±à°Ÿà± ఎడిటరౠదసà±à°¤à±à°°à°¾à°¨à±à°¨à°¿ దూరà±à°šà± à°ªà±à°²à°—à°¿à°¨à±
+Name[tg]=Пуркунандаи KTextEditor барои дарҷи файлҳо
+Name[th]=ปลัà¸à¸­à¸´à¸™à¸à¸²à¸£à¹à¸—รà¸à¹à¸Ÿà¹‰à¸¡à¸‚อง KTextEditor
+Name[tr]=KTextEditor Dosya YerleÅŸtirme Eklentisi
+Name[tt]=KTextEditor'nıñ Birem Tığu Quşılması
+Name[uk]=Втулок KTextEditor Ð´Ð»Ñ Ð²ÑÑ‚Ð°Ð²Ð»ÐµÐ½Ð½Ñ Ñ„Ð°Ð¹Ð»Ð°
+Name[uz]=KTextEditor uchun fayldan qoʻyish plagin
+Name[uz@cyrillic]=KTextEditor учун файлдан қўйиш плагин
+Name[ven]=Musengulusi wa manwalwa K i dzhenisa pulagini ya faela
+Name[vi]=Bộ cầm phít Chèn Tập tin KTextEditor
+Name[wa]=Tchôke-divins di KTextEditor po stitchî des fitchîs
+Name[xh]=KTextEditor Faka Ifayile ye Plagi efakiweyo
+Name[zh_CN]=KTextEditor æ’入文件æ’件
+Name[zh_HK]=文字編輯器æ’入檔案外掛程å¼
+Name[zh_TW]=文字編輯器æ’入檔案外掛程å¼
+Name[zu]=Faka Ifayela Lokungena ngaphakathi le-KTextEditor
+Comment=Insert any readable file at cursor position
+Comment[af]=Voeg enige leesbare lêer in by die merker posisie
+Comment[be]=УÑтаўлÑе файл у пазіцыю курÑора
+Comment[bg]=Вмъкване на файл от мÑÑтото на курÑора
+Comment[bn]=কারà§à¦¸à¦¾à¦° অবসà§à¦¥à¦¾à¦¨à§‡ যে কোনো (পাঠযোগà§à¦¯) ফাইল অনà§à¦¤à¦°à§à¦­à§à¦•à§à¦¤ করতে পারে
+Comment[bs]=Ubacuje bilo koju Äitljivu datoteku na poziciju kursora
+Comment[ca]=Inserir qualsevol fitxer llegible en la posició del cursor
+Comment[cs]=Vloží jakýkoliv Äitelný soubor na místo kurzoru
+Comment[csb]=Wstôwiô zamkłosc lopkù przë kursorze
+Comment[da]=Indsæt en vilkårlig læsbar fil ved markørens position
+Comment[de]=Beliebige lesbare Datei an Cursor-Position einfügen
+Comment[el]=Εισαγωγή οποιουδήποτε αναγνώσιμου αÏχείου στη θέση του δÏομέα
+Comment[eo]=Enmeti iun legeblan dosieron ĉe la pozicio de la kursoro
+Comment[es]=Insertar cualquier archivo legible en la posición del cursor
+Comment[et]=Suvalise loetava faili lisamine kursori asukohta
+Comment[eu]=Kurtsorearen posizioan fitxategi irakurgarri bat txertatzen du
+Comment[fa]=درج هر پروندۀ قابل خواندن در موقعیت مکان‌نما
+Comment[fi]=Lisää mikä tahansa luettava tiedosto kursorin kohdalle
+Comment[fr]=Insérer tout fichier lisible à la position du curseur
+Comment[fy]=Els lêsber triem by it rinnerke ynfoegje
+Comment[gl]=Inserir calquera ficheiro lexíbel na posición do cursor
+Comment[he]=מוסיף כל קובץ בר קיר××” ×‘×ž×™×§×•× ×”×¡×ž×Ÿ
+Comment[hr]=Na položaju pokazivaÄa umetnite bilo koju Äitljivu datoteku
+Comment[hsb]=Zasunje lubowólnu Äitajomnu dataju na poziciji cursora
+Comment[hu]=Tetszőleges olvasható fájl beszúrása a kurzorpozíciónál
+Comment[id]=Sisipkan berkas apa saja yang bisa dibaca ke posisi kursor
+Comment[is]=Setur inn hvaða lesanlegu skrá sem er í stöðu bendilsins
+Comment[it]=Inserisce un qualsiasi file leggibile alla posizione del cursore
+Comment[ja]=カーソルä½ç½®ã«èª­ã¿è¾¼ã¿å¯èƒ½ãªãƒ•ã‚¡ã‚¤ãƒ«ã‚’挿入ã—ã¾ã™
+Comment[ka]=ნებისმიერი კითხვáƒáƒ“ი ფáƒáƒ˜áƒšáƒ˜áƒ¡ კურსáƒáƒ áƒ˜áƒ¡ áƒáƒ“გილáƒáƒ¡ ჩáƒáƒ›áƒáƒ¢áƒ”ბáƒ
+Comment[kk]=Меңзер көрÑететін орынға кез-келген оқылатын файлды ендіру
+Comment[km]=បញ្ចូល​ឯកសារ​ដែល​អាច​អាន​បាន​ណាមួយ​នៅ​ទីážáž¶áŸ†áž„​របស់​ទស្សនáŸâ€‹áž‘្រនិច
+Comment[ko]=커서가 있는 ê³³ì— ì½ì„ 수 있는 파ì¼ì„ ë¼ì›Œ 넣습니다
+Comment[lb]=Setzt eng liesbar Datei bei der Cursorpositioun an
+Comment[lt]=Įterpią bet kokią skaitomą bylą ties žymekliu
+Comment[lv]=Ievieto jebkuru lasÄmu failu kursora atraÅ¡anÄs vietÄ
+Comment[mk]=ВнеÑува било која читлива датотека на позицијата на курÑорот
+Comment[ms]=Sisipkan sebarang fail boleh baca di posisi kursor
+Comment[nb]=Sett inn en lesbar fil ved skrivemerket
+Comment[nds]=Jichtenseen leesbore Datei bi'n Blinker infögen
+Comment[ne]=करà¥à¤¸à¤° सà¥à¤¥à¤¿à¤¤à¤¿à¤®à¤¾ कà¥à¤¨à¥ˆ पनि पढà¥à¤¨à¤¯à¥‹à¤—à¥à¤¯ फाइल घà¥à¤¸à¤¾à¤‰à¤¨à¥à¤¹à¥‹à¤¸à¥
+Comment[nl]=Voeg een willekeurig leesbaar bestand in op de cursorpositie
+Comment[nn]=Set inn ei lesbar fil ved skrivemerket
+Comment[pa]=ਕੋਈ ਪੜਨਯੋਗ ਫਾਇਲ ਕਰਸਰ ਸਥਿਤੀ ਤੇ ਸ਼ਾਮਿਲ ਕਰੋ
+Comment[pl]=Wstawia zawartość pliku w pozycji kursora
+Comment[pt]=Insira qualquer ficheiro legível na posição do cursor
+Comment[pt_BR]=Insere qualquer arquivo com permissões de leitura na posição do cursor
+Comment[ro]=Inserează la poziţia cursorului orice fişier citibil
+Comment[ru]=вÑтавка любого читаемого файла в позиции курÑора
+Comment[rw]=Kongeramo idosiye isomeka ibonetse ku mwanya w'inyoboranyandiko
+Comment[se]=Lasiha logahahtti fiilla Äállinmearkka sajádahkii
+Comment[sk]=Vloží ľubovoľný súbor na pozíciu kurzora
+Comment[sl]=Vstavi katerokoli berljivo datoteko na položaju kazalca
+Comment[sr]=Убаците било који читљиви фајл на положају курÑора
+Comment[sr@Latn]=Ubacite bilo koji Äitljivi fajl na položaju kursora
+Comment[sv]=Infoga vilken läsbar fil som helst vid markörens plats
+Comment[ta]=சà¯à®Ÿà¯à®Ÿà¯à®®à¯ இடதà¯à®¤à®¿à®²à¯ படிகà¯à®•à®•à¯à®•à¯‚டிய கோபà¯à®ªà®¿à®©à¯ˆ உளà¯à®³à®¿à®Ÿà¯
+Comment[te]=à°®à±à°²à±à°•à± à°µà±à°¨à±à°¨ చోట చదవగలిగే దసà±à°¤à±à°°à°¾à°¨à±à°¨à°¿ దూరà±à°šà±à°¨à±
+Comment[tg]=Файли хондашавандаи ҳеҷгуна дар мавқеъи курÑор ҷойгир мекунад
+Comment[th]=ทำà¸à¸²à¸£à¹à¸—รà¸à¹à¸Ÿà¹‰à¸¡à¸—ี่สามารถอ่านได้ที่ตำà¹à¸«à¸™à¹ˆà¸‡à¸‚องเคอร์เซอร์
+Comment[tr]=İmleç konumunda herhangi bir dosyanın içeriğini ekle
+Comment[tt]=Kürsär urınına, uqıp bulğan birem eçtälegen tığıp östi
+Comment[uk]=Ð’ÑтавлÑÑ” вміÑÑ‚ будь-Ñкого файла, Ñкий можна прочитати, у позицію курÑора
+Comment[uz]=Har qanday oʻqib boʻladigan faylni kursorning joyidan qoʻyish
+Comment[uz@cyrillic]=Ҳар қандай ўқиб бўладиган файлни курÑорнинг жойидан қўйиш
+Comment[vi]=Chèn bất kỳ tập tin có khả năng Ä‘á»c tại vị trí của con chạy.
+Comment[zh_CN]=在光标ä½ç½®æ’入任何å¯è¯»æ–‡ä»¶
+Comment[zh_HK]=在游標處æ’入任æ„的檔案
+Comment[zh_TW]=在游標處æ’入任æ„çš„å¯è®€æª”案
+X-KDE-Library=ktexteditor_insertfile
+ServiceTypes=KTextEditor/Plugin
+Type=Service
+InitialPreference=8
+MimeType=text/plain
diff --git a/kate/plugins/insertfile/ktexteditor_insertfileui.rc b/kate/plugins/insertfile/ktexteditor_insertfileui.rc
new file mode 100644
index 000000000..36ac0916f
--- /dev/null
+++ b/kate/plugins/insertfile/ktexteditor_insertfileui.rc
@@ -0,0 +1,9 @@
+<!DOCTYPE kpartgui>
+<kpartplugin name="ktexteditor_insertfile" library="ktexteditor_insertfile" version="2">
+<MenuBar>
+ <Menu name="tools"><Text>&amp;Tools</Text>
+ <separator group="tools_operations" />
+ <Action name="tools_insert_file" group="tools_operations"/>
+ </Menu>
+</MenuBar>
+</kpartplugin>
diff --git a/kate/plugins/isearch/ISearchPlugin.cpp b/kate/plugins/isearch/ISearchPlugin.cpp
new file mode 100644
index 000000000..9a790a3ef
--- /dev/null
+++ b/kate/plugins/isearch/ISearchPlugin.cpp
@@ -0,0 +1,495 @@
+ /* This file is part of the KDE libraries
+ Copyright (C) 2002 by John Firebaugh <jfirebaugh@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+ */
+
+#include <qlabel.h>
+#include <qregexp.h>
+#include <qstyle.h>
+#include <qpopupmenu.h>
+#include <kgenericfactory.h>
+#include <klocale.h>
+#include <kaction.h>
+#include <kcombobox.h>
+#include <kconfig.h>
+#include <kdebug.h>
+
+#include "ISearchPlugin.h"
+#include "ISearchPlugin.moc"
+
+K_EXPORT_COMPONENT_FACTORY( ktexteditor_isearch, KGenericFactory<ISearchPlugin>( "ktexteditor_isearch" ) )
+
+ISearchPluginView::ISearchPluginView( KTextEditor::View *view )
+ : QObject ( view ), KXMLGUIClient (view)
+ , m_view( 0L )
+ , m_doc( 0L )
+ , m_searchIF( 0L )
+ , m_cursorIF( 0L )
+ , m_selectIF( 0L )
+// , m_toolBarAction( 0L )
+ , m_searchForwardAction( 0L )
+ , m_searchBackwardAction( 0L )
+ , m_label( 0L )
+ , m_combo( 0L )
+ , m_lastString( "" )
+ , m_searchBackward( false )
+ , m_caseSensitive( false )
+ , m_fromBeginning( false )
+ , m_regExp( false )
+ , m_autoWrap( false )
+ , m_wrapped( false )
+ , m_startLine( 0 )
+ , m_startCol( 0 )
+ , m_searchLine( 0 )
+ , m_searchCol( 0 )
+ , m_foundLine( 0 )
+ , m_foundCol( 0 )
+ , m_matchLen( 0 )
+ , m_toolBarWasHidden( false )
+{
+ view->insertChildClient (this);
+
+ setInstance( KGenericFactory<ISearchPlugin>::instance() );
+
+ m_searchForwardAction = new KAction(
+ i18n("Search Incrementally"), CTRL+ALT+Key_F,
+ this, SLOT(slotSearchForwardAction()),
+ actionCollection(), "edit_isearch" );
+ m_searchBackwardAction = new KAction(
+ i18n("Search Incrementally Backwards"), CTRL+ALT+SHIFT+Key_F,
+ this, SLOT(slotSearchBackwardAction()),
+ actionCollection(), "edit_isearch_reverse" );
+
+ m_label = new QLabel( i18n("I-Search:"), 0L, "kde toolbar widget" );
+ KWidgetAction* labelAction = new KWidgetAction(
+ m_label,
+ i18n("I-Search:"), 0, 0, 0,
+ actionCollection(), "isearch_label" );
+ labelAction->setShortcutConfigurable( false );
+
+ m_combo = new KHistoryCombo();
+ m_combo->setDuplicatesEnabled( false );
+ m_combo->setMaximumWidth( 300 );
+ m_combo->lineEdit()->installEventFilter( this );
+ connect( m_combo, SIGNAL(textChanged(const QString&)),
+ this, SLOT(slotTextChanged(const QString&)) );
+ connect( m_combo, SIGNAL(returnPressed(const QString&)),
+ this, SLOT(slotReturnPressed(const QString&)) );
+ connect( m_combo, SIGNAL(aboutToShowContextMenu(QPopupMenu*)),
+ this, SLOT(slotAddContextMenuItems(QPopupMenu*)) );
+ m_comboAction = new KWidgetAction(
+ m_combo,
+ i18n("Search"), 0, 0, 0,
+ actionCollection(), "isearch_combo" );
+ m_comboAction->setAutoSized( true );
+ m_comboAction->setShortcutConfigurable( false );
+
+ KActionMenu* optionMenu = new KActionMenu(
+ i18n("Search Options"), "configure",
+ actionCollection(), "isearch_options" );
+ optionMenu->setDelayed( false );
+
+ KToggleAction* action = new KToggleAction(
+ i18n("Case Sensitive"), KShortcut(),
+ actionCollection(), "isearch_case_sensitive" );
+ action->setShortcutConfigurable( false );
+ connect( action, SIGNAL(toggled(bool)),
+ this, SLOT(setCaseSensitive(bool)) );
+ action->setChecked( m_caseSensitive );
+ optionMenu->insert( action );
+
+ action = new KToggleAction(
+ i18n("From Beginning"), KShortcut(),
+ actionCollection(), "isearch_from_beginning" );
+ action->setShortcutConfigurable( false );
+ connect( action, SIGNAL(toggled(bool)),
+ this, SLOT(setFromBeginning(bool)) );
+ action->setChecked( m_fromBeginning );
+ optionMenu->insert( action );
+
+ action = new KToggleAction(
+ i18n("Regular Expression"), KShortcut(),
+ actionCollection(), "isearch_reg_exp" );
+ action->setShortcutConfigurable( false );
+ connect( action, SIGNAL(toggled(bool)),
+ this, SLOT(setRegExp(bool)) );
+ action->setChecked( m_regExp );
+ optionMenu->insert( action );
+
+// optionMenu->insert( new KActionSeparator() );
+//
+// action = new KToggleAction(
+// i18n("Auto-Wrap Search"), KShortcut(),
+// actionCollection(), "isearch_auto_wrap" );
+// connect( action, SIGNAL(toggled(bool)),
+// this, SLOT(setAutoWrap(bool)) );
+// action->setChecked( m_autoWrap );
+// optionMenu->insert( action );
+
+ setXMLFile( "ktexteditor_isearchui.rc" );
+}
+
+ISearchPluginView::~ISearchPluginView()
+{
+ writeConfig();
+ m_combo->lineEdit()->removeEventFilter( this );
+ delete m_combo;
+ delete m_label;
+}
+
+void ISearchPluginView::setView( KTextEditor::View* view )
+{
+ m_view = view;
+ m_doc = m_view->document();
+ m_searchIF = KTextEditor::searchInterface ( m_doc );
+ m_cursorIF = KTextEditor::viewCursorInterface ( m_view );
+ m_selectIF = KTextEditor::selectionInterface ( m_doc );
+ if( !m_doc || !m_cursorIF || !m_selectIF ) {
+ m_view = 0L;
+ m_doc = 0L;
+ m_searchIF = 0L;
+ m_cursorIF = 0L;
+ m_selectIF = 0L;
+ }
+
+ readConfig();
+}
+
+void ISearchPluginView::readConfig()
+{
+ // KConfig* config = instance()->config();
+}
+
+void ISearchPluginView::writeConfig()
+{
+ // KConfig* config = instance()->config();
+}
+
+void ISearchPluginView::setCaseSensitive( bool caseSensitive )
+{
+ m_caseSensitive = caseSensitive;
+}
+
+void ISearchPluginView::setFromBeginning( bool fromBeginning )
+{
+ m_fromBeginning = fromBeginning;
+
+ if( m_fromBeginning ) {
+ m_searchLine = m_searchCol = 0;
+ }
+}
+
+void ISearchPluginView::setRegExp( bool regExp )
+{
+ m_regExp = regExp;
+}
+
+void ISearchPluginView::setAutoWrap( bool autoWrap )
+{
+ m_autoWrap = autoWrap;
+}
+
+bool ISearchPluginView::eventFilter( QObject* o, QEvent* e )
+{
+ if( o != m_combo->lineEdit() )
+ return false;
+
+ if( e->type() == QEvent::FocusIn ) {
+ QFocusEvent* focusEvent = (QFocusEvent*)e;
+ if( focusEvent->reason() == QFocusEvent::ActiveWindow ||
+ focusEvent->reason() == QFocusEvent::Popup )
+ return false;
+ startSearch();
+ }
+
+ if( e->type() == QEvent::FocusOut ) {
+ QFocusEvent* focusEvent = (QFocusEvent*)e;
+ if( focusEvent->reason() == QFocusEvent::ActiveWindow ||
+ focusEvent->reason() == QFocusEvent::Popup )
+ return false;
+ endSearch();
+ }
+
+ if( e->type() == QEvent::KeyPress ) {
+ QKeyEvent *keyEvent = (QKeyEvent*)e;
+ if( keyEvent->key() == Qt::Key_Escape )
+ quitToView( QString::null );
+ }
+
+ return false;
+}
+
+// Sigh... i18n hell.
+void ISearchPluginView::updateLabelText(
+ bool failing /* = false */, bool reverse /* = false */,
+ bool wrapped /* = false */, bool overwrapped /* = false */ )
+{
+ QString text;
+ // Reverse binary:
+ // 0000
+ if( !failing && !reverse && !wrapped && !overwrapped ) {
+ text = i18n("Incremental Search", "I-Search:");
+ // 1000
+ } else if ( failing && !reverse && !wrapped && !overwrapped ) {
+ text = i18n("Incremental Search found no match", "Failing I-Search:");
+ // 0100
+ } else if ( !failing && reverse && !wrapped && !overwrapped ) {
+ text = i18n("Incremental Search in the reverse direction", "I-Search Backward:");
+ // 1100
+ } else if ( failing && reverse && !wrapped && !overwrapped ) {
+ text = i18n("Failing I-Search Backward:");
+ // 0010
+ } else if ( !failing && !reverse && wrapped && !overwrapped ) {
+ text = i18n("Incremental Search has passed the end of the document", "Wrapped I-Search:");
+ // 1010
+ } else if ( failing && !reverse && wrapped && !overwrapped ) {
+ text = i18n("Failing Wrapped I-Search:");
+ // 0110
+ } else if ( !failing && reverse && wrapped && !overwrapped ) {
+ text = i18n("Wrapped I-Search Backward:");
+ // 1110
+ } else if ( failing && reverse && wrapped && !overwrapped ) {
+ text = i18n("Failing Wrapped I-Search Backward:");
+ // 0011
+ } else if ( !failing && !reverse && overwrapped ) {
+ text = i18n("Incremental Search has passed both the end of the document "
+ "and the original starting position", "Overwrapped I-Search:");
+ // 1011
+ } else if ( failing && !reverse && overwrapped ) {
+ text = i18n("Failing Overwrapped I-Search:");
+ // 0111
+ } else if ( !failing && reverse && overwrapped ) {
+ text = i18n("Overwrapped I-Search Backwards:");
+ // 1111
+ } else if ( failing && reverse && overwrapped ) {
+ text = i18n("Failing Overwrapped I-Search Backward:");
+ } else {
+ text = i18n("Error: unknown i-search state!");
+ }
+ m_label->setText( text );
+}
+
+void ISearchPluginView::slotSearchForwardAction()
+{
+ slotSearchAction( false );
+}
+
+void ISearchPluginView::slotSearchBackwardAction()
+{
+ slotSearchAction( true );
+}
+
+void ISearchPluginView::slotSearchAction( bool reverse )
+{
+ if( !m_combo->hasFocus() ) {
+ if( m_comboAction->container(0) && m_comboAction->container(0)->isHidden() ) {
+ m_toolBarWasHidden = true;
+ m_comboAction->container(0)->setHidden( false );
+ } else {
+ m_toolBarWasHidden = false;
+ }
+ m_combo->setFocus(); // Will call startSearch()
+ } else {
+ nextMatch( reverse );
+ }
+}
+
+void ISearchPluginView::nextMatch( bool reverse )
+{
+ QString text = m_combo->currentText();
+ if( text.isEmpty() )
+ return;
+ if( state != MatchSearch ) {
+ // Last search was performed by typing, start from that match.
+ if( !reverse ) {
+ m_searchLine = m_foundLine;
+ m_searchCol = m_foundCol + m_matchLen;
+ } else {
+ m_searchLine = m_foundLine;
+ m_searchCol = m_foundCol;
+ }
+ state = MatchSearch;
+ }
+
+ bool found = iSearch( m_searchLine, m_searchCol, text, reverse, m_autoWrap );
+ if( found ) {
+ m_searchLine = m_foundLine;
+ m_searchCol = m_foundCol + m_matchLen;
+ } else {
+ m_wrapped = true;
+ m_searchLine = m_searchCol = 0;
+ }
+}
+
+void ISearchPluginView::startSearch()
+{
+ if( !m_view ) return;
+
+ m_searchForwardAction->setText( i18n("Next Incremental Search Match") );
+ m_searchBackwardAction->setText( i18n("Previous Incremental Search Match") );
+
+ m_wrapped = false;
+
+ if( m_fromBeginning ) {
+ m_startLine = m_startCol = 0;
+ } else {
+ m_cursorIF->cursorPositionReal( &m_startLine, &m_startCol );
+ }
+ m_searchLine = m_startLine;
+ m_searchCol = m_startCol;
+
+ updateLabelText( false, m_searchBackward );
+
+ m_combo->blockSignals( true );
+
+ QString text = m_selectIF->selection();
+ if( text.isEmpty() )
+ text = m_lastString;
+ m_combo->setCurrentText( text );
+
+ m_combo->blockSignals( false );
+ m_combo->lineEdit()->selectAll();
+
+// kdDebug() << "Starting search at " << m_startLine << ", " << m_startCol << endl;
+}
+
+void ISearchPluginView::endSearch()
+{
+ m_searchForwardAction->setText( i18n("Search Incrementally") );
+ m_searchBackwardAction->setText( i18n("Search Incrementally Backwards") );
+
+ updateLabelText();
+
+ if( m_toolBarWasHidden && m_comboAction->containerCount() > 0 ) {
+ m_comboAction->container(0)->setHidden( true );
+ }
+}
+
+void ISearchPluginView::quitToView( const QString &text )
+{
+ if( !text.isNull() && !text.isEmpty() ) {
+ m_combo->addToHistory( text );
+ m_lastString = text;
+ }
+
+ if( m_view ) {
+ m_view->setFocus(); // Will call endSearch()
+ }
+}
+
+void ISearchPluginView::slotTextChanged( const QString& text )
+{
+ state = TextSearch;
+
+ if( text.isEmpty() )
+ return;
+
+ iSearch( m_searchLine, m_searchCol, text, m_searchBackward, m_autoWrap );
+}
+
+void ISearchPluginView::slotReturnPressed( const QString& text )
+{
+ quitToView( text );
+}
+
+void ISearchPluginView::slotAddContextMenuItems( QPopupMenu *menu )
+{
+ if( menu ) {
+ menu->insertSeparator();
+ menu->insertItem( i18n("Case Sensitive"), this,
+ SLOT(setCaseSensitive(bool)));
+ menu->insertItem( i18n("From Beginning"), this,
+ SLOT(setFromBeginning(bool)));
+ menu->insertItem( i18n("Regular Expression"), this,
+ SLOT(setRegExp(bool)));
+ //menu->insertItem( i18n("Auto-Wrap Search"), this,
+ // SLOT(setAutoWrap(bool)));
+ }
+}
+
+bool ISearchPluginView::iSearch(
+ uint startLine, uint startCol,
+ const QString& text, bool reverse,
+ bool autoWrap )
+{
+ if( !m_view ) return false;
+
+// kdDebug() << "Searching for " << text << " at " << startLine << ", " << startCol << endl;
+ bool found = false;
+ if( !m_regExp ) {
+ found = m_searchIF->searchText( startLine,
+ startCol,
+ text,
+ &m_foundLine,
+ &m_foundCol,
+ &m_matchLen,
+ m_caseSensitive,
+ reverse );
+ } else {
+ found = m_searchIF->searchText( startLine,
+ startCol,
+ QRegExp( text ),
+ &m_foundLine,
+ &m_foundCol,
+ &m_matchLen,
+ reverse );
+ }
+ if( found ) {
+// kdDebug() << "Found '" << text << "' at " << m_foundLine << ", " << m_foundCol << endl;
+// v->gotoLineNumber( m_foundLine );
+ m_cursorIF->setCursorPositionReal( m_foundLine, m_foundCol + m_matchLen );
+ m_selectIF->setSelection( m_foundLine, m_foundCol, m_foundLine, m_foundCol + m_matchLen );
+ } else if ( autoWrap ) {
+ m_wrapped = true;
+ found = iSearch( 0, 0, text, reverse, false );
+ }
+ // FIXME
+ bool overwrapped = ( m_wrapped &&
+ ((m_foundLine > m_startLine ) ||
+ (m_foundLine == m_startLine && m_foundCol >= m_startCol)) );
+// kdDebug() << "Overwrap = " << overwrapped << ". Start was " << m_startLine << ", " << m_startCol << endl;
+ updateLabelText( !found, reverse, m_wrapped, overwrapped );
+ return found;
+}
+
+ISearchPlugin::ISearchPlugin( QObject *parent, const char* name, const QStringList& )
+ : KTextEditor::Plugin ( (KTextEditor::Document*) parent, name )
+{
+}
+
+ISearchPlugin::~ISearchPlugin()
+{
+}
+
+void ISearchPlugin::addView(KTextEditor::View *view)
+{
+ ISearchPluginView *nview = new ISearchPluginView (view);
+ nview->setView (view);
+ m_views.append (nview);
+}
+
+void ISearchPlugin::removeView(KTextEditor::View *view)
+{
+ for (uint z=0; z < m_views.count(); z++)
+ {
+ if (m_views.at(z)->parentClient() == view)
+ {
+ ISearchPluginView *nview = m_views.at(z);
+ m_views.remove (nview);
+ delete nview;
+ }
+ }
+}
diff --git a/kate/plugins/isearch/ISearchPlugin.h b/kate/plugins/isearch/ISearchPlugin.h
new file mode 100644
index 000000000..d2f603fb8
--- /dev/null
+++ b/kate/plugins/isearch/ISearchPlugin.h
@@ -0,0 +1,114 @@
+ /* This file is part of the KDE libraries
+ Copyright (C) 2002 by John Firebaugh <jfirebaugh@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+ */
+
+#ifndef _ISearchPlugin_H_
+#define _ISearchPlugin_H_
+
+#include <ktexteditor/plugin.h>
+#include <ktexteditor/view.h>
+#include <ktexteditor/document.h>
+#include <ktexteditor/searchinterface.h>
+#include <ktexteditor/viewcursorinterface.h>
+#include <ktexteditor/selectioninterface.h>
+
+#include <kxmlguiclient.h>
+#include <qobject.h>
+#include <qguardedptr.h>
+
+class QLabel;
+
+class ISearchPlugin : public KTextEditor::Plugin, public KTextEditor::PluginViewInterface
+{
+ Q_OBJECT
+
+public:
+ ISearchPlugin( QObject *parent = 0, const char* name = 0, const QStringList &args = QStringList() );
+ virtual ~ISearchPlugin();
+
+ void addView (KTextEditor::View *view);
+ void removeView (KTextEditor::View *view);
+
+private:
+ QPtrList<class ISearchPluginView> m_views;
+};
+
+class ISearchPluginView : public QObject, public KXMLGUIClient
+{
+ Q_OBJECT
+
+public:
+ ISearchPluginView( KTextEditor::View *view );
+ virtual ~ISearchPluginView();
+
+ virtual bool eventFilter( QObject*, QEvent* );
+
+ void setView( KTextEditor::View* view );
+
+public slots:
+ void setCaseSensitive( bool );
+ void setFromBeginning( bool );
+ void setRegExp( bool );
+ void setAutoWrap( bool );
+
+private slots:
+ void slotSearchForwardAction();
+ void slotSearchBackwardAction();
+ void slotSearchAction( bool reverse );
+ void slotTextChanged( const QString& text );
+ void slotReturnPressed( const QString& text );
+ void slotAddContextMenuItems( QPopupMenu *menu);
+
+private:
+ void readConfig();
+ void writeConfig();
+
+ void updateLabelText( bool failing = false, bool reverse = false,
+ bool wrapped = false, bool overwrapped = false );
+ void startSearch();
+ void endSearch();
+ void quitToView( const QString &text );
+
+ void nextMatch( bool reverse );
+ bool iSearch( uint startLine, uint startCol,
+ const QString& text, bool reverse, bool autoWrap );
+
+ KTextEditor::View* m_view;
+ KTextEditor::Document* m_doc;
+ KTextEditor::SearchInterface* m_searchIF;
+ KTextEditor::ViewCursorInterface* m_cursorIF;
+ KTextEditor::SelectionInterface* m_selectIF;
+ KAction* m_searchForwardAction;
+ KAction* m_searchBackwardAction;
+ KWidgetAction* m_comboAction;
+ QGuardedPtr<QLabel> m_label;
+ QGuardedPtr<KHistoryCombo> m_combo;
+ QString m_lastString;
+ bool m_searchBackward;
+ bool m_caseSensitive;
+ bool m_fromBeginning;
+ bool m_regExp;
+ bool m_autoWrap;
+ bool m_wrapped;
+ uint m_startLine, m_startCol;
+ uint m_searchLine, m_searchCol;
+ uint m_foundLine, m_foundCol, m_matchLen;
+ bool m_toolBarWasHidden;
+ enum { NoSearch, TextSearch, MatchSearch } state;
+};
+
+#endif // _ISearchPlugin_H_
diff --git a/kate/plugins/isearch/Makefile.am b/kate/plugins/isearch/Makefile.am
new file mode 100644
index 000000000..70327218e
--- /dev/null
+++ b/kate/plugins/isearch/Makefile.am
@@ -0,0 +1,18 @@
+INCLUDES = -I$(top_srcdir)/interfaces $(all_includes)
+METASOURCES = AUTO
+
+# Install this plugin in the KDE modules directory
+kde_module_LTLIBRARIES = ktexteditor_isearch.la
+
+ktexteditor_isearch_la_SOURCES = ISearchPlugin.cpp
+ktexteditor_isearch_la_LIBADD = $(top_builddir)/interfaces/ktexteditor/libktexteditor.la
+ktexteditor_isearch_la_LDFLAGS = -module $(KDE_PLUGIN) $(all_libraries)
+
+isearchdatadir = $(kde_datadir)/ktexteditor_isearch
+isearchdata_DATA = ktexteditor_isearchui.rc
+
+kde_services_DATA = ktexteditor_isearch.desktop
+
+messages: rc.cpp
+ $(XGETTEXT) *.cpp *.h -o $(podir)/ktexteditor_isearch.pot
+
diff --git a/kate/plugins/isearch/ktexteditor_isearch.desktop b/kate/plugins/isearch/ktexteditor_isearch.desktop
new file mode 100644
index 000000000..0a345495e
--- /dev/null
+++ b/kate/plugins/isearch/ktexteditor_isearch.desktop
@@ -0,0 +1,153 @@
+[Desktop Entry]
+Name=KTextEditor Incremental Search Plugin
+Name[af]=KTextEditor Inkrementele Soektog Inprop Module
+Name[ar]=ملحق بحث تزايدي لمحرر نصوص كيدي
+Name[az]=KTextEditor Artan Axtarış ÆlavÉ™si
+Name[be]=Модуль паÑтуповага пошуку
+Name[bn]=কে-টেকà§à¦¸à¦Ÿ-à¦à¦¡à¦¿à¦Ÿà¦° ধারাবাহিক সনà§à¦§à¦¾à¦¨ পà§à¦²à¦¾à¦—-ইন
+Name[bs]=KTextEditor dodatak za inkrementalnu pretragu
+Name[ca]=Connector del KTextEditor per a la recerca incremental
+Name[cs]=Modul pro postupné vyhledávání
+Name[csb]=Pligins editorë do przërostowi szëkbë
+Name[cy]=Ategyn Chwiliad Cynyddol KGolyguTestun
+Name[da]=KTextEditor inkrementel søgnings-plugin
+Name[de]=KTextEditor-Erweiterung zur einengenden Suche
+Name[el]=ΠÏόσθετο αυξητικής αναζήτησης KTextEditor
+Name[eo]=KTextEditor Iom-post-Ioma-Serĉo-kromaĵeto
+Name[es]=Plugin de búsqueda incremental de KTextEditor
+Name[et]=KTextEditori täpsustava otsingu plugin
+Name[eu]=KTextEditor-en bilaketa inkrementalerako plugin-a
+Name[fa]=وصلۀ جستجوی نموی KTextEditor
+Name[fi]=KTextEditorin tarkentuvan haun laajennus
+Name[fr]=Module externe de recherche incrémentale pour KTextEditor
+Name[fy]=KTextEditor-plugin foar sykaksjes yn meardere stappen
+Name[ga]=Breiseán KTextEditor do chuardach incriminteach
+Name[gl]=Plugin de Procura Incremental de KTextEditor
+Name[he]=תוסף חיפוש חלקי ל־KTextEditor
+Name[hi]=के-टेकà¥à¤¸à¥à¤Ÿ-à¤à¤¡à¤¿à¤Ÿà¤° इंकà¥à¤°à¥€à¤®à¥‡à¤‚टल सरà¥à¤š पà¥à¤²à¤—इन
+Name[hr]=KTextEditor dodatak za traženje u koracima
+Name[hsb]=KTextEditor Plugin za inkrementelne pytanje
+Name[hu]=KTextEditor inkrementális keresési bővítőmodul
+Name[id]=Plugin Pencarian Bertahap KTextEditor
+Name[is]=KTextEditor þrepaleitar-íforrit
+Name[it]=Plugin ricerca incrementale di KTextEditor
+Name[ja]=KTextEditor インクリメンタル検索プラグイン
+Name[ka]=ნáƒáƒ›áƒáƒ¢áƒ˜ ძიების KTextEditor მáƒáƒ“ული
+Name[kk]=KTextEditor инкременттік іздеу модулі
+Name[km]=កម្មវិធី​ជំនួយ​ážáž¶áž„​ក្នុង KTextEditor Incremental Search
+Name[lb]=Inkrementellen Sich-Plugin fir de KTextEditor
+Name[lt]=KTextEditor auganÄios paieÅ¡kos priedas
+Name[lv]=KTextEditor "meklē kamēr raksti" spraudnis
+Name[mk]=KTextEditor приклучок за инкрементално пребарување
+Name[mn]=ТекÑÑ‚ боловÑруулагчийн нÑмÑлт хайлтын плугин
+Name[ms]=Plug masuk Carian Meningkat KTextEditor
+Name[mt]=Plagin ta' KTextEditor għal tfittix inkrementali
+Name[nb]=Programtillegg for 'fortløpende søk' i KTextEditor
+Name[nds]=KTextEditor-Plugin för "Tast för Tast"-Söök
+Name[ne]=KTextEditor बढोतà¥à¤¤à¤°à¥€à¤¤ खोजी पà¥à¤²à¤—इन
+Name[nl]=KTextEditor-plugin voor incrementele zoekacties
+Name[nn]=Programtillegg for inkrementelt søk i skriveprogram
+Name[nso]=Tsenyo ya Nyako ya Koketso ya Mofetosi wa Sengwalwana sa K
+Name[pa]=KTextEditor ਲਗਾਤਾਰ ਖੋਜ ਪਲੱਗਿੰਨ
+Name[pl]=Wtyczka edytora do szukania przyrostowego
+Name[pt]='Plugin' de Procura Incremental do KTextEditor
+Name[pt_BR]=Plug-in de Busca Incremental para o Editor de textos
+Name[ro]=Modul de căutare incrementală pentru KTextEditor
+Name[ru]=Модуль поиÑка по набору KTextEditor
+Name[rw]=Icomeka Nyongeragaciro ryo Gushakisha rya KMuhinduziMwandiko
+Name[se]=KTextEditor lassáneaddji-ohcan lassemoduvla
+Name[sk]=Modul pre inkrementálne hľadanie KTextEditor
+Name[sl]=Vstavek KTextEditor za postopno iskanje
+Name[sq]=KTextEditor Shtojca: Kërkim përmes Numrimit
+Name[sr]=KTextEditor прикључак за инкрементално претраживање
+Name[sr@Latn]=KTextEditor prikljuÄak za inkrementalno pretraživanje
+Name[ss]=I-plugin yekusesha lokungetekako kwe KTextEditor
+Name[sv]=Ktexteditor-insticksprogram för inkrementell sökning
+Name[ta]=கேஉரை தொகà¯à®ªà¯à®ªà®¾à®³à®°à¯ படிபà¯à®ªà®Ÿà®¿à®¯à®¾à®© தேடற௠சொரà¯à®•à¯à®ªà¯à®ªà¯Šà®°à¯à®³à¯
+Name[te]=కెటెకà±à°¸à±à°Ÿà± ఎడిటరౠహెచà±à°šà°¿à°‚à°šà°¿ వెతà±à°•à±à°Ÿà°•à± à°ªà±à°²à°—à°¿à°¨à±
+Name[tg]=Пуркунандаи KTextEditor барои ҷуÑтуҷӯи афзоиш
+Name[th]=ปลัà¸à¸­à¸´à¸™à¸à¸²à¸£à¸„้นหาà¹à¸šà¸šà¸—บเพิ่มของ KTextEditor
+Name[tr]=KTextEditor Artımsal Arama Eklentisi
+Name[tt]=KTextEditor'nıñ Artıp Ezläw Quşılması
+Name[uk]=Втулок KTextEditor Ð´Ð»Ñ Ð¿Ð¾ÐºÑ€Ð¾ÐºÐ¾Ð²Ð¾Ð³Ð¾ пошуку
+Name[uz]=KTextEditor ketma-ket qidirish plagini
+Name[uz@cyrillic]=KTextEditor кетма-кет қидириш плагини
+Name[ven]=Pulagini yau toda yo engedzeaho ya musengulusi wa manwalwa a K
+Name[vi]=Bộ cầm phít Tìm kiếm Dần dần KTextEditor
+Name[xh]=KTextEditor Iplagi yangaphakathi Yokuphendla Ngokunyukayo
+Name[zh_CN]=KTextEditor 增é‡æœç´¢æ’件
+Name[zh_HK]=KTextEditor 漸進å¼æœå°‹å¤–掛程å¼
+Name[zh_TW]=KTextEditor 漸進å¼æœå°‹å¤–掛程å¼
+Name[zu]=I-Plugin Yosesho Lokwenyuka ngezigaba ze-KTextEditor
+Comment=Also known as "As you type search"
+Comment[af]=Ook bekend as "Soos jy tik soektog"
+Comment[be]=Ð”Ñ€ÑƒÐ³Ð°Ñ Ð½Ð°Ð·Ð²Ð° "пошук пры набіранні"
+Comment[bg]=ПоÑледователно Ñ‚ÑŠÑ€Ñене, извеÑтно още като Ñ‚ÑŠÑ€Ñене по време на въвеждане на низа
+Comment[bn]="টাইপ করাকালীন সনà§à¦§à¦¾à¦¨" হিসাবেও পরিচিত
+Comment[bs]=Takođe poznat kao "Pretraga dok kucate"
+Comment[ca]=També es coneix com a "Cerca en teclejar"
+Comment[cs]=Známý také "Hledání jak napíšete"
+Comment[csb]=Tzw. "szëkba òb czas pisaniô"
+Comment[da]=Også kendt som "Søg mens du skriver"
+Comment[de]=Suchvorgänge beim Tippen
+Comment[el]=Επίσης γνωστή και ως "Αναζήτηση κατά την πληκτÏολόγηση"
+Comment[eo]=Ankaŭ konata kiel "Dumtajpa serĉo"
+Comment[es]=También conocido como "Búsqueda mientras teclea"
+Comment[et]=Tuntud ka kui "otsimine vastavalt kirjutamisele"
+Comment[eu]="Idaztean bilatu" bezala ere ezaguna
+Comment[fa]=همچنین شناخته‌شده به عنوان »وقتی که جستجو را تحریر می‌کنید«
+Comment[fi]=Tunnetaan myös nimellä "Hae kun kirjoitat"
+Comment[fr]=Aussi connu comme « Recherche pendant la saisie »
+Comment[fy]=Ek bekend as"ûnder it typen sykje"
+Comment[ga]=Darbh ainm "Cuardach Beo" freisin
+Comment[gl]=Tamén coñecido como "Busca mentres escrebes"
+Comment[he]=ידוע ×’× ×‘×ª×•×¨ "חיפוש תוך כדי כתיבה"
+Comment[hi]=à¤à¤¸à¥‡ भी जाना जाता है "जैसे जैसे टाइप करते जाà¤à¤- ढूंढते जाà¤à¤"
+Comment[hr]=Poznat i kao "As you type search"
+Comment[hsb]=Tež znate jako "pytanje při zapodawanju"
+Comment[hu]=Más néven "Beírásos keresés"
+Comment[id]=Dikenal juga sebagai "Cari sembari mengetik"
+Comment[is]=Einnig þekkt sem "Leita meðan þú pikkar"
+Comment[it]=Noto anche come "Ricerca mentre scrivi"
+Comment[ja]=é€æ¬¡æ¤œç´¢ã¨ã‚‚ã„ã„ã¾ã™
+Comment[ka]=იგივეáƒ, რáƒáƒª ძიებრáƒáƒ™áƒ áƒ”ფის პრáƒáƒªáƒ”სში
+Comment[kk]=БаÑқаша "Теруге қарай іздеу" деп аталатын
+Comment[km]=​កáŸâ€‹ážŸáŸ’គាល់​ជា "ស្វែងរក áž–áŸáž›â€‹áž¢áŸ’នក​វាយ"
+Comment[lb]=Och bekannt als "Sichen, wärend dir antippt"
+Comment[lt]=Taip pat žinomas kaip „paieška spausdinimo metu“
+Comment[lv]=Meklē tekstu kamēr Jūs to rakstat
+Comment[mk]=Познато и како "пребарување додека куцате"
+Comment[ms]=Juga dikenali sebagai "Apabila nada taip cari"
+Comment[nb]=Også kjent som søk «etterhvert som du skriver»
+Comment[nds]=Direktemang bi't Tippen söken
+Comment[ne]="तपाईà¤à¤²à¥‡ खोजी टाइप गरे जसà¥à¤¤à¥ˆ" को रूपमा पनि चिनिनà¥à¤›
+Comment[nl]=Ook bekend als "Zoeken terwijl u typt"
+Comment[nn]=Òg kjend som søk «etter kvart som du skriv»
+Comment[pa]=ਇਸ ਤਰਾਂ ਵੀ ਜਾਣੋ ਕਿ "ਜਿਵੇਂ ਤà©à¨¸à©€à¨‚ ਖੋਜ ਲਿਖੀ"
+Comment[pl]=Tzw. "wyszukiwanie podczas pisania"
+Comment[pt]=Também conhecida como "Procura enquanto escreve"
+Comment[pt_BR]=Conhecido também como "Busca como você digitar"
+Comment[ro]=Căutare instantanee, pe măsură ce scrieţi modelul de text căutat
+Comment[ru]=ПоиÑк по набору Ñимволов
+Comment[rw]=Nanone bizwi nka "Nk'iyo wanditse ishakisha"
+Comment[se]=Maiddái dovddus «oza daÄ‘istaga go Äálát» namas.
+Comment[sk]=Známe aj ako "Hľadanie podľa napísaného textu"
+Comment[sl]=Znano tudi kot »Iskanje med tipkanjem«
+Comment[sr]=Познато и као „претрага док куцате“
+Comment[sr@Latn]=Poznato i kao „pretraga dok kucate“
+Comment[sv]=Också känt som "Sök medan du skriver"
+Comment[ta]="தேட௠எனà¯à®±à¯ தடà¯à®Ÿà®šà¯à®šà®¿à®Ÿà¯à®Ÿà®µà¯à®Ÿà®©à¯" எனà¯à®±à¯à®®à¯ அழைகà¯à®•à®ªà¯à®ªà®Ÿà¯à®®à¯
+Comment[te]="టైపౠచెసà±à°¤à±à°‚à°¡à°—à°¾ వెతà±à°•à±à°Ÿ "అని కూడా à°…à°‚à°¦à±à°°à±à°°à±
+Comment[tg]=Ҳамчун "ҶуÑтуҷӯи ҳарфчинӣ" машҳур аÑÑ‚
+Comment[th]=หรือรู้จัà¸à¸à¸±à¸™à¸­à¸µà¸à¸­à¸¢à¹ˆà¸²à¸‡à¸§à¹ˆà¸² "ค้นหาขณะพิมพ์"
+Comment[tr]=Ayrıca "Yazarken ararsın" olarak da bilinir
+Comment[tt]=Cıyılu belän beryulı ezli
+Comment[uk]=Також відомий Ñк "Пошук за вводом"
+Comment[vi]=Cũng được biết như là « Tìm kiếm trong khi gõ ».
+Comment[zh_CN]=也称为“å³è¾“å³æœâ€
+Comment[zh_TW]=也稱åšã€Œå³æ™‚æœå°‹ã€
+X-KDE-Library=ktexteditor_isearch
+ServiceTypes=KTextEditor/Plugin
+Type=Service
+InitialPreference=8
+MimeType=text/plain
diff --git a/kate/plugins/isearch/ktexteditor_isearchui.rc b/kate/plugins/isearch/ktexteditor_isearchui.rc
new file mode 100644
index 000000000..d8fc6b5dd
--- /dev/null
+++ b/kate/plugins/isearch/ktexteditor_isearchui.rc
@@ -0,0 +1,14 @@
+<!DOCTYPE kpartgui>
+<kpartplugin name="ktexteditor_isearch" library="ktexteditor_isearch" version="4">
+<MenuBar>
+ <Menu name="edit"><text>&amp;Edit</text>
+ <Action name="edit_isearch" group="edit_find_merge"/>
+ <Action name="edit_isearch_reverse" group="edit_find_merge"/>
+ </Menu>
+</MenuBar>
+<ToolBar name="isearchToolBar" hidden="true"><text>Search Toolbar</text>
+ <Action name="isearch_label"/>
+ <Action name="isearch_combo"/>
+ <Action name="isearch_options"/>
+</ToolBar>
+</kpartplugin>
diff --git a/kate/plugins/kdatatool/Makefile.am b/kate/plugins/kdatatool/Makefile.am
new file mode 100644
index 000000000..115391ada
--- /dev/null
+++ b/kate/plugins/kdatatool/Makefile.am
@@ -0,0 +1,19 @@
+INCLUDES = -I$(top_srcdir)/interfaces -I$(top_srcdir)/kdefx $(all_includes)
+METASOURCES = AUTO
+
+# Install this plugin in the KDE modules directory
+kde_module_LTLIBRARIES = ktexteditor_kdatatool.la
+
+ktexteditor_kdatatool_la_SOURCES = kate_kdatatool.cpp
+ktexteditor_kdatatool_la_LIBADD = $(top_builddir)/interfaces/ktexteditor/libktexteditor.la
+ktexteditor_kdatatool_la_LDFLAGS = -module $(KDE_PLUGIN) $(all_libraries)
+
+kdatatooldatadir = $(kde_datadir)/ktexteditor_kdatatool
+kdatatooldata_DATA = ktexteditor_kdatatoolui.rc
+
+kde_services_DATA = ktexteditor_kdatatool.desktop
+
+messages: rc.cpp
+ $(XGETTEXT) *.cpp *.h -o $(podir)/ktexteditor_kdatatool.pot
+
+
diff --git a/kate/plugins/kdatatool/kate_kdatatool.cpp b/kate/plugins/kdatatool/kate_kdatatool.cpp
new file mode 100644
index 000000000..3c63bcb4f
--- /dev/null
+++ b/kate/plugins/kdatatool/kate_kdatatool.cpp
@@ -0,0 +1,246 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2002 Joseph Wenninger <jowenn@jowenn.at> and Daniel Naber <daniel.naber@t-online.de>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+//BEGIN includes
+#include "kate_kdatatool.h"
+#include "kate_kdatatool.moc"
+#include <kgenericfactory.h>
+#include <kaction.h>
+#include <ktexteditor/view.h>
+#include <kdebug.h>
+#include <kdatatool.h>
+#include <ktexteditor/document.h>
+#include <ktexteditor/selectioninterface.h>
+#include <kpopupmenu.h>
+#include <ktexteditor/viewcursorinterface.h>
+#include <ktexteditor/editinterface.h>
+#include <kmessagebox.h>
+//END includes
+
+
+K_EXPORT_COMPONENT_FACTORY( ktexteditor_kdatatool, KGenericFactory<KTextEditor::KDataToolPlugin>( "ktexteditor_kdatatool" ) )
+
+namespace KTextEditor {
+
+KDataToolPlugin::KDataToolPlugin( QObject *parent, const char* name, const QStringList& )
+ : KTextEditor::Plugin ( (KTextEditor::Document*) parent, name )
+{
+}
+
+
+KDataToolPlugin::~KDataToolPlugin ()
+{
+}
+
+void KDataToolPlugin::addView(KTextEditor::View *view)
+{
+ KDataToolPluginView *nview = new KDataToolPluginView (view);
+ nview->setView (view);
+ m_views.append (nview);
+}
+
+void KDataToolPlugin::removeView(KTextEditor::View *view)
+{
+ for (uint z=0; z < m_views.count(); z++)
+ {
+ if (m_views.at(z)->parentClient() == view)
+ {
+ KDataToolPluginView *nview = m_views.at(z);
+ m_views.remove (nview);
+ delete nview;
+ }
+ }
+}
+
+
+KDataToolPluginView::KDataToolPluginView( KTextEditor::View *view )
+ :m_menu(0),m_notAvailable(0)
+{
+
+ view->insertChildClient (this);
+ setInstance( KGenericFactory<KDataToolPlugin>::instance() );
+
+ m_menu = new KActionMenu(i18n("Data Tools"), actionCollection(), "popup_dataTool");
+ connect(m_menu->popupMenu(), SIGNAL(aboutToShow()), this, SLOT(aboutToShow()));
+ setXMLFile("ktexteditor_kdatatoolui.rc");
+
+ m_view = view;
+}
+
+KDataToolPluginView::~KDataToolPluginView()
+{
+ m_view->removeChildClient (this);
+ delete m_menu;
+}
+
+void KDataToolPluginView::aboutToShow()
+{
+ kdDebug()<<"KTextEditor::KDataToolPluginView::aboutToShow"<<endl;
+ QString word;
+ m_singleWord = false;
+ m_wordUnderCursor = QString::null;
+
+ // unplug old actions, if any:
+ KAction *ac;
+ for ( ac = m_actionList.first(); ac; ac = m_actionList.next() ) {
+ m_menu->remove(ac);
+ }
+ if (m_notAvailable) {
+ m_menu->remove(m_notAvailable);
+ delete m_notAvailable;
+ m_notAvailable=0;
+ }
+ if ( selectionInterface(m_view->document())->hasSelection() )
+ {
+ word = selectionInterface(m_view->document())->selection();
+ if ( word.find(' ') == -1 && word.find('\t') == -1 && word.find('\n') == -1 )
+ m_singleWord = true;
+ else
+ m_singleWord = false;
+ } else {
+ // No selection -> use word under cursor
+ KTextEditor::EditInterface *ei;
+ KTextEditor::ViewCursorInterface *ci;
+ KTextEditor::View *v = (KTextEditor::View*)m_view;
+ ei = KTextEditor::editInterface(v->document());
+ ci = KTextEditor::viewCursorInterface(v);
+ uint line, col;
+ ci->cursorPositionReal(&line, &col);
+ QString tmp_line = ei->textLine(line);
+ m_wordUnderCursor = "";
+ // find begin of word:
+ m_singleWord_start = 0;
+ for(int i = col; i >= 0; i--) {
+ QChar ch = tmp_line.at(i);
+ if( ! (ch.isLetter() || ch == '-' || ch == '\'') )
+ {
+ m_singleWord_start = i+1;
+ break;
+ }
+ m_wordUnderCursor = ch + m_wordUnderCursor;
+ }
+ // find end of word:
+ m_singleWord_end = tmp_line.length();
+ for(uint i = col+1; i < tmp_line.length(); i++) {
+ QChar ch = tmp_line.at(i);
+ if( ! (ch.isLetter() || ch == '-' || ch == '\'') )
+ {
+ m_singleWord_end = i;
+ break;
+ }
+ m_wordUnderCursor += ch;
+ }
+ if( ! m_wordUnderCursor.isEmpty() )
+ {
+ m_singleWord = true;
+ m_singleWord_line = line;
+ } else {
+ m_notAvailable = new KAction(i18n("(not available)"), QString::null, 0, this,
+ SLOT(slotNotAvailable()), actionCollection(),"dt_n_av");
+ m_menu->insert(m_notAvailable);
+ return;
+ }
+ }
+
+ KInstance *inst=instance();
+
+ QValueList<KDataToolInfo> tools;
+ tools += KDataToolInfo::query( "QString", "text/plain", inst );
+ if( m_singleWord )
+ tools += KDataToolInfo::query( "QString", "application/x-singleword", inst );
+
+ m_actionList = KDataToolAction::dataToolActionList( tools, this,
+ SLOT( slotToolActivated( const KDataToolInfo &, const QString & ) ) );
+
+ for ( ac = m_actionList.first(); ac; ac = m_actionList.next() ) {
+ m_menu->insert(ac);
+ }
+
+ if( m_actionList.isEmpty() ) {
+ m_notAvailable = new KAction(i18n("(not available)"), QString::null, 0, this,
+ SLOT(slotNotAvailable()), actionCollection(),"dt_n_av");
+ m_menu->insert(m_notAvailable);
+ }
+}
+
+void KDataToolPluginView::slotNotAvailable()
+{
+ KMessageBox::sorry(0, i18n("Data tools are only available when text is selected, "
+ "or when the right mouse button is clicked over a word. If no data tools are offered "
+ "even when text is selected, you need to install them. Some data tools are part "
+ "of the KOffice package."));
+}
+
+void KDataToolPluginView::slotToolActivated( const KDataToolInfo &info, const QString &command )
+{
+
+ KDataTool* tool = info.createTool( );
+ if ( !tool )
+ {
+ kdWarning() << "Could not create Tool !" << endl;
+ return;
+ }
+
+ QString text;
+ if ( selectionInterface(m_view->document())->hasSelection() )
+ text = selectionInterface(m_view->document())->selection();
+ else
+ text = m_wordUnderCursor;
+
+ QString mimetype = "text/plain";
+ QString datatype = "QString";
+
+ // If unsupported (and if we have a single word indeed), try application/x-singleword
+ if ( !info.mimeTypes().contains( mimetype ) && m_singleWord )
+ mimetype = "application/x-singleword";
+
+ kdDebug() << "Running tool with datatype=" << datatype << " mimetype=" << mimetype << endl;
+
+ QString origText = text;
+
+ if ( tool->run( command, &text, datatype, mimetype) )
+ {
+ kdDebug() << "Tool ran. Text is now " << text << endl;
+ if ( origText != text )
+ {
+ uint line, col;
+ viewCursorInterface(m_view)->cursorPositionReal(&line, &col);
+ if ( ! selectionInterface(m_view->document())->hasSelection() )
+ {
+ KTextEditor::SelectionInterface *si;
+ si = KTextEditor::selectionInterface(m_view->document());
+ si->setSelection(m_singleWord_line, m_singleWord_start, m_singleWord_line, m_singleWord_end);
+ }
+
+ // replace selection with 'text'
+ selectionInterface(m_view->document())->removeSelectedText();
+ viewCursorInterface(m_view)->cursorPositionReal(&line, &col);
+ editInterface(m_view->document())->insertText(line, col, text);
+ // fixme: place cursor at the end:
+ /* No idea yet (Joseph Wenninger)
+ for ( uint i = 0; i < text.length(); i++ ) {
+ viewCursorInterface(m_view)->cursorRight();
+ } */
+ }
+ }
+
+ delete tool;
+}
+
+
+}
diff --git a/kate/plugins/kdatatool/kate_kdatatool.h b/kate/plugins/kdatatool/kate_kdatatool.h
new file mode 100644
index 000000000..bde5d70b2
--- /dev/null
+++ b/kate/plugins/kdatatool/kate_kdatatool.h
@@ -0,0 +1,76 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2002 Joseph Wenninger <jowenn@jowenn.at> and Daniel Naber <daniel.naber@t-online.de>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+// $Id$
+
+#ifndef _KATE_KDATATOOL_
+#define _KATE_KDATATOOL_
+
+#include <ktexteditor/plugin.h>
+#include <qstringlist.h>
+#include <kxmlguiclient.h>
+#include <qguardedptr.h>
+
+class KActionMenu;
+class KDataToolInfo;
+
+namespace KTextEditor
+{
+
+class View;
+
+class KDataToolPlugin : public KTextEditor::Plugin, public KTextEditor::PluginViewInterface
+{
+ Q_OBJECT
+
+public:
+ KDataToolPlugin( QObject *parent = 0, const char* name = 0, const QStringList &args = QStringList() );
+ virtual ~KDataToolPlugin();
+ void addView (KTextEditor::View *view);
+ void removeView (KTextEditor::View *view);
+
+ private:
+ QPtrList<class KDataToolPluginView> m_views;
+};
+
+
+class KDataToolPluginView : public QObject, public KXMLGUIClient
+{
+ Q_OBJECT
+
+public:
+ KDataToolPluginView( KTextEditor::View *view );
+ virtual ~KDataToolPluginView();
+ void setView( KTextEditor::View* ){;}
+private:
+ View *m_view;
+ bool m_singleWord;
+ int m_singleWord_line, m_singleWord_start, m_singleWord_end;
+ QString m_wordUnderCursor;
+ QPtrList<KAction> m_actionList;
+ QGuardedPtr<KActionMenu> m_menu;
+ KAction *m_notAvailable;
+protected slots:
+ void aboutToShow();
+ void slotToolActivated( const KDataToolInfo &datatoolinfo, const QString &string );
+ void slotNotAvailable();
+};
+
+}
+
+#endif
diff --git a/kate/plugins/kdatatool/ktexteditor_kdatatool.desktop b/kate/plugins/kdatatool/ktexteditor_kdatatool.desktop
new file mode 100644
index 000000000..66bb095d9
--- /dev/null
+++ b/kate/plugins/kdatatool/ktexteditor_kdatatool.desktop
@@ -0,0 +1,169 @@
+[Desktop Entry]
+Name=KTextEditor KDataTool Plugin
+Name[af]=KTextEditor KDataTool Inprop Module
+Name[ar]=ملحق KDataTool لـ KTextEditor
+Name[az]=KTextEditor KDataVasitÉ™si ÆlavÉ™si
+Name[be]=Модуль KDataTool
+Name[bn]=কে-টেকà§à¦¸à¦Ÿ-à¦à¦¡à¦¿à¦Ÿà¦° কে-ডেটা-টà§à¦² পà§à¦²à¦¾à¦—-ইন
+Name[br]=Lugent KTextEditor KDataTool
+Name[bs]=KTextEditor KDataTool dodatak
+Name[ca]=Connector KDataTool per al KTextEditor
+Name[cs]=Modul datového nástroje
+Name[csb]=Pligins editorë do òbsłużënkù pòdôwków
+Name[cy]=Ategyn KErfynData KGolyguTestun
+Name[da]=KTextEditor KDataTool-plugin
+Name[de]=KTextEditor-Erweiterung für KDataTool
+Name[el]=ΠÏόσθετο KTextEditor KDataTool
+Name[eo]=KTextEditor KDataTool Kromaĵo
+Name[es]=Plugin KDataTool de KTextEditor
+Name[et]=KTextEditori KDataTool plugin
+Name[eu]=KTextEditor-en KDataTool plugin-a
+Name[fa]=وصلۀ ابزار KTextEditor KData
+Name[fi]=KTextEditor KDataTool -lisäosa
+Name[fr]=Module externe KDataTool pour KTextEditor
+Name[fy]=KTextEditor-plugin foar KDatatool
+Name[ga]=Breiseán KDataTool do KTextEditor
+Name[gl]=Plugin KDataTool de KTextEditor
+Name[he]=תוסף כלי × ×ª×•× ×™× ×œÖ¾KTextEditor
+Name[hi]=के-टेकà¥à¤¸à¥à¤Ÿ-à¤à¤¡à¤¿à¤Ÿà¤° के-डाटा-टूल पà¥à¤²à¤—इन
+Name[hr]=KTextEditor dodatak za KDataTool
+Name[hu]=KTextEditor KDataTool bővítőmodul
+Name[id]=Plugin KDataTool untuk KTextEditor
+Name[is]=KTextEditor KDataTool íforrit
+Name[it]=Plugin KDataTool di KTextEditor
+Name[ja]=KTextEditor KDataTool プラグイン
+Name[ka]=მáƒáƒœáƒáƒªáƒ”მთრდáƒáƒ›áƒ£áƒ¨áƒáƒ•áƒ”ბის KTextEditor-ის მáƒáƒ“ული
+Name[kk]=KTextEditor KDataTool модулі
+Name[km]=កម្មវិធី​ជំនួយ​ážáž¶áž„​ក្នុង KDataTool KTextEditor
+Name[lb]=KTextEditor-KDataTool-Plugin
+Name[lt]=KTextEditor KDataTool priedas
+Name[lv]=KTextEditor KDataTool spraudnis
+Name[mk]=KTextEditor KDataTool приклучок
+Name[mn]=ТекÑÑ‚ боловÑруулагчийн өгөгдлийн Ñ…ÑÑ€ÑгÑлийн плугин
+Name[ms]=Plug masuk KDataTool KTextEditor
+Name[mt]=Name=Plagin ta' KTextEditor - KDataTool
+Name[nb]=KTextEditor KDataTool-programtillegg
+Name[nds]=KTextEditor-Plugin för KDataTool
+Name[ne]=KTextEditor KDataTool पà¥à¤²à¤—इन
+Name[nl]=KTextEditor-plugin voor KDatatool
+Name[nn]=KDataTool-programtillegg for skriveprogram
+Name[nso]=Tsenyo ya Sebereka sa Data ya K ya Mofetosi wa Sengwalwana sa K
+Name[pa]=KTextEditor KDataTool ਪਲੱਗਿੰਨ
+Name[pl]=Wtyczka edytora do obsługi danych
+Name[pt]='Plugin' do KDataTool do KTextEditor
+Name[pt_BR]=Plug-in de Ferramenta de Dados para o Editor de textos
+Name[ro]=Modul KDataTool pentru KTextEditor
+Name[ru]=Модуль обработки данных KTextEditor
+Name[rw]=Icyomeka ry'Igikoresho KIbyatanzwe rya KMuhinduziMwandiko
+Name[se]=KDataTool-lassemoduvla Äállinprográmmaid várás
+Name[sk]=Module KDataTool KTextEditor
+Name[sl]=Vstavek KTextEditor KDataTool
+Name[sq]=KTextEditor Shtojca: KDataTool
+Name[sr]=KTextEditor KDataTool прикључак
+Name[sr@Latn]=KTextEditor KDataTool prikljuÄak
+Name[ss]=I-plugin KDataTool ku KTextEditor
+Name[sv]=Ktexteditor-insticksprogram med dataverktyg
+Name[ta]=கேஉரைதொகà¯à®ªà¯à®ªà®¾à®³à®°à¯ கேதகவல௠கரà¯à®µà®¿ சொரà¯à®•à¯à®ªà¯à®ªà¯Šà®°à¯à®³à¯
+Name[te]=కెటెకà±à°¸à±à°Ÿà± ఎడిటరౠకెడాటాటూలౠపà±à°²à°—à°¿à°¨à±
+Name[tg]=Пуркунандаи KTextEditor барои таҳрири додаҳо
+Name[th]=ปลัà¸à¸­à¸´à¸™à¹€à¸„รื่องมือ KData ของ KTextEditor
+Name[tr]=KTextEditor KDataTool Eklentisi
+Name[tt]=KTextEditor'nıñ Eşkärtü Quşılması
+Name[uk]=Втулок KTextEditor KDataTool
+Name[uz]=KTextEditor KDataTool plagini
+Name[uz@cyrillic]=KTextEditor KDataTool плагини
+Name[ven]=Pulagini ya tshishumiswa tsha data ya K ya musengulusi wa manwalwa a K
+Name[vi]=Bộ cầm phít Công cụ KData KTextEditor
+Name[wa]=Tchôke-divins KDataTool po KTextEditor
+Name[xh]=KTextEditor KDataTool Iplagi yangaphakathi
+Name[zh_CN]=KTextEditor KDataTool æ’件
+Name[zh_HK]=KTextEditor KDataTool 外掛程å¼
+Name[zh_TW]=KTextEditor KDataTool 外排程å¼
+Name[zu]=I-Plugin ye-KDataTool ye-KTextEditor
+Comment=Enable data tools like thesaurus and spell check (if installed)
+Comment[af]=Aktiveer data nutsprogramme soos thesaurus en spel bevestig (as geïnstalleer)
+Comment[ar]=قم بتÙعيل أدوات البيانات مثل المترادÙات والتدقيق اﻹملائي (إذا كان منصبا)
+Comment[az]=Tezaurus və imla yoxlaması kimi data vasitələrini fəallaşdır (quruludursa)
+Comment[be]=ІнÑтрументы працы з даннÑмі: Ñ‚ÑзаўруÑ, Ñпраўджванне правапіÑу Ñ– інш. (калі Ñны ÑžÑтаноўленыÑ)
+Comment[bg]=Поддръжка на текÑтообработващи инÑтрументи, като проверка на правопиÑа и Ñинонимен речник
+Comment[bn]=থিসরার বা বানান পরীকà§à¦·à¦• ইতà§à¦¯à¦¾à¦¦à¦¿ সকà§à¦°à¦¿à§Ÿ করে (যদি পাওয়া যায়)
+Comment[bs]=UkljuÄi alate za podatke kao Å¡to su thesaurus i provjera pravopisa (ako su instalirani)
+Comment[ca]=Habilita les eines per a la gestió de dades, com ara el thesaurus i el corrector ortogràfic (si estan instal·lats)
+Comment[cs]=Povolí datové nástroje jako tezaurus nebo kontrolu pravopisu, pokud jsou nainstalovány
+Comment[csb]=Òbsłużënk nôrzãdzów ôrtu tezaurus ë sprôwdzanié pisënkù
+Comment[cy]=Alluogi offer data fel theawrws a cywirydd sillafu (os maent wedi'u gosod)
+Comment[da]=Aktivér dataværktøjer som begrebsordbog og stavekontrol (hvis installeret)
+Comment[de]=Aktivierung von Dienstprogrammen wie Thesaurus und Rechtschreibprüfung (falls installiert)
+Comment[el]=ΕνεÏγοποίηση εÏγαλείων δεδομένων όπως ο θησαυÏός λέξεων και ο οÏθογÏαφικός έλεγχος (αν είναι εγκατεστημένα)
+Comment[eo]=EnÅalti ilojn kiel samsignifilon kaj literumilon (se instalitaj)
+Comment[es]=Activa herramientas como el thesaurus y el corrector ortográfico (si instalados)
+Comment[et]=Andmete tööriistad, näiteks thesaurus ja õigekirja kontroll
+Comment[eu]=Gaitu thesaurus-a eta ortografia zuzentzailea bezalako tresnak (instalatua badaude)
+Comment[fa]=Ùعال‌سازی ابزارهای داده مانند واژه‌نامه Ùˆ غلط‌گیر (در صورت نصب)
+Comment[fi]=Käytä datatyökaluja, kuten oikolukua ja sanakirjaa (jos asennettuna)
+Comment[fr]=Activer les outils de données comme le thésaurus et la correction orthographique (s'ils sont installés)
+Comment[fy]=Aktivearjen fan dataprogramma's, lykas de tesaurus en stavering (wannear't dy ynstallearre binne)
+Comment[ga]=Cumasaigh uirlisí mar litreoir agus foclóir (má tá siad ar fáil)
+Comment[gl]=Habilitar ferramentas de dados como sinónimos e corrección ortográfica (se están instalados)
+Comment[he]=×פשר שימוש בכלי × ×ª×•× ×™× ×›×’×•×Ÿ ×יגרון ובדיקת ×יות (×× ×ž×•×ª×§× ×™× ×›×œ×™× ×›×לה)
+Comment[hi]= डाटा टूलà¥à¤¸ जैसे शबà¥à¤¦à¤•à¥‹à¤¶ व वरà¥à¤¤à¤¨à¥€ जांच को सकà¥à¤·à¤® करें(यदि सà¥à¤¥à¤¾à¤ªà¤¿à¤¤ हों)
+Comment[hr]=Omogućavanje alata poput tezaurusa i provjere pravopisa (ako su instalirani)
+Comment[hsb]=Staja graty kaž tezawrus abo prawopisnu kontrolu k dispoziciji (jeli instalowane)
+Comment[hu]=Adatkezelési eszközök (pl. szinonimaszótár, helyesírás-ellenőrző) támogatása
+Comment[id]=Aktifkan perangkat bantu data seperi thesaurus dan pemeriksa ejaan (bila terpasang)
+Comment[is]=Virkir gagnatól eins og stafsetningaforrit og leiðréttingar (ef uppsett)
+Comment[it]=Abilita gli strumenti per i dati come il dizionario dei sinonimi e il controllo ortografico (se installati)
+Comment[ja]=åŒç¾©èªžãƒ„ールやスペルãƒã‚§ãƒƒã‚¯ãªã©ã®ãƒ‡ãƒ¼ã‚¿ãƒ„ールを有効ã«ã—ã¾ã™ (インストールã•ã‚Œã¦ã„ã‚‹å ´åˆ)
+Comment[ka]=Warktüüch as Thesaurus oder Klookschriever anmaken (wenn op dien Reekner)
+Comment[kk]=Ð¢ÐµÑƒÐ·Ð°ÑƒÑ€ÑƒÑ Ð¿ÐµÐ½ емле текÑеру Ñекілді (егер орнатылған болÑа) деректерді өңдеу құралдарды пайдалануға мүмкіншілік береді
+Comment[km]=ធ្វើ​ឲ្យ​ឧបករណáŸâ€‹áž‘ិន្ននáŸáž™â€‹áž”្រើ​បាន ដូច​ជា​កម្រង​វáŸážœáž…នសព្ទ និង​ពិនិážáŸ’យ​អក្ážážšáž¶ážœáž·ážšáž»áž‘្ធ​ជា​ដើម (បើ​បាន​ដំឡើង)
+Comment[ko]=(깔려 있다면) 비슷한 ë§ ì‚¬ì „ê³¼ 맞춤법 검사기 ê°™ì€ ë„구를 ì”니다
+Comment[lb]=Hëllefsprogrammer, wéi Thésaurus an Rechtschreifkontroll, uschalten (wann installéiert)
+Comment[lt]=Įjungia duomenų įrankius, tokius kaip sinonimų žodynas ir rašybos tikrinimas (jei įdiegta)
+Comment[lv]=IeslÄ“dz instalÄ“tos datu rÄ«kus kÄ tÄ“zaurs un pareizrakstÄ«bas pÄrbaudÄ«tÄjs
+Comment[mk]=Овозможување на алатки како енциклопедија или проверка на Ð¿Ñ€Ð°Ð²Ð¾Ð¿Ð¸Ñ (ако Ñе инÑталирани)
+Comment[mn]=thesaurus and spell check (Ñ…ÑрвÑÑ ÑууÑан бол) гÑÑ… мÑÑ‚ өгөгдлийн Ñ…ÑÑ€ÑгÑлүүдийг нÑÑнÑ.
+Comment[ms]=Membolehkan alatan data seperti tesaurus dan periksa ejaan(jika dipasang)
+Comment[mt]=Ippermetti l-użu ta' għodda bħat-teżawru u spell check (jekk installati)
+Comment[nb]=Skru på dataverktøy som ordbok og stavekontroll (hvis det er installert)
+Comment[nds]=Warktüüch as Thesaurus oder Klookschriever anmaken (wenn installeert)
+Comment[ne]=परà¥à¤¯à¤¾à¤¯à¤•à¥‹à¤· र हिजà¥à¤œà¥‡ परीकà¥à¤·à¤£ जसà¥à¤¤à¥ˆ डेटा उपकरणहरू सकà¥à¤·à¤® पारà¥à¤¨à¥à¤¹à¥‹à¤¸à¥ (यदि सà¥à¤¥à¤¾à¤ªà¤¨à¤¾ भà¤à¤®à¤¾)
+Comment[nl]=Activering van hulpprogramma's, zoals de thesaurus en spellingcontrole (indien geïnstalleerd)
+Comment[nn]=Tilgang til dataverktøy som ordliste og stavekontroll
+Comment[nso]=Kgontsha dibereka tsa data goswana le thesaurus le tebelelo yamongwalo (ge di tsentswe)
+Comment[pa]=ਡਾਟਾ ਸੰਦ ਜਿਵੇਂ ਕਿ ਥੀਸਾਰਾਉਸ ਤੇ ਸ਼ਬਦ-ਜੋੜ ਆਦਿ ਯੋਗ(ਜੇਕਰ ਇੰਸਟਾਲ ਹੋਵੇ)
+Comment[pl]=Obsługa narzędzi typu tezaurus i sprawdzanie pisowni
+Comment[pt]=Activa as ferramentas de dados como os sinónimos e a verificação ortográfica (se estiverem instalados)
+Comment[pt_BR]=Habilita as ferramentas de dados, como o Thesaurus e a verificação ortográfica (se instalados)
+Comment[ro]=Activează utilitare de date precum dicţionarul şi verificarea ortografică (dacă sînt instalate)
+Comment[ru]=позволÑет иÑпользовать утилиты ÑÐ»Ð¾Ð²Ð°Ñ€Ñ Ð¸ проверки орфографии (еÑли они уÑтановлены)
+Comment[rw]=Gushoboza ibikoresho by'ibyatanzwe nk'impuzansobanuro n'igenzuranyuguti (niba byarakorewe iyinjizaporogaramu)
+Comment[se]=Geavat diehtoreaidduid nugo synonymasátnelisttu ja Äállindárkkisteami (jos leat sajáiduhttojuvvon)
+Comment[sk]=Podpora dátových nástrojov, ako je thesaurus a kontrola pravopisu (ak sú nainštalované)
+Comment[sl]=OmogoÄi orodja za podatke, kot so slovar sopomenk in preverjanje Ärkovanja (Äe je nameÅ¡Äen)
+Comment[sq]=Lejo veglat për të dhënat sikurse fjalori i sinonimeve dhe korigjuesi i fjalëve (nëse janë të instaluara)
+Comment[sr]=Укључије алате као што Ñу ризница и провера правопиÑа (ако Ñу инÑталирани)
+Comment[sr@Latn]=UkljuÄije alate kao Å¡to su riznica i provera pravopisa (ako su instalirani)
+Comment[sv]=Aktivera dataverktyg som synonymordlista och stavningskontroll (om installerade)
+Comment[ta]=அகராதி, எழà¯à®¤à¯à®¤à¯à®ªà¯à®ªà®¿à®´à¯ˆ திரà¯à®¤à¯à®¤à®¿ போனà¯à®± தகவல௠கரà¯à®µà®¿à®•à®³à¯ˆ இயகà¯à®•à¯à®®à¯ (நிறà¯à®µà®ªà¯à®ªà®Ÿà¯à®Ÿà®¿à®°à¯à®¨à¯à®¤à®¾à®²à¯)
+Comment[te]=పదకోశం మరయూ à°…à°•à±à°·à°° తపà±à°ªà±à°²à°¨à± పటà±à°Ÿà±à°•à±Šà°¨à± పనిమà±à°Ÿà±à°²à°¨à± ఉపయోగించౠ(ఇంసà±à°Ÿà°¾à°²à± చేసిన పనిచేయà±à°¨à±)
+Comment[tg]=Иҷозаи иÑтифодаи утилитаи луғат ва тафтиши имлоро (агар онҳо Ñабт карда шуда бошанд) медиҳад
+Comment[th]=เปิดใช้งานเครื่องมือจัดà¸à¸²à¸£à¸‚้อมูลอย่างเช่น พจนานุà¸à¸£à¸¡à¸„ำคล้าย หรือ ตรวจคำสะà¸à¸” (ถ้าได้ติดตั้งไว้)
+Comment[tr]=Thesaurus ve imla denetimi gibi araçları etkinleştir
+Comment[tt]=Süznämä belän imla tikşerü kebek qorallar eşlätä (quyılğan bulsalar)
+Comment[uk]=Ðадає доÑтуп до заÑобів на кшталт Ñловників та перевірки правопиÑу (Ñкщо вÑтановлені)
+Comment[uz]=Lugʻat va imloni tekshirish vositalarni yoqish (agar oʻrnatilgan boʻlsa)
+Comment[uz@cyrillic]=Луғат ва имлони текшириш воÑиталарни ёқиш (агар ўрнатилган бўлÑа)
+Comment[ven]=U konisa zwishumiswa zwa data sa bugu nau sedza ha tshipelini (arali zwo dzheniswa)
+Comment[vi]=Hiệu lực công cụ dữ liệu như từ điển đồng nghĩa và bộ bắt lỗi chính tả (nếu được cài đặt).
+Comment[wa]=Mete en alaedje les usteyes po manaedjî les dnêyes, come les diccionaires ou les coridjreces (si astalés)
+Comment[xh]=Yenza izixhobo ze data ezinjenge thesaurus nomkhangeli wopelo (ukuba ifakelwe)
+Comment[zh_CN]=å¯ç”¨åƒè¾žå…¸(thesaurus)和拼写检查(spell check)这样的数æ®å·¥å…·(如果安装了的è¯)
+Comment[zh_HK]=如果有安è£çš„話,啟用åƒåŒç¾©å­—字典和拼字檢查等的文字工具
+Comment[zh_TW]=打開資料工具如åŒç¾©å­—典與拼字檢查 (如果有安è£çš„話)
+Comment[zu]=Nika amandla amathuluzi edata anjenge thesaurus kanye nokubheka ukubhalwa kwamagama (uma kufakiwe)
+X-KDE-Library=ktexteditor_kdatatool
+ServiceTypes=KTextEditor/Plugin
+Type=Service
+InitialPreference=8
+MimeType=text/plain
diff --git a/kate/plugins/kdatatool/ktexteditor_kdatatoolui.rc b/kate/plugins/kdatatool/ktexteditor_kdatatoolui.rc
new file mode 100644
index 000000000..b98806200
--- /dev/null
+++ b/kate/plugins/kdatatool/ktexteditor_kdatatoolui.rc
@@ -0,0 +1,8 @@
+<!DOCTYPE kpartgui>
+<kpartplugin name="ktexteditor_kdatatoolui" library="ktexteditor_kdatatool" version="2">
+
+<Menu name="ktexteditor_popup" noMerge="1">
+ <Action name="popup_dataTool" group="popup_operations"/>
+</Menu>
+
+</kpartplugin>
diff --git a/kate/plugins/wordcompletion/Makefile.am b/kate/plugins/wordcompletion/Makefile.am
new file mode 100644
index 000000000..5bddb895e
--- /dev/null
+++ b/kate/plugins/wordcompletion/Makefile.am
@@ -0,0 +1,17 @@
+INCLUDES = -I$(top_srcdir)/interfaces $(all_includes)
+METASOURCES = AUTO
+
+# Install this plugin in the KDE modules directory
+kde_module_LTLIBRARIES = ktexteditor_docwordcompletion.la
+
+ktexteditor_docwordcompletion_la_SOURCES = docwordcompletion.cpp
+ktexteditor_docwordcompletion_la_LIBADD = $(top_builddir)/interfaces/ktexteditor/libktexteditor.la
+ktexteditor_docwordcompletion_la_LDFLAGS = -module $(KDE_PLUGIN) $(all_libraries)
+
+docwordcompletiondatadir = $(kde_datadir)/ktexteditor_docwordcompletion
+docwordcompletiondata_DATA = docwordcompletionui.rc
+
+kde_services_DATA = ktexteditor_docwordcompletion.desktop
+
+messages: rc.cpp
+ $(XGETTEXT) *.cpp *.h -o $(podir)/ktexteditor_docwordcompletion.pot
diff --git a/kate/plugins/wordcompletion/docwordcompletion.cpp b/kate/plugins/wordcompletion/docwordcompletion.cpp
new file mode 100644
index 000000000..9fb7f4844
--- /dev/null
+++ b/kate/plugins/wordcompletion/docwordcompletion.cpp
@@ -0,0 +1,554 @@
+/*
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+
+ ---
+ file: docwordcompletion.cpp
+
+ KTextEditor plugin to autocompletion with document words.
+ Copyright Anders Lund <anders.lund@lund.tdcadsl.dk>, 2003
+
+ The following completion methods are supported:
+ * Completion with bigger matching words in
+ either direction (backward/forward).
+ * NOT YET Pop up a list of all bigger matching words in document
+
+*/
+//BEGIN includes
+#include "docwordcompletion.h"
+
+#include <ktexteditor/document.h>
+#include <ktexteditor/viewcursorinterface.h>
+#include <ktexteditor/editinterface.h>
+#include <ktexteditor/variableinterface.h>
+
+#include <kapplication.h>
+#include <kconfig.h>
+#include <kdialog.h>
+#include <kgenericfactory.h>
+#include <klocale.h>
+#include <kaction.h>
+#include <knotifyclient.h>
+#include <kparts/part.h>
+#include <kiconloader.h>
+
+#include <qregexp.h>
+#include <qstring.h>
+#include <qdict.h>
+#include <qspinbox.h>
+#include <qlabel.h>
+#include <qlayout.h>
+#include <qhbox.h>
+#include <qwhatsthis.h>
+#include <qcheckbox.h>
+
+// #include <kdebug.h>
+//END
+
+//BEGIN DocWordCompletionPlugin
+K_EXPORT_COMPONENT_FACTORY( ktexteditor_docwordcompletion, KGenericFactory<DocWordCompletionPlugin>( "ktexteditor_docwordcompletion" ) )
+DocWordCompletionPlugin::DocWordCompletionPlugin( QObject *parent,
+ const char* name,
+ const QStringList& /*args*/ )
+ : KTextEditor::Plugin ( (KTextEditor::Document*) parent, name )
+{
+ readConfig();
+}
+
+void DocWordCompletionPlugin::readConfig()
+{
+ KConfig *config = kapp->config();
+ config->setGroup( "DocWordCompletion Plugin" );
+ m_treshold = config->readNumEntry( "treshold", 3 );
+ m_autopopup = config->readBoolEntry( "autopopup", true );
+}
+
+void DocWordCompletionPlugin::writeConfig()
+{
+ KConfig *config = kapp->config();
+ config->setGroup("DocWordCompletion Plugin");
+ config->writeEntry("autopopup", m_autopopup );
+ config->writeEntry("treshold", m_treshold );
+}
+
+void DocWordCompletionPlugin::addView(KTextEditor::View *view)
+{
+ DocWordCompletionPluginView *nview = new DocWordCompletionPluginView (m_treshold, m_autopopup, view, "Document word completion");
+ m_views.append (nview);
+}
+
+void DocWordCompletionPlugin::removeView(KTextEditor::View *view)
+{
+ for (uint z=0; z < m_views.count(); z++)
+ if (m_views.at(z)->parentClient() == view)
+ {
+ DocWordCompletionPluginView *nview = m_views.at(z);
+ m_views.remove (nview);
+ delete nview;
+ }
+}
+
+KTextEditor::ConfigPage* DocWordCompletionPlugin::configPage( uint, QWidget *parent, const char *name )
+{
+ return new DocWordCompletionConfigPage( this, parent, name );
+}
+
+QString DocWordCompletionPlugin::configPageName( uint ) const
+{
+ return i18n("Word Completion Plugin");
+}
+
+QString DocWordCompletionPlugin::configPageFullName( uint ) const
+{
+ return i18n("Configure the Word Completion Plugin");
+}
+
+// FIXME provide sucn a icon
+ QPixmap DocWordCompletionPlugin::configPagePixmap( uint, int size ) const
+{
+ return UserIcon( "kte_wordcompletion", size );
+}
+//END
+
+//BEGIN DocWordCompletionPluginView
+struct DocWordCompletionPluginViewPrivate
+{
+ uint line, col; // start position of last match (where to search from)
+ uint cline, ccol; // cursor position
+ uint lilen; // length of last insertion
+ QString last; // last word we were trying to match
+ QString lastIns; // latest applied completion
+ QRegExp re; // hrm
+ KToggleAction *autopopup; // for accessing state
+ uint treshold; // the required length of a word before popping up the completion list automatically
+ int directionalPos; // be able to insert "" at the correct time
+};
+
+DocWordCompletionPluginView::DocWordCompletionPluginView( uint treshold, bool autopopup, KTextEditor::View *view, const char *name )
+ : QObject( view, name ),
+ KXMLGUIClient( view ),
+ m_view( view ),
+ d( new DocWordCompletionPluginViewPrivate )
+{
+ d->treshold = treshold;
+ view->insertChildClient( this );
+ setInstance( KGenericFactory<DocWordCompletionPlugin>::instance() );
+
+ (void) new KAction( i18n("Reuse Word Above"), CTRL+Key_8, this,
+ SLOT(completeBackwards()), actionCollection(), "doccomplete_bw" );
+ (void) new KAction( i18n("Reuse Word Below"), CTRL+Key_9, this,
+ SLOT(completeForwards()), actionCollection(), "doccomplete_fw" );
+ (void) new KAction( i18n("Pop Up Completion List"), 0, this,
+ SLOT(popupCompletionList()), actionCollection(), "doccomplete_pu" );
+ (void) new KAction( i18n("Shell Completion"), 0, this,
+ SLOT(shellComplete()), actionCollection(), "doccomplete_sh" );
+ d->autopopup = new KToggleAction( i18n("Automatic Completion Popup"), 0, this,
+ SLOT(toggleAutoPopup()), actionCollection(), "enable_autopopup" );
+
+ d->autopopup->setChecked( autopopup );
+ toggleAutoPopup();
+
+ setXMLFile("docwordcompletionui.rc");
+
+ KTextEditor::VariableInterface *vi = KTextEditor::variableInterface( view->document() );
+ if ( vi )
+ {
+ QString e = vi->variable("wordcompletion-autopopup");
+ if ( ! e.isEmpty() )
+ d->autopopup->setEnabled( e == "true" );
+
+ connect( view->document(), SIGNAL(variableChanged(const QString &, const QString &)),
+ this, SLOT(slotVariableChanged(const QString &, const QString &)) );
+ }
+}
+
+void DocWordCompletionPluginView::settreshold( uint t )
+{
+ d->treshold = t;
+}
+
+void DocWordCompletionPluginView::completeBackwards()
+{
+ complete( false );
+}
+
+void DocWordCompletionPluginView::completeForwards()
+{
+ complete();
+}
+
+// Pop up the editors completion list if applicable
+void DocWordCompletionPluginView::popupCompletionList( QString w )
+{
+ if ( w.isEmpty() )
+ w = word();
+ if ( w.isEmpty() )
+ return;
+
+ KTextEditor::CodeCompletionInterface *cci = codeCompletionInterface( m_view );
+ cci->showCompletionBox( allMatches( w ), w.length() );
+}
+
+void DocWordCompletionPluginView::toggleAutoPopup()
+{
+ if ( d->autopopup->isChecked() ) {
+ if ( ! connect( m_view->document(), SIGNAL(charactersInteractivelyInserted(int ,int ,const QString&)),
+ this, SLOT(autoPopupCompletionList()) ))
+ {
+ connect( m_view->document(), SIGNAL(textChanged()), this, SLOT(autoPopupCompletionList()) );
+ }
+ } else {
+ disconnect( m_view->document(), SIGNAL(textChanged()), this, SLOT(autoPopupCompletionList()) );
+ disconnect( m_view->document(), SIGNAL(charactersInteractivelyInserted(int ,int ,const QString&)),
+ this, SLOT(autoPopupCompletionList()) );
+
+ }
+}
+
+// for autopopup FIXME - don't pop up if reuse word is inserting
+void DocWordCompletionPluginView::autoPopupCompletionList()
+{
+ if ( ! m_view->hasFocus() ) return;
+ QString w = word();
+ if ( w.length() >= d->treshold )
+ {
+ popupCompletionList( w );
+ }
+}
+
+// Contributed by <brain@hdsnet.hu>
+void DocWordCompletionPluginView::shellComplete()
+{
+ // setup
+ KTextEditor::EditInterface * ei = KTextEditor::editInterface(m_view->document());
+ // find the word we are typing
+ uint cline, ccol;
+ viewCursorInterface(m_view)->cursorPositionReal(&cline, &ccol);
+ QString wrd = word();
+ if (wrd.isEmpty())
+ return;
+
+ QValueList < KTextEditor::CompletionEntry > matches = allMatches(wrd);
+ if (matches.size() == 0)
+ return;
+ QString partial = findLongestUnique(matches);
+ if (partial.length() == wrd.length())
+ {
+ KTextEditor::CodeCompletionInterface * cci = codeCompletionInterface(m_view);
+ cci->showCompletionBox(matches, wrd.length());
+ }
+ else
+ {
+ partial.remove(0, wrd.length());
+ ei->insertText(cline, ccol, partial);
+ }
+}
+
+// Do one completion, searching in the desired direction,
+// if possible
+void DocWordCompletionPluginView::complete( bool fw )
+{
+ // setup
+ KTextEditor::EditInterface *ei = KTextEditor::editInterface( m_view->document() );
+ // find the word we are typing
+ uint cline, ccol;
+ viewCursorInterface( m_view )->cursorPositionReal( &cline, &ccol );
+ QString wrd = word();
+ if ( wrd.isEmpty() )
+ return;
+
+ int inc = fw ? 1 : -1;
+
+ /* IF the current line is equal to the previous line
+ AND the position - the length of the last inserted string
+ is equal to the old position
+ AND the lastinsertedlength last characters of the word is
+ equal to the last inserted string
+ */
+ if ( cline == d-> cline &&
+ ccol - d->lilen == d->ccol &&
+ wrd.endsWith( d->lastIns ) )
+ {
+ // this is a repeted activation
+
+ // if we are back to where we started, reset.
+ if ( ( fw && d->directionalPos == -1 ) ||
+ ( !fw && d->directionalPos == 1 ) )
+ {
+ if ( d->lilen )
+ ei->removeText( d->cline, d->ccol, d->cline, d->ccol + d->lilen );
+
+ d->lastIns = "";
+ d->lilen = 0;
+ d->line = d->cline;
+ d->col = d->ccol;
+ d->directionalPos = 0;
+
+ return;
+ }
+
+ if ( fw )
+ d->col += d->lilen;
+
+ ccol = d->ccol;
+ wrd = d->last;
+
+ d->directionalPos += inc;
+ }
+ else
+ {
+ d->cline = cline;
+ d->ccol = ccol;
+ d->last = wrd;
+ d->lastIns = "";
+ d->line = cline;
+ d->col = ccol - wrd.length();
+ d->lilen = 0;
+ d->directionalPos = inc;
+ }
+
+ d->re.setPattern( "\\b" + wrd + "(\\w+)" );
+ int pos ( 0 );
+ QString ln = ei->textLine( d->line );
+
+ while ( true )
+ {
+ pos = fw ?
+ d->re.search( ln, d->col ) :
+ d->re.searchRev( ln, d->col );
+
+ if ( pos > -1 ) // we matched a word
+ {
+ QString m = d->re.cap( 1 );
+ if ( m != d->lastIns )
+ {
+ // we got good a match! replace text and return.
+ if ( d->lilen )
+ ei->removeText( d->cline, d->ccol, d->cline, d->ccol + d->lilen );
+ ei->insertText( d->cline, d->ccol, m );
+
+ d->lastIns = m;
+ d->lilen = m.length();
+ d->col = pos; // for next try
+
+ return;
+ }
+
+ // equal to last one, continue
+ else
+ {
+ d->col = pos; // for next try
+
+ if ( fw )
+ d->col += d->re.matchedLength();
+
+ else
+ {
+ if ( pos == 0 )
+ {
+ if ( d->line > 0 )
+ {
+ d->line += inc;
+ ln = ei->textLine( d->line );
+ d->col = ln.length();
+ }
+ else
+ {
+ KNotifyClient::beep();
+ return;
+ }
+ }
+
+ else
+ d->col--;
+ }
+ }
+ }
+
+ else // no match
+ {
+ if ( (! fw && d->line == 0 ) || ( fw && d->line >= (uint)ei->numLines() ) )
+ {
+ KNotifyClient::beep();
+ return;
+ }
+
+ d->line += inc;
+
+ ln = ei->textLine( d->line );
+ d->col = fw ? 0 : ln.length();
+ }
+ } // while true
+}
+
+// Contributed by <brain@hdsnet.hu>
+QString DocWordCompletionPluginView::findLongestUnique(const QValueList < KTextEditor::CompletionEntry > &matches)
+{
+ QString partial = matches.front().text;
+ QValueList < KTextEditor::CompletionEntry >::const_iterator i = matches.begin();
+ for (++i; i != matches.end(); ++i)
+ {
+ if (!(*i).text.startsWith(partial))
+ {
+ while(partial.length() > 0)
+ {
+ partial.remove(partial.length() - 1, 1);
+ if ((*i).text.startsWith(partial))
+ {
+ break;
+ }
+ }
+ if (partial.length() == 0)
+ return QString();
+ }
+ }
+
+ return partial;
+}
+
+// Return the string to complete (the letters behind the cursor)
+QString DocWordCompletionPluginView::word()
+{
+ uint cline, ccol;
+ viewCursorInterface( m_view )->cursorPositionReal( &cline, &ccol );
+ if ( ! ccol ) return QString::null; // no word
+ KTextEditor::EditInterface *ei = KTextEditor::editInterface( m_view->document() );
+ d->re.setPattern( "\\b(\\w+)$" );
+ if ( d->re.searchRev(
+ ei->text( cline, 0, cline, ccol )
+ ) < 0 )
+ return QString::null; // no word
+ return d->re.cap( 1 );
+}
+
+// Scan throught the entire document for possible completions,
+// ignoring any dublets
+QValueList<KTextEditor::CompletionEntry> DocWordCompletionPluginView::allMatches( const QString &word )
+{
+ QValueList<KTextEditor::CompletionEntry> l;
+ uint i( 0 );
+ int pos( 0 );
+ d->re.setPattern( "\\b("+word+"\\w+)" );
+ QString s, m;
+ KTextEditor::EditInterface *ei = KTextEditor::editInterface( m_view->document() );
+ QDict<int> seen; // maybe slow with > 17 matches
+ int sawit(1); // to ref for the dict
+ uint cline, ccol;// needed to avoid constructing a word at cursor position
+ viewCursorInterface( m_view )->cursorPositionReal( &cline, &ccol );
+
+ while( i < ei->numLines() )
+ {
+ s = ei->textLine( i );
+ pos = 0;
+ while ( pos >= 0 )
+ {
+ pos = d->re.search( s, pos );
+ if ( pos >= 0 )
+ {
+ // do not construct a new word!
+ if ( i == cline && pos + word.length() == ccol )
+ {
+ pos += word.length();
+ continue;
+ }
+
+ m = d->re.cap( 1 );
+ if ( ! seen[ m ] ) {
+ seen.insert( m, &sawit );
+ KTextEditor::CompletionEntry e;
+ e.text = m;
+ l.append( e );
+ }
+ pos += d->re.matchedLength();
+ }
+ }
+ i++;
+ }
+ return l;
+}
+
+void DocWordCompletionPluginView::slotVariableChanged( const QString &var, const QString &val )
+{
+ if ( var == "wordcompletion-autopopup" )
+ d->autopopup->setEnabled( val == "true" );
+ else if ( var == "wordcompletion-treshold" )
+ d->treshold = val.toInt();
+}
+//END
+
+//BEGIN DocWordCompletionConfigPage
+DocWordCompletionConfigPage::DocWordCompletionConfigPage( DocWordCompletionPlugin *completion, QWidget *parent, const char *name )
+ : KTextEditor::ConfigPage( parent, name )
+ , m_completion( completion )
+{
+ QVBoxLayout *lo = new QVBoxLayout( this );
+ lo->setSpacing( KDialog::spacingHint() );
+
+ cbAutoPopup = new QCheckBox( i18n("Automatically &show completion list"), this );
+ lo->addWidget( cbAutoPopup );
+
+ QHBox *hb = new QHBox( this );
+ hb->setSpacing( KDialog::spacingHint() );
+ lo->addWidget( hb );
+ QLabel *l = new QLabel( i18n(
+ "Translators: This is the first part of two strings wich will comprise the "
+ "sentence 'Show completions when a word is at least N characters'. The first "
+ "part is on the right side of the N, which is represented by a spinbox "
+ "widget, followed by the second part: 'characters long'. Characters is a "
+ "ingeger number between and including 1 and 30. Feel free to leave the "
+ "second part of the sentence blank if it suits your language better. ",
+ "Show completions &when a word is at least"), hb );
+ sbAutoPopup = new QSpinBox( 1, 30, 1, hb );
+ l->setBuddy( sbAutoPopup );
+ lSbRight = new QLabel( i18n(
+ "This is the second part of two strings that will comprise teh sentence "
+ "'Show completions when a word is at least N characters'",
+ "characters long."), hb );
+
+ QWhatsThis::add( cbAutoPopup, i18n(
+ "Enable the automatic completion list popup as default. The popup can "
+ "be disabled on a view basis from the 'Tools' menu.") );
+ QWhatsThis::add( sbAutoPopup, i18n(
+ "Define the length a word should have before the completion list "
+ "is displayed.") );
+
+ cbAutoPopup->setChecked( m_completion->autoPopupEnabled() );
+ sbAutoPopup->setValue( m_completion->treshold() );
+
+ lo->addStretch();
+}
+
+void DocWordCompletionConfigPage::apply()
+{
+ m_completion->setAutoPopupEnabled( cbAutoPopup->isChecked() );
+ m_completion->setTreshold( sbAutoPopup->value() );
+ m_completion->writeConfig();
+}
+
+void DocWordCompletionConfigPage::reset()
+{
+ cbAutoPopup->setChecked( m_completion->autoPopupEnabled() );
+ sbAutoPopup->setValue( m_completion->treshold() );
+}
+
+void DocWordCompletionConfigPage::defaults()
+{
+ cbAutoPopup->setChecked( true );
+ sbAutoPopup->setValue( 3 );
+}
+
+//END DocWordCompletionConfigPage
+
+#include "docwordcompletion.moc"
+// kate: space-indent on; indent-width 2; replace-tabs on; mixed-indent off;
diff --git a/kate/plugins/wordcompletion/docwordcompletion.h b/kate/plugins/wordcompletion/docwordcompletion.h
new file mode 100644
index 000000000..b42560fca
--- /dev/null
+++ b/kate/plugins/wordcompletion/docwordcompletion.h
@@ -0,0 +1,133 @@
+/*
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+
+ ---
+ file: docwordcompletion.h
+
+ KTextEditor plugin to autocompletion with document words.
+ Copyright Anders Lund <anders.lund@lund.tdcadsl.dk>, 2003
+
+ The following completion methods are supported:
+ * Completion with bigger matching words in
+ either direction (backward/forward).
+ * NOT YET Pop up a list of all bigger matching words in document
+
+*/
+
+#ifndef _DocWordCompletionPlugin_h_
+#define _DocWordCompletionPlugin_h_
+
+#include <ktexteditor/plugin.h>
+#include <ktexteditor/view.h>
+#include <ktexteditor/codecompletioninterface.h>
+#include <ktexteditor/configinterfaceextension.h>
+#include <kxmlguiclient.h>
+
+#include <qevent.h>
+#include <qobject.h>
+#include <qvaluelist.h>
+
+class DocWordCompletionPlugin
+ : public KTextEditor::Plugin
+ , public KTextEditor::PluginViewInterface
+ , public KTextEditor::ConfigInterfaceExtension
+{
+ Q_OBJECT
+
+ public:
+ DocWordCompletionPlugin( QObject *parent = 0,
+ const char* name = 0,
+ const QStringList &args = QStringList() );
+ virtual ~DocWordCompletionPlugin() {};
+
+ void addView (KTextEditor::View *view);
+ void removeView (KTextEditor::View *view);
+
+ void readConfig();
+ void writeConfig();
+
+ // ConfigInterfaceExtention
+ uint configPages() const { return 1; };
+ KTextEditor::ConfigPage * configPage( uint number, QWidget *parent, const char *name );
+ QString configPageName( uint ) const;
+ QString configPageFullName( uint ) const;
+ QPixmap configPagePixmap( uint, int ) const;
+
+ uint treshold() const { return m_treshold; };
+ void setTreshold( uint t ) { m_treshold = t; };
+ bool autoPopupEnabled() const { return m_autopopup; };
+ void setAutoPopupEnabled( bool enable ) { m_autopopup = enable; };
+
+
+ private:
+ QPtrList<class DocWordCompletionPluginView> m_views;
+ uint m_treshold;
+ bool m_autopopup;
+
+};
+
+class DocWordCompletionPluginView
+ : public QObject, public KXMLGUIClient
+{
+ Q_OBJECT
+
+ public:
+ DocWordCompletionPluginView( uint treshold=3, bool autopopup=true, KTextEditor::View *view=0,
+ const char *name=0 );
+ ~DocWordCompletionPluginView() {};
+
+ void settreshold( uint treshold );
+
+ private slots:
+ void completeBackwards();
+ void completeForwards();
+ void shellComplete();
+
+ void popupCompletionList( QString word=QString::null );
+ void autoPopupCompletionList();
+ void toggleAutoPopup();
+
+ void slotVariableChanged( const QString &, const QString & );
+
+ private:
+ void complete( bool fw=true );
+
+ QString word();
+ QValueList<KTextEditor::CompletionEntry> allMatches( const QString &word );
+ QString findLongestUnique(const QValueList < KTextEditor::CompletionEntry > &matches);
+ KTextEditor::View *m_view;
+ struct DocWordCompletionPluginViewPrivate *d;
+};
+
+class DocWordCompletionConfigPage : public KTextEditor::ConfigPage
+{
+ Q_OBJECT
+ public:
+ DocWordCompletionConfigPage( DocWordCompletionPlugin *completion, QWidget *parent, const char *name );
+ virtual ~DocWordCompletionConfigPage() {};
+
+ virtual void apply();
+ virtual void reset();
+ virtual void defaults();
+
+ private:
+ DocWordCompletionPlugin *m_completion;
+ class QCheckBox *cbAutoPopup;
+ class QSpinBox *sbAutoPopup;
+ class QLabel *lSbRight;
+};
+
+#endif // _DocWordCompletionPlugin_h_
+// kate: space-indent on; indent-width 2; replace-tabs on; mixed-indent off;
diff --git a/kate/plugins/wordcompletion/docwordcompletionui.rc b/kate/plugins/wordcompletion/docwordcompletionui.rc
new file mode 100644
index 000000000..f8095e128
--- /dev/null
+++ b/kate/plugins/wordcompletion/docwordcompletionui.rc
@@ -0,0 +1,16 @@
+<!DOCTYPE kpartgui>
+<kpartplugin name="ktexteditor_docwordcompletion" library="ktexteditor_docwordcompletion" version="4">
+<MenuBar>
+ <Menu name="tools"><Text>&amp;Tools</Text>
+ <separator group="tools_operations" />
+ <menu name="wordcompletion" group="tools_operations"><text>Word Completion</text>
+ <Action name="doccomplete_fw" />
+ <Action name="doccomplete_bw" />
+ <Action name="doccomplete_pu" />
+ <Action name="doccomplete_sh" />
+ <separator />
+ <action name="enable_autopopup" />
+ </menu>
+ </Menu>
+</MenuBar>
+</kpartplugin>
diff --git a/kate/plugins/wordcompletion/ktexteditor_docwordcompletion.desktop b/kate/plugins/wordcompletion/ktexteditor_docwordcompletion.desktop
new file mode 100644
index 000000000..dd2a5e8dc
--- /dev/null
+++ b/kate/plugins/wordcompletion/ktexteditor_docwordcompletion.desktop
@@ -0,0 +1,139 @@
+[Desktop Entry]
+Name=KTextEditor Word Completion Plugin
+Name[af]=KTextEditor Woord Voltooiïng Inprop Module
+Name[be]=Модуль заканчÑÐ½Ð½Ñ Ñловаў
+Name[bn]=কে-টেকà§à¦¸à¦Ÿ-à¦à¦¡à¦¿à¦Ÿà¦° শবà§à¦¦ পরিপূরণ পà§à¦²à¦¾à¦—-ইন
+Name[bs]=KTextEditor dodatak za dovrÅ¡avanje rijeÄi
+Name[ca]=Endollable de completar paraules del KTextEditor
+Name[cs]=Modul pro doplňování slov
+Name[csb]=Plugins editorë do dofùlowaniô słowów
+Name[da]=KTextEditor 'ord-kompletterings'-plugin
+Name[de]=KTextEditor-Erweiterung für Wortergänzungen
+Name[el]=ΠÏόσθετο συμπλήÏωσης λέξεων του KTextEditor
+Name[eo]=KTextEditor Vortkompletiga kromaĵo
+Name[es]=Plugin de completado de palabras de KTextEditor
+Name[et]=KTextEditori sõna lõpetamise plugin
+Name[eu]=KTextEditor-en hitzen osaketarako plugin-a
+Name[fa]=وصلۀ تکمیل واژۀ KTextEditor
+Name[fi]=KTextEditorin sanojen täydennyslaajennus
+Name[fr]=Module externe de complètement des mots de KTextEditor
+Name[fy]=KTextEditor plugin foar it kompleet meitje fan wurden
+Name[ga]=Breiseán Comhlánaithe Focal KTextEditor
+Name[gl]=Plugin de Completado de Palabras de KTextEditor
+Name[he]=תוסף השלמה ×וטומטית של ×ž×™×œ×™× ×¢×‘×•×¨ KTextEditor
+Name[hi]=के-टेकà¥à¤¸à¥à¤Ÿ-à¤à¤¡à¤¿à¤Ÿà¤° वरà¥à¤¡ कमà¥à¤ªà¥à¤²à¥€à¤¶à¤¨ पà¥à¤²à¤—िन
+Name[hr]=KTextEditor dodatak za dopunjavanje rijeÄi
+Name[hsb]=KTextEditor Plugin za wudospołnjenje słowow
+Name[hu]=KTextEditor szókiegészítő bővítőmodul
+Name[id]=Plugin Pelengkapan Kata KTextEditor
+Name[is]=KTextEditor íforrit til að klára orð
+Name[it]=Plugin completamento parole di KTextEditor
+Name[ja]=KTextEditor å˜èªžè£œå®Œãƒ—ラグイン
+Name[ka]=სიტყვების თვითშევსების KTextEditor-ის მáƒáƒ“ული
+Name[kk]=KTextEditor Ñөздерді аÑқтау модулі
+Name[km]=កម្មវិធី​ជំនួយ​បំពáŸáž‰â€‹áž–ាក្យ​របស់ KTextEditor
+Name[ko]=K글월편집기 ë‚±ë§ ì™„ì„± 플러그ì¸
+Name[lb]=KTextEditor-Wuert-Vervollstännegungs-Plugin
+Name[lt]=KTextEditor žodžio užbaigimo priedas
+Name[lv]=KTextEditor vÄrdu pabeigÅ¡anas spraudnis
+Name[mk]=KTextEditor приклучок за довршување на зборови
+Name[ms]=Plug masuk Penyudah Kata Fail KTextEditor
+Name[nb]=Programtillegg for ordfullføring i KTextEditor
+Name[nds]=KTextEditor-Plugin för Woort-Kompletteren
+Name[ne]=KTextEditor शबà¥à¤¦ समापà¥à¤¤à¤¿ पà¥à¤²à¤—इन
+Name[nl]=KTextEditor-plugin voor het aanvullen van woorden
+Name[nn]=Programtillegg for ordfullføring i KTextEditor
+Name[pa]=KTextEditor ਪਾਠ ਪੂਰਨ ਪਲੱਗਿੰਨ
+Name[pl]=Wtyczka edytora do dopełniania słów
+Name[pt]='Plugin' de Completação de Palavras do KTextEditor
+Name[pt_BR]=Plug-in de Complementação de Palavras para Editor de textos
+Name[ro]=Modul completare cuvinte pentru KTextEditor
+Name[ru]=Модуль Ð°Ð²Ñ‚Ð¾Ð´Ð¾Ð¿Ð¾Ð»Ð½ÐµÐ½Ð¸Ñ Ñлов KTextEditor
+Name[rw]=Icomeka ry'Iyuzuza Jambo rya KMuhinduziUmwandiko
+Name[se]=KTextEditor:a sátneollašuhttinlassemoduvla
+Name[sk]=Modul pre doplnenie slov pre KTextEditor
+Name[sl]=Vstavek KTextEditor za dopolnjevanje besed
+Name[sr]=KTextEditor прикључак за довршавање речи
+Name[sr@Latn]=KTextEditor prikljuÄak za dovrÅ¡avanje reÄi
+Name[sv]=Ktexteditor-insticksprogram för att komplettera ord
+Name[ta]=கேஉரைதொகà¯à®ªà¯à®ªà®¾à®³à®°à¯ கோபà¯à®ªà¯ உளà¯à®³à¯€à®Ÿà¯à®Ÿà¯à®šà¯ சொரà¯à®•à¯à®ªà¯à®ªà¯Šà®°à¯à®³à¯
+Name[te]=కెటెకà±à°¸à±à°Ÿà± ఎడిటరౠపద పూరణ à°ªà±à°²à°—à°¿à°¨à±
+Name[tg]=Модули худиловакунандаи калимаҳои KTextEditor
+Name[th]=ปลัà¸à¸­à¸´à¸™à¸à¸²à¸£à¹€à¸•à¸´à¸¡à¸„ำให้สมบูรณ์ของ KTextEditor
+Name[tr]=KTextEditor Kelime Tamamlama Eklentisi
+Name[tt]=KTextEditor'nıñ Süz Tulılandıru Östämäse
+Name[uk]=Втулок KTextEditor Ð´Ð»Ñ Ð·Ð°Ð²ÐµÑ€ÑˆÐµÐ½Ð½Ñ Ñлів
+Name[vi]=Bộ cầm phít Nhập xong Từ KTextEditor
+Name[zh_CN]=KTextEditor å•è¯è¡¥å…¨æ’件
+Name[zh_HK]=KTextEditor 文字自動補齊外掛程å¼
+Name[zh_TW]=KTextEditor 單字補完外掛程å¼
+Comment=Directional or popup-based completion from words in the document
+Comment[af]=Direksionele of opspring gebaseerde woord voltooiïng van woorde in die dokument
+Comment[be]=ПроÑтае заканчÑнне Ñловаў ці выплыўнае вакно з варыÑнтамі заканчÑннÑ
+Comment[bg]=Ðвтоматично завършване на думи, базирано на използваните вече думи в документа
+Comment[bn]=ডকà§à¦®à§‡à¦¨à§à¦Ÿ-à¦à¦° অনà§à¦¯à¦¾à¦¨à§à¦¯ শবà§à¦¦à§‡à¦° উপর ভিতà§à¦¤à¦¿ করে পরিপূরণ
+Comment[bs]=Direkcionalno ili popup-bazirano dovrÅ¡avanje za rijeÄi u dokumentu
+Comment[ca]=Compleció de paraules del document dirigida o basada en emergents
+Comment[cs]=Přímé nebo vyskakovací doplňování slov v dokumentu
+Comment[csb]=Dofùlowanié na spòdlëm lëstë słowów w dokùmence
+Comment[da]=Retnings- eller popop-baseret fuldstændiggørelse ud fra ord i dokumentet
+Comment[de]=Richtungs- oder über Aufklappfenstergesteuerte automatische Vervollständigung von Wörtern in Dokumenten
+Comment[el]=Κατευθυντική ή μέσω αναδυόμενων Î¼ÎµÎ½Î¿Ï ÏƒÏ…Î¼Ï€Î»Î®Ïωση από λέξεις μέσα στο έγγÏαφο
+Comment[eo]=Regula aÅ­ Åprucbazita kompletigo de vortoj en la dokumento
+Comment[es]=Completado de palabras direccional o de menú emergente en el documento.
+Comment[et]=Lõpetamine vastavalt suunale või hüpikvariantide alusel dokumendi sõnade põhjal
+Comment[eu]=Dokumentuko hitzen osaketarako plugin-a
+Comment[fa]=تکمیل جهت‌دار یا مبنی بر بالاپر از کلمات موجود در سند
+Comment[fi]=Asiakirjasta löytyvillä sanoilla täydentäminen
+Comment[fr]=Complètement utilisant la direction ou un menu à partir des mots du document
+Comment[fy]=kompleet meitsje fan wurden yn it dokumint op Direktsjeneel of popup-basearje
+Comment[gl]=Completado direccional ou baseada en popup a partir de palabras no documento
+Comment[he]=השלמת ×ž×™×œ×™× ×›×™×•×•× ×™×•×ª ×ו מבוססת תיבת מוקפצות של ×ž×™×œ×™× ×ž×”×ž×¡×ž×š
+Comment[hi]=डायरेकà¥à¤¶à¤¨à¤² या पॉपअप-आधारित दसà¥à¤¤à¤¾à¤µà¥‡à¤œà¤¼ में शबà¥à¤¦ से कमà¥à¤ªà¤²à¥€à¤¶à¤¨.
+Comment[hr]=Usmjereno ili pop-up zasnovano dovrÅ¡avanje iz rijeÄi u dokumentu
+Comment[hsb]=Direktionalne abo na pop-up bazowace wudospołnjowanje za słowa w dokumenće
+Comment[hu]=Irány szerinti vagy felbukkanó kiegészítés dokumentum szavai alapján
+Comment[id]=Pelengkapan arahan atau popup dari kata di dalam dokumen
+Comment[is]=Ãttvíst forrit sem getur líka opnað glugga með orðatillögum
+Comment[it]=Completamento direzionale o con finestre a comparsa di parole nel documento
+Comment[ja]=ãƒãƒƒãƒ—アップã¾ãŸã¯ãƒ¦ãƒ¼ã‚¶ã®æŒ‡ç¤ºã«ã‚ˆã£ã¦ãƒ‰ã‚­ãƒ¥ãƒ¡ãƒ³ãƒˆã®å˜èªžã‹ã‚‰è£œå®Œã—ã¾ã™
+Comment[ka]=დáƒáƒ™áƒ£áƒ›áƒ”ნტში სიტყვების პირდáƒáƒžáƒ˜áƒ áƒ˜ მეთáƒáƒ“ით áƒáƒœ ჩáƒáƒ›áƒáƒ¨áƒšáƒáƒ“ი მენიუთი თვითშევსებáƒ
+Comment[kk]=Құжаттағы Ñөздерді аÑқтау модулі
+Comment[km]=ការបំពáŸáž‰â€‹áž–ាក្យ​ដោយ​ផ្ទាល់ ឬ ážáž¶áž˜â€‹ážšáž™áŸˆâ€‹áž€áž¶ážšáž›áŸáž…ឡើង​នៃ​ពាក្យ​ដែល​មាន​ក្នុង​ឯកសារ
+Comment[lb]=Direktional oder Opklapp-Fënster-baséiert Vervollstännegung vu Wierder am Dokument
+Comment[lt]=Žodžių pabaigimas raÅ¡ant dokumente pasiÅ«lymus teikiant eilutÄ—je arba iÅ¡Å¡okanÄiame meniu
+Comment[lv]=VÄrdu automÄtiska pabeigÅ¡ana izmantojot dokumentÄ jau esoÅ¡os vÄrdus
+Comment[mk]=ÐаÑочено или Ñкок-базирано довршување од зборови во документот
+Comment[ms]=Penyelesaian berarah atau berasaskan popup daripada perkataan dalam dokumen
+Comment[nb]=Retningsbestemt eller sprettopp-basert fullføring av ord i dokumentet
+Comment[nds]=Richten- oder Opdukbaseert Kompletteren vun Wöör binnen dat Dokment
+Comment[ne]=कागजातमा शबà¥à¤¦à¤¹à¤°à¥‚बाट दिशानिरà¥à¤¦à¥‡à¤¶à¤¿à¤¤ वा पपअपमा आधारित समापà¥à¤¤à¤¿
+Comment[nl]=Voor het aanvullen van woorden in het document door middel van onder meer pop-ups
+Comment[nn]=Retningsbestemt eller sprettopp-basert fullføring av ord i dokumentet
+Comment[pa]=ਦਸਤਾਵੇਜ਼ ਵਿੱਚ ਦਿਸ਼ਾਵੀ ਜਾਂ ਪੋਪਅੱਪ ਆਧਾਰਿਤ ਸ਼ਬਦ ਪੂਰਨ
+Comment[pl]=Dopełnianie na podstawie listy słów w dokumencie
+Comment[pt]=Completação direccional ou por lista de palavras no documento
+Comment[pt_BR]=Complementação direcional, ou baseada em popup, de palavras do documento
+Comment[ro]=Propune completarea cuvintelor din document dintr-o listă popup sau direcţională
+Comment[ru]=Ðвтодополнение Ñлов в документе
+Comment[rw]=Irangiza mfatacyerekezo cyangwa rishingiye-kwirambura biva ku magambo yo mu nyandiko
+Comment[sk]=Dopĺňanie slov v dokumente priame alebo pomocou dialógu
+Comment[sl]=Neposredno ali pojavno dopolnjevanje iz besed v dokumentu
+Comment[sr]=Директна или иÑкачућа допуна од речи у документу
+Comment[sr@Latn]=Direktna ili iskaÄuća dopuna od reÄi u dokumentu
+Comment[sv]=Komplettering av ord i dokumentet baserad på ordlista eller dialogruta
+Comment[ta]=ஆவணதà¯à®¤à®¿à®²à¯à®³à¯à®³ வாரà¯à®¤à¯à®¤à¯ˆà®•à®³à®¿à®²à®¿à®°à¯à®¨à¯à®¤à¯ திசைகள௠அலà¯à®²à®¤à¯ மேலà¯à®µà®¿à®°à®¿-சாரà¯à®¨à¯à®¤ நிறைவà¯
+Comment[te]=పతà±à°°à°‚ లోని పదాలౠవాడె, దిశా లేక పాపౠఅపౠఆధారిత పద పూరణ
+Comment[tg]=Худиловакунандаи калима дар ҳуҷҷат
+Comment[th]=à¸à¸²à¸£à¹€à¸•à¸´à¸¡à¸„ำให้สมบูรณ์โดยà¸à¸²à¸£à¸Šà¸µà¹‰à¸™à¸³à¸«à¸£à¸·à¸­ popup ขึ้นมา จาà¸à¸„ำต่างๆ ในเอà¸à¸ªà¸²à¸£
+Comment[tr]=Doğrusal veya açılır-kuttu abanlı kelime tamamlama
+Comment[tt]=İstälek süzlärenä azaqlarnı yözep çığarıp kürsätä torğan närsä
+Comment[uk]=Ð—Ð°Ð²ÐµÑ€ÑˆÐµÐ½Ð½Ñ Ñлів у документі. ПрÑме або на оÑнові вигулькного меню
+Comment[vi]=Khả năng nhập xong từ trong tài liệu, Ä‘á»±a vào chiá»u hoặc vào bá»™ bật lên.
+Comment[zh_CN]=在文档中基于方å‘或弹出补全å•è¯
+Comment[zh_TW]=在編輯文件時的單字補完功能
+X-KDE-Library=ktexteditor_docwordcompletion
+ServiceTypes=KTextEditor/Plugin
+Type=Service
+InitialPreference=8
+MimeType=text/plain
diff --git a/kate/scripts/Makefile.am b/kate/scripts/Makefile.am
new file mode 100644
index 000000000..b30da48af
--- /dev/null
+++ b/kate/scripts/Makefile.am
@@ -0,0 +1,5 @@
+scriptskatedir = $(kde_datadir)/katepart/scripts
+scriptskate_DATA = jstest.desktop jstest.js script-indent-c-newline.js script-indent-c-char.js sort.js
+
+indentscriptskatedir = $(kde_datadir)/katepart/scripts/indent
+indentscriptskate_DATA = script-indent-c-test.js script-indent-c1-test.lua
diff --git a/kate/scripts/jstest.desktop b/kate/scripts/jstest.desktop
new file mode 100644
index 000000000..28619d871
--- /dev/null
+++ b/kate/scripts/jstest.desktop
@@ -0,0 +1,119 @@
+[Desktop Entry]
+Name=Kate Part JavaScript Test
+Name[af]=Kate Deel Javaskript Toets
+Name[be]=Праверка ÑцÑнараў JavaScript Ð´Ð»Ñ Kate
+Name[ca]=Prova de la peça JavaScript de Kate
+Name[cs]=Kate Part JavaScript test
+Name[csb]=Test JavaScript - dzélu Kate
+Name[de]=JavaScript-Test für Kate-Komponente
+Name[el]=Έλεγχος JavaScript του Kate Part
+Name[eo]=Äœavaskripta testo por Kate dokumenta rigardilo
+Name[es]=Prueba JavaScript de Kate Part
+Name[et]=Kate komponendi JavaScripti test
+Name[eu]=Kate zatiaren JavaScript proba
+Name[fa]=آزمون دست‌نوشتۀ جاوا Kate Part
+Name[fi]=Kate Part JavaScript -testi
+Name[fr]=Test du module JavaScript pour Kate
+Name[fy]=Kate-part JavaSkript-test
+Name[ga]=Tástáil JavaScript do Pháirt Kate
+Name[gl]=Comprobar Kate Part JavaScript
+Name[he]=בדיקת JavaScript של רכיב Kate
+Name[hr]=Kate Part JavaScript test
+Name[hu]=Kate objektum, Javascript-teszt
+Name[id]=Tes JavaScript untuk Part Kate
+Name[is]=Kate hluti JavaScript prófun
+Name[it]=Prova componente JavaScript per Kate
+Name[ja]=Kate Part JavaScript テスト
+Name[ka]=JavaScript-ის შემáƒáƒ¬áƒ›áƒ”ბრKate-ში
+Name[kk]=JavaScript Ñкрипттерді Kate редакторында текÑеру
+Name[km]=ការ​សាកល្បង Kate Part JavaScript
+Name[lb]=Kate Part JavaScript-Test
+Name[lt]=Kate Part JavaScript testas
+Name[ms]=Ujian JavaScript Bahagian Kate
+Name[nb]=Kate Part JavaScript-test
+Name[nds]=Kate-Part JavaScript-Test
+Name[ne]=केट भाग जाभा सà¥à¤•à¥à¤°à¤¿à¤ªà¥à¤Ÿ परीकà¥à¤·à¤£
+Name[nl]=Kate-part JavaScript-test
+Name[nn]=Kate Part JavaScript-test
+Name[pa]=Kate Part JavaScript ਜਾਂਚ
+Name[pl]=Test JavaScript osadzalnej części Kate
+Name[pt]=Teste de JavaScript do Componente do Kate
+Name[pt_BR]=Teste do componente JavaScript do Kate
+Name[ro]=Test JavaScript pentru componenta Kate
+Name[ru]=Проверка Ñкриптов JavaScript в Kate
+Name[rw]=Igerageza rya JavaScript Igice Kate
+Name[se]=Kate Part JavaScript-geahÄÄaleapmi
+Name[sl]=Test JavaScripta za del Kate
+Name[sr]=Проба JavaScript-а Kate-иног дела
+Name[sr@Latn]=Proba JavaScript-a Kate-inog dela
+Name[sv]=Test av Javaskript för Kates delprogram
+Name[ta]=கேட௠பகà¯à®¤à®¿ ஜாவாஸà¯à®•à®¿à®°à®¿à®ªà¯à®Ÿà¯ சோதனை
+Name[te]=కేటౠభాగం జావాసà±à°•à±à°°à°¿à°ªà±à°Ÿà± పరీకà±à°·
+Name[tg]=Санҷиши ҚиÑми Kate-и JavaScript
+Name[th]=ทดสอบจาวาสคริปต์ของ Kate
+Name[tt]=Kate Part JavaScript Sınaw
+Name[uk]=Перевірка Ñкриптів JavaScript в компоненті Kate
+Name[vi]=Thử ra JavaScript phần Kate
+Name[zh_CN]=Kate 部件 JavaScript 测试
+Comment=Script for testing kate part's scripting
+Comment[af]=Skript om te toets of Kate se skript masjien werk
+Comment[be]=СцÑнар праверкі Ð´Ð»Ñ Kate
+Comment[bg]=Скрипт за теÑтване на модулите за поддръжка на Ñкриптове
+Comment[bs]=Skripta za testiranje podrške Kate part-a za skriptiranje
+Comment[ca]=Guió per a provar l'escriptat de les peces Kate
+Comment[cs]=Skript pro test skriptování Kate
+Comment[csb]=Skript do testowaniô mòżnotë skriptów Kate
+Comment[da]=Script til at teste katepart scripter
+Comment[de]=Ein Skript zum Testen der Skriptfunktionalität der Kate-Komponente
+Comment[el]=ΣενάÏιο για έλεγχο του scripting του Kate Part
+Comment[eo]=Skripto por testi la skriptan kapablon de katepart (dokumento kaj rigardilo)
+Comment[es]=Guión para probar el part de scripting de kate
+Comment[et]=Skript Kate komponendi skriptimisomaduste testimiseks
+Comment[eu]=Script-a Kate zatiaren script-ak probatzeko.
+Comment[fa]=دست‌نوشته برای آزمون دست‌نوشته‌هایKate Part
+Comment[fi]=Skripti kate partin skriptien testaukseen
+Comment[fr]=Script testant le module de scripting de Kate
+Comment[fy]=Skript foar it testen fan Kate-part's skriptmooglikheid
+Comment[gl]=Guión para probar os guións das partes de kate
+Comment[he]=תסריט לבדיקה של יכולות התסריט של Kate
+Comment[hr]=Skripta za ispitivanje izvršavanje skripti pri 'kate part'
+Comment[hu]=Szkript a Kate objektum szkriptkezelőjének ellenőrzéséhez
+Comment[id]=Skrip untuk menguji skripting part kate
+Comment[is]=Skrifta til að prófa skriftueiginleika Kate hluta
+Comment[it]=Script per provare il componente di scripting di kate
+Comment[ja]=kate part ã®ã‚¹ã‚¯ãƒªãƒ—トをテストã™ã‚‹ãŸã‚ã®ã‚¹ã‚¯ãƒªãƒ—ト
+Comment[ka]=სკრიპტი Kate-ში სკრიპტების შესáƒáƒ›áƒáƒ¬áƒ›áƒ”ბლáƒáƒ“
+Comment[kk]=Kate редакторында Ñкрипттерді текÑеру Ñкрипті
+Comment[km]=ស្គ្រីប​សម្រាប់​សាកល្បង​ការ​សរសáŸážšâ€‹ážšáž”ស់ kate part
+Comment[lb]=Skript fir d'Skriptfunktioune vum Kate part ze testen
+Comment[lt]=Scenarijus Kate komponento scenarijų rašymo patikrai
+Comment[ms]=Skrip untuk menguji penskripan bahagian kate
+Comment[nb]=Skript til å teste kate parts skripting
+Comment[nds]=En Skript, dat Kate-Part sien Skriptkönen pröven schall
+Comment[ne]=केट भागको सà¥à¤•à¥à¤°à¤¿à¤ªà¥à¤Ÿà¤¿à¤™ परीकà¥à¤·à¤£à¤•à¤¾ लागि सà¥à¤•à¥à¤°à¤¿à¤ªà¥à¤Ÿ
+Comment[nl]=Script voor het testen van Kate-part's scriptmogelijkheid
+Comment[nn]=Skript for testing av Kate part-skriptinga
+Comment[pa]=kate part ਦੀ ਸਕà©à¨°à¨¿à¨ªà¨Ÿà¨¿à©°à¨— ਦੀ ਜਾਂਚ ਲਈ ਸਕà©à¨°à¨¿à¨ªà¨Ÿ
+Comment[pl]=Skrypt do testowania możliwości skryptów Kate
+Comment[pt]=Um programa para testar a programação do componente do Kate
+Comment[pt_BR]=Script para testes da parte de scripts do kate
+Comment[ro]=Script pentru testarea părţii de scripting din Kate
+Comment[ru]=Скрипт Ð´Ð»Ñ Ð¿Ñ€Ð¾Ð²ÐµÑ€ÐºÐ¸ поддержки Ñкриптов в Kate
+Comment[rw]=Inyandikoporogaramu yo kugenzura kwandika kode by'igice cya kate.
+Comment[se]=Skripta mii geahÄÄala Kate part-skriptema
+Comment[sk]=Skript pre testovanie skriptovania Kate Part
+Comment[sl]=Skript za testiranje delovanja skriptov za del Kate
+Comment[sr]=Скрипта за иÑпробавање Ñкриптовања Kate-иног дела
+Comment[sr@Latn]=Skripta za isprobavanje skriptovanja Kate-inog dela
+Comment[sv]=Skript för att testa skripthantering i Kates delprogram
+Comment[ta]=கேட௠பகà¯à®¤à®¿à®¯à®¿à®©à¯ எழà¯à®¤à¯à®¤à®¾à®•à¯à®• சோதனைகà¯à®•à®¾à®© கà¯à®±à¯à®¨à®¿à®°à®²à¯
+Comment[te]=కేటౠభాగంపౠసà±à°•à±à°°à°¿à°ªà±à°Ÿà°¿à°‚గౠనౠపరీకà±à°·à°¿à°‚à°šà±à°Ÿà°•à± వాడౠఒక à°¸à±à°•à±à°°à°¿à°ªà±à°Ÿà±
+Comment[tg]=Скрипт барои Ñанҷидани Ñкриптгузории қиÑми kate
+Comment[th]=สคริปต์สำหรับทดสอบà¸à¸²à¸£à¹€à¸‚ียนสคริปต์ในส่วนของ Kate
+Comment[tt]=Kate Part'nıñ ämerleklären sınawçı qoral
+Comment[uk]=Скрипт Ð´Ð»Ñ Ð¿ÐµÑ€ÐµÐ²Ñ–Ñ€ÐºÐ¸ підтримки Ñкриптів в компоненті Kate
+Comment[vi]=Tập lệnh để thá»­ ra khả năng Ä‘iá»u khiển bằng tập lệnh của phần Kate.
+Comment[zh_CN]=测试 kate 部件脚本的脚本
+Comment[zh_TW]=測試 kate part 的文稿
+X-Kate-Command=jstest
+X-Kate-Help=<p>Usage: <code>jstest</code></p>
diff --git a/kate/scripts/jstest.js b/kate/scripts/jstest.js
new file mode 100644
index 000000000..cdde8a00d
--- /dev/null
+++ b/kate/scripts/jstest.js
@@ -0,0 +1,26 @@
+// If you select some text before running the script, this line will be overwritten.
+if ( view.hasSelection() )
+{
+ document.removeText( 0, 0, 0, document.lineLength(0) );
+ document.insertText( 0, 0, "// initial selection: " + view.selectionStartLine + "," + view.selectionStartColumn + " - " + view.selectionEndLine + "," + view.selectionEndColumn );
+}
+// test selection interface
+view.selectAll();
+view.setSelection( 0, 0, 0, 20 );
+view.clearSelection();
+
+// insert some text and select that
+var line = document.lines();
+document.insertLine( line, "foo" );
+document.insertText( line, 0, "// This is a new line" );
+view.setSelection( line, 0, line, document.lineLength(line) );
+// Delete that text
+view.removeSelectedText();
+
+// insert some text and select that
+var line = document.lines();
+document.insertLine( line, "bar");
+document.insertText( line, 0, "// This is a new line" );
+view.setSelection( line, 0, line, document.lineLength(line) );
+
+document.insertText( line, document.lineLength( line ), " Selection is " + view.selectionStartLine + "," + view.selectionStartColumn + " - " + view.selectionEndLine + "," + view.selectionEndColumn );
diff --git a/kate/scripts/script-indent-c-char.js b/kate/scripts/script-indent-c-char.js
new file mode 100644
index 000000000..975d77edc
--- /dev/null
+++ b/kate/scripts/script-indent-c-char.js
@@ -0,0 +1,30 @@
+var tabWidth = 4;
+var spaceIndent = true;
+var indentWidth = 4;
+
+var line = view.cursorLine();
+var col = view.cursorColumn();
+
+var textLine = document.textLine( line );
+var prevLine = document.textLine( line - 1 );
+
+var prevIndent = prevLine.match(/^\s*/);
+var addIndent = "";
+
+function unindent()
+{
+// if (
+}
+
+// unindent } and {, if not in a comment
+if ( textLine.search( /^\s*\/\// ) == -1 )
+{
+ if ( textLine.charAt( col-1 ) == '}' || textLine.charAt( col-1 ) == '{')
+ {
+ if ( textLine.search(/^\s\s\s\s/) != -1)
+ {
+ document.removeText( line, 0, line, tabWidth );
+ view.setCursorPositionReal( line, col - tabWidth );
+ }
+ }
+}
diff --git a/kate/scripts/script-indent-c-newline.js b/kate/scripts/script-indent-c-newline.js
new file mode 100644
index 000000000..ade711a3e
--- /dev/null
+++ b/kate/scripts/script-indent-c-newline.js
@@ -0,0 +1,113 @@
+var tabWidth = 4;
+var spaceIndent = true;
+var indentWidth = 4;
+
+var strIndentCharacters = " ";
+var strIndentFiller = "";
+
+var intStartLine = view.cursorLine();
+var intStartColumn = view.cursorColumn();
+
+var strTextLine = document.textLine( intStartLine );
+var strPrevLine = document.textLine( intStartLine - 1 );
+
+var addIndent = "";
+
+function firstNonSpace( _text )
+{
+ for( _i=0; _i < _text.length; _i++ )
+ {
+ _ch = _text.charAt( _i );
+ if( _ch != ' ' && _ch != '\t' )
+ return _i;
+ }
+
+ return -1;
+}
+
+function lastNonSpace( _text )
+{
+ for( _i=_text.length - 1; _i >= 0; _i-- )
+ {
+ _ch = _text.charAt( _i );
+ if( _ch != ' ' && _ch != '\t' )
+ return _i;
+ }
+
+ return -1;
+}
+
+
+// if previous line ends with a '{' increase indent level
+// if ( prevLine.search( /{\s*$/ ) != -1 )
+// {
+// if ( spaceIndent )
+// addIndent = " ";
+// else
+// addIndent = "\t";
+// }
+// else
+{
+ var intCurrentLine = intStartLine;
+ var openParenCount = 0;
+ var openBraceCount = 0;
+
+ label_while:
+ while ( intCurrentLine > 0 )
+ {
+ intCurrentLine--;
+
+ strCurrentLine = document.textLine( intCurrentLine );
+ intLastChar = lastNonSpace( strCurrentLine );
+ intFirstChar = firstNonSpace( strCurrentLine ) ;
+
+ if ( strCurrentLine.search( /\/\// ) == -1 )
+ {
+
+ // look through line backwards for interesting characters
+ for( intCurrentChar = intLastChar; intCurrentChar >= intFirstChar; --intCurrentChar )
+ {
+ ch = strCurrentLine.charAt( intCurrentChar );
+ switch( ch )
+ {
+ case '(': case '[':
+ if( ++openParenCount > 0 )
+ break label_while; //return calcIndentInBracket( begin, cur, pos );
+ break;
+ case ')': case ']': openParenCount--; break;
+ case '{':
+ if( ++openBraceCount > 0 )
+ break label_while; //return calcIndentInBrace( begin, cur, pos );
+ break;
+ case '}': openBraceCount--; lookingForScopeKeywords = false; break;
+ case ';':
+ if( openParenCount == 0 )
+ lookingForScopeKeywords = false;
+ break;
+ }
+ }
+ }
+ }
+
+ strIndentFiller += strCurrentLine.match(/^\s+/);
+ if ( strIndentFiller == "null" )
+ strIndentFiller = "";
+
+ debug( "line: " + intCurrentLine);
+ debug( openParenCount + ", " + openBraceCount);
+
+ while( openParenCount > 0 )
+ {
+ openParenCount--;
+ strIndentFiller += strIndentCharacters;
+ }
+
+ while( openBraceCount > 0 )
+ {
+ openBraceCount--;
+ strIndentFiller += strIndentCharacters;
+ }
+}
+
+document.insertText( intStartLine, 0, strIndentFiller );
+view.setCursorPositionReal( intStartLine, document.textLine( intStartLine ).length );
diff --git a/kate/scripts/script-indent-c-test.js b/kate/scripts/script-indent-c-test.js
new file mode 100644
index 000000000..5d506ca67
--- /dev/null
+++ b/kate/scripts/script-indent-c-test.js
@@ -0,0 +1,180 @@
+/**KATE
+ *NAME: C style indenter
+ *COPYRIGHT:
+ *Based on work Copyright 2005 by Dominik Haumann
+ *Copyright 2005 by Joseph Wenninger
+ *Here will be the license text, Dominik has to choose
+ * The following line is not empty
+ *
+ *An empty line ends this block
+ *
+ *VERSION: 0.1
+ *ANUNKNOWNKEYWORD: Version has to be in the format major.minor (both numbers)
+ *IGNOREALSO: All keywords, except COPYRIGHT are expected to have their data on one line
+ *UNKNOWN: unknown keywords are simply ignored from the information parser
+ *CURRENTLY_KNOWN_KEYWORDS: NAME,VERSION, COPYRIGHT
+ *INFORMATION: This block has to begin in the first line at the first character position
+ *INFORMATION: It is optional, but at least all files within the kde cvs,
+ *INFORMATION: which are ment for publishing are supposed to have at least the
+ *INFORMATION: COPYRIGHT block
+ *INFORMATION: These files have to be stored as UTF8
+ **/
+
+/*
+function indentChar() // also possible
+{*/
+
+function indentChar(c)
+{
+ var tabWidth = 4;
+ var spaceIndent = true;
+ var indentWidth = 4;
+
+
+ var line = view.cursorLine();
+ var col = view.cursorColumn();
+
+ var textLine = document.textLine( line );
+ var prevLine = document.textLine( line - 1 );
+
+ var prevIndent = prevLine.match(/^\s*/);
+ var addIndent = "";
+
+ function unindent()
+ {
+ // if (
+ }
+
+ // unindent } and {, if not in a comment
+ if ( textLine.search( /^\s*\/\// ) == -1 )
+ {
+ if ( /*textLine.charAt( col-1 )*/ c == '}' || /*textLine.c( col-1 )*/ c == '{')
+ {
+ if ( textLine.search(/^\s\s\s\s/) != -1)
+ {
+ document.removeText( line, 0, line, tabWidth );
+ view.setCursorPositionReal( line, col - tabWidth );
+ }
+ }
+ }
+
+}
+
+
+function firstNonSpace( _text )
+{
+ for( _i=0; _i < _text.length; _i++ )
+ {
+ _ch = _text.charAt( _i );
+ if( _ch != ' ' && _ch != '\t' )
+ return _i;
+ }
+
+ return -1;
+}
+
+function lastNonSpace( _text )
+{
+ for( _i=_text.length - 1; _i >= 0; _i-- )
+ {
+ _ch = _text.charAt( _i );
+ if( _ch != ' ' && _ch != '\t' )
+ return _i;
+ }
+
+ return -1;
+}
+
+function indentNewLine()
+{
+ var tabWidth = 4;
+ var spaceIndent = true;
+ var indentWidth = 4;
+
+ var strIndentCharacters = " ";
+ var strIndentFiller = "";
+
+ var intStartLine = view.cursorLine();
+ var intStartColumn = view.cursorColumn();
+
+ var strTextLine = document.textLine( intStartLine );
+ var strPrevLine = document.textLine( intStartLine - 1 );
+
+ var addIndent = "";
+ // if previous line ends with a '{' increase indent level
+ // if ( prevLine.search( /{\s*$/ ) != -1 )
+ // {
+ // if ( spaceIndent )
+ // addIndent = " ";
+ // else
+ // addIndent = "\t";
+ // }
+ // else
+ {
+ var intCurrentLine = intStartLine;
+ var openParenCount = 0;
+ var openBraceCount = 0;
+
+ label_while:
+ while ( intCurrentLine > 0 )
+ {
+ intCurrentLine--;
+
+ strCurrentLine = document.textLine( intCurrentLine );
+ intLastChar = lastNonSpace( strCurrentLine );
+ intFirstChar = firstNonSpace( strCurrentLine ) ;
+
+ if ( strCurrentLine.search( /\/\// ) == -1 )
+ {
+
+ // look through line backwards for interesting characters
+ for( intCurrentChar = intLastChar; intCurrentChar >= intFirstChar; --intCurrentChar )
+ {
+ ch = strCurrentLine.charAt( intCurrentChar );
+ switch( ch )
+ {
+ case '(': case '[':
+ if( ++openParenCount > 0 )
+ break label_while; //return calcIndentInBracket( begin, cur, pos );
+ break;
+ case ')': case ']': openParenCount--; break;
+ case '{':
+ if( ++openBraceCount > 0 )
+ break label_while; //return calcIndentInBrace( begin, cur, pos );
+ break;
+ case '}': openBraceCount--; lookingForScopeKeywords = false; break;
+ case ';':
+ if( openParenCount == 0 )
+ lookingForScopeKeywords = false;
+ break;
+ }
+ }
+ }
+ }
+
+ strIndentFiller += strCurrentLine.match(/^\s+/);
+ if ( strIndentFiller == "null" )
+ strIndentFiller = "";
+
+ debug( "line: " + intCurrentLine);
+ debug( openParenCount + ", " + openBraceCount);
+
+ while( openParenCount > 0 )
+ {
+ openParenCount--;
+ strIndentFiller += strIndentCharacters;
+ }
+
+ while( openBraceCount > 0 )
+ {
+ openBraceCount--;
+ strIndentFiller += strIndentCharacters;
+ }
+ }
+
+ document.insertText( intStartLine, 0, strIndentFiller );
+ view.setCursorPositionReal( intStartLine, document.textLine( intStartLine ).length );
+}
+
+indenter.onchar=indentChar
+indenter.onnewline=indentNewLine \ No newline at end of file
diff --git a/kate/scripts/script-indent-c1-test.lua b/kate/scripts/script-indent-c1-test.lua
new file mode 100644
index 000000000..d2593b962
--- /dev/null
+++ b/kate/scripts/script-indent-c1-test.lua
@@ -0,0 +1,154 @@
+function indentChar(c)
+ katedebug("LUA indentChar has been called")
+ local tabWidth = 4
+ local spaceIndent = true
+ local indentWidth = 4
+
+ local line=view.cursorLine()
+ local col=view.cursorColumn()
+ local textLine=document.textLine(line)
+ local prevLine=document.textLine(line-1);
+
+ --local prevIndent=prevLine.match("^%s*")
+ --local addIndent=""
+
+
+ -- unindent } and {, if not in a comment
+
+ if not(string.find(textLine,"^%s*//")) then
+ katedebug("no comment")
+ katedebug(c);
+ if (c=="}") or (c=="{") then
+ katedebug("} or { found");
+ if (string.find(textLine,"^%s%s%s%s")) then
+ katedebug("removing one indentation level");
+ document.removeText(line,0,line,tabWidth)
+ view.setCursorPositionReal(line,col-tabWidth)
+ else
+ katedebug("no indentation found");
+ end
+ end
+ else
+ katedebug("in comment");
+ end
+end
+
+
+
+
+
+function indentNewLine()
+ local tabWidth = 4;
+ local spaceIndent = true;
+ local indentWidth = 4;
+
+ local strIndentCharacters = " ";
+ local strIndentFiller = "";
+
+ local intStartLine, intStartColumn= view.cursorPosition();
+
+ local strTextLine = document.textLine( intStartLine );
+ local strPrevLine = document.textLine( intStartLine - 1 );
+
+ local addIndent = "";
+
+
+ local intCurrentLine = intStartLine;
+ local openParenCount = 0;
+ local openBraceCount = 0;
+
+
+
+ function firstNonSpace( text )
+ local pos=string.find(text,"[^%s]")
+ if pos then
+ return pos
+ else
+ return -1
+ end
+ end
+
+ function lastNonSpace (text)
+ local pos=string.find(text,"[^%s]%s*$")
+ if pos then
+ return pos
+ else
+ return -1
+ end
+ end
+
+ local strCurrentLine=""
+ local intCurrentLine=intStartLine
+ katedebug(intStartLine .. "-" .. intStartColumn)
+ function label_while()
+ katedebug("label_while has been entered: intCurrentLine" .. intCurrentLine)
+ while (intCurrentLine>0) do
+ --katedebug("intCurrentLine:" ..intCurrentLine)
+ intCurrentLine=intCurrentLine-1
+ strCurrentLine=document.textLine(intCurrentLine)
+ intLastChar= lastNonSpace(strCurrentLine)
+ intFirstChar=firstNonSpace(strCurrentLine)
+ if not (string.find(strCurrentLine,"//")) then
+ for intCurrentChar=intLastChar,intFirstChar,-1 do
+ ch=string.sub(strCurrentLine,intCurrentChar,intCurrentChar)
+ if (ch=="(") or (ch=="[") then
+ openParenCount=openParenCount+1
+ if (openParenCount>0) then
+ return label_while()
+ end
+ elseif (ch==")") or (ch=="]") then
+ openParenCount=openParenCount-1
+ elseif (ch=="{") then
+ openBraceCount=openBraceCount+1
+ if openBraceCount>0 then
+ return label_while()
+ end
+ elseif (ch=="}") then
+ openBraceCount=openBraceCount-1
+ elseif (ch==";") then
+ if (openParenCount==0) then
+ lookingForScopeKeywords=false
+ end
+ end
+ end
+ end
+ end
+ end
+
+ label_while()
+
+
+
+ katedebug( "line: " .. intCurrentLine)
+ katedebug( openParenCount .. ", " .. openBraceCount)
+
+ local ok,match=pcall(function () return string.sub(strCurrentLine,string.find(strCurrentLine,"^%s+")) end)
+ if ok then
+ katedebug("Line HAD leading whitespaces")
+ strIndentFiller=match
+ else
+ katedebug("Line had NO leading whitespaces")
+ strIndentFiller=""
+ end
+
+
+ while( openParenCount > 0 ) do
+ openParenCount=openParenCount-1
+ strIndentFiller = strIndentFiller .. strIndentCharacters
+ end
+
+ while( openBraceCount > 0 ) do
+ openBraceCount=openBraceCount-1;
+ strIndentFiller = strIndentFiller .. strIndentCharacters
+ end
+
+ document.insertText( intStartLine, 0, strIndentFiller )
+ view.setCursorPositionReal( intStartLine, string.len(document.textLine( intStartLine )))
+end
+
+
+
+
+
+indenter.register(indenter.OnChar,indentChar)
+indenter.register(indenter.OnNewline,indentNewLine) \ No newline at end of file
diff --git a/kate/scripts/sort.js b/kate/scripts/sort.js
new file mode 100644
index 000000000..41f2145fb
--- /dev/null
+++ b/kate/scripts/sort.js
@@ -0,0 +1,18 @@
+if( view.hasSelection() )
+{
+ start = view.selectionStartLine;
+ end = view.selectionEndLine;
+
+ txt = document.textRange( start, 0, end, document.lineLength( end ) );
+
+ repl = txt.split("\n");
+ repl.sort();
+ txt = repl.join("\n");
+
+ view.clearSelection();
+
+ document.editBegin();
+ document.removeText( start, 0, end, document.lineLength( end ) );
+ document.insertText( start, 0, txt );
+ document.editEnd();
+} \ No newline at end of file
diff --git a/kate/scripts/test.js b/kate/scripts/test.js
new file mode 100644
index 000000000..acc3b94e3
--- /dev/null
+++ b/kate/scripts/test.js
@@ -0,0 +1,16 @@
+var test = 1;
+
+var start = document.lines ()
+
+document.editBegin();
+
+for (var t = 0; t < 100; t++)
+{
+ document.insertLine (start+t, document.lineLength(0));
+ document.insertText (start+t, 0, " muh");
+ document.insertText (start+t, 0, view.cursorLine());
+ document.insertText (start+t, 0, "// ");
+}
+
+document.editEnd();
+
diff --git a/kate/scripts/test_selectioniface.js b/kate/scripts/test_selectioniface.js
new file mode 100644
index 000000000..c447976bb
--- /dev/null
+++ b/kate/scripts/test_selectioniface.js
@@ -0,0 +1,26 @@
+// If you select some text before running the script, this line will be overwritten.
+if ( view.hasSelection() )
+{
+ document.removeText( 0, 0, 0, document.lineLength(0) );
+ document.insertText( 0, 0, "// initial selection: " + view.selectionStartLine + "," + view.selectionStartColumn + " - " + view.selectionEndLine + "," + view.selectionEndColumn );
+}
+// test selection interface
+view.selectAll();
+view.setSelection( 0, 0, 0, 20 );
+view.clearSelection();
+
+// insert some text and select that
+var line = document.lines();
+document.insertLine( line, "foo" );
+document.insertText( line, 0, "// This is a new line" );
+view.setSelection( line, 0, line, document.lineLength(line) );
+// Delete that text
+view.removeSelectedText();
+
+// insert some text and select that
+var line = document.lines();
+document.insertLine( line, "bar" );
+document.insertText( line, 0, "// This is a new line" );
+view.setSelection( line, 0, line, document.lineLength(line) );
+
+document.insertText( line, document.lineLength( line ), " Selection is " + view.selectionStartLine + "," + view.selectionStartColumn + " - " + view.selectionEndLine + "," + view.selectionEndColumn );
diff --git a/kate/tests/ejp1.asm b/kate/tests/ejp1.asm
new file mode 100644
index 000000000..d94dc4ca0
--- /dev/null
+++ b/kate/tests/ejp1.asm
@@ -0,0 +1,285 @@
+;
+; Decodeur de trame pulsadis EJP et préavis EJP
+; (pic 12C508 ou 509)
+; Alain Gibaud, 20-2-2001
+;
+; ========================================================
+ list r=hex,p=p12c508
+
+ include "p12c508.inc"
+GP0 equ 0
+GP1 equ 1
+GP2 equ 2
+GP3 equ 3
+GP4 equ 4
+GP5 equ 5
+TO equ 4
+; masques pour acceder aux pattes
+GP0bit equ 1 << GP0
+GP1bit equ 1 << GP1
+GP2bit equ 1 << GP2
+GP3bit equ 1 << GP3
+GP4bit equ 1 << GP4
+GP5bit equ 1 << GP5
+; ========================================================
+; affectation des pattes
+;
+
+; sorties: (actives niv bas)
+NORMAL equ GP0 ; LED verte
+ALERTE equ GP1 ; LED orange
+EJP equ GP2 ; LED rouge
+; entrees:( actives niv bas)
+SIGNAL equ GP3 ; avec pull-up, en provenance filtre 175 Hz
+; GP4-5 sont utilisees par l'horloge
+; ========================================================
+; variables:
+TICKS equ 0x7 ; compteur de ticks (1 tick = 2/100 s)
+SLOT equ 0x8 ; numero slot dans la trame
+; =======================================================
+; Macros pour alleger le code ...
+;
+; Teste si min <= (var) < max
+; branche en "in" si oui, en "out" si non.
+;
+Lminmax macro var,min,max,outm,in,outp
+ movlw min
+ subwf var,W ; (var) - min
+ btfss STATUS,C
+ goto outm ; C=0 => resutat < 0 => var < min
+
+ movlw max
+ subwf var,W ; (var) - max
+ btfss STATUS,C
+ goto in
+ goto outp ; C=1 => resutat >= 0 => var >= min
+ endm
+;
+; Attend que le bit "bit" du registre "reg" soit a 1
+;
+Waitbit1 macro reg,bit
+ local Wait1
+Wait1 btfss reg,bit
+ goto Wait1
+ endm
+;
+; Attend que le bit "bit" du registre "reg" soit a 0
+;
+Waitbit0 macro reg,bit
+ local Wait0
+Wait0 btfsc reg,bit
+ goto Wait0
+ endm
+;
+; Branche en "label" si (reg) == num, sinon continue
+;
+Beq macro label,reg,num
+ movlw num
+ subwf reg,W
+ btfsc STATUS,Z
+ goto label
+ endm
+;
+; Branche en "label" si (reg) != num, sinon continue
+;
+Bne macro label,reg,num
+ movlw num
+ subwf reg,W
+ btfss STATUS,Z
+ goto label
+ endm
+
+;
+; Branche en "label" si (reg) < num, sinon continue
+;
+Blt macro label,reg,num
+ movlw num
+ subwf reg,W ; reg - W
+ btfss STATUS,C
+ goto label ; C=0 => reg - W < 0
+ endm
+
+;
+; Branche en "label" si (reg) >= num, sinon continue
+;
+Bge macro label,reg,num
+ movlw num
+ subwf reg,W ; reg - W
+ btfsc STATUS,C
+ goto label ; C=1 => reg - W >= 0
+ endm
+; ========================================================
+ ; CONFIG word ( en FFF )
+ ; bits 11:5 don't care
+ ; bit 4 : MCLRE enabled = 1, tied to Vdd = 0
+ ; bit 3 : code protection off = 1, on = 0
+ ; bit 2 : no watchdog = 0, watchdog = 1
+ ; bit 1-0 ; EXTRC = 00, INTRC = 10, XT = 01, LP = 00
+
+ __CONFIG B'000000001101' ; (horloge a quartz, avec watchdog)
+; ========================================================
+ org 0
+ goto debut
+;=========================================================
+; sous-programmes
+; ========================================================
+; regarde si le timer est passe a 0
+; si oui, le compteur de ticks est incremente
+; et on attend le repassage a 1
+; Cette routine DOIT etre appelee tout les 2/100 s ou plus souvent
+tickcount
+ clrwdt
+ movf TMR0,W
+ btfss STATUS,Z
+ retlw 0
+
+ incf TICKS,F
+; attendre que le timer ait depasse 0
+waitnoZ
+ clrwdt
+ movf TMR0,W
+ btfsc STATUS,Z
+ goto waitnoZ
+ retlw 0
+;
+; les 2 fct qui suivent maintiennent, le compteur de ticks
+; (en plus de scruter une patte)
+; attente d'un signal (logique negative)
+waitsignal
+ call tickcount
+ btfsc GPIO,SIGNAL
+ goto waitsignal
+ retlw 0
+; attente fin signal
+waitnosignal
+ call tickcount
+ btfss GPIO,SIGNAL
+ goto waitnosignal
+ retlw 0
+; remet a zero le compteur de ticks et le timer et le watchdog
+clearticks
+ clrwdt
+ clrw
+ movwf TICKS
+ movwf TMR0
+ ; pour eviter un timeout immediat, le timer est charge
+ ; a 1, et le 1er tick ne fait que 0.019922s au lieu de 0.2s
+ ; (ce n'est pas grave dans la mesure ou de toute facon,
+ ; le temps de traitement entre les different declenchements
+ ; de chrono n'est pas nul)
+ incf TMR0,F
+ retlw 0
+
+;
+; ==========================================================
+;
+debut
+ ; reset par Watchdog ?
+ btfsc STATUS,TO
+ goto notimeout
+ ; TO == 0 : OUI
+ clrwdt
+ goto 0x1FF ; recalibrage, 0x3FF sur 12C509
+
+ ; TO == 1 : NON
+notimeout
+ movwf OSCCAL ; recalibrer l'horloge
+ clrf TMR0 ; RAZ timer
+ ; GPWU=1 : disable wake up on pin change
+ ; GPPU=0 : enable pullups (a voir avec le hard ..)
+ ; T0CS=0 : timer connected to F/4
+ ; T0SE=x : dont't care
+ ; PSA=0 : prescaler assigned to timer
+ ; PS2-0= : timer prescaler 111= 1/256, 101 = 1/64, 011 = 1/16
+ movlw B'10010101'
+ option
+
+ ; config des pattes
+ movlw B'00001000' ; GP0-2 en sortie, GP3 entree
+ tris GPIO
+
+ ; se mettre en mode normal
+ bcf GPIO,NORMAL
+ bsf GPIO,ALERTE
+ bsf GPIO,EJP
+
+
+attendre_trame
+ call waitnosignal ; attendre ...
+ call waitsignal ; ... front montant
+ call clearticks
+ call waitnosignal
+ ; 45 tk = 0.9s, 55 tk = 1.1s
+ Lminmax TICKS,D'45',D'55',attendre_trame,pulse1s,attendre_trame
+pulse1s
+
+ ; attendre 162,5 tk = 2.75 s + 0.5 s = 3.25 s
+ call clearticks
+again325
+ call tickcount
+ Lminmax TICKS,D'162',D'162',again325,again325,end325
+end325
+
+ ; on est maintenant au centre du 1er bit
+ ; il suffit d'echantillonner toutes les 2.5s
+ movlw 1
+ movwf SLOT
+
+sample btfsc GPIO,SIGNAL ; logique negative
+ goto slot40
+
+ ; signal detecte !!
+ Bne not5,SLOT,D'5' ; slot == 5 ?
+ ; oui - 5 = passage en alerte
+ bsf GPIO,NORMAL ; bit a 1 = LED eteinte
+ bsf GPIO,EJP ; bit a 1 = LED eteinte
+ bcf GPIO,ALERTE ; bit a 0 = LED allumee
+ goto nextslot
+not5
+ Bne not15,SLOT,D'15' ; slot == 15 ?
+ ; oui
+ btfsc GPIO,ALERTE ; deja en alerte ?
+ goto endejp
+ ; oui - 5 & 15 = debut ejp
+ bsf GPIO,NORMAL ; bit a 1 = LED eteinte
+ bsf GPIO,ALERTE ; bit a 1 = LED eteinte
+ bcf GPIO,EJP ; bit a 0 = LED allumee
+ goto nextslot
+endejp
+ ; non - 15 seul = fin ejp
+ bsf GPIO,EJP ; bit a 1 = LED eteinte
+ bsf GPIO,ALERTE ; bit a 1 = LED eteinte
+ bcf GPIO,NORMAL ; bit a 0 = LED allumee
+ goto nextslot
+
+not15
+slot40
+ ; slot 40 ?
+ Bne nextslot,SLOT,D'40' ; slot == 40 ?
+ ; et attendre une nouvelle trame
+
+ goto attendre_trame
+nextslot
+ incf SLOT,F
+
+ ; si le signal est a 1, on en profite pour se resynchroniser
+ ; sur son front descendant, au cas ou l'emetteur ne soit pas
+ ; bien conforme au protocole.
+ btfss GPIO,SIGNAL
+ goto resynchro
+ ; attendre 125 ticks = 2.5s
+ call clearticks
+again125
+ call tickcount
+ Lminmax TICKS,D'125',D'126',again125,sample,again125
+
+resynchro
+ call waitnosignal
+ call clearticks
+again100 ; attente 2 s (100 ticks)
+ call tickcount
+ Lminmax TICKS,D'100',D'101',again100,sample,again100
+
+ end
+
+
diff --git a/kate/tests/highlight.abc b/kate/tests/highlight.abc
new file mode 100644
index 000000000..a7e45f751
--- /dev/null
+++ b/kate/tests/highlight.abc
@@ -0,0 +1,8 @@
+% Taken from http://www.gre.ac.uk/~c.walshaw/abc/#examples
+T:Paddy O'Rafferty
+C:Trad.
+M:6/8
+K:D
+dff cee|def gfe|dff cee|dfe dBA|dff cee|def gfe|faf gfe|1 dfe dBA:|2 dfe dcB||
+~A3 B3|gfe fdB|AFA B2c|dfe dcB|~A3 ~B3|efe efg|faf gfe|1 dfe dcB:|2 dfe dBA||
+fAA eAA|def gfe|fAA eAA|dfe dBA|fAA eAA|def gfe|faf gfe|dfe dBA:|
diff --git a/kate/tests/highlight.ahdl b/kate/tests/highlight.ahdl
new file mode 100644
index 000000000..e059aa804
--- /dev/null
+++ b/kate/tests/highlight.ahdl
@@ -0,0 +1,43 @@
+-- Test file for kate's syntax highlighting
+Title "Test file";
+
+-- BEGIN region (a region marker region) :)
+
+% multiline comment
+goes on here %
+
+-- END
+
+FUNCTION FCT (Clk, Key) RETURNS (pulse);
+
+SUBDESIGN CDCLOCK2
+(
+in : INPUT; -- go in
+out[3..0] : OUTPUT; -- come out
+)
+
+VARIABLE
+start : soft;
+usec[3..0] : node;
+
+BEGIN
+
+in = FCT(clock, some_key); -- senseless code
+
+-- comment
+blubb = (blobb[] == H"3ff");
+
+IF in THEN asdf
+-- folde me
+END IF;
+
+TABLE
+-- missing code
+END TABLE
+
+
+END;
+
+-- hex, octal, binary
+H"0" => B"1000000";
+O"01234567"; \ No newline at end of file
diff --git a/kate/tests/highlight.asm-avr b/kate/tests/highlight.asm-avr
new file mode 100644
index 000000000..dcffc153d
--- /dev/null
+++ b/kate/tests/highlight.asm-avr
@@ -0,0 +1,75 @@
+;********************************************************************
+;* LED flasher: LED will flash with a X on/off ratio at PD6
+;*
+;* NOTE: delay depends in the value of X, 1 is fast, 255 is slow
+;*
+;* No copyright ©1998 RES® * FREEWARE *
+;*
+;* NOTE: Connect a low current LED with a 1k resistor in serie from
+;* Vdd to pin 11 of the MCU. (Or a normal LED with a 330ohm)
+;*
+;* RES® can be reached by email: digitalaudio@mail.com
+;* or visit the website: http://home.wanadoo.nl/electro1/avr
+;*
+;* Version :1.0
+;* Date :12/26/98
+;* Author :Rob's ElectroSoft®
+;* Target MCU :AT90S1200-12PI@4MHz
+;********************************************************************
+
+.include "1200def.inc"
+
+ rjmp RESET ;reset handle
+
+
+;* Long delay
+
+;* Register variables
+
+ .def T1 = r1
+ .def T2 = r2
+ .def temp = r19
+
+;* Code
+
+longDelay:
+ clr T1 ;T1 used as delay 2nd count
+ clr T2 ;T2 used as delay 3d count
+delay_1:
+ dec T2
+ brne delay_1
+ dec T1
+ brne delay_1
+ dec temp ;temp must be preset as
+ brne delay_1 ; delay master count
+ ret
+
+
+;* Resets the data direction register D
+
+;* Defines
+
+ .equ led = 6 ;LED at PD6
+
+;* Code
+
+RESET:
+ sbi DDRD, led ;connect LED to PORTD pin 6
+
+
+;* Main program
+
+;* This part will let the LED go on and off by X
+
+;* Register variables
+
+ .equ X = 10 ;enter delaytime X
+
+flash:
+ sbi PORTD, led ;LED on
+ ldi temp, X ;X sec delay
+ rcall longDelay
+ cbi PORTD, led ;LED off
+ ldi temp, X ;X sec delay
+ rcall longDelay
+ rjmp flash ;another run \ No newline at end of file
diff --git a/kate/tests/highlight.asm-nasm b/kate/tests/highlight.asm-nasm
new file mode 100644
index 000000000..a5da4d1e8
--- /dev/null
+++ b/kate/tests/highlight.asm-nasm
@@ -0,0 +1,27 @@
+; Example file for nasm.xml kate syntax file
+; compile with `nasm example.asm -f elf -o example.o`
+; and link with 'gcc example.o -o example`
+; Public domain
+; kate: hl Intel x86 (NASM);
+
+section .data
+
+hello dd 'Hello World', 0x0A, 0h
+printf_param dd '%s', 0q
+
+section .text
+
+extern printf
+
+global main
+main:
+ push ebp
+ mov ebp, esp
+
+ push hello
+ push printf_param
+ call printf
+
+ mov eax, 0b
+ leave
+ ret
diff --git a/kate/tests/highlight.asp b/kate/tests/highlight.asp
new file mode 100644
index 000000000..07a8619e1
--- /dev/null
+++ b/kate/tests/highlight.asp
@@ -0,0 +1,58 @@
+<% 'kate: hl ASP;
+if ( instr(request.servervariables("PATH_INFO"),"login.asp") <= 0 and instr(request.servervariables("PATH_INFO"),"inset") <= 0 and instr(request.servervariables("PATH_INFO"),"Data") <= 0 and instr(request.servervariables("PATH_INFO"),"dropDown") <= 0 ) then
+ Session("originalRequestedPage") = Request.ServerVariables("PATH_INFO") & "?" & Request.ServerVariables("QUERY_STRING")
+end if
+
+function countRecords( rsToCount )
+ numRecs = 0
+
+ do until rsToCount.eof
+ numRecs = numRecs + 1
+
+ rsToCount.movenext
+ loop
+
+ rsToCount.close ' just to make sure nobody
+ ' tries to operate on the recordset,
+ ' which has already reached eof
+
+ countRecords = numRecs
+end function
+
+function unique( rs, sortColumn ) ' return unique instances of text in sortColumn within rs
+ dim sorted()
+
+ redim sorted(1)
+ dim i
+ i = 0
+ do until rs.eof
+ if (not find( rs(sortColumn), sorted )) then
+ redim preserve sorted(i+1)
+ sorted(i) = rs(sortColumn)
+ i = i + 1
+ end if
+ rs.MoveNext
+ loop
+
+ redim preserve sorted(i-1) ' the function will add an extra blank entry to the array
+
+ rs.Close ' close the recordset - we'll be using it again - and reset i - well be using it again, too
+
+ unique = sorted
+end function
+
+sub testSub( variable ) ' do nothing impressive...
+ dim newVar
+
+ newVar = variable
+
+ if ( variable = true )
+ response.end
+ else %>
+
+<p>We are writing text.</p>
+<p class="stuff"><%=newVar%></p>
+<p>We have written text and outputted a variable.</p>
+
+<% end if
+end sub %> \ No newline at end of file
diff --git a/kate/tests/highlight.awk b/kate/tests/highlight.awk
new file mode 100644
index 000000000..47f10cfcb
--- /dev/null
+++ b/kate/tests/highlight.awk
@@ -0,0 +1,28 @@
+#!/usr
+# AWK hl test
+
+# BEGIN and END are also matched as patterns
+BEGIN {
+ p = 0;
+}
+
+/some pattern/ {
+ p++;
+}
+
+# / inside brackets is not considered end of expression
+# a loose division operator (/) is not mismatched as a pattern.
+$1 =~ /[^abc/]def/ || b == 3 / 5 {
+
+ gsub ( FILENAME );
+
+}
+
+# TODO and FIXME also work in comments in Awk.
+
+# Also backslash in patterns works.
+/\/usr\/bin\/awk/ { print "This is me"; }
+
+END {
+ print p;
+}
diff --git a/kate/tests/highlight.bib b/kate/tests/highlight.bib
new file mode 100644
index 000000000..0ae404c2c
--- /dev/null
+++ b/kate/tests/highlight.bib
@@ -0,0 +1,31 @@
+% test file for kate's bibtex syntax highlighting
+
+@Article{artikel,
+author = {Me},
+title = {Something},
+journal = {JHEP},
+year = {2003},
+}
+
+@Book
+
+{
+
+boek,
+author = "Someone",
+title = "Something",
+journal = "Nucl. Phys. B",
+year = "2003",
+}
+
+This is ignored by BibTeX, no special highlighting
+%This is not a comment, it is just ignored (thanks to the people in #latex) :)
+
+@string{test="lange string die ik niet vaak opnieuw wil intikken"}
+
+@PhdThesis{thesis,
+author = {Me},
+title = {Dunno},
+school = {ITFA},
+year = {2005, hopefully},
+}
diff --git a/kate/tests/highlight.cmake b/kate/tests/highlight.cmake
new file mode 100644
index 000000000..cb8eaaa51
--- /dev/null
+++ b/kate/tests/highlight.cmake
@@ -0,0 +1,48 @@
+#this CMakeLists.txt doesn't do anything useful, but it shoudl demonstrate the cmake syntax highlighting
+#Alexander Neundorf <neundorf@kde.org>
+
+#ok this is a comment
+#and another line
+#a built-in command, it's bold black
+ADD_DEFINITIONS(-Wall -Wctor-dtor-privacy -Woverloaded-virtual -Wno-long-long -pipe -fno-builtin -fno-exceptions)
+
+#and another function
+INCLUDE_DIRECTORIES(
+#comments are also highlighted inside function parameters
+#variables are blue
+${CMAKE_CURRENT_SOURCE_DIR}/../../lib/qt4/include/Qt
+)
+
+# BEGIN defining a macro
+MACRO(ECOS_ADD_EXECUTABLE _exe_NAME )
+
+#special parameters are italic, see the STATIC in the next line
+ADD_LIBRARY(${_exe_NAME} STATIC ${ARGN})
+#but not in the following line ?
+ ADD_LIBRARY(${_exe_NAME} STATIC ${ARGN})
+
+
+#another command with a bunch of variables and special parameters
+ ADD_CUSTOM_COMMAND(
+ TARGET ${_exe_NAME}
+ PRE_LINK
+ COMMAND ${CMAKE_C_COMPILER}
+ ARGS -o ${_exe_NAME}
+$\(${_exe_NAME}_SRC_OBJS\) -nostdlib -nostartfiles -Lecos/install/lib -Ttarget.ld
+ )
+
+#add the created files to the make_clean_files
+ SET(ECOS_ADD_MAKE_CLEAN_FILES ${ECOS_ADD_MAKE_CLEAN_FILES};${_exe_NAME};)
+#and another command...
+ SET_DIRECTORY_PROPERTIES(
+ PROPERTIES
+ ADDITIONAL_MAKE_CLEAN_FILES "${ECOS_ADD_MAKE_CLEAN_FILES}"
+ )
+ENDMACRO(ECOS_ADD_EXECUTABLE)
+# END of macro
+
+#calling a self-defined function, variables are also blue here
+ECOS_ADD_EXECUTABLE(${PROJECT_NAME} ${the_sources} ${qt4_moc_SRCS})
+
+
+
diff --git a/kate/tests/highlight.css b/kate/tests/highlight.css
new file mode 100644
index 000000000..126fa4d02
--- /dev/null
+++ b/kate/tests/highlight.css
@@ -0,0 +1,49 @@
+/**
+ * This is a pseudo CSS file to test Kate's CSS syntax highlighting.
+ */
+
+@import url("othersheet.css") screen, tv;
+
+body {
+ font-size: 15pt;
+ font-family: Verdana, Helvetica, "Bitstream Vera Sans", sans-serif;
+ margin-top: 0px; /* yet another comment */
+ margin-bottom: 0px;
+ // this is no comment, it's just broken!
+ margin-left: 0px;
+ margin-right: 0px;
+}
+
+.something
+{
+ margin-right: 0px;
+ color: #cdd;
+ color: #AAFE04;
+ color: rgb(10%,30%,43%);
+ background: maroon;
+}
+
+a:hover {
+}
+
+#header,
+p.intro:first-letter,
+p:lang(nl),
+img[align="right"]
+{
+ border: 1px solid red !important;
+ -moz-border-radius: 15px; /* unknown properties render italic */
+}
+
+@media print {
+
+ #header
+ {
+ display: none;
+ }
+
+}
+
+/*
+TODO: add more tests, e.g. media
+*/
diff --git a/kate/tests/highlight.do b/kate/tests/highlight.do
new file mode 100644
index 000000000..0b90b16b6
--- /dev/null
+++ b/kate/tests/highlight.do
@@ -0,0 +1,89 @@
+/* Test file for kate's stata syntax highlighting
+*/
+*! version 1.2.0 2mar2003 E. Leuven
+program define spellsplit
+ version 7
+ syntax [anything], spell(varlist min=2 max=2) [ by(varlist)]
+ tokenize `spell'
+ local date0 `1'
+ local date1 `2'
+ local f0 : format `date0'
+ local f1 : format `date1'
+
+ /* set default statistic */
+ local current "mean"
+
+ gettoken left anything : anything, match(prns)
+ while "`left'"!="" {
+ if "`prns'"!="" {
+ if !inlist("`left'","mean","sum") {
+ di as error "Statistic `left' not supported"
+ exit 198
+ }
+ local current "`left'"
+ }
+ else {
+ local `current'vars ``current'vars' `left'
+ }
+ gettoken left anything : anything, match(prns)
+ }
+ if ("`meanvars'"!="") {
+ confirm var `meanvars'
+ unab meanvars : `meanvars'
+ }
+ if ("`sumvars'"!="") {
+ confirm var `sumvars'
+ unab sumvars : `sumvars'
+ }
+
+ quietly {
+ g _count = 1
+ local xvars `meanvars' `sumvars' _count
+
+ /* create dummy by-var if no by option is specified */
+ if "`by'"=="" {
+ tempvar by
+ g byte `by' = 1
+ }
+ tempvar `xvars' `by'
+
+ /* create negative for subtraction when spell ends */
+ cap foreach v of varlist `xvars' {
+ g double ``v'' = -`v'
+ local txvars `txvars' ``v''
+ }
+ cap foreach v of varlist `by' {
+ g double ``v'' = `v'
+ local txvars `txvars' ``v''
+ }
+
+ stack `date0' `xvars' `by' `date1' `txvars', into(`date0' `xvars' `by') clear
+
+ /* calculate totals per date */
+ cap foreach v of varlist `xvars' {
+ egen double ``v'' = sum(`v'), by(`by' `date0')
+ }
+
+ /* unique dates only */
+ by `by' `date0', sort: keep if _n==1
+
+ /* calculate totals (+ when spell starts - when ends) */
+ sort `by'
+ cap foreach v of varlist `xvars' {
+ by `by': replace `v' = sum(``v'')
+ }
+ by `by': g `date1' = `date0'[_n + 1]
+
+ drop if `date0'>`date1'
+ drop _stack
+ drop if _count==0
+ order `by' `date0' `date1' `xvars'
+ format `date0' `f0'
+ format `date1' `f1'
+
+ cap for var `meanvars': replace X = X/_count
+
+ compress
+ }
+
+end \ No newline at end of file
diff --git a/kate/tests/highlight.dox b/kate/tests/highlight.dox
new file mode 100644
index 000000000..39b404fe2
--- /dev/null
+++ b/kate/tests/highlight.dox
@@ -0,0 +1,227 @@
+This is a pseudo doxygen file to test Kate's doxyge syntax highlighting.
+
+Normal text, no HL.
+===================
+a multiline comment may begin with a /*! */, too. That should work,
+because it is the same "entrance rule".
+
+popping tests:
+/** multiline */ end of doxygen HL mode
+/*! multiline */ end of doxygen HL mode
+//! singleline, where */ should be ignored! still doxygen HL mode
+/// singleline, where */ should be ignored! still doxygen HL mode
+///< singleline, where */ should be ignored! still doxygen HL mode
+begin and end immediately:
+/********/ actually no doxygen comment - used for "info boxes" :)
+/**/ <-- it really works --- end of doxygen HL mode
+/*!*/ end of doxygen HL mode
+
+<tag> <normal comment HL>
+/** \code rest of line is normal comment HL */ end of doxygen HL mode
+/** \code rest of line is normal comment HL
+ * comment HL mode
+ */ end of doxygen HL mode
+
+<tag> <word> <normal comment HL>
+/** \file aword rest of line is normal comment HL */ end of doxygen HL mode
+/** \file */aword <-- pop! no doxygen HL mode
+/** \file aword rest of line is normal comment HL
+ * comment HL mode
+ */ end of doxygen HL mode
+
+<tag> <rest of line is string>
+/** \brief A short description */ end of doxygen HL mode
+/** \brief */A <-- pop! end of doxygen HL mode
+/** \brief A short description
+ * comment HL mode
+ */ end of doxygen HL mode
+
+<tag> <word> <rest of line is string>
+/** \page aword rest of line is string */ end of doxygen HL mode
+/** \page */aword <-- pop! end of doxygen HL mode
+/** \page aword rest of line is string
+ * comment HL mode
+ */ end of doxygen HL mode
+
+<tag> <word> <word> <normal comment HL>
+/** \image aword aword rest of line is normal HL */ end of doxygen HL mode
+/** \image aword */aword <-- pop! end of doxygen HL mode
+/** \image */aword aword <-- pop! end of doxygen HL mode
+/** \image aword aword rest of line is normal HL
+ * comment HL mode
+ */ end of doxygen HL mode
+
+Tests for HTML tags in doxygen HL mode:
+=======================================
+/** <a href="blubb" href='blubb'> */ end of doxygen HL mode
+/** <a href="blubb" href='blubb'*/> end of doxygen HL mode
+/** <a href="blubb" href='blubb*/'> end of doxygen HL mode
+/** <a href="blubb" href='blub*/b'> end of doxygen HL mode
+/** <a href="blubb" href='b*/lubb'> end of doxygen HL mode
+/** <a href="blubb" href='*/blubb'> end of doxygen HL mode
+/** <a href="blubb" href=*/'blubb'> end of doxygen HL mode
+/** <a href="blubb" href*/='blubb'> end of doxygen HL mode
+/** <a href="blubb" hre*/f='blubb'> end of doxygen HL mode
+/** <a href="blubb" */href='blubb'> end of doxygen HL mode
+/** <a href="blubb"> */ end of doxygen HL mode
+/** <a href="blubb"*/> end of doxygen HL mode
+/** <a href="blubb*/"> end of doxygen HL mode
+/** <a href="blub*/b"> end of doxygen HL mode
+/** <a href="*/blubb"> end of doxygen HL mode
+/** <a href=*/"blubb"> end of doxygen HL mode
+/** <a href*/="blubb"> end of doxygen HL mode
+/** <a h*/ref="blubb"> end of doxygen HL mode
+/** <a */href="blubb"> end of doxygen HL mode
+/** <a*/ href="blubb"> end of doxygen HL mode
+/** <*/a href="blubb"> end of doxygen HL mode
+
+//! <a href="blubb" href='blubb'> */ stay in doygen HL mode
+//! <a href="blubb" href='blubb'*/> stay in doygen HL mode
+//! <a href="blubb" href='blubb*/'> stay in doygen HL mode
+//! <a href="blubb" href='blu*/bb'> stay in doygen HL mode
+//! <a href="blubb" href='*/blubb'> stay in doygen HL mode
+//! <a href="blubb" href=*/'blubb'> stay in doygen HL mode
+//! <a href="blubb"> */ stay in doygen HL mode
+//! <a href="blubb"*/> stay in doygen HL mode
+//! <a href="blubb*/"> stay in doygen HL mode
+//! <a href="blub*/b"> stay in doygen HL mode
+//! <a href="*/blubb"> stay in doygen HL mode
+//! <a href=*/"blubb"> stay in doygen HL mode
+//! <a href*/="blubb"> stay in doygen HL mode
+//! <a h*/ref="blubb"> stay in doygen HL mode
+//! <a */href="blubb"> stay in doygen HL mode
+//! <a*/ href="blubb"> stay in doygen HL mode
+//! <*/a href="blubb"> stay in doygen HL mode
+//! <a href="blubb"> stay in doygen HL <mode
+here should be normal HL mode (no doxygen!)
+
+Tests for HTML tags in doxygen HL mode with tags:
+=================================================
+<tag> <normal comment HL>
+/** \code rest <a href="blubb"> of </a href='blubb'> line is normal comment HL */ end of doxygen HL mode
+/** \code rest <a href="blubb"> of </a href='blubb'*/> end of doxygen HL mode
+/** \code rest <a href="blubb"> of </a href='blubb*/'> end of doxygen HL mode
+/** \code rest <a href="blubb"> of </a href='*/blubb'> end of doxygen HL mode
+/** \code rest <a href="blubb"> of </a href=*/'blubb'> end of doxygen HL mode
+/** \code rest <a href="blubb*/"> of </a href=*/'blubb'> end of doxygen HL mode
+/** \code rest <a href=*/"blubb"> of </a href='blubb'> end of doxygen HL mode
+/** \code rest <a h*/ref="blubb"> of </a href='blubb'> end of doxygen HL mode
+/** \code rest <*/a href="blubb"> of </a href='blubb'> end of doxygen HL mode
+/** \code rest of line is normal comment HL
+ * comment HL mode <html> text </html>
+ */ end of doxygen HL mode
+
+<tag> <word> <normal comment HL>
+/** \file awo<html_should_be_ignored_here>rd rest of line is normal comment HL */ end of doxygen HL mode
+/** \file awo<html_should_be_ignored_here>*/rd end of doxygen HL mode
+/** \file awo<html_should_be_i*/gnored_here>rd end of doxygen HL mode
+/** \file awo<*/html_should_be_ignored_here>rd end of doxygen HL mode
+/** \file a*/wo<html_should_be_ignored_here>rd end of doxygen HL mode
+/** \file aword rest of line is normal co<code>mment HL
+ * comment HL mode
+ */ end of doxygen HL mode
+
+<tag> <rest of line is string>
+/** \brief A short <a href="blubb"> of </a href='blubb'> description */ end of doxygen HL mode
+/** \brief A short <a href="blubb"> of </a href='blubb'*/> end of doxygen HL mode
+/** \brief A short <a href="blubb"> of </a href='*/blubb'> end of doxygen HL mode
+/** \brief A short <a href="blubb"> of </a href=*/'blubb'> end of doxygen HL mode
+/** \brief A short <a href="blubb"> of </a href*/='blubb'> end of doxygen HL mode
+/** \brief A short <a href="blubb"> of </a */href='blubb'> end of doxygen HL mode
+/** \brief A short <a href="blubb"> of <*//a href='blubb'> end of doxygen HL mode
+/** \brief A short <a href="blubb"*/> of </a href='blubb'> end of doxygen HL mode
+/** \brief A short <a href="blubb*/"> of </a href='blubb'> end of doxygen HL mode
+/** \brief A short <a href="*/blubb"> of </a href='blubb'> end of doxygen HL mode
+/** \brief A short <a href=*/"blubb"> of </a href='blubb'> end of doxygen HL mode
+/** \brief A short <a href*/="blubb"> of </a href='blubb'> end of doxygen HL mode
+/** \brief A short <a h*/ref="blubb"> of </a href='blubb'> end of doxygen HL mode
+/** \brief A short <a href="blubb"> of </a href='blubb'> description
+ * comment HL mode
+ */ end of doxygen HL mode
+
+<tag> <word> <rest of line is string>
+/** \page aword A short <a href="blubb"> of </a href='blubb'> description */ end of doxygen HL mode
+/** \page aword A short <a href="blubb"> of </a href='blubb'*/> end of doxygen HL mode
+/** \page aword A short <a href="blubb"> of </a href='*/blubb'> end of doxygen HL mode
+/** \page aword A short <a href="blubb"> of </a href=*/'blubb'> end of doxygen HL mode
+/** \page aword A short <a href="blubb"> of </a href*/='blubb'> end of doxygen HL mode
+/** \page aword A short <a href="blubb"> of </a */href='blubb'> end of doxygen HL mode
+/** \page aword A short <a href="blubb"> of <*//a href='blubb'> end of doxygen HL mode
+/** \page aword A short <a href="blubb"*/> of </a href='blubb'> end of doxygen HL mode
+/** \page aword A short <a href="blubb*/"> of </a href='blubb'> end of doxygen HL mode
+/** \page aword A short <a href="*/blubb"> of </a href='blubb'> end of doxygen HL mode
+/** \page aword A short <a href=*/"blubb"> of </a href='blubb'> end of doxygen HL mode
+/** \page aword A short <a href*/="blubb"> of </a href='blubb'> end of doxygen HL mode
+/** \page aword A short <a h*/ref="blubb"> of </a href='blubb'> end of doxygen HL mode
+/** \page aword A short <*/a href="blubb"> of </a href='blubb'> end of doxygen HL mode
+/** \page aword A shor*/t <a href="blubb"> of </a href='blubb'> end of doxygen HL mode
+/** \page awor*/d A short <a href="blubb"> of </a href='blubb'> end of doxygen HL mode
+/** \page */aword A short <a href="blubb"> of </a href='blubb'> end of doxygen HL mode
+/** \page aword A short <a href="blubb"> of </a href='blubb'> description
+ * comment HL mode
+ */ end of doxygen HL mode
+
+<tag> <word> <word> <rest of line is string>
+/** \image aword aword rest of line is normal HL */ end of doxygen HL mode
+/** \image aword aword rest of line is*/ end of doxygen HL mode
+/** \image aword aword*/ end of doxygen HL mode
+/** \image aword aw*/ord end of doxygen HL mode
+/** \image aword */aword end of doxygen HL mode
+/** \image aword*/ end of doxygen HL mode
+/** \image awo*/rd end of doxygen HL mode
+/** \image */aword end of doxygen HL mode
+/** \ima*/ge end of doxygen HL mode
+/** \image aword aword rest of line is normal HL
+ * comment HL mode
+ */ end of doxygen HL mode
+
+Some further tests for singlelinecomments (* / should not pop!)
+===============================================================
+/// a singlelinecommment blubb blubb */. stay in doxygen HL mode
+/// \code a singlelinecommment blubb b*/lubb. stay in doxygen HL mode
+/// \code*/ a singlelinecommment blubb blubb. stay in doxygen HL mode
+/// \code a singlelinecommment blubb blubb
+/// \brief a descriptive text (string) stay in doxygen HL mode
+/// \brief a descriptive text (string)*/ description should go on here
+/// \brief a descriptive text */(string) description should go on here
+/// \brief */a descriptive text (string) description should go on here
+/// \ref aword a descriptive text (string) */ description should go on here
+/// \ref aword a descriptive text (str*/ing) description should go on here
+/// \ref aword a des*/criptive text (string) description should go on here
+/// \ref aword*/ a descriptive text (string) description should go on here
+/// \ref aw*/ord a descriptive text (string) description should go on here
+/// \ref */aword a descriptive text (string) description should go on here
+
+HTML comment tests:
+===================
+//! \ref word de<!--*/ -->scriptive text (string)
+normal HL mode.
+//! \ref w descriptive text (string)
+/** \ref word de<!--*/ -->scriptive text (string)
+normal HL mode.
+/** \ref w <!--
+ * HTML comments
+ * -->
+ * normal doxygen HL mode.
+ */
+
+
+And final tests for a word: a single char:
+===========================================
+<tag> <word> <rest of line as string>
+//! \ref word descriptive text (string)
+//! \ref w descriptive text (string)
+
+<tag> <word> <word> <rest is normal HL>
+//! \image word1 word2 b descriptive text (string)
+//! \image a word b descriptive text (string)
+
+<tag> <rest of line is string>
+//! \brief A b c d e description should go on here
+
+<tag> <word> <rest of line is normal doxygen HL mode>
+//! \file word rest of line is normal comment HL
+//! \file a word rest of line is normal comment HL
+
+no doxygen HL mode here.
+== END OF TESTFILE == \ No newline at end of file
diff --git a/kate/tests/highlight.e b/kate/tests/highlight.e
new file mode 100644
index 000000000..6f07c8385
--- /dev/null
+++ b/kate/tests/highlight.e
@@ -0,0 +1,90 @@
+<'
+
+extend TB_NAME_T : [ ETRC ];
+
+extend fifo {
+ keep soft testbench == ETRC;
+};
+
+extend ETRC fifo {
+
+ keep direction == POP;
+ keep soft type == CLASSIC;
+
+ keep PORT_DATAOUT == appendf("esa_data[%d]" , id);
+ keep PORT_POP_EMPTY == appendf("fifo_empty[%d]", id);
+ keep PORT_POP_ALMOST_EMPTY == appendf("ESA_PopAE[%d]" , id);
+ keep PORT_POP_ALMOST_FULL == appendf("ESA_PopAF[%d]" , id);
+ keep PORT_POP_FULL == "";
+ keep PORT_POP_ERROR == "";
+ keep PORT_POP_REQ == appendf("etrc_popreq_n[%d]" , id);
+ keep soft PORT_POP_CLK == "sysclk";
+ keep soft PORT_PUSH_CLK == "sysclk";
+
+// keep logger.verbosity == HIGH;
+
+
+ reset_sig() is {
+ injector.reset_sig();
+ '(PORT_DATAOUT)' = 0;
+ '(PORT_POP_EMPTY)' = 0;
+ '(PORT_POP_ALMOST_EMPTY)' = 0;
+ '(PORT_POP_ALMOST_FULL)' = 0;
+ '(PORT_POP_REQ)' = 0;
+ '(PORT_POP_CLK)' = 0;
+ '(PORT_POP_CLK)' = 1;
+ };
+
+ event clkSys is rise('sysclk');
+ event bug001 is true('pkdescnt[0]' == 1)@clkSys;
+
+ on bug001
+ {
+ dut_error("Bug 001 found ... crash!");
+ };
+
+};
+
+
+
+extend ETRC FIFO_INJECTOR {
+
+ pkt_desc_if : pkt_desc_if is instance;
+ keep pkt_desc_if.MAC_uid == id;
+
+ add_new_pkt_desc() is also {
+ pkt_desc_if.indicate_one_pck_desc_is_come_in_FIFO();
+ };
+
+ reset_sig() is {
+ pkt_desc_if.reset_sig();
+ };
+
+};
+
+extend ETRC CLASSIC fifo
+{
+
+ keep ae_seuil == 1;
+ keep af_seuil == 46;
+ keep fifo_size == 56;
+
+
+
+ setState() is also
+ {
+ if (fifo_plot &&(sys.time > 200000) && // avoid fifo plot before beginning of operation of RAMC
+ !((injector.generated_packet_nb == injector.max_generated_packets && injector.stream.size() == 0)
+ || injector.generated_packet_nb == 0))
+ {
+ if (fifo_use_logger) {
+ messagef(HIGH, "ETRC[%d] : %d\n", id, fifo.size());
+ }
+ else {
+ out("__fifo_plot: ", sys.time, " ", fifo.size() );
+ };
+ };
+ };
+};
+
+'>
diff --git a/kate/tests/highlight.exu b/kate/tests/highlight.exu
new file mode 100644
index 000000000..3651adf33
--- /dev/null
+++ b/kate/tests/highlight.exu
@@ -0,0 +1,97 @@
+-- Test file for Kate's Euphoria syntax highlighting/code folding.
+-- BEGIN region marker test
+
+-- code here
+
+-- END region marker test
+
+-- The N Queens Problem:
+-- Place N Queens on an NxN chess board
+-- such that they don't threaten each other.
+constant N = 8 -- try some other sizes
+constant ROW = 1, COLUMN = 2
+constant TRUE = 1, FALSE = 0
+type square(sequence x)
+-- a square on the board
+ return length(x) = 2
+end type
+type row(integer x)
+-- a row on the board
+ return x >= 1 and x <= N
+end type
+
+function threat(square q1, square q2)
+-- do two queens threaten each other?
+ if q1[COLUMN] = q2[COLUMN] then
+ return TRUE
+ elsif q1[ROW] - q1[COLUMN] = q2[ROW] - q2[COLUMN] then
+ return TRUE
+ elsif q1[ROW] + q1[COLUMN] = q2[ROW] + q2[COLUMN] then
+ return TRUE
+ elsif q1[ROW] = q2[ROW] then
+ return TRUE
+ else
+ return FALSE
+ end if
+end function
+
+function conflict(square q, sequence queens)
+-- Would square p cause a conflict with other queens on board so far?
+ for i = 1 to length(queens) do
+ if threat(q, queens[i]) then
+ return TRUE
+ end if
+ end for
+ return FALSE
+end function
+
+integer soln
+soln = 0 -- solution number
+
+procedure print_board(sequence queens)
+-- print a solution, showing the Queens on the board
+ integer k
+ position(1, 1)
+ printf(1, "Solution #%d\n\n ", soln)
+ for c = 'a' to 'a' + N - 1 do
+ printf(1, "%2s", c)
+ end for
+ puts(1, "\n")
+ for r = 1 to N do
+ printf(1, "%2d ", r)
+ for c = 1 to N do
+ if find({r,c}, queens) then
+ puts(1, "Q ")
+ else
+ puts(1, ". ")
+ end if
+ end for
+ puts(1, "\n")
+ end for
+ puts(1, "\nPress Enter. (q to quit) ")
+ while TRUE do
+ k = get_key()
+ if k = 'q' then
+ abort(0)
+ elsif k != -1 then
+ exit
+ end if
+ end while
+end procedure
+
+procedure place_queen(sequence queens)
+-- place queens on a NxN chess board
+-- (recursive procedure)
+ row r -- only need to consider one row for each queen
+ if length(queens) = N then
+ soln += 1
+ print_board(queens)
+ return
+ end if
+ r = length(queens)+1
+ for c = 1 to N do
+ if not conflict({r,c}, queens) then
+ place_queen(append(queens, {r,c}))
+ end if
+ end for
+end procedure
diff --git a/kate/tests/highlight.f90 b/kate/tests/highlight.f90
new file mode 100644
index 000000000..e2008c20a
--- /dev/null
+++ b/kate/tests/highlight.f90
@@ -0,0 +1,181 @@
+! This file is an example to test the syntax highlighting file F.xml
+! (for fortran 90 and F)
+
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+! THIS IS AN EXAMPLE OF A MODULE !
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+module module_example
+
+ ! use 'implicit none' when you want all variables to be declared
+ implicit none
+
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+! PUBLICS AND PRIVATES
+
+ ! In fortran 90 you can define your own operator
+ public :: operator(.norm.)
+ public :: operator(+) ! <-- you can also overload the usual operators
+ public :: factorial
+ public :: example_fn
+
+ private :: point3d_add
+ private :: point3d_norm
+
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+! USER-DEFINED TYPES...
+
+ ! This is a definition to use in declarations of real variables,
+ ! parameters, etc.
+ integer, parameter, public :: kr = selected_real_kind(10)
+
+ ! This is a user-defined type
+ type, public :: point3d
+ real(kind=kr) :: x, y, z
+ end type point3d
+
+ ! This type is useless: it is only an example of type definition!
+ type, public :: example_type
+ complex(kind=kr) :: c ! <-- a complex number (two reals of kind kr)!
+ real, dimension(-10:10) :: & ! <-- this line does not end here!
+ r1, r2 ! <-- this is the final part of the previous line
+ real, pointer, dimension(:) :: pointer_to_array_of_real
+ real, dimension(:), pointer :: array_of_pointer_to_real
+ end type example_type
+
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+! INTERFACES...
+
+ ! Interface for the norm of a 3-D vector
+ interface operator(.norm.)
+ module procedure point3d_norm
+ end interface
+
+ ! Interface for the operator '+'
+ interface operator(+)
+ module procedure point3d_add
+ end interface
+
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+! SOME DECLARATIONS...
+
+ ! A real number can be declared with the following line:
+ real(kind=kr) :: real_var1
+ ! But if you are not interested on the precision of floating point numbers,
+ ! you can use simply:
+ real :: real_var2
+
+ ! An array can be declared in two ways:
+ real(kind=kr), dimension(1:10, -4:5), private :: a, b, c
+ real(kind=kr), private :: d(1:10, -4:5)
+
+ ! This is a string with fixed lenght
+ character(len=10) :: str_var
+
+ ! This is an allocatable array, which can be a target of a pointer
+ type(example_type), private, dimension(:), allocatable, target :: &
+ many_examples
+
+! Fortran 90 hasn't got its own preprocessor, it uses the C preprocessor!
+#ifdef XXX
+c <-- this is a comment in the old fortran 77 style (fixed form)
+c This is a free form file, so we shouldn't use this kind of comments!
+c But fortran 90 still understands fixed form, when parsing sources with
+c the *.f extension.
+ c ! <-- this 'c' shouldn't be highlighted as a comment!
+#endif
+
+contains
+
+
+ ! The sum of two points
+ pure function point3d_add(a, b) result(rs)
+ type(point3d) :: rs
+ type(point3d), intent(in) :: a, b
+ rs%x = a%x + b%x
+ rs%y = a%y + b%y
+ rs%z = a%z + b%z
+ end function point3d_add
+
+
+ ! The norm of a point
+ pure function point3d_norm(a) result(rs)
+ real(kind=kr) :: rs
+ type(point3d), intent(in) :: a
+ rs = sqrt(a%x * a%x + a%y * a%y + a%z * a%z)
+ end function point3d_norm
+
+
+ ! A simple recursive function
+ recursive function factorial(i) result (rs)
+ integer :: rs
+ integer, intent(in) :: i
+ if ( i <= 1 ) then
+ rs = 1
+ else
+ rs = i * factorial(i - 1)
+ end if
+ end function factorial
+
+
+ ! This is a useless function
+ subroutine example_fn(int_arg, real_arg, str_arg)
+ integer, intent(in) :: int_arg
+ real(kind=kr), intent(out) :: real_arg
+ character(len=*), intent(in) :: str_arg
+
+ type(example_type), pointer :: p
+ integer :: n, i, j
+ logical :: flag
+
+ flag = .true. ! .true. is not an operator!
+ if ( flag .and. flag ) then ! .and. is a pre-defined operator
+ print *, "blabla"
+ end if
+
+ ! Examples of inquiry functions: allocated, lbound, ubound.
+ if ( .not. allocated(many_examples) ) then
+ allocate( many_examples(10) )
+ end if
+ print *, "Lower bound = ", lbound(many_examples, 1)
+ print *, "Upper bound = ", ubound(many_examples, 1)
+
+ p => many_examples(5) ! <-- p is a pointer
+
+ ! A strange way to calculate i*i: add the first i odd numbers
+ i = 6
+ j = 0
+ do n = 1, i
+ j = j + (2*n - 1)
+ end do
+ print *, "i*i = ", i*i, j
+
+ real_arg = real(j) ! <-- here the highlighting is not very good:
+ ! it is unable to distinguish between this and a definition like:
+ ! real(kind=kr) :: a
+ deallocate( many_examples )
+ end subroutine example_fn
+
+end module module_example
+
+
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+! THIS IS THE MAIN PROGRAM !
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+program example
+ use module_example
+
+ ! this is another example of use of the 'implicit' keyword
+ implicit double precision (a-h,o-z)
+
+ real(kind=kr) :: var_out
+
+ type(point3d) :: &
+ a = point3d(0.0_kr, 1.0_kr, 2.0_kr), &
+ b = point3d(4.0_kr, 5.0_kr, 6.0_kr)
+
+ print *, "a + b = ", .norm. (a + b)
+ print *, "factorial of 5 = ", factorial(5)
+
+ call example_fn(1, var_out, "hello!")
+
+end program example
diff --git a/kate/tests/highlight.glsl b/kate/tests/highlight.glsl
new file mode 100644
index 000000000..3495757b6
--- /dev/null
+++ b/kate/tests/highlight.glsl
@@ -0,0 +1,62 @@
+// This is a test file for the Katepart GLSL Syntax Highlighting.
+
+normal text
+// this is a single-line comment
+normal text
+/* this
+is a multi-line
+comment */
+normal text
+
+some_symbol.some_member;
+some_symbol.some_member_function();
+some_function();
+
+// this is a function
+void main()
+{
+ float f = 1.4e3; // decimal float literal
+ int i1 = 2884; // decimal int literal
+ int i2 = 0x44; // hex int literal
+ int i3 = 0456; // octal int literal
+}
+
+// this is a structure
+struct some_struct
+{
+ vec3 some_member_vector;
+};
+
+# this is
+#preprocessor code
+
+// all keywords
+break continue do for while
+if else
+true false
+discard return
+struct
+
+// all basic types
+float int void bool
+mat2 mat3 mat4
+vec2 vec3 vec4
+ivec2 ivec3 ivec4
+bvec2 bvec3 bvec4
+sampler1D sampler2D sampler3D
+samplerCube sampler1DShadow sampler1DShadow
+
+// all type qualifiers
+attribute const uniform varying
+in out inout
+
+// attensions:
+// FIXME
+// TODO
+// BUG
+
+// some of the std functions
+radians degrees sin cos tan asin acos atan
+
+// some of the std variables
+gl_Position gl_PointSize gl_ClipVertex
diff --git a/kate/tests/highlight.hs b/kate/tests/highlight.hs
new file mode 100644
index 000000000..057a3f3fc
--- /dev/null
+++ b/kate/tests/highlight.hs
@@ -0,0 +1,124 @@
+-- test file for Haskell syntax highlighting in KDE's Kate
+
+-- The test file for literate Haskell can be easily created like this:
+-- cat highlight.hs | sed -e "s|^|> |" -e "s|> -- ||" -e "s|^> $||" > highlight.lhs
+-- You only have to manually edit the multi-line comment below.
+
+-- this is a single-line comment
+
+{- this is a multi-line comment
+
+Things like "a string" or a 'c' character shouldn't be highlighted in here.
+
+-- I could even start a new
+-- one-line comment.
+
+-}
+
+-- a data definition
+
+data Tree a = Br (Tree a) (Tree a) | Leaf a | Nil deriving (Show, Eq)
+
+
+-- function definition, "funnyfunction::", "Integer", "Int", "Bool" should be highlighted
+
+funnyfunction::(Tree a)=>[a]->Integer->Int->Bool
+
+
+-- strings and chars
+-- first line of function definitions (type declaration) should be highlighted
+
+strangefunction::Int->String
+strangefunction 1 = "hello"
+strangefunction 2 = "what's up"
+strangefunction 3 = (strangefunction 1) ++ ", " ++ (strangefunction 2)
+strangefunction 4 = 'a':'b':'c':'"':[] -- will return "abc"
+strangefunction 5 = '\n':[]
+strangefunction 6 = '\invalidhaskell':[]
+
+-- function name including the single quote character
+-- and infix operator (`div`)
+
+justtesting'::Int->Int
+justtesting' 2 = 2+1
+justtesting' 9 = 7 `div` 2
+
+-- same definition as above, slightly different function name and a couple more whitespaces
+
+justtesting'' :: Int -> Int
+justtesting'' 2 = 3
+justtesting'' 9 = 3 + 9 - 9
+
+-- the following lines are copied out of Haskell's "Prelude.hs"
+
+infixl 7 *, /, `quot`, `rem`, `div`, `mod`, :%, %
+
+
+-- everything highlighted except the "a"
+
+class Bounded a where
+ minBound, maxBound :: a
+
+class (Num a, Ord a) => Real a where
+ toRational :: a -> Rational
+
+-- finally, some keyword lists
+
+-- keywords
+
+case, class, data, deriving, do, else, if, in, infixl, infixr, instance, let, module, of, primitive,
+then, type, where
+
+-- infix operators
+
+quot, rem, div, mod, elem, notElem, seq
+
+-- this stuff is not handled yet
+
+!!, %, &&, $!, $, *, **, -,., /=, <, <=, =<<, ==, >, >=, >>, >>=, ^, ^^, ++, ||
+
+-- functions
+
+FilePath, IOError, abs, acos, acosh, all, and, any, appendFile,
+approxRational, asTypeOf, asin, asinh, atan, atan2, atanh, basicIORun,
+break, catch, ceiling, chr, compare, concat, concatMap, const, cos, cosh,
+curry, cycle, decodeFloat, denominator, digitToInt, div, divMod, drop,
+dropWhile, either, elem, encodeFloat, enumFrom, enumFromThen,
+enumFromThenTo, enumFromTo, error, even, exp, exponent, fail, filter, flip,
+floatDigits, floatRadix, floatRange, floor, fmap, foldl, foldl1, foldr,
+foldr1, fromDouble, fromEnum, fromInt, fromInteger, fromIntegral,
+fromRational, fst, gcd, getChar, getContents, getLine, head, id, inRange,
+index, init, intToDigit, interact, ioError, isAlpha, isAlphaNum, isAscii,
+isControl, isDenormalized, isDigit, isHexDigit, isIEEE, isInfinite, isLower,
+isNaN, isNegativeZero, isOctDigit, isPrint, isSpace, isUpper, iterate, last,
+lcm, length, lex, lexDigits, lexLitChar, lines, log, logBase, lookup, map,
+mapM, mapM_, max, maxBound, maximum, maybe, min, minBound, minimum, mod,
+negate, not, notElem, null, numerator, odd, or, ord, otherwise, pi, pred,
+primExitWith, print, product, properFraction, putChar, putStr, putStrLn,
+quot, quotRem, range, rangeSize, read, readDec, readFile, readFloat,
+readHex, readIO, readInt, readList, readLitChar, readLn, readOct, readParen,
+readSigned, reads, readsPrec, realToFrac, recip, rem, repeat, replicate,
+return, reverse, round, scaleFloat, scanl, scanl1, scanr, scanr1, seq,
+sequence, sequence_, show, showChar, showInt, showList, showLitChar,
+showParen, showSigned, showString, shows, showsPrec, significand, signum,
+sin, sinh, snd, span, splitAt, sqrt, subtract, succ, sum, tail, take,
+either, elem, encodeFloat, enumFrom, enumFromThen, enumFromThenTo,
+enumFromTo, error, even, exp, exponent, fail, filter, flip, floatDigits,
+floatRadix, floatRange, floor, fmap, takeWhile, tan, tanh, threadToIOResult,
+toEnum, toInt, toInteger, toLower, toRational, toUpper, truncate, uncurry,
+undefined, unlines, until, unwords, unzip, unzip3, userError, words,
+writeFile, zip, zip3, zipWith, zipWith3
+
+-- type constructors
+
+Bool, Char, Double, Either, Float, IO, Integer, Int, Maybe, Ordering, Rational, Ratio, ReadS,
+ShowS, String
+
+-- classes
+
+Bounded, Enum, Eq, Floating, Fractional, Functor, Integral, Ix, Monad, Num, Ord, Read, RealFloat,
+RealFrac, Real, Show
+
+-- data constructors
+
+EQ, False, GT, Just, LT, Left, Nothing, Right, True
diff --git a/kate/tests/highlight.jsp b/kate/tests/highlight.jsp
new file mode 100644
index 000000000..d912836bd
--- /dev/null
+++ b/kate/tests/highlight.jsp
@@ -0,0 +1,170 @@
+<%--
+ This page won't actually work, as it is simply designed to display jsp syntax highlighting.
+--%>
+<%@ page info="A Page to Test Kate Jsp Syntax Highlighting" language="java" errorPage="/test-error-page.jsp"%>
+<%@ include file="/include/myglobalvars.jsp"%> --%>
+<%@ page import="java.util.*,
+ java.io.*,
+ java.math.*" %>
+<%@ taglib uri="/WEB-INF/lib/si_taglib.tld" prefix="si"%>
+<jsp:useBean id="aPageBean" scope="page" class="my.package.MyPageBean"/>
+<jsp:useBean id="aRequestBean" scope="request" class="my.package.MyRequestBean"/>
+<%
+ // We can decipher our expected parameters here.
+ String parm1 = noNull(request.getParameter(PARAMETER_1)).trim();
+ String parm2 = noNull(request.getParameter(PARAMETER_2)).trim();
+ String parm3 = noNull(request.getParameter(PARAMETER_3)).trim();
+ String parm4 = noNull(request.getParameter(PARAMETER_4)).trim();
+ String parm5 = noNull(request.getParameter(PARAMETER_5)).trim();
+
+ // A sample collection of Integers to display some code folding.
+ List intList = getIntList(10);
+
+
+%>
+<html>
+ <title>A Sample Jsp</title>
+ <head>
+ <script language="javascript"><!--
+ function doAlert1() {
+ alert("This is the first javascript example.");
+ }
+
+ function doAlert2() {
+ alert("This is the second javascript example.");
+ }
+ //--></script>
+ </head>
+ <body>
+ <%-- The top label table. --%>
+ <table width="400" cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td><font size="3"><b>The following parameters were detected:</b></font></td>
+ </tr>
+ </table>
+
+ <%-- Display the parameters which might have been passed in. --%>
+ <table width="400" cellpadding="0" cellspacing="0" border="0">
+ <%-- Label; Actual Parameter String; Value Detected --%>
+ <tr>
+ <td><b>PARAMETER_1</b></td>
+ <td align="center"><%=PARAMETER_1%></td>
+ <td align="right">&quot;<%=parm1%>&quot;</td>
+ </tr>
+
+ <%-- Label; Actual Parameter String; Value Detected --%>
+ <tr>
+ <td><b>PARAMETER_2</b></td>
+ <td align="center"><%=PARAMETER_2%></td>
+ <td align="right">&quot;<%=parm2%>&quot;</td>
+ </tr>
+
+ <%-- Label; Actual Parameter String; Value Detected --%>
+ <tr>
+ <td><b>PARAMETER_3</b></td>
+ <td align="center"><%=PARAMETER_3%></td>
+ <td align="right">&quot;<%=parm3%>&quot;</td>
+ </tr>
+
+ <%-- Label; Actual Parameter String; Value Detected --%>
+ <tr>
+ <td><b>PARAMETER_4</b></td>
+ <td align="center"><%=PARAMETER_4%></td>
+ <td align="right">&quot;<%=parm4%>&quot;</td>
+ </tr>
+
+ <%-- Label; Actual Parameter String; Value Detected --%>
+ <tr>
+ <td><b>PARAMETER_5</b></td>
+ <td align="center"><%=PARAMETER_5%></td>
+ <td align="right">&quot;<%=parm5%>&quot;</td>
+ </tr>
+ </table>
+
+ <br><br>
+
+ <%-- Display our list of random Integers (shows code folding). --%>
+ <table width="400" cellpadding="0" cellspacing="0" border="0">
+<%
+ if (intList != null && intList.size() > 0) {
+%>
+ <tr><td><b>Here are the elements of intList...</b></td></tr>
+<%
+ Iterator intListIt = intList.iterator();
+ while (intListIt.hasNext()) {
+ Integer i = (Integer) intListIt.next();
+%>
+ <tr><td><%=i.toString()%></td></tr>
+<%
+ }
+ } else {
+%>
+ <tr><td><font color="blue"><b><i>Oooops, we forgot to initialize intList!</i></b></font></td></tr>
+<%
+ }
+%>
+ </table>
+
+ <br><br>
+
+ <%-- We can call javascript functions. --%>
+ <table width="400" cellpadding="0" cellspacing="0" border="0">
+ <tr><td colspan="2"><b>Test our javascript...</b></td></tr>
+ <tr>
+ <td><input type="button" name="button1" value="Alert 1" onmouseup="javascript:doAlert1()"></td>
+ <td><input type="button" name="button2" value="Alert 2" onmouseup="javascript:doAlert2()"></td>
+ </tr>
+ </table>
+
+ <br><br>
+ <%-- If we actually had defined a tag library. --%>
+ <table width="400" cellpadding="0" cellspacing="0" border="0">
+ <tr><td>
+ <my:SampleTag prop1="first" prop2="third">
+ <my:SampleTagChild nameProp="value1"/>
+ <my:SampleTagChild nameProp="value2"/>
+ </my:SampleTag>
+ </td></tr>
+ </table>
+
+ <br><br>
+ <%-- Expression language. --%>
+ <table width="400" cellpadding="0" cellspacing="0" border="0">
+ <c:if test="${!empty param.aParam}">
+ <c:set var="myParam" scope="session" value="${param.aParam}"/>
+ </c:if>
+
+ <tr><td>myParam's value: &quot;<c:out value="${myParam}" default=="Default"/>&quot;</td></tr>
+ </table>
+ </body>
+</html>
+<%!
+ /* A place for class variables and functions... */
+
+ // Define some sample parameter names that this page might understand.
+ private static final String PARAMETER_1 = "p1";
+ private static final String PARAMETER_2 = "p2";
+ private static final String PARAMETER_3 = "p3";
+ private static final String PARAMETER_4 = "p4";
+ private static final String PARAMETER_5 = "p5";
+
+ // Returns str trimmed, or an empty string if str is null.
+ private static String noNull(String str) {
+ String retStr;
+ if (str == null)
+ retStr = "";
+ else
+ retStr = str.trim();
+
+ return retStr;
+ }
+
+ // Returns a list of Integers with listSize elements.
+ private static List getIntList(int listSize) {
+ ArrayList retList = new ArrayList(listSize);
+ for (int i = 0; i < listSize; i++)
+ retList.add(new Integer( (int) (Math.random() * 100) ));
+
+ return retList;
+ }
+%> \ No newline at end of file
diff --git a/kate/tests/highlight.lex b/kate/tests/highlight.lex
new file mode 100644
index 000000000..33527bd22
--- /dev/null
+++ b/kate/tests/highlight.lex
@@ -0,0 +1,82 @@
+/* This test file tests kates Lex/Flex highlighting */
+
+%option c++
+%option yyclass="KateTester"
+%option yylineno
+
+ /* This is a C(++) comment */
+
+/* This one is a lex comment ! */
+
+%{
+#include <iostream>
+#include "realparser.hpp"
+using namespace std;
+%}
+
+/* Some definitions */
+DIGIT [0-9]
+LETTER [_a-zA-Z]
+
+%%
+
+ /* Comment *shall be indented here* */
+[ \t\n\r]+
+
+ /* Note: there is a bad } just here vvv */
+\/\*([^\*]|\*[^/])*\*\/ { foo(a, b, c); } }
+
+ /* A start condition scope... */
+<ESC>{
+ "a" {
+
+ /* C mode ! */
+ return 0;
+}
+
+ "b" %{
+
+ /* C mode, too ! */
+ return 0;
+%}
+
+ "c" return 0; // C++ comment
+}
+
+ /* Big rule */
+\"([^"\\]|\\.)*\" {
+
+ yylval.string_val = new char[strlen(yytext) + 1];
+ int j = 0, i = 1;
+
+ while (yytext[i] != '"')
+ if (yytext[i] != '\\')
+ yylval.string_val[j++] = yytext[i++];
+ else
+ switch (yytext[i + 1])
+ {
+ case 'n':
+ yylval.string_val[j++] = '\n'; i += 2;
+ break;
+ default:
+ yylval.string_val[j++] << yytext[i + 1], i += 2;
+ }
+
+ yylval.string_val[j] = 0;
+ return TOK_STRING;
+
+}
+
+ /* Dot (match all) */
+. {return yylval.int_val = yytext[0];}
+
+%%
+
+// Here is pure C(++)
+#include <iostream>
+
+int main(void)
+{
+ std::cout << "Hello, World\n";
+ return 0;
+}
diff --git a/kate/tests/highlight.lhs b/kate/tests/highlight.lhs
new file mode 100644
index 000000000..9dc52e570
--- /dev/null
+++ b/kate/tests/highlight.lhs
@@ -0,0 +1,124 @@
+test file for Haskell syntax highlighting in KDE's Kate
+
+The test file for literate Haskell can be easily created like this:
+ cat highlight.hs | sed -e "s|^|> |" -e "s|> -- ||" -e "s|^> $||" > highlight.lhs
+You only have to manually edit the multi-line comment below.
+
+this is a single-line comment
+
+{- this is a multi-line comment
+
+Things like "a string" or a 'c' character shouldn't be highlighted in here.
+
+I could even start a new
+one-line comment.
+
+-}
+
+a data definition
+
+> data Tree a = Br (Tree a) (Tree a) | Leaf a | Nil deriving (Show, Eq)
+
+
+function definition, "funnyfunction::", "Integer", "Int", "Bool" should be highlighted
+
+> funnyfunction::(Tree a)=>[a]->Integer->Int->Bool
+
+
+strings and chars
+first line of function definitions (type declaration) should be highlighted
+
+> strangefunction::Int->String
+> strangefunction 1 = "hello"
+> strangefunction 2 = "what's up"
+> strangefunction 3 = (strangefunction 1) ++ ", " ++ (strangefunction 2)
+> strangefunction 4 = 'a':'b':'c':'"':[] -- will return "abc"
+> strangefunction 5 = '\n':[]
+> strangefunction 6 = '\invalidhaskell':[]
+
+function name including the single quote character
+and infix operator (`div`)
+
+> justtesting'::Int->Int
+> justtesting' 2 = 2+1
+> justtesting' 9 = 7 `div` 2
+
+same definition as above, slightly different function name and a couple more whitespaces
+
+> justtesting'' :: Int -> Int
+> justtesting'' 2 = 3
+> justtesting'' 9 = 3 + 9 - 9
+
+the following lines are copied out of Haskell's "Prelude.hs"
+
+> infixl 7 *, /, `quot`, `rem`, `div`, `mod`, :%, %
+
+
+everything highlighted except the "a"
+
+> class Bounded a where
+> minBound, maxBound :: a
+
+> class (Num a, Ord a) => Real a where
+> toRational :: a -> Rational
+
+finally, some keyword lists
+
+keywords
+
+> case, class, data, deriving, do, else, if, in, infixl, infixr, instance, let, module, of, primitive,
+> then, type, where
+
+infix operators
+
+> quot, rem, div, mod, elem, notElem, seq
+
+this stuff is not handled yet
+
+> !!, %, &&, $!, $, *, **, -,., /=, <, <=, =<<, ==, >, >=, >>, >>=, ^, ^^, ++, ||
+
+functions
+
+> FilePath, IOError, abs, acos, acosh, all, and, any, appendFile,
+> approxRational, asTypeOf, asin, asinh, atan, atan2, atanh, basicIORun,
+> break, catch, ceiling, chr, compare, concat, concatMap, const, cos, cosh,
+> curry, cycle, decodeFloat, denominator, digitToInt, div, divMod, drop,
+> dropWhile, either, elem, encodeFloat, enumFrom, enumFromThen,
+> enumFromThenTo, enumFromTo, error, even, exp, exponent, fail, filter, flip,
+> floatDigits, floatRadix, floatRange, floor, fmap, foldl, foldl1, foldr,
+> foldr1, fromDouble, fromEnum, fromInt, fromInteger, fromIntegral,
+> fromRational, fst, gcd, getChar, getContents, getLine, head, id, inRange,
+> index, init, intToDigit, interact, ioError, isAlpha, isAlphaNum, isAscii,
+> isControl, isDenormalized, isDigit, isHexDigit, isIEEE, isInfinite, isLower,
+> isNaN, isNegativeZero, isOctDigit, isPrint, isSpace, isUpper, iterate, last,
+> lcm, length, lex, lexDigits, lexLitChar, lines, log, logBase, lookup, map,
+> mapM, mapM_, max, maxBound, maximum, maybe, min, minBound, minimum, mod,
+> negate, not, notElem, null, numerator, odd, or, ord, otherwise, pi, pred,
+> primExitWith, print, product, properFraction, putChar, putStr, putStrLn,
+> quot, quotRem, range, rangeSize, read, readDec, readFile, readFloat,
+> readHex, readIO, readInt, readList, readLitChar, readLn, readOct, readParen,
+> readSigned, reads, readsPrec, realToFrac, recip, rem, repeat, replicate,
+> return, reverse, round, scaleFloat, scanl, scanl1, scanr, scanr1, seq,
+> sequence, sequence_, show, showChar, showInt, showList, showLitChar,
+> showParen, showSigned, showString, shows, showsPrec, significand, signum,
+> sin, sinh, snd, span, splitAt, sqrt, subtract, succ, sum, tail, take,
+> either, elem, encodeFloat, enumFrom, enumFromThen, enumFromThenTo,
+> enumFromTo, error, even, exp, exponent, fail, filter, flip, floatDigits,
+> floatRadix, floatRange, floor, fmap, takeWhile, tan, tanh, threadToIOResult,
+> toEnum, toInt, toInteger, toLower, toRational, toUpper, truncate, uncurry,
+> undefined, unlines, until, unwords, unzip, unzip3, userError, words,
+> writeFile, zip, zip3, zipWith, zipWith3
+
+type constructors
+
+> Bool, Char, Double, Either, Float, IO, Integer, Int, Maybe, Ordering, Rational, Ratio, ReadS,
+> ShowS, String
+
+classes
+
+> Bounded, Enum, Eq, Floating, Fractional, Functor, Integral, Ix, Monad, Num, Ord, Read, RealFloat,
+> RealFrac, Real, Show
+
+data constructors
+
+> EQ, False, GT, Just, LT, Left, Nothing, Right, True
diff --git a/kate/tests/highlight.lisp b/kate/tests/highlight.lisp
new file mode 100644
index 000000000..e86c85f15
--- /dev/null
+++ b/kate/tests/highlight.lisp
@@ -0,0 +1,36 @@
+;; This test file tests kates common lisp highlighting
+#|
+multilinecomment :)
+|#
+
+;BEGIN region marker
+
+;END end
+
+(defun bin-search (obj vec)
+ (let ((len (length vec)))
+ (and (not (zerop len))
+ (finder obj vec 0 (- len 1)))))
+
+(defun parse-date (str)
+ (let ((toks (tokens str #'constituent 0)))
+ (list (parse-integer (first toks))
+ (parse-month (second toks))
+ (parse-integer (third toks)))))
+
+(defconstant month-names
+ #("jan" "feb" "mar" "apr" "may" "jun"
+ "jul" "aug" "sep" "oct" "nov" "dec"))
+
+(defstruct buf
+ vec (start -1) (used -1) (new -1) (end -1))
+
+(defparameter *words* (make-hash-table :size 10000))
+
+(defmacro while (test &rest body)
+ `(do ()
+ ((not ,test))
+ ,@body))
+
+(define-modify-macro append1f (val)
+ (lambda (lst val) (append lst (list val))))
diff --git a/kate/tests/highlight.ly b/kate/tests/highlight.ly
new file mode 100644
index 000000000..29aa7a6ea
--- /dev/null
+++ b/kate/tests/highlight.ly
@@ -0,0 +1,114 @@
+% This is a file to test the Lilypond highlighting features of Katepart.
+% This is NOT a valid lilypond file, because it also shows the
+% highlighting of some invalid lilypond constructs!
+% This is a line comment.
+
+%{
+this is a block comment, that can occur inside a line, or across
+multiple lines.
+%}
+
+\header {
+ title = "Katepart Lilypond syntax highlighting test file"
+ composer = %{"Wilbert Berendsen"%} "Anonymus"
+ poet = "The KDE team"
+ opus = "1"
+ copyright = "Share and enjoy!"
+}
+
+\paper {
+ #(set-paper-size "a4") % a hash introduces scheme
+ indent = 0 % recognize variable names inside \paper, \layout etc.
+ between-system-space = 3\mm
+}
+
+\layout {
+ \context {
+ \Score
+ \remove Bar_number_engraver % recognize engraver names
+ \remove "Bar_number_engraver" % also when quoted!
+ }
+}
+
+% { and << block are folded
+\score {
+ \new StaffGroup <<
+ \new ChordNames \chordmode { c2sus4/f g2/d c1 }
+ \new Staff \new Voice ="mel" {
+ \key f \major
+ \time 4/4
+ \partial 4
+ \set Staff.instrumentName = "Bla."
+ \once \override Staff.NoteHead #'color = #red
+ % dynamics, articulations and markup
+ c8\p d\< e-. f-> g a\f c-5\markup {Hoi}
+ \notemode { c d e f }
+ \repeat volta 2 {
+ % complex durations are highlighted:
+ g4*2/3
+ }
+ \times 2/3 {e8 f g}
+ % there is some error checking:
+ % often made mistake to have octavemarks after the duration:
+ c2'
+ % invalid durations are caught:
+ g3
+ }
+ \context Lyrics \lyricsto "mel" {
+ \set fontSize = #1
+ this is a line of ly -- rics.
+ with4 dur -- a -- tions.2.
+ % errors like forgetting spaces are found:
+ space-- flight %{i.s.o.%} space -- flight
+ space at end for -- got -- ten as well.}
+
+ \new DrumStaff \drummode { hihat4 bassdrum8 }
+ \new FiguredBass \figuremode {
+ <5 4>8 <6->
+ }
+ >>
+ \midi {
+ \context {
+ \Score
+ tempoWholesPerMinute = #(ly:make-moment 60 2)
+ }
+ }
+}
+
+av = #(define-music-function (parser location voice)
+(string?)
+; scheme comments are recognized in scheme
+; Lilypond inside scheme works as well:
+#{
+ \set associatedVoice = $voice
+#})
+
+
+
+
+% inside scheme some elements are highlighted:
+#(define (naturalise-pitch p)
+ (let* ((o (ly:pitch-octave p))
+ (a (* 4 (ly:pitch-alteration p)))
+ (n (ly:pitch-notename p)))
+ (bla 'ArticulationEvent 'ChoirStaff)
+ (cond
+ ((> a 2) (set! a (- a 4)) (set! n (+ n 1)))
+ ((< a -2) (set! a (+ a 4)) (set! n (- n 1))))
+
+ (if (< n 0) (begin (set! o (- o 1)) (set! n (+ n 7))))
+ (if (> n 6) (begin (set! o (+ o 1)) (set! n (- n 7))))
+
+ (ly:make-pitch o n (/ a 4))))
+
+% markup is also highlighted
+\markup {
+ \line {
+ text test Voice Staff % note Lilypond keywords are not highlighted here
+ }
+ \score { \relative c' { <ceg>2( d) } }
+ \italic bla
+ \override #'(baseline-skip . 2) {
+ \underline blu
+ }
+}
diff --git a/kate/tests/highlight.m b/kate/tests/highlight.m
new file mode 100644
index 000000000..f24013853
--- /dev/null
+++ b/kate/tests/highlight.m
@@ -0,0 +1,61 @@
+%%=====================================================
+% MATLAB test code for Kate/Kwrite syntax highlighting
+% kate: hl Matlab
+%%=====================================================
+
+% Numbers _____________________________________________
+5, 5.5, .1, 0.1, 0.4e5, 1.2e-5, 5i, 5.3i, 6j, .345+3i
+5', 5.5', .1', 0.1', 0.4e5', 1.2e-5', 5i', 5.3i', 6j', .345+3i'
+
+% Operators ___________________________________________
+% relational operators
+'asdf'~=4, c<=4, d>=4, a<b, a>b, a==b, b||c, b&&c
+% elementwise arithmetic operators
+a.^b, a.*b a./b, 1:4:5
+% single-character binary arithmetic
+a+3, a-3, a*2, a^3, a/3, a\3, a|b, a&b
+% unary operators
+a = ~g; g = @sfdgdsf(sdfsd,345); g.' + 1i.' - ('asdf').'
+% separators and delimiter
+(asd),[sadf];{asdf},;;,;;;()
+% continuation
+a = 1+ ...
+ 2;
+
+% Strings and adjoint _________________________________
+% incomplete strings
+'string
+'str''
+'str''ing
+% complete strings
+'string' % simple string
+'''' % string containing '
+'str''ing' % one string containing '
+'string' 'string' % two strings
+'asdf' 'asdf''' variable % two strings and a variable
+'asdf''asdf'' fsgdfg' + (asdf)' - 'asdf'.' + []''''.';''
+'sadf'.' % string transpose
+% adjoint
+{'asdf'}' + 1
+('asdf')' + 1
+['asdf']' + 1
+'' var''' % empty string, var with >1 adjoints
+[5]'*{5}'*('asd')'.'+(5)'*6'*asdf'*asdf'.' % many adjoints
+A'*B + 1 % adjoint
+A.'*B + 1 % transpose
+A.'.'*B + 1 % double transpose
+A'.' + 1 % adjoint, then transpose
+A.'' % transpose, then adjoint
+
+% System command ______________________________________
+!hostname
+!cp * /tmp
+
+% Reserved keywords ___________________________________
+function, persistent, global
+switch, case, otherwise
+if, else, elseif
+try, catch
+for, while, break, continue
+end, return
+function, FUNCTION, Function % case sensitive! \ No newline at end of file
diff --git a/kate/tests/highlight.mup b/kate/tests/highlight.mup
new file mode 100644
index 000000000..ed5a03d99
--- /dev/null
+++ b/kate/tests/highlight.mup
@@ -0,0 +1,103 @@
+// This is a MUP highlighting test.
+// Mup is a shareware music publisher from www.arkkra.com
+
+// contexts
+score
+music
+staff 1
+voice 1 3
+
+top
+top2
+bottom
+bottom2
+grids
+
+headshapes
+
+
+header
+footer
+header2
+footer2
+
+// parameters and values
+score
+ units = cm;
+ key = 3#minor
+ key = 3# minor
+ rehstyle=circled
+
+
+
+
+mussym above all: 1 "ferm" ;
+
+define NAME
+// this is a macro definition, these are collapsable
+@
+
+ifdef NAME
+// this is conditionally "compiled"
+endif
+
+ifndef NAME
+// this is conditionally "compiled" when the macro has not been defined
+else
+// else clause
+endif
+
+
+// Various Tests
+
+// tablature
+1: e ^f; f; b ^c5; c#5;
+bar
+
+1: d+^e+ g^a; e+a; g ^/; c ^/ c+^/;
+bar
+
+// cross-staff stems
+1: 1e+g+c++;
+2: cc+; ee+; g with g+ above; with c+c++ above;
+bar
+
+1: 2+4ceg;4; // tie implied by added time values
+
+// slurs
+1: 2f<d> a<b> c+<d+>; dbd+;
+bar
+1: 2fac+ slur; dbd+;
+bar
+
+// alternation
+1: 2c alt 2; 2c+;2g;
+bar
+
+// bar to draw if repeatstart happens to be on new line
+(dblbar) repeatstart
+1: [up]8f bm with staff below;a;4s ebm;4s bm with staff below;8b;[len 11]d ebm;
+2: 4s bm with staff above;8a;b ebm;[down;len 14]b bm with staff above;d;4s ebm;
+bar
+
+// locations
+3: 2cf; [=h] egc+;
+1: [cue; with >; =_ch] fa;
+
+
+roll up 1 1 to 1 2: 2; 4;
+roll down 1 1 to 1 2: 2; 4;
+
+lyrics above 1,3 ; below 2,4 ; between 5&6 : "<1. >Hi, hi";
+
+title "page \% of \#"
+
+// shaped whole rests
+1: 4mr; // use a quarter rest symbol
+1: 1/4mr; // use a quadruple whole rest symbol
+2: 2.. mr; // use a double-dotted half rest
+
+// tuplets
+1: {4f; g;}3num,4.+2.
+bar
+
diff --git a/kate/tests/highlight.pb b/kate/tests/highlight.pb
new file mode 100644
index 000000000..556023334
--- /dev/null
+++ b/kate/tests/highlight.pb
@@ -0,0 +1,87 @@
+; This is a test file for kate's PureBasic highlighting.
+
+; BMP2x Converter by Sven Langenkamp
+
+UseJPEGImageEncoder()
+UsePNGImageEncoder()
+
+Declare Convert(JPEG)
+
+Enumeration 1
+ #JPEG
+ #PNG
+EndEnumeration
+
+; BEGIN section
+
+
+; END
+
+Global Count
+Global file.s
+Global filename.s
+Global fileext.s
+Global OutputFormat
+Global JPEGQuality
+
+Count = 0
+OutputFormat = 1
+JPEGQuality = -1
+
+; MAIN PROGRAM------------------------------------------------------------------
+
+;Request Options
+PrintN("Output Format")
+PrintN(" [1] JPEG")
+PrintN(" [2] PNG")
+Print ("> ")
+OutputFormat = Int(Input())
+
+Select OutputFormat
+ Case #JPEG:
+ fileext = ".jpg"
+ ;Request JPEG Quality
+ PrintN("")
+ PrintN("JPEG Quality")
+ PrintN(" [0-10]")
+ Print ("> ")
+ JPEGQuality = Int(Input())
+
+ Case #PNG:
+ fileext = ".png"
+EndSelect
+
+;Convert all BMP files in the current directory
+ExamineDirectory(0, "", "*.bmp")
+While NextDirectoryEntry()
+ file = DirectoryEntryName()
+ filename = GetFilePart(file)
+
+ If LoadImage(0, file)
+ Select OutputFormat
+ Case #JPEG:
+ Convert(JPEGQuality)
+
+ Case #PNG:
+ Convert(-1)
+ EndSelect
+ Count = Count +1
+ EndIf
+
+Wend
+
+PrintN(Str(Count) + " files converted")
+CloseConsole()
+
+; PROCUDURES--------------------------------------------------------------------
+
+Procedure Convert(JPEG)
+ Shared filename, fileext
+
+ If JPEG > -1
+ SaveImage(0, filename + fileext, #PB_ImagePlugin_JPEG, JPEG)
+ Else
+ SaveImage(0, filename + fileext, #PB_ImagePlugin_PNG)
+ EndIf
+ PrintN(file + " converted to " + filename + fileext)
+EndProcedure \ No newline at end of file
diff --git a/kate/tests/highlight.php b/kate/tests/highlight.php
new file mode 100644
index 000000000..d604e3689
--- /dev/null
+++ b/kate/tests/highlight.php
@@ -0,0 +1,23 @@
+<?
+/* This is a pseudo PHP file to test Kate's PHP syntax highlighting. */
+# TODO: this is incomplete, add more syntax examples!
+# this is also a comment.
+// Even this is a comment
+function test($varname) {
+ return "bla"; # this is also a comment
+}
+
+?>
+
+<?php echo("hello test"); ?>
+
+<html>
+ <? print "<title>test</title>"; ?>
+</html>
+
+<?php
+$var = <<<DOOH
+This is the $string inside the variable (which seems to be rendered as a string)
+It works well, I think.
+DOOH
+?> \ No newline at end of file
diff --git a/kate/tests/highlight.pike b/kate/tests/highlight.pike
new file mode 100644
index 000000000..2f63144f5
--- /dev/null
+++ b/kate/tests/highlight.pike
@@ -0,0 +1,24 @@
+#! /bin/env pike
+
+/* This file is a syntax highlight test for Kate.
+ * FIXME: Improve it to contain more (and more unusual) syntax examples.
+ */
+
+
+#define PIKE_ON_THE_WEB /* Is this address correct? */ "http://pike.ida.liu.se/"
+
+
+int main(int argc, array(string) args)
+{
+ // Write funny things with Pike :)
+ write(`+("Command line arguments (%d of them): ", @map(args, `+, " ")) + "\n", argc);
+
+ write("\nVisit Pike site at %s\n\n", PIKE_ON_THE_WEB);
+
+ for (int i = 1; i <= 3; i++)
+ write(":" + ")" * i + " ");
+
+ write("\n" + ({"Bye", "bye"}) * "-" + "!\n");
+
+ return 0;
+}
diff --git a/kate/tests/highlight.pl b/kate/tests/highlight.pl
new file mode 100644
index 000000000..991d1fea6
--- /dev/null
+++ b/kate/tests/highlight.pl
@@ -0,0 +1,44 @@
+#!/usr/bin/perl -w
+# This is a pseudo Perl file to test Kate's Perl syntax highlighting.
+# TODO: this is incomplete, add more syntax examples!
+
+sub prg($)
+{
+ my $var = shift;
+
+ $var =~ s/bla/foo/igs;
+ $var =~ s!bla!foo!igs;
+ $var =~ s#bla#foo#igs;
+ $var =~ tr/a-z/A-Z/;
+ ($match) = ($var =~ m/(.*?)/igs);
+
+ $test = 2/453453.21;
+ $test /= 2;
+
+ print qq~d fsd fsdf sdfl sd~
+
+ $" = '/';
+
+ $foo = <<__EOF;
+d ahfdklf klsdfl sdf sd
+fsd sdf sdfsdlkf sd
+__EOF
+
+ $x = "dasds";
+
+ next if( $match eq "two" );
+ next if( $match =~ /go/i );
+
+ @array = (1,2,3); # a comment
+ @array = qw(apple foo bar);
+ push(@array, 4);
+ %hash = (red => 'rot',
+ blue => 'blau');
+ print keys(%hash);
+}
+
+sub blah {
+}
+
+&blah;
+prg("test");
diff --git a/kate/tests/highlight.pov b/kate/tests/highlight.pov
new file mode 100644
index 000000000..0bb307744
--- /dev/null
+++ b/kate/tests/highlight.pov
@@ -0,0 +1,76 @@
+//BEGIN TEST
+// test scene for POV-Ray syntax highlighting
+
+/* test comment */
+
+/* nested /* comments */ do not work */
+
+#version 3.5;
+//END
+global_settings { assumed_gamma 1.0 }
+
+// ----------------------------------------
+
+camera {
+ location <5.0, -12.0, 2.0>
+ up z sky z
+ look_at <0.0, 0.0, 0.5>
+ angle 40
+}
+
+sky_sphere {
+ pigment {
+ gradient z
+ color_map {
+ [0.0 rgb <0.6,0.7,1.0>]
+ [0.2 rgb <0.2,0.3,0.9>]
+ }
+ }
+}
+
+light_source {
+ <3, 1, 2>*1000
+ color rgb <2.2, 1.8, 1.5>
+}
+
+// ----------------------------------------
+
+#declare TEST=0;
+
+#ifdef (TEST)
+ plane {
+ z, 0
+ texture {
+ pigment {
+ checker
+ color rgb 1, color rgb 0
+ }
+ }
+ }
+#end
+
+#macro Sphere(Pos, Radius)
+ sphere {
+ <Pos.x, Pos.y, Radius*1.3>, Radius
+ texture {
+ pigment { color rgb 1 }
+ finish{
+ diffuse 0.3
+ ambient 0.0
+ specular 0.6
+ reflection 0.8
+ }
+ }
+ }
+#end
+
+#local Cnt=0;
+#local Seed=seed(0);
+
+#while (Cnt<10000)
+ Sphere(
+ -100+<rand(Seed), rand(Seed)>*200,
+ 0.3+pow(rand(Seed),2)*0.7
+ )
+ #local Cnt=Cnt+1;
+#end \ No newline at end of file
diff --git a/kate/tests/highlight.prg b/kate/tests/highlight.prg
new file mode 100644
index 000000000..713c60551
--- /dev/null
+++ b/kate/tests/highlight.prg
@@ -0,0 +1,71 @@
+// Test file to test kate's clipper highlighting
+// kate: hl Clipper;
+
+//BEGIN INCLUDES
+#include <clip-ui.ch>
+#include "logo.ch"
+
+#define PRGVERSION "0.0.1"
+//END
+
+//BEGIN CODE
+static ws, win
+static driver := getDriver()
+/* a multiline
+ comment
+*/
+
+function main( formName )
+ local form
+ local fileName
+
+ if empty(formName)
+ ?? "Usage: ./form_ui <form.xfl>&\n"
+ CANCEL
+ else
+ fileName := formName
+ endif
+ ws := UIWorkSpace()
+
+ form := UIForm( fileName )
+ win := form:parseFile()
+// ?? valtype(win),chr(10)
+ if win == NIL
+ CANCEL
+ endif
+ win:show()
+
+ ws:run()
+ ws:quit()
+return 0
+
+/* Setting dialog */
+function settingsDialog()
+ ?? "TODO: Settings dialog&\n"
+return
+
+/* About dialog */
+function aboutDialog()
+ local dlg := UIWindow("About", win, "aboutDlg", .F.)
+ local hl, lside, t, bb, bD
+
+ hl := UIHBox(,4,8)
+ lside := UIVBox()
+ lside:add(UIImage(eas_logo_mini,.T.))
+ hl:add(lside,.F.,.F.)
+ dlg:userSpace:add(hl,.T.,.T.)
+ t := UIVBox()
+ hl:add(t,.T.,.T.)
+
+ t:add(UILabel("License: GPL version 2 or later"))
+ bb := UIButtonBar()
+ t:add(bb)
+ bD := UIButton(win, "&Close", {|o,e| dlg:close() } )
+ bb:add( bD )
+
+ dlg:setFocus(bD)
+ dlg:setDefault(bD)
+ dlg:setPlacement( .T. )
+ dlg:show()
+return
+//END \ No newline at end of file
diff --git a/kate/tests/highlight.rb b/kate/tests/highlight.rb
new file mode 100644
index 000000000..96061c1d0
--- /dev/null
+++ b/kate/tests/highlight.rb
@@ -0,0 +1,480 @@
+# This file is a testcase for the highlighting of Ruby code
+# It's not executable code, but a collection of code snippets
+#
+
+require 'Config'
+require 'DO/Clients'
+require 'DO/DBClients'
+
+ def CGI::escapeElement(string, *elements)
+ elements = elements[0] if elements[0].kind_of?(Array)
+ unless elements.empty?
+ string.gsub(/<\/?(?:#{elements.join("|")})(?!\w)(?:.|\n)*?>/ni) do
+ CGI::escapeHTML($&)
+ end
+ else
+ string
+ end
+ end
+
+case inputLine
+ when "debug"
+ dumpDebugInfo
+ dumpSymbols
+ when /p\s+(\w+)/
+ dumpVariable($1)
+ when "quit", "exit"
+ exit
+ else
+ print "Illegal command: #{inputLine}"
+end
+
+
+kind = case year #hi there
+ when 1850..1889 then "Blues"
+ when 1890..1909 then "Ragtime"
+ when 1910..1929 then "New Orleans Jazz"
+ when 1930..1939 then "Swing"
+ when 1940..1950 then "Bebop"
+ else "Jazz"
+ end
+
+ # URL-encode a string.
+ # url_encoded_string = CGI::escape("'Stop!' said Fred")
+ # # => "%27Stop%21%27+said+Fred"
+ def CGI::escape(string)
+ string.gsub(/([^ a-zA-Z0-9_.-]+)/n) do
+ '%' + $1.unpack('H2' * $1.size).join('%').upcase
+ end.tr(' ', '+')
+ end
+
+
+# Class ClientManager
+#
+# definition : Import, store and export the various data used by the application.
+# This class is the sole interface between the application and the underlying database.
+
+mon, day, year = $1, $2, $3 if /(\d\d)-(\d\d)-(\d\d)/
+puts "a = #{a}" if fDebug
+print total unless total == 0
+
+while gets
+ next if /^#/ # Skip comments
+ parseLine unless /^$/ # Don't parse empty lines
+end
+
+if artist == "John Coltrane" #hi there
+ artist = "'Trane" #hi there
+end unless nicknames == "no" #hi there
+
+handle = if aSong.artist == "Gillespie" then #hi there
+ "Dizzy"
+ elsif aSong.artist == "Parker" then
+ "Bird"
+ else #hi there
+ "unknown"
+ end
+
+if aSong.artist == "Gillespie" then handle = "Dizzy"
+elsif aSong.artist == "Parker" then handle = "Bird"
+else handle = "unknown"
+end #hi there
+
+if aSong.artist == "Gillespie" then
+ handle = "Dizzy"
+elsif aSong.artist == "Parker" then
+ handle = "Bird"
+else
+ handle = "unknown"
+end
+
+if aSong.artist == "Gillespie"
+ handle = "Dizzy"
+elsif aSong.artist == "Parker"
+ handle = "Bird"
+else
+ handle = "unknown"
+end
+
+ case line
+ when /title=(.*)/
+ puts "Title is #$1"
+ when /track=(.*)/
+ puts "Track is #$1"
+ when /artist=(.*)/
+ puts "Artist is #$1"
+end
+
+case shape
+ when Square, Rectangle
+ # ...
+ when Circle
+ # ...
+ when Triangle
+ # ...
+ else
+ # ...
+end
+
+
+until playList.duration > 60 #hi there
+ playList.add(songList.pop)
+end
+
+3.times do
+ print "Ho! "
+end
+
+loop {
+ # block ...
+}
+
+songList.each do |aSong|
+ aSong.play
+end
+
+for aSong in songList
+ aSong.play
+end
+
+for i in ['fee', 'fi', 'fo', 'fum']
+ print i, " "
+end
+for i in 1..3
+ print i, " "
+end
+for i in File.open("ordinal").find_all { |l| l =~ /d$/}
+ print i.chomp, " "
+end
+
+class Periods
+ def each
+ yield "Classical"
+ yield "Jazz"
+ yield "Rock"
+ end
+end
+
+
+periods = Periods.new
+for genre in periods
+ print genre, " "
+end
+
+while gets
+ next if /^\s*#/ # skip comments
+ break if /^END/ # stop at end
+ # substitute stuff in backticks and try again
+ redo if gsub!(/`(.*?)`/) { eval($1) }
+ # process line ...
+end
+
+i=0
+loop do
+ i += 1
+ next if i < 3
+ print i
+ break if i > 4
+end
+
+for i in 1..100
+ print "Now at #{i}. Restart? "
+ retry if gets =~ /^y/i
+end
+
+def doUntil(cond)
+ yield
+ retry unless cond
+end
+
+i = 0
+doUntil(i > 3) {
+ print i, " "
+ i += 1
+}
+
+def system_call
+ # ... code which throws SystemCallError
+rescue SystemCallError
+ $stderr.print "IO failed: " + $!
+ opFile.close
+ File.delete(opName)
+ raise
+end
+
+class ClientManager
+
+ # constructor
+ def initialize(dbase)
+ @dbClient = DBClient.new(dbase)
+ @clients = Clients.new
+ end
+
+ def prout(a, b, xy="jj") 24 end
+ ###############################################################
+ #
+ # CLIENTS SECTION
+ #
+ ###############################################################
+
+ # update the clients object by retrieving the related data from the database
+ # returns the number of clients
+ def refreshClients
+ @clients.clean
+ unless @sqlQuery.nil? then
+ @sqlQuery.selectClient.each do |row|
+ @clients.addClient(row[0],row[1],row[2],row[3],row[4],row[5], row[6], row[7], row[8])
+ end
+ else
+ puts "SqlQuery wasn't created : cannot read data from database"
+ end
+ return @clients.length
+ end
+
+ # insert a client in the database and refreshes the local clients object
+ # we assume that none of the arguments is null
+ # we assume that the client, identified by raison_sociale doesn't already exists
+ def addClient(raison_sociale, division, departement, adresse, cp, ville, nom_contact, tel_contact)
+ id = "0"
+ unless @sqlQuery.nil? then
+ id = @sqlQuery.insertClient(raison_sociale, division, departement, adresse, cp, ville, nom_contact,tel_contact)
+ else
+ puts "SqlQuery wasn't created : database update cannot be performed"
+ end
+ @clients.addClient(id, raison_sociale, division, departement, adresse, cp, ville, nom_contact, tel_contact) # synchronize local object with DB
+ end
+
+ # deletes a client from the database and updates the local Clients object accordingly
+ def delClient(nomclient_brut)
+ raison_sociale, div, dep = Clients.getIdentifiers(nomclient_brut)
+ listeContratsExp, listeContratsSup, listeContratsProd, listePropositionsExp, listePropositionsSup = []
+
+ listeContratsExp = @contratsExpertise.getContratsFromClient(nomclient_brut)
+ listeContratsSup = @contratsSupport.getContratsFromClient(nomclient_brut)
+ listeContratsProd = @contratsProduits.getContratsFromClient(nomclient_brut)
+ listePropositionsExp = @propositionsExpertise.getPropositionsFromClient(nomclient_brut)
+ listePropositionsSup = @propositionsSupport.getPropositionsFromClient(nomclient_brut)
+
+ unless @sqlQuery.nil? then
+ @sqlQuery.deleteClient(raison_sociale, div, dep)
+
+ @sqlQuery.deleteContracts(Config::EXPERTISE,listeContratsExp)
+ @sqlQuery.deleteContracts(Config::SUPPORT,listeContratsSup)
+ @sqlQuery.deleteContracts(Config::PRODUIT,listeContratsProd)
+ @sqlQuery.deletePropositions(Config::EXPERTISE,listePropositionsExp)
+ @sqlQuery.deletePropositions(Config::SUPPORT,listePropositionsSup)
+ else
+ puts "SqlQuery wasn't created : database update cannot be performed"
+ end
+ @clients.delClient(raison_sociale,div,dep)
+
+ @contratsExpertise.deleteContracts(listeContratsExp)
+ @contratsSupport.deleteContracts(listeContratsSup)
+ @contratsProduits.deleteContracts(listeContratsProd)
+ @propositionsExpertise.deletePropositions(listePropositionsExp)
+ @propositionsSupport.deletePropositions(listePropositionsSup)
+ end
+end
+
+ # Mixin module for HTML version 3 generation methods.
+ module Html3 # :nodoc:
+
+ # The DOCTYPE declaration for this version of HTML
+ def doctype
+ %|<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">|
+ end
+
+ # Initialise the HTML generation methods for this version.
+ def element_init
+ extend TagMaker
+ methods = ""
+ # - -
+ for element in %w[ A TT I B U STRIKE BIG SMALL SUB SUP EM STRONG
+ DFN CODE SAMP KBD VAR CITE FONT ADDRESS DIV center MAP
+ APPLET PRE XMP LISTING DL OL UL DIR MENU SELECT table TITLE
+ STYLE SCRIPT H1 H2 H3 H4 H5 H6 TEXTAREA FORM BLOCKQUOTE
+ CAPTION ]
+ methods += <<-BEGIN + nn_element_def(element) + <<-END
+ def #{element.downcase}(attributes = {})
+ BEGIN
+ end
+ END
+ end
+
+ # - O EMPTY
+ for element in %w[ IMG BASE BASEFONT BR AREA LINK PARAM HR INPUT
+ ISINDEX META ]
+ methods += <<-BEGIN + nOE_element_def(element) + <<-END
+ def #{element.downcase}(attributes = {})
+ BEGIN
+ end
+ END
+ end
+
+ # O O or - O
+ for element in %w[ HTML HEAD BODY P PLAINTEXT DT DD LI OPTION tr
+ th td ]
+ methods += <<-BEGIN + nO_element_def(element) + <<-END
+ def #{element.downcase}(attributes = {})
+ BEGIN
+ end
+ END
+ end
+ eval(methods)
+ end
+
+ end
+
+# following snippet from Webrick's log.rb
+# notice the erronous handling of the query method is_a?
+def format(arg)
+ str = if arg.is_a?(Exception)
+ "#{arg.class}: #{arg.message}\n\t" <<
+ arg.backtrace.join("\n\t") << "\n"
+ elsif arg.respond_to?(:to_str)
+ arg.to_str
+ else
+ arg.inspect
+ end
+end
+
+# following snippet from Webrick's httputils.rb
+# Splitting regexps on several lines might be bad form,
+# but not illegal in Ruby.
+# This should probably be supported in the highlighting
+def split_header_value(str)
+ str.scan(/((?:"(?:\\.|[^"])+?"|[^",]+)+)
+ (?:,\s*|\Z)/xn).collect{|v| v[0] }
+end
+
+# snippet from Net::Telnet
+string.gsub(/#{IAC}(
+ [#{IAC}#{AO}#{AYT}#{DM}#{IP}#{NOP}]|
+ [#{DO}#{DONT}#{WILL}#{WONT}]
+ [#{OPT_BINARY}-#{OPT_NEW_ENVIRON}#{OPT_EXOPL}]|
+ #{SB}[^#{IAC}]*#{IAC}#{SE}
+ )/xno)
+
+# following snippet from Webrick's httpresponse.rb
+# the HEREDOC is not recognized as such
+@body << <<-_end_of_html_
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
+<HTML>
+ <HEAD><TITLE>#{HTMLUtils::escape(@reason_phrase)}</TITLE></HEAD>
+ <BODY>
+ <H1>#{HTMLUtils::escape(@reason_phrase)}</H1>
+ #{HTMLUtils::escape(ex.message)}
+ <HR>
+_end_of_html_
+
+
+# snippet from Webrick's httpproxy.rb
+# here we should make sure that the symbol definition ':' doesn't override
+# the module operator '::'
+Net::HTTP::version_1_2 if RUBY_VERSION < "1.7"
+
+# snippet from Webrick's cookie.rb
+# the beginning of the regexp is erronously highlighted like an operator
+key, val = x.split(/=/,2)
+
+# the following are division operators
+# it's a bit tricky to keep the operator apart from the regexp
+# we currently require a space after the operator, but that is not quite right either
+result = 8 / 4
+result /= divisor
+
+# test cases for general delimited input
+# quoted strings
+%Q|this is a string|
+%Q{this is a string}
+%Q(this is a string)
+%Q<this is a string>
+%Q[this is a string]
+
+%|also a string|
+%{also a string}
+%(also a string)
+%<also a string>
+%[also a string]
+
+# apostrophed strings
+%q|apostrophed|
+%q{apostrophed}
+%q(apostrophed)
+%q<apostrophed>
+%q[apostrophed]
+
+# regular expressions
+%r{expression}
+%r(expression)
+%r<expression>
+%r[expression]
+%r|expression|
+
+# shell commands
+%x{ls -l}
+%x(ls -l)
+%x<ls -l>
+%x[ls -l]
+
+# sometimes it's useful to have the command on multiple lines
+%x{ls -l |
+grep test }
+
+# token array
+%w{one two three}
+%w(one two three)
+%w<one two three>
+%w[one two three]
+
+# snippet from Net::IMAP
+# I object to putting String, Integer and Array into kernel methods.
+# While these classes are builtin in Ruby, this is an implementation detail
+# that should not be exposed to the user.
+# If we want to handle all std-lib classes, fine. But then they should be in their
+# own std-lib keyword category.
+
+def send_data(data)
+ case data
+ when nil
+ put_string("NIL")
+ when String
+ send_string_data(data)
+ when Integer
+ send_number_data(data)
+ when Array
+ send_list_data(data)
+ when Time
+ send_time_data(data)
+ when Symbol
+ send_symbol_data(data)
+ else
+ data.send_data(self)
+ end
+end
+
+# snippet from Net::POP
+# class names can have numbers in them as long as they don't begin with numbers
+# Ruby doesn't internally really make much of a difference between a class name and a constant
+
+# class aliases
+ POP = POP3
+ POPSession = POP3
+ POP3Session = POP3
+
+# "member access"
+POP::Session.COUNT.attribute.calc_with(2){ |arg| puts arg }
+
+# snippet from Net::SMTP
+# This breaks the code folding. I think we would need to
+# handle the '\' that continues the statement to the next line
+# in some way to make these kind of things not break something.
+raise ArgumentError, 'both user and secret are required'\
+ unless user and secret
+
+# string escapes must detect escaping the escape char
+str = "\\"
+str = "\\\\"
+# this is not part of the string
+%x{echo \\\}\\} # prints \}\
+# this is not part of the command
diff --git a/kate/tests/highlight.rib b/kate/tests/highlight.rib
new file mode 100644
index 000000000..0ec827798
--- /dev/null
+++ b/kate/tests/highlight.rib
@@ -0,0 +1,68 @@
+# bulb.rib
+# Author: Scott Iverson <si@SpamSucks_sitexgraphics.com>
+# Date: 6/9/95
+#
+
+Display "bulb.tiff" "file" "rgb"
+
+Projection "perspective" "fov" 25
+Format 380 380 -1
+Rotate 0 0 0 1
+Rotate -0.570093918 1 0 0
+Rotate 5.71059326 0 1 0
+Translate -1 -2 10
+
+WorldBegin
+ LightSource "ambientlight" 1 "intensity" .4
+ LightSource "distantlight" 2 "intensity" .6 "from" [0 0 0] "to" [-.3 -.2 1]
+ AttributeBegin
+ Rotate -90 1 0 0
+
+ ShadingInterpolation "smooth"
+
+# base
+ Surface "metal"
+ Color 0 0 1
+ AttributeBegin
+ Orientation "rh"
+ Disk 0 .18 360
+ AttributeEnd
+
+ Cylinder .18 0 .1 360
+
+ Translate 0 0 .1
+
+ Surface "matte"
+ Color 1 1 0
+ Hyperboloid .18 0 0 .4 0 .15 360
+
+ Translate 0 0 .15
+
+ Surface "metal"
+ Color 1 .7 0
+
+ Translate 0 0 .05
+ Torus .4 .05 -90 90 360
+ Translate 0 0 0.10
+ Torus .4 .05 -90 90 360
+ Translate 0 0 0.10
+ Torus .4 .05 -90 90 360
+ Translate 0 0 0.10
+ Torus .4 .05 -90 90 360
+ Translate 0 0 0.10
+ Torus .4 .05 -90 90 360
+ Translate 0 0 0.10
+ Translate 0 0 -0.05
+
+# the glass part
+
+ Surface "plastic" "roughness" .4
+
+ Color 1 1 1
+
+ PatchMesh "bicubic" 13 "nowrap" 7 "nowrap" "P" [ 0.40 0.00 0 0.40 0.220913867 0 0.220913867 0.40 0 0.00 0.40 0 -0.220913867 0.40 0 -0.40 0.220913867 0 -0.40 0.00 0 -0.40 -0.220913867 0 -0.220913867 -0.40 0 0.00 -0.40 0 0.220913867 -0.40 0 0.40 -0.220913867 0 0.40 0.00 0 0.40 0.00 .9 0.40 0.220913867 .9 0.220913867 0.40 .9 0.00 0.40 .9 -0.220913867 0.40 .9 -0.40 0.220913867 .9 -0.40 0.00 .9 -0.40 -0.220913867 .9 -0.220913867 -0.40 .9 0.00 -0.40 .9 0.220913867 -0.40 .9 0.40 -0.220913867 .9 0.40 0.00 .9 1.0 0.0 1.34771533 1.0 0.552284667 1.34771533 0.552284667 1.0 1.34771533 0.0 1.0 1.34771533 -0.552284667 1.0 1.34771533 -1.0 0.552284667 1.34771533 -1.0 0.0 1.34771533 -1.0 -0.552284667 1.34771533 -0.552284667 -1.0 1.34771533 0.0 -1.0 1.34771533 0.552284667 -1.0 1.34771533 1.0 -0.552284667 1.34771533 1.0 0.0 1.34771533 1.0 0.0 1.9 1.0 0.552284667 1.9 0.552284667 1.0 1.9 0.0 1.0 1.9 -0.552284667 1.0 1.9 -1.0 0.552284667 1.9 -1.0 0.0 1.9 -1.0 -0.552284667 1.9 -0.552284667 -1.0 1.9 0.0 -1.0 1.9 0.552284667 -1.0 1.9 1.0 -0.552284667 1.9 1.0 0.0 1.9 1.0 0.0 2.45228467 1.0 0.552284667 2.45228467 0.552284667 1.0 2.45228467 0.0 1.0 2.45228467 -0.552284667 1.0 2.45228467 -1.0 0.552284667 2.45228467 -1.0 0.0 2.45228467 -1.0 -0.552284667 2.45228467 -0.552284667 -1.0 2.45228467 0.0 -1.0 2.45228467 0.552284667 -1.0 2.45228467 1.0 -0.552284667 2.45228467 1.0 0.0 2.45228467 0.552284667 0 2.9 0.552284667 0.305018353 2.9 0.305018353 0.552284667 2.9 0 0.552284667 2.9 -0.305018353 0.552284667 2.9 -0.552284667 0.305018353 2.9 -0.552284667 0 2.9 -0.552284667 -0.305018353 2.9 -0.305018353 -0.552284667 2.9 0.00000000 -0.552284667 2.9 0.305018353 -0.552284667 2.9 0.552284667 -0.305018353 2.9 0.552284667 0 2.9 0.001 0 2.9 0.0010 0.000552284667 2.9 0.000552284667 0.001 2.9 0 0.0010 2.9 -0.000552284667 0.0010 2.9 -0.0010 0.000552284667 2.9 -0.001 0 2.9 -0.0010 -0.000552284667 2.9 -0.000552284667 -0.0010 2.9 0.0000 -0.0010 2.9 0.000552284667 -0.0010 2.9 0.0010 -0.000552284667 2.9 0.0010 0.0000 2.9 ]
+
+AttributeEnd
+
+WorldEnd
+
diff --git a/kate/tests/highlight.scheme b/kate/tests/highlight.scheme
new file mode 100644
index 000000000..ee081d791
--- /dev/null
+++ b/kate/tests/highlight.scheme
@@ -0,0 +1,186 @@
+; This is a test file to test kates scheme highlighting
+; This is a comment
+
+;; Another comment, usually used.
+;BEGIN region marker
+;; a vektor
+#(1 2 3 4 5)
+;END region marker
+;; this represents integer 28 (FIXME: does not work perfectly atm!)
+28 028 #e28 #i28 ;; Normal, normal, exact, inexact
+#b11100 #o34 #d28 #x1c ;; Bin, okt, dec, hex
+#oe34 #eo34 ;; combined.
+
+;; char.
+(#\y #\space) ;; list: `y' space.
+(#\ #\\ #\)) ;; list of spaces, backslash and`)'.
+#\newline ;; a newline-char
+#\NewLine ;; another one :)
+
+"Hello, world" ;; a string
+
+"hoho, what do you
+want to do ;; this is NO comment
+with that?"
+
+;; R5RS definiert diese beiden.
+"Das ist \"in Anführungszeichen\" und mit \\ Backslash."
+
+(let ((x (+ 1 2)) (y "blah")) ;; `let' highlighting.
+ (and (number? x) ;; `and' highlighting.
+ (string? y)))
+
+(let* ((x 2) (y (+ x 1))) ;; `let*' too.
+ (or (negative? x) ;; `or' anyways.
+ (negative? y)))
+
+(do ((vec (make-vector 5)) ;; `do' you may guess!
+ (i 0 (+ i 1)))
+ ((= i 5) vec)
+ (vector-set! vec i i))
+
+(quasiquote ((+ 1 2) (unquote (+ 1 2))))
+;; same as: `((+ 1 2) ,(+ 1 2))
+
+;; see above.
+(quasiquote ((+ 1 2) (unquote-splicing (list 1 2 3))))
+;; same as: `((+ 1 2) ,@(+ 1 2))
+
+;; not necessary.
+(quote ())
+
+(cond ((string? x) (string->symbol x)) ;; `cond' highlighting.
+ ((symbol? x) => (lambda (x) x)) ;; `=>' highlighting.
+ (else ;; `else' highlighting.
+ (error "Blah")))
+
+(case x ;; `case' highlighting.
+ ((#t) 'true) ((#f) 'false)
+ ((()) 'null)
+ ((0) 'zero))
+
+;; highlight `let-syntax' and `syntax-rules' .
+(let-syntax ((when (syntax-rules ()
+ ((when test stmt1 stmt2 ...)
+ ;; hl `begin' .
+ (if test (begin stmt1 stmt2 ...))))))
+ (let ((if #t)) ;; here`if' is actually no keyword.
+ (when if (set! if 'now)) ;; nor here.
+ if))
+
+(letrec-syntax ...) ;; hl `letrec-syntax'.
+
+(define-syntax when
+ (syntax-rules ()
+ ((when test stmt1 stmt2 ...)
+ (if test (begin stmt1 stmt2 ...))))))
+
+;; variable definitions.
+(define natural-numbers ;; hl `define' and the var name
+ ;; endless stream of all natual numbers.
+ (letrec ((next-cell ;; hl `letrec'.
+ (lambda (x) ;; hl `lambda'.
+ ;; hl `delay' .
+ (cons x (delay (next-cell (+ x 1)))))))
+ (next-cell 0)))
+
+;; a procedure with unusual but allowed name.
+(define 1+
+ (lambda (x)
+ (+ x 1)))
+
+;; a predicate
+(define between?
+ (lambda (x y z)
+ (if (and (>= x y) (<= x z))
+ #t ;; True
+ #f))) ;; False.
+
+;; imperative procedure
+(define set-something!
+ (lambda (required-argument another-one . all-remaining-args)
+ (set-car! another-one (lambda all-args
+ (set-cdr! required-argument
+ (append all-remaining-args
+ all-args))))))
+
+(define compose
+ (lambda (f g)
+ (lambda (x)
+ (f (g x)))))
+
+;; syntactical sugar for procedure-definitions.
+(define (compose f g)
+ (lambda (x)
+ (f (g x))))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; NOW: Guile extensions ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+;; procedure-generator.
+(define ((compose f g) x)
+ (f (g x)))
+
+;; scheme doesn't say, which chars may be in variables...
+;; At least: Guile accepts umlauts
+(define-private (timetr??? sprache) ;; hl `define-private'.
+ (list-dialekt? sprache))
+
+(define-public x #t) ;; hl `define-public'.
+(define-module (foo bar)) ;; hl `define-module'.
+(define-macro (neither . exprs) ;; hl `define-macro'.
+ `(and ,@(map (lambda (x) `(not ,x)) exprs)))
+
+(defmacro neither exprs ;; `defmacro' as well.
+ `(and ,@(map (lambda (x) `(not ,x)) exprs)))
+
+;; hl, but I really don't know what this is supposed to do :-)
+(define-syntax-macro ...)
+
+;; hl GOOPS-`defines'
+(define-method (foo bar (baz <vector>) qux) ...)
+(define-class <foo> ...)
+(define-generic foo)
+(define-accessor bar)
+
+;; Keywords!
+(blah #:foo 33 #:bar 44)
+
+;; another convention for symbols:
+#{foo}#
+
+#{a
+few
+lines}#
+
+#{4711}#
+
+;; more chars.
+#\nul #\nl #\esc #\bs #\bel #\syn #\ack #\sp ;; etc, utc, itc, oops (this is boring)
+
+#!
+ guile block-comment.
+!#
+
+;; now, a bit hairy:
+#! comment !#
+still comment!!!
+!#
+'now-no-comment-anymore
+
+;; more precise:
+#! comment !#
+still comment
+!# still comment!
+!#
+'now-no-comment-anymore
+
+(while (> foo 10) ;; Highlight `while'.
+ (set! foo (- foo 1))
+ (catch #t ;; Highlight `catch'.
+ (lambda () (display foo))
+ (lambda (key . args)
+ (if (eq? key 'system-error)
+ (break) ;; Highlight `break'.
+ (continue))))) ;; Highlight `continue'. \ No newline at end of file
diff --git a/kate/tests/highlight.sh b/kate/tests/highlight.sh
new file mode 100644
index 000000000..bdac6e4f2
--- /dev/null
+++ b/kate/tests/highlight.sh
@@ -0,0 +1,198 @@
+#! /bin/sh
+# This is a test script for the Katepart Bash Syntax Highlighting by
+# Wilbert Berendsen. This is not runnable !!!
+
+
+# The highlighting recognizes basic types of input, and has a few special cases that
+# are all in FindCommands. The main objective is to create really proper nesting of
+# (multiline) strings, variables, expressions, etc.
+
+
+
+# ============== Tests: ===============
+
+# basic types:
+echo 'single quoted string'
+echo "double quoted string"
+echo $'string with esc\apes\x0din it'
+echo $"string meant to be translated"
+
+
+# comments:
+# this is a comment
+#this too
+echo this is#nt a comment
+dcop kate EditInterface#1 #this is
+
+
+# brace expansion
+mv my_file.{JPG,jpg}
+
+
+# special characters are escaped:
+echo \(output\) \&\| \> \< \" \' \*
+
+
+# variable substitution:
+echo $filename.ext
+echo $filename_ext
+echo ${filename}_ext
+echo text${array[$subscript]}.text
+echo text${array["string"]}.text
+echo ${!prefix*}
+echo ${!redir}
+echo short are $_, $$, $?, ${@}, etc.
+echo ${variable/a/d}
+echo ${1:-default}
+
+
+# expression subst:
+echo $(( cd << ed + 1 ))
+
+
+# command subst:
+echo $(ls -l)
+echo `cat myfile`
+
+
+# file subst:
+echo $(<$filename)
+echo $(</path/to/myfile)
+
+# process subst:
+sort <(show_labels) | sed 's/a/bg' > my_file.txt 2>&1
+
+
+# All substitutions also work in strings:
+echo "subst ${in}side string" 'not $inside this ofcourse'
+echo "The result is $(( $a + $b )). Thanks!"
+echo "Your homedir contains `ls $HOME |wc -l` files."
+
+
+# Escapes in strings:
+p="String \` with \$ escapes \" ";
+
+
+# keywords are black, builtins dark purple and common commands lighter purple
+set
+exit
+login
+
+
+# Other colorings:
+error() {
+ cat /usr/bin/lesspipe.sh
+ runscript >& redir.bak
+ exec 3>&4
+}
+
+
+# do - done make code blocks
+while [ $p -lt $q ]
+do
+ chown 0644 $file.$p
+done
+
+
+# braces as well
+run_prog | sort -u |
+{
+ echo Header
+ while read a b d
+ do
+ echo $a/$b/$c
+ done
+ echo Footer
+}
+
+
+# Any constructions can be nested:
+echo "A long string with $(
+ if [ $count -gt 100 ] ; then
+ echo "much"
+ else
+ echo "not much"
+ fi ) substitutions." ;
+
+
+# Even the case construct is correctly folded:
+test -f blaat &&
+( do_something
+ case $p in
+ *bak)
+ do_bak $p
+ ;;
+ *)
+ dont_bak $p
+ ;;
+ esac
+) # despite the extra parentheses in the case construction.
+
+
+# variable assignments:
+DIR=/dev
+p=`ls`
+LC_ALL="nl" dcop 'kate*'
+_VAR=val
+ARR=(this is an array)
+ARR2=([this]=too [and]="this too")
+usage="$0 -- version $VERSION
+Multiple lines of output
+can be possible."
+ANSWER=yes # here 'yes' isn't highlighed as command
+
+
+# Some commands expect variable names, these are colored correctly:
+export PATH=/my/bin:$PATH BLAAT
+export A B D
+local p=3 x y='\'
+read x y z <<< $hallo
+unset B
+declare -a VAR1 VAR2 && exit
+declare less a && b
+
+# options are recoqnized:
+zip -f=file.zip
+./configure --destdir=/usr
+make destdir=/usr/
+
+
+# [[ and [ correctly need spaces to be regarded as structure,
+# otherwise they are patterns (currently treated as normal text)
+if [ "$p" == "" ] ; then
+ ls /usr/bin/[a-z]*
+elif [[ $p == 0 ]] ; then
+ ls /usr/share/$p
+fi
+
+# Fixed:
+ls a[ab]* # dont try to interprete as assignment with subscript (fixed)
+a[ab]
+a[ab]=sa
+
+
+# Here documents are difficult to catch:
+cat > myfile << __EOF__
+You're right, this is definitely no bash code
+But ls more $parameters should be expanded.
+__EOF__
+
+
+# quoted:
+cat << "EOF" | egrep "this" >&4 # the rest of the line is still considered bash source
+You're right, this is definitely no bash code
+But ls more $parameters should be expanded. :->
+EOF
+
+
+# indented:
+if true
+then
+ cat <<- EOF
+ Indented text with a $dollar or \$two
+ EOF
+elif [ -d $file ]; then
+ cat <<- "EOF"
+ Indented text without a $dollar
+ EOF
+fi
diff --git a/kate/tests/highlight.sp b/kate/tests/highlight.sp
new file mode 100644
index 000000000..046dfea70
--- /dev/null
+++ b/kate/tests/highlight.sp
@@ -0,0 +1,32 @@
+*current sink p-type inverter - dc sweep of voltage I/O
+*file:invcsp0.sp
+
+*parameters
+.PARAM ww=38.5 $ parameter for width which will be swept
+
+*circuit net list
+Vdd vdd GND dc 5.0
+Vbias bias GND dc 2.5
+Vin src GND dc 0.0
+Mn out bias GND GND nmosl1 W=16 L=8
+Mp out in vdd vdd pmosl1 W=ww L=8
+Cl out GND 0.01P
+Rs src in 10K
+
+*options & analysis
+.OPTIONS POST=2 SCALE=1U $ output results for plot; scale mosfet L & W dimensions
+.DC Vin 0 5 0.1 $sweep I/P voltage
+.MEASURE DC vin_bal WHEN V(out)=2.5
+
+*output
+.plot DC v(src) v(in) v(out)
+
+*mosfet models - level 1
+.INC 'l1typ.inc'
+
+$ a comment
+* another comment
+
+.END
+
+
diff --git a/kate/tests/highlight.tcl b/kate/tests/highlight.tcl
new file mode 100644
index 000000000..d6b7276de
--- /dev/null
+++ b/kate/tests/highlight.tcl
@@ -0,0 +1,50 @@
+# tcl syntax highlighting sample script for Kate
+#
+# author: JM. Philippe 15/03/04
+
+# escaped characters
+set String \{
+set String \{
+set String \"
+set String " \" "
+set String " \{ "
+
+#comments and not comments
+# is comments
+;#is comments
+ # is comments
+# <h1> is html comment </h1>
+puts ok; # is comments
+set String [string map {</a> {<span>&#187;is not comments</span></a>}} $String]
+set String \#not_a_comment
+
+# blocks
+proc test {arg1 {arg2 {}} {arg3 {fr fq r}}} {
+ if {1} {; #comments
+ set String \{; # not a block start
+ }
+}
+
+proc test args {
+ set String \}; # not a block end
+}
+
+# BEGIN - collapsable comments
+# blablabla
+# END
+
+# strings
+set String "feqr feqr $gqer gqe"
+set String "feqr
+feqr \" $gqer \
+gqe
+"
+set String {feqr
+feqr \{ $gqer \
+gqe
+}
+
+# variables
+set b+1 [incr b]
+set {incr-b} ${b+1}
+puts ${incr-b}
diff --git a/kate/tests/highlight.tex b/kate/tests/highlight.tex
new file mode 100644
index 000000000..b706f708b
--- /dev/null
+++ b/kate/tests/highlight.tex
@@ -0,0 +1,73 @@
+% LaTeX test file for kate's syntax highlighting and code folding
+
+\ordinaryLaTeXcommandwithoption[10pt,a4paper]{article}
+% BEGIN region
+%comment, this is all ok % $
+\%no comments please
+\\%comment
+% END of region
+
+\newcommand{\nohighlighting}
+
+\section{normal}
+
+\ref{blue}
+\pageref{blue}
+\cite{blue}
+
+\begin{environmentshavespecialcolors}
+normal
+\end{environmentshavespecialcolors}
+
+$equations are green, \commands somewhat darker$
+normal
+$$equations are green, \commands somewhat darker$$
+normal
+\(
+\frac{1}{2}
+\begin{test}
+\end{test}
+\)
+normal
+\[
+%comment
+displaymath
+\]
+normal
+\begin{equation}
+green\darkergreen
+\begin{test}
+\test
+\end{test}
+\end{equation}
+
+\begin{equation*}
+green\darkergreen
+%comment
+\begin{test}
+\test
+\end{test}
+\%no comment
+\end{equation*}
+
+\{ %this should be comment
+
+\verb%this shouldn't be%and this should be normal text
+
+\begin{verbatim}
+text inside a verbatim environment is also treated special $ %,
+you can even put a \begin{verbatim} inside
+\end{verbatim}
+
+normal
+
+\begin{Verbatim}
+&@@#^%&^#$
+\end{Verbatim}
+
+
+\begin{Verbatim*}
+@*&^#@*(^#(*@&
+\end{Verbatim*}
+
+normal \ No newline at end of file
diff --git a/kate/tests/highlight.wrl b/kate/tests/highlight.wrl
new file mode 100644
index 000000000..2fb4b41c6
--- /dev/null
+++ b/kate/tests/highlight.wrl
@@ -0,0 +1,41 @@
+#VRML V2.0 utf8
+#
+# VRML highlighting test for Kate's syntax highlighting
+#
+
+# Keywords
+DEF, EXTERNPROTO, FALSE, IS, NULL, PROTO, ROUTE, TO, TRUE, USE, eventIn,
+eventOut, exposedField, field
+
+# Data types
+MFColor, MFFloat, MFInt32, MFNode. MFRotation, MFString, MFTime, MFVec2f,
+MFVec3f, SFBool, SFColor, SFFloat, SFImage, SFInt32, SFNode, SFRotation,
+SFString, SFTime, SFVec2f, SFVec3f
+
+# Predefined nodes
+Anchor, Appearance, AudioClip, Background, Billboard, Box, Collision, Color,
+ColorInterpolator, Cone, Coordinate, CoordinateInterpolator, Cylinder,
+CylinderSensor, DirectionalLight, ElevationGrid, Extrusion, Fog, FontStyle,
+Group, ImageTexture, IndexedFaceSet, IndexedLineSet, Inline, LOD, Material,
+MovieTexture, NavigationInfo, Normal, NormalInterpolator, OrientationInterpolator,
+PixelTexture, PlaneSensor, PointLight, PointSet, PositionInterpolator,
+ProximitySensor, ScalarInterpolator, Script, Shape, Sound, Sphere, SphereSensor,
+SpotLight, Switch, Text, TextureCoordinate, TextureTransform, TimeSensor,
+TouchSensor, Transform, Viewpoint, VisibilitySensor, WorldInfo
+
+# Some real VRML constructs to see if highlighting of int, float etc. works
+NavigationInfo {
+ avatarSize [0.25, 1.6, 0.75]
+ headlight TRUE
+ speed 1
+ type ["WALK", "ANY"]
+ visibilityLimit 0.0
+}
+
+# some further testing for strings: linefeeds are allowed within strings
+Text {
+ string ["some special in-string characters: \" \\
+ some more text in the next line
+ and yet another line"]
+}
+
diff --git a/kate/tests/highlight.xml b/kate/tests/highlight.xml
new file mode 100644
index 000000000..007449c29
--- /dev/null
+++ b/kate/tests/highlight.xml
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+<!-- we need this tags or this is no valid file -->
+
+
+This is a pseudo XML file to test Kate's XML syntax highlighting.
+
+Doctype:
+ <!DOCTYPE HTML PUBLIC "-//SOME_DOCTYPE 0.01//EN" SYSTEM "foobar.dtd">
+
+Processing instruction:
+ <?php processing instruction ?>
+
+Comments:
+ <!-- a comment -->
+ <!-- another comment,
+ using more than one line -->
+
+Comment inside element:
+ <element attr="foobar">content<!-- comment --></element>
+
+Markup inside comment:
+ <!--
+ This is a comment!
+ <element inside_comment />
+ -->
+
+Empty element:
+ <empty/>
+ <empty />
+
+Simple element plus content:
+ <element>some content</element>
+ <element attr="foobar">some
+ content</element>
+
+Namespace for elements and attributes:
+ <ns:element>content</ns:element>
+ <element ns:attr="content content">content</element>
+
+Elements containing allowed characters:
+ <element-dash foo="test"/>
+ <element.dot foo="test"/>
+
+Elements containing allowed start characters:
+ <:element foo="test"/>
+ <_element foo="test"/>
+
+Single quotes (the same as double quotes):
+ <element attr='content &nbsp; content'>content</element>
+
+Allowed Whitespace:
+ <element attr = "test" >
+ content</element>
+
+Entities:
+ &nbsp;
+ &#229;
+ &#xE5;
+ &#Xe5;
+ &#1048;
+ &#x6C34;
+ <element attr="foo &nbsp; &#229; &amp; bar"/>
+
+Illegal XML, should not be highlighted:
+ <0foobar> -- no digit as first character
+ <-foo> -- no dash as first character
diff --git a/kate/tests/highlight.xsl b/kate/tests/highlight.xsl
new file mode 100644
index 000000000..f6e0efb12
--- /dev/null
+++ b/kate/tests/highlight.xsl
@@ -0,0 +1,109 @@
+<?xml version="1.0" encoding="iso-8859-15"?>
+
+<!--
+ This file is freely distributable, created by Wilbert Berendsen (wbsoft@xs4all.nl)
+
+ This is just a simple XSLT file that converts some HTML pages to a XBEL bookmarklist.
+ It is included here to test the new XSLT highlighting by Peter Lammich.
+
+ TODO: add better test file.
+-->
+
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
+xmlns:h="http://www.w3.org/1999/xhtml">
+<xsl:output method="xml" encoding="iso-8859-15" indent="yes"
+ doctype-public="+//IDN python.org//DTD XML Bookmark Exchange Language 1.0//EN//XML"
+ doctype-system="http://www.python.org/topics/xml/dtds/xbel-1.0.dtd"
+/>
+
+<!-- main -->
+<xsl:template match="/">
+<xbel><folder><title>Linux at Home Links</title>
+<xsl:for-each select="//*[@id='maincontents']//h:li">
+ <xsl:variable name="f" select="document(h:a/@href)/h:html"/>
+ <folder>
+ <title><xsl:value-of select="h:a/h:strong"/></title>
+ <desc><xsl:value-of select="normalize-space(h:a/text())"/></desc>
+ <xsl:for-each select="$f//h:div[@id='maincontents']">
+ <xsl:call-template name="getbookmarks"/>
+ </xsl:for-each>
+
+ </folder>
+</xsl:for-each>
+</folder></xbel>
+</xsl:template>
+<!-- end of main -->
+
+<!-- get bookmarks from a page -->
+<xsl:template name="getbookmarks">
+
+<xsl:choose>
+ <!-- harvest links from p or li elements -->
+ <xsl:when test="self::h:li or self::h:p">
+ <xsl:variable name="t" select="normalize-space()"/>
+ <xsl:for-each select=".//h:a[1]">
+ <xsl:call-template name="bookmark">
+ <xsl:with-param name="desc" select="$t"/>
+ </xsl:call-template>
+ </xsl:for-each>
+ <xsl:for-each select=".//h:a[position()!=1]">
+ <xsl:call-template name="bookmark"/>
+ </xsl:for-each>
+ </xsl:when>
+
+
+ <xsl:otherwise>
+ <xsl:for-each select="*">
+ <xsl:call-template name="getbookmarks"/>
+ </xsl:for-each>
+ </xsl:otherwise>
+
+</xsl:choose>
+
+</xsl:template>
+
+
+<xsl:template name="bookmark">
+ <xsl:param name="href" select="@href"/>
+ <xsl:param name="desc" select="''"/>
+ <xsl:param name="title" select="normalize-space()"/>
+
+ <xsl:variable name="realdesc">
+ <xsl:choose>
+ <xsl:when test="starts-with($desc,$title)">
+ <xsl:choose>
+ <xsl:when test="starts-with(translate(substring-after($desc,$title),',.;','...'),'.')">
+ <xsl:value-of select="substring($desc,string-length($title) + 2)"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="substring-after($desc,$title)"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$desc"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+
+ <bookmark>
+ <xsl:attribute name="href">
+ <xsl:choose>
+ <xsl:when test="starts-with($href,'http://') or starts-with($href,'ftp://') or starts-with($href,'mailto:')">
+ <xsl:value-of select="$href"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="concat('http://www.xs4all.nl/~wbsoft/linux/links/',$href)"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:attribute>
+ <title><xsl:value-of select="normalize-space($title)"/></title>
+ <xsl:if test="normalize-space($realdesc) != ''">
+ <desc><xsl:value-of select="normalize-space($realdesc)"/></desc>
+ </xsl:if>
+ </bookmark>
+</xsl:template>
+
+
+
+</xsl:stylesheet>
diff --git a/kate/tests/highlight.y b/kate/tests/highlight.y
new file mode 100644
index 000000000..f7715e6db
--- /dev/null
+++ b/kate/tests/highlight.y
@@ -0,0 +1,54 @@
+/* Yacc / Bison hl test file.
+ * It won't compile :-) Sure !
+ */
+
+%{
+
+#include <iostream>
+using namespace std;
+
+extern KateParser *parser;
+
+%}
+
+%locations
+
+%union {
+ int int_val;
+ double double_val;
+ bool bool_val;
+ char *string_val;
+ char *ident_val;
+ struct var *v;
+ void *ptr;
+}
+
+%token <int_val> TOK_NOT_EQUAL "!="
+%token <int_val> TOK_LESSER_E "<="
+%token <int_val> TOK_GREATER_E ">="
+%token <int_val> TOK_EQUAL_2 "=="
+
+%type <int_val> type type_proc
+
+%%
+
+prog: KW_PROGRAM ident { parser->start($2); } prog_beg_glob_decl instructions { parser->endproc(0); } dev_procedures KW_ENDP ;
+
+number: integer_number
+ | TOK_DOUBLE
+ {
+ $$ = new var;
+ $$->type = KW_REEL;
+ $$->cl = var::LITTERAL;
+ $$->real = $<int_val>1;
+ };
+
+%%
+
+#include <stdio.h>
+
+int main(void)
+{
+ puts("Hello, World!");
+ return 0;
+}
diff --git a/kate/tests/highlight_lpc.c b/kate/tests/highlight_lpc.c
new file mode 100644
index 000000000..fe5c62979
--- /dev/null
+++ b/kate/tests/highlight_lpc.c
@@ -0,0 +1,64 @@
+// NOTE: This is a test file for kate's LPC syntax highlighting.
+
+// This is a Single-Line Comment
+/* This is a Multi-
+ Line Comment */
+
+// This again is a Single-Line Comment which should end here /*
+
+// And this is an evil single line comment \
+ which should include this and the next line because of the \
+ Do not use this style at home, kids.
+// BEGIN region marker
+
+// END of region marker
+
+private void create()
+{
+// Some Preprocessor stuff:
+#define SOME_STUFF if(foo("bar")) \
+ { \
+ bar("foo"); \
+ } // Preprocessor, Keyword, Preprocessor-String, Multiline
+
+ // Some closures:
+ #'create;
+ #'?!;
+
+
+ /* Some other Data Types: */
+
+ int i = 1; // Integer.
+ float b = 2.34; // Float.
+ int c = 0b001; // Binary
+ int e = 0x019Beef; // Hexadecimal
+ int f = 0o2345; // Octal
+ string a = "Wheee"; // String
+ string x = "Wheee\
+ heee"; // Multi-Line String, again, don't use this.
+
+
+
+ /* Some keywords: */
+ if(1)
+ {
+ switch(2)
+ {
+ case 3:
+ 4;
+ break;
+ }
+ }
+
+ else
+ {
+ return 0;
+ }
+}
+
+/*
+WARNING: If the above function is part of a multi-line comment,
+ it's buggy. The WARNING: itself should be a comment-keyword.
+ That's not actually part of the language, but simply used
+ to highlight important stuff inside comments like TODO: etc.
+*/
diff --git a/kate/tests/highlight_ocaml.ml b/kate/tests/highlight_ocaml.ml
new file mode 100644
index 000000000..dc1717a82
--- /dev/null
+++ b/kate/tests/highlight_ocaml.ml
@@ -0,0 +1,105 @@
+(* ocaml test file -- a big stew of Objective Caml syntax to use to
+ test Kate's syntax highlighting. This will not run! :-) *)
+
+(* First a little piece of real OCaml that should look right: *)
+
+ #load "basic";;
+ (* Return a default value for a BASIC variable given its identifer. *)
+ let default_value (ident : string) : basic_value =
+ assert (String.length ident > 0);
+ match ident.[String.length ident - 1] with
+ | '$' -> Str ""
+ | '%' -> Int 0
+ | '!' -> Flt 0.0
+ | _ -> Flt 0.0
+ ;;
+
+(* Directives: *)
+#load "pa_o";;
+ #load "pa_o";;
+object # meth ;; (* not a directive - a method call *)
+object
+ # meth ;; (* not a directive - a method call *)
+
+(* OCaml keywords: *)
+and as assert asr (* etc. there so many... *)
+
+(* Additional OCaml Revised Syntax keywords: *)
+(* These are in a seperate category so they can be coloured to look
+ like identifiers when ordinary OCaml syntax is being used: *)
+declare where value
+
+(* There's no way to reliably highlight all OCaml type expressions,
+ (they can be very complex) so just the built-in type names are highlighted.*)
+exn lazy_t format unit int real char string ref array bool list option
+
+
+let integers : int list = [
+ 123456789; (* decimal *)
+ -0xabcedf0123456789; (* hexadecimal *)
+ 0xABCDEF0123456789; (* hexadecimal *)
+ -0o1234567; (* octal *)
+ 0b01001010101010; (* binary *)
+ -0Xabcedf0123456789; (* hexadecimal *)
+ 0XABCDEF0123456789; (* hexadecimal *)
+ -0O1234567; (* octal *)
+ 0B01001010101010; (* binary *)
+ -123_456_789; (* Underscores are allowed in numeric constants. *)
+ 0x_abce_df01_2345_6789;
+ -0o12_34_567;
+ 0b_0100_1010_1010_1101;
+];;
+
+let floats : real list = [
+ 12345.6789;
+ -1.23456789e4; (* All variations of the exponent form *)
+ 1.23456789e+4;
+ -1.23456789e-4;
+ 1.23456789E-4;
+ -1.23456789E+4;
+ 12_345.6789; (* Underscores are allowed in numeric constants. *)
+ -1.23_456_789e+4;
+ 12_345.6789;
+];;
+
+let characters : char list = [
+ 'a';
+ ' ';
+ 'ä';
+ '\n'; '\r'; '\t'; '\b'; (* Control characters. Only these four: not the full C-language range. *)
+ '\000'; '\128'; (* Decimal character codes. These are always 3 digits. *)
+ '\x02'; '\xff'; '\xFF'; (* Hexadecimal character codes. These are always 3 digits. *)
+ '\\'; '\''; '\"'; '"' (* Quote character escapes. *)
+];;
+
+(* Quotes used to mark constants in parsers should
+ not be confused with character constant quotes.
+ "Ticks" at the end of identifiers should
+ not be confused with character constant quotes. *)
+let basic_identifier =
+ parser
+ [< ''F'; ''N'; name = s >] -> ID (s, 'f')
+ | [< name = s' >] -> ID (s','i')
+;;
+
+let strings : string list = [
+ ""; (* Empty string *)
+ "a"; " "; "ä"; "ab";
+ "A\nB"; "A\rB"; "A\tB"; "A\bB"; (* Control characters. Only these four: not the full C-language range. *)
+ "A\000B"; "A\128B"; (* Decimal character codes. These are always 3 digits. *)
+ "A\x02B"; "A\xffB"; "A\xFFB"; (* Hexadecimal character codes. These are always 3 digits. *)
+ "A\\B"; "A\'B"; "A'B"; "A\"B"; (* Quote character escapes. *)
+ "A multiline\
+ string";
+];
+
+let camlp4_quotations = [
+ <<A Camlp4 source code quotation.>> ;
+ <:QUOTE<A labelled Camlp4 source code quotation.>> ;
+ <:QUÖTÈ<A labelled Camlp4 source code quotation. (Latin-1 identifier.)>> ;
+ << A quote with an escape: \>> (end-quote symbol) >> ;
+ << A quote with an escape: \<< (plain start quote-symbol) >> ;
+ << A quote with an escape: \<:Trouvé< (labelled start-quote symbol) >> ;
+];;
+
+(* end *)
diff --git a/kate/tests/highlight_octave.m b/kate/tests/highlight_octave.m
new file mode 100644
index 000000000..1f96036b8
--- /dev/null
+++ b/kate/tests/highlight_octave.m
@@ -0,0 +1,74 @@
+##=====================================================
+% Octave test code for Kate/Kwrite syntax highlighting
+% (shamelessly copied from Matlab's, since the two
+% are very similar)
+% kate: hl Octave;
+##=====================================================
+
+% Numbers _____________________________________________
+5, 5.5, .1, 0.1, 0.4e5, 1.2e-5, 5i, 5.3i, 6j, .345+3i
+5', 5.5', .1', 0.1', 0.4e5', 1.2e-5', 5i', 5.3i', 6j', .345+3i'
+
+% Operators ___________________________________________
+% relational operators
+'asdf'~=4, c<=4, d>=4, a<b, a>b, a==b, b||c, b&&c
+% elementwise arithmetic operators
+a.^b, a.*b a./b, 1:4:5
+% single-character binary arithmetic
+a+3, a-3, a*2, a^3, a/3, a\3, a|b, a&b
+% unary operators
+a = ~g; g = @sfdgdsf(sdfsd,345); g.' + 1i.' - ('asdf').'
+% separators and delimiter
+(asd),[sadf];{asdf},;;,;;;()
+% continuation
+a = 1+ ...
+ 2;
+
+% Strings and adjoint _________________________________
+% incomplete strings
+'string
+'str''
+'str''ing
+'str''\'
+% complete strings
+'string' % simple string
+'''' '\'' % strings containing '
+'str''ing' % one string containing '
+'string' 'string' % two strings
+'asdf' "asdf""" variable % two strings and a variable
+'asdf''asdf'' fsgdfg' + (asdf)' - 'asdf'.' + []''''.';''
+'sadf'.' % string transpose
+% adjoint
+{'asdf'}' + 1
+('asdf')' + 1
+['asdf']' + 1
+'' var''' % empty string, var with >1 adjoints
+[5]'*{5}'*('asd')'.'+(5)'*6'*asdf'*asdf'.' % many adjoints
+A'*B + 1 % adjoint
+A.'*B + 1 % transpose
+A.'.'*B + 1 % double transpose
+A'.' + 1 % adjoint, then transpose
+A.'' % transpose, then adjoint
+
+% System command ______________________________________
+!hostname
+!cp * /tmp
+
+% Reserved keywords ___________________________________
+function, persistent, global
+endfunction
+
+switch, case, otherwise
+endswitch
+
+if, else, elseif
+endif
+
+try, end_try_catch
+for, while, break, continue
+endfor
+
+endwhile
+return
+function, FUNCTION, Function % case sensitive!
+endfunction \ No newline at end of file
diff --git a/kate/tests/test.js b/kate/tests/test.js
new file mode 100644
index 000000000..2dfe86c5b
--- /dev/null
+++ b/kate/tests/test.js
@@ -0,0 +1,134 @@
+/* test.js - test for javascript.xml syntax file */
+// Note: this script will not, and is not supposed to, comile in any js engine.
+
+/*
+ NOTE: The words "todo", "fixme" and "note" should be rendered in a different style
+ within comments, match should be caseless (to test for regexp insensitive attribute).
+ The regex used for this rule is */
+ String = /\b(?:fixme|todo|note)\b/
+ /* Thus, for example "Notebook" is not caught by
+ this rule. (the "?:" in the subpattern is there to avoid the regex engine wasting time
+ saving a backref, which is not used for anything. I do not know if the overhead of parsing
+ that is greater than the time saved by not capturing the text...)
+ The rule for catching these words is placed in a context "Comment common", which is used
+ by both comment contexts (single line, multiline) using the new "IncludeRules" item.
+*/
+
+// test if regex support works - nice with new fallthrough prop in context:)
+somestring.replace( /dooh/ , "bah!");
+re=/foo/ig; // hehe
+
+somestring.search(
+ /^foo\w+\s\d{0,15}$/
+ );
+
+ re =
+ /dooh/;
+
+// This is supposedly legal:
+re = somebool ? /foo/ : /bar/;
+
+// NOTE - Special case: an empty regex, not a comment.
+// The rule uses a positive lookahead assertion to catch it: "//(?=;)".
+re = //;
+re = /a|b/;
+
+/*
+ Tests for the regex parser.
+ It will parse classes, quanitfiers, special characters and regex operaters,
+ as specified in the netscape documentation for javascript.
+ Regexps are only parsed in their clean form, as the RegExp(string) constructor
+ is using a quoted string.
+ TODO: Find out if more regex feats should be supported.
+ Consider using more itemDatas - assertion, quantifier are options.
+*/
+
+re = /^text\s+\d+\s*$/;
+re = /a pattern with caret \(^\) in it/;
+re = /(\d{0,4})\D/;
+re = /[a-zA-Z_]+/;
+re = /[^\d^]+/;
+re = /\s+?\w+\.$/;
+re = /\/\//;
+re = /a|b/;
+
+// a test if #pop back from a comment will work
+re = /*/foo/*/ /bar/;
+// ^ POP
+// ^ we got back after pop in comment, if there is regexp attribs here :-)
+
+/*
+ Some tests if the fallthrough works.
+ The fallthrough happens if a regexp is not found in a possible (!) position,
+ which is after "search(" or "replace(" or "=" or "?" or ":" in version 0.1 of the xml file
+*/
+
+var foo = 'bar';
+// ^ fallthrough!
+
+
+somestring.replace( new RegExp("\\b\\w+\\b"), "word: $1");
+// ^ fallthrough expected. ("new" whould be bold)
+
+
+something.method =
+ function ( a, b, c ) { /* ... */ }
+// ^ fallthrough ?!
+
+something.other =
+function ( d, e, f ) { /* ... */ }
+// fallthrough expected at col 0 ("function" should be bold)
+
+var ary = new Array(5);
+// ^ fallthrough ? (if keyword is correctly rendered)
+
+var b = a ? 1 : 0;
+// ^ ^ fallthroughs. numbers must be rendered correctly.
+
+var c = d ? true : false;
+
+var conditinalstring = b ?
+ "something" :
+ "something else";
+// guess...
+
+
+/*
+ Normal program flow...
+*/
+
+if (something)
+ dostuff();
+else
+ dont();
+
+ return;
+
+try { bla() } catch (e) { alert("ERROR! : " + e) }
+
+for (int i=0; i < j; i++)
+ document.write("i is" + i + "<br>");
+
+while (something)
+{
+ block();
+ picky:
+ if (!1)
+ break;
+ else
+ continue;
+}
+
+with (a) {
+ do {
+ stuff( b ); // a.b if it exists
+ } while (itmakessense);
+}
+
+switch (i) {
+ case 0:
+ f();
+ break;
+ default:
+ break;
+}
diff --git a/kate/tests/test.uc b/kate/tests/test.uc
new file mode 100644
index 000000000..be53bccee
--- /dev/null
+++ b/kate/tests/test.uc
@@ -0,0 +1,266 @@
+//=============================================================================
+// Shield Gun
+//=============================================================================
+class ShieldGun extends Weapon
+ config(user);
+
+#EXEC OBJ LOAD FILE=InterfaceContent.utx
+
+var Sound ShieldHitSound;
+var String ShieldHitForce;
+
+replication
+{
+ reliable if (Role == ROLE_Authority)
+ ClientTakeHit;
+}
+
+simulated function DoAutoSwitch()
+{
+}
+
+simulated event RenderOverlays( Canvas Canvas )
+{
+ local int m;
+
+ if ((Hand < -1.0) || (Hand > 1.0))
+ {
+ for (m = 0; m < NUM_FIRE_MODES; m++)
+ {
+ if (FireMode[m] != None)
+ {
+ FireMode[m].DrawMuzzleFlash(Canvas);
+ }
+ }
+ }
+ Super.RenderOverlays(Canvas);
+}
+
+// AI Interface
+function GiveTo(Pawn Other, optional Pickup Pickup)
+{
+ Super.GiveTo(Other, Pickup);
+
+ if ( Bot(Other.Controller) != None )
+ Bot(Other.Controller).bHasImpactHammer = true;
+}
+
+function bool CanAttack(Actor Other)
+{
+ return true;
+}
+
+simulated function Timer()
+{
+ local Bot B;
+
+ if (ClientState == WS_BringUp)
+ {
+ // check if owner is bot waiting to do impact jump
+ B = Bot(Instigator.Controller);
+ if ( (B != None) && B.bPreparingMove && (B.ImpactTarget != None) )
+ {
+ B.ImpactJump();
+ B = None;
+ }
+ }
+ Super.Timer();
+ if ( (B != None) && (B.Enemy != None) )
+ BotFire(false);
+}
+
+function FireHack(byte Mode)
+{
+ if ( Mode == 0 )
+ {
+ FireMode[0].PlayFiring();
+ FireMode[0].FlashMuzzleFlash();
+ FireMode[0].StartMuzzleSmoke();
+ IncrementFlashCount(0);
+ }
+}
+
+/* BestMode()
+choose between regular or alt-fire
+*/
+function byte BestMode()
+{
+ local float EnemyDist;
+ local bot B;
+
+ B = Bot(Instigator.Controller);
+ if ( (B == None) || (B.Enemy == None) )
+ return 1;
+
+ EnemyDist = VSize(B.Enemy.Location - Instigator.Location);
+ if ( EnemyDist > 2 * Instigator.GroundSpeed )
+ return 1;
+ if ( (B.MoveTarget != B.Enemy) && ((EnemyDist > 0.5 * Instigator.GroundSpeed)
+ || (((B.Enemy.Location - Instigator.Location) Dot vector(Instigator.Rotation)) <= 0)) )
+ return 1;
+ return 0;
+}
+
+// super desireable for bot waiting to impact jump
+function float GetAIRating()
+{
+ local Bot B;
+ local float EnemyDist;
+
+ B = Bot(Instigator.Controller);
+ if ( B == None )
+ return AIRating;
+
+ if ( B.bPreparingMove && (B.ImpactTarget != None) )
+ return 9;
+
+ if ( B.PlayerReplicationInfo.HasFlag != None )
+ {
+ if ( Instigator.Health < 50 )
+ return AIRating + 0.35;
+ return AIRating + 0.25;
+ }
+
+ if ( B.Enemy == None )
+ return AIRating;
+
+ EnemyDist = VSize(B.Enemy.Location - Instigator.Location);
+ if ( B.Stopped() && (EnemyDist > 100) )
+ return 0.1;
+
+ if ( (EnemyDist < 750) && (B.Skill <= 2) && !B.Enemy.IsA('Bot') && (ShieldGun(B.Enemy.Weapon) != None) )
+ return FClamp(300/(EnemyDist + 1), 0.6, 0.75);
+
+ if ( EnemyDist > 400 )
+ return 0.1;
+ if ( (Instigator.Weapon != self) && (EnemyDist < 120) )
+ return 0.25;
+
+ return ( FMin(0.6, 90/(EnemyDist + 1)) );
+}
+
+// End AI interface
+
+function AdjustPlayerDamage( out int Damage, Pawn InstigatedBy, Vector HitLocation,
+ out Vector Momentum, class<DamageType> DamageType)
+{
+ local int Drain;
+ local vector Reflect;
+ local vector HitNormal;
+ local float DamageMax;
+
+ DamageMax = 100.0;
+ if ( DamageType == class'Fell' )
+ DamageMax = 20.0;
+ else if( !DamageType.default.bArmorStops || (DamageType == class'DamTypeShieldImpact' && InstigatedBy == Instigator) )
+ return;
+
+ if ( CheckReflect(HitLocation, HitNormal, 0) )
+ {
+ Drain = Min( Ammo[1].AmmoAmount*2, Damage );
+ Drain = Min(Drain,DamageMax);
+ Reflect = MirrorVectorByNormal( Normal(Location - HitLocation), Vector(Instigator.Rotation) );
+ Damage -= Drain;
+ Momentum *= 1.25;
+ Ammo[1].UseAmmo(Drain/2);
+ DoReflectEffect(Drain/2);
+ }
+}
+
+function DoReflectEffect(int Drain)
+{
+ PlaySound(ShieldHitSound, SLOT_None);
+ ShieldAltFire(FireMode[1]).TakeHit(Drain);
+ ClientTakeHit(Drain);
+}
+
+simulated function ClientTakeHit(int Drain)
+{
+ ClientPlayForceFeedback(ShieldHitForce);
+ ShieldAltFire(FireMode[1]).TakeHit(Drain);
+}
+
+function bool CheckReflect( Vector HitLocation, out Vector RefNormal, int AmmoDrain )
+{
+ local Vector HitDir;
+ local Vector FaceDir;
+
+ if (!FireMode[1].bIsFiring || Ammo[0].AmmoAmount == 0) return false;
+
+ FaceDir = Vector(Instigator.Controller.Rotation);
+ HitDir = Normal(Instigator.Location - HitLocation + Vect(0,0,8));
+ //Log(self@"HitDir"@(FaceDir dot HitDir));
+
+ RefNormal = FaceDir;
+
+ if ( FaceDir dot HitDir < -0.37 ) // 68 degree protection arc
+ {
+ if (AmmoDrain > 0)
+ Ammo[0].UseAmmo(AmmoDrain);
+ return true;
+ }
+ return false;
+}
+
+function AnimEnd(int channel)
+{
+ if (FireMode[0].bIsFiring)
+ {
+ LoopAnim('Charged');
+ }
+ else if (!FireMode[1].bIsFiring)
+ {
+ Super.AnimEnd(channel);
+ }
+}
+
+function float SuggestAttackStyle()
+{
+ return 0.8;
+}
+
+function float SuggestDefenseStyle()
+{
+ return -0.8;
+}
+
+simulated function float ChargeBar()
+{
+ return FMin(1,FireMode[0].HoldTime/ShieldFire(FireMode[0]).FullyChargedTime);
+}
+
+defaultproperties
+{
+ ItemName="Shield Gun"
+ IconMaterial=Material'InterfaceContent.Hud.SkinA'
+ IconCoords=(X1=200,Y1=281,X2=321,Y2=371)
+
+ bShowChargingBar=true
+ bCanThrow=false
+ FireModeClass(0)=ShieldFire
+ FireModeClass(1)=ShieldAltFire
+ InventoryGroup=1
+ Mesh=mesh'Weapons.ShieldGun_1st'
+ BobDamping=2.2
+ PickupClass=class'ShieldGunPickup'
+ EffectOffset=(X=15.0,Y=6.7,Z=1.2)
+ bMeleeWeapon=true
+ ShieldHitSound=Sound'WeaponSounds.ShieldGun.ShieldReflection'
+ DrawScale=0.4
+ PutDownAnim=PutDown
+ DisplayFOV=60
+ PlayerViewOffset=(X=2,Y=-0.7,Z=-2.7)
+ PlayerViewPivot=(Pitch=500,Roll=0,Yaw=500)
+
+ UV2Texture=Material'XGameShaders.WeaponEnvShader'
+
+ AttachmentClass=class'ShieldAttachment'
+ SelectSound=Sound'WeaponSounds.ShieldGun_change'
+ SelectForce="ShieldGun_change"
+ ShieldHitForce="ShieldReflection"
+
+ AIRating=0.35
+ CurrentRating=0.35
+
+ DefaultPriority=2
+}