├── .gitignore
├── LICENSE
├── README.md
├── SimpleNotePad.sln
├── SimpleNotePad
├── AboutDlg.cpp
├── AboutDlg.h
├── BaseDialog.cpp
├── BaseDialog.h
├── CVariant.cpp
├── CVariant.h
├── CodeConvertDlg.cpp
├── CodeConvertDlg.h
├── ColorStatic.cpp
├── ColorStatic.h
├── ColorStaticEx.cpp
├── ColorStaticEx.h
├── Common.cpp
├── Common.h
├── CommonData.cpp
├── CommonData.h
├── DeleteDataDlg.cpp
├── DeleteDataDlg.h
├── DonateDlg.cpp
├── DonateDlg.h
├── DrawCommon.cpp
├── DrawCommon.h
├── EditEx.cpp
├── EditEx.h
├── EditSettingsDlg.cpp
├── EditSettingsDlg.h
├── EditorHelper.cpp
├── EditorHelper.h
├── FileCompareDlg.cpp
├── FileCompareDlg.h
├── FilePathHelper.cpp
├── FilePathHelper.h
├── FileRelateDlg.cpp
├── FileRelateDlg.h
├── FindReplaceDlg.cpp
├── FindReplaceDlg.h
├── FindReplaceTools.cpp
├── FindReplaceTools.h
├── FormatConvertDlg.cpp
├── FormatConvertDlg.h
├── GeneralSettingsDlg.cpp
├── GeneralSettingsDlg.h
├── GoToLineDlg.cpp
├── GoToLineDlg.h
├── HexEditView.cpp
├── HexEditView.h
├── HexViewDlg.cpp
├── HexViewDlg.h
├── InputDlg.cpp
├── InputDlg.h
├── InsertDataDlg.cpp
├── InsertDataDlg.h
├── LanguageSettingsDlg.cpp
├── LanguageSettingsDlg.h
├── ReadMe.txt
├── RegFileRelate.cpp
├── RegFileRelate.h
├── ScintillaEditView.cpp
├── ScintillaEditView.h
├── SettingsDlg.cpp
├── SettingsDlg.h
├── SimpleNotePad.cpp
├── SimpleNotePad.h
├── SimpleNotePad.rc
├── SimpleNotePad.vcxproj
├── SimpleNotePad.vcxproj.filters
├── SimpleNotePadDlg.cpp
├── SimpleNotePadDlg.h
├── SimpleXML.cpp
├── SimpleXML.h
├── SpinEdit.cpp
├── SpinEdit.h
├── SyntaxHighlight.cpp
├── SyntaxHighlight.h
├── TabCtrlEx.cpp
├── TabCtrlEx.h
├── TabDlg.cpp
├── TabDlg.h
├── Test.cpp
├── Test.h
├── TinyXml2Helper.cpp
├── TinyXml2Helper.h
├── UpdateHelper.cpp
├── UpdateHelper.h
├── UserDefinedLanguageStyle.cpp
├── UserDefinedLanguageStyle.h
├── WIC.cpp
├── WIC.h
├── WinVersionHelper.cpp
├── WinVersionHelper.h
├── crashtool.cpp
├── crashtool.h
├── lang.xml
├── res
│ ├── SimpleNotePad.ico
│ ├── SimpleNotePad.rc2
│ ├── capital.ico
│ ├── clipboard.ico
│ ├── code.ico
│ ├── code_batch.ico
│ ├── comment.ico
│ ├── compare.ico
│ ├── copy.ico
│ ├── cut.ico
│ ├── date_time.ico
│ ├── donate.bmp
│ ├── donate_wechat.bmp
│ ├── exit.ico
│ ├── explore.ico
│ ├── file.ico
│ ├── find.ico
│ ├── font.ico
│ ├── help.ico
│ ├── hex_view.ico
│ ├── language.ico
│ ├── lower_case.ico
│ ├── mark.ico
│ ├── new.ico
│ ├── new_window.ico
│ ├── next.ico
│ ├── open.ico
│ ├── paste.ico
│ ├── pin.ico
│ ├── previous.ico
│ ├── recent_files.ico
│ ├── redo.ico
│ ├── reload.ico
│ ├── replace.ico
│ ├── save.ico
│ ├── save_as.ico
│ ├── select_all.ico
│ ├── settings.ico
│ ├── undo.ico
│ ├── zoom_in.ico
│ └── zoom_out.ico
├── resource.h
├── simplemarshal.h
├── stdafx.cpp
├── stdafx.h
├── targetver.h
└── xmlMatchedTagsHighlighter
│ ├── xmlMatchedTagsHighlighter.cpp
│ └── xmlMatchedTagsHighlighter.h
├── bin
├── Win32_Debug
│ └── tinyxml2d.dll
├── Win32_Release
│ └── tinyxml2.dll
├── x64_Debug
│ └── tinyxml2d.dll
└── x64_Release
│ └── tinyxml2.dll
├── images
├── 1.png
└── SimpleNotepad.png
├── include
└── tinyxml2.h
├── lib
├── tinyxml2.lib
├── tinyxml2d.lib
└── x64
│ ├── tinyxml2.lib
│ └── tinyxml2d.lib
├── scintilla
├── .hg_archival.txt
├── .hgeol
├── .hgignore
├── .hgtags
├── CONTRIBUTING
├── License.txt
├── README
├── cocoa
│ ├── InfoBar.h
│ ├── InfoBar.mm
│ ├── InfoBarCommunicator.h
│ ├── PlatCocoa.h
│ ├── PlatCocoa.mm
│ ├── QuartzTextLayout.h
│ ├── QuartzTextStyle.h
│ ├── QuartzTextStyleAttribute.h
│ ├── Scintilla
│ │ ├── Info.plist
│ │ ├── Scintilla.xcodeproj
│ │ │ ├── project.pbxproj
│ │ │ └── project.xcworkspace
│ │ │ │ ├── contents.xcworkspacedata
│ │ │ │ └── xcshareddata
│ │ │ │ └── IDEWorkspaceChecks.plist
│ │ └── module.modulemap
│ ├── ScintillaCocoa.h
│ ├── ScintillaCocoa.mm
│ ├── ScintillaFramework
│ │ ├── Info.plist
│ │ ├── ScintillaFramework.xcodeproj
│ │ │ ├── project.pbxproj
│ │ │ ├── project.xcworkspace
│ │ │ │ ├── contents.xcworkspacedata
│ │ │ │ └── xcshareddata
│ │ │ │ │ └── IDEWorkspaceChecks.plist
│ │ │ └── xcshareddata
│ │ │ │ └── xcschemes
│ │ │ │ └── Scintilla.xcscheme
│ │ ├── en.lproj
│ │ │ └── InfoPlist.strings
│ │ └── module.modulemap
│ ├── ScintillaTest
│ │ ├── AppController.h
│ │ ├── AppController.mm
│ │ ├── Info.plist
│ │ ├── Scintilla-Info.plist
│ │ ├── ScintillaTest.xcodeproj
│ │ │ ├── project.pbxproj
│ │ │ └── project.xcworkspace
│ │ │ │ ├── contents.xcworkspacedata
│ │ │ │ └── xcshareddata
│ │ │ │ └── IDEWorkspaceChecks.plist
│ │ ├── TestData.sql
│ │ ├── en.lproj
│ │ │ ├── InfoPlist.strings
│ │ │ └── MainMenu.xib
│ │ └── main.m
│ ├── ScintillaView.h
│ ├── ScintillaView.mm
│ ├── checkbuildosx.sh
│ └── res
│ │ ├── info_bar_bg.png
│ │ ├── info_bar_bg@2x.png
│ │ ├── mac_cursor_busy.png
│ │ ├── mac_cursor_busy@2x.png
│ │ ├── mac_cursor_flipped.png
│ │ └── mac_cursor_flipped@2x.png
├── cppcheck.suppress
├── delbin.bat
├── doc
│ ├── AddSource.txt
│ ├── Design.html
│ ├── Icons.html
│ ├── Indicators.png
│ ├── Lexer.txt
│ ├── Markers.png
│ ├── Privacy.html
│ ├── SciBreak.jpg
│ ├── SciCoding.html
│ ├── SciRest.jpg
│ ├── SciTEIco.png
│ ├── SciWord.jpg
│ ├── ScintillaDoc.html
│ ├── ScintillaDownload.html
│ ├── ScintillaHistory.html
│ ├── ScintillaRelated.html
│ ├── ScintillaToDo.html
│ ├── ScintillaUsage.html
│ ├── Steps.html
│ ├── StyleMetadata.html
│ ├── annotations.png
│ ├── eolannotation.png
│ ├── index.html
│ └── styledmargin.png
├── gtk
│ ├── Converter.h
│ ├── DepGen.py
│ ├── PlatGTK.cxx
│ ├── ScintillaGTK.cxx
│ ├── ScintillaGTK.h
│ ├── ScintillaGTKAccessible.cxx
│ ├── ScintillaGTKAccessible.h
│ ├── deps.mak
│ ├── makefile
│ ├── scintilla-marshal.c
│ ├── scintilla-marshal.h
│ └── scintilla-marshal.list
├── include
│ ├── ILexer.h
│ ├── ILoader.h
│ ├── Platform.h
│ ├── SciLexer.h
│ ├── Sci_Position.h
│ ├── Scintilla.h
│ ├── Scintilla.iface
│ └── ScintillaWidget.h
├── lexers
│ ├── LexA68k.cxx
│ ├── LexAPDL.cxx
│ ├── LexASY.cxx
│ ├── LexAU3.cxx
│ ├── LexAVE.cxx
│ ├── LexAVS.cxx
│ ├── LexAbaqus.cxx
│ ├── LexAda.cxx
│ ├── LexAsm.cxx
│ ├── LexAsn1.cxx
│ ├── LexBaan.cxx
│ ├── LexBash.cxx
│ ├── LexBasic.cxx
│ ├── LexBatch.cxx
│ ├── LexBibTeX.cxx
│ ├── LexBullant.cxx
│ ├── LexCIL.cxx
│ ├── LexCLW.cxx
│ ├── LexCOBOL.cxx
│ ├── LexCPP.cxx
│ ├── LexCSS.cxx
│ ├── LexCaml.cxx
│ ├── LexCmake.cxx
│ ├── LexCoffeeScript.cxx
│ ├── LexConf.cxx
│ ├── LexCrontab.cxx
│ ├── LexCsound.cxx
│ ├── LexD.cxx
│ ├── LexDMAP.cxx
│ ├── LexDMIS.cxx
│ ├── LexDataflex.cxx
│ ├── LexDiff.cxx
│ ├── LexECL.cxx
│ ├── LexEDIFACT.cxx
│ ├── LexEScript.cxx
│ ├── LexEiffel.cxx
│ ├── LexErlang.cxx
│ ├── LexErrorList.cxx
│ ├── LexFlagship.cxx
│ ├── LexForth.cxx
│ ├── LexFortran.cxx
│ ├── LexGAP.cxx
│ ├── LexGui4Cli.cxx
│ ├── LexHTML.cxx
│ ├── LexHaskell.cxx
│ ├── LexHex.cxx
│ ├── LexHexView.cxx
│ ├── LexHollywood.cxx
│ ├── LexIndent.cxx
│ ├── LexInno.cxx
│ ├── LexJSON.cxx
│ ├── LexKVIrc.cxx
│ ├── LexKix.cxx
│ ├── LexLaTeX.cxx
│ ├── LexLisp.cxx
│ ├── LexLout.cxx
│ ├── LexLua.cxx
│ ├── LexMMIXAL.cxx
│ ├── LexMPT.cxx
│ ├── LexMSSQL.cxx
│ ├── LexMagik.cxx
│ ├── LexMake.cxx
│ ├── LexMarkdown.cxx
│ ├── LexMatlab.cxx
│ ├── LexMaxima.cxx
│ ├── LexMetapost.cxx
│ ├── LexModula.cxx
│ ├── LexMySQL.cxx
│ ├── LexNim.cxx
│ ├── LexNimrod.cxx
│ ├── LexNsis.cxx
│ ├── LexNull.cxx
│ ├── LexOScript.cxx
│ ├── LexOpal.cxx
│ ├── LexPB.cxx
│ ├── LexPLM.cxx
│ ├── LexPO.cxx
│ ├── LexPOV.cxx
│ ├── LexPS.cxx
│ ├── LexPascal.cxx
│ ├── LexPerl.cxx
│ ├── LexPowerPro.cxx
│ ├── LexPowerShell.cxx
│ ├── LexProgress.cxx
│ ├── LexProps.cxx
│ ├── LexPython.cxx
│ ├── LexR.cxx
│ ├── LexRaku.cxx
│ ├── LexRebol.cxx
│ ├── LexRegistry.cxx
│ ├── LexRuby.cxx
│ ├── LexRust.cxx
│ ├── LexSAS.cxx
│ ├── LexSML.cxx
│ ├── LexSQL.cxx
│ ├── LexSTTXT.cxx
│ ├── LexScriptol.cxx
│ ├── LexSmalltalk.cxx
│ ├── LexSorcus.cxx
│ ├── LexSpecman.cxx
│ ├── LexSpice.cxx
│ ├── LexStata.cxx
│ ├── LexTACL.cxx
│ ├── LexTADS3.cxx
│ ├── LexTAL.cxx
│ ├── LexTCL.cxx
│ ├── LexTCMD.cxx
│ ├── LexTeX.cxx
│ ├── LexTxt2tags.cxx
│ ├── LexVB.cxx
│ ├── LexVHDL.cxx
│ ├── LexVerilog.cxx
│ ├── LexVisualProlog.cxx
│ ├── LexX12.cxx
│ └── LexYAML.cxx
├── lexilla
│ ├── scripts
│ │ ├── LexillaGen.py
│ │ ├── RunTest.bat
│ │ └── RunTest.sh
│ ├── src
│ │ ├── DepGen.py
│ │ ├── Lexilla.cxx
│ │ ├── Lexilla.def
│ │ ├── Lexilla.h
│ │ ├── Lexilla.vcxproj
│ │ ├── Lexilla
│ │ │ ├── Info.plist
│ │ │ └── Lexilla.xcodeproj
│ │ │ │ ├── project.pbxproj
│ │ │ │ └── project.xcworkspace
│ │ │ │ ├── contents.xcworkspacedata
│ │ │ │ └── xcshareddata
│ │ │ │ └── IDEWorkspaceChecks.plist
│ │ ├── LexillaVersion.rc
│ │ ├── README
│ │ ├── deps.mak
│ │ ├── lexilla.mak
│ │ ├── makefile
│ │ └── nmdeps.mak
│ ├── test
│ │ ├── LexillaAccess.cxx
│ │ ├── LexillaAccess.h
│ │ ├── README
│ │ ├── TestDocument.cxx
│ │ ├── TestDocument.h
│ │ ├── TestLexers.cxx
│ │ ├── TestLexers.vcxproj
│ │ ├── examples
│ │ │ ├── batch
│ │ │ │ ├── SciTE.properties
│ │ │ │ ├── x.bat
│ │ │ │ └── x.bat.styled
│ │ │ ├── cpp
│ │ │ │ ├── SciTE.properties
│ │ │ │ ├── x.cxx
│ │ │ │ └── x.cxx.styled
│ │ │ ├── d
│ │ │ │ ├── SciTE.properties
│ │ │ │ ├── x.d
│ │ │ │ └── x.d.styled
│ │ │ ├── errorlist
│ │ │ │ ├── AllStyles.err
│ │ │ │ ├── AllStyles.err.styled
│ │ │ │ └── SciTE.properties
│ │ │ ├── hypertext
│ │ │ │ ├── SciTE.properties
│ │ │ │ ├── apostophe.php
│ │ │ │ ├── apostophe.php.styled
│ │ │ │ ├── x.asp
│ │ │ │ ├── x.asp.styled
│ │ │ │ ├── x.html
│ │ │ │ ├── x.html.styled
│ │ │ │ ├── x.php
│ │ │ │ └── x.php.styled
│ │ │ ├── latex
│ │ │ │ ├── AllStyles.tex
│ │ │ │ ├── AllStyles.tex.styled
│ │ │ │ ├── Feature1358.tex
│ │ │ │ ├── Feature1358.tex.styled
│ │ │ │ └── SciTE.properties
│ │ │ ├── lua
│ │ │ │ ├── SciTE.properties
│ │ │ │ ├── x.lua
│ │ │ │ └── x.lua.styled
│ │ │ ├── makefile
│ │ │ │ ├── SciTE.properties
│ │ │ │ ├── x.mak
│ │ │ │ └── x.mak.styled
│ │ │ ├── mmixal
│ │ │ │ ├── AllStyles.mms
│ │ │ │ ├── AllStyles.mms.styled
│ │ │ │ ├── SciTE.properties
│ │ │ │ ├── references.mms
│ │ │ │ ├── references.mms.styled
│ │ │ │ ├── x.mms
│ │ │ │ └── x.mms.styled
│ │ │ ├── nim
│ │ │ │ ├── SciTE.properties
│ │ │ │ ├── x.nim
│ │ │ │ └── x.nim.styled
│ │ │ ├── perl
│ │ │ │ ├── SciTE.properties
│ │ │ │ ├── perl-test-5220delta.pl
│ │ │ │ ├── perl-test-5220delta.pl.styled
│ │ │ │ ├── perl-test-sub-prototypes.pl
│ │ │ │ ├── perl-test-sub-prototypes.pl.styled
│ │ │ │ ├── x.pl
│ │ │ │ └── x.pl.styled
│ │ │ ├── python
│ │ │ │ ├── AllStyles.py
│ │ │ │ ├── AllStyles.py.styled
│ │ │ │ ├── SciTE.properties
│ │ │ │ ├── x.py
│ │ │ │ └── x.py.styled
│ │ │ ├── raku
│ │ │ │ ├── SciTE.properties
│ │ │ │ ├── x.p6
│ │ │ │ └── x.p6.styled
│ │ │ ├── ruby
│ │ │ │ ├── SciTE.properties
│ │ │ │ ├── x.rb
│ │ │ │ └── x.rb.styled
│ │ │ ├── tcl
│ │ │ │ ├── SciTE.properties
│ │ │ │ ├── x.tcl
│ │ │ │ └── x.tcl.styled
│ │ │ └── vb
│ │ │ │ ├── SciTE.properties
│ │ │ │ ├── x.vb
│ │ │ │ └── x.vb.styled
│ │ ├── makefile
│ │ └── testlexers.mak
│ └── version.txt
├── lexlib
│ ├── Accessor.cxx
│ ├── Accessor.h
│ ├── CatalogueModules.h
│ ├── CharacterCategory.cxx
│ ├── CharacterCategory.h
│ ├── CharacterSet.cxx
│ ├── CharacterSet.h
│ ├── DefaultLexer.cxx
│ ├── DefaultLexer.h
│ ├── LexAccessor.h
│ ├── LexerBase.cxx
│ ├── LexerBase.h
│ ├── LexerModule.cxx
│ ├── LexerModule.h
│ ├── LexerNoExceptions.cxx
│ ├── LexerNoExceptions.h
│ ├── LexerSimple.cxx
│ ├── LexerSimple.h
│ ├── OptionSet.h
│ ├── PropSetSimple.cxx
│ ├── PropSetSimple.h
│ ├── SparseState.h
│ ├── StringCopy.h
│ ├── StyleContext.cxx
│ ├── StyleContext.h
│ ├── SubStyles.h
│ ├── WordList.cxx
│ └── WordList.h
├── qt
│ ├── README
│ ├── ScintillaEdit
│ │ ├── ScintillaDocument.cpp
│ │ ├── ScintillaDocument.h
│ │ ├── ScintillaEdit.cpp.template
│ │ ├── ScintillaEdit.h.template
│ │ ├── ScintillaEdit.pro
│ │ └── WidgetGen.py
│ ├── ScintillaEditBase
│ │ ├── Notes.txt
│ │ ├── PlatQt.cpp
│ │ ├── PlatQt.h
│ │ ├── ScintillaEditBase.cpp
│ │ ├── ScintillaEditBase.h
│ │ ├── ScintillaEditBase.pro
│ │ ├── ScintillaQt.cpp
│ │ └── ScintillaQt.h
│ └── ScintillaEditPy
│ │ ├── README
│ │ ├── ScintillaConstants.py.template
│ │ ├── ScintillaEditPy.pro
│ │ ├── global.h
│ │ ├── sepbuild.py
│ │ ├── testsepq.py
│ │ └── typesystem_ScintillaEdit.xml.template
├── scripts
│ ├── CheckMentioned.py
│ ├── Dependencies.py
│ ├── Face.py
│ ├── FileGenerator.py
│ ├── GenerateCaseConvert.py
│ ├── GenerateCharacterCategory.py
│ ├── HFacer.py
│ ├── HeaderCheck.py
│ ├── HeaderOrder.txt
│ ├── LexGen.py
│ ├── ScintillaData.py
│ ├── __init__.py
│ └── archive.sh
├── src
│ ├── AutoComplete.cxx
│ ├── AutoComplete.h
│ ├── CallTip.cxx
│ ├── CallTip.h
│ ├── CaseConvert.cxx
│ ├── CaseConvert.h
│ ├── CaseFolder.cxx
│ ├── CaseFolder.h
│ ├── Catalogue.cxx
│ ├── Catalogue.h
│ ├── CellBuffer.cxx
│ ├── CellBuffer.h
│ ├── CharClassify.cxx
│ ├── CharClassify.h
│ ├── ContractionState.cxx
│ ├── ContractionState.h
│ ├── DBCS.cxx
│ ├── DBCS.h
│ ├── Decoration.cxx
│ ├── Decoration.h
│ ├── Document.cxx
│ ├── Document.h
│ ├── EditModel.cxx
│ ├── EditModel.h
│ ├── EditView.cxx
│ ├── EditView.h
│ ├── Editor.cxx
│ ├── Editor.h
│ ├── ElapsedPeriod.h
│ ├── ExternalLexer.cxx
│ ├── ExternalLexer.h
│ ├── FontQuality.h
│ ├── Indicator.cxx
│ ├── Indicator.h
│ ├── IntegerRectangle.h
│ ├── KeyMap.cxx
│ ├── KeyMap.h
│ ├── LineMarker.cxx
│ ├── LineMarker.h
│ ├── MarginView.cxx
│ ├── MarginView.h
│ ├── Partitioning.h
│ ├── PerLine.cxx
│ ├── PerLine.h
│ ├── Position.h
│ ├── PositionCache.cxx
│ ├── PositionCache.h
│ ├── RESearch.cxx
│ ├── RESearch.h
│ ├── RunStyles.cxx
│ ├── RunStyles.h
│ ├── SciTE.properties
│ ├── ScintillaBase.cxx
│ ├── ScintillaBase.h
│ ├── Selection.cxx
│ ├── Selection.h
│ ├── SparseVector.h
│ ├── SplitVector.h
│ ├── Style.cxx
│ ├── Style.h
│ ├── UniConversion.cxx
│ ├── UniConversion.h
│ ├── UniqueString.cxx
│ ├── UniqueString.h
│ ├── ViewStyle.cxx
│ ├── ViewStyle.h
│ ├── XPM.cxx
│ └── XPM.h
├── test
│ ├── MessageNumbers.py
│ ├── README
│ ├── ScintillaCallable.py
│ ├── XiteMenu.py
│ ├── XiteQt.py
│ ├── XiteWin.py
│ ├── examples
│ │ ├── perl-test-5220delta.pl
│ │ ├── perl-test-5220delta.pl.styled
│ │ ├── perl-test-sub-prototypes.pl
│ │ ├── perl-test-sub-prototypes.pl.styled
│ │ ├── x.asp
│ │ ├── x.asp.styled
│ │ ├── x.cxx
│ │ ├── x.cxx.styled
│ │ ├── x.d
│ │ ├── x.d.styled
│ │ ├── x.html
│ │ ├── x.html.styled
│ │ ├── x.lua
│ │ ├── x.lua.styled
│ │ ├── x.nim
│ │ ├── x.nim.styled
│ │ ├── x.php
│ │ ├── x.php.styled
│ │ ├── x.pl
│ │ ├── x.pl.styled
│ │ ├── x.py
│ │ ├── x.py.styled
│ │ ├── x.rb
│ │ ├── x.rb.styled
│ │ ├── x.tcl
│ │ ├── x.tcl.styled
│ │ ├── x.vb
│ │ └── x.vb.styled
│ ├── gi
│ │ ├── Scintilla-0.1.gir.good
│ │ ├── filter-scintilla-h.py
│ │ ├── gi-test.py
│ │ └── makefile
│ ├── lexTests.py
│ ├── performanceTests.py
│ ├── simpleTests.py
│ ├── unit
│ │ ├── LICENSE_1_0.txt
│ │ ├── README
│ │ ├── Sci.natvis
│ │ ├── SciTE.properties
│ │ ├── UnitTester.cxx
│ │ ├── UnitTester.vcxproj
│ │ ├── catch.hpp
│ │ ├── makefile
│ │ ├── test.mak
│ │ ├── testCellBuffer.cxx
│ │ ├── testCharClassify.cxx
│ │ ├── testContractionState.cxx
│ │ ├── testDecoration.cxx
│ │ ├── testPartitioning.cxx
│ │ ├── testPerLine.cxx
│ │ ├── testRunStyles.cxx
│ │ ├── testSparseState.cxx
│ │ ├── testSparseVector.cxx
│ │ ├── testSplitVector.cxx
│ │ ├── testUniConversion.cxx
│ │ ├── testWordList.cxx
│ │ └── unitTest.cxx
│ ├── win32Tests.py
│ └── xite.py
├── tgzsrc
├── version.txt
├── win32
│ ├── DepGen.py
│ ├── HanjaDic.cxx
│ ├── HanjaDic.h
│ ├── PlatWin.cxx
│ ├── PlatWin.h
│ ├── SciLexer.vcxproj
│ ├── SciLexer.vcxproj.filters
│ ├── SciTE.properties
│ ├── ScintRes.rc
│ ├── Scintilla.def
│ ├── Scintilla.vcxproj
│ ├── ScintillaDLL.cxx
│ ├── ScintillaWin.cxx
│ ├── ScintillaWin.h
│ ├── deps.mak
│ ├── makefile
│ ├── nmdeps.mak
│ └── scintilla.mak
└── zipsrc.bat
└── version.info
/README.md:
--------------------------------------------------------------------------------
1 | # SimpleNotePad
2 |
3 |
4 | ## 简介
5 |
6 | 这是一个可以代替Windows记事本的软件,除了包含记事本原有的功能外,还支持各种编程语言的语法高亮,还有编码格式转换、十六进制查看编辑、文件二进制比较、编码批量转换的功能。
7 |
8 | 
9 |
10 | ## 主要特性
11 |
12 | * 支持各种编程语言的语法高亮
13 | * 支持ANSI、UTF8、UTF16及多种编码字符集之间的自由切换和转换
14 | * 编码格式自动识别
15 | * 代码折叠
16 | * 剪贴板历史记录
17 | * 增强的查找和替换
18 | * 标记所有匹配
19 | * 自动标记所有选中标识符
20 | * 添加/删除注释
21 | * 大小写转换
22 | * 十六进制查看功能
23 | * 文件二进制比较功能
24 | * 文本编码转换和文件编码批量转换功能
25 |
26 | ## 下载链接
27 |
28 | 请[点击此处](https://github.com/zhongyang219/SimpleNotePad/releases/latest)下载SimpleNotePad的最新版本。
29 |
30 |
--------------------------------------------------------------------------------
/SimpleNotePad/AboutDlg.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | //#include "DonateDlg.h"
3 | //#include "LinkStatic.h"
4 |
5 | // 用于应用程序“关于”菜单项的 CAboutDlg 对话框
6 |
7 | class CAboutDlg : public CDialog
8 | {
9 | public:
10 | CAboutDlg();
11 |
12 | // 对话框数据
13 | #ifdef AFX_DESIGN_TIME
14 | enum { IDD = IDD_ABOUTBOX };
15 | #endif
16 |
17 | protected:
18 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持
19 |
20 | // 实现
21 | protected:
22 | DECLARE_MESSAGE_MAP()
23 | public:
24 | afx_msg void OnNMClickStaticMail(NMHDR* pNMHDR, LRESULT* pResult);
25 | afx_msg void OnNMClickStaticCheckForUpdate(NMHDR* pNMHDR, LRESULT* pResult);
26 | afx_msg void OnNMClickStaticGithub(NMHDR* pNMHDR, LRESULT* pResult);
27 | afx_msg void OnNMClickStaticGitee(NMHDR* pNMHDR, LRESULT* pResult);
28 | virtual BOOL OnInitDialog();
29 | afx_msg void OnNMClickStaticDonate(NMHDR* pNMHDR, LRESULT* pResult);
30 | };
31 |
--------------------------------------------------------------------------------
/SimpleNotePad/BaseDialog.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 |
4 | // CBaseDialog 对话框
5 | //用于实现记住对话框大小
6 | //将窗口初始大小设置为最小大小
7 |
8 | class CBaseDialog : public CDialog
9 | {
10 | DECLARE_DYNAMIC(CBaseDialog)
11 |
12 | public:
13 | CBaseDialog(UINT nIDTemplate, CWnd* pParent = NULL); // 标准构造函数
14 | virtual ~CBaseDialog();
15 |
16 | // 对话框数据
17 | //#ifdef AFX_DESIGN_TIME
18 | // enum { IDD = IDD_BASEDIALOG };
19 | //#endif
20 |
21 | void SetMinSize(int cx, int cy); //设置窗口的最小大小,如果未设置,则使用窗口的初始大小作为最小大小
22 |
23 | protected:
24 | virtual void LoadConfig();
25 | virtual void SaveConfig() const;
26 |
27 | protected:
28 | CSize m_min_size{};
29 | CSize m_window_size{ -1, -1 };
30 |
31 | protected:
32 | virtual CString GetDialogName() const = 0;
33 | void SetButtonIcon(UINT id, HICON icon);
34 | void EnableDlgCtrl(UINT id, bool enable);
35 | void ShowDlgCtrl(UINT id, bool show);
36 |
37 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持
38 |
39 | DECLARE_MESSAGE_MAP()
40 | public:
41 | virtual BOOL OnInitDialog();
42 | afx_msg void OnDestroy();
43 | afx_msg void OnGetMinMaxInfo(MINMAXINFO* lpMMI);
44 | afx_msg void OnSize(UINT nType, int cx, int cy);
45 | };
46 |
--------------------------------------------------------------------------------
/SimpleNotePad/CVariant.cpp:
--------------------------------------------------------------------------------
1 | #include "stdafx.h"
2 | #include "CVariant.h"
3 |
4 |
5 | CVariant::CVariant(int value)
6 | {
7 | m_value_int = value;
8 | m_type = eType::INT;
9 | }
10 |
11 | CVariant::CVariant(size_t value)
12 | {
13 | m_value_int = static_cast(value);
14 | m_type = eType::UINT;
15 | }
16 |
17 | CVariant::CVariant(double value)
18 | {
19 | m_value_double = value;
20 | m_type = eType::DOUBLE;
21 | }
22 |
23 | CVariant::CVariant(LPCTSTR value)
24 | {
25 | m_value_string = value;
26 | m_type = eType::STRING;
27 | }
28 |
29 | CVariant::CVariant(const CString& value)
30 | {
31 | m_value_string = value;
32 | m_type = eType::STRING;
33 | }
34 |
35 | CVariant::CVariant(const wstring & value)
36 | {
37 | m_value_string = value.c_str();
38 | m_type = eType::STRING;
39 | }
40 |
41 | CVariant::~CVariant()
42 | {
43 | }
44 |
45 | CString CVariant::ToString() const
46 | {
47 | CString str;
48 | switch (m_type)
49 | {
50 | case CVariant::eType::INT:
51 | str.Format(_T("%d"), m_value_int);
52 | break;
53 | case eType::UINT:
54 | str.Format(_T("%u"), static_cast(m_value_int));
55 | break;
56 | case CVariant::eType::DOUBLE:
57 | str.Format(_T("%g"), m_value_double);
58 | break;
59 | case CVariant::eType::STRING:
60 | str = m_value_string;
61 | break;
62 | default:
63 | break;
64 | }
65 | return str;
66 | }
67 |
--------------------------------------------------------------------------------
/SimpleNotePad/CVariant.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | class CVariant
3 | {
4 | public:
5 | CVariant(int value);
6 | CVariant(size_t value);
7 | CVariant(double value);
8 | CVariant(LPCTSTR value);
9 | CVariant(const CString& value);
10 | CVariant(const wstring& value);
11 |
12 | ~CVariant();
13 |
14 | CString ToString() const;
15 |
16 | private:
17 | enum class eType { INT, UINT, DOUBLE, STRING };
18 |
19 | int m_value_int;
20 | double m_value_double;
21 | CString m_value_string;
22 | eType m_type;
23 |
24 | };
25 |
26 |
--------------------------------------------------------------------------------
/SimpleNotePad/CodeConvertDlg.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "BaseDialog.h"
3 |
4 |
5 | // CCodeConvertDlg 对话框
6 |
7 | class CCodeConvertDlg : public CBaseDialog
8 | {
9 | DECLARE_DYNAMIC(CCodeConvertDlg)
10 |
11 | public:
12 | CCodeConvertDlg(CWnd* pParent = nullptr); // 标准构造函数
13 | virtual ~CCodeConvertDlg();
14 |
15 | // 对话框数据
16 | #ifdef AFX_DESIGN_TIME
17 | enum { IDD = IDD_CODE_CONVERT_DIALOG };
18 | #endif
19 |
20 | protected:
21 | void InitComboBox(CComboBox& combo_box);
22 |
23 | virtual CString GetDialogName() const override;
24 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持
25 |
26 | DECLARE_MESSAGE_MAP()
27 | public:
28 | virtual BOOL OnInitDialog();
29 | CComboBox m_input_combo;
30 | CComboBox m_output_combo;
31 | afx_msg void OnBnClickedButton1();
32 | };
33 |
--------------------------------------------------------------------------------
/SimpleNotePad/ColorStatic.cpp:
--------------------------------------------------------------------------------
1 | // ColorStatic.cpp : 实现文件
2 | //
3 |
4 | #include "stdafx.h"
5 | #include "ColorStatic.h"
6 |
7 |
8 | // CColorStatic
9 |
10 | IMPLEMENT_DYNAMIC(CColorStatic, CStatic)
11 |
12 | CColorStatic::CColorStatic()
13 | {
14 |
15 | }
16 |
17 | CColorStatic::~CColorStatic()
18 | {
19 | }
20 |
21 | void CColorStatic::SetFillColor(COLORREF fill_color)
22 | {
23 | m_fill_color = fill_color;
24 | Invalidate();
25 | }
26 |
27 |
28 | void CColorStatic::EnableWindow(bool enable)
29 | {
30 | CStatic::EnableWindow(enable);
31 | Invalidate(FALSE);
32 | }
33 |
34 | BEGIN_MESSAGE_MAP(CColorStatic, CStatic)
35 | ON_WM_PAINT()
36 | END_MESSAGE_MAP()
37 |
38 |
39 |
40 | // CColorStatic 消息处理程序
41 |
42 |
43 |
44 |
45 | void CColorStatic::OnPaint()
46 | {
47 | CPaintDC dc(this); // device context for painting
48 | // TODO: 在此处添加消息处理程序代码
49 | // 不为绘图消息调用 CStatic::OnPaint()
50 | CRect rect;
51 | GetClientRect(rect);
52 | if (IsWindowEnabled())
53 | {
54 | dc.FillSolidRect(rect, m_fill_color);
55 | }
56 | else
57 | {
58 | CBrush brush(HS_BDIAGONAL, RGB(190, 190, 190));
59 | dc.FillRect(rect, &brush);
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/SimpleNotePad/ColorStatic.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 |
4 | // CColorStatic
5 |
6 | class CColorStatic : public CStatic
7 | {
8 | DECLARE_DYNAMIC(CColorStatic)
9 |
10 | public:
11 | CColorStatic();
12 | virtual ~CColorStatic();
13 |
14 | void SetFillColor(COLORREF fill_color); //设置要填充的背景色
15 | void EnableWindow(bool enable);
16 |
17 | protected:
18 | COLORREF m_fill_color{ RGB(255, 255,255) };
19 |
20 | protected:
21 | DECLARE_MESSAGE_MAP()
22 | public:
23 | afx_msg void OnPaint();
24 | };
25 |
--------------------------------------------------------------------------------
/SimpleNotePad/ColorStaticEx.cpp:
--------------------------------------------------------------------------------
1 | #include "stdafx.h"
2 | #include "ColorStaticEx.h"
3 | #include "CommonData.h"
4 |
5 | CColorStaticEx::CColorStaticEx()
6 | {
7 | }
8 |
9 |
10 | CColorStaticEx::~CColorStaticEx()
11 | {
12 | }
13 |
14 |
15 | COLORREF CColorStaticEx::GetFillColor() const
16 | {
17 | return m_fill_color;
18 | }
19 |
20 | void CColorStaticEx::PreSubclassWindow()
21 | {
22 | // TODO: 在此添加专用代码和/或调用基类
23 | DWORD dwStyle = GetStyle();
24 | ::SetWindowLong(GetSafeHwnd(), GWL_STYLE, dwStyle | SS_NOTIFY);
25 |
26 | CColorStatic::PreSubclassWindow();
27 | }
28 | BEGIN_MESSAGE_MAP(CColorStaticEx, CColorStatic)
29 | // ON_CONTROL_REFLECT(STN_CLICKED, &CColorStaticEx::OnStnClicked)
30 | ON_WM_LBUTTONUP()
31 | END_MESSAGE_MAP()
32 |
33 |
34 | //void CColorStaticEx::OnStnClicked()
35 | //{
36 | // // TODO: 在此添加控件通知处理程序代码
37 | //}
38 |
39 |
40 | void CColorStaticEx::OnLButtonUp(UINT nFlags, CPoint point)
41 | {
42 | // TODO: 在此添加消息处理程序代码和/或调用默认值
43 | CColorDialog color_dlg(m_fill_color);
44 | if (color_dlg.DoModal() == IDOK)
45 | {
46 | SetFillColor(color_dlg.GetColor());
47 |
48 | //向父窗口发送WM_COLOR_SELECTED消息
49 | CWnd* pParent = GetParent();
50 | if(pParent!=nullptr)
51 | ::SendMessage(pParent->GetSafeHwnd(), WM_COLOR_SELECTED, (WPARAM)this, (LPARAM)m_fill_color);
52 | }
53 |
54 | CColorStatic::OnLButtonUp(nFlags, point);
55 | }
56 |
--------------------------------------------------------------------------------
/SimpleNotePad/ColorStaticEx.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "ColorStatic.h"
3 | class CColorStaticEx :
4 | public CColorStatic
5 | {
6 | public:
7 | CColorStaticEx();
8 | ~CColorStaticEx();
9 | COLORREF GetFillColor() const;
10 |
11 | virtual void PreSubclassWindow();
12 | DECLARE_MESSAGE_MAP()
13 | // afx_msg void OnStnClicked();
14 | afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
15 | };
16 |
17 |
--------------------------------------------------------------------------------
/SimpleNotePad/DeleteDataDlg.cpp:
--------------------------------------------------------------------------------
1 | // DeleteDataDlg.cpp: 实现文件
2 | //
3 |
4 | #include "stdafx.h"
5 | #include "SimpleNotePad.h"
6 | #include "DeleteDataDlg.h"
7 | #include "afxdialogex.h"
8 |
9 |
10 | // CDeleteDataDlg 对话框
11 |
12 | IMPLEMENT_DYNAMIC(CDeleteDataDlg, CDialog)
13 |
14 | CDeleteDataDlg::CDeleteDataDlg(CWnd* pParent /*=nullptr*/)
15 | : CDialog(IDD_DELETE_DATA_DIALOG, pParent)
16 | {
17 |
18 | }
19 |
20 | CDeleteDataDlg::~CDeleteDataDlg()
21 | {
22 | }
23 |
24 | void CDeleteDataDlg::DoDataExchange(CDataExchange* pDX)
25 | {
26 | CDialog::DoDataExchange(pDX);
27 | }
28 |
29 |
30 | BEGIN_MESSAGE_MAP(CDeleteDataDlg, CDialog)
31 | END_MESSAGE_MAP()
32 |
33 |
34 | // CDeleteDataDlg 消息处理程序
35 |
36 |
37 | void CDeleteDataDlg::OnOK()
38 | {
39 | // TODO: 在此添加专用代码和/或调用基类
40 | CString strTmp;
41 | GetDlgItemText(IDC_DELETE_ADDR_EDIT, strTmp);
42 | m_address = wcstoul(strTmp, nullptr, 16);
43 |
44 | GetDlgItemText(IDC_DELETE_SIZE_EDIT, strTmp);
45 | m_size = _ttoi(strTmp);
46 |
47 | CDialog::OnOK();
48 | }
49 |
--------------------------------------------------------------------------------
/SimpleNotePad/DeleteDataDlg.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 |
4 | // CDeleteDataDlg 对话框
5 |
6 | class CDeleteDataDlg : public CDialog
7 | {
8 | DECLARE_DYNAMIC(CDeleteDataDlg)
9 |
10 | public:
11 | CDeleteDataDlg(CWnd* pParent = nullptr); // 标准构造函数
12 | virtual ~CDeleteDataDlg();
13 |
14 | unsigned int GetDeleteAddress() const { return m_address; }
15 | unsigned int GetDeleteSize() const { return m_size; }
16 |
17 | // 对话框数据
18 | #ifdef AFX_DESIGN_TIME
19 | enum { IDD = IDD_DELETE_DATA_DIALOG };
20 | #endif
21 |
22 | private:
23 | unsigned int m_address;
24 | unsigned int m_size;
25 |
26 | protected:
27 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持
28 |
29 | DECLARE_MESSAGE_MAP()
30 | virtual void OnOK();
31 | };
32 |
--------------------------------------------------------------------------------
/SimpleNotePad/DonateDlg.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 |
4 | // CDonateDlg 对话框
5 |
6 | class CDonateDlg : public CDialog
7 | {
8 | DECLARE_DYNAMIC(CDonateDlg)
9 |
10 | public:
11 | CDonateDlg(CWnd* pParent = nullptr); // 标准构造函数
12 | virtual ~CDonateDlg();
13 |
14 | // 对话框数据
15 | #ifdef AFX_DESIGN_TIME
16 | enum { IDD = IDD_DONATE_DIALOG };
17 | #endif
18 |
19 | private:
20 | CRect m_pic1_rect;
21 | CRect m_pic2_rect;
22 | CBitmap m_pic1;
23 | CBitmap m_pic2;
24 |
25 | protected:
26 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持
27 |
28 | DECLARE_MESSAGE_MAP()
29 | public:
30 | virtual BOOL OnInitDialog();
31 | afx_msg void OnPaint();
32 | };
33 |
--------------------------------------------------------------------------------
/SimpleNotePad/EditEx.cpp:
--------------------------------------------------------------------------------
1 | // EditEx.cpp : 实现文件
2 | //
3 |
4 | #include "stdafx.h"
5 | #include "EditEx.h"
6 |
7 |
8 | // CEditEx
9 |
10 | IMPLEMENT_DYNAMIC(CEditEx, CEdit)
11 |
12 | CEditEx::CEditEx()
13 | {
14 |
15 | }
16 |
17 | CEditEx::~CEditEx()
18 | {
19 | }
20 |
21 |
22 | BEGIN_MESSAGE_MAP(CEditEx, CEdit)
23 | ON_WM_LBUTTONDBLCLK()
24 | END_MESSAGE_MAP()
25 |
26 |
27 |
28 | // CEditEx 消息处理程序
29 |
30 |
31 |
32 |
33 | BOOL CEditEx::PreTranslateMessage(MSG* pMsg)
34 | {
35 | // TODO: 在此添加专用代码和/或调用基类
36 | //按Ctrl+A全选
37 | if ((GetKeyState(VK_CONTROL) & 0x80) && (pMsg->wParam == 'A'))
38 | {
39 | SetSel(0, -1);
40 | return TRUE;
41 | }
42 | return CEdit::PreTranslateMessage(pMsg);
43 | }
44 |
45 |
46 | void CEditEx::OnLButtonDblClk(UINT nFlags, CPoint point)
47 | {
48 | // TODO: 在此添加消息处理程序代码和/或调用默认值
49 | CString edit_str;
50 | GetWindowText(edit_str);
51 | int length{ edit_str.GetLength() };
52 | int cursor_pos; //光标位置
53 | int not_used;
54 | GetSel(cursor_pos, not_used); //获取当前光标的位置,由于双击时不可能选中任何文本,所以此函数的两个参数的值必定一样
55 | int start_pos{ cursor_pos }; //选择的起始位置
56 | int end_pos{ cursor_pos }; //选择的结束位置
57 | while (start_pos >= 0 && CCommon::IsValidNameChar(edit_str[start_pos]))
58 | {
59 | start_pos--;
60 | }
61 | while (end_pos < length && CCommon::IsValidNameChar(edit_str[end_pos]))
62 | {
63 | end_pos++;
64 | }
65 | SetSel(start_pos + 1, end_pos);
66 | //CEdit::OnLButtonDblClk(nFlags, point);
67 | }
68 |
--------------------------------------------------------------------------------
/SimpleNotePad/EditEx.h:
--------------------------------------------------------------------------------
1 | //CEdit的派生类
2 | #pragma once
3 | #include "Common.h"
4 |
5 | // CEditEx
6 |
7 | class CEditEx : public CEdit
8 | {
9 | DECLARE_DYNAMIC(CEditEx)
10 |
11 | public:
12 | CEditEx();
13 | virtual ~CEditEx();
14 |
15 | protected:
16 | DECLARE_MESSAGE_MAP()
17 | virtual BOOL PreTranslateMessage(MSG* pMsg);
18 | public:
19 | afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
20 | };
21 |
22 |
23 |
--------------------------------------------------------------------------------
/SimpleNotePad/EditSettingsDlg.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "TabDlg.h"
3 | #include "CommonData.h"
4 | #include "ColorStaticEx.h"
5 | #include "SpinEdit.h"
6 |
7 | // CEditSettingsDlg 对话框
8 |
9 | class CEditSettingsDlg : public CTabDlg
10 | {
11 | DECLARE_DYNAMIC(CEditSettingsDlg)
12 |
13 | public:
14 | CEditSettingsDlg(CWnd* pParent = nullptr); // 标准构造函数
15 | virtual ~CEditSettingsDlg();
16 |
17 | // 对话框数据
18 | #ifdef AFX_DESIGN_TIME
19 | enum { IDD = IDD_EDIT_SETTINGS_DIALOG };
20 | #endif
21 |
22 | public:
23 | EditSettingData m_data;
24 |
25 | private:
26 | CColorStaticEx m_background_color_static;
27 | CSpinEdit m_font_size_edit;
28 | CColorStaticEx m_highlight_color_static;
29 | CColorStaticEx m_selection_back_color_static;
30 | CSpinEdit m_tab_width_edit;
31 |
32 | protected:
33 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持
34 | void EnableControl();
35 |
36 | DECLARE_MESSAGE_MAP()
37 | public:
38 | virtual BOOL OnInitDialog();
39 | virtual void OnOK();
40 | protected:
41 | afx_msg LRESULT OnColorSelected(WPARAM wParam, LPARAM lParam);
42 | public:
43 | afx_msg void OnBnClickedChooseFontButton();
44 | afx_msg void OnBnClickedHexSetFontButton();
45 | afx_msg void OnBnClickedCurrentLineHighlightCheck();
46 | };
47 |
--------------------------------------------------------------------------------
/SimpleNotePad/EditorHelper.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "ScintillaEditView.h"
3 | #include "SyntaxHighlight.h"
4 |
5 | class CEditorHelper
6 | {
7 | public:
8 | CEditorHelper(CScintillaEditView* edit_view)
9 | : m_view(edit_view)
10 | {}
11 |
12 | //标记匹配的括号
13 | void MarkMatchedBrackets();
14 |
15 | //括号自动完成
16 | // left_bracket: 输入的左括号
17 | void BracketsAutoComp(char left_bracket);
18 |
19 | //删除左括号时自动删除括号对
20 | // ch: 删除的左括号
21 | void BracketsAutoDelete(char ch);
22 |
23 | //自动添加或删除注释
24 | void AddOrRemoveComment(const CLanguage::Comment& comment);
25 |
26 | //HTML标记自动完成
27 | // character_input: 最后输入的字符
28 | void HtmlMarkAutoComp(char character_input);
29 |
30 | //标记匹配的HTML标签
31 | void MarkMatchedHtmlMarks();
32 |
33 | //自动显示代码完成列表
34 | void AutoShowCompList(const CLanguage& languange);
35 |
36 | private:
37 | string GetMatchedCompList(const CLanguage& languange, const std::string& str);
38 |
39 | private:
40 | CScintillaEditView* m_view{};
41 | };
42 |
--------------------------------------------------------------------------------
/SimpleNotePad/FilePathHelper.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | class CFilePathHelper
3 | {
4 | public:
5 | CFilePathHelper(const wstring& file_path);
6 | CFilePathHelper(){}
7 | ~CFilePathHelper();
8 |
9 | void SetFilePath(const wstring& file_path) { m_file_path = file_path; }
10 |
11 | wstring GetFileExtension(bool upper = false, bool width_dot = false) const; //获取文件的扩展名(upper:是否大写; width_dot:是否包含“.”)
12 | wstring GetFileName() const; //获取文件名
13 | wstring GetFileNameWithoutExtension() const; //获取文件名(不含扩展名)
14 | wstring GetFolderName() const; //获取文件夹名
15 | wstring GetDir() const; //获取目录
16 | wstring GetParentDir() const; //获取上级目录
17 | wstring GetFilePath() const { return m_file_path; } //获取完整路径
18 | const wstring& ReplaceFileExtension(const wchar_t* new_extension); //替换文件的扩展名,返回文件完整路径
19 | wstring GetFilePathWithoutExtension() const; //获取文件路径(不含扩展名)
20 | protected:
21 | wstring m_file_path;
22 | };
23 |
24 |
--------------------------------------------------------------------------------
/SimpleNotePad/FileRelateDlg.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "TabDlg.h"
3 |
4 |
5 | // CFileRelateDlg 对话框
6 |
7 | class CFileRelateDlg : public CTabDlg
8 | {
9 | DECLARE_DYNAMIC(CFileRelateDlg)
10 |
11 | public:
12 | CFileRelateDlg(CWnd* pParent = nullptr); // 标准构造函数
13 | virtual ~CFileRelateDlg();
14 |
15 | // 对话框数据
16 | #ifdef AFX_DESIGN_TIME
17 | enum { IDD = IDD_FILE_RELATE_DIALOG };
18 | #endif
19 |
20 | private:
21 | std::map extensions;
22 | std::map m_list_checked_state; //保存初始时列表中勾选状态
23 |
24 | protected:
25 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持
26 | void RefreshList();
27 | bool IsModified();
28 |
29 | DECLARE_MESSAGE_MAP()
30 | public:
31 | CListCtrl m_list_ctrl;
32 | virtual BOOL OnInitDialog();
33 | virtual void OnOK();
34 | afx_msg void OnBnClickedSelectAllCheck();
35 | afx_msg void OnBnClickedDefaultButton();
36 | };
37 |
--------------------------------------------------------------------------------
/SimpleNotePad/FindReplaceTools.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "ScintillaEditView.h"
3 | #include
4 |
5 |
6 | enum class FindMode
7 | {
8 | NORMAL,
9 | EXTENDED,
10 | REGULAR_EXPRESSION
11 | };
12 |
13 | //查找选项
14 | struct FindOption
15 | {
16 | std::wstring find_str;
17 | std::wstring replace_str;
18 | bool match_whole_word{};
19 | bool match_case{};
20 | bool find_loop{};
21 | FindMode find_mode{};
22 | };
23 |
24 | class FindReplaceTools
25 | {
26 | public:
27 | static bool FindTexts(FindOption options, bool next, CScintillaEditView* pEditView);
28 | static bool ReplaceTexts(FindOption options, CScintillaEditView* pEditView);
29 | static int ReplaceAll(FindOption options, CScintillaEditView* pEditView);
30 | static int ReplaceSelection(FindOption options, CScintillaEditView* pEditView);
31 | static int MarkAll(FindOption options, CScintillaEditView* pEditView);
32 | static bool MarkSameWord(const std::string& str, CScintillaEditView::MarkStyle mark_style, CScintillaEditView* pEditView);
33 | static bool MarkSameWord(const std::wstring& str, CScintillaEditView::MarkStyle mark_style, CScintillaEditView* pEditView);
34 |
35 | private:
36 | static int ReplaceInRange(int start, int end, FindOption options, CScintillaEditView* pEditView);
37 |
38 | static std::wstring convertExtendedToString(const std::wstring query);
39 | static unsigned int buildSearchFlags(const FindOption& option);
40 | static bool readBase(const TCHAR* str, int* value, int base, int size);
41 | };
42 |
--------------------------------------------------------------------------------
/SimpleNotePad/GeneralSettingsDlg.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "Common.h"
3 | #include "TabDlg.h"
4 |
5 | // CSettingsDlg 对话框
6 |
7 | class CGeneralSettingsDlg : public CTabDlg
8 | {
9 | DECLARE_DYNAMIC(CGeneralSettingsDlg)
10 |
11 | public:
12 | CGeneralSettingsDlg(CWnd* pParent = nullptr); // 标准构造函数
13 | virtual ~CGeneralSettingsDlg();
14 |
15 | // 对话框数据
16 | #ifdef AFX_DESIGN_TIME
17 | enum { IDD = IDD_GENERAL_SETTINGS_DIALOG };
18 | #endif
19 |
20 | public:
21 | SettingsData m_data;
22 |
23 | private:
24 | CComboBox m_default_page_code_combo;
25 | CComboBox m_language_combo;
26 | bool m_explorer_context_menu_exist{};
27 | CComboBox m_default_code_type_combo;
28 |
29 | protected:
30 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持
31 |
32 | DECLARE_MESSAGE_MAP()
33 | public:
34 | virtual BOOL OnInitDialog();
35 | afx_msg void OnCbnSelchangeDefaultCodePageCombo();
36 | virtual void OnOK();
37 | afx_msg void OnBnClickedGithubRadio();
38 | afx_msg void OnBnClickedGiteeRadio();
39 | afx_msg void OnCbnSelchangeLanguageCombo();
40 | };
41 |
--------------------------------------------------------------------------------
/SimpleNotePad/GoToLineDlg.cpp:
--------------------------------------------------------------------------------
1 | // GoToLineDlg.cpp: 实现文件
2 | //
3 |
4 | #include "stdafx.h"
5 | #include "SimpleNotePad.h"
6 | #include "GoToLineDlg.h"
7 | #include "afxdialogex.h"
8 |
9 |
10 | // CGoToLineDlg 对话框
11 |
12 | IMPLEMENT_DYNAMIC(CGoToLineDlg, CDialog)
13 |
14 | CGoToLineDlg::CGoToLineDlg(CWnd* pParent /*=nullptr*/)
15 | : CDialog(IDD_GTO_DIALOG, pParent)
16 | {
17 |
18 | }
19 |
20 | CGoToLineDlg::~CGoToLineDlg()
21 | {
22 | }
23 |
24 | int CGoToLineDlg::GetLine()
25 | {
26 | return m_line;
27 | }
28 |
29 | void CGoToLineDlg::DoDataExchange(CDataExchange* pDX)
30 | {
31 | CDialog::DoDataExchange(pDX);
32 | }
33 |
34 |
35 | BEGIN_MESSAGE_MAP(CGoToLineDlg, CDialog)
36 | END_MESSAGE_MAP()
37 |
38 |
39 | // CGoToLineDlg 消息处理程序
40 |
41 |
42 | void CGoToLineDlg::OnOK()
43 | {
44 | // TODO: 在此添加专用代码和/或调用基类
45 | CString str;
46 | GetDlgItemText(IDC_EDIT1, str);
47 | m_line = _ttoi(str.GetString());
48 |
49 | CDialog::OnOK();
50 | }
51 |
52 |
53 | BOOL CGoToLineDlg::OnInitDialog()
54 | {
55 | CDialog::OnInitDialog();
56 |
57 | // TODO: 在此添加额外的初始化
58 |
59 | CWnd* pEdit = GetDlgItem(IDC_EDIT1);
60 | if (pEdit != nullptr)
61 | pEdit->SetFocus();
62 |
63 | return FALSE; // return TRUE unless you set the focus to a control
64 | // 异常: OCX 属性页应返回 FALSE
65 | }
66 |
--------------------------------------------------------------------------------
/SimpleNotePad/GoToLineDlg.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 |
4 | // CGoToLineDlg 对话框
5 |
6 | class CGoToLineDlg : public CDialog
7 | {
8 | DECLARE_DYNAMIC(CGoToLineDlg)
9 |
10 | public:
11 | CGoToLineDlg(CWnd* pParent = nullptr); // 标准构造函数
12 | virtual ~CGoToLineDlg();
13 | int GetLine();
14 |
15 | // 对话框数据
16 | #ifdef AFX_DESIGN_TIME
17 | enum { IDD = IDD_GTO_DIALOG };
18 | #endif
19 |
20 | private:
21 | int m_line{};
22 |
23 | protected:
24 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持
25 |
26 | DECLARE_MESSAGE_MAP()
27 | virtual void OnOK();
28 | public:
29 | virtual BOOL OnInitDialog();
30 | };
31 |
--------------------------------------------------------------------------------
/SimpleNotePad/HexEditView.cpp:
--------------------------------------------------------------------------------
1 | #include "stdafx.h"
2 | #include "HexEditView.h"
3 |
4 | IMPLEMENT_DYNCREATE(CHexEditView, CView)
5 |
6 | CHexEditView::CHexEditView()
7 | {
8 |
9 | }
10 |
11 | void CHexEditView::InitHexView()
12 | {
13 | SendMessage(SCI_SETHSCROLLBAR, 0);
14 | SetReadOnly(true);
15 |
16 | SendMessage(SCI_STYLECLEARALL); //如果没有这句,设置字体的粗体、任何等样式无效
17 |
18 | SetLexer(SCLEX_HEXVIEW);
19 | //设置颜色
20 | SetSyntaxColor(SCE_HEXVIEW_ADDR, 0xCD4230);
21 | SetSyntaxFontStyle(SCE_HEXVIEW_ADDR, true, false);
22 | SetSyntaxColor(SCE_HEXVIEW_BYTES, 0x794E41);
23 | SetSyntaxColor(SCE_HEXVIEW_DUMP, 0x737300);
24 | //去掉左侧的空白
25 | SendMessage(SCI_SETMARGINWIDTHN, 1, 0);
26 | }
27 |
--------------------------------------------------------------------------------
/SimpleNotePad/HexEditView.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "ScintillaEditView.h"
3 | class CHexEditView :
4 | public CScintillaEditView
5 | {
6 | DECLARE_DYNCREATE(CHexEditView)
7 |
8 | protected:
9 | CHexEditView();
10 | public:
11 | void InitHexView();
12 |
13 | };
14 |
15 |
--------------------------------------------------------------------------------
/SimpleNotePad/InputDlg.cpp:
--------------------------------------------------------------------------------
1 | // InputDlg.cpp : 实现文件
2 | //
3 |
4 | #include "stdafx.h"
5 | #include "SimpleNotePad.h"
6 | #include "InputDlg.h"
7 | #include "afxdialogex.h"
8 |
9 |
10 | // CInputDlg 对话框
11 |
12 | IMPLEMENT_DYNAMIC(CInputDlg, CBaseDialog)
13 |
14 | CInputDlg::CInputDlg(CWnd* pParent /*=NULL*/)
15 | : CBaseDialog(IDD_INPUT_DLG, pParent)
16 | {
17 |
18 | }
19 |
20 | CInputDlg::~CInputDlg()
21 | {
22 | }
23 |
24 | void CInputDlg::SetTitle(LPCTSTR strTitle)
25 | {
26 | m_strTitle = strTitle;
27 | }
28 |
29 | void CInputDlg::SetInfoText(LPCTSTR strInfo)
30 | {
31 | m_strInfo = strInfo;
32 | }
33 |
34 | void CInputDlg::SetEditText(LPCTSTR strEdit)
35 | {
36 | m_strEdit = strEdit;
37 | }
38 |
39 | CString CInputDlg::GetEditText() const
40 | {
41 | return m_strEdit;
42 | }
43 |
44 | void CInputDlg::DoDataExchange(CDataExchange* pDX)
45 | {
46 | CBaseDialog::DoDataExchange(pDX);
47 | }
48 |
49 | CString CInputDlg::GetDialogName() const
50 | {
51 | return _T("InputDlg");
52 | }
53 |
54 |
55 | BEGIN_MESSAGE_MAP(CInputDlg, CBaseDialog)
56 | END_MESSAGE_MAP()
57 |
58 |
59 | // CInputDlg 消息处理程序
60 |
61 |
62 | BOOL CInputDlg::OnInitDialog()
63 | {
64 | CBaseDialog::OnInitDialog();
65 |
66 | // TODO: 在此添加额外的初始化
67 | SetWindowText(m_strTitle);
68 | SetDlgItemText(IDC_INFO_STATIC, m_strInfo);
69 | SetIcon(theApp.GetMenuIcon(IDI_CODE), FALSE);
70 |
71 | CEdit* pEdit = (CEdit*)GetDlgItem(IDC_INPUT_EDIT);
72 | if (pEdit != nullptr)
73 | {
74 | pEdit->SetWindowText(m_strEdit);
75 | pEdit->SetFocus(); //初始时将焦点设置到输入框
76 | pEdit->SetSel(0, -1);
77 | }
78 |
79 | return TRUE; // return TRUE unless you set the focus to a control
80 | // 异常: OCX 属性页应返回 FALSE
81 | }
82 |
83 |
84 | void CInputDlg::OnOK()
85 | {
86 | // TODO: 在此添加专用代码和/或调用基类
87 | GetDlgItemText(IDC_INPUT_EDIT, m_strEdit);
88 |
89 | CBaseDialog::OnOK();
90 | }
91 |
--------------------------------------------------------------------------------
/SimpleNotePad/InputDlg.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhongyang219/SimpleNotePad/c06d48ba612acfc51e4e515098da857aa8b0229f/SimpleNotePad/InputDlg.h
--------------------------------------------------------------------------------
/SimpleNotePad/InsertDataDlg.cpp:
--------------------------------------------------------------------------------
1 | // InsertDataDlg.cpp: 实现文件
2 | //
3 |
4 | #include "stdafx.h"
5 | #include "SimpleNotePad.h"
6 | #include "InsertDataDlg.h"
7 | #include "afxdialogex.h"
8 |
9 |
10 | // CInsertDataDlg 对话框
11 |
12 | IMPLEMENT_DYNAMIC(CInsertDataDlg, CDialog)
13 |
14 | CInsertDataDlg::CInsertDataDlg(CWnd* pParent /*=nullptr*/)
15 | : CDialog(IDD_INSERT_DATA_DIALOG, pParent)
16 | {
17 |
18 | }
19 |
20 | CInsertDataDlg::~CInsertDataDlg()
21 | {
22 | }
23 |
24 | void CInsertDataDlg::DoDataExchange(CDataExchange* pDX)
25 | {
26 | CDialog::DoDataExchange(pDX);
27 | }
28 |
29 |
30 | BEGIN_MESSAGE_MAP(CInsertDataDlg, CDialog)
31 | END_MESSAGE_MAP()
32 |
33 |
34 | // CInsertDataDlg 消息处理程序
35 |
36 |
37 | void CInsertDataDlg::OnOK()
38 | {
39 | // TODO: 在此添加专用代码和/或调用基类
40 | CString strTmp;
41 | GetDlgItemText(IDC_INSERT_ADDR_EDIT, strTmp);
42 | m_address = wcstoul(strTmp, nullptr, 16);
43 |
44 | GetDlgItemText(IDC_INSERT_SIZE_EDIT, strTmp);
45 | m_size = _ttoi(strTmp);
46 |
47 | CDialog::OnOK();
48 | }
49 |
--------------------------------------------------------------------------------
/SimpleNotePad/InsertDataDlg.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 |
4 | // CInsertDataDlg 对话框
5 |
6 | class CInsertDataDlg : public CDialog
7 | {
8 | DECLARE_DYNAMIC(CInsertDataDlg)
9 |
10 | public:
11 | CInsertDataDlg(CWnd* pParent = nullptr); // 标准构造函数
12 | virtual ~CInsertDataDlg();
13 |
14 | unsigned int GetInsertAddress() const { return m_address; }
15 | unsigned int GetInsertSize() const { return m_size; }
16 |
17 | // 对话框数据
18 | #ifdef AFX_DESIGN_TIME
19 | enum { IDD = IDD_INSERT_DATA_DIALOG };
20 | #endif
21 |
22 | private:
23 | unsigned int m_address;
24 | unsigned int m_size;
25 |
26 | protected:
27 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持
28 |
29 | DECLARE_MESSAGE_MAP()
30 | virtual void OnOK();
31 | };
32 |
--------------------------------------------------------------------------------
/SimpleNotePad/LanguageSettingsDlg.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "TabDlg.h"
3 | #include "UserDefinedLanguageStyle.h"
4 | #include "ColorStaticEx.h"
5 |
6 | // CLanguageSettingsDlg 对话框
7 |
8 | class CLanguageSettingsDlg : public CTabDlg
9 | {
10 | DECLARE_DYNAMIC(CLanguageSettingsDlg)
11 |
12 | public:
13 | CLanguageSettingsDlg(CWnd* pParent = nullptr); // 标准构造函数
14 | virtual ~CLanguageSettingsDlg();
15 |
16 | // 对话框数据
17 | #ifdef AFX_DESIGN_TIME
18 | enum { IDD = IDD_LANGUAGE_SETTING_DIALOG };
19 | #endif
20 |
21 | public:
22 | CUserDefinedLanguageStyle m_data;
23 |
24 | private:
25 | CString m_cur_lan;
26 | CMenu m_restore_default_menu;
27 |
28 | protected:
29 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持
30 | void EnableControl();
31 | void CurStyleFromUI(); //从界面获取当前样式设置
32 |
33 | DECLARE_MESSAGE_MAP()
34 | public:
35 | virtual BOOL OnInitDialog();
36 | CListBox m_language_list_box;
37 | CListBox m_style_list_box;
38 | CColorStaticEx m_text_color_static;
39 | afx_msg void OnLbnSelchangeList1();
40 | afx_msg void OnLbnSelchangeStyleList();
41 | afx_msg void OnBnClickedBoldCheck();
42 | afx_msg void OnBnClickedItalicCheck();
43 | protected:
44 | afx_msg LRESULT OnColorSelected(WPARAM wParam, LPARAM lParam);
45 | public:
46 | afx_msg void OnBnClickedRestoreDefaultButton();
47 | afx_msg void OnEnChangeUserExtEdit();
48 | afx_msg void OnRestoreSelectedStyle();
49 | afx_msg void OnRestoreSelectedLanguange();
50 | afx_msg void OnRestoreAll();
51 | afx_msg void OnInitMenu(CMenu* pMenu);
52 | };
53 |
--------------------------------------------------------------------------------
/SimpleNotePad/RegFileRelate.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | class CRegFileRelate
3 | {
4 | public:
5 | CRegFileRelate();
6 | ~CRegFileRelate();
7 |
8 | void SetModelPath(LPCTSTR model_path);
9 | void SetAppName(LPCTSTR app_name);
10 |
11 | //添加一个文件类型的关联
12 | //file_ext: 要关联的文件扩展名
13 | bool AddFileTypeRelate(LPCTSTR file_ext, LPCTSTR ico_path = nullptr, bool default_icon = false, LPCTSTR description = NULL);
14 | bool AddFileTypeRelate(LPCTSTR file_ext, int ico_index, bool default_icon = false, LPCTSTR description = NULL);
15 | //判断一个文件类型是否已关联
16 | bool IsFileTypeRelated(LPCTSTR file_ext);
17 | //删除一个文件类型的关联
18 | bool DeleteFileTypeRelate(LPCTSTR file_ext);
19 |
20 | //获取所有已关联的类型扩展名
21 | bool GetAllRelatedExtensions(std::vector& extensions);
22 |
23 | private:
24 | bool OpenItem(CRegKey& key, LPCTSTR item_str);
25 |
26 | private:
27 | CString m_model_path;
28 | CString m_app_name = APP_NAME;
29 | };
30 |
31 |
--------------------------------------------------------------------------------
/SimpleNotePad/SettingsDlg.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "BaseDialog.h"
3 | #include "TabCtrlEx.h"
4 | #include "GeneralSettingsDlg.h"
5 | #include "EditSettingsDlg.h"
6 | #include "FileRelateDlg.h"
7 | #include "LanguageSettingsDlg.h"
8 |
9 | // CSettingsDlg1 对话框
10 |
11 | class CSettingsDlg : public CBaseDialog
12 | {
13 | DECLARE_DYNAMIC(CSettingsDlg)
14 |
15 | public:
16 | CSettingsDlg(CWnd* pParent = nullptr); // 标准构造函数
17 | virtual ~CSettingsDlg();
18 |
19 | // 对话框数据
20 | #ifdef AFX_DESIGN_TIME
21 | enum { IDD = IDD_SETTINGS_DIALOG };
22 | #endif
23 |
24 | CGeneralSettingsDlg m_general_settings_dlg;
25 | CEditSettingsDlg m_edit_settings_dlg;
26 | CFileRelateDlg m_file_relate_dlg;
27 | CLanguageSettingsDlg m_language_settings_dlg;
28 |
29 | private:
30 | CTabCtrlEx m_tab_ctrl;
31 | static int m_tab_selected;
32 | std::vector m_tab_vect;
33 | std::vector m_tab_height;
34 |
35 | protected:
36 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持
37 |
38 | DECLARE_MESSAGE_MAP()
39 |
40 | virtual CString GetDialogName() const override;
41 |
42 | public:
43 | virtual BOOL OnInitDialog();
44 | virtual void OnOK();
45 | afx_msg void OnDestroy();
46 | afx_msg void OnSize(UINT nType, int cx, int cy);
47 | };
48 |
--------------------------------------------------------------------------------
/SimpleNotePad/SimpleNotePad.rc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhongyang219/SimpleNotePad/c06d48ba612acfc51e4e515098da857aa8b0229f/SimpleNotePad/SimpleNotePad.rc
--------------------------------------------------------------------------------
/SimpleNotePad/SimpleXML.h:
--------------------------------------------------------------------------------
1 | //一个简易的XML解析的类
2 | #pragma once
3 | #include "Common.h"
4 |
5 | class CSimpleXML
6 | {
7 | public:
8 | CSimpleXML(const wstring& xml_path);
9 | CSimpleXML();
10 | ~CSimpleXML();
11 |
12 | void LoadXMLContentDirect(const wstring& xml_content) { m_xml_content = xml_content; }
13 |
14 | wstring GetNode(const wchar_t* node, const wchar_t* parent) const;
15 | wstring GetNode(const wchar_t* node) const;
16 |
17 | static wstring _GetNode(const wchar_t* node, const wstring& content);
18 |
19 | protected:
20 | wstring m_xml_content;
21 |
22 | };
23 |
24 |
--------------------------------------------------------------------------------
/SimpleNotePad/SpinEdit.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhongyang219/SimpleNotePad/c06d48ba612acfc51e4e515098da857aa8b0229f/SimpleNotePad/SpinEdit.cpp
--------------------------------------------------------------------------------
/SimpleNotePad/SpinEdit.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhongyang219/SimpleNotePad/c06d48ba612acfc51e4e515098da857aa8b0229f/SimpleNotePad/SpinEdit.h
--------------------------------------------------------------------------------
/SimpleNotePad/SyntaxHighlight.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "stdafx.h"
3 | #include "tinyxml2.h"
4 |
5 | class CLanguage
6 | {
7 | public:
8 | struct SyntaxStyle
9 | {
10 | std::wstring name;
11 | int id{};
12 | COLORREF color;
13 | bool bold{};
14 | bool italic{};
15 | };
16 | std::wstring m_name;
17 | int m_id{};
18 | std::set m_ext;
19 | std::map m_keywords_list;
20 | std::vector m_syntax_list;
21 |
22 | struct Comment
23 | {
24 | std::string line;
25 | std::string start;
26 | std::string end;
27 |
28 | bool isMultiLeneCommentValid() const
29 | {
30 | return !start.empty() && !end.empty();
31 | }
32 | };
33 | Comment m_comment;
34 |
35 | //从配置文件“Language”节点解析语法高亮信息
36 | //ele: xml节点
37 | //syntax_from: 如果语法高亮颜色设置要从其他语言复制,则将该语言的名称保存在这里
38 | //comment_from: 如果注释设置要从其他语言复制,则将该语言的名称保存在这里
39 | void FromXmlElement(tinyxml2::XMLElement* ele, wstring& syntax_from, wstring& comment_from);
40 | };
41 |
42 | class CSyntaxHighlight
43 | {
44 | public:
45 | void LoadFromFile(const wchar_t* file_path);
46 |
47 | const CLanguage& FindLanguageByFileName(const wstring& file_name) const;
48 | const CLanguage& FindLanguageByName(const wchar_t* name) const;
49 | const CLanguage& GetLanguage(int index) const;
50 | int IndexOf(const wstring& name) const;
51 |
52 | const std::vector& GetLanguageList() const;
53 |
54 | private:
55 | std::vector m_language_list;
56 | CLanguage m_empty_language{};
57 | };
58 |
--------------------------------------------------------------------------------
/SimpleNotePad/TabCtrlEx.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 |
4 | // CTabCtrlEx
5 |
6 | class CTabCtrlEx : public CTabCtrl
7 | {
8 | DECLARE_DYNAMIC(CTabCtrlEx)
9 |
10 | public:
11 | CTabCtrlEx();
12 | virtual ~CTabCtrlEx();
13 |
14 | void AddWindow(CWnd* pWnd, LPCTSTR lable_text); //向当前tab控件添加一个子窗口
15 | void SetCurTab(int index);
16 | CWnd* GetCurrentTab();
17 | void AdjustTabWindowSize();
18 |
19 | protected:
20 | void CalSubWindowSize();
21 |
22 | DECLARE_MESSAGE_MAP()
23 |
24 | protected:
25 | vector m_tab_list; //保存tab控件每个子窗口的指针
26 | public:
27 | afx_msg void OnTcnSelchange(NMHDR *pNMHDR, LRESULT *pResult);
28 | virtual void PreSubclassWindow();
29 |
30 | CRect m_tab_rect;
31 | afx_msg void OnSize(UINT nType, int cx, int cy);
32 | };
33 |
34 |
35 |
--------------------------------------------------------------------------------
/SimpleNotePad/TabDlg.h:
--------------------------------------------------------------------------------
1 | //这是用于Tab标签中的子对话框类
2 | #pragma once
3 | class CTabDlg : public CDialogEx
4 | {
5 | DECLARE_DYNAMIC(CTabDlg)
6 | public:
7 | CTabDlg(UINT nIDTemplate, CWnd *pParent = NULL);
8 | ~CTabDlg();
9 | virtual BOOL PreTranslateMessage(MSG* pMsg);
10 | virtual BOOL OnInitDialog();
11 | CWnd* GetParentWindow();
12 | void SetScrollbarInfo(int nPage, int nMax);
13 | void ResetScroll();
14 | virtual void OnTabEntered() {} //当标签切换到当前窗口时被调用
15 | virtual void OnOK();
16 | void SetScrollEnable(bool enable) { m_scroll_enable = enable; }
17 |
18 | protected:
19 | void ScrollWindowSimple(int step);
20 |
21 | void EnableDlgCtrl(UINT id, bool enable);
22 | void ShowDlgCtrl(UINT id, bool show);
23 |
24 | protected:
25 | CWnd* m_pParent;
26 | bool m_scroll_enable{ false };
27 | int m_last_pos{};
28 | COLORREF m_background_color{};
29 |
30 | public:
31 | DECLARE_MESSAGE_MAP()
32 | afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
33 | afx_msg BOOL OnMouseWheel(UINT nFlags, short zDelta, CPoint pt);
34 | };
35 |
36 |
--------------------------------------------------------------------------------
/SimpleNotePad/Test.cpp:
--------------------------------------------------------------------------------
1 | #include "stdafx.h"
2 | #include "Test.h"
3 | #include "TinyXml2Helper.h"
4 | #include "SyntaxHighlight.h"
5 | #include "SimpleNotePad.h"
6 | #include "Common.h"
7 |
8 | void CTest::Test()
9 | {
10 | //TestXml();
11 | //TestSaveStringList();
12 | //TestFindWindows();
13 | }
14 |
15 | void CTest::TestXml()
16 | {
17 | //tinyxml2::XMLDocument doc;
18 |
19 | //CTinyXml2Helper::LoadXmlFile(doc, L"./lang.xml");
20 |
21 | //CTinyXml2Helper::IterateChildNode(doc.FirstChildElement(), [](tinyxml2::XMLElement* child)
22 | //{
23 | // int a = 0;
24 | //});
25 |
26 | //CSyntaxHighlight syntax;
27 | //syntax.LoadFromFile("./lang.xml");
28 | int a = 0;
29 | }
30 |
31 | void CTest::TestSaveStringList()
32 | {
33 | std::vector test;
34 | test.push_back(L"123");
35 | test.push_back(L"abc");
36 | test.push_back(L"测试");
37 | theApp.WriteStringList(L"test", L"test_string_list", test);
38 | std::vector test_result;
39 | theApp.GetStringList(L"test", L"test_string_list", test_result);
40 | int a = 0;
41 | }
42 |
43 | void CTest::TestFindWindows()
44 | {
45 | std::vector result;
46 | CCommon::FindAllWindow(APP_CLASS_NAME, result);
47 | int a = 0;
48 | }
49 |
--------------------------------------------------------------------------------
/SimpleNotePad/Test.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | class CTest
3 | {
4 | public:
5 | static void Test();
6 |
7 | private:
8 | static void TestXml();
9 | static void TestSaveStringList();
10 | static void TestFindWindows();
11 | };
12 |
--------------------------------------------------------------------------------
/SimpleNotePad/TinyXml2Helper.cpp:
--------------------------------------------------------------------------------
1 | #include "stdafx.h"
2 | #include "TinyXml2Helper.h"
3 | #include "Common.h"
4 |
5 | bool CTinyXml2Helper::LoadXmlFile(tinyxml2::XMLDocument& doc, const wchar_t* file_path)
6 | {
7 | //由于XMLDocument::LoadFile函数不支持Unicode,因此这里自行读取文件内容,并调用XMLDocument::Parse函数解析
8 | size_t length;
9 | const char* xml_contents = CCommon::GetFileContent(file_path, length);
10 | auto err = doc.Parse(xml_contents, length);
11 | delete[] xml_contents;
12 | return err == tinyxml2::XML_SUCCESS;
13 | }
14 |
15 | void CTinyXml2Helper::IterateChildNode(tinyxml2::XMLElement* ele, std::function fun)
16 | {
17 | if (ele == nullptr)
18 | return;
19 |
20 | tinyxml2::XMLElement* child = ele->FirstChildElement();
21 | if (child == nullptr)
22 | return;
23 | fun(child);
24 | while (true)
25 | {
26 | child = child->NextSiblingElement();
27 | if (child != nullptr)
28 | fun(child);
29 | else
30 | break;
31 | }
32 | }
33 |
34 | const char * CTinyXml2Helper::ElementAttribute(tinyxml2::XMLElement * ele, const char * attr)
35 | {
36 | if (ele != nullptr)
37 | {
38 | const char* str = ele->Attribute(attr);
39 | if (str != nullptr)
40 | return str;
41 | }
42 | return "";
43 | }
44 |
45 | const char* CTinyXml2Helper::ElementName(tinyxml2::XMLElement* ele)
46 | {
47 | if (ele != nullptr)
48 | {
49 | const char* str = ele->Name();
50 | if (str != nullptr)
51 | return str;
52 | }
53 | return "";
54 | }
55 |
56 | const char* CTinyXml2Helper::ElementText(tinyxml2::XMLElement* ele)
57 | {
58 | if (ele != nullptr)
59 | {
60 | const char* str = ele->GetText();
61 | if (str != nullptr)
62 | return str;
63 | }
64 | return "";
65 | }
66 |
67 |
--------------------------------------------------------------------------------
/SimpleNotePad/TinyXml2Helper.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "tinyxml2.h"
3 | #include
4 | #include
5 |
6 | class CTinyXml2Helper
7 | {
8 | public:
9 |
10 | static bool LoadXmlFile(tinyxml2::XMLDocument& doc, const wchar_t* file_path);
11 |
12 | static void IterateChildNode(tinyxml2::XMLElement* ele, std::function fun);
13 |
14 | static const char* ElementAttribute(tinyxml2::XMLElement* ele, const char* attr);
15 | static const char* ElementName(tinyxml2::XMLElement* ele);
16 | static const char* ElementText(tinyxml2::XMLElement* ele);
17 | };
18 |
19 |
--------------------------------------------------------------------------------
/SimpleNotePad/UpdateHelper.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | class CUpdateHelper
3 | {
4 | public:
5 | CUpdateHelper();
6 | ~CUpdateHelper();
7 |
8 | enum class UpdateSource
9 | {
10 | GitHubSource,
11 | GiteeSource
12 | };
13 |
14 | void SetUpdateSource(UpdateSource update_source);
15 |
16 | bool CheckForUpdate();
17 |
18 | const std::wstring& GetVersion() const;
19 | const std::wstring& GetLink() const;
20 | const std::wstring& GetLink64() const;
21 | const std::wstring& GetContentsEn() const;
22 | const std::wstring& GetContentsZhCn() const;
23 |
24 | private:
25 | void ParseUpdateInfo(wstring version_info);
26 |
27 | private:
28 | std::wstring m_version;
29 | std::wstring m_link;
30 | std::wstring m_link64;
31 | std::wstring m_contents_en;
32 | std::wstring m_contents_zh_cn;
33 | UpdateSource m_update_source{ UpdateSource::GitHubSource };
34 | };
35 |
--------------------------------------------------------------------------------
/SimpleNotePad/UserDefinedLanguageStyle.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhongyang219/SimpleNotePad/c06d48ba612acfc51e4e515098da857aa8b0229f/SimpleNotePad/UserDefinedLanguageStyle.h
--------------------------------------------------------------------------------
/SimpleNotePad/WIC.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhongyang219/SimpleNotePad/c06d48ba612acfc51e4e515098da857aa8b0229f/SimpleNotePad/WIC.cpp
--------------------------------------------------------------------------------
/SimpleNotePad/WIC.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhongyang219/SimpleNotePad/c06d48ba612acfc51e4e515098da857aa8b0229f/SimpleNotePad/WIC.h
--------------------------------------------------------------------------------
/SimpleNotePad/WinVersionHelper.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | struct WinVersion
4 | {
5 | public:
6 | WinVersion();
7 |
8 | int m_major_version;
9 | int m_minor_version;
10 | int m_build_number;
11 | };
12 |
13 | class CWinVersionHelper
14 | {
15 | public:
16 | ~CWinVersionHelper();
17 |
18 | static bool IsWindows11OrLater(); //判断当前Windows版本是否为Win11或更新的版本
19 | static bool IsWindows10(); //判断Windows版本是否为Windows10
20 | static bool IsWindows10FallCreatorOrLater(); //判断当前Windows版本是否为Win10秋季创意者更新或更新的版本
21 | static bool IsWindowsVista();
22 | static bool IsWindows7(); //判断Windows版本是否为Windows7
23 | static bool IsWindows7OrLater();
24 | static bool IsWindows8Or8point1(); //判断Windows版本是否为Windows8或Windows8.1
25 | static bool IsWindows8OrLater();
26 | static bool IsWindows10OrLater();
27 | static bool IsWindows10Version1809OrLater();
28 |
29 | static int GetMajorVersion() { return m_version.m_major_version; }
30 | static int GetMinorVersion() { return m_version.m_minor_version; }
31 | static int GetBuildNumber() { return m_version.m_build_number; }
32 |
33 | static bool IsWindows10LightTheme();
34 | static void CheckWindows10LightTheme();
35 |
36 | private:
37 | CWinVersionHelper();
38 | static LONG GetDWORDRegKeyData(HKEY hKey, const wstring& strValueName, DWORD& dwValueData);
39 |
40 | static WinVersion m_version;
41 | static bool m_windows10_light_theme;
42 | };
43 |
--------------------------------------------------------------------------------
/SimpleNotePad/crashtool.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhongyang219/SimpleNotePad/c06d48ba612acfc51e4e515098da857aa8b0229f/SimpleNotePad/crashtool.h
--------------------------------------------------------------------------------
/SimpleNotePad/res/SimpleNotePad.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhongyang219/SimpleNotePad/c06d48ba612acfc51e4e515098da857aa8b0229f/SimpleNotePad/res/SimpleNotePad.ico
--------------------------------------------------------------------------------
/SimpleNotePad/res/SimpleNotePad.rc2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhongyang219/SimpleNotePad/c06d48ba612acfc51e4e515098da857aa8b0229f/SimpleNotePad/res/SimpleNotePad.rc2
--------------------------------------------------------------------------------
/SimpleNotePad/res/capital.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhongyang219/SimpleNotePad/c06d48ba612acfc51e4e515098da857aa8b0229f/SimpleNotePad/res/capital.ico
--------------------------------------------------------------------------------
/SimpleNotePad/res/clipboard.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhongyang219/SimpleNotePad/c06d48ba612acfc51e4e515098da857aa8b0229f/SimpleNotePad/res/clipboard.ico
--------------------------------------------------------------------------------
/SimpleNotePad/res/code.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhongyang219/SimpleNotePad/c06d48ba612acfc51e4e515098da857aa8b0229f/SimpleNotePad/res/code.ico
--------------------------------------------------------------------------------
/SimpleNotePad/res/code_batch.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhongyang219/SimpleNotePad/c06d48ba612acfc51e4e515098da857aa8b0229f/SimpleNotePad/res/code_batch.ico
--------------------------------------------------------------------------------
/SimpleNotePad/res/comment.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhongyang219/SimpleNotePad/c06d48ba612acfc51e4e515098da857aa8b0229f/SimpleNotePad/res/comment.ico
--------------------------------------------------------------------------------
/SimpleNotePad/res/compare.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhongyang219/SimpleNotePad/c06d48ba612acfc51e4e515098da857aa8b0229f/SimpleNotePad/res/compare.ico
--------------------------------------------------------------------------------
/SimpleNotePad/res/copy.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhongyang219/SimpleNotePad/c06d48ba612acfc51e4e515098da857aa8b0229f/SimpleNotePad/res/copy.ico
--------------------------------------------------------------------------------
/SimpleNotePad/res/cut.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhongyang219/SimpleNotePad/c06d48ba612acfc51e4e515098da857aa8b0229f/SimpleNotePad/res/cut.ico
--------------------------------------------------------------------------------
/SimpleNotePad/res/date_time.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhongyang219/SimpleNotePad/c06d48ba612acfc51e4e515098da857aa8b0229f/SimpleNotePad/res/date_time.ico
--------------------------------------------------------------------------------
/SimpleNotePad/res/donate.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhongyang219/SimpleNotePad/c06d48ba612acfc51e4e515098da857aa8b0229f/SimpleNotePad/res/donate.bmp
--------------------------------------------------------------------------------
/SimpleNotePad/res/donate_wechat.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhongyang219/SimpleNotePad/c06d48ba612acfc51e4e515098da857aa8b0229f/SimpleNotePad/res/donate_wechat.bmp
--------------------------------------------------------------------------------
/SimpleNotePad/res/exit.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhongyang219/SimpleNotePad/c06d48ba612acfc51e4e515098da857aa8b0229f/SimpleNotePad/res/exit.ico
--------------------------------------------------------------------------------
/SimpleNotePad/res/explore.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhongyang219/SimpleNotePad/c06d48ba612acfc51e4e515098da857aa8b0229f/SimpleNotePad/res/explore.ico
--------------------------------------------------------------------------------
/SimpleNotePad/res/file.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhongyang219/SimpleNotePad/c06d48ba612acfc51e4e515098da857aa8b0229f/SimpleNotePad/res/file.ico
--------------------------------------------------------------------------------
/SimpleNotePad/res/find.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhongyang219/SimpleNotePad/c06d48ba612acfc51e4e515098da857aa8b0229f/SimpleNotePad/res/find.ico
--------------------------------------------------------------------------------
/SimpleNotePad/res/font.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhongyang219/SimpleNotePad/c06d48ba612acfc51e4e515098da857aa8b0229f/SimpleNotePad/res/font.ico
--------------------------------------------------------------------------------
/SimpleNotePad/res/help.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhongyang219/SimpleNotePad/c06d48ba612acfc51e4e515098da857aa8b0229f/SimpleNotePad/res/help.ico
--------------------------------------------------------------------------------
/SimpleNotePad/res/hex_view.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhongyang219/SimpleNotePad/c06d48ba612acfc51e4e515098da857aa8b0229f/SimpleNotePad/res/hex_view.ico
--------------------------------------------------------------------------------
/SimpleNotePad/res/language.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhongyang219/SimpleNotePad/c06d48ba612acfc51e4e515098da857aa8b0229f/SimpleNotePad/res/language.ico
--------------------------------------------------------------------------------
/SimpleNotePad/res/lower_case.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhongyang219/SimpleNotePad/c06d48ba612acfc51e4e515098da857aa8b0229f/SimpleNotePad/res/lower_case.ico
--------------------------------------------------------------------------------
/SimpleNotePad/res/mark.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhongyang219/SimpleNotePad/c06d48ba612acfc51e4e515098da857aa8b0229f/SimpleNotePad/res/mark.ico
--------------------------------------------------------------------------------
/SimpleNotePad/res/new.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhongyang219/SimpleNotePad/c06d48ba612acfc51e4e515098da857aa8b0229f/SimpleNotePad/res/new.ico
--------------------------------------------------------------------------------
/SimpleNotePad/res/new_window.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhongyang219/SimpleNotePad/c06d48ba612acfc51e4e515098da857aa8b0229f/SimpleNotePad/res/new_window.ico
--------------------------------------------------------------------------------
/SimpleNotePad/res/next.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhongyang219/SimpleNotePad/c06d48ba612acfc51e4e515098da857aa8b0229f/SimpleNotePad/res/next.ico
--------------------------------------------------------------------------------
/SimpleNotePad/res/open.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhongyang219/SimpleNotePad/c06d48ba612acfc51e4e515098da857aa8b0229f/SimpleNotePad/res/open.ico
--------------------------------------------------------------------------------
/SimpleNotePad/res/paste.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhongyang219/SimpleNotePad/c06d48ba612acfc51e4e515098da857aa8b0229f/SimpleNotePad/res/paste.ico
--------------------------------------------------------------------------------
/SimpleNotePad/res/pin.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhongyang219/SimpleNotePad/c06d48ba612acfc51e4e515098da857aa8b0229f/SimpleNotePad/res/pin.ico
--------------------------------------------------------------------------------
/SimpleNotePad/res/previous.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhongyang219/SimpleNotePad/c06d48ba612acfc51e4e515098da857aa8b0229f/SimpleNotePad/res/previous.ico
--------------------------------------------------------------------------------
/SimpleNotePad/res/recent_files.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhongyang219/SimpleNotePad/c06d48ba612acfc51e4e515098da857aa8b0229f/SimpleNotePad/res/recent_files.ico
--------------------------------------------------------------------------------
/SimpleNotePad/res/redo.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhongyang219/SimpleNotePad/c06d48ba612acfc51e4e515098da857aa8b0229f/SimpleNotePad/res/redo.ico
--------------------------------------------------------------------------------
/SimpleNotePad/res/reload.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhongyang219/SimpleNotePad/c06d48ba612acfc51e4e515098da857aa8b0229f/SimpleNotePad/res/reload.ico
--------------------------------------------------------------------------------
/SimpleNotePad/res/replace.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhongyang219/SimpleNotePad/c06d48ba612acfc51e4e515098da857aa8b0229f/SimpleNotePad/res/replace.ico
--------------------------------------------------------------------------------
/SimpleNotePad/res/save.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhongyang219/SimpleNotePad/c06d48ba612acfc51e4e515098da857aa8b0229f/SimpleNotePad/res/save.ico
--------------------------------------------------------------------------------
/SimpleNotePad/res/save_as.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhongyang219/SimpleNotePad/c06d48ba612acfc51e4e515098da857aa8b0229f/SimpleNotePad/res/save_as.ico
--------------------------------------------------------------------------------
/SimpleNotePad/res/select_all.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhongyang219/SimpleNotePad/c06d48ba612acfc51e4e515098da857aa8b0229f/SimpleNotePad/res/select_all.ico
--------------------------------------------------------------------------------
/SimpleNotePad/res/settings.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhongyang219/SimpleNotePad/c06d48ba612acfc51e4e515098da857aa8b0229f/SimpleNotePad/res/settings.ico
--------------------------------------------------------------------------------
/SimpleNotePad/res/undo.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhongyang219/SimpleNotePad/c06d48ba612acfc51e4e515098da857aa8b0229f/SimpleNotePad/res/undo.ico
--------------------------------------------------------------------------------
/SimpleNotePad/res/zoom_in.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhongyang219/SimpleNotePad/c06d48ba612acfc51e4e515098da857aa8b0229f/SimpleNotePad/res/zoom_in.ico
--------------------------------------------------------------------------------
/SimpleNotePad/res/zoom_out.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhongyang219/SimpleNotePad/c06d48ba612acfc51e4e515098da857aa8b0229f/SimpleNotePad/res/zoom_out.ico
--------------------------------------------------------------------------------
/SimpleNotePad/stdafx.cpp:
--------------------------------------------------------------------------------
1 |
2 | // stdafx.cpp : 只包括标准包含文件的源文件
3 | // SimpleNotePad.pch 将作为预编译头
4 | // stdafx.obj 将包含预编译类型信息
5 |
6 | #include "stdafx.h"
7 |
8 |
9 |
--------------------------------------------------------------------------------
/SimpleNotePad/targetver.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | // 包括 SDKDDKVer.h 将定义可用的最高版本的 Windows 平台。
4 |
5 | // 如果要为以前的 Windows 平台生成应用程序,请包括 WinSDKVer.h,并将
6 | // 将 _WIN32_WINNT 宏设置为要支持的平台,然后再包括 SDKDDKVer.h。
7 |
8 | #include
9 |
--------------------------------------------------------------------------------
/bin/Win32_Debug/tinyxml2d.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhongyang219/SimpleNotePad/c06d48ba612acfc51e4e515098da857aa8b0229f/bin/Win32_Debug/tinyxml2d.dll
--------------------------------------------------------------------------------
/bin/Win32_Release/tinyxml2.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhongyang219/SimpleNotePad/c06d48ba612acfc51e4e515098da857aa8b0229f/bin/Win32_Release/tinyxml2.dll
--------------------------------------------------------------------------------
/bin/x64_Debug/tinyxml2d.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhongyang219/SimpleNotePad/c06d48ba612acfc51e4e515098da857aa8b0229f/bin/x64_Debug/tinyxml2d.dll
--------------------------------------------------------------------------------
/bin/x64_Release/tinyxml2.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhongyang219/SimpleNotePad/c06d48ba612acfc51e4e515098da857aa8b0229f/bin/x64_Release/tinyxml2.dll
--------------------------------------------------------------------------------
/images/1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhongyang219/SimpleNotePad/c06d48ba612acfc51e4e515098da857aa8b0229f/images/1.png
--------------------------------------------------------------------------------
/images/SimpleNotepad.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhongyang219/SimpleNotePad/c06d48ba612acfc51e4e515098da857aa8b0229f/images/SimpleNotepad.png
--------------------------------------------------------------------------------
/lib/tinyxml2.lib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhongyang219/SimpleNotePad/c06d48ba612acfc51e4e515098da857aa8b0229f/lib/tinyxml2.lib
--------------------------------------------------------------------------------
/lib/tinyxml2d.lib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhongyang219/SimpleNotePad/c06d48ba612acfc51e4e515098da857aa8b0229f/lib/tinyxml2d.lib
--------------------------------------------------------------------------------
/lib/x64/tinyxml2.lib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhongyang219/SimpleNotePad/c06d48ba612acfc51e4e515098da857aa8b0229f/lib/x64/tinyxml2.lib
--------------------------------------------------------------------------------
/lib/x64/tinyxml2d.lib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhongyang219/SimpleNotePad/c06d48ba612acfc51e4e515098da857aa8b0229f/lib/x64/tinyxml2d.lib
--------------------------------------------------------------------------------
/scintilla/.hg_archival.txt:
--------------------------------------------------------------------------------
1 | repo: bdf8c3ef2fb01ea24578e726337888e706d10b92
2 | node: 1fd979759d49a05ab9514f267469694112d35547
3 | branch: default
4 | latesttag: rel-4-4-6
5 | latesttagdistance: 1
6 | changessincelatesttag: 1
7 |
--------------------------------------------------------------------------------
/scintilla/.hgeol:
--------------------------------------------------------------------------------
1 | [patterns]
2 | **.cxx = native
3 | **.cpp = native
4 | **.c = native
5 | **.h = native
6 | **.m = native
7 | **.mm = native
8 | **.iface = native
9 | **.template = native
10 | **.mk = native
11 | **.py = native
12 | **.rc = native
13 | **.html = native
14 | **.bat = native
15 | **.mak = native
16 | **.def = native
17 | **.manifest = native
18 | **.properties = native
19 | **.styled = native
20 | **.asp = native
21 | **.php = native
22 | **.vb = native
23 | **.d = native
24 | **.lua = native
25 | **.nim = native
26 | **.pl = native
27 | **.p6 = native
28 | **.rb = native
29 | **.tcl = native
30 | **.err = native
31 | **.mms = native
32 | **.tex = native
33 | **.txt = native
34 | **.pch = native
35 | **.hgeol = native
36 | **.dsp = native
37 | **.sln = native
38 | **.vcproj = native
39 | **.pro = native
40 | **.gen = native
41 | **makefile = native
42 | README = native
43 | **.bmp = BIN
44 | **.cur = BIN
45 | **.ico = BIN
46 | **.jpg = BIN
47 | **.png = BIN
48 | tgzsrc = LF
49 |
--------------------------------------------------------------------------------
/scintilla/.hgignore:
--------------------------------------------------------------------------------
1 | syntax: glob
2 | *.o
3 | *.a
4 | *.asm
5 | *.lib
6 | *.obj
7 | *.iobj
8 | __pycache__
9 | *.pyc
10 | *.dll
11 | *.so
12 | *.dylib
13 | *.framework
14 | *.pyd
15 | *.exe
16 | *.exp
17 | *.lib
18 | *.pdb
19 | *.ipdb
20 | *.res
21 | *.bak
22 | *.sbr
23 | *.suo
24 | *.aps
25 | *.sln
26 | *.vcxproj.*
27 | *.idb
28 | *.bsc
29 | *.intermediate.manifest
30 | *.lastbuildstate
31 | *.cache
32 | *.ilk
33 | *.ncb
34 | *.tlog
35 | *.sdf
36 | gtk/*.plist
37 | win32/*.plist
38 | *.opt
39 | *.plg
40 | *.pbxbtree
41 | *.mode1v3
42 | *.pbxuser
43 | *.pbproj
44 | *.log
45 | *.xcbkptlist
46 | *.xcuserstate
47 | xcuserdata/
48 | *.xcsettings
49 | xcschememanagement.plist
50 | .DS_Store
51 | Debug
52 | cocoa/build
53 | cocoa/ScintillaFramework/build
54 | cocoa/ScintillaTest/build
55 | macosx/SciTest/build
56 | *.cppcheck
57 | Makefile.Debug
58 | Makefile.Release
59 | *_resource.rc
60 | moc_*
61 | *.pro.user
62 | .qmake.stash
63 | ScintillaEdit.cpp
64 | ScintillaEdit.h
65 | ScintillaConstants.py
66 | ScintillaEditBase.intermediate.manifest
67 | ScintillaEdit.intermediate.manifest
68 | qt/*/Makefile
69 | cov-int
70 | .vs
71 | meson-private
72 | meson-logs
73 | build.ninja
74 | .ninja*
75 | compile_commands.json
76 |
--------------------------------------------------------------------------------
/scintilla/CONTRIBUTING:
--------------------------------------------------------------------------------
1 | Fixes should be posted to the Bug Tracker
2 | http://sourceforge.net/p/scintilla/bugs/
3 |
4 | Features should be posted to the Feature Request Tracker
5 | http://sourceforge.net/p/scintilla/feature-requests/
6 |
7 | Either send unified diffs (or patch files) or zip archives with whole files.
8 | Mercurial patch files are best as they include author information and commit
9 | messages.
10 |
11 | Questions should go to the scintilla-interest mailing list
12 | https://groups.google.com/forum/#!forum/scintilla-interest
13 |
14 | Code should follow the guidelines at
15 | http://www.scintilla.org/SciCoding.html
16 |
17 | Do not use SourceForge's Merge Request mechanism or message sending
18 | feature as no one is monitoring these.
19 | The neilh @ scintilla.org account receives much spam and is only checked
20 | occasionally. Almost all Scintilla mail should go to the mailing list.
--------------------------------------------------------------------------------
/scintilla/License.txt:
--------------------------------------------------------------------------------
1 | License for Scintilla and SciTE
2 |
3 | Copyright 1998-2003 by Neil Hodgson
4 |
5 | All Rights Reserved
6 |
7 | Permission to use, copy, modify, and distribute this software and its
8 | documentation for any purpose and without fee is hereby granted,
9 | provided that the above copyright notice appear in all copies and that
10 | both that copyright notice and this permission notice appear in
11 | supporting documentation.
12 |
13 | NEIL HODGSON DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
14 | SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
15 | AND FITNESS, IN NO EVENT SHALL NEIL HODGSON BE LIABLE FOR ANY
16 | SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
17 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
18 | WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
19 | TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE
20 | OR PERFORMANCE OF THIS SOFTWARE.
--------------------------------------------------------------------------------
/scintilla/cocoa/InfoBar.h:
--------------------------------------------------------------------------------
1 |
2 | /**
3 | * Scintilla source code edit control
4 | * @file InfoBar.h - Implements special info bar with zoom info, caret position etc. to be used with
5 | * ScintillaView.
6 | *
7 | * Mike Lischke
8 | *
9 | * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
10 | * This file is dual licensed under LGPL v2.1 and the Scintilla license (http://www.scintilla.org/License.txt).
11 | */
12 |
13 | #import
14 | #import "InfoBarCommunicator.h"
15 |
16 | /**
17 | * Extended text cell for vertically aligned text.
18 | */
19 | @interface VerticallyCenteredTextFieldCell : NSTextFieldCell {
20 | BOOL mIsEditingOrSelecting;
21 | }
22 |
23 | @end
24 |
25 | @interface InfoBar : NSView {
26 | @private
27 | NSImage *mBackground;
28 | IBDisplay mDisplayMask;
29 |
30 | float mScaleFactor;
31 | NSPopUpButton *mZoomPopup;
32 |
33 | int mCurrentCaretX;
34 | int mCurrentCaretY;
35 | NSTextField *mCaretPositionLabel;
36 | NSTextField *mStatusTextLabel;
37 |
38 | id mCallback;
39 | }
40 |
41 | - (void) notify: (NotificationType) type message: (NSString *) message location: (NSPoint) location
42 | value: (float) value;
43 | - (void) setCallback: (id ) callback;
44 |
45 | - (void) createItems;
46 | - (void) positionSubViews;
47 | - (void) setDisplay: (IBDisplay) display;
48 | - (void) zoomItemAction: (id) sender;
49 | - (void) setScaleFactor: (float) newScaleFactor adjustPopup: (BOOL) flag;
50 | - (void) setCaretPosition: (NSPoint) position;
51 | - (void) sizeToFit;
52 |
53 | @end
54 |
--------------------------------------------------------------------------------
/scintilla/cocoa/InfoBarCommunicator.h:
--------------------------------------------------------------------------------
1 | /*
2 | * InfoBarCommunicator.h - Definitions of a communication protocol and other data types used for
3 | * the info bar implementation.
4 | *
5 | * Mike Lischke
6 | *
7 | * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
8 | * This file is dual licensed under LGPL v2.1 and the Scintilla license (http://www.scintilla.org/License.txt).
9 | */
10 |
11 | typedef NS_OPTIONS(NSUInteger, IBDisplay) {
12 | IBShowZoom = 0x01,
13 | IBShowCaretPosition = 0x02,
14 | IBShowStatusText = 0x04,
15 | IBShowAll = 0xFF
16 | };
17 |
18 | /**
19 | * The info bar communicator protocol is used for communication between ScintillaView and its
20 | * information bar component. Using this protocol decouples any potential info target from the main
21 | * ScintillaView implementation. The protocol is used two-way.
22 | */
23 |
24 | typedef NS_ENUM(NSInteger, NotificationType) {
25 | IBNZoomChanged, // The user selected another zoom value.
26 | IBNCaretChanged, // The caret in the editor changed.
27 | IBNStatusChanged, // The application set a new status message.
28 | };
29 |
30 | @protocol InfoBarCommunicator
31 | - (void) notify: (NotificationType) type message: (NSString *) message location: (NSPoint) location
32 | value: (float) value;
33 | - (void) setCallback: (id ) callback;
34 | @end
35 |
36 |
--------------------------------------------------------------------------------
/scintilla/cocoa/Scintilla/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | $(PRODUCT_BUNDLE_PACKAGE_TYPE)
17 | CFBundleShortVersionString
18 | 4.4.6
19 | CFBundleVersion
20 | $(CURRENT_PROJECT_VERSION)
21 | NSHumanReadableCopyright
22 | Copyright © 2020 Neil Hodgson. All rights reserved.
23 |
24 |
25 |
--------------------------------------------------------------------------------
/scintilla/cocoa/Scintilla/Scintilla.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/scintilla/cocoa/Scintilla/Scintilla.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/scintilla/cocoa/Scintilla/module.modulemap:
--------------------------------------------------------------------------------
1 | framework module Scintilla {
2 | umbrella header "ScintillaView.h"
3 | module InfoBar {
4 | header "InfoBar.h"
5 | }
6 | // ILexer.h is not included as Swift doesn't yet interoperate with C++
7 | exclude header "ILexer.h"
8 | export *
9 | module * { export * }
10 | }
11 |
--------------------------------------------------------------------------------
/scintilla/cocoa/ScintillaFramework/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | English
7 | CFBundleExecutable
8 | ${EXECUTABLE_NAME}
9 | CFBundleIconFile
10 |
11 | CFBundleIdentifier
12 | $(PRODUCT_BUNDLE_IDENTIFIER)
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | ${PRODUCT_NAME}
17 | CFBundlePackageType
18 | FMWK
19 | CFBundleShortVersionString
20 | 4.4.6
21 | CFBundleSignature
22 | ????
23 | CFBundleVersion
24 | 4.4.6
25 | NSPrincipalClass
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/scintilla/cocoa/ScintillaFramework/ScintillaFramework.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/scintilla/cocoa/ScintillaFramework/ScintillaFramework.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/scintilla/cocoa/ScintillaFramework/en.lproj/InfoPlist.strings:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhongyang219/SimpleNotePad/c06d48ba612acfc51e4e515098da857aa8b0229f/scintilla/cocoa/ScintillaFramework/en.lproj/InfoPlist.strings
--------------------------------------------------------------------------------
/scintilla/cocoa/ScintillaFramework/module.modulemap:
--------------------------------------------------------------------------------
1 | framework module Scintilla {
2 | umbrella header "ScintillaView.h"
3 | module InfoBar {
4 | header "InfoBar.h"
5 | }
6 | // ILexer.h is not included as Swift doesn't yet interoperate with C++
7 | exclude header "ILexer.h"
8 | export *
9 | module * { export * }
10 | }
11 |
--------------------------------------------------------------------------------
/scintilla/cocoa/ScintillaTest/AppController.h:
--------------------------------------------------------------------------------
1 | /**
2 | * AppController.h
3 | * SciTest
4 | *
5 | * Created by Mike Lischke on 01.04.09.
6 | * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
7 | * This file is dual licensed under LGPL v2.1 and the Scintilla license (http://www.scintilla.org/License.txt).
8 | */
9 |
10 | #import
11 |
12 | #import "Scintilla/ScintillaView.h"
13 | #import "Scintilla/InfoBar.h"
14 |
15 | @interface AppController : NSObject {
16 | IBOutlet NSBox *mEditHost;
17 | ScintillaView* mEditor;
18 | ScintillaView* sciExtra; // For testing Scintilla tear-down
19 | }
20 |
21 | - (void) awakeFromNib;
22 | - (void) setupEditor;
23 | - (IBAction) searchText: (id) sender;
24 | - (IBAction) addRemoveExtra: (id) sender;
25 |
26 | @end
27 |
--------------------------------------------------------------------------------
/scintilla/cocoa/ScintillaTest/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | English
7 | CFBundleExecutable
8 | ${EXECUTABLE_NAME}
9 | CFBundleIconFile
10 |
11 | CFBundleIdentifier
12 | $(PRODUCT_BUNDLE_IDENTIFIER)
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | ${PRODUCT_NAME}
17 | CFBundlePackageType
18 | APPL
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1.0
23 | NSMainNibFile
24 | MainMenu
25 | NSPrincipalClass
26 | NSApplication
27 |
28 |
29 |
--------------------------------------------------------------------------------
/scintilla/cocoa/ScintillaTest/Scintilla-Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | English
7 | CFBundleExecutable
8 | ${EXECUTABLE_NAME}
9 | CFBundleIdentifier
10 | com.sun.${PRODUCT_NAME:identifier}
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundlePackageType
14 | FMWK
15 | CFBundleSignature
16 | ????
17 | CFBundleVersion
18 | 1.0
19 |
20 |
21 |
--------------------------------------------------------------------------------
/scintilla/cocoa/ScintillaTest/ScintillaTest.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/scintilla/cocoa/ScintillaTest/ScintillaTest.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/scintilla/cocoa/ScintillaTest/en.lproj/InfoPlist.strings:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhongyang219/SimpleNotePad/c06d48ba612acfc51e4e515098da857aa8b0229f/scintilla/cocoa/ScintillaTest/en.lproj/InfoPlist.strings
--------------------------------------------------------------------------------
/scintilla/cocoa/ScintillaTest/main.m:
--------------------------------------------------------------------------------
1 | /**
2 | * main.m
3 | * ScintillaTest
4 | *
5 | * Created by Mike Lischke on 02.04.09.
6 | * Copyright Sun Microsystems, Inc 2009. All rights reserved.
7 | * This file is dual licensed under LGPL v2.1 and the Scintilla license (http://www.scintilla.org/License.txt).
8 | */
9 |
10 | #import
11 |
12 | int main(int argc, char *argv[])
13 | {
14 | return NSApplicationMain(argc, (const char **) argv);
15 | }
16 |
--------------------------------------------------------------------------------
/scintilla/cocoa/checkbuildosx.sh:
--------------------------------------------------------------------------------
1 | # Script to build Scintilla for OS X with most supported build files.
2 | # Current directory should be scintilla/cocoa before running.
3 |
4 | cd ../..
5 |
6 | # ************************************************************
7 | # Target 1: Unit tests
8 |
9 | echo Unit tests
10 |
11 | cd scintilla/test/unit
12 | make clean
13 | make test
14 | cd ../../..
15 |
16 | # ************************************************************
17 | # Target 2: build framework and test app with Xcode targeting OS X 10.n with n from 9 to 5
18 | # Only SDK versions that are installed will be built
19 | # Clean both then build both -- if perform clean in ScintillaTest, also cleans ScintillaFramework
20 | # which can cause double build
21 |
22 | echo Building Cocoa-native ScintillaFramework and ScintillaTest
23 | for sdk in macosx10.15 macosx10.14
24 | do
25 | xcodebuild -showsdks | grep $sdk
26 | if [ "$(xcodebuild -showsdks | grep $sdk)" != "" ]
27 | then
28 | echo Building with $sdk
29 | cd scintilla/cocoa/ScintillaFramework
30 | xcodebuild clean
31 | cd ../ScintillaTest
32 | xcodebuild clean
33 | cd ../ScintillaFramework
34 | xcodebuild -sdk $sdk
35 | cd ../ScintillaTest
36 | xcodebuild -sdk $sdk
37 | cd ../../..
38 | else
39 | echo Warning $sdk not available
40 | fi
41 | done
42 |
43 | # ************************************************************
44 | # Target 3: Qt builds
45 | # Requires Qt development libraries and qmake to be installed
46 |
47 | echo Building Qt and PySide
48 |
49 | cd scintilla/qt
50 | cd ScintillaEditBase
51 | qmake -spec macx-xcode
52 | xcodebuild clean
53 | xcodebuild
54 | cd ..
55 |
56 | cd ScintillaEdit
57 | python3 WidgetGen.py
58 | qmake -spec macx-xcode
59 | xcodebuild clean
60 | xcodebuild
61 | cd ..
62 |
63 | cd ScintillaEditPy
64 | python2 sepbuild.py
65 | cd ..
66 | cd ../..
67 |
--------------------------------------------------------------------------------
/scintilla/cocoa/res/info_bar_bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhongyang219/SimpleNotePad/c06d48ba612acfc51e4e515098da857aa8b0229f/scintilla/cocoa/res/info_bar_bg.png
--------------------------------------------------------------------------------
/scintilla/cocoa/res/info_bar_bg@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhongyang219/SimpleNotePad/c06d48ba612acfc51e4e515098da857aa8b0229f/scintilla/cocoa/res/info_bar_bg@2x.png
--------------------------------------------------------------------------------
/scintilla/cocoa/res/mac_cursor_busy.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhongyang219/SimpleNotePad/c06d48ba612acfc51e4e515098da857aa8b0229f/scintilla/cocoa/res/mac_cursor_busy.png
--------------------------------------------------------------------------------
/scintilla/cocoa/res/mac_cursor_busy@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhongyang219/SimpleNotePad/c06d48ba612acfc51e4e515098da857aa8b0229f/scintilla/cocoa/res/mac_cursor_busy@2x.png
--------------------------------------------------------------------------------
/scintilla/cocoa/res/mac_cursor_flipped.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhongyang219/SimpleNotePad/c06d48ba612acfc51e4e515098da857aa8b0229f/scintilla/cocoa/res/mac_cursor_flipped.png
--------------------------------------------------------------------------------
/scintilla/cocoa/res/mac_cursor_flipped@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhongyang219/SimpleNotePad/c06d48ba612acfc51e4e515098da857aa8b0229f/scintilla/cocoa/res/mac_cursor_flipped@2x.png
--------------------------------------------------------------------------------
/scintilla/delbin.bat:
--------------------------------------------------------------------------------
1 | @del /S /Q *.a *.aps *.bsc *.dll *.dsw *.exe *.idb *.ilc *.ild *.ilf *.ilk *.ils *.lib *.map *.ncb *.obj *.o *.opt *.ipdb *.pdb *.plg *.res *.sbr *.tds *.exp *.tlog >NUL:
2 |
--------------------------------------------------------------------------------
/scintilla/doc/AddSource.txt:
--------------------------------------------------------------------------------
1 | Some of the build files adapt to adding and removing source code files but most
2 | must be modified by hand. Here is a list of directories and the build files that
3 | must be modified or possibly need to be modified.
4 | The Cocoa project.pbxproj file is complex and should be modified with Xcode.
5 | The other build files can be edited manually.
6 |
7 | src:
8 | cocoa/ScintillaFramework/ScintillaFramework.xcodeproj/project.pbxproj
9 | gtk/makefile
10 | qt/ScintillaEdit/ScintillaEdit.pro
11 | qt/ScintillaEditBase/ScintillaEditBase.pro
12 | win32/makefile
13 | win32/scintilla.mak
14 | -- possibly:
15 | test/unit/makefile
16 | test/unit/test.mak
17 |
18 | cocoa:
19 | cocoa/ScintillaFramework/ScintillaFramework.xcodeproj/project.pbxproj
20 |
21 | gtk:
22 | gtk/makefile
23 |
24 | qt:
25 | qt/ScintillaEdit/ScintillaEdit.pro
26 | qt/ScintillaEditBase/ScintillaEditBase.pro
27 |
28 | win32:
29 | win32/makefile
30 | win32/scintilla.mak
31 |
--------------------------------------------------------------------------------
/scintilla/doc/Indicators.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhongyang219/SimpleNotePad/c06d48ba612acfc51e4e515098da857aa8b0229f/scintilla/doc/Indicators.png
--------------------------------------------------------------------------------
/scintilla/doc/Markers.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhongyang219/SimpleNotePad/c06d48ba612acfc51e4e515098da857aa8b0229f/scintilla/doc/Markers.png
--------------------------------------------------------------------------------
/scintilla/doc/SciBreak.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhongyang219/SimpleNotePad/c06d48ba612acfc51e4e515098da857aa8b0229f/scintilla/doc/SciBreak.jpg
--------------------------------------------------------------------------------
/scintilla/doc/SciRest.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhongyang219/SimpleNotePad/c06d48ba612acfc51e4e515098da857aa8b0229f/scintilla/doc/SciRest.jpg
--------------------------------------------------------------------------------
/scintilla/doc/SciTEIco.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhongyang219/SimpleNotePad/c06d48ba612acfc51e4e515098da857aa8b0229f/scintilla/doc/SciTEIco.png
--------------------------------------------------------------------------------
/scintilla/doc/SciWord.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhongyang219/SimpleNotePad/c06d48ba612acfc51e4e515098da857aa8b0229f/scintilla/doc/SciWord.jpg
--------------------------------------------------------------------------------
/scintilla/doc/annotations.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhongyang219/SimpleNotePad/c06d48ba612acfc51e4e515098da857aa8b0229f/scintilla/doc/annotations.png
--------------------------------------------------------------------------------
/scintilla/doc/eolannotation.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhongyang219/SimpleNotePad/c06d48ba612acfc51e4e515098da857aa8b0229f/scintilla/doc/eolannotation.png
--------------------------------------------------------------------------------
/scintilla/doc/styledmargin.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhongyang219/SimpleNotePad/c06d48ba612acfc51e4e515098da857aa8b0229f/scintilla/doc/styledmargin.png
--------------------------------------------------------------------------------
/scintilla/gtk/DepGen.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 | # DepGen.py - produce a make dependencies file for Scintilla
3 | # Copyright 2019 by Neil Hodgson
4 | # The License.txt file describes the conditions under which this software may be distributed.
5 | # Requires Python 3.6 or later
6 |
7 | import sys
8 |
9 | sys.path.append("..")
10 |
11 | from scripts import Dependencies
12 |
13 | topComment = "# Created by DepGen.py. To recreate, run DepGen.py.\n"
14 |
15 | def Generate():
16 | sources = ["../src/*.cxx", "../lexlib/*.cxx", "../lexers/*.cxx"]
17 | includes = ["../include", "../src", "../lexlib"]
18 |
19 | deps = Dependencies.FindDependencies(["../gtk/*.cxx"] + sources, ["../gtk"] + includes, ".o", "../gtk/")
20 | Dependencies.UpdateDependencies("../gtk/deps.mak", deps, topComment)
21 |
22 | if __name__ == "__main__":
23 | Generate()
--------------------------------------------------------------------------------
/scintilla/gtk/scintilla-marshal.h:
--------------------------------------------------------------------------------
1 | /* This file is generated, all changes will be lost */
2 | #ifndef __SCINTILLA_MARSHAL_MARSHAL_H__
3 | #define __SCINTILLA_MARSHAL_MARSHAL_H__
4 |
5 | #include
6 |
7 | G_BEGIN_DECLS
8 |
9 | /* VOID:INT,OBJECT (scintilla-marshal.list:1) */
10 | extern
11 | void scintilla_marshal_VOID__INT_OBJECT (GClosure *closure,
12 | GValue *return_value,
13 | guint n_param_values,
14 | const GValue *param_values,
15 | gpointer invocation_hint,
16 | gpointer marshal_data);
17 |
18 | /* VOID:INT,BOXED (scintilla-marshal.list:2) */
19 | extern
20 | void scintilla_marshal_VOID__INT_BOXED (GClosure *closure,
21 | GValue *return_value,
22 | guint n_param_values,
23 | const GValue *param_values,
24 | gpointer invocation_hint,
25 | gpointer marshal_data);
26 |
27 |
28 | G_END_DECLS
29 |
30 | #endif /* __SCINTILLA_MARSHAL_MARSHAL_H__ */
31 |
--------------------------------------------------------------------------------
/scintilla/gtk/scintilla-marshal.list:
--------------------------------------------------------------------------------
1 | VOID:INT,OBJECT
2 | VOID:INT,BOXED
3 |
--------------------------------------------------------------------------------
/scintilla/include/ILoader.h:
--------------------------------------------------------------------------------
1 | // Scintilla source code edit control
2 | /** @file ILoader.h
3 | ** Interface for loading into a Scintilla document from a background thread.
4 | **/
5 | // Copyright 1998-2017 by Neil Hodgson
6 | // The License.txt file describes the conditions under which this software may be distributed.
7 |
8 | #ifndef ILOADER_H
9 | #define ILOADER_H
10 |
11 | #include "Sci_Position.h"
12 |
13 | class ILoader {
14 | public:
15 | virtual int SCI_METHOD Release() = 0;
16 | // Returns a status code from SC_STATUS_*
17 | virtual int SCI_METHOD AddData(const char *data, Sci_Position length) = 0;
18 | virtual void * SCI_METHOD ConvertToDocument() = 0;
19 | };
20 |
21 | #endif
22 |
--------------------------------------------------------------------------------
/scintilla/include/Sci_Position.h:
--------------------------------------------------------------------------------
1 | // Scintilla source code edit control
2 | /** @file Sci_Position.h
3 | ** Define the Sci_Position type used in Scintilla's external interfaces.
4 | ** These need to be available to clients written in C so are not in a C++ namespace.
5 | **/
6 | // Copyright 2015 by Neil Hodgson
7 | // The License.txt file describes the conditions under which this software may be distributed.
8 |
9 | #ifndef SCI_POSITION_H
10 | #define SCI_POSITION_H
11 |
12 | #include
13 |
14 | // Basic signed type used throughout interface
15 | typedef ptrdiff_t Sci_Position;
16 |
17 | // Unsigned variant used for ILexer::Lex and ILexer::Fold
18 | typedef size_t Sci_PositionU;
19 |
20 | // For Sci_CharacterRange which is defined as long to be compatible with Win32 CHARRANGE
21 | typedef long Sci_PositionCR;
22 |
23 | #ifdef _WIN32
24 | #define SCI_METHOD __stdcall
25 | #else
26 | #define SCI_METHOD
27 | #endif
28 |
29 | #endif
30 |
--------------------------------------------------------------------------------
/scintilla/lexers/LexNull.cxx:
--------------------------------------------------------------------------------
1 | // Scintilla source code edit control
2 | /** @file LexNull.cxx
3 | ** Lexer for no language. Used for plain text and unrecognized files.
4 | **/
5 | // Copyright 1998-2001 by Neil Hodgson
6 | // The License.txt file describes the conditions under which this software may be distributed.
7 |
8 | #include
9 | #include
10 | #include
11 | #include
12 | #include
13 | #include
14 |
15 | #include "ILexer.h"
16 | #include "Scintilla.h"
17 | #include "SciLexer.h"
18 |
19 | #include "WordList.h"
20 | #include "LexAccessor.h"
21 | #include "Accessor.h"
22 | #include "StyleContext.h"
23 | #include "CharacterSet.h"
24 | #include "LexerModule.h"
25 |
26 | using namespace Scintilla;
27 |
28 | static void ColouriseNullDoc(Sci_PositionU startPos, Sci_Position length, int, WordList *[],
29 | Accessor &styler) {
30 | // Null language means all style bytes are 0 so just mark the end - no need to fill in.
31 | if (length > 0) {
32 | styler.StartAt(startPos + length - 1);
33 | styler.StartSegment(startPos + length - 1);
34 | styler.ColourTo(startPos + length - 1, 0);
35 | }
36 | }
37 |
38 | LexerModule lmNull(SCLEX_NULL, ColouriseNullDoc, "null");
39 |
--------------------------------------------------------------------------------
/scintilla/lexilla/scripts/RunTest.bat:
--------------------------------------------------------------------------------
1 | rem Test lexers
2 | rem build lexilla.dll and TestLexers.exe then run TestLexers.exe
3 | cd ../src
4 | make
5 | cd ../test
6 | make
7 | make test
8 |
--------------------------------------------------------------------------------
/scintilla/lexilla/scripts/RunTest.sh:
--------------------------------------------------------------------------------
1 | # Test lexers
2 | # build lexilla.so and TestLexers then run TestLexers
3 | cd ../src
4 | make
5 | cd ../test
6 | make
7 | make test
8 |
--------------------------------------------------------------------------------
/scintilla/lexilla/src/DepGen.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 | # DepGen.py - produce a make dependencies file for Scintilla
3 | # Copyright 2019 by Neil Hodgson
4 | # The License.txt file describes the conditions under which this software may be distributed.
5 | # Requires Python 3.6 or later
6 |
7 | import os, sys
8 |
9 | sys.path.append(os.path.join("..", ".."))
10 |
11 | from scripts import Dependencies
12 |
13 | topComment = "# Created by DepGen.py. To recreate, run DepGen.py.\n"
14 |
15 | def Generate():
16 | scintilla = os.path.join("..", "..")
17 | lexilla = os.path.join(scintilla, "lexilla")
18 | sources = [
19 | os.path.join(lexilla, "src", "Lexilla.cxx"),
20 | os.path.join(scintilla, "lexlib", "*.cxx"),
21 | os.path.join(scintilla, "lexers", "*.cxx")]
22 | includes = [
23 | os.path.join(scintilla, "include"),
24 | os.path.join(scintilla, "src"),
25 | os.path.join(scintilla, "lexlib")]
26 |
27 | # Create the dependencies file for g++
28 | deps = Dependencies.FindDependencies(sources, includes, ".o", "../lexilla/")
29 |
30 | Dependencies.UpdateDependencies(os.path.join(lexilla, "src", "deps.mak"), deps, topComment)
31 |
32 | # Create the dependencies file for MSVC
33 |
34 | # Place the objects in $(DIR_O) and change extension from ".o" to ".obj"
35 | deps = [["$(DIR_O)/"+Dependencies.PathStem(obj)+".obj", headers] for obj, headers in deps]
36 |
37 | Dependencies.UpdateDependencies(os.path.join(lexilla, "src", "nmdeps.mak"), deps, topComment)
38 |
39 | if __name__ == "__main__":
40 | Generate()
--------------------------------------------------------------------------------
/scintilla/lexilla/src/Lexilla.def:
--------------------------------------------------------------------------------
1 | EXPORTS
2 | GetLexerCount
3 | GetLexerName
4 | GetLexerFactory
5 | CreateLexer
6 |
--------------------------------------------------------------------------------
/scintilla/lexilla/src/Lexilla.h:
--------------------------------------------------------------------------------
1 | // Scintilla source code edit control
2 | /** @file Lexilla.h
3 | ** Lexer infrastructure.
4 | ** Declare functions in Lexilla library.
5 | **/
6 | // Copyright 2019 by Neil Hodgson
7 | // The License.txt file describes the conditions under which this software may be distributed.
8 |
9 | #if _WIN32
10 | #define LEXILLA_CALLING_CONVENTION __stdcall
11 | #else
12 | #define LEXILLA_CALLING_CONVENTION
13 | #endif
14 |
15 | extern "C" {
16 |
17 | Scintilla::ILexer5 * LEXILLA_CALLING_CONVENTION CreateLexer(const char *name);
18 |
19 | }
20 |
--------------------------------------------------------------------------------
/scintilla/lexilla/src/Lexilla/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | $(PRODUCT_BUNDLE_PACKAGE_TYPE)
17 | CFBundleShortVersionString
18 | 4.4.6
19 | CFBundleVersion
20 | $(CURRENT_PROJECT_VERSION)
21 | NSHumanReadableCopyright
22 | Copyright © 2020 Neil Hodgson. All rights reserved.
23 |
24 |
25 |
--------------------------------------------------------------------------------
/scintilla/lexilla/src/Lexilla/Lexilla.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/scintilla/lexilla/src/Lexilla/Lexilla.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/scintilla/lexilla/src/LexillaVersion.rc:
--------------------------------------------------------------------------------
1 | // Resource file for Lexilla - provides a version number
2 | // Copyright 2020 by Neil Hodgson
3 | // The License.txt file describes the conditions under which this software may be distributed.
4 |
5 | #include
6 |
7 | #define VERSION_LEXILLA "4.4.6"
8 | #define VERSION_WORDS 4, 4, 6, 0
9 |
10 | VS_VERSION_INFO VERSIONINFO
11 | FILEVERSION VERSION_WORDS
12 | PRODUCTVERSION VERSION_WORDS
13 | FILEFLAGSMASK 0x3fL
14 | FILEFLAGS 0
15 | FILEOS VOS_NT_WINDOWS32
16 | FILETYPE VFT_APP
17 | FILESUBTYPE VFT2_UNKNOWN
18 | BEGIN
19 | BLOCK "VarFileInfo"
20 | BEGIN
21 | VALUE "Translation", 0x409, 1200
22 | END
23 | BLOCK "StringFileInfo"
24 | BEGIN
25 | BLOCK "040904b0"
26 | BEGIN
27 | VALUE "CompanyName", "Neil Hodgson neilh@scintilla.org\0"
28 | VALUE "FileDescription", "Lexilla.DLL - a Lexical Analysis Component\0"
29 | VALUE "FileVersion", VERSION_LEXILLA "\0"
30 | VALUE "InternalName", "Lexilla\0"
31 | VALUE "LegalCopyright", "Copyright 2019 by Neil Hodgson\0"
32 | VALUE "OriginalFilename", "Lexilla.DLL\0"
33 | VALUE "ProductName", "Lexilla\0"
34 | VALUE "ProductVersion", VERSION_LEXILLA "\0"
35 | END
36 | END
37 | END
38 |
--------------------------------------------------------------------------------
/scintilla/lexilla/src/README:
--------------------------------------------------------------------------------
1 | README for Lexilla library.
2 |
3 | The Lexilla library contains a set of lexers and folders that provides support for
4 | programming, mark-up, and data languages for the Scintilla source code editing
5 | component.
6 |
7 | Lexilla is made available as both a shared library and static library.
8 | The shared library is called liblexilla.so / liblexilla.dylib / lexilla.dll on Linux / macOS /
9 | Windows.
10 | The static library is called liblexilla.a when built with GCC or Clang and liblexilla.lib
11 | when built with MSVC.
12 |
13 | Lexilla is developed on Windows, Linux, and macOS and requires a C++17 compiler.
14 | It may work on other Unix platforms like BSD but that is not a development focus.
15 | MSVC 2019.4, GCC 9.0, Clang 9.0, and Apple Clang 11.0 are known to work.
16 |
17 | MSVC is only available on Windows.
18 |
19 | GCC and Clang work on Windows and Linux.
20 |
21 | On macOS, only Apple Clang is available.
22 |
23 | To use GCC, run lexilla/src/makefile:
24 | make
25 |
26 | To use Clang, run lexilla/test/makefile:
27 | make CLANG=1
28 | On macOS, CLANG is set automatically so this can just be
29 | make
30 |
31 | To use MSVC, run lexilla/test/lexilla.mak:
32 | nmake -f lexilla.mak
33 |
34 | To build a debugging version of the library, add DEBUG=1 to the command:
35 | make DEBUG=1
36 |
37 | The built libraries are copied into scintilla/bin.
38 |
39 | Lexilla relies on a list of lexers from the scintilla/lexers directory. If any changes are
40 | made to the set of lexers then source and build files can be regenerated with the
41 | lexilla/scripts/LexillaGen.py script which requires Python 3 and is tested with 3.7+.
42 | Unix:
43 | python3 LexillaGen.py
44 | Windows:
45 | pyw LexillaGen.py
46 |
--------------------------------------------------------------------------------
/scintilla/lexilla/test/LexillaAccess.h:
--------------------------------------------------------------------------------
1 | // Scintilla source code edit control
2 | /** @file LexillaAccess.h
3 | ** Interface to Lexilla shared library.
4 | **/
5 | // Copyright 2019 by Neil Hodgson
6 | // The License.txt file describes the conditions under which this software may be distributed.
7 |
8 | Scintilla::ILexer5 *CreateLexer(std::string languageName);
9 | bool LoadLexilla(std::filesystem::path path);
10 |
--------------------------------------------------------------------------------
/scintilla/lexilla/test/examples/batch/SciTE.properties:
--------------------------------------------------------------------------------
1 | lexer.*.bat=batch
2 | keywords.*.bat=call defined do echo else errorlevel exist exit for goto if in not set
3 |
4 |
--------------------------------------------------------------------------------
/scintilla/lexilla/test/examples/batch/x.bat:
--------------------------------------------------------------------------------
1 | rem comment=1
2 | rem 'echo' is word=2, 'a' is default=0
3 | echo a
4 | rem label=3
5 | :START
6 | rem '@' is hide=4
7 | @echo b
8 | rem 'gcc' is external command=5
9 | gcc --version
10 | rem '%PATH%' is variable=6
11 | echo %PATH%
12 | echo %ProgramFiles(x86)%
13 | rem operator=7 '='
14 | @set Q=A
15 |
16 | ::comment=1
17 |
18 | :: Bug 1624: this construct produced inconsistent brackets in the past
19 | if ERRORLEVEL 2 goto END
20 | @if exist a (
21 | echo exists
22 | ) else (
23 | echo not
24 | )
25 |
26 | FOR /L %%G IN (2,1,4) DO (echo %%G)
27 |
28 | :: Bug 1997: keywords not recognized when preceded by '('
29 | IF NOT DEFINED var (SET var=1)
30 |
31 | :: Bug 2065: keywords not recognized when followed by ')'
32 | @if exist a ( exit)
33 |
34 | :: Bug: with \r or \n, 'command' is seen as continuation
35 | echo word ^
36 | 1
37 | command
38 |
39 | :END
40 |
--------------------------------------------------------------------------------
/scintilla/lexilla/test/examples/batch/x.bat.styled:
--------------------------------------------------------------------------------
1 | {1}rem comment=1
2 | rem 'echo' is word=2, 'a' is default=0
3 | {2}echo{0} a
4 | {1}rem label=3
5 | {3}:START
6 | {1}rem '@' is hide=4
7 | {4}@{2}echo{0} b
8 | {1}rem 'gcc' is external command=5
9 | {5}gcc{0} --version
10 | {1}rem '%PATH%' is variable=6
11 | {2}echo{0} {6}%PATH%{0}
12 | {2}echo{0} {6}%ProgramFiles(x86)%{0}
13 | {1}rem operator=7 '='
14 | {4}@{2}set{0} Q{7}={0}A
15 |
16 | {1}::comment=1
17 | {0}
18 | {1}:: Bug 1624: this construct produced inconsistent brackets in the past
19 | {2}if ERRORLEVEL{0} 2{2} goto{0} END
20 | {4}@{2}if exist{0} a (
21 | {2}echo{0} exists
22 | ){2} else{0} (
23 | {2}echo{0} not
24 | )
25 |
26 | {2}FOR{0} /L {6}%%G{2} IN{0} (2,1,4){2} DO{0} ({2}echo{0} {6}%%G{0})
27 |
28 | {1}:: Bug 1997: keywords not recognized when preceded by '('
29 | {2}IF NOT DEFINED{0} var ({2}SET{0} var{7}={0}1)
30 |
31 | {1}:: Bug 2065: keywords not recognized when followed by ')'
32 | {4}@{2}if exist{0} a ({2} exit{0})
33 |
34 | {1}:: Bug: with \r or \n, 'command' is seen as continuation
35 | {2}echo{0} word ^
36 | 1
37 | {5}command{0}
38 |
39 | {3}:END
40 |
--------------------------------------------------------------------------------
/scintilla/lexilla/test/examples/cpp/SciTE.properties:
--------------------------------------------------------------------------------
1 | lexer.*.cxx=cpp
2 | keywords.*.cxx=int let
3 | keywords2.*.cxx=
4 | lexer.cpp.track.preprocessor=1
5 | lexer.cpp.escape.sequence=1
6 |
--------------------------------------------------------------------------------
/scintilla/lexilla/test/examples/cpp/x.cxx:
--------------------------------------------------------------------------------
1 | // A demonstration program
2 | #include
3 | #if 0 /* */
4 | #define DUMMY() \
5 | if (1);
6 | #endif
7 |
8 | #define M\
9 |
10 | \
11 |
12 | int main() {
13 | double x[] = {3.14159,6.02e23,1.6e-19,1.0+1};
14 | int y[] = {75,0113,0x4b};
15 | printf("hello world %d %g\n", y[0], x[0]);
16 |
17 | // JavaScript regular expression (14) tests
18 | let a = /a/;
19 | let b = /[a-z]+/gi;
20 |
21 | // Escape sequence (27) tests
22 | printf("\'\"\?\\\a\b\f\n\r\t\v \P");
23 | printf("\0a \013a \019");
24 | printf("\x013ac \xdz");
25 | printf("\ua34df \uz");
26 | printf("\Ua34df7833 \Uz");
27 | }
28 |
--------------------------------------------------------------------------------
/scintilla/lexilla/test/examples/cpp/x.cxx.styled:
--------------------------------------------------------------------------------
1 | {2}// A demonstration program
2 | {9}#include
3 | #if 0 {23}/* */{9}
4 | {73}#define DUMMY() \
5 | if (1);
6 | {9}#endif
7 | {0}
8 | {9}#define M\
9 |
10 | {0}\
11 |
12 | {5}int{0} {11}main{10}(){0} {10}{{0}
13 | {11}double{0} {11}x{10}[]{0} {10}={0} {10}{{4}3.14159{10},{4}6.02e23{10},{4}1.6e-19{10},{4}1.0{10}+{4}1{10}};{0}
14 | {5}int{0} {11}y{10}[]{0} {10}={0} {10}{{4}75{10},{4}0113{10},{4}0x4b{10}};{0}
15 | {11}printf{10}({6}"hello world %d %g{27}\n{6}"{10},{0} {11}y{10}[{4}0{10}],{0} {11}x{10}[{4}0{10}]);{0}
16 |
17 | {2}// JavaScript regular expression (14) tests
18 | {0} {5}let{0} {11}a{0} {10}={0} {14}/a/{10};{0}
19 | {5}let{0} {11}b{0} {10}={0} {14}/[a-z]+/gi{10};{0}
20 |
21 | {2}// Escape sequence (27) tests
22 | {0} {11}printf{10}({6}"{27}\'\"\?\\\a\b\f\n\r\t\v{6} {27}\P{6}"{10});{0}
23 | {11}printf{10}({6}"{27}\0{6}a {27}\013{6}a {27}\01{6}9"{10});{0}
24 | {11}printf{10}({6}"{27}\x013a{6}c {27}\xd{6}z"{10});{0}
25 | {11}printf{10}({6}"{27}\ua34d{6}f {27}\u{6}z"{10});{0}
26 | {11}printf{10}({6}"{27}\Ua34df783{6}3 {27}\U{6}z"{10});{0}
27 | {10}}{0}
28 |
--------------------------------------------------------------------------------
/scintilla/lexilla/test/examples/d/SciTE.properties:
--------------------------------------------------------------------------------
1 | lexer.*.d=d
2 | keywords.*.d=keyword1
3 | keywords2.*.d=keyword2
4 | keywords3.*.d=
5 | keywords4.*.d=keyword4
6 | keywords5.*.d=keyword5
7 | keywords6.*.d=keyword6
8 | keywords7.*.d=keyword7
9 |
10 |
--------------------------------------------------------------------------------
/scintilla/lexilla/test/examples/d/x.d:
--------------------------------------------------------------------------------
1 | $
2 | // /++ +/ doccomments are not yet supported
3 | /* */
4 | /** */
5 | /// drdr
6 | /+ /+ +/ +/
7 | //keyword test
8 | keyword1
9 | keyword2
10 | keyword4
11 | keyword5
12 | keyword6
13 | keyword7
14 | //unicode identifier test
15 | вапёasdÓΘΣαԷԸՑהכ拉麺とひシマイ단결을
16 | //strings test
17 | 's
18 | '
19 | w's'w
20 | "multiline
21 | string"w
22 | e"zz"e
23 | r"asd\"e
24 | r"multiline
25 | string"c
26 | r`asd\`e
27 | `multiline
28 | string`d
29 | x"023 abc"e
30 | x"023
31 | abc"w
32 | //numbers test
33 | a[3..4]=3
34 | 2.stringof
35 | 2.0.stringof
36 | 2.
37 | 2.2e+2
38 | 2.2e-2
39 | .2e+2
40 | .2
41 | 2e+2
42 | 0x2e+2
43 | 0x2ep+10
44 | ,.2.stringof,
45 |
46 | end
47 |
48 |
--------------------------------------------------------------------------------
/scintilla/lexilla/test/examples/d/x.d.styled:
--------------------------------------------------------------------------------
1 | {14}${0}
2 | {2}// /++ +/ doccomments are not yet supported
3 | {1}/* */{0}
4 | {3}/** */{0}
5 | {15}/// drdr
6 | {4}/+ /+ +/ +/{0}
7 | {2}//keyword test
8 | {6}keyword1{0}
9 | {7}keyword2{0}
10 | {9}keyword4{0}
11 | {20}keyword5{0}
12 | {21}keyword6{0}
13 | {22}keyword7{0}
14 | {2}//unicode identifier test
15 | {14}вапёasdÓΘΣαԷԸՑהכ拉麺とひシマイ단결을{0}
16 | {2}//strings test
17 | {11}'s
18 | '
19 | {14}w{12}'s'{14}w{0}
20 | {10}"multiline
21 | string"w{0}
22 | {14}e{10}"zz"{14}e{0}
23 | {19}r"asd\"{14}e{0}
24 | {19}r"multiline
25 | string"c{0}
26 | {14}r{18}`asd\`{14}e{0}
27 | {18}`multiline
28 | string`d{0}
29 | {19}x"023 abc"{14}e{0}
30 | {19}x"023
31 | abc"w{0}
32 | {2}//numbers test
33 | {14}a{13}[{5}3{13}..{5}4{13}]={5}3{0}
34 | {5}2.stringof{0}
35 | {5}2.0{13}.{14}stringof{0}
36 | {5}2.{0}
37 | {5}2.2e+2{0}
38 | {5}2.2e-2{0}
39 | {5}.2e+2{0}
40 | {5}.2{0}
41 | {5}2e+2{0}
42 | {5}0x2e{13}+{5}2{0}
43 | {5}0x2ep+10{0}
44 | {13},{5}.2{13}.{14}stringof{13},{0}
45 |
46 | {14}end{0}
47 |
48 |
--------------------------------------------------------------------------------
/scintilla/lexilla/test/examples/errorlist/SciTE.properties:
--------------------------------------------------------------------------------
1 | lexer.*.err=errorlist
2 | lexer.errorlist.value.separate=1
3 | lexer.errorlist.escape.sequences=1
4 | style.errorlist.23=fore:#000000,back:#FFFFFF,$(error.background)
5 | style.errorlist.25=fore:#CF008F,$(font.monospace.small)
6 |
--------------------------------------------------------------------------------
/scintilla/lexilla/test/examples/hypertext/SciTE.properties:
--------------------------------------------------------------------------------
1 | lexer.*=hypertext
2 | keywords.*=b body content head href html link meta \
3 | name rel script strong title type xmlns
4 | keywords2.*=function
5 | keywords3.*=sub
6 |
7 |
--------------------------------------------------------------------------------
/scintilla/lexilla/test/examples/hypertext/apostophe.php:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/scintilla/lexilla/test/examples/hypertext/apostophe.php.styled:
--------------------------------------------------------------------------------
1 | {18}
10 |
11 |
12 |
--------------------------------------------------------------------------------
/scintilla/lexilla/test/examples/hypertext/x.asp:
--------------------------------------------------------------------------------
1 | <%@language=javas%>
2 | <%
3 | #include
4 | function x() {
5 | }
6 | %>
7 | <%@language=vbscript%>
8 | <%
9 | sub x 'comment
10 | %>
11 |
12 |
13 |
--------------------------------------------------------------------------------
/scintilla/lexilla/test/examples/hypertext/x.asp.styled:
--------------------------------------------------------------------------------
1 | {15}<%@{16}language=javas{15}%>{0}
2 | {15}<%{56}
3 | #{61}include{56}
4 | {62}function{56} {61}x{65}(){56} {65}{{56}
5 | {65}}{56}
6 | {15}%>{0}
7 | {15}<%@{16}language=vbscript{15}%>{0}
8 | {15}<%{81}
9 | {84}sub{81} {86}x{81} {82}'comment {81}
10 | {15}%>{0}
11 | {1}{0}
12 | {1}{0}
13 |
--------------------------------------------------------------------------------
/scintilla/lexilla/test/examples/hypertext/x.html:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 | SinkWorld - Portability
10 | SinkWorld - Portability
11 |
12 |
13 |
--------------------------------------------------------------------------------
/scintilla/lexilla/test/examples/hypertext/x.html.styled:
--------------------------------------------------------------------------------
1 | {1}{0}
2 | {1}{0}
7 | {1}{0}
8 | {1}{0}
9 | {1}{0}SinkWorld - Portability{1}{0}
10 | {2}{0}SinkWorld - Portability{2}{0}
11 | {1}{0}
12 | {1}{0}
13 |
--------------------------------------------------------------------------------
/scintilla/lexilla/test/examples/hypertext/x.php:
--------------------------------------------------------------------------------
1 |
2 | \n";
4 | /* ?> */
5 | ?>
6 | forif
7 |
--------------------------------------------------------------------------------
/scintilla/lexilla/test/examples/hypertext/x.php.styled:
--------------------------------------------------------------------------------
1 | {1}{0} {9}{0}
2 | {18}\n"{127};{118}
4 | {124}/* ?> */{118}
5 | {18}?>{0}
6 | {1}{0}for{1}{0}if{1}{0}
7 |
--------------------------------------------------------------------------------
/scintilla/lexilla/test/examples/latex/AllStyles.tex:
--------------------------------------------------------------------------------
1 | % Enumerate all styles: 0 to 12
2 | % Not a valid laTeX file as entities are unbalanced and not semantically correct
3 | % comment=4
4 |
5 | % whitespace=0
6 | text %
7 |
8 | % command=1
9 | \documentclass
10 |
11 | % tag=2
12 | \begin{document}
13 |
14 | % tag closing=5
15 | \end{document}
16 |
17 | % math=3
18 | \begin{math}
19 | E &= mc^2
20 | \end{math}
21 |
22 | % math block=6
23 | \begin{align}
24 | E &= mc^2
25 | \end{align}
26 |
27 | % comment block=7
28 | \begin{comment}
29 | A block comment
30 | \end{comment}
31 |
32 | % verbatim=8
33 | \begin{verbatim}
34 | puts $foo
35 | \end{verbatim}
36 |
37 | % short command=9
38 | \(\)
39 |
40 | % special=10
41 | \#
42 |
43 | % command optional argument=11
44 | \x[12pt]
45 |
46 | % error=12
47 | \
48 |
--------------------------------------------------------------------------------
/scintilla/lexilla/test/examples/latex/AllStyles.tex.styled:
--------------------------------------------------------------------------------
1 | {4}% Enumerate all styles: 0 to 12{0}
2 | {4}% Not a valid laTeX file as entities are unbalanced and not semantically correct{0}
3 | {4}% comment=4{0}
4 |
5 | {4}% whitespace=0{0}
6 | text {4}%{0}
7 |
8 | {4}% command=1{0}
9 | {1}\documentclass{0}
10 |
11 | {4}% tag=2{0}
12 | {1}\begin{2}{document}{0}
13 |
14 | {4}% tag closing=5{0}
15 | {1}\end{5}{document}{0}
16 |
17 | {4}% math=3{0}
18 | {1}\begin{2}{math}{3}
19 | E &= mc^2
20 | {1}\end{5}{math}{0}
21 |
22 | {4}% math block=6{0}
23 | {1}\begin{2}{align}{6}
24 | E &= mc^2
25 | {1}\end{5}{align}{0}
26 |
27 | {4}% comment block=7{0}
28 | {1}\begin{2}{comment}{7}
29 | A block comment
30 | {1}\end{5}{comment}{0}
31 |
32 | {4}% verbatim=8{0}
33 | {1}\begin{2}{verbatim}{8}
34 | puts $foo
35 | {1}\end{5}{verbatim}{0}
36 |
37 | {4}% short command=9{0}
38 | {9}\(\){0}
39 |
40 | {4}% special=10{0}
41 | {10}\#{0}
42 |
43 | {4}% command optional argument=11{0}
44 | {1}\x{11}[12pt]{0}
45 |
46 | {4}% error=12{0}
47 | {12}\{0}
48 |
--------------------------------------------------------------------------------
/scintilla/lexilla/test/examples/latex/Feature1358.tex:
--------------------------------------------------------------------------------
1 | \begin{lstlisting}[language=make]
2 | # If no BOARD is found in the environment, use this default:
3 | BOARD ?= bluepill
4 |
5 | # To use chinese st-link v2 and ch340 dongle with bluepill
6 | ifeq ($(BOARD),bluepill)
7 | STLINK_VERSION=2
8 | PORT_LINUX=/dev/ttyUSB0
9 | endif
10 | \end{lstlisting}
11 |
--------------------------------------------------------------------------------
/scintilla/lexilla/test/examples/latex/Feature1358.tex.styled:
--------------------------------------------------------------------------------
1 | {1}\begin{2}{lstlisting}{8}[language=make]
2 | # If no BOARD is found in the environment, use this default:
3 | BOARD ?= bluepill
4 |
5 | # To use chinese st-link v2 and ch340 dongle with bluepill
6 | ifeq ($(BOARD),bluepill)
7 | STLINK_VERSION=2
8 | PORT_LINUX=/dev/ttyUSB0
9 | endif
10 | {1}\end{5}{lstlisting}{0}
11 |
--------------------------------------------------------------------------------
/scintilla/lexilla/test/examples/latex/SciTE.properties:
--------------------------------------------------------------------------------
1 | lexer.*.tex=latex
2 |
--------------------------------------------------------------------------------
/scintilla/lexilla/test/examples/lua/SciTE.properties:
--------------------------------------------------------------------------------
1 | lexer.*.lua=lua
2 | keywords.*.lua=function end
3 |
--------------------------------------------------------------------------------
/scintilla/lexilla/test/examples/lua/x.lua:
--------------------------------------------------------------------------------
1 | --[[ coding:UTF-8
2 | comment ]]
3 | function first()
4 | ::開::
5 | -- Comment
6 | func(SCI_ANNOTATIONSETTEXT, 'a', 0, "LINE1")
7 | end
8 |
--------------------------------------------------------------------------------
/scintilla/lexilla/test/examples/lua/x.lua.styled:
--------------------------------------------------------------------------------
1 | {1}--[[ coding:UTF-8
2 | comment ]]{0}
3 | {5}function{0} {11}first{10}(){0}
4 | {20}::開::{0}
5 | {2}-- Comment
6 | {0} {11}func{10}({11}SCI_ANNOTATIONSETTEXT{10},{0} {7}'a'{10},{0} {4}0{10},{0} {6}"LINE1"{10}){0}
7 | {5}end{0}
8 |
--------------------------------------------------------------------------------
/scintilla/lexilla/test/examples/makefile/SciTE.properties:
--------------------------------------------------------------------------------
1 | lexer.*.mak=makefile
2 |
--------------------------------------------------------------------------------
/scintilla/lexilla/test/examples/makefile/x.mak:
--------------------------------------------------------------------------------
1 | # '# comment' comment=1
2 | # comment
3 |
4 | # '.SUFFIXES' target=5, ':' operator=4
5 | .SUFFIXES:
6 |
7 | # 'LD' identifier=3, '=' operator=4, 'link' default=0
8 | LD=link
9 |
10 | # '!IFDEF DEBUG' preprocessor=2
11 | !IFDEF DEBUG
12 |
13 | # '$(' ID EOL=9
14 | X=$(
15 |
16 | # End of file
17 |
--------------------------------------------------------------------------------
/scintilla/lexilla/test/examples/makefile/x.mak.styled:
--------------------------------------------------------------------------------
1 | {1}# '# comment' comment=1
2 | # comment
3 | {0}
4 | {1}# '.SUFFIXES' target=5, ':' operator=4
5 | {5}.SUFFIXES{4}:{0}
6 |
7 | {1}# 'LD' identifier=3, '=' operator=4, 'link' default=0
8 | {3}LD{4}={0}link
9 |
10 | {1}# '!IFDEF DEBUG' preprocessor=2
11 | {2}!IFDEF DEBUG
12 | {0}
13 | {1}# '$(' ID EOL=9
14 | {3}X{4}={9}$(
15 | {0}
16 | {1}# End of file
17 |
--------------------------------------------------------------------------------
/scintilla/lexilla/test/examples/mmixal/AllStyles.mms:
--------------------------------------------------------------------------------
1 | % Demonstrate each possible style. Does not make sense as code.
2 |
3 | % A comment 1
4 | % Comment
5 |
6 |
7 | % Whitespace 0
8 |
9 |
10 |
11 | % Label 2
12 | label
13 |
14 |
15 | % Not Validated Opcode 3 appears to always validate to either 5 or 6
16 | % so is never seen on screen.
17 |
18 |
19 | % Division between Label and Opcode 4
20 | la
21 |
22 |
23 | % Valid Opcode 5
24 | TRAP
25 |
26 |
27 | % Invalid Opcode 6
28 | UNKNOWN
29 |
30 |
31 | % Division between Opcode and Operands 7
32 | LOC
33 |
34 |
35 | % Division of Operands 8
36 | LOC 0.
37 |
38 |
39 | % Number 9
40 | BYTE 0
41 |
42 |
43 | % Reference 10
44 | JMP @label
45 |
46 |
47 | % Char 11
48 | BYTE 'a'
49 |
50 |
51 | % String 12
52 | BYTE "Hello, world!"
53 |
54 |
55 | % Register 13
56 | BYTE rA
57 |
58 |
59 | % Hexadecimal Number 14
60 | BYTE #FF
61 |
62 |
63 | % Operator 15
64 | BYTE +
65 |
66 |
67 | % Symbol 16
68 | TRAP Fputs
69 |
70 |
71 | % Preprocessor 17
72 | @include a.mms
73 |
74 |
75 |
--------------------------------------------------------------------------------
/scintilla/lexilla/test/examples/mmixal/AllStyles.mms.styled:
--------------------------------------------------------------------------------
1 | {1}% Demonstrate each possible style. Does not make sense as code.
2 | {0}
3 | {1}% A comment 1
4 | % Comment
5 | {0}
6 |
7 | {1}% Whitespace 0
8 | {0}
9 |
10 |
11 | {1}% Label 2
12 | {2}label{4}
13 | {0}
14 |
15 | {1}% Not Validated Opcode 3 appears to always validate to either 5 or 6
16 | % so is never seen on screen.
17 | {0}
18 |
19 | {1}% Division between Label and Opcode 4
20 | {2}la{4}
21 | {0}
22 |
23 | {1}% Valid Opcode 5
24 | {0} {5}TRAP{7}
25 | {0}
26 |
27 | {1}% Invalid Opcode 6
28 | {0} {6}UNKNOWN{7}
29 | {0}
30 |
31 | {1}% Division between Opcode and Operands 7
32 | {0} {5}LOC{7}
33 | {0}
34 |
35 | {1}% Division of Operands 8
36 | {0} {5}LOC{7} {9}0{8}.{1}
37 | {0}
38 |
39 | {1}% Number 9
40 | {0} {5}BYTE{7} {9}0{1}
41 | {0}
42 |
43 | {1}% Reference 10
44 | {0} {5}JMP{7} {10}@label{1}
45 | {0}
46 |
47 | {1}% Char 11
48 | {0} {5}BYTE{7} {11}'a'{1}
49 | {0}
50 |
51 | {1}% String 12
52 | {0} {5}BYTE{7} {12}"Hello, world!"{1}
53 | {0}
54 |
55 | {1}% Register 13
56 | {0} {5}BYTE{7} {13}rA{1}
57 | {0}
58 |
59 | {1}% Hexadecimal Number 14
60 | {0} {5}BYTE{7} {14}#FF{1}
61 | {0}
62 |
63 | {1}% Operator 15
64 | {0} {5}BYTE{7} {15}+{1}
65 | {0}
66 |
67 | {1}% Symbol 16
68 | {0} {5}TRAP{7} {16}Fputs{1}
69 | {0}
70 |
71 | {1}% Preprocessor 17
72 | {17}@include a.mms
73 | {0}
74 |
75 |
--------------------------------------------------------------------------------
/scintilla/lexilla/test/examples/mmixal/SciTE.properties:
--------------------------------------------------------------------------------
1 | lexer.*.mms=mmixal
2 | keywords.*.mms=BYTE GETA JMP LOC PREFIX TRAP
3 | keywords2.*.mms=rA
4 | keywords3.*.mms=Fputs StdOut
5 |
--------------------------------------------------------------------------------
/scintilla/lexilla/test/examples/mmixal/references.mms:
--------------------------------------------------------------------------------
1 | # Bug #2019 Buffer over-read in MMIXAL lexer
2 | label
3 | PREFIX Foo:
4 | % Relative reference (uses PREFIX)
5 | JMP label
6 | %
7 | JMP @label
8 | % Absolute reference (does not use PREFIX)
9 | JMP :label
10 | % In register list so treated as register
11 | JMP :rA
12 | % Too long for buffer so truncated
13 | JMP l1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
14 | % Too long for buffer so truncated then treated as absolute
15 | JMP :l1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
16 | %
17 |
--------------------------------------------------------------------------------
/scintilla/lexilla/test/examples/mmixal/references.mms.styled:
--------------------------------------------------------------------------------
1 | {1}# Bug #2019 Buffer over-read in MMIXAL lexer
2 | {2}label{4}
3 | {0} {5}PREFIX{7} {10}Foo:{1}
4 | % Relative reference (uses PREFIX)
5 | {0} {5}JMP{7} {10}label{1}
6 | %
7 | {0} {5}JMP{7} {10}@label{1}
8 | % Absolute reference (does not use PREFIX)
9 | {0} {5}JMP{7} {10}:label{1}
10 | % In register list so treated as register
11 | {0} {5}JMP{7} {13}:rA{1}
12 | % Too long for buffer so truncated
13 | {0} {5}JMP{7} {10}l1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890{1}
14 | % Too long for buffer so truncated then treated as absolute
15 | {0} {5}JMP{7} {10}:l1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890{1}
16 | %
17 |
--------------------------------------------------------------------------------
/scintilla/lexilla/test/examples/mmixal/x.mms:
--------------------------------------------------------------------------------
1 | % Some example code
2 |
3 | % Set the address of the program initially to 0x100.
4 | LOC #100
5 |
6 | Main GETA $255,string
7 |
8 | TRAP 0,Fputs,StdOut
9 |
10 | TRAP 0,Halt,0
11 |
12 | string BYTE "Hello, world!",#a,0
13 |
--------------------------------------------------------------------------------
/scintilla/lexilla/test/examples/mmixal/x.mms.styled:
--------------------------------------------------------------------------------
1 | {1}% Some example code
2 | {0}
3 | {1}% Set the address of the program initially to 0x100.
4 | {0} {5}LOC{7} {14}#100{1}
5 | {0}
6 | {2}Main{4} {5}GETA{7} {13}$255{15},{10}string{1}
7 | {0}
8 | {5}TRAP{7} {9}0{15},{16}Fputs{15},{16}StdOut{1}
9 | {0}
10 | {5}TRAP{7} {9}0{15},{10}Halt{15},{9}0{1}
11 | {0}
12 | {2}string{4} {5}BYTE{7} {12}"Hello, world!"{15},{14}#a{15},{9}0{1}
13 |
--------------------------------------------------------------------------------
/scintilla/lexilla/test/examples/nim/SciTE.properties:
--------------------------------------------------------------------------------
1 | lexer.*.nim=nim
2 | keywords.*.nim=else end if let proc
3 |
--------------------------------------------------------------------------------
/scintilla/lexilla/test/examples/nim/x.nim:
--------------------------------------------------------------------------------
1 | # Tests for Nim
2 | let s = "foobar"
3 |
4 | # Feature #1260
5 | {.ident.}
6 | stdin.readLine.split.map(parseInt).max.`$`.echo(" is the maximum!")
7 |
8 | # Feature #1261
9 | # IsFuncName("proc") so style ticks as SCE_NIM_FUNCNAME:
10 | proc `$` (x: myDataType): string = ...
11 | # Style ticks as SCE_NIM_BACKTICKS:
12 | if `==`( `+`(3,4),7): echo "True"
13 |
14 | # Feature #1262
15 | # Standard raw string identifier:
16 | let standardDoubleLitRawStr = R"A raw string\"
17 | let standardTripleLitRawStr = R"""A triple-double raw string\""""
18 | # Style of 'customIdent' is determined by lexer.nim.raw.strings.highlight.ident. 16 if false, 6 or 10 if true
19 | let customDoubleLitRawStr = customIdent"A string\"
20 | let customTripleLitRawStr = customIdent"""A triple-double raw string\""""
21 |
22 | # Feature #1268
23 | 10_000
24 | 10__000
25 | 10_
26 | 1....5
27 | 1.ident
28 | 1._ident
29 |
--------------------------------------------------------------------------------
/scintilla/lexilla/test/examples/nim/x.nim.styled:
--------------------------------------------------------------------------------
1 | {3}# Tests for Nim
2 | {8}let{0} {16}s{0} {15}={0} {6}"foobar"{0}
3 |
4 | {3}# Feature #1260
5 | {15}{.{16}ident{15}.}{0}
6 | {16}stdin{15}.{16}readLine{15}.{16}split{15}.{16}map{15}({16}parseInt{15}).{16}max{15}.{11}`$`{15}.{16}echo{15}({6}" is the maximum!"{15}){0}
7 |
8 | {3}# Feature #1261
9 | # IsFuncName("proc") so style ticks as SCE_NIM_FUNCNAME:
10 | {8}proc{0} {12}`$`{0} {15}({16}x{15}:{0} {16}myDataType{15}):{0} {16}string{0} {15}={0} {15}...{0}
11 | {3}# Style ticks as SCE_NIM_BACKTICKS:
12 | {8}if{0} {11}`==`{15}({0} {11}`+`{15}({5}3{15},{5}4{15}),{5}7{15}):{0} {16}echo{0} {6}"True"{0}
13 |
14 | {3}# Feature #1262
15 | # Standard raw string identifier:
16 | {8}let{0} {16}standardDoubleLitRawStr{0} {15}={0} {6}R"A raw string\"{0}
17 | {8}let{0} {16}standardTripleLitRawStr{0} {15}={0} {10}R"""A triple-double raw string\""""{0}
18 | {3}# Style of 'customIdent' is determined by lexer.nim.raw.strings.highlight.ident. 16 if false, 6 or 10 if true
19 | {8}let{0} {16}customDoubleLitRawStr{0} {15}={0} {16}customIdent{6}"A string\"{0}
20 | {8}let{0} {16}customTripleLitRawStr{0} {15}={0} {16}customIdent{10}"""A triple-double raw string\""""{0}
21 |
22 | {3}# Feature #1268
23 | {5}10_000{0}
24 | {5}10{16}__000{0}
25 | {5}10{16}_{0}
26 | {5}1{15}....{5}5{0}
27 | {5}1{15}.{16}ident{0}
28 | {5}1{15}.{16}_ident{0}
29 |
--------------------------------------------------------------------------------
/scintilla/lexilla/test/examples/perl/SciTE.properties:
--------------------------------------------------------------------------------
1 | lexer.*.pl=perl
2 | keywords.*.pl=\
3 | NULL __FILE__ __LINE__ __PACKAGE__ __DATA__ __END__ AUTOLOAD \
4 | BEGIN CORE DESTROY END EQ GE GT INIT LE LT NE CHECK abs accept \
5 | alarm and atan2 bind binmode bless caller chdir chmod chomp chop \
6 | chown chr chroot close closedir cmp connect continue cos crypt \
7 | dbmclose dbmopen defined delete die do dump each else elsif endgrent \
8 | endhostent endnetent endprotoent endpwent endservent eof eq eval \
9 | exec exists exit exp fcntl fileno flock for foreach fork format \
10 | formline ge getc getgrent getgrgid getgrnam gethostbyaddr gethostbyname \
11 | gethostent getlogin getnetbyaddr getnetbyname getnetent getpeername \
12 | getpgrp getppid getpriority getprotobyname getprotobynumber getprotoent \
13 | getpwent getpwnam getpwuid getservbyname getservbyport getservent \
14 | getsockname getsockopt glob gmtime goto grep gt hex if index \
15 | int ioctl join keys kill last lc lcfirst le length link listen \
16 | local localtime lock log lstat lt map mkdir msgctl msgget msgrcv \
17 | msgsnd my ne next no not oct open opendir or ord our pack package \
18 | pipe pop pos print printf prototype push quotemeta qu \
19 | rand read readdir readline readlink readpipe recv redo \
20 | ref rename require reset return reverse rewinddir rindex rmdir \
21 | scalar seek seekdir select semctl semget semop send setgrent \
22 | sethostent setnetent setpgrp setpriority setprotoent setpwent \
23 | setservent setsockopt shift shmctl shmget shmread shmwrite shutdown \
24 | sin sleep socket socketpair sort splice split sprintf sqrt srand \
25 | stat study sub substr symlink syscall sysopen sysread sysseek \
26 | system syswrite tell telldir tie tied time times truncate \
27 | uc ucfirst umask undef unless unlink unpack unshift untie until \
28 | use utime values vec wait waitpid wantarray warn while write \
29 | xor \
30 | given when default break say state UNITCHECK __SUB__ fc
31 |
32 |
--------------------------------------------------------------------------------
/scintilla/lexilla/test/examples/perl/x.pl:
--------------------------------------------------------------------------------
1 | use strict;
2 | while ( $r ) {
3 | printf ( "Example text \n" );
4 | sleep 1;
5 | }
--------------------------------------------------------------------------------
/scintilla/lexilla/test/examples/perl/x.pl.styled:
--------------------------------------------------------------------------------
1 | {5}use{0} {11}strict{10};{0}
2 | {5}while{0} {10}({0} {12}$r{0} {10}){0} {10}{{0}
3 | {5}printf{0} {10}({0} {6}"Example text \n"{0} {10});{0}
4 | {5}sleep{0} {4}1{10};{0}
5 | {10}}
--------------------------------------------------------------------------------
/scintilla/lexilla/test/examples/python/AllStyles.py:
--------------------------------------------------------------------------------
1 | # Enumerate all styles: 0 to 19
2 | # comment=1
3 |
4 | # whitespace=0
5 | # w
6 |
7 | # number=2
8 | 37
9 |
10 | # double-quoted-string=3
11 | "str"
12 |
13 | # single-quoted-string=4
14 | 'str'
15 |
16 | # keyword=5
17 | pass
18 |
19 | # triple-quoted-string=6
20 | '''str'''
21 |
22 | # triple-double-quoted-string=7
23 | """str"""
24 |
25 | # class-name=8
26 | class ClassName:
27 | pass
28 |
29 | # function-name=9
30 | def function_name():
31 | pass
32 |
33 | # operator=10
34 | 1 + 3
35 |
36 | # identifier=11
37 | identifier = 2
38 |
39 | # comment-block=12
40 | ## block
41 |
42 | # unclosed-string=13
43 | " unclosed
44 |
45 | # highlighted-identifier=14
46 | hilight = 2
47 |
48 | # decorator=15
49 | @staticmethod
50 | def fn(): pass
51 |
52 | a = 1
53 | # double-quoted-f-string=16
54 | f"{a}"
55 |
56 | # single-quoted-f-string=17
57 | f'{a}'
58 |
59 | # triple-quoted-f-string=18
60 | f'''{a}'''
61 |
62 | # double-triple-quoted-f-string=19
63 | f"""{a}"""
64 |
--------------------------------------------------------------------------------
/scintilla/lexilla/test/examples/python/AllStyles.py.styled:
--------------------------------------------------------------------------------
1 | {1}# Enumerate all styles: 0 to 19{0}
2 | {1}# comment=1{0}
3 |
4 | {1}# whitespace=0{0}
5 | {1}# w{0}
6 |
7 | {1}# number=2{0}
8 | {2}37{0}
9 |
10 | {1}# double-quoted-string=3{0}
11 | {3}"str"{0}
12 |
13 | {1}# single-quoted-string=4{0}
14 | {4}'str'{0}
15 |
16 | {1}# keyword=5{0}
17 | {5}pass{0}
18 |
19 | {1}# triple-quoted-string=6{0}
20 | {6}'''str'''{0}
21 |
22 | {1}# triple-double-quoted-string=7{0}
23 | {7}"""str"""{0}
24 |
25 | {1}# class-name=8{0}
26 | {5}class{0} {8}ClassName{10}:{0}
27 | {5}pass{0}
28 |
29 | {1}# function-name=9{0}
30 | {5}def{0} {9}function_name{10}():{0}
31 | {5}pass{0}
32 |
33 | {1}# operator=10{0}
34 | {2}1{0} {10}+{0} {2}3{0}
35 |
36 | {1}# identifier=11{0}
37 | {11}identifier{0} {10}={0} {2}2{0}
38 |
39 | {1}# comment-block=12{0}
40 | {12}## block{0}
41 |
42 | {1}# unclosed-string=13{0}
43 | {13}" unclosed
44 | {0}
45 | {1}# highlighted-identifier=14{0}
46 | {14}hilight{0} {10}={0} {2}2{0}
47 |
48 | {1}# decorator=15{0}
49 | {15}@staticmethod{0}
50 | {5}def{0} {9}fn{10}():{0} {5}pass{0}
51 |
52 | {11}a{0} {10}={0} {2}1{0}
53 | {1}# double-quoted-f-string=16{0}
54 | {16}f"{{11}a{16}}"{0}
55 |
56 | {1}# single-quoted-f-string=17{0}
57 | {17}f'{{11}a{17}}'{0}
58 |
59 | {1}# triple-quoted-f-string=18{0}
60 | {18}f'''{{11}a{18}}'''{0}
61 |
62 | {1}# double-triple-quoted-f-string=19{0}
63 | {19}f"""{{11}a{19}}"""{0}
64 |
--------------------------------------------------------------------------------
/scintilla/lexilla/test/examples/python/SciTE.properties:
--------------------------------------------------------------------------------
1 | lexer.*.py=python
2 | keywords.*.py=class def else for if import in pass print return while with yield
3 | keywords2.*.py=hilight
4 |
--------------------------------------------------------------------------------
/scintilla/lexilla/test/examples/python/x.py:
--------------------------------------------------------------------------------
1 | # Convert all punctuation characters except '_', '*', and '.' into spaces.
2 | def depunctuate(s):
3 | '''A docstring'''
4 | """Docstring 2"""
5 | d = ""
6 | for ch in s:
7 | if ch in 'abcde':
8 | d = d + ch
9 | else:
10 | d = d + " "
11 | return d
12 |
13 | import contextlib
14 |
15 | @contextlib.contextmanager
16 | def singleuse():
17 | print("Before")
18 | yield
19 | with singleuse(): pass
20 |
--------------------------------------------------------------------------------
/scintilla/lexilla/test/examples/python/x.py.styled:
--------------------------------------------------------------------------------
1 | {1}# Convert all punctuation characters except '_', '*', and '.' into spaces.{0}
2 | {5}def{0} {9}depunctuate{10}({11}s{10}):{0}
3 | {6}'''A docstring'''{0}
4 | {7}"""Docstring 2"""{0}
5 | {11}d{0} {10}={0} {3}""{0}
6 | {5}for{0} {11}ch{0} {5}in{0} {11}s{10}:{0}
7 | {5}if{0} {11}ch{0} {5}in{0} {4}'abcde'{10}:{0}
8 | {11}d{0} {10}={0} {11}d{0} {10}+{0} {11}ch{0}
9 | {5}else{10}:{0}
10 | {11}d{0} {10}={0} {11}d{0} {10}+{0} {3}" "{0}
11 | {5}return{0} {11}d{0}
12 |
13 | {5}import{0} {11}contextlib{0}
14 |
15 | {15}@contextlib{10}.{11}contextmanager{0}
16 | {5}def{0} {9}singleuse{10}():{0}
17 | {5}print{10}({3}"Before"{10}){0}
18 | {5}yield{0}
19 | {5}with{0} {11}singleuse{10}():{0} {5}pass{0}
20 |
--------------------------------------------------------------------------------
/scintilla/lexilla/test/examples/raku/x.p6:
--------------------------------------------------------------------------------
1 | use v6;
2 |
3 | # Normal single line comment
4 | my Int $i = 0;
5 | my Rat $r = 3.142;
6 | my Str $s = "Hello, world! \$i == $i and \$r == $r";
7 | say $s;
8 |
9 | #`{{
10 | *** This is a multi-line comment ***
11 | }}
12 |
13 | my @array = #`[[ inline comment ]] ;
14 | my %hash = ( AAA => 1, BBB => 2 );
15 |
16 | say q[This back\slash stays];
17 | say q[This back\\slash stays]; # Identical output
18 | say Q:q!Just a literal "\n" here!;
19 |
20 | =begin pod
21 | POD Documentation...
22 | =end pod
23 |
24 | say qq:to/END/;
25 | A multi-line
26 | string with interpolated vars: $i, $r
27 | END
28 |
29 | sub function {
30 | return q:to/END/;
31 | Here is
32 | some multi-line
33 | string
34 | END
35 | }
36 |
37 | my $func = &function;
38 | say $func();
39 |
40 | grammar Calculator {
41 | token TOP { }
42 | proto rule calc-op {*}
43 | rule calc-op:sym { '+' }
44 | rule calc-op:sym { '-' }
45 | token num { \d+ }
46 | }
47 |
48 | class Calculations {
49 | method TOP ($/) { make $.made; }
50 | method calc-op:sym ($/) { make [+] $; }
51 | method calc-op:sym ($/) { make [-] $; }
52 | }
53 |
54 | say Calculator.parse('2 + 3', actions => Calculations).made;
55 |
--------------------------------------------------------------------------------
/scintilla/lexilla/test/examples/ruby/SciTE.properties:
--------------------------------------------------------------------------------
1 | lexer.*.rb=ruby
2 | keywords.*.rb=class def end
3 |
--------------------------------------------------------------------------------
/scintilla/lexilla/test/examples/ruby/x.rb:
--------------------------------------------------------------------------------
1 | class Demo
2 | def test # A test
3 | i = 1
4 | puts "Example"
5 | end
6 | end
--------------------------------------------------------------------------------
/scintilla/lexilla/test/examples/ruby/x.rb.styled:
--------------------------------------------------------------------------------
1 | {5}class{0} {8}Demo{0}
2 | {5}def{0} {9}test{0} {2}# A test{0}
3 | {11}i{0} {10}={0} {4}1{0}
4 | {11}puts{0} {6}"Example"{0}
5 | {5}end{0}
6 | {5}end
--------------------------------------------------------------------------------
/scintilla/lexilla/test/examples/tcl/SciTE.properties:
--------------------------------------------------------------------------------
1 | lexer.*.tcl=tcl
2 | keywords.*.tcl=proc set socket vwait
3 |
--------------------------------------------------------------------------------
/scintilla/lexilla/test/examples/tcl/x.tcl:
--------------------------------------------------------------------------------
1 | # tcl tests
2 |
3 | #simple example
4 |
5 | proc Echo_Server {port} {
6 | set s [socket -server EchoAccept $port]
7 | vwait forever;
8 | }
9 |
10 | # Bug #1947
11 |
12 | $s($i,"n")
13 | set n $showArray($i,"neighbor")
14 |
--------------------------------------------------------------------------------
/scintilla/lexilla/test/examples/tcl/x.tcl.styled:
--------------------------------------------------------------------------------
1 | {2}# tcl tests
2 | {0}
3 | {2}#simple example
4 | {0}
5 | {12}proc{0} {7}Echo_Server{0} {6}{{7}port{6}}{0} {6}{
6 | {0} {12}set{0} {7}s{0} {6}[{12}socket{0} {10}-server{0} {7}EchoAccept{0} {8}$port{6}]
7 | {0} {12}vwait{0} {7}forever{0};
8 | {6}}
9 | {0}
10 | {2}# Bug #1947
11 | {0}
12 | {8}$s{6}({8}$i{6},{5}"n"{6})
13 | {12}set{0} {7}n{0} {8}$showArray{6}({8}$i{6},{5}"neighbor"{6})
14 |
--------------------------------------------------------------------------------
/scintilla/lexilla/test/examples/vb/SciTE.properties:
--------------------------------------------------------------------------------
1 | lexer.*.vb=vb
2 | keywords.*.vb=as dim or string
3 |
--------------------------------------------------------------------------------
/scintilla/lexilla/test/examples/vb/x.vb:
--------------------------------------------------------------------------------
1 | ' String"
2 | Dim a As String = "hello, world"
3 | Dim b As String = "hello world"
4 | Dim c As String = "Joe said ""Hello"" to me"
5 | Dim d As String = "\\\\server\\share\\file.txt"
6 | ' Character
7 | ""C "c"C "cc"C
8 | ' Date
9 | d = #5/31/1993# or # 01/01/0001 12:00:00AM #
10 | ' Number
11 | 123_456___789
12 | 123_
13 | &b10101_01010
14 |
--------------------------------------------------------------------------------
/scintilla/lexilla/test/examples/vb/x.vb.styled:
--------------------------------------------------------------------------------
1 | {1}' String"
2 | {3}Dim{0} {7}a{0} {3}As{0} {3}String{0} {6}={0} {4}"hello, world"{0}
3 | {3}Dim{0} {7}b{0} {3}As{0} {3}String{0} {6}={0} {4}"hello world"{0}
4 | {3}Dim{0} {7}c{0} {3}As{0} {3}String{0} {6}={0} {4}"Joe said ""Hello"" to me"{0}
5 | {3}Dim{0} {7}d{0} {3}As{0} {3}String{0} {6}={0} {4}"\\\\server\\share\\file.txt"{0}
6 | {1}' Character
7 | {4}""C{0} {4}"c"C{0} {4}"cc"C{0}
8 | {1}' Date
9 | {7}d{0} {6}={0} {8}#5/31/1993#{0} {3}or{0} {8}# 01/01/0001 12:00:00AM #{0}
10 | {1}' Number
11 | {2}123_456___789{0}
12 | {2}123_{0}
13 | {2}&b10101_01010{0}
14 |
--------------------------------------------------------------------------------
/scintilla/lexilla/test/makefile:
--------------------------------------------------------------------------------
1 | # Build all the lexer tests using GNU make and either g++ or Clang
2 | # @file makefile
3 | # Copyright 2019 by Neil Hodgson
4 | # The License.txt file describes the conditions under which this software may be distributed.
5 | # Should be run using mingw32-make on Windows, not nmake
6 | # On Windows g++ is used, on OS X clang, and on Linux g++ is used by default
7 | # but clang can be used by defining CLANG when invoking make
8 | # clang works only with libc++, not libstdc++
9 |
10 | .PHONY: all test clean
11 |
12 | .SUFFIXES: .cxx
13 |
14 | WARNINGS = -Wpedantic -Wall -Wextra
15 |
16 | ifndef windir
17 | LIBS += -ldl
18 | ifeq ($(shell uname),Darwin)
19 | # On macOS always use Clang
20 | CLANG = 1
21 | endif
22 | endif
23 |
24 | EXE = $(if $(windir),TestLexers.exe,TestLexers)
25 |
26 | BASE_FLAGS += --std=c++2a
27 |
28 | ifdef CLANG
29 | CXX = clang++
30 | BASE_FLAGS += -fsanitize=address
31 | endif
32 |
33 | ifdef LEXILLA_STATIC
34 | DEFINES += -D LEXILLA_STATIC
35 | LIBS += ../../bin/liblexilla.a
36 | endif
37 |
38 | ifdef windir
39 | DEL = $(if $(wildcard $(dir $(SHELL))rm.exe), $(dir $(SHELL))rm.exe -f, del /q)
40 | else
41 | DEL = rm -f
42 | endif
43 |
44 | DEFINES += -D$(if $(DEBUG),DEBUG,NDEBUG)
45 | BASE_FLAGS += $(if $(DEBUG),-g,-Os)
46 |
47 | INCLUDES = -I ../../include -I ../src
48 | BASE_FLAGS += $(WARNINGS)
49 |
50 | all: $(EXE)
51 |
52 | test: $(EXE)
53 | ./$(EXE)
54 |
55 | clean:
56 | $(DEL) *.o *.obj $(EXE)
57 |
58 | %.o: %.cxx
59 | $(CXX) $(DEFINES) $(INCLUDES) $(BASE_FLAGS) $(CPPFLAGS) $(CXXFLAGS) -c $< -o $@
60 |
61 | OBJS = TestLexers.o TestDocument.o LexillaAccess.o
62 |
63 | $(EXE): $(OBJS)
64 | $(CXX) $(BASE_FLAGS) $(CPPFLAGS) $(CXXFLAGS) $^ $(LIBS) $(LDLIBS) -o $@
65 |
66 | TestLexers.o: TestLexers.cxx TestDocument.h LexillaAccess.h
67 | TestDocument.o: TestDocument.cxx TestDocument.h
68 | LexillaAccess.o: LexillaAccess.cxx LexillaAccess.h
69 |
--------------------------------------------------------------------------------
/scintilla/lexilla/test/testlexers.mak:
--------------------------------------------------------------------------------
1 | # Build the lexers test with Microsoft Visual C++ using nmake
2 | # Tested with Visual C++ 2019
3 |
4 | DEL = del /q
5 | EXE = TestLexers.exe
6 |
7 | INCLUDEDIRS = -I ../../include -I ../src
8 |
9 | !IFDEF LEXILLA_STATIC
10 | STATIC_FLAG = -D LEXILLA_STATIC
11 | LIBS = ../../bin/liblexilla.lib
12 | !ENDIF
13 |
14 | !IFDEF DEBUG
15 | DEBUG_OPTIONS = -Od -MTd -DDEBUG $(STATIC_FLAG)
16 | !ELSE
17 | DEBUG_OPTIONS=-O1 -MT -DNDEBUG $(STATIC_FLAG) -GL
18 | !ENDIF
19 |
20 | CXXFLAGS = /EHsc /std:c++latest $(DEBUG_OPTIONS) $(INCLUDEDIRS)
21 |
22 | OBJS = TestLexers.obj TestDocument.obj LexillaAccess.obj
23 |
24 | all: $(EXE)
25 |
26 | test: $(EXE)
27 | $(EXE)
28 |
29 | clean:
30 | $(DEL) *.o *.obj *.exe
31 |
32 | $(EXE): $(OBJS) $(LIBS)
33 | $(CXX) $(CXXFLAGS) $(LIBS) /Fe$@ $**
34 |
35 | .cxx.obj::
36 | $(CXX) $(CXXFLAGS) -c $<
37 |
38 | TestLexers.obj: $*.cxx TestDocument.h LexillaAccess.h
39 | TestDocument.obj: $*.cxx $*.h
40 | LexillaAccess.obj: $*.cxx $*.h
41 |
--------------------------------------------------------------------------------
/scintilla/lexilla/version.txt:
--------------------------------------------------------------------------------
1 | 446
2 |
--------------------------------------------------------------------------------
/scintilla/lexlib/Accessor.h:
--------------------------------------------------------------------------------
1 | // Scintilla source code edit control
2 | /** @file Accessor.h
3 | ** Interfaces between Scintilla and lexers.
4 | **/
5 | // Copyright 1998-2010 by Neil Hodgson
6 | // The License.txt file describes the conditions under which this software may be distributed.
7 |
8 | #ifndef ACCESSOR_H
9 | #define ACCESSOR_H
10 |
11 | namespace Scintilla {
12 |
13 | enum { wsSpace=1, wsTab=2, wsSpaceTab=4, wsInconsistent=8 };
14 |
15 | class Accessor;
16 | class WordList;
17 | class PropSetSimple;
18 |
19 | typedef bool (*PFNIsCommentLeader)(Accessor &styler, Sci_Position pos, Sci_Position len);
20 |
21 | class Accessor : public LexAccessor {
22 | public:
23 | PropSetSimple *pprops;
24 | Accessor(IDocument *pAccess_, PropSetSimple *pprops_);
25 | int GetPropertyInt(const char *, int defaultValue=0) const;
26 | int IndentAmount(Sci_Position line, int *flags, PFNIsCommentLeader pfnIsCommentLeader = 0);
27 | };
28 |
29 | }
30 |
31 | #endif
32 |
--------------------------------------------------------------------------------
/scintilla/lexlib/CharacterCategory.h:
--------------------------------------------------------------------------------
1 | // Scintilla source code edit control
2 | /** @file CharacterCategory.h
3 | ** Returns the Unicode general category of a character.
4 | **/
5 | // Copyright 2013 by Neil Hodgson
6 | // The License.txt file describes the conditions under which this software may be distributed.
7 |
8 | #ifndef CHARACTERCATEGORY_H
9 | #define CHARACTERCATEGORY_H
10 |
11 | namespace Scintilla {
12 |
13 | enum CharacterCategory {
14 | ccLu, ccLl, ccLt, ccLm, ccLo,
15 | ccMn, ccMc, ccMe,
16 | ccNd, ccNl, ccNo,
17 | ccPc, ccPd, ccPs, ccPe, ccPi, ccPf, ccPo,
18 | ccSm, ccSc, ccSk, ccSo,
19 | ccZs, ccZl, ccZp,
20 | ccCc, ccCf, ccCs, ccCo, ccCn
21 | };
22 |
23 | CharacterCategory CategoriseCharacter(int character);
24 |
25 | // Common definitions of allowable characters in identifiers from UAX #31.
26 | bool IsIdStart(int character);
27 | bool IsIdContinue(int character);
28 | bool IsXidStart(int character);
29 | bool IsXidContinue(int character);
30 |
31 | class CharacterCategoryMap {
32 | private:
33 | std::vector dense;
34 | public:
35 | CharacterCategoryMap();
36 | CharacterCategory CategoryFor(int character) const {
37 | if (static_cast(character) < dense.size()) {
38 | return static_cast(dense[character]);
39 | } else {
40 | // binary search through ranges
41 | return CategoriseCharacter(character);
42 | }
43 | }
44 | int Size() const noexcept;
45 | void Optimize(int countCharacters);
46 | };
47 |
48 | }
49 |
50 | #endif
51 |
--------------------------------------------------------------------------------
/scintilla/lexlib/CharacterSet.cxx:
--------------------------------------------------------------------------------
1 | // Scintilla source code edit control
2 | /** @file CharacterSet.cxx
3 | ** Simple case functions for ASCII.
4 | ** Lexer infrastructure.
5 | **/
6 | // Copyright 1998-2010 by Neil Hodgson
7 | // The License.txt file describes the conditions under which this software may be distributed.
8 |
9 | #include
10 | #include
11 |
12 | #include "CharacterSet.h"
13 |
14 | using namespace Scintilla;
15 |
16 | namespace Scintilla {
17 |
18 | int CompareCaseInsensitive(const char *a, const char *b) noexcept {
19 | while (*a && *b) {
20 | if (*a != *b) {
21 | const char upperA = MakeUpperCase(*a);
22 | const char upperB = MakeUpperCase(*b);
23 | if (upperA != upperB)
24 | return upperA - upperB;
25 | }
26 | a++;
27 | b++;
28 | }
29 | // Either *a or *b is nul
30 | return *a - *b;
31 | }
32 |
33 | int CompareNCaseInsensitive(const char *a, const char *b, size_t len) noexcept {
34 | while (*a && *b && len) {
35 | if (*a != *b) {
36 | const char upperA = MakeUpperCase(*a);
37 | const char upperB = MakeUpperCase(*b);
38 | if (upperA != upperB)
39 | return upperA - upperB;
40 | }
41 | a++;
42 | b++;
43 | len--;
44 | }
45 | if (len == 0)
46 | return 0;
47 | else
48 | // Either *a or *b is nul
49 | return *a - *b;
50 | }
51 |
52 | }
53 |
--------------------------------------------------------------------------------
/scintilla/lexlib/LexerNoExceptions.h:
--------------------------------------------------------------------------------
1 | // Scintilla source code edit control
2 | /** @file LexerNoExceptions.h
3 | ** A simple lexer with no state.
4 | **/
5 | // Copyright 1998-2010 by Neil Hodgson
6 | // The License.txt file describes the conditions under which this software may be distributed.
7 |
8 | #ifndef LEXERNOEXCEPTIONS_H
9 | #define LEXERNOEXCEPTIONS_H
10 |
11 | namespace Scintilla {
12 |
13 | // A simple lexer with no state
14 | class LexerNoExceptions : public LexerBase {
15 | public:
16 | // TODO Also need to prevent exceptions in constructor and destructor
17 | Sci_Position SCI_METHOD PropertySet(const char *key, const char *val) override;
18 | Sci_Position SCI_METHOD WordListSet(int n, const char *wl) override;
19 | void SCI_METHOD Lex(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle, IDocument *pAccess) override;
20 | void SCI_METHOD Fold(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle, IDocument *) override;
21 |
22 | virtual void Lexer(Sci_PositionU startPos, Sci_Position length, int initStyle, IDocument *pAccess, Accessor &styler) = 0;
23 | virtual void Folder(Sci_PositionU startPos, Sci_Position length, int initStyle, IDocument *pAccess, Accessor &styler) = 0;
24 | };
25 |
26 | }
27 |
28 | #endif
29 |
--------------------------------------------------------------------------------
/scintilla/lexlib/LexerSimple.cxx:
--------------------------------------------------------------------------------
1 | // Scintilla source code edit control
2 | /** @file LexerSimple.cxx
3 | ** A simple lexer with no state.
4 | **/
5 | // Copyright 1998-2010 by Neil Hodgson
6 | // The License.txt file describes the conditions under which this software may be distributed.
7 |
8 | #include
9 | #include
10 |
11 | #include
12 |
13 | #include "ILexer.h"
14 | #include "Scintilla.h"
15 | #include "SciLexer.h"
16 |
17 | #include "PropSetSimple.h"
18 | #include "WordList.h"
19 | #include "LexAccessor.h"
20 | #include "Accessor.h"
21 | #include "LexerModule.h"
22 | #include "LexerBase.h"
23 | #include "LexerSimple.h"
24 |
25 | using namespace Scintilla;
26 |
27 | LexerSimple::LexerSimple(const LexerModule *module_) :
28 | LexerBase(module_->LexClasses(), module_->NamedStyles()),
29 | module(module_) {
30 | for (int wl = 0; wl < module->GetNumWordLists(); wl++) {
31 | if (!wordLists.empty())
32 | wordLists += "\n";
33 | wordLists += module->GetWordListDescription(wl);
34 | }
35 | }
36 |
37 | const char * SCI_METHOD LexerSimple::DescribeWordListSets() {
38 | return wordLists.c_str();
39 | }
40 |
41 | void SCI_METHOD LexerSimple::Lex(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle, IDocument *pAccess) {
42 | Accessor astyler(pAccess, &props);
43 | module->Lex(startPos, lengthDoc, initStyle, keyWordLists, astyler);
44 | astyler.Flush();
45 | }
46 |
47 | void SCI_METHOD LexerSimple::Fold(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle, IDocument *pAccess) {
48 | if (props.GetInt("fold")) {
49 | Accessor astyler(pAccess, &props);
50 | module->Fold(startPos, lengthDoc, initStyle, keyWordLists, astyler);
51 | astyler.Flush();
52 | }
53 | }
54 |
55 | const char * SCI_METHOD LexerSimple::GetName() {
56 | return module->languageName;
57 | }
58 |
59 | int SCI_METHOD LexerSimple::GetIdentifier() {
60 | return module->GetLanguage();
61 | }
62 |
--------------------------------------------------------------------------------
/scintilla/lexlib/LexerSimple.h:
--------------------------------------------------------------------------------
1 | // Scintilla source code edit control
2 | /** @file LexerSimple.h
3 | ** A simple lexer with no state.
4 | **/
5 | // Copyright 1998-2010 by Neil Hodgson
6 | // The License.txt file describes the conditions under which this software may be distributed.
7 |
8 | #ifndef LEXERSIMPLE_H
9 | #define LEXERSIMPLE_H
10 |
11 | namespace Scintilla {
12 |
13 | // A simple lexer with no state
14 | class LexerSimple : public LexerBase {
15 | const LexerModule *module;
16 | std::string wordLists;
17 | public:
18 | explicit LexerSimple(const LexerModule *module_);
19 | const char * SCI_METHOD DescribeWordListSets() override;
20 | void SCI_METHOD Lex(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle, IDocument *pAccess) override;
21 | void SCI_METHOD Fold(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle, IDocument *pAccess) override;
22 | // ILexer5 methods
23 | const char * SCI_METHOD GetName() override;
24 | int SCI_METHOD GetIdentifier() override;
25 | };
26 |
27 | }
28 |
29 | #endif
30 |
--------------------------------------------------------------------------------
/scintilla/lexlib/PropSetSimple.h:
--------------------------------------------------------------------------------
1 | // Scintilla source code edit control
2 | /** @file PropSetSimple.h
3 | ** A basic string to string map.
4 | **/
5 | // Copyright 1998-2009 by Neil Hodgson
6 | // The License.txt file describes the conditions under which this software may be distributed.
7 |
8 | #ifndef PROPSETSIMPLE_H
9 | #define PROPSETSIMPLE_H
10 |
11 | namespace Scintilla {
12 |
13 | class PropSetSimple {
14 | void *impl;
15 | void Set(const char *keyVal);
16 | public:
17 | PropSetSimple();
18 | virtual ~PropSetSimple();
19 | void Set(const char *key, const char *val, size_t lenKey, size_t lenVal);
20 | void SetMultiple(const char *);
21 | const char *Get(const char *key) const;
22 | size_t GetExpanded(const char *key, char *result) const;
23 | int GetInt(const char *key, int defaultValue=0) const;
24 | };
25 |
26 | }
27 |
28 | #endif
29 |
--------------------------------------------------------------------------------
/scintilla/lexlib/StringCopy.h:
--------------------------------------------------------------------------------
1 | // Scintilla source code edit control
2 | /** @file StringCopy.h
3 | ** Safe string copy function which always NUL terminates.
4 | ** ELEMENTS macro for determining array sizes.
5 | **/
6 | // Copyright 2013 by Neil Hodgson
7 | // The License.txt file describes the conditions under which this software may be distributed.
8 |
9 | #ifndef STRINGCOPY_H
10 | #define STRINGCOPY_H
11 |
12 | namespace Scintilla {
13 |
14 | // Safer version of string copy functions like strcpy, wcsncpy, etc.
15 | // Instantiate over fixed length strings of both char and wchar_t.
16 | // May truncate if source doesn't fit into dest with room for NUL.
17 |
18 | template
19 | void StringCopy(T (&dest)[count], const T* source) {
20 | for (size_t i=0; i
6 | // This file is in the public domain.
7 |
8 | #include
9 | #include
10 |
11 | #include "ILexer.h"
12 |
13 | #include "LexAccessor.h"
14 | #include "Accessor.h"
15 | #include "StyleContext.h"
16 | #include "CharacterSet.h"
17 |
18 | using namespace Scintilla;
19 |
20 | bool StyleContext::MatchIgnoreCase(const char *s) {
21 | if (MakeLowerCase(ch) != static_cast(*s))
22 | return false;
23 | s++;
24 | if (MakeLowerCase(chNext) != static_cast(*s))
25 | return false;
26 | s++;
27 | for (int n = 2; *s; n++) {
28 | if (*s !=
29 | MakeLowerCase(styler.SafeGetCharAt(currentPos + n, 0)))
30 | return false;
31 | s++;
32 | }
33 | return true;
34 | }
35 |
36 | static void getRange(Sci_PositionU start,
37 | Sci_PositionU end,
38 | LexAccessor &styler,
39 | char *s,
40 | Sci_PositionU len) {
41 | Sci_PositionU i = 0;
42 | while ((i < end - start + 1) && (i < len-1)) {
43 | s[i] = styler[start + i];
44 | i++;
45 | }
46 | s[i] = '\0';
47 | }
48 |
49 | void StyleContext::GetCurrent(char *s, Sci_PositionU len) {
50 | getRange(styler.GetStartSegment(), currentPos - 1, styler, s, len);
51 | }
52 |
53 | static void getRangeLowered(Sci_PositionU start,
54 | Sci_PositionU end,
55 | LexAccessor &styler,
56 | char *s,
57 | Sci_PositionU len) {
58 | Sci_PositionU i = 0;
59 | while ((i < end - start + 1) && (i < len-1)) {
60 | s[i] = MakeLowerCase(styler[start + i]);
61 | i++;
62 | }
63 | s[i] = '\0';
64 | }
65 |
66 | void StyleContext::GetCurrentLowered(char *s, Sci_PositionU len) {
67 | getRangeLowered(styler.GetStartSegment(), currentPos - 1, styler, s, len);
68 | }
69 |
--------------------------------------------------------------------------------
/scintilla/lexlib/WordList.h:
--------------------------------------------------------------------------------
1 | // Scintilla source code edit control
2 | /** @file WordList.h
3 | ** Hold a list of words.
4 | **/
5 | // Copyright 1998-2010 by Neil Hodgson
6 | // The License.txt file describes the conditions under which this software may be distributed.
7 |
8 | #ifndef WORDLIST_H
9 | #define WORDLIST_H
10 |
11 | namespace Scintilla {
12 |
13 | /**
14 | */
15 | class WordList {
16 | // Each word contains at least one character - a empty word acts as sentinel at the end.
17 | char **words;
18 | char *list;
19 | int len;
20 | bool onlyLineEnds; ///< Delimited by any white space or only line ends
21 | int starts[256];
22 | public:
23 | explicit WordList(bool onlyLineEnds_ = false);
24 | ~WordList();
25 | operator bool() const noexcept;
26 | bool operator!=(const WordList &other) const noexcept;
27 | int Length() const noexcept;
28 | void Clear() noexcept;
29 | bool Set(const char *s);
30 | bool InList(const char *s) const noexcept;
31 | bool InListAbbreviated(const char *s, const char marker) const noexcept;
32 | bool InListAbridged(const char *s, const char marker) const noexcept;
33 | const char *WordAt(int n) const noexcept;
34 | };
35 |
36 | }
37 |
38 | #endif
39 |
--------------------------------------------------------------------------------
/scintilla/qt/README:
--------------------------------------------------------------------------------
1 | README for building of Scintilla on Qt
2 |
3 | There are three different Scintilla libraries that can be produced:
4 |
5 | ScintillaEditBase
6 | A basic widget callable from C++ which is small and can be used just as is
7 | or with higher level functionality added.
8 |
9 | ScintillaEdit
10 | A more complete C++ widget with a method for every Scintilla API and a
11 | secondary API allowing direct access to document objects.
12 |
13 | ScintillaEditPy
14 | A Python callable version of ScintillaEdit using the PySide bindings.
15 |
16 | Building a library
17 |
18 | ScintillaEditBase can be built without performing any generation steps.
19 | The ScintillaEditBase/ScintillaEditBase.pro project can be loaded into
20 | Qt Creator and the "Build All" command performed.
21 | Alternatively, run "qmake" to build make files and then use the platform
22 | make to build. Most commonly, use "make" on Unix and "nmake"
23 | on Windows.
24 |
25 | On Linux, qmake may be called qmake-qt5 or qmake-qt4.
26 |
27 | ScintillaEdit requires a generation command be run first. From the
28 | ScintillaEdit directory:
29 |
30 | python WidgetGen.py
31 |
32 | After the generation command has run, the ScintillaEdit.h and
33 | ScintillaEdit.cpp files will have been populated with the Scintilla API
34 | methods.
35 | To build, use Qt Creator or qmake and make as for ScintillaEditBase.
36 |
37 | ScintillaEditPy is more complex and instructions are found in
38 | ScintillaEditPy/README.
39 |
--------------------------------------------------------------------------------
/scintilla/qt/ScintillaEditBase/Notes.txt:
--------------------------------------------------------------------------------
1 |
2 | Issues with Scintilla for Qt
3 |
4 | Qt reports character descenders are 1 pixel shorter than they really are.
5 | There is a tweak in the code to add a pixel in. This may have to be reviewed for Qt 5.
6 | There's a comment in the Qt code for Windows:
7 | // ### we subtract 1 to even out the historical +1 in QFontMetrics's
8 | // ### height=asc+desc+1 equation. Fix in Qt5.
9 |
10 | The clocks used aren't great. QTime is a time since midnight clock so wraps around and
11 | is only accurate to, at best, milliseconds.
12 |
13 | On OS X drawing text into a pixmap moves it around 1 pixel to the right compared to drawing
14 | it directly onto a window. Buffered drawing turned off by default to avoid this.
15 | Reported as QTBUG-19483.
16 |
17 | Only one QPainter can be active on any widget at a time. Scintilla only draws into one
18 | widget but reenters for measurement.
19 |
--------------------------------------------------------------------------------
/scintilla/qt/ScintillaEditPy/ScintillaConstants.py.template:
--------------------------------------------------------------------------------
1 | # ScintillaConstants.py
2 | # Define all the symbolic constants from Scintilla.iface so Python code can use them
3 | # Copyright (c) 2011 Archaeopteryx Software, Inc. d/b/a Wingware
4 |
5 | # ++Autogenerated -- start of section automatically generated from Scintilla.iface */
6 | # --Autogenerated -- end of section automatically generated from Scintilla.iface */
7 |
--------------------------------------------------------------------------------
/scintilla/qt/ScintillaEditPy/global.h:
--------------------------------------------------------------------------------
1 | #include "pyside_global.h"
2 |
3 | #include "ScintillaEditBase.h"
4 | #include "ScintillaEdit.h"
5 |
--------------------------------------------------------------------------------
/scintilla/scripts/GenerateCharacterCategory.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 | # Script to generate CharacterCategory.cxx from Python's Unicode data
3 | # Should be run rarely when a Python with a new version of Unicode data is available.
4 | # Requires Python 3.3 or later
5 | # Should not be run with old versions of Python.
6 |
7 | import codecs, os, platform, sys, unicodedata
8 |
9 | from FileGenerator import Regenerate
10 |
11 | def findCategories(filename):
12 | with codecs.open(filename, "r", "UTF-8") as infile:
13 | lines = [x.strip() for x in infile.readlines() if "\tcc" in x]
14 | values = "".join(lines).replace(" ","").split(",")
15 | print(values)
16 | return [v[2:] for v in values]
17 |
18 | def updateCharacterCategory(filename):
19 | values = ["// Created with Python %s, Unicode %s" % (
20 | platform.python_version(), unicodedata.unidata_version)]
21 |
22 | startRange = 0
23 | category = unicodedata.category(chr(startRange))
24 | table = []
25 | for ch in range(sys.maxunicode):
26 | uch = chr(ch)
27 | current = unicodedata.category(uch)
28 | if current != category:
29 | value = startRange * 32 + categories.index(category)
30 | table.append(value)
31 | category = current
32 | startRange = ch
33 | value = startRange * 32 + categories.index(category)
34 | table.append(value)
35 |
36 | # the sentinel value is used to simplify CharacterCategoryMap::Optimize()
37 | category = 'Cn'
38 | value = (sys.maxunicode + 1)*32 + categories.index(category)
39 | table.append(value)
40 |
41 | values.extend(["%d," % value for value in table])
42 |
43 | Regenerate(filename, "//", values)
44 |
45 | categories = findCategories("../lexlib/CharacterCategory.h")
46 |
47 | updateCharacterCategory("../lexlib/CharacterCategory.cxx")
48 |
--------------------------------------------------------------------------------
/scintilla/scripts/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhongyang219/SimpleNotePad/c06d48ba612acfc51e4e515098da857aa8b0229f/scintilla/scripts/__init__.py
--------------------------------------------------------------------------------
/scintilla/scripts/archive.sh:
--------------------------------------------------------------------------------
1 | # Up to parent directory of scintilla
2 | cd ../..
3 |
4 | # Archive Scintilla to scintilla.tgz
5 | hg archive --repository scintilla scintilla.tgz
6 |
--------------------------------------------------------------------------------
/scintilla/src/CaseConvert.h:
--------------------------------------------------------------------------------
1 | // Scintilla source code edit control
2 | // Encoding: UTF-8
3 | /** @file CaseConvert.h
4 | ** Performs Unicode case conversions.
5 | ** Does not handle locale-sensitive case conversion.
6 | **/
7 | // Copyright 2013 by Neil Hodgson
8 | // The License.txt file describes the conditions under which this software may be distributed.
9 |
10 | #ifndef CASECONVERT_H
11 | #define CASECONVERT_H
12 |
13 | namespace Scintilla {
14 |
15 | enum CaseConversion {
16 | CaseConversionFold,
17 | CaseConversionUpper,
18 | CaseConversionLower
19 | };
20 |
21 | class ICaseConverter {
22 | public:
23 | virtual size_t CaseConvertString(char *converted, size_t sizeConverted, const char *mixed, size_t lenMixed) = 0;
24 | };
25 |
26 | ICaseConverter *ConverterFor(enum CaseConversion conversion);
27 |
28 | // Returns a UTF-8 string. Empty when no conversion
29 | const char *CaseConvert(int character, enum CaseConversion conversion);
30 |
31 | // When performing CaseConvertString, the converted value may be up to 3 times longer than the input.
32 | // Ligatures are often decomposed into multiple characters and long cases include:
33 | // ΐ "\xce\x90" folds to ΐ "\xce\xb9\xcc\x88\xcc\x81"
34 | constexpr size_t maxExpansionCaseConversion = 3;
35 |
36 | // Converts a mixed case string using a particular conversion.
37 | // Result may be a different length to input and the length is the return value.
38 | // If there is not enough space then 0 is returned.
39 | size_t CaseConvertString(char *converted, size_t sizeConverted, const char *mixed, size_t lenMixed, enum CaseConversion conversion);
40 |
41 | // Converts a mixed case string using a particular conversion.
42 | std::string CaseConvertString(const std::string &s, enum CaseConversion conversion);
43 |
44 | }
45 |
46 | #endif
47 |
--------------------------------------------------------------------------------
/scintilla/src/CaseFolder.h:
--------------------------------------------------------------------------------
1 | // Scintilla source code edit control
2 | /** @file CaseFolder.h
3 | ** Classes for case folding.
4 | **/
5 | // Copyright 1998-2013 by Neil Hodgson
6 | // The License.txt file describes the conditions under which this software may be distributed.
7 |
8 | #ifndef CASEFOLDER_H
9 | #define CASEFOLDER_H
10 |
11 | namespace Scintilla {
12 |
13 | class CaseFolder {
14 | public:
15 | virtual ~CaseFolder();
16 | virtual size_t Fold(char *folded, size_t sizeFolded, const char *mixed, size_t lenMixed) = 0;
17 | };
18 |
19 | class CaseFolderTable : public CaseFolder {
20 | protected:
21 | char mapping[256];
22 | public:
23 | CaseFolderTable() noexcept;
24 | ~CaseFolderTable() override;
25 | size_t Fold(char *folded, size_t sizeFolded, const char *mixed, size_t lenMixed) override;
26 | void SetTranslation(char ch, char chTranslation) noexcept;
27 | void StandardASCII() noexcept;
28 | };
29 |
30 | class ICaseConverter;
31 |
32 | class CaseFolderUnicode : public CaseFolderTable {
33 | ICaseConverter *converter;
34 | public:
35 | CaseFolderUnicode();
36 | size_t Fold(char *folded, size_t sizeFolded, const char *mixed, size_t lenMixed) override;
37 | };
38 |
39 | }
40 |
41 | #endif
42 |
--------------------------------------------------------------------------------
/scintilla/src/Catalogue.h:
--------------------------------------------------------------------------------
1 | // Scintilla source code edit control
2 | /** @file Catalogue.h
3 | ** Lexer infrastructure.
4 | ** Contains a list of LexerModules which can be searched to find a module appropriate for a
5 | ** particular language.
6 | **/
7 | // Copyright 1998-2010 by Neil Hodgson
8 | // The License.txt file describes the conditions under which this software may be distributed.
9 |
10 | #ifndef CATALOGUE_H
11 | #define CATALOGUE_H
12 |
13 | namespace Scintilla {
14 |
15 | class Catalogue {
16 | public:
17 | static const LexerModule *Find(int language);
18 | static const LexerModule *Find(const char *languageName) noexcept;
19 | static void AddLexerModule(LexerModule *plm);
20 | };
21 |
22 | }
23 |
24 | #endif
25 |
--------------------------------------------------------------------------------
/scintilla/src/CharClassify.cxx:
--------------------------------------------------------------------------------
1 | // Scintilla source code edit control
2 | /** @file CharClassify.cxx
3 | ** Character classifications used by Document and RESearch.
4 | **/
5 | // Copyright 2006 by Neil Hodgson
6 | // The License.txt file describes the conditions under which this software may be distributed.
7 |
8 | #include
9 | #include
10 |
11 | #include
12 |
13 | #include "CharacterSet.h"
14 | #include "CharClassify.h"
15 |
16 | using namespace Scintilla;
17 |
18 | CharClassify::CharClassify() : charClass{} {
19 | SetDefaultCharClasses(true);
20 | }
21 |
22 | void CharClassify::SetDefaultCharClasses(bool includeWordClass) {
23 | // Initialize all char classes to default values
24 | for (int ch = 0; ch < 256; ch++) {
25 | if (ch == '\r' || ch == '\n')
26 | charClass[ch] = ccNewLine;
27 | else if (ch < 0x20 || ch == ' ')
28 | charClass[ch] = ccSpace;
29 | else if (includeWordClass && (ch >= 0x80 || IsAlphaNumeric(ch) || ch == '_'))
30 | charClass[ch] = ccWord;
31 | else
32 | charClass[ch] = ccPunctuation;
33 | }
34 | }
35 |
36 | void CharClassify::SetCharClasses(const unsigned char *chars, cc newCharClass) {
37 | // Apply the newCharClass to the specified chars
38 | if (chars) {
39 | while (*chars) {
40 | charClass[*chars] = static_cast(newCharClass);
41 | chars++;
42 | }
43 | }
44 | }
45 |
46 | int CharClassify::GetCharsOfClass(cc characterClass, unsigned char *buffer) const noexcept {
47 | // Get characters belonging to the given char class; return the number
48 | // of characters (if the buffer is NULL, don't write to it).
49 | int count = 0;
50 | for (int ch = maxChar - 1; ch >= 0; --ch) {
51 | if (charClass[ch] == characterClass) {
52 | ++count;
53 | if (buffer) {
54 | *buffer = static_cast(ch);
55 | buffer++;
56 | }
57 | }
58 | }
59 | return count;
60 | }
61 |
--------------------------------------------------------------------------------
/scintilla/src/CharClassify.h:
--------------------------------------------------------------------------------
1 | // Scintilla source code edit control
2 | /** @file CharClassify.h
3 | ** Character classifications used by Document and RESearch.
4 | **/
5 | // Copyright 2006-2009 by Neil Hodgson
6 | // The License.txt file describes the conditions under which this software may be distributed.
7 |
8 | #ifndef CHARCLASSIFY_H
9 | #define CHARCLASSIFY_H
10 |
11 | namespace Scintilla {
12 |
13 | class CharClassify {
14 | public:
15 | CharClassify();
16 |
17 | enum cc { ccSpace, ccNewLine, ccWord, ccPunctuation };
18 | void SetDefaultCharClasses(bool includeWordClass);
19 | void SetCharClasses(const unsigned char *chars, cc newCharClass);
20 | int GetCharsOfClass(cc characterClass, unsigned char *buffer) const noexcept;
21 | cc GetClass(unsigned char ch) const noexcept { return static_cast(charClass[ch]);}
22 | bool IsWord(unsigned char ch) const noexcept { return static_cast(charClass[ch]) == ccWord;}
23 |
24 | private:
25 | enum { maxChar=256 };
26 | unsigned char charClass[maxChar]; // not type cc to save space
27 | };
28 |
29 | }
30 |
31 | #endif
32 |
--------------------------------------------------------------------------------
/scintilla/src/DBCS.cxx:
--------------------------------------------------------------------------------
1 | // Scintilla source code edit control
2 | /** @file DBCS.cxx
3 | ** Functions to handle DBCS double byte encodings like Shift-JIS.
4 | **/
5 | // Copyright 2017 by Neil Hodgson
6 | // The License.txt file describes the conditions under which this software may be distributed.
7 |
8 | #include "DBCS.h"
9 |
10 | using namespace Scintilla;
11 |
12 | namespace Scintilla {
13 |
14 | bool DBCSIsLeadByte(int codePage, char ch) noexcept {
15 | // Byte ranges found in Wikipedia articles with relevant search strings in each case
16 | const unsigned char uch = ch;
17 | switch (codePage) {
18 | case 932:
19 | // Shift_jis
20 | return ((uch >= 0x81) && (uch <= 0x9F)) ||
21 | ((uch >= 0xE0) && (uch <= 0xFC));
22 | // Lead bytes F0 to FC may be a Microsoft addition.
23 | case 936:
24 | // GBK
25 | return (uch >= 0x81) && (uch <= 0xFE);
26 | case 949:
27 | // Korean Wansung KS C-5601-1987
28 | return (uch >= 0x81) && (uch <= 0xFE);
29 | case 950:
30 | // Big5
31 | return (uch >= 0x81) && (uch <= 0xFE);
32 | case 1361:
33 | // Korean Johab KS C-5601-1992
34 | return
35 | ((uch >= 0x84) && (uch <= 0xD3)) ||
36 | ((uch >= 0xD8) && (uch <= 0xDE)) ||
37 | ((uch >= 0xE0) && (uch <= 0xF9));
38 | }
39 | return false;
40 | }
41 |
42 | }
43 |
--------------------------------------------------------------------------------
/scintilla/src/DBCS.h:
--------------------------------------------------------------------------------
1 | // Scintilla source code edit control
2 | /** @file DBCS.h
3 | ** Functions to handle DBCS double byte encodings like Shift-JIS.
4 | **/
5 | // Copyright 2017 by Neil Hodgson
6 | // The License.txt file describes the conditions under which this software may be distributed.
7 |
8 | #ifndef DBCS_H
9 | #define DBCS_H
10 |
11 | namespace Scintilla {
12 |
13 | constexpr bool IsDBCSCodePage(int codePage) noexcept {
14 | return codePage == 932
15 | || codePage == 936
16 | || codePage == 949
17 | || codePage == 950
18 | || codePage == 1361;
19 | }
20 |
21 | bool DBCSIsLeadByte(int codePage, char ch) noexcept;
22 |
23 | }
24 |
25 | #endif
26 |
--------------------------------------------------------------------------------
/scintilla/src/ElapsedPeriod.h:
--------------------------------------------------------------------------------
1 | // Scintilla source code edit control
2 | /** @file ElapsedPeriod.h
3 | ** Encapsulate C++ to simplify use.
4 | **/
5 | // Copyright 2018 by Neil Hodgson
6 | // The License.txt file describes the conditions under which this software may be distributed.
7 |
8 | #ifndef ELAPSEDPERIOD_H
9 | #define ELAPSEDPERIOD_H
10 |
11 | namespace Scintilla {
12 |
13 | // Simplified access to high precision timing.
14 | class ElapsedPeriod {
15 | std::chrono::high_resolution_clock::time_point tp;
16 | public:
17 | /// Capture the moment
18 | ElapsedPeriod() noexcept : tp(std::chrono::high_resolution_clock::now()) {
19 | }
20 | /// Return duration as floating point seconds
21 | double Duration(bool reset=false) noexcept {
22 | const std::chrono::high_resolution_clock::time_point tpNow =
23 | std::chrono::high_resolution_clock::now();
24 | const std::chrono::duration stylingDuration =
25 | std::chrono::duration_cast>(tpNow - tp);
26 | if (reset) {
27 | tp = tpNow;
28 | }
29 | return stylingDuration.count();
30 | }
31 | };
32 |
33 | }
34 |
35 | #endif
36 |
--------------------------------------------------------------------------------
/scintilla/src/ExternalLexer.h:
--------------------------------------------------------------------------------
1 | // Scintilla source code edit control
2 | /** @file ExternalLexer.h
3 | ** Support external lexers in DLLs or shared libraries.
4 | **/
5 | // Copyright 2001 Simon Steele , portions copyright Neil Hodgson.
6 | // The License.txt file describes the conditions under which this software may be distributed.
7 |
8 | #ifndef EXTERNALLEXER_H
9 | #define EXTERNALLEXER_H
10 |
11 | namespace Scintilla {
12 |
13 | void ExternalLexerLoad(const char *path);
14 |
15 | }
16 |
17 | #endif
18 |
--------------------------------------------------------------------------------
/scintilla/src/FontQuality.h:
--------------------------------------------------------------------------------
1 | // Scintilla source code edit control
2 | /** @file FontQuality.h
3 | ** Definitions to control font anti-aliasing.
4 | ** Redefine constants from Scintilla.h to avoid including Scintilla.h in PlatWin.cxx.
5 | **/
6 | // Copyright 1998-2009 by Neil Hodgson
7 | // The License.txt file describes the conditions under which this software may be distributed.
8 |
9 | #ifndef FONTQUALITY_H
10 | #define FONTQUALITY_H
11 |
12 | namespace Scintilla {
13 |
14 | // These definitions match Scintilla.h
15 | #define SC_EFF_QUALITY_MASK 0xF
16 | #define SC_EFF_QUALITY_DEFAULT 0
17 | #define SC_EFF_QUALITY_NON_ANTIALIASED 1
18 | #define SC_EFF_QUALITY_ANTIALIASED 2
19 | #define SC_EFF_QUALITY_LCD_OPTIMIZED 3
20 |
21 | // These definitions must match SC_TECHNOLOGY_* in Scintilla.h
22 | #define SCWIN_TECH_GDI 0
23 | #define SCWIN_TECH_DIRECTWRITE 1
24 |
25 | }
26 |
27 | #endif
28 |
--------------------------------------------------------------------------------
/scintilla/src/IntegerRectangle.h:
--------------------------------------------------------------------------------
1 | // Scintilla source code edit control
2 | /** @file IntegerRectangle.h
3 | ** A rectangle with integer coordinates.
4 | **/
5 | // Copyright 2018 by Neil Hodgson
6 | // The License.txt file describes the conditions under which this software may be distributed.
7 |
8 | #ifndef INTEGERRECTANGLE_H
9 | #define INTEGERRECTANGLE_H
10 |
11 | namespace Scintilla {
12 |
13 | struct IntegerRectangle {
14 | int left;
15 | int top;
16 | int right;
17 | int bottom;
18 |
19 | explicit IntegerRectangle(PRectangle rc) noexcept :
20 | left(static_cast(rc.left)), top(static_cast(rc.top)),
21 | right(static_cast(rc.right)), bottom(static_cast(rc.bottom)) {
22 | }
23 | int Width() const noexcept { return right - left; }
24 | int Height() const noexcept { return bottom - top; }
25 | };
26 |
27 | }
28 |
29 | #endif
30 |
--------------------------------------------------------------------------------
/scintilla/src/KeyMap.h:
--------------------------------------------------------------------------------
1 | // Scintilla source code edit control
2 | /** @file KeyMap.h
3 | ** Defines a mapping between keystrokes and commands.
4 | **/
5 | // Copyright 1998-2001 by Neil Hodgson
6 | // The License.txt file describes the conditions under which this software may be distributed.
7 |
8 | #ifndef KEYMAP_H
9 | #define KEYMAP_H
10 |
11 | namespace Scintilla {
12 |
13 | #define SCI_NORM 0
14 | #define SCI_SHIFT SCMOD_SHIFT
15 | #define SCI_CTRL SCMOD_CTRL
16 | #define SCI_ALT SCMOD_ALT
17 | #define SCI_META SCMOD_META
18 | #define SCI_SUPER SCMOD_SUPER
19 | #define SCI_CSHIFT (SCI_CTRL | SCI_SHIFT)
20 | #define SCI_ASHIFT (SCI_ALT | SCI_SHIFT)
21 |
22 | /**
23 | */
24 | class KeyModifiers {
25 | public:
26 | int key;
27 | int modifiers;
28 | KeyModifiers(int key_, int modifiers_) noexcept : key(key_), modifiers(modifiers_) {
29 | }
30 | bool operator<(const KeyModifiers &other) const noexcept {
31 | if (key == other.key)
32 | return modifiers < other.modifiers;
33 | else
34 | return key < other.key;
35 | }
36 | };
37 |
38 | /**
39 | */
40 | class KeyToCommand {
41 | public:
42 | int key;
43 | int modifiers;
44 | unsigned int msg;
45 | };
46 |
47 | /**
48 | */
49 | class KeyMap {
50 | std::map kmap;
51 | static const KeyToCommand MapDefault[];
52 |
53 | public:
54 | KeyMap();
55 | ~KeyMap();
56 | void Clear() noexcept;
57 | void AssignCmdKey(int key, int modifiers, unsigned int msg);
58 | unsigned int Find(int key, int modifiers) const; // 0 returned on failure
59 | const std::map &GetKeyMap() const noexcept;
60 | };
61 |
62 | }
63 |
64 | #endif
65 |
--------------------------------------------------------------------------------
/scintilla/src/MarginView.h:
--------------------------------------------------------------------------------
1 | // Scintilla source code edit control
2 | /** @file MarginView.h
3 | ** Defines the appearance of the editor margin.
4 | **/
5 | // Copyright 1998-2014 by Neil Hodgson
6 | // The License.txt file describes the conditions under which this software may be distributed.
7 |
8 | #ifndef MARGINVIEW_H
9 | #define MARGINVIEW_H
10 |
11 | namespace Scintilla {
12 |
13 | void DrawWrapMarker(Surface *surface, PRectangle rcPlace, bool isEndMarker, ColourDesired wrapColour);
14 |
15 | typedef void (*DrawWrapMarkerFn)(Surface *surface, PRectangle rcPlace, bool isEndMarker, ColourDesired wrapColour);
16 |
17 | /**
18 | * MarginView draws the margins.
19 | */
20 | class MarginView {
21 | public:
22 | std::unique_ptr pixmapSelMargin;
23 | std::unique_ptr pixmapSelPattern;
24 | std::unique_ptr pixmapSelPatternOffset1;
25 | // Highlight current folding block
26 | HighlightDelimiter highlightDelimiter;
27 |
28 | int wrapMarkerPaddingRight; // right-most pixel padding of wrap markers
29 | /** Some platforms, notably PLAT_CURSES, do not support Scintilla's native
30 | * DrawWrapMarker function for drawing wrap markers. Allow those platforms to
31 | * override it instead of creating a new method in the Surface class that
32 | * existing platforms must implement as empty. */
33 | DrawWrapMarkerFn customDrawWrapMarker;
34 |
35 | MarginView() noexcept;
36 |
37 | void DropGraphics(bool freeObjects);
38 | void AllocateGraphics(const ViewStyle &vsDraw);
39 | void RefreshPixMaps(Surface *surfaceWindow, WindowID wid, const ViewStyle &vsDraw);
40 | void PaintMargin(Surface *surface, Sci::Line topLine, PRectangle rc, PRectangle rcMargin,
41 | const EditModel &model, const ViewStyle &vs);
42 | };
43 |
44 | }
45 |
46 | #endif
47 |
--------------------------------------------------------------------------------
/scintilla/src/Position.h:
--------------------------------------------------------------------------------
1 | // Scintilla source code edit control
2 | /** @file Position.h
3 | ** Defines global type name Position in the Sci internal namespace.
4 | **/
5 | // Copyright 2015 by Neil Hodgson
6 | // The License.txt file describes the conditions under which this software may be distributed.
7 |
8 | #ifndef POSITION_H
9 | #define POSITION_H
10 |
11 | /**
12 | * A Position is a position within a document between two characters or at the beginning or end.
13 | * Sometimes used as a character index where it identifies the character after the position.
14 | * A Line is a document or screen line.
15 | */
16 |
17 | namespace Sci {
18 |
19 | typedef ptrdiff_t Position;
20 | typedef ptrdiff_t Line;
21 |
22 | const Position invalidPosition = -1;
23 |
24 | }
25 |
26 | #endif
27 |
--------------------------------------------------------------------------------
/scintilla/src/SciTE.properties:
--------------------------------------------------------------------------------
1 | # SciTE.properties is the per directory local options file and can be used to override
2 | # settings made in SciTEGlobal.properties
3 | command.build.directory.*.cxx=..\win32
4 | command.build.directory.*.h=..\win32
5 | command.build.*.cxx=nmake -f scintilla.mak QUIET=1
6 | command.build.*.h=nmake -f scintilla.mak QUIET=1
7 |
--------------------------------------------------------------------------------
/scintilla/src/UniqueString.cxx:
--------------------------------------------------------------------------------
1 | // Scintilla source code edit control
2 | /** @file UniqueString.cxx
3 | ** Define an allocator for UniqueString.
4 | **/
5 | // Copyright 2017 by Neil Hodgson
6 | // The License.txt file describes the conditions under which this software may be distributed.
7 |
8 | #include
9 | #include
10 | #include
11 | #include
12 |
13 | #include "UniqueString.h"
14 |
15 | namespace Scintilla {
16 |
17 | /// Equivalent to strdup but produces a std::unique_ptr allocation to go
18 | /// into collections.
19 | UniqueString UniqueStringCopy(const char *text) {
20 | if (!text) {
21 | return UniqueString();
22 | }
23 | const std::string_view sv(text);
24 | std::unique_ptr upcNew = std::make_unique(sv.length() + 1);
25 | sv.copy(upcNew.get(), sv.length());
26 | return UniqueString(upcNew.release());
27 | }
28 |
29 | // A set of strings that always returns the same pointer for each string.
30 |
31 | UniqueStringSet::UniqueStringSet() noexcept = default;
32 |
33 | UniqueStringSet::~UniqueStringSet() {
34 | strings.clear();
35 | }
36 |
37 | void UniqueStringSet::Clear() noexcept {
38 | strings.clear();
39 | }
40 |
41 | const char *UniqueStringSet::Save(const char *text) {
42 | if (!text)
43 | return nullptr;
44 |
45 | const std::string_view sv(text);
46 | for (const UniqueString &us : strings) {
47 | if (sv == us.get()) {
48 | return us.get();
49 | }
50 | }
51 |
52 | strings.push_back(UniqueStringCopy(text));
53 | return strings.back().get();
54 | }
55 |
56 | }
57 |
--------------------------------------------------------------------------------
/scintilla/src/UniqueString.h:
--------------------------------------------------------------------------------
1 | // Scintilla source code edit control
2 | /** @file UniqueString.h
3 | ** Define UniqueString, a unique_ptr based string type for storage in containers
4 | ** and an allocator for UniqueString.
5 | ** Define UniqueStringSet which holds a set of strings, used to avoid holding many copies
6 | ** of font names.
7 | **/
8 | // Copyright 2017 by Neil Hodgson
9 | // The License.txt file describes the conditions under which this software may be distributed.
10 |
11 | #ifndef UNIQUESTRING_H
12 | #define UNIQUESTRING_H
13 |
14 | namespace Scintilla {
15 |
16 | constexpr bool IsNullOrEmpty(const char *text) noexcept {
17 | return text == nullptr || *text == '\0';
18 | }
19 |
20 | using UniqueString = std::unique_ptr;
21 |
22 | /// Equivalent to strdup but produces a std::unique_ptr allocation to go
23 | /// into collections.
24 | UniqueString UniqueStringCopy(const char *text);
25 |
26 | // A set of strings that always returns the same pointer for each string.
27 |
28 | class UniqueStringSet {
29 | private:
30 | std::vector strings;
31 | public:
32 | UniqueStringSet() noexcept;
33 | // UniqueStringSet objects can not be copied.
34 | UniqueStringSet(const UniqueStringSet &) = delete;
35 | UniqueStringSet &operator=(const UniqueStringSet &) = delete;
36 | // UniqueStringSet objects can be moved.
37 | UniqueStringSet(UniqueStringSet &&) = default;
38 | UniqueStringSet &operator=(UniqueStringSet &&) = default;
39 | ~UniqueStringSet();
40 | void Clear() noexcept;
41 | const char *Save(const char *text);
42 | };
43 |
44 | }
45 |
46 | #endif
47 |
--------------------------------------------------------------------------------
/scintilla/test/MessageNumbers.py:
--------------------------------------------------------------------------------
1 | # List many windows message numbers
2 |
3 | msgs = {
4 | "WM_ACTIVATE":6,
5 | "WM_ACTIVATEAPP":28,
6 | "WM_CAPTURECHANGED":533,
7 | "WM_CHAR":258,
8 | "WM_CLOSE":16,
9 | "WM_CREATE":1,
10 | "WM_COMMAND":273,
11 | "WM_DESTROY":2,
12 | "WM_ENTERSIZEMOVE":561,
13 | "WM_ERASEBKGND":20,
14 | "WM_EXITSIZEMOVE":562,
15 | "WM_GETMINMAXINFO":36,
16 | "WM_GETTEXT":13,
17 | "WM_GETTEXTLENGTH":14,
18 | "WM_IME_SETCONTEXT":0x0281,
19 | "WM_IME_NOTIFY":0x0282,
20 | "WM_KEYDOWN":256,
21 | "WM_KEYUP":257,
22 | "WM_KILLFOCUS":8,
23 | "WM_LBUTTONDOWN":513,
24 | "WM_LBUTTONUP":514,
25 | "WM_MBUTTONDOWN":519,
26 | "WM_MBUTTONUP":520,
27 | "WM_MBUTTONDBLCLK":521,
28 | "WM_MOUSEACTIVATE":33,
29 | "WM_MOUSEMOVE":512,
30 | "WM_MOVE":3,
31 | "WM_MOVING":534,
32 | "WM_NCACTIVATE":134,
33 | "WM_NCCALCSIZE":131,
34 | "WM_NCCREATE":129,
35 | "WM_NCDESTROY":130,
36 | "WM_NCHITTEST":132,
37 | "WM_NCLBUTTONDBLCLK":163,
38 | "WM_NCLBUTTONDOWN":161,
39 | "WM_NCLBUTTONUP":162,
40 | "WM_NCMOUSEMOVE":160,
41 | "WM_NCPAINT":133,
42 | "WM_PAINT":15,
43 | "WM_PARENTNOTIFY":528,
44 | "WM_SETCURSOR":32,
45 | "WM_SETFOCUS":7,
46 | "WM_SETFONT":48,
47 | "WM_SETTEXT":12,
48 | "WM_SHOWWINDOW":24,
49 | "WM_SIZE":5,
50 | "WM_SIZING":532,
51 | "WM_SYNCPAINT":136,
52 | "WM_SYSCOMMAND":274,
53 | "WM_SYSKEYDOWN":260,
54 | "WM_TIMER":275,
55 | "WM_USER":1024,
56 | "WM_USER+1":1025,
57 | "WM_WINDOWPOSCHANGED":71,
58 | "WM_WINDOWPOSCHANGING":70,
59 | }
60 |
61 | sgsm={}
62 | for k,v in msgs.items():
63 | sgsm[v] = k
64 |
65 |
--------------------------------------------------------------------------------
/scintilla/test/README:
--------------------------------------------------------------------------------
1 | The test directory contains some unit and performance tests for Scintilla.
2 |
3 | The tests can only be run on Windows or Linux/Qt using Python 2.7 or 3.x.
4 | Python 2.7+ is required because the bytes string type and literals are available.
5 | Scintilla must be built before running any tests.
6 |
7 | A test application for Windows only is in xite.py and this can be run to experiment:
8 | pythonw xite.py
9 |
10 | To run the basic tests:
11 | python simpleTests.py
12 |
13 | There are some lexing tests with simple input files in several languages in the examples
14 | subdirectory and their expected lexed states in *.styled where the start of each style
15 | is marked with {styleNumber}, for example:
16 | {15}<%@{16}language=javas{15}%>{0}
17 |
18 | To run the lexing tests:
19 | python lexTests.py
20 |
21 | To check for performance regressions:
22 | python performanceTests.py
23 | While each test run will be different and the timer has only limited granularity, some results
24 | from a 2 GHz Athlon with a DEBUG build are:
25 | 0.187 testAddLine
26 | . 0.203 testAddLineMiddle
27 | . 0.171 testHuge
28 | . 0.203 testHugeInserts
29 | . 0.312 testHugeReplace
30 | .
31 |
--------------------------------------------------------------------------------
/scintilla/test/XiteMenu.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 |
3 | from __future__ import unicode_literals
4 |
5 | """ Define the menu structure used by the Pentacle applications """
6 |
7 | MenuStructure = [
8 | ["&File", [
9 | ["&New", "N"],
10 | ["&Open...", "O"],
11 | ["&Save", "S"],
12 | ["Save &As...", "S"],
13 | ["Test", ""],
14 | ["Exercised", ""],
15 | ["Uncalled", ""],
16 | ["-", ""],
17 | ["&Exit", ""]]],
18 | [ "&Edit", [
19 | ["&Undo", "Z"],
20 | ["&Redo", "Y"],
21 | ["-", ""],
22 | ["Cu&t", "X"],
23 | ["&Copy", "C"],
24 | ["&Paste", "V"],
25 | ["&Delete", "Del"],
26 | ["Select &All", "A"],
27 | ]],
28 | ]
29 |
--------------------------------------------------------------------------------
/scintilla/test/XiteQt.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python2
2 | # -*- coding: utf-8 -*-
3 | # Requires Python 2.7 or later
4 |
5 | import ctypes, os, sys, unittest
6 |
7 | from PySide.QtCore import *
8 | from PySide.QtGui import *
9 |
10 | import ScintillaCallable
11 |
12 | sys.path.append("..")
13 | from bin import ScintillaEditPy
14 |
15 | scintillaDirectory = ".."
16 | scintillaIncludeDirectory = os.path.join(scintillaDirectory, "include")
17 | scintillaScriptsDirectory = os.path.join(scintillaDirectory, "scripts")
18 | sys.path.append(scintillaScriptsDirectory)
19 | import Face
20 |
21 | class Form(QDialog):
22 |
23 | def __init__(self, parent=None):
24 | super(Form, self).__init__(parent)
25 | self.resize(460,300)
26 | # Create widget
27 | self.edit = ScintillaEditPy.ScintillaEdit(self)
28 |
29 | class XiteWin():
30 | def __init__(self, test=""):
31 | self.face = Face.Face()
32 | self.face.ReadFromFile(os.path.join(scintillaIncludeDirectory, "Scintilla.iface"))
33 |
34 | self.test = test
35 |
36 | self.form = Form()
37 |
38 | scifn = self.form.edit.send(int(self.face.features["GetDirectFunction"]["Value"]), 0, 0)
39 | sciptr = ctypes.c_char_p(self.form.edit.send(
40 | int(self.face.features["GetDirectPointer"]["Value"]), 0,0))
41 |
42 | self.ed = ScintillaCallable.ScintillaCallable(self.face, scifn, sciptr)
43 | self.form.show()
44 |
45 | def DoStuff(self):
46 | print(self.test)
47 | self.CmdTest()
48 |
49 | def DoEvents(self):
50 | QApplication.processEvents()
51 |
52 | def CmdTest(self):
53 | runner = unittest.TextTestRunner()
54 | tests = unittest.defaultTestLoader.loadTestsFromName(self.test)
55 | results = runner.run(tests)
56 | print(results)
57 | sys.exit(0)
58 |
59 | xiteFrame = None
60 |
61 | def main(test):
62 | global xiteFrame
63 | app = QApplication(sys.argv)
64 | xiteFrame = XiteWin(test)
65 | xiteFrame.DoStuff()
66 | sys.exit(app.exec_())
67 |
--------------------------------------------------------------------------------
/scintilla/test/examples/x.asp:
--------------------------------------------------------------------------------
1 | <%@language=javas%>
2 | <%
3 | #include
4 | function x() {
5 | }
6 | %>
7 | <%@language=vbscript%>
8 | <%
9 | sub x 'comment
10 | %>
11 |
12 |
13 |
--------------------------------------------------------------------------------
/scintilla/test/examples/x.asp.styled:
--------------------------------------------------------------------------------
1 | {15}<%@{16}language=javas{15}%>{0}
2 | {15}<%{56}
3 | #{61}include{56}
4 | {62}function{56} {61}x{65}(){56} {65}{{56}
5 | {65}}{56}
6 | {15}%>{0}
7 | {15}<%@{16}language=vbscript{15}%>{0}
8 | {15}<%{81}
9 | {84}sub{81} {86}x{81} {82}'comment {81}
10 | {15}%>{0}
11 | {1}{0}
12 | {1}{0}
13 |
--------------------------------------------------------------------------------
/scintilla/test/examples/x.cxx:
--------------------------------------------------------------------------------
1 | // A demonstration program
2 | #include
3 | #if 0 /* */
4 | #define DUMMY() \
5 | if (1);
6 | #endif
7 |
8 | #define M\
9 |
10 | \
11 |
12 | int main() {
13 | double x[] = {3.14159,6.02e23,1.6e-19,1.0+1};
14 | int y[] = {75,0113,0x4b};
15 | printf("hello world %d %g\n", y[0], x[0]);
16 | }
17 |
--------------------------------------------------------------------------------
/scintilla/test/examples/x.cxx.styled:
--------------------------------------------------------------------------------
1 | {2}// A demonstration program
2 | {9}#include
3 | #if 0 {23}/* */{9}
4 | {73}#define DUMMY() \
5 | if (1);
6 | {9}#endif
7 | {0}
8 | {9}#define M\
9 |
10 | {0}\
11 |
12 | {5}int{0} {11}main{10}(){0} {10}{{0}
13 | {11}double{0} {11}x{10}[]{0} {10}={0} {10}{{4}3.14159{10},{4}6.02e23{10},{4}1.6e-19{10},{4}1.0{10}+{4}1{10}};{0}
14 | {5}int{0} {11}y{10}[]{0} {10}={0} {10}{{4}75{10},{4}0113{10},{4}0x4b{10}};{0}
15 | {11}printf{10}({6}"hello world %d %g\n"{10},{0} {11}y{10}[{4}0{10}],{0} {11}x{10}[{4}0{10}]);{0}
16 | {10}}{0}
17 |
--------------------------------------------------------------------------------
/scintilla/test/examples/x.d:
--------------------------------------------------------------------------------
1 | $
2 | // /++ +/ doccomments are not yet supported
3 | /* */
4 | /** */
5 | /// drdr
6 | /+ /+ +/ +/
7 | //keyword test
8 | keyword1
9 | keyword2
10 | keyword4
11 | keyword5
12 | keyword6
13 | keyword7
14 | //unicode identifier test
15 | вапёasdÓΘΣαԷԸՑהכ拉麺とひシマイ단결을
16 | //strings test
17 | 's
18 | '
19 | w's'w
20 | "multiline
21 | string"w
22 | e"zz"e
23 | r"asd\"e
24 | r"multiline
25 | string"c
26 | r`asd\`e
27 | `multiline
28 | string`d
29 | x"023 abc"e
30 | x"023
31 | abc"w
32 | //numbers test
33 | a[3..4]=3
34 | 2.stringof
35 | 2.0.stringof
36 | 2.
37 | 2.2e+2
38 | 2.2e-2
39 | .2e+2
40 | .2
41 | 2e+2
42 | 0x2e+2
43 | 0x2ep+10
44 | ,.2.stringof,
45 |
46 | end
47 |
48 |
--------------------------------------------------------------------------------
/scintilla/test/examples/x.d.styled:
--------------------------------------------------------------------------------
1 | {14}${0}
2 | {2}// /++ +/ doccomments are not yet supported
3 | {1}/* */{0}
4 | {3}/** */{0}
5 | {15}/// drdr
6 | {4}/+ /+ +/ +/{0}
7 | {2}//keyword test
8 | {6}keyword1{0}
9 | {7}keyword2{0}
10 | {9}keyword4{0}
11 | {20}keyword5{0}
12 | {21}keyword6{0}
13 | {22}keyword7{0}
14 | {2}//unicode identifier test
15 | {14}вапёasdÓΘΣαԷԸՑהכ拉麺とひシマイ단결을{0}
16 | {2}//strings test
17 | {11}'s
18 | '
19 | {14}w{12}'s'{14}w{0}
20 | {10}"multiline
21 | string"w{0}
22 | {14}e{10}"zz"{14}e{0}
23 | {19}r"asd\"{14}e{0}
24 | {19}r"multiline
25 | string"c{0}
26 | {14}r{18}`asd\`{14}e{0}
27 | {18}`multiline
28 | string`d{0}
29 | {19}x"023 abc"{14}e{0}
30 | {19}x"023
31 | abc"w{0}
32 | {2}//numbers test
33 | {14}a{13}[{5}3{13}..{5}4{13}]={5}3{0}
34 | {5}2.stringof{0}
35 | {5}2.0{13}.{14}stringof{0}
36 | {5}2.{0}
37 | {5}2.2e+2{0}
38 | {5}2.2e-2{0}
39 | {5}.2e+2{0}
40 | {5}.2{0}
41 | {5}2e+2{0}
42 | {5}0x2e{13}+{5}2{0}
43 | {5}0x2ep+10{0}
44 | {13},{5}.2{13}.{14}stringof{13},{0}
45 |
46 | {14}end{0}
47 |
48 |
--------------------------------------------------------------------------------
/scintilla/test/examples/x.html:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 | SinkWorld - Portability
10 | SinkWorld - Portability
11 |
12 |
13 |
--------------------------------------------------------------------------------
/scintilla/test/examples/x.html.styled:
--------------------------------------------------------------------------------
1 | {1}{0}
2 | {1}{0}
7 | {1}{0}
8 | {1}{0}
9 | {1}{0}SinkWorld - Portability{1}{0}
10 | {2}{0}SinkWorld - Portability{2}{0}
11 | {1}{0}
12 | {1}{0}
13 |
--------------------------------------------------------------------------------
/scintilla/test/examples/x.lua:
--------------------------------------------------------------------------------
1 | --[[ coding:UTF-8
2 | comment ]]
3 | function first()
4 | ::開::
5 | -- Comment
6 | func(SCI_ANNOTATIONSETTEXT, 'a', 0, "LINE1")
7 | end
8 |
--------------------------------------------------------------------------------
/scintilla/test/examples/x.lua.styled:
--------------------------------------------------------------------------------
1 | {1}--[[ coding:UTF-8
2 | comment ]]{0}
3 | {5}function{0} {11}first{10}(){0}
4 | {20}::開::{0}
5 | {2}-- Comment
6 | {0} {11}func{10}({11}SCI_ANNOTATIONSETTEXT{10},{0} {7}'a'{10},{0} {4}0{10},{0} {6}"LINE1"{10}){0}
7 | {5}end{0}
8 |
--------------------------------------------------------------------------------
/scintilla/test/examples/x.nim:
--------------------------------------------------------------------------------
1 | # Tests for Nim
2 | let s = "foobar"
3 |
4 | # Feature #1260
5 | {.ident.}
6 | stdin.readLine.split.map(parseInt).max.`$`.echo(" is the maximum!")
7 |
8 | # Feature #1261
9 | # IsFuncName("proc") so style ticks as SCE_NIM_FUNCNAME:
10 | proc `$` (x: myDataType): string = ...
11 | # Style ticks as SCE_NIM_BACKTICKS:
12 | if `==`( `+`(3,4),7): echo "True"
13 |
14 | # Feature #1262
15 | # Standard raw string identifier:
16 | let standardDoubleLitRawStr = R"A raw string\"
17 | let standardTripleLitRawStr = R"""A triple-double raw string\""""
18 | # Style of 'customIdent' is determined by lexer.nim.raw.strings.highlight.ident. 16 if false, 6 or 10 if true
19 | let customDoubleLitRawStr = customIdent"A string\"
20 | let customTripleLitRawStr = customIdent"""A triple-double raw string\""""
21 |
22 | # Feature #1268
23 | 10_000
24 | 10__000
25 | 10_
26 | 1....5
27 | 1.ident
28 | 1._ident
29 |
--------------------------------------------------------------------------------
/scintilla/test/examples/x.nim.styled:
--------------------------------------------------------------------------------
1 | {3}# Tests for Nim
2 | {8}let{0} {16}s{0} {15}={0} {6}"foobar"{0}
3 |
4 | {3}# Feature #1260
5 | {15}{.{16}ident{15}.}{0}
6 | {16}stdin{15}.{16}readLine{15}.{16}split{15}.{16}map{15}({16}parseInt{15}).{16}max{15}.{11}`$`{15}.{16}echo{15}({6}" is the maximum!"{15}){0}
7 |
8 | {3}# Feature #1261
9 | # IsFuncName("proc") so style ticks as SCE_NIM_FUNCNAME:
10 | {8}proc{0} {12}`$`{0} {15}({16}x{15}:{0} {16}myDataType{15}):{0} {16}string{0} {15}={0} {15}...{0}
11 | {3}# Style ticks as SCE_NIM_BACKTICKS:
12 | {8}if{0} {11}`==`{15}({0} {11}`+`{15}({5}3{15},{5}4{15}),{5}7{15}):{0} {16}echo{0} {6}"True"{0}
13 |
14 | {3}# Feature #1262
15 | # Standard raw string identifier:
16 | {8}let{0} {16}standardDoubleLitRawStr{0} {15}={0} {6}R"A raw string\"{0}
17 | {8}let{0} {16}standardTripleLitRawStr{0} {15}={0} {10}R"""A triple-double raw string\""""{0}
18 | {3}# Style of 'customIdent' is determined by lexer.nim.raw.strings.highlight.ident. 16 if false, 6 or 10 if true
19 | {8}let{0} {16}customDoubleLitRawStr{0} {15}={0} {16}customIdent{6}"A string\"{0}
20 | {8}let{0} {16}customTripleLitRawStr{0} {15}={0} {16}customIdent{10}"""A triple-double raw string\""""{0}
21 |
22 | {3}# Feature #1268
23 | {5}10_000{0}
24 | {5}10{16}__000{0}
25 | {5}10{16}_{0}
26 | {5}1{15}....{5}5{0}
27 | {5}1{15}.{16}ident{0}
28 | {5}1{15}.{16}_ident{0}
29 |
--------------------------------------------------------------------------------
/scintilla/test/examples/x.php:
--------------------------------------------------------------------------------
1 |
2 | \n";
4 | /* ?> */
5 | ?>
6 | forif
7 |
--------------------------------------------------------------------------------
/scintilla/test/examples/x.php.styled:
--------------------------------------------------------------------------------
1 | {1}{0} {9}{0}
2 | {18}\n"{127};{118}
4 | {124}/* ?> */{118}
5 | {18}?>{0}
6 | {1}{0}for{1}{0}if{1}{0}
7 |
--------------------------------------------------------------------------------
/scintilla/test/examples/x.pl:
--------------------------------------------------------------------------------
1 | use strict;
2 | while ( $r ) {
3 | printf ( "Example text \n" );
4 | sleep 1;
5 | }
--------------------------------------------------------------------------------
/scintilla/test/examples/x.pl.styled:
--------------------------------------------------------------------------------
1 | {5}use{0} {11}strict{10};{0}
2 | {5}while{0} {10}({0} {12}$r{0} {10}){0} {10}{{0}
3 | {5}printf{0} {10}({0} {6}"Example text \n"{0} {10});{0}
4 | {5}sleep{0} {4}1{10};{0}
5 | {10}}
--------------------------------------------------------------------------------
/scintilla/test/examples/x.py:
--------------------------------------------------------------------------------
1 | # Convert all punctuation characters except '_', '*', and '.' into spaces.
2 | def depunctuate(s):
3 | '''A docstring'''
4 | """Docstring 2"""
5 | d = ""
6 | for ch in s:
7 | if ch in 'abcde':
8 | d = d + ch
9 | else:
10 | d = d + " "
11 | return d
12 |
--------------------------------------------------------------------------------
/scintilla/test/examples/x.py.styled:
--------------------------------------------------------------------------------
1 | {1}# Convert all punctuation characters except '_', '*', and '.' into spaces.{0}
2 | {5}def{0} {9}depunctuate{10}({11}s{10}):{0}
3 | {6}'''A docstring'''{0}
4 | {7}"""Docstring 2"""{0}
5 | {11}d{0} {10}={0} {3}""{0}
6 | {5}for{0} {11}ch{0} {5}in{0} {11}s{10}:{0}
7 | {5}if{0} {11}ch{0} {5}in{0} {4}'abcde'{10}:{0}
8 | {11}d{0} {10}={0} {11}d{0} {10}+{0} {11}ch{0}
9 | {5}else{10}:{0}
10 | {11}d{0} {10}={0} {11}d{0} {10}+{0} {3}" "{0}
11 | {5}return{0} {11}d{0}
12 |
--------------------------------------------------------------------------------
/scintilla/test/examples/x.rb:
--------------------------------------------------------------------------------
1 | class Demo
2 | def test # A test
3 | i = 1
4 | puts "Example"
5 | end
6 | end
--------------------------------------------------------------------------------
/scintilla/test/examples/x.rb.styled:
--------------------------------------------------------------------------------
1 | {5}class{0} {8}Demo{0}
2 | {5}def{0} {9}test{0} {2}# A test{0}
3 | {11}i{0} {10}={0} {4}1{0}
4 | {11}puts{0} {6}"Example"{0}
5 | {5}end{0}
6 | {5}end
--------------------------------------------------------------------------------
/scintilla/test/examples/x.tcl:
--------------------------------------------------------------------------------
1 | # tcl tests
2 |
3 | #simple example
4 |
5 | proc Echo_Server {port} {
6 | set s [socket -server EchoAccept $port]
7 | vwait forever;
8 | }
9 |
10 | # Bug #1947
11 |
12 | $s($i,"n")
13 | set n $showArray($i,"neighbor")
14 |
--------------------------------------------------------------------------------
/scintilla/test/examples/x.tcl.styled:
--------------------------------------------------------------------------------
1 | {2}# tcl tests
2 | {0}
3 | {2}#simple example
4 | {0}
5 | {12}proc{0} {7}Echo_Server{0} {6}{{7}port{6}}{0} {6}{
6 | {0} {12}set{0} {7}s{0} {6}[{12}socket{0} {10}-server{0} {7}EchoAccept{0} {8}$port{6}]
7 | {0} {12}vwait{0} {7}forever{0};
8 | {6}}
9 | {0}
10 | {2}# Bug #1947
11 | {0}
12 | {8}$s{6}({8}$i{6},{5}"n"{6})
13 | {12}set{0} {7}n{0} {8}$showArray{6}({8}$i{6},{5}"neighbor"{6})
14 |
--------------------------------------------------------------------------------
/scintilla/test/examples/x.vb:
--------------------------------------------------------------------------------
1 | ' String"
2 | Dim a As String = "hello, world"
3 | Dim b As String = "hello world"
4 | Dim c As String = "Joe said ""Hello"" to me"
5 | Dim d As String = "\\\\server\\share\\file.txt"
6 | ' Character
7 | ""C "c"C "cc"C
8 | ' Date
9 | d = #5/31/1993# or # 01/01/0001 12:00:00AM #
10 | ' Number
11 | 123_456___789
12 | 123_
13 | &b10101_01010
14 |
--------------------------------------------------------------------------------
/scintilla/test/examples/x.vb.styled:
--------------------------------------------------------------------------------
1 | {1}' String"
2 | {3}Dim{0} {7}a{0} {3}As{0} {3}String{0} {6}={0} {4}"hello, world"{0}
3 | {3}Dim{0} {7}b{0} {3}As{0} {3}String{0} {6}={0} {4}"hello world"{0}
4 | {3}Dim{0} {7}c{0} {3}As{0} {3}String{0} {6}={0} {4}"Joe said ""Hello"" to me"{0}
5 | {3}Dim{0} {7}d{0} {3}As{0} {3}String{0} {6}={0} {4}"\\\\server\\share\\file.txt"{0}
6 | {1}' Character
7 | {4}""C{0} {4}"c"C{0} {4}"cc"C{0}
8 | {1}' Date
9 | {7}d{0} {6}={0} {8}#5/31/1993#{0} {3}or{0} {8}# 01/01/0001 12:00:00AM #{0}
10 | {1}' Number
11 | {2}123_456___789{0}
12 | {2}123_{0}
13 | {2}&b10101_01010{0}
14 |
--------------------------------------------------------------------------------
/scintilla/test/gi/filter-scintilla-h.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | # Filters Scintilla.h to not contain generated stuff or deprecated defines
3 |
4 | import sys
5 | import fileinput
6 |
7 | def main():
8 | inhibit = 0
9 | for line in fileinput.input():
10 | if line.startswith("/* ++Autogenerated") or line.startswith("#ifdef INCLUDE_DEPRECATED_FEATURES"):
11 | inhibit += 1
12 | if inhibit == 0:
13 | sys.stdout.write(line)
14 | if line.startswith("/* --Autogenerated") or line.startswith("#endif"):
15 | if (inhibit > 0):
16 | inhibit -= 1
17 |
18 | if __name__ == "__main__":
19 | main()
20 |
--------------------------------------------------------------------------------
/scintilla/test/gi/gi-test.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python
2 | import gi
3 | gi.require_version('Scintilla', '0.1')
4 |
5 | # Scintilla is imported before because it loads Gtk with a specified version
6 | # this avoids a warning when Gtk is imported without version such as below (where
7 | # it is imported without because this script works with gtk2 and gtk3)
8 | from gi.repository import Scintilla
9 | from gi.repository import Gtk
10 |
11 | def on_notify(sci, id, scn):
12 | if (scn.nmhdr.code == 2001): # SCN_CHARADDED
13 | print ("sci-notify: id: %d, char added: %d" % (id, scn.ch))
14 | elif (scn.nmhdr.code == 2008): # SCN_MODIFIED
15 | print ("sci-notify: id: %d, pos: %d, mod type: %d" % (id, scn.position, scn.modificationType))
16 | else:
17 | print ("sci-notify: id: %d, scn.nmhdr.code: %d" % (id, scn.nmhdr.code))
18 |
19 | win = Gtk.Window()
20 | win.connect("delete-event", Gtk.main_quit)
21 | sci = Scintilla.Object()
22 | sci.connect("sci-notify", on_notify)
23 | win.add(sci)
24 | win.show_all()
25 | win.resize(400,300)
26 | Gtk.main()
27 |
--------------------------------------------------------------------------------
/scintilla/test/gi/makefile:
--------------------------------------------------------------------------------
1 | # Build gir and test
2 | # For Ubuntu, these may be needed:
3 | # apt-get install gobject-introspection
4 | # apt-get install libgirepository1.0-dev
5 | all: Scintilla-0.1.typelib
6 |
7 | ifdef GTK3
8 | GTKVERSION=3.0
9 | else
10 | GTKVERSION=2.0
11 | endif
12 |
13 | GI_SCANNER = g-ir-scanner
14 | GI_COMPILER = g-ir-compiler
15 | GTK_LIBS = $(shell pkg-config --libs gtk+-$(GTKVERSION))
16 | GTK_CFLAGS = $(shell pkg-config --cflags gtk+-$(GTKVERSION))
17 | PWD = $(shell pwd)
18 |
19 | .PHONY: test clean FORCE
20 |
21 | ../../bin/scintilla.a: FORCE
22 | $(MAKE) -C ../../gtk all
23 |
24 | Scintilla-filtered.h: ../../include/Scintilla.h
25 | python filter-scintilla-h.py $< > $@
26 |
27 | libscintilla.so: ../../bin/scintilla.a
28 | $(CXX) -shared -o $@ -Wl,--whole-archive $^ -Wl,--no-whole-archive $(GTK_LIBS)
29 |
30 | Scintilla-0.1.gir: libscintilla.so Scintilla-filtered.h
31 | LDFLAGS=-Wl,-rpath=$(shell pwd) \
32 | $(GI_SCANNER) --no-libtool --warn-all -i Gtk-$(GTKVERSION) -DG_IR_SCANNING -DGTK \
33 | --cflags-begin $(GTK_CFLAGS) -include gtk/gtk.h \
34 | -include Scintilla-filtered.h -I../../include --cflags-end \
35 | --accept-unprefixed \
36 | --c-include Scintilla.h --c-include ScintillaWidget.h \
37 | -n Scintilla --nsversion 0.1 --library scintilla -L$(PWD) \
38 | ../../include/Sci_Position.h ../../include/ScintillaWidget.h Scintilla-filtered.h \
39 | -o $@
40 |
41 | Scintilla-0.1.typelib: Scintilla-0.1.gir
42 | $(GI_COMPILER) $^ -o $@
43 |
44 | clean:
45 | rm -f libscintilla.so Scintilla-0.1.gir Scintilla-0.1.typelib Scintilla-filtered.h
46 | $(MAKE) -C ../../gtk clean
47 |
48 | test: Scintilla-0.1.gir Scintilla-0.1.typelib
49 | @echo Verifying Scintilla-0.1.gir file
50 | @diff $<.good $< || (echo "GIR FILE MISMATCH!"; exit 1)
51 | @echo Launching gi-test.py python program
52 | GI_TYPELIB_PATH=$(PWD) LD_LIBRARY_PATH=$(PWD) \
53 | python $(PWD)/gi-test.py
54 |
--------------------------------------------------------------------------------
/scintilla/test/unit/LICENSE_1_0.txt:
--------------------------------------------------------------------------------
1 | Boost Software License - Version 1.0 - August 17th, 2003
2 |
3 | Permission is hereby granted, free of charge, to any person or organization
4 | obtaining a copy of the software and accompanying documentation covered by
5 | this license (the "Software") to use, reproduce, display, distribute,
6 | execute, and transmit the Software, and to prepare derivative works of the
7 | Software, and to permit third-parties to whom the Software is furnished to
8 | do so, all subject to the following:
9 |
10 | The copyright notices in the Software and this entire statement, including
11 | the above license grant, this restriction and the following disclaimer,
12 | must be included in all copies of the Software, in whole or in part, and
13 | all derivative works of the Software, unless such copies or derivative
14 | works are solely in the form of machine-executable object code generated by
15 | a source language processor.
16 |
17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 | FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
20 | SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
21 | FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
22 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23 | DEALINGS IN THE SOFTWARE.
24 |
--------------------------------------------------------------------------------
/scintilla/test/unit/README:
--------------------------------------------------------------------------------
1 | The test/unit directory contains unit tests for Scintilla data structures.
2 |
3 | The tests can be run on Windows, OS X, or Linux using g++ and GNU make.
4 | The Catch test framework is used.
5 | https://github.com/philsquared/Catch
6 | The file catch.hpp is under the Boost Software License which is contained in LICENSE_1_0.txt
7 |
8 | To run the tests on OS X or Linux:
9 | make test
10 |
11 | To run the tests on Windows:
12 | mingw32-make test
13 |
14 | Visual C++ (2010+) and nmake can also be used on Windows:
15 | nmake -f test.mak test
16 |
--------------------------------------------------------------------------------
/scintilla/test/unit/Sci.natvis:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | {{size = {lengthBody}}}
5 |
6 | - lengthBody
7 | - part1Length
8 | - gapLength
9 |
10 | lengthBody
11 | body[($i<part1Length)?$i:$i+gapLength]
12 |
13 |
14 |
15 |
16 | {{size = {body->lengthBody}}}
17 |
18 |
19 | body->lengthBody
20 | body->body[($i<body->part1Length)?$i:$i+body->gapLength]+($i>stepPartition?stepLength:0)
21 |
22 |
23 |
24 |
25 | _Mypair._Myval2
26 | empty
27 | unique_ptr {*_Mypair._Myval2}
28 |
29 | _Mypair._Myval2
30 | _Mypair
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/scintilla/test/unit/SciTE.properties:
--------------------------------------------------------------------------------
1 | command.go.*.cxx=./unitTest
2 | if PLAT_WIN
3 | make.command=mingw32-make
4 | command.go.*.cxx=unitTest
5 | command.go.needs.$(file.patterns.cplusplus)=$(make.command)
6 |
--------------------------------------------------------------------------------
/scintilla/test/unit/UnitTester.cxx:
--------------------------------------------------------------------------------
1 | // UnitTester.cpp : Defines the entry point for the console application.
2 | //
3 |
4 | // Catch uses std::uncaught_exception which is deprecated in C++17.
5 | // This define silences a warning from Visual C++.
6 | #define _SILENCE_CXX17_UNCAUGHT_EXCEPTION_DEPRECATION_WARNING
7 |
8 | #include
9 | #include
10 |
11 | #include
12 | #include
13 | #include
14 |
15 | #include "Platform.h"
16 |
17 | #define CATCH_CONFIG_WINDOWS_CRTDBG
18 | #define CATCH_CONFIG_RUNNER
19 | #include "catch.hpp"
20 |
21 | // Needed for PLATFORM_ASSERT in code being tested
22 |
23 | namespace Scintilla {
24 |
25 | void Platform::Assert(const char *c, const char *file, int line) {
26 | fprintf(stderr, "Assertion [%s] failed at %s %d\n", c, file, line);
27 | abort();
28 | }
29 |
30 | void Platform::DebugPrintf(const char *format, ...) {
31 | char buffer[2000];
32 | va_list pArguments;
33 | va_start(pArguments, format);
34 | vsprintf(buffer, format, pArguments);
35 | va_end(pArguments);
36 | fprintf(stderr, "%s", buffer);
37 | }
38 |
39 | }
40 |
41 | int main(int argc, char* argv[]) {
42 | const int result = Catch::Session().run(argc, argv);
43 |
44 | return result;
45 | }
46 |
--------------------------------------------------------------------------------
/scintilla/test/unit/makefile:
--------------------------------------------------------------------------------
1 | # Build all the unit tests using GNU make and either g++ or clang
2 | # Should be run using mingw32-make on Windows, not nmake
3 | # On Windows g++ is used, on OS X clang, and on Linux G++ is used by default
4 | # but clang can be used by defining CLANG when invoking make
5 | # clang works only with libc++, not libstdc++
6 | # Tested with clang 9 and g++ 9
7 |
8 | CXXSTD=c++17
9 |
10 | ifndef windir
11 | ifeq ($(shell uname),Darwin)
12 | # On OS X always use clang as g++ is old version
13 | CLANG = 1
14 | USELIBCPP = 1
15 | endif
16 | endif
17 |
18 | CXXFLAGS += --std=$(CXXSTD)
19 |
20 | ifdef CLANG
21 | CXX = clang++
22 | ifdef USELIBCPP
23 | # OS X, use libc++ but don't have sanitizers
24 | CXXFLAGS += --stdlib=libc++
25 | LINKFLAGS = -lc++
26 | else
27 | # Linux, have sanitizers
28 | SANITIZE = -fsanitize=address,undefined
29 | CXXFLAGS += $(SANITIZE)
30 | endif
31 | else
32 | CXX = g++
33 | endif
34 |
35 | ifdef windir
36 | DEL = del /q
37 | EXE = unitTest.exe
38 | else
39 | DEL = rm -f
40 | EXE = unitTest
41 | endif
42 |
43 | INCLUDEDIRS = -I ../../include -I ../../src -I../../lexlib
44 |
45 | CPPFLAGS += $(INCLUDEDIRS)
46 | CXXFLAGS += -Wall -Wextra
47 |
48 | # Files in this directory containing tests
49 | TESTSRC=test*.cxx
50 | # Files being tested from scintilla/src directory
51 | TESTEDSRC=\
52 | ../../lexlib/WordList.cxx \
53 | ../../src/CellBuffer.cxx \
54 | ../../src/CharClassify.cxx \
55 | ../../src/ContractionState.cxx \
56 | ../../src/Decoration.cxx \
57 | ../../src/PerLine.cxx \
58 | ../../src/RunStyles.cxx \
59 | ../../src/UniConversion.cxx \
60 | ../../src/UniqueString.cxx
61 |
62 | TESTS=$(EXE)
63 |
64 | all: $(TESTS)
65 |
66 | test: $(TESTS)
67 | ./$(EXE)
68 |
69 | clean:
70 | $(DEL) $(TESTS) *.o *.obj *.exe
71 |
72 | $(EXE): $(TESTSRC) $(TESTEDSRC) unitTest.cxx
73 | $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(LINKFLAGS) $^ -o $@
74 |
--------------------------------------------------------------------------------
/scintilla/test/unit/test.mak:
--------------------------------------------------------------------------------
1 | # Build all the unit tests with Microsoft Visual C++ using nmake
2 | # Tested with Visual C++ 2019
3 |
4 | DEL = del /q
5 | EXE = unitTest.exe
6 |
7 | INCLUDEDIRS = /I../../include /I../../src /I../../lexlib
8 |
9 | CXXFLAGS = /EHsc /std:c++17 /D_HAS_AUTO_PTR_ETC=1 /wd 4805 $(INCLUDEDIRS)
10 |
11 | # Files in this directory containing tests
12 | TESTSRC=test*.cxx
13 | # Files being tested from scintilla/src directory
14 | TESTEDSRC=\
15 | ../../lexlib/WordList.cxx \
16 | ../../src/CellBuffer.cxx \
17 | ../../src/CharClassify.cxx \
18 | ../../src/ContractionState.cxx \
19 | ../../src/Decoration.cxx \
20 | ../../src/PerLine.cxx \
21 | ../../src/RunStyles.cxx \
22 | ../../src/UniConversion.cxx \
23 | ../../src/UniqueString.cxx
24 |
25 | TESTS=$(EXE)
26 |
27 | all: $(TESTS)
28 |
29 | test: $(TESTS)
30 | $(EXE)
31 |
32 | clean:
33 | $(DEL) $(TESTS) *.o *.obj *.exe
34 |
35 | $(EXE): $(TESTSRC) $(TESTEDSRC) $(@B).obj
36 | $(CXX) $(CXXFLAGS) /Fe$@ $**
37 |
--------------------------------------------------------------------------------
/scintilla/test/xite.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 | # -*- coding: utf-8 -*-
3 | # Requires Python 3.6 or later
4 |
5 | import XiteWin
6 |
7 | if __name__ == "__main__":
8 | XiteWin.main("")
9 |
--------------------------------------------------------------------------------
/scintilla/tgzsrc:
--------------------------------------------------------------------------------
1 | cd ..
2 | rm -f scintilla.tgz
3 | tar --create --exclude \*.o --exclude \*.obj --exclude \*.dll --exclude \*.so --exclude \*.exe --exclude \*.a scintilla/* \
4 | | gzip -c >scintilla.tgz
5 |
--------------------------------------------------------------------------------
/scintilla/version.txt:
--------------------------------------------------------------------------------
1 | 446
2 |
--------------------------------------------------------------------------------
/scintilla/win32/DepGen.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 | # DepGen.py - produce a make dependencies file for Scintilla
3 | # Copyright 2019 by Neil Hodgson
4 | # The License.txt file describes the conditions under which this software may be distributed.
5 | # Requires Python 3.6 or later
6 |
7 | import sys
8 |
9 | sys.path.append("..")
10 |
11 | from scripts import Dependencies
12 |
13 | topComment = "# Created by DepGen.py. To recreate, run DepGen.py.\n"
14 |
15 | def Generate():
16 | sources = ["../src/*.cxx", "../lexlib/*.cxx", "../lexers/*.cxx"]
17 | includes = ["../include", "../src", "../lexlib"]
18 |
19 | # Create the dependencies file for g++
20 | deps = Dependencies.FindDependencies(["../win32/*.cxx"] + sources, ["../win32"] + includes, ".o", "../win32/")
21 |
22 | # Add ScintillaBaseL as the same as ScintillaBase
23 | deps = Dependencies.InsertSynonym(deps, "ScintillaBase.o", "ScintillaBaseL.o")
24 |
25 | # Add CatalogueL as the same as Catalogue
26 | deps = Dependencies.InsertSynonym(deps, "Catalogue.o", "CatalogueL.o")
27 |
28 | Dependencies.UpdateDependencies("../win32/deps.mak", deps, topComment)
29 |
30 | # Create the dependencies file for MSVC
31 |
32 | # Place the objects in $(DIR_O) and change extension from ".o" to ".obj"
33 | deps = [["$(DIR_O)/"+Dependencies.PathStem(obj)+".obj", headers] for obj, headers in deps]
34 |
35 | Dependencies.UpdateDependencies("../win32/nmdeps.mak", deps, topComment)
36 |
37 | if __name__ == "__main__":
38 | Generate()
--------------------------------------------------------------------------------
/scintilla/win32/HanjaDic.h:
--------------------------------------------------------------------------------
1 | // Scintilla source code edit control
2 | /** @file HanjaDic.h
3 | ** Korean Hanja Dictionary
4 | ** Convert between Korean Hanja and Hangul by COM interface.
5 | **/
6 | // Copyright 2015 by Neil Hodgson
7 | // The License.txt file describes the conditions under which this software may be distributed.
8 |
9 | #ifndef HANJADIC_H
10 | #define HANJADIC_H
11 |
12 | namespace Scintilla {
13 |
14 | namespace HanjaDict {
15 |
16 | int GetHangulOfHanja(wchar_t *inout);
17 |
18 | }
19 |
20 | }
21 |
22 | #endif
23 |
--------------------------------------------------------------------------------
/scintilla/win32/SciTE.properties:
--------------------------------------------------------------------------------
1 | command.build.SConstruct=scons.bat .
2 | command.name.1.SConstruct=scons clean
3 | command.1.SConstruct=scons.bat --clean .
4 |
5 | command.build.*.mak=nmake -f $(FileNameExt) DEBUG=1 QUIET=1
6 | command.name.1.*.mak=nmake clean
7 | command.1.*.mak=nmake -f $(FileNameExt) clean
8 | command.name.2.*.mak=Borland Make
9 | command.2.*.mak=make -f $(FileNameExt)
10 | command.subsystem.2.*.mak=0
11 | command.name.3.*.mak=make clean
12 | command.3.*.mak=make -f $(FileNameExt) clean
13 | command.name.4.*.mak=make debug
14 | command.4.*.mak=make DEBUG=1 -f $(FileNameExt)
15 | command.name.5.*.mak=nmake debug
16 | command.5.*.mak=nmake DEBUG=1 -f $(FileNameExt)
17 | # SciTE.properties is the per directory local options file and can be used to override
18 | # settings made in SciTEGlobal.properties
19 | command.build.*.cxx=nmake -f scintilla.mak DEBUG=1 QUIET=1
20 | command.build.*.h=nmake -f scintilla.mak DEBUG=1 QUIET=1
21 | command.build.*.rc=nmake -f scintilla.mak DEBUG=1 QUIET=1
22 |
--------------------------------------------------------------------------------
/scintilla/win32/ScintRes.rc:
--------------------------------------------------------------------------------
1 | // Resource file for Scintilla
2 | // Copyright 1998-2010 by Neil Hodgson
3 | // The License.txt file describes the conditions under which this software may be distributed.
4 |
5 | #include
6 |
7 | #define VERSION_SCINTILLA "4.4.6 for SimpleNotePad"
8 | #define VERSION_WORDS 4, 4, 6, 0
9 |
10 | VS_VERSION_INFO VERSIONINFO
11 | FILEVERSION VERSION_WORDS
12 | PRODUCTVERSION VERSION_WORDS
13 | FILEFLAGSMASK 0x3fL
14 | FILEFLAGS 0
15 | FILEOS VOS_NT_WINDOWS32
16 | FILETYPE VFT_APP
17 | FILESUBTYPE VFT2_UNKNOWN
18 | BEGIN
19 | BLOCK "VarFileInfo"
20 | BEGIN
21 | VALUE "Translation", 0x409, 1200
22 | END
23 | BLOCK "StringFileInfo"
24 | BEGIN
25 | BLOCK "040904b0"
26 | BEGIN
27 | VALUE "CompanyName", "Neil Hodgson neilh@scintilla.org\0"
28 | VALUE "FileDescription", "Scintilla.DLL - a Source Editing Component\0"
29 | VALUE "FileVersion", VERSION_SCINTILLA "\0"
30 | VALUE "InternalName", "Scintilla\0"
31 | VALUE "LegalCopyright", "Copyright 1998-2012 by Neil Hodgson\0"
32 | VALUE "OriginalFilename", "Scintilla.DLL\0"
33 | VALUE "ProductName", "Scintilla\0"
34 | VALUE "ProductVersion", VERSION_SCINTILLA "\0"
35 | END
36 | END
37 | END
38 |
--------------------------------------------------------------------------------
/scintilla/win32/Scintilla.def:
--------------------------------------------------------------------------------
1 | EXPORTS
2 | Scintilla_DirectFunction
--------------------------------------------------------------------------------
/scintilla/win32/ScintillaDLL.cxx:
--------------------------------------------------------------------------------
1 | // Scintilla source code edit control
2 | /** @file ScintillaDLL.cxx
3 | ** DLL entry point for Scintilla.
4 | **/
5 | // Copyright 1998-2018 by Neil Hodgson
6 | // The License.txt file describes the conditions under which this software may be distributed.
7 |
8 | #undef _WIN32_WINNT
9 | #define _WIN32_WINNT 0x0500
10 | #undef WINVER
11 | #define WINVER 0x0500
12 | #include
13 |
14 | #include "Scintilla.h"
15 | #include "ScintillaWin.h"
16 |
17 | extern "C"
18 | __declspec(dllexport)
19 | sptr_t __stdcall Scintilla_DirectFunction(
20 | ScintillaWin *sci, UINT iMessage, uptr_t wParam, sptr_t lParam) {
21 | return Scintilla::DirectFunction(sci, iMessage, wParam, lParam);
22 | }
23 |
24 | extern "C" int APIENTRY DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpvReserved) {
25 | //Platform::DebugPrintf("Scintilla::DllMain %d %d\n", hInstance, dwReason);
26 | if (dwReason == DLL_PROCESS_ATTACH) {
27 | if (!Scintilla_RegisterClasses(hInstance))
28 | return FALSE;
29 | } else if (dwReason == DLL_PROCESS_DETACH) {
30 | if (lpvReserved == NULL) {
31 | Scintilla::ResourcesRelease(true);
32 | }
33 | }
34 | return TRUE;
35 | }
36 |
--------------------------------------------------------------------------------
/scintilla/win32/ScintillaWin.h:
--------------------------------------------------------------------------------
1 | // Scintilla source code edit control
2 | /** @file ScintillaWin.h
3 | ** Define functions from ScintillaWin.cxx that can be called from ScintillaDLL.cxx.
4 | **/
5 | // Copyright 1998-2018 by Neil Hodgson
6 | // The License.txt file describes the conditions under which this software may be distributed.
7 |
8 | #ifndef SCINTILLAWIN_H
9 | #define SCINTILLAWIN_H
10 |
11 | class ScintillaWin;
12 |
13 | namespace Scintilla {
14 |
15 | int ResourcesRelease(bool fromDllMain) noexcept;
16 | sptr_t DirectFunction(ScintillaWin *sci, UINT iMessage, uptr_t wParam, sptr_t lParam);
17 |
18 | }
19 |
20 | #endif
21 |
--------------------------------------------------------------------------------
/scintilla/zipsrc.bat:
--------------------------------------------------------------------------------
1 | cd ..
2 | del/q scintilla.zip
3 | zip scintilla.zip scintilla\*.* scintilla\*\*.* scintilla\*\*\*.* scintilla\*\*\*\*.* scintilla\*\*\*\*\*.* -x *.o -x *.obj -x *.dll -x *.lib -x *.res -x *.exp
4 | cd scintilla
5 |
--------------------------------------------------------------------------------