]> git.saurik.com Git - wxWidgets.git/commitdiff
Update to Scintilla 1.53
authorRobin Dunn <robin@alldunn.com>
Fri, 18 Jul 2003 06:43:31 +0000 (06:43 +0000)
committerRobin Dunn <robin@alldunn.com>
Fri, 18 Jul 2003 06:43:31 +0000 (06:43 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@22080 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

51 files changed:
contrib/build/stc/stc.bkl
contrib/include/wx/stc/stc.h
contrib/src/stc/Makefile.in
contrib/src/stc/PlatWX.cpp
contrib/src/stc/ScintillaWX.cpp
contrib/src/stc/ScintillaWX.h
contrib/src/stc/scintilla/README.txt
contrib/src/stc/scintilla/include/Platform.h
contrib/src/stc/scintilla/include/PropSet.h
contrib/src/stc/scintilla/include/SciLexer.h
contrib/src/stc/scintilla/include/Scintilla.h
contrib/src/stc/scintilla/include/Scintilla.iface
contrib/src/stc/scintilla/src/Document.cxx
contrib/src/stc/scintilla/src/Editor.cxx
contrib/src/stc/scintilla/src/Editor.h
contrib/src/stc/scintilla/src/ExternalLexer.cxx [new file with mode: 0644]
contrib/src/stc/scintilla/src/ExternalLexer.h [new file with mode: 0644]
contrib/src/stc/scintilla/src/KeyMap.cxx
contrib/src/stc/scintilla/src/KeyWords.cxx
contrib/src/stc/scintilla/src/LexCPP.cxx
contrib/src/stc/scintilla/src/LexEScript.cxx [new file with mode: 0644]
contrib/src/stc/scintilla/src/LexLout.cxx [new file with mode: 0644]
contrib/src/stc/scintilla/src/LexOthers.cxx
contrib/src/stc/scintilla/src/PropSet.cxx
contrib/src/stc/scintilla/src/RESearch.cxx
contrib/src/stc/stc.cpp
include/wx/stc/stc.h
src/stc/Makefile.in
src/stc/PlatWX.cpp
src/stc/ScintillaWX.cpp
src/stc/ScintillaWX.h
src/stc/scintilla/README.txt
src/stc/scintilla/include/Platform.h
src/stc/scintilla/include/PropSet.h
src/stc/scintilla/include/SciLexer.h
src/stc/scintilla/include/Scintilla.h
src/stc/scintilla/include/Scintilla.iface
src/stc/scintilla/src/Document.cxx
src/stc/scintilla/src/Editor.cxx
src/stc/scintilla/src/Editor.h
src/stc/scintilla/src/ExternalLexer.cxx [new file with mode: 0644]
src/stc/scintilla/src/ExternalLexer.h [new file with mode: 0644]
src/stc/scintilla/src/KeyMap.cxx
src/stc/scintilla/src/KeyWords.cxx
src/stc/scintilla/src/LexCPP.cxx
src/stc/scintilla/src/LexEScript.cxx [new file with mode: 0644]
src/stc/scintilla/src/LexLout.cxx [new file with mode: 0644]
src/stc/scintilla/src/LexOthers.cxx
src/stc/scintilla/src/PropSet.cxx
src/stc/scintilla/src/RESearch.cxx
src/stc/stc.cpp

index 45b1fb75dd909be43827348a100117b75847c820..e0a1b923efd9eb541fef06ca95bca6457c967730 100644 (file)
@@ -18,6 +18,7 @@
         scintilla/src/Document.cxx
         scintilla/src/DocumentAccessor.cxx
         scintilla/src/Editor.cxx
         scintilla/src/Document.cxx
         scintilla/src/DocumentAccessor.cxx
         scintilla/src/Editor.cxx
+        scintilla/src/ExternalLexer.cxx
         scintilla/src/Indicator.cxx
         scintilla/src/KeyMap.cxx
         scintilla/src/KeyWords.cxx
         scintilla/src/Indicator.cxx
         scintilla/src/KeyMap.cxx
         scintilla/src/KeyWords.cxx
         scintilla/src/LexConf.cxx
         scintilla/src/LexCrontab.cxx
         scintilla/src/LexEiffel.cxx
         scintilla/src/LexConf.cxx
         scintilla/src/LexCrontab.cxx
         scintilla/src/LexEiffel.cxx
+        scintilla/src/LexEScript.cxx
         scintilla/src/LexFortran.cxx
         scintilla/src/LexHTML.cxx
         scintilla/src/LexLisp.cxx
         scintilla/src/LexFortran.cxx
         scintilla/src/LexHTML.cxx
         scintilla/src/LexLisp.cxx
+        scintilla/src/LexLout.cxx
         scintilla/src/LexLua.cxx
         scintilla/src/LexMatlab.cxx
         scintilla/src/LexOthers.cxx
         scintilla/src/LexLua.cxx
         scintilla/src/LexMatlab.cxx
         scintilla/src/LexOthers.cxx
@@ -53,7 +56,7 @@
         scintilla/src/UniConversion.cxx
         scintilla/src/ViewStyle.cxx
         scintilla/src/WindowAccessor.cxx
         scintilla/src/UniConversion.cxx
         scintilla/src/ViewStyle.cxx
         scintilla/src/WindowAccessor.cxx
-        scintilla/src/XPM.cxx 
+        scintilla/src/XPM.cxx
     </set>
 
     <headers template="wx_contrib_headers">
     </set>
 
     <headers template="wx_contrib_headers">
@@ -77,7 +80,7 @@
         <wx-lib>core</wx-lib>
         <wx-lib>base</wx-lib>
     </dll>
         <wx-lib>core</wx-lib>
         <wx-lib>base</wx-lib>
     </dll>
-    
+
     <lib id="stclib" template="wx_contrib_lib,stc_base" cond="SHARED=='0'"/>
 
 </makefile>
     <lib id="stclib" template="wx_contrib_lib,stc_base" cond="SHARED=='0'"/>
 
 </makefile>
index 193376418ff38fe0b6e30f768b03508949d06e34..2f54e83f76a2af18c90dce9b277da819da102981 100644 (file)
 #define wxSTC_LEX_F77 37
 #define wxSTC_LEX_CSS 38
 #define wxSTC_LEX_POV 39
 #define wxSTC_LEX_F77 37
 #define wxSTC_LEX_CSS 38
 #define wxSTC_LEX_POV 39
+#define wxSTC_LEX_LOUT 40
+#define wxSTC_LEX_ESCRIPT 41
 
 // When a lexer specifies its language as SCLEX_AUTOMATIC it receives a
 // value assigned in sequence from SCLEX_AUTOMATIC+1.
 
 // When a lexer specifies its language as SCLEX_AUTOMATIC it receives a
 // value assigned in sequence from SCLEX_AUTOMATIC+1.
 #define wxSTC_C_WORD2 16
 #define wxSTC_C_COMMENTDOCKEYWORD 17
 #define wxSTC_C_COMMENTDOCKEYWORDERROR 18
 #define wxSTC_C_WORD2 16
 #define wxSTC_C_COMMENTDOCKEYWORD 17
 #define wxSTC_C_COMMENTDOCKEYWORDERROR 18
+#define wxSTC_C_GLOBALCLASS 19
 
 // Lexical states for SCLEX_HTML, SCLEX_XML
 #define wxSTC_H_DEFAULT 0
 
 // Lexical states for SCLEX_HTML, SCLEX_XML
 #define wxSTC_H_DEFAULT 0
 #define wxSTC_POV_BRACE 9
 #define wxSTC_POV_WORD2 10
 
 #define wxSTC_POV_BRACE 9
 #define wxSTC_POV_WORD2 10
 
+// Lexical states for SCLEX_LOUT
+#define wxSTC_LOUT_DEFAULT 0
+#define wxSTC_LOUT_COMMENT 1
+#define wxSTC_LOUT_NUMBER 2
+#define wxSTC_LOUT_WORD 3
+#define wxSTC_LOUT_WORD2 4
+#define wxSTC_LOUT_WORD3 5
+#define wxSTC_LOUT_WORD4 6
+#define wxSTC_LOUT_STRING 7
+#define wxSTC_LOUT_OPERATOR 8
+#define wxSTC_LOUT_IDENTIFIER 9
+#define wxSTC_LOUT_STRINGEOL 10
+
+// Lexical states for SCLEX_ESCRIPT
+#define wxSTC_ESCRIPT_DEFAULT 0
+#define wxSTC_ESCRIPT_COMMENT 1
+#define wxSTC_ESCRIPT_COMMENTLINE 2
+#define wxSTC_ESCRIPT_COMMENTDOC 3
+#define wxSTC_ESCRIPT_NUMBER 4
+#define wxSTC_ESCRIPT_WORD 5
+#define wxSTC_ESCRIPT_STRING 6
+#define wxSTC_ESCRIPT_OPERATOR 7
+#define wxSTC_ESCRIPT_IDENTIFIER 8
+#define wxSTC_ESCRIPT_BRACE 9
+#define wxSTC_ESCRIPT_WORD2 10
+#define wxSTC_ESCRIPT_WORD3 11
+
 
 //-----------------------------------------
 // Commands that can be bound to keystrokes
 
 //-----------------------------------------
 // Commands that can be bound to keystrokes
@@ -1880,6 +1910,9 @@ public:
     // caret position.
     void LineEndDisplayExtend();
 
     // caret position.
     void LineEndDisplayExtend();
 
+    // Copy the line containing the caret.
+    void LineCopy();
+
     // Move the caret inside current view if it's not there already.
     void MoveCaretInsideView();
 
     // Move the caret inside current view if it's not there already.
     void MoveCaretInsideView();
 
@@ -2056,6 +2089,20 @@ public:
     // Enable / Disable underlining active hotspots.
     void SetHotspotActiveUnderline(bool underline);
 
     // Enable / Disable underlining active hotspots.
     void SetHotspotActiveUnderline(bool underline);
 
+    // Given a valid document position, return the previous position taking code
+    // page into account. Returns 0 if passed 0.
+    int PositionBefore(int pos);
+
+    // Given a valid document position, return the next position taking code
+    // page into account. Maximum value returned is the last position in the document.
+    int PositionAfter(int pos);
+
+    // Copy a range of text to the clipboard. Positions are clipped into the document.
+    void CopyRange(int start, int end);
+
+    // Copy argument text to the clipboard.
+    void CopyText(int length, const wxString& text);
+
     // Start notifying the container of all key presses and commands.
     void StartRecord();
 
     // Start notifying the container of all key presses and commands.
     void StartRecord();
 
index 6d3ac72f9ed44b19e68c1d87fe9691eb79193072..ff006759dc565f64a673da38bb408001d56ba651 100644 (file)
@@ -17,6 +17,7 @@ CXXFLAGS = @CXXFLAGS@
 DLLPREFIX = @DLLPREFIX@
 EXTRALIBS = @EXTRALIBS@
 EXTRALIBS_GUI = @EXTRALIBS_GUI@
 DLLPREFIX = @DLLPREFIX@
 EXTRALIBS = @EXTRALIBS@
 EXTRALIBS_GUI = @EXTRALIBS_GUI@
+HOST_SUFFIX = @HOST_SUFFIX@
 INSTALL_DATA = @INSTALL_DATA@
 INSTALL_DIR = @INSTALL_DIR@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_DATA = @INSTALL_DATA@
 INSTALL_DIR = @INSTALL_DIR@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
@@ -40,8 +41,17 @@ top_srcdir = @top_srcdir@
 
 ### Variables: ###
 
 
 ### Variables: ###
 
-STCDLL_CXXFLAGS = $(CPPFLAGS)   -D__WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p)   -I$(top_srcdir)/include $(__INC_TIFF_p) $(__INC_JPEG_p) $(__INC_PNG_p) $(__INC_ZLIB_p) $(__INC_ODBC_p) $(__INC_REGEX_p) -I$(srcdir)/../../include -I$(srcdir)/scintilla/include -I$(srcdir)/scintilla/src -D__WX__ -DSCI_LEXER -DLINK_LEXERS -DWXUSINGDLL -DWXMAKINGDLL_STC $(CXXFLAGS) $(PIC_FLAG)
-STCLIB_CXXFLAGS = $(CPPFLAGS)   -D__WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p)   -I$(top_srcdir)/include $(__INC_TIFF_p) $(__INC_JPEG_p) $(__INC_PNG_p) $(__INC_ZLIB_p) $(__INC_ODBC_p) $(__INC_REGEX_p) -I$(srcdir)/../../include -I$(srcdir)/scintilla/include -I$(srcdir)/scintilla/src -D__WX__ -DSCI_LEXER -DLINK_LEXERS $(CXXFLAGS)
+STCDLL_CXXFLAGS = $(CPPFLAGS) -D__WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p) \
+       -I$(top_srcdir)/include $(__INC_TIFF_p) $(__INC_JPEG_p) $(__INC_PNG_p) \
+       $(__INC_ZLIB_p) $(__INC_ODBC_p) $(__INC_REGEX_p) -I$(srcdir)/../../include \
+       -I$(srcdir)/scintilla/include -I$(srcdir)/scintilla/src -D__WX__ \
+       -DSCI_LEXER -DLINK_LEXERS -DWXUSINGDLL -DWXMAKINGDLL_STC $(CXXFLAGS) \
+       $(PIC_FLAG)
+STCLIB_CXXFLAGS = $(CPPFLAGS) -D__WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p) \
+       -I$(top_srcdir)/include $(__INC_TIFF_p) $(__INC_JPEG_p) $(__INC_PNG_p) \
+       $(__INC_ZLIB_p) $(__INC_ODBC_p) $(__INC_REGEX_p) -I$(srcdir)/../../include \
+       -I$(srcdir)/scintilla/include -I$(srcdir)/scintilla/src -D__WX__ \
+       -DSCI_LEXER -DLINK_LEXERS $(CXXFLAGS)
 
 ### Conditionally set variables: ###
 
 
 ### Conditionally set variables: ###
 
@@ -68,38 +78,74 @@ STCLIB_CXXFLAGS = $(CPPFLAGS)   -D__WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p)   -I$(to
 @COND_WXUSE_REGEX_BUILTIN@__INC_REGEX_p = -I$(top_srcdir)/src/regex
 @COND_WXUSE_LIBTIFF_BUILTIN@__INC_TIFF_p = -I$(top_srcdir)/src/tiff
 @COND_WXUSE_ZLIB_BUILTIN@__INC_ZLIB_p = -I$(top_srcdir)/src/zlib
 @COND_WXUSE_REGEX_BUILTIN@__INC_REGEX_p = -I$(top_srcdir)/src/regex
 @COND_WXUSE_LIBTIFF_BUILTIN@__INC_TIFF_p = -I$(top_srcdir)/src/tiff
 @COND_WXUSE_ZLIB_BUILTIN@__INC_ZLIB_p = -I$(top_srcdir)/src/zlib
-@COND_WXUSE_LIBJPEG_BUILTIN@__LIB_JPEG_p = -lwxjpeg$(WXDEBUGFLAG)
-@COND_WXUSE_ODBC_BUILTIN@__LIB_ODBC_p = -lwxodbc$(WXDEBUGFLAG)
-@COND_WXUSE_LIBPNG_BUILTIN@__LIB_PNG_p = -lwxpng$(WXDEBUGFLAG)
-@COND_WXUSE_REGEX_BUILTIN@__LIB_REGEX_p = -lwxregex$(WXDEBUGFLAG)
-@COND_WXUSE_LIBTIFF_BUILTIN@__LIB_TIFF_p = -lwxtiff$(WXDEBUGFLAG)
-@COND_WXUSE_ZLIB_BUILTIN@__LIB_ZLIB_p = -lwxzlib$(WXDEBUGFLAG)
-@COND_MONOLITHIC_0@__WXLIB_BASE_p = -lwx_base$(WXBASEPORT)$(WXUNICODEFLAG)$(WXDEBUGFLAG)-2.5
-@COND_MONOLITHIC_0@__WXLIB_CORE_p = -lwx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_core-2.5
-@COND_MONOLITHIC_1@__WXLIB_MONO_p = -lwx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)-2.5
+@COND_WXUSE_LIBJPEG_BUILTIN@__LIB_JPEG_p = \
+@COND_WXUSE_LIBJPEG_BUILTIN@   -lwxjpeg$(WXDEBUGFLAG)$(HOST_SUFFIX)
+@COND_WXUSE_ODBC_BUILTIN@__LIB_ODBC_p = \
+@COND_WXUSE_ODBC_BUILTIN@      -lwxodbc$(WXDEBUGFLAG)$(HOST_SUFFIX)
+@COND_WXUSE_LIBPNG_BUILTIN@__LIB_PNG_p = \
+@COND_WXUSE_LIBPNG_BUILTIN@    -lwxpng$(WXDEBUGFLAG)$(HOST_SUFFIX)
+@COND_WXUSE_REGEX_BUILTIN@__LIB_REGEX_p = \
+@COND_WXUSE_REGEX_BUILTIN@     -lwxregex$(WXDEBUGFLAG)$(HOST_SUFFIX)
+@COND_WXUSE_LIBTIFF_BUILTIN@__LIB_TIFF_p = \
+@COND_WXUSE_LIBTIFF_BUILTIN@   -lwxtiff$(WXDEBUGFLAG)$(HOST_SUFFIX)
+@COND_WXUSE_ZLIB_BUILTIN@__LIB_ZLIB_p = \
+@COND_WXUSE_ZLIB_BUILTIN@      -lwxzlib$(WXDEBUGFLAG)$(HOST_SUFFIX)
+@COND_MONOLITHIC_0@__WXLIB_BASE_p = \
+@COND_MONOLITHIC_0@    -lwx_base$(WXBASEPORT)$(WXUNICODEFLAG)$(WXDEBUGFLAG)-2.5$(HOST_SUFFIX)
+@COND_MONOLITHIC_0@__WXLIB_CORE_p = \
+@COND_MONOLITHIC_0@    -lwx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_core-2.5$(HOST_SUFFIX)
+@COND_MONOLITHIC_1@__WXLIB_MONO_p = \
+@COND_MONOLITHIC_1@    -lwx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)-2.5$(HOST_SUFFIX)
 @COND_WXUNIV_1@__WXUNIV_DEFINE_p = -D__WXUNIVERSAL__
 @COND_SHARED_1@__install_stcdll___depname = install_stcdll
 @COND_SHARED_0@__install_stclib___depname = install_stclib
 @COND_WXUNIV_1@__WXUNIV_DEFINE_p = -D__WXUNIVERSAL__
 @COND_SHARED_1@__install_stcdll___depname = install_stcdll
 @COND_SHARED_0@__install_stclib___depname = install_stclib
-@COND_SHARED_1@__stcdll___depname = $(top_builddir)lib/$(DLLPREFIX)$(WXDLLNAMEPREFIXGUI)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc$(WXCOMPILER)$(VENDORTAG)$(WXDLLVERSIONTAG)$(__stcdll___targetsuf3)
-@COND_PLATFORM_WIN32_1@__stcdll___importlib = -Wl,--out-implib,libwx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc-2.5$(DLLIMPEXT)
-@COND_PLATFORM_WIN32_1@__stcdll___importlib = -Wl,--out-implib,$(top_builddir)lib/libwx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc-2.5$(DLLIMPEXT)
-@COND_PLATFORM_MACOSX_1@__stcdll___macinstnamecmd = -install_name $(libdir)/$(DLLPREFIX)$(WXDLLNAMEPREFIXGUI)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc$(WXCOMPILER)$(VENDORTAG)$(WXDLLVERSIONTAG)$(__stcdll___targetsuf2)
-@COND_PLATFORM_MACOSX_1@__stcdll___macver = -compatibility_version 2.5 -current_version 2.5.0
-@COND_USE_SOSYMLINKS_1@__stcdll___so_symlinks_cmd = rm -f $(top_builddir)lib/libwx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc-2.5$(DLLIMPEXT) $(top_builddir)lib/$(DLLPREFIX)$(WXDLLNAMEPREFIXGUI)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc$(WXCOMPILER)$(VENDORTAG)$(WXDLLVERSIONTAG)$(__stcdll___targetsuf2); \
-@COND_USE_SOSYMLINKS_1@                $(LN_S) $(DLLPREFIX)$(WXDLLNAMEPREFIXGUI)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc$(WXCOMPILER)$(VENDORTAG)$(WXDLLVERSIONTAG)$(__stcdll___targetsuf3) $(top_builddir)lib/$(DLLPREFIX)$(WXDLLNAMEPREFIXGUI)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc$(WXCOMPILER)$(VENDORTAG)$(WXDLLVERSIONTAG)$(__stcdll___targetsuf2); \
-@COND_USE_SOSYMLINKS_1@                $(LN_S) $(DLLPREFIX)$(WXDLLNAMEPREFIXGUI)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc$(WXCOMPILER)$(VENDORTAG)$(WXDLLVERSIONTAG)$(__stcdll___targetsuf2) $(top_builddir)lib/libwx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc-2.5$(DLLIMPEXT)
-@COND_USE_SOSYMLINKS_1@__stcdll___so_symlinks_inst_cmd = rm -f libwx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc-2.5$(DLLIMPEXT) $(DLLPREFIX)$(WXDLLNAMEPREFIXGUI)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc$(WXCOMPILER)$(VENDORTAG)$(WXDLLVERSIONTAG)$(__stcdll___targetsuf2); \
-@COND_USE_SOSYMLINKS_1@                $(LN_S) $(DLLPREFIX)$(WXDLLNAMEPREFIXGUI)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc$(WXCOMPILER)$(VENDORTAG)$(WXDLLVERSIONTAG)$(__stcdll___targetsuf3) $(DLLPREFIX)$(WXDLLNAMEPREFIXGUI)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc$(WXCOMPILER)$(VENDORTAG)$(WXDLLVERSIONTAG)$(__stcdll___targetsuf2); \
-@COND_USE_SOSYMLINKS_1@                $(LN_S) $(DLLPREFIX)$(WXDLLNAMEPREFIXGUI)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc$(WXCOMPILER)$(VENDORTAG)$(WXDLLVERSIONTAG)$(__stcdll___targetsuf2) libwx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc-2.5$(DLLIMPEXT)
-@COND_USE_SOVERLINUX_1@__stcdll___soname_flags = $(SONAME_FLAG)$(DLLPREFIX)$(WXDLLNAMEPREFIXGUI)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc$(WXCOMPILER)$(VENDORTAG)$(WXDLLVERSIONTAG)$(__stcdll___targetsuf2)
-@COND_USE_SOVERSOLARIS_1@__stcdll___soname_flags = $(SONAME_FLAG)$(DLLPREFIX)$(WXDLLNAMEPREFIXGUI)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc$(WXCOMPILER)$(VENDORTAG)$(WXDLLVERSIONTAG)$(__stcdll___targetsuf3)
-@COND_PLATFORM_MACOSX_0_USE_SOVERSION_1@__stcdll___targetsuf2 = .$(SO_SUFFIX).0
-@COND_PLATFORM_MACOSX_1_USE_SOVERSION_1@__stcdll___targetsuf2 = .0.$(SO_SUFFIX)
+@COND_SHARED_1@__stcdll___depname = \
+@COND_SHARED_1@        $(top_builddir)lib/$(DLLPREFIX)$(WXDLLNAMEPREFIXGUI)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc$(WXCOMPILER)$(VENDORTAG)$(WXDLLVERSIONTAG)$(__stcdll___targetsuf3)
+@COND_PLATFORM_WIN32_1@__stcdll___importlib = \
+@COND_PLATFORM_WIN32_1@        -Wl,--out-implib,libwx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc-2.5$(HOST_SUFFIX)$(DLLIMPEXT)
+@COND_PLATFORM_WIN32_1@__stcdll___importlib = \
+@COND_PLATFORM_WIN32_1@        -Wl,--out-implib,$(top_builddir)lib/libwx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc-2.5$(HOST_SUFFIX)$(DLLIMPEXT)
+@COND_PLATFORM_MACOSX_1@__stcdll___macinstnamecmd = \
+@COND_PLATFORM_MACOSX_1@       -install_name \
+@COND_PLATFORM_MACOSX_1@       $(libdir)/$(DLLPREFIX)$(WXDLLNAMEPREFIXGUI)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc$(WXCOMPILER)$(VENDORTAG)$(WXDLLVERSIONTAG)$(__stcdll___targetsuf2)
+@COND_PLATFORM_MACOSX_1@__stcdll___macver = \
+@COND_PLATFORM_MACOSX_1@       -compatibility_version 2.5 -current_version 2.5.0
+@COND_USE_SOSYMLINKS_1@__stcdll___so_symlinks_cmd = \
+@COND_USE_SOSYMLINKS_1@        rm -f \
+@COND_USE_SOSYMLINKS_1@        $(top_builddir)lib/libwx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc-2.5$(HOST_SUFFIX)$(DLLIMPEXT) \
+@COND_USE_SOSYMLINKS_1@        $(top_builddir)lib/$(DLLPREFIX)$(WXDLLNAMEPREFIXGUI)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc$(WXCOMPILER)$(VENDORTAG)$(WXDLLVERSIONTAG)$(__stcdll___targetsuf2); \
+@COND_USE_SOSYMLINKS_1@        $(LN_S) \
+@COND_USE_SOSYMLINKS_1@        $(DLLPREFIX)$(WXDLLNAMEPREFIXGUI)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc$(WXCOMPILER)$(VENDORTAG)$(WXDLLVERSIONTAG)$(__stcdll___targetsuf3) \
+@COND_USE_SOSYMLINKS_1@        $(top_builddir)lib/$(DLLPREFIX)$(WXDLLNAMEPREFIXGUI)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc$(WXCOMPILER)$(VENDORTAG)$(WXDLLVERSIONTAG)$(__stcdll___targetsuf2); \
+@COND_USE_SOSYMLINKS_1@        $(LN_S) \
+@COND_USE_SOSYMLINKS_1@        $(DLLPREFIX)$(WXDLLNAMEPREFIXGUI)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc$(WXCOMPILER)$(VENDORTAG)$(WXDLLVERSIONTAG)$(__stcdll___targetsuf2) \
+@COND_USE_SOSYMLINKS_1@        $(top_builddir)lib/libwx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc-2.5$(HOST_SUFFIX)$(DLLIMPEXT)
+@COND_USE_SOSYMLINKS_1@__stcdll___so_symlinks_inst_cmd \
+@COND_USE_SOSYMLINKS_1@        = rm -f \
+@COND_USE_SOSYMLINKS_1@        libwx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc-2.5$(HOST_SUFFIX)$(DLLIMPEXT) \
+@COND_USE_SOSYMLINKS_1@        $(DLLPREFIX)$(WXDLLNAMEPREFIXGUI)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc$(WXCOMPILER)$(VENDORTAG)$(WXDLLVERSIONTAG)$(__stcdll___targetsuf2); \
+@COND_USE_SOSYMLINKS_1@        $(LN_S) \
+@COND_USE_SOSYMLINKS_1@        $(DLLPREFIX)$(WXDLLNAMEPREFIXGUI)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc$(WXCOMPILER)$(VENDORTAG)$(WXDLLVERSIONTAG)$(__stcdll___targetsuf3) \
+@COND_USE_SOSYMLINKS_1@        $(DLLPREFIX)$(WXDLLNAMEPREFIXGUI)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc$(WXCOMPILER)$(VENDORTAG)$(WXDLLVERSIONTAG)$(__stcdll___targetsuf2); \
+@COND_USE_SOSYMLINKS_1@        $(LN_S) \
+@COND_USE_SOSYMLINKS_1@        $(DLLPREFIX)$(WXDLLNAMEPREFIXGUI)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc$(WXCOMPILER)$(VENDORTAG)$(WXDLLVERSIONTAG)$(__stcdll___targetsuf2) \
+@COND_USE_SOSYMLINKS_1@        libwx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc-2.5$(HOST_SUFFIX)$(DLLIMPEXT)
+@COND_USE_SOVERLINUX_1@__stcdll___soname_flags = \
+@COND_USE_SOVERLINUX_1@        $(SONAME_FLAG)$(DLLPREFIX)$(WXDLLNAMEPREFIXGUI)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc$(WXCOMPILER)$(VENDORTAG)$(WXDLLVERSIONTAG)$(__stcdll___targetsuf2)
+@COND_USE_SOVERSOLARIS_1@__stcdll___soname_flags = \
+@COND_USE_SOVERSOLARIS_1@      $(SONAME_FLAG)$(DLLPREFIX)$(WXDLLNAMEPREFIXGUI)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc$(WXCOMPILER)$(VENDORTAG)$(WXDLLVERSIONTAG)$(__stcdll___targetsuf3)
+@COND_PLATFORM_MACOSX_0_USE_SOVERSION_1@__stcdll___targetsuf2 \
+@COND_PLATFORM_MACOSX_0_USE_SOVERSION_1@       = .$(SO_SUFFIX).0
+@COND_PLATFORM_MACOSX_1_USE_SOVERSION_1@__stcdll___targetsuf2 \
+@COND_PLATFORM_MACOSX_1_USE_SOVERSION_1@       = .0.$(SO_SUFFIX)
 @COND_USE_SOVERSION_0@__stcdll___targetsuf2 = .$(SO_SUFFIX)
 @COND_USE_SOVERSION_0@__stcdll___targetsuf2 = .$(SO_SUFFIX)
