Browse Source

Reorganization of SDK placement and references for CWE-ou

Phase 1: reorganize StaticSDK directories to better reflect
  origin of each SDK, platform, etc.  Add SDK-binary as submodule.
rarified/sdk-reorg-1
rarified 3 years ago
parent
commit
c50edd2ea7
  1. 3
      .gitmodules
  2. 1
      MOULOpenSourceClientPlugin/StaticSDKs/Win32/Expat/placeholder.txt
  3. 157
      MOULOpenSourceClientPlugin/StaticSDKs/Win32/IJL/ijlnotes.htm
  4. 1
      MOULOpenSourceClientPlugin/StaticSDKs/Win32/MAX7SDK/placeholder.txt
  5. 1
      MOULOpenSourceClientPlugin/StaticSDKs/Win32/MySQL/ReadMe.txt
  6. 1
      MOULOpenSourceClientPlugin/StaticSDKs/Win32/OpenSSL/placeholder.txt
  7. 1
      MOULOpenSourceClientPlugin/StaticSDKs/Win32/PlatformSDK/ReadMe.txt
  8. 1
      MOULOpenSourceClientPlugin/StaticSDKs/Win32/QTW/placeholder.txt
  9. 20
      MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/License.txt
  10. 69
      MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/README
  11. BIN
      MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/bin/SciLexer.dll
  12. BIN
      MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/bin/SciLexer.exp
  13. BIN
      MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/bin/SciLexer.lib
  14. BIN
      MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/bin/SciLexer.pdb
  15. BIN
      MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/bin/Scintilla.dll
  16. BIN
      MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/bin/Scintilla.exp
  17. BIN
      MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/bin/Scintilla.lib
  18. BIN
      MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/bin/Scintilla.pdb
  19. 249
      MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/doc/Design.html
  20. 56
      MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/doc/Icons.html
  21. 226
      MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/doc/Lexer.txt
  22. BIN
      MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/doc/SciBreak.jpg
  23. 251
      MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/doc/SciCoding.html
  24. BIN
      MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/doc/SciRest.jpg
  25. BIN
      MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/doc/SciTEIco.png
  26. BIN
      MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/doc/SciWord.jpg
  27. 5350
      MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/doc/ScintillaDoc.html
  28. 70
      MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/doc/ScintillaDownload.html
  29. 5296
      MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/doc/ScintillaHistory.html
  30. 507
      MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/doc/ScintillaRelated.html
  31. 178
      MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/doc/ScintillaToDo.html
  32. 375
      MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/doc/ScintillaUsage.html
  33. 142
      MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/doc/Steps.html
  34. 198
      MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/doc/index.html
  35. 78
      MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/include/Accessor.h
  36. 107
      MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/include/Face.py
  37. 76
      MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/include/HFacer.py
  38. 82
      MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/include/KeyWords.h
  39. 517
      MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/include/Platform.h
  40. 114
      MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/include/PropSet.h
  41. 280
      MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/include/SString.h
  42. 1074
      MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/include/SciLexer.h
  43. 780
      MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/include/Scintilla.h
  44. 3012
      MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/include/Scintilla.iface
  45. 59
      MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/include/ScintillaWidget.h
  46. 57
      MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/include/WindowAccessor.h
  47. 174
      MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/src/AutoComplete.cxx
  48. 70
      MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/src/AutoComplete.h
  49. 314
      MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/src/CallTip.cxx
  50. 79
      MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/src/CallTip.h
  51. 1120
      MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/src/CellBuffer.cxx
  52. 250
      MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/src/CellBuffer.h
  53. 43
      MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/src/CharClassify.cxx
  54. 25
      MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/src/CharClassify.h
  55. 289
      MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/src/ContractionState.cxx
  56. 65
      MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/src/ContractionState.h
  57. 1577
      MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/src/Document.cxx
  58. 305
      MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/src/Document.h
  59. 187
      MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/src/DocumentAccessor.cxx
  60. 67
      MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/src/DocumentAccessor.h
  61. 7297
      MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/src/Editor.cxx
  62. 582
      MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/src/Editor.h
  63. 259
      MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/src/ExternalLexer.cxx
  64. 95
      MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/src/ExternalLexer.h
  65. 77
      MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/src/Indicator.cxx
  66. 22
      MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/src/Indicator.h
  67. 148
      MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/src/KeyMap.cxx
  68. 43
      MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/src/KeyMap.h
  69. 221
      MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/src/KeyWords.cxx
  70. 136
      MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/src/LexAPDL.cxx
  71. 891
      MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/src/LexAU3.cxx
  72. 225
      MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/src/LexAVE.cxx
  73. 520
      MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/src/LexAda.cxx
  74. 177
      MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/src/LexAsm.cxx
  75. 181
      MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/src/LexAsn1.cxx
  76. 189
      MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/src/LexBaan.cxx
  77. 663
      MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/src/LexBash.cxx
  78. 369
      MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/src/LexBasic.cxx
  79. 225
      MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/src/LexBullant.cxx
  80. 675
      MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/src/LexCLW.cxx
  81. 489
      MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/src/LexCPP.cxx
  82. 303
      MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/src/LexCSS.cxx
  83. 399
      MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/src/LexCaml.cxx
  84. 184
      MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/src/LexConf.cxx
  85. 218
      MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/src/LexCrontab.cxx
  86. 207
      MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/src/LexCsound.cxx
  87. 270
      MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/src/LexEScript.cxx
  88. 234
      MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/src/LexEiffel.cxx
  89. 522
      MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/src/LexErlang.cxx
  90. 226
      MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/src/LexFlagship.cxx
  91. 348
      MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/src/LexForth.cxx
  92. 452
      MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/src/LexFortran.cxx
  93. 241
      MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/src/LexGen.py
  94. 309
      MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/src/LexGui4Cli.cxx
  95. 2042
      MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/src/LexHTML.cxx
  96. 263
      MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/src/LexHaskell.cxx
  97. 290
      MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/src/LexInno.cxx
  98. 122
      MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/src/LexKix.cxx
  99. 275
      MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/src/LexLisp.cxx
  100. 208
      MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/src/LexLout.cxx
  101. Some files were not shown because too many files have changed in this diff Show More

3
.gitmodules vendored

@ -0,0 +1,3 @@
[submodule "SDK-binary"]
path = MOULOpenSourceClientPlugin/SDK-binary
url = https://foundry.openuru.org/gitblit/r/CWE-SDKs/SDK-binary-VS2010

1
MOULOpenSourceClientPlugin/StaticSDKs/Win32/Expat/placeholder.txt

@ -1 +0,0 @@
What do you see? An empty folder.

157
MOULOpenSourceClientPlugin/StaticSDKs/Win32/IJL/ijlnotes.htm

@ -1,157 +0,0 @@
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1252">
<META NAME="Generator" CONTENT="Microsoft FrontPage 4.0">
<TITLE>Intel® JPEG Library Release Notes</TITLE>
<link rel="stylesheet" type="text/css" href="doc/css/ijl.css">
</HEAD>
<BODY TEXT="#000000" LINK="#0000ff" VLINK="#800080" BGCOLOR="#ffffff">
<h1 ALIGN="left">Intel&reg; JPEG Library v1.51 </h1>
<h1 ALIGN="left"> Product Release Notes </h1>
<h2>Contents</h2>
<P><A HREF="#Overview">Intel® JPEG&nbsp; Library 1.51</A> <BR>
<A HREF="#System_Requirements">System Requirements</A><BR>
<A HREF="#Compilers">Compiler Support </A><BR>
<A HREF="#License_Definitions">License Definitions</A> <BR>
<A HREF="#Installation">Installation</A> <BR>
<A HREF="#Library_Use">Library Use</A><BR>
<A HREF="#Whats_New">What's New in Version 1.51</A><BR>
<A HREF="#History">History</A><BR>
<A HREF="#Known_Limitations">Known Limitations in Version 1.51</A> <BR>
<a HREF="#Technical_Support">Technical Support and Feedback</a> <BR>
<A NAME="Overview"></P>
</A>
<A NAME="Overview"><h2>Intel® JPEG Library 1.51</h2>
</A><P>The Intel® JPEG Library (IJL) is a software library for application developers that provides high performance JPEG encoding and decoding of full color and grayscale still
images.</P>
<P>The IJL was designed for use on Intel® architecture platforms and has been tuned for speed and efficient memory usage. Additionally, the IJL was developed to take advantage of MMX™,
Streaming SIMD Extensions (SSE), and SSE-2 technology if
present.</P>
<P>The IJL provides an easy-to-use programming interface without sacrificing low-level JPEG control to advanced developers. The IJL also includes a substantial amount of functionality that is not included in the ISO JPEG standard. This added functionality is typically necessary when working with JPEG images, and includes pre-processing and post-processing options like sampling and color space conversions.</P>
<P>Additional information on this software as well as other libraries is
available at the <a href="http://developer.intel.com/software/products/perflib/">Intel Performance
Libraries web site</a>.<br>
</P>
<h2><A NAME="System_Requirements">System Requirements</h2>
</A>
<P>The Intel JPEG Library requires the following software and hardware:</P>
<P>Recommended hardware: A Pentium&reg; II,&nbsp; Pentium <font face="Arial">III</font>, or Pentium 4 processor-based PC with memory appropriate to the image sizes needed.</P>
<P>Software Requirements: Microsoft* Windows* 95, 98, ME*, 2000, or Microsoft Windows NT* 3.51 or 4.0.</P>
<h2><a name="Compilers">Compiler Support</a></h2>
<P>Intel&reg; C++ Compiler, Borland* C++ 5, or Microsoft* Visual C++* 4.2 or
later. Other compatible compilers have not been tested extensively but might work.</P>
<h2><A NAME="License_Definitions">License Definitions</h2>
</A>
<P>Please see the license file <a href="ijllic.htm">ijllic.htm</a>
for the license definitions and restrictions on the library.</P>
<h2><A NAME="Installation">Installation</h2>
</A>
<P>You can install the IJL package by downloading and running the appropriate self-extracting installation files from the Web site.
Check the <a href="http://developer.intel.com/software/products/perflib/ijl/">Intel JPEG
Library</a> site for updates, when available.</P>
<h2><A NAME="Library_Use">Library Use</A></h2><P>To get started using the library, the following steps are required:</P>
<UL>
<LI>Include the file &quot;ijl.h&quot; in your program. </LI>
<LI>Call the IJL interface. </LI>
<LI>Link to the file ijl.lib in the lib directory. </LI>
<LI>Put the DLL ijl15.dll in your path before executing your program.</LI></UL>
<h2><a name="Whats_New">What’s New in the Intel JPEG Library Version 1.51</a></h2>
<p>New Features:</p>
<ul>
<li>Microsoft* Visual Basic* example extended to demonstrate how to work with
a memory buffer</li>
</ul>
<p>Fixed Bugs:</p>
<ul>
<li>Multi-thread safety restored</li>
<li>Now properly auto-detects processor type</li>
<li>Now writing JPEG comments properly</li>
<li>No longer crashing when decoding corrupted JPEG images</li>
<li>Now encoding/decoding progressive JPEG images properly</li>
<li>Now decoding a Region of Interest (ROI) from progressive JPEG images</li>
<li>Rounding error fixed in the Microsoft* Visual Basic* example</li>
<li>JPGView example now stores BMP files in top-down order instead of
bottom-up</li>
</ul>
<h2><A NAME="History">History</A></h2>
<p>New in Version 1.5:</p>
<ul>
<li>Optimizations for the Pentium <font face="Arial"> III</font> and Pentium 4 processors</li>
<li>Support for Microsoft* Visual Basic*</li>
<li>A more accurate DCT</li>
<li>Encoding of progressive images</li>
<li>Reading of embedded thumbnails</li>
<li>Reading/Writing of JPEG comments</li>
<li>Reading/Writing of DPI information</li>
<li>Raw quantization and Huffman tables can be read at decode time</li>
<li>YCbCr (4:2:2) supported as input to encoder and output from decoder</li>
<li>Raw DCT coefficients and raw sampled data supported as input to decoder
and output from decoder</li>
</ul>
<p>Bugs fixed in 1.5:&nbsp;</p>
<ul>
<li>JPG files are properly truncated of extra data before writing</li>
<li>JPGSizeBytes no longer ignored on ijlWrite</li>
<li>No dynamic buffer overruns if output buffer is too small</li>
<li>No longer misinterpreting coefficients when first AC coefficient is -1 and
first DC coefficient is negative</li>
<li>A single-line distortion problem was fixed</li>
<li>Some&nbsp; image corruptions at encode time was fixed</li>
<li>Path searching is correct when path contains localized characters/ UNICODE</li>
<li>IJL now recognizes images encoded with a ZORAN* chip</li>
</ul>
<p>New in Version 1.1:</p>
<UL>
<LI>Delphi support</LI>
<LI>ijl_ipl.pdf corrected to refer to version 2.x of the Intel&reg; Image Processing Library</LI>
<LI>Examples in the manual were corrected</LI>
<LI><A NAME="Known_Limitations">Bug in subsampled decoding that made images look "washed out" was fixed</LI></A></UL>
<h2><A NAME="Known_Limitations">Known Limitations In Version 1.51</h2>
<UL>
<LI></A>PLSInfo.exe and the Performance Libraries dispatching mechanism are not supported. </LI>
</UL>
<H2><a NAME="Technical_Support">Technical Support and Feedback</a></H2>
<p>All interactive support for the Intel JPEG Library is handled through the Intel® Performance
Libraries section of the Intel® Premier Support web-based support system. In order to access support for this product, you will need an account on Intel Premier Support. Register for an account at the Intel Premier Support Registration Page.&nbsp;<br>
Once you have an account, you can login to the Intel Premier Support Web site.&nbsp;<p>
If you have forgotten your password, please contact quad.support@intel.com. If you have questions pertaining to the
auto accounts registration process, please contact pto.quad@intel.com. For all support questions, please submit an issue at
<a href="https://premier.intel.com/">https://premier.intel.com/</a>.<p>
To submit an issue via the Intel Premier Support website:
<ul>
<li>
Go to <a href="https://premier.intel.com/">https://premier.intel.com/</a>&nbsp;</li>
<li>Type in your Premier Support Login and Password.<br>
Click the "Submit" button.</li>
<li>Read the Confidentiality Statement and click the "I Accept" button.</li>
<li>Click on the "Submit Issue" link in the left navigation bar.</li>
<li>
Choose "Initiatives, technologies &amp; tools" from the "Product Type" drop-down list.</li>
<li>
Choose "Intel® Performance Libraries" from the "Product Name" drop-down list.</li>
<li>Enter your question and complete the fields in the windows that follow to successfully submit the issue.&nbsp;</li>
</ul>
<p>
Contact us with your suggestions or problem reports using your Intel Premier Support account. A technical support engineer will respond within one (1) Intel business day.
</p>
<p><font face="Arial,HELVETICA" size="1">Intel, the Intel logo, and Pentium are
registered trademarks of Intel Corporation.<br>
MMX is a trademark of Intel Corporation.<br>
*Other names and brands may be claimed as the property of others.</p>
<p>Copyright 2001, Intel Corporation, All Rights Reserved.</p>
</font>
</BODY>
</HTML>

1
MOULOpenSourceClientPlugin/StaticSDKs/Win32/MAX7SDK/placeholder.txt

@ -1 +0,0 @@
What do you see? An empty folder.

1
MOULOpenSourceClientPlugin/StaticSDKs/Win32/MySQL/ReadMe.txt

@ -1 +0,0 @@
Not sure this is needed. It was probably for the original servers (before MOUL).

1
MOULOpenSourceClientPlugin/StaticSDKs/Win32/OpenSSL/placeholder.txt

@ -1 +0,0 @@
What do you see? An empty folder.

1
MOULOpenSourceClientPlugin/StaticSDKs/Win32/PlatformSDK/ReadMe.txt

@ -1 +0,0 @@
Windows Platform SDk

1
MOULOpenSourceClientPlugin/StaticSDKs/Win32/QTW/placeholder.txt

@ -1 +0,0 @@
What do you see? An empty folder.

20
MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/License.txt

@ -1,20 +0,0 @@
License for Scintilla and SciTE
Copyright 1998-2003 by Neil Hodgson <neilh@scintilla.org>
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.

69
MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/README

@ -1,69 +0,0 @@
README for building of Scintilla and SciTE
Scintilla can be built by itself.
To build SciTE, Scintilla must first be built.
*** GTK+/Linux version ***
You must first have GTK+ 1.2 or later and GCC (3.1 or better) installed.
GTK+ 1.0x will not work and when it did it was very slow.
Other C++ compilers may work but may require tweaking the make file.
To build Scintilla, use the makefile located in the scintilla/gtk directory
cd scintilla/gtk
make
cd ../..
To build and install SciTE, use the makefile located in the scite/gtk directory
cd scite/gtk
make
make install
This installs SciTE into $prefix/bin. The value of $prefix is determined from
the location of Gnome if it is installed. This is usually /usr if installed
with Linux or /usr/local if built from source. If Gnome is not installed
/usr/bin is used as the prefix. The prefix can be overridden on the command
line like "make prefix=/opt" but the same value should be used for both make
and make install as this location is compiled into the executable. The global
properties file is installed at $prefix/share/scite/SciTEGlobal.properties.
The language specific properties files are also installed into this directory.
To build Scintilla for GTK+ 1 rather than the default GTK+ 2, define GTK1 on
the make command line:
make GTK1=1
To remove SciTE
make uninstall
To clean the object files which may be needed to change $prefix
make clean
The current make file only supports static linking between SciTE and Scintilla.
*** Windows version ***
A C++ compiler is required. Visual Studio .NET 2003 is the development system
used for most development although Mingw32 3.1 and Borland C++ are also
supported.
For older versions of Borland make such as version 5.02, add the -l option.
To build Scintilla, make in the scintilla/win32 directory
cd scintilla\win32
GCC: mingw32-make
VS .NET: nmake -f scintilla.mak
VC++ 6: nmake -f scintilla_vc6.mak
Borland: make -fscintilla.mak
cd ..\..
To build SciTE, use the makefiles located in the scite/win32 directory
cd scite\win32
GCC: mingw32-make
VS .NET: nmake -f scite.mak
Borland: make -fscite.mak
An executable SciTE will now be in scite\bin.
The Visual C++ 6.0 project (.dsp) files are no longer supported but are left
in the download for people that are prepared to update them.

BIN
MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/bin/SciLexer.dll

Binary file not shown.

BIN
MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/bin/SciLexer.exp

Binary file not shown.

BIN
MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/bin/SciLexer.lib

Binary file not shown.

BIN
MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/bin/SciLexer.pdb

Binary file not shown.

BIN
MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/bin/Scintilla.dll

Binary file not shown.

BIN
MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/bin/Scintilla.exp

Binary file not shown.

BIN
MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/bin/Scintilla.lib

Binary file not shown.

BIN
MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/bin/Scintilla.pdb

Binary file not shown.

249
MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/doc/Design.html

