From 664e37abfe5c796c1279b8295fb030f126b0a7d8 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Wed, 30 Nov 2011 11:36:13 -0600 Subject: Initial import of qscintilla from 2007 --- ChangeLog | 937 +++ LICENSE | 280 + NEWS | 114 + README | 128 + README.MacOS | 49 + designer/designer.pro | 13 + designer/qscintillaplugin.cpp | 154 + doc/Scintilla/Design.html | 249 + doc/Scintilla/Icons.html | 56 + doc/Scintilla/Lexer.txt | 226 + doc/Scintilla/License.txt | 20 + doc/Scintilla/SciBreak.jpg | Bin 0 -> 14998 bytes doc/Scintilla/SciCoding.html | 251 + doc/Scintilla/SciRest.jpg | Bin 0 -> 16680 bytes doc/Scintilla/SciTEIco.png | Bin 0 -> 10091 bytes doc/Scintilla/SciWord.jpg | Bin 0 -> 6164 bytes doc/Scintilla/ScintillaDoc.html | 5350 ++++++++++++++ doc/Scintilla/ScintillaDownload.html | 70 + doc/Scintilla/ScintillaHistory.html | 5296 ++++++++++++++ doc/Scintilla/ScintillaRelated.html | 507 ++ doc/Scintilla/ScintillaToDo.html | 178 + doc/Scintilla/ScintillaUsage.html | 375 + doc/Scintilla/Steps.html | 142 + doc/Scintilla/index.html | 198 + doc/html/annotated.html | 54 + doc/html/classQextScintilla-members.html | 1014 +++ doc/html/classQextScintilla.html | 4920 +++++++++++++ doc/html/classQextScintillaAPIs-members.html | 30 + doc/html/classQextScintillaAPIs.html | 151 + doc/html/classQextScintillaBase-members.html | 769 +++ doc/html/classQextScintillaBase.html | 3465 ++++++++++ doc/html/classQextScintillaCommand-members.html | 31 + doc/html/classQextScintillaCommand.html | 176 + doc/html/classQextScintillaCommandSet-members.html | 30 + doc/html/classQextScintillaCommandSet.html | 168 + doc/html/classQextScintillaDocument-members.html | 29 + doc/html/classQextScintillaDocument.html | 64 + doc/html/classQextScintillaLexer-members.html | 66 + doc/html/classQextScintillaLexer.html | 910 +++ doc/html/classQextScintillaLexerBash-members.html | 87 + doc/html/classQextScintillaLexerBash.html | 560 ++ doc/html/classQextScintillaLexerBatch-members.html | 76 + doc/html/classQextScintillaLexerBatch.html | 345 + doc/html/classQextScintillaLexerCPP-members.html | 99 + doc/html/classQextScintillaLexerCPP.html | 753 ++ doc/html/classQextScintillaLexerCSS-members.html | 89 + doc/html/classQextScintillaLexerCSS.html | 520 ++ .../classQextScintillaLexerCSharp-members.html | 101 + doc/html/classQextScintillaLexerCSharp.html | 261 + doc/html/classQextScintillaLexerDiff-members.html | 75 + doc/html/classQextScintillaLexerDiff.html | 243 + doc/html/classQextScintillaLexerHTML-members.html | 184 + doc/html/classQextScintillaLexerHTML.html | 1014 +++ doc/html/classQextScintillaLexerIDL-members.html | 101 + doc/html/classQextScintillaLexerIDL.html | 186 + doc/html/classQextScintillaLexerJava-members.html | 101 + doc/html/classQextScintillaLexerJava.html | 138 + .../classQextScintillaLexerJavaScript-members.html | 101 + doc/html/classQextScintillaLexerJavaScript.html | 261 + doc/html/classQextScintillaLexerLua-members.html | 85 + doc/html/classQextScintillaLexerLua.html | 514 ++ .../classQextScintillaLexerMakefile-members.html | 75 + doc/html/classQextScintillaLexerMakefile.html | 318 + doc/html/classQextScintillaLexerPOV-members.html | 91 + doc/html/classQextScintillaLexerPOV.html | 613 ++ doc/html/classQextScintillaLexerPerl-members.html | 101 + doc/html/classQextScintillaLexerPerl.html | 621 ++ .../classQextScintillaLexerProperties-members.html | 75 + doc/html/classQextScintillaLexerProperties.html | 450 ++ .../classQextScintillaLexerPython-members.html | 97 + doc/html/classQextScintillaLexerPython.html | 661 ++ doc/html/classQextScintillaLexerRuby-members.html | 99 + doc/html/classQextScintillaLexerRuby.html | 451 ++ doc/html/classQextScintillaLexerSQL-members.html | 95 + doc/html/classQextScintillaLexerSQL.html | 629 ++ doc/html/classQextScintillaLexerTeX-members.html | 74 + doc/html/classQextScintillaLexerTeX.html | 261 + doc/html/classQextScintillaMacro-members.html | 34 + doc/html/classQextScintillaMacro.html | 267 + doc/html/classQextScintillaPrinter-members.html | 33 + doc/html/classQextScintillaPrinter.html | 252 + doc/html/deprecated.html | 42 + doc/html/doxygen.css | 358 + doc/html/doxygen.png | Bin 0 -> 1281 bytes doc/html/functions.html | 130 + doc/html/functions_0x62.html | 85 + doc/html/functions_0x63.html | 108 + doc/html/functions_0x64.html | 82 + doc/html/functions_0x65.html | 91 + doc/html/functions_0x66.html | 88 + doc/html/functions_0x67.html | 73 + doc/html/functions_0x68.html | 80 + doc/html/functions_0x69.html | 90 + doc/html/functions_0x6a.html | 81 + doc/html/functions_0x6b.html | 77 + doc/html/functions_0x6c.html | 82 + doc/html/functions_0x6d.html | 89 + doc/html/functions_0x6e.html | 72 + doc/html/functions_0x6f.html | 71 + doc/html/functions_0x70.html | 118 + doc/html/functions_0x71.html | 100 + doc/html/functions_0x72.html | 84 + doc/html/functions_0x73.html | 360 + doc/html/functions_0x74.html | 83 + doc/html/functions_0x75.html | 77 + doc/html/functions_0x76.html | 82 + doc/html/functions_0x77.html | 85 + doc/html/functions_0x78.html | 71 + doc/html/functions_0x7a.html | 71 + doc/html/functions_0x7e.html | 93 + doc/html/functions_enum.html | 46 + doc/html/functions_eval.html | 113 + doc/html/functions_eval_0x62.html | 78 + doc/html/functions_eval_0x63.html | 90 + doc/html/functions_eval_0x64.html | 75 + doc/html/functions_eval_0x65.html | 75 + doc/html/functions_eval_0x66.html | 67 + doc/html/functions_eval_0x67.html | 69 + doc/html/functions_eval_0x68.html | 77 + doc/html/functions_eval_0x69.html | 72 + doc/html/functions_eval_0x6a.html | 79 + doc/html/functions_eval_0x6b.html | 72 + doc/html/functions_eval_0x6c.html | 73 + doc/html/functions_eval_0x6d.html | 68 + doc/html/functions_eval_0x6e.html | 70 + doc/html/functions_eval_0x6f.html | 69 + doc/html/functions_eval_0x70.html | 109 + doc/html/functions_eval_0x71.html | 71 + doc/html/functions_eval_0x72.html | 71 + doc/html/functions_eval_0x73.html | 250 + doc/html/functions_eval_0x74.html | 76 + doc/html/functions_eval_0x75.html | 72 + doc/html/functions_eval_0x76.html | 78 + doc/html/functions_eval_0x77.html | 76 + doc/html/functions_eval_0x78.html | 69 + doc/html/functions_func.html | 78 + doc/html/functions_func_0x62.html | 68 + doc/html/functions_func_0x63.html | 80 + doc/html/functions_func_0x64.html | 69 + doc/html/functions_func_0x65.html | 76 + doc/html/functions_func_0x66.html | 82 + doc/html/functions_func_0x67.html | 66 + doc/html/functions_func_0x68.html | 65 + doc/html/functions_func_0x69.html | 79 + doc/html/functions_func_0x6b.html | 67 + doc/html/functions_func_0x6c.html | 71 + doc/html/functions_func_0x6d.html | 82 + doc/html/functions_func_0x70.html | 71 + doc/html/functions_func_0x71.html | 91 + doc/html/functions_func_0x72.html | 75 + doc/html/functions_func_0x73.html | 172 + doc/html/functions_func_0x74.html | 69 + doc/html/functions_func_0x75.html | 67 + doc/html/functions_func_0x76.html | 66 + doc/html/functions_func_0x77.html | 68 + doc/html/functions_func_0x7a.html | 67 + doc/html/functions_func_0x7e.html | 89 + doc/html/hierarchy.html | 60 + doc/html/index.html | 20 + doc/html/pages.html | 22 + doc/html/tab_b.gif | Bin 0 -> 35 bytes doc/html/tab_l.gif | Bin 0 -> 706 bytes doc/html/tab_r.gif | Bin 0 -> 2585 bytes doc/html/tabs.css | 102 + doc/qscintilla.dxy | 1098 +++ example/License.txt | 20 + example/README | 12 + example/application.cpp | 271 + example/application.h | 48 + example/application.pro | 10 + example/fileopen.xpm | 22 + example/fileprint.xpm | 24 + example/filesave.xpm | 22 + example/main.cpp | 21 + include/Accessor.h | 78 + include/Face.py | 107 + include/HFacer.py | 76 + include/KeyWords.h | 82 + include/License.txt | 20 + include/Platform.h | 531 ++ include/PropSet.h | 114 + include/SString.h | 280 + include/SciLexer.h | 1074 +++ include/Scintilla.h | 780 +++ include/Scintilla.iface | 3012 ++++++++ include/ScintillaWidget.h | 59 + include/WindowAccessor.h | 57 + qt/PlatQt.cpp | 933 +++ qt/SciListBox.cpp | 328 + qt/SciListBox.h | 51 + qt/ScintillaQt.cpp | 692 ++ qt/ScintillaQt.h | 117 + qt/qextscintilla.cpp | 3031 ++++++++ qt/qextscintilla.h | 1457 ++++ qt/qextscintillaapis.cpp | 210 + qt/qextscintillaapis.h | 84 + qt/qextscintillabase.cpp | 582 ++ qt/qextscintillabase.h | 2413 +++++++ qt/qextscintillacommand.cpp | 199 + qt/qextscintillacommand.h | 99 + qt/qextscintillacommandset.cpp | 653 ++ qt/qextscintillacommandset.h | 82 + qt/qextscintilladocument.cpp | 139 + qt/qextscintilladocument.h | 61 + qt/qextscintillaglobal.h | 54 + qt/qextscintillalexer.cpp | 444 ++ qt/qextscintillalexer.h | 274 + qt/qextscintillalexerbash.cpp | 369 + qt/qextscintillalexerbash.h | 189 + qt/qextscintillalexerbatch.cpp | 198 + qt/qextscintillalexerbatch.h | 119 + qt/qextscintillalexercpp.cpp | 515 ++ qt/qextscintillalexercpp.h | 273 + qt/qextscintillalexercsharp.cpp | 118 + qt/qextscintillalexercsharp.h | 84 + qt/qextscintillalexercss.cpp | 376 + qt/qextscintillalexercss.h | 193 + qt/qextscintillalexerdiff.cpp | 123 + qt/qextscintillalexerdiff.h | 100 + qt/qextscintillalexerhtml.cpp | 1132 +++ qt/qextscintillalexerhtml.h | 486 ++ qt/qextscintillalexeridl.cpp | 102 + qt/qextscintillalexeridl.h | 72 + qt/qextscintillalexerjava.cpp | 59 + qt/qextscintillalexerjava.h | 61 + qt/qextscintillalexerjavascript.cpp | 120 + qt/qextscintillalexerjavascript.h | 88 + qt/qextscintillalexerlua.cpp | 346 + qt/qextscintillalexerlua.h | 178 + qt/qextscintillalexermakefile.cpp | 156 + qt/qextscintillalexermakefile.h | 112 + qt/qextscintillalexerperl.cpp | 482 ++ qt/qextscintillalexerperl.h | 231 + qt/qextscintillalexerpov.cpp | 488 ++ qt/qextscintillalexerpov.h | 214 + qt/qextscintillalexerproperties.cpp | 204 + qt/qextscintillalexerproperties.h | 141 + qt/qextscintillalexerpython.cpp | 407 ++ qt/qextscintillalexerpython.h | 244 + qt/qextscintillalexerruby.cpp | 380 + qt/qextscintillalexerruby.h | 203 + qt/qextscintillalexersql.cpp | 452 ++ qt/qextscintillalexersql.h | 226 + qt/qextscintillalexertex.cpp | 206 + qt/qextscintillalexertex.h | 101 + qt/qextscintillamacro.cpp | 329 + qt/qextscintillamacro.h | 106 + qt/qextscintillaprinter.cpp | 186 + qt/qextscintillaprinter.h | 107 + qt/qscintilla.pro | 220 + qt/qscintilla_de.qm | Bin 0 -> 27067 bytes qt/qscintilla_de.ts | 1635 +++++ qt/qscintilla_fr.qm | Bin 0 -> 29156 bytes qt/qscintilla_fr.ts | 1635 +++++ qt/qscintilla_pt_br.qm | Bin 0 -> 29270 bytes qt/qscintilla_pt_br.ts | 1635 +++++ qt/qscintilla_ru.qm | Bin 0 -> 17221 bytes qt/qscintilla_ru.ts | 1635 +++++ src/AutoComplete.cpp | 174 + src/AutoComplete.h | 70 + src/CallTip.cpp | 314 + src/CallTip.h | 79 + src/CellBuffer.cpp | 1120 +++ src/CellBuffer.h | 250 + src/CharClassify.cpp | 43 + src/CharClassify.h | 25 + src/ContractionState.cpp | 289 + src/ContractionState.h | 65 + src/Document.cpp | 1577 +++++ src/Document.h | 305 + src/DocumentAccessor.cpp | 187 + src/DocumentAccessor.h | 67 + src/Editor.cpp | 7299 ++++++++++++++++++++ src/Editor.h | 582 ++ src/ExternalLexer.cpp | 259 + src/ExternalLexer.h | 102 + src/Indicator.cpp | 77 + src/Indicator.h | 22 + src/KeyMap.cpp | 148 + src/KeyMap.h | 43 + src/KeyWords.cpp | 221 + src/LexAPDL.cpp | 136 + src/LexAU3.cpp | 891 +++ src/LexAVE.cpp | 225 + src/LexAda.cpp | 520 ++ src/LexAsm.cpp | 177 + src/LexAsn1.cpp | 181 + src/LexBaan.cpp | 189 + src/LexBash.cpp | 663 ++ src/LexBasic.cpp | 369 + src/LexBullant.cpp | 225 + src/LexCLW.cpp | 675 ++ src/LexCPP.cpp | 489 ++ src/LexCSS.cpp | 303 + src/LexCaml.cpp | 399 ++ src/LexConf.cpp | 184 + src/LexCrontab.cpp | 218 + src/LexCsound.cpp | 207 + src/LexEScript.cpp | 270 + src/LexEiffel.cpp | 234 + src/LexErlang.cpp | 522 ++ src/LexFlagship.cpp | 226 + src/LexForth.cpp | 348 + src/LexFortran.cpp | 452 ++ src/LexGen.py | 241 + src/LexGui4Cli.cpp | 309 + src/LexHTML.cpp | 2042 ++++++ src/LexHaskell.cpp | 263 + src/LexInno.cpp | 290 + src/LexKix.cpp | 122 + src/LexLisp.cpp | 275 + src/LexLout.cpp | 208 + src/LexLua.cpp | 357 + src/LexMMIXAL.cpp | 183 + src/LexMPT.cpp | 182 + src/LexMSSQL.cpp | 359 + src/LexMatlab.cpp | 225 + src/LexMetapost.cpp | 320 + src/LexNsis.cpp | 647 ++ src/LexOpal.cpp | 518 ++ src/LexOthers.cpp | 1140 +++ src/LexPB.cpp | 358 + src/LexPOV.cpp | 312 + src/LexPS.cpp | 343 + src/LexPascal.cpp | 369 + src/LexPerl.cpp | 1256 ++++ src/LexPython.cpp | 449 ++ src/LexRebol.cpp | 319 + src/LexRuby.cpp | 1542 +++++ src/LexSQL.cpp | 342 + src/LexScriptol.cpp | 404 ++ src/LexSmalltalk.cpp | 317 + src/LexSpecman.cpp | 286 + src/LexSpice.cpp | 221 + src/LexTADS3.cpp | 837 +++ src/LexTCL.cpp | 362 + src/LexTeX.cpp | 288 + src/LexVB.cpp | 278 + src/LexVHDL.cpp | 473 ++ src/LexVerilog.cpp | 299 + src/LexYAML.cpp | 305 + src/License.txt | 20 + src/LineMarker.cpp | 301 + src/LineMarker.h | 54 + src/PropSet.cpp | 1170 ++++ src/RESearch.cpp | 788 +++ src/RESearch.h | 65 + src/SVector.h | 127 + src/SciTE.properties | 6 + src/ScintillaBase.cpp | 727 ++ src/ScintillaBase.h | 93 + src/Style.cpp | 154 + src/Style.h | 56 + src/StyleContext.cpp | 51 + src/StyleContext.h | 169 + src/UniConversion.cpp | 76 + src/UniConversion.h | 12 + src/ViewStyle.cpp | 297 + src/ViewStyle.h | 108 + src/WindowAccessor.cpp | 178 + src/XPM.cpp | 348 + src/XPM.h | 94 + 362 files changed, 124684 insertions(+) create mode 100644 ChangeLog create mode 100644 LICENSE create mode 100644 NEWS create mode 100644 README create mode 100644 README.MacOS create mode 100644 designer/designer.pro create mode 100644 designer/qscintillaplugin.cpp create mode 100755 doc/Scintilla/Design.html create mode 100644 doc/Scintilla/Icons.html create mode 100755 doc/Scintilla/Lexer.txt create mode 100755 doc/Scintilla/License.txt create mode 100755 doc/Scintilla/SciBreak.jpg create mode 100755 doc/Scintilla/SciCoding.html create mode 100755 doc/Scintilla/SciRest.jpg create mode 100755 doc/Scintilla/SciTEIco.png create mode 100755 doc/Scintilla/SciWord.jpg create mode 100755 doc/Scintilla/ScintillaDoc.html create mode 100755 doc/Scintilla/ScintillaDownload.html create mode 100755 doc/Scintilla/ScintillaHistory.html create mode 100755 doc/Scintilla/ScintillaRelated.html create mode 100755 doc/Scintilla/ScintillaToDo.html create mode 100755 doc/Scintilla/ScintillaUsage.html create mode 100755 doc/Scintilla/Steps.html create mode 100755 doc/Scintilla/index.html create mode 100644 doc/html/annotated.html create mode 100644 doc/html/classQextScintilla-members.html create mode 100644 doc/html/classQextScintilla.html create mode 100644 doc/html/classQextScintillaAPIs-members.html create mode 100644 doc/html/classQextScintillaAPIs.html create mode 100644 doc/html/classQextScintillaBase-members.html create mode 100644 doc/html/classQextScintillaBase.html create mode 100644 doc/html/classQextScintillaCommand-members.html create mode 100644 doc/html/classQextScintillaCommand.html create mode 100644 doc/html/classQextScintillaCommandSet-members.html create mode 100644 doc/html/classQextScintillaCommandSet.html create mode 100644 doc/html/classQextScintillaDocument-members.html create mode 100644 doc/html/classQextScintillaDocument.html create mode 100644 doc/html/classQextScintillaLexer-members.html create mode 100644 doc/html/classQextScintillaLexer.html create mode 100644 doc/html/classQextScintillaLexerBash-members.html create mode 100644 doc/html/classQextScintillaLexerBash.html create mode 100644 doc/html/classQextScintillaLexerBatch-members.html create mode 100644 doc/html/classQextScintillaLexerBatch.html create mode 100644 doc/html/classQextScintillaLexerCPP-members.html create mode 100644 doc/html/classQextScintillaLexerCPP.html create mode 100644 doc/html/classQextScintillaLexerCSS-members.html create mode 100644 doc/html/classQextScintillaLexerCSS.html create mode 100644 doc/html/classQextScintillaLexerCSharp-members.html create mode 100644 doc/html/classQextScintillaLexerCSharp.html create mode 100644 doc/html/classQextScintillaLexerDiff-members.html create mode 100644 doc/html/classQextScintillaLexerDiff.html create mode 100644 doc/html/classQextScintillaLexerHTML-members.html create mode 100644 doc/html/classQextScintillaLexerHTML.html create mode 100644 doc/html/classQextScintillaLexerIDL-members.html create mode 100644 doc/html/classQextScintillaLexerIDL.html create mode 100644 doc/html/classQextScintillaLexerJava-members.html create mode 100644 doc/html/classQextScintillaLexerJava.html create mode 100644 doc/html/classQextScintillaLexerJavaScript-members.html create mode 100644 doc/html/classQextScintillaLexerJavaScript.html create mode 100644 doc/html/classQextScintillaLexerLua-members.html create mode 100644 doc/html/classQextScintillaLexerLua.html create mode 100644 doc/html/classQextScintillaLexerMakefile-members.html create mode 100644 doc/html/classQextScintillaLexerMakefile.html create mode 100644 doc/html/classQextScintillaLexerPOV-members.html create mode 100644 doc/html/classQextScintillaLexerPOV.html create mode 100644 doc/html/classQextScintillaLexerPerl-members.html create mode 100644 doc/html/classQextScintillaLexerPerl.html create mode 100644 doc/html/classQextScintillaLexerProperties-members.html create mode 100644 doc/html/classQextScintillaLexerProperties.html create mode 100644 doc/html/classQextScintillaLexerPython-members.html create mode 100644 doc/html/classQextScintillaLexerPython.html create mode 100644 doc/html/classQextScintillaLexerRuby-members.html create mode 100644 doc/html/classQextScintillaLexerRuby.html create mode 100644 doc/html/classQextScintillaLexerSQL-members.html create mode 100644 doc/html/classQextScintillaLexerSQL.html create mode 100644 doc/html/classQextScintillaLexerTeX-members.html create mode 100644 doc/html/classQextScintillaLexerTeX.html create mode 100644 doc/html/classQextScintillaMacro-members.html create mode 100644 doc/html/classQextScintillaMacro.html create mode 100644 doc/html/classQextScintillaPrinter-members.html create mode 100644 doc/html/classQextScintillaPrinter.html create mode 100644 doc/html/deprecated.html create mode 100644 doc/html/doxygen.css create mode 100644 doc/html/doxygen.png create mode 100644 doc/html/functions.html create mode 100644 doc/html/functions_0x62.html create mode 100644 doc/html/functions_0x63.html create mode 100644 doc/html/functions_0x64.html create mode 100644 doc/html/functions_0x65.html create mode 100644 doc/html/functions_0x66.html create mode 100644 doc/html/functions_0x67.html create mode 100644 doc/html/functions_0x68.html create mode 100644 doc/html/functions_0x69.html create mode 100644 doc/html/functions_0x6a.html create mode 100644 doc/html/functions_0x6b.html create mode 100644 doc/html/functions_0x6c.html create mode 100644 doc/html/functions_0x6d.html create mode 100644 doc/html/functions_0x6e.html create mode 100644 doc/html/functions_0x6f.html create mode 100644 doc/html/functions_0x70.html create mode 100644 doc/html/functions_0x71.html create mode 100644 doc/html/functions_0x72.html create mode 100644 doc/html/functions_0x73.html create mode 100644 doc/html/functions_0x74.html create mode 100644 doc/html/functions_0x75.html create mode 100644 doc/html/functions_0x76.html create mode 100644 doc/html/functions_0x77.html create mode 100644 doc/html/functions_0x78.html create mode 100644 doc/html/functions_0x7a.html create mode 100644 doc/html/functions_0x7e.html create mode 100644 doc/html/functions_enum.html create mode 100644 doc/html/functions_eval.html create mode 100644 doc/html/functions_eval_0x62.html create mode 100644 doc/html/functions_eval_0x63.html create mode 100644 doc/html/functions_eval_0x64.html create mode 100644 doc/html/functions_eval_0x65.html create mode 100644 doc/html/functions_eval_0x66.html create mode 100644 doc/html/functions_eval_0x67.html create mode 100644 doc/html/functions_eval_0x68.html create mode 100644 doc/html/functions_eval_0x69.html create mode 100644 doc/html/functions_eval_0x6a.html create mode 100644 doc/html/functions_eval_0x6b.html create mode 100644 doc/html/functions_eval_0x6c.html create mode 100644 doc/html/functions_eval_0x6d.html create mode 100644 doc/html/functions_eval_0x6e.html create mode 100644 doc/html/functions_eval_0x6f.html create mode 100644 doc/html/functions_eval_0x70.html create mode 100644 doc/html/functions_eval_0x71.html create mode 100644 doc/html/functions_eval_0x72.html create mode 100644 doc/html/functions_eval_0x73.html create mode 100644 doc/html/functions_eval_0x74.html create mode 100644 doc/html/functions_eval_0x75.html create mode 100644 doc/html/functions_eval_0x76.html create mode 100644 doc/html/functions_eval_0x77.html create mode 100644 doc/html/functions_eval_0x78.html create mode 100644 doc/html/functions_func.html create mode 100644 doc/html/functions_func_0x62.html create mode 100644 doc/html/functions_func_0x63.html create mode 100644 doc/html/functions_func_0x64.html create mode 100644 doc/html/functions_func_0x65.html create mode 100644 doc/html/functions_func_0x66.html create mode 100644 doc/html/functions_func_0x67.html create mode 100644 doc/html/functions_func_0x68.html create mode 100644 doc/html/functions_func_0x69.html create mode 100644 doc/html/functions_func_0x6b.html create mode 100644 doc/html/functions_func_0x6c.html create mode 100644 doc/html/functions_func_0x6d.html create mode 100644 doc/html/functions_func_0x70.html create mode 100644 doc/html/functions_func_0x71.html create mode 100644 doc/html/functions_func_0x72.html create mode 100644 doc/html/functions_func_0x73.html create mode 100644 doc/html/functions_func_0x74.html create mode 100644 doc/html/functions_func_0x75.html create mode 100644 doc/html/functions_func_0x76.html create mode 100644 doc/html/functions_func_0x77.html create mode 100644 doc/html/functions_func_0x7a.html create mode 100644 doc/html/functions_func_0x7e.html create mode 100644 doc/html/hierarchy.html create mode 100644 doc/html/index.html create mode 100644 doc/html/pages.html create mode 100644 doc/html/tab_b.gif create mode 100644 doc/html/tab_l.gif create mode 100644 doc/html/tab_r.gif create mode 100644 doc/html/tabs.css create mode 100644 doc/qscintilla.dxy create mode 100755 example/License.txt create mode 100644 example/README create mode 100644 example/application.cpp create mode 100644 example/application.h create mode 100644 example/application.pro create mode 100644 example/fileopen.xpm create mode 100644 example/fileprint.xpm create mode 100644 example/filesave.xpm create mode 100644 example/main.cpp create mode 100755 include/Accessor.h create mode 100755 include/Face.py create mode 100755 include/HFacer.py create mode 100755 include/KeyWords.h create mode 100755 include/License.txt create mode 100755 include/Platform.h create mode 100755 include/PropSet.h create mode 100755 include/SString.h create mode 100755 include/SciLexer.h create mode 100755 include/Scintilla.h create mode 100755 include/Scintilla.iface create mode 100755 include/ScintillaWidget.h create mode 100755 include/WindowAccessor.h create mode 100644 qt/PlatQt.cpp create mode 100644 qt/SciListBox.cpp create mode 100644 qt/SciListBox.h create mode 100644 qt/ScintillaQt.cpp create mode 100644 qt/ScintillaQt.h create mode 100644 qt/qextscintilla.cpp create mode 100644 qt/qextscintilla.h create mode 100644 qt/qextscintillaapis.cpp create mode 100644 qt/qextscintillaapis.h create mode 100644 qt/qextscintillabase.cpp create mode 100644 qt/qextscintillabase.h create mode 100644 qt/qextscintillacommand.cpp create mode 100644 qt/qextscintillacommand.h create mode 100644 qt/qextscintillacommandset.cpp create mode 100644 qt/qextscintillacommandset.h create mode 100644 qt/qextscintilladocument.cpp create mode 100644 qt/qextscintilladocument.h create mode 100644 qt/qextscintillaglobal.h create mode 100644 qt/qextscintillalexer.cpp create mode 100644 qt/qextscintillalexer.h create mode 100644 qt/qextscintillalexerbash.cpp create mode 100644 qt/qextscintillalexerbash.h create mode 100644 qt/qextscintillalexerbatch.cpp create mode 100644 qt/qextscintillalexerbatch.h create mode 100644 qt/qextscintillalexercpp.cpp create mode 100644 qt/qextscintillalexercpp.h create mode 100644 qt/qextscintillalexercsharp.cpp create mode 100644 qt/qextscintillalexercsharp.h create mode 100644 qt/qextscintillalexercss.cpp create mode 100644 qt/qextscintillalexercss.h create mode 100644 qt/qextscintillalexerdiff.cpp create mode 100644 qt/qextscintillalexerdiff.h create mode 100644 qt/qextscintillalexerhtml.cpp create mode 100644 qt/qextscintillalexerhtml.h create mode 100644 qt/qextscintillalexeridl.cpp create mode 100644 qt/qextscintillalexeridl.h create mode 100644 qt/qextscintillalexerjava.cpp create mode 100644 qt/qextscintillalexerjava.h create mode 100644 qt/qextscintillalexerjavascript.cpp create mode 100644 qt/qextscintillalexerjavascript.h create mode 100644 qt/qextscintillalexerlua.cpp create mode 100644 qt/qextscintillalexerlua.h create mode 100644 qt/qextscintillalexermakefile.cpp create mode 100644 qt/qextscintillalexermakefile.h create mode 100644 qt/qextscintillalexerperl.cpp create mode 100644 qt/qextscintillalexerperl.h create mode 100644 qt/qextscintillalexerpov.cpp create mode 100644 qt/qextscintillalexerpov.h create mode 100644 qt/qextscintillalexerproperties.cpp create mode 100644 qt/qextscintillalexerproperties.h create mode 100644 qt/qextscintillalexerpython.cpp create mode 100644 qt/qextscintillalexerpython.h create mode 100644 qt/qextscintillalexerruby.cpp create mode 100644 qt/qextscintillalexerruby.h create mode 100644 qt/qextscintillalexersql.cpp create mode 100644 qt/qextscintillalexersql.h create mode 100644 qt/qextscintillalexertex.cpp create mode 100644 qt/qextscintillalexertex.h create mode 100644 qt/qextscintillamacro.cpp create mode 100644 qt/qextscintillamacro.h create mode 100644 qt/qextscintillaprinter.cpp create mode 100644 qt/qextscintillaprinter.h create mode 100644 qt/qscintilla.pro create mode 100644 qt/qscintilla_de.qm create mode 100644 qt/qscintilla_de.ts create mode 100644 qt/qscintilla_fr.qm create mode 100644 qt/qscintilla_fr.ts create mode 100644 qt/qscintilla_pt_br.qm create mode 100644 qt/qscintilla_pt_br.ts create mode 100644 qt/qscintilla_ru.qm create mode 100644 qt/qscintilla_ru.ts create mode 100755 src/AutoComplete.cpp create mode 100755 src/AutoComplete.h create mode 100755 src/CallTip.cpp create mode 100755 src/CallTip.h create mode 100755 src/CellBuffer.cpp create mode 100755 src/CellBuffer.h create mode 100644 src/CharClassify.cpp create mode 100644 src/CharClassify.h create mode 100755 src/ContractionState.cpp create mode 100755 src/ContractionState.h create mode 100755 src/Document.cpp create mode 100755 src/Document.h create mode 100755 src/DocumentAccessor.cpp create mode 100755 src/DocumentAccessor.h create mode 100755 src/Editor.cpp create mode 100755 src/Editor.h create mode 100755 src/ExternalLexer.cpp create mode 100644 src/ExternalLexer.h create mode 100755 src/Indicator.cpp create mode 100755 src/Indicator.h create mode 100755 src/KeyMap.cpp create mode 100755 src/KeyMap.h create mode 100755 src/KeyWords.cpp create mode 100755 src/LexAPDL.cpp create mode 100755 src/LexAU3.cpp create mode 100755 src/LexAVE.cpp create mode 100755 src/LexAda.cpp create mode 100755 src/LexAsm.cpp create mode 100755 src/LexAsn1.cpp create mode 100755 src/LexBaan.cpp create mode 100755 src/LexBash.cpp create mode 100644 src/LexBasic.cpp create mode 100755 src/LexBullant.cpp create mode 100755 src/LexCLW.cpp create mode 100755 src/LexCPP.cpp create mode 100755 src/LexCSS.cpp create mode 100644 src/LexCaml.cpp create mode 100755 src/LexConf.cpp create mode 100755 src/LexCrontab.cpp create mode 100644 src/LexCsound.cpp create mode 100755 src/LexEScript.cpp create mode 100755 src/LexEiffel.cpp create mode 100755 src/LexErlang.cpp create mode 100644 src/LexFlagship.cpp create mode 100755 src/LexForth.cpp create mode 100755 src/LexFortran.cpp create mode 100755 src/LexGen.py create mode 100755 src/LexGui4Cli.cpp create mode 100755 src/LexHTML.cpp create mode 100644 src/LexHaskell.cpp create mode 100644 src/LexInno.cpp create mode 100755 src/LexKix.cpp create mode 100755 src/LexLisp.cpp create mode 100755 src/LexLout.cpp create mode 100755 src/LexLua.cpp create mode 100755 src/LexMMIXAL.cpp create mode 100755 src/LexMPT.cpp create mode 100755 src/LexMSSQL.cpp create mode 100755 src/LexMatlab.cpp create mode 100755 src/LexMetapost.cpp create mode 100755 src/LexNsis.cpp create mode 100644 src/LexOpal.cpp create mode 100755 src/LexOthers.cpp create mode 100755 src/LexPB.cpp create mode 100755 src/LexPOV.cpp create mode 100755 src/LexPS.cpp create mode 100755 src/LexPascal.cpp create mode 100755 src/LexPerl.cpp create mode 100755 src/LexPython.cpp create mode 100644 src/LexRebol.cpp create mode 100755 src/LexRuby.cpp create mode 100755 src/LexSQL.cpp create mode 100755 src/LexScriptol.cpp create mode 100644 src/LexSmalltalk.cpp create mode 100755 src/LexSpecman.cpp create mode 100644 src/LexSpice.cpp create mode 100644 src/LexTADS3.cpp create mode 100644 src/LexTCL.cpp create mode 100755 src/LexTeX.cpp create mode 100755 src/LexVB.cpp create mode 100755 src/LexVHDL.cpp create mode 100755 src/LexVerilog.cpp create mode 100755 src/LexYAML.cpp create mode 100755 src/License.txt create mode 100755 src/LineMarker.cpp create mode 100755 src/LineMarker.h create mode 100755 src/PropSet.cpp create mode 100755 src/RESearch.cpp create mode 100755 src/RESearch.h create mode 100755 src/SVector.h create mode 100755 src/SciTE.properties create mode 100755 src/ScintillaBase.cpp create mode 100755 src/ScintillaBase.h create mode 100755 src/Style.cpp create mode 100755 src/Style.h create mode 100755 src/StyleContext.cpp create mode 100755 src/StyleContext.h create mode 100755 src/UniConversion.cpp create mode 100755 src/UniConversion.h create mode 100755 src/ViewStyle.cpp create mode 100755 src/ViewStyle.h create mode 100755 src/WindowAccessor.cpp create mode 100644 src/XPM.cpp create mode 100644 src/XPM.h diff --git a/ChangeLog b/ChangeLog new file mode 100644 index 0000000..d09cbfd --- /dev/null +++ b/ChangeLog @@ -0,0 +1,937 @@ +2006/11/30 9:28:17 phil +Released as v1.7.1. + + +2006/11/17 18:19:30 phil +Fixed the name of the generated source packages. + + +2006/11/11 10:33:00 phil +Fixed a compiler warning. With older versions of gcc treat it as an error. + + +2006/11/04 22:08:01 phil +Released as v1.7. + + +2006/11/03 16:10:48 phil +Fixed QextScintillaLexer::setPaper() so that it also sets the background colour +of the default style. + + +2006/10/29 15:27:49 phil +Renamed the Portuguese Brazilian translation files. + + +2006/10/27 17:14:20 phil +Updated the NEWS file. + + +2006/10/21 12:37:02 phil +Switched the internal build system to Qt v3.3.7. + + +2006/10/20 16:41:33 phil +Renamed the base package QScintilla1. +Platform portability fixes from Ulli. + + +2006/10/13 16:28:56 phil +Backported the fix for misaligned indentation marks. + + +2006/10/08 17:06:19 phil +Reset the text and paper colours and font when removing a lexer. + + +2006/10/06 17:48:45 phil +Added QextScintilla::lexer(). +Fixed setFont(), setColor(), setEolFill() and setPaper() in QextScintillaLexer +so that they handle all styles as documented. + + +2006/09/29 15:59:39 phil +Fixed the documentation bug in QextScintilla::insert(). + + +2006/09/09 17:46:26 phil +QextScintilla's setFont(), setColor() and setPaper() now work as expected when +there is no lexer (and have no effect if there is a lexer). + + +2006/09/04 19:24:46 phil +Fixed crash enabling setAutoCompletionFillupsEnabled() without having a lexer +or first calling setAutoCompletionFillups(). + + +2006/08/27 17:07:13 phil +Merged Scintilla v1.71. + + +2006/07/30 17:19:12 phil +Added autoCompletionFillupsEnabled() and setAutoCompletionFillupsEnabled() to +QextScintilla. +Don't auto-complete numbers. +Added support for triple clicking. + + +2006/07/09 15:26:26 phil +Updated translations from Detlev. + + +2006/07/08 19:24:04 phil +Added QextScintilla::isCallTipActive(). + + +2006/07/08 15:28:11 phil +Changed the autoindentation to be slightly cleverer when handling Python. If a +lexer does not define block end words then a block start word is ignored unless +it is the last significant word in a line. + + +2006/07/02 16:19:16 phil +Possibly fixed a possible problem with double clicking under Windows. + + +2006/07/02 14:27:26 phil +Added setWrapVisualFlags(), WrapMode::WrapCharacter, WrapVisualFlag to +QextScintilla. +The layout cache is now set according to the wrap mode. +Setting a wrap mode now disables the horizontal scrollbar. + + +2006/07/01 18:52:37 phil +Added cancelList(), firstVisibleLine(), isListActive(), showUserList(), +textHeight() and userListActivated() to QextScintilla. + + +2006/07/01 16:49:53 phil +Auto-completion changed so that subsequent start characters cause the list to +be re-created (containing a subset of the previous one). + + +2006/06/28 22:12:23 phil +Handle Key_Enter the same as Key_Return. +QextScintilla::foldAll() can now optionally fold all child fold points. +Added autoCompleteFromAll() and setAutoCompletionStartCharacters() to +QextScintilla. +Vastly improved the way auto-completion and call tips work. + + +2006/06/25 23:51:44 phil +The default fore and background colours now default to the application palette +rather than being hardcoded to black and white. + + +2006/06/25 21:51:58 phil +Added defaultColor() and setDefaultColor() to QextScintillaLexer. +Added color() and setColor() to QextScintilla. +Renamed eraseColor() and setEraseColor() to paper() and setPaper() in +QextScintilla. + + +2006/06/25 16:21:02 phil +Added a couple of extra SendScintilla overloads. One is needed for PyQt because +of the change in SIP's handling of unsigned values. The other is needed to +solve C++ problems caused by the first. +Autocompletion list entries from APIs may now contain spaces. +Added defaultPaper() and setDefaultPaper() to QextScintillaLexer. +Added eraseColor() and setEraseColor() to QextScintilla. + + +2006/06/21 22:41:28 phil +Removed QextScintillaLexer::styleBits() now that SCI_GETSTYLEBITSNEEDED is +available. + + +2006/06/21 14:39:50 phil +QextScintilla::setSelectionBackgroundColor(), +QextScintilla::setMarkerBackgroundColor() and +QextScintilla::setCaretLineBackgroundColor() now respect the alpha component. + + +2006/06/20 16:02:08 phil +Merged Scintilla v1.70. + + +2006/06/19 21:02:01 phil +Significant, and incompatible, updates to the QextScintillaLexerRuby class. + + +2006/06/19 15:56:38 phil +Fix for qsort helpers linkage from Ulli. (Patch sent upstream.) + + +2006/06/18 23:50:33 phil +Ctrl-D is now duplicate selection rather than duplicate line. +Updated the Python lexer to add support for hightlighted identifiers and +decorators. + + +2006/06/18 16:41:17 phil +Added the Scintilla 1.69 extensions to the low level API. + + +2006/06/18 14:51:41 phil +Removed the redundant .repoman file. +Synced with Scintilla v1.69 with only the minimal changes needed to compile it. + + +2006/06/18 13:02:16 phil +Minor repairs to the .srepo control file from the move to SVN. + + +2006/03/21 16:45:54 phil +Added a multi-byte character fix to QextScintilla::posFromLineIndex() from +Dandrea Francesco. + + +2006/03/11 19:15:56 phil +Changed the internal build system to use Qt v3.3.6. + + +2005/12/12 17:10:15 phil +Fixed the second occurance of the autoindenting bug. +Send context menu events (rather than execute the handler directly) so that +they can be filtered. + + +2005/11/03 22:39:10 phil +Fixed the leak of the standard command set when a QextScintilla instance is +destroyed. + + +2005/09/24 11:14:26 phil +Fixed a bug in autoindenting with AiOpening and AiClosing. + + +2005/09/19 16:59:01 phil +QextScintilla now disables mouse captures in it's ctor. This appeared to cause +problems on multi-head systems (and Qt should do the right thing anyway). + + +2005/09/13 19:53:04 phil +Fixed bug in drawing a filled rectangle without setting the pen. This caused +the fold margin to have a border after a marker had been drawn. + + +2005/08/30 16:29:57 phil +Released as v1.6. + + +2005/08/21 18:22:05 phil +Updated translations from Detlev. + + +2005/08/12 17:55:39 phil +Updated the Brazilian Portuguese and French translations. +Added an install target to the project file. + + +2005/08/10 21:52:38 phil +Added the QextScintillaLexerBatch class from Detlev. +Added the Brazilian Portuguese translations from Douglas Soares de Andrade. +Changed the default fonts for all lexers to match those used in current +versions of SciTE. + + +2005/08/08 20:55:49 phil +Completed the merge of Scintilla v1.65. + + +2005/07/27 20:45:46 phil +Updated French translations from Jul Vienne. + + +2005/07/27 17:32:53 phil +Updated translations from Detlev. + + +2005/07/26 19:49:39 phil +Added Detlev's latest translations. + + +2005/07/26 11:08:01 phil +Added the QextScintillaLexerDiff, QextScintillaLexerMakefile and +QextScintillaLexerProperties classes. + + +2005/07/24 17:11:51 phil +Added the QextScintillaLexerCSS and QextScintillaLexerTeX classes. + + +2005/07/20 17:04:47 phil +Added some comments about the confusing interpretation of KEYWORDSET_MAX. + + +2005/07/19 20:45:27 phil +Added the new German translations from Detlev. +Fixed a bug in the handling of keyword sets. + + +2005/07/10 11:05:35 phil +Applied the two focus fixes from Harri Porten. + + +2005/07/09 17:55:05 phil +Updated QextScintillaLexerSQL for Scintilla v1.64. + + +2005/07/06 17:47:13 phil +Added the missing #includes. +Completed the QextScintillaLexerPOV class. + + +2005/07/05 21:05:31 phil +Added the extra flag to QextScintilla::findFirst(). +Started QextScintillaLexerPOV - not yet finished. + + +2005/07/04 19:18:08 phil +Added all the new v1.63 and v1.64 functionality. + + +2005/07/04 17:28:32 phil +Now compiles and runs. + + +2005/07/03 20:59:01 phil +Resolved all the CVS conflicts from merging Scintilla 1.64. Almost certain not +to compile yet. + + +2005/03/11 19:21:56 phil +Updated French translations from Jul Vienne. + + +2005/03/06 10:05:56 phil +Released as v1.5.1. + + +2005/02/20 08:48:49 phil +Added updated German translations from Detlev. + + +2005/02/19 15:18:55 phil +Added the QextScintillaLexerLua class. +Released as v1.5. + + +2005/02/11 22:53:09 phil +Updated the NEWS file. + + +2005/01/22 00:28:28 phil +Tidy up properly when destroying a QScintilla instance. + + +2005/01/21 17:36:26 phil +Restored the missing translation files. + + +2005/01/21 17:30:35 phil +Fixed bug where the widget would shrink if a scrollbar was hidden. +Added the QextScintillaBase::viewport() and QextScintillaBase::startDrag() +methods. + + +2005/01/14 17:34:23 phil +Updated the copyright notices. +Changes to the internal build system and to the code so that it builds with the +Borland compiler. + + +2005/01/05 06:54:01 phil +Updated translations from Detlev. + + +2004/12/26 12:31:18 phil +Added the QextScintillaLexerRuby class. + + +2004/10/31 16:32:17 phil +Completed the merge of Scintilla v1.62. It builds, but is otherwise untested. + + +2004/09/18 17:31:23 phil +Added the port of the Qt application example. + + +2004/09/16 08:26:31 phil +Released as v1.4. + + +2004/09/14 07:43:58 phil +Added French translations from Julien Vienne. + + +2004/09/13 17:33:54 phil +Updated the German translations from Detlev. +Probably fixed (ie. hacked) the AltGr support under Windows. + + +2004/09/12 15:15:31 phil +Changed the implementation of QextScintilla::isModified() to work around an +apparent bug in Scintilla. + + +2004/09/12 11:41:21 phil +Added the QextScintillaLexerBash class. + + +2004/08/25 15:34:05 phil +Added the Qt Designer plugin. +Fixed the Russian translations. + + +2004/08/22 15:41:59 phil +Added insert(), edgeColor(), setEdgeColor(), edgeColumn(), setEdgeColumn(), +edgeMode(), setEdgeMode(), wrapMode(), setWrapMode(), +resetSelectionBackgroundColor() and resetSelectionForegroundColor() to +QextScintilla. +Added clearKeys() and clearAlternateKeys() to QextScintillaCommandSet. + + +2004/07/03 14:46:33 phil +Merged Scintilla v1.61. +Added Russian translations from Alexander Daroksky. + + +2004/05/09 10:30:31 phil +Changed the build system so that the platform name is no longer included in the +package filename. +Released as v1.3. + + +2004/05/02 00:36:46 phil +Completed the merge of Scintilla v1.60. + + +2004/04/27 17:57:39 phil +Fixed potential buffer overflow problem in QextScintilla::text(int line). + + +2004/04/24 20:12:38 phil +Fixed a bug with autocompleting from the current document. + + +2004/04/24 09:01:37 phil +Added README.MacOS which includes the required patch to Qt v3.3.2 and earlier +versions. +Updated the NEWS file. + + +2004/04/18 13:35:06 phil +Fixed up the internal mini-editor test application. +Fixed the problem preventing QextScintillaDocument being usable on Windows. + + +2004/04/14 18:24:29 phil +Added new German translations from Detlev. +Fixed problem with losing double-clicks on Windows. +Fixed the copyright notices. + + +2004/04/12 19:13:52 phil +Some changes for Windows - still doesn't build there though. + + +2004/04/12 14:49:01 phil +Added the QextScintillaLexerPerl class. +Lexers can now provide a specific set of word characters. + + +2004/04/07 21:02:00 phil +Changed the implementation of the Copy() method when doing double buffered +drawing. It is now faster and, hopefully, has fixed the redraw bug on X11 (and +might also make a difference on MacOS/X). +The read-only flag only applies to user input and not program changes (to mimic +QTextEdit). + + +2004/04/04 16:59:56 phil +Added the QextScintillaDocument class. +Added pool() to QextScintillaBase. +Added document() and setDocument() to QextScintilla. + + +2004/03/28 15:16:26 phil +Renamed QextScintilla.setCaretColor() to setCaretForegroundColor(). +Added recolor(), setCaretWidth(), setCaretLineVisible() and +setCaretLineBackgroundColor() to QextScintilla. +Added STYLE_MAX to QextScintillaBase. + + +2004/03/27 18:25:28 phil +Added setCaretColor(), setSelectionForegroundColor() and +setSelectionBackgroundColor() to QextScintilla. + + +2004/03/22 18:53:41 phil +Fixed QextScintilla.textChanged() so that it really is emitted only when text +has been inserted or deleted. + + +2004/03/22 17:51:14 phil +Fixed bug in auto-completion using the current document. +Fixed bug in dropping text into a UTF8 document. +Some other tidy ups to drag'n'drops. + + +2004/03/21 20:47:56 phil +Updated the default command set to match Scintilla v1.59. +Now builds successfully, but otherwise untested. + + +2004/03/20 18:50:39 phil +Added INDIC_BOX. +Added SC_SEL_*. +Added the SCI_SETSELECTIONMODE, SCI_GETSELECTIONMODE, +SCI_GETLINESELSTARTPOSITION, SCI_GETLINESELENDPOSITION, SCI_LINEDOWNRECTEXTEND, +SCI_LINEUPRECTEXTEND, SCI_CHARLEFTRECTEXTEND, SCI_CHARRIGHTRECTEXTEND, +SCI_HOMERECTEXTEND, SCI_VCHOMERECTEXTEND, SCI_LINEENDRECTEXTEND, +SCI_PAGEUPRECTEXTEND, SCI_PAGEDOWNRECTEXTEND, SCI_STUTTEREDPAGEUP, +SCI_STUTTEREDPAGEUPEXTEND, SCI_STUTTEREDPAGEDOWN, SCI_STUTTEREDPAGEDOWNEXTEND, +SCI_WORDLEFTEND, SCI_WORDLEFTENDEXTEND, SCI_WORDRIGHTEND, +SCI_WORDRIGHTENDEXTEND, SCI_SETWHITESPACECHARS, SCI_SETCHARSDEFAULT, +SCI_AUTOCGETCURRENT, SCI_ALLOCATE functions. +Added the SCLEX_CLW, SCLEX_CLWNOCASE, SCLEX_LOT, SCLEX_YAML, SCLEX_TEX, +SCLEX_METAPOST, SCLEX_POWERBASIC, SCLEX_FORTH, SCLEX_ERLANG, SCLEX_OCTAVE, +SCLEX_MSSQL, SCLEX_VERILOG lexers. + + +2004/03/20 13:33:14 phil +Changes to the internal build system to use repo rather than repoman. +Merged Scintilla v1.59. (Not tested at all - probably won't compile.) + + +2003/08/16 20:46:15 phil +Released as v1.2. + + +2003/08/12 14:56:05 phil +Merged Scintilla v1.54. +Changed the library version to 3.0.0. + + +2003/08/12 12:25:19 phil +Added the internal TODO file. + + +2003/05/23 07:22:15 phil +Updated the documentation. +Released as v1.1. + + +2003/05/20 10:37:03 phil +Updated translations from Detlev. +Added QextScintilla::modificationAttempted(). + + +2003/05/16 21:30:45 phil +Merged Scintilla v1.53. +Added GlobalClass as a style of the C++ lexer (using keyword set 4). +Added foldAtElse() and setFoldAtElse() to QextScintillaLexerCPP. + + +2003/05/16 11:34:27 phil +Added QextScintillaBase::SCN_MODIFYATTEMPTRO. + + +2003/05/11 10:26:11 phil +Increased the maximum number of keyword sets to match Scintilla. +Changed references to WhiteSpace in lexers to Default (but kept WhiteSpace for +backwards compatibility). +By default the C++ lexer now folds preprocessor blocks (to match the default +SciTE properties file rather than the code). +Hopefully fixed auto-completion lists and call tips under Windows without +breaking them under X11. +Added the QextScintillaLexerHTML class. +Fixed bug where abandoned paints weren't handled properly. + + +2003/05/07 22:07:22 phil +Fixed the window decorations for auto-completion lists and call tips under +Windows. + + +2003/05/07 16:52:11 phil +Added the QextScintillaLexerSQL class. +Changed the library version number to 1.1.0. + + +2003/05/03 14:26:31 phil +Fixed a bug when trying to paste an empty clipboard. +Changed the library version to 1.0.1. + + +2003/04/26 13:59:53 phil +Updated German translations from Detlev. +Released as v1.0. + + +2003/04/18 22:20:13 phil +Merged Scintilla v1.52. +Added QextScintillaLexer.setDefaultFont(). +Added setCallTipsForegroundColor() and setCallTipsHighlightColor() to +QextScintilla. +Changed QextScintilla.setCallTipsVisible() to interpret a negative argument as +meaning display call tips one at a time with scrolling arrows. + + +2003/04/13 15:11:07 phil +Foxed a documentation bug in QextScintilla.setCallTipsVisible(). +Made sure that call tips are unique. + + +2003/04/07 11:52:00 phil +Ensured that the current item of an auto-completion list is always visible. +Fixed QextScintilla::append(). +Call tips and auto-completion lists should now be non-modal. + + +2003/04/01 20:41:55 phil +Added the missing educational license files. + + +2003/04/01 20:40:50 phil +Added support for the educational version. +Fixed a few Windows build problems. + + +2003/03/22 16:44:11 phil +Updated German translations from Detlev. + + +2003/03/16 16:23:47 phil +Fully implemented the high level API to macros. +Re-ordered the default command table. + + +2003/03/15 23:41:40 phil +Added the QextScintillaCommand, QextScintillaCommandSet and QextScintillaMacro +classes. (The latter is not yet fully implemented.) +Added QextScintilla.standardCommands(). +Brought the documentation up to date. + + +2003/03/14 19:48:48 phil +Fixed another Windows compile problem. +Control characters are now passed properly to Scintilla so that they can be +recognised as command keys. + + +2003/03/13 12:59:10 phil +Added QextScintillaAPIs.add(). +The caret is now displayed when either a call tip or auto-completion list is +displayed. +Fully implemented the high level API to call tips. +Fixed bug compiling against Qt v3.0.x. + + +2003/03/09 18:36:46 phil +Removed the DBCS functions as QScintilla doesn't support DBCS. +Minor portability fixes for Windows. +The high level API auto-completion methods are now fully implemented. + + +2003/03/06 10:37:27 phil +Added QextScintilla.AutoCompletionSource, QextScintilla.autoCompleteFromAPIs(), +QextScintilla.autoCompleteFromDocument(), QextScintilla.autoCompletionSource(), +QextScintilla.autoCompletionThreshold(), QextScintilla.setAutoCompletionAPIs(), +QextScintilla.setAutoCompletionSource(), +QextScintilla.setAutoCompletionThreshold(). Note that these are just hooks and +haven't yet been implemented. + + +2003/03/03 18:04:52 phil +The low-level APIs to call tips and autocompletion lists should now work. +Added the QextScintillaAPIs class. + + +2003/03/01 14:46:48 phil +Added missing #include of stdlib.h. + + +2003/03/01 09:21:20 phil +Fixed compile problem for Qt v3.0.x. + + +2003/02/27 16:19:52 phil +Updated dates on the copyright notices. + + +2003/02/26 23:41:23 phil +Merged Scintilla v1.51. +Added QextScintilla.resetFoldMarginColors() and +QextScintilla.setFoldMarginColors(). + + +2003/02/26 19:30:25 phil +Updated to Scintilla v1.50. +Added the QextScintillaBase.SendScintilla() overload that takes a QPixmap *. +SCI_MARKERDEFINEPIXMAP now takes a pointer to a QPixmap instance rather than a +pointer to raw or textual XPM image data. +QextScintilla.markerDefine() now takes a QPixmap rather than an XPM image. +Added QSCINTILLA_VERSION, QSCINTILLA_VERSION_STR and QSCINTILLA_BUILD. +Added QextScintilla.WrapMode, QextScintillaPrinter.setWrapMode() and +QextScintillaPrinter.wrapMode(). + + +2003/01/20 09:04:46 phil +Minor tweak to build properly under IRIX. +Added QextScintilla.lineAt(). + + +2002/12/25 10:47:33 phil +Added QextScintilla.ensureCursorVisible(). + + +2002/12/17 13:19:42 phil +Added the QextScintillaBase::SendScintilla() overload that hides the Scintilla +RangeToFormat structure. +Added the QextScintillaPrinter class. +Changed the low level implementation of a Scintilla Surface to be a QPainter +with an attached QPaintDevice rather than a QPaintDevice. This allows the +printing code to have complete control over the QPainter. + + +2002/12/16 11:14:48 phil +Fixed a bug entering double-byte encoded characters in UTF-8 mode. + + +2002/12/15 18:31:45 phil +Fix a crash when pasting an empty string. + + +2002/12/11 13:48:02 phil +Released as v0.3. + + +2002/12/07 14:01:09 phil +Brought the documentation up to date. +Minor changes needed to build properly under Windows. +Changed the default fonts under Windows to match the SciTE ones. + + +2002/12/01 22:27:47 phil +Added drag'n'drop support. + + +2002/11/26 12:47:38 phil +Fixed bug in selectToMatchingBrace() and moveToMatchingBrace() in +QextScintilla. +Added the QextScintilla.markerDefine() overload that handles XPM pixmaps. + + +2002/11/22 22:42:37 phil +Added Detlev's support for different folding styles. +Added the QextScintillaBase.SendScintilla() overload that handles colours. + + +2002/11/21 18:56:37 phil +Fixed the value of QextScintilla.AiClosing. +Added braceMatching(), setBraceMatching(), moveToMatchingBrace(), +selectToMatchingBrace(), setMatchedBraceBackgroundColor(), +setMatchedBraceForegroundColor(), setUnmatchedBraceBackgroundColor, +setUnmatchedBraceForegroundColor() to QextScintilla. +Fixed the default lexer colours so that they match SciTE. + + +2002/11/18 19:35:19 phil +Added the binary versions of the translations to CVS so that the build machine +doesn't need Qt installed. +Added the QextScintillaBase.SendScintilla() that allows messages that need a +TextRange structure to be handled. +Added autoIndentStyle() and setAutoIndentStyle() to QextScintillaLexer. +Added autoIndent() and setAutoIndent() to QextScintilla. + + +2002/11/14 22:30:51 phil +Added full i18n support and German translations (thanks to Detlev of course). +Minor fixes for building under Windows. + + +2002/11/13 20:25:28 phil +Fixed QextScintilla::indent() and QextScintilla::unindent(). +Removed QextScintillaBase::setScintillaProperty() (the SCI_SETPROPERTY message +should be used instead). +Added another QextScintillaBase::sendScintilla() overload to make using +SCI_SETPROPERTY easier to use. +Added convertEols(), eolMode(), setEolMode(), eolVisibility(), +setEolVisibility(), whitespaceVisibility(), setWhitespaceVisibility() to +QextScintilla. +Added foldComments(), setFoldComments(), foldQuotes(), setFoldQuotes(), +indentationWarning(), setIndentationWarning() to QextScintillaLexerPython. +Added foldComments(), setFoldComments(), foldCompact(), setFoldCompact(), +foldPreprocessor(), setFoldPreprocessor(), stylePreprocessor(), +setStylePreprocessor() to QextScintillaLexerCPP. +Added support for case insensitive keywords to QextScintillaLexerCPP. +Added various methods to transparently handle lexer properties including +reading and writing them from and to settings files. +Fixed the handling of the context menu. + + +2002/11/03 20:17:03 phil +Updated to Scintilla v1.49. +Fixed bugs in end-of-line fill settings in QextScintillaLexer. +Fixed bugs in UTF support (thanks to Nickolay Kolchin-Semyonov). +Added isUtf8() and setUtf8() to QextScintilla. +Removed SCN_MODIFYATTEMPTRO as it is now deprecated. + + +2002/10/25 18:59:58 phil +Added QextScintilla::lines(). +Fixed a copy/paste bug. +Removed the incorrect fix for the Scintilla indentation guides bug and worked +around it, rather than fixing it properly. + + +2002/10/24 08:41:54 phil +Added foldAll(), folding() and setFolding() to QextScintilla. +Added setScintillaProperty() to QextScintillaBase. +Released as v0.2. + + +2002/10/23 17:26:44 phil +Fixed a Scintilla bug where indentation guides were being displayed incorrectly +when indentations didn't use tabs. +Fixed pasting from the clipboard. + + +2002/10/22 21:27:39 phil +Added cursorPositionChanged(), replace(), zoomIn(), zoomOut() and zoomTo() to +QextScintilla. +Fixed some bugs in QextScintilla::findFirst(). + + +2002/10/21 21:26:53 phil +Added findFirst(), findNext(), removeSelectedText(), getCursorPosition(), +beginUndoAction(), endUndoAction(), redo(), undo(), isRedoAvailable(), +isUndoAvailable() and the text() overload to QextScintilla. + + +2002/10/20 21:59:44 phil +Added backspaceDeindents(), setBackspaceDeindents(), tabIndents(), +setTabIndents(), tabWidth(), setTabWidth(), indent(), unindent(), +indentation(), setIndentation(), indentationWidth(), setIndentationWidth(), +indentationsUseTabs(), setIndentationsUseTabs() to QextScintilla. +Made some changes to the clipboard management, but more work is still needed. + + +2002/10/19 18:41:23 phil +Added clear(), copy(), copyAvailable(), cut(), getSelection(), +hasSelectedText(), indentationGuides(), insertAt(), paste(), selectAll(), +selectedText(), selectionChanged(), setCursorPosition(), +setIndentationGuides(), setIndentationGuidesBackgroundColor(), +setIndentationGuidesForegroundColor() setSelection() to QextScintilla. +Added QSCN_SELCHANGED() to QextScintillaBase. + + +2002/10/18 17:29:06 phil +Added the QextScintillaLexerCPP, QextScintillaLexerCSharp, +QextScintillaLexerIDL, QextScintillaLexerJava and QextScintillaLexerJavaScript +classes. +Fixed incorrect font defaults for the Python lexer. + + +2002/10/12 23:44:51 phil +Fixed the QextScintilla::marginClicked() signature and changed it to pass the +line number rather than the pixel position. +Added mouse wheel support from Detlev. +Setting the lexer no longer resets all the styles. +The cursor shape now changes when moved across the text area and margins. +Added ensureLineVisible(), setMarginsBackgroundColor(), +setMarginsForegroundColor(), setMarginsFont() and the overloaded +setMarginWidth() to QextScintilla. +Changed the visible policy to match SciTE's default. + + +2002/10/11 14:14:19 phil +Added the end-of-line fill as a lexer stype options to the high-level API. +Fixed the default Python styles so that they are the same as SciTE (at least on +UNIX). +Fixed the bug that left cursor artefacts lying around. + + +2002/10/06 16:00:05 phil +Removed QextScintillaBase::Colourise(). +Added QextScintillaLexer and QextScintillaLexerPython. + + +2002/10/05 13:33:23 phil +Documented margins and markers. +Added support for margins and markers to QextScintilla. + + +2002/10/03 10:45:34 phil +Fixed the README regarding building as a static library. +QextScintilla::append() behaves more like QTextEdit::append(). +Added setText(), text(), textChanged(), isReadOnly(), setReadOnly(), +isModified(), setModified(), modificationChanged() and length() to +QextScintilla. +More documentation. + + +2002/10/01 17:37:10 phil +Changes required to build under Windows. + + +2002/09/30 15:31:10 phil +Added the QextScintillaBase::SendScintilla() overload to make it easier to pass +strings from PyQt. + + +2002/09/28 08:56:05 phil +Added the doxygen configuration file. +The internal build system now creates the doxygen documentation. +The original Scintilla documentation is now installed in a sub-directory of the +doc directory. +Added QextScintillaBase::Colourise(). + + +2002/09/18 14:46:34 phil +Released as v0.1. + + +2002/09/18 08:35:31 phil +Changed the re-implemented protected methods in QextScintillaBase so that they +are like the rest of Qt. + + +2002/09/17 18:17:41 phil +The context menu now works. +Key presses are now handled. +Focus changes are now handled. +Added all the installation/licensing infrastructure. + + +2002/09/17 11:08:34 phil +The mouse handling now seems to be correct. +The context menu is displayed, but none of the options yet do anything. + + +2002/09/16 18:53:31 phil +Scrollbars now seem to be working. + + +2002/09/16 08:09:40 phil +Further refined the low-level API so that it is as close as possible to the +standard Scintilla API. + + +2002/09/16 00:35:44 phil +Completed the implementation of the low-level API (ie. QextScintillaBase). +Disabled INCLUDE_DEPRECATED_FEATURES for the Qt port and fixed the bugs in the +main code that appear as a consequence. + + +2002/09/15 19:00:10 phil +Fixed the paint event handling - we now seem to have a basically working +editor. + + +2002/09/14 21:49:56 phil +Added the start of the Qt port, including a simple test editor. As yet nothing +works, but everything compiles. + diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..c7aea18 --- /dev/null +++ b/LICENSE @@ -0,0 +1,280 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 675 Mass Ave, Cambridge, MA 02139, USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, 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 software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, 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 redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +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 give any other recipients of the Program a copy of this License +along with the Program. + +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 Program or any portion +of it, thus forming a work based on the Program, 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) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +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 Program, 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 Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) 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; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, 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 executable. 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. + +If distribution of executable or 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 counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program 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. + + 5. 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 Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program 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. + + 7. 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 Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program 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 Program. + +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. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program 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. + + 9. The Free Software Foundation may publish revised and/or new versions +of the 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 Program +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 Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, 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 + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "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 PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. 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 PROGRAM 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 PROGRAM (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 PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS diff --git a/NEWS b/NEWS new file mode 100644 index 0000000..d9977ab --- /dev/null +++ b/NEWS @@ -0,0 +1,114 @@ +v1.7 4th November 2006 + - Merged Scintilla v1.71. + - Added support for triple clicking. + - Ctrl-D now duplicates the selection rather than the current line. + - The setSelectionBackgroundColor(), setMarkerBackgroundColor() and + setCaretLineBackgroundColor() methods of QextScintilla now respect the + alpha component of the background colour. + - Added defaultColor(), setDefaultColor(), defaultPaper() and + setDefaultPaper() to QextScintillaLexer. + - Added color(), paper(), setColor() and setPaper() to QextScintilla. + - Added cancelList(), isListActive(), showUserList() and userListActivated() + to QextScintilla. + - Added setWrapVisualFlags(), WrapMode::WrapCharacter and WrapVisualFlag to + QextScintilla. + - Added isCallTipActive(), firstVisibleLine(), lexer() and textHeight() to + QextScintilla. + - QextScintilla::foldAll() can now optionally fold all child fold points. + - Auto-completion lists can now be generated from the current document and + API files at the same time. Added autoCompletionFillupsEnabled(), + autoCompleteFromAll(), setAutoCompletionFillupsEnabled() and + setAutoCompletionStartCharacters() to QextScintilla. + - The QextScintillaLexerPython class now handles decorators. + - The QextScintillaLexerRuby class has significant and incompatible changes + to its configurable styles. + +v1.6 30th August 2005 + - Merged Scintilla v1.65. + - Added the QextScintillaLexerCSS, QextScintillaLexerDiff, + QextScintillaLexerMakefile, QextScintillaLexerPOV, + QextScintillaLexerProperties and QextScintillaLexerBatch classes. + - QextScintilla::findFirst() will now optionally not make the found text + visible. + - Added Brazilian Portuguese translations. + +v1.5.1 6th March 2005 + - Updated the German translations. + +v1.5 19th February 2005 + - Merged Scintilla v1.62. + - Added the QextScintillaLexerLua and QextScintillaLexerRuby classes. + - Added viewport() and startDrag() to QextScintillaBase. + +v1.4 16th September 2004 + - Merged Scintilla v1.61. + - Added the QextScintillaLexerBash class. + - Added insert(), edgeColor(), setEdgeColor(), edgeColumn(), setEdgeColumn(), + edgeMode(), setEdgeMode(), wrapMode(), setWrapMode(), + resetSelectionBackgroundColor() and resetSelectionForegroundColor() to + QextScintilla. + - Added clearKeys() and clearAlternateKeys() to QextScintillaCommandSet. + - Added French and Russian translations. + - Added the plugin for Qt Designer. + +v1.3 9th May 2004 + - Merged Scintilla v1.60. + - Added the QextScintillaDocument and QextScintillaLexerPerl classes. + - Added pool() to QextScintillaBase. + - Added document(), setDocument(), recolor(), setCaretForegroundColor(), + setCaretWidth(), setCaretLineVisible(), setCaretLineBackgroundColor(), + setSelectionForegroundColor() and setSelectionBackgroundColor() to + QextScintilla. + +v1.2 16th August 2003 + - Merged Scintilla v1.54. + +v1.1 23rd May 2003 + - Merged Scintilla v1.53. + - Added the QextScintillaLexerHTML and QextScintillaLexerSQL classes. + - By default the C++ lexer now folds preprocessor blocks (to match the + default SciTE properties file rather than the code). + - Added GlobalClass as a style of the C++ lexer (using keyword set 4). + - The WhiteSpace style in all existing lexers is now deprecated and Default + should be used instead. + - Added foldAtElse() and setFoldAtElse() to QextScintillaLexerCPP. + - Added modificationAttempted() to QextScintilla. + - Added SCN_MODIFYATTEMPTRO() to QextScintillaBase. + +v1.0 26th April 2003 + - Merged Scintilla v1.52. + - Added the QextScintillaAPIs, QextScintillaCommand, QextScintillaCommandSet, + QextScintillaMacro and QextScintillaPrinter classes. + - Added autoCompleteFromAPIs(), autoCompleteFromDocument(), + autoCompletionSource(), autoCompletionThreshold(), setAutoCompletionAPIs(), + setAutoCompletionFillups(), setAutoCompletionSource(), + setAutoCompletionThreshold(), callTip(), callTipsVisible(), + clearRegisteredImages(), registerImage(), setCallTipsAPIs(), + setCallTipsBackgroundColor(), setCallTipsVisible(), ensureCursorVisible(), + lineAt(), resetFoldMarginColors(), setFoldMarginColors(), + standardCommands() to QextScintilla. + - Added setDefaultFont() to QextScintillaLexer. + - QextScintilla::markerDefine() now takes a QPixmap rather than a string + encoded XPM image. + - Added QSCINTILLA_VERSION, QSCINTILLA_VERSION_STR and QSCINTILLA_BUILD. + +v0.3 11th December 2002 + - Merged Scintilla v1.49. + - Added drag'n'drop support. + - Added the QextScintilla::markerDefine() overload that handles XPM pixmaps. + - Added support for different folding styles, brace matching, automatic + indentation, end-of-line characters and whitespace visibility to + QextScintilla. + - Completed the Unicode support. + - Added full i18n support and German translations. + +v0.2 24th October 2002 + - The beginnings of the documentation. + - It will now build under Windows. + - Added support for code folding, search & replace, zooming, undo/redo, + cut/copy/paste, indentation guides, margins, markers and the Python and C++ + lexers to QextScintilla. + - Added support for wheel mice. + +v0.1 18th September 2002 + - The first release of the Qt port of Scintilla. diff --git a/README b/README new file mode 100644 index 0000000..79a5918 --- /dev/null +++ b/README @@ -0,0 +1,128 @@ + QScintilla - a Port to Qt of Scintilla + + +INTRODUCTION + +To quote http://www.scintilla.org/: + +"Scintilla is a free source code editing component. It comes with complete +source code and a license that permits use in any free project or commercial +product. + +As well as features found in standard text editing components, Scintilla +includes features especially useful when editing and debugging source code. +These include support for syntax styling, error indicators, code completion and +call tips. The selection margin can contain markers like those used in +debuggers to indicate breakpoints and the current line. Styling choices are +more open than with many editors, allowing the use of proportional fonts, bold +and italics, multiple foreground and background colours and multiple fonts." + +Scintilla runs on Windows and on UNIX/Linux using the GTK+ GUI toolkit. + +QScintilla is a port or Scintilla to the Qt GUI toolkit from Trolltech and runs +on any operating system supported by Qt (eg. Windows, UNIX/Linux, MacOS/X). Qt +v3 or later is required. + +This version of QScintilla is based on Scintilla v1.71. + + +LICENSING + +Scintilla is released under the following license: + +"License for Scintilla and SciTE + + Copyright 1998-2003 by Neil Hodgson + + All Rights Reserved + + Permission to use, copy, modify, and distribute this software and its + documentation for any purpose and without fee is hereby granted, + provided that the above copyright notice appear in all copies and that + both that copyright notice and this permission notice appear in + supporting documentation. + + NEIL HODGSON DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS + SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS, IN NO EVENT SHALL NEIL HODGSON BE LIABLE FOR ANY + SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE + OR PERFORMANCE OF THIS SOFTWARE." + +QScintilla, however, uses the same license model as Qt itself. QScintilla is +available under the GNU GPL on UNIX/Linux systems. QScintilla is available +under a commercial license on Windows, UNIX/Linux and MacOS/X systems. The +commercial license allows closed source applications using QScintilla to be +developed and distributed. + +See the file "LICENSE" to see what license this copy of QScintilla is released +under. + + +INSTALLATION + +Check for any other README files in this directory that relate to your +particular platform. Feel free to contribute a README for your platform or to +provide updates to any existing documentation. + +To configure QScintilla, edit the file "qscintilla.pro" in the "qt" directory. +As supplied, QScintilla is built as a shared library/DLL with thread support +enabled, and installed in the same directory as the Qt library. + +To install the QScintilla library in another directory, edit the value of +"DESTDIR". To build the library in situ (in the "qt" directory) then comment +out "DESTDIR" entirely - this will also mean that you will not need root +privileges under UNIX/Linux. + +If your Qt library was built without thread support, edit the value of "CONFIG" +and remove "thread". + +If you want to build a static library, edit the value of "CONFIG" and replace +"dll" with "staticlib", and edit the value of "DEFINES" and remove +"QEXTSCINTILLA_MAKE_DLL". + +To build QScintilla on UNIX/Linux/MacOS, run (as root): + + cd qt + qmake qscintilla.pro + make + make install + +You may also need to run: + + ldconfig + +If you are using the GNU C++ compiler you might want to edit "qt/Makefile" and +add "-fno-exceptions" to "CXXFLAGS" before running "make". + +To build QScintilla on Windows, run: + + cd qt + qmake qscintilla.pro + nmake + nmake install + copy %QTDIR%\lib\qscintilla.dll %QTDIR%\bin + +Please do not try to build the GPL version of QScintilla under Windows. It +will not work and you would be contravening the GPL. + + +Qt DESIGNER PLUGIN + +QScintilla includes an optional plugin for Qt Designer that allows QScintilla +instances to be included in GUI designs just like any other Qt widget. + +To build the plugin on all platforms, make sure QScintilla is installed and +then run (as root or administrator): + + cd designer + qmake designer + make + +On Windows you may need to run "nmake" rather than "make". + + +Phil Thompson +phil@riverbankcomputing.co.uk diff --git a/README.MacOS b/README.MacOS new file mode 100644 index 0000000..ff6bcba --- /dev/null +++ b/README.MacOS @@ -0,0 +1,49 @@ + QScintilla on MacOS/X + + +All versions of Qt for MacOS/X up to an including Qt v3.3.2 have a bug which +crashes QScintilla. The following patch needs to be applied to Qt: + + +--- src/kernel/qt_mac.h 2004-04-21 00:15:43 -0000 ++++ src/kernel/qt_mac.h 2004-04-21 00:15:43 -0000 + +@@ -395,22 +395,28 @@ + inline QMacSavedPortInfo::~QMacSavedPortInfo() + { + if(mac_window_count) { +- if(valid_gworld) +- SetGWorld(world,handle); //always do this one first +- else +- setPaintDevice(qt_mac_safe_pdev); +- SetClip(clip); +- DisposeRgn(clip); +- SetPenState(&pen); +- RGBForeColor(&fore); +- RGBBackColor(&back); ++ bool set_state = false; ++ if(valid_gworld) { ++ set_state = IsValidPort(world); ++ if(set_state) ++ SetGWorld(world,handle); //always do this one first ++ } else { ++ setPaintDevice(qt_mac_safe_pdev); ++ } ++ if(set_state) { ++ SetClip(clip); ++ SetPenState(&pen); ++ RGBForeColor(&fore); ++ RGBBackColor(&back); ++ } ++ DisposeRgn(clip); + } + if(fi) + delete fi; + qt_mac_current_painter = painter; + #if defined(QT_THREAD_SUPPORT) + if(qt_mac_port_mutex) +- qt_mac_port_mutex->unlock(); ++ qt_mac_port_mutex->unlock(); + #endif + } + diff --git a/designer/designer.pro b/designer/designer.pro new file mode 100644 index 0000000..4c8d722 --- /dev/null +++ b/designer/designer.pro @@ -0,0 +1,13 @@ +# This is the qmake file for the QScintilla plugin for Qt Designer. + + +TEMPLATE = lib +TARGET = qscintillaplugin +# DESTDIR = $(QTDIR)/plugins/designer +INCLUDEPATH = ../qt +LIBPATH += ../tmplib +CONFIG += qt warn_on release plugin + +SOURCES += qscintillaplugin.cpp + +LIBS += -lqscintilla diff --git a/designer/qscintillaplugin.cpp b/designer/qscintillaplugin.cpp new file mode 100644 index 0000000..1f1e595 --- /dev/null +++ b/designer/qscintillaplugin.cpp @@ -0,0 +1,154 @@ +// This implements the QScintilla plugin for Qt Designer. + + +#include + +#include "../qt/qextscintilla.h" + + +static const char *qscintilla_pixmap[]={ + "22 22 35 1", + "m c #000000", + "n c #000033", + "p c #003300", + "r c #003333", + "v c #330000", + "o c #330033", + "l c #333300", + "h c #333333", + "c c #333366", + "d c #336666", + "u c #336699", + "E c #3366cc", + "k c #663333", + "i c #663366", + "b c #666666", + "e c #666699", + "A c #6666cc", + "G c #669966", + "f c #669999", + "j c #6699cc", + "y c #6699ff", + "t c #996666", + "a c #999999", + "g c #9999cc", + "s c #9999ff", + "C c #99cc99", + "x c #99cccc", + "w c #99ccff", + "F c #cc99ff", + "q c #cccccc", + "# c #ccccff", + "B c #ccffcc", + "z c #ccffff", + "D c #ffffcc", + ". c none", + "........#abcda........", + "......abefghdidcf.....", + ".....cadhfaehjheck....", + "....leh.m.ncbehjddo...", + "...depn.hqhqhr#mccch..", + "..bb.hcaeh.hqersjhjcd.", + ".tcm.uqn.hc.uvwxhuygha", + ".feh.n.hb.hhzemcwhmuAm", + "Bgehghqqme.eo#wlnysbnj", + "awhdAzn.engjepswhmuyuj", + "bCh#m.de.jpqwbmcwemlcz", + "hcb#xh.nd#qrbswfehwzbm", + "bd#d.A#zor#qmgbzwgjgws", + "ajbcuqhqzchwwbemewchmr", + "Dcn#cwmhgwehgsxbmhEjAc", + ".uanauFrhbgeahAAbcbuhh", + ".bohdAegcccfbbebuucmhe", + "..briuauAediddeclchhh.", + "...hcbhjccdecbceccch..", + "....nhcmeccdccephcp...", + ".....crbhchhhrhhck....", + "......tcmdhohhcnG....." +}; + + +class QScintillaPlugin : public QWidgetPlugin +{ +public: + QScintillaPlugin() {}; + + QStringList keys() const; + QWidget *create(const QString &classname, QWidget *parent = 0, const char *name = 0); + QString group(const QString &) const; + QIconSet iconSet(const QString &) const; + QString includeFile(const QString &) const; + QString toolTip(const QString &) const; + QString whatsThis(const QString &) const; + bool isContainer(const QString &) const; +}; + + +QStringList QScintillaPlugin::keys() const +{ + QStringList list; + + list << "QextScintilla"; + + return list; +} + + +QWidget *QScintillaPlugin::create(const QString &key, QWidget *parent, const char *name) +{ + if (key == "QextScintilla") + return new QextScintilla(parent, name); + + return 0; +} + + +QString QScintillaPlugin::group(const QString &feature) const +{ + if (feature == "QextScintilla") + return "Input"; + + return QString::null; +} + + +QIconSet QScintillaPlugin::iconSet(const QString &) const +{ + return QIconSet(QPixmap(qscintilla_pixmap)); +} + + +QString QScintillaPlugin::includeFile(const QString &feature) const +{ + if (feature == "QextScintilla") + return "qextscintilla.h"; + + return QString::null; +} + + +QString QScintillaPlugin::toolTip(const QString &feature) const +{ + if (feature == "QextScintilla") + return "QScintilla Programmer's Editor"; + + return QString::null; +} + + +QString QScintillaPlugin::whatsThis(const QString &feature) const +{ + if (feature == "QextScintilla") + return "A port to Qt of the Scintilla programmer's editor"; + + return QString::null; +} + + +bool QScintillaPlugin::isContainer(const QString &) const +{ + return FALSE; +} + + +Q_EXPORT_PLUGIN(QScintillaPlugin) diff --git a/doc/Scintilla/Design.html b/doc/Scintilla/Design.html new file mode 100755 index 0000000..0ca231e --- /dev/null +++ b/doc/Scintilla/Design.html @@ -0,0 +1,249 @@ + + + + + + + + + Scintilla and SciTE + + + + + + + + +
+ Scintilla icon + + Scintilla + Component Design +
+

+ Top level structure +

+

+ Scintilla consists of three major layers of C++ code +

+
    +
  • + Portability Library +
  • +
  • + Core Code +
  • +
  • + Platform Events and API +
  • +
+

+ The primary purpose of this structure is to separate the platform dependent code from the + platform independent core code. This makes it easier to port Scintilla to a new platform and + ensures that most readers of the code do not have to deal with platform details. To minimise + portability problems and avoid code bloat, a conservative subset of C++ is used in Scintilla + with no exception handling, run time type information or use of the standard C++ + library and with limited use of templates. +

+

+ The currently supported platforms, Windows, GTK+/Linux and wxWindows are fairly similar in + many ways. + Each has windows, menus and bitmaps. These features generally work in similar ways so each + has a way to move a window or draw a red line. Sometimes one platform requires a sequence of + calls rather than a single call. At other times, the differences are more profound. Reading + the Windows clipboard occurs synchronously but reading the GTK+ clipboard requires a request + call that will be asynchronously answered with a message containing the clipboard data. + The wxWindows platform is available from the wxWindows site +

+
+

+ Portability Library +

+

+ This is a fairly small and thin layer over the platform's native capabilities. +

+

+ The portability library is defined in Platform.h and is implemented once for each platform. + PlatWin.cxx defines the Windows variants of the methods and PlatGTK.cxx the GTK+ variants. +

+

+ Several of the classes here hold platform specific object identifiers and act as proxies to + these platform objects. Most client code can thus manipulate the platform objects without + caring which is the current platform. Sometimes client code needs access to the underlying + object identifiers and this is provided by the GetID method. The underlying types of the + platform specific identifiers are typedefed to common names to allow them to be transferred + around in client code where needed. +

+

+ Point, PRectangle +

+

+ These are simple classes provided to hold the commonly used geometric primitives. A + PRectangle follows the Mac / Windows convention of not including its bottom and right sides + instead of including all its sides as is normal in GTK+. It is not called Rectangle as this may be + the name of a macro on Windows. +

+

+ Colour, ColourPair, Palette +

+

+ Colour holds a platform specific colour identifier - COLORREF for Windows and GdkColor for + GTK+. The red, green and blue components that make up the colour are limited to the 8 bits of + precision available on Windows. ColourPairs are used because not all possible colours are + always available. Using an 8 bit colour mode, which is a common setting for both Windows and + GTK+, only 256 colours are possible on the display. Thus when an application asks for a dull + red, say #400000, it may only be allocated an already available colour such as #800000 or + #330000. With 16 or 2 colour modes even less choice is available and the application will + have to use the limited set of already available colours. +

+ A Palette object holds a set of colour pairs and can make the appropriate calls to ask to + allocate these colours and to see what the platform has decided will be allowed. +

+ Font +

+

+ Font holds a platform specific font identifier - HFONT for Windows, GdkFont* for GTK+. It + does not own the identifier and so will not delete the platform font object in its + destructor. Client code should call Destroy at appropriate times. +

+

+ Surface +

+

+ Surface is an abstraction over each platform's concept of somewhere that graphical drawing + operations can be done. It may wrap an already created drawing place such as a window or be + used to create a bitmap that can be drawn into and later copied onto another surface. On + Windows it wraps a HDC and possibly a HBITMAP. On GTK+ it wraps a GdkDrawable* and possibly a + GdkPixmap*. Other platform specific objects are created (and correctly destroyed) whenever + required to perform drawing actions. +

+

+ Drawing operations provided include drawing filled and unfilled polygons, lines, rectangles, + ellipses and text. The height and width of text as well as other details can be measured. + Operations can be clipped to a rectangle. Most of the calls are stateless with all parameters + being passed at each call. The exception to this is line drawing which is performed by + calling MoveTo and then LineTo. +

+

+ Window +

+

+ Window acts as a proxy to a platform window allowing operations such as showing, moving, + redrawing, and destroying to be performed. It contains a platform specific window identifier + - HWND for Windows, GtkWidget* for GTK+. +

+

+ ListBox +

+

+ ListBox is a subclass of Window and acts as a proxy to a platform listbox adding methods for + operations such as adding, retrieving, and selecting items. +

+

+ Menu +

+

+ Menu is a small helper class for constructing popup menus. It contains the platform specific + menu identifier - HMENU for Windows, GtkItemFactory* for GTK+. Most of the work in + constructing menus requires access to platform events and so is done in the Platform Events + and API layer. +

+

+ Platform +

+

+ The Platform class is used to access the facilities of the platform. System wide parameters + such as double click speed and chrome colour are available from Platform. Utility functions + such as DebugPrintf are also available from Platform. +

+

+ Core Code +

+

+ The bulk of Scintilla's code is platform independent. This is made up of the CellBuffer, + ContractionState, Document, Editor, Indicator, LineMarker, Style, ViewStyle, KeyMap, + ScintillaBase, CallTip, + and AutoComplete primary classes. +

+

+ CellBuffer +

+

+ A CellBuffer holds text and styling information, the undo stack, the assignment of line + markers to lines, and the fold structure. +

+

+ A cell contains a character byte and its associated style byte. The current state of the + cell buffer is the sequence of cells that make up the text and a sequence of line information + containing the starting position of each line and any markers assigned to each line. +

+

+ The undo stack holds a sequence of actions on the cell buffer. Each action is one of a text + insertion, a text deletion or an undo start action. The start actions are used to group + sequences of text insertions and deletions together so they can be undone together. To + perform an undo operation, each insertion or deletion is undone in reverse sequence. + Similarly, redo reapplies each action to the buffer in sequence. Whenever a character is + inserted in the buffer either directly through a call such as InsertString or through undo or + redo, its styling byte is initially set to zero. Client code is responsible for styling each + character whenever convenient. Styling information is not stored in undo actions. +

+

+ Document +

+

+ A document contains a CellBuffer and deals with some higher level abstractions such as + words, DBCS character sequences and line end character sequences. It is responsible for + managing the styling process and for notifying other objects when changes occur to the + document. +

+

+ Editor +

+

+ The Editor object is central to Scintilla. It is responsible for displaying a document and + responding to user actions and requests from the container. It uses ContractionState, Indicator, + LineMarker, Style, and ViewStyle objects to display the document and a KeyMap class to + map key presses to functions. + The visibility of each line is kept in the ContractionState which is also responsible for mapping + from display lines to documents lines and vice versa. +

+

+ There may be multiple Editor objects attached to one Document object. Changes to a + document are broadcast to the editors through the DocWatcher mechanism. +

+

+ ScintillaBase +

+

+ ScintillaBase is a subclass of Editor and adds extra windowing features including display of + calltips, autocompletion lists and context menus. These features use CallTip and AutoComplete + objects. This class is optional so a lightweight implementation of Scintilla may bypass it if + the added functionality is not required. +

+

+ Platform Events and API +

+

+ Each platform uses different mechanisms for receiving events. On Windows, events are + received through messages and COM. On GTK+, callback functions are used. +

+

+ For each platform, a class is derived from ScintillaBase (and thus from Editor). This is + ScintillaWin on Windows and ScintillaGTK on GTK+. These classes are responsible for + connecting to the platforms event mechanism and also to implement some virtual methods in + Editor and ScintillaBase which are different on the platforms. For example, this layer has to + support this difference between the synchronous Windows clipboard and the asynchronous GTK+ + clipboard. +

+

+ The external API is defined in this layer as each platform has different preferred styles of + API - messages on Windows and function calls on GTK+. This also allows multiple APIs to be + defined on a platform. The currently available API on GTK+ is similar to the Windows API and + does not follow platform conventions well. A second API could be implemented here that did + follow platform conventions. +

+ + + diff --git a/doc/Scintilla/Icons.html b/doc/Scintilla/Icons.html new file mode 100644 index 0000000..0bf302d --- /dev/null +++ b/doc/Scintilla/Icons.html @@ -0,0 +1,56 @@ + + + + + + + + + Scintilla icons + + + + + + + + +
+ Scintilla icon + + Scintilla + and SciTE +
+

+ Icons +

+

+ These images may be used under the same license as Scintilla. +

+

+ Drawn by Iago Rubio, Philippe Lhoste, and Neil Hodgson. +

+

+ zip format (70K) +

+ + + + + + + + + + + + + + + + + +
For autocompletion listsFor margin markers
12x1216x1624x2432x32
+ + diff --git a/doc/Scintilla/Lexer.txt b/doc/Scintilla/Lexer.txt new file mode 100755 index 0000000..9d4ab50 --- /dev/null +++ b/doc/Scintilla/Lexer.txt @@ -0,0 +1,226 @@ +How to write a scintilla lexer + +A lexer for a particular language determines how a specified range of +text shall be colored. Writing a lexer is relatively straightforward +because the lexer need only color given text. The harder job of +determining how much text actually needs to be colored is handled by +Scintilla itself, that is, the lexer's caller. + + +Parameters + +The lexer for language LLL has the following prototype: + + static void ColouriseLLLDoc ( + unsigned int startPos, int length, + int initStyle, + WordList *keywordlists[], + Accessor &styler); + +The styler parameter is an Accessor object. The lexer must use this +object to access the text to be colored. The lexer gets the character +at position i using styler.SafeGetCharAt(i); + +The startPos and length parameters indicate the range of text to be +recolored; the lexer must determine the proper color for all characters +in positions startPos through startPos+length. + +The initStyle parameter indicates the initial state, that is, the state +at the character before startPos. States also indicate the coloring to +be used for a particular range of text. + +Note: the character at StartPos is assumed to start a line, so if a +newline terminates the initStyle state the lexer should enter its +default state (or whatever state should follow initStyle). + +The keywordlists parameter specifies the keywords that the lexer must +recognize. A WordList class object contains methods that make simplify +the recognition of keywords. Present lexers use a helper function +called classifyWordLLL to recognize keywords. These functions show how +to use the keywordlists parameter to recognize keywords. This +documentation will not discuss keywords further. + + +The lexer code + +The task of a lexer can be summarized briefly: for each range r of +characters that are to be colored the same, the lexer should call + + styler.ColourTo(i, state) + +where i is the position of the last character of the range r. The lexer +should set the state variable to the coloring state of the character at +position i and continue until the entire text has been colored. + +Note 1: the styler (Accessor) object remembers the i parameter in the +previous calls to styler.ColourTo, so the single i parameter suffices to +indicate a range of characters. + +Note 2: As a side effect of calling styler.ColourTo(i,state), the +coloring states of all characters in the range are remembered so that +Scintilla may set the initStyle parameter correctly on future calls to +the +lexer. + + +Lexer organization + +There are at least two ways to organize the code of each lexer. Present +lexers use what might be called a "character-based" approach: the outer +loop iterates over characters, like this: + + lengthDoc = startPos + length ; + for (unsigned int i = startPos; i < lengthDoc; i++) { + chNext = styler.SafeGetCharAt(i + 1); + << handle special cases >> + switch(state) { + // Handlers examine only ch and chNext. + // Handlers call styler.ColorTo(i,state) if the state changes. + case state_1: << handle ch in state 1 >> + case state_2: << handle ch in state 2 >> + ... + case state_n: << handle ch in state n >> + } + chPrev = ch; + } + styler.ColourTo(lengthDoc - 1, state); + + +An alternative would be to use a "state-based" approach. The outer loop +would iterate over states, like this: + + lengthDoc = startPos+lenth ; + for ( unsigned int i = startPos ;; ) { + char ch = styler.SafeGetCharAt(i); + int new_state = 0 ; + switch ( state ) { + // scanners set new_state if they set the next state. + case state_1: << scan to the end of state 1 >> break ; + case state_2: << scan to the end of state 2 >> break ; + case default_state: + << scan to the next non-default state and set new_state >> + } + styler.ColourTo(i, state); + if ( i >= lengthDoc ) break ; + if ( ! new_state ) { + ch = styler.SafeGetCharAt(i); + << set state based on ch in the default state >> + } + } + styler.ColourTo(lengthDoc - 1, state); + +This approach might seem to be more natural. State scanners are simpler +than character scanners because less needs to be done. For example, +there is no need to test for the start of a C string inside the scanner +for a C comment. Also this way makes it natural to define routines that +could be used by more than one scanner; for example, a scanToEndOfLine +routine. + +However, the special cases handled in the main loop in the +character-based approach would have to be handled by each state scanner, +so both approaches have advantages. These special cases are discussed +below. + +Special case: Lead characters + +Lead bytes are part of DBCS processing for languages such as Japanese +using an encoding such as Shift-JIS. In these encodings, extended +(16-bit) characters are encoded as a lead byte followed by a trail byte. + +Lead bytes are rarely of any lexical significance, normally only being +allowed within strings and comments. In such contexts, lexers should +ignore ch if styler.IsLeadByte(ch) returns TRUE. + +Note: UTF-8 is simpler than Shift-JIS, so no special handling is +applied for it. All UTF-8 extended characters are >= 128 and none are +lexically significant in programming languages which, so far, use only +characters in ASCII for operators, comment markers, etc. + + +Special case: Folding + +Folding may be performed in the lexer function. It is better to use a +separate folder function as that avoids some troublesome interaction +between styling and folding. The folder function will be run after the +lexer function if folding is enabled. The rest of this section explains +how to perform folding within the lexer function. + +During initialization, lexers that support folding set + + bool fold = styler.GetPropertyInt("fold"); + +If folding is enabled in the editor, fold will be TRUE and the lexer +should call: + + styler.SetLevel(line, level); + +at the end of each line and just before exiting. + +The line parameter is simply the count of the number of newlines seen. +It's initial value is styler.GetLine(startPos) and it is incremented +(after calling styler.SetLevel) whenever a newline is seen. + +The level parameter is the desired indentation level in the low 12 bits, +along with flag bits in the upper four bits. The indentation level +depends on the language. For C++, it is incremented when the lexer sees +a '{' and decremented when the lexer sees a '}' (outside of strings and +comments, of course). + +The following flag bits, defined in Scintilla.h, may be set or cleared +in the flags parameter. The SC_FOLDLEVELWHITEFLAG flag is set if the +lexer considers that the line contains nothing but whitespace. The +SC_FOLDLEVELHEADERFLAG flag indicates that the line is a fold point. +This normally means that the next line has a greater level than present +line. However, the lexer may have some other basis for determining a +fold point. For example, a lexer might create a header line for the +first line of a function definition rather than the last. + +The SC_FOLDLEVELNUMBERMASK mask denotes the level number in the low 12 +bits of the level param. This mask may be used to isolate either flags +or level numbers. + +For example, the C++ lexer contains the following code when a newline is +seen: + + if (fold) { + int lev = levelPrev; + + // Set the "all whitespace" bit if the line is blank. + if (visChars == 0) + lev |= SC_FOLDLEVELWHITEFLAG; + + // Set the "header" bit if needed. + if ((levelCurrent > levelPrev) && (visChars > 0)) + lev |= SC_FOLDLEVELHEADERFLAG; + styler.SetLevel(lineCurrent, lev); + + // reinitialize the folding vars describing the present line. + lineCurrent++; + visChars = 0; // Number of non-whitespace characters on the line. + levelPrev = levelCurrent; + } + +The following code appears in the C++ lexer just before exit: + + // Fill in the real level of the next line, keeping the current flags + // as they will be filled in later. + if (fold) { + // Mask off the level number, leaving only the previous flags. + int flagsNext = styler.LevelAt(lineCurrent); + flagsNext &= ~SC_FOLDLEVELNUMBERMASK; + styler.SetLevel(lineCurrent, levelPrev | flagsNext); + } + + +Don't worry about performance + +The writer of a lexer may safely ignore performance considerations: the +cost of redrawing the screen is several orders of magnitude greater than +the cost of function calls, etc. Moreover, Scintilla performs all the +important optimizations; Scintilla ensures that a lexer will be called +only to recolor text that actually needs to be recolored. Finally, it +is not necessary to avoid extra calls to styler.ColourTo: the sytler +object buffers calls to ColourTo to avoid multiple updates of the +screen. + +Page contributed by Edward K. Ream \ No newline at end of file diff --git a/doc/Scintilla/License.txt b/doc/Scintilla/License.txt new file mode 100755 index 0000000..cbe25b2 --- /dev/null +++ b/doc/Scintilla/License.txt @@ -0,0 +1,20 @@ +License for Scintilla and SciTE + +Copyright 1998-2003 by Neil Hodgson + +All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation. + +NEIL HODGSON DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS +SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS, IN NO EVENT SHALL NEIL HODGSON BE LIABLE FOR ANY +SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE +OR PERFORMANCE OF THIS SOFTWARE. \ No newline at end of file diff --git a/doc/Scintilla/SciBreak.jpg b/doc/Scintilla/SciBreak.jpg new file mode 100755 index 0000000..65c9fc7 Binary files /dev/null and b/doc/Scintilla/SciBreak.jpg differ diff --git a/doc/Scintilla/SciCoding.html b/doc/Scintilla/SciCoding.html new file mode 100755 index 0000000..df0eb90 --- /dev/null +++ b/doc/Scintilla/SciCoding.html @@ -0,0 +1,251 @@ + + + + + + + + Scintilla and SciTE Code Style Preferences + + + + + + + + + +
+ Scintilla icon + + Scintilla + and SciTE +
+

+ Code Style +

+

+ Introduction +

+

+ The source code of Scintilla and SciTE follow my preferences. + Some of these decisions are arbitrary and based on my sense of aesthetics + but its good to have all the code look the same even if its not exactly how + everyone would prefer. +

+

+ Code that does not follow these conventions will be accepted, but will be modified + as time goes by to fit the conventions. Scintilla code follows the conventions more + closely than SciTE except for lexers which are relatively independent modules. + Lexers that are maintained by others are left as they are submitted except that + warnings will be fixed so the whole project can compile cleanly. +

+

+ The AStyle formatting + program with a '-tapO' argument formats code in much the right way although + there are a few bugs in AStyle. The scite/scripts/Fixer.py script will run AStyle + over a C++ source file and fix up some of those bugs. +

+

+ Language features +

+

+ Design goals for Scintilla and SciTE include portability to currently available C++ + compilers on diverse platforms with high performance and low resource usage. + Scintilla has stricter portability requirements to SciTE as it may be ported to + low capability platforms such as Windows CE or PalmOS but it is less likely + SciTE will be. +

+

+ To achieve portability, only a subset of C++ features are used. Exceptions are + not available on some platforms such as Windows CE so exceptions are not used + and thus the standard C++ library can not be used. + Template support differs between compilers so is not used in Scintilla but there + are some simple uses in SciTE. + Run-time type information adds to memory use so is turned off. + Name spaces are not used. +

+

+ The goto statement is not used because of bad memories from my first job + maintaining FORTRAN programs. The union feature is not used as it can lead to + non-type-safe value access. +

+

+ Casting +

+

+ Do not use old C style casts like (char *)s. Instead use the most strict form of C++ + cast possible like const_cast<char *>(s). Use static_cast and const_cast + where possible rather than reinterpret_cast. Because the code is compiled with + run-time type information turned off, dynamic_cast will not work. +

+

+ The benefit to using the new style casts is that they explicitly detail what evil is + occurring and act as signals that something potentially unsafe is being done. +

+

+ Code that treats const seriously is easier to reason about both for humans + and compilers, so use const parameters and avoid const_cast. +

+

+ Warnings +

+

+ To help ensure code is well written and portable, it is compiled with almost all + warnings turned on. This sometimes results in warnings about code that is + completely good (false positives) but changing the code to avoid the warnings + is generally fast and has little impact on readability. +

+

+ Initialise all variables and minimise the scope of variables. If a variable is defined + just before its use then it can't be misused by code before that point. + Use loop declarations that are compatible with both the C++ standard and currently + available compilers. +

+

+ Allocation +

+

+ As exceptions are not used, memory exhaustion can occur. + This should be checked for and handled but there is quite a lot of Scintilla and + SciTE code that doesn't yet. + Fixed length buffers are often used as these are simple and avoid the need to + worry about memory exhaustion but then require that buffer lengths are + respected. +

+

+ The C++ new and delete operators are preferred over C's malloc and free + as new and delete are type safe. +

+

+ Bracketing +

+

+ Start brackets, '{', should be located on the line of the control structure they + start and end brackets, '}', should be at the indented start of a line. When there is + an else clause, this occurs on the same line as the '}'. + This format uses less lines than alternatives, allowing more code to be seen on screen. + Fully bracketed control + structures are preferred because this makes it more likely that modifications will + be correct and it allows Scintilla's folder to work. No braces on returned + expressions as return is a keyword, not a function call. +

+bool fn(int a) {
+        
if (a) {
+                
s();
+                
t();
+        
} else {
+                
u();
+        
}
+        
return !a;
+
}
+

+ Spacing +

+

+ Spaces on both sides of '=' and comparison operators and no attempt to line up '='. + No space before or after '(', when used in calls, but a space after every ','. + No spaces between tokens in short expressions but may be present in + longer expressions. Space before '{'. No space before ';'. + No space after '*' when used to mean pointer and no space after '[' or ']'. + One space between keywords and '('. +

+void StoreConditionally(int c, const char *s) {
+        
if (c && (baseSegment == trustSegment["html"])) {
+                
baseSegment = s+1;
+                
Store(s, baseSegment, "html");
+        
}
+
} +

+ Names +

+

+ Identifiers use mixed case and no underscores. + Class, function and method names start with an uppercase letter and use + further upper case letters to distinguish words. Variables start with a lower + case letter and use upper case letters to distinguish words. + Loop counters and similar variables can have simple names like 'i'. + Function calls should be differentiated from method calls with an initial '::' + global scope modifier. +

+class StorageZone {
+
public:
+        
void Store(const char *s) {
+                
Media *mediaStore = ::GetBaseMedia(zoneDefault);
+                
for (int i=mediaStore->cursor; mediaStore[i], i++) {
+                        
mediaStore->Persist(s[i]);
+                
}
+        
}
+
}; + + diff --git a/doc/Scintilla/SciRest.jpg b/doc/Scintilla/SciRest.jpg new file mode 100755 index 0000000..4b05223 Binary files /dev/null and b/doc/Scintilla/SciRest.jpg differ diff --git a/doc/Scintilla/SciTEIco.png b/doc/Scintilla/SciTEIco.png new file mode 100755 index 0000000..d0cc869 Binary files /dev/null and b/doc/Scintilla/SciTEIco.png differ diff --git a/doc/Scintilla/SciWord.jpg b/doc/Scintilla/SciWord.jpg new file mode 100755 index 0000000..60e70e8 Binary files /dev/null and b/doc/Scintilla/SciWord.jpg differ diff --git a/doc/Scintilla/ScintillaDoc.html b/doc/Scintilla/ScintillaDoc.html new file mode 100755 index 0000000..3767b3b --- /dev/null +++ b/doc/Scintilla/ScintillaDoc.html @@ -0,0 +1,5350 @@ + + + + + + + + + + Scintilla and SciTE + + + + + + + + + + + +
Scintilla iconScintilla
+ +

Scintilla Documentation

+ +

Last edited 4/February/2006 NH

+ +

There is an overview of the internal design of + Scintilla.
+ Some notes on using Scintilla.
+ How to use the Scintilla Edit Control on Windows.
+ A simple sample using Scintilla from + C++ on Windows.
+ A simple sample using Scintilla from + Visual Basic.
+ Bait is a tiny sample using Scintilla + on GTK+.
+ A detailed description of how to write a lexer, including a + discussion of folding.
+ + How to implement a lexer in the container.
+ + How to implement folding.
+ The coding style used in Scintilla and SciTE is + worth following if you want to contribute code to Scintilla but is not compulsory.

+ +

Introduction

+ +

The Windows version of Scintilla is a Windows Control. As such, its primary programming + interface is through Windows messages. Early versions of Scintilla emulated much of the API + defined by the standard Windows Edit and RichEdit controls but those APIs are now deprecated in + favour of Scintilla's own, more consistent API. In addition to messages performing the actions + of a normal Edit control, Scintilla allows control of syntax styling, folding, markers, autocompletion + and call tips.

+ +

The GTK+ version also uses messages in a similar way to the Windows version. This is + different to normal GTK+ practice but made it easier to implement rapidly.

+ +

This documentation describes the individual messages and notifications used by Scintilla. It + does not describe how to link them together to form a useful editor. For now, the best way to + work out how to develop using Scintilla is to see how SciTE uses it. SciTE exercises most of + Scintilla's facilities.

+ +

In the descriptions that follow, the messages are described as function calls with zero, one + or two arguments. These two arguments are the standard wParam and + lParam familiar to Windows programmers. These parameters are integers that + are large enough to hold pointers, and the return value is also an integer large enough to contain a + pointer. + Although the commands only use the + arguments described, because all messages have two arguments whether Scintilla uses them or + not, it is strongly recommended that any unused arguments are set to 0. This allows future + enhancement of messages without the risk of breaking existing code. Common argument types + are:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
boolArguments expect the values 0 for false and 1 for + true.
intArguments are 32-bit signed integers.
const char *Arguments point at text that is being passed to Scintilla but not modified. The text + may be zero terminated or another argument may specify the character count, the + description will make this clear.
char *Arguments point at text buffers that Scintilla will fill with text. In some cases, + another argument will tell Scintilla the buffer size. In others, you must make sure that + the buffer is big enough to hold the requested text. If a NULL pointer (0) is passed + then, for SCI_* calls, the length that should be allocated is returned.
colourColours are set using the RGB format (Red, Green, Blue). The intensity of each colour + is set in the range 0 to 255. If you have three such intensities, they are combined as: + red | (green << 8) | (blue << 16). If you set all intensities to 255, the + colour is white. If you set all intensities to 0, the colour is black. When you set a + colour, you are making a request. What you will get depends on the capabilities of the + system and the current screen mode.
alphaTranslucency is set using an alpha value. + Alpha ranges from 0 (SC_ALPHA_TRANSPARENT) which is completely transparent to + 255 (SC_ALPHA_OPAQUE) which is opaque. The value 256 (SC_ALPHA_NOALPHA) + is opaque and uses code that is not alpha-aware and may be faster. Not all platforms support + translucency and only some Scintilla features implement translucency. + The default alpha value for most features is SC_ALPHA_NOALPHA.
<unused>This is an unused argument. Setting it to 0 will ensure compatibility with future + enhancements.
+ +

Contents

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
o Text retrieval and + modificationo Searching and replacingo Overtype
o Cut, copy and pasteo Error handlingo Undo and Redo
o Selection and informationo Scrolling and automatic + scrollingo White space
o Cursoro Mouse captureo Line endings
o Stylingo Style definitiono Caret, selection, and hotspot styles
o Marginso Other settingso Brace highlighting
o Tabs and Indentation + Guideso Markerso Indicators
o Autocompletiono User listso Call tips
o Keyboard commandso Key bindingso Popup edit menu
o Macro recordingo Printingo Direct access
o Multiple viewso Foldingo Line wrapping
o Zoomingo Long lineso Lexer
o Notificationso GTK+o Deprecated messages
o Edit messages never + supported by Scintillao Building Scintilla
+ +

Messages with names of the form SCI_SETxxxxx often have a companion + SCI_GETxxxxx. To save tedious repetition, if the SCI_GETxxxxx message + returns the value set by the SCI_SETxxxxx message, the SET routine is + described and the GET routine is left to your imagination.

+ +

Text retrieval and modification

+ +

Each character in a Scintilla document is followed by an associated byte of styling + information. The combination of a character byte and a style byte is called a cell. Style bytes + are interpreted as a style index in the low 5 bits and as 3 individual bits of indicators. This allows 32 fundamental styles, which is enough for most + languages, and three independent indicators so that, for example, syntax errors, deprecated + names and bad indentation could all be displayed at once. The number of bits used for styles + can be altered with SCI_SETSTYLEBITS up to a maximum of 7 bits. + The remaining bits can be used for indicators.

+ +

Positions within the Scintilla document refer to a character or the gap before that + character. The first character in a document is 0, the second 1 and so on. If a document + contains nLen characters, the last character is numbered nLen-1. + The caret exists between character positions and can be located from before the first character (0) + to after the last character (nLen).

+ +

There are places where the caret can not go where two character bytes make up one character. + This occurs when a DBCS character from a language like Japanese is included in the document or + when line ends are marked with the CP/M standard of a carriage return followed by a line feed. + The INVALID_POSITION constant (-1) represents an invalid position within the + document.

+ +

All lines of text in Scintilla are the same height, and this height is calculated from the + largest font in any current style. This restriction is for performance; if lines differed in + height then calculations involving positioning of text would require the text to be styled + first.

+ SCI_GETTEXT(int length, char *text)
+ SCI_SETTEXT(<unused>, const char *text)
+ SCI_SETSAVEPOINT
+ SCI_GETLINE(int line, char *text)
+ SCI_REPLACESEL(<unused>, const char + *text)
+ SCI_SETREADONLY(bool readOnly)
+ SCI_GETREADONLY
+ SCI_GETTEXTRANGE(<unused>, TextRange + *tr)
+ SCI_ALLOCATE(int bytes, <unused>)
+ SCI_ADDTEXT(int length, const char *s)
+ SCI_ADDSTYLEDTEXT(int length, cell *s)
+ SCI_APPENDTEXT(int length, const char *s)
+ SCI_INSERTTEXT(int pos, const char *text)
+ SCI_CLEARALL
+ SCI_CLEARDOCUMENTSTYLE
+ SCI_GETCHARAT(int position)
+ SCI_GETSTYLEAT(int position)
+ SCI_GETSTYLEDTEXT(<unused>, TextRange + *tr)
+ SCI_SETSTYLEBITS(int bits)
+ SCI_GETSTYLEBITS
+ SCI_TARGETASUTF8(<unused>, char *s)
+ SCI_ENCODEDFROMUTF8(const char *utf8, char *encoded)
+ SCI_SETLENGTHFORENCODE(int bytes)
+
+ +

SCI_GETTEXT(int length, char *text)
+ This returns length-1 characters of text from the start of the document plus one + terminating 0 character. To collect all the text in a document, use SCI_GETLENGTH + to get the number of characters in the document (nLen), allocate a character + buffer of length nLen+1 bytes, then call SCI_GETTEXT(nLen+1, char + *text). If the text argument is 0 then the length that should be allocated to store the + entire document is returned. + If you then save the text, you should use SCI_SETSAVEPOINT to mark + the text as unmodified.

+ +

See also: SCI_GETSELTEXT, SCI_GETCURLINE, SCI_GETLINE, SCI_GETSTYLEDTEXT, SCI_GETTEXTRANGE

+ +

SCI_SETTEXT(<unused>, const char *text)
+ This replaces all the text in the document with the zero terminated text string you pass + in.

+ +

SCI_SETSAVEPOINT
+ This message tells Scintilla that the current state of the document is unmodified. This is + usually done when the file is saved or loaded, hence the name "save point". As Scintilla + performs undo and redo operations, it notifies the container that it has entered or left the + save point with SCN_SAVEPOINTREACHED and SCN_SAVEPOINTLEFT notification messages, allowing the container to know if the file + should be considered dirty or not.

+ +

See also: SCI_EMPTYUNDOBUFFER, SCI_GETMODIFY

+ +

SCI_GETLINE(int line, char *text)
+ This fills the buffer defined by text with the contents of the nominated line (lines start at + 0). The buffer is not terminated by a 0 character. It is up to you to make sure that the buffer + is long enough for the text, use SCI_LINELENGTH(int line). The returned value is the + number of characters copied to the buffer. The returned text includes any end of line + characters. If you ask for a line number outside the range of lines in the document, 0 + characters are copied. If the text argument is 0 then the length that should be allocated + to store the entire line is returned.

+ +

See also: SCI_GETCURLINE, SCI_GETSELTEXT, SCI_GETTEXTRANGE, SCI_GETSTYLEDTEXT, SCI_GETTEXT

+ +

SCI_REPLACESEL(<unused>, const char *text)
+ The currently selected text between the anchor + and the current position is replaced by the 0 terminated text string. If the anchor and + current position are the same, the text is inserted at the caret position. The caret is + positioned after the inserted text and the caret is scrolled into view.

+ +

SCI_SETREADONLY(bool readOnly)
+ SCI_GETREADONLY
+ These messages set and get the read-only flag for the document. If you mark a document as read + only, attempts to modify the text cause the SCN_MODIFYATTEMPTRO notification.

+ +

SCI_GETTEXTRANGE(<unused>, TextRange *tr)
+ This collects the text between the positions cpMin and cpMax and + copies it to lpstrText (see struct TextRange in + Scintilla.h). If cpMax is -1, text is returned to the end of the + document. The text is 0 terminated, so you must supply a buffer that is at least 1 character + longer than the number of characters you wish to read. The return value is the length of the + returned text not including the terminating 0.

+ +

See also: SCI_GETSELTEXT, SCI_GETLINE, SCI_GETCURLINE, SCI_GETSTYLEDTEXT, SCI_GETTEXT

+ +

SCI_GETSTYLEDTEXT(<unused>, TextRange *tr)
+ This collects styled text into a buffer using two bytes for each cell, with the character at + the lower address of each pair and the style byte at the upper address. Characters between the + positions cpMin and cpMax are copied to lpstrText (see + struct TextRange in Scintilla.h). Two 0 bytes are added to the end of + the text, so the buffer that lpstrText points at must be at least + 2*(cpMax-cpMin)+2 bytes long. No check is made for sensible values of + cpMin or cpMax. Positions outside the document return character codes + and style bytes of 0.

+ +

See also: SCI_GETSELTEXT, SCI_GETLINE, SCI_GETCURLINE, SCI_GETTEXTRANGE, SCI_GETTEXT

+ +

SCI_ALLOCATE(int bytes, <unused>)
+ Allocate a document buffer large enough to store a given number of bytes. + The document will not be made smaller than its current contents.

+ +

SCI_ADDTEXT(int length, const char *s)
+ This inserts the first length characters from the string s + at the current position. This will include any 0's in the string that you might have expected + to stop the insert operation. The current position is set at the end of the inserted text, + but it is not scrolled into view.

+ +

SCI_ADDSTYLEDTEXT(int length, cell *s)
+ This behaves just like SCI_ADDTEXT, but inserts styled text.

+ +

SCI_APPENDTEXT(int length, const char *s)
+ This adds the first length characters from the string s to the end + of the document. This will include any 0's in the string that you might have expected to stop + the operation. The current selection is not changed and the new text is not scrolled into + view.

+ +

SCI_INSERTTEXT(int pos, const char *text)
+ This inserts the zero terminated text string at position pos or at + the current position if pos is -1. If the current position is after the insertion point + then it is moved along with its surrounding text but no scrolling is performed.

+ +

SCI_CLEARALL
+ Unless the document is read-only, this deletes all the text.

+ +

SCI_CLEARDOCUMENTSTYLE
+ When wanting to completely restyle the document, for example after choosing a lexer, the + SCI_CLEARDOCUMENTSTYLE can be used to clear all styling information and reset the + folding state.

+ +

SCI_GETCHARAT(int pos)
+ This returns the character at pos in the document or 0 if pos is + negative or past the end of the document.

+ +

SCI_GETSTYLEAT(int pos)
+ This returns the style at pos in the document, or 0 if pos is + negative or past the end of the document.

+ +

SCI_SETSTYLEBITS(int bits)
+ SCI_GETSTYLEBITS
+ This pair of routines sets and reads back the number of bits in each cell to use for styling, + to a maximum of 7 style bits. The remaining bits can be used as indicators. The standard + setting is SCI_SETSTYLEBITS(5). + The number of styling bits needed by the current lexer can be found with + SCI_GETSTYLEBITSNEEDED.

+ +

TextRange and CharacterRange
+ These structures are defined to be exactly the same shape as the Win32 TEXTRANGE + and CHARRANGE, so that older code that treats Scintilla as a RichEdit will + work.

+
+struct CharacterRange {
+    long cpMin;
+    long cpMax;
+};
+
+struct TextRange {
+    struct CharacterRange chrg;
+    char *lpstrText;
+};
+
+ +

GTK+-specific: Access to encoded text

+ +

SCI_TARGETASUTF8(<unused>, char *s)
+ This method retrieves the value of the target encoded as UTF-8 which is the default + encoding of GTK+ so is useful for retrieving text for use in other parts of the user interface, + such as find and replace dialogs. The length of the encoded text in bytes is returned. +

+ +

SCI_ENCODEDFROMUTF8(const char *utf8, char *encoded)
+ SCI_SETLENGTHFORENCODE(int bytes)
+ SCI_ENCODEDFROMUTF8 converts a UTF-8 string into the document's + encoding which is useful for taking the results of a find dialog, for example, and receiving + a string of bytes that can be searched for in the document. Since the text can contain nul bytes, + the SCI_SETLENGTHFORENCODE method can be used to set the + length that will be converted. If set to -1, the length is determined by finding a nul byte. + The length of the converted string is returned. +

+ + +

Searching

+ SCI_FINDTEXT(int flags, TextToFind + *ttf)
+ SCI_SEARCHANCHOR
+ SCI_SEARCHNEXT(int searchFlags, const char + *text)
+ SCI_SEARCHPREV(int searchFlags, const char + *text)
+ Search and replace using the + target
+
+ +

searchFlags
+ Several of the search routines use flag options, which include a simple regular expression + search. Combine the flag options by adding them:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SCFIND_MATCHCASEA match only occurs with text that matches the case of the search string.
SCFIND_WHOLEWORDA match only occurs if the characters before and after are not word characters.
SCFIND_WORDSTARTA match only occurs if the character before is not a word character.
SCFIND_REGEXPThe search string should be interpreted as a regular expression.
SCFIND_POSIXTreat regular expression in a more POSIX compatible manner + by interpreting bare ( and ) for tagged sections rather than \( and \).
+ +

If SCFIND_REGEXP is not included in the searchFlags, you can + search backwards to find the previous occurrence of a search string by setting the end of the + search range before the start. If SCFIND_REGEXP is included, searches are always + from a lower position to a higher position, even if the search range is backwards.

+ +

In a regular expression, special characters interpreted are:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
.Matches any character
\(This marks the start of a region for tagging a match.
\)This marks the end of a tagged region.
\nWhere n is 1 through 9 refers to the first through ninth tagged region + when replacing. For example, if the search string was Fred\([1-9]\)XXX and + the replace string was Sam\1YYY, when applied to Fred2XXX this + would generate Sam2YYY.
\<This matches the start of a word using Scintilla's definitions of words.
\>This matches the end of a word using Scintilla's definition of words.
\xThis allows you to use a character x that would otherwise have a special meaning. For + example, \[ would be interpreted as [ and not as the start of a character set.
[...]This indicates a set of characters, for example, [abc] means any of the characters a, + b or c. You can also use ranges, for example [a-z] for any lower case character.
[^...]The complement of the characters in the set. For example, [^A-Za-z] means any + character except an alphabetic character.
^This matches the start of a line (unless used inside a set, see above).
$This matches the end of a line.
*This matches 0 or more times. For example, Sa*m matches Sm, + Sam, Saam, Saaam and so on.
+This matches 1 or more times. For example, Sa+m matches + Sam, Saam, Saaam and so on.
+ +

SCI_FINDTEXT(int searchFlags, TextToFind *ttf)
+ This message searches for text in the document. It does not use or move the current selection. + The searchFlags argument controls the + search type, which includes regular expression searches.

+ +

The TextToFind structure is defined in Scintilla.h; set + chrg.cpMin and chrg.cpMax with the range of positions in the document + to search. If SCFIND_REGEXP is not included in the flags, you can search backwards by + setting chrg.cpMax less than chrg.cpMin. If SCFIND_REGEXP + is included, the search is always forwards (even if chrg.cpMax is less than chrg.cpMin). + Set the lpstrText member of TextToFind to point at a zero terminated + text string holding the search pattern. If your language makes the use of TextToFind + difficult, you should consider using SCI_SEARCHINTARGET instead.

+ +

The return value is -1 if the search fails or the position of the start of the found text if + it succeeds. The chrgText.cpMin and chrgText.cpMax members of + TextToFind are filled in with the start and end positions of the found text.

+ +

See also: SCI_SEARCHINTARGET

+ +

TextToFind
+ This structure is defined to have exactly the same shape as the Win32 structure + FINDTEXTEX for old code that treated Scintilla as a RichEdit control.

+
+struct TextToFind {
+    struct CharacterRange chrg;     // range to search
+    char *lpstrText;                // the search pattern (zero terminated)
+    struct CharacterRange chrgText; // returned as position of matching text
+};
+
+ +

SCI_SEARCHANCHOR
+ SCI_SEARCHNEXT(int searchFlags, const char *text)
+ SCI_SEARCHPREV(int searchFlags, const char *text)
+ These messages provide relocatable search support. This allows multiple incremental + interactive searches to be macro recorded while still setting the selection to found text so + the find/select operation is self-contained. These three messages send SCN_MACRORECORD notifications if macro recording is enabled.

+ +

SCI_SEARCHANCHOR sets the search start point used by + SCI_SEARCHNEXT and SCI_SEARCHPREV to the start of the current + selection, that is, the end of the selection that is nearer to the start of the document. You + should always call this before calling either of SCI_SEARCHNEXT or + SCI_SEARCHPREV.

+ +

SCI_SEARCHNEXT and SCI_SEARCHPREV search for the next and previous + occurrence of the zero terminated search string pointed at by text. The search is modified by + the searchFlags. If you request a regular + expression, SCI_SEARCHPREV finds the first occurrence of the search string in the + document, not the previous one before the anchor point.

+ +

The return value is -1 if nothing is found, otherwise the return value is the start position + of the matching text. The selection is updated to show the matched text, but is not scrolled + into view.

+ +

See also: SCI_SEARCHINTARGET, + SCI_FINDTEXT

+ +

Search and replace using the target

+ +

Using SCI_REPLACESEL, + modifications cause scrolling and other visible changes, which may take some time and cause + unwanted display updates. If performing many changes, such as a replace all command, the target + can be used instead. First, set the target, ie. the range to be replaced. Then call + SCI_REPLACETARGET or SCI_REPLACETARGETRE.

+ +

Searching can be performed within the target range with SCI_SEARCHINTARGET, + which uses a counted string to allow searching for null characters. It returns the length of + range or -1 for failure, in which case the target is not moved. The flags used by + SCI_SEARCHINTARGET such as SCFIND_MATCHCASE, + SCFIND_WHOLEWORD, SCFIND_WORDSTART, and SCFIND_REGEXP + can be set with SCI_SETSEARCHFLAGS. SCI_SEARCHINTARGET may be simpler + for some clients to use than SCI_FINDTEXT, as that requires using a pointer to a + structure.

+ SCI_SETTARGETSTART(int pos)
+ SCI_GETTARGETSTART
+ SCI_SETTARGETEND(int pos)
+ SCI_GETTARGETEND
+ SCI_TARGETFROMSELECTION
+ SCI_SETSEARCHFLAGS(int searchFlags)
+ SCI_GETSEARCHFLAGS
+ SCI_SEARCHINTARGET(int length, const char + *text)
+ SCI_REPLACETARGET(int length, const char + *text)
+ SCI_REPLACETARGETRE(int length, const char + *text)
+
+ +

SCI_SETTARGETSTART(int pos)
+ SCI_GETTARGETSTART
+ SCI_SETTARGETEND(int pos)
+ SCI_GETTARGETEND
+ These functions set and return the start and end of the target. When searching in non-regular + expression mode, you can set start greater than end to find the last matching text in the + target rather than the first matching text. The target is also set by a successful + SCI_SEARCHINTARGET.

+ +

SCI_TARGETFROMSELECTION
+ Set the target start and end to the start and end positions of the selection.

+ +

SCI_SETSEARCHFLAGS(int searchFlags)
+ SCI_GETSEARCHFLAGS
+ These get and set the searchFlags used by + SCI_SEARCHINTARGET. There are several option flags including a simple regular + expression search.

+ +

SCI_SEARCHINTARGET(int length, const char *text)
+ This searches for the first occurrence of a text string in the target defined by + SCI_SETTARGETSTART and SCI_SETTARGETEND. The text string is not zero + terminated; the size is set by length. The search is modified by the search flags + set by SCI_SETSEARCHFLAGS. If the search succeeds, the target is set to the found + text and the return value is the position of the start of the matching text. If the search + fails, the result is -1.

+ +

SCI_REPLACETARGET(int length, const char *text)
+ If length is -1, text is a zero terminated string, otherwise + length sets the number of character to replace the target with. + After replacement, the target range refers to the replacement text. + The return value + is the length of the replacement string.
+ Note that the recommended way to delete text in the document is to set the target to the text to be removed, + and to perform a replace target with an empty string.

+ +

SCI_REPLACETARGETRE(int length, const char *text)
+ This replaces the target using regular expressions. If length is -1, + text is a zero terminated string, otherwise length is the number of + characters to use. The replacement string is formed from the text string with any sequences of + \1 through \9 replaced by tagged matches from the most recent regular + expression search. + After replacement, the target range refers to the replacement text. + The return value is the length of the replacement string.

+ +

See also: SCI_FINDTEXT

+ +

Overtype

+ +

SCI_SETOVERTYPE(bool overType)
+ SCI_GETOVERTYPE
+ When overtype is enabled, each typed character replaces the character to the right of the text + caret. When overtype is disabled, characters are inserted at the caret. + SCI_GETOVERTYPE returns TRUE (1) if overtyping is active, otherwise + FALSE (0) will be returned. Use SCI_SETOVERTYPE to set the overtype + mode.

+ +

Cut, copy and paste

+ + SCI_CUT
+ SCI_COPY
+ SCI_PASTE
+ SCI_CLEAR
+ SCI_CANPASTE
+ SCI_COPYRANGE(int start, int end)
+ SCI_COPYTEXT(int length, + const char *text)
+ SCI_SETPASTECONVERTENDINGS(bool convert)
+ SCI_GETPASTECONVERTENDINGS
+
+ +

SCI_CUT
+ SCI_COPY
+ SCI_PASTE
+ SCI_CLEAR
+ SCI_CANPASTE
+ These commands perform the standard tasks of cutting and copying data to the clipboard, + pasting from the clipboard into the document, and clearing the document. + SCI_CANPASTE returns non-zero if the document isn't read-only and if the selection + doesn't contain protected text. If you need a "can copy" or "can cut", use + SCI_GETSELECTIONSTART()-SCI_GETSELECTIONEND(), which will be non-zero if you can + copy or cut to the clipboard.

+ +

GTK+ does not really support SCI_CANPASTE and always returns TRUE + unless the document is read-only.

+ +

On X, the clipboard is asynchronous and may require several messages between + the destination and source applications. Data from SCI_PASTE will not arrive in the + document immediately.

+ + SCI_COPYRANGE(int start, int end)
+ SCI_COPYTEXT(int length, const char *text)
+

SCI_COPYRANGE copies a range of text from the document to + the system clipboard and SCI_COPYTEXT copies a supplied piece of + text to the system clipboard.

+ +

SCI_SETPASTECONVERTENDINGS(bool convert)
+ SCI_GETPASTECONVERTENDINGS
+ If this property is set then when text is pasted any line ends are converted to match the document's + end of line mode as set with + SCI_SETEOLMODE. + Currently only changeable on Windows. On GTK+ pasted text is always converted.

+ +

Error handling

+ +

SCI_SETSTATUS(int status)
+ SCI_GETSTATUS
+ If an error occurs, Scintilla may set an internal error number that can be retrieved with + SCI_GETSTATUS. Not currently used but will be in the future. To clear the error + status call SCI_SETSTATUS(0).

+ +

Undo and Redo

+ +

Scintilla has multiple level undo and redo. It will continue to collect undoable actions + until memory runs out. Scintilla saves actions that change the document. Scintilla does not + save caret and selection movements, view scrolling and the like. Sequences of typing or + deleting are compressed into single actions to make it easier to undo and redo at a sensible + level of detail. Sequences of actions can be combined into actions that are undone as a unit. + These sequences occur between SCI_BEGINUNDOACTION and + SCI_ENDUNDOACTION messages. These sequences can be nested and only the top-level + sequences are undone as units.

+ SCI_UNDO
+ SCI_CANUNDO
+ SCI_EMPTYUNDOBUFFER
+ SCI_REDO
+ SCI_CANREDO
+ SCI_SETUNDOCOLLECTION(bool + collectUndo)
+ SCI_GETUNDOCOLLECTION
+ SCI_BEGINUNDOACTION
+ SCI_ENDUNDOACTION
+
+ +

SCI_UNDO
+ SCI_CANUNDO
+ SCI_UNDO undoes one action, or if the undo buffer has reached a + SCI_ENDUNDOACTION point, all the actions back to the corresponding + SCI_BEGINUNDOACTION.

+ +

SCI_CANUNDO returns 0 if there is nothing to undo, and 1 if there is. You would + typically use the result of this message to enable/disable the Edit menu Undo command.

+ +

SCI_REDO
+ SCI_CANREDO
+ SCI_REDO undoes the effect of the last SCI_UNDO operation.

+ +

SCI_CANREDO returns 0 if there is no action to redo and 1 if there are undo + actions to redo. You could typically use the result of this message to enable/disable the Edit + menu Redo command.

+ +

SCI_EMPTYUNDOBUFFER
+ This command tells Scintilla to forget any saved undo or redo history. It also sets the save + point to the start of the undo buffer, so the document will appear to be unmodified. This does + not cause the SCN_SAVEPOINTREACHED notification to be sent to the + container.

+ +

See also: SCI_SETSAVEPOINT

+ +

SCI_SETUNDOCOLLECTION(bool collectUndo)
+ SCI_GETUNDOCOLLECTION
+ You can control whether Scintilla collects undo information with + SCI_SETUNDOCOLLECTION. Pass in true (1) to collect information and + false (0) to stop collecting. If you stop collection, you should also use + SCI_EMPTYUNDOBUFFER to avoid the undo buffer being unsynchronized with the data in + the buffer.

+ +

You might wish to turn off saving undo information if you use the Scintilla to store text + generated by a program (a Log view) or in a display window where text is often deleted and + regenerated.

+ +

SCI_BEGINUNDOACTION
+ SCI_ENDUNDOACTION
+ Send these two messages to Scintilla to mark the beginning and end of a set of operations that + you want to undo all as one operation but that you have to generate as several operations. + Alternatively, you can use these to mark a set of operations that you do not want to have + combined with the preceding or following operations if they are undone.

+ +

Selection and information

+ +

Scintilla maintains a selection that stretches between two points, the anchor and the + current position. If the anchor and the current position are the same, there is no selected + text. Positions in the document range from 0 (before the first character), to the document size + (after the last character). If you use messages, there is nothing to stop you setting a + position that is in the middle of a CRLF pair, or in the middle of a 2 byte character. However, + keyboard commands will not move the caret into such positions.

+ SCI_GETTEXTLENGTH
+ SCI_GETLENGTH
+ SCI_GETLINECOUNT
+ SCI_GETFIRSTVISIBLELINE
+ SCI_LINESONSCREEN
+ SCI_GETMODIFY
+ SCI_SETSEL(int anchorPos, int currentPos)
+ SCI_GOTOPOS(int position)
+ SCI_GOTOLINE(int line)
+ SCI_SETCURRENTPOS(int position)
+ SCI_GETCURRENTPOS
+ SCI_SETANCHOR(int position)
+ SCI_GETANCHOR
+ SCI_SETSELECTIONSTART(int position)
+ SCI_GETSELECTIONSTART
+ SCI_SETSELECTIONEND(int position)
+ SCI_GETSELECTIONEND
+ SCI_SELECTALL
+ SCI_LINEFROMPOSITION(int position)
+ SCI_POSITIONFROMLINE(int line)
+ SCI_GETLINEENDPOSITION(int line)
+ SCI_LINELENGTH(int line)
+ SCI_GETCOLUMN(int position)
+ SCI_FINDCOLUMN(int line, int column)
+ SCI_POSITIONFROMPOINT(int x, int y)
+ SCI_POSITIONFROMPOINTCLOSE(int x, int + y)
+ SCI_POINTXFROMPOSITION(<unused>, int + position)
+ SCI_POINTYFROMPOSITION(<unused>, int + position)
+ SCI_HIDESELECTION(bool hide)
+ SCI_GETSELTEXT(<unused>, char *text)
+ SCI_GETCURLINE(int textLen, char *text)
+ SCI_SELECTIONISRECTANGLE
+ SCI_SETSELECTIONMODE(int mode)
+ SCI_GETSELECTIONMODE
+ SCI_GETLINESELSTARTPOSITION(int line)
+ SCI_GETLINESELENDPOSITION(int line)
+ SCI_MOVECARETINSIDEVIEW
+ SCI_WORDENDPOSITION(int position, bool + onlyWordCharacters)
+ SCI_WORDSTARTPOSITION(int position, bool + onlyWordCharacters)
+ SCI_POSITIONBEFORE(int position)
+ SCI_POSITIONAFTER(int position)
+ SCI_TEXTWIDTH(int styleNumber, const char *text)
+ SCI_TEXTHEIGHT(int line)
+ SCI_CHOOSECARETX
+
+ +

SCI_GETTEXTLENGTH
+ SCI_GETLENGTH
+ Both these messages return the length of the document in characters.

+ +

SCI_GETLINECOUNT
+ This returns the number of lines in the document. An empty document contains 1 line. A + document holding only an end of line sequence has 2 lines.

+ +

SCI_GETFIRSTVISIBLELINE
+ This returns the line number of the first visible line in the Scintilla view. The first line + in the document is numbered 0. The value is a visible line rather than a document line.

+ +

SCI_LINESONSCREEN
+ This returns the number of complete lines visible on the screen. With a constant line height, + this is the vertical space available divided by the line separation. Unless you arrange to size + your window to an integral number of lines, there may be a partial line visible at the bottom + of the view.

+ +

SCI_GETMODIFY
+ This returns non-zero if the document is modified and 0 if it is unmodified. The modified + status of a document is determined by the undo position relative to the save point. The save + point is set by SCI_SETSAVEPOINT, + usually when you have saved data to a file.

+ +

If you need to be notified when the document becomes modified, Scintilla notifies the + container that it has entered or left the save point with the SCN_SAVEPOINTREACHED and SCN_SAVEPOINTLEFT notification messages.

+ +

SCI_SETSEL(int anchorPos, int currentPos)
+ This message sets both the anchor and the current position. If currentPos is + negative, it means the end of the document. If anchorPos is negative, it means + remove any selection (i.e. set the anchor to the same position as currentPos). The + caret is scrolled into view after this operation.

+ +

SCI_GOTOPOS(int pos)
+ This removes any selection, sets the caret at pos and scrolls the view to make + the caret visible, if necessary. It is equivalent to + SCI_SETSEL(pos, pos). The anchor position is set the same as the current + position.

+ +

SCI_GOTOLINE(int line)
+ This removes any selection and sets the caret at the start of line number line + and scrolls the view (if needed) to make it visible. The anchor position is set the same as the + current position. If line is outside the lines in the document (first line is 0), + the line set is the first or last.

+ +

SCI_SETCURRENTPOS(int pos)
+ This sets the current position and creates a selection between the anchor and the current + position. The caret is not scrolled into view.

+ +

See also: SCI_SCROLLCARET

+ +

SCI_GETCURRENTPOS
+ This returns the current position.

+ +

SCI_SETANCHOR(int pos)
+ This sets the anchor position and creates a selection between the anchor position and the + current position. The caret is not scrolled into view.

+ +

See also: SCI_SCROLLCARET

+ +

SCI_GETANCHOR
+ This returns the current anchor position.

+ +

SCI_SETSELECTIONSTART(int pos)
+ SCI_SETSELECTIONEND(int pos)
+ These set the selection based on the assumption that the anchor position is less than the + current position. They do not make the caret visible. The table shows the positions of the + anchor and the current position after using these messages.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ anchorcurrent
SCI_SETSELECTIONSTARTposMax(pos, current)
SCI_SETSELECTIONENDMin(anchor, pos)pos
+ +

See also: SCI_SCROLLCARET

+ +

SCI_GETSELECTIONSTART
+ SCI_GETSELECTIONEND
+ These return the start and end of the selection without regard to which end is the current + position and which is the anchor. SCI_GETSELECTIONSTART returns the smaller of the + current position or the anchor position. SCI_GETSELECTIONEND returns the larger of + the two values.

+ +

SCI_SELECTALL
+ This selects all the text in the document. The current position is not scrolled into view.

+ +

SCI_LINEFROMPOSITION(int pos)
+ This message returns the line that contains the position pos in the document. The + return value is 0 if pos <= 0. The return value is the last line if + pos is beyond the end of the document.

+ +

SCI_POSITIONFROMLINE(int line)
+ This returns the document position that corresponds with the start of the line. If + line is negative, the position of the line holding the start of the selection is + returned. If line is greater than the lines in the document, the return value is + -1. If line is equal to the number of lines in the document (i.e. 1 line past the + last line), the return value is the end of the document.

+ +

SCI_GETLINEENDPOSITION(int line)
+ This returns the position at the end of the line, before any line end characters. If line + is the last line in the document (which does not have any end of line characters), the result is the size of the + document. If line is negative or line >= SCI_GETLINECOUNT(), the result is undefined.

+ +

SCI_LINELENGTH(int line)
+ This returns the length of the line, including any line end characters. If line + is negative or beyond the last line in the document, the result is 0. If you want the length of + the line not including any end of line characters, use SCI_GETLINEENDPOSITION(line) - SCI_POSITIONFROMLINE(line).

+ SCI_GETSELTEXT(<unused>, char *text)
+ This copies the currently selected text and a terminating 0 byte to the text + buffer. The buffer must be at least + SCI_GETSELECTIONEND()-SCI_GETSELECTIONSTART()+1 bytes long.
+ If the text argument is 0 then the length that should be allocated + to store the entire selection is returned.
+ +

See also: SCI_GETCURLINE, SCI_GETLINE, SCI_GETTEXT, SCI_GETSTYLEDTEXT, SCI_GETTEXTRANGE

+ +

SCI_GETCURLINE(int textLen, char *text)
+ This retrieves the text of the line containing the caret and returns the position within the + line of the caret. Pass in char* text pointing at a buffer large enough to hold + the text you wish to retrieve and a terminating 0 character. + Set textLen to the + length of the buffer which must be at least 1 to hold the terminating 0 character. + If the text argument is 0 then the length that should be allocated + to store the entire current line is returned.

+ +

See also: SCI_GETSELTEXT, SCI_GETLINE, SCI_GETTEXT, SCI_GETSTYLEDTEXT, SCI_GETTEXTRANGE

+ +

SCI_SELECTIONISRECTANGLE
+ This returns 1 if the current selection is in rectangle mode, 0 if not.

+ +

SCI_SETSELECTIONMODE(int mode)
+ SCI_GETSELECTIONMODE
+ The two functions set and get the selection mode, which can be + stream (SC_SEL_STREAM=0) or + rectangular (SC_SEL_RECTANGLE=1) + or by lines (SC_SEL_LINES=2). + When set in these modes, regular caret moves will extend or reduce the selection, + until the mode is cancelled by a call with same value or with SCI_CANCEL. + The get function returns the current mode even if the selection was made by mouse + or with regular extended moves.

+ +

SCI_GETLINESELSTARTPOSITION(int line)
+ SCI_GETLINESELENDPOSITION(int line)
+ Retrieve the position of the start and end of the selection at the given line with + INVALID_POSITION returned if no selection on this line.

+ +

SCI_MOVECARETINSIDEVIEW
+ If the caret is off the top or bottom of the view, it is moved to the nearest line that is + visible to its current position. Any selection is lost.

+ +

SCI_WORDENDPOSITION(int position, bool + onlyWordCharacters)
+ SCI_WORDSTARTPOSITION(int position, bool + onlyWordCharacters)
+ These messages return the start and end of words using the same definition of words as used + internally within Scintilla. You can set your own list of characters that count as words with + SCI_SETWORDCHARS. The position + sets the start or the search, which is forwards when searching for the end and backwards when + searching for the start.

+ +

Set onlyWordCharacters to true (1) to stop searching at the first + non-word character in the search direction. If onlyWordCharacters is + false (0), the first character in the search direction sets the type of the search + as word or non-word and the search stops at the first non-matching character. Searches are also + terminated by the start or end of the document.

+ +

If "w" represents word characters and "." represents non-word characters and "|" represents + the position and true or false is the state of + onlyWordCharacters:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Initial stateend, trueend, falsestart, truestart, false
..ww..|..ww....ww..|..ww....ww....|ww....ww..|..ww....ww|....ww..
....ww|ww........wwww|........wwww|........|wwww........|wwww....
..ww|....ww....ww|....ww....ww....|ww....|ww....ww....|ww....ww..
..ww....|ww....ww....ww|....ww....ww|....ww....|ww....ww|....ww..
+ +

SCI_POSITIONBEFORE(int position)
+ SCI_POSITIONAFTER(int position)
+ These messages return the position before and after another position + in the document taking into account the current code page. The minimum + position returned is 0 and the maximum is the last position in the document. + If called with a position within a multi byte character will return the position + of the start/end of that character.

+ +

SCI_TEXTWIDTH(int styleNumber, const char *text)
+ This returns the pixel width of a string drawn in the given styleNumber which can + be used, for example, to decide how wide to make the line number margin in order to display a + given number of numerals.

+ +

SCI_TEXTHEIGHT(int line)
+ This returns the height in pixels of a particular line. Currently all lines are the same + height.

+ +

SCI_GETCOLUMN(int pos)
+ This message returns the column number of a position pos within the document + taking the width of tabs into account. This returns the column number of the last tab on the + line before pos, plus the number of characters between the last tab and + pos. If there are no tab characters on the line, the return value is the number of + characters up to the position on the line. In both cases, double byte characters count as a + single character. This is probably only useful with monospaced fonts.

+ +

SCI_FINDCOLUMN(int line, int column)
+ This message returns the position of a column on a line + taking the width of tabs into account. It treats a multi-byte character as a single column. + Column numbers, like lines start at 0.

+ +

SCI_POSITIONFROMPOINT(int x, int y)
+ SCI_POSITIONFROMPOINTCLOSE(int x, int y)
+ SCI_POSITIONFROMPOINT finds the closest character position to a point and + SCI_POSITIONFROMPOINTCLOSE is similar but returns -1 if the point is outside the + window or not close to any characters.

+ +

SCI_POINTXFROMPOSITION(<unused>, int pos)
+ SCI_POINTYFROMPOSITION(<unused>, int pos)
+ These messages return the x and y display pixel location of text at position pos + in the document.

+ +

SCI_HIDESELECTION(bool hide)
+ The normal state is to make the selection visible by drawing it as set by SCI_SETSELFORE and SCI_SETSELBACK. However, if you hide the selection, it + is drawn as normal text.

+ +

SCI_CHOOSECARETX
+ Scintilla remembers the x value of the last position horizontally moved to explicitly by the + user and this value is then used when moving vertically such as by using the up and down keys. + This message sets the current x position of the caret as the remembered value.

+ +

Scrolling and automatic scrolling

+ SCI_LINESCROLL(int column, int line)
+ SCI_SCROLLCARET
+ SCI_SETXCARETPOLICY(int caretPolicy, int + caretSlop)
+ SCI_SETYCARETPOLICY(int caretPolicy, int + caretSlop)
+ SCI_SETVISIBLEPOLICY(int caretPolicy, int + caretSlop)
+ SCI_SETHSCROLLBAR(bool visible)
+ SCI_GETHSCROLLBAR
+ SCI_SETVSCROLLBAR(bool visible)
+ SCI_GETVSCROLLBAR
+ SCI_GETXOFFSET
+ SCI_SETXOFFSET(int xOffset)
+ SCI_SETSCROLLWIDTH(int pixelWidth)
+ SCI_GETSCROLLWIDTH
+ SCI_SETENDATLASTLINE(bool + endAtLastLine)
+ SCI_GETENDATLASTLINE
+
+ +

SCI_LINESCROLL(int column, int line)
+ This will attempt to scroll the display by the number of columns and lines that you specify. + Positive line values increase the line number at the top of the screen (i.e. they move the text + upwards as far as the user is concerned), Negative line values do the reverse.

+ +

The column measure is the width of a space in the default style. Positive values increase + the column at the left edge of the view (i.e. they move the text leftwards as far as the user + is concerned). Negative values do the reverse.

+ +

See also: SCI_SETXOFFSET

+ +

SCI_SCROLLCARET
+ If the current position (this is the caret if there is no selection) is not visible, the view + is scrolled to make it visible according to the current caret policy.

+ +

SCI_SETXCARETPOLICY(int caretPolicy, int caretSlop)
+ SCI_SETYCARETPOLICY(int caretPolicy, int caretSlop)
+ These set the caret policy. The value of caretPolicy is a combination of + CARET_SLOP, CARET_STRICT, CARET_JUMPS and + CARET_EVEN.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
CARET_SLOPIf set, we can define a slop value: caretSlop. This value defines an + unwanted zone (UZ) where the caret is... unwanted. This zone is defined as a number of + pixels near the vertical margins, and as a number of lines near the horizontal margins. + By keeping the caret away from the edges, it is seen within its context. This makes it + likely that the identifier that the caret is on can be completely seen, and that the + current line is seen with some of the lines following it, which are often dependent on + that line.
CARET_STRICTIf set, the policy set by CARET_SLOP is enforced... strictly. The caret + is centred on the display if caretSlop is not set, and cannot go in the UZ + if caretSlop is set.
CARET_JUMPSIf set, the display is moved more energetically so the caret can move in the same + direction longer before the policy is applied again. '3UZ' notation is used to indicate + three time the size of the UZ as a distance to the margin.
CARET_EVENIf not set, instead of having symmetrical UZs, the left and bottom UZs are extended + up to right and top UZs respectively. This way, we favour the displaying of useful + information: the beginning of lines, where most code reside, and the lines after the + caret, for example, the body of a function.
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
slopstrictjumpsevenCaret can go to the marginOn reaching limit (going out of visibility
+ or going into the UZ) display is...
0000Yesmoved to put caret on top/on right
0001Yesmoved by one position
0010Yesmoved to put caret on top/on right
0011Yescentred on the caret
01-0Caret is always on top/on right of display-
01-1No, caret is always centred-
1000Yesmoved to put caret out of the asymmetrical UZ
1001Yesmoved to put caret out of the UZ
1010Yesmoved to put caret at 3UZ of the top or right margin
1011Yesmoved to put caret at 3UZ of the margin
11-0Caret is always at UZ of top/right margin-
1101No, kept out of UZmoved by one position
1110No, kept out of UZmoved to put caret at 3UZ of the margin
+ +

SCI_SETVISIBLEPOLICY(int caretPolicy, int caretSlop)
+ This determines how the vertical positioning is determined when SCI_ENSUREVISIBLEENFORCEPOLICY is + called. It takes VISIBLE_SLOP and VISIBLE_STRICT flags for the policy + parameter. It is similar in operation to SCI_SETYCARETPOLICY(int caretPolicy, int + caretSlop).

+ +

SCI_SETHSCROLLBAR(bool visible)
+ SCI_GETHSCROLLBAR
+ The horizontal scroll bar is only displayed if it is needed for the assumed width. + If you never wish to see it, call + SCI_SETHSCROLLBAR(0). Use SCI_SETHSCROLLBAR(1) to enable it again. + SCI_GETHSCROLLBAR returns the current state. The default state is to display it + when needed. + See also: SCI_SETSCROLLWIDTH.

+ +

SCI_SETVSCROLLBAR(bool visible)
+ SCI_GETVSCROLLBAR
+ By default, the vertical scroll bar is always displayed when required. You can choose to hide + or show it with SCI_SETVSCROLLBAR and get the current state with + SCI_GETVSCROLLBAR.

+ +

SCI_SETXOFFSET(int xOffset)
+ SCI_GETXOFFSET
+ The xOffset is the horizontal scroll position in pixels of the start of the text + view. A value of 0 is the normal position with the first text column visible at the left of the + view.

+ +

See also: SCI_LINESCROLL

+ +

SCI_SETSCROLLWIDTH(int pixelWidth)
+ SCI_GETSCROLLWIDTH
+ For performance, Scintilla does not measure the display width of the document to determine + the properties of the horizontal scroll bar. Instead, an assumed width is used. + These messages set and get the document width in pixels assumed by Scintilla. + The default value is 2000.

+ +

SCI_SETENDATLASTLINE(bool endAtLastLine)
+ SCI_GETENDATLASTLINE
+ SCI_SETENDATLASTLINE sets the scroll range so that maximum scroll position has + the last line at the bottom of the view (default). Setting this to false allows + scrolling one page below the last line.

+ +

White space

+ SCI_SETVIEWWS(int wsMode)
+ SCI_GETVIEWWS
+ SCI_SETWHITESPACEFORE(bool + useWhitespaceForeColour, int colour)
+ SCI_SETWHITESPACEBACK(bool + useWhitespaceBackColour, int colour)
+
+ +

SCI_SETVIEWWS(int wsMode)
+ SCI_GETVIEWWS
+ White space can be made visible which may useful for languages in which white space is + significant, such as Python. Space characters appear as small centred dots and tab characters + as light arrows pointing to the right. There are also ways to control the display of end of line characters. The two messages set and get the + white space display mode. The wsMode argument can be one of:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
SCWS_INVISIBLE0The normal display mode with white space displayed as an empty background + colour.
SCWS_VISIBLEALWAYS1White space characters are drawn as dots and arrows,
SCWS_VISIBLEAFTERINDENT2White space used for indentation is displayed normally but after the first visible + character, it is shown as dots and arrows.
+ +

The effect of using any other wsMode value is undefined.

+ +

SCI_SETWHITESPACEFORE<(bool useWhitespaceForeColour, int colour)
+ SCI_SETWHITESPACEBACK(bool useWhitespaceBackColour, int colour)
+ By default, the colour of visible white space is determined by the lexer in use. The + foreground and/or background colour of all visible white space can be set globally, overriding + the lexer's colours with SCI_SETWHITESPACEFORE and + SCI_SETWHITESPACEBACK.

+ +

Cursor

+ +

SCI_SETCURSOR(int curType)
+ SCI_GETCURSOR
+ The cursor is normally chosen in a context sensitive way, so it will be different over the + margin than when over the text. When performing a slow action, you may wish to change to a wait + cursor. You set the cursor type with SCI_SETCURSOR. The curType + argument can be:

+ + + + + + + + + + + + + + + + + + + +
SC_CURSORNORMAL-1The normal cursor is displayed.
SC_CURSORWAIT 4The wait cursor is displayed when the mouse is over or owned by the Scintilla + window.
+ +

Cursor values 1 through 7 have defined cursors, but only SC_CURSORWAIT is + usefully controllable. Other values of curType cause a pointer to be displayed. + The SCI_GETCURSOR message returns the last cursor type you set, or + SC_CURSORNORMAL (-1) if you have not set a cursor type.

+ +

Mouse capture

+ +

SCI_SETMOUSEDOWNCAPTURES(bool captures)
+ SCI_GETMOUSEDOWNCAPTURES
+ When the mouse is pressed inside Scintilla, it is captured so future mouse movement events are + sent to Scintilla. This behavior may be turned off with + SCI_SETMOUSEDOWNCAPTURES(0).

+ +

Line endings

+ +

Scintilla can interpret any of the three major line end conventions, Macintosh (\r), Unix + (\n) and CP/M / DOS / Windows (\r\n). When the user presses the Enter key, one of these line + end strings is inserted into the buffer. The default is \r\n in Windows and \n in Unix, but + this can be changed with the SCI_SETEOLMODE message. You can also convert the + entire document to one of these line endings with SCI_CONVERTEOLS. Finally, you + can choose to display the line endings with SCI_SETVIEWEOL.

+ SCI_SETEOLMODE(int eolMode)
+ SCI_GETEOLMODE
+ SCI_CONVERTEOLS(int eolMode)
+ SCI_SETVIEWEOL(bool visible)
+ SCI_GETVIEWEOL
+
+ +

SCI_SETEOLMODE(int eolMode)
+ SCI_GETEOLMODE
+ SCI_SETEOLMODE sets the characters that are added into the document when the user + presses the Enter key. You can set eolMode to one of SC_EOL_CRLF (0), + SC_EOL_CR (1), or SC_EOL_LF (2). The SCI_GETEOLMODE + message retrieves the current state.

+ +

SCI_CONVERTEOLS(int eolMode)
+ This message changes all the end of line characters in the document to match + eolMode. Valid values are: SC_EOL_CRLF (0), SC_EOL_CR + (1), or SC_EOL_LF (2).

+ +

SCI_SETVIEWEOL(bool visible)
+ SCI_GETVIEWEOL
+ Normally, the end of line characters are hidden, but SCI_SETVIEWEOL allows you to + display (or hide) them by setting visible true (or + false). The visible rendering of the end of line characters is similar to + (CR), (LF), or (CR)(LF). SCI_GETVIEWEOL + returns the current state.

+ +

Styling

+ +

The styling messages allow you to assign styles to text. The standard Scintilla settings + divide the 8 style bits available for each character into 5 bits (0 to 4 = styles 0 to 31) that set a style and three bits (5 to 7) that + define indicators. You can change the balance between + styles and indicators with SCI_SETSTYLEBITS. If your styling needs can be met by + one of the standard lexers, or if you can write your own, then a lexer is probably the easiest + way to style your document. If you choose to use the container to do the styling you can use + the SCI_SETLEXER command to select + SCLEX_CONTAINER, in which case the container is sent a SCN_STYLENEEDED notification each time text needs styling for display. As another + alternative, you might use idle time to style the document. Even if you use a lexer, you might + use the styling commands to mark errors detected by a compiler. The following commands can be + used.

+ SCI_GETENDSTYLED
+ SCI_STARTSTYLING(int position, int mask)
+ SCI_SETSTYLING(int length, int style)
+ SCI_SETSTYLINGEX(int length, const char + *styles)
+ SCI_SETLINESTATE(int line, int value)
+ SCI_GETLINESTATE(int line)
+ SCI_GETMAXLINESTATE
+
+ +

SCI_GETENDSTYLED
+ Scintilla keeps a record of the last character that is likely to be styled correctly. This is + moved forwards when characters after it are styled and moved backwards if changes are made to + the text of the document before it. Before drawing text, this position is checked to see if any + styling is needed and, if so, a SCN_STYLENEEDED notification message is sent to the + container. The container can send SCI_GETENDSTYLED to work out where it needs to + start styling. Scintilla will always ask to style whole lines.

+ +

SCI_STARTSTYLING(int pos, int mask)
+ This prepares for styling by setting the styling position pos to start at and a + mask indicating which bits of the style bytes can be set. The mask allows styling + to occur over several passes, with, for example, basic styling done on an initial pass to + ensure that the text of the code is seen quickly and correctly, and then a second slower pass, + detecting syntax errors and using indicators to show where these are. For example, with the + standard settings of 5 style bits and 3 indicator bits, you would use a mask value + of 31 (0x1f) if you were setting text styles and did not want to change the indicators. After + SCI_STARTSTYLING, send multiple SCI_SETSTYLING messages for each + lexical entity to style.

+ +

SCI_SETSTYLING(int length, int style)
+ This message sets the style of length characters starting at the styling position + and then increases the styling position by length, ready for the next call. If + sCell is the style byte, the operation is:
+ if ((sCell & mask) != style) sCell = (sCell & ~mask) | (style & + mask);
+

+ +

SCI_SETSTYLINGEX(int length, const char *styles)
+ As an alternative to SCI_SETSTYLING, which applies the same style to each byte, + you can use this message which specifies the styles for each of length bytes from + the styling position and then increases the styling position by length, ready for + the next call. The length styling bytes pointed at by styles should + not contain any bits not set in mask.

+ +

SCI_SETLINESTATE(int line, int value)
+ SCI_GETLINESTATE(int line)
+ As well as the 8 bits of lexical state stored for each character there is also an integer + stored for each line. This can be used for longer lived parse states such as what the current + scripting language is in an ASP page. Use SCI_SETLINESTATE to set the integer + value and SCI_GETLINESTATE to get the value.

+ +

SCI_GETMAXLINESTATE
+ This returns the last line that has any line state.

+ +

Style definition

+ +

While the style setting messages mentioned above change the style numbers associated with + text, these messages define how those style numbers are interpreted visually. There are 128 + lexer styles that can be set, numbered 0 to STYLEMAX (127). Unless you use SCI_SETSTYLEBITS to change the number + of style bits, styles 0 to 31 are used to set the text attributes. There are also some + predefined numbered styles starting at 32, The following STYLE_* constants are + defined.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
STYLE_DEFAULT32This style defines the attributes that all styles receive when the + SCI_STYLECLEARALL message is used.
STYLE_LINENUMBER33This style sets the attributes of the text used to display line numbers in a line + number margin. The background colour set for this style also sets the background colour + for all margins that do not have any folding mask bits set. That is, any margin for which + mask & SC_MASK_FOLDERS is 0. See SCI_SETMARGINMASKN for more about masks.
STYLE_BRACELIGHT34This style sets the attributes used when highlighting braces with the SCI_BRACEHIGHLIGHT message and + when highlighting the corresponding indentation with SCI_SETHIGHLIGHTGUIDE.
STYLE_BRACEBAD35This style sets the display attributes used when marking an unmatched brace with the + SCI_BRACEBADLIGHT + message.
STYLE_CONTROLCHAR36This style sets the font used when drawing control characters. + Only the font, size, bold, italics, and character set attributes are used and not + the colour attributes. See + also: SCI_SETCONTROLCHARSYMBOL.
STYLE_INDENTGUIDE37This style sets the foreground and background colours used when drawing the + indentation guides.
STYLE_CALLTIP38 Call tips normally use the font attributes defined by STYLE_DEFAULT. + Use of SCI_CALLTIPUSESTYLE + causes call tips to use this style instead. Only the font face name, font size, + foreground and background colours and character set attributes are used.
STYLE_LASTPREDEFINED39To make it easier for client code to discover the range of styles that are + predefined, this is set to the style number of the last predefined style. This is + currently set to 39 and the last style with an identifier is 38, which reserves space + for one future predefined style.
STYLE_MAX127This is not a style but is the number of the maximum style that can be set. Styles + between STYLE_LASTPREDEFINED and STYLE_MAX would be appropriate + if you used SCI_SETSTYLEBITS + to set more than 5 style bits.
+ +

For each style you can set the font name, size and use of bold, italic and underline, + foreground and background colour and the character set. You can also choose to hide text with a + given style, display all characters as upper or lower case and fill from the last character on + a line to the end of the line (for embedded languages). There is also an experimental attribute + to make text read-only.

+ +

It is entirely up to you how you use styles. If you want to use syntax colouring you might + use style 0 for white space, style 1 for numbers, style 2 for keywords, style 3 for strings, + style 4 for preprocessor, style 5 for operators, and so on.

+ SCI_STYLERESETDEFAULT
+ SCI_STYLECLEARALL
+ SCI_STYLESETFONT(int styleNumber, char + *fontName)
+ SCI_STYLESETSIZE(int styleNumber, int + sizeInPoints)
+ SCI_STYLESETBOLD(int styleNumber, bool + bold)
+ SCI_STYLESETITALIC(int styleNumber, bool + italic)
+ SCI_STYLESETUNDERLINE(int styleNumber, bool + underline)
+ SCI_STYLESETFORE(int styleNumber, int + colour)
+ SCI_STYLESETBACK(int styleNumber, int + colour)
+ SCI_STYLESETEOLFILLED(int styleNumber, bool + eolFilled)
+ SCI_STYLESETCHARACTERSET(int styleNumber, + int charSet)
+ SCI_STYLESETCASE(int styleNumber, int + caseMode)
+ SCI_STYLESETVISIBLE(int styleNumber, bool + visible)
+ SCI_STYLESETCHANGEABLE(int styleNumber, bool + changeable)
+ SCI_STYLESETHOTSPOT(int styleNumber, bool + hotspot)
+
+ +

SCI_STYLERESETDEFAULT
+ This message resets STYLE_DEFAULT to its state when Scintilla was + initialised.

+ +

SCI_STYLECLEARALL
+ This message sets all styles to have the same attributes as STYLE_DEFAULT. If you + are setting up Scintilla for syntax colouring, it is likely that the lexical styles you set + will be very similar. One way to set the styles is to:
+ 1. Set STYLE_DEFAULT to the common features of all styles.
+ 2. Use SCI_STYLECLEARALL to copy this to all styles.
+ 3. Set the style attributes that make your lexical styles different.

+ +

SCI_STYLESETFONT(int styleNumber, const char *fontName)
+ SCI_STYLESETSIZE(int styleNumber, int sizeInPoints)
+ SCI_STYLESETBOLD(int styleNumber, bool bold)
+ SCI_STYLESETITALIC(int styleNumber, bool italic)
+ These messages (plus SCI_STYLESETCHARACTERSET) set the font + attributes that are used to match the fonts you request to those available. The + fontName is a zero terminated string holding the name of a font. Under Windows, + only the first 32 characters of the name are used and the name is not case sensitive. For + internal caching, Scintilla tracks fonts by name and does care about the casing of font names, + so please be consistent. On GTK+ 2.x, either GDK or Pango can be used to display text. + Pango antialiases text, works well with Unicode and is better supported in recent versions of GTK+ + but GDK is faster. + Prepend a '!' character to the font name to use Pango.

+ +

SCI_STYLESETUNDERLINE(int styleNumber, bool + underline)
+ You can set a style to be underlined. The underline is drawn in the foreground colour. All + characters with a style that includes the underline attribute are underlined, even if they are + white space.

+ +

SCI_STYLESETFORE(int styleNumber, int colour)
+ SCI_STYLESETBACK(int styleNumber, int colour)
+ Text is drawn in the foreground colour. The space in each character cell that is not occupied + by the character is drawn in the background colour.

+ +

SCI_STYLESETEOLFILLED(int styleNumber, bool + eolFilled)
+ If the last character in the line has a style with this attribute set, the remainder of the + line up to the right edge of the window is filled with the background colour set for the last + character. This is useful when a document contains embedded sections in another language such + as HTML pages with embedded JavaScript. By setting eolFilled to true + and a consistent background colour (different from the background colour set for the HTML + styles) to all JavaScript styles then JavaScript sections will be easily distinguished from + HTML.

+ +

SCI_STYLESETCHARACTERSET(int styleNumber, int + charSet)
+ You can set a style to use a different character set than the default. The places where such + characters sets are likely to be useful are comments and literal strings. For example, + SCI_STYLESETCHARACTERSET(SCE_C_STRING, SC_CHARSET_RUSSIAN) would ensure that + strings in Russian would display correctly in C and C++ (SCE_C_STRING is the style + number used by the C and C++ lexer to display literal strings; it has the value 6). This + feature works differently on Windows and GTK+.

+ +

The character sets supported on Windows are:
+ SC_CHARSET_ANSI, SC_CHARSET_ARABIC, SC_CHARSET_BALTIC, + SC_CHARSET_CHINESEBIG5, SC_CHARSET_DEFAULT, + SC_CHARSET_EASTEUROPE, SC_CHARSET_GB2312, + SC_CHARSET_GREEK, SC_CHARSET_HANGUL, SC_CHARSET_HEBREW, + SC_CHARSET_JOHAB, SC_CHARSET_MAC, SC_CHARSET_OEM, + SC_CHARSET_RUSSIAN (code page 1251), + SC_CHARSET_SHIFTJIS, SC_CHARSET_SYMBOL, SC_CHARSET_THAI, + SC_CHARSET_TURKISH, and SC_CHARSET_VIETNAMESE.

+ +

The character sets supported on GTK+ are:
+ SC_CHARSET_ANSI, SC_CHARSET_CYRILLIC (code page 1251), + SC_CHARSET_EASTEUROPE, + SC_CHARSET_GB2312, SC_CHARSET_HANGUL, + SC_CHARSET_RUSSIAN (KOI8-R), SC_CHARSET_SHIFTJIS, and + SC_CHARSET_8859_15.

+ +

SCI_STYLESETCASE(int styleNumber, int caseMode)
+ The value of caseMode determines how text is displayed. You can set upper case + (SC_CASE_UPPER, 1) or lower case (SC_CASE_LOWER, 2) or display + normally (SC_CASE_MIXED, 0). This does not change the stored text, only how it is + displayed.

+ +

SCI_STYLESETVISIBLE(int styleNumber, bool visible)
+ Text is normally visible. However, you can completely hide it by giving it a style with the + visible set to 0. This could be used to hide embedded formatting instructions or + hypertext keywords in HTML or XML.

+ +

SCI_STYLESETCHANGEABLE(int styleNumber, bool + changeable)
+ This is an experimental and incompletely implemented style attribute. The default setting is + changeable set true but when set false it makes text + read-only. Currently it only stops the caret from being within not-changeable text and does not + yet stop deleting a range that contains not-changeable text.

+ +

SCI_STYLESETHOTSPOT(int styleNumber, bool + hotspot)
+ This style is used to mark ranges of text that can detect mouse clicks. + The cursor changes to a hand over hotspots, and the foreground, and background colours + may change and an underline appear to indicate that these areas are sensitive to clicking. + This may be used to allow hyperlinks to other documents.

+ + SCI_STYLESETHOTSPOT(int styleNumber, bool + hotspot)
+ +

Caret, selection, and hotspot styles

+ +

The selection is shown by changing the foreground and/or background colours. If one of these + is not set then that attribute is not changed for the selection. The default is to show the + selection by changing the background to light gray and leaving the foreground the same as when + it was not selected. When there is no selection, the current insertion point is marked by the + text caret. This is a vertical line that is normally blinking on and off to attract the users + attention.

+ SCI_SETSELFORE(bool useSelectionForeColour, int + colour)
+ SCI_SETSELBACK(bool useSelectionBackColour, int + colour)
+ SCI_SETSELALPHA(int alpha)
+ SCI_GETSELALPHA
+ SCI_SETCARETFORE(int colour)
+ SCI_GETCARETFORE
+ SCI_SETCARETLINEVISIBLE(bool + show)
+ SCI_GETCARETLINEVISIBLE
+ SCI_SETCARETLINEBACK(int colour)
+ SCI_GETCARETLINEBACK
+ SCI_SETCARETLINEBACKALPHA(int alpha)
+ SCI_GETCARETLINEBACKALPHA
+ SCI_SETCARETPERIOD(int milliseconds)
+ SCI_GETCARETPERIOD
+ SCI_SETCARETWIDTH(int pixels)
+ SCI_GETCARETWIDTH
+ SCI_SETHOTSPOTACTIVEFORE
+ SCI_SETHOTSPOTACTIVEBACK
+ SCI_SETHOTSPOTACTIVEUNDERLINE
+ SCI_SETHOTSPOTSINGLELINE
+ SCI_SETCONTROLCHARSYMBOL(int + symbol)
+ SCI_GETCONTROLCHARSYMBOL
+ SCI_SETCARETSTICKY
+ SCI_GETCARETSTICKY
+ SCI_TOGGLECARETSTICKY
+
+ +

SCI_SETSELFORE(bool useSelectionForeColour, int colour)
+ SCI_SETSELBACK(bool useSelectionBackColour, int colour)
+ You can choose to override the default selection colouring with these two messages. The colour + you provide is used if you set useSelection*Colour to true. If it is + set to false, the default colour colouring is used and the colour + argument has no effect.

+

SCI_SETSELALPHA(int alpha)
+ SCI_GETSELALPHA
+ The selection can be drawn translucently in the selection background colour by + setting an alpha value.

+ +

SCI_SETCARETFORE(int colour)
+ SCI_GETCARETFORE
+ The colour of the caret can be set with SCI_SETCARETFORE and retrieved with + SCI_CETCARETFORE.

+ +

SCI_SETCARETLINEVISIBLE(bool show)
+ SCI_GETCARETLINEVISIBLE
+ SCI_SETCARETLINEBACK(int colour)
+ SCI_GETCARETLINEBACK
+ SCI_SETCARETLINEBACKALPHA(int alpha)
+ SCI_GETCARETLINEBACKALPHA
+ You can choose to make the background colour of the line containing the caret different with + these messages. To do this, set the desired background colour with + SCI_SETCARETLINEBACK, then use SCI_SETCARETLINEVISIBLE(true) to + enable the effect. You can cancel the effect with SCI_SETCARETLINEVISIBLE(false). + The two SCI_GETCARET* functions return the state and the colour. This form of + background colouring has highest priority when a line has markers that would otherwise change + the background colour. + The caret line may also be drawn translucently which allows other background colours to show + through. This is done by setting the alpha (translucency) value by calling + SCI_SETCARETLINEBACKALPHA. When the alpha is not SC_ALPHA_NOALPHA, + the caret line is drawn after all other features so will affect the colour of all other features. +

+ +

SCI_SETCARETPERIOD(int milliseconds)
+ SCI_GETCARETPERIOD
+ The rate at which the caret blinks can be set with SCI_SETCARETPERIOD which + determines the time in milliseconds that the caret is visible or invisible before changing + state. Setting the period to 0 stops the caret blinking. The default value is 500 milliseconds. + SCI_GETCARETPERIOD returns the current setting.

+ +

SCI_SETCARETWIDTH(int pixels)
+ SCI_GETCARETWIDTH
+ The width of the caret can be set with SCI_SETCARETWIDTH to a value of 0, 1, 2 or + 3 pixels. The default width is 1 pixel. You can read back the current width with + SCI_GETCARETWIDTH. A width of 0 makes the caret invisible (added at version + 1.50).

+ +

SCI_SETHOTSPOTACTIVEFORE(bool useHotSpotForeColour, int colour)
+ SCI_SETHOTSPOTACTIVEBACK(bool useHotSpotBackColour, int colour)
+ SCI_SETHOTSPOTACTIVEUNDERLINE(bool underline,)
+ SCI_SETHOTSPOTSINGLELINE(bool singleLine,)
+ While the cursor hovers over text in a style with the hotspot attribute set, + the default colouring can be modified and an underline drawn with these settings. + Single line mode stops a hotspot from wrapping onto next line.

+ +

SCI_SETCONTROLCHARSYMBOL(int symbol)
+ SCI_GETCONTROLCHARSYMBOL
+ By default, Scintilla displays control characters (characters with codes less than 32) in a + rounded rectangle as ASCII mnemonics: "NUL", "SOH", "STX", "ETX", "EOT", "ENQ", "ACK", "BEL", + "BS", "HT", "LF", "VT", "FF", "CR", "SO", "SI", "DLE", "DC1", "DC2", "DC3", "DC4", "NAK", + "SYN", "ETB", "CAN", "EM", "SUB", "ESC", "FS", "GS", "RS", "US". These mnemonics come from the + early days of signaling, though some are still used (LF = Line Feed, BS = Back Space, CR = + Carriage Return, for example).

+ +

You can choose to replace these mnemonics by a nominated symbol with an ASCII code in the + range 32 to 255. If you set a symbol value less than 32, all control characters are displayed + as mnemonics. The symbol you set is rendered in the font of the style set for the character. + You can read back the current symbol with the SCI_GETCONTROLCHARSYMBOL message. + The default symbol value is 0.

+ +

SCI_SETCARETSTICKY(bool useCaretStickyBehaviour)
+ SCI_GETCARETSTICKY
+ SCI_TOGGLECARETSTICKY
+ These messages set, get or toggle the caretSticky flag which controls when the last position + of the caret on the line is saved. When set to true, the position is not saved when you type + a character, a tab, paste the clipboard content or press backspace.

+ +

Margins

+ +

There may be up to five margins to the left of the text display, plus a gap either side of + the text. Each margin can be set to display either symbols or line numbers with SCI_SETMARGINTYPEN. The markers + that can be displayed in each margin are set with SCI_SETMARGINMASKN. Any markers not associated with + a visible margin will be displayed as changes in background colour in the text. A width in + pixels can be set for each margin. Margins with a zero width are ignored completely. You can + choose if a mouse click in a margin sends a SCN_MARGINCLICK notification to the container or + selects a line of text.

+ +

The margins are numbered 0 to 4. Using a margin number outside the valid range has no + effect. By default, margin 0 is set to display line numbers, but is given a width of 0, so it + is hidden. Margin 1 is set to display non-folding symbols and is given a width of 16 pixels, so + it is visible. Margin 2 is set to display the folding symbols, but is given a width of 0, so it + is hidden. Of course, you can set the margins to be whatever you wish.

+ SCI_SETMARGINTYPEN(int margin, int + type)
+ SCI_GETMARGINTYPEN(int margin)
+ SCI_SETMARGINWIDTHN(int margin, int + pixelWidth)
+ SCI_GETMARGINWIDTHN(int margin)
+ SCI_SETMARGINMASKN(int margin, int + mask)
+ SCI_GETMARGINMASKN(int margin)
+ SCI_SETMARGINSENSITIVEN(int margin, bool + sensitive)
+ SCI_GETMARGINSENSITIVEN(int + margin)
+ SCI_SETMARGINLEFT(<unused>, int + pixels)
+ SCI_GETMARGINLEFT
+ SCI_SETMARGINRIGHT(<unused>, int + pixels)
+ SCI_GETMARGINRIGHT
+ SCI_SETFOLDMARGINCOLOUR(bool useSetting, int colour)
+ SCI_SETFOLDMARGINHICOLOUR(bool useSetting, int colour)
+
+ +

SCI_SETMARGINTYPEN(int margin, int iType)
+ SCI_GETMARGINTYPEN(int margin)
+ These two routines set and get the type of a margin. The margin argument should be 0, 1, 2, 3 or 4. + You can use the predefined constants SC_MARGIN_SYMBOL (0) and + SC_MARGIN_NUMBER (1) to set a margin as either a line number or a symbol margin. + By convention, margin 0 is used for line numbers and the next two are used for symbols. You can + also use the constants SC_MARGIN_BACK (2) and SC_MARGIN_FORE (3) for + symbol margins that set their background colour to match the STYLE_DEFAULT background and + foreground colours.

+ +

SCI_SETMARGINWIDTHN(int margin, int pixelWidth)
+ SCI_GETMARGINWIDTHN(int margin)
+ These routines set and get the width of a margin in pixels. A margin with zero width is + invisible. By default, Scintilla sets margin 1 for symbols with a width of 16 pixels, so this + is a reasonable guess if you are not sure what would be appropriate. Line number margins widths + should take into account the number of lines in the document and the line number style. You + could use something like SCI_TEXTWIDTH(STYLE_LINENUMBER, "_99999") to get a + suitable width.

+ +

SCI_SETMARGINMASKN(int margin, int mask)
+ SCI_GETMARGINMASKN(int margin)
+ The mask is a 32-bit value. Each bit corresponds to one of 32 logical symbols that can be + displayed in a margin that is enabled for symbols. There is a useful constant, + SC_MASK_FOLDERS (0xFE000000 or -33554432), that is a mask for the 7 logical + symbols used to denote folding. You can assign a wide range of symbols and colours to each of + the 32 logical symbols, see Markers for more information. If (mask + & SC_MASK_FOLDERS)==0, the margin background colour is controlled by style 33 (STYLE_LINENUMBER).

+ +

You add logical markers to a line with SCI_MARKERADD. If a line has an associated marker that + does not appear in the mask of any margin with a non-zero width, the marker changes the + background colour of the line. For example, suppose you decide to use logical marker 10 to mark + lines with a syntax error and you want to show such lines by changing the background colour. + The mask for this marker is 1 shifted left 10 times (1<<10) which is 0x400. If you make + sure that no symbol margin includes 0x400 in its mask, any line with the marker gets the + background colour changed.

+ +

To set a non-folding margin 1 use SCI_SETMARGINMASKN(1, ~SC_MASK_FOLDERS); to + set a folding margin 2 use SCI_SETMARGINMASKN(2, SC_MASK_FOLDERS). This is the + default set by Scintilla. ~SC_MASK_FOLDERS is 0x1FFFFFF in hexadecimal or 33554431 + decimal. Of course, you may need to display all 32 symbols in a margin, in which case use + SCI_SETMARGINMASKN(margin, -1).

+ +

SCI_SETMARGINSENSITIVEN(int margin, bool + sensitive)
+ SCI_GETMARGINSENSITIVEN(int margin)
+ Each of the five margins can be set sensitive or insensitive to mouse clicks. A click in a + sensitive margin sends a SCN_MARGINCLICK notification to the container. Margins that are not sensitive act as + selection margins which make it easy to select ranges of lines. By default, all margins are + insensitive.

+ +

SCI_SETMARGINLEFT(<unused>, int pixels)
+ SCI_GETMARGINLEFT
+ SCI_SETMARGINRIGHT(<unused>, int pixels)
+ SCI_GETMARGINRIGHT
+ These messages set and get the width of the blank margin on both sides of the text in pixels. + The default is to one pixel on each side.

+ +

SCI_SETFOLDMARGINCOLOUR(bool useSetting, int colour)
+ SCI_SETFOLDMARGINHICOLOUR(bool useSetting, int colour)
+ These messages allow changing the colour of the fold margin and fold margin highlight. + On Windows the fold margin colour defaults to ::GetSysColor(COLOR_3DFACE) and the fold margin highlight + colour to ::GetSysColor(COLOR_3DHIGHLIGHT).

+ +

Other settings

+ SCI_SETUSEPALETTE(bool + allowPaletteUse)
+ SCI_GETUSEPALETTE
+ SCI_SETBUFFEREDDRAW(bool isBuffered)
+ SCI_GETBUFFEREDDRAW
+ SCI_SETTWOPHASEDRAW(bool twoPhase)
+ SCI_GETTWOPHASEDRAW
+ SCI_SETCODEPAGE(int codePage)
+ SCI_GETCODEPAGE
+ SCI_SETWORDCHARS(<unused>, const char + *chars)
+ SCI_SETWHITESPACECHARS(<unused>, const char + *chars)
+ SCI_SETCHARSDEFAULT
+ SCI_GRABFOCUS
+ SCI_SETFOCUS(bool focus)
+ SCI_GETFOCUS
+
+ +

SCI_SETUSEPALETTE(bool allowPaletteUse)
+ SCI_GETUSEPALETTE
+ On 8 bit displays, which can only display a maximum of 256 colours, the graphics environment + mediates between the colour needs of applications through the use of palettes. On GTK+, + Scintilla always uses a palette.

+ +

On Windows, there are some problems with visual flashing when switching between applications + with palettes and it is also necessary for the application containing the Scintilla control to + forward some messages to Scintilla for its palette code to work. Because of this, by default, + the palette is not used and the application must tell Scintilla to use one. If Scintilla is not + using a palette, it will only display in those colours already available, which are often the + 20 Windows system colours.

+ +

To see an example of how to enable palette support in Scintilla, search the text of SciTE + for WM_PALETTECHANGED, WM_QUERYNEWPALETTE and + SCI_SETUSEPALETTE. The Windows messages to forward are:
+ WM_SYSCOLORCHANGE, WM_PALETTECHANGED, + WM_QUERYNEWPALETTE (should return TRUE).

+ +

To forward a message (WM_XXXX, WPARAM, LPARAM) to Scintilla, you can use + SendMessage(hScintilla, WM_XXXX, WPARAM, LPARAM) where hScintilla is + the handle to the Scintilla window you created as your editor.

+ +

While we are on the subject of forwarding messages in Windows, the top level window should + forward any WM_SETTINGCHANGE messages to Scintilla (this is currently used to + collect changes to mouse settings, but could be used for other user interface items in the + future).

+ +

SCI_SETBUFFEREDDRAW(bool isBuffered)
+ SCI_GETBUFFEREDDRAW
+ These messages turn buffered drawing on or off and report the buffered drawing state. Buffered + drawing draws each line into a bitmap rather than directly to the screen and then copies the + bitmap to the screen. This avoids flickering although it does take longer. The default is for + drawing to be buffered.

+ +

SCI_SETTWOPHASEDRAW(bool twoPhase)
+ SCI_GETTWOPHASEDRAW
+ Two phase drawing is a better but slower way of drawing text. + In single phase drawing each run of characters in one style is drawn along with its background. + If a character overhangs the end of a run, such as in "V_" where the + "V" is in a different style from the "_", then this can cause the right hand + side of the "V" to be overdrawn by the background of the "_" which + cuts it off. Two phase drawing + fixes this by drawing all the backgrounds first and then drawing the text in + transparent mode. Two phase drawing may flicker more than single phase + unless buffered drawing is on. The default is for drawing to be two phase.

+ +

SCI_SETCODEPAGE(int codePage)
+ SCI_GETCODEPAGE
+ Scintilla has some support for Japanese, Chinese and Korean DBCS. Use this message with + codePage set to the code page number to set Scintilla to use code page information + to ensure double byte characters are treated as one character rather than two. This also stops + the caret from moving between the two bytes in a double byte character. + Do not use this message to choose between different single byte character sets: it doesn't do that. + Call with + codePage set to zero to disable DBCS support. The default is + SCI_SETCODEPAGE(0).

+ +

Code page SC_CP_UTF8 (65001) sets Scintilla into Unicode mode with the document + treated as a sequence of characters expressed in UTF-8. The text is converted to the platform's + normal Unicode encoding before being drawn by the OS and thus can display Hebrew, Arabic, + Cyrillic, and Han characters. Languages which can use two characters stacked vertically in one + horizontal space, such as Thai, will mostly work but there are some issues where the characters + are drawn separately leading to visual glitches. Bi-directional text is not supported. Characters outside the + Basic Multilingual Plane are unlikely to work.

+ +

On Windows, code page can be set to 932 (Japanese Shift-JIS), 936 (Simplified Chinese GBK), + 949 (Korean Unified Hangul Code), 950 (Traditional Chinese Big5), or 1361 (Korean Johab) + although these may require installation of language specific support.

+ +

On GTK+, code page SC_CP_DBCS (1) sets Scintilla into + multi byte character mode as is required for Japanese language processing with + the EUC encoding.

+ +

For GTK+ 1.x, the locale should be set to a Unicode locale with a call similar to + setlocale(LC_CTYPE, "en_US.UTF-8"). Fonts with an "iso10646" registry + should be used in a font set. Font sets are a comma separated list of partial font + specifications where each partial font specification can be in the form: + foundry-fontface-charsetregistry-encoding or + fontface-charsetregistry-encoding or foundry-fontface or + fontface. An example is "misc-fixed-iso10646-1,*". + On GTK+ 2.x, Pango fonts should be used rather than font sets.

+ +

Setting codePage to a non-zero value that is not SC_CP_UTF8 is + operating system dependent.

+ +

SCI_SETWORDCHARS(<unused>, const char *chars)
+ Scintilla has several functions that operate on words, which are defined to be contiguous + sequences of characters from a particular set of characters. This message defines which + characters are members of that set. The character sets are set to default values before processing this + function. + For example, if you don't allow '_' in your set of characters + use:
+ SCI_SETWORDCHARS(0, "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789");

+ +

SCI_SETWHITESPACECHARS(<unused>, const char *chars)
+ Similar to SCI_SETWORDCHARS, this message allows the user to define which chars Scintilla considers + as whitespace. Setting the whitespace chars allows the user to fine-tune Scintilla's behaviour doing + such things as moving the cursor to the start or end of a word; for example, by defining punctuation chars + as whitespace, they will be skipped over when the user presses ctrl+left or ctrl+right. + This function should be called after SCI_SETWORDCHARS as it will + reset the whitespace characters to the default set.

+

SCI_SETCHARSDEFAULT
+ Use the default sets of word and whitespace characters. This sets whitespace to space, tab and other + characters with codes less than 0x20, with word characters set to alphanumeric and '_'. +

+ + +

SCI_GRABFOCUS
+ SCI_SETFOCUS(bool focus)
+ SCI_GETFOCUS
+ Scintilla can be told to grab the focus with this message. This is needed more on GTK+ where + focus handling is more complicated than on Windows.

+ +

The internal focus flag can be set with SCI_SETFOCUS. This is used by clients + that have complex focus requirements such as having their own window that gets the real focus + but with the need to indicate that Scintilla has the logical focus.

+ +

Brace highlighting

+ SCI_BRACEHIGHLIGHT(int pos1, int + pos2)
+ SCI_BRACEBADLIGHT(int pos1)
+ SCI_BRACEMATCH(int position, int + maxReStyle)
+
+ +

SCI_BRACEHIGHLIGHT(int pos1, int pos2)
+ Up to two characters can be highlighted in a 'brace highlighting style', which is defined as + style number STYLE_BRACELIGHT (34). + If you have enabled indent guides, you may also wish to highlight the indent that corresponds + with the brace. You can locate the column with SCI_GETCOLUMN and highlight the indent with SCI_SETHIGHLIGHTGUIDE.

+ +

SCI_BRACEBADLIGHT(int pos1)
+ If there is no matching brace then the brace + badlighting style, style BRACE_BADLIGHT (35), can be used to show the brace + that is unmatched. Using a position of INVALID_POSITION (-1) removes the + highlight.

+ +

SCI_BRACEMATCH(int pos, int maxReStyle)
+ The SCI_BRACEMATCH message finds a corresponding matching brace given + pos, the position of one brace. The brace characters handled are '(', ')', '[', + ']', '{', '}', '<', and '>'. The search is forwards from an opening brace and backwards + from a closing brace. If the character at position is not a brace character, or a matching + brace cannot be found, the return value is -1. Otherwise, the return value is the position of + the matching brace.

+ +

A match only occurs if the style of the matching brace is the same as the starting brace or + the matching brace is beyond the end of styling. Nested braces are handled correctly. The + maxReStyle parameter must currently be 0 - it may be used in the future to limit + the length of brace searches.

+ +

Tabs and Indentation Guides

+ +

Indentation (the white space at the start of a line) is often used by programmers to clarify + program structure and in some languages, for example Python, it may be part of the language + syntax. Tabs are normally used in editors to insert a tab character or to pad text with spaces + up to the next tab.

+ +

Scintilla can be set to treat tab and backspace in the white space at the start of a line in + a special way: inserting a tab indents the line to the next indent position rather than just + inserting a tab at the current character position and backspace unindents the line rather than + deleting a character. Scintilla can also display indentation guides (vertical lines) to help + you to generate code.

+ SCI_SETTABWIDTH(int widthInChars)
+ SCI_GETTABWIDTH
+ SCI_SETUSETABS(bool useTabs)
+ SCI_GETUSETABS
+ SCI_SETINDENT(int widthInChars)
+ SCI_GETINDENT
+ SCI_SETTABINDENTS(bool tabIndents)
+ SCI_GETTABINDENTS
+ SCI_SETBACKSPACEUNINDENTS(bool + bsUnIndents)
+ SCI_GETBACKSPACEUNINDENTS
+ SCI_SETLINEINDENTATION(int line, int + indentation)
+ SCI_GETLINEINDENTATION(int line)
+ SCI_GETLINEINDENTPOSITION(int + line)
+ SCI_SETINDENTATIONGUIDES(bool + view)
+ SCI_GETINDENTATIONGUIDES
+ SCI_SETHIGHLIGHTGUIDE(int column)
+ SCI_GETHIGHLIGHTGUIDE
+
+ +

SCI_SETTABWIDTH(int widthInChars)
+ SCI_GETTABWIDTH
+ SCI_SETTABWIDTH sets the size of a tab as a multiple of the size of a space + character in STYLE_DEFAULT. The default tab width is 8 characters. There are no + limits on tab sizes, but values less than 1 or large values may have undesirable effects.

+ +

SCI_SETUSETABS(bool useTabs)
+ SCI_GETUSETABS
+ SCI_SETUSETABS determines whether indentation should be created out of a mixture + of tabs and spaces or be based purely on spaces. Set useTabs to false + (0) to create all tabs and indents out of spaces. The default is true. You can use + SCI_GETCOLUMN to get the column of a + position taking the width of a tab into account.

+ SCI_SETINDENT(int widthInChars)
+ SCI_GETINDENT
+ SCI_SETINDENT sets the size of indentation in terms of the width of a space in STYLE_DEFAULT. If you set a width of + 0, the indent size is the same as the tab size. There are no limits on indent sizes, but values + less than 0 or large values may have undesirable effects.
+
+ + +

SCI_SETTABINDENTS(bool tabIndents)
+ SCI_GETTABINDENTS
+ SCI_SETBACKSPACEUNINDENTS(bool bsUnIndents)
+ SCI_GETBACKSPACEUNINDENTS
+

+ +

Inside indentation white space, the tab and backspace keys can be made to indent and + unindent rather than insert a tab character or delete a character with the + SCI_SETTABINDENTS and SCI_SETBACKSPACEUNINDENTS functions.

+ +

SCI_SETLINEINDENTATION(int line, int indentation)
+ SCI_GETLINEINDENTATION(int line)
+ The amount of indentation on a line can be discovered and set with + SCI_GETLINEINDENTATION and SCI_SETLINEINDENTATION. The indentation is + measured in character columns, which correspond to the width of space characters.

+ +

SCI_GETLINEINDENTPOSITION(int line)
+ This returns the position at the end of indentation of a line.

+ +

SCI_SETINDENTATIONGUIDES(bool view)
+ SCI_GETINDENTATIONGUIDES
+ Indentation guides are dotted vertical lines that appear within indentation white space every + indent size columns. They make it easy to see which constructs line up especially when they + extend over multiple pages. Style STYLE_INDENTGUIDE (37) is used to specify the + foreground and background colour of the indentation guides.

+ +

SCI_SETHIGHLIGHTGUIDE(int column)
+ SCI_GETHIGHLIGHTGUIDE
+ When brace highlighting occurs, the indentation guide corresponding to the braces may be + highlighted with the brace highlighting style, STYLE_BRACELIGHT (34). Set column to 0 to + cancel this highlight.

+ +

Markers

+ +

There are 32 markers, numbered 0 to 31, and you can assign any combination of them to each + line in the document. Markers appear in the selection + margin to the left of the text. If the selection margin is set to zero width, the + background colour of the whole line is changed instead. Marker numbers 25 to 31 are used by + Scintilla in folding margins, and have symbolic names of the form SC_MARKNUM_*, + for example SC_MARKNUM_FOLDEROPEN.

+ +

Marker numbers 0 to 24 have no pre-defined function; you can use them to mark syntax errors + or the current point of execution, break points, or whatever you need marking. If you do not + need folding, you can use all 32 for any purpose you wish.

+ +

Each marker number has a symbol associated with it. You can also set the foreground and + background colour for each marker number, so you can use the same symbol more than once with + different colouring for different uses. Scintilla has a set of symbols you can assign + (SC_MARK_*) or you can use characters. By default, all 32 markers are set to + SC_MARK_CIRCLE with a black foreground and a white background.

+ +

The markers are drawn in the order of their numbers, so higher numbered markers appear on + top of lower numbered ones. Markers try to move with their text by tracking where the start of + their line moves. When a line is deleted, its markers are combined, by an OR + operation, with the markers of the previous line.

+ SCI_MARKERDEFINE(int markerNumber, int + markerSymbols)
+ SCI_MARKERDEFINEPIXMAP(int markerNumber, + const char *xpm)
+ SCI_MARKERSETFORE(int markerNumber, int + colour)
+ SCI_MARKERSETBACK(int markerNumber, int + colour)
+ SCI_MARKERSETALPHA(int markerNumber, int + alpha)
+ SCI_MARKERADD(int line, int markerNumber)
+ SCI_MARKERADDSET(int line, int markerMask)
+ SCI_MARKERDELETE(int line, int + markerNumber)
+ SCI_MARKERDELETEALL(int markerNumber)
+ SCI_MARKERGET(int line)
+ SCI_MARKERNEXT(int lineStart, int + markerMask)
+ SCI_MARKERPREVIOUS(int lineStart, int + markerMask)
+ SCI_MARKERLINEFROMHANDLE(int + handle)
+ SCI_MARKERDELETEHANDLE(int handle)
+
+ +

SCI_MARKERDEFINE(int markerNumber, int markerSymbols)
+ This message associates a marker number in the range 0 to 31 with one of the marker symbols or + an ASCII character. The general-purpose marker symbols currently available are:
+ SC_MARK_CIRCLE, SC_MARK_ROUNDRECT, SC_MARK_ARROW, + SC_MARK_SMALLRECT, SC_MARK_SHORTARROW, SC_MARK_EMPTY, + SC_MARK_ARROWDOWN, SC_MARK_MINUS, SC_MARK_PLUS, + SC_MARK_ARROWS, SC_MARK_DOTDOTDOT, SC_MARK_EMPTY, + SC_MARK_BACKGROUND and SC_MARK_FULLRECT.

+ +

The SC_MARK_BACKGROUND marker changes the background colour of the line only. + The SC_MARK_FULLRECT symbol mirrors this, changing only the margin background colour. + The SC_MARK_EMPTY symbol is invisible, allowing client code to track the movement + of lines. You would also use it if you changed the folding style and wanted one or more of the + SC_FOLDERNUM_* markers to have no associated symbol.

+ +

There are also marker symbols designed for use in the folding margin in a flattened tree + style.
+ SC_MARK_BOXMINUS, SC_MARK_BOXMINUSCONNECTED, + SC_MARK_BOXPLUS, SC_MARK_BOXPLUSCONNECTED, + SC_MARK_CIRCLEMINUS, SC_MARK_CIRCLEMINUSCONNECTED, + SC_MARK_CIRCLEPLUS, SC_MARK_CIRCLEPLUSCONNECTED, + SC_MARK_LCORNER, SC_MARK_LCORNERCURVE, SC_MARK_TCORNER, + SC_MARK_TCORNERCURVE, and SC_MARK_VLINE.

+ Characters can be used as markers by adding the ASCII value of the character to + SC_MARK_CHARACTER (10000). For example, to use 'A' (ASCII code 65) as marker + number 1 use:
+ SCI_MARKERDEFINE(1, SC_MARK_CHARACTER+65).
+ +

The marker numbers SC_MARKNUM_FOLDER and SC_MARKNUM_FOLDEROPEN are + used for showing that a fold is present and open or closed. Any symbols may be assigned for + this purpose although the (SC_MARK_PLUS, SC_MARK_MINUS) pair or the + (SC_MARK_ARROW, SC_MARK_ARROWDOWN) pair are good choices. As well as + these two, more assignments are needed for the flattened tree style: + SC_MARKNUM_FOLDEREND, SC_MARKNUM_FOLDERMIDTAIL, + SC_MARKNUM_FOLDEROPENMID, SC_MARKNUM_FOLDERSUB, and + SC_MARKNUM_FOLDERTAIL. The bits used for folding are specified by + SC_MASK_FOLDERS, which is commonly used as an argument to + SCI_SETMARGINMASKN when defining a margin to be used for folding.

+ +

This table shows which SC_MARK_* symbols should be assigned to which + SC_MARKNUM_* marker numbers to obtain four folding styles: Arrow (mimics + Macintosh), plus/minus shows folded lines as '+' and opened folds as '-', Circle tree, Box + tree.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SC_MARKNUM_*ArrowPlus/minusCircle treeBox tree
FOLDEROPENARROWDOWNMINUSCIRCLEMINUSBOXMINUS
FOLDERARROWPLUSCIRCLEPLUSBOXPLUS
FOLDERSUBEMPTYEMPTYVLINEVLINE
FOLDERTAILEMPTYEMPTYLCORNERCURVELCORNER
FOLDERENDEMPTYEMPTYCIRCLEPLUSCONNECTEDBOXPLUSCONNECTED
FOLDEROPENMIDEMPTYEMPTYCIRCLEMINUSCONNECTEDBOXMINUSCONNECTED
FOLDERMIDTAILEMPTYEMPTYTCORNERCURVETCORNER
+ +

SCI_MARKERDEFINEPIXMAP(int markerNumber, const char + *xpm)
+ Markers can be set to pixmaps with this message. The XPM format is used for the pixmap and it + is limited to pixmaps that use one character per pixel. The data should be null terminated. + Pixmaps use the SC_MARK_PIXMAP marker symbol. You can find the full description of + the XPM format here.

+ +

SCI_MARKERSETFORE(int markerNumber, int colour)
+ SCI_MARKERSETBACK(int markerNumber, int colour)
+ These two messages set the foreground and background colour of a marker number.

+

SCI_MARKERSETALPHA(int markerNumber, int alpha)
+ When markers are drawn in the content area, either because there is no margin for them or + they are of SC_MARK_BACKGROUND type, they may be drawn translucently by + setting an alpha value.

+ +

SCI_MARKERADD(int line, int markerNumber)
+ This message adds marker number markerNumber to a line. The message returns -1 if + this fails (illegal line number, out of memory) or it returns a marker handle number that + identifies the added marker. You can use this returned handle with SCI_MARKERLINEFROMHANDLE to find where a + marker is after moving or combining lines and with SCI_MARKERDELETEHANDLE to delete the marker + based on its handle. The message does not check the value of markerNumber, nor does it + check if the line already contains the marker.

+ +

SCI_MARKERADDSET(int line, int markerMask)
+ This message can add one or more markers to a line with a single call, specified in the same "one-bit-per-marker" 32-bit integer format returned by + SCI_MARKERGET + (and used by the mask-based marker search functions + SCI_MARKERNEXT and + SCI_MARKERPREVIOUS). + As with + SCI_MARKERADD, no check is made + to see if any of the markers are already present on the targeted line.

+ +

SCI_MARKERDELETE(int line, int markerNumber)
+ This searches the given line number for the given marker number and deletes it if it is + present. If you added the same marker more than once to the line, this will delete one copy + each time it is used. If you pass in a marker number of -1, all markers are deleted from the + line.

+ +

SCI_MARKERDELETEALL(int markerNumber)
+ This removes markers of the given number from all lines. If markerNumber is -1, it deletes all + markers from all lines.

+ +

SCI_MARKERGET(int line)
+ This returns a 32-bit integer that indicates which markers were present on the line. Bit 0 is + set if marker 0 is present, bit 1 for marker 1 and so on.

+ +

SCI_MARKERNEXT(int lineStart, int markerMask)
+ SCI_MARKERPREVIOUS(int lineStart, int markerMask)
+ These messages search efficiently for lines that include a given set of markers. The search + starts at line number lineStart and continues forwards to the end of the file + (SCI_MARKERNEXT) or backwards to the start of the file + (SCI_MARKERPREVIOUS). The markerMask argument should have one bit set + for each marker you wish to find. Set bit 0 to find marker 0, bit 1 for marker 1 and so on. The + message returns the line number of the first line that contains one of the markers in + markerMask or -1 if no marker is found.

+ +

SCI_MARKERLINEFROMHANDLE(int markerHandle)
+ The markerHandle argument is an identifier for a marker returned by SCI_MARKERADD. This function searches + the document for the marker with this handle and returns the line number that contains it or -1 + if it is not found.

+ +

SCI_MARKERDELETEHANDLE(int markerHandle)
+ The markerHandle argument is an identifier for a marker returned by SCI_MARKERADD. This function searches + the document for the marker with this handle and deletes the marker if it is found.

+ +

Indicators

+ +

By default, Scintilla organizes the style byte associated with each text byte as 5 bits of + style information (for 32 styles) and 3 bits of indicator information for 3 independent + indicators so that, for example, syntax errors, deprecated names and bad indentation could all + be displayed at once. Indicators may be displayed as simple underlines, squiggly underlines, a + line of small 'T' shapes, a line of diagonal hatching, a strike-out or a rectangle around the text.

+ +

The indicators are set using SCI_STARTSTYLING with a INDICS_MASK mask + and SCI_SETSTYLING with the values + INDIC0_MASK, INDIC1_MASK and INDIC2_MASK.

+ +

If you are using indicators in a buffer that has a lexer active + (see SCI_SETLEXER), + you must save lexing state information before setting any indicators and restore it afterwards. + Use SCI_GETENDSTYLED + to retrieve the current "styled to" position and + SCI_STARTSTYLING + to reset the styling position and mask (0x1f in the default layout of 5 style bits and 3 indicator bits) + when you are done.

+ +

The number of bits used for styles can be altered with SCI_SETSTYLEBITS from 0 to 7 bits. The remaining bits + can be used for indicators, so there can be from 1 to 8 indicators. However, the + INDIC*_MASK constants defined in Scintilla.h all assume 5 bits of + styling information and 3 indicators. If you use a different arrangement, you must define your + own constants.

+ +

The SCI_INDIC* messages allow you to get and set the visual appearance of the + indicators. They all use an indicatorNumber argument in the range 0 to 7 to set + the indicator to style. With the default settings, only indicators 0, 1 and 2 will have any + visible effect.

+ SCI_INDICSETSTYLE(int indicatorNumber, int + indicatorStyle)
+ SCI_INDICGETSTYLE(int indicatorNumber)
+ SCI_INDICSETFORE(int indicatorNumber, int + colour)
+ SCI_INDICGETFORE(int indicatorNumber)
+
+ +

SCI_INDICSETSTYLE(int indicatorNumber, int + indicatorStyle)
+ SCI_INDICGETSTYLE(int indicatorNumber)
+ These two messages set and get the style for a particular indicator. The indicator styles + currently available are:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SymbolValueVisual effect
INDIC_PLAIN0Underlined with a single, straight line.
INDIC_SQUIGGLE1A squiggly underline.
INDIC_TT2A line of small T shapes.
INDIC_DIAGONAL3Diagonal hatching.
INDIC_STRIKE4Strike out.
INDIC_HIDDEN5An indicator with no visual effect.
INDIC_BOX6A rectangle around the text.
INDIC_ROUNDBOX7A rectangle with rounded corners around the text using translucent drawing with the + interior more transparent than the border.
+ +

The default indicator styles are equivalent to:
+ SCI_INDICSETSTYLE(0, INDIC_SQUIGGLE);
+ SCI_INDICSETSTYLE(1, INDIC_TT);
+ SCI_INDICSETSTYLE(2, INDIC_PLAIN);

+ +

SCI_INDICSETFORE(int indicatorNumber, int colour)
+ SCI_INDICGETFORE(int indicatorNumber)
+ These two messages set and get the colour used to draw an indicator. The default indicator + colours are equivalent to:
+ SCI_INDICSETFORE(0, 0x007f00); (dark green)
+ SCI_INDICSETFORE(1, 0xff0000); (light blue)
+ SCI_INDICSETFORE(2, 0x0000ff); (light red)

+ +

Autocompletion

+ +

Autocompletion displays a list box showing likely identifiers based upon the user's typing. + The user chooses the currently selected item by pressing the tab character or another character + that is a member of the fillup character set defined with SCI_AUTOCSETFILLUPS. + Autocompletion is triggered by your application. For example, in C if you detect that the user + has just typed fred. you could look up fred, and if it has a known + list of members, you could offer them in an autocompletion list. Alternatively, you could + monitor the user's typing and offer a list of likely items once their typing has narrowed down + the choice to a reasonable list. As yet another alternative, you could define a key code to + activate the list.

+ +

When the user makes a selection from the list the container is sent a SCN_AUTOCSELECTION notification message. On return from the notification Scintilla will insert + the selected text unless the autocompletion list has been cancelled, for example by the container sending + SCI_AUTOCCANCEL.

+ +

To make use of autocompletion you must monitor each character added to the document. See + SciTEBase::CharAdded() in SciTEBase.cxx for an example of autocompletion.

+ SCI_AUTOCSHOW(int lenEntered, const char + *list)
+ SCI_AUTOCCANCEL
+ SCI_AUTOCACTIVE
+ SCI_AUTOCPOSSTART
+ SCI_AUTOCCOMPLETE
+ SCI_AUTOCSTOPS(<unused>, const char + *chars)
+ SCI_AUTOCSETSEPARATOR(char + separator)
+ SCI_AUTOCGETSEPARATOR
+ SCI_AUTOCSELECT(<unused>, const char + *select)
+ SCI_AUTOCGETCURRENT
+ SCI_AUTOCSETCANCELATSTART(bool + cancel)
+ SCI_AUTOCGETCANCELATSTART
+ SCI_AUTOCSETFILLUPS(<unused>, const char + *chars)
+ SCI_AUTOCSETCHOOSESINGLE(bool + chooseSingle)
+ SCI_AUTOCGETCHOOSESINGLE
+ SCI_AUTOCSETIGNORECASE(bool + ignoreCase)
+ SCI_AUTOCGETIGNORECASE
+ SCI_AUTOCSETAUTOHIDE(bool autoHide)
+ SCI_AUTOCGETAUTOHIDE
+ SCI_AUTOCSETDROPRESTOFWORD(bool + dropRestOfWord)
+ SCI_AUTOCGETDROPRESTOFWORD
+ SCI_REGISTERIMAGE
+ SCI_CLEARREGISTEREDIMAGES
+ SCI_AUTOCSETTYPESEPARATOR(char separatorCharacter)
+ SCI_AUTOCGETTYPESEPARATOR
+ SCI_AUTOCSETMAXHEIGHT(int rowCount)
+ SCI_AUTOCGETMAXHEIGHT
+ SCI_AUTOCSETMAXWIDTH(int characterCount)
+ SCI_AUTOCGETMAXWIDTH
+
+ +

SCI_AUTOCSHOW(int lenEntered, const char *list)
+ This message causes a list to be displayed. lenEntered is the number of + characters of the word already entered and list is the list of words separated by + separator characters. The initial separator character is a space but this can be set or got + with SCI_AUTOCSETSEPARATOR + and SCI_AUTOCGETSEPARATOR.

+ +

The list of words should be in sorted order. If set to ignore case mode with SCI_AUTOCSETIGNORECASE, then + strings are matched after being converted to upper case. One result of this is that the list + should be sorted with the punctuation characters '[', '\', ']', '^', '_', and '`' sorted after + letters.

+ +

SCI_AUTOCCANCEL
+ This message cancels any displayed autocompletion list. When in autocompletion mode, the list + should disappear when the user types a character that can not be part of the autocompletion, + such as '.', '(' or '[' when typing an identifier. A set of characters that will cancel + autocompletion can be specified with SCI_AUTOCSTOPS.

+ +

SCI_AUTOCACTIVE
+ This message returns non-zero if there is an active autocompletion list and zero if there is + not.

+ +

SCI_AUTOCPOSSTART
+ This returns the value of the current position when SCI_AUTOCSHOW started display + of the list.

+ +

SCI_AUTOCCOMPLETE
+ This message triggers autocompletion. This has the same effect as the tab key.

+ +

SCI_AUTOCSTOPS(<unused>, const char *chars)
+ The chars argument is a string containing a list of characters that will + automatically cancel the autocompletion list. When you start the editor, this list is + empty.

+ +

SCI_AUTOCSETSEPARATOR(char separator)
+ SCI_AUTOCGETSEPARATOR
+ These two messages set and get the separator character used to separate words in the + SCI_AUTOCSHOW list. The default is the space character.

+ +

SCI_AUTOCSELECT(<unused>, const char *select)
+ SCI_AUTOCGETCURRENT
+ This message selects an item in the autocompletion list. It searches the list of words for the + first that matches select. By default, comparisons are case sensitive, but you can + change this with SCI_AUTOCSETIGNORECASE. The match is character + by character for the length of the select string. That is, if select is "Fred" it + will match "Frederick" if this is the first item in the list that begins with "Fred". If an + item is found, it is selected. If the item is not found, the autocompletion list closes if + auto-hide is true (see SCI_AUTOCSETAUTOHIDE).
+ The current selection can be retrieved with SCI_AUTOCGETCURRENT +

+ +

SCI_AUTOCSETCANCELATSTART(bool cancel)
+ SCI_AUTOCGETCANCELATSTART
+ The default behavior is for the list to be cancelled if the caret moves before the location it + was at when the list was displayed. By calling this message with a false argument, + the list is not cancelled until the caret moves before the first character of the word being + completed.

+ +

SCI_AUTOCSETFILLUPS(<unused>, const char *chars)
+ If a fillup character is typed with an autocompletion list active, the currently selected item + in the list is added into the document, then the fillup character is added. Common fillup + characters are '(', '[' and '.' but others are possible depending on the language. By default, + no fillup characters are set.

+ +

SCI_AUTOCSETCHOOSESINGLE(bool chooseSingle)
+ SCI_AUTOCGETCHOOSESINGLE
+ If you use SCI_AUTOCSETCHOOSESINGLE(1) and a list has only one item, it is + automatically added and no list is displayed. The default is to display the list even if there + is only a single item.

+ +

SCI_AUTOCSETIGNORECASE(bool ignoreCase)
+ SCI_AUTOCGETIGNORECASE
+ By default, matching of characters to list members is case sensitive. These messages let you + set and get case sensitivity.

+ +

SCI_AUTOCSETAUTOHIDE(bool autoHide)
+ SCI_AUTOCGETAUTOHIDE
+ By default, the list is cancelled if there are no viable matches (the user has typed + characters that no longer match a list entry). If you want to keep displaying the original + list, set autoHide to false. This also effects SCI_AUTOCSELECT.

+ +

SCI_AUTOCSETDROPRESTOFWORD(bool dropRestOfWord)
+ SCI_AUTOCGETDROPRESTOFWORD
+ When an item is selected, any word characters following the caret are first erased if + dropRestOfWord is set true. The default is false.

+ +

+ SCI_REGISTERIMAGE(int type, const char *xpmData)
+ SCI_CLEARREGISTEREDIMAGES
+ SCI_AUTOCSETTYPESEPARATOR(char separatorCharacter)
+ SCI_AUTOCGETTYPESEPARATOR
+ + Autocompletion list items may display an image as well as text. Each image is first registered with an integer + type. Then this integer is included in the text of the list separated by a '?' from the text. For example, + "fclose?2 fopen" displays image 2 before the string "fclose" and no image before "fopen". + The images are in XPM format as is described for + SCI_MARKERDEFINEPIXMAP + The set of registered images can be cleared with SCI_CLEARREGISTEREDIMAGES and the '?' separator changed + with SCI_AUTOCSETTYPESEPARATOR. +

+ +

+ SCI_AUTOCSETMAXHEIGHT(int rowCount)
+ SCI_AUTOCGETMAXHEIGHT
+ + Get or set the maximum number of rows that will be visible in an autocompletion list. If there are more rows in the list, then a vertical + scrollbar is shown. The default is 5. +

+ +

+ SCI_AUTOCSETMAXWIDTH(int characterCount)
+ SCI_AUTOCGETMAXWIDTH
+ + Get or set the maximum width of an autocompletion list expressed as the number of characters in the longest item that will be totally visible. + If zero (the default) then the list's width is calculated to fit the item with the most characters. Any items that cannot be fully displayed within + the available width are indicated by the presence of ellipsis. +

+ +

User lists

+ +

User lists use the same internal mechanisms as autocompletion lists, and all the calls + listed for autocompletion work on them; you cannot display a user list at the same time as an + autocompletion list is active. They differ in the following respects:

+ +

o The SCI_AUTOCSETCHOOSESINGLE message has no + effect.
+ o When the user makes a selection you are sent a SCN_USERLISTSELECTION notification message rather than SCN_AUTOCSELECTION.

+ +

BEWARE: if you have set fillup characters or stop characters, these will still be active + with the user list, and may result in items being selected or the user list cancelled due to + the user typing into the editor.

+ +

SCI_USERLISTSHOW(int listType, const char *list)
+ The listType parameter is returned to the container as the wParam + field of the SCNotification + structure. It must be greater than 0 as this is how Scintilla tells the difference between an + autocompletion list and a user list. If you have different types of list, for example a list of + buffers and a list of macros, you can use listType to tell which one has returned + a selection.

+ +

Call tips

+ +

Call tips are small windows displaying the arguments to a function and are displayed after + the user has typed the name of the function. They normally display characters using the font + facename, size and character set defined by + STYLE_DEFAULT. You can choose to + use STYLE_CALLTIP to define the + facename, size, foreground and background colours and character set with + SCI_CALLTIPUSESTYLE. + This also enables support for Tab characters. + + There is some interaction between call tips and autocompletion lists in that showing a + call tip cancels any active autocompletion list, and vice versa.

+ +

Call tips can highlight part of the text within them. You could use this to highlight the + current argument to a function by counting the number of commas (or whatever separator your + language uses). See SciTEBase::CharAdded() in SciTEBase.cxx for an + example of call tip use.

+ +

The mouse may be clicked on call tips and this causes a + SCN_CALLTIPCLICK + notification to be sent to the container. Small up an down arrows may be displayed within + a call tip by, respectively, including the characters '\001', or '\002'. This is useful + for showing that there are overloaded variants of one function name and that the user can + click on the arrows to cycle through the overloads.

+ +

Alternatively, call tips can be displayed when you leave the mouse pointer for a while over + a word in response to the SCN_DWELLSTART notification and cancelled in response to SCN_DWELLEND. This method could be used in a debugger to give + the value of a variable, or during editing to give information about the word under the + pointer.

+ SCI_CALLTIPSHOW(int posStart, const char + *definition)
+ SCI_CALLTIPCANCEL
+ SCI_CALLTIPACTIVE
+ SCI_CALLTIPPOSSTART
+ SCI_CALLTIPSETHLT(int highlightStart, int + highlightEnd)
+ SCI_CALLTIPSETBACK(int colour)
+ SCI_CALLTIPSETFORE(int colour)
+ SCI_CALLTIPSETFOREHLT(int colour)
+ SCI_CALLTIPUSESTYLE(int tabsize)
+
+ +

SCI_CALLTIPSHOW(int posStart, const char *definition)
+ This message starts the process by displaying the call tip window. If a call tip is already + active, this has no effect.
+ posStart is the position in the document at which to align the call tip. The call + tip text is aligned to start 1 line below this character unless you have included up and/or + down arrows in the call tip text in which case the tip is aligned to the right-hand edge of + the rightmost arrow. The assumption is that you will start the text with something like + "\001 1 of 3 \002".
+ definition is the call tip text. This can contain multiple lines separated by + '\n' (Line Feed, ASCII code 10) characters. Do not include '\r' (Carriage Return, ASCII + code 13), as this will most likely print as an empty box. '\t' (Tab, ASCII code 9) is + supported if you set a tabsize with + SCI_CALLTIPUSESTYLE.

+ +

SCI_CALLTIPCANCEL
+ This message cancels any displayed call tip. Scintilla will also cancel call tips for you if + you use any keyboard commands that are not compatible with editing the argument list of a + function.

+ +

SCI_CALLTIPACTIVE
+ This returns 1 if a call tip is active and 0 if it is not active.

+ +

SCI_CALLTIPPOSSTART
+ This message returns the value of the current position when SCI_CALLTIPSHOW + started to display the tip.

+ +

SCI_CALLTIPSETHLT(int hlStart, int hlEnd)
+ This sets the region of the call tips text to display in a highlighted style. + hlStart is the zero-based index into the string of the first character to + highlight and hlEnd is the index of the first character after the highlight. + hlEnd must be greater than hlStart; hlEnd-hlStart is the + number of characters to highlight. Highlights can extend over line ends if this is + required.

+ +

Unhighlighted text is drawn in a mid gray. Selected text is drawn in a dark blue. The + background is white. These can be changed with + SCI_CALLTIPSETBACK, + SCI_CALLTIPSETFORE, and + SCI_CALLTIPSETFOREHLT. +

+ +

SCI_CALLTIPSETBACK(int colour)
+ The background colour of call tips can be set with this message; the default colour is white. + It is not a good idea to set a dark colour as the background as the default colour for normal + calltip text is mid gray and the defaultcolour for highlighted text is dark blue. This also + sets the background colour of STYLE_CALLTIP.

+ +

SCI_CALLTIPSETFORE(int colour)
+ The colour of call tip text can be set with this message; the default colour is mid gray. + This also sets the foreground colour of STYLE_CALLTIP.

+ +

SCI_CALLTIPSETFOREHLT(int colour)
+ The colour of highlighted call tip text can be set with this message; the default colour + is dark blue.

+ +

SCI_CALLTIPUSESTYLE(int tabsize)
+ This message changes the style used for call tips from STYLE_DEFAULT to + STYLE_CALLTIP and sets a tab size in screen pixels. If tabsize is + less than 1, Tab characters are not treated specially. Once this call has been used, the + call tip foreground and background colours are also taken from the style.

+ + +

Keyboard commands

+ +

To allow the container application to perform any of the actions available to the user with + keyboard, all the keyboard actions are messages. They do not take any parameters. These + commands are also used when redefining the key bindings with the SCI_ASSIGNCMDKEY message.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SCI_LINEDOWNSCI_LINEDOWNEXTENDSCI_LINEDOWNRECTEXTENDSCI_LINESCROLLDOWN
SCI_LINEUPSCI_LINEUPEXTENDSCI_LINEUPRECTEXTENDSCI_LINESCROLLUP
SCI_PARADOWNSCI_PARADOWNEXTENDSCI_PARAUPSCI_PARAUPEXTEND
SCI_CHARLEFTSCI_CHARLEFTEXTENDSCI_CHARLEFTRECTEXTEND
SCI_CHARRIGHTSCI_CHARRIGHTEXTENDSCI_CHARRIGHTRECTEXTEND
SCI_WORDLEFTSCI_WORDLEFTEXTENDSCI_WORDRIGHTSCI_WORDRIGHTEXTEND
SCI_WORDLEFTENDSCI_WORDLEFTENDEXTENDSCI_WORDRIGHTENDSCI_WORDRIGHTENDEXTEND
SCI_WORDPARTLEFTSCI_WORDPARTLEFTEXTENDSCI_WORDPARTRIGHTSCI_WORDPARTRIGHTEXTEND
SCI_HOMESCI_HOMEEXTEND[SCI_HOMERECTEXTEND]
SCI_HOMEDISPLAYSCI_HOMEDISPLAYEXTENDSCI_HOMEWRAPSCI_HOMEWRAPEXTEND
SCI_VCHOMESCI_VCHOMEEXTENDSCI_VCHOMERECTEXTEND
SCI_VCHOMEWRAPSCI_VCHOMEWRAPEXTEND
SCI_LINEENDSCI_LINEENDEXTENDSCI_LINEENDRECTEXTEND
SCI_LINEENDDISPLAYSCI_LINEENDDISPLAYEXTENDSCI_LINEENDWRAPSCI_LINEENDWRAPEXTEND
SCI_DOCUMENTSTARTSCI_DOCUMENTSTARTEXTENDSCI_DOCUMENTENDSCI_DOCUMENTENDEXTEND
SCI_PAGEUPSCI_PAGEUPEXTENDSCI_PAGEUPRECTEXTEND
SCI_PAGEDOWNSCI_PAGEDOWNEXTENDSCI_PAGEDOWNRECTEXTEND
SCI_STUTTEREDPAGEUPSCI_STUTTEREDPAGEUPEXTEND
SCI_STUTTEREDPAGEDOWNSCI_STUTTEREDPAGEDOWNEXTEND
SCI_DELETEBACKSCI_DELETEBACKNOTLINESCI_DELWORDLEFTSCI_DELWORDRIGHT
SCI_DELLINELEFTSCI_DELLINERIGHTSCI_LINEDELETE
SCI_LINECUTSCI_LINECOPYSCI_LINETRANSPOSESCI_LINEDUPLICATE
SCI_LOWERCASESCI_UPPERCASESCI_CANCELSCI_EDITTOGGLEOVERTYPE
SCI_NEWLINESCI_FORMFEEDSCI_TABSCI_BACKTAB
SCI_SELECTIONDUPLICATE
+ +

The SCI_*EXTEND messages extend the selection.

+ +

The SCI_*RECTEXTEND messages extend the rectangular selection + (and convert regular selection to rectangular one, if any).

+ +

The SCI_WORDPART* commands are used to move between word segments marked by + capitalisation (aCamelCaseIdentifier) or underscores (an_under_bar_ident).

+ +

The SCI_HOME* commands move the caret to the start of the line, while the + SCI_VCHOME*commands move the caret to the first non-blank character of the line + (ie. just after the indentation) unless it is already there; in this case, it acts as SCI_HOME*.

+ +

The SCI_[HOME|LINEEND]DISPLAY* commands are used when in line wrap mode to + allow movement to the start or end of display lines as opposed to the normal + SCI_[HOME|LINEEND] commands which move to the start or end of document lines.

+ +

The SCI_[[VC]HOME|LINEEND]WRAP* commands are like their namesakes + SCI_[[VC]HOME|LINEEND]* except they behave differently when word-wrap is enabled: + They go first to the start / end of the display line, like SCI_[HOME|LINEEND]DISPLAY*, + but if the cursor is already at the point, it goes on to the start or end of the document line, + as appropriate for SCI_[[VC]HOME|LINEEND]*. +

+ +

Key bindings

+ +

There is a default binding of keys to commands that is defined in the Scintilla source in + the file KeyMap.cxx by the constant KeyMap::MapDefault[]. This table + maps key definitions to SCI_* messages with no parameters (mostly the keyboard commands discussed above, but any Scintilla + command that has no arguments can be mapped). You can change the mapping to suit your own + requirements.

+ SCI_ASSIGNCMDKEY(int keyDefinition, int + sciCommand)
+ SCI_CLEARCMDKEY(int keyDefinition)
+ SCI_CLEARALLCMDKEYS
+ SCI_NULL
+
+ +

keyDefinition
+ A key definition contains the key code in the low 16-bits and the key modifiers in the high + 16-bits. To combine keyCode and keyMod set:
+
+ keyDefinition = keyCode + (keyMod << 16)

+ +

The key code is a visible or control character or a key from the SCK_* + enumeration, which contains:
+ SCK_ADD, SCK_BACK, SCK_DELETE, SCK_DIVIDE, + SCK_DOWN, SCK_END, SCK_ESCAPE, SCK_HOME, + SCK_INSERT, SCK_LEFT, SCK_NEXT (Page Down), + SCK_PRIOR (Page Up), SCK_RETURN, SCK_RIGHT, + SCK_SUBTRACT, SCK_TAB, and SCK_UP.

+ +

The modifiers are a combination of zero or more of SCMOD_ALT, + SCMOD_CTRL, and SCMOD_SHIFT. If you are building a table, you might + want to use SCMOD_NORM, which has the value 0, to mean no modifiers.

+ +

SCI_ASSIGNCMDKEY(int keyDefinition, int sciCommand)
+ This assigns the given key definition to a Scintilla command identified by + sciCommand. sciCommand can be any SCI_* command that has + no arguments.

+ +

SCI_CLEARCMDKEY(int keyDefinition)
+ This makes the given key definition do nothing by assigning the action SCI_NULL + to it.

+ +

SCI_CLEARALLCMDKEYS
+ This command removes all keyboard command mapping by setting an empty mapping table.

+ +

SCI_NULL
+ The SCI_NULL does nothing and is the value assigned to keys that perform no + action. SCI_NULL ensures that keys do not propagate to the parent window as that may + cause focus to move. If you want the standard platform behaviour use the constant 0 instead.

+ +

Popup edit menu

+ +

SCI_USEPOPUP(bool bEnablePopup)
+ Clicking the wrong button on the mouse pops up a short default editing menu. This may be + turned off with SCI_USEPOPUP(0). If you turn it off, context menu commands (in + Windows, WM_CONTEXTMENU) will not be handled by Scintilla, so the parent of the + Scintilla window will have the opportunity to handle the message.

+ +

Macro recording

+ +

Start and stop macro recording mode. In macro recording mode, actions are reported to the + container through SCN_MACRORECORD + notifications. It is then up to the container to + record these actions for future replay.

+ +

SCI_STARTRECORD
+ SCI_STOPRECORD
+ These two messages turn macro recording on and off.

+ +

Printing

+ +

On Windows SCI_FORMATRANGE can be used to draw the text onto a display context + which can include a printer display context. Printed output shows text styling as on the + screen, but it hides all margins except a line number margin. All special marker effects are + removed and the selection and caret are hidden.

+ SCI_FORMATRANGE(bool bDraw, RangeToFormat + *pfr)
+ SCI_SETPRINTMAGNIFICATION(int + magnification)
+ SCI_GETPRINTMAGNIFICATION
+ SCI_SETPRINTCOLOURMODE(int mode)
+ SCI_GETPRINTCOLOURMODE
+ SCI_SETPRINTWRAPMODE
+ SCI_GETPRINTWRAPMODE
+
+ +

SCI_FORMATRANGE(bool bDraw, RangeToFormat *pfr)
+ This call allows Windows users to render a range of text into a device context. If you use + this for printing, you will probably want to arrange a page header and footer; Scintilla does + not do this for you. See SciTEWin::Print() in SciTEWinDlg.cxx for an + example. Each use of this message renders a range of text into a rectangular area and returns + the position in the document of the next character to print.

+ +

bDraw controls if any output is done. Set this to false if you are paginating + (for example, if you use this with MFC you will need to paginate in + OnBeginPrinting() before you output each page.

+
+struct RangeToFormat {
+    SurfaceID hdc;        // The HDC (device context) we print to
+    SurfaceID hdcTarget;  // The HDC we use for measuring (may be same as hdc)
+    PRectangle rc;        // Rectangle in which to print
+    PRectangle rcPage;    // Physically printable page size
+    CharacterRange chrg;  // Range of characters to print
+};
+
+ +

hdc and hdcTarget should both be set to the device context handle + of the output device (usually a printer). If you print to a metafile these will not be the same + as Windows metafiles (unlike extended metafiles) do not implement the full API for returning + information. In this case, set hdcTarget to the screen DC.
+ rcPage is the rectangle {0, 0, maxX, maxY} where maxX+1 + and maxY+1 are the number of physically printable pixels in x and y.
+ rc is the rectangle to render the text in (which will, of course, fit within the + rectangle defined by rcPage).
+ chrg.cpMin and chrg.cpMax define the start position and maximum + position of characters to output. All of each line within this character range is drawn.

+ +

When printing, the most tedious part is always working out what the margins should be to + allow for the non-printable area of the paper and printing a header and footer. If you look at + the printing code in SciTE, you will find that most of it is taken up with this. The loop that + causes Scintilla to render text is quite simple if you strip out all the margin, non-printable + area, header and footer code.

+ +

SCI_SETPRINTMAGNIFICATION(int magnification)
+ SCI_GETPRINTMAGNIFICATION
+ SCI_GETPRINTMAGNIFICATION lets you to print at a different size than the screen + font. magnification is the number of points to add to the size of each screen + font. A value of -3 or -4 gives reasonably small print. You can get this value with + SCI_GETPRINTMAGNIFICATION.

+ +

SCI_SETPRINTCOLOURMODE(int mode)
+ SCI_GETPRINTCOLOURMODE
+ These two messages set and get the method used to render coloured text on a printer that is + probably using white paper. It is especially important to consider the treatment of colour if + you use a dark or black screen background. Printing white on black uses up toner and ink very + many times faster than the other way around. You can set the mode to one of:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SymbolValuePurpose
SC_PRINT_NORMAL0Print using the current screen colours. This is the default.
SC_PRINT_INVERTLIGHT1If you use a dark screen background this saves ink by inverting the light value of + all colours and printing on a white background.
SC_PRINT_BLACKONWHITE2Print all text as black on a white background.
SC_PRINT_COLOURONWHITE3Everything prints in its own colour on a white background.
SC_PRINT_COLOURONWHITEDEFAULTBG4Everything prints in its own colour on a white background except that line numbers + use their own background colour.
+ +

SCI_SETPRINTWRAPMODE(int wrapMode)
+ SCI_GETPRINTWRAPMODE
+ These two functions get and set the printer wrap mode. wrapMode can be + set to SC_WRAP_NONE (0), SC_WRAP_WORD (1) or + SC_WRAP_CHAR (2). The default is + SC_WRAP_WORD, which wraps printed output so that all characters fit + into the print rectangle. If you set SC_WRAP_NONE, each line of text + generates one line of output and the line is truncated if it is too long to fit + into the print area.
+ SC_WRAP_WORD tries to wrap only between words as indicated by + white space or style changes although if a word is longer than a line, it will be wrapped before + the line end. SC_WRAP_CHAR is preferred to + SC_WRAP_WORD for Asian languages where there is no white space + between words.

+ +

Direct access

+ SCI_GETDIRECTFUNCTION
+ SCI_GETDIRECTPOINTER
+
+ +

On Windows, the message-passing scheme used to communicate between the container and + Scintilla is mediated by the operating system SendMessage function and can lead to + bad performance when calling intensively. To avoid this overhead, Scintilla provides messages + that allow you to call the Scintilla message function directly. The code to do this in C/C++ is + of the form:

+
+#include "Scintilla.h"
+SciFnDirect pSciMsg = (SciFnDirect)SendMessage(hSciWnd, SCI_GETDIRECTFUNCTION, 0, 0);
+sptr_t pSciWndData = (sptr_t)SendMessage(hSciWnd, SCI_GETDIRECTPOINTER, 0, 0);
+
+// now a wrapper to call Scintilla directly
+sptr_t CallScintilla(unsigned int iMessage, uptr_t wParam, sptr_t lParam){
+    return pSciMsg(pSciWndData, iMessage, wParam, lParam);
+}
+
+ +

SciFnDirect, sptr_t and uptr_t are declared in + Scintilla.h. hSciWnd is the window handle returned when you created + the Scintilla window.

+ +

While faster, this direct calling will cause problems if performed from a different thread + to the native thread of the Scintilla window in which case SendMessage(hSciWnd, SCI_*, + wParam, lParam) should be used to synchronize with the window's thread.

+ +

This feature also works on GTK+ but has no significant impact on speed.

+ +

From version 1.47 on Windows, Scintilla exports a function called + Scintilla_DirectFunction that can be used the same as the function returned by + SCI_GETDIRECTFUNCTION. This saves you the call to + SCI_GETDIRECTFUNCTION and the need to call Scintilla indirectly via the function + pointer.

+ +

SCI_GETDIRECTFUNCTION
+ This message returns the address of the function to call to handle Scintilla messages without + the overhead of passing through the Windows messaging system. You need only call this once, + regardless of the number of Scintilla windows you create.

+ +

SCI_GETDIRECTPOINTER
+ This returns a pointer to data that identifies which Scintilla window is in use. You must call + this once for each Scintilla window you create. When you call the direct function, you must + pass in the direct pointer associated with the target window.

+ +

Multiple views

+ +

A Scintilla window and the document that it displays are separate entities. When you create + a new window, you also create a new, empty document. Each document has a reference count that + is initially set to 1. The document also has a list of the Scintilla windows that are linked to + it so when any window changes the document, all other windows in which it appears are notified + to cause them to update. The system is arranged in this way so that you can work with many + documents in a single Scintilla window and so you can display a single document in multiple + windows (for use with splitter windows).

+ +

Although these messages use document *pDoc, to ensure compatibility with future + releases of Scintilla you should treat pDoc as an opaque void*. That + is, you can use and store the pointer as described in this section but you should not + dereference it.

+ SCI_GETDOCPOINTER
+ SCI_SETDOCPOINTER(<unused>, document + *pDoc)
+ SCI_CREATEDOCUMENT
+ SCI_ADDREFDOCUMENT(<unused>, document + *pDoc)
+ SCI_RELEASEDOCUMENT(<unused>, document + *pDoc)
+
+ +

SCI_GETDOCPOINTER
+ This returns a pointer to the document currently in use by the window. It has no other + effect.

+ +

SCI_SETDOCPOINTER(<unused>, document *pDoc)
+ This message does the following:
+ 1. It removes the current window from the list held by the current document.
+ 2. It reduces the reference count of the current document by 1.
+ 3. If the reference count reaches 0, the document is deleted.
+ 4. pDoc is set as the new document for the window.
+ 5. If pDoc was 0, a new, empty document is created and attached to the + window.
+ 6. If pDoc was not 0, its reference count is increased by 1.

+ +

SCI_CREATEDOCUMENT
+ This message creates a new, empty document and returns a pointer to it. This document is not + selected into the editor and starts with a reference count of 1. This means that you have + ownership of it and must either reduce its reference count by 1 after using + SCI_SETDOCPOINTER so that the Scintilla window owns it or you must make sure that + you reduce the reference count by 1 with SCI_RELEASEDOCUMENT before you close the + application to avoid memory leaks.

+ +

SCI_ADDREFDOCUMENT(<unused>, document *pDoc)
+ This increases the reference count of a document by 1. If you want to replace the current + document in the Scintilla window and take ownership of the current document, for example if you + are editing many documents in one window, do the following:
+ 1. Use SCI_GETDOCPOINTER to get a pointer to the document, + pDoc.
+ 2. Use SCI_ADDREFDOCUMENT(0, pDoc) to increment the reference count.
+ 3. Use SCI_SETDOCPOINTER(0, pNewDoc) to set a different document or + SCI_SETDOCPOINTER(0, 0) to set a new, empty document.

+ +

SCI_RELEASEDOCUMENT(<unused>, document *pDoc)
+ This message reduces the reference count of the document identified by pDoc. pDoc + must be the result of SCI_GETDOCPOINTER or SCI_CREATEDOCUMENT and + must point at a document that still exists. If you call this on a document with a reference + count of 1 that is still attached to a Scintilla window, bad things will happen. To keep the + world spinning in its orbit you must balance each call to SCI_CREATEDOCUMENT or + SCI_ADDREFDOCUMENT with a call to SCI_RELEASEDOCUMENT.

+ +

Folding

+ +

The fundamental operation in folding is making lines invisible or visible. Line visibility + is a property of the view rather than the document so each view may be displaying a different + set of lines. From the point of view of the user, lines are hidden and displayed using fold + points. Generally, the fold points of a document are based on the hierarchical structure of the + document contents. In Python, the hierarchy is determined by indentation and in C++ by brace + characters. This hierarchy can be represented within a Scintilla document object by attaching a + numeric "fold level" to each line. The fold level is most easily set by a lexer, but you can + also set it with messages.

+ +

It is up to your code to set the connection between user actions and folding and unfolding. + The best way to see how this is done is to search the SciTE source code for the messages used + in this section of the documentation and see how they are used. You will also need to use + markers and a folding margin to complete your folding implementation. + The "fold" property should be set to "1" with + SCI_SETPROPERTY("fold", "1") to enable folding.

+ SCI_VISIBLEFROMDOCLINE(int + docLine)
+ SCI_DOCLINEFROMVISIBLE(int + displayLine)
+ SCI_SHOWLINES(int lineStart, int lineEnd)
+ SCI_HIDELINES(int lineStart, int lineEnd)
+ SCI_GETLINEVISIBLE(int line)
+ SCI_SETFOLDLEVEL(int line, int level)
+ SCI_GETFOLDLEVEL(int line)
+ SCI_SETFOLDFLAGS(int flags)
+ SCI_GETLASTCHILD(int line, int level)
+ SCI_GETFOLDPARENT(int line)
+ SCI_SETFOLDEXPANDED(int line, bool + expanded)
+ SCI_GETFOLDEXPANDED(int line)
+ SCI_TOGGLEFOLD(int line)
+ SCI_ENSUREVISIBLE(int line)
+ SCI_ENSUREVISIBLEENFORCEPOLICY(int + line)
+
+ +

SCI_VISIBLEFROMDOCLINE(int docLine)
+ When some lines are folded, then a particular line in the document may be displayed at a + different position to its document position. If no lines are folded, this message returns + docLine. Otherwise, this returns the display line (counting the very first visible + line as 0). The display line of an invisible line is the same as the previous visible line. The + display line number of the first line in the document is 0. If there is folding and + docLine is outside the range of lines in the document, the return value is -1. + Lines can occupy more than one display line if they wrap.

+ +

SCI_DOCLINEFROMVISIBLE(int displayLine)
+ When some lines are hidden, then a particular line in the document may be displayed at a + different position to its document position. This message returns the document line number that + corresponds to a display line (counting the display line of the first line in the document as + 0). If displayLine is less than or equal to 0, the result is 0. If + displayLine is greater than or equal to the number of displayed lines, the result + is the number of lines in the document.

+ +

SCI_SHOWLINES(int lineStart, int lineEnd)
+ SCI_HIDELINES(int lineStart, int lineEnd)
+ SCI_GETLINEVISIBLE(int line)
+ The first two messages mark a range of lines as visible or invisible and then redraw the + display. The third message reports on the visible state of a line and returns 1 if it is + visible and 0 if it is not visible. These messages have no effect on fold levels or fold + flags.

+ +

SCI_SETFOLDLEVEL(int line, int level)
+ SCI_GETFOLDLEVEL(int line)
+ These two messages set and get a 32-bit value that contains the fold level of a line and some + flags associated with folding. The fold level is a number in the range 0 to + SC_FOLDLEVELNUMBERMASK (4095). However, the initial fold level is set to + SC_FOLDLEVELBASE (1024) to allow unsigned arithmetic on folding levels. There are + two addition flag bits. SC_FOLDLEVELWHITEFLAG indicates that the line is blank and + allows it to be treated slightly different then its level may indicate. For example, blank + lines should generally not be fold points and will be considered part of the preceding section even though + they may have a lesser fold level. + SC_FOLDLEVELHEADERFLAG indicates that + the line is a header (fold point).

+ +

Use SCI_GETFOLDLEVEL(line) & SC_FOLDLEVELNUMBERMASK to get the fold level + of a line. Likewise, use SCI_GETFOLDLEVEL(line) & SC_FOLDLEVEL*FLAG to get the + state of the flags. To set the fold level you must or in the associated flags. For instance, to + set the level to thisLevel and mark a line as being a fold point use: + SCI_SETFOLDLEVEL(line, thisLevel | SC_FOLDLEVELHEADERFLAG).

+ If you use a lexer, you should not need to use SCI_SETFOLDLEVEL as this is far + better handled by the lexer. You will need to use SCI_GETFOLDLEVEL to decide how + to handle user folding requests. If you do change the fold levels, the folding margin will + update to match your changes. + +

SCI_SETFOLDFLAGS(int flags)
+ In addition to showing markers in the folding margin, you can indicate folds to the user by + drawing lines in the text area. The lines are drawn in the foreground colour set for STYLE_DEFAULT. Bits set in + flags determine where folding lines are drawn:
+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ValueEffect
1Experimental - draw boxes if expanded
2Draw above if expanded
4Draw above if not expanded
8Draw below if expanded
16Draw below if not expanded
64display hexadecimal fold levels in line margin to aid debugging of + folding. This feature needs to be redesigned to be sensible.
+ +

This message causes the display to redraw.

+ +

SCI_GETLASTCHILD(int startLine, int level)
+ This message searches for the next line after startLine, that has a folding level + that is less than or equal to level and then returns the previous line number. If + you set level to -1, level is set to the folding level of line + startLine. If from is a fold point, SCI_GETLASTCHILD(from, + -1) returns the last line that would be in made visible or hidden by toggling the fold + state.

+ +

SCI_GETFOLDPARENT(int startLine)
+ This message returns the line number of the first line before startLine that is + marked as a fold point with SC_FOLDLEVELHEADERFLAG and has a fold level less than + the startLine. If no line is found, or if the header flags and fold levels are + inconsistent, the return value is -1.

+ +

SCI_TOGGLEFOLD(int line)
+ Each fold point may be either expanded, displaying all its child lines, or contracted, hiding + all the child lines. This message toggles the folding state of the given line as long as it has + the SC_FOLDLEVELHEADERFLAG set. This message takes care of folding or expanding + all the lines that depend on the line. The display updates after this message.

+ +

SCI_SETFOLDEXPANDED(int line, bool expanded)
+ SCI_GETFOLDEXPANDED(int line)
+ These messages set and get the expanded state of a single line. The set message has no effect + on the visible state of the line or any lines that depend on it. It does change the markers in + the folding margin. If you ask for the expansion state of a line that is outside the document, + the result is false (0).

+ +

If you just want to toggle the fold state of one line and handle all the lines that are + dependent on it, it is much easier to use SCI_TOGGLEFOLD. You would use the + SCI_SETFOLDEXPANDED message to process many folds without updating the display + until you had finished. See SciTEBase::FoldAll() and + SciTEBase::Expand() for examples of the use of these messages.

+ +

SCI_ENSUREVISIBLE(int line)
+ SCI_ENSUREVISIBLEENFORCEPOLICY(int line)
+ A line may be hidden because more than one of its parent lines is contracted. Both these + message travels up the fold hierarchy, expanding any contracted folds until they reach the top + level. The line will then be visible. If you use SCI_ENSUREVISIBLEENFORCEPOLICY, + the vertical caret policy set by SCI_SETVISIBLEPOLICY is then applied.

+ +

Line wrapping

+ + SCI_SETWRAPMODE(int wrapMode)
+ SCI_GETWRAPMODE
+ SCI_SETWRAPVISUALFLAGS(int wrapVisualFlags)
+ SCI_GETWRAPVISUALFLAGS
+ SCI_SETWRAPSTARTINDENT(int indent)
+ SCI_GETWRAPSTARTINDENT
+ SCI_SETLAYOUTCACHE(int cacheMode)
+ SCI_GETLAYOUTCACHE
+ SCI_LINESSPLIT(int pixelWidth)
+ SCI_LINESJOIN
+ SCI_WRAPCOUNT(int docLine)
+
+ +

By default, Scintilla does not wrap lines of text. If you enable line wrapping, lines wider + than the window width are continued on the following lines. Lines are broken after space or tab + characters or between runs of different styles. If this is not possible because a word in one + style is wider than the window then the break occurs after the last character that completely + fits on the line. The horizontal scroll bar does not appear when wrap mode is on.

+ +

For wrapped lines Scintilla can draw visual flags (little arrows) at end of a a subline of a + wrapped line and at begin of the next subline. These can be enabled individually, but if Scintilla + draws the visual flag at begin of the next subline this subline will be indented by one char. + Independent from drawing a visual flag at the begin the subline can have an indention.

+ +

Much of the time used by Scintilla is spent on laying out and drawing text. The same text + layout calculations may be performed many times even when the data used in these calculations + does not change. To avoid these unnecessary calculations in some circumstances, the line layout + cache can store the results of the calculations. The cache is invalidated whenever the + underlying data, such as the contents or styling of the document changes. Caching the layout of + the whole document has the most effect, making dynamic line wrap as much as 20 times faster but + this requires 7 times the memory required by the document contents plus around 80 bytes per + line.

+ +

Wrapping is not performed immediately there is a change but is delayed until the display + is redrawn. This delay improves peformance by allowing a set of changes to be performed + and then wrapped and displayed once. Because of this, some operations may not occur as + expected. If a file is read and the scroll position moved to a particular line in the text, + such as occurs when a container tries to restore a previous editing session, then + the scroll position will have been determined before wrapping so an unexpected range + of text will be displayed. To scroll to the position correctly, delay the scroll until the + wrapping has been performed by waiting for an initial + SCN_PAINTED notification.

+ +

SCI_SETWRAPMODE(int wrapMode)
+ SCI_GETWRAPMODE
+ Set wrapMode to SC_WRAP_WORD (1) to enable wrapping + on word boundaries, SC_WRAP_CHAR (2) to enable wrapping + between any characters, and to SC_WRAP_NONE (0) to disable line + wrapping. SC_WRAP_CHAR is preferred to + SC_WRAP_WORD for Asian languages where there is no white space + between words.

+ + +

SCI_SETWRAPVISUALFLAGS(int wrapVisualFlags)
+ SCI_GETWRAPVISUALFLAGS
+ You can enable the drawing of visual flags to indicate a line is wrapped. Bits set in + wrapVisualFlags determine which visual flags are drawn. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SymbolValueEffect
SC_WRAPVISUALFLAG_NONE0No visual flags
SC_WRAPVISUALFLAG_END1Visual flag at end of subline of a wrapped line.
SC_WRAPVISUALFLAG_START2Visual flag at begin of subline of a wrapped line.
+ Subline is indented by at least 1 to make room for the flag.
+
+ +

SCI_SETWRAPVISUALFLAGSLOCATION(int wrapVisualFlagsLocation)
+ SCI_GETWRAPVISUALFLAGSLOCATION
+ You can set wether the visual flags to indicate a line is wrapped are drawn near the border or near the text. + Bits set in wrapVisualFlagsLocation set the location to near the text for the corresponding visual flag. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SymbolValueEffect
SC_WRAPVISUALFLAGLOC_DEFAULT0Visual flags drawn near border
SC_WRAPVISUALFLAGLOC_END_BY_TEXT1Visual flag at end of subline drawn near text
SC_WRAPVISUALFLAGLOC_START_BY_TEXT2Visual flag at begin of subline drawn near text
+ +
+ +

SCI_SETWRAPSTARTINDENT(int indent)
+ SCI_GETWRAPSTARTINDENT
+ SCI_SETWRAPSTARTINDENT sets the size of indentation of sublines for + wrapped lines in terms of the width of a space in + STYLE_DEFAULT. + There are no limits on indent sizes, but values less than 0 or large values may have + undesirable effects.
+ The indention of sublines is independent of visual flags, but if + SC_WRAPVISUALFLAG_START is set an indent of at least 1 is used. +

+ +

SCI_SETLAYOUTCACHE(int cacheMode)
+ SCI_GETLAYOUTCACHE
+ You can set cacheMode to one of the symbols in the table:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SymbolValueLayout cached for these lines
SC_CACHE_NONE0No lines are cached.
SC_CACHE_CARET1The line containing the text caret. This is the default.
SC_CACHE_PAGE2Visible lines plus the line containing the caret.
SC_CACHE_DOCUMENT3All lines in the document.
+
+ +

SCI_LINESSPLIT(int pixelWidth)
+ Split a range of lines indicated by the target into lines that are at most pixelWidth wide. + Splitting occurs on word boundaries wherever possible in a similar manner to line wrapping. + When pixelWidth is 0 then the width of the window is used. +

+ +

SCI_LINESJOIN
+ Join a range of lines indicated by the target into one line by + removing line end characters. + Where this would lead to no space between words, an extra space is inserted. +

+ +

SCI_WRAPCOUNT(int docLine)
+ Document lines can occupy more than one display line if they wrap and this + returns the number of display lines needed to wrap a document line.

+ +

Zooming

+ +

Scintilla incorporates a "zoom factor" that lets you make all the text in the document + larger or smaller in steps of one point. The displayed point size never goes below 2, whatever + zoom factor you set. You can set zoom factors in the range -10 to +20 points.

+ SCI_ZOOMIN
+ SCI_ZOOMOUT
+ SCI_SETZOOM(int zoomInPoints)
+ SCI_GETZOOM
+
+ +

SCI_ZOOMIN
+ SCI_ZOOMOUT
+ SCI_ZOOMIN increases the zoom factor by one point if the current zoom factor is + less than 20 points. SCI_ZOOMOUT decreases the zoom factor by one point if the + current zoom factor is greater than -10 points.

+ +

SCI_SETZOOM(int zoomInPoints)
+ SCI_GETZOOM
+ These messages let you set and get the zoom factor directly. There is no limit set on the + factors you can set, so limiting yourself to -10 to +20 to match the incremental zoom functions + is a good idea.

+ +

Long lines

+ +

You can choose to mark lines that exceed a given length by drawing a vertical line or by + colouring the background of characters that exceed the set length.

+ SCI_SETEDGEMODE(int mode)
+ SCI_GETEDGEMODE
+ SCI_SETEDGECOLUMN(int column)
+ SCI_GETEDGECOLUMN
+ SCI_SETEDGECOLOUR(int colour)
+ SCI_GETEDGECOLOUR
+
+ +

SCI_SETEDGEMODE(int edgeMode)
+ SCI_GETEDGEMODE
+ These two messages set and get the mode used to display long lines. You can set one of the + values in the table:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SymbolValueLong line display mode
EDGE_NONE0Long lines are not marked. This is the default state.
EDGE_LINE1A vertical line is drawn at the column number set by SCI_SETEDGECOLUMN. + This works well for monospaced fonts. The line is drawn at a position based on the width + of a space character in STYLE_DEFAULT, so it may not work very well if + your styles use proportional fonts or if your style have varied font sizes or you use a + mixture of bold, italic and normal text. .
EDGE_BACKGROUND2The background colour of characters after the column limit is changed to the colour + set by SCI_SETEDGECOLOUR. This is recommended for proportional fonts.
+
+
+ + +

SCI_SETEDGECOLUMN(int column)
+ SCI_GETEDGECOLUMN
+ These messages set and get the column number at which to display the long line marker. When + drawing lines, the column sets a position in units of the width of a space character in + STYLE_DEFAULT. When setting the background colour, the column is a character count + (allowing for tabs) into the line.

+ +

SCI_SETEDGECOLOUR(int colour)
+ SCI_GETEDGECOLOUR
+ These messages set and get the colour of the marker used to show that a line has exceeded the + length set by SCI_SETEDGECOLUMN.

+ +

Lexer

+ +

If you define the symbol SCI_LEXER when building Scintilla, (this is sometimes + called the SciLexer version of Scintilla), lexing support for a wide range programming + languages is included and the messages in this section are supported. If you want to set + styling and fold points for an unsupported language you can either do this in the container or + better still, write your own lexer following the pattern of one of the existing ones.

+ +

Scintilla also supports external lexers. These are DLLs (on Windows) or .so modules (on GTK+/Linux) that export four + functions: GetLexerCount, GetLexerName, Lex and + Fold. See externalLexer.cxx for more.

+ SCI_SETLEXER(int lexer)
+ SCI_GETLEXER
+ SCI_SETLEXERLANGUAGE(<unused>, char + *name)
+ SCI_LOADLEXERLIBRARY(<unused>, char + *path)
+ SCI_COLOURISE(int start, int end)
+ SCI_SETPROPERTY(const char *key, const char *value)
+ SCI_GETPROPERTY(const char *key, char *value)
+ SCI_GETPROPERTYEXPANDED(const char *key, char *value)
+ SCI_GETPROPERTYINT(const char *key, int default)
+ SCI_SETKEYWORDS(int keyWordSet, const char + *keyWordList)
+ SCI_GETSTYLEBITSNEEDED +
+
+ +

SCI_SETLEXER(int lexer)
+ SCI_GETLEXER
+ You can select the lexer to use with an integer code from the SCLEX_* enumeration + in Scintilla.h. There are two codes in this sequence that do not use lexers: + SCLEX_NULL to select no lexing action and SCLEX_CONTAINER which sends + the SCN_STYLENEEDED notification to + the container whenever a range of text needs to be styled. You cannot use the + SCLEX_AUTOMATIC value; this identifies additional external lexers that Scintilla + assigns unused lexer numbers to.

+ +

SCI_SETLEXERLANGUAGE(<unused>, const char *name)
+ This message lets you select a lexer by name, and is the only method if you are using an + external lexer or if you have written a lexer module for a language of your own and do not wish + to assign it an explicit lexer number. To select an existing lexer, set name to + match the (case sensitive) name given to the module, for example "ada" or "python", not "Ada" + or "Python". To locate the name for the built-in lexers, open the relevant + Lex*.cxx file and search for LexerModule. The third argument in the + LexerModule constructor is the name to use.

+ +

To test if your lexer assignment worked, use SCI_GETLEXER before and after setting the new lexer to + see if the lexer number changed.

+ +

SCI_LOADLEXERLIBRARY(<unused>, const char *path)
+ Load a lexer implemented in a shared library. This is a .so file on GTK+/Linux or a .DLL file on Windows. +

+ +

SCI_COLOURISE(int startPos, int endPos)
+ This requests the current lexer or the container (if the lexer is set to + SCLEX_CONTAINER) to style the document between startPos and + endPos. If endPos is -1, the document is styled from + startPos to the end. If the "fold" property is set to + "1" and your lexer or container supports folding, fold levels are also set. This + message causes a redraw.

+ +

SCI_SETPROPERTY(const char *key, const char *value)
+ You can communicate settings to lexers with keyword:value string pairs. There is no limit to + the number of keyword pairs you can set, other than available memory. key is a + case sensitive keyword, value is a string that is associated with the keyword. If + there is already a value string associated with the keyword, it is replaced. If you pass a zero + length string, the message does nothing. Both key and value are used + without modification; extra spaces at the beginning or end of key are + significant.

+ +

The value string can refer to other keywords. For example, + SCI_SETPROPERTY("foldTimes10", "$(fold)0") stores the string + "$(fold)0", but when this is accessed, the $(fold) is replaced by the + value of the "fold" keyword (or by nothing if this keyword does not exist).

+ +

Currently the "fold" property is defined for most of the lexers to set the fold structure if + set to "1". SCLEX_PYTHON understands "tab.timmy.whinge.level" as a + setting that determines how to indicate bad indentation. Most keywords have values that are + interpreted as integers. Search the lexer sources for GetPropertyInt to see how + properties are used.

+ +

SCI_GETPROPERTY(const char *key, char *value)
+ Lookup a keyword:value pair using the specified key; if found, copy the value to the user-supplied + buffer and return the length (not including the terminating 0). If not found, copy an empty string + to the buffer and return 0.

+ +

Note that "keyword replacement" as described in + SCI_SETPROPERTY will not be performed.

+ +

If the value argument is 0 then the length that should be allocated to store the value is returned; + again, the terminating 0 is not included.

+ +

SCI_GETPROPERTYEXPANDED(const char *key, char *value)
+ Lookup a keyword:value pair using the specified key; if found, copy the value to the user-supplied + buffer and return the length (not including the terminating 0). If not found, copy an empty string + to the buffer and return 0.

+ +

Note that "keyword replacement" as described in + SCI_SETPROPERTY will be performed.

+ +

If the value argument is 0 then the length that should be allocated to store the value (including any indicated keyword replacement) + is returned; again, the terminating 0 is not included.

+ +

SCI_GETPROPERTYINT(const char *key, int default)
+ Lookup a keyword:value pair using the specified key; if found, interpret the value as an integer and return it. + If not found (or the value is an empty string) then return the supplied default. If the keyword:value pair is found but is not + a number, then return 0.

+ +

Note that "keyword replacement" as described in + SCI_SETPROPERTY will be performed before any numeric interpretation.

+ +

SCI_SETKEYWORDS(int keyWordSet, const char *keyWordList)
+ You can set up to 9 lists of keywords for use by the current lexer. This was increased from 6 + at revision 1.50. keyWordSet can be 0 to 8 (actually 0 to KEYWORDSET_MAX) + and selects which keyword list to replace. keyWordList is a list of keywords + separated by spaces, tabs, "\n" or "\r" or any combination of these. + It is expected that the keywords will be composed of standard ASCII printing characters, + but there is nothing to stop you using any non-separator character codes from 1 to 255 + (except common sense).

+ +

How these keywords are used is entirely up to the lexer. Some languages, such as HTML may + contain embedded languages, VBScript and JavaScript are common for HTML. For HTML, key word set + 0 is for HTML, 1 is for JavaScript and 2 is for VBScript, 3 is for Python, 4 is for PHP and 5 + is for SGML and DTD keywords. Review the lexer code to see examples of keyword list. A fully + conforming lexer sets the fourth argument of the LexerModule constructor to be a + list of strings that describe the uses of the keyword lists.

+ +

Alternatively, you might use set 0 for general keywords, set 1 for keywords that cause + indentation and set 2 for keywords that cause unindentation. Yet again, you might have a simple + lexer that colours keywords and you could change languages by changing the keywords in set 0. + There is nothing to stop you building your own keyword lists into the lexer, but this means + that the lexer must be rebuilt if more keywords are added.

+ +

SCI_GETSTYLEBITSNEEDED
+ Retrieve the number of bits the current lexer needs for styling. This should normally be the argument + to SCI_SETSTYLEBITS. +

+ +

Notifications

+ +

Notifications are sent (fired) from the Scintilla control to its container when an event has + occurred that may interest the container. Notifications are sent using the + WM_NOTIFY message on Windows and the "notify" signal on GTK+. The container is + passed a SCNotification structure containing information about the event.

+
+struct NotifyHeader {   // This matches the Win32 NMHDR structure
+    void *hwndFrom;     // environment specific window handle/pointer
+    uptr_t idFrom;	// CtrlID of the window issuing the notification
+    unsigned int code;  // The SCN_* notification code
+};
+
+struct SCNotification {
+    struct NotifyHeader nmhdr;
+    int position;
+    // SCN_STYLENEEDED, SCN_DOUBLECLICK, SCN_MODIFIED, SCN_DWELLSTART,
+    // SCN_DWELLEND, SCN_CALLTIPCLICK,
+    // SCN_HOTSPOTCLICK, SCN_HOTSPOTDOUBLECLICK
+    int ch;             // SCN_CHARADDED, SCN_KEY
+    int modifiers;      // SCN_KEY, SCN_HOTSPOTCLICK, SCN_HOTSPOTDOUBLECLICK
+    int modificationType; // SCN_MODIFIED
+    const char *text;   // SCN_MODIFIED, SCN_USERLISTSELECTION, SCN_AUTOCSELECTION
+    int length;         // SCN_MODIFIED
+    int linesAdded;     // SCN_MODIFIED
+    int message;        // SCN_MACRORECORD
+    uptr_t wParam;      // SCN_MACRORECORD
+    sptr_t lParam;      // SCN_MACRORECORD
+    int line;           // SCN_MODIFIED, SCN_DOUBLECLICK
+    int foldLevelNow;   // SCN_MODIFIED
+    int foldLevelPrev;  // SCN_MODIFIED
+    int margin;         // SCN_MARGINCLICK
+    int listType;       // SCN_USERLISTSELECTION, SCN_AUTOCSELECTION
+    int x;              // SCN_DWELLSTART, SCN_DWELLEND
+    int y;              // SCN_DWELLSTART, SCN_DWELLEND
+};
+
+ +

The notification messages that your container can choose to handle and the messages + associated with them are:

+ SCN_STYLENEEDED
+ SCN_CHARADDED
+ SCN_SAVEPOINTREACHED
+ SCN_SAVEPOINTLEFT
+ SCN_MODIFYATTEMPTRO
+ SCN_KEY
+ SCN_DOUBLECLICK
+ SCN_UPDATEUI
+ SCN_MODIFIED
+ SCN_MACRORECORD
+ SCN_MARGINCLICK
+ SCN_NEEDSHOWN
+ SCN_PAINTED
+ SCN_USERLISTSELECTION
+ SCN_URIDROPPED
+ SCN_DWELLSTART
+ SCN_DWELLEND
+ SCN_ZOOM
+ SCN_HOTSPOTCLICK
+ SCN_HOTSPOTDOUBLECLICK
+ SCN_CALLTIPCLICK
+ SCN_AUTOCSELECTION
+
+ +

The following SCI_* messages are associated with these notifications:

+ SCI_SETMODEVENTMASK(int + eventMask)
+ SCI_GETMODEVENTMASK
+ SCI_SETMOUSEDWELLTIME
+ SCI_GETMOUSEDWELLTIME
+
+ +

The following additional notifications are sent using the WM_COMMAND message on + Windows and the "Command" signal on GTK+. This emulates the Windows Edit control. Only the lower + 16 bits of the control's ID is passed in these notifications.

+ SCEN_CHANGE
+ SCEN_SETFOCUS
+ SCEN_KILLFOCUS
+
+ +

SCN_STYLENEEDED
+ If you used SCI_SETLEXER(SCLEX_CONTAINER) to make the container act as the + lexer, you will receive this notification when Scintilla is about to display or print text that + requires styling. You are required to style the text from the line that contains the position + returned by SCI_GETENDSTYLED up to + the position passed in SCNotification.position. Symbolically, you need code of the + form:

+
+    startPos = SCI_GETENDSTYLED()
+    lineNumber = SCI_LINEFROMPOSITION(startPos);
+    startPos = SCI_POSITIONFROMLINE(lineNumber);
+    MyStyleRoutine(startPos, SCNotification.position);
+
+ +

SCN_CHARADDED
+ This is sent when the user types an ordinary text character (as opposed to a command + character) that is entered into the text. The container can use this to decide to display a call tip or an auto + completion list. The character is in SCNotification.ch. + This notification is sent before the character has been styled so processing that depends on + styling should instead be performed in the SCN_UPDATEUI notification.

+ +

SCN_SAVEPOINTREACHED
+ SCN_SAVEPOINTLEFT
+ Sent to the container when the save point is entered or left, allowing the container to + display a "document dirty" indicator and change its menus.
+ See also: SCI_SETSAVEPOINT, SCI_GETMODIFY

+ +

SCN_MODIFYATTEMPTRO
+ When in read-only mode, this notification is sent to the container if the user tries to change + the text. This can be used to check the document out of a version control system. You can set + the read-only state of a document with SCI_SETREADONLY.

+ +

SCN_KEY
+ Reports all keys pressed but not consumed by Scintilla. Used on GTK+ because of + some problems with keyboard focus and is not sent by the Windows version. SCNotification.ch holds the key code and + SCNotification.modifiers holds the modifiers. This notification is sent if the + modifiers include SCMOD_ALT or SCMOD_CTRL and the key code is less + than 256.

+ +

SCN_DOUBLECLICK
+ The mouse button was double clicked in editor. The position field is set to the text position of the + double click and the line field is set to the line of the double click.

+ +

SCN_UPDATEUI
+ Either the text or styling of the document has changed or the selection range has changed. Now + would be a good time to update any container UI elements that depend on document or view state. + This was previously called SCN_CHECKBRACE because a common use is to check whether the + caret is next to a brace and set highlights on this brace and its corresponding matching brace. + This also replaces SCN_POSCHANGED, + which is now deprecated.

+ +

SCN_MODIFIED
+ This notification is sent when the text or styling of the document changes or is about to + change. You can set a mask for the notifications that are sent to the container with SCI_SETMODEVENTMASK. The + notification structure contains information about what changed, how the change occurred and + whether this changed the number of lines in the document. No modifications may be performed + while in a SCN_MODIFIED event. The SCNotification fields used + are:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldUsage
modificationTypeA set of flags that identify the change(s) made. See the next + table.
positionStart position of a text or styling change. Set to 0 if not used.
lengthLength of the change in cells or characters when the text or styling + changes. Set to 0 if not used.
linesAddedNumber of added lines. If negative, the number of deleted lines. Set to + 0 if not used or no lines added or deleted.
textValid for text changes, not for style changes. If we are collecting undo + information this holds a pointer to the text that is handed to the Undo system, otherwise + it is zero. For user performed SC_MOD_BEFOREDELETE the text field is 0 and + for user performed SC_MOD_BEFOREINSERT the text field points to an array of cells, + not bytes and the length is the number of cells.
lineThe line number at which a fold level or marker change occurred. This is + 0 if unused and may be -1 if more than one line changed.
foldLevelNowThe new fold level applied to the line or 0 if this field is + unused.
foldLevelPrevThe previous folding level of the line or 0 if this field is + unused.
+ +

The SCNotification.modificationType field has bits set to tell you what has + been done. The SC_MOD_* bits correspond to actions. The + SC_PERFORMED_* bits tell you if the action was done by the user, or the result of + Undo or Redo of a previous action.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SymbolValueMeaningSCNotification fields
SC_MOD_INSERTTEXT0x01Text has been inserted into the document.position, length, text, linesAdded
SC_MOD_DELETETEXT0x02Text has been removed from the document.position, length, text, linesAdded
SC_MOD_CHANGESTYLE0x04A style change has occurred.position, length
SC_MOD_CHANGEFOLD0x08A folding change has occurred.line, foldLevelNow, foldLevelPrev
SC_PERFORMED_USER0x10Information: the operation was done by the user.None
SC_PERFORMED_UNDO0x20Information: this was the result of an Undo.None
SC_PERFORMED_REDO0x40Information: this was the result of a Redo.None
SC_MULTISTEPUNDOREDO0x80This is part of a multi-step Undo or Redo.None
SC_LASTSTEPINUNDOREDO0x100This is the final step in an Undo or Redo.None
SC_MOD_CHANGEMARKER0x200One or more markers has changed in a line.line
SC_MOD_BEFOREINSERT0x400Text is about to be inserted into the document.position, if performed by user then text in cells, length in cells
SC_MOD_BEFOREDELETE0x800Text is about to be deleted from the document.position, length
SC_MULTILINEUNDOREDO0x1000This is part of an Undo or Redo with multi-line changes.None
SC_MODEVENTMASKALL0x1fffThis is a mask for all valid flags. This is the default mask state set by SCI_SETMODEVENTMASK.None
+ +

SCEN_CHANGE
+ SCEN_CHANGE (768) is fired when the text (not the style) of the document changes. + This notification is sent using the WM_COMMAND message on Windows and the + "Command" signal on GTK+ as this is the behavior of the standard Edit control + (SCEN_CHANGE has the same value as the Windows Edit control + EN_CHANGE). No other information is sent. If you need more detailed information + use SCN_MODIFIED. You can filter the + types of changes you are notified about with SCI_SETMODEVENTMASK.

+ +

SCI_SETMODEVENTMASK(int eventMask)
+ SCI_GETMODEVENTMASK
+ These messages set and get an event mask that determines which document change events are + notified to the container with SCN_MODIFIED and SCEN_CHANGE. For example, a container may decide to see + only notifications about changes to text and not styling changes by calling + SCI_SETMODEVENTMASK(SC_MOD_INSERTTEXT|SC_MOD_DELETETEXT).

+ +

The possible notification types are the same as the modificationType bit flags + used by SCN_MODIFIED: SC_MOD_INSERTTEXT, + SC_MOD_DELETETEXT, SC_MOD_CHANGESTYLE, + SC_MOD_CHANGEFOLD, SC_PERFORMED_USER, SC_PERFORMED_UNDO, + SC_PERFORMED_REDO, SC_MULTISTEPUNDOREDO, + SC_LASTSTEPINUNDOREDO, SC_MOD_CHANGEMARKER, + SC_MOD_BEFOREINSERT, SC_MOD_BEFOREDELETE, + SC_MULTILINEUNDOREDO, and SC_MODEVENTMASKALL.

+ +

SCEN_SETFOCUS
+ SCEN_KILLFOCUS
+ SCEN_SETFOCUS (512) is fired when Scintilla receives focus and + SCEN_KILLFOCUS (256) when it loses focus. These notifications are sent using the + WM_COMMAND message on Windows and the "Command" signal on GTK+ as this is the + behavior of the standard Edit control. Unfortunately, these codes do not match the Windows Edit + notification codes EN_SETFOCUS (256) and EN_KILLFOCUS (512). It is + now too late to change the Scintilla codes as clients depend on the current values.

+ +

SCN_MACRORECORD
+ The SCI_STARTRECORD and SCI_STOPRECORD messages enable and + disable macro recording. When enabled, each time a recordable change occurs, the + SCN_MACRORECORD notification is sent to the container. It is up to the container + to record the action. To see the complete list of SCI_* messages that are + recordable, search the Scintilla source Editor.cxx for + Editor::NotifyMacroRecord. The fields of SCNotification set in this + notification are:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldUsage
messageThe SCI_* message that caused the notification.
wParamThe value of wParam in the SCI_* message.
lParamThe value of lParam in the SCI_* message.
+ +

SCN_MARGINCLICK
+ This notification tells the container that the mouse was clicked inside a margin that was marked as sensitive (see SCI_SETMARGINSENSITIVEN). This can be used to + perform folding or to place breakpoints. The following SCNotification fields are + used:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldUsage
modifiersThe appropriate combination of SCI_SHIFT, + SCI_CTRL and SCI_ALT to indicate the keys that were held down + at the time of the margin click.
positionThe position of the start of the line in the document that corresponds + to the margin click.
marginThe margin number that was clicked.
+ +

SCN_NEEDSHOWN
+ Scintilla has determined that a range of lines that is currently invisible should be made + visible. An example of where this may be needed is if the end of line of a contracted fold + point is deleted. This message is sent to the container in case it wants to make the line + visible in some unusual way such as making the whole document visible. Most containers will + just ensure each line in the range is visible by calling SCI_ENSUREVISIBLE. The position and + length fields of SCNotification indicate the range of the document + that should be made visible. The container code will be similar to the following code + skeleton:

+
+firstLine = SCI_LINEFROMPOSITION(scn.position)
+lastLine = SCI_LINEFROMPOSITION(scn.position+scn.length-1)
+for line = lineStart to lineEnd do SCI_ENSUREVISIBLE(line) next
+
+ +

SCN_PAINTED
+ Painting has just been done. Useful when you want to update some other widgets based on a + change in Scintilla, but want to have the paint occur first to appear more responsive. There is + no other information in SCNotification.

+ +

SCN_USERLISTSELECTION
+ The user has selected an item in a user list. The + SCNotification fields used are:

+ + + + + + + + + + + + + + + + + + + + + + + +
FieldUsage
wParamThis is set to the listType parameter from the SCI_USERLISTSHOW message that + initiated the list.
textThe text of the selection.
+
+
+ + +

SCN_URIDROPPED
+ Only on the GTK+ version. Indicates that the user has dragged a URI such as a file name or Web + address onto Scintilla. The container could interpret this as a request to open the file. The + text field of SCNotification points at the URI text.

+ +

SCN_DWELLSTART
+ SCN_DWELLEND
+ SCN_DWELLSTART is generated when the user keeps the mouse in one position for the + dwell period (see SCI_SETMOUSEDWELLTIME). SCN_DWELLEND is + generated after a SCN_DWELLSTART and the mouse is moved or other activity such as + key press indicates the dwell is over. Both notifications set the same fields in + SCNotification:

+ + + + + + + + + + + + + + + + + + + + + + + +
FieldUsage
positionThis is the nearest position in the document to the position where the + mouse pointer was lingering.
x, yWhere the pointer lingered. The position field is set to + SCI_POSITIONFROMPOINTCLOSE(x, y).
+
+
+ +

SCI_SETMOUSEDWELLTIME
+ SCI_GETMOUSEDWELLTIME
+ These two messages set and get the time the mouse must sit still, in milliseconds, to generate + a SCN_DWELLSTART notification. If + set to SC_TIME_FOREVER, the default, no dwell events are generated.

+ +

SCN_ZOOM
+ This notification is generated when the user zooms the display using the keyboard or the + SCI_SETZOOM method is called. This + notification can be used to recalculate positions, such as the width of the line number margin + to maintain sizes in terms of characters rather than pixels. SCNotification has no + additional information.

+ +

+ SCN_HOTSPOTCLICK
+ SCN_HOTSPOTDOUBLECLICK
+ These notifications are generated when the user clicks or double clicks on + text that is in a style with the hotspot attribute set. + This notification can be used to link to variable definitions or web pages. + The position field is set the text position of the click or + double click and the modifiers field set to the key modifiers + held down in a similar manner to SCN_KEY.

+ +

SCN_CALLTIPCLICK
+ This notification is generated when the user clicks on a calltip. + This notification can be used to display the next function prototype when a + function name is overloaded with different arguments. + The position field is set to 1 if the click is in an up arrow, + 2 if in a down arrow, and 0 if elsewhere.

+ +

SCN_AUTOCSELECTION
+ The user has selected an item in an autocompletion list. The + notification is sent before the selection is inserted. Automatic insertion can be cancelled by sending a + SCI_AUTOCCANCEL message + before returning from the notification. The SCNotification fields used are:

+ + + + + + + + + + + + + + + + + + + + + + +
FieldUsage
lParamThe start position of the word being completed.
textThe text of the selection.
+ +

GTK+

+

On GTK+, the following functions create a Scintilla widget, communicate with it and allow + resources to be released after all Scintilla widgets hace been destroyed.

+ GtkWidget *scintilla_new()
+ void scintilla_set_id(ScintillaObject *sci, uptr_t id)
+ sptr_t scintilla_send_message(ScintillaObject *sci,unsigned int iMessage, uptr_t wParam, sptr_t lParam)
+ void scintilla_release_resources()
+
+ +

GtkWidget *scintilla_new()
+ Create a new Scintilla widget. The returned pointer can be added to a container and displayed in the same way as other + widgets.

+ +

void scintilla_set_id(ScintillaObject *sci, uptr_t id)
+ Set the control ID which will be used in the idFrom field of the NotifyHeader structure of all + notifications for this instance. When an application creates multiple Scintilla widgets, this allows + the source of each notification to be found. The value should be small, preferrably less than 16 bits, + rather than a pointer as some of the functions will only transmit 16 or 32 bits.

+ +

sptr_t scintilla_send_message(ScintillaObject *sci,unsigned int iMessage, uptr_t wParam, sptr_t lParam)
+ The main entry point allows sending any of the messages described in this document.

+ +

void scintilla_release_resources()
+ Call this to free any remaining resources after all the Scintilla widgets have been destroyed.

+ +

Deprecated messages and notifications

+ +

The following messages are currently supported to emulate existing Windows controls, but + they will be removed in future versions of Scintilla. If you use these messages you should + replace them with the Scintilla equivalent.

+
+WM_GETTEXT(int length, char *text)
+WM_SETTEXT(<unused>, const char *text)
+EM_GETLINE(int line, char *text)
+EM_REPLACESEL(<unused>, const char *text)
+EM_SETREADONLY
+EM_GETTEXTRANGE(<unused>, TEXTRANGE *tr)
+WM_CUT
+WM_COPY
+WM_PASTE
+WM_CLEAR
+WM_UNDO
+EM_CANUNDO
+EM_EMPTYUNDOBUFFER
+WM_GETTEXTLENGTH
+EM_GETFIRSTVISIBLELINE
+EM_GETLINECOUNT
+EM_GETMODIFY
+EM_SETMODIFY(bool isModified)
+EM_GETRECT(RECT *rect)
+EM_GETSEL(int *start, int *end)
+EM_EXGETSEL(<unused>, CHARRANGE *cr)
+EM_SETSEL(int start, int end)
+EM_EXSETSEL(<unused>, CHARRANGE *cr)
+EM_GETSELTEXT(<unused>, char *text)
+EM_LINEFROMCHAR(int position)
+EM_EXLINEFROMCHAR(int position)
+EM_LINEINDEX(int line)
+EM_LINELENGTH(int position)
+EM_SCROLL(int line)
+EM_LINESCROLL(int column, int line)
+EM_SCROLLCARET()
+EM_CANPASTE
+EM_CHARFROMPOS(<unused>, POINT *location)
+EM_POSFROMCHAR(int position, POINT *location)
+EM_SELECTIONTYPE
+EM_HIDESELECTION(bool hide)
+EM_FINDTEXT(int flags, FINDTEXTEX *ft)
+EM_FINDTEXTEX(int flags, FINDTEXTEX *ft)
+EM_GETMARGINS
+EM_SETMARGINS(EC_LEFTMARGIN or EC_RIGHTMARGIN or EC_USEFONTINFO, int val)
+EM_FORMATRANGE
+
+ +

The following are features that are only included if you define + INCLUDE_DEPRECATED_FEATURES in Scintilla.h. To ensure future + compatibility you should change them as indicated.

+ +

SCN_POSCHANGED() Deprecated
+ Fired when the user moves the cursor to a different position in the text. Use SCN_UPDATEUI instead.

+ +

SCN_CHECKBRACE Deprecated
+ Either the text or styling of the document has changed or the selection range has changed. + This is replaced by SCN_UPDATEUI. You + can also use SCN_MODIFIED for more + detailed information on text and styling changes,

+ +

Edit messages never supported by Scintilla

+
+EM_GETWORDBREAKPROC EM_GETWORDBREAKPROCEX
+EM_SETWORDBREAKPROC EM_SETWORDBREAKPROCEX
+EM_GETWORDWRAPMODE EM_SETWORDWRAPMODE
+EM_LIMITTEXT EM_EXLIMITTEXT
+EM_SETRECT EM_SETRECTNP
+EM_FMTLINES
+EM_GETHANDLE EM_SETHANDLE
+EM_GETPASSWORDCHAR EM_SETPASSWORDCHAR
+EM_SETTABSTOPS
+EM_FINDWORDBREAK
+EM_GETCHARFORMAT EM_SETCHARFORMAT
+EM_GETOLEINTERFACE EM_SETOLEINTERFACE
+EM_SETOLECALLBACK
+EM_GETPARAFORMAT EM_SETPARAFORMAT
+EM_PASTESPECIAL
+EM_REQUESTRESIZE
+EM_GETBKGNDCOLOR EM_SETBKGNDCOLOR
+EM_STREAMIN EM_STREAMOUT
+EM_GETIMECOLOR EM_SETIMECOLOR
+EM_GETIMEOPTIONS EM_SETIMEOPTIONS
+EM_GETOPTIONS EM_SETOPTIONS
+EM_GETPUNCTUATION EM_SETPUNCTUATION
+EM_GETTHUMB
+EM_GETEVENTMASK
+EM_SETEVENTMASK
+EM_DISPLAYBAND
+EM_SETTARGETDEVICE
+
+ +

Scintilla tries to be a superset of the standard windows Edit and RichEdit controls wherever + that makes sense. As it is not intended for use in a word processor, some edit messages can not + be sensibly handled. Unsupported messages have no effect.

+ +

Building Scintilla

+ +

To build Scintilla or SciTE, see the README file present in both the Scintilla and SciTE + directories. For Windows, GCC 3.2, Borland C++ or Microsoft Visual Studio .NET can be used + for building. There is a make file for building Scintilla but not SciTE with Visual C++ 6 at + scintilla/win32/scintilla_vc6.mak. For GTK+, GCC 3.1 should be used. GTK+ 1.2x and 2.0x are + supported. The version of GTK+ installed should be detected automatically. + When both GTK+ 1 and GTK+ 2 are present, building for GTK+ 1.x requires defining GTK1 + on the command line.

+ +

Static linking

+ +

On Windows, Scintilla is normally used as a dynamic library as a .DLL file. If you want to + link Scintilla directly into your application .EXE or .DLL file, then the + STATIC_BUILD preprocessor symbol should be defined and + Scintilla_RegisterClasses called. STATIC_BUILD prevents compiling the + DllMain function which will conflict with any DllMain defined in your + code. Scintilla_RegisterClasses takes the HINSTANCE of your + application and ensures that the "Scintilla" window class is registered. To make sure that the + right pointing arrow cursor used in the margin is displayed by Scintilla add the + scintilla/win32/Margin.cur file to your application's resources with the ID + IDC_MARGIN which is defined in scintilla/win32/platfromRes.h as + 400.

+ +

Ensuring lexers are linked into Scintilla

+ +

Depending on the compiler and linker used, the lexers may be stripped out. This is most + often caused when building a static library. To ensure the lexers are linked in, the + Scintilla_LinkLexers() function may be called.

+ +

Changing set of lexers

+ +

To change the set of lexers in Scintilla, add and remove lexer source files + (Lex*.cxx) from the scintilla/src directory and run the + src/LexGen.py script from the src directory to update the make files + and KeyWords.cxx. LexGen.py requires Python 2.1 or later. If you do + not have access to Python, you can hand edit KeyWords.cxx in a simple-minded way, + following the patterns of other lexers. The important thing is to include + LINK_LEXER(lmMyLexer); to correspond with the LexerModule + lmMyLexer(...); in your lexer source code.

+ + + diff --git a/doc/Scintilla/ScintillaDownload.html b/doc/Scintilla/ScintillaDownload.html new file mode 100755 index 0000000..c6b9657 --- /dev/null +++ b/doc/Scintilla/ScintillaDownload.html @@ -0,0 +1,70 @@ + + + + + + + + + Download Scintilla + + + + + + + + +
+ Scintilla icon + + Download + Scintilla +
+ + + + +
+ + Windows   + + GTK+/Linux   + +
+

+ Download. +

+

+ The license for using Scintilla or SciTE is similar to that of Python + containing very few restrictions. +

+

+ Release 1.71 +

+

+ Source Code +

+ The source code package contains all of the source code for Scintilla but no binary + executable code and is available in +
    +
  • zip format (720K) commonly used on Windows
  • +
  • tgz format (620K) commonly used on Linux and compatible operating systems
  • +
+ Instructions for building on both Windows and Linux are included in the readme file. +

+ Windows Executable Code +

+ There is no download available containing only the Scintilla DLL. + However, it is included in the SciTE + executable full download as SciLexer.DLL. +

+ SciTE is a good demonstration of Scintilla. +

+

+ Previous versions can be downloaded from the history + page. +

+ + diff --git a/doc/Scintilla/ScintillaHistory.html b/doc/Scintilla/ScintillaHistory.html new file mode 100755 index 0000000..a230271 --- /dev/null +++ b/doc/Scintilla/ScintillaHistory.html @@ -0,0 +1,5296 @@ + + + + + + + + + Scintilla and SciTE + + + + + + + + +
+ Scintilla icon + + Scintilla + and SciTE +
+

+ History of Scintilla and SciTE +

+

+ Contributors +

+

+ Thanks to all the people that have contributed patches, bug reports and suggestions. +

+

+ Source code and documentation have been contributed by +

+
    +
  • Atsuo Ishimoto
  • +
  • Mark Hammond
  • +
  • Francois Le Coguiec
  • +
  • Dale Nagata
  • +
  • Ralf Reinhardt
  • +
  • Philippe Lhoste
  • +
  • Andrew McKinlay
  • +
  • Stephan R. A. Deibel
  • +
  • Hans Eckardt
  • +
  • Vassili Bourdo
  • +
  • Maksim Lin
  • +
  • Robin Dunn
  • +
  • John Ehresman
  • +
  • Steffen Goeldner
  • +
  • Deepak S.
  • +
  • Yann Gaillard
  • +
  • Aubin Paul
  • +
  • Jason Diamond
  • +
  • Ahmad Baitalmal
  • +
  • Paul Winwood
  • +
  • Maxim Baranov
  • +
  • Ragnar Højland
  • +
  • Christian Obrecht
  • +
  • Andreas Neukoetter
  • +
  • Adam Gates
  • +
  • Steve Lhomme
  • +
  • Ferdinand Prantl
  • +
  • Jan Dries
  • +
  • Markus Gritsch
  • +
  • Tahir Karaca
  • +
  • Ahmad Zawawi
  • +
  • Laurent le Tynevez
  • +
  • Walter Braeu
  • +
  • Ashley Cambrell
  • +
  • Garrett Serack
  • +
  • Holger Schmidt
  • +
  • ActiveState
  • +
  • James Larcombe
  • +
  • Alexey Yutkin
  • +
  • Jan Hercek
  • +
  • Richard Pecl
  • +
  • Edward K. Ream
  • +
  • Valery Kondakoff
  • +
  • Smári McCarthy
  • +
  • Clemens Wyss
  • +
  • Simon Steele
  • +
  • Serge A. Baranov
  • +
  • Xavier Nodet
  • +
  • Willy Devaux
  • +
  • David Clain
  • +
  • Brendon Yenson
  • +
  • Vamsi Potluru
  • +
  • Praveen Ambekar
  • +
  • Alan Knowles
  • +
  • Kengo Jinno
  • +
  • Valentin Valchev
  • +
  • Marcos E. Wurzius
  • +
  • Martin Alderson
  • +
  • Robert Gustavsson
  • +
  • José Fonseca
  • +
  • Holger Kiemes
  • +
  • Francis Irving
  • +
  • Scott Kirkwood
  • +
  • Brian Quinlan
  • +
  • Ubi
  • +
  • Michael R. Duerig
  • +
  • Deepak T
  • +
  • Don Paul Beletsky
  • +
  • Gerhard Kalab
  • +
  • Olivier Dagenais
  • +
  • Josh Wingstrom
  • +
  • Bruce Dodson
  • +
  • Sergey Koshcheyev
  • +
  • Chuan-jian Shen
  • +
  • Shane Caraveo
  • +
  • Alexander Scripnik
  • +
  • Ryan Christianson
  • +
  • Martin Steffensen
  • +
  • Jakub Vrána
  • +
  • The Black Horus
  • +
  • Bernd Kreuss
  • +
  • Thomas Lauer
  • +
  • Mike Lansdaal
  • +
  • Yukihiro Nakai
  • +
  • Jochen Tucht
  • +
  • Greg Smith
  • +
  • Steve Schoettler
  • +
  • Mauritius Thinnes
  • +
  • Darren Schroeder
  • +
  • Pedro Guerreiro
  • +
  • Dan Petitt
  • +
  • Biswapesh Chattopadhyay
  • +
  • Kein-Hong Man
  • +
  • Patrizio Bekerle
  • +
  • Nigel Hathaway
  • +
  • Hrishikesh Desai
  • +
  • Sergey Puljajev
  • +
  • Mathias Rauen
  • +
  • Angelo Mandato
  • +
  • Denis Sureau
  • +
  • Kaspar Schiess
  • +
  • Christoph Hösler
  • +
  • João Paulo F Farias
  • +
  • Ron Schofield
  • +
  • Stefan Wosnik
  • +
  • Marius Gheorghe
  • +
  • Naba Kumar
  • +
  • Sean O'Dell
  • +
  • Stefanos Togoulidis
  • +
  • Hans Hagen
  • +
  • Jim Cape
  • +
  • Roland Walter
  • +
  • Brian Mosher
  • +
  • Nicholas Nemtsev
  • +
  • Roy Wood
  • +
  • Peter-Henry Mander
  • +
  • Robert Boucher
  • +
  • Christoph Dalitz
  • +
  • April White
  • +
  • S. Umar
  • +
  • Trent Mick
  • +
  • Filip Yaghob
  • +
  • Avi Yegudin
  • +
  • Vivi Orunitia
  • +
  • Manfred Becker
  • +
  • Dimitris Keletsekis
  • +
  • Yuiga
  • +
  • Davide Scola
  • +
  • Jason Boggs
  • +
  • Reinhold Niesner
  • +
  • Jos van der Zande
  • +
  • Pescuma
  • +
  • Pavol Bosik
  • +
  • Johannes Schmid
  • +
  • Blair McGlashan
  • +
  • Mikael Hultgren
  • +
  • Florian Balmer
  • +
  • Hadar Raz
  • +
  • Herr Pfarrer
  • +
  • Ben Key
  • +
  • Gene Barry
  • +
  • Niki Spahiev
  • +
  • Carsten Sperber
  • +
  • Phil Reid
  • +
  • Iago Rubio
  • +
  • Régis Vaquette
  • +
  • Massimo Corà
  • +
  • Elias Pschernig
  • +
  • Chris Jones
  • +
  • Josiah Reynolds
  • +
  • Robert Roessler rftp.com
  • +
  • Steve Donovan
  • +
  • Jan Martin Pettersen
  • +
  • Sergey Philippov
  • +
  • Borujoa
  • +
  • Michael Owens
  • +
  • Franck Marcia
  • +
  • Massimo Maria Ghisalberti
  • +
  • Frank Wunderlich
  • +
  • Josepmaria Roca
  • +
  • Tobias Engvall
  • +
  • Suzumizaki Kimitaka
  • +
  • Michael Cartmell
  • +
  • Pascal Hurni
  • +
  • Andre
  • +
  • Randy Butler
  • +
  • Georg Ritter
  • +
  • Michael Goffioul
  • +
  • Ben Harper
  • +
  • Adam Strzelecki
  • +
  • Kamen Stanev
  • +
  • Steve Menard
  • +
  • Oliver Yeoh
  • +
  • Eric Promislow
  • +
  • Joseph Galbraith
  • +
  • Jeffrey Ren
  • +
  • Armel Asselin
  • +
  • Jim Pattee
  • +
  • Friedrich Vedder
  • +
  • Sebastian Pipping
  • +
  • Andre Arpin
  • +
  • Stanislav Maslovski
  • +
  • Martin Stone
  • +
  • Fabien Proriol
  • +
  • mimir
  • +
  • Nicola Civran
  • +
+

+ Images used in GTK+ version +

+
    +
  • + + Icons Copyright(C) 1998 by Dean S. Jones
    +
  • +
+

+ Release 1.71 +

+
    +
  • + Released on 21 August 2006. +
  • +
  • + On GTK+ drag and drop defaults to move rather than copy. +
  • +
  • + Double click notification includes line and position. +
  • +
  • + VB lexer bugs fixed for preprocessor directive below a comment or some other states and + to use string not closed style back to the starting quote when there are internal doubled quotes. +
  • +
  • + C++ lexer allows identifiers to contain '$' and non-ASCII characters such as UTF-8. + The '$' character can be disallowed with lexer.cpp.allow.dollars=0. +
  • +
  • + Perl lexer allows UTF-8 identifiers and has some other small improvements. +
  • +
  • + SciTE's $(CurrentWord) uses word.characters.<filepattern> to define the word + rather than a hardcoded list of word characters. +
  • +
  • + SciTE Export as HTML adds encoding information for UTF-8 file and fixes DOCTYPE. +
  • +
  • + SciTE session and .recent files default to the user properties directory rather than global + properties directory. +
  • +
  • + Left and right scroll events handled correctly on GTK+ and horizontal scroll bar has more sensible + distances for page and arrow clicks. +
  • +
  • + SciTE on GTK+ tab bar fixed to work on recent versions of GTK+. +
  • +
  • + On GTK+, if the approximate character set conversion is unavailable, a second attempt is made + without approximations. This may allow keyboard input and paste to work on older systems. +
  • +
  • + SciTE on GTK+ can redefine the Insert key. +
  • +
  • + SciTE scripting interface bug fixed where some string properties could not be changed. +
  • +
+

+ Release 1.70 +

+
    +
  • + Released on 20 June 2006. +
  • +
  • + On GTK+, character set conversion is performed using an option that allows approximate conversions rather + than failures when a character can not be converted. This may lead to similar characters being inserted or + when no similar character is available a '?' may be inserted. +
  • +
  • + On GTK+, the internationalised IM (Input Method) feature is used for all typed input for all character sets. +
  • +
  • + Scintilla has new margin types SC_MARGIN_BACK and SC_MARGIN_FORE that use the default + style's background and foreground colours (normally white and black) as the background to the margin. +
  • +
  • + Scintilla/GTK+ allows file drops on Windows when drop is of type DROPFILES_DND + as well as text/uri-list. +
  • +
  • + Code page can only be set to one of the listed valid values. +
  • +
  • + Text wrapping fixed for cases where insertion was not wide enough to trigger + wrapping before being styled but was after styling. +
  • +
  • + SciTE find marks are removed before printing or exporting to avoid producing incorrect styles. +
  • +
+

+ Release 1.69 +

+
    +
  • + Released on 29 May 2006. +
  • +
  • + SciTE supports z-order based buffer switching on Ctrl+Tab. +
  • +
  • + Translucent support for selection and whole line markers. +
  • +
  • + SciTE may have per-language abbreviations files. +
  • +
  • + Support for Spice language. +
  • +
  • + On GTK+ autocompletion lists are optimised and use correct selection colours. +
  • +
  • + On GTK+ the URI data type is preferred in drag and drop so that applications + will see files dragged from the shell rather than dragging the text of the file name + into the document. +
  • +
  • + Increased number of margins to 5. +
  • +
  • + Basic lexer allows include directive $include: "file name". +
  • +
  • + SQL lexer no longer bases folding on indentation. +
  • +
  • + Line ends are transformed when copied to clipboard on + Windows/GTK+2 as well as Windows/GTK+ 1. +
  • +
  • + Lexing code masks off the indicator bits on the start style before calling the lexer + to avoid confusing the lexer when an application has used an indicator. +
  • +
  • + SciTE savebefore:yes only saves the file when it has been changed. +
  • +
  • + SciTE adds output.initial.hide setting to allow setting the size of the output pane + without it showing initially. +
  • +
  • + SciTE on Windows Go To dialog allows line number with more digits. +
  • +
  • + Bug in HTML lexer fixed where a segment of PHP could switch scripting language + based on earlier text on that line. +
  • +
  • + Memory bug fixed when freeing regions on GTK+. + Other minor bugs fixed on GTK+. +
  • +
  • + Deprecated GTK+ calls in Scintilla replaced with current calls. +
  • +
  • + Fixed a SciTE bug where closing the final buffer, if read-only, left the text present in an + untitled buffer. +
  • +
  • + Bug fixed in bash lexer that prevented folding. +
  • +
  • + Crash fixed in bash lexer when backslash at end of file. +
  • +
  • + Crash on recent releases of GTK+ 2.x avoided by changing default font from X + core font to Pango font "!Sans". +
  • +
  • + Fix for SciTE properties files where multiline properties continued over completely blank lines. +
  • +
  • + Bug fixed in SciTE/GTK+ director interface where more data available than + buffer size. +
  • +
  • + Minor visual fixes to SciTE splitter on GTK+. +
  • +
+

+ Release 1.68 +

+
    +
  • + Released on 9 March 2006. +
  • +
  • + Translucent drawing implemented for caret line and box indicators. +
  • +
  • + Lexer specifically for TCL is much more accurate than reusing C++ lexer. +
  • +
  • + Support for Inno Setup scripts. +
  • +
  • + Support for Opal language. +
  • +
  • + Calltips may use a new style, STYLE_CALLTIP which allows choosing a + different font for calltips. +
  • +
  • + Python lexer styles comments on decorators. +
  • +
  • + HTML lexer refined handling of "?>" and "%>" within server + side scripts. +
  • +
  • + Batch file lexer improved. +
  • +
  • + Eiffel lexer doesn't treat '.' as a name character. +
  • +
  • + Lua lexer handles length operator, #, and hex literals. +
  • +
  • + Properties file lexer has separate style for keys. +
  • +
  • + PL/SQL folding improved. +
  • +
  • + SciTE Replace dialog always searches in forwards direction. +
  • +
  • + SciTE can detect language of file from initial #! line. +
  • +
  • + SciTE on GTK+ supports output.scroll=2 setting. +
  • +
  • + SciTE can perform an import a properties file from the command line. +
  • +
  • + Set of word characters used for regular expression \< and \>. +
  • +
  • + Bug fixed with SCI_COPYTEXT stopping too early. +
  • +
  • + Bug fixed with splitting lines so that all lines are split. +
  • +
  • + SciTE calls OnSwitchFile when closing one buffer causes a switch to another. +
  • +
  • + SciTE bug fixed where properties were being reevaluated without good reason + after running a macro. +
  • +
  • + Crash fixed when clearing document with some lines contracted in word wrap mode. +
  • +
  • + Palette expands as more entries are needed. +
  • +
  • + SCI_POSITIONFROMPOINT returns more reasonable value when close to + last text on a line. +
  • +
  • + On Windows, long pieces of text may be drawn in segments if they fail to draw + as a whole. +
  • +
  • + Bug fixed with bad drawing when some visual changes made inside SCN_UPDATEUI + notification. +
  • +
  • + SciTE bug fixed with groupundo setting. +
  • +
+

+ Release 1.67 +

+
    +
  • + Released on 17 December 2005. +
  • +
  • + Scintilla checks the paint region more accurately when seeing if an area is being + repainted. Platform layer implementations may need to change for this to take + effect. This fixes some drawing and styling bugs. Also optimized some parts of + marker code to only redraw the line of the marker rather than whole of the margin. +
  • +
  • + Quoted identifier style for SQL. SQL folding performed more simply. +
  • +
  • + Ruby lexer improved to better handle here documents and non-ASCII + characters. +
  • +
  • + Lua lexer supports long string and block comment syntax from Lua 5.1. +
  • +
  • + Bash lexer handles here documents better. +
  • +
  • + JavaScript lexing recognises regular expressions more accurately and includes flag + characters in the regular expression style. This is both in JavaScript files and when + JavaScript is embedded in HTML. +
  • +
  • + Scintilla API provided to reveal how many style bits are needed for the + current lexer. +
  • +
  • + Selection duplicate added. +
  • +
  • + Scintilla API for adding a set of markers to a line. +
  • +
  • + DBCS encodings work on Windows 9x. +
  • +
  • + Convention defined for property names to be used by lexers and folders + so they can be automatically discovered and forwarded from containers. +
  • +
  • + Default bookmark in SciTE changed to a blue sphere image. +
  • +
  • + SciTE stores the time of last asking for a save separately for each buffer + which fixes bugs with automatic reloading. +
  • +
  • + On Windows, pasted text has line ends converted to current preference. + GTK+ already did this. +
  • +
  • + Kid template language better handled by HTML lexer by finishing ASP Python + mode when a ?> is found. +
  • +
  • + SciTE counts number of characters in a rectangular selection correctly. +
  • +
  • + 64-bit compatibility improved. One change that may affect user code is that + the notification message header changed to include a pointer-sized id field + to match the current Windows definition. +
  • +
  • + Empty ranges can no longer be dragged. +
  • +
  • + Crash fixed when calls made that use layout inside the painted notification. +
  • +
  • + Bug fixed where Scintilla created pixmap buffers that were too large leading + to failures when many instances used. +
  • +
  • + SciTE sets the directory of a new file to the directory of the currently + active file. +
  • +
  • + SciTE allows choosing a code page for the output pane. +
  • +
  • + SciTE HTML exporter no longer honours monospaced font setting. +
  • +
  • + Line layout cache in page mode caches the line of the caret. An assertion is + now used to ensure that the layout reentrancy problem that caused this + is easier to find. +
  • +
  • + Speed optimized for long lines and lines containing many control characters. +
  • +
  • + Bug fixed in brace matching in DBCS files where byte inside character + is same as brace. +
  • +
  • + Indent command does not indent empty lines. +
  • +
  • + SciTE bug fixed for commands that operate on files with empty extensions. +
  • +
  • + SciTE bug fixed where monospaced option was copied for subsequently opened files. +
  • +
  • + SciTE on Windows bug fixed in the display of a non-ASCII search string + which can not be found. +
  • +
  • + Bugs fixed with nested calls displaying a new calltip while one is already + displayed. +
  • +
  • + Bug fixed when styling PHP strings. +
  • +
  • + Bug fixed when styling C++ continued preprocessor lines. +
  • +
  • + SciTE bug fixed where opening file from recently used list reset choice of + language. +
  • +
  • + SciTE bug fixed when compiled with NO_EXTENSIONS and + closing one file closes the application. +
  • +
  • + SciTE crash fixed for error messages that look like Lua messages but aren't + in the same order. +
  • +
  • + Remaining fold box support deprecated. The symbols SC_FOLDLEVELBOXHEADERFLAG, + SC_FOLDLEVELBOXFOOTERFLAG, SC_FOLDLEVELCONTRACTED, + SC_FOLDLEVELUNINDENT, and SC_FOLDFLAG_BOX are deprecated. +
  • +
+

+ Release 1.66 +

+
    +
  • + Released on 26 August 2005. +
  • +
  • + New, more ambitious Ruby lexer. +
  • +
  • + SciTE Find in Files dialog has options for matching case and whole words which are + enabled when the internal find command is used. +
  • +
  • + SciTE output pane can display automatic completion after "$(" typed. + An initial ">" on a line is ignored when Enter pressed. +
  • +
  • + C++ lexer recognises keywords within line doc comments. It continues styles over line + end characters more consistently so that eolfilled style can be used for preprocessor lines + and line comments. +
  • +
  • + VB lexer improves handling of file numbers and date literals. +
  • +
  • + Lua folder handles repeat until, nested comments and nested strings. +
  • +
  • + POV lexer improves handling of comment lines. +
  • +
  • + AU3 lexer and folder updated. COMOBJ style added. +
  • +
  • + Bug fixed with text display on GTK+ with Pango 1.8. +
  • +
  • + Caret painting avoided when not focused. +
  • +
  • + SciTE on GTK+ handles file names used to reference properties as case-sensitive. +
  • +
  • + SciTE on GTK+ Save As and Export commands set the file name field. + On GTK+ the Export commands modify the file name in the same way as on Windows. +
  • +
  • + Fixed SciTE problem where confirmation was not displaying when closing a file where all + contents had been deleted. +
  • +
  • + Middle click on SciTE tab now closes correct buffer on Windows when tool bar is visible. +
  • +
  • + SciTE bugs fixed where files contained in directory that includes '.' character. +
  • +
  • + SciTE bug fixed where import in user options was reading file from directory of + global options. +
  • +
  • + SciTE calltip bug fixed where single line calltips had arrow displayed incorrectly. +
  • +
  • + SciTE folding bug fixed where empty lines were shown for no reason. +
  • +
  • + Bug fixed where 2 byte per pixel XPM images caused crash although they are still not + displayed. +
  • +
  • + Autocompletion list size tweaked. +
  • +
+

+ Release 1.65 +

+
    +
  • + Released on 1 August 2005. +
  • +
  • + FreeBasic support. +
  • +
  • + SciTE on Windows handles command line arguments + "-" (read standard input into buffer), + "--" (read standard input into output pane) and + "-@" (read file names from standard input and open each). +
  • +
  • + SciTE includes a simple implementation of Find in Files which is used if no find.command is set. +
  • +
  • + SciTE can close tabs with a mouse middle click. +
  • +
  • + SciTE includes a save.all.for.build setting. +
  • +
  • + Folder for MSSQL. +
  • +
  • + Batch file lexer understands more of the syntax and the behaviour of built in commands. +
  • +
  • + Perl lexer handles here docs better; disambiguates barewords, quote-like delimiters, and repetition operators; + handles Pods after __END__; recognises numbers better; and handles some typeglob special variables. +
  • +
  • + Lisp adds more lexical states. +
  • +
  • + PHP allows spaces after <<<. +
  • +
  • + TADS3 has a simpler set of states and recognizes identifiers. +
  • +
  • + Avenue elseif folds better. +
  • +
  • + Errorlist lexer treats lines starting with '+++' and '---' as separate + styles from '+' and '-' as they indicate file names in diffs. +
  • +
  • + SciTE error recogniser handles file paths in extra explanatory lines from MSVC + and in '+++' and '---' lines from diff. +
  • +
  • + Bugs fixed in SciTE and Scintilla folding behaviour when text pasted before + folded text caused unnecessary + unfolding and cutting text could lead to text being irretrievably hidden. +
  • +
  • + SciTE on Windows uses correct font for dialogs and better font for tab bar + allowing better localisation +
  • +
  • + When Windows is used with a secondary monitor before the primary + monitor, autocompletion lists are not forced onto the primary monitor. +
  • +
  • + Scintilla calltip bug fixed where down arrow setting wrong value in notification + if not in first line. SciTE bug fixed where second arrow only shown on multiple line + calltip and was therefore misinterpreting the notification value. +
  • +
  • + Lexers will no longer be re-entered recursively during, for example, fold level setting. +
  • +
  • + Undo of typing in overwrite mode undoes one character at a time rather than requiring a removal + and addition step for each character. +
  • +
  • + EM_EXSETSEL(0,-1) fixed. +
  • +
  • + Bug fixed where part of a rectangular selection was not shown as selected. +
  • +
  • + Autocomplete window size fixed. +
  • +
+

+ Release 1.64 +

+
    +
  • + Released on 6 June 2005. +
  • +
  • + TADS3 support +
  • +
  • + Smalltalk support. +
  • +
  • + Rebol support. +
  • +
  • + Flagship (Clipper / XBase) support. +
  • +
  • + CSound support. +
  • +
  • + SQL enhanced to support SQL*Plus. +
  • +
  • + SC_MARK_FULLRECT margin marker fills the whole marker margin for marked + lines with a colour. +
  • +
  • + Performance improved for some large undo and redo operations and modification flags + added in notifications. +
  • +
  • + SciTE adds command equivalents for fold margin mouse actions. +
  • +
  • + SciTE adds OnUpdateUI to set of events that can be handled by a Lua script. +
  • +
  • + Properties set in Scintilla can be read. +
  • +
  • + GTK+ SciTE exit confirmation adds Cancel button. +
  • +
  • + More accurate lexing of numbers in PHP and Caml. +
  • +
  • + Perl can fold POD and package sections. POD verbatim section style. + Globbing syntax recognized better. +
  • +
  • + Context menu moved slightly on GTK+ so that it will be under the mouse and will + stay open if just clicked rather than held. +
  • +
  • + Rectangular selection paste works the same whichever direction the selection was dragged in. +
  • +
  • + EncodedFromUTF8 handles -1 length argument as documented. +
  • +
  • + Undo and redo can cause SCN_MODIFYATTEMPTRO notifications. +
  • +
  • + Indicators display correctly when they start at the second character on a line. +
  • +
  • + SciTE Export As HTML uses standards compliant CSS. +
  • +
  • + SciTE automatic indentation handles keywords for indentation better. +
  • +
  • + SciTE fold.comment.python property removed as does not work. +
  • +
  • + Fixed problem with character set conversion when pasting on GTK+. +
  • +
  • + SciTE default character set changed from ANSI_CHARSET to DEFAULT_CHARSET. +
  • +
  • + Fixed crash when creating empty autocompletion list. +
  • +
  • + Autocomplete window size made larger under some conditions to make truncation less common. +
  • +
  • + Bug fixed where changing case of a selection did not affect initial character of lines + in multi-byte encodings. +
  • +
  • + Bug fixed where rectangular selection not displayed after Alt+Shift+Click. +
  • +
+

+ Release 1.63 +

+
    +
  • + Released on 4 April 2005. +
  • +
  • + Autocompletion on Windows changed to use popup window, be faster, + allow choice of maximum width and height, and to highlight only the text of the + selected item rather than both the text and icon if any. +
  • +
  • + Extra items can be added to the context menu in SciTE. +
  • +
  • + Character wrap mode in Scintilla helps East Asian languages. +
  • +
  • + Lexer added for Haskell. +
  • +
  • + Objective Caml support. +
  • +
  • + BlitzBasic and PureBasic support. +
  • +
  • + CSS support updated to handle CSS2. +
  • +
  • + C++ lexer is more selective about document comment keywords. +
  • +
  • + AutoIt 3 lexer improved. +
  • +
  • + Lua lexer styles end of line characters on comment and preprocessor + lines so that the eolfilled style can be applied to them. +
  • +
  • + NSIS support updated for line continuations, box comments, SectionGroup and + PageEx, and with more up-to-date properties. +
  • +
  • + Clarion lexer updated to perform folding and have more styles. +
  • +
  • + SQL lexer gains second set of keywords. +
  • +
  • + Errorlist lexer recognises Borland Delphi error messages. +
  • +
  • + Method added for determining number of visual lines occupied by a document + line due to wrapping. +
  • +
  • + Sticky caret mode does not modify the preferred caret x position when typing + and may be useful for typing columns of text. +
  • +
  • + Dwell end notification sent when scroll occurs. +
  • +
  • + On GTK+, Scintilla requisition height is screen height rather than large fixed value. +
  • +
  • + Case insensitive autocompletion prefers exact case match. +
  • +
  • + SCI_PARADOWN and SCI_PARAUP treat lines containing only white + space as empty and handle text hidden by folding. +
  • +
  • + Scintilla on Windows supports WM_PRINTCLIENT although there are some + limitations. +
  • +
  • + SCN_AUTOCSELECTION notification sent when user selects from autoselection list. +
  • +
  • + SciTE's standard properties file sets buffers to 10, uses Pango fonts on GTK+ and + has dropped several languages to make the menu fit on screen. +
  • +
  • + SciTE's encoding cookie detection loosened so that common XML files will load + in UTF-8 if that is their declared encoding. +
  • +
  • + SciTE on GTK+ changes menus and toolbars to not be detachable unless turned + on with a property. Menus no longer tear off. The toolbar may be set to use the + default theme icons rather than SciTE's set. Changed key for View | End of Line + because of a conflict. Language menu can contain more items. +
  • +
  • + SciTE on GTK+ 2.x allows the height and width of the file open file chooser to + be set, for the show hidden files check box to be set from an option and for it + to be opened in the directory of the current file explicitly. Enter key works in + save chooser. +
  • +
  • + Scintilla lexers should no longer see bits in style bytes that are outside the set + they modify so should be able to correctly lex documents where the container + has used indicators. +
  • +
  • + SciTE no longer asks to save before performing a revert. +
  • +
  • + SciTE director interface adds a reloadproperties command to reload properties + from files. +
  • +
  • + Allow build on CYGWIN platform. +
  • +
  • + Allow use from LccWin compiler. +
  • +
  • + SCI_COLOURISE for SCLEX_CONTAINER causes a + SCN_STYLENEEDED notification. +
  • +
  • + Bugs fixed in lexing of HTML/ASP/JScript. +
  • +
  • + Fix for folding becoming confused. +
  • +
  • + On Windows, fixes for Japanese Input Method Editor and for 8 bit Katakana + characters. +
  • +
  • + Fixed buffer size bug avoided when typing long words by making buffer bigger. +
  • +
  • + Undo after automatic indentation more sensible. +
  • +
  • + SciTE menus on GTK+ uses Shift and Ctrl rather than old style abbreviations. +
  • +
  • + SciTE full screen mode on Windows calculates size more correctly. +
  • +
  • + SciTE on Windows menus work better with skinning applications. +
  • +
  • + Searching bugs fixed. +
  • +
  • + Colours reallocated when changing image using SCI_REGISTERIMAGE. +
  • +
  • + Caret stays visible when Enter held down. +
  • +
  • + Undo of automatic indentation more reasonable. +
  • +
  • + High processor usage fixed in background wrapping under some + circumstances. +
  • +
  • + Crashing bug fixed on AMD64. +
  • +
  • + SciTE crashing bug fixed when position.height or position.width not set. +
  • +
  • + Crashing bug on GTK+ fixed when setting cursor and window is NULL. +
  • +
  • + Crashing bug on GTK+ preedit window fixed. +
  • +
  • + SciTE crashing bug fixed in incremental search on Windows ME. +
  • +
  • + SciTE on Windows has a optional find and replace dialogs that can search through + all buffers and search within a particular style number. +
  • +
+

+ Release 1.62 +

+
    +
  • + Released on 31 October 2004. +
  • +
  • + Lexer added for ASN.1. +
  • +
  • + Lexer added for VHDL. +
  • +
  • + On Windows, an invisible system caret is used to allow screen readers to determine + where the caret is. The visible caret is still drawn by the painting code. +
  • +
  • + On GTK+, Scintilla has methods to read the target as UTF-8 and to convert + a string from UTF-8 to the document encoding. This eases integration with + containers that use the UTF-8 encoding which is the API encoding for GTK+ 2. +
  • +
  • + SciTE on GTK+2 and Windows NT/2000/XP allows search and replace of Unicode text. +
  • +
  • + SciTE calltips allow setting the characters used to start and end parameter lists and + to separate parameters. +
  • +
  • + FindColumn method converts a line and column into a position, taking into account + tabs and multi-byte characters. +
  • +
  • + On Windows, when Scintilla copies text to the clipboard as Unicode, it avoids + adding an ANSI copy as the system will automatically convert as required in + a context-sensitive manner. +
  • +
  • + SciTE indent.auto setting automatically determines indent.size and use.tabs from + document contents. +
  • +
  • + SciTE defines a CurrentMessage property that holds the most recently selected + output pane message. +
  • +
  • + SciTE Lua scripting enhanced with +
      +
    • A Lua table called 'buffer' is associated with each buffer and can be used to + maintain buffer-specific state.
    • +
    • A 'scite' object allows interaction with the application such as opening + files from script.
    • +
    • Dynamic properties can be reset by assigning nil to a given key in + the props table.
    • +
    • An 'OnClear' event fires whenever properties and extension scripts are + about to be reloaded.
    • +
    • On Windows, loadlib is enabled and can be used to access Lua + binary modules / DLLs.
    +
  • +
  • + SciTE Find in Files on Windows can be used in a modeless way and gains a '..' + button to move up to the parent directory. It is also wider so that longer paths + can be seen. +
  • +
  • + Close buttons added to dialogs in SciTE on Windows. +
  • +
  • + SciTE on GTK+ 2 has a "hidden files" check box in file open dialog. +
  • +
  • + SciTE use.monospaced setting removed. More information in the + FAQ. +
  • +
  • + APDL lexer updated with more lexical classes +
  • +
  • + AutoIt3 lexer updated. +
  • +
  • + Ada lexer fixed to support non-ASCII text. +
  • +
  • + Cpp lexer now only matches exactly three slashes as starting a doc-comment so that + lines of slashes are seen as a normal comment. + Line ending characters are appear in default style on preprocessor and single line + comment lines. +
  • +
  • + CSS lexer updated to support CSS2 including second set of keywords. +
  • +
  • + Errorlist lexer now understands Java stack trace lines. +
  • +
  • + SciTE's handling of HTML Tidy messages jumps to column as well as line indicated. +
  • +
  • + Lisp lexer allows multiline strings. +
  • +
  • + Lua lexer treats .. as an operator when between identifiers. +
  • +
  • + PHP lexer handles 'e' in numerical literals. +
  • +
  • + PowerBasic lexer updated for macros and optimised. +
  • +
  • + Properties file folder changed to leave lines before a header at the base level + and thus avoid a vertical line when using connected folding symbols. +
  • +
  • + GTK+ on Windows version uses Alt for rectangular selection to be compatible with + platform convention. +
  • +
  • + SciTE abbreviations file moved from system directory to user directory + so each user can have separate abbreviations. +
  • +
  • + SciTE on GTK+ has improved .desktop file and make install support that may + lead to better integration with system shell. +
  • +
  • + Disabling of themed background drawing on GTK+ extended to all cases. +
  • +
  • + SciTE date formatting on Windows performed with the user setting rather than the + system setting. +
  • +
  • + GTK+ 2 redraw while scrolling fixed. +
  • +
  • + Recursive property definitions are safer, avoiding expansion when detected. +
  • +
  • + SciTE thread synchronization for scripts no longer uses HWND_MESSAGE + so is compatible with older versions of Windows. + Other Lua scripting bugs fixed. +
  • +
  • + SciTE on Windows localisation of menu accelerators changed to be compatible + with alternative UI themes. +
  • +
  • + SciTE on Windows full screen mode now fits better when menu different height + to title bar height. +
  • +
  • + SC_MARK_EMPTY marker is now invisible and does not change the background + colour. +
  • +
  • + Bug fixed in HTML lexer to allow use of <?xml in strings in scripts without + triggering xml mode. +
  • +
  • + Bug fixed in SciTE abbreviation expansion that could break indentation or crash. +
  • +
  • + Bug fixed when searching for a whole word string that ends one character before + end of document. +
  • +
  • + Drawing bug fixed when indicators drawn on wrapped lines. +
  • +
  • + Bug fixed when double clicking a hotspot. +
  • +
  • + Bug fixed where autocompletion would remove typed text if no match found. +
  • +
  • + Bug fixed where display does not scroll when inserting in long wrapped line. +
  • +
  • + Bug fixed where SCI_MARKERDELETEALL would only remove one of the markers + on a line that contained multiple markers with the same number. +
  • +
  • + Bug fixed where markers would move when converting line endings. +
  • +
  • + Bug fixed where SCI_LINEENDWRAP would move too far when line ends are visible. +
  • +
  • + Bugs fixed where calltips with unicode or other non-ASCII text would display + incorrectly. +
  • +
  • + Bug fixed in determining if at save point after undoing from save point and then + performing changes. +
  • +
  • + Bug fixed on GTK+ using unsupported code pages where extraneous text could + be drawn. +
  • +
  • + Bug fixed in drag and drop code on Windows where dragging from SciTE to + Firefox could hang both applications. +
  • +
  • + Crashing bug fixed on GTK+ when no font allocation succeeds. +
  • +
  • + Crashing bug fixed when autocompleting word longer than 1000 characters. +
  • +
  • + SciTE crashing bug fixed when both Find and Replace dialogs shown by disallowing + this situation. +
  • +
+

+ Release 1.61 +

+
    +
  • + Released on 29 May 2004. +
  • +
  • + Improvements to selection handling on GTK+. +
  • +
  • + SciTE on GTK+ 2.4 uses the improved file chooser which allows + file extension filters, multiple selection, and remembers favourite + directories. +
  • +
  • + SciTE Load Session and Save Session commands available on GTK+. +
  • +
  • + SciTE lists Lua Startup Script in Options menu when loaded. +
  • +
  • + In SciTE, OnUserListSelection can be implemented in Lua. +
  • +
  • + SciTE on Windows has a context menu on the file tabs. +
  • +
  • + SQL lexer allows '#' comments and optionally '\' quoting inside strings. +
  • +
  • + Mssql lexer improved. +
  • +
  • + AutoIt3 lexer updated. +
  • +
  • + Perl lexer recognizes regular expression use better. +
  • +
  • + Errorlist lexer understands Lua tracebacks and copes with findstr + output for file names that end with digits. +
  • +
  • + Drawing of lines on GTK+ improved and made more like Windows + without final point. +
  • +
  • + SciTE on GTK+ uses a high resolution window icon. +
  • +
  • + SciTE can be set to warn before loading files larger than a particular size. +
  • +
  • + SciTE Lua scripting bugs fixed included a crashing bug when using + an undefined function name that would go before first actual name. +
  • +
  • + SciTE bug fixed where a modified buffer was not saved if it was + the last buffer and was not current when the New command used. +
  • +
  • + SciTE monofont mode no longer affects line numbers. +
  • +
  • + Crashing bug in SciTE avoided by not allowing both the Find and Replace + dialogs to be visible at one time. +
  • +
  • + Crashing bug in SciTE fixed when Lua scripts were being run + concurrently. +
  • +
  • + Bug fixed that caused incorrect line number width in SciTE. +
  • +
  • + PHP folding bug fixed. +
  • +
  • + Regression fixed when setting word characters to not include + some of the standard word characters. +
  • +
+

+ Release 1.60 +

+
    +
  • + Released on 1 May 2004. +
  • +
  • + SciTE can be scripted using the Lua programming language. +
  • +
  • + command.mode is a better way to specify tool command options in SciTE. +
  • +
  • + Continuation markers can be displayed so that you can see which lines are wrapped. +
  • +
  • + Lexer for Gui4Cli language. +
  • +
  • + Lexer for Kix language. +
  • +
  • + Lexer for Specman E language. +
  • +
  • + Lexer for AutoIt3 language. +
  • +
  • + Lexer for APDL language. +
  • +
  • + Lexer for Bash language. Also reasonable for other Unix shells. +
  • +
  • + SciTE can load lexers implemented in external shared libraries. +
  • +
  • + Perl treats "." not as part of an identifier and interprets '/' and '->' + correctly in more circumstances. +
  • +
  • + PHP recognises variables within strings. +
  • +
  • + NSIS has properties "nsis.uservars" and "nsis.ignorecase". +
  • +
  • + MSSQL lexer adds keyword list for operators and stored procedures, + defines '(', ')', and ',' as operators and changes some other details. +
  • +
  • + Input method preedit window on GTK+ 2 may support some Asian languages. +
  • +
  • + Platform interface adds an extra platform-specific flag to Font::Create. + Used on wxWidgets to choose antialiased text display but may be used for + any task that a platform needs. +
  • +
  • + OnBeforeSave method added to Extension interface. +
  • +
  • + Scintilla methods that return strings can be called with a NULL pointer + to find out how long the string should be. +
  • +
  • + Visual Studio .NET project file now in VS .NET 2003 format so can not be used + directly in VS .NET 2002. +
  • +
  • + Scintilla can be built with GTK+ 2 on Windows. +
  • +
  • + Updated RPM spec for SciTE on GTK+. +
  • +
  • + GTK+ makefile for SciTE allows selection of destination directory, creates destination + directories and sets file modes and owners better. +
  • +
  • + Tab indents now go to next tab multiple rather than add tab size. +
  • +
  • + SciTE abbreviations now use the longest possible match rather than the shortest. +
  • +
  • + Autocompletion does not remove prefix when actioned with no choice selected. +
  • +
  • + Autocompletion cancels when moving beyond the start position, not at the start position. +
  • +
  • + SciTE now shows only calltips for functions that match exactly, not + those that match as a prefix. +
  • +
  • + SciTE can repair box comment sections where some lines were added without + the box comment middle line prefix. +
  • +
  • + Alt+ works in user.shortcuts on Windows. +
  • +
  • + SciTE on GTK+ enables replace in selection for rectangular selections. +
  • +
  • + Key bindings for command.shortcut implemented in a way that doesn't break + when the menus are localised. +
  • +
  • + Drawing of background on GTK+ faster as theme drawing disabled. +
  • +
  • + On GTK+, calltips are moved back onto the screen if they extend beyond the screen bounds. +
  • +
  • + On Windows, the Scintilla object is destroyed on WM_NCDESTROY rather than + WM_DESTROY which arrives earlier. This fixes some problems when Scintilla was subclassed. +
  • +
  • + The zorder switching feature removed due to number of crashing bugs. +
  • +
  • + Code for XPM images made more robust. +
  • +
  • + Bug fixed with primary selection on GTK+. +
  • +
  • + On GTK+ 2, copied or cut text can still be pasted after the Scintilla widget is destroyed. +
  • +
  • + Styling change not visible problem fixed when line was cached. +
  • +
  • + Bug in SciTE on Windows fixed where clipboard commands stopped working. +
  • +
  • + Crashing bugs in display fixed in line layout cache. +
  • +
  • + Crashing bug may be fixed on AMD64 processor on GTK+. +
  • +
  • + Rare hanging crash fixed in Python lexer. +
  • +
  • + Display bugs fixed with DBCS characters on GTK+. +
  • +
  • + Autocompletion lists on GTK+ 2 are not sorted by the ListModel as the + contents are sorted correctly by Scintilla. +
  • +
  • + SciTE fixed to not open extra untitled buffers with check.if.already.open. +
  • +
  • + Sizing bug fixed on GTK+ when window resized while unmapped. +
  • +
  • + Text drawing crashing bug fixed on GTK+ with non-Pango fonts and long strings. +
  • +
  • + Fixed some issues if characters are unsigned. +
  • +
  • + Fixes in NSIS support. +
  • +
+

+ Release 1.59 +

+
    +
  • + Released on 19 February 2004. +
  • +
  • + SciTE Options and Language menus reduced in length by commenting + out some languages. Languages can be enabled by editing the global + properties file. +
  • +
  • + Verilog language supported. +
  • +
  • + Lexer for Microsoft dialect of SQL. SciTE properties file available from extras page. +
  • +
  • + Perl lexer disambiguates '/' better. +
  • +
  • + NSIS lexer improved with a lexical class for numbers, option for ignoring case + of keywords, and folds only occurring when folding keyword first on line. +
  • +
  • + PowerBasic lexer improved with styles for constants and assembler and + folding improvements. +
  • +
  • + On GTK+, input method support only invoked for Asian languages and not + European languages as the old European keyboard code works better. +
  • +
  • + Scintilla can be requested to allocate a certain amount and so avoid repeated + reallocations and memory inefficiencies. SciTE uses this and so should require + less memory. +
  • +
  • + SciTE's "toggle current fold" works when invoked on child line as well as + fold header. +
  • +
  • + SciTE output pane scrolling can be set to not scroll back to start after + completion of command. +
  • +
  • + SciTE has a $(SessionPath) property. +
  • +
  • + SciTE on Windows can use VK_* codes for keys in user.shortcuts. +
  • +
  • + Stack overwrite bug fixed in SciTE's command to move to the end of a + preprocessor conditional. +
  • +
  • + Bug fixed where vertical selection appeared to select a different set of characters + then would be used by, for example, a copy. +
  • +
  • + SciTE memory leak fixed in fold state remembering. +
  • +
  • + Bug fixed where changing the style of some text outside the + standard StyleNeeded notification would not be visible. +
  • +
  • + On GTK+ 2 g_iconv is used in preference to iconv, as it is provided by GTK+ + so should avoid problems finding the iconv library. +
  • +
  • + On GTK+ fixed a style reference count bug. +
  • +
  • + Memory corruption bug fixed with GetSelText. +
  • +
  • + On Windows Scintilla deletes memory on WM_NCDESTROY rather than + the earlier WM_DESTROY to avoid problems when the window is subclassed. +
  • +
+

+ Release 1.58 +

+
    +
  • + Released on 11 January 2004. +
  • +
  • + Method to discover the currently highlighted element in an autocompletion list. +
  • +
  • + On GTK+, the lexers are now included in the scintilla.a library file. This + will require changes to the make files of dependent projects. +
  • +
  • + Octave support added alongside related Matlab language and Matlab support improved. +
  • +
  • + VB lexer gains an unterminated string state and 4 sets of keywords. +
  • +
  • + Ruby lexer handles $' correctly. +
  • +
  • + Error line handling improved for FORTRAN compilers from Absoft and Intel. +
  • +
  • + International input enabled on GTK+ 2 although there is no way to choose an + input method. +
  • +
  • + MultiplexExtension in SciTE allows multiple extensions to be used at once. +
  • +
  • + Regular expression replace interprets backslash expressions \a, \b, \f, \n, \r, \t, + and \v in the replacement value. +
  • +
  • + SciTE Replace dialog displays number of replacements made when Replace All or + Replace in Selection performed. +
  • +
  • + Localisation files may contain a translation.encoding setting which is used + on GTK+ 2 to automatically reencode the translation to UTF-8 so it will be + the localised text will be displayed correctly. +
  • +
  • + SciTE on GTK+ implements check.if.already.open. +
  • +
  • + Make files for Mac OS X made more robust. +
  • +
  • + Performance improved in SciTE when switching buffers when there + is a rectangular selection. +
  • +
  • + Fixed failure to display some text when wrapped. +
  • +
  • + SciTE crashes from Ctrl+Tab buffer cycling fixed. + May still be some rare bugs here. +
  • +
  • + Crash fixed when decoding an error message that appears similar to a + Borland error message. +
  • +
  • + Fix to auto-scrolling allows containers to implement enhanced double click selection. +
  • +
  • + Hang fixed in idle word wrap. +
  • +
  • + Crash fixed in hotspot display code.. +
  • +
  • + SciTE on Windows Incremental Search no longer moves caret back. +
  • +
  • + SciTE hang fixed when performing a replace with a find string that + matched zero length strings such as ".*". +
  • +
  • + SciTE no longer styles the whole file when saving buffer fold state + as that was slow. +
  • +
+

+ Release 1.57 +

+
    +
  • + Released on 27 November 2003. +
  • +
  • + SciTE remembers folding of each buffer. +
  • +
  • + Lexer for Erlang language. +
  • +
  • + Scintilla allows setting the set of white space characters. +
  • +
  • + Scintilla has 'stuttered' page movement commands to first move + to top or bottom within current visible lines before scrolling. +
  • +
  • + Scintilla commands for moving to end of words. +
  • +
  • + Incremental line wrap enabled on Windows. +
  • +
  • + SciTE PDF exporter produces output that is more compliant with reader + applications, is smaller and allows more configuration. + HTML exporter optimizes size of output files. +
  • +
  • + SciTE defines properties PLAT_WINNT and PLAT_WIN95 on the + corresponding platforms. +
  • +
  • + SciTE can adjust the line margin width to fit the largest line number. + The line.numbers property is split between line.margin.visible and + line.margin.width. +
  • +
  • + SciTE on GTK+ allows user defined menu accelerators. + Alt can be included in user.shortcuts. +
  • +
  • + SciTE Language menu can have items commented out. +
  • +
  • + SciTE on Windows Go to dialog allows choosing a column number as + well as a line number. +
  • +
  • + SciTE on GTK+ make file uses prefix setting more consistently. +
  • +
  • + Bug fixed that caused word wrapping to fail to display all text. +
  • +
  • + Crashing bug fixed in GTK+ version of Scintilla when using GDK fonts + and opening autocompletion. +
  • +
  • + Bug fixed in Scintilla SCI_GETSELTEXT where an extra NUL + was included at end of returned string +
  • +
  • + Crashing bug fixed in SciTE z-order switching implementation. +
  • +
  • + Hanging bug fixed in Perl lexer. +
  • +
  • + SciTE crashing bug fixed for using 'case' without argument in style definition. +
  • +
+

+ Release 1.56 +

+
    +
  • + Released on 25 October 2003. +
  • +
  • + Rectangular selection can be performed using the keyboard. + Greater programmatic control over rectangular selection. + This has caused several changes to key bindings. +
  • +
  • + SciTE Replace In Selection works on rectangular selections. +
  • +
  • + Improved lexer for TeX, new lexer for Metapost and other support for these + languages. +
  • +
  • + Lexer for PowerBasic. +
  • +
  • + Lexer for Forth. +
  • +
  • + YAML lexer improved to include error styling. +
  • +
  • + Perl lexer improved to correctly handle more cases. +
  • +
  • + Assembler lexer updated to support single-quote strings and fix some + problems. +
  • +
  • + SciTE on Windows can switch between buffers in order of use (z-order) rather + than static order. +
  • +
  • + SciTE supports adding an extension for "Open Selected Filename". + The openpath setting works on GTK+. +
  • +
  • + SciTE can Export as XML. +
  • +
  • + SciTE $(SelHeight) variable gives a more natural result for empty and whole line + selections. +
  • +
  • + Fixes to wrapping problems, such as only first display line being visible in some + cases. +
  • +
  • + Fixes to hotspot to only highlight when over the hotspot, only use background + colour when set and option to limit hotspots to a single line. +
  • +
  • + Small fixes to FORTRAN lexing and folding. +
  • +
  • + SQL lexer treats single quote strings as a separate class to double quote strings.. +
  • +
  • + Scintilla made compatible with expectations of container widget in GTK+ 2.3. +
  • +
  • + Fix to strip out pixmap ID when automatically choosing from an autocompletion + list with only one element. +
  • +
  • + SciTE bug fixed where UTF-8 files longer than 128K were gaining more than one + BOM. +
  • +
  • + Crashing bug fixed in SciTE on GTK+ where using "Stop Executing" twice leads + to all applications exiting. +
  • +
  • + Bug fixed in autocompletion scrolling on GTK+ 2 with a case sensitive list. + The ListBox::Sort method is no longer needed or available so platform + maintainers should remove it. +
  • +
  • + SciTE check.if.already.open setting removed from GTK+ version as unmaintained. +
  • +
+

+ Release 1.55 +

+
    +
  • + Released on 25 September 2003. +
  • +
  • + Fix a crashing bug in indicator display in Scintilla. +
  • +
  • + GTK+ version now defaults to building for GTK+ 2 rather than 1. +
  • +
  • + Mingw make file detects compiler version and avoids options + that are cause problems for some versions. +
  • +
  • + Large performance improvement on GTK+ 2 for long lines. +
  • +
  • + Incremental line wrap on GTK+. +
  • +
  • + International text entry works much better on GTK+ with particular + improvements for Baltic languages and languages that use 'dead' accents. + NUL key events such as those generated by some function keys, ignored. +
  • +
  • + Unicode clipboard support on GTK+. +
  • +
  • + Indicator type INDIC_BOX draws a rectangle around the text. +
  • +
  • + Clarion language support. +
  • +
  • + YAML language support. +
  • +
  • + MPT LOG language support. +
  • +
  • + On Windows, SciTE can switch buffers based on activation order rather + than buffer number. +
  • +
  • + SciTE save.on.deactivate saves all buffers rather than just the current buffer. +
  • +
  • + Lua lexer handles non-ASCII characters correctly. +
  • +
  • + Error lexer understands Borland errors with pathnames that contain space. +
  • +
  • + On GTK+ 2, autocompletion uses TreeView rather than deprecated CList. +
  • +
  • + SciTE autocompletion removed when expand abbreviation command used. +
  • +
  • + SciTE calltips support overloaded functions. +
  • +
  • + When Save fails in SciTE, choice offered to Save As. +
  • +
  • + SciTE message boxes on Windows may be moved to front when needed. +
  • +
  • + Indicators drawn correctly on wrapped lines. +
  • +
  • + Regular expression search no longer matches characters with high bit + set to characters without high bit set. +
  • +
  • + Hang fixed in backwards search in multi byte character documents. +
  • +
  • + Hang fixed in SciTE Mark All command when wrap around turned off. +
  • +
  • + SciTE Incremental Search no longer uses hot keys on Windows. +
  • +
  • + Calltips draw non-ASCII characters correctly rather than as arrows. +
  • +
  • + SciTE crash fixed when going to an error message with empty file name. +
  • +
  • + Bugs fixed in XPM image handling code. +
  • +
+

+ Release 1.54 +

+
    +
  • + Released on 12 August 2003. +
  • +
  • + SciTE on GTK+ 2.x can display a tab bar. +
  • +
  • + SciTE on Windows provides incremental search. +
  • +
  • + Lexer for PostScript. +
  • +
  • + Lexer for the NSIS scripting language. +
  • +
  • + New lexer for POV-Ray Scene Description Language + replaces previous implementation. +
  • +
  • + Lexer for the MMIX Assembler language. +
  • +
  • + Lexer for the Scriptol language. +
  • +
  • + Incompatibility: SQL keywords are specified in lower case rather than upper case. + SQL lexer allows double quoted strings. +
  • +
  • + Pascal lexer: character constants that start with '#' understood, + '@' only allowed within assembler blocks, + '$' can be the start of a number, + initial '.' in 0..constant not treated as part of a number, + and assembler blocks made more distinctive. +
  • +
  • + Lua lexer allows '.' in keywords. + Multi-line strings and comments can be folded. +
  • +
  • + CSS lexer handles multiple psuedoclasses. +
  • +
  • + Properties file folder works for INI file format. +
  • +
  • + Hidden indicator style allows the container to mark text within Scintilla + without there being any visual effect. +
  • +
  • + SciTE does not prompt to save changes when the buffer is empty and untitled. +
  • +
  • + Modification notifications caused by SCI_INSERTSTYLEDSTRING + now include the contents of the insertion. +
  • +
  • + SCI_MARKERDELETEALL deletes all the markers on a line + rather than just the first match. +
  • +
  • + Better handling of 'dead' accents on GTK+ 2 for languages + that use accented characters. +
  • +
  • + SciTE now uses value of output.vertical.size property. +
  • +
  • + Crash fixed in SciTE autocompletion on long lines. +
  • +
  • + Crash fixed in SciTE comment command on long lines. +
  • +
  • + Bug fixed with backwards regular expression search skipping + every second match. +
  • +
  • + Hang fixed with regular expression replace where both target and replacement were empty. +
  • +
+

+ Release 1.53 +

+
    +
  • + Released on 16 May 2003. +
  • +
  • + On GTK+ 2, encodings other than ASCII, Latin1, and Unicode are + supported for both display and input using iconv. +
  • +
  • + External lexers supported on GTK+/Linux. + External lexers must now be explicitly loaded with SCI_LOADLEXERLIBRARY + rather than relying upon a naming convention and automatic loading. +
  • +
  • + Support of Lout typesetting language. +
  • +
  • + Support of E-Scripts language used in the POL Ultima Online Emulator. +
  • +
  • + Scrolling and drawing performance on GTK+ enhanced, particularly for GTK+ 2.x + with an extra window for the text area avoiding conflicts with the scroll bars. +
  • +
  • + CopyText and CopyRange methods in Scintilla allow container to + easily copy to the system clipboard. +
  • +
  • + Line Copy command implemented and bound to Ctrl+Shift+T. +
  • +
  • + Scintilla APIs PositionBefore and PositionAfter can be used to iterate through + a document taking into account the encoding and multi-byte characters. +
  • +
  • + C++ folder can fold on the "} else {" line of an if statement by setting + fold.at.else property to 1. +
  • +
  • + C++ lexer allows an extra set of keywords. +
  • +
  • + Property names and thus abbreviations may be non-ASCII. +
  • +
  • + Removed attempt to load a file when setting properties that was + part of an old scripting experiment. +
  • +
  • + SciTE no longer warns about a file not existing when opening + properties files from the Options menu as there is a good chance + the user wants to create one. +
  • +
  • + Bug fixed with brace recognition in multi-byte encoded files where a partial + character matched a brace byte. +
  • +
  • + More protection against infinite loops or recursion with recursive property definitions. +
  • +
  • + On Windows, cursor will no longer disappear over margins in custom builds when + cursor resource not present. The Windows default cursor is displayed instead. +
  • +
  • + load.on.activate fixed in SciTE as was broken in 1.52. +
  • +
+

+ Release 1.52 +

+
    +
  • + Released on 17 April 2003. +
  • +
  • + Pango font support on GTK+ 2. + Unicode input improved on GTK+ 2. +
  • +
  • + Hotspot style implemented in Scintilla. +
  • +
  • + Small up and down arrows can be displayed in calltips and the container + is notified when the mouse is clicked on a calltip. + Normal and selected calltip text colours can be set. +
  • +
  • + POSIX compatibility flag in Scintilla regular expression search + interprets bare ( and ) as tagged sections. +
  • +
  • + Error message lexer tightened to yield fewer false matches. + Recognition of Lahey and Intel FORTRAN error formats. +
  • +
  • + Scintilla keyboard commands for moving to start and end of + screen lines rather than document lines, unless already there + where these keys move to the start or end of the document line. +
  • +
  • + Line joining command. +
  • +
  • + Lexer for POV-Ray. +
  • +
  • + Calltips on Windows are no longer clipped by the parent window. +
  • +
  • + Autocompletion lists are cancelled when focus leaves their parent window. +
  • +
  • + Move to next/previous empty line delimited paragraph key commands. +
  • +
  • + SciTE hang fixed with recursive property definitions by placing limit + on number of substitutions performed. +
  • +
  • + SciTE Export as PDF reenabled and works. +
  • +
  • + Added loadsession: command line command to SciTE. +
  • +
  • + SciTE option to quit application when last document closed. +
  • +
  • + SciTE option to ask user if it is OK to reload a file that has been + modified outside SciTE. +
  • +
  • + SciTE option to automatically save before running particular command tools + or to ask user or to not save. +
  • +
  • + SciTE on Windows 9x will write a Ctrl+Z to the process input pipe before + closing the pipe when running tool commands that take input. +
  • +
  • + Added a manifest resource to SciTE on Windows to enable Windows XP + themed UI. +
  • +
  • + SciTE calltips handle nested calls and other situations better. +
  • +
  • + CSS lexer improved. +
  • +
  • + Interface to platform layer changed - Surface initialisation now requires + a WindowID parameter. +
  • +
  • + Bug fixed with drawing or measuring long pieces of text on Windows 9x + by truncating the pieces. +
  • +
  • + Bug fixed with SciTE on GTK+ where a user shortcut for a visible character + inserted the character as well as executing the command. +
  • +
  • + Bug fixed where primary selection on GTK+ was reset by + Scintilla during creation. +
  • +
  • + Bug fixed where SciTE would close immediately on startup + when using save.session. +
  • +
  • + Crash fixed when entering '\' in LaTeX file. +
  • +
  • + Hang fixed when '#' last character in VB file. +
  • +
  • + Crash fixed in error message lexer. +
  • +
  • + Crash fixed when searching for long regular expressions. +
  • +
  • + Pressing return when nothing selected in user list sends notification with + empty text rather than random text. +
  • +
  • + Mouse debouncing disabled on Windows as it interfered with some + mouse utilities. +
  • +
  • + Bug fixed where overstrike mode inserted before rather than replaced last + character in document. +
  • +
  • + Bug fixed with syntax highlighting of Japanese text. +
  • +
  • + Bug fixed in split lines function. +
  • +
  • + Cosmetic fix to SciTE tab bar on Windows when window resized. + Focus sticks to either pane more consistently. +
  • +
+

+ Release 1.51 +

+
    +
  • + Released on 16 February 2003. +
  • +
  • + Two phase drawing avoids cutting off text that overlaps runs by drawing + all the backgrounds of a line then drawing all the text transparently. + Single phase drawing is an option. +
  • +
  • + Scintilla method to split lines at a particular width by adding new line + characters. +
  • +
  • + The character used in autocompletion lists to separate the text from the image + number can be changed. +
  • +
  • + The scrollbar range will automatically expand when the caret is moved + beyond the current range. + The scroll bar is updated when SCI_SETXOFFSET is called. +
  • +
  • + Mouse cursors on GTK+ improved to be consistent with other applications + and the Windows version. +
  • +
  • + Horizontal scrollbar on GTK+ now disappears in wrapped mode. +
  • +
  • + Scintilla on GTK+ 2: mouse wheel scrolling, cursor over scrollbars, focus, + and syntax highlighting now work. + gtk_selection_notify avoided for compatibility with GTK+ 2.2. +
  • +
  • + Fold margin colours can now be set. +
  • +
  • + SciTE can be built for GTK+ 2. +
  • +
  • + SciTE can optionally preserve the undo history over an automatic file reload. +
  • +
  • + Tags can optionally be case insensitive in XML and HTML. +
  • +
  • + SciTE on Windows handles input to tool commands in a way that should avoid + deadlock. Output from tools can be used to replace the selection. +
  • +
  • + SciTE on GTK+ automatically substitutes '|' for '/' in menu items as '/' + is used to define the menu hierarchy. +
  • +
  • + Optional buffer number in SciTE title bar. +
  • +
  • + Crash fixed in SciTE brace matching. +
  • +
  • + Bug fixed where automatic scrolling past end of document + flipped back to the beginning. +
  • +
  • + Bug fixed where wrapping caused text to disappear. +
  • +
  • + Bug fixed on Windows where images in autocompletion lists were + shown on the wrong item. +
  • +
  • + Crash fixed due to memory bug in autocompletion lists on Windows. +
  • +
  • + Crash fixed when double clicking some error messages. +
  • +
  • + Bug fixed in word part movement where sometimes no movement would occur. +
  • +
  • + Bug fixed on Windows NT where long text runs were truncated by + treating NT differently to 9x where there is a limitation. +
  • +
  • + Text in not-changeable style works better but there remain some cases where + it is still possible to delete text protected this way. +
  • +
+

+ Release 1.50 +

+
    +
  • + Released on 24 January 2003. +
  • +
  • + Autocompletion lists may have a per-item pixmap. +
  • +
  • + Autocompletion lists allow Unicode text on Windows. +
  • +
  • + Scintilla documentation rewritten. +
  • +
  • + Additional DBCS encoding support in Scintilla on GTK+ primarily aimed at + Japanese EUC encoding. +
  • +
  • + CSS (Cascading Style Sheets) lexer added. +
  • +
  • + diff lexer understands some more formats. +
  • +
  • + Fold box feature is an alternative way to show the structure of code. +
  • +
  • + Avenue lexer supports multiple keyword lists. +
  • +
  • + The caret may now be made invisible by setting the caret width to 0. +
  • +
  • + Python folder attaches comments before blocks to the next block rather + than the previous block. +
  • +
  • + SciTE openpath property on Windows searches a path for files that are + the subject of the Open Selected Filename command. +
  • +
  • + The localisation file name can be changed with the locale.properties property. +
  • +
  • + On Windows, SciTE can pipe the result of a string expression into a command line tool. +
  • +
  • + On Windows, SciTE's Find dialog has a Mark All button. +
  • +
  • + On Windows, there is an Insert Abbreviation command that allows a choice from + the defined abbreviations and inserts the selection into the abbreviation at the + position of a '|'. +
  • +
  • + Minor fixes to Fortran lexer. +
  • +
  • + fold.html.preprocessor decides whether to fold <? and ?>. + Minor improvements to PHP folding. +
  • +
  • + Maximum number of keyword lists allowed increased from 6 to 9. +
  • +
  • + Duplicate line command added with default assignment to Ctrl+D. +
  • +
  • + SciTE sets $(Replacements) to the number of replacements made by the + Replace All command. $(CurrentWord) is set to the word before the caret if the caret + is at the end of a word. +
  • +
  • + Opening a SciTE session now loads files in remembered order, sets the current file + as remembered, and moves the caret to the remembered line. +
  • +
  • + Bugs fixed with printing on Windows where line wrapping was causing some text + to not print. +
  • +
  • + Bug fixed with Korean Input Method Editor on Windows. +
  • +
  • + Bugs fixed with line wrap which would sometimes choose different break positions + after switching focus away and back. +
  • +
  • + Bug fixed where wheel scrolling had no effect on GTK+ after opening a fold. +
  • +
  • + Bug fixed with file paths containing non-ASCII characters on Windows. +
  • +
  • + Crash fixed with printing on Windows after defining pixmap marker. +
  • +
  • + Crash fixed in makefile lexer when first character on line was '='. +
  • +
  • + Bug fixed where local properties were not always being applied. +
  • +
  • + Ctrl+Keypad* fold command works on GTK+. +
  • +
  • + Hangs fixed in SciTE's Replace All command when replacing regular expressions '^' + or '$'. +
  • +
  • + SciTE monospace setting behaves more sensibly. +
  • +
+

+ Release 1.49 +

+
    +
  • + Released on 1 November 2002. +
  • +
  • + Unicode supported on GTK+. To perform well, this added a font cache to GTK+ + and to make that safe, a mutex is used. The mutex requires the application to link in + the threading library by evaluating `glib-config --libs gthread`. A Unicode locale + should also be set up by a call like setlocale(LC_CTYPE, "en_US.UTF-8"). + scintilla_release_resources function added to release mutex. +
  • +
  • + FORTRAN and assembler lexers added along with other support for these + languages in SciTE. +
  • +
  • + Ada lexer improved handling of based numbers, identifier validity and attributes + distinguished from character literals. +
  • +
  • + Lua lexer handles block comments and a deep level of nesting for literal strings + and block comments. +
  • +
  • + Errorlist lexer recognises PHP error messages. +
  • +
  • + Variant of the C++ lexer with case insensitive keywords + called cppnocase. Whitespace in preprocessor text handled more correctly. +
  • +
  • + Folder added for Perl. +
  • +
  • + Compilation with GCC 3.2 supported. +
  • +
  • + Markers can be pixmaps. +
  • +
  • + Lines are wrapped when printing. + Bug fixed which printed line numbers in different styles. +
  • +
  • + Text can be appended to end with AppendText method. +
  • +
  • + ChooseCaretX method added. +
  • +
  • + Vertical scroll bar can be turned off with SetVScrollBar method. +
  • +
  • + SciTE Save All command saves all buffers. +
  • +
  • + SciTE localisation compares keys case insensitively to make translations more flexible. +
  • +
  • + SciTE detects a utf-8 coding cookie "coding: utf-8" in first two + lines and goes into Unicode mode. +
  • +
  • + SciTE key bindings are definable. +
  • +
  • + SciTE Find in Files dialog can display directory browser to + choose directory to search. +
  • +
  • + SciTE enabling of undo and redo toolbar buttons improved. +
  • +
  • + SciTE on Windows file type filters in open dialog sorted. +
  • +
  • + Fixed crashing bug when using automatic tag closing in XML or HTML. +
  • +
  • + Fixed bug on Windows causing very long (>64K) lines to not display. +
  • +
  • + Fixed bug in backwards regular expression searching. +
  • +
  • + Fixed bug in calltips where wrong argument was highlighted. +
  • +
  • + Fixed bug in tab timmy feature when file has line feed line endings. +
  • +
  • + Fixed bug in compiling without INCLUDE_DEPRECATED_FEATURES + defined. +
  • +
+

+ Release 1.48 +

+
    +
  • + Released on 9 September 2002. +
  • +
  • + Improved Pascal lexer with context sensitive keywords + and separate folder which handles //{ and //} folding comments and + {$region} and {$end} folding directives. + The "case" statement now folds correctly. +
  • +
  • + C++ lexer correctly handles comments on preprocessor lines. +
  • +
  • + New commands for moving to beginning and end of display lines when in line + wrap mode. Key bindings added for these commands. +
  • +
  • + New marker symbols that look like ">>>" and "..." which can be used for + interactive shell prompts for Python. +
  • +
  • + The foreground and background colours of visible whitespace can be chosen + independent of the colours chosen for the lexical class of that whitespace. +
  • +
  • + Per line data optimised by using an exponential allocation scheme. +
  • +
  • + SciTE API file loading optimised. +
  • +
  • + SciTE for GTK+ subsystem 2 documented. The exit status of commands + is decoded into more understandable fields. +
  • +
  • + SciTE find dialog remembers previous find string when there is no selection. + Find in Selection button disabled when selection is rectangular as command + did not work. +
  • +
  • + Shift+Enter made equivalent to Enter to avoid users having to let go of + the shift key when typing. Avoids the possibility of entering single carriage + returns in a file that contains CR+LF line ends. +
  • +
  • + Autocompletion does not immediately disappear when the length parameter + to SCI_AUTOCSHOW is 0. +
  • +
  • + SciTE focuses on the editor pane when File | New executed and when the + output pane is closed with F8. Double clicking on a non-highlighted output + pane line selects the word under the cursor rather than seeking the next + highlighted line. +
  • +
  • + SciTE director interface implements an "askproperty" command. +
  • +
  • + SciTE's Export as LaTeX output improved. +
  • +
  • + Better choice of autocompletion displaying above the caret rather then + below when that is more sensible. +
  • +
  • + Bug fixed where context menu would not be completely visible if invoked + when cursor near bottom or left of screen. +
  • +
  • + Crashing bug fixed when displaying long strings on GTK+ caused failure of X server + by displaying long text in segments. +
  • +
  • + Crashing bug fixed on GTK+ when a Scintilla window was removed from its parent + but was still the selection owner. +
  • +
  • + Bug fixed on Windows in Unicode mode where not all characters on a line + were displayed when that line contained some characters not in ASCII. +
  • +
  • + Crashing bug fixed in SciTE on Windows with clearing output while running command. +
  • +
  • + Bug fixed in SciTE for GTK+ with command completion not detected when + no output was produced by the command. +
  • +
  • + Bug fixed in SciTE for Windows where menus were not shown translated. +
  • +
  • + Bug fixed where words failed to display in line wrapping mode with visible + line ends. +
  • +
  • + Bug fixed in SciTE where files opened from a session file were not closed. +
  • +
  • + Cosmetic flicker fixed when using Ctrl+Up and Ctrl+Down with some caret policies. +
  • +
+

+ Release 1.47 +

+
    +
  • + Released on 1 August 2002. +
  • +
  • + Support for GTK+ 2 in Scintilla. International input methods not supported + on GTK+2. +
  • +
  • + Line wrapping performance improved greatly. +
  • +
  • + New caret policy implementation that treats horizontal and vertical + positioning equivalently and independently. Old caret policy methods + deprecated and not all options work correctly with old methods. +
  • +
  • + Extra fold points for C, C++, Java, ... for fold comments //{ .. //} and + #if / #ifdef .. #endif and the #region .. #endregion feature of C#. +
  • +
  • + Scintilla method to find the height in pixels of a line. Currently returns the + same result for every line as all lines are same height. +
  • +
  • + Separate make file, scintilla_vc6.mak, for Scintilla to use Visual C++ + version 6 since main makefile now assumes VS .NET. + VS .NET project files available for combined Scintilla and + SciTE in scite/boundscheck. +
  • +
  • + SciTE automatically recognises Unicode files based + on their Byte Order Marks and switches to Unicode mode. + On Windows, where SciTE supports Unicode display, this + allows display of non European characters. + The file is saved back into the same character encoding unless + the user decides to switch using the File | Encoding menu. +
  • +
  • + Handling of character input changed so that a fillup character, typically '(' + displays a calltip when an autocompletion list was being displayed. +
  • +
  • + Multiline strings lexed better for C++ and Lua. +
  • +
  • + Regular expressions in JavaScript within hypertext files are lexed better. +
  • +
  • + On Windows, Scintilla exports a function called Scintilla_DirectFunction + that can be used the same as the function returned by GetDirectFunction. +
  • +
  • + Scintilla converts line endings of text obtained from the clipboard to + the current default line endings. +
  • +
  • + New SciTE property ensure.final.line.end can ensure that saved files + always end with a new line as this is required by some tools. + The ensure.consistent.line.ends property ensures all line ends are the + current default when saving files. + The strip.trailing.spaces property now works on the buffer so the + buffer in memory and the file on disk are the same after a save is performed. +
  • +
  • + The SciTE expand abbreviation command again allows '|' characters + in expansions to be quoted by using '||'. +
  • +
  • + SciTE on Windows can send data to the find tool through standard + input rather than using a command line argument to avoid problems + with quoting command line arguments. +
  • +
  • + The Stop Executing command in SciTE on Windows improved to send + a Ctrl+Z character to the tool. Better messages when stopping a tool. +
  • +
  • + Autocompletion can automatically "fill up" when one of a set of characters is + type with the autocomplete.<lexer>.fillups property. +
  • +
  • + New predefined properties in SciTE, SelectionStartColumn, SelectionStartLine, + SelectionEndColumn, SelectionEndLine can be used to integrate with other + applications. +
  • +
  • + Environment variables are available as properties in SciTE. +
  • +
  • + SciTE on Windows keeps status line more current. +
  • +
  • + Abbreviations work in SciTE on Linux when first opened. +
  • +
  • + File saving fixed in SciTE to ensure files are not closed when they can not be + saved because of file permissions. Also fixed a problem with buffers that + caused files to not be saved. +
  • +
  • + SciTE bug fixed where monospace mode not remembered when saving files. + Some searching options now remembered when switching files. +
  • +
  • + SciTE on Linux now waits on child termination when it shuts a child down + to avoid zombies. +
  • +
  • + SciTE on Linux has a Print menu command that defaults to invoking a2ps. +
  • +
  • + Fixed incorrect highlighting of indentation guides in SciTE for Python. +
  • +
  • + Crash fixed in Scintilla when calling GetText for 0 characters. +
  • +
  • + Exporting as LaTeX improved when processing backslashes and tabs + and setting up font. +
  • +
  • + Crash fixed in SciTE when exporting or copying as RTF. +
  • +
  • + SciTE session loading fixed to handle more than 10 files in session. +
  • +
+

+ Release 1.46 +

+
    +
  • + Released on 10 May 2002. +
  • +
  • + Set of lexers compiled into Scintilla can now be changed by adding and + removing lexer source files from scintilla/src and running LexGen.py. +
  • +
  • + SCN_ZOOM notification provided by Scintilla when user changes zoom level. + Method to determine width of strings in pixels so that elements can be sized + relative to text size. + SciTE changed to keep line number column displaying a given + number of characters. +
  • +
  • + The logical width of the document used to determine scroll bar range can be set. +
  • +
  • + Setting to allow vertical scrolling to display last line at top rather than + bottom of window. +
  • +
  • + Read-only mode improved to avoid changing the selection in most cases + when a modification is attempted. Drag and drop cursors display correctly + for read-only in some cases. +
  • +
  • + Visual C++ options in make files changed to suit Visual Studio .NET. +
  • +
  • + Scintilla.iface includes feature types for enumerations and lexers. +
  • +
  • + Lua lexer improves handling of literal strings and copes with nested literal strings. +
  • +
  • + Diff lexer changed to treat lines starting with "***" similarly to "---". + Symbolic names defined for lexical classes. +
  • +
  • + nncrontab lexer improved. +
  • +
  • + Turkish fonts (iso8859-9) supported on GTK+. +
  • +
  • + Automatic close tag feature for XML and HTML in SciTE. +
  • +
  • + Automatic indentation in SciTE improved. +
  • +
  • + Maximum number of buffers available in SciTE increased. May be up to 100 + although other restrictions on menu length limit the real maximum. +
  • +
  • + Save a Copy command added to SciTE. +
  • +
  • + Export as TeX command added to SciTE. +
  • +
  • + Export as HTML command in SciTE respects Use Monospaced Font and + background colour settings. +
  • +
  • + Compilation problem on Solaris fixed. +
  • +
  • + Order of files displayed for SciTE's previous and next menu and key commands + are now consistent. +
  • +
  • + Saving of MRU in recent file changed so files open when SciTE quit + are remembered. +
  • +
  • + More variants of ctags tags handled by Open Selected Filename in SciTE. +
  • +
  • + JavaScript embedded in XML highlighted again. +
  • +
  • + SciTE status bar updated after changing parameters in case they are being + displayed in status bar. +
  • +
  • + Crash fixed when handling some multi-byte languages. +
  • +
  • + Crash fixed when replacing end of line characters. +
  • +
  • + Bug in SciTE fixed in multiple buffer mode where automatic loading + turned on could lead to losing file contents. +
  • +
  • + Bug in SciTE on GTK+ fixed where dismissing dialogs with close box led to + those dialogs never being shown again. +
  • +
  • + Bug in SciTE on Windows fixed where position.tile with default positions + led to SciTE being positioned off-screen. +
  • +
  • + Bug fixed in read-only mode, clearing all deletes contraction state data + leading to it not being synchronized with text. +
  • +
  • + Crash fixed in SciTE on Windows when tab bar displayed. +
  • +
+

+ Release 1.45 +

+
    +
  • + Released on 15 March 2002. +
  • +
  • + Line layout cache implemented to improve performance by maintaining + the positioning of characters on lines. Can be set to cache nothing, + the line with the caret, the visible page or the whole document. +
  • +
  • + Support, including a new lexer, added for Matlab programs. +
  • +
  • + Lua folder supports folding {} ranges and compact mode. + Lua lexer styles floating point numbers in number style instead of + setting the '.' in operator style. + Up to 6 sets of keywords. + Better support for [[ although only works well + when all on one line. +
  • +
  • + Python lexer improved to handle floating point numbers that contain negative + exponents and that start with '.'. +
  • +
  • + When performing a rectangular paste, the caret now remains at the + insertion point. +
  • +
  • + On Windows with a wheel mouse, page-at-a-time mode is recognised. +
  • +
  • + Read-only mode added to SciTE with a property to initialise it and another property, + $(ReadOnly) available to show this mode in the status bar. +
  • +
  • + SciTE status bar can show the number of lines in the selection + with the $(SelHeight) property. +
  • +
  • + SciTE's "Export as HTML" command uses the current character set to produce + correct output for non-Western-European character sets, such as Russian. +
  • +
  • + SciTE's "Export as RTF" fixed to produce correct output when file contains '\'. +
  • +
  • + SciTE goto command accepts a column as well as a line. + If given a column, it selects the word at that column. +
  • +
  • + SciTE's Build, Compile and Go commands are now disabled if no + action has been assigned to them. +
  • +
  • + The Refresh button in the status bar has been removed from SciTE on Windows. +
  • +
  • + Bug fixed in line wrap mode where cursor up or down command did not work. +
  • +
  • + Some styling bugs fixed that were due to a compilation problem with + gcc and inline functions with same name but different code. +
  • +
  • + The way that lexers loop over text was changed to avoid accessing beyond the + end or setting beyond the end. May fix some bugs and make the code safer but + may also cause new bugs. +
  • +
  • + Bug fixed in HTML lexer's handling of SGML. +
  • +
  • + Bug fixed on GTK+/X where lines wider than 32767 pixels did not display. +
  • +
  • + SciTE bug fixed with file name generation for standard property files. +
  • +
  • + SciTE bug fixed with Open Selected Filename command when used with + file name and line number combination. +
  • +
  • + In SciTE, indentation and tab settings stored with buffers so maintained correctly + as buffers selected. + The properties used to initialise these settings can now be set separately for different + file patterns. +
  • +
  • + Thread safety improved on Windows with a critical section protecting the font + cache and initialisation of globals performed within Scintilla_RegisterClasses. + New Scintilla_ReleaseResources call provided to allow explicit freeing of resources + when statically bound into another application. Resources automatically freed + in DLL version. The window classes are now unregistered as part of resource + freeing which fixes bugs that occurred in some containers such as Internet Explorer. +
  • +
  • + 'make install' fixed on Solaris. +
  • +
  • + Bug fixed that could lead to a file being opened twice in SciTE. +
  • +
+

+ Release 1.44 +

+
    +
  • + Released on 4 February 2002. +
  • +
  • + Crashing bug fixed in Editor::Paint. +
  • +
  • + Lua lexer no longer treats '.' as a word character and + handles 6 keyword sets. +
  • +
  • + WordStartPosition and WordEndPosition take an onlyWordCharacters + argument. +
  • +
  • + SciTE option for simplified automatic indentation which repeats + the indentation of the previous line. +
  • +
  • + Compilation fix on Alpha because of 64 bit. +
  • +
  • + Compilation fix for static linking. +
  • +
  • + Limited maximum line length handled to 8000 characters as previous + value of 16000 was causing stack exhaustion crashes for some. +
  • +
  • + When whole document line selected, only the last display line gets + the extra selected rectangle at the right hand side rather than + every display line. +
  • +
  • + Caret disappearing bug fixed for the case that the caret was not on the + first display line of a document line. +
  • +
  • + SciTE bug fixed where untitled buffer containing text was sometimes + deleted without chance to save. +
  • +
  • + SciTE bug fixed where use.monospaced not working with + multiple buffers. +
  • +
+

+ Release 1.43 +

+
    +
  • + Released on 19 January 2002. +
  • +
  • + Line wrapping robustness and performance improved in Scintilla. +
  • +
  • + Line wrapping option added to SciTE for both edit and output panes. +
  • +
  • + Static linking on Windows handles cursor resource better. + Documentation of static linking improved. +
  • +
  • + Autocompletion has an option to delete any word characters after the caret + upon selecting an item. +
  • +
  • + FOX version identified by PLAT_FOX in Platform.h. +
  • +
  • + Calltips in SciTE use the calltip.<lexer>.word.characters setting to + correctly find calltips for functions that include characters like '$' which + is not normally considered a word character. +
  • +
  • + SciTE has a command to show help on itself which gets hooked up to displaying + SciTEDoc.html. +
  • +
  • + SciTE option calltip.<lexer>.end.definition to display help text on a + second line of calltip. +
  • +
  • + Fixed the handling of the Buffers menu on GTK+ to ensure current buffer + indicated and no warnings occur. + Changed some menu items on GTK+ version to be same as Windows version. +
  • +
  • + use.monospaced property for SciTE determines initial state of Use Monospaced Font + setting. +
  • +
  • + The SciTE Complete Symbol command now works when there are no word + characters before the caret, even though it is slow to display the whole set of + symbols. +
  • +
  • + Function names removed from SciTE's list of PHP keywords. The full list of + predefined functions is available from another web site mentioned on the + Extras page. +
  • +
  • + Crashing bug at startup on GTK+ for some configurations fixed. +
  • +
  • + Crashing bug on GTK+ on 64 bit platforms fixed. +
  • +
  • + Compilation problem with some compilers fixed in GTK+. +
  • +
  • + Japanese text entry improved on Windows 9x. +
  • +
  • + SciTE recent files directory problem on Windows when HOME and SciTE_HOME + environment variables not set is now the directory of the executable. +
  • +
  • + Session files no longer include untitled buffers. +
  • +
+

+ Release 1.42 +

+
    +
  • + Released on 24 December 2001. +
  • +
  • + Better localisation support including context menus and most messages. + Translations of the SciTE user interface available for Bulgarian, + French, German, Italian, Russian, and Turkish. +
  • +
  • + Can specify a character to use to indicate control characters + rather than having them displayed as mnemonics. +
  • +
  • + Scintilla key command for backspace that will not delete line + end characters. +
  • +
  • + Scintilla method to find start and end of words. +
  • +
  • + SciTE on GTK+ now supports the load.on.activate and save.on.deactivate + properties in an equivalent way to the Windows version. +
  • +
  • + The output pane of SciTE on Windows is now interactive so command line + utilities that prompt for input or confirmation can be used. +
  • +
  • + SciTE on Windows can choose directory for a "Find in Files" + command like the GTK+ version could. +
  • +
  • + SciTE can now load a set of API files rather than just one file. +
  • +
  • + ElapsedTime class added to Platform for accurate measurement of durations. + Used for debugging and for showing the user how long commands take in SciTE. +
  • +
  • + Baan lexer added. +
  • +
  • + In C++ lexer, document comment keywords no longer have to be at the start + of the line. +
  • +
  • + PHP lexer changed to match keywords case insensitively. +
  • +
  • + More shell keywords added. +
  • +
  • + SciTE support for VoiceXML added to xml.properties. +
  • +
  • + In SciTE the selection is not copied to the find field of the Search and Replace + dialogs if it contains end of line characters. +
  • +
  • + SciTE on Windows has a menu item to decide whether to respond to other + instances which are performing their check.if.already.open check. +
  • +
  • + SciTE accelerator key for Box Comment command changed to avoid problems + in non-English locales. +
  • +
  • + SciTE context menu includes Close command for the editor pane and + Hide command for the output pane. +
  • +
  • + output: command added to SciTE director interface to add text to the + output pane. The director interface can execute commands (such as tool + commands with subsystem set to 3) by sending a macro:run message. +
  • +
  • + SciTE on GTK+ will defer to the Window Manager for position if position.left or + position.top not set and for size if position.width or position.height not set. +
  • +
  • + SciTE on Windows has a position.tile property to place a second instance + to the right of the first. +
  • +
  • + Scintilla on Windows again supports EM_GETSEL and EM_SETSEL. +
  • +
  • + Problem fixed in Scintilla on Windows where control ID is no longer cached + as it could be changed by external code. +
  • +
  • + Problems fixed in SciTE on Windows when finding any other open instances at + start up when check.if.already.open is true. +
  • +
  • + Bugs fixed in SciTE where command strings were not always having + variables evaluated. +
  • +
  • + Bugs fixed with displaying partial double-byte and Unicode characters + in rectangular selections and at the edge when edge mode is EDGE_BACKGROUND. + Column numbers reported by GetColumn treat multiple byte characters as one column + rather than counting bytes. +
  • +
  • + Bug fixed with caret movement over folded lines. +
  • +
  • + Another bug fixed with tracking selection in secondary views when performing + modifications. +
  • +
  • + Horizontal scrolling and display of long lines optimised. +
  • +
  • + Cursor setting in Scintilla on GTK+ optimised. +
  • +
  • + Experimental changeable style attribute. + Set to false to make text read-only. + Currently only stops caret from being within not-changeable + text and does not yet stop deleting a range that contains + not-changeable text. + Can be used from SciTE by adding notchangeable to style entries. +
  • +
  • + Experimental line wrapping. + Currently has performance and appearence problems. +
  • +
+

+ Release 1.41 +

+
    +
  • + Released on 6 November 2001. +
  • +
  • + Changed Platform.h to not include platform headers. This lessens likelihood and impact of + name clashes from system headers and also speeds up compilation. + Renamed DrawText to DrawTextNoClip to avoid name clash. +
  • +
  • + Changed way word functions work to treat a sequence of punctuation as + a word. This is more sensible and also more compatible with other editors. +
  • +
  • + Cursor changes over the margins and selection on GTK+ platform. +
  • +
  • + SC_MARK_BACKGROUND is a marker that only changes the line's background colour. +
  • +
  • + Enhanced Visual Basic lexer handles character date and octal literals, + and bracketed keywords for VB.NET. There are two VB lexers, vb and vbscript + with type indication characters like ! and $ allowed at the end of identifiers + in vb but not vbscript. Lexer states now separate from those used for C++ and + names start with SCE_B. +
  • +
  • + Lexer added for Bullant language. +
  • +
  • + The horizontal scroll position, xOffset, is now exposed through the API. +
  • +
  • + The SCN_POSCHANGED notification is deprecated as it was causing confusion. + Use SCN_UPDATEUI instead. +
  • +
  • + Compilation problems fixed for some versions of gcc. +
  • +
  • + Support for WM_GETTEXT restored on Windows. +
  • +
  • + Double clicking on an autocompletion list entry works on GTK+. +
  • +
  • + Bug fixed with case insensitive sorts for autocompletion lists. +
  • +
  • + Bug fixed with tracking selection in secondary views when performing modifications. +
  • +
  • + SciTE's abbreviation expansion feature will now indent expansions to the current + indentation level if indent.automatic is on. +
  • +
  • + SciTE allows setting up of parameters to commands from a dialog and can also + show this dialog automatically to prompt for arguments when running a command. +
  • +
  • + SciTE's Language menu (formerly Options | Use Lexer) is now defined by the + menu.language property rather than being hardcoded. +
  • +
  • + The user interface of SciTE can be localised to a particular language by editing + a locale.properties file. +
  • +
  • + On Windows, SciTE will try to move to the front when opening a new file from + the shell and using check.if.already.open. +
  • +
  • + SciTE can display the file name and directory in the title bar in the form + "file @ directory" when title.full.path=2. +
  • +
  • + The SciTE time.commands property reports the time taken by a command as well + as its status when completed. +
  • +
  • + The SciTE find.files property is now a list separated by '|' characters and this list is + added into the Files pull down of the Find in Files dialog. +
  • +
+

+ Release 1.40 +

+
    +
  • + Released on 23 September 2001. +
  • +
  • + Removal of emulation of Win32 RichEdit control in core of Scintilla. + This change may be incompatible with existing client code. + Some emulation still done in Windows platform layer. +
  • +
  • + SGML support in the HTML/XML lexer. +
  • +
  • + SciTE's "Stop Executing" command will terminate GUI programs on + Windows NT and Windows 2000. +
  • +
  • + StyleContext class helps construct lexers that are simple and accurate. + Used in the C++, Eiffel, and Python lexers. +
  • +
  • + Clipboard operations in GTK+ version convert between platform '\n' line endings and + currently chosen line endings. +
  • +
  • + Any character in range 0..255 can be used as a marker. + This can be used to support numbered bookmarks, for example. +
  • +
  • + The default scripting language for ASP can be set. +
  • +
  • + New lexer and other support for crontab files used with the nncron scheduler. +
  • +
  • + Folding of Python improved. +
  • +
  • + The ` character is treated as a Python operator. +
  • +
  • + Line continuations ("\" at end of line) handled inside Python strings. +
  • +
  • + More consistent handling of line continuation ('\' at end of line) in + C++ lexer. + This fixes macro definitions that span more than one line. +
  • +
  • + C++ lexer can understand Doxygen keywords in doc comments. +
  • +
  • + SciTE on Windows allows choosing to open the "open" dialog on the directory + of the current file rather than in the default directory. +
  • +
  • + SciTE on Windows handles command line arguments in "check.if.already.open" + correctly when the current directory of the new instance is different to the + already open instance of SciTE. +
  • +
  • + "cwd" command (change working directory) defined for SciTE director interface. +
  • +
  • + SciTE "Export As HTML" produces better, more compliant, and shorter files. +
  • +
  • + SciTE on Windows allows several options for determining default file name + for exported files. +
  • +
  • + Automatic indentation of Python in SciTE fixed. +
  • +
  • + Exported HTML can support folding. +
  • +
  • + Bug fixed in SCI_GETTEXT macro command of director interface. +
  • +
  • + Cursor leak fixed on GTK+. +
  • +
  • + During SciTE shutdown, "identity" messages are no longer sent over the director interface. +
  • +
+

+ Release 1.39 +

+
    +
  • + Released on 22 August 2001. +
  • +
  • + Windows version requires msvcrt.dll to be available so will not work + on original Windows 95 version 1. The msvcrt.dll file is installed + by almost everything including Internet Explorer so should be available. +
  • +
  • + Flattened tree control style folding margin. The SciTE fold.plus option is + now fold.symbols and has more values for the new styles. +
  • +
  • + Mouse dwell events are generated when the user holds the mouse steady + over Scintilla. +
  • +
  • + PositionFromPointClose is like PositionFromPoint but returns + INVALID_POSITION when point outside window or after end of line. +
  • +
  • + Input of Hungarian and Russian characters in GTK+ version works by + truncating input to 8 bits if in the range of normal characters. +
  • +
  • + Better choices for font descriptors on GTK+ for most character sets. +
  • +
  • + GTK+ Scintilla is destroyed upon receiving destroy signal rather than + destroy_event signal. +
  • +
  • + Style setting that force upper or lower case text. +
  • +
  • + Case-insensitive autocompletion lists work correctly. +
  • +
  • + Keywords can be prefix based so ^GTK_ will treat all words that start + with GTK_ as keywords. +
  • +
  • + Horizontal scrolling can be jumpy rather than gradual. +
  • +
  • + GetSelText places a '\0' in the buffer if the selection is empty.. +
  • +
  • + EnsureVisible split into two methods EnsureVisible which will not scroll to show + the line and EnsureVisibleEnforcePolicy which may scroll. +
  • +
  • + Python folder has options to fold multi-line comments and triple quoted strings. +
  • +
  • + C++ lexer handles keywords before '.' like "this.x" in Java as keywords. + Compact folding mode option chooses whether blank lines after a structure are + folded with that structure. Second set of keywords with separate style supported. +
  • +
  • + Ruby lexer handles multi-line comments. +
  • +
  • + VB has folder. +
  • +
  • + PHP lexer has an operator style, handles "<?" and "?>" inside strings + and some comments. +
  • +
  • + TCL lexer which is just an alias for the C++ lexer so does not really + understand TCL syntax. +
  • +
  • + Error lines lexer has styles for Lua error messages and .NET stack traces. +
  • +
  • + Makefile lexer has a target style. +
  • +
  • + Lua lexer handles some [[]] string literals. +
  • +
  • + HTML and XML lexer have a SCE_H_SGML state for tags that + start with "<!". +
  • +
  • + Fixed Scintilla bugs with folding. When modifications were performed near + folded regions sometimes no unfolding occurred when it should have. Deleting a + fold causing character sometimes failed to update fold information correctly. +
  • +
  • + Better support for Scintilla on GTK+ for Win32 including separate + PLAT_GTK_WIN32 definition and correct handling of rectangular selection + with clipboard operations. +
  • +
  • + SciTE has a Tools | Switch Pane (Ctrl+F6) command to switch focus between + edit and output panes. +
  • +
  • + SciTE option output.scroll allows automatic scrolling of output pane to + be turned off. +
  • +
  • + Commands can be typed into the SciTE output pane similar to a shell window. +
  • +
  • + SciTE properties magnification and output magnification set initial zoom levels. +
  • +
  • + Option for SciTE comment block command to place comments at start of line. +
  • +
  • + SciTE for Win32 has an option to minimize to the tray rather than the task bar. +
  • +
  • + Close button on SciTE tool bar for Win32. +
  • +
  • + SciTE compiles with GCC 3.0. +
  • +
  • + SciTE's automatic indentation of C++ handles braces without preceding keyword + correctly. +
  • +
  • + Bug fixed with GetLine method writing past the end of where it should. +
  • +
  • + Bug fixed with mouse drag automatic scrolling when some lines were folded. +
  • +
  • + Bug fixed because caret XEven setting was inverted. +
  • +
  • + Bug fixed where caret was initially visible even though window was not focussed. +
  • +
  • + Bug fixed where some file names could end with "\\" which caused slow + downs on Windows 9x. +
  • +
  • + On Win32, SciTE Replace dialog starts with focus on replacement text. +
  • +
  • + SciTE Go to dialog displays correct current line. +
  • +
  • + Fixed bug with SciTE opening multiple files at once. +
  • +
  • + Fixed bug with Unicode key values reported to container truncated. +
  • +
  • + Fixed bug with unnecessary save point notifications. +
  • +
  • + Fixed bugs with indenting and unindenting at start of line. +
  • +
  • + Monospace Font setting behaves more consistently. +
  • +
+

+ Release 1.38 +

+
    +
  • + Released on 23 May 2001. +
  • +
  • + Loadable lexer plugins on Windows. +
  • +
  • + Ruby lexer and support. +
  • +
  • + Lisp lexer and support. +
  • +
  • + Eiffel lexer and support. +
  • +
  • + Modes for better handling of Tab and BackSpace keys within + indentation. Mode to avoid autocompletion list cancelling when + there are no viable matches. +
  • +
  • + ReplaceTarget replaced with two calls ReplaceTarget + (which is incompatible with previous ReplaceTarget) and + ReplaceTargetRE. Both of these calls have a count first + parameter which allows using strings containing nulls. + SearchInTarget and SetSearchFlags functions allow + specifying a search in several simple steps which helps + some clients which can not create structs or pointers easily. +
  • +
  • + Asian language input through an Input Method Editor works + on Windows 2000. +
  • +
  • + On Windows, control characters can be entered through use of + the numeric keypad in conjunction with the Alt key. +
  • +
  • + Document memory allocation changed to grow exponentially + which reduced time to load a 30 Megabyte file from + 1000 seconds to 25. Change means more memory may be used. +
  • +
  • + Word part movement keys now handled in Scintilla rather than + SciTE. +
  • +
  • + Regular expression '^' and '$' work more often allowing insertion + of text at start or end of line with a replace command. + Backslash quoted control characters \a, \b, \f, \t, and \v + recognised within sets. +
  • +
  • + Session files for SciTE. +
  • +
  • + Export as PDF command hidden in SciTE as it often failed. + Code still present so can be turned on by those willing to cope. +
  • +
  • + Bug fixed in HTML lexer handling % before > as end ASP + even when no start ASP encountered. + Bug fixed when scripts ended with a quoted string and + end tag was not seen. +
  • +
  • + Bug fixed on Windows where context menu key caused menu to + appear in corner of screen rather than within window. +
  • +
  • + Bug fixed in SciTE's Replace All command not processing + whole file when replace string longer than search string. +
  • +
  • + Bug fixed in SciTE's MRU list repeating entries if Ctrl+Tab + used when all entries filled. +
  • +
  • + ConvertEOLs call documentation fixed. +
  • +
+

+ Release 1.37 +

+
    +
  • + Released on 17 April 2001. +
  • +
  • + Bug fixed with scroll bars being invisible on GTK+ 1.2.9. +
  • +
  • + Scintilla and SciTE support find and replace using simple regular + expressions with tagged expressions. SciTE supports C '\' escapes + in the Find and Replace dialogs. + Replace in Selection available in SciTE. +
  • +
  • + Scintilla has a 'target' feature for replacing code rapidly without + causing display updates. +
  • +
  • + Scintilla and SciTE on GTK+ support file dropping from file managers + such as Nautilus and gmc. Files or other URIs dropped on Scintilla + result in a URIDropped notification. +
  • +
  • + Lexers may have separate Lex and Fold functions. +
  • +
  • + Lexer infrastructure improved to allow for plug in lexers and for referring + to lexers by name rather than by ID. +
  • +
  • + Ada lexer and support added. +
  • +
  • + Option in both Scintilla and SciTE to treat both left and right margin + as equally important when repositioning visible area in response to + caret movement. Default is to prefer visible area positioning which + minimises the horizontal scroll position thus favouring the left margin. +
  • +
  • + Caret line highlighting. +
  • +
  • + Commands to delete from the caret to the end of line and + from the caret to the beginning of line. +
  • +
  • + SciTE has commands for inserting and removing block comments and + for inserting stream comments. +
  • +
  • + SciTE Director interface uses C++ '\' escapes to send control characters. +
  • +
  • + SciTE Director interface adds more commands including support for macros. +
  • +
  • + SciTE has menu options for recording and playing macros which are visible + when used with a companion program that supports these features. +
  • +
  • + SciTE has an Expand Abbreviation command. + Abbreviations are stored in a global abbrev.properties file. +
  • +
  • + SciTE has a Full Screen command to switch between a normal window + size and using the full screen. On Windows, the menu bar can be turned + off when in full screen mode. +
  • +
  • + SciTE has a Use monospaced font command to switch between the normal + set of fonts and one size of a particular fixed width font. +
  • +
  • + SciTE's use of tabs can be controlled for particular file names + as well as globally. +
  • +
  • + The contents of SciTE's status bar can be defined by a property and + include variables. On Windows, several status bar definitions can be active + with a click on the status bar cycling through them. +
  • +
  • + Copy as RTF command in SciTE on Windows to allow pasting + styled text into word processors. +
  • +
  • + SciTE can allow the use of non-alphabetic characters in + Complete Symbol lists and can automatically display this autocompletion + list when a trigger character such as '.' is typed. + Complete word can be set to pop up when the user is typing a word and + there is only one matching word in the document. +
  • +
  • + SciTE lists the imported properties files on a menu to allow rapid + access to them. +
  • +
  • + SciTE on GTK+ improvements to handling accelerator keys and focus + in dialogs. Message boxes respond to key presses without the Alt key as + they have no text entries to accept normal keystrokes. +
  • +
  • + SciTE on GTK+ sets the application icon. +
  • +
  • + SciTE allows setting the colours used to indicate the current + error line. +
  • +
  • + Variables within PHP strings have own style. Keyword list updated. +
  • +
  • + Keyword list for Lua updated for Lua 4.0. +
  • +
  • + Bug fixed in rectangular selection where rectangle still appeared + selected after using cursor keys to move caret. +
  • +
  • + Bug fixed in C++ lexer when deleting a '{' controlling a folded range + led to that range becoming permanently invisible. +
  • +
  • + Bug fixed in Batch lexer where comments were not recognised. +
  • +
  • + Bug fixed with undo actions coalescing into steps incorrectly. +
  • +
  • + Bug fixed with Scintilla on GTK+ positioning scroll bars 1 pixel + over the Scintilla window leading to their sides being chopped off. +
  • +
  • + Bugs fixed in SciTE when doing some actions led to the start + or end of the file being displayed rather than the current location. +
  • +
  • + Appearance of calltips fixed to look like document text including + any zoom factor. Positioned to be outside current line even when + multiple fonts and sizes used. +
  • +
  • + Bug fixed in Scintilla macro support where typing Enter caused both a newline + command and newline character insertion to be recorded. +
  • +
  • + Bug fixed in SciTE on GTK+ where focus was moving + between widgets incorrectly. +
  • +
  • + Bug fixed with fold symbols sometimes not updating when + the text changed. +
  • +
  • + Bugs fixed in SciTE's handling of folding commands. +
  • +
  • + Deprecated undo collection enumeration removed from API. +
  • +
+

+ Release 1.36 +

+
    +
  • + Released on 1 March 2001. +
  • +
  • + Scintilla supports GTK+ on Win32. +
  • +
  • + Some untested work on making Scintilla and SciTE 64 bit compatible. + For users on GTK+ this requires including Scintilla.h before + ScintillaWidget.h. +
  • +
  • + HTML lexer allows folding HTML. +
  • +
  • + New lexer for Avenue files which are used in the ESRI ArcView GIS. +
  • +
  • + DOS Batch file lexer has states for '@', external commands, variables and + operators. +
  • +
  • + C++ lexer can fold comments of /* .. */ form. +
  • +
  • + Better disabling of popup menu items in Scintilla when in read-only mode. +
  • +
  • + Starting to move to Doxygen compatible commenting. +
  • +
  • + Director interface on Windows enables another application to control SciTE. +
  • +
  • + Opening SciTE on Windows 9x sped up greatly for some cases. +
  • +
  • + The command.build.directory property allows SciTE to run the build + command in a different directory to the source files. +
  • +
  • + SciTE on Windows allows setting foreground and background colours + for printed headers and footers. +
  • +
  • + Bug fixed in finding calltips in SciTE which led to no calltips for some identifiers. +
  • +
  • + Documentation added for lexers and for the extension and director interfaces. +
  • +
  • + SciTE menus rearranged with new View menu taking over some of the items that + were under the Options menu. Clear All Bookmarks command added. +
  • +
  • + Clear Output command in SciTE. +
  • +
  • + SciTE on Windows gains an Always On Top command. +
  • +
  • + Bug fixed in SciTE with attempts to define properties recursively. +
  • +
  • + Bug fixed in SciTE properties where only one level of substitution was done. +
  • +
  • + Bug fixed in SciTE properties where extensions were not being + matched in a case insensitive manner. +
  • +
  • + Bug fixed in SciTE on Windows where the Go to dialog displays the correct + line number. +
  • +
  • + In SciTE, if fold.on.open set then switching buffers also performs fold. +
  • +
  • + Bug fixed in Scintilla where ensuring a line was visible in the presence of folding + operated on the document line instead of the visible line. +
  • +
  • + SciTE command line processing modified to operate on arguments in order and in + two phases. First any arguments before the first file name are processed, then the + UI is opened, then the remaining arguments are processed. Actions defined for the + Director interface (currently only "open") may also be used on the command line. + For example, "SciTE -open:x.txt" will start SciTE and open x.txt. +
  • +
  • + Numbered menu items SciTE's Buffers menu and the Most Recently Used portion + of the File menu go from 1..0 rather than 0..9. +
  • +
  • + The tab bar in SciTE for Windows has numbers. + The tab.hide.one option hides the tab bar until there is more than one buffer open. +
  • +
+

+ Release 1.35 +

+
    +
  • + Released on 29 January 2001. +
  • +
  • + Rewritten and simplified widget code for the GTK+ version to enhance + solidity and make more fully compliant with platform norms. This includes more + normal handling of keystrokes so they are forwarded to containers correctly. +
  • +
  • + User defined lists can be shown. +
  • +
  • + Many fixes to the Perl lexer. +
  • +
  • + Pascal lexer handles comments more correctly. +
  • +
  • + C/C++/Java/JavaScipt lexer has a state for line doc comments. +
  • +
  • + Error output lexer understands Sun CC messages. +
  • +
  • + Make file lexer has variable, preprocessor, and operator states. +
  • +
  • + Wider area given to an italics character that is at the end of a line to prevent it + being cut off. +
  • +
  • + Call to move the caret inside the currently visible area. +
  • +
  • + Paste Rectangular will space fill on the left hand side of the pasted text as + needed to ensure it is kept rectangular. +
  • +
  • + Cut and Paste Rectangular does nothing in read-only mode. +
  • +
  • + Undo batching changed so that a paste followed by typing creates two undo actions.. +
  • +
  • + A "visibility policy" setting for Scintilla determines which range of lines are displayed + when a particular line is moved to. Also exposed as a property in SciTE. +
  • +
  • + SciTE command line allows property settings. +
  • +
  • + SciTE has a View Output command to hide or show the output pane. +
  • +
  • + SciTE's Edit menu has been split in two with searching commands moved to a + new Search menu. Find Previous and Previous Bookmark are in the Search menu. +
  • +
  • + SciTE on Windows has options for setting print margins, headers and footers. +
  • +
  • + SciTE on Windows has tooltips for toolbar. +
  • +
  • + SciTE on GTK+ has properties for setting size of file selector. +
  • +
  • + Visual and audio cues in SciTE on Windows enhanced. +
  • +
  • + Fixed performance problem in SciTE for GTK+ by dropping the extra 3D + effect on the content windows. +
  • +
  • + Fixed problem in SciTE where choosing a specific lexer then meant + that no lexer was chosen when files opened. +
  • +
  • + Default selection colour changed to be visible on low colour displays. +
  • +
  • + Fixed problems with automatically reloading changed documents in SciTE on + Windows. +
  • +
  • + Fixed problem with uppercase file extensions in SciTE. +
  • +
  • + Fixed some problems when using characters >= 128, some of which were being + incorrectly treated as spaces. +
  • +
  • + Fixed handling multiple line tags, non-inline scripts, and XML end tags /> in HTML/XML lexer. +
  • +
  • + Bookmarks in SciTE no longer disappear when switching between buffers. +
  • +
+

+ Release 1.34 +

+
    +
  • + Released on 28 November 2000. +
  • +
  • + Pascal lexer. +
  • +
  • + Export as PDF in SciTE. +
  • +
  • + Support for the OpenVMS operating system in SciTE. +
  • +
  • + SciTE for GTK+ can check for another instance of SciTE + editing a file and switch to it rather than open a second instance + on one file. +
  • +
  • + Fixes to quoting and here documents in the Perl lexer. +
  • +
  • + SciTE on Windows can give extra visual and audio cues when a + warning is shown or find restarts from beginning of file. +
  • +
  • + Open Selected Filename command in SciTE. Also understands some + warning message formats. +
  • +
  • + Wider area for line numbers when printing. +
  • +
  • + Better scrolling performance on GTK+. +
  • +
  • + Fixed problem where rectangles with negative coordinates were + invalidated leading to trouble with platforms that use + unsigned coordinates. +
  • +
  • + GTK+ Scintilla uses more compliant signalling code so that keyboard + events should propagate to containers. +
  • +
  • + Bug fixed with opening full or partial paths. +
  • +
  • + Improved handling of paths in error messages in SciTE. +
  • +
  • + Better handling of F6 in SciTE. +
  • +
+

+ Release 1.33 +

+
    +
  • + Released on 6 November 2000. +
  • +
  • + XIM support for the GTK+ version of Scintilla ensures that more non-English + characters can be typed. +
  • +
  • + Caret may be 1, 2, or 3 pixels wide. +
  • +
  • + Cursor may be switched to wait image during lengthy processing. +
  • +
  • + Scintilla's internal focus flag is exposed for clients where focus is handled in + complex ways. +
  • +
  • + Error status defined for Scintilla to hold indication that an operation failed and the reason + for that failure. No detection yet implemented but clients may start using the interface + so as to be ready for when it does. +
  • +
  • + Context sensitive help in SciTE. +
  • +
  • + CurrentWord property available in SciTE holding the value of the word the + caret is within or near. +
  • +
  • + Apache CONF file lexer. +
  • +
  • + Changes to Python lexer to allow 'as' as a context sensitive keyword and the + string forms starting with u, r, and ur to be recognised. +
  • +
  • + SCN_POSCHANGED notification now working and SCN_PAINTED notification added. +
  • +
  • + Word part movement commands for cursoring between the parts of reallyLongCamelIdentifiers and + other_ways_of_making_words. +
  • +
  • + When text on only one line is selected, Shift+Tab moves to the previous tab stop. +
  • +
  • + Tab control available for Windows version of SciTE listing all the buffers + and making it easy to switch between them. +
  • +
  • + SciTE can be set to automatically determine the line ending type from the contents of a + file when it is opened. +
  • +
  • + Dialogs in GTK+ version of SciTE made more modal and have accelerator keys. +
  • +
  • + Find in Files command in GTK+ version of SciTE allows choice of directory. +
  • +
  • + On Windows, multiple files can be opened at once. +
  • +
  • + SciTE source broken up into more files. +
  • +
  • + Scintilla headers made safe for C language, not just C++. +
  • +
  • + New printing modes - force background to white and force default background to white. +
  • +
  • + Automatic unfolding not occurring when Enter pressed at end of line bug fixed. +
  • +
  • + Bugs fixed in line selection. +
  • +
  • + Bug fixed with escapes in PHP strings in the HTML lexer. +
  • +
  • + Bug fixed in SciTE for GTK+ opening files when given full paths. +
  • +
  • + Bug fixed in autocompletion where user backspaces into existing text. +
  • +
  • + Bugs fixed in opening files and ensuring they are saved before running. + A case bug also fixed here. +
  • +
+

+ Release 1.32 +

+
    +
  • + Released on 8 September 2000. +
  • +
  • + Fixes bugs in complete word and related code. Protection against a bug when + receiving a bad argument. +
  • +
+

+ Release 1.31 +

+
    +
  • + Released on 6 September 2000. +
  • +
  • + Scintilla is available as a COM control from the scintillactrl module in CVS. +
  • +
  • + Style setting to underline text. Exposed in SciTE as "underlined". +
  • +
  • + Style setting to make text invisible. +
  • +
  • + SciTE has an extensibility interface that can be used to implement features such as + a scripting language or remote control. An example use of this is the extlua module + available from CVS which allows SciTE to be scripted in Lua. +
  • +
  • + Many minor fixes to all of the lexers. +
  • +
  • + New lexer for diff and patch files. +
  • +
  • + Error message lexer understands Perl error messages. +
  • +
  • + C/C++/Java lexer now supports C#, specifically verbatim strings and + @ quoting of identifiers that are the same as keywords. SciTE has + a set of keywords for C# and a build command set up for C#. +
  • +
  • + Scintilla property to see whether in overtype or insert state. +
  • +
  • + PosChanged notification fired when caret moved. +
  • +
  • + Comboboxes in dialogs in SciTE on Windows can be horizontally scrolled. +
  • +
  • + Autocompletion and calltips can treat the document as case sensitive or + case insensitive. +
  • +
  • + Autocompletion can be set to automatically choose the only + element in a single element list. +
  • +
  • + Set of characters that automatically complete an autocompletion list + can be set. +
  • +
  • + SciTE command to display calltip - useful when dropped because of + editing. +
  • +
  • + SciTE has a Revert command to go back to the last saved version. +
  • +
  • + SciTE has an Export as RTF command. Save as HTML is renamed + to Export as HTML and is located on the Export sub menu. +
  • +
  • + SciTE command "Complete Word" searches document for any + words starting with characters before caret. +
  • +
  • + SciTE options for changing aspects of the formatting of files exported + as HTML or RTF. +
  • +
  • + SciTE "character.set" option for choosing the character + set for all fonts. +
  • +
  • + SciTE has a "Toggle all folds" command. +
  • +
  • + The makefiles have changed. The makefile_vc and + makefile_bor files in scintilla/win32 and scite/win32 have been + merged into scintilla/win32/scintilla.mak and scite/win32/scite.mak. + DEBUG may be defined for all make files and this will turn on + assertions and for some make files will choose other debugging + options. +
  • +
  • + To make debugging easier and allow good use of BoundsChecker + there is a Visual C++ project file in scite/boundscheck that builds + all of Scintilla and SciTE into one executable. +
  • +
  • + The size of the SciTE output window can be set with the + output.horizontal.size and output.vertical.size settings. +
  • +
  • + SciTE status bar indicator for insert or overwrite mode. +
  • +
  • + Performance improvements to autocompletion and calltips. +
  • +
  • + A caret redraw problem when undoing is fixed. +
  • +
  • + Crash with long lines fixed. +
  • +
  • + Bug fixed with merging markers when lines merged. +
  • +
+

+ Release 1.30 +

+
    +
  • + Released on 26 July 2000. +
  • +
  • + Much better support for PHP which is now an integral part of the HTML support. +
  • +
  • + Start replacement of Windows-specific APIs with cross platform APIs. + In 1.30, the new APIs are introduced but the old APIs are still available. + For the GTK+ version, may have to include "WinDefs.h" explicitly to + use the old APIs. +
  • +
  • + "if" and "import" statements in SciTE properties files allows modularisation into + language-specific properties files and choices based upon platform. + This means that SciTE is delivered with 9 language-specific properties files + as well as the standard SciTEGlobal.properties file. +
  • +
  • + Much lower resource usage on Windows 9x. +
  • +
  • + "/p" option in SciTE on Windows for printing a file and then exiting. +
  • +
  • + Options for printing with inverted brightness (when the screen is set to use + a dark background) and to force black on white printing. +
  • +
  • + Option for printing magnified or miniaturised from screen settings. +
  • +
  • + In SciTE, Ctrl+F3 and Ctrl+Shift+F3 find the selection in the forwards and backwards + directions respectively. +
  • +
  • + Auto-completion lists may be set to cancel when the cursor goes before + its start position or before the start of string being completed. +
  • +
  • + Auto-completion lists automatically size more sensibly. +
  • +
  • + SCI_CLEARDOCUMENTSTYLE zeroes all style bytes, ensures all + lines are shown and deletes all folding information. +
  • +
  • + On Windows, auto-completion lists are visually outdented rather than indented. +
  • +
  • + Close all command in SciTE. +
  • +
  • + On Windows multiple files can be dragged into SciTE. +
  • +
  • + When saving a file, the SciTE option save.deletes.first deletes it before doing the save. + This allows saving with a different capitalisation on Windows. +
  • +
  • + When use tabs option is off pressing the tab key inserts spaces. +
  • +
  • + Bug in indicators leading to extra line drawn fixed. +
  • +
+

+ Release 1.28 +

+
    +
  • + Released on 27 June 2000. +
  • +
  • + Fixes crash in indentation guides when indent size set to 0. +
  • +
  • + Fixes to installation on GTK+/Linux. User properties file on GTK+ has a dot at front of name: + .SciTEUser.properties. Global properties file location configurable at compile time + defaulting to $prefix/share/scite. $prefix determined from Gnome if present else its + /usr/local and can be overridden by installer. Gnome menu integration performed in + make install if Gnome present. +
  • +
+

+ Release 1.27 +

+
    +
  • + Released on 23 June 2000. +
  • +
  • + Indentation guides. View whitespace mode may be set to not display whitespace + in indentation. +
  • +
  • + Set methods have corresponding gets for UndoCollection, BufferedDraw, + CodePage, UsePalette, ReadOnly, CaretFore, and ModEventMask. +
  • +
  • + Caret is continuously on rather than blinking while typing or holding down + delete or backspace. And is now always shown if non blinking when focused on GTK+. +
  • +
  • + Bug fixed in SciTE with file extension comparison now done in case insensitive way. +
  • +
  • + Bugs fixed in SciTE's file path handling on Windows. +
  • +
  • + Bug fixed with preprocessor '#' last visible character causing hang. +
  • +
+

+ Release 1.26 +

+
    +
  • + Released on 13 June 2000. +
  • +
  • + Support for the Lua language in both Scintilla and SciTE. +
  • +
  • + Multiple buffers may be open in SciTE. +
  • +
  • + Each style may have a character set configured. This may determine + the characters that are displayed by the style. +
  • +
  • + In the C++ lexer, lexing of preprocessor source may either treat it all as being in + the preprocessor class or only the initial # and preprocessor command word as + being in the preprocessor class. +
  • +
  • + Scintilla provides SCI_CREATEDOCUMENT, SCI_ADDREFDOCUMENT, and + SCI_RELEASEDOCUMENT to make it easier for a container to deal with multiple + documents. +
  • +
  • + GTK+ specific definitions in Scintilla.h were removed to ScintillaWidget.h. All GTK+ clients will need to + #include "ScintillaWidget.h". +
  • +
  • + For GTK+, tools can be executed in the background by setting subsystem to 2. +
  • +
  • + Keys in the properties files are now case sensitive. This leads to a performance increase. +
  • +
  • + Menu to choose which lexer to use on a file. +
  • +
  • + Tab size dialog on Windows. +
  • +
  • + File dialogs enlarged on GTK+. +
  • +
  • + Match Brace command bound to Ctrl+E on both platforms with Ctrl+] a synonym on Windows. + Ctrl+Shift+E is select to matching brace. Brace matching tries to match to either the inside or the + outside, depending on whether the cursor is inside or outside the braces initially. + View End of Line bound to Ctrl+Shift+O. +
  • +
  • + The Home key may be bound to move the caret to either the start of the line or the start of the + text on the line. +
  • +
  • + Visual C++ project file for SciTE. +
  • +
  • + Bug fixed with current x location after Tab key. +
  • +
  • + Bug fixed with hiding fold margin by setting fold.margin.width to 0. +
  • +
  • + Bugs fixed with file name confusion on Windows when long and short names used, or different capitalisations, + or relative paths. +
  • +
+

+ Release 1.25 +

+
    +
  • + Released on 9 May 2000. +
  • +
  • + Some Unicode support on Windows. Treats buffer and API as UTF-8 and displays + through UCS-2 of Windows. +
  • +
  • + Automatic indentation. Indentation size can be different to tab size. +
  • +
  • + Tool bar. +
  • +
  • + Status bar now on Windows as well as GTK+. +
  • +
  • + Input fields in Find and Replace dialogs now have history on both Windows and + GTK+. +
  • +
  • + Auto completion list items may be separated by a chosen character to allow spaces + in items. The selected item may be changed through the API. +
  • +
  • + Horizontal scrollbar can be turned off. +
  • +
  • + Property to remove trailing spaces when saving file. +
  • +
  • + On Windows, changed font size calculation to be more compatible with + other applications. +
  • +
  • + On GTK+, SciTE's global properties files are looked for in the directory specified in the + SCITE_HOME environment variable if it is set. This allows hiding in a dot directory. +
  • +
  • + Keyword lists in SciTE updated for JavaScript to include those destined to be used in + the future. IDL includes XPIDL keywords as well as MSIDL keywords. +
  • +
  • + Zoom level can be set and queried through API. +
  • +
  • + New notification sent before insertions and deletions. +
  • +
  • + LaTeX lexer. +
  • +
  • + Fixes to folding including when deletions and additions are performed. +
  • +
  • + Fix for crash with very long lines. +
  • +
  • + Fix to affect all of rectangular selections with deletion and case changing. +
  • +
  • + Removed non-working messages that had been included only for Richedit compatibility. +
  • +
+

+ Release 1.24 +

+
    +
  • + Released on 29 March 2000. +
  • +
  • + Added lexing of IDL based on C++ lexer with extra UUID lexical class. +
  • +
  • + Functions and associated keys for Line Delete, Line Cut, Line Transpose, + Selection Lower Case and Selection Upper Case. +
  • +
  • + Property setting for SciTE, eol.mode, chooses initial state of line end characters. +
  • +
  • + Fixed bugs in undo history with small almost-contiguous changes being incorrectly coalesced. +
  • +
  • + Fixed bugs with incorrect expansion of ContractionState data structures causing crash. +
  • +
  • + Fixed bugs relating to null fonts. +
  • +
  • + Fixed bugs where recolourisation was not done sometimes when required. +
  • +
  • + Fixed compilation problems with SVector.h. +
  • +
  • + Fixed bad setting of fold points in Python. +
  • +
+

+ Release 1.23 +

+
    +
  • + Released on 21 March 2000. +
  • +
  • + Directory structure to separate on basis of product (Scintilla, SciTE, DMApp) + and environment (Cross-platform, Win32, GTK+). +
  • +
  • + Download packaging to allow download of the source or platform dependent executables. +
  • +
  • + Source code now available from CVS at SourceForge. +
  • +
  • + Very simple Windows-only demonstration application DMApp is available from cvs as dmapp. +
  • +
  • + Lexing functionality may optionally be included in Scintilla rather than be provided by + the container. +
  • +
  • + Set of lexers included is determined at link time by defining which of the Lex* object files + are linked in. +
  • +
  • + On Windows, the SciLexer.DLL extends Scintilla.DLL with the standard lexers. +
  • +
  • + Enhanced HTML lexer styles embedded VBScript and Python. + ASP segments are styled and ASP scripts in JavaScript, VBScript and Python are styled. +
  • +
  • + PLSQL and PHP supported. +
  • +
  • + Maximum number of lexical states extended to 128. +
  • +
  • + Lexers may store per line parse state for multiple line features such as ASP script language choice. +
  • +
  • + Lexing API simplified. +
  • +
  • + Project file for Visual C++. +
  • +
  • + Can now cycle through all recent files with Ctrl+Tab in SciTE. +
  • +
  • + Bookmarks in SciTE. +
  • +
  • + Drag and drop copy works when dragging to the edge of the selection. +
  • +
  • + Fixed bug with value sizes in properties file. +
  • +
  • + Fixed bug with last line in properties file not being used. +
  • +
  • + Bug with multiple views of one document fixed. +
  • +
  • + Keypad now works on GTK+. +
  • +
+

+ Release 1.22 +

+
    +
  • + Released on 27 February 2000. +
  • +
  • + wxWindows platform defined. + Implementation for wxWindows will be available separately + from main Scintilla distribution. +
  • +
  • + Line folding in Scintilla. +
  • +
  • + SciTE performs syntax directed folding for C/C++/Java/JavaScript and for Python. +
  • +
  • + Optional macro recording support. +
  • +
  • + User properties file (SciTEUser.properties) allows for customisation by the user + that is not overwritten with each installation of SciTE. +
  • +
  • + Python lexer detects and highlights inconsistent indentation. +
  • +
  • + Margin API made more orthogonal. SCI_SETMARGINWIDTH and SCI_SETLINENUMBERWIDTH + are deprecated in favour of this new API. +
  • +
  • + Margins may be made sensitive to forward mouse click events to container. +
  • +
  • + SQL lexer and styles included. +
  • +
  • + Perl lexer handles regular expressions better. +
  • +
  • + Caret policy determines how closely caret is tracked by visible area. +
  • +
  • + New marker shapes: arrow pointing down, plus and minus. +
  • +
  • + Optionally display full path in title rather than just file name. +
  • +
  • + Container is notified when Scintilla gains or loses focus. +
  • +
  • + SciTE handles focus in a more standard way and applies the main + edit commands to the focused pane. +
  • +
  • + Container is notified when Scintilla determines that a line needs to be made visible. +
  • +
  • + Document watchers receive notification when document about to be deleted. +
  • +
  • + Document interface allows access to list of watchers. +
  • +
  • + Line end determined correctly for lines ending with only a '\n'. +
  • +
  • + Search variant that searches form current selection and sets selection. +
  • +
  • + SciTE understands format of diagnostic messages from WScript. +
  • +
  • + SciTE remembers top line of window for each file in MRU list so switching to a recent file + is more likely to show the same text as when the file was previously visible. +
  • +
  • + Document reference count now initialised correctly. +
  • +
  • + Setting a null document pointer creates an empty document. +
  • +
  • + WM_GETTEXT can no longer overrun buffer. +
  • +
  • + Polygon drawing bug fixed on GTK+. +
  • +
  • + Java and JavaScript lexers merged into C++ lexer. +
  • +
  • + C++ lexer indicates unterminated strings by colouring the end of the line + rather than changing the rest of the file to string style. This is less + obtrusive and helps the folding. +
  • +
+

+ Release 1.21 +

+
    +
  • + Released on 2 February 2000. +
  • +
  • + Blank margins on left and right side of text. +
  • +
  • + SCN_CHECKBRACE renamed SCN_UPDATEUI and made more efficient. +
  • +
  • + SciTE source code refactored into platform independent and platform specific classes. +
  • +
  • + XML and Perl subset lexers in SciTE. +
  • +
  • + Large improvement to lexing speed. +
  • +
  • + A new subsystem, 2, allows use of ShellExec on Windows. +
  • +
  • + Borland compatible makefile. +
  • +
  • + Status bar showing caret position in GTK+ version of SciTE. +
  • +
  • + Bug fixes to selection drawing when part of selection outside window, mouse release over + scroll bars, and scroll positioning after deletion. +
  • +
+

+ Release 1.2 +

+
    +
  • + Released on 21 January 2000. +
  • +
  • + Multiple views of one document. +
  • +
  • + Rectangular selection, cut, copy, paste, drag and drop. +
  • +
  • + Long line indication. +
  • +
  • + Reverse searching +
  • +
  • + Line end conversion. +
  • +
  • + Generic autocompletion and calltips in SciTE. +
  • +
  • + Call tip background colour can be set. +
  • +
  • + SCI_MARKERPREV for moving to a previous marker. +
  • +
  • + Caret kept more within window where possible. +
  • +
+

+ Release 1.15 +

+
    +
  • + Released on 15 December 1999. +
  • +
  • + Brace highlighting and badlighting (for mismatched braces). +
  • +
  • + Visible line ends. +
  • +
  • + Multiple line call tips. +
  • +
  • + Printing now works from SciTE on Windows. +
  • +
  • + SciTE has a global "*" lexer style that is used as the basis for all the lexers' styles. +
  • +
  • + Fixes some warnings on GTK+ 1.2.6. +
  • +
  • + Better handling of modal dialogs on GTK+. +
  • +
  • + Resize handle drawn on pane splitter in SciTE on GTK+ so it looks more like a regular GTK+ + *paned widget. +
  • +
  • + SciTE does not place window origin offscreen if no properties file found on GTK+. +
  • +
  • + File open filter remembered in SciTE on Windows. +
  • +
  • + New mechanism using style numbers 32 to 36 standardises the setting of styles for brace + highlighting, brace badlighting, line numbers, control characters and the default style. +
  • +
  • + Old messages SCI_SETFORE .. SCI_SETFONT have been replaced by the default style 32. The old + messages are deprecated and will disappear in a future version. +
  • +
+

+ Release 1.14 +

+
    +
  • + Released on 20 November 1999. +
  • +
  • + Fixes a scrolling bug reported on GTK+. +
  • +
+

+ Release 1.13 +

+
    +
  • + Released on 18 November 1999. +
  • +
  • + Fixes compilation problems with the mingw32 GCC 2.95.2 on Windows. +
  • +
  • + Control characters are now visible. +
  • +
  • + Performance has improved, particularly for scrolling. +
  • +
  • + Windows RichEdit emulation is more accurate. This may break client code that uses these + messages: EM_GETLINE, EM_GETLINECOUNT, EM_EXGETSEL, EM_EXSETSEL, EM_EXLINEFROMCHAR, + EM_LINELENGTH, EM_LINEINDEX, EM_CHARFROMPOS, EM_POSFROMCHAR, and EM_GETTEXTRANGE. +
  • +
  • + Menus rearranged and accelerator keys set for all static items. +
  • +
  • + Placement of space indicators in view whitespace mode is more accurate with some fonts. +
  • +
+

+ Release 1.12 +

+
    +
  • + Released on 9 November 1999. +
  • +
  • + Packaging error in 1.11 meant that the compilation error was not fixed in that release. + Linux/GTK+ should compile with GCC 2.95 this time. +
  • +
+

+ Release 1.11 +

+
    +
  • + Released on 7 November 1999. +
  • +
  • + Fixed a compilation bug in ScintillaGTK.cxx. +
  • +
  • + Added a README file to explain how to build. +
  • +
  • + GTK+/Linux downloads now include documentation. +
  • +
  • + Binary only Sc1.EXE one file download for Windows. +
  • +
+

+ Release 1.1 +

+
    +
  • + Released on 6 November 1999. +
  • +
  • + Major restructuring for better modularity and platform independence. +
  • +
  • + Inter-application drag and drop. +
  • +
  • + Printing support in Scintilla on Windows. +
  • +
  • + Styles can select colouring to end of line. This can be used when a file contains more than + one language to differentiate between the areas in each language. An example is the HTML + + JavaScript styling in SciTE. +
  • +
  • + Actions can be grouped in the undo stack, so they will be undone together. This grouping is + hierarchical so higher level actions such as replace all can be undone in one go. Call to + discover whether there are any actions to redo. +
  • +
  • + The set of characters that define words can be changed. +
  • +
  • + Markers now have identifiers and can be found and deleted by their identifier. The empty + marker type can be used to make a marker that is invisible and which is only used to trace + where a particular line moves to. +
  • +
  • + Double click notification. +
  • +
  • + HTML styling in SciTE also styles embedded JavaScript. +
  • +
  • + Additional tool commands can be added to SciTE. +
  • +
  • + SciTE option to allow reloading if changed upon application activation and saving on + application deactivation. Not yet working on GTK+ version. +
  • +
  • + Entry fields in search dialogs remember last 10 user entries. Not working in all cases in + Windows version. +
  • +
  • + SciTE can save a styled copy of the current file in HTML format. As SciTE does not yet + support printing, this can be used to print a file by then using a browser to print the + HTML file. +
  • +
+

+ Release 1.02 +

+
    +
  • + Released on 1 October 1999. +
  • +
  • + GTK+ version compiles with GCC 2.95. +
  • +
  • + Properly deleting objects when window destroyed under GTK+. +
  • +
  • + If the selection is not empty backspace deletes the selection. +
  • +
  • + Some X style middle mouse button handling for copying the primary selection to and from + Scintilla. Does not work in all cases. +
  • +
  • + HTML styling in SciTE. +
  • +
  • + Stopped dirty flag being set in SciTE when results pane modified. +
  • +
+

+ Release 1.01 +

+
    +
  • + Released on 28 September 1999. +
  • +
  • + Better DBCS support on Windows including IME. +
  • +
  • + Wheel mouse support for scrolling and zooming on Windows. Zooming with Ctrl+KeypadPlus and + Ctrl+KeypadMinus. +
  • +
  • + Performance improvements especially on GTK+. +
  • +
  • + Caret blinking and settable colour on both GTK+ and Windows. +
  • +
  • + Drag and drop within a Scintilla window. On Windows, files can be dragged into SciTE. +
  • +
+

+ Release 1.0 +

+
    +
  • + Released on 17 May 1999. +
  • +
  • + Changed name of "Tide" to "SciTE" to avoid clash with a TCL based IDE. "SciTE" is a + SCIntilla based Text Editor and is Latin meaning something like "understanding in a neat + way" and is also an Old English version of the word "shit". +
  • +
  • + There is a SCI_AUTOCSTOPS message for defining a string of characters that will stop + autocompletion mode. Autocompletion mode is cancelled when any cursor movement occurs apart + from backspace. +
  • +
  • + GTK+ version now splits horizontally as well as vertically and all dialogs cancel when the + escape key is pressed. +
  • +
+

+ Beta release 0.93 +

+
    +
  • + Released on 12 May 1999. +
  • +
  • + A bit more robust than 0.92 and supports SCI_MARKERNEXT message. +
  • +
+

+ Beta release 0.92 +

+
    +
  • + Released on 11 May 1999. +
  • +
  • + GTK+ version now contains all features of Windows version with some very small differences. + Executing programs works much better now. +
  • +
  • + New palette code to allow more colours to be displayed in 256 colour screen modes. A line + number column can be displayed to the left of the selection margin. +
  • +
  • + The code that maps from line numbers to text positions and back has been completely + rewritten to be faster, and to allow markers to move with the text. +
  • +
+

+ Beta release 0.91 +

+
    +
  • + Released on 30 April 1999, containing fixes to text measuring to make Scintilla work better + with bitmap fonts. Also some small fixes to make compiling work with Visual C++. +
  • +
+

+ Beta release 0.90 +

+
    +
  • + Released on 29 April 1999, containing working GTK+/Linux version. +
  • +
  • + The Java, C++ and Python lexers recognise operators as distinct from default allowing them + to be highlighted. +
  • +
+

+ Beta release 0.82 +

+
    +
  • + Released on 1 April 1999, to fix a problem with handling the Enter key in PythonWin. Also + fixes some problems with cmd key mapping. +
  • +
+

+ Beta release 0.81 +

+
    +
  • + Released on 30th March 1999, containing bug fixes and a few more features. +
  • +
  • + Static linking supported and Tidy.EXE, a statically linked version of Tide.EXE. Changes to + compiler flags in the makefiles to optimise for size. +
  • +
  • + Scintilla supports a 'savepoint' in the undo stack which can be set by the container when + the document is saved. Notifications are sent to the container when the savepoint is + entered or left, allowing the container to to display a dirty indicator and change its + menus. +
  • +
  • + When Scintilla is set to read-only mode, a notification is sent to the container should the + user try to edit the document. This can be used to check the document out of a version + control system. +
  • +
  • + There is an API for setting the appearance of indicators. +
  • +
  • + The keyboard mapping can be redefined or removed so it can be implemented completely by the + container. All of the keyboard commands are now commands which can be sent by the + container. +
  • +
  • + A home command like Visual C++ with one hit going to the start of the text on the line and + the next going to the left margin is available. I do not personally like this but my + fingers have become trained to it by much repetition. +
  • +
  • + SCI_MARKERDELETEALL has an argument in wParam which is the number of the type marker to + delete with -1 performing the old action of removing all marker types. +
  • +
  • + Tide now understands both the file name and line numbers in error messages in most cases. +
  • +
  • + Tide remembers the current lines of files in the recently used list. +
  • +
  • + Tide has a Find in Files command. +
  • +
+

+ Beta release 0.80 +

+
    +
  • + This was the first public release on 14th March 1999, containing a mostly working Win32 + Scintilla DLL and Tide EXE. +
  • +
+

+ Beta releases of SciTE were called Tide +

+ + + diff --git a/doc/Scintilla/ScintillaRelated.html b/doc/Scintilla/ScintillaRelated.html new file mode 100755 index 0000000..bc2edc8 --- /dev/null +++ b/doc/Scintilla/ScintillaRelated.html @@ -0,0 +1,507 @@ + + + + + + + + + Scintilla and SciTE Related Sites + + + + + + + + +
+ Scintilla icon + + Scintilla + and SciTE +
+

+ Related Sites +

+

+ Ports and Bindings of Scintilla +

+

+ Editawy + is an ActiveX Control wrapper that support all Scintilla functions and additional high level functions. +

+

+ Jintilla + is a JNI wrapper that allows Scintilla to be used in Java with + both SWT and AWT. +

+

+ Delphi Scintilla Interface Components + is a FREE collection of components that makes it easy to use the + Scintilla source code editing control from within Delphi and C++ Builder. +

+

+ wxStEdit + is a library and sample program that provides extra features over wxStyledTextControl. +

+

+ CScintillaCtrl, CScintillaView & CScintillaDoc + are freeware MFC classes to encapsulate Scintilla. +

+

+ ScintillaNet + is an encapsulation of Scintilla for use within the .NET framework. +

+

+ QScintilla + is a port of Scintilla to the Qt platform. It has a similar license to Qt: GPL for use in + free software and commercial for use in close-source applications. +

+

+ + GWindows is a Win32 RAD GUI Framework for Ada 95 that + includes a binding of Scintilla. +

+

+ + DolphinScintilla is a DolphinSmalltalk wrapper for Scintilla. +

+

+ ScintillaVB + is an ActiveX control written in VB that encapsulates Scintilla. +

+

+ FXScintilla + is a port of Scintilla to the FOX platform. FXRuby includes Ruby + bindings for FXScintilla. +

+

+ Delphi wrapper for + Scintilla which is also usable from Borland C++ Builder. +

+

+ The wxStyledTextCtrl editor component in the + wxWindows cross platform toolkit is based on Scintilla.
+ A Python binding for wxStyledTextCtrl is part of wxPython. +

+

+ gtkscintilla + is an alternative GTK class implementation for scintilla. + This implementation acts more like a Gtk+ object, with many methods rather + than just scintilla_send_message() and is available as a shared library. + This implementation works with GTK 1.x. +

+

+ gtkscintilla2 + is an alternative GTK class implementation for scintilla + similar to the above, but for GTK 2.x. +

+

+ pyscintilla + is the original Python binding for Scintilla's default GTK + 1.x class. Includes some additional support, such as native printing on + Windows. The binding is hand-written rather than auto-generated from the + Scintilla.iface file. +

+

+ pygtkscintilla + is a Python binding for gtk1.x scintilla that uses + gtkscintilla instead of the default GTK class. +

+

+ pyscintilla2 + is a Python binding for GTK 2.x scintilla that uses + gtkscintilla2. +

+

+ ScintillaCtrl + is an unmaintained ActiveX control wrapper for Scintilla. +

+

+ Projects using Scintilla +

+

+ PyPE + is an editor written in Python with the wxPython GUI toolkit. +

+

+ Sciboo + is an editor based on ScintillaNET. +

+

+ The Scite Config Tool + is a graphical user interface for changing SciTE properties files. +

+

+ Scintilla Lister + is a plugin for Total Commander allowing viewing all documents with syntax highlighting + inside Total Commander. +

+

+ ChSciTE + is a free IDE for C/C++ interpreter Ch. It runs cross platform. + Ch is for cross-platform scripting, shell + programming, 2D/3D plotting, numerical computing, and embedded + scripting. +

+

+ + Code::Blocks is an open source, cross platform free C++ IDE. +

+

+ + Notepad++ is a free source code editor under Windows. +

+

+ + Gubed is a cross platform program to debug PHP scripts. +

+

+ + LSW DotNet-Lab is a development environment for the .NET platform. +

+

+ + GLIntercept is an OpenGL function call interceptor that uses SciTE as a + run-time shader editor. +

+

+ + Xin is an open-source XML editor for Windows. +

+

+ + wyoEditor is "A nice editor with a well designed and consistent look and feel". +

+

+ + Notepad2 is "Yet another Notepad replacement". +

+

+ + PyCrash Viewer can examine crash dumps of Python programs. +

+

+ + MPT series Wire Analyzers use Scintilla and SciTE. +

+

+ MyGeneration + is a .NET based code generator. +

+

+ CSSED + is a tiny GTK2 CSS editor. +

+

+ DIDE + is a free IDE for the D language on Windows. +

+

+ + IdePS + is a free Integrated Development Environment for PostScript +

+

+ + CUTE + is a user-friendly source code editor easily extended using Python. +

+

+ + Venis IX, + the Visual Environment for NSIS (Nullsoft Scriptable Install System). +

+

+ + MinGW Developer Studio + is a simple C/C++ IDE for the MinGW compiler on Windows. +

+

+ Eric3 + is a Python IDE written using PyQt and QScintilla. +

+

+ TemplateTamer + is a tool for development of template based PHP web pages. +

+

+ SciTE|Flash + is a free Scintilla-based ActionScript editor for Windows. +

+

+ CPPIDE + is part of some commercial high-school oriented programming course software. +

+

+ phpSciTE + is a free distribution of SciTE for Windows customised for use with PHP + and bundled with a PHP API file and online help. +

+

+ Instant Source + is a commercial tool for looking at the HTML on web sites. +

+

+ RAD.On++ + is a free C++ Rapid Application Developer for Win32. +

+

+ wxLua is both + a binding of the wxWindows classes for Lua and a small IDE that works on Linux + and Windows. +

+

+ wxBasic is an open source + Basic interpreter that uses the wxWindows toolkit. A small IDE is under construction. +

+

+ FreeRIDE will be a + cross-platform IDE for the Ruby programming language. +

+

+ Visual MinGW is an + IDE for the MinGW compiler system.This runs on Windows with gcc. +

+

+ The Wing IDE is a + complete integrated development environment for the Python programming + language. + Available on Intel based Linux and Windows and on MacOS X through XDarwin. +

+

+ LuaIDE + is an IDE for Lua on Windows. +

+

+ Sphere + is 2D RPG engine with a development environment. +

+

+ Practical Ruby + is an IDE for Ruby on Windows. +

+

+ GNUe + is a suite of tools and applications for solving the needs of the enterprise. +

+

+ SilverCity + is a lexing package that can provide lexical analysis for over 20 programming + and markup languages. +

+

+ Php mole + is an integrated development enviroment for developing (primarily) + web based and phpgtk based applications. +

+

+ HAP Python Remote Debugger + is a Python debugger that can run on one Windows machine debugging a Python program running + on either the same or another machine. +

+

+ pyeditor and wxEditor + are scriptable editors implemented in Python. pyeditor is based on GTK+ and + the pyscintilla wrapper. wxEditor is based on wxWindows, wxPython and + wxStyledTextControl. +

+

+ Ruby installation + that includes SciTE set up for Ruby using an included copy of the "Programming Ruby" book for help. +

+

+ Interactive LuaSpace Development + is a graphical environment for LuaSpace which combines the CORBA platform + with the language Lua. +

+

+ PyCrust is an interactive + Python shell based on wxPython. +

+

+ Black Adder is a + Qt based development environment for Python and Ruby. +

+

+ Komodo + is a cross-platform multi-language development environment built + as an application of Mozilla. +

+

+ titmouse + is a Lua editor/debugger for Windows. It is available as both a component + and an application. +

+

+ Filerx + is a project manager for SciTE on Windows. + Open source and includes an implementation of SciTE's Director interface so + will be of interest to others wanting to control SciTE. +

+

+ Anjuta + is an open source C/C++ IDE for Linux/GNOME. +

+

+ Gen<X> + is a code generalisation product for Win32 that uses Scintilla in the X-Code Editor (which + can also be used for general purpose editing) and for editing HTML in the HTML Dialog + Editor. +

+

+ Moleskine is a Scintilla + based editor for GTK+. More ambitious than SciTE with plans + for MDI, printing, and session management. + Includes a new GTK+ wrapper widget for Scintilla. +

+

+ A version of SciTE for Win32 enhanced + with a tab control to allow easy movement between buffers. + Go to the "Goodies" area on this site. +

+

+ + Suneido is an integrated application platform currently available for Win32 that includes an + object-oriented language, client-server database, and user interface and reporting frameworks. +

+

+ + BitLeaf is a new GNOME based development environment. + Currently at an early stage of development. +

+

+ + Agast is an authoring system for adventure games which includes + a customised version of SciTE. +

+

+ + SashXB for Linux is an open source application development tool by + IBM that uses Scintilla. +

+

+ Boa Constructor is a RAD GUI + Building IDE for the wxWindows cross platform platform. Written using wxPython with the + wxStyledTextCtrl used as its editor. +

+

+ PythonWin, a Win32 IDE for Python, uses + Scintilla for both its editing and interactive windows. +

+

+ Editing Components +

+

+ GtkSourceView + is a text widget that extends the standard GTK+ 2.x text widget and improves it + by implementing syntax highlighting and other features typical of a source editor. +

+

+ AEditor + is a free source code editing component implemented in Ruby. +

+

+ SyntaxEditor + is a commercial native .Net source code editing component. +

+

+ jEdit is a good Open Source syntax colouring + editor written in and for Java. +

+

+ GTK+, the GIMP Toolkit, contains a rich text editing + widget.
+ Gedit is an editor for GTK+/GNOME.
+ +

+

+ CodeGuru has source code for several Win32 MFC based + editors. +

+ SynEdit is a Win32 edit control written + in Delphi. +

+ SourceView is a commercial editing + component for Win32. +

+

+ CodeMax is another commercial component for Win32. +

+

+ Documents +

+

+ The Craft of Text Editing + describes how EMACS works, Craig A. Finseth +

+

+ Span Tables + are another data structure that can be used to represent documents in memory in a way + that performs well when data is inserted and deleted, James Brown +

+

+ Data Structures in a Bit-Mapped Text + Editor, Wilfred J. Hanson, Byte January 1987 +

+

+ Text Editors: Algorithms and Architectures, Ray Valdés, Dr. Dobbs Journal + April 1993 +

+

+ Macintosh User Interface Guidelines and TextEdit chapters of Inside Macintosh +

+

+ Development Tools +

+

+ Scintilla and SciTE were developed using the + Mingw version of GCC. +

+

+ AStyle is a source code formatter for C++ and + Java code. SciTE has an Indent command defined for .cxx files that uses AStyle. +

+

+ WinMerge is an interactive diff / merge + for Windows. I prefer code submissions in the form of source files rather than diffs and then run + WinMerge over the files to work out how to merge. +

+

+ Python is my favourite programming language. Scintilla + was started after I tried to improve the editor built into PythonWin, but was frustrated by the limitations of + the Windows Richedit control which PythonWin used. +

+

+ regex is a public domain + implementation of regular expression pattern matching used in Scintilla. +

+ +

+ + Inspirational coding soundscapes by David Bridie. +

+

+ Get away from hacking without any of that tedious standing up bother: Virtually There ;). +

+ + + diff --git a/doc/Scintilla/ScintillaToDo.html b/doc/Scintilla/ScintillaToDo.html new file mode 100755 index 0000000..0fd6b0b --- /dev/null +++ b/doc/Scintilla/ScintillaToDo.html @@ -0,0 +1,178 @@ + + + + + + + + + Scintilla and SciTE To Do + + + + + + + + +
+ Scintilla icon + + Scintilla + and SciTE +
+

+ Bugs and To Do List +

+

+ Feedback +

+

+ Issues can be reported on the Bug Tracker + and features requested on the Feature Request Tracker. +

+

+ Scintilla Bugs +

+

+ At the end of italics style runs characters can be chopped off. An example + is using Verdana 12 point italics for strings makes an ending double quote + half visible and an ending single quote invisible. This is hard to solve + completely, may be better to avoid these situations by, for example, + choosing a font like Times New Roman for strings. There is a specific kluge + for the end of line which adds some room for italics but this does not + work elsewhere. +

+

+ Dragging over bold text in some fonts will ripple because of the difference in + size between drawing all of a string at once and drawing it in parts. +

+

+ Automatic scrolling when text dragged near edge of window. +

+

+ GTK+ Version Bugs +

+

+ Scintilla To Do +

+

+ Folding for languages that don't have it yet and good folding for languages + that inherited poor folding from another languages folding code. +

+

+ Simple pattern based styling. +

+

+ Different height lines based upon tallest text on the line rather than on the tallest style + possible. +

+

+ Composition of lexing for mixed languages (such as ASP+ over COBOL) by + combining lexers. +

+

+ Printing support on GTK+. Maybe Postscript output or use Gnome? +

+

+ Stream folding which could be used to fold up the contents of HTML elements. +

+

+ Persisting view state such as current folding into a stream or blob so it is easy + to restore. +

+

+ Move line up and move line down keys or move selected lines up / down. +

+

+ Printing of highlight lines and folding margin. +

+

+ Flow diagrams inside editor similar to + + GRASP. +

+

+ A VCL component wrapper around Scintilla so it can be used with Delphi or + Borland C++ Builder. + There is some work + on this available. +

+

+ Port to MacOS X. +

+

+ More lexers for other languages. +

+

+ Automatically calculated range for horizontal scrolling. +

+

+ Virtual space at the end of lines so the caret can be moved beyond the end + of lines with the cursor keys. May also make rectangular operations easier + to perform. +

+

+ SciTE To Do +

+

+ Good regular expression support through a plugin. +

+

+ Allow tools to transform the selection, performing an operation like + indentation or sorting. +

+

+ Allow file name based selection on all properties rather than just a chosen few. +

+

+ Opening from and saving to FTP servers. +

+

+ Setting to fold away comments upon opening. +

+

+ User defined fold ranges. +

+

+ Silent mode that does not display any message boxes. +

+

+ Features I am unlikely to do +

+

+ These are features I don't like or don't think are important enough to work on. + Implementations are welcome from others though. +

+

+ Automatically saving modified menu shortcuts on exit. +

+

+ Mouse wheel panning (press the mouse wheel and then move the mouse) on + Windows. +

+

+ Adding options to the save dialog to save in a particular encoding or with a + chosen line ending. +

+

+ Directions +

+

+ The main point of this development is Scintilla, and this is where most effort will + go. SciTE will get new features, but only when they make my life easier - I am + not intending to make it grow up to be a huge full-function IDE like Visual + Cafe. The lines I've currently decided not to step over in SciTE are any sort of + project facility and any configuration dialogs. SciTE for Windows now has a + Director interface for communicating with a separate project manager + application. +

+

+ If you are interested in contributing code, do not feel any need to make it cross + platform. + Just code it for your platform and I'll either reimplement for the other platform or + ensure that there is no effect on the other platform. +

+ + diff --git a/doc/Scintilla/ScintillaUsage.html b/doc/Scintilla/ScintillaUsage.html new file mode 100755 index 0000000..e0ffb0b --- /dev/null +++ b/doc/Scintilla/ScintillaUsage.html @@ -0,0 +1,375 @@ + + + + + + + + + Scintilla Usage Notes + + + + + + + + + +
+ Scintilla icon + + Scintilla + Usage Notes +
+

+ Implementing Auto-Indent +

+

+ The key idea is to use the SCN_CHARADDED notification to add indentation after a newline. +

+

+ The lParam on the notification is a pointer to a SCNotification structure whose ch member + specifies the character added. If a newline was added, the previous line can be retrieved and + the same indentation can be added to the new line. +

+

+ Here is the relevant portion of code from SciTE: (SciTE.cxx SciTEWindow::CharAdded) +

+ if  (ch  ==  '\r'  ||  ch  ==  '\n')  {
+     
char  + linebuf[1000];
+     
int  + curLine  =  GetCurrentLineNumber();
+     
int  + lineLength  + =  SendEditor(SCI_LINELENGTH,  curLine);
+     
+ //Platform::DebugPrintf("[CR] %d len = %d\n", curLine, lineLength);
+     
if  (curLine  >  0  &&  + lineLength  + <=  2)  {
+     
int  + prevLineLength  + =  SendEditor(SCI_LINELENGTH,  curLine  -  1);
+     
if  (prevLineLength  <  sizeof(linebuf))  {
+         
WORD  buflen  =  sizeof(linebuf);
+         
memcpy(linebuf,  &buflen,  sizeof(buflen));
+         
+ SendEditor(EM_GETLINE,  curLine  -  1,
+                    
+ reinterpret_cast<LPARAM>(static_cast<char  *>(linebuf)));
+         
linebuf[prevLineLength]  =  '\0';
+         
for  (int  pos  =  0;  linebuf[pos];  pos++)  {
+             
if  (linebuf[pos]  !=  ' '  &&  + linebuf[pos]  !=  '\t')
+                 
+ linebuf[pos]  =  '\0';
+         
}
+         
+ SendEditor(EM_REPLACESEL,  0,  + reinterpret_cast<LPARAM>(static_cast<char  *>(linebuf)));
+     
}
+
}
+ +

+ Of course, fancier handling could be implemented. For example, if the previous line was the + start of a control construct, the next line could be automatically indented one tab further. + (Assuming that is your indenting style.) +

+

+ Implementing Syntax Styling +

+

+ Syntax styling is handled by the SCN_STYLENEEDED notification. Scintilla keeps track of the + end of the styled text - this is retrieved with SCI_GETENDSTYLED. In response to the + SCN_STYLENEEDED notification, you should apply styles to the text from ENDSTYLED to the + position specified by the notification. +

+

+ Here is the relevant portion of code from SciTE: (SciTE.cxx) +

+ void  + SciTEWindow::Notify(SCNotification  *notification)  {
+     
switch  + (notification->nmhdr.code)  {
+     
case  + SCN_STYLENEEDED:  {
+             
if  (notification->nmhdr.idFrom  ==  IDM_SRCWIN)  {
+                 
+ int  + endStyled  =  SendEditor(SCI_GETENDSTYLED);
+                 
+ int  + lineEndStyled  =  SendEditor(EM_LINEFROMCHAR,  + endStyled);
+                 
+ endStyled  + =  SendEditor(EM_LINEINDEX,  lineEndStyled);
+                 
+ Colourise(endStyled,  notification->position);
+ +

+ Colourize(start, end) retrieves the specified range of text and then calls ColourizeDoc in + keywords.cxx. It starts the process by calling: +

+     SendMessage(hwnd,  SCI_STARTSTYLING,  + startPos,  31);
+ +

+ and then for each token of the text, calling: +

+     SendMessage(hwnd,  SCI_SETSTYLING,  length,  style);
+ +

+ where style is a number from 0 to 31 whose appearance has been defined using the + SCI_STYLESET... messages. +

+

+ Implementing Calltips +

+

+ Again, the SCN_CHARADDED notification is used to catch when an opening parenthesis is added. + The preceding word can then be retrieved from the current line: +

+     char  linebuf[1000];
+
    int  current  =  SendEditor(SCI_GETCURLINE,  sizeof(linebuf),
+         
+ reinterpret_cast<LPARAM>(static_cast<char  *>(linebuf)));
+
    int  pos  =  SendEditor(SCI_GETCURRENTPOS);
+
+
    int  startword  =  current  -  1;
+
    while  + (startword  + >  0  &&  + isalpha(linebuf[startword  -  1]))
+         
+ startword--;
+
    linebuf[current  -  1]  =  '\0';
+
    char*  word  =  linebuf  +  startword;
+ +

+ Then if a calltip is available it can be displayed. The calltip appears immediately below + the position specified. The calltip can be multiple lines separated by newlines (\n). +

+     pos  =  SendMessage(hwnd,  SCI_GETCURRENTPOS,  0,  0);
+
    SendMessageText(hwnd,  SCI_CALLTIPSHOW,  pos  -  wordLen  -  1,  calltip);
+ +

+ The calltip can be removed when a closing parenthesis is entered: +

+     if  (SendMessage(hwnd,  SCI_CALLTIPACTIVE,  + 0,  0))
+         
+ SendMessage(hwnd,  + SCI_CALLTIPCANCEL,  0,  + 0);
+ +

+ Obviously, it is up the application to look after supplying the appropriate calltip text. +

+

+ SciTE goes one step further, counting the commas between arguments and highlighting the + corresponding part of the calltip. This code is in ContinueCallTip. +

+

+ Page contributed by Andrew McKinlay. +

+ + + diff --git a/doc/Scintilla/Steps.html b/doc/Scintilla/Steps.html new file mode 100755 index 0000000..ff88e88 --- /dev/null +++ b/doc/Scintilla/Steps.html @@ -0,0 +1,142 @@ + +How to use the Scintilla Edit Control in windows? +

How to use the Scintilla Edit Control in windows?

+

+ This should be a little step by step explanation how to use Scintilla in the windows environment. +

+

+

How to create Scintilla Edit Control?

+

+ First of all, load the Scintilla DLL with something like: +

+
+
+	hmod = LoadLibrary("SciLexer.DLL");
+		if (hmod==NULL)
+		{
+			MessageBox(hwndParent,
+			"The Scintilla DLL could not be loaded.",
+			"Error loading Scintilla",
+			MB_OK | MB_ICONERROR);
+		}
+		
+

+ If the DLL was loaded successfully, then the DLL has registered (yes, by itself) a new + window class. The new class called "Scintilla" is the new scintilla edit control. +

+

+ Now you can use this new control just like any other windows control. +

+
+
+	hwndScintilla = CreateWindowEx(0,
+		"Scintilla","", WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_CLIPCHILDREN,
+		10,10,500,400,hwndParent,(HMENU)GuiID, hInstance,NULL);
+		
+

+ Note the new window class name: "Scintilla". By reaching this point you actually included + a Scintilla Edit Control to your windows program. +

+

+

How to control the Scintilla Edit Control?

+

+ You can control Scintilla by sending commands to the Edit Control. + There a 2 ways of doing this. A simple and fast way. +

+

The simple way to control Scintilla

+

+ The simple way is just like with any other windows control. You can send messages to the + Scintilla Edit Control and receive notifications from the control. (Note that the notifications + are sent to the parent window of the Scintilla Edit Control.) +

+

+ The Scintilla Edit Control knows a special message for each command. + To send commands to the Scintilla Edit Control you can use the SendMessage function. +

+
+
+	SendMessage(hwndScintilla,sci_command,wparam,lparam);
+			
+

+ like: +

+
+
+	SendMessage(hwndScintilla,SCI_CREATEDOCUMENT, 0, 0);
+			
+

+ Some of the commands will return a value and unused parameters should be set to NULL. +

+

+

The fast way to control Scintilla

+

+ The fast way of controlling the Scintilla Edit Control is to call message handling function by yourself. + You can retrieve a pointer to the message handling function of the Scintilla Edit Control and + call it directly to execute a command. This way is much more faster than the SendMessage() way. +

+

+ 1st you have to use the SCI_GETDIRECTFUNCTION and SCI_GETDIRECTPOINTER commands to + retrieve the pointer to the function and a pointer which must be the first parameter when calling the retrieved + function pointer. + You have to do this with the SendMessage way :) +

+

+ The whole thing has to look like this: +

+
+
+	int (*fn)(void*,int,int,int);
+	void * ptr;
+	int canundo;
+
+	fn = (int (__cdecl *)(void *,int,int,int))SendMessage(
+		hwndScintilla,SCI_GETDIRECTFUNCTION,0,0);
+	ptr = (void *)SendMessage(hwndScintilla,SCI_GETDIRECTPOINTER,0,0);
+
+	canundo = fn(ptr,SCI_CANUNDO,0,0);
+			
+

+ with "fn" as the function pointer to the message handling function of the Scintilla Control + and "ptr" as the pointer that must be used as 1st parameter. + The next parameters are the Scintilla Command with its two (optional) parameters. +

+ +

+

How will I receive notifications?

+

+ Whenever an event occurs where Scintilla wants to inform you about something, the Scintilla Edit Control + will send notification to the parent window. This is done by a WM_NOTITY message. + When receiving that message, you have to look in the xxx struct for the actual message. +

+

+ So in Scintillas parent window message handling function you have to include some code like this: +

+
+	NMHDR *lpnmhdr;
+
+	[...]
+
+	case WM_NOTIFY:
+		lpnmhdr = (LPNMHDR) lParam;
+
+		if(lpnmhdr->hwndFrom==hwndScintilla)
+		{
+			switch(lpnmhdr->code)
+			{
+				case SCN_CHARADDED:
+					/* Hey, Scintilla just told me that a new */
+					/* character was added to the Edit Control.*/
+					/* Now i do something cool with that char. */
+				break;
+			}
+		}
+	break;
+			
+

+

+ +

+ Page contributed by Holger Schmidt. +

+ + diff --git a/doc/Scintilla/index.html b/doc/Scintilla/index.html new file mode 100755 index 0000000..a4eeeda --- /dev/null +++ b/doc/Scintilla/index.html @@ -0,0 +1,198 @@ + + + + + + + + + + + + + + Scintilla and SciTE + + + + + + + + + + +
+ Scintilla + + A free source code editing component for Win32 and + GTK+ + + Release version 1.71
+ Site last modified August 21 2006
+
+   +
+ + + + +
+ Sci Break +
+ + + + + + + + + + + + + + + + + + + +
+ Version 1.71 defaults mouse drag to be move on GTK+ + and GTK+ also has some internationalisation fixes. +
+ Version 1.70 allows, on GTK+, approximate character set conversions + for pasting and uses internationalised input at all times. +
+ Version 1.69 supports the Spice language and can draw + the selection and whole line markers translucently. +
+ Version 1.68 can draw the caret line + and box indicators translucently and has an accurate TCL lexer. +
+ Version 1.67 enhances some lexers and fixes bugs. +
+ Version 1.66 has a new Ruby lexer and fixes bugs on GTK+ + with Pango 1.8. +
+ + + + +
+ + + Documentation   + Bugs   + + + History   Related   +
+

+ Scintilla is a free source code editing component. + It comes with complete source code and a license that + permits use in any free project or commercial product. +

+

+ As well as features found in standard text editing components, Scintilla includes features + especially useful when editing and debugging source code. + These include support for syntax styling, error indicators, code completion and call tips. + The selection margin can contain markers like those used in debuggers to indicate + breakpoints and the current line. Styling choices are more open than with many editors, + allowing the use of proportional fonts, bold and italics, multiple foreground and background + colours and multiple fonts. +

+

+ The SinkWorld project + investigates possible future directions for Scintilla to make it more flexible, robust, perform + better and run on the .NET and Java virtual machines. +

+

+ SciTE is a SCIntilla based Text Editor. Originally built to + demonstrate Scintilla, it has grown to be a generally useful editor with facilities for + building and running programs. It is best used for jobs with simple configurations - I use it + for building test and demonstration programs as well as SciTE and Scintilla, themselves. +

+

+ Development of Scintilla started as an effort to improve the text editor in PythonWin. After + being frustrated by problems in the Richedit control used by PythonWin, it looked like the + best way forward was to write a new edit control. The biggest problem with Richedit and other + similar controls is that they treat styling changes as important persistent changes to the + document so they are saved into the undo stack and set the document's dirty flag. For source + code, styling should not be persisted as it can be mechanically recreated. +

+

+ Scintilla and SciTE are currently available for Intel Win32 and Linux compatible operating + systems with GTK+. They have been run on Windows 95, NT 4.0, Windows 2000, and on Red Hat + Linux 8 and 9 with GTK+ 1.2 and 2.0. Here is a screenshot of + SciTE.
+

+

+ You can download Scintilla. +

+

+ The source code can be downloaded via CVS at the Source Forge + Scintilla project page. +

+

+ Related sites. +

+

+ Bugs and To Do list. +

+

+ History and contribution credits. +

+

+ Icons that can be used with Scintilla. +

+

+ Questions and comments about Scintilla should be directed to the + scintilla-interest + mailing list, + which is for discussion of Scintilla and related projects, their bugs and future features. + This is a low traffic list, averaging less than 50 messages per week. + To avoid spam, only list members can write to the list. + Announcements of new versions of Scintilla go to both the scintilla-interest list and + scintilla-announce. + Messages sent to my personal email address that could have been sent to the list + may receive no response. +
+

+ + + + diff --git a/doc/html/annotated.html b/doc/html/annotated.html new file mode 100644 index 0000000..f07b536 --- /dev/null +++ b/doc/html/annotated.html @@ -0,0 +1,54 @@ + + +QScintilla: Class List + + + + + + +

QScintilla Class List

Here are the classes, structs, unions and interfaces with brief descriptions: + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
QextScintillaImplements a higher level, more Qt-like, API to the Scintilla editor widget
QextScintillaAPIsTextual API information used in call tips and for auto-completion
QextScintillaBaseImplements the Scintilla editor widget and its low-level API
QextScintillaCommandInternal editor command that may have one or two keys bound to it
QextScintillaCommandSetSet of all internal editor commands that may have keys bound
QextScintillaDocumentDocument to be editted
QextScintillaLexerAbstract class used as a base for specific language lexers
QextScintillaLexerBashEncapsulates the Scintilla Bash lexer
QextScintillaLexerBatchEncapsulates the Scintilla batch file lexer
QextScintillaLexerCPPEncapsulates the Scintilla C++ lexer
QextScintillaLexerCSharpEncapsulates the Scintilla C# lexer
QextScintillaLexerCSSEncapsulates the Scintilla CSS lexer
QextScintillaLexerDiffEncapsulates the Scintilla Diff lexer
QextScintillaLexerHTMLEncapsulates the Scintilla HTML lexer
QextScintillaLexerIDLEncapsulates the Scintilla IDL lexer
QextScintillaLexerJavaEncapsulates the Scintilla Java lexer
QextScintillaLexerJavaScriptEncapsulates the Scintilla JavaScript lexer
QextScintillaLexerLuaEncapsulates the Scintilla Lua lexer
QextScintillaLexerMakefileEncapsulates the Scintilla Makefile lexer
QextScintillaLexerPerlEncapsulates the Scintilla Perl lexer
QextScintillaLexerPOVEncapsulates the Scintilla POV lexer
QextScintillaLexerPropertiesEncapsulates the Scintilla Properties lexer
QextScintillaLexerPythonEncapsulates the Scintilla Python lexer
QextScintillaLexerRubyEncapsulates the Scintilla Ruby lexer
QextScintillaLexerSQLEncapsulates the Scintilla SQL lexer
QextScintillaLexerTeXEncapsulates the Scintilla TeX lexer
QextScintillaMacroSequence of recordable editor commands
QextScintillaPrinterSub-class of the Qt QPrinter class that is able to print the text of a Scintilla document
+
Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/classQextScintilla-members.html b/doc/html/classQextScintilla-members.html new file mode 100644 index 0000000..5f05801 --- /dev/null +++ b/doc/html/classQextScintilla-members.html @@ -0,0 +1,1014 @@ + + +QScintilla: Member List + + + + + + +

QextScintilla Member List

This is the complete list of members for QextScintilla, including all inherited members.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AcsAll enum valueQextScintilla
AcsAPIs enum valueQextScintilla
AcsDocument enum valueQextScintilla
AiClosing enum valueQextScintilla
AiMaintain enum valueQextScintilla
AiOpening enum valueQextScintilla
append(const QString &text)QextScintilla [virtual, slot]
autoCompleteFromAll()QextScintilla [virtual, slot]
autoCompleteFromAPIs()QextScintilla [virtual, slot]
autoCompleteFromDocument()QextScintilla [virtual, slot]
autoCompletionCaseSensitivity()QextScintilla
autoCompletionFillupsEnabled()QextScintilla
autoCompletionReplaceWord()QextScintilla
autoCompletionShowSingle()QextScintilla
AutoCompletionSource enum nameQextScintilla
autoCompletionSource() const QextScintilla [inline]
autoCompletionThreshold() const QextScintilla [inline]
autoIndent() const QextScintilla [inline]
Background enum valueQextScintilla
backspaceUnindents()QextScintilla
beginUndoAction()QextScintilla
BottomLeftCorner enum valueQextScintilla
BoxedFoldStyle enum valueQextScintilla
BoxedMinus enum valueQextScintilla
BoxedMinusConnected enum valueQextScintilla
BoxedPlus enum valueQextScintilla
BoxedPlusConnected enum valueQextScintilla
BoxedTreeFoldStyle enum valueQextScintilla
BraceMatch enum nameQextScintilla
braceMatching() const QextScintilla [inline]
callTip()QextScintilla [virtual, slot]
callTipsVisible() const QextScintilla [inline]
cancelList()QextScintilla
CARET_EVEN enum value (defined in QextScintillaBase)QextScintillaBase
CARET_JUMPS enum value (defined in QextScintillaBase)QextScintillaBase
CARET_SLOP enum value (defined in QextScintillaBase)QextScintillaBase
CARET_STRICT enum value (defined in QextScintillaBase)QextScintillaBase
Circle enum valueQextScintilla
CircledFoldStyle enum valueQextScintilla
CircledMinus enum valueQextScintilla
CircledMinusConnected enum valueQextScintilla
CircledPlus enum valueQextScintilla
CircledPlusConnected enum valueQextScintilla
CircledTreeFoldStyle enum valueQextScintilla
clear()QextScintilla [virtual, slot]
clearRegisteredImages()QextScintilla
color() const QextScintilla
convertEols(EolMode mode)QextScintilla
copy()QextScintilla [virtual, slot]
copyAvailable(bool yes)QextScintilla [signal]
cursorPositionChanged(int line, int pos)QextScintilla [signal]
cut()QextScintilla [virtual, slot]
document()QextScintilla [inline]
DownTriangle enum valueQextScintilla
EDGE_BACKGROUND enum value (defined in QextScintillaBase)QextScintillaBase
EDGE_LINE enum value (defined in QextScintillaBase)QextScintillaBase
EDGE_NONE enum value (defined in QextScintillaBase)QextScintillaBase
EdgeBackground enum valueQextScintilla
edgeColor()QextScintilla
edgeColumn()QextScintilla
EdgeLine enum valueQextScintilla
EdgeMode enum nameQextScintilla
edgeMode()QextScintilla
EdgeNone enum valueQextScintilla
endUndoAction()QextScintilla
ensureCursorVisible()QextScintilla [virtual, slot]
ensureLineVisible(int line)QextScintilla [virtual, slot]
EolMac enum valueQextScintilla
EolMode enum nameQextScintilla
eolMode()QextScintilla
EolUnix enum valueQextScintilla
eolVisibility()QextScintilla
EolWindows enum valueQextScintilla
eventFilter(QObject *o, QEvent *e)QextScintillaBase [protected]
findFirst(const QString &expr, bool re, bool cs, bool wo, bool wrap, bool forward=TRUE, int line=-1, int index=-1, bool show=TRUE)QextScintilla [virtual]
findNext()QextScintilla [virtual]
firstVisibleLine()QextScintilla
focusInEvent(QFocusEvent *)QextScintillaBase [protected, virtual]
focusNextPrevChild(bool)QextScintillaBase [protected, virtual]
focusOutEvent(QFocusEvent *)QextScintillaBase [protected, virtual]
foldAll(bool children=FALSE)QextScintilla [virtual, slot]
folding() const QextScintilla [inline]
foldLine(int line)QextScintilla [virtual, slot]
FoldStyle enum nameQextScintilla
getCursorPosition(int *line, int *index)QextScintilla
getSelection(int *lineFrom, int *indexFrom, int *lineTo, int *indexTo)QextScintilla
hasSelectedText() const QextScintilla [inline]
indent(int line)QextScintilla [virtual, slot]
indentation(int line)QextScintilla
indentationGuides()QextScintilla
indentationsUseTabs()QextScintilla
indentationWidth()QextScintilla
INDIC0_MASK enum value (defined in QextScintillaBase)QextScintillaBase
INDIC1_MASK enum value (defined in QextScintillaBase)QextScintillaBase
INDIC2_MASK enum value (defined in QextScintillaBase)QextScintillaBase
INDIC_BOX enum value (defined in QextScintillaBase)QextScintillaBase
INDIC_DIAGONAL enum value (defined in QextScintillaBase)QextScintillaBase
INDIC_HIDDEN enum value (defined in QextScintillaBase)QextScintillaBase
INDIC_MAX enum value (defined in QextScintillaBase)QextScintillaBase
INDIC_PLAIN enum value (defined in QextScintillaBase)QextScintillaBase
INDIC_ROUNDBOX enum value (defined in QextScintillaBase)QextScintillaBase
INDIC_SQUIGGLE enum value (defined in QextScintillaBase)QextScintillaBase
INDIC_STRIKE enum value (defined in QextScintillaBase)QextScintillaBase
INDIC_TT enum value (defined in QextScintillaBase)QextScintillaBase
INDICS_MASK enum value (defined in QextScintillaBase)QextScintillaBase
insert(const QString &text)QextScintilla [virtual, slot]
insertAt(const QString &text, int line, int index)QextScintilla [virtual, slot]
Invisible enum valueQextScintilla
isCallTipActive()QextScintilla
isListActive()QextScintilla
isModified()QextScintilla
isReadOnly()QextScintilla
isRedoAvailable()QextScintilla
isUndoAvailable()QextScintilla
isUtf8()QextScintilla
keyPressEvent(QKeyEvent *ke)QextScintillaBase [protected, virtual]
LeftSideRoundedSplitter enum valueQextScintilla
LeftSideSplitter enum valueQextScintilla
length()QextScintilla
lexer() const QextScintilla
lineAt(const QPoint &pos)QextScintilla
lineLength(int line)QextScintilla
lines()QextScintilla
marginClicked(int margin, int line, Qt::ButtonState state)QextScintilla [signal]
marginLineNumbers(int margin)QextScintilla
marginMarkerMask(int margin)QextScintilla
marginSensitivity(int margin)QextScintilla
marginWidth(int margin)QextScintilla
markerAdd(int linenr, int mnr)QextScintilla
markerDefine(MarkerSymbol sym, int mnr=-1)QextScintilla
markerDefine(char ch, int mnr=-1)QextScintilla
markerDefine(const QPixmap *pm, int mnr=-1)QextScintilla
markerDelete(int linenr, int mnr=-1)QextScintilla
markerDeleteAll(int mnr=-1)QextScintilla
markerDeleteHandle(int mhandle)QextScintilla
markerFindNext(int linenr, unsigned mask)QextScintilla
markerFindPrevious(int linenr, unsigned mask)QextScintilla
markerLine(int mhandle)QextScintilla
markersAtLine(int linenr)QextScintilla
MarkerSymbol enum nameQextScintilla
Minus enum valueQextScintilla
modificationAttempted()QextScintilla [signal]
modificationChanged(bool m)QextScintilla [signal]
moveToMatchingBrace()QextScintilla [virtual, slot]
NoBraceMatch enum valueQextScintilla
NoFoldStyle enum valueQextScintilla
paper() const QextScintilla
paste()QextScintilla [virtual, slot]
PlainFoldStyle enum valueQextScintilla
Plus enum valueQextScintilla
pool()QextScintillaBase [static]
QextScintilla(QWidget *parent=0, const char *name=0, WFlags f=0)QextScintilla
QextScintillaBase(QWidget *parent=0, const char *name=0, WFlags f=0)QextScintillaBase
QSCN_SELCHANGED(bool yes)QextScintillaBase [signal]
recolor(int start=0, int end=-1)QextScintilla [virtual]
Rectangle enum valueQextScintilla
redo()QextScintilla [virtual, slot]
registerImage(int id, const QPixmap *pm)QextScintilla
removeSelectedText()QextScintilla [virtual, slot]
replace(const QString &replaceStr)QextScintilla [virtual]
resetFoldMarginColors()QextScintilla
resetSelectionBackgroundColor()QextScintilla [virtual, slot]
resetSelectionForegroundColor()QextScintilla [virtual, slot]
RightArrow enum valueQextScintilla
RightTriangle enum valueQextScintilla
RoundedBottomLeftCorner enum valueQextScintilla
SC_ALPHA_NOALPHA enum value (defined in QextScintillaBase)QextScintillaBase
SC_ALPHA_OPAQUE enum value (defined in QextScintillaBase)QextScintillaBase
SC_ALPHA_TRANSPARENT enum value (defined in QextScintillaBase)QextScintillaBase
SC_CACHE_CARET enum value (defined in QextScintillaBase)QextScintillaBase
SC_CACHE_DOCUMENT enum value (defined in QextScintillaBase)QextScintillaBase
SC_CACHE_NONE enum value (defined in QextScintillaBase)QextScintillaBase
SC_CACHE_PAGE enum value (defined in QextScintillaBase)QextScintillaBase
SC_CASE_LOWER enum value (defined in QextScintillaBase)QextScintillaBase
SC_CASE_MIXED enum value (defined in QextScintillaBase)QextScintillaBase
SC_CASE_UPPER enum value (defined in QextScintillaBase)QextScintillaBase
SC_CHARSET_8859_15 enum value (defined in QextScintillaBase)QextScintillaBase
SC_CHARSET_ANSI enum value (defined in QextScintillaBase)QextScintillaBase
SC_CHARSET_ARABIC enum value (defined in QextScintillaBase)QextScintillaBase
SC_CHARSET_BALTIC enum value (defined in QextScintillaBase)QextScintillaBase
SC_CHARSET_CHINESEBIG5 enum value (defined in QextScintillaBase)QextScintillaBase
SC_CHARSET_DEFAULT enum value (defined in QextScintillaBase)QextScintillaBase
SC_CHARSET_EASTEUROPE enum value (defined in QextScintillaBase)QextScintillaBase
SC_CHARSET_GB2312 enum value (defined in QextScintillaBase)QextScintillaBase
SC_CHARSET_GREEK enum value (defined in QextScintillaBase)QextScintillaBase
SC_CHARSET_HANGUL enum value (defined in QextScintillaBase)QextScintillaBase
SC_CHARSET_HEBREW enum value (defined in QextScintillaBase)QextScintillaBase
SC_CHARSET_JOHAB enum value (defined in QextScintillaBase)QextScintillaBase
SC_CHARSET_MAC enum value (defined in QextScintillaBase)QextScintillaBase
SC_CHARSET_OEM enum value (defined in QextScintillaBase)QextScintillaBase
SC_CHARSET_RUSSIAN enum value (defined in QextScintillaBase)QextScintillaBase
SC_CHARSET_SHIFTJIS enum value (defined in QextScintillaBase)QextScintillaBase
SC_CHARSET_SYMBOL enum value (defined in QextScintillaBase)QextScintillaBase
SC_CHARSET_THAI enum value (defined in QextScintillaBase)QextScintillaBase
SC_CHARSET_TURKISH enum value (defined in QextScintillaBase)QextScintillaBase
SC_CHARSET_VIETNAMESE enum value (defined in QextScintillaBase)QextScintillaBase
SC_CP_DBCS enum value (defined in QextScintillaBase)QextScintillaBase
SC_CP_UTF8 enum value (defined in QextScintillaBase)QextScintillaBase
SC_CURSORNORMAL enum value (defined in QextScintillaBase)QextScintillaBase
SC_CURSORWAIT enum value (defined in QextScintillaBase)QextScintillaBase
SC_EOL_CR enum value (defined in QextScintillaBase)QextScintillaBase
SC_EOL_CRLF enum value (defined in QextScintillaBase)QextScintillaBase
SC_EOL_LF enum value (defined in QextScintillaBase)QextScintillaBase
SC_FOLDFLAG_BOX enum value (defined in QextScintillaBase)QextScintillaBase
SC_FOLDFLAG_LEVELNUMBERS enum value (defined in QextScintillaBase)QextScintillaBase
SC_FOLDFLAG_LINEAFTER_CONTRACTED enum value (defined in QextScintillaBase)QextScintillaBase
SC_FOLDFLAG_LINEAFTER_EXPANDED enum value (defined in QextScintillaBase)QextScintillaBase
SC_FOLDFLAG_LINEBEFORE_CONTRACTED enum value (defined in QextScintillaBase)QextScintillaBase
SC_FOLDFLAG_LINEBEFORE_EXPANDED enum value (defined in QextScintillaBase)QextScintillaBase
SC_FOLDLEVELBASE enum value (defined in QextScintillaBase)QextScintillaBase
SC_FOLDLEVELBOXFOOTERFLAG enum value (defined in QextScintillaBase)QextScintillaBase
SC_FOLDLEVELBOXHEADERFLAG enum value (defined in QextScintillaBase)QextScintillaBase
SC_FOLDLEVELCONTRACTED enum value (defined in QextScintillaBase)QextScintillaBase
SC_FOLDLEVELHEADERFLAG enum value (defined in QextScintillaBase)QextScintillaBase
SC_FOLDLEVELNUMBERMASK enum value (defined in QextScintillaBase)QextScintillaBase
SC_FOLDLEVELUNINDENT enum value (defined in QextScintillaBase)QextScintillaBase
SC_FOLDLEVELWHITEFLAG enum value (defined in QextScintillaBase)QextScintillaBase
SC_LASTSTEPINUNDOREDO enum value (defined in QextScintillaBase)QextScintillaBase
SC_MARGIN_BACK enum valueQextScintillaBase
SC_MARGIN_FORE enum valueQextScintillaBase
SC_MARGIN_NUMBER enum valueQextScintillaBase
SC_MARGIN_SYMBOL enum valueQextScintillaBase
SC_MARK_ARROW enum valueQextScintillaBase
SC_MARK_ARROWDOWN enum valueQextScintillaBase
SC_MARK_ARROWS enum valueQextScintillaBase
SC_MARK_BACKGROUND enum valueQextScintillaBase
SC_MARK_BOXMINUS enum valueQextScintillaBase
SC_MARK_BOXMINUSCONNECTED enum valueQextScintillaBase
SC_MARK_BOXPLUS enum valueQextScintillaBase
SC_MARK_BOXPLUSCONNECTED enum valueQextScintillaBase
SC_MARK_CHARACTER enum valueQextScintillaBase
SC_MARK_CIRCLE enum valueQextScintillaBase
SC_MARK_CIRCLEMINUS enum valueQextScintillaBase
SC_MARK_CIRCLEMINUSCONNECTED enum valueQextScintillaBase
SC_MARK_CIRCLEPLUS enum valueQextScintillaBase
SC_MARK_CIRCLEPLUSCONNECTED enum valueQextScintillaBase
SC_MARK_DOTDOTDOT enum valueQextScintillaBase
SC_MARK_EMPTY enum valueQextScintillaBase
SC_MARK_FULLRECT enum valueQextScintillaBase
SC_MARK_LCORNER enum valueQextScintillaBase
SC_MARK_LCORNERCURVE enum valueQextScintillaBase
SC_MARK_MINUS enum valueQextScintillaBase
SC_MARK_PIXMAP enum valueQextScintillaBase
SC_MARK_PLUS enum valueQextScintillaBase
SC_MARK_ROUNDRECT enum valueQextScintillaBase
SC_MARK_SHORTARROW enum valueQextScintillaBase
SC_MARK_SMALLRECT enum valueQextScintillaBase
SC_MARK_TCORNER enum valueQextScintillaBase
SC_MARK_TCORNERCURVE enum valueQextScintillaBase
SC_MARK_VLINE enum valueQextScintillaBase
SC_MARKNUM_FOLDER enum value (defined in QextScintillaBase)QextScintillaBase
SC_MARKNUM_FOLDEREND enum value (defined in QextScintillaBase)QextScintillaBase
SC_MARKNUM_FOLDERMIDTAIL enum value (defined in QextScintillaBase)QextScintillaBase
SC_MARKNUM_FOLDEROPEN enum value (defined in QextScintillaBase)QextScintillaBase
SC_MARKNUM_FOLDEROPENMID enum value (defined in QextScintillaBase)QextScintillaBase
SC_MARKNUM_FOLDERSUB enum value (defined in QextScintillaBase)QextScintillaBase
SC_MARKNUM_FOLDERTAIL enum value (defined in QextScintillaBase)QextScintillaBase
SC_MASK_FOLDERS enum value (defined in QextScintillaBase)QextScintillaBase
SC_MOD_BEFOREDELETE enum value (defined in QextScintillaBase)QextScintillaBase
SC_MOD_BEFOREINSERT enum value (defined in QextScintillaBase)QextScintillaBase
SC_MOD_CHANGEFOLD enum value (defined in QextScintillaBase)QextScintillaBase
SC_MOD_CHANGEMARKER enum value (defined in QextScintillaBase)QextScintillaBase
SC_MOD_CHANGESTYLE enum value (defined in QextScintillaBase)QextScintillaBase
SC_MOD_DELETETEXT enum value (defined in QextScintillaBase)QextScintillaBase
SC_MOD_INSERTTEXT enum value (defined in QextScintillaBase)QextScintillaBase
SC_MODEVENTMASKALL enum value (defined in QextScintillaBase)QextScintillaBase
SC_MULTILINEUNDOREDO enum value (defined in QextScintillaBase)QextScintillaBase
SC_MULTISTEPUNDOREDO enum value (defined in QextScintillaBase)QextScintillaBase
SC_PERFORMED_REDO enum value (defined in QextScintillaBase)QextScintillaBase
SC_PERFORMED_UNDO enum value (defined in QextScintillaBase)QextScintillaBase
SC_PERFORMED_USER enum value (defined in QextScintillaBase)QextScintillaBase
SC_PRINT_BLACKONWHITE enum value (defined in QextScintillaBase)QextScintillaBase
SC_PRINT_COLOURONWHITE enum value (defined in QextScintillaBase)QextScintillaBase
SC_PRINT_COLOURONWHITEDEFAULTBG enum value (defined in QextScintillaBase)QextScintillaBase
SC_PRINT_INVERTLIGHT enum value (defined in QextScintillaBase)QextScintillaBase
SC_PRINT_NORMAL enum value (defined in QextScintillaBase)QextScintillaBase
SC_SEL_LINES enum value (defined in QextScintillaBase)QextScintillaBase
SC_SEL_RECTANGLE enum value (defined in QextScintillaBase)QextScintillaBase
SC_SEL_STREAM enum value (defined in QextScintillaBase)QextScintillaBase
SC_TIME_FOREVER enum value (defined in QextScintillaBase)QextScintillaBase
SC_WRAP_CHAR enum value (defined in QextScintillaBase)QextScintillaBase
SC_WRAP_NONE enum value (defined in QextScintillaBase)QextScintillaBase
SC_WRAP_WORD enum value (defined in QextScintillaBase)QextScintillaBase
SC_WRAPVISUALFLAG_END enum value (defined in QextScintillaBase)QextScintillaBase
SC_WRAPVISUALFLAG_NONE enum value (defined in QextScintillaBase)QextScintillaBase
SC_WRAPVISUALFLAG_START enum value (defined in QextScintillaBase)QextScintillaBase
SC_WRAPVISUALFLAGLOC_DEFAULT enum value (defined in QextScintillaBase)QextScintillaBase
SC_WRAPVISUALFLAGLOC_END_BY_TEXT enum value (defined in QextScintillaBase)QextScintillaBase
SC_WRAPVISUALFLAGLOC_START_BY_TEXT enum value (defined in QextScintillaBase)QextScintillaBase
SCEN_CHANGE()QextScintillaBase [signal]
SCFIND_MATCHCASE enum value (defined in QextScintillaBase)QextScintillaBase
SCFIND_POSIX enum value (defined in QextScintillaBase)QextScintillaBase
SCFIND_REGEXP enum value (defined in QextScintillaBase)QextScintillaBase
SCFIND_WHOLEWORD enum value (defined in QextScintillaBase)QextScintillaBase
SCFIND_WORDSTART enum value (defined in QextScintillaBase)QextScintillaBase
SCI_ADDREFDOCUMENT enum value (defined in QextScintillaBase)QextScintillaBase
SCI_ADDSTYLEDTEXT enum value (defined in QextScintillaBase)QextScintillaBase
SCI_ADDTEXT enum valueQextScintillaBase
SCI_ALLOCATE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_APPENDTEXT enum value (defined in QextScintillaBase)QextScintillaBase
SCI_ASSIGNCMDKEY enum value (defined in QextScintillaBase)QextScintillaBase
SCI_AUTOCACTIVE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_AUTOCCANCEL enum value (defined in QextScintillaBase)QextScintillaBase
SCI_AUTOCCOMPLETE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_AUTOCGETAUTOHIDE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_AUTOCGETCANCELATSTART enum value (defined in QextScintillaBase)QextScintillaBase
SCI_AUTOCGETCHOOSESINGLE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_AUTOCGETCURRENT enum value (defined in QextScintillaBase)QextScintillaBase
SCI_AUTOCGETDROPRESTOFWORD enum value (defined in QextScintillaBase)QextScintillaBase
SCI_AUTOCGETIGNORECASE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_AUTOCGETMAXHEIGHT enum value (defined in QextScintillaBase)QextScintillaBase
SCI_AUTOCGETMAXWIDTH enum value (defined in QextScintillaBase)QextScintillaBase
SCI_AUTOCGETSEPARATOR enum value (defined in QextScintillaBase)QextScintillaBase
SCI_AUTOCGETTYPESEPARATOR enum value (defined in QextScintillaBase)QextScintillaBase
SCI_AUTOCPOSSTART enum value (defined in QextScintillaBase)QextScintillaBase
SCI_AUTOCSELECT enum value (defined in QextScintillaBase)QextScintillaBase
SCI_AUTOCSETAUTOHIDE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_AUTOCSETCANCELATSTART enum value (defined in QextScintillaBase)QextScintillaBase
SCI_AUTOCSETCHOOSESINGLE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_AUTOCSETDROPRESTOFWORD enum value (defined in QextScintillaBase)QextScintillaBase
SCI_AUTOCSETFILLUPS enum value (defined in QextScintillaBase)QextScintillaBase
SCI_AUTOCSETIGNORECASE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_AUTOCSETMAXHEIGHT enum value (defined in QextScintillaBase)QextScintillaBase
SCI_AUTOCSETMAXWIDTH enum value (defined in QextScintillaBase)QextScintillaBase
SCI_AUTOCSETSEPARATOR enum value (defined in QextScintillaBase)QextScintillaBase
SCI_AUTOCSETTYPESEPARATOR enum value (defined in QextScintillaBase)QextScintillaBase
SCI_AUTOCSHOW enum value (defined in QextScintillaBase)QextScintillaBase
SCI_AUTOCSTOPS enum value (defined in QextScintillaBase)QextScintillaBase
SCI_BACKTAB enum value (defined in QextScintillaBase)QextScintillaBase
SCI_BEGINUNDOACTION enum value (defined in QextScintillaBase)QextScintillaBase
SCI_BRACEBADLIGHT enum value (defined in QextScintillaBase)QextScintillaBase
SCI_BRACEHIGHLIGHT enum value (defined in QextScintillaBase)QextScintillaBase
SCI_BRACEMATCH enum value (defined in QextScintillaBase)QextScintillaBase
SCI_CALLTIPACTIVE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_CALLTIPCANCEL enum value (defined in QextScintillaBase)QextScintillaBase
SCI_CALLTIPPOSSTART enum value (defined in QextScintillaBase)QextScintillaBase
SCI_CALLTIPSETBACK enum value (defined in QextScintillaBase)QextScintillaBase
SCI_CALLTIPSETFORE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_CALLTIPSETFOREHLT enum value (defined in QextScintillaBase)QextScintillaBase
SCI_CALLTIPSETHLT enum value (defined in QextScintillaBase)QextScintillaBase
SCI_CALLTIPSHOW enum value (defined in QextScintillaBase)QextScintillaBase
SCI_CALLTIPUSESTYLE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_CANCEL enum value (defined in QextScintillaBase)QextScintillaBase
SCI_CANPASTE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_CANREDO enum value (defined in QextScintillaBase)QextScintillaBase
SCI_CANUNDO enum value (defined in QextScintillaBase)QextScintillaBase
SCI_CHARLEFT enum value (defined in QextScintillaBase)QextScintillaBase
SCI_CHARLEFTEXTEND enum value (defined in QextScintillaBase)QextScintillaBase
SCI_CHARLEFTRECTEXTEND enum value (defined in QextScintillaBase)QextScintillaBase
SCI_CHARRIGHT enum value (defined in QextScintillaBase)QextScintillaBase
SCI_CHARRIGHTEXTEND enum value (defined in QextScintillaBase)QextScintillaBase
SCI_CHARRIGHTRECTEXTEND enum value (defined in QextScintillaBase)QextScintillaBase
SCI_CHOOSECARETX enum value (defined in QextScintillaBase)QextScintillaBase
SCI_CLEAR enum value (defined in QextScintillaBase)QextScintillaBase
SCI_CLEARALL enum value (defined in QextScintillaBase)QextScintillaBase
SCI_CLEARALLCMDKEYS enum value (defined in QextScintillaBase)QextScintillaBase
SCI_CLEARCMDKEY enum value (defined in QextScintillaBase)QextScintillaBase
SCI_CLEARDOCUMENTSTYLE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_CLEARREGISTEREDIMAGES enum valueQextScintillaBase
SCI_COLOURISE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_CONVERTEOLS enum value (defined in QextScintillaBase)QextScintillaBase
SCI_COPY enum value (defined in QextScintillaBase)QextScintillaBase
SCI_COPYRANGE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_COPYTEXT enum value (defined in QextScintillaBase)QextScintillaBase
SCI_CREATEDOCUMENT enum value (defined in QextScintillaBase)QextScintillaBase
SCI_CUT enum value (defined in QextScintillaBase)QextScintillaBase
SCI_DELETEBACK enum value (defined in QextScintillaBase)QextScintillaBase
SCI_DELETEBACKNOTLINE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_DELLINELEFT enum value (defined in QextScintillaBase)QextScintillaBase
SCI_DELLINERIGHT enum value (defined in QextScintillaBase)QextScintillaBase
SCI_DELWORDLEFT enum value (defined in QextScintillaBase)QextScintillaBase
SCI_DELWORDRIGHT enum value (defined in QextScintillaBase)QextScintillaBase
SCI_DOCLINEFROMVISIBLE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_DOCUMENTEND enum value (defined in QextScintillaBase)QextScintillaBase
SCI_DOCUMENTENDEXTEND enum value (defined in QextScintillaBase)QextScintillaBase
SCI_DOCUMENTSTART enum value (defined in QextScintillaBase)QextScintillaBase
SCI_DOCUMENTSTARTEXTEND enum value (defined in QextScintillaBase)QextScintillaBase
SCI_EDITTOGGLEOVERTYPE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_EMPTYUNDOBUFFER enum valueQextScintillaBase
SCI_ENDUNDOACTION enum value (defined in QextScintillaBase)QextScintillaBase
SCI_ENSUREVISIBLE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_ENSUREVISIBLEENFORCEPOLICY enum value (defined in QextScintillaBase)QextScintillaBase
SCI_FINDCOLUMN enum value (defined in QextScintillaBase)QextScintillaBase
SCI_FINDTEXT enum value (defined in QextScintillaBase)QextScintillaBase
SCI_FORMATRANGE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_FORMFEED enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETANCHOR enum valueQextScintillaBase
SCI_GETBACKSPACEUNINDENTS enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETBUFFEREDDRAW enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETCARETFORE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETCARETLINEBACK enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETCARETLINEBACKALPHA enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETCARETLINEVISIBLE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETCARETPERIOD enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETCARETSTICKY enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETCARETWIDTH enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETCHARAT enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETCODEPAGE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETCOLUMN enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETCONTROLCHARSYMBOL enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETCURLINE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETCURRENTPOS enum valueQextScintillaBase
SCI_GETCURSOR enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETDIRECTFUNCTION enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETDIRECTPOINTER enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETDOCPOINTER enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETEDGECOLOUR enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETEDGECOLUMN enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETEDGEMODE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETENDATLASTLINE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETENDSTYLED enum valueQextScintillaBase
SCI_GETEOLMODE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETFIRSTVISIBLELINE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETFOCUS enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETFOLDEXPANDED enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETFOLDLEVEL enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETFOLDPARENT enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETHIGHLIGHTGUIDE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETHSCROLLBAR enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETINDENT enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETINDENTATIONGUIDES enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETLASTCHILD enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETLAYOUTCACHE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETLENGTH enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETLEXER enum valueQextScintillaBase
SCI_GETLINE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETLINECOUNT enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETLINEENDPOSITION enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETLINEINDENTATION enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETLINEINDENTPOSITION enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETLINESELENDPOSITION enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETLINESELSTARTPOSITION enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETLINESTATE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETLINEVISIBLE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETMARGINLEFT enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETMARGINMASKN enum valueQextScintillaBase
SCI_GETMARGINRIGHT enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETMARGINSENSITIVEN enum valueQextScintillaBase
SCI_GETMARGINTYPEN enum valueQextScintillaBase
SCI_GETMARGINWIDTHN enum valueQextScintillaBase
SCI_GETMAXLINESTATE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETMODEVENTMASK enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETMODIFY enum valueQextScintillaBase
SCI_GETMOUSEDOWNCAPTURES enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETMOUSEDWELLTIME enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETOVERTYPE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETPASTECONVERTENDINGS enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETPRINTCOLOURMODE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETPRINTMAGNIFICATION enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETPRINTWRAPMODE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETPROPERTY enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETPROPERTYEXPANDED enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETPROPERTYINT enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETREADONLY enum valueQextScintillaBase
SCI_GETSCROLLWIDTH enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETSEARCHFLAGS enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETSELALPHA enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETSELECTIONEND enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETSELECTIONMODE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETSELECTIONSTART enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETSELTEXT enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETSTATUS enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETSTYLEAT enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETSTYLEBITS enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETSTYLEBITSNEEDED enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETSTYLEDTEXT enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETTABINDENTS enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETTABWIDTH enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETTARGETEND enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETTARGETSTART enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETTEXT enum valueQextScintillaBase
SCI_GETTEXTLENGTH enum valueQextScintillaBase
SCI_GETTEXTRANGE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETTWOPHASEDRAW enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETUNDOCOLLECTION enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETUSEPALETTE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETUSETABS enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETVIEWEOL enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETVIEWWS enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETVSCROLLBAR enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETWRAPMODE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETWRAPSTARTINDENT enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETWRAPVISUALFLAGS enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETWRAPVISUALFLAGSLOCATION enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETXOFFSET enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETZOOM enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GOTOLINE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GOTOPOS enum valueQextScintillaBase
SCI_GRABFOCUS enum value (defined in QextScintillaBase)QextScintillaBase
SCI_HIDELINES enum value (defined in QextScintillaBase)QextScintillaBase
SCI_HIDESELECTION enum value (defined in QextScintillaBase)QextScintillaBase
SCI_HOME enum value (defined in QextScintillaBase)QextScintillaBase
SCI_HOMEDISPLAY enum value (defined in QextScintillaBase)QextScintillaBase
SCI_HOMEDISPLAYEXTEND enum value (defined in QextScintillaBase)QextScintillaBase
SCI_HOMEEXTEND enum value (defined in QextScintillaBase)QextScintillaBase
SCI_HOMERECTEXTEND enum value (defined in QextScintillaBase)QextScintillaBase
SCI_HOMEWRAP enum value (defined in QextScintillaBase)QextScintillaBase
SCI_HOMEWRAPEXTEND enum value (defined in QextScintillaBase)QextScintillaBase
SCI_INDICGETFORE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_INDICGETSTYLE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_INDICSETFORE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_INDICSETSTYLE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_INSERTTEXT enum value (defined in QextScintillaBase)QextScintillaBase
SCI_LEXER_START enum value (defined in QextScintillaBase)QextScintillaBase
SCI_LINECOPY enum value (defined in QextScintillaBase)QextScintillaBase
SCI_LINECUT enum value (defined in QextScintillaBase)QextScintillaBase
SCI_LINEDELETE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_LINEDOWN enum value (defined in QextScintillaBase)QextScintillaBase
SCI_LINEDOWNEXTEND enum value (defined in QextScintillaBase)QextScintillaBase
SCI_LINEDOWNRECTEXTEND enum value (defined in QextScintillaBase)QextScintillaBase
SCI_LINEDUPLICATE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_LINEEND enum value (defined in QextScintillaBase)QextScintillaBase
SCI_LINEENDDISPLAY enum value (defined in QextScintillaBase)QextScintillaBase
SCI_LINEENDDISPLAYEXTEND enum value (defined in QextScintillaBase)QextScintillaBase
SCI_LINEENDEXTEND enum value (defined in QextScintillaBase)QextScintillaBase
SCI_LINEENDRECTEXTEND enum value (defined in QextScintillaBase)QextScintillaBase
SCI_LINEENDWRAP enum value (defined in QextScintillaBase)QextScintillaBase
SCI_LINEENDWRAPEXTEND enum value (defined in QextScintillaBase)QextScintillaBase
SCI_LINEFROMPOSITION enum value (defined in QextScintillaBase)QextScintillaBase
SCI_LINELENGTH enum value (defined in QextScintillaBase)QextScintillaBase
SCI_LINESCROLL enum value (defined in QextScintillaBase)QextScintillaBase
SCI_LINESCROLLDOWN enum value (defined in QextScintillaBase)QextScintillaBase
SCI_LINESCROLLUP enum value (defined in QextScintillaBase)QextScintillaBase
SCI_LINESJOIN enum value (defined in QextScintillaBase)QextScintillaBase
SCI_LINESONSCREEN enum value (defined in QextScintillaBase)QextScintillaBase
SCI_LINESSPLIT enum value (defined in QextScintillaBase)QextScintillaBase
SCI_LINETRANSPOSE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_LINEUP enum value (defined in QextScintillaBase)QextScintillaBase
SCI_LINEUPEXTEND enum value (defined in QextScintillaBase)QextScintillaBase
SCI_LINEUPRECTEXTEND enum value (defined in QextScintillaBase)QextScintillaBase
SCI_LOADLEXERLIBRARY enum value (defined in QextScintillaBase)QextScintillaBase
SCI_LOWERCASE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_MARKERADD enum valueQextScintillaBase
SCI_MARKERADDSET enum value (defined in QextScintillaBase)QextScintillaBase
SCI_MARKERDEFINE enum valueQextScintillaBase
SCI_MARKERDEFINEPIXMAP enum valueQextScintillaBase
SCI_MARKERDELETE enum valueQextScintillaBase
SCI_MARKERDELETEALL enum valueQextScintillaBase
SCI_MARKERDELETEHANDLE enum valueQextScintillaBase
SCI_MARKERGET enum valueQextScintillaBase
SCI_MARKERLINEFROMHANDLE enum valueQextScintillaBase
SCI_MARKERNEXT enum valueQextScintillaBase
SCI_MARKERPREVIOUS enum valueQextScintillaBase
SCI_MARKERSETALPHA enum value (defined in QextScintillaBase)QextScintillaBase
SCI_MARKERSETBACK enum valueQextScintillaBase
SCI_MARKERSETFORE enum valueQextScintillaBase
SCI_MOVECARETINSIDEVIEW enum value (defined in QextScintillaBase)QextScintillaBase
SCI_NEWLINE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_NULL enum value (defined in QextScintillaBase)QextScintillaBase
SCI_OPTIONAL_START enum value (defined in QextScintillaBase)QextScintillaBase
SCI_PAGEDOWN enum value (defined in QextScintillaBase)QextScintillaBase
SCI_PAGEDOWNEXTEND enum value (defined in QextScintillaBase)QextScintillaBase
SCI_PAGEDOWNRECTEXTEND enum value (defined in QextScintillaBase)QextScintillaBase
SCI_PAGEUP enum value (defined in QextScintillaBase)QextScintillaBase
SCI_PAGEUPEXTEND enum value (defined in QextScintillaBase)QextScintillaBase
SCI_PAGEUPRECTEXTEND enum value (defined in QextScintillaBase)QextScintillaBase
SCI_PARADOWN enum value (defined in QextScintillaBase)QextScintillaBase
SCI_PARADOWNEXTEND enum value (defined in QextScintillaBase)QextScintillaBase
SCI_PARAUP enum value (defined in QextScintillaBase)QextScintillaBase
SCI_PARAUPEXTEND enum value (defined in QextScintillaBase)QextScintillaBase
SCI_PASTE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_POINTXFROMPOSITION enum value (defined in QextScintillaBase)QextScintillaBase
SCI_POINTYFROMPOSITION enum value (defined in QextScintillaBase)QextScintillaBase
SCI_POSITIONAFTER enum value (defined in QextScintillaBase)QextScintillaBase
SCI_POSITIONBEFORE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_POSITIONFROMLINE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_POSITIONFROMPOINT enum value (defined in QextScintillaBase)QextScintillaBase
SCI_POSITIONFROMPOINTCLOSE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_REDO enum value (defined in QextScintillaBase)QextScintillaBase
SCI_REGISTERIMAGE enum valueQextScintillaBase
SCI_RELEASEDOCUMENT enum value (defined in QextScintillaBase)QextScintillaBase
SCI_REPLACESEL enum value (defined in QextScintillaBase)QextScintillaBase
SCI_REPLACETARGET enum value (defined in QextScintillaBase)QextScintillaBase
SCI_REPLACETARGETRE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SCROLLCARET enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SEARCHANCHOR enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SEARCHINTARGET enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SEARCHNEXT enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SEARCHPREV enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SELECTALL enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SELECTIONDUPLICATE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SELECTIONISRECTANGLE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETANCHOR enum valueQextScintillaBase
SCI_SETBACKSPACEUNINDENTS enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETBUFFEREDDRAW enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETCARETFORE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETCARETLINEBACK enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETCARETLINEBACKALPHA enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETCARETLINEVISIBLE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETCARETPERIOD enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETCARETSTICKY enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETCARETWIDTH enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETCHARSDEFAULT enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETCODEPAGE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETCONTROLCHARSYMBOL enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETCURRENTPOS enum valueQextScintillaBase
SCI_SETCURSOR enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETDOCPOINTER enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETEDGECOLOUR enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETEDGECOLUMN enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETEDGEMODE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETENDATLASTLINE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETEOLMODE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETFOCUS enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETFOLDEXPANDED enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETFOLDFLAGS enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETFOLDLEVEL enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETFOLDMARGINCOLOUR enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETFOLDMARGINHICOLOUR enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETHIGHLIGHTGUIDE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETHOTSPOTACTIVEBACK enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETHOTSPOTACTIVEFORE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETHOTSPOTACTIVEUNDERLINE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETHSCROLLBAR enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETINDENT enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETINDENTATIONGUIDES enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETKEYWORDS enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETLAYOUTCACHE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETLEXER enum valueQextScintillaBase
SCI_SETLEXERLANGUAGE enum valueQextScintillaBase
SCI_SETLINEINDENTATION enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETLINESTATE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETMARGINLEFT enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETMARGINMASKN enum valueQextScintillaBase
SCI_SETMARGINRIGHT enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETMARGINSENSITIVEN enum valueQextScintillaBase
SCI_SETMARGINTYPEN enum valueQextScintillaBase
SCI_SETMARGINWIDTHN enum valueQextScintillaBase
SCI_SETMODEVENTMASK enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETMOUSEDOWNCAPTURES enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETMOUSEDWELLTIME enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETOVERTYPE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETPASTECONVERTENDINGS enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETPRINTCOLOURMODE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETPRINTMAGNIFICATION enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETPRINTWRAPMODE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETPROPERTY enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETREADONLY enum valueQextScintillaBase
SCI_SETSAVEPOINT enum valueQextScintillaBase
SCI_SETSCROLLWIDTH enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETSEARCHFLAGS enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETSEL enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETSELALPHA enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETSELBACK enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETSELECTIONEND enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETSELECTIONMODE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETSELECTIONSTART enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETSELFORE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETSTATUS enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETSTYLEBITS enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETSTYLING enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETSTYLINGEX enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETTABINDENTS enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETTABWIDTH enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETTARGETEND enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETTARGETSTART enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETTEXT enum valueQextScintillaBase
SCI_SETTWOPHASEDRAW enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETUNDOCOLLECTION enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETUSEPALETTE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETUSETABS enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETVIEWEOL enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETVIEWWS enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETVISIBLEPOLICY enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETVSCROLLBAR enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETWHITESPACEBACK enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETWHITESPACECHARS enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETWHITESPACEFORE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETWORDCHARS enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETWRAPMODE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETWRAPSTARTINDENT enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETWRAPVISUALFLAGS enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETWRAPVISUALFLAGSLOCATION enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETXCARETPOLICY enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETXOFFSET enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETYCARETPOLICY enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETZOOM enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SHOWLINES enum value (defined in QextScintillaBase)QextScintillaBase
SCI_START enum value (defined in QextScintillaBase)QextScintillaBase
SCI_STARTRECORD enum value (defined in QextScintillaBase)QextScintillaBase
SCI_STARTSTYLING enum value (defined in QextScintillaBase)QextScintillaBase
SCI_STOPRECORD enum value (defined in QextScintillaBase)QextScintillaBase
SCI_STUTTEREDPAGEDOWN enum value (defined in QextScintillaBase)QextScintillaBase
SCI_STUTTEREDPAGEDOWNEXTEND enum value (defined in QextScintillaBase)QextScintillaBase
SCI_STUTTEREDPAGEUP enum value (defined in QextScintillaBase)QextScintillaBase
SCI_STUTTEREDPAGEUPEXTEND enum value (defined in QextScintillaBase)QextScintillaBase
SCI_STYLECLEARALL enum value (defined in QextScintillaBase)QextScintillaBase
SCI_STYLERESETDEFAULT enum value (defined in QextScintillaBase)QextScintillaBase
SCI_STYLESETBACK enum value (defined in QextScintillaBase)QextScintillaBase
SCI_STYLESETBOLD enum value (defined in QextScintillaBase)QextScintillaBase
SCI_STYLESETCASE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_STYLESETCHANGEABLE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_STYLESETCHARACTERSET enum value (defined in QextScintillaBase)QextScintillaBase
SCI_STYLESETEOLFILLED enum value (defined in QextScintillaBase)QextScintillaBase
SCI_STYLESETFONT enum value (defined in QextScintillaBase)QextScintillaBase
SCI_STYLESETFORE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_STYLESETHOTSPOT enum value (defined in QextScintillaBase)QextScintillaBase
SCI_STYLESETITALIC enum value (defined in QextScintillaBase)QextScintillaBase
SCI_STYLESETSIZE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_STYLESETUNDERLINE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_STYLESETVISIBLE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_TAB enum value (defined in QextScintillaBase)QextScintillaBase
SCI_TARGETFROMSELECTION enum value (defined in QextScintillaBase)QextScintillaBase
SCI_TEXTHEIGHT enum value (defined in QextScintillaBase)QextScintillaBase
SCI_TEXTWIDTH enum valueQextScintillaBase
SCI_TOGGLECARETSTICKY enum value (defined in QextScintillaBase)QextScintillaBase
SCI_TOGGLEFOLD enum value (defined in QextScintillaBase)QextScintillaBase
SCI_UNDO enum value (defined in QextScintillaBase)QextScintillaBase
SCI_UPPERCASE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_USEPOPUP enum value (defined in QextScintillaBase)QextScintillaBase
SCI_USERLISTSHOW enum value (defined in QextScintillaBase)QextScintillaBase
SCI_VCHOME enum value (defined in QextScintillaBase)QextScintillaBase
SCI_VCHOMEEXTEND enum value (defined in QextScintillaBase)QextScintillaBase
SCI_VCHOMERECTEXTEND enum value (defined in QextScintillaBase)QextScintillaBase
SCI_VCHOMEWRAP enum value (defined in QextScintillaBase)QextScintillaBase
SCI_VCHOMEWRAPEXTEND enum value (defined in QextScintillaBase)QextScintillaBase
SCI_VISIBLEFROMDOCLINE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_WORDENDPOSITION enum value (defined in QextScintillaBase)QextScintillaBase
SCI_WORDLEFT enum value (defined in QextScintillaBase)QextScintillaBase
SCI_WORDLEFTEND enum value (defined in QextScintillaBase)QextScintillaBase
SCI_WORDLEFTENDEXTEND enum value (defined in QextScintillaBase)QextScintillaBase
SCI_WORDLEFTEXTEND enum value (defined in QextScintillaBase)QextScintillaBase
SCI_WORDPARTLEFT enum value (defined in QextScintillaBase)QextScintillaBase
SCI_WORDPARTLEFTEXTEND enum value (defined in QextScintillaBase)QextScintillaBase
SCI_WORDPARTRIGHT enum value (defined in QextScintillaBase)QextScintillaBase
SCI_WORDPARTRIGHTEXTEND enum value (defined in QextScintillaBase)QextScintillaBase
SCI_WORDRIGHT enum value (defined in QextScintillaBase)QextScintillaBase
SCI_WORDRIGHTEND enum value (defined in QextScintillaBase)QextScintillaBase
SCI_WORDRIGHTENDEXTEND enum value (defined in QextScintillaBase)QextScintillaBase
SCI_WORDRIGHTEXTEND enum value (defined in QextScintillaBase)QextScintillaBase
SCI_WORDSTARTPOSITION enum value (defined in QextScintillaBase)QextScintillaBase
SCI_WRAPCOUNT enum value (defined in QextScintillaBase)QextScintillaBase
SCI_ZOOMIN enum value (defined in QextScintillaBase)QextScintillaBase
SCI_ZOOMOUT enum value (defined in QextScintillaBase)QextScintillaBase
SCK_ADD enum value (defined in QextScintillaBase)QextScintillaBase
SCK_BACK enum value (defined in QextScintillaBase)QextScintillaBase
SCK_DELETE enum value (defined in QextScintillaBase)QextScintillaBase
SCK_DIVIDE enum value (defined in QextScintillaBase)QextScintillaBase
SCK_DOWN enum value (defined in QextScintillaBase)QextScintillaBase
SCK_END enum value (defined in QextScintillaBase)QextScintillaBase
SCK_ESCAPE enum value (defined in QextScintillaBase)QextScintillaBase
SCK_HOME enum value (defined in QextScintillaBase)QextScintillaBase
SCK_INSERT enum value (defined in QextScintillaBase)QextScintillaBase
SCK_LEFT enum value (defined in QextScintillaBase)QextScintillaBase
SCK_NEXT enum value (defined in QextScintillaBase)QextScintillaBase
SCK_PRIOR enum value (defined in QextScintillaBase)QextScintillaBase
SCK_RETURN enum value (defined in QextScintillaBase)QextScintillaBase
SCK_RIGHT enum value (defined in QextScintillaBase)QextScintillaBase
SCK_SUBTRACT enum value (defined in QextScintillaBase)QextScintillaBase
SCK_TAB enum value (defined in QextScintillaBase)QextScintillaBase
SCK_UP enum value (defined in QextScintillaBase)QextScintillaBase
SCLEX_ADA enum valueQextScintillaBase
SCLEX_APDL enum valueQextScintillaBase
SCLEX_ASM enum valueQextScintillaBase
SCLEX_ASN1 enum valueQextScintillaBase
SCLEX_ASP enum valueQextScintillaBase
SCLEX_AU3 enum valueQextScintillaBase
SCLEX_AVE enum valueQextScintillaBase
SCLEX_BAAN enum valueQextScintillaBase
SCLEX_BASH enum valueQextScintillaBase
SCLEX_BATCH enum valueQextScintillaBase
SCLEX_BLITZBASIC enum valueQextScintillaBase
SCLEX_BULLANT enum valueQextScintillaBase
SCLEX_CAML enum valueQextScintillaBase
SCLEX_CLW enum valueQextScintillaBase
SCLEX_CLWNOCASE enum valueQextScintillaBase
SCLEX_CONF enum valueQextScintillaBase
SCLEX_CONTAINER enum valueQextScintillaBase
SCLEX_CPP enum valueQextScintillaBase
SCLEX_CPPNOCASE enum valueQextScintillaBase
SCLEX_CSOUND enum valueQextScintillaBase
SCLEX_CSS enum valueQextScintillaBase
SCLEX_DIFF enum valueQextScintillaBase
SCLEX_EIFFEL enum valueQextScintillaBase
SCLEX_EIFFELKW enum valueQextScintillaBase
SCLEX_ERLANG enum valueQextScintillaBase
SCLEX_ERRORLIST enum valueQextScintillaBase
SCLEX_ESCRIPT enum valueQextScintillaBase
SCLEX_F77 enum valueQextScintillaBase
SCLEX_FLAGSHIP enum valueQextScintillaBase
SCLEX_FORTH enum valueQextScintillaBase
SCLEX_FORTRAN enum valueQextScintillaBase
SCLEX_FREEBASIC enum valueQextScintillaBase
SCLEX_GUI4CLI enum valueQextScintillaBase
SCLEX_HASKELL enum valueQextScintillaBase
SCLEX_HTML enum valueQextScintillaBase
SCLEX_INNOSETUP enum valueQextScintillaBase
SCLEX_KIX enum valueQextScintillaBase
SCLEX_LATEX enum valueQextScintillaBase
SCLEX_LISP enum valueQextScintillaBase
SCLEX_LOT enum valueQextScintillaBase
SCLEX_LOUT enum valueQextScintillaBase
SCLEX_LUA enum valueQextScintillaBase
SCLEX_MAKEFILE enum valueQextScintillaBase
SCLEX_MATLAB enum valueQextScintillaBase
SCLEX_METAPOST enum valueQextScintillaBase
SCLEX_MMIXAL enum valueQextScintillaBase
SCLEX_MSSQL enum valueQextScintillaBase
SCLEX_NNCRONTAB enum valueQextScintillaBase
SCLEX_NSIS enum valueQextScintillaBase
SCLEX_NULL enum valueQextScintillaBase
SCLEX_OCTAVE enum valueQextScintillaBase
SCLEX_OPAL enum valueQextScintillaBase
SCLEX_PASCAL enum valueQextScintillaBase
SCLEX_PERL enum valueQextScintillaBase
SCLEX_PHP enum valueQextScintillaBase
SCLEX_PHPSCRIPT enum valueQextScintillaBase
SCLEX_POV enum valueQextScintillaBase
SCLEX_POWERBASIC enum valueQextScintillaBase
SCLEX_PROPERTIES enum valueQextScintillaBase
SCLEX_PS enum valueQextScintillaBase
SCLEX_PUREBASIC enum valueQextScintillaBase
SCLEX_PYTHON enum valueQextScintillaBase
SCLEX_REBOL enum valueQextScintillaBase
SCLEX_RUBY enum valueQextScintillaBase
SCLEX_SCRIPTOL enum valueQextScintillaBase
SCLEX_SMALLTALK enum valueQextScintillaBase
SCLEX_SPECMAN enum valueQextScintillaBase
SCLEX_SPICE enum valueQextScintillaBase
SCLEX_SQL enum valueQextScintillaBase
SCLEX_TADS3 enum valueQextScintillaBase
SCLEX_TCL enum valueQextScintillaBase
SCLEX_TEX enum valueQextScintillaBase
SCLEX_VB enum valueQextScintillaBase
SCLEX_VBSCRIPT enum valueQextScintillaBase
SCLEX_VERILOG enum valueQextScintillaBase
SCLEX_VHDL enum valueQextScintillaBase
SCLEX_XML enum valueQextScintillaBase
SCLEX_YAML enum valueQextScintillaBase
SCMOD_ALT enum valueQextScintillaBase
SCMOD_CTRL enum valueQextScintillaBase
SCMOD_NORM enum valueQextScintillaBase
SCMOD_SHIFT enum valueQextScintillaBase
SCN_AUTOCSELECTION(const char *selection, int position)QextScintillaBase [signal]
SCN_CALLTIPCLICK(int direction)QextScintillaBase [signal]
SCN_CHARADDED(int charadded)QextScintillaBase [signal]
SCN_DOUBLECLICK() (defined in QextScintillaBase)QextScintillaBase [signal]
SCN_DWELLEND(int, int, int) (defined in QextScintillaBase)QextScintillaBase [signal]
SCN_DWELLSTART(int, int, int) (defined in QextScintillaBase)QextScintillaBase [signal]
SCN_HOTSPOTCLICK(int position, int modifiers)QextScintillaBase [signal]
SCN_HOTSPOTDOUBLECLICK(int position, int modifiers)QextScintillaBase [signal]
SCN_MACRORECORD(unsigned int, unsigned long, long)QextScintillaBase [signal]
SCN_MARGINCLICK(int position, int modifiers, int margin)QextScintillaBase [signal]
SCN_MODIFIED(int, int, const char *, int, int, int, int, int) (defined in QextScintillaBase)QextScintillaBase [signal]
SCN_MODIFYATTEMPTRO()QextScintillaBase [signal]
SCN_NEEDSHOWN(int, int) (defined in QextScintillaBase)QextScintillaBase [signal]
SCN_PAINTED()QextScintillaBase [signal]
SCN_SAVEPOINTLEFT()QextScintillaBase [signal]
SCN_SAVEPOINTREACHED()QextScintillaBase [signal]
SCN_STYLENEEDED(int position)QextScintillaBase [signal]
SCN_UPDATEUI() (defined in QextScintillaBase)QextScintillaBase [signal]
SCN_USERLISTSELECTION(const char *, int) (defined in QextScintillaBase)QextScintillaBase [signal]
SCN_ZOOM() (defined in QextScintillaBase)QextScintillaBase [signal]
SCWS_INVISIBLE enum value (defined in QextScintillaBase)QextScintillaBase
SCWS_VISIBLEAFTERINDENT enum value (defined in QextScintillaBase)QextScintillaBase
SCWS_VISIBLEALWAYS enum value (defined in QextScintillaBase)QextScintillaBase
selectAll(bool select=TRUE)QextScintilla [virtual, slot]
selectedText()QextScintilla
selectionChanged()QextScintilla [signal]
selectToMatchingBrace()QextScintilla [virtual, slot]
SendScintilla(unsigned int msg, unsigned long wParam=0, long lParam=0)QextScintillaBase
SendScintilla(unsigned int msg, unsigned long wParam, const char *lParam) (defined in QextScintillaBase)QextScintillaBase [inline]
SendScintilla(unsigned int msg, const char *lParam) (defined in QextScintillaBase)QextScintillaBase [inline]
SendScintilla(unsigned int msg, const char *wParam, const char *lParam) (defined in QextScintillaBase)QextScintillaBase [inline]
SendScintilla(unsigned int msg, long wParam) (defined in QextScintillaBase)QextScintillaBase [inline]
SendScintilla(unsigned int msg, int wParam) (defined in QextScintillaBase)QextScintillaBase [inline]
SendScintilla(unsigned int msg, long cpMin, long cpMax, char *lpstrText) (defined in QextScintillaBase)QextScintillaBase
SendScintilla(unsigned int msg, unsigned long wParam, const QColor &col) (defined in QextScintillaBase)QextScintillaBase
SendScintilla(unsigned int msg, const QColor &col) (defined in QextScintillaBase)QextScintillaBase
SendScintilla(unsigned int msg, unsigned long wParam, QPainter *hdc, const QRect &rc, long cpMin, long cpMax) (defined in QextScintillaBase)QextScintillaBase
SendScintilla(unsigned int msg, unsigned long wParam, const QPixmap *lParam) (defined in QextScintillaBase)QextScintillaBase [inline]
setAutoCompletionAPIs(QextScintillaAPIs *apis=0)QextScintilla
setAutoCompletionCaseSensitivity(bool cs)QextScintilla [virtual, slot]
setAutoCompletionFillups(const char *fillups)QextScintilla
setAutoCompletionFillupsEnabled(bool enabled)QextScintilla
setAutoCompletionReplaceWord(bool replace)QextScintilla [virtual, slot]
setAutoCompletionShowSingle(bool single)QextScintilla [virtual, slot]
setAutoCompletionSource(AutoCompletionSource source)QextScintilla [virtual, slot]
setAutoCompletionStartCharacters(const char *start)QextScintilla
setAutoCompletionThreshold(int thresh)QextScintilla [virtual, slot]
setAutoIndent(bool autoindent)QextScintilla [virtual, slot]
setBackspaceUnindents(bool unindent)QextScintilla [virtual, slot]
setBraceMatching(BraceMatch bm)QextScintilla [virtual, slot]
setCallTipsAPIs(QextScintillaAPIs *apis=0)QextScintilla
setCallTipsBackgroundColor(const QColor &col)QextScintilla
setCallTipsForegroundColor(const QColor &col)QextScintilla
setCallTipsHighlightColor(const QColor &col)QextScintilla
setCallTipsVisible(int nr)QextScintilla
setCaretForegroundColor(const QColor &col)QextScintilla [virtual, slot]
setCaretLineBackgroundColor(const QColor &col)QextScintilla [virtual, slot]
setCaretLineVisible(bool enable)QextScintilla [virtual, slot]
setCaretWidth(int width)QextScintilla [virtual, slot]
setColor(const QColor &c)QextScintilla [virtual, slot]
setCursorPosition(int line, int index)QextScintilla [virtual, slot]
setDocument(const QextScintillaDocument &document)QextScintilla
setEdgeColor(const QColor &col)QextScintilla
setEdgeColumn(int colnr)QextScintilla
setEdgeMode(EdgeMode mode)QextScintilla
setEolMode(EolMode mode)QextScintilla [virtual, slot]
setEolVisibility(bool visible)QextScintilla [virtual, slot]
setFolding(FoldStyle fold)QextScintilla [virtual, slot]
setFoldMarginColors(const QColor &fore, const QColor &back)QextScintilla
setFont(const QFont &f)QextScintilla [virtual]
setIndentation(int line, int indentation)QextScintilla [virtual, slot]
setIndentationGuides(bool enable)QextScintilla [virtual, slot]
setIndentationGuidesBackgroundColor(const QColor &col)QextScintilla [virtual, slot]
setIndentationGuidesForegroundColor(const QColor &col)QextScintilla [virtual, slot]
setIndentationsUseTabs(bool tabs)QextScintilla [virtual, slot]
setIndentationWidth(int width)QextScintilla [virtual, slot]
setLexer(QextScintillaLexer *lexer=0)QextScintilla [virtual, slot]
setMarginLineNumbers(int margin, bool lnrs)QextScintilla [virtual, slot]
setMarginMarkerMask(int margin, int mask)QextScintilla [virtual, slot]
setMarginsBackgroundColor(const QColor &col)QextScintilla [virtual, slot]
setMarginSensitivity(int margin, bool sens)QextScintilla [virtual, slot]
setMarginsFont(const QFont &f)QextScintilla [virtual, slot]
setMarginsForegroundColor(const QColor &col)QextScintilla [virtual, slot]
setMarginWidth(int margin, int width)QextScintilla [virtual, slot]
setMarginWidth(int margin, const QString &s)QextScintilla [virtual, slot]
setMarkerBackgroundColor(const QColor &col, int mnr=-1)QextScintilla
setMarkerForegroundColor(const QColor &col, int mnr=-1)QextScintilla
setMatchedBraceBackgroundColor(const QColor &col)QextScintilla
setMatchedBraceForegroundColor(const QColor &col)QextScintilla
setModified(bool m)QextScintilla [virtual, slot]
setPaper(const QColor &c)QextScintilla [virtual, slot]
setReadOnly(bool ro)QextScintilla [virtual, slot]
setSelection(int lineFrom, int indexFrom, int lineTo, int indexTo)QextScintilla [virtual, slot]
setSelectionBackgroundColor(const QColor &col)QextScintilla [virtual, slot]
setSelectionForegroundColor(const QColor &col)QextScintilla [virtual, slot]
setTabIndents(bool indent)QextScintilla [virtual, slot]
setTabWidth(int width)QextScintilla [virtual, slot]
setText(const QString &text)QextScintilla [virtual, slot]
setUnmatchedBraceBackgroundColor(const QColor &col)QextScintilla
setUnmatchedBraceForegroundColor(const QColor &col)QextScintilla
setUtf8(bool cp)QextScintilla [virtual, slot]
setWhitespaceVisibility(WhitespaceVisibility mode)QextScintilla [virtual, slot]
setWrapMode(WrapMode mode)QextScintilla [virtual, slot]
setWrapVisualFlags(WrapVisualFlag eflag, WrapVisualFlag sflag=WrapFlagNone, int sindent=0)QextScintilla
showUserList(int id, const QStringList &list)QextScintilla
sizeHint() const QextScintillaBase [virtual]
SloppyBraceMatch enum valueQextScintilla
SmallRectangle enum valueQextScintilla
standardCommands() const QextScintilla [inline]
startDrag()QextScintillaBase [protected, virtual]
StrictBraceMatch enum valueQextScintilla
STYLE_BRACEBAD enum value (defined in QextScintillaBase)QextScintillaBase
STYLE_BRACELIGHT enum value (defined in QextScintillaBase)QextScintillaBase
STYLE_CALLTIP enum value (defined in QextScintillaBase)QextScintillaBase
STYLE_CONTROLCHAR enum value (defined in QextScintillaBase)QextScintillaBase
STYLE_DEFAULT enum value (defined in QextScintillaBase)QextScintillaBase
STYLE_INDENTGUIDE enum value (defined in QextScintillaBase)QextScintillaBase
STYLE_LASTPREDEFINED enum value (defined in QextScintillaBase)QextScintillaBase
STYLE_LINENUMBER enum value (defined in QextScintillaBase)QextScintillaBase
STYLE_MAX enum value (defined in QextScintillaBase)QextScintillaBase
tabIndents()QextScintilla
tabWidth()QextScintilla
text()QextScintilla
text(int line)QextScintilla
textChanged()QextScintilla [signal]
textHeight(int linenr)QextScintilla
ThreeDots enum valueQextScintilla
ThreeRightArrows enum valueQextScintilla
undo()QextScintilla [virtual, slot]
unindent(int line)QextScintilla [virtual, slot]
userListActivated(int id, const QString &string)QextScintilla [signal]
VerticalLine enum valueQextScintilla
viewport() const QextScintillaBase
VISIBLE_SLOP enum value (defined in QextScintillaBase)QextScintillaBase
VISIBLE_STRICT enum value (defined in QextScintillaBase)QextScintillaBase
WhitespaceVisibility enum nameQextScintilla
whitespaceVisibility()QextScintilla
WrapCharacter enum valueQextScintilla
WrapFlagByBorder enum valueQextScintilla
WrapFlagByText enum valueQextScintilla
WrapFlagNone enum valueQextScintilla
wrapMode()QextScintilla
WrapMode enum nameQextScintilla
WrapNone enum valueQextScintilla
WrapVisualFlag enum nameQextScintilla
WrapWord enum valueQextScintilla
WsInvisible enum valueQextScintilla
WsVisible enum valueQextScintilla
WsVisibleAfterIndent enum valueQextScintilla
zoomIn(int range)QextScintilla [virtual, slot]
zoomIn()QextScintilla [virtual, slot]
zoomOut(int range)QextScintilla [virtual, slot]
zoomOut()QextScintilla [virtual, slot]
zoomTo(int size)QextScintilla [virtual, slot]
~QextScintilla()QextScintilla [virtual]
~QextScintillaBase()QextScintillaBase [virtual]


Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/classQextScintilla.html b/doc/html/classQextScintilla.html new file mode 100644 index 0000000..47a99f0 --- /dev/null +++ b/doc/html/classQextScintilla.html @@ -0,0 +1,4920 @@ + + +QScintilla: QextScintilla Class Reference + + + + + + +

QextScintilla Class Reference

The QextScintilla class implements a higher level, more Qt-like, API to the Scintilla editor widget. +More... +

+#include <qextscintilla.h> +

+Inherits QextScintillaBase. +

+List of all members.

Public Types

+ +

Public Slots

+ +

Signals

+ +

Public Member Functions

+ +

Classes

+
    +
  • struct FindState +
+

Detailed Description

+The QextScintilla class implements a higher level, more Qt-like, API to the Scintilla editor widget. +

+QextScintilla implements methods, signals and slots similar to those found in other Qt editor classes. It also provides a higher level interface to features specific to Scintilla such as syntax styling, call tips, auto-indenting and auto-completion than that provided by QextScintillaBase.

+The API is modelled on QTextEdit - a method of the same name should behave in the same way. +

+


Member Enumeration Documentation

+ +
+
+ + + + +
anonymous enum
+
+
+ +

+This enum defines the different auto-indentation styles. +

+

Enumerator:
+ + + + +
AiMaintain  +A line is automatically indented to match the previous line.
AiOpening  +If the language supported by the current lexer has a specific start of block character (e.g. { in C++), then a line that begins with that character is indented as well as the lines that make up the block. It may be logically ored with AiClosing.
AiClosing  +If the language supported by the current lexer has a specific end of block character (e.g. } in C++), then a line that begins with that character is indented as well as the lines that make up the block. It may be logically ored with AiOpening.
+
+ +
+

+ +

+ +
+ +

+This enum defines the different sources for auto-completion lists. +

+

Enumerator:
+ + + + +
AcsDocument  +The source is the current document.
AcsAPIs  +The source is any installed APIs.
AcsAll  +The source is all available sources.
+
+ +
+

+ +

+
+ + + + +
enum QextScintilla::BraceMatch
+
+
+ +

+This enum defines the different brace matching modes. The character pairs {}, [] and () are treated as braces. The Python lexer will also match a : with the end of the corresponding indented block.

Enumerator:
+ + + + +
NoBraceMatch  +Brace matching is disabled.
StrictBraceMatch  +Brace matching is enabled for a brace immediately before the current position.
SloppyBraceMatch  +Brace matching is enabled for a brace immediately before or after the current position.
+
+ +
+

+ +

+
+ + + + +
enum QextScintilla::EdgeMode
+
+
+ +

+This enum defines the different edge modes for long lines. +

+

Enumerator:
+ + + + +
EdgeNone  +Long lines are not marked.
EdgeLine  +A vertical line is drawn at the column set by setEdgeColumn(). This is recommended for monospace fonts.
EdgeBackground  +The background color of characters after the column limit is changed to the color set by setEdgeColor(). This is recommended for proportional fonts.
+
+ +
+

+ +

+
+ + + + +
enum QextScintilla::EolMode
+
+
+ +

+This enum defines the different end-of-line modes. +

+

Enumerator:
+ + + + +
EolWindows  +A carriage return/line feed as used on Windows systems.
EolUnix  +A line feed as used on Unix systems.
EolMac  +A carriage return as used on Mac systems.
+
+ +
+

+ +

+
+ + + + +
enum QextScintilla::FoldStyle
+
+
+ +

+This enum defines the different styles for the folding margin. +

+

Enumerator:
+ + + + + + + +
NoFoldStyle  +Folding is disabled.
PlainFoldStyle  +Plain folding style using plus and minus symbols.
CircledFoldStyle  +Circled folding style using circled plus and minus symbols.
BoxedFoldStyle  +Boxed folding style using boxed plus and minus symbols.
CircledTreeFoldStyle  +Circled tree style using a flattened tree with circled plus and minus symbols and rounded corners.
BoxedTreeFoldStyle  +Boxed tree style using a flattened tree with boxed plus and minus symbols and right-angled corners.
+
+ +
+

+ +

+
+ + + + +
enum QextScintilla::MarkerSymbol
+
+
+ +

+This enum defines the different pre-defined marker symbols. +

+

Enumerator:
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Circle  +A circle.
Rectangle  +A rectangle.
RightTriangle  +A triangle pointing to the right.
SmallRectangle  +A smaller rectangle.
RightArrow  +An arrow pointing to the right.
Invisible  +An invisible marker that allows code to track the movement of lines.
DownTriangle  +A triangle pointing down.
Minus  +A drawn minus sign.
Plus  +A drawn plus sign.
VerticalLine  +A vertical line drawn in the background colour.
BottomLeftCorner  +A bottom left corner drawn in the background colour.
LeftSideSplitter  +A vertical line with a centre right horizontal line drawn in the background colour.
BoxedPlus  +A drawn plus sign in a box.
BoxedPlusConnected  +A drawn plus sign in a connected box.
BoxedMinus  +A drawn minus sign in a box.
BoxedMinusConnected  +A drawn minus sign in a connected box.
RoundedBottomLeftCorner  +A rounded bottom left corner drawn in the background colour.
LeftSideRoundedSplitter  +A vertical line with a centre right curved line drawn in the background colour.
CircledPlus  +A drawn plus sign in a circle.
CircledPlusConnected  +A drawn plus sign in a connected box.
CircledMinus  +A drawn minus sign in a circle.
CircledMinusConnected  +A drawn minus sign in a connected circle.
Background  +No symbol is drawn but the line of text is drawn with the same background colour.
ThreeDots  +Three drawn dots.
ThreeRightArrows  +Three drawn arrows pointing right.
+
+ +
+

+ +

+ +
+ +

+This enum defines the different whitespace visibility modes. When whitespace is visible spaces are displayed as small centred dots and tabs are displayed as light arrows pointing to the right.

Enumerator:
+ + + + +
WsInvisible  +Whitespace is invisible.
WsVisible  +Whitespace is always visible.
WsVisibleAfterIndent  +Whitespace is visible after the whitespace used for indentation.
+
+ +
+

+ +

+
+ + + + +
enum QextScintilla::WrapMode
+
+
+ +

+This enum defines the different line wrap modes. +

+

Enumerator:
+ + + + +
WrapNone  +Lines are not wrapped.
WrapWord  +Lines are wrapped at word boundaries.
WrapCharacter  +Lines are wrapped at character boundaries.
+
+ +
+

+ +

+ +
+ +

+This enum defines the different line wrap visual flags. +

+

Enumerator:
+ + + + +
WrapFlagNone  +No wrap flag is displayed.
WrapFlagByText  +A wrap flag is displayed by the text.
WrapFlagByBorder  +A wrap flag is displayed by the border.
+
+ +
+

+


Constructor & Destructor Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
QextScintilla::QextScintilla (QWidget *  parent = 0,
const char *  name = 0,
WFlags  f = 0 
)
+
+
+ +

+Construct an empty QextScintilla with parent parent, name name, and widget flags f. +

+

+ +

+
+ + + + + + + + +
virtual QextScintilla::~QextScintilla (  )  [virtual]
+
+
+ +

+Destroys the QextScintilla instance. +

+ +

+

+


Member Function Documentation

+ +
+
+ + + + + + + + +
bool QextScintilla::autoCompletionCaseSensitivity (  ) 
+
+
+ +

+Returns TRUE if auto-completion lists are case sensitive.

+

See also:
setAutoCompletionCaseSensitivity()
+ +
+

+ +

+
+ + + + + + + + +
bool QextScintilla::autoCompletionFillupsEnabled (  ) 
+
+
+ +

+Returns true if auto-completion fill-up characters are enabled.

+

See also:
setAutoCompletionFillups(), setAutoCompletionFillupsEnabled()
+ +
+

+ +

+
+ + + + + + + + +
bool QextScintilla::autoCompletionReplaceWord (  ) 
+
+
+ +

+Returns TRUE if the rest of the word to the right of the current cursor is removed when an item from an auto-completion list is selected.

+

See also:
setAutoCompletionReplaceWord()
+ +
+

+ +

+
+ + + + + + + + +
bool QextScintilla::autoCompletionShowSingle (  ) 
+
+
+ +

+Returns TRUE if the only item in an auto-completion list with a single entry is automatically used and the list not displayed.

+

See also:
setAutoCompletionShowSingle()
+ +
+

+ +

+
+ + + + + + + + +
AutoCompletionSource QextScintilla::autoCompletionSource (  )  const [inline]
+
+
+ +

+Returns the current source for the auto-completion list when it is being displayed automatically as the user types.

+

See also:
setAutoCompletionSource()
+ +
+

+ +

+
+ + + + + + + + +
int QextScintilla::autoCompletionThreshold (  )  const [inline]
+
+
+ +

+Returns the current threshold for the automatic display of the auto-completion list as the user types.

+

See also:
setAutoCompletionThreshold()
+ +
+

+ +

+
+ + + + + + + + +
bool QextScintilla::autoIndent (  )  const [inline]
+
+
+ +

+Returns TRUE if auto-indentation is enabled.

+

See also:
setAutoIndent()
+ +
+

+ +

+
+ + + + + + + + +
bool QextScintilla::backspaceUnindents (  ) 
+
+
+ +

+Returns TRUE if the backspace key unindents a line instead of deleting a character. The default is FALSE.

+

See also:
setBackspaceUnindents(), tabIndents(), setTabIndents()
+ +
+

+ +

+
+ + + + + + + + +
void QextScintilla::beginUndoAction (  ) 
+
+
+ +

+Mark the beginning of a sequence of actions that can be undone by a single call to undo().

+

See also:
endUndoAction(), undo()
+ +
+

+ +

+
+ + + + + + + + +
BraceMatch QextScintilla::braceMatching (  )  const [inline]
+
+
+ +

+Returns the brace matching mode.

+

See also:
setBraceMatching()
+ +
+

+ +

+
+ + + + + + + + +
int QextScintilla::callTipsVisible (  )  const [inline]
+
+
+ +

+Returns the maximum number of call tips that are displayed.

+

See also:
setCallTipsVisible()
+ +
+

+ +

+
+ + + + + + + + +
void QextScintilla::cancelList (  ) 
+
+
+ +

+Cancel any current auto-completion or user defined list. +

+ +

+

+ +

+
+ + + + + + + + +
void QextScintilla::clearRegisteredImages (  ) 
+
+
+ +

+Clear all registered images.

+

See also:
registerImage()
+ +
+

+ +

+
+ + + + + + + + + +
void QextScintilla::convertEols (EolMode  mode  ) 
+
+
+ +

+All the lines of the text have their end-of-lines converted to mode mode.

+

See also:
eolMode(), setEolMode()
+ +
+

+ +

+
+ + + + + + + + +
QColor QextScintilla::color (  )  const
+
+
+ +

+Returns the widget's text (ie. foreground) colour.

+

See also:
setColor()
+ +
+

+ +

+
+ + + + + + + + +
QextScintillaDocument QextScintilla::document (  )  [inline]
+
+
+ +

+Returns the attached document.

+

See also:
setDocument()
+ +
+

+ +

+
+ + + + + + + + +
void QextScintilla::endUndoAction (  ) 
+
+
+ +

+Mark the end of a sequence of actions that can be undone by a single call to undo().

+

See also:
beginUndoAction(), undo()
+ +
+

+ +

+
+ + + + + + + + +
QColor QextScintilla::edgeColor (  ) 
+
+
+ +

+Returns the color of the marker used to show that a line has exceeded the length set by setEdgeColumn().

+

See also:
setEdgeColor(),

+setEdgeColumn

+ +
+

+ +

+
+ + + + + + + + +
int QextScintilla::edgeColumn (  ) 
+
+
+ +

+Returns the number of the column after which lines are considered to be long.

+

See also:
setEdgeColumn()
+ +
+

+ +

+
+ + + + + + + + +
EdgeMode QextScintilla::edgeMode (  ) 
+
+
+ +

+Returns the edge mode which determines how long lines are marked.

+

See also:
setEdgeMode()
+ +
+

+ +

+
+ + + + + + + + +
EolMode QextScintilla::eolMode (  ) 
+
+
+ +

+Returns the end-of-line mode.

+

See also:
setEolMode()
+ +
+

+ +

+
+ + + + + + + + +
bool QextScintilla::eolVisibility (  ) 
+
+
+ +

+Returns the visibility of end-of-lines.

+

See also:
setEolVisibility()
+ +
+

+ +

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
virtual bool QextScintilla::findFirst (const QString &  expr,
bool  re,
bool  cs,
bool  wo,
bool  wrap,
bool  forward = TRUE,
int  line = -1,
int  index = -1,
bool  show = TRUE 
) [virtual]
+
+
+ +

+Find the next occurrence of the string expr and return TRUE if expr was found, otherwise returns FALSE. If expr is found it becomes the current selection.

+If re is TRUE then expr is interpreted as a regular expression rather than a simple string.

+If cs is TRUE then the search is case sensitive.

+If wo is TRUE then the search looks for whole word matches only, otherwise it searches for any matching text.

+If wrap is TRUE then the search wraps around the end of the text.

+If forward is TRUE (the default) then the search is forward from the starting position to the end of the text, otherwise it is backwards to the beginning of the text.

+If either line or index are negative (the default) then the search begins from the current cursor position. Otherwise the search begins at position index of line line.

+If show is TRUE (the default) then any text found is made visible (ie. it is unfolded).

+

See also:
findNext(), replace()
+ +
+

+ +

+
+ + + + + + + + +
virtual bool QextScintilla::findNext (  )  [virtual]
+
+
+ +

+Find the next occurence of the string found using findFirst().

+

See also:
findFirst(), replace()
+ +
+

+ +

+
+ + + + + + + + +
int QextScintilla::firstVisibleLine (  ) 
+
+
+ +

+Returns the number of the first visible line. +

+ +

+

+ +

+
+ + + + + + + + +
FoldStyle QextScintilla::folding (  )  const [inline]
+
+
+ +

+Returns the current folding style.

+

See also:
setFolding()
+ +
+

+ +

+
+ + + + + + + + + + + + + + + + + + +
void QextScintilla::getCursorPosition (int *  line,
int *  index 
)
+
+
+ +

+Sets *line and *index to the line and index of the cursor.

+

See also:
setCursorPosition()
+ +
+

+ +

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
void QextScintilla::getSelection (int *  lineFrom,
int *  indexFrom,
int *  lineTo,
int *  indexTo 
)
+
+
+ +

+If there is a selection, *lineFrom is set to the line number in which the selection begins and *lineTo is set to the line number in which the selection ends. (They could be the same.) *indexFrom is set to the index at which the selection begins within *lineFrom, and *indexTo is set to the index at which the selection ends within *lineTo. If there is no selection, *lineFrom, *indexFrom, *lineTo and *indexTo are all set to -1.

+

See also:
setSelection()
+ +
+

+ +

+
+ + + + + + + + +
bool QextScintilla::hasSelectedText (  )  const [inline]
+
+
+ +

+Returns TRUE if some text is selected.

+

See also:
selectedText()
+ +
+

+ +

+
+ + + + + + + + + +
int QextScintilla::indentation (int  line  ) 
+
+
+ +

+Returns the number of characters that line line is indented by.

+

See also:
setIndentation()
+ +
+

+ +

+
+ + + + + + + + +
bool QextScintilla::indentationGuides (  ) 
+
+
+ +

+Returns TRUE if the display of indentation guides is enabled.

+

See also:
setIndentationGuides()
+ +
+

+ +

+
+ + + + + + + + +
bool QextScintilla::indentationsUseTabs (  ) 
+
+
+ +

+Returns TRUE if indentations are created using tabs and spaces, rather than just spaces. The default is TRUE.

+

See also:
setIndentationsUseTabs()
+ +
+

+ +

+
+ + + + + + + + +
int QextScintilla::indentationWidth (  ) 
+
+
+ +

+Returns the indentation width in characters. The default is 0 which means that the value returned by tabWidth() is actually used.

+

See also:
setIndentationWidth(), tabWidth()
+ +
+

+ +

+
+ + + + + + + + +
bool QextScintilla::isCallTipActive (  ) 
+
+
+ +

+Returns TRUE if a call tip is currently active. +

+ +

+

+ +

+
+ + + + + + + + +
bool QextScintilla::isListActive (  ) 
+
+
+ +

+Returns TRUE if an auto-completion or user defined list is currently active. +

+

+ +

+
+ + + + + + + + +
bool QextScintilla::isModified (  ) 
+
+
+ +

+Returns TRUE if the text has been modified.

+

See also:
setModified(), modificationChanged()
+ +
+

+ +

+
+ + + + + + + + +
bool QextScintilla::isReadOnly (  ) 
+
+
+ +

+Returns TRUE if the text edit is read-only.

+

See also:
setReadOnly()
+ +
+

+ +

+
+ + + + + + + + +
bool QextScintilla::isRedoAvailable (  ) 
+
+
+ +

+Returns TRUE if there is something that can be redone.

+

See also:
redo()
+ +
+

+ +

+
+ + + + + + + + +
bool QextScintilla::isUndoAvailable (  ) 
+
+
+ +

+Returns TRUE if there is something that can be undone.

+

See also:
undo()
+ +
+

+ +

+
+ + + + + + + + +
bool QextScintilla::isUtf8 (  ) 
+
+
+ +

+Returns TRUE if text is interpreted as being UTF8 encoded. The default is to interpret the text as Latin1 encoded.

+

See also:
setUtf8()
+ +
+

+ +

+
+ + + + + + + + + +
int QextScintilla::lineAt (const QPoint &  pos  ) 
+
+
+ +

+Returns the line which is at position pos or -1 if there is no line at that position. +

+

+ +

+
+ + + + + + + + + +
int QextScintilla::lineLength (int  line  ) 
+
+
+ +

+Returns the length of line line or -1 if there is no such line. +

+ +

+

+ +

+
+ + + + + + + + +
int QextScintilla::lines (  ) 
+
+
+ +

+Returns the number of lines of text. +

+ +

+

+ +

+
+ + + + + + + + +
int QextScintilla::length (  ) 
+
+
+ +

+Returns the length of the text edit's text. +

+ +

+

+ +

+
+ + + + + + + + +
QextScintillaLexer* QextScintilla::lexer (  )  const
+
+
+ +

+Returns the current language lexer used to style text. If it is 0 then syntax styling is disabled.

+

See also:
setLexer()
+ +
+

+ +

+
+ + + + + + + + + +
bool QextScintilla::marginLineNumbers (int  margin  ) 
+
+
+ +

+Returns TRUE if line numbers are enabled for margin margin.

+

See also:
setMarginLineNumbers(), QextScintillaBase::SCI_GETMARGINTYPEN
+ +
+

+ +

+
+ + + + + + + + + +
int QextScintilla::marginMarkerMask (int  margin  ) 
+
+
+ +

+Returns the marker mask of margin margin.

+

See also:
setMarginMask(), QextScintillaMarker, QextScintillaBase::SCI_GETMARGINMASKN
+ +
+

+ +

+
+ + + + + + + + + +
bool QextScintilla::marginSensitivity (int  margin  ) 
+
+
+ +

+Returns TRUE if margin margin is sensitive to mouse clicks.

+

See also:
setMarginSensitivity(), marginClicked(), QextScintillaBase::SCI_GETMARGINTYPEN
+ +
+

+ +

+
+ + + + + + + + + +
int QextScintilla::marginWidth (int  margin  ) 
+
+
+ +

+Returns the width in pixels of margin margin.

+

See also:
setMarginWidth(), QextScintillaBase::SCI_GETMARGINWIDTHN
+ +
+

+ +

+
+ + + + + + + + + + + + + + + + + + +
int QextScintilla::markerDefine (MarkerSymbol  sym,
int  mnr = -1 
)
+
+
+ +

+Define a marker using the symbol sym with the marker number mnr. If mnr is -1 then the marker number is automatically allocated. The marker number is returned or -1 if the marker number was already allocated or too many markers have been defined.

+Markers are small geometric symbols and character used, for example, to indicate the current line or, in debuggers, to indicate breakpoints. If a margin has a width of 0 then its markers are not drawn, but their background colours affect the background colour of the corresponding line of text.

+There may be up to 32 markers defined and each line of text has a set of these markers associated with it. Markers are drawn according to their numerical identifier. Markers try to move with their text by tracking where the start of their line moves to. For example, when a line is deleted its markers are added to previous line's markers.

+Each marker is identified by a marker number. Each instance of a marker is identified by a marker handle. +

+

+ +

+
+ + + + + + + + + + + + + + + + + + +
int QextScintilla::markerDefine (char  ch,
int  mnr = -1 
)
+
+
+ +

+Define a marker using the character ch with the marker number mnr. If mnr is -1 then the marker number is automatically allocated. The marker number is returned or -1 if the marker number was already allocated or too many markers have been defined. +

+

+ +

+
+ + + + + + + + + + + + + + + + + + +
int QextScintilla::markerDefine (const QPixmap *  pm,
int  mnr = -1 
)
+
+
+ +

+Define a marker using a copy of the pixmap pm with the marker number mnr. If mnr is -1 then the marker number is automatically allocated. The marker number is returned or -1 if the marker number was already allocated or too many markers have been defined. +

+

+ +

+
+ + + + + + + + + + + + + + + + + + +
int QextScintilla::markerAdd (int  linenr,
int  mnr 
)
+
+
+ +

+Add a marker number mnr to line number linenr. A handle for the marker is returned which can be used to track the marker's position, or -1 if the mnr was invalid.

+

See also:
markerDelete(), markerDeleteAll(), markerDeleteHandle()
+ +
+

+ +

+
+ + + + + + + + + +
unsigned QextScintilla::markersAtLine (int  linenr  ) 
+
+
+ +

+Returns the 32 bit mask of marker numbers at line number linenr.

+

See also:
markerAdd()
+ +
+

+ +

+
+ + + + + + + + + + + + + + + + + + +
void QextScintilla::markerDelete (int  linenr,
int  mnr = -1 
)
+
+
+ +

+Delete all markers with the marker number mnr in the line linenr. If mnr is -1 then delete all markers from line linenr.

+

See also:
markerAdd(), markerDeleteAll(), markerDeleteHandle()
+ +
+

+ +

+
+ + + + + + + + + +
void QextScintilla::markerDeleteAll (int  mnr = -1  ) 
+
+
+ +

+Delete the all markers with the marker number mnr. If mnr is -1 then delete all markers.

+

See also:
markerAdd(), markerDelete(), markerDeleteHandle()
+ +
+

+ +

+
+ + + + + + + + + +
void QextScintilla::markerDeleteHandle (int  mhandle  ) 
+
+
+ +

+Delete the the marker instance with the marker handle mhandle.

+

See also:
markerAdd(), markerDelete(), markerDeleteAll()
+ +
+

+ +

+
+ + + + + + + + + +
int QextScintilla::markerLine (int  mhandle  ) 
+
+
+ +

+Return the line number that contains the marker instance with the marker handle mhandle. +

+

+ +

+
+ + + + + + + + + + + + + + + + + + +
int QextScintilla::markerFindNext (int  linenr,
unsigned  mask 
)
+
+
+ +

+Return the number of the next line to contain at least one marker from a 32 bit mask of markers. linenr is the line number to start the search from. mask is the mask of markers to search for.

+

See also:
markerFindPrevious()
+ +
+

+ +

+
+ + + + + + + + + + + + + + + + + + +
int QextScintilla::markerFindPrevious (int  linenr,
unsigned  mask 
)
+
+
+ +

+Return the number of the previous line to contain at least one marker from a 32 bit mask of markers. linenr is the line number to start the search from. mask is the mask of markers to search for.

+

See also:
markerFindNext()
+ +
+

+ +

+
+ + + + + + + + +
QColor QextScintilla::paper (  )  const
+
+
+ +

+Returns the widget's paper (ie. background) colour.

+

See also:
setPaper()
+ +
+

+ +

+
+ + + + + + + + + + + + + + + + + + +
virtual void QextScintilla::recolor (int  start = 0,
int  end = -1 
) [virtual]
+
+
+ +

+Recolours the document between the start and end positions. start defaults to the start of the document and end defaults to the end of the document. +

+

+ +

+
+ + + + + + + + + + + + + + + + + + +
void QextScintilla::registerImage (int  id,
const QPixmap *  pm 
)
+
+
+ +

+Register an image pm with ID id. Registered images can be displayed in auto-completion lists.

+

See also:
clearRegisteredImages(), QextScintillaAPIs
+ +
+

+ +

+
+ + + + + + + + + +
virtual void QextScintilla::replace (const QString &  replaceStr  )  [virtual]
+
+
+ +

+Replace the current selection, set by a previous call to findFirst() or findNext(), with replaceStr.

+

See also:
findFirst(), findNext()
+ +
+

+ +

+
+ + + + + + + + +
void QextScintilla::resetFoldMarginColors (  ) 
+
+
+ +

+Reset the fold margin colours to their defaults.

+

See also:
setFoldMarginColors()
+ +
+

+ +

+
+ + + + + + + + + + + + + + + + + + +
void QextScintilla::setFoldMarginColors (const QColor &  fore,
const QColor &  back 
)
+
+
+ +

+The fold margin may be drawn as a one pixel sized checkerboard pattern of two colours, fore and back.

+

See also:
resetFoldMarginColors()
+ +
+

+ +

+
+ + + + + + + + + +
void QextScintilla::setAutoCompletionAPIs (QextScintillaAPIs apis = 0  ) 
+
+
+ +

+Sets the APIs used for auto-completion to apis. If apis is 0 then any existing APIs are removed.

+

See also:
autoCompleteFromAPIs(), setCallTipsAPIs()
+ +
+

+ +

+
+ + + + + + + + + +
void QextScintilla::setAutoCompletionFillups (const char *  fillups  ) 
+
+
+ +

+set its own. Explicitly setting the fill-up characters using this method automatically enables their use.

+

See also:
autoCompletionFillupsEnabled(), setAutoCompletionFillupsEnabled()
+ +
+

+ +

+
+ + + + + + + + + +
void QextScintilla::setAutoCompletionFillupsEnabled (bool  enabled  ) 
+
+
+ +

+Enable the use of fill-up characters, either those explicitly set or those set by a lexer. By default, fill-up characters are disabled.

+

See also:
autoCompletionFillupsEnabled(), setAutoCompletionFillups()
+ +
+

+ +

+
+ + + + + + + + + +
void QextScintilla::setAutoCompletionStartCharacters (const char *  start  ) 
+
+
+ +

+A start character is one that, when entered, causes the auto-completion list to be displayed. If a language lexer has been set then this is ignored and the lexer defines the start characters. The default is that no start characters are set.

+

See also:
setAutoCompletionThreshold()
+ +
+

+ +

+
+ + + + + + + + + +
void QextScintilla::setCallTipsAPIs (QextScintillaAPIs apis = 0  ) 
+
+
+ +

+Sets the APIs used for call tips to apis. If apis is 0 then then call tips are disabled.

+

See also:
setAutoCompletionAPIs()
+ +
+

+ +

+
+ + + + + + + + + +
void QextScintilla::setCallTipsBackgroundColor (const QColor &  col  ) 
+
+
+ +

+Set the background colour of call tips to col. The default is white. +

+

+ +

+
+ + + + + + + + + +
void QextScintilla::setCallTipsForegroundColor (const QColor &  col  ) 
+
+
+ +

+Set the foreground colour of call tips to col. The default is mid-gray. +

+

+ +

+
+ + + + + + + + + +
void QextScintilla::setCallTipsHighlightColor (const QColor &  col  ) 
+
+
+ +

+Set the highlighted colour of call tip text to col. The default is dark blue. +

+

+ +

+
+ + + + + + + + + +
void QextScintilla::setCallTipsVisible (int  nr  ) 
+
+
+ +

+Set the maximum number of call tips that are displayed to nr. If the maximum number is 0 then all applicable call tips are displayed. If the maximum number is -1 then one call tip will be displayed with up and down arrows that allow the use to scroll through the full list. The default is -1.

+

See also:
callTipsVisible()
+ +
+

+ +

+
+ + + + + + + + + +
void QextScintilla::setDocument (const QextScintillaDocument document  ) 
+
+
+ +

+Attach the document document, replacing the currently attached document.

+

See also:
document()
+ +
+

+ +

+
+ + + + + + + + + +
void QextScintilla::setEdgeColor (const QColor &  col  ) 
+
+
+ +

+Set the color of the marker used to show that a line has exceeded the length set by setEdgeColumn().

+

See also:
edgeColor(),

+setEdgeColumn

+ +
+

+ +

+
+ + + + + + + + + +
void QextScintilla::setEdgeColumn (int  colnr  ) 
+
+
+ +

+Set the number of the column after which lines are considered to be long.

+

See also:
edgeColumn()
+ +
+

+ +

+
+ + + + + + + + + +
void QextScintilla::setEdgeMode (EdgeMode  mode  ) 
+
+
+ +

+Set the edge mode which determines how long lines are marked.

+

See also:
edgeMode()
+ +
+

+ +

+
+ + + + + + + + + +
virtual void QextScintilla::setFont (const QFont &  f  )  [virtual]
+
+
+ +

+Set the default font. This has no effect if a language lexer has been set. +

+

+ +

+
+ + + + + + + + + + + + + + + + + + +
void QextScintilla::setMarkerBackgroundColor (const QColor &  col,
int  mnr = -1 
)
+
+
+ +

+Set the background colour, including the alpha component, of marker mnr to col. If mnr is -1 then the colour of all markers is set. The default is white.

+

See also:
setMarkerForegroundColor()
+ +
+

+ +

+
+ + + + + + + + + + + + + + + + + + +
void QextScintilla::setMarkerForegroundColor (const QColor &  col,
int  mnr = -1 
)
+
+
+ +

+Set the foreground colour of marker mnr to col. If mnr is -1 then the colour of all markers is set. The default is black.

+

See also:
setMarkerBackgroundColor()
+ +
+

+ +

+
+ + + + + + + + + +
void QextScintilla::setMatchedBraceBackgroundColor (const QColor &  col  ) 
+
+
+ +

+Set the background colour used to display matched braces to col. The default is white.

+

See also:
setMatchedBraceForegroundColor()
+ +
+

+ +

+
+ + + + + + + + + +
void QextScintilla::setMatchedBraceForegroundColor (const QColor &  col  ) 
+
+
+ +

+Set the foreground colour used to display matched braces to col. The default is red.

+

See also:
setMatchedBraceBackgroundColor()
+ +
+

+ +

+
+ + + + + + + + + +
void QextScintilla::setUnmatchedBraceBackgroundColor (const QColor &  col  ) 
+
+
+ +

+Set the background colour used to display unmatched braces to col. The default is white.

+

See also:
setUnmatchedBraceForegroundColor()
+ +
+

+ +

+
+ + + + + + + + + +
void QextScintilla::setUnmatchedBraceForegroundColor (const QColor &  col  ) 
+
+
+ +

+Set the foreground colour used to display unmatched braces to col. The default is blue.

+

See also:
setUnmatchedBraceBackgroundColor()
+ +
+

+ +

+
+ + + + + + + + + + + + + + + + + + + + + + + + +
void QextScintilla::setWrapVisualFlags (WrapVisualFlag  eflag,
WrapVisualFlag  sflag = WrapFlagNone,
int  sindent = 0 
)
+
+
+ +

+Set the visual flags displayed when a line is wrapped. eflag determines if and where the flag at the end of a line is displayed. sflag determines if and where the flag at the start of a line is displayed. sindent is the number of characters a wrapped line is indented by. By default no visual flags are displayed. +

+

+ +

+
+ + + + + + + + +
QString QextScintilla::selectedText (  ) 
+
+
+ +

+Returns the selected text or an empty string if there is no currently selected text.

+

See also:
hasSelectedText()
+ +
+

+ +

+
+ + + + + + + + + + + + + + + + + + +
void QextScintilla::showUserList (int  id,
const QStringList &  list 
)
+
+
+ +

+Displays a user defined list which can be interacted with like an auto-completion list. id is an identifier for the list which is passed as an argument to the userListActivated() signal and must be at least 1. list is the text with which the list is populated.

+

See also:
cancelList(), isListActive(), userListActivated()
+ +
+

+ +

+
+ + + + + + + + +
QextScintillaCommandSet* QextScintilla::standardCommands (  )  const [inline]
+
+
+ +

+The standard command set is returned. +

+ +

+

+ +

+
+ + + + + + + + +
bool QextScintilla::tabIndents (  ) 
+
+
+ +

+Returns TRUE if the tab key indents a line instead of inserting a tab character. The default is TRUE.

+

See also:
setTabIndents(), backspaceUnindents(), setBackspaceUnindents()
+ +
+

+ +

+
+ + + + + + + + +
int QextScintilla::tabWidth (  ) 
+
+
+ +

+Returns the tab width in characters. The default is 8.

+

See also:
setTabWidth()
+ +
+

+ +

+
+ + + + + + + + +
QString QextScintilla::text (  ) 
+
+
+ +

+Returns the text edit's text.

+

See also:
setText()
+ +
+

+ +

+
+ + + + + + + + + +
QString QextScintilla::text (int  line  ) 
+
+
+ +

+This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Returns the text of line line.

+

See also:
setText()
+ +
+

+ +

+
+ + + + + + + + + +
int QextScintilla::textHeight (int  linenr  ) 
+
+
+ +

+Returns the height in pixels of the text in line number linenr. +

+ +

+

+ +

+
+ + + + + + + + +
WhitespaceVisibility QextScintilla::whitespaceVisibility (  ) 
+
+
+ +

+Returns the visibility of whitespace.

+

See also:
setWhitespaceVisibility()
+ +
+

+ +

+
+ + + + + + + + +
WrapMode QextScintilla::wrapMode (  ) 
+
+
+ +

+Returns the line wrap mode.

+

See also:
setWrapMode()
+ +
+

+ +

+
+ + + + + + + + + +
virtual void QextScintilla::append (const QString &  text  )  [virtual, slot]
+
+
+ +

+Appends the text text to the end of the text edit. Note that the undo/redo history is cleared by this function. +

+

+ +

+
+ + + + + + + + +
virtual void QextScintilla::autoCompleteFromAll (  )  [virtual, slot]
+
+
+ +

+Display an auto-completion list based on any installed APIs, the current contents of the document and the characters immediately to the left of the cursor.

+

See also:
autoCompleteFromAPIs(), autoCompleteFromDocument()
+ +
+

+ +

+
+ + + + + + + + +
virtual void QextScintilla::autoCompleteFromAPIs (  )  [virtual, slot]
+
+
+ +

+Display an auto-completion list based on any installed APIs and the characters immediately to the left of the cursor.

+

See also:
autoCompleteFromAll(), autoCompleteFromDocument(), setAutoCompletionAPIs()
+ +
+

+ +

+
+ + + + + + + + +
virtual void QextScintilla::autoCompleteFromDocument (  )  [virtual, slot]
+
+
+ +

+Display an auto-completion list based on the current contents of the document and the characters immediately to the left of the cursor.

+

See also:
autoCompleteFromAll(), autoCompleteFromAPIs()
+ +
+

+ +

+
+ + + + + + + + +
virtual void QextScintilla::callTip (  )  [virtual, slot]
+
+
+ +

+Display a call tip based on the the characters immediately to the left of the cursor. +

+

+ +

+
+ + + + + + + + +
virtual void QextScintilla::clear (  )  [virtual, slot]
+
+
+ +

+Deletes all the text in the text edit. +

+ +

+

+ +

+
+ + + + + + + + +
virtual void QextScintilla::copy (  )  [virtual, slot]
+
+
+ +

+Copies any selected text to the clipboard.

+

See also:
copyAvailable(), cut(), paste()
+ +
+

+ +

+
+ + + + + + + + +
virtual void QextScintilla::cut (  )  [virtual, slot]
+
+
+ +

+Copies any selected text to the clipboard and then deletes the text.

+

See also:
copy(), paste()
+ +
+

+ +

+
+ + + + + + + + +
virtual void QextScintilla::ensureCursorVisible (  )  [virtual, slot]
+
+
+ +

+Ensures that the cursor is visible. +

+ +

+

+ +

+
+ + + + + + + + + +
virtual void QextScintilla::ensureLineVisible (int  line  )  [virtual, slot]
+
+
+ +

+Ensures that the line number line is visible. +

+ +

+

+ +

+
+ + + + + + + + + +
virtual void QextScintilla::foldAll (bool  children = FALSE  )  [virtual, slot]
+
+
+ +

+If any lines are currently folded then they are all unfolded. Otherwise all lines are folded. This has the same effect as clicking in the fold margin with the shift and control keys pressed. If children is not set (the default) then only the top level fold points are affected, otherwise the state of all fold points are changed. +

+

+ +

+
+ + + + + + + + + +
virtual void QextScintilla::foldLine (int  line  )  [virtual, slot]
+
+
+ +

+If the line line is folded then it is unfolded. Otherwise it is folded. This has the same effect as clicking in the fold margin. +

+

+ +

+
+ + + + + + + + + +
virtual void QextScintilla::indent (int  line  )  [virtual, slot]
+
+
+ +

+Increases the indentation of line line by an indentation width.

+

See also:
unindent()
+ +
+

+ +

+
+ + + + + + + + + +
virtual void QextScintilla::insert (const QString &  text  )  [virtual, slot]
+
+
+ +

+Insert the text text at the current position. +

+ +

+

+ +

+
+ + + + + + + + + + + + + + + + + + + + + + + + +
virtual void QextScintilla::insertAt (const QString &  text,
int  line,
int  index 
) [virtual, slot]
+
+
+ +

+Insert the text text in the line line at the position index. +

+

+ +

+
+ + + + + + + + +
virtual void QextScintilla::moveToMatchingBrace (  )  [virtual, slot]
+
+
+ +

+If the cursor is either side of a brace character then move it to the position of the corresponding brace. +

+

+ +

+
+ + + + + + + + +
virtual void QextScintilla::paste (  )  [virtual, slot]
+
+
+ +

+Pastes any text from the clipboard into the text edit at the current cursor position.

+

See also:
copy(), cut()
+ +
+

+ +

+
+ + + + + + + + +
virtual void QextScintilla::redo (  )  [virtual, slot]
+
+
+ +

+Redo the last change or sequence of changes.

+

See also:
isRedoAvailable()
+ +
+

+ +

+
+ + + + + + + + +
virtual void QextScintilla::removeSelectedText (  )  [virtual, slot]
+
+
+ +

+Removes any selected text. +

+ +

+

+ +

+
+ + + + + + + + +
virtual void QextScintilla::resetSelectionBackgroundColor (  )  [virtual, slot]
+
+
+ +

+Resets the background colour of selected text to the default.

+

See also:
setSelectionBackgroundColor(), resetSelectionForegroundColor()
+ +
+

+ +

+
+ + + + + + + + +
virtual void QextScintilla::resetSelectionForegroundColor (  )  [virtual, slot]
+
+
+ +

+Resets the foreground colour of selected text to the default.

+

See also:
setSelectionForegroundColor(), resetSelectionBackgroundColor()
+ +
+

+ +

+
+ + + + + + + + + +
virtual void QextScintilla::selectAll (bool  select = TRUE  )  [virtual, slot]
+
+
+ +

+If select is TRUE (the default) then all the text is selected. If select is FALSE then any currently selected text is deselected. +

+

+ +

+
+ + + + + + + + +
virtual void QextScintilla::selectToMatchingBrace (  )  [virtual, slot]
+
+
+ +

+If the cursor is either side of a brace character then move it to the position of the corresponding brace and select the text between the braces. +

+

+ +

+
+ + + + + + + + + +
virtual void QextScintilla::setAutoCompletionCaseSensitivity (bool  cs  )  [virtual, slot]
+
+
+ +

+If cs is TRUE then auto-completion lists are case sensitive. The default is TRUE.

+

See also:
autoCompletionCaseSensitivity()
+ +
+

+ +

+
+ + + + + + + + + +
virtual void QextScintilla::setAutoCompletionReplaceWord (bool  replace  )  [virtual, slot]
+
+
+ +

+If replace is TRUE then when an item from an auto-completion list is selected, the rest of the word to the right of the current cursor is removed. The default is FALSE.

+

See also:
autoCompletionReplaceWord()
+ +
+

+ +

+
+ + + + + + + + + +
virtual void QextScintilla::setAutoCompletionShowSingle (bool  single  )  [virtual, slot]
+
+
+ +

+If single is TRUE then when there is only a single entry in an auto-completion list it is automatically used and the list is not displayed. This only has an effect when auto-completion is explicitly requested (using autoCompleteFromAPIs() and autoCompleteFromDocument()) and has no effect when auto-completion is triggered as the user types. The default is FALSE.

+

See also:
autoCompletionShowSingle()
+ +
+

+ +

+
+ + + + + + + + + +
virtual void QextScintilla::setAutoCompletionSource (AutoCompletionSource  source  )  [virtual, slot]
+
+
+ +

+Sets the source for the auto-completion list when it is being displayed automatically as the user types to source. The default is AcsDocument.

+

See also:
autoCompletionSource()
+ +
+

+ +

+
+ + + + + + + + + +
virtual void QextScintilla::setAutoCompletionThreshold (int  thresh  )  [virtual, slot]
+
+
+ +

+Sets the threshold for the automatic display of the auto-completion list as the user types to thresh. The threshold is the number of characters that the user must type before the list is displayed. If the threshold is less than or equal to 0 then the list is disabled. The default is -1.

+

See also:
autoCompletionThreshold(), setAutoCompletionStartCharacters()
+ +
+

+ +

+
+ + + + + + + + + +
virtual void QextScintilla::setAutoIndent (bool  autoindent  )  [virtual, slot]
+
+
+ +

+If autoindent is TRUE then auto-indentation is enabled. The default is FALSE.

+

See also:
autoIndent()
+ +
+

+ +

+
+ + + + + + + + + +
virtual void QextScintilla::setBraceMatching (BraceMatch  bm  )  [virtual, slot]
+
+
+ +

+Sets the brace matching mode to bm. The default is NoBraceMatching.

+

See also:
braceMatching()
+ +
+

+ +

+
+ + + + + + + + + +
virtual void QextScintilla::setBackspaceUnindents (bool  unindent  )  [virtual, slot]
+
+
+ +

+If deindent is TRUE then the backspace key will unindent a line rather then delete a character.

+

See also:
backspaceUnindents(), tabIndents(), setTabIndents()
+ +
+

+ +

+
+ + + + + + + + + +
virtual void QextScintilla::setCaretForegroundColor (const QColor &  col  )  [virtual, slot]
+
+
+ +

+Sets the foreground colour of the caret to col. +

+ +

+

+ +

+
+ + + + + + + + + +
virtual void QextScintilla::setCaretLineBackgroundColor (const QColor &  col  )  [virtual, slot]
+
+
+ +

+Sets the background colour, including the alpha component, of the line containing the caret to col.

+

See also:
setCaretLineVisible()
+ +
+

+ +

+
+ + + + + + + + + +
virtual void QextScintilla::setCaretLineVisible (bool  enable  )  [virtual, slot]
+
+
+ +

+Enables or disables, according to enable, the background color of the line containing the caret.

+

See also:
setCaretLineBackgroundColor()
+ +
+

+ +

+
+ + + + + + + + + +
virtual void QextScintilla::setCaretWidth (int  width  )  [virtual, slot]
+
+
+ +

+Sets the width of the caret to width pixels. A width of 0 makes the caret invisible. +

+

+ +

+
+ + + + + + + + + +
virtual void QextScintilla::setColor (const QColor &  c  )  [virtual, slot]
+
+
+ +

+

See also:
color()
+ +
+

+ +

+
+ + + + + + + + + + + + + + + + + + +
virtual void QextScintilla::setCursorPosition (int  line,
int  index 
) [virtual, slot]
+
+
+ +

+Sets the cursor to the line line at the position index.

+

See also:
getCursorPosition()
+ +
+

+ +

+
+ + + + + + + + + +
virtual void QextScintilla::setEolMode (EolMode  mode  )  [virtual, slot]
+
+
+ +

+Sets the end-of-line mode to mode. The default is the platform's natural mode.

+

See also:
eolMode()
+ +
+

+ +

+
+ + + + + + + + + +
virtual void QextScintilla::setEolVisibility (bool  visible  )  [virtual, slot]
+
+
+ +

+If visible is TRUE then end-of-lines are made visible. The default is that they are invisible.

+

See also:
eolVisibility()
+ +
+

+ +

+
+ + + + + + + + + +
virtual void QextScintilla::setFolding (FoldStyle  fold  )  [virtual, slot]
+
+
+ +

+Sets the folding style for margin 2 to fold. The default is NoFoldStyle (ie. folding is disabled).

+

See also:
folding()
+ +
+

+ +

+
+ + + + + + + + + + + + + + + + + + +
virtual void QextScintilla::setIndentation (int  line,
int  indentation 
) [virtual, slot]
+
+
+ +

+Sets the indentation of line to indentation characters.

+

See also:
indentation()
+ +
+

+ +

+
+ + + + + + + + + +
virtual void QextScintilla::setIndentationGuides (bool  enable  )  [virtual, slot]
+
+
+ +

+Enables or disables, according to enable, this display of indentation guides.

+

See also:
indentationGuides()
+ +
+

+ +

+
+ + + + + + + + + +
virtual void QextScintilla::setIndentationGuidesBackgroundColor (const QColor &  col  )  [virtual, slot]
+
+
+ +

+Set the background colour of indentation guides to col.

+

See also:
setIndentationGuidesForegroundColor()
+ +
+

+ +

+
+ + + + + + + + + +
virtual void QextScintilla::setIndentationGuidesForegroundColor (const QColor &  col  )  [virtual, slot]
+
+
+ +

+Set the foreground colour of indentation guides to col.

+

See also:
setIndentationGuidesBackgroundColor()
+ +
+

+ +

+
+ + + + + + + + + +
virtual void QextScintilla::setIndentationsUseTabs (bool  tabs  )  [virtual, slot]
+
+
+ +

+If tabs is TRUE then indentations are created using tabs and spaces, rather than just spaces.

+

See also:
indentationsUseTabs()
+ +
+

+ +

+
+ + + + + + + + + +
virtual void QextScintilla::setIndentationWidth (int  width  )  [virtual, slot]
+
+
+ +

+Sets the indentation width to width characters. If width is 0 then the value returned by tabWidth() is used.

+

See also:
indentationWidth(), tabWidth()
+ +
+

+ +

+
+ + + + + + + + + +
virtual void QextScintilla::setLexer (QextScintillaLexer lexer = 0  )  [virtual, slot]
+
+
+ +

+Sets the specific language lexer used to style text to lexer. If lexer is 0 then syntax styling is disabled.

+

See also:
lexer()
+ +
+

+ +

+
+ + + + + + + + + +
virtual void QextScintilla::setMarginsBackgroundColor (const QColor &  col  )  [virtual, slot]
+
+
+ +

+Set the background colour of all margins to col. The default is a gray.

+

See also:
setMarginsForegroundColor()
+ +
+

+ +

+
+ + + + + + + + + +
virtual void QextScintilla::setMarginsFont (const QFont &  f  )  [virtual, slot]
+
+
+ +

+Set the font used in all margins to f. +

+ +

+

+ +

+
+ + + + + + + + + +
virtual void QextScintilla::setMarginsForegroundColor (const QColor &  col  )  [virtual, slot]
+
+
+ +

+Set the foreground colour of all margins to col. The default is black.

+

See also:
setMarginsBackgroundColor()
+ +
+

+ +

+
+ + + + + + + + + + + + + + + + + + +
virtual void QextScintilla::setMarginLineNumbers (int  margin,
bool  lnrs 
) [virtual, slot]
+
+
+ +

+Enables or disables, according to lnrs, the display of line numbers in margin margin.

+

See also:
marginLineNumbers(), QextScintillaBase::SCI_SETMARGINTYPEN
+ +
+

+ +

+
+ + + + + + + + + + + + + + + + + + +
virtual void QextScintilla::setMarginMarkerMask (int  margin,
int  mask 
) [virtual, slot]
+
+
+ +

+Sets the marker mask of margin margin to mask. Only those markers whose bit is set in the mask are displayed in the margin.

+

See also:
marginMarkerMask(), QextScintillaMarker, QextScintillaBase::SCI_SETMARGINMASKN
+ +
+

+ +

+
+ + + + + + + + + + + + + + + + + + +
virtual void QextScintilla::setMarginSensitivity (int  margin,
bool  sens 
) [virtual, slot]
+
+
+ +

+Enables or disables, according to sens, the sensitivity of margin margin to mouse clicks. If the user clicks in a sensitive margin the marginClicked() signal is emitted.

+

See also:
marginSensitivity(), marginClicked(), QextScintillaBase::SCI_SETMARGINSENSITIVEN
+ +
+

+ +

+
+ + + + + + + + + + + + + + + + + + +
virtual void QextScintilla::setMarginWidth (int  margin,
int  width 
) [virtual, slot]
+
+
+ +

+Sets the width of margin margin to width pixels. If the width of a margin is 0 then it is not displayed.

+

See also:
marginWidth(), QextScintillaBase::SCI_SETMARGINWIDTHN
+ +
+

+ +

+
+ + + + + + + + + + + + + + + + + + +
virtual void QextScintilla::setMarginWidth (int  margin,
const QString &  s 
) [virtual, slot]
+
+
+ +

+Sets the width of margin margin so that it is wide enough to display s in the current margin font.

+

See also:
marginWidth(), QextScintillaBase::SCI_SETMARGINWIDTHN
+ +
+

+ +

+
+ + + + + + + + + +
virtual void QextScintilla::setModified (bool  m  )  [virtual, slot]
+
+
+ +

+Sets the modified state of the text edit to m. Note that it is only possible to clear the modified state (where m is FALSE). Attempts to set the modified state (where m is TRUE) are ignored.

+

See also:
isModified(), modificationChanged()
+ +
+

+ +

+
+ + + + + + + + + +
virtual void QextScintilla::setPaper (const QColor &  c  )  [virtual, slot]
+
+
+ +

+

See also:
paper()
+ +
+

+ +

+
+ + + + + + + + + +
virtual void QextScintilla::setReadOnly (bool  ro  )  [virtual, slot]
+
+
+ +

+Sets the read-only state of the text edit to ro.

+

See also:
isReadOnly()
+ +
+

+ +

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
virtual void QextScintilla::setSelection (int  lineFrom,
int  indexFrom,
int  lineTo,
int  indexTo 
) [virtual, slot]
+
+
+ +

+Sets the selection which starts at position indexFrom in line lineFrom and ends at position indexTo in line lineTo. The cursor is moved to the end of the selection.

+

See also:
getSelection()
+ +
+

+ +

+
+ + + + + + + + + +
virtual void QextScintilla::setSelectionBackgroundColor (const QColor &  col  )  [virtual, slot]
+
+
+ +

+Sets the background colour, including the alpha component, of selected text to col.

+

See also:
resetSelectionBackgroundColor(), setSelectionForegroundColor()
+ +
+

+ +

+
+ + + + + + + + + +
virtual void QextScintilla::setSelectionForegroundColor (const QColor &  col  )  [virtual, slot]
+
+
+ +

+Sets the foreground colour of selected text to col.

+

See also:
resetSelectionForegroundColor(), setSelectionBackgroundColor()
+ +
+

+ +

+
+ + + + + + + + + +
virtual void QextScintilla::setTabIndents (bool  indent  )  [virtual, slot]
+
+
+ +

+If indent is TRUE then the tab key will indent a line rather then insert a tab character.

+

See also:
tabIndents(), backspaceUnindents(), setBackspaceUnindents()
+ +
+

+ +

+
+ + + + + + + + + +
virtual void QextScintilla::setTabWidth (int  width  )  [virtual, slot]
+
+
+ +

+Sets the tab width to width characters.

+

See also:
tabWidth()
+ +
+

+ +

+
+ + + + + + + + + +
virtual void QextScintilla::setText (const QString &  text  )  [virtual, slot]
+
+
+ +

+Replaces all of the current text with text. Note that the undo/redo history is cleared by this function.

+

See also:
text()
+ +
+

+ +

+
+ + + + + + + + + +
virtual void QextScintilla::setUtf8 (bool  cp  )  [virtual, slot]
+
+
+ +

+Sets the current text encoding. If cp is TRUE then UTF8 is used, otherwise Latin1 is used.

+

See also:
isUtf8()
+ +
+

+ +

+
+ + + + + + + + + +
virtual void QextScintilla::setWhitespaceVisibility (WhitespaceVisibility  mode  )  [virtual, slot]
+
+
+ +

+Sets the visibility of whitespace to mode mode. The default is that whitespace is invisible.

+

See also:
whitespaceVisibility()
+ +
+

+ +

+
+ + + + + + + + + +
virtual void QextScintilla::setWrapMode (WrapMode  mode  )  [virtual, slot]
+
+
+ +

+Sets the line wrap mode to mode mode. The default is that lines are not wrapped.

+

See also:
wrapMode()
+ +
+

+ +

+
+ + + + + + + + +
virtual void QextScintilla::undo (  )  [virtual, slot]
+
+
+ +

+Undo the last change or sequence of changes.

+Scintilla has multiple level undo and redo. It will continue to record undoable actions until memory runs out. Sequences of typing or deleting are compressed into single actions to make it easier to undo and redo at a sensible level of detail. Sequences of actions can be combined into actions that are undone as a unit. These sequences occur between calls to beginUndoAction() and endUndoAction(). These sequences can be nested and only the top level sequences are undone as units.

+

See also:
beginUndoAction(), endUndoAction(), isUndoAvailable()
+ +
+

+ +

+
+ + + + + + + + + +
virtual void QextScintilla::unindent (int  line  )  [virtual, slot]
+
+
+ +

+Decreases the indentation of line line by an indentation width.

+

See also:
indent()
+ +
+

+ +

+
+ + + + + + + + + +
virtual void QextScintilla::zoomIn (int  range  )  [virtual, slot]
+
+
+ +

+Zooms in on the text by by making the base font size range points larger and recalculating all font sizes.

+

See also:
zoomOut(), zoomTo()
+ +
+

+ +

+
+ + + + + + + + +
virtual void QextScintilla::zoomIn (  )  [virtual, slot]
+
+
+ +

+This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Zooms in on the text by by making the base font size one point larger and recalculating all font sizes. +

+

+ +

+
+ + + + + + + + + +
virtual void QextScintilla::zoomOut (int  range  )  [virtual, slot]
+
+
+ +

+Zooms out on the text by by making the base font size range points smaller and recalculating all font sizes.

+

See also:
zoomIn(), zoomTo()
+ +
+

+ +

+
+ + + + + + + + +
virtual void QextScintilla::zoomOut (  )  [virtual, slot]
+
+
+ +

+This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Zooms out on the text by by making the base font size one point larger and recalculating all font sizes. +

+

+ +

+
+ + + + + + + + + +
virtual void QextScintilla::zoomTo (int  size  )  [virtual, slot]
+
+
+ +

+Zooms the text by making the base font size size points and recalculating all font sizes.

+

See also:
zoomIn(), zoomOut()
+ +
+

+ +

+
+ + + + + + + + + + + + + + + + + + +
void QextScintilla::cursorPositionChanged (int  line,
int  pos 
) [signal]
+
+
+ +

+This signal is emitted whenever the cursor position changes. line contains the line number and pos contains the character position within the line. +

+

+ +

+
+ + + + + + + + + +
void QextScintilla::copyAvailable (bool  yes  )  [signal]
+
+
+ +

+This signal is emitted whenever text is selected or de-selected. yes is TRUE if text has been selected and FALSE if text has been deselected. If yes is TRUE then copy() can be used to copy the selection to the clipboard. If yes is FALSE then copy() does nothing.

+

See also:
copy(), selectionChanged()
+ +
+

+ +

+
+ + + + + + + + + + + + + + + + + + + + + + + + +
void QextScintilla::marginClicked (int  margin,
int  line,
Qt::ButtonState  state 
) [signal]
+
+
+ +

+This signal is emitted whenever the user clicks on a sensitive margin. margin is the margin. line is the number of the line where the user clicked. state is the state of the modifier keys (ShiftButton, ControlButton and AltButton) when the user clicked.

+

See also:
marginSensitivity(), setMarginSensitivity()
+ +
+

+ +

+
+ + + + + + + + +
void QextScintilla::modificationAttempted (  )  [signal]
+
+
+ +

+This signal is emitted whenever the user attempts to modify read-only text.

+

See also:
isReadOnly(), setReadOnly()
+ +
+

+ +

+
+ + + + + + + + + +
void QextScintilla::modificationChanged (bool  m  )  [signal]
+
+
+ +

+This signal is emitted whenever the modification state of the text changes. m is TRUE if the text has been modified.

+

See also:
isModified(), setModified()
+ +
+

+ +

+
+ + + + + + + + +
void QextScintilla::selectionChanged (  )  [signal]
+
+
+ +

+This signal is emitted whenever the selection changes.

+

See also:
copyAvailable()
+ +
+

+ +

+
+ + + + + + + + +
void QextScintilla::textChanged (  )  [signal]
+
+
+ +

+This signal is emitted whenever the text in the text edit changes. +

+ +

+

+ +

+
+ + + + + + + + + + + + + + + + + + +
void QextScintilla::userListActivated (int  id,
const QString &  string 
) [signal]
+
+
+ +

+This signal is emitted when an item in a user defined list is activated (selected). id is the list identifier. string is the text of the item.

+

See also:
showUserList()
+ +
+

+


Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/classQextScintillaAPIs-members.html b/doc/html/classQextScintillaAPIs-members.html new file mode 100644 index 0000000..3bf9904 --- /dev/null +++ b/doc/html/classQextScintillaAPIs-members.html @@ -0,0 +1,30 @@ + + +QScintilla: Member List + + + + + + +

QextScintillaAPIs Member List

This is the complete list of members for QextScintillaAPIs, including all inherited members.

+ + + + + +
add(const QString &entry)QextScintillaAPIs
clear()QextScintillaAPIs
load(const QString &fname)QextScintillaAPIs
QextScintillaAPIs()QextScintillaAPIs
~QextScintillaAPIs()QextScintillaAPIs


Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/classQextScintillaAPIs.html b/doc/html/classQextScintillaAPIs.html new file mode 100644 index 0000000..9efdffc --- /dev/null +++ b/doc/html/classQextScintillaAPIs.html @@ -0,0 +1,151 @@ + + +QScintilla: QextScintillaAPIs Class Reference + + + + + + +

QextScintillaAPIs Class Reference

The QextScintillaAPIs class represents the textual API information used in call tips and for auto-completion. +More... +

+#include <qextscintillaapis.h> +

+List of all members.

Public Member Functions

+ +

Detailed Description

+The QextScintillaAPIs class represents the textual API information used in call tips and for auto-completion. +

+API information is read from one or more files. Each API function is described by a single line of text comprising the function's name, followed by the function's optional comma separated parameters enclosed in parenthesis, and finally followed by optional explanatory text.

+A function name may be followed by a `?' and a number. The number is used by auto-completion to display a registered QPixmap with the function name.

+All function names are used by auto-completion, but only those that include function parameters are used in call tips. +

+


Constructor & Destructor Documentation

+ +
+
+ + + + + + + + +
QextScintillaAPIs::QextScintillaAPIs (  ) 
+
+
+ +

+Constructs a QextScintillaAPIs instance. +

+ +

+

+ +

+
+ + + + + + + + +
QextScintillaAPIs::~QextScintillaAPIs (  ) 
+
+
+ +

+Destroys the QextScintillaAPIs instance. +

+ +

+

+


Member Function Documentation

+ +
+
+ + + + + + + + + +
void QextScintillaAPIs::add (const QString &  entry  ) 
+
+
+ +

+Add the single API entry entry to the current set. +

+ +

+

+ +

+
+ + + + + + + + + +
bool QextScintillaAPIs::load (const QString &  fname  ) 
+
+
+ +

+Load the API information from the file named fname, adding it to the current set. Returns TRUE if successful, otherwise FALSE. +

+

+ +

+
+ + + + + + + + +
void QextScintillaAPIs::clear (  ) 
+
+
+ +

+Deletes all API information. +

+ +

+

+


Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/classQextScintillaBase-members.html b/doc/html/classQextScintillaBase-members.html new file mode 100644 index 0000000..183b5ac --- /dev/null +++ b/doc/html/classQextScintillaBase-members.html @@ -0,0 +1,769 @@ + + +QScintilla: Member List + + + + + + +

QextScintillaBase Member List

This is the complete list of members for QextScintillaBase, including all inherited members.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CARET_EVEN enum value (defined in QextScintillaBase)QextScintillaBase
CARET_JUMPS enum value (defined in QextScintillaBase)QextScintillaBase
CARET_SLOP enum value (defined in QextScintillaBase)QextScintillaBase
CARET_STRICT enum value (defined in QextScintillaBase)QextScintillaBase
EDGE_BACKGROUND enum value (defined in QextScintillaBase)QextScintillaBase
EDGE_LINE enum value (defined in QextScintillaBase)QextScintillaBase
EDGE_NONE enum value (defined in QextScintillaBase)QextScintillaBase
eventFilter(QObject *o, QEvent *e)QextScintillaBase [protected]
focusInEvent(QFocusEvent *)QextScintillaBase [protected, virtual]
focusNextPrevChild(bool)QextScintillaBase [protected, virtual]
focusOutEvent(QFocusEvent *)QextScintillaBase [protected, virtual]
INDIC0_MASK enum value (defined in QextScintillaBase)QextScintillaBase
INDIC1_MASK enum value (defined in QextScintillaBase)QextScintillaBase
INDIC2_MASK enum value (defined in QextScintillaBase)QextScintillaBase
INDIC_BOX enum value (defined in QextScintillaBase)QextScintillaBase
INDIC_DIAGONAL enum value (defined in QextScintillaBase)QextScintillaBase
INDIC_HIDDEN enum value (defined in QextScintillaBase)QextScintillaBase
INDIC_MAX enum value (defined in QextScintillaBase)QextScintillaBase
INDIC_PLAIN enum value (defined in QextScintillaBase)QextScintillaBase
INDIC_ROUNDBOX enum value (defined in QextScintillaBase)QextScintillaBase
INDIC_SQUIGGLE enum value (defined in QextScintillaBase)QextScintillaBase
INDIC_STRIKE enum value (defined in QextScintillaBase)QextScintillaBase
INDIC_TT enum value (defined in QextScintillaBase)QextScintillaBase
INDICS_MASK enum value (defined in QextScintillaBase)QextScintillaBase
keyPressEvent(QKeyEvent *ke)QextScintillaBase [protected, virtual]
pool()QextScintillaBase [static]
QextScintillaBase(QWidget *parent=0, const char *name=0, WFlags f=0)QextScintillaBase
QSCN_SELCHANGED(bool yes)QextScintillaBase [signal]
SC_ALPHA_NOALPHA enum value (defined in QextScintillaBase)QextScintillaBase
SC_ALPHA_OPAQUE enum value (defined in QextScintillaBase)QextScintillaBase
SC_ALPHA_TRANSPARENT enum value (defined in QextScintillaBase)QextScintillaBase
SC_CACHE_CARET enum value (defined in QextScintillaBase)QextScintillaBase
SC_CACHE_DOCUMENT enum value (defined in QextScintillaBase)QextScintillaBase
SC_CACHE_NONE enum value (defined in QextScintillaBase)QextScintillaBase
SC_CACHE_PAGE enum value (defined in QextScintillaBase)QextScintillaBase
SC_CASE_LOWER enum value (defined in QextScintillaBase)QextScintillaBase
SC_CASE_MIXED enum value (defined in QextScintillaBase)QextScintillaBase
SC_CASE_UPPER enum value (defined in QextScintillaBase)QextScintillaBase
SC_CHARSET_8859_15 enum value (defined in QextScintillaBase)QextScintillaBase
SC_CHARSET_ANSI enum value (defined in QextScintillaBase)QextScintillaBase
SC_CHARSET_ARABIC enum value (defined in QextScintillaBase)QextScintillaBase
SC_CHARSET_BALTIC enum value (defined in QextScintillaBase)QextScintillaBase
SC_CHARSET_CHINESEBIG5 enum value (defined in QextScintillaBase)QextScintillaBase
SC_CHARSET_DEFAULT enum value (defined in QextScintillaBase)QextScintillaBase
SC_CHARSET_EASTEUROPE enum value (defined in QextScintillaBase)QextScintillaBase
SC_CHARSET_GB2312 enum value (defined in QextScintillaBase)QextScintillaBase
SC_CHARSET_GREEK enum value (defined in QextScintillaBase)QextScintillaBase
SC_CHARSET_HANGUL enum value (defined in QextScintillaBase)QextScintillaBase
SC_CHARSET_HEBREW enum value (defined in QextScintillaBase)QextScintillaBase
SC_CHARSET_JOHAB enum value (defined in QextScintillaBase)QextScintillaBase
SC_CHARSET_MAC enum value (defined in QextScintillaBase)QextScintillaBase
SC_CHARSET_OEM enum value (defined in QextScintillaBase)QextScintillaBase
SC_CHARSET_RUSSIAN enum value (defined in QextScintillaBase)QextScintillaBase
SC_CHARSET_SHIFTJIS enum value (defined in QextScintillaBase)QextScintillaBase
SC_CHARSET_SYMBOL enum value (defined in QextScintillaBase)QextScintillaBase
SC_CHARSET_THAI enum value (defined in QextScintillaBase)QextScintillaBase
SC_CHARSET_TURKISH enum value (defined in QextScintillaBase)QextScintillaBase
SC_CHARSET_VIETNAMESE enum value (defined in QextScintillaBase)QextScintillaBase
SC_CP_DBCS enum value (defined in QextScintillaBase)QextScintillaBase
SC_CP_UTF8 enum value (defined in QextScintillaBase)QextScintillaBase
SC_CURSORNORMAL enum value (defined in QextScintillaBase)QextScintillaBase
SC_CURSORWAIT enum value (defined in QextScintillaBase)QextScintillaBase
SC_EOL_CR enum value (defined in QextScintillaBase)QextScintillaBase
SC_EOL_CRLF enum value (defined in QextScintillaBase)QextScintillaBase
SC_EOL_LF enum value (defined in QextScintillaBase)QextScintillaBase
SC_FOLDFLAG_BOX enum value (defined in QextScintillaBase)QextScintillaBase
SC_FOLDFLAG_LEVELNUMBERS enum value (defined in QextScintillaBase)QextScintillaBase
SC_FOLDFLAG_LINEAFTER_CONTRACTED enum value (defined in QextScintillaBase)QextScintillaBase
SC_FOLDFLAG_LINEAFTER_EXPANDED enum value (defined in QextScintillaBase)QextScintillaBase
SC_FOLDFLAG_LINEBEFORE_CONTRACTED enum value (defined in QextScintillaBase)QextScintillaBase
SC_FOLDFLAG_LINEBEFORE_EXPANDED enum value (defined in QextScintillaBase)QextScintillaBase
SC_FOLDLEVELBASE enum value (defined in QextScintillaBase)QextScintillaBase
SC_FOLDLEVELBOXFOOTERFLAG enum value (defined in QextScintillaBase)QextScintillaBase
SC_FOLDLEVELBOXHEADERFLAG enum value (defined in QextScintillaBase)QextScintillaBase
SC_FOLDLEVELCONTRACTED enum value (defined in QextScintillaBase)QextScintillaBase
SC_FOLDLEVELHEADERFLAG enum value (defined in QextScintillaBase)QextScintillaBase
SC_FOLDLEVELNUMBERMASK enum value (defined in QextScintillaBase)QextScintillaBase
SC_FOLDLEVELUNINDENT enum value (defined in QextScintillaBase)QextScintillaBase
SC_FOLDLEVELWHITEFLAG enum value (defined in QextScintillaBase)QextScintillaBase
SC_LASTSTEPINUNDOREDO enum value (defined in QextScintillaBase)QextScintillaBase
SC_MARGIN_BACK enum valueQextScintillaBase
SC_MARGIN_FORE enum valueQextScintillaBase
SC_MARGIN_NUMBER enum valueQextScintillaBase
SC_MARGIN_SYMBOL enum valueQextScintillaBase
SC_MARK_ARROW enum valueQextScintillaBase
SC_MARK_ARROWDOWN enum valueQextScintillaBase
SC_MARK_ARROWS enum valueQextScintillaBase
SC_MARK_BACKGROUND enum valueQextScintillaBase
SC_MARK_BOXMINUS enum valueQextScintillaBase
SC_MARK_BOXMINUSCONNECTED enum valueQextScintillaBase
SC_MARK_BOXPLUS enum valueQextScintillaBase
SC_MARK_BOXPLUSCONNECTED enum valueQextScintillaBase
SC_MARK_CHARACTER enum valueQextScintillaBase
SC_MARK_CIRCLE enum valueQextScintillaBase
SC_MARK_CIRCLEMINUS enum valueQextScintillaBase
SC_MARK_CIRCLEMINUSCONNECTED enum valueQextScintillaBase
SC_MARK_CIRCLEPLUS enum valueQextScintillaBase
SC_MARK_CIRCLEPLUSCONNECTED enum valueQextScintillaBase
SC_MARK_DOTDOTDOT enum valueQextScintillaBase
SC_MARK_EMPTY enum valueQextScintillaBase
SC_MARK_FULLRECT enum valueQextScintillaBase
SC_MARK_LCORNER enum valueQextScintillaBase
SC_MARK_LCORNERCURVE enum valueQextScintillaBase
SC_MARK_MINUS enum valueQextScintillaBase
SC_MARK_PIXMAP enum valueQextScintillaBase
SC_MARK_PLUS enum valueQextScintillaBase
SC_MARK_ROUNDRECT enum valueQextScintillaBase
SC_MARK_SHORTARROW enum valueQextScintillaBase
SC_MARK_SMALLRECT enum valueQextScintillaBase
SC_MARK_TCORNER enum valueQextScintillaBase
SC_MARK_TCORNERCURVE enum valueQextScintillaBase
SC_MARK_VLINE enum valueQextScintillaBase
SC_MARKNUM_FOLDER enum value (defined in QextScintillaBase)QextScintillaBase
SC_MARKNUM_FOLDEREND enum value (defined in QextScintillaBase)QextScintillaBase
SC_MARKNUM_FOLDERMIDTAIL enum value (defined in QextScintillaBase)QextScintillaBase
SC_MARKNUM_FOLDEROPEN enum value (defined in QextScintillaBase)QextScintillaBase
SC_MARKNUM_FOLDEROPENMID enum value (defined in QextScintillaBase)QextScintillaBase
SC_MARKNUM_FOLDERSUB enum value (defined in QextScintillaBase)QextScintillaBase
SC_MARKNUM_FOLDERTAIL enum value (defined in QextScintillaBase)QextScintillaBase
SC_MASK_FOLDERS enum value (defined in QextScintillaBase)QextScintillaBase
SC_MOD_BEFOREDELETE enum value (defined in QextScintillaBase)QextScintillaBase
SC_MOD_BEFOREINSERT enum value (defined in QextScintillaBase)QextScintillaBase
SC_MOD_CHANGEFOLD enum value (defined in QextScintillaBase)QextScintillaBase
SC_MOD_CHANGEMARKER enum value (defined in QextScintillaBase)QextScintillaBase
SC_MOD_CHANGESTYLE enum value (defined in QextScintillaBase)QextScintillaBase
SC_MOD_DELETETEXT enum value (defined in QextScintillaBase)QextScintillaBase
SC_MOD_INSERTTEXT enum value (defined in QextScintillaBase)QextScintillaBase
SC_MODEVENTMASKALL enum value (defined in QextScintillaBase)QextScintillaBase
SC_MULTILINEUNDOREDO enum value (defined in QextScintillaBase)QextScintillaBase
SC_MULTISTEPUNDOREDO enum value (defined in QextScintillaBase)QextScintillaBase
SC_PERFORMED_REDO enum value (defined in QextScintillaBase)QextScintillaBase
SC_PERFORMED_UNDO enum value (defined in QextScintillaBase)QextScintillaBase
SC_PERFORMED_USER enum value (defined in QextScintillaBase)QextScintillaBase
SC_PRINT_BLACKONWHITE enum value (defined in QextScintillaBase)QextScintillaBase
SC_PRINT_COLOURONWHITE enum value (defined in QextScintillaBase)QextScintillaBase
SC_PRINT_COLOURONWHITEDEFAULTBG enum value (defined in QextScintillaBase)QextScintillaBase
SC_PRINT_INVERTLIGHT enum value (defined in QextScintillaBase)QextScintillaBase
SC_PRINT_NORMAL enum value (defined in QextScintillaBase)QextScintillaBase
SC_SEL_LINES enum value (defined in QextScintillaBase)QextScintillaBase
SC_SEL_RECTANGLE enum value (defined in QextScintillaBase)QextScintillaBase
SC_SEL_STREAM enum value (defined in QextScintillaBase)QextScintillaBase
SC_TIME_FOREVER enum value (defined in QextScintillaBase)QextScintillaBase
SC_WRAP_CHAR enum value (defined in QextScintillaBase)QextScintillaBase
SC_WRAP_NONE enum value (defined in QextScintillaBase)QextScintillaBase
SC_WRAP_WORD enum value (defined in QextScintillaBase)QextScintillaBase
SC_WRAPVISUALFLAG_END enum value (defined in QextScintillaBase)QextScintillaBase
SC_WRAPVISUALFLAG_NONE enum value (defined in QextScintillaBase)QextScintillaBase
SC_WRAPVISUALFLAG_START enum value (defined in QextScintillaBase)QextScintillaBase
SC_WRAPVISUALFLAGLOC_DEFAULT enum value (defined in QextScintillaBase)QextScintillaBase
SC_WRAPVISUALFLAGLOC_END_BY_TEXT enum value (defined in QextScintillaBase)QextScintillaBase
SC_WRAPVISUALFLAGLOC_START_BY_TEXT enum value (defined in QextScintillaBase)QextScintillaBase
SCEN_CHANGE()QextScintillaBase [signal]
SCFIND_MATCHCASE enum value (defined in QextScintillaBase)QextScintillaBase
SCFIND_POSIX enum value (defined in QextScintillaBase)QextScintillaBase
SCFIND_REGEXP enum value (defined in QextScintillaBase)QextScintillaBase
SCFIND_WHOLEWORD enum value (defined in QextScintillaBase)QextScintillaBase
SCFIND_WORDSTART enum value (defined in QextScintillaBase)QextScintillaBase
SCI_ADDREFDOCUMENT enum value (defined in QextScintillaBase)QextScintillaBase
SCI_ADDSTYLEDTEXT enum value (defined in QextScintillaBase)QextScintillaBase
SCI_ADDTEXT enum valueQextScintillaBase
SCI_ALLOCATE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_APPENDTEXT enum value (defined in QextScintillaBase)QextScintillaBase
SCI_ASSIGNCMDKEY enum value (defined in QextScintillaBase)QextScintillaBase
SCI_AUTOCACTIVE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_AUTOCCANCEL enum value (defined in QextScintillaBase)QextScintillaBase
SCI_AUTOCCOMPLETE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_AUTOCGETAUTOHIDE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_AUTOCGETCANCELATSTART enum value (defined in QextScintillaBase)QextScintillaBase
SCI_AUTOCGETCHOOSESINGLE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_AUTOCGETCURRENT enum value (defined in QextScintillaBase)QextScintillaBase
SCI_AUTOCGETDROPRESTOFWORD enum value (defined in QextScintillaBase)QextScintillaBase
SCI_AUTOCGETIGNORECASE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_AUTOCGETMAXHEIGHT enum value (defined in QextScintillaBase)QextScintillaBase
SCI_AUTOCGETMAXWIDTH enum value (defined in QextScintillaBase)QextScintillaBase
SCI_AUTOCGETSEPARATOR enum value (defined in QextScintillaBase)QextScintillaBase
SCI_AUTOCGETTYPESEPARATOR enum value (defined in QextScintillaBase)QextScintillaBase
SCI_AUTOCPOSSTART enum value (defined in QextScintillaBase)QextScintillaBase
SCI_AUTOCSELECT enum value (defined in QextScintillaBase)QextScintillaBase
SCI_AUTOCSETAUTOHIDE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_AUTOCSETCANCELATSTART enum value (defined in QextScintillaBase)QextScintillaBase
SCI_AUTOCSETCHOOSESINGLE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_AUTOCSETDROPRESTOFWORD enum value (defined in QextScintillaBase)QextScintillaBase
SCI_AUTOCSETFILLUPS enum value (defined in QextScintillaBase)QextScintillaBase
SCI_AUTOCSETIGNORECASE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_AUTOCSETMAXHEIGHT enum value (defined in QextScintillaBase)QextScintillaBase
SCI_AUTOCSETMAXWIDTH enum value (defined in QextScintillaBase)QextScintillaBase
SCI_AUTOCSETSEPARATOR enum value (defined in QextScintillaBase)QextScintillaBase
SCI_AUTOCSETTYPESEPARATOR enum value (defined in QextScintillaBase)QextScintillaBase
SCI_AUTOCSHOW enum value (defined in QextScintillaBase)QextScintillaBase
SCI_AUTOCSTOPS enum value (defined in QextScintillaBase)QextScintillaBase
SCI_BACKTAB enum value (defined in QextScintillaBase)QextScintillaBase
SCI_BEGINUNDOACTION enum value (defined in QextScintillaBase)QextScintillaBase
SCI_BRACEBADLIGHT enum value (defined in QextScintillaBase)QextScintillaBase
SCI_BRACEHIGHLIGHT enum value (defined in QextScintillaBase)QextScintillaBase
SCI_BRACEMATCH enum value (defined in QextScintillaBase)QextScintillaBase
SCI_CALLTIPACTIVE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_CALLTIPCANCEL enum value (defined in QextScintillaBase)QextScintillaBase
SCI_CALLTIPPOSSTART enum value (defined in QextScintillaBase)QextScintillaBase
SCI_CALLTIPSETBACK enum value (defined in QextScintillaBase)QextScintillaBase
SCI_CALLTIPSETFORE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_CALLTIPSETFOREHLT enum value (defined in QextScintillaBase)QextScintillaBase
SCI_CALLTIPSETHLT enum value (defined in QextScintillaBase)QextScintillaBase
SCI_CALLTIPSHOW enum value (defined in QextScintillaBase)QextScintillaBase
SCI_CALLTIPUSESTYLE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_CANCEL enum value (defined in QextScintillaBase)QextScintillaBase
SCI_CANPASTE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_CANREDO enum value (defined in QextScintillaBase)QextScintillaBase
SCI_CANUNDO enum value (defined in QextScintillaBase)QextScintillaBase
SCI_CHARLEFT enum value (defined in QextScintillaBase)QextScintillaBase
SCI_CHARLEFTEXTEND enum value (defined in QextScintillaBase)QextScintillaBase
SCI_CHARLEFTRECTEXTEND enum value (defined in QextScintillaBase)QextScintillaBase
SCI_CHARRIGHT enum value (defined in QextScintillaBase)QextScintillaBase
SCI_CHARRIGHTEXTEND enum value (defined in QextScintillaBase)QextScintillaBase
SCI_CHARRIGHTRECTEXTEND enum value (defined in QextScintillaBase)QextScintillaBase
SCI_CHOOSECARETX enum value (defined in QextScintillaBase)QextScintillaBase
SCI_CLEAR enum value (defined in QextScintillaBase)QextScintillaBase
SCI_CLEARALL enum value (defined in QextScintillaBase)QextScintillaBase
SCI_CLEARALLCMDKEYS enum value (defined in QextScintillaBase)QextScintillaBase
SCI_CLEARCMDKEY enum value (defined in QextScintillaBase)QextScintillaBase
SCI_CLEARDOCUMENTSTYLE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_CLEARREGISTEREDIMAGES enum valueQextScintillaBase
SCI_COLOURISE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_CONVERTEOLS enum value (defined in QextScintillaBase)QextScintillaBase
SCI_COPY enum value (defined in QextScintillaBase)QextScintillaBase
SCI_COPYRANGE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_COPYTEXT enum value (defined in QextScintillaBase)QextScintillaBase
SCI_CREATEDOCUMENT enum value (defined in QextScintillaBase)QextScintillaBase
SCI_CUT enum value (defined in QextScintillaBase)QextScintillaBase
SCI_DELETEBACK enum value (defined in QextScintillaBase)QextScintillaBase
SCI_DELETEBACKNOTLINE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_DELLINELEFT enum value (defined in QextScintillaBase)QextScintillaBase
SCI_DELLINERIGHT enum value (defined in QextScintillaBase)QextScintillaBase
SCI_DELWORDLEFT enum value (defined in QextScintillaBase)QextScintillaBase
SCI_DELWORDRIGHT enum value (defined in QextScintillaBase)QextScintillaBase
SCI_DOCLINEFROMVISIBLE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_DOCUMENTEND enum value (defined in QextScintillaBase)QextScintillaBase
SCI_DOCUMENTENDEXTEND enum value (defined in QextScintillaBase)QextScintillaBase
SCI_DOCUMENTSTART enum value (defined in QextScintillaBase)QextScintillaBase
SCI_DOCUMENTSTARTEXTEND enum value (defined in QextScintillaBase)QextScintillaBase
SCI_EDITTOGGLEOVERTYPE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_EMPTYUNDOBUFFER enum valueQextScintillaBase
SCI_ENDUNDOACTION enum value (defined in QextScintillaBase)QextScintillaBase
SCI_ENSUREVISIBLE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_ENSUREVISIBLEENFORCEPOLICY enum value (defined in QextScintillaBase)QextScintillaBase
SCI_FINDCOLUMN enum value (defined in QextScintillaBase)QextScintillaBase
SCI_FINDTEXT enum value (defined in QextScintillaBase)QextScintillaBase
SCI_FORMATRANGE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_FORMFEED enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETANCHOR enum valueQextScintillaBase
SCI_GETBACKSPACEUNINDENTS enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETBUFFEREDDRAW enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETCARETFORE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETCARETLINEBACK enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETCARETLINEBACKALPHA enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETCARETLINEVISIBLE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETCARETPERIOD enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETCARETSTICKY enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETCARETWIDTH enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETCHARAT enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETCODEPAGE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETCOLUMN enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETCONTROLCHARSYMBOL enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETCURLINE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETCURRENTPOS enum valueQextScintillaBase
SCI_GETCURSOR enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETDIRECTFUNCTION enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETDIRECTPOINTER enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETDOCPOINTER enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETEDGECOLOUR enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETEDGECOLUMN enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETEDGEMODE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETENDATLASTLINE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETENDSTYLED enum valueQextScintillaBase
SCI_GETEOLMODE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETFIRSTVISIBLELINE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETFOCUS enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETFOLDEXPANDED enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETFOLDLEVEL enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETFOLDPARENT enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETHIGHLIGHTGUIDE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETHSCROLLBAR enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETINDENT enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETINDENTATIONGUIDES enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETLASTCHILD enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETLAYOUTCACHE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETLENGTH enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETLEXER enum valueQextScintillaBase
SCI_GETLINE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETLINECOUNT enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETLINEENDPOSITION enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETLINEINDENTATION enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETLINEINDENTPOSITION enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETLINESELENDPOSITION enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETLINESELSTARTPOSITION enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETLINESTATE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETLINEVISIBLE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETMARGINLEFT enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETMARGINMASKN enum valueQextScintillaBase
SCI_GETMARGINRIGHT enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETMARGINSENSITIVEN enum valueQextScintillaBase
SCI_GETMARGINTYPEN enum valueQextScintillaBase
SCI_GETMARGINWIDTHN enum valueQextScintillaBase
SCI_GETMAXLINESTATE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETMODEVENTMASK enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETMODIFY enum valueQextScintillaBase
SCI_GETMOUSEDOWNCAPTURES enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETMOUSEDWELLTIME enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETOVERTYPE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETPASTECONVERTENDINGS enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETPRINTCOLOURMODE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETPRINTMAGNIFICATION enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETPRINTWRAPMODE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETPROPERTY enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETPROPERTYEXPANDED enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETPROPERTYINT enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETREADONLY enum valueQextScintillaBase
SCI_GETSCROLLWIDTH enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETSEARCHFLAGS enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETSELALPHA enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETSELECTIONEND enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETSELECTIONMODE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETSELECTIONSTART enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETSELTEXT enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETSTATUS enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETSTYLEAT enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETSTYLEBITS enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETSTYLEBITSNEEDED enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETSTYLEDTEXT enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETTABINDENTS enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETTABWIDTH enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETTARGETEND enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETTARGETSTART enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETTEXT enum valueQextScintillaBase
SCI_GETTEXTLENGTH enum valueQextScintillaBase
SCI_GETTEXTRANGE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETTWOPHASEDRAW enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETUNDOCOLLECTION enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETUSEPALETTE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETUSETABS enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETVIEWEOL enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETVIEWWS enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETVSCROLLBAR enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETWRAPMODE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETWRAPSTARTINDENT enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETWRAPVISUALFLAGS enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETWRAPVISUALFLAGSLOCATION enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETXOFFSET enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GETZOOM enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GOTOLINE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_GOTOPOS enum valueQextScintillaBase
SCI_GRABFOCUS enum value (defined in QextScintillaBase)QextScintillaBase
SCI_HIDELINES enum value (defined in QextScintillaBase)QextScintillaBase
SCI_HIDESELECTION enum value (defined in QextScintillaBase)QextScintillaBase
SCI_HOME enum value (defined in QextScintillaBase)QextScintillaBase
SCI_HOMEDISPLAY enum value (defined in QextScintillaBase)QextScintillaBase
SCI_HOMEDISPLAYEXTEND enum value (defined in QextScintillaBase)QextScintillaBase
SCI_HOMEEXTEND enum value (defined in QextScintillaBase)QextScintillaBase
SCI_HOMERECTEXTEND enum value (defined in QextScintillaBase)QextScintillaBase
SCI_HOMEWRAP enum value (defined in QextScintillaBase)QextScintillaBase
SCI_HOMEWRAPEXTEND enum value (defined in QextScintillaBase)QextScintillaBase
SCI_INDICGETFORE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_INDICGETSTYLE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_INDICSETFORE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_INDICSETSTYLE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_INSERTTEXT enum value (defined in QextScintillaBase)QextScintillaBase
SCI_LEXER_START enum value (defined in QextScintillaBase)QextScintillaBase
SCI_LINECOPY enum value (defined in QextScintillaBase)QextScintillaBase
SCI_LINECUT enum value (defined in QextScintillaBase)QextScintillaBase
SCI_LINEDELETE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_LINEDOWN enum value (defined in QextScintillaBase)QextScintillaBase
SCI_LINEDOWNEXTEND enum value (defined in QextScintillaBase)QextScintillaBase
SCI_LINEDOWNRECTEXTEND enum value (defined in QextScintillaBase)QextScintillaBase
SCI_LINEDUPLICATE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_LINEEND enum value (defined in QextScintillaBase)QextScintillaBase
SCI_LINEENDDISPLAY enum value (defined in QextScintillaBase)QextScintillaBase
SCI_LINEENDDISPLAYEXTEND enum value (defined in QextScintillaBase)QextScintillaBase
SCI_LINEENDEXTEND enum value (defined in QextScintillaBase)QextScintillaBase
SCI_LINEENDRECTEXTEND enum value (defined in QextScintillaBase)QextScintillaBase
SCI_LINEENDWRAP enum value (defined in QextScintillaBase)QextScintillaBase
SCI_LINEENDWRAPEXTEND enum value (defined in QextScintillaBase)QextScintillaBase
SCI_LINEFROMPOSITION enum value (defined in QextScintillaBase)QextScintillaBase
SCI_LINELENGTH enum value (defined in QextScintillaBase)QextScintillaBase
SCI_LINESCROLL enum value (defined in QextScintillaBase)QextScintillaBase
SCI_LINESCROLLDOWN enum value (defined in QextScintillaBase)QextScintillaBase
SCI_LINESCROLLUP enum value (defined in QextScintillaBase)QextScintillaBase
SCI_LINESJOIN enum value (defined in QextScintillaBase)QextScintillaBase
SCI_LINESONSCREEN enum value (defined in QextScintillaBase)QextScintillaBase
SCI_LINESSPLIT enum value (defined in QextScintillaBase)QextScintillaBase
SCI_LINETRANSPOSE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_LINEUP enum value (defined in QextScintillaBase)QextScintillaBase
SCI_LINEUPEXTEND enum value (defined in QextScintillaBase)QextScintillaBase
SCI_LINEUPRECTEXTEND enum value (defined in QextScintillaBase)QextScintillaBase
SCI_LOADLEXERLIBRARY enum value (defined in QextScintillaBase)QextScintillaBase
SCI_LOWERCASE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_MARKERADD enum valueQextScintillaBase
SCI_MARKERADDSET enum value (defined in QextScintillaBase)QextScintillaBase
SCI_MARKERDEFINE enum valueQextScintillaBase
SCI_MARKERDEFINEPIXMAP enum valueQextScintillaBase
SCI_MARKERDELETE enum valueQextScintillaBase
SCI_MARKERDELETEALL enum valueQextScintillaBase
SCI_MARKERDELETEHANDLE enum valueQextScintillaBase
SCI_MARKERGET enum valueQextScintillaBase
SCI_MARKERLINEFROMHANDLE enum valueQextScintillaBase
SCI_MARKERNEXT enum valueQextScintillaBase
SCI_MARKERPREVIOUS enum valueQextScintillaBase
SCI_MARKERSETALPHA enum value (defined in QextScintillaBase)QextScintillaBase
SCI_MARKERSETBACK enum valueQextScintillaBase
SCI_MARKERSETFORE enum valueQextScintillaBase
SCI_MOVECARETINSIDEVIEW enum value (defined in QextScintillaBase)QextScintillaBase
SCI_NEWLINE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_NULL enum value (defined in QextScintillaBase)QextScintillaBase
SCI_OPTIONAL_START enum value (defined in QextScintillaBase)QextScintillaBase
SCI_PAGEDOWN enum value (defined in QextScintillaBase)QextScintillaBase
SCI_PAGEDOWNEXTEND enum value (defined in QextScintillaBase)QextScintillaBase
SCI_PAGEDOWNRECTEXTEND enum value (defined in QextScintillaBase)QextScintillaBase
SCI_PAGEUP enum value (defined in QextScintillaBase)QextScintillaBase
SCI_PAGEUPEXTEND enum value (defined in QextScintillaBase)QextScintillaBase
SCI_PAGEUPRECTEXTEND enum value (defined in QextScintillaBase)QextScintillaBase
SCI_PARADOWN enum value (defined in QextScintillaBase)QextScintillaBase
SCI_PARADOWNEXTEND enum value (defined in QextScintillaBase)QextScintillaBase
SCI_PARAUP enum value (defined in QextScintillaBase)QextScintillaBase
SCI_PARAUPEXTEND enum value (defined in QextScintillaBase)QextScintillaBase
SCI_PASTE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_POINTXFROMPOSITION enum value (defined in QextScintillaBase)QextScintillaBase
SCI_POINTYFROMPOSITION enum value (defined in QextScintillaBase)QextScintillaBase
SCI_POSITIONAFTER enum value (defined in QextScintillaBase)QextScintillaBase
SCI_POSITIONBEFORE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_POSITIONFROMLINE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_POSITIONFROMPOINT enum value (defined in QextScintillaBase)QextScintillaBase
SCI_POSITIONFROMPOINTCLOSE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_REDO enum value (defined in QextScintillaBase)QextScintillaBase
SCI_REGISTERIMAGE enum valueQextScintillaBase
SCI_RELEASEDOCUMENT enum value (defined in QextScintillaBase)QextScintillaBase
SCI_REPLACESEL enum value (defined in QextScintillaBase)QextScintillaBase
SCI_REPLACETARGET enum value (defined in QextScintillaBase)QextScintillaBase
SCI_REPLACETARGETRE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SCROLLCARET enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SEARCHANCHOR enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SEARCHINTARGET enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SEARCHNEXT enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SEARCHPREV enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SELECTALL enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SELECTIONDUPLICATE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SELECTIONISRECTANGLE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETANCHOR enum valueQextScintillaBase
SCI_SETBACKSPACEUNINDENTS enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETBUFFEREDDRAW enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETCARETFORE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETCARETLINEBACK enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETCARETLINEBACKALPHA enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETCARETLINEVISIBLE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETCARETPERIOD enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETCARETSTICKY enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETCARETWIDTH enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETCHARSDEFAULT enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETCODEPAGE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETCONTROLCHARSYMBOL enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETCURRENTPOS enum valueQextScintillaBase
SCI_SETCURSOR enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETDOCPOINTER enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETEDGECOLOUR enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETEDGECOLUMN enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETEDGEMODE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETENDATLASTLINE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETEOLMODE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETFOCUS enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETFOLDEXPANDED enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETFOLDFLAGS enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETFOLDLEVEL enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETFOLDMARGINCOLOUR enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETFOLDMARGINHICOLOUR enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETHIGHLIGHTGUIDE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETHOTSPOTACTIVEBACK enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETHOTSPOTACTIVEFORE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETHOTSPOTACTIVEUNDERLINE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETHSCROLLBAR enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETINDENT enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETINDENTATIONGUIDES enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETKEYWORDS enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETLAYOUTCACHE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETLEXER enum valueQextScintillaBase
SCI_SETLEXERLANGUAGE enum valueQextScintillaBase
SCI_SETLINEINDENTATION enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETLINESTATE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETMARGINLEFT enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETMARGINMASKN enum valueQextScintillaBase
SCI_SETMARGINRIGHT enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETMARGINSENSITIVEN enum valueQextScintillaBase
SCI_SETMARGINTYPEN enum valueQextScintillaBase
SCI_SETMARGINWIDTHN enum valueQextScintillaBase
SCI_SETMODEVENTMASK enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETMOUSEDOWNCAPTURES enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETMOUSEDWELLTIME enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETOVERTYPE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETPASTECONVERTENDINGS enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETPRINTCOLOURMODE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETPRINTMAGNIFICATION enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETPRINTWRAPMODE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETPROPERTY enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETREADONLY enum valueQextScintillaBase
SCI_SETSAVEPOINT enum valueQextScintillaBase
SCI_SETSCROLLWIDTH enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETSEARCHFLAGS enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETSEL enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETSELALPHA enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETSELBACK enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETSELECTIONEND enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETSELECTIONMODE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETSELECTIONSTART enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETSELFORE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETSTATUS enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETSTYLEBITS enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETSTYLING enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETSTYLINGEX enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETTABINDENTS enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETTABWIDTH enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETTARGETEND enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETTARGETSTART enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETTEXT enum valueQextScintillaBase
SCI_SETTWOPHASEDRAW enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETUNDOCOLLECTION enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETUSEPALETTE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETUSETABS enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETVIEWEOL enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETVIEWWS enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETVISIBLEPOLICY enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETVSCROLLBAR enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETWHITESPACEBACK enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETWHITESPACECHARS enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETWHITESPACEFORE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETWORDCHARS enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETWRAPMODE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETWRAPSTARTINDENT enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETWRAPVISUALFLAGS enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETWRAPVISUALFLAGSLOCATION enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETXCARETPOLICY enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETXOFFSET enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETYCARETPOLICY enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SETZOOM enum value (defined in QextScintillaBase)QextScintillaBase
SCI_SHOWLINES enum value (defined in QextScintillaBase)QextScintillaBase
SCI_START enum value (defined in QextScintillaBase)QextScintillaBase
SCI_STARTRECORD enum value (defined in QextScintillaBase)QextScintillaBase
SCI_STARTSTYLING enum value (defined in QextScintillaBase)QextScintillaBase
SCI_STOPRECORD enum value (defined in QextScintillaBase)QextScintillaBase
SCI_STUTTEREDPAGEDOWN enum value (defined in QextScintillaBase)QextScintillaBase
SCI_STUTTEREDPAGEDOWNEXTEND enum value (defined in QextScintillaBase)QextScintillaBase
SCI_STUTTEREDPAGEUP enum value (defined in QextScintillaBase)QextScintillaBase
SCI_STUTTEREDPAGEUPEXTEND enum value (defined in QextScintillaBase)QextScintillaBase
SCI_STYLECLEARALL enum value (defined in QextScintillaBase)QextScintillaBase
SCI_STYLERESETDEFAULT enum value (defined in QextScintillaBase)QextScintillaBase
SCI_STYLESETBACK enum value (defined in QextScintillaBase)QextScintillaBase
SCI_STYLESETBOLD enum value (defined in QextScintillaBase)QextScintillaBase
SCI_STYLESETCASE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_STYLESETCHANGEABLE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_STYLESETCHARACTERSET enum value (defined in QextScintillaBase)QextScintillaBase
SCI_STYLESETEOLFILLED enum value (defined in QextScintillaBase)QextScintillaBase
SCI_STYLESETFONT enum value (defined in QextScintillaBase)QextScintillaBase
SCI_STYLESETFORE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_STYLESETHOTSPOT enum value (defined in QextScintillaBase)QextScintillaBase
SCI_STYLESETITALIC enum value (defined in QextScintillaBase)QextScintillaBase
SCI_STYLESETSIZE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_STYLESETUNDERLINE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_STYLESETVISIBLE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_TAB enum value (defined in QextScintillaBase)QextScintillaBase
SCI_TARGETFROMSELECTION enum value (defined in QextScintillaBase)QextScintillaBase
SCI_TEXTHEIGHT enum value (defined in QextScintillaBase)QextScintillaBase
SCI_TEXTWIDTH enum valueQextScintillaBase
SCI_TOGGLECARETSTICKY enum value (defined in QextScintillaBase)QextScintillaBase
SCI_TOGGLEFOLD enum value (defined in QextScintillaBase)QextScintillaBase
SCI_UNDO enum value (defined in QextScintillaBase)QextScintillaBase
SCI_UPPERCASE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_USEPOPUP enum value (defined in QextScintillaBase)QextScintillaBase
SCI_USERLISTSHOW enum value (defined in QextScintillaBase)QextScintillaBase
SCI_VCHOME enum value (defined in QextScintillaBase)QextScintillaBase
SCI_VCHOMEEXTEND enum value (defined in QextScintillaBase)QextScintillaBase
SCI_VCHOMERECTEXTEND enum value (defined in QextScintillaBase)QextScintillaBase
SCI_VCHOMEWRAP enum value (defined in QextScintillaBase)QextScintillaBase
SCI_VCHOMEWRAPEXTEND enum value (defined in QextScintillaBase)QextScintillaBase
SCI_VISIBLEFROMDOCLINE enum value (defined in QextScintillaBase)QextScintillaBase
SCI_WORDENDPOSITION enum value (defined in QextScintillaBase)QextScintillaBase
SCI_WORDLEFT enum value (defined in QextScintillaBase)QextScintillaBase
SCI_WORDLEFTEND enum value (defined in QextScintillaBase)QextScintillaBase
SCI_WORDLEFTENDEXTEND enum value (defined in QextScintillaBase)QextScintillaBase
SCI_WORDLEFTEXTEND enum value (defined in QextScintillaBase)QextScintillaBase
SCI_WORDPARTLEFT enum value (defined in QextScintillaBase)QextScintillaBase
SCI_WORDPARTLEFTEXTEND enum value (defined in QextScintillaBase)QextScintillaBase
SCI_WORDPARTRIGHT enum value (defined in QextScintillaBase)QextScintillaBase
SCI_WORDPARTRIGHTEXTEND enum value (defined in QextScintillaBase)QextScintillaBase
SCI_WORDRIGHT enum value (defined in QextScintillaBase)QextScintillaBase
SCI_WORDRIGHTEND enum value (defined in QextScintillaBase)QextScintillaBase
SCI_WORDRIGHTENDEXTEND enum value (defined in QextScintillaBase)QextScintillaBase
SCI_WORDRIGHTEXTEND enum value (defined in QextScintillaBase)QextScintillaBase
SCI_WORDSTARTPOSITION enum value (defined in QextScintillaBase)QextScintillaBase
SCI_WRAPCOUNT enum value (defined in QextScintillaBase)QextScintillaBase
SCI_ZOOMIN enum value (defined in QextScintillaBase)QextScintillaBase
SCI_ZOOMOUT enum value (defined in QextScintillaBase)QextScintillaBase
SCK_ADD enum value (defined in QextScintillaBase)QextScintillaBase
SCK_BACK enum value (defined in QextScintillaBase)QextScintillaBase
SCK_DELETE enum value (defined in QextScintillaBase)QextScintillaBase
SCK_DIVIDE enum value (defined in QextScintillaBase)QextScintillaBase
SCK_DOWN enum value (defined in QextScintillaBase)QextScintillaBase
SCK_END enum value (defined in QextScintillaBase)QextScintillaBase
SCK_ESCAPE enum value (defined in QextScintillaBase)QextScintillaBase
SCK_HOME enum value (defined in QextScintillaBase)QextScintillaBase
SCK_INSERT enum value (defined in QextScintillaBase)QextScintillaBase
SCK_LEFT enum value (defined in QextScintillaBase)QextScintillaBase
SCK_NEXT enum value (defined in QextScintillaBase)QextScintillaBase
SCK_PRIOR enum value (defined in QextScintillaBase)QextScintillaBase
SCK_RETURN enum value (defined in QextScintillaBase)QextScintillaBase
SCK_RIGHT enum value (defined in QextScintillaBase)QextScintillaBase
SCK_SUBTRACT enum value (defined in QextScintillaBase)QextScintillaBase
SCK_TAB enum value (defined in QextScintillaBase)QextScintillaBase
SCK_UP enum value (defined in QextScintillaBase)QextScintillaBase
SCLEX_ADA enum valueQextScintillaBase
SCLEX_APDL enum valueQextScintillaBase
SCLEX_ASM enum valueQextScintillaBase
SCLEX_ASN1 enum valueQextScintillaBase
SCLEX_ASP enum valueQextScintillaBase
SCLEX_AU3 enum valueQextScintillaBase
SCLEX_AVE enum valueQextScintillaBase
SCLEX_BAAN enum valueQextScintillaBase
SCLEX_BASH enum valueQextScintillaBase
SCLEX_BATCH enum valueQextScintillaBase
SCLEX_BLITZBASIC enum valueQextScintillaBase
SCLEX_BULLANT enum valueQextScintillaBase
SCLEX_CAML enum valueQextScintillaBase
SCLEX_CLW enum valueQextScintillaBase
SCLEX_CLWNOCASE enum valueQextScintillaBase
SCLEX_CONF enum valueQextScintillaBase
SCLEX_CONTAINER enum valueQextScintillaBase
SCLEX_CPP enum valueQextScintillaBase
SCLEX_CPPNOCASE enum valueQextScintillaBase
SCLEX_CSOUND enum valueQextScintillaBase
SCLEX_CSS enum valueQextScintillaBase
SCLEX_DIFF enum valueQextScintillaBase
SCLEX_EIFFEL enum valueQextScintillaBase
SCLEX_EIFFELKW enum valueQextScintillaBase
SCLEX_ERLANG enum valueQextScintillaBase
SCLEX_ERRORLIST enum valueQextScintillaBase
SCLEX_ESCRIPT enum valueQextScintillaBase
SCLEX_F77 enum valueQextScintillaBase
SCLEX_FLAGSHIP enum valueQextScintillaBase
SCLEX_FORTH enum valueQextScintillaBase
SCLEX_FORTRAN enum valueQextScintillaBase
SCLEX_FREEBASIC enum valueQextScintillaBase
SCLEX_GUI4CLI enum valueQextScintillaBase
SCLEX_HASKELL enum valueQextScintillaBase
SCLEX_HTML enum valueQextScintillaBase
SCLEX_INNOSETUP enum valueQextScintillaBase
SCLEX_KIX enum valueQextScintillaBase
SCLEX_LATEX enum valueQextScintillaBase
SCLEX_LISP enum valueQextScintillaBase
SCLEX_LOT enum valueQextScintillaBase
SCLEX_LOUT enum valueQextScintillaBase
SCLEX_LUA enum valueQextScintillaBase
SCLEX_MAKEFILE enum valueQextScintillaBase
SCLEX_MATLAB enum valueQextScintillaBase
SCLEX_METAPOST enum valueQextScintillaBase
SCLEX_MMIXAL enum valueQextScintillaBase
SCLEX_MSSQL enum valueQextScintillaBase
SCLEX_NNCRONTAB enum valueQextScintillaBase
SCLEX_NSIS enum valueQextScintillaBase
SCLEX_NULL enum valueQextScintillaBase
SCLEX_OCTAVE enum valueQextScintillaBase
SCLEX_OPAL enum valueQextScintillaBase
SCLEX_PASCAL enum valueQextScintillaBase
SCLEX_PERL enum valueQextScintillaBase
SCLEX_PHP enum valueQextScintillaBase
SCLEX_PHPSCRIPT enum valueQextScintillaBase
SCLEX_POV enum valueQextScintillaBase
SCLEX_POWERBASIC enum valueQextScintillaBase
SCLEX_PROPERTIES enum valueQextScintillaBase
SCLEX_PS enum valueQextScintillaBase
SCLEX_PUREBASIC enum valueQextScintillaBase
SCLEX_PYTHON enum valueQextScintillaBase
SCLEX_REBOL enum valueQextScintillaBase
SCLEX_RUBY enum valueQextScintillaBase
SCLEX_SCRIPTOL enum valueQextScintillaBase
SCLEX_SMALLTALK enum valueQextScintillaBase
SCLEX_SPECMAN enum valueQextScintillaBase
SCLEX_SPICE enum valueQextScintillaBase
SCLEX_SQL enum valueQextScintillaBase
SCLEX_TADS3 enum valueQextScintillaBase
SCLEX_TCL enum valueQextScintillaBase
SCLEX_TEX enum valueQextScintillaBase
SCLEX_VB enum valueQextScintillaBase
SCLEX_VBSCRIPT enum valueQextScintillaBase
SCLEX_VERILOG enum valueQextScintillaBase
SCLEX_VHDL enum valueQextScintillaBase
SCLEX_XML enum valueQextScintillaBase
SCLEX_YAML enum valueQextScintillaBase
SCMOD_ALT enum valueQextScintillaBase
SCMOD_CTRL enum valueQextScintillaBase
SCMOD_NORM enum valueQextScintillaBase
SCMOD_SHIFT enum valueQextScintillaBase
SCN_AUTOCSELECTION(const char *selection, int position)QextScintillaBase [signal]
SCN_CALLTIPCLICK(int direction)QextScintillaBase [signal]
SCN_CHARADDED(int charadded)QextScintillaBase [signal]
SCN_DOUBLECLICK() (defined in QextScintillaBase)QextScintillaBase [signal]
SCN_DWELLEND(int, int, int) (defined in QextScintillaBase)QextScintillaBase [signal]
SCN_DWELLSTART(int, int, int) (defined in QextScintillaBase)QextScintillaBase [signal]
SCN_HOTSPOTCLICK(int position, int modifiers)QextScintillaBase [signal]
SCN_HOTSPOTDOUBLECLICK(int position, int modifiers)QextScintillaBase [signal]
SCN_MACRORECORD(unsigned int, unsigned long, long)QextScintillaBase [signal]
SCN_MARGINCLICK(int position, int modifiers, int margin)QextScintillaBase [signal]
SCN_MODIFIED(int, int, const char *, int, int, int, int, int) (defined in QextScintillaBase)QextScintillaBase [signal]
SCN_MODIFYATTEMPTRO()QextScintillaBase [signal]
SCN_NEEDSHOWN(int, int) (defined in QextScintillaBase)QextScintillaBase [signal]
SCN_PAINTED()QextScintillaBase [signal]
SCN_SAVEPOINTLEFT()QextScintillaBase [signal]
SCN_SAVEPOINTREACHED()QextScintillaBase [signal]
SCN_STYLENEEDED(int position)QextScintillaBase [signal]
SCN_UPDATEUI() (defined in QextScintillaBase)QextScintillaBase [signal]
SCN_USERLISTSELECTION(const char *, int) (defined in QextScintillaBase)QextScintillaBase [signal]
SCN_ZOOM() (defined in QextScintillaBase)QextScintillaBase [signal]
SCWS_INVISIBLE enum value (defined in QextScintillaBase)QextScintillaBase
SCWS_VISIBLEAFTERINDENT enum value (defined in QextScintillaBase)QextScintillaBase
SCWS_VISIBLEALWAYS enum value (defined in QextScintillaBase)QextScintillaBase
SendScintilla(unsigned int msg, unsigned long wParam=0, long lParam=0)QextScintillaBase
SendScintilla(unsigned int msg, unsigned long wParam, const char *lParam) (defined in QextScintillaBase)QextScintillaBase [inline]
SendScintilla(unsigned int msg, const char *lParam) (defined in QextScintillaBase)QextScintillaBase [inline]
SendScintilla(unsigned int msg, const char *wParam, const char *lParam) (defined in QextScintillaBase)QextScintillaBase [inline]
SendScintilla(unsigned int msg, long wParam) (defined in QextScintillaBase)QextScintillaBase [inline]
SendScintilla(unsigned int msg, int wParam) (defined in QextScintillaBase)QextScintillaBase [inline]
SendScintilla(unsigned int msg, long cpMin, long cpMax, char *lpstrText) (defined in QextScintillaBase)QextScintillaBase
SendScintilla(unsigned int msg, unsigned long wParam, const QColor &col) (defined in QextScintillaBase)QextScintillaBase
SendScintilla(unsigned int msg, const QColor &col) (defined in QextScintillaBase)QextScintillaBase
SendScintilla(unsigned int msg, unsigned long wParam, QPainter *hdc, const QRect &rc, long cpMin, long cpMax) (defined in QextScintillaBase)QextScintillaBase
SendScintilla(unsigned int msg, unsigned long wParam, const QPixmap *lParam) (defined in QextScintillaBase)QextScintillaBase [inline]
sizeHint() const QextScintillaBase [virtual]
startDrag()QextScintillaBase [protected, virtual]
STYLE_BRACEBAD enum value (defined in QextScintillaBase)QextScintillaBase
STYLE_BRACELIGHT enum value (defined in QextScintillaBase)QextScintillaBase
STYLE_CALLTIP enum value (defined in QextScintillaBase)QextScintillaBase
STYLE_CONTROLCHAR enum value (defined in QextScintillaBase)QextScintillaBase
STYLE_DEFAULT enum value (defined in QextScintillaBase)QextScintillaBase
STYLE_INDENTGUIDE enum value (defined in QextScintillaBase)QextScintillaBase
STYLE_LASTPREDEFINED enum value (defined in QextScintillaBase)QextScintillaBase
STYLE_LINENUMBER enum value (defined in QextScintillaBase)QextScintillaBase
STYLE_MAX enum value (defined in QextScintillaBase)QextScintillaBase
viewport() const QextScintillaBase
VISIBLE_SLOP enum value (defined in QextScintillaBase)QextScintillaBase
VISIBLE_STRICT enum value (defined in QextScintillaBase)QextScintillaBase
~QextScintillaBase()QextScintillaBase [virtual]


Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/classQextScintillaBase.html b/doc/html/classQextScintillaBase.html new file mode 100644 index 0000000..bbecf39 --- /dev/null +++ b/doc/html/classQextScintillaBase.html @@ -0,0 +1,3465 @@ + + +QScintilla: QextScintillaBase Class Reference + + + + + + +

QextScintillaBase Class Reference

The QextScintillaBase class implements the Scintilla editor widget and its low-level API. +More... +

+#include <qextscintillabase.h> +

+Inherited by QextScintilla. +

+List of all members.

Public Types

+
    +
  • +SCI_START = 2000 +
  • +SCI_OPTIONAL_START = 3000 +
  • +SCI_LEXER_START = 4000 +
  • SCI_ADDTEXT = 2001 +
  • +SCI_ADDSTYLEDTEXT = 2002 +
  • +SCI_INSERTTEXT = 2003 +
  • +SCI_CLEARALL = 2004 +
  • +SCI_CLEARDOCUMENTSTYLE = 2005 +
  • +SCI_GETLENGTH = 2006 +
  • +SCI_GETCHARAT = 2007 +
  • SCI_GETCURRENTPOS = 2008 +
  • SCI_GETANCHOR = 2009 +
  • +SCI_GETSTYLEAT = 2010 +
  • +SCI_REDO = 2011 +
  • +SCI_SETUNDOCOLLECTION = 2012 +
  • +SCI_SELECTALL = 2013 +
  • SCI_SETSAVEPOINT = 2014 +
  • +SCI_GETSTYLEDTEXT = 2015 +
  • +SCI_CANREDO = 2016 +
  • SCI_MARKERLINEFROMHANDLE = 2017 +
  • SCI_MARKERDELETEHANDLE = 2018 +
  • +SCI_GETUNDOCOLLECTION = 2019 +
  • +SCI_GETVIEWWS = 2020 +
  • +SCI_SETVIEWWS = 2021 +
  • +SCI_POSITIONFROMPOINT = 2022 +
  • +SCI_POSITIONFROMPOINTCLOSE = 2023 +
  • +SCI_GOTOLINE = 2024 +
  • SCI_GOTOPOS = 2025 +
  • SCI_SETANCHOR = 2026 +
  • +SCI_GETCURLINE = 2027 +
  • SCI_GETENDSTYLED = 2028 +
  • +SCI_CONVERTEOLS = 2029 +
  • +SCI_GETEOLMODE = 2030 +
  • +SCI_SETEOLMODE = 2031 +
  • +SCI_STARTSTYLING = 2032 +
  • +SCI_SETSTYLING = 2033 +
  • +SCI_GETBUFFEREDDRAW = 2034 +
  • +SCI_SETBUFFEREDDRAW = 2035 +
  • +SCI_SETTABWIDTH = 2036 +
  • +SCI_GETTABWIDTH = 2121 +
  • +SCI_SETCODEPAGE = 2037 +
  • +SCI_SETUSEPALETTE = 2039 +
  • SCI_MARKERDEFINE = 2040 +
  • SCI_MARKERSETFORE = 2041 +
  • SCI_MARKERSETBACK = 2042 +
  • SCI_MARKERADD = 2043 +
  • SCI_MARKERDELETE = 2044 +
  • SCI_MARKERDELETEALL = 2045 +
  • SCI_MARKERGET = 2046 +
  • SCI_MARKERNEXT = 2047 +
  • SCI_MARKERPREVIOUS = 2048 +
  • SCI_MARKERDEFINEPIXMAP = 2049 +
  • SCI_SETMARGINTYPEN = 2240 +
  • SCI_GETMARGINTYPEN = 2241 +
  • SCI_SETMARGINWIDTHN = 2242 +
  • SCI_GETMARGINWIDTHN = 2243 +
  • SCI_SETMARGINMASKN = 2244 +
  • SCI_GETMARGINMASKN = 2245 +
  • SCI_SETMARGINSENSITIVEN = 2246 +
  • SCI_GETMARGINSENSITIVEN = 2247 +
  • +SCI_STYLECLEARALL = 2050 +
  • +SCI_STYLESETFORE = 2051 +
  • +SCI_STYLESETBACK = 2052 +
  • +SCI_STYLESETBOLD = 2053 +
  • +SCI_STYLESETITALIC = 2054 +
  • +SCI_STYLESETSIZE = 2055 +
  • +SCI_STYLESETFONT = 2056 +
  • +SCI_STYLESETEOLFILLED = 2057 +
  • +SCI_STYLERESETDEFAULT = 2058 +
  • +SCI_STYLESETUNDERLINE = 2059 +
  • +SCI_STYLESETCASE = 2060 +
  • +SCI_STYLESETCHARACTERSET = 2066 +
  • +SCI_SETSELFORE = 2067 +
  • +SCI_SETSELBACK = 2068 +
  • +SCI_SETCARETFORE = 2069 +
  • +SCI_ASSIGNCMDKEY = 2070 +
  • +SCI_CLEARCMDKEY = 2071 +
  • +SCI_CLEARALLCMDKEYS = 2072 +
  • +SCI_SETSTYLINGEX = 2073 +
  • +SCI_STYLESETVISIBLE = 2074 +
  • +SCI_GETCARETPERIOD = 2075 +
  • +SCI_SETCARETPERIOD = 2076 +
  • +SCI_SETWORDCHARS = 2077 +
  • +SCI_BEGINUNDOACTION = 2078 +
  • +SCI_ENDUNDOACTION = 2079 +
  • +SCI_INDICSETSTYLE = 2080 +
  • +SCI_INDICGETSTYLE = 2081 +
  • +SCI_INDICSETFORE = 2082 +
  • +SCI_INDICGETFORE = 2083 +
  • +SCI_SETWHITESPACEFORE = 2084 +
  • +SCI_SETWHITESPACEBACK = 2085 +
  • +SCI_SETSTYLEBITS = 2090 +
  • +SCI_GETSTYLEBITS = 2091 +
  • +SCI_SETLINESTATE = 2092 +
  • +SCI_GETLINESTATE = 2093 +
  • +SCI_GETMAXLINESTATE = 2094 +
  • +SCI_GETCARETLINEVISIBLE = 2095 +
  • +SCI_SETCARETLINEVISIBLE = 2096 +
  • +SCI_GETCARETLINEBACK = 2097 +
  • +SCI_SETCARETLINEBACK = 2098 +
  • +SCI_STYLESETCHANGEABLE = 2099 +
  • +SCI_AUTOCSHOW = 2100 +
  • +SCI_AUTOCCANCEL = 2101 +
  • +SCI_AUTOCACTIVE = 2102 +
  • +SCI_AUTOCPOSSTART = 2103 +
  • +SCI_AUTOCCOMPLETE = 2104 +
  • +SCI_AUTOCSTOPS = 2105 +
  • +SCI_AUTOCSETSEPARATOR = 2106 +
  • +SCI_AUTOCGETSEPARATOR = 2107 +
  • +SCI_AUTOCSELECT = 2108 +
  • +SCI_AUTOCSETCANCELATSTART = 2110 +
  • +SCI_AUTOCGETCANCELATSTART = 2111 +
  • +SCI_AUTOCSETFILLUPS = 2112 +
  • +SCI_AUTOCSETCHOOSESINGLE = 2113 +
  • +SCI_AUTOCGETCHOOSESINGLE = 2114 +
  • +SCI_AUTOCSETIGNORECASE = 2115 +
  • +SCI_AUTOCGETIGNORECASE = 2116 +
  • +SCI_USERLISTSHOW = 2117 +
  • +SCI_AUTOCSETAUTOHIDE = 2118 +
  • +SCI_AUTOCGETAUTOHIDE = 2119 +
  • +SCI_AUTOCSETDROPRESTOFWORD = 2270 +
  • +SCI_AUTOCGETDROPRESTOFWORD = 2271 +
  • +SCI_SETINDENT = 2122 +
  • +SCI_GETINDENT = 2123 +
  • +SCI_SETUSETABS = 2124 +
  • +SCI_GETUSETABS = 2125 +
  • +SCI_SETLINEINDENTATION = 2126 +
  • +SCI_GETLINEINDENTATION = 2127 +
  • +SCI_GETLINEINDENTPOSITION = 2128 +
  • +SCI_GETCOLUMN = 2129 +
  • +SCI_SETHSCROLLBAR = 2130 +
  • +SCI_GETHSCROLLBAR = 2131 +
  • +SCI_SETINDENTATIONGUIDES = 2132 +
  • +SCI_GETINDENTATIONGUIDES = 2133 +
  • +SCI_SETHIGHLIGHTGUIDE = 2134 +
  • +SCI_GETHIGHLIGHTGUIDE = 2135 +
  • +SCI_GETLINEENDPOSITION = 2136 +
  • +SCI_GETCODEPAGE = 2137 +
  • +SCI_GETCARETFORE = 2138 +
  • +SCI_GETUSEPALETTE = 2139 +
  • SCI_GETREADONLY = 2140 +
  • SCI_SETCURRENTPOS = 2141 +
  • +SCI_SETSELECTIONSTART = 2142 +
  • +SCI_GETSELECTIONSTART = 2143 +
  • +SCI_SETSELECTIONEND = 2144 +
  • +SCI_GETSELECTIONEND = 2145 +
  • +SCI_SETPRINTMAGNIFICATION = 2146 +
  • +SCI_GETPRINTMAGNIFICATION = 2147 +
  • +SCI_SETPRINTCOLOURMODE = 2148 +
  • +SCI_GETPRINTCOLOURMODE = 2149 +
  • +SCI_FINDTEXT = 2150 +
  • +SCI_FORMATRANGE = 2151 +
  • +SCI_GETFIRSTVISIBLELINE = 2152 +
  • +SCI_GETLINE = 2153 +
  • +SCI_GETLINECOUNT = 2154 +
  • +SCI_SETMARGINLEFT = 2155 +
  • +SCI_GETMARGINLEFT = 2156 +
  • +SCI_SETMARGINRIGHT = 2157 +
  • +SCI_GETMARGINRIGHT = 2158 +
  • SCI_GETMODIFY = 2159 +
  • +SCI_SETSEL = 2160 +
  • +SCI_GETSELTEXT = 2161 +
  • +SCI_GETTEXTRANGE = 2162 +
  • +SCI_HIDESELECTION = 2163 +
  • +SCI_POINTXFROMPOSITION = 2164 +
  • +SCI_POINTYFROMPOSITION = 2165 +
  • +SCI_LINEFROMPOSITION = 2166 +
  • +SCI_POSITIONFROMLINE = 2167 +
  • +SCI_LINESCROLL = 2168 +
  • +SCI_SCROLLCARET = 2169 +
  • +SCI_REPLACESEL = 2170 +
  • SCI_SETREADONLY = 2171 +
  • +SCI_NULL = 2172 +
  • +SCI_CANPASTE = 2173 +
  • +SCI_CANUNDO = 2174 +
  • SCI_EMPTYUNDOBUFFER = 2175 +
  • +SCI_UNDO = 2176 +
  • +SCI_CUT = 2177 +
  • +SCI_COPY = 2178 +
  • +SCI_PASTE = 2179 +
  • +SCI_CLEAR = 2180 +
  • SCI_SETTEXT = 2181 +
  • SCI_GETTEXT = 2182 +
  • SCI_GETTEXTLENGTH = 2183 +
  • +SCI_GETDIRECTFUNCTION = 2184 +
  • +SCI_GETDIRECTPOINTER = 2185 +
  • +SCI_SETOVERTYPE = 2186 +
  • +SCI_GETOVERTYPE = 2187 +
  • +SCI_SETCARETWIDTH = 2188 +
  • +SCI_GETCARETWIDTH = 2189 +
  • +SCI_SETTARGETSTART = 2190 +
  • +SCI_GETTARGETSTART = 2191 +
  • +SCI_SETTARGETEND = 2192 +
  • +SCI_GETTARGETEND = 2193 +
  • +SCI_REPLACETARGET = 2194 +
  • +SCI_REPLACETARGETRE = 2195 +
  • +SCI_SEARCHINTARGET = 2197 +
  • +SCI_SETSEARCHFLAGS = 2198 +
  • +SCI_GETSEARCHFLAGS = 2199 +
  • +SCI_CALLTIPSHOW = 2200 +
  • +SCI_CALLTIPCANCEL = 2201 +
  • +SCI_CALLTIPACTIVE = 2202 +
  • +SCI_CALLTIPPOSSTART = 2203 +
  • +SCI_CALLTIPSETHLT = 2204 +
  • +SCI_CALLTIPSETBACK = 2205 +
  • +SCI_CALLTIPSETFORE = 2206 +
  • +SCI_CALLTIPSETFOREHLT = 2207 +
  • +SCI_AUTOCSETMAXWIDTH = 2208 +
  • +SCI_AUTOCGETMAXWIDTH = 2209 +
  • +SCI_AUTOCSETMAXHEIGHT = 2210 +
  • +SCI_AUTOCGETMAXHEIGHT = 2211 +
  • +SCI_CALLTIPUSESTYLE = 2212 +
  • +SCI_VISIBLEFROMDOCLINE = 2220 +
  • +SCI_DOCLINEFROMVISIBLE = 2221 +
  • +SCI_SETFOLDLEVEL = 2222 +
  • +SCI_GETFOLDLEVEL = 2223 +
  • +SCI_GETLASTCHILD = 2224 +
  • +SCI_GETFOLDPARENT = 2225 +
  • +SCI_SHOWLINES = 2226 +
  • +SCI_HIDELINES = 2227 +
  • +SCI_GETLINEVISIBLE = 2228 +
  • +SCI_SETFOLDEXPANDED = 2229 +
  • +SCI_GETFOLDEXPANDED = 2230 +
  • +SCI_TOGGLEFOLD = 2231 +
  • +SCI_ENSUREVISIBLE = 2232 +
  • +SCI_SETFOLDFLAGS = 2233 +
  • +SCI_ENSUREVISIBLEENFORCEPOLICY = 2234 +
  • +SCI_WRAPCOUNT = 2235 +
  • +SCI_SETTABINDENTS = 2260 +
  • +SCI_GETTABINDENTS = 2261 +
  • +SCI_SETBACKSPACEUNINDENTS = 2262 +
  • +SCI_GETBACKSPACEUNINDENTS = 2263 +
  • +SCI_SETMOUSEDWELLTIME = 2264 +
  • +SCI_GETMOUSEDWELLTIME = 2265 +
  • +SCI_WORDSTARTPOSITION = 2266 +
  • +SCI_WORDENDPOSITION = 2267 +
  • +SCI_SETWRAPMODE = 2268 +
  • +SCI_GETWRAPMODE = 2269 +
  • +SCI_SETLAYOUTCACHE = 2272 +
  • +SCI_GETLAYOUTCACHE = 2273 +
  • +SCI_SETSCROLLWIDTH = 2274 +
  • +SCI_GETSCROLLWIDTH = 2275 +
  • SCI_TEXTWIDTH = 2276 +
  • +SCI_SETENDATLASTLINE = 2277 +
  • +SCI_GETENDATLASTLINE = 2278 +
  • +SCI_TEXTHEIGHT = 2279 +
  • +SCI_SETVSCROLLBAR = 2280 +
  • +SCI_GETVSCROLLBAR = 2281 +
  • +SCI_APPENDTEXT = 2282 +
  • +SCI_GETTWOPHASEDRAW = 2283 +
  • +SCI_SETTWOPHASEDRAW = 2284 +
  • +SCI_AUTOCGETTYPESEPARATOR = 2285 +
  • +SCI_AUTOCSETTYPESEPARATOR = 2286 +
  • +SCI_TARGETFROMSELECTION = 2287 +
  • +SCI_LINESJOIN = 2288 +
  • +SCI_LINESSPLIT = 2289 +
  • +SCI_SETFOLDMARGINCOLOUR = 2290 +
  • +SCI_SETFOLDMARGINHICOLOUR = 2291 +
  • +SCI_LINEDOWN = 2300 +
  • +SCI_LINEDOWNEXTEND = 2301 +
  • +SCI_LINEUP = 2302 +
  • +SCI_LINEUPEXTEND = 2303 +
  • +SCI_CHARLEFT = 2304 +
  • +SCI_CHARLEFTEXTEND = 2305 +
  • +SCI_CHARRIGHT = 2306 +
  • +SCI_CHARRIGHTEXTEND = 2307 +
  • +SCI_WORDLEFT = 2308 +
  • +SCI_WORDLEFTEXTEND = 2309 +
  • +SCI_WORDRIGHT = 2310 +
  • +SCI_WORDRIGHTEXTEND = 2311 +
  • +SCI_HOME = 2312 +
  • +SCI_HOMEEXTEND = 2313 +
  • +SCI_LINEEND = 2314 +
  • +SCI_LINEENDEXTEND = 2315 +
  • +SCI_DOCUMENTSTART = 2316 +
  • +SCI_DOCUMENTSTARTEXTEND = 2317 +
  • +SCI_DOCUMENTEND = 2318 +
  • +SCI_DOCUMENTENDEXTEND = 2319 +
  • +SCI_PAGEUP = 2320 +
  • +SCI_PAGEUPEXTEND = 2321 +
  • +SCI_PAGEDOWN = 2322 +
  • +SCI_PAGEDOWNEXTEND = 2323 +
  • +SCI_EDITTOGGLEOVERTYPE = 2324 +
  • +SCI_CANCEL = 2325 +
  • +SCI_DELETEBACK = 2326 +
  • +SCI_TAB = 2327 +
  • +SCI_BACKTAB = 2328 +
  • +SCI_NEWLINE = 2329 +
  • +SCI_FORMFEED = 2330 +
  • +SCI_VCHOME = 2331 +
  • +SCI_VCHOMEEXTEND = 2332 +
  • +SCI_ZOOMIN = 2333 +
  • +SCI_ZOOMOUT = 2334 +
  • +SCI_DELWORDLEFT = 2335 +
  • +SCI_DELWORDRIGHT = 2336 +
  • +SCI_LINECUT = 2337 +
  • +SCI_LINEDELETE = 2338 +
  • +SCI_LINETRANSPOSE = 2339 +
  • +SCI_LOWERCASE = 2340 +
  • +SCI_UPPERCASE = 2341 +
  • +SCI_LINESCROLLDOWN = 2342 +
  • +SCI_LINESCROLLUP = 2343 +
  • +SCI_DELETEBACKNOTLINE = 2344 +
  • +SCI_HOMEDISPLAY = 2345 +
  • +SCI_HOMEDISPLAYEXTEND = 2346 +
  • +SCI_LINEENDDISPLAY = 2347 +
  • +SCI_LINEENDDISPLAYEXTEND = 2348 +
  • +SCI_MOVECARETINSIDEVIEW = 2401 +
  • +SCI_LINELENGTH = 2350 +
  • +SCI_BRACEHIGHLIGHT = 2351 +
  • +SCI_BRACEBADLIGHT = 2352 +
  • +SCI_BRACEMATCH = 2353 +
  • +SCI_GETVIEWEOL = 2355 +
  • +SCI_SETVIEWEOL = 2356 +
  • +SCI_GETDOCPOINTER = 2357 +
  • +SCI_SETDOCPOINTER = 2358 +
  • +SCI_SETMODEVENTMASK = 2359 +
  • +SCI_GETEDGECOLUMN = 2360 +
  • +SCI_SETEDGECOLUMN = 2361 +
  • +SCI_GETEDGEMODE = 2362 +
  • +SCI_SETEDGEMODE = 2363 +
  • +SCI_GETEDGECOLOUR = 2364 +
  • +SCI_SETEDGECOLOUR = 2365 +
  • +SCI_SEARCHANCHOR = 2366 +
  • +SCI_SEARCHNEXT = 2367 +
  • +SCI_SEARCHPREV = 2368 +
  • +SCI_LINESONSCREEN = 2370 +
  • +SCI_USEPOPUP = 2371 +
  • +SCI_SELECTIONISRECTANGLE = 2372 +
  • +SCI_SETZOOM = 2373 +
  • +SCI_GETZOOM = 2374 +
  • +SCI_CREATEDOCUMENT = 2375 +
  • +SCI_ADDREFDOCUMENT = 2376 +
  • +SCI_RELEASEDOCUMENT = 2377 +
  • +SCI_GETMODEVENTMASK = 2378 +
  • +SCI_SETFOCUS = 2380 +
  • +SCI_GETFOCUS = 2381 +
  • +SCI_SETSTATUS = 2382 +
  • +SCI_GETSTATUS = 2383 +
  • +SCI_SETMOUSEDOWNCAPTURES = 2384 +
  • +SCI_GETMOUSEDOWNCAPTURES = 2385 +
  • +SCI_SETCURSOR = 2386 +
  • +SCI_GETCURSOR = 2387 +
  • +SCI_SETCONTROLCHARSYMBOL = 2388 +
  • +SCI_GETCONTROLCHARSYMBOL = 2389 +
  • +SCI_WORDPARTLEFT = 2390 +
  • +SCI_WORDPARTLEFTEXTEND = 2391 +
  • +SCI_WORDPARTRIGHT = 2392 +
  • +SCI_WORDPARTRIGHTEXTEND = 2393 +
  • +SCI_SETVISIBLEPOLICY = 2394 +
  • +SCI_DELLINELEFT = 2395 +
  • +SCI_DELLINERIGHT = 2396 +
  • +SCI_SETXOFFSET = 2397 +
  • +SCI_GETXOFFSET = 2398 +
  • +SCI_CHOOSECARETX = 2399 +
  • +SCI_GRABFOCUS = 2400 +
  • +SCI_SETXCARETPOLICY = 2402 +
  • +SCI_SETYCARETPOLICY = 2403 +
  • +SCI_LINEDUPLICATE = 2404 +
  • SCI_REGISTERIMAGE = 2405 +
  • +SCI_SETPRINTWRAPMODE = 2406 +
  • +SCI_GETPRINTWRAPMODE = 2407 +
  • SCI_CLEARREGISTEREDIMAGES = 2408 +
  • +SCI_STYLESETHOTSPOT = 2409 +
  • +SCI_SETHOTSPOTACTIVEFORE = 2410 +
  • +SCI_SETHOTSPOTACTIVEBACK = 2411 +
  • +SCI_SETHOTSPOTACTIVEUNDERLINE = 2412 +
  • +SCI_PARADOWN = 2413 +
  • +SCI_PARADOWNEXTEND = 2414 +
  • +SCI_PARAUP = 2415 +
  • +SCI_PARAUPEXTEND = 2416 +
  • +SCI_POSITIONBEFORE = 2417 +
  • +SCI_POSITIONAFTER = 2418 +
  • +SCI_COPYRANGE = 2419 +
  • +SCI_COPYTEXT = 2420 +
  • +SCI_SETSELECTIONMODE = 2422 +
  • +SCI_GETSELECTIONMODE = 2423 +
  • +SCI_GETLINESELSTARTPOSITION = 2424 +
  • +SCI_GETLINESELENDPOSITION = 2425 +
  • +SCI_LINEDOWNRECTEXTEND = 2426 +
  • +SCI_LINEUPRECTEXTEND = 2427 +
  • +SCI_CHARLEFTRECTEXTEND = 2428 +
  • +SCI_CHARRIGHTRECTEXTEND = 2429 +
  • +SCI_HOMERECTEXTEND = 2430 +
  • +SCI_VCHOMERECTEXTEND = 2431 +
  • +SCI_LINEENDRECTEXTEND = 2432 +
  • +SCI_PAGEUPRECTEXTEND = 2433 +
  • +SCI_PAGEDOWNRECTEXTEND = 2434 +
  • +SCI_STUTTEREDPAGEUP = 2435 +
  • +SCI_STUTTEREDPAGEUPEXTEND = 2436 +
  • +SCI_STUTTEREDPAGEDOWN = 2437 +
  • +SCI_STUTTEREDPAGEDOWNEXTEND = 2438 +
  • +SCI_WORDLEFTEND = 2439 +
  • +SCI_WORDLEFTENDEXTEND = 2440 +
  • +SCI_WORDRIGHTEND = 2441 +
  • +SCI_WORDRIGHTENDEXTEND = 2442 +
  • +SCI_SETWHITESPACECHARS = 2443 +
  • +SCI_SETCHARSDEFAULT = 2444 +
  • +SCI_AUTOCGETCURRENT = 2445 +
  • +SCI_ALLOCATE = 2446 +
  • +SCI_HOMEWRAP = 2349 +
  • +SCI_HOMEWRAPEXTEND = 2450 +
  • +SCI_LINEENDWRAP = 2451 +
  • +SCI_LINEENDWRAPEXTEND = 2452 +
  • +SCI_VCHOMEWRAP = 2453 +
  • +SCI_VCHOMEWRAPEXTEND = 2454 +
  • +SCI_LINECOPY = 2455 +
  • +SCI_FINDCOLUMN = 2456 +
  • +SCI_GETCARETSTICKY = 2457 +
  • +SCI_SETCARETSTICKY = 2458 +
  • +SCI_TOGGLECARETSTICKY = 2459 +
  • +SCI_SETWRAPVISUALFLAGS = 2460 +
  • +SCI_GETWRAPVISUALFLAGS = 2461 +
  • +SCI_SETWRAPVISUALFLAGSLOCATION = 2462 +
  • +SCI_GETWRAPVISUALFLAGSLOCATION = 2463 +
  • +SCI_SETWRAPSTARTINDENT = 2464 +
  • +SCI_GETWRAPSTARTINDENT = 2465 +
  • +SCI_MARKERADDSET = 2466 +
  • +SCI_SETPASTECONVERTENDINGS = 2467 +
  • +SCI_GETPASTECONVERTENDINGS = 2468 +
  • +SCI_SELECTIONDUPLICATE = 2469 +
  • +SCI_SETCARETLINEBACKALPHA = 2470 +
  • +SCI_GETCARETLINEBACKALPHA = 2471 +
  • +SCI_MARKERSETALPHA = 2476 +
  • +SCI_GETSELALPHA = 2477 +
  • +SCI_SETSELALPHA = 2478 +
  • +SCI_STARTRECORD = 3001 +
  • +SCI_STOPRECORD = 3002 +
  • SCI_SETLEXER = 4001 +
  • SCI_GETLEXER = 4002 +
  • +SCI_COLOURISE = 4003 +
  • +SCI_SETPROPERTY = 4004 +
  • +SCI_SETKEYWORDS = 4005 +
  • SCI_SETLEXERLANGUAGE = 4006 +
  • +SCI_LOADLEXERLIBRARY = 4007 +
  • +SCI_GETPROPERTY = 4008 +
  • +SCI_GETPROPERTYEXPANDED = 4009 +
  • +SCI_GETPROPERTYINT = 4010 +
  • +SCI_GETSTYLEBITSNEEDED = 4011 +
  • +SC_ALPHA_TRANSPARENT = 0 +
  • +SC_ALPHA_OPAQUE = 255 +
  • +SC_ALPHA_NOALPHA = 256 +
  • +SC_WRAPVISUALFLAG_NONE = 0x0000 +
  • +SC_WRAPVISUALFLAG_END = 0x0001 +
  • +SC_WRAPVISUALFLAG_START = 0x0002 +
  • +SC_WRAPVISUALFLAGLOC_DEFAULT = 0x0000 +
  • +SC_WRAPVISUALFLAGLOC_END_BY_TEXT = 0x0001 +
  • +SC_WRAPVISUALFLAGLOC_START_BY_TEXT = 0x0002 +
  • +SC_SEL_STREAM = 0 +
  • +SC_SEL_RECTANGLE = 1 +
  • +SC_SEL_LINES = 2 +
  • +SCWS_INVISIBLE = 0 +
  • +SCWS_VISIBLEALWAYS = 1 +
  • +SCWS_VISIBLEAFTERINDENT = 2 +
  • +SC_EOL_CRLF = 0 +
  • +SC_EOL_CR = 1 +
  • +SC_EOL_LF = 2 +
  • +SC_CP_DBCS = 1 +
  • +SC_CP_UTF8 = 65001 +
  • SC_MARK_CIRCLE = 0 +
  • SC_MARK_ROUNDRECT = 1 +
  • SC_MARK_ARROW = 2 +
  • SC_MARK_SMALLRECT = 3 +
  • SC_MARK_SHORTARROW = 4 +
  • SC_MARK_EMPTY = 5 +
  • SC_MARK_ARROWDOWN = 6 +
  • SC_MARK_MINUS = 7 +
  • SC_MARK_PLUS = 8 +
  • SC_MARK_VLINE = 9 +
  • SC_MARK_LCORNER = 10 +
  • SC_MARK_TCORNER = 11 +
  • SC_MARK_BOXPLUS = 12 +
  • SC_MARK_BOXPLUSCONNECTED = 13 +
  • SC_MARK_BOXMINUS = 14 +
  • SC_MARK_BOXMINUSCONNECTED = 15 +
  • SC_MARK_LCORNERCURVE = 16 +
  • SC_MARK_TCORNERCURVE = 17 +
  • SC_MARK_CIRCLEPLUS = 18 +
  • SC_MARK_CIRCLEPLUSCONNECTED = 19 +
  • SC_MARK_CIRCLEMINUS = 20 +
  • SC_MARK_CIRCLEMINUSCONNECTED = 21 +
  • SC_MARK_BACKGROUND = 22 +
  • SC_MARK_DOTDOTDOT = 23 +
  • SC_MARK_ARROWS = 24 +
  • SC_MARK_PIXMAP = 25 +
  • SC_MARK_FULLRECT = 26 +
  • SC_MARK_CHARACTER = 10000 +
  • +SC_MARKNUM_FOLDEREND = 25 +
  • +SC_MARKNUM_FOLDEROPENMID = 26 +
  • +SC_MARKNUM_FOLDERMIDTAIL = 27 +
  • +SC_MARKNUM_FOLDERTAIL = 28 +
  • +SC_MARKNUM_FOLDERSUB = 29 +
  • +SC_MARKNUM_FOLDER = 30 +
  • +SC_MARKNUM_FOLDEROPEN = 31 +
  • +SC_MASK_FOLDERS = 0xfe000000 +
  • SC_MARGIN_SYMBOL = 0 +
  • SC_MARGIN_NUMBER = 1 +
  • SC_MARGIN_BACK = 2 +
  • SC_MARGIN_FORE = 3 +
  • +STYLE_DEFAULT = 32 +
  • +STYLE_LINENUMBER = 33 +
  • +STYLE_BRACELIGHT = 34 +
  • +STYLE_BRACEBAD = 35 +
  • +STYLE_CONTROLCHAR = 36 +
  • +STYLE_INDENTGUIDE = 37 +
  • +STYLE_CALLTIP = 38 +
  • +STYLE_LASTPREDEFINED = 39 +
  • +STYLE_MAX = 127 +
  • +SC_CHARSET_ANSI = 0 +
  • +SC_CHARSET_DEFAULT = 1 +
  • +SC_CHARSET_BALTIC = 186 +
  • +SC_CHARSET_CHINESEBIG5 = 136 +
  • +SC_CHARSET_EASTEUROPE = 238 +
  • +SC_CHARSET_GB2312 = 134 +
  • +SC_CHARSET_GREEK = 161 +
  • +SC_CHARSET_HANGUL = 129 +
  • +SC_CHARSET_MAC = 77 +
  • +SC_CHARSET_OEM = 255 +
  • +SC_CHARSET_RUSSIAN = 204 +
  • +SC_CHARSET_SHIFTJIS = 128 +
  • +SC_CHARSET_SYMBOL = 2 +
  • +SC_CHARSET_TURKISH = 162 +
  • +SC_CHARSET_JOHAB = 130 +
  • +SC_CHARSET_HEBREW = 177 +
  • +SC_CHARSET_ARABIC = 178 +
  • +SC_CHARSET_VIETNAMESE = 163 +
  • +SC_CHARSET_THAI = 222 +
  • +SC_CHARSET_8859_15 = 1000 +
  • +SC_CASE_MIXED = 0 +
  • +SC_CASE_UPPER = 1 +
  • +SC_CASE_LOWER = 2 +
  • +INDIC_MAX = 7 +
  • +INDIC_PLAIN = 0 +
  • +INDIC_SQUIGGLE = 1 +
  • +INDIC_TT = 2 +
  • +INDIC_DIAGONAL = 3 +
  • +INDIC_STRIKE = 4 +
  • +INDIC_HIDDEN = 5 +
  • +INDIC_BOX = 6 +
  • +INDIC_ROUNDBOX = 7 +
  • +INDIC0_MASK = 0x20 +
  • +INDIC1_MASK = 0x40 +
  • +INDIC2_MASK = 0x80 +
  • +INDICS_MASK = 0xe0 +
  • +SC_PRINT_NORMAL = 0 +
  • +SC_PRINT_INVERTLIGHT = 1 +
  • +SC_PRINT_BLACKONWHITE = 2 +
  • +SC_PRINT_COLOURONWHITE = 3 +
  • +SC_PRINT_COLOURONWHITEDEFAULTBG = 4 +
  • +SCFIND_WHOLEWORD = 2 +
  • +SCFIND_MATCHCASE = 4 +
  • +SCFIND_WORDSTART = 0x00100000 +
  • +SCFIND_REGEXP = 0x00200000 +
  • +SCFIND_POSIX = 0x00400000 +
  • +SC_FOLDLEVELBASE = 0x00400 +
  • +SC_FOLDLEVELWHITEFLAG = 0x01000 +
  • +SC_FOLDLEVELHEADERFLAG = 0x02000 +
  • +SC_FOLDLEVELBOXHEADERFLAG = 0x04000 +
  • +SC_FOLDLEVELBOXFOOTERFLAG = 0x08000 +
  • +SC_FOLDLEVELCONTRACTED = 0x10000 +
  • +SC_FOLDLEVELUNINDENT = 0x20000 +
  • +SC_FOLDLEVELNUMBERMASK = 0x00fff +
  • +SC_FOLDFLAG_BOX = 0x0001 +
  • +SC_FOLDFLAG_LINEBEFORE_EXPANDED = 0x0002 +
  • +SC_FOLDFLAG_LINEBEFORE_CONTRACTED = 0x0004 +
  • +SC_FOLDFLAG_LINEAFTER_EXPANDED = 0x0008 +
  • +SC_FOLDFLAG_LINEAFTER_CONTRACTED = 0x0010 +
  • +SC_FOLDFLAG_LEVELNUMBERS = 0x0040 +
  • +SC_TIME_FOREVER = 10000000 +
  • +SC_WRAP_NONE = 0 +
  • +SC_WRAP_WORD = 1 +
  • +SC_WRAP_CHAR = 2 +
  • +SC_CACHE_NONE = 0 +
  • +SC_CACHE_CARET = 1 +
  • +SC_CACHE_PAGE = 2 +
  • +SC_CACHE_DOCUMENT = 3 +
  • +EDGE_NONE = 0 +
  • +EDGE_LINE = 1 +
  • +EDGE_BACKGROUND = 2 +
  • +SC_CURSORNORMAL = -1 +
  • +SC_CURSORWAIT = 4 +
  • +VISIBLE_SLOP = 0x01 +
  • +VISIBLE_STRICT = 0x04 +
  • +CARET_SLOP = 0x01 +
  • +CARET_STRICT = 0x04 +
  • +CARET_JUMPS = 0x10 +
  • +CARET_EVEN = 0x08 +
  • +SC_MOD_INSERTTEXT = 0x1 +
  • +SC_MOD_DELETETEXT = 0x2 +
  • +SC_MOD_CHANGESTYLE = 0x4 +
  • +SC_MOD_CHANGEFOLD = 0x8 +
  • +SC_PERFORMED_USER = 0x10 +
  • +SC_PERFORMED_UNDO = 0x20 +
  • +SC_PERFORMED_REDO = 0x40 +
  • +SC_MULTISTEPUNDOREDO = 0x80 +
  • +SC_LASTSTEPINUNDOREDO = 0x100 +
  • +SC_MOD_CHANGEMARKER = 0x200 +
  • +SC_MOD_BEFOREINSERT = 0x400 +
  • +SC_MOD_BEFOREDELETE = 0x800 +
  • +SC_MULTILINEUNDOREDO = 0x1000 +
  • +SC_MODEVENTMASKALL = 0x1fff +
  • +SCK_DOWN = 300 +
  • +SCK_UP = 301 +
  • +SCK_LEFT = 302 +
  • +SCK_RIGHT = 303 +
  • +SCK_HOME = 304 +
  • +SCK_END = 305 +
  • +SCK_PRIOR = 306 +
  • +SCK_NEXT = 307 +
  • +SCK_DELETE = 308 +
  • +SCK_INSERT = 309 +
  • +SCK_ESCAPE = 7 +
  • +SCK_BACK = 8 +
  • +SCK_TAB = 9 +
  • +SCK_RETURN = 13 +
  • +SCK_ADD = 310 +
  • +SCK_SUBTRACT = 311 +
  • +SCK_DIVIDE = 312 +
  • SCMOD_NORM = 0 +
  • SCMOD_SHIFT = 1 +
  • SCMOD_CTRL = 2 +
  • SCMOD_ALT = 4 +
  • SCLEX_CONTAINER = 0 +
  • SCLEX_NULL = 1 +
  • SCLEX_PYTHON = 2 +
  • SCLEX_CPP = 3 +
  • SCLEX_HTML = 4 +
  • SCLEX_XML = 5 +
  • SCLEX_PERL = 6 +
  • SCLEX_SQL = 7 +
  • SCLEX_VB = 8 +
  • SCLEX_PROPERTIES = 9 +
  • SCLEX_ERRORLIST = 10 +
  • SCLEX_MAKEFILE = 11 +
  • SCLEX_BATCH = 12 +
  • SCLEX_LATEX = 14 +
  • SCLEX_LUA = 15 +
  • SCLEX_DIFF = 16 +
  • SCLEX_CONF = 17 +
  • SCLEX_PASCAL = 18 +
  • SCLEX_AVE = 19 +
  • SCLEX_ADA = 20 +
  • SCLEX_LISP = 21 +
  • SCLEX_RUBY = 22 +
  • SCLEX_EIFFEL = 23 +
  • SCLEX_EIFFELKW = 24 +
  • SCLEX_TCL = 25 +
  • SCLEX_NNCRONTAB = 26 +
  • SCLEX_BULLANT = 27 +
  • SCLEX_VBSCRIPT = 28 +
  • SCLEX_ASP = SCLEX_HTML +
  • SCLEX_PHP = SCLEX_HTML +
  • SCLEX_BAAN = 31 +
  • SCLEX_MATLAB = 32 +
  • SCLEX_SCRIPTOL = 33 +
  • SCLEX_ASM = 34 +
  • SCLEX_CPPNOCASE = 35 +
  • SCLEX_FORTRAN = 36 +
  • SCLEX_F77 = 37 +
  • SCLEX_CSS = 38 +
  • SCLEX_POV = 39 +
  • SCLEX_LOUT = 40 +
  • SCLEX_ESCRIPT = 41 +
  • SCLEX_PS = 42 +
  • SCLEX_NSIS = 43 +
  • SCLEX_MMIXAL = 44 +
  • SCLEX_CLW = 45 +
  • SCLEX_CLWNOCASE = 46 +
  • SCLEX_LOT = 47 +
  • SCLEX_YAML = 48 +
  • SCLEX_TEX = 49 +
  • SCLEX_METAPOST = 50 +
  • SCLEX_POWERBASIC = 51 +
  • SCLEX_FORTH = 52 +
  • SCLEX_ERLANG = 53 +
  • SCLEX_OCTAVE = 54 +
  • SCLEX_MSSQL = 55 +
  • SCLEX_VERILOG = 56 +
  • SCLEX_KIX = 57 +
  • SCLEX_GUI4CLI = 58 +
  • SCLEX_SPECMAN = 59 +
  • SCLEX_AU3 = 60 +
  • SCLEX_APDL = 61 +
  • SCLEX_BASH = 62 +
  • SCLEX_ASN1 = 63 +
  • SCLEX_VHDL = 64 +
  • SCLEX_CAML = 65 +
  • SCLEX_BLITZBASIC = 66 +
  • SCLEX_PUREBASIC = 67 +
  • SCLEX_HASKELL = 68 +
  • SCLEX_PHPSCRIPT = 69 +
  • SCLEX_TADS3 = 70 +
  • SCLEX_REBOL = 71 +
  • SCLEX_SMALLTALK = 72 +
  • SCLEX_FLAGSHIP = 73 +
  • SCLEX_CSOUND = 74 +
  • SCLEX_FREEBASIC = 75 +
  • SCLEX_INNOSETUP = 76 +
  • SCLEX_OPAL = 77 +
  • SCLEX_SPICE = 78 +
  • enum {
    +  SCI_START = 2000, +SCI_OPTIONAL_START = 3000, +SCI_LEXER_START = 4000, +
    +  SCI_ADDTEXT = 2001, +SCI_ADDSTYLEDTEXT = 2002, +SCI_INSERTTEXT = 2003, +
    +  SCI_CLEARALL = 2004, +SCI_CLEARDOCUMENTSTYLE = 2005, +SCI_GETLENGTH = 2006, +
    +  SCI_GETCHARAT = 2007, +SCI_GETCURRENTPOS = 2008, +SCI_GETANCHOR = 2009, +
    +  SCI_GETSTYLEAT = 2010, +SCI_REDO = 2011, +SCI_SETUNDOCOLLECTION = 2012, +
    +  SCI_SELECTALL = 2013, +SCI_SETSAVEPOINT = 2014, +SCI_GETSTYLEDTEXT = 2015, +
    +  SCI_CANREDO = 2016, +SCI_MARKERLINEFROMHANDLE = 2017, +SCI_MARKERDELETEHANDLE = 2018, +
    +  SCI_GETUNDOCOLLECTION = 2019, +SCI_GETVIEWWS = 2020, +SCI_SETVIEWWS = 2021, +
    +  SCI_POSITIONFROMPOINT = 2022, +SCI_POSITIONFROMPOINTCLOSE = 2023, +SCI_GOTOLINE = 2024, +
    +  SCI_GOTOPOS = 2025, +SCI_SETANCHOR = 2026, +SCI_GETCURLINE = 2027, +
    +  SCI_GETENDSTYLED = 2028, +SCI_CONVERTEOLS = 2029, +SCI_GETEOLMODE = 2030, +
    +  SCI_SETEOLMODE = 2031, +SCI_STARTSTYLING = 2032, +SCI_SETSTYLING = 2033, +
    +  SCI_GETBUFFEREDDRAW = 2034, +SCI_SETBUFFEREDDRAW = 2035, +SCI_SETTABWIDTH = 2036, +
    +  SCI_GETTABWIDTH = 2121, +SCI_SETCODEPAGE = 2037, +SCI_SETUSEPALETTE = 2039, +
    +  SCI_MARKERDEFINE = 2040, +SCI_MARKERSETFORE = 2041, +SCI_MARKERSETBACK = 2042, +
    +  SCI_MARKERADD = 2043, +SCI_MARKERDELETE = 2044, +SCI_MARKERDELETEALL = 2045, +
    +  SCI_MARKERGET = 2046, +SCI_MARKERNEXT = 2047, +SCI_MARKERPREVIOUS = 2048, +
    +  SCI_MARKERDEFINEPIXMAP = 2049, +SCI_SETMARGINTYPEN = 2240, +SCI_GETMARGINTYPEN = 2241, +
    +  SCI_SETMARGINWIDTHN = 2242, +SCI_GETMARGINWIDTHN = 2243, +SCI_SETMARGINMASKN = 2244, +
    +  SCI_GETMARGINMASKN = 2245, +SCI_SETMARGINSENSITIVEN = 2246, +SCI_GETMARGINSENSITIVEN = 2247, +
    +  SCI_STYLECLEARALL = 2050, +SCI_STYLESETFORE = 2051, +SCI_STYLESETBACK = 2052, +
    +  SCI_STYLESETBOLD = 2053, +SCI_STYLESETITALIC = 2054, +SCI_STYLESETSIZE = 2055, +
    +  SCI_STYLESETFONT = 2056, +SCI_STYLESETEOLFILLED = 2057, +SCI_STYLERESETDEFAULT = 2058, +
    +  SCI_STYLESETUNDERLINE = 2059, +SCI_STYLESETCASE = 2060, +SCI_STYLESETCHARACTERSET = 2066, +
    +  SCI_SETSELFORE = 2067, +SCI_SETSELBACK = 2068, +SCI_SETCARETFORE = 2069, +
    +  SCI_ASSIGNCMDKEY = 2070, +SCI_CLEARCMDKEY = 2071, +SCI_CLEARALLCMDKEYS = 2072, +
    +  SCI_SETSTYLINGEX = 2073, +SCI_STYLESETVISIBLE = 2074, +SCI_GETCARETPERIOD = 2075, +
    +  SCI_SETCARETPERIOD = 2076, +SCI_SETWORDCHARS = 2077, +SCI_BEGINUNDOACTION = 2078, +
    +  SCI_ENDUNDOACTION = 2079, +SCI_INDICSETSTYLE = 2080, +SCI_INDICGETSTYLE = 2081, +
    +  SCI_INDICSETFORE = 2082, +SCI_INDICGETFORE = 2083, +SCI_SETWHITESPACEFORE = 2084, +
    +  SCI_SETWHITESPACEBACK = 2085, +SCI_SETSTYLEBITS = 2090, +SCI_GETSTYLEBITS = 2091, +
    +  SCI_SETLINESTATE = 2092, +SCI_GETLINESTATE = 2093, +SCI_GETMAXLINESTATE = 2094, +
    +  SCI_GETCARETLINEVISIBLE = 2095, +SCI_SETCARETLINEVISIBLE = 2096, +SCI_GETCARETLINEBACK = 2097, +
    +  SCI_SETCARETLINEBACK = 2098, +SCI_STYLESETCHANGEABLE = 2099, +SCI_AUTOCSHOW = 2100, +
    +  SCI_AUTOCCANCEL = 2101, +SCI_AUTOCACTIVE = 2102, +SCI_AUTOCPOSSTART = 2103, +
    +  SCI_AUTOCCOMPLETE = 2104, +SCI_AUTOCSTOPS = 2105, +SCI_AUTOCSETSEPARATOR = 2106, +
    +  SCI_AUTOCGETSEPARATOR = 2107, +SCI_AUTOCSELECT = 2108, +SCI_AUTOCSETCANCELATSTART = 2110, +
    +  SCI_AUTOCGETCANCELATSTART = 2111, +SCI_AUTOCSETFILLUPS = 2112, +SCI_AUTOCSETCHOOSESINGLE = 2113, +
    +  SCI_AUTOCGETCHOOSESINGLE = 2114, +SCI_AUTOCSETIGNORECASE = 2115, +SCI_AUTOCGETIGNORECASE = 2116, +
    +  SCI_USERLISTSHOW = 2117, +SCI_AUTOCSETAUTOHIDE = 2118, +SCI_AUTOCGETAUTOHIDE = 2119, +
    +  SCI_AUTOCSETDROPRESTOFWORD = 2270, +SCI_AUTOCGETDROPRESTOFWORD = 2271, +SCI_SETINDENT = 2122, +
    +  SCI_GETINDENT = 2123, +SCI_SETUSETABS = 2124, +SCI_GETUSETABS = 2125, +
    +  SCI_SETLINEINDENTATION = 2126, +SCI_GETLINEINDENTATION = 2127, +SCI_GETLINEINDENTPOSITION = 2128, +
    +  SCI_GETCOLUMN = 2129, +SCI_SETHSCROLLBAR = 2130, +SCI_GETHSCROLLBAR = 2131, +
    +  SCI_SETINDENTATIONGUIDES = 2132, +SCI_GETINDENTATIONGUIDES = 2133, +SCI_SETHIGHLIGHTGUIDE = 2134, +
    +  SCI_GETHIGHLIGHTGUIDE = 2135, +SCI_GETLINEENDPOSITION = 2136, +SCI_GETCODEPAGE = 2137, +
    +  SCI_GETCARETFORE = 2138, +SCI_GETUSEPALETTE = 2139, +SCI_GETREADONLY = 2140, +
    +  SCI_SETCURRENTPOS = 2141, +SCI_SETSELECTIONSTART = 2142, +SCI_GETSELECTIONSTART = 2143, +
    +  SCI_SETSELECTIONEND = 2144, +SCI_GETSELECTIONEND = 2145, +SCI_SETPRINTMAGNIFICATION = 2146, +
    +  SCI_GETPRINTMAGNIFICATION = 2147, +SCI_SETPRINTCOLOURMODE = 2148, +SCI_GETPRINTCOLOURMODE = 2149, +
    +  SCI_FINDTEXT = 2150, +SCI_FORMATRANGE = 2151, +SCI_GETFIRSTVISIBLELINE = 2152, +
    +  SCI_GETLINE = 2153, +SCI_GETLINECOUNT = 2154, +SCI_SETMARGINLEFT = 2155, +
    +  SCI_GETMARGINLEFT = 2156, +SCI_SETMARGINRIGHT = 2157, +SCI_GETMARGINRIGHT = 2158, +
    +  SCI_GETMODIFY = 2159, +SCI_SETSEL = 2160, +SCI_GETSELTEXT = 2161, +
    +  SCI_GETTEXTRANGE = 2162, +SCI_HIDESELECTION = 2163, +SCI_POINTXFROMPOSITION = 2164, +
    +  SCI_POINTYFROMPOSITION = 2165, +SCI_LINEFROMPOSITION = 2166, +SCI_POSITIONFROMLINE = 2167, +
    +  SCI_LINESCROLL = 2168, +SCI_SCROLLCARET = 2169, +SCI_REPLACESEL = 2170, +
    +  SCI_SETREADONLY = 2171, +SCI_NULL = 2172, +SCI_CANPASTE = 2173, +
    +  SCI_CANUNDO = 2174, +SCI_EMPTYUNDOBUFFER = 2175, +SCI_UNDO = 2176, +
    +  SCI_CUT = 2177, +SCI_COPY = 2178, +SCI_PASTE = 2179, +
    +  SCI_CLEAR = 2180, +SCI_SETTEXT = 2181, +SCI_GETTEXT = 2182, +
    +  SCI_GETTEXTLENGTH = 2183, +SCI_GETDIRECTFUNCTION = 2184, +SCI_GETDIRECTPOINTER = 2185, +
    +  SCI_SETOVERTYPE = 2186, +SCI_GETOVERTYPE = 2187, +SCI_SETCARETWIDTH = 2188, +
    +  SCI_GETCARETWIDTH = 2189, +SCI_SETTARGETSTART = 2190, +SCI_GETTARGETSTART = 2191, +
    +  SCI_SETTARGETEND = 2192, +SCI_GETTARGETEND = 2193, +SCI_REPLACETARGET = 2194, +
    +  SCI_REPLACETARGETRE = 2195, +SCI_SEARCHINTARGET = 2197, +SCI_SETSEARCHFLAGS = 2198, +
    +  SCI_GETSEARCHFLAGS = 2199, +SCI_CALLTIPSHOW = 2200, +SCI_CALLTIPCANCEL = 2201, +
    +  SCI_CALLTIPACTIVE = 2202, +SCI_CALLTIPPOSSTART = 2203, +SCI_CALLTIPSETHLT = 2204, +
    +  SCI_CALLTIPSETBACK = 2205, +SCI_CALLTIPSETFORE = 2206, +SCI_CALLTIPSETFOREHLT = 2207, +
    +  SCI_AUTOCSETMAXWIDTH = 2208, +SCI_AUTOCGETMAXWIDTH = 2209, +SCI_AUTOCSETMAXHEIGHT = 2210, +
    +  SCI_AUTOCGETMAXHEIGHT = 2211, +SCI_CALLTIPUSESTYLE = 2212, +SCI_VISIBLEFROMDOCLINE = 2220, +
    +  SCI_DOCLINEFROMVISIBLE = 2221, +SCI_SETFOLDLEVEL = 2222, +SCI_GETFOLDLEVEL = 2223, +
    +  SCI_GETLASTCHILD = 2224, +SCI_GETFOLDPARENT = 2225, +SCI_SHOWLINES = 2226, +
    +  SCI_HIDELINES = 2227, +SCI_GETLINEVISIBLE = 2228, +SCI_SETFOLDEXPANDED = 2229, +
    +  SCI_GETFOLDEXPANDED = 2230, +SCI_TOGGLEFOLD = 2231, +SCI_ENSUREVISIBLE = 2232, +
    +  SCI_SETFOLDFLAGS = 2233, +SCI_ENSUREVISIBLEENFORCEPOLICY = 2234, +SCI_WRAPCOUNT = 2235, +
    +  SCI_SETTABINDENTS = 2260, +SCI_GETTABINDENTS = 2261, +SCI_SETBACKSPACEUNINDENTS = 2262, +
    +  SCI_GETBACKSPACEUNINDENTS = 2263, +SCI_SETMOUSEDWELLTIME = 2264, +SCI_GETMOUSEDWELLTIME = 2265, +
    +  SCI_WORDSTARTPOSITION = 2266, +SCI_WORDENDPOSITION = 2267, +SCI_SETWRAPMODE = 2268, +
    +  SCI_GETWRAPMODE = 2269, +SCI_SETLAYOUTCACHE = 2272, +SCI_GETLAYOUTCACHE = 2273, +
    +  SCI_SETSCROLLWIDTH = 2274, +SCI_GETSCROLLWIDTH = 2275, +SCI_TEXTWIDTH = 2276, +
    +  SCI_SETENDATLASTLINE = 2277, +SCI_GETENDATLASTLINE = 2278, +SCI_TEXTHEIGHT = 2279, +
    +  SCI_SETVSCROLLBAR = 2280, +SCI_GETVSCROLLBAR = 2281, +SCI_APPENDTEXT = 2282, +
    +  SCI_GETTWOPHASEDRAW = 2283, +SCI_SETTWOPHASEDRAW = 2284, +SCI_AUTOCGETTYPESEPARATOR = 2285, +
    +  SCI_AUTOCSETTYPESEPARATOR = 2286, +SCI_TARGETFROMSELECTION = 2287, +SCI_LINESJOIN = 2288, +
    +  SCI_LINESSPLIT = 2289, +SCI_SETFOLDMARGINCOLOUR = 2290, +SCI_SETFOLDMARGINHICOLOUR = 2291, +
    +  SCI_LINEDOWN = 2300, +SCI_LINEDOWNEXTEND = 2301, +SCI_LINEUP = 2302, +
    +  SCI_LINEUPEXTEND = 2303, +SCI_CHARLEFT = 2304, +SCI_CHARLEFTEXTEND = 2305, +
    +  SCI_CHARRIGHT = 2306, +SCI_CHARRIGHTEXTEND = 2307, +SCI_WORDLEFT = 2308, +
    +  SCI_WORDLEFTEXTEND = 2309, +SCI_WORDRIGHT = 2310, +SCI_WORDRIGHTEXTEND = 2311, +
    +  SCI_HOME = 2312, +SCI_HOMEEXTEND = 2313, +SCI_LINEEND = 2314, +
    +  SCI_LINEENDEXTEND = 2315, +SCI_DOCUMENTSTART = 2316, +SCI_DOCUMENTSTARTEXTEND = 2317, +
    +  SCI_DOCUMENTEND = 2318, +SCI_DOCUMENTENDEXTEND = 2319, +SCI_PAGEUP = 2320, +
    +  SCI_PAGEUPEXTEND = 2321, +SCI_PAGEDOWN = 2322, +SCI_PAGEDOWNEXTEND = 2323, +
    +  SCI_EDITTOGGLEOVERTYPE = 2324, +SCI_CANCEL = 2325, +SCI_DELETEBACK = 2326, +
    +  SCI_TAB = 2327, +SCI_BACKTAB = 2328, +SCI_NEWLINE = 2329, +
    +  SCI_FORMFEED = 2330, +SCI_VCHOME = 2331, +SCI_VCHOMEEXTEND = 2332, +
    +  SCI_ZOOMIN = 2333, +SCI_ZOOMOUT = 2334, +SCI_DELWORDLEFT = 2335, +
    +  SCI_DELWORDRIGHT = 2336, +SCI_LINECUT = 2337, +SCI_LINEDELETE = 2338, +
    +  SCI_LINETRANSPOSE = 2339, +SCI_LOWERCASE = 2340, +SCI_UPPERCASE = 2341, +
    +  SCI_LINESCROLLDOWN = 2342, +SCI_LINESCROLLUP = 2343, +SCI_DELETEBACKNOTLINE = 2344, +
    +  SCI_HOMEDISPLAY = 2345, +SCI_HOMEDISPLAYEXTEND = 2346, +SCI_LINEENDDISPLAY = 2347, +
    +  SCI_LINEENDDISPLAYEXTEND = 2348, +SCI_MOVECARETINSIDEVIEW = 2401, +SCI_LINELENGTH = 2350, +
    +  SCI_BRACEHIGHLIGHT = 2351, +SCI_BRACEBADLIGHT = 2352, +SCI_BRACEMATCH = 2353, +
    +  SCI_GETVIEWEOL = 2355, +SCI_SETVIEWEOL = 2356, +SCI_GETDOCPOINTER = 2357, +
    +  SCI_SETDOCPOINTER = 2358, +SCI_SETMODEVENTMASK = 2359, +SCI_GETEDGECOLUMN = 2360, +
    +  SCI_SETEDGECOLUMN = 2361, +SCI_GETEDGEMODE = 2362, +SCI_SETEDGEMODE = 2363, +
    +  SCI_GETEDGECOLOUR = 2364, +SCI_SETEDGECOLOUR = 2365, +SCI_SEARCHANCHOR = 2366, +
    +  SCI_SEARCHNEXT = 2367, +SCI_SEARCHPREV = 2368, +SCI_LINESONSCREEN = 2370, +
    +  SCI_USEPOPUP = 2371, +SCI_SELECTIONISRECTANGLE = 2372, +SCI_SETZOOM = 2373, +
    +  SCI_GETZOOM = 2374, +SCI_CREATEDOCUMENT = 2375, +SCI_ADDREFDOCUMENT = 2376, +
    +  SCI_RELEASEDOCUMENT = 2377, +SCI_GETMODEVENTMASK = 2378, +SCI_SETFOCUS = 2380, +
    +  SCI_GETFOCUS = 2381, +SCI_SETSTATUS = 2382, +SCI_GETSTATUS = 2383, +
    +  SCI_SETMOUSEDOWNCAPTURES = 2384, +SCI_GETMOUSEDOWNCAPTURES = 2385, +SCI_SETCURSOR = 2386, +
    +  SCI_GETCURSOR = 2387, +SCI_SETCONTROLCHARSYMBOL = 2388, +SCI_GETCONTROLCHARSYMBOL = 2389, +
    +  SCI_WORDPARTLEFT = 2390, +SCI_WORDPARTLEFTEXTEND = 2391, +SCI_WORDPARTRIGHT = 2392, +
    +  SCI_WORDPARTRIGHTEXTEND = 2393, +SCI_SETVISIBLEPOLICY = 2394, +SCI_DELLINELEFT = 2395, +
    +  SCI_DELLINERIGHT = 2396, +SCI_SETXOFFSET = 2397, +SCI_GETXOFFSET = 2398, +
    +  SCI_CHOOSECARETX = 2399, +SCI_GRABFOCUS = 2400, +SCI_SETXCARETPOLICY = 2402, +
    +  SCI_SETYCARETPOLICY = 2403, +SCI_LINEDUPLICATE = 2404, +SCI_REGISTERIMAGE = 2405, +
    +  SCI_SETPRINTWRAPMODE = 2406, +SCI_GETPRINTWRAPMODE = 2407, +SCI_CLEARREGISTEREDIMAGES = 2408, +
    +  SCI_STYLESETHOTSPOT = 2409, +SCI_SETHOTSPOTACTIVEFORE = 2410, +SCI_SETHOTSPOTACTIVEBACK = 2411, +
    +  SCI_SETHOTSPOTACTIVEUNDERLINE = 2412, +SCI_PARADOWN = 2413, +SCI_PARADOWNEXTEND = 2414, +
    +  SCI_PARAUP = 2415, +SCI_PARAUPEXTEND = 2416, +SCI_POSITIONBEFORE = 2417, +
    +  SCI_POSITIONAFTER = 2418, +SCI_COPYRANGE = 2419, +SCI_COPYTEXT = 2420, +
    +  SCI_SETSELECTIONMODE = 2422, +SCI_GETSELECTIONMODE = 2423, +SCI_GETLINESELSTARTPOSITION = 2424, +
    +  SCI_GETLINESELENDPOSITION = 2425, +SCI_LINEDOWNRECTEXTEND = 2426, +SCI_LINEUPRECTEXTEND = 2427, +
    +  SCI_CHARLEFTRECTEXTEND = 2428, +SCI_CHARRIGHTRECTEXTEND = 2429, +SCI_HOMERECTEXTEND = 2430, +
    +  SCI_VCHOMERECTEXTEND = 2431, +SCI_LINEENDRECTEXTEND = 2432, +SCI_PAGEUPRECTEXTEND = 2433, +
    +  SCI_PAGEDOWNRECTEXTEND = 2434, +SCI_STUTTEREDPAGEUP = 2435, +SCI_STUTTEREDPAGEUPEXTEND = 2436, +
    +  SCI_STUTTEREDPAGEDOWN = 2437, +SCI_STUTTEREDPAGEDOWNEXTEND = 2438, +SCI_WORDLEFTEND = 2439, +
    +  SCI_WORDLEFTENDEXTEND = 2440, +SCI_WORDRIGHTEND = 2441, +SCI_WORDRIGHTENDEXTEND = 2442, +
    +  SCI_SETWHITESPACECHARS = 2443, +SCI_SETCHARSDEFAULT = 2444, +SCI_AUTOCGETCURRENT = 2445, +
    +  SCI_ALLOCATE = 2446, +SCI_HOMEWRAP = 2349, +SCI_HOMEWRAPEXTEND = 2450, +
    +  SCI_LINEENDWRAP = 2451, +SCI_LINEENDWRAPEXTEND = 2452, +SCI_VCHOMEWRAP = 2453, +
    +  SCI_VCHOMEWRAPEXTEND = 2454, +SCI_LINECOPY = 2455, +SCI_FINDCOLUMN = 2456, +
    +  SCI_GETCARETSTICKY = 2457, +SCI_SETCARETSTICKY = 2458, +SCI_TOGGLECARETSTICKY = 2459, +
    +  SCI_SETWRAPVISUALFLAGS = 2460, +SCI_GETWRAPVISUALFLAGS = 2461, +SCI_SETWRAPVISUALFLAGSLOCATION = 2462, +
    +  SCI_GETWRAPVISUALFLAGSLOCATION = 2463, +SCI_SETWRAPSTARTINDENT = 2464, +SCI_GETWRAPSTARTINDENT = 2465, +
    +  SCI_MARKERADDSET = 2466, +SCI_SETPASTECONVERTENDINGS = 2467, +SCI_GETPASTECONVERTENDINGS = 2468, +
    +  SCI_SELECTIONDUPLICATE = 2469, +SCI_SETCARETLINEBACKALPHA = 2470, +SCI_GETCARETLINEBACKALPHA = 2471, +
    +  SCI_MARKERSETALPHA = 2476, +SCI_GETSELALPHA = 2477, +SCI_SETSELALPHA = 2478, +
    +  SCI_STARTRECORD = 3001, +SCI_STOPRECORD = 3002, +SCI_SETLEXER = 4001, +
    +  SCI_GETLEXER = 4002, +SCI_COLOURISE = 4003, +SCI_SETPROPERTY = 4004, +
    +  SCI_SETKEYWORDS = 4005, +SCI_SETLEXERLANGUAGE = 4006, +SCI_LOADLEXERLIBRARY = 4007, +
    +  SCI_GETPROPERTY = 4008, +SCI_GETPROPERTYEXPANDED = 4009, +SCI_GETPROPERTYINT = 4010, +
    +  SCI_GETSTYLEBITSNEEDED = 4011 +
    + } +
  • enum { SC_ALPHA_TRANSPARENT = 0, +SC_ALPHA_OPAQUE = 255, +SC_ALPHA_NOALPHA = 256 + } +
  • enum { SC_WRAPVISUALFLAG_NONE = 0x0000, +SC_WRAPVISUALFLAG_END = 0x0001, +SC_WRAPVISUALFLAG_START = 0x0002 + } +
  • enum { SC_WRAPVISUALFLAGLOC_DEFAULT = 0x0000, +SC_WRAPVISUALFLAGLOC_END_BY_TEXT = 0x0001, +SC_WRAPVISUALFLAGLOC_START_BY_TEXT = 0x0002 + } +
  • enum { SC_SEL_STREAM = 0, +SC_SEL_RECTANGLE = 1, +SC_SEL_LINES = 2 + } +
  • enum { SCWS_INVISIBLE = 0, +SCWS_VISIBLEALWAYS = 1, +SCWS_VISIBLEAFTERINDENT = 2 + } +
  • enum { SC_EOL_CRLF = 0, +SC_EOL_CR = 1, +SC_EOL_LF = 2 + } +
  • enum { SC_CP_DBCS = 1, +SC_CP_UTF8 = 65001 + } +
  • enum {
    +  SC_MARK_CIRCLE = 0, +SC_MARK_ROUNDRECT = 1, +SC_MARK_ARROW = 2, +
    +  SC_MARK_SMALLRECT = 3, +SC_MARK_SHORTARROW = 4, +SC_MARK_EMPTY = 5, +
    +  SC_MARK_ARROWDOWN = 6, +SC_MARK_MINUS = 7, +SC_MARK_PLUS = 8, +
    +  SC_MARK_VLINE = 9, +SC_MARK_LCORNER = 10, +SC_MARK_TCORNER = 11, +
    +  SC_MARK_BOXPLUS = 12, +SC_MARK_BOXPLUSCONNECTED = 13, +SC_MARK_BOXMINUS = 14, +
    +  SC_MARK_BOXMINUSCONNECTED = 15, +SC_MARK_LCORNERCURVE = 16, +SC_MARK_TCORNERCURVE = 17, +
    +  SC_MARK_CIRCLEPLUS = 18, +SC_MARK_CIRCLEPLUSCONNECTED = 19, +SC_MARK_CIRCLEMINUS = 20, +
    +  SC_MARK_CIRCLEMINUSCONNECTED = 21, +SC_MARK_BACKGROUND = 22, +SC_MARK_DOTDOTDOT = 23, +
    +  SC_MARK_ARROWS = 24, +SC_MARK_PIXMAP = 25, +SC_MARK_FULLRECT = 26, +
    +  SC_MARK_CHARACTER = 10000 +
    + } +
  • enum {
    +  SC_MARKNUM_FOLDEREND = 25, +SC_MARKNUM_FOLDEROPENMID = 26, +SC_MARKNUM_FOLDERMIDTAIL = 27, +
    +  SC_MARKNUM_FOLDERTAIL = 28, +SC_MARKNUM_FOLDERSUB = 29, +SC_MARKNUM_FOLDER = 30, +
    +  SC_MARKNUM_FOLDEROPEN = 31, +SC_MASK_FOLDERS = 0xfe000000 +
    + } +
  • enum {
    +  SC_MARGIN_SYMBOL = 0, +SC_MARGIN_NUMBER = 1, +SC_MARGIN_BACK = 2, +
    +  SC_MARGIN_FORE = 3 +
    + } +
  • enum {
    +  STYLE_DEFAULT = 32, +STYLE_LINENUMBER = 33, +STYLE_BRACELIGHT = 34, +
    +  STYLE_BRACEBAD = 35, +STYLE_CONTROLCHAR = 36, +STYLE_INDENTGUIDE = 37, +
    +  STYLE_CALLTIP = 38, +STYLE_LASTPREDEFINED = 39, +STYLE_MAX = 127 +
    + } +
  • enum {
    +  SC_CHARSET_ANSI = 0, +SC_CHARSET_DEFAULT = 1, +SC_CHARSET_BALTIC = 186, +
    +  SC_CHARSET_CHINESEBIG5 = 136, +SC_CHARSET_EASTEUROPE = 238, +SC_CHARSET_GB2312 = 134, +
    +  SC_CHARSET_GREEK = 161, +SC_CHARSET_HANGUL = 129, +SC_CHARSET_MAC = 77, +
    +  SC_CHARSET_OEM = 255, +SC_CHARSET_RUSSIAN = 204, +SC_CHARSET_SHIFTJIS = 128, +
    +  SC_CHARSET_SYMBOL = 2, +SC_CHARSET_TURKISH = 162, +SC_CHARSET_JOHAB = 130, +
    +  SC_CHARSET_HEBREW = 177, +SC_CHARSET_ARABIC = 178, +SC_CHARSET_VIETNAMESE = 163, +
    +  SC_CHARSET_THAI = 222, +SC_CHARSET_8859_15 = 1000 +
    + } +
  • enum { SC_CASE_MIXED = 0, +SC_CASE_UPPER = 1, +SC_CASE_LOWER = 2 + } +
  • enum {
    +  INDIC_MAX = 7, +INDIC_PLAIN = 0, +INDIC_SQUIGGLE = 1, +
    +  INDIC_TT = 2, +INDIC_DIAGONAL = 3, +INDIC_STRIKE = 4, +
    +  INDIC_HIDDEN = 5, +INDIC_BOX = 6, +INDIC_ROUNDBOX = 7, +
    +  INDIC0_MASK = 0x20, +INDIC1_MASK = 0x40, +INDIC2_MASK = 0x80, +
    +  INDICS_MASK = 0xe0 +
    + } +
  • enum {
    +  SC_PRINT_NORMAL = 0, +SC_PRINT_INVERTLIGHT = 1, +SC_PRINT_BLACKONWHITE = 2, +
    +  SC_PRINT_COLOURONWHITE = 3, +SC_PRINT_COLOURONWHITEDEFAULTBG = 4 +
    + } +
  • enum {
    +  SCFIND_WHOLEWORD = 2, +SCFIND_MATCHCASE = 4, +SCFIND_WORDSTART = 0x00100000, +
    +  SCFIND_REGEXP = 0x00200000, +SCFIND_POSIX = 0x00400000 +
    + } +
  • enum {
    +  SC_FOLDLEVELBASE = 0x00400, +SC_FOLDLEVELWHITEFLAG = 0x01000, +SC_FOLDLEVELHEADERFLAG = 0x02000, +
    +  SC_FOLDLEVELBOXHEADERFLAG = 0x04000, +SC_FOLDLEVELBOXFOOTERFLAG = 0x08000, +SC_FOLDLEVELCONTRACTED = 0x10000, +
    +  SC_FOLDLEVELUNINDENT = 0x20000, +SC_FOLDLEVELNUMBERMASK = 0x00fff +
    + } +
  • enum {
    +  SC_FOLDFLAG_BOX = 0x0001, +SC_FOLDFLAG_LINEBEFORE_EXPANDED = 0x0002, +SC_FOLDFLAG_LINEBEFORE_CONTRACTED = 0x0004, +
    +  SC_FOLDFLAG_LINEAFTER_EXPANDED = 0x0008, +SC_FOLDFLAG_LINEAFTER_CONTRACTED = 0x0010, +SC_FOLDFLAG_LEVELNUMBERS = 0x0040 +
    + } +
  • enum { SC_TIME_FOREVER = 10000000 + } +
  • enum { SC_WRAP_NONE = 0, +SC_WRAP_WORD = 1, +SC_WRAP_CHAR = 2 + } +
  • enum {
    +  SC_CACHE_NONE = 0, +SC_CACHE_CARET = 1, +SC_CACHE_PAGE = 2, +
    +  SC_CACHE_DOCUMENT = 3 +
    + } +
  • enum { EDGE_NONE = 0, +EDGE_LINE = 1, +EDGE_BACKGROUND = 2 + } +
  • enum { SC_CURSORNORMAL = -1, +SC_CURSORWAIT = 4 + } +
  • enum { VISIBLE_SLOP = 0x01, +VISIBLE_STRICT = 0x04 + } +
  • enum {
    +  CARET_SLOP = 0x01, +CARET_STRICT = 0x04, +CARET_JUMPS = 0x10, +
    +  CARET_EVEN = 0x08 +
    + } +
  • enum {
    +  SC_MOD_INSERTTEXT = 0x1, +SC_MOD_DELETETEXT = 0x2, +SC_MOD_CHANGESTYLE = 0x4, +
    +  SC_MOD_CHANGEFOLD = 0x8, +SC_PERFORMED_USER = 0x10, +SC_PERFORMED_UNDO = 0x20, +
    +  SC_PERFORMED_REDO = 0x40, +SC_MULTISTEPUNDOREDO = 0x80, +SC_LASTSTEPINUNDOREDO = 0x100, +
    +  SC_MOD_CHANGEMARKER = 0x200, +SC_MOD_BEFOREINSERT = 0x400, +SC_MOD_BEFOREDELETE = 0x800, +
    +  SC_MULTILINEUNDOREDO = 0x1000, +SC_MODEVENTMASKALL = 0x1fff +
    + } +
  • enum {
    +  SCK_DOWN = 300, +SCK_UP = 301, +SCK_LEFT = 302, +
    +  SCK_RIGHT = 303, +SCK_HOME = 304, +SCK_END = 305, +
    +  SCK_PRIOR = 306, +SCK_NEXT = 307, +SCK_DELETE = 308, +
    +  SCK_INSERT = 309, +SCK_ESCAPE = 7, +SCK_BACK = 8, +
    +  SCK_TAB = 9, +SCK_RETURN = 13, +SCK_ADD = 310, +
    +  SCK_SUBTRACT = 311, +SCK_DIVIDE = 312 +
    + } +
  • enum {
    +  SCMOD_NORM = 0, +SCMOD_SHIFT = 1, +SCMOD_CTRL = 2, +
    +  SCMOD_ALT = 4 +
    + } +
  • enum {
    +  SCLEX_CONTAINER = 0, +SCLEX_NULL = 1, +SCLEX_PYTHON = 2, +
    +  SCLEX_CPP = 3, +SCLEX_HTML = 4, +SCLEX_XML = 5, +
    +  SCLEX_PERL = 6, +SCLEX_SQL = 7, +SCLEX_VB = 8, +
    +  SCLEX_PROPERTIES = 9, +SCLEX_ERRORLIST = 10, +SCLEX_MAKEFILE = 11, +
    +  SCLEX_BATCH = 12, +SCLEX_LATEX = 14, +SCLEX_LUA = 15, +
    +  SCLEX_DIFF = 16, +SCLEX_CONF = 17, +SCLEX_PASCAL = 18, +
    +  SCLEX_AVE = 19, +SCLEX_ADA = 20, +SCLEX_LISP = 21, +
    +  SCLEX_RUBY = 22, +SCLEX_EIFFEL = 23, +SCLEX_EIFFELKW = 24, +
    +  SCLEX_TCL = 25, +SCLEX_NNCRONTAB = 26, +SCLEX_BULLANT = 27, +
    +  SCLEX_VBSCRIPT = 28, +SCLEX_ASP = SCLEX_HTML, +SCLEX_PHP = SCLEX_HTML, +
    +  SCLEX_BAAN = 31, +SCLEX_MATLAB = 32, +SCLEX_SCRIPTOL = 33, +
    +  SCLEX_ASM = 34, +SCLEX_CPPNOCASE = 35, +SCLEX_FORTRAN = 36, +
    +  SCLEX_F77 = 37, +SCLEX_CSS = 38, +SCLEX_POV = 39, +
    +  SCLEX_LOUT = 40, +SCLEX_ESCRIPT = 41, +SCLEX_PS = 42, +
    +  SCLEX_NSIS = 43, +SCLEX_MMIXAL = 44, +SCLEX_CLW = 45, +
    +  SCLEX_CLWNOCASE = 46, +SCLEX_LOT = 47, +SCLEX_YAML = 48, +
    +  SCLEX_TEX = 49, +SCLEX_METAPOST = 50, +SCLEX_POWERBASIC = 51, +
    +  SCLEX_FORTH = 52, +SCLEX_ERLANG = 53, +SCLEX_OCTAVE = 54, +
    +  SCLEX_MSSQL = 55, +SCLEX_VERILOG = 56, +SCLEX_KIX = 57, +
    +  SCLEX_GUI4CLI = 58, +SCLEX_SPECMAN = 59, +SCLEX_AU3 = 60, +
    +  SCLEX_APDL = 61, +SCLEX_BASH = 62, +SCLEX_ASN1 = 63, +
    +  SCLEX_VHDL = 64, +SCLEX_CAML = 65, +SCLEX_BLITZBASIC = 66, +
    +  SCLEX_PUREBASIC = 67, +SCLEX_HASKELL = 68, +SCLEX_PHPSCRIPT = 69, +
    +  SCLEX_TADS3 = 70, +SCLEX_REBOL = 71, +SCLEX_SMALLTALK = 72, +
    +  SCLEX_FLAGSHIP = 73, +SCLEX_CSOUND = 74, +SCLEX_FREEBASIC = 75, +
    +  SCLEX_INNOSETUP = 76, +SCLEX_OPAL = 77, +SCLEX_SPICE = 78 +
    + } +
+

Signals

+ +

Public Member Functions

+
    +
  • QextScintillaBase (QWidget *parent=0, const char *name=0, WFlags f=0) +
  • virtual ~QextScintillaBase () +
  • long SendScintilla (unsigned int msg, unsigned long wParam=0, long lParam=0) +
  • +long SendScintilla (unsigned int msg, unsigned long wParam, const char *lParam) +
  • +long SendScintilla (unsigned int msg, const char *lParam) +
  • +long SendScintilla (unsigned int msg, const char *wParam, const char *lParam) +
  • +long SendScintilla (unsigned int msg, long wParam) +
  • +long SendScintilla (unsigned int msg, int wParam) +
  • +long SendScintilla (unsigned int msg, long cpMin, long cpMax, char *lpstrText) +
  • +long SendScintilla (unsigned int msg, unsigned long wParam, const QColor &col) +
  • +long SendScintilla (unsigned int msg, const QColor &col) +
  • +long SendScintilla (unsigned int msg, unsigned long wParam, QPainter *hdc, const QRect &rc, long cpMin, long cpMax) +
  • +long SendScintilla (unsigned int msg, unsigned long wParam, const QPixmap *lParam) +
  • virtual QSize sizeHint () const +
  • QWidget * viewport () const +
+

Static Public Member Functions

+ +

Protected Member Functions

+ +

Detailed Description

+The QextScintillaBase class implements the Scintilla editor widget and its low-level API. +

+Scintilla (http://www.scintilla.org) is a powerful C++ editor class that supports many features including syntax styling, error indicators, code completion and call tips. It is particularly useful as a programmer's editor.

+QextScintillaBase is a port to Qt of Scintilla. It implements the standard Scintilla API which consists of a number of messages each taking up to two arguments.

+See QextScintilla for the implementation of a higher level API that is more consistent with the rest of the Qt toolkit. +

+


Member Enumeration Documentation

+ +
+
+ + + + +
anonymous enum
+
+
+ +

+The low-level Scintilla API is implemented as a set of messages each of which takes up to two parameters (wParam and lParam) and optionally return a value. This enum defines all the possible messages.

+

See also:
SendScintilla()
+
Enumerator:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SCI_ADDTEXT  +This message appends some text to the end of the document. wParam is the length of the text. lParam is the text to be appended.
SCI_GETCURRENTPOS  +This message returns the current position.

+

See also:
SCI_SETCURRENTPOS
+
SCI_GETANCHOR  +This message returns the anchor.

+

See also:
SCI_SETANCHOR
+
SCI_SETSAVEPOINT  +This message marks the current state of the text as the the save point. This is usually done when the text is saved or loaded.

+

See also:
SCN_SAVEPOINTREACHED(), SCN_SAVEPOINTLEFT()
+
SCI_MARKERLINEFROMHANDLE  +This message returns the line that contains a particular instance of a marker. wParam is the handle of the marker.

+

See also:
SCI_MARKERADD
+
SCI_MARKERDELETEHANDLE  +This message removes a particular instance of a marker. wParam is the handle of the marker.

+

See also:
SCI_MARKERADD
+
SCI_GOTOPOS  +This message clears the current selection and sets the current position. wParam is the new current position.

+

See also:
SCI_SETCURRENTPOS
+
SCI_SETANCHOR  +This message sets the anchor. wParam is the new anchor.

+

See also:
SCI_GETANCHOR
+
SCI_GETENDSTYLED  +This message returns the character position of the start of the text that needs to be syntax styled.

+

See also:
SCN_STYLENEEDED()
+
SCI_MARKERDEFINE  +This message sets the symbol used to draw one of 32 markers. Some markers have pre-defined uses, see the SC_MARKNUM_* values. wParam is the number of the marker. lParam is the marker symbol and is one of the SC_MARK_* values.

+

See also:
SCI_MARKERADD, SCI_MARKERDEFINEPIXMAP
+
SCI_MARKERSETFORE  +This message sets the foreground colour used to draw a marker. A colour is represented as a 24 bit value. The 8 least significant bits correspond to red, the middle 8 bits correspond to green, and the 8 most significant bits correspond to blue. The default value is 0x000000. wParam is the number of the marker. lParam is the colour.

+

See also:
SCI_MARKERSETBACK
+
SCI_MARKERSETBACK  +This message sets the background colour used to draw a marker. A colour is represented as a 24 bit value. The 8 least significant bits correspond to red, the middle 8 bits correspond to green, and the 8 most significant bits correspond to blue. The default value is 0xffffff. wParam is the number of the marker. lParam is the colour.

+

See also:
SCI_MARKERSETFORE
+
SCI_MARKERADD  +This message adds a marker to a line. A handle for the marker is returned which can be used to track the marker's position. wParam is the line number. lParam is the number of the marker.

+

See also:
SCI_MARKERDELETE, SCI_MARKERDELETEALL, SCI_MARKERDELETEHANDLE
+
SCI_MARKERDELETE  +This message deletes a marker from a line. wParam is the line number. lParam is the number of the marker.

+

See also:
SCI_MARKERADD, SCI_MARKERDELETEALL
+
SCI_MARKERDELETEALL  +This message deletes all occurences of a marker. wParam is the number of the marker. If wParam is -1 then all markers are removed.

+

See also:
SCI_MARKERADD, SCI_MARKERDELETE
+
SCI_MARKERGET  +This message returns the 32 bit mask of markers at a line. wParam is the line number.
SCI_MARKERNEXT  +This message looks for the next line to contain at least one marker contained in a 32 bit mask of markers and returns the line number. wParam is the line number to start the search from. lParam is the mask of markers to search for.

+

See also:
SCI_MARKERPREVIOUS
+
SCI_MARKERPREVIOUS  +This message looks for the previous line to contain at least one marker contained in a 32 bit mask of markers and returns the line number. wParam is the line number to start the search from. lParam is the mask of markers to search for.

+

See also:
SCI_MARKERNEXT
+
SCI_MARKERDEFINEPIXMAP  +This message sets the symbol used to draw one of the 32 markers to a pixmap. Pixmaps use the SC_MARK_PIXMAP marker symbol. wParam is the number of the marker. lParam is a pointer to a QPixmap instance. Note that in other ports of Scintilla this is a pointer to either raw or textual XPM image data.

+

See also:
SCI_MARKERDEFINE
+
SCI_SETMARGINTYPEN  +This message sets what can be displayed in a margin. wParam is the number of the margin: 0, 1 or 2. lParam is the logical or of the SC_MARGIN_* values.

+

See also:
SCI_GETMARGINTYPEN
+
SCI_GETMARGINTYPEN  +This message returns what can be displayed in a margin. wParam is the number of the margin: 0, 1 or 2.

+

See also:
SCI_SETMARGINTYPEN
+
SCI_SETMARGINWIDTHN  +This message sets the width of a margin in pixels. wParam is the number of the margin: 0, 1 or 2. lParam is the new margin width.

+

See also:
SCI_GETMARGINWIDTHN
+
SCI_GETMARGINWIDTHN  +This message returns the width of a margin in pixels. wParam is the number of the margin: 0, 1 or 2.

+

See also:
SCI_SETMARGINWIDTHN
+
SCI_SETMARGINMASKN  +This message sets the mask of a margin. The mask is a 32 value with one bit for each possible marker. If a bit is set then the corresponding marker is displayed. By default, all markers are displayed. wParam is the number of the margin: 0, 1 or 2. lParam is the new margin mask.

+

See also:
SCI_GETMARGINMASKN, SCI_MARKERDEFINE
+
SCI_GETMARGINMASKN  +This message returns the mask of a margin. wParam is the number of the margin: 0, 1 or 2.

+

See also:
SCI_SETMARGINMASKN
+
SCI_SETMARGINSENSITIVEN  +This message sets the sensitivity of a margin to mouse clicks. wParam is the number of the margin: 0, 1 or 2. lParam is non-zero to make the margin sensitive to mouse clicks. When the mouse is clicked the SCN_MARGINCLICK() signal is emitted.

+

See also:
SCI_GETMARGINSENSITIVEN, SCN_MARGINCLICK()
+
SCI_GETMARGINSENSITIVEN  +This message returns the sensitivity of a margin to mouse clicks. wParam is the number of the margin: 0, 1 or 2.

+

See also:
SCI_SETMARGINSENSITIVEN, SCN_MARGINCLICK()
+
SCI_GETREADONLY  +This message returns a non-zero value if the document is read-only.

+

See also:
SCI_SETREADONLY
+
SCI_SETCURRENTPOS  +This message sets the current position. wParam is the new current position.

+

See also:
SCI_GETCURRENTPOS
+
SCI_GETMODIFY  +This message returns a non-zero value if the document has been modified.
SCI_SETREADONLY  +This message sets the read-only state of the document. wParam is the new read-only state of the document.

+

See also:
SCI_GETREADONLY
+
SCI_EMPTYUNDOBUFFER  +This message empties the undo buffer.
SCI_SETTEXT  +This message sets the text of the document. wParam is unused. lParam is the new text of the document.

+

See also:
SCI_GETTEXT
+
SCI_GETTEXT  +This message gets the text of the document. wParam is size of the buffer that the text is copied to. lParam is the address of the buffer that the text is copied to.

+

See also:
SCI_SETTEXT
+
SCI_GETTEXTLENGTH  +This message returns the length of the document.
SCI_TEXTWIDTH  +This message returns the width of some text when rendered in a particular style. wParam is the style number and is one of the STYLE_* values or one of the styles defined by a lexer. lParam is a pointer to the text.
SCI_REGISTERIMAGE  +This message takes a copy of an image and registers it so that it can be refered to by a unique integer identifier. wParam is the image's identifier. lParam is a pointer to a QPixmap instance. Note that in other ports of Scintilla this is a pointer to either raw or textual XPM image data.

+

See also:
SCI_CLEARREGISTEREDIMAGES
+
SCI_CLEARREGISTEREDIMAGES  +This message de-registers all currently registered images.

+

See also:
SCI_REGISTERIMAGE
+
SCI_SETLEXER  +This message sets the number of the lexer to use for syntax styling. wParam is the number of the lexer and is one of the SCLEX_* values.
SCI_GETLEXER  +This message returns the number of the lexer being used for syntax styling.
SCI_SETLEXERLANGUAGE  +This message sets the name of the lexer to use for syntax styling. wParam is unused. lParam is the name of the lexer.
+
+ +
+

+ +

+
+ + + + +
anonymous enum
+
+
+ +

+This enum defines the different selection modes.

+

See also:
SCI_GETSELECTIONMODE, SCI_SETSELECTIONMODE
+ +
+

+ +

+
+ + + + +
anonymous enum
+
+
+ +

+This enum defines the different marker symbols.

+

See also:
SCI_MARKERDEFINE
+
Enumerator:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SC_MARK_CIRCLE  +A circle.
SC_MARK_ROUNDRECT  +A rectangle.
SC_MARK_ARROW  +A triangle pointing to the right.
SC_MARK_SMALLRECT  +A smaller rectangle.
SC_MARK_SHORTARROW  +An arrow pointing to the right.
SC_MARK_EMPTY  +An invisible marker that allows code to track the movement of lines.
SC_MARK_ARROWDOWN  +A triangle pointing down.
SC_MARK_MINUS  +A drawn minus sign.
SC_MARK_PLUS  +A drawn plus sign.
SC_MARK_VLINE  +A vertical line drawn in the background colour.
SC_MARK_LCORNER  +A bottom left corner drawn in the background colour.
SC_MARK_TCORNER  +A vertical line with a centre right horizontal line drawn in the background colour.
SC_MARK_BOXPLUS  +A drawn plus sign in a box.
SC_MARK_BOXPLUSCONNECTED  +A drawn plus sign in a connected box.
SC_MARK_BOXMINUS  +A drawn minus sign in a box.
SC_MARK_BOXMINUSCONNECTED  +A drawn minus sign in a connected box.
SC_MARK_LCORNERCURVE  +A rounded bottom left corner drawn in the background colour.
SC_MARK_TCORNERCURVE  +A vertical line with a centre right curved line drawn in the background colour.
SC_MARK_CIRCLEPLUS  +A drawn plus sign in a circle.
SC_MARK_CIRCLEPLUSCONNECTED  +A drawn plus sign in a connected box.
SC_MARK_CIRCLEMINUS  +A drawn minus sign in a circle.
SC_MARK_CIRCLEMINUSCONNECTED  +A drawn minus sign in a connected circle.
SC_MARK_BACKGROUND  +No symbol is drawn but the line of text is drawn with the same background colour.
SC_MARK_DOTDOTDOT  +Three drawn dots.
SC_MARK_ARROWS  +Three drawn arrows pointing right.
SC_MARK_PIXMAP  +An XPM format pixmap.
SC_MARK_FULLRECT  +A full rectangle.
SC_MARK_CHARACTER  +Characters can be used as symbols by adding this to the ASCII value of the character.
+
+ +
+

+ +

+
+ + + + +
anonymous enum
+
+
+ +

+This enum defines what can be displayed in a margin.

+

See also:
SCI_GETMARGINTYPEN, SCI_SETMARGINTYPEN
+
Enumerator:
+ + + + + +
SC_MARGIN_SYMBOL  +The margin can display symbols. Note that all margins can display symbols.
SC_MARGIN_NUMBER  +The margin will display line numbers.
SC_MARGIN_BACK  +The margin's background color will be set to the default background color.
SC_MARGIN_FORE  +The margin's background color will be set to the default foreground color.
+
+ +
+

+ +

+
+ + + + +
anonymous enum
+
+
+ +

+This enum defines the different modifier keys. +

+

Enumerator:
+ + + + + +
SCMOD_NORM  +No modifier key.
SCMOD_SHIFT  +Shift key.
SCMOD_CTRL  +Control key.
SCMOD_ALT  +Alt key.
+
+ +
+

+ +

+
+ + + + +
anonymous enum
+
+
+ +

+This enum defines the different language lexers.

+

See also:
SCI_GETLEXER, SCI_SETLEXER
+
Enumerator:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SCLEX_CONTAINER  +No lexer is selected and the SCN_STYLENEEDED signal is emitted so that the application can style the text as needed. This is the default.
SCLEX_NULL  +Select the null lexer that does no syntax styling.
SCLEX_PYTHON  +Select the Python lexer.
SCLEX_CPP  +Select the C++ lexer.
SCLEX_HTML  +Select the HTML lexer.
SCLEX_XML  +Select the XML lexer.
SCLEX_PERL  +Select the Perl lexer.
SCLEX_SQL  +Select the SQL lexer.
SCLEX_VB  +Select the Visual Basic lexer.
SCLEX_PROPERTIES  +Select the lexer for properties style files.
SCLEX_ERRORLIST  +Select the lexer for error list style files.
SCLEX_MAKEFILE  +Select the Makefile lexer.
SCLEX_BATCH  +Select the Windows batch file lexer.
SCLEX_LATEX  +Select the LaTex lexer.
SCLEX_LUA  +Select the Lua lexer.
SCLEX_DIFF  +Select the lexer for diff output.
SCLEX_CONF  +Select the lexer for Apache configuration files.
SCLEX_PASCAL  +Select the Pascal lexer.
SCLEX_AVE  +Select the Avenue lexer.
SCLEX_ADA  +Select the Ada lexer.
SCLEX_LISP  +Select the Lisp lexer.
SCLEX_RUBY  +Select the Ruby lexer.
SCLEX_EIFFEL  +Select the Eiffel lexer.
SCLEX_EIFFELKW  +Select the Eiffel lexer folding at keywords.
SCLEX_TCL  +Select the Tcl lexer.
SCLEX_NNCRONTAB  +Select the lexer for nnCron files.
SCLEX_BULLANT  +Select the Bullant lexer.
SCLEX_VBSCRIPT  +Select the VBScript lexer.
SCLEX_ASP  +Select the ASP lexer.
SCLEX_PHP  +Select the PHP lexer.
SCLEX_BAAN  +Select the Baan lexer.
SCLEX_MATLAB  +Select the Matlab lexer.
SCLEX_SCRIPTOL  +Select the Scriptol lexer.
SCLEX_ASM  +Select the assembler lexer.
SCLEX_CPPNOCASE  +Select the C++ lexer with case insensitive keywords.
SCLEX_FORTRAN  +Select the FORTRAN lexer.
SCLEX_F77  +Select the FORTRAN77 lexer.
SCLEX_CSS  +Select the CSS lexer.
SCLEX_POV  +Select the POV lexer.
SCLEX_LOUT  +Select the Basser Lout typesetting language lexer.
SCLEX_ESCRIPT  +Select the EScript lexer.
SCLEX_PS  +Select the PostScript lexer.
SCLEX_NSIS  +Select the NSIS lexer.
SCLEX_MMIXAL  +Select the MMIX assembly language lexer.
SCLEX_CLW  +Select the Clarion lexer.
SCLEX_CLWNOCASE  +Select the Clarion lexer with case insensitive keywords.
SCLEX_LOT  +Select the MPT text log file lexer.
SCLEX_YAML  +Select the YAML lexer.
SCLEX_TEX  +Select the TeX lexer.
SCLEX_METAPOST  +Select the Metapost lexer.
SCLEX_POWERBASIC  +Select the PowerBASIC lexer.
SCLEX_FORTH  +Select the Forth lexer.
SCLEX_ERLANG  +Select the Erlang lexer.
SCLEX_OCTAVE  +Select the Octave lexer.
SCLEX_MSSQL  +Select the MS SQL lexer.
SCLEX_VERILOG  +Select the Verilog lexer.
SCLEX_KIX  +Select the KIX-Scripts lexer.
SCLEX_GUI4CLI  +Select the Gui4Cli lexer.
SCLEX_SPECMAN  +Select the Specman E lexer.
SCLEX_AU3  +Select the AutoIt3 lexer.
SCLEX_APDL  +Select the APDL lexer.
SCLEX_BASH  +Select the Bash lexer.
SCLEX_ASN1  +Select the ASN.1 lexer.
SCLEX_VHDL  +Select the VHDL lexer.
SCLEX_CAML  +Select the Caml lexer.
SCLEX_BLITZBASIC  +Select the BlitzBasic lexer.
SCLEX_PUREBASIC  +Select the PureBasic lexer.
SCLEX_HASKELL  +Select the Haskell lexer.
SCLEX_PHPSCRIPT  +Select the PHPScript lexer.
SCLEX_TADS3  +Select the TADS3 lexer.
SCLEX_REBOL  +Select the REBOL lexer.
SCLEX_SMALLTALK  +Select the Smalltalk lexer.
SCLEX_FLAGSHIP  +Select the FlagShip lexer.
SCLEX_CSOUND  +Select the Csound lexer.
SCLEX_FREEBASIC  +Select the FreeBasic lexer.
SCLEX_INNOSETUP  +Select the InnoSetup lexer.
SCLEX_OPAL  +Select the Opal lexer.
SCLEX_SPICE  +Select the Spice lexer.
+
+ +
+

+


Constructor & Destructor Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
QextScintillaBase::QextScintillaBase (QWidget *  parent = 0,
const char *  name = 0,
WFlags  f = 0 
)
+
+
+ +

+Construct an empty QextScintillaBase with parent parent, name name, and widget flags f. +

+

+ +

+
+ + + + + + + + +
virtual QextScintillaBase::~QextScintillaBase (  )  [virtual]
+
+
+ +

+Destroys the QextScintillaBase instance. +

+ +

+

+


Member Function Documentation

+ +
+
+ + + + + + + + +
static QextScintillaBase* QextScintillaBase::pool (  )  [static]
+
+
+ +

+Returns a pointer to a QextScintillaBase instance, or 0 if there isn't one. This can be used by the higher level API to send messages that aren't associated with a particular instance. +

+

+ +

+
+ + + + + + + + + + + + + + + + + + + + + + + + +
long QextScintillaBase::SendScintilla (unsigned int  msg,
unsigned long  wParam = 0,
long  lParam = 0 
)
+
+
+ +

+Send the Scintilla message msg with the optional parameters wParam and lParam. +

+

+ +

+
+ + + + + + + + +
virtual QSize QextScintillaBase::sizeHint (  )  const [virtual]
+
+
+ +

+Returns the recommended size of the widget. +

+ +

+

+ +

+
+ + + + + + + + +
QWidget* QextScintillaBase::viewport (  )  const
+
+
+ +

+Returns the viewport widget. This is the widget that actually contains the text. +

+

+ +

+
+ + + + + + + + + +
void QextScintillaBase::QSCN_SELCHANGED (bool  yes  )  [signal]
+
+
+ +

+This signal is emitted when text is selected or de-selected. yes is TRUE if text has been selected and FALSE if text has been deselected. +

+

+ +

+
+ + + + + + + + + + + + + + + + + + +
void QextScintillaBase::SCN_AUTOCSELECTION (const char *  selection,
int  position 
) [signal]
+
+
+ +

+This signal is emitted when the user selects an item in an auto-completion list. It is emitted before the selection is inserted. The insertion can be cancelled by sending an SCI_AUTOCANCEL message from a connected slot. position is the start position of the word being completed. selection is the text of the selection. +

+

+ +

+
+ + + + + + + + +
void QextScintillaBase::SCEN_CHANGE (  )  [signal]
+
+
+ +

+This signal is emitted when the document has changed for any reason. +

+

+ +

+
+ + + + + + + + + +
void QextScintillaBase::SCN_CALLTIPCLICK (int  direction  )  [signal]
+
+
+ +

+This signal ir emitted when the user clicks on a calltip. position is 1 if the user clicked on the up arrow, 2 if the user clicked on the down arrow, and 0 if the user clicked elsewhere. +

+

+ +

+
+ + + + + + + + + +
void QextScintillaBase::SCN_CHARADDED (int  charadded  )  [signal]
+
+
+ +

+This signal is emitted whenever the user enters an ordinary character into the text. charadded is the character. It can be used to decide to display a call tip or an auto-completion list. +

+

+ +

+
+ + + + + + + + + + + + + + + + + + +
void QextScintillaBase::SCN_HOTSPOTCLICK (int  position,
int  modifiers 
) [signal]
+
+
+ +

+This signal is emitted when the user clicks on text in a style with the hotspot attribute set. position is the position in the text where the click occured. modifiers is the logical or of the modifier keys that were pressed when the user clicked. +

+

+ +

+
+ + + + + + + + + + + + + + + + + + +
void QextScintillaBase::SCN_HOTSPOTDOUBLECLICK (int  position,
int  modifiers 
) [signal]
+
+
+ +

+This signal is emitted when the user double clicks on text in a style with the hotspot attribute set. position is the position in the text where the double click occured. modifiers is the logical or of the modifier keys that were pressed when the user double clicked. +

+

+ +

+
+ + + + + + + + + + + + + + + + + + + + + + + + +
void QextScintillaBase::SCN_MACRORECORD (unsigned  int,
unsigned  long,
long  
) [signal]
+
+
+ +

+This signal is emitted when a recordable editor command has been executed. +

+

+ +

+
+ + + + + + + + + + + + + + + + + + + + + + + + +
void QextScintillaBase::SCN_MARGINCLICK (int  position,
int  modifiers,
int  margin 
) [signal]
+
+
+ +

+This signal is emitted when the user clicks on a sensitive margin. position is the position of the start of the line against which the user clicked. modifiers is the logical or of the modifier keys that were pressed when the user clicked. margin is the number of the margin the user clicked in: 0, 1 or 2.

+

See also:
SCI_GETMARGINSENSITIVEN, SCI_SETMARGINSENSITIVEN
+ +
+

+ +

+
+ + + + + + + + +
void QextScintillaBase::SCN_MODIFYATTEMPTRO (  )  [signal]
+
+
+ +

+This signal is emitted when the user attempts to modify read-only text. +

+

+ +

+
+ + + + + + + + +
void QextScintillaBase::SCN_PAINTED (  )  [signal]
+
+
+ +

+This signal is emitted when painting has been completed. It is useful to trigger some other change but to have the paint be done first to appear more reponsive to the user. +

+

+ +

+
+ + + + + + + + +
void QextScintillaBase::SCN_SAVEPOINTLEFT (  )  [signal]
+
+
+ +

+This signal is emitted when the current state of the text no longer corresponds to the state of the text at the save point.

+

See also:
SCI_SETSAVEPOINT, SCN_SAVEPOINTREACHED()
+ +
+

+ +

+
+ + + + + + + + +
void QextScintillaBase::SCN_SAVEPOINTREACHED (  )  [signal]
+
+
+ +

+This signal is emitted when the current state of the text corresponds to the state of the text at the save point. This allows feedback to be given to the user as to whether the text has been modified since it was last saved.

+

See also:
SCI_SETSAVEPOINT, SCN_SAVEPOINTLEFT()
+ +
+

+ +

+
+ + + + + + + + + +
void QextScintillaBase::SCN_STYLENEEDED (int  position  )  [signal]
+
+
+ +

+This signal is emitted when a range of text needs to be syntax styled. The range is from the value returned by the SCI_GETENDSTYLED message and position. It is only emitted if the currently selected lexer is SCNLEX_CONTAINER.

+

See also:
SCI_COLOURISE, SCI_GETENDSTYLED
+ +
+

+ +

+
+ + + + + + + + + + + + + + + + + + +
bool QextScintillaBase::eventFilter (QObject *  o,
QEvent *  e 
) [protected]
+
+
+ +

+Re-implemented to filter certain events. +

+ +

+

+ +

+
+ + + + + + + + + +
virtual void QextScintillaBase::keyPressEvent (QKeyEvent *  ke  )  [protected, virtual]
+
+
+ +

+Re-implemented to handle the key presses for the widget. +

+ +

+

+ +

+
+ + + + + + + + + +
virtual void QextScintillaBase::focusInEvent (QFocusEvent *   )  [protected, virtual]
+
+
+ +

+Re-implemented to tell Scintilla it has the focus. +

+ +

+

+ +

+
+ + + + + + + + + +
virtual void QextScintillaBase::focusOutEvent (QFocusEvent *   )  [protected, virtual]
+
+
+ +

+Re-implemented to tell Scintilla it has lost the focus. +

+ +

+

+ +

+
+ + + + + + + + + +
virtual bool QextScintillaBase::focusNextPrevChild (bool   )  [protected, virtual]
+
+
+ +

+Re-implemented to allow tabs to be entered as text. +

+ +

+

+ +

+
+ + + + + + + + +
virtual void QextScintillaBase::startDrag (  )  [protected, virtual]
+
+
+ +

+Start a drag operation. +

+ +

+

+


Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/classQextScintillaCommand-members.html b/doc/html/classQextScintillaCommand-members.html new file mode 100644 index 0000000..700ddcd --- /dev/null +++ b/doc/html/classQextScintillaCommand-members.html @@ -0,0 +1,31 @@ + + +QScintilla: Member List + + + + + + +

QextScintillaCommand Member List

This is the complete list of members for QextScintillaCommand, including all inherited members.

+ + + + + + +
alternateKey() const QextScintillaCommand [inline]
description() const QextScintillaCommand
key() const QextScintillaCommand [inline]
setAlternateKey(int altkey)QextScintillaCommand
setKey(int key)QextScintillaCommand
validKey(int key)QextScintillaCommand [static]


Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/classQextScintillaCommand.html b/doc/html/classQextScintillaCommand.html new file mode 100644 index 0000000..dd80426 --- /dev/null +++ b/doc/html/classQextScintillaCommand.html @@ -0,0 +1,176 @@ + + +QScintilla: QextScintillaCommand Class Reference + + + + + + +

QextScintillaCommand Class Reference

The QextScintillaCommand class represents an internal editor command that may have one or two keys bound to it. +More... +

+#include <qextscintillacommand.h> +

+List of all members.

Public Member Functions

+ +

Static Public Member Functions

+ +

Detailed Description

+The QextScintillaCommand class represents an internal editor command that may have one or two keys bound to it. +

+Methods are provided to change the keys bound to the command and to remove a key binding. Each command has a user friendly description of the command for use in key mapping dialogs. +

+


Member Function Documentation

+ +
+
+ + + + + + + + + +
void QextScintillaCommand::setKey (int  key  ) 
+
+
+ +

+Binds the key key to the command. If key is 0 then the key binding is removed. If key is invalid then the key binding is unchanged. Valid keys are any visible or control character or any of Key_Down, Key_Up, Key_Left, Key_Right, Key_Home, Key_End, Key_Prior, Key_Next, Key_Delete, Key_Insert, Key_Escape, Key_Backspace, Key_Tab and Key_Return. Keys may be modified with any combination of SHIFT, CTRL and ALT.

+

See also:
key(), setAlternateKey(), validKey()
+ +
+

+ +

+
+ + + + + + + + + +
void QextScintillaCommand::setAlternateKey (int  altkey  ) 
+
+
+ +

+Binds the alternate key altkey to the command. If key is 0 then the alternate key binding is removed.

+

See also:
alternateKey(), setKey(), validKey()
+ +
+

+ +

+
+ + + + + + + + +
int QextScintillaCommand::key (  )  const [inline]
+
+
+ +

+The key that is currently bound to the command is returned.

+

See also:
setKey(), alternateKey()
+ +
+

+ +

+
+ + + + + + + + +
int QextScintillaCommand::alternateKey (  )  const [inline]
+
+
+ +

+The alternate key that is currently bound to the command is returned.

+

See also:
setAlternateKey(), key()
+ +
+

+ +

+
+ + + + + + + + + +
static bool QextScintillaCommand::validKey (int  key  )  [static]
+
+
+ +

+If the key key is valid then TRUE is returned. +

+ +

+

+ +

+
+ + + + + + + + +
QString QextScintillaCommand::description (  )  const
+
+
+ +

+The user friendly description of the command is returned. +

+ +

+

+


Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/classQextScintillaCommandSet-members.html b/doc/html/classQextScintillaCommandSet-members.html new file mode 100644 index 0000000..fa8f277 --- /dev/null +++ b/doc/html/classQextScintillaCommandSet-members.html @@ -0,0 +1,30 @@ + + +QScintilla: Member List + + + + + + +

QextScintillaCommandSet Member List

This is the complete list of members for QextScintillaCommandSet, including all inherited members.

+ + + + + +
clearAlternateKeys()QextScintillaCommandSet
clearKeys()QextScintillaCommandSet
commands()QextScintillaCommandSet [inline]
readSettings(QSettings &qs, const char *prefix="/Scintilla")QextScintillaCommandSet
writeSettings(QSettings &qs, const char *prefix="/Scintilla")QextScintillaCommandSet


Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/classQextScintillaCommandSet.html b/doc/html/classQextScintillaCommandSet.html new file mode 100644 index 0000000..fc9fff4 --- /dev/null +++ b/doc/html/classQextScintillaCommandSet.html @@ -0,0 +1,168 @@ + + +QScintilla: QextScintillaCommandSet Class Reference + + + + + + +

QextScintillaCommandSet Class Reference

The QextScintillaCommandSet class represents the set of all internal editor commands that may have keys bound. +More... +

+#include <qextscintillacommandset.h> +

+List of all members.

Public Member Functions

+ +

Detailed Description

+The QextScintillaCommandSet class represents the set of all internal editor commands that may have keys bound. +

+Methods are provided to access the individual commands and to read and write the current bindings from and to settings files. +

+


Member Function Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + +
bool QextScintillaCommandSet::readSettings (QSettings &  qs,
const char *  prefix = "/Scintilla" 
)
+
+
+ +

+The key bindings for each command in the set are read from the settings qs. prefix is prepended to the key of each entry. TRUE is returned if there was no error.

+

See also:
writeSettings()
+ +
+

+ +

+
+ + + + + + + + + + + + + + + + + + +
bool QextScintillaCommandSet::writeSettings (QSettings &  qs,
const char *  prefix = "/Scintilla" 
)
+
+
+ +

+The key bindings for each command in the set are written to the settings qs. prefix is prepended to the key of each entry. TRUE is returned if there was no error.

+

See also:
readSettings()
+ +
+

+ +

+
+ + + + + + + + +
QPtrList<QextScintillaCommand>& QextScintillaCommandSet::commands (  )  [inline]
+
+
+ +

+The commands in the set are returned as a list. +

+ +

+

+ +

+
+ + + + + + + + +
void QextScintillaCommandSet::clearKeys (  ) 
+
+
+ +

+The primary keys bindings for all commands are removed. +

+ +

+

+ +

+
+ + + + + + + + +
void QextScintillaCommandSet::clearAlternateKeys (  ) 
+
+
+ +

+The alternate keys bindings for all commands are removed. +

+ +

+

+


Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/classQextScintillaDocument-members.html b/doc/html/classQextScintillaDocument-members.html new file mode 100644 index 0000000..b23e094 --- /dev/null +++ b/doc/html/classQextScintillaDocument-members.html @@ -0,0 +1,29 @@ + + +QScintilla: Member List + + + + + + +

QextScintillaDocument Member List

This is the complete list of members for QextScintillaDocument, including all inherited members.

+ + + + +
operator=(const QextScintillaDocument &) (defined in QextScintillaDocument)QextScintillaDocument
QextScintillaDocument()QextScintillaDocument
QextScintillaDocument(const QextScintillaDocument &) (defined in QextScintillaDocument)QextScintillaDocument
~QextScintillaDocument() (defined in QextScintillaDocument)QextScintillaDocument [virtual]


Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/classQextScintillaDocument.html b/doc/html/classQextScintillaDocument.html new file mode 100644 index 0000000..5773d1f --- /dev/null +++ b/doc/html/classQextScintillaDocument.html @@ -0,0 +1,64 @@ + + +QScintilla: QextScintillaDocument Class Reference + + + + + + +

QextScintillaDocument Class Reference

The QextScintillaDocument class represents a document to be editted. +More... +

+#include <qextscintilladocument.h> +

+List of all members.

Public Member Functions

+ +

Detailed Description

+The QextScintillaDocument class represents a document to be editted. +

+It is an opaque class that can be attached to multiple instances of QextScintilla to create different simultaneous views of the same document. QextScintillaDocument uses implicit sharing so that copying class instances is a cheap operation. +

+


Constructor & Destructor Documentation

+ +
+
+ + + + + + + + +
QextScintillaDocument::QextScintillaDocument (  ) 
+
+
+ +

+Create a new unattached document. +

+ +

+

+


Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/classQextScintillaLexer-members.html b/doc/html/classQextScintillaLexer-members.html new file mode 100644 index 0000000..29a27b1 --- /dev/null +++ b/doc/html/classQextScintillaLexer-members.html @@ -0,0 +1,66 @@ + + +QScintilla: Member List + + + + + + +

QextScintillaLexer Member List

This is the complete list of members for QextScintillaLexer, including all inherited members.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
autoCompletionFillups() const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
autoCompletionStartCharacters() const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
autoIndentStyle()QextScintillaLexer
blockEnd(int *style=0) const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
blockLookback() const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
blockStart(int *style=0) const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
blockStartKeyword(int *style=0) const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
braceStyle() const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
color(int style) const QextScintillaLexer [virtual]
colorChanged(const QColor &c, int style)QextScintillaLexer [signal]
defaultColor() const QextScintillaLexer [virtual]
defaultFont() const QextScintillaLexer [virtual]
defaultPaper() const QextScintillaLexer [virtual]
defaultStyle() const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
description(int style) const =0QextScintillaLexer [pure virtual]
eolFill(int style) const QextScintillaLexer [virtual]
eolFillChanged(bool eoffilled, int style)QextScintillaLexer [signal]
font(int style) const QextScintillaLexer [virtual]
fontChanged(const QFont &f, int style)QextScintillaLexer [signal]
keywords(int set) const QextScintillaLexer [virtual]
language() const =0QextScintillaLexer [pure virtual]
lexer() const =0QextScintillaLexer [pure virtual]
paper(int style) const QextScintillaLexer [virtual]
paperChanged(const QColor &c, int style)QextScintillaLexer [signal]
propertyChanged(const char *prop, const char *val)QextScintillaLexer [signal]
QextScintillaLexer(QObject *parent=0, const char *name=0)QextScintillaLexer
readProperties(QSettings &qs, const QString &prefix)QextScintillaLexer [protected, virtual]
readSettings(QSettings &qs, const char *prefix="/Scintilla")QextScintillaLexer
refreshProperties()QextScintillaLexer [virtual]
setAutoIndentStyle(int autoindentstyle)QextScintillaLexer [virtual, slot]
setColor(const QColor &c, int style=-1)QextScintillaLexer [virtual, slot]
setDefaultColor(const QColor &c)QextScintillaLexer [virtual, slot]
setDefaultFont(const QFont &f)QextScintillaLexer [virtual, slot]
setDefaultPaper(const QColor &c)QextScintillaLexer [virtual, slot]
setEolFill(bool eoffill, int style=-1)QextScintillaLexer [virtual, slot]
setFont(const QFont &f, int style=-1)QextScintillaLexer [virtual, slot]
setPaper(const QColor &c, int style=-1)QextScintillaLexer [virtual, slot]
wordCharacters() const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
writeProperties(QSettings &qs, const QString &prefix) const QextScintillaLexer [protected, virtual]
writeSettings(QSettings &qs, const char *prefix="/Scintilla") const QextScintillaLexer
~QextScintillaLexer()QextScintillaLexer [virtual]


Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/classQextScintillaLexer.html b/doc/html/classQextScintillaLexer.html new file mode 100644 index 0000000..6085267 --- /dev/null +++ b/doc/html/classQextScintillaLexer.html @@ -0,0 +1,910 @@ + + +QScintilla: QextScintillaLexer Class Reference + + + + + + +

QextScintillaLexer Class Reference

The QextScintillaLexer class is an abstract class used as a base for specific language lexers. +More... +

+#include <qextscintillalexer.h> +

+Inherited by QextScintillaLexerBash, QextScintillaLexerBatch, QextScintillaLexerCPP, QextScintillaLexerCSS, QextScintillaLexerDiff, QextScintillaLexerHTML, QextScintillaLexerLua, QextScintillaLexerMakefile, QextScintillaLexerPerl, QextScintillaLexerPOV, QextScintillaLexerProperties, QextScintillaLexerPython, QextScintillaLexerRuby, QextScintillaLexerSQL, and QextScintillaLexerTeX. +

+List of all members.

Public Slots

+ +

Signals

+ +

Public Member Functions

+
    +
  • QextScintillaLexer (QObject *parent=0, const char *name=0) +
  • virtual ~QextScintillaLexer () +
  • virtual const char * language () const =0 +
  • virtual const char * lexer () const =0 +
  • +virtual const char * autoCompletionFillups () const +
  • +virtual const char * autoCompletionStartCharacters () const +
  • int autoIndentStyle () +
  • +virtual const char * blockEnd (int *style=0) const +
  • +virtual int blockLookback () const +
  • +virtual const char * blockStart (int *style=0) const +
  • +virtual const char * blockStartKeyword (int *style=0) const +
  • +virtual int braceStyle () const +
  • +virtual const char * wordCharacters () const +
  • virtual QColor color (int style) const +
  • virtual bool eolFill (int style) const +
  • virtual QFont font (int style) const +
  • virtual const char * keywords (int set) const +
  • +virtual int defaultStyle () const +
  • virtual QString description (int style) const =0 +
  • virtual QColor paper (int style) const +
  • virtual QFont defaultFont () const +
  • virtual QColor defaultColor () const +
  • virtual QColor defaultPaper () const +
  • virtual void refreshProperties () +
  • bool readSettings (QSettings &qs, const char *prefix="/Scintilla") +
  • bool writeSettings (QSettings &qs, const char *prefix="/Scintilla") const +
+

Protected Member Functions

+
    +
  • virtual bool readProperties (QSettings &qs, const QString &prefix) +
  • virtual bool writeProperties (QSettings &qs, const QString &prefix) const +
+

Detailed Description

+The QextScintillaLexer class is an abstract class used as a base for specific language lexers. +

+A Scintilla lexer scans the text breaking it up into separate language objects, e.g. keywords, strings, operators. The lexer then uses a different style to draw each object. A style is identified by a style number and has a number of attributes, including colour and font. A specific language lexer will implement appropriate default styles which can be overriden by an application by further sub-classing the specific language lexer.

+A specific language lexer may provide one or more sets of words to be recognised as keywords. Most lexers only provide one set, but some may support languages embedded in other languages and provide several sets.

+QextScintillaLexer provides convenience methods for saving and restoring user preferences for fonts and colours. +

+


Constructor & Destructor Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + +
QextScintillaLexer::QextScintillaLexer (QObject *  parent = 0,
const char *  name = 0 
)
+
+
+ +

+Construct a QextScintillaLexer with parent parent and name name. parent is typically the QextScintilla instance. +

+

+ +

+
+ + + + + + + + +
virtual QextScintillaLexer::~QextScintillaLexer (  )  [virtual]
+
+
+ +

+Destroys the QextScintillaLexer instance. +

+ +

+

+


Member Function Documentation

+ +

+ +

+
+ + + + + + + + +
virtual const char* QextScintillaLexer::lexer (  )  const [pure virtual]
+
+ +

+ +

+
+ + + + + + + + +
int QextScintillaLexer::autoIndentStyle (  ) 
+
+
+ +

+Returns the auto-indentation style. The default is 0 if the language is block structured, or QextScintilla::AiMaintain if not.

+

See also:
setAutoIndentStyle(), QextScintilla::AiMaintain, QextScintilla::AiOpening, QextScintilla::AiClosing
+ +
+

+ +

+
+ + + + + + + + + +
virtual QColor QextScintillaLexer::color (int  style  )  const [virtual]
+
+ +

+ +

+
+ + + + + + + + + +
virtual bool QextScintillaLexer::eolFill (int  style  )  const [virtual]
+
+ +

+ +

+
+ + + + + + + + + +
virtual QFont QextScintillaLexer::font (int  style  )  const [virtual]
+
+ +

+ +

+
+ + + + + + + + + +
virtual const char* QextScintillaLexer::keywords (int  set  )  const [virtual]
+
+ +

+ +

+
+ + + + + + + + + +
virtual QString QextScintillaLexer::description (int  style  )  const [pure virtual]
+
+ +

+ +

+
+ + + + + + + + + +
virtual QColor QextScintillaLexer::paper (int  style  )  const [virtual]
+
+ +

+ +

+
+ + + + + + + + +
virtual QFont QextScintillaLexer::defaultFont (  )  const [virtual]
+
+
+ +

+Returns the default font for all styles.

+

See also:
setDefaultFont()
+ +
+

+ +

+
+ + + + + + + + +
virtual QColor QextScintillaLexer::defaultColor (  )  const [virtual]
+
+
+ +

+Returns the default text colour for all styles.

+

See also:
setDefaultColor()
+ +
+

+ +

+
+ + + + + + + + +
virtual QColor QextScintillaLexer::defaultPaper (  )  const [virtual]
+
+
+ +

+Returns the default paper colour for all styles.

+

See also:
setDefaultPaper()
+ +
+

+ +

+
+ + + + + + + + +
virtual void QextScintillaLexer::refreshProperties (  )  [virtual]
+
+ +

+ +

+
+ + + + + + + + + + + + + + + + + + +
bool QextScintillaLexer::readSettings (QSettings &  qs,
const char *  prefix = "/Scintilla" 
)
+
+
+ +

+The colour, paper, font and end-of-line for each style number, and all lexer specific properties are read from the settings qs. prefix is prepended to the key of each entry. TRUE is returned if there was no error.

+

See also:
writeSettings(), QextScintilla::setLexer()
+ +
+

+ +

+
+ + + + + + + + + + + + + + + + + + +
bool QextScintillaLexer::writeSettings (QSettings &  qs,
const char *  prefix = "/Scintilla" 
) const
+
+
+ +

+The colour, paper, font and end-of-line for each style number, and all lexer specific properties are written to the settings qs. prefix is prepended to the key of each entry. TRUE is returned if there was no error.

+

See also:
readSettings()
+ +
+

+ +

+
+ + + + + + + + + +
virtual void QextScintillaLexer::setAutoIndentStyle (int  autoindentstyle  )  [virtual, slot]
+
+
+ +

+The auto-indentation style is set to autoindentstyle.

+

See also:
autoIndentStyle(), QextScintilla::AiMaintain, QextScintilla::AiOpening, QextScintilla::AiClosing
+ +
+

+ +

+
+ + + + + + + + + + + + + + + + + + +
virtual void QextScintillaLexer::setColor (const QColor &  c,
int  style = -1 
) [virtual, slot]
+
+
+ +

+The foreground colour for style number style is set to c. If style is -1 then the colour is set for all styles. +

+

+ +

+
+ + + + + + + + + +
virtual void QextScintillaLexer::setDefaultFont (const QFont &  f  )  [virtual, slot]
+
+
+ +

+The default font for all styles is set to f.

+

See also:
defaultFont()
+ +
+

+ +

+
+ + + + + + + + + +
virtual void QextScintillaLexer::setDefaultColor (const QColor &  c  )  [virtual, slot]
+
+
+ +

+The default text colour for all styles is set to c.

+

See also:
defaultColor(), color()
+ +
+

+ +

+
+ + + + + + + + + +
virtual void QextScintillaLexer::setDefaultPaper (const QColor &  c  )  [virtual, slot]
+
+
+ +

+The default paper colour for all styles is set to c.

+

See also:
defaultPaper(), paper()
+ +
+

+ +

+
+ + + + + + + + + + + + + + + + + + +
virtual void QextScintillaLexer::setEolFill (bool  eoffill,
int  style = -1 
) [virtual, slot]
+
+
+ +

+The end-of-line fill for style number style is set to eoffill. If style is -1 then the fill is set for all styles. +

+

+ +

+
+ + + + + + + + + + + + + + + + + + +
virtual void QextScintillaLexer::setFont (const QFont &  f,
int  style = -1 
) [virtual, slot]
+
+
+ +

+The font for style number style is set to f. If style is -1 then the font is set for all styles. +

+

+ +

+
+ + + + + + + + + + + + + + + + + + +
virtual void QextScintillaLexer::setPaper (const QColor &  c,
int  style = -1 
) [virtual, slot]
+
+
+ +

+The background colour for style number style is set to c. If style is -1 then the colour is set for all styles. +

+

+ +

+
+ + + + + + + + + + + + + + + + + + +
void QextScintillaLexer::colorChanged (const QColor &  c,
int  style 
) [signal]
+
+
+ +

+This signal is emitted when the foreground colour of style number style has changed. The new colour is c. +

+

+ +

+
+ + + + + + + + + + + + + + + + + + +
void QextScintillaLexer::eolFillChanged (bool  eoffilled,
int  style 
) [signal]
+
+
+ +

+This signal is emitted when the end-of-file fill of style number style has changed. The new fill is eoffilled. +

+

+ +

+
+ + + + + + + + + + + + + + + + + + +
void QextScintillaLexer::fontChanged (const QFont &  f,
int  style 
) [signal]
+
+
+ +

+This signal is emitted when the font of style number style has changed. The new font is f. +

+

+ +

+
+ + + + + + + + + + + + + + + + + + +
void QextScintillaLexer::paperChanged (const QColor &  c,
int  style 
) [signal]
+
+
+ +

+This signal is emitted when the background colour of style number style has changed. The new colour is c. +

+

+ +

+
+ + + + + + + + + + + + + + + + + + +
void QextScintillaLexer::propertyChanged (const char *  prop,
const char *  val 
) [signal]
+
+
+ +

+This signal is emitted when the value of the lexer property prop needs to be changed. The new value is val. +

+

+ +

+
+ + + + + + + + + + + + + + + + + + +
virtual bool QextScintillaLexer::readProperties (QSettings &  qs,
const QString &  prefix 
) [protected, virtual]
+
+
+ +

+The lexer's properties are read from the settings qs. prefix (which has a trailing '/') should be used as a prefix to the key of each setting. TRUE is returned if there is no error. +

+Reimplemented in QextScintillaLexerBash, QextScintillaLexerCPP, QextScintillaLexerCSS, QextScintillaLexerHTML, QextScintillaLexerLua, QextScintillaLexerPerl, QextScintillaLexerPOV, QextScintillaLexerProperties, QextScintillaLexerPython, and QextScintillaLexerSQL. +

+

+ +

+
+ + + + + + + + + + + + + + + + + + +
virtual bool QextScintillaLexer::writeProperties (QSettings &  qs,
const QString &  prefix 
) const [protected, virtual]
+
+
+ +

+The lexer's properties are written to the settings qs. prefix (which has a trailing '/') should be used as a prefix to the key of each setting. TRUE is returned if there is no error. +

+Reimplemented in QextScintillaLexerBash, QextScintillaLexerCPP, QextScintillaLexerCSS, QextScintillaLexerHTML, QextScintillaLexerLua, QextScintillaLexerPerl, QextScintillaLexerPOV, QextScintillaLexerProperties, QextScintillaLexerPython, and QextScintillaLexerSQL. +

+

+


Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/classQextScintillaLexerBash-members.html b/doc/html/classQextScintillaLexerBash-members.html new file mode 100644 index 0000000..d3e21d1 --- /dev/null +++ b/doc/html/classQextScintillaLexerBash-members.html @@ -0,0 +1,87 @@ + + +QScintilla: Member List + + + + + + +

QextScintillaLexerBash Member List

This is the complete list of members for QextScintillaLexerBash, including all inherited members.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
autoCompletionFillups() const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
autoCompletionStartCharacters() const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
autoIndentStyle()QextScintillaLexer
Backticks enum valueQextScintillaLexerBash
blockEnd(int *style=0) const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
blockLookback() const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
blockStart(int *style=0) const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
blockStartKeyword(int *style=0) const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
braceStyle() const (defined in QextScintillaLexerBash)QextScintillaLexerBash [virtual]
color(int style) const QextScintillaLexerBash [virtual]
colorChanged(const QColor &c, int style)QextScintillaLexer [signal]
Comment enum valueQextScintillaLexerBash
Default enum valueQextScintillaLexerBash
defaultColor() const QextScintillaLexer [virtual]
defaultFont() const QextScintillaLexer [virtual]
defaultPaper() const QextScintillaLexer [virtual]
defaultStyle() const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
description(int style) const QextScintillaLexerBash [virtual]
DoubleQuotedString enum valueQextScintillaLexerBash
eolFill(int style) const QextScintillaLexerBash [virtual]
eolFillChanged(bool eoffilled, int style)QextScintillaLexer [signal]
Error enum valueQextScintillaLexerBash
foldComments() const QextScintillaLexerBash
foldCompact() const QextScintillaLexerBash
font(int style) const QextScintillaLexerBash [virtual]
fontChanged(const QFont &f, int style)QextScintillaLexer [signal]
HereDocumentDelimiter enum valueQextScintillaLexerBash
Identifier enum valueQextScintillaLexerBash
Keyword enum valueQextScintillaLexerBash
keywords(int set) const QextScintillaLexerBash [virtual]
language() const QextScintillaLexerBash [virtual]
lexer() const QextScintillaLexerBash [virtual]
Number enum valueQextScintillaLexerBash
Operator enum valueQextScintillaLexerBash
paper(int style) const QextScintillaLexerBash [virtual]
paperChanged(const QColor &c, int style)QextScintillaLexer [signal]
ParameterExpansion enum valueQextScintillaLexerBash
propertyChanged(const char *prop, const char *val)QextScintillaLexer [signal]
QextScintillaLexer(QObject *parent=0, const char *name=0)QextScintillaLexer
QextScintillaLexerBash(QObject *parent=0, const char *name=0)QextScintillaLexerBash
readProperties(QSettings &qs, const QString &prefix)QextScintillaLexerBash [protected, virtual]
readSettings(QSettings &qs, const char *prefix="/Scintilla")QextScintillaLexer
refreshProperties()QextScintillaLexerBash [virtual]
Scalar enum valueQextScintillaLexerBash
setAutoIndentStyle(int autoindentstyle)QextScintillaLexer [virtual, slot]
setColor(const QColor &c, int style=-1)QextScintillaLexer [virtual, slot]
setDefaultColor(const QColor &c)QextScintillaLexer [virtual, slot]
setDefaultFont(const QFont &f)QextScintillaLexer [virtual, slot]
setDefaultPaper(const QColor &c)QextScintillaLexer [virtual, slot]
setEolFill(bool eoffill, int style=-1)QextScintillaLexer [virtual, slot]
setFoldComments(bool fold)QextScintillaLexerBash [virtual, slot]
setFoldCompact(bool fold)QextScintillaLexerBash [virtual, slot]
setFont(const QFont &f, int style=-1)QextScintillaLexer [virtual, slot]
setPaper(const QColor &c, int style=-1)QextScintillaLexer [virtual, slot]
SingleQuotedHereDocument enum valueQextScintillaLexerBash
SingleQuotedString enum valueQextScintillaLexerBash
WhiteSpace enum valueQextScintillaLexerBash
wordCharacters() const (defined in QextScintillaLexerBash)QextScintillaLexerBash [virtual]
writeProperties(QSettings &qs, const QString &prefix) const QextScintillaLexerBash [protected, virtual]
writeSettings(QSettings &qs, const char *prefix="/Scintilla") const QextScintillaLexer
~QextScintillaLexer()QextScintillaLexer [virtual]
~QextScintillaLexerBash()QextScintillaLexerBash [virtual]


Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/classQextScintillaLexerBash.html b/doc/html/classQextScintillaLexerBash.html new file mode 100644 index 0000000..0cedfb1 --- /dev/null +++ b/doc/html/classQextScintillaLexerBash.html @@ -0,0 +1,560 @@ + + +QScintilla: QextScintillaLexerBash Class Reference + + + + + + +

QextScintillaLexerBash Class Reference

The QextScintillaLexerBash class encapsulates the Scintilla Bash lexer. +More... +

+#include <qextscintillalexerbash.h> +

+Inherits QextScintillaLexer. +

+List of all members.

Public Types

+ +

Public Slots

+ +

Public Member Functions

+ +

Protected Member Functions

+ +

Detailed Description

+The QextScintillaLexerBash class encapsulates the Scintilla Bash lexer. +

+


Member Enumeration Documentation

+ +
+
+ + + + +
anonymous enum
+
+
+ +

+This enum defines the meanings of the different styles used by the Bash lexer.

Enumerator:
+ + + + + + + + + + + + + + + + +
Default  +The default.
WhiteSpace  +
Deprecated:
White space.
+
Error  +An error.
Comment  +A comment.
Number  +A number.
Keyword  +A keyword.
DoubleQuotedString  +A double-quoted string.
SingleQuotedString  +A single-quoted string.
Operator  +An operator.
Identifier  +An identifier.
Scalar  +A scalar.
ParameterExpansion  +Parameter expansion.
Backticks  +Backticks.
HereDocumentDelimiter  +A here document delimiter.
SingleQuotedHereDocument  +A single quoted here document.
+
+ +
+

+


Constructor & Destructor Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + +
QextScintillaLexerBash::QextScintillaLexerBash (QObject *  parent = 0,
const char *  name = 0 
)
+
+
+ +

+Construct a QextScintillaLexerBash with parent parent and name name. parent is typically the QextScintilla instance. +

+

+ +

+
+ + + + + + + + +
virtual QextScintillaLexerBash::~QextScintillaLexerBash (  )  [virtual]
+
+
+ +

+Destroys the QextScintillaLexerBash instance. +

+ +

+

+


Member Function Documentation

+ +
+
+ + + + + + + + +
const char* QextScintillaLexerBash::language (  )  const [virtual]
+
+
+ +

+Returns the name of the language. +

+ +

+Implements QextScintillaLexer. +

+

+ +

+
+ + + + + + + + +
const char* QextScintillaLexerBash::lexer (  )  const [virtual]
+
+
+ +

+Returns the name of the lexer. Some lexers support a number of languages. +

+Implements QextScintillaLexer. +

+

+ +

+
+ + + + + + + + + +
QColor QextScintillaLexerBash::color (int  style  )  const [virtual]
+
+
+ +

+Returns the foreground colour of the text for style number style.

+

See also:
paper()
+ +

+Reimplemented from QextScintillaLexer. +

+

+ +

+
+ + + + + + + + + +
bool QextScintillaLexerBash::eolFill (int  style  )  const [virtual]
+
+
+ +

+Returns the end-of-line fill for style number style. +

+ +

+Reimplemented from QextScintillaLexer. +

+

+ +

+
+ + + + + + + + + +
QFont QextScintillaLexerBash::font (int  style  )  const [virtual]
+
+
+ +

+Returns the font for style number style. +

+ +

+Reimplemented from QextScintillaLexer. +

+

+ +

+
+ + + + + + + + + +
const char* QextScintillaLexerBash::keywords (int  set  )  const [virtual]
+
+
+ +

+Returns the set of keywords for the keyword set set recognised by the lexer as a space separated string. +

+Reimplemented from QextScintillaLexer. +

+

+ +

+
+ + + + + + + + + +
QString QextScintillaLexerBash::description (int  style  )  const [virtual]
+
+
+ +

+Returns the descriptive name for style number style. If the style is invalid for this language then QString::null is returned. This is intended to be used in user preference dialogs. +

+Implements QextScintillaLexer. +

+

+ +

+
+ + + + + + + + + +
QColor QextScintillaLexerBash::paper (int  style  )  const [virtual]
+
+
+ +

+Returns the background colour of the text for style number style.

+

See also:
color()
+ +

+Reimplemented from QextScintillaLexer. +

+

+ +

+
+ + + + + + + + +
void QextScintillaLexerBash::refreshProperties (  )  [virtual]
+
+
+ +

+Causes all properties to be refreshed by emitting the propertyChanged() signal as required. +

+Reimplemented from QextScintillaLexer. +

+

+ +

+
+ + + + + + + + +
bool QextScintillaLexerBash::foldComments (  )  const
+
+
+ +

+Returns TRUE if multi-line comment blocks can be folded.

+

See also:
setFoldComments()
+ +
+

+ +

+
+ + + + + + + + +
bool QextScintillaLexerBash::foldCompact (  )  const
+
+
+ +

+Returns TRUE if trailing blank lines are included in a fold block.

+

See also:
setFoldCompact()
+ +
+

+ +

+
+ + + + + + + + + +
virtual void QextScintillaLexerBash::setFoldComments (bool  fold  )  [virtual, slot]
+
+
+ +

+If fold is TRUE then multi-line comment blocks can be folded. The default is FALSE.

+

See also:
foldComments()
+ +
+

+ +

+
+ + + + + + + + + +
virtual void QextScintillaLexerBash::setFoldCompact (bool  fold  )  [virtual, slot]
+
+
+ +

+If fold is TRUE then trailing blank lines are included in a fold block. The default is TRUE.

+

See also:
foldCompact()
+ +
+

+ +

+
+ + + + + + + + + + + + + + + + + + +
bool QextScintillaLexerBash::readProperties (QSettings &  qs,
const QString &  prefix 
) [protected, virtual]
+
+
+ +

+The lexer's properties are read from the settings qs. prefix (which has a trailing '/') should be used as a prefix to the key of each setting. TRUE is returned if there is no error. +

+Reimplemented from QextScintillaLexer. +

+

+ +

+
+ + + + + + + + + + + + + + + + + + +
bool QextScintillaLexerBash::writeProperties (QSettings &  qs,
const QString &  prefix 
) const [protected, virtual]
+
+
+ +

+The lexer's properties are written to the settings qs. prefix (which has a trailing '/') should be used as a prefix to the key of each setting. TRUE is returned if there is no error. +

+Reimplemented from QextScintillaLexer. +

+

+


Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/classQextScintillaLexerBatch-members.html b/doc/html/classQextScintillaLexerBatch-members.html new file mode 100644 index 0000000..0bacee5 --- /dev/null +++ b/doc/html/classQextScintillaLexerBatch-members.html @@ -0,0 +1,76 @@ + + +QScintilla: Member List + + + + + + +

QextScintillaLexerBatch Member List

This is the complete list of members for QextScintillaLexerBatch, including all inherited members.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
autoCompletionFillups() const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
autoCompletionStartCharacters() const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
autoIndentStyle()QextScintillaLexer
blockEnd(int *style=0) const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
blockLookback() const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
blockStart(int *style=0) const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
blockStartKeyword(int *style=0) const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
braceStyle() const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
color(int style) const QextScintillaLexerBatch [virtual]
colorChanged(const QColor &c, int style)QextScintillaLexer [signal]
Comment enum valueQextScintillaLexerBatch
Default enum valueQextScintillaLexerBatch
defaultColor() const QextScintillaLexer [virtual]
defaultFont() const QextScintillaLexer [virtual]
defaultPaper() const QextScintillaLexer [virtual]
defaultStyle() const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
description(int style) const QextScintillaLexerBatch [virtual]
eolFill(int style) const QextScintillaLexerBatch [virtual]
eolFillChanged(bool eoffilled, int style)QextScintillaLexer [signal]
ExternalCommand enum valueQextScintillaLexerBatch
font(int style) const QextScintillaLexerBatch [virtual]
fontChanged(const QFont &f, int style)QextScintillaLexer [signal]
HideCommandChar enum valueQextScintillaLexerBatch
Keyword enum valueQextScintillaLexerBatch
keywords(int set) const QextScintillaLexerBatch [virtual]
Label enum valueQextScintillaLexerBatch
language() const QextScintillaLexerBatch [virtual]
lexer() const QextScintillaLexerBatch [virtual]
Operator enum valueQextScintillaLexerBatch
paper(int style) const QextScintillaLexerBatch [virtual]
paperChanged(const QColor &c, int style)QextScintillaLexer [signal]
propertyChanged(const char *prop, const char *val)QextScintillaLexer [signal]
QextScintillaLexer(QObject *parent=0, const char *name=0)QextScintillaLexer
QextScintillaLexerBatch(QObject *parent=0, const char *name=0)QextScintillaLexerBatch
readProperties(QSettings &qs, const QString &prefix)QextScintillaLexer [protected, virtual]
readSettings(QSettings &qs, const char *prefix="/Scintilla")QextScintillaLexer
refreshProperties()QextScintillaLexer [virtual]
setAutoIndentStyle(int autoindentstyle)QextScintillaLexer [virtual, slot]
setColor(const QColor &c, int style=-1)QextScintillaLexer [virtual, slot]
setDefaultColor(const QColor &c)QextScintillaLexer [virtual, slot]
setDefaultFont(const QFont &f)QextScintillaLexer [virtual, slot]
setDefaultPaper(const QColor &c)QextScintillaLexer [virtual, slot]
setEolFill(bool eoffill, int style=-1)QextScintillaLexer [virtual, slot]
setFont(const QFont &f, int style=-1)QextScintillaLexer [virtual, slot]
setPaper(const QColor &c, int style=-1)QextScintillaLexer [virtual, slot]
Variable enum valueQextScintillaLexerBatch
wordCharacters() const (defined in QextScintillaLexerBatch)QextScintillaLexerBatch [virtual]
writeProperties(QSettings &qs, const QString &prefix) const QextScintillaLexer [protected, virtual]
writeSettings(QSettings &qs, const char *prefix="/Scintilla") const QextScintillaLexer
~QextScintillaLexer()QextScintillaLexer [virtual]
~QextScintillaLexerBatch()QextScintillaLexerBatch [virtual]


Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/classQextScintillaLexerBatch.html b/doc/html/classQextScintillaLexerBatch.html new file mode 100644 index 0000000..bdf6913 --- /dev/null +++ b/doc/html/classQextScintillaLexerBatch.html @@ -0,0 +1,345 @@ + + +QScintilla: QextScintillaLexerBatch Class Reference + + + + + + +

QextScintillaLexerBatch Class Reference

The QextScintillaLexerBatch class encapsulates the Scintilla batch file lexer. +More... +

+#include <qextscintillalexerbatch.h> +

+Inherits QextScintillaLexer. +

+List of all members.

Public Types

+ +

Public Member Functions

+ +

Detailed Description

+The QextScintillaLexerBatch class encapsulates the Scintilla batch file lexer. +

+


Member Enumeration Documentation

+ +
+
+ + + + +
anonymous enum
+
+
+ +

+This enum defines the meanings of the different styles used by the batch file lexer.

Enumerator:
+ + + + + + + + + +
Default  +The default.
Comment  +A comment.
Keyword  +A keyword.
Label  +A label.
HideCommandChar  +An hide command character.
ExternalCommand  +An external command .
Variable  +A variable.
Operator  +An operator.
+
+ +
+

+


Constructor & Destructor Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + +
QextScintillaLexerBatch::QextScintillaLexerBatch (QObject *  parent = 0,
const char *  name = 0 
)
+
+
+ +

+Construct a QextScintillaLexerBatch with parent parent and name name. parent is typically the QextScintilla instance. +

+

+ +

+
+ + + + + + + + +
virtual QextScintillaLexerBatch::~QextScintillaLexerBatch (  )  [virtual]
+
+
+ +

+Destroys the QextScintillaLexerBatch instance. +

+ +

+

+


Member Function Documentation

+ +
+
+ + + + + + + + +
const char* QextScintillaLexerBatch::language (  )  const [virtual]
+
+
+ +

+Returns the name of the language. +

+ +

+Implements QextScintillaLexer. +

+

+ +

+
+ + + + + + + + +
const char* QextScintillaLexerBatch::lexer (  )  const [virtual]
+
+
+ +

+Returns the name of the lexer. Some lexers support a number of languages. +

+Implements QextScintillaLexer. +

+

+ +

+
+ + + + + + + + + +
QColor QextScintillaLexerBatch::color (int  style  )  const [virtual]
+
+
+ +

+Returns the foreground colour of the text for style number style.

+

See also:
paper()
+ +

+Reimplemented from QextScintillaLexer. +

+

+ +

+
+ + + + + + + + + +
bool QextScintillaLexerBatch::eolFill (int  style  )  const [virtual]
+
+
+ +

+Returns the end-of-line fill for style number style. +

+ +

+Reimplemented from QextScintillaLexer. +

+

+ +

+
+ + + + + + + + + +
QFont QextScintillaLexerBatch::font (int  style  )  const [virtual]
+
+
+ +

+Returns the font for style number style. +

+ +

+Reimplemented from QextScintillaLexer. +

+

+ +

+
+ + + + + + + + + +
const char* QextScintillaLexerBatch::keywords (int  set  )  const [virtual]
+
+
+ +

+Returns the set of keywords for the keyword set set recognised by the lexer as a space separated string. +

+Reimplemented from QextScintillaLexer. +

+

+ +

+
+ + + + + + + + + +
QString QextScintillaLexerBatch::description (int  style  )  const [virtual]
+
+
+ +

+Returns the descriptive name for style number style. If the style is invalid for this language then QString::null is returned. This is intended to be used in user preference dialogs. +

+Implements QextScintillaLexer. +

+

+ +

+
+ + + + + + + + + +
QColor QextScintillaLexerBatch::paper (int  style  )  const [virtual]
+
+
+ +

+Returns the background colour of the text for style number style.

+

See also:
color()
+ +

+Reimplemented from QextScintillaLexer. +

+

+


Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/classQextScintillaLexerCPP-members.html b/doc/html/classQextScintillaLexerCPP-members.html new file mode 100644 index 0000000..3e1a8a1 --- /dev/null +++ b/doc/html/classQextScintillaLexerCPP-members.html @@ -0,0 +1,99 @@ + + +QScintilla: Member List + + + + + + +

QextScintillaLexerCPP Member List

This is the complete list of members for QextScintillaLexerCPP, including all inherited members.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
autoCompletionFillups() const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
autoCompletionStartCharacters() const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
autoIndentStyle()QextScintillaLexer
blockEnd(int *style=0) const (defined in QextScintillaLexerCPP)QextScintillaLexerCPP [virtual]
blockLookback() const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
blockStart(int *style=0) const (defined in QextScintillaLexerCPP)QextScintillaLexerCPP [virtual]
blockStartKeyword(int *style=0) const (defined in QextScintillaLexerCPP)QextScintillaLexerCPP [virtual]
braceStyle() const (defined in QextScintillaLexerCPP)QextScintillaLexerCPP [virtual]
color(int style) const QextScintillaLexerCPP [virtual]
colorChanged(const QColor &c, int style)QextScintillaLexer [signal]
Comment enum valueQextScintillaLexerCPP
CommentDoc enum valueQextScintillaLexerCPP
CommentDocKeyword enum valueQextScintillaLexerCPP
CommentDocKeywordError enum valueQextScintillaLexerCPP
CommentLine enum valueQextScintillaLexerCPP
CommentLineDoc enum valueQextScintillaLexerCPP
Default enum valueQextScintillaLexerCPP
defaultColor() const QextScintillaLexer [virtual]
defaultFont() const QextScintillaLexer [virtual]
defaultPaper() const QextScintillaLexer [virtual]
defaultStyle() const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
description(int style) const QextScintillaLexerCPP [virtual]
DoubleQuotedString enum valueQextScintillaLexerCPP
eolFill(int style) const QextScintillaLexerCPP [virtual]
eolFillChanged(bool eoffilled, int style)QextScintillaLexer [signal]
foldAtElse() const QextScintillaLexerCPP
foldComments() const QextScintillaLexerCPP
foldCompact() const QextScintillaLexerCPP
foldPreprocessor() const QextScintillaLexerCPP
font(int style) const QextScintillaLexerCPP [virtual]
fontChanged(const QFont &f, int style)QextScintillaLexer [signal]
GlobalClass enum valueQextScintillaLexerCPP
Identifier enum valueQextScintillaLexerCPP
Keyword enum valueQextScintillaLexerCPP
keywords(int set) const QextScintillaLexerCPP [virtual]
KeywordSet2 enum valueQextScintillaLexerCPP
language() const QextScintillaLexerCPP [virtual]
lexer() const QextScintillaLexerCPP [virtual]
Number enum valueQextScintillaLexerCPP
Operator enum valueQextScintillaLexerCPP
paper(int style) const QextScintillaLexerCPP [virtual]
paperChanged(const QColor &c, int style)QextScintillaLexer [signal]
PreProcessor enum valueQextScintillaLexerCPP
propertyChanged(const char *prop, const char *val)QextScintillaLexer [signal]
QextScintillaLexer(QObject *parent=0, const char *name=0)QextScintillaLexer
QextScintillaLexerCPP(QObject *parent=0, const char *name=0, bool caseInsensitiveKeywords=FALSE)QextScintillaLexerCPP
readProperties(QSettings &qs, const QString &prefix)QextScintillaLexerCPP [protected, virtual]
readSettings(QSettings &qs, const char *prefix="/Scintilla")QextScintillaLexer
refreshProperties()QextScintillaLexerCPP [virtual]
Regex enum valueQextScintillaLexerCPP
setAutoIndentStyle(int autoindentstyle)QextScintillaLexer [virtual, slot]
setColor(const QColor &c, int style=-1)QextScintillaLexer [virtual, slot]
setDefaultColor(const QColor &c)QextScintillaLexer [virtual, slot]
setDefaultFont(const QFont &f)QextScintillaLexer [virtual, slot]
setDefaultPaper(const QColor &c)QextScintillaLexer [virtual, slot]
setEolFill(bool eoffill, int style=-1)QextScintillaLexer [virtual, slot]
setFoldAtElse(bool fold)QextScintillaLexerCPP [virtual, slot]
setFoldComments(bool fold)QextScintillaLexerCPP [virtual, slot]
setFoldCompact(bool fold)QextScintillaLexerCPP [virtual, slot]
setFoldPreprocessor(bool fold)QextScintillaLexerCPP [virtual, slot]
setFont(const QFont &f, int style=-1)QextScintillaLexer [virtual, slot]
setPaper(const QColor &c, int style=-1)QextScintillaLexer [virtual, slot]
setStylePreprocessor(bool style)QextScintillaLexerCPP [virtual, slot]
SingleQuotedString enum valueQextScintillaLexerCPP
stylePreprocessor() const QextScintillaLexerCPP
UnclosedString enum valueQextScintillaLexerCPP
UUID enum valueQextScintillaLexerCPP
VerbatimString enum valueQextScintillaLexerCPP
WhiteSpace enum valueQextScintillaLexerCPP
wordCharacters() const (defined in QextScintillaLexerCPP)QextScintillaLexerCPP [virtual]
writeProperties(QSettings &qs, const QString &prefix) const QextScintillaLexerCPP [protected, virtual]
writeSettings(QSettings &qs, const char *prefix="/Scintilla") const QextScintillaLexer
~QextScintillaLexer()QextScintillaLexer [virtual]
~QextScintillaLexerCPP()QextScintillaLexerCPP [virtual]


Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/classQextScintillaLexerCPP.html b/doc/html/classQextScintillaLexerCPP.html new file mode 100644 index 0000000..91a716a --- /dev/null +++ b/doc/html/classQextScintillaLexerCPP.html @@ -0,0 +1,753 @@ + + +QScintilla: QextScintillaLexerCPP Class Reference + + + + + + +

QextScintillaLexerCPP Class Reference

The QextScintillaLexerCPP class encapsulates the Scintilla C++ lexer. +More... +

+#include <qextscintillalexercpp.h> +

+Inherits QextScintillaLexer. +

+Inherited by QextScintillaLexerCSharp, QextScintillaLexerIDL, QextScintillaLexerJava, and QextScintillaLexerJavaScript. +

+List of all members.

Public Types

+ +

Public Slots

+ +

Public Member Functions

+ +

Protected Member Functions

+ +

Detailed Description

+The QextScintillaLexerCPP class encapsulates the Scintilla C++ lexer. +

+


Member Enumeration Documentation

+ +
+
+ + + + +
anonymous enum
+
+
+ +

+This enum defines the meanings of the different styles used by the C++ lexer.

Enumerator:
+ + + + + + + + + + + + + + + + + + + + + + +
Default  +The default.
WhiteSpace  +
Deprecated:
White space.
+
Comment  +A C comment.
CommentLine  +A C++ comment line.
CommentDoc  +A JavaDoc/Doxygen style C comment.
Number  +A number.
Keyword  +A keyword.
DoubleQuotedString  +A double-quoted string.
SingleQuotedString  +A single-quoted string.
UUID  +An IDL UUID.
PreProcessor  +A pre-processor block.
Operator  +An operator.
Identifier  +An identifier.
UnclosedString  +The end of a line where a string is not closed.
VerbatimString  +A C# verbatim string.
Regex  +A JavaScript regular expression.
CommentLineDoc  +A JavaDoc/Doxygen style C++ comment line.
KeywordSet2  +A keyword defined in keyword set number 2. The class must be sub-classed and re-implement keywords() to make use of this style.
CommentDocKeyword  +A JavaDoc/Doxygen keyword.
CommentDocKeywordError  +A JavaDoc/Doxygen keyword error.
GlobalClass  +A global class or typedef defined in keyword set number 4. The class must be sub-classed and re-implement keywords() to make use of this style.
+
+ +
+

+


Constructor & Destructor Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
QextScintillaLexerCPP::QextScintillaLexerCPP (QObject *  parent = 0,
const char *  name = 0,
bool  caseInsensitiveKeywords = FALSE 
)
+
+
+ +

+Construct a QextScintillaLexerCPP with parent parent and name name. parent is typically the QextScintilla instance. caseInsensitiveKeywords is TRUE if the lexer ignores the case of keywords. +

+

+ +

+
+ + + + + + + + +
virtual QextScintillaLexerCPP::~QextScintillaLexerCPP (  )  [virtual]
+
+
+ +

+Destroys the QextScintillaLexerCPP instance. +

+ +

+

+


Member Function Documentation

+ +
+
+ + + + + + + + +
const char* QextScintillaLexerCPP::language (  )  const [virtual]
+
+
+ +

+Returns the name of the language. +

+ +

+Implements QextScintillaLexer. +

+Reimplemented in QextScintillaLexerCSharp, QextScintillaLexerIDL, QextScintillaLexerJava, and QextScintillaLexerJavaScript. +

+

+ +

+
+ + + + + + + + +
const char* QextScintillaLexerCPP::lexer (  )  const [virtual]
+
+
+ +

+Returns the name of the lexer. Some lexers support a number of languages. +

+Implements QextScintillaLexer. +

+

+ +

+
+ + + + + + + + + +
QColor QextScintillaLexerCPP::color (int  style  )  const [virtual]
+
+
+ +

+Returns the foreground colour of the text for style number style.

+

See also:
paper()
+ +

+Reimplemented from QextScintillaLexer. +

+Reimplemented in QextScintillaLexerCSharp, QextScintillaLexerIDL, and QextScintillaLexerJavaScript. +

+

+ +

+
+ + + + + + + + + +
bool QextScintillaLexerCPP::eolFill (int  style  )  const [virtual]
+
+
+ +

+Returns the end-of-line fill for style number style. +

+ +

+Reimplemented from QextScintillaLexer. +

+Reimplemented in QextScintillaLexerCSharp, and QextScintillaLexerJavaScript. +

+

+ +

+
+ + + + + + + + + +
QFont QextScintillaLexerCPP::font (int  style  )  const [virtual]
+
+
+ +

+Returns the font for style number style. +

+ +

+Reimplemented from QextScintillaLexer. +

+Reimplemented in QextScintillaLexerCSharp, and QextScintillaLexerJavaScript. +

+

+ +

+
+ + + + + + + + + +
const char* QextScintillaLexerCPP::keywords (int  set  )  const [virtual]
+
+
+ +

+Returns the set of keywords for the keyword set set recognised by the lexer as a space separated string. +

+Reimplemented from QextScintillaLexer. +

+Reimplemented in QextScintillaLexerCSharp, QextScintillaLexerIDL, QextScintillaLexerJava, and QextScintillaLexerJavaScript. +

+

+ +

+
+ + + + + + + + + +
QString QextScintillaLexerCPP::description (int  style  )  const [virtual]
+
+
+ +

+Returns the descriptive name for style number style. If the style is invalid for this language then QString::null is returned. This is intended to be used in user preference dialogs. +

+Implements QextScintillaLexer. +

+Reimplemented in QextScintillaLexerCSharp, QextScintillaLexerIDL, and QextScintillaLexerJavaScript. +

+

+ +

+
+ + + + + + + + + +
QColor QextScintillaLexerCPP::paper (int  style  )  const [virtual]
+
+
+ +

+Returns the background colour of the text for style number style.

+

See also:
color()
+ +

+Reimplemented from QextScintillaLexer. +

+Reimplemented in QextScintillaLexerCSharp, and QextScintillaLexerJavaScript. +

+

+ +

+
+ + + + + + + + +
void QextScintillaLexerCPP::refreshProperties (  )  [virtual]
+
+
+ +

+Causes all properties to be refreshed by emitting the propertyChanged() signal as required. +

+Reimplemented from QextScintillaLexer. +

+

+ +

+
+ + + + + + + + +
bool QextScintillaLexerCPP::foldAtElse (  )  const
+
+
+ +

+Returns TRUE if "} else {" lines can be folded.

+

See also:
setFoldAtElse()
+ +
+

+ +

+
+ + + + + + + + +
bool QextScintillaLexerCPP::foldComments (  )  const
+
+
+ +

+Returns TRUE if multi-line comment blocks can be folded.

+

See also:
setFoldComments()
+ +
+

+ +

+
+ + + + + + + + +
bool QextScintillaLexerCPP::foldCompact (  )  const
+
+
+ +

+Returns TRUE if trailing blank lines are included in a fold block.

+

See also:
setFoldCompact()
+ +
+

+ +

+
+ + + + + + + + +
bool QextScintillaLexerCPP::foldPreprocessor (  )  const
+
+
+ +

+Returns TRUE if preprocessor blocks can be folded.

+

See also:
setFoldPreprocessor()
+ +
+

+ +

+
+ + + + + + + + +
bool QextScintillaLexerCPP::stylePreprocessor (  )  const
+
+
+ +

+Returns TRUE if preprocessor lines (after the preprocessor directive) are styled.

+

See also:
setStylePreprocessor()
+ +
+

+ +

+
+ + + + + + + + + +
virtual void QextScintillaLexerCPP::setFoldAtElse (bool  fold  )  [virtual, slot]
+
+
+ +

+If fold is TRUE then "} else {" lines can be folded. The default is FALSE.

+

See also:
foldAtElse()
+ +
+

+ +

+
+ + + + + + + + + +
virtual void QextScintillaLexerCPP::setFoldComments (bool  fold  )  [virtual, slot]
+
+
+ +

+If fold is TRUE then multi-line comment blocks can be folded. The default is FALSE.

+

See also:
foldComments()
+ +
+

+ +

+
+ + + + + + + + + +
virtual void QextScintillaLexerCPP::setFoldCompact (bool  fold  )  [virtual, slot]
+
+
+ +

+If fold is TRUE then trailing blank lines are included in a fold block. The default is TRUE.

+

See also:
foldCompact()
+ +
+

+ +

+
+ + + + + + + + + +
virtual void QextScintillaLexerCPP::setFoldPreprocessor (bool  fold  )  [virtual, slot]
+
+
+ +

+If fold is TRUE then preprocessor blocks can be folded. The default is TRUE.

+

See also:
foldPreprocessor()
+ +
+

+ +

+
+ + + + + + + + + +
virtual void QextScintillaLexerCPP::setStylePreprocessor (bool  style  )  [virtual, slot]
+
+
+ +

+If style is TRUE then preprocessor lines (after the preprocessor directive) are styled. The default is FALSE.

+

See also:
stylePreprocessor()
+ +
+

+ +

+
+ + + + + + + + + + + + + + + + + + +
bool QextScintillaLexerCPP::readProperties (QSettings &  qs,
const QString &  prefix 
) [protected, virtual]
+
+
+ +

+The lexer's properties are read from the settings qs. prefix (which has a trailing '/') should be used as a prefix to the key of each setting. TRUE is returned if there is no error.

+

See also:
writeProperties()
+ +

+Reimplemented from QextScintillaLexer. +

+

+ +

+
+ + + + + + + + + + + + + + + + + + +
bool QextScintillaLexerCPP::writeProperties (QSettings &  qs,
const QString &  prefix 
) const [protected, virtual]
+
+
+ +

+The lexer's properties are written to the settings qs. prefix (which has a trailing '/') should be used as a prefix to the key of each setting. TRUE is returned if there is no error.

+

See also:
readProperties()
+ +

+Reimplemented from QextScintillaLexer. +

+

+


Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/classQextScintillaLexerCSS-members.html b/doc/html/classQextScintillaLexerCSS-members.html new file mode 100644 index 0000000..c9f16a3 --- /dev/null +++ b/doc/html/classQextScintillaLexerCSS-members.html @@ -0,0 +1,89 @@ + + +QScintilla: Member List + + + + + + +

QextScintillaLexerCSS Member List

This is the complete list of members for QextScintillaLexerCSS, including all inherited members.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AtRule enum valueQextScintillaLexerCSS
Attribute enum valueQextScintillaLexerCSS
autoCompletionFillups() const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
autoCompletionStartCharacters() const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
autoIndentStyle()QextScintillaLexer
blockEnd(int *style=0) const (defined in QextScintillaLexerCSS)QextScintillaLexerCSS [virtual]
blockLookback() const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
blockStart(int *style=0) const (defined in QextScintillaLexerCSS)QextScintillaLexerCSS [virtual]
blockStartKeyword(int *style=0) const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
braceStyle() const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
ClassSelector enum valueQextScintillaLexerCSS
color(int style) const QextScintillaLexerCSS [virtual]
colorChanged(const QColor &c, int style)QextScintillaLexer [signal]
Comment enum valueQextScintillaLexerCSS
CSS1Property enum valueQextScintillaLexerCSS
CSS2Property enum valueQextScintillaLexerCSS
Default enum valueQextScintillaLexerCSS
defaultColor() const QextScintillaLexer [virtual]
defaultFont() const QextScintillaLexer [virtual]
defaultPaper() const QextScintillaLexer [virtual]
defaultStyle() const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
description(int style) const QextScintillaLexerCSS [virtual]
DoubleQuotedString enum valueQextScintillaLexerCSS
eolFill(int style) const QextScintillaLexer [virtual]
eolFillChanged(bool eoffilled, int style)QextScintillaLexer [signal]
foldComments() const QextScintillaLexerCSS
foldCompact() const QextScintillaLexerCSS
font(int style) const QextScintillaLexerCSS [virtual]
fontChanged(const QFont &f, int style)QextScintillaLexer [signal]
IDSelector enum valueQextScintillaLexerCSS
Important enum valueQextScintillaLexerCSS
keywords(int set) const QextScintillaLexerCSS [virtual]
language() const QextScintillaLexerCSS [virtual]
lexer() const QextScintillaLexerCSS [virtual]
Operator enum valueQextScintillaLexerCSS
paper(int style) const QextScintillaLexer [virtual]
paperChanged(const QColor &c, int style)QextScintillaLexer [signal]
propertyChanged(const char *prop, const char *val)QextScintillaLexer [signal]
PseudoClass enum valueQextScintillaLexerCSS
QextScintillaLexer(QObject *parent=0, const char *name=0)QextScintillaLexer
QextScintillaLexerCSS(QObject *parent=0, const char *name=0)QextScintillaLexerCSS
readProperties(QSettings &qs, const QString &prefix)QextScintillaLexerCSS [protected, virtual]
readSettings(QSettings &qs, const char *prefix="/Scintilla")QextScintillaLexer
refreshProperties()QextScintillaLexerCSS [virtual]
setAutoIndentStyle(int autoindentstyle)QextScintillaLexer [virtual, slot]
setColor(const QColor &c, int style=-1)QextScintillaLexer [virtual, slot]
setDefaultColor(const QColor &c)QextScintillaLexer [virtual, slot]
setDefaultFont(const QFont &f)QextScintillaLexer [virtual, slot]
setDefaultPaper(const QColor &c)QextScintillaLexer [virtual, slot]
setEolFill(bool eoffill, int style=-1)QextScintillaLexer [virtual, slot]
setFoldComments(bool fold)QextScintillaLexerCSS [virtual, slot]
setFoldCompact(bool fold)QextScintillaLexerCSS [virtual, slot]
setFont(const QFont &f, int style=-1)QextScintillaLexer [virtual, slot]
setPaper(const QColor &c, int style=-1)QextScintillaLexer [virtual, slot]
SingleQuotedString enum valueQextScintillaLexerCSS
Tag enum valueQextScintillaLexerCSS
UnknownProperty enum valueQextScintillaLexerCSS
UnknownPseudoClass enum valueQextScintillaLexerCSS
Value enum valueQextScintillaLexerCSS
wordCharacters() const (defined in QextScintillaLexerCSS)QextScintillaLexerCSS [virtual]
writeProperties(QSettings &qs, const QString &prefix) const QextScintillaLexerCSS [protected, virtual]
writeSettings(QSettings &qs, const char *prefix="/Scintilla") const QextScintillaLexer
~QextScintillaLexer()QextScintillaLexer [virtual]
~QextScintillaLexerCSS()QextScintillaLexerCSS [virtual]


Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/classQextScintillaLexerCSS.html b/doc/html/classQextScintillaLexerCSS.html new file mode 100644 index 0000000..cfc076d --- /dev/null +++ b/doc/html/classQextScintillaLexerCSS.html @@ -0,0 +1,520 @@ + + +QScintilla: QextScintillaLexerCSS Class Reference + + + + + + +

QextScintillaLexerCSS Class Reference

The QextScintillaLexerCSS class encapsulates the Scintilla CSS lexer. +More... +

+#include <qextscintillalexercss.h> +

+Inherits QextScintillaLexer. +

+List of all members.

Public Types

+ +

Public Slots

+ +

Public Member Functions

+ +

Protected Member Functions

+ +

Detailed Description

+The QextScintillaLexerCSS class encapsulates the Scintilla CSS lexer. +

+


Member Enumeration Documentation

+ +
+
+ + + + +
anonymous enum
+
+
+ +

+This enum defines the meanings of the different styles used by the CSS lexer.

Enumerator:
+ + + + + + + + + + + + + + + + + + +
Default  +The default.
Tag  +A tag.
ClassSelector  +A class selector.
PseudoClass  +A pseudo-class.
UnknownPseudoClass  +An pseudo-class.
Operator  +An operator.
CSS1Property  +A CSS1 property.
UnknownProperty  +An unknown property.
Value  +A value.
Comment  +A comment.
IDSelector  +An ID selector.
Important  +An important value.
AtRule  +An @-rule.
DoubleQuotedString  +A double-quoted string.
SingleQuotedString  +A single-quoted string.
CSS2Property  +A CSS2 property.
Attribute  +An attribute.
+
+ +
+

+


Constructor & Destructor Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + +
QextScintillaLexerCSS::QextScintillaLexerCSS (QObject *  parent = 0,
const char *  name = 0 
)
+
+
+ +

+Construct a QextScintillaLexerCSS with parent parent and name name. parent is typically the QextScintilla instance. +

+

+ +

+
+ + + + + + + + +
virtual QextScintillaLexerCSS::~QextScintillaLexerCSS (  )  [virtual]
+
+
+ +

+Destroys the QextScintillaLexerCSS instance. +

+ +

+

+


Member Function Documentation

+ +
+
+ + + + + + + + +
const char* QextScintillaLexerCSS::language (  )  const [virtual]
+
+
+ +

+Returns the name of the language. +

+ +

+Implements QextScintillaLexer. +

+

+ +

+
+ + + + + + + + +
const char* QextScintillaLexerCSS::lexer (  )  const [virtual]
+
+
+ +

+Returns the name of the lexer. Some lexers support a number of languages. +

+Implements QextScintillaLexer. +

+

+ +

+
+ + + + + + + + + +
QColor QextScintillaLexerCSS::color (int  style  )  const [virtual]
+
+
+ +

+Returns the foreground colour of the text for style number style.

+

See also:
paper()
+ +

+Reimplemented from QextScintillaLexer. +

+

+ +

+
+ + + + + + + + + +
QFont QextScintillaLexerCSS::font (int  style  )  const [virtual]
+
+
+ +

+Returns the font for style number style. +

+ +

+Reimplemented from QextScintillaLexer. +

+

+ +

+
+ + + + + + + + + +
const char* QextScintillaLexerCSS::keywords (int  set  )  const [virtual]
+
+
+ +

+Returns the set of keywords for the keyword set set recognised by the lexer as a space separated string. +

+Reimplemented from QextScintillaLexer. +

+

+ +

+
+ + + + + + + + + +
QString QextScintillaLexerCSS::description (int  style  )  const [virtual]
+
+
+ +

+Returns the descriptive name for style number style. If the style is invalid for this language then QString::null is returned. This is intended to be used in user preference dialogs. +

+Implements QextScintillaLexer. +

+

+ +

+
+ + + + + + + + +
void QextScintillaLexerCSS::refreshProperties (  )  [virtual]
+
+
+ +

+Causes all properties to be refreshed by emitting the propertyChanged() signal as required. +

+Reimplemented from QextScintillaLexer. +

+

+ +

+
+ + + + + + + + +
bool QextScintillaLexerCSS::foldComments (  )  const
+
+
+ +

+Returns TRUE if multi-line comment blocks can be folded.

+

See also:
setFoldComments()
+ +
+

+ +

+
+ + + + + + + + +
bool QextScintillaLexerCSS::foldCompact (  )  const
+
+
+ +

+Returns TRUE if trailing blank lines are included in a fold block.

+

See also:
setFoldCompact()
+ +
+

+ +

+
+ + + + + + + + + +
virtual void QextScintillaLexerCSS::setFoldComments (bool  fold  )  [virtual, slot]
+
+
+ +

+If fold is TRUE then multi-line comment blocks can be folded. The default is FALSE.

+

See also:
foldComments()
+ +
+

+ +

+
+ + + + + + + + + +
virtual void QextScintillaLexerCSS::setFoldCompact (bool  fold  )  [virtual, slot]
+
+
+ +

+If fold is TRUE then trailing blank lines are included in a fold block. The default is TRUE.

+

See also:
foldCompact()
+ +
+

+ +

+
+ + + + + + + + + + + + + + + + + + +
bool QextScintillaLexerCSS::readProperties (QSettings &  qs,
const QString &  prefix 
) [protected, virtual]
+
+
+ +

+The lexer's properties are read from the settings qs. prefix (which has a trailing '/') should be used as a prefix to the key of each setting. TRUE is returned if there is no error. +

+Reimplemented from QextScintillaLexer. +

+

+ +

+
+ + + + + + + + + + + + + + + + + + +
bool QextScintillaLexerCSS::writeProperties (QSettings &  qs,
const QString &  prefix 
) const [protected, virtual]
+
+
+ +

+The lexer's properties are written to the settings qs. prefix (which has a trailing '/') should be used as a prefix to the key of each setting. TRUE is returned if there is no error. +

+Reimplemented from QextScintillaLexer. +

+

+


Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/classQextScintillaLexerCSharp-members.html b/doc/html/classQextScintillaLexerCSharp-members.html new file mode 100644 index 0000000..ac3a2d3 --- /dev/null +++ b/doc/html/classQextScintillaLexerCSharp-members.html @@ -0,0 +1,101 @@ + + +QScintilla: Member List + + + + + + +

QextScintillaLexerCSharp Member List

This is the complete list of members for QextScintillaLexerCSharp, including all inherited members.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
autoCompletionFillups() const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
autoCompletionStartCharacters() const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
autoIndentStyle()QextScintillaLexer
blockEnd(int *style=0) const (defined in QextScintillaLexerCPP)QextScintillaLexerCPP [virtual]
blockLookback() const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
blockStart(int *style=0) const (defined in QextScintillaLexerCPP)QextScintillaLexerCPP [virtual]
blockStartKeyword(int *style=0) const (defined in QextScintillaLexerCPP)QextScintillaLexerCPP [virtual]
braceStyle() const (defined in QextScintillaLexerCPP)QextScintillaLexerCPP [virtual]
color(int style) const QextScintillaLexerCSharp [virtual]
colorChanged(const QColor &c, int style)QextScintillaLexer [signal]
Comment enum valueQextScintillaLexerCPP
CommentDoc enum valueQextScintillaLexerCPP
CommentDocKeyword enum valueQextScintillaLexerCPP
CommentDocKeywordError enum valueQextScintillaLexerCPP
CommentLine enum valueQextScintillaLexerCPP
CommentLineDoc enum valueQextScintillaLexerCPP
Default enum valueQextScintillaLexerCPP
defaultColor() const QextScintillaLexer [virtual]
defaultFont() const QextScintillaLexer [virtual]
defaultPaper() const QextScintillaLexer [virtual]
defaultStyle() const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
description(int style) const QextScintillaLexerCSharp [virtual]
DoubleQuotedString enum valueQextScintillaLexerCPP
eolFill(int style) const QextScintillaLexerCSharp [virtual]
eolFillChanged(bool eoffilled, int style)QextScintillaLexer [signal]
foldAtElse() const QextScintillaLexerCPP
foldComments() const QextScintillaLexerCPP
foldCompact() const QextScintillaLexerCPP
foldPreprocessor() const QextScintillaLexerCPP
font(int style) const QextScintillaLexerCSharp [virtual]
fontChanged(const QFont &f, int style)QextScintillaLexer [signal]
GlobalClass enum valueQextScintillaLexerCPP
Identifier enum valueQextScintillaLexerCPP
Keyword enum valueQextScintillaLexerCPP
keywords(int set) const QextScintillaLexerCSharp [virtual]
KeywordSet2 enum valueQextScintillaLexerCPP
language() const QextScintillaLexerCSharp [virtual]
lexer() const QextScintillaLexerCPP [virtual]
Number enum valueQextScintillaLexerCPP
Operator enum valueQextScintillaLexerCPP
paper(int style) const QextScintillaLexerCSharp [virtual]
paperChanged(const QColor &c, int style)QextScintillaLexer [signal]
PreProcessor enum valueQextScintillaLexerCPP
propertyChanged(const char *prop, const char *val)QextScintillaLexer [signal]
QextScintillaLexer(QObject *parent=0, const char *name=0)QextScintillaLexer
QextScintillaLexerCPP(QObject *parent=0, const char *name=0, bool caseInsensitiveKeywords=FALSE)QextScintillaLexerCPP
QextScintillaLexerCSharp(QObject *parent=0, const char *name=0)QextScintillaLexerCSharp
readProperties(QSettings &qs, const QString &prefix)QextScintillaLexerCPP [protected, virtual]
readSettings(QSettings &qs, const char *prefix="/Scintilla")QextScintillaLexer
refreshProperties()QextScintillaLexerCPP [virtual]
Regex enum valueQextScintillaLexerCPP
setAutoIndentStyle(int autoindentstyle)QextScintillaLexer [virtual, slot]
setColor(const QColor &c, int style=-1)QextScintillaLexer [virtual, slot]
setDefaultColor(const QColor &c)QextScintillaLexer [virtual, slot]
setDefaultFont(const QFont &f)QextScintillaLexer [virtual, slot]
setDefaultPaper(const QColor &c)QextScintillaLexer [virtual, slot]
setEolFill(bool eoffill, int style=-1)QextScintillaLexer [virtual, slot]
setFoldAtElse(bool fold)QextScintillaLexerCPP [virtual, slot]
setFoldComments(bool fold)QextScintillaLexerCPP [virtual, slot]
setFoldCompact(bool fold)QextScintillaLexerCPP [virtual, slot]
setFoldPreprocessor(bool fold)QextScintillaLexerCPP [virtual, slot]
setFont(const QFont &f, int style=-1)QextScintillaLexer [virtual, slot]
setPaper(const QColor &c, int style=-1)QextScintillaLexer [virtual, slot]
setStylePreprocessor(bool style)QextScintillaLexerCPP [virtual, slot]
SingleQuotedString enum valueQextScintillaLexerCPP
stylePreprocessor() const QextScintillaLexerCPP
UnclosedString enum valueQextScintillaLexerCPP
UUID enum valueQextScintillaLexerCPP
VerbatimString enum valueQextScintillaLexerCPP
WhiteSpace enum valueQextScintillaLexerCPP
wordCharacters() const (defined in QextScintillaLexerCPP)QextScintillaLexerCPP [virtual]
writeProperties(QSettings &qs, const QString &prefix) const QextScintillaLexerCPP [protected, virtual]
writeSettings(QSettings &qs, const char *prefix="/Scintilla") const QextScintillaLexer
~QextScintillaLexer()QextScintillaLexer [virtual]
~QextScintillaLexerCPP()QextScintillaLexerCPP [virtual]
~QextScintillaLexerCSharp()QextScintillaLexerCSharp [virtual]


Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/classQextScintillaLexerCSharp.html b/doc/html/classQextScintillaLexerCSharp.html new file mode 100644 index 0000000..bdb8fc3 --- /dev/null +++ b/doc/html/classQextScintillaLexerCSharp.html @@ -0,0 +1,261 @@ + + +QScintilla: QextScintillaLexerCSharp Class Reference + + + + + + +

QextScintillaLexerCSharp Class Reference

The QextScintillaLexerCSharp class encapsulates the Scintilla C# lexer. +More... +

+#include <qextscintillalexercsharp.h> +

+Inherits QextScintillaLexerCPP. +

+List of all members.

Public Member Functions

+ +

Detailed Description

+The QextScintillaLexerCSharp class encapsulates the Scintilla C# lexer. +

+


Constructor & Destructor Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + +
QextScintillaLexerCSharp::QextScintillaLexerCSharp (QObject *  parent = 0,
const char *  name = 0 
)
+
+
+ +

+Construct a QextScintillaLexerCSharp with parent parent and name name. parent is typically the QextScintilla instance. +

+

+ +

+
+ + + + + + + + +
virtual QextScintillaLexerCSharp::~QextScintillaLexerCSharp (  )  [virtual]
+
+
+ +

+Destroys the QextScintillaLexerCSharp instance. +

+ +

+

+


Member Function Documentation

+ +
+
+ + + + + + + + +
const char* QextScintillaLexerCSharp::language (  )  const [virtual]
+
+
+ +

+Returns the name of the language. +

+ +

+Reimplemented from QextScintillaLexerCPP. +

+

+ +

+
+ + + + + + + + + +
QColor QextScintillaLexerCSharp::color (int  style  )  const [virtual]
+
+
+ +

+Returns the foreground colour of the text for style number style.

+

See also:
paper()
+ +

+Reimplemented from QextScintillaLexerCPP. +

+

+ +

+
+ + + + + + + + + +
bool QextScintillaLexerCSharp::eolFill (int  style  )  const [virtual]
+
+
+ +

+Returns the end-of-line fill for style number style. +

+ +

+Reimplemented from QextScintillaLexerCPP. +

+

+ +

+
+ + + + + + + + + +
QFont QextScintillaLexerCSharp::font (int  style  )  const [virtual]
+
+
+ +

+Returns the font for style number style. +

+ +

+Reimplemented from QextScintillaLexerCPP. +

+

+ +

+
+ + + + + + + + + +
const char* QextScintillaLexerCSharp::keywords (int  set  )  const [virtual]
+
+
+ +

+Returns the set of keywords for the keyword set set recognised by the lexer as a space separated string. +

+Reimplemented from QextScintillaLexerCPP. +

+

+ +

+
+ + + + + + + + + +
QString QextScintillaLexerCSharp::description (int  style  )  const [virtual]
+
+
+ +

+Returns the descriptive name for style number style. If the style is invalid for this language then QString::null is returned. This is intended to be used in user preference dialogs. +

+Reimplemented from QextScintillaLexerCPP. +

+

+ +

+
+ + + + + + + + + +
QColor QextScintillaLexerCSharp::paper (int  style  )  const [virtual]
+
+
+ +

+Returns the background colour of the text for style number style.

+

See also:
color()
+ +

+Reimplemented from QextScintillaLexerCPP. +

+

+


Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/classQextScintillaLexerDiff-members.html b/doc/html/classQextScintillaLexerDiff-members.html new file mode 100644 index 0000000..04d5ad5 --- /dev/null +++ b/doc/html/classQextScintillaLexerDiff-members.html @@ -0,0 +1,75 @@ + + +QScintilla: Member List + + + + + + +

QextScintillaLexerDiff Member List

This is the complete list of members for QextScintillaLexerDiff, including all inherited members.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
autoCompletionFillups() const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
autoCompletionStartCharacters() const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
autoIndentStyle()QextScintillaLexer
blockEnd(int *style=0) const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
blockLookback() const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
blockStart(int *style=0) const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
blockStartKeyword(int *style=0) const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
braceStyle() const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
color(int style) const QextScintillaLexerDiff [virtual]
colorChanged(const QColor &c, int style)QextScintillaLexer [signal]
Command enum valueQextScintillaLexerDiff
Comment enum valueQextScintillaLexerDiff
Default enum valueQextScintillaLexerDiff
defaultColor() const QextScintillaLexer [virtual]
defaultFont() const QextScintillaLexer [virtual]
defaultPaper() const QextScintillaLexer [virtual]
defaultStyle() const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
description(int style) const QextScintillaLexerDiff [virtual]
eolFill(int style) const QextScintillaLexer [virtual]
eolFillChanged(bool eoffilled, int style)QextScintillaLexer [signal]
font(int style) const QextScintillaLexer [virtual]
fontChanged(const QFont &f, int style)QextScintillaLexer [signal]
Header enum valueQextScintillaLexerDiff
keywords(int set) const QextScintillaLexer [virtual]
language() const QextScintillaLexerDiff [virtual]
lexer() const QextScintillaLexerDiff [virtual]
LineAdded enum valueQextScintillaLexerDiff
LineRemoved enum valueQextScintillaLexerDiff
paper(int style) const QextScintillaLexer [virtual]
paperChanged(const QColor &c, int style)QextScintillaLexer [signal]
Position enum valueQextScintillaLexerDiff
propertyChanged(const char *prop, const char *val)QextScintillaLexer [signal]
QextScintillaLexer(QObject *parent=0, const char *name=0)QextScintillaLexer
QextScintillaLexerDiff(QObject *parent=0, const char *name=0)QextScintillaLexerDiff
readProperties(QSettings &qs, const QString &prefix)QextScintillaLexer [protected, virtual]
readSettings(QSettings &qs, const char *prefix="/Scintilla")QextScintillaLexer
refreshProperties()QextScintillaLexer [virtual]
setAutoIndentStyle(int autoindentstyle)QextScintillaLexer [virtual, slot]
setColor(const QColor &c, int style=-1)QextScintillaLexer [virtual, slot]
setDefaultColor(const QColor &c)QextScintillaLexer [virtual, slot]
setDefaultFont(const QFont &f)QextScintillaLexer [virtual, slot]
setDefaultPaper(const QColor &c)QextScintillaLexer [virtual, slot]
setEolFill(bool eoffill, int style=-1)QextScintillaLexer [virtual, slot]
setFont(const QFont &f, int style=-1)QextScintillaLexer [virtual, slot]
setPaper(const QColor &c, int style=-1)QextScintillaLexer [virtual, slot]
wordCharacters() const (defined in QextScintillaLexerDiff)QextScintillaLexerDiff [virtual]
writeProperties(QSettings &qs, const QString &prefix) const QextScintillaLexer [protected, virtual]
writeSettings(QSettings &qs, const char *prefix="/Scintilla") const QextScintillaLexer
~QextScintillaLexer()QextScintillaLexer [virtual]
~QextScintillaLexerDiff()QextScintillaLexerDiff [virtual]


Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/classQextScintillaLexerDiff.html b/doc/html/classQextScintillaLexerDiff.html new file mode 100644 index 0000000..78fa800 --- /dev/null +++ b/doc/html/classQextScintillaLexerDiff.html @@ -0,0 +1,243 @@ + + +QScintilla: QextScintillaLexerDiff Class Reference + + + + + + +

QextScintillaLexerDiff Class Reference

The QextScintillaLexerDiff class encapsulates the Scintilla Diff lexer. +More... +

+#include <qextscintillalexerdiff.h> +

+Inherits QextScintillaLexer. +

+List of all members.

Public Types

+ +

Public Member Functions

+ +

Detailed Description

+The QextScintillaLexerDiff class encapsulates the Scintilla Diff lexer. +

+


Member Enumeration Documentation

+ +
+
+ + + + +
anonymous enum
+
+
+ +

+This enum defines the meanings of the different styles used by the Diff lexer.

Enumerator:
+ + + + + + + + +
Default  +The default.
Comment  +A comment.
Command  +A command.
Header  +A header.
Position  +A position.
LineRemoved  +A removed line.
LineAdded  +An added line.
+
+ +
+

+


Constructor & Destructor Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + +
QextScintillaLexerDiff::QextScintillaLexerDiff (QObject *  parent = 0,
const char *  name = 0 
)
+
+
+ +

+Construct a QextScintillaLexerDiff with parent parent and name name. parent is typically the QextScintilla instance. +

+

+ +

+
+ + + + + + + + +
virtual QextScintillaLexerDiff::~QextScintillaLexerDiff (  )  [virtual]
+
+
+ +

+Destroys the QextScintillaLexerDiff instance. +

+ +

+

+


Member Function Documentation

+ +
+
+ + + + + + + + +
const char* QextScintillaLexerDiff::language (  )  const [virtual]
+
+
+ +

+Returns the name of the language. +

+ +

+Implements QextScintillaLexer. +

+

+ +

+
+ + + + + + + + +
const char* QextScintillaLexerDiff::lexer (  )  const [virtual]
+
+
+ +

+Returns the name of the lexer. Some lexers support a number of languages. +

+Implements QextScintillaLexer. +

+

+ +

+
+ + + + + + + + + +
QColor QextScintillaLexerDiff::color (int  style  )  const [virtual]
+
+
+ +

+Returns the foreground colour of the text for style number style.

+

See also:
paper()
+ +

+Reimplemented from QextScintillaLexer. +

+

+ +

+
+ + + + + + + + + +
QString QextScintillaLexerDiff::description (int  style  )  const [virtual]
+
+
+ +

+Returns the descriptive name for style number style. If the style is invalid for this language then QString::null is returned. This is intended to be used in user preference dialogs. +

+Implements QextScintillaLexer. +

+

+


Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/classQextScintillaLexerHTML-members.html b/doc/html/classQextScintillaLexerHTML-members.html new file mode 100644 index 0000000..7a411f5 --- /dev/null +++ b/doc/html/classQextScintillaLexerHTML-members.html @@ -0,0 +1,184 @@ + + +QScintilla: Member List + + + + + + +

QextScintillaLexerHTML Member List

This is the complete list of members for QextScintillaLexerHTML, including all inherited members.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ASPAtStart enum valueQextScintillaLexerHTML
ASPJavaScriptComment enum valueQextScintillaLexerHTML
ASPJavaScriptCommentDoc enum valueQextScintillaLexerHTML
ASPJavaScriptCommentLine enum valueQextScintillaLexerHTML
ASPJavaScriptDefault enum valueQextScintillaLexerHTML
ASPJavaScriptDoubleQuotedString enum valueQextScintillaLexerHTML
ASPJavaScriptKeyword enum valueQextScintillaLexerHTML
ASPJavaScriptNumber enum valueQextScintillaLexerHTML
ASPJavaScriptRegex enum valueQextScintillaLexerHTML
ASPJavaScriptSingleQuotedString enum valueQextScintillaLexerHTML
ASPJavaScriptStart enum valueQextScintillaLexerHTML
ASPJavaScriptSymbol enum valueQextScintillaLexerHTML
ASPJavaScriptUnclosedString enum valueQextScintillaLexerHTML
ASPJavaScriptWord enum valueQextScintillaLexerHTML
ASPPythonClassName enum valueQextScintillaLexerHTML
ASPPythonComment enum valueQextScintillaLexerHTML
ASPPythonDefault enum valueQextScintillaLexerHTML
ASPPythonDoubleQuotedString enum valueQextScintillaLexerHTML
ASPPythonFunctionMethodName enum valueQextScintillaLexerHTML
ASPPythonIdentifier enum valueQextScintillaLexerHTML
ASPPythonKeyword enum valueQextScintillaLexerHTML
ASPPythonNumber enum valueQextScintillaLexerHTML
ASPPythonOperator enum valueQextScintillaLexerHTML
ASPPythonSingleQuotedString enum valueQextScintillaLexerHTML
ASPPythonStart enum valueQextScintillaLexerHTML
ASPPythonTripleDoubleQuotedString enum valueQextScintillaLexerHTML
ASPPythonTripleSingleQuotedString enum valueQextScintillaLexerHTML
ASPStart enum valueQextScintillaLexerHTML
ASPVBScriptComment enum valueQextScintillaLexerHTML
ASPVBScriptDefault enum valueQextScintillaLexerHTML
ASPVBScriptIdentifier enum valueQextScintillaLexerHTML
ASPVBScriptKeyword enum valueQextScintillaLexerHTML
ASPVBScriptNumber enum valueQextScintillaLexerHTML
ASPVBScriptStart enum valueQextScintillaLexerHTML
ASPVBScriptString enum valueQextScintillaLexerHTML
ASPVBScriptUnclosedString enum valueQextScintillaLexerHTML
ASPXCComment enum valueQextScintillaLexerHTML
Attribute enum valueQextScintillaLexerHTML
autoCompletionFillups() const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
autoCompletionStartCharacters() const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
autoIndentStyle()QextScintillaLexer
blockEnd(int *style=0) const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
blockLookback() const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
blockStart(int *style=0) const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
blockStartKeyword(int *style=0) const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
braceStyle() const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
caseSensitiveTags() const QextScintillaLexerHTML
CDATA enum valueQextScintillaLexerHTML
color(int style) const QextScintillaLexerHTML [virtual]
colorChanged(const QColor &c, int style)QextScintillaLexer [signal]
Default enum valueQextScintillaLexerHTML
defaultColor() const QextScintillaLexer [virtual]
defaultFont() const QextScintillaLexer [virtual]
defaultPaper() const QextScintillaLexer [virtual]
defaultStyle() const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
description(int style) const QextScintillaLexerHTML [virtual]
Entity enum valueQextScintillaLexerHTML
eolFill(int style) const QextScintillaLexerHTML [virtual]
eolFillChanged(bool eoffilled, int style)QextScintillaLexer [signal]
foldCompact() const QextScintillaLexerHTML
foldPreprocessor() const QextScintillaLexerHTML
font(int style) const QextScintillaLexerHTML [virtual]
fontChanged(const QFont &f, int style)QextScintillaLexer [signal]
HTMLComment enum valueQextScintillaLexerHTML
HTMLDoubleQuotedString enum valueQextScintillaLexerHTML
HTMLNumber enum valueQextScintillaLexerHTML
HTMLSingleQuotedString enum valueQextScintillaLexerHTML
HTMLValue enum valueQextScintillaLexerHTML
JavaScriptComment enum valueQextScintillaLexerHTML
JavaScriptCommentDoc enum valueQextScintillaLexerHTML
JavaScriptCommentLine enum valueQextScintillaLexerHTML
JavaScriptDefault enum valueQextScintillaLexerHTML
JavaScriptDoubleQuotedString enum valueQextScintillaLexerHTML
JavaScriptKeyword enum valueQextScintillaLexerHTML
JavaScriptNumber enum valueQextScintillaLexerHTML
JavaScriptRegex enum valueQextScintillaLexerHTML
JavaScriptSingleQuotedString enum valueQextScintillaLexerHTML
JavaScriptStart enum valueQextScintillaLexerHTML
JavaScriptSymbol enum valueQextScintillaLexerHTML
JavaScriptUnclosedString enum valueQextScintillaLexerHTML
JavaScriptWord enum valueQextScintillaLexerHTML
keywords(int set) const QextScintillaLexerHTML [virtual]
language() const QextScintillaLexerHTML [virtual]
lexer() const QextScintillaLexerHTML [virtual]
OtherInTag enum valueQextScintillaLexerHTML
paper(int style) const QextScintillaLexerHTML [virtual]
paperChanged(const QColor &c, int style)QextScintillaLexer [signal]
PHPComment enum valueQextScintillaLexerHTML
PHPCommentLine enum valueQextScintillaLexerHTML
PHPDefault enum valueQextScintillaLexerHTML
PHPDoubleQuotedString enum valueQextScintillaLexerHTML
PHPDoubleQuotedVariable enum valueQextScintillaLexerHTML
PHPKeyword enum valueQextScintillaLexerHTML
PHPNumber enum valueQextScintillaLexerHTML
PHPOperator enum valueQextScintillaLexerHTML
PHPSingleQuotedString enum valueQextScintillaLexerHTML
PHPStart enum valueQextScintillaLexerHTML
PHPVariable enum valueQextScintillaLexerHTML
propertyChanged(const char *prop, const char *val)QextScintillaLexer [signal]
PythonClassName enum valueQextScintillaLexerHTML
PythonComment enum valueQextScintillaLexerHTML
PythonDefault enum valueQextScintillaLexerHTML
PythonDoubleQuotedString enum valueQextScintillaLexerHTML
PythonFunctionMethodName enum valueQextScintillaLexerHTML
PythonIdentifier enum valueQextScintillaLexerHTML
PythonKeyword enum valueQextScintillaLexerHTML
PythonNumber enum valueQextScintillaLexerHTML
PythonOperator enum valueQextScintillaLexerHTML
PythonSingleQuotedString enum valueQextScintillaLexerHTML
PythonStart enum valueQextScintillaLexerHTML
PythonTripleDoubleQuotedString enum valueQextScintillaLexerHTML
PythonTripleSingleQuotedString enum valueQextScintillaLexerHTML
QextScintillaLexer(QObject *parent=0, const char *name=0)QextScintillaLexer
QextScintillaLexerHTML(QObject *parent=0, const char *name=0)QextScintillaLexerHTML
readProperties(QSettings &qs, const QString &prefix)QextScintillaLexerHTML [protected, virtual]
readSettings(QSettings &qs, const char *prefix="/Scintilla")QextScintillaLexer
refreshProperties()QextScintillaLexerHTML [virtual]
Script enum valueQextScintillaLexerHTML
setAutoIndentStyle(int autoindentstyle)QextScintillaLexer [virtual, slot]
setCaseSensitiveTags(bool sens)QextScintillaLexerHTML [virtual, slot]
setColor(const QColor &c, int style=-1)QextScintillaLexer [virtual, slot]
setDefaultColor(const QColor &c)QextScintillaLexer [virtual, slot]
setDefaultFont(const QFont &f)QextScintillaLexer [virtual, slot]
setDefaultPaper(const QColor &c)QextScintillaLexer [virtual, slot]
setEolFill(bool eoffill, int style=-1)QextScintillaLexer [virtual, slot]
setFoldCompact(bool fold)QextScintillaLexerHTML [virtual, slot]
setFoldPreprocessor(bool fold)QextScintillaLexerHTML [virtual, slot]
setFont(const QFont &f, int style=-1)QextScintillaLexer [virtual, slot]
setPaper(const QColor &c, int style=-1)QextScintillaLexer [virtual, slot]
SGMLBlockDefault enum valueQextScintillaLexerHTML
SGMLCommand enum valueQextScintillaLexerHTML
SGMLComment enum valueQextScintillaLexerHTML
SGMLDefault enum valueQextScintillaLexerHTML
SGMLDoubleQuotedString enum valueQextScintillaLexerHTML
SGMLEntity enum valueQextScintillaLexerHTML
SGMLError enum valueQextScintillaLexerHTML
SGMLParameter enum valueQextScintillaLexerHTML
SGMLParameterComment enum valueQextScintillaLexerHTML
SGMLSingleQuotedString enum valueQextScintillaLexerHTML
SGMLSpecial enum valueQextScintillaLexerHTML
Tag enum valueQextScintillaLexerHTML
UnknownAttribute enum valueQextScintillaLexerHTML
UnknownTag enum valueQextScintillaLexerHTML
VBScriptComment enum valueQextScintillaLexerHTML
VBScriptDefault enum valueQextScintillaLexerHTML
VBScriptIdentifier enum valueQextScintillaLexerHTML
VBScriptKeyword enum valueQextScintillaLexerHTML
VBScriptNumber enum valueQextScintillaLexerHTML
VBScriptStart enum valueQextScintillaLexerHTML
VBScriptString enum valueQextScintillaLexerHTML
VBScriptUnclosedString enum valueQextScintillaLexerHTML
wordCharacters() const (defined in QextScintillaLexerHTML)QextScintillaLexerHTML [virtual]
writeProperties(QSettings &qs, const QString &prefix) const QextScintillaLexerHTML [protected, virtual]
writeSettings(QSettings &qs, const char *prefix="/Scintilla") const QextScintillaLexer
XMLEnd enum valueQextScintillaLexerHTML
XMLStart enum valueQextScintillaLexerHTML
XMLTagEnd enum valueQextScintillaLexerHTML
~QextScintillaLexer()QextScintillaLexer [virtual]
~QextScintillaLexerHTML()QextScintillaLexerHTML [virtual]


Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/classQextScintillaLexerHTML.html b/doc/html/classQextScintillaLexerHTML.html new file mode 100644 index 0000000..46f52b3 --- /dev/null +++ b/doc/html/classQextScintillaLexerHTML.html @@ -0,0 +1,1014 @@ + + +QScintilla: QextScintillaLexerHTML Class Reference + + + + + + +

QextScintillaLexerHTML Class Reference

The QextScintillaLexerHTML class encapsulates the Scintilla HTML lexer. +More... +

+#include <qextscintillalexerhtml.h> +

+Inherits QextScintillaLexer. +

+List of all members.

Public Types

+ +

Public Slots

+ +

Public Member Functions

+ +

Protected Member Functions

+ +

Detailed Description

+The QextScintillaLexerHTML class encapsulates the Scintilla HTML lexer. +

+


Member Enumeration Documentation

+ +
+
+ + + + +
anonymous enum
+
+
+ +

+This enum defines the meanings of the different styles used by the HTML lexer.

Enumerator:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Default  +The default.
Tag  +A tag.
UnknownTag  +An unknown tag.
Attribute  +An attribute.
UnknownAttribute  +An unknown attribute.
HTMLNumber  +An HTML number.
HTMLDoubleQuotedString  +An HTML double-quoted string.
HTMLSingleQuotedString  +An HTML single-quoted string.
OtherInTag  +Other text within a tag.
HTMLComment  +An HTML comment.
Entity  +An entity.
XMLTagEnd  +The end of an XML style tag.
XMLStart  +The start of an XML fragment.
XMLEnd  +The end of an XML fragment.
Script  +A script tag.
ASPAtStart  +The start of an ASP fragment with @.
ASPStart  +The start of an ASP fragment.
CDATA  +CDATA.
PHPStart  +The start of a PHP fragment.
HTMLValue  +An unquoted HTML value.
ASPXCComment  +An ASP X-Code comment.
SGMLDefault  +The default for SGML.
SGMLCommand  +An SGML command.
SGMLParameter  +The first parameter of an SGML command.
SGMLDoubleQuotedString  +An SGML double-quoted string.
SGMLSingleQuotedString  +An SGML single-quoted string.
SGMLError  +An SGML error.
SGMLSpecial  +An SGML special entity.
SGMLEntity  +An SGML entity.
SGMLComment  +An SGML comment.
SGMLParameterComment  +A comment with the first parameter of an SGML command.
SGMLBlockDefault  +The default for an SGML block.
JavaScriptStart  +The start of a JavaScript fragment.
JavaScriptDefault  +The default for JavaScript.
JavaScriptComment  +A JavaScript comment.
JavaScriptCommentLine  +A JavaScript line comment.
JavaScriptCommentDoc  +A JavaDoc style JavaScript comment.
JavaScriptNumber  +A JavaScript number.
JavaScriptWord  +A JavaScript word.
JavaScriptKeyword  +A JavaScript keyword.
JavaScriptDoubleQuotedString  +A JavaScript double-quoted string.
JavaScriptSingleQuotedString  +A JavaScript single-quoted string.
JavaScriptSymbol  +A JavaScript symbol.
JavaScriptUnclosedString  +The end of a JavaScript line where a string is not closed.
JavaScriptRegex  +A JavaScript regular expression.
ASPJavaScriptStart  +The start of an ASP JavaScript fragment.
ASPJavaScriptDefault  +The default for ASP JavaScript.
ASPJavaScriptComment  +An ASP JavaScript comment.
ASPJavaScriptCommentLine  +An ASP JavaScript line comment.
ASPJavaScriptCommentDoc  +An ASP JavaDoc style JavaScript comment.
ASPJavaScriptNumber  +An ASP JavaScript number.
ASPJavaScriptWord  +An ASP JavaScript word.
ASPJavaScriptKeyword  +An ASP JavaScript keyword.
ASPJavaScriptDoubleQuotedString  +An ASP JavaScript double-quoted string.
ASPJavaScriptSingleQuotedString  +An ASP JavaScript single-quoted string.
ASPJavaScriptSymbol  +An ASP JavaScript symbol.
ASPJavaScriptUnclosedString  +The end of an ASP JavaScript line where a string is not closed.
ASPJavaScriptRegex  +An ASP JavaScript regular expression.
VBScriptStart  +The start of a VBScript fragment.
VBScriptDefault  +The default for VBScript.
VBScriptComment  +A VBScript comment.
VBScriptNumber  +A VBScript number.
VBScriptKeyword  +A VBScript keyword.
VBScriptString  +A VBScript string.
VBScriptIdentifier  +A VBScript identifier.
VBScriptUnclosedString  +The end of a VBScript line where a string is not closed.
ASPVBScriptStart  +The start of an ASP VBScript fragment.
ASPVBScriptDefault  +The default for ASP VBScript.
ASPVBScriptComment  +An ASP VBScript comment.
ASPVBScriptNumber  +An ASP VBScript number.
ASPVBScriptKeyword  +An ASP VBScript keyword.
ASPVBScriptString  +An ASP VBScript string.
ASPVBScriptIdentifier  +An ASP VBScript identifier.
ASPVBScriptUnclosedString  +The end of an ASP VBScript line where a string is not closed.
PythonStart  +The start of a Python fragment.
PythonDefault  +The default for Python.
PythonComment  +A Python comment.
PythonNumber  +A Python number.
PythonDoubleQuotedString  +A Python double-quoted string.
PythonSingleQuotedString  +A Python single-quoted string.
PythonKeyword  +A Python keyword.
PythonTripleSingleQuotedString  +A Python triple single-quoted string.
PythonTripleDoubleQuotedString  +A Python triple double-quoted string.
PythonClassName  +The name of a Python class.
PythonFunctionMethodName  +The name of a Python function or method.
PythonOperator  +A Python operator.
PythonIdentifier  +A Python identifier.
ASPPythonStart  +The start of an ASP Python fragment.
ASPPythonDefault  +The default for ASP Python.
ASPPythonComment  +An ASP Python comment.
ASPPythonNumber  +An ASP Python number.
ASPPythonDoubleQuotedString  +An ASP Python double-quoted string.
ASPPythonSingleQuotedString  +An ASP Python single-quoted string.
ASPPythonKeyword  +An ASP Python keyword.
ASPPythonTripleSingleQuotedString  +An ASP Python triple single-quoted string.
ASPPythonTripleDoubleQuotedString  +An ASP Python triple double-quoted string.
ASPPythonClassName  +The name of an ASP Python class.
ASPPythonFunctionMethodName  +The name of an ASP Python function or method.
ASPPythonOperator  +An ASP Python operator.
ASPPythonIdentifier  +An ASP Python identifier.
PHPDefault  +The default for PHP.
PHPDoubleQuotedString  +A PHP double-quoted string.
PHPSingleQuotedString  +A PHP single-quoted string.
PHPKeyword  +A PHP keyword.
PHPNumber  +A PHP number.
PHPVariable  +A PHP variable.
PHPComment  +A PHP comment.
PHPCommentLine  +A PHP line comment.
PHPDoubleQuotedVariable  +A PHP double-quoted variable.
PHPOperator  +A PHP operator.
+
+ +
+

+


Constructor & Destructor Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + +
QextScintillaLexerHTML::QextScintillaLexerHTML (QObject *  parent = 0,
const char *  name = 0 
)
+
+
+ +

+Construct a QextScintillaLexerHTML with parent parent and name name. parent is typically the QextScintilla instance. +

+

+ +

+
+ + + + + + + + +
virtual QextScintillaLexerHTML::~QextScintillaLexerHTML (  )  [virtual]
+
+
+ +

+Destroys the QextScintillaLexerHTML instance. +

+ +

+

+


Member Function Documentation

+ +
+
+ + + + + + + + +
const char* QextScintillaLexerHTML::language (  )  const [virtual]
+
+
+ +

+Returns the name of the language. +

+ +

+Implements QextScintillaLexer. +

+

+ +

+
+ + + + + + + + +
const char* QextScintillaLexerHTML::lexer (  )  const [virtual]
+
+
+ +

+Returns the name of the lexer. Some lexers support a number of languages. +

+Implements QextScintillaLexer. +

+

+ +

+
+ + + + + + + + + +
QColor QextScintillaLexerHTML::color (int  style  )  const [virtual]
+
+
+ +

+Returns the foreground colour of the text for style number style.

+

See also:
paper()
+ +

+Reimplemented from QextScintillaLexer. +

+

+ +

+
+ + + + + + + + + +
bool QextScintillaLexerHTML::eolFill (int  style  )  const [virtual]
+
+
+ +

+Returns the end-of-line fill for style number style. +

+ +

+Reimplemented from QextScintillaLexer. +

+

+ +

+
+ + + + + + + + + +
QFont QextScintillaLexerHTML::font (int  style  )  const [virtual]
+
+
+ +

+Returns the font for style number style. +

+ +

+Reimplemented from QextScintillaLexer. +

+

+ +

+
+ + + + + + + + + +
const char* QextScintillaLexerHTML::keywords (int  set  )  const [virtual]
+
+
+ +

+Returns the set of keywords for the keyword set set recognised by the lexer as a space separated string. +

+Reimplemented from QextScintillaLexer. +

+

+ +

+
+ + + + + + + + + +
QString QextScintillaLexerHTML::description (int  style  )  const [virtual]
+
+
+ +

+Returns the descriptive name for style number style. If the style is invalid for this language then QString::null is returned. This is intended to be used in user preference dialogs. +

+Implements QextScintillaLexer. +

+

+ +

+
+ + + + + + + + + +
QColor QextScintillaLexerHTML::paper (int  style  )  const [virtual]
+
+
+ +

+Returns the background colour of the text for style number style.

+

See also:
color()
+ +

+Reimplemented from QextScintillaLexer. +

+

+ +

+
+ + + + + + + + +
void QextScintillaLexerHTML::refreshProperties (  )  [virtual]
+
+
+ +

+Causes all properties to be refreshed by emitting the propertyChanged() signal as required. +

+Reimplemented from QextScintillaLexer. +

+

+ +

+
+ + + + + + + + +
bool QextScintillaLexerHTML::foldCompact (  )  const
+
+
+ +

+Returns TRUE if trailing blank lines are included in a fold block.

+

See also:
setFoldCompact()
+ +
+

+ +

+
+ + + + + + + + +
bool QextScintillaLexerHTML::foldPreprocessor (  )  const
+
+
+ +

+Returns TRUE if preprocessor blocks can be folded.

+

See also:
setFoldPreprocessor()
+ +
+

+ +

+
+ + + + + + + + +
bool QextScintillaLexerHTML::caseSensitiveTags (  )  const
+
+
+ +

+Returns TRUE if tags are case sensitive.

+

See also:
setCaseSensitiveTags()
+ +
+

+ +

+
+ + + + + + + + + +
virtual void QextScintillaLexerHTML::setFoldCompact (bool  fold  )  [virtual, slot]
+
+
+ +

+If fold is TRUE then trailing blank lines are included in a fold block. The default is TRUE.

+

See also:
foldCompact()
+ +
+

+ +

+
+ + + + + + + + + +
virtual void QextScintillaLexerHTML::setFoldPreprocessor (bool  fold  )  [virtual, slot]
+
+
+ +

+If fold is TRUE then preprocessor blocks can be folded. The default is FALSE.

+

See also:
foldPreprocessor()
+ +
+

+ +

+
+ + + + + + + + + +
virtual void QextScintillaLexerHTML::setCaseSensitiveTags (bool  sens  )  [virtual, slot]
+
+
+ +

+If sens is TRUE then tags are case sensitive. The default is FALSE.

+

See also:
caseSensitiveTags()
+ +
+

+ +

+
+ + + + + + + + + + + + + + + + + + +
bool QextScintillaLexerHTML::readProperties (QSettings &  qs,
const QString &  prefix 
) [protected, virtual]
+
+
+ +

+The lexer's properties are read from the settings qs. prefix (which has a trailing '/') should be used as a prefix to the key of each setting. TRUE is returned if there is no error. +

+Reimplemented from QextScintillaLexer. +

+

+ +

+
+ + + + + + + + + + + + + + + + + + +
bool QextScintillaLexerHTML::writeProperties (QSettings &  qs,
const QString &  prefix 
) const [protected, virtual]
+
+
+ +

+The lexer's properties are written to the settings qs. prefix (which has a trailing '/') should be used as a prefix to the key of each setting. TRUE is returned if there is no error. +

+Reimplemented from QextScintillaLexer. +

+

+


Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/classQextScintillaLexerIDL-members.html b/doc/html/classQextScintillaLexerIDL-members.html new file mode 100644 index 0000000..fb5ed10 --- /dev/null +++ b/doc/html/classQextScintillaLexerIDL-members.html @@ -0,0 +1,101 @@ + + +QScintilla: Member List + + + + + + +

QextScintillaLexerIDL Member List

This is the complete list of members for QextScintillaLexerIDL, including all inherited members.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
autoCompletionFillups() const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
autoCompletionStartCharacters() const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
autoIndentStyle()QextScintillaLexer
blockEnd(int *style=0) const (defined in QextScintillaLexerCPP)QextScintillaLexerCPP [virtual]
blockLookback() const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
blockStart(int *style=0) const (defined in QextScintillaLexerCPP)QextScintillaLexerCPP [virtual]
blockStartKeyword(int *style=0) const (defined in QextScintillaLexerCPP)QextScintillaLexerCPP [virtual]
braceStyle() const (defined in QextScintillaLexerCPP)QextScintillaLexerCPP [virtual]
color(int style) const QextScintillaLexerIDL [virtual]
colorChanged(const QColor &c, int style)QextScintillaLexer [signal]
Comment enum valueQextScintillaLexerCPP
CommentDoc enum valueQextScintillaLexerCPP
CommentDocKeyword enum valueQextScintillaLexerCPP
CommentDocKeywordError enum valueQextScintillaLexerCPP
CommentLine enum valueQextScintillaLexerCPP
CommentLineDoc enum valueQextScintillaLexerCPP
Default enum valueQextScintillaLexerCPP
defaultColor() const QextScintillaLexer [virtual]
defaultFont() const QextScintillaLexer [virtual]
defaultPaper() const QextScintillaLexer [virtual]
defaultStyle() const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
description(int style) const QextScintillaLexerIDL [virtual]
DoubleQuotedString enum valueQextScintillaLexerCPP
eolFill(int style) const QextScintillaLexerCPP [virtual]
eolFillChanged(bool eoffilled, int style)QextScintillaLexer [signal]
foldAtElse() const QextScintillaLexerCPP
foldComments() const QextScintillaLexerCPP
foldCompact() const QextScintillaLexerCPP
foldPreprocessor() const QextScintillaLexerCPP
font(int style) const QextScintillaLexerCPP [virtual]
fontChanged(const QFont &f, int style)QextScintillaLexer [signal]
GlobalClass enum valueQextScintillaLexerCPP
Identifier enum valueQextScintillaLexerCPP
Keyword enum valueQextScintillaLexerCPP
keywords(int set) const QextScintillaLexerIDL [virtual]
KeywordSet2 enum valueQextScintillaLexerCPP
language() const QextScintillaLexerIDL [virtual]
lexer() const QextScintillaLexerCPP [virtual]
Number enum valueQextScintillaLexerCPP
Operator enum valueQextScintillaLexerCPP
paper(int style) const QextScintillaLexerCPP [virtual]
paperChanged(const QColor &c, int style)QextScintillaLexer [signal]
PreProcessor enum valueQextScintillaLexerCPP
propertyChanged(const char *prop, const char *val)QextScintillaLexer [signal]
QextScintillaLexer(QObject *parent=0, const char *name=0)QextScintillaLexer
QextScintillaLexerCPP(QObject *parent=0, const char *name=0, bool caseInsensitiveKeywords=FALSE)QextScintillaLexerCPP
QextScintillaLexerIDL(QObject *parent=0, const char *name=0)QextScintillaLexerIDL
readProperties(QSettings &qs, const QString &prefix)QextScintillaLexerCPP [protected, virtual]
readSettings(QSettings &qs, const char *prefix="/Scintilla")QextScintillaLexer
refreshProperties()QextScintillaLexerCPP [virtual]
Regex enum valueQextScintillaLexerCPP
setAutoIndentStyle(int autoindentstyle)QextScintillaLexer [virtual, slot]
setColor(const QColor &c, int style=-1)QextScintillaLexer [virtual, slot]
setDefaultColor(const QColor &c)QextScintillaLexer [virtual, slot]
setDefaultFont(const QFont &f)QextScintillaLexer [virtual, slot]
setDefaultPaper(const QColor &c)QextScintillaLexer [virtual, slot]
setEolFill(bool eoffill, int style=-1)QextScintillaLexer [virtual, slot]
setFoldAtElse(bool fold)QextScintillaLexerCPP [virtual, slot]
setFoldComments(bool fold)QextScintillaLexerCPP [virtual, slot]
setFoldCompact(bool fold)QextScintillaLexerCPP [virtual, slot]
setFoldPreprocessor(bool fold)QextScintillaLexerCPP [virtual, slot]
setFont(const QFont &f, int style=-1)QextScintillaLexer [virtual, slot]
setPaper(const QColor &c, int style=-1)QextScintillaLexer [virtual, slot]
setStylePreprocessor(bool style)QextScintillaLexerCPP [virtual, slot]
SingleQuotedString enum valueQextScintillaLexerCPP
stylePreprocessor() const QextScintillaLexerCPP
UnclosedString enum valueQextScintillaLexerCPP
UUID enum valueQextScintillaLexerCPP
VerbatimString enum valueQextScintillaLexerCPP
WhiteSpace enum valueQextScintillaLexerCPP
wordCharacters() const (defined in QextScintillaLexerCPP)QextScintillaLexerCPP [virtual]
writeProperties(QSettings &qs, const QString &prefix) const QextScintillaLexerCPP [protected, virtual]
writeSettings(QSettings &qs, const char *prefix="/Scintilla") const QextScintillaLexer
~QextScintillaLexer()QextScintillaLexer [virtual]
~QextScintillaLexerCPP()QextScintillaLexerCPP [virtual]
~QextScintillaLexerIDL()QextScintillaLexerIDL [virtual]


Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/classQextScintillaLexerIDL.html b/doc/html/classQextScintillaLexerIDL.html new file mode 100644 index 0000000..82aad2f --- /dev/null +++ b/doc/html/classQextScintillaLexerIDL.html @@ -0,0 +1,186 @@ + + +QScintilla: QextScintillaLexerIDL Class Reference + + + + + + +

QextScintillaLexerIDL Class Reference

The QextScintillaLexerIDL class encapsulates the Scintilla IDL lexer. +More... +

+#include <qextscintillalexeridl.h> +

+Inherits QextScintillaLexerCPP. +

+List of all members.

Public Member Functions

+ +

Detailed Description

+The QextScintillaLexerIDL class encapsulates the Scintilla IDL lexer. +

+


Constructor & Destructor Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + +
QextScintillaLexerIDL::QextScintillaLexerIDL (QObject *  parent = 0,
const char *  name = 0 
)
+
+
+ +

+Construct a QextScintillaLexerIDL with parent parent and name name. parent is typically the QextScintilla instance. +

+

+ +

+
+ + + + + + + + +
virtual QextScintillaLexerIDL::~QextScintillaLexerIDL (  )  [virtual]
+
+
+ +

+Destroys the QextScintillaLexerIDL instance. +

+ +

+

+


Member Function Documentation

+ +
+
+ + + + + + + + +
const char* QextScintillaLexerIDL::language (  )  const [virtual]
+
+
+ +

+Returns the name of the language. +

+ +

+Reimplemented from QextScintillaLexerCPP. +

+

+ +

+
+ + + + + + + + + +
QColor QextScintillaLexerIDL::color (int  style  )  const [virtual]
+
+
+ +

+Returns the foreground colour of the text for style number style.

+

See also:
paper()
+ +

+Reimplemented from QextScintillaLexerCPP. +

+

+ +

+
+ + + + + + + + + +
const char* QextScintillaLexerIDL::keywords (int  set  )  const [virtual]
+
+
+ +

+Returns the set of keywords for the keyword set set recognised by the lexer as a space separated string. +

+Reimplemented from QextScintillaLexerCPP. +

+

+ +

+
+ + + + + + + + + +
QString QextScintillaLexerIDL::description (int  style  )  const [virtual]
+
+
+ +

+Returns the descriptive name for style number style. If the style is invalid for this language then QString::null is returned. This is intended to be used in user preference dialogs. +

+Reimplemented from QextScintillaLexerCPP. +

+

+


Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/classQextScintillaLexerJava-members.html b/doc/html/classQextScintillaLexerJava-members.html new file mode 100644 index 0000000..e5eb10a --- /dev/null +++ b/doc/html/classQextScintillaLexerJava-members.html @@ -0,0 +1,101 @@ + + +QScintilla: Member List + + + + + + +

QextScintillaLexerJava Member List

This is the complete list of members for QextScintillaLexerJava, including all inherited members.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
autoCompletionFillups() const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
autoCompletionStartCharacters() const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
autoIndentStyle()QextScintillaLexer
blockEnd(int *style=0) const (defined in QextScintillaLexerCPP)QextScintillaLexerCPP [virtual]
blockLookback() const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
blockStart(int *style=0) const (defined in QextScintillaLexerCPP)QextScintillaLexerCPP [virtual]
blockStartKeyword(int *style=0) const (defined in QextScintillaLexerCPP)QextScintillaLexerCPP [virtual]
braceStyle() const (defined in QextScintillaLexerCPP)QextScintillaLexerCPP [virtual]
color(int style) const QextScintillaLexerCPP [virtual]
colorChanged(const QColor &c, int style)QextScintillaLexer [signal]
Comment enum valueQextScintillaLexerCPP
CommentDoc enum valueQextScintillaLexerCPP
CommentDocKeyword enum valueQextScintillaLexerCPP
CommentDocKeywordError enum valueQextScintillaLexerCPP
CommentLine enum valueQextScintillaLexerCPP
CommentLineDoc enum valueQextScintillaLexerCPP
Default enum valueQextScintillaLexerCPP
defaultColor() const QextScintillaLexer [virtual]
defaultFont() const QextScintillaLexer [virtual]
defaultPaper() const QextScintillaLexer [virtual]
defaultStyle() const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
description(int style) const QextScintillaLexerCPP [virtual]
DoubleQuotedString enum valueQextScintillaLexerCPP
eolFill(int style) const QextScintillaLexerCPP [virtual]
eolFillChanged(bool eoffilled, int style)QextScintillaLexer [signal]
foldAtElse() const QextScintillaLexerCPP
foldComments() const QextScintillaLexerCPP
foldCompact() const QextScintillaLexerCPP
foldPreprocessor() const QextScintillaLexerCPP
font(int style) const QextScintillaLexerCPP [virtual]
fontChanged(const QFont &f, int style)QextScintillaLexer [signal]
GlobalClass enum valueQextScintillaLexerCPP
Identifier enum valueQextScintillaLexerCPP
Keyword enum valueQextScintillaLexerCPP
keywords(int set) const QextScintillaLexerJava [virtual]
KeywordSet2 enum valueQextScintillaLexerCPP
language() const QextScintillaLexerJava [virtual]
lexer() const QextScintillaLexerCPP [virtual]
Number enum valueQextScintillaLexerCPP
Operator enum valueQextScintillaLexerCPP
paper(int style) const QextScintillaLexerCPP [virtual]
paperChanged(const QColor &c, int style)QextScintillaLexer [signal]
PreProcessor enum valueQextScintillaLexerCPP
propertyChanged(const char *prop, const char *val)QextScintillaLexer [signal]
QextScintillaLexer(QObject *parent=0, const char *name=0)QextScintillaLexer
QextScintillaLexerCPP(QObject *parent=0, const char *name=0, bool caseInsensitiveKeywords=FALSE)QextScintillaLexerCPP
QextScintillaLexerJava(QObject *parent=0, const char *name=0)QextScintillaLexerJava
readProperties(QSettings &qs, const QString &prefix)QextScintillaLexerCPP [protected, virtual]
readSettings(QSettings &qs, const char *prefix="/Scintilla")QextScintillaLexer
refreshProperties()QextScintillaLexerCPP [virtual]
Regex enum valueQextScintillaLexerCPP
setAutoIndentStyle(int autoindentstyle)QextScintillaLexer [virtual, slot]
setColor(const QColor &c, int style=-1)QextScintillaLexer [virtual, slot]
setDefaultColor(const QColor &c)QextScintillaLexer [virtual, slot]
setDefaultFont(const QFont &f)QextScintillaLexer [virtual, slot]
setDefaultPaper(const QColor &c)QextScintillaLexer [virtual, slot]
setEolFill(bool eoffill, int style=-1)QextScintillaLexer [virtual, slot]
setFoldAtElse(bool fold)QextScintillaLexerCPP [virtual, slot]
setFoldComments(bool fold)QextScintillaLexerCPP [virtual, slot]
setFoldCompact(bool fold)QextScintillaLexerCPP [virtual, slot]
setFoldPreprocessor(bool fold)QextScintillaLexerCPP [virtual, slot]
setFont(const QFont &f, int style=-1)QextScintillaLexer [virtual, slot]
setPaper(const QColor &c, int style=-1)QextScintillaLexer [virtual, slot]
setStylePreprocessor(bool style)QextScintillaLexerCPP [virtual, slot]
SingleQuotedString enum valueQextScintillaLexerCPP
stylePreprocessor() const QextScintillaLexerCPP
UnclosedString enum valueQextScintillaLexerCPP
UUID enum valueQextScintillaLexerCPP
VerbatimString enum valueQextScintillaLexerCPP
WhiteSpace enum valueQextScintillaLexerCPP
wordCharacters() const (defined in QextScintillaLexerCPP)QextScintillaLexerCPP [virtual]
writeProperties(QSettings &qs, const QString &prefix) const QextScintillaLexerCPP [protected, virtual]
writeSettings(QSettings &qs, const char *prefix="/Scintilla") const QextScintillaLexer
~QextScintillaLexer()QextScintillaLexer [virtual]
~QextScintillaLexerCPP()QextScintillaLexerCPP [virtual]
~QextScintillaLexerJava()QextScintillaLexerJava [virtual]


Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/classQextScintillaLexerJava.html b/doc/html/classQextScintillaLexerJava.html new file mode 100644 index 0000000..5d5dab2 --- /dev/null +++ b/doc/html/classQextScintillaLexerJava.html @@ -0,0 +1,138 @@ + + +QScintilla: QextScintillaLexerJava Class Reference + + + + + + +

QextScintillaLexerJava Class Reference

The QextScintillaLexerJava class encapsulates the Scintilla Java lexer. +More... +

+#include <qextscintillalexerjava.h> +

+Inherits QextScintillaLexerCPP. +

+List of all members.

Public Member Functions

+ +

Detailed Description

+The QextScintillaLexerJava class encapsulates the Scintilla Java lexer. +

+


Constructor & Destructor Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + +
QextScintillaLexerJava::QextScintillaLexerJava (QObject *  parent = 0,
const char *  name = 0 
)
+
+
+ +

+Construct a QextScintillaLexerJava with parent parent and name name. parent is typically the QextScintilla instance. +

+

+ +

+
+ + + + + + + + +
virtual QextScintillaLexerJava::~QextScintillaLexerJava (  )  [virtual]
+
+
+ +

+Destroys the QextScintillaLexerJava instance. +

+ +

+

+


Member Function Documentation

+ +
+
+ + + + + + + + +
const char* QextScintillaLexerJava::language (  )  const [virtual]
+
+
+ +

+Returns the name of the language. +

+ +

+Reimplemented from QextScintillaLexerCPP. +

+

+ +

+
+ + + + + + + + + +
const char* QextScintillaLexerJava::keywords (int  set  )  const [virtual]
+
+
+ +

+Returns the set of keywords for the keyword set set recognised by the lexer as a space separated string. +

+Reimplemented from QextScintillaLexerCPP. +

+

+


Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/classQextScintillaLexerJavaScript-members.html b/doc/html/classQextScintillaLexerJavaScript-members.html new file mode 100644 index 0000000..7c8f911 --- /dev/null +++ b/doc/html/classQextScintillaLexerJavaScript-members.html @@ -0,0 +1,101 @@ + + +QScintilla: Member List + + + + + + +

QextScintillaLexerJavaScript Member List

This is the complete list of members for QextScintillaLexerJavaScript, including all inherited members.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
autoCompletionFillups() const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
autoCompletionStartCharacters() const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
autoIndentStyle()QextScintillaLexer
blockEnd(int *style=0) const (defined in QextScintillaLexerCPP)QextScintillaLexerCPP [virtual]
blockLookback() const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
blockStart(int *style=0) const (defined in QextScintillaLexerCPP)QextScintillaLexerCPP [virtual]
blockStartKeyword(int *style=0) const (defined in QextScintillaLexerCPP)QextScintillaLexerCPP [virtual]
braceStyle() const (defined in QextScintillaLexerCPP)QextScintillaLexerCPP [virtual]
color(int style) const QextScintillaLexerJavaScript [virtual]
colorChanged(const QColor &c, int style)QextScintillaLexer [signal]
Comment enum valueQextScintillaLexerCPP
CommentDoc enum valueQextScintillaLexerCPP
CommentDocKeyword enum valueQextScintillaLexerCPP
CommentDocKeywordError enum valueQextScintillaLexerCPP
CommentLine enum valueQextScintillaLexerCPP
CommentLineDoc enum valueQextScintillaLexerCPP
Default enum valueQextScintillaLexerCPP
defaultColor() const QextScintillaLexer [virtual]
defaultFont() const QextScintillaLexer [virtual]
defaultPaper() const QextScintillaLexer [virtual]
defaultStyle() const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
description(int style) const QextScintillaLexerJavaScript [virtual]
DoubleQuotedString enum valueQextScintillaLexerCPP
eolFill(int style) const QextScintillaLexerJavaScript [virtual]
eolFillChanged(bool eoffilled, int style)QextScintillaLexer [signal]
foldAtElse() const QextScintillaLexerCPP
foldComments() const QextScintillaLexerCPP
foldCompact() const QextScintillaLexerCPP
foldPreprocessor() const QextScintillaLexerCPP
font(int style) const QextScintillaLexerJavaScript [virtual]
fontChanged(const QFont &f, int style)QextScintillaLexer [signal]
GlobalClass enum valueQextScintillaLexerCPP
Identifier enum valueQextScintillaLexerCPP
Keyword enum valueQextScintillaLexerCPP
keywords(int set) const QextScintillaLexerJavaScript [virtual]
KeywordSet2 enum valueQextScintillaLexerCPP
language() const QextScintillaLexerJavaScript [virtual]
lexer() const QextScintillaLexerCPP [virtual]
Number enum valueQextScintillaLexerCPP
Operator enum valueQextScintillaLexerCPP
paper(int style) const QextScintillaLexerJavaScript [virtual]
paperChanged(const QColor &c, int style)QextScintillaLexer [signal]
PreProcessor enum valueQextScintillaLexerCPP
propertyChanged(const char *prop, const char *val)QextScintillaLexer [signal]
QextScintillaLexer(QObject *parent=0, const char *name=0)QextScintillaLexer
QextScintillaLexerCPP(QObject *parent=0, const char *name=0, bool caseInsensitiveKeywords=FALSE)QextScintillaLexerCPP
QextScintillaLexerJavaScript(QObject *parent=0, const char *name=0)QextScintillaLexerJavaScript
readProperties(QSettings &qs, const QString &prefix)QextScintillaLexerCPP [protected, virtual]
readSettings(QSettings &qs, const char *prefix="/Scintilla")QextScintillaLexer
refreshProperties()QextScintillaLexerCPP [virtual]
Regex enum valueQextScintillaLexerCPP
setAutoIndentStyle(int autoindentstyle)QextScintillaLexer [virtual, slot]
setColor(const QColor &c, int style=-1)QextScintillaLexer [virtual, slot]
setDefaultColor(const QColor &c)QextScintillaLexer [virtual, slot]
setDefaultFont(const QFont &f)QextScintillaLexer [virtual, slot]
setDefaultPaper(const QColor &c)QextScintillaLexer [virtual, slot]
setEolFill(bool eoffill, int style=-1)QextScintillaLexer [virtual, slot]
setFoldAtElse(bool fold)QextScintillaLexerCPP [virtual, slot]
setFoldComments(bool fold)QextScintillaLexerCPP [virtual, slot]
setFoldCompact(bool fold)QextScintillaLexerCPP [virtual, slot]
setFoldPreprocessor(bool fold)QextScintillaLexerCPP [virtual, slot]
setFont(const QFont &f, int style=-1)QextScintillaLexer [virtual, slot]
setPaper(const QColor &c, int style=-1)QextScintillaLexer [virtual, slot]
setStylePreprocessor(bool style)QextScintillaLexerCPP [virtual, slot]
SingleQuotedString enum valueQextScintillaLexerCPP
stylePreprocessor() const QextScintillaLexerCPP
UnclosedString enum valueQextScintillaLexerCPP
UUID enum valueQextScintillaLexerCPP
VerbatimString enum valueQextScintillaLexerCPP
WhiteSpace enum valueQextScintillaLexerCPP
wordCharacters() const (defined in QextScintillaLexerCPP)QextScintillaLexerCPP [virtual]
writeProperties(QSettings &qs, const QString &prefix) const QextScintillaLexerCPP [protected, virtual]
writeSettings(QSettings &qs, const char *prefix="/Scintilla") const QextScintillaLexer
~QextScintillaLexer()QextScintillaLexer [virtual]
~QextScintillaLexerCPP()QextScintillaLexerCPP [virtual]
~QextScintillaLexerJavaScript()QextScintillaLexerJavaScript [virtual]


Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/classQextScintillaLexerJavaScript.html b/doc/html/classQextScintillaLexerJavaScript.html new file mode 100644 index 0000000..5a31904 --- /dev/null +++ b/doc/html/classQextScintillaLexerJavaScript.html @@ -0,0 +1,261 @@ + + +QScintilla: QextScintillaLexerJavaScript Class Reference + + + + + + +

QextScintillaLexerJavaScript Class Reference

The QextScintillaLexerJavaScript class encapsulates the Scintilla JavaScript lexer. +More... +

+#include <qextscintillalexerjavascript.h> +

+Inherits QextScintillaLexerCPP. +

+List of all members.

Public Member Functions

+ +

Detailed Description

+The QextScintillaLexerJavaScript class encapsulates the Scintilla JavaScript lexer. +

+


Constructor & Destructor Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + +
QextScintillaLexerJavaScript::QextScintillaLexerJavaScript (QObject *  parent = 0,
const char *  name = 0 
)
+
+
+ +

+Construct a QextScintillaLexerJavaScript with parent parent and name name. parent is typically the QextScintilla instance. +

+

+ +

+
+ + + + + + + + +
virtual QextScintillaLexerJavaScript::~QextScintillaLexerJavaScript (  )  [virtual]
+
+
+ +

+Destroys the QextScintillaLexerJavaScript instance. +

+ +

+

+


Member Function Documentation

+ +
+
+ + + + + + + + +
const char* QextScintillaLexerJavaScript::language (  )  const [virtual]
+
+
+ +

+Returns the name of the language. +

+ +

+Reimplemented from QextScintillaLexerCPP. +

+

+ +

+
+ + + + + + + + + +
QColor QextScintillaLexerJavaScript::color (int  style  )  const [virtual]
+
+
+ +

+Returns the foreground colour of the text for style number style.

+

See also:
paper()
+ +

+Reimplemented from QextScintillaLexerCPP. +

+

+ +

+
+ + + + + + + + + +
bool QextScintillaLexerJavaScript::eolFill (int  style  )  const [virtual]
+
+
+ +

+Returns the end-of-line fill for style number style. +

+ +

+Reimplemented from QextScintillaLexerCPP. +

+

+ +

+
+ + + + + + + + + +
QFont QextScintillaLexerJavaScript::font (int  style  )  const [virtual]
+
+
+ +

+Returns the font for style number style. +

+ +

+Reimplemented from QextScintillaLexerCPP. +

+

+ +

+
+ + + + + + + + + +
const char* QextScintillaLexerJavaScript::keywords (int  set  )  const [virtual]
+
+
+ +

+Returns the set of keywords for the keyword set set recognised by the lexer as a space separated string. +

+Reimplemented from QextScintillaLexerCPP. +

+

+ +

+
+ + + + + + + + + +
QString QextScintillaLexerJavaScript::description (int  style  )  const [virtual]
+
+
+ +

+Returns the descriptive name for style number style. If the style is invalid for this language then QString::null is returned. This is intended to be used in user preference dialogs. +

+Reimplemented from QextScintillaLexerCPP. +

+

+ +

+
+ + + + + + + + + +
QColor QextScintillaLexerJavaScript::paper (int  style  )  const [virtual]
+
+
+ +

+Returns the background colour of the text for style number style.

+

See also:
color()
+ +

+Reimplemented from QextScintillaLexerCPP. +

+

+


Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/classQextScintillaLexerLua-members.html b/doc/html/classQextScintillaLexerLua-members.html new file mode 100644 index 0000000..2fd15cc --- /dev/null +++ b/doc/html/classQextScintillaLexerLua-members.html @@ -0,0 +1,85 @@ + + +QScintilla: Member List + + + + + + +

QextScintillaLexerLua Member List

This is the complete list of members for QextScintillaLexerLua, including all inherited members.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
autoCompletionFillups() const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
autoCompletionStartCharacters() const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
autoIndentStyle()QextScintillaLexer
BasicFunctions enum valueQextScintillaLexerLua
blockEnd(int *style=0) const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
blockLookback() const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
blockStart(int *style=0) const (defined in QextScintillaLexerLua)QextScintillaLexerLua [virtual]
blockStartKeyword(int *style=0) const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
braceStyle() const (defined in QextScintillaLexerLua)QextScintillaLexerLua [virtual]
Character enum valueQextScintillaLexerLua
color(int style) const QextScintillaLexerLua [virtual]
colorChanged(const QColor &c, int style)QextScintillaLexer [signal]
Comment enum valueQextScintillaLexerLua
CoroutinesIOSystemFacilities enum valueQextScintillaLexerLua
Default enum valueQextScintillaLexerLua
defaultColor() const QextScintillaLexer [virtual]
defaultFont() const QextScintillaLexer [virtual]
defaultPaper() const QextScintillaLexer [virtual]
defaultStyle() const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
description(int style) const QextScintillaLexerLua [virtual]
eolFill(int style) const QextScintillaLexerLua [virtual]
eolFillChanged(bool eoffilled, int style)QextScintillaLexer [signal]
foldCompact() const QextScintillaLexerLua
font(int style) const QextScintillaLexerLua [virtual]
fontChanged(const QFont &f, int style)QextScintillaLexer [signal]
Identifier enum valueQextScintillaLexerLua
Keyword enum valueQextScintillaLexerLua
keywords(int set) const QextScintillaLexerLua [virtual]
language() const QextScintillaLexerLua [virtual]
lexer() const QextScintillaLexerLua [virtual]
LineComment enum valueQextScintillaLexerLua
LiteralString enum valueQextScintillaLexerLua
Number enum valueQextScintillaLexerLua
Operator enum valueQextScintillaLexerLua
paper(int style) const QextScintillaLexerLua [virtual]
paperChanged(const QColor &c, int style)QextScintillaLexer [signal]
Preprocessor enum valueQextScintillaLexerLua
propertyChanged(const char *prop, const char *val)QextScintillaLexer [signal]
QextScintillaLexer(QObject *parent=0, const char *name=0)QextScintillaLexer
QextScintillaLexerLua(QObject *parent=0, const char *name=0)QextScintillaLexerLua
readProperties(QSettings &qs, const QString &prefix)QextScintillaLexerLua [protected, virtual]
readSettings(QSettings &qs, const char *prefix="/Scintilla")QextScintillaLexer
refreshProperties()QextScintillaLexerLua [virtual]
setAutoIndentStyle(int autoindentstyle)QextScintillaLexer [virtual, slot]
setColor(const QColor &c, int style=-1)QextScintillaLexer [virtual, slot]
setDefaultColor(const QColor &c)QextScintillaLexer [virtual, slot]
setDefaultFont(const QFont &f)QextScintillaLexer [virtual, slot]
setDefaultPaper(const QColor &c)QextScintillaLexer [virtual, slot]
setEolFill(bool eoffill, int style=-1)QextScintillaLexer [virtual, slot]
setFoldCompact(bool fold)QextScintillaLexerLua [virtual, slot]
setFont(const QFont &f, int style=-1)QextScintillaLexer [virtual, slot]
setPaper(const QColor &c, int style=-1)QextScintillaLexer [virtual, slot]
String enum valueQextScintillaLexerLua
StringTableMathsFunctions enum valueQextScintillaLexerLua
UnclosedString enum valueQextScintillaLexerLua
wordCharacters() const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
writeProperties(QSettings &qs, const QString &prefix) const QextScintillaLexerLua [protected, virtual]
writeSettings(QSettings &qs, const char *prefix="/Scintilla") const QextScintillaLexer
~QextScintillaLexer()QextScintillaLexer [virtual]
~QextScintillaLexerLua()QextScintillaLexerLua [virtual]


Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/classQextScintillaLexerLua.html b/doc/html/classQextScintillaLexerLua.html new file mode 100644 index 0000000..31efdad --- /dev/null +++ b/doc/html/classQextScintillaLexerLua.html @@ -0,0 +1,514 @@ + + +QScintilla: QextScintillaLexerLua Class Reference + + + + + + +

QextScintillaLexerLua Class Reference

The QextScintillaLexerLua class encapsulates the Scintilla Lua lexer. +More... +

+#include <qextscintillalexerlua.h> +

+Inherits QextScintillaLexer. +

+List of all members.

Public Types

+ +

Public Slots

+ +

Public Member Functions

+ +

Protected Member Functions

+ +

Detailed Description

+The QextScintillaLexerLua class encapsulates the Scintilla Lua lexer. +

+


Member Enumeration Documentation

+ +
+
+ + + + +
anonymous enum
+
+
+ +

+This enum defines the meanings of the different styles used by the Lua lexer.

Enumerator:
+ + + + + + + + + + + + + + + + +
Default  +The default.
Comment  +A block comment.
LineComment  +A line comment.
Number  +A number.
Keyword  +A keyword.
String  +A string.
Character  +A character.
LiteralString  +A literal string.
Preprocessor  +Preprocessor.
Operator  +An operator.
Identifier  +An identifier.
UnclosedString  +The end of a line where a string is not closed.
BasicFunctions  +Basic functions.
StringTableMathsFunctions  +String, table and maths functions.
CoroutinesIOSystemFacilities  +Coroutines, I/O and system facilities.
+
+ +
+

+


Constructor & Destructor Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + +
QextScintillaLexerLua::QextScintillaLexerLua (QObject *  parent = 0,
const char *  name = 0 
)
+
+
+ +

+Construct a QextScintillaLexerLua with parent parent and name name. parent is typically the QextScintilla instance. +

+

+ +

+
+ + + + + + + + +
virtual QextScintillaLexerLua::~QextScintillaLexerLua (  )  [virtual]
+
+
+ +

+Destroys the QextScintillaLexerLua instance. +

+ +

+

+


Member Function Documentation

+ +
+
+ + + + + + + + +
const char* QextScintillaLexerLua::language (  )  const [virtual]
+
+
+ +

+Returns the name of the language. +

+ +

+Implements QextScintillaLexer. +

+

+ +

+
+ + + + + + + + +
const char* QextScintillaLexerLua::lexer (  )  const [virtual]
+
+
+ +

+Returns the name of the lexer. Some lexers support a number of languages. +

+Implements QextScintillaLexer. +

+

+ +

+
+ + + + + + + + + +
QColor QextScintillaLexerLua::color (int  style  )  const [virtual]
+
+
+ +

+Returns the foreground colour of the text for style number style.

+

See also:
paper()
+ +

+Reimplemented from QextScintillaLexer. +

+

+ +

+
+ + + + + + + + + +
bool QextScintillaLexerLua::eolFill (int  style  )  const [virtual]
+
+
+ +

+Returns the end-of-line fill for style number style. +

+ +

+Reimplemented from QextScintillaLexer. +

+

+ +

+
+ + + + + + + + + +
QFont QextScintillaLexerLua::font (int  style  )  const [virtual]
+
+
+ +

+Returns the font for style number style. +

+ +

+Reimplemented from QextScintillaLexer. +

+

+ +

+
+ + + + + + + + + +
const char* QextScintillaLexerLua::keywords (int  set  )  const [virtual]
+
+
+ +

+Returns the set of keywords for the keyword set set recognised by the lexer as a space separated string. +

+Reimplemented from QextScintillaLexer. +

+

+ +

+
+ + + + + + + + + +
QString QextScintillaLexerLua::description (int  style  )  const [virtual]
+
+
+ +

+Returns the descriptive name for style number style. If the style is invalid for this language then QString::null is returned. This is intended to be used in user preference dialogs. +

+Implements QextScintillaLexer. +

+

+ +

+
+ + + + + + + + + +
QColor QextScintillaLexerLua::paper (int  style  )  const [virtual]
+
+
+ +

+Returns the background colour of the text for style number style.

+

See also:
color()
+ +

+Reimplemented from QextScintillaLexer. +

+

+ +

+
+ + + + + + + + +
void QextScintillaLexerLua::refreshProperties (  )  [virtual]
+
+
+ +

+Causes all properties to be refreshed by emitting the propertyChanged() signal as required. +

+Reimplemented from QextScintillaLexer. +

+

+ +

+
+ + + + + + + + +
bool QextScintillaLexerLua::foldCompact (  )  const
+
+
+ +

+Returns TRUE if trailing blank lines are included in a fold block.

+

See also:
setFoldCompact()
+ +
+

+ +

+
+ + + + + + + + + +
virtual void QextScintillaLexerLua::setFoldCompact (bool  fold  )  [virtual, slot]
+
+
+ +

+If fold is TRUE then trailing blank lines are included in a fold block. The default is TRUE.

+

See also:
foldCompact()
+ +
+

+ +

+
+ + + + + + + + + + + + + + + + + + +
bool QextScintillaLexerLua::readProperties (QSettings &  qs,
const QString &  prefix 
) [protected, virtual]
+
+
+ +

+The lexer's properties are read from the settings qs. prefix (which has a trailing '/') should be used as a prefix to the key of each setting. TRUE is returned if there is no error. +

+Reimplemented from QextScintillaLexer. +

+

+ +

+
+ + + + + + + + + + + + + + + + + + +
bool QextScintillaLexerLua::writeProperties (QSettings &  qs,
const QString &  prefix 
) const [protected, virtual]
+
+
+ +

+The lexer's properties are written to the settings qs. prefix (which has a trailing '/') should be used as a prefix to the key of each setting. TRUE is returned if there is no error. +

+Reimplemented from QextScintillaLexer. +

+

+


Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/classQextScintillaLexerMakefile-members.html b/doc/html/classQextScintillaLexerMakefile-members.html new file mode 100644 index 0000000..857a037 --- /dev/null +++ b/doc/html/classQextScintillaLexerMakefile-members.html @@ -0,0 +1,75 @@ + + +QScintilla: Member List + + + + + + +

QextScintillaLexerMakefile Member List

This is the complete list of members for QextScintillaLexerMakefile, including all inherited members.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
autoCompletionFillups() const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
autoCompletionStartCharacters() const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
autoIndentStyle()QextScintillaLexer
blockEnd(int *style=0) const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
blockLookback() const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
blockStart(int *style=0) const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
blockStartKeyword(int *style=0) const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
braceStyle() const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
color(int style) const QextScintillaLexerMakefile [virtual]
colorChanged(const QColor &c, int style)QextScintillaLexer [signal]
Comment enum valueQextScintillaLexerMakefile
Default enum valueQextScintillaLexerMakefile
defaultColor() const QextScintillaLexer [virtual]
defaultFont() const QextScintillaLexer [virtual]
defaultPaper() const QextScintillaLexer [virtual]
defaultStyle() const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
description(int style) const QextScintillaLexerMakefile [virtual]
eolFill(int style) const QextScintillaLexerMakefile [virtual]
eolFillChanged(bool eoffilled, int style)QextScintillaLexer [signal]
Error enum valueQextScintillaLexerMakefile
font(int style) const QextScintillaLexerMakefile [virtual]
fontChanged(const QFont &f, int style)QextScintillaLexer [signal]
keywords(int set) const QextScintillaLexer [virtual]
language() const QextScintillaLexerMakefile [virtual]
lexer() const QextScintillaLexerMakefile [virtual]
Operator enum valueQextScintillaLexerMakefile
paper(int style) const QextScintillaLexerMakefile [virtual]
paperChanged(const QColor &c, int style)QextScintillaLexer [signal]
Preprocessor enum valueQextScintillaLexerMakefile
propertyChanged(const char *prop, const char *val)QextScintillaLexer [signal]
QextScintillaLexer(QObject *parent=0, const char *name=0)QextScintillaLexer
QextScintillaLexerMakefile(QObject *parent=0, const char *name=0)QextScintillaLexerMakefile
readProperties(QSettings &qs, const QString &prefix)QextScintillaLexer [protected, virtual]
readSettings(QSettings &qs, const char *prefix="/Scintilla")QextScintillaLexer
refreshProperties()QextScintillaLexer [virtual]
setAutoIndentStyle(int autoindentstyle)QextScintillaLexer [virtual, slot]
setColor(const QColor &c, int style=-1)QextScintillaLexer [virtual, slot]
setDefaultColor(const QColor &c)QextScintillaLexer [virtual, slot]
setDefaultFont(const QFont &f)QextScintillaLexer [virtual, slot]
setDefaultPaper(const QColor &c)QextScintillaLexer [virtual, slot]
setEolFill(bool eoffill, int style=-1)QextScintillaLexer [virtual, slot]
setFont(const QFont &f, int style=-1)QextScintillaLexer [virtual, slot]
setPaper(const QColor &c, int style=-1)QextScintillaLexer [virtual, slot]
Target enum valueQextScintillaLexerMakefile
Variable enum valueQextScintillaLexerMakefile
wordCharacters() const (defined in QextScintillaLexerMakefile)QextScintillaLexerMakefile [virtual]
writeProperties(QSettings &qs, const QString &prefix) const QextScintillaLexer [protected, virtual]
writeSettings(QSettings &qs, const char *prefix="/Scintilla") const QextScintillaLexer
~QextScintillaLexer()QextScintillaLexer [virtual]
~QextScintillaLexerMakefile()QextScintillaLexerMakefile [virtual]


Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/classQextScintillaLexerMakefile.html b/doc/html/classQextScintillaLexerMakefile.html new file mode 100644 index 0000000..d7cdec5 --- /dev/null +++ b/doc/html/classQextScintillaLexerMakefile.html @@ -0,0 +1,318 @@ + + +QScintilla: QextScintillaLexerMakefile Class Reference + + + + + + +

QextScintillaLexerMakefile Class Reference

The QextScintillaLexerMakefile class encapsulates the Scintilla Makefile lexer. +More... +

+#include <qextscintillalexermakefile.h> +

+Inherits QextScintillaLexer. +

+List of all members.

Public Types

+ +

Public Member Functions

+ +

Detailed Description

+The QextScintillaLexerMakefile class encapsulates the Scintilla Makefile lexer. +

+


Member Enumeration Documentation

+ +
+
+ + + + +
anonymous enum
+
+
+ +

+This enum defines the meanings of the different styles used by the Makefile lexer.

Enumerator:
+ + + + + + + + +
Default  +The default.
Comment  +A comment.
Preprocessor  +A pre-processor directive.
Variable  +A variable.
Operator  +An operator.
Target  +A target.
Error  +An error.
+
+ +
+

+


Constructor & Destructor Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + +
QextScintillaLexerMakefile::QextScintillaLexerMakefile (QObject *  parent = 0,
const char *  name = 0 
)
+
+
+ +

+Construct a QextScintillaLexerMakefile with parent parent and name name. parent is typically the QextScintilla instance. +

+

+ +

+
+ + + + + + + + +
virtual QextScintillaLexerMakefile::~QextScintillaLexerMakefile (  )  [virtual]
+
+
+ +

+Destroys the QextScintillaLexerMakefile instance. +

+ +

+

+


Member Function Documentation

+ +
+
+ + + + + + + + +
const char* QextScintillaLexerMakefile::language (  )  const [virtual]
+
+
+ +

+Returns the name of the language. +

+ +

+Implements QextScintillaLexer. +

+

+ +

+
+ + + + + + + + +
const char* QextScintillaLexerMakefile::lexer (  )  const [virtual]
+
+
+ +

+Returns the name of the lexer. Some lexers support a number of languages. +

+Implements QextScintillaLexer. +

+

+ +

+
+ + + + + + + + + +
QColor QextScintillaLexerMakefile::color (int  style  )  const [virtual]
+
+
+ +

+Returns the foreground colour of the text for style number style.

+

See also:
paper()
+ +

+Reimplemented from QextScintillaLexer. +

+

+ +

+
+ + + + + + + + + +
bool QextScintillaLexerMakefile::eolFill (int  style  )  const [virtual]
+
+
+ +

+Returns the end-of-line fill for style number style. +

+ +

+Reimplemented from QextScintillaLexer. +

+

+ +

+
+ + + + + + + + + +
QFont QextScintillaLexerMakefile::font (int  style  )  const [virtual]
+
+
+ +

+Returns the font for style number style. +

+ +

+Reimplemented from QextScintillaLexer. +

+

+ +

+
+ + + + + + + + + +
QString QextScintillaLexerMakefile::description (int  style  )  const [virtual]
+
+
+ +

+Returns the descriptive name for style number style. If the style is invalid for this language then QString::null is returned. This is intended to be used in user preference dialogs. +

+Implements QextScintillaLexer. +

+

+ +

+
+ + + + + + + + + +
QColor QextScintillaLexerMakefile::paper (int  style  )  const [virtual]
+
+
+ +

+Returns the background colour of the text for style number style.

+

See also:
color()
+ +

+Reimplemented from QextScintillaLexer. +

+

+


Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/classQextScintillaLexerPOV-members.html b/doc/html/classQextScintillaLexerPOV-members.html new file mode 100644 index 0000000..d35d76c --- /dev/null +++ b/doc/html/classQextScintillaLexerPOV-members.html @@ -0,0 +1,91 @@ + + +QScintilla: Member List + + + + + + +

QextScintillaLexerPOV Member List

This is the complete list of members for QextScintillaLexerPOV, including all inherited members.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
autoCompletionFillups() const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
autoCompletionStartCharacters() const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
autoIndentStyle()QextScintillaLexer
BadDirective enum valueQextScintillaLexerPOV
blockEnd(int *style=0) const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
blockLookback() const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
blockStart(int *style=0) const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
blockStartKeyword(int *style=0) const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
braceStyle() const (defined in QextScintillaLexerPOV)QextScintillaLexerPOV [virtual]
color(int style) const QextScintillaLexerPOV [virtual]
colorChanged(const QColor &c, int style)QextScintillaLexer [signal]
Comment enum valueQextScintillaLexerPOV
CommentLine enum valueQextScintillaLexerPOV
Default enum valueQextScintillaLexerPOV
defaultColor() const QextScintillaLexer [virtual]
defaultFont() const QextScintillaLexer [virtual]
defaultPaper() const QextScintillaLexer [virtual]
defaultStyle() const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
description(int style) const QextScintillaLexerPOV [virtual]
Directive enum valueQextScintillaLexerPOV
eolFill(int style) const QextScintillaLexerPOV [virtual]
eolFillChanged(bool eoffilled, int style)QextScintillaLexer [signal]
foldComments() const QextScintillaLexerPOV
foldCompact() const QextScintillaLexerPOV
foldDirectives() const QextScintillaLexerPOV
font(int style) const QextScintillaLexerPOV [virtual]
fontChanged(const QFont &f, int style)QextScintillaLexer [signal]
Identifier enum valueQextScintillaLexerPOV
keywords(int set) const QextScintillaLexerPOV [virtual]
KeywordSet6 enum valueQextScintillaLexerPOV
KeywordSet7 enum valueQextScintillaLexerPOV
KeywordSet8 enum valueQextScintillaLexerPOV
language() const QextScintillaLexerPOV [virtual]
lexer() const QextScintillaLexerPOV [virtual]
Number enum valueQextScintillaLexerPOV
ObjectsCSGAppearance enum valueQextScintillaLexerPOV
Operator enum valueQextScintillaLexerPOV
paper(int style) const QextScintillaLexerPOV [virtual]
paperChanged(const QColor &c, int style)QextScintillaLexer [signal]
PredefinedFunctions enum valueQextScintillaLexerPOV
PredefinedIdentifiers enum valueQextScintillaLexerPOV
propertyChanged(const char *prop, const char *val)QextScintillaLexer [signal]
QextScintillaLexer(QObject *parent=0, const char *name=0)QextScintillaLexer
QextScintillaLexerPOV(QObject *parent=0, const char *name=0)QextScintillaLexerPOV
readProperties(QSettings &qs, const QString &prefix)QextScintillaLexerPOV [protected, virtual]
readSettings(QSettings &qs, const char *prefix="/Scintilla")QextScintillaLexer
refreshProperties()QextScintillaLexerPOV [virtual]
setAutoIndentStyle(int autoindentstyle)QextScintillaLexer [virtual, slot]
setColor(const QColor &c, int style=-1)QextScintillaLexer [virtual, slot]
setDefaultColor(const QColor &c)QextScintillaLexer [virtual, slot]
setDefaultFont(const QFont &f)QextScintillaLexer [virtual, slot]
setDefaultPaper(const QColor &c)QextScintillaLexer [virtual, slot]
setEolFill(bool eoffill, int style=-1)QextScintillaLexer [virtual, slot]
setFoldComments(bool fold)QextScintillaLexerPOV [virtual, slot]
setFoldCompact(bool fold)QextScintillaLexerPOV [virtual, slot]
setFoldDirectives(bool fold)QextScintillaLexerPOV [virtual, slot]
setFont(const QFont &f, int style=-1)QextScintillaLexer [virtual, slot]
setPaper(const QColor &c, int style=-1)QextScintillaLexer [virtual, slot]
String enum valueQextScintillaLexerPOV
TypesModifiersItems enum valueQextScintillaLexerPOV
UnclosedString enum valueQextScintillaLexerPOV
wordCharacters() const (defined in QextScintillaLexerPOV)QextScintillaLexerPOV [virtual]
writeProperties(QSettings &qs, const QString &prefix) const QextScintillaLexerPOV [protected, virtual]
writeSettings(QSettings &qs, const char *prefix="/Scintilla") const QextScintillaLexer
~QextScintillaLexer()QextScintillaLexer [virtual]
~QextScintillaLexerPOV()QextScintillaLexerPOV [virtual]


Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/classQextScintillaLexerPOV.html b/doc/html/classQextScintillaLexerPOV.html new file mode 100644 index 0000000..b198427 --- /dev/null +++ b/doc/html/classQextScintillaLexerPOV.html @@ -0,0 +1,613 @@ + + +QScintilla: QextScintillaLexerPOV Class Reference + + + + + + +

QextScintillaLexerPOV Class Reference

The QextScintillaLexerPOV class encapsulates the Scintilla POV lexer. +More... +

+#include <qextscintillalexerpov.h> +

+Inherits QextScintillaLexer. +

+List of all members.

Public Types

+ +

Public Slots

+ +

Public Member Functions

+ +

Protected Member Functions

+ +

Detailed Description

+The QextScintillaLexerPOV class encapsulates the Scintilla POV lexer. +

+


Member Enumeration Documentation

+ +
+
+ + + + +
anonymous enum
+
+
+ +

+This enum defines the meanings of the different styles used by the POV lexer.

Enumerator:
+ + + + + + + + + + + + + + + + + + +
Default  +The default.
Comment  +A comment.
CommentLine  +A comment line.
Number  +A number.
Operator  +An operator.
Identifier  +An identifier.
String  +A string.
UnclosedString  +The end of a line where a string is not closed.
Directive  +A directive.
BadDirective  +A bad directive.
ObjectsCSGAppearance  +Objects, CSG and appearance.
TypesModifiersItems  +Types, modifiers and items.
PredefinedIdentifiers  +Predefined identifiers.
PredefinedFunctions  +Predefined identifiers.
KeywordSet6  +A keyword defined in keyword set number 6. The class must be sub-classed and re-implement keywords() to make use of this style.
KeywordSet7  +A keyword defined in keyword set number 7. The class must be sub-classed and re-implement keywords() to make use of this style.
KeywordSet8  +A keyword defined in keyword set number 8. The class must be sub-classed and re-implement keywords() to make use of this style.
+
+ +
+

+


Constructor & Destructor Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + +
QextScintillaLexerPOV::QextScintillaLexerPOV (QObject *  parent = 0,
const char *  name = 0 
)
+
+
+ +

+Construct a QextScintillaLexerPOV with parent parent and name name. parent is typically the QextScintilla instance. +

+

+ +

+
+ + + + + + + + +
virtual QextScintillaLexerPOV::~QextScintillaLexerPOV (  )  [virtual]
+
+
+ +

+Destroys the QextScintillaLexerPOV instance. +

+ +

+

+


Member Function Documentation

+ +
+
+ + + + + + + + +
const char* QextScintillaLexerPOV::language (  )  const [virtual]
+
+
+ +

+Returns the name of the language. +

+ +

+Implements QextScintillaLexer. +

+

+ +

+
+ + + + + + + + +
const char* QextScintillaLexerPOV::lexer (  )  const [virtual]
+
+
+ +

+Returns the name of the lexer. Some lexers support a number of languages. +

+Implements QextScintillaLexer. +

+

+ +

+
+ + + + + + + + + +
QColor QextScintillaLexerPOV::color (int  style  )  const [virtual]
+
+
+ +

+Returns the foreground colour of the text for style number style.

+

See also:
paper()
+ +

+Reimplemented from QextScintillaLexer. +

+

+ +

+
+ + + + + + + + + +
bool QextScintillaLexerPOV::eolFill (int  style  )  const [virtual]
+
+
+ +

+Returns the end-of-line fill for style number style. +

+ +

+Reimplemented from QextScintillaLexer. +

+

+ +

+
+ + + + + + + + + +
QFont QextScintillaLexerPOV::font (int  style  )  const [virtual]
+
+
+ +

+Returns the font for style number style. +

+ +

+Reimplemented from QextScintillaLexer. +

+

+ +

+
+ + + + + + + + + +
const char* QextScintillaLexerPOV::keywords (int  set  )  const [virtual]
+
+
+ +

+Returns the set of keywords for the keyword set set recognised by the lexer as a space separated string. +

+Reimplemented from QextScintillaLexer. +

+

+ +

+
+ + + + + + + + + +
QString QextScintillaLexerPOV::description (int  style  )  const [virtual]
+
+
+ +

+Returns the descriptive name for style number style. If the style is invalid for this language then QString::null is returned. This is intended to be used in user preference dialogs. +

+Implements QextScintillaLexer. +

+

+ +

+
+ + + + + + + + + +
QColor QextScintillaLexerPOV::paper (int  style  )  const [virtual]
+
+
+ +

+Returns the background colour of the text for style number style.

+

See also:
color()
+ +

+Reimplemented from QextScintillaLexer. +

+

+ +

+
+ + + + + + + + +
void QextScintillaLexerPOV::refreshProperties (  )  [virtual]
+
+
+ +

+Causes all properties to be refreshed by emitting the propertyChanged() signal as required. +

+Reimplemented from QextScintillaLexer. +

+

+ +

+
+ + + + + + + + +
bool QextScintillaLexerPOV::foldComments (  )  const
+
+
+ +

+Returns TRUE if multi-line comment blocks can be folded.

+

See also:
setFoldComments()
+ +
+

+ +

+
+ + + + + + + + +
bool QextScintillaLexerPOV::foldCompact (  )  const
+
+
+ +

+Returns TRUE if trailing blank lines are included in a fold block.

+

See also:
setFoldCompact()
+ +
+

+ +

+
+ + + + + + + + +
bool QextScintillaLexerPOV::foldDirectives (  )  const
+
+
+ +

+Returns TRUE if directives can be folded.

+

See also:
setFoldDirectives()
+ +
+

+ +

+
+ + + + + + + + + +
virtual void QextScintillaLexerPOV::setFoldComments (bool  fold  )  [virtual, slot]
+
+
+ +

+If fold is TRUE then multi-line comment blocks can be folded. The default is FALSE.

+

See also:
foldComments()
+ +
+

+ +

+
+ + + + + + + + + +
virtual void QextScintillaLexerPOV::setFoldCompact (bool  fold  )  [virtual, slot]
+
+
+ +

+If fold is TRUE then trailing blank lines are included in a fold block. The default is TRUE.

+

See also:
foldCompact()
+ +
+

+ +

+
+ + + + + + + + + +
virtual void QextScintillaLexerPOV::setFoldDirectives (bool  fold  )  [virtual, slot]
+
+
+ +

+If fold is TRUE then directives can be folded. The default is FALSE.

+

See also:
foldDirectives()
+ +
+

+ +

+
+ + + + + + + + + + + + + + + + + + +
bool QextScintillaLexerPOV::readProperties (QSettings &  qs,
const QString &  prefix 
) [protected, virtual]
+
+
+ +

+The lexer's properties are read from the settings qs. prefix (which has a trailing '/') should be used as a prefix to the key of each setting. TRUE is returned if there is no error. +

+Reimplemented from QextScintillaLexer. +

+

+ +

+
+ + + + + + + + + + + + + + + + + + +
bool QextScintillaLexerPOV::writeProperties (QSettings &  qs,
const QString &  prefix 
) const [protected, virtual]
+
+
+ +

+The lexer's properties are written to the settings qs. prefix (which has a trailing '/') should be used as a prefix to the key of each setting. TRUE is returned if there is no error. +

+Reimplemented from QextScintillaLexer. +

+

+


Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/classQextScintillaLexerPerl-members.html b/doc/html/classQextScintillaLexerPerl-members.html new file mode 100644 index 0000000..232bc24 --- /dev/null +++ b/doc/html/classQextScintillaLexerPerl-members.html @@ -0,0 +1,101 @@ + + +QScintilla: Member List + + + + + + +

QextScintillaLexerPerl Member List

This is the complete list of members for QextScintillaLexerPerl, including all inherited members.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Array enum valueQextScintillaLexerPerl
autoCompletionFillups() const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
autoCompletionStartCharacters() const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
autoIndentStyle()QextScintillaLexer
BacktickHereDocument enum valueQextScintillaLexerPerl
Backticks enum valueQextScintillaLexerPerl
blockEnd(int *style=0) const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
blockLookback() const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
blockStart(int *style=0) const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
blockStartKeyword(int *style=0) const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
braceStyle() const (defined in QextScintillaLexerPerl)QextScintillaLexerPerl [virtual]
color(int style) const QextScintillaLexerPerl [virtual]
colorChanged(const QColor &c, int style)QextScintillaLexer [signal]
Comment enum valueQextScintillaLexerPerl
DataSection enum valueQextScintillaLexerPerl
Default enum valueQextScintillaLexerPerl
defaultColor() const QextScintillaLexer [virtual]
defaultFont() const QextScintillaLexer [virtual]
defaultPaper() const QextScintillaLexer [virtual]
defaultStyle() const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
description(int style) const QextScintillaLexerPerl [virtual]
DoubleQuotedHereDocument enum valueQextScintillaLexerPerl
DoubleQuotedString enum valueQextScintillaLexerPerl
eolFill(int style) const QextScintillaLexerPerl [virtual]
eolFillChanged(bool eoffilled, int style)QextScintillaLexer [signal]
Error enum valueQextScintillaLexerPerl
foldComments() const QextScintillaLexerPerl
foldCompact() const QextScintillaLexerPerl
font(int style) const QextScintillaLexerPerl [virtual]
fontChanged(const QFont &f, int style)QextScintillaLexer [signal]
Hash enum valueQextScintillaLexerPerl
HereDocumentDelimiter enum valueQextScintillaLexerPerl
Identifier enum valueQextScintillaLexerPerl
Keyword enum valueQextScintillaLexerPerl
keywords(int set) const QextScintillaLexerPerl [virtual]
language() const QextScintillaLexerPerl [virtual]
lexer() const QextScintillaLexerPerl [virtual]
Number enum valueQextScintillaLexerPerl
Operator enum valueQextScintillaLexerPerl
paper(int style) const QextScintillaLexerPerl [virtual]
paperChanged(const QColor &c, int style)QextScintillaLexer [signal]
POD enum valueQextScintillaLexerPerl
PODVerbatim enum valueQextScintillaLexerPerl
propertyChanged(const char *prop, const char *val)QextScintillaLexer [signal]
QextScintillaLexer(QObject *parent=0, const char *name=0)QextScintillaLexer
QextScintillaLexerPerl(QObject *parent=0, const char *name=0)QextScintillaLexerPerl
QuotedStringQ enum valueQextScintillaLexerPerl
QuotedStringQQ enum valueQextScintillaLexerPerl
QuotedStringQR enum valueQextScintillaLexerPerl
QuotedStringQW enum valueQextScintillaLexerPerl
QuotedStringQX enum valueQextScintillaLexerPerl
readProperties(QSettings &qs, const QString &prefix)QextScintillaLexerPerl [protected, virtual]
readSettings(QSettings &qs, const char *prefix="/Scintilla")QextScintillaLexer
refreshProperties()QextScintillaLexerPerl [virtual]
Regex enum valueQextScintillaLexerPerl
Scalar enum valueQextScintillaLexerPerl
setAutoIndentStyle(int autoindentstyle)QextScintillaLexer [virtual, slot]
setColor(const QColor &c, int style=-1)QextScintillaLexer [virtual, slot]
setDefaultColor(const QColor &c)QextScintillaLexer [virtual, slot]
setDefaultFont(const QFont &f)QextScintillaLexer [virtual, slot]
setDefaultPaper(const QColor &c)QextScintillaLexer [virtual, slot]
setEolFill(bool eoffill, int style=-1)QextScintillaLexer [virtual, slot]
setFoldComments(bool fold)QextScintillaLexerPerl [virtual, slot]
setFoldCompact(bool fold)QextScintillaLexerPerl [virtual, slot]
setFont(const QFont &f, int style=-1)QextScintillaLexer [virtual, slot]
setPaper(const QColor &c, int style=-1)QextScintillaLexer [virtual, slot]
SingleQuotedHereDocument enum valueQextScintillaLexerPerl
SingleQuotedString enum valueQextScintillaLexerPerl
Substitution enum valueQextScintillaLexerPerl
SymbolTable enum valueQextScintillaLexerPerl
WhiteSpace enum valueQextScintillaLexerPerl
wordCharacters() const (defined in QextScintillaLexerPerl)QextScintillaLexerPerl [virtual]
writeProperties(QSettings &qs, const QString &prefix) const QextScintillaLexerPerl [protected, virtual]
writeSettings(QSettings &qs, const char *prefix="/Scintilla") const QextScintillaLexer
~QextScintillaLexer()QextScintillaLexer [virtual]
~QextScintillaLexerPerl()QextScintillaLexerPerl [virtual]


Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/classQextScintillaLexerPerl.html b/doc/html/classQextScintillaLexerPerl.html new file mode 100644 index 0000000..dd8d423 --- /dev/null +++ b/doc/html/classQextScintillaLexerPerl.html @@ -0,0 +1,621 @@ + + +QScintilla: QextScintillaLexerPerl Class Reference + + + + + + +

QextScintillaLexerPerl Class Reference

The QextScintillaLexerPerl class encapsulates the Scintilla Perl lexer. +More... +

+#include <qextscintillalexerperl.h> +

+Inherits QextScintillaLexer. +

+List of all members.

Public Types

+ +

Public Slots

+ +

Public Member Functions

+ +

Protected Member Functions

+ +

Detailed Description

+The QextScintillaLexerPerl class encapsulates the Scintilla Perl lexer. +

+


Member Enumeration Documentation

+ +
+
+ + + + +
anonymous enum
+
+
+ +

+This enum defines the meanings of the different styles used by the Perl lexer.

Enumerator:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Default  +The default.
WhiteSpace  +
Deprecated:
White space.
+
Error  +An error.
Comment  +A comment.
POD  +A POD.
Number  +A number.
Keyword  +A keyword.
DoubleQuotedString  +A double-quoted string.
SingleQuotedString  +A single-quoted string.
Operator  +An operator.
Identifier  +An identifier.
Scalar  +A scalar.
Array  +An array.
Hash  +A hash.
SymbolTable  +A symbol table.
Regex  +A regular expression.
Substitution  +A substitution.
Backticks  +Backticks.
DataSection  +A data section.
HereDocumentDelimiter  +A here document delimiter.
SingleQuotedHereDocument  +A single quoted here document.
DoubleQuotedHereDocument  +A double quoted here document.
BacktickHereDocument  +A backtick here document.
QuotedStringQ  +A quoted string (q).
QuotedStringQQ  +A quoted string (qq).
QuotedStringQX  +A quoted string (qx).
QuotedStringQR  +A quoted string (qr).
QuotedStringQW  +A quoted string (qw).
PODVerbatim  +A verbatim POD.
+
+ +
+

+


Constructor & Destructor Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + +
QextScintillaLexerPerl::QextScintillaLexerPerl (QObject *  parent = 0,
const char *  name = 0 
)
+
+
+ +

+Construct a QextScintillaLexerPerl with parent parent and name name. parent is typically the QextScintilla instance. +

+

+ +

+
+ + + + + + + + +
virtual QextScintillaLexerPerl::~QextScintillaLexerPerl (  )  [virtual]
+
+
+ +

+Destroys the QextScintillaLexerPerl instance. +

+ +

+

+


Member Function Documentation

+ +
+
+ + + + + + + + +
const char* QextScintillaLexerPerl::language (  )  const [virtual]
+
+
+ +

+Returns the name of the language. +

+ +

+Implements QextScintillaLexer. +

+

+ +

+
+ + + + + + + + +
const char* QextScintillaLexerPerl::lexer (  )  const [virtual]
+
+
+ +

+Returns the name of the lexer. Some lexers support a number of languages. +

+Implements QextScintillaLexer. +

+

+ +

+
+ + + + + + + + + +
QColor QextScintillaLexerPerl::color (int  style  )  const [virtual]
+
+
+ +

+Returns the foreground colour of the text for style number style.

+

See also:
paper()
+ +

+Reimplemented from QextScintillaLexer. +

+

+ +

+
+ + + + + + + + + +
bool QextScintillaLexerPerl::eolFill (int  style  )  const [virtual]
+
+
+ +

+Returns the end-of-line fill for style number style. +

+ +

+Reimplemented from QextScintillaLexer. +

+

+ +

+
+ + + + + + + + + +
QFont QextScintillaLexerPerl::font (int  style  )  const [virtual]
+
+
+ +

+Returns the font for style number style. +

+ +

+Reimplemented from QextScintillaLexer. +

+

+ +

+
+ + + + + + + + + +
const char* QextScintillaLexerPerl::keywords (int  set  )  const [virtual]
+
+
+ +

+Returns the set of keywords for the keyword set set recognised by the lexer as a space separated string. +

+Reimplemented from QextScintillaLexer. +

+

+ +

+
+ + + + + + + + + +
QString QextScintillaLexerPerl::description (int  style  )  const [virtual]
+
+
+ +

+Returns the descriptive name for style number style. If the style is invalid for this language then QString::null is returned. This is intended to be used in user preference dialogs. +

+Implements QextScintillaLexer. +

+

+ +

+
+ + + + + + + + + +
QColor QextScintillaLexerPerl::paper (int  style  )  const [virtual]
+
+
+ +

+Returns the background colour of the text for style number style.

+

See also:
color()
+ +

+Reimplemented from QextScintillaLexer. +

+

+ +

+
+ + + + + + + + +
void QextScintillaLexerPerl::refreshProperties (  )  [virtual]
+
+
+ +

+Causes all properties to be refreshed by emitting the propertyChanged() signal as required. +

+Reimplemented from QextScintillaLexer. +

+

+ +

+
+ + + + + + + + +
bool QextScintillaLexerPerl::foldComments (  )  const
+
+
+ +

+Returns TRUE if multi-line comment blocks can be folded.

+

See also:
setFoldComments()
+ +
+

+ +

+
+ + + + + + + + +
bool QextScintillaLexerPerl::foldCompact (  )  const
+
+
+ +

+Returns TRUE if trailing blank lines are included in a fold block.

+

See also:
setFoldCompact()
+ +
+

+ +

+
+ + + + + + + + + +
virtual void QextScintillaLexerPerl::setFoldComments (bool  fold  )  [virtual, slot]
+
+
+ +

+If fold is TRUE then multi-line comment blocks can be folded. The default is FALSE.

+

See also:
foldComments()
+ +
+

+ +

+
+ + + + + + + + + +
virtual void QextScintillaLexerPerl::setFoldCompact (bool  fold  )  [virtual, slot]
+
+
+ +

+If fold is TRUE then trailing blank lines are included in a fold block. The default is TRUE.

+

See also:
foldCompact()
+ +
+

+ +

+
+ + + + + + + + + + + + + + + + + + +
bool QextScintillaLexerPerl::readProperties (QSettings &  qs,
const QString &  prefix 
) [protected, virtual]
+
+
+ +

+The lexer's properties are read from the settings qs. prefix (which has a trailing '/') should be used as a prefix to the key of each setting. TRUE is returned if there is no error. +

+Reimplemented from QextScintillaLexer. +

+

+ +

+
+ + + + + + + + + + + + + + + + + + +
bool QextScintillaLexerPerl::writeProperties (QSettings &  qs,
const QString &  prefix 
) const [protected, virtual]
+
+
+ +

+The lexer's properties are written to the settings qs. prefix (which has a trailing '/') should be used as a prefix to the key of each setting. TRUE is returned if there is no error. +

+Reimplemented from QextScintillaLexer. +

+

+


Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/classQextScintillaLexerProperties-members.html b/doc/html/classQextScintillaLexerProperties-members.html new file mode 100644 index 0000000..31d1f01 --- /dev/null +++ b/doc/html/classQextScintillaLexerProperties-members.html @@ -0,0 +1,75 @@ + + +QScintilla: Member List + + + + + + +

QextScintillaLexerProperties Member List

This is the complete list of members for QextScintillaLexerProperties, including all inherited members.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Assignment enum valueQextScintillaLexerProperties
autoCompletionFillups() const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
autoCompletionStartCharacters() const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
autoIndentStyle()QextScintillaLexer
blockEnd(int *style=0) const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
blockLookback() const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
blockStart(int *style=0) const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
blockStartKeyword(int *style=0) const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
braceStyle() const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
color(int style) const QextScintillaLexerProperties [virtual]
colorChanged(const QColor &c, int style)QextScintillaLexer [signal]
Comment enum valueQextScintillaLexerProperties
Default enum valueQextScintillaLexerProperties
defaultColor() const QextScintillaLexer [virtual]
defaultFont() const QextScintillaLexer [virtual]
defaultPaper() const QextScintillaLexer [virtual]
defaultStyle() const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
DefaultValue enum valueQextScintillaLexerProperties
description(int style) const QextScintillaLexerProperties [virtual]
eolFill(int style) const QextScintillaLexerProperties [virtual]
eolFillChanged(bool eoffilled, int style)QextScintillaLexer [signal]
foldCompact() const QextScintillaLexerProperties
font(int style) const QextScintillaLexerProperties [virtual]
fontChanged(const QFont &f, int style)QextScintillaLexer [signal]
keywords(int set) const QextScintillaLexer [virtual]
language() const QextScintillaLexerProperties [virtual]
lexer() const QextScintillaLexerProperties [virtual]
paper(int style) const QextScintillaLexerProperties [virtual]
paperChanged(const QColor &c, int style)QextScintillaLexer [signal]
propertyChanged(const char *prop, const char *val)QextScintillaLexer [signal]
QextScintillaLexer(QObject *parent=0, const char *name=0)QextScintillaLexer
QextScintillaLexerProperties(QObject *parent=0, const char *name=0)QextScintillaLexerProperties
readProperties(QSettings &qs, const QString &prefix)QextScintillaLexerProperties [protected, virtual]
readSettings(QSettings &qs, const char *prefix="/Scintilla")QextScintillaLexer
refreshProperties()QextScintillaLexerProperties [virtual]
Section enum valueQextScintillaLexerProperties
setAutoIndentStyle(int autoindentstyle)QextScintillaLexer [virtual, slot]
setColor(const QColor &c, int style=-1)QextScintillaLexer [virtual, slot]
setDefaultColor(const QColor &c)QextScintillaLexer [virtual, slot]
setDefaultFont(const QFont &f)QextScintillaLexer [virtual, slot]
setDefaultPaper(const QColor &c)QextScintillaLexer [virtual, slot]
setEolFill(bool eoffill, int style=-1)QextScintillaLexer [virtual, slot]
setFoldCompact(bool fold)QextScintillaLexerProperties [virtual, slot]
setFont(const QFont &f, int style=-1)QextScintillaLexer [virtual, slot]
setPaper(const QColor &c, int style=-1)QextScintillaLexer [virtual, slot]
wordCharacters() const (defined in QextScintillaLexerProperties)QextScintillaLexerProperties [virtual]
writeProperties(QSettings &qs, const QString &prefix) const QextScintillaLexerProperties [protected, virtual]
writeSettings(QSettings &qs, const char *prefix="/Scintilla") const QextScintillaLexer
~QextScintillaLexer()QextScintillaLexer [virtual]
~QextScintillaLexerProperties()QextScintillaLexerProperties [virtual]


Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/classQextScintillaLexerProperties.html b/doc/html/classQextScintillaLexerProperties.html new file mode 100644 index 0000000..e837e40 --- /dev/null +++ b/doc/html/classQextScintillaLexerProperties.html @@ -0,0 +1,450 @@ + + +QScintilla: QextScintillaLexerProperties Class Reference + + + + + + +

QextScintillaLexerProperties Class Reference

The QextScintillaLexerProperties class encapsulates the Scintilla Properties lexer. +More... +

+#include <qextscintillalexerproperties.h> +

+Inherits QextScintillaLexer. +

+List of all members.

Public Types

+ +

Public Slots

+ +

Public Member Functions

+ +

Protected Member Functions

+ +

Detailed Description

+The QextScintillaLexerProperties class encapsulates the Scintilla Properties lexer. +

+


Member Enumeration Documentation

+ +
+
+ + + + +
anonymous enum
+
+
+ +

+This enum defines the meanings of the different styles used by the Properties lexer.

Enumerator:
+ + + + + + +
Default  +The default.
Comment  +A comment.
Section  +A section.
Assignment  +An assignment operator.
DefaultValue  +A default value.
+
+ +
+

+


Constructor & Destructor Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + +
QextScintillaLexerProperties::QextScintillaLexerProperties (QObject *  parent = 0,
const char *  name = 0 
)
+
+
+ +

+Construct a QextScintillaLexerProperties with parent parent and name name. parent is typically the QextScintilla instance. +

+

+ +

+
+ + + + + + + + +
virtual QextScintillaLexerProperties::~QextScintillaLexerProperties (  )  [virtual]
+
+
+ +

+Destroys the QextScintillaLexerProperties instance. +

+ +

+

+


Member Function Documentation

+ +
+
+ + + + + + + + +
const char* QextScintillaLexerProperties::language (  )  const [virtual]
+
+
+ +

+Returns the name of the language. +

+ +

+Implements QextScintillaLexer. +

+

+ +

+
+ + + + + + + + +
const char* QextScintillaLexerProperties::lexer (  )  const [virtual]
+
+
+ +

+Returns the name of the lexer. Some lexers support a number of languages. +

+Implements QextScintillaLexer. +

+

+ +

+
+ + + + + + + + + +
QColor QextScintillaLexerProperties::color (int  style  )  const [virtual]
+
+
+ +

+Returns the foreground colour of the text for style number style.

+

See also:
paper()
+ +

+Reimplemented from QextScintillaLexer. +

+

+ +

+
+ + + + + + + + + +
bool QextScintillaLexerProperties::eolFill (int  style  )  const [virtual]
+
+
+ +

+Returns the end-of-line fill for style number style. +

+ +

+Reimplemented from QextScintillaLexer. +

+

+ +

+
+ + + + + + + + + +
QFont QextScintillaLexerProperties::font (int  style  )  const [virtual]
+
+
+ +

+Returns the font for style number style. +

+ +

+Reimplemented from QextScintillaLexer. +

+

+ +

+
+ + + + + + + + + +
QString QextScintillaLexerProperties::description (int  style  )  const [virtual]
+
+
+ +

+Returns the descriptive name for style number style. If the style is invalid for this language then QString::null is returned. This is intended to be used in user preference dialogs. +

+Implements QextScintillaLexer. +

+

+ +

+
+ + + + + + + + + +
QColor QextScintillaLexerProperties::paper (int  style  )  const [virtual]
+
+
+ +

+Returns the background colour of the text for style number style.

+

See also:
color()
+ +

+Reimplemented from QextScintillaLexer. +

+

+ +

+
+ + + + + + + + +
void QextScintillaLexerProperties::refreshProperties (  )  [virtual]
+
+
+ +

+Causes all properties to be refreshed by emitting the propertyChanged() signal as required. +

+Reimplemented from QextScintillaLexer. +

+

+ +

+
+ + + + + + + + +
bool QextScintillaLexerProperties::foldCompact (  )  const
+
+
+ +

+Returns TRUE if trailing blank lines are included in a fold block.

+

See also:
setFoldCompact()
+ +
+

+ +

+
+ + + + + + + + + +
virtual void QextScintillaLexerProperties::setFoldCompact (bool  fold  )  [virtual, slot]
+
+
+ +

+If fold is TRUE then trailing blank lines are included in a fold block. The default is TRUE.

+

See also:
foldCompact()
+ +
+

+ +

+
+ + + + + + + + + + + + + + + + + + +
bool QextScintillaLexerProperties::readProperties (QSettings &  qs,
const QString &  prefix 
) [protected, virtual]
+
+
+ +

+The lexer's properties are read from the settings qs. prefix (which has a trailing '/') should be used as a prefix to the key of each setting. TRUE is returned if there is no error.

+

See also:
writeProperties()
+ +

+Reimplemented from QextScintillaLexer. +

+

+ +

+
+ + + + + + + + + + + + + + + + + + +
bool QextScintillaLexerProperties::writeProperties (QSettings &  qs,
const QString &  prefix 
) const [protected, virtual]
+
+
+ +

+The lexer's properties are written to the settings qs. prefix (which has a trailing '/') should be used as a prefix to the key of each setting. TRUE is returned if there is no error.

+

See also:
readProperties()
+ +

+Reimplemented from QextScintillaLexer. +

+

+


Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/classQextScintillaLexerPython-members.html b/doc/html/classQextScintillaLexerPython-members.html new file mode 100644 index 0000000..11c4b3f --- /dev/null +++ b/doc/html/classQextScintillaLexerPython-members.html @@ -0,0 +1,97 @@ + + +QScintilla: Member List + + + + + + +

QextScintillaLexerPython Member List

This is the complete list of members for QextScintillaLexerPython, including all inherited members.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
autoCompletionFillups() const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
autoCompletionStartCharacters() const (defined in QextScintillaLexerPython)QextScintillaLexerPython [virtual]
autoIndentStyle()QextScintillaLexer
blockEnd(int *style=0) const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
blockLookback() const (defined in QextScintillaLexerPython)QextScintillaLexerPython [virtual]
blockStart(int *style=0) const (defined in QextScintillaLexerPython)QextScintillaLexerPython [virtual]
blockStartKeyword(int *style=0) const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
braceStyle() const (defined in QextScintillaLexerPython)QextScintillaLexerPython [virtual]
ClassName enum valueQextScintillaLexerPython
color(int style) const QextScintillaLexerPython [virtual]
colorChanged(const QColor &c, int style)QextScintillaLexer [signal]
Comment enum valueQextScintillaLexerPython
CommentBlock enum valueQextScintillaLexerPython
Decorator enum valueQextScintillaLexerPython
Default enum valueQextScintillaLexerPython
defaultColor() const QextScintillaLexer [virtual]
defaultFont() const QextScintillaLexer [virtual]
defaultPaper() const QextScintillaLexer [virtual]
defaultStyle() const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
description(int style) const QextScintillaLexerPython [virtual]
DoubleQuotedString enum valueQextScintillaLexerPython
eolFill(int style) const QextScintillaLexerPython [virtual]
eolFillChanged(bool eoffilled, int style)QextScintillaLexer [signal]
foldComments() const QextScintillaLexerPython
foldQuotes() const QextScintillaLexerPython
font(int style) const QextScintillaLexerPython [virtual]
fontChanged(const QFont &f, int style)QextScintillaLexer [signal]
FunctionMethodName enum valueQextScintillaLexerPython
HighlightedIdentifier enum valueQextScintillaLexerPython
Identifier enum valueQextScintillaLexerPython
Inconsistent enum valueQextScintillaLexerPython
indentationWarning() const QextScintillaLexerPython
IndentationWarning enum nameQextScintillaLexerPython
Keyword enum valueQextScintillaLexerPython
keywords(int set) const QextScintillaLexerPython [virtual]
language() const QextScintillaLexerPython [virtual]
lexer() const QextScintillaLexerPython [virtual]
NoWarning enum valueQextScintillaLexerPython
Number enum valueQextScintillaLexerPython
Operator enum valueQextScintillaLexerPython
paper(int style) const QextScintillaLexerPython [virtual]
paperChanged(const QColor &c, int style)QextScintillaLexer [signal]
propertyChanged(const char *prop, const char *val)QextScintillaLexer [signal]
QextScintillaLexer(QObject *parent=0, const char *name=0)QextScintillaLexer
QextScintillaLexerPython(QObject *parent=0, const char *name=0)QextScintillaLexerPython
readProperties(QSettings &qs, const QString &prefix)QextScintillaLexerPython [protected, virtual]
readSettings(QSettings &qs, const char *prefix="/Scintilla")QextScintillaLexer
refreshProperties()QextScintillaLexerPython [virtual]
setAutoIndentStyle(int autoindentstyle)QextScintillaLexer [virtual, slot]
setColor(const QColor &c, int style=-1)QextScintillaLexer [virtual, slot]
setDefaultColor(const QColor &c)QextScintillaLexer [virtual, slot]
setDefaultFont(const QFont &f)QextScintillaLexer [virtual, slot]
setDefaultPaper(const QColor &c)QextScintillaLexer [virtual, slot]
setEolFill(bool eoffill, int style=-1)QextScintillaLexer [virtual, slot]
setFoldComments(bool fold)QextScintillaLexerPython [virtual, slot]
setFoldQuotes(bool fold)QextScintillaLexerPython [virtual, slot]
setFont(const QFont &f, int style=-1)QextScintillaLexer [virtual, slot]
setIndentationWarning(IndentationWarning warn)QextScintillaLexerPython [virtual, slot]
setPaper(const QColor &c, int style=-1)QextScintillaLexer [virtual, slot]
SingleQuotedString enum valueQextScintillaLexerPython
Spaces enum valueQextScintillaLexerPython
Tabs enum valueQextScintillaLexerPython
TabsAfterSpaces enum valueQextScintillaLexerPython
TripleDoubleQuotedString enum valueQextScintillaLexerPython
TripleSingleQuotedString enum valueQextScintillaLexerPython
UnclosedString enum valueQextScintillaLexerPython
WhiteSpace enum valueQextScintillaLexerPython
wordCharacters() const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
writeProperties(QSettings &qs, const QString &prefix) const QextScintillaLexerPython [protected, virtual]
writeSettings(QSettings &qs, const char *prefix="/Scintilla") const QextScintillaLexer
~QextScintillaLexer()QextScintillaLexer [virtual]
~QextScintillaLexerPython()QextScintillaLexerPython [virtual]


Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/classQextScintillaLexerPython.html b/doc/html/classQextScintillaLexerPython.html new file mode 100644 index 0000000..359758a --- /dev/null +++ b/doc/html/classQextScintillaLexerPython.html @@ -0,0 +1,661 @@ + + +QScintilla: QextScintillaLexerPython Class Reference + + + + + + +

QextScintillaLexerPython Class Reference

The QextScintillaLexerPython class encapsulates the Scintilla Python lexer. +More... +

+#include <qextscintillalexerpython.h> +

+Inherits QextScintillaLexer. +

+List of all members.

Public Types

+ +

Public Slots

+ +

Public Member Functions

+ +

Protected Member Functions

+ +

Detailed Description

+The QextScintillaLexerPython class encapsulates the Scintilla Python lexer. +

+


Member Enumeration Documentation

+ +
+
+ + + + +
anonymous enum
+
+
+ +

+This enum defines the meanings of the different styles used by the Python lexer.

Enumerator:
+ + + + + + + + + + + + + + + + + + +
Default  +The default.
WhiteSpace  +
Deprecated:
White space.
+
Comment  +A comment.
Number  +A number.
DoubleQuotedString  +A double-quoted string.
SingleQuotedString  +A single-quoted string.
Keyword  +A keyword.
TripleSingleQuotedString  +A triple single-quoted string.
TripleDoubleQuotedString  +A triple double-quoted string.
ClassName  +The name of a class.
FunctionMethodName  +The name of a function or method.
Operator  +An operator.
Identifier  +An identifier.
CommentBlock  +A comment block.
UnclosedString  +The end of a line where a string is not closed.
HighlightedIdentifier  +A highlighted identifier. These are defined by keyword set 2. Reimplement keywords() to define keyword set 2.
Decorator  +A decorator.
+
+ +
+

+ +

+ +
+ +

+This enum defines the different conditions that can cause indentations to be displayed as being bad.

Enumerator:
+ + + + + + +
NoWarning  +Bad indentation is not displayed differently.
Inconsistent  +The indentation is inconsistent when compared to the previous line, ie. it is made up of a different combination of tabs and/or spaces.
TabsAfterSpaces  +The indentation is made up of spaces followed by tabs.
Spaces  +The indentation contains spaces.
Tabs  +The indentation contains tabs.
+
+ +
+

+


Constructor & Destructor Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + +
QextScintillaLexerPython::QextScintillaLexerPython (QObject *  parent = 0,
const char *  name = 0 
)
+
+
+ +

+Construct a QextScintillaLexerPython with parent parent and name name. parent is typically the QextScintilla instance. +

+

+ +

+
+ + + + + + + + +
virtual QextScintillaLexerPython::~QextScintillaLexerPython (  )  [virtual]
+
+
+ +

+Destroys the QextScintillaLexerPython instance. +

+ +

+

+


Member Function Documentation

+ +
+
+ + + + + + + + +
const char* QextScintillaLexerPython::language (  )  const [virtual]
+
+
+ +

+Returns the name of the language. +

+ +

+Implements QextScintillaLexer. +

+

+ +

+
+ + + + + + + + +
const char* QextScintillaLexerPython::lexer (  )  const [virtual]
+
+
+ +

+Returns the name of the lexer. Some lexers support a number of languages. +

+Implements QextScintillaLexer. +

+

+ +

+
+ + + + + + + + + +
QColor QextScintillaLexerPython::color (int  style  )  const [virtual]
+
+
+ +

+Returns the foreground colour of the text for style number style.

+

See also:
paper()
+ +

+Reimplemented from QextScintillaLexer. +

+

+ +

+
+ + + + + + + + + +
bool QextScintillaLexerPython::eolFill (int  style  )  const [virtual]
+
+
+ +

+Returns the end-of-line fill for style number style. +

+ +

+Reimplemented from QextScintillaLexer. +

+

+ +

+
+ + + + + + + + + +
QFont QextScintillaLexerPython::font (int  style  )  const [virtual]
+
+
+ +

+Returns the font for style number style. +

+ +

+Reimplemented from QextScintillaLexer. +

+

+ +

+
+ + + + + + + + + +
const char* QextScintillaLexerPython::keywords (int  set  )  const [virtual]
+
+
+ +

+Returns the set of keywords for the keyword set set recognised by the lexer as a space separated string. +

+Reimplemented from QextScintillaLexer. +

+

+ +

+
+ + + + + + + + + +
QString QextScintillaLexerPython::description (int  style  )  const [virtual]
+
+
+ +

+Returns the descriptive name for style number style. If the style is invalid for this language then QString::null is returned. This is intended to be used in user preference dialogs. +

+Implements QextScintillaLexer. +

+

+ +

+
+ + + + + + + + + +
QColor QextScintillaLexerPython::paper (int  style  )  const [virtual]
+
+
+ +

+Returns the background colour of the text for style number style.

+

See also:
color()
+ +

+Reimplemented from QextScintillaLexer. +

+

+ +

+
+ + + + + + + + +
void QextScintillaLexerPython::refreshProperties (  )  [virtual]
+
+
+ +

+Causes all properties to be refreshed by emitting the propertyChanged() signal as required. +

+Reimplemented from QextScintillaLexer. +

+

+ +

+
+ + + + + + + + +
bool QextScintillaLexerPython::foldComments (  )  const
+
+
+ +

+Returns TRUE if indented comment blocks can be folded.

+

See also:
setFoldComments()
+ +
+

+ +

+
+ + + + + + + + +
bool QextScintillaLexerPython::foldQuotes (  )  const
+
+
+ +

+Returns TRUE if triple quoted strings can be folded.

+

See also:
setFoldQuotes()
+ +
+

+ +

+
+ + + + + + + + +
IndentationWarning QextScintillaLexerPython::indentationWarning (  )  const
+
+
+ +

+Returns the condition that will cause bad indentations to be displayed.

+

See also:
setIndentationWarning()
+ +
+

+ +

+
+ + + + + + + + + +
virtual void QextScintillaLexerPython::setFoldComments (bool  fold  )  [virtual, slot]
+
+
+ +

+If fold is TRUE then indented comment blocks can be folded. The default is FALSE.

+

See also:
foldComments()
+ +
+

+ +

+
+ + + + + + + + + +
virtual void QextScintillaLexerPython::setFoldQuotes (bool  fold  )  [virtual, slot]
+
+
+ +

+If fold is TRUE then triple quoted strings can be folded. The default is FALSE.

+

See also:
foldQuotes()
+ +
+

+ +

+
+ + + + + + + + + +
virtual void QextScintillaLexerPython::setIndentationWarning (IndentationWarning  warn  )  [virtual, slot]
+
+
+ +

+Sets the condition that will cause bad indentations to be displayed.

+

See also:
indentationWarning()
+ +
+

+ +

+
+ + + + + + + + + + + + + + + + + + +
bool QextScintillaLexerPython::readProperties (QSettings &  qs,
const QString &  prefix 
) [protected, virtual]
+
+
+ +

+The lexer's properties are read from the settings qs. prefix (which has a trailing '/') should be used as a prefix to the key of each setting. TRUE is returned if there is no error. +

+Reimplemented from QextScintillaLexer. +

+

+ +

+
+ + + + + + + + + + + + + + + + + + +
bool QextScintillaLexerPython::writeProperties (QSettings &  qs,
const QString &  prefix 
) const [protected, virtual]
+
+
+ +

+The lexer's properties are written to the settings qs. prefix (which has a trailing '/') should be used as a prefix to the key of each setting. TRUE is returned if there is no error. +

+Reimplemented from QextScintillaLexer. +

+

+


Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/classQextScintillaLexerRuby-members.html b/doc/html/classQextScintillaLexerRuby-members.html new file mode 100644 index 0000000..ebe3f43 --- /dev/null +++ b/doc/html/classQextScintillaLexerRuby-members.html @@ -0,0 +1,99 @@ + + +QScintilla: Member List + + + + + + +

QextScintillaLexerRuby Member List

This is the complete list of members for QextScintillaLexerRuby, including all inherited members.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
autoCompletionFillups() const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
autoCompletionStartCharacters() const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
autoIndentStyle()QextScintillaLexer
Backticks enum valueQextScintillaLexerRuby
blockEnd(int *style=0) const (defined in QextScintillaLexerRuby)QextScintillaLexerRuby [virtual]
blockLookback() const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
blockStart(int *style=0) const (defined in QextScintillaLexerRuby)QextScintillaLexerRuby [virtual]
blockStartKeyword(int *style=0) const (defined in QextScintillaLexerRuby)QextScintillaLexerRuby [virtual]
braceStyle() const (defined in QextScintillaLexerRuby)QextScintillaLexerRuby [virtual]
ClassName enum valueQextScintillaLexerRuby
ClassVariable enum valueQextScintillaLexerRuby
color(int style) const QextScintillaLexerRuby [virtual]
colorChanged(const QColor &c, int style)QextScintillaLexer [signal]
Comment enum valueQextScintillaLexerRuby
DataSection enum valueQextScintillaLexerRuby
Default enum valueQextScintillaLexerRuby
defaultColor() const QextScintillaLexer [virtual]
defaultFont() const QextScintillaLexer [virtual]
defaultPaper() const QextScintillaLexer [virtual]
defaultStyle() const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
DemotedKeyword enum valueQextScintillaLexerRuby
description(int style) const QextScintillaLexerRuby [virtual]
DoubleQuotedString enum valueQextScintillaLexerRuby
eolFill(int style) const QextScintillaLexerRuby [virtual]
eolFillChanged(bool eoffilled, int style)QextScintillaLexer [signal]
Error enum valueQextScintillaLexerRuby
font(int style) const QextScintillaLexerRuby [virtual]
fontChanged(const QFont &f, int style)QextScintillaLexer [signal]
FunctionMethodName enum valueQextScintillaLexerRuby
Global enum valueQextScintillaLexerRuby
HereDocument enum valueQextScintillaLexerRuby
HereDocumentDelimiter enum valueQextScintillaLexerRuby
Identifier enum valueQextScintillaLexerRuby
InstanceVariable enum valueQextScintillaLexerRuby
Keyword enum valueQextScintillaLexerRuby
keywords(int set) const QextScintillaLexerRuby [virtual]
language() const QextScintillaLexerRuby [virtual]
lexer() const QextScintillaLexerRuby [virtual]
ModuleName enum valueQextScintillaLexerRuby
Number enum valueQextScintillaLexerRuby
Operator enum valueQextScintillaLexerRuby
paper(int style) const QextScintillaLexerRuby [virtual]
paperChanged(const QColor &c, int style)QextScintillaLexer [signal]
PercentStringq enum valueQextScintillaLexerRuby
PercentStringQ enum valueQextScintillaLexerRuby
PercentStringr enum valueQextScintillaLexerRuby
PercentStringw enum valueQextScintillaLexerRuby
PercentStringx enum valueQextScintillaLexerRuby
POD enum valueQextScintillaLexerRuby
propertyChanged(const char *prop, const char *val)QextScintillaLexer [signal]
QextScintillaLexer(QObject *parent=0, const char *name=0)QextScintillaLexer
QextScintillaLexerRuby(QObject *parent=0, const char *name=0)QextScintillaLexerRuby
readProperties(QSettings &qs, const QString &prefix)QextScintillaLexer [protected, virtual]
readSettings(QSettings &qs, const char *prefix="/Scintilla")QextScintillaLexer
refreshProperties()QextScintillaLexer [virtual]
Regex enum valueQextScintillaLexerRuby
setAutoIndentStyle(int autoindentstyle)QextScintillaLexer [virtual, slot]
setColor(const QColor &c, int style=-1)QextScintillaLexer [virtual, slot]
setDefaultColor(const QColor &c)QextScintillaLexer [virtual, slot]
setDefaultFont(const QFont &f)QextScintillaLexer [virtual, slot]
setDefaultPaper(const QColor &c)QextScintillaLexer [virtual, slot]
setEolFill(bool eoffill, int style=-1)QextScintillaLexer [virtual, slot]
setFont(const QFont &f, int style=-1)QextScintillaLexer [virtual, slot]
setPaper(const QColor &c, int style=-1)QextScintillaLexer [virtual, slot]
SingleQuotedString enum valueQextScintillaLexerRuby
Stderr enum valueQextScintillaLexerRuby
Stdin enum valueQextScintillaLexerRuby
Stdout enum valueQextScintillaLexerRuby
Symbol enum valueQextScintillaLexerRuby
wordCharacters() const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
writeProperties(QSettings &qs, const QString &prefix) const QextScintillaLexer [protected, virtual]
writeSettings(QSettings &qs, const char *prefix="/Scintilla") const QextScintillaLexer
~QextScintillaLexer()QextScintillaLexer [virtual]
~QextScintillaLexerRuby()QextScintillaLexerRuby [virtual]


Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/classQextScintillaLexerRuby.html b/doc/html/classQextScintillaLexerRuby.html new file mode 100644 index 0000000..0b40358 --- /dev/null +++ b/doc/html/classQextScintillaLexerRuby.html @@ -0,0 +1,451 @@ + + +QScintilla: QextScintillaLexerRuby Class Reference + + + + + + +

QextScintillaLexerRuby Class Reference

The QextScintillaLexerRuby class encapsulates the Scintilla Ruby lexer. +More... +

+#include <qextscintillalexerruby.h> +

+Inherits QextScintillaLexer. +

+List of all members.

Public Types

+ +

Public Member Functions

+
    +
  • QextScintillaLexerRuby (QObject *parent=0, const char *name=0) +
  • virtual ~QextScintillaLexerRuby () +
  • const char * language () const +
  • const char * lexer () const +
  • +const char * blockEnd (int *style=0) const +
  • +const char * blockStart (int *style=0) const +
  • +const char * blockStartKeyword (int *style=0) const +
  • +int braceStyle () const +
  • QColor color (int style) const +
  • bool eolFill (int style) const +
  • QFont font (int style) const +
  • const char * keywords (int set) const +
  • QString description (int style) const +
  • QColor paper (int style) const +
+

Detailed Description

+The QextScintillaLexerRuby class encapsulates the Scintilla Ruby lexer. +

+


Member Enumeration Documentation

+ +
+
+ + + + +
anonymous enum
+
+
+ +

+This enum defines the meanings of the different styles used by the Ruby lexer.

Enumerator:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Default  +The default.
Error  +An error.
Comment  +A comment.
POD  +A POD.
Number  +A number.
Keyword  +A keyword.
DoubleQuotedString  +A double-quoted string.
SingleQuotedString  +A single-quoted string.
ClassName  +The name of a class.
FunctionMethodName  +The name of a function or method.
Operator  +An operator.
Identifier  +An identifier.
Regex  +A regular expression.
Global  +A global.
Symbol  +A symbol.
ModuleName  +The name of a module.
InstanceVariable  +An instance variable.
ClassVariable  +A class variable.
Backticks  +Backticks.
DataSection  +A data section.
HereDocumentDelimiter  +A here document delimiter.
HereDocument  +A here document.
PercentStringq  +A q string.
PercentStringQ  +A Q string.
PercentStringx  +A x string.
PercentStringr  +A r string.
PercentStringw  +A w string.
DemotedKeyword  +A demoted keyword.
Stdin  +stdin.
Stdout  +stdout.
Stderr  +stderr.
+
+ +
+

+


Constructor & Destructor Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + +
QextScintillaLexerRuby::QextScintillaLexerRuby (QObject *  parent = 0,
const char *  name = 0 
)
+
+
+ +

+Construct a QextScintillaLexerRuby with parent parent and name name. parent is typically the QextScintilla instance. +

+

+ +

+
+ + + + + + + + +
virtual QextScintillaLexerRuby::~QextScintillaLexerRuby (  )  [virtual]
+
+
+ +

+Destroys the QextScintillaLexerRuby instance. +

+ +

+

+


Member Function Documentation

+ +
+
+ + + + + + + + +
const char* QextScintillaLexerRuby::language (  )  const [virtual]
+
+
+ +

+Returns the name of the language. +

+ +

+Implements QextScintillaLexer. +

+

+ +

+
+ + + + + + + + +
const char* QextScintillaLexerRuby::lexer (  )  const [virtual]
+
+
+ +

+Returns the name of the lexer. Some lexers support a number of languages. +

+Implements QextScintillaLexer. +

+

+ +

+
+ + + + + + + + + +
QColor QextScintillaLexerRuby::color (int  style  )  const [virtual]
+
+
+ +

+Returns the foreground colour of the text for style number style.

+

See also:
paper()
+ +

+Reimplemented from QextScintillaLexer. +

+

+ +

+
+ + + + + + + + + +
bool QextScintillaLexerRuby::eolFill (int  style  )  const [virtual]
+
+
+ +

+Returns the end-of-line fill for style number style. +

+ +

+Reimplemented from QextScintillaLexer. +

+

+ +

+
+ + + + + + + + + +
QFont QextScintillaLexerRuby::font (int  style  )  const [virtual]
+
+
+ +

+Returns the font for style number style. +

+ +

+Reimplemented from QextScintillaLexer. +

+

+ +

+
+ + + + + + + + + +
const char* QextScintillaLexerRuby::keywords (int  set  )  const [virtual]
+
+
+ +

+Returns the set of keywords for the keyword set set recognised by the lexer as a space separated string. +

+Reimplemented from QextScintillaLexer. +

+

+ +

+
+ + + + + + + + + +
QString QextScintillaLexerRuby::description (int  style  )  const [virtual]
+
+
+ +

+Returns the descriptive name for style number style. If the style is invalid for this language then QString::null is returned. This is intended to be used in user preference dialogs. +

+Implements QextScintillaLexer. +

+

+ +

+
+ + + + + + + + + +
QColor QextScintillaLexerRuby::paper (int  style  )  const [virtual]
+
+
+ +

+Returns the background colour of the text for style number style.

+

See also:
color()
+ +

+Reimplemented from QextScintillaLexer. +

+

+


Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/classQextScintillaLexerSQL-members.html b/doc/html/classQextScintillaLexerSQL-members.html new file mode 100644 index 0000000..f8959da --- /dev/null +++ b/doc/html/classQextScintillaLexerSQL-members.html @@ -0,0 +1,95 @@ + + +QScintilla: Member List + + + + + + +

QextScintillaLexerSQL Member List

This is the complete list of members for QextScintillaLexerSQL, including all inherited members.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
autoCompletionFillups() const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
autoCompletionStartCharacters() const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
autoIndentStyle()QextScintillaLexer
backslashEscapes() const QextScintillaLexerSQL
blockEnd(int *style=0) const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
blockLookback() const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
blockStart(int *style=0) const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
blockStartKeyword(int *style=0) const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
braceStyle() const (defined in QextScintillaLexerSQL)QextScintillaLexerSQL [virtual]
color(int style) const QextScintillaLexerSQL [virtual]
colorChanged(const QColor &c, int style)QextScintillaLexer [signal]
Comment enum valueQextScintillaLexerSQL
CommentDoc enum valueQextScintillaLexerSQL
CommentDocKeyword enum valueQextScintillaLexerSQL
CommentDocKeywordError enum valueQextScintillaLexerSQL
CommentLine enum valueQextScintillaLexerSQL
CommentLineHash enum valueQextScintillaLexerSQL
Default enum valueQextScintillaLexerSQL
defaultColor() const QextScintillaLexer [virtual]
defaultFont() const QextScintillaLexer [virtual]
defaultPaper() const QextScintillaLexer [virtual]
defaultStyle() const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
description(int style) const QextScintillaLexerSQL [virtual]
DoubleQuotedString enum valueQextScintillaLexerSQL
eolFill(int style) const QextScintillaLexerSQL [virtual]
eolFillChanged(bool eoffilled, int style)QextScintillaLexer [signal]
foldComments() const QextScintillaLexerSQL
foldCompact() const QextScintillaLexerSQL
font(int style) const QextScintillaLexerSQL [virtual]
fontChanged(const QFont &f, int style)QextScintillaLexer [signal]
Identifier enum valueQextScintillaLexerSQL
Keyword enum valueQextScintillaLexerSQL
keywords(int set) const QextScintillaLexerSQL [virtual]
KeywordSet5 enum valueQextScintillaLexerSQL
KeywordSet6 enum valueQextScintillaLexerSQL
KeywordSet7 enum valueQextScintillaLexerSQL
KeywordSet8 enum valueQextScintillaLexerSQL
language() const QextScintillaLexerSQL [virtual]
lexer() const QextScintillaLexerSQL [virtual]
LineComment enum valueQextScintillaLexerSQL
Number enum valueQextScintillaLexerSQL
Operator enum valueQextScintillaLexerSQL
paper(int style) const QextScintillaLexerSQL [virtual]
paperChanged(const QColor &c, int style)QextScintillaLexer [signal]
PlusComment enum valueQextScintillaLexerSQL
PlusKeyword enum valueQextScintillaLexerSQL
PlusPrompt enum valueQextScintillaLexerSQL
propertyChanged(const char *prop, const char *val)QextScintillaLexer [signal]
QextScintillaLexer(QObject *parent=0, const char *name=0)QextScintillaLexer
QextScintillaLexerSQL(QObject *parent=0, const char *name=0)QextScintillaLexerSQL
readProperties(QSettings &qs, const QString &prefix)QextScintillaLexerSQL [protected, virtual]
readSettings(QSettings &qs, const char *prefix="/Scintilla")QextScintillaLexer
refreshProperties()QextScintillaLexerSQL [virtual]
setAutoIndentStyle(int autoindentstyle)QextScintillaLexer [virtual, slot]
setBackslashEscapes(bool enable)QextScintillaLexerSQL [virtual, slot]
setColor(const QColor &c, int style=-1)QextScintillaLexer [virtual, slot]
setDefaultColor(const QColor &c)QextScintillaLexer [virtual, slot]
setDefaultFont(const QFont &f)QextScintillaLexer [virtual, slot]
setDefaultPaper(const QColor &c)QextScintillaLexer [virtual, slot]
setEolFill(bool eoffill, int style=-1)QextScintillaLexer [virtual, slot]
setFoldComments(bool fold)QextScintillaLexerSQL [virtual, slot]
setFoldCompact(bool fold)QextScintillaLexerSQL [virtual, slot]
setFont(const QFont &f, int style=-1)QextScintillaLexer [virtual, slot]
setPaper(const QColor &c, int style=-1)QextScintillaLexer [virtual, slot]
SingleQuotedString enum valueQextScintillaLexerSQL
wordCharacters() const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
writeProperties(QSettings &qs, const QString &prefix) const QextScintillaLexerSQL [protected, virtual]
writeSettings(QSettings &qs, const char *prefix="/Scintilla") const QextScintillaLexer
~QextScintillaLexer()QextScintillaLexer [virtual]
~QextScintillaLexerSQL()QextScintillaLexerSQL [virtual]


Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/classQextScintillaLexerSQL.html b/doc/html/classQextScintillaLexerSQL.html new file mode 100644 index 0000000..7960847 --- /dev/null +++ b/doc/html/classQextScintillaLexerSQL.html @@ -0,0 +1,629 @@ + + +QScintilla: QextScintillaLexerSQL Class Reference + + + + + + +

QextScintillaLexerSQL Class Reference

The QextScintillaLexerSQL class encapsulates the Scintilla SQL lexer. +More... +

+#include <qextscintillalexersql.h> +

+Inherits QextScintillaLexer. +

+List of all members.

Public Types

+ +

Public Slots

+ +

Public Member Functions

+ +

Protected Member Functions

+ +

Detailed Description

+The QextScintillaLexerSQL class encapsulates the Scintilla SQL lexer. +

+


Member Enumeration Documentation

+ +
+
+ + + + +
anonymous enum
+
+
+ +

+This enum defines the meanings of the different styles used by the SQL lexer.

Enumerator:
+ + + + + + + + + + + + + + + + + + + + + + +
Default  +The default.
Comment  +A comment.
CommentLine  +A line comment.
LineComment  +
Deprecated:
A line comment.
+
CommentDoc  +A JavaDoc/Doxygen style comment.
Number  +A number.
Keyword  +A keyword.
DoubleQuotedString  +A double-quoted string.
SingleQuotedString  +A single-quoted string.
PlusKeyword  +An SQL*Plus keyword.
PlusPrompt  +An SQL*Plus prompt.
Operator  +An operator.
Identifier  +An identifier.
PlusComment  +An SQL*Plus comment.
CommentLineHash  +A '#' line comment.
CommentDocKeyword  +A JavaDoc/Doxygen keyword.
CommentDocKeywordError  +A JavaDoc/Doxygen keyword error.
KeywordSet5  +A keyword defined in keyword set number 5. The class must be sub-classed and re-implement keywords() to make use of this style.
KeywordSet6  +A keyword defined in keyword set number 6. The class must be sub-classed and re-implement keywords() to make use of this style.
KeywordSet7  +A keyword defined in keyword set number 7. The class must be sub-classed and re-implement keywords() to make use of this style.
KeywordSet8  +A keyword defined in keyword set number 8. The class must be sub-classed and re-implement keywords() to make use of this style.
+
+ +
+

+


Constructor & Destructor Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + +
QextScintillaLexerSQL::QextScintillaLexerSQL (QObject *  parent = 0,
const char *  name = 0 
)
+
+
+ +

+Construct a QextScintillaLexerSQL with parent parent and name name. parent is typically the QextScintilla instance. +

+

+ +

+
+ + + + + + + + +
virtual QextScintillaLexerSQL::~QextScintillaLexerSQL (  )  [virtual]
+
+
+ +

+Destroys the QextScintillaLexerSQL instance. +

+ +

+

+


Member Function Documentation

+ +
+
+ + + + + + + + +
const char* QextScintillaLexerSQL::language (  )  const [virtual]
+
+
+ +

+Returns the name of the language. +

+ +

+Implements QextScintillaLexer. +

+

+ +

+
+ + + + + + + + +
const char* QextScintillaLexerSQL::lexer (  )  const [virtual]
+
+
+ +

+Returns the name of the lexer. Some lexers support a number of languages. +

+Implements QextScintillaLexer. +

+

+ +

+
+ + + + + + + + + +
QColor QextScintillaLexerSQL::color (int  style  )  const [virtual]
+
+
+ +

+Returns the foreground colour of the text for style number style.

+

See also:
paper()
+ +

+Reimplemented from QextScintillaLexer. +

+

+ +

+
+ + + + + + + + + +
bool QextScintillaLexerSQL::eolFill (int  style  )  const [virtual]
+
+
+ +

+Returns the end-of-line fill for style number style. +

+ +

+Reimplemented from QextScintillaLexer. +

+

+ +

+
+ + + + + + + + + +
QFont QextScintillaLexerSQL::font (int  style  )  const [virtual]
+
+
+ +

+Returns the font for style number style. +

+ +

+Reimplemented from QextScintillaLexer. +

+

+ +

+
+ + + + + + + + + +
const char* QextScintillaLexerSQL::keywords (int  set  )  const [virtual]
+
+
+ +

+Returns the set of keywords for the keyword set set recognised by the lexer as a space separated string. +

+Reimplemented from QextScintillaLexer. +

+

+ +

+
+ + + + + + + + + +
QString QextScintillaLexerSQL::description (int  style  )  const [virtual]
+
+
+ +

+Returns the descriptive name for style number style. If the style is invalid for this language then QString::null is returned. This is intended to be used in user preference dialogs. +

+Implements QextScintillaLexer. +

+

+ +

+
+ + + + + + + + + +
QColor QextScintillaLexerSQL::paper (int  style  )  const [virtual]
+
+
+ +

+Returns the background colour of the text for style number style.

+

See also:
color()
+ +

+Reimplemented from QextScintillaLexer. +

+

+ +

+
+ + + + + + + + +
void QextScintillaLexerSQL::refreshProperties (  )  [virtual]
+
+
+ +

+Causes all properties to be refreshed by emitting the propertyChanged() signal as required. +

+Reimplemented from QextScintillaLexer. +

+

+ +

+
+ + + + + + + + +
bool QextScintillaLexerSQL::foldComments (  )  const
+
+
+ +

+Returns TRUE if multi-line comment blocks can be folded.

+

See also:
setFoldComments()
+ +
+

+ +

+
+ + + + + + + + +
bool QextScintillaLexerSQL::foldCompact (  )  const
+
+
+ +

+Returns TRUE if trailing blank lines are included in a fold block.

+

See also:
setFoldCompact()
+ +
+

+ +

+
+ + + + + + + + +
bool QextScintillaLexerSQL::backslashEscapes (  )  const
+
+
+ +

+Returns TRUE if backslash escapes are enabled.

+

See also:
setBackslashEscapes()
+ +
+

+ +

+
+ + + + + + + + + +
virtual void QextScintillaLexerSQL::setFoldComments (bool  fold  )  [virtual, slot]
+
+
+ +

+If fold is TRUE then multi-line comment blocks can be folded. The default is FALSE.

+

See also:
foldComments()
+ +
+

+ +

+
+ + + + + + + + + +
virtual void QextScintillaLexerSQL::setFoldCompact (bool  fold  )  [virtual, slot]
+
+
+ +

+If fold is TRUE then trailing blank lines are included in a fold block. The default is TRUE.

+

See also:
foldCompact()
+ +
+

+ +

+
+ + + + + + + + + +
virtual void QextScintillaLexerSQL::setBackslashEscapes (bool  enable  )  [virtual, slot]
+
+
+ +

+If enable is TRUE then backslash escapes are enabled. The default is FALSE.

+

See also:
backslashEscapes()
+ +
+

+ +

+
+ + + + + + + + + + + + + + + + + + +
bool QextScintillaLexerSQL::readProperties (QSettings &  qs,
const QString &  prefix 
) [protected, virtual]
+
+
+ +

+The lexer's properties are read from the settings qs. prefix (which has a trailing '/') should be used as a prefix to the key of each setting. TRUE is returned if there is no error. +

+Reimplemented from QextScintillaLexer. +

+

+ +

+
+ + + + + + + + + + + + + + + + + + +
bool QextScintillaLexerSQL::writeProperties (QSettings &  qs,
const QString &  prefix 
) const [protected, virtual]
+
+
+ +

+The lexer's properties are written to the settings qs. prefix (which has a trailing '/') should be used as a prefix to the key of each setting. TRUE is returned if there is no error. +

+Reimplemented from QextScintillaLexer. +

+

+


Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/classQextScintillaLexerTeX-members.html b/doc/html/classQextScintillaLexerTeX-members.html new file mode 100644 index 0000000..4775fda --- /dev/null +++ b/doc/html/classQextScintillaLexerTeX-members.html @@ -0,0 +1,74 @@ + + +QScintilla: Member List + + + + + + +

QextScintillaLexerTeX Member List

This is the complete list of members for QextScintillaLexerTeX, including all inherited members.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
autoCompletionFillups() const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
autoCompletionStartCharacters() const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
autoIndentStyle()QextScintillaLexer
blockEnd(int *style=0) const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
blockLookback() const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
blockStart(int *style=0) const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
blockStartKeyword(int *style=0) const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
braceStyle() const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
color(int style) const QextScintillaLexerTeX [virtual]
colorChanged(const QColor &c, int style)QextScintillaLexer [signal]
Command enum valueQextScintillaLexerTeX
Default enum valueQextScintillaLexerTeX
defaultColor() const QextScintillaLexer [virtual]
defaultFont() const QextScintillaLexer [virtual]
defaultPaper() const QextScintillaLexer [virtual]
defaultStyle() const (defined in QextScintillaLexer)QextScintillaLexer [virtual]
description(int style) const QextScintillaLexerTeX [virtual]
eolFill(int style) const QextScintillaLexer [virtual]
eolFillChanged(bool eoffilled, int style)QextScintillaLexer [signal]
font(int style) const QextScintillaLexer [virtual]
fontChanged(const QFont &f, int style)QextScintillaLexer [signal]
Group enum valueQextScintillaLexerTeX
keywords(int set) const QextScintillaLexerTeX [virtual]
language() const QextScintillaLexerTeX [virtual]
lexer() const QextScintillaLexerTeX [virtual]
paper(int style) const QextScintillaLexer [virtual]
paperChanged(const QColor &c, int style)QextScintillaLexer [signal]
propertyChanged(const char *prop, const char *val)QextScintillaLexer [signal]
QextScintillaLexer(QObject *parent=0, const char *name=0)QextScintillaLexer
QextScintillaLexerTeX(QObject *parent=0, const char *name=0)QextScintillaLexerTeX
readProperties(QSettings &qs, const QString &prefix)QextScintillaLexer [protected, virtual]
readSettings(QSettings &qs, const char *prefix="/Scintilla")QextScintillaLexer
refreshProperties()QextScintillaLexer [virtual]
setAutoIndentStyle(int autoindentstyle)QextScintillaLexer [virtual, slot]
setColor(const QColor &c, int style=-1)QextScintillaLexer [virtual, slot]
setDefaultColor(const QColor &c)QextScintillaLexer [virtual, slot]
setDefaultFont(const QFont &f)QextScintillaLexer [virtual, slot]
setDefaultPaper(const QColor &c)QextScintillaLexer [virtual, slot]
setEolFill(bool eoffill, int style=-1)QextScintillaLexer [virtual, slot]
setFont(const QFont &f, int style=-1)QextScintillaLexer [virtual, slot]
setPaper(const QColor &c, int style=-1)QextScintillaLexer [virtual, slot]
Special enum valueQextScintillaLexerTeX
Symbol enum valueQextScintillaLexerTeX
Text enum valueQextScintillaLexerTeX
wordCharacters() const (defined in QextScintillaLexerTeX)QextScintillaLexerTeX [virtual]
writeProperties(QSettings &qs, const QString &prefix) const QextScintillaLexer [protected, virtual]
writeSettings(QSettings &qs, const char *prefix="/Scintilla") const QextScintillaLexer
~QextScintillaLexer()QextScintillaLexer [virtual]
~QextScintillaLexerTeX()QextScintillaLexerTeX [virtual]


Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/classQextScintillaLexerTeX.html b/doc/html/classQextScintillaLexerTeX.html new file mode 100644 index 0000000..76f6639 --- /dev/null +++ b/doc/html/classQextScintillaLexerTeX.html @@ -0,0 +1,261 @@ + + +QScintilla: QextScintillaLexerTeX Class Reference + + + + + + +

QextScintillaLexerTeX Class Reference

The QextScintillaLexerTeX class encapsulates the Scintilla TeX lexer. +More... +

+#include <qextscintillalexertex.h> +

+Inherits QextScintillaLexer. +

+List of all members.

Public Types

+ +

Public Member Functions

+ +

Detailed Description

+The QextScintillaLexerTeX class encapsulates the Scintilla TeX lexer. +

+


Member Enumeration Documentation

+ +
+
+ + + + +
anonymous enum
+
+
+ +

+This enum defines the meanings of the different styles used by the TeX lexer.

Enumerator:
+ + + + + + + +
Default  +The default.
Special  +A special.
Group  +A group.
Symbol  +A symbol.
Command  +A command.
Text  +Text.
+
+ +
+

+


Constructor & Destructor Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + +
QextScintillaLexerTeX::QextScintillaLexerTeX (QObject *  parent = 0,
const char *  name = 0 
)
+
+
+ +

+Construct a QextScintillaLexerTeX with parent parent and name name. parent is typically the QextScintilla instance. +

+

+ +

+
+ + + + + + + + +
virtual QextScintillaLexerTeX::~QextScintillaLexerTeX (  )  [virtual]
+
+
+ +

+Destroys the QextScintillaLexerTeX instance. +

+ +

+

+


Member Function Documentation

+ +
+
+ + + + + + + + +
const char* QextScintillaLexerTeX::language (  )  const [virtual]
+
+
+ +

+Returns the name of the language. +

+ +

+Implements QextScintillaLexer. +

+

+ +

+
+ + + + + + + + +
const char* QextScintillaLexerTeX::lexer (  )  const [virtual]
+
+
+ +

+Returns the name of the lexer. Some lexers support a number of languages. +

+Implements QextScintillaLexer. +

+

+ +

+
+ + + + + + + + + +
QColor QextScintillaLexerTeX::color (int  style  )  const [virtual]
+
+
+ +

+Returns the foreground colour of the text for style number style.

+

See also:
paper()
+ +

+Reimplemented from QextScintillaLexer. +

+

+ +

+
+ + + + + + + + + +
const char* QextScintillaLexerTeX::keywords (int  set  )  const [virtual]
+
+
+ +

+Returns the set of keywords for the keyword set set recognised by the lexer as a space separated string. +

+Reimplemented from QextScintillaLexer. +

+

+ +

+
+ + + + + + + + + +
QString QextScintillaLexerTeX::description (int  style  )  const [virtual]
+
+
+ +

+Returns the descriptive name for style number style. If the style is invalid for this language then QString::null is returned. This is intended to be used in user preference dialogs. +

+Implements QextScintillaLexer. +

+

+


Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/classQextScintillaMacro-members.html b/doc/html/classQextScintillaMacro-members.html new file mode 100644 index 0000000..1ce7114 --- /dev/null +++ b/doc/html/classQextScintillaMacro-members.html @@ -0,0 +1,34 @@ + + +QScintilla: Member List + + + + + + +

QextScintillaMacro Member List

This is the complete list of members for QextScintillaMacro, including all inherited members.

+ + + + + + + + + +
clear()QextScintillaMacro
endRecording()QextScintillaMacro [virtual, slot]
load(const QCString &asc)QextScintillaMacro
play()QextScintillaMacro [virtual, slot]
QextScintillaMacro(QextScintilla *parent, const char *name=0)QextScintillaMacro
QextScintillaMacro(const QCString &asc, QextScintilla *parent, const char *name=0)QextScintillaMacro
save() const QextScintillaMacro
startRecording()QextScintillaMacro [virtual, slot]
~QextScintillaMacro()QextScintillaMacro [virtual]


Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/classQextScintillaMacro.html b/doc/html/classQextScintillaMacro.html new file mode 100644 index 0000000..7102abb --- /dev/null +++ b/doc/html/classQextScintillaMacro.html @@ -0,0 +1,267 @@ + + +QScintilla: QextScintillaMacro Class Reference + + + + + + +

QextScintillaMacro Class Reference

The QextScintillaMacro class represents a sequence of recordable editor commands. +More... +

+#include <qextscintillamacro.h> +

+List of all members.

Public Slots

+ +

Public Member Functions

+ +

Classes

+
    +
  • struct Macro +
+

Detailed Description

+The QextScintillaMacro class represents a sequence of recordable editor commands. +

+Methods are provided to convert convert a macro to and from a textual representation so that they can be easily written to and read from permanent storage. +

+


Constructor & Destructor Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + +
QextScintillaMacro::QextScintillaMacro (QextScintilla parent,
const char *  name = 0 
)
+
+
+ +

+Construct a QextScintillaMacro with parent parent and name name. +

+

+ +

+
+ + + + + + + + + + + + + + + + + + + + + + + + +
QextScintillaMacro::QextScintillaMacro (const QCString &  asc,
QextScintilla parent,
const char *  name = 0 
)
+
+
+ +

+Construct a QextScintillaMacro from the printable ASCII representation asc, with parent parent and name name. +

+

+ +

+
+ + + + + + + + +
virtual QextScintillaMacro::~QextScintillaMacro (  )  [virtual]
+
+
+ +

+Destroy the QextScintillaMacro instance. +

+ +

+

+


Member Function Documentation

+ +
+
+ + + + + + + + +
void QextScintillaMacro::clear (  ) 
+
+
+ +

+Clear the contents of the macro. +

+ +

+

+ +

+
+ + + + + + + + + +
bool QextScintillaMacro::load (const QCString &  asc  ) 
+
+
+ +

+Load the macro from the printable ASCII representation asc. Returns TRUE if there was no error.

+

See also:
save()
+ +
+

+ +

+
+ + + + + + + + +
QCString QextScintillaMacro::save (  )  const
+
+
+ +

+Return a printable ASCII representation of the macro. It is guaranteed that only printable ASCII characters are used and that double quote characters will not be used.

+

See also:
load()
+ +
+

+ +

+
+ + + + + + + + +
virtual void QextScintillaMacro::play (  )  [virtual, slot]
+
+
+ +

+Play the macro. +

+ +

+

+ +

+
+ + + + + + + + +
virtual void QextScintillaMacro::startRecording (  )  [virtual, slot]
+
+
+ +

+Start recording user commands and add them to the macro. +

+ +

+

+ +

+
+ + + + + + + + +
virtual void QextScintillaMacro::endRecording (  )  [virtual, slot]
+
+
+ +

+Stop recording user commands. +

+ +

+

+


Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/classQextScintillaPrinter-members.html b/doc/html/classQextScintillaPrinter-members.html new file mode 100644 index 0000000..64e416d --- /dev/null +++ b/doc/html/classQextScintillaPrinter-members.html @@ -0,0 +1,33 @@ + + +QScintilla: Member List + + + + + + +

QextScintillaPrinter Member List

This is the complete list of members for QextScintillaPrinter, including all inherited members.

+ + + + + + + + +
formatPage(QPainter &painter, bool drawing, QRect &area, int pagenr)QextScintillaPrinter [virtual]
magnification() const QextScintillaPrinter [inline]
printRange(QextScintillaBase *qsb, int from=-1, int to=-1)QextScintillaPrinter [virtual]
QextScintillaPrinter(PrinterMode mode=ScreenResolution)QextScintillaPrinter
setMagnification(int magnification)QextScintillaPrinter [virtual]
setWrapMode(QextScintilla::WrapMode wmode)QextScintillaPrinter [virtual]
wrapMode() const QextScintillaPrinter [inline]
~QextScintillaPrinter()QextScintillaPrinter


Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/classQextScintillaPrinter.html b/doc/html/classQextScintillaPrinter.html new file mode 100644 index 0000000..1e829ca --- /dev/null +++ b/doc/html/classQextScintillaPrinter.html @@ -0,0 +1,252 @@ + + +QScintilla: QextScintillaPrinter Class Reference + + + + + + +

QextScintillaPrinter Class Reference

The QextScintillaPrinter class is a sub-class of the Qt QPrinter class that is able to print the text of a Scintilla document. +More... +

+#include <qextscintillaprinter.h> +

+List of all members.

Public Member Functions

+ +

Detailed Description

+The QextScintillaPrinter class is a sub-class of the Qt QPrinter class that is able to print the text of a Scintilla document. +

+The class can be further sub-classed to alter to layout of the text, adding headers and footers for example. +

+


Constructor & Destructor Documentation

+ +
+
+ + + + + + + + + +
QextScintillaPrinter::QextScintillaPrinter (PrinterMode  mode = ScreenResolution  ) 
+
+
+ +

+Constructs a printer paint device with mode mode. +

+ +

+

+ +

+
+ + + + + + + + +
QextScintillaPrinter::~QextScintillaPrinter (  ) 
+
+
+ +

+Destroys the QextScintillaPrinter instance. +

+ +

+

+


Member Function Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
virtual void QextScintillaPrinter::formatPage (QPainter &  painter,
bool  drawing,
QRect &  area,
int  pagenr 
) [virtual]
+
+
+ +

+Format a page, by adding headers and footers for example, before the document text is drawn on it. painter is the painter to be used to add customised text and graphics. drawing is TRUE if the page is actually being drawn rather than being sized. painter drawing methods must only be called when drawing is TRUE. area is the area of the page that will be used to draw the text. This should be modified if it is necessary to reserve space for any customised text or graphics. By default the area is relative to the printable area of the page. Use QPrinter::setFullPage() because calling printRange() if you want to try and print over the whole page. pagenr is the number of the page. The first page is numbered 1. +

+

+ +

+
+ + + + + + + + +
int QextScintillaPrinter::magnification (  )  const [inline]
+
+
+ +

+Return the number of points to add to each font when printing.

+

See also:
setMagnification()
+ +
+

+ +

+
+ + + + + + + + + +
virtual void QextScintillaPrinter::setMagnification (int  magnification  )  [virtual]
+
+
+ +

+Sets the number of points to add to each font when printing to magnification.

+

See also:
magnification()
+ +
+

+ +

+
+ + + + + + + + + + + + + + + + + + + + + + + + +
virtual int QextScintillaPrinter::printRange (QextScintillaBase qsb,
int  from = -1,
int  to = -1 
) [virtual]
+
+
+ +

+Print a range of lines from the Scintilla instance qsb. from is the first line to print and a negative value signifies the first line of text. to is the last line to print and a negative value signifies the last line of text. TRUE is returned if there was no error. +

+

+ +

+
+ + + + + + + + +
QextScintilla::WrapMode QextScintillaPrinter::wrapMode (  )  const [inline]
+
+
+ +

+Return the line wrap mode used when printing. The default is QextScintilla::WrapWord.

+

See also:
setWrapMode()
+ +
+

+ +

+
+ + + + + + + + + +
virtual void QextScintillaPrinter::setWrapMode (QextScintilla::WrapMode  wmode  )  [virtual]
+
+
+ +

+Sets the line wrap mode used when printing to wmode.

+

See also:
wrapMode()
+ +
+

+


Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/deprecated.html b/doc/html/deprecated.html new file mode 100644 index 0000000..7a37e8e --- /dev/null +++ b/doc/html/deprecated.html @@ -0,0 +1,42 @@ + + +QScintilla: Deprecated List + + + + + +

Deprecated List

+
Member QextScintillaLexerBash::WhiteSpace
+
White space.
+
+

+

+
Member QextScintillaLexerCPP::WhiteSpace
+
White space.
+
+

+

+
Member QextScintillaLexerPerl::WhiteSpace
+
White space.
+
+

+

+
Member QextScintillaLexerPython::WhiteSpace
+
White space.
+
+

+

+
Member QextScintillaLexerSQL::LineComment
+
A line comment.
+
+
Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/doxygen.css b/doc/html/doxygen.css new file mode 100644 index 0000000..5d58369 --- /dev/null +++ b/doc/html/doxygen.css @@ -0,0 +1,358 @@ +BODY,H1,H2,H3,H4,H5,H6,P,CENTER,TD,TH,UL,DL,DIV { + font-family: Geneva, Arial, Helvetica, sans-serif; +} +BODY,TD { + font-size: 90%; +} +H1 { + text-align: center; + font-size: 160%; +} +H2 { + font-size: 120%; +} +H3 { + font-size: 100%; +} +CAPTION { font-weight: bold } +DIV.qindex { + width: 100%; + background-color: #e8eef2; + border: 1px solid #84b0c7; + text-align: center; + margin: 2px; + padding: 2px; + line-height: 140%; +} +DIV.nav { + width: 100%; + background-color: #e8eef2; + border: 1px solid #84b0c7; + text-align: center; + margin: 2px; + padding: 2px; + line-height: 140%; +} +DIV.navtab { + background-color: #e8eef2; + border: 1px solid #84b0c7; + text-align: center; + margin: 2px; + margin-right: 15px; + padding: 2px; +} +TD.navtab { + font-size: 70%; +} +A.qindex { + text-decoration: none; + font-weight: bold; + color: #1A419D; +} +A.qindex:visited { + text-decoration: none; + font-weight: bold; + color: #1A419D +} +A.qindex:hover { + text-decoration: none; + background-color: #ddddff; +} +A.qindexHL { + text-decoration: none; + font-weight: bold; + background-color: #6666cc; + color: #ffffff; + border: 1px double #9295C2; +} +A.qindexHL:hover { + text-decoration: none; + background-color: #6666cc; + color: #ffffff; +} +A.qindexHL:visited { text-decoration: none; background-color: #6666cc; color: #ffffff } +A.el { text-decoration: none; font-weight: bold } +A.elRef { font-weight: bold } +A.code:link { text-decoration: none; font-weight: normal; color: #0000FF} +A.code:visited { text-decoration: none; font-weight: normal; color: #0000FF} +A.codeRef:link { font-weight: normal; color: #0000FF} +A.codeRef:visited { font-weight: normal; color: #0000FF} +A:hover { text-decoration: none; background-color: #f2f2ff } +DL.el { margin-left: -1cm } +.fragment { + font-family: monospace, fixed; + font-size: 95%; +} +PRE.fragment { + border: 1px solid #CCCCCC; + background-color: #f5f5f5; + margin-top: 4px; + margin-bottom: 4px; + margin-left: 2px; + margin-right: 8px; + padding-left: 6px; + padding-right: 6px; + padding-top: 4px; + padding-bottom: 4px; +} +DIV.ah { background-color: black; font-weight: bold; color: #ffffff; margin-bottom: 3px; margin-top: 3px } + +DIV.groupHeader { + margin-left: 16px; + margin-top: 12px; + margin-bottom: 6px; + font-weight: bold; +} +DIV.groupText { margin-left: 16px; font-style: italic; font-size: 90% } +BODY { + background: white; + color: black; + margin-right: 20px; + margin-left: 20px; +} +TD.indexkey { + background-color: #e8eef2; + font-weight: bold; + padding-right : 10px; + padding-top : 2px; + padding-left : 10px; + padding-bottom : 2px; + margin-left : 0px; + margin-right : 0px; + margin-top : 2px; + margin-bottom : 2px; + border: 1px solid #CCCCCC; +} +TD.indexvalue { + background-color: #e8eef2; + font-style: italic; + padding-right : 10px; + padding-top : 2px; + padding-left : 10px; + padding-bottom : 2px; + margin-left : 0px; + margin-right : 0px; + margin-top : 2px; + margin-bottom : 2px; + border: 1px solid #CCCCCC; +} +TR.memlist { + background-color: #f0f0f0; +} +P.formulaDsp { text-align: center; } +IMG.formulaDsp { } +IMG.formulaInl { vertical-align: middle; } +SPAN.keyword { color: #008000 } +SPAN.keywordtype { color: #604020 } +SPAN.keywordflow { color: #e08000 } +SPAN.comment { color: #800000 } +SPAN.preprocessor { color: #806020 } +SPAN.stringliteral { color: #002080 } +SPAN.charliteral { color: #008080 } +.mdescLeft { + padding: 0px 8px 4px 8px; + font-size: 80%; + font-style: italic; + background-color: #FAFAFA; + border-top: 1px none #E0E0E0; + border-right: 1px none #E0E0E0; + border-bottom: 1px none #E0E0E0; + border-left: 1px none #E0E0E0; + margin: 0px; +} +.mdescRight { + padding: 0px 8px 4px 8px; + font-size: 80%; + font-style: italic; + background-color: #FAFAFA; + border-top: 1px none #E0E0E0; + border-right: 1px none #E0E0E0; + border-bottom: 1px none #E0E0E0; + border-left: 1px none #E0E0E0; + margin: 0px; +} +.memItemLeft { + padding: 1px 0px 0px 8px; + margin: 4px; + border-top-width: 1px; + border-right-width: 1px; + border-bottom-width: 1px; + border-left-width: 1px; + border-top-color: #E0E0E0; + border-right-color: #E0E0E0; + border-bottom-color: #E0E0E0; + border-left-color: #E0E0E0; + border-top-style: solid; + border-right-style: none; + border-bottom-style: none; + border-left-style: none; + background-color: #FAFAFA; + font-size: 80%; +} +.memItemRight { + padding: 1px 8px 0px 8px; + margin: 4px; + border-top-width: 1px; + border-right-width: 1px; + border-bottom-width: 1px; + border-left-width: 1px; + border-top-color: #E0E0E0; + border-right-color: #E0E0E0; + border-bottom-color: #E0E0E0; + border-left-color: #E0E0E0; + border-top-style: solid; + border-right-style: none; + border-bottom-style: none; + border-left-style: none; + background-color: #FAFAFA; + font-size: 80%; +} +.memTemplItemLeft { + padding: 1px 0px 0px 8px; + margin: 4px; + border-top-width: 1px; + border-right-width: 1px; + border-bottom-width: 1px; + border-left-width: 1px; + border-top-color: #E0E0E0; + border-right-color: #E0E0E0; + border-bottom-color: #E0E0E0; + border-left-color: #E0E0E0; + border-top-style: none; + border-right-style: none; + border-bottom-style: none; + border-left-style: none; + background-color: #FAFAFA; + font-size: 80%; +} +.memTemplItemRight { + padding: 1px 8px 0px 8px; + margin: 4px; + border-top-width: 1px; + border-right-width: 1px; + border-bottom-width: 1px; + border-left-width: 1px; + border-top-color: #E0E0E0; + border-right-color: #E0E0E0; + border-bottom-color: #E0E0E0; + border-left-color: #E0E0E0; + border-top-style: none; + border-right-style: none; + border-bottom-style: none; + border-left-style: none; + background-color: #FAFAFA; + font-size: 80%; +} +.memTemplParams { + padding: 1px 0px 0px 8px; + margin: 4px; + border-top-width: 1px; + border-right-width: 1px; + border-bottom-width: 1px; + border-left-width: 1px; + border-top-color: #E0E0E0; + border-right-color: #E0E0E0; + border-bottom-color: #E0E0E0; + border-left-color: #E0E0E0; + border-top-style: solid; + border-right-style: none; + border-bottom-style: none; + border-left-style: none; + color: #606060; + background-color: #FAFAFA; + font-size: 80%; +} +.search { color: #003399; + font-weight: bold; +} +FORM.search { + margin-bottom: 0px; + margin-top: 0px; +} +INPUT.search { font-size: 75%; + color: #000080; + font-weight: normal; + background-color: #e8eef2; +} +TD.tiny { font-size: 75%; +} +a { + color: #1A41A8; +} +a:visited { + color: #2A3798; +} +.dirtab { padding: 4px; + border-collapse: collapse; + border: 1px solid #84b0c7; +} +TH.dirtab { background: #e8eef2; + font-weight: bold; +} +HR { height: 1px; + border: none; + border-top: 1px solid black; +} + +/* Style for detailed member documentation */ +.memtemplate { + font-size: 80%; + color: #606060; + font-weight: normal; +} +.memnav { + background-color: #e8eef2; + border: 1px solid #84b0c7; + text-align: center; + margin: 2px; + margin-right: 15px; + padding: 2px; +} +.memitem { + padding: 4px; + background-color: #eef3f5; + border-width: 1px; + border-style: solid; + border-color: #dedeee; + -moz-border-radius: 8px 8px 8px 8px; +} +.memname { + white-space: nowrap; + font-weight: bold; +} +.memdoc{ + padding-left: 10px; +} +.memproto { + background-color: #d5e1e8; + width: 100%; + border-width: 1px; + border-style: solid; + border-color: #84b0c7; + font-weight: bold; + -moz-border-radius: 8px 8px 8px 8px; +} +.paramkey { + text-align: right; +} +.paramtype { + white-space: nowrap; +} +.paramname { + color: #602020; + font-style: italic; +} +/* End Styling for detailed member documentation */ + +/* for the tree view */ +.ftvtree { + font-family: sans-serif; + margin:0.5em; +} +.directory { font-size: 9pt; font-weight: bold; } +.directory h3 { margin: 0px; margin-top: 1em; font-size: 11pt; } +.directory > h3 { margin-top: 0; } +.directory p { margin: 0px; white-space: nowrap; } +.directory div { display: none; margin: 0px; } +.directory img { vertical-align: -30%; } + diff --git a/doc/html/doxygen.png b/doc/html/doxygen.png new file mode 100644 index 0000000..f0a274b Binary files /dev/null and b/doc/html/doxygen.png differ diff --git a/doc/html/functions.html b/doc/html/functions.html new file mode 100644 index 0000000..ee811c5 --- /dev/null +++ b/doc/html/functions.html @@ -0,0 +1,130 @@ + + +QScintilla: Class Members + + + + + + + +
+ +
+ +

+Here is a list of all documented class members with links to the class documentation for each member: +

+

- a -

+
Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/functions_0x62.html b/doc/html/functions_0x62.html new file mode 100644 index 0000000..039cd58 --- /dev/null +++ b/doc/html/functions_0x62.html @@ -0,0 +1,85 @@ + + +QScintilla: Class Members + + + + + + + +
+ +
+ +

+Here is a list of all documented class members with links to the class documentation for each member: +

+

- b -

+
Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/functions_0x63.html b/doc/html/functions_0x63.html new file mode 100644 index 0000000..19b6193 --- /dev/null +++ b/doc/html/functions_0x63.html @@ -0,0 +1,108 @@ + + +QScintilla: Class Members + + + + + + + +
+ +
+ +

+Here is a list of all documented class members with links to the class documentation for each member: +

+

- c -

+
Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/functions_0x64.html b/doc/html/functions_0x64.html new file mode 100644 index 0000000..e84403b --- /dev/null +++ b/doc/html/functions_0x64.html @@ -0,0 +1,82 @@ + + +QScintilla: Class Members + + + + + + + +
+ +
+ +

+Here is a list of all documented class members with links to the class documentation for each member: +

+

- d -

+
Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/functions_0x65.html b/doc/html/functions_0x65.html new file mode 100644 index 0000000..dc2d1ca --- /dev/null +++ b/doc/html/functions_0x65.html @@ -0,0 +1,91 @@ + + +QScintilla: Class Members + + + + + + + +
+ +
+ +

+Here is a list of all documented class members with links to the class documentation for each member: +

+

- e -

+
Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/functions_0x66.html b/doc/html/functions_0x66.html new file mode 100644 index 0000000..39551a6 --- /dev/null +++ b/doc/html/functions_0x66.html @@ -0,0 +1,88 @@ + + +QScintilla: Class Members + + + + + + + +
+ +
+ +

+Here is a list of all documented class members with links to the class documentation for each member: +

+

- f -

+
Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/functions_0x67.html b/doc/html/functions_0x67.html new file mode 100644 index 0000000..f04e8e0 --- /dev/null +++ b/doc/html/functions_0x67.html @@ -0,0 +1,73 @@ + + +QScintilla: Class Members + + + + + + + +
+ +
+ +

+Here is a list of all documented class members with links to the class documentation for each member: +

+

- g -

+
Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/functions_0x68.html b/doc/html/functions_0x68.html new file mode 100644 index 0000000..7d0385a --- /dev/null +++ b/doc/html/functions_0x68.html @@ -0,0 +1,80 @@ + + +QScintilla: Class Members + + + + + + + +
+ +
+ +

+Here is a list of all documented class members with links to the class documentation for each member: +

+

- h -

+
Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/functions_0x69.html b/doc/html/functions_0x69.html new file mode 100644 index 0000000..af4a83c --- /dev/null +++ b/doc/html/functions_0x69.html @@ -0,0 +1,90 @@ + + +QScintilla: Class Members + + + + + + + +
+ +
+ +

+Here is a list of all documented class members with links to the class documentation for each member: +

+

- i -

+
Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/functions_0x6a.html b/doc/html/functions_0x6a.html new file mode 100644 index 0000000..f61c58d --- /dev/null +++ b/doc/html/functions_0x6a.html @@ -0,0 +1,81 @@ + + +QScintilla: Class Members + + + + + + + +
+ +
+ +

+Here is a list of all documented class members with links to the class documentation for each member: +

+

- j -

+
Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/functions_0x6b.html b/doc/html/functions_0x6b.html new file mode 100644 index 0000000..9400d87 --- /dev/null +++ b/doc/html/functions_0x6b.html @@ -0,0 +1,77 @@ + + +QScintilla: Class Members + + + + + + + +
+ +
+ +

+Here is a list of all documented class members with links to the class documentation for each member: +

+

- k -

+
Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/functions_0x6c.html b/doc/html/functions_0x6c.html new file mode 100644 index 0000000..0a2379f --- /dev/null +++ b/doc/html/functions_0x6c.html @@ -0,0 +1,82 @@ + + +QScintilla: Class Members + + + + + + + +
+ +
+ +

+Here is a list of all documented class members with links to the class documentation for each member: +

+

- l -

+
Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/functions_0x6d.html b/doc/html/functions_0x6d.html new file mode 100644 index 0000000..3f20854 --- /dev/null +++ b/doc/html/functions_0x6d.html @@ -0,0 +1,89 @@ + + +QScintilla: Class Members + + + + + + + +
+ +
+ +

+Here is a list of all documented class members with links to the class documentation for each member: +

+

- m -

+
Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/functions_0x6e.html b/doc/html/functions_0x6e.html new file mode 100644 index 0000000..7d3ce9e --- /dev/null +++ b/doc/html/functions_0x6e.html @@ -0,0 +1,72 @@ + + +QScintilla: Class Members + + + + + + + +
+ +
+ +

+Here is a list of all documented class members with links to the class documentation for each member: +

+

- n -

+
Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/functions_0x6f.html b/doc/html/functions_0x6f.html new file mode 100644 index 0000000..ccb61e4 --- /dev/null +++ b/doc/html/functions_0x6f.html @@ -0,0 +1,71 @@ + + +QScintilla: Class Members + + + + + + + +
+ +
+ +

+Here is a list of all documented class members with links to the class documentation for each member: +

+

- o -

+
Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/functions_0x70.html b/doc/html/functions_0x70.html new file mode 100644 index 0000000..f1c8807 --- /dev/null +++ b/doc/html/functions_0x70.html @@ -0,0 +1,118 @@ + + +QScintilla: Class Members + + + + + + + +
+ +
+ +

+Here is a list of all documented class members with links to the class documentation for each member: +

+

- p -

+
Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/functions_0x71.html b/doc/html/functions_0x71.html new file mode 100644 index 0000000..dc84b2e --- /dev/null +++ b/doc/html/functions_0x71.html @@ -0,0 +1,100 @@ + + +QScintilla: Class Members + + + + + + + +
+ +
+ +

+Here is a list of all documented class members with links to the class documentation for each member: +

+

- q -

+
Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/functions_0x72.html b/doc/html/functions_0x72.html new file mode 100644 index 0000000..e1d3a5f --- /dev/null +++ b/doc/html/functions_0x72.html @@ -0,0 +1,84 @@ + + +QScintilla: Class Members + + + + + + + +
+ +
+ +

+Here is a list of all documented class members with links to the class documentation for each member: +

+

- r -

+
Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/functions_0x73.html b/doc/html/functions_0x73.html new file mode 100644 index 0000000..4c0e473 --- /dev/null +++ b/doc/html/functions_0x73.html @@ -0,0 +1,360 @@ + + +QScintilla: Class Members + + + + + + + +
+ +
+ +

+Here is a list of all documented class members with links to the class documentation for each member: +

+

- s -

+
Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/functions_0x74.html b/doc/html/functions_0x74.html new file mode 100644 index 0000000..a489bf4 --- /dev/null +++ b/doc/html/functions_0x74.html @@ -0,0 +1,83 @@ + + +QScintilla: Class Members + + + + + + + +
+ +
+ +

+Here is a list of all documented class members with links to the class documentation for each member: +

+

- t -

+
Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/functions_0x75.html b/doc/html/functions_0x75.html new file mode 100644 index 0000000..bc94eaa --- /dev/null +++ b/doc/html/functions_0x75.html @@ -0,0 +1,77 @@ + + +QScintilla: Class Members + + + + + + + +
+ +
+ +

+Here is a list of all documented class members with links to the class documentation for each member: +

+

- u -

+
Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/functions_0x76.html b/doc/html/functions_0x76.html new file mode 100644 index 0000000..7654546 --- /dev/null +++ b/doc/html/functions_0x76.html @@ -0,0 +1,82 @@ + + +QScintilla: Class Members + + + + + + + +
+ +
+ +

+Here is a list of all documented class members with links to the class documentation for each member: +

+

- v -

+
Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/functions_0x77.html b/doc/html/functions_0x77.html new file mode 100644 index 0000000..7ec4d6a --- /dev/null +++ b/doc/html/functions_0x77.html @@ -0,0 +1,85 @@ + + +QScintilla: Class Members + + + + + + + +
+ +
+ +

+Here is a list of all documented class members with links to the class documentation for each member: +

+

- w -

+
Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/functions_0x78.html b/doc/html/functions_0x78.html new file mode 100644 index 0000000..f21ec8d --- /dev/null +++ b/doc/html/functions_0x78.html @@ -0,0 +1,71 @@ + + +QScintilla: Class Members + + + + + + + +
+ +
+ +

+Here is a list of all documented class members with links to the class documentation for each member: +

+

- x -

+
Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/functions_0x7a.html b/doc/html/functions_0x7a.html new file mode 100644 index 0000000..2a99df9 --- /dev/null +++ b/doc/html/functions_0x7a.html @@ -0,0 +1,71 @@ + + +QScintilla: Class Members + + + + + + + +
+ +
+ +

+Here is a list of all documented class members with links to the class documentation for each member: +

+

- z -

+
Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/functions_0x7e.html b/doc/html/functions_0x7e.html new file mode 100644 index 0000000..b1a6c22 --- /dev/null +++ b/doc/html/functions_0x7e.html @@ -0,0 +1,93 @@ + + +QScintilla: Class Members + + + + + + + +
+ +
+ +

+Here is a list of all documented class members with links to the class documentation for each member: +

+

- ~ -

+
Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/functions_enum.html b/doc/html/functions_enum.html new file mode 100644 index 0000000..7fcaf4b --- /dev/null +++ b/doc/html/functions_enum.html @@ -0,0 +1,46 @@ + + +QScintilla: Class Members - Enumerations + + + + + + + +  +

+

+
Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/functions_eval.html b/doc/html/functions_eval.html new file mode 100644 index 0000000..0c1f1bd --- /dev/null +++ b/doc/html/functions_eval.html @@ -0,0 +1,113 @@ + + +QScintilla: Class Members - Enumerator + + + + + + + +
+ +
+ +

+  +

+

- a -

+
Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/functions_eval_0x62.html b/doc/html/functions_eval_0x62.html new file mode 100644 index 0000000..e3df794 --- /dev/null +++ b/doc/html/functions_eval_0x62.html @@ -0,0 +1,78 @@ + + +QScintilla: Class Members - Enumerator + + + + + + + +
+ +
+ +

+  +

+

- b -

+
Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/functions_eval_0x63.html b/doc/html/functions_eval_0x63.html new file mode 100644 index 0000000..9e0638f --- /dev/null +++ b/doc/html/functions_eval_0x63.html @@ -0,0 +1,90 @@ + + +QScintilla: Class Members - Enumerator + + + + + + + +
+ +
+ +

+  +

+

- c -

+
Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/functions_eval_0x64.html b/doc/html/functions_eval_0x64.html new file mode 100644 index 0000000..8f7856f --- /dev/null +++ b/doc/html/functions_eval_0x64.html @@ -0,0 +1,75 @@ + + +QScintilla: Class Members - Enumerator + + + + + + + +
+ +
+ +

+  +

+

- d -

+
Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/functions_eval_0x65.html b/doc/html/functions_eval_0x65.html new file mode 100644 index 0000000..5fe6872 --- /dev/null +++ b/doc/html/functions_eval_0x65.html @@ -0,0 +1,75 @@ + + +QScintilla: Class Members - Enumerator + + + + + + + +
+ +
+ +

+  +

+

- e -

+
Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/functions_eval_0x66.html b/doc/html/functions_eval_0x66.html new file mode 100644 index 0000000..13b36ba --- /dev/null +++ b/doc/html/functions_eval_0x66.html @@ -0,0 +1,67 @@ + + +QScintilla: Class Members - Enumerator + + + + + + + +
+ +
+ +

+  +

+

- f -

+
Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/functions_eval_0x67.html b/doc/html/functions_eval_0x67.html new file mode 100644 index 0000000..00bfbb6 --- /dev/null +++ b/doc/html/functions_eval_0x67.html @@ -0,0 +1,69 @@ + + +QScintilla: Class Members - Enumerator + + + + + + + +
+ +
+ +

+  +

+

- g -

+
Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/functions_eval_0x68.html b/doc/html/functions_eval_0x68.html new file mode 100644 index 0000000..e7b589a --- /dev/null +++ b/doc/html/functions_eval_0x68.html @@ -0,0 +1,77 @@ + + +QScintilla: Class Members - Enumerator + + + + + + + +
+ +
+ +

+  +

+

- h -

+
Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/functions_eval_0x69.html b/doc/html/functions_eval_0x69.html new file mode 100644 index 0000000..44344aa --- /dev/null +++ b/doc/html/functions_eval_0x69.html @@ -0,0 +1,72 @@ + + +QScintilla: Class Members - Enumerator + + + + + + + +
+ +
+ +

+  +

+

- i -

+
Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/functions_eval_0x6a.html b/doc/html/functions_eval_0x6a.html new file mode 100644 index 0000000..9b3fd9b --- /dev/null +++ b/doc/html/functions_eval_0x6a.html @@ -0,0 +1,79 @@ + + +QScintilla: Class Members - Enumerator + + + + + + + +
+ +
+ +

+  +

+

- j -

+
Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/functions_eval_0x6b.html b/doc/html/functions_eval_0x6b.html new file mode 100644 index 0000000..fe892fe --- /dev/null +++ b/doc/html/functions_eval_0x6b.html @@ -0,0 +1,72 @@ + + +QScintilla: Class Members - Enumerator + + + + + + + +
+ +
+ +

+  +

+

- k -

+
Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/functions_eval_0x6c.html b/doc/html/functions_eval_0x6c.html new file mode 100644 index 0000000..507e916 --- /dev/null +++ b/doc/html/functions_eval_0x6c.html @@ -0,0 +1,73 @@ + + +QScintilla: Class Members - Enumerator + + + + + + + +
+ +
+ +

+  +

+

- l -

+
Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/functions_eval_0x6d.html b/doc/html/functions_eval_0x6d.html new file mode 100644 index 0000000..d5e122d --- /dev/null +++ b/doc/html/functions_eval_0x6d.html @@ -0,0 +1,68 @@ + + +QScintilla: Class Members - Enumerator + + + + + + + +
+ +
+ +

+  +

+

- m -

+
Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/functions_eval_0x6e.html b/doc/html/functions_eval_0x6e.html new file mode 100644 index 0000000..b5de1d7 --- /dev/null +++ b/doc/html/functions_eval_0x6e.html @@ -0,0 +1,70 @@ + + +QScintilla: Class Members - Enumerator + + + + + + + +
+ +
+ +

+  +

+

- n -

+
Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/functions_eval_0x6f.html b/doc/html/functions_eval_0x6f.html new file mode 100644 index 0000000..498fc39 --- /dev/null +++ b/doc/html/functions_eval_0x6f.html @@ -0,0 +1,69 @@ + + +QScintilla: Class Members - Enumerator + + + + + + + +
+ +
+ +

+  +

+

- o -

+
Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/functions_eval_0x70.html b/doc/html/functions_eval_0x70.html new file mode 100644 index 0000000..3fb3fd8 --- /dev/null +++ b/doc/html/functions_eval_0x70.html @@ -0,0 +1,109 @@ + + +QScintilla: Class Members - Enumerator + + + + + + + +
+ +
+ +

+  +

+

- p -

+
Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/functions_eval_0x71.html b/doc/html/functions_eval_0x71.html new file mode 100644 index 0000000..26be482 --- /dev/null +++ b/doc/html/functions_eval_0x71.html @@ -0,0 +1,71 @@ + + +QScintilla: Class Members - Enumerator + + + + + + + +
+ +
+ +

+  +

+

- q -

+
Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/functions_eval_0x72.html b/doc/html/functions_eval_0x72.html new file mode 100644 index 0000000..608d141 --- /dev/null +++ b/doc/html/functions_eval_0x72.html @@ -0,0 +1,71 @@ + + +QScintilla: Class Members - Enumerator + + + + + + + +
+ +
+ +

+  +

+

- r -

+
Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/functions_eval_0x73.html b/doc/html/functions_eval_0x73.html new file mode 100644 index 0000000..80213bf --- /dev/null +++ b/doc/html/functions_eval_0x73.html @@ -0,0 +1,250 @@ + + +QScintilla: Class Members - Enumerator + + + + + + + +
+ +
+ +

+  +

+

- s -

+
Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/functions_eval_0x74.html b/doc/html/functions_eval_0x74.html new file mode 100644 index 0000000..e6fe416 --- /dev/null +++ b/doc/html/functions_eval_0x74.html @@ -0,0 +1,76 @@ + + +QScintilla: Class Members - Enumerator + + + + + + + +
+ +
+ +

+  +

+

- t -

+
Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/functions_eval_0x75.html b/doc/html/functions_eval_0x75.html new file mode 100644 index 0000000..de9de0d --- /dev/null +++ b/doc/html/functions_eval_0x75.html @@ -0,0 +1,72 @@ + + +QScintilla: Class Members - Enumerator + + + + + + + +
+ +
+ +

+  +

+

- u -

+
Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/functions_eval_0x76.html b/doc/html/functions_eval_0x76.html new file mode 100644 index 0000000..b74be2b --- /dev/null +++ b/doc/html/functions_eval_0x76.html @@ -0,0 +1,78 @@ + + +QScintilla: Class Members - Enumerator + + + + + + + +
+ +
+ +

+  +

+

- v -

+
Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/functions_eval_0x77.html b/doc/html/functions_eval_0x77.html new file mode 100644 index 0000000..f88d529 --- /dev/null +++ b/doc/html/functions_eval_0x77.html @@ -0,0 +1,76 @@ + + +QScintilla: Class Members - Enumerator + + + + + + + +
+ +
+ +

+  +

+

- w -

+
Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/functions_eval_0x78.html b/doc/html/functions_eval_0x78.html new file mode 100644 index 0000000..dd6827d --- /dev/null +++ b/doc/html/functions_eval_0x78.html @@ -0,0 +1,69 @@ + + +QScintilla: Class Members - Enumerator + + + + + + + +
+ +
+ +

+  +

+

- x -

+
Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/functions_func.html b/doc/html/functions_func.html new file mode 100644 index 0000000..165faef --- /dev/null +++ b/doc/html/functions_func.html @@ -0,0 +1,78 @@ + + +QScintilla: Class Members - Functions + + + + + + + +
+ +
+ +

+  +

+

- a -

+
Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/functions_func_0x62.html b/doc/html/functions_func_0x62.html new file mode 100644 index 0000000..253883d --- /dev/null +++ b/doc/html/functions_func_0x62.html @@ -0,0 +1,68 @@ + + +QScintilla: Class Members - Functions + + + + + + + +
+ +
+ +

+  +

+

- b -

+
Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/functions_func_0x63.html b/doc/html/functions_func_0x63.html new file mode 100644 index 0000000..fbc6d1c --- /dev/null +++ b/doc/html/functions_func_0x63.html @@ -0,0 +1,80 @@ + + +QScintilla: Class Members - Functions + + + + + + + +
+ +
+ +

+  +

+

- c -

+
Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/functions_func_0x64.html b/doc/html/functions_func_0x64.html new file mode 100644 index 0000000..f4c096e --- /dev/null +++ b/doc/html/functions_func_0x64.html @@ -0,0 +1,69 @@ + + +QScintilla: Class Members - Functions + + + + + + + +
+ +
+ +

+  +

+

- d -

+
Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/functions_func_0x65.html b/doc/html/functions_func_0x65.html new file mode 100644 index 0000000..4f79e39 --- /dev/null +++ b/doc/html/functions_func_0x65.html @@ -0,0 +1,76 @@ + + +QScintilla: Class Members - Functions + + + + + + + +
+ +
+ +

+  +

+

- e -

+
Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/functions_func_0x66.html b/doc/html/functions_func_0x66.html new file mode 100644 index 0000000..68adb56 --- /dev/null +++ b/doc/html/functions_func_0x66.html @@ -0,0 +1,82 @@ + + +QScintilla: Class Members - Functions + + + + + + + +
+ +
+ +

+  +

+

- f -

+
Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/functions_func_0x67.html b/doc/html/functions_func_0x67.html new file mode 100644 index 0000000..77c7451 --- /dev/null +++ b/doc/html/functions_func_0x67.html @@ -0,0 +1,66 @@ + + +QScintilla: Class Members - Functions + + + + + + + +
+ +
+ +

+  +

+

- g -

+
Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/functions_func_0x68.html b/doc/html/functions_func_0x68.html new file mode 100644 index 0000000..83449f8 --- /dev/null +++ b/doc/html/functions_func_0x68.html @@ -0,0 +1,65 @@ + + +QScintilla: Class Members - Functions + + + + + + + +
+ +
+ +

+  +

+

- h -

+
Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/functions_func_0x69.html b/doc/html/functions_func_0x69.html new file mode 100644 index 0000000..f45b88e --- /dev/null +++ b/doc/html/functions_func_0x69.html @@ -0,0 +1,79 @@ + + +QScintilla: Class Members - Functions + + + + + + + +
+ +
+ +

+  +

+

- i -

+
Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/functions_func_0x6b.html b/doc/html/functions_func_0x6b.html new file mode 100644 index 0000000..268b943 --- /dev/null +++ b/doc/html/functions_func_0x6b.html @@ -0,0 +1,67 @@ + + +QScintilla: Class Members - Functions + + + + + + + +
+ +
+ +

+  +

+

- k -

+
Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/functions_func_0x6c.html b/doc/html/functions_func_0x6c.html new file mode 100644 index 0000000..5a4d519 --- /dev/null +++ b/doc/html/functions_func_0x6c.html @@ -0,0 +1,71 @@ + + +QScintilla: Class Members - Functions + + + + + + + +
+ +
+ +

+  +

+

- l -

+
Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/functions_func_0x6d.html b/doc/html/functions_func_0x6d.html new file mode 100644 index 0000000..71ed9ed --- /dev/null +++ b/doc/html/functions_func_0x6d.html @@ -0,0 +1,82 @@ + + +QScintilla: Class Members - Functions + + + + + + + +
+ +
+ +

+  +

+

- m -

+
Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/functions_func_0x70.html b/doc/html/functions_func_0x70.html new file mode 100644 index 0000000..1c05313 --- /dev/null +++ b/doc/html/functions_func_0x70.html @@ -0,0 +1,71 @@ + + +QScintilla: Class Members - Functions + + + + + + + +
+ +
+ +

+  +

+

- p -

+
Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/functions_func_0x71.html b/doc/html/functions_func_0x71.html new file mode 100644 index 0000000..c63f5bb --- /dev/null +++ b/doc/html/functions_func_0x71.html @@ -0,0 +1,91 @@ + + +QScintilla: Class Members - Functions + + + + + + + +
+ +
+ +

+  +

+

- q -

+
Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/functions_func_0x72.html b/doc/html/functions_func_0x72.html new file mode 100644 index 0000000..ac17933 --- /dev/null +++ b/doc/html/functions_func_0x72.html @@ -0,0 +1,75 @@ + + +QScintilla: Class Members - Functions + + + + + + + +
+ +
+ +

+  +

+

- r -

+
Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/functions_func_0x73.html b/doc/html/functions_func_0x73.html new file mode 100644 index 0000000..94123cc --- /dev/null +++ b/doc/html/functions_func_0x73.html @@ -0,0 +1,172 @@ + + +QScintilla: Class Members - Functions + + + + + + + +
+ +
+ +

+  +

+

- s -

+
Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/functions_func_0x74.html b/doc/html/functions_func_0x74.html new file mode 100644 index 0000000..37c831c --- /dev/null +++ b/doc/html/functions_func_0x74.html @@ -0,0 +1,69 @@ + + +QScintilla: Class Members - Functions + + + + + + + +
+ +
+ +

+  +

+

- t -

+
Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/functions_func_0x75.html b/doc/html/functions_func_0x75.html new file mode 100644 index 0000000..9c573e9 --- /dev/null +++ b/doc/html/functions_func_0x75.html @@ -0,0 +1,67 @@ + + +QScintilla: Class Members - Functions + + + + + + + +
+ +
+ +

+  +

+

- u -

+
Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/functions_func_0x76.html b/doc/html/functions_func_0x76.html new file mode 100644 index 0000000..89b4102 --- /dev/null +++ b/doc/html/functions_func_0x76.html @@ -0,0 +1,66 @@ + + +QScintilla: Class Members - Functions + + + + + + + +
+ +
+ +

+  +

+

- v -

+
Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/functions_func_0x77.html b/doc/html/functions_func_0x77.html new file mode 100644 index 0000000..6135770 --- /dev/null +++ b/doc/html/functions_func_0x77.html @@ -0,0 +1,68 @@ + + +QScintilla: Class Members - Functions + + + + + + + +
+ +
+ +

+  +

+

- w -

+
Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/functions_func_0x7a.html b/doc/html/functions_func_0x7a.html new file mode 100644 index 0000000..ae042b6 --- /dev/null +++ b/doc/html/functions_func_0x7a.html @@ -0,0 +1,67 @@ + + +QScintilla: Class Members - Functions + + + + + + + +
+ +
+ +

+  +

+

- z -

+
Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/functions_func_0x7e.html b/doc/html/functions_func_0x7e.html new file mode 100644 index 0000000..cdf8597 --- /dev/null +++ b/doc/html/functions_func_0x7e.html @@ -0,0 +1,89 @@ + + +QScintilla: Class Members - Functions + + + + + + + +
+ +
+ +

+  +

+

- ~ -

+
Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/hierarchy.html b/doc/html/hierarchy.html new file mode 100644 index 0000000..84995f7 --- /dev/null +++ b/doc/html/hierarchy.html @@ -0,0 +1,60 @@ + + +QScintilla: Hierarchical Index + + + + + + +

QScintilla Class Hierarchy

This inheritance list is sorted roughly, but not completely, alphabetically: +
Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/index.html b/doc/html/index.html new file mode 100644 index 0000000..95efba9 --- /dev/null +++ b/doc/html/index.html @@ -0,0 +1,20 @@ + + +QScintilla: Main Page + + + + + +

QScintilla Documentation

+

+

1.7.1 (based on Scintilla 1.71)


Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/pages.html b/doc/html/pages.html new file mode 100644 index 0000000..e479ad2 --- /dev/null +++ b/doc/html/pages.html @@ -0,0 +1,22 @@ + + +QScintilla: Page Index + + + + + +

QScintilla Related Pages

Here is a list of all related documentation pages: +
Generated on Thu Nov 30 09:32:31 2006 for QScintilla by  + +doxygen 1.4.7
+ + diff --git a/doc/html/tab_b.gif b/doc/html/tab_b.gif new file mode 100644 index 0000000..0d62348 Binary files /dev/null and b/doc/html/tab_b.gif differ diff --git a/doc/html/tab_l.gif b/doc/html/tab_l.gif new file mode 100644 index 0000000..9b1e633 Binary files /dev/null and b/doc/html/tab_l.gif differ diff --git a/doc/html/tab_r.gif b/doc/html/tab_r.gif new file mode 100644 index 0000000..ce9dd9f Binary files /dev/null and b/doc/html/tab_r.gif differ diff --git a/doc/html/tabs.css b/doc/html/tabs.css new file mode 100644 index 0000000..a61552a --- /dev/null +++ b/doc/html/tabs.css @@ -0,0 +1,102 @@ +/* tabs styles, based on http://www.alistapart.com/articles/slidingdoors */ + +DIV.tabs +{ + float : left; + width : 100%; + background : url("tab_b.gif") repeat-x bottom; + margin-bottom : 4px; +} + +DIV.tabs UL +{ + margin : 0px; + padding-left : 10px; + list-style : none; +} + +DIV.tabs LI, DIV.tabs FORM +{ + display : inline; + margin : 0px; + padding : 0px; +} + +DIV.tabs FORM +{ + float : right; +} + +DIV.tabs A +{ + float : left; + background : url("tab_r.gif") no-repeat right top; + border-bottom : 1px solid #84B0C7; + font-size : x-small; + font-weight : bold; + text-decoration : none; +} + +DIV.tabs A:hover +{ + background-position: 100% -150px; +} + +DIV.tabs A:link, DIV.tabs A:visited, +DIV.tabs A:active, DIV.tabs A:hover +{ + color: #1A419D; +} + +DIV.tabs SPAN +{ + float : left; + display : block; + background : url("tab_l.gif") no-repeat left top; + padding : 5px 9px; + white-space : nowrap; +} + +DIV.tabs INPUT +{ + float : right; + display : inline; + font-size : 1em; +} + +DIV.tabs TD +{ + font-size : x-small; + font-weight : bold; + text-decoration : none; +} + + + +/* Commented Backslash Hack hides rule from IE5-Mac \*/ +DIV.tabs SPAN {float : none;} +/* End IE5-Mac hack */ + +DIV.tabs A:hover SPAN +{ + background-position: 0% -150px; +} + +DIV.tabs LI#current A +{ + background-position: 100% -150px; + border-width : 0px; +} + +DIV.tabs LI#current SPAN +{ + background-position: 0% -150px; + padding-bottom : 6px; +} + +DIV.nav +{ + background : none; + border : none; + border-bottom : 1px solid #84B0C7; +} diff --git a/doc/qscintilla.dxy b/doc/qscintilla.dxy new file mode 100644 index 0000000..0ae31b3 --- /dev/null +++ b/doc/qscintilla.dxy @@ -0,0 +1,1098 @@ +# Doxyfile 1.3.5 + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project +# +# All text after a hash (#) is considered a comment and will be ignored +# The format is: +# TAG = value [value, ...] +# For lists items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (" ") + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- + +# The PROJECT_NAME tag is a single word (or a sequence of words surrounded +# by quotes) that should identify the project. + +PROJECT_NAME = QScintilla + +# The PROJECT_NUMBER tag can be used to enter a project or revision number. +# This could be handy for archiving the generated documentation or +# if some version control system is used. + +PROJECT_NUMBER = "1.7.1 (based on Scintilla 1.71)" + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) +# base path where the generated documentation will be put. +# If a relative path is entered, it will be relative to the location +# where doxygen was started. If left blank the current directory will be used. + +OUTPUT_DIRECTORY = + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# The default language is English, other supported languages are: +# Brazilian, Catalan, Chinese, Chinese-Traditional, Croatian, Czech, Danish, Dutch, +# Finnish, French, German, Greek, Hungarian, Italian, Japanese, Japanese-en +# (Japanese with English messages), Korean, Norwegian, Polish, Portuguese, +# Romanian, Russian, Serbian, Slovak, Slovene, Spanish, Swedish, and Ukrainian. + +OUTPUT_LANGUAGE = English + +# This tag can be used to specify the encoding used in the generated output. +# The encoding is not always determined by the language that is chosen, +# but also whether or not the output is meant for Windows or non-Windows users. +# In case there is a difference, setting the USE_WINDOWS_ENCODING tag to YES +# forces the Windows encoding (this is the default for the Windows binary), +# whereas setting the tag to NO uses a Unix-style encoding (the default for +# all platforms other than Windows). + +USE_WINDOWS_ENCODING = NO + +# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will +# include brief member descriptions after the members that are listed in +# the file and class documentation (similar to JavaDoc). +# Set to NO to disable this. + +BRIEF_MEMBER_DESC = NO + +# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend +# the brief description of a member or function before the detailed description. +# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# brief descriptions will be completely suppressed. + +REPEAT_BRIEF = YES + +# This tag implements a quasi-intelligent brief description abbreviator +# that is used to form the text in various listings. Each string +# in this list, if found as the leading text of the brief description, will be +# stripped from the text and the result after processing the whole list, is used +# as the annotated text. Otherwise, the brief description is used as-is. If left +# blank, the following values are used ("$name" is automatically replaced with the +# name of the entity): "The $name class" "The $name widget" "The $name file" +# "is" "provides" "specifies" "contains" "represents" "a" "an" "the" + +ABBREVIATE_BRIEF = + +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# Doxygen will generate a detailed section even if there is only a brief +# description. + +ALWAYS_DETAILED_SEC = NO + +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all inherited +# members of a class in the documentation of that class as if those members were +# ordinary class members. Constructors, destructors and assignment operators of +# the base classes will not be shown. + +INLINE_INHERITED_MEMB = NO + +# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full +# path before files name in the file list and in the header files. If set +# to NO the shortest path that makes the file name unique will be used. + +FULL_PATH_NAMES = NO + +# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag +# can be used to strip a user-defined part of the path. Stripping is +# only done if one of the specified strings matches the left-hand part of +# the path. It is allowed to use relative paths in the argument list. + +STRIP_FROM_PATH = + +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter +# (but less readable) file names. This can be useful is your file systems +# doesn't support long names like on DOS, Mac, or CD-ROM. + +SHORT_NAMES = NO + +# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen +# will interpret the first line (until the first dot) of a JavaDoc-style +# comment as the brief description. If set to NO, the JavaDoc +# comments will behave just like the Qt-style comments (thus requiring an +# explicit @brief command for a brief description. + +JAVADOC_AUTOBRIEF = NO + +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen +# treat a multi-line C++ special comment block (i.e. a block of //! or /// +# comments) as a brief description. This used to be the default behaviour. +# The new default is to treat a multi-line C++ comment block as a detailed +# description. Set this tag to YES if you prefer the old behaviour instead. + +MULTILINE_CPP_IS_BRIEF = NO + +# If the DETAILS_AT_TOP tag is set to YES then Doxygen +# will output the detailed description near the top, like JavaDoc. +# If set to NO, the detailed description appears after the member +# documentation. + +DETAILS_AT_TOP = NO + +# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented +# member inherits the documentation from any documented member that it +# re-implements. + +INHERIT_DOCS = YES + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES, then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. + +DISTRIBUTE_GROUP_DOC = NO + +# The TAB_SIZE tag can be used to set the number of spaces in a tab. +# Doxygen uses this value to replace tabs by spaces in code fragments. + +TAB_SIZE = 8 + +# This tag can be used to specify a number of aliases that acts +# as commands in the documentation. An alias has the form "name=value". +# For example adding "sideeffect=\par Side Effects:\n" will allow you to +# put the command \sideeffect (or @sideeffect) in the documentation, which +# will result in a user-defined paragraph with heading "Side Effects:". +# You can put \n's in the value part of an alias to insert newlines. + +ALIASES = + +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources +# only. Doxygen will then generate output that is more tailored for C. +# For instance, some of the names that are used will be different. The list +# of all members will be omitted, etc. + +OPTIMIZE_OUTPUT_FOR_C = NO + +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java sources +# only. Doxygen will then generate output that is more tailored for Java. +# For instance, namespaces will be presented as packages, qualified scopes +# will look different, etc. + +OPTIMIZE_OUTPUT_JAVA = NO + +# Set the SUBGROUPING tag to YES (the default) to allow class member groups of +# the same type (for instance a group of public functions) to be put as a +# subgroup of that type (e.g. under the Public Functions section). Set it to +# NO to prevent subgrouping. Alternatively, this can be done per class using +# the \nosubgrouping command. + +SUBGROUPING = YES + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- + +# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in +# documentation are documented, even if no documentation was available. +# Private class members and static file members will be hidden unless +# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES + +EXTRACT_ALL = NO + +# If the EXTRACT_PRIVATE tag is set to YES all private members of a class +# will be included in the documentation. + +EXTRACT_PRIVATE = NO + +# If the EXTRACT_STATIC tag is set to YES all static members of a file +# will be included in the documentation. + +EXTRACT_STATIC = NO + +# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) +# defined locally in source files will be included in the documentation. +# If set to NO only classes defined in header files are included. + +EXTRACT_LOCAL_CLASSES = NO + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all +# undocumented members of documented classes, files or namespaces. +# If set to NO (the default) these members will be included in the +# various overviews, but no documentation section is generated. +# This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_MEMBERS = NO + +# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. +# If set to NO (the default) these classes will be included in the various +# overviews. This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_CLASSES = NO + +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all +# friend (class|struct|union) declarations. +# If set to NO (the default) these declarations will be included in the +# documentation. + +HIDE_FRIEND_COMPOUNDS = YES + +# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any +# documentation blocks found inside the body of a function. +# If set to NO (the default) these blocks will be appended to the +# function's detailed documentation block. + +HIDE_IN_BODY_DOCS = NO + +# The INTERNAL_DOCS tag determines if documentation +# that is typed after a \internal command is included. If the tag is set +# to NO (the default) then the documentation will be excluded. +# Set it to YES to include the internal documentation. + +INTERNAL_DOCS = NO + +# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate +# file names in lower-case letters. If set to YES upper-case letters are also +# allowed. This is useful if you have classes or files whose names only differ +# in case and if your file system supports case sensitive file names. Windows +# users are advised to set this option to NO. + +CASE_SENSE_NAMES = YES + +# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen +# will show members with their full class and namespace scopes in the +# documentation. If set to YES the scope will be hidden. + +HIDE_SCOPE_NAMES = NO + +# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen +# will put a list of the files that are included by a file in the documentation +# of that file. + +SHOW_INCLUDE_FILES = YES + +# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] +# is inserted in the documentation for inline members. + +INLINE_INFO = YES + +# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen +# will sort the (detailed) documentation of file and class members +# alphabetically by member name. If set to NO the members will appear in +# declaration order. + +SORT_MEMBER_DOCS = NO + +# The GENERATE_TODOLIST tag can be used to enable (YES) or +# disable (NO) the todo list. This list is created by putting \todo +# commands in the documentation. + +GENERATE_TODOLIST = YES + +# The GENERATE_TESTLIST tag can be used to enable (YES) or +# disable (NO) the test list. This list is created by putting \test +# commands in the documentation. + +GENERATE_TESTLIST = YES + +# The GENERATE_BUGLIST tag can be used to enable (YES) or +# disable (NO) the bug list. This list is created by putting \bug +# commands in the documentation. + +GENERATE_BUGLIST = YES + +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or +# disable (NO) the deprecated list. This list is created by putting +# \deprecated commands in the documentation. + +GENERATE_DEPRECATEDLIST= YES + +# The ENABLED_SECTIONS tag can be used to enable conditional +# documentation sections, marked by \if sectionname ... \endif. + +ENABLED_SECTIONS = + +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines +# the initial value of a variable or define consists of for it to appear in +# the documentation. If the initializer consists of more lines than specified +# here it will be hidden. Use a value of 0 to hide initializers completely. +# The appearance of the initializer of individual variables and defines in the +# documentation can be controlled using \showinitializer or \hideinitializer +# command in the documentation regardless of this setting. + +MAX_INITIALIZER_LINES = 30 + +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated +# at the bottom of the documentation of classes and structs. If set to YES the +# list will mention the files that were used to generate the documentation. + +SHOW_USED_FILES = NO + +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- + +# The QUIET tag can be used to turn on/off the messages that are generated +# by doxygen. Possible values are YES and NO. If left blank NO is used. + +QUIET = NO + +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated by doxygen. Possible values are YES and NO. If left blank +# NO is used. + +WARNINGS = YES + +# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings +# for undocumented members. If EXTRACT_ALL is set to YES then this flag will +# automatically be disabled. + +WARN_IF_UNDOCUMENTED = YES + +# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as not documenting some +# parameters in a documented function, or documenting parameters that +# don't exist or using markup commands wrongly. + +WARN_IF_DOC_ERROR = YES + +# The WARN_FORMAT tag determines the format of the warning messages that +# doxygen can produce. The string should contain the $file, $line, and $text +# tags, which will be replaced by the file and line number from which the +# warning originated and the warning text. + +WARN_FORMAT = "$file:$line: $text" + +# The WARN_LOGFILE tag can be used to specify a file to which warning +# and error messages should be written. If left blank the output is written +# to stderr. + +WARN_LOGFILE = + +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- + +# The INPUT tag can be used to specify the files and/or directories that contain +# documented source files. You may enter file names like "myfile.cpp" or +# directories like "/usr/src/myproject". Separate the files or directories +# with spaces. + +INPUT = ../qt + +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank the following patterns are tested: +# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx *.hpp +# *.h++ *.idl *.odl *.cs *.php *.php3 *.inc + +FILE_PATTERNS = qext*.h + +# The RECURSIVE tag can be used to turn specify whether or not subdirectories +# should be searched for input files as well. Possible values are YES and NO. +# If left blank NO is used. + +RECURSIVE = NO + +# The EXCLUDE tag can be used to specify files and/or directories that should +# excluded from the INPUT source files. This way you can easily exclude a +# subdirectory from a directory tree whose root is specified with the INPUT tag. + +EXCLUDE = + +# The EXCLUDE_SYMLINKS tag can be used select whether or not files or directories +# that are symbolic links (a Unix filesystem feature) are excluded from the input. + +EXCLUDE_SYMLINKS = NO + +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. + +EXCLUDE_PATTERNS = + +# The EXAMPLE_PATH tag can be used to specify one or more files or +# directories that contain example code fragments that are included (see +# the \include command). + +EXAMPLE_PATH = + +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank all files are included. + +EXAMPLE_PATTERNS = + +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude +# commands irrespective of the value of the RECURSIVE tag. +# Possible values are YES and NO. If left blank NO is used. + +EXAMPLE_RECURSIVE = NO + +# The IMAGE_PATH tag can be used to specify one or more files or +# directories that contain image that are included in the documentation (see +# the \image command). + +IMAGE_PATH = + +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command , where +# is the value of the INPUT_FILTER tag, and is the name of an +# input file. Doxygen will then use the output that the filter program writes +# to standard output. + +INPUT_FILTER = + +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER) will be used to filter the input files when producing source +# files to browse (i.e. when SOURCE_BROWSER is set to YES). + +FILTER_SOURCE_FILES = NO + +#--------------------------------------------------------------------------- +# configuration options related to source browsing +#--------------------------------------------------------------------------- + +# If the SOURCE_BROWSER tag is set to YES then a list of source files will +# be generated. Documented entities will be cross-referenced with these sources. +# Note: To get rid of all source code in the generated output, make sure also +# VERBATIM_HEADERS is set to NO. + +SOURCE_BROWSER = NO + +# Setting the INLINE_SOURCES tag to YES will include the body +# of functions and classes directly in the documentation. + +INLINE_SOURCES = NO + +# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct +# doxygen to hide any special comment blocks from generated source code +# fragments. Normal C and C++ comments will always remain visible. + +STRIP_CODE_COMMENTS = YES + +# If the REFERENCED_BY_RELATION tag is set to YES (the default) +# then for each documented function all documented +# functions referencing it will be listed. + +REFERENCED_BY_RELATION = YES + +# If the REFERENCES_RELATION tag is set to YES (the default) +# then for each documented function all documented entities +# called/used by that function will be listed. + +REFERENCES_RELATION = YES + +# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen +# will generate a verbatim copy of the header file for each class for +# which an include is specified. Set to NO to disable this. + +VERBATIM_HEADERS = NO + +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- + +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index +# of all compounds will be generated. Enable this if the project +# contains a lot of classes, structs, unions or interfaces. + +ALPHABETICAL_INDEX = NO + +# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then +# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns +# in which this list will be split (can be a number in the range [1..20]) + +COLS_IN_ALPHA_INDEX = 5 + +# In case all classes in a project start with a common prefix, all +# classes will be put under the same header in the alphabetical index. +# The IGNORE_PREFIX tag can be used to specify one or more prefixes that +# should be ignored while generating the index headers. + +IGNORE_PREFIX = + +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- + +# If the GENERATE_HTML tag is set to YES (the default) Doxygen will +# generate HTML output. + +GENERATE_HTML = YES + +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `html' will be used as the default path. + +HTML_OUTPUT = html + +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for +# each generated HTML page (for example: .htm,.php,.asp). If it is left blank +# doxygen will generate files with .html extension. + +HTML_FILE_EXTENSION = .html + +# The HTML_HEADER tag can be used to specify a personal HTML header for +# each generated HTML page. If it is left blank doxygen will generate a +# standard header. + +HTML_HEADER = + +# The HTML_FOOTER tag can be used to specify a personal HTML footer for +# each generated HTML page. If it is left blank doxygen will generate a +# standard footer. + +HTML_FOOTER = + +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading +# style sheet that is used by each HTML page. It can be used to +# fine-tune the look of the HTML output. If the tag is left blank doxygen +# will generate a default style sheet. Note that doxygen will try to copy +# the style sheet file to the HTML output directory, so don't put your own +# stylesheet in the HTML output directory as well, or it will be erased! + +HTML_STYLESHEET = + +# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, +# files or namespaces will be aligned in HTML using tables. If set to +# NO a bullet list will be used. + +HTML_ALIGN_MEMBERS = NO + +# If the GENERATE_HTMLHELP tag is set to YES, additional index files +# will be generated that can be used as input for tools like the +# Microsoft HTML help workshop to generate a compressed HTML help file (.chm) +# of the generated HTML documentation. + +GENERATE_HTMLHELP = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can +# be used to specify the file name of the resulting .chm file. You +# can add a path in front of the file if the result should not be +# written to the html output directory. + +CHM_FILE = + +# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can +# be used to specify the location (absolute path including file name) of +# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run +# the HTML help compiler on the generated index.hhp. + +HHC_LOCATION = + +# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag +# controls if a separate .chi index file is generated (YES) or that +# it should be included in the master .chm file (NO). + +GENERATE_CHI = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag +# controls whether a binary table of contents is generated (YES) or a +# normal table of contents (NO) in the .chm file. + +BINARY_TOC = NO + +# The TOC_EXPAND flag can be set to YES to add extra items for group members +# to the contents of the HTML help documentation and to the tree view. + +TOC_EXPAND = NO + +# The DISABLE_INDEX tag can be used to turn on/off the condensed index at +# top of each HTML page. The value NO (the default) enables the index and +# the value YES disables it. + +DISABLE_INDEX = NO + +# This tag can be used to set the number of enum values (range [1..20]) +# that doxygen will group on one line in the generated HTML documentation. + +ENUM_VALUES_PER_LINE = 3 + +# If the GENERATE_TREEVIEW tag is set to YES, a side panel will be +# generated containing a tree-like index structure (just like the one that +# is generated for HTML Help). For this to work a browser that supports +# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+, +# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are +# probably better off using the HTML help feature. + +GENERATE_TREEVIEW = NO + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be +# used to set the initial width (in pixels) of the frame in which the tree +# is shown. + +TREEVIEW_WIDTH = 250 + +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- + +# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will +# generate Latex output. + +GENERATE_LATEX = NO + +# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `latex' will be used as the default path. + +LATEX_OUTPUT = latex + +# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be +# invoked. If left blank `latex' will be used as the default command name. + +LATEX_CMD_NAME = latex + +# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to +# generate index for LaTeX. If left blank `makeindex' will be used as the +# default command name. + +MAKEINDEX_CMD_NAME = makeindex + +# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact +# LaTeX documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_LATEX = NO + +# The PAPER_TYPE tag can be used to set the paper type that is used +# by the printer. Possible values are: a4, a4wide, letter, legal and +# executive. If left blank a4wide will be used. + +PAPER_TYPE = a4wide + +# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX +# packages that should be included in the LaTeX output. + +EXTRA_PACKAGES = + +# The LATEX_HEADER tag can be used to specify a personal LaTeX header for +# the generated latex document. The header should contain everything until +# the first chapter. If it is left blank doxygen will generate a +# standard header. Notice: only use this tag if you know what you are doing! + +LATEX_HEADER = + +# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated +# is prepared for conversion to pdf (using ps2pdf). The pdf file will +# contain links (just like the HTML output) instead of page references +# This makes the output suitable for online browsing using a pdf viewer. + +PDF_HYPERLINKS = NO + +# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of +# plain latex in the generated Makefile. Set this option to YES to get a +# higher quality PDF documentation. + +USE_PDFLATEX = NO + +# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. +# command to the generated LaTeX files. This will instruct LaTeX to keep +# running if errors occur, instead of asking the user for help. +# This option is also used when generating formulas in HTML. + +LATEX_BATCHMODE = NO + +# If LATEX_HIDE_INDICES is set to YES then doxygen will not +# include the index chapters (such as File Index, Compound Index, etc.) +# in the output. + +LATEX_HIDE_INDICES = NO + +#--------------------------------------------------------------------------- +# configuration options related to the RTF output +#--------------------------------------------------------------------------- + +# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output +# The RTF output is optimized for Word 97 and may not look very pretty with +# other RTF readers or editors. + +GENERATE_RTF = NO + +# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `rtf' will be used as the default path. + +RTF_OUTPUT = rtf + +# If the COMPACT_RTF tag is set to YES Doxygen generates more compact +# RTF documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_RTF = NO + +# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated +# will contain hyperlink fields. The RTF file will +# contain links (just like the HTML output) instead of page references. +# This makes the output suitable for online browsing using WORD or other +# programs which support those fields. +# Note: wordpad (write) and others do not support links. + +RTF_HYPERLINKS = NO + +# Load stylesheet definitions from file. Syntax is similar to doxygen's +# config file, i.e. a series of assignments. You only have to provide +# replacements, missing definitions are set to their default value. + +RTF_STYLESHEET_FILE = + +# Set optional variables used in the generation of an rtf document. +# Syntax is similar to doxygen's config file. + +RTF_EXTENSIONS_FILE = + +#--------------------------------------------------------------------------- +# configuration options related to the man page output +#--------------------------------------------------------------------------- + +# If the GENERATE_MAN tag is set to YES (the default) Doxygen will +# generate man pages + +GENERATE_MAN = NO + +# The MAN_OUTPUT tag is used to specify where the man pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `man' will be used as the default path. + +MAN_OUTPUT = man + +# The MAN_EXTENSION tag determines the extension that is added to +# the generated man pages (default is the subroutine's section .3) + +MAN_EXTENSION = .3 + +# If the MAN_LINKS tag is set to YES and Doxygen generates man output, +# then it will generate one additional man file for each entity +# documented in the real man page(s). These additional files +# only source the real man page, but without them the man command +# would be unable to find the correct page. The default is NO. + +MAN_LINKS = NO + +#--------------------------------------------------------------------------- +# configuration options related to the XML output +#--------------------------------------------------------------------------- + +# If the GENERATE_XML tag is set to YES Doxygen will +# generate an XML file that captures the structure of +# the code including all documentation. + +GENERATE_XML = NO + +# The XML_OUTPUT tag is used to specify where the XML pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `xml' will be used as the default path. + +XML_OUTPUT = xml + +# The XML_SCHEMA tag can be used to specify an XML schema, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_SCHEMA = + +# The XML_DTD tag can be used to specify an XML DTD, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_DTD = + +# If the XML_PROGRAMLISTING tag is set to YES Doxygen will +# dump the program listings (including syntax highlighting +# and cross-referencing information) to the XML output. Note that +# enabling this will significantly increase the size of the XML output. + +XML_PROGRAMLISTING = YES + +#--------------------------------------------------------------------------- +# configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- + +# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will +# generate an AutoGen Definitions (see autogen.sf.net) file +# that captures the structure of the code including all +# documentation. Note that this feature is still experimental +# and incomplete at the moment. + +GENERATE_AUTOGEN_DEF = NO + +#--------------------------------------------------------------------------- +# configuration options related to the Perl module output +#--------------------------------------------------------------------------- + +# If the GENERATE_PERLMOD tag is set to YES Doxygen will +# generate a Perl module file that captures the structure of +# the code including all documentation. Note that this +# feature is still experimental and incomplete at the +# moment. + +GENERATE_PERLMOD = NO + +# If the PERLMOD_LATEX tag is set to YES Doxygen will generate +# the necessary Makefile rules, Perl scripts and LaTeX code to be able +# to generate PDF and DVI output from the Perl module output. + +PERLMOD_LATEX = NO + +# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be +# nicely formatted so it can be parsed by a human reader. This is useful +# if you want to understand what is going on. On the other hand, if this +# tag is set to NO the size of the Perl module output will be much smaller +# and Perl will parse it just the same. + +PERLMOD_PRETTY = YES + +# The names of the make variables in the generated doxyrules.make file +# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. +# This is useful so different doxyrules.make files included by the same +# Makefile don't overwrite each other's variables. + +PERLMOD_MAKEVAR_PREFIX = + +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- + +# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will +# evaluate all C-preprocessor directives found in the sources and include +# files. + +ENABLE_PREPROCESSING = YES + +# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro +# names in the source code. If set to NO (the default) only conditional +# compilation will be performed. Macro expansion can be done in a controlled +# way by setting EXPAND_ONLY_PREDEF to YES. + +MACRO_EXPANSION = NO + +# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES +# then the macro expansion is limited to the macros specified with the +# PREDEFINED and EXPAND_AS_PREDEFINED tags. + +EXPAND_ONLY_PREDEF = NO + +# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files +# in the INCLUDE_PATH (see below) will be search if a #include is found. + +SEARCH_INCLUDES = YES + +# The INCLUDE_PATH tag can be used to specify one or more directories that +# contain include files that are not input files but should be processed by +# the preprocessor. + +INCLUDE_PATH = + +# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard +# patterns (like *.h and *.hpp) to filter out the header-files in the +# directories. If left blank, the patterns specified with FILE_PATTERNS will +# be used. + +INCLUDE_FILE_PATTERNS = + +# The PREDEFINED tag can be used to specify one or more macro names that +# are defined before the preprocessor is started (similar to the -D option of +# gcc). The argument of the tag is a list of macros of the form: name +# or name=definition (no spaces). If the definition and the = are +# omitted =1 is assumed. + +PREDEFINED = + +# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then +# this tag can be used to specify a list of macro names that should be expanded. +# The macro definition that is found in the sources will be used. +# Use the PREDEFINED tag if you want to use a different macro definition. + +EXPAND_AS_DEFINED = + +# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then +# doxygen's preprocessor will remove all function-like macros that are alone +# on a line, have an all uppercase name, and do not end with a semicolon. Such +# function macros are typically used for boiler-plate code, and will confuse the +# parser if not removed. + +SKIP_FUNCTION_MACROS = YES + +#--------------------------------------------------------------------------- +# Configuration::addtions related to external references +#--------------------------------------------------------------------------- + +# The TAGFILES option can be used to specify one or more tagfiles. +# Optionally an initial location of the external documentation +# can be added for each tagfile. The format of a tag file without +# this location is as follows: +# TAGFILES = file1 file2 ... +# Adding location for the tag files is done as follows: +# TAGFILES = file1=loc1 "file2 = loc2" ... +# where "loc1" and "loc2" can be relative or absolute paths or +# URLs. If a location is present for each tag, the installdox tool +# does not have to be run to correct the links. +# Note that each tag file must have a unique name +# (where the name does NOT include the path) +# If a tag file is not located in the directory in which doxygen +# is run, you must also specify the path to the tagfile here. + +TAGFILES = + +# When a file name is specified after GENERATE_TAGFILE, doxygen will create +# a tag file that is based on the input files it reads. + +GENERATE_TAGFILE = + +# If the ALLEXTERNALS tag is set to YES all external classes will be listed +# in the class index. If set to NO only the inherited external classes +# will be listed. + +ALLEXTERNALS = NO + +# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed +# in the modules index. If set to NO, only the current project's groups will +# be listed. + +EXTERNAL_GROUPS = YES + +# The PERL_PATH should be the absolute path and name of the perl script +# interpreter (i.e. the result of `which perl'). + +PERL_PATH = /usr/bin/perl + +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- + +# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will +# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base or +# super classes. Setting the tag to NO turns the diagrams off. Note that this +# option is superseded by the HAVE_DOT option below. This is only a fallback. It is +# recommended to install and use dot, since it yields more powerful graphs. + +CLASS_DIAGRAMS = NO + +# If set to YES, the inheritance and collaboration graphs will hide +# inheritance and usage relations if the target is undocumented +# or is not a class. + +HIDE_UNDOC_RELATIONS = YES + +# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is +# available from the path. This tool is part of Graphviz, a graph visualization +# toolkit from AT&T and Lucent Bell Labs. The other options in this section +# have no effect if this option is set to NO (the default) + +HAVE_DOT = NO + +# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect inheritance relations. Setting this tag to YES will force the +# the CLASS_DIAGRAMS tag to NO. + +CLASS_GRAPH = YES + +# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect implementation dependencies (inheritance, containment, and +# class references variables) of the class with other documented classes. + +COLLABORATION_GRAPH = YES + +# If the UML_LOOK tag is set to YES doxygen will generate inheritance and +# collaboration diagrams in a style similar to the OMG's Unified Modeling +# Language. + +UML_LOOK = NO + +# If set to YES, the inheritance and collaboration graphs will show the +# relations between templates and their instances. + +TEMPLATE_RELATIONS = YES + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT +# tags are set to YES then doxygen will generate a graph for each documented +# file showing the direct and indirect include dependencies of the file with +# other documented files. + +INCLUDE_GRAPH = YES + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and +# HAVE_DOT tags are set to YES then doxygen will generate a graph for each +# documented header file showing the documented files that directly or +# indirectly include this file. + +INCLUDED_BY_GRAPH = YES + +# If the CALL_GRAPH and HAVE_DOT tags are set to YES then doxygen will +# generate a call dependency graph for every global function or class method. +# Note that enabling this option will significantly increase the time of a run. +# So in most cases it will be better to enable call graphs for selected +# functions only using the \callgraph command. + +CALL_GRAPH = NO + +# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen +# will graphical hierarchy of all classes instead of a textual one. + +GRAPHICAL_HIERARCHY = YES + +# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images +# generated by dot. Possible values are png, jpg, or gif +# If left blank png will be used. + +DOT_IMAGE_FORMAT = png + +# The tag DOT_PATH can be used to specify the path where the dot tool can be +# found. If left blank, it is assumed the dot tool can be found on the path. + +DOT_PATH = + +# The DOTFILE_DIRS tag can be used to specify one or more directories that +# contain dot files that are included in the documentation (see the +# \dotfile command). + +DOTFILE_DIRS = + +# The MAX_DOT_GRAPH_WIDTH tag can be used to set the maximum allowed width +# (in pixels) of the graphs generated by dot. If a graph becomes larger than +# this value, doxygen will try to truncate the graph, so that it fits within +# the specified constraint. Beware that most browsers cannot cope with very +# large images. + +MAX_DOT_GRAPH_WIDTH = 1024 + +# The MAX_DOT_GRAPH_HEIGHT tag can be used to set the maximum allows height +# (in pixels) of the graphs generated by dot. If a graph becomes larger than +# this value, doxygen will try to truncate the graph, so that it fits within +# the specified constraint. Beware that most browsers cannot cope with very +# large images. + +MAX_DOT_GRAPH_HEIGHT = 1024 + +# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the +# graphs generated by dot. A depth value of 3 means that only nodes reachable +# from the root by following a path via at most 3 edges will be shown. Nodes that +# lay further from the root node will be omitted. Note that setting this option to +# 1 or 2 may greatly reduce the computation time needed for large code bases. Also +# note that a graph may be further truncated if the graph's image dimensions are +# not sufficient to fit the graph (see MAX_DOT_GRAPH_WIDTH and MAX_DOT_GRAPH_HEIGHT). +# If 0 is used for the depth value (the default), the graph is not depth-constrained. + +MAX_DOT_GRAPH_DEPTH = 0 + +# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will +# generate a legend page explaining the meaning of the various boxes and +# arrows in the dot generated graphs. + +GENERATE_LEGEND = YES + +# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will +# remove the intermediate dot files that are used to generate +# the various graphs. + +DOT_CLEANUP = YES + +#--------------------------------------------------------------------------- +# Configuration::addtions related to the search engine +#--------------------------------------------------------------------------- + +# The SEARCHENGINE tag specifies whether or not a search engine should be +# used. If set to NO the values of all tags below this one will be ignored. + +SEARCHENGINE = NO diff --git a/example/License.txt b/example/License.txt new file mode 100755 index 0000000..cbe25b2 --- /dev/null +++ b/example/License.txt @@ -0,0 +1,20 @@ +License for Scintilla and SciTE + +Copyright 1998-2003 by Neil Hodgson + +All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation. + +NEIL HODGSON DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS +SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS, IN NO EVENT SHALL NEIL HODGSON BE LIABLE FOR ANY +SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE +OR PERFORMANCE OF THIS SOFTWARE. \ No newline at end of file diff --git a/example/README b/example/README new file mode 100644 index 0000000..6ffa2ea --- /dev/null +++ b/example/README @@ -0,0 +1,12 @@ +QSCINTILLA EXAMPLE + +This directory contains a port of the standard application example included +with Qt that uses QScintilla rather than QTextEdit. + +To build the example on all platforms, make sure QScintilla is installed and +then run: + + qmake application + make + +On Windows you may need to run "nmake" rather than "make". diff --git a/example/application.cpp b/example/application.cpp new file mode 100644 index 0000000..a4cca36 --- /dev/null +++ b/example/application.cpp @@ -0,0 +1,271 @@ +/**************************************************************************** +** $Id: application.cpp,v 1.1 2004/09/18 17:31:23 phil Exp $ +** +** Copyright (C) 1992-2002 Trolltech AS. All rights reserved. +** +** This file is part of an example program for Qt. This example +** program may be used, distributed and modified without limitation. +** +*****************************************************************************/ + +#include "application.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include "filesave.xpm" +#include "fileopen.xpm" +#include "fileprint.xpm" + +ApplicationWindow::ApplicationWindow() + : QMainWindow( 0, "example application main window", WDestructiveClose | WGroupLeader ) +{ + printer = new QextScintillaPrinter( QPrinter::HighResolution ); + QPixmap openIcon, saveIcon, printIcon; + + QToolBar * fileTools = new QToolBar( this, "file operations" ); + fileTools->setLabel( "File Operations" ); + + openIcon = QPixmap( fileopen ); + QToolButton * fileOpen + = new QToolButton( openIcon, "Open File", QString::null, + this, SLOT(choose()), fileTools, "open file" ); + + saveIcon = QPixmap( filesave ); + QToolButton * fileSave + = new QToolButton( saveIcon, "Save File", QString::null, + this, SLOT(save()), fileTools, "save file" ); + + printIcon = QPixmap( fileprint ); + QToolButton * filePrint + = new QToolButton( printIcon, "Print File", QString::null, + this, SLOT(print()), fileTools, "print file" ); + + + (void)QWhatsThis::whatsThisButton( fileTools ); + + const char * fileOpenText = "

" + "Click this button to open a new file.
" + "You can also select the Open command " + "from the File menu.

"; + + QWhatsThis::add( fileOpen, fileOpenText ); + + QMimeSourceFactory::defaultFactory()->setPixmap( "fileopen", openIcon ); + + const char * fileSaveText = "

Click this button to save the file you " + "are editing. You will be prompted for a file name.\n" + "You can also select the Save command " + "from the File menu.

"; + + QWhatsThis::add( fileSave, fileSaveText ); + + const char * filePrintText = "Click this button to print the file you " + "are editing.\n" + "You can also select the Print command " + "from the File menu."; + + QWhatsThis::add( filePrint, filePrintText ); + + + QPopupMenu * file = new QPopupMenu( this ); + menuBar()->insertItem( "&File", file ); + + + file->insertItem( "&New", this, SLOT(newDoc()), CTRL+Key_N ); + + int id; + id = file->insertItem( openIcon, "&Open...", + this, SLOT(choose()), CTRL+Key_O ); + file->setWhatsThis( id, fileOpenText ); + + id = file->insertItem( saveIcon, "&Save", + this, SLOT(save()), CTRL+Key_S ); + file->setWhatsThis( id, fileSaveText ); + + id = file->insertItem( "Save &As...", this, SLOT(saveAs()) ); + file->setWhatsThis( id, fileSaveText ); + + file->insertSeparator(); + + id = file->insertItem( printIcon, "&Print...", + this, SLOT(print()), CTRL+Key_P ); + file->setWhatsThis( id, filePrintText ); + + file->insertSeparator(); + + file->insertItem( "&Close", this, SLOT(close()), CTRL+Key_W ); + + file->insertItem( "&Quit", qApp, SLOT( closeAllWindows() ), CTRL+Key_Q ); + + menuBar()->insertSeparator(); + + QPopupMenu * help = new QPopupMenu( this ); + menuBar()->insertItem( "&Help", help ); + + help->insertItem( "&About", this, SLOT(about()), Key_F1 ); + help->insertItem( "About &Qt", this, SLOT(aboutQt()) ); + help->insertSeparator(); + help->insertItem( "What's &This", this, SLOT(whatsThis()), SHIFT+Key_F1 ); + + e = new QextScintilla( this, "editor" ); + e->setFocus(); + setCentralWidget( e ); + statusBar()->message( "Ready", 2000 ); + + resize( 450, 600 ); +} + + +ApplicationWindow::~ApplicationWindow() +{ + delete printer; +} + + + +void ApplicationWindow::newDoc() +{ + ApplicationWindow *ed = new ApplicationWindow; + ed->setCaption("QScintilla Example - Application"); + ed->show(); +} + +void ApplicationWindow::choose() +{ + QString fn = QFileDialog::getOpenFileName( QString::null, QString::null, + this); + if ( !fn.isEmpty() ) + load( fn ); + else + statusBar()->message( "Loading aborted", 2000 ); +} + + +void ApplicationWindow::load( const QString &fileName ) +{ + QFile f( fileName ); + if ( !f.open( IO_ReadOnly ) ) + return; + + QTextStream ts( &f ); + e->setText( ts.read() ); + e->setModified( FALSE ); + setCaption( fileName ); + statusBar()->message( "Loaded document " + fileName, 2000 ); +} + + +void ApplicationWindow::save() +{ + if ( filename.isEmpty() ) { + saveAs(); + return; + } + + QString text = e->text(); + QFile f( filename ); + if ( !f.open( IO_WriteOnly ) ) { + statusBar()->message( QString("Could not write to %1").arg(filename), + 2000 ); + return; + } + + QTextStream t( &f ); + t << text; + f.close(); + + e->setModified( FALSE ); + + setCaption( filename ); + + statusBar()->message( QString( "File %1 saved" ).arg( filename ), 2000 ); +} + + +void ApplicationWindow::saveAs() +{ + QString fn = QFileDialog::getSaveFileName( QString::null, QString::null, + this ); + if ( !fn.isEmpty() ) { + filename = fn; + save(); + } else { + statusBar()->message( "Saving aborted", 2000 ); + } +} + + +void ApplicationWindow::print() +{ + printer->setFullPage( TRUE ); + if ( printer->setup(this) ) { // printer dialog + statusBar()->message( "Printing..." ); + + if (printer->printRange( e )) + statusBar()->message( "Printing completed", 2000 ); + else + statusBar()->message( "Error while printing", 2000 ); + } else { + statusBar()->message( "Printing aborted", 2000 ); + } +} + +void ApplicationWindow::closeEvent( QCloseEvent* ce ) +{ + if ( !e->isModified() ) { + ce->accept(); + return; + } + + switch( QMessageBox::information( this, "QScintilla Application Example", + "Do you want to save the changes" + " to the document?", + "Yes", "No", "Cancel", + 0, 1 ) ) { + case 0: + save(); + ce->accept(); + break; + case 1: + ce->accept(); + break; + case 2: + default: // just for sanity + ce->ignore(); + break; + } +} + + +void ApplicationWindow::about() +{ + QMessageBox::about( this, "QScintilla Application Example", + "This example demonstrates a simple use of " + "QextScintilla and QextScintillaPrinter."); +} + + +void ApplicationWindow::aboutQt() +{ + QMessageBox::aboutQt( this, "QScintilla Application Example" ); +} diff --git a/example/application.h b/example/application.h new file mode 100644 index 0000000..6f48d41 --- /dev/null +++ b/example/application.h @@ -0,0 +1,48 @@ +/**************************************************************************** +** $Id: application.h,v 1.1 2004/09/18 17:31:23 phil Exp $ +** +** Copyright (C) 1992-2000 Trolltech AS. All rights reserved. +** +** This file is part of an example program for Qt. This example +** program may be used, distributed and modified without limitation. +** +*****************************************************************************/ + +#ifndef APPLICATION_H +#define APPLICATION_H + +#include + +class QextScintilla; +class QextScintillaPrinter; + +class ApplicationWindow: public QMainWindow +{ + Q_OBJECT + +public: + ApplicationWindow(); + ~ApplicationWindow(); + +protected: + void closeEvent( QCloseEvent* ); + +private slots: + void newDoc(); + void choose(); + void load( const QString &fileName ); + void save(); + void saveAs(); + void print(); + + void about(); + void aboutQt(); + +private: + QextScintillaPrinter *printer; + QextScintilla *e; + QString filename; +}; + + +#endif diff --git a/example/application.pro b/example/application.pro new file mode 100644 index 0000000..160beaa --- /dev/null +++ b/example/application.pro @@ -0,0 +1,10 @@ +TEMPLATE = app +TARGET = application + +CONFIG += qt warn_on release + +LIBS += -lqscintilla + +HEADERS = application.h +SOURCES = application.cpp \ + main.cpp diff --git a/example/fileopen.xpm b/example/fileopen.xpm new file mode 100644 index 0000000..880417e --- /dev/null +++ b/example/fileopen.xpm @@ -0,0 +1,22 @@ +/* XPM */ +static const char *fileopen[] = { +" 16 13 5 1", +". c #040404", +"# c #808304", +"a c None", +"b c #f3f704", +"c c #f3f7f3", +"aaaaaaaaa...aaaa", +"aaaaaaaa.aaa.a.a", +"aaaaaaaaaaaaa..a", +"a...aaaaaaaa...a", +".bcb.......aaaaa", +".cbcbcbcbc.aaaaa", +".bcbcbcbcb.aaaaa", +".cbcb...........", +".bcb.#########.a", +".cb.#########.aa", +".b.#########.aaa", +"..#########.aaaa", +"...........aaaaa" +}; diff --git a/example/fileprint.xpm b/example/fileprint.xpm new file mode 100644 index 0000000..6ada912 --- /dev/null +++ b/example/fileprint.xpm @@ -0,0 +1,24 @@ +/* XPM */ +static const char *fileprint[] = { +" 16 14 6 1", +". c #000000", +"# c #848284", +"a c #c6c3c6", +"b c #ffff00", +"c c #ffffff", +"d c None", +"ddddd.........dd", +"dddd.cccccccc.dd", +"dddd.c.....c.ddd", +"ddd.cccccccc.ddd", +"ddd.c.....c....d", +"dd.cccccccc.a.a.", +"d..........a.a..", +".aaaaaaaaaa.a.a.", +".............aa.", +".aaaaaa###aa.a.d", +".aaaaaabbbaa...d", +".............a.d", +"d.aaaaaaaaa.a.dd", +"dd...........ddd" +}; diff --git a/example/filesave.xpm b/example/filesave.xpm new file mode 100644 index 0000000..bd6870f --- /dev/null +++ b/example/filesave.xpm @@ -0,0 +1,22 @@ +/* XPM */ +static const char *filesave[] = { +" 14 14 4 1", +". c #040404", +"# c #808304", +"a c #bfc2bf", +"b c None", +"..............", +".#.aaaaaaaa.a.", +".#.aaaaaaaa...", +".#.aaaaaaaa.#.", +".#.aaaaaaaa.#.", +".#.aaaaaaaa.#.", +".#.aaaaaaaa.#.", +".##........##.", +".############.", +".##.........#.", +".##......aa.#.", +".##......aa.#.", +".##......aa.#.", +"b............." +}; diff --git a/example/main.cpp b/example/main.cpp new file mode 100644 index 0000000..3c2722c --- /dev/null +++ b/example/main.cpp @@ -0,0 +1,21 @@ +/**************************************************************************** +** $Id: main.cpp,v 1.1 2004/09/18 17:31:23 phil Exp $ +** +** Copyright (C) 1992-2000 Trolltech AS. All rights reserved. +** +** This file is part of an example program for Qt. This example +** program may be used, distributed and modified without limitation. +** +*****************************************************************************/ + +#include +#include "application.h" + +int main( int argc, char ** argv ) { + QApplication a( argc, argv ); + ApplicationWindow *mw = new ApplicationWindow(); + mw->setCaption( "QScintilla Example - Application" ); + mw->show(); + a.connect( &a, SIGNAL(lastWindowClosed()), &a, SLOT(quit()) ); + return a.exec(); +} diff --git a/include/Accessor.h b/include/Accessor.h new file mode 100755 index 0000000..0b2c4ba --- /dev/null +++ b/include/Accessor.h @@ -0,0 +1,78 @@ +// Scintilla source code edit control +/** @file Accessor.h + ** Rapid easy access to contents of a Scintilla. + **/ +// Copyright 1998-2001 by Neil Hodgson +// The License.txt file describes the conditions under which this software may be distributed. + +enum { wsSpace = 1, wsTab = 2, wsSpaceTab = 4, wsInconsistent=8}; + +class Accessor; + +typedef bool (*PFNIsCommentLeader)(Accessor &styler, int pos, int len); + +/** + * Interface to data in a Scintilla. + */ +class Accessor { +protected: + enum {extremePosition=0x7FFFFFFF}; + /** @a bufferSize is a trade off between time taken to copy the characters + * and retrieval overhead. + * @a slopSize positions the buffer before the desired position + * in case there is some backtracking. */ + enum {bufferSize=4000, slopSize=bufferSize/8}; + char buf[bufferSize+1]; + int startPos; + int endPos; + int codePage; + + virtual bool InternalIsLeadByte(char ch)=0; + virtual void Fill(int position)=0; + +public: + Accessor() : startPos(extremePosition), endPos(0), codePage(0) {} + virtual ~Accessor() {} + char operator[](int position) { + if (position < startPos || position >= endPos) { + Fill(position); + } + return buf[position - startPos]; + } + /** Safe version of operator[], returning a defined value for invalid position. */ + char SafeGetCharAt(int position, char chDefault=' ') { + if (position < startPos || position >= endPos) { + Fill(position); + if (position < startPos || position >= endPos) { + // Position is outside range of document + return chDefault; + } + } + return buf[position - startPos]; + } + bool IsLeadByte(char ch) { + return codePage && InternalIsLeadByte(ch); + } + void SetCodePage(int codePage_) { codePage = codePage_; } + + virtual bool Match(int pos, const char *s)=0; + virtual char StyleAt(int position)=0; + virtual int GetLine(int position)=0; + virtual int LineStart(int line)=0; + virtual int LevelAt(int line)=0; + virtual int Length()=0; + virtual void Flush()=0; + virtual int GetLineState(int line)=0; + virtual int SetLineState(int line, int state)=0; + virtual int GetPropertyInt(const char *key, int defaultValue=0)=0; + virtual char *GetProperties()=0; + + // Style setting + virtual void StartAt(unsigned int start, char chMask=31)=0; + virtual void SetFlags(char chFlags_, char chWhile_)=0; + virtual unsigned int GetStartSegment()=0; + virtual void StartSegment(unsigned int pos)=0; + virtual void ColourTo(unsigned int pos, int chAttr)=0; + virtual void SetLevel(int line, int level)=0; + virtual int IndentAmount(int line, int *flags, PFNIsCommentLeader pfnIsCommentLeader = 0)=0; +}; diff --git a/include/Face.py b/include/Face.py new file mode 100755 index 0000000..08ac7a9 --- /dev/null +++ b/include/Face.py @@ -0,0 +1,107 @@ +# Module for reading and parsing Scintilla.iface file +import string + +def sanitiseLine(line): + if line[-1:] == '\n': line = line[:-1] + if string.find(line, "##") != -1: + line = line[:string.find(line, "##")] + line = string.strip(line) + return line + +def decodeFunction(featureVal): + retType, rest = string.split(featureVal, " ", 1) + nameIdent, params = string.split(rest, "(") + name, value = string.split(nameIdent, "=") + params, rest = string.split(params, ")") + param1, param2 = string.split(params, ",")[0:2] + return retType, name, value, param1, param2 + +def decodeEvent(featureVal): + retType, rest = string.split(featureVal, " ", 1) + nameIdent, params = string.split(rest, "(") + name, value = string.split(nameIdent, "=") + return retType, name, value + +def decodeParam(p): + param = string.strip(p) + type = "" + name = "" + value = "" + if " " in param: + type, nv = string.split(param, " ") + if "=" in nv: + name, value = string.split(nv, "=") + else: + name = nv + return type, name, value + +class Face: + + def __init__(self): + self.order = [] + self.features = {} + self.values = {} + self.events = {} + + def ReadFromFile(self, name): + currentCategory = "" + currentComment = [] + currentCommentFinished = 0 + file = open(name) + for line in file.readlines(): + line = sanitiseLine(line) + if line: + if line[0] == "#": + if line[1] == " ": + if currentCommentFinished: + currentComment = [] + currentCommentFinished = 0 + currentComment.append(line[2:]) + else: + currentCommentFinished = 1 + featureType, featureVal = string.split(line, " ", 1) + if featureType in ["fun", "get", "set"]: + retType, name, value, param1, param2 = decodeFunction(featureVal) + p1 = decodeParam(param1) + p2 = decodeParam(param2) + self.features[name] = { + "FeatureType": featureType, + "ReturnType": retType, + "Value": value, + "Param1Type": p1[0], "Param1Name": p1[1], "Param1Value": p1[2], + "Param2Type": p2[0], "Param2Name": p2[1], "Param2Value": p2[2], + "Category": currentCategory, "Comment": currentComment + } + if self.values.has_key(value): + raise "Duplicate value " + value + " " + name + self.values[value] = 1 + self.order.append(name) + elif featureType == "evt": + retType, name, value = decodeEvent(featureVal) + self.features[name] = { + "FeatureType": featureType, + "ReturnType": retType, + "Value": value, + "Category": currentCategory, "Comment": currentComment + } + if self.events.has_key(value): + raise "Duplicate event " + value + " " + name + self.events[value] = 1 + self.order.append(name) + elif featureType == "cat": + currentCategory = featureVal + elif featureType == "val": + name, value = string.split(featureVal, "=", 1) + self.features[name] = { + "FeatureType": featureType, + "Category": currentCategory, + "Value": value } + self.order.append(name) + elif featureType == "enu" or featureType == "lex": + name, value = string.split(featureVal, "=", 1) + self.features[name] = { + "FeatureType": featureType, + "Category": currentCategory, + "Value": value } + self.order.append(name) + diff --git a/include/HFacer.py b/include/HFacer.py new file mode 100755 index 0000000..8c780d5 --- /dev/null +++ b/include/HFacer.py @@ -0,0 +1,76 @@ +# HFacer.py - regenerate the Scintilla.h and SciLexer.h files from the Scintilla.iface interface +# definition file. +# The header files are copied to a temporary file apart from the section between a //++Autogenerated +# comment and a //--Autogenerated comment which is generated by the printHFile and printLexHFile +# functions. After the temporary file is created, it is copied back to the original file name. + +import string +import sys +import os +import Face + +def Contains(s,sub): + return string.find(s, sub) != -1 + +def printLexHFile(f,out): + for name in f.order: + v = f.features[name] + if v["FeatureType"] in ["val"]: + if Contains(name, "SCE_") or Contains(name, "SCLEX_"): + out.write("#define " + name + " " + v["Value"] + "\n") + +def printHFile(f,out): + for name in f.order: + v = f.features[name] + if v["Category"] != "Deprecated": + if v["FeatureType"] in ["fun", "get", "set"]: + featureDefineName = "SCI_" + string.upper(name) + out.write("#define " + featureDefineName + " " + v["Value"] + "\n") + elif v["FeatureType"] in ["evt"]: + featureDefineName = "SCN_" + string.upper(name) + out.write("#define " + featureDefineName + " " + v["Value"] + "\n") + elif v["FeatureType"] in ["val"]: + if not (Contains(name, "SCE_") or Contains(name, "SCLEX_")): + out.write("#define " + name + " " + v["Value"] + "\n") + +def CopyWithInsertion(input, output, genfn, definition): + copying = 1 + for line in input.readlines(): + if copying: + output.write(line) + if Contains(line, "//++Autogenerated"): + copying = 0 + genfn(definition, output) + if Contains(line, "//--Autogenerated"): + copying = 1 + output.write(line) + +def contents(filename): + f = file(filename) + t = f.read() + f.close() + return t + +def Regenerate(filename, genfn, definition): + inText = contents(filename) + tempname = "HFacer.tmp" + out = open(tempname,"w") + hfile = open(filename) + CopyWithInsertion(hfile, out, genfn, definition) + out.close() + hfile.close() + outText = contents(tempname) + if inText == outText: + os.unlink(tempname) + else: + os.unlink(filename) + os.rename(tempname, filename) + +f = Face.Face() +try: + f.ReadFromFile("Scintilla.iface") + Regenerate("Scintilla.h", printHFile, f) + Regenerate("SciLexer.h", printLexHFile, f) + print "Maximum ID is", max(x for x in f.values if int(x) < 3000) +except: + raise diff --git a/include/KeyWords.h b/include/KeyWords.h new file mode 100755 index 0000000..059ac0d --- /dev/null +++ b/include/KeyWords.h @@ -0,0 +1,82 @@ +// Scintilla source code edit control +/** @file KeyWords.h + ** Colourise for particular languages. + **/ +// Copyright 1998-2001 by Neil Hodgson +// The License.txt file describes the conditions under which this software may be distributed. + +typedef void (*LexerFunction)(unsigned int startPos, int lengthDoc, int initStyle, + WordList *keywordlists[], Accessor &styler); + +/** + * A LexerModule is responsible for lexing and folding a particular language. + * The class maintains a list of LexerModules which can be searched to find a + * module appropriate to a particular language. + */ +class LexerModule { +protected: + const LexerModule *next; + int language; + LexerFunction fnLexer; + LexerFunction fnFolder; + const char * const * wordListDescriptions; + int styleBits; + + static const LexerModule *base; + static int nextLanguage; + +public: + const char *languageName; + LexerModule(int language_, + LexerFunction fnLexer_, + const char *languageName_=0, + LexerFunction fnFolder_=0, + const char * const wordListDescriptions_[] = NULL, + int styleBits_=5); + virtual ~LexerModule() { + } + int GetLanguage() const { return language; } + + // -1 is returned if no WordList information is available + int GetNumWordLists() const; + const char *GetWordListDescription(int index) const; + + int GetStyleBitsNeeded() const; + + virtual void Lex(unsigned int startPos, int lengthDoc, int initStyle, + WordList *keywordlists[], Accessor &styler) const; + virtual void Fold(unsigned int startPos, int lengthDoc, int initStyle, + WordList *keywordlists[], Accessor &styler) const; + static const LexerModule *Find(int language); + static const LexerModule *Find(const char *languageName); +}; + +/** + * Check if a character is a space. + * This is ASCII specific but is safe with chars >= 0x80. + */ +inline bool isspacechar(unsigned char ch) { + return (ch == ' ') || ((ch >= 0x09) && (ch <= 0x0d)); +} + +inline bool iswordchar(char ch) { + return isascii(ch) && (isalnum(ch) || ch == '.' || ch == '_'); +} + +inline bool iswordstart(char ch) { + return isascii(ch) && (isalnum(ch) || ch == '_'); +} + +inline bool isoperator(char ch) { + if (isascii(ch) && isalnum(ch)) + return false; + // '.' left out as it is used to make up numbers + if (ch == '%' || ch == '^' || ch == '&' || ch == '*' || + ch == '(' || ch == ')' || ch == '-' || ch == '+' || + ch == '=' || ch == '|' || ch == '{' || ch == '}' || + ch == '[' || ch == ']' || ch == ':' || ch == ';' || + ch == '<' || ch == '>' || ch == ',' || ch == '/' || + ch == '?' || ch == '!' || ch == '.' || ch == '~') + return true; + return false; +} diff --git a/include/License.txt b/include/License.txt new file mode 100755 index 0000000..cbe25b2 --- /dev/null +++ b/include/License.txt @@ -0,0 +1,20 @@ +License for Scintilla and SciTE + +Copyright 1998-2003 by Neil Hodgson + +All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation. + +NEIL HODGSON DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS +SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS, IN NO EVENT SHALL NEIL HODGSON BE LIABLE FOR ANY +SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE +OR PERFORMANCE OF THIS SOFTWARE. \ No newline at end of file diff --git a/include/Platform.h b/include/Platform.h new file mode 100755 index 0000000..93ffc00 --- /dev/null +++ b/include/Platform.h @@ -0,0 +1,531 @@ +// Scintilla source code edit control +/** @file Platform.h + ** Interface to platform facilities. Also includes some basic utilities. + ** Implemented in PlatGTK.cxx for GTK+/Linux, PlatWin.cxx for Windows, and PlatWX.cxx for wxWindows. + **/ +// Copyright 1998-2003 by Neil Hodgson +// The License.txt file describes the conditions under which this software may be distributed. + +#ifndef PLATFORM_H +#define PLATFORM_H + +// PLAT_QT is Qt on any supported platform +// PLAT_GTK = GTK+ on Linux or Win32 +// PLAT_GTK_WIN32 is defined additionally when running PLAT_GTK under Win32 +// PLAT_WIN = Win32 API on Win32 OS +// PLAT_WX is wxWindows on any supported platform + +#define PLAT_QT 0 +#define PLAT_GTK 0 +#define PLAT_GTK_WIN32 0 +#define PLAT_WIN 0 +#define PLAT_WX 0 +#define PLAT_FOX 0 + +#if defined(FOX) +#undef PLAT_FOX +#define PLAT_FOX 1 + +#elif defined(QT) +#undef PLAT_QT +#define PLAT_QT 1 + +#elif defined(__WX__) +#undef PLAT_WX +#define PLAT_WX 1 + +#elif defined(GTK) +#undef PLAT_GTK +#define PLAT_GTK 1 + +#ifdef _MSC_VER +#undef PLAT_GTK_WIN32 +#define PLAT_GTK_WIN32 1 +#endif + +#else +#undef PLAT_WIN +#define PLAT_WIN 1 + +#endif + + +// Underlying the implementation of the platform classes are platform specific types. +// Sometimes these need to be passed around by client code so they are defined here + +typedef void *FontID; +typedef void *SurfaceID; +typedef void *WindowID; +typedef void *MenuID; +typedef void *TickerID; +typedef void *Function; +typedef void *IdlerID; + +/** + * A geometric point class. + * Point is exactly the same as the Win32 POINT and GTK+ GdkPoint so can be used interchangeably. + */ +class Point { +public: + int x; + int y; + + explicit Point(int x_=0, int y_=0) : x(x_), y(y_) { + } + + // Other automatically defined methods (assignment, copy constructor, destructor) are fine + + static Point FromLong(long lpoint); +}; + +/** + * A geometric rectangle class. + * PRectangle is exactly the same as the Win32 RECT so can be used interchangeably. + * PRectangles contain their top and left sides, but not their right and bottom sides. + */ +class PRectangle { +public: + int left; + int top; + int right; + int bottom; + + PRectangle(int left_=0, int top_=0, int right_=0, int bottom_ = 0) : + left(left_), top(top_), right(right_), bottom(bottom_) { + } + + // Other automatically defined methods (assignment, copy constructor, destructor) are fine + + bool operator==(PRectangle &rc) { + return (rc.left == left) && (rc.right == right) && + (rc.top == top) && (rc.bottom == bottom); + } + bool Contains(Point pt) { + return (pt.x >= left) && (pt.x <= right) && + (pt.y >= top) && (pt.y <= bottom); + } + bool Contains(PRectangle rc) { + return (rc.left >= left) && (rc.right <= right) && + (rc.top >= top) && (rc.bottom <= bottom); + } + bool Intersects(PRectangle other) { + return (right > other.left) && (left < other.right) && + (bottom > other.top) && (top < other.bottom); + } + void Move(int xDelta, int yDelta) { + left += xDelta; + top += yDelta; + right += xDelta; + bottom += yDelta; + } + int Width() { return right - left; } + int Height() { return bottom - top; } +}; + +/** + * In some circumstances, including Win32 in paletted mode and GTK+, each colour + * must be allocated before use. The desired colours are held in the ColourDesired class, + * and after allocation the allocation entry is stored in the ColourAllocated class. In other + * circumstances, such as Win32 in true colour mode, the allocation process just copies + * the RGB values from the desired to the allocated class. + * As each desired colour requires allocation before it can be used, the ColourPair class + * holds both a ColourDesired and a ColourAllocated + * The Palette class is responsible for managing the palette of colours which contains a + * list of ColourPair objects and performs the allocation. + */ + +/** + * Holds a desired RGB colour. + */ +class ColourDesired { + long co; +public: + ColourDesired(long lcol=0) { + co = lcol; + } + + ColourDesired(unsigned int red, unsigned int green, unsigned int blue) { + Set(red, green, blue); + } + + bool operator==(const ColourDesired &other) const { + return co == other.co; + } + + void Set(long lcol) { + co = lcol; + } + + void Set(unsigned int red, unsigned int green, unsigned int blue) { + co = red | (green << 8) | (blue << 16); + } + + static inline unsigned int ValueOfHex(const char ch) { + if (ch >= '0' && ch <= '9') + return ch - '0'; + else if (ch >= 'A' && ch <= 'F') + return ch - 'A' + 10; + else if (ch >= 'a' && ch <= 'f') + return ch - 'a' + 10; + else + return 0; + } + + void Set(const char *val) { + if (*val == '#') { + val++; + } + unsigned int r = ValueOfHex(val[0]) * 16 + ValueOfHex(val[1]); + unsigned int g = ValueOfHex(val[2]) * 16 + ValueOfHex(val[3]); + unsigned int b = ValueOfHex(val[4]) * 16 + ValueOfHex(val[5]); + Set(r, g, b); + } + + long AsLong() const { + return co; + } + + unsigned int GetRed() { + return co & 0xff; + } + + unsigned int GetGreen() { + return (co >> 8) & 0xff; + } + + unsigned int GetBlue() { + return (co >> 16) & 0xff; + } +}; + +/** + * Holds an allocated RGB colour which may be an approximation to the desired colour. + */ +class ColourAllocated { + long coAllocated; + +public: + + ColourAllocated(long lcol=0) { + coAllocated = lcol; + } + + void Set(long lcol) { + coAllocated = lcol; + } + + long AsLong() const { + return coAllocated; + } +}; + +/** + * Colour pairs hold a desired colour and an allocated colour. + */ +struct ColourPair { + ColourDesired desired; + ColourAllocated allocated; + + ColourPair(ColourDesired desired_=ColourDesired(0,0,0)) { + desired = desired_; + allocated.Set(desired.AsLong()); + } + void Copy() { + allocated.Set(desired.AsLong()); + } +}; + +class Window; // Forward declaration for Palette + +/** + * Colour palette management. + */ +class Palette { + int used; + int size; + ColourPair *entries; +#if PLAT_GTK + void *allocatedPalette; // GdkColor * + int allocatedLen; +#endif + // Private so Palette objects can not be copied + Palette(const Palette &) {} + Palette &operator=(const Palette &) { return *this; } +public: +#if PLAT_WIN + void *hpal; +#endif + bool allowRealization; + + Palette(); + ~Palette(); + + void Release(); + + /** + * This method either adds a colour to the list of wanted colours (want==true) + * or retrieves the allocated colour back to the ColourPair. + * This is one method to make it easier to keep the code for wanting and retrieving in sync. + */ + void WantFind(ColourPair &cp, bool want); + + void Allocate(Window &w); +}; + +/** + * Font management. + */ +class Font { +protected: + FontID id; +#if PLAT_WX + int ascent; +#endif + // Private so Font objects can not be copied + Font(const Font &) {} + Font &operator=(const Font &) { id=0; return *this; } +public: + Font(); + virtual ~Font(); + + virtual void Create(const char *faceName, int characterSet, int size, + bool bold, bool italic, bool extraFontFlag=false); + virtual void Release(); + + FontID GetID() { return id; } + // Alias another font - caller guarantees not to Release + void SetID(FontID id_) { id = id_; } + friend class Surface; + friend class SurfaceImpl; +}; + +/** + * A surface abstracts a place to draw. + */ +#if defined(PLAT_QT) +class XPM; +#endif + +class Surface { +private: + // Private so Surface objects can not be copied + Surface(const Surface &) {} + Surface &operator=(const Surface &) { return *this; } +public: + Surface() {}; + virtual ~Surface() {}; + static Surface *Allocate(); + + virtual void Init(WindowID wid)=0; + virtual void Init(SurfaceID sid, WindowID wid)=0; + virtual void InitPixMap(int width, int height, Surface *surface_, WindowID wid)=0; + + virtual void Release()=0; + virtual bool Initialised()=0; + virtual void PenColour(ColourAllocated fore)=0; + virtual int LogPixelsY()=0; + virtual int DeviceHeightFont(int points)=0; + virtual void MoveTo(int x_, int y_)=0; + virtual void LineTo(int x_, int y_)=0; + virtual void Polygon(Point *pts, int npts, ColourAllocated fore, ColourAllocated back)=0; + virtual void RectangleDraw(PRectangle rc, ColourAllocated fore, ColourAllocated back)=0; + virtual void FillRectangle(PRectangle rc, ColourAllocated back)=0; + virtual void FillRectangle(PRectangle rc, Surface &surfacePattern)=0; + virtual void RoundedRectangle(PRectangle rc, ColourAllocated fore, ColourAllocated back)=0; + virtual void AlphaRectangle(PRectangle rc, int cornerSize, ColourAllocated fill, int alphaFill, + ColourAllocated outline, int alphaOutline, int flags)=0; + virtual void Ellipse(PRectangle rc, ColourAllocated fore, ColourAllocated back)=0; + virtual void Copy(PRectangle rc, Point from, Surface &surfaceSource)=0; + + virtual void DrawTextNoClip(PRectangle rc, Font &font_, int ybase, const char *s, int len, ColourAllocated fore, ColourAllocated back)=0; + virtual void DrawTextClipped(PRectangle rc, Font &font_, int ybase, const char *s, int len, ColourAllocated fore, ColourAllocated back)=0; + virtual void DrawTextTransparent(PRectangle rc, Font &font_, int ybase, const char *s, int len, ColourAllocated fore)=0; + virtual void MeasureWidths(Font &font_, const char *s, int len, int *positions)=0; + virtual int WidthText(Font &font_, const char *s, int len)=0; + virtual int WidthChar(Font &font_, char ch)=0; + virtual int Ascent(Font &font_)=0; + virtual int Descent(Font &font_)=0; + virtual int InternalLeading(Font &font_)=0; + virtual int ExternalLeading(Font &font_)=0; + virtual int Height(Font &font_)=0; + virtual int AverageCharWidth(Font &font_)=0; + + virtual int SetPalette(Palette *pal, bool inBackGround)=0; + virtual void SetClip(PRectangle rc)=0; + virtual void FlushCachedState()=0; + + virtual void SetUnicodeMode(bool unicodeMode_)=0; + virtual void SetDBCSMode(int codePage)=0; + +#if defined(PLAT_QT) + virtual void DrawXPM(PRectangle rc, const XPM *xpm)=0; +#endif +}; + +/** + * A simple callback action passing one piece of untyped user data. + */ +typedef void (*CallBackAction)(void*); + +/** + * Class to hide the details of window manipulation. + * Does not own the window which will normally have a longer life than this object. + */ +class Window { +protected: + WindowID id; +public: + Window() : id(0), cursorLast(cursorInvalid) {} + Window(const Window &source) : id(source.id), cursorLast(cursorInvalid) {} + virtual ~Window(); + Window &operator=(WindowID id_) { + id = id_; + return *this; + } + WindowID GetID() const { return id; } + bool Created() const { return id != 0; } + void Destroy(); + bool HasFocus(); + PRectangle GetPosition(); + void SetPosition(PRectangle rc); + void SetPositionRelative(PRectangle rc, Window relativeTo); + PRectangle GetClientPosition(); + void Show(bool show=true); + void InvalidateAll(); + void InvalidateRectangle(PRectangle rc); + virtual void SetFont(Font &font); + enum Cursor { cursorInvalid, cursorText, cursorArrow, cursorUp, cursorWait, cursorHoriz, cursorVert, cursorReverseArrow, cursorHand }; + void SetCursor(Cursor curs); + void SetTitle(const char *s); +private: + Cursor cursorLast; +}; + +/** + * Listbox management. + */ + +class ListBox : public Window { +public: + ListBox(); + virtual ~ListBox(); + static ListBox *Allocate(); + + virtual void SetFont(Font &font)=0; + virtual void Create(Window &parent, int ctrlID, Point location, int lineHeight_, bool unicodeMode_)=0; + virtual void SetAverageCharWidth(int width)=0; + virtual void SetVisibleRows(int rows)=0; + virtual int GetVisibleRows() const=0; + virtual PRectangle GetDesiredRect()=0; + virtual int CaretFromEdge()=0; + virtual void Clear()=0; + virtual void Append(char *s, int type = -1)=0; + virtual int Length()=0; + virtual void Select(int n)=0; + virtual int GetSelection()=0; + virtual int Find(const char *prefix)=0; + virtual void GetValue(int n, char *value, int len)=0; + virtual void RegisterImage(int type, const char *xpm_data)=0; + virtual void ClearRegisteredImages()=0; + virtual void SetDoubleClickAction(CallBackAction, void *)=0; + virtual void SetList(const char* list, char separator, char typesep)=0; +}; + +/** + * Menu management. + */ +class Menu { + MenuID id; +public: + Menu(); + MenuID GetID() { return id; } + void CreatePopUp(); + void Destroy(); + void Show(Point pt, Window &w); +}; + +class ElapsedTime { + long bigBit; + long littleBit; +public: + ElapsedTime(); + double Duration(bool reset=false); +}; + +/** + * Dynamic Library (DLL/SO/...) loading + */ +class DynamicLibrary { +public: + virtual ~DynamicLibrary() {}; + + /// @return Pointer to function "name", or NULL on failure. + virtual Function FindFunction(const char *name) = 0; + + /// @return true if the library was loaded successfully. + virtual bool IsValid() = 0; + + /// @return An instance of a DynamicLibrary subclass with "modulePath" loaded. + static DynamicLibrary *Load(const char *modulePath); +}; + +/** + * Platform class used to retrieve system wide parameters such as double click speed + * and chrome colour. Not a creatable object, more of a module with several functions. + */ +class Platform { + // Private so Platform objects can not be copied + Platform(const Platform &) {} + Platform &operator=(const Platform &) { return *this; } +public: + // Should be private because no new Platforms are ever created + // but gcc warns about this + Platform() {} + ~Platform() {} + static ColourDesired Chrome(); + static ColourDesired ChromeHighlight(); + static const char *DefaultFont(); + static int DefaultFontSize(); + static unsigned int DoubleClickTime(); + static bool MouseButtonBounce(); + static void DebugDisplay(const char *s); + static bool IsKeyDown(int key); + static long SendScintilla( + WindowID w, unsigned int msg, unsigned long wParam=0, long lParam=0); + static long SendScintillaPointer( + WindowID w, unsigned int msg, unsigned long wParam=0, void *lParam=0); + static bool IsDBCSLeadByte(int codePage, char ch); + static int DBCSCharLength(int codePage, const char *s); + static int DBCSCharMaxLength(); + + // These are utility functions not really tied to a platform + static int Minimum(int a, int b); + static int Maximum(int a, int b); + // Next three assume 16 bit shorts and 32 bit longs + static long LongFromTwoShorts(short a,short b) { + return (a) | ((b) << 16); + } + static short HighShortFromLong(long x) { + return static_cast(x >> 16); + } + static short LowShortFromLong(long x) { + return static_cast(x & 0xffff); + } + static void DebugPrintf(const char *format, ...); + static bool ShowAssertionPopUps(bool assertionPopUps_); + static void Assert(const char *c, const char *file, int line); + static int Clamp(int val, int minVal, int maxVal); +}; + +#ifdef NDEBUG +#define PLATFORM_ASSERT(c) ((void)0) +#else +#define PLATFORM_ASSERT(c) ((c) ? (void)(0) : Platform::Assert(#c, __FILE__, __LINE__)) +#endif + +// Shut up annoying Visual C++ warnings: +#ifdef _MSC_VER +#pragma warning(disable: 4244 4309 4514 4710) +#endif + +#endif diff --git a/include/PropSet.h b/include/PropSet.h new file mode 100755 index 0000000..e38de7d --- /dev/null +++ b/include/PropSet.h @@ -0,0 +1,114 @@ +// Scintilla source code edit control +/** @file PropSet.h + ** A Java style properties file module. + **/ +// Copyright 1998-2002 by Neil Hodgson +// The License.txt file describes the conditions under which this software may be distributed. + +#ifndef PROPSET_H +#define PROPSET_H +#include "SString.h" + +bool EqualCaseInsensitive(const char *a, const char *b); + +bool isprefix(const char *target, const char *prefix); + +struct Property { + unsigned int hash; + char *key; + char *val; + Property *next; + Property() : hash(0), key(0), val(0), next(0) {} +}; + +/** + */ +class PropSet { +protected: + enum { hashRoots=31 }; + Property *props[hashRoots]; + Property *enumnext; + int enumhash; + static bool caseSensitiveFilenames; + static unsigned int HashString(const char *s, size_t len) { + unsigned int ret = 0; + while (len--) { + ret <<= 4; + ret ^= *s; + s++; + } + return ret; + } + static bool IncludesVar(const char *value, const char *key); + +public: + PropSet *superPS; + PropSet(); + ~PropSet(); + void Set(const char *key, const char *val, int lenKey=-1, int lenVal=-1); + void Set(const char *keyVal); + void Unset(const char *key, int lenKey=-1); + void SetMultiple(const char *s); + SString Get(const char *key); + SString GetExpanded(const char *key); + SString Expand(const char *withVars, int maxExpands=100); + int GetInt(const char *key, int defaultValue=0); + SString GetWild(const char *keybase, const char *filename); + SString GetNewExpand(const char *keybase, const char *filename=""); + void Clear(); + char *ToString(); // Caller must delete[] the return value + bool GetFirst(char **key, char **val); + bool GetNext(char **key, char **val); + static void SetCaseSensitiveFilenames(bool caseSensitiveFilenames_) { + caseSensitiveFilenames = caseSensitiveFilenames_; + } + +private: + // copy-value semantics not implemented + PropSet(const PropSet ©); + void operator=(const PropSet &assign); +}; + +/** + */ +class WordList { +public: + // Each word contains at least one character - a empty word acts as sentinel at the end. + char **words; + char **wordsNoCase; + char *list; + int len; + bool onlyLineEnds; ///< Delimited by any white space or only line ends + bool sorted; + bool sortedNoCase; + int starts[256]; + WordList(bool onlyLineEnds_ = false) : + words(0), wordsNoCase(0), list(0), len(0), onlyLineEnds(onlyLineEnds_), + sorted(false), sortedNoCase(false) {} + ~WordList() { Clear(); } + operator bool() { return len ? true : false; } + char *operator[](int ind) { return words[ind]; } + void Clear(); + void Set(const char *s); + char *Allocate(int size); + void SetFromAllocated(); + bool InList(const char *s); + bool InListAbbreviated(const char *s, const char marker); + const char *GetNearestWord(const char *wordStart, int searchLen, + bool ignoreCase = false, SString wordCharacters="", int wordIndex = -1); + char *GetNearestWords(const char *wordStart, int searchLen, + bool ignoreCase=false, char otherSeparator='\0', bool exactLen=false); +}; + +inline bool IsAlphabetic(unsigned int ch) { + return ((ch >= 'A') && (ch <= 'Z')) || ((ch >= 'a') && (ch <= 'z')); +} + + +#ifdef _MSC_VER +// Visual C++ doesn't like the private copy idiom for disabling +// the default copy constructor and operator=, but it's fine. +#pragma warning(disable: 4511 4512) +#endif + +#endif diff --git a/include/SString.h b/include/SString.h new file mode 100755 index 0000000..38a206c --- /dev/null +++ b/include/SString.h @@ -0,0 +1,280 @@ +// SciTE - Scintilla based Text Editor +/** @file SString.h + ** A simple string class. + **/ +// Copyright 1998-2004 by Neil Hodgson +// The License.txt file describes the conditions under which this software may be distributed. + +#ifndef SSTRING_H +#define SSTRING_H + +// These functions are implemented because each platform calls them something different. +int CompareCaseInsensitive(const char *a, const char *b); +int CompareNCaseInsensitive(const char *a, const char *b, size_t len); +bool EqualCaseInsensitive(const char *a, const char *b); + +// Define another string class. +// While it would be 'better' to use std::string, that doubles the executable size. +// An SString may contain embedded nul characters. + +/** + * Base class from which the two other classes (SBuffer & SString) + * are derived. + */ +class SContainer { +public: + /** Type of string lengths (sizes) and positions (indexes). */ + typedef size_t lenpos_t; + /** Out of bounds value indicating that the string argument should be measured. */ + enum { measure_length=0xffffffffU}; + +protected: + char *s; ///< The C string + lenpos_t sSize; ///< The size of the buffer, less 1: ie. the maximum size of the string + + SContainer() : s(0), sSize(0) {} + ~SContainer() { + delete []s; // Suppose it was allocated using StringAllocate + s = 0; + sSize = 0; + } + /** Size of buffer. */ + lenpos_t size() const { + if (s) { + return sSize; + } else { + return 0; + } + } +public: + /** + * Allocate uninitialized memory big enough to fit a string of the given length. + * @return the pointer to the new string + */ + static char *StringAllocate(lenpos_t len); + /** + * Duplicate a buffer/C string. + * Allocate memory of the given size, or big enough to fit the string if length isn't given; + * then copy the given string in the allocated memory. + * @return the pointer to the new string + */ + static char *StringAllocate( + const char *s, ///< The string to duplicate + lenpos_t len=measure_length); ///< The length of memory to allocate. Optional. +}; + + +/** + * @brief A string buffer class. + * + * Main use is to ask an API the length of a string it can provide, + * then to allocate a buffer of the given size, and to provide this buffer + * to the API to put the string. + * This class is intended to be shortlived, to be transformed as SString + * as soon as it holds the string, so it has little members. + * Note: we assume the buffer is filled by the API. If the length can be shorter, + * we should set sLen to strlen(sb.ptr()) in related SString constructor and assignment. + */ +class SBuffer : protected SContainer { +public: + SBuffer(lenpos_t len) { + s = StringAllocate(len); + if (s) { + *s = '\0'; + sSize = len; + } else { + sSize = 0; + } + } +private: + /// Copy constructor + // Here only to be on the safe size, user should avoid returning SBuffer values. + SBuffer(const SBuffer &source) : SContainer() { + s = StringAllocate(source.s, source.sSize); + sSize = (s) ? source.sSize : 0; + } + /// Default assignment operator + // Same here, shouldn't be used + SBuffer &operator=(const SBuffer &source) { + if (this != &source) { + delete []s; + s = StringAllocate(source.s, source.sSize); + sSize = (s) ? source.sSize : 0; + } + return *this; + } +public: + /** Provide direct read/write access to buffer. */ + char *ptr() { + return s; + } + /** Ownership of the buffer have been taken, so release it. */ + void reset() { + s = 0; + sSize = 0; + } + /** Size of buffer. */ + lenpos_t size() const { + return SContainer::size(); + } +}; + + +/** + * @brief A simple string class. + * + * Hold the length of the string for quick operations, + * can have a buffer bigger than the string to avoid too many memory allocations and copies. + * May have embedded zeroes as a result of @a substitute, but relies too heavily on C string + * functions to allow reliable manipulations of these strings, other than simple appends, etc. + */ +class SString : protected SContainer { + lenpos_t sLen; ///< The size of the string in s + lenpos_t sizeGrowth; ///< Minimum growth size when appending strings + enum { sizeGrowthDefault = 64 }; + + bool grow(lenpos_t lenNew); + SString &assign(const char *sOther, lenpos_t sSize_=measure_length); + +public: + SString() : sLen(0), sizeGrowth(sizeGrowthDefault) {} + SString(const SString &source) : SContainer(), sizeGrowth(sizeGrowthDefault) { + s = StringAllocate(source.s, source.sLen); + sSize = sLen = (s) ? source.sLen : 0; + } + SString(const char *s_) : sizeGrowth(sizeGrowthDefault) { + s = StringAllocate(s_); + sSize = sLen = (s) ? strlen(s) : 0; + } + SString(SBuffer &buf) : sizeGrowth(sizeGrowthDefault) { + s = buf.ptr(); + sSize = sLen = buf.size(); + // Consumes the given buffer! + buf.reset(); + } + SString(const char *s_, lenpos_t first, lenpos_t last) : sizeGrowth(sizeGrowthDefault) { + // note: expects the "last" argument to point one beyond the range end (a la STL iterators) + s = StringAllocate(s_ + first, last - first); + sSize = sLen = (s) ? last - first : 0; + } + SString(int i); + SString(double d, int precision); + ~SString() { + sLen = 0; + } + void clear() { + if (s) { + *s = '\0'; + } + sLen = 0; + } + /** Size of buffer. */ + lenpos_t size() const { + return SContainer::size(); + } + /** Size of string in buffer. */ + lenpos_t length() const { + return sLen; + } + /** Read access to a character of the string. */ + char operator[](lenpos_t i) const { + return (s && i < sSize) ? s[i] : '\0'; + } + SString &operator=(const char *source) { + return assign(source); + } + SString &operator=(const SString &source) { + if (this != &source) { + assign(source.s, source.sLen); + } + return *this; + } + bool operator==(const SString &sOther) const; + bool operator!=(const SString &sOther) const { + return !operator==(sOther); + } + bool operator==(const char *sOther) const; + bool operator!=(const char *sOther) const { + return !operator==(sOther); + } + bool contains(char ch) const { + return (s && *s) ? strchr(s, ch) != 0 : false; + } + void setsizegrowth(lenpos_t sizeGrowth_) { + sizeGrowth = sizeGrowth_; + } + const char *c_str() const { + return s ? s : ""; + } + /** Give ownership of buffer to caller which must use delete[] to free buffer. */ + char *detach() { + char *sRet = s; + s = 0; + sSize = 0; + sLen = 0; + return sRet; + } + SString substr(lenpos_t subPos, lenpos_t subLen=measure_length) const; + SString &lowercase(lenpos_t subPos = 0, lenpos_t subLen=measure_length); + SString &uppercase(lenpos_t subPos = 0, lenpos_t subLen=measure_length); + SString &append(const char *sOther, lenpos_t sLenOther=measure_length, char sep = '\0'); + SString &operator+=(const char *sOther) { + return append(sOther, static_cast(measure_length)); + } + SString &operator+=(const SString &sOther) { + return append(sOther.s, sOther.sLen); + } + SString &operator+=(char ch) { + return append(&ch, 1); + } + SString &appendwithseparator(const char *sOther, char sep) { + return append(sOther, strlen(sOther), sep); + } + SString &insert(lenpos_t pos, const char *sOther, lenpos_t sLenOther=measure_length); + + /** + * Remove @a len characters from the @a pos position, included. + * Characters at pos + len and beyond replace characters at pos. + * If @a len is 0, or greater than the length of the string + * starting at @a pos, the string is just truncated at @a pos. + */ + void remove(lenpos_t pos, lenpos_t len); + + SString &change(lenpos_t pos, char ch) { + if (pos < sLen) { // character changed must be in string bounds + *(s + pos) = ch; + } + return *this; + } + /** Read an integral numeric value from the string. */ + int value() const { + return s ? atoi(s) : 0; + } + bool startswith(const char *prefix); + bool endswith(const char *suffix); + int search(const char *sFind, lenpos_t start=0) const; + bool contains(const char *sFind) const { + return search(sFind) >= 0; + } + int substitute(char chFind, char chReplace); + int substitute(const char *sFind, const char *sReplace); + int remove(const char *sFind) { + return substitute(sFind, ""); + } +}; + + +/** + * Duplicate a C string. + * Allocate memory of the given size, or big enough to fit the string if length isn't given; + * then copy the given string in the allocated memory. + * @return the pointer to the new string + */ +inline char *StringDup( + const char *s, ///< The string to duplicate + SContainer::lenpos_t len=SContainer::measure_length) ///< The length of memory to allocate. Optional. +{ + return SContainer::StringAllocate(s, len); +} + +#endif diff --git a/include/SciLexer.h b/include/SciLexer.h new file mode 100755 index 0000000..22d016d --- /dev/null +++ b/include/SciLexer.h @@ -0,0 +1,1074 @@ +// Scintilla source code edit control +/** @file SciLexer.h + ** Interface to the added lexer functions in the SciLexer version of the edit control. + **/ +// Copyright 1998-2002 by Neil Hodgson +// The License.txt file describes the conditions under which this software may be distributed. + +// Most of this file is automatically generated from the Scintilla.iface interface definition +// file which contains any comments about the definitions. HFacer.py does the generation. + +#ifndef SCILEXER_H +#define SCILEXER_H + +// SciLexer features - not in standard Scintilla + +//++Autogenerated -- start of section automatically generated from Scintilla.iface +#define SCLEX_CONTAINER 0 +#define SCLEX_NULL 1 +#define SCLEX_PYTHON 2 +#define SCLEX_CPP 3 +#define SCLEX_HTML 4 +#define SCLEX_XML 5 +#define SCLEX_PERL 6 +#define SCLEX_SQL 7 +#define SCLEX_VB 8 +#define SCLEX_PROPERTIES 9 +#define SCLEX_ERRORLIST 10 +#define SCLEX_MAKEFILE 11 +#define SCLEX_BATCH 12 +#define SCLEX_XCODE 13 +#define SCLEX_LATEX 14 +#define SCLEX_LUA 15 +#define SCLEX_DIFF 16 +#define SCLEX_CONF 17 +#define SCLEX_PASCAL 18 +#define SCLEX_AVE 19 +#define SCLEX_ADA 20 +#define SCLEX_LISP 21 +#define SCLEX_RUBY 22 +#define SCLEX_EIFFEL 23 +#define SCLEX_EIFFELKW 24 +#define SCLEX_TCL 25 +#define SCLEX_NNCRONTAB 26 +#define SCLEX_BULLANT 27 +#define SCLEX_VBSCRIPT 28 +#define SCLEX_BAAN 31 +#define SCLEX_MATLAB 32 +#define SCLEX_SCRIPTOL 33 +#define SCLEX_ASM 34 +#define SCLEX_CPPNOCASE 35 +#define SCLEX_FORTRAN 36 +#define SCLEX_F77 37 +#define SCLEX_CSS 38 +#define SCLEX_POV 39 +#define SCLEX_LOUT 40 +#define SCLEX_ESCRIPT 41 +#define SCLEX_PS 42 +#define SCLEX_NSIS 43 +#define SCLEX_MMIXAL 44 +#define SCLEX_CLW 45 +#define SCLEX_CLWNOCASE 46 +#define SCLEX_LOT 47 +#define SCLEX_YAML 48 +#define SCLEX_TEX 49 +#define SCLEX_METAPOST 50 +#define SCLEX_POWERBASIC 51 +#define SCLEX_FORTH 52 +#define SCLEX_ERLANG 53 +#define SCLEX_OCTAVE 54 +#define SCLEX_MSSQL 55 +#define SCLEX_VERILOG 56 +#define SCLEX_KIX 57 +#define SCLEX_GUI4CLI 58 +#define SCLEX_SPECMAN 59 +#define SCLEX_AU3 60 +#define SCLEX_APDL 61 +#define SCLEX_BASH 62 +#define SCLEX_ASN1 63 +#define SCLEX_VHDL 64 +#define SCLEX_CAML 65 +#define SCLEX_BLITZBASIC 66 +#define SCLEX_PUREBASIC 67 +#define SCLEX_HASKELL 68 +#define SCLEX_PHPSCRIPT 69 +#define SCLEX_TADS3 70 +#define SCLEX_REBOL 71 +#define SCLEX_SMALLTALK 72 +#define SCLEX_FLAGSHIP 73 +#define SCLEX_CSOUND 74 +#define SCLEX_FREEBASIC 75 +#define SCLEX_INNOSETUP 76 +#define SCLEX_OPAL 77 +#define SCLEX_SPICE 78 +#define SCLEX_AUTOMATIC 1000 +#define SCE_P_DEFAULT 0 +#define SCE_P_COMMENTLINE 1 +#define SCE_P_NUMBER 2 +#define SCE_P_STRING 3 +#define SCE_P_CHARACTER 4 +#define SCE_P_WORD 5 +#define SCE_P_TRIPLE 6 +#define SCE_P_TRIPLEDOUBLE 7 +#define SCE_P_CLASSNAME 8 +#define SCE_P_DEFNAME 9 +#define SCE_P_OPERATOR 10 +#define SCE_P_IDENTIFIER 11 +#define SCE_P_COMMENTBLOCK 12 +#define SCE_P_STRINGEOL 13 +#define SCE_P_WORD2 14 +#define SCE_P_DECORATOR 15 +#define SCE_C_DEFAULT 0 +#define SCE_C_COMMENT 1 +#define SCE_C_COMMENTLINE 2 +#define SCE_C_COMMENTDOC 3 +#define SCE_C_NUMBER 4 +#define SCE_C_WORD 5 +#define SCE_C_STRING 6 +#define SCE_C_CHARACTER 7 +#define SCE_C_UUID 8 +#define SCE_C_PREPROCESSOR 9 +#define SCE_C_OPERATOR 10 +#define SCE_C_IDENTIFIER 11 +#define SCE_C_STRINGEOL 12 +#define SCE_C_VERBATIM 13 +#define SCE_C_REGEX 14 +#define SCE_C_COMMENTLINEDOC 15 +#define SCE_C_WORD2 16 +#define SCE_C_COMMENTDOCKEYWORD 17 +#define SCE_C_COMMENTDOCKEYWORDERROR 18 +#define SCE_C_GLOBALCLASS 19 +#define SCE_TCL_DEFAULT 0 +#define SCE_TCL_COMMENT 1 +#define SCE_TCL_COMMENTLINE 2 +#define SCE_TCL_NUMBER 3 +#define SCE_TCL_WORD_IN_QUOTE 4 +#define SCE_TCL_IN_QUOTE 5 +#define SCE_TCL_OPERATOR 6 +#define SCE_TCL_IDENTIFIER 7 +#define SCE_TCL_SUBSTITUTION 8 +#define SCE_TCL_SUB_BRACE 9 +#define SCE_TCL_MODIFIER 10 +#define SCE_TCL_EXPAND 11 +#define SCE_TCL_WORD 12 +#define SCE_TCL_WORD2 13 +#define SCE_TCL_WORD3 14 +#define SCE_TCL_WORD4 15 +#define SCE_TCL_WORD5 16 +#define SCE_TCL_WORD6 17 +#define SCE_TCL_WORD7 18 +#define SCE_TCL_WORD8 19 +#define SCE_TCL_COMMENT_BOX 20 +#define SCE_TCL_BLOCK_COMMENT 21 +#define SCE_H_DEFAULT 0 +#define SCE_H_TAG 1 +#define SCE_H_TAGUNKNOWN 2 +#define SCE_H_ATTRIBUTE 3 +#define SCE_H_ATTRIBUTEUNKNOWN 4 +#define SCE_H_NUMBER 5 +#define SCE_H_DOUBLESTRING 6 +#define SCE_H_SINGLESTRING 7 +#define SCE_H_OTHER 8 +#define SCE_H_COMMENT 9 +#define SCE_H_ENTITY 10 +#define SCE_H_TAGEND 11 +#define SCE_H_XMLSTART 12 +#define SCE_H_XMLEND 13 +#define SCE_H_SCRIPT 14 +#define SCE_H_ASP 15 +#define SCE_H_ASPAT 16 +#define SCE_H_CDATA 17 +#define SCE_H_QUESTION 18 +#define SCE_H_VALUE 19 +#define SCE_H_XCCOMMENT 20 +#define SCE_H_SGML_DEFAULT 21 +#define SCE_H_SGML_COMMAND 22 +#define SCE_H_SGML_1ST_PARAM 23 +#define SCE_H_SGML_DOUBLESTRING 24 +#define SCE_H_SGML_SIMPLESTRING 25 +#define SCE_H_SGML_ERROR 26 +#define SCE_H_SGML_SPECIAL 27 +#define SCE_H_SGML_ENTITY 28 +#define SCE_H_SGML_COMMENT 29 +#define SCE_H_SGML_1ST_PARAM_COMMENT 30 +#define SCE_H_SGML_BLOCK_DEFAULT 31 +#define SCE_HJ_START 40 +#define SCE_HJ_DEFAULT 41 +#define SCE_HJ_COMMENT 42 +#define SCE_HJ_COMMENTLINE 43 +#define SCE_HJ_COMMENTDOC 44 +#define SCE_HJ_NUMBER 45 +#define SCE_HJ_WORD 46 +#define SCE_HJ_KEYWORD 47 +#define SCE_HJ_DOUBLESTRING 48 +#define SCE_HJ_SINGLESTRING 49 +#define SCE_HJ_SYMBOLS 50 +#define SCE_HJ_STRINGEOL 51 +#define SCE_HJ_REGEX 52 +#define SCE_HJA_START 55 +#define SCE_HJA_DEFAULT 56 +#define SCE_HJA_COMMENT 57 +#define SCE_HJA_COMMENTLINE 58 +#define SCE_HJA_COMMENTDOC 59 +#define SCE_HJA_NUMBER 60 +#define SCE_HJA_WORD 61 +#define SCE_HJA_KEYWORD 62 +#define SCE_HJA_DOUBLESTRING 63 +#define SCE_HJA_SINGLESTRING 64 +#define SCE_HJA_SYMBOLS 65 +#define SCE_HJA_STRINGEOL 66 +#define SCE_HJA_REGEX 67 +#define SCE_HB_START 70 +#define SCE_HB_DEFAULT 71 +#define SCE_HB_COMMENTLINE 72 +#define SCE_HB_NUMBER 73 +#define SCE_HB_WORD 74 +#define SCE_HB_STRING 75 +#define SCE_HB_IDENTIFIER 76 +#define SCE_HB_STRINGEOL 77 +#define SCE_HBA_START 80 +#define SCE_HBA_DEFAULT 81 +#define SCE_HBA_COMMENTLINE 82 +#define SCE_HBA_NUMBER 83 +#define SCE_HBA_WORD 84 +#define SCE_HBA_STRING 85 +#define SCE_HBA_IDENTIFIER 86 +#define SCE_HBA_STRINGEOL 87 +#define SCE_HP_START 90 +#define SCE_HP_DEFAULT 91 +#define SCE_HP_COMMENTLINE 92 +#define SCE_HP_NUMBER 93 +#define SCE_HP_STRING 94 +#define SCE_HP_CHARACTER 95 +#define SCE_HP_WORD 96 +#define SCE_HP_TRIPLE 97 +#define SCE_HP_TRIPLEDOUBLE 98 +#define SCE_HP_CLASSNAME 99 +#define SCE_HP_DEFNAME 100 +#define SCE_HP_OPERATOR 101 +#define SCE_HP_IDENTIFIER 102 +#define SCE_HPHP_COMPLEX_VARIABLE 104 +#define SCE_HPA_START 105 +#define SCE_HPA_DEFAULT 106 +#define SCE_HPA_COMMENTLINE 107 +#define SCE_HPA_NUMBER 108 +#define SCE_HPA_STRING 109 +#define SCE_HPA_CHARACTER 110 +#define SCE_HPA_WORD 111 +#define SCE_HPA_TRIPLE 112 +#define SCE_HPA_TRIPLEDOUBLE 113 +#define SCE_HPA_CLASSNAME 114 +#define SCE_HPA_DEFNAME 115 +#define SCE_HPA_OPERATOR 116 +#define SCE_HPA_IDENTIFIER 117 +#define SCE_HPHP_DEFAULT 118 +#define SCE_HPHP_HSTRING 119 +#define SCE_HPHP_SIMPLESTRING 120 +#define SCE_HPHP_WORD 121 +#define SCE_HPHP_NUMBER 122 +#define SCE_HPHP_VARIABLE 123 +#define SCE_HPHP_COMMENT 124 +#define SCE_HPHP_COMMENTLINE 125 +#define SCE_HPHP_HSTRING_VARIABLE 126 +#define SCE_HPHP_OPERATOR 127 +#define SCE_PL_DEFAULT 0 +#define SCE_PL_ERROR 1 +#define SCE_PL_COMMENTLINE 2 +#define SCE_PL_POD 3 +#define SCE_PL_NUMBER 4 +#define SCE_PL_WORD 5 +#define SCE_PL_STRING 6 +#define SCE_PL_CHARACTER 7 +#define SCE_PL_PUNCTUATION 8 +#define SCE_PL_PREPROCESSOR 9 +#define SCE_PL_OPERATOR 10 +#define SCE_PL_IDENTIFIER 11 +#define SCE_PL_SCALAR 12 +#define SCE_PL_ARRAY 13 +#define SCE_PL_HASH 14 +#define SCE_PL_SYMBOLTABLE 15 +#define SCE_PL_VARIABLE_INDEXER 16 +#define SCE_PL_REGEX 17 +#define SCE_PL_REGSUBST 18 +#define SCE_PL_LONGQUOTE 19 +#define SCE_PL_BACKTICKS 20 +#define SCE_PL_DATASECTION 21 +#define SCE_PL_HERE_DELIM 22 +#define SCE_PL_HERE_Q 23 +#define SCE_PL_HERE_QQ 24 +#define SCE_PL_HERE_QX 25 +#define SCE_PL_STRING_Q 26 +#define SCE_PL_STRING_QQ 27 +#define SCE_PL_STRING_QX 28 +#define SCE_PL_STRING_QR 29 +#define SCE_PL_STRING_QW 30 +#define SCE_PL_POD_VERB 31 +#define SCE_RB_DEFAULT 0 +#define SCE_RB_ERROR 1 +#define SCE_RB_COMMENTLINE 2 +#define SCE_RB_POD 3 +#define SCE_RB_NUMBER 4 +#define SCE_RB_WORD 5 +#define SCE_RB_STRING 6 +#define SCE_RB_CHARACTER 7 +#define SCE_RB_CLASSNAME 8 +#define SCE_RB_DEFNAME 9 +#define SCE_RB_OPERATOR 10 +#define SCE_RB_IDENTIFIER 11 +#define SCE_RB_REGEX 12 +#define SCE_RB_GLOBAL 13 +#define SCE_RB_SYMBOL 14 +#define SCE_RB_MODULE_NAME 15 +#define SCE_RB_INSTANCE_VAR 16 +#define SCE_RB_CLASS_VAR 17 +#define SCE_RB_BACKTICKS 18 +#define SCE_RB_DATASECTION 19 +#define SCE_RB_HERE_DELIM 20 +#define SCE_RB_HERE_Q 21 +#define SCE_RB_HERE_QQ 22 +#define SCE_RB_HERE_QX 23 +#define SCE_RB_STRING_Q 24 +#define SCE_RB_STRING_QQ 25 +#define SCE_RB_STRING_QX 26 +#define SCE_RB_STRING_QR 27 +#define SCE_RB_STRING_QW 28 +#define SCE_RB_WORD_DEMOTED 29 +#define SCE_RB_STDIN 30 +#define SCE_RB_STDOUT 31 +#define SCE_RB_STDERR 40 +#define SCE_RB_UPPER_BOUND 41 +#define SCE_B_DEFAULT 0 +#define SCE_B_COMMENT 1 +#define SCE_B_NUMBER 2 +#define SCE_B_KEYWORD 3 +#define SCE_B_STRING 4 +#define SCE_B_PREPROCESSOR 5 +#define SCE_B_OPERATOR 6 +#define SCE_B_IDENTIFIER 7 +#define SCE_B_DATE 8 +#define SCE_B_STRINGEOL 9 +#define SCE_B_KEYWORD2 10 +#define SCE_B_KEYWORD3 11 +#define SCE_B_KEYWORD4 12 +#define SCE_B_CONSTANT 13 +#define SCE_B_ASM 14 +#define SCE_B_LABEL 15 +#define SCE_B_ERROR 16 +#define SCE_B_HEXNUMBER 17 +#define SCE_B_BINNUMBER 18 +#define SCE_PROPS_DEFAULT 0 +#define SCE_PROPS_COMMENT 1 +#define SCE_PROPS_SECTION 2 +#define SCE_PROPS_ASSIGNMENT 3 +#define SCE_PROPS_DEFVAL 4 +#define SCE_PROPS_KEY 5 +#define SCE_L_DEFAULT 0 +#define SCE_L_COMMAND 1 +#define SCE_L_TAG 2 +#define SCE_L_MATH 3 +#define SCE_L_COMMENT 4 +#define SCE_LUA_DEFAULT 0 +#define SCE_LUA_COMMENT 1 +#define SCE_LUA_COMMENTLINE 2 +#define SCE_LUA_COMMENTDOC 3 +#define SCE_LUA_NUMBER 4 +#define SCE_LUA_WORD 5 +#define SCE_LUA_STRING 6 +#define SCE_LUA_CHARACTER 7 +#define SCE_LUA_LITERALSTRING 8 +#define SCE_LUA_PREPROCESSOR 9 +#define SCE_LUA_OPERATOR 10 +#define SCE_LUA_IDENTIFIER 11 +#define SCE_LUA_STRINGEOL 12 +#define SCE_LUA_WORD2 13 +#define SCE_LUA_WORD3 14 +#define SCE_LUA_WORD4 15 +#define SCE_LUA_WORD5 16 +#define SCE_LUA_WORD6 17 +#define SCE_LUA_WORD7 18 +#define SCE_LUA_WORD8 19 +#define SCE_ERR_DEFAULT 0 +#define SCE_ERR_PYTHON 1 +#define SCE_ERR_GCC 2 +#define SCE_ERR_MS 3 +#define SCE_ERR_CMD 4 +#define SCE_ERR_BORLAND 5 +#define SCE_ERR_PERL 6 +#define SCE_ERR_NET 7 +#define SCE_ERR_LUA 8 +#define SCE_ERR_CTAG 9 +#define SCE_ERR_DIFF_CHANGED 10 +#define SCE_ERR_DIFF_ADDITION 11 +#define SCE_ERR_DIFF_DELETION 12 +#define SCE_ERR_DIFF_MESSAGE 13 +#define SCE_ERR_PHP 14 +#define SCE_ERR_ELF 15 +#define SCE_ERR_IFC 16 +#define SCE_ERR_IFORT 17 +#define SCE_ERR_ABSF 18 +#define SCE_ERR_TIDY 19 +#define SCE_ERR_JAVA_STACK 20 +#define SCE_BAT_DEFAULT 0 +#define SCE_BAT_COMMENT 1 +#define SCE_BAT_WORD 2 +#define SCE_BAT_LABEL 3 +#define SCE_BAT_HIDE 4 +#define SCE_BAT_COMMAND 5 +#define SCE_BAT_IDENTIFIER 6 +#define SCE_BAT_OPERATOR 7 +#define SCE_MAKE_DEFAULT 0 +#define SCE_MAKE_COMMENT 1 +#define SCE_MAKE_PREPROCESSOR 2 +#define SCE_MAKE_IDENTIFIER 3 +#define SCE_MAKE_OPERATOR 4 +#define SCE_MAKE_TARGET 5 +#define SCE_MAKE_IDEOL 9 +#define SCE_DIFF_DEFAULT 0 +#define SCE_DIFF_COMMENT 1 +#define SCE_DIFF_COMMAND 2 +#define SCE_DIFF_HEADER 3 +#define SCE_DIFF_POSITION 4 +#define SCE_DIFF_DELETED 5 +#define SCE_DIFF_ADDED 6 +#define SCE_CONF_DEFAULT 0 +#define SCE_CONF_COMMENT 1 +#define SCE_CONF_NUMBER 2 +#define SCE_CONF_IDENTIFIER 3 +#define SCE_CONF_EXTENSION 4 +#define SCE_CONF_PARAMETER 5 +#define SCE_CONF_STRING 6 +#define SCE_CONF_OPERATOR 7 +#define SCE_CONF_IP 8 +#define SCE_CONF_DIRECTIVE 9 +#define SCE_AVE_DEFAULT 0 +#define SCE_AVE_COMMENT 1 +#define SCE_AVE_NUMBER 2 +#define SCE_AVE_WORD 3 +#define SCE_AVE_STRING 6 +#define SCE_AVE_ENUM 7 +#define SCE_AVE_STRINGEOL 8 +#define SCE_AVE_IDENTIFIER 9 +#define SCE_AVE_OPERATOR 10 +#define SCE_AVE_WORD1 11 +#define SCE_AVE_WORD2 12 +#define SCE_AVE_WORD3 13 +#define SCE_AVE_WORD4 14 +#define SCE_AVE_WORD5 15 +#define SCE_AVE_WORD6 16 +#define SCE_ADA_DEFAULT 0 +#define SCE_ADA_WORD 1 +#define SCE_ADA_IDENTIFIER 2 +#define SCE_ADA_NUMBER 3 +#define SCE_ADA_DELIMITER 4 +#define SCE_ADA_CHARACTER 5 +#define SCE_ADA_CHARACTEREOL 6 +#define SCE_ADA_STRING 7 +#define SCE_ADA_STRINGEOL 8 +#define SCE_ADA_LABEL 9 +#define SCE_ADA_COMMENTLINE 10 +#define SCE_ADA_ILLEGAL 11 +#define SCE_BAAN_DEFAULT 0 +#define SCE_BAAN_COMMENT 1 +#define SCE_BAAN_COMMENTDOC 2 +#define SCE_BAAN_NUMBER 3 +#define SCE_BAAN_WORD 4 +#define SCE_BAAN_STRING 5 +#define SCE_BAAN_PREPROCESSOR 6 +#define SCE_BAAN_OPERATOR 7 +#define SCE_BAAN_IDENTIFIER 8 +#define SCE_BAAN_STRINGEOL 9 +#define SCE_BAAN_WORD2 10 +#define SCE_LISP_DEFAULT 0 +#define SCE_LISP_COMMENT 1 +#define SCE_LISP_NUMBER 2 +#define SCE_LISP_KEYWORD 3 +#define SCE_LISP_KEYWORD_KW 4 +#define SCE_LISP_SYMBOL 5 +#define SCE_LISP_STRING 6 +#define SCE_LISP_STRINGEOL 8 +#define SCE_LISP_IDENTIFIER 9 +#define SCE_LISP_OPERATOR 10 +#define SCE_LISP_SPECIAL 11 +#define SCE_LISP_MULTI_COMMENT 12 +#define SCE_EIFFEL_DEFAULT 0 +#define SCE_EIFFEL_COMMENTLINE 1 +#define SCE_EIFFEL_NUMBER 2 +#define SCE_EIFFEL_WORD 3 +#define SCE_EIFFEL_STRING 4 +#define SCE_EIFFEL_CHARACTER 5 +#define SCE_EIFFEL_OPERATOR 6 +#define SCE_EIFFEL_IDENTIFIER 7 +#define SCE_EIFFEL_STRINGEOL 8 +#define SCE_NNCRONTAB_DEFAULT 0 +#define SCE_NNCRONTAB_COMMENT 1 +#define SCE_NNCRONTAB_TASK 2 +#define SCE_NNCRONTAB_SECTION 3 +#define SCE_NNCRONTAB_KEYWORD 4 +#define SCE_NNCRONTAB_MODIFIER 5 +#define SCE_NNCRONTAB_ASTERISK 6 +#define SCE_NNCRONTAB_NUMBER 7 +#define SCE_NNCRONTAB_STRING 8 +#define SCE_NNCRONTAB_ENVIRONMENT 9 +#define SCE_NNCRONTAB_IDENTIFIER 10 +#define SCE_FORTH_DEFAULT 0 +#define SCE_FORTH_COMMENT 1 +#define SCE_FORTH_COMMENT_ML 2 +#define SCE_FORTH_IDENTIFIER 3 +#define SCE_FORTH_CONTROL 4 +#define SCE_FORTH_KEYWORD 5 +#define SCE_FORTH_DEFWORD 6 +#define SCE_FORTH_PREWORD1 7 +#define SCE_FORTH_PREWORD2 8 +#define SCE_FORTH_NUMBER 9 +#define SCE_FORTH_STRING 10 +#define SCE_FORTH_LOCALE 11 +#define SCE_MATLAB_DEFAULT 0 +#define SCE_MATLAB_COMMENT 1 +#define SCE_MATLAB_COMMAND 2 +#define SCE_MATLAB_NUMBER 3 +#define SCE_MATLAB_KEYWORD 4 +#define SCE_MATLAB_STRING 5 +#define SCE_MATLAB_OPERATOR 6 +#define SCE_MATLAB_IDENTIFIER 7 +#define SCE_MATLAB_DOUBLEQUOTESTRING 8 +#define SCE_SCRIPTOL_DEFAULT 0 +#define SCE_SCRIPTOL_WHITE 1 +#define SCE_SCRIPTOL_COMMENTLINE 2 +#define SCE_SCRIPTOL_PERSISTENT 3 +#define SCE_SCRIPTOL_CSTYLE 4 +#define SCE_SCRIPTOL_COMMENTBLOCK 5 +#define SCE_SCRIPTOL_NUMBER 6 +#define SCE_SCRIPTOL_STRING 7 +#define SCE_SCRIPTOL_CHARACTER 8 +#define SCE_SCRIPTOL_STRINGEOL 9 +#define SCE_SCRIPTOL_KEYWORD 10 +#define SCE_SCRIPTOL_OPERATOR 11 +#define SCE_SCRIPTOL_IDENTIFIER 12 +#define SCE_SCRIPTOL_TRIPLE 13 +#define SCE_SCRIPTOL_CLASSNAME 14 +#define SCE_SCRIPTOL_PREPROCESSOR 15 +#define SCE_ASM_DEFAULT 0 +#define SCE_ASM_COMMENT 1 +#define SCE_ASM_NUMBER 2 +#define SCE_ASM_STRING 3 +#define SCE_ASM_OPERATOR 4 +#define SCE_ASM_IDENTIFIER 5 +#define SCE_ASM_CPUINSTRUCTION 6 +#define SCE_ASM_MATHINSTRUCTION 7 +#define SCE_ASM_REGISTER 8 +#define SCE_ASM_DIRECTIVE 9 +#define SCE_ASM_DIRECTIVEOPERAND 10 +#define SCE_ASM_COMMENTBLOCK 11 +#define SCE_ASM_CHARACTER 12 +#define SCE_ASM_STRINGEOL 13 +#define SCE_ASM_EXTINSTRUCTION 14 +#define SCE_F_DEFAULT 0 +#define SCE_F_COMMENT 1 +#define SCE_F_NUMBER 2 +#define SCE_F_STRING1 3 +#define SCE_F_STRING2 4 +#define SCE_F_STRINGEOL 5 +#define SCE_F_OPERATOR 6 +#define SCE_F_IDENTIFIER 7 +#define SCE_F_WORD 8 +#define SCE_F_WORD2 9 +#define SCE_F_WORD3 10 +#define SCE_F_PREPROCESSOR 11 +#define SCE_F_OPERATOR2 12 +#define SCE_F_LABEL 13 +#define SCE_F_CONTINUATION 14 +#define SCE_CSS_DEFAULT 0 +#define SCE_CSS_TAG 1 +#define SCE_CSS_CLASS 2 +#define SCE_CSS_PSEUDOCLASS 3 +#define SCE_CSS_UNKNOWN_PSEUDOCLASS 4 +#define SCE_CSS_OPERATOR 5 +#define SCE_CSS_IDENTIFIER 6 +#define SCE_CSS_UNKNOWN_IDENTIFIER 7 +#define SCE_CSS_VALUE 8 +#define SCE_CSS_COMMENT 9 +#define SCE_CSS_ID 10 +#define SCE_CSS_IMPORTANT 11 +#define SCE_CSS_DIRECTIVE 12 +#define SCE_CSS_DOUBLESTRING 13 +#define SCE_CSS_SINGLESTRING 14 +#define SCE_CSS_IDENTIFIER2 15 +#define SCE_CSS_ATTRIBUTE 16 +#define SCE_POV_DEFAULT 0 +#define SCE_POV_COMMENT 1 +#define SCE_POV_COMMENTLINE 2 +#define SCE_POV_NUMBER 3 +#define SCE_POV_OPERATOR 4 +#define SCE_POV_IDENTIFIER 5 +#define SCE_POV_STRING 6 +#define SCE_POV_STRINGEOL 7 +#define SCE_POV_DIRECTIVE 8 +#define SCE_POV_BADDIRECTIVE 9 +#define SCE_POV_WORD2 10 +#define SCE_POV_WORD3 11 +#define SCE_POV_WORD4 12 +#define SCE_POV_WORD5 13 +#define SCE_POV_WORD6 14 +#define SCE_POV_WORD7 15 +#define SCE_POV_WORD8 16 +#define SCE_LOUT_DEFAULT 0 +#define SCE_LOUT_COMMENT 1 +#define SCE_LOUT_NUMBER 2 +#define SCE_LOUT_WORD 3 +#define SCE_LOUT_WORD2 4 +#define SCE_LOUT_WORD3 5 +#define SCE_LOUT_WORD4 6 +#define SCE_LOUT_STRING 7 +#define SCE_LOUT_OPERATOR 8 +#define SCE_LOUT_IDENTIFIER 9 +#define SCE_LOUT_STRINGEOL 10 +#define SCE_ESCRIPT_DEFAULT 0 +#define SCE_ESCRIPT_COMMENT 1 +#define SCE_ESCRIPT_COMMENTLINE 2 +#define SCE_ESCRIPT_COMMENTDOC 3 +#define SCE_ESCRIPT_NUMBER 4 +#define SCE_ESCRIPT_WORD 5 +#define SCE_ESCRIPT_STRING 6 +#define SCE_ESCRIPT_OPERATOR 7 +#define SCE_ESCRIPT_IDENTIFIER 8 +#define SCE_ESCRIPT_BRACE 9 +#define SCE_ESCRIPT_WORD2 10 +#define SCE_ESCRIPT_WORD3 11 +#define SCE_PS_DEFAULT 0 +#define SCE_PS_COMMENT 1 +#define SCE_PS_DSC_COMMENT 2 +#define SCE_PS_DSC_VALUE 3 +#define SCE_PS_NUMBER 4 +#define SCE_PS_NAME 5 +#define SCE_PS_KEYWORD 6 +#define SCE_PS_LITERAL 7 +#define SCE_PS_IMMEVAL 8 +#define SCE_PS_PAREN_ARRAY 9 +#define SCE_PS_PAREN_DICT 10 +#define SCE_PS_PAREN_PROC 11 +#define SCE_PS_TEXT 12 +#define SCE_PS_HEXSTRING 13 +#define SCE_PS_BASE85STRING 14 +#define SCE_PS_BADSTRINGCHAR 15 +#define SCE_NSIS_DEFAULT 0 +#define SCE_NSIS_COMMENT 1 +#define SCE_NSIS_STRINGDQ 2 +#define SCE_NSIS_STRINGLQ 3 +#define SCE_NSIS_STRINGRQ 4 +#define SCE_NSIS_FUNCTION 5 +#define SCE_NSIS_VARIABLE 6 +#define SCE_NSIS_LABEL 7 +#define SCE_NSIS_USERDEFINED 8 +#define SCE_NSIS_SECTIONDEF 9 +#define SCE_NSIS_SUBSECTIONDEF 10 +#define SCE_NSIS_IFDEFINEDEF 11 +#define SCE_NSIS_MACRODEF 12 +#define SCE_NSIS_STRINGVAR 13 +#define SCE_NSIS_NUMBER 14 +#define SCE_NSIS_SECTIONGROUP 15 +#define SCE_NSIS_PAGEEX 16 +#define SCE_NSIS_FUNCTIONDEF 17 +#define SCE_NSIS_COMMENTBOX 18 +#define SCE_MMIXAL_LEADWS 0 +#define SCE_MMIXAL_COMMENT 1 +#define SCE_MMIXAL_LABEL 2 +#define SCE_MMIXAL_OPCODE 3 +#define SCE_MMIXAL_OPCODE_PRE 4 +#define SCE_MMIXAL_OPCODE_VALID 5 +#define SCE_MMIXAL_OPCODE_UNKNOWN 6 +#define SCE_MMIXAL_OPCODE_POST 7 +#define SCE_MMIXAL_OPERANDS 8 +#define SCE_MMIXAL_NUMBER 9 +#define SCE_MMIXAL_REF 10 +#define SCE_MMIXAL_CHAR 11 +#define SCE_MMIXAL_STRING 12 +#define SCE_MMIXAL_REGISTER 13 +#define SCE_MMIXAL_HEX 14 +#define SCE_MMIXAL_OPERATOR 15 +#define SCE_MMIXAL_SYMBOL 16 +#define SCE_MMIXAL_INCLUDE 17 +#define SCE_CLW_DEFAULT 0 +#define SCE_CLW_LABEL 1 +#define SCE_CLW_COMMENT 2 +#define SCE_CLW_STRING 3 +#define SCE_CLW_USER_IDENTIFIER 4 +#define SCE_CLW_INTEGER_CONSTANT 5 +#define SCE_CLW_REAL_CONSTANT 6 +#define SCE_CLW_PICTURE_STRING 7 +#define SCE_CLW_KEYWORD 8 +#define SCE_CLW_COMPILER_DIRECTIVE 9 +#define SCE_CLW_RUNTIME_EXPRESSIONS 10 +#define SCE_CLW_BUILTIN_PROCEDURES_FUNCTION 11 +#define SCE_CLW_STRUCTURE_DATA_TYPE 12 +#define SCE_CLW_ATTRIBUTE 13 +#define SCE_CLW_STANDARD_EQUATE 14 +#define SCE_CLW_ERROR 15 +#define SCE_CLW_DEPRECATED 16 +#define SCE_LOT_DEFAULT 0 +#define SCE_LOT_HEADER 1 +#define SCE_LOT_BREAK 2 +#define SCE_LOT_SET 3 +#define SCE_LOT_PASS 4 +#define SCE_LOT_FAIL 5 +#define SCE_LOT_ABORT 6 +#define SCE_YAML_DEFAULT 0 +#define SCE_YAML_COMMENT 1 +#define SCE_YAML_IDENTIFIER 2 +#define SCE_YAML_KEYWORD 3 +#define SCE_YAML_NUMBER 4 +#define SCE_YAML_REFERENCE 5 +#define SCE_YAML_DOCUMENT 6 +#define SCE_YAML_TEXT 7 +#define SCE_YAML_ERROR 8 +#define SCE_TEX_DEFAULT 0 +#define SCE_TEX_SPECIAL 1 +#define SCE_TEX_GROUP 2 +#define SCE_TEX_SYMBOL 3 +#define SCE_TEX_COMMAND 4 +#define SCE_TEX_TEXT 5 +#define SCE_METAPOST_DEFAULT 0 +#define SCE_METAPOST_SPECIAL 1 +#define SCE_METAPOST_GROUP 2 +#define SCE_METAPOST_SYMBOL 3 +#define SCE_METAPOST_COMMAND 4 +#define SCE_METAPOST_TEXT 5 +#define SCE_METAPOST_EXTRA 6 +#define SCE_ERLANG_DEFAULT 0 +#define SCE_ERLANG_COMMENT 1 +#define SCE_ERLANG_VARIABLE 2 +#define SCE_ERLANG_NUMBER 3 +#define SCE_ERLANG_KEYWORD 4 +#define SCE_ERLANG_STRING 5 +#define SCE_ERLANG_OPERATOR 6 +#define SCE_ERLANG_ATOM 7 +#define SCE_ERLANG_FUNCTION_NAME 8 +#define SCE_ERLANG_CHARACTER 9 +#define SCE_ERLANG_MACRO 10 +#define SCE_ERLANG_RECORD 11 +#define SCE_ERLANG_SEPARATOR 12 +#define SCE_ERLANG_NODE_NAME 13 +#define SCE_ERLANG_UNKNOWN 31 +#define SCE_MSSQL_DEFAULT 0 +#define SCE_MSSQL_COMMENT 1 +#define SCE_MSSQL_LINE_COMMENT 2 +#define SCE_MSSQL_NUMBER 3 +#define SCE_MSSQL_STRING 4 +#define SCE_MSSQL_OPERATOR 5 +#define SCE_MSSQL_IDENTIFIER 6 +#define SCE_MSSQL_VARIABLE 7 +#define SCE_MSSQL_COLUMN_NAME 8 +#define SCE_MSSQL_STATEMENT 9 +#define SCE_MSSQL_DATATYPE 10 +#define SCE_MSSQL_SYSTABLE 11 +#define SCE_MSSQL_GLOBAL_VARIABLE 12 +#define SCE_MSSQL_FUNCTION 13 +#define SCE_MSSQL_STORED_PROCEDURE 14 +#define SCE_MSSQL_DEFAULT_PREF_DATATYPE 15 +#define SCE_MSSQL_COLUMN_NAME_2 16 +#define SCE_V_DEFAULT 0 +#define SCE_V_COMMENT 1 +#define SCE_V_COMMENTLINE 2 +#define SCE_V_COMMENTLINEBANG 3 +#define SCE_V_NUMBER 4 +#define SCE_V_WORD 5 +#define SCE_V_STRING 6 +#define SCE_V_WORD2 7 +#define SCE_V_WORD3 8 +#define SCE_V_PREPROCESSOR 9 +#define SCE_V_OPERATOR 10 +#define SCE_V_IDENTIFIER 11 +#define SCE_V_STRINGEOL 12 +#define SCE_V_USER 19 +#define SCE_KIX_DEFAULT 0 +#define SCE_KIX_COMMENT 1 +#define SCE_KIX_STRING1 2 +#define SCE_KIX_STRING2 3 +#define SCE_KIX_NUMBER 4 +#define SCE_KIX_VAR 5 +#define SCE_KIX_MACRO 6 +#define SCE_KIX_KEYWORD 7 +#define SCE_KIX_FUNCTIONS 8 +#define SCE_KIX_OPERATOR 9 +#define SCE_KIX_IDENTIFIER 31 +#define SCE_GC_DEFAULT 0 +#define SCE_GC_COMMENTLINE 1 +#define SCE_GC_COMMENTBLOCK 2 +#define SCE_GC_GLOBAL 3 +#define SCE_GC_EVENT 4 +#define SCE_GC_ATTRIBUTE 5 +#define SCE_GC_CONTROL 6 +#define SCE_GC_COMMAND 7 +#define SCE_GC_STRING 8 +#define SCE_GC_OPERATOR 9 +#define SCE_SN_DEFAULT 0 +#define SCE_SN_CODE 1 +#define SCE_SN_COMMENTLINE 2 +#define SCE_SN_COMMENTLINEBANG 3 +#define SCE_SN_NUMBER 4 +#define SCE_SN_WORD 5 +#define SCE_SN_STRING 6 +#define SCE_SN_WORD2 7 +#define SCE_SN_WORD3 8 +#define SCE_SN_PREPROCESSOR 9 +#define SCE_SN_OPERATOR 10 +#define SCE_SN_IDENTIFIER 11 +#define SCE_SN_STRINGEOL 12 +#define SCE_SN_REGEXTAG 13 +#define SCE_SN_SIGNAL 14 +#define SCE_SN_USER 19 +#define SCE_AU3_DEFAULT 0 +#define SCE_AU3_COMMENT 1 +#define SCE_AU3_COMMENTBLOCK 2 +#define SCE_AU3_NUMBER 3 +#define SCE_AU3_FUNCTION 4 +#define SCE_AU3_KEYWORD 5 +#define SCE_AU3_MACRO 6 +#define SCE_AU3_STRING 7 +#define SCE_AU3_OPERATOR 8 +#define SCE_AU3_VARIABLE 9 +#define SCE_AU3_SENT 10 +#define SCE_AU3_PREPROCESSOR 11 +#define SCE_AU3_SPECIAL 12 +#define SCE_AU3_EXPAND 13 +#define SCE_AU3_COMOBJ 14 +#define SCE_AU3_UDF 15 +#define SCE_APDL_DEFAULT 0 +#define SCE_APDL_COMMENT 1 +#define SCE_APDL_COMMENTBLOCK 2 +#define SCE_APDL_NUMBER 3 +#define SCE_APDL_STRING 4 +#define SCE_APDL_OPERATOR 5 +#define SCE_APDL_WORD 6 +#define SCE_APDL_PROCESSOR 7 +#define SCE_APDL_COMMAND 8 +#define SCE_APDL_SLASHCOMMAND 9 +#define SCE_APDL_STARCOMMAND 10 +#define SCE_APDL_ARGUMENT 11 +#define SCE_APDL_FUNCTION 12 +#define SCE_SH_DEFAULT 0 +#define SCE_SH_ERROR 1 +#define SCE_SH_COMMENTLINE 2 +#define SCE_SH_NUMBER 3 +#define SCE_SH_WORD 4 +#define SCE_SH_STRING 5 +#define SCE_SH_CHARACTER 6 +#define SCE_SH_OPERATOR 7 +#define SCE_SH_IDENTIFIER 8 +#define SCE_SH_SCALAR 9 +#define SCE_SH_PARAM 10 +#define SCE_SH_BACKTICKS 11 +#define SCE_SH_HERE_DELIM 12 +#define SCE_SH_HERE_Q 13 +#define SCE_ASN1_DEFAULT 0 +#define SCE_ASN1_COMMENT 1 +#define SCE_ASN1_IDENTIFIER 2 +#define SCE_ASN1_STRING 3 +#define SCE_ASN1_OID 4 +#define SCE_ASN1_SCALAR 5 +#define SCE_ASN1_KEYWORD 6 +#define SCE_ASN1_ATTRIBUTE 7 +#define SCE_ASN1_DESCRIPTOR 8 +#define SCE_ASN1_TYPE 9 +#define SCE_ASN1_OPERATOR 10 +#define SCE_VHDL_DEFAULT 0 +#define SCE_VHDL_COMMENT 1 +#define SCE_VHDL_COMMENTLINEBANG 2 +#define SCE_VHDL_NUMBER 3 +#define SCE_VHDL_STRING 4 +#define SCE_VHDL_OPERATOR 5 +#define SCE_VHDL_IDENTIFIER 6 +#define SCE_VHDL_STRINGEOL 7 +#define SCE_VHDL_KEYWORD 8 +#define SCE_VHDL_STDOPERATOR 9 +#define SCE_VHDL_ATTRIBUTE 10 +#define SCE_VHDL_STDFUNCTION 11 +#define SCE_VHDL_STDPACKAGE 12 +#define SCE_VHDL_STDTYPE 13 +#define SCE_VHDL_USERWORD 14 +#define SCE_CAML_DEFAULT 0 +#define SCE_CAML_IDENTIFIER 1 +#define SCE_CAML_TAGNAME 2 +#define SCE_CAML_KEYWORD 3 +#define SCE_CAML_KEYWORD2 4 +#define SCE_CAML_KEYWORD3 5 +#define SCE_CAML_LINENUM 6 +#define SCE_CAML_OPERATOR 7 +#define SCE_CAML_NUMBER 8 +#define SCE_CAML_CHAR 9 +#define SCE_CAML_STRING 11 +#define SCE_CAML_COMMENT 12 +#define SCE_CAML_COMMENT1 13 +#define SCE_CAML_COMMENT2 14 +#define SCE_CAML_COMMENT3 15 +#define SCE_HA_DEFAULT 0 +#define SCE_HA_IDENTIFIER 1 +#define SCE_HA_KEYWORD 2 +#define SCE_HA_NUMBER 3 +#define SCE_HA_STRING 4 +#define SCE_HA_CHARACTER 5 +#define SCE_HA_CLASS 6 +#define SCE_HA_MODULE 7 +#define SCE_HA_CAPITAL 8 +#define SCE_HA_DATA 9 +#define SCE_HA_IMPORT 10 +#define SCE_HA_OPERATOR 11 +#define SCE_HA_INSTANCE 12 +#define SCE_HA_COMMENTLINE 13 +#define SCE_HA_COMMENTBLOCK 14 +#define SCE_HA_COMMENTBLOCK2 15 +#define SCE_HA_COMMENTBLOCK3 16 +#define SCE_T3_DEFAULT 0 +#define SCE_T3_X_DEFAULT 1 +#define SCE_T3_PREPROCESSOR 2 +#define SCE_T3_BLOCK_COMMENT 3 +#define SCE_T3_LINE_COMMENT 4 +#define SCE_T3_OPERATOR 5 +#define SCE_T3_KEYWORD 6 +#define SCE_T3_NUMBER 7 +#define SCE_T3_IDENTIFIER 8 +#define SCE_T3_S_STRING 9 +#define SCE_T3_D_STRING 10 +#define SCE_T3_X_STRING 11 +#define SCE_T3_LIB_DIRECTIVE 12 +#define SCE_T3_MSG_PARAM 13 +#define SCE_T3_HTML_TAG 14 +#define SCE_T3_HTML_DEFAULT 15 +#define SCE_T3_HTML_STRING 16 +#define SCE_T3_USER1 17 +#define SCE_T3_USER2 18 +#define SCE_T3_USER3 19 +#define SCE_REBOL_DEFAULT 0 +#define SCE_REBOL_COMMENTLINE 1 +#define SCE_REBOL_COMMENTBLOCK 2 +#define SCE_REBOL_PREFACE 3 +#define SCE_REBOL_OPERATOR 4 +#define SCE_REBOL_CHARACTER 5 +#define SCE_REBOL_QUOTEDSTRING 6 +#define SCE_REBOL_BRACEDSTRING 7 +#define SCE_REBOL_NUMBER 8 +#define SCE_REBOL_PAIR 9 +#define SCE_REBOL_TUPLE 10 +#define SCE_REBOL_BINARY 11 +#define SCE_REBOL_MONEY 12 +#define SCE_REBOL_ISSUE 13 +#define SCE_REBOL_TAG 14 +#define SCE_REBOL_FILE 15 +#define SCE_REBOL_EMAIL 16 +#define SCE_REBOL_URL 17 +#define SCE_REBOL_DATE 18 +#define SCE_REBOL_TIME 19 +#define SCE_REBOL_IDENTIFIER 20 +#define SCE_REBOL_WORD 21 +#define SCE_REBOL_WORD2 22 +#define SCE_REBOL_WORD3 23 +#define SCE_REBOL_WORD4 24 +#define SCE_REBOL_WORD5 25 +#define SCE_REBOL_WORD6 26 +#define SCE_REBOL_WORD7 27 +#define SCE_REBOL_WORD8 28 +#define SCE_SQL_DEFAULT 0 +#define SCE_SQL_COMMENT 1 +#define SCE_SQL_COMMENTLINE 2 +#define SCE_SQL_COMMENTDOC 3 +#define SCE_SQL_NUMBER 4 +#define SCE_SQL_WORD 5 +#define SCE_SQL_STRING 6 +#define SCE_SQL_CHARACTER 7 +#define SCE_SQL_SQLPLUS 8 +#define SCE_SQL_SQLPLUS_PROMPT 9 +#define SCE_SQL_OPERATOR 10 +#define SCE_SQL_IDENTIFIER 11 +#define SCE_SQL_SQLPLUS_COMMENT 13 +#define SCE_SQL_COMMENTLINEDOC 15 +#define SCE_SQL_WORD2 16 +#define SCE_SQL_COMMENTDOCKEYWORD 17 +#define SCE_SQL_COMMENTDOCKEYWORDERROR 18 +#define SCE_SQL_USER1 19 +#define SCE_SQL_USER2 20 +#define SCE_SQL_USER3 21 +#define SCE_SQL_USER4 22 +#define SCE_SQL_QUOTEDIDENTIFIER 23 +#define SCE_ST_DEFAULT 0 +#define SCE_ST_STRING 1 +#define SCE_ST_NUMBER 2 +#define SCE_ST_COMMENT 3 +#define SCE_ST_SYMBOL 4 +#define SCE_ST_BINARY 5 +#define SCE_ST_BOOL 6 +#define SCE_ST_SELF 7 +#define SCE_ST_SUPER 8 +#define SCE_ST_NIL 9 +#define SCE_ST_GLOBAL 10 +#define SCE_ST_RETURN 11 +#define SCE_ST_SPECIAL 12 +#define SCE_ST_KWSEND 13 +#define SCE_ST_ASSIGN 14 +#define SCE_ST_CHARACTER 15 +#define SCE_ST_SPEC_SEL 16 +#define SCE_FS_DEFAULT 0 +#define SCE_FS_COMMENT 1 +#define SCE_FS_COMMENTLINE 2 +#define SCE_FS_COMMENTDOC 3 +#define SCE_FS_COMMENTLINEDOC 4 +#define SCE_FS_COMMENTDOCKEYWORD 5 +#define SCE_FS_COMMENTDOCKEYWORDERROR 6 +#define SCE_FS_KEYWORD 7 +#define SCE_FS_KEYWORD2 8 +#define SCE_FS_KEYWORD3 9 +#define SCE_FS_KEYWORD4 10 +#define SCE_FS_NUMBER 11 +#define SCE_FS_STRING 12 +#define SCE_FS_PREPROCESSOR 13 +#define SCE_FS_OPERATOR 14 +#define SCE_FS_IDENTIFIER 15 +#define SCE_FS_DATE 16 +#define SCE_FS_STRINGEOL 17 +#define SCE_FS_CONSTANT 18 +#define SCE_FS_ASM 19 +#define SCE_FS_LABEL 20 +#define SCE_FS_ERROR 21 +#define SCE_FS_HEXNUMBER 22 +#define SCE_FS_BINNUMBER 23 +#define SCE_CSOUND_DEFAULT 0 +#define SCE_CSOUND_COMMENT 1 +#define SCE_CSOUND_NUMBER 2 +#define SCE_CSOUND_OPERATOR 3 +#define SCE_CSOUND_INSTR 4 +#define SCE_CSOUND_IDENTIFIER 5 +#define SCE_CSOUND_OPCODE 6 +#define SCE_CSOUND_HEADERSTMT 7 +#define SCE_CSOUND_USERKEYWORD 8 +#define SCE_CSOUND_COMMENTBLOCK 9 +#define SCE_CSOUND_PARAM 10 +#define SCE_CSOUND_ARATE_VAR 11 +#define SCE_CSOUND_KRATE_VAR 12 +#define SCE_CSOUND_IRATE_VAR 13 +#define SCE_CSOUND_GLOBAL_VAR 14 +#define SCE_CSOUND_STRINGEOL 15 +#define SCE_INNO_DEFAULT 0 +#define SCE_INNO_COMMENT 1 +#define SCE_INNO_KEYWORD 2 +#define SCE_INNO_PARAMETER 3 +#define SCE_INNO_SECTION 4 +#define SCE_INNO_PREPROC 5 +#define SCE_INNO_PREPROC_INLINE 6 +#define SCE_INNO_COMMENT_PASCAL 7 +#define SCE_INNO_KEYWORD_PASCAL 8 +#define SCE_INNO_KEYWORD_USER 9 +#define SCE_INNO_STRING_DOUBLE 10 +#define SCE_INNO_STRING_SINGLE 11 +#define SCE_INNO_IDENTIFIER 12 +#define SCE_OPAL_SPACE 0 +#define SCE_OPAL_COMMENT_BLOCK 1 +#define SCE_OPAL_COMMENT_LINE 2 +#define SCE_OPAL_INTEGER 3 +#define SCE_OPAL_KEYWORD 4 +#define SCE_OPAL_SORT 5 +#define SCE_OPAL_STRING 6 +#define SCE_OPAL_PAR 7 +#define SCE_OPAL_BOOL_CONST 8 +#define SCE_OPAL_DEFAULT 32 +#define SCE_SPICE_DEFAULT 0 +#define SCE_SPICE_IDENTIFIER 1 +#define SCE_SPICE_KEYWORD 2 +#define SCE_SPICE_KEYWORD2 3 +#define SCE_SPICE_KEYWORD3 4 +#define SCE_SPICE_NUMBER 5 +#define SCE_SPICE_DELIMITER 6 +#define SCE_SPICE_VALUE 7 +#define SCE_SPICE_COMMENTLINE 8 +#define SCLEX_ASP 29 +#define SCLEX_PHP 30 +//--Autogenerated -- end of section automatically generated from Scintilla.iface + +#endif diff --git a/include/Scintilla.h b/include/Scintilla.h new file mode 100755 index 0000000..426c8d4 --- /dev/null +++ b/include/Scintilla.h @@ -0,0 +1,780 @@ +// Scintilla source code edit control +/** @file Scintilla.h + ** Interface to the edit control. + **/ +// Copyright 1998-2003 by Neil Hodgson +// The License.txt file describes the conditions under which this software may be distributed. + +// Most of this file is automatically generated from the Scintilla.iface interface definition +// file which contains any comments about the definitions. HFacer.py does the generation. + +#ifndef SCINTILLA_H +#define SCINTILLA_H + +#if LCCWIN +typedef BOOL bool; +#endif + +#if PLAT_WIN +// Return false on failure: +bool Scintilla_RegisterClasses(void *hInstance); +bool Scintilla_ReleaseResources(); +#endif +int Scintilla_LinkLexers(); + +// Here should be placed typedefs for uptr_t, an unsigned integer type large enough to +// hold a pointer and sptr_t, a signed integer large enough to hold a pointer. +// May need to be changed for 64 bit platforms. +#if _MSC_VER >= 1300 +#include +#endif +#ifdef MAXULONG_PTR +typedef ULONG_PTR uptr_t; +typedef LONG_PTR sptr_t; +#else +typedef unsigned long uptr_t; +typedef long sptr_t; +#endif + +typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, sptr_t lParam); + +//++Autogenerated -- start of section automatically generated from Scintilla.iface +#define INVALID_POSITION -1 +#define SCI_START 2000 +#define SCI_OPTIONAL_START 3000 +#define SCI_LEXER_START 4000 +#define SCI_ADDTEXT 2001 +#define SCI_ADDSTYLEDTEXT 2002 +#define SCI_INSERTTEXT 2003 +#define SCI_CLEARALL 2004 +#define SCI_CLEARDOCUMENTSTYLE 2005 +#define SCI_GETLENGTH 2006 +#define SCI_GETCHARAT 2007 +#define SCI_GETCURRENTPOS 2008 +#define SCI_GETANCHOR 2009 +#define SCI_GETSTYLEAT 2010 +#define SCI_REDO 2011 +#define SCI_SETUNDOCOLLECTION 2012 +#define SCI_SELECTALL 2013 +#define SCI_SETSAVEPOINT 2014 +#define SCI_GETSTYLEDTEXT 2015 +#define SCI_CANREDO 2016 +#define SCI_MARKERLINEFROMHANDLE 2017 +#define SCI_MARKERDELETEHANDLE 2018 +#define SCI_GETUNDOCOLLECTION 2019 +#define SCWS_INVISIBLE 0 +#define SCWS_VISIBLEALWAYS 1 +#define SCWS_VISIBLEAFTERINDENT 2 +#define SCI_GETVIEWWS 2020 +#define SCI_SETVIEWWS 2021 +#define SCI_POSITIONFROMPOINT 2022 +#define SCI_POSITIONFROMPOINTCLOSE 2023 +#define SCI_GOTOLINE 2024 +#define SCI_GOTOPOS 2025 +#define SCI_SETANCHOR 2026 +#define SCI_GETCURLINE 2027 +#define SCI_GETENDSTYLED 2028 +#define SC_EOL_CRLF 0 +#define SC_EOL_CR 1 +#define SC_EOL_LF 2 +#define SCI_CONVERTEOLS 2029 +#define SCI_GETEOLMODE 2030 +#define SCI_SETEOLMODE 2031 +#define SCI_STARTSTYLING 2032 +#define SCI_SETSTYLING 2033 +#define SCI_GETBUFFEREDDRAW 2034 +#define SCI_SETBUFFEREDDRAW 2035 +#define SCI_SETTABWIDTH 2036 +#define SCI_GETTABWIDTH 2121 +#define SC_CP_UTF8 65001 +#define SC_CP_DBCS 1 +#define SCI_SETCODEPAGE 2037 +#define SCI_SETUSEPALETTE 2039 +#define MARKER_MAX 31 +#define SC_MARK_CIRCLE 0 +#define SC_MARK_ROUNDRECT 1 +#define SC_MARK_ARROW 2 +#define SC_MARK_SMALLRECT 3 +#define SC_MARK_SHORTARROW 4 +#define SC_MARK_EMPTY 5 +#define SC_MARK_ARROWDOWN 6 +#define SC_MARK_MINUS 7 +#define SC_MARK_PLUS 8 +#define SC_MARK_VLINE 9 +#define SC_MARK_LCORNER 10 +#define SC_MARK_TCORNER 11 +#define SC_MARK_BOXPLUS 12 +#define SC_MARK_BOXPLUSCONNECTED 13 +#define SC_MARK_BOXMINUS 14 +#define SC_MARK_BOXMINUSCONNECTED 15 +#define SC_MARK_LCORNERCURVE 16 +#define SC_MARK_TCORNERCURVE 17 +#define SC_MARK_CIRCLEPLUS 18 +#define SC_MARK_CIRCLEPLUSCONNECTED 19 +#define SC_MARK_CIRCLEMINUS 20 +#define SC_MARK_CIRCLEMINUSCONNECTED 21 +#define SC_MARK_BACKGROUND 22 +#define SC_MARK_DOTDOTDOT 23 +#define SC_MARK_ARROWS 24 +#define SC_MARK_PIXMAP 25 +#define SC_MARK_FULLRECT 26 +#define SC_MARK_CHARACTER 10000 +#define SC_MARKNUM_FOLDEREND 25 +#define SC_MARKNUM_FOLDEROPENMID 26 +#define SC_MARKNUM_FOLDERMIDTAIL 27 +#define SC_MARKNUM_FOLDERTAIL 28 +#define SC_MARKNUM_FOLDERSUB 29 +#define SC_MARKNUM_FOLDER 30 +#define SC_MARKNUM_FOLDEROPEN 31 +#define SC_MASK_FOLDERS 0xFE000000 +#define SCI_MARKERDEFINE 2040 +#define SCI_MARKERSETFORE 2041 +#define SCI_MARKERSETBACK 2042 +#define SCI_MARKERADD 2043 +#define SCI_MARKERDELETE 2044 +#define SCI_MARKERDELETEALL 2045 +#define SCI_MARKERGET 2046 +#define SCI_MARKERNEXT 2047 +#define SCI_MARKERPREVIOUS 2048 +#define SCI_MARKERDEFINEPIXMAP 2049 +#define SCI_MARKERADDSET 2466 +#define SCI_MARKERSETALPHA 2476 +#define SC_MARGIN_SYMBOL 0 +#define SC_MARGIN_NUMBER 1 +#define SC_MARGIN_BACK 2 +#define SC_MARGIN_FORE 3 +#define SCI_SETMARGINTYPEN 2240 +#define SCI_GETMARGINTYPEN 2241 +#define SCI_SETMARGINWIDTHN 2242 +#define SCI_GETMARGINWIDTHN 2243 +#define SCI_SETMARGINMASKN 2244 +#define SCI_GETMARGINMASKN 2245 +#define SCI_SETMARGINSENSITIVEN 2246 +#define SCI_GETMARGINSENSITIVEN 2247 +#define STYLE_DEFAULT 32 +#define STYLE_LINENUMBER 33 +#define STYLE_BRACELIGHT 34 +#define STYLE_BRACEBAD 35 +#define STYLE_CONTROLCHAR 36 +#define STYLE_INDENTGUIDE 37 +#define STYLE_CALLTIP 38 +#define STYLE_LASTPREDEFINED 39 +#define STYLE_MAX 127 +#define SC_CHARSET_ANSI 0 +#define SC_CHARSET_DEFAULT 1 +#define SC_CHARSET_BALTIC 186 +#define SC_CHARSET_CHINESEBIG5 136 +#define SC_CHARSET_EASTEUROPE 238 +#define SC_CHARSET_GB2312 134 +#define SC_CHARSET_GREEK 161 +#define SC_CHARSET_HANGUL 129 +#define SC_CHARSET_MAC 77 +#define SC_CHARSET_OEM 255 +#define SC_CHARSET_RUSSIAN 204 +#define SC_CHARSET_CYRILLIC 1251 +#define SC_CHARSET_SHIFTJIS 128 +#define SC_CHARSET_SYMBOL 2 +#define SC_CHARSET_TURKISH 162 +#define SC_CHARSET_JOHAB 130 +#define SC_CHARSET_HEBREW 177 +#define SC_CHARSET_ARABIC 178 +#define SC_CHARSET_VIETNAMESE 163 +#define SC_CHARSET_THAI 222 +#define SC_CHARSET_8859_15 1000 +#define SCI_STYLECLEARALL 2050 +#define SCI_STYLESETFORE 2051 +#define SCI_STYLESETBACK 2052 +#define SCI_STYLESETBOLD 2053 +#define SCI_STYLESETITALIC 2054 +#define SCI_STYLESETSIZE 2055 +#define SCI_STYLESETFONT 2056 +#define SCI_STYLESETEOLFILLED 2057 +#define SCI_STYLERESETDEFAULT 2058 +#define SCI_STYLESETUNDERLINE 2059 +#define SC_CASE_MIXED 0 +#define SC_CASE_UPPER 1 +#define SC_CASE_LOWER 2 +#define SCI_STYLESETCASE 2060 +#define SCI_STYLESETCHARACTERSET 2066 +#define SCI_STYLESETHOTSPOT 2409 +#define SCI_SETSELFORE 2067 +#define SCI_SETSELBACK 2068 +#define SCI_GETSELALPHA 2477 +#define SCI_SETSELALPHA 2478 +#define SCI_SETCARETFORE 2069 +#define SCI_ASSIGNCMDKEY 2070 +#define SCI_CLEARCMDKEY 2071 +#define SCI_CLEARALLCMDKEYS 2072 +#define SCI_SETSTYLINGEX 2073 +#define SCI_STYLESETVISIBLE 2074 +#define SCI_GETCARETPERIOD 2075 +#define SCI_SETCARETPERIOD 2076 +#define SCI_SETWORDCHARS 2077 +#define SCI_BEGINUNDOACTION 2078 +#define SCI_ENDUNDOACTION 2079 +#define INDIC_MAX 7 +#define INDIC_PLAIN 0 +#define INDIC_SQUIGGLE 1 +#define INDIC_TT 2 +#define INDIC_DIAGONAL 3 +#define INDIC_STRIKE 4 +#define INDIC_HIDDEN 5 +#define INDIC_BOX 6 +#define INDIC_ROUNDBOX 7 +#define INDIC0_MASK 0x20 +#define INDIC1_MASK 0x40 +#define INDIC2_MASK 0x80 +#define INDICS_MASK 0xE0 +#define SCI_INDICSETSTYLE 2080 +#define SCI_INDICGETSTYLE 2081 +#define SCI_INDICSETFORE 2082 +#define SCI_INDICGETFORE 2083 +#define SCI_SETWHITESPACEFORE 2084 +#define SCI_SETWHITESPACEBACK 2085 +#define SCI_SETSTYLEBITS 2090 +#define SCI_GETSTYLEBITS 2091 +#define SCI_SETLINESTATE 2092 +#define SCI_GETLINESTATE 2093 +#define SCI_GETMAXLINESTATE 2094 +#define SCI_GETCARETLINEVISIBLE 2095 +#define SCI_SETCARETLINEVISIBLE 2096 +#define SCI_GETCARETLINEBACK 2097 +#define SCI_SETCARETLINEBACK 2098 +#define SCI_STYLESETCHANGEABLE 2099 +#define SCI_AUTOCSHOW 2100 +#define SCI_AUTOCCANCEL 2101 +#define SCI_AUTOCACTIVE 2102 +#define SCI_AUTOCPOSSTART 2103 +#define SCI_AUTOCCOMPLETE 2104 +#define SCI_AUTOCSTOPS 2105 +#define SCI_AUTOCSETSEPARATOR 2106 +#define SCI_AUTOCGETSEPARATOR 2107 +#define SCI_AUTOCSELECT 2108 +#define SCI_AUTOCSETCANCELATSTART 2110 +#define SCI_AUTOCGETCANCELATSTART 2111 +#define SCI_AUTOCSETFILLUPS 2112 +#define SCI_AUTOCSETCHOOSESINGLE 2113 +#define SCI_AUTOCGETCHOOSESINGLE 2114 +#define SCI_AUTOCSETIGNORECASE 2115 +#define SCI_AUTOCGETIGNORECASE 2116 +#define SCI_USERLISTSHOW 2117 +#define SCI_AUTOCSETAUTOHIDE 2118 +#define SCI_AUTOCGETAUTOHIDE 2119 +#define SCI_AUTOCSETDROPRESTOFWORD 2270 +#define SCI_AUTOCGETDROPRESTOFWORD 2271 +#define SCI_REGISTERIMAGE 2405 +#define SCI_CLEARREGISTEREDIMAGES 2408 +#define SCI_AUTOCGETTYPESEPARATOR 2285 +#define SCI_AUTOCSETTYPESEPARATOR 2286 +#define SCI_AUTOCSETMAXWIDTH 2208 +#define SCI_AUTOCGETMAXWIDTH 2209 +#define SCI_AUTOCSETMAXHEIGHT 2210 +#define SCI_AUTOCGETMAXHEIGHT 2211 +#define SCI_SETINDENT 2122 +#define SCI_GETINDENT 2123 +#define SCI_SETUSETABS 2124 +#define SCI_GETUSETABS 2125 +#define SCI_SETLINEINDENTATION 2126 +#define SCI_GETLINEINDENTATION 2127 +#define SCI_GETLINEINDENTPOSITION 2128 +#define SCI_GETCOLUMN 2129 +#define SCI_SETHSCROLLBAR 2130 +#define SCI_GETHSCROLLBAR 2131 +#define SCI_SETINDENTATIONGUIDES 2132 +#define SCI_GETINDENTATIONGUIDES 2133 +#define SCI_SETHIGHLIGHTGUIDE 2134 +#define SCI_GETHIGHLIGHTGUIDE 2135 +#define SCI_GETLINEENDPOSITION 2136 +#define SCI_GETCODEPAGE 2137 +#define SCI_GETCARETFORE 2138 +#define SCI_GETUSEPALETTE 2139 +#define SCI_GETREADONLY 2140 +#define SCI_SETCURRENTPOS 2141 +#define SCI_SETSELECTIONSTART 2142 +#define SCI_GETSELECTIONSTART 2143 +#define SCI_SETSELECTIONEND 2144 +#define SCI_GETSELECTIONEND 2145 +#define SCI_SETPRINTMAGNIFICATION 2146 +#define SCI_GETPRINTMAGNIFICATION 2147 +#define SC_PRINT_NORMAL 0 +#define SC_PRINT_INVERTLIGHT 1 +#define SC_PRINT_BLACKONWHITE 2 +#define SC_PRINT_COLOURONWHITE 3 +#define SC_PRINT_COLOURONWHITEDEFAULTBG 4 +#define SCI_SETPRINTCOLOURMODE 2148 +#define SCI_GETPRINTCOLOURMODE 2149 +#define SCFIND_WHOLEWORD 2 +#define SCFIND_MATCHCASE 4 +#define SCFIND_WORDSTART 0x00100000 +#define SCFIND_REGEXP 0x00200000 +#define SCFIND_POSIX 0x00400000 +#define SCI_FINDTEXT 2150 +#define SCI_FORMATRANGE 2151 +#define SCI_GETFIRSTVISIBLELINE 2152 +#define SCI_GETLINE 2153 +#define SCI_GETLINECOUNT 2154 +#define SCI_SETMARGINLEFT 2155 +#define SCI_GETMARGINLEFT 2156 +#define SCI_SETMARGINRIGHT 2157 +#define SCI_GETMARGINRIGHT 2158 +#define SCI_GETMODIFY 2159 +#define SCI_SETSEL 2160 +#define SCI_GETSELTEXT 2161 +#define SCI_GETTEXTRANGE 2162 +#define SCI_HIDESELECTION 2163 +#define SCI_POINTXFROMPOSITION 2164 +#define SCI_POINTYFROMPOSITION 2165 +#define SCI_LINEFROMPOSITION 2166 +#define SCI_POSITIONFROMLINE 2167 +#define SCI_LINESCROLL 2168 +#define SCI_SCROLLCARET 2169 +#define SCI_REPLACESEL 2170 +#define SCI_SETREADONLY 2171 +#define SCI_NULL 2172 +#define SCI_CANPASTE 2173 +#define SCI_CANUNDO 2174 +#define SCI_EMPTYUNDOBUFFER 2175 +#define SCI_UNDO 2176 +#define SCI_CUT 2177 +#define SCI_COPY 2178 +#define SCI_PASTE 2179 +#define SCI_CLEAR 2180 +#define SCI_SETTEXT 2181 +#define SCI_GETTEXT 2182 +#define SCI_GETTEXTLENGTH 2183 +#define SCI_GETDIRECTFUNCTION 2184 +#define SCI_GETDIRECTPOINTER 2185 +#define SCI_SETOVERTYPE 2186 +#define SCI_GETOVERTYPE 2187 +#define SCI_SETCARETWIDTH 2188 +#define SCI_GETCARETWIDTH 2189 +#define SCI_SETTARGETSTART 2190 +#define SCI_GETTARGETSTART 2191 +#define SCI_SETTARGETEND 2192 +#define SCI_GETTARGETEND 2193 +#define SCI_REPLACETARGET 2194 +#define SCI_REPLACETARGETRE 2195 +#define SCI_SEARCHINTARGET 2197 +#define SCI_SETSEARCHFLAGS 2198 +#define SCI_GETSEARCHFLAGS 2199 +#define SCI_CALLTIPSHOW 2200 +#define SCI_CALLTIPCANCEL 2201 +#define SCI_CALLTIPACTIVE 2202 +#define SCI_CALLTIPPOSSTART 2203 +#define SCI_CALLTIPSETHLT 2204 +#define SCI_CALLTIPSETBACK 2205 +#define SCI_CALLTIPSETFORE 2206 +#define SCI_CALLTIPSETFOREHLT 2207 +#define SCI_CALLTIPUSESTYLE 2212 +#define SCI_VISIBLEFROMDOCLINE 2220 +#define SCI_DOCLINEFROMVISIBLE 2221 +#define SCI_WRAPCOUNT 2235 +#define SC_FOLDLEVELBASE 0x400 +#define SC_FOLDLEVELWHITEFLAG 0x1000 +#define SC_FOLDLEVELHEADERFLAG 0x2000 +#define SC_FOLDLEVELBOXHEADERFLAG 0x4000 +#define SC_FOLDLEVELBOXFOOTERFLAG 0x8000 +#define SC_FOLDLEVELCONTRACTED 0x10000 +#define SC_FOLDLEVELUNINDENT 0x20000 +#define SC_FOLDLEVELNUMBERMASK 0x0FFF +#define SCI_SETFOLDLEVEL 2222 +#define SCI_GETFOLDLEVEL 2223 +#define SCI_GETLASTCHILD 2224 +#define SCI_GETFOLDPARENT 2225 +#define SCI_SHOWLINES 2226 +#define SCI_HIDELINES 2227 +#define SCI_GETLINEVISIBLE 2228 +#define SCI_SETFOLDEXPANDED 2229 +#define SCI_GETFOLDEXPANDED 2230 +#define SCI_TOGGLEFOLD 2231 +#define SCI_ENSUREVISIBLE 2232 +#define SC_FOLDFLAG_LINEBEFORE_EXPANDED 0x0002 +#define SC_FOLDFLAG_LINEBEFORE_CONTRACTED 0x0004 +#define SC_FOLDFLAG_LINEAFTER_EXPANDED 0x0008 +#define SC_FOLDFLAG_LINEAFTER_CONTRACTED 0x0010 +#define SC_FOLDFLAG_LEVELNUMBERS 0x0040 +#define SC_FOLDFLAG_BOX 0x0001 +#define SCI_SETFOLDFLAGS 2233 +#define SCI_ENSUREVISIBLEENFORCEPOLICY 2234 +#define SCI_SETTABINDENTS 2260 +#define SCI_GETTABINDENTS 2261 +#define SCI_SETBACKSPACEUNINDENTS 2262 +#define SCI_GETBACKSPACEUNINDENTS 2263 +#define SC_TIME_FOREVER 10000000 +#define SCI_SETMOUSEDWELLTIME 2264 +#define SCI_GETMOUSEDWELLTIME 2265 +#define SCI_WORDSTARTPOSITION 2266 +#define SCI_WORDENDPOSITION 2267 +#define SC_WRAP_NONE 0 +#define SC_WRAP_WORD 1 +#define SC_WRAP_CHAR 2 +#define SCI_SETWRAPMODE 2268 +#define SCI_GETWRAPMODE 2269 +#define SC_WRAPVISUALFLAG_NONE 0x0000 +#define SC_WRAPVISUALFLAG_END 0x0001 +#define SC_WRAPVISUALFLAG_START 0x0002 +#define SCI_SETWRAPVISUALFLAGS 2460 +#define SCI_GETWRAPVISUALFLAGS 2461 +#define SC_WRAPVISUALFLAGLOC_DEFAULT 0x0000 +#define SC_WRAPVISUALFLAGLOC_END_BY_TEXT 0x0001 +#define SC_WRAPVISUALFLAGLOC_START_BY_TEXT 0x0002 +#define SCI_SETWRAPVISUALFLAGSLOCATION 2462 +#define SCI_GETWRAPVISUALFLAGSLOCATION 2463 +#define SCI_SETWRAPSTARTINDENT 2464 +#define SCI_GETWRAPSTARTINDENT 2465 +#define SC_CACHE_NONE 0 +#define SC_CACHE_CARET 1 +#define SC_CACHE_PAGE 2 +#define SC_CACHE_DOCUMENT 3 +#define SCI_SETLAYOUTCACHE 2272 +#define SCI_GETLAYOUTCACHE 2273 +#define SCI_SETSCROLLWIDTH 2274 +#define SCI_GETSCROLLWIDTH 2275 +#define SCI_TEXTWIDTH 2276 +#define SCI_SETENDATLASTLINE 2277 +#define SCI_GETENDATLASTLINE 2278 +#define SCI_TEXTHEIGHT 2279 +#define SCI_SETVSCROLLBAR 2280 +#define SCI_GETVSCROLLBAR 2281 +#define SCI_APPENDTEXT 2282 +#define SCI_GETTWOPHASEDRAW 2283 +#define SCI_SETTWOPHASEDRAW 2284 +#define SCI_TARGETFROMSELECTION 2287 +#define SCI_LINESJOIN 2288 +#define SCI_LINESSPLIT 2289 +#define SCI_SETFOLDMARGINCOLOUR 2290 +#define SCI_SETFOLDMARGINHICOLOUR 2291 +#define SCI_LINEDOWN 2300 +#define SCI_LINEDOWNEXTEND 2301 +#define SCI_LINEUP 2302 +#define SCI_LINEUPEXTEND 2303 +#define SCI_CHARLEFT 2304 +#define SCI_CHARLEFTEXTEND 2305 +#define SCI_CHARRIGHT 2306 +#define SCI_CHARRIGHTEXTEND 2307 +#define SCI_WORDLEFT 2308 +#define SCI_WORDLEFTEXTEND 2309 +#define SCI_WORDRIGHT 2310 +#define SCI_WORDRIGHTEXTEND 2311 +#define SCI_HOME 2312 +#define SCI_HOMEEXTEND 2313 +#define SCI_LINEEND 2314 +#define SCI_LINEENDEXTEND 2315 +#define SCI_DOCUMENTSTART 2316 +#define SCI_DOCUMENTSTARTEXTEND 2317 +#define SCI_DOCUMENTEND 2318 +#define SCI_DOCUMENTENDEXTEND 2319 +#define SCI_PAGEUP 2320 +#define SCI_PAGEUPEXTEND 2321 +#define SCI_PAGEDOWN 2322 +#define SCI_PAGEDOWNEXTEND 2323 +#define SCI_EDITTOGGLEOVERTYPE 2324 +#define SCI_CANCEL 2325 +#define SCI_DELETEBACK 2326 +#define SCI_TAB 2327 +#define SCI_BACKTAB 2328 +#define SCI_NEWLINE 2329 +#define SCI_FORMFEED 2330 +#define SCI_VCHOME 2331 +#define SCI_VCHOMEEXTEND 2332 +#define SCI_ZOOMIN 2333 +#define SCI_ZOOMOUT 2334 +#define SCI_DELWORDLEFT 2335 +#define SCI_DELWORDRIGHT 2336 +#define SCI_LINECUT 2337 +#define SCI_LINEDELETE 2338 +#define SCI_LINETRANSPOSE 2339 +#define SCI_LINEDUPLICATE 2404 +#define SCI_LOWERCASE 2340 +#define SCI_UPPERCASE 2341 +#define SCI_LINESCROLLDOWN 2342 +#define SCI_LINESCROLLUP 2343 +#define SCI_DELETEBACKNOTLINE 2344 +#define SCI_HOMEDISPLAY 2345 +#define SCI_HOMEDISPLAYEXTEND 2346 +#define SCI_LINEENDDISPLAY 2347 +#define SCI_LINEENDDISPLAYEXTEND 2348 +#define SCI_HOMEWRAP 2349 +#define SCI_HOMEWRAPEXTEND 2450 +#define SCI_LINEENDWRAP 2451 +#define SCI_LINEENDWRAPEXTEND 2452 +#define SCI_VCHOMEWRAP 2453 +#define SCI_VCHOMEWRAPEXTEND 2454 +#define SCI_LINECOPY 2455 +#define SCI_MOVECARETINSIDEVIEW 2401 +#define SCI_LINELENGTH 2350 +#define SCI_BRACEHIGHLIGHT 2351 +#define SCI_BRACEBADLIGHT 2352 +#define SCI_BRACEMATCH 2353 +#define SCI_GETVIEWEOL 2355 +#define SCI_SETVIEWEOL 2356 +#define SCI_GETDOCPOINTER 2357 +#define SCI_SETDOCPOINTER 2358 +#define SCI_SETMODEVENTMASK 2359 +#define EDGE_NONE 0 +#define EDGE_LINE 1 +#define EDGE_BACKGROUND 2 +#define SCI_GETEDGECOLUMN 2360 +#define SCI_SETEDGECOLUMN 2361 +#define SCI_GETEDGEMODE 2362 +#define SCI_SETEDGEMODE 2363 +#define SCI_GETEDGECOLOUR 2364 +#define SCI_SETEDGECOLOUR 2365 +#define SCI_SEARCHANCHOR 2366 +#define SCI_SEARCHNEXT 2367 +#define SCI_SEARCHPREV 2368 +#define SCI_LINESONSCREEN 2370 +#define SCI_USEPOPUP 2371 +#define SCI_SELECTIONISRECTANGLE 2372 +#define SCI_SETZOOM 2373 +#define SCI_GETZOOM 2374 +#define SCI_CREATEDOCUMENT 2375 +#define SCI_ADDREFDOCUMENT 2376 +#define SCI_RELEASEDOCUMENT 2377 +#define SCI_GETMODEVENTMASK 2378 +#define SCI_SETFOCUS 2380 +#define SCI_GETFOCUS 2381 +#define SCI_SETSTATUS 2382 +#define SCI_GETSTATUS 2383 +#define SCI_SETMOUSEDOWNCAPTURES 2384 +#define SCI_GETMOUSEDOWNCAPTURES 2385 +#define SC_CURSORNORMAL -1 +#define SC_CURSORWAIT 4 +#define SCI_SETCURSOR 2386 +#define SCI_GETCURSOR 2387 +#define SCI_SETCONTROLCHARSYMBOL 2388 +#define SCI_GETCONTROLCHARSYMBOL 2389 +#define SCI_WORDPARTLEFT 2390 +#define SCI_WORDPARTLEFTEXTEND 2391 +#define SCI_WORDPARTRIGHT 2392 +#define SCI_WORDPARTRIGHTEXTEND 2393 +#define VISIBLE_SLOP 0x01 +#define VISIBLE_STRICT 0x04 +#define SCI_SETVISIBLEPOLICY 2394 +#define SCI_DELLINELEFT 2395 +#define SCI_DELLINERIGHT 2396 +#define SCI_SETXOFFSET 2397 +#define SCI_GETXOFFSET 2398 +#define SCI_CHOOSECARETX 2399 +#define SCI_GRABFOCUS 2400 +#define CARET_SLOP 0x01 +#define CARET_STRICT 0x04 +#define CARET_JUMPS 0x10 +#define CARET_EVEN 0x08 +#define SCI_SETXCARETPOLICY 2402 +#define SCI_SETYCARETPOLICY 2403 +#define SCI_SETPRINTWRAPMODE 2406 +#define SCI_GETPRINTWRAPMODE 2407 +#define SCI_SETHOTSPOTACTIVEFORE 2410 +#define SCI_SETHOTSPOTACTIVEBACK 2411 +#define SCI_SETHOTSPOTACTIVEUNDERLINE 2412 +#define SCI_SETHOTSPOTSINGLELINE 2421 +#define SCI_PARADOWN 2413 +#define SCI_PARADOWNEXTEND 2414 +#define SCI_PARAUP 2415 +#define SCI_PARAUPEXTEND 2416 +#define SCI_POSITIONBEFORE 2417 +#define SCI_POSITIONAFTER 2418 +#define SCI_COPYRANGE 2419 +#define SCI_COPYTEXT 2420 +#define SC_SEL_STREAM 0 +#define SC_SEL_RECTANGLE 1 +#define SC_SEL_LINES 2 +#define SCI_SETSELECTIONMODE 2422 +#define SCI_GETSELECTIONMODE 2423 +#define SCI_GETLINESELSTARTPOSITION 2424 +#define SCI_GETLINESELENDPOSITION 2425 +#define SCI_LINEDOWNRECTEXTEND 2426 +#define SCI_LINEUPRECTEXTEND 2427 +#define SCI_CHARLEFTRECTEXTEND 2428 +#define SCI_CHARRIGHTRECTEXTEND 2429 +#define SCI_HOMERECTEXTEND 2430 +#define SCI_VCHOMERECTEXTEND 2431 +#define SCI_LINEENDRECTEXTEND 2432 +#define SCI_PAGEUPRECTEXTEND 2433 +#define SCI_PAGEDOWNRECTEXTEND 2434 +#define SCI_STUTTEREDPAGEUP 2435 +#define SCI_STUTTEREDPAGEUPEXTEND 2436 +#define SCI_STUTTEREDPAGEDOWN 2437 +#define SCI_STUTTEREDPAGEDOWNEXTEND 2438 +#define SCI_WORDLEFTEND 2439 +#define SCI_WORDLEFTENDEXTEND 2440 +#define SCI_WORDRIGHTEND 2441 +#define SCI_WORDRIGHTENDEXTEND 2442 +#define SCI_SETWHITESPACECHARS 2443 +#define SCI_SETCHARSDEFAULT 2444 +#define SCI_AUTOCGETCURRENT 2445 +#define SCI_ALLOCATE 2446 +#define SCI_TARGETASUTF8 2447 +#define SCI_SETLENGTHFORENCODE 2448 +#define SCI_ENCODEDFROMUTF8 2449 +#define SCI_FINDCOLUMN 2456 +#define SCI_GETCARETSTICKY 2457 +#define SCI_SETCARETSTICKY 2458 +#define SCI_TOGGLECARETSTICKY 2459 +#define SCI_SETPASTECONVERTENDINGS 2467 +#define SCI_GETPASTECONVERTENDINGS 2468 +#define SCI_SELECTIONDUPLICATE 2469 +#define SC_ALPHA_TRANSPARENT 0 +#define SC_ALPHA_OPAQUE 255 +#define SC_ALPHA_NOALPHA 256 +#define SCI_SETCARETLINEBACKALPHA 2470 +#define SCI_GETCARETLINEBACKALPHA 2471 +#define SCI_STARTRECORD 3001 +#define SCI_STOPRECORD 3002 +#define SCI_SETLEXER 4001 +#define SCI_GETLEXER 4002 +#define SCI_COLOURISE 4003 +#define SCI_SETPROPERTY 4004 +#define KEYWORDSET_MAX 8 +#define SCI_SETKEYWORDS 4005 +#define SCI_SETLEXERLANGUAGE 4006 +#define SCI_LOADLEXERLIBRARY 4007 +#define SCI_GETPROPERTY 4008 +#define SCI_GETPROPERTYEXPANDED 4009 +#define SCI_GETPROPERTYINT 4010 +#define SCI_GETSTYLEBITSNEEDED 4011 +#define SC_MOD_INSERTTEXT 0x1 +#define SC_MOD_DELETETEXT 0x2 +#define SC_MOD_CHANGESTYLE 0x4 +#define SC_MOD_CHANGEFOLD 0x8 +#define SC_PERFORMED_USER 0x10 +#define SC_PERFORMED_UNDO 0x20 +#define SC_PERFORMED_REDO 0x40 +#define SC_MULTISTEPUNDOREDO 0x80 +#define SC_LASTSTEPINUNDOREDO 0x100 +#define SC_MOD_CHANGEMARKER 0x200 +#define SC_MOD_BEFOREINSERT 0x400 +#define SC_MOD_BEFOREDELETE 0x800 +#define SC_MULTILINEUNDOREDO 0x1000 +#define SC_MODEVENTMASKALL 0x1FFF +#define SCEN_CHANGE 768 +#define SCEN_SETFOCUS 512 +#define SCEN_KILLFOCUS 256 +#define SCK_DOWN 300 +#define SCK_UP 301 +#define SCK_LEFT 302 +#define SCK_RIGHT 303 +#define SCK_HOME 304 +#define SCK_END 305 +#define SCK_PRIOR 306 +#define SCK_NEXT 307 +#define SCK_DELETE 308 +#define SCK_INSERT 309 +#define SCK_ESCAPE 7 +#define SCK_BACK 8 +#define SCK_TAB 9 +#define SCK_RETURN 13 +#define SCK_ADD 310 +#define SCK_SUBTRACT 311 +#define SCK_DIVIDE 312 +#define SCMOD_NORM 0 +#define SCMOD_SHIFT 1 +#define SCMOD_CTRL 2 +#define SCMOD_ALT 4 +#define SCN_STYLENEEDED 2000 +#define SCN_CHARADDED 2001 +#define SCN_SAVEPOINTREACHED 2002 +#define SCN_SAVEPOINTLEFT 2003 +#define SCN_MODIFYATTEMPTRO 2004 +#define SCN_KEY 2005 +#define SCN_DOUBLECLICK 2006 +#define SCN_UPDATEUI 2007 +#define SCN_MODIFIED 2008 +#define SCN_MACRORECORD 2009 +#define SCN_MARGINCLICK 2010 +#define SCN_NEEDSHOWN 2011 +#define SCN_PAINTED 2013 +#define SCN_USERLISTSELECTION 2014 +#define SCN_URIDROPPED 2015 +#define SCN_DWELLSTART 2016 +#define SCN_DWELLEND 2017 +#define SCN_ZOOM 2018 +#define SCN_HOTSPOTCLICK 2019 +#define SCN_HOTSPOTDOUBLECLICK 2020 +#define SCN_CALLTIPCLICK 2021 +#define SCN_AUTOCSELECTION 2022 +//--Autogenerated -- end of section automatically generated from Scintilla.iface + +// These structures are defined to be exactly the same shape as the Win32 +// CHARRANGE, TEXTRANGE, FINDTEXTEX, FORMATRANGE, and NMHDR structs. +// So older code that treats Scintilla as a RichEdit will work. + +struct CharacterRange { + long cpMin; + long cpMax; +}; + +struct TextRange { + struct CharacterRange chrg; + char *lpstrText; +}; + +struct TextToFind { + struct CharacterRange chrg; + char *lpstrText; + struct CharacterRange chrgText; +}; + +#ifdef PLATFORM_H + +// This structure is used in printing and requires some of the graphics types +// from Platform.h. Not needed by most client code. + +struct RangeToFormat { + SurfaceID hdc; + SurfaceID hdcTarget; + PRectangle rc; + PRectangle rcPage; + CharacterRange chrg; +}; + +#endif + +struct NotifyHeader { + // Compatible with Windows NMHDR. + // hwndFrom is really an environment specific window handle or pointer + // but most clients of Scintilla.h do not have this type visible. + void *hwndFrom; + uptr_t idFrom; + unsigned int code; +}; + +struct SCNotification { + struct NotifyHeader nmhdr; + int position; // SCN_STYLENEEDED, SCN_MODIFIED, SCN_DWELLSTART, SCN_DWELLEND + int ch; // SCN_CHARADDED, SCN_KEY + int modifiers; // SCN_KEY + int modificationType; // SCN_MODIFIED + const char *text; // SCN_MODIFIED, SCN_USERLISTSELECTION, SCN_AUTOCSELECTION + int length; // SCN_MODIFIED + int linesAdded; // SCN_MODIFIED + int message; // SCN_MACRORECORD + uptr_t wParam; // SCN_MACRORECORD + sptr_t lParam; // SCN_MACRORECORD + int line; // SCN_MODIFIED + int foldLevelNow; // SCN_MODIFIED + int foldLevelPrev; // SCN_MODIFIED + int margin; // SCN_MARGINCLICK + int listType; // SCN_USERLISTSELECTION + int x; // SCN_DWELLSTART, SCN_DWELLEND + int y; // SCN_DWELLSTART, SCN_DWELLEND +}; + +// Deprecation section listing all API features that are deprecated and will +// will be removed completely in a future version. +// To enable these features define INCLUDE_DEPRECATED_FEATURES + +#ifdef INCLUDE_DEPRECATED_FEATURES + +#define SCI_SETCARETPOLICY 2369 +#define CARET_CENTER 0x02 +#define CARET_XEVEN 0x08 +#define CARET_XJUMPS 0x10 + +#define SCN_POSCHANGED 2012 +#define SCN_CHECKBRACE 2007 + +#endif + +#endif diff --git a/include/Scintilla.iface b/include/Scintilla.iface new file mode 100755 index 0000000..c3e5b56 --- /dev/null +++ b/include/Scintilla.iface @@ -0,0 +1,3012 @@ +## First line may be used for shbang + +## This file defines the interface to Scintilla + +## Copyright 2000-2003 by Neil Hodgson +## The License.txt file describes the conditions under which this software may be distributed. + +## A line starting with ## is a pure comment and should be stripped by readers. +## A line starting with #! is for future shbang use +## A line starting with # followed by a space is a documentation comment and refers +## to the next feature definition. + +## Each feature is defined by a line starting with fun, get, set, val or evt. +## cat -> start a category +## fun -> a function +## get -> a property get function +## set -> a property set function +## val -> definition of a constant +## evt -> an event +## enu -> associate an enumeration with a set of vals with a prefix +## lex -> associate a lexer with the lexical classes it produces +## +## All other feature names should be ignored. They may be defined in the future. +## A property may have a set function, a get function or both. Each will have +## "Get" or "Set" in their names and the corresponding name will have the obvious switch. +## A property may be subscripted, in which case the first parameter is the subscript. +## fun, get, and set features have a strict syntax: +## [=,) +## where stands for white space. +## param may be empty (null value) or is [=] +## Additional white space is allowed between elements. +## The syntax for evt is [=[,]*]) +## Feature names that contain an underscore are defined by Windows, so in these +## cases, using the Windows definition is preferred where available. +## The feature numbers are stable so features will not be renumbered. +## Features may be removed but they will go through a period of deprecation +## before removal which is signalled by moving them into the Deprecated category. +## +## enu has the syntax enu=[]* where all the val +## features in this file starting with a given are considered part of the +## enumeration. +## +## lex has the syntax lex=[]* +## where name is a reasonably capitalised (Python, XML) identifier or UI name, +## lexerVal is the val used to specify the lexer, and the list of prefixes is similar +## to enu. The name may not be the same as that used within the lexer so the lexerVal +## should be used to tie these entities together. + +## Types: +## void +## int +## bool -> integer, 1=true, 0=false +## position -> integer position in a document +## colour -> colour integer containing red, green and blue bytes. +## string -> pointer to const character +## stringresult -> pointer to character, NULL-> return size of result +## cells -> pointer to array of cells, each cell containing a style byte and character byte +## textrange -> range of a min and a max position with an output string +## findtext -> searchrange, text -> foundposition +## keymod -> integer containing key in low half and modifiers in high half +## formatrange +## Types no longer used: +## findtextex -> searchrange +## charrange -> range of a min and a max position +## charrangeresult -> like charrange, but output param +## countedstring +## point -> x,y +## pointresult -> like point, but output param +## rectangle -> left,top,right,bottom +## Client code should ignore definitions containing types it does not understand, except +## for possibly #defining the constants + +## Line numbers and positions start at 0. +## String arguments may contain NUL ('\0') characters where the calls provide a length +## argument and retrieve NUL characters. All retrieved strings except for those retrieved +## by GetLine also have a NUL appended but client code should calculate the size that +## will be returned rather than relying upon the NUL whenever possible. Allow for the +## extra NUL character when allocating buffers. The size to allocate for a stringresult +## can be determined by calling with a NULL (0) pointer. + +cat Basics + +################################################ +## For Scintilla.h +val INVALID_POSITION=-1 +# Define start of Scintilla messages to be greater than all Windows edit (EM_*) messages +# as many EM_ messages can be used although that use is deprecated. +val SCI_START=2000 +val SCI_OPTIONAL_START=3000 +val SCI_LEXER_START=4000 + +# Add text to the document at current position. +fun void AddText=2001(int length, string text) + +# Add array of cells to document. +fun void AddStyledText=2002(int length, cells c) + +# Insert string at a position. +fun void InsertText=2003(position pos, string text) + +# Delete all text in the document. +fun void ClearAll=2004(,) + +# Set all style bytes to 0, remove all folding information. +fun void ClearDocumentStyle=2005(,) + +# Returns the number of characters in the document. +get int GetLength=2006(,) + +# Returns the character byte at the position. +get int GetCharAt=2007(position pos,) + +# Returns the position of the caret. +get position GetCurrentPos=2008(,) + +# Returns the position of the opposite end of the selection to the caret. +get position GetAnchor=2009(,) + +# Returns the style byte at the position. +get int GetStyleAt=2010(position pos,) + +# Redoes the next action on the undo history. +fun void Redo=2011(,) + +# Choose between collecting actions into the undo +# history and discarding them. +set void SetUndoCollection=2012(bool collectUndo,) + +# Select all the text in the document. +fun void SelectAll=2013(,) + +# Remember the current position in the undo history as the position +# at which the document was saved. +fun void SetSavePoint=2014(,) + +# Retrieve a buffer of cells. +# Returns the number of bytes in the buffer not including terminating NULs. +fun int GetStyledText=2015(, textrange tr) + +# Are there any redoable actions in the undo history? +fun bool CanRedo=2016(,) + +# Retrieve the line number at which a particular marker is located. +fun int MarkerLineFromHandle=2017(int handle,) + +# Delete a marker. +fun void MarkerDeleteHandle=2018(int handle,) + +# Is undo history being collected? +get bool GetUndoCollection=2019(,) + +enu WhiteSpace=SCWS_ +val SCWS_INVISIBLE=0 +val SCWS_VISIBLEALWAYS=1 +val SCWS_VISIBLEAFTERINDENT=2 + +# Are white space characters currently visible? +# Returns one of SCWS_* constants. +get int GetViewWS=2020(,) + +# Make white space characters invisible, always visible or visible outside indentation. +set void SetViewWS=2021(int viewWS,) + +# Find the position from a point within the window. +fun position PositionFromPoint=2022(int x, int y) + +# Find the position from a point within the window but return +# INVALID_POSITION if not close to text. +fun position PositionFromPointClose=2023(int x, int y) + +# Set caret to start of a line and ensure it is visible. +fun void GotoLine=2024(int line,) + +# Set caret to a position and ensure it is visible. +fun void GotoPos=2025(position pos,) + +# Set the selection anchor to a position. The anchor is the opposite +# end of the selection from the caret. +set void SetAnchor=2026(position posAnchor,) + +# Retrieve the text of the line containing the caret. +# Returns the index of the caret on the line. +fun int GetCurLine=2027(int length, stringresult text) + +# Retrieve the position of the last correctly styled character. +get position GetEndStyled=2028(,) + +enu EndOfLine=SC_EOL_ +val SC_EOL_CRLF=0 +val SC_EOL_CR=1 +val SC_EOL_LF=2 + +# Convert all line endings in the document to one mode. +fun void ConvertEOLs=2029(int eolMode,) + +# Retrieve the current end of line mode - one of CRLF, CR, or LF. +get int GetEOLMode=2030(,) + +# Set the current end of line mode. +set void SetEOLMode=2031(int eolMode,) + +# Set the current styling position to pos and the styling mask to mask. +# The styling mask can be used to protect some bits in each styling byte from modification. +fun void StartStyling=2032(position pos, int mask) + +# Change style from current styling position for length characters to a style +# and move the current styling position to after this newly styled segment. +fun void SetStyling=2033(int length, int style) + +# Is drawing done first into a buffer or direct to the screen? +get bool GetBufferedDraw=2034(,) + +# If drawing is buffered then each line of text is drawn into a bitmap buffer +# before drawing it to the screen to avoid flicker. +set void SetBufferedDraw=2035(bool buffered,) + +# Change the visible size of a tab to be a multiple of the width of a space character. +set void SetTabWidth=2036(int tabWidth,) + +# Retrieve the visible size of a tab. +get int GetTabWidth=2121(,) + +# The SC_CP_UTF8 value can be used to enter Unicode mode. +# This is the same value as CP_UTF8 in Windows +val SC_CP_UTF8=65001 + +# The SC_CP_DBCS value can be used to indicate a DBCS mode for GTK+. +val SC_CP_DBCS=1 + +# Set the code page used to interpret the bytes of the document as characters. +# The SC_CP_UTF8 value can be used to enter Unicode mode. +set void SetCodePage=2037(int codePage,) + +# In palette mode, Scintilla uses the environment's palette calls to display +# more colours. This may lead to ugly displays. +set void SetUsePalette=2039(bool usePalette,) + +enu MarkerSymbol=SC_MARK_ +val MARKER_MAX=31 +val SC_MARK_CIRCLE=0 +val SC_MARK_ROUNDRECT=1 +val SC_MARK_ARROW=2 +val SC_MARK_SMALLRECT=3 +val SC_MARK_SHORTARROW=4 +val SC_MARK_EMPTY=5 +val SC_MARK_ARROWDOWN=6 +val SC_MARK_MINUS=7 +val SC_MARK_PLUS=8 + +# Shapes used for outlining column. +val SC_MARK_VLINE=9 +val SC_MARK_LCORNER=10 +val SC_MARK_TCORNER=11 +val SC_MARK_BOXPLUS=12 +val SC_MARK_BOXPLUSCONNECTED=13 +val SC_MARK_BOXMINUS=14 +val SC_MARK_BOXMINUSCONNECTED=15 +val SC_MARK_LCORNERCURVE=16 +val SC_MARK_TCORNERCURVE=17 +val SC_MARK_CIRCLEPLUS=18 +val SC_MARK_CIRCLEPLUSCONNECTED=19 +val SC_MARK_CIRCLEMINUS=20 +val SC_MARK_CIRCLEMINUSCONNECTED=21 + +# Invisible mark that only sets the line background color. +val SC_MARK_BACKGROUND=22 +val SC_MARK_DOTDOTDOT=23 +val SC_MARK_ARROWS=24 +val SC_MARK_PIXMAP=25 +val SC_MARK_FULLRECT=26 + +val SC_MARK_CHARACTER=10000 + +enu MarkerOutline=SC_MARKNUM_ +# Markers used for outlining column. +val SC_MARKNUM_FOLDEREND=25 +val SC_MARKNUM_FOLDEROPENMID=26 +val SC_MARKNUM_FOLDERMIDTAIL=27 +val SC_MARKNUM_FOLDERTAIL=28 +val SC_MARKNUM_FOLDERSUB=29 +val SC_MARKNUM_FOLDER=30 +val SC_MARKNUM_FOLDEROPEN=31 + +val SC_MASK_FOLDERS=0xFE000000 + +# Set the symbol used for a particular marker number. +fun void MarkerDefine=2040(int markerNumber, int markerSymbol) + +# Set the foreground colour used for a particular marker number. +fun void MarkerSetFore=2041(int markerNumber, colour fore) + +# Set the background colour used for a particular marker number. +fun void MarkerSetBack=2042(int markerNumber, colour back) + +# Add a marker to a line, returning an ID which can be used to find or delete the marker. +fun int MarkerAdd=2043(int line, int markerNumber) + +# Delete a marker from a line. +fun void MarkerDelete=2044(int line, int markerNumber) + +# Delete all markers with a particular number from all lines. +fun void MarkerDeleteAll=2045(int markerNumber,) + +# Get a bit mask of all the markers set on a line. +fun int MarkerGet=2046(int line,) + +# Find the next line after lineStart that includes a marker in mask. +fun int MarkerNext=2047(int lineStart, int markerMask) + +# Find the previous line before lineStart that includes a marker in mask. +fun int MarkerPrevious=2048(int lineStart, int markerMask) + +# Define a marker from a pixmap. +fun void MarkerDefinePixmap=2049(int markerNumber, string pixmap) + +# Add a set of markers to a line. +fun void MarkerAddSet=2466(int line, int set) + +# Set the alpha used for a marker that is drawn in the text area, not the margin. +fun void MarkerSetAlpha=2476(int markerNumber, int alpha) + +enu MarginType=SC_MARGIN_ +val SC_MARGIN_SYMBOL=0 +val SC_MARGIN_NUMBER=1 +val SC_MARGIN_BACK=2 +val SC_MARGIN_FORE=3 + +# Set a margin to be either numeric or symbolic. +set void SetMarginTypeN=2240(int margin, int marginType) + +# Retrieve the type of a margin. +get int GetMarginTypeN=2241(int margin,) + +# Set the width of a margin to a width expressed in pixels. +set void SetMarginWidthN=2242(int margin, int pixelWidth) + +# Retrieve the width of a margin in pixels. +get int GetMarginWidthN=2243(int margin,) + +# Set a mask that determines which markers are displayed in a margin. +set void SetMarginMaskN=2244(int margin, int mask) + +# Retrieve the marker mask of a margin. +get int GetMarginMaskN=2245(int margin,) + +# Make a margin sensitive or insensitive to mouse clicks. +set void SetMarginSensitiveN=2246(int margin, bool sensitive) + +# Retrieve the mouse click sensitivity of a margin. +get bool GetMarginSensitiveN=2247(int margin,) + +# Styles in range 32..38 are predefined for parts of the UI and are not used as normal styles. +# Style 39 is for future use. +enu StylesCommon=STYLE_ +val STYLE_DEFAULT=32 +val STYLE_LINENUMBER=33 +val STYLE_BRACELIGHT=34 +val STYLE_BRACEBAD=35 +val STYLE_CONTROLCHAR=36 +val STYLE_INDENTGUIDE=37 +val STYLE_CALLTIP=38 +val STYLE_LASTPREDEFINED=39 +val STYLE_MAX=127 + +# Character set identifiers are used in StyleSetCharacterSet. +# The values are the same as the Windows *_CHARSET values. +enu CharacterSet=SC_CHARSET_ +val SC_CHARSET_ANSI=0 +val SC_CHARSET_DEFAULT=1 +val SC_CHARSET_BALTIC=186 +val SC_CHARSET_CHINESEBIG5=136 +val SC_CHARSET_EASTEUROPE=238 +val SC_CHARSET_GB2312=134 +val SC_CHARSET_GREEK=161 +val SC_CHARSET_HANGUL=129 +val SC_CHARSET_MAC=77 +val SC_CHARSET_OEM=255 +val SC_CHARSET_RUSSIAN=204 +val SC_CHARSET_CYRILLIC=1251 +val SC_CHARSET_SHIFTJIS=128 +val SC_CHARSET_SYMBOL=2 +val SC_CHARSET_TURKISH=162 +val SC_CHARSET_JOHAB=130 +val SC_CHARSET_HEBREW=177 +val SC_CHARSET_ARABIC=178 +val SC_CHARSET_VIETNAMESE=163 +val SC_CHARSET_THAI=222 +val SC_CHARSET_8859_15=1000 + +# Clear all the styles and make equivalent to the global default style. +set void StyleClearAll=2050(,) + +# Set the foreground colour of a style. +set void StyleSetFore=2051(int style, colour fore) + +# Set the background colour of a style. +set void StyleSetBack=2052(int style, colour back) + +# Set a style to be bold or not. +set void StyleSetBold=2053(int style, bool bold) + +# Set a style to be italic or not. +set void StyleSetItalic=2054(int style, bool italic) + +# Set the size of characters of a style. +set void StyleSetSize=2055(int style, int sizePoints) + +# Set the font of a style. +set void StyleSetFont=2056(int style, string fontName) + +# Set a style to have its end of line filled or not. +set void StyleSetEOLFilled=2057(int style, bool filled) + +# Reset the default style to its state at startup +fun void StyleResetDefault=2058(,) + +# Set a style to be underlined or not. +set void StyleSetUnderline=2059(int style, bool underline) + +enu CaseVisible=SC_CASE_ +val SC_CASE_MIXED=0 +val SC_CASE_UPPER=1 +val SC_CASE_LOWER=2 +# Set a style to be mixed case, or to force upper or lower case. +set void StyleSetCase=2060(int style, int caseForce) + +# Set the character set of the font in a style. +set void StyleSetCharacterSet=2066(int style, int characterSet) + +# Set a style to be a hotspot or not. +set void StyleSetHotSpot=2409(int style, bool hotspot) + +# Set the foreground colour of the selection and whether to use this setting. +fun void SetSelFore=2067(bool useSetting, colour fore) + +# Set the background colour of the selection and whether to use this setting. +fun void SetSelBack=2068(bool useSetting, colour back) + +# Get the alpha of the selection. +get int GetSelAlpha=2477(,) + +# Set the alpha of the selection. +set void SetSelAlpha=2478(int alpha,) + +# Set the foreground colour of the caret. +set void SetCaretFore=2069(colour fore,) + +# When key+modifier combination km is pressed perform msg. +fun void AssignCmdKey=2070(keymod km, int msg) + +# When key+modifier combination km is pressed do nothing. +fun void ClearCmdKey=2071(keymod km,) + +# Drop all key mappings. +fun void ClearAllCmdKeys=2072(,) + +# Set the styles for a segment of the document. +fun void SetStylingEx=2073(int length, string styles) + +# Set a style to be visible or not. +set void StyleSetVisible=2074(int style, bool visible) + +# Get the time in milliseconds that the caret is on and off. +get int GetCaretPeriod=2075(,) + +# Get the time in milliseconds that the caret is on and off. 0 = steady on. +set void SetCaretPeriod=2076(int periodMilliseconds,) + +# Set the set of characters making up words for when moving or selecting by word. +# First sets deaults like SetCharsDefault. +set void SetWordChars=2077(, string characters) + +# Start a sequence of actions that is undone and redone as a unit. +# May be nested. +fun void BeginUndoAction=2078(,) + +# End a sequence of actions that is undone and redone as a unit. +fun void EndUndoAction=2079(,) + +enu IndicatorStyle=INDIC_ +val INDIC_MAX=7 +val INDIC_PLAIN=0 +val INDIC_SQUIGGLE=1 +val INDIC_TT=2 +val INDIC_DIAGONAL=3 +val INDIC_STRIKE=4 +val INDIC_HIDDEN=5 +val INDIC_BOX=6 +val INDIC_ROUNDBOX=7 +val INDIC0_MASK=0x20 +val INDIC1_MASK=0x40 +val INDIC2_MASK=0x80 +val INDICS_MASK=0xE0 + +# Set an indicator to plain, squiggle or TT. +set void IndicSetStyle=2080(int indic, int style) + +# Retrieve the style of an indicator. +get int IndicGetStyle=2081(int indic,) + +# Set the foreground colour of an indicator. +set void IndicSetFore=2082(int indic, colour fore) + +# Retrieve the foreground colour of an indicator. +get colour IndicGetFore=2083(int indic,) + +# Set the foreground colour of all whitespace and whether to use this setting. +fun void SetWhitespaceFore=2084(bool useSetting, colour fore) + +# Set the background colour of all whitespace and whether to use this setting. +fun void SetWhitespaceBack=2085(bool useSetting, colour back) + +# Divide each styling byte into lexical class bits (default: 5) and indicator +# bits (default: 3). If a lexer requires more than 32 lexical states, then this +# is used to expand the possible states. +set void SetStyleBits=2090(int bits,) + +# Retrieve number of bits in style bytes used to hold the lexical state. +get int GetStyleBits=2091(,) + +# Used to hold extra styling information for each line. +set void SetLineState=2092(int line, int state) + +# Retrieve the extra styling information for a line. +get int GetLineState=2093(int line,) + +# Retrieve the last line number that has line state. +get int GetMaxLineState=2094(,) + +# Is the background of the line containing the caret in a different colour? +get bool GetCaretLineVisible=2095(,) + +# Display the background of the line containing the caret in a different colour. +set void SetCaretLineVisible=2096(bool show,) + +# Get the colour of the background of the line containing the caret. +get colour GetCaretLineBack=2097(,) + +# Set the colour of the background of the line containing the caret. +set void SetCaretLineBack=2098(colour back,) + +# Set a style to be changeable or not (read only). +# Experimental feature, currently buggy. +set void StyleSetChangeable=2099(int style, bool changeable) + +# Display a auto-completion list. +# The lenEntered parameter indicates how many characters before +# the caret should be used to provide context. +fun void AutoCShow=2100(int lenEntered, string itemList) + +# Remove the auto-completion list from the screen. +fun void AutoCCancel=2101(,) + +# Is there an auto-completion list visible? +fun bool AutoCActive=2102(,) + +# Retrieve the position of the caret when the auto-completion list was displayed. +fun position AutoCPosStart=2103(,) + +# User has selected an item so remove the list and insert the selection. +fun void AutoCComplete=2104(,) + +# Define a set of character that when typed cancel the auto-completion list. +fun void AutoCStops=2105(, string characterSet) + +# Change the separator character in the string setting up an auto-completion list. +# Default is space but can be changed if items contain space. +set void AutoCSetSeparator=2106(int separatorCharacter,) + +# Retrieve the auto-completion list separator character. +get int AutoCGetSeparator=2107(,) + +# Select the item in the auto-completion list that starts with a string. +fun void AutoCSelect=2108(, string text) + +# Should the auto-completion list be cancelled if the user backspaces to a +# position before where the box was created. +set void AutoCSetCancelAtStart=2110(bool cancel,) + +# Retrieve whether auto-completion cancelled by backspacing before start. +get bool AutoCGetCancelAtStart=2111(,) + +# Define a set of characters that when typed will cause the autocompletion to +# choose the selected item. +set void AutoCSetFillUps=2112(, string characterSet) + +# Should a single item auto-completion list automatically choose the item. +set void AutoCSetChooseSingle=2113(bool chooseSingle,) + +# Retrieve whether a single item auto-completion list automatically choose the item. +get bool AutoCGetChooseSingle=2114(,) + +# Set whether case is significant when performing auto-completion searches. +set void AutoCSetIgnoreCase=2115(bool ignoreCase,) + +# Retrieve state of ignore case flag. +get bool AutoCGetIgnoreCase=2116(,) + +# Display a list of strings and send notification when user chooses one. +fun void UserListShow=2117(int listType, string itemList) + +# Set whether or not autocompletion is hidden automatically when nothing matches. +set void AutoCSetAutoHide=2118(bool autoHide,) + +# Retrieve whether or not autocompletion is hidden automatically when nothing matches. +get bool AutoCGetAutoHide=2119(,) + +# Set whether or not autocompletion deletes any word characters +# after the inserted text upon completion. +set void AutoCSetDropRestOfWord=2270(bool dropRestOfWord,) + +# Retrieve whether or not autocompletion deletes any word characters +# after the inserted text upon completion. +get bool AutoCGetDropRestOfWord=2271(,) + +# Register an XPM image for use in autocompletion lists. +fun void RegisterImage=2405(int type, string xpmData) + +# Clear all the registered XPM images. +fun void ClearRegisteredImages=2408(,) + +# Retrieve the auto-completion list type-separator character. +get int AutoCGetTypeSeparator=2285(,) + +# Change the type-separator character in the string setting up an auto-completion list. +# Default is '?' but can be changed if items contain '?'. +set void AutoCSetTypeSeparator=2286(int separatorCharacter,) + +# Set the maximum width, in characters, of auto-completion and user lists. +# Set to 0 to autosize to fit longest item, which is the default. +set void AutoCSetMaxWidth=2208(int characterCount,) + +# Get the maximum width, in characters, of auto-completion and user lists. +get int AutoCGetMaxWidth=2209(,) + +# Set the maximum height, in rows, of auto-completion and user lists. +# The default is 5 rows. +set void AutoCSetMaxHeight=2210(int rowCount,) + +# Set the maximum height, in rows, of auto-completion and user lists. +get int AutoCGetMaxHeight=2211(,) + +# Set the number of spaces used for one level of indentation. +set void SetIndent=2122(int indentSize,) + +# Retrieve indentation size. +get int GetIndent=2123(,) + +# Indentation will only use space characters if useTabs is false, otherwise +# it will use a combination of tabs and spaces. +set void SetUseTabs=2124(bool useTabs,) + +# Retrieve whether tabs will be used in indentation. +get bool GetUseTabs=2125(,) + +# Change the indentation of a line to a number of columns. +set void SetLineIndentation=2126(int line, int indentSize) + +# Retrieve the number of columns that a line is indented. +get int GetLineIndentation=2127(int line,) + +# Retrieve the position before the first non indentation character on a line. +get position GetLineIndentPosition=2128(int line,) + +# Retrieve the column number of a position, taking tab width into account. +get int GetColumn=2129(position pos,) + +# Show or hide the horizontal scroll bar. +set void SetHScrollBar=2130(bool show,) + +# Is the horizontal scroll bar visible? +get bool GetHScrollBar=2131(,) + +# Show or hide indentation guides. +set void SetIndentationGuides=2132(bool show,) + +# Are the indentation guides visible? +get bool GetIndentationGuides=2133(,) + +# Set the highlighted indentation guide column. +# 0 = no highlighted guide. +set void SetHighlightGuide=2134(int column,) + +# Get the highlighted indentation guide column. +get int GetHighlightGuide=2135(,) + +# Get the position after the last visible characters on a line. +get int GetLineEndPosition=2136(int line,) + +# Get the code page used to interpret the bytes of the document as characters. +get int GetCodePage=2137(,) + +# Get the foreground colour of the caret. +get colour GetCaretFore=2138(,) + +# In palette mode? +get bool GetUsePalette=2139(,) + +# In read-only mode? +get bool GetReadOnly=2140(,) + +# Sets the position of the caret. +set void SetCurrentPos=2141(position pos,) + +# Sets the position that starts the selection - this becomes the anchor. +set void SetSelectionStart=2142(position pos,) + +# Returns the position at the start of the selection. +get position GetSelectionStart=2143(,) + +# Sets the position that ends the selection - this becomes the currentPosition. +set void SetSelectionEnd=2144(position pos,) + +# Returns the position at the end of the selection. +get position GetSelectionEnd=2145(,) + +# Sets the print magnification added to the point size of each style for printing. +set void SetPrintMagnification=2146(int magnification,) + +# Returns the print magnification. +get int GetPrintMagnification=2147(,) + +enu PrintOption=SC_PRINT_ +# PrintColourMode - use same colours as screen. +val SC_PRINT_NORMAL=0 +# PrintColourMode - invert the light value of each style for printing. +val SC_PRINT_INVERTLIGHT=1 +# PrintColourMode - force black text on white background for printing. +val SC_PRINT_BLACKONWHITE=2 +# PrintColourMode - text stays coloured, but all background is forced to be white for printing. +val SC_PRINT_COLOURONWHITE=3 +# PrintColourMode - only the default-background is forced to be white for printing. +val SC_PRINT_COLOURONWHITEDEFAULTBG=4 + +# Modify colours when printing for clearer printed text. +set void SetPrintColourMode=2148(int mode,) + +# Returns the print colour mode. +get int GetPrintColourMode=2149(,) + +enu FindOption=SCFIND_ +val SCFIND_WHOLEWORD=2 +val SCFIND_MATCHCASE=4 +val SCFIND_WORDSTART=0x00100000 +val SCFIND_REGEXP=0x00200000 +val SCFIND_POSIX=0x00400000 + +# Find some text in the document. +fun position FindText=2150(int flags, findtext ft) + +# On Windows, will draw the document into a display context such as a printer. +fun position FormatRange=2151(bool draw, formatrange fr) + +# Retrieve the display line at the top of the display. +get int GetFirstVisibleLine=2152(,) + +# Retrieve the contents of a line. +# Returns the length of the line. +fun int GetLine=2153(int line, stringresult text) + +# Returns the number of lines in the document. There is always at least one. +get int GetLineCount=2154(,) + +# Sets the size in pixels of the left margin. +set void SetMarginLeft=2155(, int pixelWidth) + +# Returns the size in pixels of the left margin. +get int GetMarginLeft=2156(,) + +# Sets the size in pixels of the right margin. +set void SetMarginRight=2157(, int pixelWidth) + +# Returns the size in pixels of the right margin. +get int GetMarginRight=2158(,) + +# Is the document different from when it was last saved? +get bool GetModify=2159(,) + +# Select a range of text. +fun void SetSel=2160(position start, position end) + +# Retrieve the selected text. +# Return the length of the text. +fun int GetSelText=2161(, stringresult text) + +# Retrieve a range of text. +# Return the length of the text. +fun int GetTextRange=2162(, textrange tr) + +# Draw the selection in normal style or with selection highlighted. +fun void HideSelection=2163(bool normal,) + +# Retrieve the x value of the point in the window where a position is displayed. +fun int PointXFromPosition=2164(, position pos) + +# Retrieve the y value of the point in the window where a position is displayed. +fun int PointYFromPosition=2165(, position pos) + +# Retrieve the line containing a position. +fun int LineFromPosition=2166(position pos,) + +# Retrieve the position at the start of a line. +fun position PositionFromLine=2167(int line,) + +# Scroll horizontally and vertically. +fun void LineScroll=2168(int columns, int lines) + +# Ensure the caret is visible. +fun void ScrollCaret=2169(,) + +# Replace the selected text with the argument text. +fun void ReplaceSel=2170(, string text) + +# Set to read only or read write. +set void SetReadOnly=2171(bool readOnly,) + +# Null operation. +fun void Null=2172(,) + +# Will a paste succeed? +fun bool CanPaste=2173(,) + +# Are there any undoable actions in the undo history? +fun bool CanUndo=2174(,) + +# Delete the undo history. +fun void EmptyUndoBuffer=2175(,) + +# Undo one action in the undo history. +fun void Undo=2176(,) + +# Cut the selection to the clipboard. +fun void Cut=2177(,) + +# Copy the selection to the clipboard. +fun void Copy=2178(,) + +# Paste the contents of the clipboard into the document replacing the selection. +fun void Paste=2179(,) + +# Clear the selection. +fun void Clear=2180(,) + +# Replace the contents of the document with the argument text. +fun void SetText=2181(, string text) + +# Retrieve all the text in the document. +# Returns number of characters retrieved. +fun int GetText=2182(int length, stringresult text) + +# Retrieve the number of characters in the document. +get int GetTextLength=2183(,) + +# Retrieve a pointer to a function that processes messages for this Scintilla. +get int GetDirectFunction=2184(,) + +# Retrieve a pointer value to use as the first argument when calling +# the function returned by GetDirectFunction. +get int GetDirectPointer=2185(,) + +# Set to overtype (true) or insert mode. +set void SetOvertype=2186(bool overtype,) + +# Returns true if overtype mode is active otherwise false is returned. +get bool GetOvertype=2187(,) + +# Set the width of the insert mode caret. +set void SetCaretWidth=2188(int pixelWidth,) + +# Returns the width of the insert mode caret. +get int GetCaretWidth=2189(,) + +# Sets the position that starts the target which is used for updating the +# document without affecting the scroll position. +set void SetTargetStart=2190(position pos,) + +# Get the position that starts the target. +get position GetTargetStart=2191(,) + +# Sets the position that ends the target which is used for updating the +# document without affecting the scroll position. +set void SetTargetEnd=2192(position pos,) + +# Get the position that ends the target. +get position GetTargetEnd=2193(,) + +# Replace the target text with the argument text. +# Text is counted so it can contain NULs. +# Returns the length of the replacement text. +fun int ReplaceTarget=2194(int length, string text) + +# Replace the target text with the argument text after \d processing. +# Text is counted so it can contain NULs. +# Looks for \d where d is between 1 and 9 and replaces these with the strings +# matched in the last search operation which were surrounded by \( and \). +# Returns the length of the replacement text including any change +# caused by processing the \d patterns. +fun int ReplaceTargetRE=2195(int length, string text) + +# Search for a counted string in the target and set the target to the found +# range. Text is counted so it can contain NULs. +# Returns length of range or -1 for failure in which case target is not moved. +fun int SearchInTarget=2197(int length, string text) + +# Set the search flags used by SearchInTarget. +set void SetSearchFlags=2198(int flags,) + +# Get the search flags used by SearchInTarget. +get int GetSearchFlags=2199(,) + +# Show a call tip containing a definition near position pos. +fun void CallTipShow=2200(position pos, string definition) + +# Remove the call tip from the screen. +fun void CallTipCancel=2201(,) + +# Is there an active call tip? +fun bool CallTipActive=2202(,) + +# Retrieve the position where the caret was before displaying the call tip. +fun position CallTipPosStart=2203(,) + +# Highlight a segment of the definition. +fun void CallTipSetHlt=2204(int start, int end) + +# Set the background colour for the call tip. +set void CallTipSetBack=2205(colour back,) + +# Set the foreground colour for the call tip. +set void CallTipSetFore=2206(colour fore,) + +# Set the foreground colour for the highlighted part of the call tip. +set void CallTipSetForeHlt=2207(colour fore,) + +# Enable use of STYLE_CALLTIP and set call tip tab size in pixels. +set void CallTipUseStyle=2212(int tabSize,) + +# Find the display line of a document line taking hidden lines into account. +fun int VisibleFromDocLine=2220(int line,) + +# Find the document line of a display line taking hidden lines into account. +fun int DocLineFromVisible=2221(int lineDisplay,) + +# The number of display lines needed to wrap a document line +fun int WrapCount=2235(int line,) + +enu FoldLevel=SC_FOLDLEVEL +val SC_FOLDLEVELBASE=0x400 +val SC_FOLDLEVELWHITEFLAG=0x1000 +val SC_FOLDLEVELHEADERFLAG=0x2000 +val SC_FOLDLEVELBOXHEADERFLAG=0x4000 +val SC_FOLDLEVELBOXFOOTERFLAG=0x8000 +val SC_FOLDLEVELCONTRACTED=0x10000 +val SC_FOLDLEVELUNINDENT=0x20000 +val SC_FOLDLEVELNUMBERMASK=0x0FFF + +# Set the fold level of a line. +# This encodes an integer level along with flags indicating whether the +# line is a header and whether it is effectively white space. +set void SetFoldLevel=2222(int line, int level) + +# Retrieve the fold level of a line. +get int GetFoldLevel=2223(int line,) + +# Find the last child line of a header line. +get int GetLastChild=2224(int line, int level) + +# Find the parent line of a child line. +get int GetFoldParent=2225(int line,) + +# Make a range of lines visible. +fun void ShowLines=2226(int lineStart, int lineEnd) + +# Make a range of lines invisible. +fun void HideLines=2227(int lineStart, int lineEnd) + +# Is a line visible? +get bool GetLineVisible=2228(int line,) + +# Show the children of a header line. +set void SetFoldExpanded=2229(int line, bool expanded) + +# Is a header line expanded? +get bool GetFoldExpanded=2230(int line,) + +# Switch a header line between expanded and contracted. +fun void ToggleFold=2231(int line,) + +# Ensure a particular line is visible by expanding any header line hiding it. +fun void EnsureVisible=2232(int line,) + +enu FoldFlag=SC_FOLDFLAG_ +val SC_FOLDFLAG_LINEBEFORE_EXPANDED=0x0002 +val SC_FOLDFLAG_LINEBEFORE_CONTRACTED=0x0004 +val SC_FOLDFLAG_LINEAFTER_EXPANDED=0x0008 +val SC_FOLDFLAG_LINEAFTER_CONTRACTED=0x0010 +val SC_FOLDFLAG_LEVELNUMBERS=0x0040 +val SC_FOLDFLAG_BOX=0x0001 + +# Set some style options for folding. +fun void SetFoldFlags=2233(int flags,) + +# Ensure a particular line is visible by expanding any header line hiding it. +# Use the currently set visibility policy to determine which range to display. +fun void EnsureVisibleEnforcePolicy=2234(int line,) + +# Sets whether a tab pressed when caret is within indentation indents. +set void SetTabIndents=2260(bool tabIndents,) + +# Does a tab pressed when caret is within indentation indent? +get bool GetTabIndents=2261(,) + +# Sets whether a backspace pressed when caret is within indentation unindents. +set void SetBackSpaceUnIndents=2262(bool bsUnIndents,) + +# Does a backspace pressed when caret is within indentation unindent? +get bool GetBackSpaceUnIndents=2263(,) + +val SC_TIME_FOREVER=10000000 + +# Sets the time the mouse must sit still to generate a mouse dwell event. +set void SetMouseDwellTime=2264(int periodMilliseconds,) + +# Retrieve the time the mouse must sit still to generate a mouse dwell event. +get int GetMouseDwellTime=2265(,) + +# Get position of start of word. +fun int WordStartPosition=2266(position pos, bool onlyWordCharacters) + +# Get position of end of word. +fun int WordEndPosition=2267(position pos, bool onlyWordCharacters) + +enu Wrap=SC_WRAP_ +val SC_WRAP_NONE=0 +val SC_WRAP_WORD=1 +val SC_WRAP_CHAR=2 + +# Sets whether text is word wrapped. +set void SetWrapMode=2268(int mode,) + +# Retrieve whether text is word wrapped. +get int GetWrapMode=2269(,) + +enu WrapVisualFlag=SC_WRAPVISUALFLAG_ +val SC_WRAPVISUALFLAG_NONE=0x0000 +val SC_WRAPVISUALFLAG_END=0x0001 +val SC_WRAPVISUALFLAG_START=0x0002 + +# Set the display mode of visual flags for wrapped lines. +set void SetWrapVisualFlags=2460(int wrapVisualFlags,) + +# Retrive the display mode of visual flags for wrapped lines. +get int GetWrapVisualFlags=2461(,) + +enu WrapVisualLocation=SC_WRAPVISUALFLAGLOC_ +val SC_WRAPVISUALFLAGLOC_DEFAULT=0x0000 +val SC_WRAPVISUALFLAGLOC_END_BY_TEXT=0x0001 +val SC_WRAPVISUALFLAGLOC_START_BY_TEXT=0x0002 + +# Set the location of visual flags for wrapped lines. +set void SetWrapVisualFlagsLocation=2462(int wrapVisualFlagsLocation,) + +# Retrive the location of visual flags for wrapped lines. +get int GetWrapVisualFlagsLocation=2463(,) + +# Set the start indent for wrapped lines. +set void SetWrapStartIndent=2464(int indent,) + +# Retrive the start indent for wrapped lines. +get int GetWrapStartIndent=2465(,) + +enu LineCache=SC_CACHE_ +val SC_CACHE_NONE=0 +val SC_CACHE_CARET=1 +val SC_CACHE_PAGE=2 +val SC_CACHE_DOCUMENT=3 + +# Sets the degree of caching of layout information. +set void SetLayoutCache=2272(int mode,) + +# Retrieve the degree of caching of layout information. +get int GetLayoutCache=2273(,) + +# Sets the document width assumed for scrolling. +set void SetScrollWidth=2274(int pixelWidth,) + +# Retrieve the document width assumed for scrolling. +get int GetScrollWidth=2275(,) + +# Measure the pixel width of some text in a particular style. +# NUL terminated text argument. +# Does not handle tab or control characters. +fun int TextWidth=2276(int style, string text) + +# Sets the scroll range so that maximum scroll position has +# the last line at the bottom of the view (default). +# Setting this to false allows scrolling one page below the last line. +set void SetEndAtLastLine=2277(bool endAtLastLine,) + +# Retrieve whether the maximum scroll position has the last +# line at the bottom of the view. +get bool GetEndAtLastLine=2278(,) + +# Retrieve the height of a particular line of text in pixels. +fun int TextHeight=2279(int line,) + +# Show or hide the vertical scroll bar. +set void SetVScrollBar=2280(bool show,) + +# Is the vertical scroll bar visible? +get bool GetVScrollBar=2281(,) + +# Append a string to the end of the document without changing the selection. +fun void AppendText=2282(int length, string text) + +# Is drawing done in two phases with backgrounds drawn before faoregrounds? +get bool GetTwoPhaseDraw=2283(,) + +# In twoPhaseDraw mode, drawing is performed in two phases, first the background +# and then the foreground. This avoids chopping off characters that overlap the next run. +set void SetTwoPhaseDraw=2284(bool twoPhase,) + +# Make the target range start and end be the same as the selection range start and end. +fun void TargetFromSelection=2287(,) + +# Join the lines in the target. +fun void LinesJoin=2288(,) + +# Split the lines in the target into lines that are less wide than pixelWidth +# where possible. +fun void LinesSplit=2289(int pixelWidth,) + +# Set the colours used as a chequerboard pattern in the fold margin +fun void SetFoldMarginColour=2290(bool useSetting, colour back) +fun void SetFoldMarginHiColour=2291(bool useSetting, colour fore) + +## New messages go here + +## Start of key messages +# Move caret down one line. +fun void LineDown=2300(,) + +# Move caret down one line extending selection to new caret position. +fun void LineDownExtend=2301(,) + +# Move caret up one line. +fun void LineUp=2302(,) + +# Move caret up one line extending selection to new caret position. +fun void LineUpExtend=2303(,) + +# Move caret left one character. +fun void CharLeft=2304(,) + +# Move caret left one character extending selection to new caret position. +fun void CharLeftExtend=2305(,) + +# Move caret right one character. +fun void CharRight=2306(,) + +# Move caret right one character extending selection to new caret position. +fun void CharRightExtend=2307(,) + +# Move caret left one word. +fun void WordLeft=2308(,) + +# Move caret left one word extending selection to new caret position. +fun void WordLeftExtend=2309(,) + +# Move caret right one word. +fun void WordRight=2310(,) + +# Move caret right one word extending selection to new caret position. +fun void WordRightExtend=2311(,) + +# Move caret to first position on line. +fun void Home=2312(,) + +# Move caret to first position on line extending selection to new caret position. +fun void HomeExtend=2313(,) + +# Move caret to last position on line. +fun void LineEnd=2314(,) + +# Move caret to last position on line extending selection to new caret position. +fun void LineEndExtend=2315(,) + +# Move caret to first position in document. +fun void DocumentStart=2316(,) + +# Move caret to first position in document extending selection to new caret position. +fun void DocumentStartExtend=2317(,) + +# Move caret to last position in document. +fun void DocumentEnd=2318(,) + +# Move caret to last position in document extending selection to new caret position. +fun void DocumentEndExtend=2319(,) + +# Move caret one page up. +fun void PageUp=2320(,) + +# Move caret one page up extending selection to new caret position. +fun void PageUpExtend=2321(,) + +# Move caret one page down. +fun void PageDown=2322(,) + +# Move caret one page down extending selection to new caret position. +fun void PageDownExtend=2323(,) + +# Switch from insert to overtype mode or the reverse. +fun void EditToggleOvertype=2324(,) + +# Cancel any modes such as call tip or auto-completion list display. +fun void Cancel=2325(,) + +# Delete the selection or if no selection, the character before the caret. +fun void DeleteBack=2326(,) + +# If selection is empty or all on one line replace the selection with a tab character. +# If more than one line selected, indent the lines. +fun void Tab=2327(,) + +# Dedent the selected lines. +fun void BackTab=2328(,) + +# Insert a new line, may use a CRLF, CR or LF depending on EOL mode. +fun void NewLine=2329(,) + +# Insert a Form Feed character. +fun void FormFeed=2330(,) + +# Move caret to before first visible character on line. +# If already there move to first character on line. +fun void VCHome=2331(,) + +# Like VCHome but extending selection to new caret position. +fun void VCHomeExtend=2332(,) + +# Magnify the displayed text by increasing the sizes by 1 point. +fun void ZoomIn=2333(,) + +# Make the displayed text smaller by decreasing the sizes by 1 point. +fun void ZoomOut=2334(,) + +# Delete the word to the left of the caret. +fun void DelWordLeft=2335(,) + +# Delete the word to the right of the caret. +fun void DelWordRight=2336(,) + +# Cut the line containing the caret. +fun void LineCut=2337(,) + +# Delete the line containing the caret. +fun void LineDelete=2338(,) + +# Switch the current line with the previous. +fun void LineTranspose=2339(,) + +# Duplicate the current line. +fun void LineDuplicate=2404(,) + +# Transform the selection to lower case. +fun void LowerCase=2340(,) + +# Transform the selection to upper case. +fun void UpperCase=2341(,) + +# Scroll the document down, keeping the caret visible. +fun void LineScrollDown=2342(,) + +# Scroll the document up, keeping the caret visible. +fun void LineScrollUp=2343(,) + +# Delete the selection or if no selection, the character before the caret. +# Will not delete the character before at the start of a line. +fun void DeleteBackNotLine=2344(,) + +# Move caret to first position on display line. +fun void HomeDisplay=2345(,) + +# Move caret to first position on display line extending selection to +# new caret position. +fun void HomeDisplayExtend=2346(,) + +# Move caret to last position on display line. +fun void LineEndDisplay=2347(,) + +# Move caret to last position on display line extending selection to new +# caret position. +fun void LineEndDisplayExtend=2348(,) + +# These are like their namesakes Home(Extend)?, LineEnd(Extend)?, VCHome(Extend)? +# except they behave differently when word-wrap is enabled: +# They go first to the start / end of the display line, like (Home|LineEnd)Display +# The difference is that, the cursor is already at the point, it goes on to the start +# or end of the document line, as appropriate for (Home|LineEnd|VCHome)(Extend)?. + +fun void HomeWrap=2349(,) +fun void HomeWrapExtend=2450(,) +fun void LineEndWrap=2451(,) +fun void LineEndWrapExtend=2452(,) +fun void VCHomeWrap=2453(,) +fun void VCHomeWrapExtend=2454(,) + +# Copy the line containing the caret. +fun void LineCopy=2455(,) + +# Move the caret inside current view if it's not there already. +fun void MoveCaretInsideView=2401(,) + +# How many characters are on a line, not including end of line characters? +fun int LineLength=2350(int line,) + +# Highlight the characters at two positions. +fun void BraceHighlight=2351(position pos1, position pos2) + +# Highlight the character at a position indicating there is no matching brace. +fun void BraceBadLight=2352(position pos,) + +# Find the position of a matching brace or INVALID_POSITION if no match. +fun position BraceMatch=2353(position pos,) + +# Are the end of line characters visible? +get bool GetViewEOL=2355(,) + +# Make the end of line characters visible or invisible. +set void SetViewEOL=2356(bool visible,) + +# Retrieve a pointer to the document object. +get int GetDocPointer=2357(,) + +# Change the document object used. +set void SetDocPointer=2358(, int pointer) + +# Set which document modification events are sent to the container. +set void SetModEventMask=2359(int mask,) + +enu EdgeVisualStyle=EDGE_ +val EDGE_NONE=0 +val EDGE_LINE=1 +val EDGE_BACKGROUND=2 + +# Retrieve the column number which text should be kept within. +get int GetEdgeColumn=2360(,) + +# Set the column number of the edge. +# If text goes past the edge then it is highlighted. +set void SetEdgeColumn=2361(int column,) + +# Retrieve the edge highlight mode. +get int GetEdgeMode=2362(,) + +# The edge may be displayed by a line (EDGE_LINE) or by highlighting text that +# goes beyond it (EDGE_BACKGROUND) or not displayed at all (EDGE_NONE). +set void SetEdgeMode=2363(int mode,) + +# Retrieve the colour used in edge indication. +get colour GetEdgeColour=2364(,) + +# Change the colour used in edge indication. +set void SetEdgeColour=2365(colour edgeColour,) + +# Sets the current caret position to be the search anchor. +fun void SearchAnchor=2366(,) + +# Find some text starting at the search anchor. +# Does not ensure the selection is visible. +fun int SearchNext=2367(int flags, string text) + +# Find some text starting at the search anchor and moving backwards. +# Does not ensure the selection is visible. +fun int SearchPrev=2368(int flags, string text) + +# Retrieves the number of lines completely visible. +get int LinesOnScreen=2370(,) + +# Set whether a pop up menu is displayed automatically when the user presses +# the wrong mouse button. +fun void UsePopUp=2371(bool allowPopUp,) + +# Is the selection rectangular? The alternative is the more common stream selection. +get bool SelectionIsRectangle=2372(,) + +# Set the zoom level. This number of points is added to the size of all fonts. +# It may be positive to magnify or negative to reduce. +set void SetZoom=2373(int zoom,) +# Retrieve the zoom level. +get int GetZoom=2374(,) + +# Create a new document object. +# Starts with reference count of 1 and not selected into editor. +fun int CreateDocument=2375(,) +# Extend life of document. +fun void AddRefDocument=2376(, int doc) +# Release a reference to the document, deleting document if it fades to black. +fun void ReleaseDocument=2377(, int doc) + +# Get which document modification events are sent to the container. +get int GetModEventMask=2378(,) + +# Change internal focus flag. +set void SetFocus=2380(bool focus,) +# Get internal focus flag. +get bool GetFocus=2381(,) + +# Change error status - 0 = OK. +set void SetStatus=2382(int statusCode,) +# Get error status. +get int GetStatus=2383(,) + +# Set whether the mouse is captured when its button is pressed. +set void SetMouseDownCaptures=2384(bool captures,) +# Get whether mouse gets captured. +get bool GetMouseDownCaptures=2385(,) + +enu CursorShape=SC_CURSOR +val SC_CURSORNORMAL=-1 +val SC_CURSORWAIT=4 +# Sets the cursor to one of the SC_CURSOR* values. +set void SetCursor=2386(int cursorType,) +# Get cursor type. +get int GetCursor=2387(,) + +# Change the way control characters are displayed: +# If symbol is < 32, keep the drawn way, else, use the given character. +set void SetControlCharSymbol=2388(int symbol,) +# Get the way control characters are displayed. +get int GetControlCharSymbol=2389(,) + +# Move to the previous change in capitalisation. +fun void WordPartLeft=2390(,) +# Move to the previous change in capitalisation extending selection +# to new caret position. +fun void WordPartLeftExtend=2391(,) +# Move to the change next in capitalisation. +fun void WordPartRight=2392(,) +# Move to the next change in capitalisation extending selection +# to new caret position. +fun void WordPartRightExtend=2393(,) + +# Constants for use with SetVisiblePolicy, similar to SetCaretPolicy. +val VISIBLE_SLOP=0x01 +val VISIBLE_STRICT=0x04 +# Set the way the display area is determined when a particular line +# is to be moved to by Find, FindNext, GotoLine, etc. +fun void SetVisiblePolicy=2394(int visiblePolicy, int visibleSlop) + +# Delete back from the current position to the start of the line. +fun void DelLineLeft=2395(,) + +# Delete forwards from the current position to the end of the line. +fun void DelLineRight=2396(,) + +# Get and Set the xOffset (ie, horizonal scroll position). +set void SetXOffset=2397(int newOffset,) +get int GetXOffset=2398(,) + +# Set the last x chosen value to be the caret x position. +fun void ChooseCaretX=2399(,) + +# Set the focus to this Scintilla widget. +fun void GrabFocus=2400(,) + +enu CaretPolicy = CARET_ +# Caret policy, used by SetXCaretPolicy and SetYCaretPolicy. +# If CARET_SLOP is set, we can define a slop value: caretSlop. +# This value defines an unwanted zone (UZ) where the caret is... unwanted. +# This zone is defined as a number of pixels near the vertical margins, +# and as a number of lines near the horizontal margins. +# By keeping the caret away from the edges, it is seen within its context, +# so it is likely that the identifier that the caret is on can be completely seen, +# and that the current line is seen with some of the lines following it which are +# often dependent on that line. +val CARET_SLOP=0x01 +# If CARET_STRICT is set, the policy is enforced... strictly. +# The caret is centred on the display if slop is not set, +# and cannot go in the UZ if slop is set. +val CARET_STRICT=0x04 +# If CARET_JUMPS is set, the display is moved more energetically +# so the caret can move in the same direction longer before the policy is applied again. +val CARET_JUMPS=0x10 +# If CARET_EVEN is not set, instead of having symmetrical UZs, +# the left and bottom UZs are extended up to right and top UZs respectively. +# This way, we favour the displaying of useful information: the begining of lines, +# where most code reside, and the lines after the caret, eg. the body of a function. +val CARET_EVEN=0x08 + +# Set the way the caret is kept visible when going sideway. +# The exclusion zone is given in pixels. +fun void SetXCaretPolicy=2402(int caretPolicy, int caretSlop) + +# Set the way the line the caret is on is kept visible. +# The exclusion zone is given in lines. +fun void SetYCaretPolicy=2403(int caretPolicy, int caretSlop) + +# Set printing to line wrapped (SC_WRAP_WORD) or not line wrapped (SC_WRAP_NONE). +set void SetPrintWrapMode=2406(int mode,) + +# Is printing line wrapped? +get int GetPrintWrapMode=2407(,) + +# Set a fore colour for active hotspots. +set void SetHotspotActiveFore=2410(bool useSetting, colour fore) + +# Set a back colour for active hotspots. +set void SetHotspotActiveBack=2411(bool useSetting, colour back) + +# Enable / Disable underlining active hotspots. +set void SetHotspotActiveUnderline=2412(bool underline,) + +# Limit hotspots to single line so hotspots on two lines don't merge. +set void SetHotspotSingleLine=2421(bool singleLine,) + +# Move caret between paragraphs (delimited by empty lines). +fun void ParaDown=2413(,) +fun void ParaDownExtend=2414(,) +fun void ParaUp=2415(,) +fun void ParaUpExtend=2416(,) + +# Given a valid document position, return the previous position taking code +# page into account. Returns 0 if passed 0. +fun position PositionBefore=2417(position pos,) + +# Given a valid document position, return the next position taking code +# page into account. Maximum value returned is the last position in the document. +fun position PositionAfter=2418(position pos,) + +# Copy a range of text to the clipboard. Positions are clipped into the document. +fun void CopyRange=2419(position start, position end) + +# Copy argument text to the clipboard. +fun void CopyText=2420(int length, string text) + +enu SelectionMode=SC_SEL_ +val SC_SEL_STREAM=0 +val SC_SEL_RECTANGLE=1 +val SC_SEL_LINES=2 + +# Set the selection mode to stream (SC_SEL_STREAM) or rectangular (SC_SEL_RECTANGLE) or +# by lines (SC_SEL_LINES). +set void SetSelectionMode=2422(int mode,) + +# Get the mode of the current selection. +get int GetSelectionMode=2423(,) + +# Retrieve the position of the start of the selection at the given line (INVALID_POSITION if no selection on this line). +fun position GetLineSelStartPosition=2424(int line,) + +# Retrieve the position of the end of the selection at the given line (INVALID_POSITION if no selection on this line). +fun position GetLineSelEndPosition=2425(int line,) + +## RectExtended rectangular selection moves +# Move caret down one line, extending rectangular selection to new caret position. +fun void LineDownRectExtend=2426(,) + +# Move caret up one line, extending rectangular selection to new caret position. +fun void LineUpRectExtend=2427(,) + +# Move caret left one character, extending rectangular selection to new caret position. +fun void CharLeftRectExtend=2428(,) + +# Move caret right one character, extending rectangular selection to new caret position. +fun void CharRightRectExtend=2429(,) + +# Move caret to first position on line, extending rectangular selection to new caret position. +fun void HomeRectExtend=2430(,) + +# Move caret to before first visible character on line. +# If already there move to first character on line. +# In either case, extend rectangular selection to new caret position. +fun void VCHomeRectExtend=2431(,) + +# Move caret to last position on line, extending rectangular selection to new caret position. +fun void LineEndRectExtend=2432(,) + +# Move caret one page up, extending rectangular selection to new caret position. +fun void PageUpRectExtend=2433(,) + +# Move caret one page down, extending rectangular selection to new caret position. +fun void PageDownRectExtend=2434(,) + + +# Move caret to top of page, or one page up if already at top of page. +fun void StutteredPageUp=2435(,) + +# Move caret to top of page, or one page up if already at top of page, extending selection to new caret position. +fun void StutteredPageUpExtend=2436(,) + +# Move caret to bottom of page, or one page down if already at bottom of page. +fun void StutteredPageDown=2437(,) + +# Move caret to bottom of page, or one page down if already at bottom of page, extending selection to new caret position. +fun void StutteredPageDownExtend=2438(,) + + +# Move caret left one word, position cursor at end of word. +fun void WordLeftEnd=2439(,) + +# Move caret left one word, position cursor at end of word, extending selection to new caret position. +fun void WordLeftEndExtend=2440(,) + +# Move caret right one word, position cursor at end of word. +fun void WordRightEnd=2441(,) + +# Move caret right one word, position cursor at end of word, extending selection to new caret position. +fun void WordRightEndExtend=2442(,) + +# Set the set of characters making up whitespace for when moving or selecting by word. +# Should be called after SetWordChars. +set void SetWhitespaceChars=2443(, string characters) + +# Reset the set of characters for whitespace and word characters to the defaults. +fun void SetCharsDefault=2444(,) + +# Get currently selected item position in the auto-completion list +fun int AutoCGetCurrent=2445(,) + +# Enlarge the document to a particular size of text bytes. +fun void Allocate=2446(int bytes,) + +# Returns the target converted to UTF8. +# Return the length in bytes. +fun int TargetAsUTF8=2447(, stringresult s) + +# Set the length of the utf8 argument for calling EncodedFromUTF8. +# Set to -1 and the string will be measured to the first nul. +fun void SetLengthForEncode=2448(int bytes,) + +# Translates a UTF8 string into the document encoding. +# Return the length of the result in bytes. +# On error return 0. +fun int EncodedFromUTF8=2449(string utf8, stringresult encoded) + +# Find the position of a column on a line taking into account tabs and +# multi-byte characters. If beyond end of line, return line end position. +fun int FindColumn=2456(int line, int column) + +# Can the caret preferred x position only be changed by explicit movement commands? +get bool GetCaretSticky=2457(,) + +# Stop the caret preferred x position changing when the user types. +set void SetCaretSticky=2458(bool useCaretStickyBehaviour,) + +# Switch between sticky and non-sticky: meant to be bound to a key. +fun void ToggleCaretSticky=2459(,) + +# Enable/Disable convert-on-paste for line endings +set void SetPasteConvertEndings=2467(bool convert,) + +# Get convert-on-paste setting +get bool GetPasteConvertEndings=2468(,) + +# Duplicate the selection. If selection empty duplicate the line containing the caret. +fun void SelectionDuplicate=2469(,) + +val SC_ALPHA_TRANSPARENT=0 +val SC_ALPHA_OPAQUE=255 +val SC_ALPHA_NOALPHA=256 + +# Set background alpha of the caret line. +set void SetCaretLineBackAlpha=2470(int alpha,) + +# Get the background alpha of the caret line. +get int GetCaretLineBackAlpha=2471(,) + +# Start notifying the container of all key presses and commands. +fun void StartRecord=3001(,) + +# Stop notifying the container of all key presses and commands. +fun void StopRecord=3002(,) + +# Set the lexing language of the document. +set void SetLexer=4001(int lexer,) + +# Retrieve the lexing language of the document. +get int GetLexer=4002(,) + +# Colourise a segment of the document using the current lexing language. +fun void Colourise=4003(position start, position end) + +# Set up a value that may be used by a lexer for some optional feature. +set void SetProperty=4004(string key, string value) + +# Maximum value of keywordSet parameter of SetKeyWords. +val KEYWORDSET_MAX=8 + +# Set up the key words used by the lexer. +set void SetKeyWords=4005(int keywordSet, string keyWords) + +# Set the lexing language of the document based on string name. +set void SetLexerLanguage=4006(, string language) + +# Load a lexer library (dll / so). +fun void LoadLexerLibrary=4007(, string path) + +# Retrieve a "property" value previously set with SetProperty. +fun int GetProperty=4008(string key, stringresult buf) + +# Retrieve a "property" value previously set with SetProperty, +# with "$()" variable replacement on returned buffer. +fun int GetPropertyExpanded=4009(string key, stringresult buf) + +# Retrieve a "property" value previously set with SetProperty, +# interpreted as an int AFTER any "$()" variable replacement. +get int GetPropertyInt=4010(string key,) + +# Retrieve the number of bits the current lexer needs for styling. +get int GetStyleBitsNeeded=4011(,) + +# Notifications +# Type of modification and the action which caused the modification. +# These are defined as a bit mask to make it easy to specify which notifications are wanted. +# One bit is set from each of SC_MOD_* and SC_PERFORMED_*. +enu ModificationFlags=SC_MOD_ SC_PERFORMED_ SC_LAST +val SC_MOD_INSERTTEXT=0x1 +val SC_MOD_DELETETEXT=0x2 +val SC_MOD_CHANGESTYLE=0x4 +val SC_MOD_CHANGEFOLD=0x8 +val SC_PERFORMED_USER=0x10 +val SC_PERFORMED_UNDO=0x20 +val SC_PERFORMED_REDO=0x40 +val SC_MULTISTEPUNDOREDO=0x80 +val SC_LASTSTEPINUNDOREDO=0x100 +val SC_MOD_CHANGEMARKER=0x200 +val SC_MOD_BEFOREINSERT=0x400 +val SC_MOD_BEFOREDELETE=0x800 +val SC_MULTILINEUNDOREDO=0x1000 +val SC_MODEVENTMASKALL=0x1FFF + +# For compatibility, these go through the COMMAND notification rather than NOTIFY +# and should have had exactly the same values as the EN_* constants. +# Unfortunately the SETFOCUS and KILLFOCUS are flipped over from EN_* +# As clients depend on these constants, this will not be changed. +val SCEN_CHANGE=768 +val SCEN_SETFOCUS=512 +val SCEN_KILLFOCUS=256 + +# Symbolic key codes and modifier flags. +# ASCII and other printable characters below 256. +# Extended keys above 300. + +enu Keys=SCK_ +val SCK_DOWN=300 +val SCK_UP=301 +val SCK_LEFT=302 +val SCK_RIGHT=303 +val SCK_HOME=304 +val SCK_END=305 +val SCK_PRIOR=306 +val SCK_NEXT=307 +val SCK_DELETE=308 +val SCK_INSERT=309 +val SCK_ESCAPE=7 +val SCK_BACK=8 +val SCK_TAB=9 +val SCK_RETURN=13 +val SCK_ADD=310 +val SCK_SUBTRACT=311 +val SCK_DIVIDE=312 + +enu KeyMod=SCMOD_ +val SCMOD_NORM=0 +val SCMOD_SHIFT=1 +val SCMOD_CTRL=2 +val SCMOD_ALT=4 + +################################################ +# For SciLexer.h +enu Lexer=SCLEX_ +val SCLEX_CONTAINER=0 +val SCLEX_NULL=1 +val SCLEX_PYTHON=2 +val SCLEX_CPP=3 +val SCLEX_HTML=4 +val SCLEX_XML=5 +val SCLEX_PERL=6 +val SCLEX_SQL=7 +val SCLEX_VB=8 +val SCLEX_PROPERTIES=9 +val SCLEX_ERRORLIST=10 +val SCLEX_MAKEFILE=11 +val SCLEX_BATCH=12 +val SCLEX_XCODE=13 +val SCLEX_LATEX=14 +val SCLEX_LUA=15 +val SCLEX_DIFF=16 +val SCLEX_CONF=17 +val SCLEX_PASCAL=18 +val SCLEX_AVE=19 +val SCLEX_ADA=20 +val SCLEX_LISP=21 +val SCLEX_RUBY=22 +val SCLEX_EIFFEL=23 +val SCLEX_EIFFELKW=24 +val SCLEX_TCL=25 +val SCLEX_NNCRONTAB=26 +val SCLEX_BULLANT=27 +val SCLEX_VBSCRIPT=28 +val SCLEX_BAAN=31 +val SCLEX_MATLAB=32 +val SCLEX_SCRIPTOL=33 +val SCLEX_ASM=34 +val SCLEX_CPPNOCASE=35 +val SCLEX_FORTRAN=36 +val SCLEX_F77=37 +val SCLEX_CSS=38 +val SCLEX_POV=39 +val SCLEX_LOUT=40 +val SCLEX_ESCRIPT=41 +val SCLEX_PS=42 +val SCLEX_NSIS=43 +val SCLEX_MMIXAL=44 +val SCLEX_CLW=45 +val SCLEX_CLWNOCASE=46 +val SCLEX_LOT=47 +val SCLEX_YAML=48 +val SCLEX_TEX=49 +val SCLEX_METAPOST=50 +val SCLEX_POWERBASIC=51 +val SCLEX_FORTH=52 +val SCLEX_ERLANG=53 +val SCLEX_OCTAVE=54 +val SCLEX_MSSQL=55 +val SCLEX_VERILOG=56 +val SCLEX_KIX=57 +val SCLEX_GUI4CLI=58 +val SCLEX_SPECMAN=59 +val SCLEX_AU3=60 +val SCLEX_APDL=61 +val SCLEX_BASH=62 +val SCLEX_ASN1=63 +val SCLEX_VHDL=64 +val SCLEX_CAML=65 +val SCLEX_BLITZBASIC=66 +val SCLEX_PUREBASIC=67 +val SCLEX_HASKELL=68 +val SCLEX_PHPSCRIPT=69 +val SCLEX_TADS3=70 +val SCLEX_REBOL=71 +val SCLEX_SMALLTALK=72 +val SCLEX_FLAGSHIP=73 +val SCLEX_CSOUND=74 +val SCLEX_FREEBASIC=75 +val SCLEX_INNOSETUP=76 +val SCLEX_OPAL=77 +val SCLEX_SPICE=78 + +# When a lexer specifies its language as SCLEX_AUTOMATIC it receives a +# value assigned in sequence from SCLEX_AUTOMATIC+1. +val SCLEX_AUTOMATIC=1000 +# Lexical states for SCLEX_PYTHON +lex Python=SCLEX_PYTHON SCE_P_ +val SCE_P_DEFAULT=0 +val SCE_P_COMMENTLINE=1 +val SCE_P_NUMBER=2 +val SCE_P_STRING=3 +val SCE_P_CHARACTER=4 +val SCE_P_WORD=5 +val SCE_P_TRIPLE=6 +val SCE_P_TRIPLEDOUBLE=7 +val SCE_P_CLASSNAME=8 +val SCE_P_DEFNAME=9 +val SCE_P_OPERATOR=10 +val SCE_P_IDENTIFIER=11 +val SCE_P_COMMENTBLOCK=12 +val SCE_P_STRINGEOL=13 +val SCE_P_WORD2=14 +val SCE_P_DECORATOR=15 +# Lexical states for SCLEX_CPP +lex Cpp=SCLEX_CPP SCE_C_ +lex Pascal=SCLEX_PASCAL SCE_C_ +lex BullAnt=SCLEX_BULLANT SCE_C_ +val SCE_C_DEFAULT=0 +val SCE_C_COMMENT=1 +val SCE_C_COMMENTLINE=2 +val SCE_C_COMMENTDOC=3 +val SCE_C_NUMBER=4 +val SCE_C_WORD=5 +val SCE_C_STRING=6 +val SCE_C_CHARACTER=7 +val SCE_C_UUID=8 +val SCE_C_PREPROCESSOR=9 +val SCE_C_OPERATOR=10 +val SCE_C_IDENTIFIER=11 +val SCE_C_STRINGEOL=12 +val SCE_C_VERBATIM=13 +val SCE_C_REGEX=14 +val SCE_C_COMMENTLINEDOC=15 +val SCE_C_WORD2=16 +val SCE_C_COMMENTDOCKEYWORD=17 +val SCE_C_COMMENTDOCKEYWORDERROR=18 +val SCE_C_GLOBALCLASS=19 +# Lexical states for SCLEX_TCL +lex TCL=SCLEX_TCL SCE_TCL_ +val SCE_TCL_DEFAULT=0 +val SCE_TCL_COMMENT=1 +val SCE_TCL_COMMENTLINE=2 +val SCE_TCL_NUMBER=3 +val SCE_TCL_WORD_IN_QUOTE=4 +val SCE_TCL_IN_QUOTE=5 +val SCE_TCL_OPERATOR=6 +val SCE_TCL_IDENTIFIER=7 +val SCE_TCL_SUBSTITUTION=8 +val SCE_TCL_SUB_BRACE=9 +val SCE_TCL_MODIFIER=10 +val SCE_TCL_EXPAND=11 +val SCE_TCL_WORD=12 +val SCE_TCL_WORD2=13 +val SCE_TCL_WORD3=14 +val SCE_TCL_WORD4=15 +val SCE_TCL_WORD5=16 +val SCE_TCL_WORD6=17 +val SCE_TCL_WORD7=18 +val SCE_TCL_WORD8=19 +val SCE_TCL_COMMENT_BOX=20 +val SCE_TCL_BLOCK_COMMENT=21 +# Lexical states for SCLEX_HTML, SCLEX_XML +lex HTML=SCLEX_HTML SCE_H +lex XML=SCLEX_XML SCE_H +lex ASP=SCLEX_ASP SCE_H +lex PHP=SCLEX_PHP SCE_H +val SCE_H_DEFAULT=0 +val SCE_H_TAG=1 +val SCE_H_TAGUNKNOWN=2 +val SCE_H_ATTRIBUTE=3 +val SCE_H_ATTRIBUTEUNKNOWN=4 +val SCE_H_NUMBER=5 +val SCE_H_DOUBLESTRING=6 +val SCE_H_SINGLESTRING=7 +val SCE_H_OTHER=8 +val SCE_H_COMMENT=9 +val SCE_H_ENTITY=10 +# XML and ASP +val SCE_H_TAGEND=11 +val SCE_H_XMLSTART=12 +val SCE_H_XMLEND=13 +val SCE_H_SCRIPT=14 +val SCE_H_ASP=15 +val SCE_H_ASPAT=16 +val SCE_H_CDATA=17 +val SCE_H_QUESTION=18 +# More HTML +val SCE_H_VALUE=19 +# X-Code +val SCE_H_XCCOMMENT=20 +# SGML +val SCE_H_SGML_DEFAULT=21 +val SCE_H_SGML_COMMAND=22 +val SCE_H_SGML_1ST_PARAM=23 +val SCE_H_SGML_DOUBLESTRING=24 +val SCE_H_SGML_SIMPLESTRING=25 +val SCE_H_SGML_ERROR=26 +val SCE_H_SGML_SPECIAL=27 +val SCE_H_SGML_ENTITY=28 +val SCE_H_SGML_COMMENT=29 +val SCE_H_SGML_1ST_PARAM_COMMENT=30 +val SCE_H_SGML_BLOCK_DEFAULT=31 +# Embedded Javascript +val SCE_HJ_START=40 +val SCE_HJ_DEFAULT=41 +val SCE_HJ_COMMENT=42 +val SCE_HJ_COMMENTLINE=43 +val SCE_HJ_COMMENTDOC=44 +val SCE_HJ_NUMBER=45 +val SCE_HJ_WORD=46 +val SCE_HJ_KEYWORD=47 +val SCE_HJ_DOUBLESTRING=48 +val SCE_HJ_SINGLESTRING=49 +val SCE_HJ_SYMBOLS=50 +val SCE_HJ_STRINGEOL=51 +val SCE_HJ_REGEX=52 +# ASP Javascript +val SCE_HJA_START=55 +val SCE_HJA_DEFAULT=56 +val SCE_HJA_COMMENT=57 +val SCE_HJA_COMMENTLINE=58 +val SCE_HJA_COMMENTDOC=59 +val SCE_HJA_NUMBER=60 +val SCE_HJA_WORD=61 +val SCE_HJA_KEYWORD=62 +val SCE_HJA_DOUBLESTRING=63 +val SCE_HJA_SINGLESTRING=64 +val SCE_HJA_SYMBOLS=65 +val SCE_HJA_STRINGEOL=66 +val SCE_HJA_REGEX=67 +# Embedded VBScript +val SCE_HB_START=70 +val SCE_HB_DEFAULT=71 +val SCE_HB_COMMENTLINE=72 +val SCE_HB_NUMBER=73 +val SCE_HB_WORD=74 +val SCE_HB_STRING=75 +val SCE_HB_IDENTIFIER=76 +val SCE_HB_STRINGEOL=77 +# ASP VBScript +val SCE_HBA_START=80 +val SCE_HBA_DEFAULT=81 +val SCE_HBA_COMMENTLINE=82 +val SCE_HBA_NUMBER=83 +val SCE_HBA_WORD=84 +val SCE_HBA_STRING=85 +val SCE_HBA_IDENTIFIER=86 +val SCE_HBA_STRINGEOL=87 +# Embedded Python +val SCE_HP_START=90 +val SCE_HP_DEFAULT=91 +val SCE_HP_COMMENTLINE=92 +val SCE_HP_NUMBER=93 +val SCE_HP_STRING=94 +val SCE_HP_CHARACTER=95 +val SCE_HP_WORD=96 +val SCE_HP_TRIPLE=97 +val SCE_HP_TRIPLEDOUBLE=98 +val SCE_HP_CLASSNAME=99 +val SCE_HP_DEFNAME=100 +val SCE_HP_OPERATOR=101 +val SCE_HP_IDENTIFIER=102 +# PHP +val SCE_HPHP_COMPLEX_VARIABLE=104 +# ASP Python +val SCE_HPA_START=105 +val SCE_HPA_DEFAULT=106 +val SCE_HPA_COMMENTLINE=107 +val SCE_HPA_NUMBER=108 +val SCE_HPA_STRING=109 +val SCE_HPA_CHARACTER=110 +val SCE_HPA_WORD=111 +val SCE_HPA_TRIPLE=112 +val SCE_HPA_TRIPLEDOUBLE=113 +val SCE_HPA_CLASSNAME=114 +val SCE_HPA_DEFNAME=115 +val SCE_HPA_OPERATOR=116 +val SCE_HPA_IDENTIFIER=117 +# PHP +val SCE_HPHP_DEFAULT=118 +val SCE_HPHP_HSTRING=119 +val SCE_HPHP_SIMPLESTRING=120 +val SCE_HPHP_WORD=121 +val SCE_HPHP_NUMBER=122 +val SCE_HPHP_VARIABLE=123 +val SCE_HPHP_COMMENT=124 +val SCE_HPHP_COMMENTLINE=125 +val SCE_HPHP_HSTRING_VARIABLE=126 +val SCE_HPHP_OPERATOR=127 +# Lexical states for SCLEX_PERL +lex Perl=SCLEX_PERL SCE_PL_ +val SCE_PL_DEFAULT=0 +val SCE_PL_ERROR=1 +val SCE_PL_COMMENTLINE=2 +val SCE_PL_POD=3 +val SCE_PL_NUMBER=4 +val SCE_PL_WORD=5 +val SCE_PL_STRING=6 +val SCE_PL_CHARACTER=7 +val SCE_PL_PUNCTUATION=8 +val SCE_PL_PREPROCESSOR=9 +val SCE_PL_OPERATOR=10 +val SCE_PL_IDENTIFIER=11 +val SCE_PL_SCALAR=12 +val SCE_PL_ARRAY=13 +val SCE_PL_HASH=14 +val SCE_PL_SYMBOLTABLE=15 +val SCE_PL_VARIABLE_INDEXER=16 +val SCE_PL_REGEX=17 +val SCE_PL_REGSUBST=18 +val SCE_PL_LONGQUOTE=19 +val SCE_PL_BACKTICKS=20 +val SCE_PL_DATASECTION=21 +val SCE_PL_HERE_DELIM=22 +val SCE_PL_HERE_Q=23 +val SCE_PL_HERE_QQ=24 +val SCE_PL_HERE_QX=25 +val SCE_PL_STRING_Q=26 +val SCE_PL_STRING_QQ=27 +val SCE_PL_STRING_QX=28 +val SCE_PL_STRING_QR=29 +val SCE_PL_STRING_QW=30 +val SCE_PL_POD_VERB=31 +# Lexical states for SCLEX_RUBY +lex Ruby=SCLEX_RUBY SCE_RB_ +val SCE_RB_DEFAULT=0 +val SCE_RB_ERROR=1 +val SCE_RB_COMMENTLINE=2 +val SCE_RB_POD=3 +val SCE_RB_NUMBER=4 +val SCE_RB_WORD=5 +val SCE_RB_STRING=6 +val SCE_RB_CHARACTER=7 +val SCE_RB_CLASSNAME=8 +val SCE_RB_DEFNAME=9 +val SCE_RB_OPERATOR=10 +val SCE_RB_IDENTIFIER=11 +val SCE_RB_REGEX=12 +val SCE_RB_GLOBAL=13 +val SCE_RB_SYMBOL=14 +val SCE_RB_MODULE_NAME=15 +val SCE_RB_INSTANCE_VAR=16 +val SCE_RB_CLASS_VAR=17 +val SCE_RB_BACKTICKS=18 +val SCE_RB_DATASECTION=19 +val SCE_RB_HERE_DELIM=20 +val SCE_RB_HERE_Q=21 +val SCE_RB_HERE_QQ=22 +val SCE_RB_HERE_QX=23 +val SCE_RB_STRING_Q=24 +val SCE_RB_STRING_QQ=25 +val SCE_RB_STRING_QX=26 +val SCE_RB_STRING_QR=27 +val SCE_RB_STRING_QW=28 +val SCE_RB_WORD_DEMOTED=29 +val SCE_RB_STDIN=30 +val SCE_RB_STDOUT=31 +val SCE_RB_STDERR=40 +val SCE_RB_UPPER_BOUND=41 +# Lexical states for SCLEX_VB, SCLEX_VBSCRIPT, SCLEX_POWERBASIC +lex VB=SCLEX_VB SCE_B_ +lex VBScript=SCLEX_VBSCRIPT SCE_B_ +lex PowerBasic=SCLEX_POWERBASIC SCE_B_ +val SCE_B_DEFAULT=0 +val SCE_B_COMMENT=1 +val SCE_B_NUMBER=2 +val SCE_B_KEYWORD=3 +val SCE_B_STRING=4 +val SCE_B_PREPROCESSOR=5 +val SCE_B_OPERATOR=6 +val SCE_B_IDENTIFIER=7 +val SCE_B_DATE=8 +val SCE_B_STRINGEOL=9 +val SCE_B_KEYWORD2=10 +val SCE_B_KEYWORD3=11 +val SCE_B_KEYWORD4=12 +val SCE_B_CONSTANT=13 +val SCE_B_ASM=14 +val SCE_B_LABEL=15 +val SCE_B_ERROR=16 +val SCE_B_HEXNUMBER=17 +val SCE_B_BINNUMBER=18 +# Lexical states for SCLEX_PROPERTIES +lex Properties=SCLEX_PROPERTIES SCE_PROPS_ +val SCE_PROPS_DEFAULT=0 +val SCE_PROPS_COMMENT=1 +val SCE_PROPS_SECTION=2 +val SCE_PROPS_ASSIGNMENT=3 +val SCE_PROPS_DEFVAL=4 +val SCE_PROPS_KEY=5 +# Lexical states for SCLEX_LATEX +lex LaTeX=SCLEX_LATEX SCE_L_ +val SCE_L_DEFAULT=0 +val SCE_L_COMMAND=1 +val SCE_L_TAG=2 +val SCE_L_MATH=3 +val SCE_L_COMMENT=4 +# Lexical states for SCLEX_LUA +lex Lua=SCLEX_LUA SCE_LUA_ +val SCE_LUA_DEFAULT=0 +val SCE_LUA_COMMENT=1 +val SCE_LUA_COMMENTLINE=2 +val SCE_LUA_COMMENTDOC=3 +val SCE_LUA_NUMBER=4 +val SCE_LUA_WORD=5 +val SCE_LUA_STRING=6 +val SCE_LUA_CHARACTER=7 +val SCE_LUA_LITERALSTRING=8 +val SCE_LUA_PREPROCESSOR=9 +val SCE_LUA_OPERATOR=10 +val SCE_LUA_IDENTIFIER=11 +val SCE_LUA_STRINGEOL=12 +val SCE_LUA_WORD2=13 +val SCE_LUA_WORD3=14 +val SCE_LUA_WORD4=15 +val SCE_LUA_WORD5=16 +val SCE_LUA_WORD6=17 +val SCE_LUA_WORD7=18 +val SCE_LUA_WORD8=19 +# Lexical states for SCLEX_ERRORLIST +lex ErrorList=SCLEX_ERRORLIST SCE_ERR_ +val SCE_ERR_DEFAULT=0 +val SCE_ERR_PYTHON=1 +val SCE_ERR_GCC=2 +val SCE_ERR_MS=3 +val SCE_ERR_CMD=4 +val SCE_ERR_BORLAND=5 +val SCE_ERR_PERL=6 +val SCE_ERR_NET=7 +val SCE_ERR_LUA=8 +val SCE_ERR_CTAG=9 +val SCE_ERR_DIFF_CHANGED=10 +val SCE_ERR_DIFF_ADDITION=11 +val SCE_ERR_DIFF_DELETION=12 +val SCE_ERR_DIFF_MESSAGE=13 +val SCE_ERR_PHP=14 +val SCE_ERR_ELF=15 +val SCE_ERR_IFC=16 +val SCE_ERR_IFORT=17 +val SCE_ERR_ABSF=18 +val SCE_ERR_TIDY=19 +val SCE_ERR_JAVA_STACK=20 +# Lexical states for SCLEX_BATCH +lex Batch=SCLEX_BATCH SCE_BAT_ +val SCE_BAT_DEFAULT=0 +val SCE_BAT_COMMENT=1 +val SCE_BAT_WORD=2 +val SCE_BAT_LABEL=3 +val SCE_BAT_HIDE=4 +val SCE_BAT_COMMAND=5 +val SCE_BAT_IDENTIFIER=6 +val SCE_BAT_OPERATOR=7 +# Lexical states for SCLEX_MAKEFILE +lex MakeFile=SCLEX_MAKEFILE SCE_MAKE_ +val SCE_MAKE_DEFAULT=0 +val SCE_MAKE_COMMENT=1 +val SCE_MAKE_PREPROCESSOR=2 +val SCE_MAKE_IDENTIFIER=3 +val SCE_MAKE_OPERATOR=4 +val SCE_MAKE_TARGET=5 +val SCE_MAKE_IDEOL=9 +# Lexical states for SCLEX_DIFF +lex Diff=SCLEX_DIFF SCE_DIFF_ +val SCE_DIFF_DEFAULT=0 +val SCE_DIFF_COMMENT=1 +val SCE_DIFF_COMMAND=2 +val SCE_DIFF_HEADER=3 +val SCE_DIFF_POSITION=4 +val SCE_DIFF_DELETED=5 +val SCE_DIFF_ADDED=6 +# Lexical states for SCLEX_CONF (Apache Configuration Files Lexer) +lex Conf=SCLEX_CONF SCE_CONF_ +val SCE_CONF_DEFAULT=0 +val SCE_CONF_COMMENT=1 +val SCE_CONF_NUMBER=2 +val SCE_CONF_IDENTIFIER=3 +val SCE_CONF_EXTENSION=4 +val SCE_CONF_PARAMETER=5 +val SCE_CONF_STRING=6 +val SCE_CONF_OPERATOR=7 +val SCE_CONF_IP=8 +val SCE_CONF_DIRECTIVE=9 +# Lexical states for SCLEX_AVE, Avenue +lex Avenue=SCLEX_AVE SCE_AVE_ +val SCE_AVE_DEFAULT=0 +val SCE_AVE_COMMENT=1 +val SCE_AVE_NUMBER=2 +val SCE_AVE_WORD=3 +val SCE_AVE_STRING=6 +val SCE_AVE_ENUM=7 +val SCE_AVE_STRINGEOL=8 +val SCE_AVE_IDENTIFIER=9 +val SCE_AVE_OPERATOR=10 +val SCE_AVE_WORD1=11 +val SCE_AVE_WORD2=12 +val SCE_AVE_WORD3=13 +val SCE_AVE_WORD4=14 +val SCE_AVE_WORD5=15 +val SCE_AVE_WORD6=16 +# Lexical states for SCLEX_ADA +lex Ada=SCLEX_ADA SCE_ADA_ +val SCE_ADA_DEFAULT=0 +val SCE_ADA_WORD=1 +val SCE_ADA_IDENTIFIER=2 +val SCE_ADA_NUMBER=3 +val SCE_ADA_DELIMITER=4 +val SCE_ADA_CHARACTER=5 +val SCE_ADA_CHARACTEREOL=6 +val SCE_ADA_STRING=7 +val SCE_ADA_STRINGEOL=8 +val SCE_ADA_LABEL=9 +val SCE_ADA_COMMENTLINE=10 +val SCE_ADA_ILLEGAL=11 +# Lexical states for SCLEX_BAAN +lex Baan=SCLEX_BAAN SCE_BAAN_ +val SCE_BAAN_DEFAULT=0 +val SCE_BAAN_COMMENT=1 +val SCE_BAAN_COMMENTDOC=2 +val SCE_BAAN_NUMBER=3 +val SCE_BAAN_WORD=4 +val SCE_BAAN_STRING=5 +val SCE_BAAN_PREPROCESSOR=6 +val SCE_BAAN_OPERATOR=7 +val SCE_BAAN_IDENTIFIER=8 +val SCE_BAAN_STRINGEOL=9 +val SCE_BAAN_WORD2=10 +# Lexical states for SCLEX_LISP +lex Lisp=SCLEX_LISP SCE_LISP_ +val SCE_LISP_DEFAULT=0 +val SCE_LISP_COMMENT=1 +val SCE_LISP_NUMBER=2 +val SCE_LISP_KEYWORD=3 +val SCE_LISP_KEYWORD_KW=4 +val SCE_LISP_SYMBOL=5 +val SCE_LISP_STRING=6 +val SCE_LISP_STRINGEOL=8 +val SCE_LISP_IDENTIFIER=9 +val SCE_LISP_OPERATOR=10 +val SCE_LISP_SPECIAL=11 +val SCE_LISP_MULTI_COMMENT=12 +# Lexical states for SCLEX_EIFFEL and SCLEX_EIFFELKW +lex Eiffel=SCLEX_EIFFEL SCE_EIFFEL_ +lex EiffelKW=SCLEX_EIFFELKW SCE_EIFFEL_ +val SCE_EIFFEL_DEFAULT=0 +val SCE_EIFFEL_COMMENTLINE=1 +val SCE_EIFFEL_NUMBER=2 +val SCE_EIFFEL_WORD=3 +val SCE_EIFFEL_STRING=4 +val SCE_EIFFEL_CHARACTER=5 +val SCE_EIFFEL_OPERATOR=6 +val SCE_EIFFEL_IDENTIFIER=7 +val SCE_EIFFEL_STRINGEOL=8 +# Lexical states for SCLEX_NNCRONTAB (nnCron crontab Lexer) +lex NNCronTab=SCLEX_NNCRONTAB SCE_NNCRONTAB_ +val SCE_NNCRONTAB_DEFAULT=0 +val SCE_NNCRONTAB_COMMENT=1 +val SCE_NNCRONTAB_TASK=2 +val SCE_NNCRONTAB_SECTION=3 +val SCE_NNCRONTAB_KEYWORD=4 +val SCE_NNCRONTAB_MODIFIER=5 +val SCE_NNCRONTAB_ASTERISK=6 +val SCE_NNCRONTAB_NUMBER=7 +val SCE_NNCRONTAB_STRING=8 +val SCE_NNCRONTAB_ENVIRONMENT=9 +val SCE_NNCRONTAB_IDENTIFIER=10 +# Lexical states for SCLEX_FORTH (Forth Lexer) +lex Forth=SCLEX_FORTH SCE_FORTH_ +val SCE_FORTH_DEFAULT=0 +val SCE_FORTH_COMMENT=1 +val SCE_FORTH_COMMENT_ML=2 +val SCE_FORTH_IDENTIFIER=3 +val SCE_FORTH_CONTROL=4 +val SCE_FORTH_KEYWORD=5 +val SCE_FORTH_DEFWORD=6 +val SCE_FORTH_PREWORD1=7 +val SCE_FORTH_PREWORD2=8 +val SCE_FORTH_NUMBER=9 +val SCE_FORTH_STRING=10 +val SCE_FORTH_LOCALE=11 +# Lexical states for SCLEX_MATLAB +lex MatLab=SCLEX_MATLAB SCE_MATLAB_ +val SCE_MATLAB_DEFAULT=0 +val SCE_MATLAB_COMMENT=1 +val SCE_MATLAB_COMMAND=2 +val SCE_MATLAB_NUMBER=3 +val SCE_MATLAB_KEYWORD=4 +# single quoted string +val SCE_MATLAB_STRING=5 +val SCE_MATLAB_OPERATOR=6 +val SCE_MATLAB_IDENTIFIER=7 +val SCE_MATLAB_DOUBLEQUOTESTRING=8 +# Lexical states for SCLEX_SCRIPTOL +lex Sol=SCLEX_SCRIPTOL SCE_SCRIPTOL_ +val SCE_SCRIPTOL_DEFAULT=0 +val SCE_SCRIPTOL_WHITE=1 +val SCE_SCRIPTOL_COMMENTLINE=2 +val SCE_SCRIPTOL_PERSISTENT=3 +val SCE_SCRIPTOL_CSTYLE=4 +val SCE_SCRIPTOL_COMMENTBLOCK=5 +val SCE_SCRIPTOL_NUMBER=6 +val SCE_SCRIPTOL_STRING=7 +val SCE_SCRIPTOL_CHARACTER=8 +val SCE_SCRIPTOL_STRINGEOL=9 +val SCE_SCRIPTOL_KEYWORD=10 +val SCE_SCRIPTOL_OPERATOR=11 +val SCE_SCRIPTOL_IDENTIFIER=12 +val SCE_SCRIPTOL_TRIPLE=13 +val SCE_SCRIPTOL_CLASSNAME=14 +val SCE_SCRIPTOL_PREPROCESSOR=15 +# Lexical states for SCLEX_ASM +lex Asm=SCLEX_ASM SCE_ASM_ +val SCE_ASM_DEFAULT=0 +val SCE_ASM_COMMENT=1 +val SCE_ASM_NUMBER=2 +val SCE_ASM_STRING=3 +val SCE_ASM_OPERATOR=4 +val SCE_ASM_IDENTIFIER=5 +val SCE_ASM_CPUINSTRUCTION=6 +val SCE_ASM_MATHINSTRUCTION=7 +val SCE_ASM_REGISTER=8 +val SCE_ASM_DIRECTIVE=9 +val SCE_ASM_DIRECTIVEOPERAND=10 +val SCE_ASM_COMMENTBLOCK=11 +val SCE_ASM_CHARACTER=12 +val SCE_ASM_STRINGEOL=13 +val SCE_ASM_EXTINSTRUCTION=14 +# Lexical states for SCLEX_FORTRAN +lex Fortran=SCLEX_FORTRAN SCE_F_ +lex F77=SCLEX_F77 SCE_F_ +val SCE_F_DEFAULT=0 +val SCE_F_COMMENT=1 +val SCE_F_NUMBER=2 +val SCE_F_STRING1=3 +val SCE_F_STRING2=4 +val SCE_F_STRINGEOL=5 +val SCE_F_OPERATOR=6 +val SCE_F_IDENTIFIER=7 +val SCE_F_WORD=8 +val SCE_F_WORD2=9 +val SCE_F_WORD3=10 +val SCE_F_PREPROCESSOR=11 +val SCE_F_OPERATOR2=12 +val SCE_F_LABEL=13 +val SCE_F_CONTINUATION=14 +# Lexical states for SCLEX_CSS +lex CSS=SCLEX_CSS SCE_CSS_ +val SCE_CSS_DEFAULT=0 +val SCE_CSS_TAG=1 +val SCE_CSS_CLASS=2 +val SCE_CSS_PSEUDOCLASS=3 +val SCE_CSS_UNKNOWN_PSEUDOCLASS=4 +val SCE_CSS_OPERATOR=5 +val SCE_CSS_IDENTIFIER=6 +val SCE_CSS_UNKNOWN_IDENTIFIER=7 +val SCE_CSS_VALUE=8 +val SCE_CSS_COMMENT=9 +val SCE_CSS_ID=10 +val SCE_CSS_IMPORTANT=11 +val SCE_CSS_DIRECTIVE=12 +val SCE_CSS_DOUBLESTRING=13 +val SCE_CSS_SINGLESTRING=14 +val SCE_CSS_IDENTIFIER2=15 +val SCE_CSS_ATTRIBUTE=16 +# Lexical states for SCLEX_POV +lex POV=SCLEX_POV SCE_POV_ +val SCE_POV_DEFAULT=0 +val SCE_POV_COMMENT=1 +val SCE_POV_COMMENTLINE=2 +val SCE_POV_NUMBER=3 +val SCE_POV_OPERATOR=4 +val SCE_POV_IDENTIFIER=5 +val SCE_POV_STRING=6 +val SCE_POV_STRINGEOL=7 +val SCE_POV_DIRECTIVE=8 +val SCE_POV_BADDIRECTIVE=9 +val SCE_POV_WORD2=10 +val SCE_POV_WORD3=11 +val SCE_POV_WORD4=12 +val SCE_POV_WORD5=13 +val SCE_POV_WORD6=14 +val SCE_POV_WORD7=15 +val SCE_POV_WORD8=16 +# Lexical states for SCLEX_LOUT +lex LOUT=SCLEX_LOUT SCE_LOUT_ +val SCE_LOUT_DEFAULT=0 +val SCE_LOUT_COMMENT=1 +val SCE_LOUT_NUMBER=2 +val SCE_LOUT_WORD=3 +val SCE_LOUT_WORD2=4 +val SCE_LOUT_WORD3=5 +val SCE_LOUT_WORD4=6 +val SCE_LOUT_STRING=7 +val SCE_LOUT_OPERATOR=8 +val SCE_LOUT_IDENTIFIER=9 +val SCE_LOUT_STRINGEOL=10 +# Lexical states for SCLEX_ESCRIPT +lex ESCRIPT=SCLEX_ESCRIPT SCE_ESCRIPT_ +val SCE_ESCRIPT_DEFAULT=0 +val SCE_ESCRIPT_COMMENT=1 +val SCE_ESCRIPT_COMMENTLINE=2 +val SCE_ESCRIPT_COMMENTDOC=3 +val SCE_ESCRIPT_NUMBER=4 +val SCE_ESCRIPT_WORD=5 +val SCE_ESCRIPT_STRING=6 +val SCE_ESCRIPT_OPERATOR=7 +val SCE_ESCRIPT_IDENTIFIER=8 +val SCE_ESCRIPT_BRACE=9 +val SCE_ESCRIPT_WORD2=10 +val SCE_ESCRIPT_WORD3=11 +# Lexical states for SCLEX_PS +lex PS=SCLEX_PS SCE_PS_ +val SCE_PS_DEFAULT=0 +val SCE_PS_COMMENT=1 +val SCE_PS_DSC_COMMENT=2 +val SCE_PS_DSC_VALUE=3 +val SCE_PS_NUMBER=4 +val SCE_PS_NAME=5 +val SCE_PS_KEYWORD=6 +val SCE_PS_LITERAL=7 +val SCE_PS_IMMEVAL=8 +val SCE_PS_PAREN_ARRAY=9 +val SCE_PS_PAREN_DICT=10 +val SCE_PS_PAREN_PROC=11 +val SCE_PS_TEXT=12 +val SCE_PS_HEXSTRING=13 +val SCE_PS_BASE85STRING=14 +val SCE_PS_BADSTRINGCHAR=15 +# Lexical states for SCLEX_NSIS +lex NSIS=SCLEX_NSIS SCE_NSIS_ +val SCE_NSIS_DEFAULT=0 +val SCE_NSIS_COMMENT=1 +val SCE_NSIS_STRINGDQ=2 +val SCE_NSIS_STRINGLQ=3 +val SCE_NSIS_STRINGRQ=4 +val SCE_NSIS_FUNCTION=5 +val SCE_NSIS_VARIABLE=6 +val SCE_NSIS_LABEL=7 +val SCE_NSIS_USERDEFINED=8 +val SCE_NSIS_SECTIONDEF=9 +val SCE_NSIS_SUBSECTIONDEF=10 +val SCE_NSIS_IFDEFINEDEF=11 +val SCE_NSIS_MACRODEF=12 +val SCE_NSIS_STRINGVAR=13 +val SCE_NSIS_NUMBER=14 +val SCE_NSIS_SECTIONGROUP=15 +val SCE_NSIS_PAGEEX=16 +val SCE_NSIS_FUNCTIONDEF=17 +val SCE_NSIS_COMMENTBOX=18 +# Lexical states for SCLEX_MMIXAL +lex MMIXAL=SCLEX_MMIXAL SCE_MMIXAL_ +val SCE_MMIXAL_LEADWS=0 +val SCE_MMIXAL_COMMENT=1 +val SCE_MMIXAL_LABEL=2 +val SCE_MMIXAL_OPCODE=3 +val SCE_MMIXAL_OPCODE_PRE=4 +val SCE_MMIXAL_OPCODE_VALID=5 +val SCE_MMIXAL_OPCODE_UNKNOWN=6 +val SCE_MMIXAL_OPCODE_POST=7 +val SCE_MMIXAL_OPERANDS=8 +val SCE_MMIXAL_NUMBER=9 +val SCE_MMIXAL_REF=10 +val SCE_MMIXAL_CHAR=11 +val SCE_MMIXAL_STRING=12 +val SCE_MMIXAL_REGISTER=13 +val SCE_MMIXAL_HEX=14 +val SCE_MMIXAL_OPERATOR=15 +val SCE_MMIXAL_SYMBOL=16 +val SCE_MMIXAL_INCLUDE=17 +# Lexical states for SCLEX_CLW +lex Clarion=SCLEX_CLW SCE_CLW_ +val SCE_CLW_DEFAULT=0 +val SCE_CLW_LABEL=1 +val SCE_CLW_COMMENT=2 +val SCE_CLW_STRING=3 +val SCE_CLW_USER_IDENTIFIER=4 +val SCE_CLW_INTEGER_CONSTANT=5 +val SCE_CLW_REAL_CONSTANT=6 +val SCE_CLW_PICTURE_STRING=7 +val SCE_CLW_KEYWORD=8 +val SCE_CLW_COMPILER_DIRECTIVE=9 +val SCE_CLW_RUNTIME_EXPRESSIONS=10 +val SCE_CLW_BUILTIN_PROCEDURES_FUNCTION=11 +val SCE_CLW_STRUCTURE_DATA_TYPE=12 +val SCE_CLW_ATTRIBUTE=13 +val SCE_CLW_STANDARD_EQUATE=14 +val SCE_CLW_ERROR=15 +val SCE_CLW_DEPRECATED=16 +# Lexical states for SCLEX_LOT +lex LOT=SCLEX_LOT SCE_LOT_ +val SCE_LOT_DEFAULT=0 +val SCE_LOT_HEADER=1 +val SCE_LOT_BREAK=2 +val SCE_LOT_SET=3 +val SCE_LOT_PASS=4 +val SCE_LOT_FAIL=5 +val SCE_LOT_ABORT=6 +# Lexical states for SCLEX_YAML +lex YAML=SCLEX_YAML SCE_YAML_ +val SCE_YAML_DEFAULT=0 +val SCE_YAML_COMMENT=1 +val SCE_YAML_IDENTIFIER=2 +val SCE_YAML_KEYWORD=3 +val SCE_YAML_NUMBER=4 +val SCE_YAML_REFERENCE=5 +val SCE_YAML_DOCUMENT=6 +val SCE_YAML_TEXT=7 +val SCE_YAML_ERROR=8 +# Lexical states for SCLEX_TEX +lex TeX=SCLEX_TEX SCE_TEX_ +val SCE_TEX_DEFAULT=0 +val SCE_TEX_SPECIAL=1 +val SCE_TEX_GROUP=2 +val SCE_TEX_SYMBOL=3 +val SCE_TEX_COMMAND=4 +val SCE_TEX_TEXT=5 +lex Metapost=SCLEX_METAPOST SCE_METAPOST_ +val SCE_METAPOST_DEFAULT=0 +val SCE_METAPOST_SPECIAL=1 +val SCE_METAPOST_GROUP=2 +val SCE_METAPOST_SYMBOL=3 +val SCE_METAPOST_COMMAND=4 +val SCE_METAPOST_TEXT=5 +val SCE_METAPOST_EXTRA=6 +# Lexical states for SCLEX_ERLANG +lex Erlang=SCLEX_ERLANG SCE_ERLANG_ +val SCE_ERLANG_DEFAULT=0 +val SCE_ERLANG_COMMENT=1 +val SCE_ERLANG_VARIABLE=2 +val SCE_ERLANG_NUMBER=3 +val SCE_ERLANG_KEYWORD=4 +val SCE_ERLANG_STRING=5 +val SCE_ERLANG_OPERATOR=6 +val SCE_ERLANG_ATOM=7 +val SCE_ERLANG_FUNCTION_NAME=8 +val SCE_ERLANG_CHARACTER=9 +val SCE_ERLANG_MACRO=10 +val SCE_ERLANG_RECORD=11 +val SCE_ERLANG_SEPARATOR=12 +val SCE_ERLANG_NODE_NAME=13 +val SCE_ERLANG_UNKNOWN=31 +# Lexical states for SCLEX_OCTAVE are identical to MatLab +lex Octave=SCLEX_OCTAVE SCE_MATLAB_ +# Lexical states for SCLEX_MSSQL +lex MSSQL=SCLEX_MSSQL SCE_MSSQL_ +val SCE_MSSQL_DEFAULT=0 +val SCE_MSSQL_COMMENT=1 +val SCE_MSSQL_LINE_COMMENT=2 +val SCE_MSSQL_NUMBER=3 +val SCE_MSSQL_STRING=4 +val SCE_MSSQL_OPERATOR=5 +val SCE_MSSQL_IDENTIFIER=6 +val SCE_MSSQL_VARIABLE=7 +val SCE_MSSQL_COLUMN_NAME=8 +val SCE_MSSQL_STATEMENT=9 +val SCE_MSSQL_DATATYPE=10 +val SCE_MSSQL_SYSTABLE=11 +val SCE_MSSQL_GLOBAL_VARIABLE=12 +val SCE_MSSQL_FUNCTION=13 +val SCE_MSSQL_STORED_PROCEDURE=14 +val SCE_MSSQL_DEFAULT_PREF_DATATYPE=15 +val SCE_MSSQL_COLUMN_NAME_2=16 +# Lexical states for SCLEX_VERILOG +lex Verilog=SCLEX_VERILOG SCE_V_ +val SCE_V_DEFAULT=0 +val SCE_V_COMMENT=1 +val SCE_V_COMMENTLINE=2 +val SCE_V_COMMENTLINEBANG=3 +val SCE_V_NUMBER=4 +val SCE_V_WORD=5 +val SCE_V_STRING=6 +val SCE_V_WORD2=7 +val SCE_V_WORD3=8 +val SCE_V_PREPROCESSOR=9 +val SCE_V_OPERATOR=10 +val SCE_V_IDENTIFIER=11 +val SCE_V_STRINGEOL=12 +val SCE_V_USER=19 +# Lexical states for SCLEX_KIX +lex Kix=SCLEX_KIX SCE_KIX_ +val SCE_KIX_DEFAULT=0 +val SCE_KIX_COMMENT=1 +val SCE_KIX_STRING1=2 +val SCE_KIX_STRING2=3 +val SCE_KIX_NUMBER=4 +val SCE_KIX_VAR=5 +val SCE_KIX_MACRO=6 +val SCE_KIX_KEYWORD=7 +val SCE_KIX_FUNCTIONS=8 +val SCE_KIX_OPERATOR=9 +val SCE_KIX_IDENTIFIER=31 +# Lexical states for SCLEX_GUI4CLI +val SCE_GC_DEFAULT=0 +val SCE_GC_COMMENTLINE=1 +val SCE_GC_COMMENTBLOCK=2 +val SCE_GC_GLOBAL=3 +val SCE_GC_EVENT=4 +val SCE_GC_ATTRIBUTE=5 +val SCE_GC_CONTROL=6 +val SCE_GC_COMMAND=7 +val SCE_GC_STRING=8 +val SCE_GC_OPERATOR=9 +# Lexical states for SCLEX_SPECMAN +lex Specman=SCLEX_SPECMAN SCE_SN_ +val SCE_SN_DEFAULT=0 +val SCE_SN_CODE=1 +val SCE_SN_COMMENTLINE=2 +val SCE_SN_COMMENTLINEBANG=3 +val SCE_SN_NUMBER=4 +val SCE_SN_WORD=5 +val SCE_SN_STRING=6 +val SCE_SN_WORD2=7 +val SCE_SN_WORD3=8 +val SCE_SN_PREPROCESSOR=9 +val SCE_SN_OPERATOR=10 +val SCE_SN_IDENTIFIER=11 +val SCE_SN_STRINGEOL=12 +val SCE_SN_REGEXTAG=13 +val SCE_SN_SIGNAL=14 +val SCE_SN_USER=19 +# Lexical states for SCLEX_AU3 +lex Au3=SCLEX_AU3 SCE_AU3_ +val SCE_AU3_DEFAULT=0 +val SCE_AU3_COMMENT=1 +val SCE_AU3_COMMENTBLOCK=2 +val SCE_AU3_NUMBER=3 +val SCE_AU3_FUNCTION=4 +val SCE_AU3_KEYWORD=5 +val SCE_AU3_MACRO=6 +val SCE_AU3_STRING=7 +val SCE_AU3_OPERATOR=8 +val SCE_AU3_VARIABLE=9 +val SCE_AU3_SENT=10 +val SCE_AU3_PREPROCESSOR=11 +val SCE_AU3_SPECIAL=12 +val SCE_AU3_EXPAND=13 +val SCE_AU3_COMOBJ=14 +val SCE_AU3_UDF=15 +# Lexical states for SCLEX_APDL +lex APDL=SCLEX_APDL SCE_APDL_ +val SCE_APDL_DEFAULT=0 +val SCE_APDL_COMMENT=1 +val SCE_APDL_COMMENTBLOCK=2 +val SCE_APDL_NUMBER=3 +val SCE_APDL_STRING=4 +val SCE_APDL_OPERATOR=5 +val SCE_APDL_WORD=6 +val SCE_APDL_PROCESSOR=7 +val SCE_APDL_COMMAND=8 +val SCE_APDL_SLASHCOMMAND=9 +val SCE_APDL_STARCOMMAND=10 +val SCE_APDL_ARGUMENT=11 +val SCE_APDL_FUNCTION=12 +# Lexical states for SCLEX_BASH +lex Bash=SCLEX_BASH SCE_SH_ +val SCE_SH_DEFAULT=0 +val SCE_SH_ERROR=1 +val SCE_SH_COMMENTLINE=2 +val SCE_SH_NUMBER=3 +val SCE_SH_WORD=4 +val SCE_SH_STRING=5 +val SCE_SH_CHARACTER=6 +val SCE_SH_OPERATOR=7 +val SCE_SH_IDENTIFIER=8 +val SCE_SH_SCALAR=9 +val SCE_SH_PARAM=10 +val SCE_SH_BACKTICKS=11 +val SCE_SH_HERE_DELIM=12 +val SCE_SH_HERE_Q=13 +# Lexical states for SCLEX_ASN1 +lex Asn1=SCLEX_ASN1 SCE_ASN1_ +val SCE_ASN1_DEFAULT=0 +val SCE_ASN1_COMMENT=1 +val SCE_ASN1_IDENTIFIER=2 +val SCE_ASN1_STRING=3 +val SCE_ASN1_OID=4 +val SCE_ASN1_SCALAR=5 +val SCE_ASN1_KEYWORD=6 +val SCE_ASN1_ATTRIBUTE=7 +val SCE_ASN1_DESCRIPTOR=8 +val SCE_ASN1_TYPE=9 +val SCE_ASN1_OPERATOR=10 +# Lexical states for SCLEX_VHDL +lex VHDL=SCLEX_VHDL SCE_VHDL_ +val SCE_VHDL_DEFAULT=0 +val SCE_VHDL_COMMENT=1 +val SCE_VHDL_COMMENTLINEBANG=2 +val SCE_VHDL_NUMBER=3 +val SCE_VHDL_STRING=4 +val SCE_VHDL_OPERATOR=5 +val SCE_VHDL_IDENTIFIER=6 +val SCE_VHDL_STRINGEOL=7 +val SCE_VHDL_KEYWORD=8 +val SCE_VHDL_STDOPERATOR=9 +val SCE_VHDL_ATTRIBUTE=10 +val SCE_VHDL_STDFUNCTION=11 +val SCE_VHDL_STDPACKAGE=12 +val SCE_VHDL_STDTYPE=13 +val SCE_VHDL_USERWORD=14 +# Lexical states for SCLEX_CAML +lex Caml=SCLEX_CAML SCE_CAML_ +val SCE_CAML_DEFAULT=0 +val SCE_CAML_IDENTIFIER=1 +val SCE_CAML_TAGNAME=2 +val SCE_CAML_KEYWORD=3 +val SCE_CAML_KEYWORD2=4 +val SCE_CAML_KEYWORD3=5 +val SCE_CAML_LINENUM=6 +val SCE_CAML_OPERATOR=7 +val SCE_CAML_NUMBER=8 +val SCE_CAML_CHAR=9 +val SCE_CAML_STRING=11 +val SCE_CAML_COMMENT=12 +val SCE_CAML_COMMENT1=13 +val SCE_CAML_COMMENT2=14 +val SCE_CAML_COMMENT3=15 +# Lexical states for SCLEX_HASKELL +lex Haskell=SCLEX_HASKELL SCE_HA_ +val SCE_HA_DEFAULT=0 +val SCE_HA_IDENTIFIER=1 +val SCE_HA_KEYWORD=2 +val SCE_HA_NUMBER=3 +val SCE_HA_STRING=4 +val SCE_HA_CHARACTER=5 +val SCE_HA_CLASS=6 +val SCE_HA_MODULE=7 +val SCE_HA_CAPITAL=8 +val SCE_HA_DATA=9 +val SCE_HA_IMPORT=10 +val SCE_HA_OPERATOR=11 +val SCE_HA_INSTANCE=12 +val SCE_HA_COMMENTLINE=13 +val SCE_HA_COMMENTBLOCK=14 +val SCE_HA_COMMENTBLOCK2=15 +val SCE_HA_COMMENTBLOCK3=16 +# Lexical states of SCLEX_TADS3 +lex TADS3=SCLEX_TADS3 SCE_T3_ +val SCE_T3_DEFAULT=0 +val SCE_T3_X_DEFAULT=1 +val SCE_T3_PREPROCESSOR=2 +val SCE_T3_BLOCK_COMMENT=3 +val SCE_T3_LINE_COMMENT=4 +val SCE_T3_OPERATOR=5 +val SCE_T3_KEYWORD=6 +val SCE_T3_NUMBER=7 +val SCE_T3_IDENTIFIER=8 +val SCE_T3_S_STRING=9 +val SCE_T3_D_STRING=10 +val SCE_T3_X_STRING=11 +val SCE_T3_LIB_DIRECTIVE=12 +val SCE_T3_MSG_PARAM=13 +val SCE_T3_HTML_TAG=14 +val SCE_T3_HTML_DEFAULT=15 +val SCE_T3_HTML_STRING=16 +val SCE_T3_USER1=17 +val SCE_T3_USER2=18 +val SCE_T3_USER3=19 +# Lexical states for SCLEX_REBOL +lex Rebol=SCLEX_REBOL SCE_REBOL_ +val SCE_REBOL_DEFAULT=0 +val SCE_REBOL_COMMENTLINE=1 +val SCE_REBOL_COMMENTBLOCK=2 +val SCE_REBOL_PREFACE=3 +val SCE_REBOL_OPERATOR=4 +val SCE_REBOL_CHARACTER=5 +val SCE_REBOL_QUOTEDSTRING=6 +val SCE_REBOL_BRACEDSTRING=7 +val SCE_REBOL_NUMBER=8 +val SCE_REBOL_PAIR=9 +val SCE_REBOL_TUPLE=10 +val SCE_REBOL_BINARY=11 +val SCE_REBOL_MONEY=12 +val SCE_REBOL_ISSUE=13 +val SCE_REBOL_TAG=14 +val SCE_REBOL_FILE=15 +val SCE_REBOL_EMAIL=16 +val SCE_REBOL_URL=17 +val SCE_REBOL_DATE=18 +val SCE_REBOL_TIME=19 +val SCE_REBOL_IDENTIFIER=20 +val SCE_REBOL_WORD=21 +val SCE_REBOL_WORD2=22 +val SCE_REBOL_WORD3=23 +val SCE_REBOL_WORD4=24 +val SCE_REBOL_WORD5=25 +val SCE_REBOL_WORD6=26 +val SCE_REBOL_WORD7=27 +val SCE_REBOL_WORD8=28 +# Lexical states for SCLEX_SQL +lex SQL=SCLEX_SQL SCE_SQL_ +val SCE_SQL_DEFAULT=0 +val SCE_SQL_COMMENT=1 +val SCE_SQL_COMMENTLINE=2 +val SCE_SQL_COMMENTDOC=3 +val SCE_SQL_NUMBER=4 +val SCE_SQL_WORD=5 +val SCE_SQL_STRING=6 +val SCE_SQL_CHARACTER=7 +val SCE_SQL_SQLPLUS=8 +val SCE_SQL_SQLPLUS_PROMPT=9 +val SCE_SQL_OPERATOR=10 +val SCE_SQL_IDENTIFIER=11 +val SCE_SQL_SQLPLUS_COMMENT=13 +val SCE_SQL_COMMENTLINEDOC=15 +val SCE_SQL_WORD2=16 +val SCE_SQL_COMMENTDOCKEYWORD=17 +val SCE_SQL_COMMENTDOCKEYWORDERROR=18 +val SCE_SQL_USER1=19 +val SCE_SQL_USER2=20 +val SCE_SQL_USER3=21 +val SCE_SQL_USER4=22 +val SCE_SQL_QUOTEDIDENTIFIER=23 +# Lexical states for SCLEX_SMALLTALK +lex Smalltalk=SCLEX_SMALLTALK SCE_ST_ +val SCE_ST_DEFAULT=0 +val SCE_ST_STRING=1 +val SCE_ST_NUMBER=2 +val SCE_ST_COMMENT=3 +val SCE_ST_SYMBOL=4 +val SCE_ST_BINARY=5 +val SCE_ST_BOOL=6 +val SCE_ST_SELF=7 +val SCE_ST_SUPER=8 +val SCE_ST_NIL=9 +val SCE_ST_GLOBAL=10 +val SCE_ST_RETURN=11 +val SCE_ST_SPECIAL=12 +val SCE_ST_KWSEND=13 +val SCE_ST_ASSIGN=14 +val SCE_ST_CHARACTER=15 +val SCE_ST_SPEC_SEL=16 +# Lexical states for SCLEX_FLAGSHIP (clipper) +lex FlagShip=SCLEX_FLAGSHIP SCE_B_ +val SCE_FS_DEFAULT=0 +val SCE_FS_COMMENT=1 +val SCE_FS_COMMENTLINE=2 +val SCE_FS_COMMENTDOC=3 +val SCE_FS_COMMENTLINEDOC=4 +val SCE_FS_COMMENTDOCKEYWORD=5 +val SCE_FS_COMMENTDOCKEYWORDERROR=6 +val SCE_FS_KEYWORD=7 +val SCE_FS_KEYWORD2=8 +val SCE_FS_KEYWORD3=9 +val SCE_FS_KEYWORD4=10 +val SCE_FS_NUMBER=11 +val SCE_FS_STRING=12 +val SCE_FS_PREPROCESSOR=13 +val SCE_FS_OPERATOR=14 +val SCE_FS_IDENTIFIER=15 +val SCE_FS_DATE=16 +val SCE_FS_STRINGEOL=17 +val SCE_FS_CONSTANT=18 +val SCE_FS_ASM=19 +val SCE_FS_LABEL=20 +val SCE_FS_ERROR=21 +val SCE_FS_HEXNUMBER=22 +val SCE_FS_BINNUMBER=23 +# Lexical states for SCLEX_CSOUND +lex Csound=SCLEX_CSOUND SCE_CSOUND_ +val SCE_CSOUND_DEFAULT=0 +val SCE_CSOUND_COMMENT=1 +val SCE_CSOUND_NUMBER=2 +val SCE_CSOUND_OPERATOR=3 +val SCE_CSOUND_INSTR=4 +val SCE_CSOUND_IDENTIFIER=5 +val SCE_CSOUND_OPCODE=6 +val SCE_CSOUND_HEADERSTMT=7 +val SCE_CSOUND_USERKEYWORD=8 +val SCE_CSOUND_COMMENTBLOCK=9 +val SCE_CSOUND_PARAM=10 +val SCE_CSOUND_ARATE_VAR=11 +val SCE_CSOUND_KRATE_VAR=12 +val SCE_CSOUND_IRATE_VAR=13 +val SCE_CSOUND_GLOBAL_VAR=14 +val SCE_CSOUND_STRINGEOL=15 +# Lexical states for SCLEX_INNOSETUP +lex Inno=SCLEX_INNOSETUP SCE_INNO_ +val SCE_INNO_DEFAULT=0 +val SCE_INNO_COMMENT=1 +val SCE_INNO_KEYWORD=2 +val SCE_INNO_PARAMETER=3 +val SCE_INNO_SECTION=4 +val SCE_INNO_PREPROC=5 +val SCE_INNO_PREPROC_INLINE=6 +val SCE_INNO_COMMENT_PASCAL=7 +val SCE_INNO_KEYWORD_PASCAL=8 +val SCE_INNO_KEYWORD_USER=9 +val SCE_INNO_STRING_DOUBLE=10 +val SCE_INNO_STRING_SINGLE=11 +val SCE_INNO_IDENTIFIER=12 +# Lexical states for SCLEX_OPAL +lex Opal=SCLEX_OPAL SCE_OPAL_ +val SCE_OPAL_SPACE=0 +val SCE_OPAL_COMMENT_BLOCK=1 +val SCE_OPAL_COMMENT_LINE=2 +val SCE_OPAL_INTEGER=3 +val SCE_OPAL_KEYWORD=4 +val SCE_OPAL_SORT=5 +val SCE_OPAL_STRING=6 +val SCE_OPAL_PAR=7 +val SCE_OPAL_BOOL_CONST=8 +val SCE_OPAL_DEFAULT=32 +# Lexical states for SCLEX_SPICE +lex Spice=SCLEX_SPICE SCE_SPICE_ +val SCE_SPICE_DEFAULT=0 +val SCE_SPICE_IDENTIFIER=1 +val SCE_SPICE_KEYWORD=2 +val SCE_SPICE_KEYWORD2=3 +val SCE_SPICE_KEYWORD3=4 +val SCE_SPICE_NUMBER=5 +val SCE_SPICE_DELIMITER=6 +val SCE_SPICE_VALUE=7 +val SCE_SPICE_COMMENTLINE=8 + +# Events + +evt void StyleNeeded=2000(int position) +evt void CharAdded=2001(int ch) +evt void SavePointReached=2002(void) +evt void SavePointLeft=2003(void) +evt void ModifyAttemptRO=2004(void) +# GTK+ Specific to work around focus and accelerator problems: +evt void Key=2005(int ch, int modifiers) +evt void DoubleClick=2006(void) +evt void UpdateUI=2007(void) +evt void Modified=2008(int position, int modificationType, string text, int length, int linesAdded, int line, int foldLevelNow, int foldLevelPrev) +evt void MacroRecord=2009(int message, int wParam, int lParam) +evt void MarginClick=2010(int modifiers, int position, int margin) +evt void NeedShown=2011(int position, int length) +evt void Painted=2013(void) +evt void UserListSelection=2014(int listType, string text) +evt void URIDropped=2015(string text) +evt void DwellStart=2016(int position) +evt void DwellEnd=2017(int position) +evt void Zoom=2018(void) +evt void HotSpotClick=2019(int modifiers, int position) +evt void HotSpotDoubleClick=2020(int modifiers, int position) +evt void CallTipClick=2021(int position) +evt void AutoCSelection=2022(string text) + +cat Deprecated + +# CARET_POLICY changed in 1.47 +fun void SetCaretPolicy=2369(int caretPolicy, int caretSlop) +val CARET_CENTER=0x02 +val CARET_XEVEN=0x08 +val CARET_XJUMPS=0x10 + +# The old name for SCN_UPDATEUI +val SCN_CHECKBRACE=2007 +evt void PosChanged=2012(int position) + +# SCLEX_HTML should be used in preference to these. +val SCLEX_ASP=29 +val SCLEX_PHP=30 diff --git a/include/ScintillaWidget.h b/include/ScintillaWidget.h new file mode 100755 index 0000000..9d23ce2 --- /dev/null +++ b/include/ScintillaWidget.h @@ -0,0 +1,59 @@ +// Scintilla source code edit control +/** @file ScintillaWidget.h + ** Definition of Scintilla widget for GTK+. + ** Only needed by GTK+ code but is harmless on other platforms. + **/ +// Copyright 1998-2001 by Neil Hodgson +// The License.txt file describes the conditions under which this software may be distributed. + +#ifndef SCINTILLAWIDGET_H +#define SCINTILLAWIDGET_H + +#if PLAT_GTK + +#ifdef __cplusplus +extern "C" { +#endif + +#define SCINTILLA(obj) GTK_CHECK_CAST (obj, scintilla_get_type (), ScintillaObject) +#define SCINTILLA_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, scintilla_get_type (), ScintillaClass) +#define IS_SCINTILLA(obj) GTK_CHECK_TYPE (obj, scintilla_get_type ()) + +typedef struct _ScintillaObject ScintillaObject; +typedef struct _ScintillaClass ScintillaClass; + +struct _ScintillaObject { + GtkContainer cont; + void *pscin; +}; + +struct _ScintillaClass { + GtkContainerClass parent_class; + + void (* command) (ScintillaObject *ttt); + void (* notify) (ScintillaObject *ttt); +}; + +#if GLIB_MAJOR_VERSION < 2 +GtkType scintilla_get_type (void); +#else +GType scintilla_get_type (void); +#endif +GtkWidget* scintilla_new (void); +void scintilla_set_id (ScintillaObject *sci, uptr_t id); +sptr_t scintilla_send_message (ScintillaObject *sci,unsigned int iMessage, uptr_t wParam, sptr_t lParam); +void scintilla_release_resources(void); + +#if GTK_MAJOR_VERSION < 2 +#define SCINTILLA_NOTIFY "notify" +#else +#define SCINTILLA_NOTIFY "sci-notify" +#endif + +#ifdef __cplusplus +} +#endif + +#endif + +#endif diff --git a/include/WindowAccessor.h b/include/WindowAccessor.h new file mode 100755 index 0000000..6c16b15 --- /dev/null +++ b/include/WindowAccessor.h @@ -0,0 +1,57 @@ +// Scintilla source code edit control +/** @file WindowAccessor.h + ** Implementation of BufferAccess and StylingAccess on a Scintilla + ** rapid easy access to contents of a Scintilla. + **/ +// Copyright 1998-2001 by Neil Hodgson +// The License.txt file describes the conditions under which this software may be distributed. + +/** + */ +class WindowAccessor : public Accessor { + // Private so WindowAccessor objects can not be copied + WindowAccessor(const WindowAccessor &source) : Accessor(), props(source.props) {} + WindowAccessor &operator=(const WindowAccessor &) { return *this; } +protected: + WindowID id; + PropSet &props; + int lenDoc; + + char styleBuf[bufferSize]; + int validLen; + char chFlags; + char chWhile; + unsigned int startSeg; + + bool InternalIsLeadByte(char ch); + void Fill(int position); +public: + WindowAccessor(WindowID id_, PropSet &props_) : + Accessor(), id(id_), props(props_), + lenDoc(-1), validLen(0), chFlags(0), chWhile(0) { + } + ~WindowAccessor(); + bool Match(int pos, const char *s); + char StyleAt(int position); + int GetLine(int position); + int LineStart(int line); + int LevelAt(int line); + int Length(); + void Flush(); + int GetLineState(int line); + int SetLineState(int line, int state); + int GetPropertyInt(const char *key, int defaultValue=0) { + return props.GetInt(key, defaultValue); + } + char *GetProperties() { + return props.ToString(); + } + + void StartAt(unsigned int start, char chMask=31); + void SetFlags(char chFlags_, char chWhile_) {chFlags = chFlags_; chWhile = chWhile_; }; + unsigned int GetStartSegment() { return startSeg; } + void StartSegment(unsigned int pos); + void ColourTo(unsigned int pos, int chAttr); + void SetLevel(int line, int level); + int IndentAmount(int line, int *flags, PFNIsCommentLeader pfnIsCommentLeader = 0); +}; diff --git a/qt/PlatQt.cpp b/qt/PlatQt.cpp new file mode 100644 index 0000000..160ef70 --- /dev/null +++ b/qt/PlatQt.cpp @@ -0,0 +1,933 @@ +// This module implements the portability layer for the Qt port of Scintilla. +// +// Copyright (c) 2006 +// Riverbank Computing Limited +// +// This file is part of QScintilla. +// +// This copy of QScintilla is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2, or (at your option) any +// later version. +// +// QScintilla is supplied 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 +// QScintilla; see the file LICENSE. If not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "Platform.h" +#include "XPM.h" + +#include "qextscintillabase.h" + + +// Type convertors. +static QFont *PFont(FontID id) +{ + return reinterpret_cast(id); +} + +static QPainter *PSurface(SurfaceID id) +{ + return reinterpret_cast(id); +} + +static QWidget *PWindow(WindowID id) +{ + return reinterpret_cast(id); +} + +static QPopupMenu *PMenu(MenuID id) +{ + return reinterpret_cast(id); +} + + +// Create a Point instance from a long value. +Point Point::FromLong(long lpoint) +{ + return Point(Platform::LowShortFromLong(lpoint), + Platform::HighShortFromLong(lpoint)); +} + + +// Colour palette management. The Qt interface to colours means this class +// doesn't have to do anything. +Palette::Palette() +{ + used = 0; + allowRealization = false; +} + +Palette::~Palette() +{ + Release(); +} + +void Palette::Release() +{ + used = 0; +} + +void Palette::WantFind(ColourPair &cp,bool want) +{ + if (!want) + cp.allocated.Set(cp.desired.AsLong()); +} + +void Palette::Allocate(Window &) +{ +} + + +// Font management. +Font::Font() : id(0) +{ +} + +Font::~Font() +{ +} + +void Font::Create(const char *faceName,int,int size,bool bold,bool italic,bool) +{ + Release(); + + QFont *f = new QFont(); + + // If name of the font begins with a '-', assume, that it is an XLFD. + if (faceName[0] == '-') + f -> setRawName(faceName); + else + { + f -> setFamily(faceName); + f -> setPointSize(size); + f -> setBold(bold); + f -> setItalic(italic); + } + + id = f; +} + +void Font::Release() +{ + if (id) + { + delete PFont(id); + id = 0; + } +} + + +// A surface abstracts a place to draw. +class SurfaceImpl : public Surface +{ +public: + SurfaceImpl(); + virtual ~SurfaceImpl(); + + void Init(WindowID); + void Init(SurfaceID sid,WindowID); + void InitPixMap(int width,int height,Surface *surface_,WindowID); + + void Release(); + bool Initialised() {return painter;} + void PenColour(ColourAllocated fore); + int LogPixelsY() {return 72;} + int DeviceHeightFont(int points) {return points;} + void MoveTo(int x_,int y_) {painter -> moveTo(x_,y_);} + void LineTo(int x_,int y_) {painter -> lineTo(x_,y_);} + void Polygon(Point *pts,int npts,ColourAllocated fore, + ColourAllocated back); + void RectangleDraw(PRectangle rc,ColourAllocated fore, + ColourAllocated back); + void FillRectangle(PRectangle rc,ColourAllocated back); + void FillRectangle(PRectangle rc,Surface &surfacePattern); + void RoundedRectangle(PRectangle rc,ColourAllocated fore, + ColourAllocated back); + void AlphaRectangle(PRectangle rc, int cornerSize, + ColourAllocated fill, int alphaFill, + ColourAllocated outline, int alphaOutline, int flags); + void Ellipse(PRectangle rc,ColourAllocated fore,ColourAllocated back); + void Copy(PRectangle rc,Point from,Surface &surfaceSource); + + void DrawTextNoClip(PRectangle rc,Font &font_,int ybase,const char *s, + int len,ColourAllocated fore,ColourAllocated back); + void DrawTextClipped(PRectangle rc,Font &font_,int ybase,const char *s, + int len,ColourAllocated fore, + ColourAllocated back); + void DrawTextTransparent(PRectangle rc,Font &font_,int ybase, + const char *s,int len,ColourAllocated fore); + void MeasureWidths(Font &font_,const char *s,int len,int *positions); + int WidthText(Font &font_,const char *s,int len); + int WidthChar(Font &font_,char ch); + int Ascent(Font &font_); + int Descent(Font &font_); + int InternalLeading(Font &font_) {return 0;} + int ExternalLeading(Font &font_); + int Height(Font &font_); + int AverageCharWidth(Font &font_) {return WidthChar(font_,'n');} + + int SetPalette(Palette *,bool) {return 0;} + void SetClip(PRectangle rc); + void FlushCachedState() {painter -> flush();} + + void SetUnicodeMode(bool unicodeMode_) {unicodeMode = unicodeMode_;} + void SetDBCSMode(int codePage) {} + + void DrawXPM(PRectangle rc,const XPM *xpm); + +private: + void commonInit(QPainter *painter_,bool mypainter_); + bool setFont(Font &font_); + QString convertText(const char *s,int len); + static QRgb convertQRgb(const ColourAllocated &col, unsigned alpha); + static QColor convertQColor(const ColourAllocated &col, + unsigned alpha = 0xff); + + bool unicodeMode; + bool mypainter; + QPainter *painter; +}; + +Surface *Surface::Allocate() +{ + return new SurfaceImpl; +} + +SurfaceImpl::SurfaceImpl() : unicodeMode(false), mypainter(false), painter(0) +{ +} + +SurfaceImpl::~SurfaceImpl() +{ + Release(); +} + +void SurfaceImpl::commonInit(QPainter *painter_,bool mypainter_) +{ + Release(); + + painter = painter_; + mypainter = mypainter_; +} + +void SurfaceImpl::Init(WindowID) +{ + commonInit(new QPainter(new QWidget()),true); +} + +void SurfaceImpl::Init(SurfaceID sid,WindowID) +{ + commonInit(PSurface(sid),false); +} + +void SurfaceImpl::InitPixMap(int width,int height,Surface *,WindowID) +{ + commonInit(new QPainter(new QPixmap(width,height)),true); +} + +void SurfaceImpl::Release() +{ + if (painter && mypainter) + { + QPaintDevice *pd = painter -> device(); + + delete painter; + + delete pd; + } + + painter = 0; +} + +void SurfaceImpl::PenColour(ColourAllocated fore) +{ + painter -> setPen(convertQColor(fore)); +} + +void SurfaceImpl::Polygon(Point *pts,int npts,ColourAllocated fore, + ColourAllocated back) +{ + QPointArray qpts(npts); + + for (int i = 0; i < npts; ++i) + qpts.setPoint(i,pts[i].x,pts[i].y); + + painter -> setPen(convertQColor(fore)); + painter -> setBrush(convertQColor(back)); + painter -> drawPolygon(qpts); +} + +void SurfaceImpl::RectangleDraw(PRectangle rc,ColourAllocated fore, + ColourAllocated back) +{ + painter -> setPen(convertQColor(fore)); + painter -> setBrush(convertQColor(back)); + painter -> drawRect(rc.left,rc.top, + rc.right - rc.left,rc.bottom - rc.top); +} + +void SurfaceImpl::FillRectangle(PRectangle rc,ColourAllocated back) +{ + painter -> setPen(Qt::NoPen); + painter -> setBrush(convertQColor(back)); + painter -> drawRect(rc.left,rc.top, + rc.right - rc.left,rc.bottom - rc.top); +} + +void SurfaceImpl::FillRectangle(PRectangle rc,Surface &surfacePattern) +{ + SurfaceImpl &si = static_cast(surfacePattern); + QPixmap *pm = static_cast(si.painter -> device()); + + if (pm) + { + QBrush brsh(Qt::black,*pm); + + painter -> setPen(Qt::NoPen); + painter -> setBrush(brsh); + painter -> drawRect(rc.left,rc.top, + rc.right - rc.left,rc.bottom - rc.top); + } + else + FillRectangle(rc,ColourAllocated(0)); +} + +void SurfaceImpl::RoundedRectangle(PRectangle rc,ColourAllocated fore, + ColourAllocated back) +{ + painter -> setPen(convertQColor(fore)); + painter -> setBrush(convertQColor(back)); + painter -> drawRoundRect(rc.left,rc.top, + rc.right - rc.left,rc.bottom - rc.top); +} + +void SurfaceImpl::AlphaRectangle(PRectangle rc, int cornerSize, + ColourAllocated fill, int alphaFill, ColourAllocated outline, + int alphaOutline, int) +{ + int w = rc.right - rc.left; + int h = rc.bottom - rc.top; + + QImage img(w, h, 32); + + img.fill(convertQRgb(fill, alphaFill)); + img.setAlphaBuffer(TRUE); + + // Assume that "cornerSize" means outline width. + if (cornerSize > 0) + { + QRgb oline = convertQRgb(outline, alphaOutline); + + int linew = cornerSize; + + if (linew > w) + linew = w; + + for (int y = 0; y < h; ++y) + { + int x; + + if (y < cornerSize || y >= (h - cornerSize)) + for (x = 0; x < w; ++x) + img.setPixel(x, y, oline); + else + { + for (x = 0; x < linew; ++x) + img.setPixel(x, y, oline); + + for (x = w - 1; x >= w - linew; --x) + img.setPixel(x, y, oline); + } + } + } + + painter->drawImage(rc.left, rc.top, img); +} + +void SurfaceImpl::Ellipse(PRectangle rc,ColourAllocated fore, + ColourAllocated back) +{ + painter -> setPen(convertQColor(fore)); + painter -> setBrush(convertQColor(back)); + painter -> drawEllipse(rc.left,rc.top, + rc.right - rc.left,rc.bottom - rc.top); +} + +void SurfaceImpl::Copy(PRectangle rc,Point from,Surface &surfaceSource) +{ + SurfaceImpl &si = static_cast(surfaceSource); + QPaintDevice *spd = si.painter -> device(); + QPaintDevice *dpd = painter -> device(); + + if (spd && dpd) + { + si.painter -> end(); + painter -> end(); + + bitBlt(dpd,rc.left,rc.top,spd,from.x,from.y, + rc.right - rc.left,rc.bottom - rc.top); + + si.painter -> begin(spd); + painter -> begin(dpd); + } +} + +void SurfaceImpl::DrawTextNoClip(PRectangle rc,Font &font_,int ybase, + const char *s,int len,ColourAllocated fore, + ColourAllocated back) +{ + FillRectangle(rc,back); + DrawTextTransparent(rc,font_,ybase,s,len,fore); +} + +void SurfaceImpl::DrawTextClipped(PRectangle rc,Font &font_,int ybase, + const char *s,int len,ColourAllocated fore, + ColourAllocated back) +{ + SetClip(rc); + DrawTextNoClip(rc,font_,ybase,s,len,fore,back); + painter -> setClipping(FALSE); +} + +void SurfaceImpl::DrawTextTransparent(PRectangle rc,Font &font_,int ybase, + const char *s,int len, + ColourAllocated fore) +{ + QString qs = convertText(s,len); + + setFont(font_); + painter -> setPen(convertQColor(fore)); + painter -> drawText(rc.left,ybase,qs); +} + +void SurfaceImpl::DrawXPM(PRectangle rc,const XPM *xpm) +{ + int x, y; + const QPixmap &qpm = xpm -> Pixmap(); + + x = rc.left + (rc.Width() - qpm.width()) / 2; + y = rc.top + (rc.Height() - qpm.height()) / 2; + + painter -> drawPixmap(x,y,qpm); +} + +void SurfaceImpl::MeasureWidths(Font &font_,const char *s,int len, + int *positions) +{ + if (setFont(font_)) + { + int totalWidth = 0, ui = 0; + QString qs = convertText(s,len); + QFontMetrics fm = painter -> fontMetrics(); + + for (int i = 0; i < qs.length(); ++i) + { + totalWidth += fm.width(qs[i]); + + int l = (unicodeMode ? QString(qs[i]).utf8().length() : 1); + + while (l--) + positions[ui++] = totalWidth; + } + } + else + for (int i = 0; i < len; ++i) + positions[i] = i + 1; +} + +int SurfaceImpl::WidthText(Font &font_,const char *s,int len) +{ + if (setFont(font_)) + { + QString qs = convertText(s,len); + + return painter -> fontMetrics().width(qs,qs.length()); + } + + return 1; +} + +int SurfaceImpl::WidthChar(Font &font_,char ch) +{ + if (setFont(font_)) + return painter -> fontMetrics().width(ch); + + return 1; +} + +int SurfaceImpl::Ascent(Font &font_) +{ + if (setFont(font_)) + return painter -> fontMetrics().ascent(); + + return 1; +} + +int SurfaceImpl::Descent(Font &font_) +{ + // Qt doesn't include the baseline in the descent, so add it. + + if (setFont(font_)) + return painter -> fontMetrics().descent() + 1; + + return 1; +} + +int SurfaceImpl::ExternalLeading(Font &font_) +{ + if (setFont(font_)) + return painter -> fontMetrics().leading(); + + return 0; +} + +int SurfaceImpl::Height(Font &font_) +{ + if (setFont(font_)) + return painter -> fontMetrics().height(); + + return 1; +} + +void SurfaceImpl::SetClip(PRectangle rc) +{ + painter -> setClipRect(rc.left,rc.top, + rc.right - rc.left,rc.bottom - rc.top); +} + +// Set the painter font if there is one. Return true if it was set. +bool SurfaceImpl::setFont(Font &font_) +{ + QFont *f = PFont(font_.GetID()); + + if (f) + painter -> setFont(*f); + + return f; +} + +// Convert a Scintilla string to a Qt Unicode string. +QString SurfaceImpl::convertText(const char *s,int len) +{ + if (unicodeMode) + return QString::fromUtf8(s,len); + + QString qs; + + qs.setLatin1(s,len); + + return qs; +} + +// Convert a Scintilla colour and alpha component to a Qt QRgb. +QRgb SurfaceImpl::convertQRgb(const ColourAllocated &col, unsigned alpha) +{ + long c = col.AsLong(); + + unsigned r = c & 0xff; + unsigned g = (c >> 8) & 0xff; + unsigned b = (c >> 16) & 0xff; + + QRgb rgba = (alpha << 24) | (r << 16) | (g << 8) | b; + + return rgba; +} + +// Convert a Scintilla colour, and optional alpha component, to a Qt QColor. +QColor SurfaceImpl::convertQColor(const ColourAllocated &col, unsigned alpha) +{ + return QColor(convertQRgb(col, alpha)); +} + + +// Window (widget) management. +Window::~Window() +{ +} + +void Window::Destroy() +{ + QWidget *w = PWindow(id); + + if (w) + { + delete w; + id = 0; + } +} + +bool Window::HasFocus() +{ + return PWindow(id) -> hasFocus(); +} + +PRectangle Window::GetPosition() +{ + QWidget *w = PWindow(id); + + // Before any size allocated pretend its big enough not to be scrolled. + PRectangle rc(0,0,5000,5000); + + if (w) + { + const QRect &r = w -> geometry(); + + rc.left = r.left(); + rc.top = r.top(); + rc.right = r.right() + 1; + rc.bottom = r.bottom() + 1; + } + + return rc; +} + +void Window::SetPosition(PRectangle rc) +{ + PWindow(id) -> setGeometry(rc.left,rc.top, + rc.right - rc.left,rc.bottom - rc.top); +} + +void Window::SetPositionRelative(PRectangle rc,Window relativeTo) +{ + QWidget *rel = PWindow(relativeTo.id); + QPoint pos = rel -> mapToGlobal(rel -> pos()); + + int x = pos.x() + rc.left; + int y = pos.y() + rc.top; + + PWindow(id) -> setGeometry(x,y,rc.right - rc.left,rc.bottom - rc.top); +} + +PRectangle Window::GetClientPosition() +{ + return GetPosition(); +} + +void Window::Show(bool show) +{ + QWidget *w = PWindow(id); + + if (show) + w -> show(); + else + w -> hide(); +} + +void Window::InvalidateAll() +{ + QWidget *w = PWindow(id); + + if (w) + w -> update(); +} + +void Window::InvalidateRectangle(PRectangle rc) +{ + QWidget *w = PWindow(id); + + if (w) + w -> update(rc.left,rc.top, + rc.right - rc.left,rc.bottom - rc.top); +} + +void Window::SetFont(Font &font) +{ + PWindow(id) -> setFont(*PFont(font.GetID())); +} + +void Window::SetCursor(Cursor curs) +{ + Qt::CursorShape qc; + + switch (curs) + { + case cursorText: + qc = Qt::IbeamCursor; + break; + + case cursorUp: + qc = Qt::UpArrowCursor; + break; + + case cursorWait: + qc = Qt::WaitCursor; + break; + + case cursorHoriz: + qc = Qt::SizeHorCursor; + break; + + case cursorVert: + qc = Qt::SizeVerCursor; + break; + + case cursorHand: + qc = Qt::PointingHandCursor; + break; + + default: + qc = Qt::ArrowCursor; + } + + PWindow(id) -> setCursor(qc); +} + +void Window::SetTitle(const char *s) +{ + PWindow(id) -> setCaption(s); +} + + +// Menu management. +Menu::Menu() : id(0) +{ +} + +void Menu::CreatePopUp() +{ + Destroy(); + id = new QPopupMenu(); +} + +void Menu::Destroy() +{ + QPopupMenu *m = PMenu(id); + + if (m) + { + delete m; + id = 0; + } +} + +void Menu::Show(Point pt,Window &) +{ + PMenu(id) -> popup(QPoint(pt.x,pt.y)); +} + + +class DynamicLibraryImpl : public DynamicLibrary +{ +public: + DynamicLibraryImpl(const char *modulePath) + { + m = new QLibrary(modulePath); + m -> load(); + } + + virtual ~DynamicLibraryImpl() + { + if (m) + delete m; + } + + virtual Function FindFunction(const char *name) + { + if (m) + return m -> resolve(name); + + return 0; + } + + virtual bool IsValid() + { + return m && m -> isLoaded(); + } + +private: + QLibrary* m; +}; + +DynamicLibrary *DynamicLibrary::Load(const char *modulePath) +{ + return new DynamicLibraryImpl(modulePath); +} + + +// Elapsed time. This implementation assumes that the maximum elapsed time is +// less than 48 hours. +ElapsedTime::ElapsedTime() +{ + QTime now = QTime::currentTime(); + + bigBit = now.hour() * 60 * 60 + now.minute() * 60 + now.second(); + littleBit = now.msec(); +} + +double ElapsedTime::Duration(bool reset) +{ + long endBigBit, endLittleBit; + QTime now = QTime::currentTime(); + + endBigBit = now.hour() * 60 * 60 + now.minute() * 60 + now.second(); + endLittleBit = now.msec(); + + double duration = endBigBit - bigBit; + + if (duration < 0 || (duration == 0 && endLittleBit < littleBit)) + duration += 24 * 60 * 60; + + duration += (endLittleBit - littleBit) / 1000.0; + + if (reset) + { + bigBit = endBigBit; + littleBit = endLittleBit; + } + + return duration; +} + + +// Manage system wide parameters. +ColourDesired Platform::Chrome() +{ + return ColourDesired(0xe0,0xe0,0xe0); +} + +ColourDesired Platform::ChromeHighlight() +{ + return ColourDesired(0xff,0xff,0xff); +} + +const char *Platform::DefaultFont() +{ + return QApplication::font().family(); +} + +int Platform::DefaultFontSize() +{ + return QApplication::font().pointSize(); +} + +unsigned int Platform::DoubleClickTime() +{ + return QApplication::doubleClickInterval(); +} + +bool Platform::MouseButtonBounce() +{ + return true; +} + +void Platform::DebugDisplay(const char *s) +{ + qDebug("%s",s); +} + +bool Platform::IsKeyDown(int) +{ + return false; +} + +long Platform::SendScintilla(WindowID w,unsigned int msg,unsigned long wParam, + long lParam) +{ + return static_cast(PWindow(w) -> parentWidget()) -> SendScintilla(msg,wParam,lParam); +} + +long Platform::SendScintillaPointer(WindowID w,unsigned int msg, + unsigned long wParam,void *lParam) +{ + return static_cast(PWindow(w) -> parentWidget()) -> SendScintilla(msg,wParam,reinterpret_cast(lParam)); +} + +bool Platform::IsDBCSLeadByte(int codepage,char ch) +{ + // We don't support DBCS. + return false; +} + +int Platform::DBCSCharLength(int codePage,const char *s) +{ + // We don't support DBCS. + return 1; +} + +int Platform::DBCSCharMaxLength() +{ + // We don't support DBCS. + return 2; +} + +int Platform::Minimum(int a,int b) +{ + return (a < b) ? a : b; +} + +int Platform::Maximum(int a,int b) +{ + return (a > b) ? a : b; +} + +int Platform::Clamp(int val,int minVal,int maxVal) +{ + if (val > maxVal) + val = maxVal; + + if (val < minVal) + val = minVal; + + return val; +} + + +//#define TRACE + +#ifdef TRACE +void Platform::DebugPrintf(const char *format, ...) +{ + char buffer[2000]; + va_list pArguments; + + va_start(pArguments,format); + vsprintf(buffer,format,pArguments); + va_end(pArguments); + + DebugDisplay(buffer); +} +#else +void Platform::DebugPrintf(const char *, ...) +{ +} +#endif + +static bool assertionPopUps = true; + +bool Platform::ShowAssertionPopUps(bool assertionPopUps_) +{ + bool ret = assertionPopUps; + + assertionPopUps = assertionPopUps_; + + return ret; +} + +void Platform::Assert(const char *c,const char *file,int line) +{ + qFatal("Assertion [%s] failed at %s %d\n",c,file,line); +} diff --git a/qt/SciListBox.cpp b/qt/SciListBox.cpp new file mode 100644 index 0000000..4808ffa --- /dev/null +++ b/qt/SciListBox.cpp @@ -0,0 +1,328 @@ +// This module implements the specialisation of QListBox that handles the +// Scintilla double-click callback. +// +// Copyright (c) 2006 +// Riverbank Computing Limited +// +// This file is part of QScintilla. +// +// This copy of QScintilla is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2, or (at your option) any +// later version. +// +// QScintilla is supplied 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 +// QScintilla; see the file LICENSE. If not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +#include +#include + +#include +#include +#include + +#include "SciListBox.h" + + +// The platform specific specialisation of the ListBox abstract class. + +class ListBoxX : public ListBox +{ +public: + ListBoxX(); + virtual ~ListBoxX(); + + CallBackAction cb_action; + void *cb_data; + + virtual void SetFont(Font &font); + virtual void Create(Window &parent,int,Point,int,bool); + virtual void SetAverageCharWidth(int); + virtual void SetVisibleRows(int); + virtual int GetVisibleRows() const; + virtual PRectangle GetDesiredRect(); + virtual int CaretFromEdge(); + virtual void Clear(); + virtual void Append(char *s,int type = -1); + virtual int Length(); + virtual void Select(int n); + virtual int GetSelection(); + virtual int Find(const char *prefix); + virtual void GetValue(int n,char *value,int len); + virtual void Sort(); + virtual void RegisterImage(int type,const char *xpm_data); + virtual void ClearRegisteredImages(); + virtual void SetDoubleClickAction(CallBackAction action,void *data); + virtual void SetList(const char *list,char separator,char typesep); + +private: + SciListBox *slb; + + typedef QMap xpmMap; + xpmMap xset; +}; + + +ListBoxX::ListBoxX() : cb_action(0), cb_data(0), slb(0) +{ +} + + +ListBoxX::~ListBoxX() +{ +} + + +void ListBoxX::SetFont(Font &font) +{ + QFont *f = reinterpret_cast(font.GetID()); + + if (f) + slb -> setFont(*f); +} + + +void ListBoxX::Create(Window &parent,int,Point,int,bool) +{ + // The parent we want is the QextScintillaBase, not the text area. + id = slb = new SciListBox(reinterpret_cast(parent.GetID()) -> parentWidget(),this); +} + + +void ListBoxX::SetAverageCharWidth(int) +{ + // We rely on QListBox::sizeHint() for the size of the list box rather + // than make calculations based on the average character width and the + // number of visible rows. +} + + +void ListBoxX::SetVisibleRows(int) +{ +} + + +int ListBoxX::GetVisibleRows() const +{ + return slb -> numItemsVisible(); +} + + +PRectangle ListBoxX::GetDesiredRect() +{ + PRectangle rc(0,0,100,100); + + if (slb) + { + QSize sh = slb -> sizeHint(); + + rc.right = sh.width(); + rc.bottom = sh.height(); + } + + return rc; +} + + +int ListBoxX::CaretFromEdge() +{ + int dist = 0; + + // Find the width of the biggest image. + for (xpmMap::Iterator it = xset.begin(); it != xset.end(); ++it) + { + int w = it.data().width(); + + if (dist < w) + dist = w; + } + + if (slb) + dist += slb -> frameWidth(); + + // Fudge factor - adjust if required. + dist += 3; + + return dist; +} + + +void ListBoxX::Clear() +{ + slb -> clear(); +} + + +void ListBoxX::Append(char *s,int type) +{ + xpmMap::ConstIterator it; + + if (type < 0 || (it = xset.find(type)) == xset.end()) + slb -> insertItem(s); + else + slb -> insertItem(it.data(),s); +} + + +int ListBoxX::Length() +{ + return (slb ? slb -> numRows() : 0); +} + + +void ListBoxX::Select(int n) +{ + slb -> setSelected(n,TRUE); +} + + +int ListBoxX::GetSelection() +{ + return slb -> currentItem(); +} + + +int ListBoxX::Find(const char *prefix) +{ + return slb -> index(slb -> findItem(prefix,Qt::CaseSensitive|Qt::BeginsWith)); +} + + +void ListBoxX::GetValue(int n,char *value,int len) +{ + QString s = slb -> text(n); + + if (s.isNull() || len <= 0) + value[0] = '\0'; + else + { + strncpy(value,s.latin1(),len - 1); + value[len - 1] = '\0'; + } +} + + +void ListBoxX::Sort() +{ + slb -> sort(); +} + + +void ListBoxX::RegisterImage(int type,const char *xpm_data) +{ + xset.insert(type,*reinterpret_cast(xpm_data)); +} + + +void ListBoxX::ClearRegisteredImages() +{ + xset.clear(); +} + + +void ListBoxX::SetDoubleClickAction(CallBackAction action,void *data) +{ + cb_action = action; + cb_data = data; +} + + +void ListBoxX::SetList(const char *list,char separator,char typesep) +{ + char *words; + + Clear(); + + if ((words = strdup(list)) != NULL) + { + char *startword = words; + char *numword = NULL; + + for (int i = 0; words[i] != '\0'; i++) + { + if (words[i] == separator) + { + words[i] = '\0'; + + if (numword) + *numword = '\0'; + + Append(startword,numword ? atoi(numword + 1) : -1); + + startword = words + i + 1; + numword = NULL; + } + else if (words[i] == typesep) + { + numword = words + i; + } + } + + if (startword) + { + if (numword) + *numword = '\0'; + + Append(startword,numword ? atoi(numword + 1) : -1); + } + + free(words); + } +} + + +// The ListBox methods that need to be implemented explicitly. + +ListBox::ListBox() +{ +} + + +ListBox::~ListBox() +{ +} + + +ListBox *ListBox::Allocate() +{ + return new ListBoxX(); +} + + +SciListBox::SciListBox(QWidget *parent,ListBoxX *lbx_) + : QListBox(parent,0,WType_Popup|WStyle_Customize|WStyle_NoBorder|WStaticContents), lbx(lbx_) +{ + setFocusProxy(parent); + + setFrameShape(StyledPanel); + setFrameShadow(Plain); + setHScrollBarMode(AlwaysOff); + + connect(this,SIGNAL(doubleClicked(QListBoxItem *)), + SLOT(handleDoubleClick(QListBoxItem *))); + + connect(this,SIGNAL(highlighted(QListBoxItem *)), + SLOT(ensureCurrentVisible())); +} + + +SciListBox::~SciListBox() +{ + // Ensure that the main widget doesn't get a focus out event when this + // is destroyed. + setFocusProxy(0); +} + + +void SciListBox::handleDoubleClick(QListBoxItem *) +{ + if (lbx && lbx -> cb_action) + lbx -> cb_action(lbx -> cb_data); +} diff --git a/qt/SciListBox.h b/qt/SciListBox.h new file mode 100644 index 0000000..2bbcf7d --- /dev/null +++ b/qt/SciListBox.h @@ -0,0 +1,51 @@ +// This sub-class of QListBox is needed to provide slots from which we can call +// ListBox's double-click callback. (And you thought this was a C++ program.) +// +// Copyright (c) 2006 +// Riverbank Computing Limited +// +// This file is part of QScintilla. +// +// This copy of QScintilla is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2, or (at your option) any +// later version. +// +// QScintilla is supplied 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 +// QScintilla; see the file LICENSE. If not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +#ifndef SCILISTBOX_H +#define SCILISTBOX_H + + +#include + +#include "Platform.h" + + +class ListBoxX; + + +class SciListBox : public QListBox +{ + Q_OBJECT + +public: + SciListBox(QWidget *parent,ListBoxX *lbx_); + ~SciListBox(); + +private slots: + void handleDoubleClick(QListBoxItem *); + +private: + ListBoxX *lbx; +}; + +#endif diff --git a/qt/ScintillaQt.cpp b/qt/ScintillaQt.cpp new file mode 100644 index 0000000..4753785 --- /dev/null +++ b/qt/ScintillaQt.cpp @@ -0,0 +1,692 @@ +// The implementation of the Qt specific subclass of ScintillaBase. +// +// Copyright (c) 2006 +// Riverbank Computing Limited +// +// This file is part of QScintilla. +// +// This copy of QScintilla is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2, or (at your option) any +// later version. +// +// QScintilla is supplied 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 +// QScintilla; see the file LICENSE. If not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "qextscintillabase.h" +#include "ScintillaQt.h" + + +// We want to use the Scintilla notification names as Qt signal names. +#undef SCEN_CHANGE +#undef SCN_AUTOCSELECTION +#undef SCN_CALLTIPCLICK +#undef SCN_CHARADDED +#undef SCN_DOUBLECLICK +#undef SCN_DWELLEND +#undef SCN_DWELLSTART +#undef SCN_HOTSPOTCLICK +#undef SCN_HOTSPOTDOUBLECLICK +#undef SCN_MACRORECORD +#undef SCN_MARGINCLICK +#undef SCN_MODIFIED +#undef SCN_MODIFYATTEMPTRO +#undef SCN_NEEDSHOWN +#undef SCN_PAINTED +#undef SCN_SAVEPOINTLEFT +#undef SCN_SAVEPOINTREACHED +#undef SCN_STYLENEEDED +#undef SCN_UPDATEUI +#undef SCN_USERLISTSELECTION +#undef SCN_ZOOM + +enum +{ + SCEN_CHANGE = 768, + SCN_AUTOCSELECTION = 2022, + SCN_CALLTIPCLICK = 2021, + SCN_CHARADDED = 2001, + SCN_DOUBLECLICK = 2006, + SCN_DWELLEND = 2017, + SCN_DWELLSTART = 2016, + SCN_HOTSPOTCLICK = 2019, + SCN_HOTSPOTDOUBLECLICK = 2020, + SCN_MACRORECORD = 2009, + SCN_MARGINCLICK = 2010, + SCN_MODIFIED = 2008, + SCN_MODIFYATTEMPTRO = 2004, + SCN_NEEDSHOWN = 2011, + SCN_PAINTED = 2013, + SCN_SAVEPOINTLEFT = 2003, + SCN_SAVEPOINTREACHED = 2002, + SCN_STYLENEEDED = 2000, + SCN_UPDATEUI = 2007, + SCN_USERLISTSELECTION = 2014, + SCN_ZOOM = 2018 +}; + + +// The ctor. +ScintillaQt::ScintillaQt(QextScintillaBase *qsb_) : + capturedMouse(false), qsb(qsb_) +{ + wMain = qsb -> txtarea; + + // We aren't a QObject so we use the API class to do QObject related + // things for us. + qsb -> connect(&qtimer,SIGNAL(timeout()),SLOT(handleTimer())); + + Initialise(); +} + + +// The dtor. +ScintillaQt::~ScintillaQt() +{ + Finalise(); +} + + +// Initialise the instance. +void ScintillaQt::Initialise() +{ + SetTicking(true); +} + + +// Tidy up the instance. +void ScintillaQt::Finalise() +{ + SetTicking(false); + ScintillaBase::Finalise(); +} + + +// Start a drag. +void ScintillaQt::StartDrag() +{ + // Allow applications to re-implement the drag start. + qsb -> startDrag(); +} + + +// Do the real drag start. +void ScintillaQt::StartDragImpl() +{ + QDragObject *dobj = new QTextDrag(textRange(&drag),qsb -> txtarea); + + // Remove the dragged text if it was a move to another widget or + // application. + if (dobj -> drag() && dobj -> target() != qsb -> txtarea) + ClearSelection(); + + inDragDrop = false; + SetDragPosition(invalidPosition); +} + + +// Handle a drag enter event. +void ScintillaQt::dragEnterEvent(QDragEnterEvent *dee) +{ + dragMoveEvent(dee); +} + + +// Handle a drag move event. +void ScintillaQt::dragMoveEvent(QDragMoveEvent *dme) +{ + dme -> acceptAction(QTextDrag::canDecode(dme)); + SetDragPosition(PositionFromLocation(Point(dme -> pos().x(),dme -> pos().y()))); +} + + +// Handle a drag leave event. +void ScintillaQt::dragLeaveEvent(QDragLeaveEvent *dle) +{ + SetDragPosition(invalidPosition); +} + + +// Handle a drop event. +void ScintillaQt::dropEvent(QDropEvent *de) +{ + QString text; + + if (QTextDrag::decode(de,text)) + { + bool moving = (de -> source() == qsb -> txtarea && de -> action() == QDropEvent::Move); + + de -> acceptAction(); + + const char *s; + QCString us; + + if (IsUnicodeMode()) + { + us = text.utf8(); + s = us.data(); + } + else + s = text.latin1(); + + DropAt(posDrop,s,moving,false); + SetDragPosition(invalidPosition); + Redraw(); + } +} + + +// Re-implement to trap certain messages. +sptr_t ScintillaQt::WndProc(unsigned int iMessage,uptr_t wParam,sptr_t lParam) +{ + switch (iMessage) + { + case SCI_GRABFOCUS: + PWindow(wMain) -> setFocus(); + return 0; + + case SCI_GETDIRECTFUNCTION: + return reinterpret_cast(DirectFunction); + + case SCI_GETDIRECTPOINTER: + return reinterpret_cast(this); + } + + return ScintillaBase::WndProc(iMessage,wParam,lParam); +} + + +// Windows nonsense. +sptr_t ScintillaQt::DefWndProc(unsigned int,uptr_t,sptr_t) +{ + return 0; +} + + +// Manage the timer. +void ScintillaQt::SetTicking(bool on) +{ + if (timer.ticking != on) + { + timer.ticking = on; + + if (timer.ticking) + qtimer.start(timer.tickSize); + else + qtimer.stop(); + } + + timer.ticksToWait = caret.period; +} + + +// Grab or release the mouse (and keyboard). +void ScintillaQt::SetMouseCapture(bool on) +{ + if (mouseDownCaptures) + if (on) + PWindow(wMain) -> grabMouse(); + else + PWindow(wMain) -> releaseMouse(); + + capturedMouse = on; +} + + +// Return true if the mouse/keyboard are currently grabbed. +bool ScintillaQt::HaveMouseCapture() +{ + return capturedMouse; +} + + +// Set the position of the vertical scrollbar. +void ScintillaQt::SetVerticalScrollPos() +{ + qsb -> vsb -> setValue(topLine); +} + + +// Set the position of the horizontal scrollbar. +void ScintillaQt::SetHorizontalScrollPos() +{ + qsb -> hsb -> setValue(xOffset); +} + + +// Set the extent of the vertical and horizontal scrollbars and return true if +// the view needs re-drawing. +bool ScintillaQt::ModifyScrollBars(int nMax,int nPage) +{ + qsb -> vsb -> setMinValue(0); + qsb -> vsb -> setMaxValue(nMax - nPage + 1); + qsb -> vsb -> setLineStep(1); + qsb -> vsb -> setPageStep(nPage); + + qsb -> hsb -> setMinValue(0); + qsb -> hsb -> setMaxValue(scrollWidth); + qsb -> hsb -> setPageStep(scrollWidth / 10); + + return true; +} + + +// Called after SCI_SETWRAPMODE and SCI_SETHSCROLLBAR. +void ScintillaQt::ReconfigureScrollBars() +{ + // Hide or show the scrollbars if needed. + if (horizontalScrollBarVisible && wrapState == eWrapNone) + qsb->hsb->show(); + else + qsb->hsb->hide(); + + if (verticalScrollBarVisible) + qsb->vsb->show(); + else + qsb->vsb->hide(); +} + + +// Notify interested parties of any change in the document. +void ScintillaQt::NotifyChange() +{ + emit qsb -> SCEN_CHANGE(); +} + + +// Notify interested parties of various events. This is the main mapping +// between Scintilla notifications and Qt signals. +void ScintillaQt::NotifyParent(SCNotification scn) +{ + switch (scn.nmhdr.code) + { + case SCN_CALLTIPCLICK: + emit qsb -> SCN_CALLTIPCLICK(scn.position); + break; + + case SCN_AUTOCSELECTION: + emit qsb -> SCN_AUTOCSELECTION(scn.text,scn.lParam); + break; + + case SCN_CHARADDED: + emit qsb -> SCN_CHARADDED(scn.ch); + break; + + case SCN_DOUBLECLICK: + emit qsb -> SCN_DOUBLECLICK(); + break; + + case SCN_DWELLEND: + emit qsb -> SCN_DWELLEND(scn.position,scn.x,scn.y); + break; + + case SCN_DWELLSTART: + emit qsb -> SCN_DWELLSTART(scn.position,scn.x,scn.y); + break; + + case SCN_HOTSPOTCLICK: + emit qsb -> SCN_HOTSPOTCLICK(scn.position,scn.modifiers); + break; + + case SCN_HOTSPOTDOUBLECLICK: + emit qsb -> SCN_HOTSPOTDOUBLECLICK(scn.position,scn.modifiers); + break; + + case SCN_MACRORECORD: + emit qsb -> SCN_MACRORECORD(scn.message,scn.wParam,scn.lParam); + break; + + case SCN_MARGINCLICK: + emit qsb -> SCN_MARGINCLICK(scn.position,scn.modifiers, + scn.margin); + break; + + case SCN_MODIFIED: + emit qsb -> SCN_MODIFIED(scn.position,scn.modificationType, + scn.text,scn.length,scn.linesAdded, + scn.line,scn.foldLevelNow, + scn.foldLevelPrev); + break; + + case SCN_MODIFYATTEMPTRO: + emit qsb -> SCN_MODIFYATTEMPTRO(); + break; + + case SCN_NEEDSHOWN: + emit qsb -> SCN_NEEDSHOWN(scn.position,scn.length); + break; + + case SCN_PAINTED: + emit qsb -> SCN_PAINTED(); + break; + + case SCN_SAVEPOINTLEFT: + emit qsb -> SCN_SAVEPOINTLEFT(); + break; + + case SCN_SAVEPOINTREACHED: + emit qsb -> SCN_SAVEPOINTREACHED(); + break; + + case SCN_STYLENEEDED: + emit qsb -> SCN_STYLENEEDED(scn.position); + break; + + case SCN_UPDATEUI: + emit qsb -> SCN_UPDATEUI(); + break; + + case SCN_USERLISTSELECTION: + emit qsb -> SCN_USERLISTSELECTION(scn.text,scn.wParam); + break; + + case SCN_ZOOM: + emit qsb -> SCN_ZOOM(); + break; + + default: + qWarning("Unknown notification: %u",scn.nmhdr.code); + } +} + + +// Handle a key that hasn't been filtered out as a command key. Return 0 if we +// haven't handled it. +int ScintillaQt::KeyDefault(int key,int modifiers) +{ + // On Windows Alt Gr is returned as Ctrl-Alt (on X11 it seems to be the + // Meta key). We therefore ignore that combination. +#if defined(Q_OS_WIN) + modifiers &= (SCI_CTRL | SCI_ALT); + + if (modifiers == SCI_CTRL || modifiers == SCI_ALT) + return 0; +#else + if (modifiers & (SCI_CTRL | SCI_ALT)) + return 0; +#endif + + AddChar(key); + + return 1; +} + + +// Convert a text range to a QString. +QString ScintillaQt::textRange(const SelectionText *text) +{ + QString qs; + + if (text -> s) + if (IsUnicodeMode()) + qs = QString::fromUtf8(text -> s); + else + qs.setLatin1(text -> s); + + return qs; +} + + +// Copy the selected text to the clipboard. +void ScintillaQt::CopyToClipboard(const SelectionText &selectedText) +{ + QApplication::clipboard() -> setText(textRange(&selectedText)); +} + + +// Implement copy. +void ScintillaQt::Copy() +{ + if (currentPos != anchor) + { + SelectionText text; + + CopySelectionRange(&text); + CopyToClipboard(text); + } +} + + +// Implement paste. +void ScintillaQt::Paste() +{ + QString str = QApplication::clipboard() -> text(); + + if (str.isEmpty()) + return; + + pdoc -> BeginUndoAction(); + + ClearSelection(); + + int len; + + if (IsUnicodeMode()) + { + QCString s = str.utf8(); + + len = s.length(); + + if (len) + pdoc -> InsertString(currentPos,s.data(),len); + } + else + { + const char *s = str.latin1(); + + len = (s ? strlen(s) : 0); + + if (len) + pdoc -> InsertString(currentPos,s,len); + } + + SetEmptySelection(currentPos + len); + + pdoc -> EndUndoAction(); + + NotifyChange(); + Redraw(); +} + + +// A simple QWidget sub-class to implement a call tip. No need to bother with +// all the moc stuff. +class QtCallTip : public QWidget +{ +public: + QtCallTip(QWidget *parent,ScintillaQt *sci_); + ~QtCallTip(); + +protected: + void paintEvent(QPaintEvent *); + void mousePressEvent(QMouseEvent *me); + +private: + ScintillaQt *sci; +}; + + +// Create a call tip. +QtCallTip::QtCallTip(QWidget *parent,ScintillaQt *sci_) : + QWidget(parent,0,WType_Popup|WStyle_Customize|WStyle_NoBorder), sci(sci_) +{ + // Ensure that the main window keeps the focus (and the caret flashing) + // when this is displayed. + setFocusProxy(parent); +} + + +// Destroy a call tip. +QtCallTip::~QtCallTip() +{ + // Ensure that the main window doesn't receive a focus out event when + // this is destroyed. + setFocusProxy(0); +} + + +// Paint a call tip. +void QtCallTip::paintEvent(QPaintEvent *) +{ + Surface *surfaceWindow = Surface::Allocate(); + + if (surfaceWindow) + { + QPainter p(this); + + surfaceWindow -> Init(&p,0); + sci -> ct.PaintCT(surfaceWindow); + surfaceWindow -> Release(); + + delete surfaceWindow; + } +} + + +// Handle a mouse press in a call tip. +void QtCallTip::mousePressEvent(QMouseEvent *me) +{ + Point pt; + + pt.x = me -> x(); + pt.y = me -> y(); + + sci -> ct.MouseClick(pt); + sci -> CallTipClick(); +} + + +// Create a call tip window. +void ScintillaQt::CreateCallTipWindow(PRectangle rc) +{ + if (!ct.wCallTip.Created()) + ct.wCallTip = ct.wDraw = new QtCallTip(qsb,this); + + PWindow(ct.wCallTip) -> resize(rc.right - rc.left,rc.bottom - rc.top); + ct.wCallTip.Show(); +} + + +// Add an item to the right button menu. +void ScintillaQt::AddToPopUp(const char *label,int cmd,bool enabled) +{ + QPopupMenu *pm = static_cast(popup.GetID()); + + if (label[0] != '\0') + { + QString tr_label = qApp -> translate("ContextMenu",label); + + pm -> insertItem(tr_label,qsb,SLOT(handlePopUp(int)),0,cmd); + pm -> setItemEnabled(cmd,enabled); + } + else + pm -> insertSeparator(); +} + + +// Claim the selection. +void ScintillaQt::ClaimSelection() +{ + bool isSel = (currentPos != anchor); + + if (isSel) + { + QClipboard *cb = QApplication::clipboard(); + + // If we support X11 style selection then make it available + // now. + if (cb -> supportsSelection()) + { + SelectionText text; + + CopySelectionRange(&text); + + if (text.s) + { + cb -> setSelectionMode(TRUE); + cb -> setText(text.s); + cb -> setSelectionMode(FALSE); + } + } + + primarySelection = true; + } + else + primarySelection = false; + + emit qsb -> QSCN_SELCHANGED(isSel); +} + + +// Unclaim the selection. +void ScintillaQt::UnclaimSelection() +{ + if (primarySelection) + { + primarySelection = false; + qsb -> txtarea -> update(); + } +} + + +// Implemented to provide compatibility with the Windows version. +sptr_t ScintillaQt::DirectFunction(ScintillaQt *sciThis,unsigned int iMessage, + uptr_t wParam,sptr_t lParam) +{ + return sciThis -> WndProc(iMessage,wParam,lParam); +} + + +// Draw the contents of the widget. +void ScintillaQt::paintEvent(QPaintEvent *pe) +{ + bool isUnicodeMode = (pdoc && pdoc -> dbcsCodePage == SC_CP_UTF8); + + paintState = painting; + + const QRect &qr = pe -> rect(); + + rcPaint.left = qr.left(); + rcPaint.top = qr.top(); + rcPaint.right = qr.right() + 1; + rcPaint.bottom = qr.bottom() + 1; + + PRectangle rcText = GetTextRectangle(); + paintingAllText = rcPaint.Contains(rcText); + + Surface *sw = Surface::Allocate(); + + if (sw) + { + QPainter painter(PWindow(wMain)); + + sw -> Init(&painter,0); + sw -> SetUnicodeMode(isUnicodeMode); + Paint(sw,rcPaint); + sw -> Release(); + delete sw; + + // If the painting area was insufficient to cover the new style + // or brace highlight positions then repaint the whole thing. + if (paintState == paintAbandoned) + PWindow(wMain) -> update(); + } + + paintState = notPainting; +} diff --git a/qt/ScintillaQt.h b/qt/ScintillaQt.h new file mode 100644 index 0000000..3190b71 --- /dev/null +++ b/qt/ScintillaQt.h @@ -0,0 +1,117 @@ +// The definition of the Qt specific subclass of ScintillaBase. +// +// Copyright (c) 2006 +// Riverbank Computing Limited +// +// This file is part of QScintilla. +// +// This copy of QScintilla is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2, or (at your option) any +// later version. +// +// QScintilla is supplied 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 +// QScintilla; see the file LICENSE. If not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +#ifndef SCINTILLAQT_H +#define SCINTILLAQT_H + + +#include + +// These are needed because scintilla class header files don't seem to manage +// their own dependencies properly. +#include +#include +#include "Platform.h" +#include "Scintilla.h" +#include "SVector.h" +#include "CellBuffer.h" +#include "CharClassify.h" +#include "Document.h" +#include "Style.h" +#include "XPM.h" +#include "LineMarker.h" +#include "Indicator.h" +#include "ViewStyle.h" +#include "KeyMap.h" +#include "ContractionState.h" +#include "Editor.h" +#include "AutoComplete.h" +#include "CallTip.h" +#include "SString.h" +#include "PropSet.h" +#include "Accessor.h" +#include "KeyWords.h" + +#include "ScintillaBase.h" + + +class QPaintEvent; +class QextScintillaBase; +class QtCallTip; + + +class ScintillaQt : public ScintillaBase +{ + friend class QextScintillaBase; + friend class QtCallTip; + +public: + ScintillaQt(QextScintillaBase *qsb_); + virtual ~ScintillaQt(); + + virtual sptr_t WndProc(unsigned int iMessage,uptr_t wParam, + sptr_t lParam); + +private: + QWidget *PWindow(Window &w) + { + return reinterpret_cast(w.GetID()); + } + + void Initialise(); + void Finalise(); + void StartDrag(); + void StartDragImpl(); + sptr_t DefWndProc(unsigned int,uptr_t,sptr_t); + void SetTicking(bool); + void SetMouseCapture(bool on); + bool HaveMouseCapture(); + void SetVerticalScrollPos(); + void SetHorizontalScrollPos(); + bool ModifyScrollBars(int nMax,int nPage); + void ReconfigureScrollBars(); + void NotifyChange(); + void NotifyParent(SCNotification scn); + int KeyDefault(int key,int modifiers); + void CopyToClipboard(const SelectionText &selectedText); + void Copy(); + void Paste(); + void CreateCallTipWindow(PRectangle rc); + void AddToPopUp(const char *label,int cmd = 0,bool enabled = true); + void ClaimSelection(); + void UnclaimSelection(); + static sptr_t DirectFunction(ScintillaQt *sci,unsigned int iMessage, + uptr_t wParam,sptr_t lParam); + + QString textRange(const SelectionText *text); + void paintEvent(QPaintEvent *pe); + void dragEnterEvent(QDragEnterEvent *dee); + void dragMoveEvent(QDragMoveEvent *dme); + void dragLeaveEvent(QDragLeaveEvent *dle); + void dropEvent(QDropEvent *de); + + bool capturedMouse; + QextScintillaBase *qsb; + QTimer qtimer; +}; + +#endif diff --git a/qt/qextscintilla.cpp b/qt/qextscintilla.cpp new file mode 100644 index 0000000..7d3290c --- /dev/null +++ b/qt/qextscintilla.cpp @@ -0,0 +1,3031 @@ +// This module implements the "official" high-level API of the Qt port of +// Scintilla. It is modelled on QTextEdit - a method of the same name should +// behave in the same way. +// +// Copyright (c) 2006 +// Riverbank Computing Limited +// +// This file is part of QScintilla. +// +// This copy of QScintilla is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2, or (at your option) any +// later version. +// +// QScintilla is supplied 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 +// QScintilla; see the file LICENSE. If not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +#include +#include +#include + +#include "qextscintilla.h" +#include "qextscintillalexer.h" +#include "qextscintillaapis.h" +#include "qextscintillacommandset.h" + + +// Make sure these match the values in Scintilla.h. We don't #include that +// file because it just causes more clashes. +#define KEYWORDSET_MAX 8 +#define MARKER_MAX 31 + + +// The default fold margin width. +static const int defaultFoldMarginWidth = 14; + +// The default set of characters that make up a word. +static const char *defaultWordChars = "_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; + + +// The ctor. +QextScintilla::QextScintilla(QWidget *parent,const char *name,WFlags f) + : QextScintillaBase(parent,name,f), allocatedMarkers(0), oldPos(-1), + selText(FALSE), fold(NoFoldStyle), autoInd(FALSE), + braceMode(NoBraceMatch), acSource(AcsDocument), acThresh(-1), + acStart(""), acAPIs(0), ctAPIs(0), maxCallTips(-1), + showSingle(FALSE), modified(FALSE), explicit_fillups(FALSE), + fillups_enabled(FALSE), saved_fillups("") +{ + connect(this,SIGNAL(SCN_MODIFYATTEMPTRO()), + SIGNAL(modificationAttempted())); + + connect(this,SIGNAL(SCN_MODIFIED(int,int,const char *,int,int,int,int,int)), + SLOT(handleModified(int,int,const char *,int,int,int,int,int))); + connect(this,SIGNAL(SCN_CALLTIPCLICK(int)), + SLOT(handleCallTipClick(int))); + connect(this,SIGNAL(SCN_CHARADDED(int)), + SLOT(handleCharAdded(int))); + connect(this,SIGNAL(SCN_MARGINCLICK(int,int,int)), + SLOT(handleMarginClick(int,int,int))); + connect(this,SIGNAL(SCN_SAVEPOINTREACHED()), + SLOT(handleSavePointReached())); + connect(this,SIGNAL(SCN_SAVEPOINTLEFT()), + SLOT(handleSavePointLeft())); + connect(this,SIGNAL(SCN_UPDATEUI()), + SLOT(handleUpdateUI())); + connect(this,SIGNAL(QSCN_SELCHANGED(bool)), + SLOT(handleSelectionChanged(bool))); + connect(this,SIGNAL(SCN_USERLISTSELECTION(const char *,int)), + SLOT(handleUserListSelection(const char *,int))); + + // Set the default font. + setFont(QApplication::font()); + + // Set the default fore and background colours. + QColorGroup cg = QApplication::palette().active(); + setColor(cg.text()); + setPaper(cg.base()); + +#if defined(Q_OS_WIN) + setEolMode(EolWindows); +#elif defined(Q_OS_MAC) + setEolMode(EolMac); +#else + setEolMode(EolUnix); +#endif + + // Capturing the mouse seems to cause problems on multi-head systems. + // Qt should do the right thing anyway. + SendScintilla(SCI_SETMOUSEDOWNCAPTURES,0UL); + + SendScintilla(SCI_SETPROPERTY,"fold","1"); + + setMatchedBraceForegroundColor(blue); + setUnmatchedBraceForegroundColor(red); + + setLexer(); + + // Set the visible policy. These are the same as SciTE's defaults + // which, presumably, are sensible. + SendScintilla(SCI_SETVISIBLEPOLICY,VISIBLE_STRICT|VISIBLE_SLOP,4); + + // Create the standard command set. + stdCmds = new QextScintillaCommandSet(this); + + doc.display(this,0); +} + + +// The dtor. +QextScintilla::~QextScintilla() +{ + doc.undisplay(this); + delete stdCmds; +} + + +// Return the current text colour. +QColor QextScintilla::color() const +{ + return nl_text_colour; +} + + +// Set the text colour. +void QextScintilla::setColor(const QColor &c) +{ + if (lex.isNull()) + { + // Assume style 0 applies to everything so that we don't need to use + // SCI_STYLECLEARALL which clears everything. + SendScintilla(SCI_STYLESETFORE, 0, c); + nl_text_colour = c; + } +} + + +// Return the current paper colour. +QColor QextScintilla::paper() const +{ + return nl_paper_colour; +} + + +// Set the paper colour. +void QextScintilla::setPaper(const QColor &c) +{ + if (lex.isNull()) + { + // Assume style 0 applies to everything so that we don't need to use + // SCI_STYLECLEARALL which clears everything. We still have to set the + // default style as well for the background without any text. + SendScintilla(SCI_STYLESETBACK, 0, c); + SendScintilla(SCI_STYLESETBACK, STYLE_DEFAULT, c); + nl_paper_colour = c; + } +} + + +// Set the default font. +void QextScintilla::setFont(const QFont &f) +{ + if (lex.isNull()) + { + // Assume style 0 applies to everything so that we don't need to use + // SCI_STYLECLEARALL which clears everything. + setStylesFont(f, 0); + nl_font = f; + } +} + + +// Enable/disable auto-indent. +void QextScintilla::setAutoIndent(bool autoindent) +{ + autoInd = autoindent; +} + + +// Set the brace matching mode. +void QextScintilla::setBraceMatching(BraceMatch bm) +{ + braceMode = bm; +} + + +// Handle the addition of a character. +void QextScintilla::handleCharAdded(int ch) +{ + // Ignore if there is a selection. + long pos = SendScintilla(SCI_GETSELECTIONSTART); + + if (pos != SendScintilla(SCI_GETSELECTIONEND) || pos == 0) + return; + + // If auto-completion is already active then see if this character is a + // start character. If it is then create a new list which will be a + // subset of the current one. The case where it isn't a start + // character seem to be handled correctly elsewhere. + if (isListActive()) + { + if (isAutoCStartChar(ch)) + { + cancelList(); + startAutoCompletion(acSource, FALSE, FALSE); + } + + return; + } + + // Handle call tips. + if (strchr("(),", ch) != NULL) + callTip(); + + // Handle auto-indentation. + if (autoInd) + if (lex.isNull() || (lex -> autoIndentStyle() & AiMaintain)) + maintainIndentation(ch,pos); + else + autoIndentation(ch,pos); + + // See if we might want to start auto-completion. + if (!isCallTipActive()) + if (isAutoCStartChar(ch)) + startAutoCompletion(acSource, FALSE, FALSE); + else if (acThresh >= 1 && isWordChar(ch)) + startAutoCompletion(acSource, TRUE, FALSE); +} + + +// See if a call tip is active. +bool QextScintilla::isCallTipActive() +{ + return SendScintilla(SCI_CALLTIPACTIVE); +} + + +// Handle a possible change to any current call tip. +void QextScintilla::callTip() +{ + if (!ctAPIs) + return; + + long pos = SendScintilla(SCI_GETCURRENTPOS); + long linenr = SendScintilla(SCI_LINEFROMPOSITION,pos); + long linelen = SendScintilla(SCI_LINELENGTH,linenr); + + char *lbuf = new char[linelen + 1]; + + int loff = SendScintilla(SCI_GETCURLINE,linelen + 1,lbuf); + + int commas = 0, start = -1; + + // Move backwards through the line looking for the start of the current + // call tip and working out which argument it is. + while (loff > 0) + { + char ch = lbuf[--loff]; + + if (ch == ',') + ++commas; + else if (ch == ')') + { + int depth = 1; + + // Ignore everything back to the start of the + // corresponding parenthesis. + while (loff > 0) + { + ch = lbuf[--loff]; + + if (ch == ')') + ++depth; + else if (ch == '(' && --depth == 0) + break; + } + } + else if (ch == '(' && loff > 0) + { + if (isWordChar(lbuf[loff - 1])) + { + // The parenthesis is preceded by a word so + // find the start of that word. + lbuf[loff--] = '\0'; + + while (loff >= 0) + { + if (!isWordChar(lbuf[loff]) && !isAutoCStartChar(lbuf[loff])) + break; + + --loff; + } + + start = loff + 1; + break; + } + + // We are between parentheses that do not correspond to + // a call tip, so reset the argument count. + commas = 0; + } + } + + // Cancel any existing call tip. + SendScintilla(SCI_CALLTIPCANCEL); + + // Done if there is no new call tip to set. + if (start < 0) + { + delete []lbuf; + return; + } + + QString ct = ctAPIs -> callTips(&lbuf[start],maxCallTips,commas); + + delete []lbuf; + + if (ct.isEmpty()) + return; + + ctpos = SendScintilla(SCI_POSITIONFROMLINE,linenr) + start; + + SendScintilla(SCI_CALLTIPSHOW,ctpos,ct.latin1()); + + // Done if there is more than one line in the call tip or there isn't a + // down arrow at the start. + if (ct[0] == '\002' || ct.find('\n') >= 0) + return; + + // Highlight the current argument. + int astart; + + if (commas == 0) + astart = ct.find('('); + else + { + astart = -1; + + do + astart = ct.find(',',astart + 1); + while (astart >= 0 && --commas > 0); + } + + int len = ct.length(); + + if (astart < 0 || ++astart == len) + return; + + // The end is at the next comma or unmatched closing parenthesis. + int aend, depth = 0; + + for (aend = astart; aend < len; ++aend) + { + QChar ch = ct.at(aend); + + if (ch == ',' && depth == 0) + break; + else if (ch == '(') + ++depth; + else if (ch == ')') + { + if (depth == 0) + break; + + --depth; + } + } + + if (astart != aend) + SendScintilla(SCI_CALLTIPSETHLT,astart,aend); +} + + +// Handle a call tip click. +void QextScintilla::handleCallTipClick(int dir) +{ + if (!ctAPIs) + return; + + QString ct = ctAPIs -> callTipsNextPrev(dir); + + if (ct.isNull()) + return; + + SendScintilla(SCI_CALLTIPSHOW,ctpos,ct.latin1()); +} + + +// Possibly start auto-completion. +void QextScintilla::startAutoCompletion(AutoCompletionSource acs, + bool checkThresh, bool single) +{ + // Get the current line. + long len = SendScintilla(SCI_GETCURLINE) + 1; + + char *line = new char[len]; + + int wend = SendScintilla(SCI_GETCURLINE, len, line); + + // Find the start of the auto-completion text. + int wstart = wend; + bool numeric = true; + + while (wstart > 0) + { + char ch = line[wstart - 1]; + + // Don't auto-complete numbers. + if (ch < '0' || ch > '9') + numeric = false; + + if (!isWordChar(ch) && !isAutoCStartChar(ch)) + break; + + --wstart; + } + + int wlen = wend - wstart; + + if (numeric || wlen == 0 || (checkThresh && wlen < acThresh)) + return; + + // Isolate the auto-completion text. + char *word = &line[wstart]; + line[wend] = '\0'; + + // Generate the string representing the valid words to select from. + QStringList wlist; + bool cs = !SendScintilla(SCI_AUTOCGETIGNORECASE); + + if (acs == AcsAll || acs == AcsDocument) + { + SendScintilla(SCI_SETSEARCHFLAGS,SCFIND_WORDSTART | (cs ? SCFIND_MATCHCASE : 0)); + + long pos = 0; + long dlen = SendScintilla(SCI_GETLENGTH); + long caret = SendScintilla(SCI_GETCURRENTPOS); + QString root(word); + + for (;;) + { + long fstart; + + SendScintilla(SCI_SETTARGETSTART,pos); + SendScintilla(SCI_SETTARGETEND,dlen); + + if ((fstart = SendScintilla(SCI_SEARCHINTARGET,wlen,word)) < 0) + break; + + // Move past the root part. + pos = fstart + wlen; + + // Skip if this is the word we are auto-completing. + if (pos == caret) + continue; + + // Get the rest of this word. + QString w(root); + + while (pos < dlen) + { + char ch = SendScintilla(SCI_GETCHARAT,pos); + + if (!isWordChar(ch)) + break; + + w += ch; + + ++pos; + } + + // Add the word if it isn't already there. + if (wlist.findIndex(w) < 0) + wlist.append(w); + } + } + + if ((acs == AcsAll || acs == AcsAPIs) && acAPIs) + acAPIs->autoCompletionList(word, cs, wlist); + + delete []line; + + if (wlist.isEmpty()) + return; + + wlist.sort(); + + const char sep = '\x03'; + + SendScintilla(SCI_AUTOCSETCHOOSESINGLE,single); + SendScintilla(SCI_AUTOCSETSEPARATOR, sep); + SendScintilla(SCI_AUTOCSHOW, wlen, wlist.join(QChar(sep)).latin1()); +} + + +// Check if a character is an auto-completion start character. +bool QextScintilla::isAutoCStartChar(char ch) const +{ + const char *start_chars = 0; + + if (!lex.isNull()) + start_chars = lex->autoCompletionStartCharacters(); + + if (!start_chars) + start_chars = acStart; + + return (strchr(start_chars, ch) != NULL); +} + + +// Maintain the indentation of the previous line. +void QextScintilla::maintainIndentation(char ch,long pos) +{ + if (ch != '\r' && ch != '\n') + return; + + int curr_line = SendScintilla(SCI_LINEFROMPOSITION,pos); + + // Get the indentation of the preceding non-zero length line. + int ind = 0; + + for (int line = curr_line - 1; line >= 0; --line) + { + if (SendScintilla(SCI_GETLINEENDPOSITION,line) > + SendScintilla(SCI_POSITIONFROMLINE,line)) + { + ind = indentation(line); + break; + } + } + + if (ind > 0) + autoIndentLine(pos,curr_line,ind); +} + + +// Implement auto-indentation. +void QextScintilla::autoIndentation(char ch,long pos) +{ + int curr_line = SendScintilla(SCI_LINEFROMPOSITION,pos); + int ind_width = indentationWidth(); + long curr_line_start = SendScintilla(SCI_POSITIONFROMLINE,curr_line); + + const char *block_start = lex -> blockStart(); + bool start_single = (block_start && strlen(block_start) == 1); + + const char *block_end = lex -> blockEnd(); + bool end_single = (block_end && strlen(block_end) == 1); + + if (end_single && block_end[0] == ch) + { + if ((lex -> autoIndentStyle() & AiClosing) && rangeIsWhitespace(curr_line_start,pos - 1)) + autoIndentLine(pos,curr_line,blockIndent(curr_line - 1) - indentationWidth()); + } + else if (start_single && block_start[0] == ch) + { + // De-indent if we have already indented because the previous + // line was a start of block keyword. + if ((lex->autoIndentStyle() & AiOpening) && curr_line > 0 && getIndentState(curr_line - 1) == isKeywordStart && rangeIsWhitespace(curr_line_start, pos - 1)) + autoIndentLine(pos,curr_line,blockIndent(curr_line - 1) - indentationWidth()); + } + else if (ch == '\r' || ch == '\n') + autoIndentLine(pos,curr_line,blockIndent(curr_line - 1)); +} + + +// Set the indentation for a line. +void QextScintilla::autoIndentLine(long pos,int line,int indent) +{ + if (indent < 0) + return; + + long pos_before = SendScintilla(SCI_GETLINEINDENTPOSITION,line); + SendScintilla(SCI_SETLINEINDENTATION,line,indent); + long pos_after = SendScintilla(SCI_GETLINEINDENTPOSITION,line); + long new_pos = -1; + + if (pos_after > pos_before) + new_pos = pos + (pos_after - pos_before); + else if (pos_after < pos_before && pos >= pos_after) + if (pos >= pos_before) + new_pos = pos + (pos_after - pos_before); + else + new_pos = pos_after; + + if (new_pos >= 0) + SendScintilla(SCI_SETSEL,new_pos,new_pos); +} + + +// Return the indentation of the block defined by the given line (or something +// significant before). +int QextScintilla::blockIndent(int line) +{ + if (line < 0) + return 0; + + // Handle the trvial case. + if (!lex -> blockStartKeyword() && !lex -> blockStart() && !lex -> blockEnd()) + return indentation(line); + + int line_limit = line - lex -> blockLookback(); + + if (line_limit < 0) + line_limit = 0; + + for (int l = line; l >= line_limit; --l) + { + IndentState istate = getIndentState(l); + + if (istate != isNone) + { + int ind_width = indentationWidth(); + int ind = indentation(l); + + if (istate == isBlockStart) + { + if (lex -> autoIndentStyle() & AiOpening) + ind += ind_width; + } + else if (istate == isBlockEnd) + { + if (!(lex -> autoIndentStyle() & AiClosing)) + ind -= ind_width; + + if (ind < 0) + ind = 0; + } + else if (line == l) + ind += ind_width; + + return ind; + } + } + + return indentation(line); +} + + +// Return TRUE if all characters starting at spos up to, but not including +// epos, are spaces or tabs. +bool QextScintilla::rangeIsWhitespace(long spos,long epos) +{ + while (spos < epos) + { + char ch = SendScintilla(SCI_GETCHARAT,spos); + + if (ch != ' ' && ch != '\t') + return FALSE; + + ++spos; + } + + return TRUE; +} + + +// Returns the indentation state of a line. +QextScintilla::IndentState QextScintilla::getIndentState(int line) +{ + IndentState istate; + + // Get the styled text. + long spos = SendScintilla(SCI_POSITIONFROMLINE,line); + long epos = SendScintilla(SCI_POSITIONFROMLINE,line + 1); + + char *text = new char[(epos - spos + 1) * 2]; + + SendScintilla(SCI_GETSTYLEDTEXT,spos,epos,text); + + int style, bstart_off, bend_off; + + // Block start/end takes precedence over keywords. + const char *bstart_words = lex->blockStart(&style); + bstart_off = findStyledWord(text, style, bstart_words); + + const char *bend_words = lex->blockEnd(&style); + bend_off = findStyledWord(text, style, bend_words); + + // If there is a block start but no block end characters then ignore it + // unless the block start is the last significant thing on the line, + // ie. assume Python-like blocking. + if (bstart_off >= 0 && !bend_words) + for (int i = bstart_off * 2; text[i] != '\0'; i += 2) + if (!QChar(text[i]).isSpace()) + return isNone; + + if (bstart_off > bend_off) + istate = isBlockStart; + else if (bend_off > bstart_off) + istate = isBlockEnd; + else + { + const char *words = lex->blockStartKeyword(&style); + + istate = (findStyledWord(text,style,words) >= 0) ? isKeywordStart : isNone; + } + + delete[] text; + + return istate; +} + + +// text is a pointer to some styled text (ie. a character byte followed by a +// style byte). style is a style number. words is a space separated list of +// words. Returns the position in the text immediately after the last one of +// the words with the style. The reason we are after the last, and not the +// first, occurance is that we are looking for words that start and end a block +// where the latest one is the most significant. +int QextScintilla::findStyledWord(const char *text,int style,const char *words) +{ + if (!words) + return -1; + + // Find the range of text with the style we are looking for. + const char *stext; + + for (stext = text; stext[1] != style; stext += 2) + if (stext[0] == '\0') + return -1; + + // Move to the last character. + const char *etext = stext; + + while (etext[2] != '\0') + etext += 2; + + // Backtrack until we find the style. There will be one. + while (etext[1] != style) + etext -= 2; + + // Look for each word in turn. + while (words[0] != '\0') + { + // Find the end of the word. + const char *eword = words; + + while (eword[1] != ' ' && eword[1] != '\0') + ++eword; + + // Now search the text backwards. + const char *wp = eword; + + for (const char *tp = etext; tp >= stext; tp -= 2) + { + if (tp[0] != wp[0] || tp[1] != style) + { + // Reset the search. + wp = eword; + continue; + } + + // See if all the word has matched. + if (wp-- == words) + return ((tp - text) / 2) + (eword - words) + 1; + } + + // Move to the start of the next word if there is one. + words = eword + 1; + + if (words[0] == ' ') + ++words; + } + + return -1; +} + + +// Return TRUE if the code page is UTF8. +bool QextScintilla::isUtf8() +{ + return (SendScintilla(SCI_GETCODEPAGE) == SC_CP_UTF8); +} + + +// Set the code page. +void QextScintilla::setUtf8(bool cp) +{ + SendScintilla(SCI_SETCODEPAGE,(cp ? SC_CP_UTF8 : 0)); +} + + +// Return the end-of-line mode. +QextScintilla::EolMode QextScintilla::eolMode() +{ + return (EolMode)SendScintilla(SCI_GETEOLMODE); +} + + +// Set the end-of-line mode. +void QextScintilla::setEolMode(EolMode mode) +{ + SendScintilla(SCI_SETEOLMODE,mode); +} + + +// Convert the end-of-lines to a particular mode. +void QextScintilla::convertEols(EolMode mode) +{ + SendScintilla(SCI_CONVERTEOLS,mode); +} + + +// Return the edge colour. +QColor QextScintilla::edgeColor() +{ + long res = SendScintilla(SCI_GETEDGECOLOUR); + + return QColor((int)res, ((int)(res >> 8)) & 0x00ff, ((int)(res >> 16)) & 0x00ff); +} + + +// Set the edge colour. +void QextScintilla::setEdgeColor(const QColor &col) +{ + SendScintilla(SCI_SETEDGECOLOUR,col); +} + + +// Return the edge column. +int QextScintilla::edgeColumn() +{ + return SendScintilla(SCI_GETEDGECOLUMN); +} + + +// Set the edge column. +void QextScintilla::setEdgeColumn(int colnr) +{ + SendScintilla(SCI_SETEDGECOLUMN,colnr); +} + + +// Return the edge mode. +QextScintilla::EdgeMode QextScintilla::edgeMode() +{ + return (EdgeMode)SendScintilla(SCI_GETEDGEMODE); +} + + +// Set the edge mode. +void QextScintilla::setEdgeMode(EdgeMode mode) +{ + SendScintilla(SCI_SETEDGEMODE,mode); +} + + +// Return the end-of-line visibility. +bool QextScintilla::eolVisibility() +{ + return SendScintilla(SCI_GETVIEWEOL); +} + + +// Set the end-of-line visibility. +void QextScintilla::setEolVisibility(bool visible) +{ + SendScintilla(SCI_SETVIEWEOL,visible); +} + + +// Return the whitespace visibility. +QextScintilla::WhitespaceVisibility QextScintilla::whitespaceVisibility() +{ + return (WhitespaceVisibility)SendScintilla(SCI_GETVIEWWS); +} + + +// Set the whitespace visibility. +void QextScintilla::setWhitespaceVisibility(WhitespaceVisibility mode) +{ + SendScintilla(SCI_SETVIEWWS,mode); +} + + +// Return the line wrap mode. +QextScintilla::WrapMode QextScintilla::wrapMode() +{ + return (WrapMode)SendScintilla(SCI_GETWRAPMODE); +} + + +// Set the line wrap mode. +void QextScintilla::setWrapMode(WrapMode mode) +{ + SendScintilla(SCI_SETLAYOUTCACHE, (mode == WrapNone ? SC_CACHE_CARET : SC_CACHE_DOCUMENT)); + SendScintilla(SCI_SETWRAPMODE, mode); +} + + +// Set the line wrap visual flags. +void QextScintilla::setWrapVisualFlags(WrapVisualFlag eflag, + WrapVisualFlag sflag, int sindent) +{ + int flags = SC_WRAPVISUALFLAG_NONE; + int loc = SC_WRAPVISUALFLAGLOC_DEFAULT; + + if (eflag == WrapFlagByText) + { + flags |= SC_WRAPVISUALFLAG_END; + loc |= SC_WRAPVISUALFLAGLOC_END_BY_TEXT; + } + else if (eflag == WrapFlagByBorder) + flags |= SC_WRAPVISUALFLAG_END; + + if (sflag == WrapFlagByText) + { + flags |= SC_WRAPVISUALFLAG_START; + loc |= SC_WRAPVISUALFLAGLOC_START_BY_TEXT; + } + else if (sflag == WrapFlagByBorder) + flags |= SC_WRAPVISUALFLAG_START; + + SendScintilla(SCI_SETWRAPVISUALFLAGS, flags); + SendScintilla(SCI_SETWRAPVISUALFLAGSLOCATION, loc); + SendScintilla(SCI_SETWRAPSTARTINDENT, sindent); +} + + +// Set the folding style. +void QextScintilla::setFolding(FoldStyle folding) +{ + fold = folding; + + if (folding == NoFoldStyle) + { + SendScintilla(SCI_SETMARGINWIDTHN,2,0L); + return; + } + + int mask = SendScintilla(SCI_GETMODEVENTMASK); + SendScintilla(SCI_SETMODEVENTMASK,mask | SC_MOD_CHANGEFOLD); + + SendScintilla(SCI_SETFOLDFLAGS,SC_FOLDFLAG_LINEAFTER_CONTRACTED); + + SendScintilla(SCI_SETMARGINTYPEN,2,(long)SC_MARGIN_SYMBOL); + SendScintilla(SCI_SETMARGINMASKN,2,SC_MASK_FOLDERS); + SendScintilla(SCI_SETMARGINSENSITIVEN,2,1); + + // Set the marker symbols to use. + switch (folding) + { + case PlainFoldStyle: + setFoldMarker(SC_MARKNUM_FOLDEROPEN,SC_MARK_MINUS); + setFoldMarker(SC_MARKNUM_FOLDER,SC_MARK_PLUS); + setFoldMarker(SC_MARKNUM_FOLDERSUB); + setFoldMarker(SC_MARKNUM_FOLDERTAIL); + setFoldMarker(SC_MARKNUM_FOLDEREND); + setFoldMarker(SC_MARKNUM_FOLDEROPENMID); + setFoldMarker(SC_MARKNUM_FOLDERMIDTAIL); + + break; + + case CircledFoldStyle: + setFoldMarker(SC_MARKNUM_FOLDEROPEN,SC_MARK_CIRCLEMINUS); + setFoldMarker(SC_MARKNUM_FOLDER,SC_MARK_CIRCLEPLUS); + setFoldMarker(SC_MARKNUM_FOLDERSUB); + setFoldMarker(SC_MARKNUM_FOLDERTAIL); + setFoldMarker(SC_MARKNUM_FOLDEREND); + setFoldMarker(SC_MARKNUM_FOLDEROPENMID); + setFoldMarker(SC_MARKNUM_FOLDERMIDTAIL); + + break; + + case BoxedFoldStyle: + setFoldMarker(SC_MARKNUM_FOLDEROPEN,SC_MARK_BOXMINUS); + setFoldMarker(SC_MARKNUM_FOLDER,SC_MARK_BOXPLUS); + setFoldMarker(SC_MARKNUM_FOLDERSUB); + setFoldMarker(SC_MARKNUM_FOLDERTAIL); + setFoldMarker(SC_MARKNUM_FOLDEREND); + setFoldMarker(SC_MARKNUM_FOLDEROPENMID); + setFoldMarker(SC_MARKNUM_FOLDERMIDTAIL); + + break; + + case CircledTreeFoldStyle: + setFoldMarker(SC_MARKNUM_FOLDEROPEN,SC_MARK_CIRCLEMINUS); + setFoldMarker(SC_MARKNUM_FOLDER,SC_MARK_CIRCLEPLUS); + setFoldMarker(SC_MARKNUM_FOLDERSUB,SC_MARK_VLINE); + setFoldMarker(SC_MARKNUM_FOLDERTAIL,SC_MARK_LCORNERCURVE); + setFoldMarker(SC_MARKNUM_FOLDEREND,SC_MARK_CIRCLEPLUSCONNECTED); + setFoldMarker(SC_MARKNUM_FOLDEROPENMID,SC_MARK_CIRCLEMINUSCONNECTED); + setFoldMarker(SC_MARKNUM_FOLDERMIDTAIL,SC_MARK_TCORNERCURVE); + + break; + + case BoxedTreeFoldStyle: + setFoldMarker(SC_MARKNUM_FOLDEROPEN,SC_MARK_BOXMINUS); + setFoldMarker(SC_MARKNUM_FOLDER,SC_MARK_BOXPLUS); + setFoldMarker(SC_MARKNUM_FOLDERSUB,SC_MARK_VLINE); + setFoldMarker(SC_MARKNUM_FOLDERTAIL,SC_MARK_LCORNER); + setFoldMarker(SC_MARKNUM_FOLDEREND,SC_MARK_BOXPLUSCONNECTED); + setFoldMarker(SC_MARKNUM_FOLDEROPENMID,SC_MARK_BOXMINUSCONNECTED); + setFoldMarker(SC_MARKNUM_FOLDERMIDTAIL,SC_MARK_TCORNER); + + break; + } + + SendScintilla(SCI_SETMARGINWIDTHN,2,defaultFoldMarginWidth); +} + + +// Set up a folder marker. +void QextScintilla::setFoldMarker(int marknr,int mark) +{ + SendScintilla(SCI_MARKERDEFINE,marknr,mark); + + if (mark != SC_MARK_EMPTY) + { + SendScintilla(SCI_MARKERSETFORE,marknr,white); + SendScintilla(SCI_MARKERSETBACK,marknr,black); + } +} + + +// Handle a click in the fold margin. This is mostly taken from SciTE. +void QextScintilla::foldClick(int lineClick,int bstate) +{ + if ((bstate & ShiftButton) && (bstate & ControlButton)) + { + foldAll(); + return; + } + + int levelClick = SendScintilla(SCI_GETFOLDLEVEL,lineClick); + + if (levelClick & SC_FOLDLEVELHEADERFLAG) + { + if (bstate & ShiftButton) + { + // Ensure all children are visible. + SendScintilla(SCI_SETFOLDEXPANDED,lineClick,1); + foldExpand(lineClick,TRUE,TRUE,100,levelClick); + } + else if (bstate & ControlButton) + { + if (SendScintilla(SCI_GETFOLDEXPANDED,lineClick)) + { + // Contract this line and all its children. + SendScintilla(SCI_SETFOLDEXPANDED,lineClick,0L); + foldExpand(lineClick,FALSE,TRUE,0,levelClick); + } + else + { + // Expand this line and all its children. + SendScintilla(SCI_SETFOLDEXPANDED,lineClick,1); + foldExpand(lineClick,TRUE,TRUE,100,levelClick); + } + } + else + { + // Toggle this line. + SendScintilla(SCI_TOGGLEFOLD,lineClick); + } + } +} + + +// Do the hard work of hiding and showing lines. This is mostly taken from +// SciTE. +void QextScintilla::foldExpand(int &line,bool doExpand,bool force, + int visLevels,int level) +{ + int lineMaxSubord = SendScintilla(SCI_GETLASTCHILD,line,level & SC_FOLDLEVELNUMBERMASK); + + line++; + + while (line <= lineMaxSubord) + { + if (force) + { + if (visLevels > 0) + SendScintilla(SCI_SHOWLINES,line,line); + else + SendScintilla(SCI_HIDELINES,line,line); + } + else if (doExpand) + SendScintilla(SCI_SHOWLINES,line,line); + + int levelLine = level; + + if (levelLine == -1) + levelLine = SendScintilla(SCI_GETFOLDLEVEL,line); + + if (levelLine & SC_FOLDLEVELHEADERFLAG) + { + if (force) + { + if (visLevels > 1) + SendScintilla(SCI_SETFOLDEXPANDED,line,1); + else + SendScintilla(SCI_SETFOLDEXPANDED,line,0L); + + foldExpand(line,doExpand,force,visLevels - 1); + } + else if (doExpand) + { + if (!SendScintilla(SCI_GETFOLDEXPANDED,line)) + SendScintilla(SCI_SETFOLDEXPANDED,line,1); + + foldExpand(line,TRUE,force,visLevels - 1); + } + else + foldExpand(line,FALSE,force,visLevels - 1); + } + else + line++; + } +} + + +// Fully expand (if there is any line currently folded) all text. Otherwise, +// fold all text. This is mostly taken from SciTE. +void QextScintilla::foldAll(bool children) +{ + recolor(); + + int maxLine = SendScintilla(SCI_GETLINECOUNT); + bool expanding = TRUE; + + for (int lineSeek = 0; lineSeek < maxLine; lineSeek++) + { + if (SendScintilla(SCI_GETFOLDLEVEL,lineSeek) & SC_FOLDLEVELHEADERFLAG) + { + expanding = !SendScintilla(SCI_GETFOLDEXPANDED,lineSeek); + break; + } + } + + for (int line = 0; line < maxLine; line++) + { + int level = SendScintilla(SCI_GETFOLDLEVEL,line); + + if (!(level & SC_FOLDLEVELHEADERFLAG)) + continue; + + if (children || + (SC_FOLDLEVELBASE == (level & SC_FOLDLEVELNUMBERMASK))) + { + if (expanding) + { + SendScintilla(SCI_SETFOLDEXPANDED,line,1); + foldExpand(line,TRUE,FALSE,0,level); + line--; + } + else + { + int lineMaxSubord = SendScintilla(SCI_GETLASTCHILD,line,-1); + + SendScintilla(SCI_SETFOLDEXPANDED,line,0L); + + if (lineMaxSubord > line) + SendScintilla(SCI_HIDELINES,line + 1,lineMaxSubord); + } + } + } +} + + +// Handle a fold change. This is mostly taken from SciTE. +void QextScintilla::foldChanged(int line,int levelNow,int levelPrev) +{ + if (levelNow & SC_FOLDLEVELHEADERFLAG) + { + if (!(levelPrev & SC_FOLDLEVELHEADERFLAG)) + SendScintilla(SCI_SETFOLDEXPANDED,line,1); + } + else if (levelPrev & SC_FOLDLEVELHEADERFLAG) + { + if (!SendScintilla(SCI_GETFOLDEXPANDED,line)) + { + // Removing the fold from one that has been contracted + // so should expand. Otherwise lines are left + // invisible with no way to make them visible. + foldExpand(line,TRUE,FALSE,0,levelPrev); + } + } +} + + +// Toggle the fold for a line if it contains a fold marker. +void QextScintilla::foldLine(int line) +{ + SendScintilla(SCI_TOGGLEFOLD,line); +} + + +// Handle the SCN_MODIFIED notification. +void QextScintilla::handleModified(int pos,int mtype,const char *text,int len, + int added,int line,int foldNow,int foldPrev) +{ + if (mtype & SC_MOD_CHANGEFOLD) + { + if (fold) + foldChanged(line,foldNow,foldPrev); + } + else if (mtype & (SC_MOD_INSERTTEXT | SC_MOD_DELETETEXT)) + emit textChanged(); +} + + +// Zoom in a number of points. +void QextScintilla::zoomIn(int range) +{ + zoomTo(SendScintilla(SCI_GETZOOM) + range); +} + + +// Zoom in a single point. +void QextScintilla::zoomIn() +{ + SendScintilla(SCI_ZOOMIN); +} + + +// Zoom out a number of points. +void QextScintilla::zoomOut(int range) +{ + zoomTo(SendScintilla(SCI_GETZOOM) - range); +} + + +// Zoom out a single point. +void QextScintilla::zoomOut() +{ + SendScintilla(SCI_ZOOMOUT); +} + + +// Set the zoom to a number of points. +void QextScintilla::zoomTo(int size) +{ + if (size < -10) + size = -10; + else if (size > 20) + size = 20; + + SendScintilla(SCI_SETZOOM,size); +} + + +// Find the first occurrence of a string. +bool QextScintilla::findFirst(const QString &expr,bool re,bool cs,bool wo, + bool wrap,bool forward,int line,int index, + bool show) +{ + findState.inProgress = FALSE; + + if (expr.isEmpty()) + return FALSE; + + findState.expr = expr; + findState.wrap = wrap; + findState.forward = forward; + + findState.flags = (cs ? SCFIND_MATCHCASE : 0) | + (wo ? SCFIND_WHOLEWORD : 0) | + (re ? SCFIND_REGEXP : 0); + + if (line < 0 || index < 0) + findState.startpos = SendScintilla(SCI_GETCURRENTPOS); + else + findState.startpos = posFromLineIndex(line,index); + + if (forward) + findState.endpos = SendScintilla(SCI_GETLENGTH); + else + findState.endpos = 0; + + findState.show = show; + + return doFind(); +} + + +// Find the next occurrence of a string. +bool QextScintilla::findNext() +{ + if (!findState.inProgress) + return FALSE; + + return doFind(); +} + + +// Do the hard work of findFirst() and findNext(). +bool QextScintilla::doFind() +{ + SendScintilla(SCI_SETSEARCHFLAGS,findState.flags); + + long pos = simpleFind(); + + // See if it was found. If not and wraparound is wanted, try again. + if (pos == -1 && findState.wrap) + { + if (findState.forward) + { + findState.startpos = 0; + findState.endpos = SendScintilla(SCI_GETLENGTH); + } + else + { + findState.startpos = SendScintilla(SCI_GETLENGTH); + findState.endpos = 0; + } + + pos = simpleFind(); + } + + if (pos == -1) + { + findState.inProgress = FALSE; + return FALSE; + } + + // It was found. + long targstart = SendScintilla(SCI_GETTARGETSTART); + long targend = SendScintilla(SCI_GETTARGETEND); + + // Ensure the text found is visible if required. + if (findState.show) + { + int startLine = SendScintilla(SCI_LINEFROMPOSITION,targstart); + int endLine = SendScintilla(SCI_LINEFROMPOSITION,targend); + + for (int i = startLine; i <= endLine; ++i) + SendScintilla(SCI_ENSUREVISIBLEENFORCEPOLICY,i); + } + + // Now set the selection. + SendScintilla(SCI_SETSEL,targstart,targend); + + // Finally adjust the start position so that we don't find the same one + // again. + if (findState.forward) + findState.startpos = targend; + else if ((findState.startpos = targstart - 1) < 0) + findState.startpos = 0; + + findState.inProgress = TRUE; + return TRUE; +} + + +// Do a simple find between the start and end positions. +long QextScintilla::simpleFind() +{ + if (findState.startpos == findState.endpos) + return -1; + + SendScintilla(SCI_SETTARGETSTART,findState.startpos); + SendScintilla(SCI_SETTARGETEND,findState.endpos); + + long pos; + + if (isUtf8()) + { + QCString s = findState.expr.utf8(); + + pos = SendScintilla(SCI_SEARCHINTARGET,s.length(),s.data()); + } + else + { + const char *s = findState.expr.latin1(); + + pos = SendScintilla(SCI_SEARCHINTARGET,strlen(s),s); + } + + return pos; +} + + +// Replace the text found with the previous findFirst() or findNext(). +void QextScintilla::replace(const QString &replaceStr) +{ + if (!findState.inProgress) + return; + + long start = SendScintilla(SCI_GETSELECTIONSTART); + + SendScintilla(SCI_TARGETFROMSELECTION); + + long len; + int cmd = (findState.flags & SCFIND_REGEXP) ? SCI_REPLACETARGETRE : SCI_REPLACETARGET; + + if (isUtf8()) + len = SendScintilla(cmd,-1,replaceStr.utf8().data()); + else + len = SendScintilla(cmd,-1,replaceStr.latin1()); + + // Reset the selection. + SendScintilla(SCI_SETSELECTIONSTART,start); + SendScintilla(SCI_SETSELECTIONEND,start + len); + + if (findState.forward) + findState.startpos = start + len; +} + + +// Query the modified state. +bool QextScintilla::isModified() +{ + // We don't use SCI_GETMODIFY as it seems to be buggy in Scintilla + // v1.61. + return modified; +} + + +// Set the modified state. +void QextScintilla::setModified(bool m) +{ + if (!m) + SendScintilla(SCI_SETSAVEPOINT); +} + + +// Handle the SCN_MARGINCLICK notification. +void QextScintilla::handleMarginClick(int pos,int modifiers,int margin) +{ + int state = 0; + + if (modifiers & SCMOD_SHIFT) + state |= ShiftButton; + + if (modifiers & SCMOD_CTRL) + state |= ControlButton; + + if (modifiers & SCMOD_ALT) + state |= AltButton; + + int line = SendScintilla(SCI_LINEFROMPOSITION,pos); + + if (fold && margin == 2) + foldClick(line,state); + else + emit marginClicked(margin,line,(ButtonState)state); +} + + +// Handle the SCN_SAVEPOINTREACHED notification. +void QextScintilla::handleSavePointReached() +{ + if (modified) + { + modified = FALSE; + emit modificationChanged(FALSE); + } +} + + +// Handle the SCN_SAVEPOINTLEFT notification. +void QextScintilla::handleSavePointLeft() +{ + if (!modified) + { + modified = TRUE; + emit modificationChanged(TRUE); + } +} + + +// Handle the QSCN_SELCHANGED signal. +void QextScintilla::handleSelectionChanged(bool yes) +{ + selText = yes; + + emit copyAvailable(yes); + emit selectionChanged(); +} + + +// Get the current selection. +void QextScintilla::getSelection(int *lineFrom,int *indexFrom, + int *lineTo,int *indexTo) +{ + if (selText) + { + lineIndexFromPos(SendScintilla(SCI_GETSELECTIONSTART), + lineFrom,indexFrom); + lineIndexFromPos(SendScintilla(SCI_GETSELECTIONEND), + lineTo,indexTo); + } + else + *lineFrom = *indexFrom = *lineTo = *indexTo = -1; +} + + +// Sets the current selection. +void QextScintilla::setSelection(int lineFrom,int indexFrom, + int lineTo,int indexTo) +{ + SendScintilla(SCI_SETSELECTIONSTART,posFromLineIndex(lineFrom,indexFrom)); + SendScintilla(SCI_SETSELECTIONEND,posFromLineIndex(lineTo,indexTo)); +} + + +// Set the background colour of selected text. +void QextScintilla::setSelectionBackgroundColor(const QColor &col) +{ + SendScintilla(SCI_SETSELBACK,1,col); + + int alpha = qAlpha(col.rgb()); + + if (alpha < 255) + SendScintilla(SCI_SETSELALPHA, alpha); +} + + +// Set the foreground colour of selected text. +void QextScintilla::setSelectionForegroundColor(const QColor &col) +{ + SendScintilla(SCI_SETSELFORE,1,col); +} + + +// Reset the background colour of selected text to the default. +void QextScintilla::resetSelectionBackgroundColor() +{ + SendScintilla(SCI_SETSELALPHA, SC_ALPHA_NOALPHA); + SendScintilla(SCI_SETSELBACK,0UL); +} + + +// Reset the foreground colour of selected text to the default. +void QextScintilla::resetSelectionForegroundColor() +{ + SendScintilla(SCI_SETSELFORE,0UL); +} + + +// Set the width of the caret. +void QextScintilla::setCaretWidth(int width) +{ + SendScintilla(SCI_SETCARETWIDTH,width); +} + + +// Set the foreground colour of the caret. +void QextScintilla::setCaretForegroundColor(const QColor &col) +{ + SendScintilla(SCI_SETCARETFORE,col); +} + + +// Set the background colour of the line containing the caret. +void QextScintilla::setCaretLineBackgroundColor(const QColor &col) +{ + SendScintilla(SCI_SETCARETLINEBACK,col); + + int alpha = qAlpha(col.rgb()); + + if (alpha < 255) + SendScintilla(SCI_SETCARETLINEBACKALPHA, alpha); +} + + +// Set the state of the background colour of the line containing the caret. +void QextScintilla::setCaretLineVisible(bool enable) +{ + SendScintilla(SCI_SETCARETLINEVISIBLE,enable); +} + + +// Query the read-only state. +bool QextScintilla::isReadOnly() +{ + return SendScintilla(SCI_GETREADONLY); +} + + +// Set the read-only state. +void QextScintilla::setReadOnly(bool ro) +{ + SendScintilla(SCI_SETREADONLY,ro); +} + + +// Append the given text. +void QextScintilla::append(const QString &text) +{ + bool ro = ensureRW(); + + if (isUtf8()) + { + QCString s = text.utf8(); + + SendScintilla(SCI_APPENDTEXT,s.length(),s.data()); + } + else + { + const char *s = text.latin1(); + + SendScintilla(SCI_APPENDTEXT,strlen(s),s); + } + + SendScintilla(SCI_EMPTYUNDOBUFFER); + + setReadOnly(ro); +} + + +// Insert the given text at the current position. +void QextScintilla::insert(const QString &text) +{ + bool ro = ensureRW(); + + SendScintilla(SCI_BEGINUNDOACTION); + + if (isUtf8()) + SendScintilla(SCI_INSERTTEXT,-1,text.utf8().data()); + else + SendScintilla(SCI_INSERTTEXT,-1,text.latin1()); + + SendScintilla(SCI_ENDUNDOACTION); + + setReadOnly(ro); +} + + +// Insert the given text at the given position. +void QextScintilla::insertAt(const QString &text,int line,int index) +{ + bool ro = ensureRW(); + long position = posFromLineIndex(line,index); + + SendScintilla(SCI_BEGINUNDOACTION); + + if (isUtf8()) + SendScintilla(SCI_INSERTTEXT,position,text.utf8().data()); + else + SendScintilla(SCI_INSERTTEXT,position,text.latin1()); + + SendScintilla(SCI_ENDUNDOACTION); + + setReadOnly(ro); +} + + +// Begin a sequence of undoable actions. +void QextScintilla::beginUndoAction() +{ + SendScintilla(SCI_BEGINUNDOACTION); +} + + +// End a sequence of undoable actions. +void QextScintilla::endUndoAction() +{ + SendScintilla(SCI_ENDUNDOACTION); +} + + +// Redo a sequence of actions. +void QextScintilla::redo() +{ + SendScintilla(SCI_REDO); +} + + +// Undo a sequence of actions. +void QextScintilla::undo() +{ + SendScintilla(SCI_UNDO); +} + + +// See if there is something to redo. +bool QextScintilla::isRedoAvailable() +{ + return SendScintilla(SCI_CANREDO); +} + + +// See if there is something to undo. +bool QextScintilla::isUndoAvailable() +{ + return SendScintilla(SCI_CANUNDO); +} + + +// Return the number of lines. +int QextScintilla::lines() +{ + return SendScintilla(SCI_GETLINECOUNT); +} + + +// Return the line at a position. +int QextScintilla::lineAt(const QPoint &pos) +{ + long chpos = SendScintilla(SCI_POSITIONFROMPOINTCLOSE,pos.x(),pos.y()); + + if (chpos < 0) + return -1; + + return SendScintilla(SCI_LINEFROMPOSITION,chpos); +} + + +// Return the length of a line. +int QextScintilla::lineLength(int line) +{ + if (line < 0 || line >= SendScintilla(SCI_GETLINECOUNT)) + return -1; + + return SendScintilla(SCI_LINELENGTH,line); +} + + +// Return the length of the current text. +int QextScintilla::length() +{ + return SendScintilla(SCI_GETTEXTLENGTH); +} + + +// Remove any selected text. +void QextScintilla::removeSelectedText() +{ + SendScintilla(SCI_REPLACESEL,""); +} + + +// Return the current selected text. +QString QextScintilla::selectedText() +{ + if (!selText) + return QString(); + + // Scintilla doesn't tell us the length of the selected text so we use + // the length of the whole document. + char *buf = new char[length() + 1]; + + SendScintilla(SCI_GETSELTEXT,buf); + + QString qs = convertText(buf); + delete[] buf; + + return qs; +} + + +// Return the current text. +QString QextScintilla::text() +{ + int buflen = length() + 1; + char *buf = new char[buflen]; + + SendScintilla(SCI_GETTEXT,buflen,buf); + + QString qs = convertText(buf); + delete[] buf; + + return qs; +} + + +// Return the text of a line. +QString QextScintilla::text(int line) +{ + int line_len = lineLength(line); + + if (line_len < 1) + return QString(); + + char *buf = new char[line_len + 1]; + + SendScintilla(SCI_GETLINE,line,buf); + buf[line_len] = '\0'; + + QString qs = convertText(buf); + delete[] buf; + + return qs; +} + + +// Set the given text. +void QextScintilla::setText(const QString &text) +{ + bool ro = ensureRW(); + + if (isUtf8()) + SendScintilla(SCI_SETTEXT,text.utf8().data()); + else + SendScintilla(SCI_SETTEXT,text.latin1()); + + SendScintilla(SCI_EMPTYUNDOBUFFER); + + setReadOnly(ro); +} + + +// Get the cursor position +void QextScintilla::getCursorPosition(int *line,int *index) +{ + long pos = SendScintilla(SCI_GETCURRENTPOS); + long lin = SendScintilla(SCI_LINEFROMPOSITION,pos); + long linpos = SendScintilla(SCI_POSITIONFROMLINE,lin); + + *line = lin; + *index = pos - linpos; +} + + +// Set the cursor position +void QextScintilla::setCursorPosition(int line,int index) +{ + SendScintilla(SCI_GOTOPOS,posFromLineIndex(line,index)); +} + + +// Ensure the cursor is visible. +void QextScintilla::ensureCursorVisible() +{ + SendScintilla(SCI_SCROLLCARET); +} + + +// Ensure a line is visible. +void QextScintilla::ensureLineVisible(int line) +{ + SendScintilla(SCI_ENSUREVISIBLEENFORCEPOLICY,line); +} + + +// Copy text to the clipboard. +void QextScintilla::copy() +{ + SendScintilla(SCI_COPY); +} + + +// Cut text to the clipboard. +void QextScintilla::cut() +{ + SendScintilla(SCI_CUT); +} + + +// Paste text from the clipboard. +void QextScintilla::paste() +{ + SendScintilla(SCI_PASTE); +} + + +// Select all text, or deselect any selected text. +void QextScintilla::selectAll(bool select) +{ + if (selText) + SendScintilla(SCI_SETANCHOR,SendScintilla(SCI_GETCURRENTPOS)); + else + SendScintilla(SCI_SELECTALL); +} + + +// Delete all text. +void QextScintilla::clear() +{ + bool ro = ensureRW(); + + SendScintilla(SCI_BEGINUNDOACTION); + SendScintilla(SCI_CLEARALL); + SendScintilla(SCI_ENDUNDOACTION); + + setReadOnly(ro); +} + + +// Return the indentation of a line. +int QextScintilla::indentation(int line) +{ + return SendScintilla(SCI_GETLINEINDENTATION,line); +} + + +// Set the indentation of a line. +void QextScintilla::setIndentation(int line,int indentation) +{ + SendScintilla(SCI_BEGINUNDOACTION); + SendScintilla(SCI_SETLINEINDENTATION,line,indentation); + SendScintilla(SCI_ENDUNDOACTION); +} + + +// Indent a line. +void QextScintilla::indent(int line) +{ + setIndentation(line,indentation(line) + indentWidth()); +} + + +// Unindent a line. +void QextScintilla::unindent(int line) +{ + int newIndent = indentation(line) - indentWidth(); + + if (newIndent < 0) + newIndent = 0; + + setIndentation(line,newIndent); +} + + +// Return the indentation of the current line. +int QextScintilla::currentIndent() +{ + return indentation(SendScintilla(SCI_LINEFROMPOSITION,SendScintilla(SCI_GETCURRENTPOS))); +} + + +// Return the current indentation width. +int QextScintilla::indentWidth() +{ + int w = indentationWidth(); + + if (w == 0) + w = tabWidth(); + + return w; +} + + +// Return the state of indentation guides. +bool QextScintilla::indentationGuides() +{ + return SendScintilla(SCI_GETINDENTATIONGUIDES); +} + + +// Enable and disable indentation guides. +void QextScintilla::setIndentationGuides(bool enable) +{ + SendScintilla(SCI_SETINDENTATIONGUIDES,enable); +} + + +// Set the background colour of indentation guides. +void QextScintilla::setIndentationGuidesBackgroundColor(const QColor &col) +{ + SendScintilla(SCI_STYLESETBACK,STYLE_INDENTGUIDE,col); +} + + +// Set the foreground colour of indentation guides. +void QextScintilla::setIndentationGuidesForegroundColor(const QColor &col) +{ + SendScintilla(SCI_STYLESETFORE,STYLE_INDENTGUIDE,col); +} + + +// Return the indentation width. +int QextScintilla::indentationWidth() +{ + return SendScintilla(SCI_GETINDENT); +} + + +// Set the indentation width. +void QextScintilla::setIndentationWidth(int width) +{ + SendScintilla(SCI_SETINDENT,width); +} + + +// Return the tab width. +int QextScintilla::tabWidth() +{ + return SendScintilla(SCI_GETTABWIDTH); +} + + +// Set the tab width. +void QextScintilla::setTabWidth(int width) +{ + SendScintilla(SCI_SETTABWIDTH,width); +} + + +// Return the effect of the backspace key. +bool QextScintilla::backspaceUnindents() +{ + return SendScintilla(SCI_GETBACKSPACEUNINDENTS); +} + + +// Set the effect of the backspace key. +void QextScintilla::setBackspaceUnindents(bool unindents) +{ + SendScintilla(SCI_SETBACKSPACEUNINDENTS,unindents); +} + + +// Return the effect of the tab key. +bool QextScintilla::tabIndents() +{ + return SendScintilla(SCI_GETTABINDENTS); +} + + +// Set the effect of the tab key. +void QextScintilla::setTabIndents(bool indents) +{ + SendScintilla(SCI_SETTABINDENTS,indents); +} + + +// Return the indentation use of tabs. +bool QextScintilla::indentationsUseTabs() +{ + return SendScintilla(SCI_GETUSETABS); +} + + +// Set the indentation use of tabs. +void QextScintilla::setIndentationsUseTabs(bool tabs) +{ + SendScintilla(SCI_SETUSETABS,tabs); +} + + +// Return the state of line numbers in a margin. +bool QextScintilla::marginLineNumbers(int margin) +{ + return SendScintilla(SCI_GETMARGINTYPEN,margin); +} + + +// Enable and disable line numbers in a margin. +void QextScintilla::setMarginLineNumbers(int margin,bool lnrs) +{ + SendScintilla(SCI_SETMARGINTYPEN,margin,lnrs ? SC_MARGIN_NUMBER : 0); +} + + +// Return the marker mask of a margin. +int QextScintilla::marginMarkerMask(int margin) +{ + return SendScintilla(SCI_GETMARGINMASKN,margin); +} + + +// Set the marker mask of a margin. +void QextScintilla::setMarginMarkerMask(int margin,int mask) +{ + SendScintilla(SCI_SETMARGINMASKN,margin,mask); +} + + +// Return the state of a margin's sensitivity. +bool QextScintilla::marginSensitivity(int margin) +{ + return SendScintilla(SCI_GETMARGINSENSITIVEN,margin); +} + + +// Enable and disable a margin's sensitivity. +void QextScintilla::setMarginSensitivity(int margin,bool sens) +{ + SendScintilla(SCI_SETMARGINSENSITIVEN,margin,sens); +} + + +// Return the width of a margin. +int QextScintilla::marginWidth(int margin) +{ + return SendScintilla(SCI_GETMARGINWIDTHN,margin); +} + + +// Set the width of a margin. +void QextScintilla::setMarginWidth(int margin,int width) +{ + SendScintilla(SCI_SETMARGINWIDTHN,margin,width); +} + + +// Set the width of a margin to the width of some text. +void QextScintilla::setMarginWidth(int margin,const QString &s) +{ + int width; + + if (isUtf8()) + width = SendScintilla(SCI_TEXTWIDTH,STYLE_LINENUMBER,s.utf8().data()); + else + width = SendScintilla(SCI_TEXTWIDTH,STYLE_LINENUMBER,s.latin1()); + + setMarginWidth(margin,width); +} + + +// Set the background colour of all margins. +void QextScintilla::setMarginsBackgroundColor(const QColor &col) +{ + handleStylePaperChange(col,STYLE_LINENUMBER); +} + + +// Set the foreground colour of all margins. +void QextScintilla::setMarginsForegroundColor(const QColor &col) +{ + handleStyleColorChange(col,STYLE_LINENUMBER); +} + + +// Set the font of all margins. +void QextScintilla::setMarginsFont(const QFont &f) +{ + setStylesFont(f,STYLE_LINENUMBER); +} + + +// Define a marker based on a symbol. +int QextScintilla::markerDefine(MarkerSymbol sym,int mnr) +{ + checkMarker(mnr); + + if (mnr >= 0) + SendScintilla(SCI_MARKERDEFINE,mnr,static_cast(sym)); + + return mnr; +} + + +// Define a marker based on a character. +int QextScintilla::markerDefine(char ch,int mnr) +{ + checkMarker(mnr); + + if (mnr >= 0) + SendScintilla(SCI_MARKERDEFINE,mnr,static_cast(SC_MARK_CHARACTER) + ch); + + return mnr; +} + + +// Define a marker based on a QPixmap. +int QextScintilla::markerDefine(const QPixmap *pm,int mnr) +{ + checkMarker(mnr); + + if (mnr >= 0) + SendScintilla(SCI_MARKERDEFINEPIXMAP,mnr,pm); + + return mnr; +} + + +// Add a marker to a line. +int QextScintilla::markerAdd(int linenr,int mnr) +{ + if (mnr < 0 || mnr > MARKER_MAX || (allocatedMarkers & (1 << mnr)) == 0) + return -1; + + return SendScintilla(SCI_MARKERADD,linenr,mnr); +} + + +// Get the marker mask for a line. +unsigned QextScintilla::markersAtLine(int linenr) +{ + return SendScintilla(SCI_MARKERGET,linenr); +} + + +// Delete a marker from a line. +void QextScintilla::markerDelete(int linenr,int mnr) +{ + if (mnr <= MARKER_MAX) + { + if (mnr < 0) + { + unsigned am = allocatedMarkers; + + for (int m = 0; m <= MARKER_MAX; ++m) + { + if (am & 1) + SendScintilla(SCI_MARKERDELETE,linenr,m); + + am >>= 1; + } + } + else if (allocatedMarkers & (1 << mnr)) + SendScintilla(SCI_MARKERDELETE,linenr,mnr); + } +} + + +// Delete a marker from the text. +void QextScintilla::markerDeleteAll(int mnr) +{ + if (mnr <= MARKER_MAX) + { + if (mnr < 0) + SendScintilla(SCI_MARKERDELETEALL,-1); + else if (allocatedMarkers & (1 << mnr)) + SendScintilla(SCI_MARKERDELETEALL,mnr); + } +} + + +// Delete a marker handle from the text. +void QextScintilla::markerDeleteHandle(int mhandle) +{ + SendScintilla(SCI_MARKERDELETEHANDLE,mhandle); +} + + +// Return the line containing a marker instance. +int QextScintilla::markerLine(int mhandle) +{ + return SendScintilla(SCI_MARKERLINEFROMHANDLE,mhandle); +} + + +// Search forwards for a marker. +int QextScintilla::markerFindNext(int linenr,unsigned mask) +{ + return SendScintilla(SCI_MARKERNEXT,linenr,mask); +} + + +// Search backwards for a marker. +int QextScintilla::markerFindPrevious(int linenr,unsigned mask) +{ + return SendScintilla(SCI_MARKERPREVIOUS,linenr,mask); +} + + +// Set the marker background colour. +void QextScintilla::setMarkerBackgroundColor(const QColor &col,int mnr) +{ + if (mnr <= MARKER_MAX) + { + int alpha = qAlpha(col.rgb()); + + if (mnr < 0) + { + unsigned am = allocatedMarkers; + + for (int m = 0; m <= MARKER_MAX; ++m) + { + if (am & 1) + { + SendScintilla(SCI_MARKERSETBACK,m,col); + + if (alpha < 255) + SendScintilla(SCI_MARKERSETALPHA, m, alpha); + } + + am >>= 1; + } + } + else if (allocatedMarkers & (1 << mnr)) + { + SendScintilla(SCI_MARKERSETBACK,mnr,col); + + if (alpha < 255) + SendScintilla(SCI_MARKERSETALPHA, mnr, alpha); + } + } +} + + +// Set the marker foreground colour. +void QextScintilla::setMarkerForegroundColor(const QColor &col,int mnr) +{ + if (mnr <= MARKER_MAX) + { + if (mnr < 0) + { + unsigned am = allocatedMarkers; + + for (int m = 0; m <= MARKER_MAX; ++m) + { + if (am & 1) + SendScintilla(SCI_MARKERSETFORE,m,col); + + am >>= 1; + } + } + else if (allocatedMarkers & (1 << mnr)) + SendScintilla(SCI_MARKERSETFORE,mnr,col); + } +} + + +// Check a marker, allocating a marker number if necessary. +void QextScintilla::checkMarker(int &mnr) +{ + if (mnr >= 0) + { + // Check the explicit marker number isn't already allocated. + if (mnr > MARKER_MAX || allocatedMarkers & (1 << mnr)) + mnr = -1; + } + else + { + unsigned am = allocatedMarkers; + + // Find the smallest unallocated marker number. + for (mnr = 0; mnr <= MARKER_MAX; ++mnr) + { + if ((am & 1) == 0) + break; + + am >>= 1; + } + } + + // Define the marker if it is valid. + if (mnr >= 0) + allocatedMarkers |= (1 << mnr); +} + + +// Reset the fold margin colours. +void QextScintilla::resetFoldMarginColors() +{ + SendScintilla(SCI_SETFOLDMARGINHICOLOUR,0,0L); + SendScintilla(SCI_SETFOLDMARGINCOLOUR,0,0L); +} + + +// Set the fold margin colours. +void QextScintilla::setFoldMarginColors(const QColor &fore,const QColor &back) +{ + SendScintilla(SCI_SETFOLDMARGINHICOLOUR,1,fore); + SendScintilla(SCI_SETFOLDMARGINCOLOUR,1,back); +} + + +// Set the call tips background colour. +void QextScintilla::setCallTipsBackgroundColor(const QColor &col) +{ + SendScintilla(SCI_CALLTIPSETBACK,col); +} + + +// Set the call tips foreground colour. +void QextScintilla::setCallTipsForegroundColor(const QColor &col) +{ + SendScintilla(SCI_CALLTIPSETFORE,col); +} + + +// Set the call tips highlight colour. +void QextScintilla::setCallTipsHighlightColor(const QColor &col) +{ + SendScintilla(SCI_CALLTIPSETFOREHLT,col); +} + + +// Set the matched brace background colour. +void QextScintilla::setMatchedBraceBackgroundColor(const QColor &col) +{ + SendScintilla(SCI_STYLESETBACK,STYLE_BRACELIGHT,col); +} + + +// Set the matched brace foreground colour. +void QextScintilla::setMatchedBraceForegroundColor(const QColor &col) +{ + SendScintilla(SCI_STYLESETFORE,STYLE_BRACELIGHT,col); +} + + +// Set the unmatched brace background colour. +void QextScintilla::setUnmatchedBraceBackgroundColor(const QColor &col) +{ + SendScintilla(SCI_STYLESETBACK,STYLE_BRACEBAD,col); +} + + +// Set the unmatched brace foreground colour. +void QextScintilla::setUnmatchedBraceForegroundColor(const QColor &col) +{ + SendScintilla(SCI_STYLESETFORE,STYLE_BRACEBAD,col); +} + + +// Set the lexer. +void QextScintilla::setLexer(QextScintillaLexer *lexer) +{ + // Disconnect any previous lexer. + if (!lex.isNull()) + { + lex -> disconnect(this); + + SendScintilla(SCI_STYLERESETDEFAULT); + } + + // Connect up the new lexer. + lex = lexer; + + if (lex) + { + int bits = SendScintilla(SCI_GETSTYLEBITSNEEDED); + int nrStyles = 1 << bits; + + SendScintilla(SCI_SETSTYLEBITS,bits); + + connect(lex,SIGNAL(colorChanged(const QColor &,int)), + SLOT(handleStyleColorChange(const QColor &,int))); + connect(lex,SIGNAL(eolFillChanged(bool,int)), + SLOT(handleStyleEolFillChange(bool,int))); + connect(lex,SIGNAL(fontChanged(const QFont &,int)), + SLOT(handleStyleFontChange(const QFont &,int))); + connect(lex,SIGNAL(paperChanged(const QColor &,int)), + SLOT(handleStylePaperChange(const QColor &,int))); + connect(lex,SIGNAL(propertyChanged(const char *,const char *)), + SLOT(handlePropertyChange(const char *,const char *))); + + SendScintilla(SCI_SETLEXERLANGUAGE,lex -> lexer()); + + // Set the keywords. Scintilla allows for sets numbered 0 to + // KEYWORDSET_MAX (although the lexers only seem to exploit 0 + // to KEYWORDSET_MAX - 1). We number from 1 in line with + // SciTE's property files. + for (int k = 0; k <= KEYWORDSET_MAX; ++k) + { + const char *kw = lex -> keywords(k + 1); + + if (kw) + SendScintilla(SCI_SETKEYWORDS,k,kw); + } + + // Initialise each style. + for (int s = 0; s < nrStyles; ++s) + { + if (lex -> description(s).isNull()) + continue; + + handleStyleColorChange(lex -> color(s),s); + handleStyleEolFillChange(lex -> eolFill(s),s); + handleStyleFontChange(lex -> font(s),s); + handleStylePaperChange(lex -> paper(s),s); + } + + // Initialise the properties. + lex -> refreshProperties(); + + // Set the auto-completion fillups if they haven't been + // explcitly set. + if (fillups_enabled && !explicit_fillups) + SendScintilla(SCI_AUTOCSETFILLUPS, lex->autoCompletionFillups()); + } + else + { + SendScintilla(SCI_SETLEXER,SCLEX_NULL); + + setColor(nl_text_colour); + setPaper(nl_paper_colour); + setFont(nl_font); + } +} + + +// Get the current lexer. +QextScintillaLexer *QextScintilla::lexer() const +{ + return lex; +} + + +// Handle a change in lexer style foreground colour. +void QextScintilla::handleStyleColorChange(const QColor &c,int style) +{ + SendScintilla(SCI_STYLESETFORE,style,c); +} + + +// Handle a change in lexer style end-of-line fill. +void QextScintilla::handleStyleEolFillChange(bool eolfill,int style) +{ + SendScintilla(SCI_STYLESETEOLFILLED,style,eolfill); +} + + +// Handle a change in lexer style font. +void QextScintilla::handleStyleFontChange(const QFont &f,int style) +{ + setStylesFont(f,style); + + if (style == lex->defaultStyle()) + setStylesFont(f, STYLE_DEFAULT); + + if (style == lex -> braceStyle()) + { + setStylesFont(f,STYLE_BRACELIGHT); + setStylesFont(f,STYLE_BRACEBAD); + } +} + + +// Set the font for a style. +void QextScintilla::setStylesFont(const QFont &f,int style) +{ + SendScintilla(SCI_STYLESETFONT,style,f.family().latin1()); + SendScintilla(SCI_STYLESETSIZE,style,f.pointSize()); + SendScintilla(SCI_STYLESETBOLD,style,f.bold()); + SendScintilla(SCI_STYLESETITALIC,style,f.italic()); + SendScintilla(SCI_STYLESETUNDERLINE,style,f.underline()); +} + + +// Handle a change in lexer style background colour. +void QextScintilla::handleStylePaperChange(const QColor &c,int style) +{ + SendScintilla(SCI_STYLESETBACK,style,c); +} + + +// Handle a change in lexer property. +void QextScintilla::handlePropertyChange(const char *prop,const char *val) +{ + SendScintilla(SCI_SETPROPERTY,prop,val); +} + + +// Handle a change to the user visible user interface. +void QextScintilla::handleUpdateUI() +{ + long newPos = SendScintilla(SCI_GETCURRENTPOS); + + if (newPos != oldPos) + { + oldPos = newPos; + + int line = SendScintilla(SCI_LINEFROMPOSITION,newPos); + int col = SendScintilla(SCI_GETCOLUMN,newPos); + + emit cursorPositionChanged(line,col); + } + + if (braceMode != NoBraceMatch) + braceMatch(); +} + + +// Handle brace matching. +void QextScintilla::braceMatch() +{ + long braceAtCaret, braceOpposite; + + findMatchingBrace(braceAtCaret,braceOpposite,braceMode); + + if (braceAtCaret >= 0 && braceOpposite < 0) + { + SendScintilla(SCI_BRACEBADLIGHT,braceAtCaret); + SendScintilla(SCI_SETHIGHLIGHTGUIDE,0UL); + } + else + { + char chBrace = SendScintilla(SCI_GETCHARAT,braceAtCaret); + + SendScintilla(SCI_BRACEHIGHLIGHT,braceAtCaret,braceOpposite); + + long columnAtCaret = SendScintilla(SCI_GETCOLUMN,braceAtCaret); + long columnOpposite = SendScintilla(SCI_GETCOLUMN,braceOpposite); + + if (chBrace == ':') + { + long lineStart = SendScintilla(SCI_LINEFROMPOSITION,braceAtCaret); + long indentPos = SendScintilla(SCI_GETLINEINDENTPOSITION,lineStart); + long indentPosNext = SendScintilla(SCI_GETLINEINDENTPOSITION,lineStart + 1); + + columnAtCaret = SendScintilla(SCI_GETCOLUMN,indentPos); + + long columnAtCaretNext = SendScintilla(SCI_GETCOLUMN,indentPosNext); + long indentSize = SendScintilla(SCI_GETINDENT); + + if (columnAtCaretNext - indentSize > 1) + columnAtCaret = columnAtCaretNext - indentSize; + + if (columnOpposite == 0) + columnOpposite = columnAtCaret; + } + + long column = columnAtCaret; + + if (column > columnOpposite) + column = columnOpposite; + + SendScintilla(SCI_SETHIGHLIGHTGUIDE,column); + } +} + + +// Check if the character at a position is a brace. +long QextScintilla::checkBrace(long pos,int brace_style,bool &colonMode) +{ + long brace_pos = -1; + char ch = SendScintilla(SCI_GETCHARAT,pos); + + if (ch == ':') + { + // A bit of a hack. + if (!lex.isNull() && strcmp(lex -> lexer(),"python") == 0) + { + brace_pos = pos; + colonMode = TRUE; + } + } + else if (ch && strchr("[](){}<>",ch)) + { + if (brace_style < 0) + brace_pos = pos; + else + { + int style = SendScintilla(SCI_GETSTYLEAT,pos) & 0x1f; + + if (style == brace_style) + brace_pos = pos; + } + } + + return brace_pos; +} + + +// Find a brace and it's match. Return TRUE if the current position is inside +// a pair of braces. +bool QextScintilla::findMatchingBrace(long &brace,long &other,BraceMatch mode) +{ + bool colonMode = FALSE; + int brace_style = (lex.isNull() ? -1 : lex -> braceStyle()); + + brace = -1; + other = -1; + + long caretPos = SendScintilla(SCI_GETCURRENTPOS); + + if (caretPos > 0) + brace = checkBrace(caretPos - 1,brace_style,colonMode); + + bool isInside = FALSE; + + if (brace < 0 && mode == SloppyBraceMatch) + { + brace = checkBrace(caretPos,brace_style,colonMode); + + if (brace >= 0 && !colonMode) + isInside = TRUE; + } + + if (brace >= 0) + { + if (colonMode) + { + // Find the end of the Python indented block. + long lineStart = SendScintilla(SCI_LINEFROMPOSITION,brace); + long lineMaxSubord = SendScintilla(SCI_GETLASTCHILD,lineStart,-1); + + other = SendScintilla(SCI_GETLINEENDPOSITION,lineMaxSubord); + } + else + other = SendScintilla(SCI_BRACEMATCH,brace); + + if (other > brace) + isInside = !isInside; + } + + return isInside; +} + + +// Move to the matching brace. +void QextScintilla::moveToMatchingBrace() +{ + gotoMatchingBrace(FALSE); +} + + +// Select to the matching brace. +void QextScintilla::selectToMatchingBrace() +{ + gotoMatchingBrace(TRUE); +} + + +// Move to the matching brace and optionally select the text. +void QextScintilla::gotoMatchingBrace(bool select) +{ + long braceAtCaret; + long braceOpposite; + + bool isInside = findMatchingBrace(braceAtCaret,braceOpposite,SloppyBraceMatch); + + if (braceOpposite >= 0) + { + // Convert the character positions into caret positions based + // on whether the caret position was inside or outside the + // braces. + if (isInside) + { + if (braceOpposite > braceAtCaret) + braceAtCaret++; + else + braceOpposite++; + } + else + { + if (braceOpposite > braceAtCaret) + braceOpposite++; + else + braceAtCaret++; + } + + ensureLineVisible(SendScintilla(SCI_LINEFROMPOSITION,braceOpposite)); + + if (select) + SendScintilla(SCI_SETSEL,braceAtCaret,braceOpposite); + else + SendScintilla(SCI_SETSEL,braceOpposite,braceOpposite); + } +} + + +// Return a position from a line number and an index within the line. +long QextScintilla::posFromLineIndex(int line,int index) +{ + long pos = SendScintilla(SCI_POSITIONFROMLINE,line); + + // Allow for multi-byte characters. + for(int i = 0; i < index; i++) + pos = SendScintilla(SCI_POSITIONAFTER,pos); + + return pos; +} + + +// Return a line number and an index within the line from a position. +void QextScintilla::lineIndexFromPos(long pos,int *line,int *index) +{ + long lin = SendScintilla(SCI_LINEFROMPOSITION,pos); + long linpos = SendScintilla(SCI_POSITIONFROMLINE,lin); + + *line = lin; + *index = pos - linpos; +} + + +// Convert a Scintilla string to a Qt Unicode string. +QString QextScintilla::convertText(const char *s) +{ + if (isUtf8()) + return QString::fromUtf8(s); + + QString qs; + + qs.setLatin1(s); + + return qs; +} + + +// Set the source of the auto-completion list. +void QextScintilla::setAutoCompletionSource(AutoCompletionSource source) +{ + acSource = source; +} + + +// Set the threshold for automatic auto-completion. +void QextScintilla::setAutoCompletionThreshold(int thresh) +{ + acThresh = thresh; +} + + +// Set the auto-completion start characters. +void QextScintilla::setAutoCompletionStartCharacters(const char *start) +{ + acStart = start; +} + + +// Set the APIs for auto-completion. +void QextScintilla::setAutoCompletionAPIs(QextScintillaAPIs *apis) +{ + acAPIs = apis; +} + + +// Explicitly auto-complete from all sources. +void QextScintilla::autoCompleteFromAll() +{ + startAutoCompletion(AcsAll, FALSE, showSingle); +} + + +// Explicitly auto-complete from the APIs. +void QextScintilla::autoCompleteFromAPIs() +{ + startAutoCompletion(AcsAPIs, FALSE, showSingle); +} + + +// Explicitly auto-complete from the document. +void QextScintilla::autoCompleteFromDocument() +{ + // If we are not in a word then ignore. + if (currentCharInWord()) + startAutoCompletion(AcsDocument, FALSE, showSingle); +} + + +// Return TRUE if the current character (ie. the one before the carat) is part +// of a word. +bool QextScintilla::currentCharInWord() +{ + long pos = SendScintilla(SCI_GETCURRENTPOS); + + if (pos <= 0) + return FALSE; + + return isWordChar(SendScintilla(SCI_GETCHARAT,pos - 1)); +} + + +// Check if a character can be in a word. +bool QextScintilla::isWordChar(char ch) const +{ + const char *word_chars = 0; + + if (!lex.isNull()) + word_chars = lex->wordCharacters(); + + if (!word_chars) + word_chars = defaultWordChars; + + return (strchr(word_chars, ch) != NULL); +} + + +// Recolour the document. +void QextScintilla::recolor(int start,int end) +{ + SendScintilla(SCI_COLOURISE,start,end); +} + + +// Registered an image. +void QextScintilla::registerImage(int id,const QPixmap *pm) +{ + SendScintilla(SCI_REGISTERIMAGE,id,pm); +} + + +// Clear all registered images. +void QextScintilla::clearRegisteredImages() +{ + SendScintilla(SCI_CLEARREGISTEREDIMAGES); +} + + +// Set the fill-up characters for auto-completion. +void QextScintilla::setAutoCompletionFillups(const char *fillups) +{ + if (!fillups) + fillups = ""; + + SendScintilla(SCI_AUTOCSETFILLUPS, fillups); + fillups_enabled = explicit_fillups = TRUE; + + // Save them in case we need to reenable them at some point. + saved_fillups = fillups; +} + + +// Enable/disable fill-ups for auto-completion. +void QextScintilla::setAutoCompletionFillupsEnabled(bool enabled) +{ + const char *fillups; + + if (!enabled) + fillups = ""; + else if (!explicit_fillups && !lex.isNull()) + fillups = lex->autoCompletionFillups(); + else + fillups = saved_fillups.data(); + + SendScintilla(SCI_AUTOCSETFILLUPS, fillups); + fillups_enabled = enabled; +} + + +// Return the state of fill-ups for auto-completion. +bool QextScintilla::autoCompletionFillupsEnabled() +{ + return fillups_enabled; +} + + +// Set the case sensitivity for auto-completion. +void QextScintilla::setAutoCompletionCaseSensitivity(bool cs) +{ + SendScintilla(SCI_AUTOCSETIGNORECASE,!cs); +} + + +// Return the case sensitivity for auto-completion. +bool QextScintilla::autoCompletionCaseSensitivity() +{ + return !SendScintilla(SCI_AUTOCGETIGNORECASE); +} + + +// Set the replace word mode for auto-completion. +void QextScintilla::setAutoCompletionReplaceWord(bool replace) +{ + SendScintilla(SCI_AUTOCSETDROPRESTOFWORD,replace); +} + + +// Return the replace word mode for auto-completion. +bool QextScintilla::autoCompletionReplaceWord() +{ + return SendScintilla(SCI_AUTOCGETDROPRESTOFWORD); +} + + +// Set the single item mode for auto-completion. +void QextScintilla::setAutoCompletionShowSingle(bool single) +{ + showSingle = single; +} + + +// Return the single item mode for auto-completion. +bool QextScintilla::autoCompletionShowSingle() +{ + return showSingle; +} + + +// Set the APIs for call tips. +void QextScintilla::setCallTipsAPIs(QextScintillaAPIs *apis) +{ + ctAPIs = apis; +} + + +// Set maximum number of call tips displayed. +void QextScintilla::setCallTipsVisible(int nr) +{ + maxCallTips = nr; +} + + +// Set the document to display. +void QextScintilla::setDocument(const QextScintillaDocument &document) +{ + if (doc.pdoc != document.pdoc) + { + doc.undisplay(this); + doc.attach(document); + doc.display(this,&document); + } +} + + +// Ensure the document is read-write and return True if was was read-only. +bool QextScintilla::ensureRW() +{ + bool ro = isReadOnly(); + + if (ro) + setReadOnly(FALSE); + + return ro; +} + + +// Return the number of the first visible line. +int QextScintilla::firstVisibleLine() +{ + return SendScintilla(SCI_GETFIRSTVISIBLELINE); +} + + +// Return the height in pixels of the text in a particular line. +int QextScintilla::textHeight(int linenr) +{ + return SendScintilla(SCI_TEXTHEIGHT, linenr); +} + + +// See if auto-completion or user list is active. +bool QextScintilla::isListActive() +{ + return SendScintilla(SCI_AUTOCACTIVE); +} + + +// Cancel any current auto-completion or user list. +void QextScintilla::cancelList() +{ + SendScintilla(SCI_AUTOCCANCEL); +} + + +// Display a user list. +void QextScintilla::showUserList(int id, const QStringList &list) +{ + // Sanity check to make sure auto-completion doesn't get confused. + if (id <= 0) + return; + + const char sep = '\x03'; + + SendScintilla(SCI_AUTOCSETSEPARATOR, sep); + SendScintilla(SCI_USERLISTSHOW, id, list.join(QChar(sep)).latin1()); +} + + +// Translate the SCN_USERLISTSELECTION notification into something more useful. +void QextScintilla::handleUserListSelection(const char *text, int id) +{ + emit userListActivated(id, QString(text)); +} diff --git a/qt/qextscintilla.h b/qt/qextscintilla.h new file mode 100644 index 0000000..ec64f4f --- /dev/null +++ b/qt/qextscintilla.h @@ -0,0 +1,1457 @@ +// This module defines the "official" high-level API of the Qt port of +// Scintilla. +// +// Copyright (c) 2006 +// Riverbank Computing Limited +// +// This file is part of QScintilla. +// +// This copy of QScintilla is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2, or (at your option) any +// later version. +// +// QScintilla is supplied 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 +// QScintilla; see the file LICENSE. If not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +#ifndef QEXTSCINTILLA_H +#define QEXTSCINTILLA_H + + +#include +#include + +#include +#include +#include + + +class QextScintillaLexer; +class QextScintillaAPIs; +class QextScintillaCommandSet; + + +//! \brief The QextScintilla class implements a higher level, more Qt-like, +//! API to the Scintilla editor widget. +//! +//! QextScintilla implements methods, signals and slots similar to those found +//! in other Qt editor classes. It also provides a higher level interface to +//! features specific to Scintilla such as syntax styling, call tips, +//! auto-indenting and auto-completion than that provided by QextScintillaBase. +//! +//! The API is modelled on QTextEdit - a method of the same name should behave +//! in the same way. +class QEXTSCINTILLA_EXPORT QextScintilla : public QextScintillaBase +{ + Q_OBJECT + +public: + //! This enum defines the different auto-indentation styles. + enum { + //! A line is automatically indented to match the previous + //! line. + AiMaintain = 0x01, + + //! If the language supported by the current lexer has a + //! specific start of block character (e.g. { in C++), then a + //! line that begins with that character is indented as well as + //! the lines that make up the block. It may be logically ored + //! with AiClosing. + AiOpening = 0x02, + + //! If the language supported by the current lexer has a + //! specific end of block character (e.g. } in C++), then a + //! line that begins with that character is indented as well as + //! the lines that make up the block. It may be logically ored + //! with AiOpening. + AiClosing = 0x04 + }; + + //! This enum defines the different sources for auto-completion lists. + enum AutoCompletionSource { + //! The source is the current document. + AcsDocument, + + //! The source is any installed APIs. + AcsAPIs, + + //! The source is all available sources. + AcsAll + }; + + //! This enum defines the different brace matching modes. The + //! character pairs {}, [] and () are treated as braces. The Python + //! lexer will also match a : with the end of the corresponding + //! indented block. + enum BraceMatch { + //! Brace matching is disabled. + NoBraceMatch, + + //! Brace matching is enabled for a brace immediately before + //! the current position. + StrictBraceMatch, + + //! Brace matching is enabled for a brace immediately before or + //! after the current position. + SloppyBraceMatch + }; + + //! This enum defines the different edge modes for long lines. + enum EdgeMode { + //! Long lines are not marked. + EdgeNone = EDGE_NONE, + + //! A vertical line is drawn at the column set by + //! setEdgeColumn(). This is recommended for monospace fonts. + EdgeLine = EDGE_LINE, + + //! The background color of characters after the column limit + //! is changed to the color set by setEdgeColor(). This is + //! recommended for proportional fonts. + EdgeBackground = EDGE_BACKGROUND + }; + + //! This enum defines the different end-of-line modes. + enum EolMode { + //! A carriage return/line feed as used on Windows systems. + EolWindows = SC_EOL_CRLF, + + //! A line feed as used on Unix systems. + EolUnix = SC_EOL_LF, + + //! A carriage return as used on Mac systems. + EolMac = SC_EOL_CR + }; + + //! This enum defines the different styles for the folding margin. + enum FoldStyle { + //! Folding is disabled. + NoFoldStyle, + + //! Plain folding style using plus and minus symbols. + PlainFoldStyle, + + //! Circled folding style using circled plus and minus symbols. + CircledFoldStyle, + + //! Boxed folding style using boxed plus and minus symbols. + BoxedFoldStyle, + + //! Circled tree style using a flattened tree with circled plus + //! and minus symbols and rounded corners. + CircledTreeFoldStyle, + + //! Boxed tree style using a flattened tree with boxed plus and + //! minus symbols and right-angled corners. + BoxedTreeFoldStyle + }; + + //! This enum defines the different pre-defined marker symbols. + enum MarkerSymbol { + //! A circle. + Circle = SC_MARK_CIRCLE, + + //! A rectangle. + Rectangle = SC_MARK_ROUNDRECT, + + //! A triangle pointing to the right. + RightTriangle = SC_MARK_ARROW, + + //! A smaller rectangle. + SmallRectangle = SC_MARK_SMALLRECT, + + //! An arrow pointing to the right. + RightArrow = SC_MARK_SHORTARROW, + + //! An invisible marker that allows code to track the movement + //! of lines. + Invisible = SC_MARK_EMPTY, + + //! A triangle pointing down. + DownTriangle = SC_MARK_ARROWDOWN, + + //! A drawn minus sign. + Minus = SC_MARK_MINUS, + + //! A drawn plus sign. + Plus = SC_MARK_PLUS, + + //! A vertical line drawn in the background colour. + VerticalLine = SC_MARK_VLINE, + + //! A bottom left corner drawn in the background colour. + BottomLeftCorner = SC_MARK_LCORNER, + + //! A vertical line with a centre right horizontal line drawn + //! in the background colour. + LeftSideSplitter = SC_MARK_TCORNER, + + //! A drawn plus sign in a box. + BoxedPlus = SC_MARK_BOXPLUS, + + //! A drawn plus sign in a connected box. + BoxedPlusConnected = SC_MARK_BOXPLUSCONNECTED, + + //! A drawn minus sign in a box. + BoxedMinus = SC_MARK_BOXMINUS, + + //! A drawn minus sign in a connected box. + BoxedMinusConnected = SC_MARK_BOXMINUSCONNECTED, + + //! A rounded bottom left corner drawn in the background + //! colour. + RoundedBottomLeftCorner = SC_MARK_LCORNERCURVE, + + //! A vertical line with a centre right curved line drawn in + //! the background colour. + LeftSideRoundedSplitter = SC_MARK_TCORNERCURVE, + + //! A drawn plus sign in a circle. + CircledPlus = SC_MARK_CIRCLEPLUS, + + //! A drawn plus sign in a connected box. + CircledPlusConnected = SC_MARK_CIRCLEPLUSCONNECTED, + + //! A drawn minus sign in a circle. + CircledMinus = SC_MARK_CIRCLEMINUS, + + //! A drawn minus sign in a connected circle. + CircledMinusConnected = SC_MARK_CIRCLEMINUSCONNECTED, + + //! No symbol is drawn but the line of text is drawn with the + //! same background colour. + Background = SC_MARK_BACKGROUND, + + //! Three drawn dots. + ThreeDots = SC_MARK_DOTDOTDOT, + + //! Three drawn arrows pointing right. + ThreeRightArrows = SC_MARK_ARROWS + }; + + //! This enum defines the different whitespace visibility modes. When + //! whitespace is visible spaces are displayed as small centred dots + //! and tabs are displayed as light arrows pointing to the right. + enum WhitespaceVisibility { + //! Whitespace is invisible. + WsInvisible = SCWS_INVISIBLE, + + //! Whitespace is always visible. + WsVisible = SCWS_VISIBLEALWAYS, + + //! Whitespace is visible after the whitespace used for + //! indentation. + WsVisibleAfterIndent = SCWS_VISIBLEAFTERINDENT + }; + + //! This enum defines the different line wrap modes. + enum WrapMode { + //! Lines are not wrapped. + WrapNone = SC_WRAP_NONE, + + //! Lines are wrapped at word boundaries. + WrapWord = SC_WRAP_WORD, + + //! Lines are wrapped at character boundaries. + WrapCharacter = SC_WRAP_CHAR + }; + + //! This enum defines the different line wrap visual flags. + enum WrapVisualFlag { + //! No wrap flag is displayed. + WrapFlagNone, + + //! A wrap flag is displayed by the text. + WrapFlagByText, + + //! A wrap flag is displayed by the border. + WrapFlagByBorder + }; + + //! Construct an empty QextScintilla with parent \a parent, name \a + //! name, and widget flags \a f. + QextScintilla(QWidget *parent = 0,const char *name = 0,WFlags f = 0); + + //! Destroys the QextScintilla instance. + virtual ~QextScintilla(); + + //! Returns TRUE if auto-completion lists are case sensitive. + //! + //! \sa setAutoCompletionCaseSensitivity() + bool autoCompletionCaseSensitivity(); + + //! Returns true if auto-completion fill-up characters are enabled. + //! + //! \sa setAutoCompletionFillups(), setAutoCompletionFillupsEnabled() + bool autoCompletionFillupsEnabled(); + + //! Returns TRUE if the rest of the word to the right of the current + //! cursor is removed when an item from an auto-completion list is + //! selected. + //! + //! \sa setAutoCompletionReplaceWord() + bool autoCompletionReplaceWord(); + + //! Returns TRUE if the only item in an auto-completion list with a + //! single entry is automatically used and the list not displayed. + //! + //! \sa setAutoCompletionShowSingle() + bool autoCompletionShowSingle(); + + //! Returns the current source for the auto-completion list when it is + //! being displayed automatically as the user types. + //! + //! \sa setAutoCompletionSource() + AutoCompletionSource autoCompletionSource() const {return acSource;} + + //! Returns the current threshold for the automatic display of the + //! auto-completion list as the user types. + //! + //! \sa setAutoCompletionThreshold() + int autoCompletionThreshold() const {return acThresh;} + + //! Returns TRUE if auto-indentation is enabled. + //! + //! \sa setAutoIndent() + bool autoIndent() const {return autoInd;} + + //! Returns TRUE if the backspace key unindents a line instead of + //! deleting a character. The default is FALSE. + //! + //! \sa setBackspaceUnindents(), tabIndents(), setTabIndents() + bool backspaceUnindents(); + + //! Mark the beginning of a sequence of actions that can be undone by + //! a single call to undo(). + //! + //! \sa endUndoAction(), undo() + void beginUndoAction(); + + //! Returns the brace matching mode. + //! + //! \sa setBraceMatching() + BraceMatch braceMatching() const {return braceMode;} + + //! Returns the maximum number of call tips that are displayed. + //! + //! \sa setCallTipsVisible() + int callTipsVisible() const {return maxCallTips;} + + //! Cancel any current auto-completion or user defined list. + void cancelList(); + + //! Clear all registered images. + //! + //! \sa registerImage() + void clearRegisteredImages(); + + //! All the lines of the text have their end-of-lines converted to mode + //! \a mode. + //! + //! \sa eolMode(), setEolMode() + void convertEols(EolMode mode); + + //! Returns the widget's text (ie. foreground) colour. + //! + //! \sa setColor() + QColor color() const; + + //! Returns the attached document. + //! + //! \sa setDocument() + QextScintillaDocument document() {return doc;} + + //! Mark the end of a sequence of actions that can be undone by a + //! single call to undo(). + //! + //! \sa beginUndoAction(), undo() + void endUndoAction(); + + //! Returns the color of the marker used to show that a line has + //! exceeded the length set by setEdgeColumn(). + //! + //! \sa setEdgeColor(), \sa setEdgeColumn + QColor edgeColor(); + + //! Returns the number of the column after which lines are considered + //! to be long. + //! + //! \sa setEdgeColumn() + int edgeColumn(); + + //! Returns the edge mode which determines how long lines are marked. + //! + //! \sa setEdgeMode() + EdgeMode edgeMode(); + + //! Returns the end-of-line mode. + //! + //! \sa setEolMode() + EolMode eolMode(); + + //! Returns the visibility of end-of-lines. + //! + //! \sa setEolVisibility() + bool eolVisibility(); + + //! Find the next occurrence of the string \a expr and return TRUE if + //! \a expr was found, otherwise returns FALSE. If \a expr is found it + //! becomes the current selection. + //! + //! If \a re is TRUE then \a expr is interpreted as a regular + //! expression rather than a simple string. + //! + //! If \a cs is TRUE then the search is case sensitive. + //! + //! If \a wo is TRUE then the search looks for whole word matches only, + //! otherwise it searches for any matching text. + //! + //! If \a wrap is TRUE then the search wraps around the end of the + //! text. + //! + //! If \a forward is TRUE (the default) then the search is forward from + //! the starting position to the end of the text, otherwise it is + //! backwards to the beginning of the text. + //! + //! If either \a line or \a index are negative (the default) then the + //! search begins from the current cursor position. Otherwise the + //! search begins at position \a index of line \a line. + //! + //! If \a show is TRUE (the default) then any text found is made + //! visible (ie. it is unfolded). + //! + //! \sa findNext(), replace() + virtual bool findFirst(const QString &expr,bool re,bool cs,bool wo, + bool wrap,bool forward = TRUE,int line = -1, + int index = -1,bool show = TRUE); + + //! Find the next occurence of the string found using findFirst(). + //! + //! \sa findFirst(), replace() + virtual bool findNext(); + + //! Returns the number of the first visible line. + int firstVisibleLine(); + + //! Returns the current folding style. + //! + //! \sa setFolding() + FoldStyle folding() const {return fold;} + + //! Sets \a *line and \a *index to the line and index of the cursor. + //! + //! \sa setCursorPosition() + void getCursorPosition(int *line,int *index); + + //! If there is a selection, \a *lineFrom is set to the line number in + //! which the selection begins and \a *lineTo is set to the line number + //! in which the selection ends. (They could be the same.) + //! \a *indexFrom is set to the index at which the selection begins + //! within \a *lineFrom, and \a *indexTo is set to the index at which + //! the selection ends within \a *lineTo. If there is no selection, + //! \a *lineFrom, \a *indexFrom, \a *lineTo and \a *indexTo are all set + //! to -1. + //! + //! \sa setSelection() + void getSelection(int *lineFrom,int *indexFrom, + int *lineTo,int *indexTo); + + //! Returns TRUE if some text is selected. + //! + //! \sa selectedText() + bool hasSelectedText() const {return selText;} + + //! Returns the number of characters that line \a line is indented by. + //! + //! \sa setIndentation() + int indentation(int line); + + //! Returns TRUE if the display of indentation guides is enabled. + //! + //! \sa setIndentationGuides() + bool indentationGuides(); + + //! Returns TRUE if indentations are created using tabs and spaces, + //! rather than just spaces. The default is TRUE. + //! + //! \sa setIndentationsUseTabs() + bool indentationsUseTabs(); + + //! Returns the indentation width in characters. The default is 0 + //! which means that the value returned by tabWidth() is actually used. + //! + //! \sa setIndentationWidth(), tabWidth() + int indentationWidth(); + + //! Returns TRUE if a call tip is currently active. + bool isCallTipActive(); + + //! Returns TRUE if an auto-completion or user defined list is + //! currently active. + bool isListActive(); + + //! Returns TRUE if the text has been modified. + //! + //! \sa setModified(), modificationChanged() + bool isModified(); + + //! Returns TRUE if the text edit is read-only. + //! + //! \sa setReadOnly() + bool isReadOnly(); + + //! Returns TRUE if there is something that can be redone. + //! + //! \sa redo() + bool isRedoAvailable(); + + //! Returns TRUE if there is something that can be undone. + //! + //! \sa undo() + bool isUndoAvailable(); + + //! Returns TRUE if text is interpreted as being UTF8 encoded. The + //! default is to interpret the text as Latin1 encoded. + //! + //! \sa setUtf8() + bool isUtf8(); + + //! Returns the line which is at position \a pos or -1 if there is no + //! line at that position. + int lineAt(const QPoint &pos); + + //! Returns the length of line \a line or -1 if there is no such line. + int lineLength(int line); + + //! Returns the number of lines of text. + int lines(); + + //! Returns the length of the text edit's text. + int length(); + + //! Returns the current language lexer used to style text. If it is 0 then + //! syntax styling is disabled. + //! + //! \sa setLexer() + QextScintillaLexer *lexer() const; + + //! Returns TRUE if line numbers are enabled for margin \a margin. + //! + //! \sa setMarginLineNumbers(), QextScintillaBase::SCI_GETMARGINTYPEN + bool marginLineNumbers(int margin); + + //! Returns the marker mask of margin \a margin. + //! + //! \sa setMarginMask(), QextScintillaMarker, + //! QextScintillaBase::SCI_GETMARGINMASKN + int marginMarkerMask(int margin); + + //! Returns TRUE if margin \a margin is sensitive to mouse clicks. + //! + //! \sa setMarginSensitivity(), marginClicked(), + //! QextScintillaBase::SCI_GETMARGINTYPEN + bool marginSensitivity(int margin); + + //! Returns the width in pixels of margin \a margin. + //! + //! \sa setMarginWidth(), QextScintillaBase::SCI_GETMARGINWIDTHN + int marginWidth(int margin); + + //! Define a marker using the symbol \a sym with the marker number + //! \a mnr. If \a mnr is -1 then the marker number is automatically + //! allocated. The marker number is returned or -1 if the marker + //! number was already allocated or too many markers have been defined. + //! + //! Markers are small geometric symbols and character used, for + //! example, to indicate the current line or, in debuggers, to indicate + //! breakpoints. If a margin has a width of 0 then its markers are not + //! drawn, but their background colours affect the background colour of + //! the corresponding line of text. + //! + //! There may be up to 32 markers defined and each line of text has a + //! set of these markers associated with it. Markers are drawn + //! according to their numerical identifier. Markers try to move with + //! their text by tracking where the start of their line moves to. For + //! example, when a line is deleted its markers are added to previous + //! line's markers. + //! + //! Each marker is identified by a marker number. Each instance of a + //! marker is identified by a marker handle. + int markerDefine(MarkerSymbol sym,int mnr = -1); + + //! Define a marker using the character \a ch with the marker number + //! \a mnr. If \a mnr is -1 then the marker number is automatically + //! allocated. The marker number is returned or -1 if the marker + //! number was already allocated or too many markers have been defined. + int markerDefine(char ch,int mnr = -1); + + //! Define a marker using a copy of the pixmap \a pm with the marker + //! number \a mnr. If \a mnr is -1 then the marker number is + //! automatically allocated. The marker number is returned or -1 if + //! the marker number was already allocated or too many markers have + //! been defined. + int markerDefine(const QPixmap *pm,int mnr = -1); + + //! Add a marker number \a mnr to line number \a linenr. A handle for + //! the marker is returned which can be used to track the marker's + //! position, or -1 if the \a mnr was invalid. + //! + //! \sa markerDelete(), markerDeleteAll(), markerDeleteHandle() + int markerAdd(int linenr,int mnr); + + //! Returns the 32 bit mask of marker numbers at line number \a linenr. + //! + //! \sa markerAdd() + unsigned markersAtLine(int linenr); + + //! Delete all markers with the marker number \a mnr in the line + //! \a linenr. If \a mnr is -1 then delete all markers from line + //! \a linenr. + //! + //! \sa markerAdd(), markerDeleteAll(), markerDeleteHandle() + void markerDelete(int linenr,int mnr = -1); + + //! Delete the all markers with the marker number \a mnr. If \a mnr is + //! -1 then delete all markers. + //! + //! \sa markerAdd(), markerDelete(), markerDeleteHandle() + void markerDeleteAll(int mnr = -1); + + //! Delete the the marker instance with the marker handle \a mhandle. + //! + //! \sa markerAdd(), markerDelete(), markerDeleteAll() + void markerDeleteHandle(int mhandle); + + //! Return the line number that contains the marker instance with the + //! marker handle \a mhandle. + int markerLine(int mhandle); + + //! Return the number of the next line to contain at least one marker + //! from a 32 bit mask of markers. \a linenr is the line number to + //! start the search from. \a mask is the mask of markers to search + //! for. + //! + //! \sa markerFindPrevious() + int markerFindNext(int linenr,unsigned mask); + + //! Return the number of the previous line to contain at least one + //! marker from a 32 bit mask of markers. \a linenr is the line number + //! to start the search from. \a mask is the mask of markers to search + //! for. + //! + //! \sa markerFindNext() + int markerFindPrevious(int linenr,unsigned mask); + + //! Returns the widget's paper (ie. background) colour. + //! + //! \sa setPaper() + QColor paper() const; + + //! Recolours the document between the \a start and \a end positions. + //! \a start defaults to the start of the document and \a end defaults + //! to the end of the document. + virtual void recolor(int start = 0,int end = -1); + + //! Register an image \a pm with ID \a id. Registered images can be + //! displayed in auto-completion lists. + //! + //! \sa clearRegisteredImages(), QextScintillaAPIs + void registerImage(int id,const QPixmap *pm); + + //! Replace the current selection, set by a previous call to + //! findFirst() or findNext(), with \a replaceStr. + //! + //! \sa findFirst(), findNext() + virtual void replace(const QString &replaceStr); + + //! Reset the fold margin colours to their defaults. + //! + //! \sa setFoldMarginColors() + void resetFoldMarginColors(); + + //! The fold margin may be drawn as a one pixel sized checkerboard + //! pattern of two colours, \a fore and \a back. + //! + //! \sa resetFoldMarginColors() + void setFoldMarginColors(const QColor &fore,const QColor &back); + + //! Sets the APIs used for auto-completion to \a apis. If \a apis is 0 + //! then any existing APIs are removed. + //! + //! \sa autoCompleteFromAPIs(), setCallTipsAPIs() + void setAutoCompletionAPIs(QextScintillaAPIs *apis = 0); + + //! A fill-up character is one that, when entered while an + //! auto-completion list is being displayed, causes the currently + //! selected item from the list to be added to the text followed by the + //! fill-up character. \a fillups is the set of fill-up characters. + //! The default is that no fill-up characters are set, although a lexer may + //! set its own. Explicitly setting the fill-up characters using this + //! method automatically enables their use. + //! + //! \sa autoCompletionFillupsEnabled(), setAutoCompletionFillupsEnabled() + void setAutoCompletionFillups(const char *fillups); + + //! Enable the use of fill-up characters, either those explicitly set or + //! those set by a lexer. By default, fill-up characters are disabled. + //! + //! \sa autoCompletionFillupsEnabled(), setAutoCompletionFillups() + void setAutoCompletionFillupsEnabled(bool enabled); + + //! A start character is one that, when entered, causes the + //! auto-completion list to be displayed. If a language lexer has been + //! set then this is ignored and the lexer defines the start + //! characters. The default is that no start characters are set. + //! + //! \sa setAutoCompletionThreshold() + void setAutoCompletionStartCharacters(const char *start); + + //! Sets the APIs used for call tips to \a apis. If \a apis is 0 then + //! then call tips are disabled. + //! + //! \sa setAutoCompletionAPIs() + void setCallTipsAPIs(QextScintillaAPIs *apis = 0); + + //! Set the background colour of call tips to \a col. The default is + //! white. + void setCallTipsBackgroundColor(const QColor &col); + + //! Set the foreground colour of call tips to \a col. The default is + //! mid-gray. + void setCallTipsForegroundColor(const QColor &col); + + //! Set the highlighted colour of call tip text to \a col. The default + //! is dark blue. + void setCallTipsHighlightColor(const QColor &col); + + //! Set the maximum number of call tips that are displayed to \a nr. + //! If the maximum number is 0 then all applicable call tips are + //! displayed. If the maximum number is -1 then one call tip will be + //! displayed with up and down arrows that allow the use to scroll + //! through the full list. The default is -1. + //! + //! \sa callTipsVisible() + void setCallTipsVisible(int nr); + + //! Attach the document \a document, replacing the currently attached + //! document. + //! + //! \sa document() + void setDocument(const QextScintillaDocument &document); + + //! Set the color of the marker used to show that a line has exceeded + //! the length set by setEdgeColumn(). + //! + //! \sa edgeColor(), \sa setEdgeColumn + void setEdgeColor(const QColor &col); + + //! Set the number of the column after which lines are considered to be + //! long. + //! + //! \sa edgeColumn() + void setEdgeColumn(int colnr); + + //! Set the edge mode which determines how long lines are marked. + //! + //! \sa edgeMode() + void setEdgeMode(EdgeMode mode); + + //! Set the default font. This has no effect if a language lexer has been + //! set. + virtual void setFont(const QFont &f); + + //! Set the background colour, including the alpha component, of marker + //! \a mnr to \a col. If \a mnr is -1 then the colour of all markers + //! is set. The default is white. + //! + //! \sa setMarkerForegroundColor() + void setMarkerBackgroundColor(const QColor &col,int mnr = -1); + + //! Set the foreground colour of marker \a mnr to \a col. If \a mnr is + //! -1 then the colour of all markers is set. The default is black. + //! + //! \sa setMarkerBackgroundColor() + void setMarkerForegroundColor(const QColor &col,int mnr = -1); + + //! Set the background colour used to display matched braces to \a col. + //! The default is white. + //! + //! \sa setMatchedBraceForegroundColor() + void setMatchedBraceBackgroundColor(const QColor &col); + + //! Set the foreground colour used to display matched braces to \a col. + //! The default is red. + //! + //! \sa setMatchedBraceBackgroundColor() + void setMatchedBraceForegroundColor(const QColor &col); + + //! Set the background colour used to display unmatched braces to + //! \a col. The default is white. + //! + //! \sa setUnmatchedBraceForegroundColor() + void setUnmatchedBraceBackgroundColor(const QColor &col); + + //! Set the foreground colour used to display unmatched braces to + //! \a col. The default is blue. + //! + //! \sa setUnmatchedBraceBackgroundColor() + void setUnmatchedBraceForegroundColor(const QColor &col); + + //! Set the visual flags displayed when a line is wrapped. \a eflag + //! determines if and where the flag at the end of a line is displayed. + //! \a sflag determines if and where the flag at the start of a line is + //! displayed. \a sindent is the number of characters a wrapped line + //! is indented by. By default no visual flags are displayed. + void setWrapVisualFlags(WrapVisualFlag eflag, + WrapVisualFlag sflag = WrapFlagNone, int sindent = 0); + + //! Returns the selected text or an empty string if there is no + //! currently selected text. + //! + //! \sa hasSelectedText() + QString selectedText(); + + //! Displays a user defined list which can be interacted with like an + //! auto-completion list. \a id is an identifier for the list which + //! is passed as an argument to the userListActivated() signal and must + //! be at least 1. \a list is the text with which the list is + //! populated. + //! + //! \sa cancelList(), isListActive(), userListActivated() + void showUserList(int id, const QStringList &list); + + //! The standard command set is returned. + QextScintillaCommandSet *standardCommands() const {return stdCmds;} + + //! Returns TRUE if the tab key indents a line instead of inserting a + //! tab character. The default is TRUE. + //! + //! \sa setTabIndents(), backspaceUnindents(), setBackspaceUnindents() + bool tabIndents(); + + //! Returns the tab width in characters. The default is 8. + //! + //! \sa setTabWidth() + int tabWidth(); + + //! Returns the text edit's text. + //! + //! \sa setText() + QString text(); + + //! \overload + //! + //! Returns the text of line \a line. + //! + //! \sa setText() + QString text(int line); + + //! Returns the height in pixels of the text in line number \a linenr. + int textHeight(int linenr); + + //! Returns the visibility of whitespace. + //! + //! \sa setWhitespaceVisibility() + WhitespaceVisibility whitespaceVisibility(); + + //! Returns the line wrap mode. + //! + //! \sa setWrapMode() + WrapMode wrapMode(); + +public slots: + //! Appends the text \a text to the end of the text edit. Note that + //! the undo/redo history is cleared by this function. + virtual void append(const QString &text); + + //! Display an auto-completion list based on any installed APIs, the + //! current contents of the document and the characters immediately to + //! the left of the cursor. + //! + //! \sa autoCompleteFromAPIs(), autoCompleteFromDocument() + virtual void autoCompleteFromAll(); + + //! Display an auto-completion list based on any installed APIs and the + //! characters immediately to the left of the cursor. + //! + //! \sa autoCompleteFromAll(), autoCompleteFromDocument(), + //! setAutoCompletionAPIs() + virtual void autoCompleteFromAPIs(); + + //! Display an auto-completion list based on the current contents of + //! the document and the characters immediately to the left of the + //! cursor. + //! + //! \sa autoCompleteFromAll(), autoCompleteFromAPIs() + virtual void autoCompleteFromDocument(); + + //! Display a call tip based on the the characters immediately to the + //! left of the cursor. + virtual void callTip(); + + //! Deletes all the text in the text edit. + virtual void clear(); + + //! Copies any selected text to the clipboard. + //! + //! \sa copyAvailable(), cut(), paste() + virtual void copy(); + + //! Copies any selected text to the clipboard and then deletes the + //! text. + //! + //! \sa copy(), paste() + virtual void cut(); + + //! Ensures that the cursor is visible. + virtual void ensureCursorVisible(); + + //! Ensures that the line number \a line is visible. + virtual void ensureLineVisible(int line); + + //! If any lines are currently folded then they are all unfolded. + //! Otherwise all lines are folded. This has the same effect as + //! clicking in the fold margin with the shift and control keys + //! pressed. If \a children is not set (the default) then only the top + //! level fold points are affected, otherwise the state of all fold + //! points are changed. + virtual void foldAll(bool children = FALSE); + + //! If the line \a line is folded then it is unfolded. Otherwise it is + //! folded. This has the same effect as clicking in the fold margin. + virtual void foldLine(int line); + + //! Increases the indentation of line \a line by an indentation width. + //! + //! \sa unindent() + virtual void indent(int line); + + //! Insert the text \a text at the current position. + virtual void insert(const QString &text); + + //! Insert the text \a text in the line \a line at the position + //! \a index. + virtual void insertAt(const QString &text,int line,int index); + + //! If the cursor is either side of a brace character then move it to + //! the position of the corresponding brace. + virtual void moveToMatchingBrace(); + + //! Pastes any text from the clipboard into the text edit at the + //! current cursor position. + //! + //! \sa copy(), cut() + virtual void paste(); + + //! Redo the last change or sequence of changes. + //! + //! \sa isRedoAvailable() + virtual void redo(); + + //! Removes any selected text. + virtual void removeSelectedText(); + + //! Resets the background colour of selected text to the default. + //! + //! \sa setSelectionBackgroundColor(), resetSelectionForegroundColor() + virtual void resetSelectionBackgroundColor(); + + //! Resets the foreground colour of selected text to the default. + //! + //! \sa setSelectionForegroundColor(), resetSelectionBackgroundColor() + virtual void resetSelectionForegroundColor(); + + //! If \a select is TRUE (the default) then all the text is selected. + //! If \a select is FALSE then any currently selected text is + //! deselected. + virtual void selectAll(bool select = TRUE); + + //! If the cursor is either side of a brace character then move it to + //! the position of the corresponding brace and select the text between + //! the braces. + virtual void selectToMatchingBrace(); + + //! If \a cs is TRUE then auto-completion lists are case sensitive. + //! The default is TRUE. + //! + //! \sa autoCompletionCaseSensitivity() + virtual void setAutoCompletionCaseSensitivity(bool cs); + + //! If \a replace is TRUE then when an item from an auto-completion + //! list is selected, the rest of the word to the right of the current + //! cursor is removed. The default is FALSE. + //! + //! \sa autoCompletionReplaceWord() + virtual void setAutoCompletionReplaceWord(bool replace); + + //! If \a single is TRUE then when there is only a single entry in an + //! auto-completion list it is automatically used and the list is not + //! displayed. This only has an effect when auto-completion is + //! explicitly requested (using autoCompleteFromAPIs() and + //! autoCompleteFromDocument()) and has no effect when auto-completion + //! is triggered as the user types. The default is FALSE. + //! + //! \sa autoCompletionShowSingle() + virtual void setAutoCompletionShowSingle(bool single); + + //! Sets the source for the auto-completion list when it is being + //! displayed automatically as the user types to \a source. The + //! default is AcsDocument. + //! + //! \sa autoCompletionSource() + virtual void setAutoCompletionSource(AutoCompletionSource source); + + //! Sets the threshold for the automatic display of the auto-completion + //! list as the user types to \a thresh. The threshold is the number + //! of characters that the user must type before the list is displayed. + //! If the threshold is less than or equal to 0 then the list is + //! disabled. The default is -1. + //! + //! \sa autoCompletionThreshold(), setAutoCompletionStartCharacters() + virtual void setAutoCompletionThreshold(int thresh); + + //! If \a autoindent is TRUE then auto-indentation is enabled. The + //! default is FALSE. + //! + //! \sa autoIndent() + virtual void setAutoIndent(bool autoindent); + + //! Sets the brace matching mode to \a bm. The default is + //! NoBraceMatching. + //! + //! \sa braceMatching() + virtual void setBraceMatching(BraceMatch bm); + + //! If \a deindent is TRUE then the backspace key will unindent a line + //! rather then delete a character. + //! + //! \sa backspaceUnindents(), tabIndents(), setTabIndents() + virtual void setBackspaceUnindents(bool unindent); + + //! Sets the foreground colour of the caret to \a col. + virtual void setCaretForegroundColor(const QColor &col); + + //! Sets the background colour, including the alpha component, of the + //! line containing the caret to \a col. + //! + //! \sa setCaretLineVisible() + virtual void setCaretLineBackgroundColor(const QColor &col); + + //! Enables or disables, according to \a enable, the background color + //! of the line containing the caret. + //! + //! \sa setCaretLineBackgroundColor() + virtual void setCaretLineVisible(bool enable); + + //! Sets the width of the caret to \a width pixels. A \a width of 0 + //! makes the caret invisible. + virtual void setCaretWidth(int width); + + //! The widget's text (ie. foreground) colour is set to \a c. This has no + //! effect if a language lexer has been set. + //! + //! \sa color() + virtual void setColor(const QColor &c); + + //! Sets the cursor to the line \a line at the position \a index. + //! + //! \sa getCursorPosition() + virtual void setCursorPosition(int line,int index); + + //! Sets the end-of-line mode to \a mode. The default is the + //! platform's natural mode. + //! + //! \sa eolMode() + virtual void setEolMode(EolMode mode); + + //! If \a visible is TRUE then end-of-lines are made visible. The + //! default is that they are invisible. + //! + //! \sa eolVisibility() + virtual void setEolVisibility(bool visible); + + //! Sets the folding style for margin 2 to \a fold. The default is + //! NoFoldStyle (ie. folding is disabled). + //! + //! \sa folding() + virtual void setFolding(FoldStyle fold); + + //! Sets the indentation of line \a to \a indentation characters. + //! + //! \sa indentation() + virtual void setIndentation(int line,int indentation); + + //! Enables or disables, according to \a enable, this display of + //! indentation guides. + //! + //! \sa indentationGuides() + virtual void setIndentationGuides(bool enable); + + //! Set the background colour of indentation guides to \a col. + //! + //! \sa setIndentationGuidesForegroundColor() + virtual void setIndentationGuidesBackgroundColor(const QColor &col); + + //! Set the foreground colour of indentation guides to \a col. + //! + //! \sa setIndentationGuidesBackgroundColor() + virtual void setIndentationGuidesForegroundColor(const QColor &col); + + //! If \a tabs is TRUE then indentations are created using tabs and + //! spaces, rather than just spaces. + //! + //! \sa indentationsUseTabs() + virtual void setIndentationsUseTabs(bool tabs); + + //! Sets the indentation width to \a width characters. If \a width is + //! 0 then the value returned by tabWidth() is used. + //! + //! \sa indentationWidth(), tabWidth() + virtual void setIndentationWidth(int width); + + //! Sets the specific language lexer used to style text to \a lexer. If + //! \a lexer is 0 then syntax styling is disabled. + //! + //! \sa lexer() + virtual void setLexer(QextScintillaLexer *lexer = 0); + + //! Set the background colour of all margins to \a col. The default is + //! a gray. + //! + //! \sa setMarginsForegroundColor() + virtual void setMarginsBackgroundColor(const QColor &col); + + //! Set the font used in all margins to \a f. + virtual void setMarginsFont(const QFont &f); + + //! Set the foreground colour of all margins to \a col. The default is + //! black. + //! + //! \sa setMarginsBackgroundColor() + virtual void setMarginsForegroundColor(const QColor &col); + + //! Enables or disables, according to \a lnrs, the display of line + //! numbers in margin \a margin. + //! + //! \sa marginLineNumbers(), QextScintillaBase::SCI_SETMARGINTYPEN + virtual void setMarginLineNumbers(int margin,bool lnrs); + + //! Sets the marker mask of margin \a margin to \a mask. Only those + //! markers whose bit is set in the mask are displayed in the margin. + //! + //! \sa marginMarkerMask(), QextScintillaMarker, + //! QextScintillaBase::SCI_SETMARGINMASKN + virtual void setMarginMarkerMask(int margin,int mask); + + //! Enables or disables, according to \a sens, the sensitivity of + //! margin \a margin to mouse clicks. If the user clicks in a + //! sensitive margin the marginClicked() signal is emitted. + //! + //! \sa marginSensitivity(), marginClicked(), + //! QextScintillaBase::SCI_SETMARGINSENSITIVEN + virtual void setMarginSensitivity(int margin,bool sens); + + //! Sets the width of margin \a margin to \a width pixels. If the + //! width of a margin is 0 then it is not displayed. + //! + //! \sa marginWidth(), QextScintillaBase::SCI_SETMARGINWIDTHN + virtual void setMarginWidth(int margin,int width); + + //! Sets the width of margin \a margin so that it is wide enough to + //! display \a s in the current margin font. + //! + //! \sa marginWidth(), QextScintillaBase::SCI_SETMARGINWIDTHN + virtual void setMarginWidth(int margin,const QString &s); + + //! Sets the modified state of the text edit to \a m. Note that it is + //! only possible to clear the modified state (where \a m is FALSE). + //! Attempts to set the modified state (where \a m is TRUE) are + //! ignored. + //! + //! \sa isModified(), modificationChanged() + virtual void setModified(bool m); + + //! The widget's paper (ie. background) colour is set to \a c. This has no + //! effect if a language lexer has been set. + //! + //! \sa paper() + virtual void setPaper(const QColor &c); + + //! Sets the read-only state of the text edit to \a ro. + //! + //! \sa isReadOnly() + virtual void setReadOnly(bool ro); + + //! Sets the selection which starts at position \a indexFrom in line + //! \a lineFrom and ends at position \a indexTo in line \a lineTo. The + //! cursor is moved to the end of the selection. + //! + //! \sa getSelection() + virtual void setSelection(int lineFrom,int indexFrom, + int lineTo,int indexTo); + + //! Sets the background colour, including the alpha component, of + //! selected text to \a col. + //! + //! \sa resetSelectionBackgroundColor(), setSelectionForegroundColor() + virtual void setSelectionBackgroundColor(const QColor &col); + + //! Sets the foreground colour of selected text to \a col. + //! + //! \sa resetSelectionForegroundColor(), setSelectionBackgroundColor() + virtual void setSelectionForegroundColor(const QColor &col); + + //! If \a indent is TRUE then the tab key will indent a line rather + //! then insert a tab character. + //! + //! \sa tabIndents(), backspaceUnindents(), setBackspaceUnindents() + virtual void setTabIndents(bool indent); + + //! Sets the tab width to \a width characters. + //! + //! \sa tabWidth() + virtual void setTabWidth(int width); + + //! Replaces all of the current text with \a text. Note that the + //! undo/redo history is cleared by this function. + //! + //! \sa text() + virtual void setText(const QString &text); + + //! Sets the current text encoding. If \a cp is TRUE then UTF8 is + //! used, otherwise Latin1 is used. + //! + //! \sa isUtf8() + virtual void setUtf8(bool cp); + + //! Sets the visibility of whitespace to mode \a mode. The default is + //! that whitespace is invisible. + //! + //! \sa whitespaceVisibility() + virtual void setWhitespaceVisibility(WhitespaceVisibility mode); + + //! Sets the line wrap mode to mode \a mode. The default is that lines + //! are not wrapped. + //! + //! \sa wrapMode() + virtual void setWrapMode(WrapMode mode); + + //! Undo the last change or sequence of changes. + //! + //! Scintilla has multiple level undo and redo. It will continue to + //! record undoable actions until memory runs out. Sequences of + //! typing or deleting are compressed into single actions to make it + //! easier to undo and redo at a sensible level of detail. Sequences + //! of actions can be combined into actions that are undone as a unit. + //! These sequences occur between calls to beginUndoAction() and + //! endUndoAction(). These sequences can be nested and only the top + //! level sequences are undone as units. + //! + //! \sa beginUndoAction(), endUndoAction(), isUndoAvailable() + virtual void undo(); + + //! Decreases the indentation of line \a line by an indentation width. + //! + //! \sa indent() + virtual void unindent(int line); + + //! Zooms in on the text by by making the base font size \a range + //! points larger and recalculating all font sizes. + //! + //! \sa zoomOut(), zoomTo() + virtual void zoomIn(int range); + + //! \overload + //! + //! Zooms in on the text by by making the base font size one point + //! larger and recalculating all font sizes. + virtual void zoomIn(); + + //! Zooms out on the text by by making the base font size \a range + //! points smaller and recalculating all font sizes. + //! + //! \sa zoomIn(), zoomTo() + virtual void zoomOut(int range); + + //! \overload + //! + //! Zooms out on the text by by making the base font size one point + //! larger and recalculating all font sizes. + virtual void zoomOut(); + + //! Zooms the text by making the base font size \a size points and + //! recalculating all font sizes. + //! + //! \sa zoomIn(), zoomOut() + virtual void zoomTo(int size); + +signals: + //! This signal is emitted whenever the cursor position changes. + //! \a line contains the line number and \a pos contains the + //! character position within the line. + void cursorPositionChanged(int line,int pos); + + //! This signal is emitted whenever text is selected or de-selected. + //! \a yes is TRUE if text has been selected and FALSE if text has been + //! deselected. If \a yes is TRUE then copy() can be used to copy the + //! selection to the clipboard. If \a yes is FALSE then copy() does + //! nothing. + //! + //! \sa copy(), selectionChanged() + void copyAvailable(bool yes); + + //! This signal is emitted whenever the user clicks on a sensitive + //! margin. \a margin is the margin. \a line is the number of the + //! line where the user clicked. \a state is the state of the modifier + //! keys (ShiftButton, ControlButton and AltButton) when the user + //! clicked. + //! + //! \sa marginSensitivity(), setMarginSensitivity() + void marginClicked(int margin,int line,Qt::ButtonState state); + + //! This signal is emitted whenever the user attempts to modify + //! read-only text. + //! + //! \sa isReadOnly(), setReadOnly() + void modificationAttempted(); + + //! This signal is emitted whenever the modification state of the text + //! changes. \a m is TRUE if the text has been modified. + //! + //! \sa isModified(), setModified() + void modificationChanged(bool m); + + //! This signal is emitted whenever the selection changes. + //! + //! \sa copyAvailable() + void selectionChanged(); + + //! This signal is emitted whenever the text in the text edit changes. + void textChanged(); + + //! This signal is emitted when an item in a user defined list is + //! activated (selected). \a id is the list identifier. \a string is + //! the text of the item. + //! + //! \sa showUserList() + void userListActivated(int id, const QString &string); + +private slots: + void handleCallTipClick(int dir); + void handleCharAdded(int charadded); + void handleMarginClick(int pos,int margin,int modifiers); + void handleModified(int pos,int mtype,const char *text,int len, + int added,int line,int foldNow,int foldPrev); + void handlePropertyChange(const char *prop,const char *val); + void handleSavePointReached(); + void handleSavePointLeft(); + void handleSelectionChanged(bool yes); + void handleUserListSelection(const char *text, int id); + + void handleStyleColorChange(const QColor &c,int style); + void handleStyleEolFillChange(bool eolfill,int style); + void handleStyleFontChange(const QFont &f,int style); + void handleStylePaperChange(const QColor &c,int style); + + void handleUpdateUI(); + +private: + enum IndentState { + isNone, + isKeywordStart, + isBlockStart, + isBlockEnd + }; + + void maintainIndentation(char ch,long pos); + void autoIndentation(char ch,long pos); + void autoIndentLine(long pos,int line,int indent); + int blockIndent(int line); + IndentState getIndentState(int line); + bool rangeIsWhitespace(long spos,long epos); + int findStyledWord(const char *text,int style,const char *words); + + void checkMarker(int &mnr); + long posFromLineIndex(int line,int index); + void lineIndexFromPos(long pos,int *line,int *index); + int currentIndent(); + int indentWidth(); + bool doFind(); + long simpleFind(); + void foldClick(int lineClick,int bstate); + void foldChanged(int line,int levelNow,int levelPrev); + void foldExpand(int &line,bool doExpand,bool force = FALSE, + int visLevels = 0,int level = -1); + void setFoldMarker(int marknr,int mark = SC_MARK_EMPTY); + QString convertText(const char *s); + void setStylesFont(const QFont &f,int style); + + void braceMatch(); + bool findMatchingBrace(long &brace,long &other,BraceMatch mode); + long checkBrace(long pos,int brace_style,bool &colonMode); + void gotoMatchingBrace(bool select); + + void startAutoCompletion(AutoCompletionSource acs, bool checkThresh, + bool single); + bool isAutoCStartChar(char ch) const; + + bool currentCharInWord(); + bool isWordChar(char ch) const; + + bool ensureRW(); + + struct FindState + { + FindState() : inProgress(0) {} + + bool inProgress; + QString expr; + bool wrap; + bool forward; + int flags; + long startpos; + long endpos; + bool show; + }; + + FindState findState; + + unsigned allocatedMarkers; + long oldPos; + bool selText; + FoldStyle fold; + bool autoInd; + BraceMatch braceMode; + AutoCompletionSource acSource; + int acThresh; + const char *acStart; + QextScintillaAPIs *acAPIs; + QextScintillaAPIs *ctAPIs; + int maxCallTips; + bool showSingle; + long ctpos; + QGuardedPtr lex; + QextScintillaCommandSet *stdCmds; + QextScintillaDocument doc; + bool modified; + QColor nl_text_colour; + QColor nl_paper_colour; + QFont nl_font; + bool explicit_fillups; + bool fillups_enabled; + QCString saved_fillups; + +#if defined(Q_DISABLE_COPY) + QextScintilla(const QextScintilla &); + QextScintilla &operator=(const QextScintilla &); +#endif +}; + +#endif diff --git a/qt/qextscintillaapis.cpp b/qt/qextscintillaapis.cpp new file mode 100644 index 0000000..2ab7397 --- /dev/null +++ b/qt/qextscintillaapis.cpp @@ -0,0 +1,210 @@ +// This module implements the QextScintillaAPIs class. +// +// Copyright (c) 2006 +// Riverbank Computing Limited +// +// This file is part of QScintilla. +// +// This copy of QScintilla is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2, or (at your option) any +// later version. +// +// QScintilla is supplied 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 +// QScintilla; see the file LICENSE. If not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +#include +#include + +#include "qextscintillaapis.h" + + +// The ctor. +QextScintillaAPIs::QextScintillaAPIs() : sorted(TRUE), ctcursor(0) +{ +} + + +// The dtor. +QextScintillaAPIs::~QextScintillaAPIs() +{ +} + + +// Clear out all API information. +bool QextScintillaAPIs::load(const QString &fname) +{ + QFile f(fname); + + if (!f.open(IO_ReadOnly)) + return FALSE; + + QTextStream ts(&f); + + for (;;) + { + QString line = ts.readLine(); + + if (line.isNull()) + break; + + apis.append(line); + } + + sorted = FALSE; + + return TRUE; +} + + +// Add a single API entry. +void QextScintillaAPIs::add(const QString &entry) +{ + apis.append(entry); + sorted = FALSE; +} + + +// Clear out all API information. +void QextScintillaAPIs::clear() +{ + apis.clear(); + sorted = TRUE; +} + + +// Add auto-completion words to an existing list. +void QextScintillaAPIs::autoCompletionList(const QString &starts, bool cs, + QStringList &wlist) +{ + ensureSorted(); + + QStringList::ConstIterator it = apis.begin(); + + // Find the first match in the sorted list. + while (it != apis.end()) + { + if ((*it).find(starts, 0, cs) == 0) + break; + + ++it; + } + + QString prev; + + while (it != apis.end()) + { + if ((*it).find(starts, 0, cs) != 0) + break; + + QString w = (*it).section('(', 0, 0); + + if (w != prev) + { + if (wlist.findIndex(w) < 0) + wlist.append(w); + + prev = w; + } + + ++it; + } +} + + +// Return the call tip for a function. +QString QextScintillaAPIs::callTips(const QString &function,int maxnr, + int commas) +{ + ensureSorted(); + + QStringList::ConstIterator it; + + // Find the first match in the sorted list. + for (it = apis.begin(); it != apis.end(); ++it) + if ((*it).startsWith(function)) + break; + + QStringList cts; + QString prev; + + while (it != apis.end() && (*it).startsWith(function)) + { + if (maxnr > 0 && maxnr == cts.count()) + break; + + QString w = *it; + + // Remove any image ID used by auto-completion. + w.replace(QRegExp("\\?[^(]*"),""); + + if (w.find('(') == function.length() && w.contains(',') >= commas && w != prev) + { + cts.append(w); + prev = w; + } + + ++it; + } + + // See if we want to add a down arrow. + if (maxnr < 0 && cts.count() > 1) + { + // Remember the state so we can scroll through it later. + ctlist = cts; + ctcursor = 0; + + QString ct = cts[0]; + + ct.prepend('\002'); + + return ct; + } + + ctlist.clear(); + + return cts.join("\n"); +} + + +// Return the next or previous call tip. +QString QextScintillaAPIs::callTipsNextPrev(int dir) +{ + QString ct; + + // Get the call tip. + if (dir == 1 && ctcursor > 0) + ct = ctlist[--ctcursor]; + else if (dir == 2 && ctcursor < ctlist.count() - 1) + ct = ctlist[++ctcursor]; + + // Add the arrows. + if (!ct.isNull()) + { + if (ctcursor < ctlist.count() - 1) + ct.prepend('\002'); + + if (ctcursor > 0) + ct.prepend('\001'); + } + + return ct; +} + + +// Ensure the list is sorted. +void QextScintillaAPIs::ensureSorted() +{ + if (!sorted) + { + apis.sort(); + sorted = TRUE; + } +} diff --git a/qt/qextscintillaapis.h b/qt/qextscintillaapis.h new file mode 100644 index 0000000..e112e41 --- /dev/null +++ b/qt/qextscintillaapis.h @@ -0,0 +1,84 @@ +// This module defines interface to the QextScintillaAPIs class. +// +// Copyright (c) 2006 +// Riverbank Computing Limited +// +// This file is part of QScintilla. +// +// This copy of QScintilla is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2, or (at your option) any +// later version. +// +// QScintilla is supplied 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 +// QScintilla; see the file LICENSE. If not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +#ifndef QEXTSCINTILLAAPIS_H +#define QEXTSCINTILLAAPIS_H + + +#include + +#include + + +//! \brief The QextScintillaAPIs class represents the textual API information +//! used in call tips and for auto-completion. +//! +//! API information is read from one or more files. Each API function is +//! described by a single line of text comprising the function's name, followed +//! by the function's optional comma separated parameters enclosed in +//! parenthesis, and finally followed by optional explanatory text. +//! +//! A function name may be followed by a `?' and a number. The number is used +//! by auto-completion to display a registered QPixmap with the function name. +//! +//! All function names are used by auto-completion, but only those that include +//! function parameters are used in call tips. +class QEXTSCINTILLA_EXPORT QextScintillaAPIs +{ +public: + //! Constructs a QextScintillaAPIs instance. + QextScintillaAPIs(); + + //! Destroys the QextScintillaAPIs instance. + ~QextScintillaAPIs(); + + //! Add the single API entry \a entry to the current set. + void add(const QString &entry); + + //! Load the API information from the file named \a fname, adding it to + //! the current set. Returns TRUE if successful, otherwise FALSE. + bool load(const QString &fname); + + //! Deletes all API information. + void clear(); + +private: + friend class QextScintilla; + + void autoCompletionList(const QString &starts, bool cs, + QStringList &wlist); + QString callTips(const QString &function,int maxnr,int commas); + QString callTipsNextPrev(int dir); + void ensureSorted(); + + bool sorted; + int ctcursor; + QStringList apis; + QStringList ctlist; + +#if defined(Q_DISABLE_COPY) + QextScintillaAPIs(const QextScintillaAPIs &); + QextScintillaAPIs &operator=(const QextScintillaAPIs &); +#endif +}; + +#endif diff --git a/qt/qextscintillabase.cpp b/qt/qextscintillabase.cpp new file mode 100644 index 0000000..63330d4 --- /dev/null +++ b/qt/qextscintillabase.cpp @@ -0,0 +1,582 @@ +// This module implements the "official" low-level API. +// +// Copyright (c) 2006 +// Riverbank Computing Limited +// +// This file is part of QScintilla. +// +// This copy of QScintilla is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2, or (at your option) any +// later version. +// +// QScintilla is supplied 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 +// QScintilla; see the file LICENSE. If not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "qextscintillabase.h" +#include "ScintillaQt.h" + + +// The #defines in Scintilla.h and the enums in qextscintillabase.h conflict +// (because we want to use the same names) so we have to undefine those we use +// in this file. +#undef SCI_SETCARETPERIOD +#undef SCK_DOWN +#undef SCK_UP +#undef SCK_LEFT +#undef SCK_RIGHT +#undef SCK_HOME +#undef SCK_END +#undef SCK_PRIOR +#undef SCK_NEXT +#undef SCK_DELETE +#undef SCK_INSERT +#undef SCK_ESCAPE +#undef SCK_BACK +#undef SCK_TAB +#undef SCK_RETURN +#undef SCK_ADD +#undef SCK_SUBTRACT +#undef SCK_DIVIDE + + +// Remember if we have linked the lexers. +static bool lexersLinked = FALSE; + +// The list of instances. +static QPtrList poolList; + + +// The ctor. +QextScintillaBase::QextScintillaBase(QWidget *parent,const char *name,WFlags f) + : QWidget(parent,name,f) +{ + sci = 0; + + QGridLayout *layout = new QGridLayout(this,2,2); + + txtarea = new QWidget(this,0,WRepaintNoErase|WResizeNoErase); + txtarea -> setSizePolicy(QSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding)); + txtarea -> setMouseTracking(TRUE); + txtarea -> setAcceptDrops(TRUE); + txtarea -> setFocusPolicy(WheelFocus); + txtarea -> setFocusProxy(this); + layout -> addWidget(txtarea,0,0); + + vsb = new QScrollBar(Vertical,this); + layout -> addWidget(vsb,0,1); + connect(vsb,SIGNAL(valueChanged(int)),SLOT(handleVSb(int))); + + hsb = new QScrollBar(Horizontal,this); + layout -> addWidget(hsb,1,0); + connect(hsb,SIGNAL(valueChanged(int)),SLOT(handleHSb(int))); + + txtarea -> installEventFilter(this); + + setFocusPolicy(WheelFocus); + + sci = new ScintillaQt(this); + + SendScintilla(SCI_SETCARETPERIOD,QApplication::cursorFlashTime() / 2); + + // Make sure the lexers are linked in. + if (!lexersLinked) + { + Scintilla_LinkLexers(); + + lexersLinked = TRUE; + } + + QClipboard *cb = QApplication::clipboard(); + + if (cb -> supportsSelection()) + connect(cb,SIGNAL(selectionChanged()),SLOT(handleSelection())); + + // Add it to the pool. + poolList.append(this); +} + + +// The dtor. +QextScintillaBase::~QextScintillaBase() +{ + // Remove it from the pool. + poolList.remove(this); + + delete sci; +} + + +// Return the viewport widget. +QWidget *QextScintillaBase::viewport() const +{ + return txtarea; +} + + +// Return an instance from the pool. +QextScintillaBase *QextScintillaBase::pool() +{ + return poolList.first(); +} + + +// Send a message to the real Scintilla widget using the low level Scintilla +// API. +long QextScintillaBase::SendScintilla(unsigned int msg,unsigned long wParam, + long lParam) +{ + return sci -> WndProc(msg,wParam,lParam); +} + + +// Send a message to the real Scintilla widget that needs a TextRange +// structure. +long QextScintillaBase::SendScintilla(unsigned int msg,long cpMin,long cpMax, + char *lpstrText) +{ + TextRange tr; + + tr.chrg.cpMin = cpMin; + tr.chrg.cpMax = cpMax; + tr.lpstrText = lpstrText; + + return sci -> WndProc(msg,0,reinterpret_cast(&tr)); +} + + +// Send a message to the real Scintilla widget that needs a RangeToFormat +// structure. +long QextScintillaBase::SendScintilla(unsigned int msg,unsigned long wParam, + QPainter *hdc,const QRect &rc, + long cpMin,long cpMax) +{ + RangeToFormat rf; + + rf.hdc = rf.hdcTarget = reinterpret_cast(hdc); + + rf.rc.left = rc.left(); + rf.rc.top = rc.top(); + rf.rc.right = rc.right() + 1; + rf.rc.bottom = rc.bottom() + 1; + + rf.chrg.cpMin = cpMin; + rf.chrg.cpMax = cpMax; + + return sci -> WndProc(msg,wParam,reinterpret_cast(&rf)); +} + + +// Send a message to the real Scintilla widget that needs a colour. +long QextScintillaBase::SendScintilla(unsigned int msg,unsigned long wParam, + const QColor &col) +{ + long lParam = (col.blue() << 16) | (col.green() << 8) | col.red(); + + return sci -> WndProc(msg,wParam,lParam); +} + + +// Send a message to the real Scintilla widget that needs a colour. +long QextScintillaBase::SendScintilla(unsigned int msg,const QColor &col) +{ + unsigned long wParam = (col.blue() << 16) | (col.green() << 8) | col.red(); + + return sci -> WndProc(msg,wParam,0); +} + + +// Handle events on behalf of the text area. +bool QextScintillaBase::eventFilter(QObject *o,QEvent *e) +{ + if (o != txtarea) + return QWidget::eventFilter(o,e); + + bool used = TRUE; + + switch (e -> type()) + { + case QEvent::Paint: + sci -> paintEvent(static_cast(e)); + break; + + case QEvent::Resize: + sci -> ChangeSize(); + break; + + case QEvent::MouseButtonPress: + mousePress(static_cast(e)); + break; + + case QEvent::MouseButtonRelease: + mouseRelease(static_cast(e)); + break; + + case QEvent::MouseButtonDblClick: + mouseDoubleClick(static_cast(e)); + break; + + case QEvent::MouseMove: + mouseMove(static_cast(e)); + break; + + case QEvent::Wheel: + mouseWheel(static_cast(e)); + break; + + case QEvent::ContextMenu: + contextMenu(static_cast(e)); + break; + + case QEvent::DragEnter: + sci -> dragEnterEvent(static_cast(e)); + break; + + case QEvent::DragMove: + sci -> dragMoveEvent(static_cast(e)); + break; + + case QEvent::DragLeave: + sci -> dragLeaveEvent(static_cast(e)); + break; + + case QEvent::Drop: + sci -> dropEvent(static_cast(e)); + break; + + default: + used = FALSE; + } + + return used; +} + + +// Handle the timer on behalf of the ScintillaQt instance. +void QextScintillaBase::handleTimer() +{ + sci -> Tick(); +} + + +// Handle the context menu on behalf of the ScintillaQt instance. +void QextScintillaBase::handlePopUp(int cmd) +{ + sci -> Command(cmd); +} + + +// Re-implemented to tell the widget it has the focus. +void QextScintillaBase::focusInEvent(QFocusEvent *) +{ + sci -> SetFocusState(true); +} + + +// Re-implemented to tell the widget it has lost the focus. +void QextScintillaBase::focusOutEvent(QFocusEvent *) +{ + sci -> SetFocusState(false); +} + + +// Handle a mouse button press. +void QextScintillaBase::mousePress(QMouseEvent *me) +{ + setFocus(); + + Point pt(me -> x(),me -> y()); + + switch (me -> button()) + { + case LeftButton: + { + unsigned clickTime; + + // It is a triple click if the timer is running and the + // mouse hasn't moved too much. + if (triple_click.isActive() && (me -> globalPos() - triple_click_at).manhattanLength() < QApplication::startDragDistance()) + clickTime = sci -> lastClickTime + Platform::DoubleClickTime() - 1; + else + clickTime = sci -> lastClickTime + Platform::DoubleClickTime() + 1; + + triple_click.stop(); + + bool shift = me -> state() & ShiftButton; + bool ctrl = me -> state() & ControlButton; + bool alt = me -> state() & AltButton; + + sci -> ButtonDown(pt,clickTime,shift,ctrl,alt); + break; + } + + case MidButton: + { + QClipboard *cb = QApplication::clipboard(); + + if (cb -> supportsSelection()) + { + cb -> setSelectionMode(TRUE); + + int pos = sci -> PositionFromLocation(pt); + + sci -> SetSelection(pos,pos); + sci -> Paste(); + + cb -> setSelectionMode(FALSE); + } + + break; + } + + default: + break; + } +} + + +// Handle a context menu event. +void QextScintillaBase::contextMenu(QContextMenuEvent *cme) +{ + QApplication::sendEvent(this,cme); + + if (!cme -> isConsumed()) + sci -> ContextMenu(Point(cme -> globalX(),cme -> globalY())); +} + + +// Handle a mouse button releases. +void QextScintillaBase::mouseRelease(QMouseEvent *me) +{ + if (sci -> HaveMouseCapture() && me -> button() == LeftButton) + { + bool ctrl = me -> state() & ControlButton; + + sci -> ButtonUp(Point(me -> x(),me -> y()),0,ctrl); + } +} + + +// Handle a mouse move. +void QextScintillaBase::mouseMove(QMouseEvent *me) +{ + sci -> ButtonMove(Point(me -> x(),me -> y())); +} + + +// Handle a mouse wheel event. +void QextScintillaBase::mouseWheel(QWheelEvent *we) +{ + setFocus(); + + if (we -> orientation() == Horizontal || we -> state() & ShiftButton) + QApplication::sendEvent(hsb,we); + else if (we -> orientation() == Vertical) + QApplication::sendEvent(vsb,we); +} + + +// Handle a mouse button double click. +void QextScintillaBase::mouseDoubleClick(QMouseEvent *me) +{ + setFocus(); + + if (me -> button() == LeftButton) + { + // Make sure Scintilla will interpret this as a double-click. + unsigned clickTime = sci -> lastClickTime + Platform::DoubleClickTime() - 1; + + bool shift = me -> state() & ShiftButton; + bool ctrl = me -> state() & ControlButton; + bool alt = me -> state() & AltButton; + + sci -> ButtonDown(Point(me -> x(),me -> y()),clickTime,shift,ctrl,alt); + + // Remember the current position and time in case it turns into a + // triple click. + triple_click_at = me -> globalPos(); + triple_click.start(QApplication::doubleClickInterval()); + } +} + + +// Re-implemented to handle key press events. +void QextScintillaBase::keyPressEvent(QKeyEvent *ke) +{ + unsigned key; + + switch (ke -> key()) + { + case Key_Down: + key = SCK_DOWN; + break; + + case Key_Up: + key = SCK_UP; + break; + + case Key_Left: + key = SCK_LEFT; + break; + + case Key_Right: + key = SCK_RIGHT; + break; + + case Key_Home: + key = SCK_HOME; + break; + + case Key_End: + key = SCK_END; + break; + + case Key_Prior: + key = SCK_PRIOR; + break; + + case Key_Next: + key = SCK_NEXT; + break; + + case Key_Delete: + key = SCK_DELETE; + break; + + case Key_Insert: + key = SCK_INSERT; + break; + + case Key_Escape: + key = SCK_ESCAPE; + break; + + case Key_Backspace: + key = SCK_BACK; + break; + + case Key_Tab: + key = SCK_TAB; + break; + + case Key_Return: + case Key_Enter: + key = SCK_RETURN; + break; + + default: + if (sci -> IsUnicodeMode()) + { + // Work out if the original input was a single ASCII + // key. + if (ke -> text().length() == 1) + { + if ((key = ke -> text()[0].unicode()) >= 0x80) + key = 0; + } + else + key = 0; + } + else + { + key = ke -> ascii(); + + if (key >= 0x01 && key <= 0x1f) + key += 0x40; + } + } + + bool consumed = FALSE; + + if (key) + { + bool shift = ke -> state() & ShiftButton; + bool ctrl = ke -> state() & ControlButton; + bool alt = ke -> state() & AltButton; + + // If the character is eventually added by KeyDefault() then + // the return value of KeyDown() will be true, but consumed + // will incorrectly be false. + if (sci -> KeyDown(key,shift,ctrl,alt,&consumed) && !consumed) + consumed = TRUE; + } + else if (sci -> IsUnicodeMode()) + { + if (ke -> text().length() > 0 && !ke -> text()[0].isNull()) + { + QCString s = ke -> text().utf8(); + + sci -> AddCharUTF(s.data(),s.length()); + + consumed = TRUE; + } + } + + if (!consumed) + ke -> ignore(); +} + + +// Re-implemented to make sure tabs are passed to the editor. +bool QextScintillaBase::focusNextPrevChild(bool) +{ + return false; +} + + +// Start a drag and allow this to be re-implemented by an application. +void QextScintillaBase::startDrag() +{ + sci -> StartDragImpl(); +} + + +// Handle the vertical scrollbar. +void QextScintillaBase::handleVSb(int val) +{ + sci -> ScrollTo(val); +} + + +// Handle the horizontal scrollbar. +void QextScintillaBase::handleHSb(int val) +{ + sci -> HorizontalScrollTo(val); +} + + +// Return the current prefered size. +QSize QextScintillaBase::sizeHint() const +{ + int height = sci -> vs.lineHeight * sci -> pdoc -> LinesTotal(); + + if (sci -> horizontalScrollBarVisible) + height += hsb -> sizeHint().height(); + + return QSize(sci -> scrollWidth,height); +} + + +// Handle the selection changing. +void QextScintillaBase::handleSelection() +{ + if (!QApplication::clipboard() -> ownsSelection()) + sci -> UnclaimSelection(); +} diff --git a/qt/qextscintillabase.h b/qt/qextscintillabase.h new file mode 100644 index 0000000..80222e5 --- /dev/null +++ b/qt/qextscintillabase.h @@ -0,0 +1,2413 @@ +// This class defines the "official" low-level API. +// +// Copyright (c) 2006 +// Riverbank Computing Limited +// +// This file is part of QScintilla. +// +// This copy of QScintilla is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2, or (at your option) any +// later version. +// +// QScintilla is supplied 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 +// QScintilla; see the file LICENSE. If not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +#ifndef QEXTSCINTILLABASE_H +#define QEXTSCINTILLABASE_H + + +#include +#include +#include +#include + +#include + + +class ScintillaQt; +class QScrollBar; +class QColor; +class QPainter; +class QPixmap; + + +//! \brief The QextScintillaBase class implements the Scintilla editor widget +//! and its low-level API. +//! +//! Scintilla (http://www.scintilla.org) is a powerful C++ editor class that +//! supports many features including syntax styling, error indicators, code +//! completion and call tips. It is particularly useful as a programmer's +//! editor. +//! +//! QextScintillaBase is a port to Qt of Scintilla. It implements the standard +//! Scintilla API which consists of a number of messages each taking up to +//! two arguments. +//! +//! See QextScintilla for the implementation of a higher level API that is more +//! consistent with the rest of the Qt toolkit. +class QEXTSCINTILLA_EXPORT QextScintillaBase : public QWidget +{ + Q_OBJECT + +public: + //! The low-level Scintilla API is implemented as a set of messages + //! each of which takes up to two parameters (\a wParam and \a lParam) + //! and optionally return a value. This enum defines all the possible + //! messages. + //! + //! \sa SendScintilla() + enum + { + //! + SCI_START = 2000, + + //! + SCI_OPTIONAL_START = 3000, + + //! + SCI_LEXER_START = 4000, + + //! This message appends some text to the end of the document. + //! \a wParam is the length of the text. + //! \a lParam is the text to be appended. + SCI_ADDTEXT = 2001, + + //! + SCI_ADDSTYLEDTEXT = 2002, + + //! + SCI_INSERTTEXT = 2003, + + //! + SCI_CLEARALL = 2004, + + //! + SCI_CLEARDOCUMENTSTYLE = 2005, + + //! + SCI_GETLENGTH = 2006, + + //! + SCI_GETCHARAT = 2007, + + //! This message returns the current position. + //! + //! \sa SCI_SETCURRENTPOS + SCI_GETCURRENTPOS = 2008, + + //! This message returns the anchor. + //! + //! \sa SCI_SETANCHOR + SCI_GETANCHOR = 2009, + + //! + SCI_GETSTYLEAT = 2010, + + //! + SCI_REDO = 2011, + + //! + SCI_SETUNDOCOLLECTION = 2012, + + //! + SCI_SELECTALL = 2013, + + //! This message marks the current state of the text as the + //! the save point. This is usually done when the text is saved + //! or loaded. + //! + //! \sa SCN_SAVEPOINTREACHED(), SCN_SAVEPOINTLEFT() + SCI_SETSAVEPOINT = 2014, + + //! + SCI_GETSTYLEDTEXT = 2015, + + //! + SCI_CANREDO = 2016, + + //! This message returns the line that contains a particular + //! instance of a marker. + //! \a wParam is the handle of the marker. + //! + //! \sa SCI_MARKERADD + SCI_MARKERLINEFROMHANDLE = 2017, + + //! This message removes a particular instance of a marker. + //! \a wParam is the handle of the marker. + //! + //! \sa SCI_MARKERADD + SCI_MARKERDELETEHANDLE = 2018, + + //! + SCI_GETUNDOCOLLECTION = 2019, + + //! + SCI_GETVIEWWS = 2020, + + //! + SCI_SETVIEWWS = 2021, + + //! + SCI_POSITIONFROMPOINT = 2022, + + //! + SCI_POSITIONFROMPOINTCLOSE = 2023, + + //! + SCI_GOTOLINE = 2024, + + //! This message clears the current selection and sets the + //! current position. + //! \a wParam is the new current position. + //! + //! \sa SCI_SETCURRENTPOS + SCI_GOTOPOS = 2025, + + //! This message sets the anchor. + //! \a wParam is the new anchor. + //! + //! \sa SCI_GETANCHOR + SCI_SETANCHOR = 2026, + + //! + SCI_GETCURLINE = 2027, + + //! This message returns the character position of the start of + //! the text that needs to be syntax styled. + //! + //! \sa SCN_STYLENEEDED() + SCI_GETENDSTYLED = 2028, + + //! + SCI_CONVERTEOLS = 2029, + + //! + SCI_GETEOLMODE = 2030, + + //! + SCI_SETEOLMODE = 2031, + + //! + SCI_STARTSTYLING = 2032, + + //! + SCI_SETSTYLING = 2033, + + //! + SCI_GETBUFFEREDDRAW = 2034, + + //! + SCI_SETBUFFEREDDRAW = 2035, + + //! + SCI_SETTABWIDTH = 2036, + + //! + SCI_GETTABWIDTH = 2121, + + //! + SCI_SETCODEPAGE = 2037, + + //! + SCI_SETUSEPALETTE = 2039, + + //! This message sets the symbol used to draw one of 32 + //! markers. Some markers have pre-defined uses, see the + //! SC_MARKNUM_* values. + //! \a wParam is the number of the marker. + //! \a lParam is the marker symbol and is one of the SC_MARK_* + //! values. + //! + //! \sa SCI_MARKERADD, SCI_MARKERDEFINEPIXMAP + SCI_MARKERDEFINE = 2040, + + //! This message sets the foreground colour used to draw a + //! marker. A colour is represented as a 24 bit value. The 8 + //! least significant bits correspond to red, the middle 8 bits + //! correspond to green, and the 8 most significant bits + //! correspond to blue. The default value is 0x000000. + //! \a wParam is the number of the marker. + //! \a lParam is the colour. + //! + //! \sa SCI_MARKERSETBACK + SCI_MARKERSETFORE = 2041, + + //! This message sets the background colour used to draw a + //! marker. A colour is represented as a 24 bit value. The 8 + //! least significant bits correspond to red, the middle 8 bits + //! correspond to green, and the 8 most significant bits + //! correspond to blue. The default value is 0xffffff. + //! \a wParam is the number of the marker. + //! \a lParam is the colour. + //! + //! \sa SCI_MARKERSETFORE + SCI_MARKERSETBACK = 2042, + + //! This message adds a marker to a line. A handle for the + //! marker is returned which can be used to track the marker's + //! position. + //! \a wParam is the line number. + //! \a lParam is the number of the marker. + //! + //! \sa SCI_MARKERDELETE, SCI_MARKERDELETEALL, + //! SCI_MARKERDELETEHANDLE + SCI_MARKERADD = 2043, + + //! This message deletes a marker from a line. + //! \a wParam is the line number. + //! \a lParam is the number of the marker. + //! + //! \sa SCI_MARKERADD, SCI_MARKERDELETEALL + SCI_MARKERDELETE = 2044, + + //! This message deletes all occurences of a marker. + //! \a wParam is the number of the marker. If \a wParam is -1 + //! then all markers are removed. + //! + //! \sa SCI_MARKERADD, SCI_MARKERDELETE + SCI_MARKERDELETEALL = 2045, + + //! This message returns the 32 bit mask of markers at a line. + //! \a wParam is the line number. + SCI_MARKERGET = 2046, + + //! This message looks for the next line to contain at least + //! one marker contained in a 32 bit mask of markers and + //! returns the line number. + //! \a wParam is the line number to start the search from. + //! \a lParam is the mask of markers to search for. + //! + //! \sa SCI_MARKERPREVIOUS + SCI_MARKERNEXT = 2047, + + //! This message looks for the previous line to contain at + //! least one marker contained in a 32 bit mask of markers and + //! returns the line number. + //! \a wParam is the line number to start the search from. + //! \a lParam is the mask of markers to search for. + //! + //! \sa SCI_MARKERNEXT + SCI_MARKERPREVIOUS = 2048, + + //! This message sets the symbol used to draw one of the 32 + //! markers to a pixmap. Pixmaps use the SC_MARK_PIXMAP marker + //! symbol. + //! \a wParam is the number of the marker. + //! \a lParam is a pointer to a QPixmap instance. Note that in + //! other ports of Scintilla this is a pointer to either raw or + //! textual XPM image data. + //! + //! \sa SCI_MARKERDEFINE + SCI_MARKERDEFINEPIXMAP = 2049, + + //! This message sets what can be displayed in a margin. + //! \a wParam is the number of the margin: 0, 1 or 2. + //! \a lParam is the logical or of the SC_MARGIN_* values. + //! + //! \sa SCI_GETMARGINTYPEN + SCI_SETMARGINTYPEN = 2240, + + //! This message returns what can be displayed in a margin. + //! \a wParam is the number of the margin: 0, 1 or 2. + //! + //! \sa SCI_SETMARGINTYPEN + SCI_GETMARGINTYPEN = 2241, + + //! This message sets the width of a margin in pixels. + //! \a wParam is the number of the margin: 0, 1 or 2. + //! \a lParam is the new margin width. + //! + //! \sa SCI_GETMARGINWIDTHN + SCI_SETMARGINWIDTHN = 2242, + + //! This message returns the width of a margin in pixels. + //! \a wParam is the number of the margin: 0, 1 or 2. + //! + //! \sa SCI_SETMARGINWIDTHN + SCI_GETMARGINWIDTHN = 2243, + + //! This message sets the mask of a margin. The mask is a 32 + //! value with one bit for each possible marker. If a bit is + //! set then the corresponding marker is displayed. By + //! default, all markers are displayed. + //! \a wParam is the number of the margin: 0, 1 or 2. + //! \a lParam is the new margin mask. + //! + //! \sa SCI_GETMARGINMASKN, SCI_MARKERDEFINE + SCI_SETMARGINMASKN = 2244, + + //! This message returns the mask of a margin. + //! \a wParam is the number of the margin: 0, 1 or 2. + //! + //! \sa SCI_SETMARGINMASKN + SCI_GETMARGINMASKN = 2245, + + //! This message sets the sensitivity of a margin to mouse + //! clicks. + //! \a wParam is the number of the margin: 0, 1 or 2. + //! \a lParam is non-zero to make the margin sensitive to mouse + //! clicks. When the mouse is clicked the SCN_MARGINCLICK() + //! signal is emitted. + //! + //! \sa SCI_GETMARGINSENSITIVEN, SCN_MARGINCLICK() + SCI_SETMARGINSENSITIVEN = 2246, + + //! This message returns the sensitivity of a margin to mouse + //! clicks. + //! \a wParam is the number of the margin: 0, 1 or 2. + //! + //! \sa SCI_SETMARGINSENSITIVEN, SCN_MARGINCLICK() + SCI_GETMARGINSENSITIVEN = 2247, + + //! + SCI_STYLECLEARALL = 2050, + + //! + SCI_STYLESETFORE = 2051, + + //! + SCI_STYLESETBACK = 2052, + + //! + SCI_STYLESETBOLD = 2053, + + //! + SCI_STYLESETITALIC = 2054, + + //! + SCI_STYLESETSIZE = 2055, + + //! + SCI_STYLESETFONT = 2056, + + //! + SCI_STYLESETEOLFILLED = 2057, + + //! + SCI_STYLERESETDEFAULT = 2058, + + //! + SCI_STYLESETUNDERLINE = 2059, + + //! + SCI_STYLESETCASE = 2060, + + //! + SCI_STYLESETCHARACTERSET = 2066, + + //! + SCI_SETSELFORE = 2067, + + //! + SCI_SETSELBACK = 2068, + + //! + SCI_SETCARETFORE = 2069, + + //! + SCI_ASSIGNCMDKEY = 2070, + + //! + SCI_CLEARCMDKEY = 2071, + + //! + SCI_CLEARALLCMDKEYS = 2072, + + //! + SCI_SETSTYLINGEX = 2073, + + //! + SCI_STYLESETVISIBLE = 2074, + + //! + SCI_GETCARETPERIOD = 2075, + + //! + SCI_SETCARETPERIOD = 2076, + + //! + SCI_SETWORDCHARS = 2077, + + //! + SCI_BEGINUNDOACTION = 2078, + + //! + SCI_ENDUNDOACTION = 2079, + + //! + SCI_INDICSETSTYLE = 2080, + + //! + SCI_INDICGETSTYLE = 2081, + + //! + SCI_INDICSETFORE = 2082, + + //! + SCI_INDICGETFORE = 2083, + + //! + SCI_SETWHITESPACEFORE = 2084, + + //! + SCI_SETWHITESPACEBACK = 2085, + + //! + SCI_SETSTYLEBITS = 2090, + + //! + SCI_GETSTYLEBITS = 2091, + + //! + SCI_SETLINESTATE = 2092, + + //! + SCI_GETLINESTATE = 2093, + + //! + SCI_GETMAXLINESTATE = 2094, + + //! + SCI_GETCARETLINEVISIBLE = 2095, + + //! + SCI_SETCARETLINEVISIBLE = 2096, + + //! + SCI_GETCARETLINEBACK = 2097, + + //! + SCI_SETCARETLINEBACK = 2098, + + //! + SCI_STYLESETCHANGEABLE = 2099, + + //! + SCI_AUTOCSHOW = 2100, + + //! + SCI_AUTOCCANCEL = 2101, + + //! + SCI_AUTOCACTIVE = 2102, + + //! + SCI_AUTOCPOSSTART = 2103, + + //! + SCI_AUTOCCOMPLETE = 2104, + + //! + SCI_AUTOCSTOPS = 2105, + + //! + SCI_AUTOCSETSEPARATOR = 2106, + + //! + SCI_AUTOCGETSEPARATOR = 2107, + + //! + SCI_AUTOCSELECT = 2108, + + //! + SCI_AUTOCSETCANCELATSTART = 2110, + + //! + SCI_AUTOCGETCANCELATSTART = 2111, + + //! + SCI_AUTOCSETFILLUPS = 2112, + + //! + SCI_AUTOCSETCHOOSESINGLE = 2113, + + //! + SCI_AUTOCGETCHOOSESINGLE = 2114, + + //! + SCI_AUTOCSETIGNORECASE = 2115, + + //! + SCI_AUTOCGETIGNORECASE = 2116, + + //! + SCI_USERLISTSHOW = 2117, + + //! + SCI_AUTOCSETAUTOHIDE = 2118, + + //! + SCI_AUTOCGETAUTOHIDE = 2119, + + //! + SCI_AUTOCSETDROPRESTOFWORD = 2270, + + //! + SCI_AUTOCGETDROPRESTOFWORD = 2271, + + //! + SCI_SETINDENT = 2122, + + //! + SCI_GETINDENT = 2123, + + //! + SCI_SETUSETABS = 2124, + + //! + SCI_GETUSETABS = 2125, + + //! + SCI_SETLINEINDENTATION = 2126, + + //! + SCI_GETLINEINDENTATION = 2127, + + //! + SCI_GETLINEINDENTPOSITION = 2128, + + //! + SCI_GETCOLUMN = 2129, + + //! + SCI_SETHSCROLLBAR = 2130, + + //! + SCI_GETHSCROLLBAR = 2131, + + //! + SCI_SETINDENTATIONGUIDES = 2132, + + //! + SCI_GETINDENTATIONGUIDES = 2133, + + //! + SCI_SETHIGHLIGHTGUIDE = 2134, + + //! + SCI_GETHIGHLIGHTGUIDE = 2135, + + //! + SCI_GETLINEENDPOSITION = 2136, + + //! + SCI_GETCODEPAGE = 2137, + + //! + SCI_GETCARETFORE = 2138, + + //! + SCI_GETUSEPALETTE = 2139, + + //! This message returns a non-zero value if the document is + //! read-only. + //! + //! \sa SCI_SETREADONLY + SCI_GETREADONLY = 2140, + + //! This message sets the current position. + //! \a wParam is the new current position. + //! + //! \sa SCI_GETCURRENTPOS + SCI_SETCURRENTPOS = 2141, + + //! + SCI_SETSELECTIONSTART = 2142, + + //! + SCI_GETSELECTIONSTART = 2143, + + //! + SCI_SETSELECTIONEND = 2144, + + //! + SCI_GETSELECTIONEND = 2145, + + //! + SCI_SETPRINTMAGNIFICATION = 2146, + + //! + SCI_GETPRINTMAGNIFICATION = 2147, + + //! + SCI_SETPRINTCOLOURMODE = 2148, + + //! + SCI_GETPRINTCOLOURMODE = 2149, + + //! + SCI_FINDTEXT = 2150, + + //! + SCI_FORMATRANGE = 2151, + + //! + SCI_GETFIRSTVISIBLELINE = 2152, + + //! + SCI_GETLINE = 2153, + + //! + SCI_GETLINECOUNT = 2154, + + //! + SCI_SETMARGINLEFT = 2155, + + //! + SCI_GETMARGINLEFT = 2156, + + //! + SCI_SETMARGINRIGHT = 2157, + + //! + SCI_GETMARGINRIGHT = 2158, + + //! This message returns a non-zero value if the document has + //! been modified. + SCI_GETMODIFY = 2159, + + //! + SCI_SETSEL = 2160, + + //! + SCI_GETSELTEXT = 2161, + + //! + SCI_GETTEXTRANGE = 2162, + + //! + SCI_HIDESELECTION = 2163, + + //! + SCI_POINTXFROMPOSITION = 2164, + + //! + SCI_POINTYFROMPOSITION = 2165, + + //! + SCI_LINEFROMPOSITION = 2166, + + //! + SCI_POSITIONFROMLINE = 2167, + + //! + SCI_LINESCROLL = 2168, + + //! + SCI_SCROLLCARET = 2169, + + //! + SCI_REPLACESEL = 2170, + + //! This message sets the read-only state of the document. + //! \a wParam is the new read-only state of the document. + //! + //! \sa SCI_GETREADONLY + SCI_SETREADONLY = 2171, + + //! + SCI_NULL = 2172, + + //! + SCI_CANPASTE = 2173, + + //! + SCI_CANUNDO = 2174, + + //! This message empties the undo buffer. + SCI_EMPTYUNDOBUFFER = 2175, + + //! + SCI_UNDO = 2176, + + //! + SCI_CUT = 2177, + + //! + SCI_COPY = 2178, + + //! + SCI_PASTE = 2179, + + //! + SCI_CLEAR = 2180, + + //! This message sets the text of the document. + //! \a wParam is unused. + //! \a lParam is the new text of the document. + //! + //! \sa SCI_GETTEXT + SCI_SETTEXT = 2181, + + //! This message gets the text of the document. + //! \a wParam is size of the buffer that the text is copied to. + //! \a lParam is the address of the buffer that the text is + //! copied to. + //! + //! \sa SCI_SETTEXT + SCI_GETTEXT = 2182, + + //! This message returns the length of the document. + SCI_GETTEXTLENGTH = 2183, + + //! + SCI_GETDIRECTFUNCTION = 2184, + + //! + SCI_GETDIRECTPOINTER = 2185, + + //! + SCI_SETOVERTYPE = 2186, + + //! + SCI_GETOVERTYPE = 2187, + + //! + SCI_SETCARETWIDTH = 2188, + + //! + SCI_GETCARETWIDTH = 2189, + + //! + SCI_SETTARGETSTART = 2190, + + //! + SCI_GETTARGETSTART = 2191, + + //! + SCI_SETTARGETEND = 2192, + + //! + SCI_GETTARGETEND = 2193, + + //! + SCI_REPLACETARGET = 2194, + + //! + SCI_REPLACETARGETRE = 2195, + + //! + SCI_SEARCHINTARGET = 2197, + + //! + SCI_SETSEARCHFLAGS = 2198, + + //! + SCI_GETSEARCHFLAGS = 2199, + + //! + SCI_CALLTIPSHOW = 2200, + + //! + SCI_CALLTIPCANCEL = 2201, + + //! + SCI_CALLTIPACTIVE = 2202, + + //! + SCI_CALLTIPPOSSTART = 2203, + + //! + SCI_CALLTIPSETHLT = 2204, + + //! + SCI_CALLTIPSETBACK = 2205, + + //! + SCI_CALLTIPSETFORE = 2206, + + //! + SCI_CALLTIPSETFOREHLT = 2207, + + //! + SCI_AUTOCSETMAXWIDTH = 2208, + + //! + SCI_AUTOCGETMAXWIDTH = 2209, + + //! + SCI_AUTOCSETMAXHEIGHT = 2210, + + //! + SCI_AUTOCGETMAXHEIGHT = 2211, + + //! + SCI_CALLTIPUSESTYLE = 2212, + + //! + SCI_VISIBLEFROMDOCLINE = 2220, + + //! + SCI_DOCLINEFROMVISIBLE = 2221, + + //! + SCI_SETFOLDLEVEL = 2222, + + //! + SCI_GETFOLDLEVEL = 2223, + + //! + SCI_GETLASTCHILD = 2224, + + //! + SCI_GETFOLDPARENT = 2225, + + //! + SCI_SHOWLINES = 2226, + + //! + SCI_HIDELINES = 2227, + + //! + SCI_GETLINEVISIBLE = 2228, + + //! + SCI_SETFOLDEXPANDED = 2229, + + //! + SCI_GETFOLDEXPANDED = 2230, + + //! + SCI_TOGGLEFOLD = 2231, + + //! + SCI_ENSUREVISIBLE = 2232, + + //! + SCI_SETFOLDFLAGS = 2233, + + //! + SCI_ENSUREVISIBLEENFORCEPOLICY = 2234, + + //! + SCI_WRAPCOUNT = 2235, + + //! + SCI_SETTABINDENTS = 2260, + + //! + SCI_GETTABINDENTS = 2261, + + //! + SCI_SETBACKSPACEUNINDENTS = 2262, + + //! + SCI_GETBACKSPACEUNINDENTS = 2263, + + //! + SCI_SETMOUSEDWELLTIME = 2264, + + //! + SCI_GETMOUSEDWELLTIME = 2265, + + //! + SCI_WORDSTARTPOSITION = 2266, + + //! + SCI_WORDENDPOSITION = 2267, + + //! + SCI_SETWRAPMODE = 2268, + + //! + SCI_GETWRAPMODE = 2269, + + //! + SCI_SETLAYOUTCACHE = 2272, + + //! + SCI_GETLAYOUTCACHE = 2273, + + //! + SCI_SETSCROLLWIDTH = 2274, + + //! + SCI_GETSCROLLWIDTH = 2275, + + //! This message returns the width of some text when rendered + //! in a particular style. + //! \a wParam is the style number and is one of the STYLE_* + //! values or one of the styles defined by a lexer. + //! \a lParam is a pointer to the text. + SCI_TEXTWIDTH = 2276, + + //! + SCI_SETENDATLASTLINE = 2277, + + //! + SCI_GETENDATLASTLINE = 2278, + + //! + SCI_TEXTHEIGHT = 2279, + + //! + SCI_SETVSCROLLBAR = 2280, + + //! + SCI_GETVSCROLLBAR = 2281, + + //! + SCI_APPENDTEXT = 2282, + + //! + SCI_GETTWOPHASEDRAW = 2283, + + //! + SCI_SETTWOPHASEDRAW = 2284, + + //! + SCI_AUTOCGETTYPESEPARATOR = 2285, + + //! + SCI_AUTOCSETTYPESEPARATOR = 2286, + + //! + SCI_TARGETFROMSELECTION = 2287, + + //! + SCI_LINESJOIN = 2288, + + //! + SCI_LINESSPLIT = 2289, + + //! + SCI_SETFOLDMARGINCOLOUR = 2290, + + //! + SCI_SETFOLDMARGINHICOLOUR = 2291, + + //! + SCI_LINEDOWN = 2300, + + //! + SCI_LINEDOWNEXTEND = 2301, + + //! + SCI_LINEUP = 2302, + + //! + SCI_LINEUPEXTEND = 2303, + + //! + SCI_CHARLEFT = 2304, + + //! + SCI_CHARLEFTEXTEND = 2305, + + //! + SCI_CHARRIGHT = 2306, + + //! + SCI_CHARRIGHTEXTEND = 2307, + + //! + SCI_WORDLEFT = 2308, + + //! + SCI_WORDLEFTEXTEND = 2309, + + //! + SCI_WORDRIGHT = 2310, + + //! + SCI_WORDRIGHTEXTEND = 2311, + + //! + SCI_HOME = 2312, + + //! + SCI_HOMEEXTEND = 2313, + + //! + SCI_LINEEND = 2314, + + //! + SCI_LINEENDEXTEND = 2315, + + //! + SCI_DOCUMENTSTART = 2316, + + //! + SCI_DOCUMENTSTARTEXTEND = 2317, + + //! + SCI_DOCUMENTEND = 2318, + + //! + SCI_DOCUMENTENDEXTEND = 2319, + + //! + SCI_PAGEUP = 2320, + + //! + SCI_PAGEUPEXTEND = 2321, + + //! + SCI_PAGEDOWN = 2322, + + //! + SCI_PAGEDOWNEXTEND = 2323, + + //! + SCI_EDITTOGGLEOVERTYPE = 2324, + + //! + SCI_CANCEL = 2325, + + //! + SCI_DELETEBACK = 2326, + + //! + SCI_TAB = 2327, + + //! + SCI_BACKTAB = 2328, + + //! + SCI_NEWLINE = 2329, + + //! + SCI_FORMFEED = 2330, + + //! + SCI_VCHOME = 2331, + + //! + SCI_VCHOMEEXTEND = 2332, + + //! + SCI_ZOOMIN = 2333, + + //! + SCI_ZOOMOUT = 2334, + + //! + SCI_DELWORDLEFT = 2335, + + //! + SCI_DELWORDRIGHT = 2336, + + //! + SCI_LINECUT = 2337, + + //! + SCI_LINEDELETE = 2338, + + //! + SCI_LINETRANSPOSE = 2339, + + //! + SCI_LOWERCASE = 2340, + + //! + SCI_UPPERCASE = 2341, + + //! + SCI_LINESCROLLDOWN = 2342, + + //! + SCI_LINESCROLLUP = 2343, + + //! + SCI_DELETEBACKNOTLINE = 2344, + + //! + SCI_HOMEDISPLAY = 2345, + + //! + SCI_HOMEDISPLAYEXTEND = 2346, + + //! + SCI_LINEENDDISPLAY = 2347, + + //! + SCI_LINEENDDISPLAYEXTEND = 2348, + + //! + SCI_MOVECARETINSIDEVIEW = 2401, + + //! + SCI_LINELENGTH = 2350, + + //! + SCI_BRACEHIGHLIGHT = 2351, + + //! + SCI_BRACEBADLIGHT = 2352, + + //! + SCI_BRACEMATCH = 2353, + + //! + SCI_GETVIEWEOL = 2355, + + //! + SCI_SETVIEWEOL = 2356, + + //! + SCI_GETDOCPOINTER = 2357, + + //! + SCI_SETDOCPOINTER = 2358, + + //! + SCI_SETMODEVENTMASK = 2359, + + //! + SCI_GETEDGECOLUMN = 2360, + + //! + SCI_SETEDGECOLUMN = 2361, + + //! + SCI_GETEDGEMODE = 2362, + + //! + SCI_SETEDGEMODE = 2363, + + //! + SCI_GETEDGECOLOUR = 2364, + + //! + SCI_SETEDGECOLOUR = 2365, + + //! + SCI_SEARCHANCHOR = 2366, + + //! + SCI_SEARCHNEXT = 2367, + + //! + SCI_SEARCHPREV = 2368, + + //! + SCI_LINESONSCREEN = 2370, + + //! + SCI_USEPOPUP = 2371, + + //! + SCI_SELECTIONISRECTANGLE = 2372, + + //! + SCI_SETZOOM = 2373, + + //! + SCI_GETZOOM = 2374, + + //! + SCI_CREATEDOCUMENT = 2375, + + //! + SCI_ADDREFDOCUMENT = 2376, + + //! + SCI_RELEASEDOCUMENT = 2377, + + //! + SCI_GETMODEVENTMASK = 2378, + + //! + SCI_SETFOCUS = 2380, + + //! + SCI_GETFOCUS = 2381, + + //! + SCI_SETSTATUS = 2382, + + //! + SCI_GETSTATUS = 2383, + + //! + SCI_SETMOUSEDOWNCAPTURES = 2384, + + //! + SCI_GETMOUSEDOWNCAPTURES = 2385, + + //! + SCI_SETCURSOR = 2386, + + //! + SCI_GETCURSOR = 2387, + + //! + SCI_SETCONTROLCHARSYMBOL = 2388, + + //! + SCI_GETCONTROLCHARSYMBOL = 2389, + + //! + SCI_WORDPARTLEFT = 2390, + + //! + SCI_WORDPARTLEFTEXTEND = 2391, + + //! + SCI_WORDPARTRIGHT = 2392, + + //! + SCI_WORDPARTRIGHTEXTEND = 2393, + + //! + SCI_SETVISIBLEPOLICY = 2394, + + //! + SCI_DELLINELEFT = 2395, + + //! + SCI_DELLINERIGHT = 2396, + + //! + SCI_SETXOFFSET = 2397, + + //! + SCI_GETXOFFSET = 2398, + + //! + SCI_CHOOSECARETX = 2399, + + //! + SCI_GRABFOCUS = 2400, + + //! + SCI_SETXCARETPOLICY = 2402, + + //! + SCI_SETYCARETPOLICY = 2403, + + //! + SCI_LINEDUPLICATE = 2404, + + //! This message takes a copy of an image and registers it so + //! that it can be refered to by a unique integer identifier. + //! \a wParam is the image's identifier. + //! \a lParam is a pointer to a QPixmap instance. Note that in + //! other ports of Scintilla this is a pointer to either raw or + //! textual XPM image data. + //! + //! \sa SCI_CLEARREGISTEREDIMAGES + SCI_REGISTERIMAGE = 2405, + + //! + SCI_SETPRINTWRAPMODE = 2406, + + //! + SCI_GETPRINTWRAPMODE = 2407, + + //! This message de-registers all currently registered images. + //! + //! \sa SCI_REGISTERIMAGE + SCI_CLEARREGISTEREDIMAGES = 2408, + + //! + SCI_STYLESETHOTSPOT = 2409, + + //! + SCI_SETHOTSPOTACTIVEFORE = 2410, + + //! + SCI_SETHOTSPOTACTIVEBACK = 2411, + + //! + SCI_SETHOTSPOTACTIVEUNDERLINE = 2412, + + //! + SCI_PARADOWN = 2413, + + //! + SCI_PARADOWNEXTEND = 2414, + + //! + SCI_PARAUP = 2415, + + //! + SCI_PARAUPEXTEND = 2416, + + //! + SCI_POSITIONBEFORE = 2417, + + //! + SCI_POSITIONAFTER = 2418, + + //! + SCI_COPYRANGE = 2419, + + //! + SCI_COPYTEXT = 2420, + + //! + SCI_SETSELECTIONMODE = 2422, + + //! + SCI_GETSELECTIONMODE = 2423, + + //! + SCI_GETLINESELSTARTPOSITION = 2424, + + //! + SCI_GETLINESELENDPOSITION = 2425, + + //! + SCI_LINEDOWNRECTEXTEND = 2426, + + //! + SCI_LINEUPRECTEXTEND = 2427, + + //! + SCI_CHARLEFTRECTEXTEND = 2428, + + //! + SCI_CHARRIGHTRECTEXTEND = 2429, + + //! + SCI_HOMERECTEXTEND = 2430, + + //! + SCI_VCHOMERECTEXTEND = 2431, + + //! + SCI_LINEENDRECTEXTEND = 2432, + + //! + SCI_PAGEUPRECTEXTEND = 2433, + + //! + SCI_PAGEDOWNRECTEXTEND = 2434, + + //! + SCI_STUTTEREDPAGEUP = 2435, + + //! + SCI_STUTTEREDPAGEUPEXTEND = 2436, + + //! + SCI_STUTTEREDPAGEDOWN = 2437, + + //! + SCI_STUTTEREDPAGEDOWNEXTEND = 2438, + + //! + SCI_WORDLEFTEND = 2439, + + //! + SCI_WORDLEFTENDEXTEND = 2440, + + //! + SCI_WORDRIGHTEND = 2441, + + //! + SCI_WORDRIGHTENDEXTEND = 2442, + + //! + SCI_SETWHITESPACECHARS = 2443, + + //! + SCI_SETCHARSDEFAULT = 2444, + + //! + SCI_AUTOCGETCURRENT = 2445, + + //! + SCI_ALLOCATE = 2446, + + //! + SCI_HOMEWRAP = 2349, + + //! + SCI_HOMEWRAPEXTEND = 2450, + + //! + SCI_LINEENDWRAP = 2451, + + //! + SCI_LINEENDWRAPEXTEND = 2452, + + //! + SCI_VCHOMEWRAP = 2453, + + //! + SCI_VCHOMEWRAPEXTEND = 2454, + + //! + SCI_LINECOPY = 2455, + + //! + SCI_FINDCOLUMN = 2456, + + //! + SCI_GETCARETSTICKY = 2457, + + //! + SCI_SETCARETSTICKY = 2458, + + //! + SCI_TOGGLECARETSTICKY = 2459, + + //! + SCI_SETWRAPVISUALFLAGS = 2460, + + //! + SCI_GETWRAPVISUALFLAGS = 2461, + + //! + SCI_SETWRAPVISUALFLAGSLOCATION = 2462, + + //! + SCI_GETWRAPVISUALFLAGSLOCATION = 2463, + + //! + SCI_SETWRAPSTARTINDENT = 2464, + + //! + SCI_GETWRAPSTARTINDENT = 2465, + + //! + SCI_MARKERADDSET = 2466, + + //! + SCI_SETPASTECONVERTENDINGS = 2467, + + //! + SCI_GETPASTECONVERTENDINGS = 2468, + + //! + SCI_SELECTIONDUPLICATE = 2469, + + //! + SCI_SETCARETLINEBACKALPHA = 2470, + + //! + SCI_GETCARETLINEBACKALPHA = 2471, + + //! + SCI_MARKERSETALPHA = 2476, + + //! + SCI_GETSELALPHA = 2477, + + //! + SCI_SETSELALPHA = 2478, + + //! + SCI_STARTRECORD = 3001, + + //! + SCI_STOPRECORD = 3002, + + //! This message sets the number of the lexer to use for syntax + //! styling. + //! \a wParam is the number of the lexer and is one of the + //! SCLEX_* values. + SCI_SETLEXER = 4001, + + //! This message returns the number of the lexer being used for + //! syntax styling. + SCI_GETLEXER = 4002, + + //! + SCI_COLOURISE = 4003, + + //! + SCI_SETPROPERTY = 4004, + + //! + SCI_SETKEYWORDS = 4005, + + //! This message sets the name of the lexer to use for syntax + //! styling. + //! \a wParam is unused. + //! \a lParam is the name of the lexer. + SCI_SETLEXERLANGUAGE = 4006, + + //! + SCI_LOADLEXERLIBRARY = 4007, + + //! + SCI_GETPROPERTY = 4008, + + //! + SCI_GETPROPERTYEXPANDED = 4009, + + //! + SCI_GETPROPERTYINT = 4010, + + //! + SCI_GETSTYLEBITSNEEDED = 4011 + }; + + enum + { + SC_ALPHA_TRANSPARENT = 0, + SC_ALPHA_OPAQUE = 255, + SC_ALPHA_NOALPHA = 256 + }; + + enum + { + SC_WRAPVISUALFLAG_NONE = 0x0000, + SC_WRAPVISUALFLAG_END = 0x0001, + SC_WRAPVISUALFLAG_START = 0x0002 + }; + + enum + { + SC_WRAPVISUALFLAGLOC_DEFAULT = 0x0000, + SC_WRAPVISUALFLAGLOC_END_BY_TEXT = 0x0001, + SC_WRAPVISUALFLAGLOC_START_BY_TEXT = 0x0002 + }; + + //! This enum defines the different selection modes. + //! + //! \sa SCI_GETSELECTIONMODE, SCI_SETSELECTIONMODE + enum + { + SC_SEL_STREAM = 0, + SC_SEL_RECTANGLE = 1, + SC_SEL_LINES = 2 + }; + + enum + { + SCWS_INVISIBLE = 0, + SCWS_VISIBLEALWAYS = 1, + SCWS_VISIBLEAFTERINDENT = 2 + }; + + enum + { + SC_EOL_CRLF = 0, + SC_EOL_CR = 1, + SC_EOL_LF = 2 + }; + + enum + { + SC_CP_DBCS = 1, + SC_CP_UTF8 = 65001 + }; + + //! This enum defines the different marker symbols. + //! + //! \sa SCI_MARKERDEFINE + enum + { + //! A circle. + SC_MARK_CIRCLE = 0, + + //! A rectangle. + SC_MARK_ROUNDRECT = 1, + + //! A triangle pointing to the right. + SC_MARK_ARROW = 2, + + //! A smaller rectangle. + SC_MARK_SMALLRECT = 3, + + //! An arrow pointing to the right. + SC_MARK_SHORTARROW = 4, + + //! An invisible marker that allows code to track the movement + //! of lines. + SC_MARK_EMPTY = 5, + + //! A triangle pointing down. + SC_MARK_ARROWDOWN = 6, + + //! A drawn minus sign. + SC_MARK_MINUS = 7, + + //! A drawn plus sign. + SC_MARK_PLUS = 8, + + //! A vertical line drawn in the background colour. + SC_MARK_VLINE = 9, + + //! A bottom left corner drawn in the background colour. + SC_MARK_LCORNER = 10, + + //! A vertical line with a centre right horizontal line drawn + //! in the background colour. + SC_MARK_TCORNER = 11, + + //! A drawn plus sign in a box. + SC_MARK_BOXPLUS = 12, + + //! A drawn plus sign in a connected box. + SC_MARK_BOXPLUSCONNECTED = 13, + + //! A drawn minus sign in a box. + SC_MARK_BOXMINUS = 14, + + //! A drawn minus sign in a connected box. + SC_MARK_BOXMINUSCONNECTED = 15, + + //! A rounded bottom left corner drawn in the background + //! colour. + SC_MARK_LCORNERCURVE = 16, + + //! A vertical line with a centre right curved line drawn in + //! the background colour. + SC_MARK_TCORNERCURVE = 17, + + //! A drawn plus sign in a circle. + SC_MARK_CIRCLEPLUS = 18, + + //! A drawn plus sign in a connected box. + SC_MARK_CIRCLEPLUSCONNECTED = 19, + + //! A drawn minus sign in a circle. + SC_MARK_CIRCLEMINUS = 20, + + //! A drawn minus sign in a connected circle. + SC_MARK_CIRCLEMINUSCONNECTED = 21, + + //! No symbol is drawn but the line of text is drawn with the + //! same background colour. + SC_MARK_BACKGROUND = 22, + + //! Three drawn dots. + SC_MARK_DOTDOTDOT = 23, + + //! Three drawn arrows pointing right. + SC_MARK_ARROWS = 24, + + //! An XPM format pixmap. + SC_MARK_PIXMAP = 25, + + //! A full rectangle. + SC_MARK_FULLRECT = 26, + + //! Characters can be used as symbols by adding this to the + //! ASCII value of the character. + SC_MARK_CHARACTER = 10000 + }; + + enum + { + SC_MARKNUM_FOLDEREND = 25, + SC_MARKNUM_FOLDEROPENMID = 26, + SC_MARKNUM_FOLDERMIDTAIL = 27, + SC_MARKNUM_FOLDERTAIL = 28, + SC_MARKNUM_FOLDERSUB = 29, + SC_MARKNUM_FOLDER = 30, + SC_MARKNUM_FOLDEROPEN = 31, + SC_MASK_FOLDERS = 0xfe000000 + }; + + //! This enum defines what can be displayed in a margin. + //! + //! \sa SCI_GETMARGINTYPEN, SCI_SETMARGINTYPEN + enum + { + //! The margin can display symbols. Note that all margins can + //! display symbols. + SC_MARGIN_SYMBOL = 0, + + //! The margin will display line numbers. + SC_MARGIN_NUMBER = 1, + + //! The margin's background color will be set to the default + //! background color. + SC_MARGIN_BACK = 2, + + //! The margin's background color will be set to the default + //! foreground color. + SC_MARGIN_FORE = 3 + }; + + enum + { + STYLE_DEFAULT = 32, + STYLE_LINENUMBER = 33, + STYLE_BRACELIGHT = 34, + STYLE_BRACEBAD = 35, + STYLE_CONTROLCHAR = 36, + STYLE_INDENTGUIDE = 37, + STYLE_CALLTIP = 38, + STYLE_LASTPREDEFINED = 39, + STYLE_MAX = 127 + }; + + enum + { + SC_CHARSET_ANSI = 0, + SC_CHARSET_DEFAULT = 1, + SC_CHARSET_BALTIC = 186, + SC_CHARSET_CHINESEBIG5 = 136, + SC_CHARSET_EASTEUROPE = 238, + SC_CHARSET_GB2312 = 134, + SC_CHARSET_GREEK = 161, + SC_CHARSET_HANGUL = 129, + SC_CHARSET_MAC = 77, + SC_CHARSET_OEM = 255, + SC_CHARSET_RUSSIAN = 204, + SC_CHARSET_SHIFTJIS = 128, + SC_CHARSET_SYMBOL = 2, + SC_CHARSET_TURKISH = 162, + SC_CHARSET_JOHAB = 130, + SC_CHARSET_HEBREW = 177, + SC_CHARSET_ARABIC = 178, + SC_CHARSET_VIETNAMESE = 163, + SC_CHARSET_THAI = 222, + SC_CHARSET_8859_15 = 1000 + }; + + enum + { + SC_CASE_MIXED = 0, + SC_CASE_UPPER = 1, + SC_CASE_LOWER = 2 + }; + + enum + { + INDIC_MAX = 7, + INDIC_PLAIN = 0, + INDIC_SQUIGGLE = 1, + INDIC_TT = 2, + INDIC_DIAGONAL = 3, + INDIC_STRIKE = 4, + INDIC_HIDDEN = 5, + INDIC_BOX = 6, + INDIC_ROUNDBOX = 7, + INDIC0_MASK = 0x20, + INDIC1_MASK = 0x40, + INDIC2_MASK = 0x80, + INDICS_MASK = 0xe0 + }; + + enum + { + SC_PRINT_NORMAL = 0, + SC_PRINT_INVERTLIGHT = 1, + SC_PRINT_BLACKONWHITE = 2, + SC_PRINT_COLOURONWHITE = 3, + SC_PRINT_COLOURONWHITEDEFAULTBG = 4 + }; + + enum + { + SCFIND_WHOLEWORD = 2, + SCFIND_MATCHCASE = 4, + SCFIND_WORDSTART = 0x00100000, + SCFIND_REGEXP = 0x00200000, + SCFIND_POSIX = 0x00400000 + }; + + enum + { + SC_FOLDLEVELBASE = 0x00400, + SC_FOLDLEVELWHITEFLAG = 0x01000, + SC_FOLDLEVELHEADERFLAG = 0x02000, + SC_FOLDLEVELBOXHEADERFLAG = 0x04000, + SC_FOLDLEVELBOXFOOTERFLAG = 0x08000, + SC_FOLDLEVELCONTRACTED = 0x10000, + SC_FOLDLEVELUNINDENT = 0x20000, + SC_FOLDLEVELNUMBERMASK = 0x00fff + }; + + enum + { + SC_FOLDFLAG_BOX = 0x0001, + SC_FOLDFLAG_LINEBEFORE_EXPANDED = 0x0002, + SC_FOLDFLAG_LINEBEFORE_CONTRACTED = 0x0004, + SC_FOLDFLAG_LINEAFTER_EXPANDED = 0x0008, + SC_FOLDFLAG_LINEAFTER_CONTRACTED = 0x0010, + SC_FOLDFLAG_LEVELNUMBERS = 0x0040 + }; + + enum + { + SC_TIME_FOREVER = 10000000 + }; + + enum + { + SC_WRAP_NONE = 0, + SC_WRAP_WORD = 1, + SC_WRAP_CHAR = 2 + }; + + enum + { + SC_CACHE_NONE = 0, + SC_CACHE_CARET = 1, + SC_CACHE_PAGE = 2, + SC_CACHE_DOCUMENT = 3 + }; + + enum + { + EDGE_NONE = 0, + EDGE_LINE = 1, + EDGE_BACKGROUND = 2 + }; + + enum + { + SC_CURSORNORMAL = -1, + SC_CURSORWAIT = 4 + }; + + enum + { + VISIBLE_SLOP = 0x01, + VISIBLE_STRICT = 0x04 + }; + + enum + { + CARET_SLOP = 0x01, + CARET_STRICT = 0x04, + CARET_JUMPS = 0x10, + CARET_EVEN = 0x08 + }; + + enum + { + SC_MOD_INSERTTEXT = 0x1, + SC_MOD_DELETETEXT = 0x2, + SC_MOD_CHANGESTYLE = 0x4, + SC_MOD_CHANGEFOLD = 0x8, + SC_PERFORMED_USER = 0x10, + SC_PERFORMED_UNDO = 0x20, + SC_PERFORMED_REDO = 0x40, + SC_MULTISTEPUNDOREDO = 0x80, + SC_LASTSTEPINUNDOREDO = 0x100, + SC_MOD_CHANGEMARKER = 0x200, + SC_MOD_BEFOREINSERT = 0x400, + SC_MOD_BEFOREDELETE = 0x800, + SC_MULTILINEUNDOREDO = 0x1000, + SC_MODEVENTMASKALL = 0x1fff + }; + + enum + { + SCK_DOWN = 300, + SCK_UP = 301, + SCK_LEFT = 302, + SCK_RIGHT = 303, + SCK_HOME = 304, + SCK_END = 305, + SCK_PRIOR = 306, + SCK_NEXT = 307, + SCK_DELETE = 308, + SCK_INSERT = 309, + SCK_ESCAPE = 7, + SCK_BACK = 8, + SCK_TAB = 9, + SCK_RETURN = 13, + SCK_ADD = 310, + SCK_SUBTRACT = 311, + SCK_DIVIDE = 312 + }; + + //! This enum defines the different modifier keys. + enum + { + //! No modifier key. + SCMOD_NORM = 0, + + //! Shift key. + SCMOD_SHIFT = 1, + + //! Control key. + SCMOD_CTRL = 2, + + //! Alt key. + SCMOD_ALT = 4 + }; + + //! This enum defines the different language lexers. + //! + //! \sa SCI_GETLEXER, SCI_SETLEXER + enum + { + //! No lexer is selected and the SCN_STYLENEEDED signal is + //! emitted so that the application can style the text as + //! needed. This is the default. + SCLEX_CONTAINER = 0, + + //! Select the null lexer that does no syntax styling. + SCLEX_NULL = 1, + + //! Select the Python lexer. + SCLEX_PYTHON = 2, + + //! Select the C++ lexer. + SCLEX_CPP = 3, + + //! Select the HTML lexer. + SCLEX_HTML = 4, + + //! Select the XML lexer. + SCLEX_XML = 5, + + //! Select the Perl lexer. + SCLEX_PERL = 6, + + //! Select the SQL lexer. + SCLEX_SQL = 7, + + //! Select the Visual Basic lexer. + SCLEX_VB = 8, + + //! Select the lexer for properties style files. + SCLEX_PROPERTIES = 9, + + //! Select the lexer for error list style files. + SCLEX_ERRORLIST = 10, + + //! Select the Makefile lexer. + SCLEX_MAKEFILE = 11, + + //! Select the Windows batch file lexer. + SCLEX_BATCH = 12, + + //! Select the LaTex lexer. + SCLEX_LATEX = 14, + + //! Select the Lua lexer. + SCLEX_LUA = 15, + + //! Select the lexer for diff output. + SCLEX_DIFF = 16, + + //! Select the lexer for Apache configuration files. + SCLEX_CONF = 17, + + //! Select the Pascal lexer. + SCLEX_PASCAL = 18, + + //! Select the Avenue lexer. + SCLEX_AVE = 19, + + //! Select the Ada lexer. + SCLEX_ADA = 20, + + //! Select the Lisp lexer. + SCLEX_LISP = 21, + + //! Select the Ruby lexer. + SCLEX_RUBY = 22, + + //! Select the Eiffel lexer. + SCLEX_EIFFEL = 23, + + //! Select the Eiffel lexer folding at keywords. + SCLEX_EIFFELKW = 24, + + //! Select the Tcl lexer. + SCLEX_TCL = 25, + + //! Select the lexer for nnCron files. + SCLEX_NNCRONTAB = 26, + + //! Select the Bullant lexer. + SCLEX_BULLANT = 27, + + //! Select the VBScript lexer. + SCLEX_VBSCRIPT = 28, + + //! Select the ASP lexer. + SCLEX_ASP = SCLEX_HTML, + + //! Select the PHP lexer. + SCLEX_PHP = SCLEX_HTML, + + //! Select the Baan lexer. + SCLEX_BAAN = 31, + + //! Select the Matlab lexer. + SCLEX_MATLAB = 32, + + //! Select the Scriptol lexer. + SCLEX_SCRIPTOL = 33, + + //! Select the assembler lexer. + SCLEX_ASM = 34, + + //! Select the C++ lexer with case insensitive keywords. + SCLEX_CPPNOCASE = 35, + + //! Select the FORTRAN lexer. + SCLEX_FORTRAN = 36, + + //! Select the FORTRAN77 lexer. + SCLEX_F77 = 37, + + //! Select the CSS lexer. + SCLEX_CSS = 38, + + //! Select the POV lexer. + SCLEX_POV = 39, + + //! Select the Basser Lout typesetting language lexer. + SCLEX_LOUT = 40, + + //! Select the EScript lexer. + SCLEX_ESCRIPT = 41, + + //! Select the PostScript lexer. + SCLEX_PS = 42, + + //! Select the NSIS lexer. + SCLEX_NSIS = 43, + + //! Select the MMIX assembly language lexer. + SCLEX_MMIXAL = 44, + + //! Select the Clarion lexer. + SCLEX_CLW = 45, + + //! Select the Clarion lexer with case insensitive keywords. + SCLEX_CLWNOCASE = 46, + + //! Select the MPT text log file lexer. + SCLEX_LOT = 47, + + //! Select the YAML lexer. + SCLEX_YAML = 48, + + //! Select the TeX lexer. + SCLEX_TEX = 49, + + //! Select the Metapost lexer. + SCLEX_METAPOST = 50, + + //! Select the PowerBASIC lexer. + SCLEX_POWERBASIC = 51, + + //! Select the Forth lexer. + SCLEX_FORTH = 52, + + //! Select the Erlang lexer. + SCLEX_ERLANG = 53, + + //! Select the Octave lexer. + SCLEX_OCTAVE = 54, + + //! Select the MS SQL lexer. + SCLEX_MSSQL = 55, + + //! Select the Verilog lexer. + SCLEX_VERILOG = 56, + + //! Select the KIX-Scripts lexer. + SCLEX_KIX = 57, + + //! Select the Gui4Cli lexer. + SCLEX_GUI4CLI = 58, + + //! Select the Specman E lexer. + SCLEX_SPECMAN = 59, + + //! Select the AutoIt3 lexer. + SCLEX_AU3 = 60, + + //! Select the APDL lexer. + SCLEX_APDL = 61, + + //! Select the Bash lexer. + SCLEX_BASH = 62, + + //! Select the ASN.1 lexer. + SCLEX_ASN1 = 63, + + //! Select the VHDL lexer. + SCLEX_VHDL = 64, + + //! Select the Caml lexer. + SCLEX_CAML = 65, + + //! Select the BlitzBasic lexer. + SCLEX_BLITZBASIC = 66, + + //! Select the PureBasic lexer. + SCLEX_PUREBASIC = 67, + + //! Select the Haskell lexer. + SCLEX_HASKELL = 68, + + //! Select the PHPScript lexer. + SCLEX_PHPSCRIPT = 69, + + //! Select the TADS3 lexer. + SCLEX_TADS3 = 70, + + //! Select the REBOL lexer. + SCLEX_REBOL = 71, + + //! Select the Smalltalk lexer. + SCLEX_SMALLTALK = 72, + + //! Select the FlagShip lexer. + SCLEX_FLAGSHIP = 73, + + //! Select the Csound lexer. + SCLEX_CSOUND = 74, + + //! Select the FreeBasic lexer. + SCLEX_FREEBASIC = 75, + + //! Select the InnoSetup lexer. + SCLEX_INNOSETUP = 76, + + //! Select the Opal lexer. + SCLEX_OPAL = 77, + + //! Select the Spice lexer. + SCLEX_SPICE = 78 + }; + + //! Construct an empty QextScintillaBase with parent \a parent, name + //! \a name, and widget flags \a f. + QextScintillaBase(QWidget *parent = 0,const char *name = 0, + WFlags f = 0); + + //! Destroys the QextScintillaBase instance. + virtual ~QextScintillaBase(); + + //! Returns a pointer to a QextScintillaBase instance, or 0 if there + //! isn't one. This can be used by the higher level API to send + //! messages that aren't associated with a particular instance. + static QextScintillaBase *pool(); + + //! Send the Scintilla message \a msg with the optional parameters \a + //! wParam and \a lParam. + long SendScintilla(unsigned int msg,unsigned long wParam = 0, + long lParam = 0); + + //! \overload + long SendScintilla(unsigned int msg,unsigned long wParam, + const char *lParam) + { + return SendScintilla(msg,wParam,reinterpret_cast(lParam)); + } + + //! \overload + long SendScintilla(unsigned int msg,const char *lParam) + { + return SendScintilla(msg,0UL,reinterpret_cast(lParam)); + } + + //! \overload + long SendScintilla(unsigned int msg,const char *wParam, + const char *lParam) + { + return SendScintilla(msg,reinterpret_cast(wParam),reinterpret_cast(lParam)); + } + + //! \overload + long SendScintilla(unsigned int msg, long wParam) + { + return SendScintilla(msg, static_cast(wParam), 0L); + } + + //! \overload + long SendScintilla(unsigned int msg, int wParam) + { + return SendScintilla(msg, static_cast(wParam), 0L); + } + + //! \overload + long SendScintilla(unsigned int msg,long cpMin,long cpMax, + char *lpstrText); + + //! \overload + long SendScintilla(unsigned int msg,unsigned long wParam, + const QColor &col); + + //! \overload + long SendScintilla(unsigned int msg,const QColor &col); + + //! \overload + long SendScintilla(unsigned int msg,unsigned long wParam,QPainter *hdc, + const QRect &rc,long cpMin,long cpMax); + + //! \overload + long SendScintilla(unsigned int msg,unsigned long wParam, + const QPixmap *lParam) + { + return SendScintilla(msg,wParam,reinterpret_cast(lParam)); + } + + //! Returns the recommended size of the widget. + virtual QSize sizeHint() const; + + //! Returns the viewport widget. This is the widget that actually + //! contains the text. + QWidget *viewport() const; + +signals: + //! This signal is emitted when text is selected or de-selected. + //! \a yes is TRUE if text has been selected and FALSE if text has been + //! deselected. + void QSCN_SELCHANGED(bool yes); + + //! This signal is emitted when the user selects an item in an + //! auto-completion list. It is emitted before the selection is + //! inserted. The insertion can be cancelled by sending an + //! SCI_AUTOCANCEL message from a connected slot. + //! \a position is the start position of the word being completed. + //! \a selection is the text of the selection. + void SCN_AUTOCSELECTION(const char *selection,int position); + + //! This signal is emitted when the document has changed for any + //! reason. + void SCEN_CHANGE(); + + //! This signal ir emitted when the user clicks on a calltip. + //! \a position is 1 if the user clicked on the up arrow, 2 if the user + //! clicked on the down arrow, and 0 if the user clicked elsewhere. + void SCN_CALLTIPCLICK(int direction); + + //! This signal is emitted whenever the user enters an ordinary + //! character into the text. \a charadded is the character. It can be + //! used to decide to display a call tip or an auto-completion list. + void SCN_CHARADDED(int charadded); + + //! + void SCN_DOUBLECLICK(); + + //! + void SCN_DWELLEND(int,int,int); + + //! + void SCN_DWELLSTART(int,int,int); + + //! This signal is emitted when the user clicks on text in a style + //! with the hotspot attribute set. + //! \a position is the position in the text where the click occured. + //! \a modifiers is the logical or of the modifier keys that were + //! pressed when the user clicked. + void SCN_HOTSPOTCLICK(int position,int modifiers); + + //! This signal is emitted when the user double clicks on text in a + //! style with the hotspot attribute set. + //! \a position is the position in the text where the double click + //! occured. + //! \a modifiers is the logical or of the modifier keys that were + //! pressed when the user double clicked. + void SCN_HOTSPOTDOUBLECLICK(int position,int modifiers); + + //! This signal is emitted when a recordable editor command has been + //! executed. + void SCN_MACRORECORD(unsigned int,unsigned long,long); + + //! This signal is emitted when the user clicks on a sensitive margin. + //! \a position is the position of the start of the line against which + //! the user clicked. + //! \a modifiers is the logical or of the modifier keys that were + //! pressed when the user clicked. + //! \a margin is the number of the margin the user clicked in: 0, 1 or + //! 2. + //! + //! \sa SCI_GETMARGINSENSITIVEN, SCI_SETMARGINSENSITIVEN + void SCN_MARGINCLICK(int position,int modifiers,int margin); + + //! + void SCN_MODIFIED(int,int,const char *,int,int,int,int,int); + + //! This signal is emitted when the user attempts to modify read-only + //! text. + void SCN_MODIFYATTEMPTRO(); + + //! + void SCN_NEEDSHOWN(int,int); + + //! This signal is emitted when painting has been completed. It is + //! useful to trigger some other change but to have the paint be done + //! first to appear more reponsive to the user. + void SCN_PAINTED(); + + //! This signal is emitted when the current state of the text no longer + //! corresponds to the state of the text at the save point. + //! + //! \sa SCI_SETSAVEPOINT, SCN_SAVEPOINTREACHED() + void SCN_SAVEPOINTLEFT(); + + //! This signal is emitted when the current state of the text + //! corresponds to the state of the text at the save point. This allows + //! feedback to be given to the user as to whether the text has been + //! modified since it was last saved. + //! + //! \sa SCI_SETSAVEPOINT, SCN_SAVEPOINTLEFT() + void SCN_SAVEPOINTREACHED(); + + //! This signal is emitted when a range of text needs to be syntax + //! styled. The range is from the value returned by the + //! SCI_GETENDSTYLED message and \a position. It is only emitted if + //! the currently selected lexer is SCNLEX_CONTAINER. + //! + //! \sa SCI_COLOURISE, SCI_GETENDSTYLED + void SCN_STYLENEEDED(int position); + + //! + void SCN_UPDATEUI(); + + //! + void SCN_USERLISTSELECTION(const char *,int); + + //! + void SCN_ZOOM(); + +protected: + //! Re-implemented to filter certain events. + bool eventFilter(QObject *o,QEvent *e); + + //! Re-implemented to handle the key presses for the widget. + virtual void keyPressEvent(QKeyEvent *ke); + + //! Re-implemented to tell Scintilla it has the focus. + virtual void focusInEvent(QFocusEvent *); + + //! Re-implemented to tell Scintilla it has lost the focus. + virtual void focusOutEvent(QFocusEvent *); + + //! Re-implemented to allow tabs to be entered as text. + virtual bool focusNextPrevChild(bool); + + //! Start a drag operation. + virtual void startDrag(); + +private slots: + void handleTimer(); + void handleVSb(int value); + void handleHSb(int value); + void handlePopUp(int cmd); + void handleSelection(); + +private: + friend class ScintillaQt; + + void mousePress(QMouseEvent *me); + void mouseRelease(QMouseEvent *me); + void mouseDoubleClick(QMouseEvent *me); + void mouseMove(QMouseEvent *me); + void mouseWheel(QWheelEvent *we); + void contextMenu(QContextMenuEvent *cme); + + ScintillaQt *sci; + QPoint triple_click_at; + QTimer triple_click; + QScrollBar *vsb; + QScrollBar *hsb; + QWidget *txtarea; + +#if defined(Q_DISABLE_COPY) + QextScintillaBase(const QextScintillaBase &); + QextScintillaBase &operator=(const QextScintillaBase &); +#endif +}; + +#endif diff --git a/qt/qextscintillacommand.cpp b/qt/qextscintillacommand.cpp new file mode 100644 index 0000000..57f9ee1 --- /dev/null +++ b/qt/qextscintillacommand.cpp @@ -0,0 +1,199 @@ +// This module implements the QextScintillaCommand class. +// +// Copyright (c) 2006 +// Riverbank Computing Limited +// +// This file is part of QScintilla. +// +// This copy of QScintilla is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2, or (at your option) any +// later version. +// +// QScintilla is supplied 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 +// QScintilla; see the file LICENSE. If not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +#include +#include + +#include "qextscintillacommand.h" +#include "qextscintilla.h" +#include "qextscintillabase.h" + + +static int convert(int key); + + +// The ctor. +QextScintillaCommand::QextScintillaCommand(QextScintilla *qs,int msg,int key, + int altkey, const char *desc) : + qsCmd(qs), msgCmd(msg), + qkey(key), qaltkey(altkey), + descCmd(desc) +{ + scikey = convert(qkey); + + if (scikey) + qsCmd -> SendScintilla(QextScintillaBase::SCI_ASSIGNCMDKEY,scikey,msgCmd); + + scialtkey = convert(qaltkey); + + if (scialtkey) + qsCmd -> SendScintilla(QextScintillaBase::SCI_ASSIGNCMDKEY,scialtkey,msgCmd); +} + + +// Bind a key to a command. +void QextScintillaCommand::setKey(int key) +{ + bindKey(key,qkey,scikey); +} + + +// Bind an alternate key to a command. +void QextScintillaCommand::setAlternateKey(int altkey) +{ + bindKey(altkey,qaltkey,scialtkey); +} + + +// Do the hard work of binding a key. +void QextScintillaCommand::bindKey(int key,int &qk,int &scik) +{ + int new_scikey; + + // Ignore if it is invalid, allowing for the fact that we might be + // unbinding it. + if (key) + { + new_scikey = convert(key); + + if (!new_scikey) + return; + } + else + new_scikey = 0; + + if (scik) + qsCmd -> SendScintilla(QextScintillaBase::SCI_CLEARCMDKEY,scik); + + qk = key; + scik = new_scikey; + + if (scik) + qsCmd -> SendScintilla(QextScintillaBase::SCI_ASSIGNCMDKEY,scik,msgCmd); +} + + +// See if a key is valid. +bool QextScintillaCommand::validKey(int key) +{ + return convert(key); +} + + +// Convert a Qt character to the Scintilla equivalent. Return zero if it is +// invalid. +static int convert(int key) +{ + // Convert the modifiers. + int sci_mod = 0; + + if (key & Qt::SHIFT) + sci_mod |= QextScintillaBase::SCMOD_SHIFT; + + if (key & Qt::CTRL) + sci_mod |= QextScintillaBase::SCMOD_CTRL; + + if (key & Qt::ALT) + sci_mod |= QextScintillaBase::SCMOD_ALT; + + key &= ~Qt::MODIFIER_MASK; + + // Convert the key. + int sci_key; + + if (key > 0x7f) + switch (key) + { + case Qt::Key_Down: + sci_key = QextScintillaBase::SCK_DOWN; + break; + + case Qt::Key_Up: + sci_key = QextScintillaBase::SCK_UP; + break; + + case Qt::Key_Left: + sci_key = QextScintillaBase::SCK_LEFT; + break; + + case Qt::Key_Right: + sci_key = QextScintillaBase::SCK_RIGHT; + break; + + case Qt::Key_Home: + sci_key = QextScintillaBase::SCK_HOME; + break; + + case Qt::Key_End: + sci_key = QextScintillaBase::SCK_END; + break; + + case Qt::Key_Prior: + sci_key = QextScintillaBase::SCK_PRIOR; + break; + + case Qt::Key_Next: + sci_key = QextScintillaBase::SCK_NEXT; + break; + + case Qt::Key_Delete: + sci_key = QextScintillaBase::SCK_DELETE; + break; + + case Qt::Key_Insert: + sci_key = QextScintillaBase::SCK_INSERT; + break; + + case Qt::Key_Escape: + sci_key = QextScintillaBase::SCK_ESCAPE; + break; + + case Qt::Key_Backspace: + sci_key = QextScintillaBase::SCK_BACK; + break; + + case Qt::Key_Tab: + sci_key = QextScintillaBase::SCK_TAB; + break; + + case Qt::Key_Return: + sci_key = QextScintillaBase::SCK_RETURN; + break; + + default: + sci_key = 0; + } + else + sci_key = key; + + if (sci_key) + sci_key |= (sci_mod << 16); + + return sci_key; +} + + +// Return the translated user friendly description. +QString QextScintillaCommand::description() const +{ + return qApp -> translate("QextScintillaCommand",descCmd); +} diff --git a/qt/qextscintillacommand.h b/qt/qextscintillacommand.h new file mode 100644 index 0000000..0e4557c --- /dev/null +++ b/qt/qextscintillacommand.h @@ -0,0 +1,99 @@ +// This defines the interface to the QextScintillaCommand class. +// +// Copyright (c) 2006 +// Riverbank Computing Limited +// +// This file is part of QScintilla. +// +// This copy of QScintilla is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2, or (at your option) any +// later version. +// +// QScintilla is supplied 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 +// QScintilla; see the file LICENSE. If not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +#ifndef QEXTSCINTILLACOMMAND_H +#define QEXTSCINTILLACOMMAND_H + + +#include + +#include + + +class QextScintilla; + + +//! \brief The QextScintillaCommand class represents an internal editor command +//! that may have one or two keys bound to it. +//! +//! Methods are provided to change the keys bound to the command and to remove +//! a key binding. Each command has a user friendly description of the command +//! for use in key mapping dialogs. +class QEXTSCINTILLA_EXPORT QextScintillaCommand +{ +public: + //! Binds the key \a key to the command. If \a key is 0 then the key + //! binding is removed. If \a key is invalid then the key binding is + //! unchanged. Valid keys are any visible or control character or any + //! of \c Key_Down, \c Key_Up, \c Key_Left, \c Key_Right, \c Key_Home, + //! \c Key_End, \c Key_Prior, \c Key_Next, \c Key_Delete, + //! \c Key_Insert, \c Key_Escape, \c Key_Backspace, \c Key_Tab and + //! \c Key_Return. Keys may be modified with any combination of + //! \c SHIFT, \c CTRL and \c ALT. + //! + //! \sa key(), setAlternateKey(), validKey() + void setKey(int key); + + //! Binds the alternate key \a altkey to the command. If \a key is 0 + //! then the alternate key binding is removed. + //! + //! \sa alternateKey(), setKey(), validKey() + void setAlternateKey(int altkey); + + //! The key that is currently bound to the command is returned. + //! + //! \sa setKey(), alternateKey() + int key() const {return qkey;} + + //! The alternate key that is currently bound to the command is + //! returned. + //! + //! \sa setAlternateKey(), key() + int alternateKey() const {return qaltkey;} + + //! If the key \a key is valid then TRUE is returned. + static bool validKey(int key); + + //! The user friendly description of the command is returned. + QString description() const; + +private: + friend class QextScintillaCommandSet; + + QextScintillaCommand(QextScintilla *qs,int msg,int key,int altkey, + const char *desc); + + int msgId() const {return msgCmd;} + void bindKey(int key,int &qk,int &scik); + + QextScintilla *qsCmd; + int msgCmd; + int qkey, scikey, qaltkey, scialtkey; + const char *descCmd; + +#if defined(Q_DISABLE_COPY) + QextScintillaCommand(const QextScintillaCommand &); + QextScintillaCommand &operator=(const QextScintillaCommand &); +#endif +}; + +#endif diff --git a/qt/qextscintillacommandset.cpp b/qt/qextscintillacommandset.cpp new file mode 100644 index 0000000..9c7fa59 --- /dev/null +++ b/qt/qextscintillacommandset.cpp @@ -0,0 +1,653 @@ +// This module implements the QextScintillaCommandSet class. +// +// Copyright (c) 2006 +// Riverbank Computing Limited +// +// This file is part of QScintilla. +// +// This copy of QScintilla is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2, or (at your option) any +// later version. +// +// QScintilla is supplied 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 +// QScintilla; see the file LICENSE. If not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +#include + +#include "qextscintillacommandset.h" +#include "qextscintillacommand.h" +#include "qextscintilla.h" + + +// The ctor. +QextScintillaCommandSet::QextScintillaCommandSet(QextScintilla *qs) : qsci(qs) +{ + struct sci_cmd { + int msg; + int key; + int altkey; + const char *desc; + }; + + // This is based on the default table in src/KeyMap.cxx. + static struct sci_cmd cmd_table[] = { + { + QextScintillaBase::SCI_LINEDOWN, + Qt::Key_Down, + 0, + QT_TRANSLATE_NOOP("QextScintillaCommand", + "Move down one line") + }, + { + QextScintillaBase::SCI_LINEDOWNEXTEND, + Qt::Key_Down | Qt::SHIFT, + 0, + QT_TRANSLATE_NOOP("QextScintillaCommand", + "Extend selection down one line") + }, + { + QextScintillaBase::SCI_LINESCROLLDOWN, + Qt::Key_Down | Qt::CTRL, + 0, + QT_TRANSLATE_NOOP("QextScintillaCommand", + "Scroll view down one line") + }, + { + QextScintillaBase::SCI_LINEDOWNRECTEXTEND, + Qt::Key_Down | Qt::ALT | Qt::SHIFT, + 0, + QT_TRANSLATE_NOOP("QextScintillaCommand", + "Extend rectangular selection down one line") + }, + { + QextScintillaBase::SCI_LINEUP, + Qt::Key_Up, + 0, + QT_TRANSLATE_NOOP("QextScintillaCommand", + "Move up one line") + }, + { + QextScintillaBase::SCI_LINEUPEXTEND, + Qt::Key_Up | Qt::SHIFT, + 0, + QT_TRANSLATE_NOOP("QextScintillaCommand", + "Extend selection up one line") + }, + { + QextScintillaBase::SCI_LINESCROLLUP, + Qt::Key_Up | Qt::CTRL, + 0, + QT_TRANSLATE_NOOP("QextScintillaCommand", + "Scroll view up one line") + }, + { + QextScintillaBase::SCI_LINEUPRECTEXTEND, + Qt::Key_Up | Qt::ALT | Qt::SHIFT, + 0, + QT_TRANSLATE_NOOP("QextScintillaCommand", + "Extend rectangular selection up one line") + }, + { + QextScintillaBase::SCI_PARAUP, + Qt::Key_BracketLeft | Qt::CTRL, + 0, + QT_TRANSLATE_NOOP("QextScintillaCommand", + "Move up one paragraph") + }, + { + QextScintillaBase::SCI_PARAUPEXTEND, + Qt::Key_BracketLeft | Qt::CTRL | Qt::SHIFT, + 0, + QT_TRANSLATE_NOOP("QextScintillaCommand", + "Extend selection up one paragraph") + }, + { + QextScintillaBase::SCI_PARADOWN, + Qt::Key_BracketRight | Qt::CTRL, + 0, + QT_TRANSLATE_NOOP("QextScintillaCommand", + "Move down one paragraph") + }, + { + QextScintillaBase::SCI_PARADOWNEXTEND, + Qt::Key_BracketRight | Qt::CTRL | Qt::SHIFT, + 0, + QT_TRANSLATE_NOOP("QextScintillaCommand", + "Extend selection down one paragraph") + }, + { + QextScintillaBase::SCI_CHARLEFT, + Qt::Key_Left, + 0, + QT_TRANSLATE_NOOP("QextScintillaCommand", + "Move left one character") + }, + { + QextScintillaBase::SCI_CHARLEFTEXTEND, + Qt::Key_Left | Qt::SHIFT, + 0, + QT_TRANSLATE_NOOP("QextScintillaCommand", + "Extend selection left one character") + }, + { + QextScintillaBase::SCI_WORDLEFT, + Qt::Key_Left | Qt::CTRL, + 0, + QT_TRANSLATE_NOOP("QextScintillaCommand", + "Move left one word") + }, + { + QextScintillaBase::SCI_WORDLEFTEXTEND, + Qt::Key_Left | Qt::SHIFT | Qt::CTRL, + 0, + QT_TRANSLATE_NOOP("QextScintillaCommand", + "Extend selection left one word") + }, + { + QextScintillaBase::SCI_CHARLEFTRECTEXTEND, + Qt::Key_Left | Qt::ALT | Qt::SHIFT, + 0, + QT_TRANSLATE_NOOP("QextScintillaCommand", + "Extend rectangular selection left one character") + }, + { + QextScintillaBase::SCI_CHARRIGHT, + Qt::Key_Right, + 0, + QT_TRANSLATE_NOOP("QextScintillaCommand", + "Move right one character") + }, + { + QextScintillaBase::SCI_CHARRIGHTEXTEND, + Qt::Key_Right | Qt::SHIFT, + 0, + QT_TRANSLATE_NOOP("QextScintillaCommand", + "Extend selection right one character") + }, + { + QextScintillaBase::SCI_WORDRIGHT, + Qt::Key_Right | Qt::CTRL, + 0, + QT_TRANSLATE_NOOP("QextScintillaCommand", + "Move right one word") + }, + { + QextScintillaBase::SCI_WORDRIGHTEXTEND, + Qt::Key_Right | Qt::CTRL | Qt::SHIFT, + 0, + QT_TRANSLATE_NOOP("QextScintillaCommand", + "Extend selection right one word") + }, + { + QextScintillaBase::SCI_CHARRIGHTRECTEXTEND, + Qt::Key_Right | Qt::ALT | Qt::SHIFT, + 0, + QT_TRANSLATE_NOOP("QextScintillaCommand", + "Extend rectangular selection right one character") + }, + { + QextScintillaBase::SCI_WORDPARTLEFT, + Qt::Key_Slash | Qt::CTRL, + 0, + QT_TRANSLATE_NOOP("QextScintillaCommand", + "Move left one word part") + }, + { + QextScintillaBase::SCI_WORDPARTLEFTEXTEND, + Qt::Key_Slash | Qt::CTRL | Qt::SHIFT, + 0, + QT_TRANSLATE_NOOP("QextScintillaCommand", + "Extend selection left one word part") + }, + { + QextScintillaBase::SCI_WORDPARTRIGHT, + Qt::Key_Backslash | Qt::CTRL, + 0, + QT_TRANSLATE_NOOP("QextScintillaCommand", + "Move right one word part") + }, + { + QextScintillaBase::SCI_WORDPARTRIGHTEXTEND, + Qt::Key_Backslash | Qt::CTRL | Qt::SHIFT, + 0, + QT_TRANSLATE_NOOP("QextScintillaCommand", + "Extend selection right one word part") + }, + { + QextScintillaBase::SCI_VCHOME, + Qt::Key_Home, + 0, + QT_TRANSLATE_NOOP("QextScintillaCommand", + "Move to first visible character in line") + }, + { + QextScintillaBase::SCI_VCHOMEEXTEND, + Qt::Key_Home | Qt::SHIFT, + 0, + QT_TRANSLATE_NOOP("QextScintillaCommand", + "Extend selection to first visible character in line") + }, + { + QextScintillaBase::SCI_DOCUMENTSTART, + Qt::Key_Home | Qt::CTRL, + 0, + QT_TRANSLATE_NOOP("QextScintillaCommand", + "Move to start of text") + }, + { + QextScintillaBase::SCI_DOCUMENTSTARTEXTEND, + Qt::Key_Home | Qt::CTRL | Qt::SHIFT, + 0, + QT_TRANSLATE_NOOP("QextScintillaCommand", + "Extend selection to start of text") + }, + { + QextScintillaBase::SCI_HOMEDISPLAY, + Qt::Key_Home | Qt::ALT, + 0, + QT_TRANSLATE_NOOP("QextScintillaCommand", + "Move to start of displayed line") + }, + { + QextScintillaBase::SCI_HOMEDISPLAYEXTEND, + 0, + 0, + QT_TRANSLATE_NOOP("QextScintillaCommand", + "Extend selection to start of line") + }, + { + QextScintillaBase::SCI_VCHOMERECTEXTEND, + Qt::Key_Home | Qt::ALT | Qt::SHIFT, + 0, + QT_TRANSLATE_NOOP("QextScintillaCommand", + "Extend rectangular selection to first visible character in line") + }, + { + QextScintillaBase::SCI_LINEEND, + Qt::Key_End, + 0, + QT_TRANSLATE_NOOP("QextScintillaCommand", + "Move to end of line") + }, + { + QextScintillaBase::SCI_LINEENDEXTEND, + Qt::Key_End | Qt::SHIFT, + 0, + QT_TRANSLATE_NOOP("QextScintillaCommand", + "Extend selection to end of line") + }, + { + QextScintillaBase::SCI_DOCUMENTEND, + Qt::Key_End | Qt::CTRL, + 0, + QT_TRANSLATE_NOOP("QextScintillaCommand", + "Move to end of text") + }, + { + QextScintillaBase::SCI_DOCUMENTENDEXTEND, + Qt::Key_End | Qt::CTRL | Qt::SHIFT, + 0, + QT_TRANSLATE_NOOP("QextScintillaCommand", + "Extend selection to end of text") + }, + { + QextScintillaBase::SCI_LINEENDDISPLAY, + Qt::Key_End | Qt::ALT, + 0, + QT_TRANSLATE_NOOP("QextScintillaCommand", + "Move to end of displayed line") + }, + { + QextScintillaBase::SCI_LINEENDDISPLAYEXTEND, + 0, + 0, + QT_TRANSLATE_NOOP("QextScintillaCommand", + "Extend selection to end of displayed line") + }, + { + QextScintillaBase::SCI_LINEENDRECTEXTEND, + Qt::Key_End | Qt::ALT | Qt::SHIFT, + 0, + QT_TRANSLATE_NOOP("QextScintillaCommand", + "Extend rectangular selection to end of line") + }, + { + QextScintillaBase::SCI_PAGEUP, + Qt::Key_Prior, + 0, + QT_TRANSLATE_NOOP("QextScintillaCommand", + "Move up one page") + }, + { + QextScintillaBase::SCI_PAGEUPEXTEND, + Qt::Key_Prior | Qt::SHIFT, + 0, + QT_TRANSLATE_NOOP("QextScintillaCommand", + "Extend selection up one page") + }, + { + QextScintillaBase::SCI_PAGEUPRECTEXTEND, + Qt::Key_Prior | Qt::ALT | Qt::SHIFT, + 0, + QT_TRANSLATE_NOOP("QextScintillaCommand", + "Extend rectangular selection up one page") + }, + { + QextScintillaBase::SCI_PAGEDOWN, + Qt::Key_Next, + 0, + QT_TRANSLATE_NOOP("QextScintillaCommand", + "Move down one page") + }, + { + QextScintillaBase::SCI_PAGEDOWNEXTEND, + Qt::Key_Next | Qt::SHIFT, + 0, + QT_TRANSLATE_NOOP("QextScintillaCommand", + "Extend selection down one page") + }, + { + QextScintillaBase::SCI_PAGEDOWNRECTEXTEND, + Qt::Key_Next | Qt::ALT | Qt::SHIFT, + 0, + QT_TRANSLATE_NOOP("QextScintillaCommand", + "Extend rectangular selection down one page") + }, + { + QextScintillaBase::SCI_CLEAR, + Qt::Key_Delete, + 0, + QT_TRANSLATE_NOOP("QextScintillaCommand", + "Delete current character") + }, + { + QextScintillaBase::SCI_CUT, + Qt::Key_X | Qt::CTRL, + Qt::Key_Delete | Qt::SHIFT, + QT_TRANSLATE_NOOP("QextScintillaCommand", + "Cut selection") + }, + { + QextScintillaBase::SCI_DELWORDRIGHT, + Qt::Key_Delete | Qt::CTRL, + 0, + QT_TRANSLATE_NOOP("QextScintillaCommand", + "Delete word to right") + }, + { + QextScintillaBase::SCI_DELLINERIGHT, + Qt::Key_Delete | Qt::CTRL | Qt::SHIFT, + 0, + QT_TRANSLATE_NOOP("QextScintillaCommand", + "Delete line to right") + }, + { + QextScintillaBase::SCI_EDITTOGGLEOVERTYPE, + Qt::Key_Insert, + 0, + QT_TRANSLATE_NOOP("QextScintillaCommand", + "Toggle insert/overtype") + }, + { + QextScintillaBase::SCI_PASTE, + Qt::Key_V | Qt::CTRL, + Qt::Key_Insert | Qt::SHIFT, + QT_TRANSLATE_NOOP("QextScintillaCommand", + "Paste") + }, + { + QextScintillaBase::SCI_COPY, + Qt::Key_C | Qt::CTRL, + Qt::Key_Insert | Qt::CTRL, + QT_TRANSLATE_NOOP("QextScintillaCommand", + "Copy selection") + }, + { + QextScintillaBase::SCI_CANCEL, + Qt::Key_Escape, + 0, + QT_TRANSLATE_NOOP("QextScintillaCommand", + "Cancel") + }, + { + QextScintillaBase::SCI_DELETEBACK, + Qt::Key_Backspace, + Qt::Key_Backspace | Qt::SHIFT, + QT_TRANSLATE_NOOP("QextScintillaCommand", + "Delete previous character") + }, + { + QextScintillaBase::SCI_DELWORDLEFT, + Qt::Key_Backspace | Qt::CTRL, + 0, + QT_TRANSLATE_NOOP("QextScintillaCommand", + "Delete word to left") + }, + { + QextScintillaBase::SCI_UNDO, + Qt::Key_Z | Qt::CTRL, + Qt::Key_Backspace | Qt::ALT, + QT_TRANSLATE_NOOP("QextScintillaCommand", + "Undo the last command") + }, + { + QextScintillaBase::SCI_DELLINELEFT, + Qt::Key_Backspace | Qt::CTRL | Qt::SHIFT, + 0, + QT_TRANSLATE_NOOP("QextScintillaCommand", + "Delete line to left") + }, + { + QextScintillaBase::SCI_REDO, + Qt::Key_Y | Qt::CTRL, + 0, + QT_TRANSLATE_NOOP("QextScintillaCommand", + "Redo last command") + }, + { + QextScintillaBase::SCI_SELECTALL, + Qt::Key_A | Qt::CTRL, + 0, + QT_TRANSLATE_NOOP("QextScintillaCommand", + "Select all text") + }, + { + QextScintillaBase::SCI_TAB, + Qt::Key_Tab, + 0, + QT_TRANSLATE_NOOP("QextScintillaCommand", + "Indent one level") + }, + { + QextScintillaBase::SCI_BACKTAB, + Qt::Key_Tab | Qt::SHIFT, + 0, + QT_TRANSLATE_NOOP("QextScintillaCommand", + "Move back one indentation level") + }, + { + QextScintillaBase::SCI_NEWLINE, + Qt::Key_Return, + Qt::Key_Return | Qt::SHIFT, + QT_TRANSLATE_NOOP("QextScintillaCommand", + "Insert new line") + }, + { + QextScintillaBase::SCI_ZOOMIN, + Qt::Key_Plus | Qt::CTRL, + 0, + QT_TRANSLATE_NOOP("QextScintillaCommand", + "Zoom in") + }, + { + QextScintillaBase::SCI_ZOOMOUT, + Qt::Key_Minus | Qt::CTRL, + 0, + QT_TRANSLATE_NOOP("QextScintillaCommand", + "Zoom out") + }, + { + QextScintillaBase::SCI_SETZOOM, + 0, + 0, + QT_TRANSLATE_NOOP("QextScintillaCommand", + "Set zoom") + }, + { + QextScintillaBase::SCI_FORMFEED, + 0, + 0, + QT_TRANSLATE_NOOP("QextScintillaCommand", + "Formfeed") + }, + { + QextScintillaBase::SCI_LINECUT, + Qt::Key_L | Qt::CTRL, + 0, + QT_TRANSLATE_NOOP("QextScintillaCommand", + "Cut current line") + }, + { + QextScintillaBase::SCI_LINEDELETE, + Qt::Key_L | Qt::CTRL | Qt::SHIFT, + 0, + QT_TRANSLATE_NOOP("QextScintillaCommand", + "Delete current line") + }, + { + QextScintillaBase::SCI_LINECOPY, + Qt::Key_T | Qt::CTRL | Qt::SHIFT, + 0, + QT_TRANSLATE_NOOP("QextScintillaCommand", + "Copy current line") + }, + { + QextScintillaBase::SCI_LINETRANSPOSE, + Qt::Key_T | Qt::CTRL, + 0, + QT_TRANSLATE_NOOP("QextScintillaCommand", + "Swap current and previous lines") + }, + { + QextScintillaBase::SCI_SELECTIONDUPLICATE, + Qt::Key_D | Qt::CTRL, + 0, + QT_TRANSLATE_NOOP("QextScintillaCommand", + "Duplicate selection") + }, + { + QextScintillaBase::SCI_LOWERCASE, + Qt::Key_U | Qt::CTRL, + 0, + QT_TRANSLATE_NOOP("QextScintillaCommand", + "Convert selection to lower case") + }, + { + QextScintillaBase::SCI_UPPERCASE, + Qt::Key_U | Qt::CTRL | Qt::SHIFT, + 0, + QT_TRANSLATE_NOOP("QextScintillaCommand", + "Convert selection to upper case") + }, + { + QextScintillaBase::SCI_DELETEBACKNOTLINE, + 0, + 0, + QT_TRANSLATE_NOOP("QextScintillaCommand", + "Delete previous character if not at line start") + }, + }; + + cmds.setAutoDelete(TRUE); + + // Clear the default map. + qsci -> SendScintilla(QextScintillaBase::SCI_CLEARALLCMDKEYS); + + for (int i = 0; i < sizeof (cmd_table) / sizeof (cmd_table[0]); ++i) + cmds.append(new QextScintillaCommand(qsci,cmd_table[i].msg,cmd_table[i].key,cmd_table[i].altkey,cmd_table[i].desc)); +} + + +// Read the command set from settings. +bool QextScintillaCommandSet::readSettings(QSettings &qs,const char *prefix) +{ + bool rc = TRUE; + QString skey; + + for (QextScintillaCommand *cmd = cmds.first(); cmd; cmd = cmds.next()) + { + skey.sprintf("%s/keymap/c%d/",prefix,cmd -> msgId()); + + int key; + bool ok; + + // Read the key. + key = qs.readNumEntry(skey + "key",0,&ok); + + if (ok) + cmd -> setKey(key); + else + rc = FALSE; + + // Read the alternate key. + key = qs.readNumEntry(skey + "alt",0,&ok); + + if (ok) + cmd -> setAlternateKey(key); + else + rc = FALSE; + } + + return rc; +} + + +// Write the command set to settings. +bool QextScintillaCommandSet::writeSettings(QSettings &qs,const char *prefix) +{ + bool rc = TRUE; + QString skey; + + for (const QextScintillaCommand *cmd = cmds.first(); cmd; cmd = cmds.next()) + { + skey.sprintf("%s/keymap/c%d/",prefix,cmd -> msgId()); + + // Write the key. + if (!qs.writeEntry(skey + "key",cmd -> key())) + rc = FALSE; + + // Write the alternate key. + if (!qs.writeEntry(skey + "alt",cmd -> alternateKey())) + rc = FALSE; + } + + return rc; +} + + +// Clear the key bindings. +void QextScintillaCommandSet::clearKeys() +{ + QPtrList &set = commands(); + + for (QextScintillaCommand *cmd = set.first(); cmd; cmd = set.next()) + cmd -> setKey(0); +} + + +// Clear the alternate key bindings. +void QextScintillaCommandSet::clearAlternateKeys() +{ + QPtrList &set = commands(); + + for (QextScintillaCommand *cmd = set.first(); cmd; cmd = set.next()) + cmd -> setAlternateKey(0); +} diff --git a/qt/qextscintillacommandset.h b/qt/qextscintillacommandset.h new file mode 100644 index 0000000..d242bfa --- /dev/null +++ b/qt/qextscintillacommandset.h @@ -0,0 +1,82 @@ +// This defines the interface to the QextScintillaCommandSet class. +// +// Copyright (c) 2006 +// Riverbank Computing Limited +// +// This file is part of QScintilla. +// +// This copy of QScintilla is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2, or (at your option) any +// later version. +// +// QScintilla is supplied 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 +// QScintilla; see the file LICENSE. If not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +#ifndef QEXTSCINTILLACOMMANDSET_H +#define QEXTSCINTILLACOMMANDSET_H + + +#include + +#include +#include + + +class QSettings; +class QextScintilla; + + +//! \brief The QextScintillaCommandSet class represents the set of all internal +//! editor commands that may have keys bound. +//! +//! Methods are provided to access the individual commands and to read and +//! write the current bindings from and to settings files. +class QEXTSCINTILLA_EXPORT QextScintillaCommandSet +{ +public: + //! The key bindings for each command in the set are read from the + //! settings \a qs. \a prefix is prepended to the key of each entry. + //! TRUE is returned if there was no error. + //! + //! \sa writeSettings() + bool readSettings(QSettings &qs,const char *prefix = "/Scintilla"); + + //! The key bindings for each command in the set are written to the + //! settings \a qs. \a prefix is prepended to the key of each entry. + //! TRUE is returned if there was no error. + //! + //! \sa readSettings() + bool writeSettings(QSettings &qs,const char *prefix = "/Scintilla"); + + //! The commands in the set are returned as a list. + QPtrList &commands() {return cmds;} + + //! The primary keys bindings for all commands are removed. + void clearKeys(); + + //! The alternate keys bindings for all commands are removed. + void clearAlternateKeys(); + +private: + friend class QextScintilla; + + QextScintillaCommandSet(QextScintilla *qs); + + QextScintilla *qsci; + QPtrList cmds; + +#if defined(Q_DISABLE_COPY) + QextScintillaCommandSet(const QextScintillaCommandSet &); + QextScintillaCommandSet &operator=(const QextScintillaCommandSet &); +#endif +}; + +#endif diff --git a/qt/qextscintilladocument.cpp b/qt/qextscintilladocument.cpp new file mode 100644 index 0000000..9fc6887 --- /dev/null +++ b/qt/qextscintilladocument.cpp @@ -0,0 +1,139 @@ +// This module implements the QextScintillaDocument class. +// +// Copyright (c) 2006 +// Riverbank Computing Limited +// +// This file is part of QScintilla. +// +// This copy of QScintilla is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2, or (at your option) any +// later version. +// +// QScintilla is supplied 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 +// QScintilla; see the file LICENSE. If not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +#include "qextscintilladocument.h" +#include "qextscintillabase.h" + + +// This internal class encapsulates the underlying document and is shared by +// QextScintillaDocument instances. +class QextScintillaDocumentP +{ +public: + QextScintillaDocumentP() : doc(0), nr_displays(0), nr_attaches(1) {} + + long doc; // The Scintilla document. + int nr_displays; // The number of displays. + int nr_attaches; // The number of attaches. +}; + + +// The ctor. +QextScintillaDocument::QextScintillaDocument() +{ + pdoc = new QextScintillaDocumentP(); +} + + +// The dtor. +QextScintillaDocument::~QextScintillaDocument() +{ + detach(); +} + + +// The copy ctor. +QextScintillaDocument::QextScintillaDocument(const QextScintillaDocument &that) +{ + attach(that); +} + + +// The assignment operator. +QextScintillaDocument &QextScintillaDocument::operator=(const QextScintillaDocument &that) +{ + if (pdoc != that.pdoc) + { + detach(); + attach(that); + } + + return *this; +} + + +// Attach an existing document to this one. +void QextScintillaDocument::attach(const QextScintillaDocument &that) +{ + ++that.pdoc -> nr_attaches; + pdoc = that.pdoc; +} + + +// Detach the underlying document. +void QextScintillaDocument::detach() +{ + if (!pdoc) + return; + + if (--pdoc -> nr_attaches == 0) + { + if (pdoc -> doc && pdoc -> nr_displays == 0) + { + QextScintillaBase *qsb = QextScintillaBase::pool(); + + // Release the explicit reference to the document. If + // the pool is empty then we just accept the memory + // leak. + if (qsb) + qsb -> SendScintilla(QextScintillaBase::SCI_RELEASEDOCUMENT,0,pdoc -> doc); + } + + delete pdoc; + } + + pdoc = 0; +} + + +// Undisplay and detach the underlying document. +void QextScintillaDocument::undisplay(QextScintillaBase *qsb) +{ + if (--pdoc -> nr_attaches == 0) + delete pdoc; + else if (--pdoc -> nr_displays == 0) + { + // Create an explicit reference to the document to keep it + // alive. + qsb -> SendScintilla(QextScintillaBase::SCI_ADDREFDOCUMENT,0,pdoc -> doc); + } + + pdoc = 0; +} + + +// Display the underlying document. +void QextScintillaDocument::display(QextScintillaBase *qsb,const QextScintillaDocument *from) +{ + long ndoc; + + if (from) + { + ndoc = from -> pdoc -> doc; + qsb -> SendScintilla(QextScintillaBase::SCI_SETDOCPOINTER,0,ndoc); + } + else + ndoc = qsb -> SendScintilla(QextScintillaBase::SCI_GETDOCPOINTER); + + pdoc -> doc = ndoc; + ++pdoc -> nr_displays; +} diff --git a/qt/qextscintilladocument.h b/qt/qextscintilladocument.h new file mode 100644 index 0000000..4dd846c --- /dev/null +++ b/qt/qextscintilladocument.h @@ -0,0 +1,61 @@ +// This defines the interface to the QextScintillaDocument class. +// +// Copyright (c) 2006 +// Riverbank Computing Limited +// +// This file is part of QScintilla. +// +// This copy of QScintilla is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2, or (at your option) any +// later version. +// +// QScintilla is supplied 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 +// QScintilla; see the file LICENSE. If not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +#ifndef QEXTSCINTILLADOCUMENT_H +#define QEXTSCINTILLADOCUMENT_H + + +#include + + +class QextScintillaBase; +class QextScintillaDocumentP; + + +//! \brief The QextScintillaDocument class represents a document to be editted. +//! +//! It is an opaque class that can be attached to multiple instances of +//! QextScintilla to create different simultaneous views of the same document. +//! QextScintillaDocument uses implicit sharing so that copying class instances +//! is a cheap operation. +class QEXTSCINTILLA_EXPORT QextScintillaDocument +{ +public: + //! Create a new unattached document. + QextScintillaDocument(); + virtual ~QextScintillaDocument(); + + QextScintillaDocument(const QextScintillaDocument &); + QextScintillaDocument &operator=(const QextScintillaDocument &); + +private: + friend class QextScintilla; + + void attach(const QextScintillaDocument &that); + void detach(); + void display(QextScintillaBase *qsb,const QextScintillaDocument *from); + void undisplay(QextScintillaBase *qsb); + + QextScintillaDocumentP *pdoc; +}; + +#endif diff --git a/qt/qextscintillaglobal.h b/qt/qextscintillaglobal.h new file mode 100644 index 0000000..f16286a --- /dev/null +++ b/qt/qextscintillaglobal.h @@ -0,0 +1,54 @@ +// This module defines various things common to all of the Qt port to +// Scintilla. +// +// Copyright (c) 2006 +// Riverbank Computing Limited +// +// This file is part of QScintilla. +// +// This copy of QScintilla is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2, or (at your option) any +// later version. +// +// QScintilla is supplied 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 +// QScintilla; see the file LICENSE. If not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +#ifndef QEXTSCINTILLAGLOBAL_H +#define QEXTSCINTILLAGLOBAL_H + + +#include + + +#define QSCINTILLA_VERSION 0x010701 +#define QSCINTILLA_VERSION_STR "1.7.1" +#define QSCINTILLA_BUILD "@RM_BUILD@" + + +// Under Windows, define QEXTSCINTILLA_MAKE_DLL to create a Scintilla DLL, or +// define QEXTSCINTILLA_DLL to link against a Scintilla DLL, or define neither +// to either build or link against a static Scintilla library. +#if defined(Q_WS_WIN) + +#if defined(QEXTSCINTILLA_DLL) +#define QEXTSCINTILLA_EXPORT __declspec(dllimport) +#elif defined(QEXTSCINTILLA_MAKE_DLL) +#define QEXTSCINTILLA_EXPORT __declspec(dllexport) +#endif + +#endif + +#if !defined(QEXTSCINTILLA_EXPORT) +#define QEXTSCINTILLA_EXPORT +#endif + + +#endif diff --git a/qt/qextscintillalexer.cpp b/qt/qextscintillalexer.cpp new file mode 100644 index 0000000..9302180 --- /dev/null +++ b/qt/qextscintillalexer.cpp @@ -0,0 +1,444 @@ +// This module implements the QextScintillaLexer class. +// +// Copyright (c) 2006 +// Riverbank Computing Limited +// +// This file is part of QScintilla. +// +// This copy of QScintilla is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2, or (at your option) any +// later version. +// +// QScintilla is supplied 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 +// QScintilla; see the file LICENSE. If not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +#include +#include +#include +#include + +#include "qextscintillalexer.h" +#include "qextscintilla.h" +#include "qextscintillabase.h" + + +// The ctor. +QextScintillaLexer::QextScintillaLexer(QObject *parent,const char *name) + : QObject(parent,name), autoIndStyle(-1) +{ +#if defined(Q_OS_WIN) + defFont = QFont("Verdana",10); +#else + defFont = QFont("Bitstream Vera Sans",9); +#endif + + // Set the default fore and background colours. + QColorGroup cg = QApplication::palette().active(); + defColor = cg.text(); + defPaper = cg.base(); +} + + +// The dtor. +QextScintillaLexer::~QextScintillaLexer() +{ +} + + +// Default implementation to return the set of fill up characters that can end +// auto-completion. +const char *QextScintillaLexer::autoCompletionFillups() const +{ + return "("; +} + + +// Default implementation to return the set of characters that can start +// auto-completion. +const char *QextScintillaLexer::autoCompletionStartCharacters() const +{ + return 0; +} + + +// Default implementation to return the list of keywords that can start a +// block. +const char *QextScintillaLexer::blockStartKeyword(int *) const +{ + return 0; +} + + +// Default implementation to return the list of characters that can start a +// block. +const char *QextScintillaLexer::blockStart(int *) const +{ + return 0; +} + + +// Default implementation to return the list of characters that can end a +// block. +const char *QextScintillaLexer::blockEnd(int *) const +{ + return 0; +} + + +// Default implementation to return the style used for braces. +int QextScintillaLexer::braceStyle() const +{ + return -1; +} + + +// Default implementation to return the number of lines to look back when +// auto-indenting. +int QextScintillaLexer::blockLookback() const +{ + return 20; +} + + +// Default implementation to return the characters that make up a word. +const char *QextScintillaLexer::wordCharacters() const +{ + return 0; +} + + +// Default implementation to return the style used for whitespace. +int QextScintillaLexer::defaultStyle() const +{ + return 0; +} + + +// Returns the foreground colour of the text for a style. +QColor QextScintillaLexer::color(int) const +{ + return defaultColor(); +} + + +// Returns the end-of-line fill for a style. +bool QextScintillaLexer::eolFill(int) const +{ + return FALSE; +} + + +// Returns the font for a style. +QFont QextScintillaLexer::font(int) const +{ + return defaultFont(); +} + + +// Returns the set of keywords. +const char *QextScintillaLexer::keywords(int) const +{ + return 0; +} + + +// Returns the background colour of the text for a style. +QColor QextScintillaLexer::paper(int) const +{ + return defaultPaper(); +} + + +// Returns the default font for all styles. +QFont QextScintillaLexer::defaultFont() const +{ + return defFont; +} + + +// Sets the default font for all styles. +void QextScintillaLexer::setDefaultFont(const QFont &f) +{ + defFont = f; +} + + +// Returns the default text colour for all styles. +QColor QextScintillaLexer::defaultColor() const +{ + return defColor; +} + + +// Sets the default text colour for all styles. +void QextScintillaLexer::setDefaultColor(const QColor &c) +{ + defColor = c; +} + + +// Returns the default paper colour for all styles. +QColor QextScintillaLexer::defaultPaper() const +{ + return defPaper; +} + + +// Sets the default paper colour for all styles. +void QextScintillaLexer::setDefaultPaper(const QColor &c) +{ + defPaper = c; +} + + +// Read properties from the settings. +bool QextScintillaLexer::readProperties(QSettings &,const QString &) +{ + return TRUE; +} + + +// Refresh all properties. +void QextScintillaLexer::refreshProperties() +{ +} + + +// Write properties to the settings. +bool QextScintillaLexer::writeProperties(QSettings &,const QString &) const +{ + return TRUE; +} + + +// Restore the user settings. +bool QextScintillaLexer::readSettings(QSettings &qs,const char *prefix) +{ + bool ok, flag, rc = TRUE; + int num; + QString key; + + // Read the styles. + for (int i = 0; i < 128; ++i) + { + // Ignore invalid styles. + if (description(i).isNull()) + continue; + + key.sprintf("%s/%s/style%d/",prefix,language(),i); + + // Read the foreground colour. + num = qs.readNumEntry(key + "color",0,&ok); + + if (ok) + emit colorChanged(QColor((num >> 16) & 0xff,(num >> 8) & 0xff,num & 0xff),i); + else + rc = FALSE; + + // Read the end-of-line fill. + flag = qs.readBoolEntry(key + "eolfill",0,&ok); + + if (ok) + emit eolFillChanged(flag,i); + else + rc = FALSE; + + // Read the font + QStringList fdesc; + + fdesc = qs.readListEntry(key + "font",',',&ok); + + if (ok && fdesc.count() == 5) + { + QFont f; + + f.setFamily(fdesc[0]); + f.setPointSize(fdesc[1].toInt()); + f.setBold(fdesc[2].toInt()); + f.setItalic(fdesc[3].toInt()); + f.setUnderline(fdesc[4].toInt()); + + emit fontChanged(f,i); + } + else + rc = FALSE; + + // Read the background colour. + num = qs.readNumEntry(key + "paper",0,&ok); + + if (ok) + emit paperChanged(QColor((num >> 16) & 0xff,(num >> 8) & 0xff,num & 0xff),i); + else + rc = FALSE; + } + + // Read the properties. + key.sprintf("%s/%s/properties/",prefix,language()); + + if (!readProperties(qs,key)) + rc = FALSE; + + refreshProperties(); + + // Read the rest. + key.sprintf("%s/%s/",prefix,language()); + + num = qs.readNumEntry(key + "autoindentstyle",0,&ok); + + if (ok) + autoIndStyle = num; + else + rc = FALSE; + + return rc; +} + + +// Save the user settings. +bool QextScintillaLexer::writeSettings(QSettings &qs,const char *prefix) const +{ + bool rc = TRUE; + QString key; + + // Write the styles. + for (int i = 0; i < 128; ++i) + { + // Ignore invalid styles. + if (description(i).isNull()) + continue; + + int num; + QColor c; + + key.sprintf("%s/%s/style%d/",prefix,language(),i); + + // Write the foreground colour. + c = color(i); + num = (c.red() << 16) | (c.green() << 8) | c.blue(); + + if (!qs.writeEntry(key + "color",num)) + rc = FALSE; + + // Write the end-of-line fill. + if (!qs.writeEntry(key + "eolfill",eolFill(i))) + rc = FALSE; + + // Write the font + QStringList fdesc; + QString fmt("%1"); + QFont f; + + f = font(i); + + fdesc += f.family(); + fdesc += fmt.arg(f.pointSize()); + + // The casts are for Borland. + fdesc += fmt.arg((int)f.bold()); + fdesc += fmt.arg((int)f.italic()); + fdesc += fmt.arg((int)f.underline()); + + if (!qs.writeEntry(key + "font",fdesc,',')) + rc = FALSE; + + // Write the background colour. + c = paper(i); + num = (c.red() << 16) | (c.green() << 8) | c.blue(); + + if (!qs.writeEntry(key + "paper",num)) + rc = FALSE; + } + + // Write the properties. + key.sprintf("%s/%s/properties/",prefix,language()); + + if (!writeProperties(qs,key)) + rc = FALSE; + + // Write the rest. + key.sprintf("%s/%s/",prefix,language()); + + if (!qs.writeEntry(key + "autoindentstyle",autoIndStyle)) + rc = FALSE; + + return rc; +} + + +// Return the auto-indentation style. +int QextScintillaLexer::autoIndentStyle() +{ + // We can't do this in the ctor because we want the virtuals to work. + if (autoIndStyle < 0) + autoIndStyle = (blockStartKeyword() || blockStart() || blockEnd()) ? + 0 : QextScintilla::AiMaintain; + + return autoIndStyle; +} + + +// Set the auto-indentation style. +void QextScintillaLexer::setAutoIndentStyle(int autoindentstyle) +{ + autoIndStyle = autoindentstyle; +} + + +// Set the foreground colour for a style. +void QextScintillaLexer::setColor(const QColor &c,int style) +{ + if (style >= 0) + emit colorChanged(c,style); + else + for (int i = 0; i < 128; ++i) + if (!description(i).isNull()) + emit colorChanged(c,i); +} + + +// Set the end-of-line fill for a style. +void QextScintillaLexer::setEolFill(bool eolfill,int style) +{ + if (style >= 0) + emit eolFillChanged(eolfill,style); + else + for (int i = 0; i < 128; ++i) + if (!description(i).isNull()) + emit eolFillChanged(eolfill,i); +} + + +// Set the font for a style. +void QextScintillaLexer::setFont(const QFont &f,int style) +{ + if (style >= 0) + emit fontChanged(f,style); + else + for (int i = 0; i < 128; ++i) + if (!description(i).isNull()) + emit fontChanged(f,i); +} + + +// Set the background colour for a style. +void QextScintillaLexer::setPaper(const QColor &c,int style) +{ + if (style >= 0) + emit paperChanged(c,style); + else + { + for (int i = 0; i < 128; ++i) + if (!description(i).isNull()) + emit paperChanged(c,i); + + emit paperChanged(c,QextScintillaBase::STYLE_DEFAULT); + } +} diff --git a/qt/qextscintillalexer.h b/qt/qextscintillalexer.h new file mode 100644 index 0000000..2c4aad6 --- /dev/null +++ b/qt/qextscintillalexer.h @@ -0,0 +1,274 @@ +// This defines the interface to the QextScintillaLexer class. +// +// Copyright (c) 2006 +// Riverbank Computing Limited +// +// This file is part of QScintilla. +// +// This copy of QScintilla is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2, or (at your option) any +// later version. +// +// QScintilla is supplied 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 +// QScintilla; see the file LICENSE. If not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +#ifndef QEXTSCINTILLALEXER_H +#define QEXTSCINTILLALEXER_H + + +#include +#include +#include +#include + +#include + + +class QSettings; + + +//! \brief The QextScintillaLexer class is an abstract class used as a base for +//! specific language lexers. +//! +//! A Scintilla lexer scans the text breaking it up into separate language +//! objects, e.g. keywords, strings, operators. The lexer then uses a +//! different style to draw each object. A style is identified by a style +//! number and has a number of attributes, including colour and font. A +//! specific language lexer will implement appropriate default styles which can +//! be overriden by an application by further sub-classing the specific +//! language lexer. +//! +//! A specific language lexer may provide one or more sets of words to be +//! recognised as keywords. Most lexers only provide one set, but some may +//! support languages embedded in other languages and provide several sets. +//! +//! QextScintillaLexer provides convenience methods for saving and restoring +//! user preferences for fonts and colours. +class QEXTSCINTILLA_EXPORT QextScintillaLexer : public QObject +{ + Q_OBJECT + +public: + //! Construct a QextScintillaLexer with parent \a parent and name + //! \a name. \a parent is typically the QextScintilla instance. + QextScintillaLexer(QObject *parent = 0,const char *name = 0); + + //! Destroys the QextScintillaLexer instance. + virtual ~QextScintillaLexer(); + + //! Returns the name of the language. It must be re-implemented by a + //! sub-class. + virtual const char *language() const = 0; + + //! Returns the name of the lexer. Some lexers support a number of + //! languages. It must be re-implemented by a sub-class. + virtual const char *lexer() const = 0; + + //! \internal Returns the characters that can fill up auto-completion. + //! These are ignored if QextScintilla::setAutoCompletionFillups() has + //! been explicitly called. + virtual const char *autoCompletionFillups() const; + + //! \internal Returns the characters that can start auto-completion. + virtual const char *autoCompletionStartCharacters() const; + + //! Returns the auto-indentation style. The default is 0 if the + //! language is block structured, or QextScintilla::AiMaintain if not. + //! + //! \sa setAutoIndentStyle(), QextScintilla::AiMaintain, + //! QextScintilla::AiOpening, QextScintilla::AiClosing + int autoIndentStyle(); + + //! \internal Returns a space separated list of words or characters in + //! a particular style that define the end of a block for + //! auto-indentation. The style is returned via \a style. + virtual const char *blockEnd(int *style = 0) const; + + //! \internal Returns the number of lines prior to the current one when + //! determining the scope of a block when auto-indenting. + virtual int blockLookback() const; + + //! \internal Returns a space separated list of words or characters in + //! a particular style that define the start of a block for + //! auto-indentation. The style is returned via \a style. + virtual const char *blockStart(int *style = 0) const; + + //! \internal Returns a space separated list of keywords in a + //! particular style that define the start of a block for + //! auto-indentation. The style is returned via \a style. + virtual const char *blockStartKeyword(int *style = 0) const; + + //! \internal Returns the style used for braces for brace matching. + virtual int braceStyle() const; + + //! \internal Returns the string of characters that comprise a word. + //! The default is 0 which implies the upper and lower case alphabetic + //! characters and underscore. + virtual const char *wordCharacters() const; + + //! Returns the foreground colour of the text for style number + //! \a style. The default colour is black. + //! + //! \sa paper() + virtual QColor color(int style) const; + + //! Returns the end-of-line for style number \a style. The default is + //! FALSE. + virtual bool eolFill(int style) const; + + //! Returns the font for style number \a style. The default font is + //! that returned by defaultFont(). + //! + //! \sa defaultFont() + virtual QFont font(int style) const; + + //! Returns the set of keywords for the keyword set \a set recognised + //! by the lexer as a space separated string. 0 is returned if there + //! is no such set. + virtual const char *keywords(int set) const; + + //! \internal Returns the number of the style used for whitespace. The + //! default implementation returns 0 which is the convention adopted by + //! most lexers. + virtual int defaultStyle() const; + + //! Returns the descriptive name for style number \a style. If the + //! style is invalid for this language then QString::null is returned. + //! This is intended to be used in user preference dialogs. + virtual QString description(int style) const = 0; + + //! Returns the background colour of the text for style number + //! \a style. + //! + //! \sa defaultPaper(), color() + virtual QColor paper(int style) const; + + //! Returns the default font for all styles. + //! + //! \sa setDefaultFont() + virtual QFont defaultFont() const; + + //! Returns the default text colour for all styles. + //! + //! \sa setDefaultColor() + virtual QColor defaultColor() const; + + //! Returns the default paper colour for all styles. + //! + //! \sa setDefaultPaper() + virtual QColor defaultPaper() const; + + //! Causes all properties to be refreshed by emitting the + //! propertyChanged() signal as required. + virtual void refreshProperties(); + + //! The colour, paper, font and end-of-line for each style number, and + //! all lexer specific properties are read from the settings \a qs. + //! \a prefix is prepended to the key of each entry. TRUE is returned + //! if there was no error. + //! + //! \sa writeSettings(), QextScintilla::setLexer() + bool readSettings(QSettings &qs,const char *prefix = "/Scintilla"); + + //! The colour, paper, font and end-of-line for each style number, and + //! all lexer specific properties are written to the settings \a qs. + //! \a prefix is prepended to the key of each entry. TRUE is returned + //! if there was no error. + //! + //! \sa readSettings() + bool writeSettings(QSettings &qs, + const char *prefix = "/Scintilla") const; + +public slots: + //! The auto-indentation style is set to \a autoindentstyle. + //! + //! \sa autoIndentStyle(), QextScintilla::AiMaintain, + //! QextScintilla::AiOpening, QextScintilla::AiClosing + virtual void setAutoIndentStyle(int autoindentstyle); + + //! The foreground colour for style number \a style is set to \a c. If + //! \a style is -1 then the colour is set for all styles. + virtual void setColor(const QColor &c,int style = -1); + + //! The default font for all styles is set to \a f. + //! + //! \sa defaultFont() + virtual void setDefaultFont(const QFont &f); + + //! The default text colour for all styles is set to \a c. + //! + //! \sa defaultColor(), color() + virtual void setDefaultColor(const QColor &c); + + //! The default paper colour for all styles is set to \a c. + //! + //! \sa defaultPaper(), paper() + virtual void setDefaultPaper(const QColor &c); + + //! The end-of-line fill for style number \a style is set to + //! \a eoffill. If \a style is -1 then the fill is set for all styles. + virtual void setEolFill(bool eoffill,int style = -1); + + //! The font for style number \a style is set to \a f. If \a style is + //! -1 then the font is set for all styles. + virtual void setFont(const QFont &f,int style = -1); + + //! The background colour for style number \a style is set to \a c. If + //! \a style is -1 then the colour is set for all styles. + virtual void setPaper(const QColor &c,int style = -1); + +signals: + //! This signal is emitted when the foreground colour of style number + //! \a style has changed. The new colour is \a c. + void colorChanged(const QColor &c,int style); + + //! This signal is emitted when the end-of-file fill of style number + //! \a style has changed. The new fill is \a eoffilled. + void eolFillChanged(bool eoffilled,int style); + + //! This signal is emitted when the font of style number \a style has + //! changed. The new font is \a f. + void fontChanged(const QFont &f,int style); + + //! This signal is emitted when the background colour of style number + //! \a style has changed. The new colour is \a c. + void paperChanged(const QColor &c,int style); + + //! This signal is emitted when the value of the lexer property \a prop + //! needs to be changed. The new value is \a val. + void propertyChanged(const char *prop,const char *val); + +protected: + //! The lexer's properties are read from the settings \a qs. \a prefix + //! (which has a trailing '/') should be used as a prefix to the key of + //! each setting. TRUE is returned if there is no error. + //! + virtual bool readProperties(QSettings &qs,const QString &prefix); + + //! The lexer's properties are written to the settings \a qs. + //! \a prefix (which has a trailing '/') should be used as a prefix to + //! the key of each setting. TRUE is returned if there is no error. + //! + virtual bool writeProperties(QSettings &qs,const QString &prefix) const; + +private: + int autoIndStyle; + QFont defFont; + QColor defColor; + QColor defPaper; + +#if defined(Q_DISABLE_COPY) + QextScintillaLexer(const QextScintillaLexer &); + QextScintillaLexer &operator=(const QextScintillaLexer &); +#endif +}; + +#endif diff --git a/qt/qextscintillalexerbash.cpp b/qt/qextscintillalexerbash.cpp new file mode 100644 index 0000000..b5d172b --- /dev/null +++ b/qt/qextscintillalexerbash.cpp @@ -0,0 +1,369 @@ +// This module implements the QextScintillaLexerBash class. +// +// Copyright (c) 2006 +// Riverbank Computing Limited +// +// This file is part of QScintilla. +// +// This copy of QScintilla is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2, or (at your option) any +// later version. +// +// QScintilla is supplied 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 +// QScintilla; see the file LICENSE. If not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +#include +#include +#include + +#include "qextscintillalexerbash.h" + + +// The ctor. +QextScintillaLexerBash::QextScintillaLexerBash(QObject *parent, + const char *name) + : QextScintillaLexer(parent,name), fold_comments(FALSE), + fold_compact(TRUE) +{ +} + + +// The dtor. +QextScintillaLexerBash::~QextScintillaLexerBash() +{ +} + + +// Returns the language name. +const char *QextScintillaLexerBash::language() const +{ + return "Bash"; +} + + +// Returns the lexer name. +const char *QextScintillaLexerBash::lexer() const +{ + return "bash"; +} + + +// Return the style used for braces. +int QextScintillaLexerBash::braceStyle() const +{ + return Operator; +} + + +// Return the string of characters that comprise a word. +const char *QextScintillaLexerBash::wordCharacters() const +{ + return "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_$@%&"; +} + + +// Returns the foreground colour of the text for a style. +QColor QextScintillaLexerBash::color(int style) const +{ + switch (style) + { + case Default: + return QColor(0x80,0x80,0x80); + + case Error: + case Backticks: + return QColor(0xff,0xff,0x00); + + case Comment: + return QColor(0x00,0x7f,0x00); + + case Number: + return QColor(0x00,0x7f,0x7f); + + case Keyword: + return QColor(0x00,0x00,0x7f); + + case DoubleQuotedString: + case SingleQuotedString: + case SingleQuotedHereDocument: + return QColor(0x7f,0x00,0x7f); + + case Operator: + case Identifier: + case Scalar: + case ParameterExpansion: + case HereDocumentDelimiter: + return QColor(0x00,0x00,0x00); + } + + return QextScintillaLexer::color(style); +} + + +// Returns the end-of-line fill for a style. +bool QextScintillaLexerBash::eolFill(int style) const +{ + switch (style) + { + case SingleQuotedHereDocument: + return TRUE; + } + + return FALSE; +} + + +// Returns the font of the text for a style. +QFont QextScintillaLexerBash::font(int style) const +{ + QFont f; + + switch (style) + { + case Comment: +#if defined(Q_OS_WIN) + f = QFont("Comic Sans MS",9); +#else + f = QFont("Bitstream Vera Serif",9); +#endif + break; + + case Keyword: + case Operator: + f = QextScintillaLexer::font(style); + f.setBold(TRUE); + break; + + case DoubleQuotedString: + case SingleQuotedString: +#if defined(Q_OS_WIN) + f = QFont("Courier New",10); +#else + f = QFont("Bitstream Vera Sans Mono",9); +#endif + break; + + default: + f = QextScintillaLexer::font(style); + } + + return f; +} + + +// Returns the set of keywords. +const char *QextScintillaLexerBash::keywords(int set) const +{ + if (set == 1) + return + "alias ar asa awk banner basename bash bc bdiff break " + "bunzip2 bzip2 cal calendar case cat cc cd chmod " + "cksum clear cmp col comm compress continue cp cpio " + "crypt csplit ctags cut date dc dd declare deroff dev " + "df diff diff3 dircmp dirname do done du echo ed " + "egrep elif else env esac eval ex exec exit expand " + "export expr false fc fgrep fi file find fmt fold for " + "function functions getconf getopt getopts grep gres " + "hash head help history iconv id if in integer jobs " + "join kill local lc let line ln logname look ls m4 " + "mail mailx make man mkdir more mt mv newgrp nl nm " + "nohup ntps od pack paste patch pathchk pax pcat perl " + "pg pr print printf ps pwd read readonly red return " + "rev rm rmdir sed select set sh shift size sleep sort " + "spell split start stop strings strip stty sum " + "suspend sync tail tar tee test then time times touch " + "tr trap true tsort tty type typeset ulimit umask " + "unalias uname uncompress unexpand uniq unpack unset " + "until uudecode uuencode vi vim vpax wait wc whence " + "which while who wpaste wstart xargs zcat " + + "chgrp chown chroot dir dircolors factor groups " + "hostid install link md5sum mkfifo mknod nice pinky " + "printenv ptx readlink seq sha1sum shred stat su tac " + "unlink users vdir whoami yes"; + + return 0; +} + + +// Returns the user name of a style. +QString QextScintillaLexerBash::description(int style) const +{ + switch (style) + { + case Default: + return tr("Default"); + + case Error: + return tr("Error"); + + case Comment: + return tr("Comment"); + + case Number: + return tr("Number"); + + case Keyword: + return tr("Keyword"); + + case DoubleQuotedString: + return tr("Double-quoted string"); + + case SingleQuotedString: + return tr("Single-quoted string"); + + case Operator: + return tr("Operator"); + + case Identifier: + return tr("Identifier"); + + case Scalar: + return tr("Scalar"); + + case ParameterExpansion: + return tr("Parameter expansion"); + + case Backticks: + return tr("Backticks"); + + case HereDocumentDelimiter: + return tr("Here document delimiter"); + + case SingleQuotedHereDocument: + return tr("Single-quoted here document"); + } + + return QString::null; +} + + +// Returns the background colour of the text for a style. +QColor QextScintillaLexerBash::paper(int style) const +{ + switch (style) + { + case Error: + return QColor(0xff,0x00,0x00); + + case Scalar: + return QColor(0xff,0xe0,0xe0); + + case ParameterExpansion: + return QColor(0xff,0xff,0xe0); + + case Backticks: + return QColor(0xa0,0x80,0x80); + + case HereDocumentDelimiter: + case SingleQuotedHereDocument: + return QColor(0xdd,0xd0,0xdd); + } + + return QextScintillaLexer::paper(style); +} + + +// Refresh all properties. +void QextScintillaLexerBash::refreshProperties() +{ + setCommentProp(); + setCompactProp(); +} + + +// Read properties from the settings. +bool QextScintillaLexerBash::readProperties(QSettings &qs,const QString &prefix) +{ + int rc = TRUE; + bool ok, flag; + + // Read the fold comments flag. + flag = qs.readBoolEntry(prefix + "foldcomments",FALSE,&ok); + + if (ok) + fold_comments = flag; + else + rc = FALSE; + + // Read the fold compact flag. + flag = qs.readBoolEntry(prefix + "foldcompact",TRUE,&ok); + + if (ok) + fold_compact = flag; + else + rc = FALSE; + + return rc; +} + + +// Write properties to the settings. +bool QextScintillaLexerBash::writeProperties(QSettings &qs,const QString &prefix) const +{ + int rc = TRUE; + + // Write the fold comments flag. + if (!qs.writeEntry(prefix + "foldcomments",fold_comments)) + rc = FALSE; + + // Write the fold compact flag. + if (!qs.writeEntry(prefix + "foldcompact",fold_compact)) + rc = FALSE; + + return rc; +} + + +// Return TRUE if comments can be folded. +bool QextScintillaLexerBash::foldComments() const +{ + return fold_comments; +} + + +// Set if comments can be folded. +void QextScintillaLexerBash::setFoldComments(bool fold) +{ + fold_comments = fold; + + setCommentProp(); +} + + +// Set the "fold.comment" property. +void QextScintillaLexerBash::setCommentProp() +{ + emit propertyChanged("fold.comment",(fold_comments ? "1" : "0")); +} + + +// Return TRUE if folds are compact. +bool QextScintillaLexerBash::foldCompact() const +{ + return fold_compact; +} + + +// Set if folds are compact +void QextScintillaLexerBash::setFoldCompact(bool fold) +{ + fold_compact = fold; + + setCompactProp(); +} + + +// Set the "fold.compact" property. +void QextScintillaLexerBash::setCompactProp() +{ + emit propertyChanged("fold.compact",(fold_compact ? "1" : "0")); +} diff --git a/qt/qextscintillalexerbash.h b/qt/qextscintillalexerbash.h new file mode 100644 index 0000000..344aac7 --- /dev/null +++ b/qt/qextscintillalexerbash.h @@ -0,0 +1,189 @@ +// This defines the interface to the QextScintillaLexerBash class. +// +// Copyright (c) 2006 +// Riverbank Computing Limited +// +// This file is part of QScintilla. +// +// This copy of QScintilla is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2, or (at your option) any +// later version. +// +// QScintilla is supplied 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 +// QScintilla; see the file LICENSE. If not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +#ifndef QEXTSCINTILLALEXERBASH_H +#define QEXTSCINTILLALEXERBASH_H + + +#include + +#include +#include + + +//! \brief The QextScintillaLexerBash class encapsulates the Scintilla Bash +//! lexer. +class QEXTSCINTILLA_EXPORT QextScintillaLexerBash : public QextScintillaLexer +{ + Q_OBJECT + +public: + //! This enum defines the meanings of the different styles used by the + //! Bash lexer. + enum { + //! The default. + Default = 0, + + //! \deprecated White space. + WhiteSpace = Default, + + //! An error. + Error = 1, + + //! A comment. + Comment = 2, + + //! A number. + Number = 3, + + //! A keyword. + Keyword = 4, + + //! A double-quoted string. + DoubleQuotedString = 5, + + //! A single-quoted string. + SingleQuotedString = 6, + + //! An operator. + Operator = 7, + + //! An identifier + Identifier = 8, + + //! A scalar. + Scalar = 9, + + //! Parameter expansion. + ParameterExpansion = 10, + + //! Backticks. + Backticks = 11, + + //! A here document delimiter. + HereDocumentDelimiter = 12, + + //! A single quoted here document. + SingleQuotedHereDocument = 13 + }; + + //! Construct a QextScintillaLexerBash with parent \a parent and name + //! \a name. \a parent is typically the QextScintilla instance. + QextScintillaLexerBash(QObject *parent = 0,const char *name = 0); + + //! Destroys the QextScintillaLexerBash instance. + virtual ~QextScintillaLexerBash(); + + //! Returns the name of the language. + const char *language() const; + + //! Returns the name of the lexer. Some lexers support a number of + //! languages. + const char *lexer() const; + + //! \internal Returns the style used for braces for brace matching. + int braceStyle() const; + + //! \internal Returns the string of characters that comprise a word. + const char *wordCharacters() const; + + //! Returns the foreground colour of the text for style number + //! \a style. + //! + //! \sa paper() + QColor color(int style) const; + + //! Returns the end-of-line fill for style number \a style. + bool eolFill(int style) const; + + //! Returns the font for style number \a style. + QFont font(int style) const; + + //! Returns the set of keywords for the keyword set \a set recognised + //! by the lexer as a space separated string. + const char *keywords(int set) const; + + //! Returns the descriptive name for style number \a style. If the + //! style is invalid for this language then QString::null is returned. + //! This is intended to be used in user preference dialogs. + QString description(int style) const; + + //! Returns the background colour of the text for style number + //! \a style. + //! + //! \sa color() + QColor paper(int style) const; + + //! Causes all properties to be refreshed by emitting the + //! propertyChanged() signal as required. + void refreshProperties(); + + //! Returns TRUE if multi-line comment blocks can be folded. + //! + //! \sa setFoldComments() + bool foldComments() const; + + //! Returns TRUE if trailing blank lines are included in a fold block. + //! + //! \sa setFoldCompact() + bool foldCompact() const; + +public slots: + //! If \a fold is TRUE then multi-line comment blocks can be folded. + //! The default is FALSE. + //! + //! \sa foldComments() + virtual void setFoldComments(bool fold); + + //! If \a fold is TRUE then trailing blank lines are included in a fold + //! block. The default is TRUE. + //! + //! \sa foldCompact() + virtual void setFoldCompact(bool fold); + +protected: + //! The lexer's properties are read from the settings \a qs. \a prefix + //! (which has a trailing '/') should be used as a prefix to the key of + //! each setting. TRUE is returned if there is no error. + //! + bool readProperties(QSettings &qs,const QString &prefix); + + //! The lexer's properties are written to the settings \a qs. + //! \a prefix (which has a trailing '/') should be used as a prefix to + //! the key of each setting. TRUE is returned if there is no error. + //! + bool writeProperties(QSettings &qs,const QString &prefix) const; + +private: + void setCommentProp(); + void setCompactProp(); + + bool fold_comments; + bool fold_compact; + +#if defined(Q_DISABLE_COPY) + QextScintillaLexerBash(const QextScintillaLexerBash &); + QextScintillaLexerBash &operator=(const QextScintillaLexerBash &); +#endif +}; + +#endif diff --git a/qt/qextscintillalexerbatch.cpp b/qt/qextscintillalexerbatch.cpp new file mode 100644 index 0000000..57a9418 --- /dev/null +++ b/qt/qextscintillalexerbatch.cpp @@ -0,0 +1,198 @@ +// This module implements the QextScintillaLexerBatch class. +// +// Copyright (c) 2006 +// Riverbank Computing Limited +// +// This file is part of QScintilla. +// +// This copy of QScintilla is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2, or (at your option) any +// later version. +// +// QScintilla is supplied 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 +// QScintilla; see the file LICENSE. If not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +#include +#include +#include + +#include "qextscintillalexerbatch.h" + + +// The ctor. +QextScintillaLexerBatch::QextScintillaLexerBatch(QObject *parent, + const char *name) + : QextScintillaLexer(parent,name) +{ +} + + +// The dtor. +QextScintillaLexerBatch::~QextScintillaLexerBatch() +{ +} + + +// Returns the language name. +const char *QextScintillaLexerBatch::language() const +{ + return "Batch"; +} + + +// Returns the lexer name. +const char *QextScintillaLexerBatch::lexer() const +{ + return "batch"; +} + + +// Return the string of characters that comprise a word. +const char *QextScintillaLexerBatch::wordCharacters() const +{ + return "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-"; +} + + +// Returns the foreground colour of the text for a style. +QColor QextScintillaLexerBatch::color(int style) const +{ + switch (style) + { + case Default: + case Operator: + return QColor(0x00,0x00,0x00); + + case Comment: + return QColor(0x00,0x7f,0x00); + + case Keyword: + case ExternalCommand: + return QColor(0x00,0x00,0x7f); + + case Label: + return QColor(0x7f,0x00,0x7f); + + case HideCommandChar: + return QColor(0x7f,0x7f,0x00); + + case Variable: + return QColor(0x80,0x00,0x80); + } + + return QextScintillaLexer::color(style); +} + + +// Returns the end-of-line fill for a style. +bool QextScintillaLexerBatch::eolFill(int style) const +{ + return (style == Label); +} + + +// Returns the font of the text for a style. +QFont QextScintillaLexerBatch::font(int style) const +{ + QFont f; + + switch (style) + { + case Comment: +#if defined(Q_OS_WIN) + f = QFont("Comic Sans MS",9); +#else + f = QFont("Bitstream Vera Serif",9); +#endif + break; + + case Keyword: + f = QextScintillaLexer::font(style); + f.setBold(TRUE); + break; + + case ExternalCommand: +#if defined(Q_OS_WIN) + f = QFont("Courier New",10); +#else + f = QFont("Bitstream Vera Sans Mono",9); +#endif + f.setBold(TRUE); + break; + + default: + f = QextScintillaLexer::font(style); + } + + return f; +} + + +// Returns the set of keywords. +const char *QextScintillaLexerBatch::keywords(int set) const +{ + if (set == 1) + return + "rem set if exist errorlevel for in do break call " + "chcp cd chdir choice cls country ctty date del " + "erase dir echo exit goto loadfix loadhigh mkdir md " + "move path pause prompt rename ren rmdir rd shift " + "time type ver verify vol com con lpt nul"; + + return 0; +} + + +// Returns the user name of a style. +QString QextScintillaLexerBatch::description(int style) const +{ + switch (style) + { + case Default: + return tr("Default"); + + case Comment: + return tr("Comment"); + + case Keyword: + return tr("Keyword"); + + case Label: + return tr("Label"); + + case HideCommandChar: + return tr("Hide command character"); + + case ExternalCommand: + return tr("External command"); + + case Variable: + return tr("Variable"); + + case Operator: + return tr("Operator"); + } + + return QString::null; +} + + +// Returns the background colour of the text for a style. +QColor QextScintillaLexerBatch::paper(int style) const +{ + switch (style) + { + case Label: + return QColor(0x60,0x60,0x60); + } + + return QextScintillaLexer::paper(style); +} diff --git a/qt/qextscintillalexerbatch.h b/qt/qextscintillalexerbatch.h new file mode 100644 index 0000000..517edfb --- /dev/null +++ b/qt/qextscintillalexerbatch.h @@ -0,0 +1,119 @@ +// This defines the interface to the QextScintillaLexerBatch class. +// +// Copyright (c) 2006 +// Riverbank Computing Limited +// +// This file is part of QScintilla. +// +// This copy of QScintilla is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2, or (at your option) any +// later version. +// +// QScintilla is supplied 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 +// QScintilla; see the file LICENSE. If not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +#ifndef QEXTSCINTILLALEXERBATCH_H +#define QEXTSCINTILLALEXERBATCH_H + + +#include + +#include +#include + + +//! \brief The QextScintillaLexerBatch class encapsulates the Scintilla batch +//! file lexer. +class QEXTSCINTILLA_EXPORT QextScintillaLexerBatch : public QextScintillaLexer +{ + Q_OBJECT + +public: + //! This enum defines the meanings of the different styles used by the + //! batch file lexer. + enum { + //! The default. + Default = 0, + + //! A comment. + Comment = 1, + + //! A keyword. + Keyword = 2, + + //! A label. + Label = 3, + + //! An hide command character. + HideCommandChar = 4, + + //! An external command . + ExternalCommand = 5, + + //! A variable. + Variable = 6, + + //! An operator + Operator = 7 + }; + + //! Construct a QextScintillaLexerBatch with parent \a parent and name + //! \a name. \a parent is typically the QextScintilla instance. + QextScintillaLexerBatch(QObject *parent = 0,const char *name = 0); + + //! Destroys the QextScintillaLexerBatch instance. + virtual ~QextScintillaLexerBatch(); + + //! Returns the name of the language. + const char *language() const; + + //! Returns the name of the lexer. Some lexers support a number of + //! languages. + const char *lexer() const; + + //! \internal Returns the string of characters that comprise a word. + const char *wordCharacters() const; + + //! Returns the foreground colour of the text for style number + //! \a style. + //! + //! \sa paper() + QColor color(int style) const; + + //! Returns the end-of-line fill for style number \a style. + bool eolFill(int style) const; + + //! Returns the font for style number \a style. + QFont font(int style) const; + + //! Returns the set of keywords for the keyword set \a set recognised + //! by the lexer as a space separated string. + const char *keywords(int set) const; + + //! Returns the descriptive name for style number \a style. If the + //! style is invalid for this language then QString::null is returned. + //! This is intended to be used in user preference dialogs. + QString description(int style) const; + + //! Returns the background colour of the text for style number + //! \a style. + //! + //! \sa color() + QColor paper(int style) const; + +private: +#if defined(Q_DISABLE_COPY) + QextScintillaLexerBatch(const QextScintillaLexerBatch &); + QextScintillaLexerBatch &operator=(const QextScintillaLexerBatch &); +#endif +}; + +#endif diff --git a/qt/qextscintillalexercpp.cpp b/qt/qextscintillalexercpp.cpp new file mode 100644 index 0000000..706d86b --- /dev/null +++ b/qt/qextscintillalexercpp.cpp @@ -0,0 +1,515 @@ +// This module implements the QextScintillaLexerCPP class. +// +// Copyright (c) 2006 +// Riverbank Computing Limited +// +// This file is part of QScintilla. +// +// This copy of QScintilla is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2, or (at your option) any +// later version. +// +// QScintilla is supplied 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 +// QScintilla; see the file LICENSE. If not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +#include +#include +#include + +#include "qextscintillalexercpp.h" + + +// The ctor. +QextScintillaLexerCPP::QextScintillaLexerCPP(QObject *parent,const char *name, + bool caseInsensitiveKeywords) + : QextScintillaLexer(parent,name), fold_atelse(FALSE), + fold_comments(FALSE), fold_compact(TRUE), fold_preproc(TRUE), + style_preproc(FALSE), nocase(caseInsensitiveKeywords) +{ +} + + +// The dtor. +QextScintillaLexerCPP::~QextScintillaLexerCPP() +{ +} + + +// Returns the language name. +const char *QextScintillaLexerCPP::language() const +{ + return "C++"; +} + + +// Returns the lexer name. +const char *QextScintillaLexerCPP::lexer() const +{ + return (nocase ? "cppnocase" : "cpp"); +} + + +// Return the list of keywords that can start a block. +const char *QextScintillaLexerCPP::blockStartKeyword(int *style) const +{ + if (style) + *style = Keyword; + + return "case catch class default do else finally for if private " + "protected public struct try union while"; +} + + +// Return the list of characters that can start a block. +const char *QextScintillaLexerCPP::blockStart(int *style) const +{ + if (style) + *style = Operator; + + return "{"; +} + + +// Return the list of characters that can end a block. +const char *QextScintillaLexerCPP::blockEnd(int *style) const +{ + if (style) + *style = Operator; + + return "}"; +} + + +// Return the style used for braces. +int QextScintillaLexerCPP::braceStyle() const +{ + return Operator; +} + + +// Return the string of characters that comprise a word. +const char *QextScintillaLexerCPP::wordCharacters() const +{ + return "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_#"; +} + + +// Returns the foreground colour of the text for a style. +QColor QextScintillaLexerCPP::color(int style) const +{ + switch (style) + { + case Default: + return QColor(0x80,0x80,0x80); + + case Comment: + case CommentLine: + return QColor(0x00,0x7f,0x00); + + case CommentDoc: + case CommentLineDoc: + return QColor(0x3f,0x70,0x3f); + + case Number: + return QColor(0x00,0x7f,0x7f); + + case Keyword: + return QColor(0x00,0x00,0x7f); + + case DoubleQuotedString: + case SingleQuotedString: + return QColor(0x7f,0x00,0x7f); + + case PreProcessor: + return QColor(0x7f,0x7f,0x00); + + case Operator: + case UnclosedString: + return QColor(0x00,0x00,0x00); + + case Identifier: + break; + + case Regex: + return QColor(0x3f,0x7f,0x3f); + + case CommentDocKeyword: + return QColor(0x30,0x60,0xa0); + + case CommentDocKeywordError: + return QColor(0x80,0x40,0x20); + } + + return QextScintillaLexer::color(style); +} + + +// Returns the end-of-line fill for a style. +bool QextScintillaLexerCPP::eolFill(int style) const +{ + return (style == UnclosedString); +} + + +// Returns the font of the text for a style. +QFont QextScintillaLexerCPP::font(int style) const +{ + QFont f; + + switch (style) + { + case Comment: + case CommentLine: + case CommentDoc: + case CommentLineDoc: + case CommentDocKeyword: + case CommentDocKeywordError: +#if defined(Q_OS_WIN) + f = QFont("Comic Sans MS",9); +#else + f = QFont("Bitstream Vera Serif",9); +#endif + break; + + case Keyword: + case Operator: + f = QextScintillaLexer::font(style); + f.setBold(TRUE); + break; + + case DoubleQuotedString: + case SingleQuotedString: + case UnclosedString: +#if defined(Q_OS_WIN) + f = QFont("Courier New",10); +#else + f = QFont("Bitstream Vera Sans Mono",9); +#endif + break; + + default: + f = QextScintillaLexer::font(style); + } + + return f; +} + + +// Returns the set of keywords. +const char *QextScintillaLexerCPP::keywords(int set) const +{ + if (set == 1) + return + "and and_eq asm auto bitand bitor bool break case " + "catch char class compl const const_cast continue " + "default delete do double dynamic_cast else enum " + "explicit export extern false float for friend goto if " + "inline int long mutable namespace new not not_eq " + "operator or or_eq private protected public register " + "reinterpret_cast return short signed sizeof static " + "static_cast struct switch template this throw true " + "try typedef typeid typename union unsigned using " + "virtual void volatile wchar_t while xor xor_eq"; + + if (set == 3) + return + "a addindex addtogroup anchor arg attention author b " + "brief bug c class code date def defgroup deprecated " + "dontinclude e em endcode endhtmlonly endif " + "endlatexonly endlink endverbatim enum example " + "exception f$ f[ f] file fn hideinitializer " + "htmlinclude htmlonly if image include ingroup " + "internal invariant interface latexonly li line link " + "mainpage name namespace nosubgrouping note overload " + "p page par param post pre ref relates remarks return " + "retval sa section see showinitializer since skip " + "skipline struct subsection test throw todo typedef " + "union until var verbatim verbinclude version warning " + "weakgroup $ @ \\ & < > # { }"; + + return 0; +} + + +// Returns the user name of a style. +QString QextScintillaLexerCPP::description(int style) const +{ + switch (style) + { + case Default: + return tr("Default"); + + case Comment: + return tr("C comment"); + + case CommentLine: + return tr("C++ comment"); + + case CommentDoc: + return tr("JavaDoc style C comment"); + + case Number: + return tr("Number"); + + case Keyword: + return tr("Keyword"); + + case DoubleQuotedString: + return tr("Double-quoted string"); + + case SingleQuotedString: + return tr("Single-quoted string"); + + case PreProcessor: + return tr("Pre-processor block"); + + case Operator: + return tr("Operator"); + + case Identifier: + return tr("Identifier"); + + case UnclosedString: + return tr("Unclosed string"); + + case CommentLineDoc: + return tr("JavaDoc style C++ comment"); + + case KeywordSet2: + return tr("Secondary keywords and identifiers"); + + case CommentDocKeyword: + return tr("JavaDoc keyword"); + + case CommentDocKeywordError: + return tr("JavaDoc keyword error"); + + case GlobalClass: + return tr("Global classes and typedefs"); + } + + return QString::null; +} + + +// Returns the background colour of the text for a style. +QColor QextScintillaLexerCPP::paper(int style) const +{ + if (style == UnclosedString) + return QColor(0xe0,0xc0,0xe0); + + return QextScintillaLexer::paper(style); +} + + +// Refresh all properties. +void QextScintillaLexerCPP::refreshProperties() +{ + setAtElseProp(); + setCommentProp(); + setCompactProp(); + setPreprocProp(); + setStylePreprocProp(); +} + + +// Read properties from the settings. +bool QextScintillaLexerCPP::readProperties(QSettings &qs,const QString &prefix) +{ + int rc = TRUE; + bool ok, flag; + + // Read the fold at else flag. + flag = qs.readBoolEntry(prefix + "foldatelse",FALSE,&ok); + + if (ok) + fold_atelse = flag; + else + rc = FALSE; + + // Read the fold comments flag. + flag = qs.readBoolEntry(prefix + "foldcomments",FALSE,&ok); + + if (ok) + fold_comments = flag; + else + rc = FALSE; + + // Read the fold compact flag. + flag = qs.readBoolEntry(prefix + "foldcompact",TRUE,&ok); + + if (ok) + fold_compact = flag; + else + rc = FALSE; + + // Read the fold preprocessor flag. + flag = qs.readBoolEntry(prefix + "foldpreprocessor",TRUE,&ok); + + if (ok) + fold_preproc = flag; + else + rc = FALSE; + + // Read the style preprocessor flag. + flag = qs.readBoolEntry(prefix + "stylepreprocessor",FALSE,&ok); + + if (ok) + style_preproc = flag; + else + rc = FALSE; + + return rc; +} + + +// Write properties to the settings. +bool QextScintillaLexerCPP::writeProperties(QSettings &qs,const QString &prefix) const +{ + int rc = TRUE; + + // Write the fold at else flag. + if (!qs.writeEntry(prefix + "foldatelse",fold_atelse)) + rc = FALSE; + + // Write the fold comments flag. + if (!qs.writeEntry(prefix + "foldcomments",fold_comments)) + rc = FALSE; + + // Write the fold compact flag. + if (!qs.writeEntry(prefix + "foldcompact",fold_compact)) + rc = FALSE; + + // Write the fold preprocessor flag. + if (!qs.writeEntry(prefix + "foldpreprocessor",fold_preproc)) + rc = FALSE; + + // Write the style preprocessor flag. + if (!qs.writeEntry(prefix + "stylepreprocessor",style_preproc)) + rc = FALSE; + + return rc; +} + + +// Return TRUE if else can be folded. +bool QextScintillaLexerCPP::foldAtElse() const +{ + return fold_atelse; +} + + +// Set if else can be folded. +void QextScintillaLexerCPP::setFoldAtElse(bool fold) +{ + fold_atelse = fold; + + setAtElseProp(); +} + + +// Set the "fold.at.else" property. +void QextScintillaLexerCPP::setAtElseProp() +{ + emit propertyChanged("fold.at.else",(fold_atelse ? "1" : "0")); +} + + +// Return TRUE if comments can be folded. +bool QextScintillaLexerCPP::foldComments() const +{ + return fold_comments; +} + + +// Set if comments can be folded. +void QextScintillaLexerCPP::setFoldComments(bool fold) +{ + fold_comments = fold; + + setCommentProp(); +} + + +// Set the "fold.comment" property. +void QextScintillaLexerCPP::setCommentProp() +{ + emit propertyChanged("fold.comment",(fold_comments ? "1" : "0")); +} + + +// Return TRUE if folds are compact. +bool QextScintillaLexerCPP::foldCompact() const +{ + return fold_compact; +} + + +// Set if folds are compact +void QextScintillaLexerCPP::setFoldCompact(bool fold) +{ + fold_compact = fold; + + setCompactProp(); +} + + +// Set the "fold.compact" property. +void QextScintillaLexerCPP::setCompactProp() +{ + emit propertyChanged("fold.compact",(fold_compact ? "1" : "0")); +} + + +// Return TRUE if preprocessor blocks can be folded. +bool QextScintillaLexerCPP::foldPreprocessor() const +{ + return fold_preproc; +} + + +// Set if preprocessor blocks can be folded. +void QextScintillaLexerCPP::setFoldPreprocessor(bool fold) +{ + fold_preproc = fold; + + setPreprocProp(); +} + + +// Set the "fold.preprocessor" property. +void QextScintillaLexerCPP::setPreprocProp() +{ + emit propertyChanged("fold.preprocessor",(fold_preproc ? "1" : "0")); +} + + +// Return TRUE if preprocessor lines are styled. +bool QextScintillaLexerCPP::stylePreprocessor() const +{ + return style_preproc; +} + + +// Set if preprocessor lines are styled. +void QextScintillaLexerCPP::setStylePreprocessor(bool style) +{ + style_preproc = style; + + setStylePreprocProp(); +} + + +// Set the "style.within.preprocessor" property. +void QextScintillaLexerCPP::setStylePreprocProp() +{ + emit propertyChanged("style.within.preprocessor",(style_preproc ? "1" : "0")); +} diff --git a/qt/qextscintillalexercpp.h b/qt/qextscintillalexercpp.h new file mode 100644 index 0000000..01c7157 --- /dev/null +++ b/qt/qextscintillalexercpp.h @@ -0,0 +1,273 @@ +// This defines the interface to the QextScintillaLexerCPP class. +// +// Copyright (c) 2006 +// Riverbank Computing Limited +// +// This file is part of QScintilla. +// +// This copy of QScintilla is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2, or (at your option) any +// later version. +// +// QScintilla is supplied 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 +// QScintilla; see the file LICENSE. If not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +#ifndef QEXTSCINTILLALEXERCPP_H +#define QEXTSCINTILLALEXERCPP_H + + +#include + +#include +#include + + +//! \brief The QextScintillaLexerCPP class encapsulates the Scintilla C++ +//! lexer. +class QEXTSCINTILLA_EXPORT QextScintillaLexerCPP : public QextScintillaLexer +{ + Q_OBJECT + +public: + //! This enum defines the meanings of the different styles used by the + //! C++ lexer. + enum { + //! The default. + Default = 0, + + //! \deprecated White space. + WhiteSpace = Default, + + //! A C comment. + Comment = 1, + + //! A C++ comment line. + CommentLine = 2, + + //! A JavaDoc/Doxygen style C comment. + CommentDoc = 3, + + //! A number. + Number = 4, + + //! A keyword. + Keyword = 5, + + //! A double-quoted string. + DoubleQuotedString = 6, + + //! A single-quoted string. + SingleQuotedString = 7, + + //! An IDL UUID. + UUID = 8, + + //! A pre-processor block. + PreProcessor = 9, + + //! An operator. + Operator = 10, + + //! An identifier + Identifier = 11, + + //! The end of a line where a string is not closed. + UnclosedString = 12, + + //! A C# verbatim string. + VerbatimString = 13, + + //! A JavaScript regular expression. + Regex = 14, + + //! A JavaDoc/Doxygen style C++ comment line. + CommentLineDoc = 15, + + //! A keyword defined in keyword set number 2. The class must + //! be sub-classed and re-implement keywords() to make use of + //! this style. + KeywordSet2 = 16, + + //! A JavaDoc/Doxygen keyword. + CommentDocKeyword = 17, + + //! A JavaDoc/Doxygen keyword error. + CommentDocKeywordError = 18, + + //! A global class or typedef defined in keyword set number 4. + //! The class must be sub-classed and re-implement keywords() + //! to make use of this style. + GlobalClass = 19 + }; + + //! Construct a QextScintillaLexerCPP with parent \a parent and name + //! \a name. \a parent is typically the QextScintilla instance. + //! \a caseInsensitiveKeywords is TRUE if the lexer ignores the case of + //! keywords. + QextScintillaLexerCPP(QObject *parent = 0,const char *name = 0, + bool caseInsensitiveKeywords = FALSE); + + //! Destroys the QextScintillaLexerCPP instance. + virtual ~QextScintillaLexerCPP(); + + //! Returns the name of the language. + const char *language() const; + + //! Returns the name of the lexer. Some lexers support a number of + //! languages. + const char *lexer() const; + + //! \internal Returns a space separated list of words or characters in + //! a particular style that define the end of a block for + //! auto-indentation. The styles is returned via \a style. + const char *blockEnd(int *style = 0) const; + + //! \internal Returns a space separated list of words or characters in + //! a particular style that define the start of a block for + //! auto-indentation. The styles is returned via \a style. + const char *blockStart(int *style = 0) const; + + //! \internal Returns a space separated list of keywords in a + //! particular style that define the start of a block for + //! auto-indentation. The styles is returned via \a style. + const char *blockStartKeyword(int *style = 0) const; + + //! \internal Returns the style used for braces for brace matching. + int braceStyle() const; + + //! \internal Returns the string of characters that comprise a word. + const char *wordCharacters() const; + + //! Returns the foreground colour of the text for style number + //! \a style. + //! + //! \sa paper() + QColor color(int style) const; + + //! Returns the end-of-line fill for style number \a style. + bool eolFill(int style) const; + + //! Returns the font for style number \a style. + QFont font(int style) const; + + //! Returns the set of keywords for the keyword set \a set recognised + //! by the lexer as a space separated string. + const char *keywords(int set) const; + + //! Returns the descriptive name for style number \a style. If the + //! style is invalid for this language then QString::null is returned. + //! This is intended to be used in user preference dialogs. + QString description(int style) const; + + //! Returns the background colour of the text for style number + //! \a style. + //! + //! \sa color() + QColor paper(int style) const; + + //! Causes all properties to be refreshed by emitting the + //! propertyChanged() signal as required. + void refreshProperties(); + + //! Returns TRUE if "} else {" lines can be folded. + //! + //! \sa setFoldAtElse() + bool foldAtElse() const; + + //! Returns TRUE if multi-line comment blocks can be folded. + //! + //! \sa setFoldComments() + bool foldComments() const; + + //! Returns TRUE if trailing blank lines are included in a fold block. + //! + //! \sa setFoldCompact() + bool foldCompact() const; + + //! Returns TRUE if preprocessor blocks can be folded. + //! + //! \sa setFoldPreprocessor() + bool foldPreprocessor() const; + + //! Returns TRUE if preprocessor lines (after the preprocessor + //! directive) are styled. + //! + //! \sa setStylePreprocessor() + bool stylePreprocessor() const; + +public slots: + //! If \a fold is TRUE then "} else {" lines can be folded. The + //! default is FALSE. + //! + //! \sa foldAtElse() + virtual void setFoldAtElse(bool fold); + + //! If \a fold is TRUE then multi-line comment blocks can be folded. + //! The default is FALSE. + //! + //! \sa foldComments() + virtual void setFoldComments(bool fold); + + //! If \a fold is TRUE then trailing blank lines are included in a fold + //! block. The default is TRUE. + //! + //! \sa foldCompact() + virtual void setFoldCompact(bool fold); + + //! If \a fold is TRUE then preprocessor blocks can be folded. The + //! default is TRUE. + //! + //! \sa foldPreprocessor() + virtual void setFoldPreprocessor(bool fold); + + //! If \a style is TRUE then preprocessor lines (after the preprocessor + //! directive) are styled. The default is FALSE. + //! + //! \sa stylePreprocessor() + virtual void setStylePreprocessor(bool style); + +protected: + //! The lexer's properties are read from the settings \a qs. \a prefix + //! (which has a trailing '/') should be used as a prefix to the key of + //! each setting. TRUE is returned if there is no error. + //! + //! \sa writeProperties() + bool readProperties(QSettings &qs,const QString &prefix); + + //! The lexer's properties are written to the settings \a qs. + //! \a prefix (which has a trailing '/') should be used as a prefix to + //! the key of each setting. TRUE is returned if there is no error. + //! + //! \sa readProperties() + bool writeProperties(QSettings &qs,const QString &prefix) const; + +private: + void setAtElseProp(); + void setCommentProp(); + void setCompactProp(); + void setPreprocProp(); + void setStylePreprocProp(); + + bool fold_atelse; + bool fold_comments; + bool fold_compact; + bool fold_preproc; + bool style_preproc; + + bool nocase; + +#if defined(Q_DISABLE_COPY) + QextScintillaLexerCPP(const QextScintillaLexerCPP &); + QextScintillaLexerCPP &operator=(const QextScintillaLexerCPP &); +#endif +}; + +#endif diff --git a/qt/qextscintillalexercsharp.cpp b/qt/qextscintillalexercsharp.cpp new file mode 100644 index 0000000..7a8a21c --- /dev/null +++ b/qt/qextscintillalexercsharp.cpp @@ -0,0 +1,118 @@ +// This module implements the QextScintillaLexerCSharp class. +// +// Copyright (c) 2006 +// Riverbank Computing Limited +// +// This file is part of QScintilla. +// +// This copy of QScintilla is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2, or (at your option) any +// later version. +// +// QScintilla is supplied 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 +// QScintilla; see the file LICENSE. If not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +#include +#include + +#include "qextscintillalexercsharp.h" + + +// The ctor. +QextScintillaLexerCSharp::QextScintillaLexerCSharp(QObject *parent,const char *name) + : QextScintillaLexerCPP(parent,name) +{ +} + + +// The dtor. +QextScintillaLexerCSharp::~QextScintillaLexerCSharp() +{ +} + + +// Returns the language name. +const char *QextScintillaLexerCSharp::language() const +{ + return "C#"; +} + + +// Returns the foreground colour of the text for a style. +QColor QextScintillaLexerCSharp::color(int style) const +{ + if (style == VerbatimString) + return QColor(0x00,0x7f,0x00); + + return QextScintillaLexerCPP::color(style); +} + + +// Returns the end-of-line fill for a style. +bool QextScintillaLexerCSharp::eolFill(int style) const +{ + if (style == VerbatimString) + return TRUE; + + return QextScintillaLexerCPP::eolFill(style); +} + + +// Returns the font of the text for a style. +QFont QextScintillaLexerCSharp::font(int style) const +{ + if (style == VerbatimString) +#if defined(Q_OS_WIN) + return QFont("Courier New",10); +#else + return QFont("Bitstream Vera Sans Mono",9); +#endif + + return QextScintillaLexerCPP::font(style); +} + + +// Returns the set of keywords. +const char *QextScintillaLexerCSharp::keywords(int set) const +{ + if (set != 1) + return 0; + + return "abstract as base bool break byte case catch char checked " + "class const continue decimal default delegate do double else " + "enum event explicit extern false finally fixed float for " + "foreach goto if implicit in int interface internal is lock " + "long namespace new null object operator out override params " + "private protected public readonly ref return sbyte sealed " + "short sizeof stackalloc static string struct switch this " + "throw true try typeof uint ulong unchecked unsafe ushort " + "using virtual void while"; +} + + +// Returns the user name of a style. +QString QextScintillaLexerCSharp::description(int style) const +{ + if (style == VerbatimString) + return tr("Verbatim string"); + + return QextScintillaLexerCPP::description(style); +} + + +// Returns the background colour of the text for a style. +QColor QextScintillaLexerCSharp::paper(int style) const +{ + if (style == VerbatimString) + return QColor(0xe0,0xff,0xe0); + + return QextScintillaLexer::paper(style); +} diff --git a/qt/qextscintillalexercsharp.h b/qt/qextscintillalexercsharp.h new file mode 100644 index 0000000..97224e1 --- /dev/null +++ b/qt/qextscintillalexercsharp.h @@ -0,0 +1,84 @@ +// This defines the interface to the QextScintillaLexerCSharp class. +// +// Copyright (c) 2006 +// Riverbank Computing Limited +// +// This file is part of QScintilla. +// +// This copy of QScintilla is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2, or (at your option) any +// later version. +// +// QScintilla is supplied 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 +// QScintilla; see the file LICENSE. If not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +#ifndef QEXTSCINTILLALEXERCSHARP_H +#define QEXTSCINTILLALEXERCSHARP_H + + +#include + +#include +#include + + +//! \brief The QextScintillaLexerCSharp class encapsulates the Scintilla C# +//! lexer. +class QEXTSCINTILLA_EXPORT QextScintillaLexerCSharp : public QextScintillaLexerCPP +{ + Q_OBJECT + +public: + //! Construct a QextScintillaLexerCSharp with parent \a parent and name + //! \a name. \a parent is typically the QextScintilla instance. + QextScintillaLexerCSharp(QObject *parent = 0,const char *name = 0); + + //! Destroys the QextScintillaLexerCSharp instance. + virtual ~QextScintillaLexerCSharp(); + + //! Returns the name of the language. + const char *language() const; + + //! Returns the foreground colour of the text for style number + //! \a style. + //! + //! \sa paper() + QColor color(int style) const; + + //! Returns the end-of-line fill for style number \a style. + bool eolFill(int style) const; + + //! Returns the font for style number \a style. + QFont font(int style) const; + + //! Returns the set of keywords for the keyword set \a set recognised + //! by the lexer as a space separated string. + const char *keywords(int set) const; + + //! Returns the descriptive name for style number \a style. If the + //! style is invalid for this language then QString::null is returned. + //! This is intended to be used in user preference dialogs. + QString description(int style) const; + + //! Returns the background colour of the text for style number + //! \a style. + //! + //! \sa color() + QColor paper(int style) const; + +private: +#if defined(Q_DISABLE_COPY) + QextScintillaLexerCSharp(const QextScintillaLexerCSharp &); + QextScintillaLexerCSharp &operator=(const QextScintillaLexerCSharp &); +#endif +}; + +#endif diff --git a/qt/qextscintillalexercss.cpp b/qt/qextscintillalexercss.cpp new file mode 100644 index 0000000..f2e57d9 --- /dev/null +++ b/qt/qextscintillalexercss.cpp @@ -0,0 +1,376 @@ +// This module implements the QextScintillaLexerCSS class. +// +// Copyright (c) 2006 +// Riverbank Computing Limited +// +// This file is part of QScintilla. +// +// This copy of QScintilla is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2, or (at your option) any +// later version. +// +// QScintilla is supplied 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 +// QScintilla; see the file LICENSE. If not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +#include +#include +#include + +#include "qextscintillalexercss.h" + + +// The ctor. +QextScintillaLexerCSS::QextScintillaLexerCSS(QObject *parent,const char *name) + : QextScintillaLexer(parent,name), fold_comments(FALSE), + fold_compact(TRUE) +{ +} + + +// The dtor. +QextScintillaLexerCSS::~QextScintillaLexerCSS() +{ +} + + +// Returns the language name. +const char *QextScintillaLexerCSS::language() const +{ + return "CSS"; +} + + +// Returns the lexer name. +const char *QextScintillaLexerCSS::lexer() const +{ + return "css"; +} + + +// Return the list of characters that can start a block. +const char *QextScintillaLexerCSS::blockStart(int *style) const +{ + if (style) + *style = Operator; + + return "{"; +} + + +// Return the list of characters that can end a block. +const char *QextScintillaLexerCSS::blockEnd(int *style) const +{ + if (style) + *style = Operator; + + return "}"; +} + + +// Return the string of characters that comprise a word. +const char *QextScintillaLexerCSS::wordCharacters() const +{ + return "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-"; +} + + +// Returns the foreground colour of the text for a style. +QColor QextScintillaLexerCSS::color(int style) const +{ + switch (style) + { + case Default: + return QColor(0xff,0x00,0x80); + + case Tag: + return QColor(0x00,0x00,0x7f); + + case PseudoClass: + case Attribute: + return QColor(0x80,0x00,0x00); + + case UnknownPseudoClass: + case UnknownProperty: + return QColor(0xff,0x00,0x00); + + case Operator: + return QColor(0x00,0x00,0x00); + + case CSS1Property: + return QColor(0x00,0x40,0xe0); + + case Value: + case DoubleQuotedString: + case SingleQuotedString: + return QColor(0x7f,0x00,0x7f); + + case Comment: + return QColor(0x00,0x7f,0x00); + + case IDSelector: + return QColor(0x00,0x7f,0x7f); + + case Important: + return QColor(0xff,0x80,0x00); + + case AtRule: + return QColor(0x7f,0x7f,0x00); + + case CSS2Property: + return QColor(0x00,0xa0,0xe0); + } + + return QextScintillaLexer::color(style); +} + + +// Returns the font of the text for a style. +QFont QextScintillaLexerCSS::font(int style) const +{ + QFont f; + + if (style == Comment) +#if defined(Q_OS_WIN) + f = QFont("Comic Sans MS",9); +#else + f = QFont("Bitstream Vera Serif",9); +#endif + else + { + f = QextScintillaLexer::font(style); + + switch (style) + { + case Tag: + case Important: + case AtRule: + f.setBold(TRUE); + break; + + case IDSelector: + f.setItalic(TRUE); + break; + } + } + + return f; +} + + +// Returns the set of keywords. +const char *QextScintillaLexerCSS::keywords(int set) const +{ + if (set == 1) + return + "color background-color background-image " + "background-repeat background-attachment " + "background-position background font-family " + "font-style font-variant font-weight font-size font " + "word-spacing letter-spacing text-decoration " + "vertical-align text-transform text-align " + "text-indent line-height margin-top margin-right " + "margin-bottom margin-left margin padding-top " + "padding-right padding-bottom padding-left padding " + "border-top-width border-right-width " + "border-bottom-width border-left-width border-width " + "border-top border-right border-bottom border-left " + "border border-color border-style width height float " + "clear display white-space list-style-type " + "list-style-image list-style-position list-style"; + + if (set == 2) + return + "first-letter first-line link active visited " + "first-child focus hover lang before after left " + "right first"; + + if (set == 3) + return + "border-top-color border-right-color " + "border-bottom-color border-left-color border-color " + "border-top-style border-right-style " + "border-bottom-style border-left-style border-style " + "top right bottom left position z-index direction " + "unicode-bidi min-width max-width min-height " + "max-height overflow clip visibility content quotes " + "counter-reset counter-increment marker-offset size " + "marks page-break-before page-break-after " + "page-break-inside page orphans widows font-stretch " + "font-size-adjust unicode-range units-per-em src " + "panose-1 stemv stemh slope cap-height x-height " + "ascent descent widths bbox definition-src baseline " + "centerline mathline topline text-shadow " + "caption-side table-layout border-collapse " + "border-spacing empty-cells speak-header cursor " + "outline outline-width outline-style outline-color " + "volume speak pause-before pause-after pause " + "cue-before cue-after cue play-during azimuth " + "elevation speech-rate voice-family pitch " + "pitch-range stress richness speak-punctuation " + "speak-numeral"; + + return 0; +} + + +// Returns the user name of a style. +QString QextScintillaLexerCSS::description(int style) const +{ + switch (style) + { + case Default: + return tr("Default"); + + case Tag: + return tr("Tag"); + + case ClassSelector: + return tr("Class selector"); + + case PseudoClass: + return tr("Pseudo-class"); + + case UnknownPseudoClass: + return tr("Unknown pseudo-class"); + + case Operator: + return tr("Operator"); + + case CSS1Property: + return tr("CSS1 property"); + + case UnknownProperty: + return tr("Unknown property"); + + case Value: + return tr("Value"); + + case IDSelector: + return tr("ID selector"); + + case Important: + return tr("Important"); + + case AtRule: + return tr("@-rule"); + + case DoubleQuotedString: + return tr("Double-quoted string"); + + case SingleQuotedString: + return tr("Single-quoted string"); + + case CSS2Property: + return tr("CSS2 property"); + + case Attribute: + return tr("Attribute"); + } + + return QString::null; +} + + +// Refresh all properties. +void QextScintillaLexerCSS::refreshProperties() +{ + setCommentProp(); + setCompactProp(); +} + + +// Read properties from the settings. +bool QextScintillaLexerCSS::readProperties(QSettings &qs,const QString &prefix) +{ + int rc = TRUE; + bool ok, flag; + + // Read the fold comments flag. + flag = qs.readBoolEntry(prefix + "foldcomments",FALSE,&ok); + + if (ok) + fold_comments = flag; + else + rc = FALSE; + + // Read the fold compact flag. + flag = qs.readBoolEntry(prefix + "foldcompact",TRUE,&ok); + + if (ok) + fold_compact = flag; + else + rc = FALSE; + + return rc; +} + + +// Write properties to the settings. +bool QextScintillaLexerCSS::writeProperties(QSettings &qs,const QString &prefix) const +{ + int rc = TRUE; + + // Write the fold comments flag. + if (!qs.writeEntry(prefix + "foldcomments",fold_comments)) + rc = FALSE; + + // Write the fold compact flag. + if (!qs.writeEntry(prefix + "foldcompact",fold_compact)) + rc = FALSE; + + return rc; +} + + +// Return TRUE if comments can be folded. +bool QextScintillaLexerCSS::foldComments() const +{ + return fold_comments; +} + + +// Set if comments can be folded. +void QextScintillaLexerCSS::setFoldComments(bool fold) +{ + fold_comments = fold; + + setCommentProp(); +} + + +// Set the "fold.comment" property. +void QextScintillaLexerCSS::setCommentProp() +{ + emit propertyChanged("fold.comment",(fold_comments ? "1" : "0")); +} + + +// Return TRUE if folds are compact. +bool QextScintillaLexerCSS::foldCompact() const +{ + return fold_compact; +} + + +// Set if folds are compact +void QextScintillaLexerCSS::setFoldCompact(bool fold) +{ + fold_compact = fold; + + setCompactProp(); +} + + +// Set the "fold.compact" property. +void QextScintillaLexerCSS::setCompactProp() +{ + emit propertyChanged("fold.compact",(fold_compact ? "1" : "0")); +} diff --git a/qt/qextscintillalexercss.h b/qt/qextscintillalexercss.h new file mode 100644 index 0000000..ff91cce --- /dev/null +++ b/qt/qextscintillalexercss.h @@ -0,0 +1,193 @@ +// This defines the interface to the QextScintillaLexerCSS class. +// +// Copyright (c) 2006 +// Riverbank Computing Limited +// +// This file is part of QScintilla. +// +// This copy of QScintilla is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2, or (at your option) any +// later version. +// +// QScintilla is supplied 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 +// QScintilla; see the file LICENSE. If not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +#ifndef QEXTSCINTILLALEXERCSS_H +#define QEXTSCINTILLALEXERCSS_H + + +#include + +#include +#include + + +//! \brief The QextScintillaLexerCSS class encapsulates the Scintilla CSS +//! lexer. +class QEXTSCINTILLA_EXPORT QextScintillaLexerCSS : public QextScintillaLexer +{ + Q_OBJECT + +public: + //! This enum defines the meanings of the different styles used by the + //! CSS lexer. + enum { + //! The default. + Default = 0, + + //! A tag. + Tag = 1, + + //! A class selector. + ClassSelector = 2, + + //! A pseudo-class. + PseudoClass = 3, + + //! An pseudo-class. + UnknownPseudoClass = 4, + + //! An operator. + Operator = 5, + + //! A CSS1 property. + CSS1Property = 6, + + //! An unknown property. + UnknownProperty = 7, + + //! A value. + Value = 8, + + //! A comment. + Comment = 9, + + //! An ID selector. + IDSelector = 10, + + //! An important value. + Important = 11, + + //! An @-rule. + AtRule = 12, + + //! A double-quoted string. + DoubleQuotedString = 13, + + //! A single-quoted string. + SingleQuotedString = 14, + + //! A CSS2 property. + CSS2Property = 15, + + //! An attribute. + Attribute = 16 + }; + + //! Construct a QextScintillaLexerCSS with parent \a parent and name + //! \a name. \a parent is typically the QextScintilla instance. + QextScintillaLexerCSS(QObject *parent = 0,const char *name = 0); + + //! Destroys the QextScintillaLexerCSS instance. + virtual ~QextScintillaLexerCSS(); + + //! Returns the name of the language. + const char *language() const; + + //! Returns the name of the lexer. Some lexers support a number of + //! languages. + const char *lexer() const; + + //! \internal Returns a space separated list of words or characters in + //! a particular style that define the end of a block for + //! auto-indentation. The styles is returned via \a style. + const char *blockEnd(int *style = 0) const; + + //! \internal Returns a space separated list of words or characters in + //! a particular style that define the start of a block for + //! auto-indentation. The styles is returned via \a style. + const char *blockStart(int *style = 0) const; + + //! \internal Returns the string of characters that comprise a word. + const char *wordCharacters() const; + + //! Returns the foreground colour of the text for style number + //! \a style. + //! + //! \sa paper() + QColor color(int style) const; + + //! Returns the font for style number \a style. + QFont font(int style) const; + + //! Returns the set of keywords for the keyword set \a set recognised + //! by the lexer as a space separated string. + const char *keywords(int set) const; + + //! Returns the descriptive name for style number \a style. If the + //! style is invalid for this language then QString::null is returned. + //! This is intended to be used in user preference dialogs. + QString description(int style) const; + + //! Causes all properties to be refreshed by emitting the + //! propertyChanged() signal as required. + void refreshProperties(); + + //! Returns TRUE if multi-line comment blocks can be folded. + //! + //! \sa setFoldComments() + bool foldComments() const; + + //! Returns TRUE if trailing blank lines are included in a fold block. + //! + //! \sa setFoldCompact() + bool foldCompact() const; + +public slots: + //! If \a fold is TRUE then multi-line comment blocks can be folded. + //! The default is FALSE. + //! + //! \sa foldComments() + virtual void setFoldComments(bool fold); + + //! If \a fold is TRUE then trailing blank lines are included in a fold + //! block. The default is TRUE. + //! + //! \sa foldCompact() + virtual void setFoldCompact(bool fold); + +protected: + //! The lexer's properties are read from the settings \a qs. \a prefix + //! (which has a trailing '/') should be used as a prefix to the key of + //! each setting. TRUE is returned if there is no error. + //! + bool readProperties(QSettings &qs,const QString &prefix); + + //! The lexer's properties are written to the settings \a qs. + //! \a prefix (which has a trailing '/') should be used as a prefix to + //! the key of each setting. TRUE is returned if there is no error. + //! + bool writeProperties(QSettings &qs,const QString &prefix) const; + +private: + void setCommentProp(); + void setCompactProp(); + + bool fold_comments; + bool fold_compact; + +#if defined(Q_DISABLE_COPY) + QextScintillaLexerCSS(const QextScintillaLexerCSS &); + QextScintillaLexerCSS &operator=(const QextScintillaLexerCSS &); +#endif +}; + +#endif diff --git a/qt/qextscintillalexerdiff.cpp b/qt/qextscintillalexerdiff.cpp new file mode 100644 index 0000000..ea0e457 --- /dev/null +++ b/qt/qextscintillalexerdiff.cpp @@ -0,0 +1,123 @@ +// This module implements the QextScintillaLexerDiff class. +// +// Copyright (c) 2006 +// Riverbank Computing Limited +// +// This file is part of QScintilla. +// +// This copy of QScintilla is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2, or (at your option) any +// later version. +// +// QScintilla is supplied 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 +// QScintilla; see the file LICENSE. If not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +#include +#include +#include + +#include "qextscintillalexerdiff.h" + + +// The ctor. +QextScintillaLexerDiff::QextScintillaLexerDiff(QObject *parent,const char *name) + : QextScintillaLexer(parent,name) +{ +} + + +// The dtor. +QextScintillaLexerDiff::~QextScintillaLexerDiff() +{ +} + + +// Returns the language name. +const char *QextScintillaLexerDiff::language() const +{ + return "Diff"; +} + + +// Returns the lexer name. +const char *QextScintillaLexerDiff::lexer() const +{ + return "diff"; +} + + +// Return the string of characters that comprise a word. +const char *QextScintillaLexerDiff::wordCharacters() const +{ + return "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-"; +} + + +// Returns the foreground colour of the text for a style. +QColor QextScintillaLexerDiff::color(int style) const +{ + switch (style) + { + case Default: + return QColor(0x00,0x00,0x00); + + case Comment: + return QColor(0x00,0x7f,0x00); + + case Command: + return QColor(0x7f,0x7f,0x00); + + case Header: + return QColor(0x7f,0x00,0x00); + + case Position: + return QColor(0x7f,0x00,0x7f); + + case LineRemoved: + return QColor(0x00,0x7f,0x7f); + + case LineAdded: + return QColor(0x00,0x00,0x7f); + } + + return QextScintillaLexer::color(style); +} + + +// Returns the user name of a style. +QString QextScintillaLexerDiff::description(int style) const +{ + switch (style) + { + case Default: + return tr("Default"); + + case Comment: + return tr("Comment"); + + case Command: + return tr("Command"); + + case Header: + return tr("Header"); + + case Position: + return tr("Position"); + + case LineRemoved: + return tr("Removed line"); + + case LineAdded: + return tr("Added line"); + } + + return QString::null; +} diff --git a/qt/qextscintillalexerdiff.h b/qt/qextscintillalexerdiff.h new file mode 100644 index 0000000..9287a04 --- /dev/null +++ b/qt/qextscintillalexerdiff.h @@ -0,0 +1,100 @@ +// This defines the interface to the QextScintillaLexerDiff class. +// +// Copyright (c) 2006 +// Riverbank Computing Limited +// +// This file is part of QScintilla. +// +// This copy of QScintilla is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2, or (at your option) any +// later version. +// +// QScintilla is supplied 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 +// QScintilla; see the file LICENSE. If not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +#ifndef QEXTSCINTILLALEXERDIFF_H +#define QEXTSCINTILLALEXERDIFF_H + + +#include + +#include +#include + + +//! \brief The QextScintillaLexerDiff class encapsulates the Scintilla Diff +//! lexer. +class QEXTSCINTILLA_EXPORT QextScintillaLexerDiff : public QextScintillaLexer +{ + Q_OBJECT + +public: + //! This enum defines the meanings of the different styles used by the + //! Diff lexer. + enum { + //! The default. + Default = 0, + + //! A comment. + Comment = 1, + + //! A command. + Command = 2, + + //! A header. + Header = 3, + + //! A position. + Position = 4, + + //! A removed line. + LineRemoved = 5, + + //! An added line. + LineAdded = 6 + }; + + //! Construct a QextScintillaLexerDiff with parent \a parent and name + //! \a name. \a parent is typically the QextScintilla instance. + QextScintillaLexerDiff(QObject *parent = 0,const char *name = 0); + + //! Destroys the QextScintillaLexerDiff instance. + virtual ~QextScintillaLexerDiff(); + + //! Returns the name of the language. + const char *language() const; + + //! Returns the name of the lexer. Some lexers support a number of + //! languages. + const char *lexer() const; + + //! \internal Returns the string of characters that comprise a word. + const char *wordCharacters() const; + + //! Returns the foreground colour of the text for style number + //! \a style. + //! + //! \sa paper() + QColor color(int style) const; + + //! Returns the descriptive name for style number \a style. If the + //! style is invalid for this language then QString::null is returned. + //! This is intended to be used in user preference dialogs. + QString description(int style) const; + +private: +#if defined(Q_DISABLE_COPY) + QextScintillaLexerDiff(const QextScintillaLexerDiff &); + QextScintillaLexerDiff &operator=(const QextScintillaLexerDiff &); +#endif +}; + +#endif diff --git a/qt/qextscintillalexerhtml.cpp b/qt/qextscintillalexerhtml.cpp new file mode 100644 index 0000000..100d47c --- /dev/null +++ b/qt/qextscintillalexerhtml.cpp @@ -0,0 +1,1132 @@ +// This module implements the QextScintillaLexerHTML class. +// +// Copyright (c) 2006 +// Riverbank Computing Limited +// +// This file is part of QScintilla. +// +// This copy of QScintilla is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2, or (at your option) any +// later version. +// +// QScintilla is supplied 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 +// QScintilla; see the file LICENSE. If not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +#include +#include +#include + +#include "qextscintillalexerhtml.h" +#include "qextscintillalexerjavascript.h" +#include "qextscintillalexerpython.h" + + +// The ctor. +QextScintillaLexerHTML::QextScintillaLexerHTML(QObject *parent, + const char *name) + : QextScintillaLexer(parent,name), fold_compact(TRUE), + fold_preproc(TRUE), case_sens_tags(FALSE) +{ +} + + +// The dtor. +QextScintillaLexerHTML::~QextScintillaLexerHTML() +{ +} + + +// Returns the language name. +const char *QextScintillaLexerHTML::language() const +{ + return "HTML"; +} + + +// Returns the lexer name. +const char *QextScintillaLexerHTML::lexer() const +{ + return "hypertext"; +} + + +// Return the string of characters that comprise a word. +const char *QextScintillaLexerHTML::wordCharacters() const +{ + return "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-"; +} + + +// Returns the foreground colour of the text for a style. +QColor QextScintillaLexerHTML::color(int style) const +{ + switch (style) + { + case Default: + case JavaScriptDefault: + case JavaScriptWord: + case JavaScriptSymbol: + case ASPJavaScriptDefault: + case ASPJavaScriptWord: + case ASPJavaScriptSymbol: + case VBScriptDefault: + case ASPVBScriptDefault: + case PHPOperator: + return QColor(0x00,0x00,0x00); + + case Tag: + case XMLTagEnd: + case Script: + case SGMLDefault: + case SGMLCommand: + case VBScriptKeyword: + case VBScriptIdentifier: + case VBScriptUnclosedString: + case ASPVBScriptKeyword: + case ASPVBScriptIdentifier: + case ASPVBScriptUnclosedString: + return QColor(0x00,0x00,0x80); + + case UnknownTag: + case UnknownAttribute: + return QColor(0xff,0x00,0x00); + + case Attribute: + case VBScriptNumber: + case ASPVBScriptNumber: + return QColor(0x00,0x80,0x80); + + case HTMLNumber: + case JavaScriptNumber: + case ASPJavaScriptNumber: + case PythonNumber: + case PythonFunctionMethodName: + case ASPPythonNumber: + case ASPPythonFunctionMethodName: + return QColor(0x00,0x7f,0x7f); + + case HTMLDoubleQuotedString: + case HTMLSingleQuotedString: + case JavaScriptDoubleQuotedString: + case JavaScriptSingleQuotedString: + case ASPJavaScriptDoubleQuotedString: + case ASPJavaScriptSingleQuotedString: + case PythonDoubleQuotedString: + case PythonSingleQuotedString: + case ASPPythonDoubleQuotedString: + case ASPPythonSingleQuotedString: + case PHPKeyword: + return QColor(0x7f,0x00,0x7f); + + case OtherInTag: + case Entity: + case VBScriptString: + case ASPVBScriptString: + return QColor(0x80,0x00,0x80); + + case HTMLComment: + case SGMLComment: + return QColor(0x80,0x80,0x00); + + case XMLStart: + case XMLEnd: + case PHPStart: + case PythonClassName: + case ASPPythonClassName: + return QColor(0x00,0x00,0xff); + + case HTMLValue: + return QColor(0xff,0x00,0xff); + + case SGMLParameter: + return QColor(0x00,0x66,0x00); + + case SGMLDoubleQuotedString: + case SGMLError: + return QColor(0x80,0x00,0x00); + + case SGMLSingleQuotedString: + return QColor(0x99,0x33,0x00); + + case SGMLSpecial: + return QColor(0x33,0x66,0xff); + + case SGMLEntity: + return QColor(0x33,0x33,0x33); + + case SGMLBlockDefault: + return QColor(0x00,0x00,0x66); + + case JavaScriptStart: + case ASPJavaScriptStart: + return QColor(0x7f,0x7f,0x00); + + case JavaScriptComment: + case JavaScriptCommentLine: + case ASPJavaScriptComment: + case ASPJavaScriptCommentLine: + case PythonComment: + case ASPPythonComment: + case PHPDoubleQuotedString: + return QColor(0x00,0x7f,0x00); + + case JavaScriptCommentDoc: + return QColor(0x3f,0x70,0x3f); + + case JavaScriptKeyword: + case ASPJavaScriptKeyword: + case PythonKeyword: + case ASPPythonKeyword: + case PHPVariable: + case PHPDoubleQuotedVariable: + return QColor(0x00,0x00,0x7f); + + case ASPJavaScriptCommentDoc: + return QColor(0x7f,0x7f,0x7f); + + case VBScriptComment: + case ASPVBScriptComment: + return QColor(0x00,0x80,0x00); + + case PythonStart: + case PythonDefault: + case ASPPythonStart: + case ASPPythonDefault: + return QColor(0x80,0x80,0x80); + + case PythonTripleSingleQuotedString: + case PythonTripleDoubleQuotedString: + case ASPPythonTripleSingleQuotedString: + case ASPPythonTripleDoubleQuotedString: + return QColor(0x7f,0x00,0x00); + + case PHPDefault: + return QColor(0x00,0x00,0x33); + + case PHPSingleQuotedString: + return QColor(0x00,0x9f,0x00); + + case PHPNumber: + return QColor(0xcc,0x99,0x00); + + case PHPComment: + return QColor(0x99,0x99,0x99); + + case PHPCommentLine: + return QColor(0x66,0x66,0x66); + } + + return QextScintillaLexer::color(style); +} + + +// Returns the end-of-line fill for a style. +bool QextScintillaLexerHTML::eolFill(int style) const +{ + switch (style) + { + case JavaScriptDefault: + case JavaScriptComment: + case JavaScriptCommentDoc: + case JavaScriptUnclosedString: + case ASPJavaScriptDefault: + case ASPJavaScriptComment: + case ASPJavaScriptCommentDoc: + case ASPJavaScriptUnclosedString: + case VBScriptDefault: + case VBScriptComment: + case VBScriptNumber: + case VBScriptKeyword: + case VBScriptString: + case VBScriptIdentifier: + case VBScriptUnclosedString: + case ASPVBScriptDefault: + case ASPVBScriptComment: + case ASPVBScriptNumber: + case ASPVBScriptKeyword: + case ASPVBScriptString: + case ASPVBScriptIdentifier: + case ASPVBScriptUnclosedString: + case PythonDefault: + case PythonComment: + case PythonNumber: + case PythonDoubleQuotedString: + case PythonSingleQuotedString: + case PythonKeyword: + case PythonTripleSingleQuotedString: + case PythonTripleDoubleQuotedString: + case PythonClassName: + case PythonFunctionMethodName: + case PythonOperator: + case PythonIdentifier: + case ASPPythonDefault: + case ASPPythonComment: + case ASPPythonNumber: + case ASPPythonDoubleQuotedString: + case ASPPythonSingleQuotedString: + case ASPPythonKeyword: + case ASPPythonTripleSingleQuotedString: + case ASPPythonTripleDoubleQuotedString: + case ASPPythonClassName: + case ASPPythonFunctionMethodName: + case ASPPythonOperator: + case ASPPythonIdentifier: + case PHPDefault: + return TRUE; + } + + return QextScintillaLexer::eolFill(style); +} + + +// Returns the font of the text for a style. +QFont QextScintillaLexerHTML::font(int style) const +{ + QFont f; + + switch (style) + { + case Default: + case Entity: +#if defined(Q_OS_WIN) + f = QFont("Times New Roman",11); +#else + f = QFont("Bitstream Charter",10); +#endif + break; + + case HTMLComment: +#if defined(Q_OS_WIN) + f = QFont("Verdana",9); +#else + f = QFont("Bitstream Vera Sans",8); +#endif + break; + + case SGMLCommand: + case PythonKeyword: + case PythonClassName: + case PythonFunctionMethodName: + case PythonOperator: + case ASPPythonKeyword: + case ASPPythonClassName: + case ASPPythonFunctionMethodName: + case ASPPythonOperator: + f = QextScintillaLexer::font(style); + f.setBold(TRUE); + break; + + case JavaScriptDefault: + case JavaScriptCommentDoc: + case JavaScriptKeyword: + case JavaScriptSymbol: + case ASPJavaScriptDefault: + case ASPJavaScriptCommentDoc: + case ASPJavaScriptKeyword: + case ASPJavaScriptSymbol: +#if defined(Q_OS_WIN) + f = QFont("Comic Sans MS",9); +#else + f = QFont("Bitstream Vera Serif",9); +#endif + f.setBold(TRUE); + break; + + case JavaScriptComment: + case JavaScriptCommentLine: + case JavaScriptNumber: + case JavaScriptWord: + case JavaScriptDoubleQuotedString: + case JavaScriptSingleQuotedString: + case ASPJavaScriptComment: + case ASPJavaScriptCommentLine: + case ASPJavaScriptNumber: + case ASPJavaScriptWord: + case ASPJavaScriptDoubleQuotedString: + case ASPJavaScriptSingleQuotedString: + case VBScriptComment: + case ASPVBScriptComment: + case PythonComment: + case ASPPythonComment: + case PHPComment: +#if defined(Q_OS_WIN) + f = QFont("Comic Sans MS",9); +#else + f = QFont("Bitstream Vera Serif",9); +#endif + break; + + case VBScriptDefault: + case VBScriptNumber: + case VBScriptString: + case VBScriptIdentifier: + case VBScriptUnclosedString: + case ASPVBScriptDefault: + case ASPVBScriptNumber: + case ASPVBScriptString: + case ASPVBScriptIdentifier: + case ASPVBScriptUnclosedString: +#if defined(Q_OS_WIN) + f = QFont("Lucida Sans Unicode",9); +#else + f = QFont("Bitstream Vera Serif",9); +#endif + break; + + case VBScriptKeyword: + case ASPVBScriptKeyword: +#if defined(Q_OS_WIN) + f = QFont("Lucida Sans Unicode",9); +#else + f = QFont("Bitstream Vera Serif",9); +#endif + f.setBold(TRUE); + break; + + case PythonDoubleQuotedString: + case PythonSingleQuotedString: + case ASPPythonDoubleQuotedString: + case ASPPythonSingleQuotedString: +#if defined(Q_OS_WIN) + f = QFont("Courier New",10); +#else + f = QFont("Bitstream Vera Sans Mono",9); +#endif + break; + + case PHPKeyword: + case PHPVariable: + case PHPDoubleQuotedVariable: + f = QextScintillaLexer::font(style); + f.setItalic(TRUE); + break; + + case PHPCommentLine: +#if defined(Q_OS_WIN) + f = QFont("Comic Sans MS",9); +#else + f = QFont("Bitstream Vera Serif",9); +#endif + f.setItalic(TRUE); + break; + + default: + f = QextScintillaLexer::font(style); + } + + return f; +} + + +// Returns the set of keywords. +const char *QextScintillaLexerHTML::keywords(int set) const +{ + if (set == 1) + return + "a abbr acronym address applet area " + "b base basefont bdo big blockquote body br button " + "caption center cite code col colgroup " + "dd del dfn dir div dl dt " + "em " + "fieldset font form frame frameset " + "h1 h2 h3 h4 h5 h6 head hr html " + "i iframe img input ins isindex " + "kbd " + "label legend li link " + "map menu meta " + "noframes noscript " + "object ol optgroup option " + "p param pre " + "q " + "s samp script select small span strike strong style " + "sub sup " + "table tbody td textarea tfoot th thead title tr tt " + "u ul " + "var " + "xml xmlns " + "abbr accept-charset accept accesskey action align " + "alink alt archive axis " + "background bgcolor border " + "cellpadding cellspacing char charoff charset checked " + "cite class classid clear codebase codetype color " + "cols colspan compact content coords " + "data datafld dataformatas datapagesize datasrc " + "datetime declare defer dir disabled " + "enctype event " + "face for frame frameborder " + "headers height href hreflang hspace http-equiv " + "id ismap label lang language leftmargin link " + "longdesc " + "marginwidth marginheight maxlength media method " + "multiple " + "name nohref noresize noshade nowrap " + "object onblur onchange onclick ondblclick onfocus " + "onkeydown onkeypress onkeyup onload onmousedown " + "onmousemove onmouseover onmouseout onmouseup onreset " + "onselect onsubmit onunload " + "profile prompt " + "readonly rel rev rows rowspan rules " + "scheme scope selected shape size span src standby " + "start style summary " + "tabindex target text title topmargin type " + "usemap " + "valign value valuetype version vlink vspace " + "width " + "text password checkbox radio submit reset file " + "hidden image " + "public !doctype"; + + if (set == 2) + return QextScintillaLexerJavaScript::keywordClass; + + if (set == 3) + return + // Move these to QextScintillaLexerVisualBasic when we + // get round to implementing it. + "and begin case call continue do each else elseif end " + "erase error event exit false for function get gosub " + "goto if implement in load loop lset me mid new next " + "not nothing on or property raiseevent rem resume " + "return rset select set stop sub then to true unload " + "until wend while with withevents attribute alias as " + "boolean byref byte byval const compare currency date " + "declare dim double enum explicit friend global " + "integer let lib long module object option optional " + "preserve private property public redim single static " + "string type variant"; + + if (set == 4) + return QextScintillaLexerPython::keywordClass; + + if (set == 5) + return + "and argv as argc break case cfunction class continue " + "declare default do die " + "echo else elseif empty enddeclare endfor endforeach " + "endif endswitch endwhile e_all e_parse e_error " + "e_warning eval exit extends " + "false for foreach function global " + "http_cookie_vars http_get_vars http_post_vars " + "http_post_files http_env_vars http_server_vars " + "if include include_once list new not null " + "old_function or " + "parent php_os php_self php_version print " + "require require_once return " + "static switch stdclass this true var xor virtual " + "while " + "__file__ __line__ __sleep __wakeup"; + + if (set == 6) + return "ELEMENT DOCTYPE ATTLIST ENTITY NOTATION"; + + return 0; +} + + +// Returns the user name of a style. +QString QextScintillaLexerHTML::description(int style) const +{ + switch (style) + { + case Default: + return tr("HTML default"); + + case Tag: + return tr("Tag"); + + case UnknownTag: + return tr("Unknown tag"); + + case Attribute: + return tr("Attribute"); + + case UnknownAttribute: + return tr("Unknown attribute"); + + case HTMLNumber: + return tr("HTML number"); + + case HTMLDoubleQuotedString: + return tr("HTML double-quoted string"); + + case HTMLSingleQuotedString: + return tr("HTML single-quoted string"); + + case OtherInTag: + return tr("Other text in a tag"); + + case HTMLComment: + return tr("HTML comment"); + + case Entity: + return tr("Entity"); + + case XMLTagEnd: + return tr("End of a tag"); + + case XMLStart: + return tr("Start of an XML fragment"); + + case XMLEnd: + return tr("End of an XML fragment"); + + case Script: + return tr("Script tag"); + + case ASPAtStart: + return tr("Start of an ASP fragment with @"); + + case ASPStart: + return tr("Start of an ASP fragment"); + + case CDATA: + return tr("CDATA"); + + case PHPStart: + return tr("Start of a PHP fragment"); + + case HTMLValue: + return tr("Unquoted HTML value"); + + case ASPXCComment: + return tr("ASP X-Code comment"); + + case SGMLDefault: + return tr("SGML default"); + + case SGMLCommand: + return tr("SGML command"); + + case SGMLParameter: + return tr("First parameter of an SGML command"); + + case SGMLDoubleQuotedString: + return tr("SGML double-quoted string"); + + case SGMLSingleQuotedString: + return tr("SGML single-quoted string"); + + case SGMLError: + return tr("SGML error"); + + case SGMLSpecial: + return tr("SGML special entity"); + + case SGMLComment: + return tr("SGML comment"); + + case SGMLParameterComment: + return tr("First parameter comment of an SGML command"); + + case SGMLBlockDefault: + return tr("SGML block default"); + + case JavaScriptStart: + return tr("Start of a JavaScript fragment"); + + case JavaScriptDefault: + return tr("JavaScript default"); + + case JavaScriptComment: + return tr("JavaScript comment"); + + case JavaScriptCommentLine: + return tr("JavaScript line comment"); + + case JavaScriptCommentDoc: + return tr("JavaDoc style JavaScript comment"); + + case JavaScriptNumber: + return tr("JavaScript number"); + + case JavaScriptWord: + return tr("JavaScript word"); + + case JavaScriptKeyword: + return tr("JavaScript keyword"); + + case JavaScriptDoubleQuotedString: + return tr("JavaScript double-quoted string"); + + case JavaScriptSingleQuotedString: + return tr("JavaScript single-quoted string"); + + case JavaScriptSymbol: + return tr("JavaScript symbol"); + + case JavaScriptUnclosedString: + return tr("JavaScript unclosed string"); + + case JavaScriptRegex: + return tr("JavaScript regular expression"); + + case ASPJavaScriptStart: + return tr("Start of an ASP JavaScript fragment"); + + case ASPJavaScriptDefault: + return tr("ASP JavaScript default"); + + case ASPJavaScriptComment: + return tr("ASP JavaScript comment"); + + case ASPJavaScriptCommentLine: + return tr("ASP JavaScript line comment"); + + case ASPJavaScriptCommentDoc: + return tr("JavaDoc style ASP JavaScript comment"); + + case ASPJavaScriptNumber: + return tr("ASP JavaScript number"); + + case ASPJavaScriptWord: + return tr("ASP JavaScript word"); + + case ASPJavaScriptKeyword: + return tr("ASP JavaScript keyword"); + + case ASPJavaScriptDoubleQuotedString: + return tr("ASP JavaScript double-quoted string"); + + case ASPJavaScriptSingleQuotedString: + return tr("ASP JavaScript single-quoted string"); + + case ASPJavaScriptSymbol: + return tr("ASP JavaScript symbol"); + + case ASPJavaScriptUnclosedString: + return tr("ASP JavaScript unclosed string"); + + case ASPJavaScriptRegex: + return tr("ASP JavaScript regular expression"); + + case VBScriptStart: + return tr("Start of a VBScript fragment"); + + case VBScriptDefault: + return tr("VBScript default"); + + case VBScriptComment: + return tr("VBScript comment"); + + case VBScriptNumber: + return tr("VBScript number"); + + case VBScriptKeyword: + return tr("VBScript keyword"); + + case VBScriptString: + return tr("VBScript string"); + + case VBScriptIdentifier: + return tr("VBScript identifier"); + + case VBScriptUnclosedString: + return tr("VBScript unclosed string"); + + case ASPVBScriptStart: + return tr("Start of an ASP VBScript fragment"); + + case ASPVBScriptDefault: + return tr("ASP VBScript default"); + + case ASPVBScriptComment: + return tr("ASP VBScript comment"); + + case ASPVBScriptNumber: + return tr("ASP VBScript number"); + + case ASPVBScriptKeyword: + return tr("ASP VBScript keyword"); + + case ASPVBScriptString: + return tr("ASP VBScript string"); + + case ASPVBScriptIdentifier: + return tr("ASP VBScript identifier"); + + case ASPVBScriptUnclosedString: + return tr("ASP VBScript unclosed string"); + + case PythonStart: + return tr("Start of a Python fragment"); + + case PythonDefault: + return tr("Python default"); + + case PythonComment: + return tr("Python comment"); + + case PythonNumber: + return tr("Python number"); + + case PythonDoubleQuotedString: + return tr("Python double-quoted string"); + + case PythonSingleQuotedString: + return tr("Python single-quoted string"); + + case PythonKeyword: + return tr("Python keyword"); + + case PythonTripleDoubleQuotedString: + return tr("Python triple double-quoted string"); + + case PythonTripleSingleQuotedString: + return tr("Python triple single-quoted string"); + + case PythonClassName: + return tr("Python class name"); + + case PythonFunctionMethodName: + return tr("Python function or method name"); + + case PythonOperator: + return tr("Python operator"); + + case PythonIdentifier: + return tr("Python identifier"); + + case ASPPythonStart: + return tr("Start of an ASP Python fragment"); + + case ASPPythonDefault: + return tr("ASP Python default"); + + case ASPPythonComment: + return tr("ASP Python comment"); + + case ASPPythonNumber: + return tr("ASP Python number"); + + case ASPPythonDoubleQuotedString: + return tr("ASP Python double-quoted string"); + + case ASPPythonSingleQuotedString: + return tr("ASP Python single-quoted string"); + + case ASPPythonKeyword: + return tr("ASP Python keyword"); + + case ASPPythonTripleDoubleQuotedString: + return tr("ASP Python triple double-quoted string"); + + case ASPPythonTripleSingleQuotedString: + return tr("ASP Python triple single-quoted string"); + + case ASPPythonClassName: + return tr("ASP Python class name"); + + case ASPPythonFunctionMethodName: + return tr("ASP Python function or method name"); + + case ASPPythonOperator: + return tr("ASP Python operator"); + + case ASPPythonIdentifier: + return tr("ASP Python identifier"); + + case PHPDefault: + return tr("PHP default"); + + case PHPDoubleQuotedString: + return tr("PHP double-quoted string"); + + case PHPSingleQuotedString: + return tr("PHP single-quoted string"); + + case PHPKeyword: + return tr("PHP keyword"); + + case PHPNumber: + return tr("PHP number"); + + case PHPVariable: + return tr("PHP variable"); + + case PHPComment: + return tr("PHP comment"); + + case PHPCommentLine: + return tr("PHP line comment"); + + case PHPDoubleQuotedVariable: + return tr("PHP double-quoted variable"); + + case PHPOperator: + return tr("PHP operator"); + } + + return QString::null; +} + + +// Returns the background colour of the text for a style. +QColor QextScintillaLexerHTML::paper(int style) const +{ + switch (style) + { + case ASPAtStart: + return QColor(0xff,0xff,0x00); + + case ASPStart: + case CDATA: + return QColor(0xff,0xdf,0x00); + + case PHPStart: + return QColor(0xff,0xef,0xbf); + + case HTMLValue: + return QColor(0xff,0xef,0xff); + + case SGMLDefault: + case SGMLCommand: + case SGMLParameter: + case SGMLDoubleQuotedString: + case SGMLSingleQuotedString: + case SGMLSpecial: + case SGMLEntity: + case SGMLComment: + return QColor(0xef,0xef,0xff); + + case SGMLError: + return QColor(0xff,0x66,0x66); + + case SGMLBlockDefault: + return QColor(0xcc,0xcc,0xe0); + + case JavaScriptDefault: + case JavaScriptComment: + case JavaScriptCommentLine: + case JavaScriptCommentDoc: + case JavaScriptNumber: + case JavaScriptWord: + case JavaScriptKeyword: + case JavaScriptDoubleQuotedString: + case JavaScriptSingleQuotedString: + case JavaScriptSymbol: + return QColor(0xf0,0xf0,0xff); + + case JavaScriptUnclosedString: + case ASPJavaScriptUnclosedString: + return QColor(0xbf,0xbb,0xb0); + + case JavaScriptRegex: + case ASPJavaScriptRegex: + return QColor(0xff,0xbb,0xb0); + + case ASPJavaScriptDefault: + case ASPJavaScriptComment: + case ASPJavaScriptCommentLine: + case ASPJavaScriptCommentDoc: + case ASPJavaScriptNumber: + case ASPJavaScriptWord: + case ASPJavaScriptKeyword: + case ASPJavaScriptDoubleQuotedString: + case ASPJavaScriptSingleQuotedString: + case ASPJavaScriptSymbol: + return QColor(0xdf,0xdf,0x7f); + + case VBScriptDefault: + case VBScriptComment: + case VBScriptNumber: + case VBScriptKeyword: + case VBScriptString: + case VBScriptIdentifier: + return QColor(0xef,0xef,0xff); + + case VBScriptUnclosedString: + case ASPVBScriptUnclosedString: + return QColor(0x7f,0x7f,0xff); + + case ASPVBScriptDefault: + case ASPVBScriptComment: + case ASPVBScriptNumber: + case ASPVBScriptKeyword: + case ASPVBScriptString: + case ASPVBScriptIdentifier: + return QColor(0xcf,0xcf,0xef); + + case PythonDefault: + case PythonComment: + case PythonNumber: + case PythonDoubleQuotedString: + case PythonSingleQuotedString: + case PythonKeyword: + case PythonTripleSingleQuotedString: + case PythonTripleDoubleQuotedString: + case PythonClassName: + case PythonFunctionMethodName: + case PythonOperator: + case PythonIdentifier: + return QColor(0xef,0xff,0xef); + + case ASPPythonDefault: + case ASPPythonComment: + case ASPPythonNumber: + case ASPPythonDoubleQuotedString: + case ASPPythonSingleQuotedString: + case ASPPythonKeyword: + case ASPPythonTripleSingleQuotedString: + case ASPPythonTripleDoubleQuotedString: + case ASPPythonClassName: + case ASPPythonFunctionMethodName: + case ASPPythonOperator: + case ASPPythonIdentifier: + return QColor(0xcf,0xef,0xcf); + + case PHPDefault: + case PHPDoubleQuotedString: + case PHPSingleQuotedString: + case PHPKeyword: + case PHPNumber: + case PHPVariable: + case PHPComment: + case PHPCommentLine: + case PHPDoubleQuotedVariable: + case PHPOperator: + return QColor(0xff,0xf8,0xf8); + } + + return QextScintillaLexer::paper(style); +} + + +// Refresh all properties. +void QextScintillaLexerHTML::refreshProperties() +{ + setCompactProp(); + setPreprocProp(); + setCaseSensTagsProp(); +} + + +// Read properties from the settings. +bool QextScintillaLexerHTML::readProperties(QSettings &qs,const QString &prefix) +{ + int rc = TRUE; + bool ok, flag; + + // Read the fold compact flag. + flag = qs.readBoolEntry(prefix + "foldcompact",TRUE,&ok); + + if (ok) + fold_compact = flag; + else + rc = FALSE; + + // Read the fold preprocessor flag. + flag = qs.readBoolEntry(prefix + "foldpreprocessor",FALSE,&ok); + + if (ok) + fold_preproc = flag; + else + rc = FALSE; + + // Read the case sensitive tags flag. + flag = qs.readBoolEntry(prefix + "casesensitivetags",FALSE,&ok); + + if (ok) + case_sens_tags = flag; + else + rc = FALSE; + + return rc; +} + + +// Write properties to the settings. +bool QextScintillaLexerHTML::writeProperties(QSettings &qs,const QString &prefix) const +{ + int rc = TRUE; + + // Write the fold compact flag. + if (!qs.writeEntry(prefix + "foldcompact",fold_compact)) + rc = FALSE; + + // Write the fold preprocessor flag. + if (!qs.writeEntry(prefix + "foldpreprocessor",fold_preproc)) + rc = FALSE; + + // Write the case sensitive tags flag. + if (!qs.writeEntry(prefix + "casesensitivetags",case_sens_tags)) + rc = FALSE; + + return rc; +} + + +// Return TRUE if tags are case sensitive. +bool QextScintillaLexerHTML::caseSensitiveTags() const +{ + return case_sens_tags; +} + + +// Set if tags are case sensitive. +void QextScintillaLexerHTML::setCaseSensitiveTags(bool sens) +{ + case_sens_tags = sens; + + setCaseSensTagsProp(); +} + + +// Set the "html.tags.case.sensitive" property. +void QextScintillaLexerHTML::setCaseSensTagsProp() +{ + emit propertyChanged("html.tags.case.sensitive",(case_sens_tags ? "1" : "0")); +} + + +// Return TRUE if folds are compact. +bool QextScintillaLexerHTML::foldCompact() const +{ + return fold_compact; +} + + +// Set if folds are compact +void QextScintillaLexerHTML::setFoldCompact(bool fold) +{ + fold_compact = fold; + + setCompactProp(); +} + + +// Set the "fold.compact" property. +void QextScintillaLexerHTML::setCompactProp() +{ + emit propertyChanged("fold.compact",(fold_compact ? "1" : "0")); +} + + +// Return TRUE if preprocessor blocks can be folded. +bool QextScintillaLexerHTML::foldPreprocessor() const +{ + return fold_preproc; +} + + +// Set if preprocessor blocks can be folded. +void QextScintillaLexerHTML::setFoldPreprocessor(bool fold) +{ + fold_preproc = fold; + + setPreprocProp(); +} + + +// Set the "fold.preprocessor" property. +void QextScintillaLexerHTML::setPreprocProp() +{ + emit propertyChanged("fold.html.preprocessor",(fold_preproc ? "1" : "0")); +} diff --git a/qt/qextscintillalexerhtml.h b/qt/qextscintillalexerhtml.h new file mode 100644 index 0000000..1a71fe9 --- /dev/null +++ b/qt/qextscintillalexerhtml.h @@ -0,0 +1,486 @@ +// This defines the interface to the QextScintillaLexerHTML class. +// +// Copyright (c) 2006 +// Riverbank Computing Limited +// +// This file is part of QScintilla. +// +// This copy of QScintilla is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2, or (at your option) any +// later version. +// +// QScintilla is supplied 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 +// QScintilla; see the file LICENSE. If not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +#ifndef QEXTSCINTILLALEXERHTML_H +#define QEXTSCINTILLALEXERHTML_H + + +#include + +#include +#include + + +//! \brief The QextScintillaLexerHTML class encapsulates the Scintilla HTML +//! lexer. +class QEXTSCINTILLA_EXPORT QextScintillaLexerHTML : public QextScintillaLexer +{ + Q_OBJECT + +public: + //! This enum defines the meanings of the different styles used by the + //! HTML lexer. + enum { + //! The default. + Default = 0, + + //! A tag. + Tag = 1, + + //! An unknown tag. + UnknownTag = 2, + + //! An attribute. + Attribute = 3, + + //! An unknown attribute. + UnknownAttribute = 4, + + //! An HTML number. + HTMLNumber = 5, + + //! An HTML double-quoted string. + HTMLDoubleQuotedString = 6, + + //! An HTML single-quoted string. + HTMLSingleQuotedString = 7, + + //! Other text within a tag. + OtherInTag = 8, + + //! An HTML comment. + HTMLComment = 9, + + //! An entity. + Entity = 10, + + //! The end of an XML style tag. + XMLTagEnd = 11, + + //! The start of an XML fragment. + XMLStart = 12, + + //! The end of an XML fragment. + XMLEnd = 13, + + //! A script tag. + Script = 14, + + //! The start of an ASP fragment with @. + ASPAtStart = 15, + + //! The start of an ASP fragment. + ASPStart = 16, + + //! CDATA. + CDATA = 17, + + //! The start of a PHP fragment. + PHPStart = 18, + + //! An unquoted HTML value. + HTMLValue = 19, + + //! An ASP X-Code comment. + ASPXCComment = 20, + + //! The default for SGML. + SGMLDefault = 21, + + //! An SGML command. + SGMLCommand = 22, + + //! The first parameter of an SGML command. + SGMLParameter = 23, + + //! An SGML double-quoted string. + SGMLDoubleQuotedString = 24, + + //! An SGML single-quoted string. + SGMLSingleQuotedString = 25, + + //! An SGML error. + SGMLError = 26, + + //! An SGML special entity. + SGMLSpecial = 27, + + //! An SGML entity. + SGMLEntity = 28, + + //! An SGML comment. + SGMLComment = 29, + + //! A comment with the first parameter of an SGML command. + SGMLParameterComment = 30, + + //! The default for an SGML block. + SGMLBlockDefault = 31, + + //! The start of a JavaScript fragment. + JavaScriptStart = 40, + + //! The default for JavaScript. + JavaScriptDefault = 41, + + //! A JavaScript comment. + JavaScriptComment = 42, + + //! A JavaScript line comment. + JavaScriptCommentLine = 43, + + //! A JavaDoc style JavaScript comment. + JavaScriptCommentDoc = 44, + + //! A JavaScript number. + JavaScriptNumber = 45, + + //! A JavaScript word. + JavaScriptWord = 46, + + //! A JavaScript keyword. + JavaScriptKeyword = 47, + + //! A JavaScript double-quoted string. + JavaScriptDoubleQuotedString = 48, + + //! A JavaScript single-quoted string. + JavaScriptSingleQuotedString = 49, + + //! A JavaScript symbol. + JavaScriptSymbol = 50, + + //! The end of a JavaScript line where a string is not closed. + JavaScriptUnclosedString = 51, + + //! A JavaScript regular expression. + JavaScriptRegex = 52, + + //! The start of an ASP JavaScript fragment. + ASPJavaScriptStart = 55, + + //! The default for ASP JavaScript. + ASPJavaScriptDefault = 56, + + //! An ASP JavaScript comment. + ASPJavaScriptComment = 57, + + //! An ASP JavaScript line comment. + ASPJavaScriptCommentLine = 58, + + //! An ASP JavaDoc style JavaScript comment. + ASPJavaScriptCommentDoc = 59, + + //! An ASP JavaScript number. + ASPJavaScriptNumber = 60, + + //! An ASP JavaScript word. + ASPJavaScriptWord = 61, + + //! An ASP JavaScript keyword. + ASPJavaScriptKeyword = 62, + + //! An ASP JavaScript double-quoted string. + ASPJavaScriptDoubleQuotedString = 63, + + //! An ASP JavaScript single-quoted string. + ASPJavaScriptSingleQuotedString = 64, + + //! An ASP JavaScript symbol. + ASPJavaScriptSymbol = 65, + + //! The end of an ASP JavaScript line where a string is not + //! closed. + ASPJavaScriptUnclosedString = 66, + + //! An ASP JavaScript regular expression. + ASPJavaScriptRegex = 67, + + //! The start of a VBScript fragment. + VBScriptStart = 70, + + //! The default for VBScript. + VBScriptDefault = 71, + + //! A VBScript comment. + VBScriptComment = 72, + + //! A VBScript number. + VBScriptNumber = 73, + + //! A VBScript keyword. + VBScriptKeyword = 74, + + //! A VBScript string. + VBScriptString = 75, + + //! A VBScript identifier. + VBScriptIdentifier = 76, + + //! The end of a VBScript line where a string is not closed. + VBScriptUnclosedString = 77, + + //! The start of an ASP VBScript fragment. + ASPVBScriptStart = 80, + + //! The default for ASP VBScript. + ASPVBScriptDefault = 81, + + //! An ASP VBScript comment. + ASPVBScriptComment = 82, + + //! An ASP VBScript number. + ASPVBScriptNumber = 83, + + //! An ASP VBScript keyword. + ASPVBScriptKeyword = 84, + + //! An ASP VBScript string. + ASPVBScriptString = 85, + + //! An ASP VBScript identifier. + ASPVBScriptIdentifier = 86, + + //! The end of an ASP VBScript line where a string is not + //! closed. + ASPVBScriptUnclosedString = 87, + + //! The start of a Python fragment. + PythonStart = 90, + + //! The default for Python. + PythonDefault = 91, + + //! A Python comment. + PythonComment = 92, + + //! A Python number. + PythonNumber = 93, + + //! A Python double-quoted string. + PythonDoubleQuotedString = 94, + + //! A Python single-quoted string. + PythonSingleQuotedString = 95, + + //! A Python keyword. + PythonKeyword = 96, + + //! A Python triple single-quoted string. + PythonTripleSingleQuotedString = 97, + + //! A Python triple double-quoted string. + PythonTripleDoubleQuotedString = 98, + + //! The name of a Python class. + PythonClassName = 99, + + //! The name of a Python function or method. + PythonFunctionMethodName = 100, + + //! A Python operator. + PythonOperator = 101, + + //! A Python identifier. + PythonIdentifier = 102, + + //! The start of an ASP Python fragment. + ASPPythonStart = 105, + + //! The default for ASP Python. + ASPPythonDefault = 106, + + //! An ASP Python comment. + ASPPythonComment = 107, + + //! An ASP Python number. + ASPPythonNumber = 108, + + //! An ASP Python double-quoted string. + ASPPythonDoubleQuotedString = 109, + + //! An ASP Python single-quoted string. + ASPPythonSingleQuotedString = 110, + + //! An ASP Python keyword. + ASPPythonKeyword = 111, + + //! An ASP Python triple single-quoted string. + ASPPythonTripleSingleQuotedString = 112, + + //! An ASP Python triple double-quoted string. + ASPPythonTripleDoubleQuotedString = 113, + + //! The name of an ASP Python class. + ASPPythonClassName = 114, + + //! The name of an ASP Python function or method. + ASPPythonFunctionMethodName = 115, + + //! An ASP Python operator. + ASPPythonOperator = 116, + + //! An ASP Python identifier + ASPPythonIdentifier = 117, + + //! The default for PHP. + PHPDefault = 118, + + //! A PHP double-quoted string. + PHPDoubleQuotedString = 119, + + //! A PHP single-quoted string. + PHPSingleQuotedString = 120, + + //! A PHP keyword. + PHPKeyword = 121, + + //! A PHP number. + PHPNumber = 122, + + //! A PHP variable. + PHPVariable = 123, + + //! A PHP comment. + PHPComment = 124, + + //! A PHP line comment. + PHPCommentLine = 125, + + //! A PHP double-quoted variable. + PHPDoubleQuotedVariable = 126, + + //! A PHP operator. + PHPOperator = 127 + }; + + //! Construct a QextScintillaLexerHTML with parent \a parent and name + //! \a name. \a parent is typically the QextScintilla instance. + QextScintillaLexerHTML(QObject *parent = 0,const char *name = 0); + + //! Destroys the QextScintillaLexerHTML instance. + virtual ~QextScintillaLexerHTML(); + + //! Returns the name of the language. + const char *language() const; + + //! Returns the name of the lexer. Some lexers support a number of + //! languages. + const char *lexer() const; + + //! \internal Returns the string of characters that comprise a word. + const char *wordCharacters() const; + + //! Returns the foreground colour of the text for style number + //! \a style. + //! + //! \sa paper() + QColor color(int style) const; + + //! Returns the end-of-line fill for style number \a style. + bool eolFill(int style) const; + + //! Returns the font for style number \a style. + QFont font(int style) const; + + //! Returns the set of keywords for the keyword set \a set recognised + //! by the lexer as a space separated string. + const char *keywords(int set) const; + + //! Returns the descriptive name for style number \a style. If the + //! style is invalid for this language then QString::null is returned. + //! This is intended to be used in user preference dialogs. + QString description(int style) const; + + //! Returns the background colour of the text for style number + //! \a style. + //! + //! \sa color() + QColor paper(int style) const; + + //! Causes all properties to be refreshed by emitting the + //! propertyChanged() signal as required. + void refreshProperties(); + + //! Returns TRUE if trailing blank lines are included in a fold block. + //! + //! \sa setFoldCompact() + bool foldCompact() const; + + //! Returns TRUE if preprocessor blocks can be folded. + //! + //! \sa setFoldPreprocessor() + bool foldPreprocessor() const; + + //! Returns TRUE if tags are case sensitive. + //! + //! \sa setCaseSensitiveTags() + bool caseSensitiveTags() const; + +public slots: + //! If \a fold is TRUE then trailing blank lines are included in a fold + //! block. The default is TRUE. + //! + //! \sa foldCompact() + virtual void setFoldCompact(bool fold); + + //! If \a fold is TRUE then preprocessor blocks can be folded. The + //! default is FALSE. + //! + //! \sa foldPreprocessor() + virtual void setFoldPreprocessor(bool fold); + + //! If \a sens is TRUE then tags are case sensitive. The default is + //! FALSE. + //! + //! \sa caseSensitiveTags() + virtual void setCaseSensitiveTags(bool sens); + +protected: + //! The lexer's properties are read from the settings \a qs. \a prefix + //! (which has a trailing '/') should be used as a prefix to the key of + //! each setting. TRUE is returned if there is no error. + //! + bool readProperties(QSettings &qs,const QString &prefix); + + //! The lexer's properties are written to the settings \a qs. + //! \a prefix (which has a trailing '/') should be used as a prefix to + //! the key of each setting. TRUE is returned if there is no error. + //! + bool writeProperties(QSettings &qs,const QString &prefix) const; + +private: + void setCompactProp(); + void setPreprocProp(); + void setCaseSensTagsProp(); + + bool fold_compact; + bool fold_preproc; + bool case_sens_tags; + +#if defined(Q_DISABLE_COPY) + QextScintillaLexerHTML(const QextScintillaLexerHTML &); + QextScintillaLexerHTML &operator=(const QextScintillaLexerHTML &); +#endif +}; + +#endif diff --git a/qt/qextscintillalexeridl.cpp b/qt/qextscintillalexeridl.cpp new file mode 100644 index 0000000..96ea5eb --- /dev/null +++ b/qt/qextscintillalexeridl.cpp @@ -0,0 +1,102 @@ +// This module implements the QextScintillaLexerIDL class. +// +// Copyright (c) 2006 +// Riverbank Computing Limited +// +// This file is part of QScintilla. +// +// This copy of QScintilla is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2, or (at your option) any +// later version. +// +// QScintilla is supplied 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 +// QScintilla; see the file LICENSE. If not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +#include +#include + +#include "qextscintillalexeridl.h" + + +// The ctor. +QextScintillaLexerIDL::QextScintillaLexerIDL(QObject *parent,const char *name) + : QextScintillaLexerCPP(parent,name) +{ +} + + +// The dtor. +QextScintillaLexerIDL::~QextScintillaLexerIDL() +{ +} + + +// Returns the language name. +const char *QextScintillaLexerIDL::language() const +{ + return "IDL"; +} + + +// Returns the foreground colour of the text for a style. +QColor QextScintillaLexerIDL::color(int style) const +{ + if (style == UUID) + return QColor(0x80,0x40,0x80); + + return QextScintillaLexerCPP::color(style); +} + + +// Returns the set of keywords. +const char *QextScintillaLexerIDL::keywords(int set) const +{ + if (set != 1) + return 0; + + return "aggregatable allocate appobject arrays async async_uuid " + "auto_handle bindable boolean broadcast byte byte_count " + "call_as callback char coclass code comm_status const " + "context_handle context_handle_noserialize " + "context_handle_serialize control cpp_quote custom decode " + "default defaultbind defaultcollelem defaultvalue " + "defaultvtable dispinterface displaybind dllname double dual " + "enable_allocate encode endpoint entry enum error_status_t " + "explicit_handle fault_status first_is float handle_t heap " + "helpcontext helpfile helpstring helpstringcontext " + "helpstringdll hidden hyper id idempotent ignore iid_as iid_is " + "immediatebind implicit_handle import importlib in include " + "in_line int __int64 __int3264 interface last_is lcid " + "length_is library licensed local long max_is maybe message " + "methods midl_pragma midl_user_allocate midl_user_free min_is " + "module ms_union ncacn_at_dsp ncacn_dnet_nsp ncacn_http " + "ncacn_ip_tcp ncacn_nb_ipx ncacn_nb_nb ncacn_nb_tcp ncacn_np " + "ncacn_spx ncacn_vns_spp ncadg_ip_udp ncadg_ipx ncadg_mq " + "ncalrpc nocode nonbrowsable noncreatable nonextensible notify " + "object odl oleautomation optimize optional out out_of_line " + "pipe pointer_default pragma properties propget propput " + "propputref ptr public range readonly ref represent_as " + "requestedit restricted retval shape short signed size_is " + "small source strict_context_handle string struct switch " + "switch_is switch_type transmit_as typedef uidefault union " + "unique unsigned user_marshal usesgetlasterror uuid v1_enum " + "vararg version void wchar_t wire_marshal"; +} + + +// Returns the user name of a style. +QString QextScintillaLexerIDL::description(int style) const +{ + if (style == UUID) + return tr("UUID"); + + return QextScintillaLexerCPP::description(style); +} diff --git a/qt/qextscintillalexeridl.h b/qt/qextscintillalexeridl.h new file mode 100644 index 0000000..1a5c2ee --- /dev/null +++ b/qt/qextscintillalexeridl.h @@ -0,0 +1,72 @@ +// This defines the interface to the QextScintillaLexerIDL class. +// +// Copyright (c) 2006 +// Riverbank Computing Limited +// +// This file is part of QScintilla. +// +// This copy of QScintilla is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2, or (at your option) any +// later version. +// +// QScintilla is supplied 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 +// QScintilla; see the file LICENSE. If not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +#ifndef QEXTSCINTILLALEXERIDL_H +#define QEXTSCINTILLALEXERIDL_H + + +#include + +#include +#include + + +//! \brief The QextScintillaLexerIDL class encapsulates the Scintilla IDL +//! lexer. +class QEXTSCINTILLA_EXPORT QextScintillaLexerIDL : public QextScintillaLexerCPP +{ + Q_OBJECT + +public: + //! Construct a QextScintillaLexerIDL with parent \a parent and name + //! \a name. \a parent is typically the QextScintilla instance. + QextScintillaLexerIDL(QObject *parent = 0,const char *name = 0); + + //! Destroys the QextScintillaLexerIDL instance. + virtual ~QextScintillaLexerIDL(); + + //! Returns the name of the language. + const char *language() const; + + //! Returns the foreground colour of the text for style number + //! \a style. + //! + //! \sa paper() + QColor color(int style) const; + + //! Returns the set of keywords for the keyword set \a set recognised + //! by the lexer as a space separated string. + const char *keywords(int set) const; + + //! Returns the descriptive name for style number \a style. If the + //! style is invalid for this language then QString::null is returned. + //! This is intended to be used in user preference dialogs. + QString description(int style) const; + +private: +#if defined(Q_DISABLE_COPY) + QextScintillaLexerIDL(const QextScintillaLexerIDL &); + QextScintillaLexerIDL &operator=(const QextScintillaLexerIDL &); +#endif +}; + +#endif diff --git a/qt/qextscintillalexerjava.cpp b/qt/qextscintillalexerjava.cpp new file mode 100644 index 0000000..71e2cd3 --- /dev/null +++ b/qt/qextscintillalexerjava.cpp @@ -0,0 +1,59 @@ +// This module implements the QextScintillaLexerJava class. +// +// Copyright (c) 2006 +// Riverbank Computing Limited +// +// This file is part of QScintilla. +// +// This copy of QScintilla is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2, or (at your option) any +// later version. +// +// QScintilla is supplied 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 +// QScintilla; see the file LICENSE. If not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +#include "qextscintillalexerjava.h" + + +// The ctor. +QextScintillaLexerJava::QextScintillaLexerJava(QObject *parent,const char *name) + : QextScintillaLexerCPP(parent,name) +{ +} + + +// The dtor. +QextScintillaLexerJava::~QextScintillaLexerJava() +{ +} + + +// Returns the language name. +const char *QextScintillaLexerJava::language() const +{ + return "Java"; +} + + +// Returns the set of keywords. +const char *QextScintillaLexerJava::keywords(int set) const +{ + if (set != 1) + return 0; + + return "abstract assert boolean break byte case catch char class " + "const continue default do double else extends final finally " + "float for future generic goto if implements import inner " + "instanceof int interface long native new null operator outer " + "package private protected public rest return short static " + "super switch synchronized this throw throws transient try var " + "void volatile while"; +} diff --git a/qt/qextscintillalexerjava.h b/qt/qextscintillalexerjava.h new file mode 100644 index 0000000..1aa59d3 --- /dev/null +++ b/qt/qextscintillalexerjava.h @@ -0,0 +1,61 @@ +// This defines the interface to the QextScintillaLexerJava class. +// +// Copyright (c) 2006 +// Riverbank Computing Limited +// +// This file is part of QScintilla. +// +// This copy of QScintilla is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2, or (at your option) any +// later version. +// +// QScintilla is supplied 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 +// QScintilla; see the file LICENSE. If not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +#ifndef QEXTSCINTILLALEXERJAVA_H +#define QEXTSCINTILLALEXERJAVA_H + + +#include + +#include +#include + + +//! \brief The QextScintillaLexerJava class encapsulates the Scintilla Java +//! lexer. +class QEXTSCINTILLA_EXPORT QextScintillaLexerJava : public QextScintillaLexerCPP +{ + Q_OBJECT + +public: + //! Construct a QextScintillaLexerJava with parent \a parent and name + //! \a name. \a parent is typically the QextScintilla instance. + QextScintillaLexerJava(QObject *parent = 0,const char *name = 0); + + //! Destroys the QextScintillaLexerJava instance. + virtual ~QextScintillaLexerJava(); + + //! Returns the name of the language. + const char *language() const; + + //! Returns the set of keywords for the keyword set \a set recognised + //! by the lexer as a space separated string. + const char *keywords(int set) const; + +private: +#if defined(Q_DISABLE_COPY) + QextScintillaLexerJava(const QextScintillaLexerJava &); + QextScintillaLexerJava &operator=(const QextScintillaLexerJava &); +#endif +}; + +#endif diff --git a/qt/qextscintillalexerjavascript.cpp b/qt/qextscintillalexerjavascript.cpp new file mode 100644 index 0000000..ee46092 --- /dev/null +++ b/qt/qextscintillalexerjavascript.cpp @@ -0,0 +1,120 @@ +// This module implements the QextScintillaLexerJavaScript class. +// +// Copyright (c) 2006 +// Riverbank Computing Limited +// +// This file is part of QScintilla. +// +// This copy of QScintilla is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2, or (at your option) any +// later version. +// +// QScintilla is supplied 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 +// QScintilla; see the file LICENSE. If not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +#include +#include + +#include "qextscintillalexerjavascript.h" + + +// The list of JavaScript keywords that can be used by other friendly lexers. +const char *QextScintillaLexerJavaScript::keywordClass = + "abstract boolean break byte case catch char class const continue " + "debugger default delete do double else enum export extends final " + "finally float for function goto if implements import in instanceof " + "int interface long native new package private protected public " + "return short static super switch synchronized this throw throws " + "transient try typeof var void volatile while with"; + + +// The ctor. +QextScintillaLexerJavaScript::QextScintillaLexerJavaScript(QObject *parent,const char *name) + : QextScintillaLexerCPP(parent,name) +{ +} + + +// The dtor. +QextScintillaLexerJavaScript::~QextScintillaLexerJavaScript() +{ +} + + +// Returns the language name. +const char *QextScintillaLexerJavaScript::language() const +{ + return "JavaScript"; +} + + +// Returns the foreground colour of the text for a style. +QColor QextScintillaLexerJavaScript::color(int style) const +{ + if (style == Regex) + return QColor(0x3f,0x7f,0x3f); + + return QextScintillaLexerCPP::color(style); +} + + +// Returns the end-of-line fill for a style. +bool QextScintillaLexerJavaScript::eolFill(int style) const +{ + if (style == Regex) + return TRUE; + + return QextScintillaLexerCPP::eolFill(style); +} + + +// Returns the font of the text for a style. +QFont QextScintillaLexerJavaScript::font(int style) const +{ + if (style == Regex) +#if defined(Q_OS_WIN) + return QFont("Courier New",10); +#else + return QFont("Bitstream Vera Sans Mono",9); +#endif + + return QextScintillaLexerCPP::font(style); +} + + +// Returns the set of keywords. +const char *QextScintillaLexerJavaScript::keywords(int set) const +{ + if (set != 1) + return 0; + + return keywordClass; +} + + +// Returns the user name of a style. +QString QextScintillaLexerJavaScript::description(int style) const +{ + if (style == Regex) + return tr("Regular expression"); + + return QextScintillaLexerCPP::description(style); +} + + +// Returns the background colour of the text for a style. +QColor QextScintillaLexerJavaScript::paper(int style) const +{ + if (style == Regex) + return QColor(0xe0,0xf0,0xff); + + return QextScintillaLexer::paper(style); +} diff --git a/qt/qextscintillalexerjavascript.h b/qt/qextscintillalexerjavascript.h new file mode 100644 index 0000000..b166524 --- /dev/null +++ b/qt/qextscintillalexerjavascript.h @@ -0,0 +1,88 @@ +// This defines the interface to the QextScintillaLexerJavaScript class. +// +// Copyright (c) 2006 +// Riverbank Computing Limited +// +// This file is part of QScintilla. +// +// This copy of QScintilla is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2, or (at your option) any +// later version. +// +// QScintilla is supplied 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 +// QScintilla; see the file LICENSE. If not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +#ifndef QEXTSCINTILLALEXERJSCRIPT_H +#define QEXTSCINTILLALEXERJSCRIPT_H + + +#include + +#include +#include + + +//! \brief The QextScintillaLexerJavaScript class encapsulates the Scintilla +//! JavaScript lexer. +class QEXTSCINTILLA_EXPORT QextScintillaLexerJavaScript : public QextScintillaLexerCPP +{ + Q_OBJECT + +public: + //! Construct a QextScintillaLexerJavaScript with parent \a parent and + //! name \a name. \a parent is typically the QextScintilla instance. + QextScintillaLexerJavaScript(QObject *parent = 0,const char *name = 0); + + //! Destroys the QextScintillaLexerJavaScript instance. + virtual ~QextScintillaLexerJavaScript(); + + //! Returns the name of the language. + const char *language() const; + + //! Returns the foreground colour of the text for style number + //! \a style. + //! + //! \sa paper() + QColor color(int style) const; + + //! Returns the end-of-line fill for style number \a style. + bool eolFill(int style) const; + + //! Returns the font for style number \a style. + QFont font(int style) const; + + //! Returns the set of keywords for the keyword set \a set recognised + //! by the lexer as a space separated string. + const char *keywords(int set) const; + + //! Returns the descriptive name for style number \a style. If the + //! style is invalid for this language then QString::null is returned. + //! This is intended to be used in user preference dialogs. + QString description(int style) const; + + //! Returns the background colour of the text for style number + //! \a style. + //! + //! \sa color() + QColor paper(int style) const; + +private: + friend class QextScintillaLexerHTML; + + static const char *keywordClass; + +#if defined(Q_DISABLE_COPY) + QextScintillaLexerJavaScript(const QextScintillaLexerJavaScript &); + QextScintillaLexerJavaScript &operator=(const QextScintillaLexerJavaScript &); +#endif +}; + +#endif diff --git a/qt/qextscintillalexerlua.cpp b/qt/qextscintillalexerlua.cpp new file mode 100644 index 0000000..05090bf --- /dev/null +++ b/qt/qextscintillalexerlua.cpp @@ -0,0 +1,346 @@ +// This module implements the QextScintillaLexerLua class. +// +// Copyright (c) 2006 +// Riverbank Computing Limited +// +// This file is part of QScintilla. +// +// This copy of QScintilla is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2, or (at your option) any +// later version. +// +// QScintilla is supplied 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 +// QScintilla; see the file LICENSE. If not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +#include +#include +#include + +#include "qextscintillalexerlua.h" + + +// The ctor. +QextScintillaLexerLua::QextScintillaLexerLua(QObject *parent, const char *name) + : QextScintillaLexer(parent,name), fold_compact(TRUE) +{ +} + + +// The dtor. +QextScintillaLexerLua::~QextScintillaLexerLua() +{ +} + + +// Returns the language name. +const char *QextScintillaLexerLua::language() const +{ + return "Lua"; +} + + +// Returns the lexer name. +const char *QextScintillaLexerLua::lexer() const +{ + return "lua"; +} + + +// Return the list of characters that can start a block. +const char *QextScintillaLexerLua::blockStart(int *style) const +{ + if (style) + *style = Operator; + + return ""; +} + + +// Return the style used for braces. +int QextScintillaLexerLua::braceStyle() const +{ + return Operator; +} + + +// Returns the foreground colour of the text for a style. +QColor QextScintillaLexerLua::color(int style) const +{ + switch (style) + { + case Default: + return QColor(0x00,0x00,0x00); + + case Comment: + case LineComment: + return QColor(0x00,0x7f,0x00); + + case Number: + return QColor(0x00,0x7f,0x7f); + + case Keyword: + case BasicFunctions: + case StringTableMathsFunctions: + case CoroutinesIOSystemFacilities: + return QColor(0x00,0x00,0x7f); + + case String: + case Character: + case LiteralString: + return QColor(0x7f,0x00,0x7f); + + case Preprocessor: + return QColor(0x7f,0x7f,0x00); + + case Operator: + case Identifier: + break; + } + + return QextScintillaLexer::color(style); +} + + +// Returns the end-of-line fill for a style. +bool QextScintillaLexerLua::eolFill(int style) const +{ + return (style == Comment || style == UnclosedString); +} + + +// Returns the font of the text for a style. +QFont QextScintillaLexerLua::font(int style) const +{ + QFont f; + + switch (style) + { + case Comment: + case LineComment: + case LiteralString: +#if defined(Q_OS_WIN) + f = QFont("Comic Sans MS",9); +#else + f = QFont("Bitstream Vera Serif",9); +#endif + break; + + default: + f = QextScintillaLexer::font(style); + } + + return f; +} + + +// Returns the set of keywords. +const char *QextScintillaLexerLua::keywords(int set) const +{ + if (set == 1) + // Keywords. + return + "and break do else elseif end false for function if " + "in local nil not or repeat return then true until " + "while"; + + if (set == 2) + // Basic functions. + return + "_ALERT _ERRORMESSAGE _INPUT _PROMPT _OUTPUT _STDERR " + "_STDIN _STDOUT call dostring foreach foreachi getn " + "globals newtype rawget rawset require sort tinsert " + "tremove " + + "G getfenv getmetatable ipairs loadlib next pairs " + "pcall rawegal rawget rawset require setfenv " + "setmetatable xpcall string table math coroutine io " + "os debug"; + + if (set == 3) + // String, table and maths functions. + return + "abs acos asin atan atan2 ceil cos deg exp floor " + "format frexp gsub ldexp log log10 max min mod rad " + "random randomseed sin sqrt strbyte strchar strfind " + "strlen strlower strrep strsub strupper tan " + + "string.byte string.char string.dump string.find " + "string.len string.lower string.rep string.sub " + "string.upper string.format string.gfind string.gsub " + "table.concat table.foreach table.foreachi table.getn " + "table.sort table.insert table.remove table.setn " + "math.abs math.acos math.asin math.atan math.atan2 " + "math.ceil math.cos math.deg math.exp math.floor " + "math.frexp math.ldexp math.log math.log10 math.max " + "math.min math.mod math.pi math.rad math.random " + "math.randomseed math.sin math.sqrt math.tan"; + + if (set == 4) + // Coroutine, I/O and system facilities. + return + "openfile closefile readfrom writeto appendto remove " + "rename flush seek tmpfile tmpname read write clock " + "date difftime execute exit getenv setlocale time " + + "coroutine.create coroutine.resume coroutine.status " + "coroutine.wrap coroutine.yield io.close io.flush " + "io.input io.lines io.open io.output io.read " + "io.tmpfile io.type io.write io.stdin io.stdout " + "io.stderr os.clock os.date os.difftime os.execute " + "os.exit os.getenv os.remove os.rename os.setlocale " + "os.time os.tmpname"; + + return 0; +} + + +// Returns the user name of a style. +QString QextScintillaLexerLua::description(int style) const +{ + switch (style) + { + case Default: + return tr("Default"); + + case Comment: + return tr("Comment"); + + case LineComment: + return tr("Line comment"); + + case Number: + return tr("Number"); + + case Keyword: + return tr("Keyword"); + + case String: + return tr("String"); + + case Character: + return tr("Character"); + + case LiteralString: + return tr("Literal string"); + + case Preprocessor: + return tr("Preprocessor"); + + case Operator: + return tr("Operator"); + + case Identifier: + return tr("Identifier"); + + case UnclosedString: + return tr("Unclosed string"); + + case BasicFunctions: + return tr("Basic functions"); + + case StringTableMathsFunctions: + return tr("String, table and maths functions"); + + case CoroutinesIOSystemFacilities: + return tr("Coroutines, i/o and system facilities"); + } + + return QString::null; +} + + +// Returns the background colour of the text for a style. +QColor QextScintillaLexerLua::paper(int style) const +{ + switch (style) + { + case Comment: + return QColor(0xd0,0xf0,0xf0); + + case LiteralString: + return QColor(0xe0,0xff,0xff); + + case UnclosedString: + return QColor(0xe0,0xc0,0xe0); + + case BasicFunctions: + return QColor(0xd0,0xff,0xd0); + + case StringTableMathsFunctions: + return QColor(0xd0,0xd0,0xff); + + case CoroutinesIOSystemFacilities: + return QColor(0xff,0xd0,0xd0); + } + + return QextScintillaLexer::paper(style); +} + + +// Refresh all properties. +void QextScintillaLexerLua::refreshProperties() +{ + setCompactProp(); +} + + +// Read properties from the settings. +bool QextScintillaLexerLua::readProperties(QSettings &qs,const QString &prefix) +{ + int rc = TRUE; + bool ok, flag; + + // Read the fold compact flag. + flag = qs.readBoolEntry(prefix + "foldcompact",TRUE,&ok); + + if (ok) + fold_compact = flag; + else + rc = FALSE; + + return rc; +} + + +// Write properties to the settings. +bool QextScintillaLexerLua::writeProperties(QSettings &qs,const QString &prefix) const +{ + int rc = TRUE; + + // Write the fold compact flag. + if (!qs.writeEntry(prefix + "foldcompact",fold_compact)) + rc = FALSE; + + return rc; +} + + +// Return TRUE if folds are compact. +bool QextScintillaLexerLua::foldCompact() const +{ + return fold_compact; +} + + +// Set if folds are compact. +void QextScintillaLexerLua::setFoldCompact(bool fold) +{ + fold_compact = fold; + + setCompactProp(); +} + + +// Set the "fold.compact" property. +void QextScintillaLexerLua::setCompactProp() +{ + emit propertyChanged("fold.compact",(fold_compact ? "1" : "0")); +} diff --git a/qt/qextscintillalexerlua.h b/qt/qextscintillalexerlua.h new file mode 100644 index 0000000..73016e6 --- /dev/null +++ b/qt/qextscintillalexerlua.h @@ -0,0 +1,178 @@ +// This defines the interface to the QextScintillaLexerLua class. +// +// Copyright (c) 2006 +// Riverbank Computing Limited +// +// This file is part of QScintilla. +// +// This copy of QScintilla is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2, or (at your option) any +// later version. +// +// QScintilla is supplied 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 +// QScintilla; see the file LICENSE. If not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +#ifndef QEXTSCINTILLALEXERLUA_H +#define QEXTSCINTILLALEXERLUA_H + + +#include + +#include +#include + + +//! \brief The QextScintillaLexerLua class encapsulates the Scintilla Lua +//! lexer. +class QEXTSCINTILLA_EXPORT QextScintillaLexerLua : public QextScintillaLexer +{ + Q_OBJECT + +public: + //! This enum defines the meanings of the different styles used by the + //! Lua lexer. + enum { + //! The default. + Default = 0, + + //! A block comment. + Comment = 1, + + //! A line comment. + LineComment = 2, + + //! A number. + Number = 4, + + //! A keyword. + Keyword = 5, + + //! A string. + String = 6, + + //! A character. + Character = 7, + + //! A literal string. + LiteralString = 8, + + //! Preprocessor + Preprocessor = 9, + + //! An operator. + Operator = 10, + + //! An identifier + Identifier = 11, + + //! The end of a line where a string is not closed. + UnclosedString = 12, + + //! Basic functions. + BasicFunctions = 13, + + //! String, table and maths functions. + StringTableMathsFunctions = 14, + + //! Coroutines, I/O and system facilities. + CoroutinesIOSystemFacilities = 15 + }; + + //! Construct a QextScintillaLexerLua with parent \a parent and name + //! \a name. \a parent is typically the QextScintilla instance. + QextScintillaLexerLua(QObject *parent = 0,const char *name = 0); + + //! Destroys the QextScintillaLexerLua instance. + virtual ~QextScintillaLexerLua(); + + //! Returns the name of the language. + const char *language() const; + + //! Returns the name of the lexer. Some lexers support a number of + //! languages. + const char *lexer() const; + + //! \internal Returns a space separated list of words or characters in + //! a particular style that define the start of a block for + //! auto-indentation. The styles is returned via \a style. + const char *blockStart(int *style = 0) const; + + //! \internal Returns the style used for braces for brace matching. + int braceStyle() const; + + //! Returns the foreground colour of the text for style number + //! \a style. + //! + //! \sa paper() + QColor color(int style) const; + + //! Returns the end-of-line fill for style number \a style. + bool eolFill(int style) const; + + //! Returns the font for style number \a style. + QFont font(int style) const; + + //! Returns the set of keywords for the keyword set \a set recognised + //! by the lexer as a space separated string. + const char *keywords(int set) const; + + //! Returns the descriptive name for style number \a style. If the + //! style is invalid for this language then QString::null is returned. + //! This is intended to be used in user preference dialogs. + QString description(int style) const; + + //! Returns the background colour of the text for style number + //! \a style. + //! + //! \sa color() + QColor paper(int style) const; + + //! Causes all properties to be refreshed by emitting the + //! propertyChanged() signal as required. + void refreshProperties(); + + //! Returns TRUE if trailing blank lines are included in a fold block. + //! + //! \sa setFoldCompact() + bool foldCompact() const; + +public slots: + //! If \a fold is TRUE then trailing blank lines are included in a fold + //! block. The default is TRUE. + //! + //! \sa foldCompact() + virtual void setFoldCompact(bool fold); + +protected: + //! The lexer's properties are read from the settings \a qs. \a prefix + //! (which has a trailing '/') should be used as a prefix to the key of + //! each setting. TRUE is returned if there is no error. + //! + bool readProperties(QSettings &qs,const QString &prefix); + + //! The lexer's properties are written to the settings \a qs. + //! \a prefix (which has a trailing '/') should be used as a prefix to + //! the key of each setting. TRUE is returned if there is no error. + //! + bool writeProperties(QSettings &qs,const QString &prefix) const; + +private: + void setCompactProp(); + + bool fold_compact; + +#if defined(Q_DISABLE_COPY) + QextScintillaLexerLua(const QextScintillaLexerLua &); + QextScintillaLexerLua &operator=(const QextScintillaLexerLua &); +#endif +}; + +#endif diff --git a/qt/qextscintillalexermakefile.cpp b/qt/qextscintillalexermakefile.cpp new file mode 100644 index 0000000..10e219b --- /dev/null +++ b/qt/qextscintillalexermakefile.cpp @@ -0,0 +1,156 @@ +// This module implements the QextScintillaLexerMakefile class. +// +// Copyright (c) 2006 +// Riverbank Computing Limited +// +// This file is part of QScintilla. +// +// This copy of QScintilla is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2, or (at your option) any +// later version. +// +// QScintilla is supplied 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 +// QScintilla; see the file LICENSE. If not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +#include +#include +#include + +#include "qextscintillalexermakefile.h" + + +// The ctor. +QextScintillaLexerMakefile::QextScintillaLexerMakefile(QObject *parent,const char *name) + : QextScintillaLexer(parent,name) +{ +} + + +// The dtor. +QextScintillaLexerMakefile::~QextScintillaLexerMakefile() +{ +} + + +// Returns the language name. +const char *QextScintillaLexerMakefile::language() const +{ + return "Makefile"; +} + + +// Returns the lexer name. +const char *QextScintillaLexerMakefile::lexer() const +{ + return "makefile"; +} + + +// Return the string of characters that comprise a word. +const char *QextScintillaLexerMakefile::wordCharacters() const +{ + return "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-"; +} + + +// Returns the foreground colour of the text for a style. +QColor QextScintillaLexerMakefile::color(int style) const +{ + switch (style) + { + case Default: + case Operator: + return QColor(0x00,0x00,0x00); + + case Comment: + return QColor(0x00,0x7f,0x00); + + case Preprocessor: + return QColor(0x7f,0x7f,0x00); + + case Variable: + return QColor(0x00,0x00,0x80); + + case Target: + return QColor(0xa0,0x00,0x00); + + case Error: + return QColor(0xff,0xff,0x00); + } + + return QextScintillaLexer::color(style); +} + + +// Returns the end-of-line fill for a style. +bool QextScintillaLexerMakefile::eolFill(int style) const +{ + return (style == Error); +} + + +// Returns the font of the text for a style. +QFont QextScintillaLexerMakefile::font(int style) const +{ + QFont f; + + if (style == Comment) +#if defined(Q_OS_WIN) + f = QFont("Comic Sans MS",9); +#else + f = QFont("Bitstream Vera Serif",9); +#endif + else + f = QextScintillaLexer::font(style); + + return f; +} + + +// Returns the user name of a style. +QString QextScintillaLexerMakefile::description(int style) const +{ + switch (style) + { + case Default: + return tr("Default"); + + case Comment: + return tr("Comment"); + + case Preprocessor: + return tr("Preprocessor"); + + case Variable: + return tr("Variable"); + + case Operator: + return tr("Operator"); + + case Target: + return tr("Target"); + + case Error: + return tr("Error"); + } + + return QString::null; +} + + +// Returns the background colour of the text for a style. +QColor QextScintillaLexerMakefile::paper(int style) const +{ + if (style == Error) + return QColor(0xff,0x00,0x00); + + return QextScintillaLexer::paper(style); +} diff --git a/qt/qextscintillalexermakefile.h b/qt/qextscintillalexermakefile.h new file mode 100644 index 0000000..34b2e6a --- /dev/null +++ b/qt/qextscintillalexermakefile.h @@ -0,0 +1,112 @@ +// This defines the interface to the QextScintillaLexerMakefile class. +// +// Copyright (c) 2006 +// Riverbank Computing Limited +// +// This file is part of QScintilla. +// +// This copy of QScintilla is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2, or (at your option) any +// later version. +// +// QScintilla is supplied 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 +// QScintilla; see the file LICENSE. If not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +#ifndef QEXTSCINTILLALEXERMAKEFILE_H +#define QEXTSCINTILLALEXERMAKEFILE_H + + +#include + +#include +#include + + +//! \brief The QextScintillaLexerMakefile class encapsulates the Scintilla +//! Makefile lexer. +class QEXTSCINTILLA_EXPORT QextScintillaLexerMakefile : public QextScintillaLexer +{ + Q_OBJECT + +public: + //! This enum defines the meanings of the different styles used by the + //! Makefile lexer. + enum { + //! The default. + Default = 0, + + //! A comment. + Comment = 1, + + //! A pre-processor directive. + Preprocessor = 2, + + //! A variable. + Variable = 3, + + //! An operator. + Operator = 4, + + //! A target. + Target = 5, + + //! An error. + Error = 9 + }; + + //! Construct a QextScintillaLexerMakefile with parent \a parent and + //! name \a name. \a parent is typically the QextScintilla instance. + QextScintillaLexerMakefile(QObject *parent = 0,const char *name = 0); + + //! Destroys the QextScintillaLexerMakefile instance. + virtual ~QextScintillaLexerMakefile(); + + //! Returns the name of the language. + const char *language() const; + + //! Returns the name of the lexer. Some lexers support a number of + //! languages. + const char *lexer() const; + + //! \internal Returns the string of characters that comprise a word. + const char *wordCharacters() const; + + //! Returns the foreground colour of the text for style number + //! \a style. + //! + //! \sa paper() + QColor color(int style) const; + + //! Returns the end-of-line fill for style number \a style. + bool eolFill(int style) const; + + //! Returns the font for style number \a style. + QFont font(int style) const; + + //! Returns the descriptive name for style number \a style. If the + //! style is invalid for this language then QString::null is returned. + //! This is intended to be used in user preference dialogs. + QString description(int style) const; + + //! Returns the background colour of the text for style number + //! \a style. + //! + //! \sa color() + QColor paper(int style) const; + +private: +#if defined(Q_DISABLE_COPY) + QextScintillaLexerMakefile(const QextScintillaLexerMakefile &); + QextScintillaLexerMakefile &operator=(const QextScintillaLexerMakefile &); +#endif +}; + +#endif diff --git a/qt/qextscintillalexerperl.cpp b/qt/qextscintillalexerperl.cpp new file mode 100644 index 0000000..1d5c15b --- /dev/null +++ b/qt/qextscintillalexerperl.cpp @@ -0,0 +1,482 @@ +// This module implements the QextScintillaLexerPerl class. +// +// Copyright (c) 2006 +// Riverbank Computing Limited +// +// This file is part of QScintilla. +// +// This copy of QScintilla is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2, or (at your option) any +// later version. +// +// QScintilla is supplied 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 +// QScintilla; see the file LICENSE. If not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +#include +#include +#include + +#include "qextscintillalexerperl.h" + + +// The ctor. +QextScintillaLexerPerl::QextScintillaLexerPerl(QObject *parent, + const char *name) + : QextScintillaLexer(parent,name), fold_comments(FALSE), + fold_compact(TRUE) +{ +} + + +// The dtor. +QextScintillaLexerPerl::~QextScintillaLexerPerl() +{ +} + + +// Returns the language name. +const char *QextScintillaLexerPerl::language() const +{ + return "Perl"; +} + + +// Returns the lexer name. +const char *QextScintillaLexerPerl::lexer() const +{ + return "perl"; +} + + +// Return the style used for braces. +int QextScintillaLexerPerl::braceStyle() const +{ + return Operator; +} + + +// Return the string of characters that comprise a word. +const char *QextScintillaLexerPerl::wordCharacters() const +{ + return "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_$@%&"; +} + + +// Returns the foreground colour of the text for a style. +QColor QextScintillaLexerPerl::color(int style) const +{ + switch (style) + { + case Default: + return QColor(0x80,0x80,0x80); + + case Error: + case Backticks: + case QuotedStringQX: + return QColor(0xff,0xff,0x00); + + case Comment: + return QColor(0x00,0x7f,0x00); + + case POD: + case PODVerbatim: + return QColor(0x00,0x40,0x00); + + case Number: + return QColor(0x00,0x7f,0x7f); + + case Keyword: + return QColor(0x00,0x00,0x7f); + + case DoubleQuotedString: + case SingleQuotedString: + case SingleQuotedHereDocument: + case DoubleQuotedHereDocument: + case BacktickHereDocument: + case QuotedStringQ: + case QuotedStringQQ: + return QColor(0x7f,0x00,0x7f); + + case Operator: + case Identifier: + case Scalar: + case Array: + case Hash: + case SymbolTable: + case Regex: + case Substitution: + case HereDocumentDelimiter: + case QuotedStringQR: + case QuotedStringQW: + return QColor(0x00,0x00,0x00); + + case DataSection: + return QColor(0x60,0x00,0x00); + } + + return QextScintillaLexer::color(style); +} + + +// Returns the end-of-line fill for a style. +bool QextScintillaLexerPerl::eolFill(int style) const +{ + switch (style) + { + case POD: + case DataSection: + case SingleQuotedHereDocument: + case DoubleQuotedHereDocument: + case BacktickHereDocument: + case PODVerbatim: + return TRUE; + } + + return FALSE; +} + + +// Returns the font of the text for a style. +QFont QextScintillaLexerPerl::font(int style) const +{ + QFont f; + + switch (style) + { + case Comment: +#if defined(Q_OS_WIN) + f = QFont("Comic Sans MS",9); +#else + f = QFont("Bitstream Vera Serif",9); +#endif + break; + + case POD: +#if defined(Q_OS_WIN) + f = QFont("Times New Roman",11); +#else + f = QFont("Bitstream Charter",10); +#endif + break; + + case Keyword: + case Operator: + case DoubleQuotedHereDocument: + f = QextScintillaLexer::font(style); + f.setBold(TRUE); + break; + + case DoubleQuotedString: + case SingleQuotedString: + case QuotedStringQQ: + case PODVerbatim: +#if defined(Q_OS_WIN) + f = QFont("Courier New",10); +#else + f = QFont("Bitstream Vera Sans Mono",9); +#endif + break; + + case BacktickHereDocument: + f = QextScintillaLexer::font(style); + f.setItalic(TRUE); + break; + + default: + f = QextScintillaLexer::font(style); + } + + return f; +} + + +// Returns the set of keywords. +const char *QextScintillaLexerPerl::keywords(int set) const +{ + if (set == 1) + return + "NULL __FILE__ __LINE__ __PACKAGE__ __DATA__ __END__ " + "AUTOLOAD BEGIN CORE DESTROY END EQ GE GT INIT LE LT " + "NE CHECK abs accept alarm and atan2 bind binmode " + "bless caller chdir chmod chomp chop chown chr chroot " + "close closedir cmp connect continue cos crypt " + "dbmclose dbmopen defined delete die do dump each " + "else elsif endgrent endhostent endnetent endprotoent " + "endpwent endservent eof eq eval exec exists exit exp " + "fcntl fileno flock for foreach fork format formline " + "ge getc getgrent getgrgid getgrnam gethostbyaddr " + "gethostbyname gethostent getlogin getnetbyaddr " + "getnetbyname getnetent getpeername getpgrp getppid " + "getpriority getprotobyname getprotobynumber " + "getprotoent getpwent getpwnam getpwuid getservbyname " + "getservbyport getservent getsockname getsockopt glob " + "gmtime goto grep gt hex if index int ioctl join keys " + "kill last lc lcfirst le length link listen local " + "localtime lock log lstat lt m map mkdir msgctl " + "msgget msgrcv msgsnd my ne next no not oct open " + "opendir or ord our pack package pipe pop pos print " + "printf prototype push q qq qr quotemeta qu qw qx " + "rand read readdir readline readlink readpipe recv " + "redo ref rename require reset return reverse " + "rewinddir rindex rmdir s scalar seek seekdir select " + "semctl semget semop send setgrent sethostent " + "setnetent setpgrp setpriority setprotoent setpwent " + "setservent setsockopt shift shmctl shmget shmread " + "shmwrite shutdown sin sleep socket socketpair sort " + "splice split sprintf sqrt srand stat study sub " + "substr symlink syscall sysopen sysread sysseek " + "system syswrite tell telldir tie tied time times tr " + "truncate uc ucfirst umask undef unless unlink unpack " + "unshift untie until use utime values vec wait " + "waitpid wantarray warn while write x xor y"; + + return 0; +} + + +// Returns the user name of a style. +QString QextScintillaLexerPerl::description(int style) const +{ + switch (style) + { + case Default: + return tr("Default"); + + case Error: + return tr("Error"); + + case Comment: + return tr("Comment"); + + case POD: + return tr("POD"); + + case Number: + return tr("Number"); + + case Keyword: + return tr("Keyword"); + + case DoubleQuotedString: + return tr("Double-quoted string"); + + case SingleQuotedString: + return tr("Single-quoted string"); + + case Operator: + return tr("Operator"); + + case Identifier: + return tr("Identifier"); + + case Scalar: + return tr("Scalar"); + + case Array: + return tr("Array"); + + case Hash: + return tr("Hash"); + + case SymbolTable: + return tr("Symbol table"); + + case Regex: + return tr("Regular expression"); + + case Substitution: + return tr("Substitution"); + + case Backticks: + return tr("Backticks"); + + case DataSection: + return tr("Data section"); + + case HereDocumentDelimiter: + return tr("Here document delimiter"); + + case SingleQuotedHereDocument: + return tr("Single-quoted here document"); + + case DoubleQuotedHereDocument: + return tr("Double-quoted here document"); + + case BacktickHereDocument: + return tr("Backtick here document"); + + case QuotedStringQ: + return tr("Quoted string (q)"); + + case QuotedStringQQ: + return tr("Quoted string (qq)"); + + case QuotedStringQX: + return tr("Quoted string (qx)"); + + case QuotedStringQR: + return tr("Quoted string (qr)"); + + case QuotedStringQW: + return tr("Quoted string (qw)"); + + case PODVerbatim: + return tr("POD verbatim"); + } + + return QString::null; +} + + +// Returns the background colour of the text for a style. +QColor QextScintillaLexerPerl::paper(int style) const +{ + switch (style) + { + case Error: + return QColor(0xff,0x00,0x00); + + case POD: + return QColor(0xe0,0xff,0xe0); + + case Scalar: + return QColor(0xff,0xe0,0xe0); + + case Array: + return QColor(0xff,0xff,0xe0); + + case Hash: + return QColor(0xff,0xe0,0xff); + + case SymbolTable: + return QColor(0xe0,0xe0,0xe0); + + case Regex: + return QColor(0xa0,0xff,0xa0); + + case Substitution: + return QColor(0xf0,0xe0,0x80); + + case Backticks: + return QColor(0xa0,0x80,0x80); + + case DataSection: + return QColor(0xff,0xf0,0xd8); + + case HereDocumentDelimiter: + case SingleQuotedHereDocument: + case DoubleQuotedHereDocument: + case BacktickHereDocument: + return QColor(0xdd,0xd0,0xdd); + + case PODVerbatim: + return QColor(0xc0,0xff,0xc0); + } + + return QextScintillaLexer::paper(style); +} + + +// Refresh all properties. +void QextScintillaLexerPerl::refreshProperties() +{ + setCommentProp(); + setCompactProp(); +} + + +// Read properties from the settings. +bool QextScintillaLexerPerl::readProperties(QSettings &qs,const QString &prefix) +{ + int rc = TRUE; + bool ok, flag; + + // Read the fold comments flag. + flag = qs.readBoolEntry(prefix + "foldcomments",FALSE,&ok); + + if (ok) + fold_comments = flag; + else + rc = FALSE; + + // Read the fold compact flag. + flag = qs.readBoolEntry(prefix + "foldcompact",TRUE,&ok); + + if (ok) + fold_compact = flag; + else + rc = FALSE; + + return rc; +} + + +// Write properties to the settings. +bool QextScintillaLexerPerl::writeProperties(QSettings &qs,const QString &prefix) const +{ + int rc = TRUE; + + // Write the fold comments flag. + if (!qs.writeEntry(prefix + "foldcomments",fold_comments)) + rc = FALSE; + + // Write the fold compact flag. + if (!qs.writeEntry(prefix + "foldcompact",fold_compact)) + rc = FALSE; + + return rc; +} + + +// Return TRUE if comments can be folded. +bool QextScintillaLexerPerl::foldComments() const +{ + return fold_comments; +} + + +// Set if comments can be folded. +void QextScintillaLexerPerl::setFoldComments(bool fold) +{ + fold_comments = fold; + + setCommentProp(); +} + + +// Set the "fold.comment" property. +void QextScintillaLexerPerl::setCommentProp() +{ + emit propertyChanged("fold.comment",(fold_comments ? "1" : "0")); +} + + +// Return TRUE if folds are compact. +bool QextScintillaLexerPerl::foldCompact() const +{ + return fold_compact; +} + + +// Set if folds are compact +void QextScintillaLexerPerl::setFoldCompact(bool fold) +{ + fold_compact = fold; + + setCompactProp(); +} + + +// Set the "fold.compact" property. +void QextScintillaLexerPerl::setCompactProp() +{ + emit propertyChanged("fold.compact",(fold_compact ? "1" : "0")); +} diff --git a/qt/qextscintillalexerperl.h b/qt/qextscintillalexerperl.h new file mode 100644 index 0000000..0beb75a --- /dev/null +++ b/qt/qextscintillalexerperl.h @@ -0,0 +1,231 @@ +// This defines the interface to the QextScintillaLexerPerl class. +// +// Copyright (c) 2006 +// Riverbank Computing Limited +// +// This file is part of QScintilla. +// +// This copy of QScintilla is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2, or (at your option) any +// later version. +// +// QScintilla is supplied 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 +// QScintilla; see the file LICENSE. If not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +#ifndef QEXTSCINTILLALEXERPERL_H +#define QEXTSCINTILLALEXERPERL_H + + +#include + +#include +#include + + +//! \brief The QextScintillaLexerPerl class encapsulates the Scintilla Perl +//! lexer. +class QEXTSCINTILLA_EXPORT QextScintillaLexerPerl : public QextScintillaLexer +{ + Q_OBJECT + +public: + //! This enum defines the meanings of the different styles used by the + //! Perl lexer. + enum { + //! The default. + Default = 0, + + //! \deprecated White space. + WhiteSpace = Default, + + //! An error. + Error = 1, + + //! A comment. + Comment = 2, + + //! A POD. + POD = 3, + + //! A number. + Number = 4, + + //! A keyword. + Keyword = 5, + + //! A double-quoted string. + DoubleQuotedString = 6, + + //! A single-quoted string. + SingleQuotedString = 7, + + //! An operator. + Operator = 10, + + //! An identifier + Identifier = 11, + + //! A scalar. + Scalar = 12, + + //! An array. + Array = 13, + + //! A hash. + Hash = 14, + + //! A symbol table. + SymbolTable = 15, + + //! A regular expression. + Regex = 17, + + //! A substitution. + Substitution = 18, + + //! Backticks. + Backticks = 20, + + //! A data section. + DataSection = 21, + + //! A here document delimiter. + HereDocumentDelimiter = 22, + + //! A single quoted here document. + SingleQuotedHereDocument = 23, + + //! A double quoted here document. + DoubleQuotedHereDocument = 24, + + //! A backtick here document. + BacktickHereDocument = 25, + + //! A quoted string (q). + QuotedStringQ = 26, + + //! A quoted string (qq). + QuotedStringQQ = 27, + + //! A quoted string (qx). + QuotedStringQX = 28, + + //! A quoted string (qr). + QuotedStringQR = 29, + + //! A quoted string (qw). + QuotedStringQW = 30, + + //! A verbatim POD. + PODVerbatim = 31 + }; + + //! Construct a QextScintillaLexerPerl with parent \a parent and name + //! \a name. \a parent is typically the QextScintilla instance. + QextScintillaLexerPerl(QObject *parent = 0,const char *name = 0); + + //! Destroys the QextScintillaLexerPerl instance. + virtual ~QextScintillaLexerPerl(); + + //! Returns the name of the language. + const char *language() const; + + //! Returns the name of the lexer. Some lexers support a number of + //! languages. + const char *lexer() const; + + //! \internal Returns the style used for braces for brace matching. + int braceStyle() const; + + //! \internal Returns the string of characters that comprise a word. + const char *wordCharacters() const; + + //! Returns the foreground colour of the text for style number + //! \a style. + //! + //! \sa paper() + QColor color(int style) const; + + //! Returns the end-of-line fill for style number \a style. + bool eolFill(int style) const; + + //! Returns the font for style number \a style. + QFont font(int style) const; + + //! Returns the set of keywords for the keyword set \a set recognised + //! by the lexer as a space separated string. + const char *keywords(int set) const; + + //! Returns the descriptive name for style number \a style. If the + //! style is invalid for this language then QString::null is returned. + //! This is intended to be used in user preference dialogs. + QString description(int style) const; + + //! Returns the background colour of the text for style number + //! \a style. + //! + //! \sa color() + QColor paper(int style) const; + + //! Causes all properties to be refreshed by emitting the + //! propertyChanged() signal as required. + void refreshProperties(); + + //! Returns TRUE if multi-line comment blocks can be folded. + //! + //! \sa setFoldComments() + bool foldComments() const; + + //! Returns TRUE if trailing blank lines are included in a fold block. + //! + //! \sa setFoldCompact() + bool foldCompact() const; + +public slots: + //! If \a fold is TRUE then multi-line comment blocks can be folded. + //! The default is FALSE. + //! + //! \sa foldComments() + virtual void setFoldComments(bool fold); + + //! If \a fold is TRUE then trailing blank lines are included in a fold + //! block. The default is TRUE. + //! + //! \sa foldCompact() + virtual void setFoldCompact(bool fold); + +protected: + //! The lexer's properties are read from the settings \a qs. \a prefix + //! (which has a trailing '/') should be used as a prefix to the key of + //! each setting. TRUE is returned if there is no error. + //! + bool readProperties(QSettings &qs,const QString &prefix); + + //! The lexer's properties are written to the settings \a qs. + //! \a prefix (which has a trailing '/') should be used as a prefix to + //! the key of each setting. TRUE is returned if there is no error. + //! + bool writeProperties(QSettings &qs,const QString &prefix) const; + +private: + void setCommentProp(); + void setCompactProp(); + + bool fold_comments; + bool fold_compact; + +#if defined(Q_DISABLE_COPY) + QextScintillaLexerPerl(const QextScintillaLexerPerl &); + QextScintillaLexerPerl &operator=(const QextScintillaLexerPerl &); +#endif +}; + +#endif diff --git a/qt/qextscintillalexerpov.cpp b/qt/qextscintillalexerpov.cpp new file mode 100644 index 0000000..1fabd0f --- /dev/null +++ b/qt/qextscintillalexerpov.cpp @@ -0,0 +1,488 @@ +// This module implements the QextScintillaLexerPOV class. +// +// Copyright (c) 2006 +// Riverbank Computing Limited +// +// This file is part of QScintilla. +// +// This copy of QScintilla is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2, or (at your option) any +// later version. +// +// QScintilla is supplied 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 +// QScintilla; see the file LICENSE. If not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +#include +#include +#include + +#include "qextscintillalexerpov.h" + + +// The ctor. +QextScintillaLexerPOV::QextScintillaLexerPOV(QObject *parent,const char *name) + : QextScintillaLexer(parent,name), fold_comments(FALSE), + fold_compact(TRUE), fold_directives(FALSE) +{ +} + + +// The dtor. +QextScintillaLexerPOV::~QextScintillaLexerPOV() +{ +} + + +// Returns the language name. +const char *QextScintillaLexerPOV::language() const +{ + return "POV"; +} + + +// Returns the lexer name. +const char *QextScintillaLexerPOV::lexer() const +{ + return "pov"; +} + + +// Return the style used for braces. +int QextScintillaLexerPOV::braceStyle() const +{ + return Operator; +} + + +// Return the string of characters that comprise a word. +const char *QextScintillaLexerPOV::wordCharacters() const +{ + return "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_#"; +} + + +// Returns the foreground colour of the text for a style. +QColor QextScintillaLexerPOV::color(int style) const +{ + switch (style) + { + case Default: + return QColor(0xff,0x00,0x80); + + case Comment: + case CommentLine: + return QColor(0x00,0x7f,0x00); + + case Number: + return QColor(0x00,0x7f,0x7f); + + case Operator: + return QColor(0x00,0x00,0x00); + + case String: + return QColor(0x7f,0x00,0x7f); + + case Directive: + return QColor(0x7f,0x7f,0x00); + + case BadDirective: + return QColor(0x80,0x40,0x20); + + case ObjectsCSGAppearance: + case TypesModifiersItems: + case PredefinedIdentifiers: + case PredefinedFunctions: + case KeywordSet6: + case KeywordSet7: + case KeywordSet8: + return QColor(0x00,0x00,0x7f); + } + + return QextScintillaLexer::color(style); +} + + +// Returns the end-of-line fill for a style. +bool QextScintillaLexerPOV::eolFill(int style) const +{ + return (style == UnclosedString); +} + + +// Returns the font of the text for a style. +QFont QextScintillaLexerPOV::font(int style) const +{ + QFont f; + + switch (style) + { + case Comment: + case CommentLine: +#if defined(Q_OS_WIN) + f = QFont("Comic Sans MS",9); +#else + f = QFont("Bitstream Vera Serif",9); +#endif + break; + + case UnclosedString: + case PredefinedIdentifiers: + f = QextScintillaLexer::font(style); + f.setBold(TRUE); + break; + + case BadDirective: +#if defined(Q_OS_WIN) + f = QFont("Comic Sans MS",9); +#else + f = QFont("Bitstream Vera Serif",9); +#endif + f.setItalic(TRUE); + break; + + default: + f = QextScintillaLexer::font(style); + } + + return f; +} + + +// Returns the set of keywords. +const char *QextScintillaLexerPOV::keywords(int set) const +{ + if (set == 1) + return + "declare local include undef fopen fclose read write " + "default version case range break debug error " + "warning if ifdef ifndef switch while macro else end"; + + if (set == 2) + return + "camera light_source light_group object blob sphere " + "cylinder box cone height_field julia_fractal lathe " + "prism sphere_sweep superellipsoid sor text torus " + "bicubic_patch disc mesh mesh2 polygon triangle " + "smooth_triangle plane poly cubic quartic quadric " + "isosurface parametric union intersection difference " + "merge function array spline vertex_vectors " + "normal_vectors uv_vectors face_indices " + "normal_indices uv_indices texture texture_list " + "interior_texture texture_map material_map image_map " + "color_map colour_map pigment_map normal_map " + "slope_map bump_map density_map pigment normal " + "material interior finish reflection irid slope " + "pigment_pattern image_pattern warp media scattering " + "density background fog sky_sphere rainbow " + "global_settings radiosity photons pattern transform " + "looks_like projected_through contained_by " + "clipped_by bounded_by"; + + if (set == 3) + return + "linear_spline quadratic_spline cubic_spline " + "natural_spline bezier_spline b_spline read write " + "append inverse open perspective orthographic " + "fisheye ultra_wide_angle omnimax panoramic " + "spherical spotlight jitter circular orient " + "media_attenuation media_interaction shadowless " + "parallel refraction collect pass_through " + "global_lights hierarchy sturm smooth gif tga iff " + "pot png pgm ppm jpeg tiff sys ttf quaternion " + "hypercomplex linear_sweep conic_sweep type " + "all_intersections split_union cutaway_textures " + "no_shadow no_image no_reflection double_illuminate " + "hollow uv_mapping all use_index use_color " + "use_colour no_bump_scale conserve_energy fresnel " + "average agate boxed bozo bumps cells crackle " + "cylindrical density_file dents facets granite " + "leopard marble onion planar quilted radial ripples " + "spotted waves wood wrinkles solid use_alpha " + "interpolate magnet noise_generator toroidal " + "ramp_wave triangle_wave sine_wave scallop_wave " + "cubic_wave poly_wave once map_type method fog_type " + "hf_gray_16 charset ascii utf8 rotate scale " + "translate matrix location right up direction sky " + "angle look_at aperture blur_samples focal_point " + "confidence variance radius falloff tightness " + "point_at area_light adaptive fade_distance " + "fade_power threshold strength water_level tolerance " + "max_iteration precision slice u_steps v_steps " + "flatness inside_vector accuracy max_gradient " + "evaluate max_trace precompute target ior dispersion " + "dispersion_samples caustics color colour rgb rgbf " + "rgbt rgbft red green blue filter transmit gray hf " + "fade_color fade_colour quick_color quick_colour " + "brick checker hexagon brick_size mortar bump_size " + "ambient diffuse brilliance crand phong phong_size " + "metallic specular roughness reflection_exponent " + "exponent thickness gradient spiral1 spiral2 " + "agate_turb form metric offset df3 coords size " + "mandel exterior julia control0 control1 altitude " + "turbulence octaves omega lambda repeat flip " + "black-hole orientation dist_exp major_radius " + "frequency phase intervals samples ratio absorption " + "emission aa_threshold aa_level eccentricity " + "extinction distance turb_depth fog_offset fog_alt " + "width arc_angle falloff_angle adc_bailout " + "ambient_light assumed_gamma irid_wavelength " + "number_of_waves always_sample brigthness count " + "error_bound gray_threshold load_file " + "low_error_factor max_sample minimum_reuse " + "nearest_count pretrace_end pretrace_start " + "recursion_limit save_file spacing gather " + "max_trace_level autostop expand_thresholds"; + + if (set == 4) + return + "x y z t u v yes no true false on off clock " + "clock_delta clock_on final_clock final_frame " + "frame_number image_height image_width initial_clock " + "initial_frame pi version"; + + if (set == 5) + return + "abs acos acosh asc asin asinh atan atanh atan2 ceil " + "cos cosh defined degrees dimensions dimension_size " + "div exp file_exists floor inside int ln log max min " + "mod pow prod radians rand seed select sin sinh sqrt " + "strcmp strlen sum tan tanh val vdot vlength " + "min_extent max_extent trace vaxis_rotate vcross " + "vrotate vnormalize vturbulence chr concat str " + "strlwr strupr substr vstr sqr cube reciprocal pwr"; + + return 0; +} + + +// Returns the user name of a style. +QString QextScintillaLexerPOV::description(int style) const +{ + switch (style) + { + case Default: + return tr("Default"); + + case Comment: + return tr("Comment"); + + case CommentLine: + return tr("Comment line"); + + case Number: + return tr("Number"); + + case Operator: + return tr("Operator"); + + case Identifier: + return tr("Identifier"); + + case String: + return tr("String"); + + case UnclosedString: + return tr("Unclosed string"); + + case Directive: + return tr("Directive"); + + case BadDirective: + return tr("Bad directive"); + + case ObjectsCSGAppearance: + return tr("Objects, CSG and appearance"); + + case TypesModifiersItems: + return tr("Types, modifiers and items"); + + case PredefinedIdentifiers: + return tr("Predefined identifiers"); + + case PredefinedFunctions: + return tr("Predefined functions"); + + case KeywordSet6: + return tr("User defined 1"); + + case KeywordSet7: + return tr("User defined 2"); + + case KeywordSet8: + return tr("User defined 3"); + } + + return QString::null; +} + + +// Returns the background colour of the text for a style. +QColor QextScintillaLexerPOV::paper(int style) const +{ + switch (style) + { + case UnclosedString: + return QColor(0xe0,0xc0,0xe0); + + case ObjectsCSGAppearance: + return QColor(0xff,0xd0,0xd0); + + case TypesModifiersItems: + return QColor(0xff,0xff,0xd0); + + case PredefinedFunctions: + return QColor(0xd0,0xd0,0xff); + + case KeywordSet6: + return QColor(0xd0,0xff,0xd0); + + case KeywordSet7: + return QColor(0xd0,0xd0,0xd0); + + case KeywordSet8: + return QColor(0xe0,0xe0,0xe0); + } + + return QextScintillaLexer::paper(style); +} + + +// Refresh all properties. +void QextScintillaLexerPOV::refreshProperties() +{ + setCommentProp(); + setCompactProp(); + setDirectiveProp(); +} + + +// Read properties from the settings. +bool QextScintillaLexerPOV::readProperties(QSettings &qs,const QString &prefix) +{ + int rc = TRUE; + bool ok, flag; + + // Read the fold comments flag. + flag = qs.readBoolEntry(prefix + "foldcomments",FALSE,&ok); + + if (ok) + fold_comments = flag; + else + rc = FALSE; + + // Read the fold compact flag. + flag = qs.readBoolEntry(prefix + "foldcompact",TRUE,&ok); + + if (ok) + fold_compact = flag; + else + rc = FALSE; + + // Read the fold directives flag. + flag = qs.readBoolEntry(prefix + "folddirectives",FALSE,&ok); + + if (ok) + fold_directives = flag; + else + rc = FALSE; + + return rc; +} + + +// Write properties to the settings. +bool QextScintillaLexerPOV::writeProperties(QSettings &qs,const QString &prefix) const +{ + int rc = TRUE; + + // Write the fold comments flag. + if (!qs.writeEntry(prefix + "foldcomments",fold_comments)) + rc = FALSE; + + // Write the fold compact flag. + if (!qs.writeEntry(prefix + "foldcompact",fold_compact)) + rc = FALSE; + + // Write the fold directives flag. + if (!qs.writeEntry(prefix + "folddirectives",fold_directives)) + rc = FALSE; + + return rc; +} + + +// Return TRUE if comments can be folded. +bool QextScintillaLexerPOV::foldComments() const +{ + return fold_comments; +} + + +// Set if comments can be folded. +void QextScintillaLexerPOV::setFoldComments(bool fold) +{ + fold_comments = fold; + + setCommentProp(); +} + + +// Set the "fold.comment" property. +void QextScintillaLexerPOV::setCommentProp() +{ + emit propertyChanged("fold.comment",(fold_comments ? "1" : "0")); +} + + +// Return TRUE if folds are compact. +bool QextScintillaLexerPOV::foldCompact() const +{ + return fold_compact; +} + + +// Set if folds are compact +void QextScintillaLexerPOV::setFoldCompact(bool fold) +{ + fold_compact = fold; + + setCompactProp(); +} + + +// Set the "fold.compact" property. +void QextScintillaLexerPOV::setCompactProp() +{ + emit propertyChanged("fold.compact",(fold_compact ? "1" : "0")); +} + + +// Return TRUE if directives can be folded. +bool QextScintillaLexerPOV::foldDirectives() const +{ + return fold_directives; +} + + +// Set if directives can be folded. +void QextScintillaLexerPOV::setFoldDirectives(bool fold) +{ + fold_directives = fold; + + setDirectiveProp(); +} + + +// Set the "fold.directive" property. +void QextScintillaLexerPOV::setDirectiveProp() +{ + emit propertyChanged("fold.directive",(fold_directives ? "1" : "0")); +} diff --git a/qt/qextscintillalexerpov.h b/qt/qextscintillalexerpov.h new file mode 100644 index 0000000..6314fe0 --- /dev/null +++ b/qt/qextscintillalexerpov.h @@ -0,0 +1,214 @@ +// This defines the interface to the QextScintillaLexerPOV class. +// +// Copyright (c) 2006 +// Riverbank Computing Limited +// +// This file is part of QScintilla. +// +// This copy of QScintilla is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2, or (at your option) any +// later version. +// +// QScintilla is supplied 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 +// QScintilla; see the file LICENSE. If not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +#ifndef QEXTSCINTILLALEXERPOV_H +#define QEXTSCINTILLALEXERPOV_H + + +#include + +#include +#include + + +//! \brief The QextScintillaLexerPOV class encapsulates the Scintilla POV +//! lexer. +class QEXTSCINTILLA_EXPORT QextScintillaLexerPOV : public QextScintillaLexer +{ + Q_OBJECT + +public: + //! This enum defines the meanings of the different styles used by the + //! POV lexer. + enum { + //! The default. + Default = 0, + + //! A comment. + Comment = 1, + + //! A comment line. + CommentLine = 2, + + //! A number. + Number = 3, + + //! An operator. + Operator = 4, + + //! An identifier + Identifier = 5, + + //! A string. + String = 6, + + //! The end of a line where a string is not closed. + UnclosedString = 7, + + //! A directive. + Directive = 8, + + //! A bad directive. + BadDirective = 9, + + //! Objects, CSG and appearance. + ObjectsCSGAppearance = 10, + + //! Types, modifiers and items. + TypesModifiersItems = 11, + + //! Predefined identifiers. + PredefinedIdentifiers = 12, + + //! Predefined identifiers. + PredefinedFunctions = 13, + + //! A keyword defined in keyword set number 6. The class must + //! be sub-classed and re-implement keywords() to make use of + //! this style. + KeywordSet6 = 14, + + //! A keyword defined in keyword set number 7. The class must + //! be sub-classed and re-implement keywords() to make use of + //! this style. + KeywordSet7 = 15, + + //! A keyword defined in keyword set number 8. The class must + //! be sub-classed and re-implement keywords() to make use of + //! this style. + KeywordSet8 = 16 + }; + + //! Construct a QextScintillaLexerPOV with parent \a parent and name + //! \a name. \a parent is typically the QextScintilla instance. + QextScintillaLexerPOV(QObject *parent = 0,const char *name = 0); + + //! Destroys the QextScintillaLexerPOV instance. + virtual ~QextScintillaLexerPOV(); + + //! Returns the name of the language. + const char *language() const; + + //! Returns the name of the lexer. Some lexers support a number of + //! languages. + const char *lexer() const; + + //! \internal Returns the style used for braces for brace matching. + int braceStyle() const; + + //! \internal Returns the string of characters that comprise a word. + const char *wordCharacters() const; + + //! Returns the foreground colour of the text for style number + //! \a style. + //! + //! \sa paper() + QColor color(int style) const; + + //! Returns the end-of-line fill for style number \a style. + bool eolFill(int style) const; + + //! Returns the font for style number \a style. + QFont font(int style) const; + + //! Returns the set of keywords for the keyword set \a set recognised + //! by the lexer as a space separated string. + const char *keywords(int set) const; + + //! Returns the descriptive name for style number \a style. If the + //! style is invalid for this language then QString::null is returned. + //! This is intended to be used in user preference dialogs. + QString description(int style) const; + + //! Returns the background colour of the text for style number + //! \a style. + //! + //! \sa color() + QColor paper(int style) const; + + //! Causes all properties to be refreshed by emitting the + //! propertyChanged() signal as required. + void refreshProperties(); + + //! Returns TRUE if multi-line comment blocks can be folded. + //! + //! \sa setFoldComments() + bool foldComments() const; + + //! Returns TRUE if trailing blank lines are included in a fold block. + //! + //! \sa setFoldCompact() + bool foldCompact() const; + + //! Returns TRUE if directives can be folded. + //! + //! \sa setFoldDirectives() + bool foldDirectives() const; + +public slots: + //! If \a fold is TRUE then multi-line comment blocks can be folded. + //! The default is FALSE. + //! + //! \sa foldComments() + virtual void setFoldComments(bool fold); + + //! If \a fold is TRUE then trailing blank lines are included in a fold + //! block. The default is TRUE. + //! + //! \sa foldCompact() + virtual void setFoldCompact(bool fold); + + //! If \a fold is TRUE then directives can be folded. The default is + //! FALSE. + //! + //! \sa foldDirectives() + virtual void setFoldDirectives(bool fold); + +protected: + //! The lexer's properties are read from the settings \a qs. \a prefix + //! (which has a trailing '/') should be used as a prefix to the key of + //! each setting. TRUE is returned if there is no error. + //! + bool readProperties(QSettings &qs,const QString &prefix); + + //! The lexer's properties are written to the settings \a qs. + //! \a prefix (which has a trailing '/') should be used as a prefix to + //! the key of each setting. TRUE is returned if there is no error. + //! + bool writeProperties(QSettings &qs,const QString &prefix) const; + +private: + void setCommentProp(); + void setCompactProp(); + void setDirectiveProp(); + + bool fold_comments; + bool fold_compact; + bool fold_directives; + +#if defined(Q_DISABLE_COPY) + QextScintillaLexerPOV(const QextScintillaLexerPOV &); + QextScintillaLexerPOV &operator=(const QextScintillaLexerPOV &); +#endif +}; + +#endif diff --git a/qt/qextscintillalexerproperties.cpp b/qt/qextscintillalexerproperties.cpp new file mode 100644 index 0000000..fb35123 --- /dev/null +++ b/qt/qextscintillalexerproperties.cpp @@ -0,0 +1,204 @@ +// This module implements the QextScintillaLexerProperties class. +// +// Copyright (c) 2006 +// Riverbank Computing Limited +// +// This file is part of QScintilla. +// +// This copy of QScintilla is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2, or (at your option) any +// later version. +// +// QScintilla is supplied 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 +// QScintilla; see the file LICENSE. If not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +#include +#include +#include + +#include "qextscintillalexerproperties.h" + + +// The ctor. +QextScintillaLexerProperties::QextScintillaLexerProperties(QObject *parent,const char *name) + : QextScintillaLexer(parent,name), fold_compact(TRUE) +{ +} + + +// The dtor. +QextScintillaLexerProperties::~QextScintillaLexerProperties() +{ +} + + +// Returns the language name. +const char *QextScintillaLexerProperties::language() const +{ + return "Properties"; +} + + +// Returns the lexer name. +const char *QextScintillaLexerProperties::lexer() const +{ + return "props"; +} + + +// Return the string of characters that comprise a word. +const char *QextScintillaLexerProperties::wordCharacters() const +{ + return "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-"; +} + + +// Returns the foreground colour of the text for a style. +QColor QextScintillaLexerProperties::color(int style) const +{ + switch (style) + { + case Comment: + return QColor(0x00,0x7f,0x7f); + + case Section: + return QColor(0x7f,0x00,0x7f); + + case Assignment: + return QColor(0xb0,0x60,0x00); + + case DefaultValue: + return QColor(0x7f,0x7f,0x00); + } + + return QextScintillaLexer::color(style); +} + + +// Returns the end-of-line fill for a style. +bool QextScintillaLexerProperties::eolFill(int style) const +{ + return (style == Section); +} + + +// Returns the font of the text for a style. +QFont QextScintillaLexerProperties::font(int style) const +{ + QFont f; + + if (style == Comment) +#if defined(Q_OS_WIN) + f = QFont("Comic Sans MS",9); +#else + f = QFont("Bitstream Vera Serif",9); +#endif + else + f = QextScintillaLexer::font(style); + + return f; +} + + +// Returns the user name of a style. +QString QextScintillaLexerProperties::description(int style) const +{ + switch (style) + { + case Default: + return tr("Default"); + + case Comment: + return tr("Comment"); + + case Section: + return tr("Section"); + + case Assignment: + return tr("Assignment"); + + case DefaultValue: + return tr("Default value"); + } + + return QString::null; +} + + +// Returns the background colour of the text for a style. +QColor QextScintillaLexerProperties::paper(int style) const +{ + if (style == Section) + return QColor(0xe0,0xf0,0xf0); + + return QextScintillaLexer::paper(style); +} + + +// Refresh all properties. +void QextScintillaLexerProperties::refreshProperties() +{ + setCompactProp(); +} + + +// Read properties from the settings. +bool QextScintillaLexerProperties::readProperties(QSettings &qs,const QString &prefix) +{ + int rc = TRUE; + bool ok, flag; + + // Read the fold compact flag. + flag = qs.readBoolEntry(prefix + "foldcompact",TRUE,&ok); + + if (ok) + fold_compact = flag; + else + rc = FALSE; + + return rc; +} + + +// Write properties to the settings. +bool QextScintillaLexerProperties::writeProperties(QSettings &qs,const QString &prefix) const +{ + int rc = TRUE; + + // Write the fold compact flag. + if (!qs.writeEntry(prefix + "foldcompact",fold_compact)) + rc = FALSE; + + return rc; +} + + +// Return TRUE if folds are compact. +bool QextScintillaLexerProperties::foldCompact() const +{ + return fold_compact; +} + + +// Set if folds are compact +void QextScintillaLexerProperties::setFoldCompact(bool fold) +{ + fold_compact = fold; + + setCompactProp(); +} + + +// Set the "fold.compact" property. +void QextScintillaLexerProperties::setCompactProp() +{ + emit propertyChanged("fold.compact",(fold_compact ? "1" : "0")); +} diff --git a/qt/qextscintillalexerproperties.h b/qt/qextscintillalexerproperties.h new file mode 100644 index 0000000..466fe57 --- /dev/null +++ b/qt/qextscintillalexerproperties.h @@ -0,0 +1,141 @@ +// This defines the interface to the QextScintillaLexerProperties class. +// +// Copyright (c) 2006 +// Riverbank Computing Limited +// +// This file is part of QScintilla. +// +// This copy of QScintilla is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2, or (at your option) any +// later version. +// +// QScintilla is supplied 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 +// QScintilla; see the file LICENSE. If not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +#ifndef QEXTSCINTILLALEXERPROPERTIES_H +#define QEXTSCINTILLALEXERPROPERTIES_H + + +#include + +#include +#include + + +//! \brief The QextScintillaLexerProperties class encapsulates the Scintilla +//! Properties lexer. +class QEXTSCINTILLA_EXPORT QextScintillaLexerProperties : public QextScintillaLexer +{ + Q_OBJECT + +public: + //! This enum defines the meanings of the different styles used by the + //! Properties lexer. + enum { + //! The default. + Default = 0, + + //! A comment. + Comment = 1, + + //! A section. + Section = 2, + + //! An assignment operator. + Assignment = 3, + + //! A default value. + DefaultValue = 4 + }; + + //! Construct a QextScintillaLexerProperties with parent \a parent and + //! name \a name. \a parent is typically the QextScintilla instance. + QextScintillaLexerProperties(QObject *parent = 0,const char *name = 0); + + //! Destroys the QextScintillaLexerProperties instance. + virtual ~QextScintillaLexerProperties(); + + //! Returns the name of the language. + const char *language() const; + + //! Returns the name of the lexer. Some lexers support a number of + //! languages. + const char *lexer() const; + + //! \internal Returns the string of characters that comprise a word. + const char *wordCharacters() const; + + //! Returns the foreground colour of the text for style number + //! \a style. + //! + //! \sa paper() + QColor color(int style) const; + + //! Returns the end-of-line fill for style number \a style. + bool eolFill(int style) const; + + //! Returns the font for style number \a style. + QFont font(int style) const; + + //! Returns the descriptive name for style number \a style. If the + //! style is invalid for this language then QString::null is returned. + //! This is intended to be used in user preference dialogs. + QString description(int style) const; + + //! Returns the background colour of the text for style number + //! \a style. + //! + //! \sa color() + QColor paper(int style) const; + + //! Causes all properties to be refreshed by emitting the + //! propertyChanged() signal as required. + void refreshProperties(); + + //! Returns TRUE if trailing blank lines are included in a fold block. + //! + //! \sa setFoldCompact() + bool foldCompact() const; + +public slots: + //! If \a fold is TRUE then trailing blank lines are included in a fold + //! block. The default is TRUE. + //! + //! \sa foldCompact() + virtual void setFoldCompact(bool fold); + +protected: + //! The lexer's properties are read from the settings \a qs. \a prefix + //! (which has a trailing '/') should be used as a prefix to the key of + //! each setting. TRUE is returned if there is no error. + //! + //! \sa writeProperties() + bool readProperties(QSettings &qs,const QString &prefix); + + //! The lexer's properties are written to the settings \a qs. + //! \a prefix (which has a trailing '/') should be used as a prefix to + //! the key of each setting. TRUE is returned if there is no error. + //! + //! \sa readProperties() + bool writeProperties(QSettings &qs,const QString &prefix) const; + +private: + void setCompactProp(); + + bool fold_compact; + +#if defined(Q_DISABLE_COPY) + QextScintillaLexerProperties(const QextScintillaLexerProperties &); + QextScintillaLexerProperties &operator=(const QextScintillaLexerProperties &); +#endif +}; + +#endif diff --git a/qt/qextscintillalexerpython.cpp b/qt/qextscintillalexerpython.cpp new file mode 100644 index 0000000..b6252ae --- /dev/null +++ b/qt/qextscintillalexerpython.cpp @@ -0,0 +1,407 @@ +// This module implements the QextScintillaLexerPython class. +// +// Copyright (c) 2006 +// Riverbank Computing Limited +// +// This file is part of QScintilla. +// +// This copy of QScintilla is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2, or (at your option) any +// later version. +// +// QScintilla is supplied 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 +// QScintilla; see the file LICENSE. If not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +#include +#include +#include + +#include "qextscintillalexerpython.h" + + +// The list of Python keywords that can be used by other friendly lexers. +const char *QextScintillaLexerPython::keywordClass = + "and assert break class continue def del elif else except exec " + "finally for from global if import in is lambda None not or pass " + "print raise return try while yield"; + + +// The ctor. +QextScintillaLexerPython::QextScintillaLexerPython(QObject *parent, + const char *name) + : QextScintillaLexer(parent,name), fold_comments(FALSE), + fold_quotes(FALSE), indent_warn(NoWarning) +{ +} + + +// The dtor. +QextScintillaLexerPython::~QextScintillaLexerPython() +{ +} + + +// Returns the language name. +const char *QextScintillaLexerPython::language() const +{ + return "Python"; +} + + +// Returns the lexer name. +const char *QextScintillaLexerPython::lexer() const +{ + return "python"; +} + + +// Return the set of characters that can start autocompletion. +const char *QextScintillaLexerPython::autoCompletionStartCharacters() const +{ + return "."; +} + + +// Return the list of characters that can start a block. +const char *QextScintillaLexerPython::blockStart(int *style) const +{ + if (style) + *style = Operator; + + return ":"; +} + + +// Return the number of lines to look back when auto-indenting. +int QextScintillaLexerPython::blockLookback() const +{ + // This must be 0 otherwise de-indenting a Python block gets very + // difficult. + return 0; +} + + +// Return the style used for braces. +int QextScintillaLexerPython::braceStyle() const +{ + return Operator; +} + + +// Returns the foreground colour of the text for a style. +QColor QextScintillaLexerPython::color(int style) const +{ + switch (style) + { + case Default: + return QColor(0x80,0x80,0x80); + + case Comment: + return QColor(0x00,0x7f,0x00); + + case Number: + return QColor(0x00,0x7f,0x7f); + + case DoubleQuotedString: + case SingleQuotedString: + return QColor(0x7f,0x00,0x7f); + + case Keyword: + return QColor(0x00,0x00,0x7f); + + case TripleSingleQuotedString: + case TripleDoubleQuotedString: + return QColor(0x7f,0x00,0x00); + + case ClassName: + return QColor(0x00,0x00,0xff); + + case FunctionMethodName: + return QColor(0x00,0x7f,0x7f); + + case Operator: + case Identifier: + break; + + case CommentBlock: + return QColor(0x7f,0x7f,0x7f); + + case UnclosedString: + return QColor(0x00,0x00,0x00); + + case HighlightedIdentifier: + return QColor(0x40,0x70,0x90); + + case Decorator: + return QColor(0x80,0x50,0x00); + } + + return QextScintillaLexer::color(style); +} + + +// Returns the end-of-line fill for a style. +bool QextScintillaLexerPython::eolFill(int style) const +{ + return (style == UnclosedString); +} + + +// Returns the font of the text for a style. +QFont QextScintillaLexerPython::font(int style) const +{ + QFont f; + + switch (style) + { + case Comment: +#if defined(Q_OS_WIN) + f = QFont("Comic Sans MS",9); +#else + f = QFont("Bitstream Vera Serif",9); +#endif + break; + + case DoubleQuotedString: + case SingleQuotedString: + case UnclosedString: +#if defined(Q_OS_WIN) + f = QFont("Courier New",10); +#else + f = QFont("Bitstream Vera Sans Mono",9); +#endif + break; + + case Keyword: + case ClassName: + case FunctionMethodName: + case Operator: + f = QextScintillaLexer::font(style); + f.setBold(TRUE); + break; + + default: + f = QextScintillaLexer::font(style); + } + + return f; +} + + +// Returns the set of keywords. +const char *QextScintillaLexerPython::keywords(int set) const +{ + if (set != 1) + return 0; + + return keywordClass; +} + + +// Returns the user name of a style. +QString QextScintillaLexerPython::description(int style) const +{ + switch (style) + { + case Default: + return tr("Default"); + + case Comment: + return tr("Comment"); + + case Number: + return tr("Number"); + + case DoubleQuotedString: + return tr("Double-quoted string"); + + case SingleQuotedString: + return tr("Single-quoted string"); + + case Keyword: + return tr("Keyword"); + + case TripleSingleQuotedString: + return tr("Triple single-quoted string"); + + case TripleDoubleQuotedString: + return tr("Triple double-quoted string"); + + case ClassName: + return tr("Class name"); + + case FunctionMethodName: + return tr("Function or method name"); + + case Operator: + return tr("Operator"); + + case Identifier: + return tr("Identifier"); + + case CommentBlock: + return tr("Comment block"); + + case UnclosedString: + return tr("Unclosed string"); + + case HighlightedIdentifier: + return tr("Highlighted identifier"); + + case Decorator: + return tr("Decorator"); + } + + return QString::null; +} + + +// Returns the background colour of the text for a style. +QColor QextScintillaLexerPython::paper(int style) const +{ + if (style == UnclosedString) + return QColor(0xe0,0xc0,0xe0); + + return QextScintillaLexer::paper(style); +} + + +// Refresh all properties. +void QextScintillaLexerPython::refreshProperties() +{ + setCommentProp(); + setQuotesProp(); + setTabWhingeProp(); +} + + +// Read properties from the settings. +bool QextScintillaLexerPython::readProperties(QSettings &qs,const QString &prefix) +{ + int rc = TRUE, num; + bool ok, flag; + + // Read the fold comments flag. + flag = qs.readBoolEntry(prefix + "foldcomments",FALSE,&ok); + + if (ok) + fold_comments = flag; + else + rc = FALSE; + + // Read the fold quotes flag. + flag = qs.readBoolEntry(prefix + "foldquotes",FALSE,&ok); + + if (ok) + fold_quotes = flag; + else + rc = FALSE; + + // Read the indentation warning. + num = qs.readNumEntry(prefix + "indentwarning",(int)NoWarning,&ok); + + if (ok) + indent_warn = (IndentationWarning)num; + else + rc = FALSE; + + return rc; +} + + +// Write properties to the settings. +bool QextScintillaLexerPython::writeProperties(QSettings &qs,const QString &prefix) const +{ + int rc = TRUE; + + // Write the fold comments flag. + if (!qs.writeEntry(prefix + "foldcomments",fold_comments)) + rc = FALSE; + + // Write the fold quotes flag. + if (!qs.writeEntry(prefix + "foldquotes",fold_quotes)) + rc = FALSE; + + // Write the indentation warning. + if (!qs.writeEntry(prefix + "indentwarning",(int)indent_warn)) + rc = FALSE; + + return rc; +} + + +// Return TRUE if comments can be folded. +bool QextScintillaLexerPython::foldComments() const +{ + return fold_comments; +} + + +// Set if comments can be folded. +void QextScintillaLexerPython::setFoldComments(bool fold) +{ + fold_comments = fold; + + setCommentProp(); +} + + +// Set the "fold.comment.python" property. +void QextScintillaLexerPython::setCommentProp() +{ + emit propertyChanged("fold.comment.python",(fold_comments ? "1" : "0")); +} + + +// Return TRUE if quotes can be folded. +bool QextScintillaLexerPython::foldQuotes() const +{ + return fold_quotes; +} + + +// Set if quotes can be folded. +void QextScintillaLexerPython::setFoldQuotes(bool fold) +{ + fold_quotes = fold; + + setQuotesProp(); +} + + +// Set the "fold.quotes.python" property. +void QextScintillaLexerPython::setQuotesProp() +{ + emit propertyChanged("fold.quotes.python",(fold_quotes ? "1" : "0")); +} + + +// Return the indentation warning. +QextScintillaLexerPython::IndentationWarning QextScintillaLexerPython::indentationWarning() const +{ + return indent_warn; +} + + +// Set the indentation warning. +void QextScintillaLexerPython::setIndentationWarning(IndentationWarning warn) +{ + indent_warn = warn; + + setTabWhingeProp(); +} + + +// Set the "tab.timmy.whinge.level" property. +void QextScintillaLexerPython::setTabWhingeProp() +{ + emit propertyChanged("tab.timmy.whinge.level",QString::number(indent_warn)); +} diff --git a/qt/qextscintillalexerpython.h b/qt/qextscintillalexerpython.h new file mode 100644 index 0000000..b5edb3e --- /dev/null +++ b/qt/qextscintillalexerpython.h @@ -0,0 +1,244 @@ +// This defines the interface to the QextScintillaLexerPython class. +// +// Copyright (c) 2006 +// Riverbank Computing Limited +// +// This file is part of QScintilla. +// +// This copy of QScintilla is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2, or (at your option) any +// later version. +// +// QScintilla is supplied 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 +// QScintilla; see the file LICENSE. If not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +#ifndef QEXTSCINTILLALEXERPYTHON_H +#define QEXTSCINTILLALEXERPYTHON_H + + +#include + +#include +#include + + +//! \brief The QextScintillaLexerPython class encapsulates the Scintilla Python +//! lexer. +class QEXTSCINTILLA_EXPORT QextScintillaLexerPython : public QextScintillaLexer +{ + Q_OBJECT + +public: + //! This enum defines the meanings of the different styles used by the + //! Python lexer. + enum { + //! The default. + Default = 0, + + //! \deprecated White space. + WhiteSpace = Default, + + //! A comment. + Comment = 1, + + //! A number. + Number = 2, + + //! A double-quoted string. + DoubleQuotedString = 3, + + //! A single-quoted string. + SingleQuotedString = 4, + + //! A keyword. + Keyword = 5, + + //! A triple single-quoted string. + TripleSingleQuotedString = 6, + + //! A triple double-quoted string. + TripleDoubleQuotedString = 7, + + //! The name of a class. + ClassName = 8, + + //! The name of a function or method. + FunctionMethodName = 9, + + //! An operator. + Operator = 10, + + //! An identifier + Identifier = 11, + + //! A comment block. + CommentBlock = 12, + + //! The end of a line where a string is not closed. + UnclosedString = 13, + + //! A highlighted identifier. These are defined by keyword set + //! 2. Reimplement keywords() to define keyword set 2. + HighlightedIdentifier = 14, + + //! A decorator. + Decorator = 15 + }; + + //! This enum defines the different conditions that can cause + //! indentations to be displayed as being bad. + enum IndentationWarning { + //! Bad indentation is not displayed differently. + NoWarning = 0, + + //! The indentation is inconsistent when compared to the + //! previous line, ie. it is made up of a different combination + //! of tabs and/or spaces. + Inconsistent = 1, + + //! The indentation is made up of spaces followed by tabs. + TabsAfterSpaces = 2, + + //! The indentation contains spaces. + Spaces = 3, + + //! The indentation contains tabs. + Tabs = 4 + }; + + //! Construct a QextScintillaLexerPython with parent \a parent and name + //! \a name. \a parent is typically the QextScintilla instance. + QextScintillaLexerPython(QObject *parent = 0,const char *name = 0); + + //! Destroys the QextScintillaLexerPython instance. + virtual ~QextScintillaLexerPython(); + + //! Returns the name of the language. + const char *language() const; + + //! Returns the name of the lexer. Some lexers support a number of + //! languages. + const char *lexer() const; + + //! \internal Returns the characters that can start auto-completion. + const char *autoCompletionStartCharacters() const; + + //! \internal Returns the number of lines prior to the current one when + //! determining the scope of a block when auto-indenting. + int blockLookback() const; + + //! \internal Returns a space separated list of words or characters in + //! a particular style that define the start of a block for + //! auto-indentation. The styles is returned via \a style. + const char *blockStart(int *style = 0) const; + + //! \internal Returns the style used for braces for brace matching. + int braceStyle() const; + + //! Returns the foreground colour of the text for style number + //! \a style. + //! + //! \sa paper() + QColor color(int style) const; + + //! Returns the end-of-line fill for style number \a style. + bool eolFill(int style) const; + + //! Returns the font for style number \a style. + QFont font(int style) const; + + //! Returns the set of keywords for the keyword set \a set recognised + //! by the lexer as a space separated string. + const char *keywords(int set) const; + + //! Returns the descriptive name for style number \a style. If the + //! style is invalid for this language then QString::null is returned. + //! This is intended to be used in user preference dialogs. + QString description(int style) const; + + //! Returns the background colour of the text for style number + //! \a style. + //! + //! \sa color() + QColor paper(int style) const; + + //! Causes all properties to be refreshed by emitting the + //! propertyChanged() signal as required. + void refreshProperties(); + + //! Returns TRUE if indented comment blocks can be folded. + //! + //! \sa setFoldComments() + bool foldComments() const; + + //! Returns TRUE if triple quoted strings can be folded. + //! + //! \sa setFoldQuotes() + bool foldQuotes() const; + + //! Returns the condition that will cause bad indentations to be + //! displayed. + //! + //! \sa setIndentationWarning() + IndentationWarning indentationWarning() const; + +public slots: + //! If \a fold is TRUE then indented comment blocks can be folded. The + //! default is FALSE. + //! + //! \sa foldComments() + virtual void setFoldComments(bool fold); + + //! If \a fold is TRUE then triple quoted strings can be folded. The + //! default is FALSE. + //! + //! \sa foldQuotes() + virtual void setFoldQuotes(bool fold); + + //! Sets the condition that will cause bad indentations to be + //! displayed. + //! + //! \sa indentationWarning() + virtual void setIndentationWarning(IndentationWarning warn); + +protected: + //! The lexer's properties are read from the settings \a qs. \a prefix + //! (which has a trailing '/') should be used as a prefix to the key of + //! each setting. TRUE is returned if there is no error. + //! + bool readProperties(QSettings &qs,const QString &prefix); + + //! The lexer's properties are written to the settings \a qs. + //! \a prefix (which has a trailing '/') should be used as a prefix to + //! the key of each setting. TRUE is returned if there is no error. + //! + bool writeProperties(QSettings &qs,const QString &prefix) const; + +private: + void setCommentProp(); + void setQuotesProp(); + void setTabWhingeProp(); + + bool fold_comments; + bool fold_quotes; + IndentationWarning indent_warn; + + friend class QextScintillaLexerHTML; + + static const char *keywordClass; + +#if defined(Q_DISABLE_COPY) + QextScintillaLexerPython(const QextScintillaLexerPython &); + QextScintillaLexerPython &operator=(const QextScintillaLexerPython &); +#endif +}; + +#endif diff --git a/qt/qextscintillalexerruby.cpp b/qt/qextscintillalexerruby.cpp new file mode 100644 index 0000000..6ecce01 --- /dev/null +++ b/qt/qextscintillalexerruby.cpp @@ -0,0 +1,380 @@ +// This module implements the QextScintillaLexerRuby class. +// +// Copyright (c) 2006 +// Riverbank Computing Limited +// +// This file is part of QScintilla. +// +// This copy of QScintilla is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2, or (at your option) any +// later version. +// +// QScintilla is supplied 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 +// QScintilla; see the file LICENSE. If not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +#include +#include +#include + +#include "qextscintillalexerruby.h" + + +// The ctor. +QextScintillaLexerRuby::QextScintillaLexerRuby(QObject *parent, + const char *name) + : QextScintillaLexer(parent, name) +{ +} + + +// The dtor. +QextScintillaLexerRuby::~QextScintillaLexerRuby() +{ +} + + +// Returns the language name. +const char *QextScintillaLexerRuby::language() const +{ + return "Ruby"; +} + + +// Returns the lexer name. +const char *QextScintillaLexerRuby::lexer() const +{ + return "ruby"; +} + + +// Return the list of words that can start a block. +const char *QextScintillaLexerRuby::blockStart(int *style) const +{ + if (style) + *style = Keyword; + + return "do"; +} + + +// Return the list of words that can start end a block. +const char *QextScintillaLexerRuby::blockEnd(int *style) const +{ + if (style) + *style = Keyword; + + return "end"; +} + + +// Return the list of words that can start end a block. +const char *QextScintillaLexerRuby::blockStartKeyword(int *style) const +{ + if (style) + *style = Keyword; + + return "def class if do elsif else case while for"; +} + + +// Return the style used for braces. +int QextScintillaLexerRuby::braceStyle() const +{ + return Operator; +} + + +// Returns the foreground colour of the text for a style. +QColor QextScintillaLexerRuby::color(int style) const +{ + switch (style) + { + case Default: + return QColor(0x80,0x80,0x80); + + case Comment: + return QColor(0x00,0x7f,0x00); + + case POD: + return QColor(0x00,0x40,0x00); + + case Number: + case FunctionMethodName: + return QColor(0x00,0x7f,0x7f); + + case Keyword: + case DemotedKeyword: + return QColor(0x00,0x00,0x7f); + + case DoubleQuotedString: + case SingleQuotedString: + case HereDocument: + case PercentStringq: + case PercentStringQ: + return QColor(0x7f,0x00,0x7f); + + case ClassName: + return QColor(0x00,0x00,0xff); + + case Regex: + case HereDocumentDelimiter: + case PercentStringr: + case PercentStringw: + return QColor(0x00,0x00,0x00); + + case Global: + return QColor(0x80,0x00,0x80); + + case Symbol: + return QColor(0xc0,0xa0,0x30); + + case ModuleName: + return QColor(0xa0,0x00,0xa0); + + case InstanceVariable: + return QColor(0xb0,0x00,0x80); + + case ClassVariable: + return QColor(0x80,0x00,0xb0); + + case Backticks: + case PercentStringx: + return QColor(0xff,0xff,0x00); + + case DataSection: + return QColor(0x60,0x00,0x00); + } + + return QextScintillaLexer::color(style); +} + + +// Returns the end-of-line fill for a style. +bool QextScintillaLexerRuby::eolFill(int style) const +{ + bool fill; + + switch (style) + { + case POD: + case DataSection: + case HereDocument: + fill = true; + break; + + default: + fill = false; + } + + return fill; +} + + +// Returns the font of the text for a style. +QFont QextScintillaLexerRuby::font(int style) const +{ + QFont f; + + switch (style) + { + case Comment: +#if defined(Q_OS_WIN) + f = QFont("Comic Sans MS",9); +#else + f = QFont("Bitstream Vera Serif",9); +#endif + break; + + case POD: + case DoubleQuotedString: + case SingleQuotedString: + case PercentStringq: + case PercentStringQ: +#if defined(Q_OS_WIN) + f = QFont("Courier New",10); +#else + f = QFont("Bitstream Vera Sans Mono",9); +#endif + break; + + case Keyword: + case ClassName: + case FunctionMethodName: + case Operator: + case ModuleName: + case DemotedKeyword: + f = QextScintillaLexer::font(style); + f.setBold(TRUE); + break; + + default: + f = QextScintillaLexer::font(style); + } + + return f; +} + + +// Returns the set of keywords. +const char *QextScintillaLexerRuby::keywords(int set) const +{ + if (set == 1) + return + "__FILE__ and def end in or self unless __LINE__ " + "begin defined? ensure module redo super until BEGIN " + "break do false next rescue then when END case else " + "for nil require retry true while alias class elsif " + "if not return undef yield"; + + return 0; +} + + +// Returns the user name of a style. +QString QextScintillaLexerRuby::description(int style) const +{ + switch (style) + { + case Default: + return tr("Default"); + + case Error: + return tr("Error"); + + case Comment: + return tr("Comment"); + + case POD: + return tr("POD"); + + case Number: + return tr("Number"); + + case Keyword: + return tr("Keyword"); + + case DoubleQuotedString: + return tr("Double-quoted string"); + + case SingleQuotedString: + return tr("Single-quoted string"); + + case ClassName: + return tr("Class name"); + + case FunctionMethodName: + return tr("Function or method name"); + + case Operator: + return tr("Operator"); + + case Identifier: + return tr("Identifier"); + + case Regex: + return tr("Regular expression"); + + case Global: + return tr("Global"); + + case Symbol: + return tr("Symbol"); + + case ModuleName: + return tr("Module name"); + + case InstanceVariable: + return tr("Instance variable"); + + case ClassVariable: + return tr("Class variable"); + + case Backticks: + return tr("Backticks"); + + case DataSection: + return tr("Data section"); + + case HereDocumentDelimiter: + return tr("Here document delimiter"); + + case HereDocument: + return tr("Here document"); + + case PercentStringq: + return tr("%q string"); + + case PercentStringQ: + return tr("%Q string"); + + case PercentStringx: + return tr("%x string"); + + case PercentStringr: + return tr("%r string"); + + case PercentStringw: + return tr("%w string"); + + case DemotedKeyword: + return tr("Demoted keyword"); + + case Stdin: + return tr("stdin"); + + case Stdout: + return tr("stdout"); + + case Stderr: + return tr("stderr"); + } + + return QString::null; +} + + +// Returns the background colour of the text for a style. +QColor QextScintillaLexerRuby::paper(int style) const +{ + switch (style) + { + case Error: + return QColor(0xff,0x00,0x00); + + case POD: + return QColor(0xc0,0xff,0xc0); + + case Regex: + case PercentStringr: + return QColor(0xa0,0xff,0xa0); + + case Backticks: + case PercentStringx: + return QColor(0xa0,0x80,0x80); + + case DataSection: + return QColor(0xff,0xf0,0xd8); + + case HereDocumentDelimiter: + case HereDocument: + return QColor(0xdd,0xd0,0xdd); + + case PercentStringw: + return QColor(0xff,0xff,0xe0); + + case Stdin: + case Stdout: + case Stderr: + return QColor(0xff,0x80,0x80); + } + + return QextScintillaLexer::paper(style); +} diff --git a/qt/qextscintillalexerruby.h b/qt/qextscintillalexerruby.h new file mode 100644 index 0000000..96918eb --- /dev/null +++ b/qt/qextscintillalexerruby.h @@ -0,0 +1,203 @@ +// This defines the interface to the QextScintillaLexerRuby class. +// +// Copyright (c) 2006 +// Riverbank Computing Limited +// +// This file is part of QScintilla. +// +// This copy of QScintilla is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2, or (at your option) any +// later version. +// +// QScintilla is supplied 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 +// QScintilla; see the file LICENSE. If not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +#ifndef QEXTSCINTILLALEXERRUBY_H +#define QEXTSCINTILLALEXERRUBY_H + + +#include + +#include +#include + + +//! \brief The QextScintillaLexerRuby class encapsulates the Scintilla Ruby +//! lexer. +class QEXTSCINTILLA_EXPORT QextScintillaLexerRuby : public QextScintillaLexer +{ + Q_OBJECT + +public: + //! This enum defines the meanings of the different styles used by the + //! Ruby lexer. + enum { + //! The default. + Default = 0, + + //! An error. + Error = 1, + + //! A comment. + Comment = 2, + + //! A POD. + POD = 3, + + //! A number. + Number = 4, + + //! A keyword. + Keyword = 5, + + //! A double-quoted string. + DoubleQuotedString = 6, + + //! A single-quoted string. + SingleQuotedString = 7, + + //! The name of a class. + ClassName = 8, + + //! The name of a function or method. + FunctionMethodName = 9, + + //! An operator. + Operator = 10, + + //! An identifier + Identifier = 11, + + //! A regular expression. + Regex = 12, + + //! A global. + Global = 13, + + //! A symbol. + Symbol = 14, + + //! The name of a module. + ModuleName = 15, + + //! An instance variable. + InstanceVariable = 16, + + //! A class variable. + ClassVariable = 17, + + //! Backticks. + Backticks = 18, + + //! A data section. + DataSection = 19, + + //! A here document delimiter. + HereDocumentDelimiter = 20, + + //! A here document. + HereDocument = 21, + + //! A %q string. + PercentStringq = 24, + + //! A %Q string. + PercentStringQ = 25, + + //! A %x string. + PercentStringx = 26, + + //! A %r string. + PercentStringr = 27, + + //! A %w string. + PercentStringw = 28, + + //! A demoted keyword. + DemotedKeyword = 29, + + //! stdin. + Stdin = 30, + + //! stdout. + Stdout = 31, + + //! stderr. + Stderr = 40 + }; + + //! Construct a QextScintillaLexerRuby with parent \a parent and name + //! \a name. \a parent is typically the QextScintilla instance. + QextScintillaLexerRuby(QObject *parent = 0,const char *name = 0); + + //! Destroys the QextScintillaLexerRuby instance. + virtual ~QextScintillaLexerRuby(); + + //! Returns the name of the language. + const char *language() const; + + //! Returns the name of the lexer. Some lexers support a number of + //! languages. + const char *lexer() const; + + //! \internal Returns a space separated list of words or characters in + //! a particular style that define the end of a block for + //! auto-indentation. The style is returned via \a style. + const char *blockEnd(int *style = 0) const; + + //! \internal Returns a space separated list of words or characters in + //! a particular style that define the start of a block for + //! auto-indentation. The styles is returned via \a style. + const char *blockStart(int *style = 0) const; + + //! \internal Returns a space separated list of keywords in a + //! particular style that define the start of a block for + //! auto-indentation. The style is returned via \a style. + const char *blockStartKeyword(int *style = 0) const; + + //! \internal Returns the style used for braces for brace matching. + int braceStyle() const; + + //! Returns the foreground colour of the text for style number + //! \a style. + //! + //! \sa paper() + QColor color(int style) const; + + //! Returns the end-of-line fill for style number \a style. + bool eolFill(int style) const; + + //! Returns the font for style number \a style. + QFont font(int style) const; + + //! Returns the set of keywords for the keyword set \a set recognised + //! by the lexer as a space separated string. + const char *keywords(int set) const; + + //! Returns the descriptive name for style number \a style. If the + //! style is invalid for this language then QString::null is returned. + //! This is intended to be used in user preference dialogs. + QString description(int style) const; + + //! Returns the background colour of the text for style number + //! \a style. + //! + //! \sa color() + QColor paper(int style) const; + +private: +#if defined(Q_DISABLE_COPY) + QextScintillaLexerRuby(const QextScintillaLexerRuby &); + QextScintillaLexerRuby &operator=(const QextScintillaLexerRuby &); +#endif +}; + +#endif diff --git a/qt/qextscintillalexersql.cpp b/qt/qextscintillalexersql.cpp new file mode 100644 index 0000000..8b7092e --- /dev/null +++ b/qt/qextscintillalexersql.cpp @@ -0,0 +1,452 @@ +// This module implements the QextScintillaLexerSQL class. +// +// Copyright (c) 2006 +// Riverbank Computing Limited +// +// This file is part of QScintilla. +// +// This copy of QScintilla is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2, or (at your option) any +// later version. +// +// QScintilla is supplied 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 +// QScintilla; see the file LICENSE. If not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +#include +#include +#include + +#include "qextscintillalexersql.h" + + +// The ctor. +QextScintillaLexerSQL::QextScintillaLexerSQL(QObject *parent,const char *name) + : QextScintillaLexer(parent,name), fold_comments(FALSE), + fold_compact(TRUE), backslash_escapes(FALSE) +{ +} + + +// The dtor. +QextScintillaLexerSQL::~QextScintillaLexerSQL() +{ +} + + +// Returns the language name. +const char *QextScintillaLexerSQL::language() const +{ + return "SQL"; +} + + +// Returns the lexer name. +const char *QextScintillaLexerSQL::lexer() const +{ + return "sql"; +} + + +// Return the style used for braces. +int QextScintillaLexerSQL::braceStyle() const +{ + return Operator; +} + + +// Returns the foreground colour of the text for a style. +QColor QextScintillaLexerSQL::color(int style) const +{ + switch (style) + { + case Default: + return QColor(0x80,0x80,0x80); + + case Comment: + case CommentLine: + case PlusPrompt: + case PlusComment: + case CommentLineHash: + return QColor(0x00,0x7f,0x00); + + case CommentDoc: + return QColor(0x7f,0x7f,0x7f); + + case Number: + return QColor(0x00,0x7f,0x7f); + + case Keyword: + return QColor(0x00,0x00,0x7f); + + case DoubleQuotedString: + case SingleQuotedString: + return QColor(0x7f,0x00,0x7f); + + case PlusKeyword: + return QColor(0x7f,0x7f,0x00); + + case Operator: + case Identifier: + break; + + case CommentDocKeyword: + return QColor(0x30,0x60,0xa0); + + case CommentDocKeywordError: + return QColor(0x80,0x40,0x20); + + case KeywordSet5: + return QColor(0x4b,0x00,0x82); + + case KeywordSet6: + return QColor(0xb0,0x00,0x40); + + case KeywordSet7: + return QColor(0x8b,0x00,0x00); + + case KeywordSet8: + return QColor(0x80,0x00,0x80); + } + + return QextScintillaLexer::color(style); +} + + +// Returns the end-of-line fill for a style. +bool QextScintillaLexerSQL::eolFill(int style) const +{ + return (style == PlusPrompt); +} + + +// Returns the font of the text for a style. +QFont QextScintillaLexerSQL::font(int style) const +{ + QFont f; + + switch (style) + { + case Comment: + case CommentLine: + case PlusComment: + case CommentLineHash: + case CommentDocKeyword: + case CommentDocKeywordError: +#if defined(Q_OS_WIN) + f = QFont("Comic Sans MS",9); +#else + f = QFont("Bitstream Vera Serif",9); +#endif + break; + + case Keyword: + case Operator: + f = QextScintillaLexer::font(style); + f.setBold(TRUE); + break; + + case DoubleQuotedString: + case SingleQuotedString: + case PlusPrompt: +#if defined(Q_OS_WIN) + f = QFont("Courier New",10); +#else + f = QFont("Bitstream Vera Sans Mono",9); +#endif + break; + + default: + f = QextScintillaLexer::font(style); + } + + return f; +} + + +// Returns the set of keywords. +const char *QextScintillaLexerSQL::keywords(int set) const +{ + if (set == 1) + return + "absolute action add admin after aggregate alias all " + "allocate alter and any are array as asc assertion " + "at authorization before begin binary bit blob " + "boolean both breadth by call cascade cascaded case " + "cast catalog char character check class clob close " + "collate collation column commit completion connect " + "connection constraint constraints constructor " + "continue corresponding create cross cube current " + "current_date current_path current_role current_time " + "current_timestamp current_user cursor cycle data " + "date day deallocate dec decimal declare default " + "deferrable deferred delete depth deref desc " + "describe descriptor destroy destructor " + "deterministic dictionary diagnostics disconnect " + "distinct domain double drop dynamic each else end " + "end-exec equals escape every except exception exec " + "execute external false fetch first float for " + "foreign found from free full function general get " + "global go goto grant group grouping having host " + "hour identity if ignore immediate in indicator " + "initialize initially inner inout input insert int " + "integer intersect interval into is isolation " + "iterate join key language large last lateral " + "leading left less level like limit local localtime " + "localtimestamp locator map match minute modifies " + "modify module month names national natural nchar " + "nclob new next no none not null numeric object of " + "off old on only open operation option or order " + "ordinality out outer output pad parameter " + "parameters partial path postfix precision prefix " + "preorder prepare preserve primary prior privileges " + "procedure public read reads real recursive ref " + "references referencing relative restrict result " + "return returns revoke right role rollback rollup " + "routine row rows savepoint schema scroll scope " + "search second section select sequence session " + "session_user set sets size smallint some| space " + "specific specifictype sql sqlexception sqlstate " + "sqlwarning start state statement static structure " + "system_user table temporary terminate than then " + "time timestamp timezone_hour timezone_minute to " + "trailing transaction translation treat trigger " + "true under union unique unknown unnest update usage " + "user using value values varchar variable varying " + "view when whenever where with without work write " + "year zone"; + + if (set == 4) + return + "acc~ept a~ppend archive log attribute bre~ak " + "bti~tle c~hange cl~ear col~umn comp~ute conn~ect " + "copy def~ine del desc~ribe disc~onnect e~dit " + "exec~ute exit get help ho~st i~nput l~ist passw~ord " + "pau~se pri~nt pro~mpt quit recover rem~ark " + "repf~ooter reph~eader r~un sav~e set sho~w shutdown " + "spo~ol sta~rt startup store timi~ng tti~tle " + "undef~ine var~iable whenever oserror whenever " + "sqlerror"; + + return 0; +} + + +// Returns the user name of a style. +QString QextScintillaLexerSQL::description(int style) const +{ + switch (style) + { + case Default: + return tr("Default"); + + case Comment: + return tr("Comment"); + + case CommentLine: + return tr("Comment line"); + + case CommentDoc: + return tr("JavaDoc style comment"); + + case Number: + return tr("Number"); + + case Keyword: + return tr("Keyword"); + + case DoubleQuotedString: + return tr("Double-quoted string"); + + case SingleQuotedString: + return tr("Single-quoted string"); + + case PlusKeyword: + return tr("SQL*Plus keyword"); + + case PlusPrompt: + return tr("SQL*Plus prompt"); + + case Operator: + return tr("Operator"); + + case Identifier: + return tr("Identifier"); + + case PlusComment: + return tr("SQL*Plus comment"); + + case CommentLineHash: + return tr("# comment line"); + + case CommentDocKeyword: + return tr("JavaDoc keyword"); + + case CommentDocKeywordError: + return tr("JavaDoc keyword error"); + + case KeywordSet5: + return tr("User defined 1"); + + case KeywordSet6: + return tr("User defined 2"); + + case KeywordSet7: + return tr("User defined 3"); + + case KeywordSet8: + return tr("User defined 4"); + } + + return QString::null; +} + + +// Returns the background colour of the text for a style. +QColor QextScintillaLexerSQL::paper(int style) const +{ + if (style == PlusPrompt) + return QColor(0xe0,0xff,0xe0); + + return QextScintillaLexer::paper(style); +} + + +// Refresh all properties. +void QextScintillaLexerSQL::refreshProperties() +{ + setCommentProp(); + setCompactProp(); + setBackslashEscapesProp(); +} + + +// Read properties from the settings. +bool QextScintillaLexerSQL::readProperties(QSettings &qs,const QString &prefix) +{ + int rc = TRUE; + bool ok, flag; + + // Read the fold comments flag. + flag = qs.readBoolEntry(prefix + "foldcomments",FALSE,&ok); + + if (ok) + fold_comments = flag; + else + rc = FALSE; + + // Read the fold compact flag. + flag = qs.readBoolEntry(prefix + "foldcompact",TRUE,&ok); + + if (ok) + fold_compact = flag; + else + rc = FALSE; + + // Read the backslash escapes flag. + flag = qs.readBoolEntry(prefix + "backslashescapes",FALSE,&ok); + + if (ok) + backslash_escapes = flag; + else + rc = FALSE; + + return rc; +} + + +// Write properties to the settings. +bool QextScintillaLexerSQL::writeProperties(QSettings &qs,const QString &prefix) const +{ + int rc = TRUE; + + // Write the fold comments flag. + if (!qs.writeEntry(prefix + "foldcomments",fold_comments)) + rc = FALSE; + + // Write the fold compact flag. + if (!qs.writeEntry(prefix + "foldcompact",fold_compact)) + rc = FALSE; + + // Write the backslash escapes flag. + if (!qs.writeEntry(prefix + "backslashescapes",backslash_escapes)) + rc = FALSE; + + return rc; +} + + +// Return TRUE if comments can be folded. +bool QextScintillaLexerSQL::foldComments() const +{ + return fold_comments; +} + + +// Set if comments can be folded. +void QextScintillaLexerSQL::setFoldComments(bool fold) +{ + fold_comments = fold; + + setCommentProp(); +} + + +// Set the "fold.comment" property. +void QextScintillaLexerSQL::setCommentProp() +{ + emit propertyChanged("fold.comment",(fold_comments ? "1" : "0")); +} + + +// Return TRUE if folds are compact. +bool QextScintillaLexerSQL::foldCompact() const +{ + return fold_compact; +} + + +// Set if folds are compact +void QextScintillaLexerSQL::setFoldCompact(bool fold) +{ + fold_compact = fold; + + setCompactProp(); +} + + +// Set the "fold.compact" property. +void QextScintillaLexerSQL::setCompactProp() +{ + emit propertyChanged("fold.compact",(fold_compact ? "1" : "0")); +} + + +// Return TRUE if backslash escapes are enabled. +bool QextScintillaLexerSQL::backslashEscapes() const +{ + return backslash_escapes; +} + + +// Enable/disable backslash escapes. +void QextScintillaLexerSQL::setBackslashEscapes(bool enable) +{ + backslash_escapes = enable; + + setBackslashEscapesProp(); +} + + +// Set the "sql.backslash.escapes" property. +void QextScintillaLexerSQL::setBackslashEscapesProp() +{ + emit propertyChanged("sql.backslash.escapes",(backslash_escapes ? "1" : "0")); +} diff --git a/qt/qextscintillalexersql.h b/qt/qextscintillalexersql.h new file mode 100644 index 0000000..ca94825 --- /dev/null +++ b/qt/qextscintillalexersql.h @@ -0,0 +1,226 @@ +// This defines the interface to the QextScintillaLexerSQL class. +// +// Copyright (c) 2006 +// Riverbank Computing Limited +// +// This file is part of QScintilla. +// +// This copy of QScintilla is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2, or (at your option) any +// later version. +// +// QScintilla is supplied 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 +// QScintilla; see the file LICENSE. If not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +#ifndef QEXTSCINTILLALEXERSQL_H +#define QEXTSCINTILLALEXERSQL_H + + +#include + +#include +#include + + +//! \brief The QextScintillaLexerSQL class encapsulates the Scintilla SQL +//! lexer. +class QEXTSCINTILLA_EXPORT QextScintillaLexerSQL : public QextScintillaLexer +{ + Q_OBJECT + +public: + //! This enum defines the meanings of the different styles used by the + //! SQL lexer. + enum { + //! The default. + Default = 0, + + //! A comment. + Comment = 1, + + //! A line comment. + CommentLine = 2, + + //! \deprecated A line comment. + LineComment = CommentLine, + + //! A JavaDoc/Doxygen style comment. + CommentDoc = 3, + + //! A number. + Number = 4, + + //! A keyword. + Keyword = 5, + + //! A double-quoted string. + DoubleQuotedString = 6, + + //! A single-quoted string. + SingleQuotedString = 7, + + //! An SQL*Plus keyword. + PlusKeyword = 8, + + //! An SQL*Plus prompt. + PlusPrompt = 9, + + //! An operator. + Operator = 10, + + //! An identifier + Identifier = 11, + + //! An SQL*Plus comment. + PlusComment = 13, + + //! A '#' line comment. + CommentLineHash = 15, + + //! A JavaDoc/Doxygen keyword. + CommentDocKeyword = 17, + + //! A JavaDoc/Doxygen keyword error. + CommentDocKeywordError = 18, + + //! A keyword defined in keyword set number 5. The class must + //! be sub-classed and re-implement keywords() to make use of + //! this style. + KeywordSet5 = 19, + + //! A keyword defined in keyword set number 6. The class must + //! be sub-classed and re-implement keywords() to make use of + //! this style. + KeywordSet6 = 20, + + //! A keyword defined in keyword set number 7. The class must + //! be sub-classed and re-implement keywords() to make use of + //! this style. + KeywordSet7 = 21, + + //! A keyword defined in keyword set number 8. The class must + //! be sub-classed and re-implement keywords() to make use of + //! this style. + KeywordSet8 = 22 + }; + + //! Construct a QextScintillaLexerSQL with parent \a parent and name + //! \a name. \a parent is typically the QextScintilla instance. + QextScintillaLexerSQL(QObject *parent = 0,const char *name = 0); + + //! Destroys the QextScintillaLexerSQL instance. + virtual ~QextScintillaLexerSQL(); + + //! Returns the name of the language. + const char *language() const; + + //! Returns the name of the lexer. Some lexers support a number of + //! languages. + const char *lexer() const; + + //! \internal Returns the style used for braces for brace matching. + int braceStyle() const; + + //! Returns the foreground colour of the text for style number + //! \a style. + //! + //! \sa paper() + QColor color(int style) const; + + //! Returns the end-of-line fill for style number \a style. + bool eolFill(int style) const; + + //! Returns the font for style number \a style. + QFont font(int style) const; + + //! Returns the set of keywords for the keyword set \a set recognised + //! by the lexer as a space separated string. + const char *keywords(int set) const; + + //! Returns the descriptive name for style number \a style. If the + //! style is invalid for this language then QString::null is returned. + //! This is intended to be used in user preference dialogs. + QString description(int style) const; + + //! Returns the background colour of the text for style number + //! \a style. + //! + //! \sa color() + QColor paper(int style) const; + + //! Causes all properties to be refreshed by emitting the + //! propertyChanged() signal as required. + void refreshProperties(); + + //! Returns TRUE if multi-line comment blocks can be folded. + //! + //! \sa setFoldComments() + bool foldComments() const; + + //! Returns TRUE if trailing blank lines are included in a fold block. + //! + //! \sa setFoldCompact() + bool foldCompact() const; + + //! Returns TRUE if backslash escapes are enabled. + //! + //! \sa setBackslashEscapes() + bool backslashEscapes() const; + +public slots: + //! If \a fold is TRUE then multi-line comment blocks can be folded. + //! The default is FALSE. + //! + //! \sa foldComments() + virtual void setFoldComments(bool fold); + + //! If \a fold is TRUE then trailing blank lines are included in a fold + //! block. The default is TRUE. + //! + //! \sa foldCompact() + virtual void setFoldCompact(bool fold); + + //! If \a enable is TRUE then backslash escapes are enabled. The + //! default is FALSE. + //! + //! \sa backslashEscapes() + virtual void setBackslashEscapes(bool enable); + +protected: + //! The lexer's properties are read from the settings \a qs. \a prefix + //! (which has a trailing '/') should be used as a prefix to the key of + //! each setting. TRUE is returned if there is no error. + //! + bool readProperties(QSettings &qs,const QString &prefix); + + //! The lexer's properties are written to the settings \a qs. + //! \a prefix (which has a trailing '/') should be used as a prefix to + //! the key of each setting. TRUE is returned if there is no error. + //! + bool writeProperties(QSettings &qs,const QString &prefix) const; + +private: + void setCommentProp(); + void setCompactProp(); + void setBackslashEscapesProp(); + + bool fold_comments; + bool fold_compact; + bool backslash_escapes; + + +#if defined(Q_DISABLE_COPY) + QextScintillaLexerSQL(const QextScintillaLexerSQL &); + QextScintillaLexerSQL &operator=(const QextScintillaLexerSQL &); +#endif +}; + +#endif diff --git a/qt/qextscintillalexertex.cpp b/qt/qextscintillalexertex.cpp new file mode 100644 index 0000000..4cf2848 --- /dev/null +++ b/qt/qextscintillalexertex.cpp @@ -0,0 +1,206 @@ +// This module implements the QextScintillaLexerTeX class. +// +// Copyright (c) 2006 +// Riverbank Computing Limited +// +// This file is part of QScintilla. +// +// This copy of QScintilla is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2, or (at your option) any +// later version. +// +// QScintilla is supplied 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 +// QScintilla; see the file LICENSE. If not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +#include +#include +#include + +#include "qextscintillalexertex.h" + + +// The ctor. +QextScintillaLexerTeX::QextScintillaLexerTeX(QObject *parent,const char *name) + : QextScintillaLexer(parent,name) +{ +} + + +// The dtor. +QextScintillaLexerTeX::~QextScintillaLexerTeX() +{ +} + + +// Returns the language name. +const char *QextScintillaLexerTeX::language() const +{ + return "TeX"; +} + + +// Returns the lexer name. +const char *QextScintillaLexerTeX::lexer() const +{ + return "tex"; +} + + +// Return the string of characters that comprise a word. +const char *QextScintillaLexerTeX::wordCharacters() const +{ + return "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\\@"; +} + + +// Returns the foreground colour of the text for a style. +QColor QextScintillaLexerTeX::color(int style) const +{ + switch (style) + { + case Default: + return QColor(0x3f,0x3f,0x3f); + + case Special: + return QColor(0x00,0x7f,0x7f); + + case Group: + return QColor(0x7f,0x00,0x00); + + case Symbol: + return QColor(0x7f,0x7f,0x00); + + case Command: + return QColor(0x00,0x7f,0x00); + } + + return QextScintillaLexer::color(style); +} + + +// Returns the set of keywords. +const char *QextScintillaLexerTeX::keywords(int set) const +{ + if (set == 1) + return + "above abovedisplayshortskip abovedisplayskip " + "abovewithdelims accent adjdemerits advance " + "afterassignment aftergroup atop atopwithdelims " + "badness baselineskip batchmode begingroup " + "belowdisplayshortskip belowdisplayskip binoppenalty " + "botmark box boxmaxdepth brokenpenalty catcode char " + "chardef cleaders closein closeout clubpenalty copy " + "count countdef cr crcr csname day deadcycles def " + "defaulthyphenchar defaultskewchar delcode delimiter " + "delimiterfactor delimeters delimitershortfall " + "delimeters dimen dimendef discretionary " + "displayindent displaylimits displaystyle " + "displaywidowpenalty displaywidth divide " + "doublehyphendemerits dp dump edef else " + "emergencystretch end endcsname endgroup endinput " + "endlinechar eqno errhelp errmessage " + "errorcontextlines errorstopmode escapechar everycr " + "everydisplay everyhbox everyjob everymath everypar " + "everyvbox exhyphenpenalty expandafter fam fi " + "finalhyphendemerits firstmark floatingpenalty font " + "fontdimen fontname futurelet gdef global group " + "globaldefs halign hangafter hangindent hbadness " + "hbox hfil horizontal hfill horizontal hfilneg hfuzz " + "hoffset holdinginserts hrule hsize hskip hss " + "horizontal ht hyphenation hyphenchar hyphenpenalty " + "hyphen if ifcase ifcat ifdim ifeof iffalse ifhbox " + "ifhmode ifinner ifmmode ifnum ifodd iftrue ifvbox " + "ifvmode ifvoid ifx ignorespaces immediate indent " + "input inputlineno input insert insertpenalties " + "interlinepenalty jobname kern language lastbox " + "lastkern lastpenalty lastskip lccode leaders left " + "lefthyphenmin leftskip leqno let limits linepenalty " + "line lineskip lineskiplimit long looseness lower " + "lowercase mag mark mathaccent mathbin mathchar " + "mathchardef mathchoice mathclose mathcode mathinner " + "mathop mathopen mathord mathpunct mathrel " + "mathsurround maxdeadcycles maxdepth meaning " + "medmuskip message mkern month moveleft moveright " + "mskip multiply muskip muskipdef newlinechar noalign " + "noboundary noexpand noindent nolimits nonscript " + "scriptscript nonstopmode nulldelimiterspace " + "nullfont number omit openin openout or outer output " + "outputpenalty over overfullrule overline " + "overwithdelims pagedepth pagefilllstretch " + "pagefillstretch pagefilstretch pagegoal pageshrink " + "pagestretch pagetotal par parfillskip parindent " + "parshape parskip patterns pausing penalty " + "postdisplaypenalty predisplaypenalty predisplaysize " + "pretolerance prevdepth prevgraf radical raise read " + "relax relpenalty right righthyphenmin rightskip " + "romannumeral scriptfont scriptscriptfont " + "scriptscriptstyle scriptspace scriptstyle " + "scrollmode setbox setlanguage sfcode shipout show " + "showbox showboxbreadth showboxdepth showlists " + "showthe skewchar skip skipdef spacefactor spaceskip " + "span special splitbotmark splitfirstmark " + "splitmaxdepth splittopskip string tabskip textfont " + "textstyle the thickmuskip thinmuskip time toks " + "toksdef tolerance topmark topskip tracingcommands " + "tracinglostchars tracingmacros tracingonline " + "tracingoutput tracingpages tracingparagraphs " + "tracingrestores tracingstats uccode uchyph " + "underline unhbox unhcopy unkern unpenalty unskip " + "unvbox unvcopy uppercase vadjust valign vbadness " + "vbox vcenter vfil vfill vfilneg vfuzz voffset vrule " + "vsize vskip vsplit vss vtop wd widowpenalty write " + "xdef xleaders xspaceskip year " + "TeX bgroup egroup endgraf space empty null newcount " + "newdimen newskip newmuskip newbox newtoks newhelp " + "newread newwrite newfam newlanguage newinsert newif " + "maxdimen magstephalf magstep frenchspacing " + "nonfrenchspacing normalbaselines obeylines " + "obeyspaces raggedr ight ttraggedright thinspace " + "negthinspace enspace enskip quad qquad smallskip " + "medskip bigskip removelastskip topglue vglue hglue " + "break nobreak allowbreak filbreak goodbreak " + "smallbreak medbreak bigbreak line leftline " + "rightline centerline rlap llap underbar strutbox " + "strut cases matrix pmatrix bordermatrix eqalign " + "displaylines eqalignno leqalignno pageno folio " + "tracingall showhyphens fmtname fmtversion hphantom " + "vphantom phantom smash"; + + return 0; +} + + +// Returns the user name of a style. +QString QextScintillaLexerTeX::description(int style) const +{ + switch (style) + { + case Default: + return tr("Default"); + + case Special: + return tr("Special"); + + case Group: + return tr("Group"); + + case Symbol: + return tr("Symbol"); + + case Command: + return tr("Command"); + + case Text: + return tr("Text"); + } + + return QString::null; +} diff --git a/qt/qextscintillalexertex.h b/qt/qextscintillalexertex.h new file mode 100644 index 0000000..f46960c --- /dev/null +++ b/qt/qextscintillalexertex.h @@ -0,0 +1,101 @@ +// This defines the interface to the QextScintillaLexerTeX class. +// +// Copyright (c) 2006 +// Riverbank Computing Limited +// +// This file is part of QScintilla. +// +// This copy of QScintilla is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2, or (at your option) any +// later version. +// +// QScintilla is supplied 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 +// QScintilla; see the file LICENSE. If not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +#ifndef QEXTSCINTILLALEXERTEX_H +#define QEXTSCINTILLALEXERTEX_H + + +#include + +#include +#include + + +//! \brief The QextScintillaLexerTeX class encapsulates the Scintilla TeX +//! lexer. +class QEXTSCINTILLA_EXPORT QextScintillaLexerTeX : public QextScintillaLexer +{ + Q_OBJECT + +public: + //! This enum defines the meanings of the different styles used by the + //! TeX lexer. + enum { + //! The default. + Default = 0, + + //! A special. + Special = 1, + + //! A group. + Group = 2, + + //! A symbol. + Symbol = 3, + + //! A command. + Command = 4, + + //! Text. + Text = 5 + }; + + //! Construct a QextScintillaLexerTeX with parent \a parent and name + //! \a name. \a parent is typically the QextScintilla instance. + QextScintillaLexerTeX(QObject *parent = 0,const char *name = 0); + + //! Destroys the QextScintillaLexerTeX instance. + virtual ~QextScintillaLexerTeX(); + + //! Returns the name of the language. + const char *language() const; + + //! Returns the name of the lexer. Some lexers support a number of + //! languages. + const char *lexer() const; + + //! \internal Returns the string of characters that comprise a word. + const char *wordCharacters() const; + + //! Returns the foreground colour of the text for style number + //! \a style. + //! + //! \sa paper() + QColor color(int style) const; + + //! Returns the set of keywords for the keyword set \a set recognised + //! by the lexer as a space separated string. + const char *keywords(int set) const; + + //! Returns the descriptive name for style number \a style. If the + //! style is invalid for this language then QString::null is returned. + //! This is intended to be used in user preference dialogs. + QString description(int style) const; + +private: +#if defined(Q_DISABLE_COPY) + QextScintillaLexerTeX(const QextScintillaLexerTeX &); + QextScintillaLexerTeX &operator=(const QextScintillaLexerTeX &); +#endif +}; + +#endif diff --git a/qt/qextscintillamacro.cpp b/qt/qextscintillamacro.cpp new file mode 100644 index 0000000..7d2d358 --- /dev/null +++ b/qt/qextscintillamacro.cpp @@ -0,0 +1,329 @@ +// This module implements the QextScintillaMacro class. +// +// Copyright (c) 2006 +// Riverbank Computing Limited +// +// This file is part of QScintilla. +// +// This copy of QScintilla is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2, or (at your option) any +// later version. +// +// QScintilla is supplied 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 +// QScintilla; see the file LICENSE. If not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +#include + +#include + +#include "qextscintillamacro.h" +#include "qextscintilla.h" + + +static QCString extract(const QCString &asc,int &start); +static int fromHex(unsigned char ch); + + +// The ctor. +QextScintillaMacro::QextScintillaMacro(QextScintilla *parent,const char *name) + : QObject(parent,name), qsci(parent) +{ +} + + +// The ctor that initialises the macro. +QextScintillaMacro::QextScintillaMacro(const QCString &asc, + QextScintilla *parent,const char *name) + : QObject(parent,name), qsci(parent) +{ + load(asc); +} + + +// The dtor. +QextScintillaMacro::~QextScintillaMacro() +{ +} + + +// Clear the contents of the macro. +void QextScintillaMacro::clear() +{ + macro.clear(); +} + + +// Read a macro from a string. +bool QextScintillaMacro::load(const QCString &asc) +{ + bool rc = TRUE; + + macro.clear(); + + int pos = 0; + + while (pos < asc.length()) + { + QCString fld; + Macro cmd; + unsigned len; + + // Extract the 3 fixed fields. + fld = extract(asc,pos); + cmd.msg = fld.toUInt(&rc); + + if (!rc) + break; + + fld = extract(asc,pos); + cmd.wParam = fld.toULong(&rc); + + if (!rc) + break; + + fld = extract(asc,pos); + len = fld.toUInt(&rc); + + if (!rc) + break; + + // Extract any text. + if (len) + { + cmd.text.resize(len); + fld = extract(asc,pos); + + char *dp = cmd.text.data(); + const char *sp = fld; + + if (!sp) + { + rc = FALSE; + break; + } + + while (len--) + { + unsigned char ch; + + ch = *sp++; + + if (ch == '"' || ch <= ' ' || ch >= 0x7f) + { + rc = FALSE; + break; + } + + if (ch == '\\') + { + int b1, b2; + + if ((b1 = fromHex(*sp++)) < 0 || + (b2 = fromHex(*sp++)) < 0) + { + rc = FALSE; + break; + } + + ch = (b1 << 4) + b2; + } + + *dp++ = ch; + } + + if (!rc) + break; + } + + macro.append(cmd); + } + + if (!rc) + macro.clear(); + + return rc; +} + + +// Write a macro to a string. +QCString QextScintillaMacro::save() const +{ + QCString ms; + + for (QValueList::const_iterator it = macro.begin(); it != macro.end(); ++it) + { + if (!ms.isEmpty()) + ms += ' '; + + unsigned len = (*it).text.size(); + QCString m; + + m.sprintf("%u %lu %u",(*it).msg,(*it).wParam,len); + + if (len) + { + m += ' '; + + const char *cp = (*it).text.data(); + + while (len--) + { + unsigned char ch = *cp++; + + if (ch == '\\' || ch == '"' || ch <= ' ' || ch >= 0x7f) + { + char buf[4]; + + sprintf(buf,"\\%02x",ch); + m += buf; + } + else + m += ch; + } + } + + ms += m; + } + + return ms; +} + + +// Play the macro. +void QextScintillaMacro::play() +{ + if (!qsci) + return; + + for (QValueList::const_iterator it = macro.begin(); it != macro.end(); ++it) + qsci -> SendScintilla((*it).msg,(*it).wParam,(*it).text.data()); +} + + +// Start recording. +void QextScintillaMacro::startRecording() +{ + if (!qsci) + return; + + macro.clear(); + + connect(qsci, + SIGNAL(SCN_MACRORECORD(unsigned int,unsigned long,long)), + SLOT(record(unsigned int,unsigned long,long))); + + qsci -> SendScintilla(QextScintillaBase::SCI_STARTRECORD); +} + + +// End recording. +void QextScintillaMacro::endRecording() +{ + if (!qsci) + return; + + qsci -> SendScintilla(QextScintillaBase::SCI_STOPRECORD); + qsci -> disconnect(this); +} + + +// Record a command. +void QextScintillaMacro::record(unsigned int msg,unsigned long wParam, + long lParam) +{ + Macro m; + + m.msg = msg; + m.wParam = wParam; + + // Determine commands which need special handling of the parameters. + switch (msg) + { + case QextScintillaBase::SCI_ADDTEXT: + m.text.duplicate(reinterpret_cast(lParam),wParam); + break; + + case QextScintillaBase::SCI_REPLACESEL: + if (!macro.isEmpty() && macro.last().msg == QextScintillaBase::SCI_REPLACESEL) + { + const char *text = reinterpret_cast(lParam); + + // This is the command used for ordinary user input so + // it's a signifacant space reduction to append it to + // the previous command. + + QByteArray &ba = macro.last().text; + + unsigned pos = ba.size() - 1; + + // Make room for the new text. + ba.resize(ba.size() + strlen(text)); + + // Copy it in. + strcpy(ba.data() + pos,text); + + return; + } + + /* Drop through. */ + + case QextScintillaBase::SCI_INSERTTEXT: + case QextScintillaBase::SCI_APPENDTEXT: + case QextScintillaBase::SCI_SEARCHNEXT: + case QextScintillaBase::SCI_SEARCHPREV: + { + const char *text = reinterpret_cast(lParam); + + m.text.duplicate(text,strlen(text) + 1); + break; + } + } + + macro.append(m); +} + + +// Extract a macro field starting at the given position. +static QCString extract(const QCString &asc,int &fstart) +{ + QCString f; + + if (fstart < asc.length()) + { + int fend = asc.find(' ',fstart); + + if (fend < 0) + { + f = asc.mid(fstart); + fstart = asc.length(); + } + else + { + f = asc.mid(fstart,fend - fstart); + fstart = fend + 1; + } + } + + return f; +} + + +// Return the given hex character as a binary. +static int fromHex(unsigned char ch) +{ + if (ch >= '0' && ch <= '9') + return ch - '0'; + + if (ch >= 'a' && ch <= 'f') + return ch - 'a' + 10; + + return -1; +} diff --git a/qt/qextscintillamacro.h b/qt/qextscintillamacro.h new file mode 100644 index 0000000..0c33968 --- /dev/null +++ b/qt/qextscintillamacro.h @@ -0,0 +1,106 @@ +// This defines the interface to the QextScintillaMacro class. +// +// Copyright (c) 2006 +// Riverbank Computing Limited +// +// This file is part of QScintilla. +// +// This copy of QScintilla is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2, or (at your option) any +// later version. +// +// QScintilla is supplied 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 +// QScintilla; see the file LICENSE. If not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +#ifndef QEXTSCINTILLAMACRO_H +#define QEXTSCINTILLAMACRO_H + + +#include +#include +#include + +#include + + +class QString; +class QextScintilla; + + +//! \brief The QextScintillaMacro class represents a sequence of recordable +//! editor commands. +//! +//! Methods are provided to convert convert a macro to and from a textual +//! representation so that they can be easily written to and read from +//! permanent storage. +class QEXTSCINTILLA_EXPORT QextScintillaMacro : public QObject +{ + Q_OBJECT + +public: + //! Construct a QextScintillaMacro with parent \a parent and name + //! \a name. + QextScintillaMacro(QextScintilla *parent,const char *name = 0); + + //! Construct a QextScintillaMacro from the printable ASCII + //! representation \a asc, with parent \a parent and name \a name. + QextScintillaMacro(const QCString &asc,QextScintilla *parent, + const char *name = 0); + + //! Destroy the QextScintillaMacro instance. + virtual ~QextScintillaMacro(); + + //! Clear the contents of the macro. + void clear(); + + //! Load the macro from the printable ASCII representation \a asc. + //! Returns TRUE if there was no error. + //! + //! \sa save() + bool load(const QCString &asc); + + //! Return a printable ASCII representation of the macro. It is + //! guaranteed that only printable ASCII characters are used and that + //! double quote characters will not be used. + //! + //! \sa load() + QCString save() const; + +public slots: + //! Play the macro. + virtual void play(); + + //! Start recording user commands and add them to the macro. + virtual void startRecording(); + + //! Stop recording user commands. + virtual void endRecording(); + +private slots: + void record(unsigned int msg,unsigned long wParam,long lParam); + +private: + struct Macro { + unsigned int msg; + unsigned long wParam; + QByteArray text; + }; + + QextScintilla *qsci; + QValueList macro; + +#if defined(Q_DISABLE_COPY) + QextScintillaMacro(const QextScintillaMacro &); + QextScintillaMacro &operator=(const QextScintillaMacro &); +#endif +}; + +#endif diff --git a/qt/qextscintillaprinter.cpp b/qt/qextscintillaprinter.cpp new file mode 100644 index 0000000..1aadb2d --- /dev/null +++ b/qt/qextscintillaprinter.cpp @@ -0,0 +1,186 @@ +// This module implements the QextScintillaPrinter class. +// +// Copyright (c) 2006 +// Riverbank Computing Limited +// +// This file is part of QScintilla. +// +// This copy of QScintilla is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2, or (at your option) any +// later version. +// +// QScintilla is supplied 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 +// QScintilla; see the file LICENSE. If not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +#include +#include +#include +#include + +#include "qextscintillaprinter.h" +#include "qextscintillabase.h" + + +// The ctor. +QextScintillaPrinter::QextScintillaPrinter(QPrinter::PrinterMode mode) : + QPrinter(mode), mag(0), + wrap(QextScintilla::WrapWord) +{ +} + + +// The dtor. +QextScintillaPrinter::~QextScintillaPrinter() +{ +} + + +// Format the page before the document text is drawn. +void QextScintillaPrinter::formatPage(QPainter &,bool,QRect &,int) +{ +} + + +// Print a range of lines to a printer. +int QextScintillaPrinter::printRange(QextScintillaBase *qsb,int from,int to) +{ + // Sanity check. + if (!qsb) + return FALSE; + + // Setup the printing area. + QPaintDeviceMetrics metrics(this); + QRect def_area; + + def_area.setX(0); + def_area.setY(0); + def_area.setWidth(metrics.width()); + def_area.setHeight(metrics.height()); + + // Get the page range. + int pgFrom, pgTo; + + pgFrom = fromPage(); + pgTo = toPage(); + + // Find the position range. + long startPos, endPos; + + endPos = qsb -> SendScintilla(QextScintillaBase::SCI_GETLENGTH); + + startPos = (from > 0 ? qsb -> SendScintilla(QextScintillaBase::SCI_POSITIONFROMLINE,from) : 0); + + if (to >= 0) + { + long toPos = qsb -> SendScintilla(QextScintillaBase::SCI_POSITIONFROMLINE,to + 1); + + if (endPos > toPos) + endPos = toPos; + } + + if (startPos >= endPos) + return FALSE; + + QPainter painter(this); + bool reverse = (pageOrder() == LastPageFirst); + bool needNewPage = FALSE; + + qsb -> SendScintilla(QextScintillaBase::SCI_SETPRINTMAGNIFICATION,mag); + qsb -> SendScintilla(QextScintillaBase::SCI_SETPRINTWRAPMODE,wrap); + + for (int i = 1; i <= numCopies(); ++i) + { + // If we are printing in reverse page order then remember the + // start position of each page. + QValueStack pageStarts; + + int currPage = 1; + long pos = startPos; + + while (pos < endPos) + { + // See if we have finished the requested page range. + if (pgTo > 0 && pgTo < currPage) + break; + + // See if we are going to render this page, or just see + // how much would fit onto it. + bool render = FALSE; + + if (pgFrom == 0 || pgFrom <= currPage) + { + if (reverse) + pageStarts.push(pos); + else + { + render = TRUE; + + if (needNewPage) + { + if (!newPage()) + return FALSE; + } + else + needNewPage = TRUE; + } + } + + QRect area = def_area; + + formatPage(painter,render,area,currPage); + pos = qsb -> SendScintilla(QextScintillaBase::SCI_FORMATRANGE,render,&painter,area,pos,endPos); + + ++currPage; + } + + // All done if we are printing in normal page order. + if (!reverse) + continue; + + // Now go through each page on the stack and really print it. + while (!pageStarts.isEmpty()) + { + --currPage; + + long ePos = pos; + pos = pageStarts.pop(); + + if (needNewPage) + { + if (!newPage()) + return FALSE; + } + else + needNewPage = TRUE; + + QRect area = def_area; + + formatPage(painter,TRUE,area,currPage); + qsb -> SendScintilla(QextScintillaBase::SCI_FORMATRANGE,TRUE,&painter,area,pos,ePos); + } + } + + return TRUE; +} + + +// Set the print magnification in points. +void QextScintillaPrinter::setMagnification(int magnification) +{ + mag = magnification; +} + + +// Set the line wrap mode. +void QextScintillaPrinter::setWrapMode(QextScintilla::WrapMode wmode) +{ + wrap = wmode; +} diff --git a/qt/qextscintillaprinter.h b/qt/qextscintillaprinter.h new file mode 100644 index 0000000..3eae387 --- /dev/null +++ b/qt/qextscintillaprinter.h @@ -0,0 +1,107 @@ +// This module defines interface to the QextScintillaPrinter class. +// +// Copyright (c) 2006 +// Riverbank Computing Limited +// +// This file is part of QScintilla. +// +// This copy of QScintilla is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2, or (at your option) any +// later version. +// +// QScintilla is supplied 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 +// QScintilla; see the file LICENSE. If not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +#ifndef QEXTSCINTILLAPRINTER_H +#define QEXTSCINTILLAPRINTER_H + + +#include + +#include +#include + + +class QRect; +class QPainter; +class QextScintillaBase; + + +//! \brief The QextScintillaPrinter class is a sub-class of the Qt QPrinter +//! class that is able to print the text of a Scintilla document. +//! +//! The class can be further sub-classed to alter to layout of the text, adding +//! headers and footers for example. +class QEXTSCINTILLA_EXPORT QextScintillaPrinter : public QPrinter +{ +public: + //! Constructs a printer paint device with mode \a mode. + QextScintillaPrinter(PrinterMode mode = ScreenResolution); + + //! Destroys the QextScintillaPrinter instance. + ~QextScintillaPrinter(); + + //! Format a page, by adding headers and footers for example, before + //! the document text is drawn on it. \a painter is the painter to be + //! used to add customised text and graphics. \a drawing is TRUE if + //! the page is actually being drawn rather than being sized. + //! \a painter drawing methods must only be called when \a drawing is + //! TRUE. \a area is the area of the page that will be used to draw + //! the text. This should be modified if it is necessary to reserve + //! space for any customised text or graphics. By default the area is + //! relative to the printable area of the page. Use + //! QPrinter::setFullPage() because calling printRange() if you want to + //! try and print over the whole page. \a pagenr is the number of the + //! page. The first page is numbered 1. + virtual void formatPage(QPainter &painter,bool drawing,QRect &area, + int pagenr); + + //! Return the number of points to add to each font when printing. + //! + //! \sa setMagnification() + int magnification() const {return mag;} + + //! Sets the number of points to add to each font when printing to + //! \a magnification. + //! + //! \sa magnification() + virtual void setMagnification(int magnification); + + //! Print a range of lines from the Scintilla instance \a qsb. \a from + //! is the first line to print and a negative value signifies the first + //! line of text. \a to is the last line to print and a negative value + //! signifies the last line of text. TRUE is returned if there was no + //! error. + virtual int printRange(QextScintillaBase *qsb,int from = -1, + int to = -1); + + //! Return the line wrap mode used when printing. The default is + //! QextScintilla::WrapWord. + //! + //! \sa setWrapMode() + QextScintilla::WrapMode wrapMode() const {return wrap;} + + //! Sets the line wrap mode used when printing to \a wmode. + //! + //! \sa wrapMode() + virtual void setWrapMode(QextScintilla::WrapMode wmode); + +private: + int mag; + QextScintilla::WrapMode wrap; + +#if defined(Q_DISABLE_COPY) + QextScintillaPrinter(const QextScintillaPrinter &); + QextScintillaPrinter &operator=(const QextScintillaPrinter &); +#endif +}; + +#endif diff --git a/qt/qscintilla.pro b/qt/qscintilla.pro new file mode 100644 index 0000000..3180bab --- /dev/null +++ b/qt/qscintilla.pro @@ -0,0 +1,220 @@ +# The project file for the qscintilla library. +# +# Copyright (c) 2006 +# Riverbank Computing Limited +# +# This file is part of QScintilla. +# +# This copy of QScintilla is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) any +# later version. +# +# QScintilla is supplied 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 +# QScintilla; see the file LICENSE. If not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +unix:VERSION = 7.0.1 + + +TEMPLATE = lib +TARGET = qscintilla +# DESTDIR = $(QTDIR)/lib +CONFIG += qt warn_off release dll thread +INCLUDEPATH = . ../include ../src +DEFINES = QEXTSCINTILLA_MAKE_DLL QT SCI_LEXER + +HEADERS = \ + qextscintillaglobal.h \ + qextscintilla.h \ + qextscintillaapis.h \ + qextscintillabase.h \ + qextscintillacommand.h \ + qextscintillacommandset.h \ + qextscintilladocument.h \ + qextscintillalexer.h \ + qextscintillalexerbash.h \ + qextscintillalexerbatch.h \ + qextscintillalexercpp.h \ + qextscintillalexercsharp.h \ + qextscintillalexercss.h \ + qextscintillalexerdiff.h \ + qextscintillalexerhtml.h \ + qextscintillalexeridl.h \ + qextscintillalexerjava.h \ + qextscintillalexerjavascript.h \ + qextscintillalexerlua.h \ + qextscintillalexermakefile.h \ + qextscintillalexerperl.h \ + qextscintillalexerpov.h \ + qextscintillalexerproperties.h \ + qextscintillalexerpython.h \ + qextscintillalexerruby.h \ + qextscintillalexersql.h \ + qextscintillalexertex.h \ + qextscintillamacro.h \ + qextscintillaprinter.h \ + SciListBox.h \ + ScintillaQt.h \ + ../include/Accessor.h \ + ../include/KeyWords.h \ + ../include/Platform.h \ + ../include/PropSet.h \ + ../include/SString.h \ + ../include/SciLexer.h \ + ../include/Scintilla.h \ + ../include/ScintillaWidget.h \ + ../include/WindowAccessor.h \ + ../src/AutoComplete.h \ + ../src/CallTip.h \ + ../src/CellBuffer.h \ + ../src/ContractionState.h \ + ../src/CharClassify.h \ + ../src/Document.h \ + ../src/DocumentAccessor.h \ + ../src/Editor.h \ + ../src/ExternalLexer.h \ + ../src/Indicator.h \ + ../src/KeyMap.h \ + ../src/LineMarker.h \ + ../src/RESearch.h \ + ../src/SVector.h \ + ../src/ScintillaBase.h \ + ../src/Style.h \ + ../src/StyleContext.h \ + ../src/ViewStyle.h \ + ../src/XPM.h + +SOURCES = \ + qextscintilla.cpp \ + qextscintillaapis.cpp \ + qextscintillabase.cpp \ + qextscintillacommand.cpp \ + qextscintillacommandset.cpp \ + qextscintilladocument.cpp \ + qextscintillalexer.cpp \ + qextscintillalexerbash.cpp \ + qextscintillalexerbatch.cpp \ + qextscintillalexercpp.cpp \ + qextscintillalexercsharp.cpp \ + qextscintillalexercss.cpp \ + qextscintillalexerdiff.cpp \ + qextscintillalexerhtml.cpp \ + qextscintillalexeridl.cpp \ + qextscintillalexerjava.cpp \ + qextscintillalexerjavascript.cpp \ + qextscintillalexerlua.cpp \ + qextscintillalexermakefile.cpp \ + qextscintillalexerperl.cpp \ + qextscintillalexerpov.cpp \ + qextscintillalexerproperties.cpp \ + qextscintillalexerpython.cpp \ + qextscintillalexerruby.cpp \ + qextscintillalexersql.cpp \ + qextscintillalexertex.cpp \ + qextscintillamacro.cpp \ + qextscintillaprinter.cpp \ + SciListBox.cpp \ + PlatQt.cpp \ + ScintillaQt.cpp \ + ../src/AutoComplete.cpp \ + ../src/CallTip.cpp \ + ../src/CellBuffer.cpp \ + ../src/ContractionState.cpp \ + ../src/CharClassify.cpp \ + ../src/Document.cpp \ + ../src/DocumentAccessor.cpp \ + ../src/Editor.cpp \ + ../src/ExternalLexer.cpp \ + ../src/Indicator.cpp \ + ../src/KeyMap.cpp \ + ../src/KeyWords.cpp \ + ../src/LexAPDL.cpp \ + ../src/LexAU3.cpp \ + ../src/LexAVE.cpp \ + ../src/LexAda.cpp \ + ../src/LexAsm.cpp \ + ../src/LexAsn1.cpp \ + ../src/LexBaan.cpp \ + ../src/LexBash.cpp \ + ../src/LexBasic.cpp \ + ../src/LexBullant.cpp \ + ../src/LexCLW.cpp \ + ../src/LexCPP.cpp \ + ../src/LexCSS.cpp \ + ../src/LexCaml.cpp \ + ../src/LexConf.cpp \ + ../src/LexCrontab.cpp \ + ../src/LexCsound.cpp \ + ../src/LexEScript.cpp \ + ../src/LexEiffel.cpp \ + ../src/LexErlang.cpp \ + ../src/LexFlagship.cpp \ + ../src/LexForth.cpp \ + ../src/LexFortran.cpp \ + ../src/LexGui4Cli.cpp \ + ../src/LexHTML.cpp \ + ../src/LexHaskell.cpp \ + ../src/LexInno.cpp \ + ../src/LexKix.cpp \ + ../src/LexLisp.cpp \ + ../src/LexLout.cpp \ + ../src/LexLua.cpp \ + ../src/LexMMIXAL.cpp \ + ../src/LexMPT.cpp \ + ../src/LexMSSQL.cpp \ + ../src/LexMatlab.cpp \ + ../src/LexMetapost.cpp \ + ../src/LexNsis.cpp \ + ../src/LexOpal.cpp \ + ../src/LexOthers.cpp \ + ../src/LexPB.cpp \ + ../src/LexPOV.cpp \ + ../src/LexPS.cpp \ + ../src/LexPascal.cpp \ + ../src/LexPerl.cpp \ + ../src/LexPython.cpp \ + ../src/LexRebol.cpp \ + ../src/LexRuby.cpp \ + ../src/LexSQL.cpp \ + ../src/LexScriptol.cpp \ + ../src/LexSmalltalk.cpp \ + ../src/LexSpecman.cpp \ + ../src/LexSpice.cpp \ + ../src/LexTADS3.cpp \ + ../src/LexTCL.cpp \ + ../src/LexTeX.cpp \ + ../src/LexVB.cpp \ + ../src/LexVHDL.cpp \ + ../src/LexVerilog.cpp \ + ../src/LexYAML.cpp \ + ../src/LineMarker.cpp \ + ../src/PropSet.cpp \ + ../src/RESearch.cpp \ + ../src/ScintillaBase.cpp \ + ../src/Style.cpp \ + ../src/StyleContext.cpp \ + ../src/ViewStyle.cpp \ + ../src/WindowAccessor.cpp \ + ../src/XPM.cpp + +TRANSLATIONS = \ + qscintilla_de.ts \ + qscintilla_fr.ts \ + qscintilla_pt_br.ts \ + qscintilla_ru.ts + + +header.path = $(QTDIR)/include +header.files = qextscintilla*.h + +trans.path = $(QTDIR)/translations +trans.files = qscintilla_*.qm + +INSTALLS += header trans diff --git a/qt/qscintilla_de.qm b/qt/qscintilla_de.qm new file mode 100644 index 0000000..d6b1d0c Binary files /dev/null and b/qt/qscintilla_de.qm differ diff --git a/qt/qscintilla_de.ts b/qt/qscintilla_de.ts new file mode 100644 index 0000000..ab47c2b --- /dev/null +++ b/qt/qscintilla_de.ts @@ -0,0 +1,1635 @@ + + + QextScintillaCommand + + Move left one character + Ein Zeichen nach links + + + Move right one character + Ein Zeichen nach rechts + + + Move up one line + Eine Zeile nach oben + + + Move down one line + Eine Zeile nach unten + + + Move left one word part + Ein Wortteil nach links + + + Move right one word part + Ein Wortteil nach rechts + + + Move left one word + Ein Wort nach links + + + Move right one word + Ein Wort nach rechts + + + Move to first visible character in line + Zum ersten sichtbaren Zeichen + + + Move to end of line + Zum Ende der Zeile + + + Scroll view down one line + Eine Zeile nach unten rollen + + + Scroll view up one line + Eine Zeile nach oben rollen + + + Move up one page + Eine Seite hoch + + + Move down one page + Eine Seite nach unten + + + Move to start of text + Zum Textanfang + + + Move to end of text + Zum Textende + + + Indent one level + Eine Ebene einrücken + + + Move back one indentation level + Eine Ebene ausrücken + + + Select all text + Gesamten Text auswählen + + + Extend selection left one character + Auswahl um ein Zeichen nach links erweitern + + + Extend selection right one character + Auswahl um ein Zeichen nach rechts erweitern + + + Extend selection up one line + Auswahl um eine Zeile nach oben erweitern + + + Extend selection down one line + Auswahl um eine Zeile nach unten erweitern + + + Extend selection left one word part + Auswahl um einen Wortteil nach links erweitern + + + Extend selection right one word part + Auswahl um einen Wortteil nach rechts erweitern + + + Extend selection left one word + Auswahl um ein Wort nach links erweitern + + + Extend selection right one word + Auswahl um ein Wort nach rechts erweitern + + + Extend selection to first visible character in line + Auswahl bis zum ersten sichtbaren Zeichen erweitern + + + Extend selection to start of line + Auswahl bis zum Zeilenanfang erweitern + + + Extend selection to end of line + Auswahl bis zum Zeilenende erweitern + + + Extend selection up one page + Auswahl um eine Seite nach oben erweitern + + + Extend selection down one page + Auswahl um eine Seite nach unten erweitern + + + Extend selection to start of text + Auswahl bis zum Textanfang erweitern + + + Extend selection to end of text + Auswahl bis zum Textende erweitern + + + Delete previous character + Zeichen links löschen + + + Delete previous character if not at line start + Zeichen links löschen, wenn nicht am Zeilenanfang + + + Delete current character + Aktuelles Zeichen löschen + + + Delete word to left + Wort links löschen + + + Delete word to right + Wort rechts löschen + + + Delete line to left + Zeile links löschen + + + Delete line to right + Zeile rechts löschen + + + Insert new line + Neue Zeile einfügen + + + Delete current line + Aktuelle Zeile löschen + + + Swap current and previous lines + Aktuelle Zeile mit vorhergehender tauschen + + + Cut current line + Aktuelle Zeile ausschneiden + + + Cut selection + Auswahl ausschneiden + + + Copy selection + Auswahl kopieren + + + Paste + Einfügen + + + Redo last command + Letzten Befehl wiederholen + + + Undo the last command + Letzten Befehl rückgängig + + + Cancel + Abbrechen + + + Toggle insert/overtype + Einfügen/Ãœberschreiben umschalten + + + Convert selection to lower case + Auswahl in Kleinbuchstaben umwandeln + + + Convert selection to upper case + Auswahl in Großbuchstaben umwandeln + + + Zoom in + Vergrößern + + + Zoom out + Verkleinern + + + Move up one paragraph + Einen Absatz nach oben + + + Move down one paragraph + Einen Absatz nach unten + + + Extend selection up one paragraph + Auswahl um einen Absatz nach oben erweitern + + + Extend selection down one paragraph + Auswahl um einen Absatz nach unten erweitern + + + Copy current line + Aktuelle Zeile kopieren + + + Extend rectangular selection down one line + Rechteckige Auswahl um eine Zeile nach unten erweitern + + + Extend rectangular selection up one line + Rechteckige Auswahl um eine Zeile nach oben erweitern + + + Extend rectangular selection left one character + Rechteckige Auswahl um ein Zeichen nach links erweitern + + + Extend rectangular selection right one character + Rechteckige Auswahl um ein Zeichen nach rechts erweitern + + + Move to start of displayed line + Zum Beginn der angezeigten Zeile + + + Extend rectangular selection to first visible character in line + Rechteckige Auswahl bis zum ersten sichtbaren Zeichen erweitern + + + Move to end of displayed line + Zum Ende der angezeigten Zeile + + + Extend selection to end of displayed line + Auswahl bis zum Ende der angezeigten Zeile erweitern + + + Extend rectangular selection to end of line + Rechteckige Auswahl bis zum Zeilenende erweitern + + + Extend rectangular selection up one page + Rechteckige Auswahl um eine Seite nach oben erweitern + + + Extend rectangular selection down one page + Rechteckige Auswahl um eine Seite nach unten erweitern + + + Set zoom + Zoom einstellen + + + Formfeed + Seitenumbruch + + + Duplicate selection + Auswahl duplizieren + + + + QextScintillaLexerBash + + Default + Standard + + + Error + Fehler + + + Comment + Kommentar + + + Number + Zahl + + + Keyword + Schlüsselwort + + + Double-quoted string + Zeichenkette in Anführungszeichen + + + Single-quoted string + Zeichenkette in Hochkommata + + + Operator + Operator + + + Identifier + Bezeichner + + + Scalar + Skalar + + + Parameter expansion + Parametererweiterung + + + Backticks + Backticks + + + Here document delimiter + Here Dokument-Begrenzer + + + Single-quoted here document + Here Dokument in Hochkommata + + + + QextScintillaLexerBatch + + Default + Standard + + + Comment + Kommentar + + + Keyword + Schlüsselwort + + + Label + Marke + + + Variable + Variable + + + Operator + Operator + + + Hide command character + "Befehl verbergen" Zeichen + + + External command + Externer Befehl + + + + QextScintillaLexerCPP + + Number + Zahl + + + Keyword + Schlüsselwort + + + Double-quoted string + Zeichenkette in Anführungszeichen + + + Single-quoted string + Zeichenkette in Hochkommata + + + Pre-processor block + Preprozessorblock + + + Operator + Operator + + + Identifier + Bezeichner + + + Unclosed string + Unbeendete Zeichenkette + + + Default + Standard + + + C comment + C Kommentar + + + C++ comment + C++ Kommentar + + + JavaDoc style C comment + JavaDoc C Kommentar + + + JavaDoc style C++ comment + JavaDoc C++ Kommentar + + + JavaDoc keyword + JavaDoc Schlüsselwort + + + JavaDoc keyword error + JavaDoc Schlüsselwortfehler + + + Secondary keywords and identifiers + Sekundäre Schlusselwörter und Bezeichner + + + Global classes and typedefs + Globale Klassen und typdefinitionen + + + + QextScintillaLexerCSS + + Default + Standard + + + Tag + Tag + + + Class selector + Klassenselektor + + + Pseudo-class + Pseudoklasse + + + Unknown pseudo-class + Unbekannte Pseudoklasse + + + Operator + Operator + + + CSS1 property + CSS1 Eigenschaft + + + Unknown property + Unbekannte Eigenschaft + + + Value + Wert + + + ID selector + ID-Selektor + + + Important + Wichtig + + + @-rule + @-Regel + + + Double-quoted string + Zeichenkette in Anführungszeichen + + + Single-quoted string + Zeichenkette in Hochkommata + + + CSS2 property + CSS2 Eigenschaft + + + Attribute + Attribut + + + + QextScintillaLexerCSharp + + Verbatim string + Uninterpretierte Zeichenkette + + + + QextScintillaLexerDiff + + Default + Standard + + + Comment + Kommentar + + + Command + Befehl + + + Header + Kopfzeilen + + + Position + Position + + + Removed line + Entfernte Zeile + + + Added line + Hinzugefügte Zeile + + + + QextScintillaLexerHTML + + HTML default + HTML Standard + + + Tag + Tag + + + Unknown tag + Unbekanntes Tag + + + Attribute + Attribut + + + Unknown attribute + Unbekanntes Attribut + + + HTML number + HTML Zahl + + + HTML double-quoted string + HTML Zeichenkette in Anführungszeichen + + + HTML single-quoted string + HTML Zeichenkette in Hochkommata + + + Other text in a tag + Anderer Text in einem Tag + + + HTML comment + HTML Kommentar + + + Entity + Entität + + + End of a tag + Tagende + + + Start of an XML fragment + Beginn eines XML Fragmentes + + + End of an XML fragment + Ende eines XML Fragmentes + + + Script tag + Skript Tag + + + Start of an ASP fragment with @ + Beginn eines ASP Fragmentes mit @ + + + Start of an ASP fragment + Beginn eines ASP Fragmentes + + + CDATA + CDATA + + + Start of a PHP fragment + Beginn eines PHP Fragmentes + + + Unquoted HTML value + HTML Wert ohne Anführungszeichen + + + ASP X-Code comment + ASP X-Code Kommentar + + + SGML default + SGML Standard + + + SGML command + SGML Befehl + + + First parameter of an SGML command + Erster Parameter eines SGML Befehls + + + SGML double-quoted string + SGML Zeichenkette in Anführungszeichen + + + SGML single-quoted string + SGML Zeichenkette in Hochkommata + + + SGML error + SGML Fehler + + + SGML special entity + SGML Spezielle Entität + + + SGML comment + SGML Kommentar + + + First parameter comment of an SGML command + Kommentar des ersten Parameters eines SGML Befehls + + + SGML block default + SGML Standardblock + + + Start of a JavaScript fragment + Beginn eines JavaScript Fragmentes + + + JavaScript default + JavaScript Standard + + + JavaScript comment + JavaScript Kommentar + + + JavaScript line comment + JavaScript Zeilenkommentar + + + JavaDoc style JavaScript comment + JavaDoc JavaScript Kommentar + + + JavaScript number + JavaScript Zahl + + + JavaScript word + JavaScript Wort + + + JavaScript keyword + JavaScript Schlüsselwort + + + JavaScript double-quoted string + JavaScript Zeichenkette in Anführungszeichen + + + JavaScript single-quoted string + JavaScript Zeichenkette in Hochkommata + + + JavaScript symbol + JavaScript Symbol + + + JavaScript unclosed string + JavaScript Unbeendete Zeichenkette + + + JavaScript regular expression + JavaScript Regulärer Ausdruck + + + Start of an ASP JavaScript fragment + Beginn eines ASP JavaScript Fragmentes + + + ASP JavaScript default + ASP JavaScript Standard + + + ASP JavaScript comment + ASP JavaScript Kommentar + + + ASP JavaScript line comment + ASP JavaScript Zeilenkommentar + + + JavaDoc style ASP JavaScript comment + JavaDoc ASP JavaScript Kommentar + + + ASP JavaScript number + ASP JavaScript Zahl + + + ASP JavaScript word + ASP JavaScript Wort + + + ASP JavaScript keyword + ASP JavaScript Schlüsselwort + + + ASP JavaScript double-quoted string + ASP JavaScript Zeichenkette in Anführungszeichen + + + ASP JavaScript single-quoted string + ASP JavaScript Zeichenkette in Hochkommata + + + ASP JavaScript symbol + ASP JavaScript Symbol + + + ASP JavaScript unclosed string + ASP JavaScript Unbeendete Zeichenkette + + + ASP JavaScript regular expression + ASP JavaScript Regulärer Ausdruck + + + Start of a VBScript fragment + Beginn eines VBScript Fragmentes + + + VBScript default + VBScript Standard + + + VBScript comment + VBScript Kommentar + + + VBScript number + VBScript Zahl + + + VBScript keyword + VBScript Schlüsselwort + + + VBScript string + VBScript Zeichenkette + + + VBScript identifier + VBScript Bezeichner + + + VBScript unclosed string + VBScript Unbeendete Zeichenkette + + + Start of an ASP VBScript fragment + Beginn eines ASP VBScript Fragmentes + + + ASP VBScript default + ASP VBScript Standard + + + ASP VBScript comment + ASP VBScript Kommentar + + + ASP VBScript number + ASP VBScript Zahl + + + ASP VBScript keyword + ASP VBScript Schlüsselwort + + + ASP VBScript string + ASP VBScript Zeichenkette + + + ASP VBScript identifier + ASP VBScript Bezeichner + + + ASP VBScript unclosed string + ASP VBScript Unbeendete Zeichenkette + + + Start of a Python fragment + Beginn eines Python Fragmentes + + + Python default + Python Standard + + + Python comment + Python Kommentar + + + Python number + Python Zahl + + + Python double-quoted string + Python Zeichenkette in Anführungszeichen + + + Python single-quoted string + Python Zeichenkette in Hochkommata + + + Python keyword + Python Schlüsselwort + + + Python triple double-quoted string + Python Zeichenkette in dreifachen Anführungszeichen + + + Python triple single-quoted string + Python Zeichenkette in dreifachen Hochkommata + + + Python class name + Python Klassenname + + + Python function or method name + Python Funktions- oder Methodenname + + + Python operator + Python Operator + + + Python identifier + Python Bezeichner + + + Start of an ASP Python fragment + Beginn eines ASP Python Fragmentes + + + ASP Python default + ASP Python Standard + + + ASP Python comment + ASP Python Kommentar + + + ASP Python number + ASP Python Zahl + + + ASP Python double-quoted string + ASP Python Zeichenkette in Anführungszeichen + + + ASP Python single-quoted string + ASP Python Zeichenkette in Hochkommata + + + ASP Python keyword + ASP Python Schlüsselwort + + + ASP Python triple double-quoted string + ASP Python Zeichenkette in dreifachen Anführungszeichen + + + ASP Python triple single-quoted string + ASP Python Zeichenkette in dreifachen Hochkommata + + + ASP Python class name + ASP Python Klassenname + + + ASP Python function or method name + ASP Python Funktions- oder Methodenname + + + ASP Python operator + ASP Python Operator + + + ASP Python identifier + ASP Python Bezeichner + + + PHP default + PHP Standard + + + PHP double-quoted string + PHP Zeichenkette in Anführungszeichen + + + PHP single-quoted string + PHP Zeichenkette in Hochkommata + + + PHP keyword + PHP Schlüsselwort + + + PHP number + PHP Zahl + + + PHP comment + PHP Kommentar + + + PHP line comment + PHP Zeilenkommentar + + + PHP double-quoted variable + PHP Variable in Anführungszeichen + + + PHP operator + PHP Operator + + + PHP variable + PHP Variable + + + + QextScintillaLexerIDL + + UUID + UUID + + + + QextScintillaLexerJavaScript + + Regular expression + Regulärer Ausdruck + + + + QextScintillaLexerLua + + Default + Standard + + + Comment + Kommentar + + + Line comment + Zeilenkommentar + + + Number + Zahl + + + Keyword + Schlüsselwort + + + String + Zeichenkette + + + Character + Zeichen + + + Literal string + Uninterpretierte Zeichenkette + + + Preprocessor + Preprozessor + + + Operator + Operator + + + Identifier + Bezeichner + + + Unclosed string + Unbeendete Zeichenkette + + + Basic functions + Basisfunktionen + + + String, table and maths functions + Zeichenketten-, Tabelle- und mathematische Funktionen + + + Coroutines, i/o and system facilities + Koroutinen, I/O- und Systemfunktionen + + + + QextScintillaLexerMakefile + + Default + Standard + + + Comment + Kommentar + + + Preprocessor + Preprozessor + + + Variable + Variable + + + Operator + Operator + + + Target + Ziel + + + Error + Fehler + + + + QextScintillaLexerPOV + + Default + Standard + + + Comment + Kommentar + + + Comment line + Kommentarzeile + + + Number + Zahl + + + Operator + Operator + + + Identifier + Bezeichner + + + String + Zeichenkette + + + Unclosed string + Unbeendete Zeichenkette + + + Directive + Direktive + + + Bad directive + Ungültige Direktive + + + Objects, CSG and appearance + Objekte, CSG und Erscheinung + + + Types, modifiers and items + Typen, Modifizierer und Items + + + Predefined identifiers + Vordefinierter Bezeichner + + + Predefined functions + Vordefinierte Funktion + + + User defined 1 + Nutzerdefiniert 1 + + + User defined 2 + Nutzerdefiniert 2 + + + User defined 3 + Nutzerdefiniert 3 + + + + QextScintillaLexerPerl + + Default + Standard + + + Error + Fehler + + + Comment + Kommentar + + + POD + POD + + + Number + Zahl + + + Keyword + Schlüsselwort + + + Double-quoted string + Zeichenkette in Anführungszeichen + + + Single-quoted string + Zeichenkette in Hochkommata + + + Operator + Operator + + + Identifier + Bezeichner + + + Scalar + Skalar + + + Array + Feld + + + Hash + Hash + + + Symbol table + Symboltabelle + + + Regular expression + Regulärer Ausdruck + + + Substitution + Ersetzung + + + Backticks + Backticks + + + Data section + Datensektion + + + Here document delimiter + Here Dokument-Begrenzer + + + Single-quoted here document + Here Dokument in Hochkommata + + + Double-quoted here document + Here Dokument in Anführungszeichen + + + Backtick here document + Here Dokument in Backticks + + + Quoted string (q) + Zeichenkette (q) + + + Quoted string (qq) + Zeichenkette (qq) + + + Quoted string (qx) + Zeichenkette (qx) + + + Quoted string (qr) + Zeichenkette (qr) + + + Quoted string (qw) + Zeichenkette (qw) + + + POD verbatim + POD wörtlich + + + + QextScintillaLexerProperties + + Default + Standard + + + Comment + Kommentar + + + Section + Abschnitt + + + Assignment + Zuweisung + + + Default value + Standardwert + + + + QextScintillaLexerPython + + Comment + Kommentar + + + Number + Zahl + + + Double-quoted string + Zeichenkette in Anführungszeichen + + + Single-quoted string + Zeichenkette in Hochkommata + + + Keyword + Schlüsselwort + + + Triple single-quoted string + Zeichenkette in dreifachen Hochkommata + + + Triple double-quoted string + Zeichenkette in dreifachen Anführungszeichen + + + Class name + Klassenname + + + Function or method name + Funktions- oder Methodenname + + + Operator + Operator + + + Identifier + Bezeichner + + + Comment block + Kommentarblock + + + Unclosed string + Unbeendete Zeichenkette + + + Default + Standard + + + Highlighted identifier + Hervorgehobener Bezeichner + + + Decorator + Dekorator + + + + QextScintillaLexerRuby + + Default + Standard + + + Comment + Kommentar + + + Number + Zahl + + + Double-quoted string + Zeichenkette in Anführungszeichen + + + Single-quoted string + Zeichenkette in Hochkommata + + + Keyword + Schlüsselwort + + + Class name + Klassenname + + + Function or method name + Funktions- oder Methodenname + + + Operator + Operator + + + Identifier + Bezeichner + + + Error + Fehler + + + POD + POD + + + Regular expression + Regulärer Ausdruck + + + Global + Global + + + Symbol + Symbol + + + Module name + Modulname + + + Instance variable + Instanzvariable + + + Class variable + Klassenvariable + + + Backticks + Backticks + + + Data section + Datensektion + + + Here document delimiter + Here Dokument-Begrenzer + + + Here document + Here Dokument + + + %q string + %q Zeichenkette + + + %Q string + %Q Zeichenkette + + + %x string + %x Zeichenkette + + + %r string + %r Zeichenkette + + + %w string + %w Zeichenkette + + + Demoted keyword + zurückgestuftes Schlüsselwort + + + stdin + Stdin + + + stdout + Stdout + + + stderr + Stderr + + + + QextScintillaLexerSQL + + Default + Standard + + + Comment + Kommentar + + + Number + Zahl + + + Keyword + Schlüsselwort + + + Single-quoted string + Zeichenkette in Hochkommata + + + Operator + Operator + + + Identifier + Bezeichner + + + Comment line + Kommentarzeile + + + JavaDoc style comment + JavaDoc Kommentar + + + Double-quoted string + Zeichenkette in Anführungszeichen + + + SQL*Plus keyword + SQL*Plus Schlüsselwort + + + SQL*Plus prompt + SQL*Plus Eingabe + + + SQL*Plus comment + SQL*Plus Kommentar + + + # comment line + # Kommentarzeile + + + JavaDoc keyword + JavaDoc Schlüsselwort + + + JavaDoc keyword error + JavaDoc Schlüsselwortfehler + + + User defined 1 + Nutzerdefiniert 1 + + + User defined 2 + Nutzerdefiniert 2 + + + User defined 3 + Nutzerdefiniert 3 + + + User defined 4 + Nutzerdefiniert 4 + + + + QextScintillaLexerTeX + + Default + Standard + + + Special + Spezial + + + Group + Gruppe + + + Symbol + Symbol + + + Command + Befehl + + + Text + Text + + + diff --git a/qt/qscintilla_fr.qm b/qt/qscintilla_fr.qm new file mode 100644 index 0000000..4fbed09 Binary files /dev/null and b/qt/qscintilla_fr.qm differ diff --git a/qt/qscintilla_fr.ts b/qt/qscintilla_fr.ts new file mode 100644 index 0000000..481b603 --- /dev/null +++ b/qt/qscintilla_fr.ts @@ -0,0 +1,1635 @@ + + + QextScintillaCommand + + Move down one line + Déplacement d'une ligne vers le bas + + + Extend selection down one line + Extension de la sélection d'une ligne vers le bas + + + Scroll view down one line + Decendre la vue d'une ligne + + + Extend rectangular selection down one line + Extension de la sélection rectangulaire d'une ligne vers le bas + + + Move up one line + Déplacement d'une ligne vers le haut + + + Extend selection up one line + Extension de la sélection d'une ligne vers le haut + + + Scroll view up one line + Remonter la vue d'une ligne + + + Extend rectangular selection up one line + Extension de la sélection rectangulaire d'une ligne vers le haut + + + Move up one paragraph + Déplacement d'un paragraphe vers le haut + + + Extend selection up one paragraph + Extension de la sélection d'un paragraphe vers le haut + + + Move down one paragraph + Déplacement d'un paragraphe vers le bas + + + Extend selection down one paragraph + Extension de la sélection d'un paragraphe vers le bas + + + Move left one character + Déplacement d'un caractère vers la gauche + + + Extend selection left one character + Extension de la sélection d'un caractère vers la gauche + + + Move left one word + Déplacement d'un mot vers la gauche + + + Extend selection left one word + Extension de la sélection d'un mot vers la gauche + + + Extend rectangular selection left one character + Extension de la sélection rectangulaire d'un caractère vers la gauche + + + Move right one character + Déplacement d'un caractère vers la droite + + + Extend selection right one character + Extension de la sélection d'un caractère vers la droite + + + Move right one word + Déplacement d'un mot vers la droite + + + Extend selection right one word + Extension de la sélection d'un mot vers la droite + + + Extend rectangular selection right one character + Extension de la sélection rectangulaire d'un caractère vers la droite + + + Move left one word part + Déplacement d'une part de mot vers la gauche + + + Extend selection left one word part + Extension de la sélection d'une part de mot vers la gauche + + + Move right one word part + Déplacement d'une part de mot vers la droite + + + Extend selection right one word part + Extension de la sélection d'une part de mot vers la droite + + + Move to first visible character in line + Déplacement vers le premier caractère visible de la ligne + + + Extend selection to first visible character in line + Extension de la sélection jusqu'au premier caractère visible de la ligne + + + Move to start of text + Déplacement au début du texte + + + Extend selection to start of text + Extension de la sélection jusqu'au début du texte + + + Move to start of displayed line + Déplacement au le début de la ligne affichée + + + Extend selection to start of line + Extension de la sélection jusqu'au début de la ligne + + + Extend rectangular selection to first visible character in line + Extension de la sélection rectangulaire jusqu'au premier caractère visible de la ligne + + + Move to end of line + Déplacement à la fin de la ligne + + + Extend selection to end of line + Extension de la sélection jusqu'à la fin de la ligne + + + Move to end of text + Déplacement à la fin du du texte + + + Extend selection to end of text + Extension de la sélection jusqu'à la fin du texte + + + Move to end of displayed line + Déplacement à la fin de la ligne affichée + + + Extend selection to end of displayed line + Extension de la sélection à la fin de la ligne affichée + + + Extend rectangular selection to end of line + Extension de la sélection rectangulaire à la fin de la ligne + + + Move up one page + Déplacement d'une page vers le haut + + + Extend selection up one page + Extension de la sélection d'une page vers le haut + + + Extend rectangular selection up one page + Extension de la sélection rectangulaire d'une page vers le haut + + + Move down one page + Déplacement d'une page vers le bas + + + Extend selection down one page + Extension de la sélection d'une page vers le bas + + + Extend rectangular selection down one page + Extension de la sélection rectangulaire d'une page vers le bas + + + Delete current character + Effacement du caractère courant + + + Cut selection + Couper la sélection + + + Delete word to right + Suppression du mot de droite + + + Delete line to right + Suppression de la partie droite de la ligne + + + Toggle insert/overtype + Basculement Insertion /Ecrasement + + + Paste + Coller + + + Copy selection + Copier la sélection + + + Cancel + Annuler + + + Delete previous character + Suppression du dernier caractère + + + Delete word to left + Suppression du mot de gauche + + + Undo the last command + Annuler la dernière commande + + + Delete line to left + Effacer la partie gauche de la ligne + + + Redo last command + Refaire la dernière commande + + + Select all text + Sélectionner tout le texte + + + Indent one level + Indentation d'un niveau + + + Move back one indentation level + Désindentation d'un niveau + + + Insert new line + Insertion d'une nouvelle ligne + + + Zoom in + Zoom avant + + + Zoom out + Zoom arrière + + + Set zoom + Définition du zoom + + + Formfeed + Chargement de la page + + + Cut current line + Couper la ligne courante + + + Delete current line + Suppression de la ligne courante + + + Copy current line + Copier la ligne courante + + + Swap current and previous lines + Permuter la ligne précédente avec la ligne courante + + + Convert selection to lower case + Conversion de la ligne courante en minuscules + + + Convert selection to upper case + Conversion de la ligne courante en majuscules + + + Delete previous character if not at line start + Suppression du caractère précédent sauf en début de ligne + + + Duplicate selection + + + + + QextScintillaLexerBash + + Default + Par défaut + + + Error + Erreur + + + Comment + Commentaire + + + Number + Nombre + + + Keyword + Mot-clé + + + Double-quoted string + Chaine de caractères (guillemets doubles) + + + Single-quoted string + Chaine de caractères (guillemets simples) + + + Operator + Opérateur + + + Identifier + Identificateur + + + Scalar + Scalaire + + + Parameter expansion + Extension de paramètre + + + Backticks + Quotes inverses + + + Here document delimiter + Délimiteur de texte intégré (cat <<EOF....EOF) + + + Single-quoted here document + Document intégré guillemets simples + + + + QextScintillaLexerBatch + + Default + Par défaut + + + Comment + Commentaire + + + Keyword + Mot-clé + + + Label + Titre + + + Hide command character + Cacher le caratère de commande + + + External command + Commande externe + + + Variable + Variable + + + Operator + Opérateur + + + + QextScintillaLexerCPP + + Default + Par défaut + + + C comment + Commentaire C + + + C++ comment + Commentaire C++ + + + JavaDoc style C comment + Commentaire C de style JavaDoc + + + Number + Nombre + + + Keyword + Mot-clé + + + Double-quoted string + Chaine de caractères (guillemets doubles) + + + Single-quoted string + Chaine de caractères (guillemets simples) + + + Pre-processor block + Instructions de pré-processing + + + Operator + Opérateur + + + Identifier + Identificateur + + + Unclosed string + Chaine de caractères non refermée + + + JavaDoc style C++ comment + Commentaire C++ de style JavaDoc + + + Secondary keywords and identifiers + Seconds mots-clés et identificateurs + + + JavaDoc keyword + Mot-clé JavaDoc + + + JavaDoc keyword error + Erreur de mot-clé JavaDoc + + + Global classes and typedefs + Classes globales et définitions de types + + + + QextScintillaLexerCSS + + Default + Par défaut + + + Tag + Balise + + + Class selector + Classe + + + Pseudo-class + Pseudo-classe + + + Unknown pseudo-class + Peudo-classe inconnue + + + Operator + Opérateur + + + CSS1 property + Propriété CSS1 + + + Unknown property + Propriété inconnue + + + Value + Valeur + + + ID selector + ID + + + Important + Important + + + @-rule + règle-@ + + + Double-quoted string + Chaine de caractères (guillemets doubles) + + + Single-quoted string + Chaine de caractères (guillemets simples) + + + CSS2 property + Propriété CSS2 + + + Attribute + Attribut + + + + QextScintillaLexerCSharp + + Verbatim string + Chaine verbatim + + + + QextScintillaLexerDiff + + Default + Par défaut + + + Comment + Commentaire + + + Command + Commande + + + Header + En-tête + + + Position + Position + + + Removed line + Ligne supprimée + + + Added line + Ligne ajoutée + + + + QextScintillaLexerHTML + + HTML default + HTML par défaut + + + Tag + Balise + + + Unknown tag + Balise inconnue + + + Attribute + Attribut + + + Unknown attribute + Attribut inconnu + + + HTML number + Nombre HTML + + + HTML double-quoted string + Chaine de caractères HTML (guillemets doubles) + + + HTML single-quoted string + Chaine de caractères HTML (guillemets simples) + + + Other text in a tag + Autre texte dans les balises + + + HTML comment + Commentaire HTML + + + Entity + Entité + + + End of a tag + Balise fermante + + + Start of an XML fragment + Début de block XML + + + End of an XML fragment + Fin de block XML + + + Script tag + Balise de script + + + Start of an ASP fragment with @ + Début de block ASP avec @ + + + Start of an ASP fragment + Début de block ASP + + + CDATA + CDATA + + + Start of a PHP fragment + Début de block PHP + + + Unquoted HTML value + Valeur HTML sans guillemets + + + ASP X-Code comment + Commentaire X-Code ASP + + + SGML default + SGML par défaut + + + SGML command + Commande SGML + + + First parameter of an SGML command + Premier paramètre de commande SGML + + + SGML double-quoted string + Chaine de caractères SGML (guillemets doubles) + + + SGML single-quoted string + Chaine de caractères SGML (guillemets simples) + + + SGML error + Erreur SGML + + + SGML special entity + Entité SGML spéciale + + + SGML comment + Commentaire SGML + + + First parameter comment of an SGML command + Premier paramètre de commentaire de commande SGML + + + SGML block default + Block SGML par défaut + + + Start of a JavaScript fragment + Début de block JavaScript + + + JavaScript default + JavaScript par défaut + + + JavaScript comment + Commentaire JavaScript + + + JavaScript line comment + Commentaire de ligne JavaScript + + + JavaDoc style JavaScript comment + Commentaire JavaScript de style JavaDoc + + + JavaScript number + Nombre JavaScript + + + JavaScript word + Mot JavaScript + + + JavaScript keyword + Mot-clé JavaScript + + + JavaScript double-quoted string + Chaine de caractères JavaScript (guillemets doubles) + + + JavaScript single-quoted string + Chaine de caractères JavaScript (guillemets simples) + + + JavaScript symbol + Symbole JavaScript + + + JavaScript unclosed string + Chaine de caractères JavaScript non refermée + + + JavaScript regular expression + Expression régulière JavaScript + + + Start of an ASP JavaScript fragment + Début de block JavaScript ASP + + + ASP JavaScript default + JavaScript ASP par défaut + + + ASP JavaScript comment + Commentaire JavaScript ASP + + + ASP JavaScript line comment + Commentaire de ligne JavaScript ASP + + + JavaDoc style ASP JavaScript comment + Commentaire JavaScript ASP de style JavaDoc + + + ASP JavaScript number + Nombre JavaScript ASP + + + ASP JavaScript word + Mot JavaScript ASP + + + ASP JavaScript keyword + Mot-clé JavaScript ASP + + + ASP JavaScript double-quoted string + Chaine de caractères JavaScript ASP (guillemets doubles) + + + ASP JavaScript single-quoted string + Chaine de caractères JavaScript ASP (guillemets simples) + + + ASP JavaScript symbol + Symbole JavaScript ASP + + + ASP JavaScript unclosed string + Chaine de caractères JavaScript ASP non refermée + + + ASP JavaScript regular expression + Expression régulière JavaScript ASP + + + Start of a VBScript fragment + Début de block VBScript + + + VBScript default + VBScript par défaut + + + VBScript comment + Commentaire VBScript + + + VBScript number + Nombre VBScript + + + VBScript keyword + Mot-clé VBScript + + + VBScript string + Chaine de caractères VBScript + + + VBScript identifier + Identificateur VBScript + + + VBScript unclosed string + Chaine de caractères VBScript non refermée + + + Start of an ASP VBScript fragment + Début de block VBScript ASP + + + ASP VBScript default + VBScript ASP par défaut + + + ASP VBScript comment + Commentaire VBScript ASP + + + ASP VBScript number + Nombre VBScript ASP + + + ASP VBScript keyword + Mot-clé VBScript ASP + + + ASP VBScript string + Chaine de caractères VBScript ASP + + + ASP VBScript identifier + Identificateur VBScript ASP + + + ASP VBScript unclosed string + Chaine de caractères VBScript ASP non refermée + + + Start of a Python fragment + Début de block Python + + + Python default + Python par défaut + + + Python comment + Commentaire Python + + + Python number + Nombre Python + + + Python double-quoted string + Chaine de caractères Python (guillemets doubles) + + + Python single-quoted string + Chaine de caractères Python (guillemets simples) + + + Python keyword + Mot-clé Python + + + Python triple double-quoted string + Chaine de caractères Python (triples guillemets doubles) + + + Python triple single-quoted string + Chaine de caractères Python (triples guillemets simples) + + + Python class name + Nom de classe Python + + + Python function or method name + Méthode ou fonction Python + + + Python operator + Opérateur Python + + + Python identifier + Identificateur Python + + + Start of an ASP Python fragment + Début de block Python ASP + + + ASP Python default + Python ASP par défaut + + + ASP Python comment + Commentaire Python ASP + + + ASP Python number + Nombre Python ASP + + + ASP Python double-quoted string + Chaine de caractères Python ASP (guillemets doubles) + + + ASP Python single-quoted string + Chaine de caractères Python ASP (guillemets simples) + + + ASP Python keyword + Mot-clé Python ASP + + + ASP Python triple double-quoted string + Chaine de caractères Python ASP (triples guillemets doubles) + + + ASP Python triple single-quoted string + Chaine de caractères Python ASP (triples guillemets simples) + + + ASP Python class name + Nom de classe Python ASP + + + ASP Python function or method name + Méthode ou fonction Python ASP + + + ASP Python operator + Opérateur Python ASP + + + ASP Python identifier + Identificateur Python ASP + + + PHP default + PHP par défaut + + + PHP double-quoted string + Chaine de caractères PHP (guillemets doubles) + + + PHP single-quoted string + Chaine de caractères PHP (guillemets simples) + + + PHP keyword + Mot-clé PHP + + + PHP number + Nombre PHP + + + PHP variable + Variable PHP + + + PHP comment + Commentaire PHP + + + PHP line comment + Commentaire de ligne PHP + + + PHP double-quoted variable + Variable PHP (guillemets doubles) + + + PHP operator + Opérateur PHP + + + + QextScintillaLexerIDL + + UUID + UUID + + + + QextScintillaLexerJavaScript + + Regular expression + Expression régulière + + + + QextScintillaLexerLua + + Default + Par défaut + + + Comment + Commentaire + + + Line comment + Commentaire de ligne + + + Number + Nombre + + + Keyword + Mot-clé + + + String + Chaîne de caractères + + + Character + Caractère + + + Literal string + Chaîne littérale + + + Preprocessor + Préprocessing + + + Operator + Opérateur + + + Identifier + Identificateur + + + Unclosed string + Chaine de caractères non refermée + + + Basic functions + Fonctions de base + + + String, table and maths functions + Fonctions sur les chaines, tables et fonctions math + + + Coroutines, i/o and system facilities + Coroutines, i/o et fonctions système + + + + QextScintillaLexerMakefile + + Default + Par défaut + + + Comment + Commentaire + + + Preprocessor + Préprocessing + + + Variable + Variable + + + Operator + Opérateur + + + Target + Cible + + + Error + Erreur + + + + QextScintillaLexerPOV + + Default + Par défaut + + + Comment + Commentaire + + + Comment line + Ligne commentée + + + Number + Nombre + + + Operator + Opérateur + + + Identifier + Identificateur + + + String + Chaîne de caractères + + + Unclosed string + Chaine de caractères non refermée + + + Directive + Directive + + + Bad directive + Mauvaise directive + + + Objects, CSG and appearance + Objets, CSG et apparence + + + Types, modifiers and items + Types, modifieurs et éléments + + + Predefined identifiers + Identifiants prédéfinis + + + Predefined functions + Fonctions prédéfinies + + + User defined 1 + Définition utilisateur 1 + + + User defined 2 + Définition utilisateur 2 + + + User defined 3 + Définition utilisateur 3 + + + + QextScintillaLexerPerl + + Default + Par défaut + + + Error + Erreur + + + Comment + Commentaire + + + POD + POD + + + Number + Nombre + + + Keyword + Mot-clé + + + Double-quoted string + Chaine de caractères (guillemets doubles) + + + Single-quoted string + Chaine de caractères (guillemets simples) + + + Operator + Opérateur + + + Identifier + Identificateur + + + Scalar + Scalaire + + + Array + Tableau + + + Hash + Hashage + + + Symbol table + Table de symboles + + + Regular expression + Expression régulière + + + Substitution + Substitution + + + Backticks + Quotes inverses + + + Data section + Section de données + + + Here document delimiter + Délimiteur de texte intégré (cat <<EOF....EOF) + + + Single-quoted here document + Document intégré guillemets simples + + + Double-quoted here document + Document intégré guillemets doubles + + + Backtick here document + Document intégré quotes inverses + + + Quoted string (q) + Chaine quotée (q) + + + Quoted string (qq) + Chaine quotée (qq) + + + Quoted string (qx) + Chaine quotée (qx) + + + Quoted string (qr) + Chaine quotée (qr) + + + Quoted string (qw) + Chaine quotée (qw) + + + POD verbatim + POD verbatim + + + + QextScintillaLexerProperties + + Default + Par défaut + + + Comment + Commentaire + + + Section + Section + + + Assignment + Affectation + + + Default value + Valeur par défaut + + + + QextScintillaLexerPython + + Default + Par défaut + + + Comment + Commentaire + + + Number + Nombre + + + Double-quoted string + Chaine de caractères (guillemets doubles) + + + Single-quoted string + Chaine de caractères (guillemets simples) + + + Keyword + Mot-clé + + + Triple single-quoted string + Chaine de caractères HTML (guillemets simples) + + + Triple double-quoted string + Chaine de caractères HTML (guillemets simples) + + + Class name + Nom de classe + + + Function or method name + Nom de méthode ou de fonction + + + Operator + Opérateur + + + Identifier + Identificateur + + + Comment block + Block de commentaires + + + Unclosed string + Chaine de caractères non refermée + + + Highlighted identifier + + + + Decorator + + + + + QextScintillaLexerRuby + + Default + Par défaut + + + Comment + Commentaire + + + Number + Nombre + + + Double-quoted string + Chaine de caractères (guillemets doubles) + + + Single-quoted string + Chaine de caractères (guillemets simples) + + + Keyword + Mot-clé + + + Class name + Nom de classe + + + Function or method name + Nom de méthode ou de fonction + + + Operator + Opérateur + + + Identifier + Identificateur + + + Error + Erreur + + + POD + POD + + + Regular expression + Expression régulière + + + Global + + + + Symbol + Symbole + + + Module name + + + + Instance variable + + + + Class variable + + + + Backticks + Quotes inverses + + + Data section + Section de données + + + Here document delimiter + Délimiteur de texte intégré (cat <<EOF....EOF) + + + Here document + + + + %q string + + + + %Q string + + + + %x string + + + + %r string + + + + %w string + + + + Demoted keyword + + + + stdin + + + + stdout + + + + stderr + + + + + QextScintillaLexerSQL + + Default + Par défaut + + + Comment + Commentaire + + + Number + Nombre + + + Keyword + Mot-clé + + + Single-quoted string + Chaine de caractères (guillemets simples) + + + Operator + Opérateur + + + Identifier + Identificateur + + + Comment line + Ligne commentée + + + JavaDoc style comment + Commentaire style JavaDoc + + + Double-quoted string + Chaine de caractères (guillemets doubles) + + + SQL*Plus keyword + Mot-clé SQL*Plus + + + SQL*Plus prompt + Prompt SQL*Plus + + + SQL*Plus comment + Commentaire SQL*Plus + + + # comment line + # Ligne commentée + + + JavaDoc keyword + Mot-clé JavaDoc + + + JavaDoc keyword error + Erreur de mot-clé JavaDoc + + + User defined 1 + Définition utilisateur 1 + + + User defined 2 + Définition utilisateur 2 + + + User defined 3 + Définition utilisateur 3 + + + User defined 4 + Définition utilisateur 4 + + + + QextScintillaLexerTeX + + Default + Par défaut + + + Special + Spécial + + + Group + Groupe + + + Symbol + Symbole + + + Command + Commande + + + Text + Texte + + + diff --git a/qt/qscintilla_pt_br.qm b/qt/qscintilla_pt_br.qm new file mode 100644 index 0000000..1b181f3 Binary files /dev/null and b/qt/qscintilla_pt_br.qm differ diff --git a/qt/qscintilla_pt_br.ts b/qt/qscintilla_pt_br.ts new file mode 100644 index 0000000..207472f --- /dev/null +++ b/qt/qscintilla_pt_br.ts @@ -0,0 +1,1635 @@ + + + QextScintillaCommand + + Move down one line + Mover uma linha para baixo + + + Extend selection down one line + Extender a seleção uma linha para baixo + + + Scroll view down one line + Descer a visão uma linha para baixo + + + Extend rectangular selection down one line + Extender a seleção retangular uma linha para baixo + + + Move up one line + Mover uma linha para cima + + + Extend selection up one line + Extender a seleção uma linha para cima + + + Scroll view up one line + Subir a visão uma linha para cima + + + Extend rectangular selection up one line + Extender a seleção retangular uma linha para cima + + + Move up one paragraph + Mover um paragrafo para cima + + + Extend selection up one paragraph + Extender a seleção um paragrafo para cima + + + Move down one paragraph + Mover um paragrafo para baixo + + + Extend selection down one paragraph + Extender a seleção um paragrafo para baixo + + + Move left one character + Mover um caractere para a esquerda + + + Extend selection left one character + Extender a seleção um caractere para esquerda + + + Move left one word + Mover uma palavra para esquerda + + + Extend selection left one word + Extender a seleção uma palavra para esquerda + + + Extend rectangular selection left one character + Extender a seleção retangular um caractere para esquerda + + + Move right one character + Mover um caractere para direita + + + Extend selection right one character + Extender a seleção um caractere para direita + + + Move right one word + Mover uma palavra para direita + + + Extend selection right one word + Extender a seleção uma palavra para direita + + + Extend rectangular selection right one character + Extender a seleção retangular um caractere para direita + + + Move left one word part + Mover uma parte da palavra para esquerda + + + Extend selection left one word part + Extender a seleção uma parte de palavra para esquerda + + + Move right one word part + Mover uma parte da palavra para direita + + + Extend selection right one word part + Extender a seleção uma parte de palavra para direita + + + Move to first visible character in line + Mover para o primeiro caractere visível na linha + + + Extend selection to first visible character in line + Extender a seleção para o primeiro caractere na linha + + + Move to start of text + Mover para o ínicio do texto + + + Extend selection to start of text + Extender a seleção para o ínicio do texto + + + Move to start of displayed line + Mover para o ínicio da linha exibida + + + Extend selection to start of line + Extender a seleção para o ínicio da linha + + + Extend rectangular selection to first visible character in line + Extender a seleção para o primeiro caractere visível na linha + + + Move to end of line + Mover para o final da linha + + + Extend selection to end of line + Extender a seleção para o final da linha + + + Move to end of text + Mover para o final do texto + + + Extend selection to end of text + Extender a seleção para o final do texto + + + Move to end of displayed line + Mover para o final da linha exibida + + + Extend selection to end of displayed line + Extender a seleção retangular para o final da linha exibida + + + Extend rectangular selection to end of line + Extender a seleção retangular para o final da linha + + + Move up one page + Mover uma página para cima + + + Extend selection up one page + Extender a seleção uma página para cima + + + Extend rectangular selection up one page + Extender a seleção retangular uma página para cima + + + Move down one page + Mover uma página para baixo + + + Extend selection down one page + Extender a seleção uma página para baixo + + + Extend rectangular selection down one page + Extender a seleção retangular uma página para baixo + + + Delete current character + Excluir caractere atual + + + Cut selection + Recortar seleção + + + Delete word to right + Excluir palavra para direita + + + Delete line to right + Excluir linha para direita + + + Toggle insert/overtype + Alternar entre modo de inserir/sobreescrever + + + Paste + Copiar + + + Copy selection + Copiar seleção + + + Cancel + Cancelar + + + Delete previous character + Excluir caractere anterior + + + Delete word to left + Excluir palavra a esquerda + + + Undo the last command + Desfazer último comando + + + Delete line to left + Excluir linha a esquerda + + + Redo last command + Refazer último comando + + + Select all text + Selecionar todo o texto + + + Indent one level + Indentar um nível + + + Move back one indentation level + Desindentar um nível + + + Insert new line + Inserir nova linha + + + Zoom in + Aumentar zoom + + + Zoom out + Diminuir zoom + + + Set zoom + Configurar zoom + + + Formfeed + Alimentação da Página + + + Cut current line + Configurar linha atual + + + Delete current line + Excluir linha atual + + + Copy current line + Copiar linha atual + + + Swap current and previous lines + Trocar linha atual com as linhas anteriores + + + Convert selection to lower case + Converter a seleção para minúscula + + + Convert selection to upper case + Converter a seleção para maiúscula + + + Delete previous character if not at line start + Excluir o caractere anterior se o mesmo não estiver no ínicio da linha + + + Duplicate selection + + + + + QextScintillaLexerBash + + Default + Padrão + + + Error + Número + + + Comment + Comentário + + + Number + Número + + + Keyword + Palavra Chave + + + Double-quoted string + Cadeia de caracteres envolvida por aspas duplas + + + Single-quoted string + Cadeia de caracteres envolvida por aspas simples + + + Operator + Operador + + + Identifier + Identificador + + + Scalar + Escalar + + + Parameter expansion + Parâmetro de Expansão + + + Backticks + Aspas Invertidas + + + Here document delimiter + Delimitador de "here documents" + + + Single-quoted here document + "here document" envolvido por aspas simples + + + + QextScintillaLexerBatch + + Default + Padrão + + + Comment + Comentário + + + Keyword + Palavra Chave + + + Label + Rótulo + + + Hide command character + Esconder caractere de comando + + + External command + Comando externo + + + Variable + Variável + + + Operator + Operador + + + + QextScintillaLexerCPP + + Default + Padrão + + + C comment + Comentário C + + + C++ comment + Comentário C++ + + + JavaDoc style C comment + Comentário JavaDoc estilo C + + + Number + Número + + + Keyword + Palavra Chave + + + Double-quoted string + Cadeia de caracteres envolvida por aspas duplas + + + Single-quoted string + Cadeia de caracteres envolvida por aspas simples + + + Pre-processor block + Instruções de pré-processamento + + + Operator + Operador + + + Identifier + Identificador + + + Unclosed string + Cadeia de caracteres não fechada + + + JavaDoc style C++ comment + Comentário JavaDoc estilo C++ + + + Secondary keywords and identifiers + Identificadores e palavras chave secundárias + + + JavaDoc keyword + Palavra chave JavaDoc + + + JavaDoc keyword error + Erro de palavra chave do JavaDoc + + + Global classes and typedefs + Classes e definições de tipo globais + + + + QextScintillaLexerCSS + + Default + Padrão + + + Tag + Marcador + + + Class selector + Seletor de classe + + + Pseudo-class + Pseudo-classe + + + Unknown pseudo-class + Pseudo-classe desconhecida + + + Operator + Operador + + + CSS1 property + Propriedade CSS1 + + + Unknown property + Propriedade desconhecida + + + Value + Valor + + + ID selector + Seletor de ID + + + Important + Importante + + + @-rule + regra-@ + + + Double-quoted string + Cadeia de caracteres envolvida por aspas duplas + + + Single-quoted string + Cadeia de caracteres envolvida por aspas simples + + + CSS2 property + Propriedade CSS2 + + + Attribute + Atributo + + + + QextScintillaLexerCSharp + + Verbatim string + Cadeia de caracteres no formato verbatim + + + + QextScintillaLexerDiff + + Default + Padrão + + + Comment + Comentário + + + Command + Comando + + + Header + Cabeçalho + + + Position + Posição + + + Removed line + Linha Removida + + + Added line + Linha Adicionada + + + + QextScintillaLexerHTML + + HTML default + HTML por padrão + + + Tag + Marcador + + + Unknown tag + Marcador desconhecido + + + Attribute + Atributo + + + Unknown attribute + Atributo desconhecido + + + HTML number + Número HTML + + + HTML double-quoted string + Cadeia de caracteres HTML envolvida por aspas duplas + + + HTML single-quoted string + Cadeia de caracteres HTML envolvida por aspas simples + + + Other text in a tag + Outro texto em um marcador + + + HTML comment + Comentário HTML + + + Entity + Entidade + + + End of a tag + Final de um marcador + + + Start of an XML fragment + Início de um bloco XML + + + End of an XML fragment + Final de um bloco XML + + + Script tag + Marcador de script + + + Start of an ASP fragment with @ + Início de um bloco ASP com @ + + + Start of an ASP fragment + Início de um bloco ASP + + + CDATA + CDATA + + + Start of a PHP fragment + Início de um bloco PHP + + + Unquoted HTML value + Valor HTML não envolvido por aspas + + + ASP X-Code comment + Comentário ASP X-Code + + + SGML default + SGML por padrão + + + SGML command + Comando SGML + + + First parameter of an SGML command + Primeiro parâmetro em um comando SGML + + + SGML double-quoted string + Cadeia de caracteres SGML envolvida por aspas duplas + + + SGML single-quoted string + Cadeia de caracteres SGML envolvida por aspas simples + + + SGML error + Erro SGML + + + SGML special entity + Entidade especial SGML + + + SGML comment + Comando SGML + + + First parameter comment of an SGML command + Primeiro comentário de parâmetro de uma comando SGML + + + SGML block default + Bloco SGML por padrão + + + Start of a JavaScript fragment + Início de um bloco Javascript + + + JavaScript default + JavaScript por padrão + + + JavaScript comment + Comentário JavaScript + + + JavaScript line comment + Comentário de linha JavaScript + + + JavaDoc style JavaScript comment + Comentário JavaScript no estilo JavaDoc + + + JavaScript number + Número JavaScript + + + JavaScript word + Palavra JavaScript + + + JavaScript keyword + Palavra chave JavaScript + + + JavaScript double-quoted string + Cadeia de caracteres JavaScript envolvida por aspas duplas + + + JavaScript single-quoted string + Cadeia de caracteres JavaScript envolvida por aspas simples + + + JavaScript symbol + Símbolo JavaScript + + + JavaScript unclosed string + Cadeia de caracteres JavaScript não fechada + + + JavaScript regular expression + Expressão regular JavaScript + + + Start of an ASP JavaScript fragment + Início de um bloco Javascript ASP + + + ASP JavaScript default + JavaScript ASP por padrão + + + ASP JavaScript comment + Comentário JavaScript ASP + + + ASP JavaScript line comment + Comentário de linha JavaScript ASP + + + JavaDoc style ASP JavaScript comment + Comentário JavaScript ASP no estilo JavaDoc + + + ASP JavaScript number + Número JavaScript ASP + + + ASP JavaScript word + Palavra chave JavaScript ASP + + + ASP JavaScript keyword + Palavra chave JavaScript ASP + + + ASP JavaScript double-quoted string + Cadeia de caracteres JavaScript ASP envolvida por aspas duplas + + + ASP JavaScript single-quoted string + Cadeia de caracteres JavaScript ASP envolvida por aspas simples + + + ASP JavaScript symbol + Símbolo JavaScript ASP + + + ASP JavaScript unclosed string + Cadeia de caracteres JavaScript ASP não fechada + + + ASP JavaScript regular expression + Expressão regular JavaScript ASP + + + Start of a VBScript fragment + Início de um bloco VBScript + + + VBScript default + VBScript por padrão + + + VBScript comment + Comentário VBScript + + + VBScript number + Número VBScript + + + VBScript keyword + Palavra chave VBScript + + + VBScript string + Cadeia de caracteres VBScript + + + VBScript identifier + Identificador VBScript + + + VBScript unclosed string + Cadeia de caracteres VBScript não fechada + + + Start of an ASP VBScript fragment + Início de um bloco VBScript ASP + + + ASP VBScript default + VBScript ASP por padrão + + + ASP VBScript comment + Comentário VBScript ASP + + + ASP VBScript number + Número VBScript ASP + + + ASP VBScript keyword + Palavra chave VBScript ASP + + + ASP VBScript string + Cadeia de caracteres VBScript ASP + + + ASP VBScript identifier + Identificador VBScript ASP + + + ASP VBScript unclosed string + Cadeia de caracteres VBScript ASP não fechada + + + Start of a Python fragment + Início de um bloco Python + + + Python default + Python por padrão + + + Python comment + Comentário Python + + + Python number + Número Python + + + Python double-quoted string + Cadeia de caracteres Python envolvida por aspas duplas + + + Python single-quoted string + Cadeia de caracteres Python envolvida por aspas simples + + + Python keyword + Palavra chave Python + + + Python triple double-quoted string + Cadeia de caracteres Python envolvida por aspas triplas duplas + + + Python triple single-quoted string + Cadeia de caracteres Python envolvida por aspas triplas simples + + + Python class name + Nome de classe Python + + + Python function or method name + Nome de método ou função Python + + + Python operator + Operador Python + + + Python identifier + Identificador Python + + + Start of an ASP Python fragment + Início de um bloco Python ASP + + + ASP Python default + Python ASP por padrão + + + ASP Python comment + Comentário Python ASP + + + ASP Python number + Número Python ASP + + + ASP Python double-quoted string + Cadeia de caracteres Python ASP envolvida por aspas duplas + + + ASP Python single-quoted string + Cadeia de caracteres Python ASP envolvida por aspas simples + + + ASP Python keyword + Palavra chave Python ASP + + + ASP Python triple double-quoted string + Cadeia de caracteres Python ASP envolvida por aspas triplas duplas + + + ASP Python triple single-quoted string + Cadeia de caracteres Python ASP envolvida por aspas triplas simples + + + ASP Python class name + Nome de classe Python ASP + + + ASP Python function or method name + Nome de método ou função Python ASP + + + ASP Python operator + Operador Python ASP + + + ASP Python identifier + Identificador Python ASP + + + PHP default + PHP por padrão + + + PHP double-quoted string + Cadeia de caracteres PHP envolvida por aspas duplas + + + PHP single-quoted string + Cadeia de caracteres PHP envolvida por aspas simples + + + PHP keyword + Palavra chave PHP + + + PHP number + Número PHP + + + PHP variable + Variável PHP + + + PHP comment + Comentário PHP + + + PHP line comment + Comentário de linha PHP + + + PHP double-quoted variable + Variável PHP envolvida por aspas duplas + + + PHP operator + Operador PHP + + + + QextScintillaLexerIDL + + UUID + UUID + + + + QextScintillaLexerJavaScript + + Regular expression + Expressão Regular + + + + QextScintillaLexerLua + + Default + Padrão + + + Comment + Comentário + + + Line comment + Comentar Linha + + + Number + Número + + + Keyword + Palavra Chave + + + String + Cadeia de Caracteres + + + Character + Caractere + + + Literal string + Cadeia de caracteres literal + + + Preprocessor + Preprocessador + + + Operator + Operador + + + Identifier + Identificador + + + Unclosed string + Cadeia de caracteres não fechada + + + Basic functions + Funções básicas + + + String, table and maths functions + Funções de cadeia de caracteres e de tabelas matemáticas + + + Coroutines, i/o and system facilities + Funções auxiiares, e/s e funções de sistema + + + + QextScintillaLexerMakefile + + Default + Padrão + + + Comment + Comentário + + + Preprocessor + Preprocessador + + + Variable + Variável + + + Operator + Operador + + + Target + Destino + + + Error + Erro + + + + QextScintillaLexerPOV + + Default + Padrão + + + Comment + Comentário + + + Comment line + Comentar Linha + + + Number + Número + + + Operator + Operador + + + Identifier + Identificador + + + String + Cadeia de Caracteres + + + Unclosed string + Cadeia de caracteres não fechada + + + Directive + Diretiva + + + Bad directive + Diretiva ruim + + + Objects, CSG and appearance + Objetos, CSG e aparência + + + Types, modifiers and items + Tipos, modificadores e itens + + + Predefined identifiers + Identificadores predefinidos + + + Predefined functions + Funções predefinidas + + + User defined 1 + Definição de usuário 1 + + + User defined 2 + Definição de usuário 2 + + + User defined 3 + Definição de usuário 3 + + + + QextScintillaLexerPerl + + Default + Padrão + + + Error + Erro + + + Comment + Comentário + + + POD + POD + + + Number + Número + + + Keyword + Palavra Chave + + + Double-quoted string + Cadeia de caracteres envolvida por aspas duplas + + + Single-quoted string + Cadeia de caracteres envolvida por aspas simples + + + Operator + Operador + + + Identifier + Identificador + + + Scalar + Escalar + + + Array + Vetor + + + Hash + Hash + + + Symbol table + Tabela de Símbolos + + + Regular expression + Expressão Regular + + + Substitution + Substituição + + + Backticks + Aspas Invertidas + + + Data section + Seção de dados + + + Here document delimiter + Delimitador de documentos criados através de redicionadores (>> e >) + + + Single-quoted here document + "here document" envolvido por aspas simples + + + Double-quoted here document + "here document" envolvido por aspas duplas + + + Backtick here document + "here document" envolvido por aspas invertidas + + + Quoted string (q) + Cadeia de caracteres envolvida por aspas (q) + + + Quoted string (qq) + Cadeia de caracteres envolvida por aspas (qq) + + + Quoted string (qx) + Cadeia de caracteres envolvida por aspas (qx) + + + Quoted string (qr) + Cadeia de caracteres envolvida por aspas (qr) + + + Quoted string (qw) + Cadeia de caracteres envolvida por aspas (qw) + + + POD verbatim + POD em formato verbatim + + + + QextScintillaLexerProperties + + Default + Padrão + + + Comment + Comentário + + + Section + Seção + + + Assignment + Atribuição + + + Default value + Valor Padrão + + + + QextScintillaLexerPython + + Default + Padrão + + + Comment + Comentário + + + Number + Número + + + Double-quoted string + Cadeia de caracteres envolvida por aspas duplas + + + Single-quoted string + Cadeia de caracteres envolvida por aspas simples + + + Keyword + Palavra Chave + + + Triple single-quoted string + Cadeia de caracteres envolvida por três aspas simples + + + Triple double-quoted string + Cadeia de caracteres envolvida por três aspas duplas + + + Class name + Nome da classe + + + Function or method name + Nome da função ou método + + + Operator + Operador + + + Identifier + Identificador + + + Comment block + Bloco de comentários + + + Unclosed string + Cadeia de caracteres não fechada + + + Highlighted identifier + + + + Decorator + + + + + QextScintillaLexerRuby + + Default + Padrão + + + Comment + Comentário + + + Number + Número + + + Double-quoted string + Cadeia de caracteres envolvida por aspas duplas + + + Single-quoted string + Cadeia de caracteres envolvida por aspas simples + + + Keyword + Palavra Chave + + + Class name + Nome da classe + + + Function or method name + Nome da função ou método + + + Operator + Operador + + + Identifier + Identificador + + + Error + + + + POD + POD + + + Regular expression + Expressão Regular + + + Global + + + + Symbol + Símbolo + + + Module name + + + + Instance variable + + + + Class variable + + + + Backticks + Aspas Invertidas + + + Data section + Seção de dados + + + Here document delimiter + + + + Here document + + + + %q string + + + + %Q string + + + + %x string + + + + %r string + + + + %w string + + + + Demoted keyword + + + + stdin + + + + stdout + + + + stderr + + + + + QextScintillaLexerSQL + + Default + Padrão + + + Comment + Comentário + + + Number + Número + + + Keyword + Palavra Chave + + + Single-quoted string + Cadeia de caracteres envolvida por aspas simples + + + Operator + Operador + + + Identifier + Identificador + + + Comment line + Comentário de Linha + + + JavaDoc style comment + Comentário estilo JavaDoc + + + Double-quoted string + Cadeia de caracteres envolvida por aspas duplas + + + SQL*Plus keyword + Palavra chave do SQL*Plus + + + SQL*Plus prompt + Prompt do SQL*Plus + + + SQL*Plus comment + Comentário do SQL*Plus + + + # comment line + Comentário de linha usando # + + + JavaDoc keyword + Palavra chave JavaDoc + + + JavaDoc keyword error + Erro de palavra chave do JavaDoc + + + User defined 1 + Definição de usuário 1 + + + User defined 2 + Definição de usuário 2 + + + User defined 3 + Definição de usuário 3 + + + User defined 4 + Definição de usuário 4 + + + + QextScintillaLexerTeX + + Default + Padrão + + + Special + Especial + + + Group + Grupo + + + Symbol + Símbolo + + + Command + Comando + + + Text + Texto + + + diff --git a/qt/qscintilla_ru.qm b/qt/qscintilla_ru.qm new file mode 100644 index 0000000..7d85cf8 Binary files /dev/null and b/qt/qscintilla_ru.qm differ diff --git a/qt/qscintilla_ru.ts b/qt/qscintilla_ru.ts new file mode 100644 index 0000000..00ac826 --- /dev/null +++ b/qt/qscintilla_ru.ts @@ -0,0 +1,1635 @@ + + + QextScintillaCommand + + Move left one character + СдвинутьÑÑ Ð²Ð»ÐµÐ²Ð¾ на один Ñимвол + + + Move right one character + СдвинутьÑÑ Ð²Ð¿Ñ€Ð°Ð²Ð¾ на один Ñимвол + + + Move up one line + СдвинутьÑÑ Ð²Ð²ÐµÑ€Ñ… на одну Ñтрочку + + + Move down one line + СдвинутьÑÑ Ð²Ð¿Ñ€Ð°Ð²Ð¾ на одну Ñтрочку + + + Move left one word part + СдвинутьÑÑ Ð²Ð»ÐµÐ²Ð¾ на одну чаÑÑ‚ÑŒ Ñлова + + + Move right one word part + СдвинутьÑÑ Ð²Ð¿Ñ€Ð°Ð²Ð¾ на одну чаÑÑ‚ÑŒ Ñлова + + + Move left one word + СдвинутьÑÑ Ð²Ð»ÐµÐ²Ð¾ на одно Ñлово + + + Move right one word + СдвинутьÑÑ Ð²Ð¿Ñ€Ð°Ð²Ð¾ на одно Ñлово + + + Move to first visible character in line + ПеремеÑтитьÑÑ Ð½Ð° первый видимый Ñимвол на Ñтроке + + + Move to end of line + СдвинутьÑÑ Ð² конец Ñтроки + + + Scroll view down one line + Прокрутить вид на одну Ñтроку вниз + + + Scroll view up one line + Прокрутить вид на одну Ñтроку вверх + + + Move up one paragraph + СдвинутьÑÑ Ð²Ð²ÐµÑ€Ñ… на один параграф + + + Move down one paragraph + СдвинутьÑÑ Ð²Ð½Ð¸Ð· на один параграф + + + Move up one page + СдвинутьÑÑ Ð²Ð²ÐµÑ€Ñ… на одну Ñтраницу + + + Move down one page + СдвинутьÑÑ Ð²Ð¿Ñ€Ð°Ð²Ð¾ на одну Ñтраницу + + + Move to start of text + ПеремеÑтитьÑÑ Ð² начало текÑта + + + Move to end of text + ПеремеÑтитьÑÑ Ð² конец текÑта + + + Indent one level + Увеличить отÑтуп на один уровень + + + Move back one indentation level + Уменьшить отÑтуп на один уровень + + + Select all text + Выбрать веÑÑŒ текÑÑ‚ + + + Extend selection left one character + РаÑширить выделение на один Ñимвол влево + + + Extend selection right one character + РаÑширить выделение на один Ñимвол вправо + + + Extend selection up one line + РаÑширить выделение на одну Ñтроку вверх + + + Extend selection down one line + РаÑширить выделение на одну Ñтроку вниз + + + Extend selection left one word part + РаÑширить выделение влево на одну чаÑÑ‚ÑŒ Ñлова + + + Extend selection right one word part + РаÑширить выделение вправо на одну чаÑÑ‚ÑŒ Ñлова + + + Extend selection left one word + РаÑширить выделение влево на одно Ñлово + + + Extend selection right one word + РаÑширить выделение вправо на одно Ñлово + + + Extend selection to first visible character in line + РаÑширить выделение до первого видимого Ñимвола на Ñтроке + + + Extend selection to start of line + РаÑширить выделение до начала Ñтроки + + + Extend selection to end of line + РаÑширить выделение до конца Ñтроки + + + Extend selection up one paragraph + РаÑширить выделение вверх на один параграф + + + Extend selection down one paragraph + РаÑширить выделение вниз на один параграф + + + Extend selection up one page + РаÑширить выделение на одну Ñтраницу вверх + + + Extend selection down one page + РаÑширить выделение на одну Ñтраницу вниз + + + Extend selection to start of text + РаÑширить выделение до начала текÑта + + + Extend selection to end of text + РаÑширить выделение до конца текÑта + + + Delete previous character + Удалить предыдущий Ñимвол + + + Delete previous character if not at line start + Удалить предыдущий Ñимвол, еÑли он не в начале Ñтроки + + + Delete current character + Удалить текущий Ñимвол + + + Delete word to left + Удалить Ñлово Ñлева + + + Delete word to right + Удалить Ñлово Ñправа + + + Delete line to left + Удалить Ñтроку Ñлева + + + Delete line to right + Удалить Ñтроку Ñправа + + + Insert new line + Ð’Ñтавить новую Ñтроку + + + Delete current line + Удалить текущую Ñтроку + + + Swap current and previous lines + ПоменÑÑ‚ÑŒ меÑтами текущую и предыдущую Ñтроки + + + Cut current line + Вырезать текущую Ñтроку + + + Cut selection + Вырезать выделение + + + Copy current line + Копировать текущую Ñтроку + + + Copy selection + Копировать выделение + + + Paste + Ð’Ñтавить + + + Redo last command + Повторить поÑледнюю команду + + + Undo the last command + Отменить поÑледнюю команду + + + Cancel + Отменить + + + Toggle insert/overtype + ПереключитьÑÑ Ð½Ð° вÑтавку/замещение + + + Convert selection to lower case + Преобразовать выделение в нижний региÑÑ‚Ñ€ + + + Convert selection to upper case + Преобразовать выделение в верхний региÑÑ‚Ñ€ + + + Zoom in + Увеличить + + + Zoom out + Уменьшить + + + Extend rectangular selection down one line + + + + Extend rectangular selection up one line + + + + Extend rectangular selection left one character + + + + Extend rectangular selection right one character + + + + Move to start of displayed line + + + + Extend rectangular selection to first visible character in line + + + + Move to end of displayed line + + + + Extend selection to end of displayed line + + + + Extend rectangular selection to end of line + + + + Extend rectangular selection up one page + + + + Extend rectangular selection down one page + + + + Set zoom + + + + Formfeed + + + + Duplicate selection + + + + + QextScintillaLexerBash + + Default + По умолчанию + + + Comment + Комментарий + + + Number + ЧиÑло + + + Keyword + Ключевое Ñлово + + + Double-quoted string + Строка в двойных кавычках + + + Single-quoted string + Строка в одинарных кавычках + + + Operator + Оператор + + + Identifier + Идентификатор + + + Error + + + + Scalar + + + + Parameter expansion + + + + Backticks + + + + Here document delimiter + + + + Single-quoted here document + + + + + QextScintillaLexerBatch + + Default + + + + Comment + + + + Keyword + + + + Label + + + + Hide command character + + + + External command + + + + Variable + + + + Operator + + + + + QextScintillaLexerCPP + + Default + По умолчанию + + + C comment + Комментарий C + + + C++ comment + Комментарий C++ + + + JavaDoc style C comment + Комментарий C в Ñтиле JavaDoc + + + Number + ЧиÑло + + + Keyword + Ключевое Ñлово + + + Double-quoted string + Строка в двойных кавычках + + + Single-quoted string + Строка в одинарных кавычках + + + Pre-processor block + Блок препроцеÑÑора + + + Operator + Оператор + + + Identifier + Идентификатор + + + Unclosed string + ÐÐµÐ·Ð°ÐºÑ€Ñ‹Ñ‚Ð°Ñ Ñтрока + + + JavaDoc style C++ comment + Комментарий C++ в Ñтиле JavaDoc + + + Secondary keywords and identifiers + Вторичные ключевые Ñлова и идентификаторы + + + JavaDoc keyword + Ключевое Ñлово JavaDoc + + + JavaDoc keyword error + Ошибка в ключевом Ñлове JavaDoc + + + Global classes and typedefs + По умолчанию + + + + QextScintillaLexerCSS + + Default + + + + Tag + + + + Class selector + + + + Pseudo-class + + + + Unknown pseudo-class + + + + Operator + + + + CSS1 property + + + + Unknown property + + + + Value + + + + ID selector + + + + Important + + + + @-rule + + + + Double-quoted string + + + + Single-quoted string + + + + CSS2 property + + + + Attribute + + + + + QextScintillaLexerCSharp + + Verbatim string + Строка без замен + + + + QextScintillaLexerDiff + + Default + + + + Comment + + + + Command + + + + Header + + + + Position + + + + Removed line + + + + Added line + + + + + QextScintillaLexerHTML + + HTML default + HTML по умолчанию + + + Tag + Тег + + + Unknown tag + ÐеизвеÑтный тег + + + Attribute + Ðтрибут + + + Unknown attribute + ÐеизвеÑтный атрибут + + + HTML number + ЧиÑло в HTML + + + HTML double-quoted string + Строка в двойных кавычках HTML + + + HTML single-quoted string + Строка в одинарных кавычках HTML + + + Other text in a tag + Другой текÑÑ‚ в теге + + + HTML comment + Комментарий HTML + + + Entity + СущноÑÑ‚ÑŒ + + + End of a tag + Окончание тега + + + Start of an XML fragment + Ðачало фрагмента XML + + + End of an XML fragment + Окончание фрагмента XML + + + Script tag + Тег ÑÑ†ÐµÐ½Ð°Ñ€Ð¸Ñ + + + Start of an ASP fragment with @ + Ðачало @-фрагмента ASP + + + Start of an ASP fragment + Ðачало фрагмента ASP + + + CDATA + CDATA + + + Start of a PHP fragment + Ðачало фрагмента PHP + + + Unquoted HTML value + Значение атрибута HTML не в кавычках + + + ASP X-Code comment + Комментарий ASP X-Code + + + SGML default + SGML по умолчанию + + + SGML command + Команда SGML + + + First parameter of an SGML command + Первый параметр команды SGML + + + SGML double-quoted string + Строка в двойных кавычках SGML + + + SGML single-quoted string + Строка в одинарных кавычках SGML + + + SGML error + Ошибка SGML + + + SGML special entity + Ð¡Ð¿ÐµÑ†Ð¸Ð°Ð»ÑŒÐ½Ð°Ñ ÑущноÑÑ‚ÑŒ SGML + + + SGML comment + Комментарий SGML + + + First parameter comment of an SGML command + Комментарий к первому параметру команды SGML + + + SGML block default + SGML-блок по умолчанию + + + Start of a JavaScript fragment + Ðачало фрагмента JavaScript + + + JavaScript default + JavaScript по умолчанию + + + JavaScript comment + Комментарий JavaScript + + + JavaScript line comment + ОдноÑтрочный комментарий JavaScript + + + JavaDoc style JavaScript comment + Комментарий JavaScript в Ñтиле JavaDoc + + + JavaScript number + ЧиÑло JavaScript + + + JavaScript word + Слово JavaScript + + + JavaScript keyword + Ключевое Ñлово JavaScript + + + JavaScript double-quoted string + Строка JavaScript в двойных кавычках + + + JavaScript single-quoted string + Строка JavaScript в одинарных кавычках + + + JavaScript symbol + Символ JavaScript + + + JavaScript unclosed string + ÐÐµÐ·Ð°ÐºÑ€Ñ‹Ñ‚Ð°Ñ Ñтрока JavaScript + + + JavaScript regular expression + РегулÑрное выражение JavaScript + + + Start of an ASP JavaScript fragment + Ðачало JavaScript-фрагмента в ASP + + + ASP JavaScript default + ASP JavaScript по умолчанию + + + ASP JavaScript comment + Комментарий ASP JavaScript + + + ASP JavaScript line comment + ОдноÑтрочный комментарий ASP JavaScript + + + JavaDoc style ASP JavaScript comment + Комментарий ASP JavaScript в Ñтиле JavaDoc + + + ASP JavaScript number + ЧиÑло ASP JavaScript + + + ASP JavaScript word + Слово ASP JavaScript + + + ASP JavaScript keyword + Ключевое Ñлово ASP JavaScript + + + ASP JavaScript double-quoted string + Строка ASP JavaScript в двойных кавычках + + + ASP JavaScript single-quoted string + Строка ASP JavaScript в одинарных кавычках + + + ASP JavaScript symbol + Символ ASP JavaScript + + + ASP JavaScript unclosed string + ÐÐµÐ·Ð°ÐºÑ€Ñ‹Ñ‚Ð°Ñ Ñтрока ASP JavaScript + + + ASP JavaScript regular expression + РегулÑрное выражение ASP JavaScript + + + Start of a VBScript fragment + Ðачало фрагмента VBScript + + + VBScript default + VBScript по умолчанию + + + VBScript comment + Комментарий VBScript + + + VBScript number + ЧиÑло VBScript + + + VBScript keyword + Ключевое Ñлово VBScript + + + VBScript string + Строка VBScript + + + VBScript identifier + Идентификатор VBScript + + + VBScript unclosed string + ÐÐµÐ·Ð°ÐºÑ€Ñ‹Ñ‚Ð°Ñ Ñтрока VBScript + + + Start of an ASP VBScript fragment + Ðачало VBScript-фрагмента в ASP + + + ASP VBScript default + ASP VBScript по умолчанию + + + ASP VBScript comment + Комментарий ASP VBScript + + + ASP VBScript number + ЧиÑло ASP VBScript + + + ASP VBScript keyword + Ключевое Ñлово ASP VBScript + + + ASP VBScript string + Строка ASP VBScript + + + ASP VBScript identifier + Идентификатор ASP VBScript + + + ASP VBScript unclosed string + ÐÐµÐ·Ð°ÐºÑ€Ñ‹Ñ‚Ð°Ñ Ñтрока ASP VBScript + + + Start of a Python fragment + Ðачало фрагмента Python + + + Python default + Python по умолчанию + + + Python comment + Комментарий Python + + + Python number + ЧиÑло в Python + + + Python double-quoted string + Строка в двойных кавычках Python + + + Python single-quoted string + Строка в одинарных кавычках Python + + + Python keyword + Ключевое Ñлово в Python + + + Python triple double-quoted string + МногоÑÑ‚Ñ€Ð¾Ñ‡Ð½Ð°Ñ Ñтрока в двойных кавычках в Python + + + Python triple single-quoted string + МногоÑÑ‚Ñ€Ð¾Ñ‡Ð½Ð°Ñ Ñтрока в одинарных кавычках в Python + + + Python class name + Ð˜Ð¼Ñ ÐºÐ»Ð°ÑÑа в Python + + + Python function or method name + Ð˜Ð¼Ñ Ñ„ÑƒÐ½ÐºÑ†Ð¸Ð¸/метода в Python + + + Python operator + Оператор Python + + + Python identifier + Идентификатор Python + + + Start of an ASP Python fragment + Ðачало Python-фрагмента в ASP + + + ASP Python default + ASP Python по умолчанию + + + ASP Python comment + Комментарий ASP Python + + + ASP Python number + ЧиÑло в ASP Python + + + ASP Python double-quoted string + Строка в двойных кавычках ASP Python + + + ASP Python single-quoted string + Строка в одинарных кавычках ASP Python + + + ASP Python keyword + Ключевое Ñлово в ASP Python + + + ASP Python triple double-quoted string + МногоÑÑ‚Ñ€Ð¾Ñ‡Ð½Ð°Ñ Ñтрока в двойных кавычках в ASP Python + + + ASP Python triple single-quoted string + МногоÑÑ‚Ñ€Ð¾Ñ‡Ð½Ð°Ñ Ñтрока в одинарных кавычках в ASP Python + + + ASP Python class name + Ð˜Ð¼Ñ ÐºÐ»Ð°ÑÑа в ASP Python + + + ASP Python function or method name + Ð˜Ð¼Ñ Ñ„ÑƒÐ½ÐºÑ†Ð¸Ð¸/метода в ASP Python + + + ASP Python operator + Оператор ASP Python + + + ASP Python identifier + Идентификатор ASP Python + + + PHP default + PHP по умолчанию + + + PHP double-quoted string + Строка в двойных кавычках PHP + + + PHP single-quoted string + Строка в одинарных кавычках PHP + + + PHP keyword + Ключевое Ñлово PHP + + + PHP number + ЧиÑло PHP + + + PHP variable + ÐŸÐµÑ€ÐµÐ¼ÐµÐ½Ð½Ð°Ñ PHP + + + PHP comment + Комментарий PHP + + + PHP line comment + ОдноÑтрочный комментарий PHP + + + PHP double-quoted variable + ÐŸÐµÑ€ÐµÐ¼ÐµÐ½Ð½Ð°Ñ Ð² двойных кавычках PHP + + + PHP operator + Оператор PHP + + + + QextScintillaLexerIDL + + UUID + UUID + + + + QextScintillaLexerJavaScript + + Regular expression + РегулÑрное выражение + + + + QextScintillaLexerLua + + Default + + + + Comment + + + + Line comment + ОдноÑтрочный комментарий + + + Number + + + + Keyword + + + + String + + + + Character + + + + Literal string + + + + Preprocessor + + + + Operator + + + + Identifier + + + + Unclosed string + ÐÐµÐ·Ð°ÐºÑ€Ñ‹Ñ‚Ð°Ñ Ñтрока + + + Basic functions + + + + String, table and maths functions + + + + Coroutines, i/o and system facilities + + + + + QextScintillaLexerMakefile + + Default + + + + Comment + + + + Preprocessor + + + + Variable + + + + Operator + + + + Target + + + + Error + + + + + QextScintillaLexerPOV + + Default + + + + Comment + + + + Comment line + + + + Number + + + + Operator + + + + Identifier + + + + String + + + + Unclosed string + ÐÐµÐ·Ð°ÐºÑ€Ñ‹Ñ‚Ð°Ñ Ñтрока + + + Directive + + + + Bad directive + + + + Objects, CSG and appearance + + + + Types, modifiers and items + + + + Predefined identifiers + + + + Predefined functions + + + + User defined 1 + + + + User defined 2 + + + + User defined 3 + + + + + QextScintillaLexerPerl + + Default + По умолчанию + + + Comment + Комментарий + + + Number + ЧиÑло + + + Keyword + Ключевое Ñлово + + + Double-quoted string + Строка в двойных кавычках + + + Single-quoted string + Строка в одинарных кавычках + + + Operator + Оператор + + + Identifier + Идентификатор + + + Regular expression + РегулÑрное выражение + + + Error + + + + POD + + + + Scalar + + + + Array + + + + Hash + + + + Symbol table + + + + Substitution + + + + Backticks + + + + Data section + + + + Here document delimiter + + + + Single-quoted here document + + + + Double-quoted here document + + + + Backtick here document + + + + Quoted string (q) + + + + Quoted string (qq) + + + + Quoted string (qx) + + + + Quoted string (qr) + + + + Quoted string (qw) + + + + POD verbatim + + + + + QextScintillaLexerProperties + + Default + + + + Comment + + + + Section + + + + Assignment + + + + Default value + + + + + QextScintillaLexerPython + + Default + По умолчанию + + + Comment + Комментарий + + + Number + ЧиÑло + + + Double-quoted string + Строка в двойных кавычках + + + Single-quoted string + Строка в одинарных кавычках + + + Keyword + Ключевое Ñлово + + + Triple single-quoted string + МногоÑÑ‚Ñ€Ð¾Ñ‡Ð½Ð°Ñ Ñтрока в одинарных кавычках (<code>'''...'''</code>) + + + Triple double-quoted string + МногоÑÑ‚Ñ€Ð¾Ñ‡Ð½Ð°Ñ Ñтрока в двойных кавычках (<code>"""..."""</code>) + + + Class name + Ð˜Ð¼Ñ ÐºÐ»Ð°ÑÑа + + + Function or method name + Ð˜Ð¼Ñ Ñ„ÑƒÐ½ÐºÑ†Ð¸Ð¸/метода + + + Operator + Оператор + + + Identifier + Идентификатор + + + Comment block + Блочный комментарий + + + Unclosed string + ÐÐµÐ·Ð°ÐºÑ€Ñ‹Ñ‚Ð°Ñ Ñтрока + + + Highlighted identifier + + + + Decorator + + + + + QextScintillaLexerRuby + + Default + По умолчанию + + + Comment + Комментарий + + + Number + ЧиÑло + + + Double-quoted string + Строка в двойных кавычках + + + Single-quoted string + Строка в одинарных кавычках + + + Keyword + Ключевое Ñлово + + + Class name + Ð˜Ð¼Ñ ÐºÐ»Ð°ÑÑа + + + Function or method name + Ð˜Ð¼Ñ Ñ„ÑƒÐ½ÐºÑ†Ð¸Ð¸/метода + + + Operator + Оператор + + + Identifier + Идентификатор + + + Error + + + + POD + + + + Regular expression + + + + Global + + + + Symbol + + + + Module name + + + + Instance variable + + + + Class variable + + + + Backticks + + + + Data section + + + + Here document delimiter + + + + Here document + + + + %q string + + + + %Q string + + + + %x string + + + + %r string + + + + %w string + + + + Demoted keyword + + + + stdin + + + + stdout + + + + stderr + + + + + QextScintillaLexerSQL + + Default + По умолчанию + + + Comment + Комментарий + + + Number + ЧиÑло + + + Keyword + Ключевое Ñлово + + + Single-quoted string + Строка в одинарных кавычках + + + Operator + Оператор + + + Identifier + Идентификатор + + + Comment line + + + + JavaDoc style comment + + + + Double-quoted string + + + + SQL*Plus keyword + + + + SQL*Plus prompt + + + + SQL*Plus comment + + + + # comment line + + + + JavaDoc keyword + + + + JavaDoc keyword error + + + + User defined 1 + + + + User defined 2 + + + + User defined 3 + + + + User defined 4 + + + + + QextScintillaLexerTeX + + Default + + + + Special + + + + Group + + + + Symbol + + + + Command + + + + Text + + + + diff --git a/src/AutoComplete.cpp b/src/AutoComplete.cpp new file mode 100755 index 0000000..753adca --- /dev/null +++ b/src/AutoComplete.cpp @@ -0,0 +1,174 @@ +// Scintilla source code edit control +/** @file AutoComplete.cxx + ** Defines the auto completion list box. + **/ +// Copyright 1998-2003 by Neil Hodgson +// The License.txt file describes the conditions under which this software may be distributed. + +#include +#include +#include + +#include "Platform.h" + +#include "PropSet.h" +#include "AutoComplete.h" + +AutoComplete::AutoComplete() : + active(false), + separator(' '), + typesep('?'), + ignoreCase(false), + chooseSingle(false), + lb(0), + posStart(0), + startLen(0), + cancelAtStartPos(true), + autoHide(true), + dropRestOfWord(false) { + lb = ListBox::Allocate(); + stopChars[0] = '\0'; + fillUpChars[0] = '\0'; +} + +AutoComplete::~AutoComplete() { + if (lb) { + lb->Destroy(); + delete lb; + lb = 0; + } +} + +bool AutoComplete::Active() { + return active; +} + +void AutoComplete::Start(Window &parent, int ctrlID, + int position, Point location, int startLen_, + int lineHeight, bool unicodeMode) { + if (active) { + Cancel(); + } + lb->Create(parent, ctrlID, location, lineHeight, unicodeMode); + lb->Clear(); + active = true; + startLen = startLen_; + posStart = position; +} + +void AutoComplete::SetStopChars(const char *stopChars_) { + strncpy(stopChars, stopChars_, sizeof(stopChars)); + stopChars[sizeof(stopChars) - 1] = '\0'; +} + +bool AutoComplete::IsStopChar(char ch) { + return ch && strchr(stopChars, ch); +} + +void AutoComplete::SetFillUpChars(const char *fillUpChars_) { + strncpy(fillUpChars, fillUpChars_, sizeof(fillUpChars)); + fillUpChars[sizeof(fillUpChars) - 1] = '\0'; +} + +bool AutoComplete::IsFillUpChar(char ch) { + return ch && strchr(fillUpChars, ch); +} + +void AutoComplete::SetSeparator(char separator_) { + separator = separator_; +} + +char AutoComplete::GetSeparator() { + return separator; +} + +void AutoComplete::SetTypesep(char separator_) { + typesep = separator_; +} + +char AutoComplete::GetTypesep() { + return typesep; +} + +void AutoComplete::SetList(const char *list) { + lb->SetList(list, separator, typesep); +} + +void AutoComplete::Show(bool show) { + lb->Show(show); + if (show) + lb->Select(0); +} + +void AutoComplete::Cancel() { + if (lb->Created()) { + lb->Clear(); + lb->Destroy(); + active = false; + } +} + + +void AutoComplete::Move(int delta) { + int count = lb->Length(); + int current = lb->GetSelection(); + current += delta; + if (current >= count) + current = count - 1; + if (current < 0) + current = 0; + lb->Select(current); +} + +void AutoComplete::Select(const char *word) { + size_t lenWord = strlen(word); + int location = -1; + const int maxItemLen=1000; + char item[maxItemLen]; + int start = 0; // lower bound of the api array block to search + int end = lb->Length() - 1; // upper bound of the api array block to search + while ((start <= end) && (location == -1)) { // Binary searching loop + int pivot = (start + end) / 2; + lb->GetValue(pivot, item, maxItemLen); + int cond; + if (ignoreCase) + cond = CompareNCaseInsensitive(word, item, lenWord); + else + cond = strncmp(word, item, lenWord); + if (!cond) { + // Find first match + while (pivot > start) { + lb->GetValue(pivot-1, item, maxItemLen); + if (ignoreCase) + cond = CompareNCaseInsensitive(word, item, lenWord); + else + cond = strncmp(word, item, lenWord); + if (0 != cond) + break; + --pivot; + } + location = pivot; + if (ignoreCase) { + // Check for exact-case match + for (; pivot <= end; pivot++) { + lb->GetValue(pivot, item, maxItemLen); + if (!strncmp(word, item, lenWord)) { + location = pivot; + break; + } + if (CompareNCaseInsensitive(word, item, lenWord)) + break; + } + } + } else if (cond < 0) { + end = pivot - 1; + } else if (cond > 0) { + start = pivot + 1; + } + } + if (location == -1 && autoHide) + Cancel(); + else + lb->Select(location); +} + diff --git a/src/AutoComplete.h b/src/AutoComplete.h new file mode 100755 index 0000000..10577ca --- /dev/null +++ b/src/AutoComplete.h @@ -0,0 +1,70 @@ +// Scintilla source code edit control +/** @file AutoComplete.h + ** Defines the auto completion list box. + **/ +// Copyright 1998-2003 by Neil Hodgson +// The License.txt file describes the conditions under which this software may be distributed. + +#ifndef AUTOCOMPLETE_H +#define AUTOCOMPLETE_H + +/** + */ +class AutoComplete { + bool active; + char stopChars[256]; + char fillUpChars[256]; + char separator; + char typesep; // Type seperator + +public: + bool ignoreCase; + bool chooseSingle; + ListBox *lb; + int posStart; + int startLen; + /// Should autocompletion be canceled if editor's currentPos <= startPos? + bool cancelAtStartPos; + bool autoHide; + bool dropRestOfWord; + + AutoComplete(); + ~AutoComplete(); + + /// Is the auto completion list displayed? + bool Active(); + + /// Display the auto completion list positioned to be near a character position + void Start(Window &parent, int ctrlID, int position, Point location, + int startLen_, int lineHeight, bool unicodeMode); + + /// The stop chars are characters which, when typed, cause the auto completion list to disappear + void SetStopChars(const char *stopChars_); + bool IsStopChar(char ch); + + /// The fillup chars are characters which, when typed, fill up the selected word + void SetFillUpChars(const char *fillUpChars_); + bool IsFillUpChar(char ch); + + /// The separator character is used when interpreting the list in SetList + void SetSeparator(char separator_); + char GetSeparator(); + + /// The typesep character is used for seperating the word from the type + void SetTypesep(char separator_); + char GetTypesep(); + + /// The list string contains a sequence of words separated by the separator character + void SetList(const char *list); + + void Show(bool show); + void Cancel(); + + /// Move the current list element by delta, scrolling appropriately + void Move(int delta); + + /// Select a list element that starts with word as the current element + void Select(const char *word); +}; + +#endif diff --git a/src/CallTip.cpp b/src/CallTip.cpp new file mode 100755 index 0000000..f4bc5f8 --- /dev/null +++ b/src/CallTip.cpp @@ -0,0 +1,314 @@ +// Scintilla source code edit control +/** @file CallTip.cxx + ** Code for displaying call tips. + **/ +// Copyright 1998-2001 by Neil Hodgson +// The License.txt file describes the conditions under which this software may be distributed. + +#include +#include + +#include "Platform.h" + +#include "Scintilla.h" +#include "CallTip.h" + +static const int insetX = 5; // text inset in x from calltip border +static const int widthArrow = 14; + +CallTip::CallTip() { + wCallTip = 0; + inCallTipMode = false; + posStartCallTip = 0; + val = 0; + rectUp = PRectangle(0,0,0,0); + rectDown = PRectangle(0,0,0,0); + lineHeight = 1; + startHighlight = 0; + endHighlight = 0; + tabSize = 0; + useStyleCallTip = false; // for backwards compatibility + + colourBG.desired = ColourDesired(0xff, 0xff, 0xff); + colourUnSel.desired = ColourDesired(0x80, 0x80, 0x80); + colourSel.desired = ColourDesired(0, 0, 0x80); + colourShade.desired = ColourDesired(0, 0, 0); + colourLight.desired = ColourDesired(0xc0, 0xc0, 0xc0); +} + +CallTip::~CallTip() { + font.Release(); + wCallTip.Destroy(); + delete []val; + val = 0; +} + +void CallTip::RefreshColourPalette(Palette &pal, bool want) { + pal.WantFind(colourBG, want); + pal.WantFind(colourUnSel, want); + pal.WantFind(colourSel, want); + pal.WantFind(colourShade, want); + pal.WantFind(colourLight, want); +} + +// Although this test includes 0, we should never see a \0 character. +static bool IsArrowCharacter(char ch) { + return (ch == 0) || (ch == '\001') || (ch == '\002'); +} + +// We ignore tabs unless a tab width has been set. +bool CallTip::IsTabCharacter(char ch) { + return (tabSize > 0) && (ch == '\t'); +} + +int CallTip::NextTabPos(int x) { + if (tabSize > 0) { // paranoia... not called unless this is true + x -= insetX; // position relative to text + x = (x + tabSize) / tabSize; // tab "number" + return tabSize*x + insetX; // position of next tab + } else { + return x + 1; // arbitrary + } +} + +// Draw a section of the call tip that does not include \n in one colour. +// The text may include up to numEnds tabs or arrow characters. +void CallTip::DrawChunk(Surface *surface, int &x, const char *s, + int posStart, int posEnd, int ytext, PRectangle rcClient, + bool highlight, bool draw) { + s += posStart; + int len = posEnd - posStart; + + // Divide the text into sections that are all text, or that are + // single arrows or single tab characters (if tabSize > 0). + int maxEnd = 0; + const int numEnds = 10; + int ends[numEnds + 2]; + for (int i=0;i 0) + ends[maxEnd++] = i; + ends[maxEnd++] = i+1; + } + } + ends[maxEnd++] = len; + int startSeg = 0; + int xEnd; + for (int seg = 0; seg startSeg) { + if (IsArrowCharacter(s[startSeg])) { + bool upArrow = s[startSeg] == '\001'; + rcClient.left = x; + rcClient.right = rcClient.left + widthArrow; + if (draw) { + const int halfWidth = widthArrow / 2 - 3; + const int centreX = rcClient.left + widthArrow / 2 - 1; + const int centreY = (rcClient.top + rcClient.bottom) / 2; + surface->FillRectangle(rcClient, colourBG.allocated); + PRectangle rcClientInner(rcClient.left + 1, rcClient.top + 1, + rcClient.right - 2, rcClient.bottom - 1); + surface->FillRectangle(rcClientInner, colourUnSel.allocated); + + if (upArrow) { // Up arrow + Point pts[] = { + Point(centreX - halfWidth, centreY + halfWidth / 2), + Point(centreX + halfWidth, centreY + halfWidth / 2), + Point(centreX, centreY - halfWidth + halfWidth / 2), + }; + surface->Polygon(pts, sizeof(pts) / sizeof(pts[0]), + colourBG.allocated, colourBG.allocated); + } else { // Down arrow + Point pts[] = { + Point(centreX - halfWidth, centreY - halfWidth / 2), + Point(centreX + halfWidth, centreY - halfWidth / 2), + Point(centreX, centreY + halfWidth - halfWidth / 2), + }; + surface->Polygon(pts, sizeof(pts) / sizeof(pts[0]), + colourBG.allocated, colourBG.allocated); + } + } + xEnd = rcClient.right; + offsetMain = xEnd; + if (upArrow) { + rectUp = rcClient; + } else { + rectDown = rcClient; + } + } else if (IsTabCharacter(s[startSeg])) { + xEnd = NextTabPos(x); + } else { + xEnd = x + surface->WidthText(font, s + startSeg, endSeg - startSeg); + if (draw) { + rcClient.left = x; + rcClient.right = xEnd; + surface->DrawTextTransparent(rcClient, font, ytext, + s+startSeg, endSeg - startSeg, + highlight ? colourSel.allocated : colourUnSel.allocated); + } + } + x = xEnd; + startSeg = endSeg; + } + } +} + +int CallTip::PaintContents(Surface *surfaceWindow, bool draw) { + PRectangle rcClientPos = wCallTip.GetClientPosition(); + PRectangle rcClientSize(0, 0, rcClientPos.right - rcClientPos.left, + rcClientPos.bottom - rcClientPos.top); + PRectangle rcClient(1, 1, rcClientSize.right - 1, rcClientSize.bottom - 1); + + // To make a nice small call tip window, it is only sized to fit most normal characters without accents + int ascent = surfaceWindow->Ascent(font) - surfaceWindow->InternalLeading(font); + + // For each line... + // Draw the definition in three parts: before highlight, highlighted, after highlight + int ytext = rcClient.top + ascent + 1; + rcClient.bottom = ytext + surfaceWindow->Descent(font) + 1; + char *chunkVal = val; + bool moreChunks = true; + int maxWidth = 0; + while (moreChunks) { + char *chunkEnd = strchr(chunkVal, '\n'); + if (chunkEnd == NULL) { + chunkEnd = chunkVal + strlen(chunkVal); + moreChunks = false; + } + int chunkOffset = chunkVal - val; + int chunkLength = chunkEnd - chunkVal; + int chunkEndOffset = chunkOffset + chunkLength; + int thisStartHighlight = Platform::Maximum(startHighlight, chunkOffset); + thisStartHighlight = Platform::Minimum(thisStartHighlight, chunkEndOffset); + thisStartHighlight -= chunkOffset; + int thisEndHighlight = Platform::Maximum(endHighlight, chunkOffset); + thisEndHighlight = Platform::Minimum(thisEndHighlight, chunkEndOffset); + thisEndHighlight -= chunkOffset; + rcClient.top = ytext - ascent - 1; + + int x = insetX; // start each line at this inset + + DrawChunk(surfaceWindow, x, chunkVal, 0, thisStartHighlight, + ytext, rcClient, false, draw); + DrawChunk(surfaceWindow, x, chunkVal, thisStartHighlight, thisEndHighlight, + ytext, rcClient, true, draw); + DrawChunk(surfaceWindow, x, chunkVal, thisEndHighlight, chunkLength, + ytext, rcClient, false, draw); + + chunkVal = chunkEnd + 1; + ytext += lineHeight; + rcClient.bottom += lineHeight; + maxWidth = Platform::Maximum(maxWidth, x); + } + return maxWidth; +} + +void CallTip::PaintCT(Surface *surfaceWindow) { + if (!val) + return; + PRectangle rcClientPos = wCallTip.GetClientPosition(); + PRectangle rcClientSize(0, 0, rcClientPos.right - rcClientPos.left, + rcClientPos.bottom - rcClientPos.top); + PRectangle rcClient(1, 1, rcClientSize.right - 1, rcClientSize.bottom - 1); + + surfaceWindow->FillRectangle(rcClient, colourBG.allocated); + + offsetMain = insetX; // initial alignment assuming no arrows + PaintContents(surfaceWindow, true); + + // Draw a raised border around the edges of the window + surfaceWindow->MoveTo(0, rcClientSize.bottom - 1); + surfaceWindow->PenColour(colourShade.allocated); + surfaceWindow->LineTo(rcClientSize.right - 1, rcClientSize.bottom - 1); + surfaceWindow->LineTo(rcClientSize.right - 1, 0); + surfaceWindow->PenColour(colourLight.allocated); + surfaceWindow->LineTo(0, 0); + surfaceWindow->LineTo(0, rcClientSize.bottom - 1); +} + +void CallTip::MouseClick(Point pt) { + clickPlace = 0; + if (rectUp.Contains(pt)) + clickPlace = 1; + if (rectDown.Contains(pt)) + clickPlace = 2; +} + +PRectangle CallTip::CallTipStart(int pos, Point pt, const char *defn, + const char *faceName, int size, + int codePage_, int characterSet, Window &wParent) { + clickPlace = 0; + if (val) + delete []val; + val = new char[strlen(defn) + 1]; + if (!val) + return PRectangle(); + strcpy(val, defn); + codePage = codePage_; + Surface *surfaceMeasure = Surface::Allocate(); + if (!surfaceMeasure) + return PRectangle(); + surfaceMeasure->Init(wParent.GetID()); + surfaceMeasure->SetUnicodeMode(SC_CP_UTF8 == codePage); + surfaceMeasure->SetDBCSMode(codePage); + startHighlight = 0; + endHighlight = 0; + inCallTipMode = true; + posStartCallTip = pos; + int deviceHeight = surfaceMeasure->DeviceHeightFont(size); + font.Create(faceName, characterSet, deviceHeight, false, false); + // Look for multiple lines in the text + // Only support \n here - simply means container must avoid \r! + int numLines = 1; + const char *newline; + const char *look = val; + rectUp = PRectangle(0,0,0,0); + rectDown = PRectangle(0,0,0,0); + offsetMain = insetX; // changed to right edge of any arrows + int width = PaintContents(surfaceMeasure, false) + insetX; + while ((newline = strchr(look, '\n')) != NULL) { + look = newline + 1; + numLines++; + } + lineHeight = surfaceMeasure->Height(font); + + // Extra line for border and an empty line at top and bottom. The returned + // rectangle is aligned to the right edge of the last arrow encountered in + // the tip text, else to the tip text left edge. + int height = lineHeight * numLines - surfaceMeasure->InternalLeading(font) + 2 + 2; + delete surfaceMeasure; + return PRectangle(pt.x - offsetMain, pt.y + 1, pt.x + width - offsetMain, pt.y + 1 + height); +} + +void CallTip::CallTipCancel() { + inCallTipMode = false; + if (wCallTip.Created()) { + wCallTip.Destroy(); + } +} + +void CallTip::SetHighlight(int start, int end) { + // Avoid flashing by checking something has really changed + if ((start != startHighlight) || (end != endHighlight)) { + startHighlight = start; + endHighlight = end; + if (wCallTip.Created()) { + wCallTip.InvalidateAll(); + } + } +} + +// Set the tab size (sizes > 0 enable the use of tabs). This also enables the +// use of the STYLE_CALLTIP. +void CallTip::SetTabSize(int tabSz) { + tabSize = tabSz; + useStyleCallTip = true; +} + +// It might be better to have two access functions for this and to use +// them for all settings of colours. +void CallTip::SetForeBack(const ColourPair &fore, const ColourPair &back) { + colourBG = back; + colourUnSel = fore; +} diff --git a/src/CallTip.h b/src/CallTip.h new file mode 100755 index 0000000..9848a10 --- /dev/null +++ b/src/CallTip.h @@ -0,0 +1,79 @@ +// Scintilla source code edit control +/** @file CallTip.h + ** Interface to the call tip control. + **/ +// Copyright 1998-2001 by Neil Hodgson +// The License.txt file describes the conditions under which this software may be distributed. + +#ifndef CALLTIP_H +#define CALLTIP_H + +/** + */ +class CallTip { + int startHighlight; // character offset to start and... + int endHighlight; // ...end of highlighted text + char *val; + Font font; + PRectangle rectUp; // rectangle of last up angle in the tip + PRectangle rectDown; // rectangle of last down arrow in the tip + int lineHeight; // vertical line spacing + int offsetMain; // The alignment point of the call tip + int tabSize; // Tab size in pixels, <=0 no TAB expand + bool useStyleCallTip; // if true, STYLE_CALLTIP should be used + + // Private so CallTip objects can not be copied + CallTip(const CallTip &) {} + CallTip &operator=(const CallTip &) { return *this; } + void DrawChunk(Surface *surface, int &x, const char *s, + int posStart, int posEnd, int ytext, PRectangle rcClient, + bool highlight, bool draw); + int PaintContents(Surface *surfaceWindow, bool draw); + bool IsTabCharacter(char c); + int NextTabPos(int x); + +public: + Window wCallTip; + Window wDraw; + bool inCallTipMode; + int posStartCallTip; + ColourPair colourBG; + ColourPair colourUnSel; + ColourPair colourSel; + ColourPair colourShade; + ColourPair colourLight; + int codePage; + int clickPlace; + + CallTip(); + ~CallTip(); + + /// Claim or accept palette entries for the colours required to paint a calltip. + void RefreshColourPalette(Palette &pal, bool want); + + void PaintCT(Surface *surfaceWindow); + + void MouseClick(Point pt); + + /// Setup the calltip and return a rectangle of the area required. + PRectangle CallTipStart(int pos, Point pt, const char *defn, + const char *faceName, int size, int codePage_, + int characterSet, Window &wParent); + + void CallTipCancel(); + + /// Set a range of characters to be displayed in a highlight style. + /// Commonly used to highlight the current parameter. + void SetHighlight(int start, int end); + + /// Set the tab size in pixels for the call tip. 0 or -ve means no tab expand. + void SetTabSize(int tabSz); + + /// Used to determine which STYLE_xxxx to use for call tip information + bool UseStyleCallTip() const { return useStyleCallTip;} + + // Modify foreground and background colours + void SetForeBack(const ColourPair &fore, const ColourPair &back); +}; + +#endif diff --git a/src/CellBuffer.cpp b/src/CellBuffer.cpp new file mode 100755 index 0000000..1109a17 --- /dev/null +++ b/src/CellBuffer.cpp @@ -0,0 +1,1120 @@ +// Scintilla source code edit control +/** @file CellBuffer.cxx + ** Manages a buffer of cells. + **/ +// Copyright 1998-2001 by Neil Hodgson +// The License.txt file describes the conditions under which this software may be distributed. + +#include +#include +#include +#include + +#include "Platform.h" + +#include "Scintilla.h" +#include "SVector.h" +#include "CellBuffer.h" + +MarkerHandleSet::MarkerHandleSet() { + root = 0; +} + +MarkerHandleSet::~MarkerHandleSet() { + MarkerHandleNumber *mhn = root; + while (mhn) { + MarkerHandleNumber *mhnToFree = mhn; + mhn = mhn->next; + delete mhnToFree; + } + root = 0; +} + +int MarkerHandleSet::Length() { + int c = 0; + MarkerHandleNumber *mhn = root; + while (mhn) { + c++; + mhn = mhn->next; + } + return c; +} + +int MarkerHandleSet::NumberFromHandle(int handle) { + MarkerHandleNumber *mhn = root; + while (mhn) { + if (mhn->handle == handle) { + return mhn->number; + } + mhn = mhn->next; + } + return - 1; +} + +int MarkerHandleSet::MarkValue() { + unsigned int m = 0; + MarkerHandleNumber *mhn = root; + while (mhn) { + m |= (1 << mhn->number); + mhn = mhn->next; + } + return m; +} + +bool MarkerHandleSet::Contains(int handle) { + MarkerHandleNumber *mhn = root; + while (mhn) { + if (mhn->handle == handle) { + return true; + } + mhn = mhn->next; + } + return false; +} + +bool MarkerHandleSet::InsertHandle(int handle, int markerNum) { + MarkerHandleNumber *mhn = new MarkerHandleNumber; + if (!mhn) + return false; + mhn->handle = handle; + mhn->number = markerNum; + mhn->next = root; + root = mhn; + return true; +} + +void MarkerHandleSet::RemoveHandle(int handle) { + MarkerHandleNumber **pmhn = &root; + while (*pmhn) { + MarkerHandleNumber *mhn = *pmhn; + if (mhn->handle == handle) { + *pmhn = mhn->next; + delete mhn; + return ; + } + pmhn = &((*pmhn)->next); + } +} + +bool MarkerHandleSet::RemoveNumber(int markerNum) { + bool performedDeletion = false; + MarkerHandleNumber **pmhn = &root; + while (*pmhn) { + MarkerHandleNumber *mhn = *pmhn; + if (mhn->number == markerNum) { + *pmhn = mhn->next; + delete mhn; + performedDeletion = true; + } else { + pmhn = &((*pmhn)->next); + } + } + return performedDeletion; +} + +void MarkerHandleSet::CombineWith(MarkerHandleSet *other) { + MarkerHandleNumber **pmhn = &root; + while (*pmhn) { + pmhn = &((*pmhn)->next); + } + *pmhn = other->root; + other->root = 0; +} + +LineVector::LineVector() { + linesData = 0; + lines = 0; + size = 0; + levels = 0; + sizeLevels = 0; + handleCurrent = 1; + growSize = 1000; + + Init(); +} + +LineVector::~LineVector() { + for (int line = 0; line < lines; line++) { + delete linesData[line].handleSet; + linesData[line].handleSet = 0; + } + delete []linesData; + linesData = 0; + delete []levels; + levels = 0; +} + +void LineVector::Init() { + for (int line = 0; line < lines; line++) { + delete linesData[line].handleSet; + linesData[line].handleSet = 0; + } + delete []linesData; + linesData = new LineData[static_cast(growSize)]; + size = growSize; + lines = 1; + delete []levels; + levels = 0; + sizeLevels = 0; +} + +void LineVector::Expand(int sizeNew) { + LineData *linesDataNew = new LineData[sizeNew]; + if (linesDataNew) { + for (int i = 0; i < size; i++) + linesDataNew[i] = linesData[i]; + // Do not delete handleSets here as they are transferred to new linesData + delete []linesData; + linesData = linesDataNew; + size = sizeNew; + } else { + Platform::DebugPrintf("No memory available\n"); + // TODO: Blow up + } + +} + +void LineVector::ExpandLevels(int sizeNew) { + if (sizeNew == -1) + sizeNew = size; + int *levelsNew = new int[sizeNew]; + if (levelsNew) { + int i = 0; + for (; i < sizeLevels; i++) + levelsNew[i] = levels[i]; + for (; i < sizeNew; i++) + levelsNew[i] = SC_FOLDLEVELBASE; + delete []levels; + levels = levelsNew; + sizeLevels = sizeNew; + } else { + Platform::DebugPrintf("No memory available\n"); + // TODO: Blow up + } + +} + +void LineVector::ClearLevels() { + delete []levels; + levels = 0; + sizeLevels = 0; +} + +void LineVector::InsertValue(int pos, int value) { + //Platform::DebugPrintf("InsertValue[%d] = %d\n", pos, value); + if ((lines + 2) >= size) { + if (growSize * 6 < size) + growSize *= 2; + Expand(size + growSize); + if (levels) { + ExpandLevels(size + growSize); + } + } + lines++; + for (int i = lines; i > pos; i--) { + linesData[i] = linesData[i - 1]; + } + linesData[pos].startPosition = value; + linesData[pos].handleSet = 0; + if (levels) { + for (int j = lines; j > pos; j--) { + levels[j] = levels[j - 1]; + } + if (pos == 0) { + levels[pos] = SC_FOLDLEVELBASE; + } else if (pos == (lines - 1)) { // Last line will not be a folder + levels[pos] = SC_FOLDLEVELBASE; + } else { + levels[pos] = levels[pos - 1]; + } + } +} + +void LineVector::SetValue(int pos, int value) { + //Platform::DebugPrintf("SetValue[%d] = %d\n", pos, value); + if ((pos + 2) >= size) { + //Platform::DebugPrintf("Resize %d %d\n", size,pos); + Expand(pos + growSize); + //Platform::DebugPrintf("end Resize %d %d\n", size,pos); + lines = pos; + if (levels) { + ExpandLevels(pos + growSize); + } + } + linesData[pos].startPosition = value; +} + +void LineVector::Remove(int pos) { + //Platform::DebugPrintf("Remove %d\n", pos); + // Retain the markers from the deleted line by oring them into the previous line + if (pos > 0) { + MergeMarkers(pos - 1); + } + for (int i = pos; i < lines; i++) { + linesData[i] = linesData[i + 1]; + } + if (levels) { + // Move up following lines but merge header flag from this line + // to line before to avoid a temporary disappearence causing expansion. + int firstHeader = levels[pos] & SC_FOLDLEVELHEADERFLAG; + for (int j = pos; j < lines; j++) { + levels[j] = levels[j + 1]; + } + if (pos > 0) + levels[pos-1] |= firstHeader; + } + lines--; +} + +int LineVector::LineFromPosition(int pos) { + //Platform::DebugPrintf("LineFromPostion %d lines=%d end = %d\n", pos, lines, linesData[lines].startPosition); + if (lines == 0) + return 0; + //Platform::DebugPrintf("LineFromPosition %d\n", pos); + if (pos >= linesData[lines].startPosition) + return lines - 1; + int lower = 0; + int upper = lines; + do { + int middle = (upper + lower + 1) / 2; // Round high + if (pos < linesData[middle].startPosition) { + upper = middle - 1; + } else { + lower = middle; + } + } while (lower < upper); + //Platform::DebugPrintf("LineFromPostion %d %d %d\n", pos, lower, linesData[lower].startPosition, linesData[lower > 1 ? lower - 1 : 0].startPosition); + return lower; +} + +int LineVector::AddMark(int line, int markerNum) { + handleCurrent++; + if (!linesData[line].handleSet) { + // Need new structure to hold marker handle + linesData[line].handleSet = new MarkerHandleSet; + if (!linesData[line].handleSet) + return - 1; + } + linesData[line].handleSet->InsertHandle(handleCurrent, markerNum); + + return handleCurrent; +} + +void LineVector::MergeMarkers(int pos) { + if (linesData[pos + 1].handleSet != NULL) { + if (linesData[pos].handleSet == NULL ) + linesData[pos].handleSet = new MarkerHandleSet; + linesData[pos].handleSet->CombineWith(linesData[pos + 1].handleSet); + delete linesData[pos + 1].handleSet; + linesData[pos + 1].handleSet = NULL; + } +} + +void LineVector::DeleteMark(int line, int markerNum, bool all) { + if (linesData[line].handleSet) { + if (markerNum == -1) { + delete linesData[line].handleSet; + linesData[line].handleSet = 0; + } else { + bool performedDeletion = + linesData[line].handleSet->RemoveNumber(markerNum); + while (all && performedDeletion) { + performedDeletion = + linesData[line].handleSet->RemoveNumber(markerNum); + } + if (linesData[line].handleSet->Length() == 0) { + delete linesData[line].handleSet; + linesData[line].handleSet = 0; + } + } + } +} + +void LineVector::DeleteMarkFromHandle(int markerHandle) { + int line = LineFromHandle(markerHandle); + if (line >= 0) { + linesData[line].handleSet->RemoveHandle(markerHandle); + if (linesData[line].handleSet->Length() == 0) { + delete linesData[line].handleSet; + linesData[line].handleSet = 0; + } + } +} + +int LineVector::LineFromHandle(int markerHandle) { + for (int line = 0; line < lines; line++) { + if (linesData[line].handleSet) { + if (linesData[line].handleSet->Contains(markerHandle)) { + return line; + } + } + } + return - 1; +} + +Action::Action() { + at = startAction; + position = 0; + data = 0; + lenData = 0; +} + +Action::~Action() { + Destroy(); +} + +void Action::Create(actionType at_, int position_, char *data_, int lenData_, bool mayCoalesce_) { + delete []data; + position = position_; + at = at_; + data = data_; + lenData = lenData_; + mayCoalesce = mayCoalesce_; +} + +void Action::Destroy() { + delete []data; + data = 0; +} + +void Action::Grab(Action *source) { + delete []data; + + position = source->position; + at = source->at; + data = source->data; + lenData = source->lenData; + mayCoalesce = source->mayCoalesce; + + // Ownership of source data transferred to this + source->position = 0; + source->at = startAction; + source->data = 0; + source->lenData = 0; + source->mayCoalesce = true; +} + +// The undo history stores a sequence of user operations that represent the user's view of the +// commands executed on the text. +// Each user operation contains a sequence of text insertion and text deletion actions. +// All the user operations are stored in a list of individual actions with 'start' actions used +// as delimiters between user operations. +// Initially there is one start action in the history. +// As each action is performed, it is recorded in the history. The action may either become +// part of the current user operation or may start a new user operation. If it is to be part of the +// current operation, then it overwrites the current last action. If it is to be part of a new +// operation, it is appended after the current last action. +// After writing the new action, a new start action is appended at the end of the history. +// The decision of whether to start a new user operation is based upon two factors. If a +// compound operation has been explicitly started by calling BeginUndoAction and no matching +// EndUndoAction (these calls nest) has been called, then the action is coalesced into the current +// operation. If there is no outstanding BeginUndoAction call then a new operation is started +// unless it looks as if the new action is caused by the user typing or deleting a stream of text. +// Sequences that look like typing or deletion are coalesced into a single user operation. + +UndoHistory::UndoHistory() { + + lenActions = 100; + actions = new Action[lenActions]; + maxAction = 0; + currentAction = 0; + undoSequenceDepth = 0; + savePoint = 0; + + actions[currentAction].Create(startAction); +} + +UndoHistory::~UndoHistory() { + delete []actions; + actions = 0; +} + +void UndoHistory::EnsureUndoRoom() { + // Have to test that there is room for 2 more actions in the array + // as two actions may be created by the calling function + if (currentAction >= (lenActions - 2)) { + // Run out of undo nodes so extend the array + int lenActionsNew = lenActions * 2; + Action *actionsNew = new Action[lenActionsNew]; + if (!actionsNew) + return ; + for (int act = 0; act <= currentAction; act++) + actionsNew[act].Grab(&actions[act]); + delete []actions; + lenActions = lenActionsNew; + actions = actionsNew; + } +} + +void UndoHistory::AppendAction(actionType at, int position, char *data, int lengthData) { + EnsureUndoRoom(); + //Platform::DebugPrintf("%% %d action %d %d %d\n", at, position, lengthData, currentAction); + //Platform::DebugPrintf("^ %d action %d %d\n", actions[currentAction - 1].at, + // actions[currentAction - 1].position, actions[currentAction - 1].lenData); + if (currentAction < savePoint) { + savePoint = -1; + } + if (currentAction >= 1) { + if (0 == undoSequenceDepth) { + // Top level actions may not always be coalesced + Action &actPrevious = actions[currentAction - 1]; + // See if current action can be coalesced into previous action + // Will work if both are inserts or deletes and position is same + if (at != actPrevious.at) { + currentAction++; + } else if (currentAction == savePoint) { + currentAction++; + } else if ((at == insertAction) && + (position != (actPrevious.position + actPrevious.lenData))) { + // Insertions must be immediately after to coalesce + currentAction++; + } else if (!actions[currentAction].mayCoalesce) { + // Not allowed to coalesce if this set + currentAction++; + } else if (at == removeAction) { + if ((lengthData == 1) || (lengthData == 2)){ + if ((position + lengthData) == actPrevious.position) { + ; // Backspace -> OK + } else if (position == actPrevious.position) { + ; // Delete -> OK + } else { + // Removals must be at same position to coalesce + currentAction++; + } + } else { + // Removals must be of one character to coalesce + currentAction++; + } + } else { + //Platform::DebugPrintf("action coalesced\n"); + } + + } else { + // Actions not at top level are always coalesced unless this is after return to top level + if (!actions[currentAction].mayCoalesce) + currentAction++; + } + } else { + currentAction++; + } + actions[currentAction].Create(at, position, data, lengthData); + currentAction++; + actions[currentAction].Create(startAction); + maxAction = currentAction; +} + +void UndoHistory::BeginUndoAction() { + EnsureUndoRoom(); + if (undoSequenceDepth == 0) { + if (actions[currentAction].at != startAction) { + currentAction++; + actions[currentAction].Create(startAction); + maxAction = currentAction; + } + actions[currentAction].mayCoalesce = false; + } + undoSequenceDepth++; +} + +void UndoHistory::EndUndoAction() { + EnsureUndoRoom(); + undoSequenceDepth--; + if (0 == undoSequenceDepth) { + if (actions[currentAction].at != startAction) { + currentAction++; + actions[currentAction].Create(startAction); + maxAction = currentAction; + } + actions[currentAction].mayCoalesce = false; + } +} + +void UndoHistory::DropUndoSequence() { + undoSequenceDepth = 0; +} + +void UndoHistory::DeleteUndoHistory() { + for (int i = 1; i < maxAction; i++) + actions[i].Destroy(); + maxAction = 0; + currentAction = 0; + actions[currentAction].Create(startAction); + savePoint = 0; +} + +void UndoHistory::SetSavePoint() { + savePoint = currentAction; +} + +bool UndoHistory::IsSavePoint() const { + return savePoint == currentAction; +} + +bool UndoHistory::CanUndo() const { + return (currentAction > 0) && (maxAction > 0); +} + +int UndoHistory::StartUndo() { + // Drop any trailing startAction + if (actions[currentAction].at == startAction && currentAction > 0) + currentAction--; + + // Count the steps in this action + int act = currentAction; + while (actions[act].at != startAction && act > 0) { + act--; + } + return currentAction - act; +} + +const Action &UndoHistory::GetUndoStep() const { + return actions[currentAction]; +} + +void UndoHistory::CompletedUndoStep() { + currentAction--; +} + +bool UndoHistory::CanRedo() const { + return maxAction > currentAction; +} + +int UndoHistory::StartRedo() { + // Drop any leading startAction + if (actions[currentAction].at == startAction && currentAction < maxAction) + currentAction++; + + // Count the steps in this action + int act = currentAction; + while (actions[act].at != startAction && act < maxAction) { + act++; + } + return act - currentAction; +} + +const Action &UndoHistory::GetRedoStep() const { + return actions[currentAction]; +} + +void UndoHistory::CompletedRedoStep() { + currentAction++; +} + +CellBuffer::CellBuffer(int initialLength) { + body = new char[initialLength]; + size = initialLength; + length = 0; + part1len = 0; + gaplen = initialLength; + part2body = body + gaplen; + readOnly = false; + collectingUndo = true; + growSize = 4000; +} + +CellBuffer::~CellBuffer() { + delete []body; + body = 0; +} + +void CellBuffer::GapTo(int position) { + if (position == part1len) + return ; + if (position < part1len) { + int diff = part1len - position; + //Platform::DebugPrintf("Move gap backwards to %d diff = %d part1len=%d length=%d \n", position,diff, part1len, length); + for (int i = 0; i < diff; i++) + body[part1len + gaplen - i - 1] = body[part1len - i - 1]; + } else { // position > part1len + int diff = position - part1len; + //Platform::DebugPrintf("Move gap forwards to %d diff =%d\n", position,diff); + for (int i = 0; i < diff; i++) + body[part1len + i] = body[part1len + gaplen + i]; + } + part1len = position; + part2body = body + gaplen; +} + +void CellBuffer::RoomFor(int insertionLength) { + //Platform::DebugPrintf("need room %d %d\n", gaplen, insertionLength); + if (gaplen <= insertionLength) { + //Platform::DebugPrintf("need room %d %d\n", gaplen, insertionLength); + if (growSize * 6 < size) + growSize *= 2; + int newSize = size + insertionLength + growSize; + Allocate(newSize); + } +} + +// To make it easier to write code that uses ByteAt, a position outside the range of the buffer +// can be retrieved. All characters outside the range have the value '\0'. +char CellBuffer::ByteAt(int position) { + if (position < part1len) { + if (position < 0) { + return '\0'; + } else { + return body[position]; + } + } else { + if (position >= length) { + return '\0'; + } else { + return part2body[position]; + } + } +} + +void CellBuffer::SetByteAt(int position, char ch) { + + if (position < 0) { + //Platform::DebugPrintf("Bad position %d\n",position); + return ; + } + if (position >= length + 11) { + Platform::DebugPrintf("Very Bad position %d of %d\n", position, length); + //exit(2); + return ; + } + if (position >= length) { + //Platform::DebugPrintf("Bad position %d of %d\n",position,length); + return ; + } + + if (position < part1len) { + body[position] = ch; + } else { + part2body[position] = ch; + } +} + +char CellBuffer::CharAt(int position) { + return ByteAt(position*2); +} + +void CellBuffer::GetCharRange(char *buffer, int position, int lengthRetrieve) { + if (lengthRetrieve < 0) + return ; + if (position < 0) + return ; + int bytePos = position * 2; + if ((bytePos + lengthRetrieve * 2) > length) { + Platform::DebugPrintf("Bad GetCharRange %d for %d of %d\n", bytePos, + lengthRetrieve, length); + return ; + } + GapTo(0); // Move the buffer so its easy to subscript into it + char *pb = part2body + bytePos; + while (lengthRetrieve--) { + *buffer++ = *pb; + pb += 2; + } +} + +char CellBuffer::StyleAt(int position) { + return ByteAt(position*2 + 1); +} + +const char *CellBuffer::InsertString(int position, char *s, int insertLength) { + char *data = 0; + // InsertString and DeleteChars are the bottleneck though which all changes occur + if (!readOnly) { + if (collectingUndo) { + // Save into the undo/redo stack, but only the characters - not the formatting + // This takes up about half load time + data = new char[insertLength / 2]; + for (int i = 0; i < insertLength / 2; i++) { + data[i] = s[i * 2]; + } + uh.AppendAction(insertAction, position / 2, data, insertLength / 2); + } + + BasicInsertString(position, s, insertLength); + } + return data; +} + +bool CellBuffer::SetStyleAt(int position, char style, char mask) { + style &= mask; + char curVal = ByteAt(position * 2 + 1); + if ((curVal & mask) != style) { + SetByteAt(position*2 + 1, static_cast((curVal & ~mask) | style)); + return true; + } else { + return false; + } +} + +bool CellBuffer::SetStyleFor(int position, int lengthStyle, char style, char mask) { + int bytePos = position * 2 + 1; + bool changed = false; + PLATFORM_ASSERT(lengthStyle == 0 || + (lengthStyle > 0 && lengthStyle + position < length)); + while (lengthStyle--) { + char curVal = ByteAt(bytePos); + if ((curVal & mask) != style) { + SetByteAt(bytePos, static_cast((curVal & ~mask) | style)); + changed = true; + } + bytePos += 2; + } + return changed; +} + +const char *CellBuffer::DeleteChars(int position, int deleteLength) { + // InsertString and DeleteChars are the bottleneck though which all changes occur + PLATFORM_ASSERT(deleteLength > 0); + char *data = 0; + if (!readOnly) { + if (collectingUndo) { + // Save into the undo/redo stack, but only the characters - not the formatting + data = new char[deleteLength / 2]; + for (int i = 0; i < deleteLength / 2; i++) { + data[i] = ByteAt(position + i * 2); + } + uh.AppendAction(removeAction, position / 2, data, deleteLength / 2); + } + + BasicDeleteChars(position, deleteLength); + } + return data; +} + +int CellBuffer::ByteLength() { + return length; +} + +int CellBuffer::Length() { + return ByteLength() / 2; +} + +void CellBuffer::Allocate(int newSize) { + if (newSize > length) { + GapTo(length); + char *newBody = new char[newSize]; + memcpy(newBody, body, length); + delete []body; + body = newBody; + gaplen += newSize - size; + part2body = body + gaplen; + size = newSize; + } +} + +int CellBuffer::Lines() { + //Platform::DebugPrintf("Lines = %d\n", lv.lines); + return lv.lines; +} + +int CellBuffer::LineStart(int line) { + if (line < 0) + return 0; + else if (line > lv.lines) + return Length(); + else + return lv.linesData[line].startPosition; +} + +bool CellBuffer::IsReadOnly() { + return readOnly; +} + +void CellBuffer::SetReadOnly(bool set) { + readOnly = set; +} + +void CellBuffer::SetSavePoint() { + uh.SetSavePoint(); +} + +bool CellBuffer::IsSavePoint() { + return uh.IsSavePoint(); +} + +int CellBuffer::AddMark(int line, int markerNum) { + if ((line >= 0) && (line < lv.lines)) { + return lv.AddMark(line, markerNum); + } + return - 1; +} + +void CellBuffer::DeleteMark(int line, int markerNum) { + if ((line >= 0) && (line < lv.lines)) { + lv.DeleteMark(line, markerNum, false); + } +} + +void CellBuffer::DeleteMarkFromHandle(int markerHandle) { + lv.DeleteMarkFromHandle(markerHandle); +} + +int CellBuffer::GetMark(int line) { + if ((line >= 0) && (line < lv.lines) && (lv.linesData[line].handleSet)) + return lv.linesData[line].handleSet->MarkValue(); + return 0; +} + +void CellBuffer::DeleteAllMarks(int markerNum) { + for (int line = 0; line < lv.lines; line++) { + lv.DeleteMark(line, markerNum, true); + } +} + +int CellBuffer::LineFromHandle(int markerHandle) { + return lv.LineFromHandle(markerHandle); +} + +// Without undo + +void CellBuffer::BasicInsertString(int position, char *s, int insertLength) { + //Platform::DebugPrintf("Inserting at %d for %d\n", position, insertLength); + if (insertLength == 0) + return ; + PLATFORM_ASSERT(insertLength > 0); + RoomFor(insertLength); + GapTo(position); + + memcpy(body + part1len, s, insertLength); + length += insertLength; + part1len += insertLength; + gaplen -= insertLength; + part2body = body + gaplen; + + int lineInsert = lv.LineFromPosition(position / 2) + 1; + // Point all the lines after the insertion point further along in the buffer + for (int lineAfter = lineInsert; lineAfter <= lv.lines; lineAfter++) { + lv.linesData[lineAfter].startPosition += insertLength / 2; + } + char chPrev = ' '; + if ((position - 2) >= 0) + chPrev = ByteAt(position - 2); + char chAfter = ' '; + if ((position + insertLength) < length) + chAfter = ByteAt(position + insertLength); + if (chPrev == '\r' && chAfter == '\n') { + //Platform::DebugPrintf("Splitting a crlf pair at %d\n", lineInsert); + // Splitting up a crlf pair at position + lv.InsertValue(lineInsert, position / 2); + lineInsert++; + } + char ch = ' '; + for (int i = 0; i < insertLength; i += 2) { + ch = s[i]; + if (ch == '\r') { + //Platform::DebugPrintf("Inserting cr at %d\n", lineInsert); + lv.InsertValue(lineInsert, (position + i) / 2 + 1); + lineInsert++; + } else if (ch == '\n') { + if (chPrev == '\r') { + //Platform::DebugPrintf("Patching cr before lf at %d\n", lineInsert-1); + // Patch up what was end of line + lv.SetValue(lineInsert - 1, (position + i) / 2 + 1); + } else { + //Platform::DebugPrintf("Inserting lf at %d\n", lineInsert); + lv.InsertValue(lineInsert, (position + i) / 2 + 1); + lineInsert++; + } + } + chPrev = ch; + } + // Joining two lines where last insertion is cr and following text starts with lf + if (chAfter == '\n') { + if (ch == '\r') { + //Platform::DebugPrintf("Joining cr before lf at %d\n", lineInsert-1); + // End of line already in buffer so drop the newly created one + lv.Remove(lineInsert - 1); + } + } +} + +void CellBuffer::BasicDeleteChars(int position, int deleteLength) { + //Platform::DebugPrintf("Deleting at %d for %d\n", position, deleteLength); + if (deleteLength == 0) + return ; + + if ((position == 0) && (deleteLength == length)) { + // If whole buffer is being deleted, faster to reinitialise lines data + // than to delete each line. + //printf("Whole buffer being deleted\n"); + lv.Init(); + } else { + // Have to fix up line positions before doing deletion as looking at text in buffer + // to work out which lines have been removed + + int lineRemove = lv.LineFromPosition(position / 2) + 1; + // Point all the lines after the insertion point further along in the buffer + for (int lineAfter = lineRemove; lineAfter <= lv.lines; lineAfter++) { + lv.linesData[lineAfter].startPosition -= deleteLength / 2; + } + char chPrev = ' '; + if (position >= 2) + chPrev = ByteAt(position - 2); + char chBefore = chPrev; + char chNext = ' '; + if (position < length) + chNext = ByteAt(position); + bool ignoreNL = false; + if (chPrev == '\r' && chNext == '\n') { + //Platform::DebugPrintf("Deleting lf after cr, move line end to cr at %d\n", lineRemove); + // Move back one + lv.SetValue(lineRemove, position / 2); + lineRemove++; + ignoreNL = true; // First \n is not real deletion + } + + char ch = chNext; + for (int i = 0; i < deleteLength; i += 2) { + chNext = ' '; + if ((position + i + 2) < length) + chNext = ByteAt(position + i + 2); + //Platform::DebugPrintf("Deleting %d %x\n", i, ch); + if (ch == '\r') { + if (chNext != '\n') { + //Platform::DebugPrintf("Removing cr end of line\n"); + lv.Remove(lineRemove); + } + } else if (ch == '\n') { + if (ignoreNL) { + ignoreNL = false; // Further \n are real deletions + } else { + //Platform::DebugPrintf("Removing lf end of line\n"); + lv.Remove(lineRemove); + } + } + + ch = chNext; + } + // May have to fix up end if last deletion causes cr to be next to lf + // or removes one of a crlf pair + char chAfter = ' '; + if ((position + deleteLength) < length) + chAfter = ByteAt(position + deleteLength); + if (chBefore == '\r' && chAfter == '\n') { + //d.printf("Joining cr before lf at %d\n", lineRemove); + // Using lineRemove-1 as cr ended line before start of deletion + lv.Remove(lineRemove - 1); + lv.SetValue(lineRemove - 1, position / 2 + 1); + } + } + GapTo(position); + length -= deleteLength; + gaplen += deleteLength; + part2body = body + gaplen; +} + +bool CellBuffer::SetUndoCollection(bool collectUndo) { + collectingUndo = collectUndo; + uh.DropUndoSequence(); + return collectingUndo; +} + +bool CellBuffer::IsCollectingUndo() { + return collectingUndo; +} + +void CellBuffer::BeginUndoAction() { + uh.BeginUndoAction(); +} + +void CellBuffer::EndUndoAction() { + uh.EndUndoAction(); +} + +void CellBuffer::DeleteUndoHistory() { + uh.DeleteUndoHistory(); +} + +bool CellBuffer::CanUndo() { + return uh.CanUndo(); +} + +int CellBuffer::StartUndo() { + return uh.StartUndo(); +} + +const Action &CellBuffer::GetUndoStep() const { + return uh.GetUndoStep(); +} + +void CellBuffer::PerformUndoStep() { + const Action &actionStep = uh.GetUndoStep(); + if (actionStep.at == insertAction) { + BasicDeleteChars(actionStep.position*2, actionStep.lenData*2); + } else if (actionStep.at == removeAction) { + char *styledData = new char[actionStep.lenData * 2]; + for (int i = 0; i < actionStep.lenData; i++) { + styledData[i*2] = actionStep.data[i]; + styledData[i*2 + 1] = 0; + } + BasicInsertString(actionStep.position*2, styledData, actionStep.lenData*2); + delete []styledData; + } + uh.CompletedUndoStep(); +} + +bool CellBuffer::CanRedo() { + return uh.CanRedo(); +} + +int CellBuffer::StartRedo() { + return uh.StartRedo(); +} + +const Action &CellBuffer::GetRedoStep() const { + return uh.GetRedoStep(); +} + +void CellBuffer::PerformRedoStep() { + const Action &actionStep = uh.GetRedoStep(); + if (actionStep.at == insertAction) { + char *styledData = new char[actionStep.lenData * 2]; + for (int i = 0; i < actionStep.lenData; i++) { + styledData[i*2] = actionStep.data[i]; + styledData[i*2 + 1] = 0; + } + BasicInsertString(actionStep.position*2, styledData, actionStep.lenData*2); + delete []styledData; + } else if (actionStep.at == removeAction) { + BasicDeleteChars(actionStep.position*2, actionStep.lenData*2); + } + uh.CompletedRedoStep(); +} + +int CellBuffer::SetLineState(int line, int state) { + int stateOld = lineStates[line]; + lineStates[line] = state; + return stateOld; +} + +int CellBuffer::GetLineState(int line) { + return lineStates[line]; +} + +int CellBuffer::GetMaxLineState() { + return lineStates.Length(); +} + +int CellBuffer::SetLevel(int line, int level) { + int prev = 0; + if ((line >= 0) && (line < lv.lines)) { + if (!lv.levels) { + lv.ExpandLevels(); + } + prev = lv.levels[line]; + if (lv.levels[line] != level) { + lv.levels[line] = level; + } + } + return prev; +} + +int CellBuffer::GetLevel(int line) { + if (lv.levels && (line >= 0) && (line < lv.lines)) { + return lv.levels[line]; + } else { + return SC_FOLDLEVELBASE; + } +} + +void CellBuffer::ClearLevels() { + lv.ClearLevels(); +} diff --git a/src/CellBuffer.h b/src/CellBuffer.h new file mode 100755 index 0000000..bb81fd5 --- /dev/null +++ b/src/CellBuffer.h @@ -0,0 +1,250 @@ +// Scintilla source code edit control +/** @file CellBuffer.h + ** Manages the text of the document. + **/ +// Copyright 1998-2004 by Neil Hodgson +// The License.txt file describes the conditions under which this software may be distributed. + +#ifndef CELLBUFFER_H +#define CELLBUFFER_H + +/** + * This holds the marker identifier and the marker type to display. + * MarkerHandleNumbers are members of lists. + */ +struct MarkerHandleNumber { + int handle; + int number; + MarkerHandleNumber *next; +}; + +/** + * A marker handle set contains any number of MarkerHandleNumbers. + */ +class MarkerHandleSet { + MarkerHandleNumber *root; + +public: + MarkerHandleSet(); + ~MarkerHandleSet(); + int Length(); + int NumberFromHandle(int handle); + int MarkValue(); ///< Bit set of marker numbers. + bool Contains(int handle); + bool InsertHandle(int handle, int markerNum); + void RemoveHandle(int handle); + bool RemoveNumber(int markerNum); + void CombineWith(MarkerHandleSet *other); +}; + +/** + * Each line stores the starting position of the first character of the line in the cell buffer + * and potentially a marker handle set. Often a line will not have any attached markers. + */ +struct LineData { + int startPosition; + MarkerHandleSet *handleSet; + LineData() : startPosition(0), handleSet(0) { + } +}; + +/** + * The line vector contains information about each of the lines in a cell buffer. + */ +class LineVector { +public: + int growSize; + int lines; + LineData *linesData; + int size; + int *levels; + int sizeLevels; + + /// Handles are allocated sequentially and should never have to be reused as 32 bit ints are very big. + int handleCurrent; + + LineVector(); + ~LineVector(); + void Init(); + + void Expand(int sizeNew); + void ExpandLevels(int sizeNew=-1); + void ClearLevels(); + void InsertValue(int pos, int value); + void SetValue(int pos, int value); + void Remove(int pos); + int LineFromPosition(int pos); + + int AddMark(int line, int marker); + void MergeMarkers(int pos); + void DeleteMark(int line, int markerNum, bool all); + void DeleteMarkFromHandle(int markerHandle); + int LineFromHandle(int markerHandle); +}; + +enum actionType { insertAction, removeAction, startAction }; + +/** + * Actions are used to store all the information required to perform one undo/redo step. + */ +class Action { +public: + actionType at; + int position; + char *data; + int lenData; + bool mayCoalesce; + + Action(); + ~Action(); + void Create(actionType at_, int position_=0, char *data_=0, int lenData_=0, bool mayCoalesce_=true); + void Destroy(); + void Grab(Action *source); +}; + +/** + * + */ +class UndoHistory { + Action *actions; + int lenActions; + int maxAction; + int currentAction; + int undoSequenceDepth; + int savePoint; + + void EnsureUndoRoom(); + +public: + UndoHistory(); + ~UndoHistory(); + + void AppendAction(actionType at, int position, char *data, int length); + + void BeginUndoAction(); + void EndUndoAction(); + void DropUndoSequence(); + void DeleteUndoHistory(); + + /// The save point is a marker in the undo stack where the container has stated that + /// the buffer was saved. Undo and redo can move over the save point. + void SetSavePoint(); + bool IsSavePoint() const; + + /// To perform an undo, StartUndo is called to retrieve the number of steps, then UndoStep is + /// called that many times. Similarly for redo. + bool CanUndo() const; + int StartUndo(); + const Action &GetUndoStep() const; + void CompletedUndoStep(); + bool CanRedo() const; + int StartRedo(); + const Action &GetRedoStep() const; + void CompletedRedoStep(); +}; + +/** + * Holder for an expandable array of characters that supports undo and line markers. + * Based on article "Data Structures in a Bit-Mapped Text Editor" + * by Wilfred J. Hansen, Byte January 1987, page 183. + */ +class CellBuffer { +private: + char *body; ///< The cell buffer itself. + int size; ///< Allocated size of the buffer. + int length; ///< Total length of the data. + int part1len; ///< Length of the first part. + int gaplen; ///< Length of the gap between the two parts. + char *part2body; ///< The second part of the cell buffer. + ///< Doesn't point after the gap but set so that + ///< part2body[position] is consistent with body[position]. + bool readOnly; + int growSize; + + bool collectingUndo; + UndoHistory uh; + + LineVector lv; + + SVector lineStates; + + void GapTo(int position); + void RoomFor(int insertionLength); + + inline char ByteAt(int position); + void SetByteAt(int position, char ch); + +public: + + CellBuffer(int initialLength = 4000); + ~CellBuffer(); + + /// Retrieving positions outside the range of the buffer works and returns 0 + char CharAt(int position); + void GetCharRange(char *buffer, int position, int lengthRetrieve); + char StyleAt(int position); + + int ByteLength(); + int Length(); + void Allocate(int newSize); + int Lines(); + int LineStart(int line); + int LineFromPosition(int pos) { return lv.LineFromPosition(pos); } + const char *InsertString(int position, char *s, int insertLength); + + /// Setting styles for positions outside the range of the buffer is safe and has no effect. + /// @return true if the style of a character is changed. + bool SetStyleAt(int position, char style, char mask='\377'); + bool SetStyleFor(int position, int length, char style, char mask); + + const char *DeleteChars(int position, int deleteLength); + + bool IsReadOnly(); + void SetReadOnly(bool set); + + /// The save point is a marker in the undo stack where the container has stated that + /// the buffer was saved. Undo and redo can move over the save point. + void SetSavePoint(); + bool IsSavePoint(); + + /// Line marker functions + int AddMark(int line, int markerNum); + void DeleteMark(int line, int markerNum); + void DeleteMarkFromHandle(int markerHandle); + int GetMark(int line); + void DeleteAllMarks(int markerNum); + int LineFromHandle(int markerHandle); + + /// Actions without undo + void BasicInsertString(int position, char *s, int insertLength); + void BasicDeleteChars(int position, int deleteLength); + + bool SetUndoCollection(bool collectUndo); + bool IsCollectingUndo(); + void BeginUndoAction(); + void EndUndoAction(); + void DeleteUndoHistory(); + + /// To perform an undo, StartUndo is called to retrieve the number of steps, then UndoStep is + /// called that many times. Similarly for redo. + bool CanUndo(); + int StartUndo(); + const Action &GetUndoStep() const; + void PerformUndoStep(); + bool CanRedo(); + int StartRedo(); + const Action &GetRedoStep() const; + void PerformRedoStep(); + + int SetLineState(int line, int state); + int GetLineState(int line); + int GetMaxLineState(); + + int SetLevel(int line, int level); + int GetLevel(int line); + void ClearLevels(); +}; + +#define CELL_SIZE 2 + +#endif diff --git a/src/CharClassify.cpp b/src/CharClassify.cpp new file mode 100644 index 0000000..acab4b2 --- /dev/null +++ b/src/CharClassify.cpp @@ -0,0 +1,43 @@ +// Scintilla source code edit control +/** @file CharClassify.cxx + ** Character classifications used by Document and RESearch. + **/ +// Copyright 2006 by Neil Hodgson +// The License.txt file describes the conditions under which this software may be distributed. + +#include + +#include "CharClassify.h" + +// Shut up annoying Visual C++ warnings: +#ifdef _MSC_VER +#pragma warning(disable: 4514) +#endif + +CharClassify::CharClassify() { + SetDefaultCharClasses(true); +} + +void CharClassify::SetDefaultCharClasses(bool includeWordClass) { + // Initialize all char classes to default values + for (int ch = 0; ch < 256; ch++) { + if (ch == '\r' || ch == '\n') + charClass[ch] = ccNewLine; + else if (ch < 0x20 || ch == ' ') + charClass[ch] = ccSpace; + else if (includeWordClass && (ch >= 0x80 || isalnum(ch) || ch == '_')) + charClass[ch] = ccWord; + else + charClass[ch] = ccPunctuation; + } +} + +void CharClassify::SetCharClasses(const unsigned char *chars, cc newCharClass) { + // Apply the newCharClass to the specifed chars + if (chars) { + while (*chars) { + charClass[*chars] = static_cast(newCharClass); + chars++; + } + } +} diff --git a/src/CharClassify.h b/src/CharClassify.h new file mode 100644 index 0000000..881d3a1 --- /dev/null +++ b/src/CharClassify.h @@ -0,0 +1,25 @@ +// Scintilla source code edit control +/** @file CharClassify.h + ** Character classifications used by Document and RESearch. + **/ +// Copyright 2006 by Neil Hodgson +// The License.txt file describes the conditions under which this software may be distributed. + +#ifndef CHARCLASSIFY_H +#define CHARCLASSIFY_H + +class CharClassify { +public: + CharClassify(); + + enum cc { ccSpace, ccNewLine, ccWord, ccPunctuation }; + void SetDefaultCharClasses(bool includeWordClass); + void SetCharClasses(const unsigned char *chars, cc newCharClass); + cc GetClass(unsigned char ch) const { return static_cast(charClass[ch]);} + bool IsWord(unsigned char ch) const { return static_cast(charClass[ch]) == ccWord;} + +private: + enum { maxChar=256 }; + unsigned char charClass[maxChar]; // not type cc to save space +}; +#endif diff --git a/src/ContractionState.cpp b/src/ContractionState.cpp new file mode 100755 index 0000000..3d021b0 --- /dev/null +++ b/src/ContractionState.cpp @@ -0,0 +1,289 @@ +// Scintilla source code edit control +/** @file ContractionState.cxx + ** Manages visibility of lines for folding. + **/ +// Copyright 1998-2001 by Neil Hodgson +// The License.txt file describes the conditions under which this software may be distributed. + +#include "Platform.h" + +#include "ContractionState.h" + +OneLine::OneLine() { + displayLine = 0; + //docLine = 0; + visible = true; + height = 1; + expanded = true; +} + +ContractionState::ContractionState() { + lines = 0; + size = 0; + linesInDoc = 1; + linesInDisplay = 1; + valid = false; + docLines = 0; + sizeDocLines = 0; +} + +ContractionState::~ContractionState() { + Clear(); +} + +void ContractionState::MakeValid() const { + if (!valid) { + // Could be cleverer by keeping the index of the last still valid entry + // rather than invalidating all. + linesInDisplay = 0; + for (int lineInDoc=0; lineInDoc= 0) && (lineDoc < linesInDoc)) { + return lines[lineDoc].displayLine; + } + return -1; +} + +int ContractionState::DocFromDisplay(int lineDisplay) const { + if (lineDisplay <= 0) + return 0; + if (lineDisplay >= linesInDisplay) + return linesInDoc; + if (size == 0) + return lineDisplay; + MakeValid(); + if (docLines) { // Valid allocation + return docLines[lineDisplay]; + } else { + return 0; + } +} + +void ContractionState::Grow(int sizeNew) { + OneLine *linesNew = new OneLine[sizeNew]; + if (linesNew) { + int i = 0; + for (; i < size; i++) { + linesNew[i] = lines[i]; + } + for (; i < sizeNew; i++) { + linesNew[i].displayLine = i; + } + delete []lines; + lines = linesNew; + size = sizeNew; + valid = false; + } else { + Platform::DebugPrintf("No memory available\n"); + // TODO: Blow up + } +} + +void ContractionState::InsertLines(int lineDoc, int lineCount) { + if (size == 0) { + linesInDoc += lineCount; + linesInDisplay += lineCount; + return; + } + //Platform::DebugPrintf("InsertLine[%d] = %d\n", lineDoc); + if ((linesInDoc + lineCount + 2) >= size) { + Grow(linesInDoc + lineCount + growSize); + } + linesInDoc += lineCount; + for (int i = linesInDoc; i >= lineDoc + lineCount; i--) { + lines[i].visible = lines[i - lineCount].visible; + lines[i].height = lines[i - lineCount].height; + linesInDisplay += lines[i].height; + lines[i].expanded = lines[i - lineCount].expanded; + } + for (int d=0;d= 0) && (lineDoc < linesInDoc)) { + return lines[lineDoc].visible; + } else { + return false; + } +} + +bool ContractionState::SetVisible(int lineDocStart, int lineDocEnd, bool visible) { + if (lineDocStart == 0) + lineDocStart++; + if (lineDocStart > lineDocEnd) + return false; + if (size == 0) { + Grow(linesInDoc + growSize); + } + // TODO: modify docLine members to mirror displayLine + int delta = 0; + // Change lineDocs + if ((lineDocStart <= lineDocEnd) && (lineDocStart >= 0) && (lineDocEnd < linesInDoc)) { + for (int line=lineDocStart; line <= lineDocEnd; line++) { + if (lines[line].visible != visible) { + delta += visible ? lines[line].height : -lines[line].height; + lines[line].visible = visible; + } + } + } + linesInDisplay += delta; + valid = false; + return delta != 0; +} + +bool ContractionState::GetExpanded(int lineDoc) const { + if (size == 0) + return true; + if ((lineDoc >= 0) && (lineDoc < linesInDoc)) { + return lines[lineDoc].expanded; + } else { + return false; + } +} + +bool ContractionState::SetExpanded(int lineDoc, bool expanded) { + if (size == 0) { + if (expanded) { + // If in completely expanded state then setting + // one line to expanded has no effect. + return false; + } + Grow(linesInDoc + growSize); + } + if ((lineDoc >= 0) && (lineDoc < linesInDoc)) { + if (lines[lineDoc].expanded != expanded) { + lines[lineDoc].expanded = expanded; + return true; + } + } + return false; +} + +int ContractionState::GetHeight(int lineDoc) const { + if (size == 0) + return 1; + if ((lineDoc >= 0) && (lineDoc < linesInDoc)) { + return lines[lineDoc].height; + } else { + return 1; + } +} + +// Set the number of display lines needed for this line. +// Return true if this is a change. +bool ContractionState::SetHeight(int lineDoc, int height) { + if (lineDoc > linesInDoc) + return false; + if (size == 0) { + if (height == 1) { + // If in completely expanded state then all lines + // assumed to have height of one so no effect here. + return false; + } + Grow(linesInDoc + growSize); + } + if (lines[lineDoc].height != height) { + lines[lineDoc].height = height; + valid = false; + return true; + } else { + return false; + } +} + +void ContractionState::ShowAll() { + delete []lines; + lines = 0; + size = 0; + + delete []docLines; + docLines = 0; + sizeDocLines = 0; + + linesInDisplay = linesInDoc; +} diff --git a/src/ContractionState.h b/src/ContractionState.h new file mode 100755 index 0000000..e15ee3b --- /dev/null +++ b/src/ContractionState.h @@ -0,0 +1,65 @@ +// Scintilla source code edit control +/** @file ContractionState.h + ** Manages visibility of lines for folding. + **/ +// Copyright 1998-2001 by Neil Hodgson +// The License.txt file describes the conditions under which this software may be distributed. + +#ifndef CONTRACTIONSTATE_H +#define CONTRACTIONSTATE_H + +/** + */ +class OneLine { +public: + int displayLine; ///< Position within set of visible lines + //int docLine; ///< Inverse of @a displayLine + int height; ///< Number of display lines needed to show all of the line + bool visible; + bool expanded; + + OneLine(); + virtual ~OneLine() {} +}; + +/** + */ +class ContractionState { + void Grow(int sizeNew); + enum { growSize = 4000 }; + int linesInDoc; + mutable int linesInDisplay; + mutable OneLine *lines; + int size; + mutable int *docLines; + mutable int sizeDocLines; + mutable bool valid; + void MakeValid() const; + +public: + ContractionState(); + virtual ~ContractionState(); + + void Clear(); + + int LinesInDoc() const; + int LinesDisplayed() const; + int DisplayFromDoc(int lineDoc) const; + int DocFromDisplay(int lineDisplay) const; + + void InsertLines(int lineDoc, int lineCount); + void DeleteLines(int lineDoc, int lineCount); + + bool GetVisible(int lineDoc) const; + bool SetVisible(int lineDocStart, int lineDocEnd, bool visible); + + bool GetExpanded(int lineDoc) const; + bool SetExpanded(int lineDoc, bool expanded); + + int GetHeight(int lineDoc) const; + bool SetHeight(int lineDoc, int height); + + void ShowAll(); +}; + +#endif diff --git a/src/Document.cpp b/src/Document.cpp new file mode 100755 index 0000000..92be926 --- /dev/null +++ b/src/Document.cpp @@ -0,0 +1,1577 @@ +// Scintilla source code edit control +/** @file Document.cxx + ** Text document that handles notifications, DBCS, styling, words and end of line. + **/ +// Copyright 1998-2003 by Neil Hodgson +// The License.txt file describes the conditions under which this software may be distributed. + +#include +#include +#include +#include + +#include "Platform.h" + +#include "Scintilla.h" +#include "SVector.h" +#include "CellBuffer.h" +#include "CharClassify.h" +#include "Document.h" +#include "RESearch.h" + +// This is ASCII specific but is safe with chars >= 0x80 +static inline bool isspacechar(unsigned char ch) { + return (ch == ' ') || ((ch >= 0x09) && (ch <= 0x0d)); +} + +static inline bool IsPunctuation(char ch) { + return isascii(ch) && ispunct(ch); +} + +static inline bool IsADigit(char ch) { + return isascii(ch) && isdigit(ch); +} + +static inline bool IsLowerCase(char ch) { + return isascii(ch) && islower(ch); +} + +static inline bool IsUpperCase(char ch) { + return isascii(ch) && isupper(ch); +} + +Document::Document() { + refCount = 0; +#ifdef unix + eolMode = SC_EOL_LF; +#else + eolMode = SC_EOL_CRLF; +#endif + dbcsCodePage = 0; + stylingBits = 5; + stylingBitsMask = 0x1F; + stylingMask = 0; + endStyled = 0; + styleClock = 0; + enteredCount = 0; + enteredReadOnlyCount = 0; + tabInChars = 8; + indentInChars = 0; + actualIndentInChars = 8; + useTabs = true; + tabIndents = true; + backspaceUnindents = false; + watchers = 0; + lenWatchers = 0; + + matchesValid = false; + pre = 0; + substituted = 0; +} + +Document::~Document() { + for (int i = 0; i < lenWatchers; i++) { + watchers[i].watcher->NotifyDeleted(this, watchers[i].userData); + } + delete []watchers; + watchers = 0; + lenWatchers = 0; + delete pre; + pre = 0; + delete []substituted; + substituted = 0; +} + +// Increase reference count and return its previous value. +int Document::AddRef() { + return refCount++; +} + +// Decrease reference count and return its previous value. +// Delete the document if reference count reaches zero. +int Document::Release() { + int curRefCount = --refCount; + if (curRefCount == 0) + delete this; + return curRefCount; +} + +void Document::SetSavePoint() { + cb.SetSavePoint(); + NotifySavePoint(true); +} + +int Document::AddMark(int line, int markerNum) { + int prev = cb.AddMark(line, markerNum); + DocModification mh(SC_MOD_CHANGEMARKER, LineStart(line), 0, 0, 0, line); + mh.line = line; + NotifyModified(mh); + return prev; +} + +void Document::AddMarkSet(int line, int valueSet) { + unsigned int m = valueSet; + for (int i = 0; m; i++, m >>= 1) + if (m & 1) + cb.AddMark(line, i); + DocModification mh(SC_MOD_CHANGEMARKER, LineStart(line), 0, 0, 0, line); + mh.line = line; + NotifyModified(mh); +} + +void Document::DeleteMark(int line, int markerNum) { + cb.DeleteMark(line, markerNum); + DocModification mh(SC_MOD_CHANGEMARKER, LineStart(line), 0, 0, 0, line); + mh.line = line; + NotifyModified(mh); +} + +void Document::DeleteMarkFromHandle(int markerHandle) { + cb.DeleteMarkFromHandle(markerHandle); + DocModification mh(SC_MOD_CHANGEMARKER, 0, 0, 0, 0); + mh.line = -1; + NotifyModified(mh); +} + +void Document::DeleteAllMarks(int markerNum) { + cb.DeleteAllMarks(markerNum); + DocModification mh(SC_MOD_CHANGEMARKER, 0, 0, 0, 0); + mh.line = -1; + NotifyModified(mh); +} + +int Document::LineStart(int line) { + return cb.LineStart(line); +} + +int Document::LineEnd(int line) { + if (line == LinesTotal() - 1) { + return LineStart(line + 1); + } else { + int position = LineStart(line + 1) - 1; + // When line terminator is CR+LF, may need to go back one more + if ((position > LineStart(line)) && (cb.CharAt(position - 1) == '\r')) { + position--; + } + return position; + } +} + +int Document::LineFromPosition(int pos) { + return cb.LineFromPosition(pos); +} + +int Document::LineEndPosition(int position) { + return LineEnd(LineFromPosition(position)); +} + +int Document::VCHomePosition(int position) { + int line = LineFromPosition(position); + int startPosition = LineStart(line); + int endLine = LineStart(line + 1) - 1; + int startText = startPosition; + while (startText < endLine && (cb.CharAt(startText) == ' ' || cb.CharAt(startText) == '\t' ) ) + startText++; + if (position == startText) + return startPosition; + else + return startText; +} + +int Document::SetLevel(int line, int level) { + int prev = cb.SetLevel(line, level); + if (prev != level) { + DocModification mh(SC_MOD_CHANGEFOLD | SC_MOD_CHANGEMARKER, + LineStart(line), 0, 0, 0); + mh.line = line; + mh.foldLevelNow = level; + mh.foldLevelPrev = prev; + NotifyModified(mh); + } + return prev; +} + +static bool IsSubordinate(int levelStart, int levelTry) { + if (levelTry & SC_FOLDLEVELWHITEFLAG) + return true; + else + return (levelStart & SC_FOLDLEVELNUMBERMASK) < (levelTry & SC_FOLDLEVELNUMBERMASK); +} + +int Document::GetLastChild(int lineParent, int level) { + if (level == -1) + level = GetLevel(lineParent) & SC_FOLDLEVELNUMBERMASK; + int maxLine = LinesTotal(); + int lineMaxSubord = lineParent; + while (lineMaxSubord < maxLine - 1) { + EnsureStyledTo(LineStart(lineMaxSubord + 2)); + if (!IsSubordinate(level, GetLevel(lineMaxSubord + 1))) + break; + lineMaxSubord++; + } + if (lineMaxSubord > lineParent) { + if (level > (GetLevel(lineMaxSubord + 1) & SC_FOLDLEVELNUMBERMASK)) { + // Have chewed up some whitespace that belongs to a parent so seek back + if (GetLevel(lineMaxSubord) & SC_FOLDLEVELWHITEFLAG) { + lineMaxSubord--; + } + } + } + return lineMaxSubord; +} + +int Document::GetFoldParent(int line) { + int level = GetLevel(line) & SC_FOLDLEVELNUMBERMASK; + int lineLook = line - 1; + while ((lineLook > 0) && ( + (!(GetLevel(lineLook) & SC_FOLDLEVELHEADERFLAG)) || + ((GetLevel(lineLook) & SC_FOLDLEVELNUMBERMASK) >= level)) + ) { + lineLook--; + } + if ((GetLevel(lineLook) & SC_FOLDLEVELHEADERFLAG) && + ((GetLevel(lineLook) & SC_FOLDLEVELNUMBERMASK) < level)) { + return lineLook; + } else { + return -1; + } +} + +int Document::ClampPositionIntoDocument(int pos) { + return Platform::Clamp(pos, 0, Length()); +} + +bool Document::IsCrLf(int pos) { + if (pos < 0) + return false; + if (pos >= (Length() - 1)) + return false; + return (cb.CharAt(pos) == '\r') && (cb.CharAt(pos + 1) == '\n'); +} + +static const int maxBytesInDBCSCharacter=5; + +int Document::LenChar(int pos) { + if (pos < 0) { + return 1; + } else if (IsCrLf(pos)) { + return 2; + } else if (SC_CP_UTF8 == dbcsCodePage) { + unsigned char ch = static_cast(cb.CharAt(pos)); + if (ch < 0x80) + return 1; + int len = 2; + if (ch >= (0x80 + 0x40 + 0x20)) + len = 3; + int lengthDoc = Length(); + if ((pos + len) > lengthDoc) + return lengthDoc -pos; + else + return len; + } else if (dbcsCodePage) { + char mbstr[maxBytesInDBCSCharacter+1]; + int i; + for (i=0; i= Length()) + return Length(); + + // PLATFORM_ASSERT(pos > 0 && pos < Length()); + if (checkLineEnd && IsCrLf(pos - 1)) { + if (moveDir > 0) + return pos + 1; + else + return pos - 1; + } + + // Not between CR and LF + + if (dbcsCodePage) { + if (SC_CP_UTF8 == dbcsCodePage) { + unsigned char ch = static_cast(cb.CharAt(pos)); + while ((pos > 0) && (pos < Length()) && (ch >= 0x80) && (ch < (0x80 + 0x40))) { + // ch is a trail byte + if (moveDir > 0) + pos++; + else + pos--; + ch = static_cast(cb.CharAt(pos)); + } + } else { + // Anchor DBCS calculations at start of line because start of line can + // not be a DBCS trail byte. + int posCheck = LineStart(LineFromPosition(pos)); + while (posCheck < pos) { + char mbstr[maxBytesInDBCSCharacter+1]; + int i; + for(i=0;i pos) { + if (moveDir > 0) { + return posCheck + mbsize; + } else { + return posCheck; + } + } + posCheck += mbsize; + } + } + } + + return pos; +} + +void Document::ModifiedAt(int pos) { + if (endStyled > pos) + endStyled = pos; +} + +void Document::CheckReadOnly() { + if (cb.IsReadOnly() && enteredReadOnlyCount == 0) { + enteredReadOnlyCount++; + NotifyModifyAttempt(); + enteredReadOnlyCount--; + } +} + +// Document only modified by gateways DeleteChars, InsertStyledString, Undo, Redo, and SetStyleAt. +// SetStyleAt does not change the persistent state of a document + +// Unlike Undo, Redo, and InsertStyledString, the pos argument is a cell number not a char number +bool Document::DeleteChars(int pos, int len) { + if (len == 0) + return false; + if ((pos + len) > Length()) + return false; + CheckReadOnly(); + if (enteredCount != 0) { + return false; + } else { + enteredCount++; + if (!cb.IsReadOnly()) { + NotifyModified( + DocModification( + SC_MOD_BEFOREDELETE | SC_PERFORMED_USER, + pos, len, + 0, 0)); + int prevLinesTotal = LinesTotal(); + bool startSavePoint = cb.IsSavePoint(); + const char *text = cb.DeleteChars(pos * 2, len * 2); + if (startSavePoint && cb.IsCollectingUndo()) + NotifySavePoint(!startSavePoint); + if ((pos < Length()) || (pos == 0)) + ModifiedAt(pos); + else + ModifiedAt(pos-1); + NotifyModified( + DocModification( + SC_MOD_DELETETEXT | SC_PERFORMED_USER, + pos, len, + LinesTotal() - prevLinesTotal, text)); + } + enteredCount--; + } + return !cb.IsReadOnly(); +} + +/** + * Insert a styled string (char/style pairs) with a length. + */ +bool Document::InsertStyledString(int position, char *s, int insertLength) { + CheckReadOnly(); + if (enteredCount != 0) { + return false; + } else { + enteredCount++; + if (!cb.IsReadOnly()) { + NotifyModified( + DocModification( + SC_MOD_BEFOREINSERT | SC_PERFORMED_USER, + position / 2, insertLength / 2, + 0, s)); + int prevLinesTotal = LinesTotal(); + bool startSavePoint = cb.IsSavePoint(); + const char *text = cb.InsertString(position, s, insertLength); + if (startSavePoint && cb.IsCollectingUndo()) + NotifySavePoint(!startSavePoint); + ModifiedAt(position / 2); + NotifyModified( + DocModification( + SC_MOD_INSERTTEXT | SC_PERFORMED_USER, + position / 2, insertLength / 2, + LinesTotal() - prevLinesTotal, text)); + } + enteredCount--; + } + return !cb.IsReadOnly(); +} + +int Document::Undo() { + int newPos = -1; + CheckReadOnly(); + if (enteredCount == 0) { + enteredCount++; + if (!cb.IsReadOnly()) { + bool startSavePoint = cb.IsSavePoint(); + bool multiLine = false; + int steps = cb.StartUndo(); + //Platform::DebugPrintf("Steps=%d\n", steps); + for (int step = 0; step < steps; step++) { + const int prevLinesTotal = LinesTotal(); + const Action &action = cb.GetUndoStep(); + if (action.at == removeAction) { + NotifyModified(DocModification( + SC_MOD_BEFOREINSERT | SC_PERFORMED_UNDO, action)); + } else { + NotifyModified(DocModification( + SC_MOD_BEFOREDELETE | SC_PERFORMED_UNDO, action)); + } + cb.PerformUndoStep(); + int cellPosition = action.position; + ModifiedAt(cellPosition); + newPos = cellPosition; + + int modFlags = SC_PERFORMED_UNDO; + // With undo, an insertion action becomes a deletion notification + if (action.at == removeAction) { + newPos += action.lenData; + modFlags |= SC_MOD_INSERTTEXT; + } else { + modFlags |= SC_MOD_DELETETEXT; + } + if (steps > 1) + modFlags |= SC_MULTISTEPUNDOREDO; + const int linesAdded = LinesTotal() - prevLinesTotal; + if (linesAdded != 0) + multiLine = true; + if (step == steps - 1) { + modFlags |= SC_LASTSTEPINUNDOREDO; + if (multiLine) + modFlags |= SC_MULTILINEUNDOREDO; + } + NotifyModified(DocModification(modFlags, cellPosition, action.lenData, + linesAdded, action.data)); + } + + bool endSavePoint = cb.IsSavePoint(); + if (startSavePoint != endSavePoint) + NotifySavePoint(endSavePoint); + } + enteredCount--; + } + return newPos; +} + +int Document::Redo() { + int newPos = -1; + CheckReadOnly(); + if (enteredCount == 0) { + enteredCount++; + if (!cb.IsReadOnly()) { + bool startSavePoint = cb.IsSavePoint(); + bool multiLine = false; + int steps = cb.StartRedo(); + for (int step = 0; step < steps; step++) { + const int prevLinesTotal = LinesTotal(); + const Action &action = cb.GetRedoStep(); + if (action.at == insertAction) { + NotifyModified(DocModification( + SC_MOD_BEFOREINSERT | SC_PERFORMED_REDO, action)); + } else { + NotifyModified(DocModification( + SC_MOD_BEFOREDELETE | SC_PERFORMED_REDO, action)); + } + cb.PerformRedoStep(); + ModifiedAt(action.position); + newPos = action.position; + + int modFlags = SC_PERFORMED_REDO; + if (action.at == insertAction) { + newPos += action.lenData; + modFlags |= SC_MOD_INSERTTEXT; + } else { + modFlags |= SC_MOD_DELETETEXT; + } + if (steps > 1) + modFlags |= SC_MULTISTEPUNDOREDO; + const int linesAdded = LinesTotal() - prevLinesTotal; + if (linesAdded != 0) + multiLine = true; + if (step == steps - 1) { + modFlags |= SC_LASTSTEPINUNDOREDO; + if (multiLine) + modFlags |= SC_MULTILINEUNDOREDO; + } + NotifyModified( + DocModification(modFlags, action.position, action.lenData, + linesAdded, action.data)); + } + + bool endSavePoint = cb.IsSavePoint(); + if (startSavePoint != endSavePoint) + NotifySavePoint(endSavePoint); + } + enteredCount--; + } + return newPos; +} + +/** + * Insert a single character. + */ +bool Document::InsertChar(int pos, char ch) { + char chs[2]; + chs[0] = ch; + chs[1] = 0; + return InsertStyledString(pos*2, chs, 2); +} + +/** + * Insert a null terminated string. + */ +bool Document::InsertString(int position, const char *s) { + return InsertString(position, s, strlen(s)); +} + +/** + * Insert a string with a length. + */ +bool Document::InsertString(int position, const char *s, size_t insertLength) { + bool changed = false; + if (insertLength > 0) { + char *sWithStyle = new char[insertLength * 2]; + if (sWithStyle) { + for (size_t i = 0; i < insertLength; i++) { + sWithStyle[i*2] = s[i]; + sWithStyle[i*2 + 1] = 0; + } + changed = InsertStyledString(position*2, sWithStyle, + static_cast(insertLength*2)); + delete []sWithStyle; + } + } + return changed; +} + +void Document::ChangeChar(int pos, char ch) { + DeleteChars(pos, 1); + InsertChar(pos, ch); +} + +void Document::DelChar(int pos) { + DeleteChars(pos, LenChar(pos)); +} + +void Document::DelCharBack(int pos) { + if (pos <= 0) { + return; + } else if (IsCrLf(pos - 2)) { + DeleteChars(pos - 2, 2); + } else if (dbcsCodePage) { + int startChar = MovePositionOutsideChar(pos - 1, -1, false); + DeleteChars(startChar, pos - startChar); + } else { + DeleteChars(pos - 1, 1); + } +} + +static bool isindentchar(char ch) { + return (ch == ' ') || (ch == '\t'); +} + +static int NextTab(int pos, int tabSize) { + return ((pos / tabSize) + 1) * tabSize; +} + +static void CreateIndentation(char *linebuf, int length, int indent, int tabSize, bool insertSpaces) { + length--; // ensure space for \0 + if (!insertSpaces) { + while ((indent >= tabSize) && (length > 0)) { + *linebuf++ = '\t'; + indent -= tabSize; + length--; + } + } + while ((indent > 0) && (length > 0)) { + *linebuf++ = ' '; + indent--; + length--; + } + *linebuf = '\0'; +} + +int Document::GetLineIndentation(int line) { + int indent = 0; + if ((line >= 0) && (line < LinesTotal())) { + int lineStart = LineStart(line); + int length = Length(); + for (int i = lineStart;i < length;i++) { + char ch = cb.CharAt(i); + if (ch == ' ') + indent++; + else if (ch == '\t') + indent = NextTab(indent, tabInChars); + else + return indent; + } + } + return indent; +} + +void Document::SetLineIndentation(int line, int indent) { + int indentOfLine = GetLineIndentation(line); + if (indent < 0) + indent = 0; + if (indent != indentOfLine) { + char linebuf[1000]; + CreateIndentation(linebuf, sizeof(linebuf), indent, tabInChars, !useTabs); + int thisLineStart = LineStart(line); + int indentPos = GetLineIndentPosition(line); + BeginUndoAction(); + DeleteChars(thisLineStart, indentPos - thisLineStart); + InsertString(thisLineStart, linebuf); + EndUndoAction(); + } +} + +int Document::GetLineIndentPosition(int line) { + if (line < 0) + return 0; + int pos = LineStart(line); + int length = Length(); + while ((pos < length) && isindentchar(cb.CharAt(pos))) { + pos++; + } + return pos; +} + +int Document::GetColumn(int pos) { + int column = 0; + int line = LineFromPosition(pos); + if ((line >= 0) && (line < LinesTotal())) { + for (int i = LineStart(line);i < pos;) { + char ch = cb.CharAt(i); + if (ch == '\t') { + column = NextTab(column, tabInChars); + i++; + } else if (ch == '\r') { + return column; + } else if (ch == '\n') { + return column; + } else { + column++; + i = MovePositionOutsideChar(i + 1, 1); + } + } + } + return column; +} + +int Document::FindColumn(int line, int column) { + int position = LineStart(line); + int columnCurrent = 0; + if ((line >= 0) && (line < LinesTotal())) { + while ((columnCurrent < column) && (position < Length())) { + char ch = cb.CharAt(position); + if (ch == '\t') { + columnCurrent = NextTab(columnCurrent, tabInChars); + position++; + } else if (ch == '\r') { + return position; + } else if (ch == '\n') { + return position; + } else { + columnCurrent++; + position = MovePositionOutsideChar(position + 1, 1); + } + } + } + return position; +} + +void Document::Indent(bool forwards, int lineBottom, int lineTop) { + // Dedent - suck white space off the front of the line to dedent by equivalent of a tab + for (int line = lineBottom; line >= lineTop; line--) { + int indentOfLine = GetLineIndentation(line); + if (forwards) { + if (LineStart(line) < LineEnd(line)) { + SetLineIndentation(line, indentOfLine + IndentSize()); + } + } else { + SetLineIndentation(line, indentOfLine - IndentSize()); + } + } +} + +// Convert line endings for a piece of text to a particular mode. +// Stop at len or when a NUL is found. +// Caller must delete the returned pointer. +char *Document::TransformLineEnds(int *pLenOut, const char *s, size_t len, int eolMode) { + char *dest = new char[2 * len + 1]; + const char *sptr = s; + char *dptr = dest; + for (size_t i = 0; (i < len) && (*sptr != '\0'); i++) { + if (*sptr == '\n' || *sptr == '\r') { + if (eolMode == SC_EOL_CR) { + *dptr++ = '\r'; + } else if (eolMode == SC_EOL_LF) { + *dptr++ = '\n'; + } else { // eolMode == SC_EOL_CRLF + *dptr++ = '\r'; + *dptr++ = '\n'; + } + if ((*sptr == '\r') && (i+1 < len) && (*(sptr+1) == '\n')) { + i++; + sptr++; + } + sptr++; + } else { + *dptr++ = *sptr++; + } + } + *dptr++ = '\0'; + *pLenOut = (dptr - dest) - 1; + return dest; +} + +void Document::ConvertLineEnds(int eolModeSet) { + BeginUndoAction(); + + for (int pos = 0; pos < Length(); pos++) { + if (cb.CharAt(pos) == '\r') { + if (cb.CharAt(pos + 1) == '\n') { + // CRLF + if (eolModeSet == SC_EOL_CR) { + DeleteChars(pos + 1, 1); // Delete the LF + } else if (eolModeSet == SC_EOL_LF) { + DeleteChars(pos, 1); // Delete the CR + } else { + pos++; + } + } else { + // CR + if (eolModeSet == SC_EOL_CRLF) { + InsertString(pos + 1, "\n", 1); // Insert LF + pos++; + } else if (eolModeSet == SC_EOL_LF) { + InsertString(pos, "\n", 1); // Insert LF + DeleteChars(pos + 1, 1); // Delete CR + } + } + } else if (cb.CharAt(pos) == '\n') { + // LF + if (eolModeSet == SC_EOL_CRLF) { + InsertString(pos, "\r", 1); // Insert CR + pos++; + } else if (eolModeSet == SC_EOL_CR) { + InsertString(pos, "\r", 1); // Insert CR + DeleteChars(pos + 1, 1); // Delete LF + } + } + } + + EndUndoAction(); +} + +bool Document::IsWhiteLine(int line) { + int currentChar = LineStart(line); + int endLine = LineEnd(line); + while (currentChar < endLine) { + if (cb.CharAt(currentChar) != ' ' && cb.CharAt(currentChar) != '\t') { + return false; + } + ++currentChar; + } + return true; +} + +int Document::ParaUp(int pos) { + int line = LineFromPosition(pos); + line--; + while (line >= 0 && IsWhiteLine(line)) { // skip empty lines + line--; + } + while (line >= 0 && !IsWhiteLine(line)) { // skip non-empty lines + line--; + } + line++; + return LineStart(line); +} + +int Document::ParaDown(int pos) { + int line = LineFromPosition(pos); + while (line < LinesTotal() && !IsWhiteLine(line)) { // skip non-empty lines + line++; + } + while (line < LinesTotal() && IsWhiteLine(line)) { // skip empty lines + line++; + } + if (line < LinesTotal()) + return LineStart(line); + else // end of a document + return LineEnd(line-1); +} + +CharClassify::cc Document::WordCharClass(unsigned char ch) { + if ((SC_CP_UTF8 == dbcsCodePage) && (ch >= 0x80)) + return CharClassify::ccWord; + return charClass.GetClass(ch); +} + +/** + * Used by commmands that want to select whole words. + * Finds the start of word at pos when delta < 0 or the end of the word when delta >= 0. + */ +int Document::ExtendWordSelect(int pos, int delta, bool onlyWordCharacters) { + CharClassify::cc ccStart = CharClassify::ccWord; + if (delta < 0) { + if (!onlyWordCharacters) + ccStart = WordCharClass(cb.CharAt(pos-1)); + while (pos > 0 && (WordCharClass(cb.CharAt(pos - 1)) == ccStart)) + pos--; + } else { + if (!onlyWordCharacters) + ccStart = WordCharClass(cb.CharAt(pos)); + while (pos < (Length()) && (WordCharClass(cb.CharAt(pos)) == ccStart)) + pos++; + } + return MovePositionOutsideChar(pos, delta); +} + +/** + * Find the start of the next word in either a forward (delta >= 0) or backwards direction + * (delta < 0). + * This is looking for a transition between character classes although there is also some + * additional movement to transit white space. + * Used by cursor movement by word commands. + */ +int Document::NextWordStart(int pos, int delta) { + if (delta < 0) { + while (pos > 0 && (WordCharClass(cb.CharAt(pos - 1)) == CharClassify::ccSpace)) + pos--; + if (pos > 0) { + CharClassify::cc ccStart = WordCharClass(cb.CharAt(pos-1)); + while (pos > 0 && (WordCharClass(cb.CharAt(pos - 1)) == ccStart)) { + pos--; + } + } + } else { + CharClassify::cc ccStart = WordCharClass(cb.CharAt(pos)); + while (pos < (Length()) && (WordCharClass(cb.CharAt(pos)) == ccStart)) + pos++; + while (pos < (Length()) && (WordCharClass(cb.CharAt(pos)) == CharClassify::ccSpace)) + pos++; + } + return pos; +} + +/** + * Find the end of the next word in either a forward (delta >= 0) or backwards direction + * (delta < 0). + * This is looking for a transition between character classes although there is also some + * additional movement to transit white space. + * Used by cursor movement by word commands. + */ +int Document::NextWordEnd(int pos, int delta) { + if (delta < 0) { + if (pos > 0) { + CharClassify::cc ccStart = WordCharClass(cb.CharAt(pos-1)); + if (ccStart != CharClassify::ccSpace) { + while (pos > 0 && WordCharClass(cb.CharAt(pos - 1)) == ccStart) { + pos--; + } + } + while (pos > 0 && WordCharClass(cb.CharAt(pos - 1)) == CharClassify::ccSpace) { + pos--; + } + } + } else { + while (pos < Length() && WordCharClass(cb.CharAt(pos)) == CharClassify::ccSpace) { + pos++; + } + if (pos < Length()) { + CharClassify::cc ccStart = WordCharClass(cb.CharAt(pos)); + while (pos < Length() && WordCharClass(cb.CharAt(pos)) == ccStart) { + pos++; + } + } + } + return pos; +} + +/** + * Check that the character at the given position is a word or punctuation character and that + * the previous character is of a different character class. + */ +bool Document::IsWordStartAt(int pos) { + if (pos > 0) { + CharClassify::cc ccPos = WordCharClass(CharAt(pos)); + return (ccPos == CharClassify::ccWord || ccPos == CharClassify::ccPunctuation) && + (ccPos != WordCharClass(CharAt(pos - 1))); + } + return true; +} + +/** + * Check that the character at the given position is a word or punctuation character and that + * the next character is of a different character class. + */ +bool Document::IsWordEndAt(int pos) { + if (pos < Length()) { + CharClassify::cc ccPrev = WordCharClass(CharAt(pos-1)); + return (ccPrev == CharClassify::ccWord || ccPrev == CharClassify::ccPunctuation) && + (ccPrev != WordCharClass(CharAt(pos))); + } + return true; +} + +/** + * Check that the given range is has transitions between character classes at both + * ends and where the characters on the inside are word or punctuation characters. + */ +bool Document::IsWordAt(int start, int end) { + return IsWordStartAt(start) && IsWordEndAt(end); +} + +// The comparison and case changing functions here assume ASCII +// or extended ASCII such as the normal Windows code page. + +static inline char MakeUpperCase(char ch) { + if (ch < 'a' || ch > 'z') + return ch; + else + return static_cast(ch - 'a' + 'A'); +} + +static inline char MakeLowerCase(char ch) { + if (ch < 'A' || ch > 'Z') + return ch; + else + return static_cast(ch - 'A' + 'a'); +} + +// Define a way for the Regular Expression code to access the document +class DocumentIndexer : public CharacterIndexer { + Document *pdoc; + int end; +public: + DocumentIndexer(Document *pdoc_, int end_) : + pdoc(pdoc_), end(end_) { + } + + virtual ~DocumentIndexer() { + } + + virtual char CharAt(int index) { + if (index < 0 || index >= end) + return 0; + else + return pdoc->CharAt(index); + } +}; + +/** + * Find text in document, supporting both forward and backward + * searches (just pass minPos > maxPos to do a backward search) + * Has not been tested with backwards DBCS searches yet. + */ +long Document::FindText(int minPos, int maxPos, const char *s, + bool caseSensitive, bool word, bool wordStart, bool regExp, bool posix, + int *length) { + if (regExp) { + if (!pre) + pre = new RESearch(&charClass); + if (!pre) + return -1; + + int increment = (minPos <= maxPos) ? 1 : -1; + + int startPos = minPos; + int endPos = maxPos; + + // Range endpoints should not be inside DBCS characters, but just in case, move them. + startPos = MovePositionOutsideChar(startPos, 1, false); + endPos = MovePositionOutsideChar(endPos, 1, false); + + const char *errmsg = pre->Compile(s, *length, caseSensitive, posix); + if (errmsg) { + return -1; + } + // Find a variable in a property file: \$(\([A-Za-z0-9_.]+\)) + // Replace first '.' with '-' in each property file variable reference: + // Search: \$(\([A-Za-z0-9_-]+\)\.\([A-Za-z0-9_.]+\)) + // Replace: $(\1-\2) + int lineRangeStart = LineFromPosition(startPos); + int lineRangeEnd = LineFromPosition(endPos); + if ((increment == 1) && + (startPos >= LineEnd(lineRangeStart)) && + (lineRangeStart < lineRangeEnd)) { + // the start position is at end of line or between line end characters. + lineRangeStart++; + startPos = LineStart(lineRangeStart); + } + int pos = -1; + int lenRet = 0; + char searchEnd = s[*length - 1]; + int lineRangeBreak = lineRangeEnd + increment; + for (int line = lineRangeStart; line != lineRangeBreak; line += increment) { + int startOfLine = LineStart(line); + int endOfLine = LineEnd(line); + if (increment == 1) { + if (line == lineRangeStart) { + if ((startPos != startOfLine) && (s[0] == '^')) + continue; // Can't match start of line if start position after start of line + startOfLine = startPos; + } + if (line == lineRangeEnd) { + if ((endPos != endOfLine) && (searchEnd == '$')) + continue; // Can't match end of line if end position before end of line + endOfLine = endPos; + } + } else { + if (line == lineRangeEnd) { + if ((endPos != startOfLine) && (s[0] == '^')) + continue; // Can't match start of line if end position after start of line + startOfLine = endPos; + } + if (line == lineRangeStart) { + if ((startPos != endOfLine) && (searchEnd == '$')) + continue; // Can't match end of line if start position before end of line + endOfLine = startPos; + } + } + + DocumentIndexer di(this, endOfLine); + int success = pre->Execute(di, startOfLine, endOfLine); + if (success) { + pos = pre->bopat[0]; + lenRet = pre->eopat[0] - pre->bopat[0]; + if (increment == -1) { + // Check for the last match on this line. + int repetitions = 1000; // Break out of infinite loop + while (success && (pre->eopat[0] <= endOfLine) && (repetitions--)) { + success = pre->Execute(di, pos+1, endOfLine); + if (success) { + if (pre->eopat[0] <= minPos) { + pos = pre->bopat[0]; + lenRet = pre->eopat[0] - pre->bopat[0]; + } else { + success = 0; + } + } + } + } + break; + } + } + *length = lenRet; + return pos; + + } else { + + bool forward = minPos <= maxPos; + int increment = forward ? 1 : -1; + + // Range endpoints should not be inside DBCS characters, but just in case, move them. + int startPos = MovePositionOutsideChar(minPos, increment, false); + int endPos = MovePositionOutsideChar(maxPos, increment, false); + + // Compute actual search ranges needed + int lengthFind = *length; + if (lengthFind == -1) + lengthFind = static_cast(strlen(s)); + int endSearch = endPos; + if (startPos <= endPos) { + endSearch = endPos - lengthFind + 1; + } + //Platform::DebugPrintf("Find %d %d %s %d\n", startPos, endPos, ft->lpstrText, lengthFind); + char firstChar = s[0]; + if (!caseSensitive) + firstChar = static_cast(MakeUpperCase(firstChar)); + int pos = forward ? startPos : (startPos - 1); + while (forward ? (pos < endSearch) : (pos >= endSearch)) { + char ch = CharAt(pos); + if (caseSensitive) { + if (ch == firstChar) { + bool found = true; + if (pos + lengthFind > Platform::Maximum(startPos, endPos)) found = false; + for (int posMatch = 1; posMatch < lengthFind && found; posMatch++) { + ch = CharAt(pos + posMatch); + if (ch != s[posMatch]) + found = false; + } + if (found) { + if ((!word && !wordStart) || + word && IsWordAt(pos, pos + lengthFind) || + wordStart && IsWordStartAt(pos)) + return pos; + } + } + } else { + if (MakeUpperCase(ch) == firstChar) { + bool found = true; + if (pos + lengthFind > Platform::Maximum(startPos, endPos)) found = false; + for (int posMatch = 1; posMatch < lengthFind && found; posMatch++) { + ch = CharAt(pos + posMatch); + if (MakeUpperCase(ch) != MakeUpperCase(s[posMatch])) + found = false; + } + if (found) { + if ((!word && !wordStart) || + word && IsWordAt(pos, pos + lengthFind) || + wordStart && IsWordStartAt(pos)) + return pos; + } + } + } + pos += increment; + if (dbcsCodePage && (pos >= 0)) { + // Ensure trying to match from start of character + pos = MovePositionOutsideChar(pos, increment, false); + } + } + } + //Platform::DebugPrintf("Not found\n"); + return -1; +} + +const char *Document::SubstituteByPosition(const char *text, int *length) { + if (!pre) + return 0; + delete []substituted; + substituted = 0; + DocumentIndexer di(this, Length()); + if (!pre->GrabMatches(di)) + return 0; + unsigned int lenResult = 0; + for (int i = 0; i < *length; i++) { + if (text[i] == '\\') { + if (text[i + 1] >= '1' && text[i + 1] <= '9') { + unsigned int patNum = text[i + 1] - '0'; + lenResult += pre->eopat[patNum] - pre->bopat[patNum]; + i++; + } else { + switch (text[i + 1]) { + case 'a': + case 'b': + case 'f': + case 'n': + case 'r': + case 't': + case 'v': + i++; + } + lenResult++; + } + } else { + lenResult++; + } + } + substituted = new char[lenResult + 1]; + if (!substituted) + return 0; + char *o = substituted; + for (int j = 0; j < *length; j++) { + if (text[j] == '\\') { + if (text[j + 1] >= '1' && text[j + 1] <= '9') { + unsigned int patNum = text[j + 1] - '0'; + unsigned int len = pre->eopat[patNum] - pre->bopat[patNum]; + if (pre->pat[patNum]) // Will be null if try for a match that did not occur + memcpy(o, pre->pat[patNum], len); + o += len; + j++; + } else { + j++; + switch (text[j]) { + case 'a': + *o++ = '\a'; + break; + case 'b': + *o++ = '\b'; + break; + case 'f': + *o++ = '\f'; + break; + case 'n': + *o++ = '\n'; + break; + case 'r': + *o++ = '\r'; + break; + case 't': + *o++ = '\t'; + break; + case 'v': + *o++ = '\v'; + break; + default: + *o++ = '\\'; + j--; + } + } + } else { + *o++ = text[j]; + } + } + *o = '\0'; + *length = lenResult; + return substituted; +} + +int Document::LinesTotal() { + return cb.Lines(); +} + +void Document::ChangeCase(Range r, bool makeUpperCase) { + for (int pos = r.start; pos < r.end;) { + int len = LenChar(pos); + if (len == 1) { + char ch = CharAt(pos); + if (makeUpperCase) { + if (IsLowerCase(ch)) { + ChangeChar(pos, static_cast(MakeUpperCase(ch))); + } + } else { + if (IsUpperCase(ch)) { + ChangeChar(pos, static_cast(MakeLowerCase(ch))); + } + } + } + pos += len; + } +} + +void Document::SetDefaultCharClasses(bool includeWordClass) { + charClass.SetDefaultCharClasses(includeWordClass); +} + +void Document::SetCharClasses(const unsigned char *chars, CharClassify::cc newCharClass) { + charClass.SetCharClasses(chars, newCharClass); +} + +void Document::SetStylingBits(int bits) { + stylingBits = bits; + stylingBitsMask = 0; + for (int bit = 0; bit < stylingBits; bit++) { + stylingBitsMask <<= 1; + stylingBitsMask |= 1; + } +} + +void Document::StartStyling(int position, char mask) { + stylingMask = mask; + endStyled = position; +} + +bool Document::SetStyleFor(int length, char style) { + if (enteredCount != 0) { + return false; + } else { + enteredCount++; + style &= stylingMask; + int prevEndStyled = endStyled; + if (cb.SetStyleFor(endStyled, length, style, stylingMask)) { + DocModification mh(SC_MOD_CHANGESTYLE | SC_PERFORMED_USER, + prevEndStyled, length); + NotifyModified(mh); + } + endStyled += length; + enteredCount--; + return true; + } +} + +bool Document::SetStyles(int length, char *styles) { + if (enteredCount != 0) { + return false; + } else { + enteredCount++; + bool didChange = false; + int startMod = 0; + int endMod = 0; + for (int iPos = 0; iPos < length; iPos++, endStyled++) { + PLATFORM_ASSERT(endStyled < Length()); + if (cb.SetStyleAt(endStyled, styles[iPos], stylingMask)) { + if (!didChange) { + startMod = endStyled; + } + didChange = true; + endMod = endStyled; + } + } + if (didChange) { + DocModification mh(SC_MOD_CHANGESTYLE | SC_PERFORMED_USER, + startMod, endMod - startMod + 1); + NotifyModified(mh); + } + enteredCount--; + return true; + } +} + +bool Document::EnsureStyledTo(int pos) { + if (pos > GetEndStyled()) { + IncrementStyleClock(); + // Ask the watchers to style, and stop as soon as one responds. + for (int i = 0; pos > GetEndStyled() && i < lenWatchers; i++) { + watchers[i].watcher->NotifyStyleNeeded(this, watchers[i].userData, pos); + } + } + return pos <= GetEndStyled(); +} + +void Document::IncrementStyleClock() { + styleClock++; + if (styleClock > 0x100000) { + styleClock = 0; + } +} + +bool Document::AddWatcher(DocWatcher *watcher, void *userData) { + for (int i = 0; i < lenWatchers; i++) { + if ((watchers[i].watcher == watcher) && + (watchers[i].userData == userData)) + return false; + } + WatcherWithUserData *pwNew = new WatcherWithUserData[lenWatchers + 1]; + if (!pwNew) + return false; + for (int j = 0; j < lenWatchers; j++) + pwNew[j] = watchers[j]; + pwNew[lenWatchers].watcher = watcher; + pwNew[lenWatchers].userData = userData; + delete []watchers; + watchers = pwNew; + lenWatchers++; + return true; +} + +bool Document::RemoveWatcher(DocWatcher *watcher, void *userData) { + for (int i = 0; i < lenWatchers; i++) { + if ((watchers[i].watcher == watcher) && + (watchers[i].userData == userData)) { + if (lenWatchers == 1) { + delete []watchers; + watchers = 0; + lenWatchers = 0; + } else { + WatcherWithUserData *pwNew = new WatcherWithUserData[lenWatchers]; + if (!pwNew) + return false; + for (int j = 0; j < lenWatchers - 1; j++) { + pwNew[j] = (j < i) ? watchers[j] : watchers[j + 1]; + } + delete []watchers; + watchers = pwNew; + lenWatchers--; + } + return true; + } + } + return false; +} + +void Document::NotifyModifyAttempt() { + for (int i = 0; i < lenWatchers; i++) { + watchers[i].watcher->NotifyModifyAttempt(this, watchers[i].userData); + } +} + +void Document::NotifySavePoint(bool atSavePoint) { + for (int i = 0; i < lenWatchers; i++) { + watchers[i].watcher->NotifySavePoint(this, watchers[i].userData, atSavePoint); + } +} + +void Document::NotifyModified(DocModification mh) { + for (int i = 0; i < lenWatchers; i++) { + watchers[i].watcher->NotifyModified(this, mh, watchers[i].userData); + } +} + +bool Document::IsWordPartSeparator(char ch) { + return (WordCharClass(ch) == CharClassify::ccWord) && IsPunctuation(ch); +} + +int Document::WordPartLeft(int pos) { + if (pos > 0) { + --pos; + char startChar = cb.CharAt(pos); + if (IsWordPartSeparator(startChar)) { + while (pos > 0 && IsWordPartSeparator(cb.CharAt(pos))) { + --pos; + } + } + if (pos > 0) { + startChar = cb.CharAt(pos); + --pos; + if (IsLowerCase(startChar)) { + while (pos > 0 && IsLowerCase(cb.CharAt(pos))) + --pos; + if (!IsUpperCase(cb.CharAt(pos)) && !IsLowerCase(cb.CharAt(pos))) + ++pos; + } else if (IsUpperCase(startChar)) { + while (pos > 0 && IsUpperCase(cb.CharAt(pos))) + --pos; + if (!IsUpperCase(cb.CharAt(pos))) + ++pos; + } else if (IsADigit(startChar)) { + while (pos > 0 && IsADigit(cb.CharAt(pos))) + --pos; + if (!IsADigit(cb.CharAt(pos))) + ++pos; + } else if (IsPunctuation(startChar)) { + while (pos > 0 && IsPunctuation(cb.CharAt(pos))) + --pos; + if (!IsPunctuation(cb.CharAt(pos))) + ++pos; + } else if (isspacechar(startChar)) { + while (pos > 0 && isspacechar(cb.CharAt(pos))) + --pos; + if (!isspacechar(cb.CharAt(pos))) + ++pos; + } else if (!isascii(startChar)) { + while (pos > 0 && !isascii(cb.CharAt(pos))) + --pos; + if (isascii(cb.CharAt(pos))) + ++pos; + } else { + ++pos; + } + } + } + return pos; +} + +int Document::WordPartRight(int pos) { + char startChar = cb.CharAt(pos); + int length = Length(); + if (IsWordPartSeparator(startChar)) { + while (pos < length && IsWordPartSeparator(cb.CharAt(pos))) + ++pos; + startChar = cb.CharAt(pos); + } + if (!isascii(startChar)) { + while (pos < length && !isascii(cb.CharAt(pos))) + ++pos; + } else if (IsLowerCase(startChar)) { + while (pos < length && IsLowerCase(cb.CharAt(pos))) + ++pos; + } else if (IsUpperCase(startChar)) { + if (IsLowerCase(cb.CharAt(pos + 1))) { + ++pos; + while (pos < length && IsLowerCase(cb.CharAt(pos))) + ++pos; + } else { + while (pos < length && IsUpperCase(cb.CharAt(pos))) + ++pos; + } + if (IsLowerCase(cb.CharAt(pos)) && IsUpperCase(cb.CharAt(pos - 1))) + --pos; + } else if (IsADigit(startChar)) { + while (pos < length && IsADigit(cb.CharAt(pos))) + ++pos; + } else if (IsPunctuation(startChar)) { + while (pos < length && IsPunctuation(cb.CharAt(pos))) + ++pos; + } else if (isspacechar(startChar)) { + while (pos < length && isspacechar(cb.CharAt(pos))) + ++pos; + } else { + ++pos; + } + return pos; +} + +bool IsLineEndChar(char c) { + return (c == '\n' || c == '\r'); +} + +int Document::ExtendStyleRange(int pos, int delta, bool singleLine) { + int sStart = cb.StyleAt(pos); + if (delta < 0) { + while (pos > 0 && (cb.StyleAt(pos) == sStart) && (!singleLine || !IsLineEndChar(cb.CharAt(pos))) ) + pos--; + pos++; + } else { + while (pos < (Length()) && (cb.StyleAt(pos) == sStart) && (!singleLine || !IsLineEndChar(cb.CharAt(pos))) ) + pos++; + } + return pos; +} + +static char BraceOpposite(char ch) { + switch (ch) { + case '(': + return ')'; + case ')': + return '('; + case '[': + return ']'; + case ']': + return '['; + case '{': + return '}'; + case '}': + return '{'; + case '<': + return '>'; + case '>': + return '<'; + default: + return '\0'; + } +} + +// TODO: should be able to extend styled region to find matching brace +int Document::BraceMatch(int position, int /*maxReStyle*/) { + char chBrace = CharAt(position); + char chSeek = BraceOpposite(chBrace); + if (chSeek == '\0') + return - 1; + char styBrace = static_cast(StyleAt(position) & stylingBitsMask); + int direction = -1; + if (chBrace == '(' || chBrace == '[' || chBrace == '{' || chBrace == '<') + direction = 1; + int depth = 1; + position = position + direction; + while ((position >= 0) && (position < Length())) { + position = MovePositionOutsideChar(position, direction); + char chAtPos = CharAt(position); + char styAtPos = static_cast(StyleAt(position) & stylingBitsMask); + if ((position > GetEndStyled()) || (styAtPos == styBrace)) { + if (chAtPos == chBrace) + depth++; + if (chAtPos == chSeek) + depth--; + if (depth == 0) + return position; + } + position = position + direction; + } + return - 1; +} diff --git a/src/Document.h b/src/Document.h new file mode 100755 index 0000000..d774d56 --- /dev/null +++ b/src/Document.h @@ -0,0 +1,305 @@ +// Scintilla source code edit control +/** @file Document.h + ** Text document that handles notifications, DBCS, styling, words and end of line. + **/ +// Copyright 1998-2003 by Neil Hodgson +// The License.txt file describes the conditions under which this software may be distributed. + +#ifndef DOCUMENT_H +#define DOCUMENT_H + +/** + * A Position is a position within a document between two characters or at the beginning or end. + * Sometimes used as a character index where it identifies the character after the position. + */ +typedef int Position; +const Position invalidPosition = -1; + +/** + * The range class represents a range of text in a document. + * The two values are not sorted as one end may be more significant than the other + * as is the case for the selection where the end position is the position of the caret. + * If either position is invalidPosition then the range is invalid and most operations will fail. + */ +class Range { +public: + Position start; + Position end; + + Range(Position pos=0) : + start(pos), end(pos) { + }; + Range(Position start_, Position end_) : + start(start_), end(end_) { + }; + + bool Valid() const { + return (start != invalidPosition) && (end != invalidPosition); + } + + // Is the position within the range? + bool Contains(Position pos) const { + if (start < end) { + return (pos >= start && pos <= end); + } else { + return (pos <= start && pos >= end); + } + } + + // Is the character after pos within the range? + bool ContainsCharacter(Position pos) const { + if (start < end) { + return (pos >= start && pos < end); + } else { + return (pos < start && pos >= end); + } + } + + bool Contains(Range other) const { + return Contains(other.start) && Contains(other.end); + } + + bool Overlaps(Range other) const { + return + Contains(other.start) || + Contains(other.end) || + other.Contains(start) || + other.Contains(end); + } +}; + +class DocWatcher; +class DocModification; +class RESearch; + +/** + */ +class Document { + +public: + /** Used to pair watcher pointer with user data. */ + class WatcherWithUserData { + public: + DocWatcher *watcher; + void *userData; + WatcherWithUserData() { + watcher = 0; + userData = 0; + } + }; + + enum charClassification { ccSpace, ccNewLine, ccWord, ccPunctuation }; + +private: + int refCount; + CellBuffer cb; + CharClassify charClass; + char stylingMask; + int endStyled; + int styleClock; + int enteredCount; + int enteredReadOnlyCount; + + WatcherWithUserData *watchers; + int lenWatchers; + + bool matchesValid; + RESearch *pre; + char *substituted; + +public: + int stylingBits; + int stylingBitsMask; + + int eolMode; + /// Can also be SC_CP_UTF8 to enable UTF-8 mode + int dbcsCodePage; + int tabInChars; + int indentInChars; + int actualIndentInChars; + bool useTabs; + bool tabIndents; + bool backspaceUnindents; + + Document(); + virtual ~Document(); + + int AddRef(); + int Release(); + + int LineFromPosition(int pos); + int ClampPositionIntoDocument(int pos); + bool IsCrLf(int pos); + int LenChar(int pos); + int MovePositionOutsideChar(int pos, int moveDir, bool checkLineEnd=true); + + // Gateways to modifying document + void ModifiedAt(int pos); + bool DeleteChars(int pos, int len); + bool InsertStyledString(int position, char *s, int insertLength); + int Undo(); + int Redo(); + bool CanUndo() { return cb.CanUndo(); } + bool CanRedo() { return cb.CanRedo(); } + void DeleteUndoHistory() { cb.DeleteUndoHistory(); } + bool SetUndoCollection(bool collectUndo) { + return cb.SetUndoCollection(collectUndo); + } + bool IsCollectingUndo() { return cb.IsCollectingUndo(); } + void BeginUndoAction() { cb.BeginUndoAction(); } + void EndUndoAction() { cb.EndUndoAction(); } + void SetSavePoint(); + bool IsSavePoint() { return cb.IsSavePoint(); } + + int GetLineIndentation(int line); + void SetLineIndentation(int line, int indent); + int GetLineIndentPosition(int line); + int GetColumn(int position); + int FindColumn(int line, int column); + void Indent(bool forwards, int lineBottom, int lineTop); + static char *TransformLineEnds(int *pLenOut, const char *s, size_t len, int eolMode); + void ConvertLineEnds(int eolModeSet); + void SetReadOnly(bool set) { cb.SetReadOnly(set); } + bool IsReadOnly() { return cb.IsReadOnly(); } + + bool InsertChar(int pos, char ch); + bool InsertString(int position, const char *s); + bool InsertString(int position, const char *s, size_t insertLength); + void ChangeChar(int pos, char ch); + void DelChar(int pos); + void DelCharBack(int pos); + + char CharAt(int position) { return cb.CharAt(position); } + void GetCharRange(char *buffer, int position, int lengthRetrieve) { + cb.GetCharRange(buffer, position, lengthRetrieve); + } + char StyleAt(int position) { return cb.StyleAt(position); } + int GetMark(int line) { return cb.GetMark(line); } + int AddMark(int line, int markerNum); + void AddMarkSet(int line, int valueSet); + void DeleteMark(int line, int markerNum); + void DeleteMarkFromHandle(int markerHandle); + void DeleteAllMarks(int markerNum); + int LineFromHandle(int markerHandle) { return cb.LineFromHandle(markerHandle); } + int LineStart(int line); + int LineEnd(int line); + int LineEndPosition(int position); + int VCHomePosition(int position); + + int SetLevel(int line, int level); + int GetLevel(int line) { return cb.GetLevel(line); } + void ClearLevels() { cb.ClearLevels(); } + int GetLastChild(int lineParent, int level=-1); + int GetFoldParent(int line); + + void Indent(bool forwards); + int ExtendWordSelect(int pos, int delta, bool onlyWordCharacters=false); + int NextWordStart(int pos, int delta); + int NextWordEnd(int pos, int delta); + int Length() { return cb.Length(); } + void Allocate(int newSize) { cb.Allocate(newSize*2); } + long FindText(int minPos, int maxPos, const char *s, + bool caseSensitive, bool word, bool wordStart, bool regExp, bool posix, int *length); + long FindText(int iMessage, unsigned long wParam, long lParam); + const char *SubstituteByPosition(const char *text, int *length); + int LinesTotal(); + + void ChangeCase(Range r, bool makeUpperCase); + + void SetDefaultCharClasses(bool includeWordClass); + void SetCharClasses(const unsigned char *chars, CharClassify::cc newCharClass); + void SetStylingBits(int bits); + void StartStyling(int position, char mask); + bool SetStyleFor(int length, char style); + bool SetStyles(int length, char *styles); + int GetEndStyled() { return endStyled; } + bool EnsureStyledTo(int pos); + int GetStyleClock() { return styleClock; } + void IncrementStyleClock(); + + int SetLineState(int line, int state) { return cb.SetLineState(line, state); } + int GetLineState(int line) { return cb.GetLineState(line); } + int GetMaxLineState() { return cb.GetMaxLineState(); } + + bool AddWatcher(DocWatcher *watcher, void *userData); + bool RemoveWatcher(DocWatcher *watcher, void *userData); + const WatcherWithUserData *GetWatchers() const { return watchers; } + int GetLenWatchers() const { return lenWatchers; } + + bool IsWordPartSeparator(char ch); + int WordPartLeft(int pos); + int WordPartRight(int pos); + int ExtendStyleRange(int pos, int delta, bool singleLine = false); + bool IsWhiteLine(int line); + int ParaUp(int pos); + int ParaDown(int pos); + int IndentSize() { return actualIndentInChars; } + int BraceMatch(int position, int maxReStyle); + +private: + void CheckReadOnly(); + + CharClassify::cc WordCharClass(unsigned char ch); + bool IsWordStartAt(int pos); + bool IsWordEndAt(int pos); + bool IsWordAt(int start, int end); + + void NotifyModifyAttempt(); + void NotifySavePoint(bool atSavePoint); + void NotifyModified(DocModification mh); +}; + +/** + * To optimise processing of document modifications by DocWatchers, a hint is passed indicating the + * scope of the change. + * If the DocWatcher is a document view then this can be used to optimise screen updating. + */ +class DocModification { +public: + int modificationType; + int position; + int length; + int linesAdded; /**< Negative if lines deleted. */ + const char *text; /**< Only valid for changes to text, not for changes to style. */ + int line; + int foldLevelNow; + int foldLevelPrev; + + DocModification(int modificationType_, int position_=0, int length_=0, + int linesAdded_=0, const char *text_=0, int line_=0) : + modificationType(modificationType_), + position(position_), + length(length_), + linesAdded(linesAdded_), + text(text_), + line(line_), + foldLevelNow(0), + foldLevelPrev(0) {} + + DocModification(int modificationType_, const Action &act, int linesAdded_=0) : + modificationType(modificationType_), + position(act.position), + length(act.lenData), + linesAdded(linesAdded_), + text(act.data), + line(0), + foldLevelNow(0), + foldLevelPrev(0) {} +}; + +/** + * A class that wants to receive notifications from a Document must be derived from DocWatcher + * and implement the notification methods. It can then be added to the watcher list with AddWatcher. + */ +class DocWatcher { +public: + virtual ~DocWatcher() {} + + virtual void NotifyModifyAttempt(Document *doc, void *userData) = 0; + virtual void NotifySavePoint(Document *doc, void *userData, bool atSavePoint) = 0; + virtual void NotifyModified(Document *doc, DocModification mh, void *userData) = 0; + virtual void NotifyDeleted(Document *doc, void *userData) = 0; + virtual void NotifyStyleNeeded(Document *doc, void *userData, int endPos) = 0; +}; + +#endif diff --git a/src/DocumentAccessor.cpp b/src/DocumentAccessor.cpp new file mode 100755 index 0000000..c695c5f --- /dev/null +++ b/src/DocumentAccessor.cpp @@ -0,0 +1,187 @@ +// Scintilla source code edit control +/** @file DocumentAccessor.cxx + ** Rapid easy access to contents of a Scintilla. + **/ +// Copyright 1998-2001 by Neil Hodgson +// The License.txt file describes the conditions under which this software may be distributed. + +#include +#include +#include +#include + +#include "Platform.h" + +#include "PropSet.h" +#include "SVector.h" +#include "Accessor.h" +#include "DocumentAccessor.h" +#include "CellBuffer.h" +#include "Scintilla.h" +#include "CharClassify.h" +#include "Document.h" + +DocumentAccessor::~DocumentAccessor() { +} + +bool DocumentAccessor::InternalIsLeadByte(char ch) { + if (SC_CP_UTF8 == codePage) + // For lexing, all characters >= 0x80 are treated the + // same so none is considered a lead byte. + return false; + else + return Platform::IsDBCSLeadByte(codePage, ch); +} + +void DocumentAccessor::Fill(int position) { + if (lenDoc == -1) + lenDoc = pdoc->Length(); + startPos = position - slopSize; + if (startPos + bufferSize > lenDoc) + startPos = lenDoc - bufferSize; + if (startPos < 0) + startPos = 0; + endPos = startPos + bufferSize; + if (endPos > lenDoc) + endPos = lenDoc; + + pdoc->GetCharRange(buf, startPos, endPos-startPos); + buf[endPos-startPos] = '\0'; +} + +bool DocumentAccessor::Match(int pos, const char *s) { + for (int i=0; *s; i++) { + if (*s != SafeGetCharAt(pos+i)) + return false; + s++; + } + return true; +} + +char DocumentAccessor::StyleAt(int position) { + // Mask off all bits which aren't in the 'mask'. + return static_cast(pdoc->StyleAt(position) & mask); +} + +int DocumentAccessor::GetLine(int position) { + return pdoc->LineFromPosition(position); +} + +int DocumentAccessor::LineStart(int line) { + return pdoc->LineStart(line); +} + +int DocumentAccessor::LevelAt(int line) { + return pdoc->GetLevel(line); +} + +int DocumentAccessor::Length() { + if (lenDoc == -1) + lenDoc = pdoc->Length(); + return lenDoc; +} + +int DocumentAccessor::GetLineState(int line) { + return pdoc->GetLineState(line); +} + +int DocumentAccessor::SetLineState(int line, int state) { + return pdoc->SetLineState(line, state); +} + +void DocumentAccessor::StartAt(unsigned int start, char chMask) { + // Store the mask specified for use with StyleAt. + mask = chMask; + pdoc->StartStyling(start, chMask); + startPosStyling = start; +} + +void DocumentAccessor::StartSegment(unsigned int pos) { + startSeg = pos; +} + +void DocumentAccessor::ColourTo(unsigned int pos, int chAttr) { + // Only perform styling if non empty range + if (pos != startSeg - 1) { + if (pos < startSeg) { + Platform::DebugPrintf("Bad colour positions %d - %d\n", startSeg, pos); + } + + if (validLen + (pos - startSeg + 1) >= bufferSize) + Flush(); + if (validLen + (pos - startSeg + 1) >= bufferSize) { + // Too big for buffer so send directly + pdoc->SetStyleFor(pos - startSeg + 1, static_cast(chAttr)); + } else { + if (chAttr != chWhile) + chFlags = 0; + chAttr |= chFlags; + for (unsigned int i = startSeg; i <= pos; i++) { + PLATFORM_ASSERT((startPosStyling + validLen) < Length()); + styleBuf[validLen++] = static_cast(chAttr); + } + } + } + startSeg = pos+1; +} + +void DocumentAccessor::SetLevel(int line, int level) { + pdoc->SetLevel(line, level); +} + +void DocumentAccessor::Flush() { + startPos = extremePosition; + lenDoc = -1; + if (validLen > 0) { + pdoc->SetStyles(validLen, styleBuf); + startPosStyling += validLen; + validLen = 0; + } +} + +int DocumentAccessor::IndentAmount(int line, int *flags, PFNIsCommentLeader pfnIsCommentLeader) { + int end = Length(); + int spaceFlags = 0; + + // Determines the indentation level of the current line and also checks for consistent + // indentation compared to the previous line. + // Indentation is judged consistent when the indentation whitespace of each line lines + // the same or the indentation of one line is a prefix of the other. + + int pos = LineStart(line); + char ch = (*this)[pos]; + int indent = 0; + bool inPrevPrefix = line > 0; + int posPrev = inPrevPrefix ? LineStart(line-1) : 0; + while ((ch == ' ' || ch == '\t') && (pos < end)) { + if (inPrevPrefix) { + char chPrev = (*this)[posPrev++]; + if (chPrev == ' ' || chPrev == '\t') { + if (chPrev != ch) + spaceFlags |= wsInconsistent; + } else { + inPrevPrefix = false; + } + } + if (ch == ' ') { + spaceFlags |= wsSpace; + indent++; + } else { // Tab + spaceFlags |= wsTab; + if (spaceFlags & wsSpace) + spaceFlags |= wsSpaceTab; + indent = (indent / 8 + 1) * 8; + } + ch = (*this)[++pos]; + } + + *flags = spaceFlags; + indent += SC_FOLDLEVELBASE; + // if completely empty line or the start of a comment... + if ((ch == ' ' || ch == '\t' || ch == '\n' || ch == '\r') || + (pfnIsCommentLeader && (*pfnIsCommentLeader)(*this, pos, end-pos)) ) + return indent | SC_FOLDLEVELWHITEFLAG; + else + return indent; +} + diff --git a/src/DocumentAccessor.h b/src/DocumentAccessor.h new file mode 100755 index 0000000..7406520 --- /dev/null +++ b/src/DocumentAccessor.h @@ -0,0 +1,67 @@ +// Scintilla source code edit control +/** @file DocumentAccessor.h + ** Implementation of BufferAccess and StylingAccess on a Scintilla + ** rapid easy access to contents of a Scintilla. + **/ +// Copyright 1998-2001 by Neil Hodgson +// The License.txt file describes the conditions under which this software may be distributed. + +class Document; + +/** + */ +class DocumentAccessor : public Accessor { + // Private so DocumentAccessor objects can not be copied + DocumentAccessor(const DocumentAccessor &source) : Accessor(), props(source.props) {} + DocumentAccessor &operator=(const DocumentAccessor &) { return *this; } + +protected: + Document *pdoc; + PropSet &props; + WindowID id; + int lenDoc; + + char styleBuf[bufferSize]; + int validLen; + char chFlags; + char chWhile; + unsigned int startSeg; + int startPosStyling; + int mask; + + bool InternalIsLeadByte(char ch); + void Fill(int position); + +public: + DocumentAccessor(Document *pdoc_, PropSet &props_, WindowID id_=0) : + Accessor(), pdoc(pdoc_), props(props_), id(id_), + lenDoc(-1), validLen(0), chFlags(0), chWhile(0), + startSeg(0), startPosStyling(0), + mask(127) { // Initialize the mask to be big enough for any lexer. + } + ~DocumentAccessor(); + bool Match(int pos, const char *s); + char StyleAt(int position); + int GetLine(int position); + int LineStart(int line); + int LevelAt(int line); + int Length(); + void Flush(); + int GetLineState(int line); + int SetLineState(int line, int state); + int GetPropertyInt(const char *key, int defaultValue=0) { + return props.GetInt(key, defaultValue); + } + char *GetProperties() { + return props.ToString(); + } + WindowID GetWindow() { return id; } + + void StartAt(unsigned int start, char chMask=31); + void SetFlags(char chFlags_, char chWhile_) {chFlags = chFlags_; chWhile = chWhile_; }; + unsigned int GetStartSegment() { return startSeg; } + void StartSegment(unsigned int pos); + void ColourTo(unsigned int pos, int chAttr); + void SetLevel(int line, int level); + int IndentAmount(int line, int *flags, PFNIsCommentLeader pfnIsCommentLeader = 0); +}; diff --git a/src/Editor.cpp b/src/Editor.cpp new file mode 100755 index 0000000..67440f1 --- /dev/null +++ b/src/Editor.cpp @@ -0,0 +1,7299 @@ +// Scintilla source code edit control +/** @file Editor.cxx + ** Main code for the edit control. + **/ +// Copyright 1998-2004 by Neil Hodgson +// The License.txt file describes the conditions under which this software may be distributed. + +#include +#include +#include +#include + +#include "Platform.h" + +#ifndef PLAT_QT +#define INCLUDE_DEPRECATED_FEATURES +#endif +#include "Scintilla.h" + +#include "ContractionState.h" +#include "SVector.h" +#include "CellBuffer.h" +#include "KeyMap.h" +#include "Indicator.h" +#include "XPM.h" +#include "LineMarker.h" +#include "Style.h" +#include "ViewStyle.h" +#include "CharClassify.h" +#include "Document.h" +#include "Editor.h" + +/* + return whether this modification represents an operation that + may reasonably be deferred (not done now OR [possibly] at all) +*/ +static bool CanDeferToLastStep(const DocModification& mh) { + if (mh.modificationType & (SC_MOD_BEFOREINSERT|SC_MOD_BEFOREDELETE)) + return true; // CAN skip + if (!(mh.modificationType & (SC_PERFORMED_UNDO|SC_PERFORMED_REDO))) + return false; // MUST do + if (mh.modificationType & SC_MULTISTEPUNDOREDO) + return true; // CAN skip + return false; // PRESUMABLY must do +} + +static bool CanEliminate(const DocModification& mh) { + return + (mh.modificationType & (SC_MOD_BEFOREINSERT|SC_MOD_BEFOREDELETE)) != 0; +} + +/* + return whether this modification represents the FINAL step + in a [possibly lengthy] multi-step Undo/Redo sequence +*/ +static bool IsLastStep(const DocModification& mh) { + return + (mh.modificationType & (SC_PERFORMED_UNDO|SC_PERFORMED_REDO)) != 0 + && (mh.modificationType & SC_MULTISTEPUNDOREDO) != 0 + && (mh.modificationType & SC_LASTSTEPINUNDOREDO) != 0 + && (mh.modificationType & SC_MULTILINEUNDOREDO) != 0; +} + +Caret::Caret() : +active(false), on(false), period(500) {} + +Timer::Timer() : +ticking(false), ticksToWait(0), tickerID(0) {} + +Idler::Idler() : +state(false), idlerID(0) {} + +LineLayout::LineLayout(int maxLineLength_) : + lineStarts(0), + lenLineStarts(0), + lineNumber(-1), + inCache(false), + maxLineLength(-1), + numCharsInLine(0), + validity(llInvalid), + xHighlightGuide(0), + highlightColumn(0), + selStart(0), + selEnd(0), + containsCaret(false), + edgeColumn(0), + chars(0), + styles(0), + styleBitsSet(0), + indicators(0), + positions(0), + hsStart(0), + hsEnd(0), + widthLine(wrapWidthInfinite), + lines(1) { + Resize(maxLineLength_); +} + +LineLayout::~LineLayout() { + Free(); +} + +void LineLayout::Resize(int maxLineLength_) { + if (maxLineLength_ > maxLineLength) { + Free(); + chars = new char[maxLineLength_ + 1]; + styles = new unsigned char[maxLineLength_ + 1]; + indicators = new char[maxLineLength_ + 1]; + // Extra position allocated as sometimes the Windows + // GetTextExtentExPoint API writes an extra element. + positions = new int[maxLineLength_ + 1 + 1]; + maxLineLength = maxLineLength_; + } +} + +void LineLayout::Free() { + delete []chars; + chars = 0; + delete []styles; + styles = 0; + delete []indicators; + indicators = 0; + delete []positions; + positions = 0; + delete []lineStarts; + lineStarts = 0; +} + +void LineLayout::Invalidate(validLevel validity_) { + if (validity > validity_) + validity = validity_; +} + +void LineLayout::SetLineStart(int line, int start) { + if ((line >= lenLineStarts) && (line != 0)) { + int newMaxLines = line + 20; + int *newLineStarts = new int[newMaxLines]; + if (!newLineStarts) + return; + for (int i = 0; i < newMaxLines; i++) { + if (i < lenLineStarts) + newLineStarts[i] = lineStarts[i]; + else + newLineStarts[i] = 0; + } + delete []lineStarts; + lineStarts = newLineStarts; + lenLineStarts = newMaxLines; + } + lineStarts[line] = start; +} + +void LineLayout::SetBracesHighlight(Range rangeLine, Position braces[], + char bracesMatchStyle, int xHighlight) { + if (rangeLine.ContainsCharacter(braces[0])) { + int braceOffset = braces[0] - rangeLine.start; + if (braceOffset < numCharsInLine) { + bracePreviousStyles[0] = styles[braceOffset]; + styles[braceOffset] = bracesMatchStyle; + } + } + if (rangeLine.ContainsCharacter(braces[1])) { + int braceOffset = braces[1] - rangeLine.start; + if (braceOffset < numCharsInLine) { + bracePreviousStyles[1] = styles[braceOffset]; + styles[braceOffset] = bracesMatchStyle; + } + } + if ((braces[0] >= rangeLine.start && braces[1] <= rangeLine.end) || + (braces[1] >= rangeLine.start && braces[0] <= rangeLine.end)) { + xHighlightGuide = xHighlight; + } +} + +void LineLayout::RestoreBracesHighlight(Range rangeLine, Position braces[]) { + if (rangeLine.ContainsCharacter(braces[0])) { + int braceOffset = braces[0] - rangeLine.start; + if (braceOffset < numCharsInLine) { + styles[braceOffset] = bracePreviousStyles[0]; + } + } + if (rangeLine.ContainsCharacter(braces[1])) { + int braceOffset = braces[1] - rangeLine.start; + if (braceOffset < numCharsInLine) { + styles[braceOffset] = bracePreviousStyles[1]; + } + } + xHighlightGuide = 0; +} + +LineLayoutCache::LineLayoutCache() : + level(0), length(0), size(0), cache(0), + allInvalidated(false), styleClock(-1), useCount(0) { + Allocate(0); +} + +LineLayoutCache::~LineLayoutCache() { + Deallocate(); +} + +void LineLayoutCache::Allocate(int length_) { + PLATFORM_ASSERT(cache == NULL); + allInvalidated = false; + length = length_; + size = length; + if (size > 1) { + size = (size / 16 + 1) * 16; + } + if (size > 0) { + cache = new LineLayout * [size]; + } + for (int i = 0; i < size; i++) + cache[i] = 0; +} + +void LineLayoutCache::AllocateForLevel(int linesOnScreen, int linesInDoc) { + PLATFORM_ASSERT(useCount == 0); + int lengthForLevel = 0; + if (level == llcCaret) { + lengthForLevel = 1; + } else if (level == llcPage) { + lengthForLevel = linesOnScreen + 1; + } else if (level == llcDocument) { + lengthForLevel = linesInDoc; + } + if (lengthForLevel > size) { + Deallocate(); + Allocate(lengthForLevel); + } else { + if (lengthForLevel < length) { + for (int i = lengthForLevel; i < length; i++) { + delete cache[i]; + cache[i] = 0; + } + } + length = lengthForLevel; + } + PLATFORM_ASSERT(length == lengthForLevel); + PLATFORM_ASSERT(cache != NULL || length == 0); +} + +void LineLayoutCache::Deallocate() { + PLATFORM_ASSERT(useCount == 0); + for (int i = 0; i < length; i++) + delete cache[i]; + delete []cache; + cache = 0; + length = 0; + size = 0; +} + +void LineLayoutCache::Invalidate(LineLayout::validLevel validity_) { + if (cache && !allInvalidated) { + for (int i = 0; i < length; i++) { + if (cache[i]) { + cache[i]->Invalidate(validity_); + } + } + if (validity_ == LineLayout::llInvalid) { + allInvalidated = true; + } + } +} + +void LineLayoutCache::SetLevel(int level_) { + allInvalidated = false; + if ((level_ != -1) && (level != level_)) { + level = level_; + Deallocate(); + } +} + +LineLayout *LineLayoutCache::Retrieve(int lineNumber, int lineCaret, int maxChars, int styleClock_, + int linesOnScreen, int linesInDoc) { + AllocateForLevel(linesOnScreen, linesInDoc); + if (styleClock != styleClock_) { + Invalidate(LineLayout::llCheckTextAndStyle); + styleClock = styleClock_; + } + allInvalidated = false; + int pos = -1; + LineLayout *ret = 0; + if (level == llcCaret) { + pos = 0; + } else if (level == llcPage) { + if (lineNumber == lineCaret) { + pos = 0; + } else if (length > 1) { + pos = 1 + (lineNumber % (length - 1)); + } + } else if (level == llcDocument) { + pos = lineNumber; + } + if (pos >= 0) { + PLATFORM_ASSERT(useCount == 0); + if (cache && (pos < length)) { + if (cache[pos]) { + if ((cache[pos]->lineNumber != lineNumber) || + (cache[pos]->maxLineLength < maxChars)) { + delete cache[pos]; + cache[pos] = 0; + } + } + if (!cache[pos]) { + cache[pos] = new LineLayout(maxChars); + } + if (cache[pos]) { + cache[pos]->lineNumber = lineNumber; + cache[pos]->inCache = true; + ret = cache[pos]; + useCount++; + } + } + } + + if (!ret) { + ret = new LineLayout(maxChars); + ret->lineNumber = lineNumber; + } + + return ret; +} + +void LineLayoutCache::Dispose(LineLayout *ll) { + allInvalidated = false; + if (ll) { + if (!ll->inCache) { + delete ll; + } else { + useCount--; + } + } +} + +Editor::Editor() { + ctrlID = 0; + + stylesValid = false; + + printMagnification = 0; + printColourMode = SC_PRINT_NORMAL; + printWrapState = eWrapWord; + cursorMode = SC_CURSORNORMAL; + controlCharSymbol = 0; /* Draw the control characters */ + + hasFocus = false; + hideSelection = false; + inOverstrike = false; + errorStatus = 0; + mouseDownCaptures = true; + + bufferedDraw = true; + twoPhaseDraw = true; + + lastClickTime = 0; + dwellDelay = SC_TIME_FOREVER; + ticksToDwell = SC_TIME_FOREVER; + dwelling = false; + ptMouseLast.x = 0; + ptMouseLast.y = 0; + inDragDrop = false; + dropWentOutside = false; + posDrag = invalidPosition; + posDrop = invalidPosition; + selectionType = selChar; + + lastXChosen = 0; + lineAnchor = 0; + originalAnchorPos = 0; + + selType = selStream; + moveExtendsSelection = false; + xStartSelect = 0; + xEndSelect = 0; + primarySelection = true; + + caretXPolicy = CARET_SLOP | CARET_EVEN; + caretXSlop = 50; + + caretYPolicy = CARET_EVEN; + caretYSlop = 0; + + searchAnchor = 0; + + xOffset = 0; + xCaretMargin = 50; + horizontalScrollBarVisible = true; + scrollWidth = 2000; + verticalScrollBarVisible = true; + endAtLastLine = true; + caretSticky = false; + + pixmapLine = Surface::Allocate(); + pixmapSelMargin = Surface::Allocate(); + pixmapSelPattern = Surface::Allocate(); + pixmapIndentGuide = Surface::Allocate(); + pixmapIndentGuideHighlight = Surface::Allocate(); + + currentPos = 0; + anchor = 0; + + targetStart = 0; + targetEnd = 0; + searchFlags = 0; + + topLine = 0; + posTopLine = 0; + + lengthForEncode = -1; + + needUpdateUI = true; + braces[0] = invalidPosition; + braces[1] = invalidPosition; + bracesMatchStyle = STYLE_BRACEBAD; + highlightGuideColumn = 0; + + theEdge = 0; + + paintState = notPainting; + + modEventMask = SC_MODEVENTMASKALL; + + pdoc = new Document(); + pdoc->AddRef(); + pdoc->AddWatcher(this, 0); + + recordingMacro = false; + foldFlags = 0; + + wrapState = eWrapNone; + wrapWidth = LineLayout::wrapWidthInfinite; + wrapStart = wrapLineLarge; + wrapEnd = wrapLineLarge; + wrapVisualFlags = 0; + wrapVisualFlagsLocation = 0; + wrapVisualStartIndent = 0; + actualWrapVisualStartIndent = 0; + + convertPastes = true; + + hsStart = -1; + hsEnd = -1; + + llc.SetLevel(LineLayoutCache::llcCaret); +} + +Editor::~Editor() { + pdoc->RemoveWatcher(this, 0); + pdoc->Release(); + pdoc = 0; + DropGraphics(); + delete pixmapLine; + delete pixmapSelMargin; + delete pixmapSelPattern; + delete pixmapIndentGuide; + delete pixmapIndentGuideHighlight; +} + +void Editor::Finalise() { + SetIdle(false); + CancelModes(); +} + +void Editor::DropGraphics() { + pixmapLine->Release(); + pixmapSelMargin->Release(); + pixmapSelPattern->Release(); + pixmapIndentGuide->Release(); + pixmapIndentGuideHighlight->Release(); +} + +void Editor::InvalidateStyleData() { + stylesValid = false; + palette.Release(); + DropGraphics(); + llc.Invalidate(LineLayout::llInvalid); + if (selType == selRectangle) { + xStartSelect = XFromPosition(anchor); + xEndSelect = XFromPosition(currentPos); + } +} + +void Editor::InvalidateStyleRedraw() { + NeedWrapping(); + InvalidateStyleData(); + Redraw(); +} + +void Editor::RefreshColourPalette(Palette &pal, bool want) { + vs.RefreshColourPalette(pal, want); +} + +void Editor::RefreshStyleData() { + if (!stylesValid) { + stylesValid = true; + AutoSurface surface(this); + if (surface) { + vs.Refresh(*surface); + RefreshColourPalette(palette, true); + palette.Allocate(wMain); + RefreshColourPalette(palette, false); + } + SetScrollBars(); + } +} + +PRectangle Editor::GetClientRectangle() { + return wMain.GetClientPosition(); +} + +PRectangle Editor::GetTextRectangle() { + PRectangle rc = GetClientRectangle(); + rc.left += vs.fixedColumnWidth; + rc.right -= vs.rightMarginWidth; + return rc; +} + +int Editor::LinesOnScreen() { + PRectangle rcClient = GetClientRectangle(); + int htClient = rcClient.bottom - rcClient.top; + //Platform::DebugPrintf("lines on screen = %d\n", htClient / lineHeight + 1); + return htClient / vs.lineHeight; +} + +int Editor::LinesToScroll() { + int retVal = LinesOnScreen() - 1; + if (retVal < 1) + return 1; + else + return retVal; +} + +int Editor::MaxScrollPos() { + //Platform::DebugPrintf("Lines %d screen = %d maxScroll = %d\n", + //LinesTotal(), LinesOnScreen(), LinesTotal() - LinesOnScreen() + 1); + int retVal = cs.LinesDisplayed(); + if (endAtLastLine) { + retVal -= LinesOnScreen(); + } else { + retVal--; + } + if (retVal < 0) { + return 0; + } else { + return retVal; + } +} + +static inline bool IsControlCharacter(int ch) { + // iscntrl returns true for lots of chars > 127 which are displayable + return ch >= 0 && ch < ' '; +} + +const char *ControlCharacterString(unsigned char ch) { + const char *reps[] = { + "NUL", "SOH", "STX", "ETX", "EOT", "ENQ", "ACK", "BEL", + "BS", "HT", "LF", "VT", "FF", "CR", "SO", "SI", + "DLE", "DC1", "DC2", "DC3", "DC4", "NAK", "SYN", "ETB", + "CAN", "EM", "SUB", "ESC", "FS", "GS", "RS", "US" + }; + if (ch < (sizeof(reps) / sizeof(reps[0]))) { + return reps[ch]; + } else { + return "BAD"; + } +} + +/** + * Convenience class to ensure LineLayout objects are always disposed. + */ +class AutoLineLayout { + LineLayoutCache &llc; + LineLayout *ll; + AutoLineLayout &operator=(const AutoLineLayout &) { return * this; } +public: + AutoLineLayout(LineLayoutCache &llc_, LineLayout *ll_) : llc(llc_), ll(ll_) {} + ~AutoLineLayout() { + llc.Dispose(ll); + ll = 0; + } + LineLayout *operator->() const { + return ll; + } + operator LineLayout *() const { + return ll; + } + void Set(LineLayout *ll_) { + llc.Dispose(ll); + ll = ll_; + } +}; + +/** + * Allows to iterate through the lines of a selection. + * Althought it can be called for a stream selection, in most cases + * it is inefficient and it should be used only for + * a rectangular or a line selection. + */ +class SelectionLineIterator { +private: + Editor *ed; + int line; ///< Current line within the iteration. + bool forward; ///< True if iterating by increasing line number, false otherwise. + int selStart, selEnd; ///< Positions of the start and end of the selection relative to the start of the document. + int minX, maxX; ///< Left and right of selection rectangle. + +public: + int lineStart, lineEnd; ///< Line numbers, first and last lines of the selection. + int startPos, endPos; ///< Positions of the beginning and end of the selection on the current line. + + void Reset() { + if (forward) { + line = lineStart; + } else { + line = lineEnd; + } + } + + SelectionLineIterator(Editor *ed_, bool forward_ = true) : line(0), startPos(0), endPos(0) { + ed = ed_; + forward = forward_; + selStart = ed->SelectionStart(); + selEnd = ed->SelectionEnd(); + lineStart = ed->pdoc->LineFromPosition(selStart); + lineEnd = ed->pdoc->LineFromPosition(selEnd); + // Left of rectangle + minX = Platform::Minimum(ed->xStartSelect, ed->xEndSelect); + // Right of rectangle + maxX = Platform::Maximum(ed->xStartSelect, ed->xEndSelect); + Reset(); + } + ~SelectionLineIterator() {} + + void SetAt(int line) { + if (line < lineStart || line > lineEnd) { + startPos = endPos = INVALID_POSITION; + } else { + if (ed->selType == ed->selRectangle) { + // Measure line and return character closest to minX + startPos = ed->PositionFromLineX(line, minX); + // Measure line and return character closest to maxX + endPos = ed->PositionFromLineX(line, maxX); + } else if (ed->selType == ed->selLines) { + startPos = ed->pdoc->LineStart(line); + endPos = ed->pdoc->LineStart(line + 1); + } else { // Stream selection, here only for completion + if (line == lineStart) { + startPos = selStart; + } else { + startPos = ed->pdoc->LineStart(line); + } + if (line == lineEnd) { + endPos = selEnd; + } else { + endPos = ed->pdoc->LineStart(line + 1); + } + } + } + } + bool Iterate() { + SetAt(line); + if (forward) { + line++; + } else { + line--; + } + return startPos != INVALID_POSITION; + } +}; + +Point Editor::LocationFromPosition(int pos) { + Point pt; + RefreshStyleData(); + if (pos == INVALID_POSITION) + return pt; + int line = pdoc->LineFromPosition(pos); + int lineVisible = cs.DisplayFromDoc(line); + //Platform::DebugPrintf("line=%d\n", line); + AutoSurface surface(this); + AutoLineLayout ll(llc, RetrieveLineLayout(line)); + if (surface && ll) { + // -1 because of adding in for visible lines in following loop. + pt.y = (lineVisible - topLine - 1) * vs.lineHeight; + pt.x = 0; + unsigned int posLineStart = pdoc->LineStart(line); + LayoutLine(line, surface, vs, ll, wrapWidth); + int posInLine = pos - posLineStart; + // In case of very long line put x at arbitrary large position + if (posInLine > ll->maxLineLength) { + pt.x = ll->positions[ll->maxLineLength] - ll->positions[ll->LineStart(ll->lines)]; + } + + for (int subLine = 0; subLine < ll->lines; subLine++) { + if ((posInLine >= ll->LineStart(subLine)) && (posInLine <= ll->LineStart(subLine + 1))) { + pt.x = ll->positions[posInLine] - ll->positions[ll->LineStart(subLine)]; + if (actualWrapVisualStartIndent != 0) { + int lineStart = ll->LineStart(subLine); + if (lineStart != 0) // Wrapped + pt.x += actualWrapVisualStartIndent * vs.aveCharWidth; + } + } + if (posInLine >= ll->LineStart(subLine)) { + pt.y += vs.lineHeight; + } + } + pt.x += vs.fixedColumnWidth - xOffset; + } + return pt; +} + +int Editor::XFromPosition(int pos) { + Point pt = LocationFromPosition(pos); + return pt.x - vs.fixedColumnWidth + xOffset; +} + +int Editor::LineFromLocation(Point pt) { + return cs.DocFromDisplay(pt.y / vs.lineHeight + topLine); +} + +void Editor::SetTopLine(int topLineNew) { + topLine = topLineNew; + posTopLine = pdoc->LineStart(cs.DocFromDisplay(topLine)); +} + +static inline bool IsEOLChar(char ch) { + return (ch == '\r') || (ch == '\n'); +} + +int Editor::PositionFromLocation(Point pt) { + RefreshStyleData(); + pt.x = pt.x - vs.fixedColumnWidth + xOffset; + int visibleLine = pt.y / vs.lineHeight + topLine; + if (pt.y < 0) { // Division rounds towards 0 + visibleLine = (pt.y - (vs.lineHeight - 1)) / vs.lineHeight + topLine; + } + if (visibleLine < 0) + visibleLine = 0; + int lineDoc = cs.DocFromDisplay(visibleLine); + if (lineDoc >= pdoc->LinesTotal()) + return pdoc->Length(); + unsigned int posLineStart = pdoc->LineStart(lineDoc); + int retVal = posLineStart; + AutoSurface surface(this); + AutoLineLayout ll(llc, RetrieveLineLayout(lineDoc)); + if (surface && ll) { + LayoutLine(lineDoc, surface, vs, ll, wrapWidth); + int lineStartSet = cs.DisplayFromDoc(lineDoc); + int subLine = visibleLine - lineStartSet; + if (subLine < ll->lines) { + int lineStart = ll->LineStart(subLine); + int lineEnd = ll->LineStart(subLine + 1); + int subLineStart = ll->positions[lineStart]; + + if (actualWrapVisualStartIndent != 0) { + if (lineStart != 0) // Wrapped + pt.x -= actualWrapVisualStartIndent * vs.aveCharWidth; + } + for (int i = lineStart; i < lineEnd; i++) { + if (pt.x < (((ll->positions[i] + ll->positions[i + 1]) / 2) - subLineStart) || + IsEOLChar(ll->chars[i])) { + return pdoc->MovePositionOutsideChar(i + posLineStart, 1); + } + } + return lineEnd + posLineStart; + } + retVal = ll->numCharsInLine + posLineStart; + } + return retVal; +} + +// Like PositionFromLocation but INVALID_POSITION returned when not near any text. +int Editor::PositionFromLocationClose(Point pt) { + RefreshStyleData(); + PRectangle rcClient = GetTextRectangle(); + if (!rcClient.Contains(pt)) + return INVALID_POSITION; + if (pt.x < vs.fixedColumnWidth) + return INVALID_POSITION; + if (pt.y < 0) + return INVALID_POSITION; + pt.x = pt.x - vs.fixedColumnWidth + xOffset; + int visibleLine = pt.y / vs.lineHeight + topLine; + if (pt.y < 0) { // Division rounds towards 0 + visibleLine = (pt.y - (vs.lineHeight - 1)) / vs.lineHeight + topLine; + } + int lineDoc = cs.DocFromDisplay(visibleLine); + if (lineDoc < 0) + return INVALID_POSITION; + if (lineDoc >= pdoc->LinesTotal()) + return INVALID_POSITION; + AutoSurface surface(this); + AutoLineLayout ll(llc, RetrieveLineLayout(lineDoc)); + if (surface && ll) { + LayoutLine(lineDoc, surface, vs, ll, wrapWidth); + unsigned int posLineStart = pdoc->LineStart(lineDoc); + int lineStartSet = cs.DisplayFromDoc(lineDoc); + int subLine = visibleLine - lineStartSet; + if (subLine < ll->lines) { + int lineStart = ll->LineStart(subLine); + int lineEnd = ll->LineStart(subLine + 1); + int subLineStart = ll->positions[lineStart]; + + if (actualWrapVisualStartIndent != 0) { + if (lineStart != 0) // Wrapped + pt.x -= actualWrapVisualStartIndent * vs.aveCharWidth; + } + for (int i = lineStart; i < lineEnd; i++) { + if (pt.x < (((ll->positions[i] + ll->positions[i + 1]) / 2) - subLineStart) || + IsEOLChar(ll->chars[i])) { + return pdoc->MovePositionOutsideChar(i + posLineStart, 1); + } + } + if (pt.x < (ll->positions[lineEnd] - subLineStart)) { + return pdoc->MovePositionOutsideChar(lineEnd + posLineStart, 1); + } + } + } + + return INVALID_POSITION; +} + +/** + * Find the document position corresponding to an x coordinate on a particular document line. + * Ensure is between whole characters when document is in multi-byte or UTF-8 mode. + */ +int Editor::PositionFromLineX(int lineDoc, int x) { + RefreshStyleData(); + if (lineDoc >= pdoc->LinesTotal()) + return pdoc->Length(); + //Platform::DebugPrintf("Position of (%d,%d) line = %d top=%d\n", pt.x, pt.y, line, topLine); + AutoSurface surface(this); + AutoLineLayout ll(llc, RetrieveLineLayout(lineDoc)); + int retVal = 0; + if (surface && ll) { + unsigned int posLineStart = pdoc->LineStart(lineDoc); + LayoutLine(lineDoc, surface, vs, ll, wrapWidth); + retVal = ll->numCharsInLine + posLineStart; + int subLine = 0; + int lineStart = ll->LineStart(subLine); + int lineEnd = ll->LineStart(subLine + 1); + int subLineStart = ll->positions[lineStart]; + + if (actualWrapVisualStartIndent != 0) { + if (lineStart != 0) // Wrapped + x -= actualWrapVisualStartIndent * vs.aveCharWidth; + } + for (int i = lineStart; i < lineEnd; i++) { + if (x < (((ll->positions[i] + ll->positions[i + 1]) / 2) - subLineStart) || + IsEOLChar(ll->chars[i])) { + retVal = pdoc->MovePositionOutsideChar(i + posLineStart, 1); + break; + } + } + } + return retVal; +} + +/** + * If painting then abandon the painting because a wider redraw is needed. + * @return true if calling code should stop drawing. + */ +bool Editor::AbandonPaint() { + if ((paintState == painting) && !paintingAllText) { + paintState = paintAbandoned; + } + return paintState == paintAbandoned; +} + +void Editor::RedrawRect(PRectangle rc) { + //Platform::DebugPrintf("Redraw %0d,%0d - %0d,%0d\n", rc.left, rc.top, rc.right, rc.bottom); + + // Clip the redraw rectangle into the client area + PRectangle rcClient = GetClientRectangle(); + if (rc.top < rcClient.top) + rc.top = rcClient.top; + if (rc.bottom > rcClient.bottom) + rc.bottom = rcClient.bottom; + if (rc.left < rcClient.left) + rc.left = rcClient.left; + if (rc.right > rcClient.right) + rc.right = rcClient.right; + + if ((rc.bottom > rc.top) && (rc.right > rc.left)) { + wMain.InvalidateRectangle(rc); + } +} + +void Editor::Redraw() { + //Platform::DebugPrintf("Redraw all\n"); + PRectangle rcClient = GetClientRectangle(); + wMain.InvalidateRectangle(rcClient); + //wMain.InvalidateAll(); +} + +void Editor::RedrawSelMargin(int line) { + if (!AbandonPaint()) { + if (vs.maskInLine) { + Redraw(); + } else { + PRectangle rcSelMargin = GetClientRectangle(); + rcSelMargin.right = vs.fixedColumnWidth; + if (line != -1) { + int position = pdoc->LineStart(line); + PRectangle rcLine = RectangleFromRange(position, position); + rcSelMargin.top = rcLine.top; + rcSelMargin.bottom = rcLine.bottom; + } + wMain.InvalidateRectangle(rcSelMargin); + } + } +} + +PRectangle Editor::RectangleFromRange(int start, int end) { + int minPos = start; + if (minPos > end) + minPos = end; + int maxPos = start; + if (maxPos < end) + maxPos = end; + int minLine = cs.DisplayFromDoc(pdoc->LineFromPosition(minPos)); + int lineDocMax = pdoc->LineFromPosition(maxPos); + int maxLine = cs.DisplayFromDoc(lineDocMax) + cs.GetHeight(lineDocMax) - 1; + PRectangle rcClient = GetTextRectangle(); + PRectangle rc; + rc.left = vs.fixedColumnWidth; + rc.top = (minLine - topLine) * vs.lineHeight; + if (rc.top < 0) + rc.top = 0; + rc.right = rcClient.right; + rc.bottom = (maxLine - topLine + 1) * vs.lineHeight; + // Ensure PRectangle is within 16 bit space + rc.top = Platform::Clamp(rc.top, -32000, 32000); + rc.bottom = Platform::Clamp(rc.bottom, -32000, 32000); + + return rc; +} + +void Editor::InvalidateRange(int start, int end) { + RedrawRect(RectangleFromRange(start, end)); +} + +int Editor::CurrentPosition() { + return currentPos; +} + +bool Editor::SelectionEmpty() { + return anchor == currentPos; +} + +int Editor::SelectionStart() { + return Platform::Minimum(currentPos, anchor); +} + +int Editor::SelectionEnd() { + return Platform::Maximum(currentPos, anchor); +} + +void Editor::SetRectangularRange() { + if (selType == selRectangle) { + xStartSelect = XFromPosition(anchor); + xEndSelect = XFromPosition(currentPos); + } +} + +void Editor::InvalidateSelection(int currentPos_, int anchor_) { + int firstAffected = anchor; + if (firstAffected > currentPos) + firstAffected = currentPos; + if (firstAffected > anchor_) + firstAffected = anchor_; + if (firstAffected > currentPos_) + firstAffected = currentPos_; + int lastAffected = anchor; + if (lastAffected < currentPos) + lastAffected = currentPos; + if (lastAffected < anchor_) + lastAffected = anchor_; + if (lastAffected < (currentPos_ + 1)) // +1 ensures caret repainted + lastAffected = (currentPos_ + 1); + needUpdateUI = true; + InvalidateRange(firstAffected, lastAffected); +} + +void Editor::SetSelection(int currentPos_, int anchor_) { + currentPos_ = pdoc->ClampPositionIntoDocument(currentPos_); + anchor_ = pdoc->ClampPositionIntoDocument(anchor_); + if ((currentPos != currentPos_) || (anchor != anchor_)) { + InvalidateSelection(currentPos_, anchor_); + currentPos = currentPos_; + anchor = anchor_; + } + SetRectangularRange(); + ClaimSelection(); +} + +void Editor::SetSelection(int currentPos_) { + currentPos_ = pdoc->ClampPositionIntoDocument(currentPos_); + if (currentPos != currentPos_) { + InvalidateSelection(currentPos_, currentPos_); + currentPos = currentPos_; + } + SetRectangularRange(); + ClaimSelection(); +} + +void Editor::SetEmptySelection(int currentPos_) { + selType = selStream; + moveExtendsSelection = false; + SetSelection(currentPos_, currentPos_); +} + +bool Editor::RangeContainsProtected(int start, int end) const { + if (vs.ProtectionActive()) { + if (start > end) { + int t = start; + start = end; + end = t; + } + int mask = pdoc->stylingBitsMask; + for (int pos = start; pos < end; pos++) { + if (vs.styles[pdoc->StyleAt(pos) & mask].IsProtected()) + return true; + } + } + return false; +} + +bool Editor::SelectionContainsProtected() { + // DONE, but untested...: make support rectangular selection + bool scp = false; + if (selType == selStream) { + scp = RangeContainsProtected(anchor, currentPos); + } else { + SelectionLineIterator lineIterator(this); + while (lineIterator.Iterate()) { + if (RangeContainsProtected(lineIterator.startPos, lineIterator.endPos)) { + scp = true; + break; + } + } + } + return scp; +} + +/** + * Asks document to find a good position and then moves out of any invisible positions. + */ +int Editor::MovePositionOutsideChar(int pos, int moveDir, bool checkLineEnd) { + pos = pdoc->MovePositionOutsideChar(pos, moveDir, checkLineEnd); + if (vs.ProtectionActive()) { + int mask = pdoc->stylingBitsMask; + if (moveDir > 0) { + if ((pos > 0) && vs.styles[pdoc->StyleAt(pos - 1) & mask].IsProtected()) { + while ((pos < pdoc->Length()) && + (vs.styles[pdoc->StyleAt(pos) & mask].IsProtected())) + pos++; + } + } else if (moveDir < 0) { + if (vs.styles[pdoc->StyleAt(pos) & mask].IsProtected()) { + while ((pos > 0) && + (vs.styles[pdoc->StyleAt(pos - 1) & mask].IsProtected())) + pos--; + } + } + } + return pos; +} + +int Editor::MovePositionTo(int newPos, selTypes sel, bool ensureVisible) { + int delta = newPos - currentPos; + newPos = pdoc->ClampPositionIntoDocument(newPos); + newPos = MovePositionOutsideChar(newPos, delta); + if (sel != noSel) { + selType = sel; + } + if (sel != noSel || moveExtendsSelection) { + SetSelection(newPos); + } else { + SetEmptySelection(newPos); + } + ShowCaretAtCurrentPosition(); + if (ensureVisible) { + EnsureCaretVisible(); + } + NotifyMove(newPos); + return 0; +} + +int Editor::MovePositionSoVisible(int pos, int moveDir) { + pos = pdoc->ClampPositionIntoDocument(pos); + pos = MovePositionOutsideChar(pos, moveDir); + int lineDoc = pdoc->LineFromPosition(pos); + if (cs.GetVisible(lineDoc)) { + return pos; + } else { + int lineDisplay = cs.DisplayFromDoc(lineDoc); + if (moveDir > 0) { + // lineDisplay is already line before fold as lines in fold use display line of line after fold + lineDisplay = Platform::Clamp(lineDisplay, 0, cs.LinesDisplayed()); + return pdoc->LineStart(cs.DocFromDisplay(lineDisplay)); + } else { + lineDisplay = Platform::Clamp(lineDisplay - 1, 0, cs.LinesDisplayed()); + return pdoc->LineEnd(cs.DocFromDisplay(lineDisplay)); + } + } +} + +/** + * Choose the x position that the caret will try to stick to + * as it moves up and down. + */ +void Editor::SetLastXChosen() { + Point pt = LocationFromPosition(currentPos); + lastXChosen = pt.x; +} + +void Editor::ScrollTo(int line, bool moveThumb) { + int topLineNew = Platform::Clamp(line, 0, MaxScrollPos()); + if (topLineNew != topLine) { + // Try to optimise small scrolls + int linesToMove = topLine - topLineNew; + SetTopLine(topLineNew); + ShowCaretAtCurrentPosition(); + // Perform redraw rather than scroll if many lines would be redrawn anyway. +#ifndef UNDER_CE + if (abs(linesToMove) <= 10) { + ScrollText(linesToMove); + } else { + Redraw(); + } +#else + Redraw(); +#endif + if (moveThumb) { + SetVerticalScrollPos(); + } + } +} + +void Editor::ScrollText(int /* linesToMove */) { + //Platform::DebugPrintf("Editor::ScrollText %d\n", linesToMove); + Redraw(); +} + +void Editor::HorizontalScrollTo(int xPos) { + //Platform::DebugPrintf("HorizontalScroll %d\n", xPos); + if (xPos < 0) + xPos = 0; + if ((wrapState == eWrapNone) && (xOffset != xPos)) { + xOffset = xPos; + SetHorizontalScrollPos(); + RedrawRect(GetClientRectangle()); + } +} + +void Editor::MoveCaretInsideView(bool ensureVisible) { + PRectangle rcClient = GetTextRectangle(); + Point pt = LocationFromPosition(currentPos); + if (pt.y < rcClient.top) { + MovePositionTo(PositionFromLocation( + Point(lastXChosen, rcClient.top)), + noSel, ensureVisible); + } else if ((pt.y + vs.lineHeight - 1) > rcClient.bottom) { + int yOfLastLineFullyDisplayed = rcClient.top + (LinesOnScreen() - 1) * vs.lineHeight; + MovePositionTo(PositionFromLocation( + Point(lastXChosen, rcClient.top + yOfLastLineFullyDisplayed)), + noSel, ensureVisible); + } +} + +int Editor::DisplayFromPosition(int pos) { + int lineDoc = pdoc->LineFromPosition(pos); + int lineDisplay = cs.DisplayFromDoc(lineDoc); + AutoSurface surface(this); + AutoLineLayout ll(llc, RetrieveLineLayout(lineDoc)); + if (surface && ll) { + LayoutLine(lineDoc, surface, vs, ll, wrapWidth); + unsigned int posLineStart = pdoc->LineStart(lineDoc); + int posInLine = pos - posLineStart; + lineDisplay--; // To make up for first increment ahead. + for (int subLine = 0; subLine < ll->lines; subLine++) { + if (posInLine >= ll->LineStart(subLine)) { + lineDisplay++; + } + } + } + return lineDisplay; +} + +/** + * Ensure the caret is reasonably visible in context. + * +Caret policy in SciTE + +If slop is set, we can define a slop value. +This value defines an unwanted zone (UZ) where the caret is... unwanted. +This zone is defined as a number of pixels near the vertical margins, +and as a number of lines near the horizontal margins. +By keeping the caret away from the edges, it is seen within its context, +so it is likely that the identifier that the caret is on can be completely seen, +and that the current line is seen with some of the lines following it which are +often dependent on that line. + +If strict is set, the policy is enforced... strictly. +The caret is centred on the display if slop is not set, +and cannot go in the UZ if slop is set. + +If jumps is set, the display is moved more energetically +so the caret can move in the same direction longer before the policy is applied again. +'3UZ' notation is used to indicate three time the size of the UZ as a distance to the margin. + +If even is not set, instead of having symmetrical UZs, +the left and bottom UZs are extended up to right and top UZs respectively. +This way, we favour the displaying of useful information: the begining of lines, +where most code reside, and the lines after the caret, eg. the body of a function. + + | | | | | +slop | strict | jumps | even | Caret can go to the margin | When reaching limitÝ(caret going out of + | | | | | visibility or going into the UZ) display is... +-----+--------+-------+------+--------------------------------------------+-------------------------------------------------------------- + 0 | 0 | 0 | 0 | Yes | moved to put caret on top/on right + 0 | 0 | 0 | 1 | Yes | moved by one position + 0 | 0 | 1 | 0 | Yes | moved to put caret on top/on right + 0 | 0 | 1 | 1 | Yes | centred on the caret + 0 | 1 | - | 0 | Caret is always on top/on right of display | - + 0 | 1 | - | 1 | No, caret is always centred | - + 1 | 0 | 0 | 0 | Yes | moved to put caret out of the asymmetrical UZ + 1 | 0 | 0 | 1 | Yes | moved to put caret out of the UZ + 1 | 0 | 1 | 0 | Yes | moved to put caret at 3UZ of the top or right margin + 1 | 0 | 1 | 1 | Yes | moved to put caret at 3UZ of the margin + 1 | 1 | - | 0 | Caret is always at UZ of top/right margin | - + 1 | 1 | 0 | 1 | No, kept out of UZ | moved by one position + 1 | 1 | 1 | 1 | No, kept out of UZ | moved to put caret at 3UZ of the margin +*/ +void Editor::EnsureCaretVisible(bool useMargin, bool vert, bool horiz) { + //Platform::DebugPrintf("EnsureCaretVisible %d %s\n", xOffset, useMargin ? " margin" : " "); + PRectangle rcClient = GetTextRectangle(); + //int rcClientFullWidth = rcClient.Width(); + int posCaret = currentPos; + if (posDrag >= 0) { + posCaret = posDrag; + } + Point pt = LocationFromPosition(posCaret); + Point ptBottomCaret = pt; + ptBottomCaret.y += vs.lineHeight - 1; + int lineCaret = DisplayFromPosition(posCaret); + bool bSlop, bStrict, bJump, bEven; + + // Vertical positioning + if (vert && (pt.y < rcClient.top || ptBottomCaret.y > rcClient.bottom || (caretYPolicy & CARET_STRICT) != 0)) { + int linesOnScreen = LinesOnScreen(); + int halfScreen = Platform::Maximum(linesOnScreen - 1, 2) / 2; + int newTopLine = topLine; + bSlop = (caretYPolicy & CARET_SLOP) != 0; + bStrict = (caretYPolicy & CARET_STRICT) != 0; + bJump = (caretYPolicy & CARET_JUMPS) != 0; + bEven = (caretYPolicy & CARET_EVEN) != 0; + + // It should be possible to scroll the window to show the caret, + // but this fails to remove the caret on GTK+ + if (bSlop) { // A margin is defined + int yMoveT, yMoveB; + if (bStrict) { + int yMarginT, yMarginB; + if (!useMargin) { + // In drag mode, avoid moves + // otherwise, a double click will select several lines. + yMarginT = yMarginB = 0; + } else { + // yMarginT must equal to caretYSlop, with a minimum of 1 and + // a maximum of slightly less than half the heigth of the text area. + yMarginT = Platform::Clamp(caretYSlop, 1, halfScreen); + if (bEven) { + yMarginB = yMarginT; + } else { + yMarginB = linesOnScreen - yMarginT - 1; + } + } + yMoveT = yMarginT; + if (bEven) { + if (bJump) { + yMoveT = Platform::Clamp(caretYSlop * 3, 1, halfScreen); + } + yMoveB = yMoveT; + } else { + yMoveB = linesOnScreen - yMoveT - 1; + } + if (lineCaret < topLine + yMarginT) { + // Caret goes too high + newTopLine = lineCaret - yMoveT; + } else if (lineCaret > topLine + linesOnScreen - 1 - yMarginB) { + // Caret goes too low + newTopLine = lineCaret - linesOnScreen + 1 + yMoveB; + } + } else { // Not strict + yMoveT = bJump ? caretYSlop * 3 : caretYSlop; + yMoveT = Platform::Clamp(yMoveT, 1, halfScreen); + if (bEven) { + yMoveB = yMoveT; + } else { + yMoveB = linesOnScreen - yMoveT - 1; + } + if (lineCaret < topLine) { + // Caret goes too high + newTopLine = lineCaret - yMoveT; + } else if (lineCaret > topLine + linesOnScreen - 1) { + // Caret goes too low + newTopLine = lineCaret - linesOnScreen + 1 + yMoveB; + } + } + } else { // No slop + if (!bStrict && !bJump) { + // Minimal move + if (lineCaret < topLine) { + // Caret goes too high + newTopLine = lineCaret; + } else if (lineCaret > topLine + linesOnScreen - 1) { + // Caret goes too low + if (bEven) { + newTopLine = lineCaret - linesOnScreen + 1; + } else { + newTopLine = lineCaret; + } + } + } else { // Strict or going out of display + if (bEven) { + // Always center caret + newTopLine = lineCaret - halfScreen; + } else { + // Always put caret on top of display + newTopLine = lineCaret; + } + } + } + newTopLine = Platform::Clamp(newTopLine, 0, MaxScrollPos()); + if (newTopLine != topLine) { + Redraw(); + SetTopLine(newTopLine); + SetVerticalScrollPos(); + } + } + + // Horizontal positioning + if (horiz && (wrapState == eWrapNone)) { + int halfScreen = Platform::Maximum(rcClient.Width() - 4, 4) / 2; + int xOffsetNew = xOffset; + bSlop = (caretXPolicy & CARET_SLOP) != 0; + bStrict = (caretXPolicy & CARET_STRICT) != 0; + bJump = (caretXPolicy & CARET_JUMPS) != 0; + bEven = (caretXPolicy & CARET_EVEN) != 0; + + if (bSlop) { // A margin is defined + int xMoveL, xMoveR; + if (bStrict) { + int xMarginL, xMarginR; + if (!useMargin) { + // In drag mode, avoid moves unless very near of the margin + // otherwise, a simple click will select text. + xMarginL = xMarginR = 2; + } else { + // xMargin must equal to caretXSlop, with a minimum of 2 and + // a maximum of slightly less than half the width of the text area. + xMarginR = Platform::Clamp(caretXSlop, 2, halfScreen); + if (bEven) { + xMarginL = xMarginR; + } else { + xMarginL = rcClient.Width() - xMarginR - 4; + } + } + if (bJump && bEven) { + // Jump is used only in even mode + xMoveL = xMoveR = Platform::Clamp(caretXSlop * 3, 1, halfScreen); + } else { + xMoveL = xMoveR = 0; // Not used, avoid a warning + } + if (pt.x < rcClient.left + xMarginL) { + // Caret is on the left of the display + if (bJump && bEven) { + xOffsetNew -= xMoveL; + } else { + // Move just enough to allow to display the caret + xOffsetNew -= (rcClient.left + xMarginL) - pt.x; + } + } else if (pt.x >= rcClient.right - xMarginR) { + // Caret is on the right of the display + if (bJump && bEven) { + xOffsetNew += xMoveR; + } else { + // Move just enough to allow to display the caret + xOffsetNew += pt.x - (rcClient.right - xMarginR) + 1; + } + } + } else { // Not strict + xMoveR = bJump ? caretXSlop * 3 : caretXSlop; + xMoveR = Platform::Clamp(xMoveR, 1, halfScreen); + if (bEven) { + xMoveL = xMoveR; + } else { + xMoveL = rcClient.Width() - xMoveR - 4; + } + if (pt.x < rcClient.left) { + // Caret is on the left of the display + xOffsetNew -= xMoveL; + } else if (pt.x >= rcClient.right) { + // Caret is on the right of the display + xOffsetNew += xMoveR; + } + } + } else { // No slop + if (bStrict || + (bJump && (pt.x < rcClient.left || pt.x >= rcClient.right))) { + // Strict or going out of display + if (bEven) { + // Center caret + xOffsetNew += pt.x - rcClient.left - halfScreen; + } else { + // Put caret on right + xOffsetNew += pt.x - rcClient.right + 1; + } + } else { + // Move just enough to allow to display the caret + if (pt.x < rcClient.left) { + // Caret is on the left of the display + if (bEven) { + xOffsetNew -= rcClient.left - pt.x; + } else { + xOffsetNew += pt.x - rcClient.right + 1; + } + } else if (pt.x >= rcClient.right) { + // Caret is on the right of the display + xOffsetNew += pt.x - rcClient.right + 1; + } + } + } + // In case of a jump (find result) largely out of display, adjust the offset to display the caret + if (pt.x + xOffset < rcClient.left + xOffsetNew) { + xOffsetNew = pt.x + xOffset - rcClient.left; + } else if (pt.x + xOffset >= rcClient.right + xOffsetNew) { + xOffsetNew = pt.x + xOffset - rcClient.right + 1; + } + if (xOffsetNew < 0) { + xOffsetNew = 0; + } + if (xOffset != xOffsetNew) { + xOffset = xOffsetNew; + if (xOffsetNew > 0) { + PRectangle rcText = GetTextRectangle(); + if (horizontalScrollBarVisible == true && + rcText.Width() + xOffset > scrollWidth) { + scrollWidth = xOffset + rcText.Width(); + SetScrollBars(); + } + } + SetHorizontalScrollPos(); + Redraw(); + } + } + UpdateSystemCaret(); +} + +void Editor::ShowCaretAtCurrentPosition() { + if (hasFocus) { + caret.active = true; + caret.on = true; + SetTicking(true); + } else { + caret.active = false; + caret.on = false; + } + InvalidateCaret(); +} + +void Editor::DropCaret() { + caret.active = false; + InvalidateCaret(); +} + +void Editor::InvalidateCaret() { + if (posDrag >= 0) + InvalidateRange(posDrag, posDrag + 1); + else + InvalidateRange(currentPos, currentPos + 1); + UpdateSystemCaret(); +} + +void Editor::UpdateSystemCaret() { +} + +void Editor::NeedWrapping(int docLineStart, int docLineEnd) { + docLineStart = Platform::Clamp(docLineStart, 0, pdoc->LinesTotal()); + if (wrapStart > docLineStart) { + wrapStart = docLineStart; + llc.Invalidate(LineLayout::llPositions); + } + if (wrapEnd < docLineEnd) { + wrapEnd = docLineEnd; + } + wrapEnd = Platform::Clamp(wrapEnd, 0, pdoc->LinesTotal()); + // Wrap lines during idle. + if ((wrapState != eWrapNone) && (wrapEnd != wrapStart)) { + SetIdle(true); + } +} + +// Check if wrapping needed and perform any needed wrapping. +// fullwrap: if true, all lines which need wrapping will be done, +// in this single call. +// priorityWrapLineStart: If greater than zero, all lines starting from +// here to 1 page + 100 lines past will be wrapped (even if there are +// more lines under wrapping process in idle). +// If it is neither fullwrap, nor priorityWrap, then 1 page + 100 lines will be +// wrapped, if there are any wrapping going on in idle. (Generally this +// condition is called only from idler). +// Return true if wrapping occurred. +bool Editor::WrapLines(bool fullWrap, int priorityWrapLineStart) { + // If there are any pending wraps, do them during idle if possible. + int linesInOneCall = LinesOnScreen() + 100; + if (wrapState != eWrapNone) { + if (wrapStart < wrapEnd) { + if (!SetIdle(true)) { + // Idle processing not supported so full wrap required. + fullWrap = true; + } + } + if (!fullWrap && priorityWrapLineStart >= 0 && + // .. and if the paint window is outside pending wraps + (((priorityWrapLineStart + linesInOneCall) < wrapStart) || + (priorityWrapLineStart > wrapEnd))) { + // No priority wrap pending + return false; + } + } + int goodTopLine = topLine; + bool wrapOccurred = false; + if (wrapStart <= pdoc->LinesTotal()) { + if (wrapState == eWrapNone) { + if (wrapWidth != LineLayout::wrapWidthInfinite) { + wrapWidth = LineLayout::wrapWidthInfinite; + for (int lineDoc = 0; lineDoc < pdoc->LinesTotal(); lineDoc++) { + cs.SetHeight(lineDoc, 1); + } + wrapOccurred = true; + } + wrapStart = wrapLineLarge; + wrapEnd = wrapLineLarge; + } else { + if (wrapEnd >= pdoc->LinesTotal()) + wrapEnd = pdoc->LinesTotal(); + //ElapsedTime et; + int lineDocTop = cs.DocFromDisplay(topLine); + int subLineTop = topLine - cs.DisplayFromDoc(lineDocTop); + PRectangle rcTextArea = GetClientRectangle(); + rcTextArea.left = vs.fixedColumnWidth; + rcTextArea.right -= vs.rightMarginWidth; + wrapWidth = rcTextArea.Width(); + // Ensure all of the document is styled. + pdoc->EnsureStyledTo(pdoc->Length()); + RefreshStyleData(); + AutoSurface surface(this); + if (surface) { + bool priorityWrap = false; + int lastLineToWrap = wrapEnd; + int lineToWrap = wrapStart; + if (!fullWrap) { + if (priorityWrapLineStart >= 0) { + // This is a priority wrap. + lineToWrap = priorityWrapLineStart; + lastLineToWrap = priorityWrapLineStart + linesInOneCall; + priorityWrap = true; + } else { + // This is idle wrap. + lastLineToWrap = wrapStart + linesInOneCall; + } + if (lastLineToWrap >= wrapEnd) + lastLineToWrap = wrapEnd; + } // else do a fullWrap. + + // Platform::DebugPrintf("Wraplines: full = %d, priorityStart = %d (wrapping: %d to %d)\n", fullWrap, priorityWrapLineStart, lineToWrap, lastLineToWrap); + // Platform::DebugPrintf("Pending wraps: %d to %d\n", wrapStart, wrapEnd); + while (lineToWrap < lastLineToWrap) { + AutoLineLayout ll(llc, RetrieveLineLayout(lineToWrap)); + int linesWrapped = 1; + if (ll) { + LayoutLine(lineToWrap, surface, vs, ll, wrapWidth); + linesWrapped = ll->lines; + } + if (cs.SetHeight(lineToWrap, linesWrapped)) { + wrapOccurred = true; + } + lineToWrap++; + } + if (!priorityWrap) + wrapStart = lineToWrap; + // If wrapping is done, bring it to resting position + if (wrapStart >= wrapEnd) { + wrapStart = wrapLineLarge; + wrapEnd = wrapLineLarge; + } + } + goodTopLine = cs.DisplayFromDoc(lineDocTop); + if (subLineTop < cs.GetHeight(lineDocTop)) + goodTopLine += subLineTop; + else + goodTopLine += cs.GetHeight(lineDocTop); + //double durWrap = et.Duration(true); + //Platform::DebugPrintf("Wrap:%9.6g \n", durWrap); + } + } + if (wrapOccurred) { + SetScrollBars(); + SetTopLine(Platform::Clamp(goodTopLine, 0, MaxScrollPos())); + SetVerticalScrollPos(); + } + return wrapOccurred; +} + +void Editor::LinesJoin() { + if (!RangeContainsProtected(targetStart, targetEnd)) { + pdoc->BeginUndoAction(); + bool prevNonWS = true; + for (int pos = targetStart; pos < targetEnd; pos++) { + if (IsEOLChar(pdoc->CharAt(pos))) { + targetEnd -= pdoc->LenChar(pos); + pdoc->DelChar(pos); + if (prevNonWS) { + // Ensure at least one space separating previous lines + pdoc->InsertChar(pos, ' '); + } + } else { + prevNonWS = pdoc->CharAt(pos) != ' '; + } + } + pdoc->EndUndoAction(); + } +} + +const char *StringFromEOLMode(int eolMode) { + if (eolMode == SC_EOL_CRLF) { + return "\r\n"; + } else if (eolMode == SC_EOL_CR) { + return "\r"; + } else { + return "\n"; + } +} + +void Editor::LinesSplit(int pixelWidth) { + if (!RangeContainsProtected(targetStart, targetEnd)) { + if (pixelWidth == 0) { + PRectangle rcText = GetTextRectangle(); + pixelWidth = rcText.Width(); + } + int lineStart = pdoc->LineFromPosition(targetStart); + int lineEnd = pdoc->LineFromPosition(targetEnd); + const char *eol = StringFromEOLMode(pdoc->eolMode); + pdoc->BeginUndoAction(); + for (int line = lineStart; line <= lineEnd; line++) { + AutoSurface surface(this); + AutoLineLayout ll(llc, RetrieveLineLayout(line)); + if (surface && ll) { + unsigned int posLineStart = pdoc->LineStart(line); + LayoutLine(line, surface, vs, ll, pixelWidth); + for (int subLine = 1; subLine < ll->lines; subLine++) { + pdoc->InsertString(posLineStart + (subLine - 1) * strlen(eol) + + ll->LineStart(subLine), eol); + targetEnd += static_cast(strlen(eol)); + } + } + lineEnd = pdoc->LineFromPosition(targetEnd); + } + pdoc->EndUndoAction(); + } +} + +int Editor::SubstituteMarkerIfEmpty(int markerCheck, int markerDefault) { + if (vs.markers[markerCheck].markType == SC_MARK_EMPTY) + return markerDefault; + return markerCheck; +} + +// Avoid 64 bit compiler warnings. +// Scintilla does not support text buffers larger than 2**31 +static int istrlen(const char *s) { + return static_cast(strlen(s)); +} + +void Editor::PaintSelMargin(Surface *surfWindow, PRectangle &rc) { + if (vs.fixedColumnWidth == 0) + return; + + PRectangle rcMargin = GetClientRectangle(); + rcMargin.right = vs.fixedColumnWidth; + + if (!rc.Intersects(rcMargin)) + return; + + Surface *surface; + if (bufferedDraw) { + surface = pixmapSelMargin; + } else { + surface = surfWindow; + } + + PRectangle rcSelMargin = rcMargin; + rcSelMargin.right = rcMargin.left; + + for (int margin = 0; margin < vs.margins; margin++) { + if (vs.ms[margin].width > 0) { + + rcSelMargin.left = rcSelMargin.right; + rcSelMargin.right = rcSelMargin.left + vs.ms[margin].width; + + if (vs.ms[margin].style != SC_MARGIN_NUMBER) { + /* alternate scheme: + if (vs.ms[margin].mask & SC_MASK_FOLDERS) + surface->FillRectangle(rcSelMargin, vs.styles[STYLE_DEFAULT].back.allocated); + else + // Required because of special way brush is created for selection margin + surface->FillRectangle(rcSelMargin, pixmapSelPattern); + */ + if (vs.ms[margin].mask & SC_MASK_FOLDERS) + // Required because of special way brush is created for selection margin + surface->FillRectangle(rcSelMargin, *pixmapSelPattern); + else { + ColourAllocated colour; + switch (vs.ms[margin].style) { + case SC_MARGIN_BACK: + colour = vs.styles[STYLE_DEFAULT].back.allocated; + break; + case SC_MARGIN_FORE: + colour = vs.styles[STYLE_DEFAULT].fore.allocated; + break; + default: + colour = vs.styles[STYLE_LINENUMBER].back.allocated; + break; + } + surface->FillRectangle(rcSelMargin, colour); + } + } else { + surface->FillRectangle(rcSelMargin, vs.styles[STYLE_LINENUMBER].back.allocated); + } + + int visibleLine = topLine; + int yposScreen = 0; + + // Work out whether the top line is whitespace located after a + // lessening of fold level which implies a 'fold tail' but which should not + // be displayed until the last of a sequence of whitespace. + bool needWhiteClosure = false; + int level = pdoc->GetLevel(cs.DocFromDisplay(topLine)); + if (level & SC_FOLDLEVELWHITEFLAG) { + int lineBack = cs.DocFromDisplay(topLine); + int levelPrev = level; + while ((lineBack > 0) && (levelPrev & SC_FOLDLEVELWHITEFLAG)) { + lineBack--; + levelPrev = pdoc->GetLevel(lineBack); + } + if (!(levelPrev & SC_FOLDLEVELHEADERFLAG)) { + if ((level & SC_FOLDLEVELNUMBERMASK) < (levelPrev & SC_FOLDLEVELNUMBERMASK)) + needWhiteClosure = true; + } + } + + // Old code does not know about new markers needed to distinguish all cases + int folderOpenMid = SubstituteMarkerIfEmpty(SC_MARKNUM_FOLDEROPENMID, + SC_MARKNUM_FOLDEROPEN); + int folderEnd = SubstituteMarkerIfEmpty(SC_MARKNUM_FOLDEREND, + SC_MARKNUM_FOLDER); + + while ((visibleLine < cs.LinesDisplayed()) && yposScreen < rcMargin.bottom) { + + PLATFORM_ASSERT(visibleLine < cs.LinesDisplayed()); + + int lineDoc = cs.DocFromDisplay(visibleLine); + PLATFORM_ASSERT(cs.GetVisible(lineDoc)); + bool firstSubLine = visibleLine == cs.DisplayFromDoc(lineDoc); + + // Decide which fold indicator should be displayed + level = pdoc->GetLevel(lineDoc); + int levelNext = pdoc->GetLevel(lineDoc + 1); + int marks = pdoc->GetMark(lineDoc); + if (!firstSubLine) + marks = 0; + int levelNum = level & SC_FOLDLEVELNUMBERMASK; + int levelNextNum = levelNext & SC_FOLDLEVELNUMBERMASK; + if (level & SC_FOLDLEVELHEADERFLAG) { + if (firstSubLine) { + if (cs.GetExpanded(lineDoc)) { + if (levelNum == SC_FOLDLEVELBASE) + marks |= 1 << SC_MARKNUM_FOLDEROPEN; + else + marks |= 1 << folderOpenMid; + } else { + if (levelNum == SC_FOLDLEVELBASE) + marks |= 1 << SC_MARKNUM_FOLDER; + else + marks |= 1 << folderEnd; + } + } else { + marks |= 1 << SC_MARKNUM_FOLDERSUB; + } + needWhiteClosure = false; + } else if (level & SC_FOLDLEVELWHITEFLAG) { + if (needWhiteClosure) { + if (levelNext & SC_FOLDLEVELWHITEFLAG) { + marks |= 1 << SC_MARKNUM_FOLDERSUB; + } else if (levelNum > SC_FOLDLEVELBASE) { + marks |= 1 << SC_MARKNUM_FOLDERMIDTAIL; + needWhiteClosure = false; + } else { + marks |= 1 << SC_MARKNUM_FOLDERTAIL; + needWhiteClosure = false; + } + } else if (levelNum > SC_FOLDLEVELBASE) { + if (levelNextNum < levelNum) { + if (levelNextNum > SC_FOLDLEVELBASE) { + marks |= 1 << SC_MARKNUM_FOLDERMIDTAIL; + } else { + marks |= 1 << SC_MARKNUM_FOLDERTAIL; + } + } else { + marks |= 1 << SC_MARKNUM_FOLDERSUB; + } + } + } else if (levelNum > SC_FOLDLEVELBASE) { + if (levelNextNum < levelNum) { + needWhiteClosure = false; + if (levelNext & SC_FOLDLEVELWHITEFLAG) { + marks |= 1 << SC_MARKNUM_FOLDERSUB; + needWhiteClosure = true; + } else if (levelNextNum > SC_FOLDLEVELBASE) { + marks |= 1 << SC_MARKNUM_FOLDERMIDTAIL; + } else { + marks |= 1 << SC_MARKNUM_FOLDERTAIL; + } + } else { + marks |= 1 << SC_MARKNUM_FOLDERSUB; + } + } + + marks &= vs.ms[margin].mask; + PRectangle rcMarker = rcSelMargin; + rcMarker.top = yposScreen; + rcMarker.bottom = yposScreen + vs.lineHeight; + if (vs.ms[margin].style == SC_MARGIN_NUMBER) { + char number[100]; + number[0] = '\0'; + if (firstSubLine) + sprintf(number, "%d", lineDoc + 1); + if (foldFlags & SC_FOLDFLAG_LEVELNUMBERS) { + int lev = pdoc->GetLevel(lineDoc); + sprintf(number, "%c%c %03X %03X", + (lev & SC_FOLDLEVELHEADERFLAG) ? 'H' : '_', + (lev & SC_FOLDLEVELWHITEFLAG) ? 'W' : '_', + lev & SC_FOLDLEVELNUMBERMASK, + lev >> 16 + ); + } + PRectangle rcNumber = rcMarker; + // Right justify + int width = surface->WidthText(vs.styles[STYLE_LINENUMBER].font, number, istrlen(number)); + int xpos = rcNumber.right - width - 3; + rcNumber.left = xpos; + surface->DrawTextNoClip(rcNumber, vs.styles[STYLE_LINENUMBER].font, + rcNumber.top + vs.maxAscent, number, istrlen(number), + vs.styles[STYLE_LINENUMBER].fore.allocated, + vs.styles[STYLE_LINENUMBER].back.allocated); + } + + if (marks) { + for (int markBit = 0; (markBit < 32) && marks; markBit++) { + if (marks & 1) { + vs.markers[markBit].Draw(surface, rcMarker, vs.styles[STYLE_LINENUMBER].font); + } + marks >>= 1; + } + } + + visibleLine++; + yposScreen += vs.lineHeight; + } + } + } + + PRectangle rcBlankMargin = rcMargin; + rcBlankMargin.left = rcSelMargin.right; + surface->FillRectangle(rcBlankMargin, vs.styles[STYLE_DEFAULT].back.allocated); + + if (bufferedDraw) { + surfWindow->Copy(rcMargin, Point(), *pixmapSelMargin); + } +} + +void DrawTabArrow(Surface *surface, PRectangle rcTab, int ymid) { + int ydiff = (rcTab.bottom - rcTab.top) / 2; + int xhead = rcTab.right - 1 - ydiff; + if (xhead <= rcTab.left) { + ydiff -= rcTab.left - xhead - 1; + xhead = rcTab.left - 1; + } + if ((rcTab.left + 2) < (rcTab.right - 1)) + surface->MoveTo(rcTab.left + 2, ymid); + else + surface->MoveTo(rcTab.right - 1, ymid); + surface->LineTo(rcTab.right - 1, ymid); + surface->LineTo(xhead, ymid - ydiff); + surface->MoveTo(rcTab.right - 1, ymid); + surface->LineTo(xhead, ymid + ydiff); +} + +static bool IsSpaceOrTab(char ch) { + return ch == ' ' || ch == '\t'; +} + +LineLayout *Editor::RetrieveLineLayout(int lineNumber) { + int posLineStart = pdoc->LineStart(lineNumber); + int posLineEnd = pdoc->LineStart(lineNumber + 1); + int lineCaret = pdoc->LineFromPosition(currentPos); + return llc.Retrieve(lineNumber, lineCaret, + posLineEnd - posLineStart, pdoc->GetStyleClock(), + LinesOnScreen() + 1, pdoc->LinesTotal()); +} + +/** + * Fill in the LineLayout data for the given line. + * Copy the given @a line and its styles from the document into local arrays. + * Also determine the x position at which each character starts. + */ +void Editor::LayoutLine(int line, Surface *surface, ViewStyle &vstyle, LineLayout *ll, int width) { + if (!ll) + return; + PLATFORM_ASSERT(line < pdoc->LinesTotal()); + int posLineStart = pdoc->LineStart(line); + int posLineEnd = pdoc->LineStart(line + 1); + // If the line is very long, limit the treatment to a length that should fit in the viewport + if (posLineEnd > (posLineStart + ll->maxLineLength)) { + posLineEnd = posLineStart + ll->maxLineLength; + } + if (ll->validity == LineLayout::llCheckTextAndStyle) { + int lineLength = posLineEnd - posLineStart; + if (!vstyle.viewEOL) { + int cid = posLineEnd - 1; + while ((cid > posLineStart) && IsEOLChar(pdoc->CharAt(cid))) { + cid--; + lineLength--; + } + } + if (lineLength == ll->numCharsInLine) { + // See if chars, styles, indicators, are all the same + bool allSame = true; + const int styleMask = pdoc->stylingBitsMask; + // Check base line layout + char styleByte = 0; + int numCharsInLine = 0; + while (numCharsInLine < lineLength) { + int charInDoc = numCharsInLine + posLineStart; + char chDoc = pdoc->CharAt(charInDoc); + styleByte = pdoc->StyleAt(charInDoc); + allSame = allSame && + (ll->styles[numCharsInLine] == static_cast(styleByte & styleMask)); + allSame = allSame && + (ll->indicators[numCharsInLine] == static_cast(styleByte & ~styleMask)); + if (vstyle.styles[ll->styles[numCharsInLine]].caseForce == Style::caseMixed) + allSame = allSame && + (ll->chars[numCharsInLine] == chDoc); + else if (vstyle.styles[ll->styles[numCharsInLine]].caseForce == Style::caseLower) + allSame = allSame && + (ll->chars[numCharsInLine] == static_cast(tolower(chDoc))); + else // Style::caseUpper + allSame = allSame && + (ll->chars[numCharsInLine] == static_cast(toupper(chDoc))); + numCharsInLine++; + } + allSame = allSame && (ll->styles[numCharsInLine] == styleByte); // For eolFilled + if (allSame) { + ll->validity = LineLayout::llPositions; + } else { + ll->validity = LineLayout::llInvalid; + } + } else { + ll->validity = LineLayout::llInvalid; + } + } + if (ll->validity == LineLayout::llInvalid) { + ll->widthLine = LineLayout::wrapWidthInfinite; + ll->lines = 1; + int numCharsInLine = 0; + if (vstyle.edgeState == EDGE_BACKGROUND) { + ll->edgeColumn = pdoc->FindColumn(line, theEdge); + if (ll->edgeColumn >= posLineStart) { + ll->edgeColumn -= posLineStart; + } + } else { + ll->edgeColumn = -1; + } + + char styleByte = 0; + int styleMask = pdoc->stylingBitsMask; + ll->styleBitsSet = 0; + // Fill base line layout + for (int charInDoc = posLineStart; charInDoc < posLineEnd; charInDoc++) { + char chDoc = pdoc->CharAt(charInDoc); + styleByte = pdoc->StyleAt(charInDoc); + ll->styleBitsSet |= styleByte; + if (vstyle.viewEOL || (!IsEOLChar(chDoc))) { + ll->chars[numCharsInLine] = chDoc; + ll->styles[numCharsInLine] = static_cast(styleByte & styleMask); + ll->indicators[numCharsInLine] = static_cast(styleByte & ~styleMask); + if (vstyle.styles[ll->styles[numCharsInLine]].caseForce == Style::caseUpper) + ll->chars[numCharsInLine] = static_cast(toupper(chDoc)); + else if (vstyle.styles[ll->styles[numCharsInLine]].caseForce == Style::caseLower) + ll->chars[numCharsInLine] = static_cast(tolower(chDoc)); + numCharsInLine++; + } + } + ll->xHighlightGuide = 0; + // Extra element at the end of the line to hold end x position and act as + ll->chars[numCharsInLine] = 0; // Also triggers processing in the loops as this is a control character + ll->styles[numCharsInLine] = styleByte; // For eolFilled + ll->indicators[numCharsInLine] = 0; + + // Layout the line, determining the position of each character, + // with an extra element at the end for the end of the line. + int startseg = 0; // Start of the current segment, in char. number + int startsegx = 0; // Start of the current segment, in pixels + ll->positions[0] = 0; + unsigned int tabWidth = vstyle.spaceWidth * pdoc->tabInChars; + bool lastSegItalics = false; + Font &ctrlCharsFont = vstyle.styles[STYLE_CONTROLCHAR].font; + + int ctrlCharWidth[32] = {0}; + bool isControlNext = IsControlCharacter(ll->chars[0]); + for (int charInLine = 0; charInLine < numCharsInLine; charInLine++) { + bool isControl = isControlNext; + isControlNext = IsControlCharacter(ll->chars[charInLine + 1]); + if ((ll->styles[charInLine] != ll->styles[charInLine + 1]) || + isControl || isControlNext) { + ll->positions[startseg] = 0; + if (vstyle.styles[ll->styles[charInLine]].visible) { + if (isControl) { + if (ll->chars[charInLine] == '\t') { + ll->positions[charInLine + 1] = ((((startsegx + 2) / + tabWidth) + 1) * tabWidth) - startsegx; + } else if (controlCharSymbol < 32) { + if (ctrlCharWidth[ll->chars[charInLine]] == 0) { + const char *ctrlChar = ControlCharacterString(ll->chars[charInLine]); + // +3 For a blank on front and rounded edge each side: + ctrlCharWidth[ll->chars[charInLine]] = + surface->WidthText(ctrlCharsFont, ctrlChar, istrlen(ctrlChar)) + 3; + } + ll->positions[charInLine + 1] = ctrlCharWidth[ll->chars[charInLine]]; + } else { + char cc[2] = { static_cast(controlCharSymbol), '\0' }; + surface->MeasureWidths(ctrlCharsFont, cc, 1, + ll->positions + startseg + 1); + } + lastSegItalics = false; + } else { // Regular character + int lenSeg = charInLine - startseg + 1; + if ((lenSeg == 1) && (' ' == ll->chars[startseg])) { + lastSegItalics = false; + // Over half the segments are single characters and of these about half are space characters. + ll->positions[charInLine + 1] = vstyle.styles[ll->styles[charInLine]].spaceWidth; + } else { + lastSegItalics = vstyle.styles[ll->styles[charInLine]].italic; + surface->MeasureWidths(vstyle.styles[ll->styles[charInLine]].font, ll->chars + startseg, + lenSeg, ll->positions + startseg + 1); + } + } + } else { // invisible + for (int posToZero = startseg; posToZero <= (charInLine + 1); posToZero++) { + ll->positions[posToZero] = 0; + } + } + for (int posToIncrease = startseg; posToIncrease <= (charInLine + 1); posToIncrease++) { + ll->positions[posToIncrease] += startsegx; + } + startsegx = ll->positions[charInLine + 1]; + startseg = charInLine + 1; + } + } + // Small hack to make lines that end with italics not cut off the edge of the last character + if ((startseg > 0) && lastSegItalics) { + ll->positions[startseg] += 2; + } + ll->numCharsInLine = numCharsInLine; + ll->validity = LineLayout::llPositions; + } + // Hard to cope when too narrow, so just assume there is space + if (width < 20) { + width = 20; + } + if ((ll->validity == LineLayout::llPositions) || (ll->widthLine != width)) { + ll->widthLine = width; + if (width == LineLayout::wrapWidthInfinite) { + ll->lines = 1; + } else if (width > ll->positions[ll->numCharsInLine]) { + // Simple common case where line does not need wrapping. + ll->lines = 1; + } else { + if (wrapVisualFlags & SC_WRAPVISUALFLAG_END) { + width -= vstyle.aveCharWidth; // take into account the space for end wrap mark + } + ll->lines = 0; + // Calculate line start positions based upon width. + // For now this is simplistic - wraps on byte rather than character and + // in the middle of words. Should search for spaces or style changes. + int lastGoodBreak = 0; + int lastLineStart = 0; + int startOffset = 0; + int p = 0; + while (p < ll->numCharsInLine) { + if ((ll->positions[p + 1] - startOffset) >= width) { + if (lastGoodBreak == lastLineStart) { + // Try moving to start of last character + if (p > 0) { + lastGoodBreak = pdoc->MovePositionOutsideChar(p + posLineStart, -1) + - posLineStart; + } + if (lastGoodBreak == lastLineStart) { + // Ensure at least one character on line. + lastGoodBreak = pdoc->MovePositionOutsideChar(lastGoodBreak + posLineStart + 1, 1) + - posLineStart; + } + } + lastLineStart = lastGoodBreak; + ll->lines++; + ll->SetLineStart(ll->lines, lastGoodBreak); + startOffset = ll->positions[lastGoodBreak]; + // take into account the space for start wrap mark and indent + startOffset -= actualWrapVisualStartIndent * vstyle.aveCharWidth; + p = lastGoodBreak + 1; + continue; + } + if (p > 0) { + if (wrapState == eWrapChar) { + lastGoodBreak = pdoc->MovePositionOutsideChar(p + posLineStart, -1) + - posLineStart; + p = pdoc->MovePositionOutsideChar(p + 1 + posLineStart, 1) - posLineStart; + continue; + } else if (ll->styles[p] != ll->styles[p - 1]) { + lastGoodBreak = p; + } else if (IsSpaceOrTab(ll->chars[p - 1]) && !IsSpaceOrTab(ll->chars[p])) { + lastGoodBreak = p; + } + } + p++; + } + ll->lines++; + } + ll->validity = LineLayout::llLines; + } +} + +ColourAllocated Editor::SelectionBackground(ViewStyle &vsDraw) { + return primarySelection ? vsDraw.selbackground.allocated : vsDraw.selbackground2.allocated; +} + +ColourAllocated Editor::TextBackground(ViewStyle &vsDraw, bool overrideBackground, + ColourAllocated background, bool inSelection, bool inHotspot, int styleMain, int i, LineLayout *ll) { + if (inSelection) { + if (vsDraw.selbackset && (vsDraw.selAlpha == SC_ALPHA_NOALPHA)) { + return SelectionBackground(vsDraw); + } + } else { + if ((vsDraw.edgeState == EDGE_BACKGROUND) && + (i >= ll->edgeColumn) && + !IsEOLChar(ll->chars[i])) + return vsDraw.edgecolour.allocated; + if (inHotspot && vsDraw.hotspotBackgroundSet) + return vsDraw.hotspotBackground.allocated; + if (overrideBackground) + return background; + } + return vsDraw.styles[styleMain].back.allocated; +} + +void Editor::DrawIndentGuide(Surface *surface, int lineVisible, int lineHeight, int start, PRectangle rcSegment, bool highlight) { + Point from(0, ((lineVisible & 1) && (lineHeight & 1)) ? 1 : 0); + PRectangle rcCopyArea(start + 1, rcSegment.top, start + 2, rcSegment.bottom); + surface->Copy(rcCopyArea, from, + highlight ? *pixmapIndentGuideHighlight : *pixmapIndentGuide); +} + +void Editor::DrawWrapMarker(Surface *surface, PRectangle rcPlace, + bool isEndMarker, ColourAllocated wrapColour) { + surface->PenColour(wrapColour); + + enum { xa = 1 }; // gap before start + int w = rcPlace.right - rcPlace.left - xa - 1; + + bool xStraight = isEndMarker; // x-mirrored symbol for start marker + bool yStraight = true; + //bool yStraight= isEndMarker; // comment in for start marker y-mirrowed + + int x0 = xStraight ? rcPlace.left : rcPlace.right - 1; + int y0 = yStraight ? rcPlace.top : rcPlace.bottom - 1; + + int dy = (rcPlace.bottom - rcPlace.top) / 5; + int y = (rcPlace.bottom - rcPlace.top) / 2 + dy; + + struct Relative { + Surface *surface; + int xBase; + int xDir; + int yBase; + int yDir; + void MoveTo(int xRelative, int yRelative) { + surface->MoveTo(xBase + xDir * xRelative, yBase + yDir * yRelative); + } + void LineTo(int xRelative, int yRelative) { + surface->LineTo(xBase + xDir * xRelative, yBase + yDir * yRelative); + } + }; + Relative rel = {surface, x0, xStraight ? 1 : -1, y0, yStraight ? 1 : -1}; + + // arrow head + rel.MoveTo(xa, y); + rel.LineTo(xa + 2*w / 3, y - dy); + rel.MoveTo(xa, y); + rel.LineTo(xa + 2*w / 3, y + dy); + + // arrow body + rel.MoveTo(xa, y); + rel.LineTo(xa + w, y); + rel.LineTo(xa + w, y - 2 * dy); + rel.LineTo(xa - 1, // on windows lineto is exclusive endpoint, perhaps GTK not... + y - 2 * dy); +} + +static void SimpleAlphaRectangle(Surface *surface, PRectangle rc, ColourAllocated fill, int alpha) { + if (alpha != SC_ALPHA_NOALPHA) { + surface->AlphaRectangle(rc, 0, fill, alpha, fill, alpha, 0); + } +} + +void Editor::DrawEOL(Surface *surface, ViewStyle &vsDraw, PRectangle rcLine, LineLayout *ll, + int line, int lineEnd, int xStart, int subLine, int subLineStart, + bool overrideBackground, ColourAllocated background, + bool drawWrapMarkEnd, ColourAllocated wrapColour) { + + int styleMask = pdoc->stylingBitsMask; + PRectangle rcSegment = rcLine; + + // Fill in a PRectangle representing the end of line characters + int xEol = ll->positions[lineEnd] - subLineStart; + rcSegment.left = xEol + xStart; + rcSegment.right = xEol + vsDraw.aveCharWidth + xStart; + int posLineEnd = pdoc->LineStart(line + 1); + bool eolInSelection = (subLine == (ll->lines - 1)) && + (posLineEnd > ll->selStart) && (posLineEnd <= ll->selEnd) && (ll->selStart != ll->selEnd); + + if (eolInSelection && vsDraw.selbackset && (line < pdoc->LinesTotal() - 1) && (vsDraw.selAlpha == SC_ALPHA_NOALPHA)) { + surface->FillRectangle(rcSegment, SelectionBackground(vsDraw)); + } else { + if (overrideBackground) { + surface->FillRectangle(rcSegment, background); + } else { + surface->FillRectangle(rcSegment, vsDraw.styles[ll->styles[ll->numCharsInLine] & styleMask].back.allocated); + } + if (eolInSelection && vsDraw.selbackset && (line < pdoc->LinesTotal() - 1) && (vsDraw.selAlpha != SC_ALPHA_NOALPHA)) { + SimpleAlphaRectangle(surface, rcSegment, SelectionBackground(vsDraw), vsDraw.selAlpha); + } + } + + rcSegment.left = xEol + vsDraw.aveCharWidth + xStart; + rcSegment.right = rcLine.right; + if (overrideBackground) { + surface->FillRectangle(rcSegment, background); + } else if (vsDraw.styles[ll->styles[ll->numCharsInLine] & styleMask].eolFilled) { + surface->FillRectangle(rcSegment, vsDraw.styles[ll->styles[ll->numCharsInLine] & styleMask].back.allocated); + } else { + surface->FillRectangle(rcSegment, vsDraw.styles[STYLE_DEFAULT].back.allocated); + } + + if (drawWrapMarkEnd) { + PRectangle rcPlace = rcSegment; + + if (wrapVisualFlagsLocation & SC_WRAPVISUALFLAGLOC_END_BY_TEXT) { + rcPlace.left = xEol + xStart; + rcPlace.right = rcPlace.left + vsDraw.aveCharWidth; + } else { + // draw left of the right text margin, to avoid clipping by the current clip rect + rcPlace.right = rcLine.right - vs.rightMarginWidth; + rcPlace.left = rcPlace.right - vsDraw.aveCharWidth; + } + DrawWrapMarker(surface, rcPlace, true, wrapColour); + } +} + +void Editor::DrawLine(Surface *surface, ViewStyle &vsDraw, int line, int lineVisible, int xStart, + PRectangle rcLine, LineLayout *ll, int subLine) { + + PRectangle rcSegment = rcLine; + + // Using one font for all control characters so it can be controlled independently to ensure + // the box goes around the characters tightly. Seems to be no way to work out what height + // is taken by an individual character - internal leading gives varying results. + Font &ctrlCharsFont = vsDraw.styles[STYLE_CONTROLCHAR].font; + + // See if something overrides the line background color: Either if caret is on the line + // and background color is set for that, or if a marker is defined that forces its background + // color onto the line, or if a marker is defined but has no selection margin in which to + // display itself (as long as it's not an SC_MARK_EMPTY marker). These are checked in order + // with the earlier taking precedence. When multiple markers cause background override, + // the color for the highest numbered one is used. + bool overrideBackground = false; + ColourAllocated background; + if (caret.active && vsDraw.showCaretLineBackground && (vsDraw.caretLineAlpha == SC_ALPHA_NOALPHA) && ll->containsCaret) { + overrideBackground = true; + background = vsDraw.caretLineBackground.allocated; + } + if (!overrideBackground) { + int marks = pdoc->GetMark(line); + for (int markBit = 0; (markBit < 32) && marks; markBit++) { + if ((marks & 1) && (vsDraw.markers[markBit].markType == SC_MARK_BACKGROUND) && + (vsDraw.markers[markBit].alpha == SC_ALPHA_NOALPHA)) { + background = vsDraw.markers[markBit].back.allocated; + overrideBackground = true; + } + marks >>= 1; + } + } + if (!overrideBackground) { + if (vsDraw.maskInLine) { + int marksMasked = pdoc->GetMark(line) & vsDraw.maskInLine; + if (marksMasked) { + for (int markBit = 0; (markBit < 32) && marksMasked; markBit++) { + if ((marksMasked & 1) && (vsDraw.markers[markBit].markType != SC_MARK_EMPTY) && + (vsDraw.markers[markBit].alpha == SC_ALPHA_NOALPHA)) { + overrideBackground = true; + background = vsDraw.markers[markBit].back.allocated; + } + marksMasked >>= 1; + } + } + } + } + + bool drawWhitespaceBackground = (vsDraw.viewWhitespace != wsInvisible) && + (!overrideBackground) && (vsDraw.whitespaceBackgroundSet); + + bool inIndentation = subLine == 0; // Do not handle indentation except on first subline. + int indentWidth = pdoc->IndentSize() * vsDraw.spaceWidth; + + int posLineStart = pdoc->LineStart(line); + + int startseg = ll->LineStart(subLine); + int subLineStart = ll->positions[startseg]; + int lineStart = 0; + int lineEnd = 0; + if (subLine < ll->lines) { + lineStart = ll->LineStart(subLine); + lineEnd = ll->LineStart(subLine + 1); + } + + bool drawWrapMarkEnd = false; + + if (wrapVisualFlags & SC_WRAPVISUALFLAG_END) { + if (subLine + 1 < ll->lines) { + drawWrapMarkEnd = ll->LineStart(subLine + 1) != 0; + } + } + + if (actualWrapVisualStartIndent != 0) { + + bool continuedWrapLine = false; + if (subLine < ll->lines) { + continuedWrapLine = ll->LineStart(subLine) != 0; + } + + if (continuedWrapLine) { + // draw continuation rect + PRectangle rcPlace = rcSegment; + + rcPlace.left = ll->positions[startseg] + xStart - subLineStart; + rcPlace.right = rcPlace.left + actualWrapVisualStartIndent * vsDraw.aveCharWidth; + + // default bgnd here.. + surface->FillRectangle(rcSegment, vsDraw.styles[STYLE_DEFAULT].back.allocated); + + // main line style would be below but this would be inconsistent with end markers + // also would possibly not be the style at wrap point + //int styleMain = ll->styles[lineStart]; + //surface->FillRectangle(rcPlace, vsDraw.styles[styleMain].back.allocated); + + if (wrapVisualFlags & SC_WRAPVISUALFLAG_START) { + + if (wrapVisualFlagsLocation & SC_WRAPVISUALFLAGLOC_START_BY_TEXT) + rcPlace.left = rcPlace.right - vsDraw.aveCharWidth; + else + rcPlace.right = rcPlace.left + vsDraw.aveCharWidth; + + DrawWrapMarker(surface, rcPlace, false, vsDraw.whitespaceForeground.allocated); + } + + xStart += actualWrapVisualStartIndent * vsDraw.aveCharWidth; + } + } + + int i; + + // Background drawing loop + for (i = lineStart; twoPhaseDraw && (i < lineEnd); i++) { + + int iDoc = i + posLineStart; + // If there is the end of a style run for any reason + if ((ll->styles[i] != ll->styles[i + 1]) || + i == (lineEnd - 1) || + IsControlCharacter(ll->chars[i]) || IsControlCharacter(ll->chars[i + 1]) || + ((ll->selStart != ll->selEnd) && ((iDoc + 1 == ll->selStart) || (iDoc + 1 == ll->selEnd))) || + (i == (ll->edgeColumn - 1))) { + rcSegment.left = ll->positions[startseg] + xStart - subLineStart; + rcSegment.right = ll->positions[i + 1] + xStart - subLineStart; + // Only try to draw if really visible - enhances performance by not calling environment to + // draw strings that are completely past the right side of the window. + if ((rcSegment.left <= rcLine.right) && (rcSegment.right >= rcLine.left)) { + int styleMain = ll->styles[i]; + bool inSelection = (iDoc >= ll->selStart) && (iDoc < ll->selEnd) && (ll->selStart != ll->selEnd); + bool inHotspot = (ll->hsStart != -1) && (iDoc >= ll->hsStart) && (iDoc < ll->hsEnd); + ColourAllocated textBack = TextBackground(vsDraw, overrideBackground, background, inSelection, inHotspot, styleMain, i, ll); + if (ll->chars[i] == '\t') { + // Tab display + if (drawWhitespaceBackground && + (!inIndentation || vsDraw.viewWhitespace == wsVisibleAlways)) + textBack = vsDraw.whitespaceBackground.allocated; + surface->FillRectangle(rcSegment, textBack); + } else if (IsControlCharacter(ll->chars[i])) { + // Control character display + inIndentation = false; + surface->FillRectangle(rcSegment, textBack); + } else { + // Normal text display + surface->FillRectangle(rcSegment, textBack); + if (vsDraw.viewWhitespace != wsInvisible || + (inIndentation && vsDraw.viewIndentationGuides)) { + for (int cpos = 0; cpos <= i - startseg; cpos++) { + if (ll->chars[cpos + startseg] == ' ') { + if (drawWhitespaceBackground && + (!inIndentation || vsDraw.viewWhitespace == wsVisibleAlways)) { + PRectangle rcSpace(ll->positions[cpos + startseg] + xStart, rcSegment.top, + ll->positions[cpos + startseg + 1] + xStart, rcSegment.bottom); + surface->FillRectangle(rcSpace, vsDraw.whitespaceBackground.allocated); + } + } else { + inIndentation = false; + } + } + } + } + } else if (rcSegment.left > rcLine.right) { + break; + } + startseg = i + 1; + } + } + + if (twoPhaseDraw) { + DrawEOL(surface, vsDraw, rcLine, ll, line, lineEnd, + xStart, subLine, subLineStart, overrideBackground, background, + drawWrapMarkEnd, vsDraw.whitespaceForeground.allocated); + } + + inIndentation = subLine == 0; // Do not handle indentation except on first subline. + startseg = ll->LineStart(subLine); + // Foreground drawing loop + for (i = lineStart; i < lineEnd; i++) { + + int iDoc = i + posLineStart; + // If there is the end of a style run for any reason + if ((ll->styles[i] != ll->styles[i + 1]) || + i == (lineEnd - 1) || + IsControlCharacter(ll->chars[i]) || IsControlCharacter(ll->chars[i + 1]) || + ((ll->selStart != ll->selEnd) && ((iDoc + 1 == ll->selStart) || (iDoc + 1 == ll->selEnd))) || + (i == (ll->edgeColumn - 1))) { + rcSegment.left = ll->positions[startseg] + xStart - subLineStart; + rcSegment.right = ll->positions[i + 1] + xStart - subLineStart; + // Only try to draw if really visible - enhances performance by not calling environment to + // draw strings that are completely past the right side of the window. + if ((rcSegment.left <= rcLine.right) && (rcSegment.right >= rcLine.left)) { + int styleMain = ll->styles[i]; + ColourAllocated textFore = vsDraw.styles[styleMain].fore.allocated; + Font &textFont = vsDraw.styles[styleMain].font; + //hotspot foreground + if (ll->hsStart != -1 && iDoc >= ll->hsStart && iDoc < hsEnd) { + if (vsDraw.hotspotForegroundSet) + textFore = vsDraw.hotspotForeground.allocated; + } + bool inSelection = (iDoc >= ll->selStart) && (iDoc < ll->selEnd) && (ll->selStart != ll->selEnd); + if (inSelection && (vsDraw.selforeset)) { + textFore = vsDraw.selforeground.allocated; + } + bool inHotspot = (ll->hsStart != -1) && (iDoc >= ll->hsStart) && (iDoc < ll->hsEnd); + ColourAllocated textBack = TextBackground(vsDraw, overrideBackground, background, inSelection, inHotspot, styleMain, i, ll); + if (ll->chars[i] == '\t') { + // Tab display + if (!twoPhaseDraw) { + if (drawWhitespaceBackground && + (!inIndentation || vsDraw.viewWhitespace == wsVisibleAlways)) + textBack = vsDraw.whitespaceBackground.allocated; + surface->FillRectangle(rcSegment, textBack); + } + if ((vsDraw.viewWhitespace != wsInvisible) || ((inIndentation && vsDraw.viewIndentationGuides))) { + if (vsDraw.whitespaceForegroundSet) + textFore = vsDraw.whitespaceForeground.allocated; + surface->PenColour(textFore); + } + if (inIndentation && vsDraw.viewIndentationGuides) { + for (int xIG = ll->positions[i] / indentWidth * indentWidth; xIG < ll->positions[i + 1]; xIG += indentWidth) { + if (xIG >= ll->positions[i] && xIG > 0) { + DrawIndentGuide(surface, lineVisible, vsDraw.lineHeight, xIG + xStart, rcSegment, + (ll->xHighlightGuide == xIG)); + } + } + } + if (vsDraw.viewWhitespace != wsInvisible) { + if (!inIndentation || vsDraw.viewWhitespace == wsVisibleAlways) { + PRectangle rcTab(rcSegment.left + 1, rcSegment.top + 4, + rcSegment.right - 1, rcSegment.bottom - vsDraw.maxDescent); + DrawTabArrow(surface, rcTab, rcSegment.top + vsDraw.lineHeight / 2); + } + } + } else if (IsControlCharacter(ll->chars[i])) { + // Control character display + inIndentation = false; + if (controlCharSymbol < 32) { + // Draw the character + const char *ctrlChar = ControlCharacterString(ll->chars[i]); + if (!twoPhaseDraw) { + surface->FillRectangle(rcSegment, textBack); + } + int normalCharHeight = surface->Ascent(ctrlCharsFont) - + surface->InternalLeading(ctrlCharsFont); + PRectangle rcCChar = rcSegment; + rcCChar.left = rcCChar.left + 1; + rcCChar.top = rcSegment.top + vsDraw.maxAscent - normalCharHeight; + rcCChar.bottom = rcSegment.top + vsDraw.maxAscent + 1; + PRectangle rcCentral = rcCChar; + rcCentral.top++; + rcCentral.bottom--; + surface->FillRectangle(rcCentral, textFore); + PRectangle rcChar = rcCChar; + rcChar.left++; + rcChar.right--; + surface->DrawTextClipped(rcChar, ctrlCharsFont, + rcSegment.top + vsDraw.maxAscent, ctrlChar, istrlen(ctrlChar), + textBack, textFore); + } else { + char cc[2] = { static_cast(controlCharSymbol), '\0' }; + surface->DrawTextNoClip(rcSegment, ctrlCharsFont, + rcSegment.top + vsDraw.maxAscent, + cc, 1, textBack, textFore); + } + } else { + // Normal text display + if (vsDraw.styles[styleMain].visible) { + if (twoPhaseDraw) { + surface->DrawTextTransparent(rcSegment, textFont, + rcSegment.top + vsDraw.maxAscent, ll->chars + startseg, + i - startseg + 1, textFore); + } else { + surface->DrawTextNoClip(rcSegment, textFont, + rcSegment.top + vsDraw.maxAscent, ll->chars + startseg, + i - startseg + 1, textFore, textBack); + } + } + if (vsDraw.viewWhitespace != wsInvisible || + (inIndentation && vsDraw.viewIndentationGuides)) { + for (int cpos = 0; cpos <= i - startseg; cpos++) { + if (ll->chars[cpos + startseg] == ' ') { + if (vsDraw.viewWhitespace != wsInvisible) { + if (vsDraw.whitespaceForegroundSet) + textFore = vsDraw.whitespaceForeground.allocated; + if (!inIndentation || vsDraw.viewWhitespace == wsVisibleAlways) { + int xmid = (ll->positions[cpos + startseg] + ll->positions[cpos + startseg + 1]) / 2; + if (!twoPhaseDraw && drawWhitespaceBackground && + (!inIndentation || vsDraw.viewWhitespace == wsVisibleAlways)) { + textBack = vsDraw.whitespaceBackground.allocated; + PRectangle rcSpace(ll->positions[cpos + startseg] + xStart, rcSegment.top, ll->positions[cpos + startseg + 1] + xStart, rcSegment.bottom); + surface->FillRectangle(rcSpace, textBack); + } + PRectangle rcDot(xmid + xStart - subLineStart, rcSegment.top + vsDraw.lineHeight / 2, 0, 0); + rcDot.right = rcDot.left + 1; + rcDot.bottom = rcDot.top + 1; + surface->FillRectangle(rcDot, textFore); + } + } + if (inIndentation && vsDraw.viewIndentationGuides) { + int startSpace = ll->positions[cpos + startseg]; + if (startSpace > 0 && (startSpace % indentWidth == 0)) { + DrawIndentGuide(surface, lineVisible, vsDraw.lineHeight, startSpace + xStart, rcSegment, + (ll->xHighlightGuide == ll->positions[cpos + startseg])); + } + } + } else { + inIndentation = false; + } + } + } + } + if (ll->hsStart != -1 && vsDraw.hotspotUnderline && iDoc >= ll->hsStart && iDoc < ll->hsEnd ) { + PRectangle rcUL = rcSegment; + rcUL.top = rcUL.top + vsDraw.maxAscent + 1; + rcUL.bottom = rcUL.top + 1; + if (vsDraw.hotspotForegroundSet) + surface->FillRectangle(rcUL, vsDraw.hotspotForeground.allocated); + else + surface->FillRectangle(rcUL, textFore); + } else if (vsDraw.styles[styleMain].underline) { + PRectangle rcUL = rcSegment; + rcUL.top = rcUL.top + vsDraw.maxAscent + 1; + rcUL.bottom = rcUL.top + 1; + surface->FillRectangle(rcUL, textFore); + } + } else if (rcSegment.left > rcLine.right) { + break; + } + startseg = i + 1; + } + } + + // Draw indicators + // foreach indicator... + for (int indicnum = 0, mask = 1 << pdoc->stylingBits; mask < 0x100; indicnum++) { + if (!(mask & ll->styleBitsSet)) { + mask <<= 1; + continue; + } + int startPos = -1; + // foreach style pos in line... + for (int indicPos = lineStart; indicPos <= lineEnd; indicPos++) { + // look for starts... + if (startPos < 0) { + // NOT in indicator run, looking for START + if (indicPos < lineEnd && (ll->indicators[indicPos] & mask)) + startPos = indicPos; + } + // ... or ends + if (startPos >= 0) { + // IN indicator run, looking for END + if (indicPos >= lineEnd || !(ll->indicators[indicPos] & mask)) { + // AT end of indicator run, DRAW it! + PRectangle rcIndic( + ll->positions[startPos] + xStart - subLineStart, + rcLine.top + vsDraw.maxAscent, + ll->positions[indicPos] + xStart - subLineStart, + rcLine.top + vsDraw.maxAscent + 3); + vsDraw.indicators[indicnum].Draw(surface, rcIndic, rcLine); + // RESET control var + startPos = -1; + } + } + } + mask <<= 1; + } + // End of the drawing of the current line + if (!twoPhaseDraw) { + DrawEOL(surface, vsDraw, rcLine, ll, line, lineEnd, + xStart, subLine, subLineStart, overrideBackground, background, + drawWrapMarkEnd, vsDraw.whitespaceForeground.allocated); + } + if ((vsDraw.selAlpha != SC_ALPHA_NOALPHA) && (ll->selStart >= 0) && (ll->selEnd >= 0)) { + int startPosSel = (ll->selStart < posLineStart) ? posLineStart : ll->selStart; + int endPosSel = (ll->selEnd < (lineEnd + posLineStart)) ? ll->selEnd : (lineEnd + posLineStart); + if (startPosSel < endPosSel) { + rcSegment.left = xStart + ll->positions[startPosSel - posLineStart] - subLineStart; + rcSegment.right = xStart + ll->positions[endPosSel - posLineStart] - subLineStart; + SimpleAlphaRectangle(surface, rcSegment, SelectionBackground(vsDraw), vsDraw.selAlpha); + } + } + + if (vsDraw.edgeState == EDGE_LINE) { + int edgeX = theEdge * vsDraw.spaceWidth; + rcSegment.left = edgeX + xStart; + rcSegment.right = rcSegment.left + 1; + surface->FillRectangle(rcSegment, vsDraw.edgecolour.allocated); + } + + // Draw any translucent whole line states + rcSegment.left = xStart; + rcSegment.right = rcLine.right - 1; + if (caret.active && vsDraw.showCaretLineBackground && ll->containsCaret) { + SimpleAlphaRectangle(surface, rcSegment, vsDraw.caretLineBackground.allocated, vsDraw.caretLineAlpha); + } + int marks = pdoc->GetMark(line); + for (int markBit = 0; (markBit < 32) && marks; markBit++) { + if ((marks & 1) && (vsDraw.markers[markBit].markType == SC_MARK_BACKGROUND)) { + SimpleAlphaRectangle(surface, rcSegment, vsDraw.markers[markBit].back.allocated, vsDraw.markers[markBit].alpha); + } + marks >>= 1; + } + if (vsDraw.maskInLine) { + int marksMasked = pdoc->GetMark(line) & vsDraw.maskInLine; + if (marksMasked) { + for (int markBit = 0; (markBit < 32) && marksMasked; markBit++) { + if ((marksMasked & 1) && (vsDraw.markers[markBit].markType != SC_MARK_EMPTY)) { + SimpleAlphaRectangle(surface, rcSegment, vsDraw.markers[markBit].back.allocated, vsDraw.markers[markBit].alpha); + } + marksMasked >>= 1; + } + } + } +} + +void Editor::RefreshPixMaps(Surface *surfaceWindow) { + if (!pixmapSelPattern->Initialised()) { + const int patternSize = 8; + pixmapSelPattern->InitPixMap(patternSize, patternSize, surfaceWindow, wMain.GetID()); + // This complex procedure is to reproduce the checkerboard dithered pattern used by windows + // for scroll bars and Visual Studio for its selection margin. The colour of this pattern is half + // way between the chrome colour and the chrome highlight colour making a nice transition + // between the window chrome and the content area. And it works in low colour depths. + PRectangle rcPattern(0, 0, patternSize, patternSize); + + // Initialize default colours based on the chrome colour scheme. Typically the highlight is white. + ColourAllocated colourFMFill = vs.selbar.allocated; + ColourAllocated colourFMStripes = vs.selbarlight.allocated; + + if (!(vs.selbarlight.desired == ColourDesired(0xff, 0xff, 0xff))) { + // User has chosen an unusual chrome colour scheme so just use the highlight edge colour. + // (Typically, the highlight colour is white.) + colourFMFill = vs.selbarlight.allocated; + } + + if (vs.foldmarginColourSet) { + // override default fold margin colour + colourFMFill = vs.foldmarginColour.allocated; + } + if (vs.foldmarginHighlightColourSet) { + // override default fold margin highlight colour + colourFMStripes = vs.foldmarginHighlightColour.allocated; + } + + pixmapSelPattern->FillRectangle(rcPattern, colourFMFill); + pixmapSelPattern->PenColour(colourFMStripes); + for (int stripe = 0; stripe < patternSize; stripe++) { + // Alternating 1 pixel stripes is same as checkerboard. + pixmapSelPattern->MoveTo(0, stripe * 2); + pixmapSelPattern->LineTo(patternSize, stripe * 2 - patternSize); + } + } + + if (!pixmapIndentGuide->Initialised()) { + // 1 extra pixel in height so can handle odd/even positions and so produce a continuous line + pixmapIndentGuide->InitPixMap(1, vs.lineHeight + 1, surfaceWindow, wMain.GetID()); + pixmapIndentGuideHighlight->InitPixMap(1, vs.lineHeight + 1, surfaceWindow, wMain.GetID()); + PRectangle rcIG(0, 0, 1, vs.lineHeight); + pixmapIndentGuide->FillRectangle(rcIG, vs.styles[STYLE_INDENTGUIDE].back.allocated); + pixmapIndentGuide->PenColour(vs.styles[STYLE_INDENTGUIDE].fore.allocated); + pixmapIndentGuideHighlight->FillRectangle(rcIG, vs.styles[STYLE_BRACELIGHT].back.allocated); + pixmapIndentGuideHighlight->PenColour(vs.styles[STYLE_BRACELIGHT].fore.allocated); + for (int stripe = 1; stripe < vs.lineHeight + 1; stripe += 2) { + pixmapIndentGuide->MoveTo(0, stripe); + pixmapIndentGuide->LineTo(2, stripe); + pixmapIndentGuideHighlight->MoveTo(0, stripe); + pixmapIndentGuideHighlight->LineTo(2, stripe); + } + } + + if (bufferedDraw) { + if (!pixmapLine->Initialised()) { + PRectangle rcClient = GetClientRectangle(); + pixmapLine->InitPixMap(rcClient.Width(), vs.lineHeight, + surfaceWindow, wMain.GetID()); + pixmapSelMargin->InitPixMap(vs.fixedColumnWidth, + rcClient.Height(), surfaceWindow, wMain.GetID()); + } + } +} + +void Editor::Paint(Surface *surfaceWindow, PRectangle rcArea) { + //Platform::DebugPrintf("Paint:%1d (%3d,%3d) ... (%3d,%3d)\n", + // paintingAllText, rcArea.left, rcArea.top, rcArea.right, rcArea.bottom); + + RefreshStyleData(); + RefreshPixMaps(surfaceWindow); + + PRectangle rcClient = GetClientRectangle(); + //Platform::DebugPrintf("Client: (%3d,%3d) ... (%3d,%3d) %d\n", + // rcClient.left, rcClient.top, rcClient.right, rcClient.bottom); + + surfaceWindow->SetPalette(&palette, true); + pixmapLine->SetPalette(&palette, !hasFocus); + + int screenLinePaintFirst = rcArea.top / vs.lineHeight; + // The area to be painted plus one extra line is styled. + // The extra line is to determine when a style change, such as starting a comment flows on to other lines. + int lineStyleLast = topLine + (rcArea.bottom - 1) / vs.lineHeight + 1; + //Platform::DebugPrintf("Paint lines = %d .. %d\n", topLine + screenLinePaintFirst, lineStyleLast); + int endPosPaint = pdoc->Length(); + if (lineStyleLast < cs.LinesDisplayed()) + endPosPaint = pdoc->LineStart(cs.DocFromDisplay(lineStyleLast + 1)); + + int xStart = vs.fixedColumnWidth - xOffset; + int ypos = 0; + if (!bufferedDraw) + ypos += screenLinePaintFirst * vs.lineHeight; + int yposScreen = screenLinePaintFirst * vs.lineHeight; + + // Ensure we are styled as far as we are painting. + pdoc->EnsureStyledTo(endPosPaint); + bool paintAbandonedByStyling = paintState == paintAbandoned; + if (needUpdateUI) { + NotifyUpdateUI(); + needUpdateUI = false; + RefreshStyleData(); + RefreshPixMaps(surfaceWindow); + } + + // Call priority lines wrap on a window of lines which are likely + // to rendered with the following paint (that is wrap the visible + // lines first). + int startLineToWrap = cs.DocFromDisplay(topLine) - 5; + if (startLineToWrap < 0) + startLineToWrap = -1; + if (WrapLines(false, startLineToWrap)) { + // The wrapping process has changed the height of some lines so + // abandon this paint for a complete repaint. + if (AbandonPaint()) { + return; + } + RefreshPixMaps(surfaceWindow); // In case pixmaps invalidated by scrollbar change + } + PLATFORM_ASSERT(pixmapSelPattern->Initialised()); + + PaintSelMargin(surfaceWindow, rcArea); + + PRectangle rcRightMargin = rcClient; + rcRightMargin.left = rcRightMargin.right - vs.rightMarginWidth; + if (rcArea.Intersects(rcRightMargin)) { + surfaceWindow->FillRectangle(rcRightMargin, vs.styles[STYLE_DEFAULT].back.allocated); + } + + if (paintState == paintAbandoned) { + // Either styling or NotifyUpdateUI noticed that painting is needed + // outside the current painting rectangle + //Platform::DebugPrintf("Abandoning paint\n"); + if (wrapState != eWrapNone) { + if (paintAbandonedByStyling) { + // Styling has spilled over a line end, such as occurs by starting a multiline + // comment. The width of subsequent text may have changed, so rewrap. + NeedWrapping(cs.DocFromDisplay(topLine)); + } + } + return; + } + //Platform::DebugPrintf("start display %d, offset = %d\n", pdoc->Length(), xOffset); + + // Do the painting + if (rcArea.right > vs.fixedColumnWidth) { + + Surface *surface = surfaceWindow; + if (bufferedDraw) { + surface = pixmapLine; + PLATFORM_ASSERT(pixmapLine->Initialised()); + } + surface->SetUnicodeMode(IsUnicodeMode()); + surface->SetDBCSMode(CodePage()); + + int visibleLine = topLine + screenLinePaintFirst; + + int posCaret = currentPos; + if (posDrag >= 0) + posCaret = posDrag; + int lineCaret = pdoc->LineFromPosition(posCaret); + + // Remove selection margin from drawing area so text will not be drawn + // on it in unbuffered mode. + PRectangle rcTextArea = rcClient; + rcTextArea.left = vs.fixedColumnWidth; + rcTextArea.right -= vs.rightMarginWidth; + surfaceWindow->SetClip(rcTextArea); + + // Loop on visible lines + //double durLayout = 0.0; + //double durPaint = 0.0; + //double durCopy = 0.0; + //ElapsedTime etWhole; + int lineDocPrevious = -1; // Used to avoid laying out one document line multiple times + AutoLineLayout ll(llc, 0); + SelectionLineIterator lineIterator(this); + while (visibleLine < cs.LinesDisplayed() && yposScreen < rcArea.bottom) { + + int lineDoc = cs.DocFromDisplay(visibleLine); + // Only visible lines should be handled by the code within the loop + PLATFORM_ASSERT(cs.GetVisible(lineDoc)); + int lineStartSet = cs.DisplayFromDoc(lineDoc); + int subLine = visibleLine - lineStartSet; + + // Copy this line and its styles from the document into local arrays + // and determine the x position at which each character starts. + //ElapsedTime et; + if (lineDoc != lineDocPrevious) { + ll.Set(0); + // For rectangular selection this accesses the layout cache so should be after layout returned. + lineIterator.SetAt(lineDoc); + ll.Set(RetrieveLineLayout(lineDoc)); + LayoutLine(lineDoc, surface, vs, ll, wrapWidth); + lineDocPrevious = lineDoc; + } + //durLayout += et.Duration(true); + + if (ll) { + if (selType == selStream) { + ll->selStart = SelectionStart(); + ll->selEnd = SelectionEnd(); + } else { + ll->selStart = lineIterator.startPos; + ll->selEnd = lineIterator.endPos; + } + ll->containsCaret = lineDoc == lineCaret; + if (hideSelection) { + ll->selStart = -1; + ll->selEnd = -1; + ll->containsCaret = false; + } + + GetHotSpotRange(ll->hsStart, ll->hsEnd); + + PRectangle rcLine = rcClient; + rcLine.top = ypos; + rcLine.bottom = ypos + vs.lineHeight; + + Range rangeLine(pdoc->LineStart(lineDoc), pdoc->LineStart(lineDoc + 1)); + // Highlight the current braces if any + ll->SetBracesHighlight(rangeLine, braces, static_cast(bracesMatchStyle), + highlightGuideColumn * vs.spaceWidth); + + // Draw the line + DrawLine(surface, vs, lineDoc, visibleLine, xStart, rcLine, ll, subLine); + //durPaint += et.Duration(true); + + // Restore the previous styles for the brace highlights in case layout is in cache. + ll->RestoreBracesHighlight(rangeLine, braces); + + bool expanded = cs.GetExpanded(lineDoc); + if ((foldFlags & SC_FOLDFLAG_BOX) == 0) { + // Paint the line above the fold + if ((expanded && (foldFlags & SC_FOLDFLAG_LINEBEFORE_EXPANDED)) + || + (!expanded && (foldFlags & SC_FOLDFLAG_LINEBEFORE_CONTRACTED))) { + if (pdoc->GetLevel(lineDoc) & SC_FOLDLEVELHEADERFLAG) { + PRectangle rcFoldLine = rcLine; + rcFoldLine.bottom = rcFoldLine.top + 1; + surface->FillRectangle(rcFoldLine, vs.styles[STYLE_DEFAULT].fore.allocated); + } + } + // Paint the line below the fold + if ((expanded && (foldFlags & SC_FOLDFLAG_LINEAFTER_EXPANDED)) + || + (!expanded && (foldFlags & SC_FOLDFLAG_LINEAFTER_CONTRACTED))) { + if (pdoc->GetLevel(lineDoc) & SC_FOLDLEVELHEADERFLAG) { + PRectangle rcFoldLine = rcLine; + rcFoldLine.top = rcFoldLine.bottom - 1; + surface->FillRectangle(rcFoldLine, vs.styles[STYLE_DEFAULT].fore.allocated); + } + } + } else { + int FoldLevelCurr = (pdoc->GetLevel(lineDoc) & SC_FOLDLEVELNUMBERMASK) - SC_FOLDLEVELBASE; + int FoldLevelPrev = (pdoc->GetLevel(lineDoc - 1) & SC_FOLDLEVELNUMBERMASK) - SC_FOLDLEVELBASE; + int FoldLevelFlags = (pdoc->GetLevel(lineDoc) & ~SC_FOLDLEVELNUMBERMASK) & ~(0xFFF0000); + int indentationStep = pdoc->IndentSize(); + // Draw line above fold + if ((FoldLevelPrev < FoldLevelCurr) + || + (FoldLevelFlags & SC_FOLDLEVELBOXHEADERFLAG + && + (pdoc->GetLevel(lineDoc - 1) & SC_FOLDLEVELBOXFOOTERFLAG) == 0)) { + PRectangle rcFoldLine = rcLine; + rcFoldLine.bottom = rcFoldLine.top + 1; + rcFoldLine.left += xStart + FoldLevelCurr * vs.spaceWidth * indentationStep - 1; + surface->FillRectangle(rcFoldLine, vs.styles[STYLE_DEFAULT].fore.allocated); + } + + // Line below the fold (or below a contracted fold) + if (FoldLevelFlags & SC_FOLDLEVELBOXFOOTERFLAG + || + (!expanded && (foldFlags & SC_FOLDFLAG_LINEAFTER_CONTRACTED))) { + PRectangle rcFoldLine = rcLine; + rcFoldLine.top = rcFoldLine.bottom - 1; + rcFoldLine.left += xStart + (FoldLevelCurr) * vs.spaceWidth * indentationStep - 1; + surface->FillRectangle(rcFoldLine, vs.styles[STYLE_DEFAULT].fore.allocated); + } + + PRectangle rcBoxLine = rcLine; + // Draw vertical line for every fold level + for (int i = 0; i <= FoldLevelCurr; i++) { + rcBoxLine.left = xStart + i * vs.spaceWidth * indentationStep - 1; + rcBoxLine.right = rcBoxLine.left + 1; + surface->FillRectangle(rcBoxLine, vs.styles[STYLE_DEFAULT].fore.allocated); + } + } + + // Draw the Caret + if (lineDoc == lineCaret) { + int offset = Platform::Minimum(posCaret - rangeLine.start, ll->maxLineLength); + if ((offset >= ll->LineStart(subLine)) && + ((offset < ll->LineStart(subLine + 1)) || offset == ll->numCharsInLine)) { + int xposCaret = ll->positions[offset] - ll->positions[ll->LineStart(subLine)] + xStart; + + if (actualWrapVisualStartIndent != 0) { + int lineStart = ll->LineStart(subLine); + if (lineStart != 0) // Wrapped + xposCaret += actualWrapVisualStartIndent * vs.aveCharWidth; + } + int widthOverstrikeCaret; + if (posCaret == pdoc->Length()) { // At end of document + widthOverstrikeCaret = vs.aveCharWidth; + } else if ((posCaret - rangeLine.start) >= ll->numCharsInLine) { // At end of line + widthOverstrikeCaret = vs.aveCharWidth; + } else { + widthOverstrikeCaret = ll->positions[offset + 1] - ll->positions[offset]; + } + if (widthOverstrikeCaret < 3) // Make sure its visible + widthOverstrikeCaret = 3; + if (((caret.active && caret.on) || (posDrag >= 0)) && xposCaret >= 0) { + PRectangle rcCaret = rcLine; + int caretWidthOffset = 0; + if ((offset > 0) && (vs.caretWidth > 1)) + caretWidthOffset = 1; // Move back so overlaps both character cells. + if (posDrag >= 0) { + rcCaret.left = xposCaret - caretWidthOffset; + rcCaret.right = rcCaret.left + vs.caretWidth; + } else { + if (inOverstrike) { + rcCaret.top = rcCaret.bottom - 2; + rcCaret.left = xposCaret + 1; + rcCaret.right = rcCaret.left + widthOverstrikeCaret - 1; + } else { + rcCaret.left = xposCaret - caretWidthOffset; + rcCaret.right = rcCaret.left + vs.caretWidth; + } + } + surface->FillRectangle(rcCaret, vs.caretcolour.allocated); + } + } + } + + if (bufferedDraw) { + Point from(vs.fixedColumnWidth, 0); + PRectangle rcCopyArea(vs.fixedColumnWidth, yposScreen, + rcClient.right, yposScreen + vs.lineHeight); + surfaceWindow->Copy(rcCopyArea, from, *pixmapLine); + } + //durCopy += et.Duration(true); + } + + if (!bufferedDraw) { + ypos += vs.lineHeight; + } + + yposScreen += vs.lineHeight; + visibleLine++; + //gdk_flush(); + } + ll.Set(0); + //if (durPaint < 0.00000001) + // durPaint = 0.00000001; + + // Right column limit indicator + PRectangle rcBeyondEOF = rcClient; + rcBeyondEOF.left = vs.fixedColumnWidth; + rcBeyondEOF.right = rcBeyondEOF.right; + rcBeyondEOF.top = (cs.LinesDisplayed() - topLine) * vs.lineHeight; + if (rcBeyondEOF.top < rcBeyondEOF.bottom) { + surfaceWindow->FillRectangle(rcBeyondEOF, vs.styles[STYLE_DEFAULT].back.allocated); + if (vs.edgeState == EDGE_LINE) { + int edgeX = theEdge * vs.spaceWidth; + rcBeyondEOF.left = edgeX + xStart; + rcBeyondEOF.right = rcBeyondEOF.left + 1; + surfaceWindow->FillRectangle(rcBeyondEOF, vs.edgecolour.allocated); + } + } + //Platform::DebugPrintf( + //"Layout:%9.6g Paint:%9.6g Ratio:%9.6g Copy:%9.6g Total:%9.6g\n", + //durLayout, durPaint, durLayout / durPaint, durCopy, etWhole.Duration()); + NotifyPainted(); + } +} + +// Space (3 space characters) between line numbers and text when printing. +#define lineNumberPrintSpace " " + +ColourDesired InvertedLight(ColourDesired orig) { + unsigned int r = orig.GetRed(); + unsigned int g = orig.GetGreen(); + unsigned int b = orig.GetBlue(); + unsigned int l = (r + g + b) / 3; // There is a better calculation for this that matches human eye + unsigned int il = 0xff - l; + if (l == 0) + return ColourDesired(0xff, 0xff, 0xff); + r = r * il / l; + g = g * il / l; + b = b * il / l; + return ColourDesired(Platform::Minimum(r, 0xff), Platform::Minimum(g, 0xff), Platform::Minimum(b, 0xff)); +} + +// This is mostly copied from the Paint method but with some things omitted +// such as the margin markers, line numbers, selection and caret +// Should be merged back into a combined Draw method. +long Editor::FormatRange(bool draw, RangeToFormat *pfr) { + if (!pfr) + return 0; + + AutoSurface surface(pfr->hdc, this); + if (!surface) + return 0; + AutoSurface surfaceMeasure(pfr->hdcTarget, this); + if (!surfaceMeasure) { + return 0; + } + + ViewStyle vsPrint(vs); + + // Modify the view style for printing as do not normally want any of the transient features to be printed + // Printing supports only the line number margin. + int lineNumberIndex = -1; + for (int margin = 0; margin < ViewStyle::margins; margin++) { + if ((vsPrint.ms[margin].style == SC_MARGIN_NUMBER) && (vsPrint.ms[margin].width > 0)) { + lineNumberIndex = margin; + } else { + vsPrint.ms[margin].width = 0; + } + } + vsPrint.showMarkedLines = false; + vsPrint.fixedColumnWidth = 0; + vsPrint.zoomLevel = printMagnification; + vsPrint.viewIndentationGuides = false; + // Don't show the selection when printing + vsPrint.selbackset = false; + vsPrint.selforeset = false; + vsPrint.selAlpha = SC_ALPHA_NOALPHA; + vsPrint.whitespaceBackgroundSet = false; + vsPrint.whitespaceForegroundSet = false; + vsPrint.showCaretLineBackground = false; + + // Set colours for printing according to users settings + for (int sty = 0;sty <= STYLE_MAX;sty++) { + if (printColourMode == SC_PRINT_INVERTLIGHT) { + vsPrint.styles[sty].fore.desired = InvertedLight(vsPrint.styles[sty].fore.desired); + vsPrint.styles[sty].back.desired = InvertedLight(vsPrint.styles[sty].back.desired); + } else if (printColourMode == SC_PRINT_BLACKONWHITE) { + vsPrint.styles[sty].fore.desired = ColourDesired(0, 0, 0); + vsPrint.styles[sty].back.desired = ColourDesired(0xff, 0xff, 0xff); + } else if (printColourMode == SC_PRINT_COLOURONWHITE) { + vsPrint.styles[sty].back.desired = ColourDesired(0xff, 0xff, 0xff); + } else if (printColourMode == SC_PRINT_COLOURONWHITEDEFAULTBG) { + if (sty <= STYLE_DEFAULT) { + vsPrint.styles[sty].back.desired = ColourDesired(0xff, 0xff, 0xff); + } + } + } + // White background for the line numbers + vsPrint.styles[STYLE_LINENUMBER].back.desired = ColourDesired(0xff, 0xff, 0xff); + + vsPrint.Refresh(*surfaceMeasure); + // Ensure colours are set up + vsPrint.RefreshColourPalette(palette, true); + vsPrint.RefreshColourPalette(palette, false); + // Determining width must hapen after fonts have been realised in Refresh + int lineNumberWidth = 0; + if (lineNumberIndex >= 0) { + lineNumberWidth = surfaceMeasure->WidthText(vsPrint.styles[STYLE_LINENUMBER].font, + "99999" lineNumberPrintSpace, 5 + istrlen(lineNumberPrintSpace)); + vsPrint.ms[lineNumberIndex].width = lineNumberWidth; + } + + int linePrintStart = pdoc->LineFromPosition(pfr->chrg.cpMin); + int linePrintLast = linePrintStart + (pfr->rc.bottom - pfr->rc.top) / vsPrint.lineHeight - 1; + if (linePrintLast < linePrintStart) + linePrintLast = linePrintStart; + int linePrintMax = pdoc->LineFromPosition(pfr->chrg.cpMax); + if (linePrintLast > linePrintMax) + linePrintLast = linePrintMax; + //Platform::DebugPrintf("Formatting lines=[%0d,%0d,%0d] top=%0d bottom=%0d line=%0d %0d\n", + // linePrintStart, linePrintLast, linePrintMax, pfr->rc.top, pfr->rc.bottom, vsPrint.lineHeight, + // surfaceMeasure->Height(vsPrint.styles[STYLE_LINENUMBER].font)); + int endPosPrint = pdoc->Length(); + if (linePrintLast < pdoc->LinesTotal()) + endPosPrint = pdoc->LineStart(linePrintLast + 1); + + // Ensure we are styled to where we are formatting. + pdoc->EnsureStyledTo(endPosPrint); + + int xStart = vsPrint.fixedColumnWidth + pfr->rc.left + lineNumberWidth; + int ypos = pfr->rc.top; + + int lineDoc = linePrintStart; + + int nPrintPos = pfr->chrg.cpMin; + int visibleLine = 0; + int widthPrint = pfr->rc.Width() - lineNumberWidth; + if (printWrapState == eWrapNone) + widthPrint = LineLayout::wrapWidthInfinite; + + while (lineDoc <= linePrintLast && ypos < pfr->rc.bottom) { + + // When printing, the hdc and hdcTarget may be the same, so + // changing the state of surfaceMeasure may change the underlying + // state of surface. Therefore, any cached state is discarded before + // using each surface. + surfaceMeasure->FlushCachedState(); + + // Copy this line and its styles from the document into local arrays + // and determine the x position at which each character starts. + LineLayout ll(8000); + LayoutLine(lineDoc, surfaceMeasure, vsPrint, &ll, widthPrint); + + ll.selStart = -1; + ll.selEnd = -1; + ll.containsCaret = false; + + PRectangle rcLine; + rcLine.left = pfr->rc.left + lineNumberWidth; + rcLine.top = ypos; + rcLine.right = pfr->rc.right - 1; + rcLine.bottom = ypos + vsPrint.lineHeight; + + // When document line is wrapped over multiple display lines, find where + // to start printing from to ensure a particular position is on the first + // line of the page. + if (visibleLine == 0) { + int startWithinLine = nPrintPos - pdoc->LineStart(lineDoc); + for (int iwl = 0; iwl < ll.lines - 1; iwl++) { + if (ll.LineStart(iwl) <= startWithinLine && ll.LineStart(iwl + 1) >= startWithinLine) { + visibleLine = -iwl; + } + } + + if (ll.lines > 1 && startWithinLine >= ll.LineStart(ll.lines - 1)) { + visibleLine = -(ll.lines - 1); + } + } + + if (draw && lineNumberWidth && + (ypos + vsPrint.lineHeight <= pfr->rc.bottom) && + (visibleLine >= 0)) { + char number[100]; + sprintf(number, "%d" lineNumberPrintSpace, lineDoc + 1); + PRectangle rcNumber = rcLine; + rcNumber.right = rcNumber.left + lineNumberWidth; + // Right justify + rcNumber.left -= surfaceMeasure->WidthText( + vsPrint.styles[STYLE_LINENUMBER].font, number, istrlen(number)); + surface->FlushCachedState(); + surface->DrawTextNoClip(rcNumber, vsPrint.styles[STYLE_LINENUMBER].font, + ypos + vsPrint.maxAscent, number, istrlen(number), + vsPrint.styles[STYLE_LINENUMBER].fore.allocated, + vsPrint.styles[STYLE_LINENUMBER].back.allocated); + } + + // Draw the line + surface->FlushCachedState(); + + for (int iwl = 0; iwl < ll.lines; iwl++) { + if (ypos + vsPrint.lineHeight <= pfr->rc.bottom) { + if (visibleLine >= 0) { + if (draw) { + rcLine.top = ypos; + rcLine.bottom = ypos + vsPrint.lineHeight; + DrawLine(surface, vsPrint, lineDoc, visibleLine, xStart, rcLine, &ll, iwl); + } + ypos += vsPrint.lineHeight; + } + visibleLine++; + if (iwl == ll.lines - 1) + nPrintPos = pdoc->LineStart(lineDoc + 1); + else + nPrintPos += ll.LineStart(iwl + 1) - ll.LineStart(iwl); + } + } + + ++lineDoc; + } + + return nPrintPos; +} + +int Editor::TextWidth(int style, const char *text) { + RefreshStyleData(); + AutoSurface surface(this); + if (surface) { + return surface->WidthText(vs.styles[style].font, text, istrlen(text)); + } else { + return 1; + } +} + +// Empty method is overridden on GTK+ to show / hide scrollbars +void Editor::ReconfigureScrollBars() {} + +void Editor::SetScrollBars() { + RefreshStyleData(); + + int nMax = MaxScrollPos(); + int nPage = LinesOnScreen(); + bool modified = ModifyScrollBars(nMax + nPage - 1, nPage); + if (modified) { + DwellEnd(true); + } + + // TODO: ensure always showing as many lines as possible + // May not be, if, for example, window made larger + if (topLine > MaxScrollPos()) { + SetTopLine(Platform::Clamp(topLine, 0, MaxScrollPos())); + SetVerticalScrollPos(); + Redraw(); + } + if (modified) { + if (!AbandonPaint()) + Redraw(); + } + //Platform::DebugPrintf("end max = %d page = %d\n", nMax, nPage); +} + +void Editor::ChangeSize() { + DropGraphics(); + SetScrollBars(); + if (wrapState != eWrapNone) { + PRectangle rcTextArea = GetClientRectangle(); + rcTextArea.left = vs.fixedColumnWidth; + rcTextArea.right -= vs.rightMarginWidth; + if (wrapWidth != rcTextArea.Width()) { + NeedWrapping(); + Redraw(); + } + } +} + +void Editor::AddChar(char ch) { + char s[2]; + s[0] = ch; + s[1] = '\0'; + AddCharUTF(s, 1); +} + +void Editor::AddCharUTF(char *s, unsigned int len, bool treatAsDBCS) { + bool wasSelection = currentPos != anchor; + ClearSelection(); + bool charReplaceAction = false; + if (inOverstrike && !wasSelection && !RangeContainsProtected(currentPos, currentPos + 1)) { + if (currentPos < (pdoc->Length())) { + if (!IsEOLChar(pdoc->CharAt(currentPos))) { + charReplaceAction = true; + pdoc->BeginUndoAction(); + pdoc->DelChar(currentPos); + } + } + } + if (pdoc->InsertString(currentPos, s, len)) { + SetEmptySelection(currentPos + len); + } + if (charReplaceAction) { + pdoc->EndUndoAction(); + } + EnsureCaretVisible(); + // Avoid blinking during rapid typing: + ShowCaretAtCurrentPosition(); + if (!caretSticky) { + SetLastXChosen(); + } + + if (treatAsDBCS) { + NotifyChar((static_cast(s[0]) << 8) | + static_cast(s[1])); + } else { + int byte = static_cast(s[0]); + if ((byte < 0xC0) || (1 == len)) { + // Handles UTF-8 characters between 0x01 and 0x7F and single byte + // characters when not in UTF-8 mode. + // Also treats \0 and naked trail bytes 0x80 to 0xBF as valid + // characters representing themselves. + } else { + // Unroll 1 to 3 byte UTF-8 sequences. See reference data at: + // http://www.cl.cam.ac.uk/~mgk25/unicode.html + // http://www.cl.cam.ac.uk/~mgk25/ucs/examples/UTF-8-test.txt + if (byte < 0xE0) { + int byte2 = static_cast(s[1]); + if ((byte2 & 0xC0) == 0x80) { + // Two-byte-character lead-byte followed by a trail-byte. + byte = (((byte & 0x1F) << 6) | (byte2 & 0x3F)); + } + // A two-byte-character lead-byte not followed by trail-byte + // represents itself. + } else if (byte < 0xF0) { + int byte2 = static_cast(s[1]); + int byte3 = static_cast(s[2]); + if (((byte2 & 0xC0) == 0x80) && ((byte3 & 0xC0) == 0x80)) { + // Three-byte-character lead byte followed by two trail bytes. + byte = (((byte & 0x0F) << 12) | ((byte2 & 0x3F) << 6) | + (byte3 & 0x3F)); + } + // A three-byte-character lead-byte not followed by two trail-bytes + // represents itself. + } + } + NotifyChar(byte); + } +} + +void Editor::ClearSelection() { + if (!SelectionContainsProtected()) { + int startPos = SelectionStart(); + if (selType == selStream) { + unsigned int chars = SelectionEnd() - startPos; + if (0 != chars) { + pdoc->BeginUndoAction(); + pdoc->DeleteChars(startPos, chars); + pdoc->EndUndoAction(); + } + } else { + pdoc->BeginUndoAction(); + SelectionLineIterator lineIterator(this, false); + while (lineIterator.Iterate()) { + startPos = lineIterator.startPos; + unsigned int chars = lineIterator.endPos - startPos; + if (0 != chars) { + pdoc->DeleteChars(startPos, chars); + } + } + pdoc->EndUndoAction(); + selType = selStream; + } + SetEmptySelection(startPos); + } +} + +void Editor::ClearAll() { + pdoc->BeginUndoAction(); + if (0 != pdoc->Length()) { + pdoc->DeleteChars(0, pdoc->Length()); + } + if (!pdoc->IsReadOnly()) { + cs.Clear(); + } + pdoc->EndUndoAction(); + anchor = 0; + currentPos = 0; + SetTopLine(0); + SetVerticalScrollPos(); + InvalidateStyleRedraw(); +} + +void Editor::ClearDocumentStyle() { + pdoc->StartStyling(0, '\377'); + pdoc->SetStyleFor(pdoc->Length(), 0); + cs.ShowAll(); + pdoc->ClearLevels(); +} + +void Editor::Cut() { + if (!pdoc->IsReadOnly() && !SelectionContainsProtected()) { + Copy(); + ClearSelection(); + } +} + +void Editor::PasteRectangular(int pos, const char *ptr, int len) { + if (pdoc->IsReadOnly() || SelectionContainsProtected()) { + return; + } + currentPos = pos; + int xInsert = XFromPosition(currentPos); + int line = pdoc->LineFromPosition(currentPos); + bool prevCr = false; + pdoc->BeginUndoAction(); + for (int i = 0; i < len; i++) { + if (IsEOLChar(ptr[i])) { + if ((ptr[i] == '\r') || (!prevCr)) + line++; + if (line >= pdoc->LinesTotal()) { + if (pdoc->eolMode != SC_EOL_LF) + pdoc->InsertChar(pdoc->Length(), '\r'); + if (pdoc->eolMode != SC_EOL_CR) + pdoc->InsertChar(pdoc->Length(), '\n'); + } + // Pad the end of lines with spaces if required + currentPos = PositionFromLineX(line, xInsert); + if ((XFromPosition(currentPos) < xInsert) && (i + 1 < len)) { + for (int i = 0; i < xInsert - XFromPosition(currentPos); i++) { + pdoc->InsertChar(currentPos, ' '); + currentPos++; + } + } + prevCr = ptr[i] == '\r'; + } else { + pdoc->InsertString(currentPos, ptr + i, 1); + currentPos++; + prevCr = false; + } + } + pdoc->EndUndoAction(); + SetEmptySelection(pos); +} + +bool Editor::CanPaste() { + return !pdoc->IsReadOnly() && !SelectionContainsProtected(); +} + +void Editor::Clear() { + if (currentPos == anchor) { + if (!RangeContainsProtected(currentPos, currentPos + 1)) { + DelChar(); + } + } else { + ClearSelection(); + } + SetEmptySelection(currentPos); +} + +void Editor::SelectAll() { + SetSelection(0, pdoc->Length()); + Redraw(); +} + +void Editor::Undo() { + if (pdoc->CanUndo()) { + InvalidateCaret(); + int newPos = pdoc->Undo(); + if (newPos >= 0) + SetEmptySelection(newPos); + EnsureCaretVisible(); + } +} + +void Editor::Redo() { + if (pdoc->CanRedo()) { + int newPos = pdoc->Redo(); + if (newPos >= 0) + SetEmptySelection(newPos); + EnsureCaretVisible(); + } +} + +void Editor::DelChar() { + if (!RangeContainsProtected(currentPos, currentPos + 1)) { + pdoc->DelChar(currentPos); + } + // Avoid blinking during rapid typing: + ShowCaretAtCurrentPosition(); +} + +void Editor::DelCharBack(bool allowLineStartDeletion) { + if (currentPos == anchor) { + if (!RangeContainsProtected(currentPos - 1, currentPos)) { + int lineCurrentPos = pdoc->LineFromPosition(currentPos); + if (allowLineStartDeletion || (pdoc->LineStart(lineCurrentPos) != currentPos)) { + if (pdoc->GetColumn(currentPos) <= pdoc->GetLineIndentation(lineCurrentPos) && + pdoc->GetColumn(currentPos) > 0 && pdoc->backspaceUnindents) { + pdoc->BeginUndoAction(); + int indentation = pdoc->GetLineIndentation(lineCurrentPos); + int indentationStep = pdoc->IndentSize(); + if (indentation % indentationStep == 0) { + pdoc->SetLineIndentation(lineCurrentPos, indentation - indentationStep); + } else { + pdoc->SetLineIndentation(lineCurrentPos, indentation - (indentation % indentationStep)); + } + SetEmptySelection(pdoc->GetLineIndentPosition(lineCurrentPos)); + pdoc->EndUndoAction(); + } else { + pdoc->DelCharBack(currentPos); + } + } + } + } else { + ClearSelection(); + SetEmptySelection(currentPos); + } + // Avoid blinking during rapid typing: + ShowCaretAtCurrentPosition(); +} + +void Editor::NotifyFocus(bool) {} + +void Editor::NotifyStyleToNeeded(int endStyleNeeded) { + SCNotification scn = {0}; + scn.nmhdr.code = SCN_STYLENEEDED; + scn.position = endStyleNeeded; + NotifyParent(scn); +} + +void Editor::NotifyStyleNeeded(Document*, void *, int endStyleNeeded) { + NotifyStyleToNeeded(endStyleNeeded); +} + +void Editor::NotifyChar(int ch) { + SCNotification scn = {0}; + scn.nmhdr.code = SCN_CHARADDED; + scn.ch = ch; + NotifyParent(scn); + if (recordingMacro) { + char txt[2]; + txt[0] = static_cast(ch); + txt[1] = '\0'; + NotifyMacroRecord(SCI_REPLACESEL, 0, reinterpret_cast(txt)); + } +} + +void Editor::NotifySavePoint(bool isSavePoint) { + SCNotification scn = {0}; + if (isSavePoint) { + scn.nmhdr.code = SCN_SAVEPOINTREACHED; + } else { + scn.nmhdr.code = SCN_SAVEPOINTLEFT; + } + NotifyParent(scn); +} + +void Editor::NotifyModifyAttempt() { + SCNotification scn = {0}; + scn.nmhdr.code = SCN_MODIFYATTEMPTRO; + NotifyParent(scn); +} + +void Editor::NotifyDoubleClick(Point pt, bool) { + SCNotification scn = {0}; + scn.nmhdr.code = SCN_DOUBLECLICK; + scn.line = LineFromLocation(pt); + scn.position = PositionFromLocationClose(pt); + NotifyParent(scn); +} + +void Editor::NotifyHotSpotDoubleClicked(int position, bool shift, bool ctrl, bool alt) { + SCNotification scn = {0}; + scn.nmhdr.code = SCN_HOTSPOTDOUBLECLICK; + scn.position = position; + scn.modifiers = (shift ? SCI_SHIFT : 0) | (ctrl ? SCI_CTRL : 0) | + (alt ? SCI_ALT : 0); + NotifyParent(scn); +} + +void Editor::NotifyHotSpotClicked(int position, bool shift, bool ctrl, bool alt) { + SCNotification scn = {0}; + scn.nmhdr.code = SCN_HOTSPOTCLICK; + scn.position = position; + scn.modifiers = (shift ? SCI_SHIFT : 0) | (ctrl ? SCI_CTRL : 0) | + (alt ? SCI_ALT : 0); + NotifyParent(scn); +} + +void Editor::NotifyUpdateUI() { + SCNotification scn = {0}; + scn.nmhdr.code = SCN_UPDATEUI; + NotifyParent(scn); +} + +void Editor::NotifyPainted() { + SCNotification scn = {0}; + scn.nmhdr.code = SCN_PAINTED; + NotifyParent(scn); +} + +bool Editor::NotifyMarginClick(Point pt, bool shift, bool ctrl, bool alt) { + int marginClicked = -1; + int x = 0; + for (int margin = 0; margin < ViewStyle::margins; margin++) { + if ((pt.x > x) && (pt.x < x + vs.ms[margin].width)) + marginClicked = margin; + x += vs.ms[margin].width; + } + if ((marginClicked >= 0) && vs.ms[marginClicked].sensitive) { + SCNotification scn = {0}; + scn.nmhdr.code = SCN_MARGINCLICK; + scn.modifiers = (shift ? SCI_SHIFT : 0) | (ctrl ? SCI_CTRL : 0) | + (alt ? SCI_ALT : 0); + scn.position = pdoc->LineStart(LineFromLocation(pt)); + scn.margin = marginClicked; + NotifyParent(scn); + return true; + } else { + return false; + } +} + +void Editor::NotifyNeedShown(int pos, int len) { + SCNotification scn = {0}; + scn.nmhdr.code = SCN_NEEDSHOWN; + scn.position = pos; + scn.length = len; + NotifyParent(scn); +} + +void Editor::NotifyDwelling(Point pt, bool state) { + SCNotification scn = {0}; + scn.nmhdr.code = state ? SCN_DWELLSTART : SCN_DWELLEND; + scn.position = PositionFromLocationClose(pt); + scn.x = pt.x; + scn.y = pt.y; + NotifyParent(scn); +} + +void Editor::NotifyZoom() { + SCNotification scn = {0}; + scn.nmhdr.code = SCN_ZOOM; + NotifyParent(scn); +} + +// Notifications from document +void Editor::NotifyModifyAttempt(Document*, void *) { + //Platform::DebugPrintf("** Modify Attempt\n"); + NotifyModifyAttempt(); +} + +void Editor::NotifyMove(int position) { +#ifdef INCLUDE_DEPRECATED_FEATURES + SCNotification scn = {0}; + scn.nmhdr.code = SCN_POSCHANGED; + scn.position = position; + NotifyParent(scn); +#endif +} + +void Editor::NotifySavePoint(Document*, void *, bool atSavePoint) { + //Platform::DebugPrintf("** Save Point %s\n", atSavePoint ? "On" : "Off"); + NotifySavePoint(atSavePoint); +} + +void Editor::CheckModificationForWrap(DocModification mh) { + if (mh.modificationType & (SC_MOD_INSERTTEXT|SC_MOD_DELETETEXT)) { + llc.Invalidate(LineLayout::llCheckTextAndStyle); + if (wrapState != eWrapNone) { + int lineDoc = pdoc->LineFromPosition(mh.position); + int lines = Platform::Maximum(0, mh.linesAdded); + NeedWrapping(lineDoc, lineDoc + lines + 1); + } + } +} + +// Move a position so it is still after the same character as before the insertion. +static inline int MovePositionForInsertion(int position, int startInsertion, int length) { + if (position > startInsertion) { + return position + length; + } + return position; +} + +// Move a position so it is still after the same character as before the deletion if that +// character is still present else after the previous surviving character. +static inline int MovePositionForDeletion(int position, int startDeletion, int length) { + if (position > startDeletion) { + int endDeletion = startDeletion + length; + if (position > endDeletion) { + return position - length; + } else { + return startDeletion; + } + } else { + return position; + } +} + +void Editor::NotifyModified(Document*, DocModification mh, void *) { + needUpdateUI = true; + if (paintState == painting) { + CheckForChangeOutsidePaint(Range(mh.position, mh.position + mh.length)); + } + if (mh.modificationType & SC_MOD_CHANGESTYLE) { + pdoc->IncrementStyleClock(); + if (paintState == notPainting) { + if (mh.position < pdoc->LineStart(topLine)) { + // Styling performed before this view + Redraw(); + } else { + InvalidateRange(mh.position, mh.position + mh.length); + } + } + llc.Invalidate(LineLayout::llCheckTextAndStyle); + } else { + // Move selection and brace highlights + if (mh.modificationType & SC_MOD_INSERTTEXT) { + currentPos = MovePositionForInsertion(currentPos, mh.position, mh.length); + anchor = MovePositionForInsertion(anchor, mh.position, mh.length); + braces[0] = MovePositionForInsertion(braces[0], mh.position, mh.length); + braces[1] = MovePositionForInsertion(braces[1], mh.position, mh.length); + } else if (mh.modificationType & SC_MOD_DELETETEXT) { + currentPos = MovePositionForDeletion(currentPos, mh.position, mh.length); + anchor = MovePositionForDeletion(anchor, mh.position, mh.length); + braces[0] = MovePositionForDeletion(braces[0], mh.position, mh.length); + braces[1] = MovePositionForDeletion(braces[1], mh.position, mh.length); + } + if (cs.LinesDisplayed() < cs.LinesInDoc()) { + // Some lines are hidden so may need shown. + // TODO: check if the modified area is hidden. + if (mh.modificationType & SC_MOD_BEFOREINSERT) { + NotifyNeedShown(mh.position, 0); + } else if (mh.modificationType & SC_MOD_BEFOREDELETE) { + NotifyNeedShown(mh.position, mh.length); + } + } + if (mh.linesAdded != 0) { + // Update contraction state for inserted and removed lines + // lineOfPos should be calculated in context of state before modification, shouldn't it + int lineOfPos = pdoc->LineFromPosition(mh.position); + if (mh.linesAdded > 0) { + cs.InsertLines(lineOfPos, mh.linesAdded); + } else { + cs.DeleteLines(lineOfPos, -mh.linesAdded); + } + } + CheckModificationForWrap(mh); + if (mh.linesAdded != 0) { + // Avoid scrolling of display if change before current display + if (mh.position < posTopLine && !CanDeferToLastStep(mh)) { + int newTop = Platform::Clamp(topLine + mh.linesAdded, 0, MaxScrollPos()); + if (newTop != topLine) { + SetTopLine(newTop); + SetVerticalScrollPos(); + } + } + + //Platform::DebugPrintf("** %x Doc Changed\n", this); + // TODO: could invalidate from mh.startModification to end of screen + //InvalidateRange(mh.position, mh.position + mh.length); + if (paintState == notPainting && !CanDeferToLastStep(mh)) { + Redraw(); + } + } else { + //Platform::DebugPrintf("** %x Line Changed %d .. %d\n", this, + // mh.position, mh.position + mh.length); + if (paintState == notPainting && mh.length && !CanEliminate(mh)) { + InvalidateRange(mh.position, mh.position + mh.length); + } + } + } + + if (mh.linesAdded != 0 && !CanDeferToLastStep(mh)) { + SetScrollBars(); + } + + if (mh.modificationType & SC_MOD_CHANGEMARKER) { + if ((paintState == notPainting) || !PaintContainsMargin()) { + if (mh.modificationType & SC_MOD_CHANGEFOLD) { + // Fold changes can affect the drawing of following lines so redraw whole margin + RedrawSelMargin(); + } else { + RedrawSelMargin(mh.line); + } + } + } + + // NOW pay the piper WRT "deferred" visual updates + if (IsLastStep(mh)) { + SetScrollBars(); + Redraw(); + } + + // If client wants to see this modification + if (mh.modificationType & modEventMask) { + if ((mh.modificationType & SC_MOD_CHANGESTYLE) == 0) { + // Real modification made to text of document. + NotifyChange(); // Send EN_CHANGE + } + + SCNotification scn = {0}; + scn.nmhdr.code = SCN_MODIFIED; + scn.position = mh.position; + scn.modificationType = mh.modificationType; + scn.text = mh.text; + scn.length = mh.length; + scn.linesAdded = mh.linesAdded; + scn.line = mh.line; + scn.foldLevelNow = mh.foldLevelNow; + scn.foldLevelPrev = mh.foldLevelPrev; + NotifyParent(scn); + } +} + +void Editor::NotifyDeleted(Document *, void *) { + /* Do nothing */ +} + +void Editor::NotifyMacroRecord(unsigned int iMessage, uptr_t wParam, sptr_t lParam) { + + // Enumerates all macroable messages + switch (iMessage) { + case SCI_CUT: + case SCI_COPY: + case SCI_PASTE: + case SCI_CLEAR: + case SCI_REPLACESEL: + case SCI_ADDTEXT: + case SCI_INSERTTEXT: + case SCI_APPENDTEXT: + case SCI_CLEARALL: + case SCI_SELECTALL: + case SCI_GOTOLINE: + case SCI_GOTOPOS: + case SCI_SEARCHANCHOR: + case SCI_SEARCHNEXT: + case SCI_SEARCHPREV: + case SCI_LINEDOWN: + case SCI_LINEDOWNEXTEND: + case SCI_PARADOWN: + case SCI_PARADOWNEXTEND: + case SCI_LINEUP: + case SCI_LINEUPEXTEND: + case SCI_PARAUP: + case SCI_PARAUPEXTEND: + case SCI_CHARLEFT: + case SCI_CHARLEFTEXTEND: + case SCI_CHARRIGHT: + case SCI_CHARRIGHTEXTEND: + case SCI_WORDLEFT: + case SCI_WORDLEFTEXTEND: + case SCI_WORDRIGHT: + case SCI_WORDRIGHTEXTEND: + case SCI_WORDPARTLEFT: + case SCI_WORDPARTLEFTEXTEND: + case SCI_WORDPARTRIGHT: + case SCI_WORDPARTRIGHTEXTEND: + case SCI_WORDLEFTEND: + case SCI_WORDLEFTENDEXTEND: + case SCI_WORDRIGHTEND: + case SCI_WORDRIGHTENDEXTEND: + case SCI_HOME: + case SCI_HOMEEXTEND: + case SCI_LINEEND: + case SCI_LINEENDEXTEND: + case SCI_HOMEWRAP: + case SCI_HOMEWRAPEXTEND: + case SCI_LINEENDWRAP: + case SCI_LINEENDWRAPEXTEND: + case SCI_DOCUMENTSTART: + case SCI_DOCUMENTSTARTEXTEND: + case SCI_DOCUMENTEND: + case SCI_DOCUMENTENDEXTEND: + case SCI_STUTTEREDPAGEUP: + case SCI_STUTTEREDPAGEUPEXTEND: + case SCI_STUTTEREDPAGEDOWN: + case SCI_STUTTEREDPAGEDOWNEXTEND: + case SCI_PAGEUP: + case SCI_PAGEUPEXTEND: + case SCI_PAGEDOWN: + case SCI_PAGEDOWNEXTEND: + case SCI_EDITTOGGLEOVERTYPE: + case SCI_CANCEL: + case SCI_DELETEBACK: + case SCI_TAB: + case SCI_BACKTAB: + case SCI_FORMFEED: + case SCI_VCHOME: + case SCI_VCHOMEEXTEND: + case SCI_VCHOMEWRAP: + case SCI_VCHOMEWRAPEXTEND: + case SCI_DELWORDLEFT: + case SCI_DELWORDRIGHT: + case SCI_DELLINELEFT: + case SCI_DELLINERIGHT: + case SCI_LINECOPY: + case SCI_LINECUT: + case SCI_LINEDELETE: + case SCI_LINETRANSPOSE: + case SCI_LINEDUPLICATE: + case SCI_LOWERCASE: + case SCI_UPPERCASE: + case SCI_LINESCROLLDOWN: + case SCI_LINESCROLLUP: + case SCI_DELETEBACKNOTLINE: + case SCI_HOMEDISPLAY: + case SCI_HOMEDISPLAYEXTEND: + case SCI_LINEENDDISPLAY: + case SCI_LINEENDDISPLAYEXTEND: + case SCI_SETSELECTIONMODE: + case SCI_LINEDOWNRECTEXTEND: + case SCI_LINEUPRECTEXTEND: + case SCI_CHARLEFTRECTEXTEND: + case SCI_CHARRIGHTRECTEXTEND: + case SCI_HOMERECTEXTEND: + case SCI_VCHOMERECTEXTEND: + case SCI_LINEENDRECTEXTEND: + case SCI_PAGEUPRECTEXTEND: + case SCI_PAGEDOWNRECTEXTEND: + case SCI_SELECTIONDUPLICATE: + break; + + // Filter out all others like display changes. Also, newlines are redundant + // with char insert messages. + case SCI_NEWLINE: + default: + // printf("Filtered out %ld of macro recording\n", iMessage); + return ; + } + + // Send notification + SCNotification scn = {0}; + scn.nmhdr.code = SCN_MACRORECORD; + scn.message = iMessage; + scn.wParam = wParam; + scn.lParam = lParam; + NotifyParent(scn); +} + +/** + * Force scroll and keep position relative to top of window. + * + * If stuttered = true and not already at first/last row, move to first/last row of window. + * If stuttered = true and already at first/last row, scroll as normal. + */ +void Editor::PageMove(int direction, selTypes sel, bool stuttered) { + int topLineNew, newPos; + + // I consider only the caretYSlop, and ignore the caretYPolicy-- is that a problem? + int currentLine = pdoc->LineFromPosition(currentPos); + int topStutterLine = topLine + caretYSlop; + int bottomStutterLine = topLine + LinesToScroll() - caretYSlop; + + if (stuttered && (direction < 0 && currentLine > topStutterLine)) { + topLineNew = topLine; + newPos = PositionFromLocation(Point(lastXChosen, vs.lineHeight * caretYSlop)); + + } else if (stuttered && (direction > 0 && currentLine < bottomStutterLine)) { + topLineNew = topLine; + newPos = PositionFromLocation(Point(lastXChosen, vs.lineHeight * (LinesToScroll() - caretYSlop))); + + } else { + Point pt = LocationFromPosition(currentPos); + + topLineNew = Platform::Clamp( + topLine + direction * LinesToScroll(), 0, MaxScrollPos()); + newPos = PositionFromLocation( + Point(lastXChosen, pt.y + direction * (vs.lineHeight * LinesToScroll()))); + } + + if (topLineNew != topLine) { + SetTopLine(topLineNew); + MovePositionTo(newPos, sel); + Redraw(); + SetVerticalScrollPos(); + } else { + MovePositionTo(newPos, sel); + } +} + +void Editor::ChangeCaseOfSelection(bool makeUpperCase) { + pdoc->BeginUndoAction(); + int startCurrent = currentPos; + int startAnchor = anchor; + if (selType == selStream) { + pdoc->ChangeCase(Range(SelectionStart(), SelectionEnd()), + makeUpperCase); + SetSelection(startCurrent, startAnchor); + } else { + SelectionLineIterator lineIterator(this, false); + while (lineIterator.Iterate()) { + pdoc->ChangeCase( + Range(lineIterator.startPos, lineIterator.endPos), + makeUpperCase); + } + // Would be nicer to keep the rectangular selection but this is complex + SetEmptySelection(startCurrent); + } + pdoc->EndUndoAction(); +} + +void Editor::LineTranspose() { + int line = pdoc->LineFromPosition(currentPos); + if (line > 0) { + int startPrev = pdoc->LineStart(line - 1); + int endPrev = pdoc->LineEnd(line - 1); + int start = pdoc->LineStart(line); + int end = pdoc->LineEnd(line); + int startNext = pdoc->LineStart(line + 1); + if (end < pdoc->Length()) { + end = startNext; + char *thisLine = CopyRange(start, end); + pdoc->DeleteChars(start, end - start); + if (pdoc->InsertString(startPrev, thisLine, end - start)) { + MovePositionTo(startPrev + end - start); + } + delete []thisLine; + } else { + // Last line so line has no line end + char *thisLine = CopyRange(start, end); + char *prevEnd = CopyRange(endPrev, start); + pdoc->DeleteChars(endPrev, end - endPrev); + pdoc->InsertString(startPrev, thisLine, end - start); + if (pdoc->InsertString(startPrev + end - start, prevEnd, start - endPrev)) { + MovePositionTo(startPrev + end - endPrev); + } + delete []thisLine; + delete []prevEnd; + } + + } +} + +void Editor::Duplicate(bool forLine) { + int start = SelectionStart(); + int end = SelectionEnd(); + if (start == end) { + forLine = true; + } + if (forLine) { + int line = pdoc->LineFromPosition(currentPos); + start = pdoc->LineStart(line); + end = pdoc->LineEnd(line); + } + char *text = CopyRange(start, end); + if (forLine) { + const char *eol = StringFromEOLMode(pdoc->eolMode); + pdoc->InsertString(end, eol); + pdoc->InsertString(end + istrlen(eol), text, end - start); + } else { + pdoc->InsertString(end, text, end - start); + } + delete []text; +} + +void Editor::CancelModes() { + moveExtendsSelection = false; +} + +void Editor::NewLine() { + ClearSelection(); + const char *eol = "\n"; + if (pdoc->eolMode == SC_EOL_CRLF) { + eol = "\r\n"; + } else if (pdoc->eolMode == SC_EOL_CR) { + eol = "\r"; + } // else SC_EOL_LF -> "\n" already set + if (pdoc->InsertString(currentPos, eol)) { + SetEmptySelection(currentPos + istrlen(eol)); + while (*eol) { + NotifyChar(*eol); + eol++; + } + } + SetLastXChosen(); + EnsureCaretVisible(); + // Avoid blinking during rapid typing: + ShowCaretAtCurrentPosition(); +} + +void Editor::CursorUpOrDown(int direction, selTypes sel) { + Point pt = LocationFromPosition(currentPos); + int posNew = PositionFromLocation( + Point(lastXChosen, pt.y + direction * vs.lineHeight)); + if (direction < 0) { + // Line wrapping may lead to a location on the same line, so + // seek back if that is the case. + // There is an equivalent case when moving down which skips + // over a line but as that does not trap the user it is fine. + Point ptNew = LocationFromPosition(posNew); + while ((posNew > 0) && (pt.y == ptNew.y)) { + posNew--; + ptNew = LocationFromPosition(posNew); + } + } + MovePositionTo(posNew, sel); +} + +void Editor::ParaUpOrDown(int direction, selTypes sel) { + int lineDoc, savedPos = currentPos; + do { + MovePositionTo(direction > 0 ? pdoc->ParaDown(currentPos) : pdoc->ParaUp(currentPos), sel); + lineDoc = pdoc->LineFromPosition(currentPos); + if (direction > 0) { + if (currentPos >= pdoc->Length() && !cs.GetVisible(lineDoc)) { + if (sel == noSel) { + MovePositionTo(pdoc->LineEndPosition(savedPos)); + } + break; + } + } + } while (!cs.GetVisible(lineDoc)); +} + +int Editor::StartEndDisplayLine(int pos, bool start) { + RefreshStyleData(); + int line = pdoc->LineFromPosition(pos); + AutoSurface surface(this); + AutoLineLayout ll(llc, RetrieveLineLayout(line)); + int posRet = INVALID_POSITION; + if (surface && ll) { + unsigned int posLineStart = pdoc->LineStart(line); + LayoutLine(line, surface, vs, ll, wrapWidth); + int posInLine = pos - posLineStart; + if (posInLine <= ll->maxLineLength) { + for (int subLine = 0; subLine < ll->lines; subLine++) { + if ((posInLine >= ll->LineStart(subLine)) && (posInLine <= ll->LineStart(subLine + 1))) { + if (start) { + posRet = ll->LineStart(subLine) + posLineStart; + } else { + if (subLine == ll->lines - 1) + posRet = ll->LineStart(subLine + 1) + posLineStart; + else + posRet = ll->LineStart(subLine + 1) + posLineStart - 1; + } + } + } + } + } + if (posRet == INVALID_POSITION) { + return pos; + } else { + return posRet; + } +} + +int Editor::KeyCommand(unsigned int iMessage) { + switch (iMessage) { + case SCI_LINEDOWN: + CursorUpOrDown(1); + break; + case SCI_LINEDOWNEXTEND: + CursorUpOrDown(1, selStream); + break; + case SCI_LINEDOWNRECTEXTEND: + CursorUpOrDown(1, selRectangle); + break; + case SCI_PARADOWN: + ParaUpOrDown(1); + break; + case SCI_PARADOWNEXTEND: + ParaUpOrDown(1, selStream); + break; + case SCI_LINESCROLLDOWN: + ScrollTo(topLine + 1); + MoveCaretInsideView(false); + break; + case SCI_LINEUP: + CursorUpOrDown(-1); + break; + case SCI_LINEUPEXTEND: + CursorUpOrDown(-1, selStream); + break; + case SCI_LINEUPRECTEXTEND: + CursorUpOrDown(-1, selRectangle); + break; + case SCI_PARAUP: + ParaUpOrDown(-1); + break; + case SCI_PARAUPEXTEND: + ParaUpOrDown(-1, selStream); + break; + case SCI_LINESCROLLUP: + ScrollTo(topLine - 1); + MoveCaretInsideView(false); + break; + case SCI_CHARLEFT: + if (SelectionEmpty() || moveExtendsSelection) { + MovePositionTo(MovePositionSoVisible(currentPos - 1, -1)); + } else { + MovePositionTo(SelectionStart()); + } + SetLastXChosen(); + break; + case SCI_CHARLEFTEXTEND: + MovePositionTo(MovePositionSoVisible(currentPos - 1, -1), selStream); + SetLastXChosen(); + break; + case SCI_CHARLEFTRECTEXTEND: + MovePositionTo(MovePositionSoVisible(currentPos - 1, -1), selRectangle); + SetLastXChosen(); + break; + case SCI_CHARRIGHT: + if (SelectionEmpty() || moveExtendsSelection) { + MovePositionTo(MovePositionSoVisible(currentPos + 1, 1)); + } else { + MovePositionTo(SelectionEnd()); + } + SetLastXChosen(); + break; + case SCI_CHARRIGHTEXTEND: + MovePositionTo(MovePositionSoVisible(currentPos + 1, 1), selStream); + SetLastXChosen(); + break; + case SCI_CHARRIGHTRECTEXTEND: + MovePositionTo(MovePositionSoVisible(currentPos + 1, 1), selRectangle); + SetLastXChosen(); + break; + case SCI_WORDLEFT: + MovePositionTo(MovePositionSoVisible(pdoc->NextWordStart(currentPos, -1), -1)); + SetLastXChosen(); + break; + case SCI_WORDLEFTEXTEND: + MovePositionTo(MovePositionSoVisible(pdoc->NextWordStart(currentPos, -1), -1), selStream); + SetLastXChosen(); + break; + case SCI_WORDRIGHT: + MovePositionTo(MovePositionSoVisible(pdoc->NextWordStart(currentPos, 1), 1)); + SetLastXChosen(); + break; + case SCI_WORDRIGHTEXTEND: + MovePositionTo(MovePositionSoVisible(pdoc->NextWordStart(currentPos, 1), 1), selStream); + SetLastXChosen(); + break; + + case SCI_WORDLEFTEND: + MovePositionTo(MovePositionSoVisible(pdoc->NextWordEnd(currentPos, -1), -1)); + SetLastXChosen(); + break; + case SCI_WORDLEFTENDEXTEND: + MovePositionTo(MovePositionSoVisible(pdoc->NextWordEnd(currentPos, -1), -1), selStream); + SetLastXChosen(); + break; + case SCI_WORDRIGHTEND: + MovePositionTo(MovePositionSoVisible(pdoc->NextWordEnd(currentPos, 1), 1)); + SetLastXChosen(); + break; + case SCI_WORDRIGHTENDEXTEND: + MovePositionTo(MovePositionSoVisible(pdoc->NextWordEnd(currentPos, 1), 1), selStream); + SetLastXChosen(); + break; + + case SCI_HOME: + MovePositionTo(pdoc->LineStart(pdoc->LineFromPosition(currentPos))); + SetLastXChosen(); + break; + case SCI_HOMEEXTEND: + MovePositionTo(pdoc->LineStart(pdoc->LineFromPosition(currentPos)), selStream); + SetLastXChosen(); + break; + case SCI_HOMERECTEXTEND: + MovePositionTo(pdoc->LineStart(pdoc->LineFromPosition(currentPos)), selRectangle); + SetLastXChosen(); + break; + case SCI_LINEEND: + MovePositionTo(pdoc->LineEndPosition(currentPos)); + SetLastXChosen(); + break; + case SCI_LINEENDEXTEND: + MovePositionTo(pdoc->LineEndPosition(currentPos), selStream); + SetLastXChosen(); + break; + case SCI_LINEENDRECTEXTEND: + MovePositionTo(pdoc->LineEndPosition(currentPos), selRectangle); + SetLastXChosen(); + break; + case SCI_HOMEWRAP: { + int homePos = MovePositionSoVisible(StartEndDisplayLine(currentPos, true), -1); + if (currentPos <= homePos) + homePos = pdoc->LineStart(pdoc->LineFromPosition(currentPos)); + MovePositionTo(homePos); + SetLastXChosen(); + } + break; + case SCI_HOMEWRAPEXTEND: { + int homePos = MovePositionSoVisible(StartEndDisplayLine(currentPos, true), -1); + if (currentPos <= homePos) + homePos = pdoc->LineStart(pdoc->LineFromPosition(currentPos)); + MovePositionTo(homePos, selStream); + SetLastXChosen(); + } + break; + case SCI_LINEENDWRAP: { + int endPos = MovePositionSoVisible(StartEndDisplayLine(currentPos, false), 1); + int realEndPos = pdoc->LineEndPosition(currentPos); + if (endPos > realEndPos // if moved past visible EOLs + || currentPos >= endPos) // if at end of display line already + endPos = realEndPos; + MovePositionTo(endPos); + SetLastXChosen(); + } + break; + case SCI_LINEENDWRAPEXTEND: { + int endPos = MovePositionSoVisible(StartEndDisplayLine(currentPos, false), 1); + int realEndPos = pdoc->LineEndPosition(currentPos); + if (endPos > realEndPos // if moved past visible EOLs + || currentPos >= endPos) // if at end of display line already + endPos = realEndPos; + MovePositionTo(endPos, selStream); + SetLastXChosen(); + } + break; + case SCI_DOCUMENTSTART: + MovePositionTo(0); + SetLastXChosen(); + break; + case SCI_DOCUMENTSTARTEXTEND: + MovePositionTo(0, selStream); + SetLastXChosen(); + break; + case SCI_DOCUMENTEND: + MovePositionTo(pdoc->Length()); + SetLastXChosen(); + break; + case SCI_DOCUMENTENDEXTEND: + MovePositionTo(pdoc->Length(), selStream); + SetLastXChosen(); + break; + case SCI_STUTTEREDPAGEUP: + PageMove(-1, noSel, true); + break; + case SCI_STUTTEREDPAGEUPEXTEND: + PageMove(-1, selStream, true); + break; + case SCI_STUTTEREDPAGEDOWN: + PageMove(1, noSel, true); + break; + case SCI_STUTTEREDPAGEDOWNEXTEND: + PageMove(1, selStream, true); + break; + case SCI_PAGEUP: + PageMove(-1); + break; + case SCI_PAGEUPEXTEND: + PageMove(-1, selStream); + break; + case SCI_PAGEUPRECTEXTEND: + PageMove(-1, selRectangle); + break; + case SCI_PAGEDOWN: + PageMove(1); + break; + case SCI_PAGEDOWNEXTEND: + PageMove(1, selStream); + break; + case SCI_PAGEDOWNRECTEXTEND: + PageMove(1, selRectangle); + break; + case SCI_EDITTOGGLEOVERTYPE: + inOverstrike = !inOverstrike; + DropCaret(); + ShowCaretAtCurrentPosition(); + NotifyUpdateUI(); + break; + case SCI_CANCEL: // Cancel any modes - handled in subclass + // Also unselect text + CancelModes(); + break; + case SCI_DELETEBACK: + DelCharBack(true); + if (!caretSticky) { + SetLastXChosen(); + } + EnsureCaretVisible(); + break; + case SCI_DELETEBACKNOTLINE: + DelCharBack(false); + if (!caretSticky) { + SetLastXChosen(); + } + EnsureCaretVisible(); + break; + case SCI_TAB: + Indent(true); + if (!caretSticky) { + SetLastXChosen(); + } + EnsureCaretVisible(); + break; + case SCI_BACKTAB: + Indent(false); + if (!caretSticky) { + SetLastXChosen(); + } + EnsureCaretVisible(); + break; + case SCI_NEWLINE: + NewLine(); + break; + case SCI_FORMFEED: + AddChar('\f'); + break; + case SCI_VCHOME: + MovePositionTo(pdoc->VCHomePosition(currentPos)); + SetLastXChosen(); + break; + case SCI_VCHOMEEXTEND: + MovePositionTo(pdoc->VCHomePosition(currentPos), selStream); + SetLastXChosen(); + break; + case SCI_VCHOMERECTEXTEND: + MovePositionTo(pdoc->VCHomePosition(currentPos), selRectangle); + SetLastXChosen(); + break; + case SCI_VCHOMEWRAP: { + int homePos = pdoc->VCHomePosition(currentPos); + int viewLineStart = MovePositionSoVisible(StartEndDisplayLine(currentPos, true), -1); + if ((viewLineStart < currentPos) && (viewLineStart > homePos)) + homePos = viewLineStart; + + MovePositionTo(homePos); + SetLastXChosen(); + } + break; + case SCI_VCHOMEWRAPEXTEND: { + int homePos = pdoc->VCHomePosition(currentPos); + int viewLineStart = MovePositionSoVisible(StartEndDisplayLine(currentPos, true), -1); + if ((viewLineStart < currentPos) && (viewLineStart > homePos)) + homePos = viewLineStart; + + MovePositionTo(homePos, selStream); + SetLastXChosen(); + } + break; + case SCI_ZOOMIN: + if (vs.zoomLevel < 20) { + vs.zoomLevel++; + InvalidateStyleRedraw(); + NotifyZoom(); + } + break; + case SCI_ZOOMOUT: + if (vs.zoomLevel > -10) { + vs.zoomLevel--; + InvalidateStyleRedraw(); + NotifyZoom(); + } + break; + case SCI_DELWORDLEFT: { + int startWord = pdoc->NextWordStart(currentPos, -1); + pdoc->DeleteChars(startWord, currentPos - startWord); + SetLastXChosen(); + } + break; + case SCI_DELWORDRIGHT: { + int endWord = pdoc->NextWordStart(currentPos, 1); + pdoc->DeleteChars(currentPos, endWord - currentPos); + } + break; + case SCI_DELLINELEFT: { + int line = pdoc->LineFromPosition(currentPos); + int start = pdoc->LineStart(line); + pdoc->DeleteChars(start, currentPos - start); + SetLastXChosen(); + } + break; + case SCI_DELLINERIGHT: { + int line = pdoc->LineFromPosition(currentPos); + int end = pdoc->LineEnd(line); + pdoc->DeleteChars(currentPos, end - currentPos); + } + break; + case SCI_LINECOPY: { + int lineStart = pdoc->LineFromPosition(SelectionStart()); + int lineEnd = pdoc->LineFromPosition(SelectionEnd()); + CopyRangeToClipboard(pdoc->LineStart(lineStart), + pdoc->LineStart(lineEnd + 1)); + } + break; + case SCI_LINECUT: { + int lineStart = pdoc->LineFromPosition(SelectionStart()); + int lineEnd = pdoc->LineFromPosition(SelectionEnd()); + int start = pdoc->LineStart(lineStart); + int end = pdoc->LineStart(lineEnd + 1); + SetSelection(start, end); + Cut(); + SetLastXChosen(); + } + break; + case SCI_LINEDELETE: { + int line = pdoc->LineFromPosition(currentPos); + int start = pdoc->LineStart(line); + int end = pdoc->LineStart(line + 1); + pdoc->DeleteChars(start, end - start); + } + break; + case SCI_LINETRANSPOSE: + LineTranspose(); + break; + case SCI_LINEDUPLICATE: + Duplicate(true); + break; + case SCI_SELECTIONDUPLICATE: + Duplicate(false); + break; + case SCI_LOWERCASE: + ChangeCaseOfSelection(false); + break; + case SCI_UPPERCASE: + ChangeCaseOfSelection(true); + break; + case SCI_WORDPARTLEFT: + MovePositionTo(MovePositionSoVisible(pdoc->WordPartLeft(currentPos), -1)); + SetLastXChosen(); + break; + case SCI_WORDPARTLEFTEXTEND: + MovePositionTo(MovePositionSoVisible(pdoc->WordPartLeft(currentPos), -1), selStream); + SetLastXChosen(); + break; + case SCI_WORDPARTRIGHT: + MovePositionTo(MovePositionSoVisible(pdoc->WordPartRight(currentPos), 1)); + SetLastXChosen(); + break; + case SCI_WORDPARTRIGHTEXTEND: + MovePositionTo(MovePositionSoVisible(pdoc->WordPartRight(currentPos), 1), selStream); + SetLastXChosen(); + break; + case SCI_HOMEDISPLAY: + MovePositionTo(MovePositionSoVisible( + StartEndDisplayLine(currentPos, true), -1)); + SetLastXChosen(); + break; + case SCI_HOMEDISPLAYEXTEND: + MovePositionTo(MovePositionSoVisible( + StartEndDisplayLine(currentPos, true), -1), selStream); + SetLastXChosen(); + break; + case SCI_LINEENDDISPLAY: + MovePositionTo(MovePositionSoVisible( + StartEndDisplayLine(currentPos, false), 1)); + SetLastXChosen(); + break; + case SCI_LINEENDDISPLAYEXTEND: + MovePositionTo(MovePositionSoVisible( + StartEndDisplayLine(currentPos, false), 1), selStream); + SetLastXChosen(); + break; + } + return 0; +} + +int Editor::KeyDefault(int, int) { + return 0; +} + +int Editor::KeyDown(int key, bool shift, bool ctrl, bool alt, bool *consumed) { + DwellEnd(false); + int modifiers = (shift ? SCI_SHIFT : 0) | (ctrl ? SCI_CTRL : 0) | + (alt ? SCI_ALT : 0); + int msg = kmap.Find(key, modifiers); + if (msg) { + if (consumed) + *consumed = true; + return WndProc(msg, 0, 0); + } else { + if (consumed) + *consumed = false; + return KeyDefault(key, modifiers); + } +} + +void Editor::SetWhitespaceVisible(int view) { + vs.viewWhitespace = static_cast(view); +} + +int Editor::GetWhitespaceVisible() { + return vs.viewWhitespace; +} + +void Editor::Indent(bool forwards) { + //Platform::DebugPrintf("INdent %d\n", forwards); + int lineOfAnchor = pdoc->LineFromPosition(anchor); + int lineCurrentPos = pdoc->LineFromPosition(currentPos); + if (lineOfAnchor == lineCurrentPos) { + if (forwards) { + pdoc->BeginUndoAction(); + ClearSelection(); + if (pdoc->GetColumn(currentPos) <= pdoc->GetColumn(pdoc->GetLineIndentPosition(lineCurrentPos)) && + pdoc->tabIndents) { + int indentation = pdoc->GetLineIndentation(lineCurrentPos); + int indentationStep = pdoc->IndentSize(); + pdoc->SetLineIndentation(lineCurrentPos, indentation + indentationStep - indentation % indentationStep); + SetEmptySelection(pdoc->GetLineIndentPosition(lineCurrentPos)); + } else { + if (pdoc->useTabs) { + pdoc->InsertChar(currentPos, '\t'); + SetEmptySelection(currentPos + 1); + } else { + int numSpaces = (pdoc->tabInChars) - + (pdoc->GetColumn(currentPos) % (pdoc->tabInChars)); + if (numSpaces < 1) + numSpaces = pdoc->tabInChars; + for (int i = 0; i < numSpaces; i++) { + pdoc->InsertChar(currentPos + i, ' '); + } + SetEmptySelection(currentPos + numSpaces); + } + } + pdoc->EndUndoAction(); + } else { + if (pdoc->GetColumn(currentPos) <= pdoc->GetLineIndentation(lineCurrentPos) && + pdoc->tabIndents) { + pdoc->BeginUndoAction(); + int indentation = pdoc->GetLineIndentation(lineCurrentPos); + int indentationStep = pdoc->IndentSize(); + pdoc->SetLineIndentation(lineCurrentPos, indentation - indentationStep); + SetEmptySelection(pdoc->GetLineIndentPosition(lineCurrentPos)); + pdoc->EndUndoAction(); + } else { + int newColumn = ((pdoc->GetColumn(currentPos) - 1) / pdoc->tabInChars) * + pdoc->tabInChars; + if (newColumn < 0) + newColumn = 0; + int newPos = currentPos; + while (pdoc->GetColumn(newPos) > newColumn) + newPos--; + SetEmptySelection(newPos); + } + } + } else { + int anchorPosOnLine = anchor - pdoc->LineStart(lineOfAnchor); + int currentPosPosOnLine = currentPos - pdoc->LineStart(lineCurrentPos); + // Multiple lines selected so indent / dedent + int lineTopSel = Platform::Minimum(lineOfAnchor, lineCurrentPos); + int lineBottomSel = Platform::Maximum(lineOfAnchor, lineCurrentPos); + if (pdoc->LineStart(lineBottomSel) == anchor || pdoc->LineStart(lineBottomSel) == currentPos) + lineBottomSel--; // If not selecting any characters on a line, do not indent + pdoc->BeginUndoAction(); + pdoc->Indent(forwards, lineBottomSel, lineTopSel); + pdoc->EndUndoAction(); + if (lineOfAnchor < lineCurrentPos) { + if (currentPosPosOnLine == 0) + SetSelection(pdoc->LineStart(lineCurrentPos), pdoc->LineStart(lineOfAnchor)); + else + SetSelection(pdoc->LineStart(lineCurrentPos + 1), pdoc->LineStart(lineOfAnchor)); + } else { + if (anchorPosOnLine == 0) + SetSelection(pdoc->LineStart(lineCurrentPos), pdoc->LineStart(lineOfAnchor)); + else + SetSelection(pdoc->LineStart(lineCurrentPos), pdoc->LineStart(lineOfAnchor + 1)); + } + } +} + +/** + * Search of a text in the document, in the given range. + * @return The position of the found text, -1 if not found. + */ +long Editor::FindText( + uptr_t wParam, ///< Search modes : @c SCFIND_MATCHCASE, @c SCFIND_WHOLEWORD, + ///< @c SCFIND_WORDSTART, @c SCFIND_REGEXP or @c SCFIND_POSIX. + sptr_t lParam) { ///< @c TextToFind structure: The text to search for in the given range. + + TextToFind *ft = reinterpret_cast(lParam); + int lengthFound = istrlen(ft->lpstrText); + int pos = pdoc->FindText(ft->chrg.cpMin, ft->chrg.cpMax, ft->lpstrText, + (wParam & SCFIND_MATCHCASE) != 0, + (wParam & SCFIND_WHOLEWORD) != 0, + (wParam & SCFIND_WORDSTART) != 0, + (wParam & SCFIND_REGEXP) != 0, + (wParam & SCFIND_POSIX) != 0, + &lengthFound); + if (pos != -1) { + ft->chrgText.cpMin = pos; + ft->chrgText.cpMax = pos + lengthFound; + } + return pos; +} + +/** + * Relocatable search support : Searches relative to current selection + * point and sets the selection to the found text range with + * each search. + */ +/** + * Anchor following searches at current selection start: This allows + * multiple incremental interactive searches to be macro recorded + * while still setting the selection to found text so the find/select + * operation is self-contained. + */ +void Editor::SearchAnchor() { + searchAnchor = SelectionStart(); +} + +/** + * Find text from current search anchor: Must call @c SearchAnchor first. + * Used for next text and previous text requests. + * @return The position of the found text, -1 if not found. + */ +long Editor::SearchText( + unsigned int iMessage, ///< Accepts both @c SCI_SEARCHNEXT and @c SCI_SEARCHPREV. + uptr_t wParam, ///< Search modes : @c SCFIND_MATCHCASE, @c SCFIND_WHOLEWORD, + ///< @c SCFIND_WORDSTART, @c SCFIND_REGEXP or @c SCFIND_POSIX. + sptr_t lParam) { ///< The text to search for. + + const char *txt = reinterpret_cast(lParam); + int pos; + int lengthFound = istrlen(txt); + if (iMessage == SCI_SEARCHNEXT) { + pos = pdoc->FindText(searchAnchor, pdoc->Length(), txt, + (wParam & SCFIND_MATCHCASE) != 0, + (wParam & SCFIND_WHOLEWORD) != 0, + (wParam & SCFIND_WORDSTART) != 0, + (wParam & SCFIND_REGEXP) != 0, + (wParam & SCFIND_POSIX) != 0, + &lengthFound); + } else { + pos = pdoc->FindText(searchAnchor, 0, txt, + (wParam & SCFIND_MATCHCASE) != 0, + (wParam & SCFIND_WHOLEWORD) != 0, + (wParam & SCFIND_WORDSTART) != 0, + (wParam & SCFIND_REGEXP) != 0, + (wParam & SCFIND_POSIX) != 0, + &lengthFound); + } + + if (pos != -1) { + SetSelection(pos, pos + lengthFound); + } + + return pos; +} + +/** + * Search for text in the target range of the document. + * @return The position of the found text, -1 if not found. + */ +long Editor::SearchInTarget(const char *text, int length) { + int lengthFound = length; + int pos = pdoc->FindText(targetStart, targetEnd, text, + (searchFlags & SCFIND_MATCHCASE) != 0, + (searchFlags & SCFIND_WHOLEWORD) != 0, + (searchFlags & SCFIND_WORDSTART) != 0, + (searchFlags & SCFIND_REGEXP) != 0, + (searchFlags & SCFIND_POSIX) != 0, + &lengthFound); + if (pos != -1) { + targetStart = pos; + targetEnd = pos + lengthFound; + } + return pos; +} + +void Editor::GoToLine(int lineNo) { + if (lineNo > pdoc->LinesTotal()) + lineNo = pdoc->LinesTotal(); + if (lineNo < 0) + lineNo = 0; + SetEmptySelection(pdoc->LineStart(lineNo)); + ShowCaretAtCurrentPosition(); + EnsureCaretVisible(); +} + +static bool Close(Point pt1, Point pt2) { + if (abs(pt1.x - pt2.x) > 3) + return false; + if (abs(pt1.y - pt2.y) > 3) + return false; + return true; +} + +char *Editor::CopyRange(int start, int end) { + char *text = 0; + if (start < end) { + int len = end - start; + text = new char[len + 1]; + if (text) { + for (int i = 0; i < len; i++) { + text[i] = pdoc->CharAt(start + i); + } + text[len] = '\0'; + } + } + return text; +} + +void Editor::CopySelectionFromRange(SelectionText *ss, int start, int end) { + ss->Set(CopyRange(start, end), end - start + 1, + pdoc->dbcsCodePage, vs.styles[STYLE_DEFAULT].characterSet, false); +} + +void Editor::CopySelectionRange(SelectionText *ss) { + if (selType == selStream) { + CopySelectionFromRange(ss, SelectionStart(), SelectionEnd()); + } else { + char *text = 0; + int size = 0; + SelectionLineIterator lineIterator(this); + while (lineIterator.Iterate()) { + size += lineIterator.endPos - lineIterator.startPos; + if (selType != selLines) { + size++; + if (pdoc->eolMode == SC_EOL_CRLF) { + size++; + } + } + } + if (size > 0) { + text = new char[size + 1]; + if (text) { + int j = 0; + lineIterator.Reset(); + while (lineIterator.Iterate()) { + for (int i = lineIterator.startPos; + i < lineIterator.endPos; + i++) { + text[j++] = pdoc->CharAt(i); + } + if (selType != selLines) { + if (pdoc->eolMode != SC_EOL_LF) { + text[j++] = '\r'; + } + if (pdoc->eolMode != SC_EOL_CR) { + text[j++] = '\n'; + } + } + } + text[size] = '\0'; + } + } + ss->Set(text, size + 1, pdoc->dbcsCodePage, + vs.styles[STYLE_DEFAULT].characterSet, selType == selRectangle); + } +} + +void Editor::CopyRangeToClipboard(int start, int end) { + start = pdoc->ClampPositionIntoDocument(start); + end = pdoc->ClampPositionIntoDocument(end); + SelectionText selectedText; + selectedText.Set(CopyRange(start, end), end - start + 1, + pdoc->dbcsCodePage, vs.styles[STYLE_DEFAULT].characterSet, false); + CopyToClipboard(selectedText); +} + +void Editor::CopyText(int length, const char *text) { + SelectionText selectedText; + selectedText.Copy(text, length + 1, + pdoc->dbcsCodePage, vs.styles[STYLE_DEFAULT].characterSet, false); + CopyToClipboard(selectedText); +} + +void Editor::SetDragPosition(int newPos) { + if (newPos >= 0) { + newPos = MovePositionOutsideChar(newPos, 1); + posDrop = newPos; + } + if (posDrag != newPos) { + caret.on = true; + SetTicking(true); + InvalidateCaret(); + posDrag = newPos; + InvalidateCaret(); + } +} + +void Editor::DisplayCursor(Window::Cursor c) { + if (cursorMode == SC_CURSORNORMAL) + wMain.SetCursor(c); + else + wMain.SetCursor(static_cast(cursorMode)); +} + +void Editor::StartDrag() { + // Always handled by subclasses + //SetMouseCapture(true); + //DisplayCursor(Window::cursorArrow); +} + +void Editor::DropAt(int position, const char *value, bool moving, bool rectangular) { + //Platform::DebugPrintf("DropAt %d\n", inDragDrop); + if (inDragDrop) + dropWentOutside = false; + + int positionWasInSelection = PositionInSelection(position); + + bool positionOnEdgeOfSelection = + (position == SelectionStart()) || (position == SelectionEnd()); + + if ((!inDragDrop) || !(0 == positionWasInSelection) || + (positionOnEdgeOfSelection && !moving)) { + + int selStart = SelectionStart(); + int selEnd = SelectionEnd(); + + pdoc->BeginUndoAction(); + + int positionAfterDeletion = position; + if (inDragDrop && moving) { + // Remove dragged out text + if (rectangular || selType == selLines) { + SelectionLineIterator lineIterator(this); + while (lineIterator.Iterate()) { + if (position >= lineIterator.startPos) { + if (position > lineIterator.endPos) { + positionAfterDeletion -= lineIterator.endPos - lineIterator.startPos; + } else { + positionAfterDeletion -= position - lineIterator.startPos; + } + } + } + } else { + if (position > selStart) { + positionAfterDeletion -= selEnd - selStart; + } + } + ClearSelection(); + } + position = positionAfterDeletion; + + if (rectangular) { + PasteRectangular(position, value, istrlen(value)); + pdoc->EndUndoAction(); + // Should try to select new rectangle but it may not be a rectangle now so just select the drop position + SetEmptySelection(position); + } else { + position = MovePositionOutsideChar(position, currentPos - position); + if (pdoc->InsertString(position, value)) { + SetSelection(position + istrlen(value), position); + } + pdoc->EndUndoAction(); + } + } else if (inDragDrop) { + SetEmptySelection(position); + } +} + +/** + * @return -1 if given position is before the selection, + * 1 if position is after the selection, + * 0 if position is inside the selection, + */ +int Editor::PositionInSelection(int pos) { + pos = MovePositionOutsideChar(pos, currentPos - pos); + if (pos < SelectionStart()) { + return -1; + } + if (pos > SelectionEnd()) { + return 1; + } + if (selType == selStream) { + return 0; + } else { + SelectionLineIterator lineIterator(this); + lineIterator.SetAt(pdoc->LineFromPosition(pos)); + if (pos < lineIterator.startPos) { + return -1; + } else if (pos > lineIterator.endPos) { + return 1; + } else { + return 0; + } + } +} + +bool Editor::PointInSelection(Point pt) { + int pos = PositionFromLocation(pt); + if (0 == PositionInSelection(pos)) { + // Probably inside, but we must make a finer test + int selStart, selEnd; + if (selType == selStream) { + selStart = SelectionStart(); + selEnd = SelectionEnd(); + } else { + SelectionLineIterator lineIterator(this); + lineIterator.SetAt(pdoc->LineFromPosition(pos)); + selStart = lineIterator.startPos; + selEnd = lineIterator.endPos; + } + if (pos == selStart) { + // see if just before selection + Point locStart = LocationFromPosition(pos); + if (pt.x < locStart.x) { + return false; + } + } + if (pos == selEnd) { + // see if just after selection + Point locEnd = LocationFromPosition(pos); + if (pt.x > locEnd.x) { + return false; + } + } + return true; + } + return false; +} + +bool Editor::PointInSelMargin(Point pt) { + // Really means: "Point in a margin" + if (vs.fixedColumnWidth > 0) { // There is a margin + PRectangle rcSelMargin = GetClientRectangle(); + rcSelMargin.right = vs.fixedColumnWidth - vs.leftMarginWidth; + return rcSelMargin.Contains(pt); + } else { + return false; + } +} + +void Editor::LineSelection(int lineCurrent_, int lineAnchor_) { + if (lineAnchor_ < lineCurrent_) { + SetSelection(pdoc->LineStart(lineCurrent_ + 1), + pdoc->LineStart(lineAnchor_)); + } else if (lineAnchor_ > lineCurrent_) { + SetSelection(pdoc->LineStart(lineCurrent_), + pdoc->LineStart(lineAnchor_ + 1)); + } else { // Same line, select it + SetSelection(pdoc->LineStart(lineAnchor_ + 1), + pdoc->LineStart(lineAnchor_)); + } +} + +void Editor::DwellEnd(bool mouseMoved) { + if (mouseMoved) + ticksToDwell = dwellDelay; + else + ticksToDwell = SC_TIME_FOREVER; + if (dwelling && (dwellDelay < SC_TIME_FOREVER)) { + dwelling = false; + NotifyDwelling(ptMouseLast, dwelling); + } +} + +void Editor::ButtonDown(Point pt, unsigned int curTime, bool shift, bool ctrl, bool alt) { + //Platform::DebugPrintf("Scintilla:ButtonDown %d %d = %d alt=%d\n", curTime, lastClickTime, curTime - lastClickTime, alt); + ptMouseLast = pt; + int newPos = PositionFromLocation(pt); + newPos = MovePositionOutsideChar(newPos, currentPos - newPos); + inDragDrop = false; + moveExtendsSelection = false; + + bool processed = NotifyMarginClick(pt, shift, ctrl, alt); + if (processed) + return; + + bool inSelMargin = PointInSelMargin(pt); + if (shift & !inSelMargin) { + SetSelection(newPos); + } + if (((curTime - lastClickTime) < Platform::DoubleClickTime()) && Close(pt, lastClick)) { + //Platform::DebugPrintf("Double click %d %d = %d\n", curTime, lastClickTime, curTime - lastClickTime); + SetMouseCapture(true); + SetEmptySelection(newPos); + bool doubleClick = false; + // Stop mouse button bounce changing selection type + if (!Platform::MouseButtonBounce() || curTime != lastClickTime) { + if (selectionType == selChar) { + selectionType = selWord; + doubleClick = true; + } else if (selectionType == selWord) { + selectionType = selLine; + } else { + selectionType = selChar; + originalAnchorPos = currentPos; + } + } + + if (selectionType == selWord) { + if (currentPos >= originalAnchorPos) { // Moved forward + SetSelection(pdoc->ExtendWordSelect(currentPos, 1), + pdoc->ExtendWordSelect(originalAnchorPos, -1)); + } else { // Moved backward + SetSelection(pdoc->ExtendWordSelect(currentPos, -1), + pdoc->ExtendWordSelect(originalAnchorPos, 1)); + } + } else if (selectionType == selLine) { + lineAnchor = LineFromLocation(pt); + SetSelection(pdoc->LineStart(lineAnchor + 1), pdoc->LineStart(lineAnchor)); + //Platform::DebugPrintf("Triple click: %d - %d\n", anchor, currentPos); + } else { + SetEmptySelection(currentPos); + } + //Platform::DebugPrintf("Double click: %d - %d\n", anchor, currentPos); + if (doubleClick) { + NotifyDoubleClick(pt, shift); + if (PositionIsHotspot(newPos)) + NotifyHotSpotDoubleClicked(newPos, shift, ctrl, alt); + } + } else { // Single click + if (inSelMargin) { + selType = selStream; + if (ctrl) { + SelectAll(); + lastClickTime = curTime; + return; + } + if (!shift) { + lineAnchor = LineFromLocation(pt); + // Single click in margin: select whole line + LineSelection(lineAnchor, lineAnchor); + SetSelection(pdoc->LineStart(lineAnchor + 1), + pdoc->LineStart(lineAnchor)); + } else { + // Single shift+click in margin: select from line anchor to clicked line + if (anchor > currentPos) + lineAnchor = pdoc->LineFromPosition(anchor - 1); + else + lineAnchor = pdoc->LineFromPosition(anchor); + int lineStart = LineFromLocation(pt); + LineSelection(lineStart, lineAnchor); + //lineAnchor = lineStart; // Keep the same anchor for ButtonMove + } + + SetDragPosition(invalidPosition); + SetMouseCapture(true); + selectionType = selLine; + } else { + if (PointIsHotspot(pt)) { + NotifyHotSpotClicked(newPos, shift, ctrl, alt); + } + if (!shift) { + inDragDrop = PointInSelection(pt) && !SelectionEmpty(); + } + if (inDragDrop) { + SetMouseCapture(false); + SetDragPosition(newPos); + CopySelectionRange(&drag); + StartDrag(); + } else { + SetDragPosition(invalidPosition); + SetMouseCapture(true); + if (!shift) { + SetEmptySelection(newPos); + } + selType = alt ? selRectangle : selStream; + selectionType = selChar; + originalAnchorPos = currentPos; + SetRectangularRange(); + } + } + } + lastClickTime = curTime; + lastXChosen = pt.x; + ShowCaretAtCurrentPosition(); +} + +bool Editor::PositionIsHotspot(int position) { + return vs.styles[pdoc->StyleAt(position) & pdoc->stylingBitsMask].hotspot; +} + +bool Editor::PointIsHotspot(Point pt) { + int pos = PositionFromLocationClose(pt); + if (pos == INVALID_POSITION) + return false; + return PositionIsHotspot(pos); +} + +void Editor::SetHotSpotRange(Point *pt) { + if (pt) { + int pos = PositionFromLocation(*pt); + + // If we don't limit this to word characters then the + // range can encompass more than the run range and then + // the underline will not be drawn properly. + int hsStart_ = pdoc->ExtendStyleRange(pos, -1, vs.hotspotSingleLine); + int hsEnd_ = pdoc->ExtendStyleRange(pos, 1, vs.hotspotSingleLine); + + // Only invalidate the range if the hotspot range has changed... + if (hsStart_ != hsStart || hsEnd_ != hsEnd) { + if (hsStart != -1) { + InvalidateRange(hsStart, hsEnd); + } + hsStart = hsStart_; + hsEnd = hsEnd_; + InvalidateRange(hsStart, hsEnd); + } + } else { + if (hsStart != -1) { + int hsStart_ = hsStart; + int hsEnd_ = hsEnd; + hsStart = -1; + hsEnd = -1; + InvalidateRange(hsStart_, hsEnd_); + } else { + hsStart = -1; + hsEnd = -1; + } + } +} + +void Editor::GetHotSpotRange(int& hsStart_, int& hsEnd_) { + hsStart_ = hsStart; + hsEnd_ = hsEnd; +} + +void Editor::ButtonMove(Point pt) { + if ((ptMouseLast.x != pt.x) || (ptMouseLast.y != pt.y)) { + DwellEnd(true); + } + ptMouseLast = pt; + //Platform::DebugPrintf("Move %d %d\n", pt.x, pt.y); + if (HaveMouseCapture()) { + + // Slow down autoscrolling/selection + autoScrollTimer.ticksToWait -= timer.tickSize; + if (autoScrollTimer.ticksToWait > 0) + return; + autoScrollTimer.ticksToWait = autoScrollDelay; + + // Adjust selection + int movePos = PositionFromLocation(pt); + movePos = MovePositionOutsideChar(movePos, currentPos - movePos); + if (posDrag >= 0) { + SetDragPosition(movePos); + } else { + if (selectionType == selChar) { + SetSelection(movePos); + } else if (selectionType == selWord) { + // Continue selecting by word + if (movePos == originalAnchorPos) { // Didn't move + // No need to do anything. Previously this case was lumped + // in with "Moved forward", but that can be harmful in this + // case: a handler for the NotifyDoubleClick re-adjusts + // the selection for a fancier definition of "word" (for + // example, in Perl it is useful to include the leading + // '$', '%' or '@' on variables for word selection). In this + // the ButtonMove() called via Tick() for auto-scrolling + // could result in the fancier word selection adjustment + // being unmade. + } else if (movePos > originalAnchorPos) { // Moved forward + SetSelection(pdoc->ExtendWordSelect(movePos, 1), + pdoc->ExtendWordSelect(originalAnchorPos, -1)); + } else { // Moved backward + SetSelection(pdoc->ExtendWordSelect(movePos, -1), + pdoc->ExtendWordSelect(originalAnchorPos, 1)); + } + } else { + // Continue selecting by line + int lineMove = LineFromLocation(pt); + LineSelection(lineMove, lineAnchor); + } + } + // While dragging to make rectangular selection, we don't want the current + // position to jump to the end of smaller or empty lines. + //xEndSelect = pt.x - vs.fixedColumnWidth + xOffset; + xEndSelect = XFromPosition(movePos); + + // Autoscroll + PRectangle rcClient = GetClientRectangle(); + if (pt.y > rcClient.bottom) { + int lineMove = cs.DisplayFromDoc(LineFromLocation(pt)); + if (lineMove < 0) { + lineMove = cs.DisplayFromDoc(pdoc->LinesTotal() - 1); + } + ScrollTo(lineMove - LinesOnScreen() + 5); + Redraw(); + } else if (pt.y < rcClient.top) { + int lineMove = cs.DisplayFromDoc(LineFromLocation(pt)); + ScrollTo(lineMove - 5); + Redraw(); + } + EnsureCaretVisible(false, false, true); + + if (hsStart != -1 && !PositionIsHotspot(movePos)) + SetHotSpotRange(NULL); + + } else { + if (vs.fixedColumnWidth > 0) { // There is a margin + if (PointInSelMargin(pt)) { + DisplayCursor(Window::cursorReverseArrow); + return; // No need to test for selection + } + } + // Display regular (drag) cursor over selection + if (PointInSelection(pt) && !SelectionEmpty()) { + DisplayCursor(Window::cursorArrow); + } else if (PointIsHotspot(pt)) { + DisplayCursor(Window::cursorHand); + SetHotSpotRange(&pt); + } else { + DisplayCursor(Window::cursorText); + SetHotSpotRange(NULL); + } + } +} + +void Editor::ButtonUp(Point pt, unsigned int curTime, bool ctrl) { + //Platform::DebugPrintf("ButtonUp %d\n", HaveMouseCapture()); + if (HaveMouseCapture()) { + if (PointInSelMargin(pt)) { + DisplayCursor(Window::cursorReverseArrow); + } else { + DisplayCursor(Window::cursorText); + SetHotSpotRange(NULL); + } + ptMouseLast = pt; + SetMouseCapture(false); + int newPos = PositionFromLocation(pt); + newPos = MovePositionOutsideChar(newPos, currentPos - newPos); + if (inDragDrop) { + int selStart = SelectionStart(); + int selEnd = SelectionEnd(); + if (selStart < selEnd) { + if (drag.len) { + if (ctrl) { + if (pdoc->InsertString(newPos, drag.s, drag.len)) { + SetSelection(newPos, newPos + drag.len); + } + } else if (newPos < selStart) { + pdoc->DeleteChars(selStart, drag.len); + if (pdoc->InsertString(newPos, drag.s, drag.len)) { + SetSelection(newPos, newPos + drag.len); + } + } else if (newPos > selEnd) { + pdoc->DeleteChars(selStart, drag.len); + newPos -= drag.len; + if (pdoc->InsertString(newPos, drag.s, drag.len)) { + SetSelection(newPos, newPos + drag.len); + } + } else { + SetEmptySelection(newPos); + } + drag.Free(); + } + selectionType = selChar; + } + } else { + if (selectionType == selChar) { + SetSelection(newPos); + } + } + SetRectangularRange(); + lastClickTime = curTime; + lastClick = pt; + lastXChosen = pt.x; + if (selType == selStream) { + SetLastXChosen(); + } + inDragDrop = false; + EnsureCaretVisible(false); + } +} + +// Called frequently to perform background UI including +// caret blinking and automatic scrolling. +void Editor::Tick() { + if (HaveMouseCapture()) { + // Auto scroll + ButtonMove(ptMouseLast); + } + if (caret.period > 0) { + timer.ticksToWait -= timer.tickSize; + if (timer.ticksToWait <= 0) { + caret.on = !caret.on; + timer.ticksToWait = caret.period; + if (caret.active) { + InvalidateCaret(); + } + } + } + if ((dwellDelay < SC_TIME_FOREVER) && + (ticksToDwell > 0) && + (!HaveMouseCapture())) { + ticksToDwell -= timer.tickSize; + if (ticksToDwell <= 0) { + dwelling = true; + NotifyDwelling(ptMouseLast, dwelling); + } + } +} + +bool Editor::Idle() { + + bool idleDone; + + bool wrappingDone = wrapState == eWrapNone; + + if (!wrappingDone) { + // Wrap lines during idle. + WrapLines(false, -1); + // No more wrapping + if (wrapStart == wrapEnd) + wrappingDone = true; + } + + // Add more idle things to do here, but make sure idleDone is + // set correctly before the function returns. returning + // false will stop calling this idle funtion until SetIdle() is + // called again. + + idleDone = wrappingDone; // && thatDone && theOtherThingDone... + + return !idleDone; +} + +void Editor::SetFocusState(bool focusState) { + hasFocus = focusState; + NotifyFocus(hasFocus); + if (hasFocus) { + ShowCaretAtCurrentPosition(); + } else { + CancelModes(); + DropCaret(); + } +} + +bool Editor::PaintContains(PRectangle rc) { + return rcPaint.Contains(rc); +} + +bool Editor::PaintContainsMargin() { + PRectangle rcSelMargin = GetClientRectangle(); + rcSelMargin.right = vs.fixedColumnWidth; + return PaintContains(rcSelMargin); +} + +void Editor::CheckForChangeOutsidePaint(Range r) { + if (paintState == painting && !paintingAllText) { + //Platform::DebugPrintf("Checking range in paint %d-%d\n", r.start, r.end); + if (!r.Valid()) + return; + + PRectangle rcRange = RectangleFromRange(r.start, r.end); + PRectangle rcText = GetTextRectangle(); + if (rcRange.top < rcText.top) { + rcRange.top = rcText.top; + } + if (rcRange.bottom > rcText.bottom) { + rcRange.bottom = rcText.bottom; + } + + if (!PaintContains(rcRange)) { + AbandonPaint(); + } + } +} + +void Editor::SetBraceHighlight(Position pos0, Position pos1, int matchStyle) { + if ((pos0 != braces[0]) || (pos1 != braces[1]) || (matchStyle != bracesMatchStyle)) { + if ((braces[0] != pos0) || (matchStyle != bracesMatchStyle)) { + CheckForChangeOutsidePaint(Range(braces[0])); + CheckForChangeOutsidePaint(Range(pos0)); + braces[0] = pos0; + } + if ((braces[1] != pos1) || (matchStyle != bracesMatchStyle)) { + CheckForChangeOutsidePaint(Range(braces[1])); + CheckForChangeOutsidePaint(Range(pos1)); + braces[1] = pos1; + } + bracesMatchStyle = matchStyle; + if (paintState == notPainting) { + Redraw(); + } + } +} + +void Editor::SetDocPointer(Document *document) { + //Platform::DebugPrintf("** %x setdoc to %x\n", pdoc, document); + pdoc->RemoveWatcher(this, 0); + pdoc->Release(); + if (document == NULL) { + pdoc = new Document(); + } else { + pdoc = document; + } + pdoc->AddRef(); + + // Ensure all positions within document + selType = selStream; + currentPos = 0; + anchor = 0; + targetStart = 0; + targetEnd = 0; + + braces[0] = invalidPosition; + braces[1] = invalidPosition; + + // Reset the contraction state to fully shown. + cs.Clear(); + cs.InsertLines(0, pdoc->LinesTotal() - 1); + llc.Deallocate(); + NeedWrapping(); + + pdoc->AddWatcher(this, 0); + SetScrollBars(); + Redraw(); +} + +/** + * Recursively expand a fold, making lines visible except where they have an unexpanded parent. + */ +void Editor::Expand(int &line, bool doExpand) { + int lineMaxSubord = pdoc->GetLastChild(line); + line++; + while (line <= lineMaxSubord) { + if (doExpand) + cs.SetVisible(line, line, true); + int level = pdoc->GetLevel(line); + if (level & SC_FOLDLEVELHEADERFLAG) { + if (doExpand && cs.GetExpanded(line)) { + Expand(line, true); + } else { + Expand(line, false); + } + } else { + line++; + } + } +} + +void Editor::ToggleContraction(int line) { + if (line >= 0) { + if ((pdoc->GetLevel(line) & SC_FOLDLEVELHEADERFLAG) == 0) { + line = pdoc->GetFoldParent(line); + if (line < 0) + return; + } + + if (cs.GetExpanded(line)) { + int lineMaxSubord = pdoc->GetLastChild(line); + cs.SetExpanded(line, 0); + if (lineMaxSubord > line) { + cs.SetVisible(line + 1, lineMaxSubord, false); + + int lineCurrent = pdoc->LineFromPosition(currentPos); + if (lineCurrent > line && lineCurrent <= lineMaxSubord) { + // This does not re-expand the fold + EnsureCaretVisible(); + } + + SetScrollBars(); + Redraw(); + } + + } else { + if (!(cs.GetVisible(line))) { + EnsureLineVisible(line, false); + GoToLine(line); + } + cs.SetExpanded(line, 1); + Expand(line, true); + SetScrollBars(); + Redraw(); + } + } +} + +/** + * Recurse up from this line to find any folds that prevent this line from being visible + * and unfold them all. + */ +void Editor::EnsureLineVisible(int lineDoc, bool enforcePolicy) { + + // In case in need of wrapping to ensure DisplayFromDoc works. + WrapLines(true, -1); + + if (!cs.GetVisible(lineDoc)) { + int lineParent = pdoc->GetFoldParent(lineDoc); + if (lineParent >= 0) { + if (lineDoc != lineParent) + EnsureLineVisible(lineParent, enforcePolicy); + if (!cs.GetExpanded(lineParent)) { + cs.SetExpanded(lineParent, 1); + Expand(lineParent, true); + } + } + SetScrollBars(); + Redraw(); + } + if (enforcePolicy) { + int lineDisplay = cs.DisplayFromDoc(lineDoc); + if (visiblePolicy & VISIBLE_SLOP) { + if ((topLine > lineDisplay) || ((visiblePolicy & VISIBLE_STRICT) && (topLine + visibleSlop > lineDisplay))) { + SetTopLine(Platform::Clamp(lineDisplay - visibleSlop, 0, MaxScrollPos())); + SetVerticalScrollPos(); + Redraw(); + } else if ((lineDisplay > topLine + LinesOnScreen() - 1) || + ((visiblePolicy & VISIBLE_STRICT) && (lineDisplay > topLine + LinesOnScreen() - 1 - visibleSlop))) { + SetTopLine(Platform::Clamp(lineDisplay - LinesOnScreen() + 1 + visibleSlop, 0, MaxScrollPos())); + SetVerticalScrollPos(); + Redraw(); + } + } else { + if ((topLine > lineDisplay) || (lineDisplay > topLine + LinesOnScreen() - 1) || (visiblePolicy & VISIBLE_STRICT)) { + SetTopLine(Platform::Clamp(lineDisplay - LinesOnScreen() / 2 + 1, 0, MaxScrollPos())); + SetVerticalScrollPos(); + Redraw(); + } + } + } +} + +int Editor::ReplaceTarget(bool replacePatterns, const char *text, int length) { + pdoc->BeginUndoAction(); + if (length == -1) + length = istrlen(text); + if (replacePatterns) { + text = pdoc->SubstituteByPosition(text, &length); + if (!text) + return 0; + } + if (targetStart != targetEnd) + pdoc->DeleteChars(targetStart, targetEnd - targetStart); + targetEnd = targetStart; + pdoc->InsertString(targetStart, text, length); + targetEnd = targetStart + length; + pdoc->EndUndoAction(); + return length; +} + +bool Editor::IsUnicodeMode() const { + return pdoc && (SC_CP_UTF8 == pdoc->dbcsCodePage); +} + +int Editor::CodePage() const { + if (pdoc) + return pdoc->dbcsCodePage; + else + return 0; +} + +int Editor::WrapCount(int line) { + AutoSurface surface(this); + AutoLineLayout ll(llc, RetrieveLineLayout(line)); + + if (surface && ll) { + LayoutLine(line, surface, vs, ll, wrapWidth); + return ll->lines; + } else { + return 1; + } +} + +static bool ValidMargin(unsigned long wParam) { + return wParam < ViewStyle::margins; +} + +static char *CharPtrFromSPtr(sptr_t lParam) { + return reinterpret_cast(lParam); +} + +sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) { + //Platform::DebugPrintf("S start wnd proc %d %d %d\n",iMessage, wParam, lParam); + + // Optional macro recording hook + if (recordingMacro) + NotifyMacroRecord(iMessage, wParam, lParam); + + switch (iMessage) { + + case SCI_GETTEXT: { + if (lParam == 0) + return pdoc->Length() + 1; + if (wParam == 0) + return 0; + char *ptr = CharPtrFromSPtr(lParam); + unsigned int iChar = 0; + for (; iChar < wParam - 1; iChar++) + ptr[iChar] = pdoc->CharAt(iChar); + ptr[iChar] = '\0'; + return iChar; + } + + case SCI_SETTEXT: { + if (lParam == 0) + return 0; + pdoc->BeginUndoAction(); + pdoc->DeleteChars(0, pdoc->Length()); + SetEmptySelection(0); + pdoc->InsertString(0, CharPtrFromSPtr(lParam)); + pdoc->EndUndoAction(); + return 1; + } + + case SCI_GETTEXTLENGTH: + return pdoc->Length(); + + case SCI_CUT: + Cut(); + SetLastXChosen(); + break; + + case SCI_COPY: + Copy(); + break; + + case SCI_COPYRANGE: + CopyRangeToClipboard(wParam, lParam); + break; + + case SCI_COPYTEXT: + CopyText(wParam, CharPtrFromSPtr(lParam)); + break; + + case SCI_PASTE: + Paste(); + if (!caretSticky) { + SetLastXChosen(); + } + EnsureCaretVisible(); + break; + + case SCI_CLEAR: + Clear(); + SetLastXChosen(); + EnsureCaretVisible(); + break; + + case SCI_UNDO: + Undo(); + SetLastXChosen(); + break; + + case SCI_CANUNDO: + return (pdoc->CanUndo() && !pdoc->IsReadOnly()) ? 1 : 0; + + case SCI_EMPTYUNDOBUFFER: + pdoc->DeleteUndoHistory(); + return 0; + + case SCI_GETFIRSTVISIBLELINE: + return topLine; + + case SCI_GETLINE: { // Risk of overwriting the end of the buffer + int lineStart = pdoc->LineStart(wParam); + int lineEnd = pdoc->LineStart(wParam + 1); + if (lParam == 0) { + return lineEnd - lineStart; + } + char *ptr = CharPtrFromSPtr(lParam); + int iPlace = 0; + for (int iChar = lineStart; iChar < lineEnd; iChar++) { + ptr[iPlace++] = pdoc->CharAt(iChar); + } + return iPlace; + } + + case SCI_GETLINECOUNT: + if (pdoc->LinesTotal() == 0) + return 1; + else + return pdoc->LinesTotal(); + + case SCI_GETMODIFY: + return !pdoc->IsSavePoint(); + + case SCI_SETSEL: { + int nStart = static_cast(wParam); + int nEnd = static_cast(lParam); + if (nEnd < 0) + nEnd = pdoc->Length(); + if (nStart < 0) + nStart = nEnd; // Remove selection + selType = selStream; + SetSelection(nEnd, nStart); + EnsureCaretVisible(); + } + break; + + case SCI_GETSELTEXT: { + if (lParam == 0) { + if (selType == selStream) { + return 1 + SelectionEnd() - SelectionStart(); + } else { + // TODO: why is selLines handled the slow way? + int size = 0; + int extraCharsPerLine = 0; + if (selType != selLines) + extraCharsPerLine = (pdoc->eolMode == SC_EOL_CRLF) ? 2 : 1; + SelectionLineIterator lineIterator(this); + while (lineIterator.Iterate()) { + size += lineIterator.endPos + extraCharsPerLine - lineIterator.startPos; + } + + return 1 + size; + } + } + SelectionText selectedText; + CopySelectionRange(&selectedText); + char *ptr = CharPtrFromSPtr(lParam); + int iChar = 0; + if (selectedText.len) { + for (; iChar < selectedText.len; iChar++) + ptr[iChar] = selectedText.s[iChar]; + } else { + ptr[0] = '\0'; + } + return iChar; + } + + case SCI_LINEFROMPOSITION: + if (static_cast(wParam) < 0) + return 0; + return pdoc->LineFromPosition(wParam); + + case SCI_POSITIONFROMLINE: + if (static_cast(wParam) < 0) + wParam = pdoc->LineFromPosition(SelectionStart()); + if (wParam == 0) + return 0; // Even if there is no text, there is a first line that starts at 0 + if (static_cast(wParam) > pdoc->LinesTotal()) + return -1; + //if (wParam > pdoc->LineFromPosition(pdoc->Length())) // Useful test, anyway... + // return -1; + return pdoc->LineStart(wParam); + + // Replacement of the old Scintilla interpretation of EM_LINELENGTH + case SCI_LINELENGTH: + if ((static_cast(wParam) < 0) || + (static_cast(wParam) > pdoc->LineFromPosition(pdoc->Length()))) + return 0; + return pdoc->LineStart(wParam + 1) - pdoc->LineStart(wParam); + + case SCI_REPLACESEL: { + if (lParam == 0) + return 0; + pdoc->BeginUndoAction(); + ClearSelection(); + char *replacement = CharPtrFromSPtr(lParam); + pdoc->InsertString(currentPos, replacement); + pdoc->EndUndoAction(); + SetEmptySelection(currentPos + istrlen(replacement)); + EnsureCaretVisible(); + } + break; + + case SCI_SETTARGETSTART: + targetStart = wParam; + break; + + case SCI_GETTARGETSTART: + return targetStart; + + case SCI_SETTARGETEND: + targetEnd = wParam; + break; + + case SCI_GETTARGETEND: + return targetEnd; + + case SCI_TARGETFROMSELECTION: + if (currentPos < anchor) { + targetStart = currentPos; + targetEnd = anchor; + } else { + targetStart = anchor; + targetEnd = currentPos; + } + break; + + case SCI_REPLACETARGET: + PLATFORM_ASSERT(lParam); + return ReplaceTarget(false, CharPtrFromSPtr(lParam), wParam); + + case SCI_REPLACETARGETRE: + PLATFORM_ASSERT(lParam); + return ReplaceTarget(true, CharPtrFromSPtr(lParam), wParam); + + case SCI_SEARCHINTARGET: + PLATFORM_ASSERT(lParam); + return SearchInTarget(CharPtrFromSPtr(lParam), wParam); + + case SCI_SETSEARCHFLAGS: + searchFlags = wParam; + break; + + case SCI_GETSEARCHFLAGS: + return searchFlags; + + case SCI_POSITIONBEFORE: + return pdoc->MovePositionOutsideChar(wParam-1, -1, true); + + case SCI_POSITIONAFTER: + return pdoc->MovePositionOutsideChar(wParam+1, 1, true); + + case SCI_LINESCROLL: + ScrollTo(topLine + lParam); + HorizontalScrollTo(xOffset + wParam * vs.spaceWidth); + return 1; + + case SCI_SETXOFFSET: + xOffset = wParam; + SetHorizontalScrollPos(); + Redraw(); + break; + + case SCI_GETXOFFSET: + return xOffset; + + case SCI_CHOOSECARETX: + SetLastXChosen(); + break; + + case SCI_SCROLLCARET: + EnsureCaretVisible(); + break; + + case SCI_SETREADONLY: + pdoc->SetReadOnly(wParam != 0); + return 1; + + case SCI_GETREADONLY: + return pdoc->IsReadOnly(); + + case SCI_CANPASTE: + return CanPaste(); + + case SCI_POINTXFROMPOSITION: + if (lParam < 0) { + return 0; + } else { + Point pt = LocationFromPosition(lParam); + return pt.x; + } + + case SCI_POINTYFROMPOSITION: + if (lParam < 0) { + return 0; + } else { + Point pt = LocationFromPosition(lParam); + return pt.y; + } + + case SCI_FINDTEXT: + return FindText(wParam, lParam); + + case SCI_GETTEXTRANGE: { + if (lParam == 0) + return 0; + TextRange *tr = reinterpret_cast(lParam); + int cpMax = tr->chrg.cpMax; + if (cpMax == -1) + cpMax = pdoc->Length(); + PLATFORM_ASSERT(cpMax <= pdoc->Length()); + int len = cpMax - tr->chrg.cpMin; // No -1 as cpMin and cpMax are referring to inter character positions + pdoc->GetCharRange(tr->lpstrText, tr->chrg.cpMin, len); + // Spec says copied text is terminated with a NUL + tr->lpstrText[len] = '\0'; + return len; // Not including NUL + } + + case SCI_HIDESELECTION: + hideSelection = wParam != 0; + Redraw(); + break; + + case SCI_FORMATRANGE: + return FormatRange(wParam != 0, reinterpret_cast(lParam)); + + case SCI_GETMARGINLEFT: + return vs.leftMarginWidth; + + case SCI_GETMARGINRIGHT: + return vs.rightMarginWidth; + + case SCI_SETMARGINLEFT: + vs.leftMarginWidth = lParam; + InvalidateStyleRedraw(); + break; + + case SCI_SETMARGINRIGHT: + vs.rightMarginWidth = lParam; + InvalidateStyleRedraw(); + break; + + // Control specific mesages + + case SCI_ADDTEXT: { + if (lParam == 0) + return 0; + pdoc->InsertString(CurrentPosition(), CharPtrFromSPtr(lParam), wParam); + SetEmptySelection(currentPos + wParam); + return 0; + } + + case SCI_ADDSTYLEDTEXT: { + if (lParam == 0) + return 0; + pdoc->InsertStyledString(CurrentPosition() * 2, CharPtrFromSPtr(lParam), wParam); + SetEmptySelection(currentPos + wParam / 2); + return 0; + } + + case SCI_INSERTTEXT: { + if (lParam == 0) + return 0; + int insertPos = wParam; + if (static_cast(wParam) == -1) + insertPos = CurrentPosition(); + int newCurrent = CurrentPosition(); + char *sz = CharPtrFromSPtr(lParam); + pdoc->InsertString(insertPos, sz); + if (newCurrent > insertPos) + newCurrent += istrlen(sz); + SetEmptySelection(newCurrent); + return 0; + } + + case SCI_APPENDTEXT: + pdoc->InsertString(pdoc->Length(), CharPtrFromSPtr(lParam), wParam); + return 0; + + case SCI_CLEARALL: + ClearAll(); + return 0; + + case SCI_CLEARDOCUMENTSTYLE: + ClearDocumentStyle(); + return 0; + + case SCI_SETUNDOCOLLECTION: + pdoc->SetUndoCollection(wParam != 0); + return 0; + + case SCI_GETUNDOCOLLECTION: + return pdoc->IsCollectingUndo(); + + case SCI_BEGINUNDOACTION: + pdoc->BeginUndoAction(); + return 0; + + case SCI_ENDUNDOACTION: + pdoc->EndUndoAction(); + return 0; + + case SCI_GETCARETPERIOD: + return caret.period; + + case SCI_SETCARETPERIOD: + caret.period = wParam; + break; + + case SCI_SETWORDCHARS: { + pdoc->SetDefaultCharClasses(false); + if (lParam == 0) + return 0; + pdoc->SetCharClasses(reinterpret_cast(lParam), CharClassify::ccWord); + } + break; + + case SCI_SETWHITESPACECHARS: { + if (lParam == 0) + return 0; + pdoc->SetCharClasses(reinterpret_cast(lParam), CharClassify::ccSpace); + } + break; + + case SCI_SETCHARSDEFAULT: + pdoc->SetDefaultCharClasses(true); + break; + + case SCI_GETLENGTH: + return pdoc->Length(); + + case SCI_ALLOCATE: + pdoc->Allocate(wParam); + break; + + case SCI_GETCHARAT: + return pdoc->CharAt(wParam); + + case SCI_SETCURRENTPOS: + SetSelection(wParam, anchor); + break; + + case SCI_GETCURRENTPOS: + return currentPos; + + case SCI_SETANCHOR: + SetSelection(currentPos, wParam); + break; + + case SCI_GETANCHOR: + return anchor; + + case SCI_SETSELECTIONSTART: + SetSelection(Platform::Maximum(currentPos, wParam), wParam); + break; + + case SCI_GETSELECTIONSTART: + return Platform::Minimum(anchor, currentPos); + + case SCI_SETSELECTIONEND: + SetSelection(wParam, Platform::Minimum(anchor, wParam)); + break; + + case SCI_GETSELECTIONEND: + return Platform::Maximum(anchor, currentPos); + + case SCI_SETPRINTMAGNIFICATION: + printMagnification = wParam; + break; + + case SCI_GETPRINTMAGNIFICATION: + return printMagnification; + + case SCI_SETPRINTCOLOURMODE: + printColourMode = wParam; + break; + + case SCI_GETPRINTCOLOURMODE: + return printColourMode; + + case SCI_SETPRINTWRAPMODE: + printWrapState = (wParam == SC_WRAP_WORD) ? eWrapWord : eWrapNone; + break; + + case SCI_GETPRINTWRAPMODE: + return printWrapState; + + case SCI_GETSTYLEAT: + if (static_cast(wParam) >= pdoc->Length()) + return 0; + else + return pdoc->StyleAt(wParam); + + case SCI_REDO: + Redo(); + break; + + case SCI_SELECTALL: + SelectAll(); + break; + + case SCI_SETSAVEPOINT: + pdoc->SetSavePoint(); + break; + + case SCI_GETSTYLEDTEXT: { + if (lParam == 0) + return 0; + TextRange *tr = reinterpret_cast(lParam); + int iPlace = 0; + for (int iChar = tr->chrg.cpMin; iChar < tr->chrg.cpMax; iChar++) { + tr->lpstrText[iPlace++] = pdoc->CharAt(iChar); + tr->lpstrText[iPlace++] = pdoc->StyleAt(iChar); + } + tr->lpstrText[iPlace] = '\0'; + tr->lpstrText[iPlace + 1] = '\0'; + return iPlace; + } + + case SCI_CANREDO: + return (pdoc->CanRedo() && !pdoc->IsReadOnly()) ? 1 : 0; + + case SCI_MARKERLINEFROMHANDLE: + return pdoc->LineFromHandle(wParam); + + case SCI_MARKERDELETEHANDLE: + pdoc->DeleteMarkFromHandle(wParam); + break; + + case SCI_GETVIEWWS: + return vs.viewWhitespace; + + case SCI_SETVIEWWS: + vs.viewWhitespace = static_cast(wParam); + Redraw(); + break; + + case SCI_POSITIONFROMPOINT: + return PositionFromLocation(Point(wParam, lParam)); + + case SCI_POSITIONFROMPOINTCLOSE: + return PositionFromLocationClose(Point(wParam, lParam)); + + case SCI_GOTOLINE: + GoToLine(wParam); + break; + + case SCI_GOTOPOS: + SetEmptySelection(wParam); + EnsureCaretVisible(); + Redraw(); + break; + + case SCI_GETCURLINE: { + int lineCurrentPos = pdoc->LineFromPosition(currentPos); + int lineStart = pdoc->LineStart(lineCurrentPos); + unsigned int lineEnd = pdoc->LineStart(lineCurrentPos + 1); + if (lParam == 0) { + return 1 + lineEnd - lineStart; + } + PLATFORM_ASSERT(wParam > 0); + char *ptr = CharPtrFromSPtr(lParam); + unsigned int iPlace = 0; + for (unsigned int iChar = lineStart; iChar < lineEnd && iPlace < wParam - 1; iChar++) { + ptr[iPlace++] = pdoc->CharAt(iChar); + } + ptr[iPlace] = '\0'; + return currentPos - lineStart; + } + + case SCI_GETENDSTYLED: + return pdoc->GetEndStyled(); + + case SCI_GETEOLMODE: + return pdoc->eolMode; + + case SCI_SETEOLMODE: + pdoc->eolMode = wParam; + break; + + case SCI_STARTSTYLING: + pdoc->StartStyling(wParam, static_cast(lParam)); + break; + + case SCI_SETSTYLING: + pdoc->SetStyleFor(wParam, static_cast(lParam)); + break; + + case SCI_SETSTYLINGEX: // Specify a complete styling buffer + if (lParam == 0) + return 0; + pdoc->SetStyles(wParam, CharPtrFromSPtr(lParam)); + break; + + case SCI_SETBUFFEREDDRAW: + bufferedDraw = wParam != 0; + break; + + case SCI_GETBUFFEREDDRAW: + return bufferedDraw; + + case SCI_GETTWOPHASEDRAW: + return twoPhaseDraw; + + case SCI_SETTWOPHASEDRAW: + twoPhaseDraw = wParam != 0; + InvalidateStyleRedraw(); + break; + + case SCI_SETTABWIDTH: + if (wParam > 0) { + pdoc->tabInChars = wParam; + if (pdoc->indentInChars == 0) + pdoc->actualIndentInChars = pdoc->tabInChars; + } + InvalidateStyleRedraw(); + break; + + case SCI_GETTABWIDTH: + return pdoc->tabInChars; + + case SCI_SETINDENT: + pdoc->indentInChars = wParam; + if (pdoc->indentInChars != 0) + pdoc->actualIndentInChars = pdoc->indentInChars; + else + pdoc->actualIndentInChars = pdoc->tabInChars; + InvalidateStyleRedraw(); + break; + + case SCI_GETINDENT: + return pdoc->indentInChars; + + case SCI_SETUSETABS: + pdoc->useTabs = wParam != 0; + InvalidateStyleRedraw(); + break; + + case SCI_GETUSETABS: + return pdoc->useTabs; + + case SCI_SETLINEINDENTATION: + pdoc->SetLineIndentation(wParam, lParam); + break; + + case SCI_GETLINEINDENTATION: + return pdoc->GetLineIndentation(wParam); + + case SCI_GETLINEINDENTPOSITION: + return pdoc->GetLineIndentPosition(wParam); + + case SCI_SETTABINDENTS: + pdoc->tabIndents = wParam != 0; + break; + + case SCI_GETTABINDENTS: + return pdoc->tabIndents; + + case SCI_SETBACKSPACEUNINDENTS: + pdoc->backspaceUnindents = wParam != 0; + break; + + case SCI_GETBACKSPACEUNINDENTS: + return pdoc->backspaceUnindents; + + case SCI_SETMOUSEDWELLTIME: + dwellDelay = wParam; + ticksToDwell = dwellDelay; + break; + + case SCI_GETMOUSEDWELLTIME: + return dwellDelay; + + case SCI_WORDSTARTPOSITION: + return pdoc->ExtendWordSelect(wParam, -1, lParam != 0); + + case SCI_WORDENDPOSITION: + return pdoc->ExtendWordSelect(wParam, 1, lParam != 0); + + case SCI_SETWRAPMODE: + switch (wParam) { + case SC_WRAP_WORD: + wrapState = eWrapWord; + break; + case SC_WRAP_CHAR: + wrapState = eWrapChar; + break; + default: + wrapState = eWrapNone; + break; + } + xOffset = 0; + InvalidateStyleRedraw(); + ReconfigureScrollBars(); + break; + + case SCI_GETWRAPMODE: + return wrapState; + + case SCI_SETWRAPVISUALFLAGS: + wrapVisualFlags = wParam; + actualWrapVisualStartIndent = wrapVisualStartIndent; + if ((wrapVisualFlags & SC_WRAPVISUALFLAG_START) && (actualWrapVisualStartIndent == 0)) + actualWrapVisualStartIndent = 1; // must indent to show start visual + InvalidateStyleRedraw(); + ReconfigureScrollBars(); + break; + + case SCI_GETWRAPVISUALFLAGS: + return wrapVisualFlags; + + case SCI_SETWRAPVISUALFLAGSLOCATION: + wrapVisualFlagsLocation = wParam; + InvalidateStyleRedraw(); + break; + + case SCI_GETWRAPVISUALFLAGSLOCATION: + return wrapVisualFlagsLocation; + + case SCI_SETWRAPSTARTINDENT: + wrapVisualStartIndent = wParam; + actualWrapVisualStartIndent = wrapVisualStartIndent; + if ((wrapVisualFlags & SC_WRAPVISUALFLAG_START) && (actualWrapVisualStartIndent == 0)) + actualWrapVisualStartIndent = 1; // must indent to show start visual + InvalidateStyleRedraw(); + ReconfigureScrollBars(); + break; + + case SCI_GETWRAPSTARTINDENT: + return wrapVisualStartIndent; + + case SCI_SETLAYOUTCACHE: + llc.SetLevel(wParam); + break; + + case SCI_GETLAYOUTCACHE: + return llc.GetLevel(); + + case SCI_SETSCROLLWIDTH: + PLATFORM_ASSERT(wParam > 0); + if ((wParam > 0) && (wParam != static_cast(scrollWidth))) { + scrollWidth = wParam; + SetScrollBars(); + } + break; + + case SCI_GETSCROLLWIDTH: + return scrollWidth; + + case SCI_LINESJOIN: + LinesJoin(); + break; + + case SCI_LINESSPLIT: + LinesSplit(wParam); + break; + + case SCI_TEXTWIDTH: + PLATFORM_ASSERT(wParam <= STYLE_MAX); + PLATFORM_ASSERT(lParam); + return TextWidth(wParam, CharPtrFromSPtr(lParam)); + + case SCI_TEXTHEIGHT: + return vs.lineHeight; + + case SCI_SETENDATLASTLINE: + PLATFORM_ASSERT((wParam == 0) || (wParam == 1)); + if (endAtLastLine != (wParam != 0)) { + endAtLastLine = wParam != 0; + SetScrollBars(); + } + break; + + case SCI_GETENDATLASTLINE: + return endAtLastLine; + + case SCI_SETCARETSTICKY: + PLATFORM_ASSERT((wParam == 0) || (wParam == 1)); + if (caretSticky != (wParam != 0)) { + caretSticky = wParam != 0; + } + break; + + case SCI_GETCARETSTICKY: + return caretSticky; + + case SCI_TOGGLECARETSTICKY: + caretSticky = !caretSticky; + break; + + case SCI_GETCOLUMN: + return pdoc->GetColumn(wParam); + + case SCI_FINDCOLUMN: + return pdoc->FindColumn(wParam, lParam); + + case SCI_SETHSCROLLBAR : + if (horizontalScrollBarVisible != (wParam != 0)) { + horizontalScrollBarVisible = wParam != 0; + SetScrollBars(); + ReconfigureScrollBars(); + } + break; + + case SCI_GETHSCROLLBAR: + return horizontalScrollBarVisible; + + case SCI_SETVSCROLLBAR: + if (verticalScrollBarVisible != (wParam != 0)) { + verticalScrollBarVisible = wParam != 0; + SetScrollBars(); + ReconfigureScrollBars(); + } + break; + + case SCI_GETVSCROLLBAR: + return verticalScrollBarVisible; + + case SCI_SETINDENTATIONGUIDES: + vs.viewIndentationGuides = wParam != 0; + Redraw(); + break; + + case SCI_GETINDENTATIONGUIDES: + return vs.viewIndentationGuides; + + case SCI_SETHIGHLIGHTGUIDE: + if ((highlightGuideColumn != static_cast(wParam)) || (wParam > 0)) { + highlightGuideColumn = wParam; + Redraw(); + } + break; + + case SCI_GETHIGHLIGHTGUIDE: + return highlightGuideColumn; + + case SCI_GETLINEENDPOSITION: + return pdoc->LineEnd(wParam); + + case SCI_SETCODEPAGE: + if (ValidCodePage(wParam)) { + pdoc->dbcsCodePage = wParam; + InvalidateStyleRedraw(); + } + break; + + case SCI_GETCODEPAGE: + return pdoc->dbcsCodePage; + + case SCI_SETUSEPALETTE: + palette.allowRealization = wParam != 0; + InvalidateStyleRedraw(); + break; + + case SCI_GETUSEPALETTE: + return palette.allowRealization; + + // Marker definition and setting + case SCI_MARKERDEFINE: + if (wParam <= MARKER_MAX) + vs.markers[wParam].markType = lParam; + InvalidateStyleData(); + RedrawSelMargin(); + break; + case SCI_MARKERSETFORE: + if (wParam <= MARKER_MAX) + vs.markers[wParam].fore.desired = ColourDesired(lParam); + InvalidateStyleData(); + RedrawSelMargin(); + break; + case SCI_MARKERSETBACK: + if (wParam <= MARKER_MAX) + vs.markers[wParam].back.desired = ColourDesired(lParam); + InvalidateStyleData(); + RedrawSelMargin(); + break; + case SCI_MARKERSETALPHA: + if (wParam <= MARKER_MAX) + vs.markers[wParam].alpha = lParam; + InvalidateStyleRedraw(); + break; + case SCI_MARKERADD: { + int markerID = pdoc->AddMark(wParam, lParam); + return markerID; + } + case SCI_MARKERADDSET: + if (lParam != 0) + pdoc->AddMarkSet(wParam, lParam); + break; + + case SCI_MARKERDELETE: + pdoc->DeleteMark(wParam, lParam); + break; + + case SCI_MARKERDELETEALL: + pdoc->DeleteAllMarks(static_cast(wParam)); + break; + + case SCI_MARKERGET: + return pdoc->GetMark(wParam); + + case SCI_MARKERNEXT: { + int lt = pdoc->LinesTotal(); + for (int iLine = wParam; iLine < lt; iLine++) { + if ((pdoc->GetMark(iLine) & lParam) != 0) + return iLine; + } + } + return -1; + + case SCI_MARKERPREVIOUS: { + for (int iLine = wParam; iLine >= 0; iLine--) { + if ((pdoc->GetMark(iLine) & lParam) != 0) + return iLine; + } + } + return -1; + + case SCI_MARKERDEFINEPIXMAP: + if (wParam <= MARKER_MAX) { + vs.markers[wParam].SetXPM(CharPtrFromSPtr(lParam)); + }; + InvalidateStyleData(); + RedrawSelMargin(); + break; + + case SCI_SETMARGINTYPEN: + if (ValidMargin(wParam)) { + vs.ms[wParam].style = lParam; + InvalidateStyleRedraw(); + } + break; + + case SCI_GETMARGINTYPEN: + if (ValidMargin(wParam)) + return vs.ms[wParam].style; + else + return 0; + + case SCI_SETMARGINWIDTHN: + if (ValidMargin(wParam)) { + // Short-circuit if the width is unchanged, to avoid unnecessary redraw. + if (vs.ms[wParam].width != lParam) { + vs.ms[wParam].width = lParam; + InvalidateStyleRedraw(); + } + } + break; + + case SCI_GETMARGINWIDTHN: + if (ValidMargin(wParam)) + return vs.ms[wParam].width; + else + return 0; + + case SCI_SETMARGINMASKN: + if (ValidMargin(wParam)) { + vs.ms[wParam].mask = lParam; + InvalidateStyleRedraw(); + } + break; + + case SCI_GETMARGINMASKN: + if (ValidMargin(wParam)) + return vs.ms[wParam].mask; + else + return 0; + + case SCI_SETMARGINSENSITIVEN: + if (ValidMargin(wParam)) { + vs.ms[wParam].sensitive = lParam != 0; + InvalidateStyleRedraw(); + } + break; + + case SCI_GETMARGINSENSITIVEN: + if (ValidMargin(wParam)) + return vs.ms[wParam].sensitive ? 1 : 0; + else + return 0; + + case SCI_STYLECLEARALL: + vs.ClearStyles(); + InvalidateStyleRedraw(); + break; + + case SCI_STYLESETFORE: + if (wParam <= STYLE_MAX) { + vs.styles[wParam].fore.desired = ColourDesired(lParam); + InvalidateStyleRedraw(); + } + break; + case SCI_STYLESETBACK: + if (wParam <= STYLE_MAX) { + vs.styles[wParam].back.desired = ColourDesired(lParam); + InvalidateStyleRedraw(); + } + break; + case SCI_STYLESETBOLD: + if (wParam <= STYLE_MAX) { + vs.styles[wParam].bold = lParam != 0; + InvalidateStyleRedraw(); + } + break; + case SCI_STYLESETITALIC: + if (wParam <= STYLE_MAX) { + vs.styles[wParam].italic = lParam != 0; + InvalidateStyleRedraw(); + } + break; + case SCI_STYLESETEOLFILLED: + if (wParam <= STYLE_MAX) { + vs.styles[wParam].eolFilled = lParam != 0; + InvalidateStyleRedraw(); + } + break; + case SCI_STYLESETSIZE: + if (wParam <= STYLE_MAX) { + vs.styles[wParam].size = lParam; + InvalidateStyleRedraw(); + } + break; + case SCI_STYLESETFONT: + if (lParam == 0) + return 0; + if (wParam <= STYLE_MAX) { + vs.SetStyleFontName(wParam, CharPtrFromSPtr(lParam)); + InvalidateStyleRedraw(); + } + break; + case SCI_STYLESETUNDERLINE: + if (wParam <= STYLE_MAX) { + vs.styles[wParam].underline = lParam != 0; + InvalidateStyleRedraw(); + } + break; + case SCI_STYLESETCASE: + if (wParam <= STYLE_MAX) { + vs.styles[wParam].caseForce = static_cast(lParam); + InvalidateStyleRedraw(); + } + break; + case SCI_STYLESETCHARACTERSET: + if (wParam <= STYLE_MAX) { + vs.styles[wParam].characterSet = lParam; + InvalidateStyleRedraw(); + } + break; + case SCI_STYLESETVISIBLE: + if (wParam <= STYLE_MAX) { + vs.styles[wParam].visible = lParam != 0; + InvalidateStyleRedraw(); + } + break; + case SCI_STYLESETCHANGEABLE: + if (wParam <= STYLE_MAX) { + vs.styles[wParam].changeable = lParam != 0; + InvalidateStyleRedraw(); + } + break; + case SCI_STYLESETHOTSPOT: + if (wParam <= STYLE_MAX) { + vs.styles[wParam].hotspot = lParam != 0; + InvalidateStyleRedraw(); + } + break; + + case SCI_STYLERESETDEFAULT: + vs.ResetDefaultStyle(); + InvalidateStyleRedraw(); + break; + case SCI_SETSTYLEBITS: + pdoc->SetStylingBits(wParam); + break; + + case SCI_GETSTYLEBITS: + return pdoc->stylingBits; + + case SCI_SETLINESTATE: + return pdoc->SetLineState(wParam, lParam); + + case SCI_GETLINESTATE: + return pdoc->GetLineState(wParam); + + case SCI_GETMAXLINESTATE: + return pdoc->GetMaxLineState(); + + case SCI_GETCARETLINEVISIBLE: + return vs.showCaretLineBackground; + case SCI_SETCARETLINEVISIBLE: + vs.showCaretLineBackground = wParam != 0; + InvalidateStyleRedraw(); + break; + case SCI_GETCARETLINEBACK: + return vs.caretLineBackground.desired.AsLong(); + case SCI_SETCARETLINEBACK: + vs.caretLineBackground.desired = wParam; + InvalidateStyleRedraw(); + break; + case SCI_GETCARETLINEBACKALPHA: + return vs.caretLineAlpha; + case SCI_SETCARETLINEBACKALPHA: + vs.caretLineAlpha = wParam; + InvalidateStyleRedraw(); + break; + + // Folding messages + + case SCI_VISIBLEFROMDOCLINE: + return cs.DisplayFromDoc(wParam); + + case SCI_DOCLINEFROMVISIBLE: + return cs.DocFromDisplay(wParam); + + case SCI_WRAPCOUNT: + return WrapCount(wParam); + + case SCI_SETFOLDLEVEL: { + int prev = pdoc->SetLevel(wParam, lParam); + if (prev != lParam) + RedrawSelMargin(); + return prev; + } + + case SCI_GETFOLDLEVEL: + return pdoc->GetLevel(wParam); + + case SCI_GETLASTCHILD: + return pdoc->GetLastChild(wParam, lParam); + + case SCI_GETFOLDPARENT: + return pdoc->GetFoldParent(wParam); + + case SCI_SHOWLINES: + cs.SetVisible(wParam, lParam, true); + SetScrollBars(); + Redraw(); + break; + + case SCI_HIDELINES: + cs.SetVisible(wParam, lParam, false); + SetScrollBars(); + Redraw(); + break; + + case SCI_GETLINEVISIBLE: + return cs.GetVisible(wParam); + + case SCI_SETFOLDEXPANDED: + if (cs.SetExpanded(wParam, lParam != 0)) { + RedrawSelMargin(); + } + break; + + case SCI_GETFOLDEXPANDED: + return cs.GetExpanded(wParam); + + case SCI_SETFOLDFLAGS: + foldFlags = wParam; + Redraw(); + break; + + case SCI_TOGGLEFOLD: + ToggleContraction(wParam); + break; + + case SCI_ENSUREVISIBLE: + EnsureLineVisible(wParam, false); + break; + + case SCI_ENSUREVISIBLEENFORCEPOLICY: + EnsureLineVisible(wParam, true); + break; + + case SCI_SEARCHANCHOR: + SearchAnchor(); + break; + + case SCI_SEARCHNEXT: + case SCI_SEARCHPREV: + return SearchText(iMessage, wParam, lParam); + +#ifdef INCLUDE_DEPRECATED_FEATURES + case SCI_SETCARETPOLICY: // Deprecated + caretXPolicy = caretYPolicy = wParam; + caretXSlop = caretYSlop = lParam; + break; +#endif + + case SCI_SETXCARETPOLICY: + caretXPolicy = wParam; + caretXSlop = lParam; + break; + + case SCI_SETYCARETPOLICY: + caretYPolicy = wParam; + caretYSlop = lParam; + break; + + case SCI_SETVISIBLEPOLICY: + visiblePolicy = wParam; + visibleSlop = lParam; + break; + + case SCI_LINESONSCREEN: + return LinesOnScreen(); + + case SCI_SETSELFORE: + vs.selforeset = wParam != 0; + vs.selforeground.desired = ColourDesired(lParam); + InvalidateStyleRedraw(); + break; + + case SCI_SETSELBACK: + vs.selbackset = wParam != 0; + vs.selbackground.desired = ColourDesired(lParam); + InvalidateStyleRedraw(); + break; + + case SCI_SETSELALPHA: + vs.selAlpha = wParam; + InvalidateStyleRedraw(); + break; + + case SCI_GETSELALPHA: + return vs.selAlpha; + + case SCI_SETWHITESPACEFORE: + vs.whitespaceForegroundSet = wParam != 0; + vs.whitespaceForeground.desired = ColourDesired(lParam); + InvalidateStyleRedraw(); + break; + + case SCI_SETWHITESPACEBACK: + vs.whitespaceBackgroundSet = wParam != 0; + vs.whitespaceBackground.desired = ColourDesired(lParam); + InvalidateStyleRedraw(); + break; + + case SCI_SETCARETFORE: + vs.caretcolour.desired = ColourDesired(wParam); + InvalidateStyleRedraw(); + break; + + case SCI_GETCARETFORE: + return vs.caretcolour.desired.AsLong(); + + case SCI_SETCARETWIDTH: + if (wParam <= 0) + vs.caretWidth = 0; + else if (wParam >= 3) + vs.caretWidth = 3; + else + vs.caretWidth = wParam; + InvalidateStyleRedraw(); + break; + + case SCI_GETCARETWIDTH: + return vs.caretWidth; + + case SCI_ASSIGNCMDKEY: + kmap.AssignCmdKey(Platform::LowShortFromLong(wParam), + Platform::HighShortFromLong(wParam), lParam); + break; + + case SCI_CLEARCMDKEY: + kmap.AssignCmdKey(Platform::LowShortFromLong(wParam), + Platform::HighShortFromLong(wParam), SCI_NULL); + break; + + case SCI_CLEARALLCMDKEYS: + kmap.Clear(); + break; + + case SCI_INDICSETSTYLE: + if (wParam <= INDIC_MAX) { + vs.indicators[wParam].style = lParam; + InvalidateStyleRedraw(); + } + break; + + case SCI_INDICGETSTYLE: + return (wParam <= INDIC_MAX) ? vs.indicators[wParam].style : 0; + + case SCI_INDICSETFORE: + if (wParam <= INDIC_MAX) { + vs.indicators[wParam].fore.desired = ColourDesired(lParam); + InvalidateStyleRedraw(); + } + break; + + case SCI_INDICGETFORE: + return (wParam <= INDIC_MAX) ? vs.indicators[wParam].fore.desired.AsLong() : 0; + + case SCI_LINEDOWN: + case SCI_LINEDOWNEXTEND: + case SCI_PARADOWN: + case SCI_PARADOWNEXTEND: + case SCI_LINEUP: + case SCI_LINEUPEXTEND: + case SCI_PARAUP: + case SCI_PARAUPEXTEND: + case SCI_CHARLEFT: + case SCI_CHARLEFTEXTEND: + case SCI_CHARRIGHT: + case SCI_CHARRIGHTEXTEND: + case SCI_WORDLEFT: + case SCI_WORDLEFTEXTEND: + case SCI_WORDRIGHT: + case SCI_WORDRIGHTEXTEND: + case SCI_WORDLEFTEND: + case SCI_WORDLEFTENDEXTEND: + case SCI_WORDRIGHTEND: + case SCI_WORDRIGHTENDEXTEND: + case SCI_HOME: + case SCI_HOMEEXTEND: + case SCI_LINEEND: + case SCI_LINEENDEXTEND: + case SCI_HOMEWRAP: + case SCI_HOMEWRAPEXTEND: + case SCI_LINEENDWRAP: + case SCI_LINEENDWRAPEXTEND: + case SCI_DOCUMENTSTART: + case SCI_DOCUMENTSTARTEXTEND: + case SCI_DOCUMENTEND: + case SCI_DOCUMENTENDEXTEND: + + case SCI_STUTTEREDPAGEUP: + case SCI_STUTTEREDPAGEUPEXTEND: + case SCI_STUTTEREDPAGEDOWN: + case SCI_STUTTEREDPAGEDOWNEXTEND: + + case SCI_PAGEUP: + case SCI_PAGEUPEXTEND: + case SCI_PAGEDOWN: + case SCI_PAGEDOWNEXTEND: + case SCI_EDITTOGGLEOVERTYPE: + case SCI_CANCEL: + case SCI_DELETEBACK: + case SCI_TAB: + case SCI_BACKTAB: + case SCI_NEWLINE: + case SCI_FORMFEED: + case SCI_VCHOME: + case SCI_VCHOMEEXTEND: + case SCI_VCHOMEWRAP: + case SCI_VCHOMEWRAPEXTEND: + case SCI_ZOOMIN: + case SCI_ZOOMOUT: + case SCI_DELWORDLEFT: + case SCI_DELWORDRIGHT: + case SCI_DELLINELEFT: + case SCI_DELLINERIGHT: + case SCI_LINECOPY: + case SCI_LINECUT: + case SCI_LINEDELETE: + case SCI_LINETRANSPOSE: + case SCI_LINEDUPLICATE: + case SCI_LOWERCASE: + case SCI_UPPERCASE: + case SCI_LINESCROLLDOWN: + case SCI_LINESCROLLUP: + case SCI_WORDPARTLEFT: + case SCI_WORDPARTLEFTEXTEND: + case SCI_WORDPARTRIGHT: + case SCI_WORDPARTRIGHTEXTEND: + case SCI_DELETEBACKNOTLINE: + case SCI_HOMEDISPLAY: + case SCI_HOMEDISPLAYEXTEND: + case SCI_LINEENDDISPLAY: + case SCI_LINEENDDISPLAYEXTEND: + case SCI_LINEDOWNRECTEXTEND: + case SCI_LINEUPRECTEXTEND: + case SCI_CHARLEFTRECTEXTEND: + case SCI_CHARRIGHTRECTEXTEND: + case SCI_HOMERECTEXTEND: + case SCI_VCHOMERECTEXTEND: + case SCI_LINEENDRECTEXTEND: + case SCI_PAGEUPRECTEXTEND: + case SCI_PAGEDOWNRECTEXTEND: + case SCI_SELECTIONDUPLICATE: + return KeyCommand(iMessage); + + case SCI_BRACEHIGHLIGHT: + SetBraceHighlight(static_cast(wParam), lParam, STYLE_BRACELIGHT); + break; + + case SCI_BRACEBADLIGHT: + SetBraceHighlight(static_cast(wParam), -1, STYLE_BRACEBAD); + break; + + case SCI_BRACEMATCH: + // wParam is position of char to find brace for, + // lParam is maximum amount of text to restyle to find it + return pdoc->BraceMatch(wParam, lParam); + + case SCI_GETVIEWEOL: + return vs.viewEOL; + + case SCI_SETVIEWEOL: + vs.viewEOL = wParam != 0; + InvalidateStyleRedraw(); + break; + + case SCI_SETZOOM: + vs.zoomLevel = wParam; + InvalidateStyleRedraw(); + NotifyZoom(); + break; + + case SCI_GETZOOM: + return vs.zoomLevel; + + case SCI_GETEDGECOLUMN: + return theEdge; + + case SCI_SETEDGECOLUMN: + theEdge = wParam; + InvalidateStyleRedraw(); + break; + + case SCI_GETEDGEMODE: + return vs.edgeState; + + case SCI_SETEDGEMODE: + vs.edgeState = wParam; + InvalidateStyleRedraw(); + break; + + case SCI_GETEDGECOLOUR: + return vs.edgecolour.desired.AsLong(); + + case SCI_SETEDGECOLOUR: + vs.edgecolour.desired = ColourDesired(wParam); + InvalidateStyleRedraw(); + break; + + case SCI_GETDOCPOINTER: + return reinterpret_cast(pdoc); + + case SCI_SETDOCPOINTER: + CancelModes(); + SetDocPointer(reinterpret_cast(lParam)); + return 0; + + case SCI_CREATEDOCUMENT: { + Document *doc = new Document(); + if (doc) { + doc->AddRef(); + } + return reinterpret_cast(doc); + } + + case SCI_ADDREFDOCUMENT: + (reinterpret_cast(lParam))->AddRef(); + break; + + case SCI_RELEASEDOCUMENT: + (reinterpret_cast(lParam))->Release(); + break; + + case SCI_SETMODEVENTMASK: + modEventMask = wParam; + return 0; + + case SCI_GETMODEVENTMASK: + return modEventMask; + + case SCI_CONVERTEOLS: + pdoc->ConvertLineEnds(wParam); + SetSelection(currentPos, anchor); // Ensure selection inside document + return 0; + + case SCI_SETLENGTHFORENCODE: + lengthForEncode = wParam; + return 0; + + case SCI_SELECTIONISRECTANGLE: + return selType == selRectangle ? 1 : 0; + + case SCI_SETSELECTIONMODE: { + switch (wParam) { + case SC_SEL_STREAM: + moveExtendsSelection = !moveExtendsSelection || (selType != selStream); + selType = selStream; + break; + case SC_SEL_RECTANGLE: + moveExtendsSelection = !moveExtendsSelection || (selType != selRectangle); + selType = selRectangle; + break; + case SC_SEL_LINES: + moveExtendsSelection = !moveExtendsSelection || (selType != selLines); + selType = selLines; + break; + default: + moveExtendsSelection = !moveExtendsSelection || (selType != selStream); + selType = selStream; + } + InvalidateSelection(currentPos, anchor); + } + case SCI_GETSELECTIONMODE: + switch (selType) { + case selStream: + return SC_SEL_STREAM; + case selRectangle: + return SC_SEL_RECTANGLE; + case selLines: + return SC_SEL_LINES; + default: // ?! + return SC_SEL_STREAM; + } + case SCI_GETLINESELSTARTPOSITION: { + SelectionLineIterator lineIterator(this); + lineIterator.SetAt(wParam); + return lineIterator.startPos; + } + case SCI_GETLINESELENDPOSITION: { + SelectionLineIterator lineIterator(this); + lineIterator.SetAt(wParam); + return lineIterator.endPos; + } + + case SCI_SETOVERTYPE: + inOverstrike = wParam != 0; + break; + + case SCI_GETOVERTYPE: + return inOverstrike ? 1 : 0; + + case SCI_SETFOCUS: + SetFocusState(wParam != 0); + break; + + case SCI_GETFOCUS: + return hasFocus; + + case SCI_SETSTATUS: + errorStatus = wParam; + break; + + case SCI_GETSTATUS: + return errorStatus; + + case SCI_SETMOUSEDOWNCAPTURES: + mouseDownCaptures = wParam != 0; + break; + + case SCI_GETMOUSEDOWNCAPTURES: + return mouseDownCaptures; + + case SCI_SETCURSOR: + cursorMode = wParam; + DisplayCursor(Window::cursorText); + break; + + case SCI_GETCURSOR: + return cursorMode; + + case SCI_SETCONTROLCHARSYMBOL: + controlCharSymbol = wParam; + break; + + case SCI_GETCONTROLCHARSYMBOL: + return controlCharSymbol; + + case SCI_STARTRECORD: + recordingMacro = true; + return 0; + + case SCI_STOPRECORD: + recordingMacro = false; + return 0; + + case SCI_MOVECARETINSIDEVIEW: + MoveCaretInsideView(); + break; + + case SCI_SETFOLDMARGINCOLOUR: + vs.foldmarginColourSet = wParam != 0; + vs.foldmarginColour.desired = ColourDesired(lParam); + InvalidateStyleRedraw(); + break; + + case SCI_SETFOLDMARGINHICOLOUR: + vs.foldmarginHighlightColourSet = wParam != 0; + vs.foldmarginHighlightColour.desired = ColourDesired(lParam); + InvalidateStyleRedraw(); + break; + + case SCI_SETHOTSPOTACTIVEFORE: + vs.hotspotForegroundSet = wParam != 0; + vs.hotspotForeground.desired = ColourDesired(lParam); + InvalidateStyleRedraw(); + break; + + case SCI_SETHOTSPOTACTIVEBACK: + vs.hotspotBackgroundSet = wParam != 0; + vs.hotspotBackground.desired = ColourDesired(lParam); + InvalidateStyleRedraw(); + break; + + case SCI_SETHOTSPOTACTIVEUNDERLINE: + vs.hotspotUnderline = wParam != 0; + InvalidateStyleRedraw(); + break; + + case SCI_SETHOTSPOTSINGLELINE: + vs.hotspotSingleLine = wParam != 0; + InvalidateStyleRedraw(); + break; + + case SCI_SETPASTECONVERTENDINGS: + convertPastes = wParam != 0; + break; + + case SCI_GETPASTECONVERTENDINGS: + return convertPastes ? 1 : 0; + + default: + return DefWndProc(iMessage, wParam, lParam); + } + //Platform::DebugPrintf("end wnd proc\n"); + return 0l; +} diff --git a/src/Editor.h b/src/Editor.h new file mode 100755 index 0000000..fe7be26 --- /dev/null +++ b/src/Editor.h @@ -0,0 +1,582 @@ +// Scintilla source code edit control +/** @file Editor.h + ** Defines the main editor class. + **/ +// Copyright 1998-2003 by Neil Hodgson +// The License.txt file describes the conditions under which this software may be distributed. + +#ifndef EDITOR_H +#define EDITOR_H + +/** + */ +class Caret { +public: + bool active; + bool on; + int period; + + Caret(); +}; + +/** + */ +class Timer { +public: + bool ticking; + int ticksToWait; + enum {tickSize = 100}; + TickerID tickerID; + + Timer(); +}; + +/** + */ +class Idler { +public: + bool state; + IdlerID idlerID; + + Idler(); +}; + +/** + */ +class LineLayout { +private: + friend class LineLayoutCache; + int *lineStarts; + int lenLineStarts; + /// Drawing is only performed for @a maxLineLength characters on each line. + int lineNumber; + bool inCache; +public: + enum { wrapWidthInfinite = 0x7ffffff }; + int maxLineLength; + int numCharsInLine; + enum validLevel { llInvalid, llCheckTextAndStyle, llPositions, llLines } validity; + int xHighlightGuide; + bool highlightColumn; + int selStart; + int selEnd; + bool containsCaret; + int edgeColumn; + char *chars; + unsigned char *styles; + int styleBitsSet; + char *indicators; + int *positions; + char bracePreviousStyles[2]; + + // Hotspot support + int hsStart; + int hsEnd; + + // Wrapped line support + int widthLine; + int lines; + + LineLayout(int maxLineLength_); + virtual ~LineLayout(); + void Resize(int maxLineLength_); + void Free(); + void Invalidate(validLevel validity_); + int LineStart(int line) { + if (line <= 0) { + return 0; + } else if ((line >= lines) || !lineStarts) { + return numCharsInLine; + } else { + return lineStarts[line]; + } + } + void SetLineStart(int line, int start); + void SetBracesHighlight(Range rangeLine, Position braces[], + char bracesMatchStyle, int xHighlight); + void RestoreBracesHighlight(Range rangeLine, Position braces[]); +}; + +/** + */ +class LineLayoutCache { + int level; + int length; + int size; + LineLayout **cache; + bool allInvalidated; + int styleClock; + int useCount; + void Allocate(int length_); + void AllocateForLevel(int linesOnScreen, int linesInDoc); +public: + LineLayoutCache(); + virtual ~LineLayoutCache(); + void Deallocate(); + enum { + llcNone=SC_CACHE_NONE, + llcCaret=SC_CACHE_CARET, + llcPage=SC_CACHE_PAGE, + llcDocument=SC_CACHE_DOCUMENT + }; + void Invalidate(LineLayout::validLevel validity_); + void SetLevel(int level_); + int GetLevel() { return level; } + LineLayout *Retrieve(int lineNumber, int lineCaret, int maxChars, int styleClock_, + int linesOnScreen, int linesInDoc); + void Dispose(LineLayout *ll); +}; + +/** + * Hold a piece of text selected for copying or dragging. + * The text is expected to hold a terminating '\0' and this is counted in len. + */ +class SelectionText { +public: + char *s; + int len; + bool rectangular; + int codePage; + int characterSet; + SelectionText() : s(0), len(0), rectangular(false), codePage(0), characterSet(0) {} + ~SelectionText() { + Free(); + } + void Free() { + Set(0, 0, 0, 0, false); + } + void Set(char *s_, int len_, int codePage_, int characterSet_, bool rectangular_) { + delete []s; + s = s_; + if (s) + len = len_; + else + len = 0; + codePage = codePage_; + characterSet = characterSet_; + rectangular = rectangular_; + } + void Copy(const char *s_, int len_, int codePage_, int characterSet_, bool rectangular_) { + delete []s; + s = new char[len_]; + if (s) { + len = len_; + for (int i = 0; i < len_; i++) { + s[i] = s_[i]; + } + } else { + len = 0; + } + codePage = codePage_; + characterSet = characterSet_; + rectangular = rectangular_; + } + void Copy(const SelectionText &other) { + Copy(other.s, other.len, other.codePage, other.characterSet, other.rectangular); + } +}; + +/** + */ +class Editor : public DocWatcher { + // Private so Editor objects can not be copied + Editor(const Editor &) : DocWatcher() {} + Editor &operator=(const Editor &) { return *this; } + +protected: // ScintillaBase subclass needs access to much of Editor + + /** On GTK+, Scintilla is a container widget holding two scroll bars + * whereas on Windows there is just one window with both scroll bars turned on. */ + Window wMain; ///< The Scintilla parent window + + /** Style resources may be expensive to allocate so are cached between uses. + * When a style attribute is changed, this cache is flushed. */ + bool stylesValid; + ViewStyle vs; + Palette palette; + + int printMagnification; + int printColourMode; + int printWrapState; + int cursorMode; + int controlCharSymbol; + + bool hasFocus; + bool hideSelection; + bool inOverstrike; + int errorStatus; + bool mouseDownCaptures; + + /** In bufferedDraw mode, graphics operations are drawn to a pixmap and then copied to + * the screen. This avoids flashing but is about 30% slower. */ + bool bufferedDraw; + /** In twoPhaseDraw mode, drawing is performed in two phases, first the background + * and then the foreground. This avoids chopping off characters that overlap the next run. */ + bool twoPhaseDraw; + + int xOffset; ///< Horizontal scrolled amount in pixels + int xCaretMargin; ///< Ensure this many pixels visible on both sides of caret + bool horizontalScrollBarVisible; + int scrollWidth; + bool verticalScrollBarVisible; + bool endAtLastLine; + bool caretSticky; + + Surface *pixmapLine; + Surface *pixmapSelMargin; + Surface *pixmapSelPattern; + Surface *pixmapIndentGuide; + Surface *pixmapIndentGuideHighlight; + + LineLayoutCache llc; + + KeyMap kmap; + + Caret caret; + Timer timer; + Timer autoScrollTimer; + enum { autoScrollDelay = 200 }; + + Idler idler; + + Point lastClick; + unsigned int lastClickTime; + int dwellDelay; + int ticksToDwell; + bool dwelling; + enum { selChar, selWord, selLine } selectionType; + Point ptMouseLast; + bool inDragDrop; + bool dropWentOutside; + int posDrag; + int posDrop; + int lastXChosen; + int lineAnchor; + int originalAnchorPos; + int currentPos; + int anchor; + int targetStart; + int targetEnd; + int searchFlags; + int topLine; + int posTopLine; + int lengthForEncode; + + bool needUpdateUI; + Position braces[2]; + int bracesMatchStyle; + int highlightGuideColumn; + + int theEdge; + + enum { notPainting, painting, paintAbandoned } paintState; + PRectangle rcPaint; + bool paintingAllText; + + int modEventMask; + + SelectionText drag; + enum selTypes { noSel, selStream, selRectangle, selLines }; + selTypes selType; + bool moveExtendsSelection; + int xStartSelect; ///< x position of start of rectangular selection + int xEndSelect; ///< x position of end of rectangular selection + bool primarySelection; + + int caretXPolicy; + int caretXSlop; ///< Ensure this many pixels visible on both sides of caret + + int caretYPolicy; + int caretYSlop; ///< Ensure this many lines visible on both sides of caret + + int visiblePolicy; + int visibleSlop; + + int searchAnchor; + + bool recordingMacro; + + int foldFlags; + ContractionState cs; + + // Hotspot support + int hsStart; + int hsEnd; + + // Wrapping support + enum { eWrapNone, eWrapWord, eWrapChar } wrapState; + enum { wrapLineLarge = 0x7ffffff }; + int wrapWidth; + int wrapStart; + int wrapEnd; + int wrapVisualFlags; + int wrapVisualFlagsLocation; + int wrapVisualStartIndent; + int actualWrapVisualStartIndent; + + bool convertPastes; + + Document *pdoc; + + Editor(); + virtual ~Editor(); + virtual void Initialise() = 0; + virtual void Finalise(); + + void InvalidateStyleData(); + void InvalidateStyleRedraw(); + virtual void RefreshColourPalette(Palette &pal, bool want); + void RefreshStyleData(); + void DropGraphics(); + + virtual PRectangle GetClientRectangle(); + PRectangle GetTextRectangle(); + + int LinesOnScreen(); + int LinesToScroll(); + int MaxScrollPos(); + Point LocationFromPosition(int pos); + int XFromPosition(int pos); + int PositionFromLocation(Point pt); + int PositionFromLocationClose(Point pt); + int PositionFromLineX(int line, int x); + int LineFromLocation(Point pt); + void SetTopLine(int topLineNew); + + bool AbandonPaint(); + void RedrawRect(PRectangle rc); + void Redraw(); + void RedrawSelMargin(int line=-1); + PRectangle RectangleFromRange(int start, int end); + void InvalidateRange(int start, int end); + + int CurrentPosition(); + bool SelectionEmpty(); + int SelectionStart(); + int SelectionEnd(); + void SetRectangularRange(); + void InvalidateSelection(int currentPos_, int anchor_); + void SetSelection(int currentPos_, int anchor_); + void SetSelection(int currentPos_); + void SetEmptySelection(int currentPos_); + bool RangeContainsProtected(int start, int end) const; + bool SelectionContainsProtected(); + int MovePositionOutsideChar(int pos, int moveDir, bool checkLineEnd=true); + int MovePositionTo(int newPos, selTypes sel=noSel, bool ensureVisible=true); + int MovePositionSoVisible(int pos, int moveDir); + void SetLastXChosen(); + + void ScrollTo(int line, bool moveThumb=true); + virtual void ScrollText(int linesToMove); + void HorizontalScrollTo(int xPos); + void MoveCaretInsideView(bool ensureVisible=true); + int DisplayFromPosition(int pos); + void EnsureCaretVisible(bool useMargin=true, bool vert=true, bool horiz=true); + void ShowCaretAtCurrentPosition(); + void DropCaret(); + void InvalidateCaret(); + virtual void UpdateSystemCaret(); + + void NeedWrapping(int docLineStart = 0, int docLineEnd = wrapLineLarge); + bool WrapLines(bool fullWrap, int priorityWrapLineStart); + void LinesJoin(); + void LinesSplit(int pixelWidth); + + int SubstituteMarkerIfEmpty(int markerCheck, int markerDefault); + void PaintSelMargin(Surface *surface, PRectangle &rc); + LineLayout *RetrieveLineLayout(int lineNumber); + void LayoutLine(int line, Surface *surface, ViewStyle &vstyle, LineLayout *ll, + int width=LineLayout::wrapWidthInfinite); + ColourAllocated SelectionBackground(ViewStyle &vsDraw); + ColourAllocated TextBackground(ViewStyle &vsDraw, bool overrideBackground, ColourAllocated background, bool inSelection, bool inHotspot, int styleMain, int i, LineLayout *ll); + void DrawIndentGuide(Surface *surface, int lineVisible, int lineHeight, int start, PRectangle rcSegment, bool highlight); + void DrawWrapMarker(Surface *surface, PRectangle rcPlace, bool isEndMarker, ColourAllocated wrapColour); + void DrawEOL(Surface *surface, ViewStyle &vsDraw, PRectangle rcLine, LineLayout *ll, + int line, int lineEnd, int xStart, int subLine, int subLineStart, + bool overrideBackground, ColourAllocated background, + bool drawWrapMark, ColourAllocated wrapColour); + void DrawLine(Surface *surface, ViewStyle &vsDraw, int line, int lineVisible, int xStart, + PRectangle rcLine, LineLayout *ll, int subLine=0); + void RefreshPixMaps(Surface *surfaceWindow); + void Paint(Surface *surfaceWindow, PRectangle rcArea); + long FormatRange(bool draw, RangeToFormat *pfr); + int TextWidth(int style, const char *text); + + virtual void SetVerticalScrollPos() = 0; + virtual void SetHorizontalScrollPos() = 0; + virtual bool ModifyScrollBars(int nMax, int nPage) = 0; + virtual void ReconfigureScrollBars(); + void SetScrollBars(); + void ChangeSize(); + + void AddChar(char ch); + virtual void AddCharUTF(char *s, unsigned int len, bool treatAsDBCS=false); + void ClearSelection(); + void ClearAll(); + void ClearDocumentStyle(); + void Cut(); + void PasteRectangular(int pos, const char *ptr, int len); + virtual void Copy() = 0; + virtual bool CanPaste(); + virtual void Paste() = 0; + void Clear(); + void SelectAll(); + void Undo(); + void Redo(); + void DelChar(); + void DelCharBack(bool allowLineStartDeletion); + virtual void ClaimSelection() = 0; + + virtual void NotifyChange() = 0; + virtual void NotifyFocus(bool focus); + virtual int GetCtrlID() { return ctrlID; } + virtual void NotifyParent(SCNotification scn) = 0; + virtual void NotifyStyleToNeeded(int endStyleNeeded); + void NotifyChar(int ch); + void NotifyMove(int position); + void NotifySavePoint(bool isSavePoint); + void NotifyModifyAttempt(); + virtual void NotifyDoubleClick(Point pt, bool shift); + void NotifyHotSpotClicked(int position, bool shift, bool ctrl, bool alt); + void NotifyHotSpotDoubleClicked(int position, bool shift, bool ctrl, bool alt); + void NotifyUpdateUI(); + void NotifyPainted(); + bool NotifyMarginClick(Point pt, bool shift, bool ctrl, bool alt); + void NotifyNeedShown(int pos, int len); + void NotifyDwelling(Point pt, bool state); + void NotifyZoom(); + + void NotifyModifyAttempt(Document *document, void *userData); + void NotifySavePoint(Document *document, void *userData, bool atSavePoint); + void CheckModificationForWrap(DocModification mh); + void NotifyModified(Document *document, DocModification mh, void *userData); + void NotifyDeleted(Document *document, void *userData); + void NotifyStyleNeeded(Document *doc, void *userData, int endPos); + void NotifyMacroRecord(unsigned int iMessage, uptr_t wParam, sptr_t lParam); + + void PageMove(int direction, selTypes sel=noSel, bool stuttered = false); + void ChangeCaseOfSelection(bool makeUpperCase); + void LineTranspose(); + void Duplicate(bool forLine); + virtual void CancelModes(); + void NewLine(); + void CursorUpOrDown(int direction, selTypes sel=noSel); + void ParaUpOrDown(int direction, selTypes sel=noSel); + int StartEndDisplayLine(int pos, bool start); + virtual int KeyCommand(unsigned int iMessage); + virtual int KeyDefault(int /* key */, int /*modifiers*/); + int KeyDown(int key, bool shift, bool ctrl, bool alt, bool *consumed=0); + + int GetWhitespaceVisible(); + void SetWhitespaceVisible(int view); + + void Indent(bool forwards); + + long FindText(uptr_t wParam, sptr_t lParam); + void SearchAnchor(); + long SearchText(unsigned int iMessage, uptr_t wParam, sptr_t lParam); + long SearchInTarget(const char *text, int length); + void GoToLine(int lineNo); + + virtual void CopyToClipboard(const SelectionText &selectedText) = 0; + char *CopyRange(int start, int end); + void CopySelectionFromRange(SelectionText *ss, int start, int end); + void CopySelectionRange(SelectionText *ss); + void CopyRangeToClipboard(int start, int end); + void CopyText(int length, const char *text); + void SetDragPosition(int newPos); + virtual void DisplayCursor(Window::Cursor c); + virtual void StartDrag(); + void DropAt(int position, const char *value, bool moving, bool rectangular); + /** PositionInSelection returns 0 if position in selection, -1 if position before selection, and 1 if after. + * Before means either before any line of selection or before selection on its line, with a similar meaning to after. */ + int PositionInSelection(int pos); + bool PointInSelection(Point pt); + bool PointInSelMargin(Point pt); + void LineSelection(int lineCurrent_, int lineAnchor_); + void DwellEnd(bool mouseMoved); + virtual void ButtonDown(Point pt, unsigned int curTime, bool shift, bool ctrl, bool alt); + void ButtonMove(Point pt); + void ButtonUp(Point pt, unsigned int curTime, bool ctrl); + + void Tick(); + bool Idle(); + virtual void SetTicking(bool on) = 0; + virtual bool SetIdle(bool) { return false; } + virtual void SetMouseCapture(bool on) = 0; + virtual bool HaveMouseCapture() = 0; + void SetFocusState(bool focusState); + + virtual bool PaintContains(PRectangle rc); + bool PaintContainsMargin(); + void CheckForChangeOutsidePaint(Range r); + void SetBraceHighlight(Position pos0, Position pos1, int matchStyle); + + void SetDocPointer(Document *document); + + void Expand(int &line, bool doExpand); + void ToggleContraction(int line); + void EnsureLineVisible(int lineDoc, bool enforcePolicy); + int ReplaceTarget(bool replacePatterns, const char *text, int length=-1); + + bool PositionIsHotspot(int position); + bool PointIsHotspot(Point pt); + void SetHotSpotRange(Point *pt); + void GetHotSpotRange(int& hsStart, int& hsEnd); + + int CodePage() const; + virtual bool ValidCodePage(int /* codePage */) const { return true; } + int WrapCount(int line); + + virtual sptr_t DefWndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) = 0; + +public: + // Public so the COM thunks can access it. + bool IsUnicodeMode() const; + // Public so scintilla_send_message can use it. + virtual sptr_t WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam); + // Public so scintilla_set_id can use it. + int ctrlID; + friend class AutoSurface; + friend class SelectionLineIterator; +}; + +/** + * A smart pointer class to ensure Surfaces are set up and deleted correctly. + */ +class AutoSurface { +private: + Surface *surf; +public: + AutoSurface(Editor *ed) : surf(0) { + if (ed->wMain.GetID()) { + surf = Surface::Allocate(); + if (surf) { + surf->Init(ed->wMain.GetID()); + surf->SetUnicodeMode(SC_CP_UTF8 == ed->CodePage()); + surf->SetDBCSMode(ed->CodePage()); + } + } + } + AutoSurface(SurfaceID sid, Editor *ed) : surf(0) { + if (ed->wMain.GetID()) { + surf = Surface::Allocate(); + if (surf) { + surf->Init(sid, ed->wMain.GetID()); + surf->SetUnicodeMode(SC_CP_UTF8 == ed->CodePage()); + surf->SetDBCSMode(ed->CodePage()); + } + } + } + ~AutoSurface() { + delete surf; + } + Surface *operator->() const { + return surf; + } + operator Surface *() const { + return surf; + } +}; + +#endif diff --git a/src/ExternalLexer.cpp b/src/ExternalLexer.cpp new file mode 100755 index 0000000..acf45bc --- /dev/null +++ b/src/ExternalLexer.cpp @@ -0,0 +1,259 @@ +// Scintilla source code edit control +/** @file ExternalLexer.cxx + ** Support external lexers in DLLs. + **/ +// Copyright 2001 Simon Steele , portions copyright Neil Hodgson. +// The License.txt file describes the conditions under which this software may be distributed. + +#include +#include +#include +#include + +#include "Platform.h" + +#include "Scintilla.h" + +#include "SciLexer.h" +#include "PropSet.h" +#include "Accessor.h" +#include "DocumentAccessor.h" +#include "KeyWords.h" +#include "ExternalLexer.h" + +LexerManager *LexerManager::theInstance = NULL; + +//------------------------------------------ +// +// ExternalLexerModule +// +//------------------------------------------ + +char **WordListsToStrings(WordList *val[]) { + int dim = 0; + while (val[dim]) + dim++; + char **wls = new char * [dim + 1]; + for (int i = 0;i < dim;i++) { + SString words; + words = ""; + for (int n = 0; n < val[i]->len; n++) { + words += val[i]->words[n]; + if (n != val[i]->len - 1) + words += " "; + } + wls[i] = new char[words.length() + 1]; + strcpy(wls[i], words.c_str()); + } + wls[dim] = 0; + return wls; +} + +void DeleteWLStrings(char *strs[]) { + int dim = 0; + while (strs[dim]) { + delete strs[dim]; + dim++; + } + delete [] strs; +} + +void ExternalLexerModule::Lex(unsigned int startPos, int lengthDoc, int initStyle, + WordList *keywordlists[], Accessor &styler) const { + if (!fneLexer) + return ; + + char **kwds = WordListsToStrings(keywordlists); + char *ps = styler.GetProperties(); + + // The accessor passed in is always a DocumentAccessor so this cast and the subsequent + // access will work. Can not use the stricter dynamic_cast as that requires RTTI. + DocumentAccessor &da = static_cast(styler); + WindowID wID = da.GetWindow(); + + fneLexer(externalLanguage, startPos, lengthDoc, initStyle, kwds, wID, ps); + + delete ps; + DeleteWLStrings(kwds); +} + +void ExternalLexerModule::Fold(unsigned int startPos, int lengthDoc, int initStyle, + WordList *keywordlists[], Accessor &styler) const { + if (!fneFolder) + return ; + + char **kwds = WordListsToStrings(keywordlists); + char *ps = styler.GetProperties(); + + // The accessor passed in is always a DocumentAccessor so this cast and the subsequent + // access will work. Can not use the stricter dynamic_cast as that requires RTTI. + DocumentAccessor &da = static_cast(styler); + WindowID wID = da.GetWindow(); + + fneFolder(externalLanguage, startPos, lengthDoc, initStyle, kwds, wID, ps); + + delete ps; + DeleteWLStrings(kwds); +} + +void ExternalLexerModule::SetExternal(ExtLexerFunction fLexer, ExtFoldFunction fFolder, int index) { + fneLexer = fLexer; + fneFolder = fFolder; + externalLanguage = index; +} + +//------------------------------------------ +// +// LexerLibrary +// +//------------------------------------------ + +LexerLibrary::LexerLibrary(const char* ModuleName) { + // Initialise some members... + first = NULL; + last = NULL; + + // Load the DLL + lib = DynamicLibrary::Load(ModuleName); + if (lib->IsValid()) { + m_sModuleName = ModuleName; + //Cannot use reinterpret_cast because: ANSI C++ forbids casting between pointers to functions and objects + GetLexerCountFn GetLexerCount = (GetLexerCountFn)(sptr_t)lib->FindFunction("GetLexerCount"); + + if (GetLexerCount) { + ExternalLexerModule *lex; + LexerMinder *lm; + + // Find functions in the DLL + GetLexerNameFn GetLexerName = (GetLexerNameFn)(sptr_t)lib->FindFunction("GetLexerName"); + ExtLexerFunction Lexer = (ExtLexerFunction)(sptr_t)lib->FindFunction("Lex"); + ExtFoldFunction Folder = (ExtFoldFunction)(sptr_t)lib->FindFunction("Fold"); + + // Assign a buffer for the lexer name. + char lexname[100]; + strcpy(lexname, ""); + + int nl = GetLexerCount(); + + for (int i = 0; i < nl; i++) { + GetLexerName(i, lexname, 100); + lex = new ExternalLexerModule(SCLEX_AUTOMATIC, NULL, lexname, NULL); + + // Create a LexerMinder so we don't leak the ExternalLexerModule... + lm = new LexerMinder; + lm->self = lex; + lm->next = NULL; + if (first != NULL) { + last->next = lm; + last = lm; + } else { + first = lm; + last = lm; + } + + // The external lexer needs to know how to call into its DLL to + // do its lexing and folding, we tell it here. Folder may be null. + lex->SetExternal(Lexer, Folder, i); + } + } + } + next = NULL; +} + +LexerLibrary::~LexerLibrary() { + Release(); + delete lib; +} + +void LexerLibrary::Release() { + //TODO maintain a list of lexers created, and delete them! + LexerMinder *lm; + LexerMinder *next; + lm = first; + while (NULL != lm) { + next = lm->next; + delete lm->self; + delete lm; + lm = next; + } + + first = NULL; + last = NULL; +} + +//------------------------------------------ +// +// LexerManager +// +//------------------------------------------ + +/// Return the single LexerManager instance... +LexerManager *LexerManager::GetInstance() { + if(!theInstance) + theInstance = new LexerManager; + return theInstance; +} + +/// Delete any LexerManager instance... +void LexerManager::DeleteInstance() +{ + if(theInstance) { + delete theInstance; + theInstance = NULL; + } +} + +/// protected constructor - this is a singleton... +LexerManager::LexerManager() { + first = NULL; + last = NULL; +} + +LexerManager::~LexerManager() { + Clear(); +} + +void LexerManager::Load(const char* path) +{ + LoadLexerLibrary(path); +} + +void LexerManager::LoadLexerLibrary(const char* module) +{ + LexerLibrary *lib = new LexerLibrary(module); + if (NULL != first) { + last->next = lib; + last = lib; + } else { + first = lib; + last = lib; + } +} + +void LexerManager::Clear() +{ + if (NULL != first) { + LexerLibrary *cur = first; + LexerLibrary *next; + while (cur) { + next = cur->next; + delete cur; + cur = next; + } + first = NULL; + last = NULL; + } +} + +//------------------------------------------ +// +// LexerManager +// +//------------------------------------------ + +LMMinder::~LMMinder() +{ + LexerManager::DeleteInstance(); +} + +LMMinder minder; diff --git a/src/ExternalLexer.h b/src/ExternalLexer.h new file mode 100644 index 0000000..fe9da36 --- /dev/null +++ b/src/ExternalLexer.h @@ -0,0 +1,102 @@ +// Scintilla source code edit control +/** @file ExternalLexer.h + ** Support external lexers in DLLs. + **/ +// Copyright 2001 Simon Steele , portions copyright Neil Hodgson. +// The License.txt file describes the conditions under which this software may be distributed. + +#ifndef EXTERNALLEXER_H +#define EXTERNALLEXER_H + +#if PLAT_WIN +#define EXT_LEXER_DECL __stdcall +#elif PLAT_GTK +#define EXT_LEXER_DECL +#elif PLAT_QT +#include +#if defined(Q_OS_WIN32) || defined(Q_OS_WIN64) +#define EXT_LEXER_DECL __stdcall +#else +#define EXT_LEXER_DECL +#endif +#endif + +// External Lexer function definitions... +typedef void (EXT_LEXER_DECL *ExtLexerFunction)(unsigned int lexer, unsigned int startPos, int length, int initStyle, + char *words[], WindowID window, char *props); +typedef void (EXT_LEXER_DECL *ExtFoldFunction)(unsigned int lexer, unsigned int startPos, int length, int initStyle, + char *words[], WindowID window, char *props); +typedef void* (EXT_LEXER_DECL *GetLexerFunction)(unsigned int Index); +typedef int (EXT_LEXER_DECL *GetLexerCountFn)(); +typedef void (EXT_LEXER_DECL *GetLexerNameFn)(unsigned int Index, char *name, int buflength); + +//class DynamicLibrary; + +/// Sub-class of LexerModule to use an external lexer. +class ExternalLexerModule : protected LexerModule { +protected: + ExtLexerFunction fneLexer; + ExtFoldFunction fneFolder; + int externalLanguage; + char name[100]; +public: + ExternalLexerModule(int language_, LexerFunction fnLexer_, + const char *languageName_=0, LexerFunction fnFolder_=0) : LexerModule(language_, fnLexer_, 0, fnFolder_){ + strncpy(name, languageName_, sizeof(name)); + languageName = name; + }; + virtual void Lex(unsigned int startPos, int lengthDoc, int initStyle, + WordList *keywordlists[], Accessor &styler) const; + virtual void Fold(unsigned int startPos, int lengthDoc, int initStyle, + WordList *keywordlists[], Accessor &styler) const; + virtual void SetExternal(ExtLexerFunction fLexer, ExtFoldFunction fFolder, int index); +}; + +/// LexerMinder points to an ExternalLexerModule - so we don't leak them. +class LexerMinder { +public: + ExternalLexerModule *self; + LexerMinder *next; +}; + +/// LexerLibrary exists for every External Lexer DLL, contains LexerMinders. +class LexerLibrary { + DynamicLibrary *lib; + LexerMinder *first; + LexerMinder *last; + +public: + LexerLibrary(const char* ModuleName); + ~LexerLibrary(); + void Release(); + + LexerLibrary *next; + SString m_sModuleName; +}; + +/// LexerManager manages external lexers, contains LexerLibrarys. +class LexerManager { +public: + ~LexerManager(); + + static LexerManager *GetInstance(); + static void DeleteInstance(); + + void Load(const char* path); + void Clear(); + +private: + LexerManager(); + static LexerManager *theInstance; + + void LoadLexerLibrary(const char* module); + LexerLibrary *first; + LexerLibrary *last; +}; + +class LMMinder { +public: + ~LMMinder(); +}; + +#endif diff --git a/src/Indicator.cpp b/src/Indicator.cpp new file mode 100755 index 0000000..7624a4a --- /dev/null +++ b/src/Indicator.cpp @@ -0,0 +1,77 @@ +// Scintilla source code edit control +/** @file Indicator.cxx + ** Defines the style of indicators which are text decorations such as underlining. + **/ +// Copyright 1998-2001 by Neil Hodgson +// The License.txt file describes the conditions under which this software may be distributed. + +#include "Platform.h" + +#include "Scintilla.h" +#include "Indicator.h" + +void Indicator::Draw(Surface *surface, const PRectangle &rc, const PRectangle &rcLine) { + surface->PenColour(fore.allocated); + int ymid = (rc.bottom + rc.top) / 2; + if (style == INDIC_SQUIGGLE) { + surface->MoveTo(rc.left, rc.top); + int x = rc.left + 2; + int y = 2; + while (x < rc.right) { + surface->LineTo(x, rc.top + y); + x += 2; + y = 2 - y; + } + surface->LineTo(rc.right, rc.top + y); // Finish the line + } else if (style == INDIC_TT) { + surface->MoveTo(rc.left, ymid); + int x = rc.left + 5; + while (x < rc.right) { + surface->LineTo(x, ymid); + surface->MoveTo(x-3, ymid); + surface->LineTo(x-3, ymid+2); + x++; + surface->MoveTo(x, ymid); + x += 5; + } + surface->LineTo(rc.right, ymid); // Finish the line + if (x - 3 <= rc.right) { + surface->MoveTo(x-3, ymid); + surface->LineTo(x-3, ymid+2); + } + } else if (style == INDIC_DIAGONAL) { + int x = rc.left; + while (x < rc.right) { + surface->MoveTo(x, rc.top+2); + int endX = x+3; + int endY = rc.top - 1; + if (endX > rc.right) { + endY += endX - rc.right; + endX = rc.right; + } + surface->LineTo(endX, endY); + x += 4; + } + } else if (style == INDIC_STRIKE) { + surface->MoveTo(rc.left, rc.top - 4); + surface->LineTo(rc.right, rc.top - 4); + } else if (style == INDIC_HIDDEN) { + // Draw nothing + } else if (style == INDIC_BOX) { + surface->MoveTo(rc.left, ymid+1); + surface->LineTo(rc.right, ymid+1); + surface->LineTo(rc.right, rcLine.top+1); + surface->LineTo(rc.left, rcLine.top+1); + surface->LineTo(rc.left, ymid+1); + } else if (style == INDIC_ROUNDBOX) { + PRectangle rcBox = rcLine; + rcBox.top = rcLine.top + 1; + rcBox.left = rc.left; + rcBox.right = rc.right; + surface->AlphaRectangle(rcBox, 1, fore.allocated, 30, fore.allocated, 50, 0); + } else { // Either INDIC_PLAIN or unknown + surface->MoveTo(rc.left, ymid); + surface->LineTo(rc.right, ymid); + } +} + diff --git a/src/Indicator.h b/src/Indicator.h new file mode 100755 index 0000000..716db10 --- /dev/null +++ b/src/Indicator.h @@ -0,0 +1,22 @@ +// Scintilla source code edit control +/** @file Indicator.h + ** Defines the style of indicators which are text decorations such as underlining. + **/ +// Copyright 1998-2001 by Neil Hodgson +// The License.txt file describes the conditions under which this software may be distributed. + +#ifndef INDICATOR_H +#define INDICATOR_H + +/** + */ +class Indicator { +public: + int style; + ColourPair fore; + Indicator() : style(INDIC_PLAIN), fore(ColourDesired(0,0,0)) { + } + void Draw(Surface *surface, const PRectangle &rc, const PRectangle &rcLine); +}; + +#endif diff --git a/src/KeyMap.cpp b/src/KeyMap.cpp new file mode 100755 index 0000000..bfa6e2d --- /dev/null +++ b/src/KeyMap.cpp @@ -0,0 +1,148 @@ +// Scintilla source code edit control +/** @file KeyMap.cxx + ** Defines a mapping between keystrokes and commands. + **/ +// Copyright 1998-2003 by Neil Hodgson +// The License.txt file describes the conditions under which this software may be distributed. + +#include "Platform.h" + +#include "Scintilla.h" + +#include "KeyMap.h" + +KeyMap::KeyMap() : kmap(0), len(0), alloc(0) { + for (int i = 0; MapDefault[i].key; i++) { + AssignCmdKey(MapDefault[i].key, + MapDefault[i].modifiers, + MapDefault[i].msg); + } +} + +KeyMap::~KeyMap() { + Clear(); +} + +void KeyMap::Clear() { + delete []kmap; + kmap = 0; + len = 0; + alloc = 0; +} + +void KeyMap::AssignCmdKey(int key, int modifiers, unsigned int msg) { + if ((len+1) >= alloc) { + KeyToCommand *ktcNew = new KeyToCommand[alloc + 5]; + if (!ktcNew) + return; + for (int k = 0; k < len; k++) + ktcNew[k] = kmap[k]; + alloc += 5; + delete []kmap; + kmap = ktcNew; + } + for (int keyIndex = 0; keyIndex < len; keyIndex++) { + if ((key == kmap[keyIndex].key) && (modifiers == kmap[keyIndex].modifiers)) { + kmap[keyIndex].msg = msg; + return; + } + } + kmap[len].key = key; + kmap[len].modifiers = modifiers; + kmap[len].msg = msg; + len++; +} + +unsigned int KeyMap::Find(int key, int modifiers) { + for (int i = 0; i < len; i++) { + if ((key == kmap[i].key) && (modifiers == kmap[i].modifiers)) { + return kmap[i].msg; + } + } + return 0; +} + +const KeyToCommand KeyMap::MapDefault[] = { + {SCK_DOWN, SCI_NORM, SCI_LINEDOWN}, + {SCK_DOWN, SCI_SHIFT, SCI_LINEDOWNEXTEND}, + {SCK_DOWN, SCI_CTRL, SCI_LINESCROLLDOWN}, + {SCK_DOWN, SCI_ASHIFT, SCI_LINEDOWNRECTEXTEND}, + {SCK_UP, SCI_NORM, SCI_LINEUP}, + {SCK_UP, SCI_SHIFT, SCI_LINEUPEXTEND}, + {SCK_UP, SCI_CTRL, SCI_LINESCROLLUP}, + {SCK_UP, SCI_ASHIFT, SCI_LINEUPRECTEXTEND}, + {'[', SCI_CTRL, SCI_PARAUP}, + {'[', SCI_CSHIFT, SCI_PARAUPEXTEND}, + {']', SCI_CTRL, SCI_PARADOWN}, + {']', SCI_CSHIFT, SCI_PARADOWNEXTEND}, + {SCK_LEFT, SCI_NORM, SCI_CHARLEFT}, + {SCK_LEFT, SCI_SHIFT, SCI_CHARLEFTEXTEND}, + {SCK_LEFT, SCI_CTRL, SCI_WORDLEFT}, + {SCK_LEFT, SCI_CSHIFT, SCI_WORDLEFTEXTEND}, + {SCK_LEFT, SCI_ASHIFT, SCI_CHARLEFTRECTEXTEND}, + {SCK_RIGHT, SCI_NORM, SCI_CHARRIGHT}, + {SCK_RIGHT, SCI_SHIFT, SCI_CHARRIGHTEXTEND}, + {SCK_RIGHT, SCI_CTRL, SCI_WORDRIGHT}, + {SCK_RIGHT, SCI_CSHIFT, SCI_WORDRIGHTEXTEND}, + {SCK_RIGHT, SCI_ASHIFT, SCI_CHARRIGHTRECTEXTEND}, + {'/', SCI_CTRL, SCI_WORDPARTLEFT}, + {'/', SCI_CSHIFT, SCI_WORDPARTLEFTEXTEND}, + {'\\', SCI_CTRL, SCI_WORDPARTRIGHT}, + {'\\', SCI_CSHIFT, SCI_WORDPARTRIGHTEXTEND}, + {SCK_HOME, SCI_NORM, SCI_VCHOME}, + {SCK_HOME, SCI_SHIFT, SCI_VCHOMEEXTEND}, + {SCK_HOME, SCI_CTRL, SCI_DOCUMENTSTART}, + {SCK_HOME, SCI_CSHIFT, SCI_DOCUMENTSTARTEXTEND}, + {SCK_HOME, SCI_ALT, SCI_HOMEDISPLAY}, +// {SCK_HOME, SCI_ASHIFT, SCI_HOMEDISPLAYEXTEND}, + {SCK_HOME, SCI_ASHIFT, SCI_VCHOMERECTEXTEND}, + {SCK_END, SCI_NORM, SCI_LINEEND}, + {SCK_END, SCI_SHIFT, SCI_LINEENDEXTEND}, + {SCK_END, SCI_CTRL, SCI_DOCUMENTEND}, + {SCK_END, SCI_CSHIFT, SCI_DOCUMENTENDEXTEND}, + {SCK_END, SCI_ALT, SCI_LINEENDDISPLAY}, +// {SCK_END, SCI_ASHIFT, SCI_LINEENDDISPLAYEXTEND}, + {SCK_END, SCI_ASHIFT, SCI_LINEENDRECTEXTEND}, + {SCK_PRIOR, SCI_NORM, SCI_PAGEUP}, + {SCK_PRIOR, SCI_SHIFT, SCI_PAGEUPEXTEND}, + {SCK_PRIOR, SCI_ASHIFT, SCI_PAGEUPRECTEXTEND}, + {SCK_NEXT, SCI_NORM, SCI_PAGEDOWN}, + {SCK_NEXT, SCI_SHIFT, SCI_PAGEDOWNEXTEND}, + {SCK_NEXT, SCI_ASHIFT, SCI_PAGEDOWNRECTEXTEND}, + {SCK_DELETE, SCI_NORM, SCI_CLEAR}, + {SCK_DELETE, SCI_SHIFT, SCI_CUT}, + {SCK_DELETE, SCI_CTRL, SCI_DELWORDRIGHT}, + {SCK_DELETE, SCI_CSHIFT, SCI_DELLINERIGHT}, + {SCK_INSERT, SCI_NORM, SCI_EDITTOGGLEOVERTYPE}, + {SCK_INSERT, SCI_SHIFT, SCI_PASTE}, + {SCK_INSERT, SCI_CTRL, SCI_COPY}, + {SCK_ESCAPE, SCI_NORM, SCI_CANCEL}, + {SCK_BACK, SCI_NORM, SCI_DELETEBACK}, + {SCK_BACK, SCI_SHIFT, SCI_DELETEBACK}, + {SCK_BACK, SCI_CTRL, SCI_DELWORDLEFT}, + {SCK_BACK, SCI_ALT, SCI_UNDO}, + {SCK_BACK, SCI_CSHIFT, SCI_DELLINELEFT}, + {'Z', SCI_CTRL, SCI_UNDO}, + {'Y', SCI_CTRL, SCI_REDO}, + {'X', SCI_CTRL, SCI_CUT}, + {'C', SCI_CTRL, SCI_COPY}, + {'V', SCI_CTRL, SCI_PASTE}, + {'A', SCI_CTRL, SCI_SELECTALL}, + {SCK_TAB, SCI_NORM, SCI_TAB}, + {SCK_TAB, SCI_SHIFT, SCI_BACKTAB}, + {SCK_RETURN, SCI_NORM, SCI_NEWLINE}, + {SCK_RETURN, SCI_SHIFT, SCI_NEWLINE}, + {SCK_ADD, SCI_CTRL, SCI_ZOOMIN}, + {SCK_SUBTRACT, SCI_CTRL, SCI_ZOOMOUT}, + {SCK_DIVIDE, SCI_CTRL, SCI_SETZOOM}, + //'L', SCI_CTRL, SCI_FORMFEED, + {'L', SCI_CTRL, SCI_LINECUT}, + {'L', SCI_CSHIFT, SCI_LINEDELETE}, + {'T', SCI_CSHIFT, SCI_LINECOPY}, + {'T', SCI_CTRL, SCI_LINETRANSPOSE}, + {'D', SCI_CTRL, SCI_SELECTIONDUPLICATE}, + {'U', SCI_CTRL, SCI_LOWERCASE}, + {'U', SCI_CSHIFT, SCI_UPPERCASE}, + {0,0,0}, +}; + diff --git a/src/KeyMap.h b/src/KeyMap.h new file mode 100755 index 0000000..364df68 --- /dev/null +++ b/src/KeyMap.h @@ -0,0 +1,43 @@ +// Scintilla source code edit control +/** @file KeyMap.h + ** Defines a mapping between keystrokes and commands. + **/ +// Copyright 1998-2001 by Neil Hodgson +// The License.txt file describes the conditions under which this software may be distributed. + +#ifndef KEYTOCOMMAND_H +#define KEYTOCOMMAND_H + +#define SCI_NORM 0 +#define SCI_SHIFT SCMOD_SHIFT +#define SCI_CTRL SCMOD_CTRL +#define SCI_ALT SCMOD_ALT +#define SCI_CSHIFT (SCI_CTRL | SCI_SHIFT) +#define SCI_ASHIFT (SCI_ALT | SCI_SHIFT) + +/** + */ +class KeyToCommand { +public: + int key; + int modifiers; + unsigned int msg; +}; + +/** + */ +class KeyMap { + KeyToCommand *kmap; + int len; + int alloc; + static const KeyToCommand MapDefault[]; + +public: + KeyMap(); + ~KeyMap(); + void Clear(); + void AssignCmdKey(int key, int modifiers, unsigned int msg); + unsigned int Find(int key, int modifiers); // 0 returned on failure +}; + +#endif diff --git a/src/KeyWords.cpp b/src/KeyWords.cpp new file mode 100755 index 0000000..f82eb7d --- /dev/null +++ b/src/KeyWords.cpp @@ -0,0 +1,221 @@ +// Scintilla source code edit control +/** @file KeyWords.cxx + ** Colourise for particular languages. + **/ +// Copyright 1998-2002 by Neil Hodgson +// The License.txt file describes the conditions under which this software may be distributed. + +#include +#include +#include +#include +#include + +#include "Platform.h" + +#include "PropSet.h" +#include "Accessor.h" +#include "KeyWords.h" +#include "Scintilla.h" +#include "SciLexer.h" + +const LexerModule *LexerModule::base = 0; +int LexerModule::nextLanguage = SCLEX_AUTOMATIC+1; + +LexerModule::LexerModule(int language_, + LexerFunction fnLexer_, + const char *languageName_, + LexerFunction fnFolder_, + const char * const wordListDescriptions_[], + int styleBits_) : + language(language_), + fnLexer(fnLexer_), + fnFolder(fnFolder_), + wordListDescriptions(wordListDescriptions_), + styleBits(styleBits_), + languageName(languageName_) { + next = base; + base = this; + if (language == SCLEX_AUTOMATIC) { + language = nextLanguage; + nextLanguage++; + } +} + +int LexerModule::GetNumWordLists() const { + if (wordListDescriptions == NULL) { + return -1; + } else { + int numWordLists = 0; + + while (wordListDescriptions[numWordLists]) { + ++numWordLists; + } + + return numWordLists; + } +} + +const char *LexerModule::GetWordListDescription(int index) const { + static const char *emptyStr = ""; + + PLATFORM_ASSERT(index < GetNumWordLists()); + if (index >= GetNumWordLists()) { + return emptyStr; + } else { + return wordListDescriptions[index]; + } +} + +int LexerModule::GetStyleBitsNeeded() const { + return styleBits; +} + +const LexerModule *LexerModule::Find(int language) { + const LexerModule *lm = base; + while (lm) { + if (lm->language == language) { + return lm; + } + lm = lm->next; + } + return 0; +} + +const LexerModule *LexerModule::Find(const char *languageName) { + if (languageName) { + const LexerModule *lm = base; + while (lm) { + if (lm->languageName && 0 == strcmp(lm->languageName, languageName)) { + return lm; + } + lm = lm->next; + } + } + return 0; +} + +void LexerModule::Lex(unsigned int startPos, int lengthDoc, int initStyle, + WordList *keywordlists[], Accessor &styler) const { + if (fnLexer) + fnLexer(startPos, lengthDoc, initStyle, keywordlists, styler); +} + +void LexerModule::Fold(unsigned int startPos, int lengthDoc, int initStyle, + WordList *keywordlists[], Accessor &styler) const { + if (fnFolder) { + int lineCurrent = styler.GetLine(startPos); + // Move back one line in case deletion wrecked current line fold state + if (lineCurrent > 0) { + lineCurrent--; + int newStartPos = styler.LineStart(lineCurrent); + lengthDoc += startPos - newStartPos; + startPos = newStartPos; + initStyle = 0; + if (startPos > 0) { + initStyle = styler.StyleAt(startPos - 1); + } + } + fnFolder(startPos, lengthDoc, initStyle, keywordlists, styler); + } +} + +// Alternative historical name for Scintilla_LinkLexers +int wxForceScintillaLexers(void) { + return Scintilla_LinkLexers(); +} + +// To add or remove a lexer, add or remove its file and run LexGen.py. + +// Force a reference to all of the Scintilla lexers so that the linker will +// not remove the code of the lexers. +int Scintilla_LinkLexers() { + static int forcer = 0; + +// Shorten the code that declares a lexer and ensures it is linked in by calling a method. +#define LINK_LEXER(lexer) extern LexerModule lexer; forcer += lexer.GetLanguage(); + +//++Autogenerated -- run src/LexGen.py to regenerate +//**\(\tLINK_LEXER(\*);\n\) + LINK_LEXER(lmAda); + LINK_LEXER(lmAns1); + LINK_LEXER(lmAPDL); + LINK_LEXER(lmAsm); + LINK_LEXER(lmASP); + LINK_LEXER(lmAU3); + LINK_LEXER(lmAVE); + LINK_LEXER(lmBaan); + LINK_LEXER(lmBash); + LINK_LEXER(lmBatch); + LINK_LEXER(lmBlitzBasic); + LINK_LEXER(lmBullant); + LINK_LEXER(lmCaml); + LINK_LEXER(lmClw); + LINK_LEXER(lmClwNoCase); + LINK_LEXER(lmConf); + LINK_LEXER(lmCPP); + LINK_LEXER(lmCPPNoCase); + LINK_LEXER(lmCsound); + LINK_LEXER(lmCss); + LINK_LEXER(lmDiff); + LINK_LEXER(lmEiffel); + LINK_LEXER(lmEiffelkw); + LINK_LEXER(lmErlang); + LINK_LEXER(lmErrorList); + LINK_LEXER(lmESCRIPT); + LINK_LEXER(lmF77); + LINK_LEXER(lmFlagShip); + LINK_LEXER(lmForth); + LINK_LEXER(lmFortran); + LINK_LEXER(lmFreeBasic); + LINK_LEXER(lmGui4Cli); + LINK_LEXER(lmHaskell); + LINK_LEXER(lmHTML); + LINK_LEXER(lmInno); + LINK_LEXER(lmKix); + LINK_LEXER(lmLatex); + LINK_LEXER(lmLISP); + LINK_LEXER(lmLot); + LINK_LEXER(lmLout); + LINK_LEXER(lmLua); + LINK_LEXER(lmMake); + LINK_LEXER(lmMatlab); + LINK_LEXER(lmMETAPOST); + LINK_LEXER(lmMMIXAL); + LINK_LEXER(lmMSSQL); + LINK_LEXER(lmNncrontab); + LINK_LEXER(lmNsis); + LINK_LEXER(lmNull); + LINK_LEXER(lmOctave); + LINK_LEXER(lmOpal); + LINK_LEXER(lmPascal); + LINK_LEXER(lmPB); + LINK_LEXER(lmPerl); + LINK_LEXER(lmPHP); + LINK_LEXER(lmPHPSCRIPT); + LINK_LEXER(lmPOV); + LINK_LEXER(lmProps); + LINK_LEXER(lmPS); + LINK_LEXER(lmPureBasic); + LINK_LEXER(lmPython); + LINK_LEXER(lmREBOL); + LINK_LEXER(lmRuby); + LINK_LEXER(lmScriptol); + LINK_LEXER(lmSmalltalk); + LINK_LEXER(lmSpecman); + LINK_LEXER(lmSpice); + LINK_LEXER(lmSQL); + LINK_LEXER(lmTADS3); + LINK_LEXER(lmTCL); + LINK_LEXER(lmTeX); + LINK_LEXER(lmVB); + LINK_LEXER(lmVBScript); + LINK_LEXER(lmVerilog); + LINK_LEXER(lmVHDL); + LINK_LEXER(lmXML); + LINK_LEXER(lmYAML); + +//--Autogenerated -- end of automatically generated section + + return 1; +} diff --git a/src/LexAPDL.cpp b/src/LexAPDL.cpp new file mode 100755 index 0000000..1cf263e --- /dev/null +++ b/src/LexAPDL.cpp @@ -0,0 +1,136 @@ +// Scintilla source code edit control +/** @file LexAPDL.cxx + ** Lexer for APDL. Based on the lexer for Assembler by The Black Horus. + ** By Hadar Raz. + **/ +// Copyright 1998-2003 by Neil Hodgson +// The License.txt file describes the conditions under which this software may be distributed. + +#include +#include +#include +#include +#include + +#include "Platform.h" + +#include "PropSet.h" +#include "Accessor.h" +#include "StyleContext.h" +#include "KeyWords.h" +#include "Scintilla.h" +#include "SciLexer.h" + + +static inline bool IsAWordChar(const int ch) { + return (ch < 0x80 && (isalnum(ch) || ch == '_')); +} + +static inline bool IsAnOperator(char ch) { + // '.' left out as it is used to make up numbers + if (ch == '*' || ch == '/' || ch == '-' || ch == '+' || + ch == '(' || ch == ')' || ch == '=' || ch == '^' || + ch == '[' || ch == ']' || ch == '<' || ch == '&' || + ch == '>' || ch == ',' || ch == '|' || ch == '~' || + ch == '$' || ch == ':' || ch == '%') + return true; + return false; +} + +static void ColouriseAPDLDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[], + Accessor &styler) { + + int stringStart = ' '; + + WordList &processors = *keywordlists[0]; + WordList &commands = *keywordlists[1]; + WordList &slashcommands = *keywordlists[2]; + WordList &starcommands = *keywordlists[3]; + WordList &arguments = *keywordlists[4]; + WordList &functions = *keywordlists[5]; + + // Do not leak onto next line + initStyle = SCE_APDL_DEFAULT; + StyleContext sc(startPos, length, initStyle, styler); + + for (; sc.More(); sc.Forward()) { + // Determine if the current state should terminate. + if (sc.state == SCE_APDL_NUMBER) { + if (!(IsADigit(sc.ch) || sc.ch == '.' || (sc.ch == 'e' || sc.ch == 'E') || + ((sc.ch == '+' || sc.ch == '-') && (sc.chPrev == 'e' || sc.chPrev == 'E')))) { + sc.SetState(SCE_APDL_DEFAULT); + } + } else if (sc.state == SCE_APDL_COMMENT) { + if (sc.atLineEnd) { + sc.SetState(SCE_APDL_DEFAULT); + } + } else if (sc.state == SCE_APDL_COMMENTBLOCK) { + if (sc.atLineEnd) { + if (sc.ch == '\r') { + sc.Forward(); + } + sc.ForwardSetState(SCE_APDL_DEFAULT); + } + } else if (sc.state == SCE_APDL_STRING) { + if (sc.atLineEnd) { + sc.SetState(SCE_APDL_DEFAULT); + } else if ((sc.ch == '\'' && stringStart == '\'') || (sc.ch == '\"' && stringStart == '\"')) { + sc.ForwardSetState(SCE_APDL_DEFAULT); + } + } else if (sc.state == SCE_APDL_WORD) { + if (!IsAWordChar(sc.ch)) { + char s[100]; + sc.GetCurrentLowered(s, sizeof(s)); + if (processors.InList(s)) { + sc.ChangeState(SCE_APDL_PROCESSOR); + } else if (slashcommands.InList(s)) { + sc.ChangeState(SCE_APDL_SLASHCOMMAND); + } else if (starcommands.InList(s)) { + sc.ChangeState(SCE_APDL_STARCOMMAND); + } else if (commands.InList(s)) { + sc.ChangeState(SCE_APDL_COMMAND); + } else if (arguments.InList(s)) { + sc.ChangeState(SCE_APDL_ARGUMENT); + } else if (functions.InList(s)) { + sc.ChangeState(SCE_APDL_FUNCTION); + } + sc.SetState(SCE_APDL_DEFAULT); + } + } else if (sc.state == SCE_APDL_OPERATOR) { + if (!IsAnOperator(static_cast(sc.ch))) { + sc.SetState(SCE_APDL_DEFAULT); + } + } + + // Determine if a new state should be entered. + if (sc.state == SCE_APDL_DEFAULT) { + if (sc.ch == '!' && sc.chNext == '!') { + sc.SetState(SCE_APDL_COMMENTBLOCK); + } else if (sc.ch == '!') { + sc.SetState(SCE_APDL_COMMENT); + } else if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext))) { + sc.SetState(SCE_APDL_NUMBER); + } else if (sc.ch == '\'' || sc.ch == '\"') { + sc.SetState(SCE_APDL_STRING); + stringStart = sc.ch; + } else if (IsAWordChar(sc.ch) || ((sc.ch == '*' || sc.ch == '/') && !isgraph(sc.chPrev))) { + sc.SetState(SCE_APDL_WORD); + } else if (IsAnOperator(static_cast(sc.ch))) { + sc.SetState(SCE_APDL_OPERATOR); + } + } + } + sc.Complete(); +} + +static const char * const apdlWordListDesc[] = { + "processors", + "commands", + "slashommands", + "starcommands", + "arguments", + "functions", + 0 +}; + +LexerModule lmAPDL(SCLEX_APDL, ColouriseAPDLDoc, "apdl", 0, apdlWordListDesc); diff --git a/src/LexAU3.cpp b/src/LexAU3.cpp new file mode 100755 index 0000000..2bc2e0f --- /dev/null +++ b/src/LexAU3.cpp @@ -0,0 +1,891 @@ +// Scintilla source code edit control +// @file LexAU3.cxx +// Lexer for AutoIt3 http://www.hiddensoft.com/autoit3 +// by Jos van der Zande, jvdzande@yahoo.com +// +// Changes: +// March 28, 2004 - Added the standard Folding code +// April 21, 2004 - Added Preprosessor Table + Syntax Highlighting +// Fixed Number highlighting +// Changed default isoperator to IsAOperator to have a better match to AutoIt3 +// Fixed "#comments_start" -> "#comments-start" +// Fixed "#comments_end" -> "#comments-end" +// Fixed Sendkeys in Strings when not terminated with } +// Added support for Sendkey strings that have second parameter e.g. {UP 5} or {a down} +// April 26, 2004 - Fixed # pre-processor statement inside of comment block would invalidly change the color. +// Added logic for #include to treat the <> as string +// Added underscore to IsAOperator. +// May 17, 2004 - Changed the folding logic from indent to keyword folding. +// Added Folding logic for blocks of single-commentlines or commentblock. +// triggered by: fold.comment=1 +// Added Folding logic for preprocessor blocks triggered by fold.preprocessor=1 +// Added Special for #region - #endregion syntax highlight and folding. +// May 30, 2004 - Fixed issue with continuation lines on If statements. +// June 5, 2004 - Added comma to Operators for better readability. +// Added fold.compact support set with fold.compact=1 +// Changed folding inside of #cs-#ce. Default is no keyword folding inside comment blocks when fold.comment=1 +// it will now only happen when fold.comment=2. +// Sep 5, 2004 - Added logic to handle colourizing words on the last line. +// Typed Characters now show as "default" till they match any table. +// Oct 10, 2004 - Added logic to show Comments in "Special" directives. +// Nov 1, 2004 - Added better testing for Numbers supporting x and e notation. +// Nov 28, 2004 - Added logic to handle continuation lines for syntax highlighting. +// Jan 10, 2005 - Added Abbreviations Keyword used for expansion +// Mar 24, 2005 - Updated Abbreviations Keywords to fix when followed by Operator. +// Apr 18, 2005 - Updated #CE/#Comment-End logic to take a linecomment ";" into account +// - Added folding support for With...EndWith +// - Added support for a DOT in variable names +// - Fixed Underscore in CommentBlock +// May 23, 2005 - Fixed the SentKey lexing in case of a missing } +// Aug 11, 2005 - Fixed possible bug with s_save length > 100. +// Aug 23, 2005 - Added Switch/endswitch support to the folding logic. +// Sep 27, 2005 - Fixed the SentKey lexing logic in case of multiple sentkeys. +// Mar 12, 2006 - Fixed issue with <> coloring as String in stead of Operator in rare occasions. +// Apr 8, 2006 - Added support for AutoIt3 Standard UDF library (SCE_AU3_UDF) +// +// Copyright for Scintilla: 1998-2001 by Neil Hodgson +// The License.txt file describes the conditions under which this software may be distributed. +// Scintilla source code edit control + +#include +#include +#include +#include +#include + +#include "Platform.h" + +#include "PropSet.h" +#include "Accessor.h" +#include "StyleContext.h" +#include "KeyWords.h" +#include "Scintilla.h" +#include "SciLexer.h" + +static inline bool IsTypeCharacter(const int ch) +{ + return ch == '$'; +} +static inline bool IsAWordChar(const int ch) +{ + return (ch < 0x80) && (isalnum(ch) || ch == '_'); +} + +static inline bool IsAWordStart(const int ch) +{ + return (ch < 0x80) && (isalnum(ch) || ch == '_' || ch == '@' || ch == '#' || ch == '$' || ch == '.'); +} + +static inline bool IsAOperator(char ch) { + if (isascii(ch) && isalnum(ch)) + return false; + if (ch == '+' || ch == '-' || ch == '*' || ch == '/' || + ch == '&' || ch == '^' || ch == '=' || ch == '<' || ch == '>' || + ch == '(' || ch == ')' || ch == '[' || ch == ']' || ch == ',' ) + return true; + return false; +} + +/////////////////////////////////////////////////////////////////////////////// +// GetSendKey() filters the portion before and after a/multiple space(s) +// and return the first portion to be looked-up in the table +// also check if the second portion is valid... (up,down.on.off,toggle or a number) +/////////////////////////////////////////////////////////////////////////////// + +static int GetSendKey(const char *szLine, char *szKey) +{ + int nFlag = 0; + int nStartFound = 0; + int nKeyPos = 0; + int nSpecPos= 0; + int nSpecNum= 1; + int nPos = 0; + char cTemp; + char szSpecial[100]; + + // split the portion of the sendkey in the part before and after the spaces + while ( ( (cTemp = szLine[nPos]) != '\0')) + { + // skip leading Ctrl/Shift/Alt state + if (cTemp == '{') { + nStartFound = 1; + } + // + if (nStartFound == 1) { + if ((cTemp == ' ') && (nFlag == 0) ) // get the stuff till first space + { + nFlag = 1; + // Add } to the end of the first bit for table lookup later. + szKey[nKeyPos++] = '}'; + } + else if (cTemp == ' ') + { + // skip other spaces + } + else if (nFlag == 0) + { + // save first portion into var till space or } is hit + szKey[nKeyPos++] = cTemp; + } + else if ((nFlag == 1) && (cTemp != '}')) + { + // Save second portion into var... + szSpecial[nSpecPos++] = cTemp; + // check if Second portion is all numbers for repeat fuction + if (isdigit(cTemp) == false) {nSpecNum = 0;} + } + } + nPos++; // skip to next char + + } // End While + + + // Check if the second portion is either a number or one of these keywords + szKey[nKeyPos] = '\0'; + szSpecial[nSpecPos] = '\0'; + if (strcmp(szSpecial,"down")== 0 || strcmp(szSpecial,"up")== 0 || + strcmp(szSpecial,"on")== 0 || strcmp(szSpecial,"off")== 0 || + strcmp(szSpecial,"toggle")== 0 || nSpecNum == 1 ) + { + nFlag = 0; + } + else + { + nFlag = 1; + } + return nFlag; // 1 is bad, 0 is good + +} // GetSendKey() + +// +// Routine to check the last "none comment" character on a line to see if its a continuation +// +static bool IsContinuationLine(unsigned int szLine, Accessor &styler) +{ + int nsPos = styler.LineStart(szLine); + int nePos = styler.LineStart(szLine+1) - 2; + //int stylech = styler.StyleAt(nsPos); + while (nsPos < nePos) + { + //stylech = styler.StyleAt(nePos); + int stylech = styler.StyleAt(nsPos); + if (!(stylech == SCE_AU3_COMMENT)) { + char ch = styler.SafeGetCharAt(nePos); + if (!isspacechar(ch)) { + if (ch == '_') + return true; + else + return false; + } + } + nePos--; // skip to next char + } // End While + return false; +} // IsContinuationLine() + +// +// syntax highlighting logic +static void ColouriseAU3Doc(unsigned int startPos, + int length, int initStyle, + WordList *keywordlists[], + Accessor &styler) { + + WordList &keywords = *keywordlists[0]; + WordList &keywords2 = *keywordlists[1]; + WordList &keywords3 = *keywordlists[2]; + WordList &keywords4 = *keywordlists[3]; + WordList &keywords5 = *keywordlists[4]; + WordList &keywords6 = *keywordlists[5]; + WordList &keywords7 = *keywordlists[6]; + WordList &keywords8 = *keywordlists[7]; + // find the first previous line without continuation character at the end + int lineCurrent = styler.GetLine(startPos); + int s_startPos = startPos; + // When not inside a Block comment: find First line without _ + if (!(initStyle==SCE_AU3_COMMENTBLOCK)) { + while ((lineCurrent > 0 && IsContinuationLine(lineCurrent,styler)) || + (lineCurrent > 1 && IsContinuationLine(lineCurrent-1,styler))) { + lineCurrent--; + startPos = styler.LineStart(lineCurrent); // get start position + initStyle = 0; // reset the start style to 0 + } + } + // Set the new length to include it from the start and set the start position + length = length + s_startPos - startPos; // correct the total length to process + styler.StartAt(startPos); + + StyleContext sc(startPos, length, initStyle, styler); + char si; // string indicator "=1 '=2 + char ni; // Numeric indicator error=9 normal=0 normal+dec=1 hex=2 Enot=3 + char ci; // comment indicator 0=not linecomment(;) + char s_save[100]; + si=0; + ni=0; + ci=0; + //$$$ + for (; sc.More(); sc.Forward()) { + char s[100]; + sc.GetCurrentLowered(s, sizeof(s)); + // ********************************************** + // save the total current word for eof processing + if (IsAWordChar(sc.ch) || sc.ch == '}') + { + strcpy(s_save,s); + int tp = strlen(s_save); + if (tp < 99) { + s_save[tp] = static_cast(tolower(sc.ch)); + s_save[tp+1] = '\0'; + } + } + // ********************************************** + // + switch (sc.state) + { + case SCE_AU3_COMMENTBLOCK: + { + //Reset at line end + if (sc.atLineEnd) { + ci=0; + sc.SetState(SCE_AU3_COMMENTBLOCK); + } + //skip rest of line when a ; is encountered + if (sc.chPrev == ';') { + ci=2; + sc.SetState(SCE_AU3_COMMENTBLOCK); + } + // skip rest of the line + if (ci==2) + break; + // check when first character is detected on the line + if (ci==0) { + if (IsAWordStart(static_cast(sc.ch)) || IsAOperator(static_cast(sc.ch))) { + ci=1; + sc.SetState(SCE_AU3_COMMENTBLOCK); + } + break; + } + if (!(IsAWordChar(sc.ch) || (sc.ch == '-' && strcmp(s, "#comments") == 0))) { + if ((strcmp(s, "#ce")== 0 || strcmp(s, "#comments-end")== 0)) + sc.SetState(SCE_AU3_COMMENT); // set to comment line for the rest of the line + else + ci=2; // line doesn't begin with #CE so skip the rest of the line + } + break; + } + case SCE_AU3_COMMENT: + { + if (sc.atLineEnd) {sc.SetState(SCE_AU3_DEFAULT);} + break; + } + case SCE_AU3_OPERATOR: + { + // check if its a COMobject + if (sc.chPrev == '.' && IsAWordChar(sc.ch)) { + sc.SetState(SCE_AU3_COMOBJ); + } + else { + sc.SetState(SCE_AU3_DEFAULT); + } + break; + } + case SCE_AU3_SPECIAL: + { + if (sc.ch == ';') {sc.SetState(SCE_AU3_COMMENT);} + if (sc.atLineEnd) {sc.SetState(SCE_AU3_DEFAULT);} + break; + } + case SCE_AU3_KEYWORD: + { + if (!(IsAWordChar(sc.ch) || (sc.ch == '-' && (strcmp(s, "#comments") == 0 || strcmp(s, "#include") == 0)))) + { + if (!IsTypeCharacter(sc.ch)) + { + if (strcmp(s, "#cs")== 0 || strcmp(s, "#comments-start")== 0 ) + { + sc.ChangeState(SCE_AU3_COMMENTBLOCK); + sc.SetState(SCE_AU3_COMMENTBLOCK); + } + else if (keywords.InList(s)) { + sc.ChangeState(SCE_AU3_KEYWORD); + sc.SetState(SCE_AU3_DEFAULT); + } + else if (keywords2.InList(s)) { + sc.ChangeState(SCE_AU3_FUNCTION); + sc.SetState(SCE_AU3_DEFAULT); + } + else if (keywords3.InList(s)) { + sc.ChangeState(SCE_AU3_MACRO); + sc.SetState(SCE_AU3_DEFAULT); + } + else if (keywords5.InList(s)) { + sc.ChangeState(SCE_AU3_PREPROCESSOR); + sc.SetState(SCE_AU3_DEFAULT); + if (strcmp(s, "#include")== 0) + { + si = 3; // use to determine string start for #inlude <> + } + } + else if (keywords6.InList(s)) { + sc.ChangeState(SCE_AU3_SPECIAL); + sc.SetState(SCE_AU3_SPECIAL); + } + else if ((keywords7.InList(s)) && (!IsAOperator(static_cast(sc.ch)))) { + sc.ChangeState(SCE_AU3_EXPAND); + sc.SetState(SCE_AU3_DEFAULT); + } + else if (keywords8.InList(s)) { + sc.ChangeState(SCE_AU3_UDF); + sc.SetState(SCE_AU3_DEFAULT); + } + else if (strcmp(s, "_") == 0) { + sc.ChangeState(SCE_AU3_OPERATOR); + sc.SetState(SCE_AU3_DEFAULT); + } + else if (!IsAWordChar(sc.ch)) { + sc.ChangeState(SCE_AU3_DEFAULT); + sc.SetState(SCE_AU3_DEFAULT); + } + } + } + if (sc.atLineEnd) { + sc.SetState(SCE_AU3_DEFAULT);} + break; + } + case SCE_AU3_NUMBER: + { + // Numeric indicator error=9 normal=0 normal+dec=1 hex=2 E-not=3 + // + // test for Hex notation + if (strcmp(s, "0") == 0 && (sc.ch == 'x' || sc.ch == 'X') && ni == 0) + { + ni = 2; + break; + } + // test for E notation + if (IsADigit(sc.chPrev) && (sc.ch == 'e' || sc.ch == 'E') && ni <= 1) + { + ni = 3; + break; + } + // Allow Hex characters inside hex numeric strings + if ((ni == 2) && + (sc.ch == 'a' || sc.ch == 'b' || sc.ch == 'c' || sc.ch == 'd' || sc.ch == 'e' || sc.ch == 'f' || + sc.ch == 'A' || sc.ch == 'B' || sc.ch == 'C' || sc.ch == 'D' || sc.ch == 'E' || sc.ch == 'F' )) + { + break; + } + // test for 1 dec point only + if (sc.ch == '.') + { + if (ni==0) + { + ni=1; + } + else + { + ni=9; + } + break; + } + // end of numeric string ? + if (!(IsADigit(sc.ch))) + { + if (ni==9) + { + sc.ChangeState(SCE_AU3_DEFAULT); + } + sc.SetState(SCE_AU3_DEFAULT); + } + break; + } + case SCE_AU3_VARIABLE: + { + // Check if its a COMObject + if (sc.ch == '.' && !IsADigit(sc.chNext)) { + sc.SetState(SCE_AU3_OPERATOR); + } + else if (!IsAWordChar(sc.ch)) { + sc.SetState(SCE_AU3_DEFAULT); + } + break; + } + case SCE_AU3_COMOBJ: + { + if (!(IsAWordChar(sc.ch))) { + sc.SetState(SCE_AU3_DEFAULT); + } + break; + } + case SCE_AU3_STRING: + { + // check for " to end a double qouted string or + // check for ' to end a single qouted string + if ((si == 1 && sc.ch == '\"') || (si == 2 && sc.ch == '\'') || (si == 3 && sc.ch == '>')) + { + sc.ForwardSetState(SCE_AU3_DEFAULT); + si=0; + } + if (sc.atLineEnd) + { + si=0; + // at line end and not found a continuation char then reset to default + int lineCurrent = styler.GetLine(sc.currentPos); + if (!IsContinuationLine(lineCurrent,styler)) + { + sc.SetState(SCE_AU3_DEFAULT); + } + } + // find Sendkeys in a STRING + if (sc.ch == '{' || sc.ch == '+' || sc.ch == '!' || sc.ch == '^' || sc.ch == '#' ) { + sc.SetState(SCE_AU3_SENT);} + break; + } + + case SCE_AU3_SENT: + { + // Send key string ended + if (sc.chPrev == '}' && sc.ch != '}') + { + // set color to SENDKEY when valid sendkey .. else set back to regular string + char sk[100]; + // split {111 222} and return {111} and check if 222 is valid. + // if return code = 1 then invalid 222 so must be string + if (GetSendKey(s,sk)) + { + sc.ChangeState(SCE_AU3_STRING); + } + // if single char between {?} then its ok as sendkey for a single character + else if (strlen(sk) == 3) + { + sc.ChangeState(SCE_AU3_SENT); + } + // if sendkey {111} is in table then ok as sendkey + else if (keywords4.InList(sk)) + { + sc.ChangeState(SCE_AU3_SENT); + } + else + { + sc.ChangeState(SCE_AU3_STRING); + } + sc.SetState(SCE_AU3_STRING); + } + else + { + // check if the start is a valid SendKey start + int nPos = 0; + int nState = 1; + char cTemp; + while (!(nState == 2) && ((cTemp = s[nPos]) != '\0')) + { + if (cTemp == '{' && nState == 1) + { + nState = 2; + } + if (nState == 1 && !(cTemp == '+' || cTemp == '!' || cTemp == '^' || cTemp == '#' )) + { + nState = 0; + } + nPos++; + } + //Verify characters infront of { ... if not assume regular string + if (nState == 1 && (!(sc.ch == '{' || sc.ch == '+' || sc.ch == '!' || sc.ch == '^' || sc.ch == '#' ))) { + sc.ChangeState(SCE_AU3_STRING); + sc.SetState(SCE_AU3_STRING); + } + // If invalid character found then assume its a regular string + if (nState == 0) { + sc.ChangeState(SCE_AU3_STRING); + sc.SetState(SCE_AU3_STRING); + } + } + // check if next portion is again a sendkey + if (sc.atLineEnd) + { + sc.ChangeState(SCE_AU3_STRING); + sc.SetState(SCE_AU3_DEFAULT); + si = 0; // reset string indicator + } + //* check in next characters following a sentkey are again a sent key + // Need this test incase of 2 sentkeys like {F1}{ENTER} but not detect {{} + if (sc.state == SCE_AU3_STRING && (sc.ch == '{' || sc.ch == '+' || sc.ch == '!' || sc.ch == '^' || sc.ch == '#' )) { + sc.SetState(SCE_AU3_SENT);} + // check to see if the string ended... + // Sendkey string isn't complete but the string ended.... + if ((si == 1 && sc.ch == '\"') || (si == 2 && sc.ch == '\'')) + { + sc.ChangeState(SCE_AU3_STRING); + sc.ForwardSetState(SCE_AU3_DEFAULT); + } + break; + } + } //switch (sc.state) + + // Determine if a new state should be entered: + + if (sc.state == SCE_AU3_DEFAULT) + { + if (sc.ch == ';') {sc.SetState(SCE_AU3_COMMENT);} + else if (sc.ch == '#') {sc.SetState(SCE_AU3_KEYWORD);} + else if (sc.ch == '$') {sc.SetState(SCE_AU3_VARIABLE);} + else if (sc.ch == '.' && !IsADigit(sc.chNext)) {sc.SetState(SCE_AU3_OPERATOR);} + else if (sc.ch == '@') {sc.SetState(SCE_AU3_KEYWORD);} + //else if (sc.ch == '_') {sc.SetState(SCE_AU3_KEYWORD);} + else if (sc.ch == '<' && si==3) {sc.SetState(SCE_AU3_STRING);} // string after #include + else if (sc.ch == '\"') { + sc.SetState(SCE_AU3_STRING); + si = 1; } + else if (sc.ch == '\'') { + sc.SetState(SCE_AU3_STRING); + si = 2; } + else if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext))) + { + sc.SetState(SCE_AU3_NUMBER); + ni = 0; + } + else if (IsAWordStart(sc.ch)) {sc.SetState(SCE_AU3_KEYWORD);} + else if (IsAOperator(static_cast(sc.ch))) {sc.SetState(SCE_AU3_OPERATOR);} + else if (sc.atLineEnd) {sc.SetState(SCE_AU3_DEFAULT);} + } + } //for (; sc.More(); sc.Forward()) + + //************************************* + // Colourize the last word correctly + //************************************* + if (sc.state == SCE_AU3_KEYWORD) + { + if (strcmp(s_save, "#cs")== 0 || strcmp(s_save, "#comments-start")== 0 ) + { + sc.ChangeState(SCE_AU3_COMMENTBLOCK); + sc.SetState(SCE_AU3_COMMENTBLOCK); + } + else if (keywords.InList(s_save)) { + sc.ChangeState(SCE_AU3_KEYWORD); + sc.SetState(SCE_AU3_KEYWORD); + } + else if (keywords2.InList(s_save)) { + sc.ChangeState(SCE_AU3_FUNCTION); + sc.SetState(SCE_AU3_FUNCTION); + } + else if (keywords3.InList(s_save)) { + sc.ChangeState(SCE_AU3_MACRO); + sc.SetState(SCE_AU3_MACRO); + } + else if (keywords5.InList(s_save)) { + sc.ChangeState(SCE_AU3_PREPROCESSOR); + sc.SetState(SCE_AU3_PREPROCESSOR); + } + else if (keywords6.InList(s_save)) { + sc.ChangeState(SCE_AU3_SPECIAL); + sc.SetState(SCE_AU3_SPECIAL); + } + else if (keywords7.InList(s_save) && sc.atLineEnd) { + sc.ChangeState(SCE_AU3_EXPAND); + sc.SetState(SCE_AU3_EXPAND); + } + else if (keywords8.InList(s_save)) { + sc.ChangeState(SCE_AU3_UDF); + sc.SetState(SCE_AU3_UDF); + } + else { + sc.ChangeState(SCE_AU3_DEFAULT); + sc.SetState(SCE_AU3_DEFAULT); + } + } + if (sc.state == SCE_AU3_SENT) + { + // Send key string ended + if (sc.chPrev == '}' && sc.ch != '}') + { + // set color to SENDKEY when valid sendkey .. else set back to regular string + char sk[100]; + // split {111 222} and return {111} and check if 222 is valid. + // if return code = 1 then invalid 222 so must be string + if (GetSendKey(s_save,sk)) + { + sc.ChangeState(SCE_AU3_STRING); + } + // if single char between {?} then its ok as sendkey for a single character + else if (strlen(sk) == 3) + { + sc.ChangeState(SCE_AU3_SENT); + } + // if sendkey {111} is in table then ok as sendkey + else if (keywords4.InList(sk)) + { + sc.ChangeState(SCE_AU3_SENT); + } + else + { + sc.ChangeState(SCE_AU3_STRING); + } + sc.SetState(SCE_AU3_STRING); + } + // check if next portion is again a sendkey + if (sc.atLineEnd) + { + sc.ChangeState(SCE_AU3_STRING); + sc.SetState(SCE_AU3_DEFAULT); + } + } + //************************************* + sc.Complete(); +} + +// +static bool IsStreamCommentStyle(int style) { + return style == SCE_AU3_COMMENT || style == SCE_AU3_COMMENTBLOCK; +} + +// +// Routine to find first none space on the current line and return its Style +// needed for comment lines not starting on pos 1 +static int GetStyleFirstWord(unsigned int szLine, Accessor &styler) +{ + int nsPos = styler.LineStart(szLine); + int nePos = styler.LineStart(szLine+1) - 1; + while (isspacechar(styler.SafeGetCharAt(nsPos)) && nsPos < nePos) + { + nsPos++; // skip to next char + + } // End While + return styler.StyleAt(nsPos); + +} // GetStyleFirstWord() + + +// +static void FoldAU3Doc(unsigned int startPos, int length, int, WordList *[], Accessor &styler) +{ + int endPos = startPos + length; + // get settings from the config files for folding comments and preprocessor lines + bool foldComment = styler.GetPropertyInt("fold.comment") != 0; + bool foldInComment = styler.GetPropertyInt("fold.comment") == 2; + bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0; + bool foldpreprocessor = styler.GetPropertyInt("fold.preprocessor") != 0; + // Backtrack to previous line in case need to fix its fold status + int lineCurrent = styler.GetLine(startPos); + if (startPos > 0) { + if (lineCurrent > 0) { + lineCurrent--; + startPos = styler.LineStart(lineCurrent); + } + } + // vars for style of previous/current/next lines + int style = GetStyleFirstWord(lineCurrent,styler); + int stylePrev = 0; + // find the first previous line without continuation character at the end + while ((lineCurrent > 0 && IsContinuationLine(lineCurrent,styler)) || + (lineCurrent > 1 && IsContinuationLine(lineCurrent-1,styler))) { + lineCurrent--; + startPos = styler.LineStart(lineCurrent); + } + if (lineCurrent > 0) { + stylePrev = GetStyleFirstWord(lineCurrent-1,styler); + } + // vars for getting first word to check for keywords + bool FirstWordStart = false; + bool FirstWordEnd = false; + char szKeyword[10]=""; + int szKeywordlen = 0; + char szThen[5]=""; + int szThenlen = 0; + bool ThenFoundLast = false; + // var for indentlevel + int levelCurrent = SC_FOLDLEVELBASE; + if (lineCurrent > 0) + levelCurrent = styler.LevelAt(lineCurrent-1) >> 16; + int levelNext = levelCurrent; + // + int visibleChars = 0; + char chNext = styler.SafeGetCharAt(startPos); + char chPrev = ' '; + // + for (int i = startPos; i < endPos; i++) { + char ch = chNext; + chNext = styler.SafeGetCharAt(i + 1); + if (IsAWordChar(ch)) { + visibleChars++; + } + // get the syle for the current character neede to check in comment + int stylech = styler.StyleAt(i); + // get first word for the line for indent check max 9 characters + if (FirstWordStart && (!(FirstWordEnd))) { + if (!IsAWordChar(ch)) { + FirstWordEnd = true; + szKeyword[szKeywordlen] = '\0'; + } + else { + if (szKeywordlen < 10) { + szKeyword[szKeywordlen++] = static_cast(tolower(ch)); + } + } + } + // start the capture of the first word + if (!(FirstWordStart)) { + if (IsAWordChar(ch) || IsAWordStart(ch) || ch == ';') { + FirstWordStart = true; + szKeyword[szKeywordlen++] = static_cast(tolower(ch)); + } + } + // only process this logic when not in comment section + if (!(stylech == SCE_AU3_COMMENT)) { + if (ThenFoundLast) { + if (IsAWordChar(ch)) { + ThenFoundLast = false; + } + } + // find out if the word "then" is the last on a "if" line + if (FirstWordEnd && strcmp(szKeyword,"if") == 0) { + if (szThenlen == 4) { + szThen[0] = szThen[1]; + szThen[1] = szThen[2]; + szThen[2] = szThen[3]; + szThen[3] = static_cast(tolower(ch)); + if (strcmp(szThen,"then") == 0 ) { + ThenFoundLast = true; + } + } + else { + szThen[szThenlen++] = static_cast(tolower(ch)); + if (szThenlen == 5) { + szThen[4] = '\0'; + } + } + } + } + // End of Line found so process the information + if ((ch == '\r' && chNext != '\n') || (ch == '\n') || (i == endPos)) { + // ************************** + // Folding logic for Keywords + // ************************** + // if a keyword is found on the current line and the line doesn't end with _ (continuation) + // and we are not inside a commentblock. + if (szKeywordlen > 0 && (!(chPrev == '_')) && + ((!(IsStreamCommentStyle(style)) || foldInComment)) ) { + szKeyword[szKeywordlen] = '\0'; + // only fold "if" last keyword is "then" (else its a one line if) + if (strcmp(szKeyword,"if") == 0 && ThenFoundLast) { + levelNext++; + } + // create new fold for these words + if (strcmp(szKeyword,"do") == 0 || strcmp(szKeyword,"for") == 0 || + strcmp(szKeyword,"func") == 0 || strcmp(szKeyword,"while") == 0|| + strcmp(szKeyword,"with") == 0 || strcmp(szKeyword,"#region") == 0 ) { + levelNext++; + } + // create double Fold for select&switch because Case will subtract one of the current level + if (strcmp(szKeyword,"select") == 0 || strcmp(szKeyword,"switch") == 0) { + levelNext++; + levelNext++; + } + // end the fold for these words before the current line + if (strcmp(szKeyword,"endfunc") == 0 || strcmp(szKeyword,"endif") == 0 || + strcmp(szKeyword,"next") == 0 || strcmp(szKeyword,"until") == 0 || + strcmp(szKeyword,"endwith") == 0 ||strcmp(szKeyword,"wend") == 0){ + levelNext--; + levelCurrent--; + } + // end the fold for these words before the current line and Start new fold + if (strcmp(szKeyword,"case") == 0 || strcmp(szKeyword,"else") == 0 || + strcmp(szKeyword,"elseif") == 0 ) { + levelCurrent--; + } + // end the double fold for this word before the current line + if (strcmp(szKeyword,"endselect") == 0 || strcmp(szKeyword,"endswitch") == 0 ) { + levelNext--; + levelNext--; + levelCurrent--; + levelCurrent--; + } + // end the fold for these words on the current line + if (strcmp(szKeyword,"#endregion") == 0 ) { + levelNext--; + } + } + // Preprocessor and Comment folding + int styleNext = GetStyleFirstWord(lineCurrent + 1,styler); + // ************************************* + // Folding logic for preprocessor blocks + // ************************************* + // process preprosessor line + if (foldpreprocessor && style == SCE_AU3_PREPROCESSOR) { + if (!(stylePrev == SCE_AU3_PREPROCESSOR) && (styleNext == SCE_AU3_PREPROCESSOR)) { + levelNext++; + } + // fold till the last line for normal comment lines + else if (stylePrev == SCE_AU3_PREPROCESSOR && !(styleNext == SCE_AU3_PREPROCESSOR)) { + levelNext--; + } + } + // ********************************* + // Folding logic for Comment blocks + // ********************************* + if (foldComment && IsStreamCommentStyle(style)) { + // Start of a comment block + if (!(stylePrev==style) && IsStreamCommentStyle(styleNext) && styleNext==style) { + levelNext++; + } + // fold till the last line for normal comment lines + else if (IsStreamCommentStyle(stylePrev) + && !(styleNext == SCE_AU3_COMMENT) + && stylePrev == SCE_AU3_COMMENT + && style == SCE_AU3_COMMENT) { + levelNext--; + } + // fold till the one but last line for Blockcomment lines + else if (IsStreamCommentStyle(stylePrev) + && !(styleNext == SCE_AU3_COMMENTBLOCK) + && style == SCE_AU3_COMMENTBLOCK) { + levelNext--; + levelCurrent--; + } + } + int levelUse = levelCurrent; + int lev = levelUse | levelNext << 16; + if (visibleChars == 0 && foldCompact) + lev |= SC_FOLDLEVELWHITEFLAG; + if (levelUse < levelNext) { + lev |= SC_FOLDLEVELHEADERFLAG; + } + if (lev != styler.LevelAt(lineCurrent)) { + styler.SetLevel(lineCurrent, lev); + } + // reset values for the next line + lineCurrent++; + stylePrev = style; + style = styleNext; + levelCurrent = levelNext; + visibleChars = 0; + // if the last character is an Underscore then don't reset since the line continues on the next line. + if (!(chPrev == '_')) { + szKeywordlen = 0; + szThenlen = 0; + FirstWordStart = false; + FirstWordEnd = false; + ThenFoundLast = false; + } + } + // save the last processed character + if (!isspacechar(ch)) { + chPrev = ch; + visibleChars++; + } + } +} + + +// + +static const char * const AU3WordLists[] = { + "#autoit keywords", + "#autoit functions", + "#autoit macros", + "#autoit Sent keys", + "#autoit Pre-processors", + "#autoit Special", + "#autoit Expand", + "#autoit UDF", + 0 +}; +LexerModule lmAU3(SCLEX_AU3, ColouriseAU3Doc, "au3", FoldAU3Doc , AU3WordLists); diff --git a/src/LexAVE.cpp b/src/LexAVE.cpp new file mode 100755 index 0000000..e30ee7d --- /dev/null +++ b/src/LexAVE.cpp @@ -0,0 +1,225 @@ +// SciTE - Scintilla based Text Editor +/** @file LexAVE.cxx + ** Lexer for Avenue. + ** + ** Written by Alexey Yutkin . + **/ +// Copyright 1998-2002 by Neil Hodgson +// The License.txt file describes the conditions under which this software may be distributed. + +#include +#include +#include +#include +#include + +#include "Platform.h" + +#include "PropSet.h" +#include "Accessor.h" +#include "StyleContext.h" +#include "KeyWords.h" +#include "Scintilla.h" +#include "SciLexer.h" + + + +static inline bool IsAWordChar(const int ch) { + return (ch < 0x80) && (isalnum(ch) || ch == '.' || ch == '_'); +} +static inline bool IsEnumChar(const int ch) { + return (ch < 0x80) && (isalnum(ch)|| ch == '_'); +} +static inline bool IsANumberChar(const int ch) { + return (ch < 0x80) && (isalnum(ch) || ch == '.' ); +} + +inline bool IsAWordStart(const int ch) { + return (ch < 0x80) && (isalnum(ch) || ch == '_'); +} + +inline bool isAveOperator(char ch) { + if (isalnum(ch)) + return false; + // '.' left out as it is used to make up numbers + if (ch == '*' || ch == '/' || ch == '-' || ch == '+' || + ch == '(' || ch == ')' || ch == '=' || + ch == '{' || ch == '}' || + ch == '[' || ch == ']' || ch == ';' || + ch == '<' || ch == '>' || ch == ',' || + ch == '.' ) + return true; + return false; +} + +static void ColouriseAveDoc( + unsigned int startPos, + int length, + int initStyle, + WordList *keywordlists[], + Accessor &styler) { + + WordList &keywords = *keywordlists[0]; + WordList &keywords2 = *keywordlists[1]; + WordList &keywords3 = *keywordlists[2]; + WordList &keywords4 = *keywordlists[3]; + WordList &keywords5 = *keywordlists[4]; + WordList &keywords6 = *keywordlists[5]; + + // Do not leak onto next line + if (initStyle == SCE_AVE_STRINGEOL) { + initStyle = SCE_AVE_DEFAULT; + } + + StyleContext sc(startPos, length, initStyle, styler); + + for (; sc.More(); sc.Forward()) { + if (sc.atLineEnd) { + // Update the line state, so it can be seen by next line + int currentLine = styler.GetLine(sc.currentPos); + styler.SetLineState(currentLine, 0); + } + if (sc.atLineStart && (sc.state == SCE_AVE_STRING)) { + // Prevent SCE_AVE_STRINGEOL from leaking back to previous line + sc.SetState(SCE_AVE_STRING); + } + + + // Determine if the current state should terminate. + if (sc.state == SCE_AVE_OPERATOR) { + sc.SetState(SCE_AVE_DEFAULT); + } else if (sc.state == SCE_AVE_NUMBER) { + if (!IsANumberChar(sc.ch)) { + sc.SetState(SCE_AVE_DEFAULT); + } + } else if (sc.state == SCE_AVE_ENUM) { + if (!IsEnumChar(sc.ch)) { + sc.SetState(SCE_AVE_DEFAULT); + } + } else if (sc.state == SCE_AVE_IDENTIFIER) { + if (!IsAWordChar(sc.ch) || (sc.ch == '.')) { + char s[100]; + //sc.GetCurrent(s, sizeof(s)); + sc.GetCurrentLowered(s, sizeof(s)); + if (keywords.InList(s)) { + sc.ChangeState(SCE_AVE_WORD); + } else if (keywords2.InList(s)) { + sc.ChangeState(SCE_AVE_WORD2); + } else if (keywords3.InList(s)) { + sc.ChangeState(SCE_AVE_WORD3); + } else if (keywords4.InList(s)) { + sc.ChangeState(SCE_AVE_WORD4); + } else if (keywords5.InList(s)) { + sc.ChangeState(SCE_AVE_WORD5); + } else if (keywords6.InList(s)) { + sc.ChangeState(SCE_AVE_WORD6); + } + sc.SetState(SCE_AVE_DEFAULT); + } + } else if (sc.state == SCE_AVE_COMMENT) { + if (sc.atLineEnd) { + sc.SetState(SCE_AVE_DEFAULT); + } + } else if (sc.state == SCE_AVE_STRING) { + if (sc.ch == '\"') { + sc.ForwardSetState(SCE_AVE_DEFAULT); + } else if (sc.atLineEnd) { + sc.ChangeState(SCE_AVE_STRINGEOL); + sc.ForwardSetState(SCE_AVE_DEFAULT); + } + } + + // Determine if a new state should be entered. + if (sc.state == SCE_AVE_DEFAULT) { + if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext))) { + sc.SetState(SCE_AVE_NUMBER); + } else if (IsAWordStart(sc.ch)) { + sc.SetState(SCE_AVE_IDENTIFIER); + } else if (sc.Match('\"')) { + sc.SetState(SCE_AVE_STRING); + } else if (sc.Match('\'')) { + sc.SetState(SCE_AVE_COMMENT); + sc.Forward(); + } else if (isAveOperator(static_cast(sc.ch))) { + sc.SetState(SCE_AVE_OPERATOR); + } else if (sc.Match('#')) { + sc.SetState(SCE_AVE_ENUM); + sc.Forward(); + } + } + } + sc.Complete(); +} + +static void FoldAveDoc(unsigned int startPos, int length, int /* initStyle */, WordList *[], + Accessor &styler) { + unsigned int lengthDoc = startPos + length; + int visibleChars = 0; + int lineCurrent = styler.GetLine(startPos); + int levelPrev = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK; + int levelCurrent = levelPrev; + char chNext = static_cast(tolower(styler[startPos])); + bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0; + int styleNext = styler.StyleAt(startPos); + char s[10]; + + for (unsigned int i = startPos; i < lengthDoc; i++) { + char ch = static_cast(tolower(chNext)); + chNext = static_cast(tolower(styler.SafeGetCharAt(i + 1))); + int style = styleNext; + styleNext = styler.StyleAt(i + 1); + bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n'); + if (style == SCE_AVE_WORD) { + if (ch == 't' || ch == 'f' || ch == 'w' || ch == 'e') { + for (unsigned int j = 0; j < 6; j++) { + if (!iswordchar(styler[i + j])) { + break; + } + s[j] = static_cast(tolower(styler[i + j])); + s[j + 1] = '\0'; + } + + if ((strcmp(s, "then") == 0) || (strcmp(s, "for") == 0) || (strcmp(s, "while") == 0)) { + levelCurrent++; + } + if ((strcmp(s, "end") == 0) || (strcmp(s, "elseif") == 0)) { + // Normally "elseif" and "then" will be on the same line and will cancel + // each other out. // As implemented, this does not support fold.at.else. + levelCurrent--; + } + } + } else if (style == SCE_AVE_OPERATOR) { + if (ch == '{' || ch == '(') { + levelCurrent++; + } else if (ch == '}' || ch == ')') { + levelCurrent--; + } + } + + if (atEOL) { + int lev = levelPrev; + if (visibleChars == 0 && foldCompact) { + lev |= SC_FOLDLEVELWHITEFLAG; + } + if ((levelCurrent > levelPrev) && (visibleChars > 0)) { + lev |= SC_FOLDLEVELHEADERFLAG; + } + if (lev != styler.LevelAt(lineCurrent)) { + styler.SetLevel(lineCurrent, lev); + } + lineCurrent++; + levelPrev = levelCurrent; + visibleChars = 0; + } + if (!isspacechar(ch)) { + visibleChars++; + } + } + // Fill in the real level of the next line, keeping the current flags as they will be filled in later + + int flagsNext = styler.LevelAt(lineCurrent) & ~SC_FOLDLEVELNUMBERMASK; + styler.SetLevel(lineCurrent, levelPrev | flagsNext); +} + +LexerModule lmAVE(SCLEX_AVE, ColouriseAveDoc, "ave", FoldAveDoc); + diff --git a/src/LexAda.cpp b/src/LexAda.cpp new file mode 100755 index 0000000..0227ce1 --- /dev/null +++ b/src/LexAda.cpp @@ -0,0 +1,520 @@ +// Scintilla source code edit control +/** @file LexAda.cxx + ** Lexer for Ada 95 + **/ +// Copyright 2002 by Sergey Koshcheyev +// The License.txt file describes the conditions under which this software may be distributed. + +#include +#include +#include +#include + +#include "Platform.h" + +#include "Accessor.h" +#include "StyleContext.h" +#include "PropSet.h" +#include "KeyWords.h" +#include "SciLexer.h" +#include "SString.h" + +/* + * Interface + */ + +static void ColouriseDocument( + unsigned int startPos, + int length, + int initStyle, + WordList *keywordlists[], + Accessor &styler); + +static const char * const adaWordListDesc[] = { + "Keywords", + 0 +}; + +LexerModule lmAda(SCLEX_ADA, ColouriseDocument, "ada", NULL, adaWordListDesc); + +/* + * Implementation + */ + +// Functions that have apostropheStartsAttribute as a parameter set it according to whether +// an apostrophe encountered after processing the current token will start an attribute or +// a character literal. +static void ColouriseCharacter(StyleContext& sc, bool& apostropheStartsAttribute); +static void ColouriseComment(StyleContext& sc, bool& apostropheStartsAttribute); +static void ColouriseContext(StyleContext& sc, char chEnd, int stateEOL); +static void ColouriseDelimiter(StyleContext& sc, bool& apostropheStartsAttribute); +static void ColouriseLabel(StyleContext& sc, WordList& keywords, bool& apostropheStartsAttribute); +static void ColouriseNumber(StyleContext& sc, bool& apostropheStartsAttribute); +static void ColouriseString(StyleContext& sc, bool& apostropheStartsAttribute); +static void ColouriseWhiteSpace(StyleContext& sc, bool& apostropheStartsAttribute); +static void ColouriseWord(StyleContext& sc, WordList& keywords, bool& apostropheStartsAttribute); + +static inline bool IsDelimiterCharacter(int ch); +static inline bool IsNumberStartCharacter(int ch); +static inline bool IsNumberCharacter(int ch); +static inline bool IsSeparatorOrDelimiterCharacter(int ch); +static bool IsValidIdentifier(const SString& identifier); +static bool IsValidNumber(const SString& number); +static inline bool IsWordStartCharacter(int ch); +static inline bool IsWordCharacter(int ch); + +static void ColouriseCharacter(StyleContext& sc, bool& apostropheStartsAttribute) { + apostropheStartsAttribute = true; + + sc.SetState(SCE_ADA_CHARACTER); + + // Skip the apostrophe and one more character (so that '' is shown as non-terminated and ''' + // is handled correctly) + sc.Forward(); + sc.Forward(); + + ColouriseContext(sc, '\'', SCE_ADA_CHARACTEREOL); +} + +static void ColouriseContext(StyleContext& sc, char chEnd, int stateEOL) { + while (!sc.atLineEnd && !sc.Match(chEnd)) { + sc.Forward(); + } + + if (!sc.atLineEnd) { + sc.ForwardSetState(SCE_ADA_DEFAULT); + } else { + sc.ChangeState(stateEOL); + } +} + +static void ColouriseComment(StyleContext& sc, bool& /*apostropheStartsAttribute*/) { + // Apostrophe meaning is not changed, but the parameter is present for uniformity + + sc.SetState(SCE_ADA_COMMENTLINE); + + while (!sc.atLineEnd) { + sc.Forward(); + } +} + +static void ColouriseDelimiter(StyleContext& sc, bool& apostropheStartsAttribute) { + apostropheStartsAttribute = sc.Match (')'); + sc.SetState(SCE_ADA_DELIMITER); + sc.ForwardSetState(SCE_ADA_DEFAULT); +} + +static void ColouriseLabel(StyleContext& sc, WordList& keywords, bool& apostropheStartsAttribute) { + apostropheStartsAttribute = false; + + sc.SetState(SCE_ADA_LABEL); + + // Skip "<<" + sc.Forward(); + sc.Forward(); + + SString identifier; + + while (!sc.atLineEnd && !IsSeparatorOrDelimiterCharacter(sc.ch)) { + identifier += static_cast(tolower(sc.ch)); + sc.Forward(); + } + + // Skip ">>" + if (sc.Match('>', '>')) { + sc.Forward(); + sc.Forward(); + } else { + sc.ChangeState(SCE_ADA_ILLEGAL); + } + + // If the name is an invalid identifier or a keyword, then make it invalid label + if (!IsValidIdentifier(identifier) || keywords.InList(identifier.c_str())) { + sc.ChangeState(SCE_ADA_ILLEGAL); + } + + sc.SetState(SCE_ADA_DEFAULT); + +} + +static void ColouriseNumber(StyleContext& sc, bool& apostropheStartsAttribute) { + apostropheStartsAttribute = true; + + SString number; + sc.SetState(SCE_ADA_NUMBER); + + // Get all characters up to a delimiter or a separator, including points, but excluding + // double points (ranges). + while (!IsSeparatorOrDelimiterCharacter(sc.ch) || (sc.ch == '.' && sc.chNext != '.')) { + number += static_cast(sc.ch); + sc.Forward(); + } + + // Special case: exponent with sign + if ((sc.chPrev == 'e' || sc.chPrev == 'E') && + (sc.ch == '+' || sc.ch == '-')) { + number += static_cast(sc.ch); + sc.Forward (); + + while (!IsSeparatorOrDelimiterCharacter(sc.ch)) { + number += static_cast(sc.ch); + sc.Forward(); + } + } + + if (!IsValidNumber(number)) { + sc.ChangeState(SCE_ADA_ILLEGAL); + } + + sc.SetState(SCE_ADA_DEFAULT); +} + +static void ColouriseString(StyleContext& sc, bool& apostropheStartsAttribute) { + apostropheStartsAttribute = true; + + sc.SetState(SCE_ADA_STRING); + sc.Forward(); + + ColouriseContext(sc, '"', SCE_ADA_STRINGEOL); +} + +static void ColouriseWhiteSpace(StyleContext& sc, bool& /*apostropheStartsAttribute*/) { + // Apostrophe meaning is not changed, but the parameter is present for uniformity + sc.SetState(SCE_ADA_DEFAULT); + sc.ForwardSetState(SCE_ADA_DEFAULT); +} + +static void ColouriseWord(StyleContext& sc, WordList& keywords, bool& apostropheStartsAttribute) { + apostropheStartsAttribute = true; + sc.SetState(SCE_ADA_IDENTIFIER); + + SString word; + + while (!sc.atLineEnd && !IsSeparatorOrDelimiterCharacter(sc.ch)) { + word += static_cast(tolower(sc.ch)); + sc.Forward(); + } + + if (!IsValidIdentifier(word)) { + sc.ChangeState(SCE_ADA_ILLEGAL); + + } else if (keywords.InList(word.c_str())) { + sc.ChangeState(SCE_ADA_WORD); + + if (word != "all") { + apostropheStartsAttribute = false; + } + } + + sc.SetState(SCE_ADA_DEFAULT); +} + +// +// ColouriseDocument +// + +static void ColouriseDocument( + unsigned int startPos, + int length, + int initStyle, + WordList *keywordlists[], + Accessor &styler) { + WordList &keywords = *keywordlists[0]; + + StyleContext sc(startPos, length, initStyle, styler); + + int lineCurrent = styler.GetLine(startPos); + bool apostropheStartsAttribute = (styler.GetLineState(lineCurrent) & 1) != 0; + + while (sc.More()) { + if (sc.atLineEnd) { + // Go to the next line + sc.Forward(); + lineCurrent++; + + // Remember the line state for future incremental lexing + styler.SetLineState(lineCurrent, apostropheStartsAttribute); + + // Don't continue any styles on the next line + sc.SetState(SCE_ADA_DEFAULT); + } + + // Comments + if (sc.Match('-', '-')) { + ColouriseComment(sc, apostropheStartsAttribute); + + // Strings + } else if (sc.Match('"')) { + ColouriseString(sc, apostropheStartsAttribute); + + // Characters + } else if (sc.Match('\'') && !apostropheStartsAttribute) { + ColouriseCharacter(sc, apostropheStartsAttribute); + + // Labels + } else if (sc.Match('<', '<')) { + ColouriseLabel(sc, keywords, apostropheStartsAttribute); + + // Whitespace + } else if (IsASpace(sc.ch)) { + ColouriseWhiteSpace(sc, apostropheStartsAttribute); + + // Delimiters + } else if (IsDelimiterCharacter(sc.ch)) { + ColouriseDelimiter(sc, apostropheStartsAttribute); + + // Numbers + } else if (IsADigit(sc.ch) || sc.ch == '#') { + ColouriseNumber(sc, apostropheStartsAttribute); + + // Keywords or identifiers + } else { + ColouriseWord(sc, keywords, apostropheStartsAttribute); + } + } + + sc.Complete(); +} + +static inline bool IsDelimiterCharacter(int ch) { + switch (ch) { + case '&': + case '\'': + case '(': + case ')': + case '*': + case '+': + case ',': + case '-': + case '.': + case '/': + case ':': + case ';': + case '<': + case '=': + case '>': + case '|': + return true; + default: + return false; + } +} + +static inline bool IsNumberCharacter(int ch) { + return IsNumberStartCharacter(ch) || + ch == '_' || + ch == '.' || + ch == '#' || + (ch >= 'a' && ch <= 'f') || + (ch >= 'A' && ch <= 'F'); +} + +static inline bool IsNumberStartCharacter(int ch) { + return IsADigit(ch); +} + +static inline bool IsSeparatorOrDelimiterCharacter(int ch) { + return IsASpace(ch) || IsDelimiterCharacter(ch); +} + +static bool IsValidIdentifier(const SString& identifier) { + // First character can't be '_', so initialize the flag to true + bool lastWasUnderscore = true; + + size_t length = identifier.length(); + + // Zero-length identifiers are not valid (these can occur inside labels) + if (length == 0) { + return false; + } + + // Check for valid character at the start + if (!IsWordStartCharacter(identifier[0])) { + return false; + } + + // Check for only valid characters and no double underscores + for (size_t i = 0; i < length; i++) { + if (!IsWordCharacter(identifier[i]) || + (identifier[i] == '_' && lastWasUnderscore)) { + return false; + } + lastWasUnderscore = identifier[i] == '_'; + } + + // Check for underscore at the end + if (lastWasUnderscore == true) { + return false; + } + + // All checks passed + return true; +} + +static bool IsValidNumber(const SString& number) { + int hashPos = number.search("#"); + bool seenDot = false; + + size_t i = 0; + size_t length = number.length(); + + if (length == 0) + return false; // Just in case + + // Decimal number + if (hashPos == -1) { + bool canBeSpecial = false; + + for (; i < length; i++) { + if (number[i] == '_') { + if (!canBeSpecial) { + return false; + } + canBeSpecial = false; + } else if (number[i] == '.') { + if (!canBeSpecial || seenDot) { + return false; + } + canBeSpecial = false; + seenDot = true; + } else if (IsADigit(number[i])) { + canBeSpecial = true; + } else { + break; + } + } + + if (!canBeSpecial) + return false; + } else { + // Based number + bool canBeSpecial = false; + int base = 0; + + // Parse base + for (; i < length; i++) { + int ch = number[i]; + if (ch == '_') { + if (!canBeSpecial) + return false; + canBeSpecial = false; + } else if (IsADigit(ch)) { + base = base * 10 + (ch - '0'); + if (base > 16) + return false; + canBeSpecial = true; + } else if (ch == '#' && canBeSpecial) { + break; + } else { + return false; + } + } + + if (base < 2) + return false; + if (i == length) + return false; + + i++; // Skip over '#' + + // Parse number + canBeSpecial = false; + + for (; i < length; i++) { + int ch = tolower(number[i]); + + if (ch == '_') { + if (!canBeSpecial) { + return false; + } + canBeSpecial = false; + + } else if (ch == '.') { + if (!canBeSpecial || seenDot) { + return false; + } + canBeSpecial = false; + seenDot = true; + + } else if (IsADigit(ch)) { + if (ch - '0' >= base) { + return false; + } + canBeSpecial = true; + + } else if (ch >= 'a' && ch <= 'f') { + if (ch - 'a' + 10 >= base) { + return false; + } + canBeSpecial = true; + + } else if (ch == '#' && canBeSpecial) { + break; + + } else { + return false; + } + } + + if (i == length) { + return false; + } + + i++; + } + + // Exponent (optional) + if (i < length) { + if (number[i] != 'e' && number[i] != 'E') + return false; + + i++; // Move past 'E' + + if (i == length) { + return false; + } + + if (number[i] == '+') + i++; + else if (number[i] == '-') { + if (seenDot) { + i++; + } else { + return false; // Integer literals should not have negative exponents + } + } + + if (i == length) { + return false; + } + + bool canBeSpecial = false; + + for (; i < length; i++) { + if (number[i] == '_') { + if (!canBeSpecial) { + return false; + } + canBeSpecial = false; + } else if (IsADigit(number[i])) { + canBeSpecial = true; + } else { + return false; + } + } + + if (!canBeSpecial) + return false; + } + + // if i == length, number was parsed successfully. + return i == length; +} + +static inline bool IsWordCharacter(int ch) { + return IsWordStartCharacter(ch) || IsADigit(ch); +} + +static inline bool IsWordStartCharacter(int ch) { + return (isascii(ch) && isalpha(ch)) || ch == '_'; +} diff --git a/src/LexAsm.cpp b/src/LexAsm.cpp new file mode 100755 index 0000000..93e0b37 --- /dev/null +++ b/src/LexAsm.cpp @@ -0,0 +1,177 @@ +// Scintilla source code edit control +/** @file LexAsm.cxx + ** Lexer for Assembler, just for the MASM syntax + ** Written by The Black Horus + ** Enhancements and NASM stuff by Kein-Hong Man, 2003-10 + ** SCE_ASM_COMMENTBLOCK and SCE_ASM_CHARACTER are for future GNU as colouring + **/ +// Copyright 1998-2003 by Neil Hodgson +// The License.txt file describes the conditions under which this software may be distributed. + +#include +#include +#include +#include +#include + +#include "Platform.h" + +#include "PropSet.h" +#include "Accessor.h" +#include "StyleContext.h" +#include "KeyWords.h" +#include "Scintilla.h" +#include "SciLexer.h" + + +static inline bool IsAWordChar(const int ch) { + return (ch < 0x80) && (isalnum(ch) || ch == '.' || + ch == '_' || ch == '?'); +} + +static inline bool IsAWordStart(const int ch) { + return (ch < 0x80) && (isalnum(ch) || ch == '_' || ch == '.' || + ch == '%' || ch == '@' || ch == '$' || ch == '?'); +} + +static inline bool IsAsmOperator(char ch) { + if (isalnum(ch)) + return false; + // '.' left out as it is used to make up numbers + if (ch == '*' || ch == '/' || ch == '-' || ch == '+' || + ch == '(' || ch == ')' || ch == '=' || ch == '^' || + ch == '[' || ch == ']' || ch == '<' || ch == '&' || + ch == '>' || ch == ',' || ch == '|' || ch == '~' || + ch == '%' || ch == ':') + return true; + return false; +} + +static void ColouriseAsmDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[], + Accessor &styler) { + + WordList &cpuInstruction = *keywordlists[0]; + WordList &mathInstruction = *keywordlists[1]; + WordList ®isters = *keywordlists[2]; + WordList &directive = *keywordlists[3]; + WordList &directiveOperand = *keywordlists[4]; + WordList &extInstruction = *keywordlists[5]; + + // Do not leak onto next line + if (initStyle == SCE_ASM_STRINGEOL) + initStyle = SCE_ASM_DEFAULT; + + StyleContext sc(startPos, length, initStyle, styler); + + for (; sc.More(); sc.Forward()) + { + + // Prevent SCE_ASM_STRINGEOL from leaking back to previous line + if (sc.atLineStart && (sc.state == SCE_ASM_STRING)) { + sc.SetState(SCE_ASM_STRING); + } else if (sc.atLineStart && (sc.state == SCE_ASM_CHARACTER)) { + sc.SetState(SCE_ASM_CHARACTER); + } + + // Handle line continuation generically. + if (sc.ch == '\\') { + if (sc.chNext == '\n' || sc.chNext == '\r') { + sc.Forward(); + if (sc.ch == '\r' && sc.chNext == '\n') { + sc.Forward(); + } + continue; + } + } + + // Determine if the current state should terminate. + if (sc.state == SCE_ASM_OPERATOR) { + if (!IsAsmOperator(static_cast(sc.ch))) { + sc.SetState(SCE_ASM_DEFAULT); + } + }else if (sc.state == SCE_ASM_NUMBER) { + if (!IsAWordChar(sc.ch)) { + sc.SetState(SCE_ASM_DEFAULT); + } + } else if (sc.state == SCE_ASM_IDENTIFIER) { + if (!IsAWordChar(sc.ch) ) { + char s[100]; + sc.GetCurrentLowered(s, sizeof(s)); + + if (cpuInstruction.InList(s)) { + sc.ChangeState(SCE_ASM_CPUINSTRUCTION); + } else if (mathInstruction.InList(s)) { + sc.ChangeState(SCE_ASM_MATHINSTRUCTION); + } else if (registers.InList(s)) { + sc.ChangeState(SCE_ASM_REGISTER); + } else if (directive.InList(s)) { + sc.ChangeState(SCE_ASM_DIRECTIVE); + } else if (directiveOperand.InList(s)) { + sc.ChangeState(SCE_ASM_DIRECTIVEOPERAND); + } else if (extInstruction.InList(s)) { + sc.ChangeState(SCE_ASM_EXTINSTRUCTION); + } + sc.SetState(SCE_ASM_DEFAULT); + } + } + else if (sc.state == SCE_ASM_COMMENT ) { + if (sc.atLineEnd) { + sc.SetState(SCE_ASM_DEFAULT); + } + } else if (sc.state == SCE_ASM_STRING) { + if (sc.ch == '\\') { + if (sc.chNext == '\"' || sc.chNext == '\'' || sc.chNext == '\\') { + sc.Forward(); + } + } else if (sc.ch == '\"') { + sc.ForwardSetState(SCE_ASM_DEFAULT); + } else if (sc.atLineEnd) { + sc.ChangeState(SCE_ASM_STRINGEOL); + sc.ForwardSetState(SCE_ASM_DEFAULT); + } + } else if (sc.state == SCE_ASM_CHARACTER) { + if (sc.ch == '\\') { + if (sc.chNext == '\"' || sc.chNext == '\'' || sc.chNext == '\\') { + sc.Forward(); + } + } else if (sc.ch == '\'') { + sc.ForwardSetState(SCE_ASM_DEFAULT); + } else if (sc.atLineEnd) { + sc.ChangeState(SCE_ASM_STRINGEOL); + sc.ForwardSetState(SCE_ASM_DEFAULT); + } + } + + // Determine if a new state should be entered. + if (sc.state == SCE_ASM_DEFAULT) { + if (sc.ch == ';'){ + sc.SetState(SCE_ASM_COMMENT); + } else if (isdigit(sc.ch) || (sc.ch == '.' && isdigit(sc.chNext))) { + sc.SetState(SCE_ASM_NUMBER); + } else if (IsAWordStart(sc.ch)) { + sc.SetState(SCE_ASM_IDENTIFIER); + } else if (sc.ch == '\"') { + sc.SetState(SCE_ASM_STRING); + } else if (sc.ch == '\'') { + sc.SetState(SCE_ASM_CHARACTER); + } else if (IsAsmOperator(static_cast(sc.ch))) { + sc.SetState(SCE_ASM_OPERATOR); + } + } + + } + sc.Complete(); +} + +static const char * const asmWordListDesc[] = { + "CPU instructions", + "FPU instructions", + "Registers", + "Directives", + "Directive operands", + "Extended instructions", + 0 +}; + +LexerModule lmAsm(SCLEX_ASM, ColouriseAsmDoc, "asm", 0, asmWordListDesc); + diff --git a/src/LexAsn1.cpp b/src/LexAsn1.cpp new file mode 100755 index 0000000..1600e63 --- /dev/null +++ b/src/LexAsn1.cpp @@ -0,0 +1,181 @@ +// Scintilla source code edit control +/** @file LexAsn1.cxx + ** Lexer for ASN.1 + **/ +// Copyright 2004 by Herr Pfarrer rpfarrer yahoo de +// Last Updated: 20/07/2004 +// The License.txt file describes the conditions under which this software may be distributed. +#include +#include +#include +#include +#include + +#include "Platform.h" + +#include "PropSet.h" +#include "Accessor.h" +#include "StyleContext.h" +#include "KeyWords.h" +#include "Scintilla.h" +#include "SciLexer.h" + +// Some char test functions +static bool isAsn1Number(int ch) +{ + return (ch >= '0' && ch <= '9'); +} + +static bool isAsn1Letter(int ch) +{ + return (ch >= 'A' && ch <= 'Z') || (ch >= 'a' && ch <= 'z'); +} + +static bool isAsn1Char(int ch) +{ + return (ch == '-' ) || isAsn1Number(ch) || isAsn1Letter (ch); +} + +// +// Function determining the color of a given code portion +// Based on a "state" +// +static void ColouriseAsn1Doc(unsigned int startPos, int length, int initStyle, WordList *keywordLists[], Accessor &styler) +{ + // The keywords + WordList &Keywords = *keywordLists[0]; + WordList &Attributes = *keywordLists[1]; + WordList &Descriptors = *keywordLists[2]; + WordList &Types = *keywordLists[3]; + + // Parse the whole buffer character by character using StyleContext + StyleContext sc(startPos, length, initStyle, styler); + for (; sc.More(); sc.Forward()) + { + // The state engine + switch (sc.state) + { + case SCE_ASN1_DEFAULT: // Plain characters +asn1_default: + if (sc.ch == '-' && sc.chNext == '-') + // A comment begins here + sc.SetState(SCE_ASN1_COMMENT); + else if (sc.ch == '"') + // A string begins here + sc.SetState(SCE_ASN1_STRING); + else if (isAsn1Number (sc.ch)) + // A number starts here (identifier should start with a letter in ASN.1) + sc.SetState(SCE_ASN1_SCALAR); + else if (isAsn1Char (sc.ch)) + // An identifier starts here (identifier always start with a letter) + sc.SetState(SCE_ASN1_IDENTIFIER); + else if (sc.ch == ':') + // A ::= operator starts here + sc.SetState(SCE_ASN1_OPERATOR); + break; + case SCE_ASN1_COMMENT: // A comment + if (sc.ch == '\r' || sc.ch == '\n') + // A comment ends here + sc.SetState(SCE_ASN1_DEFAULT); + break; + case SCE_ASN1_IDENTIFIER: // An identifier (keyword, attribute, descriptor or type) + if (!isAsn1Char (sc.ch)) + { + // The end of identifier is here: we can look for it in lists by now and change its state + char s[100]; + sc.GetCurrent(s, sizeof(s)); + if (Keywords.InList(s)) + // It's a keyword, change its state + sc.ChangeState(SCE_ASN1_KEYWORD); + else if (Attributes.InList(s)) + // It's an attribute, change its state + sc.ChangeState(SCE_ASN1_ATTRIBUTE); + else if (Descriptors.InList(s)) + // It's a descriptor, change its state + sc.ChangeState(SCE_ASN1_DESCRIPTOR); + else if (Types.InList(s)) + // It's a type, change its state + sc.ChangeState(SCE_ASN1_TYPE); + + // Set to default now + sc.SetState(SCE_ASN1_DEFAULT); + } + break; + case SCE_ASN1_STRING: // A string delimited by "" + if (sc.ch == '"') + { + // A string ends here + sc.ForwardSetState(SCE_ASN1_DEFAULT); + + // To correctly manage a char sticking to the string quote + goto asn1_default; + } + break; + case SCE_ASN1_SCALAR: // A plain number + if (!isAsn1Number (sc.ch)) + // A number ends here + sc.SetState(SCE_ASN1_DEFAULT); + break; + case SCE_ASN1_OPERATOR: // The affectation operator ::= and wath follows (eg: ::= { org 6 } OID or ::= 12 trap) + if (sc.ch == '{') + { + // An OID definition starts here: enter the sub loop + for (; sc.More(); sc.Forward()) + { + if (isAsn1Number (sc.ch) && (!isAsn1Char (sc.chPrev) || isAsn1Number (sc.chPrev))) + // The OID number is highlighted + sc.SetState(SCE_ASN1_OID); + else if (isAsn1Char (sc.ch)) + // The OID parent identifier is plain + sc.SetState(SCE_ASN1_IDENTIFIER); + else + sc.SetState(SCE_ASN1_DEFAULT); + + if (sc.ch == '}') + // Here ends the OID and the operator sub loop: go back to main loop + break; + } + } + else if (isAsn1Number (sc.ch)) + { + // A trap number definition starts here: enter the sub loop + for (; sc.More(); sc.Forward()) + { + if (isAsn1Number (sc.ch)) + // The trap number is highlighted + sc.SetState(SCE_ASN1_OID); + else + { + // The number ends here: go back to main loop + sc.SetState(SCE_ASN1_DEFAULT); + break; + } + } + } + else if (sc.ch != ':' && sc.ch != '=' && sc.ch != ' ') + // The operator doesn't imply an OID definition nor a trap, back to main loop + goto asn1_default; // To be sure to handle actually the state change + break; + } + } + sc.Complete(); +} + +static void FoldAsn1Doc(unsigned int, int, int, WordList *[], Accessor &styler) +{ + // No folding enabled, no reason to continue... + if( styler.GetPropertyInt("fold") == 0 ) + return; + + // No folding implemented: doesn't make sense for ASN.1 +} + +static const char * const asn1WordLists[] = { + "Keywords", + "Attributes", + "Descriptors", + "Types", + 0, }; + + +LexerModule lmAns1(SCLEX_ASN1, ColouriseAsn1Doc, "asn1", FoldAsn1Doc, asn1WordLists); diff --git a/src/LexBaan.cpp b/src/LexBaan.cpp new file mode 100755 index 0000000..3a36eb8 --- /dev/null +++ b/src/LexBaan.cpp @@ -0,0 +1,189 @@ +// Scintilla source code edit control +/** @file LexBaan.cxx + ** Lexer for Baan. + ** Based heavily on LexCPP.cxx + **/ +// Copyright 2001- by Vamsi Potluru & Praveen Ambekar +// The License.txt file describes the conditions under which this software may be distributed. + +#include +#include +#include +#include +#include + +#include "Platform.h" + +#include "PropSet.h" +#include "Accessor.h" +#include "StyleContext.h" +#include "KeyWords.h" +#include "Scintilla.h" +#include "SciLexer.h" + +static inline bool IsAWordChar(const int ch) { + return (ch < 0x80) && (isalnum(ch) || ch == '.' || ch == '_' || ch == '$' || ch == ':'); +} + +static inline bool IsAWordStart(const int ch) { + return (ch < 0x80) && (isalnum(ch) || ch == '_'); +} + +static void ColouriseBaanDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[], + Accessor &styler) { + + WordList &keywords = *keywordlists[0]; + WordList &keywords2 = *keywordlists[1]; + bool stylingWithinPreprocessor = styler.GetPropertyInt("styling.within.preprocessor") != 0; + + if (initStyle == SCE_BAAN_STRINGEOL) // Does not leak onto next line + initStyle = SCE_BAAN_DEFAULT; + + int visibleChars = 0; + + StyleContext sc(startPos, length, initStyle, styler); + + for (; sc.More(); sc.Forward()) { + + if (sc.state == SCE_BAAN_OPERATOR) { + sc.SetState(SCE_BAAN_DEFAULT); + } else if (sc.state == SCE_BAAN_NUMBER) { + if (!IsAWordChar(sc.ch)) { + sc.SetState(SCE_BAAN_DEFAULT); + } + } else if (sc.state == SCE_BAAN_IDENTIFIER) { + if (!IsAWordChar(sc.ch)) { + char s[100]; + sc.GetCurrentLowered(s, sizeof(s)); + if (keywords.InList(s)) { + sc.ChangeState(SCE_BAAN_WORD); + } else if (keywords2.InList(s)) { + sc.ChangeState(SCE_BAAN_WORD2); + } + sc.SetState(SCE_BAAN_DEFAULT); + } + } else if (sc.state == SCE_BAAN_PREPROCESSOR) { + if (stylingWithinPreprocessor) { + if (IsASpace(sc.ch)) { + sc.SetState(SCE_BAAN_DEFAULT); + } + } else { + if (sc.atLineEnd && (sc.chNext != '^')) { + sc.SetState(SCE_BAAN_DEFAULT); + } + } + } else if (sc.state == SCE_BAAN_COMMENT) { + if (sc.atLineEnd) { + sc.SetState(SCE_BAAN_DEFAULT); + } + } else if (sc.state == SCE_BAAN_COMMENTDOC) { + if (sc.MatchIgnoreCase("enddllusage")) { + for (unsigned int i = 0; i < 10; i++){ + sc.Forward(); + } + sc.ForwardSetState(SCE_BAAN_DEFAULT); + } + } else if (sc.state == SCE_BAAN_STRING) { + if (sc.ch == '\"') { + sc.ForwardSetState(SCE_BAAN_DEFAULT); + } else if ((sc.atLineEnd) && (sc.chNext != '^')) { + sc.ChangeState(SCE_BAAN_STRINGEOL); + sc.ForwardSetState(SCE_C_DEFAULT); + visibleChars = 0; + } + } + + if (sc.state == SCE_BAAN_DEFAULT) { + if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext))) { + sc.SetState(SCE_BAAN_NUMBER); + } else if (sc.MatchIgnoreCase("dllusage")){ + sc.SetState(SCE_BAAN_COMMENTDOC); + do { + sc.Forward(); + } while ((!sc.atLineEnd) && sc.More()); + } else if (IsAWordStart(sc.ch)) { + sc.SetState(SCE_BAAN_IDENTIFIER); + } else if (sc.Match('|')){ + sc.SetState(SCE_BAAN_COMMENT); + } else if (sc.ch == '\"') { + sc.SetState(SCE_BAAN_STRING); + } else if (sc.ch == '#' && visibleChars == 0) { + // Preprocessor commands are alone on their line + sc.SetState(SCE_BAAN_PREPROCESSOR); + // Skip whitespace between # and preprocessor word + do { + sc.Forward(); + } while (IsASpace(sc.ch) && sc.More()); + } else if (isoperator(static_cast(sc.ch))) { + sc.SetState(SCE_BAAN_OPERATOR); + } + } + if (sc.atLineEnd) { + // Reset states to begining of colourise so no surprises + // if different sets of lines lexed. + visibleChars = 0; + } + if (!IsASpace(sc.ch)) { + visibleChars++; + } + } + sc.Complete(); +} + +static void FoldBaanDoc(unsigned int startPos, int length, int initStyle, WordList *[], + Accessor &styler) { + bool foldComment = styler.GetPropertyInt("fold.comment") != 0; + bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0; + unsigned int endPos = startPos + length; + int visibleChars = 0; + int lineCurrent = styler.GetLine(startPos); + int levelPrev = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK; + int levelCurrent = levelPrev; + char chNext = styler[startPos]; + int styleNext = styler.StyleAt(startPos); + int style = initStyle; + for (unsigned int i = startPos; i < endPos; i++) { + char ch = chNext; + chNext = styler.SafeGetCharAt(i + 1); + int stylePrev = style; + style = styleNext; + styleNext = styler.StyleAt(i + 1); + bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n'); + if (foldComment && + (style == SCE_BAAN_COMMENT || style == SCE_BAAN_COMMENTDOC)) { + if (style != stylePrev) { + levelCurrent++; + } else if ((style != styleNext) && !atEOL) { + // Comments don't end at end of line and the next character may be unstyled. + levelCurrent--; + } + } + if (style == SCE_BAAN_OPERATOR) { + if (ch == '{') { + levelCurrent++; + } else if (ch == '}') { + levelCurrent--; + } + } + if (atEOL) { + int lev = levelPrev; + if (visibleChars == 0 && foldCompact) + lev |= SC_FOLDLEVELWHITEFLAG; + if ((levelCurrent > levelPrev) && (visibleChars > 0)) + lev |= SC_FOLDLEVELHEADERFLAG; + if (lev != styler.LevelAt(lineCurrent)) { + styler.SetLevel(lineCurrent, lev); + } + lineCurrent++; + levelPrev = levelCurrent; + visibleChars = 0; + } + if (!isspacechar(ch)) + visibleChars++; + } + // Fill in the real level of the next line, keeping the current flags as they will be filled in later + int flagsNext = styler.LevelAt(lineCurrent) & ~SC_FOLDLEVELNUMBERMASK; + styler.SetLevel(lineCurrent, levelPrev | flagsNext); +} + +LexerModule lmBaan(SCLEX_BAAN, ColouriseBaanDoc, "baan", FoldBaanDoc); diff --git a/src/LexBash.cpp b/src/LexBash.cpp new file mode 100755 index 0000000..e9c31d6 --- /dev/null +++ b/src/LexBash.cpp @@ -0,0 +1,663 @@ +// Scintilla source code edit control +/** @file LexBash.cxx + ** Lexer for Bash. + **/ +// Copyright 2004-2005 by Neil Hodgson +// Adapted from LexPerl by Kein-Hong Man 2004 +// The License.txt file describes the conditions under which this software may be distributed. + +#include +#include +#include +#include +#include + +#include "Platform.h" + +#include "PropSet.h" +#include "Accessor.h" +#include "KeyWords.h" +#include "Scintilla.h" +#include "SciLexer.h" + +#define BASH_BASE_ERROR 65 +#define BASH_BASE_DECIMAL 66 +#define BASH_BASE_HEX 67 +#define BASH_BASE_OCTAL 68 +#define BASH_BASE_OCTAL_ERROR 69 + +#define HERE_DELIM_MAX 256 + +static inline int translateBashDigit(char ch) { + if (ch >= '0' && ch <= '9') { + return ch - '0'; + } else if (ch >= 'a' && ch <= 'z') { + return ch - 'a' + 10; + } else if (ch >= 'A' && ch <= 'Z') { + return ch - 'A' + 36; + } else if (ch == '@') { + return 62; + } else if (ch == '_') { + return 63; + } + return BASH_BASE_ERROR; +} + +static inline bool isEOLChar(char ch) { + return (ch == '\r') || (ch == '\n'); +} + +static bool isSingleCharOp(char ch) { + char strCharSet[2]; + strCharSet[0] = ch; + strCharSet[1] = '\0'; + return (NULL != strstr("rwxoRWXOezsfdlpSbctugkTBMACahGLNn", strCharSet)); +} + +static inline bool isBashOperator(char ch) { + if (ch == '^' || ch == '&' || ch == '\\' || ch == '%' || + ch == '(' || ch == ')' || ch == '-' || ch == '+' || + ch == '=' || ch == '|' || ch == '{' || ch == '}' || + ch == '[' || ch == ']' || ch == ':' || ch == ';' || + ch == '>' || ch == ',' || ch == '/' || ch == '<' || + ch == '?' || ch == '!' || ch == '.' || ch == '~' || + ch == '@') + return true; + return false; +} + +static int classifyWordBash(unsigned int start, unsigned int end, WordList &keywords, Accessor &styler) { + char s[100]; + for (unsigned int i = 0; i < end - start + 1 && i < 30; i++) { + s[i] = styler[start + i]; + s[i + 1] = '\0'; + } + char chAttr = SCE_SH_IDENTIFIER; + if (keywords.InList(s)) + chAttr = SCE_SH_WORD; + styler.ColourTo(end, chAttr); + return chAttr; +} + +static inline int getBashNumberBase(unsigned int start, unsigned int end, Accessor &styler) { + int base = 0; + for (unsigned int i = 0; i < end - start + 1 && i < 10; i++) { + base = base * 10 + (styler[start + i] - '0'); + } + if (base > 64 || (end - start) > 1) { + return BASH_BASE_ERROR; + } + return base; +} + +static inline bool isEndVar(char ch) { + return !isalnum(ch) && ch != '$' && ch != '_'; +} + +static inline bool isNonQuote(char ch) { + return isalnum(ch) || ch == '_'; +} + +static bool isMatch(Accessor &styler, int lengthDoc, int pos, const char *val) { + if ((pos + static_cast(strlen(val))) >= lengthDoc) { + return false; + } + while (*val) { + if (*val != styler[pos++]) { + return false; + } + val++; + } + return true; +} + +static char opposite(char ch) { + if (ch == '(') + return ')'; + if (ch == '[') + return ']'; + if (ch == '{') + return '}'; + if (ch == '<') + return '>'; + return ch; +} + +static void ColouriseBashDoc(unsigned int startPos, int length, int initStyle, + WordList *keywordlists[], Accessor &styler) { + + // Lexer for bash often has to backtrack to start of current style to determine + // which characters are being used as quotes, how deeply nested is the + // start position and what the termination string is for here documents + + WordList &keywords = *keywordlists[0]; + + class HereDocCls { + public: + int State; // 0: '<<' encountered + // 1: collect the delimiter + // 2: here doc text (lines after the delimiter) + char Quote; // the char after '<<' + bool Quoted; // true if Quote in ('\'','"','`') + bool Indent; // indented delimiter (for <<-) + int DelimiterLength; // strlen(Delimiter) + char *Delimiter; // the Delimiter, 256: sizeof PL_tokenbuf + HereDocCls() { + State = 0; + Quote = 0; + Quoted = false; + Indent = 0; + DelimiterLength = 0; + Delimiter = new char[HERE_DELIM_MAX]; + Delimiter[0] = '\0'; + } + ~HereDocCls() { + delete []Delimiter; + } + }; + HereDocCls HereDoc; + + class QuoteCls { + public: + int Rep; + int Count; + char Up; + char Down; + QuoteCls() { + this->New(1); + } + void New(int r) { + Rep = r; + Count = 0; + Up = '\0'; + Down = '\0'; + } + void Open(char u) { + Count++; + Up = u; + Down = opposite(Up); + } + }; + QuoteCls Quote; + + int state = initStyle; + int numBase = 0; + unsigned int lengthDoc = startPos + length; + + // If in a long distance lexical state, seek to the beginning to find quote characters + // Bash strings can be multi-line with embedded newlines, so backtrack. + // Bash numbers have additional state during lexing, so backtrack too. + if (state == SCE_SH_HERE_Q) { + while ((startPos > 1) && (styler.StyleAt(startPos) != SCE_SH_HERE_DELIM)) { + startPos--; + } + startPos = styler.LineStart(styler.GetLine(startPos)); + state = styler.StyleAt(startPos - 1); + } + if (state == SCE_SH_STRING + || state == SCE_SH_BACKTICKS + || state == SCE_SH_CHARACTER + || state == SCE_SH_NUMBER + || state == SCE_SH_IDENTIFIER + || state == SCE_SH_COMMENTLINE + ) { + while ((startPos > 1) && (styler.StyleAt(startPos - 1) == state)) { + startPos--; + } + state = SCE_SH_DEFAULT; + } + + styler.StartAt(startPos); + char chPrev = styler.SafeGetCharAt(startPos - 1); + if (startPos == 0) + chPrev = '\n'; + char chNext = styler[startPos]; + styler.StartSegment(startPos); + + for (unsigned int i = startPos; i < lengthDoc; i++) { + char ch = chNext; + // if the current character is not consumed due to the completion of an + // earlier style, lexing can be restarted via a simple goto + restartLexer: + chNext = styler.SafeGetCharAt(i + 1); + char chNext2 = styler.SafeGetCharAt(i + 2); + + if (styler.IsLeadByte(ch)) { + chNext = styler.SafeGetCharAt(i + 2); + chPrev = ' '; + i += 1; + continue; + } + + if ((chPrev == '\r' && ch == '\n')) { // skip on DOS/Windows + styler.ColourTo(i, state); + chPrev = ch; + continue; + } + + if (HereDoc.State == 1 && isEOLChar(ch)) { + // Begin of here-doc (the line after the here-doc delimiter): + // Lexically, the here-doc starts from the next line after the >>, but the + // first line of here-doc seem to follow the style of the last EOL sequence + HereDoc.State = 2; + if (HereDoc.Quoted) { + if (state == SCE_SH_HERE_DELIM) { + // Missing quote at end of string! We are stricter than bash. + // Colour here-doc anyway while marking this bit as an error. + state = SCE_SH_ERROR; + } + styler.ColourTo(i - 1, state); + // HereDoc.Quote always == '\'' + state = SCE_SH_HERE_Q; + } else { + styler.ColourTo(i - 1, state); + // always switch + state = SCE_SH_HERE_Q; + } + } + + if (state == SCE_SH_DEFAULT) { + if (ch == '\\') { // escaped character + if (i < lengthDoc - 1) + i++; + ch = chNext; + chNext = chNext2; + styler.ColourTo(i, SCE_SH_IDENTIFIER); + } else if (isdigit(ch)) { + state = SCE_SH_NUMBER; + numBase = BASH_BASE_DECIMAL; + if (ch == '0') { // hex,octal + if (chNext == 'x' || chNext == 'X') { + numBase = BASH_BASE_HEX; + i++; + ch = chNext; + chNext = chNext2; + } else if (isdigit(chNext)) { + numBase = BASH_BASE_OCTAL; + } + } + } else if (iswordstart(ch)) { + state = SCE_SH_WORD; + if (!iswordchar(chNext) && chNext != '+' && chNext != '-') { + // We need that if length of word == 1! + // This test is copied from the SCE_SH_WORD handler. + classifyWordBash(styler.GetStartSegment(), i, keywords, styler); + state = SCE_SH_DEFAULT; + } + } else if (ch == '#') { + state = SCE_SH_COMMENTLINE; + } else if (ch == '\"') { + state = SCE_SH_STRING; + Quote.New(1); + Quote.Open(ch); + } else if (ch == '\'') { + state = SCE_SH_CHARACTER; + Quote.New(1); + Quote.Open(ch); + } else if (ch == '`') { + state = SCE_SH_BACKTICKS; + Quote.New(1); + Quote.Open(ch); + } else if (ch == '$') { + if (chNext == '{') { + state = SCE_SH_PARAM; + goto startQuote; + } else if (chNext == '\'') { + state = SCE_SH_CHARACTER; + goto startQuote; + } else if (chNext == '"') { + state = SCE_SH_STRING; + goto startQuote; + } else if (chNext == '(' && chNext2 == '(') { + styler.ColourTo(i, SCE_SH_OPERATOR); + state = SCE_SH_DEFAULT; + goto skipChar; + } else if (chNext == '(' || chNext == '`') { + state = SCE_SH_BACKTICKS; + startQuote: + Quote.New(1); + Quote.Open(chNext); + goto skipChar; + } else { + state = SCE_SH_SCALAR; + skipChar: + i++; + ch = chNext; + chNext = chNext2; + } + } else if (ch == '*') { + if (chNext == '*') { // exponentiation + i++; + ch = chNext; + chNext = chNext2; + } + styler.ColourTo(i, SCE_SH_OPERATOR); + } else if (ch == '<' && chNext == '<') { + state = SCE_SH_HERE_DELIM; + HereDoc.State = 0; + HereDoc.Indent = false; + } else if (ch == '-' // file test operators + && isSingleCharOp(chNext) + && !isalnum((chNext2 = styler.SafeGetCharAt(i+2)))) { + styler.ColourTo(i + 1, SCE_SH_WORD); + state = SCE_SH_DEFAULT; + i++; + ch = chNext; + chNext = chNext2; + } else if (isBashOperator(ch)) { + styler.ColourTo(i, SCE_SH_OPERATOR); + } else { + // keep colouring defaults to make restart easier + styler.ColourTo(i, SCE_SH_DEFAULT); + } + } else if (state == SCE_SH_NUMBER) { + int digit = translateBashDigit(ch); + if (numBase == BASH_BASE_DECIMAL) { + if (ch == '#') { + numBase = getBashNumberBase(styler.GetStartSegment(), i - 1, styler); + if (numBase == BASH_BASE_ERROR) // take the rest as comment + goto numAtEnd; + } else if (!isdigit(ch)) + goto numAtEnd; + } else if (numBase == BASH_BASE_HEX) { + if ((digit < 16) || (digit >= 36 && digit <= 41)) { + // hex digit 0-9a-fA-F + } else + goto numAtEnd; + } else if (numBase == BASH_BASE_OCTAL || + numBase == BASH_BASE_OCTAL_ERROR) { + if (digit > 7) { + if (digit <= 9) { + numBase = BASH_BASE_OCTAL_ERROR; + } else + goto numAtEnd; + } + } else if (numBase == BASH_BASE_ERROR) { + if (digit > 9) + goto numAtEnd; + } else { // DD#DDDD number style handling + if (digit != BASH_BASE_ERROR) { + if (numBase <= 36) { + // case-insensitive if base<=36 + if (digit >= 36) digit -= 26; + } + if (digit >= numBase) { + if (digit <= 9) { + numBase = BASH_BASE_ERROR; + } else + goto numAtEnd; + } + } else { + numAtEnd: + if (numBase == BASH_BASE_ERROR || + numBase == BASH_BASE_OCTAL_ERROR) + state = SCE_SH_ERROR; + styler.ColourTo(i - 1, state); + state = SCE_SH_DEFAULT; + goto restartLexer; + } + } + } else if (state == SCE_SH_WORD) { + if (!iswordchar(chNext) && chNext != '+' && chNext != '-') { + // "." never used in Bash variable names + // but used in file names + classifyWordBash(styler.GetStartSegment(), i, keywords, styler); + state = SCE_SH_DEFAULT; + ch = ' '; + } + } else if (state == SCE_SH_IDENTIFIER) { + if (!iswordchar(chNext) && chNext != '+' && chNext != '-') { + styler.ColourTo(i, SCE_SH_IDENTIFIER); + state = SCE_SH_DEFAULT; + ch = ' '; + } + } else { + if (state == SCE_SH_COMMENTLINE) { + if (ch == '\\' && isEOLChar(chNext)) { + // comment continuation + if (chNext == '\r' && chNext2 == '\n') { + i += 2; + ch = styler.SafeGetCharAt(i); + chNext = styler.SafeGetCharAt(i + 1); + } else { + i++; + ch = chNext; + chNext = chNext2; + } + } else if (isEOLChar(ch)) { + styler.ColourTo(i - 1, state); + state = SCE_SH_DEFAULT; + goto restartLexer; + } else if (isEOLChar(chNext)) { + styler.ColourTo(i, state); + state = SCE_SH_DEFAULT; + } + } else if (state == SCE_SH_HERE_DELIM) { + // + // From Bash info: + // --------------- + // Specifier format is: <<[-]WORD + // Optional '-' is for removal of leading tabs from here-doc. + // Whitespace acceptable after <<[-] operator + // + if (HereDoc.State == 0) { // '<<' encountered + HereDoc.State = 1; + HereDoc.Quote = chNext; + HereDoc.Quoted = false; + HereDoc.DelimiterLength = 0; + HereDoc.Delimiter[HereDoc.DelimiterLength] = '\0'; + if (chNext == '\'' || chNext == '\"') { // a quoted here-doc delimiter (' or ") + i++; + ch = chNext; + chNext = chNext2; + HereDoc.Quoted = true; + } else if (!HereDoc.Indent && chNext == '-') { // <<- indent case + HereDoc.Indent = true; + HereDoc.State = 0; + } else if (isalpha(chNext) || chNext == '_' || chNext == '\\' + || chNext == '-' || chNext == '+' || chNext == '!') { + // an unquoted here-doc delimiter, no special handling + // TODO check what exactly bash considers part of the delim + } else if (chNext == '<') { // HERE string <<< + i++; + ch = chNext; + chNext = chNext2; + styler.ColourTo(i, SCE_SH_HERE_DELIM); + state = SCE_SH_DEFAULT; + HereDoc.State = 0; + } else if (isspacechar(chNext)) { + // eat whitespace + HereDoc.State = 0; + } else if (isdigit(chNext) || chNext == '=' || chNext == '$') { + // left shift << or <<= operator cases + styler.ColourTo(i, SCE_SH_OPERATOR); + state = SCE_SH_DEFAULT; + HereDoc.State = 0; + } else { + // symbols terminates; deprecated zero-length delimiter + } + } else if (HereDoc.State == 1) { // collect the delimiter + if (HereDoc.Quoted) { // a quoted here-doc delimiter + if (ch == HereDoc.Quote) { // closing quote => end of delimiter + styler.ColourTo(i, state); + state = SCE_SH_DEFAULT; + } else { + if (ch == '\\' && chNext == HereDoc.Quote) { // escaped quote + i++; + ch = chNext; + chNext = chNext2; + } + HereDoc.Delimiter[HereDoc.DelimiterLength++] = ch; + HereDoc.Delimiter[HereDoc.DelimiterLength] = '\0'; + } + } else { // an unquoted here-doc delimiter + if (isalnum(ch) || ch == '_' || ch == '-' || ch == '+' || ch == '!') { + HereDoc.Delimiter[HereDoc.DelimiterLength++] = ch; + HereDoc.Delimiter[HereDoc.DelimiterLength] = '\0'; + } else if (ch == '\\') { + // skip escape prefix + } else { + styler.ColourTo(i - 1, state); + state = SCE_SH_DEFAULT; + goto restartLexer; + } + } + if (HereDoc.DelimiterLength >= HERE_DELIM_MAX - 1) { + styler.ColourTo(i - 1, state); + state = SCE_SH_ERROR; + goto restartLexer; + } + } + } else if (HereDoc.State == 2) { + // state == SCE_SH_HERE_Q + if (isMatch(styler, lengthDoc, i, HereDoc.Delimiter)) { + if (!HereDoc.Indent && isEOLChar(chPrev)) { + endHereDoc: + // standard HERE delimiter + i += HereDoc.DelimiterLength; + chPrev = styler.SafeGetCharAt(i - 1); + ch = styler.SafeGetCharAt(i); + if (isEOLChar(ch)) { + styler.ColourTo(i - 1, state); + state = SCE_SH_DEFAULT; + HereDoc.State = 0; + goto restartLexer; + } + chNext = styler.SafeGetCharAt(i + 1); + } else if (HereDoc.Indent) { + // indented HERE delimiter + unsigned int bk = (i > 0)? i - 1: 0; + while (i > 0) { + ch = styler.SafeGetCharAt(bk--); + if (isEOLChar(ch)) { + goto endHereDoc; + } else if (!isspacechar(ch)) { + break; // got leading non-whitespace + } + } + } + } + } else if (state == SCE_SH_SCALAR) { // variable names + if (isEndVar(ch)) { + if ((state == SCE_SH_SCALAR) + && i == (styler.GetStartSegment() + 1)) { + // Special variable: $(, $_ etc. + styler.ColourTo(i, state); + state = SCE_SH_DEFAULT; + } else { + styler.ColourTo(i - 1, state); + state = SCE_SH_DEFAULT; + goto restartLexer; + } + } + } else if (state == SCE_SH_STRING + || state == SCE_SH_CHARACTER + || state == SCE_SH_BACKTICKS + || state == SCE_SH_PARAM + ) { + if (!Quote.Down && !isspacechar(ch)) { + Quote.Open(ch); + } else if (ch == '\\' && Quote.Up != '\\') { + i++; + ch = chNext; + chNext = styler.SafeGetCharAt(i + 1); + } else if (ch == Quote.Down) { + Quote.Count--; + if (Quote.Count == 0) { + Quote.Rep--; + if (Quote.Rep <= 0) { + styler.ColourTo(i, state); + state = SCE_SH_DEFAULT; + ch = ' '; + } + if (Quote.Up == Quote.Down) { + Quote.Count++; + } + } + } else if (ch == Quote.Up) { + Quote.Count++; + } + } + } + if (state == SCE_SH_ERROR) { + break; + } + chPrev = ch; + } + styler.ColourTo(lengthDoc - 1, state); +} + +static bool IsCommentLine(int line, Accessor &styler) { + int pos = styler.LineStart(line); + int eol_pos = styler.LineStart(line + 1) - 1; + for (int i = pos; i < eol_pos; i++) { + char ch = styler[i]; + if (ch == '#') + return true; + else if (ch != ' ' && ch != '\t') + return false; + } + return false; +} + +static void FoldBashDoc(unsigned int startPos, int length, int, WordList *[], + Accessor &styler) { + bool foldComment = styler.GetPropertyInt("fold.comment") != 0; + bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0; + unsigned int endPos = startPos + length; + int visibleChars = 0; + int lineCurrent = styler.GetLine(startPos); + int levelPrev = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK; + int levelCurrent = levelPrev; + char chNext = styler[startPos]; + int styleNext = styler.StyleAt(startPos); + for (unsigned int i = startPos; i < endPos; i++) { + char ch = chNext; + chNext = styler.SafeGetCharAt(i + 1); + int style = styleNext; + styleNext = styler.StyleAt(i + 1); + bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n'); + // Comment folding + if (foldComment && atEOL && IsCommentLine(lineCurrent, styler)) + { + if (!IsCommentLine(lineCurrent - 1, styler) + && IsCommentLine(lineCurrent + 1, styler)) + levelCurrent++; + else if (IsCommentLine(lineCurrent - 1, styler) + && !IsCommentLine(lineCurrent+1, styler)) + levelCurrent--; + } + if (style == SCE_SH_OPERATOR) { + if (ch == '{') { + levelCurrent++; + } else if (ch == '}') { + levelCurrent--; + } + } + if (atEOL) { + int lev = levelPrev; + if (visibleChars == 0 && foldCompact) + lev |= SC_FOLDLEVELWHITEFLAG; + if ((levelCurrent > levelPrev) && (visibleChars > 0)) + lev |= SC_FOLDLEVELHEADERFLAG; + if (lev != styler.LevelAt(lineCurrent)) { + styler.SetLevel(lineCurrent, lev); + } + lineCurrent++; + levelPrev = levelCurrent; + visibleChars = 0; + } + if (!isspacechar(ch)) + visibleChars++; + } + // Fill in the real level of the next line, keeping the current flags as they will be filled in later + int flagsNext = styler.LevelAt(lineCurrent) & ~SC_FOLDLEVELNUMBERMASK; + styler.SetLevel(lineCurrent, levelPrev | flagsNext); +} + +static const char * const bashWordListDesc[] = { + "Keywords", + 0 +}; + +LexerModule lmBash(SCLEX_BASH, ColouriseBashDoc, "bash", FoldBashDoc, bashWordListDesc); diff --git a/src/LexBasic.cpp b/src/LexBasic.cpp new file mode 100644 index 0000000..79ba2b8 --- /dev/null +++ b/src/LexBasic.cpp @@ -0,0 +1,369 @@ +// Scintilla source code edit control +/** @file LexBasic.cxx + ** Lexer for BlitzBasic and PureBasic. + **/ +// Copyright 1998-2003 by Neil Hodgson +// The License.txt file describes the conditions under which this software may be distributed. + +// This tries to be a unified Lexer/Folder for all the BlitzBasic/BlitzMax/PurBasic basics +// and derivatives. Once they diverge enough, might want to split it into multiple +// lexers for more code clearity. +// +// Mail me (elias users sf net) for any bugs. + +// Folding only works for simple things like functions or types. + +// You may want to have a look at my ctags lexer as well, if you additionally to coloring +// and folding need to extract things like label tags in your editor. + +#include +#include +#include +#include +#include + +#include "Platform.h" + +#include "PropSet.h" +#include "Accessor.h" +#include "StyleContext.h" +#include "KeyWords.h" +#include "Scintilla.h" +#include "SciLexer.h" + +/* Bits: + * 1 - whitespace + * 2 - operator + * 4 - identifier + * 8 - decimal digit + * 16 - hex digit + * 32 - bin digit + */ +static int character_classification[128] = +{ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 1, 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 10, 2, + 60, 60, 28, 28, 28, 28, 28, 28, 28, 28, 2, 2, 2, 2, 2, 2, + 2, 20, 20, 20, 20, 20, 20, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 4, + 2, 20, 20, 20, 20, 20, 20, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 0 +}; + +static bool IsSpace(int c) { + return c < 128 && (character_classification[c] & 1); +} + +static bool IsOperator(int c) { + return c < 128 && (character_classification[c] & 2); +} + +static bool IsIdentifier(int c) { + return c < 128 && (character_classification[c] & 4); +} + +static bool IsDigit(int c) { + return c < 128 && (character_classification[c] & 8); +} + +static bool IsHexDigit(int c) { + return c < 128 && (character_classification[c] & 16); +} + +static bool IsBinDigit(int c) { + return c < 128 && (character_classification[c] & 32); +} + +static int LowerCase(int c) +{ + if (c >= 'A' && c <= 'Z') + return 'a' + c - 'A'; + return c; +} + +static void ColouriseBasicDoc(unsigned int startPos, int length, int initStyle, + WordList *keywordlists[], Accessor &styler, char comment_char) { + bool wasfirst = true, isfirst = true; // true if first token in a line + styler.StartAt(startPos); + + StyleContext sc(startPos, length, initStyle, styler); + + // Can't use sc.More() here else we miss the last character + for (; ; sc.Forward()) { + if (sc.state == SCE_B_IDENTIFIER) { + if (!IsIdentifier(sc.ch)) { + // Labels + if (wasfirst && sc.Match(':')) { + sc.ChangeState(SCE_B_LABEL); + sc.ForwardSetState(SCE_B_DEFAULT); + } else { + char s[100]; + int kstates[4] = { + SCE_B_KEYWORD, + SCE_B_KEYWORD2, + SCE_B_KEYWORD3, + SCE_B_KEYWORD4, + }; + sc.GetCurrentLowered(s, sizeof(s)); + for (int i = 0; i < 4; i++) { + if (keywordlists[i]->InList(s)) { + sc.ChangeState(kstates[i]); + } + } + // Types, must set them as operator else they will be + // matched as number/constant + if (sc.Match('.') || sc.Match('$') || sc.Match('%') || + sc.Match('#')) { + sc.SetState(SCE_B_OPERATOR); + } else { + sc.SetState(SCE_B_DEFAULT); + } + } + } + } else if (sc.state == SCE_B_OPERATOR) { + if (!IsOperator(sc.ch) || sc.Match('#')) + sc.SetState(SCE_B_DEFAULT); + } else if (sc.state == SCE_B_LABEL) { + if (!IsIdentifier(sc.ch)) + sc.SetState(SCE_B_DEFAULT); + } else if (sc.state == SCE_B_CONSTANT) { + if (!IsIdentifier(sc.ch)) + sc.SetState(SCE_B_DEFAULT); + } else if (sc.state == SCE_B_NUMBER) { + if (!IsDigit(sc.ch)) + sc.SetState(SCE_B_DEFAULT); + } else if (sc.state == SCE_B_HEXNUMBER) { + if (!IsHexDigit(sc.ch)) + sc.SetState(SCE_B_DEFAULT); + } else if (sc.state == SCE_B_BINNUMBER) { + if (!IsBinDigit(sc.ch)) + sc.SetState(SCE_B_DEFAULT); + } else if (sc.state == SCE_B_STRING) { + if (sc.ch == '"') { + sc.ForwardSetState(SCE_B_DEFAULT); + } + if (sc.atLineEnd) { + sc.ChangeState(SCE_B_ERROR); + sc.SetState(SCE_B_DEFAULT); + } + } else if (sc.state == SCE_B_COMMENT || sc.state == SCE_B_PREPROCESSOR) { + if (sc.atLineEnd) { + sc.SetState(SCE_B_DEFAULT); + } + } + + if (sc.atLineStart) + isfirst = true; + + if (sc.state == SCE_B_DEFAULT || sc.state == SCE_B_ERROR) { + if (isfirst && sc.Match('.')) { + sc.SetState(SCE_B_LABEL); + } else if (isfirst && sc.Match('#')) { + wasfirst = isfirst; + sc.SetState(SCE_B_IDENTIFIER); + } else if (sc.Match(comment_char)) { + // Hack to make deprecated QBASIC '$Include show + // up in freebasic with SCE_B_PREPROCESSOR. + if (comment_char == '\'' && sc.Match(comment_char, '$')) + sc.SetState(SCE_B_PREPROCESSOR); + else + sc.SetState(SCE_B_COMMENT); + } else if (sc.Match('"')) { + sc.SetState(SCE_B_STRING); + } else if (IsDigit(sc.ch)) { + sc.SetState(SCE_B_NUMBER); + } else if (sc.Match('$')) { + sc.SetState(SCE_B_HEXNUMBER); + } else if (sc.Match('%')) { + sc.SetState(SCE_B_BINNUMBER); + } else if (sc.Match('#')) { + sc.SetState(SCE_B_CONSTANT); + } else if (IsOperator(sc.ch)) { + sc.SetState(SCE_B_OPERATOR); + } else if (IsIdentifier(sc.ch)) { + wasfirst = isfirst; + sc.SetState(SCE_B_IDENTIFIER); + } else if (!IsSpace(sc.ch)) { + sc.SetState(SCE_B_ERROR); + } + } + + if (!IsSpace(sc.ch)) + isfirst = false; + + if (!sc.More()) + break; + } + sc.Complete(); +} + +static int CheckBlitzFoldPoint(char const *token, int &level) { + if (!strcmp(token, "function") || + !strcmp(token, "type")) { + level |= SC_FOLDLEVELHEADERFLAG; + return 1; + } + if (!strcmp(token, "end function") || + !strcmp(token, "end type")) { + return -1; + } + return 0; +} + +static int CheckPureFoldPoint(char const *token, int &level) { + if (!strcmp(token, "procedure") || + !strcmp(token, "enumeration") || + !strcmp(token, "interface") || + !strcmp(token, "structure")) { + level |= SC_FOLDLEVELHEADERFLAG; + return 1; + } + if (!strcmp(token, "endprocedure") || + !strcmp(token, "endenumeration") || + !strcmp(token, "endinterface") || + !strcmp(token, "endstructure")) { + return -1; + } + return 0; +} + +static int CheckFreeFoldPoint(char const *token, int &level) { + if (!strcmp(token, "function") || + !strcmp(token, "sub") || + !strcmp(token, "type")) { + level |= SC_FOLDLEVELHEADERFLAG; + return 1; + } + if (!strcmp(token, "end function") || + !strcmp(token, "end sub") || + !strcmp(token, "end type")) { + return -1; + } + return 0; +} + +static void FoldBasicDoc(unsigned int startPos, int length, + Accessor &styler, int (*CheckFoldPoint)(char const *, int &)) { + int line = styler.GetLine(startPos); + int level = styler.LevelAt(line); + int go = 0, done = 0; + int endPos = startPos + length; + char word[256]; + int wordlen = 0; + int i; + bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0; + // Scan for tokens at the start of the line (they may include + // whitespace, for tokens like "End Function" + for (i = startPos; i < endPos; i++) { + int c = styler.SafeGetCharAt(i); + if (!done && !go) { + if (wordlen) { // are we scanning a token already? + word[wordlen] = static_cast(LowerCase(c)); + if (!IsIdentifier(c)) { // done with token + word[wordlen] = '\0'; + go = CheckFoldPoint(word, level); + if (!go) { + // Treat any whitespace as single blank, for + // things like "End Function". + if (IsSpace(c) && IsIdentifier(word[wordlen - 1])) { + word[wordlen] = ' '; + if (wordlen < 255) + wordlen++; + } + else // done with this line + done = 1; + } + } else if (wordlen < 255) { + wordlen++; + } + } else { // start scanning at first non-whitespace character + if (!IsSpace(c)) { + if (IsIdentifier(c)) { + word[0] = static_cast(LowerCase(c)); + wordlen = 1; + } else // done with this line + done = 1; + } + } + } + if (c == '\n') { // line end + if (!done && wordlen == 0 && foldCompact) // line was only space + level |= SC_FOLDLEVELWHITEFLAG; + if (level != styler.LevelAt(line)) + styler.SetLevel(line, level); + level += go; + line++; + // reset state + wordlen = 0; + level &= ~SC_FOLDLEVELHEADERFLAG; + level &= ~SC_FOLDLEVELWHITEFLAG; + go = 0; + done = 0; + } + } +} + +static void ColouriseBlitzBasicDoc(unsigned int startPos, int length, int initStyle, + WordList *keywordlists[], Accessor &styler) { + ColouriseBasicDoc(startPos, length, initStyle, keywordlists, styler, ';'); +} + +static void ColourisePureBasicDoc(unsigned int startPos, int length, int initStyle, + WordList *keywordlists[], Accessor &styler) { + ColouriseBasicDoc(startPos, length, initStyle, keywordlists, styler, ';'); +} + +static void ColouriseFreeBasicDoc(unsigned int startPos, int length, int initStyle, + WordList *keywordlists[], Accessor &styler) { + ColouriseBasicDoc(startPos, length, initStyle, keywordlists, styler, '\''); +} + +static void FoldBlitzBasicDoc(unsigned int startPos, int length, int, + WordList *[], Accessor &styler) { + FoldBasicDoc(startPos, length, styler, CheckBlitzFoldPoint); +} + +static void FoldPureBasicDoc(unsigned int startPos, int length, int, + WordList *[], Accessor &styler) { + FoldBasicDoc(startPos, length, styler, CheckPureFoldPoint); +} + +static void FoldFreeBasicDoc(unsigned int startPos, int length, int, + WordList *[], Accessor &styler) { + FoldBasicDoc(startPos, length, styler, CheckFreeFoldPoint); +} + +static const char * const blitzbasicWordListDesc[] = { + "BlitzBasic Keywords", + "user1", + "user2", + "user3", + 0 +}; + +static const char * const purebasicWordListDesc[] = { + "PureBasic Keywords", + "PureBasic PreProcessor Keywords", + "user defined 1", + "user defined 2", + 0 +}; + +static const char * const freebasicWordListDesc[] = { + "FreeBasic Keywords", + "FreeBasic PreProcessor Keywords", + "user defined 1", + "user defined 2", + 0 +}; + +LexerModule lmBlitzBasic(SCLEX_BLITZBASIC, ColouriseBlitzBasicDoc, "blitzbasic", + FoldBlitzBasicDoc, blitzbasicWordListDesc); + +LexerModule lmPureBasic(SCLEX_PUREBASIC, ColourisePureBasicDoc, "purebasic", + FoldPureBasicDoc, purebasicWordListDesc); + +LexerModule lmFreeBasic(SCLEX_FREEBASIC, ColouriseFreeBasicDoc, "freebasic", + FoldFreeBasicDoc, freebasicWordListDesc); + diff --git a/src/LexBullant.cpp b/src/LexBullant.cpp new file mode 100755 index 0000000..902f89c --- /dev/null +++ b/src/LexBullant.cpp @@ -0,0 +1,225 @@ +// SciTE - Scintilla based Text Editor +// LexBullant.cxx - lexer for Bullant + +#include +#include +#include +#include +#include + +#include "Platform.h" + +#include "PropSet.h" +#include "Accessor.h" +#include "KeyWords.h" +#include "Scintilla.h" +#include "SciLexer.h" + + +static int classifyWordBullant(unsigned int start, unsigned int end, WordList &keywords, Accessor &styler) { + char s[100]; + for (unsigned int i = 0; i < end - start + 1 && i < 30; i++) { + s[i] = static_cast(tolower(styler[start + i])); + s[i + 1] = '\0'; + } + int lev= 0; + char chAttr = SCE_C_IDENTIFIER; + if (isdigit(s[0]) || (s[0] == '.')){ + chAttr = SCE_C_NUMBER; + } + else { + if (keywords.InList(s)) { + chAttr = SCE_C_WORD; + if (strcmp(s, "end") == 0) + lev = -1; + else if (strcmp(s, "method") == 0 || + strcmp(s, "case") == 0 || + strcmp(s, "class") == 0 || + strcmp(s, "debug") == 0 || + strcmp(s, "test") == 0 || + strcmp(s, "if") == 0 || + strcmp(s, "lock") == 0 || + strcmp(s, "transaction") == 0 || + strcmp(s, "trap") == 0 || + strcmp(s, "until") == 0 || + strcmp(s, "while") == 0) + lev = 1; + } + } + styler.ColourTo(end, chAttr); + return lev; +} + +static void ColouriseBullantDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[], + Accessor &styler) { + WordList &keywords = *keywordlists[0]; + + styler.StartAt(startPos); + + bool fold = styler.GetPropertyInt("fold") != 0; + int lineCurrent = styler.GetLine(startPos); + int levelPrev = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK; + int levelCurrent = levelPrev; + + int state = initStyle; + if (state == SCE_C_STRINGEOL) // Does not leak onto next line + state = SCE_C_DEFAULT; + char chPrev = ' '; + char chNext = styler[startPos]; + unsigned int lengthDoc = startPos + length; + int visibleChars = 0; + styler.StartSegment(startPos); + int endFoundThisLine = 0; + for (unsigned int i = startPos; i < lengthDoc; i++) { + char ch = chNext; + chNext = styler.SafeGetCharAt(i + 1); + + if ((ch == '\r' && chNext != '\n') || (ch == '\n')) { + // Trigger on CR only (Mac style) or either on LF from CR+LF (Dos/Win) or on LF alone (Unix) + // Avoid triggering two times on Dos/Win + // End of line + endFoundThisLine = 0; + if (state == SCE_C_STRINGEOL) { + styler.ColourTo(i, state); + state = SCE_C_DEFAULT; + } + if (fold) { + int lev = levelPrev; + if (visibleChars == 0) + lev |= SC_FOLDLEVELWHITEFLAG; + if ((levelCurrent > levelPrev) && (visibleChars > 0)) + lev |= SC_FOLDLEVELHEADERFLAG; + styler.SetLevel(lineCurrent, lev); + lineCurrent++; + levelPrev = levelCurrent; + } + visibleChars = 0; + +/* int indentBlock = GetLineIndentation(lineCurrent); + if (blockChange==1){ + lineCurrent++; + int pos=SetLineIndentation(lineCurrent, indentBlock + indentSize); + } else if (blockChange==-1) { + indentBlock -= indentSize; + if (indentBlock < 0) + indentBlock = 0; + SetLineIndentation(lineCurrent, indentBlock); + lineCurrent++; + } + blockChange=0; +*/ } + if (!isspace(ch)) + visibleChars++; + + if (styler.IsLeadByte(ch)) { + chNext = styler.SafeGetCharAt(i + 2); + chPrev = ' '; + i += 1; + continue; + } + + if (state == SCE_C_DEFAULT) { + if (iswordstart(ch)) { + styler.ColourTo(i-1, state); + state = SCE_C_IDENTIFIER; + } else if (ch == '@' && chNext == 'o') { + if ((styler.SafeGetCharAt(i+2) =='f') && (styler.SafeGetCharAt(i+3) == 'f')) { + styler.ColourTo(i-1, state); + state = SCE_C_COMMENT; + } + } else if (ch == '#') { + styler.ColourTo(i-1, state); + state = SCE_C_COMMENTLINE; + } else if (ch == '\"') { + styler.ColourTo(i-1, state); + state = SCE_C_STRING; + } else if (ch == '\'') { + styler.ColourTo(i-1, state); + state = SCE_C_CHARACTER; + } else if (isoperator(ch)) { + styler.ColourTo(i-1, state); + styler.ColourTo(i, SCE_C_OPERATOR); + } + } else if (state == SCE_C_IDENTIFIER) { + if (!iswordchar(ch)) { + int levelChange = classifyWordBullant(styler.GetStartSegment(), i - 1, keywords, styler); + state = SCE_C_DEFAULT; + chNext = styler.SafeGetCharAt(i + 1); + if (ch == '#') { + state = SCE_C_COMMENTLINE; + } else if (ch == '\"') { + state = SCE_C_STRING; + } else if (ch == '\'') { + state = SCE_C_CHARACTER; + } else if (isoperator(ch)) { + styler.ColourTo(i, SCE_C_OPERATOR); + } + if (endFoundThisLine == 0) + levelCurrent+=levelChange; + if (levelChange == -1) + endFoundThisLine=1; + } + } else if (state == SCE_C_COMMENT) { + if (ch == '@' && chNext == 'o') { + if (styler.SafeGetCharAt(i+2) == 'n') { + styler.ColourTo(i+2, state); + state = SCE_C_DEFAULT; + i+=2; + } + } + } else if (state == SCE_C_COMMENTLINE) { + if (ch == '\r' || ch == '\n') { + endFoundThisLine = 0; + styler.ColourTo(i-1, state); + state = SCE_C_DEFAULT; + } + } else if (state == SCE_C_STRING) { + if (ch == '\\') { + if (chNext == '\"' || chNext == '\'' || chNext == '\\') { + i++; + ch = chNext; + chNext = styler.SafeGetCharAt(i + 1); + } + } else if (ch == '\"') { + styler.ColourTo(i, state); + state = SCE_C_DEFAULT; + } else if (chNext == '\r' || chNext == '\n') { + endFoundThisLine = 0; + styler.ColourTo(i-1, SCE_C_STRINGEOL); + state = SCE_C_STRINGEOL; + } + } else if (state == SCE_C_CHARACTER) { + if ((ch == '\r' || ch == '\n') && (chPrev != '\\')) { + endFoundThisLine = 0; + styler.ColourTo(i-1, SCE_C_STRINGEOL); + state = SCE_C_STRINGEOL; + } else if (ch == '\\') { + if (chNext == '\"' || chNext == '\'' || chNext == '\\') { + i++; + ch = chNext; + chNext = styler.SafeGetCharAt(i + 1); + } + } else if (ch == '\'') { + styler.ColourTo(i, state); + state = SCE_C_DEFAULT; + } + } + chPrev = ch; + } + styler.ColourTo(lengthDoc - 1, state); + + // Fill in the real level of the next line, keeping the current flags as they will be filled in later + if (fold) { + int flagsNext = styler.LevelAt(lineCurrent) & ~SC_FOLDLEVELNUMBERMASK; + //styler.SetLevel(lineCurrent, levelCurrent | flagsNext); + styler.SetLevel(lineCurrent, levelPrev | flagsNext); + + } +} + +static const char * const bullantWordListDesc[] = { + "Keywords", + 0 +}; + +LexerModule lmBullant(SCLEX_BULLANT, ColouriseBullantDoc, "bullant", 0, bullantWordListDesc); diff --git a/src/LexCLW.cpp b/src/LexCLW.cpp new file mode 100755 index 0000000..e28e4b1 --- /dev/null +++ b/src/LexCLW.cpp @@ -0,0 +1,675 @@ +// Scintilla source code edit control +/** @file LexClw.cxx + ** Lexer for Clarion. + ** 2004/12/17 Updated Lexer + **/ +// Copyright 2003-2004 by Ron Schofield +// The License.txt file describes the conditions under which this software may be distributed. + +#include +#include +#include +#include +#include + +#include "Platform.h" + +#include "PropSet.h" +#include "Accessor.h" +#include "StyleContext.h" +#include "KeyWords.h" +#include "Scintilla.h" +#include "SciLexer.h" + +// Is an end of line character +inline bool IsEOL(const int ch) { + + return(ch == '\n'); +} + +// Convert character to uppercase +static char CharacterUpper(char chChar) { + + if (chChar < 'a' || chChar > 'z') { + return(chChar); + } + else { + return(static_cast(chChar - 'a' + 'A')); + } +} + +// Convert string to uppercase +static void StringUpper(char *szString) { + + while (*szString) { + *szString = CharacterUpper(*szString); + szString++; + } +} + +// Is a label start character +inline bool IsALabelStart(const int iChar) { + + return(isalpha(iChar) || iChar == '_'); +} + +// Is a label character +inline bool IsALabelCharacter(const int iChar) { + + return(isalnum(iChar) || iChar == '_' || iChar == ':'); +} + +// Is the character is a ! and the the next character is not a ! +inline bool IsACommentStart(const int iChar) { + + return(iChar == '!'); +} + +// Is the character a Clarion hex character (ABCDEF) +inline bool IsAHexCharacter(const int iChar, bool bCaseSensitive) { + + // Case insensitive. + if (!bCaseSensitive) { + if (strchr("ABCDEFabcdef", iChar) != NULL) { + return(true); + } + } + // Case sensitive + else { + if (strchr("ABCDEF", iChar) != NULL) { + return(true); + } + } + return(false); +} + +// Is the character a Clarion base character (B=Binary, O=Octal, H=Hex) +inline bool IsANumericBaseCharacter(const int iChar, bool bCaseSensitive) { + + // Case insensitive. + if (!bCaseSensitive) { + // If character is a numeric base character + if (strchr("BOHboh", iChar) != NULL) { + return(true); + } + } + // Case sensitive + else { + // If character is a numeric base character + if (strchr("BOH", iChar) != NULL) { + return(true); + } + } + return(false); +} + +// Set the correct numeric constant state +inline bool SetNumericConstantState(StyleContext &scDoc) { + + int iPoints = 0; // Point counter + char cNumericString[512]; // Numeric string buffer + + // Buffer the current numberic string + scDoc.GetCurrent(cNumericString, sizeof(cNumericString)); + // Loop through the string until end of string (NULL termination) + for (int iIndex = 0; cNumericString[iIndex] != '\0'; iIndex++) { + // Depending on the character + switch (cNumericString[iIndex]) { + // Is a . (point) + case '.' : + // Increment point counter + iPoints++; + break; + default : + break; + } + } + // If points found (can be more than one for improper formatted number + if (iPoints > 0) { + return(true); + } + // Else no points found + else { + return(false); + } +} + +// Get the next word in uppercase from the current position (keyword lookahead) +inline bool GetNextWordUpper(Accessor &styler, unsigned int uiStartPos, int iLength, char *cWord) { + + unsigned int iIndex = 0; // Buffer Index + + // Loop through the remaining string from the current position + for (int iOffset = uiStartPos; iOffset < iLength; iOffset++) { + // Get the character from the buffer using the offset + char cCharacter = styler[iOffset]; + if (IsEOL(cCharacter)) { + break; + } + // If the character is alphabet character + if (isalpha(cCharacter)) { + // Add UPPERCASE character to the word buffer + cWord[iIndex++] = CharacterUpper(cCharacter); + } + } + // Add null termination + cWord[iIndex] = '\0'; + // If no word was found + if (iIndex == 0) { + // Return failure + return(false); + } + // Else word was found + else { + // Return success + return(true); + } +} + +// Clarion Language Colouring Procedure +static void ColouriseClarionDoc(unsigned int uiStartPos, int iLength, int iInitStyle, WordList *wlKeywords[], Accessor &accStyler, bool bCaseSensitive) { + + int iParenthesesLevel = 0; // Parenthese Level + int iColumn1Label = false; // Label starts in Column 1 + + WordList &wlClarionKeywords = *wlKeywords[0]; // Clarion Keywords + WordList &wlCompilerDirectives = *wlKeywords[1]; // Compiler Directives + WordList &wlRuntimeExpressions = *wlKeywords[2]; // Runtime Expressions + WordList &wlBuiltInProcsFuncs = *wlKeywords[3]; // Builtin Procedures and Functions + WordList &wlStructsDataTypes = *wlKeywords[4]; // Structures and Data Types + WordList &wlAttributes = *wlKeywords[5]; // Procedure Attributes + WordList &wlStandardEquates = *wlKeywords[6]; // Standard Equates + WordList &wlLabelReservedWords = *wlKeywords[7]; // Clarion Reserved Keywords (Labels) + WordList &wlProcLabelReservedWords = *wlKeywords[8]; // Clarion Reserved Keywords (Procedure Labels) + + const char wlProcReservedKeywordList[] = + "PROCEDURE FUNCTION"; + WordList wlProcReservedKeywords; + wlProcReservedKeywords.Set(wlProcReservedKeywordList); + + const char wlCompilerKeywordList[] = + "COMPILE OMIT"; + WordList wlCompilerKeywords; + wlCompilerKeywords.Set(wlCompilerKeywordList); + + const char wlLegacyStatementsList[] = + "BOF EOF FUNCTION POINTER SHARE"; + WordList wlLegacyStatements; + wlLegacyStatements.Set(wlLegacyStatementsList); + + StyleContext scDoc(uiStartPos, iLength, iInitStyle, accStyler); + + // lex source code + for (; scDoc.More(); scDoc.Forward()) + { + // + // Determine if the current state should terminate. + // + + // Label State Handling + if (scDoc.state == SCE_CLW_LABEL) { + // If the character is not a valid label + if (!IsALabelCharacter(scDoc.ch)) { + // If the character is a . (dot syntax) + if (scDoc.ch == '.') { + // Turn off column 1 label flag as label now cannot be reserved work + iColumn1Label = false; + // Uncolour the . (dot) to default state, move forward one character, + // and change back to the label state. + scDoc.SetState(SCE_CLW_DEFAULT); + scDoc.Forward(); + scDoc.SetState(SCE_CLW_LABEL); + } + // Else check label + else { + char cLabel[512]; // Label buffer + // Buffer the current label string + scDoc.GetCurrent(cLabel,sizeof(cLabel)); + // If case insensitive, convert string to UPPERCASE to match passed keywords. + if (!bCaseSensitive) { + StringUpper(cLabel); + } + // Else if UPPERCASE label string is in the Clarion compiler keyword list + if (wlCompilerKeywords.InList(cLabel) && iColumn1Label){ + // change the label to error state + scDoc.ChangeState(SCE_CLW_COMPILER_DIRECTIVE); + } + // Else if UPPERCASE label string is in the Clarion reserved keyword list + else if (wlLabelReservedWords.InList(cLabel) && iColumn1Label){ + // change the label to error state + scDoc.ChangeState(SCE_CLW_ERROR); + } + // Else if UPPERCASE label string is + else if (wlProcLabelReservedWords.InList(cLabel) && iColumn1Label) { + char cWord[512]; // Word buffer + // Get the next word from the current position + if (GetNextWordUpper(accStyler,scDoc.currentPos,uiStartPos+iLength,cWord)) { + // If the next word is a procedure reserved word + if (wlProcReservedKeywords.InList(cWord)) { + // Change the label to error state + scDoc.ChangeState(SCE_CLW_ERROR); + } + } + } + // Else if label string is in the compiler directive keyword list + else if (wlCompilerDirectives.InList(cLabel)) { + // change the state to compiler directive state + scDoc.ChangeState(SCE_CLW_COMPILER_DIRECTIVE); + } + // Terminate the label state and set to default state + scDoc.SetState(SCE_CLW_DEFAULT); + } + } + } + // Keyword State Handling + else if (scDoc.state == SCE_CLW_KEYWORD) { + // If character is : (colon) + if (scDoc.ch == ':') { + char cEquate[512]; // Equate buffer + // Move forward to include : (colon) in buffer + scDoc.Forward(); + // Buffer the equate string + scDoc.GetCurrent(cEquate,sizeof(cEquate)); + // If case insensitive, convert string to UPPERCASE to match passed keywords. + if (!bCaseSensitive) { + StringUpper(cEquate); + } + // If statement string is in the equate list + if (wlStandardEquates.InList(cEquate)) { + // Change to equate state + scDoc.ChangeState(SCE_CLW_STANDARD_EQUATE); + } + } + // If the character is not a valid label character + else if (!IsALabelCharacter(scDoc.ch)) { + char cStatement[512]; // Statement buffer + // Buffer the statement string + scDoc.GetCurrent(cStatement,sizeof(cStatement)); + // If case insensitive, convert string to UPPERCASE to match passed keywords. + if (!bCaseSensitive) { + StringUpper(cStatement); + } + // If statement string is in the Clarion keyword list + if (wlClarionKeywords.InList(cStatement)) { + // Change the statement string to the Clarion keyword state + scDoc.ChangeState(SCE_CLW_KEYWORD); + } + // Else if statement string is in the compiler directive keyword list + else if (wlCompilerDirectives.InList(cStatement)) { + // Change the statement string to the compiler directive state + scDoc.ChangeState(SCE_CLW_COMPILER_DIRECTIVE); + } + // Else if statement string is in the runtime expressions keyword list + else if (wlRuntimeExpressions.InList(cStatement)) { + // Change the statement string to the runtime expressions state + scDoc.ChangeState(SCE_CLW_RUNTIME_EXPRESSIONS); + } + // Else if statement string is in the builtin procedures and functions keyword list + else if (wlBuiltInProcsFuncs.InList(cStatement)) { + // Change the statement string to the builtin procedures and functions state + scDoc.ChangeState(SCE_CLW_BUILTIN_PROCEDURES_FUNCTION); + } + // Else if statement string is in the tructures and data types keyword list + else if (wlStructsDataTypes.InList(cStatement)) { + // Change the statement string to the structures and data types state + scDoc.ChangeState(SCE_CLW_STRUCTURE_DATA_TYPE); + } + // Else if statement string is in the procedure attribute keyword list + else if (wlAttributes.InList(cStatement)) { + // Change the statement string to the procedure attribute state + scDoc.ChangeState(SCE_CLW_ATTRIBUTE); + } + // Else if statement string is in the standard equate keyword list + else if (wlStandardEquates.InList(cStatement)) { + // Change the statement string to the standard equate state + scDoc.ChangeState(SCE_CLW_STANDARD_EQUATE); + } + // Else if statement string is in the deprecated or legacy keyword list + else if (wlLegacyStatements.InList(cStatement)) { + // Change the statement string to the standard equate state + scDoc.ChangeState(SCE_CLW_DEPRECATED); + } + // Else the statement string doesn't match any work list + else { + // Change the statement string to the default state + scDoc.ChangeState(SCE_CLW_DEFAULT); + } + // Terminate the keyword state and set to default state + scDoc.SetState(SCE_CLW_DEFAULT); + } + } + // String State Handling + else if (scDoc.state == SCE_CLW_STRING) { + // If the character is an ' (single quote) + if (scDoc.ch == '\'') { + // Set the state to default and move forward colouring + // the ' (single quote) as default state + // terminating the string state + scDoc.SetState(SCE_CLW_DEFAULT); + scDoc.Forward(); + } + // If the next character is an ' (single quote) + if (scDoc.chNext == '\'') { + // Move forward one character and set to default state + // colouring the next ' (single quote) as default state + // terminating the string state + scDoc.ForwardSetState(SCE_CLW_DEFAULT); + scDoc.Forward(); + } + } + // Picture String State Handling + else if (scDoc.state == SCE_CLW_PICTURE_STRING) { + // If the character is an ( (open parenthese) + if (scDoc.ch == '(') { + // Increment the parenthese level + iParenthesesLevel++; + } + // Else if the character is a ) (close parenthese) + else if (scDoc.ch == ')') { + // If the parenthese level is set to zero + // parentheses matched + if (!iParenthesesLevel) { + scDoc.SetState(SCE_CLW_DEFAULT); + } + // Else parenthese level is greater than zero + // still looking for matching parentheses + else { + // Decrement the parenthese level + iParenthesesLevel--; + } + } + } + // Standard Equate State Handling + else if (scDoc.state == SCE_CLW_STANDARD_EQUATE) { + if (!isalnum(scDoc.ch)) { + scDoc.SetState(SCE_CLW_DEFAULT); + } + } + // Integer Constant State Handling + else if (scDoc.state == SCE_CLW_INTEGER_CONSTANT) { + // If the character is not a digit (0-9) + // or character is not a hexidecimal character (A-F) + // or character is not a . (point) + // or character is not a numberic base character (B,O,H) + if (!(isdigit(scDoc.ch) + || IsAHexCharacter(scDoc.ch, bCaseSensitive) + || scDoc.ch == '.' + || IsANumericBaseCharacter(scDoc.ch, bCaseSensitive))) { + // If the number was a real + if (SetNumericConstantState(scDoc)) { + // Colour the matched string to the real constant state + scDoc.ChangeState(SCE_CLW_REAL_CONSTANT); + } + // Else the number was an integer + else { + // Colour the matched string to an integer constant state + scDoc.ChangeState(SCE_CLW_INTEGER_CONSTANT); + } + // Terminate the integer constant state and set to default state + scDoc.SetState(SCE_CLW_DEFAULT); + } + } + + // + // Determine if a new state should be entered. + // + + // Beginning of Line Handling + if (scDoc.atLineStart) { + // Reset the column 1 label flag + iColumn1Label = false; + // If column 1 character is a label start character + if (IsALabelStart(scDoc.ch)) { + // Label character is found in column 1 + // so set column 1 label flag and clear last column 1 label + iColumn1Label = true; + // Set the state to label + scDoc.SetState(SCE_CLW_LABEL); + } + // else if character is a space or tab + else if (IsASpace(scDoc.ch)){ + // Set to default state + scDoc.SetState(SCE_CLW_DEFAULT); + } + // else if comment start (!) or is an * (asterisk) + else if (IsACommentStart(scDoc.ch) || scDoc.ch == '*' ) { + // then set the state to comment. + scDoc.SetState(SCE_CLW_COMMENT); + } + // else the character is a ? (question mark) + else if (scDoc.ch == '?') { + // Change to the compiler directive state, move forward, + // colouring the ? (question mark), change back to default state. + scDoc.ChangeState(SCE_CLW_COMPILER_DIRECTIVE); + scDoc.Forward(); + scDoc.SetState(SCE_CLW_DEFAULT); + } + // else an invalid character in column 1 + else { + // Set to error state + scDoc.SetState(SCE_CLW_ERROR); + } + } + // End of Line Handling + else if (scDoc.atLineEnd) { + // Reset to the default state at the end of each line. + scDoc.SetState(SCE_CLW_DEFAULT); + } + // Default Handling + else { + // If in default state + if (scDoc.state == SCE_CLW_DEFAULT) { + // If is a letter could be a possible statement + if (isalpha(scDoc.ch)) { + // Set the state to Clarion Keyword and verify later + scDoc.SetState(SCE_CLW_KEYWORD); + } + // else is a number + else if (isdigit(scDoc.ch)) { + // Set the state to Integer Constant and verify later + scDoc.SetState(SCE_CLW_INTEGER_CONSTANT); + } + // else if the start of a comment or a | (line continuation) + else if (IsACommentStart(scDoc.ch) || scDoc.ch == '|') { + // then set the state to comment. + scDoc.SetState(SCE_CLW_COMMENT); + } + // else if the character is a ' (single quote) + else if (scDoc.ch == '\'') { + // If the character is also a ' (single quote) + // Embedded Apostrophe + if (scDoc.chNext == '\'') { + // Move forward colouring it as default state + scDoc.ForwardSetState(SCE_CLW_DEFAULT); + } + else { + // move to the next character and then set the state to comment. + scDoc.ForwardSetState(SCE_CLW_STRING); + } + } + // else the character is an @ (ampersand) + else if (scDoc.ch == '@') { + // Case insensitive. + if (!bCaseSensitive) { + // If character is a valid picture token character + if (strchr("DEKNPSTdeknpst", scDoc.chNext) != NULL) { + // Set to the picture string state + scDoc.SetState(SCE_CLW_PICTURE_STRING); + } + } + // Case sensitive + else { + // If character is a valid picture token character + if (strchr("DEKNPST", scDoc.chNext) != NULL) { + // Set the picture string state + scDoc.SetState(SCE_CLW_PICTURE_STRING); + } + } + } + } + } + } + // lexing complete + scDoc.Complete(); +} + +// Clarion Language Case Sensitive Colouring Procedure +static void ColouriseClarionDocSensitive(unsigned int uiStartPos, int iLength, int iInitStyle, WordList *wlKeywords[], Accessor &accStyler) { + + ColouriseClarionDoc(uiStartPos, iLength, iInitStyle, wlKeywords, accStyler, true); +} + +// Clarion Language Case Insensitive Colouring Procedure +static void ColouriseClarionDocInsensitive(unsigned int uiStartPos, int iLength, int iInitStyle, WordList *wlKeywords[], Accessor &accStyler) { + + ColouriseClarionDoc(uiStartPos, iLength, iInitStyle, wlKeywords, accStyler, false); +} + +// Fill Buffer + +static void FillBuffer(unsigned int uiStart, unsigned int uiEnd, Accessor &accStyler, char *szBuffer, unsigned int uiLength) { + + unsigned int uiPos = 0; + + while ((uiPos < uiEnd - uiStart + 1) && (uiPos < uiLength-1)) { + szBuffer[uiPos] = static_cast(toupper(accStyler[uiStart + uiPos])); + uiPos++; + } + szBuffer[uiPos] = '\0'; +} + +// Classify Clarion Fold Point + +static int ClassifyClarionFoldPoint(int iLevel, const char* szString) { + + if (!(isdigit(szString[0]) || (szString[0] == '.'))) { + if (strcmp(szString, "PROCEDURE") == 0) { + // iLevel = SC_FOLDLEVELBASE + 1; + } + else if (strcmp(szString, "MAP") == 0 || + strcmp(szString,"ACCEPT") == 0 || + strcmp(szString,"BEGIN") == 0 || + strcmp(szString,"CASE") == 0 || + strcmp(szString,"EXECUTE") == 0 || + strcmp(szString,"IF") == 0 || + strcmp(szString,"ITEMIZE") == 0 || + strcmp(szString,"INTERFACE") == 0 || + strcmp(szString,"JOIN") == 0 || + strcmp(szString,"LOOP") == 0 || + strcmp(szString,"MODULE") == 0 || + strcmp(szString,"RECORD") == 0) { + iLevel++; + } + else if (strcmp(szString, "APPLICATION") == 0 || + strcmp(szString, "CLASS") == 0 || + strcmp(szString, "DETAIL") == 0 || + strcmp(szString, "FILE") == 0 || + strcmp(szString, "FOOTER") == 0 || + strcmp(szString, "FORM") == 0 || + strcmp(szString, "GROUP") == 0 || + strcmp(szString, "HEADER") == 0 || + strcmp(szString, "INTERFACE") == 0 || + strcmp(szString, "MENU") == 0 || + strcmp(szString, "MENUBAR") == 0 || + strcmp(szString, "OLE") == 0 || + strcmp(szString, "OPTION") == 0 || + strcmp(szString, "QUEUE") == 0 || + strcmp(szString, "REPORT") == 0 || + strcmp(szString, "SHEET") == 0 || + strcmp(szString, "TAB") == 0 || + strcmp(szString, "TOOLBAR") == 0 || + strcmp(szString, "VIEW") == 0 || + strcmp(szString, "WINDOW") == 0) { + iLevel++; + } + else if (strcmp(szString, "END") == 0 || + strcmp(szString, "UNTIL") == 0 || + strcmp(szString, "WHILE") == 0) { + iLevel--; + } + } + return(iLevel); +} + +// Clarion Language Folding Procedure +static void FoldClarionDoc(unsigned int uiStartPos, int iLength, int iInitStyle, WordList *[], Accessor &accStyler) { + + unsigned int uiEndPos = uiStartPos + iLength; + int iLineCurrent = accStyler.GetLine(uiStartPos); + int iLevelPrev = accStyler.LevelAt(iLineCurrent) & SC_FOLDLEVELNUMBERMASK; + int iLevelCurrent = iLevelPrev; + char chNext = accStyler[uiStartPos]; + int iStyle = iInitStyle; + int iStyleNext = accStyler.StyleAt(uiStartPos); + int iVisibleChars = 0; + int iLastStart = 0; + + for (unsigned int uiPos = uiStartPos; uiPos < uiEndPos; uiPos++) { + + char chChar = chNext; + chNext = accStyler.SafeGetCharAt(uiPos + 1); + int iStylePrev = iStyle; + iStyle = iStyleNext; + iStyleNext = accStyler.StyleAt(uiPos + 1); + bool bEOL = (chChar == '\r' && chNext != '\n') || (chChar == '\n'); + + if (iStylePrev == SCE_CLW_DEFAULT) { + if (iStyle == SCE_CLW_KEYWORD || iStyle == SCE_CLW_STRUCTURE_DATA_TYPE) { + // Store last word start point. + iLastStart = uiPos; + } + } + + if (iStylePrev == SCE_CLW_KEYWORD || iStylePrev == SCE_CLW_STRUCTURE_DATA_TYPE) { + if(iswordchar(chChar) && !iswordchar(chNext)) { + char chBuffer[100]; + FillBuffer(iLastStart, uiPos, accStyler, chBuffer, sizeof(chBuffer)); + iLevelCurrent = ClassifyClarionFoldPoint(iLevelCurrent,chBuffer); + // if ((iLevelCurrent == SC_FOLDLEVELBASE + 1) && iLineCurrent > 1) { + // accStyler.SetLevel(iLineCurrent-1,SC_FOLDLEVELBASE); + // iLevelPrev = SC_FOLDLEVELBASE; + // } + } + } + + if (bEOL) { + int iLevel = iLevelPrev; + if ((iLevelCurrent > iLevelPrev) && (iVisibleChars > 0)) + iLevel |= SC_FOLDLEVELHEADERFLAG; + if (iLevel != accStyler.LevelAt(iLineCurrent)) { + accStyler.SetLevel(iLineCurrent,iLevel); + } + iLineCurrent++; + iLevelPrev = iLevelCurrent; + iVisibleChars = 0; + } + + if (!isspacechar(chChar)) + iVisibleChars++; + } + + // Fill in the real level of the next line, keeping the current flags + // as they will be filled in later. + int iFlagsNext = accStyler.LevelAt(iLineCurrent) & ~SC_FOLDLEVELNUMBERMASK; + accStyler.SetLevel(iLineCurrent, iLevelPrev | iFlagsNext); +} + +// Word List Descriptions +static const char * const rgWordListDescriptions[] = { + "Clarion Keywords", + "Compiler Directives", + "Built-in Procedures and Functions", + "Runtime Expressions", + "Structure and Data Types", + "Attributes", + "Standard Equates", + "Reserved Words (Labels)", + "Reserved Words (Procedure Labels)", + 0, +}; + +// Case Sensitive Clarion Language Lexer +LexerModule lmClw(SCLEX_CLW, ColouriseClarionDocSensitive, "clarion", FoldClarionDoc, rgWordListDescriptions); + +// Case Insensitive Clarion Language Lexer +LexerModule lmClwNoCase(SCLEX_CLWNOCASE, ColouriseClarionDocInsensitive, "clarionnocase", FoldClarionDoc, rgWordListDescriptions); diff --git a/src/LexCPP.cpp b/src/LexCPP.cpp new file mode 100755 index 0000000..1db0c7c --- /dev/null +++ b/src/LexCPP.cpp @@ -0,0 +1,489 @@ +// Scintilla source code edit control +/** @file LexCPP.cxx + ** Lexer for C++, C, Java, and JavaScript. + **/ +// Copyright 1998-2005 by Neil Hodgson +// The License.txt file describes the conditions under which this software may be distributed. + +#include +#include +#include +#include +#include + +#include "Platform.h" + +#include "PropSet.h" +#include "Accessor.h" +#include "StyleContext.h" +#include "KeyWords.h" +#include "Scintilla.h" +#include "SciLexer.h" + +#define SET_LOWER "abcdefghijklmnopqrstuvwxyz" +#define SET_UPPER "ABCDEFGHIJKLMNOPQRSTUVWXYZ" +#define SET_DIGITS "0123456789" + +class SetOfCharacters { + int size; + bool valueAfter; + bool *bset; +public: + SetOfCharacters(const char *setOfCharacters, int size_=0x80, bool valueAfter_=false) { + size = size_; + valueAfter = valueAfter_; + bset = new bool[size]; + for (int i=0; i < size; i++) { + bset[i] = false; + } + for (const char *cp=setOfCharacters; *cp; cp++) { + int val = static_cast(*cp); + PLATFORM_ASSERT(val >= 0); + PLATFORM_ASSERT(val < size); + bset[val] = true; + } + } + ~SetOfCharacters() { + delete []bset; + bset = 0; + size = 0; + } + void Add(int val) { + PLATFORM_ASSERT(val >= 0); + PLATFORM_ASSERT(val < size); + bset[val] = true; + } + bool Contains(int val) { + PLATFORM_ASSERT(val >= 0); + return (val < size) ? bset[val] : valueAfter; + } +}; + +static bool IsSpaceEquiv(int state) { + return (state <= SCE_C_COMMENTDOC) || + // including SCE_C_DEFAULT, SCE_C_COMMENT, SCE_C_COMMENTLINE + (state == SCE_C_COMMENTLINEDOC) || (state == SCE_C_COMMENTDOCKEYWORD) || + (state == SCE_C_COMMENTDOCKEYWORDERROR); +} + +static void ColouriseCppDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[], + Accessor &styler, bool caseSensitive) { + + WordList &keywords = *keywordlists[0]; + WordList &keywords2 = *keywordlists[1]; + WordList &keywords3 = *keywordlists[2]; + WordList &keywords4 = *keywordlists[3]; + + bool stylingWithinPreprocessor = styler.GetPropertyInt("styling.within.preprocessor") != 0; + + SetOfCharacters setOKBeforeRE("(=,"); + + SetOfCharacters setDoxygen("$@\\&<>#{}[]" SET_LOWER); + + SetOfCharacters setWordStart("_" SET_LOWER SET_UPPER, 0x80, true); + SetOfCharacters setWord("._" SET_LOWER SET_UPPER SET_DIGITS, 0x80, true); + if (styler.GetPropertyInt("lexer.cpp.allow.dollars", 1) != 0) { + setWordStart.Add('$'); + setWord.Add('$'); + } + + int chPrevNonWhite = ' '; + int visibleChars = 0; + bool lastWordWasUUID = false; + int styleBeforeDCKeyword = SCE_C_DEFAULT; + bool continuationLine = false; + + if (initStyle == SCE_C_PREPROCESSOR) { + // Set continuationLine if last character of previous line is '\' + int lineCurrent = styler.GetLine(startPos); + if (lineCurrent > 0) { + int chBack = styler.SafeGetCharAt(startPos-1, 0); + int chBack2 = styler.SafeGetCharAt(startPos-2, 0); + int lineEndChar = '!'; + if (chBack2 == '\r' && chBack == '\n') { + lineEndChar = styler.SafeGetCharAt(startPos-3, 0); + } else if (chBack == '\n' || chBack == '\r') { + lineEndChar = chBack2; + } + continuationLine = lineEndChar == '\\'; + } + } + + // look back to set chPrevNonWhite properly for better regex colouring + if (startPos > 0) { + int back = startPos; + while (--back && IsSpaceEquiv(styler.StyleAt(back))) + ; + if (styler.StyleAt(back) == SCE_C_OPERATOR) { + chPrevNonWhite = styler.SafeGetCharAt(back); + } + } + + StyleContext sc(startPos, length, initStyle, styler); + + for (; sc.More(); sc.Forward()) { + + if (sc.atLineStart) { + if (sc.state == SCE_C_STRING) { + // Prevent SCE_C_STRINGEOL from leaking back to previous line which + // ends with a line continuation by locking in the state upto this position. + sc.SetState(SCE_C_STRING); + } + // Reset states to begining of colourise so no surprises + // if different sets of lines lexed. + visibleChars = 0; + lastWordWasUUID = false; + } + + // Handle line continuation generically. + if (sc.ch == '\\') { + if (sc.chNext == '\n' || sc.chNext == '\r') { + sc.Forward(); + if (sc.ch == '\r' && sc.chNext == '\n') { + sc.Forward(); + } + continuationLine = true; + continue; + } + } + + // Determine if the current state should terminate. + switch (sc.state) { + case SCE_C_OPERATOR: + sc.SetState(SCE_C_DEFAULT); + break; + case SCE_C_NUMBER: + // We accept almost anything because of hex. and number suffixes + if (!setWord.Contains(sc.ch)) { + sc.SetState(SCE_C_DEFAULT); + } + break; + case SCE_C_IDENTIFIER: + if (!setWord.Contains(sc.ch) || (sc.ch == '.')) { + char s[1000]; + if (caseSensitive) { + sc.GetCurrent(s, sizeof(s)); + } else { + sc.GetCurrentLowered(s, sizeof(s)); + } + if (keywords.InList(s)) { + lastWordWasUUID = strcmp(s, "uuid") == 0; + sc.ChangeState(SCE_C_WORD); + } else if (keywords2.InList(s)) { + sc.ChangeState(SCE_C_WORD2); + } else if (keywords4.InList(s)) { + sc.ChangeState(SCE_C_GLOBALCLASS); + } + sc.SetState(SCE_C_DEFAULT); + } + break; + case SCE_C_PREPROCESSOR: + if (sc.atLineStart && !continuationLine) { + sc.SetState(SCE_C_DEFAULT); + } else if (stylingWithinPreprocessor) { + if (IsASpace(sc.ch)) { + sc.SetState(SCE_C_DEFAULT); + } + } else { + if (sc.Match('/', '*') || sc.Match('/', '/')) { + sc.SetState(SCE_C_DEFAULT); + } + } + break; + case SCE_C_COMMENT: + if (sc.Match('*', '/')) { + sc.Forward(); + sc.ForwardSetState(SCE_C_DEFAULT); + } + break; + case SCE_C_COMMENTDOC: + if (sc.Match('*', '/')) { + sc.Forward(); + sc.ForwardSetState(SCE_C_DEFAULT); + } else if (sc.ch == '@' || sc.ch == '\\') { // JavaDoc and Doxygen support + // Verify that we have the conditions to mark a comment-doc-keyword + if ((IsASpace(sc.chPrev) || sc.chPrev == '*') && (!IsASpace(sc.chNext))) { + styleBeforeDCKeyword = SCE_C_COMMENTDOC; + sc.SetState(SCE_C_COMMENTDOCKEYWORD); + } + } + break; + case SCE_C_COMMENTLINE: + if (sc.atLineStart) { + sc.SetState(SCE_C_DEFAULT); + } + break; + case SCE_C_COMMENTLINEDOC: + if (sc.atLineStart) { + sc.SetState(SCE_C_DEFAULT); + } else if (sc.ch == '@' || sc.ch == '\\') { // JavaDoc and Doxygen support + // Verify that we have the conditions to mark a comment-doc-keyword + if ((IsASpace(sc.chPrev) || sc.chPrev == '/' || sc.chPrev == '!') && (!IsASpace(sc.chNext))) { + styleBeforeDCKeyword = SCE_C_COMMENTLINEDOC; + sc.SetState(SCE_C_COMMENTDOCKEYWORD); + } + } + break; + case SCE_C_COMMENTDOCKEYWORD: + if ((styleBeforeDCKeyword == SCE_C_COMMENTDOC) && sc.Match('*', '/')) { + sc.ChangeState(SCE_C_COMMENTDOCKEYWORDERROR); + sc.Forward(); + sc.ForwardSetState(SCE_C_DEFAULT); + } else if (!setDoxygen.Contains(sc.ch)) { + char s[100]; + if (caseSensitive) { + sc.GetCurrent(s, sizeof(s)); + } else { + sc.GetCurrentLowered(s, sizeof(s)); + } + if (!IsASpace(sc.ch) || !keywords3.InList(s + 1)) { + sc.ChangeState(SCE_C_COMMENTDOCKEYWORDERROR); + } + sc.SetState(styleBeforeDCKeyword); + } + break; + case SCE_C_STRING: + if (sc.atLineEnd) { + sc.ChangeState(SCE_C_STRINGEOL); + } else if (sc.ch == '\\') { + if (sc.chNext == '\"' || sc.chNext == '\'' || sc.chNext == '\\') { + sc.Forward(); + } + } else if (sc.ch == '\"') { + sc.ForwardSetState(SCE_C_DEFAULT); + } + break; + case SCE_C_CHARACTER: + if (sc.atLineEnd) { + sc.ChangeState(SCE_C_STRINGEOL); + } else if (sc.ch == '\\') { + if (sc.chNext == '\"' || sc.chNext == '\'' || sc.chNext == '\\') { + sc.Forward(); + } + } else if (sc.ch == '\'') { + sc.ForwardSetState(SCE_C_DEFAULT); + } + break; + case SCE_C_REGEX: + if (sc.atLineStart) { + sc.SetState(SCE_C_DEFAULT); + } else if (sc.ch == '/') { + sc.Forward(); + while ((sc.ch < 0x80) && islower(sc.ch)) + sc.Forward(); // gobble regex flags + sc.SetState(SCE_C_DEFAULT); + } else if (sc.ch == '\\') { + // Gobble up the quoted character + if (sc.chNext == '\\' || sc.chNext == '/') { + sc.Forward(); + } + } + break; + case SCE_C_STRINGEOL: + if (sc.atLineStart) { + sc.SetState(SCE_C_DEFAULT); + } + break; + case SCE_C_VERBATIM: + if (sc.ch == '\"') { + if (sc.chNext == '\"') { + sc.Forward(); + } else { + sc.ForwardSetState(SCE_C_DEFAULT); + } + } + break; + case SCE_C_UUID: + if (sc.ch == '\r' || sc.ch == '\n' || sc.ch == ')') { + sc.SetState(SCE_C_DEFAULT); + } + } + + // Determine if a new state should be entered. + if (sc.state == SCE_C_DEFAULT) { + if (sc.Match('@', '\"')) { + sc.SetState(SCE_C_VERBATIM); + sc.Forward(); + } else if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext))) { + if (lastWordWasUUID) { + sc.SetState(SCE_C_UUID); + lastWordWasUUID = false; + } else { + sc.SetState(SCE_C_NUMBER); + } + } else if (setWordStart.Contains(sc.ch) || (sc.ch == '@')) { + if (lastWordWasUUID) { + sc.SetState(SCE_C_UUID); + lastWordWasUUID = false; + } else { + sc.SetState(SCE_C_IDENTIFIER); + } + } else if (sc.Match('/', '*')) { + if (sc.Match("/**") || sc.Match("/*!")) { // Support of Qt/Doxygen doc. style + sc.SetState(SCE_C_COMMENTDOC); + } else { + sc.SetState(SCE_C_COMMENT); + } + sc.Forward(); // Eat the * so it isn't used for the end of the comment + } else if (sc.Match('/', '/')) { + if ((sc.Match("///") && !sc.Match("////")) || sc.Match("//!")) + // Support of Qt/Doxygen doc. style + sc.SetState(SCE_C_COMMENTLINEDOC); + else + sc.SetState(SCE_C_COMMENTLINE); + } else if (sc.ch == '/' && setOKBeforeRE.Contains(chPrevNonWhite)) { + sc.SetState(SCE_C_REGEX); // JavaScript's RegEx + } else if (sc.ch == '\"') { + sc.SetState(SCE_C_STRING); + } else if (sc.ch == '\'') { + sc.SetState(SCE_C_CHARACTER); + } else if (sc.ch == '#' && visibleChars == 0) { + // Preprocessor commands are alone on their line + sc.SetState(SCE_C_PREPROCESSOR); + // Skip whitespace between # and preprocessor word + do { + sc.Forward(); + } while ((sc.ch == ' ' || sc.ch == '\t') && sc.More()); + if (sc.atLineEnd) { + sc.SetState(SCE_C_DEFAULT); + } + } else if (isoperator(static_cast(sc.ch))) { + sc.SetState(SCE_C_OPERATOR); + } + } + + if (!IsASpace(sc.ch) && !IsSpaceEquiv(sc.state)) { + chPrevNonWhite = sc.ch; + visibleChars++; + } + continuationLine = false; + } + sc.Complete(); +} + +static bool IsStreamCommentStyle(int style) { + return style == SCE_C_COMMENT || + style == SCE_C_COMMENTDOC || + style == SCE_C_COMMENTDOCKEYWORD || + style == SCE_C_COMMENTDOCKEYWORDERROR; +} + +// Store both the current line's fold level and the next lines in the +// level store to make it easy to pick up with each increment +// and to make it possible to fiddle the current level for "} else {". +static void FoldNoBoxCppDoc(unsigned int startPos, int length, int initStyle, + Accessor &styler) { + bool foldComment = styler.GetPropertyInt("fold.comment") != 0; + bool foldPreprocessor = styler.GetPropertyInt("fold.preprocessor") != 0; + bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0; + bool foldAtElse = styler.GetPropertyInt("fold.at.else", 0) != 0; + unsigned int endPos = startPos + length; + int visibleChars = 0; + int lineCurrent = styler.GetLine(startPos); + int levelCurrent = SC_FOLDLEVELBASE; + if (lineCurrent > 0) + levelCurrent = styler.LevelAt(lineCurrent-1) >> 16; + int levelMinCurrent = levelCurrent; + int levelNext = levelCurrent; + char chNext = styler[startPos]; + int styleNext = styler.StyleAt(startPos); + int style = initStyle; + for (unsigned int i = startPos; i < endPos; i++) { + char ch = chNext; + chNext = styler.SafeGetCharAt(i + 1); + int stylePrev = style; + style = styleNext; + styleNext = styler.StyleAt(i + 1); + bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n'); + if (foldComment && IsStreamCommentStyle(style)) { + if (!IsStreamCommentStyle(stylePrev)) { + levelNext++; + } else if (!IsStreamCommentStyle(styleNext) && !atEOL) { + // Comments don't end at end of line and the next character may be unstyled. + levelNext--; + } + } + if (foldComment && (style == SCE_C_COMMENTLINE)) { + if ((ch == '/') && (chNext == '/')) { + char chNext2 = styler.SafeGetCharAt(i + 2); + if (chNext2 == '{') { + levelNext++; + } else if (chNext2 == '}') { + levelNext--; + } + } + } + if (foldPreprocessor && (style == SCE_C_PREPROCESSOR)) { + if (ch == '#') { + unsigned int j = i + 1; + while ((j < endPos) && IsASpaceOrTab(styler.SafeGetCharAt(j))) { + j++; + } + if (styler.Match(j, "region") || styler.Match(j, "if")) { + levelNext++; + } else if (styler.Match(j, "end")) { + levelNext--; + } + } + } + if (style == SCE_C_OPERATOR) { + if (ch == '{') { + // Measure the minimum before a '{' to allow + // folding on "} else {" + if (levelMinCurrent > levelNext) { + levelMinCurrent = levelNext; + } + levelNext++; + } else if (ch == '}') { + levelNext--; + } + } + if (atEOL) { + int levelUse = levelCurrent; + if (foldAtElse) { + levelUse = levelMinCurrent; + } + int lev = levelUse | levelNext << 16; + if (visibleChars == 0 && foldCompact) + lev |= SC_FOLDLEVELWHITEFLAG; + if (levelUse < levelNext) + lev |= SC_FOLDLEVELHEADERFLAG; + if (lev != styler.LevelAt(lineCurrent)) { + styler.SetLevel(lineCurrent, lev); + } + lineCurrent++; + levelCurrent = levelNext; + levelMinCurrent = levelCurrent; + visibleChars = 0; + } + if (!IsASpace(ch)) + visibleChars++; + } +} + +static void FoldCppDoc(unsigned int startPos, int length, int initStyle, WordList *[], + Accessor &styler) { + FoldNoBoxCppDoc(startPos, length, initStyle, styler); +} + +static const char * const cppWordLists[] = { + "Primary keywords and identifiers", + "Secondary keywords and identifiers", + "Documentation comment keywords", + "Unused", + "Global classes and typedefs", + 0, + }; + +static void ColouriseCppDocSensitive(unsigned int startPos, int length, int initStyle, WordList *keywordlists[], + Accessor &styler) { + ColouriseCppDoc(startPos, length, initStyle, keywordlists, styler, true); +} + +static void ColouriseCppDocInsensitive(unsigned int startPos, int length, int initStyle, WordList *keywordlists[], + Accessor &styler) { + ColouriseCppDoc(startPos, length, initStyle, keywordlists, styler, false); +} + +LexerModule lmCPP(SCLEX_CPP, ColouriseCppDocSensitive, "cpp", FoldCppDoc, cppWordLists); +LexerModule lmCPPNoCase(SCLEX_CPPNOCASE, ColouriseCppDocInsensitive, "cppnocase", FoldCppDoc, cppWordLists); diff --git a/src/LexCSS.cpp b/src/LexCSS.cpp new file mode 100755 index 0000000..963a7b3 --- /dev/null +++ b/src/LexCSS.cpp @@ -0,0 +1,303 @@ +// Scintilla source code edit control +/** @file LexCSS.cxx + ** Lexer for Cascading Style Sheets + ** Written by Jakub Vrána + ** Improved by Philippe Lhoste (CSS2) + **/ +// Copyright 1998-2002 by Neil Hodgson +// The License.txt file describes the conditions under which this software may be distributed. + +#include +#include +#include +#include +#include + +#include "Platform.h" + +#include "PropSet.h" +#include "Accessor.h" +#include "StyleContext.h" +#include "KeyWords.h" +#include "Scintilla.h" +#include "SciLexer.h" + + +static inline bool IsAWordChar(const unsigned int ch) { + return (isalnum(ch) || ch == '-' || ch == '_' || ch >= 161); // _ is not in fact correct CSS word-character +} + +inline bool IsCssOperator(const char ch) { + if (!isalnum(ch) && + (ch == '{' || ch == '}' || ch == ':' || ch == ',' || ch == ';' || + ch == '.' || ch == '#' || ch == '!' || ch == '@' || + /* CSS2 */ + ch == '*' || ch == '>' || ch == '+' || ch == '=' || ch == '~' || ch == '|' || + ch == '[' || ch == ']' || ch == '(' || ch == ')')) { + return true; + } + return false; +} + +static void ColouriseCssDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[], Accessor &styler) { + WordList &keywords = *keywordlists[0]; + WordList &pseudoClasses = *keywordlists[1]; + WordList &keywords2 = *keywordlists[2]; + + StyleContext sc(startPos, length, initStyle, styler); + + int lastState = -1; // before operator + int lastStateC = -1; // before comment + int op = ' '; // last operator + + for (; sc.More(); sc.Forward()) { + if (sc.state == SCE_CSS_COMMENT && sc.Match('*', '/')) { + if (lastStateC == -1) { + // backtrack to get last state: + // comments are like whitespace, so we must return to the previous state + unsigned int i = startPos; + for (; i > 0; i--) { + if ((lastStateC = styler.StyleAt(i-1)) != SCE_CSS_COMMENT) { + if (lastStateC == SCE_CSS_OPERATOR) { + op = styler.SafeGetCharAt(i-1); + while (--i) { + lastState = styler.StyleAt(i-1); + if (lastState != SCE_CSS_OPERATOR && lastState != SCE_CSS_COMMENT) + break; + } + if (i == 0) + lastState = SCE_CSS_DEFAULT; + } + break; + } + } + if (i == 0) + lastStateC = SCE_CSS_DEFAULT; + } + sc.Forward(); + sc.ForwardSetState(lastStateC); + } + + if (sc.state == SCE_CSS_COMMENT) + continue; + + if (sc.state == SCE_CSS_DOUBLESTRING || sc.state == SCE_CSS_SINGLESTRING) { + if (sc.ch != (sc.state == SCE_CSS_DOUBLESTRING ? '\"' : '\'')) + continue; + unsigned int i = sc.currentPos; + while (i && styler[i-1] == '\\') + i--; + if ((sc.currentPos - i) % 2 == 1) + continue; + sc.ForwardSetState(SCE_CSS_VALUE); + } + + if (sc.state == SCE_CSS_OPERATOR) { + if (op == ' ') { + unsigned int i = startPos; + op = styler.SafeGetCharAt(i-1); + while (--i) { + lastState = styler.StyleAt(i-1); + if (lastState != SCE_CSS_OPERATOR && lastState != SCE_CSS_COMMENT) + break; + } + } + switch (op) { + case '@': + if (lastState == SCE_CSS_DEFAULT) + sc.SetState(SCE_CSS_DIRECTIVE); + break; + case '*': + if (lastState == SCE_CSS_DEFAULT) + sc.SetState(SCE_CSS_TAG); + break; + case '>': + case '+': + if (lastState == SCE_CSS_TAG || lastState == SCE_CSS_PSEUDOCLASS || lastState == SCE_CSS_CLASS + || lastState == SCE_CSS_ID || lastState == SCE_CSS_UNKNOWN_PSEUDOCLASS) + sc.SetState(SCE_CSS_DEFAULT); + break; + case '[': + if (lastState == SCE_CSS_TAG || lastState == SCE_CSS_PSEUDOCLASS || lastState == SCE_CSS_DEFAULT || + lastState == SCE_CSS_CLASS || lastState == SCE_CSS_ID || lastState == SCE_CSS_UNKNOWN_PSEUDOCLASS) + sc.SetState(SCE_CSS_ATTRIBUTE); + break; + case ']': + if (lastState == SCE_CSS_ATTRIBUTE) + sc.SetState(SCE_CSS_TAG); + break; + case '{': + if (lastState == SCE_CSS_DIRECTIVE) + sc.SetState(SCE_CSS_DEFAULT); + else if (lastState == SCE_CSS_TAG) + sc.SetState(SCE_CSS_IDENTIFIER); + break; + case '}': + if (lastState == SCE_CSS_DEFAULT || lastState == SCE_CSS_VALUE || lastState == SCE_CSS_IMPORTANT || + lastState == SCE_CSS_IDENTIFIER || lastState == SCE_CSS_IDENTIFIER2) + sc.SetState(SCE_CSS_DEFAULT); + break; + case ':': + if (lastState == SCE_CSS_TAG || lastState == SCE_CSS_PSEUDOCLASS || lastState == SCE_CSS_DEFAULT || + lastState == SCE_CSS_CLASS || lastState == SCE_CSS_ID || lastState == SCE_CSS_UNKNOWN_PSEUDOCLASS) + sc.SetState(SCE_CSS_PSEUDOCLASS); + else if (lastState == SCE_CSS_IDENTIFIER || lastState == SCE_CSS_IDENTIFIER2 || lastState == SCE_CSS_UNKNOWN_IDENTIFIER) + sc.SetState(SCE_CSS_VALUE); + break; + case '.': + if (lastState == SCE_CSS_TAG || lastState == SCE_CSS_PSEUDOCLASS || lastState == SCE_CSS_DEFAULT || + lastState == SCE_CSS_CLASS || lastState == SCE_CSS_ID || lastState == SCE_CSS_UNKNOWN_PSEUDOCLASS) + sc.SetState(SCE_CSS_CLASS); + break; + case '#': + if (lastState == SCE_CSS_TAG || lastState == SCE_CSS_PSEUDOCLASS || lastState == SCE_CSS_DEFAULT || + lastState == SCE_CSS_CLASS || lastState == SCE_CSS_ID || lastState == SCE_CSS_UNKNOWN_PSEUDOCLASS) + sc.SetState(SCE_CSS_ID); + break; + case ',': + if (lastState == SCE_CSS_TAG) + sc.SetState(SCE_CSS_DEFAULT); + break; + case ';': + if (lastState == SCE_CSS_DIRECTIVE) + sc.SetState(SCE_CSS_DEFAULT); + else if (lastState == SCE_CSS_VALUE || lastState == SCE_CSS_IMPORTANT) + sc.SetState(SCE_CSS_IDENTIFIER); + break; + case '!': + if (lastState == SCE_CSS_VALUE) + sc.SetState(SCE_CSS_IMPORTANT); + break; + } + } + + if (IsAWordChar(sc.ch)) { + if (sc.state == SCE_CSS_DEFAULT) + sc.SetState(SCE_CSS_TAG); + continue; + } + + if (IsAWordChar(sc.chPrev) && ( + sc.state == SCE_CSS_IDENTIFIER || sc.state == SCE_CSS_IDENTIFIER2 + || sc.state == SCE_CSS_UNKNOWN_IDENTIFIER + || sc.state == SCE_CSS_PSEUDOCLASS || sc.state == SCE_CSS_UNKNOWN_PSEUDOCLASS + || sc.state == SCE_CSS_IMPORTANT + )) { + char s[100]; + sc.GetCurrentLowered(s, sizeof(s)); + char *s2 = s; + while (*s2 && !IsAWordChar(*s2)) + s2++; + switch (sc.state) { + case SCE_CSS_IDENTIFIER: + if (!keywords.InList(s2)) { + if (keywords2.InList(s2)) { + sc.ChangeState(SCE_CSS_IDENTIFIER2); + } else { + sc.ChangeState(SCE_CSS_UNKNOWN_IDENTIFIER); + } + } + break; + case SCE_CSS_UNKNOWN_IDENTIFIER: + if (keywords.InList(s2)) + sc.ChangeState(SCE_CSS_IDENTIFIER); + else if (keywords2.InList(s2)) + sc.ChangeState(SCE_CSS_IDENTIFIER2); + break; + case SCE_CSS_PSEUDOCLASS: + if (!pseudoClasses.InList(s2)) + sc.ChangeState(SCE_CSS_UNKNOWN_PSEUDOCLASS); + break; + case SCE_CSS_UNKNOWN_PSEUDOCLASS: + if (pseudoClasses.InList(s2)) + sc.ChangeState(SCE_CSS_PSEUDOCLASS); + break; + case SCE_CSS_IMPORTANT: + if (strcmp(s2, "important") != 0) + sc.ChangeState(SCE_CSS_VALUE); + break; + } + } + + if (sc.ch != '.' && sc.ch != ':' && sc.ch != '#' && (sc.state == SCE_CSS_CLASS || sc.state == SCE_CSS_PSEUDOCLASS || sc.state == SCE_CSS_UNKNOWN_PSEUDOCLASS || sc.state == SCE_CSS_ID)) + sc.SetState(SCE_CSS_TAG); + + if (sc.Match('/', '*')) { + lastStateC = sc.state; + sc.SetState(SCE_CSS_COMMENT); + sc.Forward(); + } else if (sc.state == SCE_CSS_VALUE && (sc.ch == '\"' || sc.ch == '\'')) { + sc.SetState((sc.ch == '\"' ? SCE_CSS_DOUBLESTRING : SCE_CSS_SINGLESTRING)); + } else if (IsCssOperator(static_cast(sc.ch)) + && (sc.state != SCE_CSS_ATTRIBUTE || sc.ch == ']') + && (sc.state != SCE_CSS_VALUE || sc.ch == ';' || sc.ch == '}' || sc.ch == '!') + && (sc.state != SCE_CSS_DIRECTIVE || sc.ch == ';' || sc.ch == '{') + ) { + if (sc.state != SCE_CSS_OPERATOR) + lastState = sc.state; + sc.SetState(SCE_CSS_OPERATOR); + op = sc.ch; + } + } + + sc.Complete(); +} + +static void FoldCSSDoc(unsigned int startPos, int length, int, WordList *[], Accessor &styler) { + bool foldComment = styler.GetPropertyInt("fold.comment") != 0; + bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0; + unsigned int endPos = startPos + length; + int visibleChars = 0; + int lineCurrent = styler.GetLine(startPos); + int levelPrev = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK; + int levelCurrent = levelPrev; + char chNext = styler[startPos]; + bool inComment = (styler.StyleAt(startPos-1) == SCE_CSS_COMMENT); + for (unsigned int i = startPos; i < endPos; i++) { + char ch = chNext; + chNext = styler.SafeGetCharAt(i + 1); + int style = styler.StyleAt(i); + bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n'); + if (foldComment) { + if (!inComment && (style == SCE_CSS_COMMENT)) + levelCurrent++; + else if (inComment && (style != SCE_CSS_COMMENT)) + levelCurrent--; + inComment = (style == SCE_CSS_COMMENT); + } + if (style == SCE_CSS_OPERATOR) { + if (ch == '{') { + levelCurrent++; + } else if (ch == '}') { + levelCurrent--; + } + } + if (atEOL) { + int lev = levelPrev; + if (visibleChars == 0 && foldCompact) + lev |= SC_FOLDLEVELWHITEFLAG; + if ((levelCurrent > levelPrev) && (visibleChars > 0)) + lev |= SC_FOLDLEVELHEADERFLAG; + if (lev != styler.LevelAt(lineCurrent)) { + styler.SetLevel(lineCurrent, lev); + } + lineCurrent++; + levelPrev = levelCurrent; + visibleChars = 0; + } + if (!isspacechar(ch)) + visibleChars++; + } + // Fill in the real level of the next line, keeping the current flags as they will be filled in later + int flagsNext = styler.LevelAt(lineCurrent) & ~SC_FOLDLEVELNUMBERMASK; + styler.SetLevel(lineCurrent, levelPrev | flagsNext); +} + +static const char * const cssWordListDesc[] = { + "CSS1 Keywords", + "Pseudo classes", + "CSS2 Keywords", + 0 +}; + +LexerModule lmCss(SCLEX_CSS, ColouriseCssDoc, "css", FoldCSSDoc, cssWordListDesc); diff --git a/src/LexCaml.cpp b/src/LexCaml.cpp new file mode 100644 index 0000000..5f4fad5 --- /dev/null +++ b/src/LexCaml.cpp @@ -0,0 +1,399 @@ +// Scintilla source code edit control +/** @file LexCaml.cxx + ** Lexer for Objective Caml. + **/ +// Copyright 2005 by Robert Roessler +// The License.txt file describes the conditions under which this software may be distributed. +/* Release History + 20050204 Initial release. + 20050205 Quick compiler standards/"cleanliness" adjustment. + 20050206 Added cast for IsLeadByte(). + 20050209 Changes to "external" build support. + 20050306 Fix for 1st-char-in-doc "corner" case. + 20050502 Fix for [harmless] one-past-the-end coloring. + 20050515 Refined numeric token recognition logic. + 20051125 Added 2nd "optional" keywords class. + 20051129 Support "magic" (read-only) comments for RCaml. + 20051204 Swtich to using StyleContext infrastructure. +*/ + +#include +#include +#include +#include +#include + +#include "Platform.h" + +#include "PropSet.h" +#include "Accessor.h" +#include "StyleContext.h" +#include "KeyWords.h" +#include "Scintilla.h" +#include "SciLexer.h" + +// Since the Microsoft __iscsym[f] funcs are not ANSI... +inline int iscaml(int c) {return isalnum(c) || c == '_';} +inline int iscamlf(int c) {return isalpha(c) || c == '_';} +inline int iscamld(int c) {return isdigit(c) || c == '_';} + +static const int baseT[24] = { + 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* A - L */ + 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0,16 /* M - X */ +}; + +#ifdef BUILD_AS_EXTERNAL_LEXER +/* + (actually seems to work!) +*/ +#include "WindowAccessor.h" +#include "ExternalLexer.h" + +#if PLAT_WIN +#include +#endif + +static void ColouriseCamlDoc( + unsigned int startPos, int length, + int initStyle, + WordList *keywordlists[], + Accessor &styler); + +static void FoldCamlDoc( + unsigned int startPos, int length, + int initStyle, + WordList *keywordlists[], + Accessor &styler); + +static void InternalLexOrFold(int lexOrFold, unsigned int startPos, int length, + int initStyle, char *words[], WindowID window, char *props); + +static const char* LexerName = "caml"; + +#ifdef TRACE +void Platform::DebugPrintf(const char *format, ...) { + char buffer[2000]; + va_list pArguments; + va_start(pArguments, format); + vsprintf(buffer,format,pArguments); + va_end(pArguments); + Platform::DebugDisplay(buffer); +} +#else +void Platform::DebugPrintf(const char *, ...) { +} +#endif + +bool Platform::IsDBCSLeadByte(int codePage, char ch) { + return ::IsDBCSLeadByteEx(codePage, ch) != 0; +} + +long Platform::SendScintilla(WindowID w, unsigned int msg, unsigned long wParam, long lParam) { + return ::SendMessage(reinterpret_cast(w), msg, wParam, lParam); +} + +long Platform::SendScintillaPointer(WindowID w, unsigned int msg, unsigned long wParam, void *lParam) { + return ::SendMessage(reinterpret_cast(w), msg, wParam, + reinterpret_cast(lParam)); +} + +void EXT_LEXER_DECL Fold(unsigned int lexer, unsigned int startPos, int length, + int initStyle, char *words[], WindowID window, char *props) +{ + // below useless evaluation(s) to supress "not used" warnings + lexer; + // build expected data structures and do the Fold + InternalLexOrFold(1, startPos, length, initStyle, words, window, props); + +} + +int EXT_LEXER_DECL GetLexerCount() +{ + return 1; // just us [Objective] Caml lexers here! +} + +void EXT_LEXER_DECL GetLexerName(unsigned int Index, char *name, int buflength) +{ + // below useless evaluation(s) to supress "not used" warnings + Index; + // return as much of our lexer name as will fit (what's up with Index?) + if (buflength > 0) { + buflength--; + int n = strlen(LexerName); + if (n > buflength) + n = buflength; + memcpy(name, LexerName, n), name[n] = '\0'; + } +} + +void EXT_LEXER_DECL Lex(unsigned int lexer, unsigned int startPos, int length, + int initStyle, char *words[], WindowID window, char *props) +{ + // below useless evaluation(s) to supress "not used" warnings + lexer; + // build expected data structures and do the Lex + InternalLexOrFold(0, startPos, length, initStyle, words, window, props); +} + +static void InternalLexOrFold(int foldOrLex, unsigned int startPos, int length, + int initStyle, char *words[], WindowID window, char *props) +{ + // create and initialize a WindowAccessor (including contained PropSet) + PropSet ps; + ps.SetMultiple(props); + WindowAccessor wa(window, ps); + // create and initialize WordList(s) + int nWL = 0; + for (; words[nWL]; nWL++) ; // count # of WordList PTRs needed + WordList** wl = new WordList* [nWL + 1];// alloc WordList PTRs + int i = 0; + for (; i < nWL; i++) { + wl[i] = new WordList(); // (works or THROWS bad_alloc EXCEPTION) + wl[i]->Set(words[i]); + } + wl[i] = 0; + // call our "internal" folder/lexer (... then do Flush!) + if (foldOrLex) + FoldCamlDoc(startPos, length, initStyle, wl, wa); + else + ColouriseCamlDoc(startPos, length, initStyle, wl, wa); + wa.Flush(); + // clean up before leaving + for (i = nWL - 1; i >= 0; i--) + delete wl[i]; + delete [] wl; +} + +static +#endif /* BUILD_AS_EXTERNAL_LEXER */ + +void ColouriseCamlDoc( + unsigned int startPos, int length, + int initStyle, + WordList *keywordlists[], + Accessor &styler) +{ + // initialize styler + StyleContext sc(startPos, length, initStyle, styler); + // set up [initial] state info (terminating states that shouldn't "bleed") + int nesting = 0; + if (sc.state < SCE_CAML_STRING) + sc.state = SCE_CAML_DEFAULT; + if (sc.state >= SCE_CAML_COMMENT) + nesting = (sc.state & 0x0f) - SCE_CAML_COMMENT; + + int chBase = 0, chToken = 0, chLit = 0; + WordList& keywords = *keywordlists[0]; + WordList& keywords2 = *keywordlists[1]; + WordList& keywords3 = *keywordlists[2]; + const int useMagic = styler.GetPropertyInt("lexer.caml.magic", 0); + + // foreach char in range... + while (sc.More()) { + // set up [per-char] state info + int state2 = -1; // (ASSUME no state change) + int chColor = sc.currentPos - 1;// (ASSUME standard coloring range) + bool advance = true; // (ASSUME scanner "eats" 1 char) + + // step state machine + switch (sc.state & 0x0f) { + case SCE_CAML_DEFAULT: + chToken = sc.currentPos; // save [possible] token start (JIC) + // it's wide open; what do we have? + if (iscamlf(sc.ch)) + state2 = SCE_CAML_IDENTIFIER; + else if (sc.Match('`') && iscamlf(sc.chNext)) + state2 = SCE_CAML_TAGNAME; + else if (sc.Match('#') && isdigit(sc.chNext)) + state2 = SCE_CAML_LINENUM; + else if (isdigit(sc.ch)) { + state2 = SCE_CAML_NUMBER, chBase = 10; + if (sc.Match('0') && strchr("bBoOxX", sc.chNext)) + chBase = baseT[tolower(sc.chNext) - 'a'], sc.Forward(); + } else if (sc.Match('\'')) /* (char literal?) */ + state2 = SCE_CAML_CHAR, chLit = 0; + else if (sc.Match('\"')) + state2 = SCE_CAML_STRING; + else if (sc.Match('(', '*')) + state2 = SCE_CAML_COMMENT, + sc.ch = ' ', // (make SURE "(*)" isn't seen as a closed comment) + sc.Forward(); + else if (strchr("!?~" /* Caml "prefix-symbol" */ + "=<>@^|&+-*/$%" /* Caml "infix-symbol" */ + "()[]{};,:.#", sc.ch)) /* Caml "bracket" or ;,:.# */ + state2 = SCE_CAML_OPERATOR; + break; + + case SCE_CAML_IDENTIFIER: + // [try to] interpret as [additional] identifier char + if (!(iscaml(sc.ch) || sc.Match('\''))) { + const int n = sc.currentPos - chToken; + if (n < 24) { + // length is believable as keyword, [re-]construct token + char t[24]; + for (int i = -n; i < 0; i++) + t[n + i] = static_cast(sc.GetRelative(i)); + t[n] = '\0'; + // special-case "_" token as KEYWORD + if ((n == 1 && sc.chPrev == '_') || keywords.InList(t)) + sc.ChangeState(SCE_CAML_KEYWORD); + else if (keywords2.InList(t)) + sc.ChangeState(SCE_CAML_KEYWORD2); + else if (keywords3.InList(t)) + sc.ChangeState(SCE_CAML_KEYWORD3); + } + state2 = SCE_CAML_DEFAULT, advance = false; + } + break; + + case SCE_CAML_TAGNAME: + // [try to] interpret as [additional] tagname char + if (!(iscaml(sc.ch) || sc.Match('\''))) + state2 = SCE_CAML_DEFAULT, advance = false; + break; + + /*case SCE_CAML_KEYWORD: + case SCE_CAML_KEYWORD2: + case SCE_CAML_KEYWORD3: + // [try to] interpret as [additional] keyword char + if (!iscaml(ch)) + state2 = SCE_CAML_DEFAULT, advance = false; + break;*/ + + case SCE_CAML_LINENUM: + // [try to] interpret as [additional] linenum directive char + if (!isdigit(sc.ch)) + state2 = SCE_CAML_DEFAULT, advance = false; + break; + + case SCE_CAML_OPERATOR: { + // [try to] interpret as [additional] operator char + const char* o = 0; + if (iscaml(sc.ch) || isspace(sc.ch) /* ident or whitespace */ + || (o = strchr(")]};,\'\"`#", sc.ch),o)/* "termination" chars */ + || !strchr("!$%&*+-./:<=>?@^|~", sc.ch)/* "operator" chars */) { + // check for INCLUSIVE termination + if (o && strchr(")]};,", sc.ch)) { + if ((sc.Match(')') && sc.chPrev == '(') + || (sc.Match(']') && sc.chPrev == '[')) + // special-case "()" and "[]" tokens as KEYWORDS + sc.ChangeState(SCE_CAML_KEYWORD); + chColor++; + } else + advance = false; + state2 = SCE_CAML_DEFAULT; + } + break; + } + + case SCE_CAML_NUMBER: + // [try to] interpret as [additional] numeric literal char + // N.B. - improperly accepts "extra" digits in base 2 or 8 literals + if (iscamld(sc.ch) || IsADigit(sc.ch, chBase)) + break; + // how about an integer suffix? + if ((sc.Match('l') || sc.Match('L') || sc.Match('n')) + && (iscamld(sc.chPrev) || IsADigit(sc.chPrev, chBase))) + break; + // or a floating-point literal? + if (chBase == 10) { + // with a decimal point? + if (sc.Match('.') && iscamld(sc.chPrev)) + break; + // with an exponent? (I) + if ((sc.Match('e') || sc.Match('E')) + && (iscamld(sc.chPrev) || sc.chPrev == '.')) + break; + // with an exponent? (II) + if ((sc.Match('+') || sc.Match('-')) + && (sc.chPrev == 'e' || sc.chPrev == 'E')) + break; + } + // it looks like we have run out of number + state2 = SCE_CAML_DEFAULT, advance = false; + break; + + case SCE_CAML_CHAR: + // [try to] interpret as [additional] char literal char + if (sc.Match('\\')) { + chLit = 1; // (definitely IS a char literal) + if (sc.chPrev == '\\') + sc.ch = ' '; // (so termination test isn't fooled) + // should we be terminating - one way or another? + } else if ((sc.Match('\'') && sc.chPrev != '\\') || sc.atLineEnd) { + state2 = SCE_CAML_DEFAULT; + if (sc.Match('\'')) + chColor++; + else + sc.ChangeState(SCE_CAML_IDENTIFIER); + // ... maybe a char literal, maybe not + } else if (chLit < 1 && sc.currentPos - chToken >= 2) + sc.ChangeState(SCE_CAML_IDENTIFIER), advance = false; + break; + + case SCE_CAML_STRING: + // [try to] interpret as [additional] string literal char + if (sc.Match('\\') && sc.chPrev == '\\') + sc.ch = ' '; // (so '\\' doesn't cause us trouble) + else if (sc.Match('\"') && sc.chPrev != '\\') + state2 = SCE_CAML_DEFAULT, chColor++; + break; + + case SCE_CAML_COMMENT: + case SCE_CAML_COMMENT1: + case SCE_CAML_COMMENT2: + case SCE_CAML_COMMENT3: + // we're IN a comment - does this start a NESTED comment? + if (sc.Match('(', '*')) + state2 = sc.state + 1, chToken = sc.currentPos, + sc.ch = ' ', // (make SURE "(*)" isn't seen as a closed comment) + sc.Forward(), nesting++; + // [try to] interpret as [additional] comment char + else if (sc.Match(')') && sc.chPrev == '*') { + if (nesting) + state2 = (sc.state & 0x0f) - 1, chToken = 0, nesting--; + else + state2 = SCE_CAML_DEFAULT; + chColor++; + // enable "magic" (read-only) comment AS REQUIRED + } else if (useMagic && sc.currentPos - chToken == 4 + && sc.Match('c') && sc.chPrev == 'r' && sc.GetRelative(-2) == '@') + sc.state |= 0x10; // (switch to read-only comment style) + break; + } + + // handle state change and char coloring as required + if (state2 >= 0) + styler.ColourTo(chColor, sc.state), sc.ChangeState(state2); + // move to next char UNLESS re-scanning current char + if (advance) + sc.Forward(); + } + + // do any required terminal char coloring (JIC) + sc.Complete(); +} + +#ifdef BUILD_AS_EXTERNAL_LEXER +static +#endif /* BUILD_AS_EXTERNAL_LEXER */ +void FoldCamlDoc( + unsigned int startPos, int length, + int initStyle, + WordList *keywordlists[], + Accessor &styler) +{ + // below useless evaluation(s) to supress "not used" warnings + startPos || length || initStyle || keywordlists[0] || styler.Length(); +} + +static const char * const camlWordListDesc[] = { + "Keywords", // primary Objective Caml keywords + "Keywords2", // "optional" keywords (typically from Pervasives) + "Keywords3", // "optional" keywords (typically typenames) + 0 +}; + +#ifndef BUILD_AS_EXTERNAL_LEXER +LexerModule lmCaml(SCLEX_CAML, ColouriseCamlDoc, "caml", FoldCamlDoc, camlWordListDesc); +#endif /* BUILD_AS_EXTERNAL_LEXER */ diff --git a/src/LexConf.cpp b/src/LexConf.cpp new file mode 100755 index 0000000..c33cdb5 --- /dev/null +++ b/src/LexConf.cpp @@ -0,0 +1,184 @@ +// Scintilla source code edit control +/** @file LexConf.cxx + ** Lexer for Apache Configuration Files. + ** + ** First working version contributed by Ahmad Zawawi on October 28, 2000. + ** i created this lexer because i needed something pretty when dealing + ** when Apache Configuration files... + **/ +// Copyright 1998-2001 by Neil Hodgson +// The License.txt file describes the conditions under which this software may be distributed. + +#include +#include +#include +#include +#include + +#include "Platform.h" + +#include "PropSet.h" +#include "Accessor.h" +#include "KeyWords.h" +#include "Scintilla.h" +#include "SciLexer.h" + +static void ColouriseConfDoc(unsigned int startPos, int length, int, WordList *keywordLists[], Accessor &styler) +{ + int state = SCE_CONF_DEFAULT; + char chNext = styler[startPos]; + int lengthDoc = startPos + length; + // create a buffer large enough to take the largest chunk... + char *buffer = new char[length]; + int bufferCount = 0; + + // this assumes that we have 2 keyword list in conf.properties + WordList &directives = *keywordLists[0]; + WordList ¶ms = *keywordLists[1]; + + // go through all provided text segment + // using the hand-written state machine shown below + styler.StartAt(startPos); + styler.StartSegment(startPos); + for (int i = startPos; i < lengthDoc; i++) { + char ch = chNext; + chNext = styler.SafeGetCharAt(i + 1); + + if (styler.IsLeadByte(ch)) { + chNext = styler.SafeGetCharAt(i + 2); + i++; + continue; + } + switch(state) { + case SCE_CONF_DEFAULT: + if( ch == '\n' || ch == '\r' || ch == '\t' || ch == ' ') { + // whitespace is simply ignored here... + styler.ColourTo(i,SCE_CONF_DEFAULT); + break; + } else if( ch == '#' ) { + // signals the start of a comment... + state = SCE_CONF_COMMENT; + styler.ColourTo(i,SCE_CONF_COMMENT); + } else if( ch == '.' /*|| ch == '/'*/) { + // signals the start of a file... + state = SCE_CONF_EXTENSION; + styler.ColourTo(i,SCE_CONF_EXTENSION); + } else if( ch == '"') { + state = SCE_CONF_STRING; + styler.ColourTo(i,SCE_CONF_STRING); + } else if( ispunct(ch) ) { + // signals an operator... + // no state jump necessary for this + // simple case... + styler.ColourTo(i,SCE_CONF_OPERATOR); + } else if( isalpha(ch) ) { + // signals the start of an identifier + bufferCount = 0; + buffer[bufferCount++] = static_cast(tolower(ch)); + state = SCE_CONF_IDENTIFIER; + } else if( isdigit(ch) ) { + // signals the start of a number + bufferCount = 0; + buffer[bufferCount++] = ch; + //styler.ColourTo(i,SCE_CONF_NUMBER); + state = SCE_CONF_NUMBER; + } else { + // style it the default style.. + styler.ColourTo(i,SCE_CONF_DEFAULT); + } + break; + + case SCE_CONF_COMMENT: + // if we find a newline here, + // we simply go to default state + // else continue to work on it... + if( ch == '\n' || ch == '\r' ) { + state = SCE_CONF_DEFAULT; + } else { + styler.ColourTo(i,SCE_CONF_COMMENT); + } + break; + + case SCE_CONF_EXTENSION: + // if we find a non-alphanumeric char, + // we simply go to default state + // else we're still dealing with an extension... + if( isalnum(ch) || (ch == '_') || + (ch == '-') || (ch == '$') || + (ch == '/') || (ch == '.') || (ch == '*') ) + { + styler.ColourTo(i,SCE_CONF_EXTENSION); + } else { + state = SCE_CONF_DEFAULT; + chNext = styler[i--]; + } + break; + + case SCE_CONF_STRING: + // if we find the end of a string char, we simply go to default state + // else we're still dealing with an string... + if( (ch == '"' && styler.SafeGetCharAt(i-1)!='\\') || (ch == '\n') || (ch == '\r') ) { + state = SCE_CONF_DEFAULT; + } + styler.ColourTo(i,SCE_CONF_STRING); + break; + + case SCE_CONF_IDENTIFIER: + // stay in CONF_IDENTIFIER state until we find a non-alphanumeric + if( isalnum(ch) || (ch == '_') || (ch == '-') || (ch == '/') || (ch == '$') || (ch == '.') || (ch == '*')) { + buffer[bufferCount++] = static_cast(tolower(ch)); + } else { + state = SCE_CONF_DEFAULT; + buffer[bufferCount] = '\0'; + + // check if the buffer contains a keyword, and highlight it if it is a keyword... + if(directives.InList(buffer)) { + styler.ColourTo(i-1,SCE_CONF_DIRECTIVE ); + } else if(params.InList(buffer)) { + styler.ColourTo(i-1,SCE_CONF_PARAMETER ); + } else if(strchr(buffer,'/') || strchr(buffer,'.')) { + styler.ColourTo(i-1,SCE_CONF_EXTENSION); + } else { + styler.ColourTo(i-1,SCE_CONF_DEFAULT); + } + + // push back the faulty character + chNext = styler[i--]; + + } + break; + + case SCE_CONF_NUMBER: + // stay in CONF_NUMBER state until we find a non-numeric + if( isdigit(ch) || ch == '.') { + buffer[bufferCount++] = ch; + } else { + state = SCE_CONF_DEFAULT; + buffer[bufferCount] = '\0'; + + // Colourize here... + if( strchr(buffer,'.') ) { + // it is an IP address... + styler.ColourTo(i-1,SCE_CONF_IP); + } else { + // normal number + styler.ColourTo(i-1,SCE_CONF_NUMBER); + } + + // push back a character + chNext = styler[i--]; + } + break; + + } + } + delete []buffer; +} + +static const char * const confWordListDesc[] = { + "Directives", + "Parameters", + 0 +}; + +LexerModule lmConf(SCLEX_CONF, ColouriseConfDoc, "conf", 0, confWordListDesc); diff --git a/src/LexCrontab.cpp b/src/LexCrontab.cpp new file mode 100755 index 0000000..d139bb4 --- /dev/null +++ b/src/LexCrontab.cpp @@ -0,0 +1,218 @@ +// Scintilla source code edit control +/** @file LexCrontab.cxx + ** Lexer to use with extended crontab files used by a powerful + ** Windows scheduler/event monitor/automation manager nnCron. + ** (http://nemtsev.eserv.ru/) + **/ +// Copyright 1998-2001 by Neil Hodgson +// The License.txt file describes the conditions under which this software may be distributed. + +#include +#include +#include +#include +#include + +#include "Platform.h" + +#include "PropSet.h" +#include "Accessor.h" +#include "KeyWords.h" +#include "Scintilla.h" +#include "SciLexer.h" + +static void ColouriseNncrontabDoc(unsigned int startPos, int length, int, WordList +*keywordLists[], Accessor &styler) +{ + int state = SCE_NNCRONTAB_DEFAULT; + char chNext = styler[startPos]; + int lengthDoc = startPos + length; + // create a buffer large enough to take the largest chunk... + char *buffer = new char[length]; + int bufferCount = 0; + // used when highliting environment variables inside quoted string: + bool insideString = false; + + // this assumes that we have 3 keyword list in conf.properties + WordList §ion = *keywordLists[0]; + WordList &keyword = *keywordLists[1]; + WordList &modifier = *keywordLists[2]; + + // go through all provided text segment + // using the hand-written state machine shown below + styler.StartAt(startPos); + styler.StartSegment(startPos); + for (int i = startPos; i < lengthDoc; i++) { + char ch = chNext; + chNext = styler.SafeGetCharAt(i + 1); + + if (styler.IsLeadByte(ch)) { + chNext = styler.SafeGetCharAt(i + 2); + i++; + continue; + } + switch(state) { + case SCE_NNCRONTAB_DEFAULT: + if( ch == '\n' || ch == '\r' || ch == '\t' || ch == ' ') { + // whitespace is simply ignored here... + styler.ColourTo(i,SCE_NNCRONTAB_DEFAULT); + break; + } else if( ch == '#' && styler.SafeGetCharAt(i+1) == '(') { + // signals the start of a task... + state = SCE_NNCRONTAB_TASK; + styler.ColourTo(i,SCE_NNCRONTAB_TASK); + } + else if( ch == '\\' && (styler.SafeGetCharAt(i+1) == ' ' || + styler.SafeGetCharAt(i+1) == '\t')) { + // signals the start of an extended comment... + state = SCE_NNCRONTAB_COMMENT; + styler.ColourTo(i,SCE_NNCRONTAB_COMMENT); + } else if( ch == '#' ) { + // signals the start of a plain comment... + state = SCE_NNCRONTAB_COMMENT; + styler.ColourTo(i,SCE_NNCRONTAB_COMMENT); + } else if( ch == ')' && styler.SafeGetCharAt(i+1) == '#') { + // signals the end of a task... + state = SCE_NNCRONTAB_TASK; + styler.ColourTo(i,SCE_NNCRONTAB_TASK); + } else if( ch == '"') { + state = SCE_NNCRONTAB_STRING; + styler.ColourTo(i,SCE_NNCRONTAB_STRING); + } else if( ch == '%') { + // signals environment variables + state = SCE_NNCRONTAB_ENVIRONMENT; + styler.ColourTo(i,SCE_NNCRONTAB_ENVIRONMENT); + } else if( ch == '<' && styler.SafeGetCharAt(i+1) == '%') { + // signals environment variables + state = SCE_NNCRONTAB_ENVIRONMENT; + styler.ColourTo(i,SCE_NNCRONTAB_ENVIRONMENT); + } else if( ch == '*' ) { + // signals an asterisk + // no state jump necessary for this simple case... + styler.ColourTo(i,SCE_NNCRONTAB_ASTERISK); + } else if( isalpha(ch) || ch == '<' ) { + // signals the start of an identifier + bufferCount = 0; + buffer[bufferCount++] = ch; + state = SCE_NNCRONTAB_IDENTIFIER; + } else if( isdigit(ch) ) { + // signals the start of a number + bufferCount = 0; + buffer[bufferCount++] = ch; + state = SCE_NNCRONTAB_NUMBER; + } else { + // style it the default style.. + styler.ColourTo(i,SCE_NNCRONTAB_DEFAULT); + } + break; + + case SCE_NNCRONTAB_COMMENT: + // if we find a newline here, + // we simply go to default state + // else continue to work on it... + if( ch == '\n' || ch == '\r' ) { + state = SCE_NNCRONTAB_DEFAULT; + } else { + styler.ColourTo(i,SCE_NNCRONTAB_COMMENT); + } + break; + + case SCE_NNCRONTAB_TASK: + // if we find a newline here, + // we simply go to default state + // else continue to work on it... + if( ch == '\n' || ch == '\r' ) { + state = SCE_NNCRONTAB_DEFAULT; + } else { + styler.ColourTo(i,SCE_NNCRONTAB_TASK); + } + break; + + case SCE_NNCRONTAB_STRING: + if( ch == '%' ) { + state = SCE_NNCRONTAB_ENVIRONMENT; + insideString = true; + styler.ColourTo(i-1,SCE_NNCRONTAB_STRING); + break; + } + // if we find the end of a string char, we simply go to default state + // else we're still dealing with an string... + if( (ch == '"' && styler.SafeGetCharAt(i-1)!='\\') || + (ch == '\n') || (ch == '\r') ) { + state = SCE_NNCRONTAB_DEFAULT; + } + styler.ColourTo(i,SCE_NNCRONTAB_STRING); + break; + + case SCE_NNCRONTAB_ENVIRONMENT: + // if we find the end of a string char, we simply go to default state + // else we're still dealing with an string... + if( ch == '%' && insideString ) { + state = SCE_NNCRONTAB_STRING; + insideString = false; + break; + } + if( (ch == '%' && styler.SafeGetCharAt(i-1)!='\\') + || (ch == '\n') || (ch == '\r') || (ch == '>') ) { + state = SCE_NNCRONTAB_DEFAULT; + styler.ColourTo(i,SCE_NNCRONTAB_ENVIRONMENT); + break; + } + styler.ColourTo(i+1,SCE_NNCRONTAB_ENVIRONMENT); + break; + + case SCE_NNCRONTAB_IDENTIFIER: + // stay in CONF_IDENTIFIER state until we find a non-alphanumeric + if( isalnum(ch) || (ch == '_') || (ch == '-') || (ch == '/') || + (ch == '$') || (ch == '.') || (ch == '<') || (ch == '>') || + (ch == '@') ) { + buffer[bufferCount++] = ch; + } else { + state = SCE_NNCRONTAB_DEFAULT; + buffer[bufferCount] = '\0'; + + // check if the buffer contains a keyword, + // and highlight it if it is a keyword... + if(section.InList(buffer)) { + styler.ColourTo(i,SCE_NNCRONTAB_SECTION ); + } else if(keyword.InList(buffer)) { + styler.ColourTo(i-1,SCE_NNCRONTAB_KEYWORD ); + } // else if(strchr(buffer,'/') || strchr(buffer,'.')) { + // styler.ColourTo(i-1,SCE_NNCRONTAB_EXTENSION); + // } + else if(modifier.InList(buffer)) { + styler.ColourTo(i-1,SCE_NNCRONTAB_MODIFIER ); + } else { + styler.ColourTo(i-1,SCE_NNCRONTAB_DEFAULT); + } + // push back the faulty character + chNext = styler[i--]; + } + break; + + case SCE_NNCRONTAB_NUMBER: + // stay in CONF_NUMBER state until we find a non-numeric + if( isdigit(ch) /* || ch == '.' */ ) { + buffer[bufferCount++] = ch; + } else { + state = SCE_NNCRONTAB_DEFAULT; + buffer[bufferCount] = '\0'; + // Colourize here... (normal number) + styler.ColourTo(i-1,SCE_NNCRONTAB_NUMBER); + // push back a character + chNext = styler[i--]; + } + break; + } + } + delete []buffer; +} + +static const char * const cronWordListDesc[] = { + "Section keywords and Forth words", + "nnCrontab keywords", + "Modifiers", + 0 +}; + +LexerModule lmNncrontab(SCLEX_NNCRONTAB, ColouriseNncrontabDoc, "nncrontab", 0, cronWordListDesc); diff --git a/src/LexCsound.cpp b/src/LexCsound.cpp new file mode 100644 index 0000000..27f7b99 --- /dev/null +++ b/src/LexCsound.cpp @@ -0,0 +1,207 @@ +// Scintilla source code edit control +/** @file LexCsound.cxx + ** Lexer for Csound (Orchestra & Score) + ** Written by Georg Ritter - + **/ +// Copyright 1998-2003 by Neil Hodgson +// The License.txt file describes the conditions under which this software may be distributed. + +#include +#include +#include +#include +#include +#include "Platform.h" + +#include "PropSet.h" +#include "Accessor.h" +#include "StyleContext.h" +#include "KeyWords.h" +#include "Scintilla.h" +#include "SciLexer.h" + + +static inline bool IsAWordChar(const int ch) { + return (ch < 0x80) && (isalnum(ch) || ch == '.' || + ch == '_' || ch == '?'); +} + +static inline bool IsAWordStart(const int ch) { + return (ch < 0x80) && (isalnum(ch) || ch == '_' || ch == '.' || + ch == '%' || ch == '@' || ch == '$' || ch == '?'); +} + +static inline bool IsCsoundOperator(char ch) { + if (isalnum(ch)) + return false; + // '.' left out as it is used to make up numbers + if (ch == '*' || ch == '/' || ch == '-' || ch == '+' || + ch == '(' || ch == ')' || ch == '=' || ch == '^' || + ch == '[' || ch == ']' || ch == '<' || ch == '&' || + ch == '>' || ch == ',' || ch == '|' || ch == '~' || + ch == '%' || ch == ':') + return true; + return false; +} + +static void ColouriseCsoundDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[], + Accessor &styler) { + + WordList &opcode = *keywordlists[0]; + WordList &headerStmt = *keywordlists[1]; + WordList &otherKeyword = *keywordlists[2]; + + // Do not leak onto next line + if (initStyle == SCE_CSOUND_STRINGEOL) + initStyle = SCE_CSOUND_DEFAULT; + + StyleContext sc(startPos, length, initStyle, styler); + + for (; sc.More(); sc.Forward()) + { + // Handle line continuation generically. + if (sc.ch == '\\') { + if (sc.chNext == '\n' || sc.chNext == '\r') { + sc.Forward(); + if (sc.ch == '\r' && sc.chNext == '\n') { + sc.Forward(); + } + continue; + } + } + + // Determine if the current state should terminate. + if (sc.state == SCE_CSOUND_OPERATOR) { + if (!IsCsoundOperator(static_cast(sc.ch))) { + sc.SetState(SCE_CSOUND_DEFAULT); + } + }else if (sc.state == SCE_CSOUND_NUMBER) { + if (!IsAWordChar(sc.ch)) { + sc.SetState(SCE_CSOUND_DEFAULT); + } + } else if (sc.state == SCE_CSOUND_IDENTIFIER) { + if (!IsAWordChar(sc.ch) ) { + char s[100]; + sc.GetCurrent(s, sizeof(s)); + + if (opcode.InList(s)) { + sc.ChangeState(SCE_CSOUND_OPCODE); + } else if (headerStmt.InList(s)) { + sc.ChangeState(SCE_CSOUND_HEADERSTMT); + } else if (otherKeyword.InList(s)) { + sc.ChangeState(SCE_CSOUND_USERKEYWORD); + } else if (s[0] == 'p') { + sc.ChangeState(SCE_CSOUND_PARAM); + } else if (s[0] == 'a') { + sc.ChangeState(SCE_CSOUND_ARATE_VAR); + } else if (s[0] == 'k') { + sc.ChangeState(SCE_CSOUND_KRATE_VAR); + } else if (s[0] == 'i') { // covers both i-rate variables and i-statements + sc.ChangeState(SCE_CSOUND_IRATE_VAR); + } else if (s[0] == 'g') { + sc.ChangeState(SCE_CSOUND_GLOBAL_VAR); + } + sc.SetState(SCE_CSOUND_DEFAULT); + } + } + else if (sc.state == SCE_CSOUND_COMMENT ) { + if (sc.atLineEnd) { + sc.SetState(SCE_CSOUND_DEFAULT); + } + } + else if ((sc.state == SCE_CSOUND_ARATE_VAR) || + (sc.state == SCE_CSOUND_KRATE_VAR) || + (sc.state == SCE_CSOUND_IRATE_VAR)) { + if (!IsAWordChar(sc.ch)) { + sc.SetState(SCE_CSOUND_DEFAULT); + } + } + + // Determine if a new state should be entered. + if (sc.state == SCE_CSOUND_DEFAULT) { + if (sc.ch == ';'){ + sc.SetState(SCE_CSOUND_COMMENT); + } else if (isdigit(sc.ch) || (sc.ch == '.' && isdigit(sc.chNext))) { + sc.SetState(SCE_CSOUND_NUMBER); + } else if (IsAWordStart(sc.ch)) { + sc.SetState(SCE_CSOUND_IDENTIFIER); + } else if (IsCsoundOperator(static_cast(sc.ch))) { + sc.SetState(SCE_CSOUND_OPERATOR); + } else if (sc.ch == 'p') { + sc.SetState(SCE_CSOUND_PARAM); + } else if (sc.ch == 'a') { + sc.SetState(SCE_CSOUND_ARATE_VAR); + } else if (sc.ch == 'k') { + sc.SetState(SCE_CSOUND_KRATE_VAR); + } else if (sc.ch == 'i') { // covers both i-rate variables and i-statements + sc.SetState(SCE_CSOUND_IRATE_VAR); + } else if (sc.ch == 'g') { + sc.SetState(SCE_CSOUND_GLOBAL_VAR); + } + } + } + sc.Complete(); +} + +static void FoldCsoundInstruments(unsigned int startPos, int length, int /* initStyle */, WordList *[], + Accessor &styler) { + unsigned int lengthDoc = startPos + length; + int visibleChars = 0; + int lineCurrent = styler.GetLine(startPos); + int levelPrev = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK; + int levelCurrent = levelPrev; + char chNext = styler[startPos]; + int stylePrev = 0; + int styleNext = styler.StyleAt(startPos); + for (unsigned int i = startPos; i < lengthDoc; i++) { + char ch = chNext; + chNext = styler.SafeGetCharAt(i + 1); + int style = styleNext; + styleNext = styler.StyleAt(i + 1); + bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n'); + if ((stylePrev != SCE_CSOUND_OPCODE) && (style == SCE_CSOUND_OPCODE)) { + char s[20]; + unsigned int j = 0; + while ((j < (sizeof(s) - 1)) && (iswordchar(styler[i + j]))) { + s[j] = styler[i + j]; + j++; + } + s[j] = '\0'; + + if (strcmp(s, "instr") == 0) + levelCurrent++; + if (strcmp(s, "endin") == 0) + levelCurrent--; + } + + if (atEOL) { + int lev = levelPrev; + if (visibleChars == 0) + lev |= SC_FOLDLEVELWHITEFLAG; + if ((levelCurrent > levelPrev) && (visibleChars > 0)) + lev |= SC_FOLDLEVELHEADERFLAG; + if (lev != styler.LevelAt(lineCurrent)) { + styler.SetLevel(lineCurrent, lev); + } + lineCurrent++; + levelPrev = levelCurrent; + visibleChars = 0; + } + if (!isspacechar(ch)) + visibleChars++; + stylePrev = style; + } + // Fill in the real level of the next line, keeping the current flags as they will be filled in later + int flagsNext = styler.LevelAt(lineCurrent) & ~SC_FOLDLEVELNUMBERMASK; + styler.SetLevel(lineCurrent, levelPrev | flagsNext); +} + + +static const char * const csoundWordListDesc[] = { + "Opcodes", + "Header Statements", + "User keywords", + 0 +}; + +LexerModule lmCsound(SCLEX_CSOUND, ColouriseCsoundDoc, "csound", FoldCsoundInstruments, csoundWordListDesc); diff --git a/src/LexEScript.cpp b/src/LexEScript.cpp new file mode 100755 index 0000000..4941158 --- /dev/null +++ b/src/LexEScript.cpp @@ -0,0 +1,270 @@ +// Scintilla source code edit control +/** @file LexESCRIPT.cxx + ** Lexer for ESCRIPT + **/ +// Copyright 2003 by Patrizio Bekerle (patrizio@bekerle.com) + +#include +#include +#include +#include +#include + +#include "Platform.h" + +#include "PropSet.h" +#include "Accessor.h" +#include "StyleContext.h" +#include "KeyWords.h" +#include "Scintilla.h" +#include "SciLexer.h" + + + +static inline bool IsAWordChar(const int ch) { + return (ch < 0x80) && (isalnum(ch) || ch == '.' || ch == '_'); +} + +static inline bool IsAWordStart(const int ch) { + return (ch < 0x80) && (isalnum(ch) || ch == '_'); +} + + + +static void ColouriseESCRIPTDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[], + Accessor &styler) { + + WordList &keywords = *keywordlists[0]; + WordList &keywords2 = *keywordlists[1]; + WordList &keywords3 = *keywordlists[2]; + + // Do not leak onto next line + /*if (initStyle == SCE_ESCRIPT_STRINGEOL) + initStyle = SCE_ESCRIPT_DEFAULT;*/ + + StyleContext sc(startPos, length, initStyle, styler); + + bool caseSensitive = styler.GetPropertyInt("escript.case.sensitive", 0) != 0; + + for (; sc.More(); sc.Forward()) { + + /*if (sc.atLineStart && (sc.state == SCE_ESCRIPT_STRING)) { + // Prevent SCE_ESCRIPT_STRINGEOL from leaking back to previous line + sc.SetState(SCE_ESCRIPT_STRING); + }*/ + + // Handle line continuation generically. + if (sc.ch == '\\') { + if (sc.chNext == '\n' || sc.chNext == '\r') { + sc.Forward(); + if (sc.ch == '\r' && sc.chNext == '\n') { + sc.Forward(); + } + continue; + } + } + + // Determine if the current state should terminate. + if (sc.state == SCE_ESCRIPT_OPERATOR || sc.state == SCE_ESCRIPT_BRACE) { + sc.SetState(SCE_ESCRIPT_DEFAULT); + } else if (sc.state == SCE_ESCRIPT_NUMBER) { + if (!IsADigit(sc.ch) || sc.ch != '.') { + sc.SetState(SCE_ESCRIPT_DEFAULT); + } + } else if (sc.state == SCE_ESCRIPT_IDENTIFIER) { + if (!IsAWordChar(sc.ch) || (sc.ch == '.')) { + char s[100]; + if (caseSensitive) { + sc.GetCurrent(s, sizeof(s)); + } else { + sc.GetCurrentLowered(s, sizeof(s)); + } + +// sc.GetCurrentLowered(s, sizeof(s)); + + if (keywords.InList(s)) { + sc.ChangeState(SCE_ESCRIPT_WORD); + } else if (keywords2.InList(s)) { + sc.ChangeState(SCE_ESCRIPT_WORD2); + } else if (keywords3.InList(s)) { + sc.ChangeState(SCE_ESCRIPT_WORD3); + // sc.state = SCE_ESCRIPT_IDENTIFIER; + } + sc.SetState(SCE_ESCRIPT_DEFAULT); + } + } else if (sc.state == SCE_ESCRIPT_COMMENT) { + if (sc.Match('*', '/')) { + sc.Forward(); + sc.ForwardSetState(SCE_ESCRIPT_DEFAULT); + } + } else if (sc.state == SCE_ESCRIPT_COMMENTDOC) { + if (sc.Match('*', '/')) { + sc.Forward(); + sc.ForwardSetState(SCE_ESCRIPT_DEFAULT); + } + } else if (sc.state == SCE_ESCRIPT_COMMENTLINE) { + if (sc.atLineEnd) { + sc.SetState(SCE_ESCRIPT_DEFAULT); + } + } else if (sc.state == SCE_ESCRIPT_STRING) { + if (sc.ch == '\\') { + if (sc.chNext == '\"' || sc.chNext == '\\') { + sc.Forward(); + } + } else if (sc.ch == '\"') { + sc.ForwardSetState(SCE_ESCRIPT_DEFAULT); + } + } + + // Determine if a new state should be entered. + if (sc.state == SCE_ESCRIPT_DEFAULT) { + if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext))) { + sc.SetState(SCE_ESCRIPT_NUMBER); + } else if (IsAWordStart(sc.ch) || (sc.ch == '#')) { + sc.SetState(SCE_ESCRIPT_IDENTIFIER); + } else if (sc.Match('/', '*')) { + sc.SetState(SCE_ESCRIPT_COMMENT); + sc.Forward(); // Eat the * so it isn't used for the end of the comment + } else if (sc.Match('/', '/')) { + sc.SetState(SCE_ESCRIPT_COMMENTLINE); + } else if (sc.ch == '\"') { + sc.SetState(SCE_ESCRIPT_STRING); + //} else if (isoperator(static_cast(sc.ch))) { + } else if (sc.ch == '+' || sc.ch == '-' || sc.ch == '*' || sc.ch == '/' || sc.ch == '=' || sc.ch == '<' || sc.ch == '>' || sc.ch == '&' || sc.ch == '|' || sc.ch == '!' || sc.ch == '?' || sc.ch == ':') { + sc.SetState(SCE_ESCRIPT_OPERATOR); + } else if (sc.ch == '{' || sc.ch == '}') { + sc.SetState(SCE_ESCRIPT_BRACE); + } + } + + } + sc.Complete(); +} + + +static int classifyFoldPointESCRIPT(const char* s, const char* prevWord) { + int lev = 0; + if (strcmp(prevWord, "end") == 0) return lev; + if ((strcmp(prevWord, "else") == 0 && strcmp(s, "if") == 0) || strcmp(s, "elseif") == 0) + return -1; + + if (strcmp(s, "for") == 0 || strcmp(s, "foreach") == 0 + || strcmp(s, "program") == 0 || strcmp(s, "function") == 0 + || strcmp(s, "while") == 0 || strcmp(s, "case") == 0 + || strcmp(s, "if") == 0 ) { + lev = 1; + } else if ( strcmp(s, "endfor") == 0 || strcmp(s, "endforeach") == 0 + || strcmp(s, "endprogram") == 0 || strcmp(s, "endfunction") == 0 + || strcmp(s, "endwhile") == 0 || strcmp(s, "endcase") == 0 + || strcmp(s, "endif") == 0 ) { + lev = -1; + } + + return lev; +} + + +static bool IsStreamCommentStyle(int style) { + return style == SCE_ESCRIPT_COMMENT || + style == SCE_ESCRIPT_COMMENTDOC || + style == SCE_ESCRIPT_COMMENTLINE; +} + +static void FoldESCRIPTDoc(unsigned int startPos, int length, int initStyle, WordList *[], Accessor &styler) { + //~ bool foldComment = styler.GetPropertyInt("fold.comment") != 0; + // Do not know how to fold the comment at the moment. + bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0; + bool foldComment = true; + unsigned int endPos = startPos + length; + int visibleChars = 0; + int lineCurrent = styler.GetLine(startPos); + int levelPrev = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK; + int levelCurrent = levelPrev; + char chNext = styler[startPos]; + int styleNext = styler.StyleAt(startPos); + int style = initStyle; + + int lastStart = 0; + char prevWord[32] = ""; + + for (unsigned int i = startPos; i < endPos; i++) { + char ch = chNext; + chNext = styler.SafeGetCharAt(i + 1); + int stylePrev = style; + style = styleNext; + styleNext = styler.StyleAt(i + 1); + bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n'); + + + if (foldComment && IsStreamCommentStyle(style)) { + if (!IsStreamCommentStyle(stylePrev)) { + levelCurrent++; + } else if (!IsStreamCommentStyle(styleNext) && !atEOL) { + // Comments don't end at end of line and the next character may be unstyled. + levelCurrent--; + } + } + + if (foldComment && (style == SCE_ESCRIPT_COMMENTLINE)) { + if ((ch == '/') && (chNext == '/')) { + char chNext2 = styler.SafeGetCharAt(i + 2); + if (chNext2 == '{') { + levelCurrent++; + } else if (chNext2 == '}') { + levelCurrent--; + } + } + } + + if (stylePrev == SCE_ESCRIPT_DEFAULT && style == SCE_ESCRIPT_WORD3) + { + // Store last word start point. + lastStart = i; + } + + if (style == SCE_ESCRIPT_WORD3) { + if(iswordchar(ch) && !iswordchar(chNext)) { + char s[32]; + unsigned int j; + for(j = 0; ( j < 31 ) && ( j < i-lastStart+1 ); j++) { + s[j] = static_cast(tolower(styler[lastStart + j])); + } + s[j] = '\0'; + levelCurrent += classifyFoldPointESCRIPT(s, prevWord); + strcpy(prevWord, s); + } + } + if (atEOL) { + int lev = levelPrev; + if (visibleChars == 0 && foldCompact) + lev |= SC_FOLDLEVELWHITEFLAG; + if ((levelCurrent > levelPrev) && (visibleChars > 0)) + lev |= SC_FOLDLEVELHEADERFLAG; + if (lev != styler.LevelAt(lineCurrent)) { + styler.SetLevel(lineCurrent, lev); + } + lineCurrent++; + levelPrev = levelCurrent; + visibleChars = 0; + strcpy(prevWord, ""); + } + + if (!isspacechar(ch)) + visibleChars++; + } + + // Fill in the real level of the next line, keeping the current flags as they will be filled in later + int flagsNext = styler.LevelAt(lineCurrent) & ~SC_FOLDLEVELNUMBERMASK; + styler.SetLevel(lineCurrent, levelPrev | flagsNext); +} + + + +static const char * const ESCRIPTWordLists[] = { + "Primary keywords and identifiers", + "Intrinsic functions", + "Extended and user defined functions", + 0, +}; + +LexerModule lmESCRIPT(SCLEX_ESCRIPT, ColouriseESCRIPTDoc, "escript", FoldESCRIPTDoc, ESCRIPTWordLists); diff --git a/src/LexEiffel.cpp b/src/LexEiffel.cpp new file mode 100755 index 0000000..4aed7c6 --- /dev/null +++ b/src/LexEiffel.cpp @@ -0,0 +1,234 @@ +// Scintilla source code edit control +/** @file LexEiffel.cxx + ** Lexer for Eiffel. + **/ +// Copyright 1998-2001 by Neil Hodgson +// The License.txt file describes the conditions under which this software may be distributed. + +#include +#include +#include +#include +#include + +#include "Platform.h" + +#include "PropSet.h" +#include "Accessor.h" +#include "StyleContext.h" +#include "KeyWords.h" +#include "Scintilla.h" +#include "SciLexer.h" + +static inline bool isEiffelOperator(unsigned int ch) { + // '.' left out as it is used to make up numbers + return ch == '*' || ch == '/' || ch == '\\' || ch == '-' || ch == '+' || + ch == '(' || ch == ')' || ch == '=' || + ch == '{' || ch == '}' || ch == '~' || + ch == '[' || ch == ']' || ch == ';' || + ch == '<' || ch == '>' || ch == ',' || + ch == '.' || ch == '^' || ch == '%' || ch == ':' || + ch == '!' || ch == '@' || ch == '?'; +} + +static inline bool IsAWordChar(unsigned int ch) { + return (ch < 0x80) && (isalnum(ch) || ch == '_'); +} + +static inline bool IsAWordStart(unsigned int ch) { + return (ch < 0x80) && (isalnum(ch) || ch == '_'); +} + +static void ColouriseEiffelDoc(unsigned int startPos, + int length, + int initStyle, + WordList *keywordlists[], + Accessor &styler) { + + WordList &keywords = *keywordlists[0]; + + StyleContext sc(startPos, length, initStyle, styler); + + for (; sc.More(); sc.Forward()) { + + if (sc.state == SCE_EIFFEL_STRINGEOL) { + if (sc.ch != '\r' && sc.ch != '\n') { + sc.SetState(SCE_EIFFEL_DEFAULT); + } + } else if (sc.state == SCE_EIFFEL_OPERATOR) { + sc.SetState(SCE_EIFFEL_DEFAULT); + } else if (sc.state == SCE_EIFFEL_WORD) { + if (!IsAWordChar(sc.ch)) { + char s[100]; + sc.GetCurrentLowered(s, sizeof(s)); + if (!keywords.InList(s)) { + sc.ChangeState(SCE_EIFFEL_IDENTIFIER); + } + sc.SetState(SCE_EIFFEL_DEFAULT); + } + } else if (sc.state == SCE_EIFFEL_NUMBER) { + if (!IsAWordChar(sc.ch)) { + sc.SetState(SCE_EIFFEL_DEFAULT); + } + } else if (sc.state == SCE_EIFFEL_COMMENTLINE) { + if (sc.ch == '\r' || sc.ch == '\n') { + sc.SetState(SCE_EIFFEL_DEFAULT); + } + } else if (sc.state == SCE_EIFFEL_STRING) { + if (sc.ch == '%') { + sc.Forward(); + } else if (sc.ch == '\"') { + sc.Forward(); + sc.SetState(SCE_EIFFEL_DEFAULT); + } + } else if (sc.state == SCE_EIFFEL_CHARACTER) { + if (sc.ch == '\r' || sc.ch == '\n') { + sc.SetState(SCE_EIFFEL_STRINGEOL); + } else if (sc.ch == '%') { + sc.Forward(); + } else if (sc.ch == '\'') { + sc.Forward(); + sc.SetState(SCE_EIFFEL_DEFAULT); + } + } + + if (sc.state == SCE_EIFFEL_DEFAULT) { + if (sc.ch == '-' && sc.chNext == '-') { + sc.SetState(SCE_EIFFEL_COMMENTLINE); + } else if (sc.ch == '\"') { + sc.SetState(SCE_EIFFEL_STRING); + } else if (sc.ch == '\'') { + sc.SetState(SCE_EIFFEL_CHARACTER); + } else if (IsADigit(sc.ch) || (sc.ch == '.')) { + sc.SetState(SCE_EIFFEL_NUMBER); + } else if (IsAWordStart(sc.ch)) { + sc.SetState(SCE_EIFFEL_WORD); + } else if (isEiffelOperator(sc.ch)) { + sc.SetState(SCE_EIFFEL_OPERATOR); + } + } + } + sc.Complete(); +} + +static bool IsEiffelComment(Accessor &styler, int pos, int len) { + return len>1 && styler[pos]=='-' && styler[pos+1]=='-'; +} + +static void FoldEiffelDocIndent(unsigned int startPos, int length, int, + WordList *[], Accessor &styler) { + int lengthDoc = startPos + length; + + // Backtrack to previous line in case need to fix its fold status + int lineCurrent = styler.GetLine(startPos); + if (startPos > 0) { + if (lineCurrent > 0) { + lineCurrent--; + startPos = styler.LineStart(lineCurrent); + } + } + int spaceFlags = 0; + int indentCurrent = styler.IndentAmount(lineCurrent, &spaceFlags, IsEiffelComment); + char chNext = styler[startPos]; + for (int i = startPos; i < lengthDoc; i++) { + char ch = chNext; + chNext = styler.SafeGetCharAt(i + 1); + + if ((ch == '\r' && chNext != '\n') || (ch == '\n') || (i == lengthDoc)) { + int lev = indentCurrent; + int indentNext = styler.IndentAmount(lineCurrent + 1, &spaceFlags, IsEiffelComment); + if (!(indentCurrent & SC_FOLDLEVELWHITEFLAG)) { + // Only non whitespace lines can be headers + if ((indentCurrent & SC_FOLDLEVELNUMBERMASK) < (indentNext & SC_FOLDLEVELNUMBERMASK)) { + lev |= SC_FOLDLEVELHEADERFLAG; + } else if (indentNext & SC_FOLDLEVELWHITEFLAG) { + // Line after is blank so check the next - maybe should continue further? + int spaceFlags2 = 0; + int indentNext2 = styler.IndentAmount(lineCurrent + 2, &spaceFlags2, IsEiffelComment); + if ((indentCurrent & SC_FOLDLEVELNUMBERMASK) < (indentNext2 & SC_FOLDLEVELNUMBERMASK)) { + lev |= SC_FOLDLEVELHEADERFLAG; + } + } + } + indentCurrent = indentNext; + styler.SetLevel(lineCurrent, lev); + lineCurrent++; + } + } +} + +static void FoldEiffelDocKeyWords(unsigned int startPos, int length, int /* initStyle */, WordList *[], + Accessor &styler) { + unsigned int lengthDoc = startPos + length; + int visibleChars = 0; + int lineCurrent = styler.GetLine(startPos); + int levelPrev = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK; + int levelCurrent = levelPrev; + char chNext = styler[startPos]; + int stylePrev = 0; + int styleNext = styler.StyleAt(startPos); + // lastDeferred should be determined by looking back to last keyword in case + // the "deferred" is on a line before "class" + bool lastDeferred = false; + for (unsigned int i = startPos; i < lengthDoc; i++) { + char ch = chNext; + chNext = styler.SafeGetCharAt(i + 1); + int style = styleNext; + styleNext = styler.StyleAt(i + 1); + bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n'); + if ((stylePrev != SCE_EIFFEL_WORD) && (style == SCE_EIFFEL_WORD)) { + char s[20]; + unsigned int j = 0; + while ((j < (sizeof(s) - 1)) && (iswordchar(styler[i + j]))) { + s[j] = styler[i + j]; + j++; + } + s[j] = '\0'; + + if ( + (strcmp(s, "check") == 0) || + (strcmp(s, "debug") == 0) || + (strcmp(s, "deferred") == 0) || + (strcmp(s, "do") == 0) || + (strcmp(s, "from") == 0) || + (strcmp(s, "if") == 0) || + (strcmp(s, "inspect") == 0) || + (strcmp(s, "once") == 0) + ) + levelCurrent++; + if (!lastDeferred && (strcmp(s, "class") == 0)) + levelCurrent++; + if (strcmp(s, "end") == 0) + levelCurrent--; + lastDeferred = strcmp(s, "deferred") == 0; + } + + if (atEOL) { + int lev = levelPrev; + if (visibleChars == 0) + lev |= SC_FOLDLEVELWHITEFLAG; + if ((levelCurrent > levelPrev) && (visibleChars > 0)) + lev |= SC_FOLDLEVELHEADERFLAG; + if (lev != styler.LevelAt(lineCurrent)) { + styler.SetLevel(lineCurrent, lev); + } + lineCurrent++; + levelPrev = levelCurrent; + visibleChars = 0; + } + if (!isspacechar(ch)) + visibleChars++; + stylePrev = style; + } + // Fill in the real level of the next line, keeping the current flags as they will be filled in later + int flagsNext = styler.LevelAt(lineCurrent) & ~SC_FOLDLEVELNUMBERMASK; + styler.SetLevel(lineCurrent, levelPrev | flagsNext); +} + +static const char * const eiffelWordListDesc[] = { + "Keywords", + 0 +}; + +LexerModule lmEiffel(SCLEX_EIFFEL, ColouriseEiffelDoc, "eiffel", FoldEiffelDocIndent, eiffelWordListDesc); +LexerModule lmEiffelkw(SCLEX_EIFFELKW, ColouriseEiffelDoc, "eiffelkw", FoldEiffelDocKeyWords, eiffelWordListDesc); diff --git a/src/LexErlang.cpp b/src/LexErlang.cpp new file mode 100755 index 0000000..9444eb9 --- /dev/null +++ b/src/LexErlang.cpp @@ -0,0 +1,522 @@ +// Scintilla source code edit control +/** @file LexErlang.cxx + ** Lexer for Erlang. + ** Written by Peter-Henry Mander, based on Matlab lexer by José Fonseca + **/ +// Copyright 1998-2001 by Neil Hodgson +// The License.txt file describes the conditions under which this software may be distributed. + +#include +#include +#include +#include +#include + +#include "Platform.h" + +#include "PropSet.h" +#include "Accessor.h" +#include "StyleContext.h" +#include "KeyWords.h" +#include "Scintilla.h" +#include "SciLexer.h" + +/* + TODO: + o _Param should be a new lexical type +*/ + +static int is_radix(int radix, int ch) { + int digit; + if ( 16 < radix || 2 > radix ) { + return 0; + } + if ( isdigit(ch) ) { + digit = ch - '0'; + } else if ( isxdigit(ch) ) { + digit = toupper(ch) - 'A' + 10; + } else { + return 0; + } + if ( digit < radix ) { + return 1; + } else { + return 0; + } +} + +typedef enum { + STATE_NULL, + ATOM_UNQUOTED, + ATOM_QUOTED, + ATOM_FUN_NAME, + NODE_NAME_UNQUOTED, + NODE_NAME_QUOTED, + MACRO_START, + MACRO_UNQUOTED, + MACRO_QUOTED, + RECORD_START, + RECORD_UNQUOTED, + RECORD_QUOTED, + NUMERAL_START, + NUMERAL_SIGNED, + NUMERAL_RADIX_LITERAL, + NUMERAL_SPECULATIVE_MANTISSA, + NUMERAL_FLOAT_MANTISSA, + NUMERAL_FLOAT_EXPONENT, + NUMERAL_FLOAT_SIGNED_EXPONENT, + PARSE_ERROR +} atom_parse_state_t; + +static void ColouriseErlangDoc(unsigned int startPos, int length, int initStyle, + WordList *keywordlists[], Accessor &styler) { + + WordList &keywords = *keywordlists[0]; + + styler.StartAt(startPos); + + StyleContext sc(startPos, length, initStyle, styler); + atom_parse_state_t parse_state = STATE_NULL; + int radix_digits = 0; + int exponent_digits = 0; + for (; sc.More(); sc.Forward()) { + if ( STATE_NULL != parse_state ) { + switch (parse_state) { + case STATE_NULL: + sc.SetState(SCE_ERLANG_DEFAULT); + break; + case ATOM_UNQUOTED: + if ( '@' == sc.ch ){ + parse_state = NODE_NAME_UNQUOTED; + } else if ( !isalnum(sc.ch) && sc.ch != '_' ) { + char s[100]; + sc.GetCurrent(s, sizeof(s)); + if (keywords.InList(s)) { + sc.ChangeState(SCE_ERLANG_KEYWORD); + sc.SetState(SCE_ERLANG_DEFAULT); + parse_state = STATE_NULL; + } else { + if ( '/' == sc.ch ) { + parse_state = ATOM_FUN_NAME; + } else { + sc.ChangeState(SCE_ERLANG_ATOM); + sc.SetState(SCE_ERLANG_DEFAULT); + parse_state = STATE_NULL; + } + } + } + break; + case ATOM_QUOTED: + if ( '@' == sc.ch ){ + parse_state = NODE_NAME_QUOTED; + } else if ( '\'' == sc.ch && '\\' != sc.chPrev ) { + sc.ChangeState(SCE_ERLANG_ATOM); + sc.ForwardSetState(SCE_ERLANG_DEFAULT); + parse_state = STATE_NULL; + } + break; + case ATOM_FUN_NAME: + if ( !isdigit(sc.ch) ) { + sc.ChangeState(SCE_ERLANG_FUNCTION_NAME); + sc.SetState(SCE_ERLANG_DEFAULT); + parse_state = STATE_NULL; + } + break; + case NODE_NAME_QUOTED: + if ( '@' == sc.ch ) { + sc.SetState(SCE_ERLANG_DEFAULT); + parse_state = STATE_NULL; + } else if ( '\'' == sc.ch && '\\' != sc.chPrev ) { + sc.ChangeState(SCE_ERLANG_NODE_NAME); + sc.ForwardSetState(SCE_ERLANG_DEFAULT); + parse_state = STATE_NULL; + } + break; + case NODE_NAME_UNQUOTED: + if ( '@' == sc.ch ) { + sc.SetState(SCE_ERLANG_DEFAULT); + parse_state = STATE_NULL; + } else if ( !isalnum(sc.ch) && sc.ch != '_' ) { + sc.ChangeState(SCE_ERLANG_NODE_NAME); + sc.SetState(SCE_ERLANG_DEFAULT); + parse_state = STATE_NULL; + } + break; + case RECORD_START: + if ( '\'' == sc.ch ) { + parse_state = RECORD_QUOTED; + } else if (isalpha(sc.ch) && islower(sc.ch)) { + parse_state = RECORD_UNQUOTED; + } else { // error + sc.SetState(SCE_ERLANG_DEFAULT); + parse_state = STATE_NULL; + } + break; + case RECORD_QUOTED: + if ( '\'' == sc.ch && '\\' != sc.chPrev ) { + sc.ChangeState(SCE_ERLANG_RECORD); + sc.ForwardSetState(SCE_ERLANG_DEFAULT); + parse_state = STATE_NULL; + } + break; + case RECORD_UNQUOTED: + if ( !isalpha(sc.ch) && '_' != sc.ch ) { + sc.ChangeState(SCE_ERLANG_RECORD); + sc.SetState(SCE_ERLANG_DEFAULT); + parse_state = STATE_NULL; + } + break; + case MACRO_START: + if ( '\'' == sc.ch ) { + parse_state = MACRO_QUOTED; + } else if (isalpha(sc.ch)) { + parse_state = MACRO_UNQUOTED; + } else { // error + sc.SetState(SCE_ERLANG_DEFAULT); + parse_state = STATE_NULL; + } + break; + case MACRO_UNQUOTED: + if ( !isalpha(sc.ch) && '_' != sc.ch ) { + sc.ChangeState(SCE_ERLANG_MACRO); + sc.SetState(SCE_ERLANG_DEFAULT); + parse_state = STATE_NULL; + } + break; + case MACRO_QUOTED: + if ( '\'' == sc.ch && '\\' != sc.chPrev ) { + sc.ChangeState(SCE_ERLANG_MACRO); + sc.ForwardSetState(SCE_ERLANG_DEFAULT); + parse_state = STATE_NULL; + } + break; + case NUMERAL_START: + if ( isdigit(sc.ch) ) { + radix_digits *= 10; + radix_digits += sc.ch - '0'; // Assuming ASCII here! + } else if ( '#' == sc.ch ) { + if ( 2 > radix_digits || 16 < radix_digits) { + sc.SetState(SCE_ERLANG_DEFAULT); + parse_state = STATE_NULL; + } else { + parse_state = NUMERAL_RADIX_LITERAL; + } + } else if ( '.' == sc.ch && isdigit(sc.chNext)) { + radix_digits = 0; + parse_state = NUMERAL_FLOAT_MANTISSA; + } else if ( 'e' == sc.ch || 'E' == sc.ch ) { + exponent_digits = 0; + parse_state = NUMERAL_FLOAT_EXPONENT; + } else { + radix_digits = 0; + sc.ChangeState(SCE_ERLANG_NUMBER); + sc.SetState(SCE_ERLANG_DEFAULT); + parse_state = STATE_NULL; + } + break; + case NUMERAL_RADIX_LITERAL: + if ( !is_radix(radix_digits,sc.ch) ) { + radix_digits = 0; + if ( !isalnum(sc.ch) ) { + sc.ChangeState(SCE_ERLANG_NUMBER); + } + sc.SetState(SCE_ERLANG_DEFAULT); + parse_state = STATE_NULL; + } + break; + case NUMERAL_FLOAT_MANTISSA: + if ( 'e' == sc.ch || 'E' == sc.ch ) { + exponent_digits = 0; + parse_state = NUMERAL_FLOAT_EXPONENT; + } else if ( !isdigit(sc.ch) ) { + sc.ChangeState(SCE_ERLANG_NUMBER); + sc.SetState(SCE_ERLANG_DEFAULT); + parse_state = STATE_NULL; + } + break; + case NUMERAL_FLOAT_EXPONENT: + if ( '-' == sc.ch || '+' == sc.ch ) { + parse_state = NUMERAL_FLOAT_SIGNED_EXPONENT; + } else if ( !isdigit(sc.ch) ) { + if ( 0 < exponent_digits ) { + sc.ChangeState(SCE_ERLANG_NUMBER); + } + sc.SetState(SCE_ERLANG_DEFAULT); + parse_state = STATE_NULL; + } else { + ++exponent_digits; + } + break; + case NUMERAL_FLOAT_SIGNED_EXPONENT: + if ( !isdigit(sc.ch) ) { + if ( 0 < exponent_digits ) { + sc.ChangeState(SCE_ERLANG_NUMBER); + } + sc.SetState(SCE_ERLANG_DEFAULT); + parse_state = STATE_NULL; + } else { + ++exponent_digits; + } + break; + case NUMERAL_SIGNED: + if ( !isdigit(sc.ch) ) { + sc.ChangeState(SCE_ERLANG_NUMBER); + sc.SetState(SCE_ERLANG_DEFAULT); + parse_state = STATE_NULL; + } else if ( '.' == sc.ch ) { + parse_state = NUMERAL_FLOAT_MANTISSA; + } + break; + case NUMERAL_SPECULATIVE_MANTISSA: + if ( !isdigit(sc.ch) ) { + sc.ChangeState(SCE_ERLANG_OPERATOR); + sc.SetState(SCE_ERLANG_DEFAULT); + parse_state = STATE_NULL; + } else { + parse_state = NUMERAL_FLOAT_MANTISSA; + } + break; + case PARSE_ERROR: + sc.SetState(SCE_ERLANG_DEFAULT); + parse_state = STATE_NULL; + break; + } + } else if (sc.state == SCE_ERLANG_OPERATOR) { + if (sc.chPrev == '.') { + if (sc.ch == '*' || sc.ch == '/' || sc.ch == '\\' || sc.ch == '^') { + sc.ForwardSetState(SCE_ERLANG_DEFAULT); + } else if (sc.ch == '\'') { + sc.ForwardSetState(SCE_ERLANG_DEFAULT); + } else { + sc.SetState(SCE_ERLANG_DEFAULT); + } + } else { + sc.SetState(SCE_ERLANG_DEFAULT); + } + } else if (sc.state == SCE_ERLANG_VARIABLE) { + if (!isalnum(sc.ch) && sc.ch != '_') { + sc.SetState(SCE_ERLANG_DEFAULT); + } + } else if (sc.state == SCE_ERLANG_STRING) { + if (sc.ch == '\"' && sc.chPrev != '\\') { + sc.ForwardSetState(SCE_ERLANG_DEFAULT); + } + } else if (sc.state == SCE_ERLANG_COMMENT ) { + if (sc.atLineEnd) { + sc.SetState(SCE_ERLANG_DEFAULT); + } + } else if (sc.state == SCE_ERLANG_CHARACTER ) { + if ( sc.chPrev == '\\' ) { + sc.ForwardSetState(SCE_ERLANG_DEFAULT); + } else if ( sc.ch != '\\' ) { + sc.ForwardSetState(SCE_ERLANG_DEFAULT); + } + } + + if (sc.state == SCE_ERLANG_DEFAULT) { + if (sc.ch == '%') { + sc.SetState(SCE_ERLANG_COMMENT); + } else if (sc.ch == '\"') { + sc.SetState(SCE_ERLANG_STRING); + } else if (sc.ch == '#') { + parse_state = RECORD_START; + sc.SetState(SCE_ERLANG_UNKNOWN); + } else if (sc.ch == '?') { + parse_state = MACRO_START; + sc.SetState(SCE_ERLANG_UNKNOWN); + } else if (sc.ch == '$') { + sc.SetState(SCE_ERLANG_CHARACTER); + } else if (sc.ch == '\'') { + parse_state = ATOM_QUOTED; + sc.SetState(SCE_ERLANG_UNKNOWN); + } else if ( isdigit(sc.ch) ) { + parse_state = NUMERAL_START; + radix_digits = sc.ch - '0'; + sc.SetState(SCE_ERLANG_UNKNOWN); + } else if ( '.' == sc.ch ) { + parse_state = NUMERAL_SPECULATIVE_MANTISSA; + sc.SetState(SCE_ERLANG_UNKNOWN); + } else if (isalpha(sc.ch) && isupper(sc.ch)) { + sc.SetState(SCE_ERLANG_VARIABLE); + } else if (isalpha(sc.ch)) { + parse_state = ATOM_UNQUOTED; + sc.SetState(SCE_ERLANG_UNKNOWN); + } else if (isoperator(static_cast(sc.ch)) || sc.ch == '\\') { + sc.SetState(SCE_ERLANG_OPERATOR); + } + } + } + sc.Complete(); +} + +static int ClassifyFoldPointErlang( + Accessor &styler, + int styleNext, + int keyword_start +) { + int lev = 0; + if ( styler.Match(keyword_start,"case") + || ( + styler.Match(keyword_start,"fun") + && SCE_ERLANG_FUNCTION_NAME != styleNext) + || styler.Match(keyword_start,"if") + || styler.Match(keyword_start,"query") + || styler.Match(keyword_start,"receive") + ) { + ++lev; + } else if ( styler.Match(keyword_start,"end") ) { + --lev; + } + return lev; +} + + +static void FoldErlangDoc( + unsigned int startPos, int length, int initStyle, + WordList** /*keywordlists*/, Accessor &styler +) { + unsigned int endPos = startPos + length; + //~ int visibleChars = 0; + int lineCurrent = styler.GetLine(startPos); + int levelPrev = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK; + int levelCurrent = levelPrev; + char chNext = styler.SafeGetCharAt(startPos); + int styleNext = styler.StyleAt(startPos); + int style = initStyle; + int keyword_start = 0; + + bool fold_keywords = true; + bool fold_comments = true; + bool fold_braces = true; + bool fold_function_clauses = false; + bool fold_clauses = false; + + //int clause_level = 0; + + for (unsigned int i = startPos; i < endPos; i++) { + char ch = chNext; + chNext = styler.SafeGetCharAt(i + 1); + int stylePrev = style; + style = styleNext; + styleNext = styler.StyleAt(i + 1); + bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n'); + + if ( (stylePrev != SCE_ERLANG_KEYWORD) && (style == SCE_ERLANG_KEYWORD) ) { + keyword_start = i; + } + if ( fold_keywords ) { + if ( (stylePrev == SCE_ERLANG_KEYWORD) + && (style != SCE_ERLANG_KEYWORD) + && (style != SCE_ERLANG_ATOM) + ) { + levelCurrent += ClassifyFoldPointErlang(styler,styleNext,keyword_start); + } + } + + if ( fold_comments ) { + if (style == SCE_ERLANG_COMMENT) { + if ((ch == '%') && (chNext == '{')) { + levelCurrent++; + } else if ((ch == '%') && (chNext == '}')) { + levelCurrent--; + } + } + } + + if ( fold_function_clauses ) { + if ( (SC_FOLDLEVELBASE == levelCurrent) /*&& (style == SCE_ERLANG_OPERATOR)*/ ) { + if ( (ch == '-') && (chNext == '>')) { + //~ fprintf(stderr,"levelCurrent=%d\n", levelCurrent); + //++clause_level; + //~ if ( 0 < clause_level ) + ++levelCurrent; + } + } + //~ if ( (stylePrev != SCE_ERLANG_RECORD) + //~ && (style != SCE_ERLANG_NUMBER) + //~ && (style != SCE_ERLANG_STRING) + //~ && (style != SCE_ERLANG_COMMENT) + //~ ) { + if ( (SC_FOLDLEVELBASE+1 == levelCurrent) && (ch == '.') ) { + //--clause_level; + //~ if ( 0 == clause_level ) + --levelCurrent; + } + //~ } + } + + if ( fold_clauses ) { + if ( (0 < levelCurrent) && (style == SCE_ERLANG_OPERATOR) ) { + if ((ch == '-') && (chNext == '>')) { + levelCurrent++; + } + if ( (ch == ';') ) { + levelCurrent--; + } + } + if ( (stylePrev != SCE_ERLANG_RECORD) + && (style != SCE_ERLANG_NUMBER) + && (style != SCE_ERLANG_STRING) + && (style != SCE_ERLANG_COMMENT) + ) { + if ( (ch == '.') ) { + levelCurrent--; + } + } + if ( (stylePrev == SCE_ERLANG_KEYWORD) + && (style != SCE_ERLANG_KEYWORD) + && (style != SCE_ERLANG_ATOM) + && ( + styler.Match(keyword_start,"end") // 'end' counted twice if fold_keywords too + || styler.Match(keyword_start,"after") ) + ) { + levelCurrent--; + } + } + + if ( fold_braces ) { + if (style == SCE_ERLANG_OPERATOR) { + if ( (ch == '{') || (ch == '(') || (ch == '[') ) { + levelCurrent++; + } else if ( (ch == '}') || (ch == ')') || (ch == ']') ) { + levelCurrent--; + } + } + } + + if (atEOL) { + int lev = levelPrev; + //~ if (visibleChars == 0 && foldCompact) + //~ lev |= SC_FOLDLEVELWHITEFLAG; + //~ if ((levelCurrent > levelPrev) && (visibleChars > 0)) + if ((levelCurrent > levelPrev)) { + lev |= SC_FOLDLEVELHEADERFLAG; + } + if (lev != styler.LevelAt(lineCurrent)) { + styler.SetLevel(lineCurrent, lev); + } + lineCurrent++; + levelPrev = levelCurrent; + //~ visibleChars = 0; + } + //~ if (!isspacechar(ch)) + //~ visibleChars++; + + } + // Fill in the real level of the next line, keeping the current flags as they will be filled in later + int flagsNext = styler.LevelAt(lineCurrent) & ~SC_FOLDLEVELNUMBERMASK; + styler.SetLevel(lineCurrent, levelPrev | flagsNext); +} + +static const char * const erlangWordListDesc[] = { + "Keywords", + 0 +}; + +LexerModule lmErlang( + SCLEX_ERLANG, + ColouriseErlangDoc, + "erlang", + FoldErlangDoc, + erlangWordListDesc); + diff --git a/src/LexFlagship.cpp b/src/LexFlagship.cpp new file mode 100644 index 0000000..db0314e --- /dev/null +++ b/src/LexFlagship.cpp @@ -0,0 +1,226 @@ +// Scintilla source code edit control +/** @file LexFlagShip.cxx + ** Lexer for FlagShip + ** (Syntactically compatible to other XBase dialects, like dBase, Clipper, Fox etc.) + **/ +// Copyright 2005 by Randy Butler +// Copyright 1998-2003 by Neil Hodgson +// The License.txt file describes the conditions under which this software may be distributed. + +#include +#include +#include +#include +#include + +#include "Platform.h" + +#include "PropSet.h" +#include "Accessor.h" +#include "StyleContext.h" +#include "KeyWords.h" +#include "Scintilla.h" +#include "SciLexer.h" + +static bool IsFlagShipComment(Accessor &styler, int pos, int len) { + return len>0 && styler[pos]=='\''; +} + +static inline bool IsTypeCharacter(int ch) { + return ch == '%' || ch == '&' || ch == '@' || ch == '!' || ch == '#' || ch == '$'; +} + +// Extended to accept accented characters +static inline bool IsAWordChar(int ch) { + return ch >= 0x80 || + (isalnum(ch) || ch == '.' || ch == '_'); +} + +static inline bool IsAWordStart(int ch) { + return ch >= 0x80 || + (isalnum(ch) || ch == '_'); +} + +static inline bool IsADateCharacter(const int ch) { + return (ch < 0x80) && + (isalnum(ch) || ch == '|' || ch == '-' || ch == '/' || ch == ':' || ch == ' ' || ch == '\t'); +} + + +static void ColouriseFlagShipDoc(unsigned int startPos, int length, int initStyle, + WordList *keywordlists[], Accessor &styler) { + + //bool FSScriptSyntax = true; + WordList &keywords = *keywordlists[0]; + WordList &keywords2 = *keywordlists[1]; + WordList &keywords3 = *keywordlists[2]; + WordList &keywords4 = *keywordlists[3]; + + styler.StartAt(startPos); + + int visibleChars = 0; + + StyleContext sc(startPos, length, initStyle, styler); + + for (; sc.More(); sc.Forward()) { + + if (sc.state == SCE_FS_OPERATOR) { + sc.SetState(SCE_FS_DEFAULT); + } else if (sc.state == SCE_FS_IDENTIFIER) { + if (!IsAWordChar(sc.ch)) { + char s[100]; + sc.GetCurrentLowered(s, sizeof(s)); + if (keywords.InList(s)) { + sc.ChangeState(SCE_FS_KEYWORD); + } else if (keywords2.InList(s)) { + sc.ChangeState(SCE_FS_KEYWORD2); + } else if (keywords3.InList(s)) { + sc.ChangeState(SCE_FS_KEYWORD3); + } else if (keywords4.InList(s)) { + sc.ChangeState(SCE_FS_KEYWORD4); + }// Else, it is really an identifier... + sc.SetState(SCE_FS_DEFAULT); + } + } else if (sc.state == SCE_FS_NUMBER) { + if (!IsAWordChar(sc.ch)) { + sc.SetState(SCE_FS_DEFAULT); + } + } else if (sc.state == SCE_FS_STRING) { + // VB doubles quotes to preserve them, so just end this string + // state now as a following quote will start again + if (sc.ch == '\"') { + if (tolower(sc.chNext) == 'c') { + sc.Forward(); + } + sc.ForwardSetState(SCE_FS_DEFAULT); + } else if (sc.atLineEnd) { + sc.ChangeState(SCE_FS_STRINGEOL); + sc.ForwardSetState(SCE_FS_DEFAULT); + } + } else if (sc.state == SCE_FS_COMMENT) { + if (sc.Match('*', '/')) { // new code + sc.Forward(); + sc.ForwardSetState(SCE_FS_DEFAULT); + //if (sc.atLineEnd) { // old code + // sc.SetState(SCE_FS_DEFAULT); + } + } else if (sc.state == SCE_FS_COMMENTLINE) { //new code + if (sc.ch == '\r' || sc.ch == '\n') { + sc.SetState(SCE_FS_DEFAULT); + visibleChars = 0; + } + } else if (sc.state == SCE_FS_PREPROCESSOR) { + if (sc.atLineEnd) { + sc.SetState(SCE_FS_DEFAULT); + } + } else if (sc.state == SCE_FS_DATE) { + if (sc.ch == '#' || !IsADateCharacter(sc.chNext)) { + sc.ForwardSetState(SCE_FS_DEFAULT); + } + } + + // Determine if a new state should be entered. + if (sc.state == SCE_FS_DEFAULT) { + if (sc.Match('/', '*')) { // New code + sc.SetState(SCE_FS_COMMENT); + sc.Forward(); // Eat the * so it isn't used for the end of the comment + //if (sc.ch == '\'') { // Old code + // sc.SetState(SCE_FS_COMMENT); // old code + } else if (sc.Match('/', '/')) { // New code + sc.SetState(SCE_FS_COMMENTLINE); + } else if (sc.ch == '\"') { + sc.SetState(SCE_FS_STRING); + } else if (sc.ch == '#' && visibleChars == 0) { + // Preprocessor commands are alone on their line + sc.SetState(SCE_FS_PREPROCESSOR); + } else if (sc.ch == '#') { + int n = 1; + int chSeek = ' '; + while ((n < 100) && (chSeek == ' ' || chSeek == '\t')) { + chSeek = sc.GetRelative(n); + n++; + } + if (IsADigit(chSeek)) { + sc.SetState(SCE_FS_DATE); + } else { + sc.SetState(SCE_FS_OPERATOR); + } + } else if (sc.ch == '&' && tolower(sc.chNext) == 'h') { + sc.SetState(SCE_FS_NUMBER); + } else if (sc.ch == '&' && tolower(sc.chNext) == 'o') { + sc.SetState(SCE_FS_NUMBER); + } else if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext))) { + sc.SetState(SCE_FS_NUMBER); + } else if (IsAWordStart(sc.ch) || (sc.ch == '[')) { + sc.SetState(SCE_FS_IDENTIFIER); + } else if (isoperator(static_cast(sc.ch)) || (sc.ch == '\\')) { + sc.SetState(SCE_FS_OPERATOR); + } + } + + if (sc.atLineEnd) { + visibleChars = 0; + } + if (!IsASpace(sc.ch)) { + visibleChars++; + } + } + sc.Complete(); +} + +static void FoldFlagShipDoc(unsigned int startPos, int length, int, + WordList *[], Accessor &styler) { + + int endPos = startPos + length; + + // Backtrack to previous line in case need to fix its fold status + int lineCurrent = styler.GetLine(startPos); + if (startPos > 0) { + if (lineCurrent > 0) { + lineCurrent--; + startPos = styler.LineStart(lineCurrent); + } + } + int spaceFlags = 0; + int indentCurrent = styler.IndentAmount(lineCurrent, &spaceFlags, IsFlagShipComment); + char chNext = styler[startPos]; + for (int i = startPos; i < endPos; i++) { + char ch = chNext; + chNext = styler.SafeGetCharAt(i + 1); + + if ((ch == '\r' && chNext != '\n') || (ch == '\n') || (i == endPos)) { + int lev = indentCurrent; + int indentNext = styler.IndentAmount(lineCurrent + 1, &spaceFlags, IsFlagShipComment); + if (!(indentCurrent & SC_FOLDLEVELWHITEFLAG)) { + // Only non whitespace lines can be headers + if ((indentCurrent & SC_FOLDLEVELNUMBERMASK) < (indentNext & SC_FOLDLEVELNUMBERMASK)) { + lev |= SC_FOLDLEVELHEADERFLAG; + } else if (indentNext & SC_FOLDLEVELWHITEFLAG) { + // Line after is blank so check the next - maybe should continue further? + int spaceFlags2 = 0; + int indentNext2 = styler.IndentAmount(lineCurrent + 2, &spaceFlags2, IsFlagShipComment); + if ((indentCurrent & SC_FOLDLEVELNUMBERMASK) < (indentNext2 & SC_FOLDLEVELNUMBERMASK)) { + lev |= SC_FOLDLEVELHEADERFLAG; + } + } + } + indentCurrent = indentNext; + styler.SetLevel(lineCurrent, lev); + lineCurrent++; + } + } +} + + +static const char * const FSWordListDesc[] = { + "Keywords", + "functions", + "user2", + "user3", + 0 +}; + +LexerModule lmFlagShip(SCLEX_FLAGSHIP, ColouriseFlagShipDoc, "flagship", FoldFlagShipDoc, FSWordListDesc); + + + diff --git a/src/LexForth.cpp b/src/LexForth.cpp new file mode 100755 index 0000000..3f12815 --- /dev/null +++ b/src/LexForth.cpp @@ -0,0 +1,348 @@ +// Scintilla source code edit control +/** @file LexCrontab.cxx + ** Lexer to use with extended crontab files used by a powerful + ** Windows scheduler/event monitor/automation manager nnCron. + ** (http://nemtsev.eserv.ru/) + **/ +// Copyright 1998-2001 by Neil Hodgson +// The License.txt file describes the conditions under which this software may be distributed. + +#include +#include +#include +#include +#include + +#include "Platform.h" + +#include "PropSet.h" +#include "Accessor.h" +#include "KeyWords.h" +#include "Scintilla.h" +#include "SciLexer.h" + +bool is_whitespace(int ch){ + return ch == '\n' || ch == '\r' || ch == '\t' || ch == ' '; +} + +bool is_blank(int ch){ + return ch == '\t' || ch == ' '; +} +//#define FORTH_DEBUG +#ifdef FORTH_DEBUG +static FILE *f_debug; +#define log(x) fputs(f_debug,x); +#else +#define log(x) +#endif + +#define STATE_LOCALE +#define BL ' ' + +static Accessor *st; +static int cur_pos,pos1,pos2,pos0,lengthDoc; +char *buffer; + +char getChar(bool is_bl){ + char ch=st->SafeGetCharAt(cur_pos); + if(is_bl) if(is_whitespace(ch)) ch=BL; + return ch; +} + +char getCharBL(){ + char ch=st->SafeGetCharAt(cur_pos); + return ch; +} +bool is_eol(char ch){ + return ch=='\n' || ch=='\r'; +} + +int parse(char ch, bool skip_eol){ +// pos1 - start pos of word +// pos2 - pos after of word +// pos0 - start pos + char c=0; + int len; + bool is_bl=ch==BL; + pos0=pos1=pos2=cur_pos; + for(;cur_pos9 && base>10) digit-=7; + if(digit<0) return false; + if(digit>=base) return false; + } + return true; +} + +bool is_number(char *s){ + if(strncmp(s,"0x",2)==0) return _is_number(s+2,16); + return _is_number(s,10); +} + +static void ColouriseForthDoc(unsigned int startPos, int length, int, WordList *keywordLists[], Accessor &styler) +{ + st=&styler; + cur_pos=startPos; + lengthDoc = startPos + length; + buffer = new char[length]; + +#ifdef FORTH_DEBUG + f_debug=fopen("c:\\sci.log","at"); +#endif + + WordList &control = *keywordLists[0]; + WordList &keyword = *keywordLists[1]; + WordList &defword = *keywordLists[2]; + WordList &preword1 = *keywordLists[3]; + WordList &preword2 = *keywordLists[4]; + WordList &strings = *keywordLists[5]; + + // go through all provided text segment + // using the hand-written state machine shown below + styler.StartAt(startPos); + styler.StartSegment(startPos); + while(parse(BL,true)!=0){ + if(pos0!=pos1){ + styler.ColourTo(pos0,SCE_FORTH_DEFAULT); + styler.ColourTo(pos1-1,SCE_FORTH_DEFAULT); + } + if(strcmp("\\",buffer)==0){ + styler.ColourTo(pos1,SCE_FORTH_COMMENT); + parse(1,false); + styler.ColourTo(pos2,SCE_FORTH_COMMENT); + }else if(strcmp("(",buffer)==0){ + styler.ColourTo(pos1,SCE_FORTH_COMMENT); + parse(')',true); + if(cur_pos +// The License.txt file describes the conditions under which this software may be distributed. +/***************************************/ +#include +#include +#include +#include +#include +/***************************************/ +#include "Platform.h" +#include "PropSet.h" +#include "Accessor.h" +#include "StyleContext.h" +#include "KeyWords.h" +#include "Scintilla.h" +#include "SciLexer.h" +/***********************************************/ +static inline bool IsAWordChar(const int ch) { + return (ch < 0x80) && (isalnum(ch) || ch == '_' || ch == '%'); +} +/**********************************************/ +static inline bool IsAWordStart(const int ch) { + return (ch < 0x80) && (isalnum(ch)); +} +/***************************************/ +inline bool IsABlank(unsigned int ch) { + return (ch == ' ') || (ch == 0x09) || (ch == 0x0b) ; +} +/***************************************/ +inline bool IsALineEnd(char ch) { + return ((ch == '\n') || (ch == '\r')) ; +} +/***************************************/ +unsigned int GetContinuedPos(unsigned int pos, Accessor &styler) { + while (!IsALineEnd(styler.SafeGetCharAt(pos++))) continue; + if (styler.SafeGetCharAt(pos) == '\n') pos++; + while (IsABlank(styler.SafeGetCharAt(pos++))) continue; + char chCur = styler.SafeGetCharAt(pos); + if (chCur == '&') { + while (IsABlank(styler.SafeGetCharAt(++pos))) continue; + return pos; + } else { + return pos; + } +} +/***************************************/ +static void ColouriseFortranDoc(unsigned int startPos, int length, int initStyle, + WordList *keywordlists[], Accessor &styler, bool isFixFormat) { + WordList &keywords = *keywordlists[0]; + WordList &keywords2 = *keywordlists[1]; + WordList &keywords3 = *keywordlists[2]; + /***************************************/ + int posLineStart = 0, numNonBlank = 0, prevState = 0; + int endPos = startPos + length; + /***************************************/ + // backtrack to the nearest keyword + while ((startPos > 1) && (styler.StyleAt(startPos) != SCE_F_WORD)) { + startPos--; + } + startPos = styler.LineStart(styler.GetLine(startPos)); + initStyle = styler.StyleAt(startPos - 1); + StyleContext sc(startPos, endPos-startPos, initStyle, styler); + /***************************************/ + for (; sc.More(); sc.Forward()) { + // remember the start position of the line + if (sc.atLineStart) { + posLineStart = sc.currentPos; + numNonBlank = 0; + sc.SetState(SCE_F_DEFAULT); + } + if (!IsASpaceOrTab(sc.ch)) numNonBlank ++; + /***********************************************/ + // Handle the fix format generically + int toLineStart = sc.currentPos - posLineStart; + if (isFixFormat && (toLineStart < 6 || toLineStart > 72)) { + if (toLineStart == 0 && (tolower(sc.ch) == 'c' || sc.ch == '*') || sc.ch == '!') { + sc.SetState(SCE_F_COMMENT); + while (!sc.atLineEnd && sc.More()) sc.Forward(); // Until line end + } else if (toLineStart > 72) { + sc.SetState(SCE_F_COMMENT); + while (!sc.atLineEnd && sc.More()) sc.Forward(); // Until line end + } else if (toLineStart < 5) { + if (IsADigit(sc.ch)) + sc.SetState(SCE_F_LABEL); + else + sc.SetState(SCE_F_DEFAULT); + } else if (toLineStart == 5) { + if (!IsASpace(sc.ch) && sc.ch != '0') { + sc.SetState(SCE_F_CONTINUATION); + sc.ForwardSetState(prevState); + } else + sc.SetState(SCE_F_DEFAULT); + } + continue; + } + /***************************************/ + // Handle line continuation generically. + if (!isFixFormat && sc.ch == '&') { + char chTemp = ' '; + int j = 1; + while (IsABlank(chTemp) && j<132) { + chTemp = static_cast(sc.GetRelative(j)); + j++; + } + if (chTemp == '!') { + sc.SetState(SCE_F_CONTINUATION); + if (sc.chNext == '!') sc.ForwardSetState(SCE_F_COMMENT); + } else if (chTemp == '\r' || chTemp == '\n') { + int currentState = sc.state; + sc.SetState(SCE_F_CONTINUATION); + sc.ForwardSetState(SCE_F_DEFAULT); + while (IsASpace(sc.ch) && sc.More()) sc.Forward(); + if (sc.ch == '&') { + sc.SetState(SCE_F_CONTINUATION); + sc.Forward(); + } + sc.SetState(currentState); + } + } + /***************************************/ + // Determine if the current state should terminate. + if (sc.state == SCE_F_OPERATOR) { + sc.SetState(SCE_F_DEFAULT); + } else if (sc.state == SCE_F_NUMBER) { + if (!(IsAWordChar(sc.ch) || sc.ch=='\'' || sc.ch=='\"' || sc.ch=='.')) { + sc.SetState(SCE_F_DEFAULT); + } + } else if (sc.state == SCE_F_IDENTIFIER) { + if (!IsAWordChar(sc.ch) || (sc.ch == '%')) { + char s[100]; + sc.GetCurrentLowered(s, sizeof(s)); + if (keywords.InList(s)) { + sc.ChangeState(SCE_F_WORD); + } else if (keywords2.InList(s)) { + sc.ChangeState(SCE_F_WORD2); + } else if (keywords3.InList(s)) { + sc.ChangeState(SCE_F_WORD3); + } + sc.SetState(SCE_F_DEFAULT); + } + } else if (sc.state == SCE_F_COMMENT || sc.state == SCE_F_PREPROCESSOR) { + if (sc.ch == '\r' || sc.ch == '\n') { + sc.SetState(SCE_F_DEFAULT); + } + } else if (sc.state == SCE_F_STRING1) { + prevState = sc.state; + if (sc.ch == '\'') { + if (sc.chNext == '\'') { + sc.Forward(); + } else { + sc.ForwardSetState(SCE_F_DEFAULT); + prevState = SCE_F_DEFAULT; + } + } else if (sc.atLineEnd) { + sc.ChangeState(SCE_F_STRINGEOL); + sc.ForwardSetState(SCE_F_DEFAULT); + } + } else if (sc.state == SCE_F_STRING2) { + prevState = sc.state; + if (sc.atLineEnd) { + sc.ChangeState(SCE_F_STRINGEOL); + sc.ForwardSetState(SCE_F_DEFAULT); + } else if (sc.ch == '\"') { + if (sc.chNext == '\"') { + sc.Forward(); + } else { + sc.ForwardSetState(SCE_F_DEFAULT); + prevState = SCE_F_DEFAULT; + } + } + } else if (sc.state == SCE_F_OPERATOR2) { + if (sc.ch == '.') { + sc.ForwardSetState(SCE_F_DEFAULT); + } + } else if (sc.state == SCE_F_CONTINUATION) { + sc.SetState(SCE_F_DEFAULT); + } else if (sc.state == SCE_F_LABEL) { + if (!IsADigit(sc.ch)) { + sc.SetState(SCE_F_DEFAULT); + } else { + if (isFixFormat && sc.currentPos-posLineStart > 4) + sc.SetState(SCE_F_DEFAULT); + else if (numNonBlank > 5) + sc.SetState(SCE_F_DEFAULT); + } + } + /***************************************/ + // Determine if a new state should be entered. + if (sc.state == SCE_F_DEFAULT) { + if (sc.ch == '!') { + if (sc.chNext == '$') { + sc.SetState(SCE_F_PREPROCESSOR); + } else { + sc.SetState(SCE_F_COMMENT); + } + } else if ((!isFixFormat) && IsADigit(sc.ch) && numNonBlank == 1) { + sc.SetState(SCE_F_LABEL); + } else if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext))) { + sc.SetState(SCE_F_NUMBER); + } else if ((tolower(sc.ch) == 'b' || tolower(sc.ch) == 'o' || + tolower(sc.ch) == 'z') && (sc.chNext == '\"' || sc.chNext == '\'')) { + sc.SetState(SCE_F_NUMBER); + sc.Forward(); + } else if (sc.ch == '.' && isalpha(sc.chNext)) { + sc.SetState(SCE_F_OPERATOR2); + } else if (IsAWordStart(sc.ch)) { + sc.SetState(SCE_F_IDENTIFIER); + } else if (sc.ch == '\"') { + sc.SetState(SCE_F_STRING2); + } else if (sc.ch == '\'') { + sc.SetState(SCE_F_STRING1); + } else if (isoperator(static_cast(sc.ch))) { + sc.SetState(SCE_F_OPERATOR); + } + } + } + sc.Complete(); +} +/***************************************/ +// To determine the folding level depending on keywords +static int classifyFoldPointFortran(const char* s, const char* prevWord, const char chNextNonBlank) { + int lev = 0; + if ((strcmp(prevWord, "else") == 0 && strcmp(s, "if") == 0) || strcmp(s, "elseif") == 0) + return -1; + if (strcmp(s, "associate") == 0 || strcmp(s, "block") == 0 + || strcmp(s, "blockdata") == 0 || strcmp(s, "select") == 0 + || strcmp(s, "do") == 0 || strcmp(s, "enum") ==0 + || strcmp(s, "function") == 0 || strcmp(s, "interface") == 0 + || strcmp(s, "module") == 0 || strcmp(s, "program") == 0 + || strcmp(s, "subroutine") == 0 || strcmp(s, "then") == 0 + || (strcmp(s, "type") == 0 && chNextNonBlank != '(') ){ + if (strcmp(prevWord, "end") == 0) + lev = 0; + else + lev = 1; + } else if (strcmp(s, "end") == 0 && chNextNonBlank != '=' + || strcmp(s, "endassociate") == 0 || strcmp(s, "endblock") == 0 + || strcmp(s, "endblockdata") == 0 || strcmp(s, "endselect") == 0 + || strcmp(s, "enddo") == 0 || strcmp(s, "endenum") ==0 + || strcmp(s, "endif") == 0 || strcmp(s, "endforall") == 0 + || strcmp(s, "endfunction") == 0 || strcmp(s, "endinterface") == 0 + || strcmp(s, "endmodule") == 0 || strcmp(s, "endprogram") == 0 + || strcmp(s, "endsubroutine") == 0 || strcmp(s, "endtype") == 0 + || strcmp(s, "endwhere") == 0 + || strcmp(s, "procedure") == 0 ) { // Take care of the module procedure statement + lev = -1; + } else if (strcmp(prevWord, "end") == 0 && strcmp(s, "if") == 0){ // end if + lev = 0; + } + return lev; +} +// Folding the code +static void FoldFortranDoc(unsigned int startPos, int length, int initStyle, + Accessor &styler, bool isFixFormat) { + // + // bool foldComment = styler.GetPropertyInt("fold.comment") != 0; + // Do not know how to fold the comment at the moment. + // + bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0; + unsigned int endPos = startPos + length; + int visibleChars = 0; + int lineCurrent = styler.GetLine(startPos); + int levelPrev = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK; + int levelCurrent = levelPrev; + char chNext = styler[startPos]; + char chNextNonBlank; + int styleNext = styler.StyleAt(startPos); + int style = initStyle; + /***************************************/ + int lastStart = 0; + char prevWord[32] = ""; + char Label[6] = ""; + // Variables for do label folding. + static int doLabels[100]; + static int posLabel=-1; + /***************************************/ + for (unsigned int i = startPos; i < endPos; i++) { + char ch = chNext; + chNext = styler.SafeGetCharAt(i + 1); + chNextNonBlank = chNext; + unsigned int j=i+1; + while(IsABlank(chNextNonBlank) && j(tolower(styler[lastStart+k])); + } + s[k] = '\0'; + // Handle the forall and where statement and structure. + if (strcmp(s, "forall") == 0 || strcmp(s, "where") == 0) { + if (strcmp(prevWord, "end") != 0) { + j = i + 1; + char chBrace = '(', chSeek = ')', ch1 = styler.SafeGetCharAt(j); + // Find the position of the first ( + while (ch1 != chBrace && j -1) { + levelCurrent--; + posLabel--; + } + } + } + if (atEOL) { + int lev = levelPrev; + if (visibleChars == 0 && foldCompact) + lev |= SC_FOLDLEVELWHITEFLAG; + if ((levelCurrent > levelPrev) && (visibleChars > 0)) + lev |= SC_FOLDLEVELHEADERFLAG; + if (lev != styler.LevelAt(lineCurrent)) { + styler.SetLevel(lineCurrent, lev); + } + lineCurrent++; + levelPrev = levelCurrent; + visibleChars = 0; + strcpy(prevWord, ""); + } + /***************************************/ + if (!isspacechar(ch)) visibleChars++; + } + /***************************************/ + // Fill in the real level of the next line, keeping the current flags as they will be filled in later + int flagsNext = styler.LevelAt(lineCurrent) & ~SC_FOLDLEVELNUMBERMASK; + styler.SetLevel(lineCurrent, levelPrev | flagsNext); +} +/***************************************/ +static const char * const FortranWordLists[] = { + "Primary keywords and identifiers", + "Intrinsic functions", + "Extended and user defined functions", + 0, +}; +/***************************************/ +static void ColouriseFortranDocFreeFormat(unsigned int startPos, int length, int initStyle, WordList *keywordlists[], + Accessor &styler) { + ColouriseFortranDoc(startPos, length, initStyle, keywordlists, styler, false); +} +/***************************************/ +static void ColouriseFortranDocFixFormat(unsigned int startPos, int length, int initStyle, WordList *keywordlists[], + Accessor &styler) { + ColouriseFortranDoc(startPos, length, initStyle, keywordlists, styler, true); +} +/***************************************/ +static void FoldFortranDocFreeFormat(unsigned int startPos, int length, int initStyle, + WordList *[], Accessor &styler) { + FoldFortranDoc(startPos, length, initStyle,styler, false); +} +/***************************************/ +static void FoldFortranDocFixFormat(unsigned int startPos, int length, int initStyle, + WordList *[], Accessor &styler) { + FoldFortranDoc(startPos, length, initStyle,styler, true); +} +/***************************************/ +LexerModule lmFortran(SCLEX_FORTRAN, ColouriseFortranDocFreeFormat, "fortran", FoldFortranDocFreeFormat, FortranWordLists); +LexerModule lmF77(SCLEX_F77, ColouriseFortranDocFixFormat, "f77", FoldFortranDocFixFormat, FortranWordLists); diff --git a/src/LexGen.py b/src/LexGen.py new file mode 100755 index 0000000..97a40b4 --- /dev/null +++ b/src/LexGen.py @@ -0,0 +1,241 @@ +# LexGen.py - implemented 2002 by Neil Hodgson neilh@scintilla.org +# Released to the public domain. + +# Regenerate the Scintilla and SciTE source files that list +# all the lexers and all the properties files. +# Should be run whenever a new lexer is added or removed. +# Requires Python 2.1 or later +# Most files are regenerated in place with templates stored in comments. +# The VS .NET project file is generated into a different file as the +# VS .NET environment will not retain comments when modifying the file. +# The files are copied to a string apart from sections between a +# ++Autogenerated comment and a --Autogenerated comment which is +# generated by the CopyWithInsertion function. After the whole +# string is instantiated, it is compared with the target file and +# if different the file is rewritten. +# Does not regenerate the Visual C++ 6 project files but does the VS .NET +# project file. + +import string +import sys +import os +import glob + +# EOL constants +CR = "\r" +LF = "\n" +CRLF = "\r\n" +if sys.platform == "win32": + NATIVE = CRLF +else: + # Yes, LF is the native EOL even on Mac OS X. CR is just for + # Mac OS <=9 (a.k.a. "Mac Classic") + NATIVE = LF + +# Automatically generated sections contain start and end comments, +# a definition line and the results. +# The results are replaced by regenerating based on the definition line. +# The definition line is a comment prefix followed by "**". +# If there is a digit after the ** then this indicates which list to use +# and the digit and next character are not part of the definition +# Backslash is used as an escape within the definition line. +# The part between \( and \) is repeated for each item in the list. +# \* is replaced by each list item. \t, and \n are tab and newline. +def CopyWithInsertion(input, commentPrefix, retainDefs, eolType, *lists): + copying = 1 + listid = 0 + output = [] + for line in input.splitlines(0): + isStartGenerated = line.startswith(commentPrefix + "++Autogenerated") + if copying and not isStartGenerated: + output.append(line) + if isStartGenerated: + if retainDefs: + output.append(line) + copying = 0 + definition = "" + elif not copying and line.startswith(commentPrefix + "**"): + if retainDefs: + output.append(line) + definition = line[len(commentPrefix + "**"):] + listid = 0 + if definition[0] in string.digits: + listid = int(definition[:1]) + definition = definition[2:] + # Hide double slashes as a control character + definition = definition.replace("\\\\", "\001") + # Do some normal C style transforms + definition = definition.replace("\\n", "\n") + definition = definition.replace("\\t", "\t") + # Get the doubled backslashes back as single backslashes + definition = definition.replace("\001", "\\") + startRepeat = definition.find("\\(") + endRepeat = definition.find("\\)") + intro = definition[:startRepeat] + out = "" + if intro.endswith("\n"): + pos = 0 + else: + pos = len(intro) + out += intro + middle = definition[startRepeat+2:endRepeat] + for i in lists[listid]: + item = middle.replace("\\*", i) + if pos and (pos + len(item) >= 80): + out += "\\\n" + pos = 0 + out += item + pos += len(item) + if item.endswith("\n"): + pos = 0 + outro = definition[endRepeat+2:] + out += outro + out = out.replace("\n", eolType) # correct EOLs in generated content + output.append(out) + elif line.startswith(commentPrefix + "--Autogenerated"): + copying = 1 + if retainDefs: + output.append(line) + output = [line.rstrip(" \t") for line in output] # trim trailing whitespace + return eolType.join(output) + eolType + +def UpdateFile(filename, updated): + """ If the file is different to updated then copy updated + into the file else leave alone so CVS and make don't treat + it as modified. """ + try: + infile = open(filename, "rb") + except IOError: # File is not there yet + out = open(filename, "wb") + out.write(updated) + out.close() + print "New", filename + return + original = infile.read() + infile.close() + if updated != original: + os.unlink(filename) + out = open(filename, "wb") + out.write(updated) + out.close() + print "Changed", filename + #~ else: + #~ print "Unchanged", filename + +def Generate(inpath, outpath, commentPrefix, eolType, *lists): + """Generate 'outpath' from 'inpath'. + + "eolType" indicates the type of EOLs to use in the generated + file. It should be one of following constants: LF, CRLF, + CR, or NATIVE. + """ + #print "generate '%s' -> '%s' (comment prefix: %r, eols: %r)"\ + # % (inpath, outpath, commentPrefix, eolType) + try: + infile = open(inpath, "r") + except IOError: + print "Can not open", inpath + return + original = infile.read() + infile.close() + updated = CopyWithInsertion(original, commentPrefix, + inpath == outpath, eolType, *lists) + UpdateFile(outpath, updated) + +def Regenerate(filename, commentPrefix, eolType, *lists): + """Regenerate the given file. + + "eolType" indicates the type of EOLs to use in the generated + file. It should be one of following constants: LF, CRLF, + CR, or NATIVE. + """ + Generate(filename, filename, commentPrefix, eolType, *lists) + +def FindModules(lexFile): + modules = [] + f = open(lexFile) + for l in f.readlines(): + if l.startswith("LexerModule"): + l = l.replace("(", " ") + modules.append(l.split()[1]) + return modules + +knownIrregularProperties = [ + "fold", + "styling.within.preprocessor", + "tab.timmy.whinge.level", + "asp.default.language", + "html.tags.case.sensitive", + "ps.level", + "ps.tokenize", + "sql.backslash.escapes", + "nsis.uservars", + "nsis.ignorecase" +] + +def FindProperties(lexFile): + properties = set() + f = open(lexFile) + for l in f.readlines(): + if "GetProperty" in l: + l = l.strip() + if not l.startswith("//"): # Drop comments + propertyName = l.split("\"")[1] + if propertyName.lower() == propertyName: + # Only allow lower case property names + if propertyName in knownIrregularProperties or \ + propertyName.startswith("fold.") or \ + propertyName.startswith("lexer."): + properties.add(propertyName) + return properties + +def ciCompare(a,b): + return cmp(a.lower(), b.lower()) + +def RegenerateAll(): + root="../../" + + # Find all the lexer source code files + lexFilePaths = glob.glob(root + "scintilla/src/Lex*.cxx") + lexFiles = [os.path.basename(f)[:-4] for f in lexFilePaths] + print lexFiles + lexerModules = [] + lexerProperties = set() + for lexFile in lexFilePaths: + lexerModules.extend(FindModules(lexFile)) + lexerProperties.update(FindProperties(lexFile)) + lexerModules.sort(ciCompare) + lexerProperties.remove("fold.comment.python") + lexerProperties = list(lexerProperties) + lexerProperties.sort(ciCompare) + + # Find all the SciTE properties files + otherProps = ["abbrev.properties", "Embedded.properties", "SciTEGlobal.properties", "SciTE.properties"] + propFilePaths = glob.glob(root + "scite/src/*.properties") + propFiles = [os.path.basename(f) for f in propFilePaths if os.path.basename(f) not in otherProps] + propFiles.sort(ciCompare) + print propFiles + + # Find all the menu command IDs in the SciTE header + SciTEHeader = file(root + "scite/src/SciTE.h") + lines = SciTEHeader.read().split("\n") + SciTEHeader.close() + ids = [id for id in [l.split()[1] for l in lines if l.startswith("#define")] if id.startswith("IDM_")] + #print ids + + Regenerate(root + "scintilla/src/KeyWords.cxx", "//", NATIVE, lexerModules) + Regenerate(root + "scintilla/win32/makefile", "#", NATIVE, lexFiles) + Regenerate(root + "scintilla/win32/scintilla.mak", "#", NATIVE, lexFiles) + Regenerate(root + "scintilla/win32/scintilla_vc6.mak", "#", NATIVE, lexFiles) + # Use Unix EOLs for gtk Makefiles so they work for Linux users when + # extracted from the Scintilla source ZIP (typically created on + # Windows). + Regenerate(root + "scintilla/gtk/makefile", "#", LF, lexFiles) + Regenerate(root + "scintilla/gtk/scintilla.mak", "#", NATIVE, lexFiles) + Regenerate(root + "scite/win32/makefile", "#", NATIVE, lexFiles, propFiles) + Regenerate(root + "scite/win32/scite.mak", "#", NATIVE, lexFiles, propFiles) + Regenerate(root + "scite/src/SciTEProps.cxx", "//", NATIVE, lexerProperties, ids) + Generate(root + "scite/boundscheck/vcproj.gen", + root + "scite/boundscheck/SciTE.vcproj", "#", NATIVE, lexFiles) + +RegenerateAll() diff --git a/src/LexGui4Cli.cpp b/src/LexGui4Cli.cpp new file mode 100755 index 0000000..f76fff6 --- /dev/null +++ b/src/LexGui4Cli.cpp @@ -0,0 +1,309 @@ +// Scintilla source code edit control +// Copyright 1998-2002 by Neil Hodgson +/* +This is the Lexer for Gui4Cli, included in SciLexer.dll +- by d. Keletsekis, 2/10/2003 + +To add to SciLexer.dll: +1. Add the values below to INCLUDE\Scintilla.iface +2. Run the include/HFacer.py script +3. Run the src/lexGen.py script + +val SCE_GC_DEFAULT=0 +val SCE_GC_COMMENTLINE=1 +val SCE_GC_COMMENTBLOCK=2 +val SCE_GC_GLOBAL=3 +val SCE_GC_EVENT=4 +val SCE_GC_ATTRIBUTE=5 +val SCE_GC_CONTROL=6 +val SCE_GC_COMMAND=7 +val SCE_GC_STRING=8 +val SCE_GC_OPERATOR=9 +*/ + +#include +#include +#include +#include +#include + +#include "Platform.h" + +#include "PropSet.h" +#include "Accessor.h" +#include "StyleContext.h" +#include "KeyWords.h" +#include "Scintilla.h" +#include "SciLexer.h" + +#define debug Platform::DebugPrintf + +static inline bool IsAWordChar(const int ch) { + return (ch < 0x80) && (isalnum(ch) || ch == '.' || ch == '_' || ch =='\\'); +} + +static inline bool IsAWordStart(const int ch) { + return (ch < 0x80) && (isalnum(ch) || ch == '_' || ch == '.'); +} + +inline bool isGCOperator(int ch) +{ if (isalnum(ch)) + return false; + // '.' left out as it is used to make up numbers + if (ch == '*' || ch == '/' || ch == '-' || ch == '+' || + ch == '(' || ch == ')' || ch == '=' || ch == '%' || + ch == '[' || ch == ']' || ch == '<' || ch == '>' || + ch == ',' || ch == ';' || ch == ':') + return true; + return false; +} + +#define isSpace(x) ((x)==' ' || (x)=='\t') +#define isNL(x) ((x)=='\n' || (x)=='\r') +#define isSpaceOrNL(x) (isSpace(x) || isNL(x)) +#define BUFFSIZE 500 +#define isFoldPoint(x) ((styler.LevelAt(x) & SC_FOLDLEVELNUMBERMASK) == 1024) + +static void colorFirstWord(WordList *keywordlists[], Accessor &styler, + StyleContext *sc, char *buff, int length, int) +{ + int c = 0; + while (sc->More() && isSpaceOrNL(sc->ch)) + { sc->Forward(); + } + styler.ColourTo(sc->currentPos - 1, sc->state); + + if (!IsAWordChar(sc->ch)) // comment, marker, etc.. + return; + + while (sc->More() && !isSpaceOrNL(sc->ch) && (c < length-1) && !isGCOperator(sc->ch)) + { buff[c] = static_cast(sc->ch); + ++c; sc->Forward(); + } + buff[c] = '\0'; + char *p = buff; + while (*p) // capitalize.. + { if (islower(*p)) *p = static_cast(toupper(*p)); + ++p; + } + + WordList &kGlobal = *keywordlists[0]; // keyword lists set by the user + WordList &kEvent = *keywordlists[1]; + WordList &kAttribute = *keywordlists[2]; + WordList &kControl = *keywordlists[3]; + WordList &kCommand = *keywordlists[4]; + + int state = 0; + // int level = styler.LevelAt(line) & SC_FOLDLEVELNUMBERMASK; + // debug ("line = %d, level = %d", line, level); + + if (kGlobal.InList(buff)) state = SCE_GC_GLOBAL; + else if (kAttribute.InList(buff)) state = SCE_GC_ATTRIBUTE; + else if (kControl.InList(buff)) state = SCE_GC_CONTROL; + else if (kCommand.InList(buff)) state = SCE_GC_COMMAND; + else if (kEvent.InList(buff)) state = SCE_GC_EVENT; + + if (state) + { sc->ChangeState(state); + styler.ColourTo(sc->currentPos - 1, sc->state); + sc->ChangeState(SCE_GC_DEFAULT); + } + else + { sc->ChangeState(SCE_GC_DEFAULT); + styler.ColourTo(sc->currentPos - 1, sc->state); + } +} + +// Main colorizing function called by Scintilla +static void +ColouriseGui4CliDoc(unsigned int startPos, int length, int initStyle, + WordList *keywordlists[], Accessor &styler) +{ + styler.StartAt(startPos); + + int quotestart = 0, oldstate, currentline = styler.GetLine(startPos); + styler.StartSegment(startPos); + bool noforward; + char buff[BUFFSIZE+1]; // buffer for command name + + StyleContext sc(startPos, length, initStyle, styler); + buff[0] = '\0'; // cbuff = 0; + + if (sc.state != SCE_GC_COMMENTBLOCK) // colorize 1st word.. + colorFirstWord(keywordlists, styler, &sc, buff, BUFFSIZE, currentline); + + while (sc.More()) + { noforward = 0; + + switch (sc.ch) + { + case '/': + if (sc.state == SCE_GC_COMMENTBLOCK || sc.state == SCE_GC_STRING) + break; + if (sc.chNext == '/') // line comment + { sc.SetState (SCE_GC_COMMENTLINE); + sc.Forward(); + styler.ColourTo(sc.currentPos, sc.state); + } + else if (sc.chNext == '*') // block comment + { sc.SetState(SCE_GC_COMMENTBLOCK); + sc.Forward(); + styler.ColourTo(sc.currentPos, sc.state); + } + else + styler.ColourTo(sc.currentPos, sc.state); + break; + + case '*': // end of comment block, or operator.. + if (sc.state == SCE_GC_STRING) + break; + if (sc.state == SCE_GC_COMMENTBLOCK && sc.chNext == '/') + { sc.Forward(); + styler.ColourTo(sc.currentPos, sc.state); + sc.ChangeState (SCE_GC_DEFAULT); + } + else + styler.ColourTo(sc.currentPos, sc.state); + break; + + case '\'': case '\"': // strings.. + if (sc.state == SCE_GC_COMMENTBLOCK || sc.state == SCE_GC_COMMENTLINE) + break; + if (sc.state == SCE_GC_STRING) + { if (sc.ch == quotestart) // match same quote char.. + { styler.ColourTo(sc.currentPos, sc.state); + sc.ChangeState(SCE_GC_DEFAULT); + quotestart = 0; + } } + else + { styler.ColourTo(sc.currentPos - 1, sc.state); + sc.ChangeState(SCE_GC_STRING); + quotestart = sc.ch; + } + break; + + case ';': // end of commandline character + if (sc.state != SCE_GC_COMMENTBLOCK && sc.state != SCE_GC_COMMENTLINE && + sc.state != SCE_GC_STRING) + { + styler.ColourTo(sc.currentPos - 1, sc.state); + styler.ColourTo(sc.currentPos, SCE_GC_OPERATOR); + sc.ChangeState(SCE_GC_DEFAULT); + sc.Forward(); + colorFirstWord(keywordlists, styler, &sc, buff, BUFFSIZE, currentline); + noforward = 1; // don't move forward - already positioned at next char.. + } + break; + + case '+': case '-': case '=': case '!': // operators.. + case '<': case '>': case '&': case '|': case '$': + if (sc.state != SCE_GC_COMMENTBLOCK && sc.state != SCE_GC_COMMENTLINE && + sc.state != SCE_GC_STRING) + { + styler.ColourTo(sc.currentPos - 1, sc.state); + styler.ColourTo(sc.currentPos, SCE_GC_OPERATOR); + sc.ChangeState(SCE_GC_DEFAULT); + } + break; + + case '\\': // escape - same as operator, but also mark in strings.. + if (sc.state != SCE_GC_COMMENTBLOCK && sc.state != SCE_GC_COMMENTLINE) + { + oldstate = sc.state; + styler.ColourTo(sc.currentPos - 1, sc.state); + sc.Forward(); // mark also the next char.. + styler.ColourTo(sc.currentPos, SCE_GC_OPERATOR); + sc.ChangeState(oldstate); + } + break; + + case '\n': case '\r': + ++currentline; + if (sc.state == SCE_GC_COMMENTLINE) + { styler.ColourTo(sc.currentPos, sc.state); + sc.ChangeState (SCE_GC_DEFAULT); + } + else if (sc.state != SCE_GC_COMMENTBLOCK) + { colorFirstWord(keywordlists, styler, &sc, buff, BUFFSIZE, currentline); + noforward = 1; // don't move forward - already positioned at next char.. + } + break; + +// case ' ': case '\t': +// default : + } + + if (!noforward) sc.Forward(); + + } + sc.Complete(); +} + +// Main folding function called by Scintilla - (based on props (.ini) files function) +static void FoldGui4Cli(unsigned int startPos, int length, int, + WordList *[], Accessor &styler) +{ + bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0; + + unsigned int endPos = startPos + length; + int visibleChars = 0; + int lineCurrent = styler.GetLine(startPos); + + char chNext = styler[startPos]; + int styleNext = styler.StyleAt(startPos); + bool headerPoint = false; + + for (unsigned int i = startPos; i < endPos; i++) + { + char ch = chNext; + chNext = styler[i+1]; + + int style = styleNext; + styleNext = styler.StyleAt(i + 1); + bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n'); + + if (style == SCE_GC_EVENT || style == SCE_GC_GLOBAL) + { headerPoint = true; // fold at events and globals + } + + if (atEOL) + { int lev = SC_FOLDLEVELBASE+1; + + if (headerPoint) + lev = SC_FOLDLEVELBASE; + + if (visibleChars == 0 && foldCompact) + lev |= SC_FOLDLEVELWHITEFLAG; + + if (headerPoint) + lev |= SC_FOLDLEVELHEADERFLAG; + + if (lev != styler.LevelAt(lineCurrent)) // set level, if not already correct + { styler.SetLevel(lineCurrent, lev); + } + + lineCurrent++; // re-initialize our flags + visibleChars = 0; + headerPoint = false; + } + + if (!(isspacechar(ch))) // || (style == SCE_GC_COMMENTLINE) || (style != SCE_GC_COMMENTBLOCK))) + visibleChars++; + } + + int lev = headerPoint ? SC_FOLDLEVELBASE : SC_FOLDLEVELBASE+1; + int flagsNext = styler.LevelAt(lineCurrent) & ~SC_FOLDLEVELNUMBERMASK; + styler.SetLevel(lineCurrent, lev | flagsNext); +} + +// I have no idea what these are for.. probably accessible by some message. +static const char * const gui4cliWordListDesc[] = { + "Globals", "Events", "Attributes", "Control", "Commands", + 0 +}; + +// Declare language & pass our function pointers to Scintilla +LexerModule lmGui4Cli(SCLEX_GUI4CLI, ColouriseGui4CliDoc, "gui4cli", FoldGui4Cli, gui4cliWordListDesc); + +#undef debug + diff --git a/src/LexHTML.cpp b/src/LexHTML.cpp new file mode 100755 index 0000000..dad8fce --- /dev/null +++ b/src/LexHTML.cpp @@ -0,0 +1,2042 @@ +// Scintilla source code edit control +/** @file LexHTML.cxx + ** Lexer for HTML. + **/ +// Copyright 1998-2005 by Neil Hodgson +// The License.txt file describes the conditions under which this software may be distributed. + +#include +#include +#include +#include +#include + +#include "Platform.h" + +#include "PropSet.h" +#include "Accessor.h" +#include "StyleContext.h" +#include "KeyWords.h" +#include "Scintilla.h" +#include "SciLexer.h" + +#define SCE_HA_JS (SCE_HJA_START - SCE_HJ_START) +#define SCE_HA_VBS (SCE_HBA_START - SCE_HB_START) +#define SCE_HA_PYTHON (SCE_HPA_START - SCE_HP_START) + +enum script_type { eScriptNone = 0, eScriptJS, eScriptVBS, eScriptPython, eScriptPHP, eScriptXML, eScriptSGML, eScriptSGMLblock }; +enum script_mode { eHtml = 0, eNonHtmlScript, eNonHtmlPreProc, eNonHtmlScriptPreProc }; + +static inline bool IsAWordChar(const int ch) { + return (ch < 0x80) && (isalnum(ch) || ch == '.' || ch == '_'); +} + +static inline bool IsAWordStart(const int ch) { + return (ch < 0x80) && (isalnum(ch) || ch == '_'); +} + +static inline int MakeLowerCase(int ch) { + if (ch < 'A' || ch > 'Z') + return ch; + else + return ch - 'A' + 'a'; +} + +static void GetTextSegment(Accessor &styler, unsigned int start, unsigned int end, char *s, size_t len) { + size_t i = 0; + for (; (i < end - start + 1) && (i < len-1); i++) { + s[i] = static_cast(MakeLowerCase(styler[start + i])); + } + s[i] = '\0'; +} + +static script_type segIsScriptingIndicator(Accessor &styler, unsigned int start, unsigned int end, script_type prevValue) { + char s[100]; + GetTextSegment(styler, start, end, s, sizeof(s)); + //Platform::DebugPrintf("Scripting indicator [%s]\n", s); + if (strstr(s, "src")) // External script + return eScriptNone; + if (strstr(s, "vbs")) + return eScriptVBS; + if (strstr(s, "pyth")) + return eScriptPython; + if (strstr(s, "javas")) + return eScriptJS; + if (strstr(s, "jscr")) + return eScriptJS; + if (strstr(s, "php")) + return eScriptPHP; + if (strstr(s, "xml")) + return eScriptXML; + + return prevValue; +} + +static int PrintScriptingIndicatorOffset(Accessor &styler, unsigned int start, unsigned int end) { + int iResult = 0; + char s[100]; + GetTextSegment(styler, start, end, s, sizeof(s)); + if (0 == strncmp(s, "php", 3)) { + iResult = 3; + } + + return iResult; +} + +static script_type ScriptOfState(int state) { + if ((state >= SCE_HP_START) && (state <= SCE_HP_IDENTIFIER)) { + return eScriptPython; + } else if ((state >= SCE_HB_START) && (state <= SCE_HB_STRINGEOL)) { + return eScriptVBS; + } else if ((state >= SCE_HJ_START) && (state <= SCE_HJ_REGEX)) { + return eScriptJS; + } else if ((state >= SCE_HPHP_DEFAULT) && (state <= SCE_HPHP_COMMENTLINE)) { + return eScriptPHP; + } else if ((state >= SCE_H_SGML_DEFAULT) && (state < SCE_H_SGML_BLOCK_DEFAULT)) { + return eScriptSGML; + } else if (state == SCE_H_SGML_BLOCK_DEFAULT) { + return eScriptSGMLblock; + } else { + return eScriptNone; + } +} + +static int statePrintForState(int state, script_mode inScriptType) { + int StateToPrint; + + if ((state >= SCE_HP_START) && (state <= SCE_HP_IDENTIFIER)) { + StateToPrint = state + ((inScriptType == eNonHtmlScript) ? 0 : SCE_HA_PYTHON); + } else if ((state >= SCE_HB_START) && (state <= SCE_HB_STRINGEOL)) { + StateToPrint = state + ((inScriptType == eNonHtmlScript) ? 0 : SCE_HA_VBS); + } else if ((state >= SCE_HJ_START) && (state <= SCE_HJ_REGEX)) { + StateToPrint = state + ((inScriptType == eNonHtmlScript) ? 0 : SCE_HA_JS); + } else { + StateToPrint = state; + } + + return StateToPrint; +} + +static int stateForPrintState(int StateToPrint) { + int state; + + if ((StateToPrint >= SCE_HPA_START) && (StateToPrint <= SCE_HPA_IDENTIFIER)) { + state = StateToPrint - SCE_HA_PYTHON; + } else if ((StateToPrint >= SCE_HBA_START) && (StateToPrint <= SCE_HBA_STRINGEOL)) { + state = StateToPrint - SCE_HA_VBS; + } else if ((StateToPrint >= SCE_HJA_START) && (StateToPrint <= SCE_HJA_REGEX)) { + state = StateToPrint - SCE_HA_JS; + } else { + state = StateToPrint; + } + + return state; +} + +static inline bool IsNumber(unsigned int start, Accessor &styler) { + return IsADigit(styler[start]) || (styler[start] == '.') || + (styler[start] == '-') || (styler[start] == '#'); +} + +static inline bool isStringState(int state) { + bool bResult; + + switch (state) { + case SCE_HJ_DOUBLESTRING: + case SCE_HJ_SINGLESTRING: + case SCE_HJA_DOUBLESTRING: + case SCE_HJA_SINGLESTRING: + case SCE_HB_STRING: + case SCE_HBA_STRING: + case SCE_HP_STRING: + case SCE_HP_CHARACTER: + case SCE_HP_TRIPLE: + case SCE_HP_TRIPLEDOUBLE: + case SCE_HPA_STRING: + case SCE_HPA_CHARACTER: + case SCE_HPA_TRIPLE: + case SCE_HPA_TRIPLEDOUBLE: + case SCE_HPHP_HSTRING: + case SCE_HPHP_SIMPLESTRING: + case SCE_HPHP_HSTRING_VARIABLE: + case SCE_HPHP_COMPLEX_VARIABLE: + bResult = true; + break; + default : + bResult = false; + break; + } + return bResult; +} + +static inline bool stateAllowsTermination(int state) { + bool allowTermination = !isStringState(state); + if (allowTermination) { + switch (state) { + case SCE_HPHP_COMMENT: + case SCE_HP_COMMENTLINE: + case SCE_HPA_COMMENTLINE: + allowTermination = false; + } + } + return allowTermination; +} + +// not really well done, since it's only comments that should lex the %> and <% +static inline bool isCommentASPState(int state) { + bool bResult; + + switch (state) { + case SCE_HJ_COMMENT: + case SCE_HJ_COMMENTLINE: + case SCE_HJ_COMMENTDOC: + case SCE_HB_COMMENTLINE: + case SCE_HP_COMMENTLINE: + case SCE_HPHP_COMMENT: + case SCE_HPHP_COMMENTLINE: + bResult = true; + break; + default : + bResult = false; + break; + } + return bResult; +} + +static void classifyAttribHTML(unsigned int start, unsigned int end, WordList &keywords, Accessor &styler) { + bool wordIsNumber = IsNumber(start, styler); + char chAttr = SCE_H_ATTRIBUTEUNKNOWN; + if (wordIsNumber) { + chAttr = SCE_H_NUMBER; + } else { + char s[100]; + GetTextSegment(styler, start, end, s, sizeof(s)); + if (keywords.InList(s)) + chAttr = SCE_H_ATTRIBUTE; + } + if ((chAttr == SCE_H_ATTRIBUTEUNKNOWN) && !keywords) + // No keywords -> all are known + chAttr = SCE_H_ATTRIBUTE; + styler.ColourTo(end, chAttr); +} + +static int classifyTagHTML(unsigned int start, unsigned int end, + WordList &keywords, Accessor &styler, bool &tagDontFold, + bool caseSensitive) { + char s[30 + 2]; + // Copy after the '<' + unsigned int i = 0; + for (unsigned int cPos = start; cPos <= end && i < 30; cPos++) { + char ch = styler[cPos]; + if ((ch != '<') && (ch != '/')) { + s[i++] = caseSensitive ? ch : static_cast(MakeLowerCase(ch)); + } + } + + //The following is only a quick hack, to see if this whole thing would work + //we first need the tagname with a trailing space... + s[i] = ' '; + s[i+1] = '\0'; + + //...to find it in the list of no-container-tags + // (There are many more. We will need a keywordlist in the property file for this) + tagDontFold = (NULL != strstr("meta link img area br hr input ",s)); + + //now we can remove the trailing space + s[i] = '\0'; + + bool isScript = false; + char chAttr = SCE_H_TAGUNKNOWN; + if (s[0] == '!') { + chAttr = SCE_H_SGML_DEFAULT; + } else if (s[0] == '/') { // Closing tag + if (keywords.InList(s + 1)) + chAttr = SCE_H_TAG; + } else { + if (keywords.InList(s)) { + chAttr = SCE_H_TAG; + isScript = 0 == strcmp(s, "script"); + } + } + if ((chAttr == SCE_H_TAGUNKNOWN) && !keywords) { + // No keywords -> all are known + chAttr = SCE_H_TAG; + isScript = 0 == strcmp(s, "script"); + } + styler.ColourTo(end, chAttr); + return isScript ? SCE_H_SCRIPT : chAttr; +} + +static void classifyWordHTJS(unsigned int start, unsigned int end, + WordList &keywords, Accessor &styler, script_mode inScriptType) { + char chAttr = SCE_HJ_WORD; + bool wordIsNumber = IsADigit(styler[start]) || (styler[start] == '.'); + if (wordIsNumber) + chAttr = SCE_HJ_NUMBER; + else { + char s[30 + 1]; + unsigned int i = 0; + for (; i < end - start + 1 && i < 30; i++) { + s[i] = styler[start + i]; + } + s[i] = '\0'; + if (keywords.InList(s)) + chAttr = SCE_HJ_KEYWORD; + } + styler.ColourTo(end, statePrintForState(chAttr, inScriptType)); +} + +static int classifyWordHTVB(unsigned int start, unsigned int end, WordList &keywords, Accessor &styler, script_mode inScriptType) { + char chAttr = SCE_HB_IDENTIFIER; + bool wordIsNumber = IsADigit(styler[start]) || (styler[start] == '.'); + if (wordIsNumber) + chAttr = SCE_HB_NUMBER; + else { + char s[100]; + GetTextSegment(styler, start, end, s, sizeof(s)); + if (keywords.InList(s)) { + chAttr = SCE_HB_WORD; + if (strcmp(s, "rem") == 0) + chAttr = SCE_HB_COMMENTLINE; + } + } + styler.ColourTo(end, statePrintForState(chAttr, inScriptType)); + if (chAttr == SCE_HB_COMMENTLINE) + return SCE_HB_COMMENTLINE; + else + return SCE_HB_DEFAULT; +} + +static void classifyWordHTPy(unsigned int start, unsigned int end, WordList &keywords, Accessor &styler, char *prevWord, script_mode inScriptType) { + bool wordIsNumber = IsADigit(styler[start]); + char s[30 + 1]; + unsigned int i = 0; + for (; i < end - start + 1 && i < 30; i++) { + s[i] = styler[start + i]; + } + s[i] = '\0'; + char chAttr = SCE_HP_IDENTIFIER; + if (0 == strcmp(prevWord, "class")) + chAttr = SCE_HP_CLASSNAME; + else if (0 == strcmp(prevWord, "def")) + chAttr = SCE_HP_DEFNAME; + else if (wordIsNumber) + chAttr = SCE_HP_NUMBER; + else if (keywords.InList(s)) + chAttr = SCE_HP_WORD; + styler.ColourTo(end, statePrintForState(chAttr, inScriptType)); + strcpy(prevWord, s); +} + +// Update the word colour to default or keyword +// Called when in a PHP word +static void classifyWordHTPHP(unsigned int start, unsigned int end, WordList &keywords, Accessor &styler) { + char chAttr = SCE_HPHP_DEFAULT; + bool wordIsNumber = IsADigit(styler[start]) || (styler[start] == '.' && start+1 <= end && IsADigit(styler[start+1])); + if (wordIsNumber) + chAttr = SCE_HPHP_NUMBER; + else { + char s[100]; + GetTextSegment(styler, start, end, s, sizeof(s)); + if (keywords.InList(s)) + chAttr = SCE_HPHP_WORD; + } + styler.ColourTo(end, chAttr); +} + +static bool isWordHSGML(unsigned int start, unsigned int end, WordList &keywords, Accessor &styler) { + char s[30 + 1]; + unsigned int i = 0; + for (; i < end - start + 1 && i < 30; i++) { + s[i] = styler[start + i]; + } + s[i] = '\0'; + return keywords.InList(s); +} + +static bool isWordCdata(unsigned int start, unsigned int end, Accessor &styler) { + char s[30 + 1]; + unsigned int i = 0; + for (; i < end - start + 1 && i < 30; i++) { + s[i] = styler[start + i]; + } + s[i] = '\0'; + return (0 == strcmp(s, "[CDATA[")); +} + +// Return the first state to reach when entering a scripting language +static int StateForScript(script_type scriptLanguage) { + int Result; + switch (scriptLanguage) { + case eScriptVBS: + Result = SCE_HB_START; + break; + case eScriptPython: + Result = SCE_HP_START; + break; + case eScriptPHP: + Result = SCE_HPHP_DEFAULT; + break; + case eScriptXML: + Result = SCE_H_TAGUNKNOWN; + break; + case eScriptSGML: + Result = SCE_H_SGML_DEFAULT; + break; + default : + Result = SCE_HJ_START; + break; + } + return Result; +} + +static inline bool ishtmlwordchar(char ch) { + return !isascii(ch) || + (isalnum(ch) || ch == '.' || ch == '-' || ch == '_' || ch == ':' || ch == '!' || ch == '#'); +} + +static inline bool issgmlwordchar(char ch) { + return !isascii(ch) || + (isalnum(ch) || ch == '.' || ch == '_' || ch == ':' || ch == '!' || ch == '#' || ch == '['); +} + +static inline bool IsPhpWordStart(const unsigned char ch) { + return (isascii(ch) && (isalpha(ch) || (ch == '_'))) || (ch >= 0x7f); +} + +static inline bool IsPhpWordChar(char ch) { + return IsADigit(ch) || IsPhpWordStart(ch); +} + +static bool InTagState(int state) { + return state == SCE_H_TAG || state == SCE_H_TAGUNKNOWN || + state == SCE_H_SCRIPT || + state == SCE_H_ATTRIBUTE || state == SCE_H_ATTRIBUTEUNKNOWN || + state == SCE_H_NUMBER || state == SCE_H_OTHER || + state == SCE_H_DOUBLESTRING || state == SCE_H_SINGLESTRING; +} + +static bool IsCommentState(const int state) { + return state == SCE_H_COMMENT || state == SCE_H_SGML_COMMENT; +} + +static bool IsScriptCommentState(const int state) { + return state == SCE_HJ_COMMENT || state == SCE_HJ_COMMENTLINE || state == SCE_HJA_COMMENT || + state == SCE_HJA_COMMENTLINE || state == SCE_HB_COMMENTLINE || state == SCE_HBA_COMMENTLINE; +} + +static bool isLineEnd(char ch) { + return ch == '\r' || ch == '\n'; +} + +static bool isOKBeforeRE(char ch) { + return (ch == '(') || (ch == '=') || (ch == ','); +} + +static bool isPHPStringState(int state) { + return + (state == SCE_HPHP_HSTRING) || + (state == SCE_HPHP_SIMPLESTRING) || + (state == SCE_HPHP_HSTRING_VARIABLE) || + (state == SCE_HPHP_COMPLEX_VARIABLE); +} + +static int FindPhpStringDelimiter(char *phpStringDelimiter, const int phpStringDelimiterSize, int i, const int lengthDoc, Accessor &styler) { + int j; + while (i < lengthDoc && (styler[i] == ' ' || styler[i] == '\t')) + i++; + phpStringDelimiter[0] = '\n'; + for (j = i; j < lengthDoc && styler[j] != '\n' && styler[j] != '\r'; j++) { + if (j - i < phpStringDelimiterSize - 2) + phpStringDelimiter[j-i+1] = styler[j]; + else + i++; + } + phpStringDelimiter[j-i+1] = '\0'; + return j; +} + +static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[], + Accessor &styler) { + WordList &keywords = *keywordlists[0]; + WordList &keywords2 = *keywordlists[1]; + WordList &keywords3 = *keywordlists[2]; + WordList &keywords4 = *keywordlists[3]; + WordList &keywords5 = *keywordlists[4]; + WordList &keywords6 = *keywordlists[5]; // SGML (DTD) keywords + + // Lexer for HTML requires more lexical states (7 bits worth) than most lexers + styler.StartAt(startPos, STYLE_MAX); + char prevWord[200]; + prevWord[0] = '\0'; + char phpStringDelimiter[200]; // PHP is not limited in length, we are + phpStringDelimiter[0] = '\0'; + int StateToPrint = initStyle; + int state = stateForPrintState(StateToPrint); + + // If inside a tag, it may be a script tag, so reread from the start to ensure any language tags are seen + if (InTagState(state)) { + while ((startPos > 0) && (InTagState(styler.StyleAt(startPos - 1)))) { + startPos--; + length++; + } + state = SCE_H_DEFAULT; + } + // String can be heredoc, must find a delimiter first + while (startPos > 0 && isPHPStringState(state) && state != SCE_HPHP_SIMPLESTRING) { + startPos--; + length++; + state = styler.StyleAt(startPos); + } + styler.StartAt(startPos, STYLE_MAX); + + int lineCurrent = styler.GetLine(startPos); + int lineState; + if (lineCurrent > 0) { + lineState = styler.GetLineState(lineCurrent); + } else { + // Default client and ASP scripting language is JavaScript + lineState = eScriptJS << 8; + lineState |= styler.GetPropertyInt("asp.default.language", eScriptJS) << 4; + } + script_mode inScriptType = script_mode((lineState >> 0) & 0x03); // 2 bits of scripting mode + bool tagOpened = (lineState >> 2) & 0x01; // 1 bit to know if we are in an opened tag + bool tagClosing = (lineState >> 3) & 0x01; // 1 bit to know if we are in a closing tag + bool tagDontFold = false; //some HTML tags should not be folded + script_type aspScript = script_type((lineState >> 4) & 0x0F); // 4 bits of script name + script_type clientScript = script_type((lineState >> 8) & 0x0F); // 4 bits of script name + int beforePreProc = (lineState >> 12) & 0xFF; // 8 bits of state + + script_type scriptLanguage = ScriptOfState(state); + + const bool foldHTML = styler.GetPropertyInt("fold.html", 0) != 0; + const bool fold = foldHTML && styler.GetPropertyInt("fold", 0); + const bool foldHTMLPreprocessor = foldHTML && styler.GetPropertyInt("fold.html.preprocessor", 1); + const bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0; + const bool caseSensitive = styler.GetPropertyInt("html.tags.case.sensitive", 0) != 0; + + int levelPrev = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK; + int levelCurrent = levelPrev; + int visibleChars = 0; + + char chPrev = ' '; + char ch = ' '; + char chPrevNonWhite = ' '; + // look back to set chPrevNonWhite properly for better regex colouring + if (scriptLanguage == eScriptJS && startPos > 0) { + int back = startPos; + int style = 0; + while (--back) { + style = styler.StyleAt(back); + if (style < SCE_HJ_DEFAULT || style > SCE_HJ_COMMENTDOC) + // includes SCE_HJ_COMMENT & SCE_HJ_COMMENTLINE + break; + } + if (style == SCE_HJ_SYMBOLS) { + chPrevNonWhite = styler.SafeGetCharAt(back); + } + } + + styler.StartSegment(startPos); + const int lengthDoc = startPos + length; + for (int i = startPos; i < lengthDoc; i++) { + const char chPrev2 = chPrev; + chPrev = ch; + if (!isspacechar(ch) && state != SCE_HJ_COMMENT && + state != SCE_HJ_COMMENTLINE && state != SCE_HJ_COMMENTDOC) + chPrevNonWhite = ch; + ch = styler[i]; + char chNext = styler.SafeGetCharAt(i + 1); + const char chNext2 = styler.SafeGetCharAt(i + 2); + + // Handle DBCS codepages + if (styler.IsLeadByte(ch)) { + chPrev = ' '; + i += 1; + continue; + } + + if ((!isspacechar(ch) || !foldCompact) && fold) + visibleChars++; + + // decide what is the current state to print (depending of the script tag) + StateToPrint = statePrintForState(state, inScriptType); + + // handle script folding + if (fold) { + switch (scriptLanguage) { + case eScriptJS: + case eScriptPHP: + //not currently supported case eScriptVBS: + + if ((state != SCE_HPHP_COMMENT) && (state != SCE_HPHP_COMMENTLINE) && (state != SCE_HJ_COMMENT) && (state != SCE_HJ_COMMENTLINE) && (state != SCE_HJ_COMMENTDOC) && (!isStringState(state))) { + //Platform::DebugPrintf("state=%d, StateToPrint=%d, initStyle=%d\n", state, StateToPrint, initStyle); + //if ((state == SCE_HPHP_OPERATOR) || (state == SCE_HPHP_DEFAULT) || (state == SCE_HJ_SYMBOLS) || (state == SCE_HJ_START) || (state == SCE_HJ_DEFAULT)) { + if ((ch == '{') || (ch == '}')) { + levelCurrent += (ch == '{') ? 1 : -1; + } + } + break; + case eScriptPython: + if (state != SCE_HP_COMMENTLINE) { + if ((ch == ':') && ((chNext == '\n') || (chNext == '\r' && chNext2 == '\n'))) { + levelCurrent++; + } else if ((ch == '\n') && !((chNext == '\r') && (chNext2 == '\n')) && (chNext != '\n')) { + // check if the number of tabs is lower than the level + int Findlevel = (levelCurrent & ~SC_FOLDLEVELBASE) * 8; + for (int j = 0; Findlevel > 0; j++) { + char chTmp = styler.SafeGetCharAt(i + j + 1); + if (chTmp == '\t') { + Findlevel -= 8; + } else if (chTmp == ' ') { + Findlevel--; + } else { + break; + } + } + + if (Findlevel > 0) { + levelCurrent -= Findlevel / 8; + if (Findlevel % 8) + levelCurrent--; + } + } + } + break; + default: + break; + } + } + + if ((ch == '\r' && chNext != '\n') || (ch == '\n')) { + // Trigger on CR only (Mac style) or either on LF from CR+LF (Dos/Win) or on LF alone (Unix) + // Avoid triggering two times on Dos/Win + // New line -> record any line state onto /next/ line + if (fold) { + int lev = levelPrev; + if (visibleChars == 0) + lev |= SC_FOLDLEVELWHITEFLAG; + if ((levelCurrent > levelPrev) && (visibleChars > 0)) + lev |= SC_FOLDLEVELHEADERFLAG; + + styler.SetLevel(lineCurrent, lev); + visibleChars = 0; + levelPrev = levelCurrent; + } + lineCurrent++; + styler.SetLineState(lineCurrent, + ((inScriptType & 0x03) << 0) | + ((tagOpened & 0x01) << 2) | + ((tagClosing & 0x01) << 3) | + ((aspScript & 0x0F) << 4) | + ((clientScript & 0x0F) << 8) | + ((beforePreProc & 0xFF) << 12)); + } + + // generic end of script processing + else if ((inScriptType == eNonHtmlScript) && (ch == '<') && (chNext == '/')) { + // Check if it's the end of the script tag (or any other HTML tag) + switch (state) { + // in these cases, you can embed HTML tags (to confirm !!!!!!!!!!!!!!!!!!!!!!) + case SCE_H_DOUBLESTRING: + case SCE_H_SINGLESTRING: + case SCE_HJ_COMMENT: + case SCE_HJ_COMMENTDOC: + //case SCE_HJ_COMMENTLINE: // removed as this is a common thing done to hide + // the end of script marker from some JS interpreters. + case SCE_HJ_DOUBLESTRING: + case SCE_HJ_SINGLESTRING: + case SCE_HJ_REGEX: + case SCE_HB_STRING: + case SCE_HP_STRING: + case SCE_HP_TRIPLE: + case SCE_HP_TRIPLEDOUBLE: + break; + default : + // check if the closing tag is a script tag + if (state == SCE_HJ_COMMENTLINE) { + char tag[7]; // room for the