-@COND_PLATFORM_MACOSX_0_USE_SOVERSION_1@__stcdll___targetsuf3 = .$(SO_SUFFIX).0.0.0
-@COND_PLATFORM_MACOSX_1_USE_SOVERSION_1@__stcdll___targetsuf3 = .0.0.0.$(SO_SUFFIX)
+@COND_PLATFORM_MACOSX_0_USE_SOVERSION_1@__stcdll___targetsuf3 \
+@COND_PLATFORM_MACOSX_0_USE_SOVERSION_1@       = .$(SO_SUFFIX).0.0.0
+@COND_PLATFORM_MACOSX_1_USE_SOVERSION_1@__stcdll___targetsuf3 \
+@COND_PLATFORM_MACOSX_1_USE_SOVERSION_1@       = .0.0.0.$(SO_SUFFIX)
 @COND_USE_SOVERSION_0@__stcdll___targetsuf3 = .$(SO_SUFFIX)
 @COND_USE_SOVERSION_0@__stcdll___targetsuf3 = .$(SO_SUFFIX)
-@COND_SHARED_0@__stclib___depname = $(top_builddir)lib/libwx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc-2.5.a
+@COND_SHARED_0@__stclib___depname = \
+@COND_SHARED_0@        $(top_builddir)lib/libwx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc-2.5$(HOST_SUFFIX).a
 
 ### Targets: ###
 
 
 ### Targets: ###
 
@@ -109,9 +155,9 @@ clean:
        rm -rf ./.deps
        rm -f -f ./*.o
        rm -f $(top_builddir)lib/$(DLLPREFIX)$(WXDLLNAMEPREFIXGUI)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc$(WXCOMPILER)$(VENDORTAG)$(WXDLLVERSIONTAG)$(__stcdll___targetsuf3)
        rm -rf ./.deps
        rm -f -f ./*.o
        rm -f $(top_builddir)lib/$(DLLPREFIX)$(WXDLLNAMEPREFIXGUI)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc$(WXCOMPILER)$(VENDORTAG)$(WXDLLVERSIONTAG)$(__stcdll___targetsuf3)
-       rm -f $(top_builddir)lib/libwx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc-2.5$(DLLIMPEXT)
-       rm -f $(top_builddir)lib/libwx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc-2.5$(DLLIMPEXT) $(top_builddir)lib/$(DLLPREFIX)$(WXDLLNAMEPREFIXGUI)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc$(WXCOMPILER)$(VENDORTAG)$(WXDLLVERSIONTAG)$(__stcdll___targetsuf2)
-       rm -f $(top_builddir)lib/libwx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc-2.5.a
+       rm -f $(top_builddir)lib/libwx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc-2.5$(HOST_SUFFIX)$(DLLIMPEXT)
+       rm -f $(top_builddir)lib/libwx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc-2.5$(HOST_SUFFIX)$(DLLIMPEXT) $(top_builddir)lib/$(DLLPREFIX)$(WXDLLNAMEPREFIXGUI)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc$(WXCOMPILER)$(VENDORTAG)$(WXDLLVERSIONTAG)$(__stcdll___targetsuf2)
+       rm -f $(top_builddir)lib/libwx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc-2.5$(HOST_SUFFIX).a
 
 distclean: clean
        rm -f configure config.cache config.log config.status
 
 distclean: clean
        rm -f configure config.cache config.log config.status
@@ -131,16 +177,16 @@ install-strip: install
 
 @COND_SHARED_1@install_stcdll: 
 @COND_SHARED_1@        $(INSTALL_DIR) $(libdir)
 
 @COND_SHARED_1@install_stcdll: 
 @COND_SHARED_1@        $(INSTALL_DIR) $(libdir)
-@COND_SHARED_1@        $(INSTALL_DATA) $(top_builddir)lib/libwx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc-2.5$(DLLIMPEXT) $(libdir)
+@COND_SHARED_1@        $(INSTALL_DATA) $(top_builddir)lib/libwx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc-2.5$(HOST_SUFFIX)$(DLLIMPEXT) $(libdir)
 @COND_SHARED_1@        $(INSTALL_PROGRAM) $(top_builddir)lib/$(DLLPREFIX)$(WXDLLNAMEPREFIXGUI)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc$(WXCOMPILER)$(VENDORTAG)$(WXDLLVERSIONTAG)$(__stcdll___targetsuf3) $(libdir)
 @COND_SHARED_1@        (cd $(libdir) ; $(__stcdll___so_symlinks_inst_cmd))
 
 @COND_SHARED_0@install_stclib: 
 @COND_SHARED_0@        $(INSTALL_DIR) $(libdir)
 @COND_SHARED_1@        $(INSTALL_PROGRAM) $(top_builddir)lib/$(DLLPREFIX)$(WXDLLNAMEPREFIXGUI)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc$(WXCOMPILER)$(VENDORTAG)$(WXDLLVERSIONTAG)$(__stcdll___targetsuf3) $(libdir)
 @COND_SHARED_1@        (cd $(libdir) ; $(__stcdll___so_symlinks_inst_cmd))
 
 @COND_SHARED_0@install_stclib: 
 @COND_SHARED_0@        $(INSTALL_DIR) $(libdir)
-@COND_SHARED_0@        $(INSTALL_DATA) $(top_builddir)lib/libwx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc-2.5.a $(libdir)
+@COND_SHARED_0@        $(INSTALL_DATA) $(top_builddir)lib/libwx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc-2.5$(HOST_SUFFIX).a $(libdir)
 
 
-@COND_SHARED_1@$(top_builddir)lib/$(DLLPREFIX)$(WXDLLNAMEPREFIXGUI)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc$(WXCOMPILER)$(VENDORTAG)$(WXDLLVERSIONTAG)$(__stcdll___targetsuf3): stcdll_PlatWX.o stcdll_ScintillaWX.o stcdll_stc.o stcdll_AutoComplete.o stcdll_CallTip.o stcdll_CellBuffer.o stcdll_ContractionState.o stcdll_Document.o stcdll_DocumentAccessor.o stcdll_Editor.o stcdll_Indicator.o stcdll_KeyMap.o stcdll_KeyWords.o stcdll_LexAVE.o stcdll_LexAda.o stcdll_LexAsm.o stcdll_LexBaan.o stcdll_LexBullant.o stcdll_LexCPP.o stcdll_LexCSS.o stcdll_LexConf.o stcdll_LexCrontab.o stcdll_LexEiffel.o stcdll_LexFortran.o stcdll_LexHTML.o stcdll_LexLisp.o stcdll_LexLua.o stcdll_LexMatlab.o stcdll_LexOthers.o stcdll_LexPOV.o stcdll_LexPascal.o stcdll_LexPerl.o stcdll_LexPython.o stcdll_LexRuby.o stcdll_LexSQL.o stcdll_LexVB.o stcdll_LineMarker.o stcdll_PropSet.o stcdll_RESearch.o stcdll_ScintillaBase.o stcdll_Style.o stcdll_StyleContext.o stcdll_UniConversion.o stcdll_ViewStyle.o stcdll_WindowAccessor.o stcdll_XPM.o
-@COND_SHARED_1@        $(SHARED_LD_CXX) $@  stcdll_PlatWX.o stcdll_ScintillaWX.o stcdll_stc.o stcdll_AutoComplete.o stcdll_CallTip.o stcdll_CellBuffer.o stcdll_ContractionState.o stcdll_Document.o stcdll_DocumentAccessor.o stcdll_Editor.o stcdll_Indicator.o stcdll_KeyMap.o stcdll_KeyWords.o stcdll_LexAVE.o stcdll_LexAda.o stcdll_LexAsm.o stcdll_LexBaan.o stcdll_LexBullant.o stcdll_LexCPP.o stcdll_LexCSS.o stcdll_LexConf.o stcdll_LexCrontab.o stcdll_LexEiffel.o stcdll_LexFortran.o stcdll_LexHTML.o stcdll_LexLisp.o stcdll_LexLua.o stcdll_LexMatlab.o stcdll_LexOthers.o stcdll_LexPOV.o stcdll_LexPascal.o stcdll_LexPerl.o stcdll_LexPython.o stcdll_LexRuby.o stcdll_LexSQL.o stcdll_LexVB.o stcdll_LineMarker.o stcdll_PropSet.o stcdll_RESearch.o stcdll_ScintillaBase.o stcdll_Style.o stcdll_StyleContext.o stcdll_UniConversion.o stcdll_ViewStyle.o stcdll_WindowAccessor.o stcdll_XPM.o $(LDFLAGS) $(__stcdll___importlib)   -L$(top_builddir)lib $(__stcdll___macinstnamecmd) $(__stcdll___importlib) $(__stcdll___soname_flags) $(__stcdll___macver)  $(__WXLIB_MONO_p) $(__LIB_TIFF_p) $(__LIB_JPEG_p) $(__LIB_PNG_p) $(__LIB_ZLIB_p) $(__LIB_ODBC_p) $(__LIB_REGEX_p) $(EXTRALIBS) $(EXTRALIBS_GUI) $(__WXLIB_CORE_p) $(__WXLIB_BASE_p)
+@COND_SHARED_1@$(top_builddir)lib/$(DLLPREFIX)$(WXDLLNAMEPREFIXGUI)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc$(WXCOMPILER)$(VENDORTAG)$(WXDLLVERSIONTAG)$(__stcdll___targetsuf3): stcdll_PlatWX.o stcdll_ScintillaWX.o stcdll_stc.o stcdll_AutoComplete.o stcdll_CallTip.o stcdll_CellBuffer.o stcdll_ContractionState.o stcdll_Document.o stcdll_DocumentAccessor.o stcdll_Editor.o stcdll_ExternalLexer.o stcdll_Indicator.o stcdll_KeyMap.o stcdll_KeyWords.o stcdll_LexAVE.o stcdll_LexAda.o stcdll_LexAsm.o stcdll_LexBaan.o stcdll_LexBullant.o stcdll_LexCPP.o stcdll_LexCSS.o stcdll_LexConf.o stcdll_LexCrontab.o stcdll_LexEiffel.o stcdll_LexEScript.o stcdll_LexFortran.o stcdll_LexHTML.o stcdll_LexLisp.o stcdll_LexLout.o stcdll_LexLua.o stcdll_LexMatlab.o stcdll_LexOthers.o stcdll_LexPOV.o stcdll_LexPascal.o stcdll_LexPerl.o stcdll_LexPython.o stcdll_LexRuby.o stcdll_LexSQL.o stcdll_LexVB.o stcdll_LineMarker.o stcdll_PropSet.o stcdll_RESearch.o stcdll_ScintillaBase.o stcdll_Style.o stcdll_StyleContext.o stcdll_UniConversion.o stcdll_ViewStyle.o stcdll_WindowAccessor.o stcdll_XPM.o
+@COND_SHARED_1@        $(SHARED_LD_CXX) $@  stcdll_PlatWX.o stcdll_ScintillaWX.o stcdll_stc.o stcdll_AutoComplete.o stcdll_CallTip.o stcdll_CellBuffer.o stcdll_ContractionState.o stcdll_Document.o stcdll_DocumentAccessor.o stcdll_Editor.o stcdll_ExternalLexer.o stcdll_Indicator.o stcdll_KeyMap.o stcdll_KeyWords.o stcdll_LexAVE.o stcdll_LexAda.o stcdll_LexAsm.o stcdll_LexBaan.o stcdll_LexBullant.o stcdll_LexCPP.o stcdll_LexCSS.o stcdll_LexConf.o stcdll_LexCrontab.o stcdll_LexEiffel.o stcdll_LexEScript.o stcdll_LexFortran.o stcdll_LexHTML.o stcdll_LexLisp.o stcdll_LexLout.o stcdll_LexLua.o stcdll_LexMatlab.o stcdll_LexOthers.o stcdll_LexPOV.o stcdll_LexPascal.o stcdll_LexPerl.o stcdll_LexPython.o stcdll_LexRuby.o stcdll_LexSQL.o stcdll_LexVB.o stcdll_LineMarker.o stcdll_PropSet.o stcdll_RESearch.o stcdll_ScintillaBase.o stcdll_Style.o stcdll_StyleContext.o stcdll_UniConversion.o stcdll_ViewStyle.o stcdll_WindowAccessor.o stcdll_XPM.o $(LDFLAGS) $(__stcdll___importlib)   -L$(top_builddir)lib $(__stcdll___macinstnamecmd) $(__stcdll___importlib) $(__stcdll___soname_flags) $(__stcdll___macver)  $(__WXLIB_MONO_p) $(__LIB_TIFF_p) $(__LIB_JPEG_p) $(__LIB_PNG_p) $(__LIB_ZLIB_p) $(__LIB_ODBC_p) $(__LIB_REGEX_p) $(EXTRALIBS) $(EXTRALIBS_GUI) $(__WXLIB_CORE_p) $(__WXLIB_BASE_p)
 @COND_SHARED_1@        $(__stcdll___so_symlinks_cmd)
 
 stcdll_AutoComplete.o: $(srcdir)/scintilla/src/AutoComplete.cxx
 @COND_SHARED_1@        $(__stcdll___so_symlinks_cmd)
 
 stcdll_AutoComplete.o: $(srcdir)/scintilla/src/AutoComplete.cxx
@@ -164,6 +210,9 @@ stcdll_DocumentAccessor.o: $(srcdir)/scintilla/src/DocumentAccessor.cxx
 stcdll_Editor.o: $(srcdir)/scintilla/src/Editor.cxx
        $(CXXC) -c -o $@ $(STCDLL_CXXFLAGS) $<
 
 stcdll_Editor.o: $(srcdir)/scintilla/src/Editor.cxx
        $(CXXC) -c -o $@ $(STCDLL_CXXFLAGS) $<
 
+stcdll_ExternalLexer.o: $(srcdir)/scintilla/src/ExternalLexer.cxx
+       $(CXXC) -c -o $@ $(STCDLL_CXXFLAGS) $<
+
 stcdll_Indicator.o: $(srcdir)/scintilla/src/Indicator.cxx
        $(CXXC) -c -o $@ $(STCDLL_CXXFLAGS) $<
 
 stcdll_Indicator.o: $(srcdir)/scintilla/src/Indicator.cxx
        $(CXXC) -c -o $@ $(STCDLL_CXXFLAGS) $<
 
@@ -200,6 +249,9 @@ stcdll_LexConf.o: $(srcdir)/scintilla/src/LexConf.cxx
 stcdll_LexCrontab.o: $(srcdir)/scintilla/src/LexCrontab.cxx
        $(CXXC) -c -o $@ $(STCDLL_CXXFLAGS) $<
 
 stcdll_LexCrontab.o: $(srcdir)/scintilla/src/LexCrontab.cxx
        $(CXXC) -c -o $@ $(STCDLL_CXXFLAGS) $<
 
+stcdll_LexEScript.o: $(srcdir)/scintilla/src/LexEScript.cxx
+       $(CXXC) -c -o $@ $(STCDLL_CXXFLAGS) $<
+
 stcdll_LexEiffel.o: $(srcdir)/scintilla/src/LexEiffel.cxx
        $(CXXC) -c -o $@ $(STCDLL_CXXFLAGS) $<
 
 stcdll_LexEiffel.o: $(srcdir)/scintilla/src/LexEiffel.cxx
        $(CXXC) -c -o $@ $(STCDLL_CXXFLAGS) $<
 
@@ -212,6 +264,9 @@ stcdll_LexHTML.o: $(srcdir)/scintilla/src/LexHTML.cxx
 stcdll_LexLisp.o: $(srcdir)/scintilla/src/LexLisp.cxx
        $(CXXC) -c -o $@ $(STCDLL_CXXFLAGS) $<
 
 stcdll_LexLisp.o: $(srcdir)/scintilla/src/LexLisp.cxx
        $(CXXC) -c -o $@ $(STCDLL_CXXFLAGS) $<
 
+stcdll_LexLout.o: $(srcdir)/scintilla/src/LexLout.cxx
+       $(CXXC) -c -o $@ $(STCDLL_CXXFLAGS) $<
+
 stcdll_LexLua.o: $(srcdir)/scintilla/src/LexLua.cxx
        $(CXXC) -c -o $@ $(STCDLL_CXXFLAGS) $<
 
 stcdll_LexLua.o: $(srcdir)/scintilla/src/LexLua.cxx
        $(CXXC) -c -o $@ $(STCDLL_CXXFLAGS) $<
 
@@ -281,9 +336,9 @@ stcdll_XPM.o: $(srcdir)/scintilla/src/XPM.cxx
 stcdll_stc.o: $(srcdir)/stc.cpp
        $(CXXC) -c -o $@ $(STCDLL_CXXFLAGS) $<
 
 stcdll_stc.o: $(srcdir)/stc.cpp
        $(CXXC) -c -o $@ $(STCDLL_CXXFLAGS) $<
 
-@COND_SHARED_0@$(top_builddir)lib/libwx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc-2.5.a: stclib_PlatWX.o stclib_ScintillaWX.o stclib_stc.o stclib_AutoComplete.o stclib_CallTip.o stclib_CellBuffer.o stclib_ContractionState.o stclib_Document.o stclib_DocumentAccessor.o stclib_Editor.o stclib_Indicator.o stclib_KeyMap.o stclib_KeyWords.o stclib_LexAVE.o stclib_LexAda.o stclib_LexAsm.o stclib_LexBaan.o stclib_LexBullant.o stclib_LexCPP.o stclib_LexCSS.o stclib_LexConf.o stclib_LexCrontab.o stclib_LexEiffel.o stclib_LexFortran.o stclib_LexHTML.o stclib_LexLisp.o stclib_LexLua.o stclib_LexMatlab.o stclib_LexOthers.o stclib_LexPOV.o stclib_LexPascal.o stclib_LexPerl.o stclib_LexPython.o stclib_LexRuby.o stclib_LexSQL.o stclib_LexVB.o stclib_LineMarker.o stclib_PropSet.o stclib_RESearch.o stclib_ScintillaBase.o stclib_Style.o stclib_StyleContext.o stclib_UniConversion.o stclib_ViewStyle.o stclib_WindowAccessor.o stclib_XPM.o
+@COND_SHARED_0@$(top_builddir)lib/libwx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc-2.5$(HOST_SUFFIX).a: stclib_PlatWX.o stclib_ScintillaWX.o stclib_stc.o stclib_AutoComplete.o stclib_CallTip.o stclib_CellBuffer.o stclib_ContractionState.o stclib_Document.o stclib_DocumentAccessor.o stclib_Editor.o stclib_ExternalLexer.o stclib_Indicator.o stclib_KeyMap.o stclib_KeyWords.o stclib_LexAVE.o stclib_LexAda.o stclib_LexAsm.o stclib_LexBaan.o stclib_LexBullant.o stclib_LexCPP.o stclib_LexCSS.o stclib_LexConf.o stclib_LexCrontab.o stclib_LexEiffel.o stclib_LexEScript.o stclib_LexFortran.o stclib_LexHTML.o stclib_LexLisp.o stclib_LexLout.o stclib_LexLua.o stclib_LexMatlab.o stclib_LexOthers.o stclib_LexPOV.o stclib_LexPascal.o stclib_LexPerl.o stclib_LexPython.o stclib_LexRuby.o stclib_LexSQL.o stclib_LexVB.o stclib_LineMarker.o stclib_PropSet.o stclib_RESearch.o stclib_ScintillaBase.o stclib_Style.o stclib_StyleContext.o stclib_UniConversion.o stclib_ViewStyle.o stclib_WindowAccessor.o stclib_XPM.o
 @COND_SHARED_0@        rm -f $@
 @COND_SHARED_0@        rm -f $@
-@COND_SHARED_0@        $(AR) rcu $@  stclib_PlatWX.o stclib_ScintillaWX.o stclib_stc.o stclib_AutoComplete.o stclib_CallTip.o stclib_CellBuffer.o stclib_ContractionState.o stclib_Document.o stclib_DocumentAccessor.o stclib_Editor.o stclib_Indicator.o stclib_KeyMap.o stclib_KeyWords.o stclib_LexAVE.o stclib_LexAda.o stclib_LexAsm.o stclib_LexBaan.o stclib_LexBullant.o stclib_LexCPP.o stclib_LexCSS.o stclib_LexConf.o stclib_LexCrontab.o stclib_LexEiffel.o stclib_LexFortran.o stclib_LexHTML.o stclib_LexLisp.o stclib_LexLua.o stclib_LexMatlab.o stclib_LexOthers.o stclib_LexPOV.o stclib_LexPascal.o stclib_LexPerl.o stclib_LexPython.o stclib_LexRuby.o stclib_LexSQL.o stclib_LexVB.o stclib_LineMarker.o stclib_PropSet.o stclib_RESearch.o stclib_ScintillaBase.o stclib_Style.o stclib_StyleContext.o stclib_UniConversion.o stclib_ViewStyle.o stclib_WindowAccessor.o stclib_XPM.o
+@COND_SHARED_0@        $(AR) rcu $@  stclib_PlatWX.o stclib_ScintillaWX.o stclib_stc.o stclib_AutoComplete.o stclib_CallTip.o stclib_CellBuffer.o stclib_ContractionState.o stclib_Document.o stclib_DocumentAccessor.o stclib_Editor.o stclib_ExternalLexer.o stclib_Indicator.o stclib_KeyMap.o stclib_KeyWords.o stclib_LexAVE.o stclib_LexAda.o stclib_LexAsm.o stclib_LexBaan.o stclib_LexBullant.o stclib_LexCPP.o stclib_LexCSS.o stclib_LexConf.o stclib_LexCrontab.o stclib_LexEiffel.o stclib_LexEScript.o stclib_LexFortran.o stclib_LexHTML.o stclib_LexLisp.o stclib_LexLout.o stclib_LexLua.o stclib_LexMatlab.o stclib_LexOthers.o stclib_LexPOV.o stclib_LexPascal.o stclib_LexPerl.o stclib_LexPython.o stclib_LexRuby.o stclib_LexSQL.o stclib_LexVB.o stclib_LineMarker.o stclib_PropSet.o stclib_RESearch.o stclib_ScintillaBase.o stclib_Style.o stclib_StyleContext.o stclib_UniConversion.o stclib_ViewStyle.o stclib_WindowAccessor.o stclib_XPM.o
 @COND_SHARED_0@        $(RANLIB) $@
 
 stclib_AutoComplete.o: $(srcdir)/scintilla/src/AutoComplete.cxx
 @COND_SHARED_0@        $(RANLIB) $@
 
 stclib_AutoComplete.o: $(srcdir)/scintilla/src/AutoComplete.cxx
@@ -307,6 +362,9 @@ stclib_DocumentAccessor.o: $(srcdir)/scintilla/src/DocumentAccessor.cxx
 stclib_Editor.o: $(srcdir)/scintilla/src/Editor.cxx
        $(CXXC) -c -o $@ $(STCLIB_CXXFLAGS) $<
 
 stclib_Editor.o: $(srcdir)/scintilla/src/Editor.cxx
        $(CXXC) -c -o $@ $(STCLIB_CXXFLAGS) $<
 
+stclib_ExternalLexer.o: $(srcdir)/scintilla/src/ExternalLexer.cxx
+       $(CXXC) -c -o $@ $(STCLIB_CXXFLAGS) $<
+
 stclib_Indicator.o: $(srcdir)/scintilla/src/Indicator.cxx
        $(CXXC) -c -o $@ $(STCLIB_CXXFLAGS) $<
 
 stclib_Indicator.o: $(srcdir)/scintilla/src/Indicator.cxx
        $(CXXC) -c -o $@ $(STCLIB_CXXFLAGS) $<
 
@@ -343,6 +401,9 @@ stclib_LexConf.o: $(srcdir)/scintilla/src/LexConf.cxx
 stclib_LexCrontab.o: $(srcdir)/scintilla/src/LexCrontab.cxx
        $(CXXC) -c -o $@ $(STCLIB_CXXFLAGS) $<
 
 stclib_LexCrontab.o: $(srcdir)/scintilla/src/LexCrontab.cxx
        $(CXXC) -c -o $@ $(STCLIB_CXXFLAGS) $<
 
+stclib_LexEScript.o: $(srcdir)/scintilla/src/LexEScript.cxx
+       $(CXXC) -c -o $@ $(STCLIB_CXXFLAGS) $<
+
 stclib_LexEiffel.o: $(srcdir)/scintilla/src/LexEiffel.cxx
        $(CXXC) -c -o $@ $(STCLIB_CXXFLAGS) $<
 
 stclib_LexEiffel.o: $(srcdir)/scintilla/src/LexEiffel.cxx
        $(CXXC) -c -o $@ $(STCLIB_CXXFLAGS) $<
 
@@ -355,6 +416,9 @@ stclib_LexHTML.o: $(srcdir)/scintilla/src/LexHTML.cxx
 stclib_LexLisp.o: $(srcdir)/scintilla/src/LexLisp.cxx
        $(CXXC) -c -o $@ $(STCLIB_CXXFLAGS) $<
 
 stclib_LexLisp.o: $(srcdir)/scintilla/src/LexLisp.cxx
        $(CXXC) -c -o $@ $(STCLIB_CXXFLAGS) $<
 
+stclib_LexLout.o: $(srcdir)/scintilla/src/LexLout.cxx
+       $(CXXC) -c -o $@ $(STCLIB_CXXFLAGS) $<
+
 stclib_LexLua.o: $(srcdir)/scintilla/src/LexLua.cxx
        $(CXXC) -c -o $@ $(STCLIB_CXXFLAGS) $<
 
 stclib_LexLua.o: $(srcdir)/scintilla/src/LexLua.cxx
        $(CXXC) -c -o $@ $(STCLIB_CXXFLAGS) $<
 
index bcb44e5bc34d39b20b503c08721a019df861af86..eb21c76bb2b8f7ca4340870310cf39acb3ec9feb 100644 (file)
@@ -1062,6 +1062,13 @@ void Menu::Show(Point pt, Window &w) {
 
 //----------------------------------------------------------------------
 
 
 //----------------------------------------------------------------------
 
+DynamicLibrary *DynamicLibrary::Load(const char *modulePath) {
+    wxFAIL_MSG(wxT("Dynamic lexer loading not implemented yet"));
+    return NULL;
+}
+
+//----------------------------------------------------------------------
+
 ColourDesired Platform::Chrome() {
     wxColour c;
     c = wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE);
 ColourDesired Platform::Chrome() {
     wxColour c;
     c = wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE);
index 059dd4afaae05a5d43f6a991792d3eeffd47bee8..3e5ebf0aa601b080725de47a78aae96f1b384435 100644 (file)
@@ -16,6 +16,7 @@
 
 
 #include "ScintillaWX.h"
 
 
 #include "ScintillaWX.h"
+#include "ExternalLexer.h"
 #include "wx/stc/stc.h"
 #include "PlatWX.h"
 
 #include "wx/stc/stc.h"
 #include "PlatWX.h"
 
@@ -337,12 +338,7 @@ void ScintillaWX::Copy() {
     if (currentPos != anchor) {
         SelectionText st;
         CopySelectionRange(&st);
     if (currentPos != anchor) {
         SelectionText st;
         CopySelectionRange(&st);
-        if (wxTheClipboard->Open()) {
-            wxTheClipboard->UsePrimarySelection(FALSE);
-            wxString text = stc2wx(st.s, st.len);
-            wxTheClipboard->SetData(new wxTextDataObject(text));
-            wxTheClipboard->Close();
-        }
+        CopyToClipboard(st);
     }
 }
 
     }
 }
 
@@ -372,6 +368,16 @@ void ScintillaWX::Paste() {
 }
 
 
 }
 
 
+void ScintillaWX::CopyToClipboard(const SelectionText& st) {
+    if (wxTheClipboard->Open()) {
+        wxTheClipboard->UsePrimarySelection(FALSE);
+        wxString text = stc2wx(st.s, st.len);
+        wxTheClipboard->SetData(new wxTextDataObject(text));
+        wxTheClipboard->Close();
+    }
+}
+
+
 bool ScintillaWX::CanPaste() {
     bool canPaste = FALSE;
     bool didOpen;
 bool ScintillaWX::CanPaste() {
     bool canPaste = FALSE;
     bool didOpen;
@@ -474,6 +480,11 @@ long ScintillaWX::WndProc(unsigned int iMessage, unsigned long wParam, long lPar
           break;
       }
 
           break;
       }
 
+#ifdef SCI_LEXER
+       case SCI_LOADLEXERLIBRARY:
+            LexerManager::GetInstance()->Load((const char*)lParam);
+            break;
+#endif
       default:
           return ScintillaBase::WndProc(iMessage, wParam, lParam);
       }
       default:
           return ScintillaBase::WndProc(iMessage, wParam, lParam);
       }
index 4c6b35c6e3276e05ca65aa4743b1284a840829bb..506fa252d5185ee58a38d5f586d49e598f89b3a1 100644 (file)
@@ -100,6 +100,8 @@ public:
     virtual bool ModifyScrollBars(int nMax, int nPage);
     virtual void Copy();
     virtual void Paste();
     virtual bool ModifyScrollBars(int nMax, int nPage);
     virtual void Copy();
     virtual void Paste();
+    virtual void CopyToClipboard(const SelectionText &selectedText);
+
     virtual void CreateCallTipWindow(PRectangle rc);
     virtual void AddToPopUp(const char *label, int cmd = 0, bool enabled = true);
     virtual void ClaimSelection();
     virtual void CreateCallTipWindow(PRectangle rc);
     virtual void AddToPopUp(const char *label, int cmd = 0, bool enabled = true);
     virtual void ClaimSelection();
index 4f5b08f1cb81993e00bd72d2e1ddc16512ae23c2..bba521448edeccdec80c79562152a0ff2fb3ac18 100644 (file)
@@ -3,4 +3,4 @@ scintilla/include directories from the Scintilla/SCiTE source
 distribution.  All other code needed to implement Scintilla on top of
 wxWindows is located in the directory above this one.
 
 distribution.  All other code needed to implement Scintilla on top of
 wxWindows is located in the directory above this one.
 
-The current version of the Scintilla code is 1.52
+The current version of the Scintilla code is 1.53
index 7f5985c7657bd39d2fec7197cd487aa1be985bd6..4f7ba2357c3230fe6386b6335f7e5393cb457ae3 100644 (file)
@@ -57,6 +57,7 @@ typedef void *SurfaceID;
 typedef void *WindowID;
 typedef void *MenuID;
 typedef void *TickerID;
 typedef void *WindowID;
 typedef void *MenuID;
 typedef void *TickerID;
+typedef void *Function;
 
 /**
  * A geometric point class.
 
 /**
  * A geometric point class.
@@ -434,6 +435,23 @@ public:
        double Duration(bool reset=false);
 };
 
        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.
 /**
  * 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.
index 3f1b64f77fc89ea026e39a9730cfc157e441c6e2..1a7e2f166536cfb248906cd498759354430f5a51 100644 (file)
@@ -38,7 +38,7 @@ public:
        void SetMultiple(const char *s);
        SString Get(const char *key);
        SString GetExpanded(const char *key);
        void SetMultiple(const char *s);
        SString Get(const char *key);
        SString GetExpanded(const char *key);
-       SString Expand(const char *withVars);
+       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="");
        int GetInt(const char *key, int defaultValue=0);
        SString GetWild(const char *keybase, const char *filename);
        SString GetNewExpand(const char *keybase, const char *filename="");
index e1da492b279f122423d359d340eff396e953e7fb..edf4bd0d2478a49d7582da041f273c51b7c48a1f 100644 (file)
@@ -54,6 +54,8 @@
 #define SCLEX_F77 37
 #define SCLEX_CSS 38
 #define SCLEX_POV 39
 #define SCLEX_F77 37
 #define SCLEX_CSS 38
 #define SCLEX_POV 39
+#define SCLEX_LOUT 40
+#define SCLEX_ESCRIPT 41
 #define SCLEX_AUTOMATIC 1000
 #define SCE_P_DEFAULT 0
 #define SCE_P_COMMENTLINE 1
 #define SCLEX_AUTOMATIC 1000
 #define SCE_P_DEFAULT 0
 #define SCE_P_COMMENTLINE 1
@@ -88,6 +90,7 @@
 #define SCE_C_WORD2 16
 #define SCE_C_COMMENTDOCKEYWORD 17
 #define SCE_C_COMMENTDOCKEYWORDERROR 18
 #define SCE_C_WORD2 16
 #define SCE_C_COMMENTDOCKEYWORD 17
 #define SCE_C_COMMENTDOCKEYWORDERROR 18
+#define SCE_C_GLOBALCLASS 19
 #define SCE_H_DEFAULT 0
 #define SCE_H_TAG 1
 #define SCE_H_TAGUNKNOWN 2
 #define SCE_H_DEFAULT 0
 #define SCE_H_TAG 1
 #define SCE_H_TAGUNKNOWN 2
 #define SCE_POV_IDENTIFIER 8
 #define SCE_POV_BRACE 9
 #define SCE_POV_WORD2 10
 #define SCE_POV_IDENTIFIER 8
 #define SCE_POV_BRACE 9
 #define SCE_POV_WORD2 10
+#define SCE_LOUT_DEFAULT 0
+#define SCE_LOUT_COMMENT 1
+#define SCE_LOUT_NUMBER 2
+#define SCE_LOUT_WORD 3
+#define SCE_LOUT_WORD2 4
+#define SCE_LOUT_WORD3 5
+#define SCE_LOUT_WORD4 6
+#define SCE_LOUT_STRING 7
+#define SCE_LOUT_OPERATOR 8
+#define SCE_LOUT_IDENTIFIER 9
+#define SCE_LOUT_STRINGEOL 10
+#define SCE_ESCRIPT_DEFAULT 0
+#define SCE_ESCRIPT_COMMENT 1
+#define SCE_ESCRIPT_COMMENTLINE 2
+#define SCE_ESCRIPT_COMMENTDOC 3
+#define SCE_ESCRIPT_NUMBER 4
+#define SCE_ESCRIPT_WORD 5
+#define SCE_ESCRIPT_STRING 6
+#define SCE_ESCRIPT_OPERATOR 7
+#define SCE_ESCRIPT_IDENTIFIER 8
+#define SCE_ESCRIPT_BRACE 9
+#define SCE_ESCRIPT_WORD2 10
+#define SCE_ESCRIPT_WORD3 11
 //--Autogenerated -- end of section automatically generated from Scintilla.iface
 
 #endif
 //--Autogenerated -- end of section automatically generated from Scintilla.iface
 
 #endif
index c377d07cc20a90b6957832351f25b69d4b4dda77..250f793142b885bc75588c8dcdec876a7f969b40 100644 (file)
@@ -464,6 +464,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
 #define SCI_LINEENDWRAPEXTEND 2452
 #define SCI_VCHOMEWRAP 2453
 #define SCI_VCHOMEWRAPEXTEND 2454
 #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_MOVECARETINSIDEVIEW 2401
 #define SCI_LINELENGTH 2350
 #define SCI_BRACEHIGHLIGHT 2351
@@ -535,6 +536,10 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
 #define SCI_PARADOWNEXTEND 2414
 #define SCI_PARAUP 2415
 #define SCI_PARAUPEXTEND 2416
 #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 SCI_STARTRECORD 3001
 #define SCI_STOPRECORD 3002
 #define SCI_SETLEXER 4001
 #define SCI_STARTRECORD 3001
 #define SCI_STOPRECORD 3002
 #define SCI_SETLEXER 4001
index c5dacbdf048033cd972491020e66635bb7f88c05..2ac0b66f5037c478861b2ad75add2980948547be 100644 (file)
@@ -1231,6 +1231,9 @@ fun void LineEndWrapExtend=2452(,)
 fun void VCHomeWrap=2453(,)
 fun void VCHomeWrapExtend=2454(,)
 
 fun void VCHomeWrap=2453(,)
 fun void VCHomeWrapExtend=2454(,)
 
+# Copy the line containing the caret.
+fun void LineCopy=2455(,)
+
 # Move the caret inside current view if it's not there already.
 fun void MoveCaretInsideView=2401(,)
 
 # Move the caret inside current view if it's not there already.
 fun void MoveCaretInsideView=2401(,)
 
@@ -1441,6 +1444,20 @@ fun void ParaDownExtend=2414(,)
 fun void ParaUp=2415(,)
 fun void ParaUpExtend=2416(,)
 
 fun void ParaUp=2415(,)
 fun void ParaUpExtend=2416(,)
 
+# Given a valid document position, return the previous position taking code
+# page into account. Returns 0 if passed 0.
+fun position PositionBefore=2417(position pos,)
+
+# Given a valid document position, return the next position taking code
+# page into account. Maximum value returned is the last position in the document.
+fun position PositionAfter=2418(position pos,)
+
+# Copy a range of text to the clipboard. Positions are clipped into the document.
+fun void CopyRange=2419(position start, position end)
+
+# Copy argument text to the clipboard.
+fun void CopyText=2420(int length, string text)
+
 # Start notifying the container of all key presses and commands.
 fun void StartRecord=3001(,)
 
 # Start notifying the container of all key presses and commands.
 fun void StartRecord=3001(,)
 
@@ -1466,7 +1483,6 @@ set void SetKeyWords=4005(int keywordSet, string keyWords)
 set void SetLexerLanguage=4006(, string language)
 
 # Load a lexer library (dll / so)
 set void SetLexerLanguage=4006(, string language)
 
 # Load a lexer library (dll / so)
-# NOT YET IMPLEMENTED
 fun void LoadLexerLibrary=4007(, string path)
 
 # Notifications
 fun void LoadLexerLibrary=4007(, string path)
 
 # Notifications
@@ -1566,6 +1582,8 @@ val SCLEX_FORTRAN=36
 val SCLEX_F77=37
 val SCLEX_CSS=38
 val SCLEX_POV=39
 val SCLEX_F77=37
 val SCLEX_CSS=38
 val SCLEX_POV=39
+val SCLEX_LOUT=40
+val SCLEX_ESCRIPT=41
 
 # When a lexer specifies its language as SCLEX_AUTOMATIC it receives a
 # value assigned in sequence from SCLEX_AUTOMATIC+1.
 
 # When a lexer specifies its language as SCLEX_AUTOMATIC it receives a
 # value assigned in sequence from SCLEX_AUTOMATIC+1.
@@ -1612,6 +1630,7 @@ val SCE_C_COMMENTLINEDOC=15
 val SCE_C_WORD2=16
 val SCE_C_COMMENTDOCKEYWORD=17
 val SCE_C_COMMENTDOCKEYWORDERROR=18
 val SCE_C_WORD2=16
 val SCE_C_COMMENTDOCKEYWORD=17
 val SCE_C_COMMENTDOCKEYWORDERROR=18
+val SCE_C_GLOBALCLASS=19
 # Lexical states for SCLEX_HTML, SCLEX_XML
 lex HTML=SCLEX_HTML SCE_H
 lex XML=SCLEX_XML SCE_H
 # Lexical states for SCLEX_HTML, SCLEX_XML
 lex HTML=SCLEX_HTML SCE_H
 lex XML=SCLEX_XML SCE_H
@@ -2047,6 +2066,34 @@ val SCE_POV_OPERATOR=7
 val SCE_POV_IDENTIFIER=8
 val SCE_POV_BRACE=9
 val SCE_POV_WORD2=10
 val SCE_POV_IDENTIFIER=8
 val SCE_POV_BRACE=9
 val SCE_POV_WORD2=10
+# Lexical states for SCLEX_LOUT
+lex LOUT=SCLEX_LOUT SCE_LOUT_
+val SCE_LOUT_DEFAULT=0
+val SCE_LOUT_COMMENT=1
+val SCE_LOUT_NUMBER=2
+val SCE_LOUT_WORD=3
+val SCE_LOUT_WORD2=4
+val SCE_LOUT_WORD3=5
+val SCE_LOUT_WORD4=6
+val SCE_LOUT_STRING=7
+val SCE_LOUT_OPERATOR=8
+val SCE_LOUT_IDENTIFIER=9
+val SCE_LOUT_STRINGEOL=10
+# Lexical states for SCLEX_ESCRIPT
+lex ESCRIPT=SCLEX_ESCRIPT SCE_ESCRIPT_
+val SCE_ESCRIPT_DEFAULT=0
+val SCE_ESCRIPT_COMMENT=1
+val SCE_ESCRIPT_COMMENTLINE=2
+val SCE_ESCRIPT_COMMENTDOC=3
+val SCE_ESCRIPT_NUMBER=4
+val SCE_ESCRIPT_WORD=5
+val SCE_ESCRIPT_STRING=6
+val SCE_ESCRIPT_OPERATOR=7
+val SCE_ESCRIPT_IDENTIFIER=8
+val SCE_ESCRIPT_BRACE=9
+val SCE_ESCRIPT_WORD2=10
+val SCE_ESCRIPT_WORD3=11
+
 # Events
 
 evt void StyleNeeded=2000(int position)
 # Events
 
 evt void StyleNeeded=2000(int position)
index 20900bcf97ab4ea310e0c89d167fa4857ceff822..98fc6b330ca986d3ed15b0d556bdf7f9784d09f3 100644 (file)
@@ -265,7 +265,7 @@ int Document::LenChar(int pos) {
                return 1;
        }
 }
                return 1;
        }
 }
-
+#include <assert.h>
 // Normalise a position so that it is not halfway through a two byte character.
 // This can occur in two situations -
 // When lines are terminated with \r\n pairs which should be treated as one character.
 // Normalise a position so that it is not halfway through a two byte character.
 // This can occur in two situations -
 // When lines are terminated with \r\n pairs which should be treated as one character.
@@ -273,17 +273,11 @@ int Document::LenChar(int pos) {
 // If moving, move the position in the indicated direction.
 int Document::MovePositionOutsideChar(int pos, int moveDir, bool checkLineEnd) {
        //Platform::DebugPrintf("NoCRLF %d %d\n", pos, moveDir);
 // If moving, move the position in the indicated direction.
 int Document::MovePositionOutsideChar(int pos, int moveDir, bool checkLineEnd) {
        //Platform::DebugPrintf("NoCRLF %d %d\n", pos, moveDir);
-       // If out of range, just return value - should be fixed up after
-       if (pos < 0)
-               return pos;
-       if (pos > Length())
-               return pos;
-
-       // Position 0 and Length() can not be between any two characters
-       if (pos == 0)
-               return pos;
-       if (pos == Length())
-               return pos;
+       // If out of range, just return minimum/maximum value.
+       if (pos <= 0)
+               return 0;
+       if (pos >= Length())
+               return Length();
 
        // assert pos > 0 && pos < Length()
        if (checkLineEnd && IsCrLf(pos - 1)) {
 
        // assert pos > 0 && pos < Length()
        if (checkLineEnd && IsCrLf(pos - 1)) {
@@ -309,29 +303,26 @@ int Document::MovePositionOutsideChar(int pos, int moveDir, bool checkLineEnd) {
                } else {
                        // Anchor DBCS calculations at start of line because start of line can
                        // not be a DBCS trail byte.
                } else {
                        // Anchor DBCS calculations at start of line because start of line can
                        // not be a DBCS trail byte.
-                       int startLine = pos;
-
-                       while (startLine > 0 && cb.CharAt(startLine) != '\r' && cb.CharAt(startLine) != '\n')
-                               startLine--;
-                       while (startLine < pos) {
+                       int posCheck = LineStart(LineFromPosition(pos));
+                       while (posCheck < pos) {
                                char mbstr[maxBytesInDBCSCharacter+1];
                                int i;
                                for(i=0;i<Platform::DBCSCharMaxLength();i++) {
                                char mbstr[maxBytesInDBCSCharacter+1];
                                int i;
                                for(i=0;i<Platform::DBCSCharMaxLength();i++) {
-                                       mbstr[i] = cb.CharAt(startLine+i);
+                                       mbstr[i] = cb.CharAt(posCheck+i);
                                }
                                mbstr[i] = '\0';
 
                                int mbsize = Platform::DBCSCharLength(dbcsCodePage, mbstr);
                                }
                                mbstr[i] = '\0';
 
                                int mbsize = Platform::DBCSCharLength(dbcsCodePage, mbstr);
-                               if (startLine + mbsize == pos) {
+                               if (posCheck + mbsize == pos) {
                                        return pos;
                                        return pos;
-                               } else if (startLine + mbsize > pos) {
+                               } else if (posCheck + mbsize > pos) {
                                        if (moveDir > 0) {
                                        if (moveDir > 0) {
-                                               return startLine + mbsize;
+                                               return posCheck + mbsize;
                                        } else {
                                        } else {
-                                               return startLine;
+                                               return posCheck;
                                        }
                                }
                                        }
                                }
-                               startLine += mbsize;
+                               posCheck += mbsize;
                        }
                }
        }
                        }
                }
        }
index e6b7df0be15e857df1c9a92f50b2606537aba1cf..cc53f5aac85cdea2e0f00ef5b502dc96f92f14df 100644 (file)
@@ -1,7 +1,6 @@
 // Scintilla source code edit control
 /** @file Editor.cxx
  ** Main code for the edit control.
 // Scintilla source code edit control
 /** @file Editor.cxx
  ** Main code for the edit control.
-       Last change:  JS   18 Jun 103    1:08 am
  **/
 // Copyright 1998-2003 by Neil Hodgson <neilh@scintilla.org>
 // The License.txt file describes the conditions under which this software may be distributed.
  **/
 // Copyright 1998-2003 by Neil Hodgson <neilh@scintilla.org>
 // The License.txt file describes the conditions under which this software may be distributed.