@ -1,249 +0,0 @@
<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="generator" content="HTML Tidy, see www.w3.org" />
<meta name="generator" content="SciTE" />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>
Scintilla and SciTE
</title>
</head>
<body bgcolor="#FFFFFF" text="#000000">
<table bgcolor="#000000" width="100%" cellspacing="0" cellpadding="0" border="0">
<tr>
<td>
<img src="SciTEIco.png" border="3" height="64" width="64" alt="Scintilla icon" />
</td>
<td>
<a href="index.html" style="color:white;text-decoration:none"><font size="5">Scintilla
Component Design</font></a>
</td>
</tr>
</table>
<h2>
Top level structure
</h2>
<p>
Scintilla consists of three major layers of C++ code
</p>
<ul>
<li>
Portability Library
</li>
<li>
Core Code
</li>
<li>
Platform Events and API
</li>
</ul>
<p>
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.
</p>
<p>
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 <a href="http://wxwindows.org/">wxWindows site</a>
</p>
<br />
<h3>
Portability Library
</h3>
<p>
This is a fairly small and thin layer over the platform's native capabilities.
</p>
<p>
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.
</p>
<p>
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.
</p>
<h4>
Point, PRectangle
</h4>
<p>
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.
</p>
<h4>
Colour, ColourPair, Palette
</h4>
<p>
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.
</p>
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.
<h4>
Font
</h4>
<p>
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.
</p>
<h4>
Surface
</h4>
<p>
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.
</p>
<p>
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.
</p>
<h4>
Window
</h4>
<p>
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+.
</p>
<h4>
ListBox
</h4>
<p>
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.
</p>
<h4>
Menu
</h4>
<p>
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.
</p>
<h4>
Platform
</h4>
<p>
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.
</p>
<h3>
Core Code
</h3>
<p>
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.
</p>
<h4>
CellBuffer
</h4>
<p>
A CellBuffer holds text and styling information, the undo stack, the assignment of line
markers to lines, and the fold structure.
</p>
<p>
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.
</p>
<p>
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.
</p>
<h4>
Document
</h4>
<p>
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.
</p>
<h4>
Editor
</h4>
<p>
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.
</p>
<p>
There may be multiple Editor objects attached to one Document object. Changes to a
document are broadcast to the editors through the DocWatcher mechanism.
</p>
<h4>
ScintillaBase
</h4>
<p>
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.
</p>
<h3>
Platform Events and API
</h3>
<p>
Each platform uses different mechanisms for receiving events. On Windows, events are
received through messages and COM. On GTK+, callback functions are used.
</p>
<p>
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.
</p>
<p>
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.
</p>
</body>
</html>

56
MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/doc/Icons.html

@ -1,56 +0,0 @@
<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="generator" content="HTML Tidy, see www.w3.org" />
<meta name="generator" content="SciTE" />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>
Scintilla icons
</title>
</head>
<body bgcolor="#FFFFFF" text="#000000">
<table bgcolor="#000000" width="100%" cellspacing="0" cellpadding="0" border="0">
<tr>
<td>
<img src="SciTEIco.png" border="3" height="64" width="64" alt="Scintilla icon" />
</td>
<td>
<a href="index.html" style="color:white;text-decoration:none"><font size="5">Scintilla
and SciTE</font></a>
</td>
</tr>
</table>
<h2>
Icons
</h2>
<p>
These images may be used under the same license as Scintilla.
</p>
<p>
Drawn by Iago Rubio, Philippe Lhoste, and Neil Hodgson.
</p>
<p>
<a href="http://prdownloads.sourceforge.net/scintilla/icons1.zip?download">zip format</a> (70K)
</p>
<table>
<tr>
<td>For autocompletion lists</td>
<td colspan="3">For margin markers</td>
</tr>
<tr>
<td>12x12</td>
<td>16x16</td>
<td>24x24</td>
<td>32x32</td>
</tr>
<tr>
<td valign="top"><img src="12.png" /></td>
<td valign="top"><img src="16.png" /></td>
<td valign="top"><img src="24.png" /></td>
<td valign="top"><img src="32.png" /></td>
</tr>
</table>
</body>
</html>

226
MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/doc/Lexer.txt

@ -1,226 +0,0 @@
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

BIN
MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/doc/SciBreak.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

251
MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/doc/SciCoding.html

@ -1,251 +0,0 @@
<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="generator" content="SciTE" />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>
Scintilla and SciTE Code Style Preferences
</title>
<style>
.S0 {
color: #808080;
}
.S1 {
font-family: Comic Sans MS;
color: #007F00;
font-size: 9pt;
}
.S2 {
font-family: Comic Sans MS;
color: #007F00;
font-size: 9pt;
}
.S3 {
font-family: Comic Sans MS;
color: #3F703F;
font-size: 9pt;
}
.S4 {
color: #007F7F;
}
.S5 {
font-weight: bold;
color: #00007F;
}
.S6 {
color: #7F007F;
}
.S7 {
color: #7F007F;
}
.S8 {
color: #804080;
}
.S9 {
color: #7F7F00;
}
.S10 {
font-weight: bold;
color: #000000;
}
.S12 {
font-family: Courier New;
color: #000000;
background: #E0C0E0;
font-size: 10pt;
}
.S13 {
font-family: Courier New;
color: #007F00;
background: #E0FFE0;
font-size: 10pt;
}
.S14 {
font-family: Courier New;
color: #3F7F3F;
background: #E0F0FF;
font-size: 10pt;
}
.S15 {
font-family: Comic Sans MS;
color: #3F703F;
font-size: 9pt;
}
SPAN {
font-family: Verdana;
font-size: 10pt;
}
</style>
</head>
<body bgcolor="#FFFFFF" text="#000000">
<table bgcolor="#000000" width="100%" cellspacing="0" cellpadding="0" border="0">
<tr>
<td>
<img src="SciTEIco.png" border="3" height="64" width="64" alt="Scintilla icon" />
</td>
<td>
<a href="index.html" style="color:white;text-decoration:none"><font size="5">Scintilla
and SciTE</font></a>
</td>
</tr>
</table>
<h2>
Code Style
</h2>
<h3>
Introduction
</h3>
<p>
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.
</p>
<p>
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.
</p>
<p>
The <a href="http://astyle.sourceforge.net/">AStyle</a> 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.
</p>
<h3>
Language features
</h3>
<p>
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.
</p>
<p>
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.
</p>
<p>
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.
</p>
<h3>
Casting
</h3>
<p>
Do not use old C style casts like (char *)s. Instead use the most strict form of C++
cast possible like const_cast&lt;char *&gt;(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.
</p>
<p>
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.
</p>
<p>
Code that treats const seriously is easier to reason about both for humans
and compilers, so use const parameters and avoid const_cast.
</p>
<h3>
Warnings
</h3>
<p>
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.
</p>
<p>
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.
</p>
<h3>
Allocation
</h3>
<p>
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.
</p>
<p>
The C++ new and delete operators are preferred over C's malloc and free
as new and delete are type safe.
</p>
<h3>
Bracketing
</h3>
<p>
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.
</p>
<SPAN class=S0></SPAN><SPAN class=S5>bool</SPAN><SPAN class=S0>&nbsp;</SPAN><SPAN class=S11>fn</SPAN><SPAN class=S10>(</SPAN><SPAN class=S5>int</SPAN><SPAN class=S0>&nbsp;</SPAN><SPAN class=S11>a</SPAN><SPAN class=S10>)</SPAN><SPAN class=S0>&nbsp;</SPAN><SPAN class=S10>{</SPAN><SPAN class=S0><BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN class=S5>if</SPAN><SPAN class=S0>&nbsp;</SPAN><SPAN class=S10>(</SPAN><SPAN class=S11>a</SPAN><SPAN class=S10>)</SPAN><SPAN class=S0>&nbsp;</SPAN><SPAN class=S10>{</SPAN><SPAN class=S0><BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN class=S11>s</SPAN><SPAN class=S10>();</SPAN><SPAN class=S0><BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN class=S11>t</SPAN><SPAN class=S10>();</SPAN><SPAN class=S0><BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN class=S10>}</SPAN><SPAN class=S0>&nbsp;</SPAN><SPAN class=S5>else</SPAN><SPAN class=S0>&nbsp;</SPAN><SPAN class=S10>{</SPAN><SPAN class=S0><BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN class=S11>u</SPAN><SPAN class=S10>();</SPAN><SPAN class=S0><BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN class=S10>}</SPAN><SPAN class=S0><BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN class=S5>return</SPAN><SPAN class=S0>&nbsp;</SPAN><SPAN class=S10>!</SPAN><SPAN class=S11>a</SPAN><SPAN class=S10>;</SPAN><SPAN class=S0><BR>
</SPAN><SPAN class=S10>}</SPAN><SPAN class=S0><BR>
</SPAN> <h3>
Spacing
</h3>
<p>
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 '('.
</p>
<SPAN class=S0></SPAN><SPAN class=S5>void</SPAN><SPAN class=S0>&nbsp;</SPAN><SPAN class=S11>StoreConditionally</SPAN><SPAN class=S10>(</SPAN><SPAN class=S5>int</SPAN><SPAN class=S0>&nbsp;</SPAN><SPAN class=S11>c</SPAN><SPAN class=S10>,</SPAN><SPAN class=S0>&nbsp;</SPAN><SPAN class=S5>const</SPAN><SPAN class=S0>&nbsp;</SPAN><SPAN class=S5>char</SPAN><SPAN class=S0>&nbsp;</SPAN><SPAN class=S10>*</SPAN><SPAN class=S11>s</SPAN><SPAN class=S10>)</SPAN><SPAN class=S0>&nbsp;</SPAN><SPAN class=S10>{</SPAN><SPAN class=S0><BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN class=S5>if</SPAN><SPAN class=S0>&nbsp;</SPAN><SPAN class=S10>(</SPAN><SPAN class=S11>c</SPAN><SPAN class=S0>&nbsp;</SPAN><SPAN class=S10>&amp;&amp;</SPAN><SPAN class=S0>&nbsp;</SPAN><SPAN class=S10>(</SPAN><SPAN class=S11>baseSegment</SPAN><SPAN class=S0>&nbsp;</SPAN><SPAN class=S10>==</SPAN><SPAN class=S0>&nbsp;</SPAN><SPAN class=S11>trustSegment</SPAN><SPAN class=S10>[</SPAN><SPAN class=S6>"html"</SPAN><SPAN class=S10>]))</SPAN><SPAN class=S0>&nbsp;</SPAN><SPAN class=S10>{</SPAN><SPAN class=S0><BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN class=S11>baseSegment</SPAN><SPAN class=S0>&nbsp;</SPAN><SPAN class=S10>=</SPAN><SPAN class=S0>&nbsp;</SPAN><SPAN class=S11>s</SPAN><SPAN class=S10>+</SPAN><SPAN class=S4>1</SPAN><SPAN class=S10>;</SPAN><SPAN class=S0><BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN class=S11>Store</SPAN><SPAN class=S10>(</SPAN><SPAN class=S11>s</SPAN><SPAN class=S10>,</SPAN><SPAN class=S0>&nbsp;</SPAN><SPAN class=S11>baseSegment</SPAN><SPAN class=S10>,</SPAN><SPAN class=S0>&nbsp;</SPAN><SPAN class=S6>"html"</SPAN><SPAN class=S10>);</SPAN><SPAN class=S0><BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN class=S10>}</SPAN><SPAN class=S0><BR>
</SPAN><SPAN class=S10>}</SPAN>
<h3>
Names
</h3>
<p>
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.
</p>
<SPAN class=S0></SPAN><SPAN class=S5>class</SPAN><SPAN class=S0>&nbsp;</SPAN><SPAN class=S11>StorageZone</SPAN><SPAN class=S0>&nbsp;</SPAN><SPAN class=S10>{</SPAN><SPAN class=S0><BR>
</SPAN><SPAN class=S5>public</SPAN><SPAN class=S10>:</SPAN><SPAN class=S0><BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN class=S5>void</SPAN><SPAN class=S0>&nbsp;</SPAN><SPAN class=S11>Store</SPAN><SPAN class=S10>(</SPAN><SPAN class=S5>const</SPAN><SPAN class=S0>&nbsp;</SPAN><SPAN class=S5>char</SPAN><SPAN class=S0>&nbsp;</SPAN><SPAN class=S10>*</SPAN><SPAN class=S11>s</SPAN><SPAN class=S10>)</SPAN><SPAN class=S0>&nbsp;</SPAN><SPAN class=S10>{</SPAN><SPAN class=S0><BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN class=S11>Media</SPAN><SPAN class=S0>&nbsp;</SPAN><SPAN class=S10>*</SPAN><SPAN class=S11>mediaStore</SPAN><SPAN class=S0>&nbsp;</SPAN><SPAN class=S10>=</SPAN><SPAN class=S0>&nbsp;</SPAN><SPAN class=S10>::</SPAN><SPAN class=S11>GetBaseMedia</SPAN><SPAN class=S10>(</SPAN><SPAN class=S11>zoneDefault</SPAN><SPAN class=S10>);</SPAN><SPAN class=S0><BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN class=S5>for</SPAN><SPAN class=S0>&nbsp;</SPAN><SPAN class=S10>(</SPAN><SPAN class=S5>int</SPAN><SPAN class=S0>&nbsp;</SPAN><SPAN class=S11>i</SPAN><SPAN class=S10>=</SPAN><SPAN class=S11>mediaStore</SPAN><SPAN class=S10>-&gt;</SPAN><SPAN class=S11>cursor</SPAN><SPAN class=S10>;</SPAN><SPAN class=S0>&nbsp;</SPAN><SPAN class=S11>mediaStore</SPAN><SPAN class=S10>[</SPAN><SPAN class=S11>i</SPAN><SPAN class=S10>],</SPAN><SPAN class=S0>&nbsp;</SPAN><SPAN class=S11>i</SPAN><SPAN class=S10>++)</SPAN><SPAN class=S0>&nbsp;</SPAN><SPAN class=S10>{</SPAN><SPAN class=S0><BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN class=S11>mediaStore</SPAN><SPAN class=S10>-&gt;</SPAN><SPAN class=S11>Persist</SPAN><SPAN class=S10>(</SPAN><SPAN class=S11>s</SPAN><SPAN class=S10>[</SPAN><SPAN class=S11>i</SPAN><SPAN class=S10>]);</SPAN><SPAN class=S0><BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN class=S10>}</SPAN><SPAN class=S0><BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN class=S10>}</SPAN><SPAN class=S0><BR>
</SPAN><SPAN class=S10>};</SPAN>
</body>
</html>

BIN
MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/doc/SciRest.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

BIN
MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/doc/SciTEIco.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.9 KiB

BIN
MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/doc/SciWord.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.0 KiB

5350
MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/doc/ScintillaDoc.html

File diff suppressed because it is too large Load Diff

70
MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/doc/ScintillaDownload.html

@ -1,70 +0,0 @@
<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="generator" content="HTML Tidy, see www.w3.org" />
<meta name="generator" content="SciTE" />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>
Download Scintilla
</title>
</head>
<body bgcolor="#FFFFFF" text="#000000">
<table bgcolor="#000000" width="100%" cellspacing="0" cellpadding="0" border="0">
<tr>
<td>
<img src="SciTEIco.png" border="3" height="64" width="64" alt="Scintilla icon" />
</td>
<td>
<a href="index.html" style="color:white;text-decoration:none"><font size="5">Download
Scintilla</font></a>
</td>
</tr>
</table>
<table bgcolor="#CCCCCC" width="100%" cellspacing="0" cellpadding="8" border="0">
<tr>
<td>
<font size="4"> <a href="http://prdownloads.sourceforge.net/scintilla/scintilla171.zip?download">
Windows</a>&nbsp;&nbsp;
<a href="http://prdownloads.sourceforge.net/scintilla/scintilla171.tgz?download">
GTK+/Linux</a>&nbsp;&nbsp;
</font>
</td>
</tr>
</table>
<h2>
Download.
</h2>
<p>
The <a href="License.txt">license</a> for using Scintilla or SciTE is similar to that of Python
containing very few restrictions.
</p>
<h3>
Release 1.71
</h3>
<h4>
Source Code
</h4>
The source code package contains all of the source code for Scintilla but no binary
executable code and is available in
<ul>
<li><a href="http://prdownloads.sourceforge.net/scintilla/scintilla171.zip?download">zip format</a> (720K) commonly used on Windows</li>
<li><a href="http://prdownloads.sourceforge.net/scintilla/scintilla171.tgz?download">tgz format</a> (620K) commonly used on Linux and compatible operating systems</li>
</ul>
Instructions for building on both Windows and Linux are included in the readme file.
<h4>
Windows Executable Code
</h4>
There is no download available containing only the Scintilla DLL.
However, it is included in the <a href="SciTEDownload.html">SciTE
executable full download</a> as SciLexer.DLL.
<p>
<a href="SciTEDownload.html">SciTE</a> is a good demonstration of Scintilla.
</p>
<p>
Previous versions can be downloaded from the <a href="ScintillaHistory.html">history
page</a>.
</p>
</body>
</html>

5296
MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/doc/ScintillaHistory.html

File diff suppressed because it is too large Load Diff

507
MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/doc/ScintillaRelated.html

@ -1,507 +0,0 @@
<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="generator" content="HTML Tidy, see www.w3.org" />
<meta name="generator" content="SciTE" />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>
Scintilla and SciTE Related Sites
</title>
</head>
<body bgcolor="#FFFFFF" text="#000000">
<table bgcolor="#000000" width="100%" cellspacing="0" cellpadding="0" border="0">
<tr>
<td>
<img src="SciTEIco.png" border="3" height="64" width="64" alt="Scintilla icon" />
</td>
<td>
<a href="index.html" style="color:white;text-decoration:none"><font size="5">Scintilla
and SciTE</font></a>
</td>
</tr>
</table>
<h2>
Related Sites
</h2>
<h3>
Ports and Bindings of Scintilla
</h3>
<p>
<a href="http://mewsoft.com/cgi-bin/forum/forum.cgi?action=ViewTopic&Topic=1494&Forum=1&Page=1&Period=0a&Lang=English">Editawy</a>
is an ActiveX Control wrapper that support all Scintilla functions and additional high level functions.
</p>
<p>
<a href="http://sourceforge.net/projects/jintilla/">Jintilla</a>
is a JNI wrapper that allows Scintilla to be used in Java with
both SWT and AWT.
</p>
<p>
<a href="http://delphisci.sourceforge.net/">Delphi Scintilla Interface Components</a>
is a FREE collection of components that makes it easy to use the
Scintilla source code editing control from within Delphi and C++ Builder.
</p>
<p>
<a href="http://www.lehigh.edu/~jrl1/">wxStEdit</a>
is a library and sample program that provides extra features over wxStyledTextControl.
</p>
<p>
<a href="http://www.naughter.com/scintilla.html">CScintillaCtrl, CScintillaView &amp; CScintillaDoc</a>
are freeware MFC classes to encapsulate Scintilla.
</p>
<p>
<a href="http://sourceforge.net/projects/scide/">ScintillaNet
</a> is an encapsulation of Scintilla for use within the .NET framework.
</p>
<p>
<a href="http://www.riverbankcomputing.co.uk/qscintilla/index.php">QScintilla
</a> 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.
</p>
<p>
<a href="http://www.adapower.com/gwindows/">
GWindows</a> is a Win32 RAD GUI Framework for Ada 95 that
includes a binding of Scintilla.
</p>
<p>
<a href="http://www.templatetamer.org/index.php?DolphinScintilla">
DolphinScintilla</a> is a DolphinSmalltalk wrapper for Scintilla.
</p>
<p>
<a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/scintilla/ScintillaVB/">ScintillaVB</a>
is an ActiveX control written in VB that encapsulates Scintilla.
</p>
<p>
<a href="http://savannah.nongnu.org/projects/fxscintilla/">FXScintilla
</a> is a port of Scintilla to the FOX platform. FXRuby includes Ruby
bindings for FXScintilla.
</p>
<p>
<a href="http://www.pnotepad.org/scintilla/">Delphi wrapper</a> for
Scintilla which is also usable from Borland C++ Builder.
</p>
<p>
The wxStyledTextCtrl editor component in the
<a href="http://wxwindows.org/">wxWindows</a> cross platform toolkit is based on Scintilla.<br />
A Python binding for wxStyledTextCtrl is part of <a href="http://wxpython.org/">wxPython</a>.
</p>
<p>
<a href="http://sourceforge.net/projects/moleskine/">gtkscintilla</a>
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.
</p>
<p>
<a href="http://sourceforge.net/projects/moleskine/">gtkscintilla2</a>
is an alternative GTK class implementation for scintilla
similar to the above, but for GTK 2.x.
</p>
<p>
<a href="http://www.wingide.com/opensource/pyscintilla.html">pyscintilla</a>
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.
</p>
<p>
<a href="http://sourceforge.net/projects/moleskine/">pygtkscintilla</a>
is a Python binding for gtk1.x scintilla that uses
gtkscintilla instead of the default GTK class.
</p>
<p>
<a href="http://sra.itc.it/people/cavada/PyScintilla2.html">pyscintilla2</a>
is a Python binding for GTK 2.x scintilla that uses
gtkscintilla2.
</p>
<p>
<a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/scintilla/scintillactrl/">ScintillaCtrl</a>
is an unmaintained ActiveX control wrapper for Scintilla.
</p>
<h3>
Projects using Scintilla
</h3>
<p>
<a href="http://pype.sourceforge.net/">PyPE</a>
is an editor written in Python with the wxPython GUI toolkit.
</p>
<p>
<a href="http://home.mweb.co.za/sd/sdonovan/sciboo.html">Sciboo</a>
is an editor based on ScintillaNET.
</p>
<p>
<a href="https://sourceforge.net/projects/tsct/">The Scite Config Tool</a>
is a graphical user interface for changing SciTE properties files.
</p>
<p>
<a href="http://www.totalcmd.net/plugring/SciLister.html">Scintilla Lister</a>
is a plugin for Total Commander allowing viewing all documents with syntax highlighting
inside Total Commander.
</p>
<p>
<a href="http://chscite.sourceforge.net">ChSciTE</a>
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.
</p>
<p>
<a href="http://codeblocks.org/">
Code::Blocks</a> is an open source, cross platform free C++ IDE.
</p>
<p>
<a href="http://notepad-plus.sourceforge.net/uk/site.htm">
Notepad++</a> is a free source code editor under Windows.
</p>
<p>
<a href="http://gubed.mccabe.nu/">
Gubed</a> is a cross platform program to debug PHP scripts.
</p>
<p>
<a href="http://www.lesser-software.com/lswdnl.htm">
LSW DotNet-Lab</a> is a development environment for the .NET platform.
</p>
<p>
<a href="http://glintercept.nutty.org/">
GLIntercept</a> is an OpenGL function call interceptor that uses SciTE as a
run-time shader editor.
</p>
<p>
<a href="http://xined.sourceforge.net/">
Xin</a> is an open-source XML editor for Windows.
</p>
<p>
<a href="http://wxguide.sourceforge.net/indexedit.html">
wyoEditor</a> is "A nice editor with a well designed and consistent look and feel".
</p>
<p>
<a href="http://www.flos-freeware.ch/notepad2.html">
Notepad2</a> is "Yet another Notepad replacement".
</p>
<p>
<a href="http://pycrash.sourceforge.net/index.php?type=3">
PyCrash Viewer</a> can examine crash dumps of Python programs.
</p>
<p>
<a href="http://www.cabletest.com/mpt-discovery.shtml">
MPT series Wire Analyzers</a> use Scintilla and SciTE.
</p>
<p>
<a href="http://www.mygenerationsoftware.com">MyGeneration</a>
is a .NET based code generator.
</p>
<p>
<a href="http://cssed.sourceforge.net">CSSED</a>
is a tiny GTK2 CSS editor.
</p>
<p>
<a href="http://www.atari-soldiers.com/dide.html">DIDE</a>
is a free IDE for the D language on Windows.
</p>
<p>
<a href="http://wxghostscript.sourceforge.net/">
IdePS</a>
is a free Integrated Development Environment for PostScript
</p>
<p>
<a href="http://cute.sourceforge.net/">
CUTE</a>
is a user-friendly source code editor easily extended using Python.
</p>
<p>
<a href="http://www.spaceblue.com/venis/">
Venis IX</a>,
the Visual Environment for NSIS (Nullsoft Scriptable Install System).
</p>
<p>
<a href="http://www.parinya.ca/">
MinGW Developer Studio</a>
is a simple C/C++ IDE for the MinGW compiler on Windows.
</p>
<p>
<a href="http://www.die-offenbachs.de/detlev/eric3.html">Eric3</a>
is a Python IDE written using PyQt and QScintilla.
</p>
<p>
<a href="http://www.templatetamer.com/">TemplateTamer</a>
is a tool for development of template based PHP web pages.
</p>
<p>
<a href="http://www.bomberstudios.com/sciteflash/">SciTE|Flash</a>
is a free Scintilla-based ActionScript editor for Windows.
</p>
<p>
<a href="http://www.computersciencelab.com/CppIde.htm">CPPIDE</a>
is part of some commercial high-school oriented programming course software.
</p>
<p>
<a href="http://www.phpwebclasses.org/index.php?node=13">phpSciTE</a>
is a free distribution of SciTE for Windows customised for use with PHP
and bundled with a PHP API file and online help.
</p>
<p>
<a href="http://www.blazingtools.com/is.html">Instant Source</a>
is a commercial tool for looking at the HTML on web sites.
</p>
<p>
<a href="http://www.codejoin.com/radon/">RAD.On++</a>
is a free C++ Rapid Application Developer for Win32.
</p>
<p>
<a href="http://www.luascript.thersgb.net/index.htm">wxLua</a> is both
a binding of the wxWindows classes for Lua and a small IDE that works on Linux
and Windows.
</p>
<p>
<a href="http://wxbasic.sourceforge.net/">wxBasic</a> is an open source
Basic interpreter that uses the wxWindows toolkit. A small IDE is under construction.
</p>
<p>
<a href="http://freeride.rubyforge.org/wiki/wiki.pl">FreeRIDE</a> will be a
cross-platform IDE for the Ruby programming language.
</p>
<p>
<a href="http://visual-mingw.sourceforge.net/">Visual MinGW</a> is an
IDE for the MinGW compiler system.This runs on Windows with gcc.
</p>
<p>
The <a href="http://archaeopteryx.com/wingide">Wing IDE</a> is a
complete integrated development environment for the Python programming
language.
Available on Intel based Linux and Windows and on MacOS X through XDarwin.
</p>
<p>
<a href="http://www.gorlice.net.pl/~rybak/luaide/">LuaIDE</a>
is an IDE for Lua on Windows.
</p>
<p>
<a href="http://www.aegisknight.org/sphere/">Sphere</a>
is 2D RPG engine with a development environment.
</p>
<p>
<a href="http://gaiacrtn.free.fr/practical-ruby/index.html">Practical Ruby</a>
is an IDE for Ruby on Windows.
</p>
<p>
<a href="http://www.gnuenterprise.org/">GNUe</a>
is a suite of tools and applications for solving the needs of the enterprise.
</p>
<p>
<a href="http://silvercity.sourceforge.net/">SilverCity</a>
is a lexing package that can provide lexical analysis for over 20 programming
and markup languages.
</p>
<p>
<a href="http://www.akbkhome.com/Projects/phpmole-IDE/">Php mole</a>
is an integrated development enviroment for developing (primarily)
web based and phpgtk based applications.
</p>
<p>
<a href="http://hapdebugger.sourceforge.net/">HAP Python Remote Debugger</a>
is a Python debugger that can run on one Windows machine debugging a Python program running
on either the same or another machine.
</p>
<p>
<a href="http://www.rexx.com/~dkuhlman/">pyeditor and wxEditor</a>
are scriptable editors implemented in Python. pyeditor is based on GTK+ and
the pyscintilla wrapper. wxEditor is based on wxWindows, wxPython and
wxStyledTextControl.
</p>
<p>
<a href="http://www.pragmaticprogrammer.com/ruby/downloads/ruby-install.html">Ruby installation</a>
that includes SciTE set up for Ruby using an included copy of the "Programming Ruby" book for help.
</p>
<p>
<a href="http://www.lcc.ufrn.br/~milano/ild/index.html">Interactive LuaSpace Development</a>
is a graphical environment for LuaSpace which combines the CORBA platform
with the language Lua.
</p>
<p>
<a href="http://sourceforge.net/projects/pycrust/">PyCrust</a> is an interactive
Python shell based on wxPython.
</p>
<p>
<a href="http://www.thekompany.com/products/blackadder/">Black Adder</a> is a
Qt based development environment for Python and Ruby.
</p>
<p>
<a href="http://www.activestate.com/Products/Komodo/">Komodo</a>
is a cross-platform multi-language development environment built
as an application of Mozilla.
</p>
<p>
<a href="http://www.xtgsystems.com/lua/">titmouse</a>
is a Lua editor/debugger for Windows. It is available as both a component
and an application.
</p>
<p>
<a href="http://llt.chez.tiscali.fr/">Filerx</a>
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.
</p>
<p>
<a href="http://anjuta.sourceforge.net/">Anjuta</a>
is an open source C/C++ IDE for Linux/GNOME.
</p>
<p>
<a href="http://www.develop.com/genx/">Gen&lt;X&gt;</a>
is a <i>code generalisation</i> 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.
</p>
<p>
<a href="http://www.micampe.it/software/moleskine/">Moleskine</a> 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.
</p>
<p>
A <a href="http://www.burgaud.com">version of SciTE for Win32</a> enhanced
with a tab control to allow easy movement between buffers.
Go to the "Goodies" area on this site.
</p>
<p>
<a href="http://www.suneido.com">
Suneido</a> is an integrated application platform currently available for Win32 that includes an
object-oriented language, client-server database, and user interface and reporting frameworks.
</p>
<p>
<a href="http://www.BitBuilder.com">
BitLeaf</a> is a new GNOME based development environment.
Currently at an early stage of development.
</p>
<p>
<a href="http://agast.dyndns.org/agast/home.html">
Agast</a> is an authoring system for adventure games which includes
a customised version of SciTE.
</p>
<p>
<a href="http://oss.software.ibm.com/developerworks/opensource/sashxb/">
SashXB for Linux</a> is an open source application development tool by
IBM that uses Scintilla.
</p>
<p>
<a href="http://boa-constructor.sourceforge.net/">Boa Constructor</a> is a RAD GUI
Building IDE for the wxWindows cross platform platform. Written using wxPython with the
wxStyledTextCtrl used as its editor.
</p>
<p>
<a href="http://www.python.org/windows/">PythonWin</a>, a Win32 IDE for Python, uses
Scintilla for both its editing and interactive windows.
</p>
<h3>
Editing Components
</h3>
<p>
<a href="http://gtksourceview.sourceforge.net/index.html">GtkSourceView</a>
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.
</p>
<p>
<a href="http://aeditor.rubyforge.org/">AEditor</a>
is a free source code editing component implemented in Ruby.
</p>
<p>
<a href="http://www.actiprosoftware.com/Products/DotNet/SyntaxEditor/Default.aspx">SyntaxEditor</a>
is a commercial native .Net source code editing component.
</p>
<p>
<a href="http://jedit.sourceforge.net/">jEdit</a> is a good Open Source syntax colouring
editor written in and for Java.
</p>
<p>
<a href="http://www.gtk.org/">GTK+</a>, the GIMP Toolkit, contains a rich text editing
widget.<br />
<a href="http://gedit.sourceforge.net/">Gedit</a> is an editor for GTK+/GNOME.<br />
<!--
<a href="http://www.daimi.au.dk/~mailund/gtk.html">GtkEditor</a> is a source code editing
widget based on the GTK+ text widget.<br />
<a href="http://gide.gdev.net/">gIDE</a> is an IDE based on GTK+.<br />
<a href="http://www.bahnhof.se/~mikeh/linux_software.html">GtkExText</a> is a source code
oriented text widget for GTK+.
-->
</p>
<p>
<a href="http://www.codeguru.com/">CodeGuru</a> has source code for several Win32 MFC based
editors.
</p>
<a href="http://synedit.sourceforge.net/">SynEdit</a> is a Win32 edit control written
in Delphi.
<p>
<a href="http://www.tetradyne.com/srcvwax.htm">SourceView</a> is a commercial editing
component for Win32.
</p>
<p>
<a href="http://www.winmain.com/">CodeMax</a> is another commercial component for Win32.
</p>
<h3>
Documents
</h3>
<p>
<a href="http://www.finseth.com/~fin/craft/">The Craft of Text Editing</a>
describes how EMACS works, <i>Craig A. Finseth</i>
</p>
<p>
<a href="http://freespace.virgin.net/james.brown7/tuts/bigmem02.htm">Span Tables</a>
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, <i>James Brown</i>
</p>
<p>
<a href="http://www.cs.cmu.edu/~wjh/papers/byte.html">Data Structures in a Bit-Mapped Text
Editor</a>, <i>Wilfred J. Hanson</i>, Byte January 1987
</p>
<p>
Text Editors: Algorithms and Architectures, <i>Ray Vald&eacute;s</i>, Dr. Dobbs Journal
April 1993
</p>
<p>
Macintosh User Interface Guidelines and TextEdit chapters of Inside Macintosh
</p>
<h3>
Development Tools
</h3>
<p>
Scintilla and SciTE were developed using the
<a href="http://www.mingw.org/">Mingw version of GCC</a>.
</p>
<p>
<a href="http://astyle.sourceforge.net/">AStyle</a> is a source code formatter for C++ and
Java code. SciTE has an Indent command defined for .cxx files that uses AStyle.
</p>
<p>
<a href="http://winmerge.sourceforge.net/">WinMerge</a> 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.
</p>
<p>
<a href="http://www.python.org">Python</a> is my favourite programming language. Scintilla
was started after I tried to improve the editor built into <a
href="http://www.python.org/windows/">PythonWin</a>, but was frustrated by the limitations of
the Windows Richedit control which PythonWin used.
</p>
<p>
<a href="http://www.cs.yorku.ca/~oz/">regex</a> is a public domain
implementation of regular expression pattern matching used in Scintilla.
</p>
<!--
<p>
<a href="http://www.petes-place.com/">CodeMagic</a> is a free generic IDE for Win32.
Strongly Perl focused but customisable for other languages. Has more user interface features
than SciTE.
</p>
-->
<p>
<!--
Debugging dance soundtrack from <a href="http://www.insurge.com.au">iNsuRge</a>
and -->
Inspirational coding soundscapes by <a href="http://www.davidbridie.com.au">David Bridie</a>.
</p>
<p>
Get away from hacking without any of that tedious standing up bother: <a
href="http://www.zip.com.au/~sneal/index.html">Virtually There</a> ;).
</p>
</body>
</html>

