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/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/LexLout.cxx
scintilla/src/LexLua.cxx
scintilla/src/LexMatlab.cxx
scintilla/src/LexOthers.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">
<wx-lib>core</wx-lib>
<wx-lib>base</wx-lib>
</dll>
-
+
<lib id="stclib" template="wx_contrib_lib,stc_base" cond="SHARED=='0'"/>
</makefile>
#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.
#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
#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
// 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();
// 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();
DLLPREFIX = @DLLPREFIX@
EXTRALIBS = @EXTRALIBS@
EXTRALIBS_GUI = @EXTRALIBS_GUI@
+HOST_SUFFIX = @HOST_SUFFIX@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_DIR = @INSTALL_DIR@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
### 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: ###
@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_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_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_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: ###
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
@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_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
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_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_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_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@ $(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
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_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_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) $<
//----------------------------------------------------------------------
+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);
#include "ScintillaWX.h"
+#include "ExternalLexer.h"
#include "wx/stc/stc.h"
#include "PlatWX.h"
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);
}
}
}
+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;
break;
}
+#ifdef SCI_LEXER
+ case SCI_LOADLEXERLIBRARY:
+ LexerManager::GetInstance()->Load((const char*)lParam);
+ break;
+#endif
default:
return ScintillaBase::WndProc(iMessage, wParam, lParam);
}
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();
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
typedef void *WindowID;
typedef void *MenuID;
typedef void *TickerID;
+typedef void *Function;
/**
* A geometric point class.
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.
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="");
#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 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_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
#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_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
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(,)
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(,)
set void SetLexerLanguage=4006(, string language)
# Load a lexer library (dll / so)
-# NOT YET IMPLEMENTED
fun void LoadLexerLibrary=4007(, string path)
# Notifications
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.
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
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)
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.
// 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)) {
} 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++) {
- mbstr[i] = cb.CharAt(startLine+i);
+ mbstr[i] = cb.CharAt(posCheck+i);
}
mbstr[i] = '\0';
int mbsize = Platform::DBCSCharLength(dbcsCodePage, mbstr);
- if (startLine + mbsize == pos) {
+ if (posCheck + mbsize == pos) {
return pos;
- } else if (startLine + mbsize > pos) {
+ } else if (posCheck + mbsize > pos) {
if (moveDir > 0) {
- return startLine + mbsize;
+ return posCheck + mbsize;
} else {
- return startLine;
+ return posCheck;
}
}
- startLine += mbsize;
+ posCheck += mbsize;
}
}
}
// 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.
void Editor::Redraw() {
//Platform::DebugPrintf("Redraw all\n");
- wMain.InvalidateAll();
+ PRectangle rcClient = GetClientRectangle();
+ wMain.InvalidateRectangle(rcClient);
+ //wMain.InvalidateAll();
}
void Editor::RedrawSelMargin() {
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));
}
}
- // 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)) {
} 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)
case SCI_DELWORDRIGHT:
case SCI_DELLINELEFT:
case SCI_DELLINERIGHT:
+ case SCI_LINECOPY:
case SCI_LINECUT:
case SCI_LINEDELETE:
case SCI_LINETRANSPOSE:
pdoc->DeleteChars(currentPos, end - currentPos);
}
break;
+ case SCI_LINECOPY: {
+ int lineStart = pdoc->LineFromPosition(SelectionStart());
+ int lineEnd = pdoc->LineFromPosition(SelectionEnd());
+ CopyRangeToClipboard(pdoc->LineStart(lineStart),
+ pdoc->LineStart(lineEnd + 1));
+ }
+ break;
case SCI_LINECUT: {
- int lineStart = pdoc->LineFromPosition(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();
+ SetLastXChosen();
}
break;
case SCI_LINEDELETE: {
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) {
- char *text = 0;
- int size = 0;
if (selType == selRectangle) {
+ char *text = 0;
+ int size = 0;
int lineStart = pdoc->LineFromPosition(SelectionStart());
int lineEnd = pdoc->LineFromPosition(SelectionEnd());
int line;
text[size] = '\0';
}
}
+ ss->Set(text, size + 1, true);
} 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) {
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
Copy();
break;
+ case SCI_COPYRANGE:
+ CopyRangeToClipboard(wParam, lParam);
+ break;
+
+ case SCI_COPYTEXT:
+ CopyText(wParam, CharPtrFromSPtr(lParam));
+ break;
+
case SCI_PASTE:
Paste();
SetLastXChosen();
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_DELWORDRIGHT:
case SCI_DELLINELEFT:
case SCI_DELLINERIGHT:
+ case SCI_LINECOPY:
case SCI_LINECUT:
case SCI_LINEDELETE:
case SCI_LINETRANSPOSE:
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_;
+ }
};
/**
long SearchInTarget(const char *text, int length);
void GoToLine(int lineNo);
+ virtual void CopyToClipboard(const SelectionText &selectedText) = 0;
char *CopyRange(int start, int end);
+ void CopySelectionFromRange(SelectionText *ss, int start, int end);
void CopySelectionRange(SelectionText *ss);
+ void CopyRangeToClipboard(int start, int end);
+ void CopyText(int length, const char *text);
void SetDragPosition(int newPos);
- 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.
--- /dev/null
+// 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;
--- /dev/null
+// 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
//'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},
}
}
-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();
LINK_LEXER(lmCss);
LINK_LEXER(lmEiffel);
LINK_LEXER(lmEiffelkw);
+ LINK_LEXER(lmESCRIPT);
LINK_LEXER(lmFortran);
LINK_LEXER(lmF77);
LINK_LEXER(lmHTML);
LINK_LEXER(lmASP);
LINK_LEXER(lmPHP);
LINK_LEXER(lmLISP);
+ LINK_LEXER(lmLout);
LINK_LEXER(lmLua);
LINK_LEXER(lmMatlab);
LINK_LEXER(lmBatch);
LINK_LEXER(lmMake);
LINK_LEXER(lmErrorList);
LINK_LEXER(lmLatex);
+ LINK_LEXER(lmNull);
LINK_LEXER(lmPascal);
LINK_LEXER(lmPerl);
LINK_LEXER(lmPOV);
WordList &keywords = *keywordlists[0];
WordList &keywords2 = *keywordlists[1];
WordList &keywords3 = *keywordlists[2];
+ WordList &keywords4 = *keywordlists[3];
bool stylingWithinPreprocessor = styler.GetPropertyInt("styling.within.preprocessor") != 0;
sc.ChangeState(SCE_C_WORD);
} else if (keywords2.InList(s)) {
sc.ChangeState(SCE_C_WORD2);
+ } else if (keywords4.InList(s)) {
+ sc.ChangeState(SCE_C_GLOBALCLASS);
}
sc.SetState(SCE_C_DEFAULT);
}
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;
+ bool foldAtElse = styler.GetPropertyInt("fold.at.else", 0) != 0;
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;
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.
- levelCurrent--;
+ levelNext--;
}
}
if (foldComment && (style == SCE_C_COMMENTLINE)) {
if ((ch == '/') && (chNext == '/')) {
char chNext2 = styler.SafeGetCharAt(i + 2);
if (chNext2 == '{') {
- levelCurrent++;
+ levelNext++;
} else if (chNext2 == '}') {
- levelCurrent--;
+ levelNext--;
}
}
}
j++;
}
if (styler.Match(j, "region") || styler.Match(j, "if")) {
- levelCurrent++;
+ levelNext++;
} else if (styler.Match(j, "end")) {
- levelCurrent--;
+ levelNext--;
}
}
}
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 == '}') {
- levelCurrent--;
+ levelNext--;
}
}
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 ((levelCurrent > levelPrev) && (visibleChars > 0))
+ if (levelUse < levelNext)
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++;
}
- // 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) {
-
- 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",
- "Fold header keywords",
+ "Unused",
+ "Global classes and typedefs",
0,
};
--- /dev/null
+// 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);
--- /dev/null
+// 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);
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 lmNull(SCLEX_NULL, ColouriseNullDoc, "null");
#include <stdlib.h>
#include <string.h>
-//#include <ctype.h>
#include <stdio.h>
#include "Platform.h"
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, "$(");
- int maxExpands = 1000; // Avoid infinite expansion of recursive definitions
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--;
}
* 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.
buff[len] = 0;
SendMsg(2049, markerNumber, (long)buff);
delete [] buff;
-
+
}
// Set a margin to be either numeric or symbolic.
buff[len] = 0;
SendMsg(2405, type, (long)buff);
delete [] buff;
-
+
}
// Clear all the registered images.
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);
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);
#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.
#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
#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
// 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();
// 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();
DLLPREFIX = @DLLPREFIX@
EXTRALIBS = @EXTRALIBS@
EXTRALIBS_GUI = @EXTRALIBS_GUI@
+HOST_SUFFIX = @HOST_SUFFIX@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_DIR = @INSTALL_DIR@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
### 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: ###
@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_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_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_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: ###
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
@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_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
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_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_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_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@ $(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
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_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_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) $<
//----------------------------------------------------------------------
+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);
#include "ScintillaWX.h"
+#include "ExternalLexer.h"
#include "wx/stc/stc.h"
#include "PlatWX.h"
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);
}
}
}
+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;
break;
}
+#ifdef SCI_LEXER
+ case SCI_LOADLEXERLIBRARY:
+ LexerManager::GetInstance()->Load((const char*)lParam);
+ break;
+#endif
default:
return ScintillaBase::WndProc(iMessage, wParam, lParam);
}
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();
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
typedef void *WindowID;
typedef void *MenuID;
typedef void *TickerID;
+typedef void *Function;
/**
* A geometric point class.
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.
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="");
#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 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_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
#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_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
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(,)
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(,)
set void SetLexerLanguage=4006(, string language)
# Load a lexer library (dll / so)
-# NOT YET IMPLEMENTED
fun void LoadLexerLibrary=4007(, string path)
# Notifications
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.
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
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)
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.
// 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)) {
} 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++) {
- mbstr[i] = cb.CharAt(startLine+i);
+ mbstr[i] = cb.CharAt(posCheck+i);
}
mbstr[i] = '\0';
int mbsize = Platform::DBCSCharLength(dbcsCodePage, mbstr);
- if (startLine + mbsize == pos) {
+ if (posCheck + mbsize == pos) {
return pos;
- } else if (startLine + mbsize > pos) {
+ } else if (posCheck + mbsize > pos) {
if (moveDir > 0) {
- return startLine + mbsize;
+ return posCheck + mbsize;
} else {
- return startLine;
+ return posCheck;
}
}
- startLine += mbsize;
+ posCheck += mbsize;
}
}
}
// 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.
void Editor::Redraw() {
//Platform::DebugPrintf("Redraw all\n");
- wMain.InvalidateAll();
+ PRectangle rcClient = GetClientRectangle();
+ wMain.InvalidateRectangle(rcClient);
+ //wMain.InvalidateAll();
}
void Editor::RedrawSelMargin() {
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));
}
}
- // 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)) {
} 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)
case SCI_DELWORDRIGHT:
case SCI_DELLINELEFT:
case SCI_DELLINERIGHT:
+ case SCI_LINECOPY:
case SCI_LINECUT:
case SCI_LINEDELETE:
case SCI_LINETRANSPOSE:
pdoc->DeleteChars(currentPos, end - currentPos);
}
break;
+ case SCI_LINECOPY: {
+ int lineStart = pdoc->LineFromPosition(SelectionStart());
+ int lineEnd = pdoc->LineFromPosition(SelectionEnd());
+ CopyRangeToClipboard(pdoc->LineStart(lineStart),
+ pdoc->LineStart(lineEnd + 1));
+ }
+ break;
case SCI_LINECUT: {
- int lineStart = pdoc->LineFromPosition(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();
+ SetLastXChosen();
}
break;
case SCI_LINEDELETE: {
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) {
- char *text = 0;
- int size = 0;
if (selType == selRectangle) {
+ char *text = 0;
+ int size = 0;
int lineStart = pdoc->LineFromPosition(SelectionStart());
int lineEnd = pdoc->LineFromPosition(SelectionEnd());
int line;
text[size] = '\0';
}
}
+ ss->Set(text, size + 1, true);
} 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) {
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
Copy();
break;
+ case SCI_COPYRANGE:
+ CopyRangeToClipboard(wParam, lParam);
+ break;
+
+ case SCI_COPYTEXT:
+ CopyText(wParam, CharPtrFromSPtr(lParam));
+ break;
+
case SCI_PASTE:
Paste();
SetLastXChosen();
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_DELWORDRIGHT:
case SCI_DELLINELEFT:
case SCI_DELLINERIGHT:
+ case SCI_LINECOPY:
case SCI_LINECUT:
case SCI_LINEDELETE:
case SCI_LINETRANSPOSE:
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_;
+ }
};
/**
long SearchInTarget(const char *text, int length);
void GoToLine(int lineNo);
+ virtual void CopyToClipboard(const SelectionText &selectedText) = 0;
char *CopyRange(int start, int end);
+ void CopySelectionFromRange(SelectionText *ss, int start, int end);
void CopySelectionRange(SelectionText *ss);
+ void CopyRangeToClipboard(int start, int end);
+ void CopyText(int length, const char *text);
void SetDragPosition(int newPos);
- 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.
--- /dev/null
+// 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;
--- /dev/null
+// 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
//'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},
}
}
-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();
LINK_LEXER(lmCss);
LINK_LEXER(lmEiffel);
LINK_LEXER(lmEiffelkw);
+ LINK_LEXER(lmESCRIPT);
LINK_LEXER(lmFortran);
LINK_LEXER(lmF77);
LINK_LEXER(lmHTML);
LINK_LEXER(lmASP);
LINK_LEXER(lmPHP);
LINK_LEXER(lmLISP);
+ LINK_LEXER(lmLout);
LINK_LEXER(lmLua);
LINK_LEXER(lmMatlab);
LINK_LEXER(lmBatch);
LINK_LEXER(lmMake);
LINK_LEXER(lmErrorList);
LINK_LEXER(lmLatex);
+ LINK_LEXER(lmNull);
LINK_LEXER(lmPascal);
LINK_LEXER(lmPerl);
LINK_LEXER(lmPOV);
WordList &keywords = *keywordlists[0];
WordList &keywords2 = *keywordlists[1];
WordList &keywords3 = *keywordlists[2];
+ WordList &keywords4 = *keywordlists[3];
bool stylingWithinPreprocessor = styler.GetPropertyInt("styling.within.preprocessor") != 0;
sc.ChangeState(SCE_C_WORD);
} else if (keywords2.InList(s)) {
sc.ChangeState(SCE_C_WORD2);
+ } else if (keywords4.InList(s)) {
+ sc.ChangeState(SCE_C_GLOBALCLASS);
}
sc.SetState(SCE_C_DEFAULT);
}
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;
+ bool foldAtElse = styler.GetPropertyInt("fold.at.else", 0) != 0;
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;
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.
- levelCurrent--;
+ levelNext--;
}
}
if (foldComment && (style == SCE_C_COMMENTLINE)) {
if ((ch == '/') && (chNext == '/')) {
char chNext2 = styler.SafeGetCharAt(i + 2);
if (chNext2 == '{') {
- levelCurrent++;
+ levelNext++;
} else if (chNext2 == '}') {
- levelCurrent--;
+ levelNext--;
}
}
}
j++;
}
if (styler.Match(j, "region") || styler.Match(j, "if")) {
- levelCurrent++;
+ levelNext++;
} else if (styler.Match(j, "end")) {
- levelCurrent--;
+ levelNext--;
}
}
}
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 == '}') {
- levelCurrent--;
+ levelNext--;
}
}
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 ((levelCurrent > levelPrev) && (visibleChars > 0))
+ if (levelUse < levelNext)
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++;
}
- // 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) {
-
- 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",
- "Fold header keywords",
+ "Unused",
+ "Global classes and typedefs",
0,
};
--- /dev/null
+// 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);
--- /dev/null
+// 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);
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 lmNull(SCLEX_NULL, ColouriseNullDoc, "null");
#include <stdlib.h>
#include <string.h>
-//#include <ctype.h>
#include <stdio.h>
#include "Platform.h"
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, "$(");
- int maxExpands = 1000; // Avoid infinite expansion of recursive definitions
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--;
}
* 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.
buff[len] = 0;
SendMsg(2049, markerNumber, (long)buff);
delete [] buff;
-
+
}
// Set a margin to be either numeric or symbolic.
buff[len] = 0;
SendMsg(2405, type, (long)buff);
delete [] buff;
-
+
}
// Clear all the registered images.
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);
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);