@@ -712,7 +711,9 @@ void Editor::RedrawRect(PRectangle rc) {
 
 void Editor::Redraw() {
        //Platform::DebugPrintf("Redraw all\n");
 
 void Editor::Redraw() {
        //Platform::DebugPrintf("Redraw all\n");
-       wMain.InvalidateAll();
+       PRectangle rcClient = GetClientRectangle();
+       wMain.InvalidateRectangle(rcClient);
+       //wMain.InvalidateAll();
 }
 
 void Editor::RedrawSelMargin() {
 }
 
 void Editor::RedrawSelMargin() {
@@ -1577,8 +1578,15 @@ void Editor::PaintSelMargin(Surface *surfWindow, PRectangle &rc) {
                                        number[0] = '\0';
                                        if (firstSubLine)
                                                sprintf(number, "%d", lineDoc + 1);
                                        number[0] = '\0';
                                        if (firstSubLine)
                                                sprintf(number, "%d", lineDoc + 1);
-                                       if (foldFlags & SC_FOLDFLAG_LEVELNUMBERS)
-                                               sprintf(number, "%X", pdoc->GetLevel(lineDoc));
+                                       if (foldFlags & SC_FOLDFLAG_LEVELNUMBERS) {
+                                               int lev = pdoc->GetLevel(lineDoc);
+                                               sprintf(number, "%c%c %03X %03X",
+                                                       (lev & SC_FOLDLEVELHEADERFLAG) ? 'H' : '_',
+                                                       (lev & SC_FOLDLEVELWHITEFLAG) ? 'W' : '_',
+                                                       lev & SC_FOLDLEVELNUMBERMASK,
+                                                       lev >> 16
+                                               );
+                                       }
                                        PRectangle rcNumber = rcMarker;
                                        // Right justify
                                        int width = surface->WidthText(vs.styles[STYLE_LINENUMBER].font, number, strlen(number));
                                        PRectangle rcNumber = rcMarker;
                                        // Right justify
                                        int width = surface->WidthText(vs.styles[STYLE_LINENUMBER].font, number, strlen(number));
@@ -2354,11 +2362,6 @@ void Editor::Paint(Surface *surfaceWindow, PRectangle rcArea) {
                }
        }
 
                }
        }
 
-        // Workaround by JACS: sometimes due to a re-entry condition,
-        // pixmapLine becomes uninitialised, followed by a crash.
-        if (!pixmapLine->Initialised())
-                return;
-
        PRectangle rcRightMargin = rcClient;
        rcRightMargin.left = rcRightMargin.right - vs.rightMarginWidth;
        if (rcArea.Intersects(rcRightMargin)) {
        PRectangle rcRightMargin = rcClient;
        rcRightMargin.left = rcRightMargin.right - vs.rightMarginWidth;
        if (rcArea.Intersects(rcRightMargin)) {
@@ -2482,7 +2485,7 @@ void Editor::Paint(Surface *surfaceWindow, PRectangle rcArea) {
                                } else {
                                        int FoldLevelCurr = (pdoc->GetLevel(lineDoc) & SC_FOLDLEVELNUMBERMASK) - SC_FOLDLEVELBASE;
                                        int FoldLevelPrev = (pdoc->GetLevel(lineDoc - 1) & SC_FOLDLEVELNUMBERMASK) - SC_FOLDLEVELBASE;
                                } else {
                                        int FoldLevelCurr = (pdoc->GetLevel(lineDoc) & SC_FOLDLEVELNUMBERMASK) - SC_FOLDLEVELBASE;
                                        int FoldLevelPrev = (pdoc->GetLevel(lineDoc - 1) & SC_FOLDLEVELNUMBERMASK) - SC_FOLDLEVELBASE;
-                                       int FoldLevelFlags = (pdoc->GetLevel(lineDoc) & ~SC_FOLDLEVELNUMBERMASK);
+                                       int FoldLevelFlags = (pdoc->GetLevel(lineDoc) & ~SC_FOLDLEVELNUMBERMASK) & ~(0xFFF0000);
                                        int indentationStep = (pdoc->indentInChars ? pdoc->indentInChars : pdoc->tabInChars);
                                        // Draw line above fold
                                        if ((FoldLevelPrev < FoldLevelCurr)
                                        int indentationStep = (pdoc->indentInChars ? pdoc->indentInChars : pdoc->tabInChars);
                                        // Draw line above fold
                                        if ((FoldLevelPrev < FoldLevelCurr)
@@ -3438,6 +3441,7 @@ void Editor::NotifyMacroRecord(unsigned int iMessage, unsigned long wParam, long
        case SCI_DELWORDRIGHT:
        case SCI_DELLINELEFT:
        case SCI_DELLINERIGHT:
        case SCI_DELWORDRIGHT:
        case SCI_DELLINELEFT:
        case SCI_DELLINERIGHT:
+       case SCI_LINECOPY:
        case SCI_LINECUT:
        case SCI_LINEDELETE:
        case SCI_LINETRANSPOSE:
        case SCI_LINECUT:
        case SCI_LINEDELETE:
        case SCI_LINETRANSPOSE:
@@ -3876,18 +3880,21 @@ int Editor::KeyCommand(unsigned int iMessage) {
                        pdoc->DeleteChars(currentPos, end - currentPos);
                }
                break;
                        pdoc->DeleteChars(currentPos, end - currentPos);
                }
                break;
+       case SCI_LINECOPY: {
+                       int lineStart = pdoc->LineFromPosition(SelectionStart());
+                       int lineEnd = pdoc->LineFromPosition(SelectionEnd());
+                       CopyRangeToClipboard(pdoc->LineStart(lineStart),
+                               pdoc->LineStart(lineEnd + 1));
+               }
+               break;
        case SCI_LINECUT: {
        case SCI_LINECUT: {
-                       int lineStart = pdoc->LineFromPosition(currentPos);
-                       int lineEnd = pdoc->LineFromPosition(anchor);
-                       if (lineStart > lineEnd) {
-                               int t = lineEnd;
-                               lineEnd = lineStart;
-                               lineStart = t;
-                       }
+                       int lineStart = pdoc->LineFromPosition(SelectionStart());
+                       int lineEnd = pdoc->LineFromPosition(SelectionEnd());
                        int start = pdoc->LineStart(lineStart);
                        int end = pdoc->LineStart(lineEnd + 1);
                        SetSelection(start, end);
                        Cut();
                        int start = pdoc->LineStart(lineStart);
                        int end = pdoc->LineStart(lineEnd + 1);
                        SetSelection(start, end);
                        Cut();
+                       SetLastXChosen();
                }
                break;
        case SCI_LINEDELETE: {
                }
                break;
        case SCI_LINEDELETE: {
@@ -4184,10 +4191,14 @@ char *Editor::CopyRange(int start, int end) {
        return text;
 }
 
        return text;
 }
 
+void Editor::CopySelectionFromRange(SelectionText *ss, int start, int end) {
+       ss->Set(CopyRange(start, end), end - start + 1, false);
+}
+
 void Editor::CopySelectionRange(SelectionText *ss) {
 void Editor::CopySelectionRange(SelectionText *ss) {
-       char *text = 0;
-       int size = 0;
        if (selType == selRectangle) {
        if (selType == selRectangle) {
+               char *text = 0;
+               int size = 0;
                int lineStart = pdoc->LineFromPosition(SelectionStart());
                int lineEnd = pdoc->LineFromPosition(SelectionEnd());
                int line;
                int lineStart = pdoc->LineFromPosition(SelectionStart());
                int lineEnd = pdoc->LineFromPosition(SelectionEnd());
                int line;
@@ -4212,11 +4223,24 @@ void Editor::CopySelectionRange(SelectionText *ss) {
                                text[size] = '\0';
                        }
                }
                                text[size] = '\0';
                        }
                }
+               ss->Set(text, size + 1, true);
        } else {
        } else {
-               size = SelectionEnd() - SelectionStart();
-               text = CopyRange(SelectionStart(), SelectionEnd());
+               CopySelectionFromRange(ss, SelectionStart(), SelectionEnd());
        }
        }
-       ss->Set(text, size, selType == selRectangle);
+}
+
+void Editor::CopyRangeToClipboard(int start, int end) {
+       start = pdoc->ClampPositionIntoDocument(start);
+       end = pdoc->ClampPositionIntoDocument(end);
+       SelectionText selectedText;
+       selectedText.Set(CopyRange(start, end), end - start + 1);
+       CopyToClipboard(selectedText);
+}
+
+void Editor::CopyText(int length, const char *text) {
+       SelectionText selectedText;
+       selectedText.Copy(text, length);
+       CopyToClipboard(selectedText);
 }
 
 void Editor::SetDragPosition(int newPos) {
 }
 
 void Editor::SetDragPosition(int newPos) {
@@ -4878,10 +4902,7 @@ void Editor::SetDocPointer(Document *document) {
 
        pdoc->AddWatcher(this, 0);
        Redraw();
 
        pdoc->AddWatcher(this, 0);
        Redraw();
-       // Removed because of reentrance problems of GTK+ 2.x
-       // where changing a scroll bar position causes synchronous
-       // painting before lexer and styling state is set up.
-       //SetScrollBars();
+       SetScrollBars();
 }
 
 // Recursively expand a fold, making lines visible except where they have an unexpanded parent
 }
 
 // Recursively expand a fold, making lines visible except where they have an unexpanded parent
@@ -5046,6 +5067,14 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
                Copy();
                break;
 
                Copy();
                break;
 
+       case SCI_COPYRANGE:
+               CopyRangeToClipboard(wParam, lParam);
+               break;
+
+       case SCI_COPYTEXT:
+               CopyText(wParam, CharPtrFromSPtr(lParam));
+               break;
+
        case SCI_PASTE:
                Paste();
                SetLastXChosen();
        case SCI_PASTE:
                Paste();
                SetLastXChosen();
@@ -5205,6 +5234,12 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
        case SCI_GETSEARCHFLAGS:
                return searchFlags;
 
        case SCI_GETSEARCHFLAGS:
                return searchFlags;
 
+       case SCI_POSITIONBEFORE:
+               return pdoc->MovePositionOutsideChar(wParam-1, -1, true);
+
+       case SCI_POSITIONAFTER:
+               return pdoc->MovePositionOutsideChar(wParam+1, 1, true);
+
        case SCI_LINESCROLL:
                ScrollTo(topLine + lParam);
                HorizontalScrollTo(xOffset + wParam * vs.spaceWidth);
        case SCI_LINESCROLL:
                ScrollTo(topLine + lParam);
                HorizontalScrollTo(xOffset + wParam * vs.spaceWidth);
@@ -6181,6 +6216,7 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
        case SCI_DELWORDRIGHT:
        case SCI_DELLINELEFT:
        case SCI_DELLINERIGHT:
        case SCI_DELWORDRIGHT:
        case SCI_DELLINELEFT:
        case SCI_DELLINERIGHT:
+       case SCI_LINECOPY:
        case SCI_LINECUT:
        case SCI_LINEDELETE:
        case SCI_LINETRANSPOSE:
        case SCI_LINECUT:
        case SCI_LINEDELETE:
        case SCI_LINETRANSPOSE:
index 2cc7930c47d17e27cba1b0b25a5ce437d055be51..bd4669192f7b5690a8877439155509818babf74d 100644 (file)
@@ -133,6 +133,19 @@ public:
                        len = 0;
                rectangular = rectangular_;
        }
                        len = 0;
                rectangular = rectangular_;
        }
+       void Copy(const char *s_, int len_, bool rectangular_=false) {
+               delete []s;
+               s = new char[len_];
+               if (s) {
+                       len = len_;
+                       for (int i = 0; i < len_; i++) {
+                               s[i] = s_[i];
+                       }
+               } else {
+                       len = 0;
+               }
+               rectangular = rectangular_;
+       }
 };
 
 /**
 };
 
 /**
@@ -416,10 +429,14 @@ protected:        // ScintillaBase subclass needs access to much of Editor
        long SearchInTarget(const char *text, int length);
        void GoToLine(int lineNo);
 
        long SearchInTarget(const char *text, int length);
        void GoToLine(int lineNo);
 
+       virtual void CopyToClipboard(const SelectionText &selectedText) = 0;
        char *CopyRange(int start, int end);
        char *CopyRange(int start, int end);
+       void CopySelectionFromRange(SelectionText *ss, int start, int end);
        void CopySelectionRange(SelectionText *ss);
        void CopySelectionRange(SelectionText *ss);
+       void CopyRangeToClipboard(int start, int end);
+       void CopyText(int length, const char *text);
        void SetDragPosition(int newPos);
        void SetDragPosition(int newPos);
-       void DisplayCursor(Window::Cursor c);
+       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.
        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.
diff --git a/contrib/src/stc/scintilla/src/ExternalLexer.cxx b/contrib/src/stc/scintilla/src/ExternalLexer.cxx
new file mode 100644 (file)
index 0000000..88be76f
--- /dev/null
@@ -0,0 +1,256 @@
+// 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 "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)lib->FindFunction("GetLexerCount");
+
+               if (GetLexerCount) {
+                       ExternalLexerModule *lex;
+                       LexerMinder *lm;
+
+                       // Find functions in the DLL
+                       GetLexerNameFn GetLexerName = (GetLexerNameFn)lib->FindFunction("GetLexerName");
+                       ExtLexerFunction Lexer = (ExtLexerFunction)lib->FindFunction("Lex");
+                       ExtFoldFunction Folder = (ExtFoldFunction)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 = first->next;
+               while (cur) {
+                       delete cur;
+                       cur = next;
+               }
+               first = NULL;
+               last = NULL;
+       }
+}
+
+//------------------------------------------
+//
+// LexerManager
+//
+//------------------------------------------
+
+LMMinder::~LMMinder()
+{
+       LexerManager::DeleteInstance();
+}
+
+LMMinder minder;
diff --git a/contrib/src/stc/scintilla/src/ExternalLexer.h b/contrib/src/stc/scintilla/src/ExternalLexer.h
new file mode 100644 (file)
index 0000000..01d9ac7
--- /dev/null
@@ -0,0 +1,103 @@
+// 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
+
+#if PLAT_WX
+#ifdef __WXMSW__
+#define EXT_LEXER_DECL __stdcall
+#else
+#define EXT_LEXER_DECL
+#endif
+#endif
+
+// External Lexer function definitions...
+typedef void (EXT_LEXER_DECL *ExtLexerFunction)(unsigned int lexer, unsigned int startPos, int length, int initStyle,
+                  char *words[], WindowID window, char *props);
+typedef void (EXT_LEXER_DECL *ExtFoldFunction)(unsigned int lexer, unsigned int startPos, int length, int initStyle,
+                  char *words[], WindowID window, char *props);
+typedef void* (EXT_LEXER_DECL *GetLexerFunction)(unsigned int Index);
+typedef int (EXT_LEXER_DECL *GetLexerCountFn)();
+typedef void (EXT_LEXER_DECL *GetLexerNameFn)(unsigned int Index, char *name, int buflength);
+
+//class DynamicLibrary;
+
+/// Sub-class of LexerModule to use an external lexer.
+class ExternalLexerModule : protected LexerModule {
+protected:
+       ExtLexerFunction fneLexer;
+       ExtFoldFunction fneFolder;
+       int externalLanguage;
+       char name[100];
+public:
+       ExternalLexerModule(int language_, LexerFunction fnLexer_,
+               const char *languageName_=0, LexerFunction fnFolder_=0) : LexerModule(language_, fnLexer_, 0, fnFolder_){
+               strncpy(name, languageName_, sizeof(name));
+               languageName = name;
+       };
+       virtual void Lex(unsigned int startPos, int lengthDoc, int initStyle,
+                                       WordList *keywordlists[], Accessor &styler) const;
+       virtual void Fold(unsigned int startPos, int lengthDoc, int initStyle,
+                                       WordList *keywordlists[], Accessor &styler) const;
+       virtual void SetExternal(ExtLexerFunction fLexer, ExtFoldFunction fFolder, int index);
+};
+
+/// LexerMinder points to an ExternalLexerModule - so we don't leak them.
+class LexerMinder {
+public:
+       ExternalLexerModule *self;
+       LexerMinder *next;
+};
+
+/// LexerLibrary exists for every External Lexer DLL, contains LexerMinders.
+class LexerLibrary {
+       DynamicLibrary  *lib;
+       LexerMinder             *first;
+       LexerMinder             *last;
+
+public:
+       LexerLibrary(const char* ModuleName);
+       ~LexerLibrary();
+       void Release();
+
+       LexerLibrary    *next;
+       SString                 m_sModuleName;
+};
+
+/// LexerManager manages external lexers, contains LexerLibrarys.
+class LexerManager {
+public:
+       ~LexerManager();
+
+       static LexerManager *GetInstance();
+       static void DeleteInstance();
+
+       void Load(const char* path);
+       void Clear();
+
+private:
+       LexerManager();
+       static LexerManager *theInstance;
+
+       void LoadLexerLibrary(const char* module);
+       LexerLibrary *first;
+       LexerLibrary *last;
+};
+
+class LMMinder {
+public:
+       ~LMMinder();
+};
+
+#endif
index 12249e5f3c70e903529811febb5d30773b31c82c..f15842af684cc509bbeac2ff8fdfec75c9e98542 100644 (file)
@@ -130,6 +130,7 @@ const KeyToCommand KeyMap::MapDefault[] = {
     //'L',                     SCI_CTRL,               SCI_FORMFEED,
     {'L',                      SCI_CTRL,       SCI_LINECUT},
     {'L',                      SCI_CSHIFT,     SCI_LINEDELETE},
     //'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_LINEDUPLICATE},
     {'U',                      SCI_CTRL,       SCI_LOWERCASE},
     {'T',                      SCI_CTRL,       SCI_LINETRANSPOSE},
     {'D',                      SCI_CTRL,       SCI_LINEDUPLICATE},
     {'U',                      SCI_CTRL,       SCI_LOWERCASE},
index 73ecddf50dc26797a50998d7c8ce9847b155d1d2..8fb51bdb764ea66c13dbabffefbbc9f9f5603fa2 100644 (file)
@@ -112,18 +112,6 @@ void LexerModule::Fold(unsigned int startPos, int lengthDoc, int initStyle,
        }
 }
 
        }
 }
 
-static void ColouriseNullDoc(unsigned int startPos, int length, int, WordList *[],
-                            Accessor &styler) {
-       // Null language means all style bytes are 0 so just mark the end - no need to fill in.
-       if (length > 0) {
-               styler.StartAt(startPos + length - 1);
-               styler.StartSegment(startPos + length - 1);
-               styler.ColourTo(startPos + length - 1, 0);
-       }
-}
-
-LexerModule lmNull(SCLEX_NULL, ColouriseNullDoc, "null");
-
 // Alternative historical name for Scintilla_LinkLexers
 int wxForceScintillaLexers(void) {
        return Scintilla_LinkLexers();
 // Alternative historical name for Scintilla_LinkLexers
 int wxForceScintillaLexers(void) {
        return Scintilla_LinkLexers();
@@ -154,6 +142,7 @@ int Scintilla_LinkLexers() {
        LINK_LEXER(lmCss);
        LINK_LEXER(lmEiffel);
        LINK_LEXER(lmEiffelkw);
        LINK_LEXER(lmCss);
        LINK_LEXER(lmEiffel);
        LINK_LEXER(lmEiffelkw);
+       LINK_LEXER(lmESCRIPT);
        LINK_LEXER(lmFortran);
        LINK_LEXER(lmF77);
        LINK_LEXER(lmHTML);
        LINK_LEXER(lmFortran);
        LINK_LEXER(lmF77);
        LINK_LEXER(lmHTML);
@@ -161,6 +150,7 @@ int Scintilla_LinkLexers() {
        LINK_LEXER(lmASP);
        LINK_LEXER(lmPHP);
        LINK_LEXER(lmLISP);
        LINK_LEXER(lmASP);
        LINK_LEXER(lmPHP);
        LINK_LEXER(lmLISP);
+       LINK_LEXER(lmLout);
        LINK_LEXER(lmLua);
        LINK_LEXER(lmMatlab);
        LINK_LEXER(lmBatch);
        LINK_LEXER(lmLua);
        LINK_LEXER(lmMatlab);
        LINK_LEXER(lmBatch);
@@ -169,6 +159,7 @@ int Scintilla_LinkLexers() {
        LINK_LEXER(lmMake);
        LINK_LEXER(lmErrorList);
        LINK_LEXER(lmLatex);
        LINK_LEXER(lmMake);
        LINK_LEXER(lmErrorList);
        LINK_LEXER(lmLatex);
+       LINK_LEXER(lmNull);
        LINK_LEXER(lmPascal);
        LINK_LEXER(lmPerl);
        LINK_LEXER(lmPOV);
        LINK_LEXER(lmPascal);
        LINK_LEXER(lmPerl);
        LINK_LEXER(lmPOV);
index 661b968cd75c3138b798bea9c369027e73a08367..9c8ea416ae6b3b36063090f26addb4696f7fe626 100644 (file)
@@ -60,6 +60,7 @@ static void ColouriseCppDoc(unsigned int startPos, int length, int initStyle, Wo
        WordList &keywords = *keywordlists[0];
        WordList &keywords2 = *keywordlists[1];
        WordList &keywords3 = *keywordlists[2];
        WordList &keywords = *keywordlists[0];
        WordList &keywords2 = *keywordlists[1];
        WordList &keywords3 = *keywordlists[2];
+       WordList &keywords4 = *keywordlists[3];
 
        bool stylingWithinPreprocessor = styler.GetPropertyInt("styling.within.preprocessor") != 0;
 
 
        bool stylingWithinPreprocessor = styler.GetPropertyInt("styling.within.preprocessor") != 0;
 
@@ -111,6 +112,8 @@ static void ColouriseCppDoc(unsigned int startPos, int length, int initStyle, Wo
                                        sc.ChangeState(SCE_C_WORD);
                                } else if (keywords2.InList(s)) {
                                        sc.ChangeState(SCE_C_WORD2);
                                        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);
                        }
                                }
                                sc.SetState(SCE_C_DEFAULT);
                        }
@@ -279,237 +282,23 @@ static bool IsStreamCommentStyle(int style) {
               style == SCE_C_COMMENTDOCKEYWORDERROR;
 }
 
               style == SCE_C_COMMENTDOCKEYWORDERROR;
 }
 
-static bool matchKeyword(unsigned int start, WordList &keywords, Accessor &styler, int keywordtype) {
-       bool FoundKeyword = false;
-
-       for (unsigned int i = 0;
-               strlen(keywords[i]) > 0 && !FoundKeyword;
-               i++) {
-               if (atoi(keywords[i]) == keywordtype) {
-                       FoundKeyword = styler.Match(start, ((char *)keywords[i]) + 2);
-               }
-       }
-       return FoundKeyword;
-}
-
-static bool IsCommentLine(int line, Accessor &styler) {
-       unsigned int Pos = styler.LineStart(line);
-       while (styler.GetLine(Pos) == line) {
-               int PosStyle = styler.StyleAt(Pos);
-
-               if (    !IsStreamCommentStyle(PosStyle)
-                       &&
-                       PosStyle != SCE_C_COMMENTLINEDOC
-                       &&
-                       PosStyle != SCE_C_COMMENTLINE
-                       &&
-                       !IsASpace(styler.SafeGetCharAt(Pos))
-                  )
-                       return false;
-               Pos++;
-       }
-
-       return true;
-}
-
-static void FoldBoxCppDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[],
-                          Accessor &styler) {
-
-       WordList &keywords4 = *keywordlists[3];
-
-       bool foldComment = styler.GetPropertyInt("fold.comment") != 0;
-       bool foldPreprocessor = styler.GetPropertyInt("fold.preprocessor") != 0;
-       bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0;
-       bool firstLine = true;
-       unsigned int endPos = startPos + length;
-       int visibleChars = 0;
-       int lineCurrent = styler.GetLine(startPos);
-       int levelPrev = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK;
-       int levelCurrent = levelPrev;
-       int levelPrevPrev;
-       int levelFlags = 0;
-       int levelUnindent = 0;
-       char chNext = styler[startPos];
-       int styleNext = styler.StyleAt(startPos);
-       int style = initStyle;
-
-       if (lineCurrent == 0) {
-               levelPrevPrev = levelPrev;
-       } else {
-               levelPrevPrev = styler.LevelAt(lineCurrent - 1) & SC_FOLDLEVELNUMBERMASK;
-       }
-
-       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_C_COMMENTLINE)) {
-                       if ((ch == '/') && (chNext == '/')) {
-                               char chNext2 = styler.SafeGetCharAt(i + 2);
-                               if (chNext2 == '{') {
-                                       levelCurrent++;
-                               } else if (chNext2 == '}') {
-                                       levelCurrent--;
-                               }
-                       }
-               }
-
-               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")) {
-                                       levelCurrent++;
-                               } else if (styler.Match(j, "end")) {
-                                       levelCurrent--;
-                               }
-                       }
-               }
-
-               if (style == SCE_C_OPERATOR
-                       ||
-                       style == SCE_C_COMMENT
-                       ||
-                       style == SCE_C_COMMENTLINE) {
-
-                       if (ch == '{') {
-                               levelCurrent++;
-                               // Special handling if line has closing brace followed by opening brace.
-                               if (levelCurrent == levelPrev) {
-                                       if (firstLine)
-                                               levelUnindent = 1;
-                                       else
-                                               levelUnindent = -1;
-                               }
-                       } else if (ch == '}') {
-                               levelCurrent--;
-                       }
-               }
-
-               /* Check for fold header keyword at beginning of word */
-               if ((style == SCE_C_WORD || style == SCE_C_COMMENT || style == SCE_C_COMMENTLINE)
-                       &&
-                       (style != stylePrev)) {
-                       if (matchKeyword(i, keywords4, styler, KEYWORD_BOXHEADER)) {
-                               int line;
-                               /* Loop backwards all empty or comment lines */
-                               for (line = lineCurrent - 1;
-                                       line >= 0
-                                       &&
-                                       levelCurrent == (styler.LevelAt(line) & SC_FOLDLEVELNUMBERMASK)
-                                       &&
-                                       (styler.LevelAt(line) & SC_FOLDLEVELBOXFOOTERFLAG) == 0
-                                       &&
-                                       IsCommentLine(line, styler);
-                                       line--) {
-                                       /* just loop backwards */;
-                               }
-
-                               line++;
-                               /* Set Box header flag (if the previous line has no footer line) */
-                               if ((styler.LevelAt(line) & SC_FOLDLEVELBOXFOOTERFLAG) == 0) {
-                                       if (line == lineCurrent) {
-                                               /* in current line */
-                                               levelFlags |= SC_FOLDLEVELBOXHEADERFLAG;
-                                       } else {
-                                               /* at top of all preceding comment lines */
-                                               styler.SetLevel(line, styler.LevelAt(line)
-                                                               | SC_FOLDLEVELBOXHEADERFLAG);
-                                       }
-                               }
-                       }
-               }
-
-               if (matchKeyword(i, keywords4, styler, KEYWORD_FOLDCONTRACTED)) {
-                       levelFlags |= SC_FOLDLEVELCONTRACTED;
-               }
-
-               if (atEOL) {
-                       int lev;
-                       // Compute level correction for special case: '} else {'
-                       if (levelUnindent < 0) {
-                               levelPrev += levelUnindent;
-                       } else {
-                               levelCurrent += levelUnindent;
-                       }
-
-                       lev = levelPrev;
-                       if (visibleChars == 0 && foldCompact)
-                               lev |= SC_FOLDLEVELWHITEFLAG;
-                       // Produce additional footer line (e.g. after closed if)
-                       if (visibleChars == 0
-                               &&
-                               (levelPrev < levelPrevPrev))
-                               lev |= SC_FOLDLEVELBOXFOOTERFLAG;
-                       // Produce footer line at line before (special handling for '} else {'
-                       if (levelPrev < levelPrevPrev) {
-                               styler.SetLevel(lineCurrent - 1,
-                                               styler.LevelAt(lineCurrent - 1) | SC_FOLDLEVELBOXFOOTERFLAG);
-                       }
-                       // Mark the fold header (the line that is always visible)
-                       if ((levelCurrent > levelPrev) && (visibleChars > 0))
-                               lev |= SC_FOLDLEVELHEADERFLAG;
-                       // Show a footer line at end of fold
-                       if (levelCurrent < levelPrev)
-                               lev |= SC_FOLDLEVELBOXFOOTERFLAG;
-                       /* Show a footer line at the end of each procedure (level == SC_FOLDLEVELBASE) */
-                       if ((levelPrev == SC_FOLDLEVELBASE)
-                               &&
-                               (levelPrevPrev > SC_FOLDLEVELBASE)
-                               &&
-                               (visibleChars == 0)) {
-                               lev |= SC_FOLDLEVELBOXFOOTERFLAG;
-                       }
-
-                       lev |= levelFlags;
-                       if (lev != styler.LevelAt(lineCurrent)) {
-                               styler.SetLevel(lineCurrent, lev);
-                       }
-
-                       lineCurrent++;
-                       levelPrevPrev = levelPrev;
-                       levelPrev = levelCurrent;
-                       levelUnindent = 0;
-                       visibleChars = 0;
-                       levelFlags = 0;
-                       firstLine = false;
-               }
-
-               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);
-}
-
+// 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;
 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);
        unsigned int endPos = startPos + length;
        int visibleChars = 0;
        int lineCurrent = styler.GetLine(startPos);