178
MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/doc/ScintillaToDo.html

@ -1,178 +0,0 @@
<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="generator" content="HTML Tidy, see www.w3.org" />
<meta name="generator" content="SciTE" />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>
Scintilla and SciTE To Do
</title>
</head>
<body bgcolor="#FFFFFF" text="#000000">
<table bgcolor="#000000" width="100%" cellspacing="0" cellpadding="0" border="0">
<tr>
<td>
<img src="SciTEIco.png" border="3" height="64" width="64" alt="Scintilla icon" />
</td>
<td>
<a href="index.html" style="color:white;text-decoration:none"><font size="5">Scintilla
and SciTE</font></a>
</td>
</tr>
</table>
<h2>
Bugs and To Do List
</h2>
<h3>
Feedback
</h3>
<p>
Issues can be reported on the <a href="https://sourceforge.net/tracker/?group_id=2439&atid=102439">Bug Tracker</a>
and features requested on the <a href="https://sourceforge.net/tracker/?group_id=2439&atid=352439">Feature Request Tracker</a>.
</p>
<h3>
Scintilla Bugs
</h3>
<p>
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.
</p>
<p>
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.
</p>
<p>
Automatic scrolling when text dragged near edge of window.
</p>
<h3>
GTK+ Version Bugs
</h3>
<h3>
Scintilla To Do
</h3>
<p>
Folding for languages that don't have it yet and good folding for languages
that inherited poor folding from another languages folding code.
</p>
<p>
Simple pattern based styling.
</p>
<p>
Different height lines based upon tallest text on the line rather than on the tallest style
possible.
</p>
<p>
Composition of lexing for mixed languages (such as ASP+ over COBOL) by
combining lexers.
</p>
<p>
Printing support on GTK+. Maybe Postscript output or use Gnome?
</p>
<p>
Stream folding which could be used to fold up the contents of HTML elements.
</p>
<p>
Persisting view state such as current folding into a stream or blob so it is easy
to restore.
</p>
<p>
Move line up and move line down keys or move selected lines up / down.
</p>
<p>
Printing of highlight lines and folding margin.
</p>
<p>
Flow diagrams inside editor similar to
<a href="http://www.eng.auburn.edu/grasp/grasp_main.shtml">
GRASP</a>.
</p>
<p>
A VCL component wrapper around Scintilla so it can be used with Delphi or
Borland C++ Builder.
There is <a href="http://www.pnotepad.org/scintilla/">some work</a>
on this available.
</p>
<p>
Port to MacOS X.
</p>
<p>
More lexers for other languages.
</p>
<p>
Automatically calculated range for horizontal scrolling.
</p>
<p>
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.
</p>
<h3>
SciTE To Do
</h3>
<p>
Good regular expression support through a plugin.
</p>
<p>
Allow tools to transform the selection, performing an operation like
indentation or sorting.
</p>
<p>
Allow file name based selection on all properties rather than just a chosen few.
</p>
<p>
Opening from and saving to FTP servers.
</p>
<p>
Setting to fold away comments upon opening.
</p>
<p>
User defined fold ranges.
</p>
<p>
Silent mode that does not display any message boxes.
</p>
<h3>
Features I am unlikely to do
</h3>
<p>
These are features I don't like or don't think are important enough to work on.
Implementations are welcome from others though.
</p>
<p>
Automatically saving modified menu shortcuts on exit.
</p>
<p>
Mouse wheel panning (press the mouse wheel and then move the mouse) on
Windows.
</p>
<p>
Adding options to the save dialog to save in a particular encoding or with a
chosen line ending.
</p>
<h3>
Directions
</h3>
<p>
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.
</p>
<p>
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.
</p>
</body>
</html>

375
MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/doc/ScintillaUsage.html

