Updated Scintilla to version 1.70

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@40086 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2006-07-14 01:20:18 +00:00
parent dc8a1aa53d
commit b8193d807f
98 changed files with 5324 additions and 1112 deletions

View File

@@ -43,6 +43,7 @@ STCDLL_OBJECTS = \
$(OBJS)\stcdll_AutoComplete.obj \ $(OBJS)\stcdll_AutoComplete.obj \
$(OBJS)\stcdll_CallTip.obj \ $(OBJS)\stcdll_CallTip.obj \
$(OBJS)\stcdll_CellBuffer.obj \ $(OBJS)\stcdll_CellBuffer.obj \
$(OBJS)\stcdll_CharClassify.obj \
$(OBJS)\stcdll_ContractionState.obj \ $(OBJS)\stcdll_ContractionState.obj \
$(OBJS)\stcdll_Document.obj \ $(OBJS)\stcdll_Document.obj \
$(OBJS)\stcdll_DocumentAccessor.obj \ $(OBJS)\stcdll_DocumentAccessor.obj \
@@ -77,6 +78,7 @@ STCDLL_OBJECTS = \
$(OBJS)\stcdll_LexGui4Cli.obj \ $(OBJS)\stcdll_LexGui4Cli.obj \
$(OBJS)\stcdll_LexHTML.obj \ $(OBJS)\stcdll_LexHTML.obj \
$(OBJS)\stcdll_LexHaskell.obj \ $(OBJS)\stcdll_LexHaskell.obj \
$(OBJS)\stcdll_LexInno.obj \
$(OBJS)\stcdll_LexKix.obj \ $(OBJS)\stcdll_LexKix.obj \
$(OBJS)\stcdll_LexLisp.obj \ $(OBJS)\stcdll_LexLisp.obj \
$(OBJS)\stcdll_LexLout.obj \ $(OBJS)\stcdll_LexLout.obj \
@@ -87,6 +89,7 @@ STCDLL_OBJECTS = \
$(OBJS)\stcdll_LexMatlab.obj \ $(OBJS)\stcdll_LexMatlab.obj \
$(OBJS)\stcdll_LexMetapost.obj \ $(OBJS)\stcdll_LexMetapost.obj \
$(OBJS)\stcdll_LexNsis.obj \ $(OBJS)\stcdll_LexNsis.obj \
$(OBJS)\stcdll_LexOpal.obj \
$(OBJS)\stcdll_LexOthers.obj \ $(OBJS)\stcdll_LexOthers.obj \
$(OBJS)\stcdll_LexPB.obj \ $(OBJS)\stcdll_LexPB.obj \
$(OBJS)\stcdll_LexPOV.obj \ $(OBJS)\stcdll_LexPOV.obj \
@@ -101,6 +104,8 @@ STCDLL_OBJECTS = \
$(OBJS)\stcdll_LexTADS3.obj \ $(OBJS)\stcdll_LexTADS3.obj \
$(OBJS)\stcdll_LexScriptol.obj \ $(OBJS)\stcdll_LexScriptol.obj \
$(OBJS)\stcdll_LexSpecman.obj \ $(OBJS)\stcdll_LexSpecman.obj \
$(OBJS)\stcdll_LexSpice.obj \
$(OBJS)\stcdll_LexTCL.obj \
$(OBJS)\stcdll_LexTeX.obj \ $(OBJS)\stcdll_LexTeX.obj \
$(OBJS)\stcdll_LexVB.obj \ $(OBJS)\stcdll_LexVB.obj \
$(OBJS)\stcdll_LexVHDL.obj \ $(OBJS)\stcdll_LexVHDL.obj \
@@ -131,6 +136,7 @@ STCLIB_OBJECTS = \
$(OBJS)\stclib_AutoComplete.obj \ $(OBJS)\stclib_AutoComplete.obj \
$(OBJS)\stclib_CallTip.obj \ $(OBJS)\stclib_CallTip.obj \
$(OBJS)\stclib_CellBuffer.obj \ $(OBJS)\stclib_CellBuffer.obj \
$(OBJS)\stclib_CharClassify.obj \
$(OBJS)\stclib_ContractionState.obj \ $(OBJS)\stclib_ContractionState.obj \
$(OBJS)\stclib_Document.obj \ $(OBJS)\stclib_Document.obj \
$(OBJS)\stclib_DocumentAccessor.obj \ $(OBJS)\stclib_DocumentAccessor.obj \
@@ -165,6 +171,7 @@ STCLIB_OBJECTS = \
$(OBJS)\stclib_LexGui4Cli.obj \ $(OBJS)\stclib_LexGui4Cli.obj \
$(OBJS)\stclib_LexHTML.obj \ $(OBJS)\stclib_LexHTML.obj \
$(OBJS)\stclib_LexHaskell.obj \ $(OBJS)\stclib_LexHaskell.obj \
$(OBJS)\stclib_LexInno.obj \
$(OBJS)\stclib_LexKix.obj \ $(OBJS)\stclib_LexKix.obj \
$(OBJS)\stclib_LexLisp.obj \ $(OBJS)\stclib_LexLisp.obj \
$(OBJS)\stclib_LexLout.obj \ $(OBJS)\stclib_LexLout.obj \
@@ -175,6 +182,7 @@ STCLIB_OBJECTS = \
$(OBJS)\stclib_LexMatlab.obj \ $(OBJS)\stclib_LexMatlab.obj \
$(OBJS)\stclib_LexMetapost.obj \ $(OBJS)\stclib_LexMetapost.obj \
$(OBJS)\stclib_LexNsis.obj \ $(OBJS)\stclib_LexNsis.obj \
$(OBJS)\stclib_LexOpal.obj \
$(OBJS)\stclib_LexOthers.obj \ $(OBJS)\stclib_LexOthers.obj \
$(OBJS)\stclib_LexPB.obj \ $(OBJS)\stclib_LexPB.obj \
$(OBJS)\stclib_LexPOV.obj \ $(OBJS)\stclib_LexPOV.obj \
@@ -189,6 +197,8 @@ STCLIB_OBJECTS = \
$(OBJS)\stclib_LexTADS3.obj \ $(OBJS)\stclib_LexTADS3.obj \
$(OBJS)\stclib_LexScriptol.obj \ $(OBJS)\stclib_LexScriptol.obj \
$(OBJS)\stclib_LexSpecman.obj \ $(OBJS)\stclib_LexSpecman.obj \
$(OBJS)\stclib_LexSpice.obj \
$(OBJS)\stclib_LexTCL.obj \
$(OBJS)\stclib_LexTeX.obj \ $(OBJS)\stclib_LexTeX.obj \
$(OBJS)\stclib_LexVB.obj \ $(OBJS)\stclib_LexVB.obj \
$(OBJS)\stclib_LexVHDL.obj \ $(OBJS)\stclib_LexVHDL.obj \
@@ -428,6 +438,9 @@ $(OBJS)\stcdll_CallTip.obj: ../../src/stc\scintilla\src\CallTip.cxx
$(OBJS)\stcdll_CellBuffer.obj: ../../src/stc\scintilla\src\CellBuffer.cxx $(OBJS)\stcdll_CellBuffer.obj: ../../src/stc\scintilla\src\CellBuffer.cxx
$(CXX) -q -c -P -o$@ $(STCDLL_CXXFLAGS) $** $(CXX) -q -c -P -o$@ $(STCDLL_CXXFLAGS) $**
$(OBJS)\stcdll_CharClassify.obj: ../../src/stc\scintilla\src\CharClassify.cxx
$(CXX) -q -c -P -o$@ $(STCDLL_CXXFLAGS) $**
$(OBJS)\stcdll_ContractionState.obj: ../../src/stc\scintilla\src\ContractionState.cxx $(OBJS)\stcdll_ContractionState.obj: ../../src/stc\scintilla\src\ContractionState.cxx
$(CXX) -q -c -P -o$@ $(STCDLL_CXXFLAGS) $** $(CXX) -q -c -P -o$@ $(STCDLL_CXXFLAGS) $**
@@ -530,6 +543,9 @@ $(OBJS)\stcdll_LexHTML.obj: ../../src/stc\scintilla\src\LexHTML.cxx
$(OBJS)\stcdll_LexHaskell.obj: ../../src/stc\scintilla\src\LexHaskell.cxx $(OBJS)\stcdll_LexHaskell.obj: ../../src/stc\scintilla\src\LexHaskell.cxx
$(CXX) -q -c -P -o$@ $(STCDLL_CXXFLAGS) $** $(CXX) -q -c -P -o$@ $(STCDLL_CXXFLAGS) $**
$(OBJS)\stcdll_LexInno.obj: ../../src/stc\scintilla\src\LexInno.cxx
$(CXX) -q -c -P -o$@ $(STCDLL_CXXFLAGS) $**
$(OBJS)\stcdll_LexKix.obj: ../../src/stc\scintilla\src\LexKix.cxx $(OBJS)\stcdll_LexKix.obj: ../../src/stc\scintilla\src\LexKix.cxx
$(CXX) -q -c -P -o$@ $(STCDLL_CXXFLAGS) $** $(CXX) -q -c -P -o$@ $(STCDLL_CXXFLAGS) $**
@@ -560,6 +576,9 @@ $(OBJS)\stcdll_LexMetapost.obj: ../../src/stc\scintilla\src\LexMetapost.cxx
$(OBJS)\stcdll_LexNsis.obj: ../../src/stc\scintilla\src\LexNsis.cxx $(OBJS)\stcdll_LexNsis.obj: ../../src/stc\scintilla\src\LexNsis.cxx
$(CXX) -q -c -P -o$@ $(STCDLL_CXXFLAGS) $** $(CXX) -q -c -P -o$@ $(STCDLL_CXXFLAGS) $**
$(OBJS)\stcdll_LexOpal.obj: ../../src/stc\scintilla\src\LexOpal.cxx
$(CXX) -q -c -P -o$@ $(STCDLL_CXXFLAGS) $**
$(OBJS)\stcdll_LexOthers.obj: ../../src/stc\scintilla\src\LexOthers.cxx $(OBJS)\stcdll_LexOthers.obj: ../../src/stc\scintilla\src\LexOthers.cxx
$(CXX) -q -c -P -o$@ $(STCDLL_CXXFLAGS) $** $(CXX) -q -c -P -o$@ $(STCDLL_CXXFLAGS) $**
@@ -602,6 +621,12 @@ $(OBJS)\stcdll_LexScriptol.obj: ../../src/stc\scintilla\src\LexScriptol.cxx
$(OBJS)\stcdll_LexSpecman.obj: ../../src/stc\scintilla\src\LexSpecman.cxx $(OBJS)\stcdll_LexSpecman.obj: ../../src/stc\scintilla\src\LexSpecman.cxx
$(CXX) -q -c -P -o$@ $(STCDLL_CXXFLAGS) $** $(CXX) -q -c -P -o$@ $(STCDLL_CXXFLAGS) $**
$(OBJS)\stcdll_LexSpice.obj: ../../src/stc\scintilla\src\LexSpice.cxx
$(CXX) -q -c -P -o$@ $(STCDLL_CXXFLAGS) $**
$(OBJS)\stcdll_LexTCL.obj: ../../src/stc\scintilla\src\LexTCL.cxx
$(CXX) -q -c -P -o$@ $(STCDLL_CXXFLAGS) $**
$(OBJS)\stcdll_LexTeX.obj: ../../src/stc\scintilla\src\LexTeX.cxx $(OBJS)\stcdll_LexTeX.obj: ../../src/stc\scintilla\src\LexTeX.cxx
$(CXX) -q -c -P -o$@ $(STCDLL_CXXFLAGS) $** $(CXX) -q -c -P -o$@ $(STCDLL_CXXFLAGS) $**
@@ -665,6 +690,9 @@ $(OBJS)\stclib_CallTip.obj: ../../src/stc\scintilla\src\CallTip.cxx
$(OBJS)\stclib_CellBuffer.obj: ../../src/stc\scintilla\src\CellBuffer.cxx $(OBJS)\stclib_CellBuffer.obj: ../../src/stc\scintilla\src\CellBuffer.cxx
$(CXX) -q -c -P -o$@ $(STCLIB_CXXFLAGS) $** $(CXX) -q -c -P -o$@ $(STCLIB_CXXFLAGS) $**
$(OBJS)\stclib_CharClassify.obj: ../../src/stc\scintilla\src\CharClassify.cxx
$(CXX) -q -c -P -o$@ $(STCLIB_CXXFLAGS) $**
$(OBJS)\stclib_ContractionState.obj: ../../src/stc\scintilla\src\ContractionState.cxx $(OBJS)\stclib_ContractionState.obj: ../../src/stc\scintilla\src\ContractionState.cxx
$(CXX) -q -c -P -o$@ $(STCLIB_CXXFLAGS) $** $(CXX) -q -c -P -o$@ $(STCLIB_CXXFLAGS) $**
@@ -767,6 +795,9 @@ $(OBJS)\stclib_LexHTML.obj: ../../src/stc\scintilla\src\LexHTML.cxx
$(OBJS)\stclib_LexHaskell.obj: ../../src/stc\scintilla\src\LexHaskell.cxx $(OBJS)\stclib_LexHaskell.obj: ../../src/stc\scintilla\src\LexHaskell.cxx
$(CXX) -q -c -P -o$@ $(STCLIB_CXXFLAGS) $** $(CXX) -q -c -P -o$@ $(STCLIB_CXXFLAGS) $**
$(OBJS)\stclib_LexInno.obj: ../../src/stc\scintilla\src\LexInno.cxx
$(CXX) -q -c -P -o$@ $(STCLIB_CXXFLAGS) $**
$(OBJS)\stclib_LexKix.obj: ../../src/stc\scintilla\src\LexKix.cxx $(OBJS)\stclib_LexKix.obj: ../../src/stc\scintilla\src\LexKix.cxx
$(CXX) -q -c -P -o$@ $(STCLIB_CXXFLAGS) $** $(CXX) -q -c -P -o$@ $(STCLIB_CXXFLAGS) $**
@@ -797,6 +828,9 @@ $(OBJS)\stclib_LexMetapost.obj: ../../src/stc\scintilla\src\LexMetapost.cxx
$(OBJS)\stclib_LexNsis.obj: ../../src/stc\scintilla\src\LexNsis.cxx $(OBJS)\stclib_LexNsis.obj: ../../src/stc\scintilla\src\LexNsis.cxx
$(CXX) -q -c -P -o$@ $(STCLIB_CXXFLAGS) $** $(CXX) -q -c -P -o$@ $(STCLIB_CXXFLAGS) $**
$(OBJS)\stclib_LexOpal.obj: ../../src/stc\scintilla\src\LexOpal.cxx
$(CXX) -q -c -P -o$@ $(STCLIB_CXXFLAGS) $**
$(OBJS)\stclib_LexOthers.obj: ../../src/stc\scintilla\src\LexOthers.cxx $(OBJS)\stclib_LexOthers.obj: ../../src/stc\scintilla\src\LexOthers.cxx
$(CXX) -q -c -P -o$@ $(STCLIB_CXXFLAGS) $** $(CXX) -q -c -P -o$@ $(STCLIB_CXXFLAGS) $**
@@ -839,6 +873,12 @@ $(OBJS)\stclib_LexScriptol.obj: ../../src/stc\scintilla\src\LexScriptol.cxx
$(OBJS)\stclib_LexSpecman.obj: ../../src/stc\scintilla\src\LexSpecman.cxx $(OBJS)\stclib_LexSpecman.obj: ../../src/stc\scintilla\src\LexSpecman.cxx
$(CXX) -q -c -P -o$@ $(STCLIB_CXXFLAGS) $** $(CXX) -q -c -P -o$@ $(STCLIB_CXXFLAGS) $**
$(OBJS)\stclib_LexSpice.obj: ../../src/stc\scintilla\src\LexSpice.cxx
$(CXX) -q -c -P -o$@ $(STCLIB_CXXFLAGS) $**
$(OBJS)\stclib_LexTCL.obj: ../../src/stc\scintilla\src\LexTCL.cxx
$(CXX) -q -c -P -o$@ $(STCLIB_CXXFLAGS) $**
$(OBJS)\stclib_LexTeX.obj: ../../src/stc\scintilla\src\LexTeX.cxx $(OBJS)\stclib_LexTeX.obj: ../../src/stc\scintilla\src\LexTeX.cxx
$(CXX) -q -c -P -o$@ $(STCLIB_CXXFLAGS) $** $(CXX) -q -c -P -o$@ $(STCLIB_CXXFLAGS) $**

View File

@@ -36,6 +36,7 @@ STCDLL_OBJECTS = \
$(OBJS)\stcdll_AutoComplete.o \ $(OBJS)\stcdll_AutoComplete.o \
$(OBJS)\stcdll_CallTip.o \ $(OBJS)\stcdll_CallTip.o \
$(OBJS)\stcdll_CellBuffer.o \ $(OBJS)\stcdll_CellBuffer.o \
$(OBJS)\stcdll_CharClassify.o \
$(OBJS)\stcdll_ContractionState.o \ $(OBJS)\stcdll_ContractionState.o \
$(OBJS)\stcdll_Document.o \ $(OBJS)\stcdll_Document.o \
$(OBJS)\stcdll_DocumentAccessor.o \ $(OBJS)\stcdll_DocumentAccessor.o \
@@ -70,6 +71,7 @@ STCDLL_OBJECTS = \
$(OBJS)\stcdll_LexGui4Cli.o \ $(OBJS)\stcdll_LexGui4Cli.o \
$(OBJS)\stcdll_LexHTML.o \ $(OBJS)\stcdll_LexHTML.o \
$(OBJS)\stcdll_LexHaskell.o \ $(OBJS)\stcdll_LexHaskell.o \
$(OBJS)\stcdll_LexInno.o \
$(OBJS)\stcdll_LexKix.o \ $(OBJS)\stcdll_LexKix.o \
$(OBJS)\stcdll_LexLisp.o \ $(OBJS)\stcdll_LexLisp.o \
$(OBJS)\stcdll_LexLout.o \ $(OBJS)\stcdll_LexLout.o \
@@ -80,6 +82,7 @@ STCDLL_OBJECTS = \
$(OBJS)\stcdll_LexMatlab.o \ $(OBJS)\stcdll_LexMatlab.o \
$(OBJS)\stcdll_LexMetapost.o \ $(OBJS)\stcdll_LexMetapost.o \
$(OBJS)\stcdll_LexNsis.o \ $(OBJS)\stcdll_LexNsis.o \
$(OBJS)\stcdll_LexOpal.o \
$(OBJS)\stcdll_LexOthers.o \ $(OBJS)\stcdll_LexOthers.o \
$(OBJS)\stcdll_LexPB.o \ $(OBJS)\stcdll_LexPB.o \
$(OBJS)\stcdll_LexPOV.o \ $(OBJS)\stcdll_LexPOV.o \
@@ -94,6 +97,8 @@ STCDLL_OBJECTS = \
$(OBJS)\stcdll_LexTADS3.o \ $(OBJS)\stcdll_LexTADS3.o \
$(OBJS)\stcdll_LexScriptol.o \ $(OBJS)\stcdll_LexScriptol.o \
$(OBJS)\stcdll_LexSpecman.o \ $(OBJS)\stcdll_LexSpecman.o \
$(OBJS)\stcdll_LexSpice.o \
$(OBJS)\stcdll_LexTCL.o \
$(OBJS)\stcdll_LexTeX.o \ $(OBJS)\stcdll_LexTeX.o \
$(OBJS)\stcdll_LexVB.o \ $(OBJS)\stcdll_LexVB.o \
$(OBJS)\stcdll_LexVHDL.o \ $(OBJS)\stcdll_LexVHDL.o \
@@ -124,6 +129,7 @@ STCLIB_OBJECTS = \
$(OBJS)\stclib_AutoComplete.o \ $(OBJS)\stclib_AutoComplete.o \
$(OBJS)\stclib_CallTip.o \ $(OBJS)\stclib_CallTip.o \
$(OBJS)\stclib_CellBuffer.o \ $(OBJS)\stclib_CellBuffer.o \
$(OBJS)\stclib_CharClassify.o \
$(OBJS)\stclib_ContractionState.o \ $(OBJS)\stclib_ContractionState.o \
$(OBJS)\stclib_Document.o \ $(OBJS)\stclib_Document.o \
$(OBJS)\stclib_DocumentAccessor.o \ $(OBJS)\stclib_DocumentAccessor.o \
@@ -158,6 +164,7 @@ STCLIB_OBJECTS = \
$(OBJS)\stclib_LexGui4Cli.o \ $(OBJS)\stclib_LexGui4Cli.o \
$(OBJS)\stclib_LexHTML.o \ $(OBJS)\stclib_LexHTML.o \
$(OBJS)\stclib_LexHaskell.o \ $(OBJS)\stclib_LexHaskell.o \
$(OBJS)\stclib_LexInno.o \
$(OBJS)\stclib_LexKix.o \ $(OBJS)\stclib_LexKix.o \
$(OBJS)\stclib_LexLisp.o \ $(OBJS)\stclib_LexLisp.o \
$(OBJS)\stclib_LexLout.o \ $(OBJS)\stclib_LexLout.o \
@@ -168,6 +175,7 @@ STCLIB_OBJECTS = \
$(OBJS)\stclib_LexMatlab.o \ $(OBJS)\stclib_LexMatlab.o \
$(OBJS)\stclib_LexMetapost.o \ $(OBJS)\stclib_LexMetapost.o \
$(OBJS)\stclib_LexNsis.o \ $(OBJS)\stclib_LexNsis.o \
$(OBJS)\stclib_LexOpal.o \
$(OBJS)\stclib_LexOthers.o \ $(OBJS)\stclib_LexOthers.o \
$(OBJS)\stclib_LexPB.o \ $(OBJS)\stclib_LexPB.o \
$(OBJS)\stclib_LexPOV.o \ $(OBJS)\stclib_LexPOV.o \
@@ -182,6 +190,8 @@ STCLIB_OBJECTS = \
$(OBJS)\stclib_LexTADS3.o \ $(OBJS)\stclib_LexTADS3.o \
$(OBJS)\stclib_LexScriptol.o \ $(OBJS)\stclib_LexScriptol.o \
$(OBJS)\stclib_LexSpecman.o \ $(OBJS)\stclib_LexSpecman.o \
$(OBJS)\stclib_LexSpice.o \
$(OBJS)\stclib_LexTCL.o \
$(OBJS)\stclib_LexTeX.o \ $(OBJS)\stclib_LexTeX.o \
$(OBJS)\stclib_LexVB.o \ $(OBJS)\stclib_LexVB.o \
$(OBJS)\stclib_LexVHDL.o \ $(OBJS)\stclib_LexVHDL.o \
@@ -418,6 +428,9 @@ $(OBJS)\stcdll_CallTip.o: ../../src/stc/scintilla/src/CallTip.cxx
$(OBJS)\stcdll_CellBuffer.o: ../../src/stc/scintilla/src/CellBuffer.cxx $(OBJS)\stcdll_CellBuffer.o: ../../src/stc/scintilla/src/CellBuffer.cxx
$(CXX) -c -o $@ $(STCDLL_CXXFLAGS) $(CPPDEPS) $< $(CXX) -c -o $@ $(STCDLL_CXXFLAGS) $(CPPDEPS) $<
$(OBJS)\stcdll_CharClassify.o: ../../src/stc/scintilla/src/CharClassify.cxx
$(CXX) -c -o $@ $(STCDLL_CXXFLAGS) $(CPPDEPS) $<
$(OBJS)\stcdll_ContractionState.o: ../../src/stc/scintilla/src/ContractionState.cxx $(OBJS)\stcdll_ContractionState.o: ../../src/stc/scintilla/src/ContractionState.cxx
$(CXX) -c -o $@ $(STCDLL_CXXFLAGS) $(CPPDEPS) $< $(CXX) -c -o $@ $(STCDLL_CXXFLAGS) $(CPPDEPS) $<
@@ -520,6 +533,9 @@ $(OBJS)\stcdll_LexHTML.o: ../../src/stc/scintilla/src/LexHTML.cxx
$(OBJS)\stcdll_LexHaskell.o: ../../src/stc/scintilla/src/LexHaskell.cxx $(OBJS)\stcdll_LexHaskell.o: ../../src/stc/scintilla/src/LexHaskell.cxx
$(CXX) -c -o $@ $(STCDLL_CXXFLAGS) $(CPPDEPS) $< $(CXX) -c -o $@ $(STCDLL_CXXFLAGS) $(CPPDEPS) $<
$(OBJS)\stcdll_LexInno.o: ../../src/stc/scintilla/src/LexInno.cxx
$(CXX) -c -o $@ $(STCDLL_CXXFLAGS) $(CPPDEPS) $<
$(OBJS)\stcdll_LexKix.o: ../../src/stc/scintilla/src/LexKix.cxx $(OBJS)\stcdll_LexKix.o: ../../src/stc/scintilla/src/LexKix.cxx
$(CXX) -c -o $@ $(STCDLL_CXXFLAGS) $(CPPDEPS) $< $(CXX) -c -o $@ $(STCDLL_CXXFLAGS) $(CPPDEPS) $<
@@ -550,6 +566,9 @@ $(OBJS)\stcdll_LexMetapost.o: ../../src/stc/scintilla/src/LexMetapost.cxx
$(OBJS)\stcdll_LexNsis.o: ../../src/stc/scintilla/src/LexNsis.cxx $(OBJS)\stcdll_LexNsis.o: ../../src/stc/scintilla/src/LexNsis.cxx
$(CXX) -c -o $@ $(STCDLL_CXXFLAGS) $(CPPDEPS) $< $(CXX) -c -o $@ $(STCDLL_CXXFLAGS) $(CPPDEPS) $<
$(OBJS)\stcdll_LexOpal.o: ../../src/stc/scintilla/src/LexOpal.cxx
$(CXX) -c -o $@ $(STCDLL_CXXFLAGS) $(CPPDEPS) $<
$(OBJS)\stcdll_LexOthers.o: ../../src/stc/scintilla/src/LexOthers.cxx $(OBJS)\stcdll_LexOthers.o: ../../src/stc/scintilla/src/LexOthers.cxx
$(CXX) -c -o $@ $(STCDLL_CXXFLAGS) $(CPPDEPS) $< $(CXX) -c -o $@ $(STCDLL_CXXFLAGS) $(CPPDEPS) $<
@@ -592,6 +611,12 @@ $(OBJS)\stcdll_LexScriptol.o: ../../src/stc/scintilla/src/LexScriptol.cxx
$(OBJS)\stcdll_LexSpecman.o: ../../src/stc/scintilla/src/LexSpecman.cxx $(OBJS)\stcdll_LexSpecman.o: ../../src/stc/scintilla/src/LexSpecman.cxx
$(CXX) -c -o $@ $(STCDLL_CXXFLAGS) $(CPPDEPS) $< $(CXX) -c -o $@ $(STCDLL_CXXFLAGS) $(CPPDEPS) $<
$(OBJS)\stcdll_LexSpice.o: ../../src/stc/scintilla/src/LexSpice.cxx
$(CXX) -c -o $@ $(STCDLL_CXXFLAGS) $(CPPDEPS) $<
$(OBJS)\stcdll_LexTCL.o: ../../src/stc/scintilla/src/LexTCL.cxx
$(CXX) -c -o $@ $(STCDLL_CXXFLAGS) $(CPPDEPS) $<
$(OBJS)\stcdll_LexTeX.o: ../../src/stc/scintilla/src/LexTeX.cxx $(OBJS)\stcdll_LexTeX.o: ../../src/stc/scintilla/src/LexTeX.cxx
$(CXX) -c -o $@ $(STCDLL_CXXFLAGS) $(CPPDEPS) $< $(CXX) -c -o $@ $(STCDLL_CXXFLAGS) $(CPPDEPS) $<
@@ -655,6 +680,9 @@ $(OBJS)\stclib_CallTip.o: ../../src/stc/scintilla/src/CallTip.cxx
$(OBJS)\stclib_CellBuffer.o: ../../src/stc/scintilla/src/CellBuffer.cxx $(OBJS)\stclib_CellBuffer.o: ../../src/stc/scintilla/src/CellBuffer.cxx
$(CXX) -c -o $@ $(STCLIB_CXXFLAGS) $(CPPDEPS) $< $(CXX) -c -o $@ $(STCLIB_CXXFLAGS) $(CPPDEPS) $<
$(OBJS)\stclib_CharClassify.o: ../../src/stc/scintilla/src/CharClassify.cxx
$(CXX) -c -o $@ $(STCLIB_CXXFLAGS) $(CPPDEPS) $<
$(OBJS)\stclib_ContractionState.o: ../../src/stc/scintilla/src/ContractionState.cxx $(OBJS)\stclib_ContractionState.o: ../../src/stc/scintilla/src/ContractionState.cxx
$(CXX) -c -o $@ $(STCLIB_CXXFLAGS) $(CPPDEPS) $< $(CXX) -c -o $@ $(STCLIB_CXXFLAGS) $(CPPDEPS) $<
@@ -757,6 +785,9 @@ $(OBJS)\stclib_LexHTML.o: ../../src/stc/scintilla/src/LexHTML.cxx
$(OBJS)\stclib_LexHaskell.o: ../../src/stc/scintilla/src/LexHaskell.cxx $(OBJS)\stclib_LexHaskell.o: ../../src/stc/scintilla/src/LexHaskell.cxx
$(CXX) -c -o $@ $(STCLIB_CXXFLAGS) $(CPPDEPS) $< $(CXX) -c -o $@ $(STCLIB_CXXFLAGS) $(CPPDEPS) $<
$(OBJS)\stclib_LexInno.o: ../../src/stc/scintilla/src/LexInno.cxx
$(CXX) -c -o $@ $(STCLIB_CXXFLAGS) $(CPPDEPS) $<
$(OBJS)\stclib_LexKix.o: ../../src/stc/scintilla/src/LexKix.cxx $(OBJS)\stclib_LexKix.o: ../../src/stc/scintilla/src/LexKix.cxx
$(CXX) -c -o $@ $(STCLIB_CXXFLAGS) $(CPPDEPS) $< $(CXX) -c -o $@ $(STCLIB_CXXFLAGS) $(CPPDEPS) $<
@@ -787,6 +818,9 @@ $(OBJS)\stclib_LexMetapost.o: ../../src/stc/scintilla/src/LexMetapost.cxx
$(OBJS)\stclib_LexNsis.o: ../../src/stc/scintilla/src/LexNsis.cxx $(OBJS)\stclib_LexNsis.o: ../../src/stc/scintilla/src/LexNsis.cxx
$(CXX) -c -o $@ $(STCLIB_CXXFLAGS) $(CPPDEPS) $< $(CXX) -c -o $@ $(STCLIB_CXXFLAGS) $(CPPDEPS) $<
$(OBJS)\stclib_LexOpal.o: ../../src/stc/scintilla/src/LexOpal.cxx
$(CXX) -c -o $@ $(STCLIB_CXXFLAGS) $(CPPDEPS) $<
$(OBJS)\stclib_LexOthers.o: ../../src/stc/scintilla/src/LexOthers.cxx $(OBJS)\stclib_LexOthers.o: ../../src/stc/scintilla/src/LexOthers.cxx
$(CXX) -c -o $@ $(STCLIB_CXXFLAGS) $(CPPDEPS) $< $(CXX) -c -o $@ $(STCLIB_CXXFLAGS) $(CPPDEPS) $<
@@ -829,6 +863,12 @@ $(OBJS)\stclib_LexScriptol.o: ../../src/stc/scintilla/src/LexScriptol.cxx
$(OBJS)\stclib_LexSpecman.o: ../../src/stc/scintilla/src/LexSpecman.cxx $(OBJS)\stclib_LexSpecman.o: ../../src/stc/scintilla/src/LexSpecman.cxx
$(CXX) -c -o $@ $(STCLIB_CXXFLAGS) $(CPPDEPS) $< $(CXX) -c -o $@ $(STCLIB_CXXFLAGS) $(CPPDEPS) $<
$(OBJS)\stclib_LexSpice.o: ../../src/stc/scintilla/src/LexSpice.cxx
$(CXX) -c -o $@ $(STCLIB_CXXFLAGS) $(CPPDEPS) $<
$(OBJS)\stclib_LexTCL.o: ../../src/stc/scintilla/src/LexTCL.cxx
$(CXX) -c -o $@ $(STCLIB_CXXFLAGS) $(CPPDEPS) $<
$(OBJS)\stclib_LexTeX.o: ../../src/stc/scintilla/src/LexTeX.cxx $(OBJS)\stclib_LexTeX.o: ../../src/stc/scintilla/src/LexTeX.cxx
$(CXX) -c -o $@ $(STCLIB_CXXFLAGS) $(CPPDEPS) $< $(CXX) -c -o $@ $(STCLIB_CXXFLAGS) $(CPPDEPS) $<

View File

@@ -39,6 +39,7 @@ STCDLL_OBJECTS = \
$(OBJS)\stcdll_AutoComplete.obj \ $(OBJS)\stcdll_AutoComplete.obj \
$(OBJS)\stcdll_CallTip.obj \ $(OBJS)\stcdll_CallTip.obj \
$(OBJS)\stcdll_CellBuffer.obj \ $(OBJS)\stcdll_CellBuffer.obj \
$(OBJS)\stcdll_CharClassify.obj \
$(OBJS)\stcdll_ContractionState.obj \ $(OBJS)\stcdll_ContractionState.obj \
$(OBJS)\stcdll_Document.obj \ $(OBJS)\stcdll_Document.obj \
$(OBJS)\stcdll_DocumentAccessor.obj \ $(OBJS)\stcdll_DocumentAccessor.obj \
@@ -73,6 +74,7 @@ STCDLL_OBJECTS = \
$(OBJS)\stcdll_LexGui4Cli.obj \ $(OBJS)\stcdll_LexGui4Cli.obj \
$(OBJS)\stcdll_LexHTML.obj \ $(OBJS)\stcdll_LexHTML.obj \
$(OBJS)\stcdll_LexHaskell.obj \ $(OBJS)\stcdll_LexHaskell.obj \
$(OBJS)\stcdll_LexInno.obj \
$(OBJS)\stcdll_LexKix.obj \ $(OBJS)\stcdll_LexKix.obj \
$(OBJS)\stcdll_LexLisp.obj \ $(OBJS)\stcdll_LexLisp.obj \
$(OBJS)\stcdll_LexLout.obj \ $(OBJS)\stcdll_LexLout.obj \
@@ -83,6 +85,7 @@ STCDLL_OBJECTS = \
$(OBJS)\stcdll_LexMatlab.obj \ $(OBJS)\stcdll_LexMatlab.obj \
$(OBJS)\stcdll_LexMetapost.obj \ $(OBJS)\stcdll_LexMetapost.obj \
$(OBJS)\stcdll_LexNsis.obj \ $(OBJS)\stcdll_LexNsis.obj \
$(OBJS)\stcdll_LexOpal.obj \
$(OBJS)\stcdll_LexOthers.obj \ $(OBJS)\stcdll_LexOthers.obj \
$(OBJS)\stcdll_LexPB.obj \ $(OBJS)\stcdll_LexPB.obj \
$(OBJS)\stcdll_LexPOV.obj \ $(OBJS)\stcdll_LexPOV.obj \
@@ -97,6 +100,8 @@ STCDLL_OBJECTS = \
$(OBJS)\stcdll_LexTADS3.obj \ $(OBJS)\stcdll_LexTADS3.obj \
$(OBJS)\stcdll_LexScriptol.obj \ $(OBJS)\stcdll_LexScriptol.obj \
$(OBJS)\stcdll_LexSpecman.obj \ $(OBJS)\stcdll_LexSpecman.obj \
$(OBJS)\stcdll_LexSpice.obj \
$(OBJS)\stcdll_LexTCL.obj \
$(OBJS)\stcdll_LexTeX.obj \ $(OBJS)\stcdll_LexTeX.obj \
$(OBJS)\stcdll_LexVB.obj \ $(OBJS)\stcdll_LexVB.obj \
$(OBJS)\stcdll_LexVHDL.obj \ $(OBJS)\stcdll_LexVHDL.obj \
@@ -129,6 +134,7 @@ STCLIB_OBJECTS = \
$(OBJS)\stclib_AutoComplete.obj \ $(OBJS)\stclib_AutoComplete.obj \
$(OBJS)\stclib_CallTip.obj \ $(OBJS)\stclib_CallTip.obj \
$(OBJS)\stclib_CellBuffer.obj \ $(OBJS)\stclib_CellBuffer.obj \
$(OBJS)\stclib_CharClassify.obj \
$(OBJS)\stclib_ContractionState.obj \ $(OBJS)\stclib_ContractionState.obj \
$(OBJS)\stclib_Document.obj \ $(OBJS)\stclib_Document.obj \
$(OBJS)\stclib_DocumentAccessor.obj \ $(OBJS)\stclib_DocumentAccessor.obj \
@@ -163,6 +169,7 @@ STCLIB_OBJECTS = \
$(OBJS)\stclib_LexGui4Cli.obj \ $(OBJS)\stclib_LexGui4Cli.obj \
$(OBJS)\stclib_LexHTML.obj \ $(OBJS)\stclib_LexHTML.obj \
$(OBJS)\stclib_LexHaskell.obj \ $(OBJS)\stclib_LexHaskell.obj \
$(OBJS)\stclib_LexInno.obj \
$(OBJS)\stclib_LexKix.obj \ $(OBJS)\stclib_LexKix.obj \
$(OBJS)\stclib_LexLisp.obj \ $(OBJS)\stclib_LexLisp.obj \
$(OBJS)\stclib_LexLout.obj \ $(OBJS)\stclib_LexLout.obj \
@@ -173,6 +180,7 @@ STCLIB_OBJECTS = \
$(OBJS)\stclib_LexMatlab.obj \ $(OBJS)\stclib_LexMatlab.obj \
$(OBJS)\stclib_LexMetapost.obj \ $(OBJS)\stclib_LexMetapost.obj \
$(OBJS)\stclib_LexNsis.obj \ $(OBJS)\stclib_LexNsis.obj \
$(OBJS)\stclib_LexOpal.obj \
$(OBJS)\stclib_LexOthers.obj \ $(OBJS)\stclib_LexOthers.obj \
$(OBJS)\stclib_LexPB.obj \ $(OBJS)\stclib_LexPB.obj \
$(OBJS)\stclib_LexPOV.obj \ $(OBJS)\stclib_LexPOV.obj \
@@ -187,6 +195,8 @@ STCLIB_OBJECTS = \
$(OBJS)\stclib_LexTADS3.obj \ $(OBJS)\stclib_LexTADS3.obj \
$(OBJS)\stclib_LexScriptol.obj \ $(OBJS)\stclib_LexScriptol.obj \
$(OBJS)\stclib_LexSpecman.obj \ $(OBJS)\stclib_LexSpecman.obj \
$(OBJS)\stclib_LexSpice.obj \
$(OBJS)\stclib_LexTCL.obj \
$(OBJS)\stclib_LexTeX.obj \ $(OBJS)\stclib_LexTeX.obj \
$(OBJS)\stclib_LexVB.obj \ $(OBJS)\stclib_LexVB.obj \
$(OBJS)\stclib_LexVHDL.obj \ $(OBJS)\stclib_LexVHDL.obj \
@@ -512,6 +522,9 @@ $(OBJS)\stcdll_CallTip.obj: ../../src/stc\scintilla\src\CallTip.cxx
$(OBJS)\stcdll_CellBuffer.obj: ../../src/stc\scintilla\src\CellBuffer.cxx $(OBJS)\stcdll_CellBuffer.obj: ../../src/stc\scintilla\src\CellBuffer.cxx
$(CXX) /c /nologo /TP /Fo$@ $(STCDLL_CXXFLAGS) $** $(CXX) /c /nologo /TP /Fo$@ $(STCDLL_CXXFLAGS) $**
$(OBJS)\stcdll_CharClassify.obj: ../../src/stc\scintilla\src\CharClassify.cxx
$(CXX) /c /nologo /TP /Fo$@ $(STCDLL_CXXFLAGS) $**
$(OBJS)\stcdll_ContractionState.obj: ../../src/stc\scintilla\src\ContractionState.cxx $(OBJS)\stcdll_ContractionState.obj: ../../src/stc\scintilla\src\ContractionState.cxx
$(CXX) /c /nologo /TP /Fo$@ $(STCDLL_CXXFLAGS) $** $(CXX) /c /nologo /TP /Fo$@ $(STCDLL_CXXFLAGS) $**
@@ -614,6 +627,9 @@ $(OBJS)\stcdll_LexHTML.obj: ../../src/stc\scintilla\src\LexHTML.cxx
$(OBJS)\stcdll_LexHaskell.obj: ../../src/stc\scintilla\src\LexHaskell.cxx $(OBJS)\stcdll_LexHaskell.obj: ../../src/stc\scintilla\src\LexHaskell.cxx
$(CXX) /c /nologo /TP /Fo$@ $(STCDLL_CXXFLAGS) $** $(CXX) /c /nologo /TP /Fo$@ $(STCDLL_CXXFLAGS) $**
$(OBJS)\stcdll_LexInno.obj: ../../src/stc\scintilla\src\LexInno.cxx
$(CXX) /c /nologo /TP /Fo$@ $(STCDLL_CXXFLAGS) $**
$(OBJS)\stcdll_LexKix.obj: ../../src/stc\scintilla\src\LexKix.cxx $(OBJS)\stcdll_LexKix.obj: ../../src/stc\scintilla\src\LexKix.cxx
$(CXX) /c /nologo /TP /Fo$@ $(STCDLL_CXXFLAGS) $** $(CXX) /c /nologo /TP /Fo$@ $(STCDLL_CXXFLAGS) $**
@@ -644,6 +660,9 @@ $(OBJS)\stcdll_LexMetapost.obj: ../../src/stc\scintilla\src\LexMetapost.cxx
$(OBJS)\stcdll_LexNsis.obj: ../../src/stc\scintilla\src\LexNsis.cxx $(OBJS)\stcdll_LexNsis.obj: ../../src/stc\scintilla\src\LexNsis.cxx
$(CXX) /c /nologo /TP /Fo$@ $(STCDLL_CXXFLAGS) $** $(CXX) /c /nologo /TP /Fo$@ $(STCDLL_CXXFLAGS) $**
$(OBJS)\stcdll_LexOpal.obj: ../../src/stc\scintilla\src\LexOpal.cxx
$(CXX) /c /nologo /TP /Fo$@ $(STCDLL_CXXFLAGS) $**
$(OBJS)\stcdll_LexOthers.obj: ../../src/stc\scintilla\src\LexOthers.cxx $(OBJS)\stcdll_LexOthers.obj: ../../src/stc\scintilla\src\LexOthers.cxx
$(CXX) /c /nologo /TP /Fo$@ $(STCDLL_CXXFLAGS) $** $(CXX) /c /nologo /TP /Fo$@ $(STCDLL_CXXFLAGS) $**
@@ -686,6 +705,12 @@ $(OBJS)\stcdll_LexScriptol.obj: ../../src/stc\scintilla\src\LexScriptol.cxx
$(OBJS)\stcdll_LexSpecman.obj: ../../src/stc\scintilla\src\LexSpecman.cxx $(OBJS)\stcdll_LexSpecman.obj: ../../src/stc\scintilla\src\LexSpecman.cxx
$(CXX) /c /nologo /TP /Fo$@ $(STCDLL_CXXFLAGS) $** $(CXX) /c /nologo /TP /Fo$@ $(STCDLL_CXXFLAGS) $**
$(OBJS)\stcdll_LexSpice.obj: ../../src/stc\scintilla\src\LexSpice.cxx
$(CXX) /c /nologo /TP /Fo$@ $(STCDLL_CXXFLAGS) $**
$(OBJS)\stcdll_LexTCL.obj: ../../src/stc\scintilla\src\LexTCL.cxx
$(CXX) /c /nologo /TP /Fo$@ $(STCDLL_CXXFLAGS) $**
$(OBJS)\stcdll_LexTeX.obj: ../../src/stc\scintilla\src\LexTeX.cxx $(OBJS)\stcdll_LexTeX.obj: ../../src/stc\scintilla\src\LexTeX.cxx
$(CXX) /c /nologo /TP /Fo$@ $(STCDLL_CXXFLAGS) $** $(CXX) /c /nologo /TP /Fo$@ $(STCDLL_CXXFLAGS) $**
@@ -749,6 +774,9 @@ $(OBJS)\stclib_CallTip.obj: ../../src/stc\scintilla\src\CallTip.cxx
$(OBJS)\stclib_CellBuffer.obj: ../../src/stc\scintilla\src\CellBuffer.cxx $(OBJS)\stclib_CellBuffer.obj: ../../src/stc\scintilla\src\CellBuffer.cxx
$(CXX) /c /nologo /TP /Fo$@ $(STCLIB_CXXFLAGS) $** $(CXX) /c /nologo /TP /Fo$@ $(STCLIB_CXXFLAGS) $**
$(OBJS)\stclib_CharClassify.obj: ../../src/stc\scintilla\src\CharClassify.cxx
$(CXX) /c /nologo /TP /Fo$@ $(STCLIB_CXXFLAGS) $**
$(OBJS)\stclib_ContractionState.obj: ../../src/stc\scintilla\src\ContractionState.cxx $(OBJS)\stclib_ContractionState.obj: ../../src/stc\scintilla\src\ContractionState.cxx
$(CXX) /c /nologo /TP /Fo$@ $(STCLIB_CXXFLAGS) $** $(CXX) /c /nologo /TP /Fo$@ $(STCLIB_CXXFLAGS) $**
@@ -851,6 +879,9 @@ $(OBJS)\stclib_LexHTML.obj: ../../src/stc\scintilla\src\LexHTML.cxx
$(OBJS)\stclib_LexHaskell.obj: ../../src/stc\scintilla\src\LexHaskell.cxx $(OBJS)\stclib_LexHaskell.obj: ../../src/stc\scintilla\src\LexHaskell.cxx
$(CXX) /c /nologo /TP /Fo$@ $(STCLIB_CXXFLAGS) $** $(CXX) /c /nologo /TP /Fo$@ $(STCLIB_CXXFLAGS) $**
$(OBJS)\stclib_LexInno.obj: ../../src/stc\scintilla\src\LexInno.cxx
$(CXX) /c /nologo /TP /Fo$@ $(STCLIB_CXXFLAGS) $**
$(OBJS)\stclib_LexKix.obj: ../../src/stc\scintilla\src\LexKix.cxx $(OBJS)\stclib_LexKix.obj: ../../src/stc\scintilla\src\LexKix.cxx
$(CXX) /c /nologo /TP /Fo$@ $(STCLIB_CXXFLAGS) $** $(CXX) /c /nologo /TP /Fo$@ $(STCLIB_CXXFLAGS) $**
@@ -881,6 +912,9 @@ $(OBJS)\stclib_LexMetapost.obj: ../../src/stc\scintilla\src\LexMetapost.cxx
$(OBJS)\stclib_LexNsis.obj: ../../src/stc\scintilla\src\LexNsis.cxx $(OBJS)\stclib_LexNsis.obj: ../../src/stc\scintilla\src\LexNsis.cxx
$(CXX) /c /nologo /TP /Fo$@ $(STCLIB_CXXFLAGS) $** $(CXX) /c /nologo /TP /Fo$@ $(STCLIB_CXXFLAGS) $**
$(OBJS)\stclib_LexOpal.obj: ../../src/stc\scintilla\src\LexOpal.cxx
$(CXX) /c /nologo /TP /Fo$@ $(STCLIB_CXXFLAGS) $**
$(OBJS)\stclib_LexOthers.obj: ../../src/stc\scintilla\src\LexOthers.cxx $(OBJS)\stclib_LexOthers.obj: ../../src/stc\scintilla\src\LexOthers.cxx
$(CXX) /c /nologo /TP /Fo$@ $(STCLIB_CXXFLAGS) $** $(CXX) /c /nologo /TP /Fo$@ $(STCLIB_CXXFLAGS) $**
@@ -923,6 +957,12 @@ $(OBJS)\stclib_LexScriptol.obj: ../../src/stc\scintilla\src\LexScriptol.cxx
$(OBJS)\stclib_LexSpecman.obj: ../../src/stc\scintilla\src\LexSpecman.cxx $(OBJS)\stclib_LexSpecman.obj: ../../src/stc\scintilla\src\LexSpecman.cxx
$(CXX) /c /nologo /TP /Fo$@ $(STCLIB_CXXFLAGS) $** $(CXX) /c /nologo /TP /Fo$@ $(STCLIB_CXXFLAGS) $**
$(OBJS)\stclib_LexSpice.obj: ../../src/stc\scintilla\src\LexSpice.cxx
$(CXX) /c /nologo /TP /Fo$@ $(STCLIB_CXXFLAGS) $**
$(OBJS)\stclib_LexTCL.obj: ../../src/stc\scintilla\src\LexTCL.cxx
$(CXX) /c /nologo /TP /Fo$@ $(STCLIB_CXXFLAGS) $**
$(OBJS)\stclib_LexTeX.obj: ../../src/stc\scintilla\src\LexTeX.cxx $(OBJS)\stclib_LexTeX.obj: ../../src/stc\scintilla\src\LexTeX.cxx
$(CXX) /c /nologo /TP /Fo$@ $(STCLIB_CXXFLAGS) $** $(CXX) /c /nologo /TP /Fo$@ $(STCLIB_CXXFLAGS) $**

View File

@@ -236,6 +236,7 @@ STCDLL_OBJECTS = &
$(OBJS)\stcdll_AutoComplete.obj & $(OBJS)\stcdll_AutoComplete.obj &
$(OBJS)\stcdll_CallTip.obj & $(OBJS)\stcdll_CallTip.obj &
$(OBJS)\stcdll_CellBuffer.obj & $(OBJS)\stcdll_CellBuffer.obj &
$(OBJS)\stcdll_CharClassify.obj &
$(OBJS)\stcdll_ContractionState.obj & $(OBJS)\stcdll_ContractionState.obj &
$(OBJS)\stcdll_Document.obj & $(OBJS)\stcdll_Document.obj &
$(OBJS)\stcdll_DocumentAccessor.obj & $(OBJS)\stcdll_DocumentAccessor.obj &
@@ -270,6 +271,7 @@ STCDLL_OBJECTS = &
$(OBJS)\stcdll_LexGui4Cli.obj & $(OBJS)\stcdll_LexGui4Cli.obj &
$(OBJS)\stcdll_LexHTML.obj & $(OBJS)\stcdll_LexHTML.obj &
$(OBJS)\stcdll_LexHaskell.obj & $(OBJS)\stcdll_LexHaskell.obj &
$(OBJS)\stcdll_LexInno.obj &
$(OBJS)\stcdll_LexKix.obj & $(OBJS)\stcdll_LexKix.obj &
$(OBJS)\stcdll_LexLisp.obj & $(OBJS)\stcdll_LexLisp.obj &
$(OBJS)\stcdll_LexLout.obj & $(OBJS)\stcdll_LexLout.obj &
@@ -280,6 +282,7 @@ STCDLL_OBJECTS = &
$(OBJS)\stcdll_LexMatlab.obj & $(OBJS)\stcdll_LexMatlab.obj &
$(OBJS)\stcdll_LexMetapost.obj & $(OBJS)\stcdll_LexMetapost.obj &
$(OBJS)\stcdll_LexNsis.obj & $(OBJS)\stcdll_LexNsis.obj &
$(OBJS)\stcdll_LexOpal.obj &
$(OBJS)\stcdll_LexOthers.obj & $(OBJS)\stcdll_LexOthers.obj &
$(OBJS)\stcdll_LexPB.obj & $(OBJS)\stcdll_LexPB.obj &
$(OBJS)\stcdll_LexPOV.obj & $(OBJS)\stcdll_LexPOV.obj &
@@ -294,6 +297,8 @@ STCDLL_OBJECTS = &
$(OBJS)\stcdll_LexTADS3.obj & $(OBJS)\stcdll_LexTADS3.obj &
$(OBJS)\stcdll_LexScriptol.obj & $(OBJS)\stcdll_LexScriptol.obj &
$(OBJS)\stcdll_LexSpecman.obj & $(OBJS)\stcdll_LexSpecman.obj &
$(OBJS)\stcdll_LexSpice.obj &
$(OBJS)\stcdll_LexTCL.obj &
$(OBJS)\stcdll_LexTeX.obj & $(OBJS)\stcdll_LexTeX.obj &
$(OBJS)\stcdll_LexVB.obj & $(OBJS)\stcdll_LexVB.obj &
$(OBJS)\stcdll_LexVHDL.obj & $(OBJS)\stcdll_LexVHDL.obj &
@@ -324,6 +329,7 @@ STCLIB_OBJECTS = &
$(OBJS)\stclib_AutoComplete.obj & $(OBJS)\stclib_AutoComplete.obj &
$(OBJS)\stclib_CallTip.obj & $(OBJS)\stclib_CallTip.obj &
$(OBJS)\stclib_CellBuffer.obj & $(OBJS)\stclib_CellBuffer.obj &
$(OBJS)\stclib_CharClassify.obj &
$(OBJS)\stclib_ContractionState.obj & $(OBJS)\stclib_ContractionState.obj &
$(OBJS)\stclib_Document.obj & $(OBJS)\stclib_Document.obj &
$(OBJS)\stclib_DocumentAccessor.obj & $(OBJS)\stclib_DocumentAccessor.obj &
@@ -358,6 +364,7 @@ STCLIB_OBJECTS = &
$(OBJS)\stclib_LexGui4Cli.obj & $(OBJS)\stclib_LexGui4Cli.obj &
$(OBJS)\stclib_LexHTML.obj & $(OBJS)\stclib_LexHTML.obj &
$(OBJS)\stclib_LexHaskell.obj & $(OBJS)\stclib_LexHaskell.obj &
$(OBJS)\stclib_LexInno.obj &
$(OBJS)\stclib_LexKix.obj & $(OBJS)\stclib_LexKix.obj &
$(OBJS)\stclib_LexLisp.obj & $(OBJS)\stclib_LexLisp.obj &
$(OBJS)\stclib_LexLout.obj & $(OBJS)\stclib_LexLout.obj &
@@ -368,6 +375,7 @@ STCLIB_OBJECTS = &
$(OBJS)\stclib_LexMatlab.obj & $(OBJS)\stclib_LexMatlab.obj &
$(OBJS)\stclib_LexMetapost.obj & $(OBJS)\stclib_LexMetapost.obj &
$(OBJS)\stclib_LexNsis.obj & $(OBJS)\stclib_LexNsis.obj &
$(OBJS)\stclib_LexOpal.obj &
$(OBJS)\stclib_LexOthers.obj & $(OBJS)\stclib_LexOthers.obj &
$(OBJS)\stclib_LexPB.obj & $(OBJS)\stclib_LexPB.obj &
$(OBJS)\stclib_LexPOV.obj & $(OBJS)\stclib_LexPOV.obj &
@@ -382,6 +390,8 @@ STCLIB_OBJECTS = &
$(OBJS)\stclib_LexTADS3.obj & $(OBJS)\stclib_LexTADS3.obj &
$(OBJS)\stclib_LexScriptol.obj & $(OBJS)\stclib_LexScriptol.obj &
$(OBJS)\stclib_LexSpecman.obj & $(OBJS)\stclib_LexSpecman.obj &
$(OBJS)\stclib_LexSpice.obj &
$(OBJS)\stclib_LexTCL.obj &
$(OBJS)\stclib_LexTeX.obj & $(OBJS)\stclib_LexTeX.obj &
$(OBJS)\stclib_LexVB.obj & $(OBJS)\stclib_LexVB.obj &
$(OBJS)\stclib_LexVHDL.obj & $(OBJS)\stclib_LexVHDL.obj &
@@ -460,6 +470,9 @@ $(OBJS)\stcdll_CallTip.obj : .AUTODEPEND ../../src/stc\scintilla\src\CallTip.cx
$(OBJS)\stcdll_CellBuffer.obj : .AUTODEPEND ../../src/stc\scintilla\src\CellBuffer.cxx $(OBJS)\stcdll_CellBuffer.obj : .AUTODEPEND ../../src/stc\scintilla\src\CellBuffer.cxx
$(CXX) -bt=nt -zq -fo=$^@ $(STCDLL_CXXFLAGS) $< $(CXX) -bt=nt -zq -fo=$^@ $(STCDLL_CXXFLAGS) $<
$(OBJS)\stcdll_CharClassify.obj : .AUTODEPEND ../../src/stc\scintilla\src\CharClassify.cxx
$(CXX) -bt=nt -zq -fo=$^@ $(STCDLL_CXXFLAGS) $<
$(OBJS)\stcdll_ContractionState.obj : .AUTODEPEND ../../src/stc\scintilla\src\ContractionState.cxx $(OBJS)\stcdll_ContractionState.obj : .AUTODEPEND ../../src/stc\scintilla\src\ContractionState.cxx
$(CXX) -bt=nt -zq -fo=$^@ $(STCDLL_CXXFLAGS) $< $(CXX) -bt=nt -zq -fo=$^@ $(STCDLL_CXXFLAGS) $<
@@ -562,6 +575,9 @@ $(OBJS)\stcdll_LexHTML.obj : .AUTODEPEND ../../src/stc\scintilla\src\LexHTML.cx
$(OBJS)\stcdll_LexHaskell.obj : .AUTODEPEND ../../src/stc\scintilla\src\LexHaskell.cxx $(OBJS)\stcdll_LexHaskell.obj : .AUTODEPEND ../../src/stc\scintilla\src\LexHaskell.cxx
$(CXX) -bt=nt -zq -fo=$^@ $(STCDLL_CXXFLAGS) $< $(CXX) -bt=nt -zq -fo=$^@ $(STCDLL_CXXFLAGS) $<
$(OBJS)\stcdll_LexInno.obj : .AUTODEPEND ../../src/stc\scintilla\src\LexInno.cxx
$(CXX) -bt=nt -zq -fo=$^@ $(STCDLL_CXXFLAGS) $<
$(OBJS)\stcdll_LexKix.obj : .AUTODEPEND ../../src/stc\scintilla\src\LexKix.cxx $(OBJS)\stcdll_LexKix.obj : .AUTODEPEND ../../src/stc\scintilla\src\LexKix.cxx
$(CXX) -bt=nt -zq -fo=$^@ $(STCDLL_CXXFLAGS) $< $(CXX) -bt=nt -zq -fo=$^@ $(STCDLL_CXXFLAGS) $<
@@ -592,6 +608,9 @@ $(OBJS)\stcdll_LexMetapost.obj : .AUTODEPEND ../../src/stc\scintilla\src\LexMet
$(OBJS)\stcdll_LexNsis.obj : .AUTODEPEND ../../src/stc\scintilla\src\LexNsis.cxx $(OBJS)\stcdll_LexNsis.obj : .AUTODEPEND ../../src/stc\scintilla\src\LexNsis.cxx
$(CXX) -bt=nt -zq -fo=$^@ $(STCDLL_CXXFLAGS) $< $(CXX) -bt=nt -zq -fo=$^@ $(STCDLL_CXXFLAGS) $<
$(OBJS)\stcdll_LexOpal.obj : .AUTODEPEND ../../src/stc\scintilla\src\LexOpal.cxx
$(CXX) -bt=nt -zq -fo=$^@ $(STCDLL_CXXFLAGS) $<
$(OBJS)\stcdll_LexOthers.obj : .AUTODEPEND ../../src/stc\scintilla\src\LexOthers.cxx $(OBJS)\stcdll_LexOthers.obj : .AUTODEPEND ../../src/stc\scintilla\src\LexOthers.cxx
$(CXX) -bt=nt -zq -fo=$^@ $(STCDLL_CXXFLAGS) $< $(CXX) -bt=nt -zq -fo=$^@ $(STCDLL_CXXFLAGS) $<
@@ -634,6 +653,12 @@ $(OBJS)\stcdll_LexScriptol.obj : .AUTODEPEND ../../src/stc\scintilla\src\LexScr
$(OBJS)\stcdll_LexSpecman.obj : .AUTODEPEND ../../src/stc\scintilla\src\LexSpecman.cxx $(OBJS)\stcdll_LexSpecman.obj : .AUTODEPEND ../../src/stc\scintilla\src\LexSpecman.cxx
$(CXX) -bt=nt -zq -fo=$^@ $(STCDLL_CXXFLAGS) $< $(CXX) -bt=nt -zq -fo=$^@ $(STCDLL_CXXFLAGS) $<
$(OBJS)\stcdll_LexSpice.obj : .AUTODEPEND ../../src/stc\scintilla\src\LexSpice.cxx
$(CXX) -bt=nt -zq -fo=$^@ $(STCDLL_CXXFLAGS) $<
$(OBJS)\stcdll_LexTCL.obj : .AUTODEPEND ../../src/stc\scintilla\src\LexTCL.cxx
$(CXX) -bt=nt -zq -fo=$^@ $(STCDLL_CXXFLAGS) $<
$(OBJS)\stcdll_LexTeX.obj : .AUTODEPEND ../../src/stc\scintilla\src\LexTeX.cxx $(OBJS)\stcdll_LexTeX.obj : .AUTODEPEND ../../src/stc\scintilla\src\LexTeX.cxx
$(CXX) -bt=nt -zq -fo=$^@ $(STCDLL_CXXFLAGS) $< $(CXX) -bt=nt -zq -fo=$^@ $(STCDLL_CXXFLAGS) $<
@@ -697,6 +722,9 @@ $(OBJS)\stclib_CallTip.obj : .AUTODEPEND ../../src/stc\scintilla\src\CallTip.cx
$(OBJS)\stclib_CellBuffer.obj : .AUTODEPEND ../../src/stc\scintilla\src\CellBuffer.cxx $(OBJS)\stclib_CellBuffer.obj : .AUTODEPEND ../../src/stc\scintilla\src\CellBuffer.cxx
$(CXX) -bt=nt -zq -fo=$^@ $(STCLIB_CXXFLAGS) $< $(CXX) -bt=nt -zq -fo=$^@ $(STCLIB_CXXFLAGS) $<
$(OBJS)\stclib_CharClassify.obj : .AUTODEPEND ../../src/stc\scintilla\src\CharClassify.cxx
$(CXX) -bt=nt -zq -fo=$^@ $(STCLIB_CXXFLAGS) $<
$(OBJS)\stclib_ContractionState.obj : .AUTODEPEND ../../src/stc\scintilla\src\ContractionState.cxx $(OBJS)\stclib_ContractionState.obj : .AUTODEPEND ../../src/stc\scintilla\src\ContractionState.cxx
$(CXX) -bt=nt -zq -fo=$^@ $(STCLIB_CXXFLAGS) $< $(CXX) -bt=nt -zq -fo=$^@ $(STCLIB_CXXFLAGS) $<
@@ -799,6 +827,9 @@ $(OBJS)\stclib_LexHTML.obj : .AUTODEPEND ../../src/stc\scintilla\src\LexHTML.cx
$(OBJS)\stclib_LexHaskell.obj : .AUTODEPEND ../../src/stc\scintilla\src\LexHaskell.cxx $(OBJS)\stclib_LexHaskell.obj : .AUTODEPEND ../../src/stc\scintilla\src\LexHaskell.cxx
$(CXX) -bt=nt -zq -fo=$^@ $(STCLIB_CXXFLAGS) $< $(CXX) -bt=nt -zq -fo=$^@ $(STCLIB_CXXFLAGS) $<
$(OBJS)\stclib_LexInno.obj : .AUTODEPEND ../../src/stc\scintilla\src\LexInno.cxx
$(CXX) -bt=nt -zq -fo=$^@ $(STCLIB_CXXFLAGS) $<
$(OBJS)\stclib_LexKix.obj : .AUTODEPEND ../../src/stc\scintilla\src\LexKix.cxx $(OBJS)\stclib_LexKix.obj : .AUTODEPEND ../../src/stc\scintilla\src\LexKix.cxx
$(CXX) -bt=nt -zq -fo=$^@ $(STCLIB_CXXFLAGS) $< $(CXX) -bt=nt -zq -fo=$^@ $(STCLIB_CXXFLAGS) $<
@@ -829,6 +860,9 @@ $(OBJS)\stclib_LexMetapost.obj : .AUTODEPEND ../../src/stc\scintilla\src\LexMet
$(OBJS)\stclib_LexNsis.obj : .AUTODEPEND ../../src/stc\scintilla\src\LexNsis.cxx $(OBJS)\stclib_LexNsis.obj : .AUTODEPEND ../../src/stc\scintilla\src\LexNsis.cxx
$(CXX) -bt=nt -zq -fo=$^@ $(STCLIB_CXXFLAGS) $< $(CXX) -bt=nt -zq -fo=$^@ $(STCLIB_CXXFLAGS) $<
$(OBJS)\stclib_LexOpal.obj : .AUTODEPEND ../../src/stc\scintilla\src\LexOpal.cxx
$(CXX) -bt=nt -zq -fo=$^@ $(STCLIB_CXXFLAGS) $<
$(OBJS)\stclib_LexOthers.obj : .AUTODEPEND ../../src/stc\scintilla\src\LexOthers.cxx $(OBJS)\stclib_LexOthers.obj : .AUTODEPEND ../../src/stc\scintilla\src\LexOthers.cxx
$(CXX) -bt=nt -zq -fo=$^@ $(STCLIB_CXXFLAGS) $< $(CXX) -bt=nt -zq -fo=$^@ $(STCLIB_CXXFLAGS) $<
@@ -871,6 +905,12 @@ $(OBJS)\stclib_LexScriptol.obj : .AUTODEPEND ../../src/stc\scintilla\src\LexScr
$(OBJS)\stclib_LexSpecman.obj : .AUTODEPEND ../../src/stc\scintilla\src\LexSpecman.cxx $(OBJS)\stclib_LexSpecman.obj : .AUTODEPEND ../../src/stc\scintilla\src\LexSpecman.cxx
$(CXX) -bt=nt -zq -fo=$^@ $(STCLIB_CXXFLAGS) $< $(CXX) -bt=nt -zq -fo=$^@ $(STCLIB_CXXFLAGS) $<
$(OBJS)\stclib_LexSpice.obj : .AUTODEPEND ../../src/stc\scintilla\src\LexSpice.cxx
$(CXX) -bt=nt -zq -fo=$^@ $(STCLIB_CXXFLAGS) $<
$(OBJS)\stclib_LexTCL.obj : .AUTODEPEND ../../src/stc\scintilla\src\LexTCL.cxx
$(CXX) -bt=nt -zq -fo=$^@ $(STCLIB_CXXFLAGS) $<
$(OBJS)\stclib_LexTeX.obj : .AUTODEPEND ../../src/stc\scintilla\src\LexTeX.cxx $(OBJS)\stclib_LexTeX.obj : .AUTODEPEND ../../src/stc\scintilla\src\LexTeX.cxx
$(CXX) -bt=nt -zq -fo=$^@ $(STCLIB_CXXFLAGS) $< $(CXX) -bt=nt -zq -fo=$^@ $(STCLIB_CXXFLAGS) $<

View File

@@ -15,6 +15,7 @@
scintilla/src/AutoComplete.cxx scintilla/src/AutoComplete.cxx
scintilla/src/CallTip.cxx scintilla/src/CallTip.cxx
scintilla/src/CellBuffer.cxx scintilla/src/CellBuffer.cxx
scintilla/src/CharClassify.cxx
scintilla/src/ContractionState.cxx scintilla/src/ContractionState.cxx
scintilla/src/Document.cxx scintilla/src/Document.cxx
scintilla/src/DocumentAccessor.cxx scintilla/src/DocumentAccessor.cxx
@@ -49,6 +50,7 @@
scintilla/src/LexGui4Cli.cxx scintilla/src/LexGui4Cli.cxx
scintilla/src/LexHTML.cxx scintilla/src/LexHTML.cxx
scintilla/src/LexHaskell.cxx scintilla/src/LexHaskell.cxx
scintilla/src/LexInno.cxx
scintilla/src/LexKix.cxx scintilla/src/LexKix.cxx
scintilla/src/LexLisp.cxx scintilla/src/LexLisp.cxx
scintilla/src/LexLout.cxx scintilla/src/LexLout.cxx
@@ -59,6 +61,7 @@
scintilla/src/LexMatlab.cxx scintilla/src/LexMatlab.cxx
scintilla/src/LexMetapost.cxx scintilla/src/LexMetapost.cxx
scintilla/src/LexNsis.cxx scintilla/src/LexNsis.cxx
scintilla/src/LexOpal.cxx
scintilla/src/LexOthers.cxx scintilla/src/LexOthers.cxx
scintilla/src/LexPB.cxx scintilla/src/LexPB.cxx
scintilla/src/LexPOV.cxx scintilla/src/LexPOV.cxx
@@ -73,6 +76,8 @@
scintilla/src/LexTADS3.cxx scintilla/src/LexTADS3.cxx
scintilla/src/LexScriptol.cxx scintilla/src/LexScriptol.cxx
scintilla/src/LexSpecman.cxx scintilla/src/LexSpecman.cxx
scintilla/src/LexSpice.cxx
scintilla/src/LexTCL.cxx
scintilla/src/LexTeX.cxx scintilla/src/LexTeX.cxx
scintilla/src/LexVB.cxx scintilla/src/LexVB.cxx
scintilla/src/LexVHDL.cxx scintilla/src/LexVHDL.cxx

View File

@@ -464,6 +464,10 @@ SOURCE=../../src/stc\scintilla\src\CellBuffer.cxx
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=../../src/stc\scintilla\src\CharClassify.cxx
# End Source File
# Begin Source File
SOURCE=../../src/stc\scintilla\src\ContractionState.cxx SOURCE=../../src/stc\scintilla\src\ContractionState.cxx
# End Source File # End Source File
# Begin Source File # Begin Source File
@@ -600,6 +604,10 @@ SOURCE=../../src/stc\scintilla\src\LexHaskell.cxx
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=../../src/stc\scintilla\src\LexInno.cxx
# End Source File
# Begin Source File
SOURCE=../../src/stc\scintilla\src\LexKix.cxx SOURCE=../../src/stc\scintilla\src\LexKix.cxx
# End Source File # End Source File
# Begin Source File # Begin Source File
@@ -640,6 +648,10 @@ SOURCE=../../src/stc\scintilla\src\LexNsis.cxx
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=../../src/stc\scintilla\src\LexOpal.cxx
# End Source File
# Begin Source File
SOURCE=../../src/stc\scintilla\src\LexOthers.cxx SOURCE=../../src/stc\scintilla\src\LexOthers.cxx
# End Source File # End Source File
# Begin Source File # Begin Source File
@@ -692,10 +704,18 @@ SOURCE=../../src/stc\scintilla\src\LexSpecman.cxx
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=../../src/stc\scintilla\src\LexSpice.cxx
# End Source File
# Begin Source File
SOURCE=../../src/stc\scintilla\src\LexTADS3.cxx SOURCE=../../src/stc\scintilla\src\LexTADS3.cxx
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=../../src/stc\scintilla\src\LexTCL.cxx
# End Source File
# Begin Source File
SOURCE=../../src/stc\scintilla\src\LexTeX.cxx SOURCE=../../src/stc\scintilla\src\LexTeX.cxx
# End Source File # End Source File
# Begin Source File # Begin Source File

View File

@@ -120,15 +120,18 @@
#define wxSTC_MASK_FOLDERS 0xFE000000 #define wxSTC_MASK_FOLDERS 0xFE000000
#define wxSTC_MARGIN_SYMBOL 0 #define wxSTC_MARGIN_SYMBOL 0
#define wxSTC_MARGIN_NUMBER 1 #define wxSTC_MARGIN_NUMBER 1
#define wxSTC_MARGIN_BACK 2
#define wxSTC_MARGIN_FORE 3
// Styles in range 32..37 are predefined for parts of the UI and are not used as normal styles. // Styles in range 32..38 are predefined for parts of the UI and are not used as normal styles.
// Styles 38 and 39 are for future use. // Style 39 is for future use.
#define wxSTC_STYLE_DEFAULT 32 #define wxSTC_STYLE_DEFAULT 32
#define wxSTC_STYLE_LINENUMBER 33 #define wxSTC_STYLE_LINENUMBER 33
#define wxSTC_STYLE_BRACELIGHT 34 #define wxSTC_STYLE_BRACELIGHT 34
#define wxSTC_STYLE_BRACEBAD 35 #define wxSTC_STYLE_BRACEBAD 35
#define wxSTC_STYLE_CONTROLCHAR 36 #define wxSTC_STYLE_CONTROLCHAR 36
#define wxSTC_STYLE_INDENTGUIDE 37 #define wxSTC_STYLE_INDENTGUIDE 37
#define wxSTC_STYLE_CALLTIP 38
#define wxSTC_STYLE_LASTPREDEFINED 39 #define wxSTC_STYLE_LASTPREDEFINED 39
#define wxSTC_STYLE_MAX 127 #define wxSTC_STYLE_MAX 127
@@ -166,6 +169,7 @@
#define wxSTC_INDIC_STRIKE 4 #define wxSTC_INDIC_STRIKE 4
#define wxSTC_INDIC_HIDDEN 5 #define wxSTC_INDIC_HIDDEN 5
#define wxSTC_INDIC_BOX 6 #define wxSTC_INDIC_BOX 6
#define wxSTC_INDIC_ROUNDBOX 7
#define wxSTC_INDIC0_MASK 0x20 #define wxSTC_INDIC0_MASK 0x20
#define wxSTC_INDIC1_MASK 0x40 #define wxSTC_INDIC1_MASK 0x40
#define wxSTC_INDIC2_MASK 0x80 #define wxSTC_INDIC2_MASK 0x80
@@ -258,6 +262,9 @@
#define wxSTC_SEL_STREAM 0 #define wxSTC_SEL_STREAM 0
#define wxSTC_SEL_RECTANGLE 1 #define wxSTC_SEL_RECTANGLE 1
#define wxSTC_SEL_LINES 2 #define wxSTC_SEL_LINES 2
#define wxSTC_ALPHA_TRANSPARENT 0
#define wxSTC_ALPHA_OPAQUE 255
#define wxSTC_ALPHA_NOALPHA 256
// Maximum value of keywordSet parameter of SetKeyWords. // Maximum value of keywordSet parameter of SetKeyWords.
#define wxSTC_KEYWORDSET_MAX 8 #define wxSTC_KEYWORDSET_MAX 8
@@ -381,10 +388,9 @@
#define wxSTC_LEX_FLAGSHIP 73 #define wxSTC_LEX_FLAGSHIP 73
#define wxSTC_LEX_CSOUND 74 #define wxSTC_LEX_CSOUND 74
#define wxSTC_LEX_FREEBASIC 75 #define wxSTC_LEX_FREEBASIC 75
#define wxSTC_LEX_INNOSETUP 76
// These are deprecated, STC_LEX_HTML should be used instead. #define wxSTC_LEX_OPAL 77
#define wxSTC_LEX_ASP 29 #define wxSTC_LEX_SPICE 78
#define wxSTC_LEX_PHP 30
// When a lexer specifies its language as SCLEX_AUTOMATIC it receives a // When a lexer specifies its language as SCLEX_AUTOMATIC it receives a
// value assigned in sequence from SCLEX_AUTOMATIC+1. // value assigned in sequence from SCLEX_AUTOMATIC+1.
@@ -430,6 +436,30 @@
#define wxSTC_C_COMMENTDOCKEYWORDERROR 18 #define wxSTC_C_COMMENTDOCKEYWORDERROR 18
#define wxSTC_C_GLOBALCLASS 19 #define wxSTC_C_GLOBALCLASS 19
// Lexical states for SCLEX_TCL
#define wxSTC_TCL_DEFAULT 0
#define wxSTC_TCL_COMMENT 1
#define wxSTC_TCL_COMMENTLINE 2
#define wxSTC_TCL_NUMBER 3
#define wxSTC_TCL_WORD_IN_QUOTE 4
#define wxSTC_TCL_IN_QUOTE 5
#define wxSTC_TCL_OPERATOR 6
#define wxSTC_TCL_IDENTIFIER 7
#define wxSTC_TCL_SUBSTITUTION 8
#define wxSTC_TCL_SUB_BRACE 9
#define wxSTC_TCL_MODIFIER 10
#define wxSTC_TCL_EXPAND 11
#define wxSTC_TCL_WORD 12
#define wxSTC_TCL_WORD2 13
#define wxSTC_TCL_WORD3 14
#define wxSTC_TCL_WORD4 15
#define wxSTC_TCL_WORD5 16
#define wxSTC_TCL_WORD6 17
#define wxSTC_TCL_WORD7 18
#define wxSTC_TCL_WORD8 19
#define wxSTC_TCL_COMMENT_BOX 20
#define wxSTC_TCL_BLOCK_COMMENT 21
// Lexical states for SCLEX_HTML, SCLEX_XML // Lexical states for SCLEX_HTML, SCLEX_XML
#define wxSTC_H_DEFAULT 0 #define wxSTC_H_DEFAULT 0
#define wxSTC_H_TAG 1 #define wxSTC_H_TAG 1
@@ -664,6 +694,7 @@
#define wxSTC_PROPS_SECTION 2 #define wxSTC_PROPS_SECTION 2
#define wxSTC_PROPS_ASSIGNMENT 3 #define wxSTC_PROPS_ASSIGNMENT 3
#define wxSTC_PROPS_DEFVAL 4 #define wxSTC_PROPS_DEFVAL 4
#define wxSTC_PROPS_KEY 5
// Lexical states for SCLEX_LATEX // Lexical states for SCLEX_LATEX
#define wxSTC_L_DEFAULT 0 #define wxSTC_L_DEFAULT 0
@@ -1208,6 +1239,7 @@
#define wxSTC_AU3_SPECIAL 12 #define wxSTC_AU3_SPECIAL 12
#define wxSTC_AU3_EXPAND 13 #define wxSTC_AU3_EXPAND 13
#define wxSTC_AU3_COMOBJ 14 #define wxSTC_AU3_COMOBJ 14
#define wxSTC_AU3_UDF 15
// Lexical states for SCLEX_APDL // Lexical states for SCLEX_APDL
#define wxSTC_APDL_DEFAULT 0 #define wxSTC_APDL_DEFAULT 0
@@ -1446,6 +1478,44 @@
#define wxSTC_CSOUND_GLOBAL_VAR 14 #define wxSTC_CSOUND_GLOBAL_VAR 14
#define wxSTC_CSOUND_STRINGEOL 15 #define wxSTC_CSOUND_STRINGEOL 15
// Lexical states for SCLEX_INNOSETUP
#define wxSTC_INNO_DEFAULT 0
#define wxSTC_INNO_COMMENT 1
#define wxSTC_INNO_KEYWORD 2
#define wxSTC_INNO_PARAMETER 3
#define wxSTC_INNO_SECTION 4
#define wxSTC_INNO_PREPROC 5
#define wxSTC_INNO_PREPROC_INLINE 6
#define wxSTC_INNO_COMMENT_PASCAL 7
#define wxSTC_INNO_KEYWORD_PASCAL 8
#define wxSTC_INNO_KEYWORD_USER 9
#define wxSTC_INNO_STRING_DOUBLE 10
#define wxSTC_INNO_STRING_SINGLE 11
#define wxSTC_INNO_IDENTIFIER 12
// Lexical states for SCLEX_OPAL
#define wxSTC_OPAL_SPACE 0
#define wxSTC_OPAL_COMMENT_BLOCK 1
#define wxSTC_OPAL_COMMENT_LINE 2
#define wxSTC_OPAL_INTEGER 3
#define wxSTC_OPAL_KEYWORD 4
#define wxSTC_OPAL_SORT 5
#define wxSTC_OPAL_STRING 6
#define wxSTC_OPAL_PAR 7
#define wxSTC_OPAL_BOOL_CONST 8
#define wxSTC_OPAL_DEFAULT 32
// Lexical states for SCLEX_SPICE
#define wxSTC_SPICE_DEFAULT 0
#define wxSTC_SPICE_IDENTIFIER 1
#define wxSTC_SPICE_KEYWORD 2
#define wxSTC_SPICE_KEYWORD2 3
#define wxSTC_SPICE_KEYWORD3 4
#define wxSTC_SPICE_NUMBER 5
#define wxSTC_SPICE_DELIMITER 6
#define wxSTC_SPICE_VALUE 7
#define wxSTC_SPICE_COMMENTLINE 8
//----------------------------------------- //-----------------------------------------
// Commands that can be bound to keystrokes // Commands that can be bound to keystrokes
@@ -1935,6 +2005,9 @@ public:
// Add a set of markers to a line. // Add a set of markers to a line.
void MarkerAddSet(int line, int set); void MarkerAddSet(int line, int set);
// Set the alpha used for a marker that is drawn in the text area, not the margin.
void MarkerSetAlpha(int markerNumber, int alpha);
// Set a margin to be either numeric or symbolic. // Set a margin to be either numeric or symbolic.
void SetMarginType(int margin, int marginType); void SetMarginType(int margin, int marginType);
@@ -2001,6 +2074,12 @@ public:
// Set the background colour of the selection and whether to use this setting. // Set the background colour of the selection and whether to use this setting.
void SetSelBackground(bool useSetting, const wxColour& back); void SetSelBackground(bool useSetting, const wxColour& back);
// Get the alpha of the selection.
int GetSelAlpha();
// Set the alpha of the selection.
void SetSelAlpha(int alpha);
// Set the foreground colour of the caret. // Set the foreground colour of the caret.
void SetCaretForeground(const wxColour& fore); void SetCaretForeground(const wxColour& fore);
@@ -2440,6 +2519,9 @@ public:
// Set the foreground colour for the highlighted part of the call tip. // Set the foreground colour for the highlighted part of the call tip.
void CallTipSetForegroundHighlight(const wxColour& fore); void CallTipSetForegroundHighlight(const wxColour& fore);
// Enable use of STYLE_CALLTIP and set call tip tab size in pixels.
void CallTipUseStyle(int tabSize);
// Find the display line of a document line taking hidden lines into account. // Find the display line of a document line taking hidden lines into account.
int VisibleFromDocLine(int line); int VisibleFromDocLine(int line);
@@ -3068,6 +3150,12 @@ public:
// Duplicate the selection. If selection empty duplicate the line containing the caret. // Duplicate the selection. If selection empty duplicate the line containing the caret.
void SelectionDuplicate(); void SelectionDuplicate();
// Set background alpha of the caret line.
void SetCaretLineBackAlpha(int alpha);
// Get the background alpha of the caret line.
int GetCaretLineBackAlpha();
// Start notifying the container of all key presses and commands. // Start notifying the container of all key presses and commands.
void StartRecord(); void StartRecord();

View File

@@ -66,6 +66,7 @@ STCDLL_OBJECTS = \
stcdll_AutoComplete.o \ stcdll_AutoComplete.o \
stcdll_CallTip.o \ stcdll_CallTip.o \
stcdll_CellBuffer.o \ stcdll_CellBuffer.o \
stcdll_CharClassify.o \
stcdll_ContractionState.o \ stcdll_ContractionState.o \
stcdll_Document.o \ stcdll_Document.o \
stcdll_DocumentAccessor.o \ stcdll_DocumentAccessor.o \
@@ -100,6 +101,7 @@ STCDLL_OBJECTS = \
stcdll_LexGui4Cli.o \ stcdll_LexGui4Cli.o \
stcdll_LexHTML.o \ stcdll_LexHTML.o \
stcdll_LexHaskell.o \ stcdll_LexHaskell.o \
stcdll_LexInno.o \
stcdll_LexKix.o \ stcdll_LexKix.o \
stcdll_LexLisp.o \ stcdll_LexLisp.o \
stcdll_LexLout.o \ stcdll_LexLout.o \
@@ -110,6 +112,7 @@ STCDLL_OBJECTS = \
stcdll_LexMatlab.o \ stcdll_LexMatlab.o \
stcdll_LexMetapost.o \ stcdll_LexMetapost.o \
stcdll_LexNsis.o \ stcdll_LexNsis.o \
stcdll_LexOpal.o \
stcdll_LexOthers.o \ stcdll_LexOthers.o \
stcdll_LexPB.o \ stcdll_LexPB.o \
stcdll_LexPOV.o \ stcdll_LexPOV.o \
@@ -124,6 +127,8 @@ STCDLL_OBJECTS = \
stcdll_LexTADS3.o \ stcdll_LexTADS3.o \
stcdll_LexScriptol.o \ stcdll_LexScriptol.o \
stcdll_LexSpecman.o \ stcdll_LexSpecman.o \
stcdll_LexSpice.o \
stcdll_LexTCL.o \
stcdll_LexTeX.o \ stcdll_LexTeX.o \
stcdll_LexVB.o \ stcdll_LexVB.o \
stcdll_LexVHDL.o \ stcdll_LexVHDL.o \
@@ -151,6 +156,7 @@ STCLIB_OBJECTS = \
stclib_AutoComplete.o \ stclib_AutoComplete.o \
stclib_CallTip.o \ stclib_CallTip.o \
stclib_CellBuffer.o \ stclib_CellBuffer.o \
stclib_CharClassify.o \
stclib_ContractionState.o \ stclib_ContractionState.o \
stclib_Document.o \ stclib_Document.o \
stclib_DocumentAccessor.o \ stclib_DocumentAccessor.o \
@@ -185,6 +191,7 @@ STCLIB_OBJECTS = \
stclib_LexGui4Cli.o \ stclib_LexGui4Cli.o \
stclib_LexHTML.o \ stclib_LexHTML.o \
stclib_LexHaskell.o \ stclib_LexHaskell.o \
stclib_LexInno.o \
stclib_LexKix.o \ stclib_LexKix.o \
stclib_LexLisp.o \ stclib_LexLisp.o \
stclib_LexLout.o \ stclib_LexLout.o \
@@ -195,6 +202,7 @@ STCLIB_OBJECTS = \
stclib_LexMatlab.o \ stclib_LexMatlab.o \
stclib_LexMetapost.o \ stclib_LexMetapost.o \
stclib_LexNsis.o \ stclib_LexNsis.o \
stclib_LexOpal.o \
stclib_LexOthers.o \ stclib_LexOthers.o \
stclib_LexPB.o \ stclib_LexPB.o \
stclib_LexPOV.o \ stclib_LexPOV.o \
@@ -209,6 +217,8 @@ STCLIB_OBJECTS = \
stclib_LexTADS3.o \ stclib_LexTADS3.o \
stclib_LexScriptol.o \ stclib_LexScriptol.o \
stclib_LexSpecman.o \ stclib_LexSpecman.o \
stclib_LexSpice.o \
stclib_LexTCL.o \
stclib_LexTeX.o \ stclib_LexTeX.o \
stclib_LexVB.o \ stclib_LexVB.o \
stclib_LexVHDL.o \ stclib_LexVHDL.o \
@@ -415,6 +425,9 @@ stcdll_CallTip.o: $(srcdir)/scintilla/src/CallTip.cxx
stcdll_CellBuffer.o: $(srcdir)/scintilla/src/CellBuffer.cxx stcdll_CellBuffer.o: $(srcdir)/scintilla/src/CellBuffer.cxx
$(CXXC) -c -o $@ $(STCDLL_CXXFLAGS) $(srcdir)/scintilla/src/CellBuffer.cxx $(CXXC) -c -o $@ $(STCDLL_CXXFLAGS) $(srcdir)/scintilla/src/CellBuffer.cxx
stcdll_CharClassify.o: $(srcdir)/scintilla/src/CharClassify.cxx
$(CXXC) -c -o $@ $(STCDLL_CXXFLAGS) $(srcdir)/scintilla/src/CharClassify.cxx
stcdll_ContractionState.o: $(srcdir)/scintilla/src/ContractionState.cxx stcdll_ContractionState.o: $(srcdir)/scintilla/src/ContractionState.cxx
$(CXXC) -c -o $@ $(STCDLL_CXXFLAGS) $(srcdir)/scintilla/src/ContractionState.cxx $(CXXC) -c -o $@ $(STCDLL_CXXFLAGS) $(srcdir)/scintilla/src/ContractionState.cxx
@@ -517,6 +530,9 @@ stcdll_LexHTML.o: $(srcdir)/scintilla/src/LexHTML.cxx
stcdll_LexHaskell.o: $(srcdir)/scintilla/src/LexHaskell.cxx stcdll_LexHaskell.o: $(srcdir)/scintilla/src/LexHaskell.cxx
$(CXXC) -c -o $@ $(STCDLL_CXXFLAGS) $(srcdir)/scintilla/src/LexHaskell.cxx $(CXXC) -c -o $@ $(STCDLL_CXXFLAGS) $(srcdir)/scintilla/src/LexHaskell.cxx
stcdll_LexInno.o: $(srcdir)/scintilla/src/LexInno.cxx
$(CXXC) -c -o $@ $(STCDLL_CXXFLAGS) $(srcdir)/scintilla/src/LexInno.cxx
stcdll_LexKix.o: $(srcdir)/scintilla/src/LexKix.cxx stcdll_LexKix.o: $(srcdir)/scintilla/src/LexKix.cxx
$(CXXC) -c -o $@ $(STCDLL_CXXFLAGS) $(srcdir)/scintilla/src/LexKix.cxx $(CXXC) -c -o $@ $(STCDLL_CXXFLAGS) $(srcdir)/scintilla/src/LexKix.cxx
@@ -547,6 +563,9 @@ stcdll_LexMetapost.o: $(srcdir)/scintilla/src/LexMetapost.cxx
stcdll_LexNsis.o: $(srcdir)/scintilla/src/LexNsis.cxx stcdll_LexNsis.o: $(srcdir)/scintilla/src/LexNsis.cxx
$(CXXC) -c -o $@ $(STCDLL_CXXFLAGS) $(srcdir)/scintilla/src/LexNsis.cxx $(CXXC) -c -o $@ $(STCDLL_CXXFLAGS) $(srcdir)/scintilla/src/LexNsis.cxx
stcdll_LexOpal.o: $(srcdir)/scintilla/src/LexOpal.cxx
$(CXXC) -c -o $@ $(STCDLL_CXXFLAGS) $(srcdir)/scintilla/src/LexOpal.cxx
stcdll_LexOthers.o: $(srcdir)/scintilla/src/LexOthers.cxx stcdll_LexOthers.o: $(srcdir)/scintilla/src/LexOthers.cxx
$(CXXC) -c -o $@ $(STCDLL_CXXFLAGS) $(srcdir)/scintilla/src/LexOthers.cxx $(CXXC) -c -o $@ $(STCDLL_CXXFLAGS) $(srcdir)/scintilla/src/LexOthers.cxx
@@ -589,6 +608,12 @@ stcdll_LexScriptol.o: $(srcdir)/scintilla/src/LexScriptol.cxx
stcdll_LexSpecman.o: $(srcdir)/scintilla/src/LexSpecman.cxx stcdll_LexSpecman.o: $(srcdir)/scintilla/src/LexSpecman.cxx
$(CXXC) -c -o $@ $(STCDLL_CXXFLAGS) $(srcdir)/scintilla/src/LexSpecman.cxx $(CXXC) -c -o $@ $(STCDLL_CXXFLAGS) $(srcdir)/scintilla/src/LexSpecman.cxx
stcdll_LexSpice.o: $(srcdir)/scintilla/src/LexSpice.cxx
$(CXXC) -c -o $@ $(STCDLL_CXXFLAGS) $(srcdir)/scintilla/src/LexSpice.cxx
stcdll_LexTCL.o: $(srcdir)/scintilla/src/LexTCL.cxx
$(CXXC) -c -o $@ $(STCDLL_CXXFLAGS) $(srcdir)/scintilla/src/LexTCL.cxx
stcdll_LexTeX.o: $(srcdir)/scintilla/src/LexTeX.cxx stcdll_LexTeX.o: $(srcdir)/scintilla/src/LexTeX.cxx
$(CXXC) -c -o $@ $(STCDLL_CXXFLAGS) $(srcdir)/scintilla/src/LexTeX.cxx $(CXXC) -c -o $@ $(STCDLL_CXXFLAGS) $(srcdir)/scintilla/src/LexTeX.cxx
@@ -652,6 +677,9 @@ stclib_CallTip.o: $(srcdir)/scintilla/src/CallTip.cxx
stclib_CellBuffer.o: $(srcdir)/scintilla/src/CellBuffer.cxx stclib_CellBuffer.o: $(srcdir)/scintilla/src/CellBuffer.cxx
$(CXXC) -c -o $@ $(STCLIB_CXXFLAGS) $(srcdir)/scintilla/src/CellBuffer.cxx $(CXXC) -c -o $@ $(STCLIB_CXXFLAGS) $(srcdir)/scintilla/src/CellBuffer.cxx
stclib_CharClassify.o: $(srcdir)/scintilla/src/CharClassify.cxx
$(CXXC) -c -o $@ $(STCLIB_CXXFLAGS) $(srcdir)/scintilla/src/CharClassify.cxx
stclib_ContractionState.o: $(srcdir)/scintilla/src/ContractionState.cxx stclib_ContractionState.o: $(srcdir)/scintilla/src/ContractionState.cxx
$(CXXC) -c -o $@ $(STCLIB_CXXFLAGS) $(srcdir)/scintilla/src/ContractionState.cxx $(CXXC) -c -o $@ $(STCLIB_CXXFLAGS) $(srcdir)/scintilla/src/ContractionState.cxx
@@ -754,6 +782,9 @@ stclib_LexHTML.o: $(srcdir)/scintilla/src/LexHTML.cxx
stclib_LexHaskell.o: $(srcdir)/scintilla/src/LexHaskell.cxx stclib_LexHaskell.o: $(srcdir)/scintilla/src/LexHaskell.cxx
$(CXXC) -c -o $@ $(STCLIB_CXXFLAGS) $(srcdir)/scintilla/src/LexHaskell.cxx $(CXXC) -c -o $@ $(STCLIB_CXXFLAGS) $(srcdir)/scintilla/src/LexHaskell.cxx
stclib_LexInno.o: $(srcdir)/scintilla/src/LexInno.cxx
$(CXXC) -c -o $@ $(STCLIB_CXXFLAGS) $(srcdir)/scintilla/src/LexInno.cxx
stclib_LexKix.o: $(srcdir)/scintilla/src/LexKix.cxx stclib_LexKix.o: $(srcdir)/scintilla/src/LexKix.cxx
$(CXXC) -c -o $@ $(STCLIB_CXXFLAGS) $(srcdir)/scintilla/src/LexKix.cxx $(CXXC) -c -o $@ $(STCLIB_CXXFLAGS) $(srcdir)/scintilla/src/LexKix.cxx
@@ -784,6 +815,9 @@ stclib_LexMetapost.o: $(srcdir)/scintilla/src/LexMetapost.cxx
stclib_LexNsis.o: $(srcdir)/scintilla/src/LexNsis.cxx stclib_LexNsis.o: $(srcdir)/scintilla/src/LexNsis.cxx
$(CXXC) -c -o $@ $(STCLIB_CXXFLAGS) $(srcdir)/scintilla/src/LexNsis.cxx $(CXXC) -c -o $@ $(STCLIB_CXXFLAGS) $(srcdir)/scintilla/src/LexNsis.cxx
stclib_LexOpal.o: $(srcdir)/scintilla/src/LexOpal.cxx
$(CXXC) -c -o $@ $(STCLIB_CXXFLAGS) $(srcdir)/scintilla/src/LexOpal.cxx
stclib_LexOthers.o: $(srcdir)/scintilla/src/LexOthers.cxx stclib_LexOthers.o: $(srcdir)/scintilla/src/LexOthers.cxx
$(CXXC) -c -o $@ $(STCLIB_CXXFLAGS) $(srcdir)/scintilla/src/LexOthers.cxx $(CXXC) -c -o $@ $(STCLIB_CXXFLAGS) $(srcdir)/scintilla/src/LexOthers.cxx
@@ -826,6 +860,12 @@ stclib_LexScriptol.o: $(srcdir)/scintilla/src/LexScriptol.cxx
stclib_LexSpecman.o: $(srcdir)/scintilla/src/LexSpecman.cxx stclib_LexSpecman.o: $(srcdir)/scintilla/src/LexSpecman.cxx
$(CXXC) -c -o $@ $(STCLIB_CXXFLAGS) $(srcdir)/scintilla/src/LexSpecman.cxx $(CXXC) -c -o $@ $(STCLIB_CXXFLAGS) $(srcdir)/scintilla/src/LexSpecman.cxx
stclib_LexSpice.o: $(srcdir)/scintilla/src/LexSpice.cxx
$(CXXC) -c -o $@ $(STCLIB_CXXFLAGS) $(srcdir)/scintilla/src/LexSpice.cxx
stclib_LexTCL.o: $(srcdir)/scintilla/src/LexTCL.cxx
$(CXXC) -c -o $@ $(STCLIB_CXXFLAGS) $(srcdir)/scintilla/src/LexTCL.cxx
stclib_LexTeX.o: $(srcdir)/scintilla/src/LexTeX.cxx stclib_LexTeX.o: $(srcdir)/scintilla/src/LexTeX.cxx
$(CXXC) -c -o $@ $(STCLIB_CXXFLAGS) $(srcdir)/scintilla/src/LexTeX.cxx $(CXXC) -c -o $@ $(STCLIB_CXXFLAGS) $(srcdir)/scintilla/src/LexTeX.cxx

View File

@@ -47,14 +47,21 @@ wxColour wxColourFromCA(const ColourAllocated& ca) {
Palette::Palette() { Palette::Palette() {
used = 0; used = 0;
allowRealization = false; allowRealization = false;
size = 100;
entries = new ColourPair[size];
} }
Palette::~Palette() { Palette::~Palette() {
Release(); Release();
delete [] entries;
entries = 0;
} }
void Palette::Release() { void Palette::Release() {
used = 0; used = 0;
delete [] entries;
size = 100;
entries = new ColourPair[size];
} }
// This method either adds a colour to the list of wanted colours (want==true) // This method either adds a colour to the list of wanted colours (want==true)
@@ -67,11 +74,20 @@ void Palette::WantFind(ColourPair &cp, bool want) {
return; return;
} }
if (used < numEntries) { if (used >= size) {
entries[used].desired = cp.desired; int sizeNew = size * 2;
entries[used].allocated.Set(cp.desired.AsLong()); ColourPair *entriesNew = new ColourPair[sizeNew];
used++; for (int j=0; j<size; j++) {
entriesNew[j] = entries[j];
}
delete []entries;
entries = entriesNew;
size = sizeNew;
} }
entries[used].desired = cp.desired;
entries[used].allocated.Set(cp.desired.AsLong());
used++;
} else { } else {
for (int i=0; i < used; i++) { for (int i=0; i < used; i++) {
if (entries[i].desired == cp.desired) { if (entries[i].desired == cp.desired) {
@@ -162,6 +178,8 @@ public:
virtual void FillRectangle(PRectangle rc, ColourAllocated back); virtual void FillRectangle(PRectangle rc, ColourAllocated back);
virtual void FillRectangle(PRectangle rc, Surface &surfacePattern); virtual void FillRectangle(PRectangle rc, Surface &surfacePattern);
virtual void RoundedRectangle(PRectangle rc, ColourAllocated fore, ColourAllocated back); virtual void RoundedRectangle(PRectangle rc, ColourAllocated fore, ColourAllocated back);
virtual void AlphaRectangle(PRectangle rc, int cornerSize, ColourAllocated fill, int alphaFill,
ColourAllocated outline, int alphaOutline, int flags);
virtual void Ellipse(PRectangle rc, ColourAllocated fore, ColourAllocated back); virtual void Ellipse(PRectangle rc, ColourAllocated fore, ColourAllocated back);
virtual void Copy(PRectangle rc, Point from, Surface &surfaceSource); virtual void Copy(PRectangle rc, Point from, Surface &surfaceSource);
@@ -316,6 +334,14 @@ void SurfaceImpl::RoundedRectangle(PRectangle rc, ColourAllocated fore, ColourAl
hdc->DrawRoundedRectangle(wxRectFromPRectangle(rc), 4); hdc->DrawRoundedRectangle(wxRectFromPRectangle(rc), 4);
} }
void SurfaceImpl::AlphaRectangle(PRectangle rc, int cornerSize,
ColourAllocated fill, int alphaFill,
ColourAllocated outline, int alphaOutline, int flags) {
// ** TODO
RectangleDraw(rc, outline, fill);
}
void SurfaceImpl::Ellipse(PRectangle rc, ColourAllocated fore, ColourAllocated back) { void SurfaceImpl::Ellipse(PRectangle rc, ColourAllocated fore, ColourAllocated back) {
PenColour(fore); PenColour(fore);
BrushColour(back); BrushColour(back);

View File

@@ -27,6 +27,7 @@
#include "Platform.h" #include "Platform.h"
#include "Scintilla.h" #include "Scintilla.h"
#include "CharClassify.h"
#include "XPM.h" #include "XPM.h"
#ifdef SCI_LEXER #ifdef SCI_LEXER
#include "SciLexer.h" #include "SciLexer.h"
@@ -48,7 +49,6 @@
#include "Editor.h" #include "Editor.h"
#include "ScintillaBase.h" #include "ScintillaBase.h"
//---------------------------------------------------------------------- //----------------------------------------------------------------------
#ifdef WXMAKINGDLL_STC #ifdef WXMAKINGDLL_STC

View File

@@ -3,5 +3,5 @@ scintilla/include directories from the Scintilla/SCiTE source
distribution. All other code needed to implement Scintilla on top of distribution. All other code needed to implement Scintilla on top of
wxWindows is located in the directory above this one. wxWindows is located in the directory above this one.
The current version of the Scintilla code is 1.67 The current version of the Scintilla code is 1.70

View File

@@ -236,12 +236,15 @@ class Window; // Forward declaration for Palette
*/ */
class Palette { class Palette {
int used; int used;
enum {numEntries = 100}; int size;
ColourPair entries[numEntries]; ColourPair *entries;
#if PLAT_GTK #if PLAT_GTK
void *allocatedPalette; // GdkColor * void *allocatedPalette; // GdkColor *
int allocatedLen; int allocatedLen;
#endif #endif
// Private so Palette objects can not be copied
Palette(const Palette &) {}
Palette &operator=(const Palette &) { return *this; }
public: public:
#if PLAT_WIN #if PLAT_WIN
void *hpal; void *hpal;
@@ -319,6 +322,8 @@ public:
virtual void FillRectangle(PRectangle rc, ColourAllocated back)=0; virtual void FillRectangle(PRectangle rc, ColourAllocated back)=0;
virtual void FillRectangle(PRectangle rc, Surface &surfacePattern)=0; virtual void FillRectangle(PRectangle rc, Surface &surfacePattern)=0;
virtual void RoundedRectangle(PRectangle rc, ColourAllocated fore, ColourAllocated back)=0; virtual void RoundedRectangle(PRectangle rc, ColourAllocated fore, ColourAllocated back)=0;
virtual void AlphaRectangle(PRectangle rc, int cornerSize, ColourAllocated fill, int alphaFill,
ColourAllocated outline, int alphaOutline, int flags)=0;
virtual void Ellipse(PRectangle rc, ColourAllocated fore, ColourAllocated back)=0; virtual void Ellipse(PRectangle rc, ColourAllocated fore, ColourAllocated back)=0;
virtual void Copy(PRectangle rc, Point from, Surface &surfaceSource)=0; virtual void Copy(PRectangle rc, Point from, Surface &surfaceSource)=0;

View File

@@ -88,6 +88,9 @@
#define SCLEX_FLAGSHIP 73 #define SCLEX_FLAGSHIP 73
#define SCLEX_CSOUND 74 #define SCLEX_CSOUND 74
#define SCLEX_FREEBASIC 75 #define SCLEX_FREEBASIC 75
#define SCLEX_INNOSETUP 76
#define SCLEX_OPAL 77
#define SCLEX_SPICE 78
#define SCLEX_AUTOMATIC 1000 #define SCLEX_AUTOMATIC 1000
#define SCE_P_DEFAULT 0 #define SCE_P_DEFAULT 0
#define SCE_P_COMMENTLINE 1 #define SCE_P_COMMENTLINE 1
@@ -125,6 +128,28 @@
#define SCE_C_COMMENTDOCKEYWORD 17 #define SCE_C_COMMENTDOCKEYWORD 17
#define SCE_C_COMMENTDOCKEYWORDERROR 18 #define SCE_C_COMMENTDOCKEYWORDERROR 18
#define SCE_C_GLOBALCLASS 19 #define SCE_C_GLOBALCLASS 19
#define SCE_TCL_DEFAULT 0
#define SCE_TCL_COMMENT 1
#define SCE_TCL_COMMENTLINE 2
#define SCE_TCL_NUMBER 3
#define SCE_TCL_WORD_IN_QUOTE 4
#define SCE_TCL_IN_QUOTE 5
#define SCE_TCL_OPERATOR 6
#define SCE_TCL_IDENTIFIER 7
#define SCE_TCL_SUBSTITUTION 8
#define SCE_TCL_SUB_BRACE 9
#define SCE_TCL_MODIFIER 10
#define SCE_TCL_EXPAND 11
#define SCE_TCL_WORD 12
#define SCE_TCL_WORD2 13
#define SCE_TCL_WORD3 14
#define SCE_TCL_WORD4 15
#define SCE_TCL_WORD5 16
#define SCE_TCL_WORD6 17
#define SCE_TCL_WORD7 18
#define SCE_TCL_WORD8 19
#define SCE_TCL_COMMENT_BOX 20
#define SCE_TCL_BLOCK_COMMENT 21
#define SCE_H_DEFAULT 0 #define SCE_H_DEFAULT 0
#define SCE_H_TAG 1 #define SCE_H_TAG 1
#define SCE_H_TAGUNKNOWN 2 #define SCE_H_TAGUNKNOWN 2
@@ -326,6 +351,7 @@
#define SCE_PROPS_SECTION 2 #define SCE_PROPS_SECTION 2
#define SCE_PROPS_ASSIGNMENT 3 #define SCE_PROPS_ASSIGNMENT 3
#define SCE_PROPS_DEFVAL 4 #define SCE_PROPS_DEFVAL 4
#define SCE_PROPS_KEY 5
#define SCE_L_DEFAULT 0 #define SCE_L_DEFAULT 0
#define SCE_L_COMMAND 1 #define SCE_L_COMMAND 1
#define SCE_L_TAG 2 #define SCE_L_TAG 2
@@ -795,6 +821,7 @@
#define SCE_AU3_SPECIAL 12 #define SCE_AU3_SPECIAL 12
#define SCE_AU3_EXPAND 13 #define SCE_AU3_EXPAND 13
#define SCE_AU3_COMOBJ 14 #define SCE_AU3_COMOBJ 14
#define SCE_AU3_UDF 15
#define SCE_APDL_DEFAULT 0 #define SCE_APDL_DEFAULT 0
#define SCE_APDL_COMMENT 1 #define SCE_APDL_COMMENT 1
#define SCE_APDL_COMMENTBLOCK 2 #define SCE_APDL_COMMENTBLOCK 2
@@ -1008,6 +1035,38 @@
#define SCE_CSOUND_IRATE_VAR 13 #define SCE_CSOUND_IRATE_VAR 13
#define SCE_CSOUND_GLOBAL_VAR 14 #define SCE_CSOUND_GLOBAL_VAR 14
#define SCE_CSOUND_STRINGEOL 15 #define SCE_CSOUND_STRINGEOL 15
#define SCE_INNO_DEFAULT 0
#define SCE_INNO_COMMENT 1
#define SCE_INNO_KEYWORD 2
#define SCE_INNO_PARAMETER 3
#define SCE_INNO_SECTION 4
#define SCE_INNO_PREPROC 5
#define SCE_INNO_PREPROC_INLINE 6
#define SCE_INNO_COMMENT_PASCAL 7
#define SCE_INNO_KEYWORD_PASCAL 8
#define SCE_INNO_KEYWORD_USER 9
#define SCE_INNO_STRING_DOUBLE 10
#define SCE_INNO_STRING_SINGLE 11
#define SCE_INNO_IDENTIFIER 12
#define SCE_OPAL_SPACE 0
#define SCE_OPAL_COMMENT_BLOCK 1
#define SCE_OPAL_COMMENT_LINE 2
#define SCE_OPAL_INTEGER 3
#define SCE_OPAL_KEYWORD 4
#define SCE_OPAL_SORT 5
#define SCE_OPAL_STRING 6
#define SCE_OPAL_PAR 7
#define SCE_OPAL_BOOL_CONST 8
#define SCE_OPAL_DEFAULT 32
#define SCE_SPICE_DEFAULT 0
#define SCE_SPICE_IDENTIFIER 1
#define SCE_SPICE_KEYWORD 2
#define SCE_SPICE_KEYWORD2 3
#define SCE_SPICE_KEYWORD3 4
#define SCE_SPICE_NUMBER 5
#define SCE_SPICE_DELIMITER 6
#define SCE_SPICE_VALUE 7
#define SCE_SPICE_COMMENTLINE 8
#define SCLEX_ASP 29 #define SCLEX_ASP 29
#define SCLEX_PHP 30 #define SCLEX_PHP 30
//--Autogenerated -- end of section automatically generated from Scintilla.iface //--Autogenerated -- end of section automatically generated from Scintilla.iface

View File

@@ -138,8 +138,11 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
#define SCI_MARKERPREVIOUS 2048 #define SCI_MARKERPREVIOUS 2048
#define SCI_MARKERDEFINEPIXMAP 2049 #define SCI_MARKERDEFINEPIXMAP 2049
#define SCI_MARKERADDSET 2466 #define SCI_MARKERADDSET 2466
#define SCI_MARKERSETALPHA 2476
#define SC_MARGIN_SYMBOL 0 #define SC_MARGIN_SYMBOL 0
#define SC_MARGIN_NUMBER 1 #define SC_MARGIN_NUMBER 1
#define SC_MARGIN_BACK 2
#define SC_MARGIN_FORE 3
#define SCI_SETMARGINTYPEN 2240 #define SCI_SETMARGINTYPEN 2240
#define SCI_GETMARGINTYPEN 2241 #define SCI_GETMARGINTYPEN 2241
#define SCI_SETMARGINWIDTHN 2242 #define SCI_SETMARGINWIDTHN 2242
@@ -154,6 +157,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
#define STYLE_BRACEBAD 35 #define STYLE_BRACEBAD 35
#define STYLE_CONTROLCHAR 36 #define STYLE_CONTROLCHAR 36
#define STYLE_INDENTGUIDE 37 #define STYLE_INDENTGUIDE 37
#define STYLE_CALLTIP 38
#define STYLE_LASTPREDEFINED 39 #define STYLE_LASTPREDEFINED 39
#define STYLE_MAX 127 #define STYLE_MAX 127
#define SC_CHARSET_ANSI 0 #define SC_CHARSET_ANSI 0
@@ -195,6 +199,8 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
#define SCI_STYLESETHOTSPOT 2409 #define SCI_STYLESETHOTSPOT 2409
#define SCI_SETSELFORE 2067 #define SCI_SETSELFORE 2067
#define SCI_SETSELBACK 2068 #define SCI_SETSELBACK 2068
#define SCI_GETSELALPHA 2477
#define SCI_SETSELALPHA 2478
#define SCI_SETCARETFORE 2069 #define SCI_SETCARETFORE 2069
#define SCI_ASSIGNCMDKEY 2070 #define SCI_ASSIGNCMDKEY 2070
#define SCI_CLEARCMDKEY 2071 #define SCI_CLEARCMDKEY 2071
@@ -214,6 +220,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
#define INDIC_STRIKE 4 #define INDIC_STRIKE 4
#define INDIC_HIDDEN 5 #define INDIC_HIDDEN 5
#define INDIC_BOX 6 #define INDIC_BOX 6
#define INDIC_ROUNDBOX 7
#define INDIC0_MASK 0x20 #define INDIC0_MASK 0x20
#define INDIC1_MASK 0x40 #define INDIC1_MASK 0x40
#define INDIC2_MASK 0x80 #define INDIC2_MASK 0x80
@@ -358,6 +365,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
#define SCI_CALLTIPSETBACK 2205 #define SCI_CALLTIPSETBACK 2205
#define SCI_CALLTIPSETFORE 2206 #define SCI_CALLTIPSETFORE 2206
#define SCI_CALLTIPSETFOREHLT 2207 #define SCI_CALLTIPSETFOREHLT 2207
#define SCI_CALLTIPUSESTYLE 2212
#define SCI_VISIBLEFROMDOCLINE 2220 #define SCI_VISIBLEFROMDOCLINE 2220
#define SCI_DOCLINEFROMVISIBLE 2221 #define SCI_DOCLINEFROMVISIBLE 2221
#define SCI_WRAPCOUNT 2235 #define SCI_WRAPCOUNT 2235
@@ -607,6 +615,11 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
#define SCI_SETPASTECONVERTENDINGS 2467 #define SCI_SETPASTECONVERTENDINGS 2467
#define SCI_GETPASTECONVERTENDINGS 2468 #define SCI_GETPASTECONVERTENDINGS 2468
#define SCI_SELECTIONDUPLICATE 2469 #define SCI_SELECTIONDUPLICATE 2469
#define SC_ALPHA_TRANSPARENT 0
#define SC_ALPHA_OPAQUE 255
#define SC_ALPHA_NOALPHA 256
#define SCI_SETCARETLINEBACKALPHA 2470
#define SCI_GETCARETLINEBACKALPHA 2471
#define SCI_STARTRECORD 3001 #define SCI_STARTRECORD 3001
#define SCI_STOPRECORD 3002 #define SCI_STOPRECORD 3002
#define SCI_SETLEXER 4001 #define SCI_SETLEXER 4001

View File

@@ -316,9 +316,14 @@ fun void MarkerDefinePixmap=2049(int markerNumber, string pixmap)
# Add a set of markers to a line. # Add a set of markers to a line.
fun void MarkerAddSet=2466(int line, int set) fun void MarkerAddSet=2466(int line, int set)
# Set the alpha used for a marker that is drawn in the text area, not the margin.
fun void MarkerSetAlpha=2476(int markerNumber, int alpha)
enu MarginType=SC_MARGIN_ enu MarginType=SC_MARGIN_
val SC_MARGIN_SYMBOL=0 val SC_MARGIN_SYMBOL=0
val SC_MARGIN_NUMBER=1 val SC_MARGIN_NUMBER=1
val SC_MARGIN_BACK=2
val SC_MARGIN_FORE=3
# Set a margin to be either numeric or symbolic. # Set a margin to be either numeric or symbolic.
set void SetMarginTypeN=2240(int margin, int marginType) set void SetMarginTypeN=2240(int margin, int marginType)
@@ -344,8 +349,8 @@ set void SetMarginSensitiveN=2246(int margin, bool sensitive)
# Retrieve the mouse click sensitivity of a margin. # Retrieve the mouse click sensitivity of a margin.
get bool GetMarginSensitiveN=2247(int margin,) get bool GetMarginSensitiveN=2247(int margin,)
# Styles in range 32..37 are predefined for parts of the UI and are not used as normal styles. # Styles in range 32..38 are predefined for parts of the UI and are not used as normal styles.
# Styles 38 and 39 are for future use. # Style 39 is for future use.
enu StylesCommon=STYLE_ enu StylesCommon=STYLE_
val STYLE_DEFAULT=32 val STYLE_DEFAULT=32
val STYLE_LINENUMBER=33 val STYLE_LINENUMBER=33
@@ -353,6 +358,7 @@ val STYLE_BRACELIGHT=34
val STYLE_BRACEBAD=35 val STYLE_BRACEBAD=35
val STYLE_CONTROLCHAR=36 val STYLE_CONTROLCHAR=36
val STYLE_INDENTGUIDE=37 val STYLE_INDENTGUIDE=37
val STYLE_CALLTIP=38
val STYLE_LASTPREDEFINED=39 val STYLE_LASTPREDEFINED=39
val STYLE_MAX=127 val STYLE_MAX=127
@@ -430,6 +436,12 @@ fun void SetSelFore=2067(bool useSetting, colour fore)
# Set the background colour of the selection and whether to use this setting. # Set the background colour of the selection and whether to use this setting.
fun void SetSelBack=2068(bool useSetting, colour back) fun void SetSelBack=2068(bool useSetting, colour back)
# Get the alpha of the selection.
get int GetSelAlpha=2477(,)
# Set the alpha of the selection.
set void SetSelAlpha=2478(int alpha,)
# Set the foreground colour of the caret. # Set the foreground colour of the caret.
set void SetCaretFore=2069(colour fore,) set void SetCaretFore=2069(colour fore,)
@@ -474,6 +486,7 @@ val INDIC_DIAGONAL=3
val INDIC_STRIKE=4 val INDIC_STRIKE=4
val INDIC_HIDDEN=5 val INDIC_HIDDEN=5
val INDIC_BOX=6 val INDIC_BOX=6
val INDIC_ROUNDBOX=7
val INDIC0_MASK=0x20 val INDIC0_MASK=0x20
val INDIC1_MASK=0x40 val INDIC1_MASK=0x40
val INDIC2_MASK=0x80 val INDIC2_MASK=0x80
@@ -919,6 +932,9 @@ set void CallTipSetFore=2206(colour fore,)
# Set the foreground colour for the highlighted part of the call tip. # Set the foreground colour for the highlighted part of the call tip.
set void CallTipSetForeHlt=2207(colour fore,) set void CallTipSetForeHlt=2207(colour fore,)
# Enable use of STYLE_CALLTIP and set call tip tab size in pixels.
set void CallTipUseStyle=2212(int tabSize,)
# Find the display line of a document line taking hidden lines into account. # Find the display line of a document line taking hidden lines into account.
fun int VisibleFromDocLine=2220(int line,) fun int VisibleFromDocLine=2220(int line,)
@@ -1446,7 +1462,6 @@ get int GetXOffset=2398(,)
fun void ChooseCaretX=2399(,) fun void ChooseCaretX=2399(,)
# Set the focus to this Scintilla widget. # Set the focus to this Scintilla widget.
# GTK+ Specific.
fun void GrabFocus=2400(,) fun void GrabFocus=2400(,)
enu CaretPolicy = CARET_ enu CaretPolicy = CARET_
@@ -1642,6 +1657,16 @@ get bool GetPasteConvertEndings=2468(,)
# Duplicate the selection. If selection empty duplicate the line containing the caret. # Duplicate the selection. If selection empty duplicate the line containing the caret.
fun void SelectionDuplicate=2469(,) fun void SelectionDuplicate=2469(,)
val SC_ALPHA_TRANSPARENT=0
val SC_ALPHA_OPAQUE=255
val SC_ALPHA_NOALPHA=256
# Set background alpha of the caret line.
set void SetCaretLineBackAlpha=2470(int alpha,)
# Get the background alpha of the caret line.
get int GetCaretLineBackAlpha=2471(,)
# Start notifying the container of all key presses and commands. # Start notifying the container of all key presses and commands.
fun void StartRecord=3001(,) fun void StartRecord=3001(,)
@@ -1820,11 +1845,9 @@ val SCLEX_SMALLTALK=72
val SCLEX_FLAGSHIP=73 val SCLEX_FLAGSHIP=73
val SCLEX_CSOUND=74 val SCLEX_CSOUND=74
val SCLEX_FREEBASIC=75 val SCLEX_FREEBASIC=75
val SCLEX_INNOSETUP=76
# These are deprecated, STC_LEX_HTML should be used instead. val SCLEX_OPAL=77
val SCLEX_ASP=29 val SCLEX_SPICE=78
val SCLEX_PHP=30
# When a lexer specifies its language as SCLEX_AUTOMATIC it receives a # When a lexer specifies its language as SCLEX_AUTOMATIC it receives a
# value assigned in sequence from SCLEX_AUTOMATIC+1. # value assigned in sequence from SCLEX_AUTOMATIC+1.
@@ -1850,7 +1873,6 @@ val SCE_P_DECORATOR=15
# Lexical states for SCLEX_CPP # Lexical states for SCLEX_CPP
lex Cpp=SCLEX_CPP SCE_C_ lex Cpp=SCLEX_CPP SCE_C_
lex Pascal=SCLEX_PASCAL SCE_C_ lex Pascal=SCLEX_PASCAL SCE_C_
lex TCL=SCLEX_TCL SCE_C_
lex BullAnt=SCLEX_BULLANT SCE_C_ lex BullAnt=SCLEX_BULLANT SCE_C_
val SCE_C_DEFAULT=0 val SCE_C_DEFAULT=0
val SCE_C_COMMENT=1 val SCE_C_COMMENT=1
@@ -1872,6 +1894,30 @@ val SCE_C_WORD2=16
val SCE_C_COMMENTDOCKEYWORD=17 val SCE_C_COMMENTDOCKEYWORD=17
val SCE_C_COMMENTDOCKEYWORDERROR=18 val SCE_C_COMMENTDOCKEYWORDERROR=18
val SCE_C_GLOBALCLASS=19 val SCE_C_GLOBALCLASS=19
# Lexical states for SCLEX_TCL
lex TCL=SCLEX_TCL SCE_TCL_
val SCE_TCL_DEFAULT=0
val SCE_TCL_COMMENT=1
val SCE_TCL_COMMENTLINE=2
val SCE_TCL_NUMBER=3
val SCE_TCL_WORD_IN_QUOTE=4
val SCE_TCL_IN_QUOTE=5
val SCE_TCL_OPERATOR=6
val SCE_TCL_IDENTIFIER=7
val SCE_TCL_SUBSTITUTION=8
val SCE_TCL_SUB_BRACE=9
val SCE_TCL_MODIFIER=10
val SCE_TCL_EXPAND=11
val SCE_TCL_WORD=12
val SCE_TCL_WORD2=13
val SCE_TCL_WORD3=14
val SCE_TCL_WORD4=15
val SCE_TCL_WORD5=16
val SCE_TCL_WORD6=17
val SCE_TCL_WORD7=18
val SCE_TCL_WORD8=19
val SCE_TCL_COMMENT_BOX=20
val SCE_TCL_BLOCK_COMMENT=21
# Lexical states for SCLEX_HTML, SCLEX_XML # Lexical states for SCLEX_HTML, SCLEX_XML
lex HTML=SCLEX_HTML SCE_H lex HTML=SCLEX_HTML SCE_H
lex XML=SCLEX_XML SCE_H lex XML=SCLEX_XML SCE_H
@@ -2100,6 +2146,7 @@ val SCE_PROPS_COMMENT=1
val SCE_PROPS_SECTION=2 val SCE_PROPS_SECTION=2
val SCE_PROPS_ASSIGNMENT=3 val SCE_PROPS_ASSIGNMENT=3
val SCE_PROPS_DEFVAL=4 val SCE_PROPS_DEFVAL=4
val SCE_PROPS_KEY=5
# Lexical states for SCLEX_LATEX # Lexical states for SCLEX_LATEX
lex LaTeX=SCLEX_LATEX SCE_L_ lex LaTeX=SCLEX_LATEX SCE_L_
val SCE_L_DEFAULT=0 val SCE_L_DEFAULT=0
@@ -2646,6 +2693,7 @@ val SCE_AU3_PREPROCESSOR=11
val SCE_AU3_SPECIAL=12 val SCE_AU3_SPECIAL=12
val SCE_AU3_EXPAND=13 val SCE_AU3_EXPAND=13
val SCE_AU3_COMOBJ=14 val SCE_AU3_COMOBJ=14
val SCE_AU3_UDF=15
# Lexical states for SCLEX_APDL # Lexical states for SCLEX_APDL
lex APDL=SCLEX_APDL SCE_APDL_ lex APDL=SCLEX_APDL SCE_APDL_
val SCE_APDL_DEFAULT=0 val SCE_APDL_DEFAULT=0
@@ -2883,6 +2931,44 @@ val SCE_CSOUND_KRATE_VAR=12
val SCE_CSOUND_IRATE_VAR=13 val SCE_CSOUND_IRATE_VAR=13
val SCE_CSOUND_GLOBAL_VAR=14 val SCE_CSOUND_GLOBAL_VAR=14
val SCE_CSOUND_STRINGEOL=15 val SCE_CSOUND_STRINGEOL=15
# Lexical states for SCLEX_INNOSETUP
lex Inno=SCLEX_INNOSETUP SCE_INNO_
val SCE_INNO_DEFAULT=0
val SCE_INNO_COMMENT=1
val SCE_INNO_KEYWORD=2
val SCE_INNO_PARAMETER=3
val SCE_INNO_SECTION=4
val SCE_INNO_PREPROC=5
val SCE_INNO_PREPROC_INLINE=6
val SCE_INNO_COMMENT_PASCAL=7
val SCE_INNO_KEYWORD_PASCAL=8
val SCE_INNO_KEYWORD_USER=9
val SCE_INNO_STRING_DOUBLE=10
val SCE_INNO_STRING_SINGLE=11
val SCE_INNO_IDENTIFIER=12
# Lexical states for SCLEX_OPAL
lex Opal=SCLEX_OPAL SCE_OPAL_
val SCE_OPAL_SPACE=0
val SCE_OPAL_COMMENT_BLOCK=1
val SCE_OPAL_COMMENT_LINE=2
val SCE_OPAL_INTEGER=3
val SCE_OPAL_KEYWORD=4
val SCE_OPAL_SORT=5
val SCE_OPAL_STRING=6
val SCE_OPAL_PAR=7
val SCE_OPAL_BOOL_CONST=8
val SCE_OPAL_DEFAULT=32
# Lexical states for SCLEX_SPICE
lex Spice=SCLEX_SPICE SCE_SPICE_
val SCE_SPICE_DEFAULT=0
val SCE_SPICE_IDENTIFIER=1
val SCE_SPICE_KEYWORD=2
val SCE_SPICE_KEYWORD2=3
val SCE_SPICE_KEYWORD3=4
val SCE_SPICE_NUMBER=5
val SCE_SPICE_DELIMITER=6
val SCE_SPICE_VALUE=7
val SCE_SPICE_COMMENTLINE=8
# Events # Events

View File

@@ -34,7 +34,11 @@ struct _ScintillaClass {
void (* notify) (ScintillaObject *ttt); void (* notify) (ScintillaObject *ttt);
}; };
#if GLIB_MAJOR_VERSION < 2
GtkType scintilla_get_type (void); GtkType scintilla_get_type (void);
#else
GType scintilla_get_type (void);
#endif
GtkWidget* scintilla_new (void); GtkWidget* scintilla_new (void);
void scintilla_set_id (ScintillaObject *sci, uptr_t id); void scintilla_set_id (ScintillaObject *sci, uptr_t id);
sptr_t scintilla_send_message (ScintillaObject *sci,unsigned int iMessage, uptr_t wParam, sptr_t lParam); sptr_t scintilla_send_message (ScintillaObject *sci,unsigned int iMessage, uptr_t wParam, sptr_t lParam);

View File

@@ -13,6 +13,9 @@
#include "Scintilla.h" #include "Scintilla.h"
#include "CallTip.h" #include "CallTip.h"
static const int insetX = 5; // text inset in x from calltip border
static const int widthArrow = 14;
CallTip::CallTip() { CallTip::CallTip() {
wCallTip = 0; wCallTip = 0;
inCallTipMode = false; inCallTipMode = false;
@@ -23,6 +26,8 @@ CallTip::CallTip() {
lineHeight = 1; lineHeight = 1;
startHighlight = 0; startHighlight = 0;
endHighlight = 0; endHighlight = 0;
tabSize = 0;
useStyleCallTip = false; // for backwards compatibility
colourBG.desired = ColourDesired(0xff, 0xff, 0xff); colourBG.desired = ColourDesired(0xff, 0xff, 0xff);
colourUnSel.desired = ColourDesired(0x80, 0x80, 0x80); colourUnSel.desired = ColourDesired(0x80, 0x80, 0x80);
@@ -38,8 +43,6 @@ CallTip::~CallTip() {
val = 0; val = 0;
} }
const int widthArrow = 14;
void CallTip::RefreshColourPalette(Palette &pal, bool want) { void CallTip::RefreshColourPalette(Palette &pal, bool want) {
pal.WantFind(colourBG, want); pal.WantFind(colourBG, want);
pal.WantFind(colourUnSel, want); pal.WantFind(colourUnSel, want);
@@ -48,19 +51,42 @@ void CallTip::RefreshColourPalette(Palette &pal, bool want) {
pal.WantFind(colourLight, want); pal.WantFind(colourLight, want);
} }
// Although this test includes 0, we should never see a \0 character.
static bool IsArrowCharacter(char ch) { static bool IsArrowCharacter(char ch) {
return (ch == 0) || (ch == '\001') || (ch == '\002'); return (ch == 0) || (ch == '\001') || (ch == '\002');
} }
// We ignore tabs unless a tab width has been set.
bool CallTip::IsTabCharacter(char ch) {
return (tabSize > 0) && (ch == '\t');
}
int CallTip::NextTabPos(int x) {
if (tabSize > 0) { // paranoia... not called unless this is true
x -= insetX; // position relative to text
x = (x + tabSize) / tabSize; // tab "number"
return tabSize*x + insetX; // position of next tab
} else {
return x + 1; // arbitrary
}
}
// Draw a section of the call tip that does not include \n in one colour.
// The text may include up to numEnds tabs or arrow characters.
void CallTip::DrawChunk(Surface *surface, int &x, const char *s, void CallTip::DrawChunk(Surface *surface, int &x, const char *s,
int posStart, int posEnd, int ytext, PRectangle rcClient, int posStart, int posEnd, int ytext, PRectangle rcClient,
bool highlight, bool draw) { bool highlight, bool draw) {
s += posStart; s += posStart;
int len = posEnd - posStart; int len = posEnd - posStart;
// Divide the text into sections that are all text, or that are
// single arrows or single tab characters (if tabSize > 0).
int maxEnd = 0; int maxEnd = 0;
int ends[10]; const int numEnds = 10;
int ends[numEnds + 2];
for (int i=0;i<len;i++) { for (int i=0;i<len;i++) {
if (IsArrowCharacter(s[i])) { if ((maxEnd < numEnds) &&
(IsArrowCharacter(s[i]) || IsTabCharacter(s[i])) ) {
if (i > 0) if (i > 0)
ends[maxEnd++] = i; ends[maxEnd++] = i;
ends[maxEnd++] = i+1; ends[maxEnd++] = i+1;
@@ -73,20 +99,19 @@ void CallTip::DrawChunk(Surface *surface, int &x, const char *s,
int endSeg = ends[seg]; int endSeg = ends[seg];
if (endSeg > startSeg) { if (endSeg > startSeg) {
if (IsArrowCharacter(s[startSeg])) { if (IsArrowCharacter(s[startSeg])) {
xEnd = x + widthArrow; bool upArrow = s[startSeg] == '\001';
offsetMain = xEnd;
rcClient.left = x; rcClient.left = x;
rcClient.right = xEnd; rcClient.right = rcClient.left + widthArrow;
if (draw) { if (draw) {
const int halfWidth = widthArrow / 2 - 3; const int halfWidth = widthArrow / 2 - 3;
const int centreX = x + widthArrow / 2 - 1; const int centreX = rcClient.left + widthArrow / 2 - 1;
const int centreY = (rcClient.top + rcClient.bottom) / 2; const int centreY = (rcClient.top + rcClient.bottom) / 2;
surface->FillRectangle(rcClient, colourBG.allocated); surface->FillRectangle(rcClient, colourBG.allocated);
PRectangle rcClientInner(rcClient.left+1, rcClient.top+1, rcClient.right-2, rcClient.bottom-1); PRectangle rcClientInner(rcClient.left + 1, rcClient.top + 1,
rcClient.right - 2, rcClient.bottom - 1);
surface->FillRectangle(rcClientInner, colourUnSel.allocated); surface->FillRectangle(rcClientInner, colourUnSel.allocated);
if (s[startSeg] == '\001') { if (upArrow) { // Up arrow
// Up arrow
Point pts[] = { Point pts[] = {
Point(centreX - halfWidth, centreY + halfWidth / 2), Point(centreX - halfWidth, centreY + halfWidth / 2),
Point(centreX + halfWidth, centreY + halfWidth / 2), Point(centreX + halfWidth, centreY + halfWidth / 2),
@@ -94,8 +119,7 @@ void CallTip::DrawChunk(Surface *surface, int &x, const char *s,
}; };
surface->Polygon(pts, sizeof(pts) / sizeof(pts[0]), surface->Polygon(pts, sizeof(pts) / sizeof(pts[0]),
colourBG.allocated, colourBG.allocated); colourBG.allocated, colourBG.allocated);
} else { } else { // Down arrow
// Down arrow
Point pts[] = { Point pts[] = {
Point(centreX - halfWidth, centreY - halfWidth / 2), Point(centreX - halfWidth, centreY - halfWidth / 2),
Point(centreX + halfWidth, centreY - halfWidth / 2), Point(centreX + halfWidth, centreY - halfWidth / 2),
@@ -105,20 +129,23 @@ void CallTip::DrawChunk(Surface *surface, int &x, const char *s,
colourBG.allocated, colourBG.allocated); colourBG.allocated, colourBG.allocated);
} }
} }
if (s[startSeg] == '\001') { xEnd = rcClient.right;
offsetMain = xEnd;
if (upArrow) {
rectUp = rcClient; rectUp = rcClient;
} else if (s[startSeg] == '\002') { } else {
rectDown = rcClient; rectDown = rcClient;
} }
} else if (IsTabCharacter(s[startSeg])) {
xEnd = NextTabPos(x);
} else { } else {
xEnd = x + surface->WidthText(font, s+startSeg, endSeg - startSeg); xEnd = x + surface->WidthText(font, s + startSeg, endSeg - startSeg);
if (draw) { if (draw) {
rcClient.left = x; rcClient.left = x;
rcClient.right = xEnd; rcClient.right = xEnd;
surface->DrawTextNoClip(rcClient, font, ytext, surface->DrawTextTransparent(rcClient, font, ytext,
s+startSeg, endSeg - startSeg, s+startSeg, endSeg - startSeg,
highlight ? colourSel.allocated : colourUnSel.allocated, highlight ? colourSel.allocated : colourUnSel.allocated);
colourBG.allocated);
} }
} }
x = xEnd; x = xEnd;
@@ -160,7 +187,7 @@ int CallTip::PaintContents(Surface *surfaceWindow, bool draw) {
thisEndHighlight -= chunkOffset; thisEndHighlight -= chunkOffset;
rcClient.top = ytext - ascent - 1; rcClient.top = ytext - ascent - 1;
int x = 5; int x = insetX; // start each line at this inset
DrawChunk(surfaceWindow, x, chunkVal, 0, thisStartHighlight, DrawChunk(surfaceWindow, x, chunkVal, 0, thisStartHighlight,
ytext, rcClient, false, draw); ytext, rcClient, false, draw);
@@ -187,7 +214,7 @@ void CallTip::PaintCT(Surface *surfaceWindow) {
surfaceWindow->FillRectangle(rcClient, colourBG.allocated); surfaceWindow->FillRectangle(rcClient, colourBG.allocated);
offsetMain = 5; offsetMain = insetX; // initial alignment assuming no arrows
PaintContents(surfaceWindow, true); PaintContents(surfaceWindow, true);
// Draw a raised border around the edges of the window // Draw a raised border around the edges of the window
@@ -238,14 +265,17 @@ PRectangle CallTip::CallTipStart(int pos, Point pt, const char *defn,
const char *look = val; const char *look = val;
rectUp = PRectangle(0,0,0,0); rectUp = PRectangle(0,0,0,0);
rectDown = PRectangle(0,0,0,0); rectDown = PRectangle(0,0,0,0);
offsetMain = 5; offsetMain = insetX; // changed to right edge of any arrows
int width = PaintContents(surfaceMeasure, false) + 5; int width = PaintContents(surfaceMeasure, false) + insetX;
while ((newline = strchr(look, '\n')) != NULL) { while ((newline = strchr(look, '\n')) != NULL) {
look = newline + 1; look = newline + 1;
numLines++; numLines++;
} }
lineHeight = surfaceMeasure->Height(font); lineHeight = surfaceMeasure->Height(font);
// Extra line for border and an empty line at top and bottom
// Extra line for border and an empty line at top and bottom. The returned
// rectangle is aligned to the right edge of the last arrow encountered in
// the tip text, else to the tip text left edge.
int height = lineHeight * numLines - surfaceMeasure->InternalLeading(font) + 2 + 2; int height = lineHeight * numLines - surfaceMeasure->InternalLeading(font) + 2 + 2;
delete surfaceMeasure; delete surfaceMeasure;
return PRectangle(pt.x - offsetMain, pt.y + 1, pt.x + width - offsetMain, pt.y + 1 + height); return PRectangle(pt.x - offsetMain, pt.y + 1, pt.x + width - offsetMain, pt.y + 1 + height);
@@ -268,3 +298,17 @@ void CallTip::SetHighlight(int start, int end) {
} }
} }
} }
// Set the tab size (sizes > 0 enable the use of tabs). This also enables the
// use of the STYLE_CALLTIP.
void CallTip::SetTabSize(int tabSz) {
tabSize = tabSz;
useStyleCallTip = true;
}
// It might be better to have two access functions for this and to use
// them for all settings of colours.
void CallTip::SetForeBack(const ColourPair &fore, const ColourPair &back) {
colourBG = back;
colourUnSel = fore;
}

View File

@@ -11,14 +11,17 @@
/** /**
*/ */
class CallTip { class CallTip {
int startHighlight; int startHighlight; // character offset to start and...
int endHighlight; int endHighlight; // ...end of highlighted text
char *val; char *val;
Font font; Font font;
PRectangle rectUp; PRectangle rectUp; // rectangle of last up angle in the tip
PRectangle rectDown; PRectangle rectDown; // rectangle of last down arrow in the tip
int lineHeight; int lineHeight; // vertical line spacing
int offsetMain; int offsetMain; // The alignment point of the call tip
int tabSize; // Tab size in pixels, <=0 no TAB expand
bool useStyleCallTip; // if true, STYLE_CALLTIP should be used
// Private so CallTip objects can not be copied // Private so CallTip objects can not be copied
CallTip(const CallTip &) {} CallTip(const CallTip &) {}
CallTip &operator=(const CallTip &) { return *this; } CallTip &operator=(const CallTip &) { return *this; }
@@ -26,6 +29,8 @@ class CallTip {
int posStart, int posEnd, int ytext, PRectangle rcClient, int posStart, int posEnd, int ytext, PRectangle rcClient,
bool highlight, bool draw); bool highlight, bool draw);
int PaintContents(Surface *surfaceWindow, bool draw); int PaintContents(Surface *surfaceWindow, bool draw);
bool IsTabCharacter(char c);
int NextTabPos(int x);
public: public:
Window wCallTip; Window wCallTip;
@@ -60,6 +65,15 @@ public:
/// Set a range of characters to be displayed in a highlight style. /// Set a range of characters to be displayed in a highlight style.
/// Commonly used to highlight the current parameter. /// Commonly used to highlight the current parameter.
void SetHighlight(int start, int end); void SetHighlight(int start, int end);
/// Set the tab size in pixels for the call tip. 0 or -ve means no tab expand.
void SetTabSize(int tabSz);
/// Used to determine which STYLE_xxxx to use for call tip information
bool UseStyleCallTip() const { return useStyleCallTip;}
// Modify foreground and background colours
void SetForeBack(const ColourPair &fore, const ColourPair &back);
}; };
#endif #endif

View File

@@ -0,0 +1,43 @@
// Scintilla source code edit control
/** @file CharClassify.cxx
** Character classifications used by Document and RESearch.
**/
// Copyright 2006 by Neil Hodgson <neilh@scintilla.org>
// The License.txt file describes the conditions under which this software may be distributed.
#include <ctype.h>
#include "CharClassify.h"
// Shut up annoying Visual C++ warnings:
#ifdef _MSC_VER
#pragma warning(disable: 4514)
#endif
CharClassify::CharClassify() {
SetDefaultCharClasses(true);
}
void CharClassify::SetDefaultCharClasses(bool includeWordClass) {
// Initialize all char classes to default values
for (int ch = 0; ch < 256; ch++) {
if (ch == '\r' || ch == '\n')
charClass[ch] = ccNewLine;
else if (ch < 0x20 || ch == ' ')
charClass[ch] = ccSpace;
else if (includeWordClass && (ch >= 0x80 || isalnum(ch) || ch == '_'))
charClass[ch] = ccWord;
else
charClass[ch] = ccPunctuation;
}
}
void CharClassify::SetCharClasses(const unsigned char *chars, cc newCharClass) {
// Apply the newCharClass to the specifed chars
if (chars) {
while (*chars) {
charClass[*chars] = static_cast<unsigned char>(newCharClass);
chars++;
}
}
}

View File

@@ -0,0 +1,25 @@
// Scintilla source code edit control
/** @file CharClassify.h
** Character classifications used by Document and RESearch.
**/
// Copyright 2006 by Neil Hodgson <neilh@scintilla.org>
// The License.txt file describes the conditions under which this software may be distributed.
#ifndef CHARCLASSIFY_H
#define CHARCLASSIFY_H
class CharClassify {
public:
CharClassify();
enum cc { ccSpace, ccNewLine, ccWord, ccPunctuation };
void SetDefaultCharClasses(bool includeWordClass);
void SetCharClasses(const unsigned char *chars, cc newCharClass);
cc GetClass(unsigned char ch) const { return static_cast<cc>(charClass[ch]);}
bool IsWord(unsigned char ch) const { return static_cast<cc>(charClass[ch]) == ccWord;}
private:
enum { maxChar=256 };
unsigned char charClass[maxChar]; // not type cc to save space
};
#endif

View File

@@ -280,4 +280,10 @@ void ContractionState::ShowAll() {
delete []lines; delete []lines;
lines = 0; lines = 0;
size = 0; size = 0;
delete []docLines;
docLines = 0;
sizeDocLines = 0;
linesInDisplay = linesInDoc;
} }

View File

@@ -15,6 +15,7 @@
#include "Scintilla.h" #include "Scintilla.h"
#include "SVector.h" #include "SVector.h"
#include "CellBuffer.h" #include "CellBuffer.h"
#include "CharClassify.h"
#include "Document.h" #include "Document.h"
#include "RESearch.h" #include "RESearch.h"
@@ -50,7 +51,6 @@ Document::Document() {
stylingBits = 5; stylingBits = 5;
stylingBitsMask = 0x1F; stylingBitsMask = 0x1F;
stylingMask = 0; stylingMask = 0;
SetDefaultCharClasses(true);
endStyled = 0; endStyled = 0;
styleClock = 0; styleClock = 0;
enteredCount = 0; enteredCount = 0;
@@ -836,10 +836,10 @@ int Document::ParaDown(int pos) {
return LineEnd(line-1); return LineEnd(line-1);
} }
Document::charClassification Document::WordCharClass(unsigned char ch) { CharClassify::cc Document::WordCharClass(unsigned char ch) {
if ((SC_CP_UTF8 == dbcsCodePage) && (ch >= 0x80)) if ((SC_CP_UTF8 == dbcsCodePage) && (ch >= 0x80))
return ccWord; return CharClassify::ccWord;
return charClass[ch]; return charClass.GetClass(ch);
} }
/** /**
@@ -847,7 +847,7 @@ Document::charClassification Document::WordCharClass(unsigned char ch) {
* Finds the start of word at pos when delta < 0 or the end of the word when delta >= 0. * Finds the start of word at pos when delta < 0 or the end of the word when delta >= 0.
*/ */
int Document::ExtendWordSelect(int pos, int delta, bool onlyWordCharacters) { int Document::ExtendWordSelect(int pos, int delta, bool onlyWordCharacters) {
charClassification ccStart = ccWord; CharClassify::cc ccStart = CharClassify::ccWord;
if (delta < 0) { if (delta < 0) {
if (!onlyWordCharacters) if (!onlyWordCharacters)
ccStart = WordCharClass(cb.CharAt(pos-1)); ccStart = WordCharClass(cb.CharAt(pos-1));
@@ -871,19 +871,19 @@ int Document::ExtendWordSelect(int pos, int delta, bool onlyWordCharacters) {
*/ */
int Document::NextWordStart(int pos, int delta) { int Document::NextWordStart(int pos, int delta) {
if (delta < 0) { if (delta < 0) {
while (pos > 0 && (WordCharClass(cb.CharAt(pos - 1)) == ccSpace)) while (pos > 0 && (WordCharClass(cb.CharAt(pos - 1)) == CharClassify::ccSpace))
pos--; pos--;
if (pos > 0) { if (pos > 0) {
charClassification ccStart = WordCharClass(cb.CharAt(pos-1)); CharClassify::cc ccStart = WordCharClass(cb.CharAt(pos-1));
while (pos > 0 && (WordCharClass(cb.CharAt(pos - 1)) == ccStart)) { while (pos > 0 && (WordCharClass(cb.CharAt(pos - 1)) == ccStart)) {
pos--; pos--;
} }
} }
} else { } else {
charClassification ccStart = WordCharClass(cb.CharAt(pos)); CharClassify::cc ccStart = WordCharClass(cb.CharAt(pos));
while (pos < (Length()) && (WordCharClass(cb.CharAt(pos)) == ccStart)) while (pos < (Length()) && (WordCharClass(cb.CharAt(pos)) == ccStart))
pos++; pos++;
while (pos < (Length()) && (WordCharClass(cb.CharAt(pos)) == ccSpace)) while (pos < (Length()) && (WordCharClass(cb.CharAt(pos)) == CharClassify::ccSpace))
pos++; pos++;
} }
return pos; return pos;
@@ -899,22 +899,22 @@ int Document::NextWordStart(int pos, int delta) {
int Document::NextWordEnd(int pos, int delta) { int Document::NextWordEnd(int pos, int delta) {
if (delta < 0) { if (delta < 0) {
if (pos > 0) { if (pos > 0) {
charClassification ccStart = WordCharClass(cb.CharAt(pos-1)); CharClassify::cc ccStart = WordCharClass(cb.CharAt(pos-1));
if (ccStart != ccSpace) { if (ccStart != CharClassify::ccSpace) {
while (pos > 0 && WordCharClass(cb.CharAt(pos - 1)) == ccStart) { while (pos > 0 && WordCharClass(cb.CharAt(pos - 1)) == ccStart) {
pos--; pos--;
} }
} }
while (pos > 0 && WordCharClass(cb.CharAt(pos - 1)) == ccSpace) { while (pos > 0 && WordCharClass(cb.CharAt(pos - 1)) == CharClassify::ccSpace) {
pos--; pos--;
} }
} }
} else { } else {
while (pos < Length() && WordCharClass(cb.CharAt(pos)) == ccSpace) { while (pos < Length() && WordCharClass(cb.CharAt(pos)) == CharClassify::ccSpace) {
pos++; pos++;
} }
if (pos < Length()) { if (pos < Length()) {
charClassification ccStart = WordCharClass(cb.CharAt(pos)); CharClassify::cc ccStart = WordCharClass(cb.CharAt(pos));
while (pos < Length() && WordCharClass(cb.CharAt(pos)) == ccStart) { while (pos < Length() && WordCharClass(cb.CharAt(pos)) == ccStart) {
pos++; pos++;
} }
@@ -929,8 +929,8 @@ int Document::NextWordEnd(int pos, int delta) {
*/ */
bool Document::IsWordStartAt(int pos) { bool Document::IsWordStartAt(int pos) {
if (pos > 0) { if (pos > 0) {
charClassification ccPos = WordCharClass(CharAt(pos)); CharClassify::cc ccPos = WordCharClass(CharAt(pos));
return (ccPos == ccWord || ccPos == ccPunctuation) && return (ccPos == CharClassify::ccWord || ccPos == CharClassify::ccPunctuation) &&
(ccPos != WordCharClass(CharAt(pos - 1))); (ccPos != WordCharClass(CharAt(pos - 1)));
} }
return true; return true;
@@ -942,8 +942,8 @@ bool Document::IsWordStartAt(int pos) {
*/ */
bool Document::IsWordEndAt(int pos) { bool Document::IsWordEndAt(int pos) {
if (pos < Length()) { if (pos < Length()) {
charClassification ccPrev = WordCharClass(CharAt(pos-1)); CharClassify::cc ccPrev = WordCharClass(CharAt(pos-1));
return (ccPrev == ccWord || ccPrev == ccPunctuation) && return (ccPrev == CharClassify::ccWord || ccPrev == CharClassify::ccPunctuation) &&
(ccPrev != WordCharClass(CharAt(pos))); (ccPrev != WordCharClass(CharAt(pos)));
} }
return true; return true;
@@ -1004,7 +1004,7 @@ long Document::FindText(int minPos, int maxPos, const char *s,
int *length) { int *length) {
if (regExp) { if (regExp) {
if (!pre) if (!pre)
pre = new RESearch(); pre = new RESearch(&charClass);
if (!pre) if (!pre)
return -1; return -1;
@@ -1266,27 +1266,11 @@ void Document::ChangeCase(Range r, bool makeUpperCase) {
} }
void Document::SetDefaultCharClasses(bool includeWordClass) { void Document::SetDefaultCharClasses(bool includeWordClass) {
// Initialize all char classes to default values charClass.SetDefaultCharClasses(includeWordClass);
for (int ch = 0; ch < 256; ch++) {
if (ch == '\r' || ch == '\n')
charClass[ch] = ccNewLine;
else if (ch < 0x20 || ch == ' ')
charClass[ch] = ccSpace;
else if (includeWordClass && (ch >= 0x80 || isalnum(ch) || ch == '_'))
charClass[ch] = ccWord;
else
charClass[ch] = ccPunctuation;
}
} }
void Document::SetCharClasses(const unsigned char *chars, charClassification newCharClass) { void Document::SetCharClasses(const unsigned char *chars, CharClassify::cc newCharClass) {
// Apply the newCharClass to the specifed chars charClass.SetCharClasses(chars, newCharClass);
if (chars) {
while (*chars) {
charClass[*chars] = newCharClass;
chars++;
}
}
} }
void Document::SetStylingBits(int bits) { void Document::SetStylingBits(int bits) {
@@ -1430,7 +1414,7 @@ void Document::NotifyModified(DocModification mh) {
} }
bool Document::IsWordPartSeparator(char ch) { bool Document::IsWordPartSeparator(char ch) {
return (WordCharClass(ch) == ccWord) && IsPunctuation(ch); return (WordCharClass(ch) == CharClassify::ccWord) && IsPunctuation(ch);
} }
int Document::WordPartLeft(int pos) { int Document::WordPartLeft(int pos) {

View File

@@ -93,7 +93,7 @@ public:
private: private:
int refCount; int refCount;
CellBuffer cb; CellBuffer cb;
charClassification charClass[256]; CharClassify charClass;
char stylingMask; char stylingMask;
int endStyled; int endStyled;
int styleClock; int styleClock;
@@ -207,7 +207,7 @@ public:
void ChangeCase(Range r, bool makeUpperCase); void ChangeCase(Range r, bool makeUpperCase);
void SetDefaultCharClasses(bool includeWordClass); void SetDefaultCharClasses(bool includeWordClass);
void SetCharClasses(const unsigned char *chars, charClassification newCharClass); void SetCharClasses(const unsigned char *chars, CharClassify::cc newCharClass);
void SetStylingBits(int bits); void SetStylingBits(int bits);
void StartStyling(int position, char mask); void StartStyling(int position, char mask);
bool SetStyleFor(int length, char style); bool SetStyleFor(int length, char style);
@@ -239,7 +239,7 @@ public:
private: private:
void CheckReadOnly(); void CheckReadOnly();
charClassification WordCharClass(unsigned char ch); CharClassify::cc WordCharClass(unsigned char ch);
bool IsWordStartAt(int pos); bool IsWordStartAt(int pos);
bool IsWordEndAt(int pos); bool IsWordEndAt(int pos);
bool IsWordAt(int start, int end); bool IsWordAt(int start, int end);

View File

@@ -18,6 +18,7 @@
#include "DocumentAccessor.h" #include "DocumentAccessor.h"
#include "CellBuffer.h" #include "CellBuffer.h"
#include "Scintilla.h" #include "Scintilla.h"
#include "CharClassify.h"
#include "Document.h" #include "Document.h"
DocumentAccessor::~DocumentAccessor() { DocumentAccessor::~DocumentAccessor() {

View File

@@ -26,6 +26,7 @@
#include "LineMarker.h" #include "LineMarker.h"
#include "Style.h" #include "Style.h"
#include "ViewStyle.h" #include "ViewStyle.h"
#include "CharClassify.h"
#include "Document.h" #include "Document.h"
#include "Editor.h" #include "Editor.h"
@@ -213,7 +214,7 @@ void LineLayoutCache::Allocate(int length_) {
} }
void LineLayoutCache::AllocateForLevel(int linesOnScreen, int linesInDoc) { void LineLayoutCache::AllocateForLevel(int linesOnScreen, int linesInDoc) {
// PLATFORM_ASSERT(useCount == 0); PLATFORM_ASSERT(useCount == 0);
int lengthForLevel = 0; int lengthForLevel = 0;
if (level == llcCaret) { if (level == llcCaret) {
lengthForLevel = 1; lengthForLevel = 1;
@@ -239,7 +240,7 @@ void LineLayoutCache::AllocateForLevel(int linesOnScreen, int linesInDoc) {
} }
void LineLayoutCache::Deallocate() { void LineLayoutCache::Deallocate() {
// PLATFORM_ASSERT(useCount == 0); PLATFORM_ASSERT(useCount == 0);
for (int i = 0; i < length; i++) for (int i = 0; i < length; i++)
delete cache[i]; delete cache[i];
delete []cache; delete []cache;
@@ -284,7 +285,7 @@ LineLayout *LineLayoutCache::Retrieve(int lineNumber, int lineCaret, int maxChar
} else if (level == llcPage) { } else if (level == llcPage) {
if (lineNumber == lineCaret) { if (lineNumber == lineCaret) {
pos = 0; pos = 0;
} else { } else if (length > 1) {
pos = 1 + (lineNumber % (length - 1)); pos = 1 + (lineNumber % (length - 1));
} }
} else if (level == llcDocument) { } else if (level == llcDocument) {
@@ -327,7 +328,7 @@ void LineLayoutCache::Dispose(LineLayout *ll) {
delete ll; delete ll;
} else { } else {
useCount--; useCount--;
} }
} }
} }
@@ -428,9 +429,8 @@ Editor::Editor() {
wrapState = eWrapNone; wrapState = eWrapNone;
wrapWidth = LineLayout::wrapWidthInfinite; wrapWidth = LineLayout::wrapWidthInfinite;
docLineLastWrapped = -1; wrapStart = wrapLineLarge;
docLastLineToWrap = -1; wrapEnd = wrapLineLarge;
backgroundWrapEnabled = true;
wrapVisualFlags = 0; wrapVisualFlags = 0;
wrapVisualFlagsLocation = 0; wrapVisualFlagsLocation = 0;
wrapVisualStartIndent = 0; wrapVisualStartIndent = 0;
@@ -810,6 +810,9 @@ int Editor::PositionFromLocationClose(Point pt) {
return pdoc->MovePositionOutsideChar(i + posLineStart, 1); return pdoc->MovePositionOutsideChar(i + posLineStart, 1);
} }
} }
if (pt.x < (ll->positions[lineEnd] - subLineStart)) {
return pdoc->MovePositionOutsideChar(lineEnd + posLineStart, 1);
}
} }
} }
@@ -1483,29 +1486,18 @@ void Editor::InvalidateCaret() {
void Editor::UpdateSystemCaret() { void Editor::UpdateSystemCaret() {
} }
void Editor::NeedWrapping(int docLineStartWrapping, int docLineEndWrapping) { void Editor::NeedWrapping(int docLineStart, int docLineEnd) {
docLineStartWrapping = Platform::Minimum(docLineStartWrapping, pdoc->LinesTotal()-1); docLineStart = Platform::Clamp(docLineStart, 0, pdoc->LinesTotal());
docLineEndWrapping = Platform::Minimum(docLineEndWrapping, pdoc->LinesTotal()-1); if (wrapStart > docLineStart) {
bool noWrap = (docLastLineToWrap == docLineLastWrapped); wrapStart = docLineStart;
if (docLineLastWrapped > (docLineStartWrapping - 1)) {
docLineLastWrapped = docLineStartWrapping - 1;
if (docLineLastWrapped < -1)
docLineLastWrapped = -1;
llc.Invalidate(LineLayout::llPositions); llc.Invalidate(LineLayout::llPositions);
} }
if (noWrap) { if (wrapEnd < docLineEnd) {
docLastLineToWrap = docLineEndWrapping; wrapEnd = docLineEnd;
} else if (docLastLineToWrap < docLineEndWrapping) {
docLastLineToWrap = docLineEndWrapping + 1;
} }
if (docLastLineToWrap < -1) wrapEnd = Platform::Clamp(wrapEnd, 0, pdoc->LinesTotal());
docLastLineToWrap = -1;
if (docLastLineToWrap >= pdoc->LinesTotal())
docLastLineToWrap = pdoc->LinesTotal()-1;
// Wrap lines during idle. // Wrap lines during idle.
if ((wrapState != eWrapNone) && if ((wrapState != eWrapNone) && (wrapEnd != wrapStart)) {
backgroundWrapEnabled &&
(docLastLineToWrap != docLineLastWrapped)) {
SetIdle(true); SetIdle(true);
} }
} }
@@ -1514,33 +1506,33 @@ void Editor::NeedWrapping(int docLineStartWrapping, int docLineEndWrapping) {
// fullwrap: if true, all lines which need wrapping will be done, // fullwrap: if true, all lines which need wrapping will be done,
// in this single call. // in this single call.
// priorityWrapLineStart: If greater than zero, all lines starting from // priorityWrapLineStart: If greater than zero, all lines starting from
// here to 100 lines past will be wrapped (even if there are // here to 1 page + 100 lines past will be wrapped (even if there are
// more lines under wrapping process in idle). // more lines under wrapping process in idle).
// If it is neither fullwrap, nor priorityWrap, then 100 lines will be // If it is neither fullwrap, nor priorityWrap, then 1 page + 100 lines will be
// wrapped, if there are any wrapping going on in idle. (Generally this // wrapped, if there are any wrapping going on in idle. (Generally this
// condition is called only from idler). // condition is called only from idler).
// Return true if wrapping occurred. // Return true if wrapping occurred.
bool Editor::WrapLines(bool fullWrap, int priorityWrapLineStart) { bool Editor::WrapLines(bool fullWrap, int priorityWrapLineStart) {
// If there are any pending wraps, do them during idle if possible. // If there are any pending wraps, do them during idle if possible.
int linesInOneCall = LinesOnScreen() + 100;
if (wrapState != eWrapNone) { if (wrapState != eWrapNone) {
if (docLineLastWrapped < docLastLineToWrap) { if (wrapStart < wrapEnd) {
if (!(backgroundWrapEnabled && SetIdle(true))) { if (!SetIdle(true)) {
// Background wrapping is disabled, or idle processing // Idle processing not supported so full wrap required.
// not supported. A full wrap is required.
fullWrap = true; fullWrap = true;
} }
} }
if (!fullWrap && priorityWrapLineStart >= 0 && if (!fullWrap && priorityWrapLineStart >= 0 &&
// .. and if the paint window is outside pending wraps // .. and if the paint window is outside pending wraps
(((priorityWrapLineStart + 100) < docLineLastWrapped) || (((priorityWrapLineStart + linesInOneCall) < wrapStart) ||
(priorityWrapLineStart > docLastLineToWrap))) { (priorityWrapLineStart > wrapEnd))) {
// No priority wrap pending // No priority wrap pending
return false; return false;
} }
} }
int goodTopLine = topLine; int goodTopLine = topLine;
bool wrapOccurred = false; bool wrapOccurred = false;
if (docLineLastWrapped < pdoc->LinesTotal()) { if (wrapStart <= pdoc->LinesTotal()) {
if (wrapState == eWrapNone) { if (wrapState == eWrapNone) {
if (wrapWidth != LineLayout::wrapWidthInfinite) { if (wrapWidth != LineLayout::wrapWidthInfinite) {
wrapWidth = LineLayout::wrapWidthInfinite; wrapWidth = LineLayout::wrapWidthInfinite;
@@ -1549,8 +1541,11 @@ bool Editor::WrapLines(bool fullWrap, int priorityWrapLineStart) {
} }
wrapOccurred = true; wrapOccurred = true;
} }
docLineLastWrapped = 0x7ffffff; wrapStart = wrapLineLarge;
wrapEnd = wrapLineLarge;
} else { } else {
if (wrapEnd >= pdoc->LinesTotal())
wrapEnd = pdoc->LinesTotal();
//ElapsedTime et; //ElapsedTime et;
int lineDocTop = cs.DocFromDisplay(topLine); int lineDocTop = cs.DocFromDisplay(topLine);
int subLineTop = topLine - cs.DisplayFromDoc(lineDocTop); int subLineTop = topLine - cs.DisplayFromDoc(lineDocTop);
@@ -1564,44 +1559,42 @@ bool Editor::WrapLines(bool fullWrap, int priorityWrapLineStart) {
AutoSurface surface(this); AutoSurface surface(this);
if (surface) { if (surface) {
bool priorityWrap = false; bool priorityWrap = false;
int lastLineToWrap = docLastLineToWrap; int lastLineToWrap = wrapEnd;
int firstLineToWrap = docLineLastWrapped; int lineToWrap = wrapStart;
if (!fullWrap) { if (!fullWrap) {
if (priorityWrapLineStart >= 0) { if (priorityWrapLineStart >= 0) {
// This is a priority wrap. // This is a priority wrap.
firstLineToWrap = priorityWrapLineStart; lineToWrap = priorityWrapLineStart;
lastLineToWrap = firstLineToWrap + 100; lastLineToWrap = priorityWrapLineStart + linesInOneCall;
priorityWrap = true; priorityWrap = true;
} else { } else {
// This is idle wrap. // This is idle wrap.
lastLineToWrap = docLineLastWrapped + 100; lastLineToWrap = wrapStart + linesInOneCall;
} }
if (lastLineToWrap >= docLastLineToWrap) if (lastLineToWrap >= wrapEnd)
lastLineToWrap = docLastLineToWrap; lastLineToWrap = wrapEnd;
} // else do a fullWrap. } // else do a fullWrap.
// printf("Wraplines: full = %d, priorityStart = %d (wrapping: %d to %d)\n", fullWrap, priorityWrapLineStart, firstLineToWrap, lastLineToWrap); // Platform::DebugPrintf("Wraplines: full = %d, priorityStart = %d (wrapping: %d to %d)\n", fullWrap, priorityWrapLineStart, lineToWrap, lastLineToWrap);
// printf("Pending wraps: %d to %d\n", docLineLastWrapped, docLastLineToWrap); // Platform::DebugPrintf("Pending wraps: %d to %d\n", wrapStart, wrapEnd);
while (firstLineToWrap < lastLineToWrap) { while (lineToWrap < lastLineToWrap) {
firstLineToWrap++; AutoLineLayout ll(llc, RetrieveLineLayout(lineToWrap));
if (!priorityWrap)
docLineLastWrapped++;
if (firstLineToWrap < pdoc->LinesTotal()) {
AutoLineLayout ll(llc, RetrieveLineLayout(firstLineToWrap));
int linesWrapped = 1; int linesWrapped = 1;
if (ll) { if (ll) {
LayoutLine(firstLineToWrap, surface, vs, ll, wrapWidth); LayoutLine(lineToWrap, surface, vs, ll, wrapWidth);
linesWrapped = ll->lines; linesWrapped = ll->lines;
} }
if (cs.SetHeight(firstLineToWrap, linesWrapped)) { if (cs.SetHeight(lineToWrap, linesWrapped)) {
wrapOccurred = true; wrapOccurred = true;
}
} }
lineToWrap++;
} }
if (!priorityWrap)
wrapStart = lineToWrap;
// If wrapping is done, bring it to resting position // If wrapping is done, bring it to resting position
if (docLineLastWrapped > docLastLineToWrap) { if (wrapStart >= wrapEnd) {
docLineLastWrapped = -1; wrapStart = wrapLineLarge;
docLastLineToWrap = -1; wrapEnd = wrapLineLarge;
} }
} }
goodTopLine = cs.DisplayFromDoc(lineDocTop); goodTopLine = cs.DisplayFromDoc(lineDocTop);
@@ -1673,6 +1666,7 @@ void Editor::LinesSplit(int pixelWidth) {
targetEnd += static_cast<int>(strlen(eol)); targetEnd += static_cast<int>(strlen(eol));
} }
} }
lineEnd = pdoc->LineFromPosition(targetEnd);
} }
pdoc->EndUndoAction(); pdoc->EndUndoAction();
} }
@@ -1716,7 +1710,7 @@ void Editor::PaintSelMargin(Surface *surfWindow, PRectangle &rc) {
rcSelMargin.left = rcSelMargin.right; rcSelMargin.left = rcSelMargin.right;
rcSelMargin.right = rcSelMargin.left + vs.ms[margin].width; rcSelMargin.right = rcSelMargin.left + vs.ms[margin].width;
if (vs.ms[margin].symbol) { if (vs.ms[margin].style != SC_MARGIN_NUMBER) {
/* alternate scheme: /* alternate scheme:
if (vs.ms[margin].mask & SC_MASK_FOLDERS) if (vs.ms[margin].mask & SC_MASK_FOLDERS)
surface->FillRectangle(rcSelMargin, vs.styles[STYLE_DEFAULT].back.allocated); surface->FillRectangle(rcSelMargin, vs.styles[STYLE_DEFAULT].back.allocated);
@@ -1727,8 +1721,21 @@ void Editor::PaintSelMargin(Surface *surfWindow, PRectangle &rc) {
if (vs.ms[margin].mask & SC_MASK_FOLDERS) if (vs.ms[margin].mask & SC_MASK_FOLDERS)
// Required because of special way brush is created for selection margin // Required because of special way brush is created for selection margin
surface->FillRectangle(rcSelMargin, *pixmapSelPattern); surface->FillRectangle(rcSelMargin, *pixmapSelPattern);
else else {
surface->FillRectangle(rcSelMargin, vs.styles[STYLE_LINENUMBER].back.allocated); ColourAllocated colour;
switch (vs.ms[margin].style) {
case SC_MARGIN_BACK:
colour = vs.styles[STYLE_DEFAULT].back.allocated;
break;
case SC_MARGIN_FORE:
colour = vs.styles[STYLE_DEFAULT].fore.allocated;
break;
default:
colour = vs.styles[STYLE_LINENUMBER].back.allocated;
break;
}
surface->FillRectangle(rcSelMargin, colour);
}
} else { } else {
surface->FillRectangle(rcSelMargin, vs.styles[STYLE_LINENUMBER].back.allocated); surface->FillRectangle(rcSelMargin, vs.styles[STYLE_LINENUMBER].back.allocated);
} }
@@ -1835,7 +1842,7 @@ void Editor::PaintSelMargin(Surface *surfWindow, PRectangle &rc) {
PRectangle rcMarker = rcSelMargin; PRectangle rcMarker = rcSelMargin;
rcMarker.top = yposScreen; rcMarker.top = yposScreen;
rcMarker.bottom = yposScreen + vs.lineHeight; rcMarker.bottom = yposScreen + vs.lineHeight;
if (!vs.ms[margin].symbol) { if (vs.ms[margin].style == SC_MARGIN_NUMBER) {
char number[100]; char number[100];
number[0] = '\0'; number[0] = '\0';
if (firstSubLine) if (firstSubLine)
@@ -2126,7 +2133,7 @@ void Editor::LayoutLine(int line, Surface *surface, ViewStyle &vstyle, LineLayou
continue; continue;
} }
if (p > 0) { if (p > 0) {
if (wrapState == eWrapChar){ if (wrapState == eWrapChar) {
lastGoodBreak = pdoc->MovePositionOutsideChar(p + posLineStart, -1) lastGoodBreak = pdoc->MovePositionOutsideChar(p + posLineStart, -1)
- posLineStart; - posLineStart;
p = pdoc->MovePositionOutsideChar(p + 1 + posLineStart, 1) - posLineStart; p = pdoc->MovePositionOutsideChar(p + 1 + posLineStart, 1) - posLineStart;
@@ -2145,14 +2152,15 @@ void Editor::LayoutLine(int line, Surface *surface, ViewStyle &vstyle, LineLayou
} }
} }
ColourAllocated Editor::SelectionBackground(ViewStyle &vsDraw) {
return primarySelection ? vsDraw.selbackground.allocated : vsDraw.selbackground2.allocated;
}
ColourAllocated Editor::TextBackground(ViewStyle &vsDraw, bool overrideBackground, ColourAllocated Editor::TextBackground(ViewStyle &vsDraw, bool overrideBackground,
ColourAllocated background, bool inSelection, bool inHotspot, int styleMain, int i, LineLayout *ll) { ColourAllocated background, bool inSelection, bool inHotspot, int styleMain, int i, LineLayout *ll) {
if (inSelection) { if (inSelection) {
if (vsDraw.selbackset) { if (vsDraw.selbackset && (vsDraw.selAlpha == SC_ALPHA_NOALPHA)) {
if (primarySelection) return SelectionBackground(vsDraw);
return vsDraw.selbackground.allocated;
else
return vsDraw.selbackground2.allocated;
} }
} else { } else {
if ((vsDraw.edgeState == EDGE_BACKGROUND) && if ((vsDraw.edgeState == EDGE_BACKGROUND) &&
@@ -2204,7 +2212,7 @@ void Editor::DrawWrapMarker(Surface *surface, PRectangle rcPlace,
surface->LineTo(xBase + xDir * xRelative, yBase + yDir * yRelative); surface->LineTo(xBase + xDir * xRelative, yBase + yDir * yRelative);
} }
}; };
Relative rel = {surface, x0, xStraight?1:-1, y0, yStraight?1:-1}; Relative rel = {surface, x0, xStraight ? 1 : -1, y0, yStraight ? 1 : -1};
// arrow head // arrow head
rel.MoveTo(xa, y); rel.MoveTo(xa, y);
@@ -2220,6 +2228,12 @@ void Editor::DrawWrapMarker(Surface *surface, PRectangle rcPlace,
y - 2 * dy); y - 2 * dy);
} }
static void SimpleAlphaRectangle(Surface *surface, PRectangle rc, ColourAllocated fill, int alpha) {
if (alpha != SC_ALPHA_NOALPHA) {
surface->AlphaRectangle(rc, 0, fill, alpha, fill, alpha, 0);
}
}
void Editor::DrawEOL(Surface *surface, ViewStyle &vsDraw, PRectangle rcLine, LineLayout *ll, void Editor::DrawEOL(Surface *surface, ViewStyle &vsDraw, PRectangle rcLine, LineLayout *ll,
int line, int lineEnd, int xStart, int subLine, int subLineStart, int line, int lineEnd, int xStart, int subLine, int subLineStart,
bool overrideBackground, ColourAllocated background, bool overrideBackground, ColourAllocated background,
@@ -2236,15 +2250,17 @@ void Editor::DrawEOL(Surface *surface, ViewStyle &vsDraw, PRectangle rcLine, Lin
bool eolInSelection = (subLine == (ll->lines - 1)) && bool eolInSelection = (subLine == (ll->lines - 1)) &&
(posLineEnd > ll->selStart) && (posLineEnd <= ll->selEnd) && (ll->selStart != ll->selEnd); (posLineEnd > ll->selStart) && (posLineEnd <= ll->selEnd) && (ll->selStart != ll->selEnd);
if (eolInSelection && vsDraw.selbackset && (line < pdoc->LinesTotal() - 1)) { if (eolInSelection && vsDraw.selbackset && (line < pdoc->LinesTotal() - 1) && (vsDraw.selAlpha == SC_ALPHA_NOALPHA)) {
if (primarySelection) surface->FillRectangle(rcSegment, SelectionBackground(vsDraw));
surface->FillRectangle(rcSegment, vsDraw.selbackground.allocated);
else
surface->FillRectangle(rcSegment, vsDraw.selbackground2.allocated);
} else if (overrideBackground) {
surface->FillRectangle(rcSegment, background);
} else { } else {
surface->FillRectangle(rcSegment, vsDraw.styles[ll->styles[ll->numCharsInLine] & styleMask].back.allocated); if (overrideBackground) {
surface->FillRectangle(rcSegment, background);
} else {
surface->FillRectangle(rcSegment, vsDraw.styles[ll->styles[ll->numCharsInLine] & styleMask].back.allocated);
}
if (eolInSelection && vsDraw.selbackset && (line < pdoc->LinesTotal() - 1) && (vsDraw.selAlpha != SC_ALPHA_NOALPHA)) {
SimpleAlphaRectangle(surface, rcSegment, SelectionBackground(vsDraw), vsDraw.selAlpha);
}
} }
rcSegment.left = xEol + vsDraw.aveCharWidth + xStart; rcSegment.left = xEol + vsDraw.aveCharWidth + xStart;
@@ -2290,14 +2306,15 @@ void Editor::DrawLine(Surface *surface, ViewStyle &vsDraw, int line, int lineVis
// the color for the highest numbered one is used. // the color for the highest numbered one is used.
bool overrideBackground = false; bool overrideBackground = false;
ColourAllocated background; ColourAllocated background;
if (caret.active && vsDraw.showCaretLineBackground && ll->containsCaret) { if (caret.active && vsDraw.showCaretLineBackground && (vsDraw.caretLineAlpha == SC_ALPHA_NOALPHA) && ll->containsCaret) {
overrideBackground = true; overrideBackground = true;
background = vsDraw.caretLineBackground.allocated; background = vsDraw.caretLineBackground.allocated;
} }
if (!overrideBackground) { if (!overrideBackground) {
int marks = pdoc->GetMark(line); int marks = pdoc->GetMark(line);
for (int markBit = 0; (markBit < 32) && marks; markBit++) { for (int markBit = 0; (markBit < 32) && marks; markBit++) {
if ((marks & 1) && vsDraw.markers[markBit].markType == SC_MARK_BACKGROUND) { if ((marks & 1) && (vsDraw.markers[markBit].markType == SC_MARK_BACKGROUND) &&
(vsDraw.markers[markBit].alpha == SC_ALPHA_NOALPHA)) {
background = vsDraw.markers[markBit].back.allocated; background = vsDraw.markers[markBit].back.allocated;
overrideBackground = true; overrideBackground = true;
} }
@@ -2306,14 +2323,15 @@ void Editor::DrawLine(Surface *surface, ViewStyle &vsDraw, int line, int lineVis
} }
if (!overrideBackground) { if (!overrideBackground) {
if (vsDraw.maskInLine) { if (vsDraw.maskInLine) {
int marks = pdoc->GetMark(line) & vsDraw.maskInLine; int marksMasked = pdoc->GetMark(line) & vsDraw.maskInLine;
if (marks) { if (marksMasked) {
for (int markBit = 0; (markBit < 32) && marks; markBit++) { for (int markBit = 0; (markBit < 32) && marksMasked; markBit++) {
if ((marks & 1) && (vsDraw.markers[markBit].markType != SC_MARK_EMPTY)) { if ((marksMasked & 1) && (vsDraw.markers[markBit].markType != SC_MARK_EMPTY) &&
(vsDraw.markers[markBit].alpha == SC_ALPHA_NOALPHA)) {
overrideBackground = true; overrideBackground = true;
background = vsDraw.markers[markBit].back.allocated; background = vsDraw.markers[markBit].back.allocated;
} }
marks >>= 1; marksMasked >>= 1;
} }
} }
} }
@@ -2641,6 +2659,15 @@ void Editor::DrawLine(Surface *surface, ViewStyle &vsDraw, int line, int lineVis
xStart, subLine, subLineStart, overrideBackground, background, xStart, subLine, subLineStart, overrideBackground, background,
drawWrapMarkEnd, vsDraw.whitespaceForeground.allocated); drawWrapMarkEnd, vsDraw.whitespaceForeground.allocated);
} }
if ((vsDraw.selAlpha != SC_ALPHA_NOALPHA) && (ll->selStart >= 0) && (ll->selEnd >= 0)) {
int startPosSel = (ll->selStart < posLineStart) ? posLineStart : ll->selStart;
int endPosSel = (ll->selEnd < (lineEnd + posLineStart)) ? ll->selEnd : (lineEnd + posLineStart);
if (startPosSel < endPosSel) {
rcSegment.left = xStart + ll->positions[startPosSel - posLineStart] - subLineStart;
rcSegment.right = xStart + ll->positions[endPosSel - posLineStart] - subLineStart;
SimpleAlphaRectangle(surface, rcSegment, SelectionBackground(vsDraw), vsDraw.selAlpha);
}
}
if (vsDraw.edgeState == EDGE_LINE) { if (vsDraw.edgeState == EDGE_LINE) {
int edgeX = theEdge * vsDraw.spaceWidth; int edgeX = theEdge * vsDraw.spaceWidth;
@@ -2648,6 +2675,31 @@ void Editor::DrawLine(Surface *surface, ViewStyle &vsDraw, int line, int lineVis
rcSegment.right = rcSegment.left + 1; rcSegment.right = rcSegment.left + 1;
surface->FillRectangle(rcSegment, vsDraw.edgecolour.allocated); surface->FillRectangle(rcSegment, vsDraw.edgecolour.allocated);
} }
// Draw any translucent whole line states
rcSegment.left = xStart;
rcSegment.right = rcLine.right - 1;
if (caret.active && vsDraw.showCaretLineBackground && ll->containsCaret) {
SimpleAlphaRectangle(surface, rcSegment, vsDraw.caretLineBackground.allocated, vsDraw.caretLineAlpha);
}
int marks = pdoc->GetMark(line);
for (int markBit = 0; (markBit < 32) && marks; markBit++) {
if ((marks & 1) && (vsDraw.markers[markBit].markType == SC_MARK_BACKGROUND)) {
SimpleAlphaRectangle(surface, rcSegment, vsDraw.markers[markBit].back.allocated, vsDraw.markers[markBit].alpha);
}
marks >>= 1;
}
if (vsDraw.maskInLine) {
int marksMasked = pdoc->GetMark(line) & vsDraw.maskInLine;
if (marksMasked) {
for (int markBit = 0; (markBit < 32) && marksMasked; markBit++) {
if ((marksMasked & 1) && (vsDraw.markers[markBit].markType != SC_MARK_EMPTY)) {
SimpleAlphaRectangle(surface, rcSegment, vsDraw.markers[markBit].back.allocated, vsDraw.markers[markBit].alpha);
}
marksMasked >>= 1;
}
}
}
} }
void Editor::RefreshPixMaps(Surface *surfaceWindow) { void Editor::RefreshPixMaps(Surface *surfaceWindow) {
@@ -2721,7 +2773,6 @@ void Editor::Paint(Surface *surfaceWindow, PRectangle rcArea) {
// paintingAllText, rcArea.left, rcArea.top, rcArea.right, rcArea.bottom); // paintingAllText, rcArea.left, rcArea.top, rcArea.right, rcArea.bottom);
RefreshStyleData(); RefreshStyleData();
RefreshPixMaps(surfaceWindow); RefreshPixMaps(surfaceWindow);
PRectangle rcClient = GetClientRectangle(); PRectangle rcClient = GetClientRectangle();
@@ -2752,6 +2803,8 @@ void Editor::Paint(Surface *surfaceWindow, PRectangle rcArea) {
if (needUpdateUI) { if (needUpdateUI) {
NotifyUpdateUI(); NotifyUpdateUI();
needUpdateUI = false; needUpdateUI = false;
RefreshStyleData();
RefreshPixMaps(surfaceWindow);
} }
// Call priority lines wrap on a window of lines which are likely // Call priority lines wrap on a window of lines which are likely
@@ -3063,7 +3116,7 @@ long Editor::FormatRange(bool draw, RangeToFormat *pfr) {
// Printing supports only the line number margin. // Printing supports only the line number margin.
int lineNumberIndex = -1; int lineNumberIndex = -1;
for (int margin = 0; margin < ViewStyle::margins; margin++) { for (int margin = 0; margin < ViewStyle::margins; margin++) {
if ((!vsPrint.ms[margin].symbol) && (vsPrint.ms[margin].width > 0)) { if ((vsPrint.ms[margin].style == SC_MARGIN_NUMBER) && (vsPrint.ms[margin].width > 0)) {
lineNumberIndex = margin; lineNumberIndex = margin;
} else { } else {
vsPrint.ms[margin].width = 0; vsPrint.ms[margin].width = 0;
@@ -3076,6 +3129,7 @@ long Editor::FormatRange(bool draw, RangeToFormat *pfr) {
// Don't show the selection when printing // Don't show the selection when printing
vsPrint.selbackset = false; vsPrint.selbackset = false;
vsPrint.selforeset = false; vsPrint.selforeset = false;
vsPrint.selAlpha = SC_ALPHA_NOALPHA;
vsPrint.whitespaceBackgroundSet = false; vsPrint.whitespaceBackgroundSet = false;
vsPrint.whitespaceForegroundSet = false; vsPrint.whitespaceForegroundSet = false;
vsPrint.showCaretLineBackground = false; vsPrint.showCaretLineBackground = false;
@@ -3662,19 +3716,8 @@ void Editor::CheckModificationForWrap(DocModification mh) {
llc.Invalidate(LineLayout::llCheckTextAndStyle); llc.Invalidate(LineLayout::llCheckTextAndStyle);
if (wrapState != eWrapNone) { if (wrapState != eWrapNone) {
int lineDoc = pdoc->LineFromPosition(mh.position); int lineDoc = pdoc->LineFromPosition(mh.position);
if (mh.linesAdded <= 0) { int lines = Platform::Maximum(0, mh.linesAdded);
AutoSurface surface(this); NeedWrapping(lineDoc, lineDoc + lines + 1);
AutoLineLayout ll(llc, RetrieveLineLayout(lineDoc));
if (surface && ll) {
LayoutLine(lineDoc, surface, vs, ll, wrapWidth);
if (cs.GetHeight(lineDoc) != ll->lines) {
NeedWrapping(lineDoc - 1, lineDoc + 1);
Redraw();
}
}
} else {
NeedWrapping(lineDoc, lineDoc + 1 + mh.linesAdded);
}
} }
} }
} }
@@ -3717,6 +3760,7 @@ void Editor::NotifyModified(Document*, DocModification mh, void *) {
InvalidateRange(mh.position, mh.position + mh.length); InvalidateRange(mh.position, mh.position + mh.length);
} }
} }
llc.Invalidate(LineLayout::llCheckTextAndStyle);
} else { } else {
// Move selection and brace highlights // Move selection and brace highlights
if (mh.modificationType & SC_MOD_INSERTTEXT) { if (mh.modificationType & SC_MOD_INSERTTEXT) {
@@ -4833,7 +4877,7 @@ void Editor::CopySelectionRange(SelectionText *ss) {
text[size] = '\0'; text[size] = '\0';
} }
} }
ss->Set(text, size + 1, pdoc->dbcsCodePage, ss->Set(text, size + 1, pdoc->dbcsCodePage,
vs.styles[STYLE_DEFAULT].characterSet, selType == selRectangle); vs.styles[STYLE_DEFAULT].characterSet, selType == selRectangle);
} }
} }
@@ -4849,7 +4893,7 @@ void Editor::CopyRangeToClipboard(int start, int end) {
void Editor::CopyText(int length, const char *text) { void Editor::CopyText(int length, const char *text) {
SelectionText selectedText; SelectionText selectedText;
selectedText.Copy(text, length, selectedText.Copy(text, length + 1,
pdoc->dbcsCodePage, vs.styles[STYLE_DEFAULT].characterSet, false); pdoc->dbcsCodePage, vs.styles[STYLE_DEFAULT].characterSet, false);
CopyToClipboard(selectedText); CopyToClipboard(selectedText);
} }
@@ -5289,7 +5333,7 @@ void Editor::ButtonMove(Point pt) {
} }
void Editor::ButtonUp(Point pt, unsigned int curTime, bool ctrl) { void Editor::ButtonUp(Point pt, unsigned int curTime, bool ctrl) {
//Platform::DebugPrintf("ButtonUp %d\n", HaveMouseCapture()); //Platform::DebugPrintf("ButtonUp %d\n", HaveMouseCapture());
if (HaveMouseCapture()) { if (HaveMouseCapture()) {
if (PointInSelMargin(pt)) { if (PointInSelMargin(pt)) {
DisplayCursor(Window::cursorReverseArrow); DisplayCursor(Window::cursorReverseArrow);
@@ -5377,13 +5421,13 @@ bool Editor::Idle() {
bool idleDone; bool idleDone;
bool wrappingDone = (wrapState == eWrapNone) || (!backgroundWrapEnabled); bool wrappingDone = wrapState == eWrapNone;
if (!wrappingDone) { if (!wrappingDone) {
// Wrap lines during idle. // Wrap lines during idle.
WrapLines(false, -1); WrapLines(false, -1);
// No more wrapping // No more wrapping
if (docLineLastWrapped == docLastLineToWrap) if (wrapStart == wrapEnd)
wrappingDone = true; wrappingDone = true;
} }
@@ -6038,14 +6082,14 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
pdoc->SetDefaultCharClasses(false); pdoc->SetDefaultCharClasses(false);
if (lParam == 0) if (lParam == 0)
return 0; return 0;
pdoc->SetCharClasses(reinterpret_cast<unsigned char *>(lParam), Document::ccWord); pdoc->SetCharClasses(reinterpret_cast<unsigned char *>(lParam), CharClassify::ccWord);
} }
break; break;
case SCI_SETWHITESPACECHARS: { case SCI_SETWHITESPACECHARS: {
if (lParam == 0) if (lParam == 0)
return 0; return 0;
pdoc->SetCharClasses(reinterpret_cast<unsigned char *>(lParam), Document::ccSpace); pdoc->SetCharClasses(reinterpret_cast<unsigned char *>(lParam), CharClassify::ccSpace);
} }
break; break;
@@ -6305,16 +6349,16 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
return pdoc->ExtendWordSelect(wParam, 1, lParam != 0); return pdoc->ExtendWordSelect(wParam, 1, lParam != 0);
case SCI_SETWRAPMODE: case SCI_SETWRAPMODE:
switch(wParam){ switch (wParam) {
case SC_WRAP_WORD: case SC_WRAP_WORD:
wrapState = eWrapWord; wrapState = eWrapWord;
break; break;
case SC_WRAP_CHAR: case SC_WRAP_CHAR:
wrapState = eWrapChar; wrapState = eWrapChar;
break; break;
default: default:
wrapState = eWrapNone; wrapState = eWrapNone;
break; break;
} }
xOffset = 0; xOffset = 0;
InvalidateStyleRedraw(); InvalidateStyleRedraw();
@@ -6465,8 +6509,10 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
return pdoc->LineEnd(wParam); return pdoc->LineEnd(wParam);
case SCI_SETCODEPAGE: case SCI_SETCODEPAGE:
pdoc->dbcsCodePage = wParam; if (ValidCodePage(wParam)) {
InvalidateStyleRedraw(); pdoc->dbcsCodePage = wParam;
InvalidateStyleRedraw();
}
break; break;
case SCI_GETCODEPAGE: case SCI_GETCODEPAGE:
@@ -6499,6 +6545,11 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
InvalidateStyleData(); InvalidateStyleData();
RedrawSelMargin(); RedrawSelMargin();
break; break;
case SCI_MARKERSETALPHA:
if (wParam <= MARKER_MAX)
vs.markers[wParam].alpha = lParam;
InvalidateStyleRedraw();
break;
case SCI_MARKERADD: { case SCI_MARKERADD: {
int markerID = pdoc->AddMark(wParam, lParam); int markerID = pdoc->AddMark(wParam, lParam);
return markerID; return markerID;
@@ -6546,14 +6597,14 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
case SCI_SETMARGINTYPEN: case SCI_SETMARGINTYPEN:
if (ValidMargin(wParam)) { if (ValidMargin(wParam)) {
vs.ms[wParam].symbol = (lParam == SC_MARGIN_SYMBOL); vs.ms[wParam].style = lParam;
InvalidateStyleRedraw(); InvalidateStyleRedraw();
} }
break; break;
case SCI_GETMARGINTYPEN: case SCI_GETMARGINTYPEN:
if (ValidMargin(wParam)) if (ValidMargin(wParam))
return vs.ms[wParam].symbol ? SC_MARGIN_SYMBOL : SC_MARGIN_NUMBER; return vs.ms[wParam].style;
else else
return 0; return 0;
@@ -6717,6 +6768,12 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
vs.caretLineBackground.desired = wParam; vs.caretLineBackground.desired = wParam;
InvalidateStyleRedraw(); InvalidateStyleRedraw();
break; break;
case SCI_GETCARETLINEBACKALPHA:
return vs.caretLineAlpha;
case SCI_SETCARETLINEBACKALPHA:
vs.caretLineAlpha = wParam;
InvalidateStyleRedraw();
break;
// Folding messages // Folding messages
@@ -6831,6 +6888,14 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
InvalidateStyleRedraw(); InvalidateStyleRedraw();
break; break;
case SCI_SETSELALPHA:
vs.selAlpha = wParam;
InvalidateStyleRedraw();
break;
case SCI_GETSELALPHA:
return vs.selAlpha;
case SCI_SETWHITESPACEFORE: case SCI_SETWHITESPACEFORE:
vs.whitespaceForegroundSet = wParam != 0; vs.whitespaceForegroundSet = wParam != 0;
vs.whitespaceForeground.desired = ColourDesired(lParam); vs.whitespaceForeground.desired = ColourDesired(lParam);

View File

@@ -305,10 +305,10 @@ protected: // ScintillaBase subclass needs access to much of Editor
// Wrapping support // Wrapping support
enum { eWrapNone, eWrapWord, eWrapChar } wrapState; enum { eWrapNone, eWrapWord, eWrapChar } wrapState;
bool backgroundWrapEnabled; enum { wrapLineLarge = 0x7ffffff };
int wrapWidth; int wrapWidth;
int docLineLastWrapped; int wrapStart;
int docLastLineToWrap; int wrapEnd;
int wrapVisualFlags; int wrapVisualFlags;
int wrapVisualFlagsLocation; int wrapVisualFlagsLocation;
int wrapVisualStartIndent; int wrapVisualStartIndent;
@@ -377,7 +377,7 @@ protected: // ScintillaBase subclass needs access to much of Editor
void InvalidateCaret(); void InvalidateCaret();
virtual void UpdateSystemCaret(); virtual void UpdateSystemCaret();
void NeedWrapping(int docLineStartWrapping = 0, int docLineEndWrapping = 0x7ffffff); void NeedWrapping(int docLineStart = 0, int docLineEnd = wrapLineLarge);
bool WrapLines(bool fullWrap, int priorityWrapLineStart); bool WrapLines(bool fullWrap, int priorityWrapLineStart);
void LinesJoin(); void LinesJoin();
void LinesSplit(int pixelWidth); void LinesSplit(int pixelWidth);
@@ -387,6 +387,7 @@ protected: // ScintillaBase subclass needs access to much of Editor
LineLayout *RetrieveLineLayout(int lineNumber); LineLayout *RetrieveLineLayout(int lineNumber);
void LayoutLine(int line, Surface *surface, ViewStyle &vstyle, LineLayout *ll, void LayoutLine(int line, Surface *surface, ViewStyle &vstyle, LineLayout *ll,
int width=LineLayout::wrapWidthInfinite); int width=LineLayout::wrapWidthInfinite);
ColourAllocated SelectionBackground(ViewStyle &vsDraw);
ColourAllocated TextBackground(ViewStyle &vsDraw, bool overrideBackground, ColourAllocated background, bool inSelection, bool inHotspot, int styleMain, int i, LineLayout *ll); ColourAllocated TextBackground(ViewStyle &vsDraw, bool overrideBackground, ColourAllocated background, bool inSelection, bool inHotspot, int styleMain, int i, LineLayout *ll);
void DrawIndentGuide(Surface *surface, int lineVisible, int lineHeight, int start, PRectangle rcSegment, bool highlight); void DrawIndentGuide(Surface *surface, int lineVisible, int lineHeight, int start, PRectangle rcSegment, bool highlight);
void DrawWrapMarker(Surface *surface, PRectangle rcPlace, bool isEndMarker, ColourAllocated wrapColour); void DrawWrapMarker(Surface *surface, PRectangle rcPlace, bool isEndMarker, ColourAllocated wrapColour);
@@ -524,6 +525,7 @@ protected: // ScintillaBase subclass needs access to much of Editor
void GetHotSpotRange(int& hsStart, int& hsEnd); void GetHotSpotRange(int& hsStart, int& hsEnd);
int CodePage() const; int CodePage() const;
virtual bool ValidCodePage(int /* codePage */) const { return true; }
int WrapCount(int line); int WrapCount(int line);
virtual sptr_t DefWndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) = 0; virtual sptr_t DefWndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) = 0;

View File

@@ -12,6 +12,8 @@
#include "Platform.h" #include "Platform.h"
#include "Scintilla.h"
#include "SciLexer.h" #include "SciLexer.h"
#include "PropSet.h" #include "PropSet.h"
#include "Accessor.h" #include "Accessor.h"
@@ -116,16 +118,16 @@ LexerLibrary::LexerLibrary(const char* ModuleName) {
if (lib->IsValid()) { if (lib->IsValid()) {
m_sModuleName = ModuleName; m_sModuleName = ModuleName;
//Cannot use reinterpret_cast because: ANSI C++ forbids casting between pointers to functions and objects //Cannot use reinterpret_cast because: ANSI C++ forbids casting between pointers to functions and objects
GetLexerCountFn GetLexerCount = (GetLexerCountFn)lib->FindFunction("GetLexerCount"); GetLexerCountFn GetLexerCount = (GetLexerCountFn)(sptr_t)lib->FindFunction("GetLexerCount");
if (GetLexerCount) { if (GetLexerCount) {
ExternalLexerModule *lex; ExternalLexerModule *lex;
LexerMinder *lm; LexerMinder *lm;
// Find functions in the DLL // Find functions in the DLL
GetLexerNameFn GetLexerName = (GetLexerNameFn)lib->FindFunction("GetLexerName"); GetLexerNameFn GetLexerName = (GetLexerNameFn)(sptr_t)lib->FindFunction("GetLexerName");
ExtLexerFunction Lexer = (ExtLexerFunction)lib->FindFunction("Lex"); ExtLexerFunction Lexer = (ExtLexerFunction)(sptr_t)lib->FindFunction("Lex");
ExtFoldFunction Folder = (ExtFoldFunction)lib->FindFunction("Fold"); ExtFoldFunction Folder = (ExtFoldFunction)(sptr_t)lib->FindFunction("Fold");
// Assign a buffer for the lexer name. // Assign a buffer for the lexer name.
char lexname[100]; char lexname[100];

View File

@@ -63,6 +63,12 @@ void Indicator::Draw(Surface *surface, const PRectangle &rc, const PRectangle &r
surface->LineTo(rc.right, rcLine.top+1); surface->LineTo(rc.right, rcLine.top+1);
surface->LineTo(rc.left, rcLine.top+1); surface->LineTo(rc.left, rcLine.top+1);
surface->LineTo(rc.left, ymid+1); surface->LineTo(rc.left, ymid+1);
} else if (style == INDIC_ROUNDBOX) {
PRectangle rcBox = rcLine;
rcBox.top = rcLine.top + 1;
rcBox.left = rc.left;
rcBox.right = rc.right;
surface->AlphaRectangle(rcBox, 1, fore.allocated, 30, fore.allocated, 50, 0);
} else { // Either INDIC_PLAIN or unknown } else { // Either INDIC_PLAIN or unknown
surface->MoveTo(rc.left, ymid); surface->MoveTo(rc.left, ymid);
surface->LineTo(rc.right, ymid); surface->LineTo(rc.right, ymid);

View File

@@ -171,6 +171,7 @@ int Scintilla_LinkLexers() {
LINK_LEXER(lmGui4Cli); LINK_LEXER(lmGui4Cli);
LINK_LEXER(lmHaskell); LINK_LEXER(lmHaskell);
LINK_LEXER(lmHTML); LINK_LEXER(lmHTML);
LINK_LEXER(lmInno);
LINK_LEXER(lmKix); LINK_LEXER(lmKix);
LINK_LEXER(lmLatex); LINK_LEXER(lmLatex);
LINK_LEXER(lmLISP); LINK_LEXER(lmLISP);
@@ -186,6 +187,7 @@ int Scintilla_LinkLexers() {
LINK_LEXER(lmNsis); LINK_LEXER(lmNsis);
LINK_LEXER(lmNull); LINK_LEXER(lmNull);
LINK_LEXER(lmOctave); LINK_LEXER(lmOctave);
LINK_LEXER(lmOpal);
LINK_LEXER(lmPascal); LINK_LEXER(lmPascal);
LINK_LEXER(lmPB); LINK_LEXER(lmPB);
LINK_LEXER(lmPerl); LINK_LEXER(lmPerl);
@@ -201,6 +203,7 @@ int Scintilla_LinkLexers() {
LINK_LEXER(lmScriptol); LINK_LEXER(lmScriptol);
LINK_LEXER(lmSmalltalk); LINK_LEXER(lmSmalltalk);
LINK_LEXER(lmSpecman); LINK_LEXER(lmSpecman);
LINK_LEXER(lmSpice);
LINK_LEXER(lmSQL); LINK_LEXER(lmSQL);
LINK_LEXER(lmTADS3); LINK_LEXER(lmTADS3);
LINK_LEXER(lmTCL); LINK_LEXER(lmTCL);

View File

@@ -39,6 +39,9 @@
// May 23, 2005 - Fixed the SentKey lexing in case of a missing } // May 23, 2005 - Fixed the SentKey lexing in case of a missing }
// Aug 11, 2005 - Fixed possible bug with s_save length > 100. // Aug 11, 2005 - Fixed possible bug with s_save length > 100.
// Aug 23, 2005 - Added Switch/endswitch support to the folding logic. // Aug 23, 2005 - Added Switch/endswitch support to the folding logic.
// Sep 27, 2005 - Fixed the SentKey lexing logic in case of multiple sentkeys.
// Mar 12, 2006 - Fixed issue with <> coloring as String in stead of Operator in rare occasions.
// Apr 8, 2006 - Added support for AutoIt3 Standard UDF library (SCE_AU3_UDF)
// //
// Copyright for Scintilla: 1998-2001 by Neil Hodgson <neilh@scintilla.org> // Copyright for Scintilla: 1998-2001 by Neil Hodgson <neilh@scintilla.org>
// The License.txt file describes the conditions under which this software may be distributed. // The License.txt file describes the conditions under which this software may be distributed.
@@ -92,6 +95,7 @@ static inline bool IsAOperator(char ch) {
static int GetSendKey(const char *szLine, char *szKey) static int GetSendKey(const char *szLine, char *szKey)
{ {
int nFlag = 0; int nFlag = 0;
int nStartFound = 0;
int nKeyPos = 0; int nKeyPos = 0;
int nSpecPos= 0; int nSpecPos= 0;
int nSpecNum= 1; int nSpecNum= 1;
@@ -102,31 +106,34 @@ static int GetSendKey(const char *szLine, char *szKey)
// split the portion of the sendkey in the part before and after the spaces // split the portion of the sendkey in the part before and after the spaces
while ( ( (cTemp = szLine[nPos]) != '\0')) while ( ( (cTemp = szLine[nPos]) != '\0'))
{ {
// skip leading Ctrl/Shift/ALt state // skip leading Ctrl/Shift/Alt state
if ((cTemp == '#' || cTemp == '!' || cTemp == '^') && (szLine[nPos+1] == '{') ) if (cTemp == '{') {
{ nStartFound = 1;
} }
else if ((cTemp == ' ') && (nFlag == 0) ) // get the stuff till first space //
{ if (nStartFound == 1) {
nFlag = 1; if ((cTemp == ' ') && (nFlag == 0) ) // get the stuff till first space
// Add } to the end of the first bit for table lookup later. {
szKey[nKeyPos++] = '}'; nFlag = 1;
} // Add } to the end of the first bit for table lookup later.
else if (cTemp == ' ') szKey[nKeyPos++] = '}';
{ }
// skip other spaces else if (cTemp == ' ')
} {
else if (nFlag == 0) // skip other spaces
{ }
// save first portion into var till space or } is hit else if (nFlag == 0)
szKey[nKeyPos++] = cTemp; {
} // save first portion into var till space or } is hit
else if ((nFlag == 1) && (cTemp != '}')) szKey[nKeyPos++] = cTemp;
{ }
// Save second portion into var... else if ((nFlag == 1) && (cTemp != '}'))
szSpecial[nSpecPos++] = cTemp; {
// check if Second portion is all numbers for repeat fuction // Save second portion into var...
if (isdigit(cTemp) == false) {nSpecNum = 0;} szSpecial[nSpecPos++] = cTemp;
// check if Second portion is all numbers for repeat fuction
if (isdigit(cTemp) == false) {nSpecNum = 0;}
}
} }
nPos++; // skip to next char nPos++; // skip to next char
@@ -190,6 +197,7 @@ static void ColouriseAU3Doc(unsigned int startPos,
WordList &keywords5 = *keywordlists[4]; WordList &keywords5 = *keywordlists[4];
WordList &keywords6 = *keywordlists[5]; WordList &keywords6 = *keywordlists[5];
WordList &keywords7 = *keywordlists[6]; WordList &keywords7 = *keywordlists[6];
WordList &keywords8 = *keywordlists[7];
// find the first previous line without continuation character at the end // find the first previous line without continuation character at the end
int lineCurrent = styler.GetLine(startPos); int lineCurrent = styler.GetLine(startPos);
int s_startPos = startPos; int s_startPos = startPos;
@@ -325,6 +333,10 @@ static void ColouriseAU3Doc(unsigned int startPos,
sc.ChangeState(SCE_AU3_EXPAND); sc.ChangeState(SCE_AU3_EXPAND);
sc.SetState(SCE_AU3_DEFAULT); sc.SetState(SCE_AU3_DEFAULT);
} }
else if (keywords8.InList(s)) {
sc.ChangeState(SCE_AU3_UDF);
sc.SetState(SCE_AU3_DEFAULT);
}
else if (strcmp(s, "_") == 0) { else if (strcmp(s, "_") == 0) {
sc.ChangeState(SCE_AU3_OPERATOR); sc.ChangeState(SCE_AU3_OPERATOR);
sc.SetState(SCE_AU3_DEFAULT); sc.SetState(SCE_AU3_DEFAULT);
@@ -411,9 +423,11 @@ static void ColouriseAU3Doc(unsigned int startPos,
if ((si == 1 && sc.ch == '\"') || (si == 2 && sc.ch == '\'') || (si == 3 && sc.ch == '>')) if ((si == 1 && sc.ch == '\"') || (si == 2 && sc.ch == '\'') || (si == 3 && sc.ch == '>'))
{ {
sc.ForwardSetState(SCE_AU3_DEFAULT); sc.ForwardSetState(SCE_AU3_DEFAULT);
si=0;
} }
if (sc.atLineEnd) if (sc.atLineEnd)
{ {
si=0;
// at line end and not found a continuation char then reset to default // at line end and not found a continuation char then reset to default
int lineCurrent = styler.GetLine(sc.currentPos); int lineCurrent = styler.GetLine(sc.currentPos);
if (!IsContinuationLine(lineCurrent,styler)) if (!IsContinuationLine(lineCurrent,styler))
@@ -422,11 +436,8 @@ static void ColouriseAU3Doc(unsigned int startPos,
} }
} }
// find Sendkeys in a STRING // find Sendkeys in a STRING
if (sc.ch == '{') {sc.SetState(SCE_AU3_SENT);} if (sc.ch == '{' || sc.ch == '+' || sc.ch == '!' || sc.ch == '^' || sc.ch == '#' ) {
if (sc.ch == '+' && sc.chNext == '{') {sc.SetState(SCE_AU3_SENT);} sc.SetState(SCE_AU3_SENT);}
if (sc.ch == '!' && sc.chNext == '{') {sc.SetState(SCE_AU3_SENT);}
if (sc.ch == '^' && sc.chNext == '{') {sc.SetState(SCE_AU3_SENT);}
if (sc.ch == '#' && sc.chNext == '{') {sc.SetState(SCE_AU3_SENT);}
break; break;
} }
@@ -459,6 +470,35 @@ static void ColouriseAU3Doc(unsigned int startPos,
} }
sc.SetState(SCE_AU3_STRING); sc.SetState(SCE_AU3_STRING);
} }
else
{
// check if the start is a valid SendKey start
int nPos = 0;
int nState = 1;
char cTemp;
while (!(nState == 2) && ((cTemp = s[nPos]) != '\0'))
{
if (cTemp == '{' && nState == 1)
{
nState = 2;
}
if (nState == 1 && !(cTemp == '+' || cTemp == '!' || cTemp == '^' || cTemp == '#' ))
{
nState = 0;
}
nPos++;
}
//Verify characters infront of { ... if not assume regular string
if (nState == 1 && (!(sc.ch == '{' || sc.ch == '+' || sc.ch == '!' || sc.ch == '^' || sc.ch == '#' ))) {
sc.ChangeState(SCE_AU3_STRING);
sc.SetState(SCE_AU3_STRING);
}
// If invalid character found then assume its a regular string
if (nState == 0) {
sc.ChangeState(SCE_AU3_STRING);
sc.SetState(SCE_AU3_STRING);
}
}
// check if next portion is again a sendkey // check if next portion is again a sendkey
if (sc.atLineEnd) if (sc.atLineEnd)
{ {
@@ -466,13 +506,12 @@ static void ColouriseAU3Doc(unsigned int startPos,
sc.SetState(SCE_AU3_DEFAULT); sc.SetState(SCE_AU3_DEFAULT);
si = 0; // reset string indicator si = 0; // reset string indicator
} }
//if (sc.ch == '{' && sc.chPrev != '{') {sc.SetState(SCE_AU3_SENT);} //* check in next characters following a sentkey are again a sent key
if (sc.ch == '+' && sc.chNext == '{') {sc.SetState(SCE_AU3_SENT);} // Need this test incase of 2 sentkeys like {F1}{ENTER} but not detect {{}
if (sc.ch == '!' && sc.chNext == '{') {sc.SetState(SCE_AU3_SENT);} if (sc.state == SCE_AU3_STRING && (sc.ch == '{' || sc.ch == '+' || sc.ch == '!' || sc.ch == '^' || sc.ch == '#' )) {
if (sc.ch == '^' && sc.chNext == '{') {sc.SetState(SCE_AU3_SENT);} sc.SetState(SCE_AU3_SENT);}
if (sc.ch == '#' && sc.chNext == '{') {sc.SetState(SCE_AU3_SENT);}
// check to see if the string ended... // check to see if the string ended...
// Sentkey string isn't complete but the string ended.... // Sendkey string isn't complete but the string ended....
if ((si == 1 && sc.ch == '\"') || (si == 2 && sc.ch == '\'')) if ((si == 1 && sc.ch == '\"') || (si == 2 && sc.ch == '\''))
{ {
sc.ChangeState(SCE_AU3_STRING); sc.ChangeState(SCE_AU3_STRING);
@@ -491,6 +530,7 @@ static void ColouriseAU3Doc(unsigned int startPos,
else if (sc.ch == '$') {sc.SetState(SCE_AU3_VARIABLE);} else if (sc.ch == '$') {sc.SetState(SCE_AU3_VARIABLE);}
else if (sc.ch == '.' && !IsADigit(sc.chNext)) {sc.SetState(SCE_AU3_OPERATOR);} else if (sc.ch == '.' && !IsADigit(sc.chNext)) {sc.SetState(SCE_AU3_OPERATOR);}
else if (sc.ch == '@') {sc.SetState(SCE_AU3_KEYWORD);} else if (sc.ch == '@') {sc.SetState(SCE_AU3_KEYWORD);}
//else if (sc.ch == '_') {sc.SetState(SCE_AU3_KEYWORD);}
else if (sc.ch == '<' && si==3) {sc.SetState(SCE_AU3_STRING);} // string after #include else if (sc.ch == '<' && si==3) {sc.SetState(SCE_AU3_STRING);} // string after #include
else if (sc.ch == '\"') { else if (sc.ch == '\"') {
sc.SetState(SCE_AU3_STRING); sc.SetState(SCE_AU3_STRING);
@@ -543,6 +583,10 @@ static void ColouriseAU3Doc(unsigned int startPos,
sc.ChangeState(SCE_AU3_EXPAND); sc.ChangeState(SCE_AU3_EXPAND);
sc.SetState(SCE_AU3_EXPAND); sc.SetState(SCE_AU3_EXPAND);
} }
else if (keywords8.InList(s_save)) {
sc.ChangeState(SCE_AU3_UDF);
sc.SetState(SCE_AU3_UDF);
}
else { else {
sc.ChangeState(SCE_AU3_DEFAULT); sc.ChangeState(SCE_AU3_DEFAULT);
sc.SetState(SCE_AU3_DEFAULT); sc.SetState(SCE_AU3_DEFAULT);
@@ -841,6 +885,7 @@ static const char * const AU3WordLists[] = {
"#autoit Pre-processors", "#autoit Pre-processors",
"#autoit Special", "#autoit Special",
"#autoit Expand", "#autoit Expand",
"#autoit UDF",
0 0
}; };
LexerModule lmAU3(SCLEX_AU3, ColouriseAU3Doc, "au3", FoldAU3Doc , AU3WordLists); LexerModule lmAU3(SCLEX_AU3, ColouriseAU3Doc, "au3", FoldAU3Doc , AU3WordLists);

View File

@@ -258,7 +258,8 @@ static void ColouriseBashDoc(unsigned int startPos, int length, int initStyle,
if (state == SCE_SH_DEFAULT) { if (state == SCE_SH_DEFAULT) {
if (ch == '\\') { // escaped character if (ch == '\\') { // escaped character
i++; if (i < lengthDoc - 1)
i++;
ch = chNext; ch = chNext;
chNext = chNext2; chNext = chNext2;
styler.ColourTo(i, SCE_SH_IDENTIFIER); styler.ColourTo(i, SCE_SH_IDENTIFIER);
@@ -626,7 +627,7 @@ static void FoldBashDoc(unsigned int startPos, int length, int, WordList *[],
&& !IsCommentLine(lineCurrent+1, styler)) && !IsCommentLine(lineCurrent+1, styler))
levelCurrent--; levelCurrent--;
} }
if (style == SCE_C_OPERATOR) { if (style == SCE_SH_OPERATOR) {
if (ch == '{') { if (ch == '{') {
levelCurrent++; levelCurrent++;
} else if (ch == '}') { } else if (ch == '}') {

View File

@@ -147,7 +147,7 @@ static void ColouriseBasicDoc(unsigned int startPos, int length, int initStyle,
sc.ChangeState(SCE_B_ERROR); sc.ChangeState(SCE_B_ERROR);
sc.SetState(SCE_B_DEFAULT); sc.SetState(SCE_B_DEFAULT);
} }
} else if (sc.state == SCE_B_COMMENT) { } else if (sc.state == SCE_B_COMMENT || sc.state == SCE_B_PREPROCESSOR) {
if (sc.atLineEnd) { if (sc.atLineEnd) {
sc.SetState(SCE_B_DEFAULT); sc.SetState(SCE_B_DEFAULT);
} }
@@ -163,7 +163,12 @@ static void ColouriseBasicDoc(unsigned int startPos, int length, int initStyle,
wasfirst = isfirst; wasfirst = isfirst;
sc.SetState(SCE_B_IDENTIFIER); sc.SetState(SCE_B_IDENTIFIER);
} else if (sc.Match(comment_char)) { } else if (sc.Match(comment_char)) {
sc.SetState(SCE_B_COMMENT); // Hack to make deprecated QBASIC '$Include show
// up in freebasic with SCE_B_PREPROCESSOR.
if (comment_char == '\'' && sc.Match(comment_char, '$'))
sc.SetState(SCE_B_PREPROCESSOR);
else
sc.SetState(SCE_B_COMMENT);
} else if (sc.Match('"')) { } else if (sc.Match('"')) {
sc.SetState(SCE_B_STRING); sc.SetState(SCE_B_STRING);
} else if (IsDigit(sc.ch)) { } else if (IsDigit(sc.ch)) {

View File

@@ -459,4 +459,3 @@ static void ColouriseCppDocInsensitive(unsigned int startPos, int length, int in
LexerModule lmCPP(SCLEX_CPP, ColouriseCppDocSensitive, "cpp", FoldCppDoc, cppWordLists); LexerModule lmCPP(SCLEX_CPP, ColouriseCppDocSensitive, "cpp", FoldCppDoc, cppWordLists);
LexerModule lmCPPNoCase(SCLEX_CPPNOCASE, ColouriseCppDocInsensitive, "cppnocase", FoldCppDoc, cppWordLists); LexerModule lmCPPNoCase(SCLEX_CPPNOCASE, ColouriseCppDocInsensitive, "cppnocase", FoldCppDoc, cppWordLists);
LexerModule lmTCL(SCLEX_TCL, ColouriseCppDocSensitive, "tcl", FoldCppDoc, cppWordLists);

View File

@@ -32,7 +32,7 @@ static inline bool isEiffelOperator(unsigned int ch) {
} }
static inline bool IsAWordChar(unsigned int ch) { static inline bool IsAWordChar(unsigned int ch) {
return (ch < 0x80) && (isalnum(ch) || ch == '.' || ch == '_'); return (ch < 0x80) && (isalnum(ch) || ch == '_');
} }
static inline bool IsAWordStart(unsigned int ch) { static inline bool IsAWordStart(unsigned int ch) {

View File

@@ -149,7 +149,13 @@ static inline bool isStringState(int state) {
case SCE_HB_STRING: case SCE_HB_STRING:
case SCE_HBA_STRING: case SCE_HBA_STRING:
case SCE_HP_STRING: case SCE_HP_STRING:
case SCE_HP_CHARACTER:
case SCE_HP_TRIPLE:
case SCE_HP_TRIPLEDOUBLE:
case SCE_HPA_STRING: case SCE_HPA_STRING:
case SCE_HPA_CHARACTER:
case SCE_HPA_TRIPLE:
case SCE_HPA_TRIPLEDOUBLE:
case SCE_HPHP_HSTRING: case SCE_HPHP_HSTRING:
case SCE_HPHP_SIMPLESTRING: case SCE_HPHP_SIMPLESTRING:
case SCE_HPHP_HSTRING_VARIABLE: case SCE_HPHP_HSTRING_VARIABLE:
@@ -163,6 +169,19 @@ static inline bool isStringState(int state) {
return bResult; return bResult;
} }
static inline bool stateAllowsTermination(int state) {
bool allowTermination = !isStringState(state);
if (allowTermination) {
switch (state) {
case SCE_HPHP_COMMENT:
case SCE_HP_COMMENTLINE:
case SCE_HPA_COMMENTLINE:
allowTermination = false;
}
}
return allowTermination;
}
// not really well done, since it's only comments that should lex the %> and <% // not really well done, since it's only comments that should lex the %> and <%
static inline bool isCommentASPState(int state) { static inline bool isCommentASPState(int state) {
bool bResult; bool bResult;
@@ -668,7 +687,7 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty
(ch == '<') && (ch == '<') &&
(chNext == '?') && (chNext == '?') &&
!IsScriptCommentState(state) ) { !IsScriptCommentState(state) ) {
scriptLanguage = segIsScriptingIndicator(styler, styler.GetStartSegment() + 2, i + 10, eScriptPHP); scriptLanguage = segIsScriptingIndicator(styler, i + 2, i + 10, eScriptPHP);
if (scriptLanguage != eScriptPHP && isStringState(state)) continue; if (scriptLanguage != eScriptPHP && isStringState(state)) continue;
styler.ColourTo(i - 1, StateToPrint); styler.ColourTo(i - 1, StateToPrint);
beforePreProc = state; beforePreProc = state;
@@ -763,9 +782,7 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty
else if (( else if ((
((inScriptType == eNonHtmlPreProc) ((inScriptType == eNonHtmlPreProc)
|| (inScriptType == eNonHtmlScriptPreProc)) && ( || (inScriptType == eNonHtmlScriptPreProc)) && (
((scriptLanguage == eScriptPHP) && (ch == '?') && !isPHPStringState(state) && (state != SCE_HPHP_COMMENT)) || ((scriptLanguage != eScriptNone) && stateAllowsTermination(state) && ((ch == '%') || (ch == '?')))
((scriptLanguage != eScriptNone) && !isStringState(state) &&
((ch == '%') || (ch == '?')))
) && (chNext == '>')) || ) && (chNext == '>')) ||
((scriptLanguage == eScriptSGML) && (ch == '>') && (state != SCE_H_SGML_COMMENT))) { ((scriptLanguage == eScriptSGML) && (ch == '>') && (state != SCE_H_SGML_COMMENT))) {
if (state == SCE_H_ASPAT) { if (state == SCE_H_ASPAT) {

View File

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

View File

@@ -38,7 +38,8 @@ static inline bool IsANumberChar(int ch) {
// but probably enough in most cases. // but probably enough in most cases.
return (ch < 0x80) && return (ch < 0x80) &&
(isdigit(ch) || toupper(ch) == 'E' || (isdigit(ch) || toupper(ch) == 'E' ||
ch == '.' || ch == '-' || ch == '+'); ch == '.' || ch == '-' || ch == '+' ||
(ch >= 'a' && ch <= 'f') || (ch >= 'A' && ch <= 'F'));
} }
static inline bool IsLuaOperator(int ch) { static inline bool IsLuaOperator(int ch) {
@@ -51,7 +52,8 @@ static inline bool IsLuaOperator(int 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 == ':' ||
ch == '#') {
return true; return true;
} }
return false; return false;
@@ -144,7 +146,7 @@ static void ColouriseLuaDoc(
if (sc.state == SCE_LUA_OPERATOR) { if (sc.state == SCE_LUA_OPERATOR) {
sc.SetState(SCE_LUA_DEFAULT); sc.SetState(SCE_LUA_DEFAULT);
} else if (sc.state == SCE_LUA_NUMBER) { } else if (sc.state == SCE_LUA_NUMBER) {
// We stop the number definition on non-numerical non-dot non-eE non-sign char // We stop the number definition on non-numerical non-dot non-eE non-sign non-hexdigit char
if (!IsANumberChar(sc.ch)) { if (!IsANumberChar(sc.ch)) {
sc.SetState(SCE_LUA_DEFAULT); sc.SetState(SCE_LUA_DEFAULT);
} }
@@ -225,6 +227,9 @@ static void ColouriseLuaDoc(
if (sc.state == SCE_LUA_DEFAULT) { if (sc.state == SCE_LUA_DEFAULT) {
if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext))) { if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext))) {
sc.SetState(SCE_LUA_NUMBER); sc.SetState(SCE_LUA_NUMBER);
if (sc.ch == '0' && toupper(sc.chNext) == 'X') {
sc.Forward(1);
}
} else if (IsAWordStart(sc.ch)) { } else if (IsAWordStart(sc.ch)) {
sc.SetState(SCE_LUA_IDENTIFIER); sc.SetState(SCE_LUA_IDENTIFIER);
} else if (sc.ch == '\"') { } else if (sc.ch == '\"') {

View File

@@ -3,7 +3,7 @@
** Lexer for MSSQL. ** Lexer for MSSQL.
**/ **/
// By Filip Yaghob <fyaghob@gmail.com> // By Filip Yaghob <fyaghob@gmail.com>
// The License.txt file describes the conditions under which this software may be distributed.
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>

View File

@@ -0,0 +1,518 @@
// Scintilla source code edit control
/** @file LexOpal.cxx
** Lexer for OPAL (functional language similar to Haskell)
** Written by Sebastian Pipping <webmaster@hartwork.org>
**/
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <stdio.h>
#include <stdarg.h>
#include "Platform.h"
#include "PropSet.h"
#include "Accessor.h"
#include "KeyWords.h"
#include "Scintilla.h"
#include "SciLexer.h"
#include "StyleContext.h"
inline static void getRange( unsigned int start, unsigned int end, Accessor & styler, char * s, unsigned int len )
{
unsigned int i = 0;
while( ( i < end - start + 1 ) && ( i < len - 1 ) )
{
s[i] = static_cast<char>( styler[ start + i ] );
i++;
}
s[ i ] = '\0';
}
inline bool HandleString( unsigned int & cur, unsigned int one_too_much, Accessor & styler )
{
char ch;
// Wait for string to close
bool even_backslash_count = true; // Without gaps in between
cur++; // Skip initial quote
for( ; ; )
{
if( cur >= one_too_much )
{
styler.ColourTo( cur - 1, SCE_OPAL_STRING );
return false; // STOP
}
ch = styler.SafeGetCharAt( cur );
if( ( ch == '\015' ) || ( ch == '\012' ) ) // Deny multi-line strings
{
styler.ColourTo( cur - 1, SCE_OPAL_STRING );
styler.StartSegment( cur );
return true;
}
else
{
if( even_backslash_count )
{
if( ch == '"' )
{
styler.ColourTo( cur, SCE_OPAL_STRING );
cur++;
if( cur >= one_too_much )
{
return false; // STOP
}
else
{
styler.StartSegment( cur );
return true;
}
}
else if( ch == '\\' )
{
even_backslash_count = false;
}
}
else
{
even_backslash_count = true;
}
}
cur++;
}
}
inline bool HandleCommentBlock( unsigned int & cur, unsigned int one_too_much, Accessor & styler, bool could_fail )
{
char ch;
if( could_fail )
{
cur++;
if( cur >= one_too_much )
{
styler.ColourTo( cur - 1, SCE_OPAL_DEFAULT );
return false; // STOP
}
ch = styler.SafeGetCharAt( cur );
if( ch != '*' )
{
styler.ColourTo( cur - 1, SCE_OPAL_DEFAULT );
styler.StartSegment( cur );
return true;
}
}
// Wait for comment close
cur++;
bool star_found = false;
for( ; ; )
{
if( cur >= one_too_much )
{
styler.ColourTo( cur - 1, SCE_OPAL_COMMENT_BLOCK );
return false; // STOP
}
ch = styler.SafeGetCharAt( cur );
if( star_found )
{
if( ch == '/' )
{
styler.ColourTo( cur, SCE_OPAL_COMMENT_BLOCK );
cur++;
if( cur >= one_too_much )
{
return false; // STOP
}
else
{
styler.StartSegment( cur );
return true;
}
}
else if( ch != '*' )
{
star_found = false;
}
}
else if( ch == '*' )
{
star_found = true;
}
cur++;
}
}
inline bool HandleCommentLine( unsigned int & cur, unsigned int one_too_much, Accessor & styler, bool could_fail )
{
char ch;
if( could_fail )
{
cur++;
if( cur >= one_too_much )
{
styler.ColourTo( cur - 1, SCE_OPAL_DEFAULT );
return false; // STOP
}
ch = styler.SafeGetCharAt( cur );
if( ch != '-' )
{
styler.ColourTo( cur - 1, SCE_OPAL_DEFAULT );
styler.StartSegment( cur );
return true;
}
cur++;
if( cur >= one_too_much )
{
styler.ColourTo( cur - 1, SCE_OPAL_DEFAULT );
return false; // STOP
}
ch = styler.SafeGetCharAt( cur );
if( ( ch != ' ' ) && ( ch != '\t' ) )
{
styler.ColourTo( cur - 1, SCE_OPAL_DEFAULT );
styler.StartSegment( cur );
return true;
}
}
// Wait for end of line
bool fifteen_found = false;
for( ; ; )
{
cur++;
if( cur >= one_too_much )
{
styler.ColourTo( cur - 1, SCE_OPAL_COMMENT_LINE );
return false; // STOP
}
ch = styler.SafeGetCharAt( cur );
if( fifteen_found )
{
/*
if( ch == '\012' )
{
// One newline on Windows (015, 012)
}
else
{
// One newline on MAC (015) and another char
}
*/
cur--;
styler.ColourTo( cur - 1, SCE_OPAL_COMMENT_LINE );
styler.StartSegment( cur );
return true;
}
else
{
if( ch == '\015' )
{
fifteen_found = true;
}
else if( ch == '\012' )
{
// One newline on Linux (012)
styler.ColourTo( cur - 1, SCE_OPAL_COMMENT_LINE );
styler.StartSegment( cur );
return true;
}
}
}
}
inline bool HandlePar( unsigned int & cur, Accessor & styler )
{
styler.ColourTo( cur, SCE_OPAL_PAR );
cur++;
styler.StartSegment( cur );
return true;
}
inline bool HandleSpace( unsigned int & cur, unsigned int one_too_much, Accessor & styler )
{
char ch;
cur++;
for( ; ; )
{
if( cur >= one_too_much )
{
styler.ColourTo( cur - 1, SCE_OPAL_SPACE );
return false;
}
ch = styler.SafeGetCharAt( cur );
switch( ch )
{
case ' ':
case '\t':
case '\015':
case '\012':
cur++;
break;
default:
styler.ColourTo( cur - 1, SCE_OPAL_SPACE );
styler.StartSegment( cur );
return true;
}
}
}
inline bool HandleInteger( unsigned int & cur, unsigned int one_too_much, Accessor & styler )
{
char ch;
for( ; ; )
{
cur++;
if( cur >= one_too_much )
{
styler.ColourTo( cur - 1, SCE_OPAL_INTEGER );
return false; // STOP
}
ch = styler.SafeGetCharAt( cur );
if( !isdigit( ch ) )
{
styler.ColourTo( cur - 1, SCE_OPAL_INTEGER );
styler.StartSegment( cur );
return true;
}
}
}
inline bool HandleWord( unsigned int & cur, unsigned int one_too_much, Accessor & styler, WordList * keywordlists[] )
{
char ch;
const unsigned int beg = cur;
cur++;
for( ; ; )
{
ch = styler.SafeGetCharAt( cur );
if( ( ch != '_' ) && ( ch != '-' ) &&
!islower( ch ) && !isupper( ch ) && !isdigit( ch ) ) break;
cur++;
if( cur >= one_too_much )
{
break;
}
}
const int ide_len = cur - beg + 1;
char * ide = new char[ ide_len ];
getRange( beg, cur, styler, ide, ide_len );
WordList & keywords = *keywordlists[ 0 ];
WordList & classwords = *keywordlists[ 1 ];
if( keywords.InList( ide ) ) // Keyword
{
delete [] ide;
styler.ColourTo( cur - 1, SCE_OPAL_KEYWORD );
if( cur >= one_too_much )
{
return false; // STOP
}
else
{
styler.StartSegment( cur );
return true;
}
}
else if( classwords.InList( ide ) ) // Sort
{
delete [] ide;
styler.ColourTo( cur - 1, SCE_OPAL_SORT );
if( cur >= one_too_much )
{
return false; // STOP
}
else
{
styler.StartSegment( cur );
return true;
}
}
else if( !strcmp( ide, "true" ) || !strcmp( ide, "false" ) ) // Bool const
{
delete [] ide;
styler.ColourTo( cur - 1, SCE_OPAL_BOOL_CONST );
if( cur >= one_too_much )
{
return false; // STOP
}
else
{
styler.StartSegment( cur );
return true;
}
}
else // Unknown keyword
{
delete [] ide;
styler.ColourTo( cur - 1, SCE_OPAL_DEFAULT );
if( cur >= one_too_much )
{
return false; // STOP
}
else
{
styler.StartSegment( cur );
return true;
}
}
}
inline bool HandleSkip( unsigned int & cur, unsigned int one_too_much, Accessor & styler )
{
cur++;
styler.ColourTo( cur - 1, SCE_OPAL_DEFAULT );
if( cur >= one_too_much )
{
return false; // STOP
}
else
{
styler.StartSegment( cur );
return true;
}
}
static void ColouriseOpalDoc( unsigned int startPos, int length, int initStyle, WordList *keywordlists[], Accessor & styler )
{
styler.StartAt( startPos );
styler.StartSegment( startPos );
unsigned int & cur = startPos;
const unsigned int one_too_much = startPos + length;
int state = initStyle;
for( ; ; )
{
switch( state )
{
case SCE_OPAL_KEYWORD:
case SCE_OPAL_SORT:
if( !HandleWord( cur, one_too_much, styler, keywordlists ) ) return;
state = SCE_OPAL_DEFAULT;
break;
case SCE_OPAL_INTEGER:
if( !HandleInteger( cur, one_too_much, styler ) ) return;
state = SCE_OPAL_DEFAULT;
break;
case SCE_OPAL_COMMENT_BLOCK:
if( !HandleCommentBlock( cur, one_too_much, styler, false ) ) return;
state = SCE_OPAL_DEFAULT;
break;
case SCE_OPAL_COMMENT_LINE:
if( !HandleCommentLine( cur, one_too_much, styler, false ) ) return;
state = SCE_OPAL_DEFAULT;
break;
case SCE_OPAL_STRING:
if( !HandleString( cur, one_too_much, styler ) ) return;
state = SCE_OPAL_DEFAULT;
break;
default: // SCE_OPAL_DEFAULT:
{
char ch = styler.SafeGetCharAt( cur );
switch( ch )
{
// String
case '"':
if( !HandleString( cur, one_too_much, styler ) ) return;
break;
// Comment block
case '/':
if( !HandleCommentBlock( cur, one_too_much, styler, true ) ) return;
break;
// Comment line
case '-':
if( !HandleCommentLine( cur, one_too_much, styler, true ) ) return;
break;
// Par
case '(':
case ')':
case '[':
case ']':
case '{':
case '}':
if( !HandlePar( cur, styler ) ) return;
break;
// Whitespace
case ' ':
case '\t':
case '\015':
case '\012':
if( !HandleSpace( cur, one_too_much, styler ) ) return;
break;
default:
{
// Integer
if( isdigit( ch ) )
{
if( !HandleInteger( cur, one_too_much, styler ) ) return;
}
// Keyword
else if( islower( ch ) || isupper( ch ) )
{
if( !HandleWord( cur, one_too_much, styler, keywordlists ) ) return;
}
// Skip
else
{
if( !HandleSkip( cur, one_too_much, styler ) ) return;
}
}
}
break;
}
}
}
}
static const char * const opalWordListDesc[] = {
"Keywords",
"Sorts",
0
};
LexerModule lmOpal(SCLEX_OPAL, ColouriseOpalDoc, "opal", NULL, opalWordListDesc);

View File

@@ -41,7 +41,7 @@ static bool IsBOperator(char ch) {
// Tests for BATCH Separators // Tests for BATCH Separators
static bool IsBSeparator(char ch) { static bool IsBSeparator(char ch) {
return (ch == ':') || (ch == '\\') || (ch == '.') || (ch == ';') || return (ch == '\\') || (ch == '.') || (ch == ';') ||
(ch == '\"') || (ch == '\'') || (ch == '/') || (ch == ')'); (ch == '\"') || (ch == '\'') || (ch == '/') || (ch == ')');
} }
@@ -50,7 +50,7 @@ static void ColouriseBatchLine(
unsigned int lengthLine, unsigned int lengthLine,
unsigned int startLine, unsigned int startLine,
unsigned int endPos, unsigned int endPos,
WordList &keywords, WordList *keywordlists[],
Accessor &styler) { Accessor &styler) {
unsigned int offset = 0; // Line Buffer Offset unsigned int offset = 0; // Line Buffer Offset
@@ -59,7 +59,9 @@ static void ColouriseBatchLine(
char wordBuffer[81]; // Word Buffer - large to catch long paths char wordBuffer[81]; // Word Buffer - large to catch long paths
unsigned int wbl; // Word Buffer Length unsigned int wbl; // Word Buffer Length
unsigned int wbo; // Word Buffer Offset - also Special Keyword Buffer Length unsigned int wbo; // Word Buffer Offset - also Special Keyword Buffer Length
bool forFound = false; // No Local Variable without FOR statement WordList &keywords = *keywordlists[0]; // Internal Commands
WordList &keywords2 = *keywordlists[1]; // External Commands (optional)
// CHOICE, ECHO, GOTO, PROMPT and SET have Default Text that may contain Regular Keywords // CHOICE, ECHO, GOTO, PROMPT and SET have Default Text that may contain Regular Keywords
// Toggling Regular Keyword Checking off improves readability // Toggling Regular Keyword Checking off improves readability
// Other Regular Keywords and External Commands / Programs might also benefit from toggling // Other Regular Keywords and External Commands / Programs might also benefit from toggling
@@ -174,7 +176,13 @@ static void ColouriseBatchLine(
// Reset Offset to re-process remainder of word // Reset Offset to re-process remainder of word
offset -= (wbl - 1); offset -= (wbl - 1);
// Colorize External Command / Program // Colorize External Command / Program
styler.ColourTo(startLine + offset - 1, SCE_BAT_COMMAND); if (!keywords2) {
styler.ColourTo(startLine + offset - 1, SCE_BAT_COMMAND);
} else if (keywords2.InList(wordBuffer)) {
styler.ColourTo(startLine + offset - 1, SCE_BAT_COMMAND);
} else {
styler.ColourTo(startLine + offset - 1, SCE_BAT_DEFAULT);
}
// Reset External Command / Program Location // Reset External Command / Program Location
cmdLoc = offset; cmdLoc = offset;
} else { } else {
@@ -186,10 +194,6 @@ static void ColouriseBatchLine(
// Check for Regular Keyword in list // Check for Regular Keyword in list
} else if ((keywords.InList(wordBuffer)) && } else if ((keywords.InList(wordBuffer)) &&
(continueProcessing)) { (continueProcessing)) {
// Local Variables do not exist if no FOR statement
if (CompareCaseInsensitive(wordBuffer, "for") == 0) {
forFound = true;
}
// ECHO, GOTO, PROMPT and SET require no further Regular Keyword Checking // ECHO, GOTO, PROMPT and SET require no further Regular Keyword Checking
if ((CompareCaseInsensitive(wordBuffer, "echo") == 0) || if ((CompareCaseInsensitive(wordBuffer, "echo") == 0) ||
(CompareCaseInsensitive(wordBuffer, "goto") == 0) || (CompareCaseInsensitive(wordBuffer, "goto") == 0) ||
@@ -261,8 +265,8 @@ static void ColouriseBatchLine(
styler.ColourTo(startLine + offset - 1 - (wbl - wbo), SCE_BAT_WORD); styler.ColourTo(startLine + offset - 1 - (wbl - wbo), SCE_BAT_WORD);
// Reset Offset to re-process remainder of word // Reset Offset to re-process remainder of word
offset -= (wbl - wbo); offset -= (wbl - wbo);
}
} }
}
// Check for External Command / Program or Default Text // Check for External Command / Program or Default Text
if (!sKeywordFound) { if (!sKeywordFound) {
wbo = 0; wbo = 0;
@@ -306,8 +310,14 @@ static void ColouriseBatchLine(
} }
} }
} }
// Colorize External command / program // Colorize External Command / Program
styler.ColourTo(startLine + offset - 1, SCE_BAT_COMMAND); if (!keywords2) {
styler.ColourTo(startLine + offset - 1, SCE_BAT_COMMAND);
} else if (keywords2.InList(wordBuffer)) {
styler.ColourTo(startLine + offset - 1, SCE_BAT_COMMAND);
} else {
styler.ColourTo(startLine + offset - 1, SCE_BAT_DEFAULT);
}
// No need to Reset Offset // No need to Reset Offset
// Check for Default Text // Check for Default Text
} else { } else {
@@ -354,13 +364,13 @@ static void ColouriseBatchLine(
// Check for External Command / Program // Check for External Command / Program
if (cmdLoc == offset - wbl) { if (cmdLoc == offset - wbl) {
cmdLoc = offset - (wbl - wbo); cmdLoc = offset - (wbl - wbo);
} }
// Colorize Environment Variable // Colorize Environment Variable
styler.ColourTo(startLine + offset - 1 - (wbl - wbo), SCE_BAT_IDENTIFIER); styler.ColourTo(startLine + offset - 1 - (wbl - wbo), SCE_BAT_IDENTIFIER);
// Reset Offset to re-process remainder of word // Reset Offset to re-process remainder of word
offset -= (wbl - wbo); offset -= (wbl - wbo);
// Check for Local Variable (%%a) // Check for Local Variable (%%a)
} else if ((forFound) && } else if (
(wordBuffer[1] == '%') && (wordBuffer[1] == '%') &&
(wordBuffer[2] != '%') && (wordBuffer[2] != '%') &&
(!IsBOperator(wordBuffer[2])) && (!IsBOperator(wordBuffer[2])) &&
@@ -447,7 +457,6 @@ static void ColouriseBatchDoc(
Accessor &styler) { Accessor &styler) {
char lineBuffer[1024]; char lineBuffer[1024];
WordList &keywords = *keywordlists[0];
styler.StartAt(startPos); styler.StartAt(startPos);
styler.StartSegment(startPos); styler.StartSegment(startPos);
@@ -458,14 +467,14 @@ static void ColouriseBatchDoc(
if (AtEOL(styler, i) || (linePos >= sizeof(lineBuffer) - 1)) { if (AtEOL(styler, i) || (linePos >= sizeof(lineBuffer) - 1)) {
// End of line (or of line buffer) met, colourise it // End of line (or of line buffer) met, colourise it
lineBuffer[linePos] = '\0'; lineBuffer[linePos] = '\0';
ColouriseBatchLine(lineBuffer, linePos, startLine, i, keywords, styler); ColouriseBatchLine(lineBuffer, linePos, startLine, i, keywordlists, styler);
linePos = 0; linePos = 0;
startLine = i + 1; startLine = i + 1;
} }
} }
if (linePos > 0) { // Last line does not have ending characters if (linePos > 0) { // Last line does not have ending characters
ColouriseBatchLine(lineBuffer, linePos, startLine, startPos + length - 1, ColouriseBatchLine(lineBuffer, linePos, startLine, startPos + length - 1,
keywords, styler); keywordlists, styler);
} }
} }
@@ -593,8 +602,8 @@ static void ColourisePropsLine(
while ((i < lengthLine) && (lineBuffer[i] != '=')) while ((i < lengthLine) && (lineBuffer[i] != '='))
i++; i++;
if ((i < lengthLine) && (lineBuffer[i] == '=')) { if ((i < lengthLine) && (lineBuffer[i] == '=')) {
styler.ColourTo(startLine + i - 1, SCE_PROPS_DEFAULT); styler.ColourTo(startLine + i - 1, SCE_PROPS_KEY);
styler.ColourTo(startLine + i, 3); styler.ColourTo(startLine + i, SCE_PROPS_ASSIGNMENT);
styler.ColourTo(endPos, SCE_PROPS_DEFAULT); styler.ColourTo(endPos, SCE_PROPS_DEFAULT);
} else { } else {
styler.ColourTo(endPos, SCE_PROPS_DEFAULT); styler.ColourTo(endPos, SCE_PROPS_DEFAULT);
@@ -1103,7 +1112,8 @@ static void ColouriseLatexDoc(unsigned int startPos, int length, int initStyle,
} }
static const char * const batchWordListDesc[] = { static const char * const batchWordListDesc[] = {
"Keywords", "Internal Commands",
"External Commands",
0 0
}; };

View File

@@ -212,6 +212,8 @@ static void ColourisePyDoc(unsigned int startPos, int length, int initStyle,
} else if (sc.state == SCE_P_DECORATOR) { } else if (sc.state == SCE_P_DECORATOR) {
if (sc.ch == '\r' || sc.ch == '\n') { if (sc.ch == '\r' || sc.ch == '\n') {
sc.SetState(SCE_P_DEFAULT); sc.SetState(SCE_P_DEFAULT);
} else if (sc.ch == '#') {
sc.SetState((sc.chNext == '#') ? SCE_P_COMMENTBLOCK : SCE_P_COMMENTLINE);
} }
} else if ((sc.state == SCE_P_STRING) || (sc.state == SCE_P_CHARACTER)) { } else if ((sc.state == SCE_P_STRING) || (sc.state == SCE_P_CHARACTER)) {
if (sc.ch == '\\') { if (sc.ch == '\\') {

View File

@@ -43,7 +43,6 @@ static inline bool IsANumberChar(int ch) {
ch == '.' || ch == '-' || ch == '+'); ch == '.' || ch == '-' || ch == '+');
} }
static void ColouriseSQLDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[], static void ColouriseSQLDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[],
Accessor &styler) { Accessor &styler) {
@@ -60,28 +59,8 @@ static void ColouriseSQLDoc(unsigned int startPos, int length, int initStyle, Wo
bool sqlBackslashEscapes = styler.GetPropertyInt("sql.backslash.escapes", 0) != 0; bool sqlBackslashEscapes = styler.GetPropertyInt("sql.backslash.escapes", 0) != 0;
bool sqlBackticksIdentifier = styler.GetPropertyInt("lexer.sql.backticks.identifier", 0) != 0; bool sqlBackticksIdentifier = styler.GetPropertyInt("lexer.sql.backticks.identifier", 0) != 0;
int styleBeforeDCKeyword = SCE_C_DEFAULT; int styleBeforeDCKeyword = SCE_SQL_DEFAULT;
bool fold = styler.GetPropertyInt("fold") != 0;
int lineCurrent = styler.GetLine(startPos);
for (; sc.More(); sc.Forward()) { for (; sc.More(); sc.Forward()) {
// Fold based on indentation
if (sc.atLineStart) {
int spaceFlags = 0;
int indentCurrent = styler.IndentAmount(lineCurrent, &spaceFlags);
int level = indentCurrent;
if (!(indentCurrent & SC_FOLDLEVELWHITEFLAG)) {
// Only non whitespace lines can be headers
int indentNext = styler.IndentAmount(lineCurrent + 1, &spaceFlags);
if (indentCurrent < (indentNext & ~SC_FOLDLEVELWHITEFLAG)) {
level |= SC_FOLDLEVELHEADERFLAG;
}
}
if (fold) {
styler.SetLevel(lineCurrent, level);
}
}
// Determine if the current state should terminate. // Determine if the current state should terminate.
switch (sc.state) { switch (sc.state) {
case SCE_SQL_OPERATOR: case SCE_SQL_OPERATOR:
@@ -243,12 +222,14 @@ static void FoldSQLDoc(unsigned int startPos, int length, int initStyle,
WordList *[], Accessor &styler) { WordList *[], Accessor &styler) {
bool foldComment = styler.GetPropertyInt("fold.comment") != 0; bool foldComment = styler.GetPropertyInt("fold.comment") != 0;
bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0; bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0;
bool foldOnlyBegin = styler.GetPropertyInt("fold.sql.only.begin", 0) != 0;
unsigned int endPos = startPos + length; unsigned int endPos = startPos + length;
int visibleChars = 0; int visibleChars = 0;
int lineCurrent = styler.GetLine(startPos); int lineCurrent = styler.GetLine(startPos);
int levelCurrent = SC_FOLDLEVELBASE; int levelCurrent = SC_FOLDLEVELBASE;
if (lineCurrent > 0) { if (lineCurrent > 0) {
levelCurrent = styler.LevelAt(lineCurrent - 1) & SC_FOLDLEVELNUMBERMASK; levelCurrent = styler.LevelAt(lineCurrent - 1) >> 16;
} }
int levelNext = levelCurrent; int levelNext = levelCurrent;
char chNext = styler[startPos]; char chNext = styler[startPos];
@@ -306,7 +287,7 @@ static void FoldSQLDoc(unsigned int startPos, int length, int initStyle,
} else { } else {
s[j] = '\0'; s[j] = '\0';
} }
if (strcmp(s, "if") == 0 || strcmp(s, "loop") == 0) { if ((!foldOnlyBegin) && (strcmp(s, "if") == 0 || strcmp(s, "loop") == 0)) {
if (endFound) { if (endFound) {
// ignore // ignore
endFound = false; endFound = false;
@@ -326,16 +307,14 @@ static void FoldSQLDoc(unsigned int startPos, int length, int initStyle,
} }
} }
if (atEOL) { if (atEOL) {
int level = levelCurrent; int levelUse = levelCurrent;
if (visibleChars == 0 && foldCompact) { int lev = levelUse | levelNext << 16;
// Empty line if (visibleChars == 0 && foldCompact)
level |= SC_FOLDLEVELWHITEFLAG; lev |= SC_FOLDLEVELWHITEFLAG;
} if (levelUse < levelNext)
if (visibleChars > 0 && levelNext > levelCurrent) { lev |= SC_FOLDLEVELHEADERFLAG;
level |= SC_FOLDLEVELHEADERFLAG; if (lev != styler.LevelAt(lineCurrent)) {
} styler.SetLevel(lineCurrent, lev);
if (level != styler.LevelAt(lineCurrent)) {
styler.SetLevel(lineCurrent, level);
} }
lineCurrent++; lineCurrent++;
levelCurrent = levelNext; levelCurrent = levelNext;

View File

@@ -0,0 +1,221 @@
// Scintilla source code edit control
/** @file LexSpice.cxx
** Lexer for Spice
**/
// Copyright 2006 by Fabien Proriol
// The License.txt file describes the conditions under which this software may be distributed.
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
#include <stdio.h>
#include "Platform.h"
#include "Accessor.h"
#include "StyleContext.h"
#include "PropSet.h"
#include "KeyWords.h"
#include "SciLexer.h"
#include "SString.h"
/*
* Interface
*/
static void ColouriseDocument(
unsigned int startPos,
int length,
int initStyle,
WordList *keywordlists[],
Accessor &styler);
static const char * const spiceWordListDesc[] = {
"Keywords", // SPICE command
"Keywords2", // SPICE functions
"Keywords3", // SPICE params
0
};
LexerModule lmSpice(SCLEX_SPICE, ColouriseDocument, "spice", NULL, spiceWordListDesc);
/*
* Implementation
*/
static void ColouriseComment(StyleContext& sc, bool& apostropheStartsAttribute);
static void ColouriseDelimiter(StyleContext& sc, bool& apostropheStartsAttribute);
static void ColouriseNumber(StyleContext& sc, bool& apostropheStartsAttribute);
static void ColouriseWhiteSpace(StyleContext& sc, bool& apostropheStartsAttribute);
static void ColouriseWord(StyleContext& sc, WordList& keywords, WordList& keywords2, WordList& keywords3, bool& apostropheStartsAttribute);
static inline bool IsDelimiterCharacter(int ch);
static inline bool IsNumberStartCharacter(int ch);
static inline bool IsNumberCharacter(int ch);
static inline bool IsSeparatorOrDelimiterCharacter(int ch);
static inline bool IsWordStartCharacter(int ch);
static inline bool IsWordCharacter(int ch);
static void ColouriseComment(StyleContext& sc, bool&) {
sc.SetState(SCE_SPICE_COMMENTLINE);
while (!sc.atLineEnd) {
sc.Forward();
}
}
static void ColouriseDelimiter(StyleContext& sc, bool& apostropheStartsAttribute) {
apostropheStartsAttribute = sc.Match (')');
sc.SetState(SCE_SPICE_DELIMITER);
sc.ForwardSetState(SCE_SPICE_DEFAULT);
}
static void ColouriseNumber(StyleContext& sc, bool& apostropheStartsAttribute) {
apostropheStartsAttribute = true;
SString number;
sc.SetState(SCE_SPICE_NUMBER);
// Get all characters up to a delimiter or a separator, including points, but excluding
// double points (ranges).
while (!IsSeparatorOrDelimiterCharacter(sc.ch) || (sc.ch == '.' && sc.chNext != '.')) {
number += static_cast<char>(sc.ch);
sc.Forward();
}
// Special case: exponent with sign
if ((sc.chPrev == 'e' || sc.chPrev == 'E') &&
(sc.ch == '+' || sc.ch == '-')) {
number += static_cast<char>(sc.ch);
sc.Forward ();
while (!IsSeparatorOrDelimiterCharacter(sc.ch)) {
number += static_cast<char>(sc.ch);
sc.Forward();
}
}
sc.SetState(SCE_SPICE_DEFAULT);
}
static void ColouriseWhiteSpace(StyleContext& sc, bool& ) {
sc.SetState(SCE_SPICE_DEFAULT);
sc.ForwardSetState(SCE_SPICE_DEFAULT);
}
static void ColouriseWord(StyleContext& sc, WordList& keywords, WordList& keywords2, WordList& keywords3, bool& apostropheStartsAttribute) {
apostropheStartsAttribute = true;
sc.SetState(SCE_SPICE_IDENTIFIER);
SString word;
while (!sc.atLineEnd && !IsSeparatorOrDelimiterCharacter(sc.ch)) {
word += static_cast<char>(tolower(sc.ch));
sc.Forward();
}
if (keywords.InList(word.c_str())) {
sc.ChangeState(SCE_SPICE_KEYWORD);
if (word != "all") {
apostropheStartsAttribute = false;
}
}
else if (keywords2.InList(word.c_str())) {
sc.ChangeState(SCE_SPICE_KEYWORD2);
if (word != "all") {
apostropheStartsAttribute = false;
}
}
else if (keywords3.InList(word.c_str())) {
sc.ChangeState(SCE_SPICE_KEYWORD3);
if (word != "all") {
apostropheStartsAttribute = false;
}
}
sc.SetState(SCE_SPICE_DEFAULT);
}
//
// ColouriseDocument
//
static void ColouriseDocument(
unsigned int startPos,
int length,
int initStyle,
WordList *keywordlists[],
Accessor &styler) {
WordList &keywords = *keywordlists[0];
WordList &keywords2 = *keywordlists[1];
WordList &keywords3 = *keywordlists[2];
StyleContext sc(startPos, length, initStyle, styler);
int lineCurrent = styler.GetLine(startPos);
bool apostropheStartsAttribute = (styler.GetLineState(lineCurrent) & 1) != 0;
while (sc.More()) {
if (sc.atLineEnd) {
// Go to the next line
sc.Forward();
lineCurrent++;
// Remember the line state for future incremental lexing
styler.SetLineState(lineCurrent, apostropheStartsAttribute);
// Don't continue any styles on the next line
sc.SetState(SCE_SPICE_DEFAULT);
}
// Comments
if ((sc.Match('*') && sc.atLineStart) || sc.Match('*','~')) {
ColouriseComment(sc, apostropheStartsAttribute);
// Whitespace
} else if (IsASpace(sc.ch)) {
ColouriseWhiteSpace(sc, apostropheStartsAttribute);
// Delimiters
} else if (IsDelimiterCharacter(sc.ch)) {
ColouriseDelimiter(sc, apostropheStartsAttribute);
// Numbers
} else if (IsADigit(sc.ch) || sc.ch == '#') {
ColouriseNumber(sc, apostropheStartsAttribute);
// Keywords or identifiers
} else {
ColouriseWord(sc, keywords, keywords2, keywords3, apostropheStartsAttribute);
}
}
sc.Complete();
}
static inline bool IsDelimiterCharacter(int ch) {
switch (ch) {
case '&':
case '\'':
case '(':
case ')':
case '*':
case '+':
case ',':
case '-':
case '.':
case '/':
case ':':
case ';':
case '<':
case '=':
case '>':
case '|':
return true;
default:
return false;
}
}
static inline bool IsNumberCharacter(int ch) {
return IsNumberStartCharacter(ch) ||
ch == '_' ||
ch == '.' ||
ch == '#' ||
(ch >= 'a' && ch <= 'f') ||
(ch >= 'A' && ch <= 'F');
}
static inline bool IsNumberStartCharacter(int ch) {
return IsADigit(ch);
}
static inline bool IsSeparatorOrDelimiterCharacter(int ch) {
return IsASpace(ch) || IsDelimiterCharacter(ch);
}
static inline bool IsWordCharacter(int ch) {
return IsWordStartCharacter(ch) || IsADigit(ch);
}
static inline bool IsWordStartCharacter(int ch) {
return (isascii(ch) && isalpha(ch)) || ch == '_';
}

View File

@@ -0,0 +1,362 @@
// Scintilla source code edit control
/** @file LexTCL.cxx
** Lexer for TCL language.
**/
// Copyright 1998-2001 by Andre Arpin <arpin@kingston.net>
// The License.txt file describes the conditions under which this software may be distributed.
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <stdarg.h>
#include <stdio.h>
#include "Platform.h"
#include "PropSet.h"
#include "Accessor.h"
#include "StyleContext.h"
#include "KeyWords.h"
#include "Scintilla.h"
#include "SciLexer.h"
// Extended to accept accented characters
static inline bool IsAWordChar(int ch) {
return ch >= 0x80 ||
(isalnum(ch) || ch == '_' || ch ==':' || ch=='.'); // : name space separator
}
static inline bool IsAWordStart(int ch) {
return ch >= 0x80 || (ch ==':' || isalpha(ch) || ch == '_');
}
static inline bool IsANumberChar(int ch) {
// Not exactly following number definition (several dots are seen as OK, etc.)
// but probably enough in most cases.
return (ch < 0x80) &&
(IsADigit(ch, 0x10) || toupper(ch) == 'E' ||
ch == '.' || ch == '-' || ch == '+');
}
static void ColouriseTCLDoc(unsigned int startPos, int length, int , WordList *keywordlists[], Accessor &styler) {
#define isComment(s) (s==SCE_TCL_COMMENT || s==SCE_TCL_COMMENTLINE || s==SCE_TCL_COMMENT_BOX || s==SCE_TCL_BLOCK_COMMENT)
bool foldComment = styler.GetPropertyInt("fold.comment") != 0;
bool commentLevel = false;
bool subBrace = false; // substitution begin with a brace ${.....}
enum tLineState {LS_DEFAULT, LS_OPEN_COMMENT, LS_OPEN_DOUBLE_QUOTE, LS_COMMENT_BOX, LS_MASK_STATE = 0xf,
LS_COMMAND_EXPECTED = 16, LS_BRACE_ONLY = 32 } lineState = LS_DEFAULT;
bool prevSlash = false;
int currentLevel = 0;
bool expected = 0;
bool subParen = 0;
int currentLine = styler.GetLine(startPos);
if (currentLine > 0)
currentLine--;
length += startPos - styler.LineStart(currentLine);
// make sure lines overlap
startPos = styler.LineStart(currentLine);
WordList &keywords = *keywordlists[0];
WordList &keywords2 = *keywordlists[1];
WordList &keywords3 = *keywordlists[2];
WordList &keywords4 = *keywordlists[3];
WordList &keywords5 = *keywordlists[4];
WordList &keywords6 = *keywordlists[5];
WordList &keywords7 = *keywordlists[6];
WordList &keywords8 = *keywordlists[7];
WordList &keywords9 = *keywordlists[8];
if (currentLine > 0) {
int ls = styler.GetLineState(currentLine - 1);
lineState = tLineState(ls & LS_MASK_STATE);
expected = LS_COMMAND_EXPECTED == tLineState(ls & LS_COMMAND_EXPECTED);
subBrace = LS_BRACE_ONLY == tLineState(ls & LS_BRACE_ONLY);
currentLevel = styler.LevelAt(currentLine - 1) >> 17;
commentLevel = (styler.LevelAt(currentLine - 1) >> 16) & 1;
} else
styler.SetLevel(0, SC_FOLDLEVELBASE | SC_FOLDLEVELHEADERFLAG);
bool visibleChars = false;
int previousLevel = currentLevel;
StyleContext sc(startPos, length, SCE_TCL_DEFAULT, styler);
for (; ; sc.Forward()) {
next:
if (sc.ch=='\r' && sc.chNext == '\n') // only ignore \r on PC process on the mac
continue;
bool atEnd = !sc.More(); // make sure we coloured the last word
if (lineState != LS_DEFAULT) {
sc.SetState(SCE_TCL_DEFAULT);
if (lineState == LS_OPEN_COMMENT)
sc.SetState(SCE_TCL_COMMENTLINE);
else if (lineState == LS_OPEN_DOUBLE_QUOTE)
sc.SetState(SCE_TCL_IN_QUOTE);
else if (lineState == LS_COMMENT_BOX && (sc.ch == '#' || (sc.ch == ' ' && sc.chNext=='#')))
sc.SetState(SCE_TCL_COMMENT_BOX);
lineState = LS_DEFAULT;
}
if (subBrace) { // ${ overrides every thing even \ except }
if (sc.ch == '}') {
subBrace = false;
sc.SetState(SCE_TCL_OPERATOR);
sc.ForwardSetState(SCE_TCL_DEFAULT);
goto next;
}
else
sc.SetState(SCE_TCL_SUB_BRACE);
if (!sc.atLineEnd)
continue;
} else if (sc.state == SCE_TCL_DEFAULT || sc.state ==SCE_TCL_OPERATOR) {
expected &= isspacechar(static_cast<unsigned char>(sc.ch)) || IsAWordStart(sc.ch) || sc.ch =='#';
} else if (sc.state == SCE_TCL_SUBSTITUTION) {
switch(sc.ch) {
case '(':
subParen=true;
sc.SetState(SCE_TCL_OPERATOR);
sc.ForwardSetState(SCE_TCL_SUBSTITUTION);
continue;
case ')':
sc.SetState(SCE_TCL_OPERATOR);
subParen=false;
continue;
case '$':
continue;
case ',':
sc.SetState(SCE_TCL_OPERATOR);
if (subParen)
sc.ForwardSetState(SCE_TCL_SUBSTITUTION);
continue;
default :
// maybe spaces should be allowed ???
if (!IsAWordChar(sc.ch)) { // probably the code is wrong
sc.SetState(SCE_TCL_DEFAULT);
subParen = 0;
}
break;
}
} else if (isComment(sc.state)) {
} else if (!IsAWordChar(sc.ch)) {
if ((sc.state == SCE_TCL_IDENTIFIER && expected) || sc.state == SCE_TCL_MODIFIER) {
char w[100];
char *s=w;
sc.GetCurrent(w, sizeof(w));
if (w[strlen(w)-1]=='\r')
w[strlen(w)-1]=0;
while(*s == ':') // ignore leading : like in ::set a 10
++s;
bool quote = sc.state == SCE_TCL_IN_QUOTE;
if (commentLevel || expected) {
if (keywords.InList(s)) {
sc.ChangeState(quote ? SCE_TCL_WORD_IN_QUOTE : SCE_TCL_WORD);
} else if (keywords2.InList(s)) {
sc.ChangeState(quote ? SCE_TCL_WORD_IN_QUOTE : SCE_TCL_WORD2);
} else if (keywords3.InList(s)) {
sc.ChangeState(quote ? SCE_TCL_WORD_IN_QUOTE : SCE_TCL_WORD3);
} else if (keywords4.InList(s)) {
sc.ChangeState(quote ? SCE_TCL_WORD_IN_QUOTE : SCE_TCL_WORD4);
} else if (sc.GetRelative(-static_cast<int>(strlen(s))-1) == '{' &&
keywords5.InList(s) && sc.ch == '}') { // {keyword} exactly no spaces
sc.ChangeState(SCE_TCL_EXPAND);
}
if (keywords6.InList(s)) {
sc.ChangeState(SCE_TCL_WORD5);
} else if (keywords7.InList(s)) {
sc.ChangeState(SCE_TCL_WORD6);
} else if (keywords8.InList(s)) {
sc.ChangeState(SCE_TCL_WORD7);
} else if (keywords9.InList(s)) {
sc.ChangeState(SCE_TCL_WORD8);
}
}
expected = false;
sc.SetState(quote ? SCE_TCL_IN_QUOTE : SCE_TCL_DEFAULT);
} else if (sc.state == SCE_TCL_MODIFIER || sc.state == SCE_TCL_IDENTIFIER) {
sc.SetState(SCE_TCL_DEFAULT);
}
}
if (atEnd)
break;
if (sc.atLineEnd) {
lineState = LS_DEFAULT;
currentLine = styler.GetLine(sc.currentPos);
if (foldComment && sc.state!=SCE_TCL_COMMENT && isComment(sc.state)) {
if (currentLevel == 0) {
++currentLevel;
commentLevel = true;
}
} else {
if (visibleChars && commentLevel) {
--currentLevel;
--previousLevel;
commentLevel = false;
}
}
int flag = 0;
if (!visibleChars)
flag = SC_FOLDLEVELWHITEFLAG;
if (currentLevel > previousLevel)
flag = SC_FOLDLEVELHEADERFLAG;
styler.SetLevel(currentLine, flag + previousLevel + SC_FOLDLEVELBASE + (currentLevel << 17) + (commentLevel << 16));
// Update the line state, so it can be seen by next line
if (sc.state == SCE_TCL_IN_QUOTE)
lineState = LS_OPEN_DOUBLE_QUOTE;
else {
if (prevSlash) {
if (isComment(sc.state))
lineState = LS_OPEN_COMMENT;
} else if (sc.state == SCE_TCL_COMMENT_BOX)
lineState = LS_COMMENT_BOX;
}
styler.SetLineState(currentLine,
(subBrace ? LS_BRACE_ONLY : 0) |
(expected ? LS_COMMAND_EXPECTED : 0) | lineState);
if (lineState == LS_COMMENT_BOX)
sc.ForwardSetState(SCE_TCL_COMMENT_BOX);
else if (lineState == LS_OPEN_DOUBLE_QUOTE)
sc.ForwardSetState(SCE_TCL_IN_QUOTE);
else
sc.ForwardSetState(SCE_TCL_DEFAULT);
prevSlash = false;
previousLevel = currentLevel;
goto next;
}
if (prevSlash) {
prevSlash = false;
if (sc.ch == '#' && IsANumberChar(sc.chNext))
sc.ForwardSetState(SCE_TCL_NUMBER);
continue;
}
prevSlash = sc.ch == '\\';
if (isComment(sc.state))
continue;
if (sc.atLineStart) {
visibleChars = false;
if (sc.state!=SCE_TCL_IN_QUOTE && !isComment(sc.state))
{
sc.SetState(SCE_TCL_DEFAULT);
expected = IsAWordStart(sc.ch)|| isspacechar(static_cast<unsigned char>(sc.ch));
}
}
switch (sc.state) {
case SCE_TCL_NUMBER:
if (!IsANumberChar(sc.ch))
sc.SetState(SCE_TCL_DEFAULT);
break;
case SCE_TCL_IN_QUOTE:
if (sc.ch == '"') {
sc.ForwardSetState(SCE_TCL_DEFAULT);
visibleChars = true; // necessary if a " is the first and only character on a line
goto next;
} else if (sc.ch == '[' || sc.ch == ']' || sc.ch == '$') {
sc.SetState(SCE_TCL_OPERATOR);
expected = sc.ch == '[';
sc.ForwardSetState(SCE_TCL_IN_QUOTE);
goto next;
}
continue;
case SCE_TCL_OPERATOR:
sc.SetState(SCE_TCL_DEFAULT);
break;
}
if (sc.ch == '#') {
if (visibleChars) {
if (sc.state != SCE_TCL_IN_QUOTE && expected)
sc.SetState(SCE_TCL_COMMENT);
} else {
sc.SetState(SCE_TCL_COMMENTLINE);
if (sc.chNext == '~')
sc.SetState(SCE_TCL_BLOCK_COMMENT);
if (sc.atLineStart && (sc.chNext == '#' || sc.chNext == '-'))
sc.SetState(SCE_TCL_COMMENT_BOX);
}
}
if (!isspacechar(static_cast<unsigned char>(sc.ch))) {
visibleChars = true;
}
if (sc.ch == '\\') {
prevSlash = true;
continue;
}
// Determine if a new state should be entered.
if (sc.state == SCE_TCL_DEFAULT) {
if (IsAWordStart(sc.ch)) {
sc.SetState(SCE_TCL_IDENTIFIER);
} else if (IsADigit(sc.ch) && !IsAWordChar(sc.chPrev)) {
sc.SetState(SCE_TCL_NUMBER);
} else {
switch (sc.ch) {
case '\"':
sc.SetState(SCE_TCL_IN_QUOTE);
break;
case '{':
sc.SetState(SCE_TCL_OPERATOR);
expected = true;
++currentLevel;
break;
case '}':
sc.SetState(SCE_TCL_OPERATOR);
--currentLevel;
break;
case '[':
expected = true;
case ']':
case '(':
case ')':
sc.SetState(SCE_TCL_OPERATOR);
break;
case ';':
expected = true;
break;
case '$':
subParen = 0;
if (sc.chNext != '{') {
sc.SetState(SCE_TCL_SUBSTITUTION);
}
else {
sc.SetState(SCE_TCL_OPERATOR); // $
sc.Forward(); // {
sc.ForwardSetState(SCE_TCL_SUB_BRACE);
subBrace = true;
}
break;
case '#':
if ((isspacechar(static_cast<unsigned char>(sc.chPrev))||
isoperator(static_cast<char>(sc.chPrev))) && IsADigit(sc.chNext,0x10))
sc.SetState(SCE_TCL_NUMBER);
break;
case '-':
sc.SetState(IsADigit(sc.chNext)? SCE_TCL_NUMBER: SCE_TCL_MODIFIER);
break;
default:
if (isoperator(static_cast<char>(sc.ch))) {
sc.SetState(SCE_TCL_OPERATOR);
}
}
}
}
}
sc.Complete();
}
static const char * const tclWordListDesc[] = {
"TCL Keywords",
"TK Keywords",
"iTCL Keywords",
"tkCommands",
"expand"
"user1",
"user2",
"user3",
"user4",
0
};
// this code supports folding in the colourizer
LexerModule lmTCL(SCLEX_TCL, ColouriseTCLDoc, "tcl", 0, tclWordListDesc);

View File

@@ -15,11 +15,13 @@ public:
int markType; int markType;
ColourPair fore; ColourPair fore;
ColourPair back; ColourPair back;
int alpha;
XPM *pxpm; XPM *pxpm;
LineMarker() { LineMarker() {
markType = SC_MARK_CIRCLE; markType = SC_MARK_CIRCLE;
fore = ColourDesired(0,0,0); fore = ColourDesired(0,0,0);
back = ColourDesired(0xff,0xff,0xff); back = ColourDesired(0xff,0xff,0xff);
alpha = SC_ALPHA_NOALPHA;
pxpm = NULL; pxpm = NULL;
} }
LineMarker(const LineMarker &) { LineMarker(const LineMarker &) {
@@ -27,6 +29,7 @@ public:
markType = SC_MARK_CIRCLE; markType = SC_MARK_CIRCLE;
fore = ColourDesired(0,0,0); fore = ColourDesired(0,0,0);
back = ColourDesired(0xff,0xff,0xff); back = ColourDesired(0xff,0xff,0xff);
alpha = SC_ALPHA_NOALPHA;
pxpm = NULL; pxpm = NULL;
} }
~LineMarker() { ~LineMarker() {
@@ -37,6 +40,7 @@ public:
markType = SC_MARK_CIRCLE; markType = SC_MARK_CIRCLE;
fore = ColourDesired(0,0,0); fore = ColourDesired(0,0,0);
back = ColourDesired(0xff,0xff,0xff); back = ColourDesired(0xff,0xff,0xff);
alpha = SC_ALPHA_NOALPHA;
delete pxpm; delete pxpm;
pxpm = NULL; pxpm = NULL;
return *this; return *this;

View File

@@ -4,7 +4,7 @@
**/ **/
/* /*
* regex - Regular expression pattern matching and replacement * regex - Regular expression pattern matching and replacement
* *
* By: Ozan S. Yigit (oz) * By: Ozan S. Yigit (oz)
* Dept. of Computer Science * Dept. of Computer Science
@@ -15,7 +15,7 @@
* Removed all use of register. * Removed all use of register.
* Converted to modern function prototypes. * Converted to modern function prototypes.
* Put all global/static variables into an object so this code can be * Put all global/static variables into an object so this code can be
* used from multiple threads etc. * used from multiple threads, etc.
* *
* These routines are the PUBLIC DOMAIN equivalents of regex * These routines are the PUBLIC DOMAIN equivalents of regex
* routines as found in 4.nBSD UN*X, with minor extensions. * routines as found in 4.nBSD UN*X, with minor extensions.
@@ -30,64 +30,62 @@
* Modification history removed. * Modification history removed.
* *
* Interfaces: * Interfaces:
* RESearch::Compile: compile a regular expression into a NFA. * RESearch::Compile: compile a regular expression into a NFA.
* *
* char *RESearch::Compile(s) * const char *RESearch::Compile(const char *pat, int length,
* char *s; * bool caseSensitive, bool posix)
* *
* RESearch::Execute: execute the NFA to match a pattern. * Returns a short error string if they fail.
* *
* int RESearch::Execute(s) * RESearch::Execute: execute the NFA to match a pattern.
* char *s;
* *
* RESearch::ModifyWord change RESearch::Execute's understanding of what a "word" * int RESearch::Execute(characterIndexer &ci, int lp, int endp)
* looks like (for \< and \>) by adding into the
* hidden word-syntax table.
* *
* void RESearch::ModifyWord(s) * RESearch::Substitute: substitute the matched portions in a new string.
* char *s;
* *
* RESearch::Substitute: substitute the matched portions in a new string. * int RESearch::Substitute(CharacterIndexer &ci, char *src, char *dst)
* *
* int RESearch::Substitute(src, dst) * re_fail: failure routine for RESearch::Execute. (no longer used)
* char *src;
* char *dst;
* *
* re_fail: failure routine for RESearch::Execute. * void re_fail(char *msg, char op)
*
* void re_fail(msg, op)
* char *msg;
* char op;
* *
* Regular Expressions: * Regular Expressions:
* *
* [1] char matches itself, unless it is a special * [1] char matches itself, unless it is a special
* character (metachar): . \ [ ] * + ^ $ * character (metachar): . \ [ ] * + ^ $
* and ( ) if posix option.
* *
* [2] . matches any character. * [2] . matches any character.
* *
* [3] \ matches the character following it, except * [3] \ matches the character following it, except:
* when followed by a left or right round bracket, * - \a, \b, \f, \n, \t, \v match the
* a digit 1 to 9 or a left or right angle bracket. * corresponding C escape char;
* (see [7], [8] and [9]) * - if not in posix mode, when followed by a
* It is used as an escape character for all * left or right round bracket (see [7]);
* other meta-characters, and itself. When used * - when followed by a digit 1 to 9 (see [8]);
* in a set ([4]), it is treated as an ordinary * - when followed by a left or right angle bracket
* character. * (see [9]).
* It is used as an escape character for all
* other meta-characters, and itself. When used
* in a set ([4]), it is treated as an ordinary
* character (except for escape chars).
* *
* [4] [set] matches one of the characters in the set. * [4] [set] matches one of the characters in the set.
* If the first character in the set is "^", * If the first character in the set is "^",
* it matches a character NOT in the set, i.e. * it matches a character NOT in the set, i.e.
* complements the set. A shorthand S-E is * complements the set. A shorthand S-E (start-end)
* used to specify a set of characters S upto * is used to specify a set of characters S upto
* E, inclusive. The special characters "]" and * E, inclusive. The special characters "]" and
* "-" have no special meaning if they appear * "-" have no special meaning if they appear
* as the first chars in the set. * as the first chars in the set. To include both,
* put - first: [-]A-Z]:
* [-]|] matches these 2 chars,
* []-|] matches from ] to | chars.
* examples: match: * examples: match:
* *
* [a-z] any lowercase alpha * [a-z] any lowercase alpha
* *
* [^]-] any char except ] and - * [^-]] any char except - and ]
* *
* [^A-Z] any char except uppercase * [^A-Z] any char except uppercase
* alpha * alpha
@@ -101,81 +99,87 @@
* [6] + same as [5], except it matches one or more. * [6] + same as [5], except it matches one or more.
* *
* [7] a regular expression in the form [1] to [10], enclosed * [7] a regular expression in the form [1] to [10], enclosed
* as \(form\) matches what form matches. The enclosure * as \(form\) (or (form) with posix flag) matches what
* creates a set of tags, used for [8] and for * form matches. The enclosure creates a set of tags,
* pattern substution. The tagged forms are numbered * used for [8] and for pattern substitution.
* starting from 1. * The tagged forms are numbered starting from 1.
* *
* [8] a \ followed by a digit 1 to 9 matches whatever a * [8] a \ followed by a digit 1 to 9 matches whatever a
* previously tagged regular expression ([7]) matched. * previously tagged regular expression ([7]) matched.
* *
* [9] \< a regular expression starting with a \< construct * [9] \< a regular expression starting with a \< construct
* \> and/or ending with a \> construct, restricts the * \> and/or ending with a \> construct, restricts the
* pattern matching to the beginning of a word, and/or * pattern matching to the beginning of a word, and/or
* the end of a word. A word is defined to be a character * the end of a word. A word is defined to be a character
* string beginning and/or ending with the characters * string beginning and/or ending with the characters
* A-Z a-z 0-9 and _. It must also be preceded and/or * A-Z a-z 0-9 and _. It must also be preceded and/or
* followed by any character outside those mentioned. * followed by any character outside those mentioned.
* *
* [10] a composite regular expression xy where x and y * [10] a composite regular expression xy where x and y
* are in the form [1] to [10] matches the longest * are in the form [1] to [10] matches the longest
* match of x followed by a match for y. * match of x followed by a match for y.
* *
* [11] ^ a regular expression starting with a ^ character * [11] ^ a regular expression starting with a ^ character
* $ and/or ending with a $ character, restricts the * $ and/or ending with a $ character, restricts the
* pattern matching to the beginning of the line, * pattern matching to the beginning of the line,
* or the end of line. [anchors] Elsewhere in the * or the end of line. [anchors] Elsewhere in the
* pattern, ^ and $ are treated as ordinary characters. * pattern, ^ and $ are treated as ordinary characters.
* *
* *
* Acknowledgements: * Acknowledgements:
* *
* HCR's Hugh Redelmeier has been most helpful in various * HCR's Hugh Redelmeier has been most helpful in various
* stages of development. He convinced me to include BOW * stages of development. He convinced me to include BOW
* and EOW constructs, originally invented by Rob Pike at * and EOW constructs, originally invented by Rob Pike at
* the University of Toronto. * the University of Toronto.
* *
* References: * References:
* Software tools Kernighan & Plauger * Software tools Kernighan & Plauger
* Software tools in Pascal Kernighan & Plauger * Software tools in Pascal Kernighan & Plauger
* Grep [rsx-11 C dist] David Conroy * Grep [rsx-11 C dist] David Conroy
* ed - text editor Un*x Programmer's Manual * ed - text editor Un*x Programmer's Manual
* Advanced editing on Un*x B. W. Kernighan * Advanced editing on Un*x B. W. Kernighan
* RegExp routines Henry Spencer * RegExp routines Henry Spencer
* *
* Notes: * Notes:
* *
* This implementation uses a bit-set representation for character * This implementation uses a bit-set representation for character
* classes for speed and compactness. Each character is represented * classes for speed and compactness. Each character is represented
* by one bit in a 128-bit block. Thus, CCL always takes a * by one bit in a 256-bit block. Thus, CCL always takes a
* constant 16 bytes in the internal nfa, and RESearch::Execute does a single * constant 32 bytes in the internal nfa, and RESearch::Execute does a single
* bit comparison to locate the character in the set. * bit comparison to locate the character in the set.
* *
* Examples: * Examples:
* *
* pattern: foo*.* * pattern: foo*.*
* compile: CHR f CHR o CLO CHR o END CLO ANY END END * compile: CHR f CHR o CLO CHR o END CLO ANY END END
* matches: fo foo fooo foobar fobar foxx ... * matches: fo foo fooo foobar fobar foxx ...
* *
* pattern: fo[ob]a[rz] * pattern: fo[ob]a[rz]
* compile: CHR f CHR o CCL bitset CHR a CCL bitset END * compile: CHR f CHR o CCL bitset CHR a CCL bitset END
* matches: fobar fooar fobaz fooaz * matches: fobar fooar fobaz fooaz
* *
* pattern: foo\\+ * pattern: foo\\+
* compile: CHR f CHR o CHR o CHR \ CLO CHR \ END END * compile: CHR f CHR o CHR o CHR \ CLO CHR \ END END
* matches: foo\ foo\\ foo\\\ ... * matches: foo\ foo\\ foo\\\ ...
* *
* pattern: \(foo\)[1-3]\1 (same as foo[1-3]foo) * pattern: \(foo\)[1-3]\1 (same as foo[1-3]foo)
* compile: BOT 1 CHR f CHR o CHR o EOT 1 CCL bitset REF 1 END * compile: BOT 1 CHR f CHR o CHR o EOT 1 CCL bitset REF 1 END
* matches: foo1foo foo2foo foo3foo * matches: foo1foo foo2foo foo3foo
* *
* pattern: \(fo.*\)-\1 * pattern: \(fo.*\)-\1
* compile: BOT 1 CHR f CHR o CLO ANY END EOT 1 CHR - REF 1 END * compile: BOT 1 CHR f CHR o CLO ANY END EOT 1 CHR - REF 1 END
* matches: foo-foo fo-fo fob-fob foobar-foobar ... * matches: foo-foo fo-fo fob-fob foobar-foobar ...
*/ */
#include "CharClassify.h"
#include "RESearch.h" #include "RESearch.h"
// Shut up annoying Visual C++ warnings:
#ifdef _MSC_VER
#pragma warning(disable: 4514)
#endif
#define OKP 1 #define OKP 1
#define NOP 0 #define NOP 0
@@ -186,8 +190,8 @@
#define EOL 5 #define EOL 5
#define BOT 6 #define BOT 6
#define EOT 7 #define EOT 7
#define BOW 8 #define BOW 8
#define EOW 9 #define EOW 9
#define REF 10 #define REF 10
#define CLO 11 #define CLO 11
@@ -197,16 +201,22 @@
* The following defines are not meant to be changeable. * The following defines are not meant to be changeable.
* They are for readability only. * They are for readability only.
*/ */
#define BLKIND 0370 #define BLKIND 0370
#define BITIND 07 #define BITIND 07
#define ASCIIB 0177
const char bitarr[] = {1,2,4,8,16,32,64,'\200'}; const char bitarr[] = {1,2,4,8,16,32,64,'\200'};
#define badpat(x) (*nfa = END, x) #define badpat(x) (*nfa = END, x)
RESearch::RESearch() { /*
* Character classification table for word boundary operators BOW
* and EOW is passed in by the creator of this object (Scintilla
* Document). The Document default state is that word chars are:
* 0-9,a-z, A-Z and _
*/
RESearch::RESearch(CharClassify *charClassTable) {
charClass = charClassTable;
Init(); Init();
} }
@@ -215,7 +225,7 @@ RESearch::~RESearch() {
} }
void RESearch::Init() { void RESearch::Init() {
sta = NOP; /* status of lastpat */ sta = NOP; /* status of lastpat */
bol = 0; bol = 0;
for (int i=0; i<MAXTAG; i++) for (int i=0; i<MAXTAG; i++)
pat[i] = 0; pat[i] = 0;
@@ -285,15 +295,15 @@ const char escapeValue(char ch) {
const char *RESearch::Compile(const char *pat, int length, bool caseSensitive, bool posix) { const char *RESearch::Compile(const char *pat, int length, bool caseSensitive, bool posix) {
char *mp=nfa; /* nfa pointer */ char *mp=nfa; /* nfa pointer */
char *lp; /* saved pointer.. */ char *lp; /* saved pointer */
char *sp=nfa; /* another one.. */ char *sp=nfa; /* another one */
char *mpMax = mp + MAXNFA - BITBLK - 10; char *mpMax = mp + MAXNFA - BITBLK - 10;
int tagi = 0; /* tag stack index */ int tagi = 0; /* tag stack index */
int tagc = 1; /* actual tag count */ int tagc = 1; /* actual tag count */
int n; int n;
char mask; /* xor mask -CCL/NCL */ char mask; /* xor mask -CCL/NCL */
int c1, c2; int c1, c2;
if (!pat || !length) if (!pat || !length)
@@ -303,18 +313,18 @@ const char *RESearch::Compile(const char *pat, int length, bool caseSensitive, b
return badpat("No previous regular expression"); return badpat("No previous regular expression");
sta = NOP; sta = NOP;
const char *p=pat; /* pattern pointer */ const char *p=pat; /* pattern pointer */
for (int i=0; i<length; i++, p++) { for (int i=0; i<length; i++, p++) {
if (mp > mpMax) if (mp > mpMax)
return badpat("Pattern too long"); return badpat("Pattern too long");
lp = mp; lp = mp;
switch(*p) { switch(*p) {
case '.': /* match any char.. */ case '.': /* match any char */
*mp++ = ANY; *mp++ = ANY;
break; break;
case '^': /* match beginning.. */ case '^': /* match beginning */
if (p == pat) if (p == pat)
*mp++ = BOL; *mp++ = BOL;
else { else {
@@ -323,7 +333,7 @@ const char *RESearch::Compile(const char *pat, int length, bool caseSensitive, b
} }
break; break;
case '$': /* match endofline.. */ case '$': /* match endofline */
if (!*(p+1)) if (!*(p+1))
*mp++ = EOL; *mp++ = EOL;
else { else {
@@ -332,7 +342,7 @@ const char *RESearch::Compile(const char *pat, int length, bool caseSensitive, b
} }
break; break;
case '[': /* match char class..*/ case '[': /* match char class */
*mp++ = CCL; *mp++ = CCL;
i++; i++;
@@ -343,7 +353,7 @@ const char *RESearch::Compile(const char *pat, int length, bool caseSensitive, b
} else } else
mask = 0; mask = 0;
if (*p == '-') { /* real dash */ if (*p == '-') { /* real dash */
i++; i++;
ChSet(*p++); ChSet(*p++);
} }
@@ -384,12 +394,12 @@ const char *RESearch::Compile(const char *pat, int length, bool caseSensitive, b
break; break;
case '*': /* match 0 or more.. */ case '*': /* match 0 or more... */
case '+': /* match 1 or more.. */ case '+': /* match 1 or more... */
if (p == pat) if (p == pat)
return badpat("Empty closure"); return badpat("Empty closure");
lp = sp; /* previous opcode */ lp = sp; /* previous opcode */
if (*lp == CLO) /* equivalence.. */ if (*lp == CLO) /* equivalence... */
break; break;
switch(*lp) { switch(*lp) {
@@ -417,7 +427,7 @@ const char *RESearch::Compile(const char *pat, int length, bool caseSensitive, b
mp = sp; mp = sp;
break; break;
case '\\': /* tags, backrefs .. */ case '\\': /* tags, backrefs... */
i++; i++;
switch(*++p) { switch(*++p) {
@@ -483,7 +493,7 @@ const char *RESearch::Compile(const char *pat, int length, bool caseSensitive, b
} }
break; break;
default : /* an ordinary char */ default : /* an ordinary char */
if (posix && *p == '(') { if (posix && *p == '(') {
if (tagc < MAXTAG) { if (tagc < MAXTAG) {
tagstk[++tagi] = tagc; tagstk[++tagi] = tagc;
@@ -524,23 +534,23 @@ const char *RESearch::Compile(const char *pat, int length, bool caseSensitive, b
/* /*
* RESearch::Execute: * RESearch::Execute:
* execute nfa to find a match. * execute nfa to find a match.
* *
* special cases: (nfa[0]) * special cases: (nfa[0])
* BOL * BOL
* Match only once, starting from the * Match only once, starting from the
* beginning. * beginning.
* CHR * CHR
* First locate the character without * First locate the character without
* calling PMatch, and if found, call * calling PMatch, and if found, call
* PMatch for the remaining string. * PMatch for the remaining string.
* END * END
* RESearch::Compile failed, poor luser did not * RESearch::Compile failed, poor luser did not
* check for it. Fail fast. * check for it. Fail fast.
* *
* If a match is found, bopat[0] and eopat[0] are set * If a match is found, bopat[0] and eopat[0] are set
* to the beginning and the end of the matched fragment, * to the beginning and the end of the matched fragment,
* respectively. * respectively.
* *
*/ */
@@ -571,7 +581,7 @@ int RESearch::Execute(CharacterIndexer &ci, int lp, int endp) {
c = *(ap+1); c = *(ap+1);
while ((lp < endp) && (ci.CharAt(lp) != c)) while ((lp < endp) && (ci.CharAt(lp) != c))
lp++; lp++;
if (lp >= endp) /* if EOS, fail, else fall thru. */ if (lp >= endp) /* if EOS, fail, else fall thru. */
return 0; return 0;
default: /* regular matching all the way. */ default: /* regular matching all the way. */
while (lp < endp) { while (lp < endp) {
@@ -595,78 +605,50 @@ int RESearch::Execute(CharacterIndexer &ci, int lp, int endp) {
/* /*
* PMatch: internal routine for the hard part * PMatch: internal routine for the hard part
* *
* This code is partly snarfed from an early grep written by * This code is partly snarfed from an early grep written by
* David Conroy. The backref and tag stuff, and various other * David Conroy. The backref and tag stuff, and various other
* innovations are by oz. * innovations are by oz.
* *
* special case optimizations: (nfa[n], nfa[n+1]) * special case optimizations: (nfa[n], nfa[n+1])
* CLO ANY * CLO ANY
* We KNOW .* will match everything upto the * We KNOW .* will match everything upto the
* end of line. Thus, directly go to the end of * end of line. Thus, directly go to the end of
* line, without recursive PMatch calls. As in * line, without recursive PMatch calls. As in
* the other closure cases, the remaining pattern * the other closure cases, the remaining pattern
* must be matched by moving backwards on the * must be matched by moving backwards on the
* string recursively, to find a match for xy * string recursively, to find a match for xy
* (x is ".*" and y is the remaining pattern) * (x is ".*" and y is the remaining pattern)
* where the match satisfies the LONGEST match for * where the match satisfies the LONGEST match for
* x followed by a match for y. * x followed by a match for y.
* CLO CHR * CLO CHR
* We can again scan the string forward for the * We can again scan the string forward for the
* single char and at the point of failure, we * single char and at the point of failure, we
* execute the remaining nfa recursively, same as * execute the remaining nfa recursively, same as
* above. * above.
*
* At the end of a successful match, bopat[n] and eopat[n]
* are set to the beginning and end of subpatterns matched
* by tagged expressions (n = 1 to 9).
* *
* At the end of a successful match, bopat[n] and eopat[n]
* are set to the beginning and end of subpatterns matched
* by tagged expressions (n = 1 to 9).
*/ */
extern void re_fail(char *,char); extern void re_fail(char *,char);
/* #define isinset(x,y) ((x)[((y)&BLKIND)>>3] & bitarr[(y)&BITIND])
* character classification table for word boundary operators BOW
* and EOW. the reason for not using ctype macros is that we can
* let the user add into our own table. see RESearch::ModifyWord. This table
* is not in the bitset form, since we may wish to extend it in the
* future for other character classifications.
*
* TRUE for 0-9 A-Z a-z _
*/
static char chrtyp[MAXCHR] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 0, 0,
0, 0, 0, 0, 0, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 0, 0, 0, 0, 1, 0, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 0, 0, 0, 0, 0
};
#define inascii(x) (0177&(x))
#define iswordc(x) chrtyp[inascii(x)]
#define isinset(x,y) ((x)[((y)&BLKIND)>>3] & bitarr[(y)&BITIND])
/* /*
* skip values for CLO XXX to skip past the closure * skip values for CLO XXX to skip past the closure
*/ */
#define ANYSKIP 2 /* [CLO] ANY END ... */ #define ANYSKIP 2 /* [CLO] ANY END */
#define CHRSKIP 3 /* [CLO] CHR chr END ... */ #define CHRSKIP 3 /* [CLO] CHR chr END */
#define CCLSKIP 34 /* [CLO] CCL 32bytes END ... */ #define CCLSKIP 34 /* [CLO] CCL 32 bytes END */
int RESearch::PMatch(CharacterIndexer &ci, int lp, int endp, char *ap) { int RESearch::PMatch(CharacterIndexer &ci, int lp, int endp, char *ap) {
int op, c, n; int op, c, n;
int e; /* extra pointer for CLO */ int e; /* extra pointer for CLO */
int bp; /* beginning of subpat.. */ int bp; /* beginning of subpat... */
int ep; /* ending of subpat.. */ int ep; /* ending of subpat... */
int are; /* to save the line ptr. */ int are; /* to save the line ptr. */
while ((op = *ap++) != END) while ((op = *ap++) != END)
switch(op) { switch(op) {
@@ -756,44 +738,15 @@ int RESearch::PMatch(CharacterIndexer &ci, int lp, int endp, char *ap) {
return lp; return lp;
} }
/*
* RESearch::ModifyWord:
* add new characters into the word table to change RESearch::Execute's
* understanding of what a word should look like. Note that we
* only accept additions into the word definition.
*
* If the string parameter is 0 or null string, the table is
* reset back to the default containing A-Z a-z 0-9 _. [We use
* the compact bitset representation for the default table]
*/
static char deftab[16] = {
0, 0, 0, 0, 0, 0, '\377', 003, '\376', '\377', '\377', '\207',
'\376', '\377', '\377', 007
};
void RESearch::ModifyWord(char *s) {
int i;
if (!s || !*s) {
for (i = 0; i < MAXCHR; i++)
if (!isinset(deftab,i))
iswordc(i) = 0;
}
else
while(*s)
iswordc(*s++) = 1;
}
/* /*
* RESearch::Substitute: * RESearch::Substitute:
* substitute the matched portions of the src in dst. * substitute the matched portions of the src in dst.
* *
* & substitute the entire matched pattern. * & substitute the entire matched pattern.
* *
* \digit substitute a subpattern, with the given tag number. * \digit substitute a subpattern, with the given tag number.
* Tags are numbered from 1 to 9. If the particular * Tags are numbered from 1 to 9. If the particular
* tagged subpattern does not exist, null is substituted. * tagged subpattern does not exist, null is substituted.
*/ */
int RESearch::Substitute(CharacterIndexer &ci, char *src, char *dst) { int RESearch::Substitute(CharacterIndexer &ci, char *src, char *dst) {
char c; char c;

View File

@@ -27,16 +27,11 @@ public:
class RESearch { class RESearch {
public: public:
RESearch(); RESearch(CharClassify *charClassTable);
~RESearch(); ~RESearch();
void Init();
void Clear();
bool GrabMatches(CharacterIndexer &ci); bool GrabMatches(CharacterIndexer &ci);
void ChSet(char c);
void ChSetWithCase(char c, bool caseSensitive);
const char *Compile(const char *pat, int length, bool caseSensitive, bool posix); const char *Compile(const char *pat, int length, bool caseSensitive, bool posix);
int Execute(CharacterIndexer &ci, int lp, int endp); int Execute(CharacterIndexer &ci, int lp, int endp);
void ModifyWord(char *s);
int Substitute(CharacterIndexer &ci, char *src, char *dst); int Substitute(CharacterIndexer &ci, char *src, char *dst);
enum {MAXTAG=10}; enum {MAXTAG=10};
@@ -48,15 +43,23 @@ public:
char *pat[MAXTAG]; char *pat[MAXTAG];
private: private:
void Init();
void Clear();
void ChSet(char c);
void ChSetWithCase(char c, bool caseSensitive);
int PMatch(CharacterIndexer &ci, int lp, int endp, char *ap); int PMatch(CharacterIndexer &ci, int lp, int endp, char *ap);
int bol; int bol;
int tagstk[MAXTAG]; /* subpat tag stack..*/ int tagstk[MAXTAG]; /* subpat tag stack */
char nfa[MAXNFA]; /* automaton.. */ char nfa[MAXNFA]; /* automaton */
int sta; int sta;
char bittab[BITBLK]; /* bit table for CCL */ char bittab[BITBLK]; /* bit table for CCL pre-set bits */
/* pre-set bits... */
int failure; int failure;
CharClassify *charClass;
bool iswordc(unsigned char x) {
return charClass->IsWord(x);
}
}; };
#endif #endif

View File

@@ -31,6 +31,7 @@
#include "Style.h" #include "Style.h"
#include "ViewStyle.h" #include "ViewStyle.h"
#include "AutoComplete.h" #include "AutoComplete.h"
#include "CharClassify.h"
#include "Document.h" #include "Document.h"
#include "Editor.h" #include "Editor.h"
#include "ScintillaBase.h" #include "ScintillaBase.h"
@@ -368,12 +369,19 @@ int ScintillaBase::AutoCompleteGetCurrent() {
void ScintillaBase::CallTipShow(Point pt, const char *defn) { void ScintillaBase::CallTipShow(Point pt, const char *defn) {
AutoCompleteCancel(); AutoCompleteCancel();
pt.y += vs.lineHeight; pt.y += vs.lineHeight;
// If container knows about STYLE_CALLTIP then use it in place of the
// STYLE_DEFAULT for the face name, size and character set. Also use it
// for the foreground and background colour.
int ctStyle = ct.UseStyleCallTip() ? STYLE_CALLTIP : STYLE_DEFAULT;
if (ct.UseStyleCallTip()) {
ct.SetForeBack(vs.styles[STYLE_CALLTIP].fore, vs.styles[STYLE_CALLTIP].back);
}
PRectangle rc = ct.CallTipStart(currentPos, pt, PRectangle rc = ct.CallTipStart(currentPos, pt,
defn, defn,
vs.styles[STYLE_DEFAULT].fontName, vs.styles[ctStyle].fontName,
vs.styles[STYLE_DEFAULT].sizeZoomed, vs.styles[ctStyle].sizeZoomed,
CodePage(), CodePage(),
vs.styles[STYLE_DEFAULT].characterSet, vs.styles[ctStyle].characterSet,
wMain); wMain);
// If the call-tip window would be out of the client // If the call-tip window would be out of the client
// space, adjust so it displays above the text. // space, adjust so it displays above the text.
@@ -461,7 +469,7 @@ void ScintillaBase::Colourise(int start, int end) {
int styleStart = 0; int styleStart = 0;
if (start > 0) if (start > 0)
styleStart = styler.StyleAt(start - 1); styleStart = styler.StyleAt(start - 1) & pdoc->stylingBitsMask;
styler.SetCodePage(pdoc->dbcsCodePage); styler.SetCodePage(pdoc->dbcsCodePage);
if (lexCurrent && (len > 0)) { // Should always succeed as null lexer should always be available if (lexCurrent && (len > 0)) { // Should always succeed as null lexer should always be available
@@ -624,11 +632,13 @@ sptr_t ScintillaBase::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lPara
case SCI_CALLTIPSETBACK: case SCI_CALLTIPSETBACK:
ct.colourBG = ColourDesired(wParam); ct.colourBG = ColourDesired(wParam);
vs.styles[STYLE_CALLTIP].fore = ct.colourBG;
InvalidateStyleRedraw(); InvalidateStyleRedraw();
break; break;
case SCI_CALLTIPSETFORE: case SCI_CALLTIPSETFORE:
ct.colourUnSel = ColourDesired(wParam); ct.colourUnSel = ColourDesired(wParam);
vs.styles[STYLE_CALLTIP].fore = ct.colourUnSel;
InvalidateStyleRedraw(); InvalidateStyleRedraw();
break; break;
@@ -637,6 +647,11 @@ sptr_t ScintillaBase::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lPara
InvalidateStyleRedraw(); InvalidateStyleRedraw();
break; break;
case SCI_CALLTIPUSESTYLE:
ct.SetTabSize((int)wParam);
InvalidateStyleRedraw();
break;
case SCI_USEPOPUP: case SCI_USEPOPUP:
displayPopupMenu = wParam != 0; displayPopupMenu = wParam != 0;
break; break;

View File

@@ -17,7 +17,7 @@
#include "ViewStyle.h" #include "ViewStyle.h"
MarginStyle::MarginStyle() : MarginStyle::MarginStyle() :
symbol(false), width(16), mask(0xffffffff), sensitive(false) { style(SC_MARGIN_SYMBOL), width(0), mask(0), sensitive(false) {
} }
// A list of the fontnames - avoids wasting space in each style // A list of the fontnames - avoids wasting space in each style
@@ -73,6 +73,7 @@ ViewStyle::ViewStyle(const ViewStyle &source) {
selbackset = source.selbackset; selbackset = source.selbackset;
selbackground.desired = source.selbackground.desired; selbackground.desired = source.selbackground.desired;
selbackground2.desired = source.selbackground2.desired; selbackground2.desired = source.selbackground2.desired;
selAlpha = source.selAlpha;
foldmarginColourSet = source.foldmarginColourSet; foldmarginColourSet = source.foldmarginColourSet;
foldmarginColour.desired = source.foldmarginColour.desired; foldmarginColour.desired = source.foldmarginColour.desired;
@@ -95,6 +96,7 @@ ViewStyle::ViewStyle(const ViewStyle &source) {
caretcolour.desired = source.caretcolour.desired; caretcolour.desired = source.caretcolour.desired;
showCaretLineBackground = source.showCaretLineBackground; showCaretLineBackground = source.showCaretLineBackground;
caretLineBackground.desired = source.caretLineBackground.desired; caretLineBackground.desired = source.caretLineBackground.desired;
caretLineAlpha = source.caretLineAlpha;
edgecolour.desired = source.edgecolour.desired; edgecolour.desired = source.edgecolour.desired;
edgeState = source.edgeState; edgeState = source.edgeState;
caretWidth = source.caretWidth; caretWidth = source.caretWidth;
@@ -140,6 +142,7 @@ void ViewStyle::Init() {
selbackset = true; selbackset = true;
selbackground.desired = ColourDesired(0xc0, 0xc0, 0xc0); selbackground.desired = ColourDesired(0xc0, 0xc0, 0xc0);
selbackground2.desired = ColourDesired(0xb0, 0xb0, 0xb0); selbackground2.desired = ColourDesired(0xb0, 0xb0, 0xb0);
selAlpha = SC_ALPHA_NOALPHA;
foldmarginColourSet = false; foldmarginColourSet = false;
foldmarginColour.desired = ColourDesired(0xff, 0, 0); foldmarginColour.desired = ColourDesired(0xff, 0, 0);
@@ -157,6 +160,7 @@ void ViewStyle::Init() {
caretcolour.desired = ColourDesired(0, 0, 0); caretcolour.desired = ColourDesired(0, 0, 0);
showCaretLineBackground = false; showCaretLineBackground = false;
caretLineBackground.desired = ColourDesired(0xff, 0xff, 0); caretLineBackground.desired = ColourDesired(0xff, 0xff, 0);
caretLineAlpha = SC_ALPHA_NOALPHA;
edgecolour.desired = ColourDesired(0xc0, 0xc0, 0xc0); edgecolour.desired = ColourDesired(0xc0, 0xc0, 0xc0);
edgeState = EDGE_NONE; edgeState = EDGE_NONE;
caretWidth = 1; caretWidth = 1;
@@ -171,13 +175,13 @@ void ViewStyle::Init() {
leftMarginWidth = 1; leftMarginWidth = 1;
rightMarginWidth = 1; rightMarginWidth = 1;
ms[0].symbol = false; ms[0].style = SC_MARGIN_NUMBER;
ms[0].width = 0; ms[0].width = 0;
ms[0].mask = 0; ms[0].mask = 0;
ms[1].symbol = true; ms[1].style = SC_MARGIN_SYMBOL;
ms[1].width = 16; ms[1].width = 16;
ms[1].mask = ~SC_MASK_FOLDERS; ms[1].mask = ~SC_MASK_FOLDERS;
ms[2].symbol = true; ms[2].style = SC_MARGIN_SYMBOL;
ms[2].width = 0; ms[2].width = 0;
ms[2].mask = 0; ms[2].mask = 0;
fixedColumnWidth = leftMarginWidth; fixedColumnWidth = leftMarginWidth;
@@ -185,7 +189,7 @@ void ViewStyle::Init() {
maskInLine = 0xffffffff; maskInLine = 0xffffffff;
for (int margin=0; margin < margins; margin++) { for (int margin=0; margin < margins; margin++) {
fixedColumnWidth += ms[margin].width; fixedColumnWidth += ms[margin].width;
symbolMargin = symbolMargin || ms[margin].symbol; symbolMargin = symbolMargin || (ms[margin].style != SC_MARGIN_NUMBER);
if (ms[margin].width > 0) if (ms[margin].width > 0)
maskInLine &= ~ms[margin].mask; maskInLine &= ~ms[margin].mask;
} }
@@ -256,7 +260,7 @@ void ViewStyle::Refresh(Surface &surface) {
maskInLine = 0xffffffff; maskInLine = 0xffffffff;
for (int margin=0; margin < margins; margin++) { for (int margin=0; margin < margins; margin++) {
fixedColumnWidth += ms[margin].width; fixedColumnWidth += ms[margin].width;
symbolMargin = symbolMargin || ms[margin].symbol; symbolMargin = symbolMargin || (ms[margin].style != SC_MARGIN_NUMBER);
if (ms[margin].width > 0) if (ms[margin].width > 0)
maskInLine &= ~ms[margin].mask; maskInLine &= ~ms[margin].mask;
} }
@@ -278,6 +282,10 @@ void ViewStyle::ClearStyles() {
} }
} }
styles[STYLE_LINENUMBER].back.desired = Platform::Chrome(); styles[STYLE_LINENUMBER].back.desired = Platform::Chrome();
// Set call tip fore/back to match the values previously set for call tips
styles[STYLE_CALLTIP].back.desired = ColourDesired(0xff, 0xff, 0xff);
styles[STYLE_CALLTIP].fore.desired = ColourDesired(0x80, 0x80, 0x80);
} }
void ViewStyle::SetStyleFontName(int styleIndex, const char *name) { void ViewStyle::SetStyleFontName(int styleIndex, const char *name) {

View File

@@ -12,7 +12,7 @@
*/ */
class MarginStyle { class MarginStyle {
public: public:
bool symbol; int style;
int width; int width;
int mask; int mask;
bool sensitive; bool sensitive;
@@ -53,6 +53,7 @@ public:
bool selbackset; bool selbackset;
ColourPair selbackground; ColourPair selbackground;
ColourPair selbackground2; ColourPair selbackground2;
int selAlpha;
bool whitespaceForegroundSet; bool whitespaceForegroundSet;
ColourPair whitespaceForeground; ColourPair whitespaceForeground;
bool whitespaceBackgroundSet; bool whitespaceBackgroundSet;
@@ -70,7 +71,7 @@ public:
bool hotspotUnderline; bool hotspotUnderline;
bool hotspotSingleLine; bool hotspotSingleLine;
/// Margins are ordered: Line Numbers, Selection Margin, Spacing Margin /// Margins are ordered: Line Numbers, Selection Margin, Spacing Margin
enum { margins=3 }; enum { margins=5 };
int leftMarginWidth; ///< Spacing margin on left of text int leftMarginWidth; ///< Spacing margin on left of text
int rightMarginWidth; ///< Spacing margin on left of text int rightMarginWidth; ///< Spacing margin on left of text
bool symbolMargin; bool symbolMargin;
@@ -85,6 +86,7 @@ public:
ColourPair caretcolour; ColourPair caretcolour;
bool showCaretLineBackground; bool showCaretLineBackground;
ColourPair caretLineBackground; ColourPair caretLineBackground;
int caretLineAlpha;
ColourPair edgecolour; ColourPair edgecolour;
int edgeState; int edgeState;
int caretWidth; int caretWidth;

View File

@@ -535,6 +535,11 @@ void wxStyledTextCtrl::MarkerAddSet(int line, int set) {
SendMsg(2466, line, set); SendMsg(2466, line, set);
} }
// Set the alpha used for a marker that is drawn in the text area, not the margin.
void wxStyledTextCtrl::MarkerSetAlpha(int markerNumber, int alpha) {
SendMsg(2476, markerNumber, alpha);
}
// Set a margin to be either numeric or symbolic. // Set a margin to be either numeric or symbolic.
void wxStyledTextCtrl::SetMarginType(int margin, int marginType) { void wxStyledTextCtrl::SetMarginType(int margin, int marginType) {
SendMsg(2240, margin, marginType); SendMsg(2240, margin, marginType);
@@ -645,6 +650,16 @@ void wxStyledTextCtrl::SetSelBackground(bool useSetting, const wxColour& back) {
SendMsg(2068, useSetting, wxColourAsLong(back)); SendMsg(2068, useSetting, wxColourAsLong(back));
} }
// Get the alpha of the selection.
int wxStyledTextCtrl::GetSelAlpha() {
return SendMsg(2477, 0, 0);
}
// Set the alpha of the selection.
void wxStyledTextCtrl::SetSelAlpha(int alpha) {
SendMsg(2478, alpha, 0);
}
// Set the foreground colour of the caret. // Set the foreground colour of the caret.
void wxStyledTextCtrl::SetCaretForeground(const wxColour& fore) { void wxStyledTextCtrl::SetCaretForeground(const wxColour& fore) {
SendMsg(2069, wxColourAsLong(fore), 0); SendMsg(2069, wxColourAsLong(fore), 0);
@@ -1445,6 +1460,11 @@ void wxStyledTextCtrl::CallTipSetForegroundHighlight(const wxColour& fore) {
SendMsg(2207, wxColourAsLong(fore), 0); SendMsg(2207, wxColourAsLong(fore), 0);
} }
// Enable use of STYLE_CALLTIP and set call tip tab size in pixels.
void wxStyledTextCtrl::CallTipUseStyle(int tabSize) {
SendMsg(2212, tabSize, 0);
}
// Find the display line of a document line taking hidden lines into account. // Find the display line of a document line taking hidden lines into account.
int wxStyledTextCtrl::VisibleFromDocLine(int line) { int wxStyledTextCtrl::VisibleFromDocLine(int line) {
return SendMsg(2220, line, 0); return SendMsg(2220, line, 0);
@@ -2481,6 +2501,16 @@ void wxStyledTextCtrl::SelectionDuplicate() {
SendMsg(2469, 0, 0); SendMsg(2469, 0, 0);
} }
// Set background alpha of the caret line.
void wxStyledTextCtrl::SetCaretLineBackAlpha(int alpha) {
SendMsg(2470, alpha, 0);
}
// Get the background alpha of the caret line.
int wxStyledTextCtrl::GetCaretLineBackAlpha() {
return SendMsg(2471, 0, 0);
}
// Start notifying the container of all key presses and commands. // Start notifying the container of all key presses and commands.
void wxStyledTextCtrl::StartRecord() { void wxStyledTextCtrl::StartRecord() {
SendMsg(3001, 0, 0); SendMsg(3001, 0, 0);

View File

@@ -120,15 +120,18 @@
#define wxSTC_MASK_FOLDERS 0xFE000000 #define wxSTC_MASK_FOLDERS 0xFE000000
#define wxSTC_MARGIN_SYMBOL 0 #define wxSTC_MARGIN_SYMBOL 0
#define wxSTC_MARGIN_NUMBER 1 #define wxSTC_MARGIN_NUMBER 1
#define wxSTC_MARGIN_BACK 2
#define wxSTC_MARGIN_FORE 3
// Styles in range 32..37 are predefined for parts of the UI and are not used as normal styles. // Styles in range 32..38 are predefined for parts of the UI and are not used as normal styles.
// Styles 38 and 39 are for future use. // Style 39 is for future use.
#define wxSTC_STYLE_DEFAULT 32 #define wxSTC_STYLE_DEFAULT 32
#define wxSTC_STYLE_LINENUMBER 33 #define wxSTC_STYLE_LINENUMBER 33
#define wxSTC_STYLE_BRACELIGHT 34 #define wxSTC_STYLE_BRACELIGHT 34
#define wxSTC_STYLE_BRACEBAD 35 #define wxSTC_STYLE_BRACEBAD 35
#define wxSTC_STYLE_CONTROLCHAR 36 #define wxSTC_STYLE_CONTROLCHAR 36
#define wxSTC_STYLE_INDENTGUIDE 37 #define wxSTC_STYLE_INDENTGUIDE 37
#define wxSTC_STYLE_CALLTIP 38
#define wxSTC_STYLE_LASTPREDEFINED 39 #define wxSTC_STYLE_LASTPREDEFINED 39
#define wxSTC_STYLE_MAX 127 #define wxSTC_STYLE_MAX 127
@@ -166,6 +169,7 @@
#define wxSTC_INDIC_STRIKE 4 #define wxSTC_INDIC_STRIKE 4
#define wxSTC_INDIC_HIDDEN 5 #define wxSTC_INDIC_HIDDEN 5
#define wxSTC_INDIC_BOX 6 #define wxSTC_INDIC_BOX 6
#define wxSTC_INDIC_ROUNDBOX 7
#define wxSTC_INDIC0_MASK 0x20 #define wxSTC_INDIC0_MASK 0x20
#define wxSTC_INDIC1_MASK 0x40 #define wxSTC_INDIC1_MASK 0x40
#define wxSTC_INDIC2_MASK 0x80 #define wxSTC_INDIC2_MASK 0x80
@@ -258,6 +262,9 @@
#define wxSTC_SEL_STREAM 0 #define wxSTC_SEL_STREAM 0
#define wxSTC_SEL_RECTANGLE 1 #define wxSTC_SEL_RECTANGLE 1
#define wxSTC_SEL_LINES 2 #define wxSTC_SEL_LINES 2
#define wxSTC_ALPHA_TRANSPARENT 0
#define wxSTC_ALPHA_OPAQUE 255
#define wxSTC_ALPHA_NOALPHA 256
// Maximum value of keywordSet parameter of SetKeyWords. // Maximum value of keywordSet parameter of SetKeyWords.
#define wxSTC_KEYWORDSET_MAX 8 #define wxSTC_KEYWORDSET_MAX 8
@@ -381,10 +388,9 @@
#define wxSTC_LEX_FLAGSHIP 73 #define wxSTC_LEX_FLAGSHIP 73
#define wxSTC_LEX_CSOUND 74 #define wxSTC_LEX_CSOUND 74
#define wxSTC_LEX_FREEBASIC 75 #define wxSTC_LEX_FREEBASIC 75
#define wxSTC_LEX_INNOSETUP 76
// These are deprecated, STC_LEX_HTML should be used instead. #define wxSTC_LEX_OPAL 77
#define wxSTC_LEX_ASP 29 #define wxSTC_LEX_SPICE 78
#define wxSTC_LEX_PHP 30
// When a lexer specifies its language as SCLEX_AUTOMATIC it receives a // When a lexer specifies its language as SCLEX_AUTOMATIC it receives a
// value assigned in sequence from SCLEX_AUTOMATIC+1. // value assigned in sequence from SCLEX_AUTOMATIC+1.
@@ -430,6 +436,30 @@
#define wxSTC_C_COMMENTDOCKEYWORDERROR 18 #define wxSTC_C_COMMENTDOCKEYWORDERROR 18
#define wxSTC_C_GLOBALCLASS 19 #define wxSTC_C_GLOBALCLASS 19
// Lexical states for SCLEX_TCL
#define wxSTC_TCL_DEFAULT 0
#define wxSTC_TCL_COMMENT 1
#define wxSTC_TCL_COMMENTLINE 2
#define wxSTC_TCL_NUMBER 3
#define wxSTC_TCL_WORD_IN_QUOTE 4
#define wxSTC_TCL_IN_QUOTE 5
#define wxSTC_TCL_OPERATOR 6
#define wxSTC_TCL_IDENTIFIER 7
#define wxSTC_TCL_SUBSTITUTION 8
#define wxSTC_TCL_SUB_BRACE 9
#define wxSTC_TCL_MODIFIER 10
#define wxSTC_TCL_EXPAND 11
#define wxSTC_TCL_WORD 12
#define wxSTC_TCL_WORD2 13
#define wxSTC_TCL_WORD3 14
#define wxSTC_TCL_WORD4 15
#define wxSTC_TCL_WORD5 16
#define wxSTC_TCL_WORD6 17
#define wxSTC_TCL_WORD7 18
#define wxSTC_TCL_WORD8 19
#define wxSTC_TCL_COMMENT_BOX 20
#define wxSTC_TCL_BLOCK_COMMENT 21
// Lexical states for SCLEX_HTML, SCLEX_XML // Lexical states for SCLEX_HTML, SCLEX_XML
#define wxSTC_H_DEFAULT 0 #define wxSTC_H_DEFAULT 0
#define wxSTC_H_TAG 1 #define wxSTC_H_TAG 1
@@ -664,6 +694,7 @@
#define wxSTC_PROPS_SECTION 2 #define wxSTC_PROPS_SECTION 2
#define wxSTC_PROPS_ASSIGNMENT 3 #define wxSTC_PROPS_ASSIGNMENT 3
#define wxSTC_PROPS_DEFVAL 4 #define wxSTC_PROPS_DEFVAL 4
#define wxSTC_PROPS_KEY 5
// Lexical states for SCLEX_LATEX // Lexical states for SCLEX_LATEX
#define wxSTC_L_DEFAULT 0 #define wxSTC_L_DEFAULT 0
@@ -1208,6 +1239,7 @@
#define wxSTC_AU3_SPECIAL 12 #define wxSTC_AU3_SPECIAL 12
#define wxSTC_AU3_EXPAND 13 #define wxSTC_AU3_EXPAND 13
#define wxSTC_AU3_COMOBJ 14 #define wxSTC_AU3_COMOBJ 14
#define wxSTC_AU3_UDF 15
// Lexical states for SCLEX_APDL // Lexical states for SCLEX_APDL
#define wxSTC_APDL_DEFAULT 0 #define wxSTC_APDL_DEFAULT 0
@@ -1446,6 +1478,44 @@
#define wxSTC_CSOUND_GLOBAL_VAR 14 #define wxSTC_CSOUND_GLOBAL_VAR 14
#define wxSTC_CSOUND_STRINGEOL 15 #define wxSTC_CSOUND_STRINGEOL 15
// Lexical states for SCLEX_INNOSETUP
#define wxSTC_INNO_DEFAULT 0
#define wxSTC_INNO_COMMENT 1
#define wxSTC_INNO_KEYWORD 2
#define wxSTC_INNO_PARAMETER 3
#define wxSTC_INNO_SECTION 4
#define wxSTC_INNO_PREPROC 5
#define wxSTC_INNO_PREPROC_INLINE 6
#define wxSTC_INNO_COMMENT_PASCAL 7
#define wxSTC_INNO_KEYWORD_PASCAL 8
#define wxSTC_INNO_KEYWORD_USER 9
#define wxSTC_INNO_STRING_DOUBLE 10
#define wxSTC_INNO_STRING_SINGLE 11
#define wxSTC_INNO_IDENTIFIER 12
// Lexical states for SCLEX_OPAL
#define wxSTC_OPAL_SPACE 0
#define wxSTC_OPAL_COMMENT_BLOCK 1
#define wxSTC_OPAL_COMMENT_LINE 2
#define wxSTC_OPAL_INTEGER 3
#define wxSTC_OPAL_KEYWORD 4
#define wxSTC_OPAL_SORT 5
#define wxSTC_OPAL_STRING 6
#define wxSTC_OPAL_PAR 7
#define wxSTC_OPAL_BOOL_CONST 8
#define wxSTC_OPAL_DEFAULT 32
// Lexical states for SCLEX_SPICE
#define wxSTC_SPICE_DEFAULT 0
#define wxSTC_SPICE_IDENTIFIER 1
#define wxSTC_SPICE_KEYWORD 2
#define wxSTC_SPICE_KEYWORD2 3
#define wxSTC_SPICE_KEYWORD3 4
#define wxSTC_SPICE_NUMBER 5
#define wxSTC_SPICE_DELIMITER 6
#define wxSTC_SPICE_VALUE 7
#define wxSTC_SPICE_COMMENTLINE 8
//----------------------------------------- //-----------------------------------------
// Commands that can be bound to keystrokes // Commands that can be bound to keystrokes
@@ -1935,6 +2005,9 @@ public:
// Add a set of markers to a line. // Add a set of markers to a line.
void MarkerAddSet(int line, int set); void MarkerAddSet(int line, int set);
// Set the alpha used for a marker that is drawn in the text area, not the margin.
void MarkerSetAlpha(int markerNumber, int alpha);
// Set a margin to be either numeric or symbolic. // Set a margin to be either numeric or symbolic.
void SetMarginType(int margin, int marginType); void SetMarginType(int margin, int marginType);
@@ -2001,6 +2074,12 @@ public:
// Set the background colour of the selection and whether to use this setting. // Set the background colour of the selection and whether to use this setting.
void SetSelBackground(bool useSetting, const wxColour& back); void SetSelBackground(bool useSetting, const wxColour& back);
// Get the alpha of the selection.
int GetSelAlpha();
// Set the alpha of the selection.
void SetSelAlpha(int alpha);
// Set the foreground colour of the caret. // Set the foreground colour of the caret.
void SetCaretForeground(const wxColour& fore); void SetCaretForeground(const wxColour& fore);
@@ -2440,6 +2519,9 @@ public:
// Set the foreground colour for the highlighted part of the call tip. // Set the foreground colour for the highlighted part of the call tip.
void CallTipSetForegroundHighlight(const wxColour& fore); void CallTipSetForegroundHighlight(const wxColour& fore);
// Enable use of STYLE_CALLTIP and set call tip tab size in pixels.
void CallTipUseStyle(int tabSize);
// Find the display line of a document line taking hidden lines into account. // Find the display line of a document line taking hidden lines into account.
int VisibleFromDocLine(int line); int VisibleFromDocLine(int line);
@@ -3068,6 +3150,12 @@ public:
// Duplicate the selection. If selection empty duplicate the line containing the caret. // Duplicate the selection. If selection empty duplicate the line containing the caret.
void SelectionDuplicate(); void SelectionDuplicate();
// Set background alpha of the caret line.
void SetCaretLineBackAlpha(int alpha);
// Get the background alpha of the caret line.
int GetCaretLineBackAlpha();
// Start notifying the container of all key presses and commands. // Start notifying the container of all key presses and commands.
void StartRecord(); void StartRecord();

View File

@@ -66,6 +66,7 @@ STCDLL_OBJECTS = \
stcdll_AutoComplete.o \ stcdll_AutoComplete.o \
stcdll_CallTip.o \ stcdll_CallTip.o \
stcdll_CellBuffer.o \ stcdll_CellBuffer.o \
stcdll_CharClassify.o \
stcdll_ContractionState.o \ stcdll_ContractionState.o \
stcdll_Document.o \ stcdll_Document.o \
stcdll_DocumentAccessor.o \ stcdll_DocumentAccessor.o \
@@ -100,6 +101,7 @@ STCDLL_OBJECTS = \
stcdll_LexGui4Cli.o \ stcdll_LexGui4Cli.o \
stcdll_LexHTML.o \ stcdll_LexHTML.o \
stcdll_LexHaskell.o \ stcdll_LexHaskell.o \
stcdll_LexInno.o \
stcdll_LexKix.o \ stcdll_LexKix.o \
stcdll_LexLisp.o \ stcdll_LexLisp.o \
stcdll_LexLout.o \ stcdll_LexLout.o \
@@ -110,6 +112,7 @@ STCDLL_OBJECTS = \
stcdll_LexMatlab.o \ stcdll_LexMatlab.o \
stcdll_LexMetapost.o \ stcdll_LexMetapost.o \
stcdll_LexNsis.o \ stcdll_LexNsis.o \
stcdll_LexOpal.o \
stcdll_LexOthers.o \ stcdll_LexOthers.o \
stcdll_LexPB.o \ stcdll_LexPB.o \
stcdll_LexPOV.o \ stcdll_LexPOV.o \
@@ -124,6 +127,8 @@ STCDLL_OBJECTS = \
stcdll_LexTADS3.o \ stcdll_LexTADS3.o \
stcdll_LexScriptol.o \ stcdll_LexScriptol.o \
stcdll_LexSpecman.o \ stcdll_LexSpecman.o \
stcdll_LexSpice.o \
stcdll_LexTCL.o \
stcdll_LexTeX.o \ stcdll_LexTeX.o \
stcdll_LexVB.o \ stcdll_LexVB.o \
stcdll_LexVHDL.o \ stcdll_LexVHDL.o \
@@ -151,6 +156,7 @@ STCLIB_OBJECTS = \
stclib_AutoComplete.o \ stclib_AutoComplete.o \
stclib_CallTip.o \ stclib_CallTip.o \
stclib_CellBuffer.o \ stclib_CellBuffer.o \
stclib_CharClassify.o \
stclib_ContractionState.o \ stclib_ContractionState.o \
stclib_Document.o \ stclib_Document.o \
stclib_DocumentAccessor.o \ stclib_DocumentAccessor.o \
@@ -185,6 +191,7 @@ STCLIB_OBJECTS = \
stclib_LexGui4Cli.o \ stclib_LexGui4Cli.o \
stclib_LexHTML.o \ stclib_LexHTML.o \
stclib_LexHaskell.o \ stclib_LexHaskell.o \
stclib_LexInno.o \
stclib_LexKix.o \ stclib_LexKix.o \
stclib_LexLisp.o \ stclib_LexLisp.o \
stclib_LexLout.o \ stclib_LexLout.o \
@@ -195,6 +202,7 @@ STCLIB_OBJECTS = \
stclib_LexMatlab.o \ stclib_LexMatlab.o \
stclib_LexMetapost.o \ stclib_LexMetapost.o \
stclib_LexNsis.o \ stclib_LexNsis.o \
stclib_LexOpal.o \
stclib_LexOthers.o \ stclib_LexOthers.o \
stclib_LexPB.o \ stclib_LexPB.o \
stclib_LexPOV.o \ stclib_LexPOV.o \
@@ -209,6 +217,8 @@ STCLIB_OBJECTS = \
stclib_LexTADS3.o \ stclib_LexTADS3.o \
stclib_LexScriptol.o \ stclib_LexScriptol.o \
stclib_LexSpecman.o \ stclib_LexSpecman.o \
stclib_LexSpice.o \
stclib_LexTCL.o \
stclib_LexTeX.o \ stclib_LexTeX.o \
stclib_LexVB.o \ stclib_LexVB.o \
stclib_LexVHDL.o \ stclib_LexVHDL.o \
@@ -415,6 +425,9 @@ stcdll_CallTip.o: $(srcdir)/scintilla/src/CallTip.cxx
stcdll_CellBuffer.o: $(srcdir)/scintilla/src/CellBuffer.cxx stcdll_CellBuffer.o: $(srcdir)/scintilla/src/CellBuffer.cxx
$(CXXC) -c -o $@ $(STCDLL_CXXFLAGS) $(srcdir)/scintilla/src/CellBuffer.cxx $(CXXC) -c -o $@ $(STCDLL_CXXFLAGS) $(srcdir)/scintilla/src/CellBuffer.cxx
stcdll_CharClassify.o: $(srcdir)/scintilla/src/CharClassify.cxx
$(CXXC) -c -o $@ $(STCDLL_CXXFLAGS) $(srcdir)/scintilla/src/CharClassify.cxx
stcdll_ContractionState.o: $(srcdir)/scintilla/src/ContractionState.cxx stcdll_ContractionState.o: $(srcdir)/scintilla/src/ContractionState.cxx
$(CXXC) -c -o $@ $(STCDLL_CXXFLAGS) $(srcdir)/scintilla/src/ContractionState.cxx $(CXXC) -c -o $@ $(STCDLL_CXXFLAGS) $(srcdir)/scintilla/src/ContractionState.cxx
@@ -517,6 +530,9 @@ stcdll_LexHTML.o: $(srcdir)/scintilla/src/LexHTML.cxx
stcdll_LexHaskell.o: $(srcdir)/scintilla/src/LexHaskell.cxx stcdll_LexHaskell.o: $(srcdir)/scintilla/src/LexHaskell.cxx
$(CXXC) -c -o $@ $(STCDLL_CXXFLAGS) $(srcdir)/scintilla/src/LexHaskell.cxx $(CXXC) -c -o $@ $(STCDLL_CXXFLAGS) $(srcdir)/scintilla/src/LexHaskell.cxx
stcdll_LexInno.o: $(srcdir)/scintilla/src/LexInno.cxx
$(CXXC) -c -o $@ $(STCDLL_CXXFLAGS) $(srcdir)/scintilla/src/LexInno.cxx
stcdll_LexKix.o: $(srcdir)/scintilla/src/LexKix.cxx stcdll_LexKix.o: $(srcdir)/scintilla/src/LexKix.cxx
$(CXXC) -c -o $@ $(STCDLL_CXXFLAGS) $(srcdir)/scintilla/src/LexKix.cxx $(CXXC) -c -o $@ $(STCDLL_CXXFLAGS) $(srcdir)/scintilla/src/LexKix.cxx
@@ -547,6 +563,9 @@ stcdll_LexMetapost.o: $(srcdir)/scintilla/src/LexMetapost.cxx
stcdll_LexNsis.o: $(srcdir)/scintilla/src/LexNsis.cxx stcdll_LexNsis.o: $(srcdir)/scintilla/src/LexNsis.cxx
$(CXXC) -c -o $@ $(STCDLL_CXXFLAGS) $(srcdir)/scintilla/src/LexNsis.cxx $(CXXC) -c -o $@ $(STCDLL_CXXFLAGS) $(srcdir)/scintilla/src/LexNsis.cxx
stcdll_LexOpal.o: $(srcdir)/scintilla/src/LexOpal.cxx
$(CXXC) -c -o $@ $(STCDLL_CXXFLAGS) $(srcdir)/scintilla/src/LexOpal.cxx
stcdll_LexOthers.o: $(srcdir)/scintilla/src/LexOthers.cxx stcdll_LexOthers.o: $(srcdir)/scintilla/src/LexOthers.cxx
$(CXXC) -c -o $@ $(STCDLL_CXXFLAGS) $(srcdir)/scintilla/src/LexOthers.cxx $(CXXC) -c -o $@ $(STCDLL_CXXFLAGS) $(srcdir)/scintilla/src/LexOthers.cxx
@@ -589,6 +608,12 @@ stcdll_LexScriptol.o: $(srcdir)/scintilla/src/LexScriptol.cxx
stcdll_LexSpecman.o: $(srcdir)/scintilla/src/LexSpecman.cxx stcdll_LexSpecman.o: $(srcdir)/scintilla/src/LexSpecman.cxx
$(CXXC) -c -o $@ $(STCDLL_CXXFLAGS) $(srcdir)/scintilla/src/LexSpecman.cxx $(CXXC) -c -o $@ $(STCDLL_CXXFLAGS) $(srcdir)/scintilla/src/LexSpecman.cxx
stcdll_LexSpice.o: $(srcdir)/scintilla/src/LexSpice.cxx
$(CXXC) -c -o $@ $(STCDLL_CXXFLAGS) $(srcdir)/scintilla/src/LexSpice.cxx
stcdll_LexTCL.o: $(srcdir)/scintilla/src/LexTCL.cxx
$(CXXC) -c -o $@ $(STCDLL_CXXFLAGS) $(srcdir)/scintilla/src/LexTCL.cxx
stcdll_LexTeX.o: $(srcdir)/scintilla/src/LexTeX.cxx stcdll_LexTeX.o: $(srcdir)/scintilla/src/LexTeX.cxx
$(CXXC) -c -o $@ $(STCDLL_CXXFLAGS) $(srcdir)/scintilla/src/LexTeX.cxx $(CXXC) -c -o $@ $(STCDLL_CXXFLAGS) $(srcdir)/scintilla/src/LexTeX.cxx
@@ -652,6 +677,9 @@ stclib_CallTip.o: $(srcdir)/scintilla/src/CallTip.cxx
stclib_CellBuffer.o: $(srcdir)/scintilla/src/CellBuffer.cxx stclib_CellBuffer.o: $(srcdir)/scintilla/src/CellBuffer.cxx
$(CXXC) -c -o $@ $(STCLIB_CXXFLAGS) $(srcdir)/scintilla/src/CellBuffer.cxx $(CXXC) -c -o $@ $(STCLIB_CXXFLAGS) $(srcdir)/scintilla/src/CellBuffer.cxx
stclib_CharClassify.o: $(srcdir)/scintilla/src/CharClassify.cxx
$(CXXC) -c -o $@ $(STCLIB_CXXFLAGS) $(srcdir)/scintilla/src/CharClassify.cxx
stclib_ContractionState.o: $(srcdir)/scintilla/src/ContractionState.cxx stclib_ContractionState.o: $(srcdir)/scintilla/src/ContractionState.cxx
$(CXXC) -c -o $@ $(STCLIB_CXXFLAGS) $(srcdir)/scintilla/src/ContractionState.cxx $(CXXC) -c -o $@ $(STCLIB_CXXFLAGS) $(srcdir)/scintilla/src/ContractionState.cxx
@@ -754,6 +782,9 @@ stclib_LexHTML.o: $(srcdir)/scintilla/src/LexHTML.cxx
stclib_LexHaskell.o: $(srcdir)/scintilla/src/LexHaskell.cxx stclib_LexHaskell.o: $(srcdir)/scintilla/src/LexHaskell.cxx
$(CXXC) -c -o $@ $(STCLIB_CXXFLAGS) $(srcdir)/scintilla/src/LexHaskell.cxx $(CXXC) -c -o $@ $(STCLIB_CXXFLAGS) $(srcdir)/scintilla/src/LexHaskell.cxx
stclib_LexInno.o: $(srcdir)/scintilla/src/LexInno.cxx
$(CXXC) -c -o $@ $(STCLIB_CXXFLAGS) $(srcdir)/scintilla/src/LexInno.cxx
stclib_LexKix.o: $(srcdir)/scintilla/src/LexKix.cxx stclib_LexKix.o: $(srcdir)/scintilla/src/LexKix.cxx
$(CXXC) -c -o $@ $(STCLIB_CXXFLAGS) $(srcdir)/scintilla/src/LexKix.cxx $(CXXC) -c -o $@ $(STCLIB_CXXFLAGS) $(srcdir)/scintilla/src/LexKix.cxx
@@ -784,6 +815,9 @@ stclib_LexMetapost.o: $(srcdir)/scintilla/src/LexMetapost.cxx
stclib_LexNsis.o: $(srcdir)/scintilla/src/LexNsis.cxx stclib_LexNsis.o: $(srcdir)/scintilla/src/LexNsis.cxx
$(CXXC) -c -o $@ $(STCLIB_CXXFLAGS) $(srcdir)/scintilla/src/LexNsis.cxx $(CXXC) -c -o $@ $(STCLIB_CXXFLAGS) $(srcdir)/scintilla/src/LexNsis.cxx
stclib_LexOpal.o: $(srcdir)/scintilla/src/LexOpal.cxx
$(CXXC) -c -o $@ $(STCLIB_CXXFLAGS) $(srcdir)/scintilla/src/LexOpal.cxx
stclib_LexOthers.o: $(srcdir)/scintilla/src/LexOthers.cxx stclib_LexOthers.o: $(srcdir)/scintilla/src/LexOthers.cxx
$(CXXC) -c -o $@ $(STCLIB_CXXFLAGS) $(srcdir)/scintilla/src/LexOthers.cxx $(CXXC) -c -o $@ $(STCLIB_CXXFLAGS) $(srcdir)/scintilla/src/LexOthers.cxx
@@ -826,6 +860,12 @@ stclib_LexScriptol.o: $(srcdir)/scintilla/src/LexScriptol.cxx
stclib_LexSpecman.o: $(srcdir)/scintilla/src/LexSpecman.cxx stclib_LexSpecman.o: $(srcdir)/scintilla/src/LexSpecman.cxx
$(CXXC) -c -o $@ $(STCLIB_CXXFLAGS) $(srcdir)/scintilla/src/LexSpecman.cxx $(CXXC) -c -o $@ $(STCLIB_CXXFLAGS) $(srcdir)/scintilla/src/LexSpecman.cxx
stclib_LexSpice.o: $(srcdir)/scintilla/src/LexSpice.cxx
$(CXXC) -c -o $@ $(STCLIB_CXXFLAGS) $(srcdir)/scintilla/src/LexSpice.cxx
stclib_LexTCL.o: $(srcdir)/scintilla/src/LexTCL.cxx
$(CXXC) -c -o $@ $(STCLIB_CXXFLAGS) $(srcdir)/scintilla/src/LexTCL.cxx
stclib_LexTeX.o: $(srcdir)/scintilla/src/LexTeX.cxx stclib_LexTeX.o: $(srcdir)/scintilla/src/LexTeX.cxx
$(CXXC) -c -o $@ $(STCLIB_CXXFLAGS) $(srcdir)/scintilla/src/LexTeX.cxx $(CXXC) -c -o $@ $(STCLIB_CXXFLAGS) $(srcdir)/scintilla/src/LexTeX.cxx

View File

@@ -47,14 +47,21 @@ wxColour wxColourFromCA(const ColourAllocated& ca) {
Palette::Palette() { Palette::Palette() {
used = 0; used = 0;
allowRealization = false; allowRealization = false;
size = 100;
entries = new ColourPair[size];
} }
Palette::~Palette() { Palette::~Palette() {
Release(); Release();
delete [] entries;
entries = 0;
} }
void Palette::Release() { void Palette::Release() {
used = 0; used = 0;
delete [] entries;
size = 100;
entries = new ColourPair[size];
} }
// This method either adds a colour to the list of wanted colours (want==true) // This method either adds a colour to the list of wanted colours (want==true)
@@ -67,11 +74,20 @@ void Palette::WantFind(ColourPair &cp, bool want) {
return; return;
} }
if (used < numEntries) { if (used >= size) {
entries[used].desired = cp.desired; int sizeNew = size * 2;
entries[used].allocated.Set(cp.desired.AsLong()); ColourPair *entriesNew = new ColourPair[sizeNew];
used++; for (int j=0; j<size; j++) {
entriesNew[j] = entries[j];
}
delete []entries;
entries = entriesNew;
size = sizeNew;
} }
entries[used].desired = cp.desired;
entries[used].allocated.Set(cp.desired.AsLong());
used++;
} else { } else {
for (int i=0; i < used; i++) { for (int i=0; i < used; i++) {
if (entries[i].desired == cp.desired) { if (entries[i].desired == cp.desired) {
@@ -162,6 +178,8 @@ public:
virtual void FillRectangle(PRectangle rc, ColourAllocated back); virtual void FillRectangle(PRectangle rc, ColourAllocated back);
virtual void FillRectangle(PRectangle rc, Surface &surfacePattern); virtual void FillRectangle(PRectangle rc, Surface &surfacePattern);
virtual void RoundedRectangle(PRectangle rc, ColourAllocated fore, ColourAllocated back); virtual void RoundedRectangle(PRectangle rc, ColourAllocated fore, ColourAllocated back);
virtual void AlphaRectangle(PRectangle rc, int cornerSize, ColourAllocated fill, int alphaFill,
ColourAllocated outline, int alphaOutline, int flags);
virtual void Ellipse(PRectangle rc, ColourAllocated fore, ColourAllocated back); virtual void Ellipse(PRectangle rc, ColourAllocated fore, ColourAllocated back);
virtual void Copy(PRectangle rc, Point from, Surface &surfaceSource); virtual void Copy(PRectangle rc, Point from, Surface &surfaceSource);
@@ -316,6 +334,14 @@ void SurfaceImpl::RoundedRectangle(PRectangle rc, ColourAllocated fore, ColourAl
hdc->DrawRoundedRectangle(wxRectFromPRectangle(rc), 4); hdc->DrawRoundedRectangle(wxRectFromPRectangle(rc), 4);
} }
void SurfaceImpl::AlphaRectangle(PRectangle rc, int cornerSize,
ColourAllocated fill, int alphaFill,
ColourAllocated outline, int alphaOutline, int flags) {
// ** TODO
RectangleDraw(rc, outline, fill);
}
void SurfaceImpl::Ellipse(PRectangle rc, ColourAllocated fore, ColourAllocated back) { void SurfaceImpl::Ellipse(PRectangle rc, ColourAllocated fore, ColourAllocated back) {
PenColour(fore); PenColour(fore);
BrushColour(back); BrushColour(back);

View File

@@ -27,6 +27,7 @@
#include "Platform.h" #include "Platform.h"
#include "Scintilla.h" #include "Scintilla.h"
#include "CharClassify.h"
#include "XPM.h" #include "XPM.h"
#ifdef SCI_LEXER #ifdef SCI_LEXER
#include "SciLexer.h" #include "SciLexer.h"
@@ -48,7 +49,6 @@
#include "Editor.h" #include "Editor.h"
#include "ScintillaBase.h" #include "ScintillaBase.h"
//---------------------------------------------------------------------- //----------------------------------------------------------------------
#ifdef WXMAKINGDLL_STC #ifdef WXMAKINGDLL_STC

View File

@@ -3,5 +3,5 @@ scintilla/include directories from the Scintilla/SCiTE source
distribution. All other code needed to implement Scintilla on top of distribution. All other code needed to implement Scintilla on top of
wxWindows is located in the directory above this one. wxWindows is located in the directory above this one.
The current version of the Scintilla code is 1.67 The current version of the Scintilla code is 1.70

View File

@@ -236,12 +236,15 @@ class Window; // Forward declaration for Palette
*/ */
class Palette { class Palette {
int used; int used;
enum {numEntries = 100}; int size;
ColourPair entries[numEntries]; ColourPair *entries;
#if PLAT_GTK #if PLAT_GTK
void *allocatedPalette; // GdkColor * void *allocatedPalette; // GdkColor *
int allocatedLen; int allocatedLen;
#endif #endif
// Private so Palette objects can not be copied
Palette(const Palette &) {}
Palette &operator=(const Palette &) { return *this; }
public: public:
#if PLAT_WIN #if PLAT_WIN
void *hpal; void *hpal;
@@ -319,6 +322,8 @@ public:
virtual void FillRectangle(PRectangle rc, ColourAllocated back)=0; virtual void FillRectangle(PRectangle rc, ColourAllocated back)=0;
virtual void FillRectangle(PRectangle rc, Surface &surfacePattern)=0; virtual void FillRectangle(PRectangle rc, Surface &surfacePattern)=0;
virtual void RoundedRectangle(PRectangle rc, ColourAllocated fore, ColourAllocated back)=0; virtual void RoundedRectangle(PRectangle rc, ColourAllocated fore, ColourAllocated back)=0;
virtual void AlphaRectangle(PRectangle rc, int cornerSize, ColourAllocated fill, int alphaFill,
ColourAllocated outline, int alphaOutline, int flags)=0;
virtual void Ellipse(PRectangle rc, ColourAllocated fore, ColourAllocated back)=0; virtual void Ellipse(PRectangle rc, ColourAllocated fore, ColourAllocated back)=0;
virtual void Copy(PRectangle rc, Point from, Surface &surfaceSource)=0; virtual void Copy(PRectangle rc, Point from, Surface &surfaceSource)=0;

View File

@@ -88,6 +88,9 @@
#define SCLEX_FLAGSHIP 73 #define SCLEX_FLAGSHIP 73
#define SCLEX_CSOUND 74 #define SCLEX_CSOUND 74
#define SCLEX_FREEBASIC 75 #define SCLEX_FREEBASIC 75
#define SCLEX_INNOSETUP 76
#define SCLEX_OPAL 77
#define SCLEX_SPICE 78
#define SCLEX_AUTOMATIC 1000 #define SCLEX_AUTOMATIC 1000
#define SCE_P_DEFAULT 0 #define SCE_P_DEFAULT 0
#define SCE_P_COMMENTLINE 1 #define SCE_P_COMMENTLINE 1
@@ -125,6 +128,28 @@
#define SCE_C_COMMENTDOCKEYWORD 17 #define SCE_C_COMMENTDOCKEYWORD 17
#define SCE_C_COMMENTDOCKEYWORDERROR 18 #define SCE_C_COMMENTDOCKEYWORDERROR 18
#define SCE_C_GLOBALCLASS 19 #define SCE_C_GLOBALCLASS 19
#define SCE_TCL_DEFAULT 0
#define SCE_TCL_COMMENT 1
#define SCE_TCL_COMMENTLINE 2
#define SCE_TCL_NUMBER 3
#define SCE_TCL_WORD_IN_QUOTE 4
#define SCE_TCL_IN_QUOTE 5
#define SCE_TCL_OPERATOR 6
#define SCE_TCL_IDENTIFIER 7
#define SCE_TCL_SUBSTITUTION 8
#define SCE_TCL_SUB_BRACE 9
#define SCE_TCL_MODIFIER 10
#define SCE_TCL_EXPAND 11
#define SCE_TCL_WORD 12
#define SCE_TCL_WORD2 13
#define SCE_TCL_WORD3 14
#define SCE_TCL_WORD4 15
#define SCE_TCL_WORD5 16
#define SCE_TCL_WORD6 17
#define SCE_TCL_WORD7 18
#define SCE_TCL_WORD8 19
#define SCE_TCL_COMMENT_BOX 20
#define SCE_TCL_BLOCK_COMMENT 21
#define SCE_H_DEFAULT 0 #define SCE_H_DEFAULT 0
#define SCE_H_TAG 1 #define SCE_H_TAG 1
#define SCE_H_TAGUNKNOWN 2 #define SCE_H_TAGUNKNOWN 2
@@ -326,6 +351,7 @@
#define SCE_PROPS_SECTION 2 #define SCE_PROPS_SECTION 2
#define SCE_PROPS_ASSIGNMENT 3 #define SCE_PROPS_ASSIGNMENT 3
#define SCE_PROPS_DEFVAL 4 #define SCE_PROPS_DEFVAL 4
#define SCE_PROPS_KEY 5
#define SCE_L_DEFAULT 0 #define SCE_L_DEFAULT 0
#define SCE_L_COMMAND 1 #define SCE_L_COMMAND 1
#define SCE_L_TAG 2 #define SCE_L_TAG 2
@@ -795,6 +821,7 @@
#define SCE_AU3_SPECIAL 12 #define SCE_AU3_SPECIAL 12
#define SCE_AU3_EXPAND 13 #define SCE_AU3_EXPAND 13
#define SCE_AU3_COMOBJ 14 #define SCE_AU3_COMOBJ 14
#define SCE_AU3_UDF 15
#define SCE_APDL_DEFAULT 0 #define SCE_APDL_DEFAULT 0
#define SCE_APDL_COMMENT 1 #define SCE_APDL_COMMENT 1
#define SCE_APDL_COMMENTBLOCK 2 #define SCE_APDL_COMMENTBLOCK 2
@@ -1008,6 +1035,38 @@
#define SCE_CSOUND_IRATE_VAR 13 #define SCE_CSOUND_IRATE_VAR 13
#define SCE_CSOUND_GLOBAL_VAR 14 #define SCE_CSOUND_GLOBAL_VAR 14
#define SCE_CSOUND_STRINGEOL 15 #define SCE_CSOUND_STRINGEOL 15
#define SCE_INNO_DEFAULT 0
#define SCE_INNO_COMMENT 1
#define SCE_INNO_KEYWORD 2
#define SCE_INNO_PARAMETER 3
#define SCE_INNO_SECTION 4
#define SCE_INNO_PREPROC 5
#define SCE_INNO_PREPROC_INLINE 6
#define SCE_INNO_COMMENT_PASCAL 7
#define SCE_INNO_KEYWORD_PASCAL 8
#define SCE_INNO_KEYWORD_USER 9
#define SCE_INNO_STRING_DOUBLE 10
#define SCE_INNO_STRING_SINGLE 11
#define SCE_INNO_IDENTIFIER 12
#define SCE_OPAL_SPACE 0
#define SCE_OPAL_COMMENT_BLOCK 1
#define SCE_OPAL_COMMENT_LINE 2
#define SCE_OPAL_INTEGER 3
#define SCE_OPAL_KEYWORD 4
#define SCE_OPAL_SORT 5
#define SCE_OPAL_STRING 6
#define SCE_OPAL_PAR 7
#define SCE_OPAL_BOOL_CONST 8
#define SCE_OPAL_DEFAULT 32
#define SCE_SPICE_DEFAULT 0
#define SCE_SPICE_IDENTIFIER 1
#define SCE_SPICE_KEYWORD 2
#define SCE_SPICE_KEYWORD2 3
#define SCE_SPICE_KEYWORD3 4
#define SCE_SPICE_NUMBER 5
#define SCE_SPICE_DELIMITER 6
#define SCE_SPICE_VALUE 7
#define SCE_SPICE_COMMENTLINE 8
#define SCLEX_ASP 29 #define SCLEX_ASP 29
#define SCLEX_PHP 30 #define SCLEX_PHP 30
//--Autogenerated -- end of section automatically generated from Scintilla.iface //--Autogenerated -- end of section automatically generated from Scintilla.iface

View File

@@ -138,8 +138,11 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
#define SCI_MARKERPREVIOUS 2048 #define SCI_MARKERPREVIOUS 2048
#define SCI_MARKERDEFINEPIXMAP 2049 #define SCI_MARKERDEFINEPIXMAP 2049
#define SCI_MARKERADDSET 2466 #define SCI_MARKERADDSET 2466
#define SCI_MARKERSETALPHA 2476
#define SC_MARGIN_SYMBOL 0 #define SC_MARGIN_SYMBOL 0
#define SC_MARGIN_NUMBER 1 #define SC_MARGIN_NUMBER 1
#define SC_MARGIN_BACK 2
#define SC_MARGIN_FORE 3
#define SCI_SETMARGINTYPEN 2240 #define SCI_SETMARGINTYPEN 2240
#define SCI_GETMARGINTYPEN 2241 #define SCI_GETMARGINTYPEN 2241
#define SCI_SETMARGINWIDTHN 2242 #define SCI_SETMARGINWIDTHN 2242
@@ -154,6 +157,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
#define STYLE_BRACEBAD 35 #define STYLE_BRACEBAD 35
#define STYLE_CONTROLCHAR 36 #define STYLE_CONTROLCHAR 36
#define STYLE_INDENTGUIDE 37 #define STYLE_INDENTGUIDE 37
#define STYLE_CALLTIP 38
#define STYLE_LASTPREDEFINED 39 #define STYLE_LASTPREDEFINED 39
#define STYLE_MAX 127 #define STYLE_MAX 127
#define SC_CHARSET_ANSI 0 #define SC_CHARSET_ANSI 0
@@ -195,6 +199,8 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
#define SCI_STYLESETHOTSPOT 2409 #define SCI_STYLESETHOTSPOT 2409
#define SCI_SETSELFORE 2067 #define SCI_SETSELFORE 2067
#define SCI_SETSELBACK 2068 #define SCI_SETSELBACK 2068
#define SCI_GETSELALPHA 2477
#define SCI_SETSELALPHA 2478
#define SCI_SETCARETFORE 2069 #define SCI_SETCARETFORE 2069
#define SCI_ASSIGNCMDKEY 2070 #define SCI_ASSIGNCMDKEY 2070
#define SCI_CLEARCMDKEY 2071 #define SCI_CLEARCMDKEY 2071
@@ -214,6 +220,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
#define INDIC_STRIKE 4 #define INDIC_STRIKE 4
#define INDIC_HIDDEN 5 #define INDIC_HIDDEN 5
#define INDIC_BOX 6 #define INDIC_BOX 6
#define INDIC_ROUNDBOX 7
#define INDIC0_MASK 0x20 #define INDIC0_MASK 0x20
#define INDIC1_MASK 0x40 #define INDIC1_MASK 0x40
#define INDIC2_MASK 0x80 #define INDIC2_MASK 0x80
@@ -358,6 +365,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
#define SCI_CALLTIPSETBACK 2205 #define SCI_CALLTIPSETBACK 2205
#define SCI_CALLTIPSETFORE 2206 #define SCI_CALLTIPSETFORE 2206
#define SCI_CALLTIPSETFOREHLT 2207 #define SCI_CALLTIPSETFOREHLT 2207
#define SCI_CALLTIPUSESTYLE 2212
#define SCI_VISIBLEFROMDOCLINE 2220 #define SCI_VISIBLEFROMDOCLINE 2220
#define SCI_DOCLINEFROMVISIBLE 2221 #define SCI_DOCLINEFROMVISIBLE 2221
#define SCI_WRAPCOUNT 2235 #define SCI_WRAPCOUNT 2235
@@ -607,6 +615,11 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
#define SCI_SETPASTECONVERTENDINGS 2467 #define SCI_SETPASTECONVERTENDINGS 2467
#define SCI_GETPASTECONVERTENDINGS 2468 #define SCI_GETPASTECONVERTENDINGS 2468
#define SCI_SELECTIONDUPLICATE 2469 #define SCI_SELECTIONDUPLICATE 2469
#define SC_ALPHA_TRANSPARENT 0
#define SC_ALPHA_OPAQUE 255
#define SC_ALPHA_NOALPHA 256
#define SCI_SETCARETLINEBACKALPHA 2470
#define SCI_GETCARETLINEBACKALPHA 2471
#define SCI_STARTRECORD 3001 #define SCI_STARTRECORD 3001
#define SCI_STOPRECORD 3002 #define SCI_STOPRECORD 3002
#define SCI_SETLEXER 4001 #define SCI_SETLEXER 4001

View File

@@ -316,9 +316,14 @@ fun void MarkerDefinePixmap=2049(int markerNumber, string pixmap)
# Add a set of markers to a line. # Add a set of markers to a line.
fun void MarkerAddSet=2466(int line, int set) fun void MarkerAddSet=2466(int line, int set)
# Set the alpha used for a marker that is drawn in the text area, not the margin.
fun void MarkerSetAlpha=2476(int markerNumber, int alpha)
enu MarginType=SC_MARGIN_ enu MarginType=SC_MARGIN_
val SC_MARGIN_SYMBOL=0 val SC_MARGIN_SYMBOL=0
val SC_MARGIN_NUMBER=1 val SC_MARGIN_NUMBER=1
val SC_MARGIN_BACK=2
val SC_MARGIN_FORE=3
# Set a margin to be either numeric or symbolic. # Set a margin to be either numeric or symbolic.
set void SetMarginTypeN=2240(int margin, int marginType) set void SetMarginTypeN=2240(int margin, int marginType)
@@ -344,8 +349,8 @@ set void SetMarginSensitiveN=2246(int margin, bool sensitive)
# Retrieve the mouse click sensitivity of a margin. # Retrieve the mouse click sensitivity of a margin.
get bool GetMarginSensitiveN=2247(int margin,) get bool GetMarginSensitiveN=2247(int margin,)
# Styles in range 32..37 are predefined for parts of the UI and are not used as normal styles. # Styles in range 32..38 are predefined for parts of the UI and are not used as normal styles.
# Styles 38 and 39 are for future use. # Style 39 is for future use.
enu StylesCommon=STYLE_ enu StylesCommon=STYLE_
val STYLE_DEFAULT=32 val STYLE_DEFAULT=32
val STYLE_LINENUMBER=33 val STYLE_LINENUMBER=33
@@ -353,6 +358,7 @@ val STYLE_BRACELIGHT=34
val STYLE_BRACEBAD=35 val STYLE_BRACEBAD=35
val STYLE_CONTROLCHAR=36 val STYLE_CONTROLCHAR=36
val STYLE_INDENTGUIDE=37 val STYLE_INDENTGUIDE=37
val STYLE_CALLTIP=38
val STYLE_LASTPREDEFINED=39 val STYLE_LASTPREDEFINED=39
val STYLE_MAX=127 val STYLE_MAX=127
@@ -430,6 +436,12 @@ fun void SetSelFore=2067(bool useSetting, colour fore)
# Set the background colour of the selection and whether to use this setting. # Set the background colour of the selection and whether to use this setting.
fun void SetSelBack=2068(bool useSetting, colour back) fun void SetSelBack=2068(bool useSetting, colour back)
# Get the alpha of the selection.
get int GetSelAlpha=2477(,)
# Set the alpha of the selection.
set void SetSelAlpha=2478(int alpha,)
# Set the foreground colour of the caret. # Set the foreground colour of the caret.
set void SetCaretFore=2069(colour fore,) set void SetCaretFore=2069(colour fore,)
@@ -474,6 +486,7 @@ val INDIC_DIAGONAL=3
val INDIC_STRIKE=4 val INDIC_STRIKE=4
val INDIC_HIDDEN=5 val INDIC_HIDDEN=5
val INDIC_BOX=6 val INDIC_BOX=6
val INDIC_ROUNDBOX=7
val INDIC0_MASK=0x20 val INDIC0_MASK=0x20
val INDIC1_MASK=0x40 val INDIC1_MASK=0x40
val INDIC2_MASK=0x80 val INDIC2_MASK=0x80
@@ -919,6 +932,9 @@ set void CallTipSetFore=2206(colour fore,)
# Set the foreground colour for the highlighted part of the call tip. # Set the foreground colour for the highlighted part of the call tip.
set void CallTipSetForeHlt=2207(colour fore,) set void CallTipSetForeHlt=2207(colour fore,)
# Enable use of STYLE_CALLTIP and set call tip tab size in pixels.
set void CallTipUseStyle=2212(int tabSize,)
# Find the display line of a document line taking hidden lines into account. # Find the display line of a document line taking hidden lines into account.
fun int VisibleFromDocLine=2220(int line,) fun int VisibleFromDocLine=2220(int line,)
@@ -1446,7 +1462,6 @@ get int GetXOffset=2398(,)
fun void ChooseCaretX=2399(,) fun void ChooseCaretX=2399(,)
# Set the focus to this Scintilla widget. # Set the focus to this Scintilla widget.
# GTK+ Specific.
fun void GrabFocus=2400(,) fun void GrabFocus=2400(,)
enu CaretPolicy = CARET_ enu CaretPolicy = CARET_
@@ -1642,6 +1657,16 @@ get bool GetPasteConvertEndings=2468(,)
# Duplicate the selection. If selection empty duplicate the line containing the caret. # Duplicate the selection. If selection empty duplicate the line containing the caret.
fun void SelectionDuplicate=2469(,) fun void SelectionDuplicate=2469(,)
val SC_ALPHA_TRANSPARENT=0
val SC_ALPHA_OPAQUE=255
val SC_ALPHA_NOALPHA=256
# Set background alpha of the caret line.
set void SetCaretLineBackAlpha=2470(int alpha,)
# Get the background alpha of the caret line.
get int GetCaretLineBackAlpha=2471(,)
# Start notifying the container of all key presses and commands. # Start notifying the container of all key presses and commands.
fun void StartRecord=3001(,) fun void StartRecord=3001(,)
@@ -1820,11 +1845,9 @@ val SCLEX_SMALLTALK=72
val SCLEX_FLAGSHIP=73 val SCLEX_FLAGSHIP=73
val SCLEX_CSOUND=74 val SCLEX_CSOUND=74
val SCLEX_FREEBASIC=75 val SCLEX_FREEBASIC=75
val SCLEX_INNOSETUP=76
# These are deprecated, STC_LEX_HTML should be used instead. val SCLEX_OPAL=77
val SCLEX_ASP=29 val SCLEX_SPICE=78
val SCLEX_PHP=30
# When a lexer specifies its language as SCLEX_AUTOMATIC it receives a # When a lexer specifies its language as SCLEX_AUTOMATIC it receives a
# value assigned in sequence from SCLEX_AUTOMATIC+1. # value assigned in sequence from SCLEX_AUTOMATIC+1.
@@ -1850,7 +1873,6 @@ val SCE_P_DECORATOR=15
# Lexical states for SCLEX_CPP # Lexical states for SCLEX_CPP
lex Cpp=SCLEX_CPP SCE_C_ lex Cpp=SCLEX_CPP SCE_C_
lex Pascal=SCLEX_PASCAL SCE_C_ lex Pascal=SCLEX_PASCAL SCE_C_
lex TCL=SCLEX_TCL SCE_C_
lex BullAnt=SCLEX_BULLANT SCE_C_ lex BullAnt=SCLEX_BULLANT SCE_C_
val SCE_C_DEFAULT=0 val SCE_C_DEFAULT=0
val SCE_C_COMMENT=1 val SCE_C_COMMENT=1
@@ -1872,6 +1894,30 @@ val SCE_C_WORD2=16
val SCE_C_COMMENTDOCKEYWORD=17 val SCE_C_COMMENTDOCKEYWORD=17
val SCE_C_COMMENTDOCKEYWORDERROR=18 val SCE_C_COMMENTDOCKEYWORDERROR=18
val SCE_C_GLOBALCLASS=19 val SCE_C_GLOBALCLASS=19
# Lexical states for SCLEX_TCL
lex TCL=SCLEX_TCL SCE_TCL_
val SCE_TCL_DEFAULT=0
val SCE_TCL_COMMENT=1
val SCE_TCL_COMMENTLINE=2
val SCE_TCL_NUMBER=3
val SCE_TCL_WORD_IN_QUOTE=4
val SCE_TCL_IN_QUOTE=5
val SCE_TCL_OPERATOR=6
val SCE_TCL_IDENTIFIER=7
val SCE_TCL_SUBSTITUTION=8
val SCE_TCL_SUB_BRACE=9
val SCE_TCL_MODIFIER=10
val SCE_TCL_EXPAND=11
val SCE_TCL_WORD=12
val SCE_TCL_WORD2=13
val SCE_TCL_WORD3=14
val SCE_TCL_WORD4=15
val SCE_TCL_WORD5=16
val SCE_TCL_WORD6=17
val SCE_TCL_WORD7=18
val SCE_TCL_WORD8=19
val SCE_TCL_COMMENT_BOX=20
val SCE_TCL_BLOCK_COMMENT=21
# Lexical states for SCLEX_HTML, SCLEX_XML # Lexical states for SCLEX_HTML, SCLEX_XML
lex HTML=SCLEX_HTML SCE_H lex HTML=SCLEX_HTML SCE_H
lex XML=SCLEX_XML SCE_H lex XML=SCLEX_XML SCE_H
@@ -2100,6 +2146,7 @@ val SCE_PROPS_COMMENT=1
val SCE_PROPS_SECTION=2 val SCE_PROPS_SECTION=2
val SCE_PROPS_ASSIGNMENT=3 val SCE_PROPS_ASSIGNMENT=3
val SCE_PROPS_DEFVAL=4 val SCE_PROPS_DEFVAL=4
val SCE_PROPS_KEY=5
# Lexical states for SCLEX_LATEX # Lexical states for SCLEX_LATEX
lex LaTeX=SCLEX_LATEX SCE_L_ lex LaTeX=SCLEX_LATEX SCE_L_
val SCE_L_DEFAULT=0 val SCE_L_DEFAULT=0
@@ -2646,6 +2693,7 @@ val SCE_AU3_PREPROCESSOR=11
val SCE_AU3_SPECIAL=12 val SCE_AU3_SPECIAL=12
val SCE_AU3_EXPAND=13 val SCE_AU3_EXPAND=13
val SCE_AU3_COMOBJ=14 val SCE_AU3_COMOBJ=14
val SCE_AU3_UDF=15
# Lexical states for SCLEX_APDL # Lexical states for SCLEX_APDL
lex APDL=SCLEX_APDL SCE_APDL_ lex APDL=SCLEX_APDL SCE_APDL_
val SCE_APDL_DEFAULT=0 val SCE_APDL_DEFAULT=0
@@ -2883,6 +2931,44 @@ val SCE_CSOUND_KRATE_VAR=12
val SCE_CSOUND_IRATE_VAR=13 val SCE_CSOUND_IRATE_VAR=13
val SCE_CSOUND_GLOBAL_VAR=14 val SCE_CSOUND_GLOBAL_VAR=14
val SCE_CSOUND_STRINGEOL=15 val SCE_CSOUND_STRINGEOL=15
# Lexical states for SCLEX_INNOSETUP
lex Inno=SCLEX_INNOSETUP SCE_INNO_
val SCE_INNO_DEFAULT=0
val SCE_INNO_COMMENT=1
val SCE_INNO_KEYWORD=2
val SCE_INNO_PARAMETER=3
val SCE_INNO_SECTION=4
val SCE_INNO_PREPROC=5
val SCE_INNO_PREPROC_INLINE=6
val SCE_INNO_COMMENT_PASCAL=7
val SCE_INNO_KEYWORD_PASCAL=8
val SCE_INNO_KEYWORD_USER=9
val SCE_INNO_STRING_DOUBLE=10
val SCE_INNO_STRING_SINGLE=11
val SCE_INNO_IDENTIFIER=12
# Lexical states for SCLEX_OPAL
lex Opal=SCLEX_OPAL SCE_OPAL_
val SCE_OPAL_SPACE=0
val SCE_OPAL_COMMENT_BLOCK=1
val SCE_OPAL_COMMENT_LINE=2
val SCE_OPAL_INTEGER=3
val SCE_OPAL_KEYWORD=4
val SCE_OPAL_SORT=5
val SCE_OPAL_STRING=6
val SCE_OPAL_PAR=7
val SCE_OPAL_BOOL_CONST=8
val SCE_OPAL_DEFAULT=32
# Lexical states for SCLEX_SPICE
lex Spice=SCLEX_SPICE SCE_SPICE_
val SCE_SPICE_DEFAULT=0
val SCE_SPICE_IDENTIFIER=1
val SCE_SPICE_KEYWORD=2
val SCE_SPICE_KEYWORD2=3
val SCE_SPICE_KEYWORD3=4
val SCE_SPICE_NUMBER=5
val SCE_SPICE_DELIMITER=6
val SCE_SPICE_VALUE=7
val SCE_SPICE_COMMENTLINE=8
# Events # Events

View File

@@ -34,7 +34,11 @@ struct _ScintillaClass {
void (* notify) (ScintillaObject *ttt); void (* notify) (ScintillaObject *ttt);
}; };
#if GLIB_MAJOR_VERSION < 2
GtkType scintilla_get_type (void); GtkType scintilla_get_type (void);
#else
GType scintilla_get_type (void);
#endif
GtkWidget* scintilla_new (void); GtkWidget* scintilla_new (void);
void scintilla_set_id (ScintillaObject *sci, uptr_t id); void scintilla_set_id (ScintillaObject *sci, uptr_t id);
sptr_t scintilla_send_message (ScintillaObject *sci,unsigned int iMessage, uptr_t wParam, sptr_t lParam); sptr_t scintilla_send_message (ScintillaObject *sci,unsigned int iMessage, uptr_t wParam, sptr_t lParam);

View File

@@ -13,6 +13,9 @@
#include "Scintilla.h" #include "Scintilla.h"
#include "CallTip.h" #include "CallTip.h"
static const int insetX = 5; // text inset in x from calltip border
static const int widthArrow = 14;
CallTip::CallTip() { CallTip::CallTip() {
wCallTip = 0; wCallTip = 0;
inCallTipMode = false; inCallTipMode = false;
@@ -23,6 +26,8 @@ CallTip::CallTip() {
lineHeight = 1; lineHeight = 1;
startHighlight = 0; startHighlight = 0;
endHighlight = 0; endHighlight = 0;
tabSize = 0;
useStyleCallTip = false; // for backwards compatibility
colourBG.desired = ColourDesired(0xff, 0xff, 0xff); colourBG.desired = ColourDesired(0xff, 0xff, 0xff);
colourUnSel.desired = ColourDesired(0x80, 0x80, 0x80); colourUnSel.desired = ColourDesired(0x80, 0x80, 0x80);
@@ -38,8 +43,6 @@ CallTip::~CallTip() {
val = 0; val = 0;
} }
const int widthArrow = 14;
void CallTip::RefreshColourPalette(Palette &pal, bool want) { void CallTip::RefreshColourPalette(Palette &pal, bool want) {
pal.WantFind(colourBG, want); pal.WantFind(colourBG, want);
pal.WantFind(colourUnSel, want); pal.WantFind(colourUnSel, want);
@@ -48,19 +51,42 @@ void CallTip::RefreshColourPalette(Palette &pal, bool want) {
pal.WantFind(colourLight, want); pal.WantFind(colourLight, want);
} }
// Although this test includes 0, we should never see a \0 character.
static bool IsArrowCharacter(char ch) { static bool IsArrowCharacter(char ch) {
return (ch == 0) || (ch == '\001') || (ch == '\002'); return (ch == 0) || (ch == '\001') || (ch == '\002');
} }
// We ignore tabs unless a tab width has been set.
bool CallTip::IsTabCharacter(char ch) {
return (tabSize > 0) && (ch == '\t');
}
int CallTip::NextTabPos(int x) {
if (tabSize > 0) { // paranoia... not called unless this is true
x -= insetX; // position relative to text
x = (x + tabSize) / tabSize; // tab "number"
return tabSize*x + insetX; // position of next tab
} else {
return x + 1; // arbitrary
}
}
// Draw a section of the call tip that does not include \n in one colour.
// The text may include up to numEnds tabs or arrow characters.
void CallTip::DrawChunk(Surface *surface, int &x, const char *s, void CallTip::DrawChunk(Surface *surface, int &x, const char *s,
int posStart, int posEnd, int ytext, PRectangle rcClient, int posStart, int posEnd, int ytext, PRectangle rcClient,
bool highlight, bool draw) { bool highlight, bool draw) {
s += posStart; s += posStart;
int len = posEnd - posStart; int len = posEnd - posStart;
// Divide the text into sections that are all text, or that are
// single arrows or single tab characters (if tabSize > 0).
int maxEnd = 0; int maxEnd = 0;
int ends[10]; const int numEnds = 10;
int ends[numEnds + 2];
for (int i=0;i<len;i++) { for (int i=0;i<len;i++) {
if (IsArrowCharacter(s[i])) { if ((maxEnd < numEnds) &&
(IsArrowCharacter(s[i]) || IsTabCharacter(s[i])) ) {
if (i > 0) if (i > 0)
ends[maxEnd++] = i; ends[maxEnd++] = i;
ends[maxEnd++] = i+1; ends[maxEnd++] = i+1;
@@ -73,20 +99,19 @@ void CallTip::DrawChunk(Surface *surface, int &x, const char *s,
int endSeg = ends[seg]; int endSeg = ends[seg];
if (endSeg > startSeg) { if (endSeg > startSeg) {
if (IsArrowCharacter(s[startSeg])) { if (IsArrowCharacter(s[startSeg])) {
xEnd = x + widthArrow; bool upArrow = s[startSeg] == '\001';
offsetMain = xEnd;
rcClient.left = x; rcClient.left = x;
rcClient.right = xEnd; rcClient.right = rcClient.left + widthArrow;
if (draw) { if (draw) {
const int halfWidth = widthArrow / 2 - 3; const int halfWidth = widthArrow / 2 - 3;
const int centreX = x + widthArrow / 2 - 1; const int centreX = rcClient.left + widthArrow / 2 - 1;
const int centreY = (rcClient.top + rcClient.bottom) / 2; const int centreY = (rcClient.top + rcClient.bottom) / 2;
surface->FillRectangle(rcClient, colourBG.allocated); surface->FillRectangle(rcClient, colourBG.allocated);
PRectangle rcClientInner(rcClient.left+1, rcClient.top+1, rcClient.right-2, rcClient.bottom-1); PRectangle rcClientInner(rcClient.left + 1, rcClient.top + 1,
rcClient.right - 2, rcClient.bottom - 1);
surface->FillRectangle(rcClientInner, colourUnSel.allocated); surface->FillRectangle(rcClientInner, colourUnSel.allocated);
if (s[startSeg] == '\001') { if (upArrow) { // Up arrow
// Up arrow
Point pts[] = { Point pts[] = {
Point(centreX - halfWidth, centreY + halfWidth / 2), Point(centreX - halfWidth, centreY + halfWidth / 2),
Point(centreX + halfWidth, centreY + halfWidth / 2), Point(centreX + halfWidth, centreY + halfWidth / 2),
@@ -94,8 +119,7 @@ void CallTip::DrawChunk(Surface *surface, int &x, const char *s,
}; };
surface->Polygon(pts, sizeof(pts) / sizeof(pts[0]), surface->Polygon(pts, sizeof(pts) / sizeof(pts[0]),
colourBG.allocated, colourBG.allocated); colourBG.allocated, colourBG.allocated);
} else { } else { // Down arrow
// Down arrow
Point pts[] = { Point pts[] = {
Point(centreX - halfWidth, centreY - halfWidth / 2), Point(centreX - halfWidth, centreY - halfWidth / 2),
Point(centreX + halfWidth, centreY - halfWidth / 2), Point(centreX + halfWidth, centreY - halfWidth / 2),
@@ -105,20 +129,23 @@ void CallTip::DrawChunk(Surface *surface, int &x, const char *s,
colourBG.allocated, colourBG.allocated); colourBG.allocated, colourBG.allocated);
} }
} }
if (s[startSeg] == '\001') { xEnd = rcClient.right;
offsetMain = xEnd;
if (upArrow) {
rectUp = rcClient; rectUp = rcClient;
} else if (s[startSeg] == '\002') { } else {
rectDown = rcClient; rectDown = rcClient;
} }
} else if (IsTabCharacter(s[startSeg])) {
xEnd = NextTabPos(x);
} else { } else {
xEnd = x + surface->WidthText(font, s+startSeg, endSeg - startSeg); xEnd = x + surface->WidthText(font, s + startSeg, endSeg - startSeg);
if (draw) { if (draw) {
rcClient.left = x; rcClient.left = x;
rcClient.right = xEnd; rcClient.right = xEnd;
surface->DrawTextNoClip(rcClient, font, ytext, surface->DrawTextTransparent(rcClient, font, ytext,
s+startSeg, endSeg - startSeg, s+startSeg, endSeg - startSeg,
highlight ? colourSel.allocated : colourUnSel.allocated, highlight ? colourSel.allocated : colourUnSel.allocated);
colourBG.allocated);
} }
} }
x = xEnd; x = xEnd;
@@ -160,7 +187,7 @@ int CallTip::PaintContents(Surface *surfaceWindow, bool draw) {
thisEndHighlight -= chunkOffset; thisEndHighlight -= chunkOffset;
rcClient.top = ytext - ascent - 1; rcClient.top = ytext - ascent - 1;
int x = 5; int x = insetX; // start each line at this inset
DrawChunk(surfaceWindow, x, chunkVal, 0, thisStartHighlight, DrawChunk(surfaceWindow, x, chunkVal, 0, thisStartHighlight,
ytext, rcClient, false, draw); ytext, rcClient, false, draw);
@@ -187,7 +214,7 @@ void CallTip::PaintCT(Surface *surfaceWindow) {
surfaceWindow->FillRectangle(rcClient, colourBG.allocated); surfaceWindow->FillRectangle(rcClient, colourBG.allocated);
offsetMain = 5; offsetMain = insetX; // initial alignment assuming no arrows
PaintContents(surfaceWindow, true); PaintContents(surfaceWindow, true);
// Draw a raised border around the edges of the window // Draw a raised border around the edges of the window
@@ -238,14 +265,17 @@ PRectangle CallTip::CallTipStart(int pos, Point pt, const char *defn,
const char *look = val; const char *look = val;
rectUp = PRectangle(0,0,0,0); rectUp = PRectangle(0,0,0,0);
rectDown = PRectangle(0,0,0,0); rectDown = PRectangle(0,0,0,0);
offsetMain = 5; offsetMain = insetX; // changed to right edge of any arrows
int width = PaintContents(surfaceMeasure, false) + 5; int width = PaintContents(surfaceMeasure, false) + insetX;
while ((newline = strchr(look, '\n')) != NULL) { while ((newline = strchr(look, '\n')) != NULL) {
look = newline + 1; look = newline + 1;
numLines++; numLines++;
} }
lineHeight = surfaceMeasure->Height(font); lineHeight = surfaceMeasure->Height(font);
// Extra line for border and an empty line at top and bottom
// Extra line for border and an empty line at top and bottom. The returned
// rectangle is aligned to the right edge of the last arrow encountered in
// the tip text, else to the tip text left edge.
int height = lineHeight * numLines - surfaceMeasure->InternalLeading(font) + 2 + 2; int height = lineHeight * numLines - surfaceMeasure->InternalLeading(font) + 2 + 2;
delete surfaceMeasure; delete surfaceMeasure;
return PRectangle(pt.x - offsetMain, pt.y + 1, pt.x + width - offsetMain, pt.y + 1 + height); return PRectangle(pt.x - offsetMain, pt.y + 1, pt.x + width - offsetMain, pt.y + 1 + height);
@@ -268,3 +298,17 @@ void CallTip::SetHighlight(int start, int end) {
} }
} }
} }
// Set the tab size (sizes > 0 enable the use of tabs). This also enables the
// use of the STYLE_CALLTIP.
void CallTip::SetTabSize(int tabSz) {
tabSize = tabSz;
useStyleCallTip = true;
}
// It might be better to have two access functions for this and to use
// them for all settings of colours.
void CallTip::SetForeBack(const ColourPair &fore, const ColourPair &back) {
colourBG = back;
colourUnSel = fore;
}

View File

@@ -11,14 +11,17 @@
/** /**
*/ */
class CallTip { class CallTip {
int startHighlight; int startHighlight; // character offset to start and...
int endHighlight; int endHighlight; // ...end of highlighted text
char *val; char *val;
Font font; Font font;
PRectangle rectUp; PRectangle rectUp; // rectangle of last up angle in the tip
PRectangle rectDown; PRectangle rectDown; // rectangle of last down arrow in the tip
int lineHeight; int lineHeight; // vertical line spacing
int offsetMain; int offsetMain; // The alignment point of the call tip
int tabSize; // Tab size in pixels, <=0 no TAB expand
bool useStyleCallTip; // if true, STYLE_CALLTIP should be used
// Private so CallTip objects can not be copied // Private so CallTip objects can not be copied
CallTip(const CallTip &) {} CallTip(const CallTip &) {}
CallTip &operator=(const CallTip &) { return *this; } CallTip &operator=(const CallTip &) { return *this; }
@@ -26,6 +29,8 @@ class CallTip {
int posStart, int posEnd, int ytext, PRectangle rcClient, int posStart, int posEnd, int ytext, PRectangle rcClient,
bool highlight, bool draw); bool highlight, bool draw);
int PaintContents(Surface *surfaceWindow, bool draw); int PaintContents(Surface *surfaceWindow, bool draw);
bool IsTabCharacter(char c);
int NextTabPos(int x);
public: public:
Window wCallTip; Window wCallTip;
@@ -60,6 +65,15 @@ public:
/// Set a range of characters to be displayed in a highlight style. /// Set a range of characters to be displayed in a highlight style.
/// Commonly used to highlight the current parameter. /// Commonly used to highlight the current parameter.
void SetHighlight(int start, int end); void SetHighlight(int start, int end);
/// Set the tab size in pixels for the call tip. 0 or -ve means no tab expand.
void SetTabSize(int tabSz);
/// Used to determine which STYLE_xxxx to use for call tip information
bool UseStyleCallTip() const { return useStyleCallTip;}
// Modify foreground and background colours
void SetForeBack(const ColourPair &fore, const ColourPair &back);
}; };
#endif #endif

View File

@@ -0,0 +1,43 @@
// Scintilla source code edit control
/** @file CharClassify.cxx
** Character classifications used by Document and RESearch.
**/
// Copyright 2006 by Neil Hodgson <neilh@scintilla.org>
// The License.txt file describes the conditions under which this software may be distributed.
#include <ctype.h>
#include "CharClassify.h"
// Shut up annoying Visual C++ warnings:
#ifdef _MSC_VER
#pragma warning(disable: 4514)
#endif
CharClassify::CharClassify() {
SetDefaultCharClasses(true);
}
void CharClassify::SetDefaultCharClasses(bool includeWordClass) {
// Initialize all char classes to default values
for (int ch = 0; ch < 256; ch++) {
if (ch == '\r' || ch == '\n')
charClass[ch] = ccNewLine;
else if (ch < 0x20 || ch == ' ')
charClass[ch] = ccSpace;
else if (includeWordClass && (ch >= 0x80 || isalnum(ch) || ch == '_'))
charClass[ch] = ccWord;
else
charClass[ch] = ccPunctuation;
}
}
void CharClassify::SetCharClasses(const unsigned char *chars, cc newCharClass) {
// Apply the newCharClass to the specifed chars
if (chars) {
while (*chars) {
charClass[*chars] = static_cast<unsigned char>(newCharClass);
chars++;
}
}
}

View File

@@ -0,0 +1,25 @@
// Scintilla source code edit control
/** @file CharClassify.h
** Character classifications used by Document and RESearch.
**/
// Copyright 2006 by Neil Hodgson <neilh@scintilla.org>
// The License.txt file describes the conditions under which this software may be distributed.
#ifndef CHARCLASSIFY_H
#define CHARCLASSIFY_H
class CharClassify {
public:
CharClassify();
enum cc { ccSpace, ccNewLine, ccWord, ccPunctuation };
void SetDefaultCharClasses(bool includeWordClass);
void SetCharClasses(const unsigned char *chars, cc newCharClass);
cc GetClass(unsigned char ch) const { return static_cast<cc>(charClass[ch]);}
bool IsWord(unsigned char ch) const { return static_cast<cc>(charClass[ch]) == ccWord;}
private:
enum { maxChar=256 };
unsigned char charClass[maxChar]; // not type cc to save space
};
#endif

View File

@@ -280,4 +280,10 @@ void ContractionState::ShowAll() {
delete []lines; delete []lines;
lines = 0; lines = 0;
size = 0; size = 0;
delete []docLines;
docLines = 0;
sizeDocLines = 0;
linesInDisplay = linesInDoc;
} }

View File

@@ -15,6 +15,7 @@
#include "Scintilla.h" #include "Scintilla.h"
#include "SVector.h" #include "SVector.h"
#include "CellBuffer.h" #include "CellBuffer.h"
#include "CharClassify.h"
#include "Document.h" #include "Document.h"
#include "RESearch.h" #include "RESearch.h"
@@ -50,7 +51,6 @@ Document::Document() {
stylingBits = 5; stylingBits = 5;
stylingBitsMask = 0x1F; stylingBitsMask = 0x1F;
stylingMask = 0; stylingMask = 0;
SetDefaultCharClasses(true);
endStyled = 0; endStyled = 0;
styleClock = 0; styleClock = 0;
enteredCount = 0; enteredCount = 0;
@@ -836,10 +836,10 @@ int Document::ParaDown(int pos) {
return LineEnd(line-1); return LineEnd(line-1);
} }
Document::charClassification Document::WordCharClass(unsigned char ch) { CharClassify::cc Document::WordCharClass(unsigned char ch) {
if ((SC_CP_UTF8 == dbcsCodePage) && (ch >= 0x80)) if ((SC_CP_UTF8 == dbcsCodePage) && (ch >= 0x80))
return ccWord; return CharClassify::ccWord;
return charClass[ch]; return charClass.GetClass(ch);
} }
/** /**
@@ -847,7 +847,7 @@ Document::charClassification Document::WordCharClass(unsigned char ch) {
* Finds the start of word at pos when delta < 0 or the end of the word when delta >= 0. * Finds the start of word at pos when delta < 0 or the end of the word when delta >= 0.
*/ */
int Document::ExtendWordSelect(int pos, int delta, bool onlyWordCharacters) { int Document::ExtendWordSelect(int pos, int delta, bool onlyWordCharacters) {
charClassification ccStart = ccWord; CharClassify::cc ccStart = CharClassify::ccWord;
if (delta < 0) { if (delta < 0) {
if (!onlyWordCharacters) if (!onlyWordCharacters)
ccStart = WordCharClass(cb.CharAt(pos-1)); ccStart = WordCharClass(cb.CharAt(pos-1));
@@ -871,19 +871,19 @@ int Document::ExtendWordSelect(int pos, int delta, bool onlyWordCharacters) {
*/ */
int Document::NextWordStart(int pos, int delta) { int Document::NextWordStart(int pos, int delta) {
if (delta < 0) { if (delta < 0) {
while (pos > 0 && (WordCharClass(cb.CharAt(pos - 1)) == ccSpace)) while (pos > 0 && (WordCharClass(cb.CharAt(pos - 1)) == CharClassify::ccSpace))
pos--; pos--;
if (pos > 0) { if (pos > 0) {
charClassification ccStart = WordCharClass(cb.CharAt(pos-1)); CharClassify::cc ccStart = WordCharClass(cb.CharAt(pos-1));
while (pos > 0 && (WordCharClass(cb.CharAt(pos - 1)) == ccStart)) { while (pos > 0 && (WordCharClass(cb.CharAt(pos - 1)) == ccStart)) {
pos--; pos--;
} }
} }
} else { } else {
charClassification ccStart = WordCharClass(cb.CharAt(pos)); CharClassify::cc ccStart = WordCharClass(cb.CharAt(pos));
while (pos < (Length()) && (WordCharClass(cb.CharAt(pos)) == ccStart)) while (pos < (Length()) && (WordCharClass(cb.CharAt(pos)) == ccStart))
pos++; pos++;
while (pos < (Length()) && (WordCharClass(cb.CharAt(pos)) == ccSpace)) while (pos < (Length()) && (WordCharClass(cb.CharAt(pos)) == CharClassify::ccSpace))
pos++; pos++;
} }
return pos; return pos;
@@ -899,22 +899,22 @@ int Document::NextWordStart(int pos, int delta) {
int Document::NextWordEnd(int pos, int delta) { int Document::NextWordEnd(int pos, int delta) {
if (delta < 0) { if (delta < 0) {
if (pos > 0) { if (pos > 0) {
charClassification ccStart = WordCharClass(cb.CharAt(pos-1)); CharClassify::cc ccStart = WordCharClass(cb.CharAt(pos-1));
if (ccStart != ccSpace) { if (ccStart != CharClassify::ccSpace) {
while (pos > 0 && WordCharClass(cb.CharAt(pos - 1)) == ccStart) { while (pos > 0 && WordCharClass(cb.CharAt(pos - 1)) == ccStart) {
pos--; pos--;
} }
} }
while (pos > 0 && WordCharClass(cb.CharAt(pos - 1)) == ccSpace) { while (pos > 0 && WordCharClass(cb.CharAt(pos - 1)) == CharClassify::ccSpace) {
pos--; pos--;
} }
} }
} else { } else {
while (pos < Length() && WordCharClass(cb.CharAt(pos)) == ccSpace) { while (pos < Length() && WordCharClass(cb.CharAt(pos)) == CharClassify::ccSpace) {
pos++; pos++;
} }
if (pos < Length()) { if (pos < Length()) {
charClassification ccStart = WordCharClass(cb.CharAt(pos)); CharClassify::cc ccStart = WordCharClass(cb.CharAt(pos));
while (pos < Length() && WordCharClass(cb.CharAt(pos)) == ccStart) { while (pos < Length() && WordCharClass(cb.CharAt(pos)) == ccStart) {
pos++; pos++;
} }
@@ -929,8 +929,8 @@ int Document::NextWordEnd(int pos, int delta) {
*/ */
bool Document::IsWordStartAt(int pos) { bool Document::IsWordStartAt(int pos) {
if (pos > 0) { if (pos > 0) {
charClassification ccPos = WordCharClass(CharAt(pos)); CharClassify::cc ccPos = WordCharClass(CharAt(pos));
return (ccPos == ccWord || ccPos == ccPunctuation) && return (ccPos == CharClassify::ccWord || ccPos == CharClassify::ccPunctuation) &&
(ccPos != WordCharClass(CharAt(pos - 1))); (ccPos != WordCharClass(CharAt(pos - 1)));
} }
return true; return true;
@@ -942,8 +942,8 @@ bool Document::IsWordStartAt(int pos) {
*/ */
bool Document::IsWordEndAt(int pos) { bool Document::IsWordEndAt(int pos) {
if (pos < Length()) { if (pos < Length()) {
charClassification ccPrev = WordCharClass(CharAt(pos-1)); CharClassify::cc ccPrev = WordCharClass(CharAt(pos-1));
return (ccPrev == ccWord || ccPrev == ccPunctuation) && return (ccPrev == CharClassify::ccWord || ccPrev == CharClassify::ccPunctuation) &&
(ccPrev != WordCharClass(CharAt(pos))); (ccPrev != WordCharClass(CharAt(pos)));
} }
return true; return true;
@@ -1004,7 +1004,7 @@ long Document::FindText(int minPos, int maxPos, const char *s,
int *length) { int *length) {
if (regExp) { if (regExp) {
if (!pre) if (!pre)
pre = new RESearch(); pre = new RESearch(&charClass);
if (!pre) if (!pre)
return -1; return -1;
@@ -1266,27 +1266,11 @@ void Document::ChangeCase(Range r, bool makeUpperCase) {
} }
void Document::SetDefaultCharClasses(bool includeWordClass) { void Document::SetDefaultCharClasses(bool includeWordClass) {
// Initialize all char classes to default values charClass.SetDefaultCharClasses(includeWordClass);
for (int ch = 0; ch < 256; ch++) {
if (ch == '\r' || ch == '\n')
charClass[ch] = ccNewLine;
else if (ch < 0x20 || ch == ' ')
charClass[ch] = ccSpace;
else if (includeWordClass && (ch >= 0x80 || isalnum(ch) || ch == '_'))
charClass[ch] = ccWord;
else
charClass[ch] = ccPunctuation;
}
} }
void Document::SetCharClasses(const unsigned char *chars, charClassification newCharClass) { void Document::SetCharClasses(const unsigned char *chars, CharClassify::cc newCharClass) {
// Apply the newCharClass to the specifed chars charClass.SetCharClasses(chars, newCharClass);
if (chars) {
while (*chars) {
charClass[*chars] = newCharClass;
chars++;
}
}
} }
void Document::SetStylingBits(int bits) { void Document::SetStylingBits(int bits) {
@@ -1430,7 +1414,7 @@ void Document::NotifyModified(DocModification mh) {
} }
bool Document::IsWordPartSeparator(char ch) { bool Document::IsWordPartSeparator(char ch) {
return (WordCharClass(ch) == ccWord) && IsPunctuation(ch); return (WordCharClass(ch) == CharClassify::ccWord) && IsPunctuation(ch);
} }
int Document::WordPartLeft(int pos) { int Document::WordPartLeft(int pos) {

View File

@@ -93,7 +93,7 @@ public:
private: private:
int refCount; int refCount;
CellBuffer cb; CellBuffer cb;
charClassification charClass[256]; CharClassify charClass;
char stylingMask; char stylingMask;
int endStyled; int endStyled;
int styleClock; int styleClock;
@@ -207,7 +207,7 @@ public:
void ChangeCase(Range r, bool makeUpperCase); void ChangeCase(Range r, bool makeUpperCase);
void SetDefaultCharClasses(bool includeWordClass); void SetDefaultCharClasses(bool includeWordClass);
void SetCharClasses(const unsigned char *chars, charClassification newCharClass); void SetCharClasses(const unsigned char *chars, CharClassify::cc newCharClass);
void SetStylingBits(int bits); void SetStylingBits(int bits);
void StartStyling(int position, char mask); void StartStyling(int position, char mask);
bool SetStyleFor(int length, char style); bool SetStyleFor(int length, char style);
@@ -239,7 +239,7 @@ public:
private: private:
void CheckReadOnly(); void CheckReadOnly();
charClassification WordCharClass(unsigned char ch); CharClassify::cc WordCharClass(unsigned char ch);
bool IsWordStartAt(int pos); bool IsWordStartAt(int pos);
bool IsWordEndAt(int pos); bool IsWordEndAt(int pos);
bool IsWordAt(int start, int end); bool IsWordAt(int start, int end);

View File

@@ -18,6 +18,7 @@
#include "DocumentAccessor.h" #include "DocumentAccessor.h"
#include "CellBuffer.h" #include "CellBuffer.h"
#include "Scintilla.h" #include "Scintilla.h"
#include "CharClassify.h"
#include "Document.h" #include "Document.h"
DocumentAccessor::~DocumentAccessor() { DocumentAccessor::~DocumentAccessor() {

View File

@@ -26,6 +26,7 @@
#include "LineMarker.h" #include "LineMarker.h"
#include "Style.h" #include "Style.h"
#include "ViewStyle.h" #include "ViewStyle.h"
#include "CharClassify.h"
#include "Document.h" #include "Document.h"
#include "Editor.h" #include "Editor.h"
@@ -213,7 +214,7 @@ void LineLayoutCache::Allocate(int length_) {
} }
void LineLayoutCache::AllocateForLevel(int linesOnScreen, int linesInDoc) { void LineLayoutCache::AllocateForLevel(int linesOnScreen, int linesInDoc) {
// PLATFORM_ASSERT(useCount == 0); PLATFORM_ASSERT(useCount == 0);
int lengthForLevel = 0; int lengthForLevel = 0;
if (level == llcCaret) { if (level == llcCaret) {
lengthForLevel = 1; lengthForLevel = 1;
@@ -239,7 +240,7 @@ void LineLayoutCache::AllocateForLevel(int linesOnScreen, int linesInDoc) {
} }
void LineLayoutCache::Deallocate() { void LineLayoutCache::Deallocate() {
// PLATFORM_ASSERT(useCount == 0); PLATFORM_ASSERT(useCount == 0);
for (int i = 0; i < length; i++) for (int i = 0; i < length; i++)
delete cache[i]; delete cache[i];
delete []cache; delete []cache;
@@ -284,7 +285,7 @@ LineLayout *LineLayoutCache::Retrieve(int lineNumber, int lineCaret, int maxChar
} else if (level == llcPage) { } else if (level == llcPage) {
if (lineNumber == lineCaret) { if (lineNumber == lineCaret) {
pos = 0; pos = 0;
} else { } else if (length > 1) {
pos = 1 + (lineNumber % (length - 1)); pos = 1 + (lineNumber % (length - 1));
} }
} else if (level == llcDocument) { } else if (level == llcDocument) {
@@ -327,7 +328,7 @@ void LineLayoutCache::Dispose(LineLayout *ll) {
delete ll; delete ll;
} else { } else {
useCount--; useCount--;
} }
} }
} }
@@ -428,9 +429,8 @@ Editor::Editor() {
wrapState = eWrapNone; wrapState = eWrapNone;
wrapWidth = LineLayout::wrapWidthInfinite; wrapWidth = LineLayout::wrapWidthInfinite;
docLineLastWrapped = -1; wrapStart = wrapLineLarge;
docLastLineToWrap = -1; wrapEnd = wrapLineLarge;
backgroundWrapEnabled = true;
wrapVisualFlags = 0; wrapVisualFlags = 0;
wrapVisualFlagsLocation = 0; wrapVisualFlagsLocation = 0;
wrapVisualStartIndent = 0; wrapVisualStartIndent = 0;
@@ -810,6 +810,9 @@ int Editor::PositionFromLocationClose(Point pt) {
return pdoc->MovePositionOutsideChar(i + posLineStart, 1); return pdoc->MovePositionOutsideChar(i + posLineStart, 1);
} }
} }
if (pt.x < (ll->positions[lineEnd] - subLineStart)) {
return pdoc->MovePositionOutsideChar(lineEnd + posLineStart, 1);
}
} }
} }
@@ -1483,29 +1486,18 @@ void Editor::InvalidateCaret() {
void Editor::UpdateSystemCaret() { void Editor::UpdateSystemCaret() {
} }
void Editor::NeedWrapping(int docLineStartWrapping, int docLineEndWrapping) { void Editor::NeedWrapping(int docLineStart, int docLineEnd) {
docLineStartWrapping = Platform::Minimum(docLineStartWrapping, pdoc->LinesTotal()-1); docLineStart = Platform::Clamp(docLineStart, 0, pdoc->LinesTotal());
docLineEndWrapping = Platform::Minimum(docLineEndWrapping, pdoc->LinesTotal()-1); if (wrapStart > docLineStart) {
bool noWrap = (docLastLineToWrap == docLineLastWrapped); wrapStart = docLineStart;
if (docLineLastWrapped > (docLineStartWrapping - 1)) {
docLineLastWrapped = docLineStartWrapping - 1;
if (docLineLastWrapped < -1)
docLineLastWrapped = -1;
llc.Invalidate(LineLayout::llPositions); llc.Invalidate(LineLayout::llPositions);
} }
if (noWrap) { if (wrapEnd < docLineEnd) {
docLastLineToWrap = docLineEndWrapping; wrapEnd = docLineEnd;
} else if (docLastLineToWrap < docLineEndWrapping) {
docLastLineToWrap = docLineEndWrapping + 1;
} }
if (docLastLineToWrap < -1) wrapEnd = Platform::Clamp(wrapEnd, 0, pdoc->LinesTotal());
docLastLineToWrap = -1;
if (docLastLineToWrap >= pdoc->LinesTotal())
docLastLineToWrap = pdoc->LinesTotal()-1;
// Wrap lines during idle. // Wrap lines during idle.
if ((wrapState != eWrapNone) && if ((wrapState != eWrapNone) && (wrapEnd != wrapStart)) {
backgroundWrapEnabled &&
(docLastLineToWrap != docLineLastWrapped)) {
SetIdle(true); SetIdle(true);
} }
} }
@@ -1514,33 +1506,33 @@ void Editor::NeedWrapping(int docLineStartWrapping, int docLineEndWrapping) {
// fullwrap: if true, all lines which need wrapping will be done, // fullwrap: if true, all lines which need wrapping will be done,
// in this single call. // in this single call.
// priorityWrapLineStart: If greater than zero, all lines starting from // priorityWrapLineStart: If greater than zero, all lines starting from
// here to 100 lines past will be wrapped (even if there are // here to 1 page + 100 lines past will be wrapped (even if there are
// more lines under wrapping process in idle). // more lines under wrapping process in idle).
// If it is neither fullwrap, nor priorityWrap, then 100 lines will be // If it is neither fullwrap, nor priorityWrap, then 1 page + 100 lines will be
// wrapped, if there are any wrapping going on in idle. (Generally this // wrapped, if there are any wrapping going on in idle. (Generally this
// condition is called only from idler). // condition is called only from idler).
// Return true if wrapping occurred. // Return true if wrapping occurred.
bool Editor::WrapLines(bool fullWrap, int priorityWrapLineStart) { bool Editor::WrapLines(bool fullWrap, int priorityWrapLineStart) {
// If there are any pending wraps, do them during idle if possible. // If there are any pending wraps, do them during idle if possible.
int linesInOneCall = LinesOnScreen() + 100;
if (wrapState != eWrapNone) { if (wrapState != eWrapNone) {
if (docLineLastWrapped < docLastLineToWrap) { if (wrapStart < wrapEnd) {
if (!(backgroundWrapEnabled && SetIdle(true))) { if (!SetIdle(true)) {
// Background wrapping is disabled, or idle processing // Idle processing not supported so full wrap required.
// not supported. A full wrap is required.
fullWrap = true; fullWrap = true;
} }
} }
if (!fullWrap && priorityWrapLineStart >= 0 && if (!fullWrap && priorityWrapLineStart >= 0 &&
// .. and if the paint window is outside pending wraps // .. and if the paint window is outside pending wraps
(((priorityWrapLineStart + 100) < docLineLastWrapped) || (((priorityWrapLineStart + linesInOneCall) < wrapStart) ||
(priorityWrapLineStart > docLastLineToWrap))) { (priorityWrapLineStart > wrapEnd))) {
// No priority wrap pending // No priority wrap pending
return false; return false;
} }
} }
int goodTopLine = topLine; int goodTopLine = topLine;
bool wrapOccurred = false; bool wrapOccurred = false;
if (docLineLastWrapped < pdoc->LinesTotal()) { if (wrapStart <= pdoc->LinesTotal()) {
if (wrapState == eWrapNone) { if (wrapState == eWrapNone) {
if (wrapWidth != LineLayout::wrapWidthInfinite) { if (wrapWidth != LineLayout::wrapWidthInfinite) {
wrapWidth = LineLayout::wrapWidthInfinite; wrapWidth = LineLayout::wrapWidthInfinite;
@@ -1549,8 +1541,11 @@ bool Editor::WrapLines(bool fullWrap, int priorityWrapLineStart) {
} }
wrapOccurred = true; wrapOccurred = true;
} }
docLineLastWrapped = 0x7ffffff; wrapStart = wrapLineLarge;
wrapEnd = wrapLineLarge;
} else { } else {
if (wrapEnd >= pdoc->LinesTotal())
wrapEnd = pdoc->LinesTotal();
//ElapsedTime et; //ElapsedTime et;
int lineDocTop = cs.DocFromDisplay(topLine); int lineDocTop = cs.DocFromDisplay(topLine);
int subLineTop = topLine - cs.DisplayFromDoc(lineDocTop); int subLineTop = topLine - cs.DisplayFromDoc(lineDocTop);
@@ -1564,44 +1559,42 @@ bool Editor::WrapLines(bool fullWrap, int priorityWrapLineStart) {
AutoSurface surface(this); AutoSurface surface(this);
if (surface) { if (surface) {
bool priorityWrap = false; bool priorityWrap = false;
int lastLineToWrap = docLastLineToWrap; int lastLineToWrap = wrapEnd;
int firstLineToWrap = docLineLastWrapped; int lineToWrap = wrapStart;
if (!fullWrap) { if (!fullWrap) {
if (priorityWrapLineStart >= 0) { if (priorityWrapLineStart >= 0) {
// This is a priority wrap. // This is a priority wrap.
firstLineToWrap = priorityWrapLineStart; lineToWrap = priorityWrapLineStart;
lastLineToWrap = firstLineToWrap + 100; lastLineToWrap = priorityWrapLineStart + linesInOneCall;
priorityWrap = true; priorityWrap = true;
} else { } else {
// This is idle wrap. // This is idle wrap.
lastLineToWrap = docLineLastWrapped + 100; lastLineToWrap = wrapStart + linesInOneCall;
} }
if (lastLineToWrap >= docLastLineToWrap) if (lastLineToWrap >= wrapEnd)
lastLineToWrap = docLastLineToWrap; lastLineToWrap = wrapEnd;
} // else do a fullWrap. } // else do a fullWrap.
// printf("Wraplines: full = %d, priorityStart = %d (wrapping: %d to %d)\n", fullWrap, priorityWrapLineStart, firstLineToWrap, lastLineToWrap); // Platform::DebugPrintf("Wraplines: full = %d, priorityStart = %d (wrapping: %d to %d)\n", fullWrap, priorityWrapLineStart, lineToWrap, lastLineToWrap);
// printf("Pending wraps: %d to %d\n", docLineLastWrapped, docLastLineToWrap); // Platform::DebugPrintf("Pending wraps: %d to %d\n", wrapStart, wrapEnd);
while (firstLineToWrap < lastLineToWrap) { while (lineToWrap < lastLineToWrap) {
firstLineToWrap++; AutoLineLayout ll(llc, RetrieveLineLayout(lineToWrap));
if (!priorityWrap)
docLineLastWrapped++;
if (firstLineToWrap < pdoc->LinesTotal()) {
AutoLineLayout ll(llc, RetrieveLineLayout(firstLineToWrap));
int linesWrapped = 1; int linesWrapped = 1;
if (ll) { if (ll) {
LayoutLine(firstLineToWrap, surface, vs, ll, wrapWidth); LayoutLine(lineToWrap, surface, vs, ll, wrapWidth);
linesWrapped = ll->lines; linesWrapped = ll->lines;
} }
if (cs.SetHeight(firstLineToWrap, linesWrapped)) { if (cs.SetHeight(lineToWrap, linesWrapped)) {
wrapOccurred = true; wrapOccurred = true;
}
} }
lineToWrap++;
} }
if (!priorityWrap)
wrapStart = lineToWrap;
// If wrapping is done, bring it to resting position // If wrapping is done, bring it to resting position
if (docLineLastWrapped > docLastLineToWrap) { if (wrapStart >= wrapEnd) {
docLineLastWrapped = -1; wrapStart = wrapLineLarge;
docLastLineToWrap = -1; wrapEnd = wrapLineLarge;
} }
} }
goodTopLine = cs.DisplayFromDoc(lineDocTop); goodTopLine = cs.DisplayFromDoc(lineDocTop);
@@ -1673,6 +1666,7 @@ void Editor::LinesSplit(int pixelWidth) {
targetEnd += static_cast<int>(strlen(eol)); targetEnd += static_cast<int>(strlen(eol));
} }
} }
lineEnd = pdoc->LineFromPosition(targetEnd);
} }
pdoc->EndUndoAction(); pdoc->EndUndoAction();
} }
@@ -1716,7 +1710,7 @@ void Editor::PaintSelMargin(Surface *surfWindow, PRectangle &rc) {
rcSelMargin.left = rcSelMargin.right; rcSelMargin.left = rcSelMargin.right;
rcSelMargin.right = rcSelMargin.left + vs.ms[margin].width; rcSelMargin.right = rcSelMargin.left + vs.ms[margin].width;
if (vs.ms[margin].symbol) { if (vs.ms[margin].style != SC_MARGIN_NUMBER) {
/* alternate scheme: /* alternate scheme:
if (vs.ms[margin].mask & SC_MASK_FOLDERS) if (vs.ms[margin].mask & SC_MASK_FOLDERS)
surface->FillRectangle(rcSelMargin, vs.styles[STYLE_DEFAULT].back.allocated); surface->FillRectangle(rcSelMargin, vs.styles[STYLE_DEFAULT].back.allocated);
@@ -1727,8 +1721,21 @@ void Editor::PaintSelMargin(Surface *surfWindow, PRectangle &rc) {
if (vs.ms[margin].mask & SC_MASK_FOLDERS) if (vs.ms[margin].mask & SC_MASK_FOLDERS)
// Required because of special way brush is created for selection margin // Required because of special way brush is created for selection margin
surface->FillRectangle(rcSelMargin, *pixmapSelPattern); surface->FillRectangle(rcSelMargin, *pixmapSelPattern);
else else {
surface->FillRectangle(rcSelMargin, vs.styles[STYLE_LINENUMBER].back.allocated); ColourAllocated colour;
switch (vs.ms[margin].style) {
case SC_MARGIN_BACK:
colour = vs.styles[STYLE_DEFAULT].back.allocated;
break;
case SC_MARGIN_FORE:
colour = vs.styles[STYLE_DEFAULT].fore.allocated;
break;
default:
colour = vs.styles[STYLE_LINENUMBER].back.allocated;
break;
}
surface->FillRectangle(rcSelMargin, colour);
}
} else { } else {
surface->FillRectangle(rcSelMargin, vs.styles[STYLE_LINENUMBER].back.allocated); surface->FillRectangle(rcSelMargin, vs.styles[STYLE_LINENUMBER].back.allocated);
} }
@@ -1835,7 +1842,7 @@ void Editor::PaintSelMargin(Surface *surfWindow, PRectangle &rc) {
PRectangle rcMarker = rcSelMargin; PRectangle rcMarker = rcSelMargin;
rcMarker.top = yposScreen; rcMarker.top = yposScreen;
rcMarker.bottom = yposScreen + vs.lineHeight; rcMarker.bottom = yposScreen + vs.lineHeight;
if (!vs.ms[margin].symbol) { if (vs.ms[margin].style == SC_MARGIN_NUMBER) {
char number[100]; char number[100];
number[0] = '\0'; number[0] = '\0';
if (firstSubLine) if (firstSubLine)
@@ -2126,7 +2133,7 @@ void Editor::LayoutLine(int line, Surface *surface, ViewStyle &vstyle, LineLayou
continue; continue;
} }
if (p > 0) { if (p > 0) {
if (wrapState == eWrapChar){ if (wrapState == eWrapChar) {
lastGoodBreak = pdoc->MovePositionOutsideChar(p + posLineStart, -1) lastGoodBreak = pdoc->MovePositionOutsideChar(p + posLineStart, -1)
- posLineStart; - posLineStart;
p = pdoc->MovePositionOutsideChar(p + 1 + posLineStart, 1) - posLineStart; p = pdoc->MovePositionOutsideChar(p + 1 + posLineStart, 1) - posLineStart;
@@ -2145,14 +2152,15 @@ void Editor::LayoutLine(int line, Surface *surface, ViewStyle &vstyle, LineLayou
} }
} }
ColourAllocated Editor::SelectionBackground(ViewStyle &vsDraw) {
return primarySelection ? vsDraw.selbackground.allocated : vsDraw.selbackground2.allocated;
}
ColourAllocated Editor::TextBackground(ViewStyle &vsDraw, bool overrideBackground, ColourAllocated Editor::TextBackground(ViewStyle &vsDraw, bool overrideBackground,
ColourAllocated background, bool inSelection, bool inHotspot, int styleMain, int i, LineLayout *ll) { ColourAllocated background, bool inSelection, bool inHotspot, int styleMain, int i, LineLayout *ll) {
if (inSelection) { if (inSelection) {
if (vsDraw.selbackset) { if (vsDraw.selbackset && (vsDraw.selAlpha == SC_ALPHA_NOALPHA)) {
if (primarySelection) return SelectionBackground(vsDraw);
return vsDraw.selbackground.allocated;
else
return vsDraw.selbackground2.allocated;
} }
} else { } else {
if ((vsDraw.edgeState == EDGE_BACKGROUND) && if ((vsDraw.edgeState == EDGE_BACKGROUND) &&
@@ -2204,7 +2212,7 @@ void Editor::DrawWrapMarker(Surface *surface, PRectangle rcPlace,
surface->LineTo(xBase + xDir * xRelative, yBase + yDir * yRelative); surface->LineTo(xBase + xDir * xRelative, yBase + yDir * yRelative);
} }
}; };
Relative rel = {surface, x0, xStraight?1:-1, y0, yStraight?1:-1}; Relative rel = {surface, x0, xStraight ? 1 : -1, y0, yStraight ? 1 : -1};
// arrow head // arrow head
rel.MoveTo(xa, y); rel.MoveTo(xa, y);
@@ -2220,6 +2228,12 @@ void Editor::DrawWrapMarker(Surface *surface, PRectangle rcPlace,
y - 2 * dy); y - 2 * dy);
} }
static void SimpleAlphaRectangle(Surface *surface, PRectangle rc, ColourAllocated fill, int alpha) {
if (alpha != SC_ALPHA_NOALPHA) {
surface->AlphaRectangle(rc, 0, fill, alpha, fill, alpha, 0);
}
}
void Editor::DrawEOL(Surface *surface, ViewStyle &vsDraw, PRectangle rcLine, LineLayout *ll, void Editor::DrawEOL(Surface *surface, ViewStyle &vsDraw, PRectangle rcLine, LineLayout *ll,
int line, int lineEnd, int xStart, int subLine, int subLineStart, int line, int lineEnd, int xStart, int subLine, int subLineStart,
bool overrideBackground, ColourAllocated background, bool overrideBackground, ColourAllocated background,
@@ -2236,15 +2250,17 @@ void Editor::DrawEOL(Surface *surface, ViewStyle &vsDraw, PRectangle rcLine, Lin
bool eolInSelection = (subLine == (ll->lines - 1)) && bool eolInSelection = (subLine == (ll->lines - 1)) &&
(posLineEnd > ll->selStart) && (posLineEnd <= ll->selEnd) && (ll->selStart != ll->selEnd); (posLineEnd > ll->selStart) && (posLineEnd <= ll->selEnd) && (ll->selStart != ll->selEnd);
if (eolInSelection && vsDraw.selbackset && (line < pdoc->LinesTotal() - 1)) { if (eolInSelection && vsDraw.selbackset && (line < pdoc->LinesTotal() - 1) && (vsDraw.selAlpha == SC_ALPHA_NOALPHA)) {
if (primarySelection) surface->FillRectangle(rcSegment, SelectionBackground(vsDraw));
surface->FillRectangle(rcSegment, vsDraw.selbackground.allocated);
else
surface->FillRectangle(rcSegment, vsDraw.selbackground2.allocated);
} else if (overrideBackground) {
surface->FillRectangle(rcSegment, background);
} else { } else {
surface->FillRectangle(rcSegment, vsDraw.styles[ll->styles[ll->numCharsInLine] & styleMask].back.allocated); if (overrideBackground) {
surface->FillRectangle(rcSegment, background);
} else {
surface->FillRectangle(rcSegment, vsDraw.styles[ll->styles[ll->numCharsInLine] & styleMask].back.allocated);
}
if (eolInSelection && vsDraw.selbackset && (line < pdoc->LinesTotal() - 1) && (vsDraw.selAlpha != SC_ALPHA_NOALPHA)) {
SimpleAlphaRectangle(surface, rcSegment, SelectionBackground(vsDraw), vsDraw.selAlpha);
}
} }
rcSegment.left = xEol + vsDraw.aveCharWidth + xStart; rcSegment.left = xEol + vsDraw.aveCharWidth + xStart;
@@ -2290,14 +2306,15 @@ void Editor::DrawLine(Surface *surface, ViewStyle &vsDraw, int line, int lineVis
// the color for the highest numbered one is used. // the color for the highest numbered one is used.
bool overrideBackground = false; bool overrideBackground = false;
ColourAllocated background; ColourAllocated background;
if (caret.active && vsDraw.showCaretLineBackground && ll->containsCaret) { if (caret.active && vsDraw.showCaretLineBackground && (vsDraw.caretLineAlpha == SC_ALPHA_NOALPHA) && ll->containsCaret) {
overrideBackground = true; overrideBackground = true;
background = vsDraw.caretLineBackground.allocated; background = vsDraw.caretLineBackground.allocated;
} }
if (!overrideBackground) { if (!overrideBackground) {
int marks = pdoc->GetMark(line); int marks = pdoc->GetMark(line);
for (int markBit = 0; (markBit < 32) && marks; markBit++) { for (int markBit = 0; (markBit < 32) && marks; markBit++) {
if ((marks & 1) && vsDraw.markers[markBit].markType == SC_MARK_BACKGROUND) { if ((marks & 1) && (vsDraw.markers[markBit].markType == SC_MARK_BACKGROUND) &&
(vsDraw.markers[markBit].alpha == SC_ALPHA_NOALPHA)) {
background = vsDraw.markers[markBit].back.allocated; background = vsDraw.markers[markBit].back.allocated;
overrideBackground = true; overrideBackground = true;
} }
@@ -2306,14 +2323,15 @@ void Editor::DrawLine(Surface *surface, ViewStyle &vsDraw, int line, int lineVis
} }
if (!overrideBackground) { if (!overrideBackground) {
if (vsDraw.maskInLine) { if (vsDraw.maskInLine) {
int marks = pdoc->GetMark(line) & vsDraw.maskInLine; int marksMasked = pdoc->GetMark(line) & vsDraw.maskInLine;
if (marks) { if (marksMasked) {
for (int markBit = 0; (markBit < 32) && marks; markBit++) { for (int markBit = 0; (markBit < 32) && marksMasked; markBit++) {
if ((marks & 1) && (vsDraw.markers[markBit].markType != SC_MARK_EMPTY)) { if ((marksMasked & 1) && (vsDraw.markers[markBit].markType != SC_MARK_EMPTY) &&
(vsDraw.markers[markBit].alpha == SC_ALPHA_NOALPHA)) {
overrideBackground = true; overrideBackground = true;
background = vsDraw.markers[markBit].back.allocated; background = vsDraw.markers[markBit].back.allocated;
} }
marks >>= 1; marksMasked >>= 1;
} }
} }
} }
@@ -2641,6 +2659,15 @@ void Editor::DrawLine(Surface *surface, ViewStyle &vsDraw, int line, int lineVis
xStart, subLine, subLineStart, overrideBackground, background, xStart, subLine, subLineStart, overrideBackground, background,
drawWrapMarkEnd, vsDraw.whitespaceForeground.allocated); drawWrapMarkEnd, vsDraw.whitespaceForeground.allocated);
} }
if ((vsDraw.selAlpha != SC_ALPHA_NOALPHA) && (ll->selStart >= 0) && (ll->selEnd >= 0)) {
int startPosSel = (ll->selStart < posLineStart) ? posLineStart : ll->selStart;
int endPosSel = (ll->selEnd < (lineEnd + posLineStart)) ? ll->selEnd : (lineEnd + posLineStart);
if (startPosSel < endPosSel) {
rcSegment.left = xStart + ll->positions[startPosSel - posLineStart] - subLineStart;
rcSegment.right = xStart + ll->positions[endPosSel - posLineStart] - subLineStart;
SimpleAlphaRectangle(surface, rcSegment, SelectionBackground(vsDraw), vsDraw.selAlpha);
}
}
if (vsDraw.edgeState == EDGE_LINE) { if (vsDraw.edgeState == EDGE_LINE) {
int edgeX = theEdge * vsDraw.spaceWidth; int edgeX = theEdge * vsDraw.spaceWidth;
@@ -2648,6 +2675,31 @@ void Editor::DrawLine(Surface *surface, ViewStyle &vsDraw, int line, int lineVis
rcSegment.right = rcSegment.left + 1; rcSegment.right = rcSegment.left + 1;
surface->FillRectangle(rcSegment, vsDraw.edgecolour.allocated); surface->FillRectangle(rcSegment, vsDraw.edgecolour.allocated);
} }
// Draw any translucent whole line states
rcSegment.left = xStart;
rcSegment.right = rcLine.right - 1;
if (caret.active && vsDraw.showCaretLineBackground && ll->containsCaret) {
SimpleAlphaRectangle(surface, rcSegment, vsDraw.caretLineBackground.allocated, vsDraw.caretLineAlpha);
}
int marks = pdoc->GetMark(line);
for (int markBit = 0; (markBit < 32) && marks; markBit++) {
if ((marks & 1) && (vsDraw.markers[markBit].markType == SC_MARK_BACKGROUND)) {
SimpleAlphaRectangle(surface, rcSegment, vsDraw.markers[markBit].back.allocated, vsDraw.markers[markBit].alpha);
}
marks >>= 1;
}
if (vsDraw.maskInLine) {
int marksMasked = pdoc->GetMark(line) & vsDraw.maskInLine;
if (marksMasked) {
for (int markBit = 0; (markBit < 32) && marksMasked; markBit++) {
if ((marksMasked & 1) && (vsDraw.markers[markBit].markType != SC_MARK_EMPTY)) {
SimpleAlphaRectangle(surface, rcSegment, vsDraw.markers[markBit].back.allocated, vsDraw.markers[markBit].alpha);
}
marksMasked >>= 1;
}
}
}
} }
void Editor::RefreshPixMaps(Surface *surfaceWindow) { void Editor::RefreshPixMaps(Surface *surfaceWindow) {
@@ -2721,7 +2773,6 @@ void Editor::Paint(Surface *surfaceWindow, PRectangle rcArea) {
// paintingAllText, rcArea.left, rcArea.top, rcArea.right, rcArea.bottom); // paintingAllText, rcArea.left, rcArea.top, rcArea.right, rcArea.bottom);
RefreshStyleData(); RefreshStyleData();
RefreshPixMaps(surfaceWindow); RefreshPixMaps(surfaceWindow);
PRectangle rcClient = GetClientRectangle(); PRectangle rcClient = GetClientRectangle();
@@ -2752,6 +2803,8 @@ void Editor::Paint(Surface *surfaceWindow, PRectangle rcArea) {
if (needUpdateUI) { if (needUpdateUI) {
NotifyUpdateUI(); NotifyUpdateUI();
needUpdateUI = false; needUpdateUI = false;
RefreshStyleData();
RefreshPixMaps(surfaceWindow);
} }
// Call priority lines wrap on a window of lines which are likely // Call priority lines wrap on a window of lines which are likely
@@ -3063,7 +3116,7 @@ long Editor::FormatRange(bool draw, RangeToFormat *pfr) {
// Printing supports only the line number margin. // Printing supports only the line number margin.
int lineNumberIndex = -1; int lineNumberIndex = -1;
for (int margin = 0; margin < ViewStyle::margins; margin++) { for (int margin = 0; margin < ViewStyle::margins; margin++) {
if ((!vsPrint.ms[margin].symbol) && (vsPrint.ms[margin].width > 0)) { if ((vsPrint.ms[margin].style == SC_MARGIN_NUMBER) && (vsPrint.ms[margin].width > 0)) {
lineNumberIndex = margin; lineNumberIndex = margin;
} else { } else {
vsPrint.ms[margin].width = 0; vsPrint.ms[margin].width = 0;
@@ -3076,6 +3129,7 @@ long Editor::FormatRange(bool draw, RangeToFormat *pfr) {
// Don't show the selection when printing // Don't show the selection when printing
vsPrint.selbackset = false; vsPrint.selbackset = false;
vsPrint.selforeset = false; vsPrint.selforeset = false;
vsPrint.selAlpha = SC_ALPHA_NOALPHA;
vsPrint.whitespaceBackgroundSet = false; vsPrint.whitespaceBackgroundSet = false;
vsPrint.whitespaceForegroundSet = false; vsPrint.whitespaceForegroundSet = false;
vsPrint.showCaretLineBackground = false; vsPrint.showCaretLineBackground = false;
@@ -3662,19 +3716,8 @@ void Editor::CheckModificationForWrap(DocModification mh) {
llc.Invalidate(LineLayout::llCheckTextAndStyle); llc.Invalidate(LineLayout::llCheckTextAndStyle);
if (wrapState != eWrapNone) { if (wrapState != eWrapNone) {
int lineDoc = pdoc->LineFromPosition(mh.position); int lineDoc = pdoc->LineFromPosition(mh.position);
if (mh.linesAdded <= 0) { int lines = Platform::Maximum(0, mh.linesAdded);
AutoSurface surface(this); NeedWrapping(lineDoc, lineDoc + lines + 1);
AutoLineLayout ll(llc, RetrieveLineLayout(lineDoc));
if (surface && ll) {
LayoutLine(lineDoc, surface, vs, ll, wrapWidth);
if (cs.GetHeight(lineDoc) != ll->lines) {
NeedWrapping(lineDoc - 1, lineDoc + 1);
Redraw();
}
}
} else {
NeedWrapping(lineDoc, lineDoc + 1 + mh.linesAdded);
}
} }
} }
} }
@@ -3717,6 +3760,7 @@ void Editor::NotifyModified(Document*, DocModification mh, void *) {
InvalidateRange(mh.position, mh.position + mh.length); InvalidateRange(mh.position, mh.position + mh.length);
} }
} }
llc.Invalidate(LineLayout::llCheckTextAndStyle);
} else { } else {
// Move selection and brace highlights // Move selection and brace highlights
if (mh.modificationType & SC_MOD_INSERTTEXT) { if (mh.modificationType & SC_MOD_INSERTTEXT) {
@@ -4833,7 +4877,7 @@ void Editor::CopySelectionRange(SelectionText *ss) {
text[size] = '\0'; text[size] = '\0';
} }
} }
ss->Set(text, size + 1, pdoc->dbcsCodePage, ss->Set(text, size + 1, pdoc->dbcsCodePage,
vs.styles[STYLE_DEFAULT].characterSet, selType == selRectangle); vs.styles[STYLE_DEFAULT].characterSet, selType == selRectangle);
} }
} }
@@ -4849,7 +4893,7 @@ void Editor::CopyRangeToClipboard(int start, int end) {
void Editor::CopyText(int length, const char *text) { void Editor::CopyText(int length, const char *text) {
SelectionText selectedText; SelectionText selectedText;
selectedText.Copy(text, length, selectedText.Copy(text, length + 1,
pdoc->dbcsCodePage, vs.styles[STYLE_DEFAULT].characterSet, false); pdoc->dbcsCodePage, vs.styles[STYLE_DEFAULT].characterSet, false);
CopyToClipboard(selectedText); CopyToClipboard(selectedText);
} }
@@ -5289,7 +5333,7 @@ void Editor::ButtonMove(Point pt) {
} }
void Editor::ButtonUp(Point pt, unsigned int curTime, bool ctrl) { void Editor::ButtonUp(Point pt, unsigned int curTime, bool ctrl) {
//Platform::DebugPrintf("ButtonUp %d\n", HaveMouseCapture()); //Platform::DebugPrintf("ButtonUp %d\n", HaveMouseCapture());
if (HaveMouseCapture()) { if (HaveMouseCapture()) {
if (PointInSelMargin(pt)) { if (PointInSelMargin(pt)) {
DisplayCursor(Window::cursorReverseArrow); DisplayCursor(Window::cursorReverseArrow);
@@ -5377,13 +5421,13 @@ bool Editor::Idle() {
bool idleDone; bool idleDone;
bool wrappingDone = (wrapState == eWrapNone) || (!backgroundWrapEnabled); bool wrappingDone = wrapState == eWrapNone;
if (!wrappingDone) { if (!wrappingDone) {
// Wrap lines during idle. // Wrap lines during idle.
WrapLines(false, -1); WrapLines(false, -1);
// No more wrapping // No more wrapping
if (docLineLastWrapped == docLastLineToWrap) if (wrapStart == wrapEnd)
wrappingDone = true; wrappingDone = true;
} }
@@ -6038,14 +6082,14 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
pdoc->SetDefaultCharClasses(false); pdoc->SetDefaultCharClasses(false);
if (lParam == 0) if (lParam == 0)
return 0; return 0;
pdoc->SetCharClasses(reinterpret_cast<unsigned char *>(lParam), Document::ccWord); pdoc->SetCharClasses(reinterpret_cast<unsigned char *>(lParam), CharClassify::ccWord);
} }
break; break;
case SCI_SETWHITESPACECHARS: { case SCI_SETWHITESPACECHARS: {
if (lParam == 0) if (lParam == 0)
return 0; return 0;
pdoc->SetCharClasses(reinterpret_cast<unsigned char *>(lParam), Document::ccSpace); pdoc->SetCharClasses(reinterpret_cast<unsigned char *>(lParam), CharClassify::ccSpace);
} }
break; break;
@@ -6305,16 +6349,16 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
return pdoc->ExtendWordSelect(wParam, 1, lParam != 0); return pdoc->ExtendWordSelect(wParam, 1, lParam != 0);
case SCI_SETWRAPMODE: case SCI_SETWRAPMODE:
switch(wParam){ switch (wParam) {
case SC_WRAP_WORD: case SC_WRAP_WORD:
wrapState = eWrapWord; wrapState = eWrapWord;
break; break;
case SC_WRAP_CHAR: case SC_WRAP_CHAR:
wrapState = eWrapChar; wrapState = eWrapChar;
break; break;
default: default:
wrapState = eWrapNone; wrapState = eWrapNone;
break; break;
} }
xOffset = 0; xOffset = 0;
InvalidateStyleRedraw(); InvalidateStyleRedraw();
@@ -6465,8 +6509,10 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
return pdoc->LineEnd(wParam); return pdoc->LineEnd(wParam);
case SCI_SETCODEPAGE: case SCI_SETCODEPAGE:
pdoc->dbcsCodePage = wParam; if (ValidCodePage(wParam)) {
InvalidateStyleRedraw(); pdoc->dbcsCodePage = wParam;
InvalidateStyleRedraw();
}
break; break;
case SCI_GETCODEPAGE: case SCI_GETCODEPAGE:
@@ -6499,6 +6545,11 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
InvalidateStyleData(); InvalidateStyleData();
RedrawSelMargin(); RedrawSelMargin();
break; break;
case SCI_MARKERSETALPHA:
if (wParam <= MARKER_MAX)
vs.markers[wParam].alpha = lParam;
InvalidateStyleRedraw();
break;
case SCI_MARKERADD: { case SCI_MARKERADD: {
int markerID = pdoc->AddMark(wParam, lParam); int markerID = pdoc->AddMark(wParam, lParam);
return markerID; return markerID;
@@ -6546,14 +6597,14 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
case SCI_SETMARGINTYPEN: case SCI_SETMARGINTYPEN:
if (ValidMargin(wParam)) { if (ValidMargin(wParam)) {
vs.ms[wParam].symbol = (lParam == SC_MARGIN_SYMBOL); vs.ms[wParam].style = lParam;
InvalidateStyleRedraw(); InvalidateStyleRedraw();
} }
break; break;
case SCI_GETMARGINTYPEN: case SCI_GETMARGINTYPEN:
if (ValidMargin(wParam)) if (ValidMargin(wParam))
return vs.ms[wParam].symbol ? SC_MARGIN_SYMBOL : SC_MARGIN_NUMBER; return vs.ms[wParam].style;
else else
return 0; return 0;
@@ -6717,6 +6768,12 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
vs.caretLineBackground.desired = wParam; vs.caretLineBackground.desired = wParam;
InvalidateStyleRedraw(); InvalidateStyleRedraw();
break; break;
case SCI_GETCARETLINEBACKALPHA:
return vs.caretLineAlpha;
case SCI_SETCARETLINEBACKALPHA:
vs.caretLineAlpha = wParam;
InvalidateStyleRedraw();
break;
// Folding messages // Folding messages
@@ -6831,6 +6888,14 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
InvalidateStyleRedraw(); InvalidateStyleRedraw();
break; break;
case SCI_SETSELALPHA:
vs.selAlpha = wParam;
InvalidateStyleRedraw();
break;
case SCI_GETSELALPHA:
return vs.selAlpha;
case SCI_SETWHITESPACEFORE: case SCI_SETWHITESPACEFORE:
vs.whitespaceForegroundSet = wParam != 0; vs.whitespaceForegroundSet = wParam != 0;
vs.whitespaceForeground.desired = ColourDesired(lParam); vs.whitespaceForeground.desired = ColourDesired(lParam);

View File

@@ -305,10 +305,10 @@ protected: // ScintillaBase subclass needs access to much of Editor
// Wrapping support // Wrapping support
enum { eWrapNone, eWrapWord, eWrapChar } wrapState; enum { eWrapNone, eWrapWord, eWrapChar } wrapState;
bool backgroundWrapEnabled; enum { wrapLineLarge = 0x7ffffff };
int wrapWidth; int wrapWidth;
int docLineLastWrapped; int wrapStart;
int docLastLineToWrap; int wrapEnd;
int wrapVisualFlags; int wrapVisualFlags;
int wrapVisualFlagsLocation; int wrapVisualFlagsLocation;
int wrapVisualStartIndent; int wrapVisualStartIndent;
@@ -377,7 +377,7 @@ protected: // ScintillaBase subclass needs access to much of Editor
void InvalidateCaret(); void InvalidateCaret();
virtual void UpdateSystemCaret(); virtual void UpdateSystemCaret();
void NeedWrapping(int docLineStartWrapping = 0, int docLineEndWrapping = 0x7ffffff); void NeedWrapping(int docLineStart = 0, int docLineEnd = wrapLineLarge);
bool WrapLines(bool fullWrap, int priorityWrapLineStart); bool WrapLines(bool fullWrap, int priorityWrapLineStart);
void LinesJoin(); void LinesJoin();
void LinesSplit(int pixelWidth); void LinesSplit(int pixelWidth);
@@ -387,6 +387,7 @@ protected: // ScintillaBase subclass needs access to much of Editor
LineLayout *RetrieveLineLayout(int lineNumber); LineLayout *RetrieveLineLayout(int lineNumber);
void LayoutLine(int line, Surface *surface, ViewStyle &vstyle, LineLayout *ll, void LayoutLine(int line, Surface *surface, ViewStyle &vstyle, LineLayout *ll,
int width=LineLayout::wrapWidthInfinite); int width=LineLayout::wrapWidthInfinite);
ColourAllocated SelectionBackground(ViewStyle &vsDraw);
ColourAllocated TextBackground(ViewStyle &vsDraw, bool overrideBackground, ColourAllocated background, bool inSelection, bool inHotspot, int styleMain, int i, LineLayout *ll); ColourAllocated TextBackground(ViewStyle &vsDraw, bool overrideBackground, ColourAllocated background, bool inSelection, bool inHotspot, int styleMain, int i, LineLayout *ll);
void DrawIndentGuide(Surface *surface, int lineVisible, int lineHeight, int start, PRectangle rcSegment, bool highlight); void DrawIndentGuide(Surface *surface, int lineVisible, int lineHeight, int start, PRectangle rcSegment, bool highlight);
void DrawWrapMarker(Surface *surface, PRectangle rcPlace, bool isEndMarker, ColourAllocated wrapColour); void DrawWrapMarker(Surface *surface, PRectangle rcPlace, bool isEndMarker, ColourAllocated wrapColour);
@@ -524,6 +525,7 @@ protected: // ScintillaBase subclass needs access to much of Editor
void GetHotSpotRange(int& hsStart, int& hsEnd); void GetHotSpotRange(int& hsStart, int& hsEnd);
int CodePage() const; int CodePage() const;
virtual bool ValidCodePage(int /* codePage */) const { return true; }
int WrapCount(int line); int WrapCount(int line);
virtual sptr_t DefWndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) = 0; virtual sptr_t DefWndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) = 0;

View File

@@ -12,6 +12,8 @@
#include "Platform.h" #include "Platform.h"
#include "Scintilla.h"
#include "SciLexer.h" #include "SciLexer.h"
#include "PropSet.h" #include "PropSet.h"
#include "Accessor.h" #include "Accessor.h"
@@ -116,16 +118,16 @@ LexerLibrary::LexerLibrary(const char* ModuleName) {
if (lib->IsValid()) { if (lib->IsValid()) {
m_sModuleName = ModuleName; m_sModuleName = ModuleName;
//Cannot use reinterpret_cast because: ANSI C++ forbids casting between pointers to functions and objects //Cannot use reinterpret_cast because: ANSI C++ forbids casting between pointers to functions and objects
GetLexerCountFn GetLexerCount = (GetLexerCountFn)lib->FindFunction("GetLexerCount"); GetLexerCountFn GetLexerCount = (GetLexerCountFn)(sptr_t)lib->FindFunction("GetLexerCount");
if (GetLexerCount) { if (GetLexerCount) {
ExternalLexerModule *lex; ExternalLexerModule *lex;
LexerMinder *lm; LexerMinder *lm;
// Find functions in the DLL // Find functions in the DLL
GetLexerNameFn GetLexerName = (GetLexerNameFn)lib->FindFunction("GetLexerName"); GetLexerNameFn GetLexerName = (GetLexerNameFn)(sptr_t)lib->FindFunction("GetLexerName");
ExtLexerFunction Lexer = (ExtLexerFunction)lib->FindFunction("Lex"); ExtLexerFunction Lexer = (ExtLexerFunction)(sptr_t)lib->FindFunction("Lex");
ExtFoldFunction Folder = (ExtFoldFunction)lib->FindFunction("Fold"); ExtFoldFunction Folder = (ExtFoldFunction)(sptr_t)lib->FindFunction("Fold");
// Assign a buffer for the lexer name. // Assign a buffer for the lexer name.
char lexname[100]; char lexname[100];

View File

@@ -63,6 +63,12 @@ void Indicator::Draw(Surface *surface, const PRectangle &rc, const PRectangle &r
surface->LineTo(rc.right, rcLine.top+1); surface->LineTo(rc.right, rcLine.top+1);
surface->LineTo(rc.left, rcLine.top+1); surface->LineTo(rc.left, rcLine.top+1);
surface->LineTo(rc.left, ymid+1); surface->LineTo(rc.left, ymid+1);
} else if (style == INDIC_ROUNDBOX) {
PRectangle rcBox = rcLine;
rcBox.top = rcLine.top + 1;
rcBox.left = rc.left;
rcBox.right = rc.right;
surface->AlphaRectangle(rcBox, 1, fore.allocated, 30, fore.allocated, 50, 0);
} else { // Either INDIC_PLAIN or unknown } else { // Either INDIC_PLAIN or unknown
surface->MoveTo(rc.left, ymid); surface->MoveTo(rc.left, ymid);
surface->LineTo(rc.right, ymid); surface->LineTo(rc.right, ymid);

View File

@@ -171,6 +171,7 @@ int Scintilla_LinkLexers() {
LINK_LEXER(lmGui4Cli); LINK_LEXER(lmGui4Cli);
LINK_LEXER(lmHaskell); LINK_LEXER(lmHaskell);
LINK_LEXER(lmHTML); LINK_LEXER(lmHTML);
LINK_LEXER(lmInno);
LINK_LEXER(lmKix); LINK_LEXER(lmKix);
LINK_LEXER(lmLatex); LINK_LEXER(lmLatex);
LINK_LEXER(lmLISP); LINK_LEXER(lmLISP);
@@ -186,6 +187,7 @@ int Scintilla_LinkLexers() {
LINK_LEXER(lmNsis); LINK_LEXER(lmNsis);
LINK_LEXER(lmNull); LINK_LEXER(lmNull);
LINK_LEXER(lmOctave); LINK_LEXER(lmOctave);
LINK_LEXER(lmOpal);
LINK_LEXER(lmPascal); LINK_LEXER(lmPascal);
LINK_LEXER(lmPB); LINK_LEXER(lmPB);
LINK_LEXER(lmPerl); LINK_LEXER(lmPerl);
@@ -201,6 +203,7 @@ int Scintilla_LinkLexers() {
LINK_LEXER(lmScriptol); LINK_LEXER(lmScriptol);
LINK_LEXER(lmSmalltalk); LINK_LEXER(lmSmalltalk);
LINK_LEXER(lmSpecman); LINK_LEXER(lmSpecman);
LINK_LEXER(lmSpice);
LINK_LEXER(lmSQL); LINK_LEXER(lmSQL);
LINK_LEXER(lmTADS3); LINK_LEXER(lmTADS3);
LINK_LEXER(lmTCL); LINK_LEXER(lmTCL);

View File

@@ -39,6 +39,9 @@
// May 23, 2005 - Fixed the SentKey lexing in case of a missing } // May 23, 2005 - Fixed the SentKey lexing in case of a missing }
// Aug 11, 2005 - Fixed possible bug with s_save length > 100. // Aug 11, 2005 - Fixed possible bug with s_save length > 100.
// Aug 23, 2005 - Added Switch/endswitch support to the folding logic. // Aug 23, 2005 - Added Switch/endswitch support to the folding logic.
// Sep 27, 2005 - Fixed the SentKey lexing logic in case of multiple sentkeys.
// Mar 12, 2006 - Fixed issue with <> coloring as String in stead of Operator in rare occasions.
// Apr 8, 2006 - Added support for AutoIt3 Standard UDF library (SCE_AU3_UDF)
// //
// Copyright for Scintilla: 1998-2001 by Neil Hodgson <neilh@scintilla.org> // Copyright for Scintilla: 1998-2001 by Neil Hodgson <neilh@scintilla.org>
// The License.txt file describes the conditions under which this software may be distributed. // The License.txt file describes the conditions under which this software may be distributed.
@@ -92,6 +95,7 @@ static inline bool IsAOperator(char ch) {
static int GetSendKey(const char *szLine, char *szKey) static int GetSendKey(const char *szLine, char *szKey)
{ {
int nFlag = 0; int nFlag = 0;
int nStartFound = 0;
int nKeyPos = 0; int nKeyPos = 0;
int nSpecPos= 0; int nSpecPos= 0;
int nSpecNum= 1; int nSpecNum= 1;
@@ -102,31 +106,34 @@ static int GetSendKey(const char *szLine, char *szKey)
// split the portion of the sendkey in the part before and after the spaces // split the portion of the sendkey in the part before and after the spaces
while ( ( (cTemp = szLine[nPos]) != '\0')) while ( ( (cTemp = szLine[nPos]) != '\0'))
{ {
// skip leading Ctrl/Shift/ALt state // skip leading Ctrl/Shift/Alt state
if ((cTemp == '#' || cTemp == '!' || cTemp == '^') && (szLine[nPos+1] == '{') ) if (cTemp == '{') {
{ nStartFound = 1;
} }
else if ((cTemp == ' ') && (nFlag == 0) ) // get the stuff till first space //
{ if (nStartFound == 1) {
nFlag = 1; if ((cTemp == ' ') && (nFlag == 0) ) // get the stuff till first space
// Add } to the end of the first bit for table lookup later. {
szKey[nKeyPos++] = '}'; nFlag = 1;
} // Add } to the end of the first bit for table lookup later.
else if (cTemp == ' ') szKey[nKeyPos++] = '}';
{ }
// skip other spaces else if (cTemp == ' ')
} {
else if (nFlag == 0) // skip other spaces
{ }
// save first portion into var till space or } is hit else if (nFlag == 0)
szKey[nKeyPos++] = cTemp; {
} // save first portion into var till space or } is hit
else if ((nFlag == 1) && (cTemp != '}')) szKey[nKeyPos++] = cTemp;
{ }
// Save second portion into var... else if ((nFlag == 1) && (cTemp != '}'))
szSpecial[nSpecPos++] = cTemp; {
// check if Second portion is all numbers for repeat fuction // Save second portion into var...
if (isdigit(cTemp) == false) {nSpecNum = 0;} szSpecial[nSpecPos++] = cTemp;
// check if Second portion is all numbers for repeat fuction
if (isdigit(cTemp) == false) {nSpecNum = 0;}
}
} }
nPos++; // skip to next char nPos++; // skip to next char
@@ -190,6 +197,7 @@ static void ColouriseAU3Doc(unsigned int startPos,
WordList &keywords5 = *keywordlists[4]; WordList &keywords5 = *keywordlists[4];
WordList &keywords6 = *keywordlists[5]; WordList &keywords6 = *keywordlists[5];
WordList &keywords7 = *keywordlists[6]; WordList &keywords7 = *keywordlists[6];
WordList &keywords8 = *keywordlists[7];
// find the first previous line without continuation character at the end // find the first previous line without continuation character at the end
int lineCurrent = styler.GetLine(startPos); int lineCurrent = styler.GetLine(startPos);
int s_startPos = startPos; int s_startPos = startPos;
@@ -325,6 +333,10 @@ static void ColouriseAU3Doc(unsigned int startPos,
sc.ChangeState(SCE_AU3_EXPAND); sc.ChangeState(SCE_AU3_EXPAND);
sc.SetState(SCE_AU3_DEFAULT); sc.SetState(SCE_AU3_DEFAULT);
} }
else if (keywords8.InList(s)) {
sc.ChangeState(SCE_AU3_UDF);
sc.SetState(SCE_AU3_DEFAULT);
}
else if (strcmp(s, "_") == 0) { else if (strcmp(s, "_") == 0) {
sc.ChangeState(SCE_AU3_OPERATOR); sc.ChangeState(SCE_AU3_OPERATOR);
sc.SetState(SCE_AU3_DEFAULT); sc.SetState(SCE_AU3_DEFAULT);
@@ -411,9 +423,11 @@ static void ColouriseAU3Doc(unsigned int startPos,
if ((si == 1 && sc.ch == '\"') || (si == 2 && sc.ch == '\'') || (si == 3 && sc.ch == '>')) if ((si == 1 && sc.ch == '\"') || (si == 2 && sc.ch == '\'') || (si == 3 && sc.ch == '>'))
{ {
sc.ForwardSetState(SCE_AU3_DEFAULT); sc.ForwardSetState(SCE_AU3_DEFAULT);
si=0;
} }
if (sc.atLineEnd) if (sc.atLineEnd)
{ {
si=0;
// at line end and not found a continuation char then reset to default // at line end and not found a continuation char then reset to default
int lineCurrent = styler.GetLine(sc.currentPos); int lineCurrent = styler.GetLine(sc.currentPos);
if (!IsContinuationLine(lineCurrent,styler)) if (!IsContinuationLine(lineCurrent,styler))
@@ -422,11 +436,8 @@ static void ColouriseAU3Doc(unsigned int startPos,
} }
} }
// find Sendkeys in a STRING // find Sendkeys in a STRING
if (sc.ch == '{') {sc.SetState(SCE_AU3_SENT);} if (sc.ch == '{' || sc.ch == '+' || sc.ch == '!' || sc.ch == '^' || sc.ch == '#' ) {
if (sc.ch == '+' && sc.chNext == '{') {sc.SetState(SCE_AU3_SENT);} sc.SetState(SCE_AU3_SENT);}
if (sc.ch == '!' && sc.chNext == '{') {sc.SetState(SCE_AU3_SENT);}
if (sc.ch == '^' && sc.chNext == '{') {sc.SetState(SCE_AU3_SENT);}
if (sc.ch == '#' && sc.chNext == '{') {sc.SetState(SCE_AU3_SENT);}
break; break;
} }
@@ -459,6 +470,35 @@ static void ColouriseAU3Doc(unsigned int startPos,
} }
sc.SetState(SCE_AU3_STRING); sc.SetState(SCE_AU3_STRING);
} }
else
{
// check if the start is a valid SendKey start
int nPos = 0;
int nState = 1;
char cTemp;
while (!(nState == 2) && ((cTemp = s[nPos]) != '\0'))
{
if (cTemp == '{' && nState == 1)
{
nState = 2;
}
if (nState == 1 && !(cTemp == '+' || cTemp == '!' || cTemp == '^' || cTemp == '#' ))
{
nState = 0;
}
nPos++;
}
//Verify characters infront of { ... if not assume regular string
if (nState == 1 && (!(sc.ch == '{' || sc.ch == '+' || sc.ch == '!' || sc.ch == '^' || sc.ch == '#' ))) {
sc.ChangeState(SCE_AU3_STRING);
sc.SetState(SCE_AU3_STRING);
}
// If invalid character found then assume its a regular string
if (nState == 0) {
sc.ChangeState(SCE_AU3_STRING);
sc.SetState(SCE_AU3_STRING);
}
}
// check if next portion is again a sendkey // check if next portion is again a sendkey
if (sc.atLineEnd) if (sc.atLineEnd)
{ {
@@ -466,13 +506,12 @@ static void ColouriseAU3Doc(unsigned int startPos,
sc.SetState(SCE_AU3_DEFAULT); sc.SetState(SCE_AU3_DEFAULT);
si = 0; // reset string indicator si = 0; // reset string indicator
} }
//if (sc.ch == '{' && sc.chPrev != '{') {sc.SetState(SCE_AU3_SENT);} //* check in next characters following a sentkey are again a sent key
if (sc.ch == '+' && sc.chNext == '{') {sc.SetState(SCE_AU3_SENT);} // Need this test incase of 2 sentkeys like {F1}{ENTER} but not detect {{}
if (sc.ch == '!' && sc.chNext == '{') {sc.SetState(SCE_AU3_SENT);} if (sc.state == SCE_AU3_STRING && (sc.ch == '{' || sc.ch == '+' || sc.ch == '!' || sc.ch == '^' || sc.ch == '#' )) {
if (sc.ch == '^' && sc.chNext == '{') {sc.SetState(SCE_AU3_SENT);} sc.SetState(SCE_AU3_SENT);}
if (sc.ch == '#' && sc.chNext == '{') {sc.SetState(SCE_AU3_SENT);}
// check to see if the string ended... // check to see if the string ended...
// Sentkey string isn't complete but the string ended.... // Sendkey string isn't complete but the string ended....
if ((si == 1 && sc.ch == '\"') || (si == 2 && sc.ch == '\'')) if ((si == 1 && sc.ch == '\"') || (si == 2 && sc.ch == '\''))
{ {
sc.ChangeState(SCE_AU3_STRING); sc.ChangeState(SCE_AU3_STRING);
@@ -491,6 +530,7 @@ static void ColouriseAU3Doc(unsigned int startPos,
else if (sc.ch == '$') {sc.SetState(SCE_AU3_VARIABLE);} else if (sc.ch == '$') {sc.SetState(SCE_AU3_VARIABLE);}
else if (sc.ch == '.' && !IsADigit(sc.chNext)) {sc.SetState(SCE_AU3_OPERATOR);} else if (sc.ch == '.' && !IsADigit(sc.chNext)) {sc.SetState(SCE_AU3_OPERATOR);}
else if (sc.ch == '@') {sc.SetState(SCE_AU3_KEYWORD);} else if (sc.ch == '@') {sc.SetState(SCE_AU3_KEYWORD);}
//else if (sc.ch == '_') {sc.SetState(SCE_AU3_KEYWORD);}
else if (sc.ch == '<' && si==3) {sc.SetState(SCE_AU3_STRING);} // string after #include else if (sc.ch == '<' && si==3) {sc.SetState(SCE_AU3_STRING);} // string after #include
else if (sc.ch == '\"') { else if (sc.ch == '\"') {
sc.SetState(SCE_AU3_STRING); sc.SetState(SCE_AU3_STRING);
@@ -543,6 +583,10 @@ static void ColouriseAU3Doc(unsigned int startPos,
sc.ChangeState(SCE_AU3_EXPAND); sc.ChangeState(SCE_AU3_EXPAND);
sc.SetState(SCE_AU3_EXPAND); sc.SetState(SCE_AU3_EXPAND);
} }
else if (keywords8.InList(s_save)) {
sc.ChangeState(SCE_AU3_UDF);
sc.SetState(SCE_AU3_UDF);
}
else { else {
sc.ChangeState(SCE_AU3_DEFAULT); sc.ChangeState(SCE_AU3_DEFAULT);
sc.SetState(SCE_AU3_DEFAULT); sc.SetState(SCE_AU3_DEFAULT);
@@ -841,6 +885,7 @@ static const char * const AU3WordLists[] = {
"#autoit Pre-processors", "#autoit Pre-processors",
"#autoit Special", "#autoit Special",
"#autoit Expand", "#autoit Expand",
"#autoit UDF",
0 0
}; };
LexerModule lmAU3(SCLEX_AU3, ColouriseAU3Doc, "au3", FoldAU3Doc , AU3WordLists); LexerModule lmAU3(SCLEX_AU3, ColouriseAU3Doc, "au3", FoldAU3Doc , AU3WordLists);

View File

@@ -258,7 +258,8 @@ static void ColouriseBashDoc(unsigned int startPos, int length, int initStyle,
if (state == SCE_SH_DEFAULT) { if (state == SCE_SH_DEFAULT) {
if (ch == '\\') { // escaped character if (ch == '\\') { // escaped character
i++; if (i < lengthDoc - 1)
i++;
ch = chNext; ch = chNext;
chNext = chNext2; chNext = chNext2;
styler.ColourTo(i, SCE_SH_IDENTIFIER); styler.ColourTo(i, SCE_SH_IDENTIFIER);
@@ -626,7 +627,7 @@ static void FoldBashDoc(unsigned int startPos, int length, int, WordList *[],
&& !IsCommentLine(lineCurrent+1, styler)) && !IsCommentLine(lineCurrent+1, styler))
levelCurrent--; levelCurrent--;
} }
if (style == SCE_C_OPERATOR) { if (style == SCE_SH_OPERATOR) {
if (ch == '{') { if (ch == '{') {
levelCurrent++; levelCurrent++;
} else if (ch == '}') { } else if (ch == '}') {

View File

@@ -147,7 +147,7 @@ static void ColouriseBasicDoc(unsigned int startPos, int length, int initStyle,
sc.ChangeState(SCE_B_ERROR); sc.ChangeState(SCE_B_ERROR);
sc.SetState(SCE_B_DEFAULT); sc.SetState(SCE_B_DEFAULT);
} }
} else if (sc.state == SCE_B_COMMENT) { } else if (sc.state == SCE_B_COMMENT || sc.state == SCE_B_PREPROCESSOR) {
if (sc.atLineEnd) { if (sc.atLineEnd) {
sc.SetState(SCE_B_DEFAULT); sc.SetState(SCE_B_DEFAULT);
} }
@@ -163,7 +163,12 @@ static void ColouriseBasicDoc(unsigned int startPos, int length, int initStyle,
wasfirst = isfirst; wasfirst = isfirst;
sc.SetState(SCE_B_IDENTIFIER); sc.SetState(SCE_B_IDENTIFIER);
} else if (sc.Match(comment_char)) { } else if (sc.Match(comment_char)) {
sc.SetState(SCE_B_COMMENT); // Hack to make deprecated QBASIC '$Include show
// up in freebasic with SCE_B_PREPROCESSOR.
if (comment_char == '\'' && sc.Match(comment_char, '$'))
sc.SetState(SCE_B_PREPROCESSOR);
else
sc.SetState(SCE_B_COMMENT);
} else if (sc.Match('"')) { } else if (sc.Match('"')) {
sc.SetState(SCE_B_STRING); sc.SetState(SCE_B_STRING);
} else if (IsDigit(sc.ch)) { } else if (IsDigit(sc.ch)) {

View File

@@ -459,4 +459,3 @@ static void ColouriseCppDocInsensitive(unsigned int startPos, int length, int in
LexerModule lmCPP(SCLEX_CPP, ColouriseCppDocSensitive, "cpp", FoldCppDoc, cppWordLists); LexerModule lmCPP(SCLEX_CPP, ColouriseCppDocSensitive, "cpp", FoldCppDoc, cppWordLists);
LexerModule lmCPPNoCase(SCLEX_CPPNOCASE, ColouriseCppDocInsensitive, "cppnocase", FoldCppDoc, cppWordLists); LexerModule lmCPPNoCase(SCLEX_CPPNOCASE, ColouriseCppDocInsensitive, "cppnocase", FoldCppDoc, cppWordLists);
LexerModule lmTCL(SCLEX_TCL, ColouriseCppDocSensitive, "tcl", FoldCppDoc, cppWordLists);

View File

@@ -32,7 +32,7 @@ static inline bool isEiffelOperator(unsigned int ch) {
} }
static inline bool IsAWordChar(unsigned int ch) { static inline bool IsAWordChar(unsigned int ch) {
return (ch < 0x80) && (isalnum(ch) || ch == '.' || ch == '_'); return (ch < 0x80) && (isalnum(ch) || ch == '_');
} }
static inline bool IsAWordStart(unsigned int ch) { static inline bool IsAWordStart(unsigned int ch) {

View File

@@ -149,7 +149,13 @@ static inline bool isStringState(int state) {
case SCE_HB_STRING: case SCE_HB_STRING:
case SCE_HBA_STRING: case SCE_HBA_STRING:
case SCE_HP_STRING: case SCE_HP_STRING:
case SCE_HP_CHARACTER:
case SCE_HP_TRIPLE:
case SCE_HP_TRIPLEDOUBLE:
case SCE_HPA_STRING: case SCE_HPA_STRING:
case SCE_HPA_CHARACTER:
case SCE_HPA_TRIPLE:
case SCE_HPA_TRIPLEDOUBLE:
case SCE_HPHP_HSTRING: case SCE_HPHP_HSTRING:
case SCE_HPHP_SIMPLESTRING: case SCE_HPHP_SIMPLESTRING:
case SCE_HPHP_HSTRING_VARIABLE: case SCE_HPHP_HSTRING_VARIABLE:
@@ -163,6 +169,19 @@ static inline bool isStringState(int state) {
return bResult; return bResult;
} }
static inline bool stateAllowsTermination(int state) {
bool allowTermination = !isStringState(state);
if (allowTermination) {
switch (state) {
case SCE_HPHP_COMMENT:
case SCE_HP_COMMENTLINE:
case SCE_HPA_COMMENTLINE:
allowTermination = false;
}
}
return allowTermination;
}
// not really well done, since it's only comments that should lex the %> and <% // not really well done, since it's only comments that should lex the %> and <%
static inline bool isCommentASPState(int state) { static inline bool isCommentASPState(int state) {
bool bResult; bool bResult;
@@ -668,7 +687,7 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty
(ch == '<') && (ch == '<') &&
(chNext == '?') && (chNext == '?') &&
!IsScriptCommentState(state) ) { !IsScriptCommentState(state) ) {
scriptLanguage = segIsScriptingIndicator(styler, styler.GetStartSegment() + 2, i + 10, eScriptPHP); scriptLanguage = segIsScriptingIndicator(styler, i + 2, i + 10, eScriptPHP);
if (scriptLanguage != eScriptPHP && isStringState(state)) continue; if (scriptLanguage != eScriptPHP && isStringState(state)) continue;
styler.ColourTo(i - 1, StateToPrint); styler.ColourTo(i - 1, StateToPrint);
beforePreProc = state; beforePreProc = state;
@@ -763,9 +782,7 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty
else if (( else if ((
((inScriptType == eNonHtmlPreProc) ((inScriptType == eNonHtmlPreProc)
|| (inScriptType == eNonHtmlScriptPreProc)) && ( || (inScriptType == eNonHtmlScriptPreProc)) && (
((scriptLanguage == eScriptPHP) && (ch == '?') && !isPHPStringState(state) && (state != SCE_HPHP_COMMENT)) || ((scriptLanguage != eScriptNone) && stateAllowsTermination(state) && ((ch == '%') || (ch == '?')))
((scriptLanguage != eScriptNone) && !isStringState(state) &&
((ch == '%') || (ch == '?')))
) && (chNext == '>')) || ) && (chNext == '>')) ||
((scriptLanguage == eScriptSGML) && (ch == '>') && (state != SCE_H_SGML_COMMENT))) { ((scriptLanguage == eScriptSGML) && (ch == '>') && (state != SCE_H_SGML_COMMENT))) {
if (state == SCE_H_ASPAT) { if (state == SCE_H_ASPAT) {

View File

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

View File

@@ -38,7 +38,8 @@ static inline bool IsANumberChar(int ch) {
// but probably enough in most cases. // but probably enough in most cases.
return (ch < 0x80) && return (ch < 0x80) &&
(isdigit(ch) || toupper(ch) == 'E' || (isdigit(ch) || toupper(ch) == 'E' ||
ch == '.' || ch == '-' || ch == '+'); ch == '.' || ch == '-' || ch == '+' ||
(ch >= 'a' && ch <= 'f') || (ch >= 'A' && ch <= 'F'));
} }
static inline bool IsLuaOperator(int ch) { static inline bool IsLuaOperator(int ch) {
@@ -51,7 +52,8 @@ static inline bool IsLuaOperator(int 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 == ':' ||
ch == '#') {
return true; return true;
} }
return false; return false;
@@ -144,7 +146,7 @@ static void ColouriseLuaDoc(
if (sc.state == SCE_LUA_OPERATOR) { if (sc.state == SCE_LUA_OPERATOR) {
sc.SetState(SCE_LUA_DEFAULT); sc.SetState(SCE_LUA_DEFAULT);
} else if (sc.state == SCE_LUA_NUMBER) { } else if (sc.state == SCE_LUA_NUMBER) {
// We stop the number definition on non-numerical non-dot non-eE non-sign char // We stop the number definition on non-numerical non-dot non-eE non-sign non-hexdigit char
if (!IsANumberChar(sc.ch)) { if (!IsANumberChar(sc.ch)) {
sc.SetState(SCE_LUA_DEFAULT); sc.SetState(SCE_LUA_DEFAULT);
} }
@@ -225,6 +227,9 @@ static void ColouriseLuaDoc(
if (sc.state == SCE_LUA_DEFAULT) { if (sc.state == SCE_LUA_DEFAULT) {
if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext))) { if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext))) {
sc.SetState(SCE_LUA_NUMBER); sc.SetState(SCE_LUA_NUMBER);
if (sc.ch == '0' && toupper(sc.chNext) == 'X') {
sc.Forward(1);
}
} else if (IsAWordStart(sc.ch)) { } else if (IsAWordStart(sc.ch)) {
sc.SetState(SCE_LUA_IDENTIFIER); sc.SetState(SCE_LUA_IDENTIFIER);
} else if (sc.ch == '\"') { } else if (sc.ch == '\"') {

View File

@@ -3,7 +3,7 @@
** Lexer for MSSQL. ** Lexer for MSSQL.
**/ **/
// By Filip Yaghob <fyaghob@gmail.com> // By Filip Yaghob <fyaghob@gmail.com>
// The License.txt file describes the conditions under which this software may be distributed.
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>

View File

@@ -0,0 +1,518 @@
// Scintilla source code edit control
/** @file LexOpal.cxx
** Lexer for OPAL (functional language similar to Haskell)
** Written by Sebastian Pipping <webmaster@hartwork.org>
**/
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <stdio.h>
#include <stdarg.h>
#include "Platform.h"
#include "PropSet.h"
#include "Accessor.h"
#include "KeyWords.h"
#include "Scintilla.h"
#include "SciLexer.h"
#include "StyleContext.h"
inline static void getRange( unsigned int start, unsigned int end, Accessor & styler, char * s, unsigned int len )
{
unsigned int i = 0;
while( ( i < end - start + 1 ) && ( i < len - 1 ) )
{
s[i] = static_cast<char>( styler[ start + i ] );
i++;
}
s[ i ] = '\0';
}
inline bool HandleString( unsigned int & cur, unsigned int one_too_much, Accessor & styler )
{
char ch;
// Wait for string to close
bool even_backslash_count = true; // Without gaps in between
cur++; // Skip initial quote
for( ; ; )
{
if( cur >= one_too_much )
{
styler.ColourTo( cur - 1, SCE_OPAL_STRING );
return false; // STOP
}
ch = styler.SafeGetCharAt( cur );
if( ( ch == '\015' ) || ( ch == '\012' ) ) // Deny multi-line strings
{
styler.ColourTo( cur - 1, SCE_OPAL_STRING );
styler.StartSegment( cur );
return true;
}
else
{
if( even_backslash_count )
{
if( ch == '"' )
{
styler.ColourTo( cur, SCE_OPAL_STRING );
cur++;
if( cur >= one_too_much )
{
return false; // STOP
}
else
{
styler.StartSegment( cur );
return true;
}
}
else if( ch == '\\' )
{
even_backslash_count = false;
}
}
else
{
even_backslash_count = true;
}
}
cur++;
}
}
inline bool HandleCommentBlock( unsigned int & cur, unsigned int one_too_much, Accessor & styler, bool could_fail )
{
char ch;
if( could_fail )
{
cur++;
if( cur >= one_too_much )
{
styler.ColourTo( cur - 1, SCE_OPAL_DEFAULT );
return false; // STOP
}
ch = styler.SafeGetCharAt( cur );
if( ch != '*' )
{
styler.ColourTo( cur - 1, SCE_OPAL_DEFAULT );
styler.StartSegment( cur );
return true;
}
}
// Wait for comment close
cur++;
bool star_found = false;
for( ; ; )
{
if( cur >= one_too_much )
{
styler.ColourTo( cur - 1, SCE_OPAL_COMMENT_BLOCK );
return false; // STOP
}
ch = styler.SafeGetCharAt( cur );
if( star_found )
{
if( ch == '/' )
{
styler.ColourTo( cur, SCE_OPAL_COMMENT_BLOCK );
cur++;
if( cur >= one_too_much )
{
return false; // STOP
}
else
{
styler.StartSegment( cur );
return true;
}
}
else if( ch != '*' )
{
star_found = false;
}
}
else if( ch == '*' )
{
star_found = true;
}
cur++;
}
}
inline bool HandleCommentLine( unsigned int & cur, unsigned int one_too_much, Accessor & styler, bool could_fail )
{
char ch;
if( could_fail )
{
cur++;
if( cur >= one_too_much )
{
styler.ColourTo( cur - 1, SCE_OPAL_DEFAULT );
return false; // STOP
}
ch = styler.SafeGetCharAt( cur );
if( ch != '-' )
{
styler.ColourTo( cur - 1, SCE_OPAL_DEFAULT );
styler.StartSegment( cur );
return true;
}
cur++;
if( cur >= one_too_much )
{
styler.ColourTo( cur - 1, SCE_OPAL_DEFAULT );
return false; // STOP
}
ch = styler.SafeGetCharAt( cur );
if( ( ch != ' ' ) && ( ch != '\t' ) )
{
styler.ColourTo( cur - 1, SCE_OPAL_DEFAULT );
styler.StartSegment( cur );
return true;
}
}
// Wait for end of line
bool fifteen_found = false;
for( ; ; )
{
cur++;
if( cur >= one_too_much )
{
styler.ColourTo( cur - 1, SCE_OPAL_COMMENT_LINE );
return false; // STOP
}
ch = styler.SafeGetCharAt( cur );
if( fifteen_found )
{
/*
if( ch == '\012' )
{
// One newline on Windows (015, 012)
}
else
{
// One newline on MAC (015) and another char
}
*/
cur--;
styler.ColourTo( cur - 1, SCE_OPAL_COMMENT_LINE );
styler.StartSegment( cur );
return true;
}
else
{
if( ch == '\015' )
{
fifteen_found = true;
}
else if( ch == '\012' )
{
// One newline on Linux (012)
styler.ColourTo( cur - 1, SCE_OPAL_COMMENT_LINE );
styler.StartSegment( cur );
return true;
}
}
}
}
inline bool HandlePar( unsigned int & cur, Accessor & styler )
{
styler.ColourTo( cur, SCE_OPAL_PAR );
cur++;
styler.StartSegment( cur );
return true;
}
inline bool HandleSpace( unsigned int & cur, unsigned int one_too_much, Accessor & styler )
{
char ch;
cur++;
for( ; ; )
{
if( cur >= one_too_much )
{
styler.ColourTo( cur - 1, SCE_OPAL_SPACE );
return false;
}
ch = styler.SafeGetCharAt( cur );
switch( ch )
{
case ' ':
case '\t':
case '\015':
case '\012':
cur++;
break;
default:
styler.ColourTo( cur - 1, SCE_OPAL_SPACE );
styler.StartSegment( cur );
return true;
}
}
}
inline bool HandleInteger( unsigned int & cur, unsigned int one_too_much, Accessor & styler )
{
char ch;
for( ; ; )
{
cur++;
if( cur >= one_too_much )
{
styler.ColourTo( cur - 1, SCE_OPAL_INTEGER );
return false; // STOP
}
ch = styler.SafeGetCharAt( cur );
if( !isdigit( ch ) )
{
styler.ColourTo( cur - 1, SCE_OPAL_INTEGER );
styler.StartSegment( cur );
return true;
}
}
}
inline bool HandleWord( unsigned int & cur, unsigned int one_too_much, Accessor & styler, WordList * keywordlists[] )
{
char ch;
const unsigned int beg = cur;
cur++;
for( ; ; )
{
ch = styler.SafeGetCharAt( cur );
if( ( ch != '_' ) && ( ch != '-' ) &&
!islower( ch ) && !isupper( ch ) && !isdigit( ch ) ) break;
cur++;
if( cur >= one_too_much )
{
break;
}
}
const int ide_len = cur - beg + 1;
char * ide = new char[ ide_len ];
getRange( beg, cur, styler, ide, ide_len );
WordList & keywords = *keywordlists[ 0 ];
WordList & classwords = *keywordlists[ 1 ];
if( keywords.InList( ide ) ) // Keyword
{
delete [] ide;
styler.ColourTo( cur - 1, SCE_OPAL_KEYWORD );
if( cur >= one_too_much )
{
return false; // STOP
}
else
{
styler.StartSegment( cur );
return true;
}
}
else if( classwords.InList( ide ) ) // Sort
{
delete [] ide;
styler.ColourTo( cur - 1, SCE_OPAL_SORT );
if( cur >= one_too_much )
{
return false; // STOP
}
else
{
styler.StartSegment( cur );
return true;
}
}
else if( !strcmp( ide, "true" ) || !strcmp( ide, "false" ) ) // Bool const
{
delete [] ide;
styler.ColourTo( cur - 1, SCE_OPAL_BOOL_CONST );
if( cur >= one_too_much )
{
return false; // STOP
}
else
{
styler.StartSegment( cur );
return true;
}
}
else // Unknown keyword
{
delete [] ide;
styler.ColourTo( cur - 1, SCE_OPAL_DEFAULT );
if( cur >= one_too_much )
{
return false; // STOP
}
else
{
styler.StartSegment( cur );
return true;
}
}
}
inline bool HandleSkip( unsigned int & cur, unsigned int one_too_much, Accessor & styler )
{
cur++;
styler.ColourTo( cur - 1, SCE_OPAL_DEFAULT );
if( cur >= one_too_much )
{
return false; // STOP
}
else
{
styler.StartSegment( cur );
return true;
}
}
static void ColouriseOpalDoc( unsigned int startPos, int length, int initStyle, WordList *keywordlists[], Accessor & styler )
{
styler.StartAt( startPos );
styler.StartSegment( startPos );
unsigned int & cur = startPos;
const unsigned int one_too_much = startPos + length;
int state = initStyle;
for( ; ; )
{
switch( state )
{
case SCE_OPAL_KEYWORD:
case SCE_OPAL_SORT:
if( !HandleWord( cur, one_too_much, styler, keywordlists ) ) return;
state = SCE_OPAL_DEFAULT;
break;
case SCE_OPAL_INTEGER:
if( !HandleInteger( cur, one_too_much, styler ) ) return;
state = SCE_OPAL_DEFAULT;
break;
case SCE_OPAL_COMMENT_BLOCK:
if( !HandleCommentBlock( cur, one_too_much, styler, false ) ) return;
state = SCE_OPAL_DEFAULT;
break;
case SCE_OPAL_COMMENT_LINE:
if( !HandleCommentLine( cur, one_too_much, styler, false ) ) return;
state = SCE_OPAL_DEFAULT;
break;
case SCE_OPAL_STRING:
if( !HandleString( cur, one_too_much, styler ) ) return;
state = SCE_OPAL_DEFAULT;
break;
default: // SCE_OPAL_DEFAULT:
{
char ch = styler.SafeGetCharAt( cur );
switch( ch )
{
// String
case '"':
if( !HandleString( cur, one_too_much, styler ) ) return;
break;
// Comment block
case '/':
if( !HandleCommentBlock( cur, one_too_much, styler, true ) ) return;
break;
// Comment line
case '-':
if( !HandleCommentLine( cur, one_too_much, styler, true ) ) return;
break;
// Par
case '(':
case ')':
case '[':
case ']':
case '{':
case '}':
if( !HandlePar( cur, styler ) ) return;
break;
// Whitespace
case ' ':
case '\t':
case '\015':
case '\012':
if( !HandleSpace( cur, one_too_much, styler ) ) return;
break;
default:
{
// Integer
if( isdigit( ch ) )
{
if( !HandleInteger( cur, one_too_much, styler ) ) return;
}
// Keyword
else if( islower( ch ) || isupper( ch ) )
{
if( !HandleWord( cur, one_too_much, styler, keywordlists ) ) return;
}
// Skip
else
{
if( !HandleSkip( cur, one_too_much, styler ) ) return;
}
}
}
break;
}
}
}
}
static const char * const opalWordListDesc[] = {
"Keywords",
"Sorts",
0
};
LexerModule lmOpal(SCLEX_OPAL, ColouriseOpalDoc, "opal", NULL, opalWordListDesc);

View File

@@ -41,7 +41,7 @@ static bool IsBOperator(char ch) {
// Tests for BATCH Separators // Tests for BATCH Separators
static bool IsBSeparator(char ch) { static bool IsBSeparator(char ch) {
return (ch == ':') || (ch == '\\') || (ch == '.') || (ch == ';') || return (ch == '\\') || (ch == '.') || (ch == ';') ||
(ch == '\"') || (ch == '\'') || (ch == '/') || (ch == ')'); (ch == '\"') || (ch == '\'') || (ch == '/') || (ch == ')');
} }
@@ -50,7 +50,7 @@ static void ColouriseBatchLine(
unsigned int lengthLine, unsigned int lengthLine,
unsigned int startLine, unsigned int startLine,
unsigned int endPos, unsigned int endPos,
WordList &keywords, WordList *keywordlists[],
Accessor &styler) { Accessor &styler) {
unsigned int offset = 0; // Line Buffer Offset unsigned int offset = 0; // Line Buffer Offset
@@ -59,7 +59,9 @@ static void ColouriseBatchLine(
char wordBuffer[81]; // Word Buffer - large to catch long paths char wordBuffer[81]; // Word Buffer - large to catch long paths
unsigned int wbl; // Word Buffer Length unsigned int wbl; // Word Buffer Length
unsigned int wbo; // Word Buffer Offset - also Special Keyword Buffer Length unsigned int wbo; // Word Buffer Offset - also Special Keyword Buffer Length
bool forFound = false; // No Local Variable without FOR statement WordList &keywords = *keywordlists[0]; // Internal Commands
WordList &keywords2 = *keywordlists[1]; // External Commands (optional)
// CHOICE, ECHO, GOTO, PROMPT and SET have Default Text that may contain Regular Keywords // CHOICE, ECHO, GOTO, PROMPT and SET have Default Text that may contain Regular Keywords
// Toggling Regular Keyword Checking off improves readability // Toggling Regular Keyword Checking off improves readability
// Other Regular Keywords and External Commands / Programs might also benefit from toggling // Other Regular Keywords and External Commands / Programs might also benefit from toggling
@@ -174,7 +176,13 @@ static void ColouriseBatchLine(
// Reset Offset to re-process remainder of word // Reset Offset to re-process remainder of word
offset -= (wbl - 1); offset -= (wbl - 1);
// Colorize External Command / Program // Colorize External Command / Program
styler.ColourTo(startLine + offset - 1, SCE_BAT_COMMAND); if (!keywords2) {
styler.ColourTo(startLine + offset - 1, SCE_BAT_COMMAND);
} else if (keywords2.InList(wordBuffer)) {
styler.ColourTo(startLine + offset - 1, SCE_BAT_COMMAND);
} else {
styler.ColourTo(startLine + offset - 1, SCE_BAT_DEFAULT);
}
// Reset External Command / Program Location // Reset External Command / Program Location
cmdLoc = offset; cmdLoc = offset;
} else { } else {
@@ -186,10 +194,6 @@ static void ColouriseBatchLine(
// Check for Regular Keyword in list // Check for Regular Keyword in list
} else if ((keywords.InList(wordBuffer)) && } else if ((keywords.InList(wordBuffer)) &&
(continueProcessing)) { (continueProcessing)) {
// Local Variables do not exist if no FOR statement
if (CompareCaseInsensitive(wordBuffer, "for") == 0) {
forFound = true;
}
// ECHO, GOTO, PROMPT and SET require no further Regular Keyword Checking // ECHO, GOTO, PROMPT and SET require no further Regular Keyword Checking
if ((CompareCaseInsensitive(wordBuffer, "echo") == 0) || if ((CompareCaseInsensitive(wordBuffer, "echo") == 0) ||
(CompareCaseInsensitive(wordBuffer, "goto") == 0) || (CompareCaseInsensitive(wordBuffer, "goto") == 0) ||
@@ -261,8 +265,8 @@ static void ColouriseBatchLine(
styler.ColourTo(startLine + offset - 1 - (wbl - wbo), SCE_BAT_WORD); styler.ColourTo(startLine + offset - 1 - (wbl - wbo), SCE_BAT_WORD);
// Reset Offset to re-process remainder of word // Reset Offset to re-process remainder of word
offset -= (wbl - wbo); offset -= (wbl - wbo);
}
} }
}
// Check for External Command / Program or Default Text // Check for External Command / Program or Default Text
if (!sKeywordFound) { if (!sKeywordFound) {
wbo = 0; wbo = 0;
@@ -306,8 +310,14 @@ static void ColouriseBatchLine(
} }
} }
} }
// Colorize External command / program // Colorize External Command / Program
styler.ColourTo(startLine + offset - 1, SCE_BAT_COMMAND); if (!keywords2) {
styler.ColourTo(startLine + offset - 1, SCE_BAT_COMMAND);
} else if (keywords2.InList(wordBuffer)) {
styler.ColourTo(startLine + offset - 1, SCE_BAT_COMMAND);
} else {
styler.ColourTo(startLine + offset - 1, SCE_BAT_DEFAULT);
}
// No need to Reset Offset // No need to Reset Offset
// Check for Default Text // Check for Default Text
} else { } else {
@@ -354,13 +364,13 @@ static void ColouriseBatchLine(
// Check for External Command / Program // Check for External Command / Program
if (cmdLoc == offset - wbl) { if (cmdLoc == offset - wbl) {
cmdLoc = offset - (wbl - wbo); cmdLoc = offset - (wbl - wbo);
} }
// Colorize Environment Variable // Colorize Environment Variable
styler.ColourTo(startLine + offset - 1 - (wbl - wbo), SCE_BAT_IDENTIFIER); styler.ColourTo(startLine + offset - 1 - (wbl - wbo), SCE_BAT_IDENTIFIER);
// Reset Offset to re-process remainder of word // Reset Offset to re-process remainder of word
offset -= (wbl - wbo); offset -= (wbl - wbo);
// Check for Local Variable (%%a) // Check for Local Variable (%%a)
} else if ((forFound) && } else if (
(wordBuffer[1] == '%') && (wordBuffer[1] == '%') &&
(wordBuffer[2] != '%') && (wordBuffer[2] != '%') &&
(!IsBOperator(wordBuffer[2])) && (!IsBOperator(wordBuffer[2])) &&
@@ -447,7 +457,6 @@ static void ColouriseBatchDoc(
Accessor &styler) { Accessor &styler) {
char lineBuffer[1024]; char lineBuffer[1024];
WordList &keywords = *keywordlists[0];
styler.StartAt(startPos); styler.StartAt(startPos);
styler.StartSegment(startPos); styler.StartSegment(startPos);
@@ -458,14 +467,14 @@ static void ColouriseBatchDoc(
if (AtEOL(styler, i) || (linePos >= sizeof(lineBuffer) - 1)) { if (AtEOL(styler, i) || (linePos >= sizeof(lineBuffer) - 1)) {
// End of line (or of line buffer) met, colourise it // End of line (or of line buffer) met, colourise it
lineBuffer[linePos] = '\0'; lineBuffer[linePos] = '\0';
ColouriseBatchLine(lineBuffer, linePos, startLine, i, keywords, styler); ColouriseBatchLine(lineBuffer, linePos, startLine, i, keywordlists, styler);
linePos = 0; linePos = 0;
startLine = i + 1; startLine = i + 1;
} }
} }
if (linePos > 0) { // Last line does not have ending characters if (linePos > 0) { // Last line does not have ending characters
ColouriseBatchLine(lineBuffer, linePos, startLine, startPos + length - 1, ColouriseBatchLine(lineBuffer, linePos, startLine, startPos + length - 1,
keywords, styler); keywordlists, styler);
} }
} }
@@ -593,8 +602,8 @@ static void ColourisePropsLine(
while ((i < lengthLine) && (lineBuffer[i] != '=')) while ((i < lengthLine) && (lineBuffer[i] != '='))
i++; i++;
if ((i < lengthLine) && (lineBuffer[i] == '=')) { if ((i < lengthLine) && (lineBuffer[i] == '=')) {
styler.ColourTo(startLine + i - 1, SCE_PROPS_DEFAULT); styler.ColourTo(startLine + i - 1, SCE_PROPS_KEY);
styler.ColourTo(startLine + i, 3); styler.ColourTo(startLine + i, SCE_PROPS_ASSIGNMENT);
styler.ColourTo(endPos, SCE_PROPS_DEFAULT); styler.ColourTo(endPos, SCE_PROPS_DEFAULT);
} else { } else {
styler.ColourTo(endPos, SCE_PROPS_DEFAULT); styler.ColourTo(endPos, SCE_PROPS_DEFAULT);
@@ -1103,7 +1112,8 @@ static void ColouriseLatexDoc(unsigned int startPos, int length, int initStyle,
} }
static const char * const batchWordListDesc[] = { static const char * const batchWordListDesc[] = {
"Keywords", "Internal Commands",
"External Commands",
0 0
}; };

View File

@@ -212,6 +212,8 @@ static void ColourisePyDoc(unsigned int startPos, int length, int initStyle,
} else if (sc.state == SCE_P_DECORATOR) { } else if (sc.state == SCE_P_DECORATOR) {
if (sc.ch == '\r' || sc.ch == '\n') { if (sc.ch == '\r' || sc.ch == '\n') {
sc.SetState(SCE_P_DEFAULT); sc.SetState(SCE_P_DEFAULT);
} else if (sc.ch == '#') {
sc.SetState((sc.chNext == '#') ? SCE_P_COMMENTBLOCK : SCE_P_COMMENTLINE);
} }
} else if ((sc.state == SCE_P_STRING) || (sc.state == SCE_P_CHARACTER)) { } else if ((sc.state == SCE_P_STRING) || (sc.state == SCE_P_CHARACTER)) {
if (sc.ch == '\\') { if (sc.ch == '\\') {

View File

@@ -43,7 +43,6 @@ static inline bool IsANumberChar(int ch) {
ch == '.' || ch == '-' || ch == '+'); ch == '.' || ch == '-' || ch == '+');
} }
static void ColouriseSQLDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[], static void ColouriseSQLDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[],
Accessor &styler) { Accessor &styler) {
@@ -60,28 +59,8 @@ static void ColouriseSQLDoc(unsigned int startPos, int length, int initStyle, Wo
bool sqlBackslashEscapes = styler.GetPropertyInt("sql.backslash.escapes", 0) != 0; bool sqlBackslashEscapes = styler.GetPropertyInt("sql.backslash.escapes", 0) != 0;
bool sqlBackticksIdentifier = styler.GetPropertyInt("lexer.sql.backticks.identifier", 0) != 0; bool sqlBackticksIdentifier = styler.GetPropertyInt("lexer.sql.backticks.identifier", 0) != 0;
int styleBeforeDCKeyword = SCE_C_DEFAULT; int styleBeforeDCKeyword = SCE_SQL_DEFAULT;
bool fold = styler.GetPropertyInt("fold") != 0;
int lineCurrent = styler.GetLine(startPos);
for (; sc.More(); sc.Forward()) { for (; sc.More(); sc.Forward()) {
// Fold based on indentation
if (sc.atLineStart) {
int spaceFlags = 0;
int indentCurrent = styler.IndentAmount(lineCurrent, &spaceFlags);
int level = indentCurrent;
if (!(indentCurrent & SC_FOLDLEVELWHITEFLAG)) {
// Only non whitespace lines can be headers
int indentNext = styler.IndentAmount(lineCurrent + 1, &spaceFlags);
if (indentCurrent < (indentNext & ~SC_FOLDLEVELWHITEFLAG)) {
level |= SC_FOLDLEVELHEADERFLAG;
}
}
if (fold) {
styler.SetLevel(lineCurrent, level);
}
}
// Determine if the current state should terminate. // Determine if the current state should terminate.
switch (sc.state) { switch (sc.state) {
case SCE_SQL_OPERATOR: case SCE_SQL_OPERATOR:
@@ -243,12 +222,14 @@ static void FoldSQLDoc(unsigned int startPos, int length, int initStyle,
WordList *[], Accessor &styler) { WordList *[], Accessor &styler) {
bool foldComment = styler.GetPropertyInt("fold.comment") != 0; bool foldComment = styler.GetPropertyInt("fold.comment") != 0;
bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0; bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0;
bool foldOnlyBegin = styler.GetPropertyInt("fold.sql.only.begin", 0) != 0;
unsigned int endPos = startPos + length; unsigned int endPos = startPos + length;
int visibleChars = 0; int visibleChars = 0;
int lineCurrent = styler.GetLine(startPos); int lineCurrent = styler.GetLine(startPos);
int levelCurrent = SC_FOLDLEVELBASE; int levelCurrent = SC_FOLDLEVELBASE;
if (lineCurrent > 0) { if (lineCurrent > 0) {
levelCurrent = styler.LevelAt(lineCurrent - 1) & SC_FOLDLEVELNUMBERMASK; levelCurrent = styler.LevelAt(lineCurrent - 1) >> 16;
} }
int levelNext = levelCurrent; int levelNext = levelCurrent;
char chNext = styler[startPos]; char chNext = styler[startPos];
@@ -306,7 +287,7 @@ static void FoldSQLDoc(unsigned int startPos, int length, int initStyle,
} else { } else {
s[j] = '\0'; s[j] = '\0';
} }
if (strcmp(s, "if") == 0 || strcmp(s, "loop") == 0) { if ((!foldOnlyBegin) && (strcmp(s, "if") == 0 || strcmp(s, "loop") == 0)) {
if (endFound) { if (endFound) {
// ignore // ignore
endFound = false; endFound = false;
@@ -326,16 +307,14 @@ static void FoldSQLDoc(unsigned int startPos, int length, int initStyle,
} }
} }
if (atEOL) { if (atEOL) {
int level = levelCurrent; int levelUse = levelCurrent;
if (visibleChars == 0 && foldCompact) { int lev = levelUse | levelNext << 16;
// Empty line if (visibleChars == 0 && foldCompact)
level |= SC_FOLDLEVELWHITEFLAG; lev |= SC_FOLDLEVELWHITEFLAG;
} if (levelUse < levelNext)
if (visibleChars > 0 && levelNext > levelCurrent) { lev |= SC_FOLDLEVELHEADERFLAG;
level |= SC_FOLDLEVELHEADERFLAG; if (lev != styler.LevelAt(lineCurrent)) {
} styler.SetLevel(lineCurrent, lev);
if (level != styler.LevelAt(lineCurrent)) {
styler.SetLevel(lineCurrent, level);
} }
lineCurrent++; lineCurrent++;
levelCurrent = levelNext; levelCurrent = levelNext;

View File

@@ -0,0 +1,221 @@
// Scintilla source code edit control
/** @file LexSpice.cxx
** Lexer for Spice
**/
// Copyright 2006 by Fabien Proriol
// The License.txt file describes the conditions under which this software may be distributed.
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
#include <stdio.h>
#include "Platform.h"
#include "Accessor.h"
#include "StyleContext.h"
#include "PropSet.h"
#include "KeyWords.h"
#include "SciLexer.h"
#include "SString.h"
/*
* Interface
*/
static void ColouriseDocument(
unsigned int startPos,
int length,
int initStyle,
WordList *keywordlists[],
Accessor &styler);
static const char * const spiceWordListDesc[] = {
"Keywords", // SPICE command
"Keywords2", // SPICE functions
"Keywords3", // SPICE params
0
};
LexerModule lmSpice(SCLEX_SPICE, ColouriseDocument, "spice", NULL, spiceWordListDesc);
/*
* Implementation
*/
static void ColouriseComment(StyleContext& sc, bool& apostropheStartsAttribute);
static void ColouriseDelimiter(StyleContext& sc, bool& apostropheStartsAttribute);
static void ColouriseNumber(StyleContext& sc, bool& apostropheStartsAttribute);
static void ColouriseWhiteSpace(StyleContext& sc, bool& apostropheStartsAttribute);
static void ColouriseWord(StyleContext& sc, WordList& keywords, WordList& keywords2, WordList& keywords3, bool& apostropheStartsAttribute);
static inline bool IsDelimiterCharacter(int ch);
static inline bool IsNumberStartCharacter(int ch);
static inline bool IsNumberCharacter(int ch);
static inline bool IsSeparatorOrDelimiterCharacter(int ch);
static inline bool IsWordStartCharacter(int ch);
static inline bool IsWordCharacter(int ch);
static void ColouriseComment(StyleContext& sc, bool&) {
sc.SetState(SCE_SPICE_COMMENTLINE);
while (!sc.atLineEnd) {
sc.Forward();
}
}
static void ColouriseDelimiter(StyleContext& sc, bool& apostropheStartsAttribute) {
apostropheStartsAttribute = sc.Match (')');
sc.SetState(SCE_SPICE_DELIMITER);
sc.ForwardSetState(SCE_SPICE_DEFAULT);
}
static void ColouriseNumber(StyleContext& sc, bool& apostropheStartsAttribute) {
apostropheStartsAttribute = true;
SString number;
sc.SetState(SCE_SPICE_NUMBER);
// Get all characters up to a delimiter or a separator, including points, but excluding
// double points (ranges).
while (!IsSeparatorOrDelimiterCharacter(sc.ch) || (sc.ch == '.' && sc.chNext != '.')) {
number += static_cast<char>(sc.ch);
sc.Forward();
}
// Special case: exponent with sign
if ((sc.chPrev == 'e' || sc.chPrev == 'E') &&
(sc.ch == '+' || sc.ch == '-')) {
number += static_cast<char>(sc.ch);
sc.Forward ();
while (!IsSeparatorOrDelimiterCharacter(sc.ch)) {
number += static_cast<char>(sc.ch);
sc.Forward();
}
}
sc.SetState(SCE_SPICE_DEFAULT);
}
static void ColouriseWhiteSpace(StyleContext& sc, bool& ) {
sc.SetState(SCE_SPICE_DEFAULT);
sc.ForwardSetState(SCE_SPICE_DEFAULT);
}
static void ColouriseWord(StyleContext& sc, WordList& keywords, WordList& keywords2, WordList& keywords3, bool& apostropheStartsAttribute) {
apostropheStartsAttribute = true;
sc.SetState(SCE_SPICE_IDENTIFIER);
SString word;
while (!sc.atLineEnd && !IsSeparatorOrDelimiterCharacter(sc.ch)) {
word += static_cast<char>(tolower(sc.ch));
sc.Forward();
}
if (keywords.InList(word.c_str())) {
sc.ChangeState(SCE_SPICE_KEYWORD);
if (word != "all") {
apostropheStartsAttribute = false;
}
}
else if (keywords2.InList(word.c_str())) {
sc.ChangeState(SCE_SPICE_KEYWORD2);
if (word != "all") {
apostropheStartsAttribute = false;
}
}
else if (keywords3.InList(word.c_str())) {
sc.ChangeState(SCE_SPICE_KEYWORD3);
if (word != "all") {
apostropheStartsAttribute = false;
}
}
sc.SetState(SCE_SPICE_DEFAULT);
}
//
// ColouriseDocument
//
static void ColouriseDocument(
unsigned int startPos,
int length,
int initStyle,
WordList *keywordlists[],
Accessor &styler) {
WordList &keywords = *keywordlists[0];
WordList &keywords2 = *keywordlists[1];
WordList &keywords3 = *keywordlists[2];
StyleContext sc(startPos, length, initStyle, styler);
int lineCurrent = styler.GetLine(startPos);
bool apostropheStartsAttribute = (styler.GetLineState(lineCurrent) & 1) != 0;
while (sc.More()) {
if (sc.atLineEnd) {
// Go to the next line
sc.Forward();
lineCurrent++;
// Remember the line state for future incremental lexing
styler.SetLineState(lineCurrent, apostropheStartsAttribute);
// Don't continue any styles on the next line
sc.SetState(SCE_SPICE_DEFAULT);
}
// Comments
if ((sc.Match('*') && sc.atLineStart) || sc.Match('*','~')) {
ColouriseComment(sc, apostropheStartsAttribute);
// Whitespace
} else if (IsASpace(sc.ch)) {
ColouriseWhiteSpace(sc, apostropheStartsAttribute);
// Delimiters
} else if (IsDelimiterCharacter(sc.ch)) {
ColouriseDelimiter(sc, apostropheStartsAttribute);
// Numbers
} else if (IsADigit(sc.ch) || sc.ch == '#') {
ColouriseNumber(sc, apostropheStartsAttribute);
// Keywords or identifiers
} else {
ColouriseWord(sc, keywords, keywords2, keywords3, apostropheStartsAttribute);
}
}
sc.Complete();
}
static inline bool IsDelimiterCharacter(int ch) {
switch (ch) {
case '&':
case '\'':
case '(':
case ')':
case '*':
case '+':
case ',':
case '-':
case '.':
case '/':
case ':':
case ';':
case '<':
case '=':
case '>':
case '|':
return true;
default:
return false;
}
}
static inline bool IsNumberCharacter(int ch) {
return IsNumberStartCharacter(ch) ||
ch == '_' ||
ch == '.' ||
ch == '#' ||
(ch >= 'a' && ch <= 'f') ||
(ch >= 'A' && ch <= 'F');
}
static inline bool IsNumberStartCharacter(int ch) {
return IsADigit(ch);
}
static inline bool IsSeparatorOrDelimiterCharacter(int ch) {
return IsASpace(ch) || IsDelimiterCharacter(ch);
}
static inline bool IsWordCharacter(int ch) {
return IsWordStartCharacter(ch) || IsADigit(ch);
}
static inline bool IsWordStartCharacter(int ch) {
return (isascii(ch) && isalpha(ch)) || ch == '_';
}

View File

@@ -0,0 +1,362 @@
// Scintilla source code edit control
/** @file LexTCL.cxx
** Lexer for TCL language.
**/
// Copyright 1998-2001 by Andre Arpin <arpin@kingston.net>
// The License.txt file describes the conditions under which this software may be distributed.
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <stdarg.h>
#include <stdio.h>
#include "Platform.h"
#include "PropSet.h"
#include "Accessor.h"
#include "StyleContext.h"
#include "KeyWords.h"
#include "Scintilla.h"
#include "SciLexer.h"
// Extended to accept accented characters
static inline bool IsAWordChar(int ch) {
return ch >= 0x80 ||
(isalnum(ch) || ch == '_' || ch ==':' || ch=='.'); // : name space separator
}
static inline bool IsAWordStart(int ch) {
return ch >= 0x80 || (ch ==':' || isalpha(ch) || ch == '_');
}
static inline bool IsANumberChar(int ch) {
// Not exactly following number definition (several dots are seen as OK, etc.)
// but probably enough in most cases.
return (ch < 0x80) &&
(IsADigit(ch, 0x10) || toupper(ch) == 'E' ||
ch == '.' || ch == '-' || ch == '+');
}
static void ColouriseTCLDoc(unsigned int startPos, int length, int , WordList *keywordlists[], Accessor &styler) {
#define isComment(s) (s==SCE_TCL_COMMENT || s==SCE_TCL_COMMENTLINE || s==SCE_TCL_COMMENT_BOX || s==SCE_TCL_BLOCK_COMMENT)
bool foldComment = styler.GetPropertyInt("fold.comment") != 0;
bool commentLevel = false;
bool subBrace = false; // substitution begin with a brace ${.....}
enum tLineState {LS_DEFAULT, LS_OPEN_COMMENT, LS_OPEN_DOUBLE_QUOTE, LS_COMMENT_BOX, LS_MASK_STATE = 0xf,
LS_COMMAND_EXPECTED = 16, LS_BRACE_ONLY = 32 } lineState = LS_DEFAULT;
bool prevSlash = false;
int currentLevel = 0;
bool expected = 0;
bool subParen = 0;
int currentLine = styler.GetLine(startPos);
if (currentLine > 0)
currentLine--;
length += startPos - styler.LineStart(currentLine);
// make sure lines overlap
startPos = styler.LineStart(currentLine);
WordList &keywords = *keywordlists[0];
WordList &keywords2 = *keywordlists[1];
WordList &keywords3 = *keywordlists[2];
WordList &keywords4 = *keywordlists[3];
WordList &keywords5 = *keywordlists[4];
WordList &keywords6 = *keywordlists[5];
WordList &keywords7 = *keywordlists[6];
WordList &keywords8 = *keywordlists[7];
WordList &keywords9 = *keywordlists[8];
if (currentLine > 0) {
int ls = styler.GetLineState(currentLine - 1);
lineState = tLineState(ls & LS_MASK_STATE);
expected = LS_COMMAND_EXPECTED == tLineState(ls & LS_COMMAND_EXPECTED);
subBrace = LS_BRACE_ONLY == tLineState(ls & LS_BRACE_ONLY);
currentLevel = styler.LevelAt(currentLine - 1) >> 17;
commentLevel = (styler.LevelAt(currentLine - 1) >> 16) & 1;
} else
styler.SetLevel(0, SC_FOLDLEVELBASE | SC_FOLDLEVELHEADERFLAG);
bool visibleChars = false;
int previousLevel = currentLevel;
StyleContext sc(startPos, length, SCE_TCL_DEFAULT, styler);
for (; ; sc.Forward()) {
next:
if (sc.ch=='\r' && sc.chNext == '\n') // only ignore \r on PC process on the mac
continue;
bool atEnd = !sc.More(); // make sure we coloured the last word
if (lineState != LS_DEFAULT) {
sc.SetState(SCE_TCL_DEFAULT);
if (lineState == LS_OPEN_COMMENT)
sc.SetState(SCE_TCL_COMMENTLINE);
else if (lineState == LS_OPEN_DOUBLE_QUOTE)
sc.SetState(SCE_TCL_IN_QUOTE);
else if (lineState == LS_COMMENT_BOX && (sc.ch == '#' || (sc.ch == ' ' && sc.chNext=='#')))
sc.SetState(SCE_TCL_COMMENT_BOX);
lineState = LS_DEFAULT;
}
if (subBrace) { // ${ overrides every thing even \ except }
if (sc.ch == '}') {
subBrace = false;
sc.SetState(SCE_TCL_OPERATOR);
sc.ForwardSetState(SCE_TCL_DEFAULT);
goto next;
}
else
sc.SetState(SCE_TCL_SUB_BRACE);
if (!sc.atLineEnd)
continue;
} else if (sc.state == SCE_TCL_DEFAULT || sc.state ==SCE_TCL_OPERATOR) {
expected &= isspacechar(static_cast<unsigned char>(sc.ch)) || IsAWordStart(sc.ch) || sc.ch =='#';
} else if (sc.state == SCE_TCL_SUBSTITUTION) {
switch(sc.ch) {
case '(':
subParen=true;
sc.SetState(SCE_TCL_OPERATOR);
sc.ForwardSetState(SCE_TCL_SUBSTITUTION);
continue;
case ')':
sc.SetState(SCE_TCL_OPERATOR);
subParen=false;
continue;
case '$':
continue;
case ',':
sc.SetState(SCE_TCL_OPERATOR);
if (subParen)
sc.ForwardSetState(SCE_TCL_SUBSTITUTION);
continue;
default :
// maybe spaces should be allowed ???
if (!IsAWordChar(sc.ch)) { // probably the code is wrong
sc.SetState(SCE_TCL_DEFAULT);
subParen = 0;
}
break;
}
} else if (isComment(sc.state)) {
} else if (!IsAWordChar(sc.ch)) {
if ((sc.state == SCE_TCL_IDENTIFIER && expected) || sc.state == SCE_TCL_MODIFIER) {
char w[100];
char *s=w;
sc.GetCurrent(w, sizeof(w));
if (w[strlen(w)-1]=='\r')
w[strlen(w)-1]=0;
while(*s == ':') // ignore leading : like in ::set a 10
++s;
bool quote = sc.state == SCE_TCL_IN_QUOTE;
if (commentLevel || expected) {
if (keywords.InList(s)) {
sc.ChangeState(quote ? SCE_TCL_WORD_IN_QUOTE : SCE_TCL_WORD);
} else if (keywords2.InList(s)) {
sc.ChangeState(quote ? SCE_TCL_WORD_IN_QUOTE : SCE_TCL_WORD2);
} else if (keywords3.InList(s)) {
sc.ChangeState(quote ? SCE_TCL_WORD_IN_QUOTE : SCE_TCL_WORD3);
} else if (keywords4.InList(s)) {
sc.ChangeState(quote ? SCE_TCL_WORD_IN_QUOTE : SCE_TCL_WORD4);
} else if (sc.GetRelative(-static_cast<int>(strlen(s))-1) == '{' &&
keywords5.InList(s) && sc.ch == '}') { // {keyword} exactly no spaces
sc.ChangeState(SCE_TCL_EXPAND);
}
if (keywords6.InList(s)) {
sc.ChangeState(SCE_TCL_WORD5);
} else if (keywords7.InList(s)) {
sc.ChangeState(SCE_TCL_WORD6);
} else if (keywords8.InList(s)) {
sc.ChangeState(SCE_TCL_WORD7);
} else if (keywords9.InList(s)) {
sc.ChangeState(SCE_TCL_WORD8);
}
}
expected = false;
sc.SetState(quote ? SCE_TCL_IN_QUOTE : SCE_TCL_DEFAULT);
} else if (sc.state == SCE_TCL_MODIFIER || sc.state == SCE_TCL_IDENTIFIER) {
sc.SetState(SCE_TCL_DEFAULT);
}
}
if (atEnd)
break;
if (sc.atLineEnd) {
lineState = LS_DEFAULT;
currentLine = styler.GetLine(sc.currentPos);
if (foldComment && sc.state!=SCE_TCL_COMMENT && isComment(sc.state)) {
if (currentLevel == 0) {
++currentLevel;
commentLevel = true;
}
} else {
if (visibleChars && commentLevel) {
--currentLevel;
--previousLevel;
commentLevel = false;
}
}
int flag = 0;
if (!visibleChars)
flag = SC_FOLDLEVELWHITEFLAG;
if (currentLevel > previousLevel)
flag = SC_FOLDLEVELHEADERFLAG;
styler.SetLevel(currentLine, flag + previousLevel + SC_FOLDLEVELBASE + (currentLevel << 17) + (commentLevel << 16));
// Update the line state, so it can be seen by next line
if (sc.state == SCE_TCL_IN_QUOTE)
lineState = LS_OPEN_DOUBLE_QUOTE;
else {
if (prevSlash) {
if (isComment(sc.state))
lineState = LS_OPEN_COMMENT;
} else if (sc.state == SCE_TCL_COMMENT_BOX)
lineState = LS_COMMENT_BOX;
}
styler.SetLineState(currentLine,
(subBrace ? LS_BRACE_ONLY : 0) |
(expected ? LS_COMMAND_EXPECTED : 0) | lineState);
if (lineState == LS_COMMENT_BOX)
sc.ForwardSetState(SCE_TCL_COMMENT_BOX);
else if (lineState == LS_OPEN_DOUBLE_QUOTE)
sc.ForwardSetState(SCE_TCL_IN_QUOTE);
else
sc.ForwardSetState(SCE_TCL_DEFAULT);
prevSlash = false;
previousLevel = currentLevel;
goto next;
}
if (prevSlash) {
prevSlash = false;
if (sc.ch == '#' && IsANumberChar(sc.chNext))
sc.ForwardSetState(SCE_TCL_NUMBER);
continue;
}
prevSlash = sc.ch == '\\';
if (isComment(sc.state))
continue;
if (sc.atLineStart) {
visibleChars = false;
if (sc.state!=SCE_TCL_IN_QUOTE && !isComment(sc.state))
{
sc.SetState(SCE_TCL_DEFAULT);
expected = IsAWordStart(sc.ch)|| isspacechar(static_cast<unsigned char>(sc.ch));
}
}
switch (sc.state) {
case SCE_TCL_NUMBER:
if (!IsANumberChar(sc.ch))
sc.SetState(SCE_TCL_DEFAULT);
break;
case SCE_TCL_IN_QUOTE:
if (sc.ch == '"') {
sc.ForwardSetState(SCE_TCL_DEFAULT);
visibleChars = true; // necessary if a " is the first and only character on a line
goto next;
} else if (sc.ch == '[' || sc.ch == ']' || sc.ch == '$') {
sc.SetState(SCE_TCL_OPERATOR);
expected = sc.ch == '[';
sc.ForwardSetState(SCE_TCL_IN_QUOTE);
goto next;
}
continue;
case SCE_TCL_OPERATOR:
sc.SetState(SCE_TCL_DEFAULT);
break;
}
if (sc.ch == '#') {
if (visibleChars) {
if (sc.state != SCE_TCL_IN_QUOTE && expected)
sc.SetState(SCE_TCL_COMMENT);
} else {
sc.SetState(SCE_TCL_COMMENTLINE);
if (sc.chNext == '~')
sc.SetState(SCE_TCL_BLOCK_COMMENT);
if (sc.atLineStart && (sc.chNext == '#' || sc.chNext == '-'))
sc.SetState(SCE_TCL_COMMENT_BOX);
}
}
if (!isspacechar(static_cast<unsigned char>(sc.ch))) {
visibleChars = true;
}
if (sc.ch == '\\') {
prevSlash = true;
continue;
}
// Determine if a new state should be entered.
if (sc.state == SCE_TCL_DEFAULT) {
if (IsAWordStart(sc.ch)) {
sc.SetState(SCE_TCL_IDENTIFIER);
} else if (IsADigit(sc.ch) && !IsAWordChar(sc.chPrev)) {
sc.SetState(SCE_TCL_NUMBER);
} else {
switch (sc.ch) {
case '\"':
sc.SetState(SCE_TCL_IN_QUOTE);
break;
case '{':
sc.SetState(SCE_TCL_OPERATOR);
expected = true;
++currentLevel;
break;
case '}':
sc.SetState(SCE_TCL_OPERATOR);
--currentLevel;
break;
case '[':
expected = true;
case ']':
case '(':
case ')':
sc.SetState(SCE_TCL_OPERATOR);
break;
case ';':
expected = true;
break;
case '$':
subParen = 0;
if (sc.chNext != '{') {
sc.SetState(SCE_TCL_SUBSTITUTION);
}
else {
sc.SetState(SCE_TCL_OPERATOR); // $
sc.Forward(); // {
sc.ForwardSetState(SCE_TCL_SUB_BRACE);
subBrace = true;
}
break;
case '#':
if ((isspacechar(static_cast<unsigned char>(sc.chPrev))||
isoperator(static_cast<char>(sc.chPrev))) && IsADigit(sc.chNext,0x10))
sc.SetState(SCE_TCL_NUMBER);
break;
case '-':
sc.SetState(IsADigit(sc.chNext)? SCE_TCL_NUMBER: SCE_TCL_MODIFIER);
break;
default:
if (isoperator(static_cast<char>(sc.ch))) {
sc.SetState(SCE_TCL_OPERATOR);
}
}
}
}
}
sc.Complete();
}
static const char * const tclWordListDesc[] = {
"TCL Keywords",
"TK Keywords",
"iTCL Keywords",
"tkCommands",
"expand"
"user1",
"user2",
"user3",
"user4",
0
};
// this code supports folding in the colourizer
LexerModule lmTCL(SCLEX_TCL, ColouriseTCLDoc, "tcl", 0, tclWordListDesc);

View File

@@ -15,11 +15,13 @@ public:
int markType; int markType;
ColourPair fore; ColourPair fore;
ColourPair back; ColourPair back;
int alpha;
XPM *pxpm; XPM *pxpm;
LineMarker() { LineMarker() {
markType = SC_MARK_CIRCLE; markType = SC_MARK_CIRCLE;
fore = ColourDesired(0,0,0); fore = ColourDesired(0,0,0);
back = ColourDesired(0xff,0xff,0xff); back = ColourDesired(0xff,0xff,0xff);
alpha = SC_ALPHA_NOALPHA;
pxpm = NULL; pxpm = NULL;
} }
LineMarker(const LineMarker &) { LineMarker(const LineMarker &) {
@@ -27,6 +29,7 @@ public:
markType = SC_MARK_CIRCLE; markType = SC_MARK_CIRCLE;
fore = ColourDesired(0,0,0); fore = ColourDesired(0,0,0);
back = ColourDesired(0xff,0xff,0xff); back = ColourDesired(0xff,0xff,0xff);
alpha = SC_ALPHA_NOALPHA;
pxpm = NULL; pxpm = NULL;
} }
~LineMarker() { ~LineMarker() {
@@ -37,6 +40,7 @@ public:
markType = SC_MARK_CIRCLE; markType = SC_MARK_CIRCLE;
fore = ColourDesired(0,0,0); fore = ColourDesired(0,0,0);
back = ColourDesired(0xff,0xff,0xff); back = ColourDesired(0xff,0xff,0xff);
alpha = SC_ALPHA_NOALPHA;
delete pxpm; delete pxpm;
pxpm = NULL; pxpm = NULL;
return *this; return *this;

View File

@@ -4,7 +4,7 @@
**/ **/
/* /*
* regex - Regular expression pattern matching and replacement * regex - Regular expression pattern matching and replacement
* *
* By: Ozan S. Yigit (oz) * By: Ozan S. Yigit (oz)
* Dept. of Computer Science * Dept. of Computer Science
@@ -15,7 +15,7 @@
* Removed all use of register. * Removed all use of register.
* Converted to modern function prototypes. * Converted to modern function prototypes.
* Put all global/static variables into an object so this code can be * Put all global/static variables into an object so this code can be
* used from multiple threads etc. * used from multiple threads, etc.
* *
* These routines are the PUBLIC DOMAIN equivalents of regex * These routines are the PUBLIC DOMAIN equivalents of regex
* routines as found in 4.nBSD UN*X, with minor extensions. * routines as found in 4.nBSD UN*X, with minor extensions.
@@ -30,64 +30,62 @@
* Modification history removed. * Modification history removed.
* *
* Interfaces: * Interfaces:
* RESearch::Compile: compile a regular expression into a NFA. * RESearch::Compile: compile a regular expression into a NFA.
* *
* char *RESearch::Compile(s) * const char *RESearch::Compile(const char *pat, int length,
* char *s; * bool caseSensitive, bool posix)
* *
* RESearch::Execute: execute the NFA to match a pattern. * Returns a short error string if they fail.
* *
* int RESearch::Execute(s) * RESearch::Execute: execute the NFA to match a pattern.
* char *s;
* *
* RESearch::ModifyWord change RESearch::Execute's understanding of what a "word" * int RESearch::Execute(characterIndexer &ci, int lp, int endp)
* looks like (for \< and \>) by adding into the
* hidden word-syntax table.
* *
* void RESearch::ModifyWord(s) * RESearch::Substitute: substitute the matched portions in a new string.
* char *s;
* *
* RESearch::Substitute: substitute the matched portions in a new string. * int RESearch::Substitute(CharacterIndexer &ci, char *src, char *dst)
* *
* int RESearch::Substitute(src, dst) * re_fail: failure routine for RESearch::Execute. (no longer used)
* char *src;
* char *dst;
* *
* re_fail: failure routine for RESearch::Execute. * void re_fail(char *msg, char op)
*
* void re_fail(msg, op)
* char *msg;
* char op;
* *
* Regular Expressions: * Regular Expressions:
* *
* [1] char matches itself, unless it is a special * [1] char matches itself, unless it is a special
* character (metachar): . \ [ ] * + ^ $ * character (metachar): . \ [ ] * + ^ $
* and ( ) if posix option.
* *
* [2] . matches any character. * [2] . matches any character.
* *
* [3] \ matches the character following it, except * [3] \ matches the character following it, except:
* when followed by a left or right round bracket, * - \a, \b, \f, \n, \t, \v match the
* a digit 1 to 9 or a left or right angle bracket. * corresponding C escape char;
* (see [7], [8] and [9]) * - if not in posix mode, when followed by a
* It is used as an escape character for all * left or right round bracket (see [7]);
* other meta-characters, and itself. When used * - when followed by a digit 1 to 9 (see [8]);
* in a set ([4]), it is treated as an ordinary * - when followed by a left or right angle bracket
* character. * (see [9]).
* It is used as an escape character for all
* other meta-characters, and itself. When used
* in a set ([4]), it is treated as an ordinary
* character (except for escape chars).
* *
* [4] [set] matches one of the characters in the set. * [4] [set] matches one of the characters in the set.
* If the first character in the set is "^", * If the first character in the set is "^",
* it matches a character NOT in the set, i.e. * it matches a character NOT in the set, i.e.
* complements the set. A shorthand S-E is * complements the set. A shorthand S-E (start-end)
* used to specify a set of characters S upto * is used to specify a set of characters S upto
* E, inclusive. The special characters "]" and * E, inclusive. The special characters "]" and
* "-" have no special meaning if they appear * "-" have no special meaning if they appear
* as the first chars in the set. * as the first chars in the set. To include both,
* put - first: [-]A-Z]:
* [-]|] matches these 2 chars,
* []-|] matches from ] to | chars.
* examples: match: * examples: match:
* *
* [a-z] any lowercase alpha * [a-z] any lowercase alpha
* *
* [^]-] any char except ] and - * [^-]] any char except - and ]
* *
* [^A-Z] any char except uppercase * [^A-Z] any char except uppercase
* alpha * alpha
@@ -101,81 +99,87 @@
* [6] + same as [5], except it matches one or more. * [6] + same as [5], except it matches one or more.
* *
* [7] a regular expression in the form [1] to [10], enclosed * [7] a regular expression in the form [1] to [10], enclosed
* as \(form\) matches what form matches. The enclosure * as \(form\) (or (form) with posix flag) matches what
* creates a set of tags, used for [8] and for * form matches. The enclosure creates a set of tags,
* pattern substution. The tagged forms are numbered * used for [8] and for pattern substitution.
* starting from 1. * The tagged forms are numbered starting from 1.
* *
* [8] a \ followed by a digit 1 to 9 matches whatever a * [8] a \ followed by a digit 1 to 9 matches whatever a
* previously tagged regular expression ([7]) matched. * previously tagged regular expression ([7]) matched.
* *
* [9] \< a regular expression starting with a \< construct * [9] \< a regular expression starting with a \< construct
* \> and/or ending with a \> construct, restricts the * \> and/or ending with a \> construct, restricts the
* pattern matching to the beginning of a word, and/or * pattern matching to the beginning of a word, and/or
* the end of a word. A word is defined to be a character * the end of a word. A word is defined to be a character
* string beginning and/or ending with the characters * string beginning and/or ending with the characters
* A-Z a-z 0-9 and _. It must also be preceded and/or * A-Z a-z 0-9 and _. It must also be preceded and/or
* followed by any character outside those mentioned. * followed by any character outside those mentioned.
* *
* [10] a composite regular expression xy where x and y * [10] a composite regular expression xy where x and y
* are in the form [1] to [10] matches the longest * are in the form [1] to [10] matches the longest
* match of x followed by a match for y. * match of x followed by a match for y.
* *
* [11] ^ a regular expression starting with a ^ character * [11] ^ a regular expression starting with a ^ character
* $ and/or ending with a $ character, restricts the * $ and/or ending with a $ character, restricts the
* pattern matching to the beginning of the line, * pattern matching to the beginning of the line,
* or the end of line. [anchors] Elsewhere in the * or the end of line. [anchors] Elsewhere in the
* pattern, ^ and $ are treated as ordinary characters. * pattern, ^ and $ are treated as ordinary characters.
* *
* *
* Acknowledgements: * Acknowledgements:
* *
* HCR's Hugh Redelmeier has been most helpful in various * HCR's Hugh Redelmeier has been most helpful in various
* stages of development. He convinced me to include BOW * stages of development. He convinced me to include BOW
* and EOW constructs, originally invented by Rob Pike at * and EOW constructs, originally invented by Rob Pike at
* the University of Toronto. * the University of Toronto.
* *
* References: * References:
* Software tools Kernighan & Plauger * Software tools Kernighan & Plauger
* Software tools in Pascal Kernighan & Plauger * Software tools in Pascal Kernighan & Plauger
* Grep [rsx-11 C dist] David Conroy * Grep [rsx-11 C dist] David Conroy
* ed - text editor Un*x Programmer's Manual * ed - text editor Un*x Programmer's Manual
* Advanced editing on Un*x B. W. Kernighan * Advanced editing on Un*x B. W. Kernighan
* RegExp routines Henry Spencer * RegExp routines Henry Spencer
* *
* Notes: * Notes:
* *
* This implementation uses a bit-set representation for character * This implementation uses a bit-set representation for character
* classes for speed and compactness. Each character is represented * classes for speed and compactness. Each character is represented
* by one bit in a 128-bit block. Thus, CCL always takes a * by one bit in a 256-bit block. Thus, CCL always takes a
* constant 16 bytes in the internal nfa, and RESearch::Execute does a single * constant 32 bytes in the internal nfa, and RESearch::Execute does a single
* bit comparison to locate the character in the set. * bit comparison to locate the character in the set.
* *
* Examples: * Examples:
* *
* pattern: foo*.* * pattern: foo*.*
* compile: CHR f CHR o CLO CHR o END CLO ANY END END * compile: CHR f CHR o CLO CHR o END CLO ANY END END
* matches: fo foo fooo foobar fobar foxx ... * matches: fo foo fooo foobar fobar foxx ...
* *
* pattern: fo[ob]a[rz] * pattern: fo[ob]a[rz]
* compile: CHR f CHR o CCL bitset CHR a CCL bitset END * compile: CHR f CHR o CCL bitset CHR a CCL bitset END
* matches: fobar fooar fobaz fooaz * matches: fobar fooar fobaz fooaz
* *
* pattern: foo\\+ * pattern: foo\\+
* compile: CHR f CHR o CHR o CHR \ CLO CHR \ END END * compile: CHR f CHR o CHR o CHR \ CLO CHR \ END END
* matches: foo\ foo\\ foo\\\ ... * matches: foo\ foo\\ foo\\\ ...
* *
* pattern: \(foo\)[1-3]\1 (same as foo[1-3]foo) * pattern: \(foo\)[1-3]\1 (same as foo[1-3]foo)
* compile: BOT 1 CHR f CHR o CHR o EOT 1 CCL bitset REF 1 END * compile: BOT 1 CHR f CHR o CHR o EOT 1 CCL bitset REF 1 END
* matches: foo1foo foo2foo foo3foo * matches: foo1foo foo2foo foo3foo
* *
* pattern: \(fo.*\)-\1 * pattern: \(fo.*\)-\1
* compile: BOT 1 CHR f CHR o CLO ANY END EOT 1 CHR - REF 1 END * compile: BOT 1 CHR f CHR o CLO ANY END EOT 1 CHR - REF 1 END
* matches: foo-foo fo-fo fob-fob foobar-foobar ... * matches: foo-foo fo-fo fob-fob foobar-foobar ...
*/ */
#include "CharClassify.h"
#include "RESearch.h" #include "RESearch.h"
// Shut up annoying Visual C++ warnings:
#ifdef _MSC_VER
#pragma warning(disable: 4514)
#endif
#define OKP 1 #define OKP 1
#define NOP 0 #define NOP 0
@@ -186,8 +190,8 @@
#define EOL 5 #define EOL 5
#define BOT 6 #define BOT 6
#define EOT 7 #define EOT 7
#define BOW 8 #define BOW 8
#define EOW 9 #define EOW 9
#define REF 10 #define REF 10
#define CLO 11 #define CLO 11
@@ -197,16 +201,22 @@
* The following defines are not meant to be changeable. * The following defines are not meant to be changeable.
* They are for readability only. * They are for readability only.
*/ */
#define BLKIND 0370 #define BLKIND 0370
#define BITIND 07 #define BITIND 07
#define ASCIIB 0177
const char bitarr[] = {1,2,4,8,16,32,64,'\200'}; const char bitarr[] = {1,2,4,8,16,32,64,'\200'};
#define badpat(x) (*nfa = END, x) #define badpat(x) (*nfa = END, x)
RESearch::RESearch() { /*
* Character classification table for word boundary operators BOW
* and EOW is passed in by the creator of this object (Scintilla
* Document). The Document default state is that word chars are:
* 0-9,a-z, A-Z and _
*/
RESearch::RESearch(CharClassify *charClassTable) {
charClass = charClassTable;
Init(); Init();
} }
@@ -215,7 +225,7 @@ RESearch::~RESearch() {
} }
void RESearch::Init() { void RESearch::Init() {
sta = NOP; /* status of lastpat */ sta = NOP; /* status of lastpat */
bol = 0; bol = 0;
for (int i=0; i<MAXTAG; i++) for (int i=0; i<MAXTAG; i++)
pat[i] = 0; pat[i] = 0;
@@ -285,15 +295,15 @@ const char escapeValue(char ch) {
const char *RESearch::Compile(const char *pat, int length, bool caseSensitive, bool posix) { const char *RESearch::Compile(const char *pat, int length, bool caseSensitive, bool posix) {
char *mp=nfa; /* nfa pointer */ char *mp=nfa; /* nfa pointer */
char *lp; /* saved pointer.. */ char *lp; /* saved pointer */
char *sp=nfa; /* another one.. */ char *sp=nfa; /* another one */
char *mpMax = mp + MAXNFA - BITBLK - 10; char *mpMax = mp + MAXNFA - BITBLK - 10;
int tagi = 0; /* tag stack index */ int tagi = 0; /* tag stack index */
int tagc = 1; /* actual tag count */ int tagc = 1; /* actual tag count */
int n; int n;
char mask; /* xor mask -CCL/NCL */ char mask; /* xor mask -CCL/NCL */
int c1, c2; int c1, c2;
if (!pat || !length) if (!pat || !length)
@@ -303,18 +313,18 @@ const char *RESearch::Compile(const char *pat, int length, bool caseSensitive, b
return badpat("No previous regular expression"); return badpat("No previous regular expression");
sta = NOP; sta = NOP;
const char *p=pat; /* pattern pointer */ const char *p=pat; /* pattern pointer */
for (int i=0; i<length; i++, p++) { for (int i=0; i<length; i++, p++) {
if (mp > mpMax) if (mp > mpMax)
return badpat("Pattern too long"); return badpat("Pattern too long");
lp = mp; lp = mp;
switch(*p) { switch(*p) {
case '.': /* match any char.. */ case '.': /* match any char */
*mp++ = ANY; *mp++ = ANY;
break; break;
case '^': /* match beginning.. */ case '^': /* match beginning */
if (p == pat) if (p == pat)
*mp++ = BOL; *mp++ = BOL;
else { else {
@@ -323,7 +333,7 @@ const char *RESearch::Compile(const char *pat, int length, bool caseSensitive, b
} }
break; break;
case '$': /* match endofline.. */ case '$': /* match endofline */
if (!*(p+1)) if (!*(p+1))
*mp++ = EOL; *mp++ = EOL;
else { else {
@@ -332,7 +342,7 @@ const char *RESearch::Compile(const char *pat, int length, bool caseSensitive, b
} }
break; break;
case '[': /* match char class..*/ case '[': /* match char class */
*mp++ = CCL; *mp++ = CCL;
i++; i++;
@@ -343,7 +353,7 @@ const char *RESearch::Compile(const char *pat, int length, bool caseSensitive, b
} else } else
mask = 0; mask = 0;
if (*p == '-') { /* real dash */ if (*p == '-') { /* real dash */
i++; i++;
ChSet(*p++); ChSet(*p++);
} }
@@ -384,12 +394,12 @@ const char *RESearch::Compile(const char *pat, int length, bool caseSensitive, b
break; break;
case '*': /* match 0 or more.. */ case '*': /* match 0 or more... */
case '+': /* match 1 or more.. */ case '+': /* match 1 or more... */
if (p == pat) if (p == pat)
return badpat("Empty closure"); return badpat("Empty closure");
lp = sp; /* previous opcode */ lp = sp; /* previous opcode */
if (*lp == CLO) /* equivalence.. */ if (*lp == CLO) /* equivalence... */
break; break;
switch(*lp) { switch(*lp) {
@@ -417,7 +427,7 @@ const char *RESearch::Compile(const char *pat, int length, bool caseSensitive, b
mp = sp; mp = sp;
break; break;
case '\\': /* tags, backrefs .. */ case '\\': /* tags, backrefs... */
i++; i++;
switch(*++p) { switch(*++p) {
@@ -483,7 +493,7 @@ const char *RESearch::Compile(const char *pat, int length, bool caseSensitive, b
} }
break; break;
default : /* an ordinary char */ default : /* an ordinary char */
if (posix && *p == '(') { if (posix && *p == '(') {
if (tagc < MAXTAG) { if (tagc < MAXTAG) {
tagstk[++tagi] = tagc; tagstk[++tagi] = tagc;
@@ -524,23 +534,23 @@ const char *RESearch::Compile(const char *pat, int length, bool caseSensitive, b
/* /*
* RESearch::Execute: * RESearch::Execute:
* execute nfa to find a match. * execute nfa to find a match.
* *
* special cases: (nfa[0]) * special cases: (nfa[0])
* BOL * BOL
* Match only once, starting from the * Match only once, starting from the
* beginning. * beginning.
* CHR * CHR
* First locate the character without * First locate the character without
* calling PMatch, and if found, call * calling PMatch, and if found, call
* PMatch for the remaining string. * PMatch for the remaining string.
* END * END
* RESearch::Compile failed, poor luser did not * RESearch::Compile failed, poor luser did not
* check for it. Fail fast. * check for it. Fail fast.
* *
* If a match is found, bopat[0] and eopat[0] are set * If a match is found, bopat[0] and eopat[0] are set
* to the beginning and the end of the matched fragment, * to the beginning and the end of the matched fragment,
* respectively. * respectively.
* *
*/ */
@@ -571,7 +581,7 @@ int RESearch::Execute(CharacterIndexer &ci, int lp, int endp) {
c = *(ap+1); c = *(ap+1);
while ((lp < endp) && (ci.CharAt(lp) != c)) while ((lp < endp) && (ci.CharAt(lp) != c))
lp++; lp++;
if (lp >= endp) /* if EOS, fail, else fall thru. */ if (lp >= endp) /* if EOS, fail, else fall thru. */
return 0; return 0;
default: /* regular matching all the way. */ default: /* regular matching all the way. */
while (lp < endp) { while (lp < endp) {
@@ -595,78 +605,50 @@ int RESearch::Execute(CharacterIndexer &ci, int lp, int endp) {
/* /*
* PMatch: internal routine for the hard part * PMatch: internal routine for the hard part
* *
* This code is partly snarfed from an early grep written by * This code is partly snarfed from an early grep written by
* David Conroy. The backref and tag stuff, and various other * David Conroy. The backref and tag stuff, and various other
* innovations are by oz. * innovations are by oz.
* *
* special case optimizations: (nfa[n], nfa[n+1]) * special case optimizations: (nfa[n], nfa[n+1])
* CLO ANY * CLO ANY
* We KNOW .* will match everything upto the * We KNOW .* will match everything upto the
* end of line. Thus, directly go to the end of * end of line. Thus, directly go to the end of
* line, without recursive PMatch calls. As in * line, without recursive PMatch calls. As in
* the other closure cases, the remaining pattern * the other closure cases, the remaining pattern
* must be matched by moving backwards on the * must be matched by moving backwards on the
* string recursively, to find a match for xy * string recursively, to find a match for xy
* (x is ".*" and y is the remaining pattern) * (x is ".*" and y is the remaining pattern)
* where the match satisfies the LONGEST match for * where the match satisfies the LONGEST match for
* x followed by a match for y. * x followed by a match for y.
* CLO CHR * CLO CHR
* We can again scan the string forward for the * We can again scan the string forward for the
* single char and at the point of failure, we * single char and at the point of failure, we
* execute the remaining nfa recursively, same as * execute the remaining nfa recursively, same as
* above. * above.
*
* At the end of a successful match, bopat[n] and eopat[n]
* are set to the beginning and end of subpatterns matched
* by tagged expressions (n = 1 to 9).
* *
* At the end of a successful match, bopat[n] and eopat[n]
* are set to the beginning and end of subpatterns matched
* by tagged expressions (n = 1 to 9).
*/ */
extern void re_fail(char *,char); extern void re_fail(char *,char);
/* #define isinset(x,y) ((x)[((y)&BLKIND)>>3] & bitarr[(y)&BITIND])
* character classification table for word boundary operators BOW
* and EOW. the reason for not using ctype macros is that we can
* let the user add into our own table. see RESearch::ModifyWord. This table
* is not in the bitset form, since we may wish to extend it in the
* future for other character classifications.
*
* TRUE for 0-9 A-Z a-z _
*/
static char chrtyp[MAXCHR] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 0, 0,
0, 0, 0, 0, 0, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 0, 0, 0, 0, 1, 0, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 0, 0, 0, 0, 0
};
#define inascii(x) (0177&(x))
#define iswordc(x) chrtyp[inascii(x)]
#define isinset(x,y) ((x)[((y)&BLKIND)>>3] & bitarr[(y)&BITIND])
/* /*
* skip values for CLO XXX to skip past the closure * skip values for CLO XXX to skip past the closure
*/ */
#define ANYSKIP 2 /* [CLO] ANY END ... */ #define ANYSKIP 2 /* [CLO] ANY END */
#define CHRSKIP 3 /* [CLO] CHR chr END ... */ #define CHRSKIP 3 /* [CLO] CHR chr END */
#define CCLSKIP 34 /* [CLO] CCL 32bytes END ... */ #define CCLSKIP 34 /* [CLO] CCL 32 bytes END */
int RESearch::PMatch(CharacterIndexer &ci, int lp, int endp, char *ap) { int RESearch::PMatch(CharacterIndexer &ci, int lp, int endp, char *ap) {
int op, c, n; int op, c, n;
int e; /* extra pointer for CLO */ int e; /* extra pointer for CLO */
int bp; /* beginning of subpat.. */ int bp; /* beginning of subpat... */
int ep; /* ending of subpat.. */ int ep; /* ending of subpat... */
int are; /* to save the line ptr. */ int are; /* to save the line ptr. */
while ((op = *ap++) != END) while ((op = *ap++) != END)
switch(op) { switch(op) {
@@ -756,44 +738,15 @@ int RESearch::PMatch(CharacterIndexer &ci, int lp, int endp, char *ap) {
return lp; return lp;
} }
/*
* RESearch::ModifyWord:
* add new characters into the word table to change RESearch::Execute's
* understanding of what a word should look like. Note that we
* only accept additions into the word definition.
*
* If the string parameter is 0 or null string, the table is
* reset back to the default containing A-Z a-z 0-9 _. [We use
* the compact bitset representation for the default table]
*/
static char deftab[16] = {
0, 0, 0, 0, 0, 0, '\377', 003, '\376', '\377', '\377', '\207',
'\376', '\377', '\377', 007
};
void RESearch::ModifyWord(char *s) {
int i;
if (!s || !*s) {
for (i = 0; i < MAXCHR; i++)
if (!isinset(deftab,i))
iswordc(i) = 0;
}
else
while(*s)
iswordc(*s++) = 1;
}
/* /*
* RESearch::Substitute: * RESearch::Substitute:
* substitute the matched portions of the src in dst. * substitute the matched portions of the src in dst.
* *
* & substitute the entire matched pattern. * & substitute the entire matched pattern.
* *
* \digit substitute a subpattern, with the given tag number. * \digit substitute a subpattern, with the given tag number.
* Tags are numbered from 1 to 9. If the particular * Tags are numbered from 1 to 9. If the particular
* tagged subpattern does not exist, null is substituted. * tagged subpattern does not exist, null is substituted.
*/ */
int RESearch::Substitute(CharacterIndexer &ci, char *src, char *dst) { int RESearch::Substitute(CharacterIndexer &ci, char *src, char *dst) {
char c; char c;

View File

@@ -27,16 +27,11 @@ public:
class RESearch { class RESearch {
public: public:
RESearch(); RESearch(CharClassify *charClassTable);
~RESearch(); ~RESearch();
void Init();
void Clear();
bool GrabMatches(CharacterIndexer &ci); bool GrabMatches(CharacterIndexer &ci);
void ChSet(char c);
void ChSetWithCase(char c, bool caseSensitive);
const char *Compile(const char *pat, int length, bool caseSensitive, bool posix); const char *Compile(const char *pat, int length, bool caseSensitive, bool posix);
int Execute(CharacterIndexer &ci, int lp, int endp); int Execute(CharacterIndexer &ci, int lp, int endp);
void ModifyWord(char *s);
int Substitute(CharacterIndexer &ci, char *src, char *dst); int Substitute(CharacterIndexer &ci, char *src, char *dst);
enum {MAXTAG=10}; enum {MAXTAG=10};
@@ -48,15 +43,23 @@ public:
char *pat[MAXTAG]; char *pat[MAXTAG];
private: private:
void Init();
void Clear();
void ChSet(char c);
void ChSetWithCase(char c, bool caseSensitive);
int PMatch(CharacterIndexer &ci, int lp, int endp, char *ap); int PMatch(CharacterIndexer &ci, int lp, int endp, char *ap);
int bol; int bol;
int tagstk[MAXTAG]; /* subpat tag stack..*/ int tagstk[MAXTAG]; /* subpat tag stack */
char nfa[MAXNFA]; /* automaton.. */ char nfa[MAXNFA]; /* automaton */
int sta; int sta;
char bittab[BITBLK]; /* bit table for CCL */ char bittab[BITBLK]; /* bit table for CCL pre-set bits */
/* pre-set bits... */
int failure; int failure;
CharClassify *charClass;
bool iswordc(unsigned char x) {
return charClass->IsWord(x);
}
}; };
#endif #endif

View File

@@ -31,6 +31,7 @@
#include "Style.h" #include "Style.h"
#include "ViewStyle.h" #include "ViewStyle.h"
#include "AutoComplete.h" #include "AutoComplete.h"
#include "CharClassify.h"
#include "Document.h" #include "Document.h"
#include "Editor.h" #include "Editor.h"
#include "ScintillaBase.h" #include "ScintillaBase.h"
@@ -368,12 +369,19 @@ int ScintillaBase::AutoCompleteGetCurrent() {
void ScintillaBase::CallTipShow(Point pt, const char *defn) { void ScintillaBase::CallTipShow(Point pt, const char *defn) {
AutoCompleteCancel(); AutoCompleteCancel();
pt.y += vs.lineHeight; pt.y += vs.lineHeight;
// If container knows about STYLE_CALLTIP then use it in place of the
// STYLE_DEFAULT for the face name, size and character set. Also use it
// for the foreground and background colour.
int ctStyle = ct.UseStyleCallTip() ? STYLE_CALLTIP : STYLE_DEFAULT;
if (ct.UseStyleCallTip()) {
ct.SetForeBack(vs.styles[STYLE_CALLTIP].fore, vs.styles[STYLE_CALLTIP].back);
}
PRectangle rc = ct.CallTipStart(currentPos, pt, PRectangle rc = ct.CallTipStart(currentPos, pt,
defn, defn,
vs.styles[STYLE_DEFAULT].fontName, vs.styles[ctStyle].fontName,
vs.styles[STYLE_DEFAULT].sizeZoomed, vs.styles[ctStyle].sizeZoomed,
CodePage(), CodePage(),
vs.styles[STYLE_DEFAULT].characterSet, vs.styles[ctStyle].characterSet,
wMain); wMain);
// If the call-tip window would be out of the client // If the call-tip window would be out of the client
// space, adjust so it displays above the text. // space, adjust so it displays above the text.
@@ -461,7 +469,7 @@ void ScintillaBase::Colourise(int start, int end) {
int styleStart = 0; int styleStart = 0;
if (start > 0) if (start > 0)
styleStart = styler.StyleAt(start - 1); styleStart = styler.StyleAt(start - 1) & pdoc->stylingBitsMask;
styler.SetCodePage(pdoc->dbcsCodePage); styler.SetCodePage(pdoc->dbcsCodePage);
if (lexCurrent && (len > 0)) { // Should always succeed as null lexer should always be available if (lexCurrent && (len > 0)) { // Should always succeed as null lexer should always be available
@@ -624,11 +632,13 @@ sptr_t ScintillaBase::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lPara
case SCI_CALLTIPSETBACK: case SCI_CALLTIPSETBACK:
ct.colourBG = ColourDesired(wParam); ct.colourBG = ColourDesired(wParam);
vs.styles[STYLE_CALLTIP].fore = ct.colourBG;
InvalidateStyleRedraw(); InvalidateStyleRedraw();
break; break;
case SCI_CALLTIPSETFORE: case SCI_CALLTIPSETFORE:
ct.colourUnSel = ColourDesired(wParam); ct.colourUnSel = ColourDesired(wParam);
vs.styles[STYLE_CALLTIP].fore = ct.colourUnSel;
InvalidateStyleRedraw(); InvalidateStyleRedraw();
break; break;
@@ -637,6 +647,11 @@ sptr_t ScintillaBase::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lPara
InvalidateStyleRedraw(); InvalidateStyleRedraw();
break; break;
case SCI_CALLTIPUSESTYLE:
ct.SetTabSize((int)wParam);
InvalidateStyleRedraw();
break;
case SCI_USEPOPUP: case SCI_USEPOPUP:
displayPopupMenu = wParam != 0; displayPopupMenu = wParam != 0;
break; break;

View File

@@ -17,7 +17,7 @@
#include "ViewStyle.h" #include "ViewStyle.h"
MarginStyle::MarginStyle() : MarginStyle::MarginStyle() :
symbol(false), width(16), mask(0xffffffff), sensitive(false) { style(SC_MARGIN_SYMBOL), width(0), mask(0), sensitive(false) {
} }
// A list of the fontnames - avoids wasting space in each style // A list of the fontnames - avoids wasting space in each style
@@ -73,6 +73,7 @@ ViewStyle::ViewStyle(const ViewStyle &source) {
selbackset = source.selbackset; selbackset = source.selbackset;
selbackground.desired = source.selbackground.desired; selbackground.desired = source.selbackground.desired;
selbackground2.desired = source.selbackground2.desired; selbackground2.desired = source.selbackground2.desired;
selAlpha = source.selAlpha;
foldmarginColourSet = source.foldmarginColourSet; foldmarginColourSet = source.foldmarginColourSet;
foldmarginColour.desired = source.foldmarginColour.desired; foldmarginColour.desired = source.foldmarginColour.desired;
@@ -95,6 +96,7 @@ ViewStyle::ViewStyle(const ViewStyle &source) {
caretcolour.desired = source.caretcolour.desired; caretcolour.desired = source.caretcolour.desired;
showCaretLineBackground = source.showCaretLineBackground; showCaretLineBackground = source.showCaretLineBackground;
caretLineBackground.desired = source.caretLineBackground.desired; caretLineBackground.desired = source.caretLineBackground.desired;
caretLineAlpha = source.caretLineAlpha;
edgecolour.desired = source.edgecolour.desired; edgecolour.desired = source.edgecolour.desired;
edgeState = source.edgeState; edgeState = source.edgeState;
caretWidth = source.caretWidth; caretWidth = source.caretWidth;
@@ -140,6 +142,7 @@ void ViewStyle::Init() {
selbackset = true; selbackset = true;
selbackground.desired = ColourDesired(0xc0, 0xc0, 0xc0); selbackground.desired = ColourDesired(0xc0, 0xc0, 0xc0);
selbackground2.desired = ColourDesired(0xb0, 0xb0, 0xb0); selbackground2.desired = ColourDesired(0xb0, 0xb0, 0xb0);
selAlpha = SC_ALPHA_NOALPHA;
foldmarginColourSet = false; foldmarginColourSet = false;
foldmarginColour.desired = ColourDesired(0xff, 0, 0); foldmarginColour.desired = ColourDesired(0xff, 0, 0);
@@ -157,6 +160,7 @@ void ViewStyle::Init() {
caretcolour.desired = ColourDesired(0, 0, 0); caretcolour.desired = ColourDesired(0, 0, 0);
showCaretLineBackground = false; showCaretLineBackground = false;
caretLineBackground.desired = ColourDesired(0xff, 0xff, 0); caretLineBackground.desired = ColourDesired(0xff, 0xff, 0);
caretLineAlpha = SC_ALPHA_NOALPHA;
edgecolour.desired = ColourDesired(0xc0, 0xc0, 0xc0); edgecolour.desired = ColourDesired(0xc0, 0xc0, 0xc0);
edgeState = EDGE_NONE; edgeState = EDGE_NONE;
caretWidth = 1; caretWidth = 1;
@@ -171,13 +175,13 @@ void ViewStyle::Init() {
leftMarginWidth = 1; leftMarginWidth = 1;
rightMarginWidth = 1; rightMarginWidth = 1;
ms[0].symbol = false; ms[0].style = SC_MARGIN_NUMBER;
ms[0].width = 0; ms[0].width = 0;
ms[0].mask = 0; ms[0].mask = 0;
ms[1].symbol = true; ms[1].style = SC_MARGIN_SYMBOL;
ms[1].width = 16; ms[1].width = 16;
ms[1].mask = ~SC_MASK_FOLDERS; ms[1].mask = ~SC_MASK_FOLDERS;
ms[2].symbol = true; ms[2].style = SC_MARGIN_SYMBOL;
ms[2].width = 0; ms[2].width = 0;
ms[2].mask = 0; ms[2].mask = 0;
fixedColumnWidth = leftMarginWidth; fixedColumnWidth = leftMarginWidth;
@@ -185,7 +189,7 @@ void ViewStyle::Init() {
maskInLine = 0xffffffff; maskInLine = 0xffffffff;
for (int margin=0; margin < margins; margin++) { for (int margin=0; margin < margins; margin++) {
fixedColumnWidth += ms[margin].width; fixedColumnWidth += ms[margin].width;
symbolMargin = symbolMargin || ms[margin].symbol; symbolMargin = symbolMargin || (ms[margin].style != SC_MARGIN_NUMBER);
if (ms[margin].width > 0) if (ms[margin].width > 0)
maskInLine &= ~ms[margin].mask; maskInLine &= ~ms[margin].mask;
} }
@@ -256,7 +260,7 @@ void ViewStyle::Refresh(Surface &surface) {
maskInLine = 0xffffffff; maskInLine = 0xffffffff;
for (int margin=0; margin < margins; margin++) { for (int margin=0; margin < margins; margin++) {
fixedColumnWidth += ms[margin].width; fixedColumnWidth += ms[margin].width;
symbolMargin = symbolMargin || ms[margin].symbol; symbolMargin = symbolMargin || (ms[margin].style != SC_MARGIN_NUMBER);
if (ms[margin].width > 0) if (ms[margin].width > 0)
maskInLine &= ~ms[margin].mask; maskInLine &= ~ms[margin].mask;
} }
@@ -278,6 +282,10 @@ void ViewStyle::ClearStyles() {
} }
} }
styles[STYLE_LINENUMBER].back.desired = Platform::Chrome(); styles[STYLE_LINENUMBER].back.desired = Platform::Chrome();
// Set call tip fore/back to match the values previously set for call tips
styles[STYLE_CALLTIP].back.desired = ColourDesired(0xff, 0xff, 0xff);
styles[STYLE_CALLTIP].fore.desired = ColourDesired(0x80, 0x80, 0x80);
} }
void ViewStyle::SetStyleFontName(int styleIndex, const char *name) { void ViewStyle::SetStyleFontName(int styleIndex, const char *name) {

View File

@@ -12,7 +12,7 @@
*/ */
class MarginStyle { class MarginStyle {
public: public:
bool symbol; int style;
int width; int width;
int mask; int mask;
bool sensitive; bool sensitive;
@@ -53,6 +53,7 @@ public:
bool selbackset; bool selbackset;
ColourPair selbackground; ColourPair selbackground;
ColourPair selbackground2; ColourPair selbackground2;
int selAlpha;
bool whitespaceForegroundSet; bool whitespaceForegroundSet;
ColourPair whitespaceForeground; ColourPair whitespaceForeground;
bool whitespaceBackgroundSet; bool whitespaceBackgroundSet;
@@ -70,7 +71,7 @@ public:
bool hotspotUnderline; bool hotspotUnderline;
bool hotspotSingleLine; bool hotspotSingleLine;
/// Margins are ordered: Line Numbers, Selection Margin, Spacing Margin /// Margins are ordered: Line Numbers, Selection Margin, Spacing Margin
enum { margins=3 }; enum { margins=5 };
int leftMarginWidth; ///< Spacing margin on left of text int leftMarginWidth; ///< Spacing margin on left of text
int rightMarginWidth; ///< Spacing margin on left of text int rightMarginWidth; ///< Spacing margin on left of text
bool symbolMargin; bool symbolMargin;
@@ -85,6 +86,7 @@ public:
ColourPair caretcolour; ColourPair caretcolour;
bool showCaretLineBackground; bool showCaretLineBackground;
ColourPair caretLineBackground; ColourPair caretLineBackground;
int caretLineAlpha;
ColourPair edgecolour; ColourPair edgecolour;
int edgeState; int edgeState;
int caretWidth; int caretWidth;

View File

@@ -535,6 +535,11 @@ void wxStyledTextCtrl::MarkerAddSet(int line, int set) {
SendMsg(2466, line, set); SendMsg(2466, line, set);
} }
// Set the alpha used for a marker that is drawn in the text area, not the margin.
void wxStyledTextCtrl::MarkerSetAlpha(int markerNumber, int alpha) {
SendMsg(2476, markerNumber, alpha);
}
// Set a margin to be either numeric or symbolic. // Set a margin to be either numeric or symbolic.
void wxStyledTextCtrl::SetMarginType(int margin, int marginType) { void wxStyledTextCtrl::SetMarginType(int margin, int marginType) {
SendMsg(2240, margin, marginType); SendMsg(2240, margin, marginType);
@@ -645,6 +650,16 @@ void wxStyledTextCtrl::SetSelBackground(bool useSetting, const wxColour& back) {
SendMsg(2068, useSetting, wxColourAsLong(back)); SendMsg(2068, useSetting, wxColourAsLong(back));
} }
// Get the alpha of the selection.
int wxStyledTextCtrl::GetSelAlpha() {
return SendMsg(2477, 0, 0);
}
// Set the alpha of the selection.
void wxStyledTextCtrl::SetSelAlpha(int alpha) {
SendMsg(2478, alpha, 0);
}
// Set the foreground colour of the caret. // Set the foreground colour of the caret.
void wxStyledTextCtrl::SetCaretForeground(const wxColour& fore) { void wxStyledTextCtrl::SetCaretForeground(const wxColour& fore) {
SendMsg(2069, wxColourAsLong(fore), 0); SendMsg(2069, wxColourAsLong(fore), 0);
@@ -1445,6 +1460,11 @@ void wxStyledTextCtrl::CallTipSetForegroundHighlight(const wxColour& fore) {
SendMsg(2207, wxColourAsLong(fore), 0); SendMsg(2207, wxColourAsLong(fore), 0);
} }
// Enable use of STYLE_CALLTIP and set call tip tab size in pixels.
void wxStyledTextCtrl::CallTipUseStyle(int tabSize) {
SendMsg(2212, tabSize, 0);
}
// Find the display line of a document line taking hidden lines into account. // Find the display line of a document line taking hidden lines into account.
int wxStyledTextCtrl::VisibleFromDocLine(int line) { int wxStyledTextCtrl::VisibleFromDocLine(int line) {
return SendMsg(2220, line, 0); return SendMsg(2220, line, 0);
@@ -2481,6 +2501,16 @@ void wxStyledTextCtrl::SelectionDuplicate() {
SendMsg(2469, 0, 0); SendMsg(2469, 0, 0);
} }
// Set background alpha of the caret line.
void wxStyledTextCtrl::SetCaretLineBackAlpha(int alpha) {
SendMsg(2470, alpha, 0);
}
// Get the background alpha of the caret line.
int wxStyledTextCtrl::GetCaretLineBackAlpha() {
return SendMsg(2471, 0, 0);
}
// Start notifying the container of all key presses and commands. // Start notifying the container of all key presses and commands.
void wxStyledTextCtrl::StartRecord() { void wxStyledTextCtrl::StartRecord() {
SendMsg(3001, 0, 0); SendMsg(3001, 0, 0);

View File

@@ -155,6 +155,9 @@ DocStr(wxStyledTextCtrl::MarkerDefineBitmap,
DocStr(wxStyledTextCtrl::MarkerAddSet, DocStr(wxStyledTextCtrl::MarkerAddSet,
"Add a set of markers to a line.", ""); "Add a set of markers to a line.", "");
DocStr(wxStyledTextCtrl::MarkerSetAlpha,
"Set the alpha used for a marker that is drawn in the text area, not the margin.", "");
DocStr(wxStyledTextCtrl::SetMarginType, DocStr(wxStyledTextCtrl::SetMarginType,
"Set a margin to be either numeric or symbolic.", ""); "Set a margin to be either numeric or symbolic.", "");
@@ -221,6 +224,12 @@ DocStr(wxStyledTextCtrl::SetSelForeground,
DocStr(wxStyledTextCtrl::SetSelBackground, DocStr(wxStyledTextCtrl::SetSelBackground,
"Set the background colour of the selection and whether to use this setting.", ""); "Set the background colour of the selection and whether to use this setting.", "");
DocStr(wxStyledTextCtrl::GetSelAlpha,
"Get the alpha of the selection.", "");
DocStr(wxStyledTextCtrl::SetSelAlpha,
"Set the alpha of the selection.", "");
DocStr(wxStyledTextCtrl::SetCaretForeground, DocStr(wxStyledTextCtrl::SetCaretForeground,
"Set the foreground colour of the caret.", ""); "Set the foreground colour of the caret.", "");
@@ -654,6 +663,9 @@ DocStr(wxStyledTextCtrl::CallTipSetForeground,
DocStr(wxStyledTextCtrl::CallTipSetForegroundHighlight, DocStr(wxStyledTextCtrl::CallTipSetForegroundHighlight,
"Set the foreground colour for the highlighted part of the call tip.", ""); "Set the foreground colour for the highlighted part of the call tip.", "");
DocStr(wxStyledTextCtrl::CallTipUseStyle,
"Enable use of STYLE_CALLTIP and set call tip tab size in pixels.", "");
DocStr(wxStyledTextCtrl::VisibleFromDocLine, DocStr(wxStyledTextCtrl::VisibleFromDocLine,
"Find the display line of a document line taking hidden lines into account.", ""); "Find the display line of a document line taking hidden lines into account.", "");
@@ -1302,6 +1314,12 @@ DocStr(wxStyledTextCtrl::GetPasteConvertEndings,
DocStr(wxStyledTextCtrl::SelectionDuplicate, DocStr(wxStyledTextCtrl::SelectionDuplicate,
"Duplicate the selection. If selection empty duplicate the line containing the caret.", ""); "Duplicate the selection. If selection empty duplicate the line containing the caret.", "");
DocStr(wxStyledTextCtrl::SetCaretLineBackAlpha,
"Set background alpha of the caret line.", "");
DocStr(wxStyledTextCtrl::GetCaretLineBackAlpha,
"Get the background alpha of the caret line.", "");
DocStr(wxStyledTextCtrl::StartRecord, DocStr(wxStyledTextCtrl::StartRecord,
"Start notifying the container of all key presses and commands.", ""); "Start notifying the container of all key presses and commands.", "");

View File

@@ -3,6 +3,7 @@ Recent Changes for wxPython
2.7.0.0 2.7.0.0
------- -------
*
The following deprecated items have been removed: The following deprecated items have been removed:
@@ -175,10 +176,48 @@ Added wrappers for the wxAUI classes, in the wx.aui module.
Added the PseudoDC class from Paul Lanier. It provides a way to Added the PseudoDC class from Paul Lanier. It provides a way to
record operations on a DC and then play them back later. record operations on a DC and then play them back later.
Upgraded to Scintilla 1.70 for wx.stc.StyledTextCtrl.
2.6.3.3
-------
* 15-July-2006
wx.lib.pubsub updates from Oliver Schoenborn:
- fixed the hash problem with non-hashable objects
- now supports listeners that use \*args as an argument
(listener(\*args) was not passing the validity test)
- corrected some mistakes in documentation
- added some clarifications (hopefully useful for first time
users)
- changed the way singleton is implemented since old way prevented
pydoc etc from extracting docs for Publisher
DocView and ActiveGrid IDE updates from Morgan Hua:
New Features: In Tab-View mode, Ctrl-number will take the user to
the numbered tab view. Modified files now show an '*' astrisk in
the view title. Debugger framework can now support PHP debugging.
Not important for python development, but at least that means the
debugger framework is more generalized.
wx.lib.mixins.listctrl.TextEditMixin: Fixed the double END_LABEL_EDIT
event problem in TextEditMixin by checking if the editor was already
hidden before continuing with the CloseEditor method. Also added code
to OpenEditor to send the BEGIN_LABEL_EDIT event and to not allow the
opening of the editor to continue if the event handler doesn't allow
it.
Undeprecated wx.GetNumberFromUser and added wx.NumberEntryDialog.
Made necessaary changes for building wxPython for Python 2.5. There
may still be some issues related to the new Py_ssize_t type and 64-bit
machines, but at least all compile errors and warnings related to it
have been resolved.
2.6.3.2 2.6.3.2
------- -------