-       int levelPrev = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK;
-       int levelCurrent = levelPrev;
+       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;
        char chNext = styler[startPos];
        int styleNext = styler.StyleAt(startPos);
        int style = initStyle;
@@ -522,19 +311,19 @@ static void FoldNoBoxCppDoc(unsigned int startPos, int length, int initStyle,
                bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n');
                if (foldComment && IsStreamCommentStyle(style)) {
                        if (!IsStreamCommentStyle(stylePrev)) {
                bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n');
                if (foldComment && IsStreamCommentStyle(style)) {
                        if (!IsStreamCommentStyle(stylePrev)) {
-                               levelCurrent++;
+                               levelNext++;
                        } else if (!IsStreamCommentStyle(styleNext) && !atEOL) {
                                // Comments don't end at end of line and the next character may be unstyled.
                        } else if (!IsStreamCommentStyle(styleNext) && !atEOL) {
                                // Comments don't end at end of line and the next character may be unstyled.
-                               levelCurrent--;
+                               levelNext--;
                        }
                }
                if (foldComment && (style == SCE_C_COMMENTLINE)) {
                        if ((ch == '/') && (chNext == '/')) {
                                char chNext2 = styler.SafeGetCharAt(i + 2);
                                if (chNext2 == '{') {
                        }
                }
                if (foldComment && (style == SCE_C_COMMENTLINE)) {
                        if ((ch == '/') && (chNext == '/')) {
                                char chNext2 = styler.SafeGetCharAt(i + 2);
                                if (chNext2 == '{') {
-                                       levelCurrent++;
+                                       levelNext++;
                                } else if (chNext2 == '}') {
                                } else if (chNext2 == '}') {
-                                       levelCurrent--;
+                                       levelNext--;
                                }
                        }
                }
                                }
                        }
                }
@@ -545,58 +334,58 @@ static void FoldNoBoxCppDoc(unsigned int startPos, int length, int initStyle,
                                        j++;
                                }
                                if (styler.Match(j, "region") || styler.Match(j, "if")) {
                                        j++;
                                }
                                if (styler.Match(j, "region") || styler.Match(j, "if")) {
-                                       levelCurrent++;
+                                       levelNext++;
                                } else if (styler.Match(j, "end")) {
                                } else if (styler.Match(j, "end")) {
-                                       levelCurrent--;
+                                       levelNext--;
                                }
                        }
                }
                if (style == SCE_C_OPERATOR) {
                        if (ch == '{') {
                                }
                        }
                }
                if (style == SCE_C_OPERATOR) {
                        if (ch == '{') {
-                               levelCurrent++;
+                               // Measure the minimum before a '{' to allow
+                               // folding on "} else {"
+                               if (levelMinCurrent > levelNext) {
+                                       levelMinCurrent = levelNext;
+                               }
+                               levelNext++;
                        } else if (ch == '}') {
                        } else if (ch == '}') {
-                               levelCurrent--;
+                               levelNext--;
                        }
                }
                if (atEOL) {
                        }
                }
                if (atEOL) {
-                       int lev = levelPrev;
+                       int levelUse = levelCurrent;
+                       if (foldAtElse) {
+                               levelUse = levelMinCurrent;
+                       }
+                       int lev = levelUse | levelNext << 16;
                        if (visibleChars == 0 && foldCompact)
                                lev |= SC_FOLDLEVELWHITEFLAG;
                        if (visibleChars == 0 && foldCompact)
                                lev |= SC_FOLDLEVELWHITEFLAG;
-                       if ((levelCurrent > levelPrev) && (visibleChars > 0))
+                       if (levelUse < levelNext)
                                lev |= SC_FOLDLEVELHEADERFLAG;
                        if (lev != styler.LevelAt(lineCurrent)) {
                                styler.SetLevel(lineCurrent, lev);
                        }
                        lineCurrent++;
                                lev |= SC_FOLDLEVELHEADERFLAG;
                        if (lev != styler.LevelAt(lineCurrent)) {
                                styler.SetLevel(lineCurrent, lev);
                        }
                        lineCurrent++;
-                       levelPrev = levelCurrent;
+                       levelCurrent = levelNext;
+                       levelMinCurrent = levelCurrent;
                        visibleChars = 0;
                }
                if (!isspacechar(ch))
                        visibleChars++;
        }
                        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 void FoldCppDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[],
+static void FoldCppDoc(unsigned int startPos, int length, int initStyle, WordList *[],
                        Accessor &styler) {
                        Accessor &styler) {
-
-       int foldFlags = styler.GetPropertyInt("fold.flags") ;
-       bool foldBox = ((foldFlags & SC_FOLDFLAG_BOX) == SC_FOLDFLAG_BOX);
-
-       if (foldBox) {
-               FoldBoxCppDoc(startPos, length, initStyle, keywordlists, styler);
-       } else {
-               FoldNoBoxCppDoc(startPos, length, initStyle, styler);
-       }
+       FoldNoBoxCppDoc(startPos, length, initStyle, styler);
 }
 
 static const char * const cppWordLists[] = {
             "Primary keywords and identifiers",
             "Secondary keywords and identifiers",
             "Documentation comment keywords",
 }
 
 static const char * const cppWordLists[] = {
             "Primary keywords and identifiers",
             "Secondary keywords and identifiers",
             "Documentation comment keywords",
-            "Fold header keywords",
+            "Unused",
+            "Global classes and typedefs",
             0,
         };
 
             0,
         };
 
diff --git a/contrib/src/stc/scintilla/src/LexEScript.cxx b/contrib/src/stc/scintilla/src/LexEScript.cxx
new file mode 100644 (file)
index 0000000..28e3b3b
--- /dev/null
@@ -0,0 +1,270 @@
+// 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);
diff --git a/contrib/src/stc/scintilla/src/LexLout.cxx b/contrib/src/stc/scintilla/src/LexLout.cxx
new file mode 100644 (file)
index 0000000..9d1a45a
--- /dev/null
@@ -0,0 +1,208 @@
+// 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);
index 6d537c9b6c2294e3200158f56738a9e2e35b58df..45e2d515446c24f84b3f61fc7e395b0ac40b0ba1 100644 (file)
@@ -626,9 +626,20 @@ static const char * const emptyWordListDesc[] = {
        0
 };
 
        0
 };
 
+static void ColouriseNullDoc(unsigned int startPos, int length, int, WordList *[],
+                            Accessor &styler) {
+       // Null language means all style bytes are 0 so just mark the end - no need to fill in.
+       if (length > 0) {
+               styler.StartAt(startPos + length - 1);
+               styler.StartSegment(startPos + length - 1);
+               styler.ColourTo(startPos + length - 1, 0);
+       }
+}
+
 LexerModule lmBatch(SCLEX_BATCH, ColouriseBatchDoc, "batch", 0, batchWordListDesc);
 LexerModule lmDiff(SCLEX_DIFF, ColouriseDiffDoc, "diff", 0, emptyWordListDesc);
 LexerModule lmProps(SCLEX_PROPERTIES, ColourisePropsDoc, "props", 0, emptyWordListDesc);
 LexerModule lmMake(SCLEX_MAKEFILE, ColouriseMakeDoc, "makefile", 0, emptyWordListDesc);
 LexerModule lmErrorList(SCLEX_ERRORLIST, ColouriseErrorListDoc, "errorlist", 0, emptyWordListDesc);
 LexerModule lmLatex(SCLEX_LATEX, ColouriseLatexDoc, "latex", 0, emptyWordListDesc);
 LexerModule lmBatch(SCLEX_BATCH, ColouriseBatchDoc, "batch", 0, batchWordListDesc);
 LexerModule lmDiff(SCLEX_DIFF, ColouriseDiffDoc, "diff", 0, emptyWordListDesc);
 LexerModule lmProps(SCLEX_PROPERTIES, ColourisePropsDoc, "props", 0, emptyWordListDesc);
 LexerModule lmMake(SCLEX_MAKEFILE, ColouriseMakeDoc, "makefile", 0, emptyWordListDesc);
 LexerModule lmErrorList(SCLEX_ERRORLIST, ColouriseErrorListDoc, "errorlist", 0, emptyWordListDesc);
 LexerModule lmLatex(SCLEX_LATEX, ColouriseLatexDoc, "latex", 0, emptyWordListDesc);
+LexerModule lmNull(SCLEX_NULL, ColouriseNullDoc, "null");
index 18544aef23c87b54b8e09c91b7edffa1944895b6..8455d854d2bc74fea4f697e1b9a0a506360458da 100644 (file)
@@ -9,7 +9,6 @@
 
 #include <stdlib.h>
 #include <string.h>
 
 #include <stdlib.h>
 #include <string.h>
-//#include <ctype.h>
 #include <stdio.h>
 
 #include "Platform.h"
 #include <stdio.h>
 
 #include "Platform.h"
@@ -182,25 +181,26 @@ SString PropSet::GetExpanded(const char *key) {
        return Expand(val.c_str());
 }
 
        return Expand(val.c_str());
 }
 
-SString PropSet::Expand(const char *withVars) {
+SString PropSet::Expand(const char *withVars, int maxExpands) {
        char *base = StringDup(withVars);
        char *cpvar = strstr(base, "$(");
        char *base = StringDup(withVars);
        char *cpvar = strstr(base, "$(");
-       int maxExpands = 1000;  // Avoid infinite expansion of recursive definitions
        while (cpvar && (maxExpands > 0)) {
                char *cpendvar = strchr(cpvar, ')');
        while (cpvar && (maxExpands > 0)) {
                char *cpendvar = strchr(cpvar, ')');
-               if (cpendvar) {
-                       int lenvar = cpendvar - cpvar - 2;      // Subtract the $()
-                       char *var = StringDup(cpvar + 2, lenvar);
-                       SString val = GetExpanded(var);
-                       size_t newlenbase = strlen(base) + val.length() - lenvar;
-                       char *newbase = new char[newlenbase];
-                       strncpy(newbase, base, cpvar - base);
-                       strcpy(newbase + (cpvar - base), val.c_str());
-                       strcpy(newbase + (cpvar - base) + val.length(), cpendvar + 1);
-                       delete []var;
-                       delete []base;
-                       base = newbase;
-               }
+               if (!cpendvar)
+                       break;
+               int lenvar = cpendvar - cpvar - 2;      // Subtract the $()
+               char *var = StringDup(cpvar + 2, lenvar);
+               SString val = Get(var);
+               if (IncludesVar(val.c_str(), var))
+                       break;
+               size_t newlenbase = strlen(base) + val.length() - lenvar;
+               char *newbase = new char[newlenbase];
+               strncpy(newbase, base, cpvar - base);
+               strcpy(newbase + (cpvar - base), val.c_str());
+               strcpy(newbase + (cpvar - base) + val.length(), cpendvar + 1);
+               delete []var;
+               delete []base;
+               base = newbase;
                cpvar = strstr(base, "$(");
                maxExpands--;
        }
                cpvar = strstr(base, "$(");
                maxExpands--;
        }
index 656570a24b9b2309c765f7756eb1e07e8f4b0faa..3bce611f0df288eda0552da4072c59eaa49b13e4 100644 (file)
@@ -30,8 +30,8 @@
  * Modification history:
  *
  * $Log$
  * Modification history:
  *
  * $Log$
- * Revision 1.6  2003/04/19 19:59:49  RD
- * Updated Scintilla to 1.52 (on the trunk this time too)
+ * Revision 1.7  2003/07/18 06:43:23  RD
+ * Update to Scintilla 1.53
  *
  * Revision 1.9  2003/03/21 10:36:08  nyamatongwe
  * Detect patterns too long in regular expression search.
  *
  * Revision 1.9  2003/03/21 10:36:08  nyamatongwe
  * Detect patterns too long in regular expression search.
index c437fee5a0aa6687daaebc2199c32acec0487521..274bce2f8159fa1afd5494206e5a26dab9dc02c3 100644 (file)
@@ -475,7 +475,7 @@ void wxStyledTextCtrl::MarkerDefineBitmap(int markerNumber, const wxBitmap& bmp)
         buff[len] = 0;
         SendMsg(2049, markerNumber, (long)buff);
         delete [] buff;
         buff[len] = 0;
         SendMsg(2049, markerNumber, (long)buff);
         delete [] buff;
-
+        
 }
 
 // Set a margin to be either numeric or symbolic.
 }
 
 // Set a margin to be either numeric or symbolic.