@ -1,375 +0,0 @@
<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="generator" content="HTML Tidy, see www.w3.org" />
<meta name="generator" content="SciTE" />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>
Scintilla Usage Notes
</title>
<style type="text/css">
SPAN {
font-family: Verdana, Arial, Helvetica;
font-size: 9pt;
}
.S0 {
color: #808080;
font-family: Verdana, Arial, Helvetica;
}
.S1 {
font-family: Comic Sans MS, Times New Roman, Times;
color: #007F00;
font-size: 8pt;
}
.S2 {
font-family: Comic Sans MS, Times New Roman, Times;
color: #007F00;
font-size: 8pt;
}
.S3 {
font-family: Verdana, Arial, Helvetica;
color: #7F7F7F;
}
.S4 {
font-family: Verdana, Arial, Helvetica;
color: #007F7F;
}
.S5 {
color: #00007F;
font-weight: bold;
font-family: Verdana, Arial, Helvetica;
}
.S6 {
color: #7F007F;
font-family: Courier New, Courier;
}
.S7 {
color: #7F007F;
font-family: Courier New, Courier;
}
.S8 {
color: #007F7F;
}
.S9 {
color: #7F7F00;
}
.S10 {
font-weight: bold;
}
</style>
</head>
<body bgcolor="#FFFFFF" text="#000000">
<table bgcolor="#000000" width="100%" cellspacing="0" cellpadding="0" border="0">
<tr>
<td>
<img src="SciTEIco.png" border="3" height="64" width="64" alt="Scintilla icon" />
</td>
<td>
<a href="index.html" style="color:white;text-decoration:none"><font size="5">Scintilla
Usage Notes</font></a>
</td>
</tr>
</table>
<h2>
Implementing Auto-Indent
</h2>
<p>
The key idea is to use the SCN_CHARADDED notification to add indentation after a newline.
</p>
<p>
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.
</p>
<p>
Here is the relevant portion of code from SciTE: (SciTE.cxx SciTEWindow::CharAdded)
</p>
<span class='S5'>if</span><span class='S0'>&nbsp;</span> <span class='S10'>(</span><span
class='S11'>ch</span><span class='S0'>&nbsp;</span> <span class='S10'>==</span><span
class='S0'>&nbsp;</span> <span class='S7'>'\r'</span><span class='S0'>&nbsp;</span> <span
class='S10'>||</span><span class='S0'>&nbsp;</span> <span class='S11'>ch</span><span
class='S0'>&nbsp;</span> <span class='S10'>==</span><span class='S0'>&nbsp;</span> <span
class='S7'>'\n'</span><span class='S10'>)</span><span class='S0'>&nbsp;</span> <span
class='S10'>{</span><span class='S0'><br />
&nbsp;&nbsp;&nbsp;&nbsp;</span> <span class='S5'>char</span><span class='S0'>&nbsp;</span>
<span class='S11'>linebuf</span><span class='S10'>[</span><span class='S4'>1000</span><span
class='S10'>];</span><span class='S0'><br />
&nbsp;&nbsp;&nbsp;&nbsp;</span> <span class='S5'>int</span><span class='S0'>&nbsp;</span>
<span class='S11'>curLine</span><span class='S0'>&nbsp;</span> <span class='S10'>=</span><span
class='S0'>&nbsp;</span> <span class='S11'>GetCurrentLineNumber</span><span
class='S10'>();</span><span class='S0'><br />
&nbsp;&nbsp;&nbsp;&nbsp;</span> <span class='S5'>int</span><span class='S0'>&nbsp;</span>
<span class='S11'>lineLength</span><span class='S0'>&nbsp;</span> <span class='S10'>
=</span><span class='S0'>&nbsp;</span> <span class='S11'>SendEditor</span><span
class='S10'>(</span><span class='S11'>SCI_LINELENGTH</span><span class='S10'>,</span><span
class='S0'>&nbsp;</span> <span class='S11'>curLine</span><span class='S10'>);</span><span
class='S0'><br />
&nbsp;&nbsp;&nbsp;&nbsp;</span> <span class='S2'>
//Platform::DebugPrintf("[CR]&nbsp;%d&nbsp;len&nbsp;=&nbsp;%d\n",&nbsp;curLine,&nbsp;lineLength);</span><span
class='S0'><br />
&nbsp;&nbsp;&nbsp;&nbsp;</span> <span class='S5'>if</span><span class='S0'>&nbsp;</span> <span
class='S10'>(</span><span class='S11'>curLine</span><span class='S0'>&nbsp;</span> <span
class='S10'>&gt;</span><span class='S0'>&nbsp;</span> <span class='S4'>0</span><span
class='S0'>&nbsp;</span> <span class='S10'>&amp;&amp;</span><span class='S0'>&nbsp;</span>
<span class='S11'>lineLength</span><span class='S0'>&nbsp;</span> <span class='S10'>
&lt;=</span><span class='S0'>&nbsp;</span> <span class='S4'>2</span><span
class='S10'>)</span><span class='S0'>&nbsp;</span> <span class='S10'>{</span><span
class='S0'><br />
&nbsp;&nbsp;&nbsp;&nbsp;</span> <span class='S5'>int</span><span class='S0'>&nbsp;</span>
<span class='S11'>prevLineLength</span><span class='S0'>&nbsp;</span> <span class='S10'>
=</span><span class='S0'>&nbsp;</span> <span class='S11'>SendEditor</span><span
class='S10'>(</span><span class='S11'>SCI_LINELENGTH</span><span class='S10'>,</span><span
class='S0'>&nbsp;</span> <span class='S11'>curLine</span><span class='S0'>&nbsp;</span> <span
class='S10'>-</span><span class='S0'>&nbsp;</span> <span class='S4'>1</span><span
class='S10'>);</span><span class='S0'><br />
&nbsp;&nbsp;&nbsp;&nbsp;</span> <span class='S5'>if</span><span class='S0'>&nbsp;</span> <span
class='S10'>(</span><span class='S11'>prevLineLength</span><span class='S0'>&nbsp;</span> <span
class='S10'>&lt;</span><span class='S0'>&nbsp;</span> <span class='S5'>sizeof</span><span
class='S10'>(</span><span class='S11'>linebuf</span><span class='S10'>))</span><span
class='S0'>&nbsp;</span> <span class='S10'>{</span><span class='S0'><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span> <span class='S11'>WORD</span><span
class='S0'>&nbsp;</span> <span class='S11'>buflen</span><span class='S0'>&nbsp;</span> <span
class='S10'>=</span><span class='S0'>&nbsp;</span> <span class='S5'>sizeof</span><span
class='S10'>(</span><span class='S11'>linebuf</span><span class='S10'>);</span><span
class='S0'><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span> <span class='S11'>memcpy</span><span
class='S10'>(</span><span class='S11'>linebuf</span><span class='S10'>,</span><span
class='S0'>&nbsp;</span> <span class='S10'>&amp;</span><span class='S11'>buflen</span><span
class='S10'>,</span><span class='S0'>&nbsp;</span> <span class='S5'>sizeof</span><span
class='S10'>(</span><span class='S11'>buflen</span><span class='S10'>));</span><span
class='S0'><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span> <span class='S11'>
SendEditor</span><span class='S10'>(</span><span class='S11'>EM_GETLINE</span><span
class='S10'>,</span><span class='S0'>&nbsp;</span> <span class='S11'>curLine</span><span
class='S0'>&nbsp;</span> <span class='S10'>-</span><span class='S0'>&nbsp;</span> <span
class='S4'>1</span><span class='S10'>,</span><span class='S0'><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
<span class='S5'>reinterpret_cast</span><span class='S10'>&lt;</span><span
class='S11'>LPARAM</span><span class='S10'>&gt;(</span><span class='S5'>static_cast</span><span
class='S10'>&lt;</span><span class='S5'>char</span><span class='S0'>&nbsp;</span> <span
class='S10'>*&gt;(</span><span class='S11'>linebuf</span><span class='S10'>)));</span><span
class='S0'><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span> <span class='S11'>linebuf</span><span
class='S10'>[</span><span class='S11'>prevLineLength</span><span class='S10'>]</span><span
class='S0'>&nbsp;</span> <span class='S10'>=</span><span class='S0'>&nbsp;</span> <span
class='S7'>'\0'</span><span class='S10'>;</span><span class='S0'><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span> <span class='S5'>for</span><span
class='S0'>&nbsp;</span> <span class='S10'>(</span><span class='S5'>int</span><span
class='S0'>&nbsp;</span> <span class='S11'>pos</span><span class='S0'>&nbsp;</span> <span
class='S10'>=</span><span class='S0'>&nbsp;</span> <span class='S4'>0</span><span
class='S10'>;</span><span class='S0'>&nbsp;</span> <span class='S11'>linebuf</span><span
class='S10'>[</span><span class='S11'>pos</span><span class='S10'>];</span><span
class='S0'>&nbsp;</span> <span class='S11'>pos</span><span class='S10'>++)</span><span
class='S0'>&nbsp;</span> <span class='S10'>{</span><span class='S0'><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span> <span
class='S5'>if</span><span class='S0'>&nbsp;</span> <span class='S10'>(</span><span
class='S11'>linebuf</span><span class='S10'>[</span><span class='S11'>pos</span><span
class='S10'>]</span><span class='S0'>&nbsp;</span> <span class='S10'>!=</span><span
class='S0'>&nbsp;</span> <span class='S7'>'&nbsp;'</span><span class='S0'>&nbsp;</span> <span
class='S10'>&amp;&amp;</span><span class='S0'>&nbsp;</span> <span class='S11'>
linebuf</span><span class='S10'>[</span><span class='S11'>pos</span><span
class='S10'>]</span><span class='S0'>&nbsp;</span> <span class='S10'>!=</span><span
class='S0'>&nbsp;</span> <span class='S7'>'\t'</span><span class='S10'>)</span><span
class='S0'><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
<span class='S11'>linebuf</span><span class='S10'>[</span><span class='S11'>pos</span><span
class='S10'>]</span><span class='S0'>&nbsp;</span> <span class='S10'>=</span><span
class='S0'>&nbsp;</span> <span class='S7'>'\0'</span><span class='S10'>;</span><span
class='S0'><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span> <span class='S10'>}</span><span
class='S0'><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span> <span class='S11'>
SendEditor</span><span class='S10'>(</span><span class='S11'>EM_REPLACESEL</span><span
class='S10'>,</span><span class='S0'>&nbsp;</span> <span class='S4'>0</span><span
class='S10'>,</span><span class='S0'>&nbsp;</span> <span class='S5'>
reinterpret_cast</span><span class='S10'>&lt;</span><span class='S11'>LPARAM</span><span
class='S10'>&gt;(</span><span class='S5'>static_cast</span><span class='S10'>&lt;</span><span
class='S5'>char</span><span class='S0'>&nbsp;</span> <span class='S10'>*&gt;(</span><span
class='S11'>linebuf</span><span class='S10'>)));</span><span class='S0'><br />
&nbsp;&nbsp;&nbsp;&nbsp;</span> <span class='S10'>}</span><span class='S0'><br />
</span> <span class='S10'>}</span><br />
<p style="margin-bottom: 0in">
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.)
</p>
<h2>
Implementing Syntax Styling
</h2>
<p>
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.
</p>
<p>
Here is the relevant portion of code from SciTE: (SciTE.cxx)
</p>
<span class='S5'>void</span><span class='S0'>&nbsp;</span> <span class='S11'>
SciTEWindow</span><span class='S10'>::</span><span class='S11'>Notify</span><span
class='S10'>(</span><span class='S11'>SCNotification</span><span class='S0'>&nbsp;</span> <span
class='S10'>*</span><span class='S11'>notification</span><span class='S10'>)</span><span
class='S0'>&nbsp;</span> <span class='S10'>{</span><span class='S0'><br />
&nbsp;&nbsp;&nbsp;&nbsp;</span> <span class='S5'>switch</span><span class='S0'>&nbsp;</span>
<span class='S10'>(</span><span class='S11'>notification</span><span
class='S10'>-&gt;</span><span class='S11'>nmhdr.code</span><span class='S10'>)</span><span
class='S0'>&nbsp;</span> <span class='S10'>{</span><span class='S0'><br />
&nbsp;&nbsp;&nbsp;&nbsp;</span> <span class='S5'>case</span><span class='S0'>&nbsp;</span>
<span class='S11'>SCN_STYLENEEDED</span><span class='S10'>:</span><span
class='S0'>&nbsp;</span> <span class='S10'>{</span><span class='S0'><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span> <span
class='S5'>if</span><span class='S0'>&nbsp;</span> <span class='S10'>(</span><span
class='S11'>notification</span><span class='S10'>-&gt;</span><span
class='S11'>nmhdr.idFrom</span><span class='S0'>&nbsp;</span> <span class='S10'>==</span><span
class='S0'>&nbsp;</span> <span class='S11'>IDM_SRCWIN</span><span class='S10'>)</span><span
class='S0'>&nbsp;</span> <span class='S10'>{</span><span class='S0'><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
<span class='S5'>int</span><span class='S0'>&nbsp;</span> <span class='S11'>
endStyled</span><span class='S0'>&nbsp;</span> <span class='S10'>=</span><span
class='S0'>&nbsp;</span> <span class='S11'>SendEditor</span><span class='S10'>(</span><span
class='S11'>SCI_GETENDSTYLED</span><span class='S10'>);</span><span class='S0'><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
<span class='S5'>int</span><span class='S0'>&nbsp;</span> <span class='S11'>
lineEndStyled</span><span class='S0'>&nbsp;</span> <span class='S10'>=</span><span
class='S0'>&nbsp;</span> <span class='S11'>SendEditor</span><span class='S10'>(</span><span
class='S11'>EM_LINEFROMCHAR</span><span class='S10'>,</span><span class='S0'>&nbsp;</span>
<span class='S11'>endStyled</span><span class='S10'>);</span><span class='S0'><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
<span class='S11'>endStyled</span><span class='S0'>&nbsp;</span> <span class='S10'>
=</span><span class='S0'>&nbsp;</span> <span class='S11'>SendEditor</span><span
class='S10'>(</span><span class='S11'>EM_LINEINDEX</span><span class='S10'>,</span><span
class='S0'>&nbsp;</span> <span class='S11'>lineEndStyled</span><span class='S10'>);</span><span
class='S0'><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
<span class='S11'>Colourise</span><span class='S10'>(</span><span
class='S11'>endStyled</span><span class='S10'>,</span><span class='S0'>&nbsp;</span> <span
class='S11'>notification</span><span class='S10'>-&gt;</span><span
class='S11'>position</span><span class='S10'>);</span><br />
<p>
Colourize(start, end) retrieves the specified range of text and then calls ColourizeDoc in
keywords.cxx. It starts the process by calling:
</p>
&nbsp;&nbsp;&nbsp;&nbsp;<span class='S11'>SendMessage</span><span class='S10'>(</span><span
class='S11'>hwnd</span><span class='S10'>,</span><span class='S0'>&nbsp;</span> <span
class='S11'>SCI_STARTSTYLING</span><span class='S10'>,</span><span class='S0'>&nbsp;</span>
<span class='S11'>startPos</span><span class='S10'>,</span><span class='S0'>&nbsp;</span> <span
class='S4'>31</span><span class='S10'>);</span><br />
<p>
and then for each token of the text, calling:
</p>
&nbsp;&nbsp;&nbsp;&nbsp;<span class='S11'>SendMessage</span><span class='S10'>(</span><span
class='S11'>hwnd</span><span class='S10'>,</span><span class='S0'>&nbsp;</span> <span
class='S11'>SCI_SETSTYLING</span><span class='S10'>,</span><span class='S0'>&nbsp;</span> <span
class='S11'>length</span><span class='S10'>,</span><span class='S0'>&nbsp;</span> <span
class='S11'>style</span><span class='S10'>);</span><br />
<p>
where style is a number from 0 to 31 whose appearance has been defined using the
SCI_STYLESET... messages.
</p>
<h2>
Implementing Calltips
</h2>
<p>
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:
</p>
&nbsp;&nbsp;&nbsp;&nbsp;<span class='S5'>char</span><span class='S0'>&nbsp;</span> <span
class='S11'>linebuf</span><span class='S10'>[</span><span class='S4'>1000</span><span
class='S10'>];</span><span class='S0'><br />
</span> &nbsp;&nbsp;&nbsp;&nbsp;<span class='S5'>int</span><span class='S0'>&nbsp;</span> <span
class='S11'>current</span><span class='S0'>&nbsp;</span> <span class='S10'>=</span><span
class='S0'>&nbsp;</span> <span class='S11'>SendEditor</span><span class='S10'>(</span><span
class='S11'>SCI_GETCURLINE</span><span class='S10'>,</span><span class='S0'>&nbsp;</span> <span
class='S5'>sizeof</span><span class='S10'>(</span><span class='S11'>linebuf</span><span
class='S10'>),</span><span class='S0'><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span> <span class='S5'>
reinterpret_cast</span><span class='S10'>&lt;</span><span class='S11'>LPARAM</span><span
class='S10'>&gt;(</span><span class='S5'>static_cast</span><span class='S10'>&lt;</span><span
class='S5'>char</span><span class='S0'>&nbsp;</span> <span class='S10'>*&gt;(</span><span
class='S11'>linebuf</span><span class='S10'>)));</span><span class='S0'><br />
</span> &nbsp;&nbsp;&nbsp;&nbsp;<span class='S5'>int</span><span class='S0'>&nbsp;</span> <span
class='S11'>pos</span><span class='S0'>&nbsp;</span> <span class='S10'>=</span><span
class='S0'>&nbsp;</span> <span class='S11'>SendEditor</span><span class='S10'>(</span><span
class='S11'>SCI_GETCURRENTPOS</span><span class='S10'>);</span><span class='S0'><br />
<br />
</span> &nbsp;&nbsp;&nbsp;&nbsp;<span class='S5'>int</span><span class='S0'>&nbsp;</span> <span
class='S11'>startword</span><span class='S0'>&nbsp;</span> <span class='S10'>=</span><span
class='S0'>&nbsp;</span> <span class='S11'>current</span><span class='S0'>&nbsp;</span> <span
class='S10'>-</span><span class='S0'>&nbsp;</span> <span class='S4'>1</span><span
class='S10'>;</span><span class='S0'><br />
</span> &nbsp;&nbsp;&nbsp;&nbsp;<span class='S5'>while</span><span class='S0'>&nbsp;</span>
<span class='S10'>(</span><span class='S11'>startword</span><span class='S0'>&nbsp;</span>
<span class='S10'>&gt;</span><span class='S0'>&nbsp;</span> <span class='S4'>0</span><span
class='S0'>&nbsp;</span> <span class='S10'>&amp;&amp;</span><span class='S0'>&nbsp;</span>
<span class='S11'>isalpha</span><span class='S10'>(</span><span class='S11'>linebuf</span><span
class='S10'>[</span><span class='S11'>startword</span><span class='S0'>&nbsp;</span> <span
class='S10'>-</span><span class='S0'>&nbsp;</span> <span class='S4'>1</span><span
class='S10'>]))</span><span class='S0'><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span> <span class='S11'>
startword</span><span class='S10'>--;</span><span class='S0'><br />
</span> &nbsp;&nbsp;&nbsp;&nbsp;<span class='S11'>linebuf</span><span class='S10'>[</span><span
class='S11'>current</span><span class='S0'>&nbsp;</span> <span class='S10'>-</span><span
class='S0'>&nbsp;</span> <span class='S4'>1</span><span class='S10'>]</span><span
class='S0'>&nbsp;</span> <span class='S10'>=</span><span class='S0'>&nbsp;</span> <span
class='S7'>'\0'</span><span class='S10'>;</span><span class='S0'><br />
</span> &nbsp;&nbsp;&nbsp;&nbsp;<span class='S5'>char</span><span class='S10'>*</span><span
class='S0'>&nbsp;</span> <span class='S11'>word</span><span class='S0'>&nbsp;</span> <span
class='S10'>=</span><span class='S0'>&nbsp;</span> <span class='S11'>linebuf</span><span
class='S0'>&nbsp;</span> <span class='S10'>+</span><span class='S0'>&nbsp;</span> <span
class='S11'>startword</span><span class='S10'>;</span><br />
<p>
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).
</p>
&nbsp;&nbsp;&nbsp;&nbsp;<span class='S11'>pos</span><span class='S0'>&nbsp;</span> <span
class='S10'>=</span><span class='S0'>&nbsp;</span> <span class='S11'>SendMessage</span><span
class='S10'>(</span><span class='S11'>hwnd</span><span class='S10'>,</span><span
class='S0'>&nbsp;</span> <span class='S11'>SCI_GETCURRENTPOS</span><span
class='S10'>,</span><span class='S0'>&nbsp;</span> <span class='S4'>0</span><span
class='S10'>,</span><span class='S0'>&nbsp;</span> <span class='S4'>0</span><span
class='S10'>);</span><span class='S0'><br />
</span> &nbsp;&nbsp;&nbsp;&nbsp;<span class='S11'>SendMessageText</span><span
class='S10'>(</span><span class='S11'>hwnd</span><span class='S10'>,</span><span
class='S0'>&nbsp;</span> <span class='S11'>SCI_CALLTIPSHOW</span><span
class='S10'>,</span><span class='S0'>&nbsp;</span> <span class='S11'>pos</span><span
class='S0'>&nbsp;</span> <span class='S10'>-</span><span class='S0'>&nbsp;</span> <span
class='S11'>wordLen</span><span class='S0'>&nbsp;</span> <span class='S10'>-</span><span
class='S0'>&nbsp;</span> <span class='S4'>1</span><span class='S10'>,</span><span
class='S0'>&nbsp;</span> <span class='S11'>calltip</span><span class='S10'>);</span><br />
<p>
The calltip can be removed when a closing parenthesis is entered:
</p>
&nbsp;&nbsp;&nbsp;&nbsp;<span class='S5'>if</span><span class='S0'>&nbsp;</span> <span
class='S10'>(</span><span class='S11'>SendMessage</span><span class='S10'>(</span><span
class='S11'>hwnd</span><span class='S10'>,</span><span class='S0'>&nbsp;</span> <span
class='S11'>SCI_CALLTIPACTIVE</span><span class='S10'>,</span><span class='S0'>&nbsp;</span>
<span class='S4'>0</span><span class='S10'>,</span><span class='S0'>&nbsp;</span> <span
class='S4'>0</span><span class='S10'>))</span><span class='S0'><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span> <span class='S11'>
SendMessage</span><span class='S10'>(</span><span class='S11'>hwnd</span><span
class='S10'>,</span><span class='S0'>&nbsp;</span> <span class='S11'>
SCI_CALLTIPCANCEL</span><span class='S10'>,</span><span class='S0'>&nbsp;</span> <span
class='S4'>0</span><span class='S10'>,</span><span class='S0'>&nbsp;</span> <span class='S4'>
0</span><span class='S10'>);</span><br />
<p>
Obviously, it is up the application to look after supplying the appropriate calltip text.
</p>
<p>
SciTE goes one step further, counting the commas between arguments and highlighting the
corresponding part of the calltip. This code is in ContinueCallTip.
</p>
<p>
<i>Page contributed by Andrew McKinlay.</i>
</p>
</body>
</html>

142
MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/doc/Steps.html

@ -1,142 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
<html><head><meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type"><title>How to use the Scintilla Edit Control in windows?</title></head><body bgcolor="#ffffff">
<p><h2>How to use the Scintilla Edit Control in windows?</h2>
<p>
This should be a little step by step explanation how to use Scintilla in the windows environment.
</p>
</p>
<p><h2>How to create Scintilla Edit Control?</h2>
<p>
First of all, load the Scintilla DLL with something like:
</p>
<pre>
hmod = LoadLibrary(&quot;SciLexer.DLL&quot;);
if (hmod==NULL)
{
MessageBox(hwndParent,
&quot;The Scintilla DLL could not be loaded.&quot;,
&quot;Error loading Scintilla&quot;,
MB_OK | MB_ICONERROR);
}
</pre>
<p>
If the DLL was loaded successfully, then the DLL has registered (yes, by itself) a new
window class. The new class called &quot;Scintilla&quot; is the new scintilla edit control.
</p>
<p>
Now you can use this new control just like any other windows control.
</p>
<pre>
hwndScintilla = CreateWindowEx(0,
&quot;Scintilla&quot;,&quot;&quot;, WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_CLIPCHILDREN,
10,10,500,400,hwndParent,(HMENU)GuiID, hInstance,NULL);
</pre>
<p>
Note the new window class name: &quot;Scintilla&quot;. By reaching this point you actually included
a Scintilla Edit Control to your windows program.
</p>
</p>
<p><h2>How to control the Scintilla Edit Control?</h2>
<p>
You can control Scintilla by sending commands to the Edit Control.
There a 2 ways of doing this. A simple and fast way.
</p>
<p><h3>The simple way to control Scintilla</h3>
<p>
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.)
</p>
<p>
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.
</p>
<pre>
SendMessage(hwndScintilla,sci_command,wparam,lparam);
</pre>
<p>
like:
</p>
<pre>
SendMessage(hwndScintilla,SCI_CREATEDOCUMENT, 0, 0);
</pre>
<p>
Some of the commands will return a value and unused parameters should be set to NULL.
</p>
</p>
<p><h3>The fast way to control Scintilla</h3>
<p>
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.
</p>
<p>
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 :)
</p>
<p>
The whole thing has to look like this:
</p>
<pre>
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);
</pre>
<p>
with &quot;fn&quot; as the function pointer to the message handling function of the Scintilla Control
and &quot;ptr&quot; as the pointer that must be used as 1st parameter.
The next parameters are the Scintilla Command with its two (optional) parameters.
</p>
</p>
<p><h3>How will I receive notifications?</h3>
<p>
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.
</p>
<p>
So in Scintillas parent window message handling function you have to include some code like this:
</p>
<pre>
NMHDR *lpnmhdr;
[...]
case WM_NOTIFY:
lpnmhdr = (LPNMHDR) lParam;
if(lpnmhdr-&gt;hwndFrom==hwndScintilla)
{
switch(lpnmhdr-&gt;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;
</pre>
</p>
</p>
<p>
<i>Page contributed by Holger Schmidt.</i>
</p>
</body></html>

198
MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/doc/index.html

@ -1,198 +0,0 @@
<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="generator" content="HTML Tidy, see www.w3.org" />
<meta name="generator" content="SciTE" />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta name="keywords" content="Scintilla, SciTE, Editing Component, Text Editor" />
<meta name="Description"
content="www.scintilla.org is the home of the Scintilla editing component and SciTE text editor application." />
<meta name="Date.Modified" content="20060821" />
<style type="text/css">
.versionlist {
color: #FFCC99;
}
</style>
<script>
function IsRemote() {
var loc = '' + window.location;
return loc.indexOf('http:') != -1;
}
</script>
<title>
Scintilla and SciTE
</title>
</head>
<body bgcolor="#FFFFFF" text="#000000">
<table bgcolor="#000000" width="100%" cellspacing="0" cellpadding="0" border="0">
<tr>
<td width="256">
<img src="SciWord.jpg" height="78" width="256" alt="Scintilla" />
</td>
<td width="40%" align="left">
<font color="#FFCC99" size="4"> A free source code editing component for Win32 and
GTK+</font>
</td>
<td width="40%" align="right">
<font color="#FFCC99" size="3"> Release version 1.71<br />
Site last modified August 21 2006</font>
</td>
<td width="20%">
&nbsp;
</td>
</tr>
</table>
<table bgcolor="#000000" width="100%" cellspacing="0" cellpadding="0" border="0">
<tr>
<td width="100%">
<img src="SciBreak.jpg" height="150" width="1024" alt="Sci Break" />
</td>
</tr>
</table>
<table bgcolor="#000000" width="100%" cellspacing="0" cellpadding="6" border="0">
<tr>
<td width="100%">
<span class="versionlist">Version 1.71 defaults mouse drag to be move on GTK+
and GTK+ also has some internationalisation fixes.</span>
</td>
</tr>
<tr>
<td width="100%">
<span class="versionlist">Version 1.70 allows, on GTK+, approximate character set conversions
for pasting and uses internationalised input at all times.</span>
</td>
</tr>
<tr>
<td width="100%">
<span class="versionlist">Version 1.69 supports the Spice language and can draw
the selection and whole line markers translucently.</span>
</td>
</tr>
<tr>
<td width="100%">
<span class="versionlist">Version 1.68 can draw the caret line
and box indicators translucently and has an accurate TCL lexer.</span>
</td>
</tr>
<tr>
<td width="100%">
<span class="versionlist">Version 1.67 enhances some lexers and fixes bugs.</span>
</td>
</tr>
<tr>
<td width="100%">
<span class="versionlist">Version 1.66 has a new Ruby lexer and fixes bugs on GTK+
with Pango 1.8.</span>
</td>
</tr>
</table>
<table bgcolor="#CCCCCC" width="100%" cellspacing="0" cellpadding="8" border="0">
<tr>
<td>
<font size="4">
<script type="text/javascript" language="JavaScript"><!--
if (IsRemote()) {
document.write('<a href="http://scintilla.sourceforge.net/SciTEImage.html">Screenshot</a>&nbsp;&nbsp;');
document.write('<a href="http://scintilla.sourceforge.net/ScintillaDownload.html">Download</a>&nbsp;&nbsp;');
}
//--></script>
<a href="http://scintilla.sourceforge.net/ScintillaDoc.html">Documentation</a>&nbsp;&nbsp;
<a href="http://scintilla.sourceforge.net/ScintillaToDo.html">Bugs</a>&nbsp;&nbsp;
<script type="text/javascript" language="JavaScript"><!--
if (IsRemote()) {
document.write('<a href="http://scintilla.sourceforge.net/SciTE.html">SciTE</a>&nbsp;&nbsp; ');
}
//--></script>
<a href="http://scintilla.sourceforge.net/ScintillaHistory.html">
History</a>&nbsp;&nbsp; <a href="http://scintilla.sourceforge.net/ScintillaRelated.html">Related</a>&nbsp;&nbsp;</font>
</td>
</tr>
</table>
<p>
<a href="http://scintilla.sourceforge.net/ScintillaDoc.html">Scintilla</a> is a free source code editing component.
It comes with complete source code and a <a href="http://scintilla.sourceforge.net/License.txt">license</a> that
permits use in any free project or commercial product.
</p>
<p>
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.
</p>
<p>
The <a href="http://scintilla.sourceforge.net/SinkWorld.html">SinkWorld project</a>
investigates possible future directions for Scintilla to make it more flexible, robust, perform
better and run on the .NET and Java virtual machines.
</p>
<p>
<a href="http://scintilla.sourceforge.net/SciTE.html">SciTE</a> 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.
</p>
<p>
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.
</p>
<p>
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. <a href="http://scintilla.sourceforge.net/SciTEImage.html">Here is a screenshot of
SciTE.</a><br />
</p>
<p>
You can <a href="http://scintilla.sourceforge.net/ScintillaDownload.html">download Scintilla.</a>
</p>
<p>
The source code can be downloaded via CVS at the Source Forge
<a href="https://sourceforge.net/project/?group_id=2439">Scintilla project page</a>.
</p>
<p>
<a href="http://scintilla.sourceforge.net/ScintillaRelated.html">Related sites.</a>
</p>
<p>
<a href="http://scintilla.sourceforge.net/ScintillaToDo.html">Bugs and To Do list.</a>
</p>
<p>
<a href="http://scintilla.sourceforge.net/ScintillaHistory.html">History and contribution credits.</a>
</p>
<p>
<a href="http://scintilla.sourceforge.net/Icons.html">Icons that can be used with Scintilla.</a>
</p>
<p>
Questions and comments about Scintilla should be directed to the
<a href="http://mailman.lyra.org/mailman/listinfo/scintilla-interest">scintilla-interest</a>
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
<a href="http://mailman.lyra.org/mailman/listinfo/scintilla-announce">scintilla-announce</a>.
Messages sent to my personal email address that could have been sent to the list
may receive no response.
<br />
</p>
<script type="text/javascript" language="JavaScript">
<!--
document.write('There is a <a href="https://sourceforge.net/project/?group_id=2439">Scintilla project page<\/a>');
document.write(' hosted on ');
if (IsRemote()) {
document.write('<a href="http://sourceforge.net">');
document.write('<img src="http://sourceforge.net/sflogo.php?group_id=2439&type=1" width="88" height="31" border="0" /><\/a> ');
} else {
document.write('<a href="http://sourceforge.net">SourceForge<\/a>');
}
//-->
</script>
</body>
</html>

78
MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/include/Accessor.h

@ -1,78 +0,0 @@
// Scintilla source code edit control
/** @file Accessor.h
** Rapid easy access to contents of a Scintilla.
**/
// Copyright 1998-2001 by Neil Hodgson <neilh@scintilla.org>
// 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;
};

107
MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/include/Face.py

@ -1,107 +0,0 @@
# 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)

76
MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/include/HFacer.py

@ -1,76 +0,0 @@
# 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

82
MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/include/KeyWords.h

@ -1,82 +0,0 @@
// Scintilla source code edit control
/** @file KeyWords.h
** Colourise for particular languages.
**/
// Copyright 1998-2001 by Neil Hodgson <neilh@scintilla.org>
// 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;
}