@@ -858,7 +858,7 @@ void wxStyledTextCtrl::RegisterImage(int type, const wxBitmap& bmp) {
         buff[len] = 0;
         SendMsg(2405, type, (long)buff);
         delete [] buff;
         buff[len] = 0;
         SendMsg(2405, type, (long)buff);
         delete [] buff;
-
+     
 }
 
 // Clear all the registered images.
 }
 
 // Clear all the registered images.
@@ -1618,6 +1618,11 @@ void wxStyledTextCtrl::LineEndDisplayExtend() {
     SendMsg(2348, 0, 0);
 }
 
     SendMsg(2348, 0, 0);
 }
 
+// Copy the line containing the caret.
+void wxStyledTextCtrl::LineCopy() {
+    SendMsg(2455, 0, 0);
+}
+
 // Move the caret inside current view if it's not there already.
 void wxStyledTextCtrl::MoveCaretInsideView() {
     SendMsg(2401, 0, 0);
 // Move the caret inside current view if it's not there already.
 void wxStyledTextCtrl::MoveCaretInsideView() {
     SendMsg(2401, 0, 0);
@@ -1905,6 +1910,28 @@ void wxStyledTextCtrl::SetHotspotActiveUnderline(bool underline) {
     SendMsg(2412, underline, 0);
 }
 
     SendMsg(2412, underline, 0);
 }
 
+// Given a valid document position, return the previous position taking code
+// page into account. Returns 0 if passed 0.
+int wxStyledTextCtrl::PositionBefore(int pos) {
+    return SendMsg(2417, pos, 0);
+}
+
+// Given a valid document position, return the next position taking code
+// page into account. Maximum value returned is the last position in the document.
+int wxStyledTextCtrl::PositionAfter(int pos) {
+    return SendMsg(2418, pos, 0);
+}
+
+// Copy a range of text to the clipboard. Positions are clipped into the document.
+void wxStyledTextCtrl::CopyRange(int start, int end) {
+    SendMsg(2419, start, end);
+}
+
+// Copy argument text to the clipboard.
+void wxStyledTextCtrl::CopyText(int length, const wxString& text) {
+    SendMsg(2420, length, (long)(const char*)wx2stc(text));
+}
+
 // Start notifying the container of all key presses and commands.
 void wxStyledTextCtrl::StartRecord() {
     SendMsg(3001, 0, 0);
 // Start notifying the container of all key presses and commands.
 void wxStyledTextCtrl::StartRecord() {
     SendMsg(3001, 0, 0);
index 193376418ff38fe0b6e30f768b03508949d06e34..2f54e83f76a2af18c90dce9b277da819da102981 100644 (file)
 #define wxSTC_LEX_F77 37
 #define wxSTC_LEX_CSS 38
 #define wxSTC_LEX_POV 39
 #define wxSTC_LEX_F77 37
 #define wxSTC_LEX_CSS 38
 #define wxSTC_LEX_POV 39
+#define wxSTC_LEX_LOUT 40
+#define wxSTC_LEX_ESCRIPT 41
 
 // When a lexer specifies its language as SCLEX_AUTOMATIC it receives a
 // value assigned in sequence from SCLEX_AUTOMATIC+1.
 
 // When a lexer specifies its language as SCLEX_AUTOMATIC it receives a
 // value assigned in sequence from SCLEX_AUTOMATIC+1.
 #define wxSTC_C_WORD2 16
 #define wxSTC_C_COMMENTDOCKEYWORD 17
 #define wxSTC_C_COMMENTDOCKEYWORDERROR 18
 #define wxSTC_C_WORD2 16
 #define wxSTC_C_COMMENTDOCKEYWORD 17
 #define wxSTC_C_COMMENTDOCKEYWORDERROR 18
+#define wxSTC_C_GLOBALCLASS 19
 
 // Lexical states for SCLEX_HTML, SCLEX_XML
 #define wxSTC_H_DEFAULT 0
 
 // Lexical states for SCLEX_HTML, SCLEX_XML
 #define wxSTC_H_DEFAULT 0
 #define wxSTC_POV_BRACE 9
 #define wxSTC_POV_WORD2 10
 
 #define wxSTC_POV_BRACE 9
 #define wxSTC_POV_WORD2 10
 
+// Lexical states for SCLEX_LOUT
+#define wxSTC_LOUT_DEFAULT 0
+#define wxSTC_LOUT_COMMENT 1
+#define wxSTC_LOUT_NUMBER 2
+#define wxSTC_LOUT_WORD 3
+#define wxSTC_LOUT_WORD2 4
+#define wxSTC_LOUT_WORD3 5
+#define wxSTC_LOUT_WORD4 6
+#define wxSTC_LOUT_STRING 7
+#define wxSTC_LOUT_OPERATOR 8
+#define wxSTC_LOUT_IDENTIFIER 9
+#define wxSTC_LOUT_STRINGEOL 10
+
+// Lexical states for SCLEX_ESCRIPT
+#define wxSTC_ESCRIPT_DEFAULT 0
+#define wxSTC_ESCRIPT_COMMENT 1
+#define wxSTC_ESCRIPT_COMMENTLINE 2
+#define wxSTC_ESCRIPT_COMMENTDOC 3
+#define wxSTC_ESCRIPT_NUMBER 4
+#define wxSTC_ESCRIPT_WORD 5
+#define wxSTC_ESCRIPT_STRING 6
+#define wxSTC_ESCRIPT_OPERATOR 7
+#define wxSTC_ESCRIPT_IDENTIFIER 8
+#define wxSTC_ESCRIPT_BRACE 9
+#define wxSTC_ESCRIPT_WORD2 10
+#define wxSTC_ESCRIPT_WORD3 11
+
 
 //-----------------------------------------
 // Commands that can be bound to keystrokes
 
 //-----------------------------------------
 // Commands that can be bound to keystrokes
@@ -1880,6 +1910,9 @@ public:
     // caret position.
     void LineEndDisplayExtend();
 
     // caret position.
     void LineEndDisplayExtend();
 
+    // Copy the line containing the caret.
+    void LineCopy();
+
     // Move the caret inside current view if it's not there already.
     void MoveCaretInsideView();
 
     // Move the caret inside current view if it's not there already.
     void MoveCaretInsideView();
 
@@ -2056,6 +2089,20 @@ public:
     // Enable / Disable underlining active hotspots.
     void SetHotspotActiveUnderline(bool underline);
 
     // Enable / Disable underlining active hotspots.
     void SetHotspotActiveUnderline(bool underline);
 
+    // Given a valid document position, return the previous position taking code
+    // page into account. Returns 0 if passed 0.
+    int PositionBefore(int pos);
+
+    // Given a valid document position, return the next position taking code
+    // page into account. Maximum value returned is the last position in the document.
+    int PositionAfter(int pos);
+
+    // Copy a range of text to the clipboard. Positions are clipped into the document.
+    void CopyRange(int start, int end);
+
+    // Copy argument text to the clipboard.
+    void CopyText(int length, const wxString& text);
+
     // Start notifying the container of all key presses and commands.
     void StartRecord();
 
     // Start notifying the container of all key presses and commands.
     void StartRecord();
 
index 6d3ac72f9ed44b19e68c1d87fe9691eb79193072..ff006759dc565f64a673da38bb408001d56ba651 100644 (file)
@@ -17,6 +17,7 @@ CXXFLAGS = @CXXFLAGS@
 DLLPREFIX = @DLLPREFIX@
 EXTRALIBS = @EXTRALIBS@
 EXTRALIBS_GUI = @EXTRALIBS_GUI@
 DLLPREFIX = @DLLPREFIX@
 EXTRALIBS = @EXTRALIBS@
 EXTRALIBS_GUI = @EXTRALIBS_GUI@
+HOST_SUFFIX = @HOST_SUFFIX@
 INSTALL_DATA = @INSTALL_DATA@
 INSTALL_DIR = @INSTALL_DIR@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_DATA = @INSTALL_DATA@
 INSTALL_DIR = @INSTALL_DIR@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
@@ -40,8 +41,17 @@ top_srcdir = @top_srcdir@
 
 ### Variables: ###
 
 
 ### Variables: ###
 
-STCDLL_CXXFLAGS = $(CPPFLAGS)   -D__WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p)   -I$(top_srcdir)/include $(__INC_TIFF_p) $(__INC_JPEG_p) $(__INC_PNG_p) $(__INC_ZLIB_p) $(__INC_ODBC_p) $(__INC_REGEX_p) -I$(srcdir)/../../include -I$(srcdir)/scintilla/include -I$(srcdir)/scintilla/src -D__WX__ -DSCI_LEXER -DLINK_LEXERS -DWXUSINGDLL -DWXMAKINGDLL_STC $(CXXFLAGS) $(PIC_FLAG)
-STCLIB_CXXFLAGS = $(CPPFLAGS)   -D__WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p)   -I$(top_srcdir)/include $(__INC_TIFF_p) $(__INC_JPEG_p) $(__INC_PNG_p) $(__INC_ZLIB_p) $(__INC_ODBC_p) $(__INC_REGEX_p) -I$(srcdir)/../../include -I$(srcdir)/scintilla/include -I$(srcdir)/scintilla/src -D__WX__ -DSCI_LEXER -DLINK_LEXERS $(CXXFLAGS)
+STCDLL_CXXFLAGS = $(CPPFLAGS) -D__WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p) \
+       -I$(top_srcdir)/include $(__INC_TIFF_p) $(__INC_JPEG_p) $(__INC_PNG_p) \
+       $(__INC_ZLIB_p) $(__INC_ODBC_p) $(__INC_REGEX_p) -I$(srcdir)/../../include \
+       -I$(srcdir)/scintilla/include -I$(srcdir)/scintilla/src -D__WX__ \
+       -DSCI_LEXER -DLINK_LEXERS -DWXUSINGDLL -DWXMAKINGDLL_STC $(CXXFLAGS) \
+       $(PIC_FLAG)
+STCLIB_CXXFLAGS = $(CPPFLAGS) -D__WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p) \
+       -I$(top_srcdir)/include $(__INC_TIFF_p) $(__INC_JPEG_p) $(__INC_PNG_p) \
+       $(__INC_ZLIB_p) $(__INC_ODBC_p) $(__INC_REGEX_p) -I$(srcdir)/../../include \
+       -I$(srcdir)/scintilla/include -I$(srcdir)/scintilla/src -D__WX__ \
+       -DSCI_LEXER -DLINK_LEXERS $(CXXFLAGS)
 
 ### Conditionally set variables: ###
 
 
 ### Conditionally set variables: ###
 
@@ -68,38 +78,74 @@ STCLIB_CXXFLAGS = $(CPPFLAGS)   -D__WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p)   -I$(to
 @COND_WXUSE_REGEX_BUILTIN@__INC_REGEX_p = -I$(top_srcdir)/src/regex
 @COND_WXUSE_LIBTIFF_BUILTIN@__INC_TIFF_p = -I$(top_srcdir)/src/tiff
 @COND_WXUSE_ZLIB_BUILTIN@__INC_ZLIB_p = -I$(top_srcdir)/src/zlib
 @COND_WXUSE_REGEX_BUILTIN@__INC_REGEX_p = -I$(top_srcdir)/src/regex
 @COND_WXUSE_LIBTIFF_BUILTIN@__INC_TIFF_p = -I$(top_srcdir)/src/tiff
 @COND_WXUSE_ZLIB_BUILTIN@__INC_ZLIB_p = -I$(top_srcdir)/src/zlib
-@COND_WXUSE_LIBJPEG_BUILTIN@__LIB_JPEG_p = -lwxjpeg$(WXDEBUGFLAG)
-@COND_WXUSE_ODBC_BUILTIN@__LIB_ODBC_p = -lwxodbc$(WXDEBUGFLAG)
-@COND_WXUSE_LIBPNG_BUILTIN@__LIB_PNG_p = -lwxpng$(WXDEBUGFLAG)
-@COND_WXUSE_REGEX_BUILTIN@__LIB_REGEX_p = -lwxregex$(WXDEBUGFLAG)
-@COND_WXUSE_LIBTIFF_BUILTIN@__LIB_TIFF_p = -lwxtiff$(WXDEBUGFLAG)
-@COND_WXUSE_ZLIB_BUILTIN@__LIB_ZLIB_p = -lwxzlib$(WXDEBUGFLAG)
-@COND_MONOLITHIC_0@__WXLIB_BASE_p = -lwx_base$(WXBASEPORT)$(WXUNICODEFLAG)$(WXDEBUGFLAG)-2.5
-@COND_MONOLITHIC_0@__WXLIB_CORE_p = -lwx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_core-2.5
-@COND_MONOLITHIC_1@__WXLIB_MONO_p = -lwx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)-2.5
+@COND_WXUSE_LIBJPEG_BUILTIN@__LIB_JPEG_p = \
+@COND_WXUSE_LIBJPEG_BUILTIN@   -lwxjpeg$(WXDEBUGFLAG)$(HOST_SUFFIX)
+@COND_WXUSE_ODBC_BUILTIN@__LIB_ODBC_p = \
+@COND_WXUSE_ODBC_BUILTIN@      -lwxodbc$(WXDEBUGFLAG)$(HOST_SUFFIX)
+@COND_WXUSE_LIBPNG_BUILTIN@__LIB_PNG_p = \
+@COND_WXUSE_LIBPNG_BUILTIN@    -lwxpng$(WXDEBUGFLAG)$(HOST_SUFFIX)
+@COND_WXUSE_REGEX_BUILTIN@__LIB_REGEX_p = \
+@COND_WXUSE_REGEX_BUILTIN@     -lwxregex$(WXDEBUGFLAG)$(HOST_SUFFIX)
+@COND_WXUSE_LIBTIFF_BUILTIN@__LIB_TIFF_p = \
+@COND_WXUSE_LIBTIFF_BUILTIN@   -lwxtiff$(WXDEBUGFLAG)$(HOST_SUFFIX)
+@COND_WXUSE_ZLIB_BUILTIN@__LIB_ZLIB_p = \
+@COND_WXUSE_ZLIB_BUILTIN@      -lwxzlib$(WXDEBUGFLAG)$(HOST_SUFFIX)
+@COND_MONOLITHIC_0@__WXLIB_BASE_p = \
+@COND_MONOLITHIC_0@    -lwx_base$(WXBASEPORT)$(WXUNICODEFLAG)$(WXDEBUGFLAG)-2.5$(HOST_SUFFIX)
+@COND_MONOLITHIC_0@__WXLIB_CORE_p = \
+@COND_MONOLITHIC_0@    -lwx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_core-2.5$(HOST_SUFFIX)
+@COND_MONOLITHIC_1@__WXLIB_MONO_p = \
+@COND_MONOLITHIC_1@    -lwx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)-2.5$(HOST_SUFFIX)
 @COND_WXUNIV_1@__WXUNIV_DEFINE_p = -D__WXUNIVERSAL__
 @COND_SHARED_1@__install_stcdll___depname = install_stcdll
 @COND_SHARED_0@__install_stclib___depname = install_stclib
 @COND_WXUNIV_1@__WXUNIV_DEFINE_p = -D__WXUNIVERSAL__
 @COND_SHARED_1@__install_stcdll___depname = install_stcdll
 @COND_SHARED_0@__install_stclib___depname = install_stclib
-@COND_SHARED_1@__stcdll___depname = $(top_builddir)lib/$(DLLPREFIX)$(WXDLLNAMEPREFIXGUI)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc$(WXCOMPILER)$(VENDORTAG)$(WXDLLVERSIONTAG)$(__stcdll___targetsuf3)
-@COND_PLATFORM_WIN32_1@__stcdll___importlib = -Wl,--out-implib,libwx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc-2.5$(DLLIMPEXT)
-@COND_PLATFORM_WIN32_1@__stcdll___importlib = -Wl,--out-implib,$(top_builddir)lib/libwx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc-2.5$(DLLIMPEXT)
-@COND_PLATFORM_MACOSX_1@__stcdll___macinstnamecmd = -install_name $(libdir)/$(DLLPREFIX)$(WXDLLNAMEPREFIXGUI)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc$(WXCOMPILER)$(VENDORTAG)$(WXDLLVERSIONTAG)$(__stcdll___targetsuf2)
-@COND_PLATFORM_MACOSX_1@__stcdll___macver = -compatibility_version 2.5 -current_version 2.5.0
-@COND_USE_SOSYMLINKS_1@__stcdll___so_symlinks_cmd = rm -f $(top_builddir)lib/libwx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc-2.5$(DLLIMPEXT) $(top_builddir)lib/$(DLLPREFIX)$(WXDLLNAMEPREFIXGUI)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc$(WXCOMPILER)$(VENDORTAG)$(WXDLLVERSIONTAG)$(__stcdll___targetsuf2); \
-@COND_USE_SOSYMLINKS_1@                $(LN_S) $(DLLPREFIX)$(WXDLLNAMEPREFIXGUI)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc$(WXCOMPILER)$(VENDORTAG)$(WXDLLVERSIONTAG)$(__stcdll___targetsuf3) $(top_builddir)lib/$(DLLPREFIX)$(WXDLLNAMEPREFIXGUI)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc$(WXCOMPILER)$(VENDORTAG)$(WXDLLVERSIONTAG)$(__stcdll___targetsuf2); \
-@COND_USE_SOSYMLINKS_1@                $(LN_S) $(DLLPREFIX)$(WXDLLNAMEPREFIXGUI)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc$(WXCOMPILER)$(VENDORTAG)$(WXDLLVERSIONTAG)$(__stcdll___targetsuf2) $(top_builddir)lib/libwx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc-2.5$(DLLIMPEXT)
-@COND_USE_SOSYMLINKS_1@__stcdll___so_symlinks_inst_cmd = rm -f libwx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc-2.5$(DLLIMPEXT) $(DLLPREFIX)$(WXDLLNAMEPREFIXGUI)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc$(WXCOMPILER)$(VENDORTAG)$(WXDLLVERSIONTAG)$(__stcdll___targetsuf2); \
-@COND_USE_SOSYMLINKS_1@                $(LN_S) $(DLLPREFIX)$(WXDLLNAMEPREFIXGUI)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc$(WXCOMPILER)$(VENDORTAG)$(WXDLLVERSIONTAG)$(__stcdll___targetsuf3) $(DLLPREFIX)$(WXDLLNAMEPREFIXGUI)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc$(WXCOMPILER)$(VENDORTAG)$(WXDLLVERSIONTAG)$(__stcdll___targetsuf2); \
-@COND_USE_SOSYMLINKS_1@                $(LN_S) $(DLLPREFIX)$(WXDLLNAMEPREFIXGUI)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc$(WXCOMPILER)$(VENDORTAG)$(WXDLLVERSIONTAG)$(__stcdll___targetsuf2) libwx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc-2.5$(DLLIMPEXT)
-@COND_USE_SOVERLINUX_1@__stcdll___soname_flags = $(SONAME_FLAG)$(DLLPREFIX)$(WXDLLNAMEPREFIXGUI)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc$(WXCOMPILER)$(VENDORTAG)$(WXDLLVERSIONTAG)$(__stcdll___targetsuf2)
-@COND_USE_SOVERSOLARIS_1@__stcdll___soname_flags = $(SONAME_FLAG)$(DLLPREFIX)$(WXDLLNAMEPREFIXGUI)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc$(WXCOMPILER)$(VENDORTAG)$(WXDLLVERSIONTAG)$(__stcdll___targetsuf3)
-@COND_PLATFORM_MACOSX_0_USE_SOVERSION_1@__stcdll___targetsuf2 = .$(SO_SUFFIX).0
-@COND_PLATFORM_MACOSX_1_USE_SOVERSION_1@__stcdll___targetsuf2 = .0.$(SO_SUFFIX)
+@COND_SHARED_1@__stcdll___depname = \
+@COND_SHARED_1@        $(top_builddir)lib/$(DLLPREFIX)$(WXDLLNAMEPREFIXGUI)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc$(WXCOMPILER)$(VENDORTAG)$(WXDLLVERSIONTAG)$(__stcdll___targetsuf3)
+@COND_PLATFORM_WIN32_1@__stcdll___importlib = \
+@COND_PLATFORM_WIN32_1@        -Wl,--out-implib,libwx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc-2.5$(HOST_SUFFIX)$(DLLIMPEXT)
+@COND_PLATFORM_WIN32_1@__stcdll___importlib = \
+@COND_PLATFORM_WIN32_1@        -Wl,--out-implib,$(top_builddir)lib/libwx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc-2.5$(HOST_SUFFIX)$(DLLIMPEXT)
+@COND_PLATFORM_MACOSX_1@__stcdll___macinstnamecmd = \
+@COND_PLATFORM_MACOSX_1@       -install_name \
+@COND_PLATFORM_MACOSX_1@       $(libdir)/$(DLLPREFIX)$(WXDLLNAMEPREFIXGUI)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc$(WXCOMPILER)$(VENDORTAG)$(WXDLLVERSIONTAG)$(__stcdll___targetsuf2)
+@COND_PLATFORM_MACOSX_1@__stcdll___macver = \
+@COND_PLATFORM_MACOSX_1@       -compatibility_version 2.5 -current_version 2.5.0
+@COND_USE_SOSYMLINKS_1@__stcdll___so_symlinks_cmd = \
+@COND_USE_SOSYMLINKS_1@        rm -f \
+@COND_USE_SOSYMLINKS_1@        $(top_builddir)lib/libwx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc-2.5$(HOST_SUFFIX)$(DLLIMPEXT) \
+@COND_USE_SOSYMLINKS_1@        $(top_builddir)lib/$(DLLPREFIX)$(WXDLLNAMEPREFIXGUI)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc$(WXCOMPILER)$(VENDORTAG)$(WXDLLVERSIONTAG)$(__stcdll___targetsuf2); \
+@COND_USE_SOSYMLINKS_1@        $(LN_S) \
+@COND_USE_SOSYMLINKS_1@        $(DLLPREFIX)$(WXDLLNAMEPREFIXGUI)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc$(WXCOMPILER)$(VENDORTAG)$(WXDLLVERSIONTAG)$(__stcdll___targetsuf3) \
+@COND_USE_SOSYMLINKS_1@        $(top_builddir)lib/$(DLLPREFIX)$(WXDLLNAMEPREFIXGUI)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc$(WXCOMPILER)$(VENDORTAG)$(WXDLLVERSIONTAG)$(__stcdll___targetsuf2); \
+@COND_USE_SOSYMLINKS_1@        $(LN_S) \
+@COND_USE_SOSYMLINKS_1@        $(DLLPREFIX)$(WXDLLNAMEPREFIXGUI)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc$(WXCOMPILER)$(VENDORTAG)$(WXDLLVERSIONTAG)$(__stcdll___targetsuf2) \
+@COND_USE_SOSYMLINKS_1@        $(top_builddir)lib/libwx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc-2.5$(HOST_SUFFIX)$(DLLIMPEXT)
+@COND_USE_SOSYMLINKS_1@__stcdll___so_symlinks_inst_cmd \
+@COND_USE_SOSYMLINKS_1@        = rm -f \
+@COND_USE_SOSYMLINKS_1@        libwx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc-2.5$(HOST_SUFFIX)$(DLLIMPEXT) \
+@COND_USE_SOSYMLINKS_1@        $(DLLPREFIX)$(WXDLLNAMEPREFIXGUI)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc$(WXCOMPILER)$(VENDORTAG)$(WXDLLVERSIONTAG)$(__stcdll___targetsuf2); \
+@COND_USE_SOSYMLINKS_1@        $(LN_S) \
+@COND_USE_SOSYMLINKS_1@        $(DLLPREFIX)$(WXDLLNAMEPREFIXGUI)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc$(WXCOMPILER)$(VENDORTAG)$(WXDLLVERSIONTAG)$(__stcdll___targetsuf3) \
+@COND_USE_SOSYMLINKS_1@        $(DLLPREFIX)$(WXDLLNAMEPREFIXGUI)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc$(WXCOMPILER)$(VENDORTAG)$(WXDLLVERSIONTAG)$(__stcdll___targetsuf2); \
+@COND_USE_SOSYMLINKS_1@        $(LN_S) \
+@COND_USE_SOSYMLINKS_1@        $(DLLPREFIX)$(WXDLLNAMEPREFIXGUI)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc$(WXCOMPILER)$(VENDORTAG)$(WXDLLVERSIONTAG)$(__stcdll___targetsuf2) \
+@COND_USE_SOSYMLINKS_1@        libwx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc-2.5$(HOST_SUFFIX)$(DLLIMPEXT)
+@COND_USE_SOVERLINUX_1@__stcdll___soname_flags = \
+@COND_USE_SOVERLINUX_1@        $(SONAME_FLAG)$(DLLPREFIX)$(WXDLLNAMEPREFIXGUI)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc$(WXCOMPILER)$(VENDORTAG)$(WXDLLVERSIONTAG)$(__stcdll___targetsuf2)
+@COND_USE_SOVERSOLARIS_1@__stcdll___soname_flags = \
+@COND_USE_SOVERSOLARIS_1@      $(SONAME_FLAG)$(DLLPREFIX)$(WXDLLNAMEPREFIXGUI)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc$(WXCOMPILER)$(VENDORTAG)$(WXDLLVERSIONTAG)$(__stcdll___targetsuf3)
+@COND_PLATFORM_MACOSX_0_USE_SOVERSION_1@__stcdll___targetsuf2 \
+@COND_PLATFORM_MACOSX_0_USE_SOVERSION_1@       = .$(SO_SUFFIX).0
+@COND_PLATFORM_MACOSX_1_USE_SOVERSION_1@__stcdll___targetsuf2 \
+@COND_PLATFORM_MACOSX_1_USE_SOVERSION_1@       = .0.$(SO_SUFFIX)
 @COND_USE_SOVERSION_0@__stcdll___targetsuf2 = .$(SO_SUFFIX)
 @COND_USE_SOVERSION_0@__stcdll___targetsuf2 = .$(SO_SUFFIX)
-@COND_PLATFORM_MACOSX_0_USE_SOVERSION_1@__stcdll___targetsuf3 = .$(SO_SUFFIX).0.0.0
-@COND_PLATFORM_MACOSX_1_USE_SOVERSION_1@__stcdll___targetsuf3 = .0.0.0.$(SO_SUFFIX)
+@COND_PLATFORM_MACOSX_0_USE_SOVERSION_1@__stcdll___targetsuf3 \
+@COND_PLATFORM_MACOSX_0_USE_SOVERSION_1@       = .$(SO_SUFFIX).0.0.0
+@COND_PLATFORM_MACOSX_1_USE_SOVERSION_1@__stcdll___targetsuf3 \
+@COND_PLATFORM_MACOSX_1_USE_SOVERSION_1@       = .0.0.0.$(SO_SUFFIX)
 @COND_USE_SOVERSION_0@__stcdll___targetsuf3 = .$(SO_SUFFIX)
 @COND_USE_SOVERSION_0@__stcdll___targetsuf3 = .$(SO_SUFFIX)
-@COND_SHARED_0@__stclib___depname = $(top_builddir)lib/libwx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc-2.5.a
+@COND_SHARED_0@__stclib___depname = \
+@COND_SHARED_0@        $(top_builddir)lib/libwx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc-2.5$(HOST_SUFFIX).a
 
 ### Targets: ###
 
 
 ### Targets: ###
 