517
MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/include/Platform.h

@ -1,517 +0,0 @@
// 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 <neilh@scintilla.org>
// The License.txt file describes the conditions under which this software may be distributed.
#ifndef PLATFORM_H
#define PLATFORM_H
// 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_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(__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.
*/
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;
};
/**
* 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<short>(x >> 16);
}
static short LowShortFromLong(long x) {
return static_cast<short>(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

114
MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/include/PropSet.h

@ -1,114 +0,0 @@
// Scintilla source code edit control
/** @file PropSet.h
** A Java style properties file module.
**/
// Copyright 1998-2002 by Neil Hodgson <neilh@scintilla.org>
// 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 &copy);
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

280
MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/include/SString.h

@ -1,280 +0,0 @@
// SciTE - Scintilla based Text Editor
/** @file SString.h
** A simple string class.
**/
// Copyright 1998-2004 by Neil Hodgson <neilh@scintilla.org>
// 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<lenpos_t>(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

1074
MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/include/SciLexer.h

File diff suppressed because it is too large Load Diff

780
MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/include/Scintilla.h

@ -1,780 +0,0 @@
// Scintilla source code edit control
/** @file Scintilla.h
** Interface to the edit control.
**/
// Copyright 1998-2003 by Neil Hodgson <neilh@scintilla.org>
// 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 <BaseTsd.h>
#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

3012
MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/include/Scintilla.iface

File diff suppressed because it is too large Load Diff

59
MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/include/ScintillaWidget.h

@ -1,59 +0,0 @@
// 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 <neilh@scintilla.org>
// 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

57
MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/include/WindowAccessor.h

@ -1,57 +0,0 @@
// 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 <neilh@scintilla.org>
// 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);
};

174
MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/src/AutoComplete.cxx

@ -1,174 +0,0 @@
// Scintilla source code edit control
/** @file AutoComplete.cxx
** Defines the auto completion list box.
**/
// Copyright 1998-2003 by Neil Hodgson <neilh@scintilla.org>
// The License.txt file describes the conditions under which this software may be distributed.
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#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);
}

70
MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/src/AutoComplete.h

@ -1,70 +0,0 @@
// Scintilla source code edit control
/** @file AutoComplete.h
** Defines the auto completion list box.
**/
// Copyright 1998-2003 by Neil Hodgson <neilh@scintilla.org>
// 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

314
MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/src/CallTip.cxx

@ -1,314 +0,0 @@
// Scintilla source code edit control
/** @file CallTip.cxx
** Code for displaying call tips.
**/
// Copyright 1998-2001 by Neil Hodgson <neilh@scintilla.org>
// The License.txt file describes the conditions under which this software may be distributed.
#include <stdlib.h>
#include <string.h>
#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<len;i++) {
if ((maxEnd < numEnds) &&
(IsArrowCharacter(s[i]) || IsTabCharacter(s[i])) ) {
if (i > 0)
ends[maxEnd++] = i;
ends[maxEnd++] = i+1;
}
}
ends[maxEnd++] = len;
int startSeg = 0;
int xEnd;
for (int seg = 0; seg<maxEnd; seg++) {
int endSeg = ends[seg];
if (endSeg > 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;
}

79
MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/src/CallTip.h

@ -1,79 +0,0 @@
// Scintilla source code edit control
/** @file CallTip.h
** Interface to the call tip control.
**/
// Copyright 1998-2001 by Neil Hodgson <neilh@scintilla.org>
// 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

1120
MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/src/CellBuffer.cxx

File diff suppressed because it is too large Load Diff

250
MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/src/CellBuffer.h

@ -1,250 +0,0 @@
// Scintilla source code edit control
/** @file CellBuffer.h
** Manages the text of the document.
**/
// Copyright 1998-2004 by Neil Hodgson <neilh@scintilla.org>
// 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

43
MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/src/CharClassify.cxx

@ -1,43 +0,0 @@
// Scintilla source code edit control
/** @file CharClassify.cxx
** Character classifications used by Document and RESearch.
**/
// Copyright 2006 by Neil Hodgson <neilh@scintilla.org>
// The License.txt file describes the conditions under which this software may be distributed.
#include <ctype.h>
#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<unsigned char>(newCharClass);
chars++;
}
}
}

25
MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/src/CharClassify.h

@ -1,25 +0,0 @@
// Scintilla source code edit control
/** @file CharClassify.h
** Character classifications used by Document and RESearch.
**/
// Copyright 2006 by Neil Hodgson <neilh@scintilla.org>
// 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<cc>(charClass[ch]);}
bool IsWord(unsigned char ch) const { return static_cast<cc>(charClass[ch]) == ccWord;}
private:
enum { maxChar=256 };
unsigned char charClass[maxChar]; // not type cc to save space
};
#endif

289
MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/src/ContractionState.cxx

@ -1,289 +0,0 @@
// Scintilla source code edit control
/** @file ContractionState.cxx
** Manages visibility of lines for folding.
**/
// Copyright 1998-2001 by Neil Hodgson <neilh@scintilla.org>
// 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<linesInDoc; lineInDoc++) {
lines[lineInDoc].displayLine = linesInDisplay;
if (lines[lineInDoc].visible) {
linesInDisplay += lines[lineInDoc].height;
}
}
if (sizeDocLines < linesInDisplay) {
delete []docLines;
int *docLinesNew = new int[linesInDisplay + growSize];
if (!docLinesNew) {
docLines = 0;
sizeDocLines = 0;
return;
}
docLines = docLinesNew;
sizeDocLines = linesInDisplay + growSize;
}
int lineInDisplay=0;
for (int line=0; line<linesInDoc; line++) {
if (lines[line].visible) {
for (int linePiece=0; linePiece<lines[line].height; linePiece++) {
docLines[lineInDisplay] = line;
lineInDisplay++;
}
}
}
valid = true;
}
}
void ContractionState::Clear() {
delete []lines;
lines = 0;
size = 0;
linesInDoc = 1;
linesInDisplay = 1;
delete []docLines;
docLines = 0;
sizeDocLines = 0;
}
int ContractionState::LinesInDoc() const {
return linesInDoc;
}
int ContractionState::LinesDisplayed() const {
if (size != 0) {
MakeValid();
}
return linesInDisplay;
}
int ContractionState::DisplayFromDoc(int lineDoc) const {
if (size == 0) {
return lineDoc;
}
MakeValid();
if ((lineDoc >= 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<lineCount;d++) {
lines[lineDoc+d].visible = true; // Should inherit visibility from context ?
lines[lineDoc+d].height = 1;
lines[lineDoc+d].expanded = true;
}
valid = false;
}
void ContractionState::DeleteLines(int lineDoc, int lineCount) {
if (size == 0) {
linesInDoc -= lineCount;
linesInDisplay -= lineCount;
return;
}
int deltaDisplayed = 0;
for (int d=0;d<lineCount;d++) {
if (lines[lineDoc+d].visible)
deltaDisplayed -= lines[lineDoc+d].height;
}
for (int i = lineDoc; i < linesInDoc-lineCount; i++) {
if (i != 0) // Line zero is always visible
lines[i].visible = lines[i + lineCount].visible;
lines[i].expanded = lines[i + lineCount].expanded;
lines[i].height = lines[i + lineCount].height;
}
linesInDoc -= lineCount;
linesInDisplay += deltaDisplayed;
valid = false;
}
bool ContractionState::GetVisible(int lineDoc) const {
if (size == 0)
return true;
if ((lineDoc >= 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;
}

65
MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/src/ContractionState.h

@ -1,65 +0,0 @@
// Scintilla source code edit control
/** @file ContractionState.h
** Manages visibility of lines for folding.
**/
// Copyright 1998-2001 by Neil Hodgson <neilh@scintilla.org>
// 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

1577
MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/src/Document.cxx

File diff suppressed because it is too large Load Diff

305
MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/src/Document.h

@ -1,305 +0,0 @@
// 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 <neilh@scintilla.org>
// 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

187
MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/src/DocumentAccessor.cxx

@ -1,187 +0,0 @@
// Scintilla source code edit control
/** @file DocumentAccessor.cxx
** Rapid easy access to contents of a Scintilla.
**/
// Copyright 1998-2001 by Neil Hodgson <neilh@scintilla.org>
// The License.txt file describes the conditions under which this software may be distributed.
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <stdio.h>
#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<char>(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<char>(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<char>(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;
}

67
MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/src/DocumentAccessor.h

@ -1,67 +0,0 @@
// 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 <neilh@scintilla.org>
// 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);
};

7297
MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/src/Editor.cxx

File diff suppressed because it is too large Load Diff

582
MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/src/Editor.h

@ -1,582 +0,0 @@
// Scintilla source code edit control
/** @file Editor.h
** Defines the main editor class.
**/
// Copyright 1998-2003 by Neil Hodgson <neilh@scintilla.org>
// 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

259
MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/src/ExternalLexer.cxx

@ -1,259 +0,0 @@
// Scintilla source code edit control
/** @file ExternalLexer.cxx
** Support external lexers in DLLs.
**/
// Copyright 2001 Simon Steele <ss@pnotepad.org>, portions copyright Neil Hodgson.
// The License.txt file describes the conditions under which this software may be distributed.
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#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<DocumentAccessor &>(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<DocumentAccessor &>(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;

95
MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/src/ExternalLexer.h

@ -1,95 +0,0 @@
// Scintilla source code edit control
/** @file ExternalLexer.h
** Support external lexers in DLLs.
**/
// Copyright 2001 Simon Steele <ss@pnotepad.org>, 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
#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

77
MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/src/Indicator.cxx

@ -1,77 +0,0 @@
// 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 <neilh@scintilla.org>
// 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);
}
}

22
MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/src/Indicator.h

@ -1,22 +0,0 @@
// 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 <neilh@scintilla.org>
// 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

148
MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/src/KeyMap.cxx

@ -1,148 +0,0 @@
// Scintilla source code edit control
/** @file KeyMap.cxx
** Defines a mapping between keystrokes and commands.
**/
// Copyright 1998-2003 by Neil Hodgson <neilh@scintilla.org>
// 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},
};

43
MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/src/KeyMap.h

@ -1,43 +0,0 @@
// Scintilla source code edit control
/** @file KeyMap.h
** Defines a mapping between keystrokes and commands.
**/
// Copyright 1998-2001 by Neil Hodgson <neilh@scintilla.org>
// 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

221
MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/src/KeyWords.cxx

@ -1,221 +0,0 @@
// Scintilla source code edit control
/** @file KeyWords.cxx
** Colourise for particular languages.
**/
// Copyright 1998-2002 by Neil Hodgson <neilh@scintilla.org>
// The License.txt file describes the conditions under which this software may be distributed.
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <stdio.h>
#include <stdarg.h>
#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;
}

136
MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/src/LexAPDL.cxx

@ -1,136 +0,0 @@
// 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 <neilh@scintilla.org>
// The License.txt file describes the conditions under which this software may be distributed.
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <stdio.h>
#include <stdarg.h>
#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<char>(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<char>(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);

891
MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/src/LexAU3.cxx