@@ -109,9 +155,9 @@ clean:
        rm -rf ./.deps
        rm -f -f ./*.o
        rm -f $(top_builddir)lib/$(DLLPREFIX)$(WXDLLNAMEPREFIXGUI)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc$(WXCOMPILER)$(VENDORTAG)$(WXDLLVERSIONTAG)$(__stcdll___targetsuf3)
        rm -rf ./.deps
        rm -f -f ./*.o
        rm -f $(top_builddir)lib/$(DLLPREFIX)$(WXDLLNAMEPREFIXGUI)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc$(WXCOMPILER)$(VENDORTAG)$(WXDLLVERSIONTAG)$(__stcdll___targetsuf3)
-       rm -f $(top_builddir)lib/libwx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc-2.5$(DLLIMPEXT)
-       rm -f $(top_builddir)lib/libwx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc-2.5$(DLLIMPEXT) $(top_builddir)lib/$(DLLPREFIX)$(WXDLLNAMEPREFIXGUI)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc$(WXCOMPILER)$(VENDORTAG)$(WXDLLVERSIONTAG)$(__stcdll___targetsuf2)
-       rm -f $(top_builddir)lib/libwx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc-2.5.a
+       rm -f $(top_builddir)lib/libwx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc-2.5$(HOST_SUFFIX)$(DLLIMPEXT)
+       rm -f $(top_builddir)lib/libwx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc-2.5$(HOST_SUFFIX)$(DLLIMPEXT) $(top_builddir)lib/$(DLLPREFIX)$(WXDLLNAMEPREFIXGUI)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc$(WXCOMPILER)$(VENDORTAG)$(WXDLLVERSIONTAG)$(__stcdll___targetsuf2)
+       rm -f $(top_builddir)lib/libwx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc-2.5$(HOST_SUFFIX).a
 
 distclean: clean
        rm -f configure config.cache config.log config.status
 
 distclean: clean
        rm -f configure config.cache config.log config.status
@@ -131,16 +177,16 @@ install-strip: install
 
 @COND_SHARED_1@install_stcdll: 
 @COND_SHARED_1@        $(INSTALL_DIR) $(libdir)
 
 @COND_SHARED_1@install_stcdll: 
 @COND_SHARED_1@        $(INSTALL_DIR) $(libdir)
-@COND_SHARED_1@        $(INSTALL_DATA) $(top_builddir)lib/libwx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc-2.5$(DLLIMPEXT) $(libdir)
+@COND_SHARED_1@        $(INSTALL_DATA) $(top_builddir)lib/libwx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc-2.5$(HOST_SUFFIX)$(DLLIMPEXT) $(libdir)
 @COND_SHARED_1@        $(INSTALL_PROGRAM) $(top_builddir)lib/$(DLLPREFIX)$(WXDLLNAMEPREFIXGUI)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc$(WXCOMPILER)$(VENDORTAG)$(WXDLLVERSIONTAG)$(__stcdll___targetsuf3) $(libdir)
 @COND_SHARED_1@        (cd $(libdir) ; $(__stcdll___so_symlinks_inst_cmd))
 
 @COND_SHARED_0@install_stclib: 
 @COND_SHARED_0@        $(INSTALL_DIR) $(libdir)
 @COND_SHARED_1@        $(INSTALL_PROGRAM) $(top_builddir)lib/$(DLLPREFIX)$(WXDLLNAMEPREFIXGUI)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc$(WXCOMPILER)$(VENDORTAG)$(WXDLLVERSIONTAG)$(__stcdll___targetsuf3) $(libdir)
 @COND_SHARED_1@        (cd $(libdir) ; $(__stcdll___so_symlinks_inst_cmd))
 
 @COND_SHARED_0@install_stclib: 
 @COND_SHARED_0@        $(INSTALL_DIR) $(libdir)
-@COND_SHARED_0@        $(INSTALL_DATA) $(top_builddir)lib/libwx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc-2.5.a $(libdir)
+@COND_SHARED_0@        $(INSTALL_DATA) $(top_builddir)lib/libwx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc-2.5$(HOST_SUFFIX).a $(libdir)
 
 
-@COND_SHARED_1@$(top_builddir)lib/$(DLLPREFIX)$(WXDLLNAMEPREFIXGUI)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc$(WXCOMPILER)$(VENDORTAG)$(WXDLLVERSIONTAG)$(__stcdll___targetsuf3): stcdll_PlatWX.o stcdll_ScintillaWX.o stcdll_stc.o stcdll_AutoComplete.o stcdll_CallTip.o stcdll_CellBuffer.o stcdll_ContractionState.o stcdll_Document.o stcdll_DocumentAccessor.o stcdll_Editor.o stcdll_Indicator.o stcdll_KeyMap.o stcdll_KeyWords.o stcdll_LexAVE.o stcdll_LexAda.o stcdll_LexAsm.o stcdll_LexBaan.o stcdll_LexBullant.o stcdll_LexCPP.o stcdll_LexCSS.o stcdll_LexConf.o stcdll_LexCrontab.o stcdll_LexEiffel.o stcdll_LexFortran.o stcdll_LexHTML.o stcdll_LexLisp.o stcdll_LexLua.o stcdll_LexMatlab.o stcdll_LexOthers.o stcdll_LexPOV.o stcdll_LexPascal.o stcdll_LexPerl.o stcdll_LexPython.o stcdll_LexRuby.o stcdll_LexSQL.o stcdll_LexVB.o stcdll_LineMarker.o stcdll_PropSet.o stcdll_RESearch.o stcdll_ScintillaBase.o stcdll_Style.o stcdll_StyleContext.o stcdll_UniConversion.o stcdll_ViewStyle.o stcdll_WindowAccessor.o stcdll_XPM.o
-@COND_SHARED_1@        $(SHARED_LD_CXX) $@  stcdll_PlatWX.o stcdll_ScintillaWX.o stcdll_stc.o stcdll_AutoComplete.o stcdll_CallTip.o stcdll_CellBuffer.o stcdll_ContractionState.o stcdll_Document.o stcdll_DocumentAccessor.o stcdll_Editor.o stcdll_Indicator.o stcdll_KeyMap.o stcdll_KeyWords.o stcdll_LexAVE.o stcdll_LexAda.o stcdll_LexAsm.o stcdll_LexBaan.o stcdll_LexBullant.o stcdll_LexCPP.o stcdll_LexCSS.o stcdll_LexConf.o stcdll_LexCrontab.o stcdll_LexEiffel.o stcdll_LexFortran.o stcdll_LexHTML.o stcdll_LexLisp.o stcdll_LexLua.o stcdll_LexMatlab.o stcdll_LexOthers.o stcdll_LexPOV.o stcdll_LexPascal.o stcdll_LexPerl.o stcdll_LexPython.o stcdll_LexRuby.o stcdll_LexSQL.o stcdll_LexVB.o stcdll_LineMarker.o stcdll_PropSet.o stcdll_RESearch.o stcdll_ScintillaBase.o stcdll_Style.o stcdll_StyleContext.o stcdll_UniConversion.o stcdll_ViewStyle.o stcdll_WindowAccessor.o stcdll_XPM.o $(LDFLAGS) $(__stcdll___importlib)   -L$(top_builddir)lib $(__stcdll___macinstnamecmd) $(__stcdll___importlib) $(__stcdll___soname_flags) $(__stcdll___macver)  $(__WXLIB_MONO_p) $(__LIB_TIFF_p) $(__LIB_JPEG_p) $(__LIB_PNG_p) $(__LIB_ZLIB_p) $(__LIB_ODBC_p) $(__LIB_REGEX_p) $(EXTRALIBS) $(EXTRALIBS_GUI) $(__WXLIB_CORE_p) $(__WXLIB_BASE_p)
+@COND_SHARED_1@$(top_builddir)lib/$(DLLPREFIX)$(WXDLLNAMEPREFIXGUI)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc$(WXCOMPILER)$(VENDORTAG)$(WXDLLVERSIONTAG)$(__stcdll___targetsuf3): stcdll_PlatWX.o stcdll_ScintillaWX.o stcdll_stc.o stcdll_AutoComplete.o stcdll_CallTip.o stcdll_CellBuffer.o stcdll_ContractionState.o stcdll_Document.o stcdll_DocumentAccessor.o stcdll_Editor.o stcdll_ExternalLexer.o stcdll_Indicator.o stcdll_KeyMap.o stcdll_KeyWords.o stcdll_LexAVE.o stcdll_LexAda.o stcdll_LexAsm.o stcdll_LexBaan.o stcdll_LexBullant.o stcdll_LexCPP.o stcdll_LexCSS.o stcdll_LexConf.o stcdll_LexCrontab.o stcdll_LexEiffel.o stcdll_LexEScript.o stcdll_LexFortran.o stcdll_LexHTML.o stcdll_LexLisp.o stcdll_LexLout.o stcdll_LexLua.o stcdll_LexMatlab.o stcdll_LexOthers.o stcdll_LexPOV.o stcdll_LexPascal.o stcdll_LexPerl.o stcdll_LexPython.o stcdll_LexRuby.o stcdll_LexSQL.o stcdll_LexVB.o stcdll_LineMarker.o stcdll_PropSet.o stcdll_RESearch.o stcdll_ScintillaBase.o stcdll_Style.o stcdll_StyleContext.o stcdll_UniConversion.o stcdll_ViewStyle.o stcdll_WindowAccessor.o stcdll_XPM.o
+@COND_SHARED_1@        $(SHARED_LD_CXX) $@  stcdll_PlatWX.o stcdll_ScintillaWX.o stcdll_stc.o stcdll_AutoComplete.o stcdll_CallTip.o stcdll_CellBuffer.o stcdll_ContractionState.o stcdll_Document.o stcdll_DocumentAccessor.o stcdll_Editor.o stcdll_ExternalLexer.o stcdll_Indicator.o stcdll_KeyMap.o stcdll_KeyWords.o stcdll_LexAVE.o stcdll_LexAda.o stcdll_LexAsm.o stcdll_LexBaan.o stcdll_LexBullant.o stcdll_LexCPP.o stcdll_LexCSS.o stcdll_LexConf.o stcdll_LexCrontab.o stcdll_LexEiffel.o stcdll_LexEScript.o stcdll_LexFortran.o stcdll_LexHTML.o stcdll_LexLisp.o stcdll_LexLout.o stcdll_LexLua.o stcdll_LexMatlab.o stcdll_LexOthers.o stcdll_LexPOV.o stcdll_LexPascal.o stcdll_LexPerl.o stcdll_LexPython.o stcdll_LexRuby.o stcdll_LexSQL.o stcdll_LexVB.o stcdll_LineMarker.o stcdll_PropSet.o stcdll_RESearch.o stcdll_ScintillaBase.o stcdll_Style.o stcdll_StyleContext.o stcdll_UniConversion.o stcdll_ViewStyle.o stcdll_WindowAccessor.o stcdll_XPM.o $(LDFLAGS) $(__stcdll___importlib)   -L$(top_builddir)lib $(__stcdll___macinstnamecmd) $(__stcdll___importlib) $(__stcdll___soname_flags) $(__stcdll___macver)  $(__WXLIB_MONO_p) $(__LIB_TIFF_p) $(__LIB_JPEG_p) $(__LIB_PNG_p) $(__LIB_ZLIB_p) $(__LIB_ODBC_p) $(__LIB_REGEX_p) $(EXTRALIBS) $(EXTRALIBS_GUI) $(__WXLIB_CORE_p) $(__WXLIB_BASE_p)
 @COND_SHARED_1@        $(__stcdll___so_symlinks_cmd)
 
 stcdll_AutoComplete.o: $(srcdir)/scintilla/src/AutoComplete.cxx
 @COND_SHARED_1@        $(__stcdll___so_symlinks_cmd)
 
 stcdll_AutoComplete.o: $(srcdir)/scintilla/src/AutoComplete.cxx
@@ -164,6 +210,9 @@ stcdll_DocumentAccessor.o: $(srcdir)/scintilla/src/DocumentAccessor.cxx
 stcdll_Editor.o: $(srcdir)/scintilla/src/Editor.cxx
        $(CXXC) -c -o $@ $(STCDLL_CXXFLAGS) $<
 
 stcdll_Editor.o: $(srcdir)/scintilla/src/Editor.cxx
        $(CXXC) -c -o $@ $(STCDLL_CXXFLAGS) $<
 
+stcdll_ExternalLexer.o: $(srcdir)/scintilla/src/ExternalLexer.cxx
+       $(CXXC) -c -o $@ $(STCDLL_CXXFLAGS) $<
+
 stcdll_Indicator.o: $(srcdir)/scintilla/src/Indicator.cxx
        $(CXXC) -c -o $@ $(STCDLL_CXXFLAGS) $<
 
 stcdll_Indicator.o: $(srcdir)/scintilla/src/Indicator.cxx
        $(CXXC) -c -o $@ $(STCDLL_CXXFLAGS) $<
 
@@ -200,6 +249,9 @@ stcdll_LexConf.o: $(srcdir)/scintilla/src/LexConf.cxx
 stcdll_LexCrontab.o: $(srcdir)/scintilla/src/LexCrontab.cxx
        $(CXXC) -c -o $@ $(STCDLL_CXXFLAGS) $<
 
 stcdll_LexCrontab.o: $(srcdir)/scintilla/src/LexCrontab.cxx
        $(CXXC) -c -o $@ $(STCDLL_CXXFLAGS) $<
 
+stcdll_LexEScript.o: $(srcdir)/scintilla/src/LexEScript.cxx
+       $(CXXC) -c -o $@ $(STCDLL_CXXFLAGS) $<
+
 stcdll_LexEiffel.o: $(srcdir)/scintilla/src/LexEiffel.cxx
        $(CXXC) -c -o $@ $(STCDLL_CXXFLAGS) $<
 
 stcdll_LexEiffel.o: $(srcdir)/scintilla/src/LexEiffel.cxx
        $(CXXC) -c -o $@ $(STCDLL_CXXFLAGS) $<
 
@@ -212,6 +264,9 @@ stcdll_LexHTML.o: $(srcdir)/scintilla/src/LexHTML.cxx
 stcdll_LexLisp.o: $(srcdir)/scintilla/src/LexLisp.cxx
        $(CXXC) -c -o $@ $(STCDLL_CXXFLAGS) $<
 
 stcdll_LexLisp.o: $(srcdir)/scintilla/src/LexLisp.cxx
        $(CXXC) -c -o $@ $(STCDLL_CXXFLAGS) $<
 
+stcdll_LexLout.o: $(srcdir)/scintilla/src/LexLout.cxx
+       $(CXXC) -c -o $@ $(STCDLL_CXXFLAGS) $<
+
 stcdll_LexLua.o: $(srcdir)/scintilla/src/LexLua.cxx
        $(CXXC) -c -o $@ $(STCDLL_CXXFLAGS) $<
 
 stcdll_LexLua.o: $(srcdir)/scintilla/src/LexLua.cxx
        $(CXXC) -c -o $@ $(STCDLL_CXXFLAGS) $<
 
@@ -281,9 +336,9 @@ stcdll_XPM.o: $(srcdir)/scintilla/src/XPM.cxx
 stcdll_stc.o: $(srcdir)/stc.cpp
        $(CXXC) -c -o $@ $(STCDLL_CXXFLAGS) $<
 
 stcdll_stc.o: $(srcdir)/stc.cpp
        $(CXXC) -c -o $@ $(STCDLL_CXXFLAGS) $<
 
-@COND_SHARED_0@$(top_builddir)lib/libwx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc-2.5.a: stclib_PlatWX.o stclib_ScintillaWX.o stclib_stc.o stclib_AutoComplete.o stclib_CallTip.o stclib_CellBuffer.o stclib_ContractionState.o stclib_Document.o stclib_DocumentAccessor.o stclib_Editor.o stclib_Indicator.o stclib_KeyMap.o stclib_KeyWords.o stclib_LexAVE.o stclib_LexAda.o stclib_LexAsm.o stclib_LexBaan.o stclib_LexBullant.o stclib_LexCPP.o stclib_LexCSS.o stclib_LexConf.o stclib_LexCrontab.o stclib_LexEiffel.o stclib_LexFortran.o stclib_LexHTML.o stclib_LexLisp.o stclib_LexLua.o stclib_LexMatlab.o stclib_LexOthers.o stclib_LexPOV.o stclib_LexPascal.o stclib_LexPerl.o stclib_LexPython.o stclib_LexRuby.o stclib_LexSQL.o stclib_LexVB.o stclib_LineMarker.o stclib_PropSet.o stclib_RESearch.o stclib_ScintillaBase.o stclib_Style.o stclib_StyleContext.o stclib_UniConversion.o stclib_ViewStyle.o stclib_WindowAccessor.o stclib_XPM.o
+@COND_SHARED_0@$(top_builddir)lib/libwx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_stc-2.5$(HOST_SUFFIX).a: stclib_PlatWX.o stclib_ScintillaWX.o stclib_stc.o stclib_AutoComplete.o stclib_CallTip.o stclib_CellBuffer.o stclib_ContractionState.o stclib_Document.o stclib_DocumentAccessor.o stclib_Editor.o stclib_ExternalLexer.o stclib_Indicator.o stclib_KeyMap.o stclib_KeyWords.o stclib_LexAVE.o stclib_LexAda.o stclib_LexAsm.o stclib_LexBaan.o stclib_LexBullant.o stclib_LexCPP.o stclib_LexCSS.o stclib_LexConf.o stclib_LexCrontab.o stclib_LexEiffel.o stclib_LexEScript.o stclib_LexFortran.o stclib_LexHTML.o stclib_LexLisp.o stclib_LexLout.o stclib_LexLua.o stclib_LexMatlab.o stclib_LexOthers.o stclib_LexPOV.o stclib_LexPascal.o stclib_LexPerl.o stclib_LexPython.o stclib_LexRuby.o stclib_LexSQL.o stclib_LexVB.o stclib_LineMarker.o stclib_PropSet.o stclib_RESearch.o stclib_ScintillaBase.o stclib_Style.o stclib_StyleContext.o stclib_UniConversion.o stclib_ViewStyle.o stclib_WindowAccessor.o stclib_XPM.o
 @COND_SHARED_0@        rm -f $@
 @COND_SHARED_0@        rm -f $@
-@COND_SHARED_0@        $(AR) rcu $@  stclib_PlatWX.o stclib_ScintillaWX.o stclib_stc.o stclib_AutoComplete.o stclib_CallTip.o stclib_CellBuffer.o stclib_ContractionState.o stclib_Document.o stclib_DocumentAccessor.o stclib_Editor.o stclib_Indicator.o stclib_KeyMap.o stclib_KeyWords.o stclib_LexAVE.o stclib_LexAda.o stclib_LexAsm.o stclib_LexBaan.o stclib_LexBullant.o stclib_LexCPP.o stclib_LexCSS.o stclib_LexConf.o stclib_LexCrontab.o stclib_LexEiffel.o stclib_LexFortran.o stclib_LexHTML.o stclib_LexLisp.o stclib_LexLua.o stclib_LexMatlab.o stclib_LexOthers.o stclib_LexPOV.o stclib_LexPascal.o stclib_LexPerl.o stclib_LexPython.o stclib_LexRuby.o stclib_LexSQL.o stclib_LexVB.o stclib_LineMarker.o stclib_PropSet.o stclib_RESearch.o stclib_ScintillaBase.o stclib_Style.o stclib_StyleContext.o stclib_UniConversion.o stclib_ViewStyle.o stclib_WindowAccessor.o stclib_XPM.o
+@COND_SHARED_0@        $(AR) rcu $@  stclib_PlatWX.o stclib_ScintillaWX.o stclib_stc.o stclib_AutoComplete.o stclib_CallTip.o stclib_CellBuffer.o stclib_ContractionState.o stclib_Document.o stclib_DocumentAccessor.o stclib_Editor.o stclib_ExternalLexer.o stclib_Indicator.o stclib_KeyMap.o stclib_KeyWords.o stclib_LexAVE.o stclib_LexAda.o stclib_LexAsm.o stclib_LexBaan.o stclib_LexBullant.o stclib_LexCPP.o stclib_LexCSS.o stclib_LexConf.o stclib_LexCrontab.o stclib_LexEiffel.o stclib_LexEScript.o stclib_LexFortran.o stclib_LexHTML.o stclib_LexLisp.o stclib_LexLout.o stclib_LexLua.o stclib_LexMatlab.o stclib_LexOthers.o stclib_LexPOV.o stclib_LexPascal.o stclib_LexPerl.o stclib_LexPython.o stclib_LexRuby.o stclib_LexSQL.o stclib_LexVB.o stclib_LineMarker.o stclib_PropSet.o stclib_RESearch.o stclib_ScintillaBase.o stclib_Style.o stclib_StyleContext.o stclib_UniConversion.o stclib_ViewStyle.o stclib_WindowAccessor.o stclib_XPM.o
 @COND_SHARED_0@        $(RANLIB) $@
 
 stclib_AutoComplete.o: $(srcdir)/scintilla/src/AutoComplete.cxx
 @COND_SHARED_0@        $(RANLIB) $@
 
 stclib_AutoComplete.o: $(srcdir)/scintilla/src/AutoComplete.cxx
@@ -307,6 +362,9 @@ stclib_DocumentAccessor.o: $(srcdir)/scintilla/src/DocumentAccessor.cxx
 stclib_Editor.o: $(srcdir)/scintilla/src/Editor.cxx
        $(CXXC) -c -o $@ $(STCLIB_CXXFLAGS) $<
 
 stclib_Editor.o: $(srcdir)/scintilla/src/Editor.cxx
        $(CXXC) -c -o $@ $(STCLIB_CXXFLAGS) $<
 
+stclib_ExternalLexer.o: $(srcdir)/scintilla/src/ExternalLexer.cxx
+       $(CXXC) -c -o $@ $(STCLIB_CXXFLAGS) $<
+
 stclib_Indicator.o: $(srcdir)/scintilla/src/Indicator.cxx
        $(CXXC) -c -o $@ $(STCLIB_CXXFLAGS) $<
 
 stclib_Indicator.o: $(srcdir)/scintilla/src/Indicator.cxx
        $(CXXC) -c -o $@ $(STCLIB_CXXFLAGS) $<
 
@@ -343,6 +401,9 @@ stclib_LexConf.o: $(srcdir)/scintilla/src/LexConf.cxx
 stclib_LexCrontab.o: $(srcdir)/scintilla/src/LexCrontab.cxx
        $(CXXC) -c -o $@ $(STCLIB_CXXFLAGS) $<
 
 stclib_LexCrontab.o: $(srcdir)/scintilla/src/LexCrontab.cxx
        $(CXXC) -c -o $@ $(STCLIB_CXXFLAGS) $<
 
+stclib_LexEScript.o: $(srcdir)/scintilla/src/LexEScript.cxx
+       $(CXXC) -c -o $@ $(STCLIB_CXXFLAGS) $<
+
 stclib_LexEiffel.o: $(srcdir)/scintilla/src/LexEiffel.cxx
        $(CXXC) -c -o $@ $(STCLIB_CXXFLAGS) $<
 
 stclib_LexEiffel.o: $(srcdir)/scintilla/src/LexEiffel.cxx
        $(CXXC) -c -o $@ $(STCLIB_CXXFLAGS) $<
 
@@ -355,6 +416,9 @@ stclib_LexHTML.o: $(srcdir)/scintilla/src/LexHTML.cxx
 stclib_LexLisp.o: $(srcdir)/scintilla/src/LexLisp.cxx
        $(CXXC) -c -o $@ $(STCLIB_CXXFLAGS) $<
 
 stclib_LexLisp.o: $(srcdir)/scintilla/src/LexLisp.cxx
        $(CXXC) -c -o $@ $(STCLIB_CXXFLAGS) $<
 
+stclib_LexLout.o: $(srcdir)/scintilla/src/LexLout.cxx
+       $(CXXC) -c -o $@ $(STCLIB_CXXFLAGS) $<
+
 stclib_LexLua.o: $(srcdir)/scintilla/src/LexLua.cxx
        $(CXXC) -c -o $@ $(STCLIB_CXXFLAGS) $<
 
 stclib_LexLua.o: $(srcdir)/scintilla/src/LexLua.cxx
        $(CXXC) -c -o $@ $(STCLIB_CXXFLAGS) $<
 
index bcb44e5bc34d39b20b503c08721a019df861af86..eb21c76bb2b8f7ca4340870310cf39acb3ec9feb 100644 (file)
@@ -1062,6 +1062,13 @@ void Menu::Show(Point pt, Window &w) {
 
 //----------------------------------------------------------------------
 
 
 //----------------------------------------------------------------------
 
+DynamicLibrary *DynamicLibrary::Load(const char *modulePath) {
+    wxFAIL_MSG(wxT("Dynamic lexer loading not implemented yet"));
+    return NULL;
+}
+
+//----------------------------------------------------------------------
+
 ColourDesired Platform::Chrome() {
     wxColour c;
     c = wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE);
 ColourDesired Platform::Chrome() {
     wxColour c;
     c = wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE);
index 059dd4afaae05a5d43f6a991792d3eeffd47bee8..3e5ebf0aa601b080725de47a78aae96f1b384435 100644 (file)
@@ -16,6 +16,7 @@
 
 
 #include "ScintillaWX.h"
 
 
 #include "ScintillaWX.h"
+#include "ExternalLexer.h"
 #include "wx/stc/stc.h"
 #include "PlatWX.h"
 
 #include "wx/stc/stc.h"
 #include "PlatWX.h"
 
@@ -337,12 +338,7 @@ void ScintillaWX::Copy() {
     if (currentPos != anchor) {
         SelectionText st;
         CopySelectionRange(&st);
     if (currentPos != anchor) {
         SelectionText st;
         CopySelectionRange(&st);
-        if (wxTheClipboard->Open()) {
-            wxTheClipboard->UsePrimarySelection(FALSE);
-            wxString text = stc2wx(st.s, st.len);
-            wxTheClipboard->SetData(new wxTextDataObject(text));
-            wxTheClipboard->Close();
-        }
+        CopyToClipboard(st);
     }
 }
 
     }
 }
 
@@ -372,6 +368,16 @@ void ScintillaWX::Paste() {
 }
 
 
 }
 
 
+void ScintillaWX::CopyToClipboard(const SelectionText& st) {
+    if (wxTheClipboard->Open()) {
+        wxTheClipboard->UsePrimarySelection(FALSE);
+        wxString text = stc2wx(st.s, st.len);
+        wxTheClipboard->SetData(new wxTextDataObject(text));
+        wxTheClipboard->Close();
+    }
+}
+
+
 bool ScintillaWX::CanPaste() {
     bool canPaste = FALSE;
     bool didOpen;
 bool ScintillaWX::CanPaste() {
     bool canPaste = FALSE;
     bool didOpen;
@@ -474,6 +480,11 @@ long ScintillaWX::WndProc(unsigned int iMessage, unsigned long wParam, long lPar
           break;
       }
 
           break;
       }
 
+#ifdef SCI_LEXER
+       case SCI_LOADLEXERLIBRARY:
+            LexerManager::GetInstance()->Load((const char*)lParam);
+            break;
+#endif
       default:
           return ScintillaBase::WndProc(iMessage, wParam, lParam);
       }
       default:
           return ScintillaBase::WndProc(iMessage, wParam, lParam);
       }
index 4c6b35c6e3276e05ca65aa4743b1284a840829bb..506fa252d5185ee58a38d5f586d49e598f89b3a1 100644 (file)
@@ -100,6 +100,8 @@ public:
     virtual bool ModifyScrollBars(int nMax, int nPage);
     virtual void Copy();
     virtual void Paste();
     virtual bool ModifyScrollBars(int nMax, int nPage);
     virtual void Copy();
     virtual void Paste();
+    virtual void CopyToClipboard(const SelectionText &selectedText);
+
     virtual void CreateCallTipWindow(PRectangle rc);
     virtual void AddToPopUp(const char *label, int cmd = 0, bool enabled = true);
     virtual void ClaimSelection();
     virtual void CreateCallTipWindow(PRectangle rc);
     virtual void AddToPopUp(const char *label, int cmd = 0, bool enabled = true);
     virtual void ClaimSelection();
index 4f5b08f1cb81993e00bd72d2e1ddc16512ae23c2..bba521448edeccdec80c79562152a0ff2fb3ac18 100644 (file)
@@ -3,4 +3,4 @@ scintilla/include directories from the Scintilla/SCiTE source
 distribution.  All other code needed to implement Scintilla on top of
 wxWindows is located in the directory above this one.
 
 distribution.  All other code needed to implement Scintilla on top of
 wxWindows is located in the directory above this one.
 
-The current version of the Scintilla code is 1.52
+The current version of the Scintilla code is 1.53
index 7f5985c7657bd39d2fec7197cd487aa1be985bd6..4f7ba2357c3230fe6386b6335f7e5393cb457ae3 100644 (file)
@@ -57,6 +57,7 @@ typedef void *SurfaceID;
 typedef void *WindowID;
 typedef void *MenuID;
 typedef void *TickerID;
 typedef void *WindowID;
 typedef void *MenuID;
 typedef void *TickerID;
+typedef void *Function;
 
 /**
  * A geometric point class.
 
 /**
  * A geometric point class.
@@ -434,6 +435,23 @@ public:
        double Duration(bool reset=false);
 };
 
        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.
 /**
  * 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.
index 3f1b64f77fc89ea026e39a9730cfc157e441c6e2..1a7e2f166536cfb248906cd498759354430f5a51 100644 (file)
@@ -38,7 +38,7 @@ public:
        void SetMultiple(const char *s);
        SString Get(const char *key);
        SString GetExpanded(const char *key);
        void SetMultiple(const char *s);
        SString Get(const char *key);
        SString GetExpanded(const char *key);
-       SString Expand(const char *withVars);
+       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="");
        int GetInt(const char *key, int defaultValue=0);
        SString GetWild(const char *keybase, const char *filename);
        SString GetNewExpand(const char *keybase, const char *filename="");
index e1da492b279f122423d359d340eff396e953e7fb..edf4bd0d2478a49d7582da041f273c51b7c48a1f 100644 (file)
@@ -54,6 +54,8 @@
 #define SCLEX_F77 37
 #define SCLEX_CSS 38
 #define SCLEX_POV 39
 #define SCLEX_F77 37
 #define SCLEX_CSS 38
 #define SCLEX_POV 39
+#define SCLEX_LOUT 40
+#define SCLEX_ESCRIPT 41
 #define SCLEX_AUTOMATIC 1000
 #define SCE_P_DEFAULT 0
 #define SCE_P_COMMENTLINE 1
 #define SCLEX_AUTOMATIC 1000
 #define SCE_P_DEFAULT 0
 #define SCE_P_COMMENTLINE 1
@@ -88,6 +90,7 @@
 #define SCE_C_WORD2 16
 #define SCE_C_COMMENTDOCKEYWORD 17
 #define SCE_C_COMMENTDOCKEYWORDERROR 18
 #define SCE_C_WORD2 16
 #define SCE_C_COMMENTDOCKEYWORD 17
 #define SCE_C_COMMENTDOCKEYWORDERROR 18
+#define SCE_C_GLOBALCLASS 19
 #define SCE_H_DEFAULT 0
 #define SCE_H_TAG 1
 #define SCE_H_TAGUNKNOWN 2
 #define SCE_H_DEFAULT 0
 #define SCE_H_TAG 1
 #define SCE_H_TAGUNKNOWN 2
 #define SCE_POV_IDENTIFIER 8
 #define SCE_POV_BRACE 9
 #define SCE_POV_WORD2 10
 #define SCE_POV_IDENTIFIER 8
 #define SCE_POV_BRACE 9
 #define SCE_POV_WORD2 10
+#define SCE_LOUT_DEFAULT 0
+#define SCE_LOUT_COMMENT 1
+#define SCE_LOUT_NUMBER 2
+#define SCE_LOUT_WORD 3
+#define SCE_LOUT_WORD2 4
+#define SCE_LOUT_WORD3 5
+#define SCE_LOUT_WORD4 6
+#define SCE_LOUT_STRING 7
+#define SCE_LOUT_OPERATOR 8
+#define SCE_LOUT_IDENTIFIER 9
+#define SCE_LOUT_STRINGEOL 10
+#define SCE_ESCRIPT_DEFAULT 0
+#define SCE_ESCRIPT_COMMENT 1
+#define SCE_ESCRIPT_COMMENTLINE 2
+#define SCE_ESCRIPT_COMMENTDOC 3
+#define SCE_ESCRIPT_NUMBER 4
+#define SCE_ESCRIPT_WORD 5
+#define SCE_ESCRIPT_STRING 6
+#define SCE_ESCRIPT_OPERATOR 7
+#define SCE_ESCRIPT_IDENTIFIER 8
+#define SCE_ESCRIPT_BRACE 9
+#define SCE_ESCRIPT_WORD2 10
+#define SCE_ESCRIPT_WORD3 11
 //--Autogenerated -- end of section automatically generated from Scintilla.iface
 
 #endif
 //--Autogenerated -- end of section automatically generated from Scintilla.iface
 
 #endif
index c377d07cc20a90b6957832351f25b69d4b4dda77..250f793142b885bc75588c8dcdec876a7f969b40 100644 (file)
@@ -464,6 +464,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
 #define SCI_LINEENDWRAPEXTEND 2452
 #define SCI_VCHOMEWRAP 2453
 #define SCI_VCHOMEWRAPEXTEND 2454
 #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_MOVECARETINSIDEVIEW 2401
 #define SCI_LINELENGTH 2350
 #define SCI_BRACEHIGHLIGHT 2351
@@ -535,6 +536,10 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
 #define SCI_PARADOWNEXTEND 2414
 #define SCI_PARAUP 2415
 #define SCI_PARAUPEXTEND 2416
 #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 SCI_STARTRECORD 3001
 #define SCI_STOPRECORD 3002
 #define SCI_SETLEXER 4001
 #define SCI_STARTRECORD 3001
 #define SCI_STOPRECORD 3002
 #define SCI_SETLEXER 4001
index c5dacbdf048033cd972491020e66635bb7f88c05..2ac0b66f5037c478861b2ad75add2980948547be 100644 (file)
@@ -1231,6 +1231,9 @@ fun void LineEndWrapExtend=2452(,)
 fun void VCHomeWrap=2453(,)
 fun void VCHomeWrapExtend=2454(,)
 
 fun void VCHomeWrap=2453(,)
 fun void VCHomeWrapExtend=2454(,)
 
+# Copy the line containing the caret.
+fun void LineCopy=2455(,)
+
 # Move the caret inside current view if it's not there already.
 fun void MoveCaretInsideView=2401(,)
 
 # Move the caret inside current view if it's not there already.
 fun void MoveCaretInsideView=2401(,)
 
@@ -1441,6 +1444,20 @@ fun void ParaDownExtend=2414(,)
 fun void ParaUp=2415(,)
 fun void ParaUpExtend=2416(,)
 
 fun void ParaUp=2415(,)
 fun void ParaUpExtend=2416(,)
 
+# Given a valid document position, return the previous position taking code
+# page into account. Returns 0 if passed 0.
+fun position PositionBefore=2417(position pos,)
+
+# Given a valid document position, return the next position taking code
+# page into account. Maximum value returned is the last position in the document.
+fun position PositionAfter=2418(position pos,)
+
+# Copy a range of text to the clipboard. Positions are clipped into the document.
+fun void CopyRange=2419(position start, position end)
+
+# Copy argument text to the clipboard.
+fun void CopyText=2420(int length, string text)
+
 # Start notifying the container of all key presses and commands.
 fun void StartRecord=3001(,)
 
 # Start notifying the container of all key presses and commands.
 fun void StartRecord=3001(,)
 
@@ -1466,7 +1483,6 @@ set void SetKeyWords=4005(int keywordSet, string keyWords)
 set void SetLexerLanguage=4006(, string language)
 
 # Load a lexer library (dll / so)
 set void SetLexerLanguage=4006(, string language)
 
 # Load a lexer library (dll / so)
-# NOT YET IMPLEMENTED
 fun void LoadLexerLibrary=4007(, string path)
 
 # Notifications
 fun void LoadLexerLibrary=4007(, string path)
 
 # Notifications
@@ -1566,6 +1582,8 @@ val SCLEX_FORTRAN=36
 val SCLEX_F77=37
 val SCLEX_CSS=38
 val SCLEX_POV=39
 val SCLEX_F77=37
 val SCLEX_CSS=38
 val SCLEX_POV=39
+val SCLEX_LOUT=40
+val SCLEX_ESCRIPT=41
 
 # When a lexer specifies its language as SCLEX_AUTOMATIC it receives a
 # value assigned in sequence from SCLEX_AUTOMATIC+1.
 
 # When a lexer specifies its language as SCLEX_AUTOMATIC it receives a
 # value assigned in sequence from SCLEX_AUTOMATIC+1.
@@ -1612,6 +1630,7 @@ val SCE_C_COMMENTLINEDOC=15
 val SCE_C_WORD2=16
 val SCE_C_COMMENTDOCKEYWORD=17
 val SCE_C_COMMENTDOCKEYWORDERROR=18
 val SCE_C_WORD2=16
 val SCE_C_COMMENTDOCKEYWORD=17
 val SCE_C_COMMENTDOCKEYWORDERROR=18
+val SCE_C_GLOBALCLASS=19
 # Lexical states for SCLEX_HTML, SCLEX_XML
 lex HTML=SCLEX_HTML SCE_H
 lex XML=SCLEX_XML SCE_H
 # Lexical states for SCLEX_HTML, SCLEX_XML
 lex HTML=SCLEX_HTML SCE_H
 lex XML=SCLEX_XML SCE_H
@@ -2047,6 +2066,34 @@ val SCE_POV_OPERATOR=7
 val SCE_POV_IDENTIFIER=8
 val SCE_POV_BRACE=9
 val SCE_POV_WORD2=10
 val SCE_POV_IDENTIFIER=8
 val SCE_POV_BRACE=9
 val SCE_POV_WORD2=10
+# Lexical states for SCLEX_LOUT
+lex LOUT=SCLEX_LOUT SCE_LOUT_
+val SCE_LOUT_DEFAULT=0
+val SCE_LOUT_COMMENT=1
+val SCE_LOUT_NUMBER=2
+val SCE_LOUT_WORD=3
+val SCE_LOUT_WORD2=4
+val SCE_LOUT_WORD3=5
+val SCE_LOUT_WORD4=6
+val SCE_LOUT_STRING=7
+val SCE_LOUT_OPERATOR=8
+val SCE_LOUT_IDENTIFIER=9
+val SCE_LOUT_STRINGEOL=10
+# Lexical states for SCLEX_ESCRIPT
+lex ESCRIPT=SCLEX_ESCRIPT SCE_ESCRIPT_
+val SCE_ESCRIPT_DEFAULT=0
+val SCE_ESCRIPT_COMMENT=1
+val SCE_ESCRIPT_COMMENTLINE=2
+val SCE_ESCRIPT_COMMENTDOC=3
+val SCE_ESCRIPT_NUMBER=4
+val SCE_ESCRIPT_WORD=5
+val SCE_ESCRIPT_STRING=6
+val SCE_ESCRIPT_OPERATOR=7
+val SCE_ESCRIPT_IDENTIFIER=8
+val SCE_ESCRIPT_BRACE=9
+val SCE_ESCRIPT_WORD2=10
+val SCE_ESCRIPT_WORD3=11
+
 # Events
 
 evt void StyleNeeded=2000(int position)
 # Events
 
 evt void StyleNeeded=2000(int position)
index 20900bcf97ab4ea310e0c89d167fa4857ceff822..98fc6b330ca986d3ed15b0d556bdf7f9784d09f3 100644 (file)
@@ -265,7 +265,7 @@ int Document::LenChar(int pos) {
                return 1;
        }
 }
                return 1;
        }
 }
-
+#include <assert.h>
 // Normalise a position so that it is not halfway through a two byte character.
 // This can occur in two situations -
 // When lines are terminated with \r\n pairs which should be treated as one character.
 // Normalise a position so that it is not halfway through a two byte character.
 // This can occur in two situations -
 // When lines are terminated with \r\n pairs which should be treated as one character.
@@ -273,17 +273,11 @@ int Document::LenChar(int pos) {
 // If moving, move the position in the indicated direction.
 int Document::MovePositionOutsideChar(int pos, int moveDir, bool checkLineEnd) {
        //Platform::DebugPrintf("NoCRLF %d %d\n", pos, moveDir);
 // If moving, move the position in the indicated direction.
 int Document::MovePositionOutsideChar(int pos, int moveDir, bool checkLineEnd) {
        //Platform::DebugPrintf("NoCRLF %d %d\n", pos, moveDir);
-       // If out of range, just return value - should be fixed up after
-       if (pos < 0)
-               return pos;
-       if (pos > Length())
-               return pos;
-
-       // Position 0 and Length() can not be between any two characters
-       if (pos == 0)
-               return pos;
-       if (pos == Length())
-               return pos;
+       // If out of range, just return minimum/maximum value.
+       if (pos <= 0)
+               return 0;
+       if (pos >= Length())
+               return Length();
 
        // assert pos > 0 && pos < Length()
        if (checkLineEnd && IsCrLf(pos - 1)) {
 
        // assert pos > 0 && pos < Length()
        if (checkLineEnd && IsCrLf(pos - 1)) {
@@ -309,29 +303,26 @@ int Document::MovePositionOutsideChar(int pos, int moveDir, bool checkLineEnd) {
                } else {
                        // Anchor DBCS calculations at start of line because start of line can
                        // not be a DBCS trail byte.
                } else {
                        // Anchor DBCS calculations at start of line because start of line can
                        // not be a DBCS trail byte.
-                       int startLine = pos;
-
-                       while (startLine > 0 && cb.CharAt(startLine) != '\r' && cb.CharAt(startLine) != '\n')
-                               startLine--;
-                       while (startLine < pos) {
+                       int posCheck = LineStart(LineFromPosition(pos));
+                       while (posCheck < pos) {
                                char mbstr[maxBytesInDBCSCharacter+1];
                                int i;
                                for(i=0;i<Platform::DBCSCharMaxLength();i++) {
                                char mbstr[maxBytesInDBCSCharacter+1];
                                int i;
                                for(i=0;i<Platform::DBCSCharMaxLength();i++) {
-                                       mbstr[i] = cb.CharAt(startLine+i);
+                                       mbstr[i] = cb.CharAt(posCheck+i);
                                }
                                mbstr[i] = '\0';
 
                                int mbsize = Platform::DBCSCharLength(dbcsCodePage, mbstr);
                                }
                                mbstr[i] = '\0';
 
                                int mbsize = Platform::DBCSCharLength(dbcsCodePage, mbstr);
-                               if (startLine + mbsize == pos) {
+                               if (posCheck + mbsize == pos) {
                                        return pos;
                                        return pos;
-                               } else if (startLine + mbsize > pos) {
+                               } else if (posCheck + mbsize > pos) {
                                        if (moveDir > 0) {
                                        if (moveDir > 0) {
-                                               return startLine + mbsize;
+                                               return posCheck + mbsize;
                                        } else {
                                        } else {
-                                               return startLine;
+                                               return posCheck;
                                        }
                                }
                                        }
                                }
-                               startLine += mbsize;
+                               posCheck += mbsize;
                        }
                }
        }
                        }
                }
        }
index e6b7df0be15e857df1c9a92f50b2606537aba1cf..cc53f5aac85cdea2e0f00ef5b502dc96f92f14df 100644 (file)
@@ -1,7 +1,6 @@
 // Scintilla source code edit control
 /** @file Editor.cxx
  ** Main code for the edit control.
 // Scintilla source code edit control
 /** @file Editor.cxx
  ** Main code for the edit control.
-       Last change:  JS   18 Jun 103    1:08 am
  **/
 // Copyright 1998-2003 by Neil Hodgson <neilh@scintilla.org>
 // The License.txt file describes the conditions under which this software may be distributed.
  **/
 // Copyright 1998-2003 by Neil Hodgson <neilh@scintilla.org>
 // The License.txt file describes the conditions under which this software may be distributed.
@@ -712,7 +711,9 @@ void Editor::RedrawRect(PRectangle rc) {
 
 void Editor::Redraw() {
        //Platform::DebugPrintf("Redraw all\n");
 
 void Editor::Redraw() {
        //Platform::DebugPrintf("Redraw all\n");
-       wMain.InvalidateAll();
+       PRectangle rcClient = GetClientRectangle();
+       wMain.InvalidateRectangle(rcClient);
+       //wMain.InvalidateAll();
 }
 
 void Editor::RedrawSelMargin() {
 }
 
 void Editor::RedrawSelMargin() {
@@ -1577,8 +1578,15 @@ void Editor::PaintSelMargin(Surface *surfWindow, PRectangle &rc) {
                                        number[0] = '\0';
                                        if (firstSubLine)
                                                sprintf(number, "%d", lineDoc + 1);
                                        number[0] = '\0';
                                        if (firstSubLine)
                                                sprintf(number, "%d", lineDoc + 1);
-                                       if (foldFlags & SC_FOLDFLAG_LEVELNUMBERS)
-                                               sprintf(number, "%X", pdoc->GetLevel(lineDoc));
+                                       if (foldFlags & SC_FOLDFLAG_LEVELNUMBERS) {
+                                               int lev = pdoc->GetLevel(lineDoc);
+                                               sprintf(number, "%c%c %03X %03X",
+                                                       (lev & SC_FOLDLEVELHEADERFLAG) ? 'H' : '_',
+                                                       (lev & SC_FOLDLEVELWHITEFLAG) ? 'W' : '_',
+                                                       lev & SC_FOLDLEVELNUMBERMASK,
+                                                       lev >> 16
+                                               );
+                                       }
                                        PRectangle rcNumber = rcMarker;
                                        // Right justify
                                        int width = surface->WidthText(vs.styles[STYLE_LINENUMBER].font, number, strlen(number));
                                        PRectangle rcNumber = rcMarker;
                                        // Right justify
                                        int width = surface->WidthText(vs.styles[STYLE_LINENUMBER].font, number, strlen(number));
@@ -2354,11 +2362,6 @@ void Editor::Paint(Surface *surfaceWindow, PRectangle rcArea) {
                }
        }
 
                }
        }
 
-        // Workaround by JACS: sometimes due to a re-entry condition,
-        // pixmapLine becomes uninitialised, followed by a crash.
-        if (!pixmapLine->Initialised())
-                return;
-
        PRectangle rcRightMargin = rcClient;
        rcRightMargin.left = rcRightMargin.right - vs.rightMarginWidth;
        if (rcArea.Intersects(rcRightMargin)) {
        PRectangle rcRightMargin = rcClient;
        rcRightMargin.left = rcRightMargin.right - vs.rightMarginWidth;
        if (rcArea.Intersects(rcRightMargin)) {
@@ -2482,7 +2485,7 @@ void Editor::Paint(Surface *surfaceWindow, PRectangle rcArea) {
                                } else {
                                        int FoldLevelCurr = (pdoc->GetLevel(lineDoc) & SC_FOLDLEVELNUMBERMASK) - SC_FOLDLEVELBASE;
                                        int FoldLevelPrev = (pdoc->GetLevel(lineDoc - 1) & SC_FOLDLEVELNUMBERMASK) - SC_FOLDLEVELBASE;
                                } else {
                                        int FoldLevelCurr = (pdoc->GetLevel(lineDoc) & SC_FOLDLEVELNUMBERMASK) - SC_FOLDLEVELBASE;
                                        int FoldLevelPrev = (pdoc->GetLevel(lineDoc - 1) & SC_FOLDLEVELNUMBERMASK) - SC_FOLDLEVELBASE;
-                                       int FoldLevelFlags = (pdoc->GetLevel(lineDoc) & ~SC_FOLDLEVELNUMBERMASK);
+                                       int FoldLevelFlags = (pdoc->GetLevel(lineDoc) & ~SC_FOLDLEVELNUMBERMASK) & ~(0xFFF0000);
                                        int indentationStep = (pdoc->indentInChars ? pdoc->indentInChars : pdoc->tabInChars);
                                        // Draw line above fold
                                        if ((FoldLevelPrev < FoldLevelCurr)
                                        int indentationStep = (pdoc->indentInChars ? pdoc->indentInChars : pdoc->tabInChars);
                                        // Draw line above fold
                                        if ((FoldLevelPrev < FoldLevelCurr)
@@ -3438,6 +3441,7 @@ void Editor::NotifyMacroRecord(unsigned int iMessage, unsigned long wParam, long
        case SCI_DELWORDRIGHT:
        case SCI_DELLINELEFT:
        case SCI_DELLINERIGHT:
        case SCI_DELWORDRIGHT:
        case SCI_DELLINELEFT:
        case SCI_DELLINERIGHT:
+       case SCI_LINECOPY:
        case SCI_LINECUT:
        case SCI_LINEDELETE:
        case SCI_LINETRANSPOSE:
        case SCI_LINECUT:
        case SCI_LINEDELETE:
        case SCI_LINETRANSPOSE:
@@ -3876,18 +3880,21 @@ int Editor::KeyCommand(unsigned int iMessage) {
                        pdoc->DeleteChars(currentPos, end - currentPos);
                }
                break;
                        pdoc->DeleteChars(currentPos, end - currentPos);
                }
                break;
+       case SCI_LINECOPY: {
+                       int lineStart = pdoc->LineFromPosition(SelectionStart());
+                       int lineEnd = pdoc->LineFromPosition(SelectionEnd());
+                       CopyRangeToClipboard(pdoc->LineStart(lineStart),
+                               pdoc->LineStart(lineEnd + 1));
+               }
+               break;
        case SCI_LINECUT: {
        case SCI_LINECUT: {
-                       int lineStart = pdoc->LineFromPosition(currentPos);
-                       int lineEnd = pdoc->LineFromPosition(anchor);
-                       if (lineStart > lineEnd) {
-                               int t = lineEnd;
-                               lineEnd = lineStart;
-                               lineStart = t;
-                       }
+                       int lineStart = pdoc->LineFromPosition(SelectionStart());
+                       int lineEnd = pdoc->LineFromPosition(SelectionEnd());
                        int start = pdoc->LineStart(lineStart);
                        int end = pdoc->LineStart(lineEnd + 1);
                        SetSelection(start, end);
                        Cut();
                        int start = pdoc->LineStart(lineStart);
                        int end = pdoc->LineStart(lineEnd + 1);
                        SetSelection(start, end);
                        Cut();
+                       SetLastXChosen();
                }
                break;
        case SCI_LINEDELETE: {
                }
                break;
        case SCI_LINEDELETE: {
@@ -4184,10 +4191,14 @@ char *Editor::CopyRange(int start, int end) {
        return text;
 }
 
        return text;
 }
 
+void Editor::CopySelectionFromRange(SelectionText *ss, int start, int end) {
+       ss->Set(CopyRange(start, end), end - start + 1, false);
+}
+
 void Editor::CopySelectionRange(SelectionText *ss) {
 void Editor::CopySelectionRange(SelectionText *ss) {
-       char *text = 0;
-       int size = 0;
        if (selType == selRectangle) {
        if (selType == selRectangle) {
+               char *text = 0;
+               int size = 0;
                int lineStart = pdoc->LineFromPosition(SelectionStart());
                int lineEnd = pdoc->LineFromPosition(SelectionEnd());
                int line;
                int lineStart = pdoc->LineFromPosition(SelectionStart());
                int lineEnd = pdoc->LineFromPosition(SelectionEnd());
                int line;
@@ -4212,11 +4223,24 @@ void Editor::CopySelectionRange(SelectionText *ss) {
                                text[size] = '\0';
                        }
                }
                                text[size] = '\0';
                        }
                }
+               ss->Set(text, size + 1, true);
        } else {
        } else {
-               size = SelectionEnd() - SelectionStart();
-               text = CopyRange(SelectionStart(), SelectionEnd());
+               CopySelectionFromRange(ss, SelectionStart(), SelectionEnd());
        }
        }
-       ss->Set(text, size, selType == selRectangle);
+}
+
+void Editor::CopyRangeToClipboard(int start, int end) {
+       start = pdoc->ClampPositionIntoDocument(start);
+       end = pdoc->ClampPositionIntoDocument(end);
+       SelectionText selectedText;
+       selectedText.Set(CopyRange(start, end), end - start + 1);
+       CopyToClipboard(selectedText);
+}
+
+void Editor::CopyText(int length, const char *text) {
+       SelectionText selectedText;
+       selectedText.Copy(text, length);
+       CopyToClipboard(selectedText);
 }
 
 void Editor::SetDragPosition(int newPos) {
 }
 
 void Editor::SetDragPosition(int newPos) {
@@ -4878,10 +4902,7 @@ void Editor::SetDocPointer(Document *document) {
 
        pdoc->AddWatcher(this, 0);
        Redraw();
 
        pdoc->AddWatcher(this, 0);
        Redraw();
-       // Removed because of reentrance problems of GTK+ 2.x
-       // where changing a scroll bar position causes synchronous
-       // painting before lexer and styling state is set up.
-       //SetScrollBars();
+       SetScrollBars();
 }
 
 // Recursively expand a fold, making lines visible except where they have an unexpanded parent
 }
 
 // Recursively expand a fold, making lines visible except where they have an unexpanded parent
@@ -5046,6 +5067,14 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
                Copy();
                break;
 
                Copy();
                break;
 
+       case SCI_COPYRANGE:
+               CopyRangeToClipboard(wParam, lParam);
+               break;
+
+       case SCI_COPYTEXT:
+               CopyText(wParam, CharPtrFromSPtr(lParam));
+               break;
+
        case SCI_PASTE:
                Paste();
                SetLastXChosen();
        case SCI_PASTE:
                Paste();
                SetLastXChosen();
@@ -5205,6 +5234,12 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
        case SCI_GETSEARCHFLAGS:
                return searchFlags;
 
        case SCI_GETSEARCHFLAGS:
                return searchFlags;
 
+       case SCI_POSITIONBEFORE:
+               return pdoc->MovePositionOutsideChar(wParam-1, -1, true);
+
+       case SCI_POSITIONAFTER:
+               return pdoc->MovePositionOutsideChar(wParam+1, 1, true);
+
        case SCI_LINESCROLL:
                ScrollTo(topLine + lParam);
                HorizontalScrollTo(xOffset + wParam * vs.spaceWidth);
        case SCI_LINESCROLL:
                ScrollTo(topLine + lParam);
                HorizontalScrollTo(xOffset + wParam * vs.spaceWidth);
@@ -6181,6 +6216,7 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
        case SCI_DELWORDRIGHT:
        case SCI_DELLINELEFT:
        case SCI_DELLINERIGHT:
        case SCI_DELWORDRIGHT:
        case SCI_DELLINELEFT:
        case SCI_DELLINERIGHT:
+       case SCI_LINECOPY:
        case SCI_LINECUT:
        case SCI_LINEDELETE:
        case SCI_LINETRANSPOSE:
        case SCI_LINECUT:
        case SCI_LINEDELETE:
        case SCI_LINETRANSPOSE:
index 2cc7930c47d17e27cba1b0b25a5ce437d055be51..bd4669192f7b5690a8877439155509818babf74d 100644 (file)
@@ -133,6 +133,19 @@ public:
                        len = 0;
                rectangular = rectangular_;
        }
                        len = 0;
                rectangular = rectangular_;
        }
+       void Copy(const char *s_, int len_, bool rectangular_=false) {
+               delete []s;
+               s = new char[len_];
+               if (s) {
+                       len = len_;
+                       for (int i = 0; i < len_; i++) {
+                               s[i] = s_[i];
+                       }
+               } else {
+                       len = 0;
+               }
+               rectangular = rectangular_;
+       }
 };
 
 /**
 };
 
 /**
@@ -416,10 +429,14 @@ protected:        // ScintillaBase subclass needs access to much of Editor
        long SearchInTarget(const char *text, int length);
        void GoToLine(int lineNo);
 
        long SearchInTarget(const char *text, int length);
        void GoToLine(int lineNo);
 
+       virtual void CopyToClipboard(const SelectionText &selectedText) = 0;
        char *CopyRange(int start, int end);
        char *CopyRange(int start, int end);
+       void CopySelectionFromRange(SelectionText *ss, int start, int end);
        void CopySelectionRange(SelectionText *ss);
        void CopySelectionRange(SelectionText *ss);
+       void CopyRangeToClipboard(int start, int end);
+       void CopyText(int length, const char *text);
        void SetDragPosition(int newPos);
        void SetDragPosition(int newPos);
-       void DisplayCursor(Window::Cursor c);
+       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.
        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.
diff --git a/src/stc/scintilla/src/ExternalLexer.cxx b/src/stc/scintilla/src/ExternalLexer.cxx
new file mode 100644 (file)
index 0000000..88be76f
--- /dev/null
@@ -0,0 +1,256 @@
+// 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 "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)lib->FindFunction("GetLexerCount");
+
+               if (GetLexerCount) {
+                       ExternalLexerModule *lex;
+                       LexerMinder *lm;
+
+                       // Find functions in the DLL
+                       GetLexerNameFn GetLexerName = (GetLexerNameFn)lib->FindFunction("GetLexerName");
+                       ExtLexerFunction Lexer = (ExtLexerFunction)lib->FindFunction("Lex");
+                       ExtFoldFunction Folder = (ExtFoldFunction)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 = first->next;
+               while (cur) {
+                       delete cur;
+                       cur = next;
+               }
+               first = NULL;
+               last = NULL;
+       }
+}
+
+//------------------------------------------
+//
+// LexerManager
+//
+//------------------------------------------
+
+LMMinder::~LMMinder()
+{
+       LexerManager::DeleteInstance();
+}
+
+LMMinder minder;
diff --git a/src/stc/scintilla/src/ExternalLexer.h b/src/stc/scintilla/src/ExternalLexer.h
new file mode 100644 (file)
index 0000000..01d9ac7
--- /dev/null
@@ -0,0 +1,103 @@
+// 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
+
+#if PLAT_WX
+#ifdef __WXMSW__
+#define EXT_LEXER_DECL __stdcall
+#else
+#define EXT_LEXER_DECL
+#endif
+#endif
+
+// External Lexer function definitions...
+typedef void (EXT_LEXER_DECL *ExtLexerFunction)(unsigned int lexer, unsigned int startPos, int length, int initStyle,
+                  char *words[], WindowID window, char *props);
+typedef void (EXT_LEXER_DECL *ExtFoldFunction)(unsigned int lexer, unsigned int startPos, int length, int initStyle,
+                  char *words[], WindowID window, char *props);
+typedef void* (EXT_LEXER_DECL *GetLexerFunction)(unsigned int Index);
+typedef int (EXT_LEXER_DECL *GetLexerCountFn)();
+typedef void (EXT_LEXER_DECL *GetLexerNameFn)(unsigned int Index, char *name, int buflength);
+
+//class DynamicLibrary;
+
+/// Sub-class of LexerModule to use an external lexer.
+class ExternalLexerModule : protected LexerModule {
+protected:
+       ExtLexerFunction fneLexer;
+       ExtFoldFunction fneFolder;
+       int externalLanguage;
+       char name[100];
+public:
+       ExternalLexerModule(int language_, LexerFunction fnLexer_,
+               const char *languageName_=0, LexerFunction fnFolder_=0) : LexerModule(language_, fnLexer_, 0, fnFolder_){
+               strncpy(name, languageName_, sizeof(name));
+               languageName = name;
+       };
+       virtual void Lex(unsigned int startPos, int lengthDoc, int initStyle,
+                                       WordList *keywordlists[], Accessor &styler) const;
+       virtual void Fold(unsigned int startPos, int lengthDoc, int initStyle,
+                                       WordList *keywordlists[], Accessor &styler) const;
+       virtual void SetExternal(ExtLexerFunction fLexer, ExtFoldFunction fFolder, int index);
+};
+
+/// LexerMinder points to an ExternalLexerModule - so we don't leak them.
+class LexerMinder {
+public:
+       ExternalLexerModule *self;
+       LexerMinder *next;
+};
+
+/// LexerLibrary exists for every External Lexer DLL, contains LexerMinders.
+class LexerLibrary {
+       DynamicLibrary  *lib;
+       LexerMinder             *first;
+       LexerMinder             *last;
+
+public:
+       LexerLibrary(const char* ModuleName);
+       ~LexerLibrary();
+       void Release();
+
+       LexerLibrary    *next;
+       SString                 m_sModuleName;
+};
+
+/// LexerManager manages external lexers, contains LexerLibrarys.
+class LexerManager {
+public:
+       ~LexerManager();
+
+       static LexerManager *GetInstance();
+       static void DeleteInstance();
+
+       void Load(const char* path);
+       void Clear();
+
+private:
+       LexerManager();
+       static LexerManager *theInstance;
+
+       void LoadLexerLibrary(const char* module);
+       LexerLibrary *first;
+       LexerLibrary *last;
+};
+
+class LMMinder {
+public:
+       ~LMMinder();
+};
+
+#endif
index 12249e5f3c70e903529811febb5d30773b31c82c..f15842af684cc509bbeac2ff8fdfec75c9e98542 100644 (file)
@@ -130,6 +130,7 @@ const KeyToCommand KeyMap::MapDefault[] = {
     //'L',                     SCI_CTRL,               SCI_FORMFEED,
     {'L',                      SCI_CTRL,       SCI_LINECUT},
     {'L',                      SCI_CSHIFT,     SCI_LINEDELETE},
     //'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_LINEDUPLICATE},
     {'U',                      SCI_CTRL,       SCI_LOWERCASE},
     {'T',                      SCI_CTRL,       SCI_LINETRANSPOSE},
     {'D',                      SCI_CTRL,       SCI_LINEDUPLICATE},
     {'U',                      SCI_CTRL,       SCI_LOWERCASE},
index 73ecddf50dc26797a50998d7c8ce9847b155d1d2..8fb51bdb764ea66c13dbabffefbbc9f9f5603fa2 100644 (file)
@@ -112,18 +112,6 @@ void LexerModule::Fold(unsigned int startPos, int lengthDoc, int initStyle,
        }
 }
 
        }
 }
 
-static void ColouriseNullDoc(unsigned int startPos, int length, int, WordList *[],
-                            Accessor &styler) {
-       // Null language means all style bytes are 0 so just mark the end - no need to fill in.
-       if (length > 0) {
-               styler.StartAt(startPos + length - 1);
-               styler.StartSegment(startPos + length - 1);
-               styler.ColourTo(startPos + length - 1, 0);
-       }
-}
-
-LexerModule lmNull(SCLEX_NULL, ColouriseNullDoc, "null");
-
 // Alternative historical name for Scintilla_LinkLexers
 int wxForceScintillaLexers(void) {
        return Scintilla_LinkLexers();
 // Alternative historical name for Scintilla_LinkLexers
 int wxForceScintillaLexers(void) {
        return Scintilla_LinkLexers();
@@ -154,6 +142,7 @@ int Scintilla_LinkLexers() {
        LINK_LEXER(lmCss);
        LINK_LEXER(lmEiffel);
        LINK_LEXER(lmEiffelkw);
        LINK_LEXER(lmCss);
        LINK_LEXER(lmEiffel);
        LINK_LEXER(lmEiffelkw);
+       LINK_LEXER(lmESCRIPT);
        LINK_LEXER(lmFortran);
        LINK_LEXER(lmF77);
        LINK_LEXER(lmHTML);
        LINK_LEXER(lmFortran);
        LINK_LEXER(lmF77);
        LINK_LEXER(lmHTML);
@@ -161,6 +150,7 @@ int Scintilla_LinkLexers() {
        LINK_LEXER(lmASP);
        LINK_LEXER(lmPHP);
        LINK_LEXER(lmLISP);
        LINK_LEXER(lmASP);
        LINK_LEXER(lmPHP);
        LINK_LEXER(lmLISP);
+       LINK_LEXER(lmLout);
        LINK_LEXER(lmLua);
        LINK_LEXER(lmMatlab);
        LINK_LEXER(lmBatch);
        LINK_LEXER(lmLua);
        LINK_LEXER(lmMatlab);
        LINK_LEXER(lmBatch);
@@ -169,6 +159,7 @@ int Scintilla_LinkLexers() {
        LINK_LEXER(lmMake);
        LINK_LEXER(lmErrorList);
        LINK_LEXER(lmLatex);
        LINK_LEXER(lmMake);
        LINK_LEXER(lmErrorList);
        LINK_LEXER(lmLatex);
+       LINK_LEXER(lmNull);
        LINK_LEXER(lmPascal);
        LINK_LEXER(lmPerl);
        LINK_LEXER(lmPOV);
        LINK_LEXER(lmPascal);
        LINK_LEXER(lmPerl);
        LINK_LEXER(lmPOV);
index 661b968cd75c3138b798bea9c369027e73a08367..9c8ea416ae6b3b36063090f26addb4696f7fe626 100644 (file)
@@ -60,6 +60,7 @@ static void ColouriseCppDoc(unsigned int startPos, int length, int initStyle, Wo
        WordList &keywords = *keywordlists[0];
        WordList &keywords2 = *keywordlists[1];
        WordList &keywords3 = *keywordlists[2];
        WordList &keywords = *keywordlists[0];
        WordList &keywords2 = *keywordlists[1];
        WordList &keywords3 = *keywordlists[2];
+       WordList &keywords4 = *keywordlists[3];
 
        bool stylingWithinPreprocessor = styler.GetPropertyInt("styling.within.preprocessor") != 0;
 
 
        bool stylingWithinPreprocessor = styler.GetPropertyInt("styling.within.preprocessor") != 0;
 
@@ -111,6 +112,8 @@ static void ColouriseCppDoc(unsigned int startPos, int length, int initStyle, Wo
                                        sc.ChangeState(SCE_C_WORD);
                                } else if (keywords2.InList(s)) {
                                        sc.ChangeState(SCE_C_WORD2);
                                        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);
                        }
                                }
                                sc.SetState(SCE_C_DEFAULT);
                        }
@@ -279,237 +282,23 @@ static bool IsStreamCommentStyle(int style) {
               style == SCE_C_COMMENTDOCKEYWORDERROR;
 }
 
               style == SCE_C_COMMENTDOCKEYWORDERROR;
 }
 
-static bool matchKeyword(unsigned int start, WordList &keywords, Accessor &styler, int keywordtype) {
-       bool FoundKeyword = false;
-
-       for (unsigned int i = 0;
-               strlen(keywords[i]) > 0 && !FoundKeyword;
-               i++) {
-               if (atoi(keywords[i]) == keywordtype) {
-                       FoundKeyword = styler.Match(start, ((char *)keywords[i]) + 2);
-               }
-       }
-       return FoundKeyword;
-}
-
-static bool IsCommentLine(int line, Accessor &styler) {
-       unsigned int Pos = styler.LineStart(line);
-       while (styler.GetLine(Pos) == line) {
-               int PosStyle = styler.StyleAt(Pos);
-
-               if (    !IsStreamCommentStyle(PosStyle)
-                       &&
-                       PosStyle != SCE_C_COMMENTLINEDOC
-                       &&
-                       PosStyle != SCE_C_COMMENTLINE
-                       &&
-                       !IsASpace(styler.SafeGetCharAt(Pos))
-                  )
-                       return false;
-               Pos++;
-       }
-
-       return true;
-}
-
-static void FoldBoxCppDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[],
-                          Accessor &styler) {
-
-       WordList &keywords4 = *keywordlists[3];
-
-       bool foldComment = styler.GetPropertyInt("fold.comment") != 0;
-       bool foldPreprocessor = styler.GetPropertyInt("fold.preprocessor") != 0;
-       bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0;
-       bool firstLine = true;
-       unsigned int endPos = startPos + length;
-       int visibleChars = 0;
-       int lineCurrent = styler.GetLine(startPos);
-       int levelPrev = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK;
-       int levelCurrent = levelPrev;
-       int levelPrevPrev;
-       int levelFlags = 0;
-       int levelUnindent = 0;
-       char chNext = styler[startPos];
-       int styleNext = styler.StyleAt(startPos);
-       int style = initStyle;
-
-       if (lineCurrent == 0) {
-               levelPrevPrev = levelPrev;
-       } else {
-               levelPrevPrev = styler.LevelAt(lineCurrent - 1) & SC_FOLDLEVELNUMBERMASK;
-       }
-
-       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_C_COMMENTLINE)) {
-                       if ((ch == '/') && (chNext == '/')) {
-                               char chNext2 = styler.SafeGetCharAt(i + 2);
-                               if (chNext2 == '{') {
-                                       levelCurrent++;
-                               } else if (chNext2 == '}') {
-                                       levelCurrent--;
-                               }
-                       }
-               }
-
-               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")) {
-                                       levelCurrent++;
-                               } else if (styler.Match(j, "end")) {
-                                       levelCurrent--;
-                               }
-                       }
-               }
-
-               if (style == SCE_C_OPERATOR
-                       ||
-                       style == SCE_C_COMMENT
-                       ||
-                       style == SCE_C_COMMENTLINE) {
-
-                       if (ch == '{') {
-                               levelCurrent++;
-                               // Special handling if line has closing brace followed by opening brace.
-                               if (levelCurrent == levelPrev) {
-                                       if (firstLine)
-                                               levelUnindent = 1;
-                                       else
-                                               levelUnindent = -1;
-                               }
-                       } else if (ch == '}') {
-                               levelCurrent--;
-                       }
-               }
-
-               /* Check for fold header keyword at beginning of word */
-               if ((style == SCE_C_WORD || style == SCE_C_COMMENT || style == SCE_C_COMMENTLINE)
-                       &&
-                       (style != stylePrev)) {
-                       if (matchKeyword(i, keywords4, styler, KEYWORD_BOXHEADER)) {
-                               int line;
-                               /* Loop backwards all empty or comment lines */
-                               for (line = lineCurrent - 1;
-                                       line >= 0
-                                       &&
-                                       levelCurrent == (styler.LevelAt(line) & SC_FOLDLEVELNUMBERMASK)
-                                       &&
-                                       (styler.LevelAt(line) & SC_FOLDLEVELBOXFOOTERFLAG) == 0
-                                       &&
-                                       IsCommentLine(line, styler);
-                                       line--) {
-                                       /* just loop backwards */;
-                               }
-
-                               line++;
-                               /* Set Box header flag (if the previous line has no footer line) */
-                               if ((styler.LevelAt(line) & SC_FOLDLEVELBOXFOOTERFLAG) == 0) {
-                                       if (line == lineCurrent) {
-                                               /* in current line */
-                                               levelFlags |= SC_FOLDLEVELBOXHEADERFLAG;
-                                       } else {
-                                               /* at top of all preceding comment lines */
-                                               styler.SetLevel(line, styler.LevelAt(line)
-                                                               | SC_FOLDLEVELBOXHEADERFLAG);
-                                       }
-                               }
-                       }
-               }
-
-               if (matchKeyword(i, keywords4, styler, KEYWORD_FOLDCONTRACTED)) {
-                       levelFlags |= SC_FOLDLEVELCONTRACTED;
-               }
-
-               if (atEOL) {
-                       int lev;
-                       // Compute level correction for special case: '} else {'
-                       if (levelUnindent < 0) {
-                               levelPrev += levelUnindent;
-                       } else {
-                               levelCurrent += levelUnindent;
-                       }
-
-                       lev = levelPrev;
-                       if (visibleChars == 0 && foldCompact)
-                               lev |= SC_FOLDLEVELWHITEFLAG;
-                       // Produce additional footer line (e.g. after closed if)
-                       if (visibleChars == 0
-                               &&
-                               (levelPrev < levelPrevPrev))
-                               lev |= SC_FOLDLEVELBOXFOOTERFLAG;
-                       // Produce footer line at line before (special handling for '} else {'
-                       if (levelPrev < levelPrevPrev) {
-                               styler.SetLevel(lineCurrent - 1,
-                                               styler.LevelAt(lineCurrent - 1) | SC_FOLDLEVELBOXFOOTERFLAG);
-                       }
-                       // Mark the fold header (the line that is always visible)
-                       if ((levelCurrent > levelPrev) && (visibleChars > 0))
-                               lev |= SC_FOLDLEVELHEADERFLAG;
-                       // Show a footer line at end of fold
-                       if (levelCurrent < levelPrev)
-                               lev |= SC_FOLDLEVELBOXFOOTERFLAG;
-                       /* Show a footer line at the end of each procedure (level == SC_FOLDLEVELBASE) */
-                       if ((levelPrev == SC_FOLDLEVELBASE)
-                               &&
-                               (levelPrevPrev > SC_FOLDLEVELBASE)
-                               &&
-                               (visibleChars == 0)) {
-                               lev |= SC_FOLDLEVELBOXFOOTERFLAG;
-                       }
-
-                       lev |= levelFlags;
-                       if (lev != styler.LevelAt(lineCurrent)) {
-                               styler.SetLevel(lineCurrent, lev);
-                       }
-
-                       lineCurrent++;
-                       levelPrevPrev = levelPrev;
-                       levelPrev = levelCurrent;
-                       levelUnindent = 0;
-                       visibleChars = 0;
-                       levelFlags = 0;
-                       firstLine = false;
-               }
-
-               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);
-}
-
+// 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;
 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);
        unsigned int endPos = startPos + length;
        int visibleChars = 0;
        int lineCurrent = styler.GetLine(startPos);