@ -1,891 +0,0 @@
// 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 <xyz.au3> 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 <neilh@scintilla.org>
// The License.txt file describes the conditions under which this software may be distributed.
// Scintilla source code edit control
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <stdio.h>
#include <stdarg.h>
#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<char>(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<char>(sc.ch)) || IsAOperator(static_cast<char>(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<char>(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<char>(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<char>(tolower(ch));
}
}
}
// start the capture of the first word
if (!(FirstWordStart)) {
if (IsAWordChar(ch) || IsAWordStart(ch) || ch == ';') {
FirstWordStart = true;
szKeyword[szKeywordlen++] = static_cast<char>(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<char>(tolower(ch));
if (strcmp(szThen,"then") == 0 ) {
ThenFoundLast = true;
}
}
else {
szThen[szThenlen++] = static_cast<char>(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);

225
MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/src/LexAVE.cxx

@ -1,225 +0,0 @@
// SciTE - Scintilla based Text Editor
/** @file LexAVE.cxx
** Lexer for Avenue.
**
** Written by Alexey Yutkin <yutkin@geol.msu.ru>.
**/
// Copyright 1998-2002 by Neil Hodgson <neilh@scintilla.org>
// The License.txt file describes the conditions under which this software may be distributed.
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <stdarg.h>
#include <stdio.h>
#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<char>(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<char>(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<char>(tolower(chNext));
chNext = static_cast<char>(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<char>(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);

520
MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/src/LexAda.cxx

@ -1,520 +0,0 @@
// Scintilla source code edit control
/** @file LexAda.cxx
** Lexer for Ada 95
**/
// Copyright 2002 by Sergey Koshcheyev <sergey.k@seznam.cz>
// The License.txt file describes the conditions under which this software may be distributed.
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
#include <stdio.h>
#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<char>(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<char>(sc.ch);
sc.Forward();
}
// Special case: exponent with sign
if ((sc.chPrev == 'e' || sc.chPrev == 'E') &&
(sc.ch == '+' || sc.ch == '-')) {
number += static_cast<char>(sc.ch);
sc.Forward ();
while (!IsSeparatorOrDelimiterCharacter(sc.ch)) {
number += static_cast<char>(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<char>(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 == '_';
}

177
MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/src/LexAsm.cxx

@ -1,177 +0,0 @@
// 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 <neilh@scintilla.org>
// The License.txt file describes the conditions under which this software may be distributed.
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <stdio.h>
#include <stdarg.h>
#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 &registers = *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<char>(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<char>(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);

181
MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/src/LexAsn1.cxx

@ -1,181 +0,0 @@
// Scintilla source code edit control
/** @file LexAsn1.cxx
** Lexer for ASN.1
**/
// Copyright 2004 by Herr Pfarrer rpfarrer <at> yahoo <dot> de
// Last Updated: 20/07/2004
// The License.txt file describes the conditions under which this software may be distributed.
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <stdio.h>
#include <stdarg.h>
#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);

189
MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/src/LexBaan.cxx

@ -1,189 +0,0 @@
// Scintilla source code edit control
/** @file LexBaan.cxx
** Lexer for Baan.
** Based heavily on LexCPP.cxx
**/
// Copyright 2001- by Vamsi Potluru <vamsi@who.net> & Praveen Ambekar <ambekarpraveen@yahoo.com>
// The License.txt file describes the conditions under which this software may be distributed.
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <stdio.h>
#include <stdarg.h>
#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<char>(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);

663
MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/src/LexBash.cxx

@ -1,663 +0,0 @@
// Scintilla source code edit control
/** @file LexBash.cxx
** Lexer for Bash.
**/
// Copyright 2004-2005 by Neil Hodgson <neilh@scintilla.org>
// Adapted from LexPerl by Kein-Hong Man <mkh@pl.jaring.my> 2004
// The License.txt file describes the conditions under which this software may be distributed.
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <stdio.h>
#include <stdarg.h>
#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<int>(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);

369
MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/src/LexBasic.cxx

@ -1,369 +0,0 @@
// Scintilla source code edit control
/** @file LexBasic.cxx
** Lexer for BlitzBasic and PureBasic.
**/
// Copyright 1998-2003 by Neil Hodgson <neilh@scintilla.org>
// 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 <at> users <dot> sf <dot> 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 <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <ctype.h>
#include <stdarg.h>
#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<char>(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<char>(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);

225
MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/src/LexBullant.cxx

@ -1,225 +0,0 @@
// SciTE - Scintilla based Text Editor
// LexBullant.cxx - lexer for Bullant
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <stdio.h>
#include <stdarg.h>
#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<char>(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);

675
MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/src/LexCLW.cxx

@ -1,675 +0,0 @@
// Scintilla source code edit control
/** @file LexClw.cxx
** Lexer for Clarion.
** 2004/12/17 Updated Lexer
**/
// Copyright 2003-2004 by Ron Schofield <ron@schofieldcomputer.com>
// The License.txt file describes the conditions under which this software may be distributed.
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <stdarg.h>
#include <ctype.h>
#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<char>(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<char>(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);

489
MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/src/LexCPP.cxx

@ -1,489 +0,0 @@
// Scintilla source code edit control
/** @file LexCPP.cxx
** Lexer for C++, C, Java, and JavaScript.
**/
// Copyright 1998-2005 by Neil Hodgson <neilh@scintilla.org>
// The License.txt file describes the conditions under which this software may be distributed.
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <stdio.h>
#include <stdarg.h>
#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<unsigned char>(*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<char>(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);

303
MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/src/LexCSS.cxx

@ -1,303 +0,0 @@
// 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 <neilh@scintilla.org>
// The License.txt file describes the conditions under which this software may be distributed.
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <stdio.h>
#include <stdarg.h>
#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<char>(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);

399
MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/src/LexCaml.cxx

@ -1,399 +0,0 @@
// Scintilla source code edit control
/** @file LexCaml.cxx
** Lexer for Objective Caml.
**/
// Copyright 2005 by Robert Roessler <robertr@rftp.com>
// 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 <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <stdio.h>
#include <stdarg.h>
#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 <windows.h>
#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<HWND>(w), msg, wParam, lParam);
}
long Platform::SendScintillaPointer(WindowID w, unsigned int msg, unsigned long wParam, void *lParam) {
return ::SendMessage(reinterpret_cast<HWND>(w), msg, wParam,
reinterpret_cast<LPARAM>(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<char>(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 */

184
MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/src/LexConf.cxx

@ -1,184 +0,0 @@
// Scintilla source code edit control
/** @file LexConf.cxx
** Lexer for Apache Configuration Files.
**
** First working version contributed by Ahmad Zawawi <zeus_go64@hotmail.com> 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 <neilh@scintilla.org>
// The License.txt file describes the conditions under which this software may be distributed.
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <stdio.h>
#include <stdarg.h>
#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 &params = *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<char>(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<char>(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);

218
MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/src/LexCrontab.cxx

@ -1,218 +0,0 @@
// 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 <neilh@scintilla.org>
// The License.txt file describes the conditions under which this software may be distributed.
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <stdio.h>
#include <stdarg.h>
#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 &section = *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);

207
MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/src/LexCsound.cxx

@ -1,207 +0,0 @@
// Scintilla source code edit control
/** @file LexCsound.cxx
** Lexer for Csound (Orchestra & Score)
** Written by Georg Ritter - <ritterfuture A T gmail D O T com>
**/
// Copyright 1998-2003 by Neil Hodgson <neilh@scintilla.org>
// The License.txt file describes the conditions under which this software may be distributed.
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <stdio.h>
#include <stdarg.h>
#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<char>(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<char>(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);

270
MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/src/LexEScript.cxx

@ -1,270 +0,0 @@
// Scintilla source code edit control
/** @file LexESCRIPT.cxx
** Lexer for ESCRIPT
**/
// Copyright 2003 by Patrizio Bekerle (patrizio@bekerle.com)
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <stdio.h>
#include <stdarg.h>
#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<char>(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<char>(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);

234
MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/src/LexEiffel.cxx

@ -1,234 +0,0 @@
// Scintilla source code edit control
/** @file LexEiffel.cxx
** Lexer for Eiffel.
**/
// Copyright 1998-2001 by Neil Hodgson <neilh@scintilla.org>
// The License.txt file describes the conditions under which this software may be distributed.
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <stdarg.h>
#include <stdio.h>
#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);

522
MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/src/LexErlang.cxx

@ -1,522 +0,0 @@
// 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 <neilh@scintilla.org>
// The License.txt file describes the conditions under which this software may be distributed.
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <stdio.h>
#include <stdarg.h>
#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<char>(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);

226
MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/src/LexFlagship.cxx

@ -1,226 +0,0 @@
// 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 <neilh@scintilla.org>
// The License.txt file describes the conditions under which this software may be distributed.
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <stdio.h>
#include <stdarg.h>
#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<char>(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);

348
MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/src/LexForth.cxx

@ -1,348 +0,0 @@
// 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 <neilh@scintilla.org>
// The License.txt file describes the conditions under which this software may be distributed.
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <stdio.h>
#include <stdarg.h>
#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_pos<lengthDoc && (c=getChar(is_bl))==ch; cur_pos++){
if(is_eol(c) && !skip_eol){
pos2=pos1;
return 0;
}
}
pos1=cur_pos;
pos2=pos1;
if(cur_pos==lengthDoc) return 0;
for(len=0;cur_pos<lengthDoc && (c=getChar(is_bl))!=ch; cur_pos++){
if(is_eol(c) && !skip_eol) break;
pos2++;
buffer[len++]=c;
}
if(c==ch) pos2--;
buffer[len]='\0';
#ifdef FORTH_DEBUG
fprintf(f_debug,"parse: %c %s\n",ch,buffer);
#endif
return len;
}
bool _is_number(char *s,int base){
for(;*s;s++){
int digit=((int)*s)-(int)'0';
#ifdef FORTH_DEBUG
fprintf(f_debug,"digit: %c %d\n",*s,digit);
#endif
if(digit>9 && 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<lengthDoc) cur_pos++;
styler.ColourTo(cur_pos,SCE_FORTH_COMMENT);
}else if(strcmp("[",buffer)==0){
styler.ColourTo(pos1,SCE_FORTH_STRING);
parse(']',true);
if(cur_pos<lengthDoc) cur_pos++;
styler.ColourTo(cur_pos,SCE_FORTH_STRING);
}else if(strcmp("{",buffer)==0){
styler.ColourTo(pos1,SCE_FORTH_LOCALE);
parse('}',false);
if(cur_pos<lengthDoc) cur_pos++;
styler.ColourTo(cur_pos,SCE_FORTH_LOCALE);
}else if(strings.InList(buffer)) {
styler.ColourTo(pos1,SCE_FORTH_STRING);
parse('"',false);
if(cur_pos<lengthDoc) cur_pos++;
styler.ColourTo(cur_pos,SCE_FORTH_STRING);
}else if(control.InList(buffer)) {
styler.ColourTo(pos1,SCE_FORTH_CONTROL);
styler.ColourTo(pos2,SCE_FORTH_CONTROL);
}else if(keyword.InList(buffer)) {
styler.ColourTo(pos1,SCE_FORTH_KEYWORD);
styler.ColourTo(pos2,SCE_FORTH_KEYWORD);
}else if(defword.InList(buffer)) {
styler.ColourTo(pos1,SCE_FORTH_KEYWORD);
styler.ColourTo(pos2,SCE_FORTH_KEYWORD);
parse(BL,false);
styler.ColourTo(pos1-1,SCE_FORTH_DEFAULT);
styler.ColourTo(pos1,SCE_FORTH_DEFWORD);
styler.ColourTo(pos2,SCE_FORTH_DEFWORD);
}else if(preword1.InList(buffer)) {
styler.ColourTo(pos1,SCE_FORTH_PREWORD1);
parse(BL,false);
styler.ColourTo(pos2,SCE_FORTH_PREWORD1);
}else if(preword2.InList(buffer)) {
styler.ColourTo(pos1,SCE_FORTH_PREWORD2);
parse(BL,false);
styler.ColourTo(pos2,SCE_FORTH_PREWORD2);
parse(BL,false);
styler.ColourTo(pos1,SCE_FORTH_STRING);
styler.ColourTo(pos2,SCE_FORTH_STRING);
}else if(is_number(buffer)){
styler.ColourTo(pos1,SCE_FORTH_NUMBER);
styler.ColourTo(pos2,SCE_FORTH_NUMBER);
}
}
#ifdef FORTH_DEBUG
fclose(f_debug);
#endif
delete []buffer;
return;
/*
if(control.InList(buffer)) {
styler.ColourTo(i,SCE_FORTH_CONTROL);
} else if(keyword.InList(buffer)) {
styler.ColourTo(i-1,SCE_FORTH_KEYWORD );
} else if(defword.InList(buffer)) {
styler.ColourTo(i-1,SCE_FORTH_DEFWORD );
// prev_state=SCE_FORTH_DEFWORD
} else if(preword1.InList(buffer)) {
styler.ColourTo(i-1,SCE_FORTH_PREWORD1 );
// state=SCE_FORTH_PREWORD1;
} else if(preword2.InList(buffer)) {
styler.ColourTo(i-1,SCE_FORTH_PREWORD2 );
} else {
styler.ColourTo(i-1,SCE_FORTH_DEFAULT);
}
*/
/*
chPrev=' ';
for (int i = startPos; i < lengthDoc; i++) {
char ch = chNext;
chNext = styler.SafeGetCharAt(i + 1);
if(i!=startPos) chPrev=styler.SafeGetCharAt(i - 1);
if (styler.IsLeadByte(ch)) {
chNext = styler.SafeGetCharAt(i + 2);
i++;
continue;
}
#ifdef FORTH_DEBUG
fprintf(f_debug,"%c %d ",ch,state);
#endif
switch(state) {
case SCE_FORTH_DEFAULT:
if(is_whitespace(ch)) {
// whitespace is simply ignored here...
styler.ColourTo(i,SCE_FORTH_DEFAULT);
break;
} else if( ch == '\\' && is_blank(chNext)) {
// signals the start of an one line comment...
state = SCE_FORTH_COMMENT;
styler.ColourTo(i,SCE_FORTH_COMMENT);
} else if( is_whitespace(chPrev) && ch == '(' && is_whitespace(chNext)) {
// signals the start of a plain comment...
state = SCE_FORTH_COMMENT_ML;
styler.ColourTo(i,SCE_FORTH_COMMENT_ML);
} else if( isdigit(ch) ) {
// signals the start of a number
bufferCount = 0;
buffer[bufferCount++] = ch;
state = SCE_FORTH_NUMBER;
} else if( !is_whitespace(ch)) {
// signals the start of an identifier
bufferCount = 0;
buffer[bufferCount++] = ch;
state = SCE_FORTH_IDENTIFIER;
} else {
// style it the default style..
styler.ColourTo(i,SCE_FORTH_DEFAULT);
}
break;
case SCE_FORTH_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_FORTH_DEFAULT;
} else {
styler.ColourTo(i,SCE_FORTH_COMMENT);
}
break;
case SCE_FORTH_COMMENT_ML:
if( ch == ')') {
state = SCE_FORTH_DEFAULT;
} else {
styler.ColourTo(i+1,SCE_FORTH_COMMENT_ML);
}
break;
case SCE_FORTH_IDENTIFIER:
// stay in CONF_IDENTIFIER state until we find a non-alphanumeric
if( !is_whitespace(ch) ) {
buffer[bufferCount++] = ch;
} else {
state = SCE_FORTH_DEFAULT;
buffer[bufferCount] = '\0';
#ifdef FORTH_DEBUG
fprintf(f_debug,"\nid %s\n",buffer);
#endif
// check if the buffer contains a keyword,
// and highlight it if it is a keyword...
// switch(prev_state)
// case SCE_FORTH_DEFAULT:
if(control.InList(buffer)) {
styler.ColourTo(i,SCE_FORTH_CONTROL);
} else if(keyword.InList(buffer)) {
styler.ColourTo(i-1,SCE_FORTH_KEYWORD );
} else if(defword.InList(buffer)) {
styler.ColourTo(i-1,SCE_FORTH_DEFWORD );
// prev_state=SCE_FORTH_DEFWORD
} else if(preword1.InList(buffer)) {
styler.ColourTo(i-1,SCE_FORTH_PREWORD1 );
// state=SCE_FORTH_PREWORD1;
} else if(preword2.InList(buffer)) {
styler.ColourTo(i-1,SCE_FORTH_PREWORD2 );
} else {
styler.ColourTo(i-1,SCE_FORTH_DEFAULT);
}
// break;
// case
// push back the faulty character
chNext = styler[i--];
}
break;
case SCE_FORTH_NUMBER:
// stay in CONF_NUMBER state until we find a non-numeric
if( isdigit(ch) ) {
buffer[bufferCount++] = ch;
} else {
state = SCE_FORTH_DEFAULT;
buffer[bufferCount] = '\0';
// Colourize here... (normal number)
styler.ColourTo(i-1,SCE_FORTH_NUMBER);
// push back a character
chNext = styler[i--];
}
break;
}
}
#ifdef FORTH_DEBUG
fclose(f_debug);
#endif
delete []buffer;
*/
}
static void FoldForthDoc(unsigned int, int, int, WordList *[],
Accessor &) {
}
static const char * const forthWordLists[] = {
"control keywords",
"keywords",
"definition words",
"prewords with one argument",
"prewords with two arguments",
"string definition keywords",
0,
};
LexerModule lmForth(SCLEX_FORTH, ColouriseForthDoc, "forth",FoldForthDoc,forthWordLists);

452
MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/src/LexFortran.cxx

@ -1,452 +0,0 @@
// Scintilla source code edit control
/** @file LexFortran.cxx
** Lexer for Fortran.
** Writen by Chuan-jian Shen, Last changed Sep. 2003
**/
// Copyright 1998-2001 by Neil Hodgson <neilh@scintilla.org>
// The License.txt file describes the conditions under which this software may be distributed.
/***************************************/
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <stdio.h>
#include <stdarg.h>
/***************************************/
#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<char>(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<char>(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<endPos) {
j ++ ;
chNextNonBlank = styler.SafeGetCharAt(j);
}
int stylePrev = style;
style = styleNext;
styleNext = styler.StyleAt(i + 1);
bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n');
//
if (stylePrev == SCE_F_DEFAULT && (style == SCE_F_WORD || style == SCE_F_LABEL)) {
// Store last word and label start point.
lastStart = i;
}
/***************************************/
if (style == SCE_F_WORD) {
if(iswordchar(ch) && !iswordchar(chNext)) {
char s[32];
unsigned int k;
for(k=0; (k<31 ) && (k<i-lastStart+1 ); k++) {
s[k] = static_cast<char>(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<endPos) {
j++;
ch1 = styler.SafeGetCharAt(j);
}
char styBrace = styler.StyleAt(j);
int depth = 1;
char chAtPos;
char styAtPos;
while (j<endPos) {
j++;
chAtPos = styler.SafeGetCharAt(j);
styAtPos = styler.StyleAt(j);
if (styAtPos == styBrace) {
if (chAtPos == chBrace) depth++;
if (chAtPos == chSeek) depth--;
if (depth == 0) break;
}
}
while (j<endPos) {
j++;
chAtPos = styler.SafeGetCharAt(j);
styAtPos = styler.StyleAt(j);
if (styAtPos == SCE_F_COMMENT || IsABlank(chAtPos)) continue;
if (isFixFormat) {
if (!IsALineEnd(chAtPos)) {
break;
} else {
if (lineCurrent < styler.GetLine(styler.Length()-1)) {
j = styler.LineStart(lineCurrent+1);
if (styler.StyleAt(j+5) == SCE_F_CONTINUATION) {
j += 5;
continue;
} else {
levelCurrent++;
break;
}
}
}
} else {
if (chAtPos == '&' && styler.StyleAt(j) == SCE_F_CONTINUATION) {
j = GetContinuedPos(j+1, styler);
continue;
} else if (IsALineEnd(chAtPos)) {
levelCurrent ++;
break;
} else {
break;
}
}
}
}
} else {
levelCurrent += classifyFoldPointFortran(s, prevWord, chNextNonBlank);
// Store the do Labels into array
if (strcmp(s, "do") == 0 && IsADigit(chNextNonBlank)) {
unsigned int k = 0;
for (i=j; (i<j+5 && i<endPos); i++) {
ch = styler.SafeGetCharAt(i);
if (IsADigit(ch))
Label[k++] = ch;
else
break;
}
Label[k] = '\0';
posLabel ++;
doLabels[posLabel] = atoi(Label);
}
}
strcpy(prevWord, s);
}
} else if (style == SCE_F_LABEL) {
if(IsADigit(ch) && !IsADigit(chNext)) {
for(j = 0; ( j < 5 ) && ( j < i-lastStart+1 ); j++) {
ch = styler.SafeGetCharAt(lastStart + j);
if (IsADigit(ch) && styler.StyleAt(lastStart+j) == SCE_F_LABEL)
Label[j] = ch;
else
break;
}
Label[j] = '\0';
while (doLabels[posLabel] == atoi(Label) && posLabel > -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);

241
MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/src/LexGen.py

@ -1,241 +0,0 @@
# 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()

309
MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/src/LexGui4Cli.cxx

@ -1,309 +0,0 @@
// Scintilla source code edit control
// Copyright 1998-2002 by Neil Hodgson <neilh@scintilla.org>
/*
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 <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <stdio.h>
#include <stdarg.h>
#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<char>(sc->ch);
++c; sc->Forward();
}
buff[c] = '\0';
char *p = buff;
while (*p) // capitalize..
{ if (islower(*p)) *p = static_cast<char>(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

2042
MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/src/LexHTML.cxx

File diff suppressed because it is too large Load Diff

263
MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/src/LexHaskell.cxx

@ -1,263 +0,0 @@
/******************************************************************
* LexHaskell.cxx
*
* A haskell lexer for the scintilla code control.
* Some stuff "lended" from LexPython.cxx and LexCPP.cxx.
* External lexer stuff inspired from the caml external lexer.
*
* Written by Tobias Engvall - tumm at dtek dot chalmers dot se
*
*
* TODO:
* * Implement a folder :)
* * Nice Character-lexing (stuff inside '\''), LexPython has
* this.
*
*
*****************************************************************/
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <stdio.h>
#include <stdarg.h>
#include "Platform.h"
#include "PropSet.h"
#include "Accessor.h"
#include "StyleContext.h"
#include "KeyWords.h"
#include "Scintilla.h"
#include "SciLexer.h"
#ifdef BUILD_AS_EXTERNAL_LEXER
#include "ExternalLexer.h"
#include "WindowAccessor.h"
#define BUILD_EXTERNAL_LEXER 0
#endif
// Max level of nested comments
#define SCE_HA_COMMENTMAX SCE_HA_COMMENTBLOCK3
enum kwType { kwOther, kwClass, kwData, kwInstance, kwImport, kwModule, kwType};
static inline bool IsNewline(const int ch) {
return (ch == '\n' || ch == '\r');
}
static inline bool IsWhitespace(const int ch) {
return ( ch == ' '
|| ch == '\t'
|| IsNewline(ch) );
}
static inline bool IsAWordStart(const int ch) {
return (ch < 0x80) && (isalnum(ch) || ch == '_');
}
static inline bool IsAWordChar(const int ch) {
return (ch < 0x80) && (isalnum(ch) || ch == '.' || ch == '_' || ch == '\'');
}
static void ColorizeHaskellDoc(unsigned int startPos, int length, int initStyle,
WordList *keywordlists[], Accessor &styler) {
WordList &keywords = *keywordlists[0];
int kwLast = kwOther;
StyleContext sc(startPos, length, initStyle, styler);
for (; sc.More(); sc.Forward()) {
// Check for state end
// Operator
if (sc.state == SCE_HA_OPERATOR) {
kwLast = kwOther;
sc.SetState(SCE_HA_DEFAULT);
}
// String
else if (sc.state == SCE_HA_STRING) {
if (sc.ch == '\"') {
sc.ForwardSetState(SCE_HA_DEFAULT);
}
}
// Char
else if (sc.state == SCE_HA_CHARACTER) {
if (sc.ch == '\'') {
sc.ForwardSetState(SCE_HA_DEFAULT);
}
}
// Number
else if (sc.state == SCE_HA_NUMBER) {
if (!IsADigit(sc.ch)) {
sc.SetState(SCE_HA_DEFAULT);
}
}
// Types, constructors, etc.
else if (sc.state == SCE_HA_CAPITAL) {
if (!IsAWordChar(sc.ch) || sc.ch == '.') {
sc.SetState(SCE_HA_DEFAULT);
}
}
// Identifier
else if (sc.state == SCE_HA_IDENTIFIER) {
if (!IsAWordChar(sc.ch)) {
char s[100];
sc.GetCurrent(s, sizeof(s));
int style = SCE_HA_IDENTIFIER;
if ((kwLast == kwImport) || (strcmp(s,"qualified") == 0) || (strcmp(s,"as") == 0)) {
style = SCE_HA_IMPORT;
} else if (keywords.InList(s)) {
style = SCE_HA_KEYWORD;
} else if (kwLast == kwData) {
style = SCE_HA_DATA;
} else if (kwLast == kwClass) {
style = SCE_HA_CLASS;
} else if (kwLast == kwModule) {
style = SCE_HA_MODULE;
} else if (isupper(s[0])) {
style = SCE_HA_CAPITAL;
}
sc.ChangeState(style);
sc.SetState(SCE_HA_DEFAULT);
if (style == SCE_HA_KEYWORD) {
if (0 == strcmp(s, "class"))
kwLast = kwClass;
else if (0 == strcmp(s, "data"))
kwLast = kwData;
else if (0 == strcmp(s, "instance"))
kwLast = kwInstance;
else if (0 == strcmp(s, "import"))
kwLast = kwImport;
else if (0 == strcmp(s, "module"))
kwLast = kwModule;
else
kwLast = kwOther;
} else if (style == SCE_HA_CLASS || style == SCE_HA_IMPORT ||
style == SCE_HA_MODULE || style == SCE_HA_CAPITAL ||
style == SCE_HA_DATA || style == SCE_HA_INSTANCE) {
kwLast = kwOther;
}
}
}
// Comments
// Oneliner
else if (sc.state == SCE_HA_COMMENTLINE) {
if (IsNewline(sc.ch))
sc.SetState(SCE_HA_DEFAULT);
}
// Nested
else if (sc.state >= SCE_HA_COMMENTBLOCK) {
if (sc.Match("{-")) {
if (sc.state < SCE_HA_COMMENTMAX)
sc.SetState(sc.state + 1);
}
else if (sc.Match("-}")) {
sc.Forward();
if (sc.state == SCE_HA_COMMENTBLOCK)
sc.ForwardSetState(SCE_HA_DEFAULT);
else
sc.ForwardSetState(sc.state - 1);
}
}
// New state?
if (sc.state == SCE_HA_DEFAULT) {
// Digit
if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext))) {
sc.SetState(SCE_HA_NUMBER);
}
// Comment line
else if (sc.Match("--")) {
sc.SetState(SCE_HA_COMMENTLINE);
// Comment block
}
else if (sc.Match("{-")) {
sc.SetState(SCE_HA_COMMENTBLOCK);
}
// String
else if (sc.Match('\"')) {
sc.SetState(SCE_HA_STRING);
}
// Character
else if (sc.Match('\'') && IsWhitespace(sc.GetRelative(-1)) ) {
sc.SetState(SCE_HA_CHARACTER);
}
// Stringstart
else if (sc.Match('\"')) {
sc.SetState(SCE_HA_STRING);
}
// Operator
else if (isascii(sc.ch) && isoperator(static_cast<char>(sc.ch))) {
sc.SetState(SCE_HA_OPERATOR);
}
// Keyword
else if (IsAWordStart(sc.ch)) {
sc.SetState(SCE_HA_IDENTIFIER);
}
}
}
sc.Complete();
}
// External stuff - used for dynamic-loading, not implemented in wxStyledTextCtrl yet.
// Inspired by the caml external lexer - Credits to Robert Roessler - http://www.rftp.com
#ifdef BUILD_EXTERNAL_LEXER
static const char* LexerName = "haskell";
void EXT_LEXER_DECL Lex(unsigned int lexer, unsigned int startPos, int length, int initStyle,
char *words[], WindowID window, char *props)
{
PropSet ps;
ps.SetMultiple(props);
WindowAccessor wa(window, ps);
int nWL = 0;
for (; words[nWL]; nWL++) ;
WordList** wl = new WordList* [nWL + 1];
int i = 0;
for (; i<nWL; i++)
{
wl[i] = new WordList();
wl[i]->Set(words[i]);
}
wl[i] = 0;
ColorizeHaskellDoc(startPos, length, initStyle, wl, wa);
wa.Flush();
for (i=nWL-1;i>=0;i--)
delete wl[i];
delete [] wl;
}
void EXT_LEXER_DECL Fold (unsigned int lexer, unsigned int startPos, int length, int initStyle,
char *words[], WindowID window, char *props)
{
}
int EXT_LEXER_DECL GetLexerCount()
{
return 1;
}
void EXT_LEXER_DECL GetLexerName(unsigned int Index, char *name, int buflength)
{
if (buflength > 0) {
buflength--;
int n = strlen(LexerName);
if (n > buflength)
n = buflength;
memcpy(name, LexerName, n), name[n] = '\0';
}
}
#endif
LexerModule lmHaskell(SCLEX_HASKELL, ColorizeHaskellDoc, "haskell");

290
MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/src/LexInno.cxx

@ -1,290 +0,0 @@
// Scintilla source code edit control
/** @file LexInno.cxx
** Lexer for Inno Setup scripts.
**/
// Written by Friedrich Vedder <fvedd@t-online.de>, using code from LexOthers.cxx.
// The License.txt file describes the conditions under which this software may be distributed.
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <stdio.h>
#include <stdarg.h>
#include "Platform.h"
#include "PropSet.h"
#include "Accessor.h"
#include "StyleContext.h"
#include "KeyWords.h"
#include "Scintilla.h"
#include "SciLexer.h"
static void ColouriseInnoDoc(unsigned int startPos, int length, int, WordList *keywordLists[], Accessor &styler) {
int state = SCE_INNO_DEFAULT;
char chPrev;
char ch = 0;
char chNext = styler[startPos];
int lengthDoc = startPos + length;
char *buffer = new char[length];
int bufferCount = 0;
bool isBOL, isEOL, isWS, isBOLWS = 0;
WordList &sectionKeywords = *keywordLists[0];
WordList &standardKeywords = *keywordLists[1];
WordList &parameterKeywords = *keywordLists[2];
WordList &preprocessorKeywords = *keywordLists[3];
WordList &pascalKeywords = *keywordLists[4];
WordList &userKeywords = *keywordLists[5];
// 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++) {
chPrev = ch;
ch = chNext;
chNext = styler.SafeGetCharAt(i + 1);
if (styler.IsLeadByte(ch)) {
chNext = styler.SafeGetCharAt(i + 2);
i++;
continue;
}
isBOL = (chPrev == 0) || (chPrev == '\n') || (chPrev == '\r' && ch != '\n');
isBOLWS = (isBOL) ? 1 : (isBOLWS && (chPrev == ' ' || chPrev == '\t'));
isEOL = (ch == '\n' || ch == '\r');
isWS = (ch == ' ' || ch == '\t');
switch(state) {
case SCE_INNO_DEFAULT:
if (ch == ';' && isBOLWS) {
// Start of a comment
state = SCE_INNO_COMMENT;
} else if (ch == '[' && isBOLWS) {
// Start of a section name
bufferCount = 0;
state = SCE_INNO_SECTION;
} else if (ch == '#' && isBOLWS) {
// Start of a preprocessor directive
state = SCE_INNO_PREPROC;
} else if (ch == '{' && chNext == '#') {
// Start of a preprocessor inline directive
state = SCE_INNO_PREPROC_INLINE;
} else if ((ch == '{' && (chNext == ' ' || chNext == '\t'))
|| (ch == '(' && chNext == '*')) {
// Start of a Pascal comment
state = SCE_INNO_COMMENT_PASCAL;
} else if (ch == '"') {
// Start of a double-quote string
state = SCE_INNO_STRING_DOUBLE;
} else if (ch == '\'') {
// Start of a single-quote string
state = SCE_INNO_STRING_SINGLE;
} else if (isascii(ch) && (isalpha(ch) || (ch == '_'))) {
// Start of an identifier
bufferCount = 0;
buffer[bufferCount++] = static_cast<char>(tolower(ch));
state = SCE_INNO_IDENTIFIER;
} else {
// Style it the default style
styler.ColourTo(i,SCE_INNO_DEFAULT);
}
break;
case SCE_INNO_COMMENT:
if (isEOL) {
state = SCE_INNO_DEFAULT;
styler.ColourTo(i,SCE_INNO_COMMENT);
}
break;
case SCE_INNO_IDENTIFIER:
if (isascii(ch) && (isalnum(ch) || (ch == '_'))) {
buffer[bufferCount++] = static_cast<char>(tolower(ch));
} else {
state = SCE_INNO_DEFAULT;
buffer[bufferCount] = '\0';
// Check if the buffer contains a keyword
if (standardKeywords.InList(buffer)) {
styler.ColourTo(i-1,SCE_INNO_KEYWORD);
} else if (parameterKeywords.InList(buffer)) {
styler.ColourTo(i-1,SCE_INNO_PARAMETER);
} else if (pascalKeywords.InList(buffer)) {
styler.ColourTo(i-1,SCE_INNO_KEYWORD_PASCAL);
} else if (userKeywords.InList(buffer)) {
styler.ColourTo(i-1,SCE_INNO_KEYWORD_USER);
} else {
styler.ColourTo(i-1,SCE_INNO_DEFAULT);
}
// Push back the faulty character
chNext = styler[i--];
ch = chPrev;
}
break;
case SCE_INNO_SECTION:
if (ch == ']') {
state = SCE_INNO_DEFAULT;
buffer[bufferCount] = '\0';
// Check if the buffer contains a section name
if (sectionKeywords.InList(buffer)) {
styler.ColourTo(i,SCE_INNO_SECTION);
} else {
styler.ColourTo(i,SCE_INNO_DEFAULT);
}
} else if (isascii(ch) && (isalnum(ch) || (ch == '_'))) {
buffer[bufferCount++] = static_cast<char>(tolower(ch));
} else {
state = SCE_INNO_DEFAULT;
styler.ColourTo(i,SCE_INNO_DEFAULT);
}
break;
case SCE_INNO_PREPROC:
if (isWS || isEOL) {
if (isascii(chPrev) && isalpha(chPrev)) {
state = SCE_INNO_DEFAULT;
buffer[bufferCount] = '\0';
// Check if the buffer contains a preprocessor directive
if (preprocessorKeywords.InList(buffer)) {
styler.ColourTo(i-1,SCE_INNO_PREPROC);
} else {
styler.ColourTo(i-1,SCE_INNO_DEFAULT);
}
// Push back the faulty character
chNext = styler[i--];
ch = chPrev;
}
} else if (isascii(ch) && isalpha(ch)) {
if (chPrev == '#' || chPrev == ' ' || chPrev == '\t')
bufferCount = 0;
buffer[bufferCount++] = static_cast<char>(tolower(ch));
}
break;
case SCE_INNO_STRING_DOUBLE:
if (ch == '"' || isEOL) {
state = SCE_INNO_DEFAULT;
styler.ColourTo(i,SCE_INNO_DEFAULT);
}
break;
case SCE_INNO_STRING_SINGLE:
if (ch == '\'' || isEOL) {
state = SCE_INNO_DEFAULT;
styler.ColourTo(i,SCE_INNO_DEFAULT);
}
break;
case SCE_INNO_PREPROC_INLINE:
if (ch == '}') {
state = SCE_INNO_DEFAULT;
styler.ColourTo(i,SCE_INNO_PREPROC_INLINE);
} else if (isEOL) {
state = SCE_INNO_DEFAULT;
styler.ColourTo(i,SCE_INNO_DEFAULT);
}
break;
case SCE_INNO_COMMENT_PASCAL:
if (ch == '}' || (ch == ')' && chPrev == '*')) {
state = SCE_INNO_DEFAULT;
styler.ColourTo(i,SCE_INNO_COMMENT_PASCAL);
} else if (isEOL) {
state = SCE_INNO_DEFAULT;
styler.ColourTo(i,SCE_INNO_DEFAULT);
}
break;
}
}
delete []buffer;
}
static const char * const innoWordListDesc[] = {
"Sections",
"Keywords",
"Parameters",
"Preprocessor directives",
"Pascal keywords",
"User defined keywords",
0
};
static void FoldInnoDoc(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;
int lev;
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_INNO_SECTION)
headerPoint = true;
if (atEOL) {
lev = SC_FOLDLEVELBASE;
if (lineCurrent > 0) {
int levelPrevious = styler.LevelAt(lineCurrent - 1);
if (levelPrevious & SC_FOLDLEVELHEADERFLAG)
lev = SC_FOLDLEVELBASE + 1;
else
lev = levelPrevious & SC_FOLDLEVELNUMBERMASK;
}
if (headerPoint)
lev = SC_FOLDLEVELBASE;
if (visibleChars == 0 && foldCompact)
lev |= SC_FOLDLEVELWHITEFLAG;
if (headerPoint)
lev |= SC_FOLDLEVELHEADERFLAG;
if (lev != styler.LevelAt(lineCurrent))
styler.SetLevel(lineCurrent, lev);
lineCurrent++;
visibleChars = 0;
headerPoint = false;
}
if (!isspacechar(ch))
visibleChars++;
}
if (lineCurrent > 0) {
int levelPrevious = styler.LevelAt(lineCurrent - 1);
if (levelPrevious & SC_FOLDLEVELHEADERFLAG)
lev = SC_FOLDLEVELBASE + 1;
else
lev = levelPrevious & SC_FOLDLEVELNUMBERMASK;
} else {
lev = SC_FOLDLEVELBASE;
}
int flagsNext = styler.LevelAt(lineCurrent);
styler.SetLevel(lineCurrent, lev | flagsNext & ~SC_FOLDLEVELNUMBERMASK);
}
LexerModule lmInno(SCLEX_INNOSETUP, ColouriseInnoDoc, "inno", FoldInnoDoc, innoWordListDesc);

122
MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/src/LexKix.cxx

@ -1,122 +0,0 @@
// Scintilla source code edit control
/** @file LexKix.cxx
** Lexer for KIX-Scripts.
**/
// Copyright 2004 by Manfred Becker <manfred@becker-trdf.de>
// The License.txt file describes the conditions under which this software may be distributed.
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <stdio.h>
#include <stdarg.h>
#include "Platform.h"
#include "PropSet.h"
#include "Accessor.h"
#include "StyleContext.h"
#include "KeyWords.h"
#include "Scintilla.h"
#include "SciLexer.h"
// Extended to accept accented characters
static inline bool IsAWordChar(int ch) {
return ch >= 0x80 || isalnum(ch) || ch == '_';
}
static inline bool IsOperator(const int ch) {
return (ch == '+' || ch == '-' || ch == '*' || ch == '/' || ch == '&' || ch == '|' || ch == '<' || ch == '>' || ch == '=');
}
static void ColouriseKixDoc(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];
styler.StartAt(startPos);
StyleContext sc(startPos, length, initStyle, styler);
for (; sc.More(); sc.Forward()) {
if (sc.state == SCE_KIX_COMMENT) {
if (sc.atLineEnd) {
sc.SetState(SCE_KIX_DEFAULT);
}
} else if (sc.state == SCE_KIX_STRING1) {
// This is a doubles quotes string
if (sc.ch == '\"') {
sc.ForwardSetState(SCE_KIX_DEFAULT);
}
} else if (sc.state == SCE_KIX_STRING2) {
// This is a single quote string
if (sc.ch == '\'') {
sc.ForwardSetState(SCE_KIX_DEFAULT);
}
} else if (sc.state == SCE_KIX_NUMBER) {
if (!IsADigit(sc.ch)) {
sc.SetState(SCE_KIX_DEFAULT);
}
} else if (sc.state == SCE_KIX_VAR) {
if (!IsAWordChar(sc.ch)) {
sc.SetState(SCE_KIX_DEFAULT);
}
} else if (sc.state == SCE_KIX_MACRO) {
if (!IsAWordChar(sc.ch) && !IsADigit(sc.ch)) {
char s[100];
sc.GetCurrentLowered(s, sizeof(s));
if (!keywords3.InList(&s[1])) {
sc.ChangeState(SCE_KIX_DEFAULT);
}
sc.SetState(SCE_KIX_DEFAULT);
}
} else if (sc.state == SCE_KIX_OPERATOR) {
if (!IsOperator(sc.ch)) {
sc.SetState(SCE_KIX_DEFAULT);
}
} else if (sc.state == SCE_KIX_IDENTIFIER) {
if (!IsAWordChar(sc.ch)) {
char s[100];
sc.GetCurrentLowered(s, sizeof(s));
if (keywords.InList(s)) {
sc.ChangeState(SCE_KIX_KEYWORD);
} else if (keywords2.InList(s)) {
sc.ChangeState(SCE_KIX_FUNCTIONS);
}
sc.SetState(SCE_KIX_DEFAULT);
}
}
// Determine if a new state should be entered.
if (sc.state == SCE_KIX_DEFAULT) {
if (sc.ch == ';') {
sc.SetState(SCE_KIX_COMMENT);
} else if (sc.ch == '\"') {
sc.SetState(SCE_KIX_STRING1);
} else if (sc.ch == '\'') {
sc.SetState(SCE_KIX_STRING2);
} else if (sc.ch == '$') {
sc.SetState(SCE_KIX_VAR);
} else if (sc.ch == '@') {
sc.SetState(SCE_KIX_MACRO);
} else if (IsADigit(sc.ch) || ((sc.ch == '.' || sc.ch == '&') && IsADigit(sc.chNext))) {
sc.SetState(SCE_KIX_NUMBER);
} else if (IsOperator(sc.ch)) {
sc.SetState(SCE_KIX_OPERATOR);
} else if (IsAWordChar(sc.ch)) {
sc.SetState(SCE_KIX_IDENTIFIER);
}
}
}
sc.Complete();
}
LexerModule lmKix(SCLEX_KIX, ColouriseKixDoc, "kix");

275
MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/src/LexLisp.cxx

@ -1,275 +0,0 @@
// Scintilla source code edit control
/** @file LexLisp.cxx
** Lexer for Lisp.
** Written by Alexey Yutkin.
**/
// Copyright 1998-2001 by Neil Hodgson <neilh@scintilla.org>
// The License.txt file describes the conditions under which this software may be distributed.
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <stdio.h>
#include <stdarg.h>
#include "Platform.h"
#include "PropSet.h"
#include "Accessor.h"
#include "KeyWords.h"
#include "Scintilla.h"
#include "SciLexer.h"
#include "StyleContext.h"
#define SCE_LISP_CHARACTER 29
#define SCE_LISP_MACRO 30
#define SCE_LISP_MACRO_DISPATCH 31
static inline bool isLispoperator(char ch) {
if (isascii(ch) && isalnum(ch))
return false;
if (ch == '\'' || ch == '`' || ch == '(' || ch == ')' )
return true;
return false;
}
static inline bool isLispwordstart(char ch) {
return isascii(ch) && ch != ';' && !isspacechar(ch) && !isLispoperator(ch) &&
ch != '\n' && ch != '\r' && ch != '\"';
}
static void classifyWordLisp(unsigned int start, unsigned int end, WordList &keywords, WordList &keywords_kw, Accessor &styler) {
PLATFORM_ASSERT(end >= start);
char s[100];
unsigned int i;
bool digit_flag = true;
for (i = 0; (i < end - start + 1) && (i < 99); i++) {
s[i] = styler[start + i];
s[i + 1] = '\0';
if (!isdigit(s[i]) && (s[i] != '.')) digit_flag = false;
}
char chAttr = SCE_LISP_IDENTIFIER;
if(digit_flag) chAttr = SCE_LISP_NUMBER;
else {
if (keywords.InList(s)) {
chAttr = SCE_LISP_KEYWORD;
} else if (keywords_kw.InList(s)) {
chAttr = SCE_LISP_KEYWORD_KW;
} else if ((s[0] == '*' && s[i-1] == '*') ||
(s[0] == '+' && s[i-1] == '+')) {
chAttr = SCE_LISP_SPECIAL;
}
}
styler.ColourTo(end, chAttr);
return;
}
static void ColouriseLispDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[],
Accessor &styler) {
WordList &keywords = *keywordlists[0];
WordList &keywords_kw = *keywordlists[1];
styler.StartAt(startPos);
int state = initStyle, radix = -1;
char chNext = styler[startPos];
unsigned int lengthDoc = startPos + length;
styler.StartSegment(startPos);
for (unsigned int i = startPos; i < lengthDoc; i++) {
char ch = chNext;
chNext = styler.SafeGetCharAt(i + 1);
bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n');
if (styler.IsLeadByte(ch)) {
chNext = styler.SafeGetCharAt(i + 2);
i += 1;
continue;
}
if (state == SCE_LISP_DEFAULT) {
if (ch == '#') {
styler.ColourTo(i - 1, state);
radix = -1;
state = SCE_LISP_MACRO_DISPATCH;
} else if (isLispwordstart(ch)) {
styler.ColourTo(i - 1, state);
state = SCE_LISP_IDENTIFIER;
}
else if (ch == ';') {
styler.ColourTo(i - 1, state);
state = SCE_LISP_COMMENT;
}
else if (isLispoperator(ch) || ch=='\'') {
styler.ColourTo(i - 1, state);
styler.ColourTo(i, SCE_LISP_OPERATOR);
if (ch=='\'' && isLispwordstart(chNext)) {
state = SCE_LISP_SYMBOL;
}
}
else if (ch == '\"') {
styler.ColourTo(i - 1, state);
state = SCE_LISP_STRING;
}
} else if (state == SCE_LISP_IDENTIFIER || state == SCE_LISP_SYMBOL) {
if (!isLispwordstart(ch)) {
if (state == SCE_LISP_IDENTIFIER) {
classifyWordLisp(styler.GetStartSegment(), i - 1, keywords, keywords_kw, styler);
} else {
styler.ColourTo(i - 1, state);
}
state = SCE_LISP_DEFAULT;
} /*else*/
if (isLispoperator(ch) || ch=='\'') {
styler.ColourTo(i - 1, state);
styler.ColourTo(i, SCE_LISP_OPERATOR);
if (ch=='\'' && isLispwordstart(chNext)) {
state = SCE_LISP_SYMBOL;
}
}
} else if (state == SCE_LISP_MACRO_DISPATCH) {
if (!isdigit(ch)) {
if (ch != 'r' && ch != 'R' && (i - styler.GetStartSegment()) > 1) {
state = SCE_LISP_DEFAULT;
} else {
switch (ch) {
case '|': state = SCE_LISP_MULTI_COMMENT; break;
case 'o':
case 'O': radix = 8; state = SCE_LISP_MACRO; break;
case 'x':
case 'X': radix = 16; state = SCE_LISP_MACRO; break;
case 'b':
case 'B': radix = 2; state = SCE_LISP_MACRO; break;
case '\\': state = SCE_LISP_CHARACTER; break;
case ':':
case '-':
case '+': state = SCE_LISP_MACRO; break;
case '\'': if (isLispwordstart(chNext)) {
state = SCE_LISP_SPECIAL;
} else {
styler.ColourTo(i - 1, SCE_LISP_DEFAULT);
styler.ColourTo(i, SCE_LISP_OPERATOR);
state = SCE_LISP_DEFAULT;
}
break;
default: if (isLispoperator(ch)) {
styler.ColourTo(i - 1, SCE_LISP_DEFAULT);
styler.ColourTo(i, SCE_LISP_OPERATOR);
}
state = SCE_LISP_DEFAULT;
break;
}
}
}
} else if (state == SCE_LISP_MACRO) {
if (isLispwordstart(ch) && (radix == -1 || IsADigit(ch, radix))) {
state = SCE_LISP_SPECIAL;
} else {
state = SCE_LISP_DEFAULT;
}
} else if (state == SCE_LISP_CHARACTER) {
if (isLispoperator(ch)) {
styler.ColourTo(i, SCE_LISP_SPECIAL);
state = SCE_LISP_DEFAULT;
} else if (isLispwordstart(ch)) {
styler.ColourTo(i, SCE_LISP_SPECIAL);
state = SCE_LISP_SPECIAL;
} else {
state = SCE_LISP_DEFAULT;
}
} else if (state == SCE_LISP_SPECIAL) {
if (!isLispwordstart(ch) || (radix != -1 && !IsADigit(ch, radix))) {
styler.ColourTo(i - 1, state);
state = SCE_LISP_DEFAULT;
}
if (isLispoperator(ch) || ch=='\'') {
styler.ColourTo(i - 1, state);
styler.ColourTo(i, SCE_LISP_OPERATOR);
if (ch=='\'' && isLispwordstart(chNext)) {
state = SCE_LISP_SYMBOL;
}
}
} else {
if (state == SCE_LISP_COMMENT) {
if (atEOL) {
styler.ColourTo(i - 1, state);
state = SCE_LISP_DEFAULT;
}
} else if (state == SCE_LISP_MULTI_COMMENT) {
if (ch == '|' && chNext == '#') {
i++;
chNext = styler.SafeGetCharAt(i + 1);
styler.ColourTo(i, state);
state = SCE_LISP_DEFAULT;
}
} else if (state == SCE_LISP_STRING) {
if (ch == '\\') {
if (chNext == '\"' || chNext == '\'' || chNext == '\\') {
i++;
chNext = styler.SafeGetCharAt(i + 1);
}
} else if (ch == '\"') {
styler.ColourTo(i, state);
state = SCE_LISP_DEFAULT;
}
}
}
}
styler.ColourTo(lengthDoc - 1, state);
}
static void FoldLispDoc(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 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 (style == SCE_LISP_OPERATOR) {
if (ch == '(') {
levelCurrent++;
} else if (ch == ')') {
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++;
}
// 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 lispWordListDesc[] = {
"Functions and special operators",
"Keywords",
0
};
LexerModule lmLISP(SCLEX_LISP, ColouriseLispDoc, "lisp", FoldLispDoc, lispWordListDesc);

208
MOULOpenSourceClientPlugin/StaticSDKs/Win32/Scintilla/src/LexLout.cxx

@ -1,208 +0,0 @@
// Scintilla source code edit control
/** @file LexLout.cxx
** Lexer for the Basser Lout (>= version 3) typesetting language
**/
// Copyright 2003 by Kein-Hong Man <mkh@pl.jaring.my>
// The License.txt file describes the conditions under which this software may be distributed.
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <stdio.h>
#include <stdarg.h>
#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) && (isalpha(ch) || ch == '@' || ch == '_');
}
static inline bool IsAnOther(const int ch) {
return (ch < 0x80) && (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 == '`' || ch == '|' || ch == '~');
}
static void ColouriseLoutDoc(unsigned int startPos, int length, int initStyle,
WordList *keywordlists[], Accessor &styler) {
WordList &keywords = *keywordlists[0];
WordList &keywords2 = *keywordlists[1];
WordList &keywords3 = *keywordlists[2];
int visibleChars = 0;
int firstWordInLine = 0;
int leadingAtSign = 0;
StyleContext sc(startPos, length, initStyle, styler);
for (; sc.More(); sc.Forward()) {
if (sc.atLineStart && (sc.state == SCE_LOUT_STRING)) {
// Prevent SCE_LOUT_STRINGEOL from leaking back to previous line
sc.SetState(SCE_LOUT_STRING);
}
// Determine if the current state should terminate.
if (sc.state == SCE_LOUT_COMMENT) {
if (sc.atLineEnd) {
sc.SetState(SCE_LOUT_DEFAULT);
visibleChars = 0;
}
} else if (sc.state == SCE_LOUT_NUMBER) {
if (!IsADigit(sc.ch) && sc.ch != '.') {
sc.SetState(SCE_LOUT_DEFAULT);
}
} else if (sc.state == SCE_LOUT_STRING) {
if (sc.ch == '\\') {
if (sc.chNext == '\"' || sc.chNext == '\\') {
sc.Forward();
}
} else if (sc.ch == '\"') {
sc.ForwardSetState(SCE_LOUT_DEFAULT);
} else if (sc.atLineEnd) {
sc.ChangeState(SCE_LOUT_STRINGEOL);
sc.ForwardSetState(SCE_LOUT_DEFAULT);
visibleChars = 0;
}
} else if (sc.state == SCE_LOUT_IDENTIFIER) {
if (!IsAWordChar(sc.ch)) {
char s[100];
sc.GetCurrent(s, sizeof(s));
if (leadingAtSign) {
if (keywords.InList(s)) {
sc.ChangeState(SCE_LOUT_WORD);
} else {
sc.ChangeState(SCE_LOUT_WORD4);
}
} else if (firstWordInLine && keywords3.InList(s)) {
sc.ChangeState(SCE_LOUT_WORD3);
}
sc.SetState(SCE_LOUT_DEFAULT);
}
} else if (sc.state == SCE_LOUT_OPERATOR) {
if (!IsAnOther(sc.ch)) {
char s[100];
sc.GetCurrent(s, sizeof(s));
if (keywords2.InList(s)) {
sc.ChangeState(SCE_LOUT_WORD2);
}
sc.SetState(SCE_LOUT_DEFAULT);
}
}
// Determine if a new state should be entered.
if (sc.state == SCE_LOUT_DEFAULT) {
if (sc.ch == '#') {
sc.SetState(SCE_LOUT_COMMENT);
} else if (sc.ch == '\"') {
sc.SetState(SCE_LOUT_STRING);
} else if (IsADigit(sc.ch) ||
(sc.ch == '.' && IsADigit(sc.chNext))) {
sc.SetState(SCE_LOUT_NUMBER);
} else if (IsAWordChar(sc.ch)) {
firstWordInLine = (visibleChars == 0);
leadingAtSign = (sc.ch == '@');
sc.SetState(SCE_LOUT_IDENTIFIER);
} else if (IsAnOther(sc.ch)) {
sc.SetState(SCE_LOUT_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 FoldLoutDoc(unsigned int startPos, int length, int, WordList *[],
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[startPos];
bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0;
int styleNext = styler.StyleAt(startPos);
char s[10];
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');
if (style == SCE_LOUT_WORD) {
if (ch == '@') {
for (unsigned int j = 0; j < 8; j++) {
if (!IsAWordChar(styler[i + j])) {
break;
}
s[j] = styler[i + j];
s[j + 1] = '\0';
}
if (strcmp(s, "@Begin") == 0) {
levelCurrent++;
} else if (strcmp(s, "@End") == 0) {
levelCurrent--;
}
}
} else if (style == SCE_LOUT_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 loutWordLists[] = {
"Predefined identifiers",
"Predefined delimiters",
"Predefined keywords",
0,
};
LexerModule lmLout(SCLEX_LOUT, ColouriseLoutDoc, "lout", FoldLoutDoc, loutWordLists);

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save