-       int levelPrev = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK;
-       int levelCurrent = levelPrev;
+       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;
        char chNext = styler[startPos];
        int styleNext = styler.StyleAt(startPos);
        int style = initStyle;
@@ -522,19 +311,19 @@ static void FoldNoBoxCppDoc(unsigned int startPos, int length, int initStyle,
                bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n');
                if (foldComment && IsStreamCommentStyle(style)) {
                        if (!IsStreamCommentStyle(stylePrev)) {
                bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n');
                if (foldComment && IsStreamCommentStyle(style)) {
                        if (!IsStreamCommentStyle(stylePrev)) {
-                               levelCurrent++;
+                               levelNext++;
                        } else if (!IsStreamCommentStyle(styleNext) && !atEOL) {
                                // Comments don't end at end of line and the next character may be unstyled.
                        } else if (!IsStreamCommentStyle(styleNext) && !atEOL) {
                                // Comments don't end at end of line and the next character may be unstyled.
-                               levelCurrent--;
+                               levelNext--;
                        }
                }
                if (foldComment && (style == SCE_C_COMMENTLINE)) {
                        if ((ch == '/') && (chNext == '/')) {
                                char chNext2 = styler.SafeGetCharAt(i + 2);
                                if (chNext2 == '{') {
                        }
                }
                if (foldComment && (style == SCE_C_COMMENTLINE)) {
                        if ((ch == '/') && (chNext == '/')) {
                                char chNext2 = styler.SafeGetCharAt(i + 2);
                                if (chNext2 == '{') {
-                                       levelCurrent++;
+                                       levelNext++;
                                } else if (chNext2 == '}') {
                                } else if (chNext2 == '}') {
-                                       levelCurrent--;
+                                       levelNext--;
                                }
                        }
                }
                                }
                        }
                }
@@ -545,58 +334,58 @@ static void FoldNoBoxCppDoc(unsigned int startPos, int length, int initStyle,
                                        j++;
                                }
                                if (styler.Match(j, "region") || styler.Match(j, "if")) {
                                        j++;
                                }
                                if (styler.Match(j, "region") || styler.Match(j, "if")) {
-                                       levelCurrent++;
+                                       levelNext++;
                                } else if (styler.Match(j, "end")) {
                                } else if (styler.Match(j, "end")) {
-                                       levelCurrent--;
+                                       levelNext--;
                                }
                        }
                }
                if (style == SCE_C_OPERATOR) {
                        if (ch == '{') {
                                }
                        }
                }
                if (style == SCE_C_OPERATOR) {
                        if (ch == '{') {
-                               levelCurrent++;
+                               // Measure the minimum before a '{' to allow
+                               // folding on "} else {"
+                               if (levelMinCurrent > levelNext) {
+                                       levelMinCurrent = levelNext;
+                               }
+                               levelNext++;
                        } else if (ch == '}') {
                        } else if (ch == '}') {
-                               levelCurrent--;
+                               levelNext--;
                        }
                }
                if (atEOL) {
                        }
                }
                if (atEOL) {
-                       int lev = levelPrev;
+                       int levelUse = levelCurrent;
+                       if (foldAtElse) {
+                               levelUse = levelMinCurrent;
+                       }
+                       int lev = levelUse | levelNext << 16;
                        if (visibleChars == 0 && foldCompact)
                                lev |= SC_FOLDLEVELWHITEFLAG;
                        if (visibleChars == 0 && foldCompact)
                                lev |= SC_FOLDLEVELWHITEFLAG;
-                       if ((levelCurrent > levelPrev) && (visibleChars > 0))
+                       if (levelUse < levelNext)
                                lev |= SC_FOLDLEVELHEADERFLAG;
                        if (lev != styler.LevelAt(lineCurrent)) {
                                styler.SetLevel(lineCurrent, lev);
                        }
                        lineCurrent++;
                                lev |= SC_FOLDLEVELHEADERFLAG;
                        if (lev != styler.LevelAt(lineCurrent)) {
                                styler.SetLevel(lineCurrent, lev);
                        }
                        lineCurrent++;
-                       levelPrev = levelCurrent;
+                       levelCurrent = levelNext;
+                       levelMinCurrent = levelCurrent;
                        visibleChars = 0;
                }
                if (!isspacechar(ch))
                        visibleChars++;
        }
                        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 void FoldCppDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[],
+static void FoldCppDoc(unsigned int startPos, int length, int initStyle, WordList *[],
                        Accessor &styler) {
                        Accessor &styler) {
-
-       int foldFlags = styler.GetPropertyInt("fold.flags") ;
-       bool foldBox = ((foldFlags & SC_FOLDFLAG_BOX) == SC_FOLDFLAG_BOX);
-
-       if (foldBox) {
-               FoldBoxCppDoc(startPos, length, initStyle, keywordlists, styler);
-       } else {
-               FoldNoBoxCppDoc(startPos, length, initStyle, styler);
-       }
+       FoldNoBoxCppDoc(startPos, length, initStyle, styler);
 }
 
 static const char * const cppWordLists[] = {
             "Primary keywords and identifiers",
             "Secondary keywords and identifiers",
             "Documentation comment keywords",
 }
 
 static const char * const cppWordLists[] = {
             "Primary keywords and identifiers",
             "Secondary keywords and identifiers",
             "Documentation comment keywords",
-            "Fold header keywords",
+            "Unused",
+            "Global classes and typedefs",
             0,
         };
 
             0,
         };
 
diff --git a/src/stc/scintilla/src/LexEScript.cxx b/src/stc/scintilla/src/LexEScript.cxx
new file mode 100644 (file)
index 0000000..28e3b3b
--- /dev/null
@@ -0,0 +1,270 @@
+// 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);
diff --git a/src/stc/scintilla/src/LexLout.cxx b/src/stc/scintilla/src/LexLout.cxx
new file mode 100644 (file)
index 0000000..9d1a45a
--- /dev/null
@@ -0,0 +1,208 @@
+// 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);
index 6d537c9b6c2294e3200158f56738a9e2e35b58df..45e2d515446c24f84b3f61fc7e395b0ac40b0ba1 100644 (file)
@@ -626,9 +626,20 @@ static const char * const emptyWordListDesc[] = {
        0
 };
 
        0
 };
 
+static void ColouriseNullDoc(unsigned int startPos, int length, int, WordList *[],
+                            Accessor &styler) {
+       // Null language means all style bytes are 0 so just mark the end - no need to fill in.
+       if (length > 0) {
+               styler.StartAt(startPos + length - 1);
+               styler.StartSegment(startPos + length - 1);
+               styler.ColourTo(startPos + length - 1, 0);
+       }
+}
+
 LexerModule lmBatch(SCLEX_BATCH, ColouriseBatchDoc, "batch", 0, batchWordListDesc);
 LexerModule lmDiff(SCLEX_DIFF, ColouriseDiffDoc, "diff", 0, emptyWordListDesc);
 LexerModule lmProps(SCLEX_PROPERTIES, ColourisePropsDoc, "props", 0, emptyWordListDesc);
 LexerModule lmMake(SCLEX_MAKEFILE, ColouriseMakeDoc, "makefile", 0, emptyWordListDesc);
 LexerModule lmErrorList(SCLEX_ERRORLIST, ColouriseErrorListDoc, "errorlist", 0, emptyWordListDesc);
 LexerModule lmLatex(SCLEX_LATEX, ColouriseLatexDoc, "latex", 0, emptyWordListDesc);
 LexerModule lmBatch(SCLEX_BATCH, ColouriseBatchDoc, "batch", 0, batchWordListDesc);
 LexerModule lmDiff(SCLEX_DIFF, ColouriseDiffDoc, "diff", 0, emptyWordListDesc);
 LexerModule lmProps(SCLEX_PROPERTIES, ColourisePropsDoc, "props", 0, emptyWordListDesc);
 LexerModule lmMake(SCLEX_MAKEFILE, ColouriseMakeDoc, "makefile", 0, emptyWordListDesc);
 LexerModule lmErrorList(SCLEX_ERRORLIST, ColouriseErrorListDoc, "errorlist", 0, emptyWordListDesc);
 LexerModule lmLatex(SCLEX_LATEX, ColouriseLatexDoc, "latex", 0, emptyWordListDesc);
+LexerModule lmNull(SCLEX_NULL, ColouriseNullDoc, "null");
index 18544aef23c87b54b8e09c91b7edffa1944895b6..8455d854d2bc74fea4f697e1b9a0a506360458da 100644 (file)
@@ -9,7 +9,6 @@
 
 #include <stdlib.h>
 #include <string.h>
 
 #include <stdlib.h>
 #include <string.h>
-//#include <ctype.h>
 #include <stdio.h>
 
 #include "Platform.h"
 #include <stdio.h>
 
 #include "Platform.h"
@@ -182,25 +181,26 @@ SString PropSet::GetExpanded(const char *key) {
        return Expand(val.c_str());
 }
 
        return Expand(val.c_str());
 }
 
-SString PropSet::Expand(const char *withVars) {
+SString PropSet::Expand(const char *withVars, int maxExpands) {
        char *base = StringDup(withVars);
        char *cpvar = strstr(base, "$(");
        char *base = StringDup(withVars);
        char *cpvar = strstr(base, "$(");
-       int maxExpands = 1000;  // Avoid infinite expansion of recursive definitions
        while (cpvar && (maxExpands > 0)) {
                char *cpendvar = strchr(cpvar, ')');
        while (cpvar && (maxExpands > 0)) {
                char *cpendvar = strchr(cpvar, ')');
-               if (cpendvar) {
-                       int lenvar = cpendvar - cpvar - 2;      // Subtract the $()
-                       char *var = StringDup(cpvar + 2, lenvar);
-                       SString val = GetExpanded(var);
-                       size_t newlenbase = strlen(base) + val.length() - lenvar;
-                       char *newbase = new char[newlenbase];
-                       strncpy(newbase, base, cpvar - base);
-                       strcpy(newbase + (cpvar - base), val.c_str());
-                       strcpy(newbase + (cpvar - base) + val.length(), cpendvar + 1);
-                       delete []var;
-                       delete []base;
-                       base = newbase;
-               }
+               if (!cpendvar)
+                       break;
+               int lenvar = cpendvar - cpvar - 2;      // Subtract the $()
+               char *var = StringDup(cpvar + 2, lenvar);
+               SString val = Get(var);
+               if (IncludesVar(val.c_str(), var))
+                       break;
+               size_t newlenbase = strlen(base) + val.length() - lenvar;
+               char *newbase = new char[newlenbase];
+               strncpy(newbase, base, cpvar - base);
+               strcpy(newbase + (cpvar - base), val.c_str());
+               strcpy(newbase + (cpvar - base) + val.length(), cpendvar + 1);
+               delete []var;
+               delete []base;
+               base = newbase;
                cpvar = strstr(base, "$(");
                maxExpands--;
        }
                cpvar = strstr(base, "$(");
                maxExpands--;
        }
index 656570a24b9b2309c765f7756eb1e07e8f4b0faa..3bce611f0df288eda0552da4072c59eaa49b13e4 100644 (file)
@@ -30,8 +30,8 @@
  * Modification history:
  *
  * $Log$
  * Modification history:
  *
  * $Log$
- * Revision 1.6  2003/04/19 19:59:49  RD
- * Updated Scintilla to 1.52 (on the trunk this time too)
+ * Revision 1.7  2003/07/18 06:43:23  RD
+ * Update to Scintilla 1.53
  *
  * Revision 1.9  2003/03/21 10:36:08  nyamatongwe
  * Detect patterns too long in regular expression search.
  *
  * Revision 1.9  2003/03/21 10:36:08  nyamatongwe
  * Detect patterns too long in regular expression search.
index c437fee5a0aa6687daaebc2199c32acec0487521..274bce2f8159fa1afd5494206e5a26dab9dc02c3 100644 (file)
@@ -475,7 +475,7 @@ void wxStyledTextCtrl::MarkerDefineBitmap(int markerNumber, const wxBitmap& bmp)
         buff[len] = 0;
         SendMsg(2049, markerNumber, (long)buff);
         delete [] buff;
         buff[len] = 0;
         SendMsg(2049, markerNumber, (long)buff);
         delete [] buff;
-
+        
 }
 
 // Set a margin to be either numeric or symbolic.
 }
 
 // Set a margin to be either numeric or symbolic.
@@ -858,7 +858,7 @@ void wxStyledTextCtrl::RegisterImage(int type, const wxBitmap& bmp) {
         buff[len] = 0;
         SendMsg(2405, type, (long)buff);
         delete [] buff;
         buff[len] = 0;
         SendMsg(2405, type, (long)buff);
         delete [] buff;
-
+     
 }
 
 // Clear all the registered images.
 }
 
 // Clear all the registered images.
@@ -1618,6 +1618,11 @@ void wxStyledTextCtrl::LineEndDisplayExtend() {
     SendMsg(2348, 0, 0);
 }
 
     SendMsg(2348, 0, 0);
 }
 
+// Copy the line containing the caret.
+void wxStyledTextCtrl::LineCopy() {
+    SendMsg(2455, 0, 0);
+}
+
 // Move the caret inside current view if it's not there already.
 void wxStyledTextCtrl::MoveCaretInsideView() {
     SendMsg(2401, 0, 0);
 // Move the caret inside current view if it's not there already.
 void wxStyledTextCtrl::MoveCaretInsideView() {
     SendMsg(2401, 0, 0);
@@ -1905,6 +1910,28 @@ void wxStyledTextCtrl::SetHotspotActiveUnderline(bool underline) {
     SendMsg(2412, underline, 0);
 }
 
     SendMsg(2412, underline, 0);
 }
 
+// Given a valid document position, return the previous position taking code
+// page into account. Returns 0 if passed 0.
+int wxStyledTextCtrl::PositionBefore(int pos) {
+    return SendMsg(2417, pos, 0);
+}
+
+// Given a valid document position, return the next position taking code
+// page into account. Maximum value returned is the last position in the document.
+int wxStyledTextCtrl::PositionAfter(int pos) {
+    return SendMsg(2418, pos, 0);
+}
+
+// Copy a range of text to the clipboard. Positions are clipped into the document.
+void wxStyledTextCtrl::CopyRange(int start, int end) {
+    SendMsg(2419, start, end);
+}
+
+// Copy argument text to the clipboard.
+void wxStyledTextCtrl::CopyText(int length, const wxString& text) {
+    SendMsg(2420, length, (long)(const char*)wx2stc(text));
+}
+
 // Start notifying the container of all key presses and commands.
 void wxStyledTextCtrl::StartRecord() {
     SendMsg(3001, 0, 0);
 // Start notifying the container of all key presses and commands.
 void wxStyledTextCtrl::StartRecord() {
     SendMsg(3001, 0, 0);