├── .gitignore ├── .tfignore ├── Build.cmd ├── ChangeLog.txt ├── LICENSE - CPropertyList.txt ├── LICENSE - Scintilla.txt ├── LICENSE - Text Designer Outline Text Library.txt ├── LICENSE - box blur filter.txt ├── License.txt ├── README.md ├── TextDesinger ├── DiffusedShadowStrategy.cpp ├── DiffusedShadowStrategy.h ├── GDIPath.cpp ├── GDIPath.h ├── IOutlineText.h ├── ITextStrategy.h ├── License.html ├── OutlineText.cpp ├── OutlineText.h ├── PngOutlineText.cpp ├── PngOutlineText.h ├── TextDblOutlineStrategy.cpp ├── TextDblOutlineStrategy.h ├── TextDesigner.vcproj ├── TextDesigner.vcxproj ├── TextDesigner.vcxproj.filters ├── TextGlowStrategy.cpp ├── TextGlowStrategy.h ├── TextOutlineStrategy.cpp ├── TextOutlineStrategy.h ├── stdafx.cpp └── stdafx.h ├── contrib ├── colorschemes │ ├── Bright.cfg │ ├── Dark.cfg │ ├── Readme.txt │ └── Ruby Blue.cfg └── jsbeautifier │ ├── HTML-Beautify.js │ ├── beautify-tests.js │ ├── beautify.js │ ├── index.html │ ├── javascriptobfuscator_unpacker.js │ ├── license.txt │ └── sanitytest.js ├── docs ├── Callbacks.txt ├── Codepages.txt ├── Flags.txt ├── Helpers.txt ├── Interfaces.txt ├── Notes & Hints.txt └── Preprocessors.txt ├── extras ├── interface.api └── jscript.api ├── foo_uie_wsh_panel_mod_plus.sln ├── foo_uie_wsh_panel_mod_plus ├── IDataObjectImpl.cpp ├── IDataObjectImpl.h ├── IDropSourceImpl.h ├── IDropTargetImpl.h ├── PropertyItem.h ├── PropertyItemEditors.h ├── PropertyItemImpl.h ├── PropertyList.h ├── SString.h ├── boxblurfilter.cpp ├── boxblurfilter.h ├── com_array.cpp ├── com_array.h ├── com_tools.cpp ├── com_tools.h ├── component_defines.h ├── config.cpp ├── config.h ├── dbgtrace.h ├── delay_loader.h ├── editorctrl.cpp ├── editorctrl.h ├── eslyric_callback_impl.h ├── foo_uie_wsh_panel_mod.cpp ├── foo_uie_wsh_panel_mod_plus.vcxproj ├── foo_uie_wsh_panel_mod_plus.vcxproj.filters ├── gdiplus_helpers.cpp ├── gdiplus_helpers.h ├── global_cfg.cpp ├── global_cfg.h ├── helpers.cpp ├── helpers.h ├── host.cpp ├── host.h ├── host_droptarget.cpp ├── host_droptarget.h ├── host_timer_dispatcher.cpp ├── host_timer_dispatcher.h ├── input_box.cpp ├── input_box.h ├── lang.cpp ├── lang.h ├── obsolete.h ├── panel_manager.cpp ├── panel_manager.h ├── panel_tooltip_param.h ├── popup_msg.h ├── process_locations.h ├── res │ ├── default.js │ ├── default_cn.js │ └── resource.rc ├── resource.h ├── scintilla_prop_sets.cpp ├── scintilla_prop_sets.h ├── script_callback_invoker.cpp ├── script_callback_invoker.h ├── script_interface.h ├── script_interface_datatransfer.h ├── script_interface_datatransfer_impl.cpp ├── script_interface_datatransfer_impl.h ├── script_interface_dragsource.h ├── script_interface_dragsource_impl.cpp ├── script_interface_dragsource_impl.h ├── script_interface_drop_impl.cpp ├── script_interface_drop_impl.h ├── script_interface_impl.cpp ├── script_interface_impl.h ├── script_interface_playlist.h ├── script_interface_playlist_impl.cpp ├── script_interface_playlist_impl.h ├── script_interface_tooltip.h ├── script_interface_tooltip_impl.cpp ├── script_interface_tooltip_impl.h ├── script_preprocessor.cpp ├── script_preprocessor.h ├── splitter_window.h ├── stackblur.cpp ├── stackblur.h ├── stdafx.cpp ├── stdafx.h ├── thread_pool.cpp ├── thread_pool.h ├── ui_conf.cpp ├── ui_conf.h ├── ui_find.cpp ├── ui_find.h ├── ui_goto.cpp ├── ui_goto.h ├── ui_name_value_edit.cpp ├── ui_name_value_edit.h ├── ui_pref.cpp ├── ui_pref.h ├── ui_property.cpp ├── ui_property.h ├── ui_replace.cpp ├── ui_replace.h ├── user_message.h ├── version.cpp ├── version.h ├── wsh_mainmenu.h ├── wsh_panel_window.cpp ├── wsh_panel_window.h ├── wsh_panel_window_cui.cpp ├── wsh_panel_window_cui.h ├── wsh_panel_window_dui.cpp ├── wsh_panel_window_dui.h ├── wsh_playlist_misc.cpp ├── wsh_playlist_misc.h └── wtlscintilla.h ├── samples ├── ApplyMask.txt ├── BoxBlur.txt ├── Drag Drop Basic.txt ├── GetAlbumArtAsync.txt ├── GetAlbumArtV2.txt ├── Glow Text Sample.txt ├── LoadImageAsync.txt ├── MainMenuManager All-In-One.txt ├── MainMenuManager.txt ├── Menu Sample (Advance).txt ├── Menu Sample (Base).txt ├── PBOButton(Menu).txt ├── PBOButton.txt ├── Preprocessor.txt ├── Scroll with GdiDrawText.txt ├── SimpleFollowCursor.txt ├── SimpleThemedButton.txt ├── Themed Seek Bar.txt ├── Timer.txt ├── Tooltip (Tracking).txt ├── Tooltip.txt ├── Volbar with GdiDrawText.txt ├── Volbar.txt ├── Watch Metadb Change (Base).txt ├── images │ ├── image.jpg │ └── mask.png └── scripts │ └── includeme.js └── scintilla ├── .hg_archival.txt ├── .hgeol ├── .hgignore ├── .hgtags ├── License.txt ├── README ├── cocoa ├── Framework.mk ├── InfoBar.h ├── InfoBar.mm ├── InfoBarCommunicator.h ├── PlatCocoa.h ├── PlatCocoa.mm ├── QuartzTextLayout.h ├── QuartzTextStyle.h ├── QuartzTextStyleAttribute.h ├── SciTest.mk ├── ScintillaCocoa.h ├── ScintillaCocoa.mm ├── ScintillaFramework │ ├── English.lproj │ │ └── InfoPlist.strings │ ├── Info.plist │ └── ScintillaFramework.xcodeproj │ │ └── project.pbxproj ├── ScintillaTest │ ├── AppController.h │ ├── AppController.mm │ ├── English.lproj │ │ ├── InfoPlist.strings │ │ └── MainMenu.xib │ ├── Info.plist │ ├── Scintilla-Info.plist │ ├── ScintillaTest.xcodeproj │ │ └── project.pbxproj │ ├── TestData.sql │ └── main.m ├── ScintillaView.h ├── ScintillaView.mm ├── checkbuildosx.sh ├── common.mk └── 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 ├── delcvs.bat ├── doc ├── Design.html ├── Icons.html ├── Indicators.png ├── Lexer.txt ├── Markers.png ├── SciBreak.jpg ├── SciCoding.html ├── SciRest.jpg ├── SciTEIco.png ├── SciWord.jpg ├── ScintillaDoc.html ├── ScintillaDownload.html ├── ScintillaHistory.html ├── ScintillaRelated.html ├── ScintillaToDo.html ├── ScintillaUsage.html ├── Steps.html ├── annotations.png ├── index.html └── styledmargin.png ├── gtk ├── Converter.h ├── PlatGTK.cxx ├── ScintillaGTK.cxx ├── deps.mak ├── makefile ├── scintilla-marshal.c ├── scintilla-marshal.h └── scintilla-marshal.list ├── include ├── .cvsignore ├── Face.py ├── HFacer.py ├── ILexer.h ├── Platform.h ├── SciLexer.h ├── Scintilla.h ├── Scintilla.iface └── ScintillaWidget.h ├── lexers ├── LexCPP.cxx └── LexVB.cxx ├── lexers_unused ├── 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 ├── LexBullant.cxx ├── LexCLW.cxx ├── LexCOBOL.cxx ├── LexCSS.cxx ├── LexCaml.cxx ├── LexCmake.cxx ├── LexCoffeeScript.cxx ├── LexConf.cxx ├── LexCrontab.cxx ├── LexCsound.cxx ├── LexD.cxx ├── LexECL.cxx ├── LexEScript.cxx ├── LexEiffel.cxx ├── LexErlang.cxx ├── LexFlagship.cxx ├── LexForth.cxx ├── LexFortran.cxx ├── LexGAP.cxx ├── LexGui4Cli.cxx ├── LexHTML.cxx ├── LexHaskell.cxx ├── LexInno.cxx ├── LexKix.cxx ├── LexLisp.cxx ├── LexLout.cxx ├── LexLua.cxx ├── LexMMIXAL.cxx ├── LexMPT.cxx ├── LexMSSQL.cxx ├── LexMagik.cxx ├── LexMarkdown.cxx ├── LexMatlab.cxx ├── LexMetapost.cxx ├── LexModula.cxx ├── LexMySQL.cxx ├── LexNimrod.cxx ├── LexNsis.cxx ├── LexOScript.cxx ├── LexOpal.cxx ├── LexOthers.cxx ├── LexPB.cxx ├── LexPLM.cxx ├── LexPOV.cxx ├── LexPS.cxx ├── LexPascal.cxx ├── LexPerl.cxx ├── LexPowerPro.cxx ├── LexPowerShell.cxx ├── LexProgress.cxx ├── LexPython.cxx ├── LexR.cxx ├── LexRebol.cxx ├── LexRuby.cxx ├── LexSML.cxx ├── LexSQL.cxx ├── LexScriptol.cxx ├── LexSmalltalk.cxx ├── LexSorcus.cxx ├── LexSpecman.cxx ├── LexSpice.cxx ├── LexTACL.cxx ├── LexTADS3.cxx ├── LexTAL.cxx ├── LexTCL.cxx ├── LexTCMD.cxx ├── LexTeX.cxx ├── LexTxt2tags.cxx ├── LexVHDL.cxx ├── LexVerilog.cxx ├── LexVisualProlog.cxx └── LexYAML.cxx ├── lexlib ├── Accessor.cxx ├── Accessor.h ├── CharacterCategory.cxx ├── CharacterCategory.h ├── CharacterSet.cxx ├── CharacterSet.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 ├── Face.py ├── FileGenerator.py ├── GenerateCaseConvert.py ├── GenerateCharacterCategory.py ├── HFacer.py ├── HeaderOrder.txt ├── LexGen.py └── ScintillaData.py ├── 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 ├── Decoration.cxx ├── Decoration.h ├── Document.cxx ├── Document.h ├── EditModel.cxx ├── EditModel.h ├── EditView.cxx ├── EditView.h ├── Editor.cxx ├── Editor.h ├── ExternalLexer.cxx ├── ExternalLexer.h ├── FontQuality.h ├── Indicator.cxx ├── Indicator.h ├── KeyMap.cxx ├── KeyMap.h ├── LexGen.py ├── LineMarker.cxx ├── LineMarker.h ├── MarginView.cxx ├── MarginView.h ├── Partitioning.h ├── PerLine.cxx ├── PerLine.h ├── PositionCache.cxx ├── PositionCache.h ├── RESearch.cxx ├── RESearch.h ├── RunStyles.cxx ├── RunStyles.h ├── SVector.h ├── SciTE.properties ├── ScintillaBase.cxx ├── ScintillaBase.h ├── Selection.cxx ├── Selection.h ├── SplitVector.h ├── Style.cxx ├── Style.h ├── UniConversion.cxx ├── UniConversion.h ├── UnicodeFromUTF8.h ├── ViewStyle.cxx ├── ViewStyle.h ├── XPM.cxx └── XPM.h ├── test ├── MessageNumbers.py ├── README ├── ScintillaCallable.py ├── XiteMenu.py ├── XiteQt.py ├── XiteWin.py ├── examples │ ├── 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.php │ ├── x.php.styled │ ├── x.pl │ ├── x.pl.styled │ ├── x.py │ ├── x.py.styled │ ├── x.rb │ ├── x.rb.styled │ ├── x.vb │ └── x.vb.styled ├── lexTests.py ├── performanceTests.py ├── simpleTests.py ├── unit │ ├── LICENSE_1_0.txt │ ├── README │ ├── SciTE.properties │ ├── catch.hpp │ ├── makefile │ ├── test.mak │ ├── testCellBuffer.cxx │ ├── testCharClassify.cxx │ ├── testContractionState.cxx │ ├── testDecoration.cxx │ ├── testPartitioning.cxx │ ├── testRunStyles.cxx │ ├── testSparseState.cxx │ ├── testSplitVector.cxx │ └── unitTest.cxx └── xite.py ├── tgzsrc ├── version.txt ├── win32 ├── .cvsignore ├── CheckD2D.cxx ├── PlatWin.cxx ├── PlatWin.h ├── SciLexer.vcxproj ├── SciTE.properties ├── ScintRes.rc ├── Scintilla.def ├── ScintillaWin.cxx ├── deps.mak ├── makefile ├── scintilla.mak ├── scintilla_vc6.mak └── vcproj │ ├── scintilla.vcxproj │ └── scintilla.vcxproj.filters └── zipsrc.bat /.gitignore: -------------------------------------------------------------------------------- 1 | Thumbs.db 2 | *.obj 3 | *.exe 4 | *.pdb 5 | *.user 6 | *.aps 7 | *.pch 8 | *.vspscc 9 | *_i.c 10 | *_p.c 11 | *.ncb 12 | *.suo 13 | *.sln.docstates 14 | *.tlb 15 | *.tlh 16 | *.bak 17 | *.cache 18 | *.ilk 19 | *.log 20 | *.idl 21 | [Bb]in 22 | [Dd]ebug*/ 23 | *.lib 24 | *.sbr 25 | obj/ 26 | [Rr]elease*/ 27 | _ReSharper*/ 28 | [Tt]est[Rr]esult* 29 | *.vssscc 30 | $tf*/ 31 | -------------------------------------------------------------------------------- /.tfignore: -------------------------------------------------------------------------------- 1 | \.git -------------------------------------------------------------------------------- /Build.cmd: -------------------------------------------------------------------------------- 1 | @echo off 2 | if not exist "%VS100COMNTOOLS%vsvars32.bat" ( 3 | echo Cannot found Visual Studio 2010 Toolset. 4 | echo exiting... 5 | goto :end 6 | ) 7 | 8 | call "%VS100COMNTOOLS%vsvars32.bat" 9 | devenv /build Release foo_uie_wsh_panel_mod_plus.sln 10 | 11 | :end -------------------------------------------------------------------------------- /LICENSE - CPropertyList.txt: -------------------------------------------------------------------------------- 1 | Written by Bjarke Viksoe (bjarke@viksoe.dk) 2 | Copyright (c) 2001-2003 Bjarke Viksoe. 3 | Thanks to Pascal Binggeli for fixing the disabled items. 4 | Column resize supplied by Remco Verhoef, thanks. 5 | Also thanks to Daniel Bowen, Alex Kamenev and others for fixes. 6 | 7 | This code may be used in compiled form in any way you desire. This 8 | source file may be redistributed by any means PROVIDING it is 9 | not sold for profit without the authors written consent, and 10 | providing that this notice and the authors name is included. 11 | 12 | This file is provided "as is" with no expressed or implied warranty. 13 | The author accepts no liability if it causes any damage to you or your 14 | computer whatsoever. It's free, so don't hassle me about it. 15 | -------------------------------------------------------------------------------- /LICENSE - Scintilla.txt: -------------------------------------------------------------------------------- 1 | Copyright 1998-2003 by Neil Hodgson 2 | 3 | All Rights Reserved 4 | 5 | Permission to use, copy, modify, and distribute this software and its 6 | documentation for any purpose and without fee is hereby granted, 7 | provided that the above copyright notice appear in all copies and that 8 | both that copyright notice and this permission notice appear in 9 | supporting documentation. 10 | 11 | NEIL HODGSON DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS 12 | SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 13 | AND FITNESS, IN NO EVENT SHALL NEIL HODGSON BE LIABLE FOR ANY 14 | SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 15 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, 16 | WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER 17 | TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE 18 | OR PERFORMANCE OF THIS SOFTWARE. 19 | -------------------------------------------------------------------------------- /LICENSE - Text Designer Outline Text Library.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2009 Wong Shao Voon 2 | 3 | The Code Project Open License (CPOL) 4 | http://www.codeproject.com/info/cpol10.aspx 5 | -------------------------------------------------------------------------------- /LICENSE - box blur filter.txt: -------------------------------------------------------------------------------- 1 | Copyright 2006 Jerry Huxtable 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | -------------------------------------------------------------------------------- /License.txt: -------------------------------------------------------------------------------- 1 | Public Domain 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ###**foo_uie_wsh_panel_mod_plus** 2 | 3 | VS2010 Project 4 | 5 | Base on [WSH Panel Mod](http://code.google.com/p/foo-wsh-panel-mod/) 6 | 7 | other stuffs: 8 | 9 | [Foobar2000 SDK](http://www.foobar2000.org/SDK) 10 | 11 | [Columns UI SDK](http://yuo.be/development.php) 12 | 13 | [Windows Template Library(WTL)](http://sourceforge.net/projects/wtl/) -------------------------------------------------------------------------------- /TextDesinger/License.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ttsping/foo_uie_wsh_panel_mod_plus/fafd9a0cdbed36a73009b3d9cf5ea58ed9be2d78/TextDesinger/License.html -------------------------------------------------------------------------------- /TextDesinger/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // TextDesigner.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /TextDesinger/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #ifndef _WIN32_WINNT // Allow use of features specific to Windows XP or later. 9 | #define _WIN32_WINNT 0x0501 // Change this to the appropriate value to target other versions of Windows. 10 | #endif 11 | 12 | //#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers 13 | #include 14 | #include 15 | 16 | 17 | 18 | // TODO: reference additional headers your program requires here 19 | -------------------------------------------------------------------------------- /contrib/colorschemes/Bright.cfg: -------------------------------------------------------------------------------- 1 | # Ported by T.P Wang 2 | # Ported from Komodo Edit 3 | # Generated by WSH Panel Mod 4 | style.default=font:Courier New,size:10,fore:#000000,back:#ffffff 5 | style.comment=italics,fore:#666666 6 | style.keyword=fore:#000085 7 | style.indentifier=fore:#006600 8 | style.string=fore:#996633 9 | style.number=fore:#8b0000 10 | style.operator=fore:#781f87 11 | style.linenumber=font:Courier New,size:8,fore:#555555 12 | style.bracelight=bold,fore:#ff0000,back:#ffff99 13 | style.bracebad=bold,fore:#ff6666,back:#ffff66 14 | style.selection.fore= 15 | style.selection.back= 16 | style.selection.alpha=256 17 | style.caret.fore= 18 | style.caret.width=1 19 | style.caret.line.back= 20 | style.caret.line.back.alpha=256 21 | -------------------------------------------------------------------------------- /contrib/colorschemes/Dark.cfg: -------------------------------------------------------------------------------- 1 | # Ported by T.P Wang 2 | # Ported from Komodo Edit 3 | # Generated by WSH Panel Mod 4 | style.default=font:Courier New,size:10,fore:#ffffff,back:#000000 5 | style.comment=italics,fore:#adadad 6 | style.keyword=fore:#78e087 7 | style.indentifier=$(style.default) 8 | style.string=fore:#dcdc71 9 | style.number=fore:#74ffff 10 | style.operator=fore:#87e078 11 | style.linenumber=font:Courier New,size:8,fore:#777777 12 | style.bracelight=bold,fore:#379b9b 13 | style.bracebad=$(style.bracelight),back:#0000ff 14 | style.selection.fore= 15 | style.selection.back=#660000 16 | style.selection.alpha=256 17 | style.caret.fore=#ffffff 18 | style.caret.width=1 19 | style.caret.line.back=#003300 20 | style.caret.line.back.alpha=256 21 | -------------------------------------------------------------------------------- /contrib/colorschemes/Readme.txt: -------------------------------------------------------------------------------- 1 | Color schemes for WSH Panel Mod Editor. 2 | 3 | In foobar2000 preference, find "Tools/WSH Panel Mod" branch, Click "Import" to import these settings. -------------------------------------------------------------------------------- /contrib/colorschemes/Ruby Blue.cfg: -------------------------------------------------------------------------------- 1 | # Ported by T.P Wang 2 | # Generated by WSH Panel Mod 3 | style.default=font:Courier New,size:10,fore:#ffffff,back:#121e31 4 | style.comment=italics,fore:#428bdd 5 | style.keyword=fore:#f8bb00 6 | style.indentifier=$(style.default) 7 | style.string=fore:#1dc116 8 | style.number=fore:#eddd3d 9 | style.operator=fore:#8aa6c1 10 | style.linenumber=font:Courier New,size:8,fore:#2b91af 11 | style.bracelight=bold,fore:#000000,back:#ffee62 12 | style.bracebad=bold,fore:#ff0000 13 | style.selection.fore= 14 | style.selection.back=#38566f 15 | style.selection.alpha=256 16 | style.caret.fore=#ffffff 17 | style.caret.width=1 18 | style.caret.line.back=#253e5a 19 | style.caret.line.back.alpha=256 20 | -------------------------------------------------------------------------------- /contrib/jsbeautifier/license.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2009 Einar Lielmanis 2 | 3 | Permission is hereby granted, free of charge, to any person 4 | obtaining a copy of this software and associated documentation 5 | files (the "Software"), to deal in the Software without 6 | restriction, including without limitation the rights to use, 7 | copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the 9 | Software is furnished to do so, subject to the following 10 | conditions: 11 | 12 | The above copyright notice and this permission notice shall be 13 | included in all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 17 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 19 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 20 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 21 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | -------------------------------------------------------------------------------- /docs/Notes & Hints.txt: -------------------------------------------------------------------------------- 1 | 1. If anything goes wrong, check the console first. 2 | 2. Usage of gdi.Font() is different from original WSH Panel: gdi.Font(name, pxSize, style); 3 | 3. Don't call repaint functions such as window.Repaint() in callback function on_size() {}, especially in pseudo transparent mode. 4 | 4. Don't try to assign parameter "gr" from function on_paint(gr) {} with other value, nor try to store "gr" in another variable. 5 | 5. CollectGarbage() is useful in JScript when you want to free memory immediately. (But please also refer to #11) 6 | 6. Remember to retrieve window width and height in on_size() callback, because their values during startup is not reliable. 7 | 7. It's NOT recommended to create objects in callback function on_paint(), since it will be called frenquently. 8 | 8. Since v1.1.0, functions/methods which use IFbFileInfo Interface is replaced with IFbMetadbHandle Inferface. 9 | 9. jsbeautifier.org is a good site for formatting your JScript files. 10 | 10. Don't forget that error handling (JScript, VBScript) is useful to create more stable scripts. 11 | 11. Consider using Dispose() method instead of CollectGarbage() function in JScript. 12 | -------------------------------------------------------------------------------- /foo_uie_wsh_panel_mod_plus/IDropSourceImpl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | 9 | class IDropSourceImpl : public IDropSource 10 | { 11 | public: 12 | // IDropSource 13 | STDMETHODIMP QueryContinueDrag(BOOL fEscapePressed, DWORD grfKeyState) 14 | { 15 | // When escape key is pressed or mouse L&R button are pressed, end draging 16 | if (fEscapePressed || (grfKeyState & (MK_LBUTTON | MK_RBUTTON)) == (MK_LBUTTON | MK_RBUTTON)) 17 | return DRAGDROP_S_CANCEL; 18 | 19 | if ((grfKeyState & (MK_LBUTTON | MK_RBUTTON)) == 0) 20 | return DRAGDROP_S_DROP; 21 | 22 | return S_OK; 23 | } 24 | 25 | STDMETHODIMP GiveFeedback(DWORD dwEffect) 26 | { 27 | return DRAGDROP_S_USEDEFAULTCURSORS; 28 | } 29 | }; 30 | -------------------------------------------------------------------------------- /foo_uie_wsh_panel_mod_plus/boxblurfilter.h: -------------------------------------------------------------------------------- 1 | // This code is obtained from Huxtable.com 2 | // Ported by T.P Wang 3 | /* 4 | Copyright 2006 Jerry Huxtable 5 | 6 | Licensed under the Apache License, Version 2.0 (the "License"); 7 | you may not use this file except in compliance with the License. 8 | You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software 13 | distributed under the License is distributed on an "AS IS" BASIS, 14 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | See the License for the specific language governing permissions and 16 | limitations under the License. 17 | */ 18 | #pragma once 19 | 20 | class box_blur_filter 21 | { 22 | public: 23 | box_blur_filter() : m_radius(1), m_iterations(1) 24 | { 25 | } 26 | 27 | inline void set_op(int p_radius = 1, int p_iterations = 1) throw() 28 | { 29 | m_radius = p_radius; 30 | m_iterations = p_iterations; 31 | } 32 | 33 | void filter(Gdiplus::Bitmap & p_img) throw(); 34 | 35 | static void blur(const int * in, int * out, int width, int height, int radius) throw(); 36 | 37 | public: 38 | static inline BYTE get_color_alpha(DWORD color) 39 | { 40 | return (color >> ALPHA_SHIFT) & 0xff; 41 | } 42 | 43 | static inline BYTE get_color_red(DWORD color) 44 | { 45 | return (color >> RED_SHIFT) & 0xff; 46 | } 47 | 48 | static inline BYTE get_color_green(DWORD color) 49 | { 50 | return (color >> GREEN_SHIFT) & 0xff; 51 | } 52 | 53 | static inline BYTE get_color_blue(DWORD color) 54 | { 55 | return (color >> BLUE_SHIFT) & 0xff; 56 | } 57 | 58 | template 59 | static inline T clamp(T x, T l, T r) 60 | { 61 | return (x < l) ? l : ((x > r) ? r : x); 62 | } 63 | 64 | static inline DWORD make_argb(BYTE a, BYTE r, BYTE g, BYTE b) 65 | { 66 | return (a << ALPHA_SHIFT) | (b << BLUE_SHIFT) | (g << GREEN_SHIFT) | (r << RED_SHIFT); 67 | } 68 | 69 | private: 70 | int m_radius; 71 | int m_iterations; 72 | }; 73 | -------------------------------------------------------------------------------- /foo_uie_wsh_panel_mod_plus/com_tools.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "com_tools.h" 3 | 4 | 5 | bool name_to_id_cache::lookup(hash_type hash, DISPID* p_dispid) const 6 | { 7 | DISPID dispId; 8 | if (!m_map.query(hash, dispId)) return false; 9 | (*p_dispid) = dispId; 10 | return true; 11 | } 12 | 13 | void name_to_id_cache::add(hash_type hash, DISPID dispid) 14 | { 15 | m_map[hash] = dispid; 16 | } 17 | 18 | name_to_id_cache::hash_type name_to_id_cache::g_hash(const wchar_t* name) 19 | { 20 | return LHashValOfName(LANG_NEUTRAL, name); 21 | } 22 | 23 | 24 | void type_info_cache_holder::init_from_typelib(ITypeLib * p_typeLib, const GUID & guid) 25 | { 26 | p_typeLib->GetTypeInfoOfGuid(guid, &m_type_info); 27 | } 28 | 29 | HRESULT type_info_cache_holder::GetTypeInfo(UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo) 30 | { 31 | if (empty()) return E_UNEXPECTED; 32 | if (!ppTInfo) return E_POINTER; 33 | if (iTInfo != 0) return DISP_E_BADINDEX; 34 | m_type_info->AddRef(); 35 | (*ppTInfo) = m_type_info.GetInterfacePtr(); 36 | return S_OK; 37 | } 38 | 39 | HRESULT type_info_cache_holder::GetIDsOfNames(LPOLESTR *rgszNames, UINT cNames, MEMBERID *pMemId) 40 | { 41 | PFC_ASSERT(m_type_info != NULL); 42 | HRESULT hr = S_OK; 43 | for (unsigned i = 0; i < cNames && SUCCEEDED(hr); ++i) 44 | { 45 | auto hash = name_to_id_cache::g_hash(rgszNames[i]); 46 | if (!m_cache.lookup(hash, &pMemId[i])) 47 | { 48 | hr = m_type_info->GetIDsOfNames(&rgszNames[i], 1, &pMemId[i]); 49 | if (SUCCEEDED(hr)) 50 | { 51 | m_cache.add(hash, pMemId[i]); 52 | } 53 | } 54 | } 55 | 56 | return hr; 57 | } 58 | 59 | HRESULT type_info_cache_holder::Invoke(PVOID pvInstance, MEMBERID memid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr) 60 | { 61 | PFC_ASSERT(m_type_info != NULL); 62 | HRESULT hr = m_type_info->Invoke(pvInstance, memid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr); 63 | PFC_ASSERT(hr != RPC_E_WRONG_THREAD); 64 | return hr; 65 | } 66 | -------------------------------------------------------------------------------- /foo_uie_wsh_panel_mod_plus/component_defines.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /* 4 | * IMPORTANT NOTE: 5 | * For modders: You should change these Defines/Guids below, in order to 6 | * co-exist with the original release of WSH Panel Mod. 7 | */ 8 | 9 | #define WSPM_NAME "WSH Panel Mod Plus" 10 | #define WSPM_WINDOW_CLASS_NAME "uie_wsh_panel_mod_plus_class" 11 | #define WSPM_DLL_NAME "foo_uie_wsh_panel_mod_plus.dll" 12 | 13 | // {D573DC73-8933-4E53-92EB-0062B1E62DAB} 14 | extern const GUID g_ui_pref_window_guid; 15 | FOOGUIDDECL const GUID g_ui_pref_window_guid = 16 | { 0xd573dc73, 0x8933, 0x4e53, { 0x92, 0xeb, 0x0, 0x62, 0xb1, 0xe6, 0x2d, 0xab } }; 17 | 18 | 19 | // {3C2C4BDC-D387-44E9-A2A8-EAAEADCA14CE} 20 | extern const GUID g_wsh_panel_window_extension_guid; 21 | FOOGUIDDECL const GUID g_wsh_panel_window_extension_guid = 22 | { 0x3c2c4bdc, 0xd387, 0x44e9, { 0xa2, 0xa8, 0xea, 0xae, 0xad, 0xca, 0x14, 0xce } }; 23 | 24 | // {4F901CF9-9D97-42C1-B7EE-1DEEE92A3AEF} 25 | extern const GUID g_wsh_panel_window_dui_guid; 26 | FOOGUIDDECL const GUID g_wsh_panel_window_dui_guid = 27 | { 0x4f901cf9, 0x9d97, 0x42c1, { 0xb7, 0xee, 0x1d, 0xee, 0xe9, 0x2a, 0x3a, 0xef } }; 28 | 29 | // {DD1C27A4-1ECE-4B28-BFD7-644C254A1D80} 30 | extern const GUID g_guid_prop_sets; 31 | FOOGUIDDECL const GUID g_guid_prop_sets = 32 | { 0xdd1c27a4, 0x1ece, 0x4b28, { 0xbf, 0xd7, 0x64, 0x4c, 0x25, 0x4a, 0x1d, 0x80 } }; 33 | 34 | // {C0A8E593-132E-4B4A-AF2E-AD5721C8CEDC} 35 | extern const GUID g_guid_cfg_safe_mode; 36 | FOOGUIDDECL const GUID g_guid_cfg_safe_mode = 37 | { 0xc0a8e593, 0x132e, 0x4b4a, { 0xaf, 0x2e, 0xad, 0x57, 0x21, 0xc8, 0xce, 0xdc } }; 38 | 39 | // {B590089C-E1E0-41E1-8344-1889C708BE87} 40 | extern const GUID g_guid_cfg_cui_warning_reported; 41 | FOOGUIDDECL const GUID g_guid_cfg_cui_warning_reported = 42 | { 0xb590089c, 0xe1e0, 0x41e1, { 0x83, 0x44, 0x18, 0x89, 0xc7, 0x8, 0xbe, 0x87 } }; 43 | 44 | // {208AB7F8-4F89-4577-BA4D-F1E7990D83FD} 45 | extern const GUID g_guid_mainmenu_help; 46 | FOOGUIDDECL const GUID g_guid_mainmenu_help = 47 | { 0x208ab7f8, 0x4f89, 0x4577, { 0xba, 0x4d, 0xf1, 0xe7, 0x99, 0xd, 0x83, 0xfd } }; 48 | -------------------------------------------------------------------------------- /foo_uie_wsh_panel_mod_plus/delay_loader.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /* WARNING: Non thread safety */ 4 | class NOVTABLE delay_loader_action 5 | { 6 | public: 7 | virtual void execute() = 0; 8 | }; 9 | 10 | class delay_loader 11 | { 12 | public: 13 | static inline void g_enqueue(delay_loader_action * callback) 14 | { 15 | if (!callback) 16 | return; 17 | 18 | if (!g_ready()) 19 | callbacks_.add_item(callback); 20 | else 21 | callback->execute(); 22 | } 23 | 24 | static inline void g_set_ready() 25 | { 26 | services_initialized_ = true; 27 | 28 | for (t_size i = 0; i < callbacks_.get_count(); ++i) 29 | { 30 | callbacks_[i]->execute(); 31 | delete callbacks_[i]; 32 | } 33 | 34 | callbacks_.remove_all(); 35 | } 36 | 37 | static inline bool g_ready() 38 | { 39 | return services_initialized_; 40 | } 41 | 42 | private: 43 | static pfc::list_t callbacks_; 44 | static bool services_initialized_; 45 | }; 46 | 47 | FOOGUIDDECL bool delay_loader::services_initialized_ = false; 48 | FOOGUIDDECL pfc::list_t delay_loader::callbacks_; 49 | -------------------------------------------------------------------------------- /foo_uie_wsh_panel_mod_plus/eslyric_callback_impl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class eslyric_callback_impl : public eslyric_callback 4 | { 5 | public: 6 | virtual void on_lyric_set(const t_para_callback_data& p_info); 7 | virtual void on_lyric_offset(t_int32 p_offset); 8 | }; -------------------------------------------------------------------------------- /foo_uie_wsh_panel_mod_plus/gdiplus_helpers.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "gdiplus_helpers.h" 3 | 4 | namespace gdiplus_helpers 5 | { 6 | HBITMAP create_hbitmap_from_gdiplus_bitmap(Gdiplus::Bitmap * bitmap_ptr) 7 | { 8 | BITMAP bm; 9 | Gdiplus::Rect rect; 10 | Gdiplus::BitmapData bmpdata; 11 | HBITMAP hBitmap; 12 | 13 | rect.X = rect.Y = 0; 14 | rect.Width = bitmap_ptr->GetWidth(); 15 | rect.Height = bitmap_ptr->GetHeight(); 16 | 17 | if (bitmap_ptr->LockBits(&rect, Gdiplus::ImageLockModeRead, PixelFormat32bppPARGB, &bmpdata) != Gdiplus::Ok) 18 | { 19 | // Error 20 | return NULL; 21 | } 22 | 23 | bm.bmType = 0; 24 | bm.bmWidth = bmpdata.Width; 25 | bm.bmHeight = bmpdata.Height; 26 | bm.bmWidthBytes = bmpdata.Stride; 27 | bm.bmPlanes = 1; 28 | bm.bmBitsPixel = 32; 29 | bm.bmBits = bmpdata.Scan0; 30 | 31 | hBitmap = CreateBitmapIndirect(&bm); 32 | bitmap_ptr->UnlockBits(&bmpdata); 33 | return hBitmap; 34 | } 35 | } -------------------------------------------------------------------------------- /foo_uie_wsh_panel_mod_plus/gdiplus_helpers.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace gdiplus_helpers 4 | { 5 | HBITMAP create_hbitmap_from_gdiplus_bitmap(Gdiplus::Bitmap * bitmap_ptr); 6 | } 7 | -------------------------------------------------------------------------------- /foo_uie_wsh_panel_mod_plus/global_cfg.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "global_cfg.h" 3 | 4 | cfg_bool g_cfg_safe_mode(g_guid_cfg_safe_mode, false); 5 | cfg_bool g_cfg_cui_warning_reported(g_guid_cfg_cui_warning_reported, false); 6 | -------------------------------------------------------------------------------- /foo_uie_wsh_panel_mod_plus/global_cfg.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | 4 | // Safe mode 5 | extern cfg_bool g_cfg_safe_mode; 6 | // CUI instance warning 7 | extern cfg_bool g_cfg_cui_warning_reported; 8 | -------------------------------------------------------------------------------- /foo_uie_wsh_panel_mod_plus/helpers.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ttsping/foo_uie_wsh_panel_mod_plus/fafd9a0cdbed36a73009b3d9cf5ea58ed9be2d78/foo_uie_wsh_panel_mod_plus/helpers.cpp -------------------------------------------------------------------------------- /foo_uie_wsh_panel_mod_plus/host_droptarget.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "IDropTargetImpl.h" 4 | #include "script_interface_impl.h" 5 | 6 | 7 | class wsh_panel_window; 8 | 9 | class HostDropTarget : public IDropTargetImpl 10 | { 11 | private: 12 | DWORD m_effect; 13 | wsh_panel_window *m_host; 14 | DropSourceAction *m_action; 15 | 16 | BEGIN_COM_QI_IMPL() 17 | COM_QI_ENTRY_MULTI(IUnknown, IDropTarget) 18 | COM_QI_ENTRY(IDropTarget) 19 | END_COM_QI_IMPL() 20 | 21 | protected: 22 | virtual void FinalRelease() {} 23 | 24 | public: 25 | HostDropTarget(wsh_panel_window * host); 26 | virtual ~HostDropTarget(); 27 | 28 | public: 29 | // IDropTarget 30 | HRESULT OnDragEnter(IDataObject *pDataObj, DWORD grfKeyState, POINTL pt, DWORD *pdwEffect); 31 | HRESULT OnDragOver(DWORD grfKeyState, POINTL pt, DWORD *pdwEffect); 32 | HRESULT OnDrop(IDataObject *pDataObj, DWORD grfKeyState, POINTL pt, DWORD *pdwEffect); 33 | HRESULT OnDragLeave(); 34 | 35 | public: 36 | void on_drag_enter(unsigned keyState, POINTL & pt, IDropSourceAction * action); 37 | void on_drag_over(unsigned keyState, POINTL & pt, IDropSourceAction * action); 38 | void on_drag_leave(); 39 | void on_drag_drop(unsigned keyState, POINTL & pt, IDropSourceAction * action); 40 | }; 41 | 42 | class HostDropTargetV2 : public IDropTargetImpl 43 | { 44 | private: 45 | BEGIN_COM_QI_IMPL() 46 | COM_QI_ENTRY_MULTI(IUnknown, IDropTarget) 47 | COM_QI_ENTRY(IDropTarget) 48 | END_COM_QI_IMPL() 49 | 50 | public: 51 | // IDropTarget 52 | HRESULT OnDragEnter(IDataObject *pDataObj, DWORD grfKeyState, POINTL pt, DWORD *pdwEffect); 53 | HRESULT OnDragOver(DWORD grfKeyState, POINTL pt, DWORD *pdwEffect); 54 | HRESULT OnDrop(IDataObject *pDataObj, DWORD grfKeyState, POINTL pt, DWORD *pdwEffect); 55 | HRESULT OnDragLeave(); 56 | 57 | public: 58 | void on_drag_enter(unsigned keyState, POINTL & pt, IDropSourceAction * action); 59 | void on_drag_over(unsigned keyState, POINTL & pt, IDropSourceAction * action); 60 | void on_drag_leave(); 61 | void on_drag_drop(unsigned keyState, POINTL & pt, IDropSourceAction * action); 62 | }; 63 | -------------------------------------------------------------------------------- /foo_uie_wsh_panel_mod_plus/host_timer_dispatcher.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | 4 | class HostTimerDispatcher 5 | { 6 | public: 7 | HostTimerDispatcher(); 8 | ~HostTimerDispatcher(); 9 | 10 | inline void setWindow(HWND hWnd) { m_hWnd = hWnd; } 11 | 12 | // For legacy use only 13 | unsigned setIntervalLegacy(unsigned delay); 14 | unsigned setInterval(unsigned delay, IDispatch * pDisp); 15 | // For legacy use only 16 | unsigned setTimeoutLegacy(unsigned delay); 17 | unsigned setTimeout(unsigned delay, IDispatch * pDisp); 18 | void killLegacy(unsigned timerID); 19 | void kill(unsigned timerID); 20 | // main thread only 21 | void invoke(UINT timerId); 22 | void reset(); 23 | 24 | private: 25 | void addTimerMap(unsigned timerID, IDispatch * pDisp); 26 | 27 | static void CALLBACK g_timer_proc_legacy(UINT uTimerID, UINT uMsg, DWORD_PTR dwUser, DWORD_PTR dw1, DWORD_PTR dw2); 28 | static void CALLBACK g_timer_proc(UINT uTimerID, UINT uMsg, DWORD_PTR dwUser, DWORD_PTR dw1, DWORD_PTR dw2); 29 | 30 | unsigned m_accuracy; 31 | HWND m_hWnd; 32 | 33 | typedef pfc::map_t TimerDispatchMap; 34 | TimerDispatchMap m_timerDispatchMap; 35 | }; 36 | -------------------------------------------------------------------------------- /foo_uie_wsh_panel_mod_plus/input_box.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | typedef TCHAR tchar; 5 | #ifdef UNICODE 6 | typedef std::wstring tstring; 7 | #else 8 | typedef std::string tstring; 9 | #endif 10 | 11 | class input_box 12 | { 13 | public: 14 | input_box(HWND hwnd, const tchar* title, const tchar* prompt, const tchar* defval, int num_only): 15 | m_hwnd(hwnd) 16 | , m_title(title) 17 | , m_prompt(prompt) 18 | , m_defval(defval) 19 | { 20 | unsigned int s = WS_BORDER | WS_CHILD | WS_VISIBLE | ES_AUTOHSCROLL | ES_AUTOVSCROLL; 21 | if (num_only) s |= ES_NUMBER; 22 | m_editstyle = s; 23 | RtlZeroMemory((void*)m_buff,4096); 24 | } 25 | tchar* show(); 26 | int CALLBACK wnd_proc(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp); 27 | private: 28 | HWND create_window(HINSTANCE hInst); 29 | int run(HWND hwnd); 30 | static int CALLBACK g_wnd_proc(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp); 31 | private: 32 | HINSTANCE m_hinst; 33 | HWND m_hwnd; 34 | HWND m_hedit; 35 | HWND m_htext; 36 | HWND m_hbtnok, m_hbtncancel; 37 | UINT m_editstyle; 38 | tstring m_title; 39 | tstring m_prompt; 40 | tstring m_defval; 41 | tchar m_buff[2048]; 42 | }; -------------------------------------------------------------------------------- /foo_uie_wsh_panel_mod_plus/lang.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ttsping/foo_uie_wsh_panel_mod_plus/fafd9a0cdbed36a73009b3d9cf5ea58ed9be2d78/foo_uie_wsh_panel_mod_plus/lang.cpp -------------------------------------------------------------------------------- /foo_uie_wsh_panel_mod_plus/lang.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | enum t_ui_lang 4 | { 5 | t_lang_en_us = 0, 6 | t_lang_zh_cn, 7 | t_lang_unknown = -1, 8 | }; 9 | 10 | t_ui_lang get_ui_language(); 11 | 12 | void set_ui_language(t_ui_lang p_lang); 13 | 14 | const wchar_t* load_lang(UINT id, std::wstring& p_out); 15 | 16 | const char* load_lang(UINT id, pfc::string_base& p_out); -------------------------------------------------------------------------------- /foo_uie_wsh_panel_mod_plus/obsolete.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "resource.h" 3 | 4 | static inline void print_obsolete_message(const char * message) 5 | { 6 | pfc::string8 lang_msg; 7 | console::formatter() << load_lang(IDS_WSHM_NAME, lang_msg) << ": " << load_lang(IDS_OBSOLETE_WARNING, lang_msg) << ": " << message; 8 | } 9 | 10 | static inline void print_obsolete_message_once(bool& reported, const char * message) 11 | { 12 | if (reported) return; 13 | print_obsolete_message(message); 14 | //reported = true; 15 | } 16 | 17 | #define PRINT_OBSOLETE_MESSAGE_ONCE(message) \ 18 | do {\ 19 | static bool ___obsolete_message_reported__ = false;\ 20 | print_obsolete_message_once(___obsolete_message_reported__, message);\ 21 | } while(0) 22 | -------------------------------------------------------------------------------- /foo_uie_wsh_panel_mod_plus/panel_tooltip_param.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | struct panel_tooltip_param 6 | { 7 | HWND tooltip_hwnd; 8 | SIZE tooltip_size; 9 | BSTR font_name; 10 | float font_size; 11 | INT font_style; 12 | 13 | panel_tooltip_param() : tooltip_hwnd(0) {} 14 | }; 15 | 16 | typedef std::shared_ptr panel_tooltip_param_ptr; 17 | -------------------------------------------------------------------------------- /foo_uie_wsh_panel_mod_plus/popup_msg.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "delay_loader.h" 4 | 5 | class popup_msg 6 | { 7 | public: 8 | struct action : public delay_loader_action 9 | { 10 | action(const char * p_msg, const char * p_title, popup_message::t_icon p_icon) 11 | : msg_(p_msg), title_(p_title), icon_(p_icon) {} 12 | 13 | pfc::string_simple msg_, title_; 14 | popup_message::t_icon icon_; 15 | 16 | virtual void execute() 17 | { 18 | ::popup_message::g_show(msg_, title_, icon_); 19 | } 20 | }; 21 | 22 | static inline void g_show(const char * p_msg, const char * p_title, popup_message::t_icon p_icon = popup_message::icon_information) 23 | { 24 | delay_loader::g_enqueue(new action(p_msg, p_title, p_icon)); 25 | } 26 | }; 27 | -------------------------------------------------------------------------------- /foo_uie_wsh_panel_mod_plus/process_locations.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "stdafx.h" 4 | 5 | class js_process_locations : public process_locations_notify 6 | { 7 | public: 8 | js_process_locations(int playlist_idx, bool to_select) 9 | : m_playlist_idx(playlist_idx), m_to_select(to_select) {} 10 | 11 | void on_completion(const pfc::list_base_const_t & p_items) 12 | { 13 | bit_array_true selection_them; 14 | bit_array_false selection_none; 15 | bit_array * select_ptr = &selection_them; 16 | static_api_ptr_t pm; 17 | t_size playlist; 18 | 19 | if (m_playlist_idx == -1) 20 | playlist = pm->get_active_playlist(); 21 | else 22 | playlist = m_playlist_idx; 23 | 24 | if (!m_to_select) 25 | select_ptr = &selection_none; 26 | 27 | if (playlist != pfc_infinite && playlist < pm->get_playlist_count()) 28 | { 29 | pm->playlist_add_items(playlist, p_items, *select_ptr); 30 | } 31 | } 32 | void on_aborted() {} 33 | 34 | private: 35 | bool m_to_select; 36 | int m_playlist_idx; 37 | }; 38 | -------------------------------------------------------------------------------- /foo_uie_wsh_panel_mod_plus/res/resource.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ttsping/foo_uie_wsh_panel_mod_plus/fafd9a0cdbed36a73009b3d9cf5ea58ed9be2d78/foo_uie_wsh_panel_mod_plus/res/resource.rc -------------------------------------------------------------------------------- /foo_uie_wsh_panel_mod_plus/scintilla_prop_sets.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | 4 | enum t_sci_editor_style_flag 5 | { 6 | ESF_NONE = 0, 7 | ESF_FONT = 1 << 0, 8 | ESF_SIZE = 1 << 1, 9 | ESF_FORE = 1 << 2, 10 | ESF_BACK = 1 << 3, 11 | ESF_BOLD = 1 << 4, 12 | ESF_ITALICS = 1 << 5, 13 | ESF_UNDERLINED = 1 << 6, 14 | ESF_CASEFORCE = 1 << 7, 15 | }; 16 | 17 | struct t_sci_editor_style 18 | { 19 | t_sci_editor_style() 20 | { 21 | flags = 0; 22 | } 23 | 24 | unsigned flags; 25 | bool italics, bold, underlined; 26 | pfc::string_simple font; 27 | unsigned size; 28 | DWORD fore, back; 29 | int case_force; 30 | }; 31 | 32 | struct t_sci_prop_set 33 | { 34 | pfc::string_simple key, defaultval, val; 35 | }; 36 | 37 | struct t_prop_set_init_table 38 | { 39 | const char * key; 40 | const char * defaultval; 41 | }; 42 | 43 | typedef pfc::list_t t_sci_prop_set_list; 44 | typedef pfc::map_t t_str_to_str_map; 45 | 46 | class cfg_sci_prop_sets : public cfg_var 47 | { 48 | private: 49 | t_sci_prop_set_list m_data; 50 | 51 | void init_data(const t_prop_set_init_table * p_default); 52 | void merge_data(const t_str_to_str_map & data_map); 53 | 54 | public: 55 | explicit inline cfg_sci_prop_sets(const GUID & p_guid, const t_prop_set_init_table * p_default) : cfg_var(p_guid) 56 | { 57 | init_data(p_default); 58 | } 59 | 60 | inline t_sci_prop_set_list & val() { return m_data; } 61 | inline const t_sci_prop_set_list & val() const { return m_data; } 62 | 63 | void get_data_raw(stream_writer * p_stream, abort_callback & p_abort); 64 | void set_data_raw(stream_reader * p_stream, t_size p_sizehint, abort_callback & p_abort); 65 | 66 | void reset(); 67 | void export_to_file(const char * filename); 68 | void import_from_file(const char * filename); 69 | }; 70 | 71 | extern cfg_sci_prop_sets g_sci_prop_sets; 72 | -------------------------------------------------------------------------------- /foo_uie_wsh_panel_mod_plus/script_interface_datatransfer.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | [ 6 | dual, 7 | object, 8 | pointer_default(unique), 9 | library_block, 10 | uuid("ec467423-55eb-4900-a90c-2f3ad371f0b2") 11 | ] 12 | __interface IDataTransferObject : IDispatch 13 | { 14 | // Properties 15 | [propget] STDMETHOD(DropEffect)([out,retval] BSTR * outDropEffect); 16 | [propput] STDMETHOD(DropEffect)(BSTR dropEffect); 17 | [propget] STDMETHOD(EffectAllowed)([out,retval] BSTR * outEffectAllowed); 18 | [propput] STDMETHOD(EffectAllowed)(BSTR effectAllowed); 19 | [propget] STDMETHOD(Types)([out,retval] VARIANT * outTypes); 20 | 21 | // Methods 22 | STDMETHOD(ClearData)([defaultvalue("")] BSTR type); 23 | STDMETHOD(SetData)(BSTR type, VARIANT data); 24 | STDMETHOD(GetData)(BSTR type, [out,retval] VARIANT * outData); 25 | STDMETHOD(SetDragImage)(__interface IGdiBitmap * bitmap, int x, int y); 26 | }; 27 | -------------------------------------------------------------------------------- /foo_uie_wsh_panel_mod_plus/script_interface_datatransfer_impl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "script_interface_datatransfer.h" 4 | #include "com_tools.h" 5 | 6 | 7 | class DataTransferObject : public IDispatchImpl3 8 | { 9 | private: 10 | unsigned m_dropEffect; 11 | unsigned m_effectAllowed; 12 | IDataObject * m_dataObject; 13 | 14 | protected: 15 | DataTransferObject(); 16 | 17 | public: 18 | // Properties 19 | STDMETHODIMP get_DropEffect(BSTR * outDropEffect); 20 | STDMETHODIMP put_DropEffect(BSTR dropEffect); 21 | STDMETHODIMP get_EffectAllowed(BSTR * outEffectAllowed); 22 | STDMETHODIMP put_EffectAllowed(BSTR effectAllowed); 23 | STDMETHODIMP get_Types(VARIANT * outTypes); 24 | 25 | // Methods 26 | STDMETHODIMP ClearData(BSTR type); 27 | STDMETHODIMP SetData(BSTR type, BSTR data); 28 | STDMETHODIMP GetData(BSTR type, VARIANT * outData); 29 | STDMETHODIMP GetMetadbHandles(IDispatch * callback); 30 | STDMETHODIMP SetDragImage(__interface IGdiBitmap * bitmap, int x, int y); 31 | }; 32 | -------------------------------------------------------------------------------- /foo_uie_wsh_panel_mod_plus/script_interface_dragsource.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | [ 6 | dual, 7 | object, 8 | pointer_default(unique), 9 | library_block, 10 | uuid("bf48b127-17c6-4fce-84ac-f27e59422c24") 11 | ] 12 | __interface IDragSourceObject : IDispatch 13 | { 14 | STDMETHOD(StartDrag)(__interface IDataTransferObject * dataTransfer); 15 | }; 16 | -------------------------------------------------------------------------------- /foo_uie_wsh_panel_mod_plus/script_interface_dragsource_impl.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "script_interface_impl.h" 3 | #include "script_interface_datatransfer_impl.h" 4 | #include "script_interface_dragsource_impl.h" 5 | 6 | 7 | DragSourceObject::DragSourceObject() 8 | { 9 | } 10 | 11 | STDMETHODIMP DragSourceObject::StartDrag(__interface IDataTransferObject * dataTransfer) 12 | { 13 | TRACK_FUNCTION(); 14 | 15 | //DoDragDrop(); 16 | return S_OK; 17 | } 18 | -------------------------------------------------------------------------------- /foo_uie_wsh_panel_mod_plus/script_interface_dragsource_impl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "script_interface_dragsource.h" 4 | #include "com_tools.h" 5 | 6 | 7 | class DragSourceObject : public IDispatchImpl3 8 | { 9 | protected: 10 | DragSourceObject(); 11 | 12 | public: 13 | STDMETHODIMP StartDrag(__interface IDataTransferObject * dataTransfer); 14 | }; 15 | -------------------------------------------------------------------------------- /foo_uie_wsh_panel_mod_plus/script_interface_drop_impl.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "script_interface_drop_impl.h" 3 | -------------------------------------------------------------------------------- /foo_uie_wsh_panel_mod_plus/script_interface_drop_impl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | 4 | -------------------------------------------------------------------------------- /foo_uie_wsh_panel_mod_plus/script_interface_tooltip.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | [ 6 | object, 7 | dual, 8 | pointer_default(unique), 9 | library_block, 10 | uuid("4ff021ab-17bc-43de-9dbe-2d0edec1e095") 11 | ] 12 | __interface IFbTooltip: IDisposable 13 | { 14 | [propget] STDMETHOD(Text)([out,retval] BSTR * pp); 15 | [propput] STDMETHOD(Text)(BSTR text); 16 | [propput] STDMETHOD(TrackActivate)(VARIANT_BOOL activate); 17 | STDMETHOD(Activate)(); 18 | STDMETHOD(Deactivate)(); 19 | STDMETHOD(SetMaxWidth)(int width); 20 | STDMETHOD(GetDelayTime)(int type, [out,retval] INT * p); 21 | STDMETHOD(SetDelayTime)(int type, int time); 22 | STDMETHOD(TrackPosition)(int x, int y); 23 | }; 24 | 25 | -------------------------------------------------------------------------------- /foo_uie_wsh_panel_mod_plus/script_interface_tooltip_impl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "script_interface_tooltip.h" 4 | #include "com_tools.h" 5 | #include "panel_tooltip_param.h" 6 | 7 | 8 | class FbTooltip : public IDisposableImpl4 9 | { 10 | protected: 11 | HWND m_wndtooltip; 12 | HWND m_wndparent; 13 | BSTR m_tip_buffer; 14 | TOOLINFO m_ti; 15 | panel_tooltip_param_ptr m_panel_tooltip_param_ptr; 16 | 17 | FbTooltip(HWND p_wndparent, const panel_tooltip_param_ptr & p_param_ptr); 18 | virtual ~FbTooltip() { } 19 | virtual void FinalRelease(); 20 | 21 | public: 22 | STDMETHODIMP get_Text(BSTR * pp); 23 | STDMETHODIMP put_Text(BSTR text); 24 | STDMETHODIMP put_TrackActivate(VARIANT_BOOL activate); 25 | STDMETHODIMP Activate(); 26 | STDMETHODIMP Deactivate(); 27 | STDMETHODIMP SetMaxWidth(int width); 28 | STDMETHODIMP GetDelayTime(int type, INT * p); 29 | STDMETHODIMP SetDelayTime(int type, int time); 30 | STDMETHODIMP TrackPosition(int x, int y); 31 | }; 32 | -------------------------------------------------------------------------------- /foo_uie_wsh_panel_mod_plus/splitter_window.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class wsh_splitter_window : public CHorSplitterWindow 4 | { 5 | public: 6 | DECLARE_WND_CLASS(_T("WSH_SplitterWindow")); 7 | 8 | public: 9 | //create from a holder window,and destroy it . 10 | HWND Create2(HWND hWnd, UINT uHolderID, DWORD dwStyle, DWORD dwExStyle) 11 | { 12 | ATLASSERT(::IsWindow(hWnd)); 13 | 14 | RECT rcHolder; 15 | HWND hHolderWnd = ::GetDlgItem(hWnd,uHolderID); 16 | 17 | ATLASSERT(::IsWindow(hHolderWnd)); 18 | 19 | ::GetWindowRect(hHolderWnd,&rcHolder); 20 | ::ScreenToClient(hWnd,(LPPOINT)&rcHolder); 21 | ::ScreenToClient(hWnd,(LPPOINT)&rcHolder + 1); 22 | 23 | HWND Wnd = NULL; 24 | 25 | Wnd = Create(hWnd,rcHolder,NULL,dwStyle,dwExStyle,uHolderID); 26 | 27 | if(Wnd)::DestroyWindow(hHolderWnd); 28 | 29 | return Wnd; 30 | } 31 | }; -------------------------------------------------------------------------------- /foo_uie_wsh_panel_mod_plus/stackblur.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | void stack_blur_filter(Gdiplus::Bitmap & p_img, int radius, int core = 1) throw(); -------------------------------------------------------------------------------- /foo_uie_wsh_panel_mod_plus/stdafx.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | -------------------------------------------------------------------------------- /foo_uie_wsh_panel_mod_plus/stdafx.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | 4 | #define _WIN32_WINNT 0x0601 // Require Windows 7 5 | #define WINVER 0x0601 6 | #define _WIN32_IE 0x600 7 | 8 | // Undefine to enable VLD 9 | #define NO_VISUAL_LEAK_DETECTOR 10 | 11 | #if defined(_DEBUG) && !defined(NO_VISUAL_LEAK_DETECTOR) 12 | #include 13 | #endif 14 | 15 | 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | 29 | // Direct2D DirectWrite relative 30 | //#include 31 | //#include 32 | //#include 33 | //#include 34 | 35 | 36 | // ATL/WTL 37 | #define _WTL_USE_CSTRING 38 | //#define _WTL_NO_WTYPES 39 | #include "atlbase.h" 40 | #include "atlapp.h" 41 | 42 | #include "atlwin.h" 43 | #include "atlframe.h" 44 | #include "atldlgs.h" 45 | #include "atlsplit.h" 46 | #include "atlctrls.h" 47 | #include "atlctrlx.h" 48 | #include "atlddx.h" 49 | #include "atlcrack.h" 50 | #include "atltheme.h" 51 | #include "atlmisc.h" 52 | 53 | // Other controls 54 | #define STATIC_BUILD 1 55 | #define SCI_LEXER 1 56 | #include 57 | #include 58 | 59 | // foobar2000 SDK 60 | #include "../../SDK/foobar2000.h" 61 | // Columns UI SDK 62 | #include "../../columns_ui-sdk/ui_extension.h" 63 | 64 | // Some marcos defined by windowsx.h should be removed 65 | #ifdef _INC_WINDOWSX 66 | #undef SubclassWindow 67 | #endif 68 | 69 | #include "component_defines.h" 70 | #include "lang.h" -------------------------------------------------------------------------------- /foo_uie_wsh_panel_mod_plus/ui_find.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "ui_find.h" 3 | #include "ui_conf.h" 4 | 5 | 6 | LRESULT CDialogFind::OnFindUp(WORD wNotifyCode, WORD wID, HWND hWndCtl) 7 | { 8 | if (m_text.is_empty()) 9 | return 0; 10 | 11 | CDialogConf::FindPrevious(m_hWnd, m_hedit, m_flags, m_text.get_ptr()); 12 | return 0; 13 | } 14 | 15 | LRESULT CDialogFind::OnFindDown(WORD wNotifyCode, WORD wID, HWND hWndCtl) 16 | { 17 | if (m_text.is_empty()) 18 | return 0; 19 | 20 | CDialogConf::FindNext(m_hWnd, m_hedit, m_flags, m_text.get_ptr()); 21 | return 0; 22 | } 23 | 24 | LRESULT CDialogFind::OnEditFindWhatEnChange(WORD wNotifyCode, WORD wID, HWND hWndCtl) 25 | { 26 | uGetWindowText(GetDlgItem(IDC_EDIT_FINDWHAT), m_text); 27 | return 0; 28 | } 29 | 30 | LRESULT CDialogFind::OnFlagCommand(WORD wNotifyCode, WORD wID, HWND hWndCtl) 31 | { 32 | bool check = uButton_GetCheck(m_hWnd, wID); 33 | int flag = 0; 34 | 35 | switch (wID) 36 | { 37 | case IDC_CHECK_MATCHCASE: 38 | flag = SCFIND_MATCHCASE; 39 | break; 40 | 41 | case IDC_CHECK_WHOLEWORD: 42 | flag = SCFIND_WHOLEWORD; 43 | break; 44 | 45 | case IDC_CHECK_WORDSTART: 46 | flag = SCFIND_WORDSTART; 47 | break; 48 | 49 | case IDC_CHECK_REGEXP: 50 | flag = SCFIND_REGEXP; 51 | break; 52 | } 53 | 54 | if (check) 55 | m_flags |= flag; 56 | else 57 | m_flags &= ~flag; 58 | 59 | return 0; 60 | } 61 | 62 | LRESULT CDialogFind::OnCancel(WORD wNotifyCode, WORD wID, HWND hWndCtl) 63 | { 64 | ShowWindow(SW_HIDE); 65 | return 0; 66 | } 67 | 68 | void CDialogFind::OnFinalMessage(HWND hWnd) 69 | { 70 | modeless_dialog_manager::g_remove(m_hWnd); 71 | delete this; 72 | } 73 | 74 | LRESULT CDialogFind::OnInitDialog(HWND hwndFocus, LPARAM lParam) 75 | { 76 | modeless_dialog_manager::g_add(m_hWnd); 77 | DlgResize_Init(); 78 | m_find.SubclassWindow(GetDlgItem(IDC_EDIT_FINDWHAT), m_hWnd); 79 | return TRUE; // set focus to default control 80 | } 81 | -------------------------------------------------------------------------------- /foo_uie_wsh_panel_mod_plus/ui_goto.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "ui_goto.h" 3 | 4 | 5 | LRESULT CDialogGoto::OnInitDialog(HWND hwndFocus, LPARAM lParam) 6 | { 7 | int cur_pos = SendMessage(m_hedit, SCI_GETCURRENTPOS, 0, 0); 8 | int cur_line = SendMessage(m_hedit, SCI_LINEFROMPOSITION, cur_pos, 0); 9 | 10 | uSetWindowText(GetDlgItem(IDC_EDIT_LINENUMBER), pfc::format_int(cur_line + 1).get_ptr()); 11 | 12 | return TRUE; // set focus to default control 13 | } 14 | 15 | LRESULT CDialogGoto::OnCloseCmd(WORD wNotifyCode, WORD wID, HWND hWndCtl) 16 | { 17 | if (wID == IDOK) 18 | { 19 | pfc::string8 text; 20 | unsigned i = 0; 21 | 22 | uGetWindowText(GetDlgItem(IDC_EDIT_LINENUMBER), text); 23 | i = pfc::atoui_ex(text.get_ptr(), text.length()) - 1; 24 | SendMessage(m_hedit, SCI_ENSUREVISIBLEENFORCEPOLICY, i, 0); 25 | SendMessage(m_hedit, SCI_GOTOLINE, i, 0); 26 | } 27 | 28 | EndDialog(wID); 29 | return 0; 30 | } 31 | -------------------------------------------------------------------------------- /foo_uie_wsh_panel_mod_plus/ui_goto.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "resource.h" 4 | 5 | 6 | class CDialogGoto : public CDialogImpl 7 | { 8 | private: 9 | HWND m_hedit; 10 | 11 | public: 12 | enum { IDD = IDD_DIALOG_GOTO }; 13 | 14 | BEGIN_MSG_MAP(CDialogGoto) 15 | MSG_WM_INITDIALOG(OnInitDialog) 16 | COMMAND_RANGE_HANDLER_EX(IDOK, IDCANCEL, OnCloseCmd) 17 | END_MSG_MAP() 18 | 19 | public: 20 | CDialogGoto(HWND p_hedit) : m_hedit(p_hedit) 21 | { 22 | } 23 | 24 | public: 25 | LRESULT OnInitDialog(HWND hwndFocus, LPARAM lParam); 26 | LRESULT OnCloseCmd(WORD wNotifyCode, WORD wID, HWND hWndCtl); 27 | }; 28 | -------------------------------------------------------------------------------- /foo_uie_wsh_panel_mod_plus/ui_name_value_edit.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "ui_name_value_edit.h" 3 | 4 | 5 | LRESULT CNameValueEdit::OnInitDialog(HWND hwndFocus, LPARAM lParam) 6 | { 7 | uSendDlgItemMessageText(m_hWnd, IDC_EDIT_NAME, WM_SETTEXT, 0, m_name); 8 | uSendDlgItemMessageText(m_hWnd, IDC_EDIT_VALUE, WM_SETTEXT, 0, m_value); 9 | 10 | // Select all 11 | SendDlgItemMessage(IDC_EDIT_VALUE, EM_SETSEL, 0, -1); 12 | ::SetFocus(GetDlgItem(IDC_EDIT_VALUE)); 13 | 14 | return FALSE; 15 | } 16 | 17 | LRESULT CNameValueEdit::OnCommand(UINT codeNotify, int id, HWND hwndCtl) 18 | { 19 | if (id == IDOK || id == IDCANCEL) 20 | { 21 | if (id == IDOK) 22 | uGetDlgItemText(m_hWnd, IDC_EDIT_VALUE, m_value); 23 | 24 | EndDialog(id); 25 | } 26 | 27 | return 0; 28 | } 29 | -------------------------------------------------------------------------------- /foo_uie_wsh_panel_mod_plus/ui_name_value_edit.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "resource.h" 4 | 5 | 6 | class CNameValueEdit : public CDialogImpl 7 | { 8 | private: 9 | pfc::string_simple m_name; 10 | pfc::string8 m_value; 11 | 12 | public: 13 | CNameValueEdit(const char * p_name, const char * p_value) : m_name(p_name), m_value(p_value) 14 | { 15 | } 16 | 17 | void GetValue(pfc::string_base & p_value) 18 | { 19 | p_value = m_value; 20 | } 21 | 22 | public: 23 | enum { IDD = IDD_DIALOG_NAME_VALUE }; 24 | 25 | BEGIN_MSG_MAP(CNameValueEdit) 26 | MSG_WM_INITDIALOG(OnInitDialog) 27 | MSG_WM_COMMAND(OnCommand) 28 | END_MSG_MAP() 29 | 30 | 31 | LRESULT OnInitDialog(HWND hwndFocus, LPARAM lParam); 32 | LRESULT OnCommand(UINT codeNotify, int id, HWND hwndCtl); 33 | }; 34 | -------------------------------------------------------------------------------- /foo_uie_wsh_panel_mod_plus/ui_pref.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "resource.h" 4 | 5 | class CDialogPref : public CDialogImpl 6 | , public CWinDataExchange 7 | , public preferences_page_instance 8 | { 9 | private: 10 | CListViewCtrl m_props; 11 | preferences_page_callback::ptr m_callback; 12 | 13 | public: 14 | CDialogPref(preferences_page_callback::ptr callback) : m_callback(callback) {} 15 | 16 | void LoadProps(bool reset = false); 17 | void uGetItemText(int nItem, int nSubItem, pfc::string_base & out); 18 | 19 | void OnChanged(); 20 | bool HasChanged(); 21 | 22 | // preferences_page_instance 23 | HWND get_wnd(); 24 | t_uint32 get_state(); 25 | void apply(); 26 | void reset(); 27 | 28 | public: 29 | enum { IDD = IDD_DIALOG_PREFERENCE }; 30 | 31 | BEGIN_MSG_MAP(CDialogPref) 32 | MSG_WM_INITDIALOG(OnInitDialog) 33 | COMMAND_HANDLER_EX(IDC_BUTTON_EXPORT, BN_CLICKED, OnButtonExportBnClicked) 34 | COMMAND_HANDLER_EX(IDC_BUTTON_IMPORT, BN_CLICKED, OnButtonImportBnClicked) 35 | COMMAND_HANDLER_EX(IDC_CHECK_SAFE_MODE, BN_CLICKED, OnEditChange) 36 | NOTIFY_HANDLER_EX(IDC_LIST_EDITOR_PROP, NM_DBLCLK, OnPropNMDblClk) 37 | END_MSG_MAP() 38 | 39 | BEGIN_DDX_MAP(CDialogPref) 40 | DDX_CONTROL_HANDLE(IDC_LIST_EDITOR_PROP, m_props) 41 | END_DDX_MAP() 42 | 43 | BOOL OnInitDialog(HWND hwndFocus, LPARAM lParam); 44 | LRESULT OnPropNMDblClk(LPNMHDR pnmh); 45 | void OnButtonExportBnClicked(WORD wNotifyCode, WORD wID, HWND hWndCtl); 46 | void OnButtonImportBnClicked(WORD wNotifyCode, WORD wID, HWND hWndCtl); 47 | void OnEditChange(WORD, WORD, HWND); 48 | }; 49 | 50 | class wsh_preferences_page_impl : public preferences_page_v3 51 | { 52 | public: 53 | preferences_page_instance::ptr instantiate(HWND parent, preferences_page_callback::ptr callback) 54 | { 55 | service_impl_t * p = new service_impl_t(callback); 56 | p->Create(parent); 57 | return p; 58 | } 59 | 60 | const char * get_name() 61 | { 62 | static pfc::string8 mod; 63 | return load_lang(IDS_WSHM_NAME, mod); 64 | } 65 | 66 | GUID get_guid() 67 | { 68 | return g_ui_pref_window_guid; 69 | } 70 | 71 | GUID get_parent_guid() 72 | { 73 | return preferences_page::guid_tools; 74 | } 75 | 76 | bool get_help_url(pfc::string_base & p_out) 77 | { 78 | p_out = "http://code.google.com/p/foo-wsh-panel-mod/wiki/EditorProperties"; 79 | return true; 80 | } 81 | }; 82 | -------------------------------------------------------------------------------- /foo_uie_wsh_panel_mod_plus/user_message.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | enum t_user_message 4 | { 5 | UWM_SCRIPT_ERROR = WM_USER + 100, 6 | UWM_SCRIPT_DISABLED_BEFORE, 7 | UWM_SCRIPT_TERM, 8 | UWM_SCRIPT_INIT, 9 | UWM_TIMER, 10 | UWM_TIMER_NEW, 11 | UWM_SIZE, 12 | UWM_REFRESHBK, 13 | UWM_SHOWCONFIGURE, 14 | UWM_SHOWPROPERTIES, 15 | UWM_REFRESHBKDONE, 16 | UWM_SIZELIMITECHANGED, 17 | UWM_KEYDOWN, 18 | UWM_FINDTEXTCHANGED, 19 | UWM_CONSOLE_PRINT, 20 | UWM_SCRIPT_RELOAD, 21 | 22 | CALLBACK_UWM_GETALBUMARTASYNCDONE, 23 | CALLBACK_UWM_LOADIMAGEASYNCDONE, 24 | 25 | CALLBACK_UWM_FONT_CHANGED, 26 | CALLBACK_UWM_COLORS_CHANGED, 27 | 28 | // config_object_notify 29 | CALLBACK_UWM_PLAYLIST_STOP_AFTER_CURRENT, 30 | CALLBACK_UWM_CURSOR_FOLLOW_PLAYBACK, 31 | CALLBACK_UWM_PLAYBACK_FOLLOW_CURSOR, 32 | CALLBACK_UWM_NOTIFY_DATA, 33 | 34 | // playback_statistics_collector 35 | CALLBACK_UWM_ON_ITEM_PLAYED, 36 | 37 | // metadb_io_callback_dynamic 38 | CALLBACK_UWM_ON_CHANGED_SORTED, 39 | 40 | // ui_selection_callback 41 | CALLBACK_UWM_ON_SELECTION_CHANGED, 42 | 43 | // play_callback 44 | CALLBACK_UWM_ON_PLAYBACK_STARTING, 45 | CALLBACK_UWM_ON_PLAYBACK_NEW_TRACK, 46 | CALLBACK_UWM_ON_PLAYBACK_STOP, 47 | CALLBACK_UWM_ON_PLAYBACK_SEEK, 48 | CALLBACK_UWM_ON_PLAYBACK_PAUSE, 49 | CALLBACK_UWM_ON_PLAYBACK_EDITED, 50 | CALLBACK_UWM_ON_PLAYBACK_DYNAMIC_INFO, 51 | CALLBACK_UWM_ON_PLAYBACK_DYNAMIC_INFO_TRACK, 52 | CALLBACK_UWM_ON_PLAYBACK_TIME, 53 | CALLBACK_UWM_ON_VOLUME_CHANGE, 54 | 55 | // playlist_callback 56 | CALLBACK_UWM_ON_PLAYLIST_ITEMS_ADDED, 57 | CALLBACK_UWM_ON_PLAYLIST_ITEMS_REORDERED, 58 | CALLBACK_UWM_ON_PLAYLIST_ITEMS_REMOVED, 59 | CALLBACK_UWM_ON_PLAYLIST_ITEMS_SELECTION_CHANGE, 60 | CALLBACK_UWM_ON_PLAYLIST_ITEM_ENSURE_VISIBLE, 61 | CALLBACK_UWM_ON_ITEM_FOCUS_CHANGE, 62 | CALLBACK_UWM_ON_PLAYLIST_SWITCH, // on_playlist_activate 63 | CALLBACK_UWM_ON_PLAYLISTS_CHANGED, 64 | CALLBACK_UWM_ON_PLAYBACK_ORDER_CHANGED, 65 | 66 | // playback_queue_callback 67 | CALLBACK_UWM_ON_PLAYBACK_QUEUE_CHANGED, 68 | 69 | // libaray callback 70 | CALLBACK_UWM_ON_LIBRARY_CHANGED, 71 | 72 | CALLBACK_UWM_HTTPRUNASYNCDONE, 73 | CALLBACK_UWM_ON_PROCESS_LOCATIONS_DONE, 74 | 75 | CALLBACK_UWM_HTTPEX_RUNASYNC_STATUS, 76 | 77 | }; 78 | -------------------------------------------------------------------------------- /foo_uie_wsh_panel_mod_plus/version.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "version.h" 3 | 4 | #if WSPM_TESTING == 1 5 | #include 6 | 7 | /* NOTE: Assume that date is following this format: "Jan 28 2010" */ 8 | bool is_expired(const char * date) 9 | { 10 | char s_month[4] = {0}; 11 | int month, day, year; 12 | tm t = {0}; 13 | const char month_names[] = "JanFebMarAprMayJunJulAugSepOctNovDec"; 14 | 15 | sscanf_s(date, "%3s %2d %4d", s_month, _countof(s_month), &day, &year); 16 | 17 | const char * month_pos = strstr(month_names, s_month); 18 | month = (month_pos - month_names) / 3; 19 | 20 | t.tm_mon = month; 21 | t.tm_mday = day; 22 | t.tm_year = year - 1900; 23 | t.tm_isdst = FALSE; 24 | 25 | time_t start = mktime(&t); 26 | time_t end = time(NULL); 27 | 28 | // expire in ~32 days 29 | const double secs = 32 * 60 * 60 * 24; 30 | return (difftime(end, start) > secs); 31 | } 32 | #endif 33 | -------------------------------------------------------------------------------- /foo_uie_wsh_panel_mod_plus/version.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // TODO: Change Version Number Every Time 4 | #define WSPM_VERSION_NUMBER "1.5.7.5" 5 | #define WSPM_WILL_NOT_EXPIRE 6 | //#define WSPM_VERSION_TEST "Beta 6" 7 | 8 | #ifdef WSPM_VERSION_TEST 9 | # define WSPM_TESTING 1 10 | # define WSPM_VERSION_TEST_PREFIX " " 11 | #else 12 | # define WSPM_TESTING 0 13 | # define WSPM_VERSION_TEST "" 14 | # define WSPM_VERSION_TEST_PREFIX "" 15 | #endif 16 | 17 | #if defined(DEBUG) || defined(_DEBUG) 18 | # define WSPM_VERSION_DEBUG_SUFFIX " (Debug)" 19 | #else 20 | # define WSPM_VERSION_DEBUG_SUFFIX "" 21 | #endif 22 | 23 | #if HG_MODS == 1 24 | # define WSPM_VERSION_MODS_SUFFIX "m" 25 | #else 26 | # define WSPM_VERSION_MODS_SUFFIX 27 | #endif 28 | 29 | #define WSPM_VERSION WSPM_VERSION_NUMBER WSPM_VERSION_MODS_SUFFIX WSPM_VERSION_TEST_PREFIX WSPM_VERSION_TEST WSPM_VERSION_DEBUG_SUFFIX 30 | 31 | #if WSPM_TESTING == 1 && !defined(WSPM_WILL_NOT_EXPIRE) 32 | /* NOTE: Assume that date is following this format: "Jan 28 2010" */ 33 | bool is_expired(const char * date); 34 | # define IS_EXPIRED(date) (is_expired(__DATE__)) 35 | #else 36 | # define IS_EXPIRED(date) (false) 37 | #endif 38 | -------------------------------------------------------------------------------- /foo_uie_wsh_panel_mod_plus/wsh_mainmenu.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ttsping/foo_uie_wsh_panel_mod_plus/fafd9a0cdbed36a73009b3d9cf5ea58ed9be2d78/foo_uie_wsh_panel_mod_plus/wsh_mainmenu.h -------------------------------------------------------------------------------- /foo_uie_wsh_panel_mod_plus/wsh_panel_window_cui.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class wsh_panel_window_cui : public wsh_panel_window, public uie::window, 4 | public columns_ui::fonts::common_callback, public columns_ui::colours::common_callback 5 | { 6 | protected: 7 | // ui_extension 8 | virtual const GUID & get_extension_guid() const; 9 | virtual void get_name(pfc::string_base& out) const; 10 | virtual void get_category(pfc::string_base& out) const; 11 | virtual unsigned get_type() const; 12 | virtual void set_config(stream_reader * reader, t_size size, abort_callback & abort); 13 | virtual void get_config(stream_writer * writer, abort_callback & abort) const; 14 | virtual bool have_config_popup() const; 15 | virtual bool show_config_popup(HWND parent); 16 | virtual LRESULT on_message(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp); 17 | 18 | virtual bool is_available(const uie::window_host_ptr & p) const {return true;} 19 | virtual const uie::window_host_ptr & get_host() const {return m_host;} 20 | virtual HWND create_or_transfer_window(HWND parent, const uie::window_host_ptr & host, const ui_helpers::window_position_t & p_position); 21 | virtual void destroy_window() {destroy(); m_host.release();} 22 | virtual HWND get_wnd() const { return t_parent::get_wnd(); } 23 | 24 | // columns_ui::fonts::common_callback 25 | virtual void on_font_changed(t_size mask) const; 26 | 27 | // columns_ui::colours::common_callback 28 | virtual void on_colour_changed(t_size mask) const; 29 | virtual void on_bool_changed(t_size mask) const; 30 | 31 | // HostComm 32 | virtual DWORD GetColorCUI(unsigned type, const GUID & guid); 33 | virtual HFONT GetFontCUI(unsigned type, const GUID & guid); 34 | virtual DWORD GetColorDUI(unsigned type) { return 0; } 35 | virtual HFONT GetFontDUI(unsigned type) { return NULL; } 36 | 37 | private: 38 | virtual void notify_size_limit_changed_(LPARAM lp); 39 | 40 | private: 41 | typedef wsh_panel_window t_parent; 42 | uie::window_host_ptr m_host; 43 | }; 44 | -------------------------------------------------------------------------------- /foo_uie_wsh_panel_mod_plus/wsh_panel_window_dui.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class wsh_panel_window_dui : public wsh_panel_window, public ui_element_instance 4 | { 5 | public: 6 | wsh_panel_window_dui(ui_element_config::ptr cfg, ui_element_instance_callback::ptr callback) : m_callback(callback) 7 | { 8 | m_instance_type = KInstanceTypeDUI; 9 | m_is_edit_mode = m_callback->is_edit_mode_enabled(); 10 | set_configuration(cfg); 11 | } 12 | 13 | virtual ~wsh_panel_window_dui() { t_parent::destroy(); } 14 | 15 | void initialize_window(HWND parent); 16 | 17 | virtual HWND get_wnd(); 18 | 19 | virtual void set_configuration(ui_element_config::ptr data); 20 | static ui_element_config::ptr g_get_default_configuration(); 21 | virtual ui_element_config::ptr get_configuration(); 22 | 23 | static void g_get_name(pfc::string_base & out); 24 | static pfc::string8 g_get_description(); 25 | 26 | static GUID g_get_guid(); 27 | virtual GUID get_guid(); 28 | 29 | static GUID g_get_subclass(); 30 | virtual GUID get_subclass(); 31 | 32 | virtual void notify(const GUID & p_what, t_size p_param1, const void * p_param2, t_size p_param2size); 33 | 34 | virtual bool edit_mode_context_menu_test(const POINT & p_point,bool p_fromkeyboard) {return true;} 35 | virtual void edit_mode_context_menu_build(const POINT & p_point,bool p_fromkeyboard,HMENU p_menu,unsigned p_id_base) { build_context_menu(p_menu, p_point.x, p_point.y, p_id_base); } 36 | virtual void edit_mode_context_menu_command(const POINT & p_point,bool p_fromkeyboard,unsigned p_id,unsigned p_id_base) { execute_context_menu_command(p_id, p_id_base); } 37 | //virtual bool edit_mode_context_menu_get_focus_point(POINT & p_point) {return true;} 38 | virtual bool edit_mode_context_menu_get_description(unsigned p_id,unsigned p_id_base,pfc::string_base & p_out) {return false;} 39 | 40 | virtual LRESULT on_message(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp); 41 | 42 | // HostComm 43 | virtual DWORD GetColorCUI(unsigned type, const GUID & guid) { return 0; } 44 | virtual HFONT GetFontCUI(unsigned type, const GUID & guid) { return NULL; } 45 | virtual DWORD GetColorDUI(unsigned type); 46 | virtual HFONT GetFontDUI(unsigned type); 47 | 48 | private: 49 | void notify_is_edit_mode_changed_(bool enabled) { m_is_edit_mode = enabled; } 50 | virtual void notify_size_limit_changed_(LPARAM lp); 51 | 52 | private: 53 | typedef wsh_panel_window t_parent; 54 | ui_element_instance_callback::ptr m_callback; 55 | bool m_is_edit_mode; 56 | }; 57 | -------------------------------------------------------------------------------- /samples/ApplyMask.txt: -------------------------------------------------------------------------------- 1 | // vi:set ft=javascript ff=dos ts=4 sts=4 sw=4 et: 2 | 3 | // USAGE: 4 | // mask.png and image.jpg to {foobar2000 folder}\images 5 | 6 | // ==PREPROCESSOR== 7 | // @name "ApplyMask" 8 | // @author "T.P Wang" 9 | // ==/PREPROCESSOR== 10 | 11 | var g_img_mask = gdi.Image(fb.FoobarPath + "images\\mask.png"); 12 | var g_img = gdi.Image(fb.FoobarPath + "images\\image.jpg"); 13 | var ww = 0, 14 | wh = 0; 15 | 16 | 17 | function on_paint(gr) { 18 | if (g_img) { 19 | // Keep aspect ratio 20 | var scale_w = ww / g_img.Width; 21 | var scale_h = wh / g_img.Height; 22 | var scale = Math.min(scale_w, scale_h); 23 | var pos_x = 0, 24 | pos_y = 0; 25 | 26 | if (scale_w < scale_h) pos_y = (wh - g_img.height * scale) / 2; 27 | else if (scale_w > scale_h) pos_x = (ww - g_img.Width * scale) / 2; 28 | 29 | gr.DrawImage(g_img, pos_x, pos_y, g_img.Width * scale, g_img.Height * scale, 0, 0, g_img.Width, g_img.Height); 30 | } 31 | } 32 | 33 | function on_size() { 34 | ww = window.Width; 35 | wh = window.Height; 36 | } 37 | 38 | // Init 39 | (function(){ 40 | // mask *MUST* be the same size as g_img 41 | var mask = g_img_mask.Resize(g_img.Width, g_img.Height); 42 | 43 | // Apply mask image to g_img 44 | g_img.ApplyMask(mask); 45 | 46 | // Dispose() method is added in WSH Panel Mod 1.1.10, in order to free unused resource 47 | // So, now CollectGarbage() is no longer encouraged 48 | mask.Dispose(); 49 | })(); 50 | 51 | -------------------------------------------------------------------------------- /samples/Drag Drop Basic.txt: -------------------------------------------------------------------------------- 1 | // vi:set ft=javascript ff=dos ts=4 sts=4 sw=4 et: 2 | 3 | // ==PREPROCESSOR== 4 | // @name "Drag Drop Basic" 5 | // @author "T.P Wang" 6 | // Add feature below to enable drag and drop support 7 | // @feature "dragdrop" 8 | // ==/PREPROCESSOR== 9 | 10 | function RGB(r, g, b) { 11 | return (0xff000000 | (r << 16) | (g << 8) | (b)); 12 | } 13 | 14 | var color_background = RGB(255, 255, 255); 15 | var color_background2 = RGB(193, 219, 252); 16 | var dragging = false; 17 | 18 | function on_paint(gr) { 19 | var color = dragging ? color_background2 : color_background; 20 | 21 | gr.FillSolidRect(0, 0, window.Width, window.Height, color); 22 | } 23 | 24 | function on_drag_enter() { 25 | dragging = true; 26 | window.Repaint(); 27 | } 28 | 29 | function on_drag_leave() { 30 | dragging = false; 31 | window.Repaint(); 32 | } 33 | 34 | // Here we create a new playlist for hosting the dropped objects. 35 | function on_drag_drop(action) { 36 | var playlist_name = "Dropped Items"; 37 | var idx = -1; 38 | 39 | // Find the playlist first. 40 | for (var i = 0; i < fb.PlaylistCount; ++i) { 41 | if (fb.GetPlaylistName(i) == playlist_name) { 42 | idx = i; 43 | break; 44 | } 45 | } 46 | 47 | // If not found, then create one. 48 | if (idx == -1) 49 | idx = fb.CreatePlaylist(fb.PlaylistCount, playlist_name); 50 | 51 | // This is required because when a drop event is fired, you won't get on_drag_leave() called. 52 | dragging = false; 53 | window.Repaint(); 54 | 55 | // We are going to process the dropped items to a playlist. 56 | action.ToPlaylist(); 57 | action.Playlist = idx; 58 | action.ToSelect = false; 59 | 60 | // Dropped items will be added to the active playlist later. 61 | } 62 | -------------------------------------------------------------------------------- /samples/GetAlbumArtAsync.txt: -------------------------------------------------------------------------------- 1 | // vi:set ft=javascript ff=dos ts=4 sts=4 sw=4 et: 2 | 3 | // ==PREPROCESSOR== 4 | // @name "GetAlbumArtAsync" 5 | // @author "T.P Wang" 6 | // ==/PREPROCESSOR== 7 | 8 | AlbumArtId = { 9 | front: 0, 10 | back: 1, 11 | disc: 2, 12 | icon: 3 13 | }; 14 | 15 | var g_img = null; 16 | var ww = 0, 17 | wh = 0; 18 | 19 | 20 | function on_paint(gr) { 21 | gr.FillSolidRect(0, 0, ww, wh, 0xffffffff); 22 | 23 | // Draw front cover 24 | if (g_img) { 25 | // Keep aspect ratio 26 | var scale_w = ww / g_img.Width; 27 | var scale_h = wh / g_img.Height; 28 | var scale = Math.min(scale_w, scale_h); 29 | var pos_x = 0, 30 | pos_y = 0; 31 | 32 | if (scale_w < scale_h) pos_y = (wh - g_img.height * scale) / 2; 33 | else if (scale_w > scale_h) pos_x = (ww - g_img.Width * scale) / 2; 34 | 35 | gr.DrawImage(g_img, pos_x, pos_y, g_img.Width * scale, g_img.Height * scale, 0, 0, g_img.Width, g_img.Height); 36 | } 37 | } 38 | 39 | function on_size() { 40 | ww = window.Width; 41 | wh = window.Height; 42 | } 43 | 44 | function on_playback_new_track(metadb) { 45 | // GetAlbumArtAsync will run in the background 46 | // When it's finished, on_get_album_art_done() will get called. 47 | if (metadb) utils.GetAlbumArtAsync(window.ID, metadb, AlbumArtId.front); 48 | g_img = null; 49 | } 50 | 51 | function on_get_album_art_done(metadb, art_id, image, image_path) { 52 | //fb.trace("Path:", image_path); 53 | g_img = image; 54 | window.Repaint(); 55 | } 56 | 57 | on_playback_new_track(fb.GetNowPlaying()); 58 | -------------------------------------------------------------------------------- /samples/GetAlbumArtV2.txt: -------------------------------------------------------------------------------- 1 | // vi:set ft=javascript ff=dos ts=4 sts=4 sw=4 et: 2 | 3 | // ==PREPROCESSOR== 4 | // @name "GetAlbumArtV2" 5 | // @author "T.P Wang" 6 | // ==/PREPROCESSOR== 7 | 8 | // NOTE: 9 | // It's not recommended to use this example because whole process will be blocked 10 | // and waited before utils.GetAlbumArtV2() is finished. 11 | 12 | AlbumArtId = { 13 | front: 0, 14 | back: 1, 15 | disc: 2, 16 | icon: 3 17 | }; 18 | 19 | var g_img = null; 20 | var ww = 0, 21 | wh = 0; 22 | 23 | function on_paint(gr) { 24 | // Draw front cover, keep aspect-ratio 25 | if (g_img) { 26 | var scale = 0; 27 | var x = 0, 28 | y = 0; 29 | var scale_w = ww / g_img.Width; 30 | var scale_h = wh / g_img.Height; 31 | 32 | if (scale_w <= scale_h) { 33 | scale = scale_w; 34 | y = (wh - g_img.Height * scale) / 2; 35 | } else { 36 | scale = scale_h; 37 | x = (ww - g_img.Width * scale) / 2; 38 | } 39 | 40 | gr.DrawImage(g_img, x, y, g_img.Width * scale, g_img.Height * scale, 0, 0, g_img.Width, g_img.Height); 41 | } 42 | } 43 | 44 | function on_size() { 45 | ww = window.Width; 46 | wh = window.Height; 47 | } 48 | 49 | function get_album_art(metadb) { 50 | if (metadb) 51 | // Get front cover 52 | return utils.GetAlbumArtV2(metadb, AlbumArtId.front); 53 | } 54 | 55 | g_img = get_album_art(fb.GetNowPlaying()); 56 | 57 | function on_playback_new_track(metadb) { 58 | if (g_img) g_img.Dispose(); 59 | g_img = get_album_art(metadb); 60 | window.Repaint(); 61 | } 62 | -------------------------------------------------------------------------------- /samples/Glow Text Sample.txt: -------------------------------------------------------------------------------- 1 | // vi:set ft=javascript ff=dos ts=4 sts=4 sw=4 et: 2 | 3 | // ==PREPROCESSOR== 4 | // @name "Glow Text Sample" 5 | // @author "T.P Wang" 6 | // ==/PREPROCESSOR== 7 | 8 | function RGB(r, g, b) { 9 | return (0xff000000 | (r << 16) | (g << 8) | (b)); 10 | } 11 | 12 | function RGBA(r, g, b, a) { 13 | return ((a << 24) | (r << 16) | (g << 8) | (b)); 14 | } 15 | 16 | var g_font = gdi.Font("Segoe UI", 22, 1); 17 | var g_drag = false; 18 | var g_textrender = gdi.CreateStyleTextRender(); 19 | var g_bkclr = RGB(0, 0, 0); 20 | 21 | function on_paint(gr) { 22 | gr.SetTextRenderingHint(5); 23 | gr.SetSmoothingMode(4); 24 | gr.SetInterpolationMode(7); 25 | 26 | var ww = window.Width; 27 | var wh = window.Height; 28 | 29 | // Draw background first 30 | gr.FillSolidRect(0, 0, ww, wh, g_bkclr); 31 | 32 | g_textrender.GlowText(RGB(0, 0, 64), RGBA(255, 255, 0, 30), 12); 33 | 34 | // Clear previous shadow setting 35 | g_textrender.EnableShadow(true); 36 | g_textrender.ResetShadow(); 37 | 38 | g_textrender.RenderStringRect(gr, "Glow Text Sample", g_font, 0, 0, ww, wh, 0x11005000); 39 | } 40 | -------------------------------------------------------------------------------- /samples/LoadImageAsync.txt: -------------------------------------------------------------------------------- 1 | // vi:set ft=javascript ff=dos ts=4 sts=4 sw=4 et: 2 | 3 | // ==PREPROCESSOR== 4 | // @name "LoadImageAsync" 5 | // @author "T.P Wang" 6 | // ==/PREPROCESSOR== 7 | 8 | // Get a list of images from a folder contains pictures 9 | // ***NOTE*** 10 | // You should configure the path before use. 11 | var g_image_list = utils.Glob("D:\\Pictures\\Wallpaper\\*.jpg").toArray(); 12 | 13 | var ww = 0, 14 | wh = 0; 15 | var g_img = null; 16 | var g_valid_tid = 0; 17 | 18 | // Trigger every 5 seconds. 19 | var g_timer = window.SetInterval(on_every_5000_seconds, 5000); 20 | 21 | load_random_image_async(); 22 | 23 | function load_random_image_async() { 24 | // Load a random image from the list 25 | var path = g_image_list[Math.floor(Math.random() * g_image_list.length)]; 26 | //fb.trace(path); 27 | g_valid_tid = gdi.LoadImageAsync(window.ID, path); 28 | } 29 | 30 | function on_size() { 31 | ww = window.Width; 32 | wh = window.Height; 33 | } 34 | 35 | function on_paint(gr) { 36 | if (g_img) { 37 | var x = 0, 38 | y = 0; 39 | var scale = 0; 40 | var scale_w = ww / g_img.Width; 41 | var scale_h = wh / g_img.Height; 42 | 43 | if (scale_w <= scale_h) { 44 | scale = scale_w; 45 | y = (wh - g_img.Height * scale) / 2; 46 | } else { 47 | scale = scale_h; 48 | x = (ww - g_img.Width * scale) / 2; 49 | } 50 | 51 | gr.DrawImage(g_img, x, y, g_img.Width * scale, g_img.Height * scale, 0, 0, g_img.Width, g_img.Height); 52 | } 53 | } 54 | 55 | function on_every_5000_seconds(timer_id) { 56 | load_random_image_async(); 57 | } 58 | 59 | // After loading image is done in the background, this callback will be invoked 60 | function on_load_image_done(tid, image) { 61 | if (g_valid_tid == tid) { 62 | // Dispose previous image, in order to save memory 63 | g_img && g_img.Dispose(); 64 | g_img = image; 65 | window.Repaint(); 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /samples/MainMenuManager.txt: -------------------------------------------------------------------------------- 1 | // vi:set ft=javascript ff=dos ts=4 sts=4 sw=4 et: 2 | 3 | // ==PREPROCESSOR== 4 | // @name "MainMenuManager" 5 | // @author "T.P Wang" 6 | // ==/PREPROCESSOR== 7 | 8 | // Flags, used by Menu 9 | var MF_SEPARATOR = 0x00000800; 10 | var MF_ENABLED = 0x00000000; 11 | var MF_GRAYED = 0x00000001; 12 | var MF_DISABLED = 0x00000002; 13 | var MF_UNCHECKED = 0x00000000; 14 | var MF_CHECKED = 0x00000008; 15 | var MF_STRING = 0x00000000; 16 | var MF_POPUP = 0x00000010; 17 | var MF_RIGHTJUSTIFY = 0x00004000; 18 | 19 | // Custom popup menu should always reponse to left-click 20 | 21 | function on_mouse_lbtn_down(x, y) { 22 | var menuman = fb.CreateMainMenuManager(); 23 | var menu = window.CreatePopupMenu(); 24 | var ret; 25 | 26 | // Build a menu based on "View" 27 | menuman.Init("View"); 28 | menuman.BuildMenu(menu, 1, 128); 29 | 30 | // Show menu 31 | ret = menu.TrackPopupMenu(x, y); 32 | 33 | fb.trace(ret); 34 | 35 | if (ret > 0) { 36 | // Execute menu commands 37 | // "ID" is based on which is generated 38 | menuman.ExecuteByID(ret - 1); 39 | } 40 | 41 | menuman.Dispose(); 42 | menu.Dispose(); 43 | } 44 | -------------------------------------------------------------------------------- /samples/Menu Sample (Advance).txt: -------------------------------------------------------------------------------- 1 | // vi:set ft=javascript ff=dos ts=4 sts=4 sw=4 et: 2 | 3 | // ==PREPROCESSOR== 4 | // @name "Menu Sample (Advance)" 5 | // @author "T.P Wang" 6 | // ==/PREPROCESSOR== 7 | 8 | // Flags, used by Menu 9 | var MF_SEPARATOR = 0x00000800; 10 | var MF_ENABLED = 0x00000000; 11 | var MF_GRAYED = 0x00000001; 12 | var MF_DISABLED = 0x00000002; 13 | var MF_UNCHECKED = 0x00000000; 14 | var MF_CHECKED = 0x00000008; 15 | var MF_STRING = 0x00000000; 16 | var MF_POPUP = 0x00000010; 17 | var MF_RIGHTJUSTIFY = 0x00004000; 18 | 19 | // custom popup menu should always reponse to left-click 20 | // This sample is more complex, because use fb2k's context menu manager to display system context menu 21 | 22 | function on_mouse_lbtn_down(x, y) { 23 | var _context = fb.CreateContextMenuManager(); 24 | var _basemenu = window.CreatePopupMenu(); 25 | var _child = window.CreatePopupMenu(); 26 | var ret; 27 | 28 | // Please start index at 1, NOT 0 29 | _basemenu.AppendMenuItem(MF_STRING, 1, "item1"); 30 | _basemenu.AppendMenuItem(MF_STRING, 2, "item2"); 31 | _child.AppendTo(_basemenu, MF_STRING, "Now Playing"); 32 | 33 | _context.InitNowPlaying(); 34 | _context.BuildMenu(_child, 3, -1); 35 | 36 | ret = _basemenu.TrackPopupMenu(x, y); 37 | 38 | // Here is why start index should be 0 39 | if (ret == 0) return; 40 | 41 | // Execute! 42 | switch (ret) { 43 | case 1: 44 | fb.trace("Mmmm, you have choose item1, of course"); 45 | break; // break is important, or it will exucte the following... 46 | case 2: 47 | fb.trace("Ok, item2 is clicked"); 48 | break; 49 | 50 | default: 51 | _context.ExecuteByID(ret - 3); 52 | fb.trace(ret.toString()); 53 | break; 54 | } 55 | 56 | _basemenu.Dispose(); 57 | } 58 | -------------------------------------------------------------------------------- /samples/Menu Sample (Base).txt: -------------------------------------------------------------------------------- 1 | // vi:set ft=javascript ff=dos ts=4 sts=4 sw=4 et: 2 | 3 | // ==PREPROCESSOR== 4 | // @name "Menu Sample (Base)" 5 | // @author "T.P Wang" 6 | // ==/PREPROCESSOR== 7 | 8 | var MF_SEPARATOR = 0x00000800; 9 | var MF_ENABLED = 0x00000000; 10 | var MF_GRAYED = 0x00000001; 11 | var MF_DISABLED = 0x00000002; 12 | var MF_UNCHECKED = 0x00000000; 13 | var MF_CHECKED = 0x00000008; 14 | var MF_STRING = 0x00000000; 15 | var MF_POPUP = 0x00000010; 16 | var MF_RIGHTJUSTIFY = 0x00004000; 17 | 18 | function on_mouse_lbtn_down(x, y) { 19 | var _menu = window.CreatePopupMenu(); 20 | var i = 1, 21 | j; 22 | var ret; 23 | 24 | _menu.AppendMenuItem(MF_STRING, i++, "Default"); 25 | _menu.AppendMenuItem(MF_STRING, i++, "Repeat (Playlist)"); 26 | _menu.AppendMenuItem(MF_STRING, i++, "Repeat (Track)"); 27 | _menu.AppendMenuItem(MF_STRING, i++, "Random"); 28 | _menu.AppendMenuItem(MF_STRING, i++, "Shuffle (tracks)"); 29 | _menu.AppendMenuItem(MF_STRING, i++, "Shuffle (albums)"); 30 | _menu.AppendMenuItem(MF_STRING, i, "Shuffle (folders)"); 31 | _menu.CheckMenuRadioItem(1, i, fb.PlayBackOrder + 1); 32 | 33 | j = i + 1; 34 | 35 | _menu.AppendMenuItem(MF_STRING, j++, "Default"); 36 | _menu.AppendMenuItem(MF_STRING, j++, "Repeat (Playlist)"); 37 | _menu.AppendMenuItem(MF_STRING, j++, "Repeat (Track)"); 38 | _menu.AppendMenuItem(MF_STRING, j++, "Random"); 39 | _menu.AppendMenuItem(MF_STRING, j++, "Shuffle (tracks)"); 40 | _menu.AppendMenuItem(MF_STRING, j++, "Shuffle (albums)"); 41 | _menu.AppendMenuItem(MF_STRING, i, "Shuffle (folders)"); 42 | _menu.CheckMenuRadioItem(j, i, fb.PlayBackOrder + j); 43 | 44 | ret = _menu.TrackPopupMenu(x, y); 45 | if (ret >= 1 && ret <= i) { 46 | fb.PlayBackOrder = ret - 1; 47 | } 48 | 49 | _menu.Dispose(); 50 | } 51 | -------------------------------------------------------------------------------- /samples/Preprocessor.txt: -------------------------------------------------------------------------------- 1 | // vi:set ft=javascript ff=dos ts=4 sts=4 sw=4 et: 2 | 3 | // Demonstrate how to use import preprocessor directive 4 | // Copy scripts directory in this sample to the directory which contains foobar2000.exe 5 | 6 | // ==PREPROCESSOR== 7 | // @name "Preprocessor" 8 | // @author "T.P Wang" 9 | // import some craps here 10 | // @import "%fb2k_path%scripts\includeme.js" 11 | // ==/PREPROCESSOR== 12 | 13 | // Only print one message to the console 14 | print_to_console("Hello, world!"); 15 | -------------------------------------------------------------------------------- /samples/Themed Seek Bar.txt: -------------------------------------------------------------------------------- 1 | // vi:set ft=javascript ff=dos ts=4 sts=4 sw=4 et: 2 | 3 | // ==PREPROCESSOR== 4 | // @name "Themed Seek Bar" 5 | // @author "T.P Wang" 6 | // ==/PREPROCESSOR== 7 | 8 | // This is just a demo so is buggy. 9 | var g_theme = window.CreateThemeManager("PROGRESS"); 10 | var g_bar_height = 15; 11 | var g_cycles = 0; 12 | var ww = 0, 13 | wh = 0; 14 | var top = 0; 15 | var g_pos = 0; 16 | var g_drag = false; 17 | var g_length = 1; 18 | 19 | function clamp(x, l, h) { 20 | return (x < l) ? l : ((x > h) ? h : x); 21 | } 22 | 23 | 24 | function on_size() { 25 | ww = window.Width; 26 | wh = window.Height; 27 | top = (wh - g_bar_height) >> 1; 28 | } 29 | 30 | function on_paint(gr) { 31 | g_theme.SetPartAndStateID(1, 0); 32 | g_theme.DrawThemeBackground(gr, 0, top, ww, g_bar_height); 33 | 34 | if (fb.IsPlaying && g_length > 0) { 35 | g_theme.SetPartAndStateID(5, fb.IsPaused ? 3 : 1); 36 | g_theme.DrawThemeBackground(gr, 0, top, g_pos, g_bar_height); 37 | } 38 | } 39 | 40 | function on_mouse_lbtn_down(x, y) { 41 | if (g_length > 0) { 42 | g_drag = true; 43 | on_mouse_move(x, y); 44 | } 45 | } 46 | 47 | function on_mouse_lbtn_up(x, y) { 48 | if (g_length > 0 && g_drag) { 49 | g_drag = false; 50 | fb.PlaybackTime = g_length * g_pos / ww; 51 | on_mouse_move(x, y); 52 | } 53 | } 54 | 55 | function on_mouse_move(x, y) { 56 | if (g_drag) { 57 | g_pos = clamp(x, 0, ww); 58 | window.Repaint(); 59 | } 60 | } 61 | 62 | function on_mouse_wheel(delta) { 63 | fb.PlaybackTime = fb.PlaybackTime + delta * 2; 64 | } 65 | 66 | function on_playback_time(time) { 67 | if (!g_drag) { 68 | if (g_length > 0) g_pos = ww * time / g_length; 69 | window.Repaint(); 70 | } 71 | } 72 | 73 | function on_playback_seek() { 74 | if (!g_drag && g_length > 0) window.Repaint(); 75 | } 76 | 77 | function on_playback_pause() { 78 | window.Repaint(); 79 | } 80 | 81 | function on_playback_stop() { 82 | g_length = 0; 83 | g_pos = 0; 84 | g_drag = false; 85 | window.Repaint(); 86 | } 87 | 88 | function on_playback_new_track() { 89 | g_length = fb.PlaybackLength; 90 | g_pos = 0; 91 | g_drag = false; 92 | window.Repaint(); 93 | } 94 | 95 | if (fb.IsPlaying) on_playback_new_track(); 96 | -------------------------------------------------------------------------------- /samples/Timer.txt: -------------------------------------------------------------------------------- 1 | // vi:set ft=javascript ff=dos ts=4 sts=4 sw=4 et: 2 | 3 | // This sample create two timers 4 | // Click the window to start the timer, and see the result after the console is showed. 5 | // Click the window again to kill all timers. 6 | 7 | // ==PREPROCESSOR== 8 | // @name "Timer" 9 | // @author "T.P Wang" 10 | // ==/PREPROCESSOR== 11 | 12 | var g_timer_started = false; 13 | var g_count = 0; 14 | var g_timer1_ID, g_timer2_ID; 15 | 16 | function print_to_console(msg) { 17 | fb.trace("Timer test:", msg); 18 | } 19 | 20 | function on_mouse_lbtn_up() { 21 | if (!g_timer_started) { 22 | // Timer are created here 23 | // 2s - one shot, happens after 2000 ms, only once 24 | g_timer1_ID = window.SetTimeout(function() { 25 | // Print and show console 26 | fb.ShowConsole(); 27 | print_to_console("g_timer1: Show console now."); 28 | }, 2000); 29 | 30 | // 500ms - periodic, happens every 500 ms 31 | g_timer2_ID = window.SetInterval(function() { 32 | g_count++; 33 | print_to_console("g_timer2: " + g_count + " time(s)."); 34 | }, 500); 35 | 36 | g_timer_started = true; 37 | } else { 38 | // Kill all timers 39 | window.ClearTimeout(g_timer2_ID); 40 | window.ClearInterval(g_timer1_ID); 41 | g_timer_started = false; 42 | g_count = 0; 43 | print_to_console("Timers killed."); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /samples/Tooltip (Tracking).txt: -------------------------------------------------------------------------------- 1 | // vi:set ft=javascript ff=dos ts=4 sts=4 sw=4 et: 2 | 3 | // ==PREPROCESSOR== 4 | // @name "Tooltip" 5 | // @author "T.P Wang" 6 | // ==/PREPROCESSOR== 7 | 8 | // ------------------------------ 9 | // --- COMMON FUNCTIONS 10 | // ------------------------------ 11 | function RGBA(r, g, b, a) { 12 | return ((a << 24) | (r << 16) | (g << 8) | (b)); 13 | } 14 | 15 | function RGB(r, g, b) { 16 | return (0xff000000 | (r << 16) | (g << 8) | (b)); 17 | } 18 | 19 | var DT_TOP = 0x00000000; 20 | var DT_CENTER = 0x00000001; 21 | var DT_VCENTER = 0x00000004; 22 | var DT_WORDBREAK = 0x00000010; 23 | var DT_CALCRECT = 0x00000400; 24 | var DT_NOPREFIX = 0x00000800; 25 | 26 | // Create a windows tooltip here 27 | // Please do not create more than one tooltip in one panel 28 | var g_tooltip = window.CreateTooltip(); 29 | var g_font = gdi.Font("Tahoma", 14); 30 | var g_trackingMouse = false; 31 | var g_oldX, g_oldY; 32 | var ww, wh; 33 | 34 | 35 | function on_mouse_move(x, y) { 36 | if (!g_trackingMouse) { 37 | g_tooltip.Activate(); 38 | g_tooltip.TrackActivate = true; 39 | g_trackingMouse = true; 40 | } 41 | 42 | // Make sure the position is changed 43 | if (g_oldX != x || g_oldY != y) { 44 | g_tooltip.Text = "x:" + x + ", y:" + y; 45 | g_tooltip.TrackPosition(x + 10, y + 20); 46 | g_oldX = x; 47 | g_oldY = y; 48 | } 49 | } 50 | 51 | function on_mouse_leave() { 52 | g_trackingMouse = false; 53 | g_tooltip.TrackActivate = false; 54 | } 55 | 56 | function on_size() { 57 | ww = window.Width; 58 | wh = window.Height; 59 | } 60 | 61 | function on_paint(gr) { 62 | gr.GdiDrawText("Move your mouse", g_font, RGB(0, 0, 0), 0, 0, ww, wh, DT_VCENTER | DT_CENTER | DT_WORDBREAK | DT_CALCRECT | DT_NOPREFIX); 63 | } 64 | -------------------------------------------------------------------------------- /samples/Volbar with GdiDrawText.txt: -------------------------------------------------------------------------------- 1 | // vi:set ft=javascript ff=dos ts=4 sts=4 sw=4 et: 2 | 3 | // ==PREPROCESSOR== 4 | // @name "Volbar with GdiDrawText" 5 | // @author "T.P Wang" 6 | // ==/PREPROCESSOR== 7 | 8 | // Flags, used with GdiDrawText 9 | // For more information, see: http://msdn.microsoft.com/en-us/library/dd162498(VS.85).aspx 10 | var DT_TOP = 0x00000000; 11 | var DT_LEFT = 0x00000000; 12 | var DT_CENTER = 0x00000001; 13 | var DT_RIGHT = 0x00000002; 14 | var DT_VCENTER = 0x00000004; 15 | var DT_BOTTOM = 0x00000008; 16 | var DT_WORDBREAK = 0x00000010; 17 | var DT_SINGLELINE = 0x00000020; 18 | var DT_EXPANDTABS = 0x00000040; 19 | var DT_TABSTOP = 0x00000080; 20 | var DT_NOCLIP = 0x00000100; 21 | var DT_EXTERNALLEADING = 0x00000200; 22 | var DT_CALCRECT = 0x00000400; 23 | var DT_NOPREFIX = 0x00000800; 24 | var DT_INTERNAL = 0x00001000; 25 | var DT_EDITCONTROL = 0x00002000; 26 | var DT_PATH_ELLIPSIS = 0x00004000; 27 | var DT_END_ELLIPSIS = 0x00008000; 28 | var DT_MODIFYSTRING = 0x00010000; 29 | var DT_RTLREADING = 0x00020000; 30 | var DT_WORD_ELLIPSIS = 0x00040000; 31 | var DT_NOFULLWIDTHCHARBREAK = 0x00080000; 32 | var DT_HIDEPREFIX = 0x00100000; 33 | var DT_PREFIXONLY = 0x00200000; 34 | 35 | function RGB(r, g, b) { 36 | return (0xff000000 | (r << 16) | (g << 8) | (b)); 37 | } 38 | 39 | var g_font = gdi.Font("Tahoma", 12, 0); 40 | var g_drag = 0; 41 | 42 | function on_paint(gr) { 43 | var ww = window.Width; 44 | var wh = window.Height; 45 | var volume = fb.Volume; 46 | var pos = window.Width * ((100 + volume) / 100); 47 | var txt = (Math.ceil(volume)) + "dB"; 48 | gr.FillGradRect(0, 0, pos, wh, 90, RGB(240, 240, 240), RGB(100, 230, 100)); 49 | gr.FillGradRect(pos, 0, ww - pos, wh, 90, RGB(240, 240, 240), RGB(190, 190, 190)); 50 | gr.GdiDrawText(txt, g_font, RGB(64, 64, 128), 0, 0, ww, wh, DT_CENTER | DT_VCENTER | DT_SINGLELINE); 51 | gr.DrawRect(0, 0, ww - 1, wh - 1, 1.0, RGB(150, 150, 150)); 52 | } 53 | 54 | function on_mouse_lbtn_down(x, y) { 55 | g_drag = 1; 56 | } 57 | 58 | function on_mouse_lbtn_up(x, y) { 59 | on_mouse_move(x, y); 60 | g_drag = 0; 61 | } 62 | 63 | function on_mouse_move(x, y) { 64 | if (g_drag) { 65 | var v = x / window.Width; 66 | v = (v < 0) ? 0 : (v < 1) ? v : 1; 67 | v = -100 * (1 - v); 68 | if (fb.Volume != v) fb.Volume = v; 69 | } 70 | } 71 | 72 | function on_mouse_wheel(delta) { 73 | if (delta > 0) fb.VolumeUp(); 74 | else fb.VolumeDown(); 75 | } 76 | 77 | function on_volume_change(val) { 78 | window.Repaint(); 79 | } 80 | -------------------------------------------------------------------------------- /samples/Volbar.txt: -------------------------------------------------------------------------------- 1 | // vi:set ft=javascript ff=dos ts=4 sts=4 sw=4 et: 2 | 3 | // ==PREPROCESSOR== 4 | // @name "Volbar" 5 | // @author "T.P Wang" 6 | // ==/PREPROCESSOR== 7 | 8 | function RGB(r, g, b) { 9 | return (0xff000000 | (r << 16) | (g << 8) | (b)); 10 | } 11 | 12 | // gdi.Font is changed, the last parameter is style flags 13 | // FontStyleRegular = 0, 14 | // FontStyleBold = 1, 15 | // FontStyleItalic = 2, 16 | // FontStyleBoldItalic = 3, 17 | // FontStyleUnderline = 4, 18 | // FontStyleStrikeout = 8 19 | // Here is 0, means FontStyleRegular 20 | var g_font = gdi.Font("Tahoma", 12, 0); 21 | var g_drag = 0; 22 | 23 | function on_paint(gr) { 24 | gr.SetTextRenderingHint(5); 25 | var ww = window.Width; 26 | var wh = window.Height; 27 | var volume = fb.Volume; 28 | var pos = window.Width * ((100 + volume) / 100); 29 | var txt = (Math.ceil(volume)) + "dB"; 30 | gr.FillGradRect(0, 0, pos, wh, 90, RGB(240, 240, 240), RGB(100, 230, 100)); 31 | gr.FillGradRect(pos, 0, ww - pos, wh, 90, RGB(240, 240, 240), RGB(190, 190, 190)); 32 | gr.DrawString(txt, g_font, RGB(64, 64, 128), 0, 0, ww, wh, 0x11005000); 33 | gr.DrawRect(0, 0, ww - 1, wh - 1, 1.0, RGB(150, 150, 150)); 34 | } 35 | 36 | function on_mouse_lbtn_down(x, y) { 37 | g_drag = 1; 38 | } 39 | 40 | function on_mouse_lbtn_up(x, y) { 41 | on_mouse_move(x, y); 42 | g_drag = 0; 43 | } 44 | 45 | function on_mouse_move(x, y) { 46 | if (g_drag) { 47 | var v = x / window.Width; 48 | v = (v < 0) ? 0 : (v < 1) ? v : 1; 49 | v = -100 * (1 - v); 50 | if (fb.Volume != v) fb.Volume = v; 51 | } 52 | } 53 | 54 | function on_mouse_wheel(delta) { 55 | if (delta > 0) fb.VolumeUp(); 56 | else fb.VolumeDown(); 57 | } 58 | 59 | function on_volume_change(val) { 60 | window.Repaint(); 61 | } 62 | -------------------------------------------------------------------------------- /samples/Watch Metadb Change (Base).txt: -------------------------------------------------------------------------------- 1 | // vi:set ft=javascript ff=dos ts=4 sts=4 sw=4 et: 2 | 3 | // ==PREPROCESSOR== 4 | // @name "Watch Metadb Change (Base)" 5 | // @author "T.P Wang" 6 | // The following two lines are required to make this sample to work. 7 | // @feature "v1.4" 8 | // @feature "watch-metadb" 9 | // ==/PREPROCESSOR== 10 | 11 | // Callback 12 | function on_metadb_changed(handles, fromhook) { 13 | fb.trace('on_metadb_changed'); 14 | var count = handles.Count; 15 | // Prompt how many files has been changed 16 | fb.ShowPopupMessage("" + count + ((count > 1) ? " files have" : " file has") + " been changed."); 17 | } 18 | -------------------------------------------------------------------------------- /samples/images/image.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ttsping/foo_uie_wsh_panel_mod_plus/fafd9a0cdbed36a73009b3d9cf5ea58ed9be2d78/samples/images/image.jpg -------------------------------------------------------------------------------- /samples/images/mask.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ttsping/foo_uie_wsh_panel_mod_plus/fafd9a0cdbed36a73009b3d9cf5ea58ed9be2d78/samples/images/mask.png -------------------------------------------------------------------------------- /samples/scripts/includeme.js: -------------------------------------------------------------------------------- 1 | function print_to_console(msg) { 2 | fb.trace(msg); 3 | } 4 | -------------------------------------------------------------------------------- /scintilla/.hg_archival.txt: -------------------------------------------------------------------------------- 1 | repo: bdf8c3ef2fb01ea24578e726337888e706d10b92 2 | node: 338662f185a7a7519553f90b66fda346587e76f7 3 | branch: default 4 | latesttag: rel-3-5-0 5 | latesttagdistance: 1 6 | -------------------------------------------------------------------------------- /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 | **.rb = native 26 | **.pl = native 27 | **.txt = native 28 | **.pch = native 29 | **.hgeol = native 30 | **.dsp = native 31 | **.sln = native 32 | **.vcproj = native 33 | **.pro = native 34 | **.gen = native 35 | **makefile = native 36 | README = native 37 | **.bmp = BIN 38 | **.cur = BIN 39 | **.ico = BIN 40 | **.jpg = BIN 41 | **.png = BIN 42 | tgzsrc = LF 43 | -------------------------------------------------------------------------------- /scintilla/.hgignore: -------------------------------------------------------------------------------- 1 | syntax: glob 2 | *.o 3 | *.a 4 | *.lib 5 | *.obj 6 | *.pyc 7 | *.dll 8 | *.dylib 9 | *.framework 10 | *.pyd 11 | *.exp 12 | *.lib 13 | *.pdb 14 | *.res 15 | *.bak 16 | *.sbr 17 | *.suo 18 | *.idb 19 | *.bsc 20 | *.intermediate.manifest 21 | *.lastbuildstate 22 | *.cache 23 | *.ilk 24 | *.ncb 25 | *.tlog 26 | *.sdf 27 | gtk/*.plist 28 | win32/*.plist 29 | *.opt 30 | *.plg 31 | *.pbxbtree 32 | *.mode1v3 33 | *.pbxuser 34 | *.pbproj 35 | *.log 36 | *.xcbkptlist 37 | *.xcscheme 38 | *.xcworkspacedata 39 | *.xcuserstate 40 | *.xcsettings 41 | xcschememanagement.plist 42 | .DS_Store 43 | cocoa/build 44 | cocoa/ScintillaFramework/build 45 | cocoa/ScintillaTest/build 46 | macosx/SciTest/build 47 | *.cppcheck 48 | Makefile.Debug 49 | Makefile.Release 50 | *_resource.rc 51 | moc_* 52 | *.pro.user 53 | ScintillaEdit.cpp 54 | ScintillaEdit.h 55 | ScintillaConstants.py 56 | ScintillaEditBase.intermediate.manifest 57 | ScintillaEdit.intermediate.manifest 58 | qt/*/Makefile 59 | cov-int 60 | -------------------------------------------------------------------------------- /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/README: -------------------------------------------------------------------------------- 1 | README for building of Scintilla and SciTE 2 | 3 | Scintilla can be built by itself. 4 | To build SciTE, Scintilla must first be built. 5 | 6 | 7 | *** GTK+/Linux version *** 8 | 9 | You must first have GTK+ 2.0 or later and GCC (4.1 or better) installed. 10 | GTK+ 1.x will not work. 11 | Other C++ compilers may work but may require tweaking the make file. 12 | 13 | To build Scintilla, use the makefile located in the scintilla/gtk directory 14 | cd scintilla/gtk 15 | make 16 | cd ../.. 17 | 18 | To build and install SciTE, use the makefile located in the scite/gtk directory 19 | cd scite/gtk 20 | make 21 | make install 22 | 23 | This installs SciTE into $prefix/bin. The value of $prefix is determined from 24 | the location of Gnome if it is installed. This is usually /usr if installed 25 | with Linux or /usr/local if built from source. If Gnome is not installed 26 | /usr/bin is used as the prefix. The prefix can be overridden on the command 27 | line like "make prefix=/opt" but the same value should be used for both make 28 | and make install as this location is compiled into the executable. The global 29 | properties file is installed at $prefix/share/scite/SciTEGlobal.properties. 30 | The language specific properties files are also installed into this directory. 31 | 32 | To remove SciTE 33 | make uninstall 34 | 35 | To clean the object files which may be needed to change $prefix 36 | make clean 37 | 38 | The current make file only supports static linking between SciTE and Scintilla. 39 | 40 | 41 | *** Windows version *** 42 | 43 | A C++ compiler is required. Visual Studio 2010 is the development system 44 | used for most development although TDM Mingw32 4.7.1 is also supported. 45 | 46 | To build Scintilla, make in the scintilla/win32 directory 47 | cd scintilla\win32 48 | GCC: mingw32-make 49 | VS .NET: nmake -f scintilla.mak 50 | cd ..\.. 51 | 52 | To build SciTE, use the makefiles located in the scite/win32 directory 53 | cd scite\win32 54 | GCC: mingw32-make 55 | VS .NET: nmake -f scite.mak 56 | 57 | An executable SciTE will now be in scite/bin. 58 | 59 | *** GTK+/Windows version *** 60 | 61 | Mingw32 is known to work. Other compilers will probably not work. 62 | 63 | Only Scintilla will build with GTK+ on Windows. SciTE will not work. 64 | 65 | To build Scintilla, make in the scintilla/gtk directory 66 | cd scintilla\gtk 67 | mingw32-make 68 | -------------------------------------------------------------------------------- /scintilla/cocoa/Framework.mk: -------------------------------------------------------------------------------- 1 | ### start defines ### 2 | include common.mk 3 | 4 | INST_NAME=-install_name \ 5 | @executable_path/../Frameworks/Sci.framework/Versions/A/Sci 6 | 7 | LD=gcc $(ARCH) -dynamiclib -framework Cocoa $(INST_NAME) 8 | 9 | LEXOBJS:=$(addsuffix .o,$(basename $(notdir $(wildcard ../lexers/Lex*.cxx)))) 10 | 11 | SCI_LEXERS=$(LEXOBJS) \ 12 | LexerBase.o LexerModule.o LexerSimple.o Accessor.o 13 | 14 | SCI_OBJ=AutoComplete.o CallTip.o CellBuffer.o CharClassify.o \ 15 | ContractionState.o Decoration.o Document.o Editor.o \ 16 | ExternalLexer.o Indicator.o KeyMap.o LineMarker.o PerLine.o \ 17 | PositionCache.o PropSetSimple.o RESearch.o RunStyles.o ScintillaBase.o Style.o \ 18 | StyleContext.o UniConversion.o ViewStyle.o XPM.o WordList.o \ 19 | Selection.o CharacterSet.o Catalogue.o $(SCI_LEXERS) 20 | 21 | WAH_OBJ=DocumentAccessor.o KeyWords.o WindowAccessor.o 22 | 23 | COC_OBJ=PlatCocoa.o ScintillaCocoa.o ScintillaView.o InfoBar.o 24 | 25 | OBJ=$(SCI_OBJ) $(UNUSED_OBJ) $(COC_OBJ) 26 | OBJS=$(addprefix $(FRM_BLD)/,$(OBJ)) 27 | 28 | TARG=$(APP)/Versions/A/Sci 29 | APP=$(FRM_BLD)/Sci.framework 30 | ### end defines ### 31 | 32 | ### start targets ### 33 | 34 | all: $(FRM_BLD) $(TARG) 35 | 36 | cleanfrm: 37 | -rm -rf $(FRM_BLD) 38 | 39 | $(APP): $(FRM_BLD) 40 | -rm -rf $(APP) 41 | -mkdir $(APP) 42 | -mkdir $(APP)/Versions 43 | -mkdir $(APP)/Versions/A 44 | -mkdir $(APP)/Versions/A/Headers 45 | -mkdir $(APP)/Versions/A/Resources 46 | -ln -sf `pwd`/$(APP)/Versions/A `pwd`/$(APP)/Versions/Current 47 | -ln -sf `pwd`/$(APP)/Versions/A/Headers `pwd`/$(APP)/Headers 48 | -ln -sf `pwd`/$(APP)/Versions/A/Resources `pwd`/$(APP)/Resources 49 | -cp *.h $(APP)/Headers/ 50 | -cp ../src/*.h $(APP)/Headers/ 51 | -cp ../include/*.h $(APP)/Headers/ 52 | -cp -R ScintillaFramework/English.lproj $(APP)/Resources 53 | -cp res/*.png $(APP)/Resources 54 | -cp ScintillaFramework/Info.plist $(APP)/Resources 55 | 56 | $(TARG) : $(OBJS) $(APP) 57 | $(LD) $(OBJS) $(gDEFs) -o $(TARG) -lstdc++ 58 | -ln `pwd`/$(TARG) `pwd`/$(APP)/Sci 59 | 60 | $(FRM_BLD): 61 | -mkdir $(BLD) 62 | -mkdir $(FRM_BLD) 63 | 64 | ### get around to filling out the real dependencies later ### 65 | #$(FRM_BLD)/AutoComplete.o : ../src/AutoComplete.cxx ../src/AutoComplete.h \ 66 | # ../include/Platform.h 67 | 68 | #$(FRM_BLD)/CallTip.o : ../src/CallTip.cxx ../src/CallTip.h \ 69 | # ../include/Platform.h 70 | 71 | ### end targets ### 72 | -------------------------------------------------------------------------------- /scintilla/cocoa/InfoBar.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Scintilla source code edit control 4 | * 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 | { 21 | BOOL mIsEditingOrSelecting; 22 | } 23 | 24 | @end 25 | 26 | @interface InfoBar : NSView 27 | { 28 | @private 29 | NSImage* mBackground; 30 | IBDisplay mDisplayMask; 31 | 32 | float mScaleFactor; 33 | NSPopUpButton* mZoomPopup; 34 | 35 | int mCurrentCaretX; 36 | int mCurrentCaretY; 37 | NSTextField* mCaretPositionLabel; 38 | NSTextField* mStatusTextLabel; 39 | 40 | id mCallback; 41 | } 42 | 43 | - (void) notify: (NotificationType) type message: (NSString*) message location: (NSPoint) location 44 | value: (float) value; 45 | - (void) setCallback: (id ) callback; 46 | 47 | - (void) createItems; 48 | - (void) positionSubViews; 49 | - (void) setDisplay: (IBDisplay) display; 50 | - (void) zoomItemAction: (id) sender; 51 | - (void) setScaleFactor: (float) newScaleFactor adjustPopup: (BOOL) flag; 52 | - (void) setCaretPosition: (NSPoint) position; 53 | - (void) sizeToFit; 54 | 55 | @end 56 | -------------------------------------------------------------------------------- /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/QuartzTextStyleAttribute.h: -------------------------------------------------------------------------------- 1 | /** 2 | * QuartzTextStyleAttribute.h 3 | * 4 | * Original Code by Evan Jones on Wed Oct 02 2002. 5 | * Contributors: 6 | * Shane Caraveo, ActiveState 7 | * Bernd Paradies, Adobe 8 | * 9 | */ 10 | 11 | 12 | #ifndef _QUARTZ_TEXT_STYLE_ATTRIBUTE_H 13 | #define _QUARTZ_TEXT_STYLE_ATTRIBUTE_H 14 | 15 | class QuartzFont 16 | { 17 | public: 18 | /** Create a font style from a name. */ 19 | QuartzFont( const char* name, size_t length, float size, int weight, bool italic ) 20 | { 21 | assert( name != NULL && length > 0 && name[length] == '\0' ); 22 | 23 | CFStringRef fontName = CFStringCreateWithCString(kCFAllocatorDefault, name, kCFStringEncodingMacRoman); 24 | assert(fontName != NULL); 25 | bool bold = weight > SC_WEIGHT_NORMAL; 26 | 27 | if (bold || italic) 28 | { 29 | CTFontSymbolicTraits desiredTrait = 0; 30 | CTFontSymbolicTraits traitMask = 0; 31 | 32 | // if bold was specified, add the trait 33 | if (bold) { 34 | desiredTrait |= kCTFontBoldTrait; 35 | traitMask |= kCTFontBoldTrait; 36 | } 37 | 38 | // if italic was specified, add the trait 39 | if (italic) { 40 | desiredTrait |= kCTFontItalicTrait; 41 | traitMask |= kCTFontItalicTrait; 42 | } 43 | 44 | // create a font and then a copy of it with the sym traits 45 | CTFontRef iFont = ::CTFontCreateWithName(fontName, size, NULL); 46 | fontid = ::CTFontCreateCopyWithSymbolicTraits(iFont, size, NULL, desiredTrait, traitMask); 47 | if (fontid) 48 | { 49 | CFRelease(iFont); 50 | } 51 | else 52 | { 53 | // Traits failed so use base font 54 | fontid = iFont; 55 | } 56 | } 57 | else 58 | { 59 | // create the font, no traits 60 | fontid = ::CTFontCreateWithName(fontName, size, NULL); 61 | } 62 | 63 | if (!fontid) 64 | { 65 | // Failed to create requested font so use font always present 66 | fontid = ::CTFontCreateWithName((CFStringRef)@"Monaco", size, NULL); 67 | } 68 | 69 | CFRelease(fontName); 70 | } 71 | 72 | CTFontRef getFontID() 73 | { 74 | return fontid; 75 | } 76 | 77 | private: 78 | CTFontRef fontid; 79 | }; 80 | 81 | #endif 82 | 83 | -------------------------------------------------------------------------------- /scintilla/cocoa/SciTest.mk: -------------------------------------------------------------------------------- 1 | ### start defines ### 2 | include common.mk 3 | 4 | NAME=Demo 5 | 6 | LD=gcc $(ARCH) -framework Cocoa 7 | 8 | TARG=$(APP)/Contents/MacOS/$(NAME) 9 | APP=$(APP_BLD)/$(NAME).app 10 | 11 | all: $(APP_BLD) $(TARG) 12 | 13 | $(APP): 14 | -rm -rf $(APP) 15 | -mkdir $(APP) 16 | -mkdir $(APP)/Contents/ 17 | -mkdir $(APP)/Contents/Frameworks/ 18 | -mkdir $(APP)/Contents/MacOS/ 19 | -mkdir $(APP)/Contents/Resources/ 20 | -cp ScintillaTest/Info.plist $(APP)/Contents/Info.plist.bak 21 | -sed "s/\$${EXECUTABLE_NAME}/$(NAME)/g" < $(APP)/Contents/Info.plist.bak > $(APP)/Contents/Info.plist.bak2 22 | -sed "s/\$${PRODUCT_NAME}/$(NAME)/g" < $(APP)/Contents/Info.plist.bak2 > $(APP)/Contents/Info.plist 23 | -rm $(APP)/Contents/Info.plist.bak $(APP)/Contents/Info.plist.bak2 24 | -cp -r ScintillaTest/English.lproj $(APP)/Contents/Resources/ 25 | /Developer/usr/bin/ibtool --errors --warnings --notices --output-format human-readable-text \ 26 | --compile $(APP)/Contents/Resources/English.lproj/MainMenu.nib ScintillaTest/English.lproj/MainMenu.xib 27 | -cp ScintillaTest/TestData.sql $(APP)/Contents/Resources/ 28 | -make -f Framework.mk all 29 | 30 | $(TARG) : $(APP_BLD)/main.o $(APP_BLD)/AppController.o $(APP) 31 | -cp -R $(FRM_BLD)/Sci.framework $(APP)/Contents/Frameworks/ 32 | $(LD) $(APP_BLD)/main.o $(APP_BLD)/AppController.o $(APP)/Contents/Frameworks/Sci.framework/Sci -o $(TARG) -lstdc++ 33 | 34 | $(APP_BLD) : 35 | -mkdir $(BLD) 36 | -mkdir $(APP_BLD) 37 | -------------------------------------------------------------------------------- /scintilla/cocoa/ScintillaFramework/English.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ttsping/foo_uie_wsh_panel_mod_plus/fafd9a0cdbed36a73009b3d9cf5ea58ed9be2d78/scintilla/cocoa/ScintillaFramework/English.lproj/InfoPlist.strings -------------------------------------------------------------------------------- /scintilla/cocoa/ScintillaFramework/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | com.sun.${PRODUCT_NAME:identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | FMWK 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /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 | } 19 | 20 | - (void) awakeFromNib; 21 | - (void) setupEditor; 22 | - (IBAction) searchText: (id) sender; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /scintilla/cocoa/ScintillaTest/English.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ttsping/foo_uie_wsh_panel_mod_plus/fafd9a0cdbed36a73009b3d9cf5ea58ed9be2d78/scintilla/cocoa/ScintillaTest/English.lproj/InfoPlist.strings -------------------------------------------------------------------------------- /scintilla/cocoa/ScintillaTest/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | com.sun.${PRODUCT_NAME: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/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 targetting 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.9 macosx10.8 macosx10.7 macosx10.6 macosx10.5 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 | python WidgetGen.py 58 | qmake -spec macx-xcode 59 | xcodebuild clean 60 | xcodebuild 61 | cd .. 62 | 63 | cd ScintillaEditPy 64 | python sepbuild.py 65 | cd .. 66 | cd ../.. 67 | -------------------------------------------------------------------------------- /scintilla/cocoa/common.mk: -------------------------------------------------------------------------------- 1 | ### shared variables and targets between Framework.mk and SciTest.mk ### 2 | 3 | # build directories 4 | BLD=build 5 | APP_BLD=$(BLD)/Application 6 | FRM_BLD=$(BLD)/Framework 7 | 8 | ifdef DBG 9 | CFLAGS=-g -O0 10 | else 11 | CFLAGS=-Os 12 | endif 13 | 14 | # compiler and compiler options 15 | ARCH=-arch i386 $(CFLAGS) 16 | CC=gcc -x c++ $(ARCH) 17 | CO=gcc -x objective-c++ $(ARCH) 18 | CCX=$(CC) $(gDEFs) $(INCS) 19 | CCO=$(CO) $(gDEFs) $(INCS) 20 | 21 | # include directories and global #define 22 | gDEFs=-DSCI_NAMESPACE -DSCI_LEXER 23 | 24 | # source directories 25 | SRC_DIRS=../src ./ScintillaFramework ./ScintillaTest ./ \ 26 | ../lexers ../lexlib 27 | 28 | INC_DIRS=$(SRC_DIRS) ../include 29 | 30 | INCS=$(addprefix -I,$(INC_DIRS)) 31 | 32 | vpath %.m $(SRC_DIRS) 33 | vpath %.mm $(SRC_DIRS) 34 | vpath %.cpp $(SRC_DIRS) 35 | vpath %.cxx $(SRC_DIRS) 36 | vpath %.c $(SRC_DIRS) 37 | vpath %.h $(INC_DIRS) 38 | 39 | # clean everything 40 | clean: 41 | -rm -rf $(BLD) 42 | 43 | # build application objective-c++ files 44 | $(APP_BLD)/%.o : %.mm 45 | $(CCO) -c $< -o $@ 46 | 47 | # build application objective-c files 48 | $(APP_BLD)/%.o : %.m 49 | $(CCO) -c $< -o $@ 50 | 51 | # build framework c++ files 52 | $(FRM_BLD)/%.o : %.cxx 53 | $(CCX) -c $< -o $@ 54 | 55 | # build framework objective-c++ files 56 | $(FRM_BLD)/%.o : %.mm 57 | $(CCO) -c $< -o $@ -------------------------------------------------------------------------------- /scintilla/cocoa/res/info_bar_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ttsping/foo_uie_wsh_panel_mod_plus/fafd9a0cdbed36a73009b3d9cf5ea58ed9be2d78/scintilla/cocoa/res/info_bar_bg.png -------------------------------------------------------------------------------- /scintilla/cocoa/res/info_bar_bg@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ttsping/foo_uie_wsh_panel_mod_plus/fafd9a0cdbed36a73009b3d9cf5ea58ed9be2d78/scintilla/cocoa/res/info_bar_bg@2x.png -------------------------------------------------------------------------------- /scintilla/cocoa/res/mac_cursor_busy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ttsping/foo_uie_wsh_panel_mod_plus/fafd9a0cdbed36a73009b3d9cf5ea58ed9be2d78/scintilla/cocoa/res/mac_cursor_busy.png -------------------------------------------------------------------------------- /scintilla/cocoa/res/mac_cursor_busy@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ttsping/foo_uie_wsh_panel_mod_plus/fafd9a0cdbed36a73009b3d9cf5ea58ed9be2d78/scintilla/cocoa/res/mac_cursor_busy@2x.png -------------------------------------------------------------------------------- /scintilla/cocoa/res/mac_cursor_flipped.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ttsping/foo_uie_wsh_panel_mod_plus/fafd9a0cdbed36a73009b3d9cf5ea58ed9be2d78/scintilla/cocoa/res/mac_cursor_flipped.png -------------------------------------------------------------------------------- /scintilla/cocoa/res/mac_cursor_flipped@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ttsping/foo_uie_wsh_panel_mod_plus/fafd9a0cdbed36a73009b3d9cf5ea58ed9be2d78/scintilla/cocoa/res/mac_cursor_flipped@2x.png -------------------------------------------------------------------------------- /scintilla/cppcheck.suppress: -------------------------------------------------------------------------------- 1 | // File to suppress cppcheck warnings for files that will not be fixed. 2 | // Does not suppress warnings where an additional occurrence of the warning may be of interest. 3 | // Does not suppress false positives from cppcheck. 4 | 5 | // Coding style is to use assignments in constructor when there are many 6 | // members to initialize or the initialization is complex or has comments. 7 | useInitializationList 8 | 9 | // Suppress most lexer warnings since the lexers are maintained by others 10 | useInitializationList:scintilla/lexers/LexAsm.cxx 11 | useInitializationList:scintilla/lexers/LexBasic.cxx 12 | noCopyConstructor:scintilla/lexers/LexBash.cxx 13 | variableScope:scintilla/lexers/LexBash.cxx 14 | variableScope:scintilla/lexers/LexCmake.cxx 15 | variableScope:scintilla/lexers/LexCSS.cxx 16 | useInitializationList:scintilla/lexers/LexD.cxx 17 | variableScope:scintilla/lexers/LexErlang.cxx 18 | variableScope:scintilla/lexers/LexGui4Cli.cxx 19 | variableScope:scintilla/lexers/LexInno.cxx 20 | variableScope:scintilla/lexers/LexLaTeX.cxx 21 | variableScope:scintilla/lexers/LexMetapost.cxx 22 | variableScope:scintilla/lexers/LexModula.cxx 23 | variableScope:scintilla/lexers/LexNimrod.cxx 24 | variableScope:scintilla/lexers/LexNsis.cxx 25 | variableScope:scintilla/lexers/LexOpal.cxx 26 | variableScope:scintilla/lexers/LexOthers.cxx 27 | variableScope:scintilla/lexers/LexPB.cxx 28 | noCopyConstructor:scintilla/lexers/LexPerl.cxx 29 | variableScope:scintilla/lexers/LexRuby.cxx 30 | uninitMemberVar:scintilla/lexers/LexRuby.cxx 31 | variableScope:scintilla/lexers/LexSpecman.cxx 32 | unreadVariable:scintilla/lexers/LexSpice.cxx 33 | invalidscanf:scintilla/lexers/LexTCMD.cxx 34 | variableScope:scintilla/lexers/LexTeX.cxx 35 | variableScope:scintilla/lexers/LexVHDL.cxx 36 | 37 | // Suppress C-style pointer casting for Qt code as won't be changing 38 | cstyleCast:scintilla/qt/ScintillaEdit/ScintillaDocument.cpp 39 | 40 | // Suppress everything in catch.hpp as won't be changing 41 | *:scintilla/test/unit/catch.hpp 42 | -------------------------------------------------------------------------------- /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 *.pdb *.plg *.res *.sbr *.tds *.exp *.tlog >NUL: 2 | -------------------------------------------------------------------------------- /scintilla/delcvs.bat: -------------------------------------------------------------------------------- 1 | del /S /Q .cvsignore 2 | -------------------------------------------------------------------------------- /scintilla/doc/Icons.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | Scintilla icons 11 | 12 | 13 | 14 | 15 | 16 | 19 | 23 | 24 |
17 | Scintilla icon 18 | 20 | Scintilla 21 | and SciTE 22 |
25 |

26 | Icons 27 |

28 |

29 | These images may be used under the same license as Scintilla. 30 |

31 |

32 | Drawn by Iago Rubio, Philippe Lhoste, and Neil Hodgson. 33 |

34 |

35 | zip format (70K) 36 |

37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 |
For autocompletion listsFor margin markers
12x1216x1624x2432x32
55 | 56 | 57 | -------------------------------------------------------------------------------- /scintilla/doc/Indicators.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ttsping/foo_uie_wsh_panel_mod_plus/fafd9a0cdbed36a73009b3d9cf5ea58ed9be2d78/scintilla/doc/Indicators.png -------------------------------------------------------------------------------- /scintilla/doc/Markers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ttsping/foo_uie_wsh_panel_mod_plus/fafd9a0cdbed36a73009b3d9cf5ea58ed9be2d78/scintilla/doc/Markers.png -------------------------------------------------------------------------------- /scintilla/doc/SciBreak.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ttsping/foo_uie_wsh_panel_mod_plus/fafd9a0cdbed36a73009b3d9cf5ea58ed9be2d78/scintilla/doc/SciBreak.jpg -------------------------------------------------------------------------------- /scintilla/doc/SciRest.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ttsping/foo_uie_wsh_panel_mod_plus/fafd9a0cdbed36a73009b3d9cf5ea58ed9be2d78/scintilla/doc/SciRest.jpg -------------------------------------------------------------------------------- /scintilla/doc/SciTEIco.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ttsping/foo_uie_wsh_panel_mod_plus/fafd9a0cdbed36a73009b3d9cf5ea58ed9be2d78/scintilla/doc/SciTEIco.png -------------------------------------------------------------------------------- /scintilla/doc/SciWord.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ttsping/foo_uie_wsh_panel_mod_plus/fafd9a0cdbed36a73009b3d9cf5ea58ed9be2d78/scintilla/doc/SciWord.jpg -------------------------------------------------------------------------------- /scintilla/doc/annotations.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ttsping/foo_uie_wsh_panel_mod_plus/fafd9a0cdbed36a73009b3d9cf5ea58ed9be2d78/scintilla/doc/annotations.png -------------------------------------------------------------------------------- /scintilla/doc/styledmargin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ttsping/foo_uie_wsh_panel_mod_plus/fafd9a0cdbed36a73009b3d9cf5ea58ed9be2d78/scintilla/doc/styledmargin.png -------------------------------------------------------------------------------- /scintilla/gtk/scintilla-marshal.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef __scintilla_marshal_MARSHAL_H__ 3 | #define __scintilla_marshal_MARSHAL_H__ 4 | 5 | #include 6 | 7 | G_BEGIN_DECLS 8 | 9 | /* NONE:INT,POINTER (scintilla-marshal.list:1) */ 10 | extern void scintilla_marshal_VOID__INT_POINTER (GClosure *closure, 11 | GValue *return_value, 12 | guint n_param_values, 13 | const GValue *param_values, 14 | gpointer invocation_hint, 15 | gpointer marshal_data); 16 | #define scintilla_marshal_NONE__INT_POINTER scintilla_marshal_VOID__INT_POINTER 17 | 18 | G_END_DECLS 19 | 20 | #endif /* __scintilla_marshal_MARSHAL_H__ */ 21 | 22 | -------------------------------------------------------------------------------- /scintilla/gtk/scintilla-marshal.list: -------------------------------------------------------------------------------- 1 | NONE:INT,POINTER 2 | -------------------------------------------------------------------------------- /scintilla/include/.cvsignore: -------------------------------------------------------------------------------- 1 | .cvsignore 2 | *.pyc 3 | -------------------------------------------------------------------------------- /scintilla/include/ScintillaWidget.h: -------------------------------------------------------------------------------- 1 | /* Scintilla source code edit control */ 2 | /** @file ScintillaWidget.h 3 | ** Definition of Scintilla widget for GTK+. 4 | ** Only needed by GTK+ code but is harmless on other platforms. 5 | **/ 6 | /* Copyright 1998-2001 by Neil Hodgson 7 | * The License.txt file describes the conditions under which this software may be distributed. */ 8 | 9 | #ifndef SCINTILLAWIDGET_H 10 | #define SCINTILLAWIDGET_H 11 | 12 | #if defined(GTK) 13 | 14 | #ifdef __cplusplus 15 | extern "C" { 16 | #endif 17 | 18 | #define SCINTILLA(obj) G_TYPE_CHECK_INSTANCE_CAST (obj, scintilla_get_type (), ScintillaObject) 19 | #define SCINTILLA_CLASS(klass) G_TYPE_CHECK_CLASS_CAST (klass, scintilla_get_type (), ScintillaClass) 20 | #define IS_SCINTILLA(obj) G_TYPE_CHECK_INSTANCE_TYPE (obj, scintilla_get_type ()) 21 | 22 | typedef struct _ScintillaObject ScintillaObject; 23 | typedef struct _ScintillaClass ScintillaClass; 24 | 25 | struct _ScintillaObject { 26 | GtkContainer cont; 27 | void *pscin; 28 | }; 29 | 30 | struct _ScintillaClass { 31 | GtkContainerClass parent_class; 32 | 33 | void (* command) (ScintillaObject *ttt); 34 | void (* notify) (ScintillaObject *ttt); 35 | }; 36 | 37 | GType scintilla_get_type (void); 38 | GtkWidget* scintilla_new (void); 39 | void scintilla_set_id (ScintillaObject *sci, uptr_t id); 40 | sptr_t scintilla_send_message (ScintillaObject *sci,unsigned int iMessage, uptr_t wParam, sptr_t lParam); 41 | void scintilla_release_resources(void); 42 | 43 | #define SCINTILLA_NOTIFY "sci-notify" 44 | 45 | #ifdef __cplusplus 46 | } 47 | #endif 48 | 49 | #endif 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /scintilla/lexers_unused/LexCSS.cxx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ttsping/foo_uie_wsh_panel_mod_plus/fafd9a0cdbed36a73009b3d9cf5ea58ed9be2d78/scintilla/lexers_unused/LexCSS.cxx -------------------------------------------------------------------------------- /scintilla/lexers_unused/LexErlang.cxx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ttsping/foo_uie_wsh_panel_mod_plus/fafd9a0cdbed36a73009b3d9cf5ea58ed9be2d78/scintilla/lexers_unused/LexErlang.cxx -------------------------------------------------------------------------------- /scintilla/lexers_unused/LexMMIXAL.cxx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ttsping/foo_uie_wsh_panel_mod_plus/fafd9a0cdbed36a73009b3d9cf5ea58ed9be2d78/scintilla/lexers_unused/LexMMIXAL.cxx -------------------------------------------------------------------------------- /scintilla/lexers_unused/LexMatlab.cxx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ttsping/foo_uie_wsh_panel_mod_plus/fafd9a0cdbed36a73009b3d9cf5ea58ed9be2d78/scintilla/lexers_unused/LexMatlab.cxx -------------------------------------------------------------------------------- /scintilla/lexlib/Accessor.cxx: -------------------------------------------------------------------------------- 1 | // Scintilla source code edit control 2 | /** @file KeyWords.cxx 3 | ** Colourise for particular languages. 4 | **/ 5 | // Copyright 1998-2002 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 "PropSetSimple.h" 20 | #include "WordList.h" 21 | #include "LexAccessor.h" 22 | #include "Accessor.h" 23 | 24 | #ifdef SCI_NAMESPACE 25 | using namespace Scintilla; 26 | #endif 27 | 28 | Accessor::Accessor(IDocument *pAccess_, PropSetSimple *pprops_) : LexAccessor(pAccess_), pprops(pprops_) { 29 | } 30 | 31 | int Accessor::GetPropertyInt(const char *key, int defaultValue) const { 32 | return pprops->GetInt(key, defaultValue); 33 | } 34 | 35 | int Accessor::IndentAmount(int line, int *flags, PFNIsCommentLeader pfnIsCommentLeader) { 36 | int end = Length(); 37 | int spaceFlags = 0; 38 | 39 | // Determines the indentation level of the current line and also checks for consistent 40 | // indentation compared to the previous line. 41 | // Indentation is judged consistent when the indentation whitespace of each line lines 42 | // the same or the indentation of one line is a prefix of the other. 43 | 44 | int pos = LineStart(line); 45 | char ch = (*this)[pos]; 46 | int indent = 0; 47 | bool inPrevPrefix = line > 0; 48 | int posPrev = inPrevPrefix ? LineStart(line-1) : 0; 49 | while ((ch == ' ' || ch == '\t') && (pos < end)) { 50 | if (inPrevPrefix) { 51 | char chPrev = (*this)[posPrev++]; 52 | if (chPrev == ' ' || chPrev == '\t') { 53 | if (chPrev != ch) 54 | spaceFlags |= wsInconsistent; 55 | } else { 56 | inPrevPrefix = false; 57 | } 58 | } 59 | if (ch == ' ') { 60 | spaceFlags |= wsSpace; 61 | indent++; 62 | } else { // Tab 63 | spaceFlags |= wsTab; 64 | if (spaceFlags & wsSpace) 65 | spaceFlags |= wsSpaceTab; 66 | indent = (indent / 8 + 1) * 8; 67 | } 68 | ch = (*this)[++pos]; 69 | } 70 | 71 | *flags = spaceFlags; 72 | indent += SC_FOLDLEVELBASE; 73 | // if completely empty line or the start of a comment... 74 | if ((LineStart(line) == Length()) || (ch == ' ' || ch == '\t' || ch == '\n' || ch == '\r') || 75 | (pfnIsCommentLeader && (*pfnIsCommentLeader)(*this, pos, end-pos))) 76 | return indent | SC_FOLDLEVELWHITEFLAG; 77 | else 78 | return indent; 79 | } 80 | -------------------------------------------------------------------------------- /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 | #ifdef SCI_NAMESPACE 12 | namespace Scintilla { 13 | #endif 14 | 15 | enum { wsSpace=1, wsTab=2, wsSpaceTab=4, wsInconsistent=8 }; 16 | 17 | class Accessor; 18 | class WordList; 19 | class PropSetSimple; 20 | 21 | typedef bool (*PFNIsCommentLeader)(Accessor &styler, int pos, int len); 22 | 23 | class Accessor : public LexAccessor { 24 | public: 25 | PropSetSimple *pprops; 26 | Accessor(IDocument *pAccess_, PropSetSimple *pprops_); 27 | int GetPropertyInt(const char *, int defaultValue=0) const; 28 | int IndentAmount(int line, int *flags, PFNIsCommentLeader pfnIsCommentLeader = 0); 29 | }; 30 | 31 | #ifdef SCI_NAMESPACE 32 | } 33 | #endif 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /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 | #ifdef SCI_NAMESPACE 12 | namespace Scintilla { 13 | #endif 14 | 15 | enum CharacterCategory { 16 | ccLu, ccLl, ccLt, ccLm, ccLo, 17 | ccMn, ccMc, ccMe, 18 | ccNd, ccNl, ccNo, 19 | ccPc, ccPd, ccPs, ccPe, ccPi, ccPf, ccPo, 20 | ccSm, ccSc, ccSk, ccSo, 21 | ccZs, ccZl, ccZp, 22 | ccCc, ccCf, ccCs, ccCo, ccCn 23 | }; 24 | 25 | CharacterCategory CategoriseCharacter(int character); 26 | 27 | #ifdef SCI_NAMESPACE 28 | } 29 | #endif 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /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 | #include 12 | #include 13 | #include 14 | 15 | #include "CharacterSet.h" 16 | 17 | #ifdef SCI_NAMESPACE 18 | using namespace Scintilla; 19 | #endif 20 | 21 | #ifdef SCI_NAMESPACE 22 | namespace Scintilla { 23 | #endif 24 | 25 | int CompareCaseInsensitive(const char *a, const char *b) { 26 | while (*a && *b) { 27 | if (*a != *b) { 28 | char upperA = MakeUpperCase(*a); 29 | char upperB = MakeUpperCase(*b); 30 | if (upperA != upperB) 31 | return upperA - upperB; 32 | } 33 | a++; 34 | b++; 35 | } 36 | // Either *a or *b is nul 37 | return *a - *b; 38 | } 39 | 40 | int CompareNCaseInsensitive(const char *a, const char *b, size_t len) { 41 | while (*a && *b && len) { 42 | if (*a != *b) { 43 | char upperA = MakeUpperCase(*a); 44 | char upperB = MakeUpperCase(*b); 45 | if (upperA != upperB) 46 | return upperA - upperB; 47 | } 48 | a++; 49 | b++; 50 | len--; 51 | } 52 | if (len == 0) 53 | return 0; 54 | else 55 | // Either *a or *b is nul 56 | return *a - *b; 57 | } 58 | 59 | #ifdef SCI_NAMESPACE 60 | } 61 | #endif 62 | -------------------------------------------------------------------------------- /scintilla/lexlib/LexerBase.cxx: -------------------------------------------------------------------------------- 1 | // Scintilla source code edit control 2 | /** @file LexerBase.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 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | #include "ILexer.h" 16 | #include "Scintilla.h" 17 | #include "SciLexer.h" 18 | 19 | #include "PropSetSimple.h" 20 | #include "WordList.h" 21 | #include "LexAccessor.h" 22 | #include "Accessor.h" 23 | #include "LexerModule.h" 24 | #include "LexerBase.h" 25 | 26 | #ifdef SCI_NAMESPACE 27 | using namespace Scintilla; 28 | #endif 29 | 30 | LexerBase::LexerBase() { 31 | for (int wl = 0; wl < numWordLists; wl++) 32 | keyWordLists[wl] = new WordList; 33 | keyWordLists[numWordLists] = 0; 34 | } 35 | 36 | LexerBase::~LexerBase() { 37 | for (int wl = 0; wl < numWordLists; wl++) { 38 | delete keyWordLists[wl]; 39 | keyWordLists[wl] = 0; 40 | } 41 | keyWordLists[numWordLists] = 0; 42 | } 43 | 44 | void SCI_METHOD LexerBase::Release() { 45 | delete this; 46 | } 47 | 48 | int SCI_METHOD LexerBase::Version() const { 49 | return lvOriginal; 50 | } 51 | 52 | const char * SCI_METHOD LexerBase::PropertyNames() { 53 | return ""; 54 | } 55 | 56 | int SCI_METHOD LexerBase::PropertyType(const char *) { 57 | return SC_TYPE_BOOLEAN; 58 | } 59 | 60 | const char * SCI_METHOD LexerBase::DescribeProperty(const char *) { 61 | return ""; 62 | } 63 | 64 | int SCI_METHOD LexerBase::PropertySet(const char *key, const char *val) { 65 | const char *valOld = props.Get(key); 66 | if (strcmp(val, valOld) != 0) { 67 | props.Set(key, val); 68 | return 0; 69 | } else { 70 | return -1; 71 | } 72 | } 73 | 74 | const char * SCI_METHOD LexerBase::DescribeWordListSets() { 75 | return ""; 76 | } 77 | 78 | int SCI_METHOD LexerBase::WordListSet(int n, const char *wl) { 79 | if (n < numWordLists) { 80 | WordList wlNew; 81 | wlNew.Set(wl); 82 | if (*keyWordLists[n] != wlNew) { 83 | keyWordLists[n]->Set(wl); 84 | return 0; 85 | } 86 | } 87 | return -1; 88 | } 89 | 90 | void * SCI_METHOD LexerBase::PrivateCall(int, void *) { 91 | return 0; 92 | } 93 | -------------------------------------------------------------------------------- /scintilla/lexlib/LexerBase.h: -------------------------------------------------------------------------------- 1 | // Scintilla source code edit control 2 | /** @file LexerBase.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 LEXERBASE_H 9 | #define LEXERBASE_H 10 | 11 | #ifdef SCI_NAMESPACE 12 | namespace Scintilla { 13 | #endif 14 | 15 | // A simple lexer with no state 16 | class LexerBase : public ILexer { 17 | protected: 18 | PropSetSimple props; 19 | enum {numWordLists=KEYWORDSET_MAX+1}; 20 | WordList *keyWordLists[numWordLists+1]; 21 | public: 22 | LexerBase(); 23 | virtual ~LexerBase(); 24 | void SCI_METHOD Release(); 25 | int SCI_METHOD Version() const; 26 | const char * SCI_METHOD PropertyNames(); 27 | int SCI_METHOD PropertyType(const char *name); 28 | const char * SCI_METHOD DescribeProperty(const char *name); 29 | int SCI_METHOD PropertySet(const char *key, const char *val); 30 | const char * SCI_METHOD DescribeWordListSets(); 31 | int SCI_METHOD WordListSet(int n, const char *wl); 32 | void SCI_METHOD Lex(unsigned int startPos, int lengthDoc, int initStyle, IDocument *pAccess) = 0; 33 | void SCI_METHOD Fold(unsigned int startPos, int lengthDoc, int initStyle, IDocument *pAccess) = 0; 34 | void * SCI_METHOD PrivateCall(int operation, void *pointer); 35 | }; 36 | 37 | #ifdef SCI_NAMESPACE 38 | } 39 | #endif 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /scintilla/lexlib/LexerNoExceptions.cxx: -------------------------------------------------------------------------------- 1 | // Scintilla source code edit control 2 | /** @file LexerNoExceptions.cxx 3 | ** A simple lexer with no state which does not throw exceptions so can be used in an external lexer. 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 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | #include "ILexer.h" 16 | #include "Scintilla.h" 17 | #include "SciLexer.h" 18 | 19 | #include "PropSetSimple.h" 20 | #include "WordList.h" 21 | #include "LexAccessor.h" 22 | #include "Accessor.h" 23 | #include "LexerModule.h" 24 | #include "LexerBase.h" 25 | #include "LexerNoExceptions.h" 26 | 27 | #ifdef SCI_NAMESPACE 28 | using namespace Scintilla; 29 | #endif 30 | 31 | int SCI_METHOD LexerNoExceptions::PropertySet(const char *key, const char *val) { 32 | try { 33 | return LexerBase::PropertySet(key, val); 34 | } catch (...) { 35 | // Should not throw into caller as may be compiled with different compiler or options 36 | } 37 | return -1; 38 | } 39 | 40 | int SCI_METHOD LexerNoExceptions::WordListSet(int n, const char *wl) { 41 | try { 42 | return LexerBase::WordListSet(n, wl); 43 | } catch (...) { 44 | // Should not throw into caller as may be compiled with different compiler or options 45 | } 46 | return -1; 47 | } 48 | 49 | void SCI_METHOD LexerNoExceptions::Lex(unsigned int startPos, int length, int initStyle, IDocument *pAccess) { 50 | try { 51 | Accessor astyler(pAccess, &props); 52 | Lexer(startPos, length, initStyle, pAccess, astyler); 53 | astyler.Flush(); 54 | } catch (...) { 55 | // Should not throw into caller as may be compiled with different compiler or options 56 | pAccess->SetErrorStatus(SC_STATUS_FAILURE); 57 | } 58 | } 59 | void SCI_METHOD LexerNoExceptions::Fold(unsigned int startPos, int length, int initStyle, IDocument *pAccess) { 60 | try { 61 | Accessor astyler(pAccess, &props); 62 | Folder(startPos, length, initStyle, pAccess, astyler); 63 | astyler.Flush(); 64 | } catch (...) { 65 | // Should not throw into caller as may be compiled with different compiler or options 66 | pAccess->SetErrorStatus(SC_STATUS_FAILURE); 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /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 | #ifdef SCI_NAMESPACE 12 | namespace Scintilla { 13 | #endif 14 | 15 | // A simple lexer with no state 16 | class LexerNoExceptions : public LexerBase { 17 | public: 18 | // TODO Also need to prevent exceptions in constructor and destructor 19 | int SCI_METHOD PropertySet(const char *key, const char *val); 20 | int SCI_METHOD WordListSet(int n, const char *wl); 21 | void SCI_METHOD Lex(unsigned int startPos, int lengthDoc, int initStyle, IDocument *pAccess); 22 | void SCI_METHOD Fold(unsigned int startPos, int lengthDoc, int initStyle, IDocument *); 23 | 24 | virtual void Lexer(unsigned int startPos, int length, int initStyle, IDocument *pAccess, Accessor &styler) = 0; 25 | virtual void Folder(unsigned int startPos, int length, int initStyle, IDocument *pAccess, Accessor &styler) = 0; 26 | }; 27 | 28 | #ifdef SCI_NAMESPACE 29 | } 30 | #endif 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /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 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | #include 16 | 17 | #include "ILexer.h" 18 | #include "Scintilla.h" 19 | #include "SciLexer.h" 20 | 21 | #include "PropSetSimple.h" 22 | #include "WordList.h" 23 | #include "LexAccessor.h" 24 | #include "Accessor.h" 25 | #include "LexerModule.h" 26 | #include "LexerBase.h" 27 | #include "LexerSimple.h" 28 | 29 | #ifdef SCI_NAMESPACE 30 | using namespace Scintilla; 31 | #endif 32 | 33 | LexerSimple::LexerSimple(const LexerModule *module_) : module(module_) { 34 | for (int wl = 0; wl < module->GetNumWordLists(); wl++) { 35 | if (!wordLists.empty()) 36 | wordLists += "\n"; 37 | wordLists += module->GetWordListDescription(wl); 38 | } 39 | } 40 | 41 | const char * SCI_METHOD LexerSimple::DescribeWordListSets() { 42 | return wordLists.c_str(); 43 | } 44 | 45 | void SCI_METHOD LexerSimple::Lex(unsigned int startPos, int lengthDoc, int initStyle, IDocument *pAccess) { 46 | Accessor astyler(pAccess, &props); 47 | module->Lex(startPos, lengthDoc, initStyle, keyWordLists, astyler); 48 | astyler.Flush(); 49 | } 50 | 51 | void SCI_METHOD LexerSimple::Fold(unsigned int startPos, int lengthDoc, int initStyle, IDocument *pAccess) { 52 | if (props.GetInt("fold")) { 53 | Accessor astyler(pAccess, &props); 54 | module->Fold(startPos, lengthDoc, initStyle, keyWordLists, astyler); 55 | astyler.Flush(); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /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 | #ifdef SCI_NAMESPACE 12 | namespace Scintilla { 13 | #endif 14 | 15 | // A simple lexer with no state 16 | class LexerSimple : public LexerBase { 17 | const LexerModule *module; 18 | std::string wordLists; 19 | public: 20 | explicit LexerSimple(const LexerModule *module_); 21 | const char * SCI_METHOD DescribeWordListSets(); 22 | void SCI_METHOD Lex(unsigned int startPos, int lengthDoc, int initStyle, IDocument *pAccess); 23 | void SCI_METHOD Fold(unsigned int startPos, int lengthDoc, int initStyle, IDocument *pAccess); 24 | }; 25 | 26 | #ifdef SCI_NAMESPACE 27 | } 28 | #endif 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /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 | #ifdef SCI_NAMESPACE 12 | namespace Scintilla { 13 | #endif 14 | 15 | class PropSetSimple { 16 | void *impl; 17 | void Set(const char *keyVal); 18 | public: 19 | PropSetSimple(); 20 | virtual ~PropSetSimple(); 21 | void Set(const char *key, const char *val, int lenKey=-1, int lenVal=-1); 22 | void SetMultiple(const char *); 23 | const char *Get(const char *key) const; 24 | int GetExpanded(const char *key, char *result) const; 25 | int GetInt(const char *key, int defaultValue=0) const; 26 | }; 27 | 28 | #ifdef SCI_NAMESPACE 29 | } 30 | #endif 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /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 | #ifdef SCI_NAMESPACE 13 | namespace Scintilla { 14 | #endif 15 | 16 | // Safer version of string copy functions like strcpy, wcsncpy, etc. 17 | // Instantiate over fixed length strings of both char and wchar_t. 18 | // May truncate if source doesn't fit into dest with room for NUL. 19 | 20 | template 21 | void StringCopy(T (&dest)[count], const T* source) { 22 | for (size_t i=0; i 6 | // This file is in the public domain. 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | #include "ILexer.h" 15 | 16 | #include "LexAccessor.h" 17 | #include "Accessor.h" 18 | #include "StyleContext.h" 19 | 20 | #ifdef SCI_NAMESPACE 21 | using namespace Scintilla; 22 | #endif 23 | 24 | static void getRange(unsigned int start, 25 | unsigned int end, 26 | LexAccessor &styler, 27 | char *s, 28 | unsigned int len) { 29 | unsigned int i = 0; 30 | while ((i < end - start + 1) && (i < len-1)) { 31 | s[i] = styler[start + i]; 32 | i++; 33 | } 34 | s[i] = '\0'; 35 | } 36 | 37 | void StyleContext::GetCurrent(char *s, unsigned int len) { 38 | getRange(styler.GetStartSegment(), currentPos - 1, styler, s, len); 39 | } 40 | 41 | static void getRangeLowered(unsigned int start, 42 | unsigned int end, 43 | LexAccessor &styler, 44 | char *s, 45 | unsigned int len) { 46 | unsigned int i = 0; 47 | while ((i < end - start + 1) && (i < len-1)) { 48 | s[i] = static_cast(tolower(styler[start + i])); 49 | i++; 50 | } 51 | s[i] = '\0'; 52 | } 53 | 54 | void StyleContext::GetCurrentLowered(char *s, unsigned int len) { 55 | getRangeLowered(styler.GetStartSegment(), currentPos - 1, styler, s, len); 56 | } 57 | -------------------------------------------------------------------------------- /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 | #ifdef SCI_NAMESPACE 12 | namespace Scintilla { 13 | #endif 14 | 15 | /** 16 | */ 17 | class WordList { 18 | // Each word contains at least one character - a empty word acts as sentinel at the end. 19 | char **words; 20 | char *list; 21 | int len; 22 | bool onlyLineEnds; ///< Delimited by any white space or only line ends 23 | int starts[256]; 24 | public: 25 | explicit WordList(bool onlyLineEnds_ = false); 26 | ~WordList(); 27 | operator bool() const; 28 | bool operator!=(const WordList &other) const; 29 | int Length() const; 30 | void Clear(); 31 | void Set(const char *s); 32 | bool InList(const char *s) const; 33 | bool InListAbbreviated(const char *s, const char marker) const; 34 | const char *WordAt(int n) const; 35 | }; 36 | 37 | #ifdef SCI_NAMESPACE 38 | } 39 | #endif 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /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 | ScintillaEdit requires a generation command be run first. From the 26 | ScintillaEdit directory: 27 | 28 | python WidgetGen.py 29 | 30 | After the generation command has run, the ScintillaEdit.h and 31 | ScintillaEdit.cpp files will have been populated with the Scintilla API 32 | methods. 33 | To build, use Qt Creator or qmake and make as for ScintillaEditBase. 34 | 35 | ScintillaEditPy is more complex and instructions are found in 36 | ScintillaEditPy/README. 37 | -------------------------------------------------------------------------------- /scintilla/qt/ScintillaEdit/ScintillaEdit.h.template: -------------------------------------------------------------------------------- 1 | // ScintillaEdit.h 2 | // Extended version of ScintillaEditBase with a method for each API 3 | // Copyright (c) 2011 Archaeopteryx Software, Inc. d/b/a Wingware 4 | 5 | #ifndef SCINTILLAEDIT_H 6 | #define SCINTILLAEDIT_H 7 | 8 | #include 9 | 10 | #include "ScintillaEditBase.h" 11 | #include "ScintillaDocument.h" 12 | 13 | #ifdef SCI_NAMESPACE 14 | namespace Scintilla { 15 | #endif 16 | 17 | #ifndef EXPORT_IMPORT_API 18 | #ifdef WIN32 19 | #ifdef MAKING_LIBRARY 20 | #define EXPORT_IMPORT_API __declspec(dllexport) 21 | #else 22 | // Defining dllimport upsets moc 23 | #define EXPORT_IMPORT_API __declspec(dllimport) 24 | //#define EXPORT_IMPORT_API 25 | #endif 26 | #else 27 | #define EXPORT_IMPORT_API 28 | #endif 29 | #endif 30 | 31 | class EXPORT_IMPORT_API ScintillaEdit : public ScintillaEditBase { 32 | Q_OBJECT 33 | 34 | public: 35 | ScintillaEdit(QWidget *parent = 0); 36 | virtual ~ScintillaEdit(); 37 | 38 | QByteArray TextReturner(int message, uptr_t wParam) const; 39 | 40 | QPairfind_text(int flags, const char *text, int cpMin, int cpMax); 41 | QByteArray get_text_range(int start, int end); 42 | ScintillaDocument *get_doc(); 43 | void set_doc(ScintillaDocument *pdoc_); 44 | 45 | // Same as previous two methods but with Qt style names 46 | QPairfindText(int flags, const char *text, int cpMin, int cpMax) { 47 | return find_text(flags, text, cpMin, cpMax); 48 | } 49 | 50 | QByteArray textRange(int start, int end) { 51 | return get_text_range(start, end); 52 | } 53 | 54 | // Exposing the FORMATRANGE api with both underscore & qt style names 55 | long format_range(bool draw, QPaintDevice* target, QPaintDevice* measure, 56 | const QRect& print_rect, const QRect& page_rect, 57 | long range_start, long range_end); 58 | long formatRange(bool draw, QPaintDevice* target, QPaintDevice* measure, 59 | const QRect& print_rect, const QRect& page_rect, 60 | long range_start, long range_end) { 61 | return format_range(draw, target, measure, print_rect, page_rect, 62 | range_start, range_end); 63 | } 64 | 65 | /* ++Autogenerated -- start of section automatically generated from Scintilla.iface */ 66 | /* --Autogenerated -- end of section automatically generated from Scintilla.iface */ 67 | 68 | }; 69 | 70 | #ifdef SCI_NAMESPACE 71 | } 72 | #endif 73 | 74 | #endif /* SCINTILLAEDIT_H */ 75 | -------------------------------------------------------------------------------- /scintilla/qt/ScintillaEdit/ScintillaEdit.pro: -------------------------------------------------------------------------------- 1 | #------------------------------------------------- 2 | # 3 | # Project created by QtCreator 2011-05-05T12:41:23 4 | # 5 | #------------------------------------------------- 6 | 7 | QT += core gui 8 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 9 | 10 | TARGET = ScintillaEdit 11 | TEMPLATE = lib 12 | CONFIG += lib_bundle 13 | 14 | VERSION = 3.5.0 15 | 16 | SOURCES += \ 17 | ScintillaEdit.cpp \ 18 | ScintillaDocument.cpp \ 19 | ../ScintillaEditBase/PlatQt.cpp \ 20 | ../ScintillaEditBase/ScintillaQt.cpp \ 21 | ../ScintillaEditBase/ScintillaEditBase.cpp \ 22 | ../../src/XPM.cxx \ 23 | ../../src/ViewStyle.cxx \ 24 | ../../src/UniConversion.cxx \ 25 | ../../src/Style.cxx \ 26 | ../../src/Selection.cxx \ 27 | ../../src/ScintillaBase.cxx \ 28 | ../../src/RunStyles.cxx \ 29 | ../../src/RESearch.cxx \ 30 | ../../src/PositionCache.cxx \ 31 | ../../src/PerLine.cxx \ 32 | ../../src/MarginView.cxx \ 33 | ../../src/LineMarker.cxx \ 34 | ../../src/KeyMap.cxx \ 35 | ../../src/Indicator.cxx \ 36 | ../../src/ExternalLexer.cxx \ 37 | ../../src/EditView.cxx \ 38 | ../../src/Editor.cxx \ 39 | ../../src/EditModel.cxx \ 40 | ../../src/Document.cxx \ 41 | ../../src/Decoration.cxx \ 42 | ../../src/ContractionState.cxx \ 43 | ../../src/CharClassify.cxx \ 44 | ../../src/CellBuffer.cxx \ 45 | ../../src/Catalogue.cxx \ 46 | ../../src/CaseFolder.cxx \ 47 | ../../src/CaseConvert.cxx \ 48 | ../../src/CallTip.cxx \ 49 | ../../src/AutoComplete.cxx \ 50 | ../../lexlib/WordList.cxx \ 51 | ../../lexlib/StyleContext.cxx \ 52 | ../../lexlib/PropSetSimple.cxx \ 53 | ../../lexlib/LexerSimple.cxx \ 54 | ../../lexlib/LexerNoExceptions.cxx \ 55 | ../../lexlib/LexerModule.cxx \ 56 | ../../lexlib/LexerBase.cxx \ 57 | ../../lexlib/CharacterSet.cxx \ 58 | ../../lexlib/CharacterCategory.cxx \ 59 | ../../lexlib/Accessor.cxx \ 60 | ../../lexers/*.cxx 61 | 62 | HEADERS += \ 63 | ScintillaEdit.h \ 64 | ScintillaDocument.h \ 65 | ../ScintillaEditBase/ScintillaEditBase.h \ 66 | ../ScintillaEditBase/ScintillaQt.h 67 | 68 | OTHER_FILES += 69 | 70 | INCLUDEPATH += ../ScintillaEditBase ../../include ../../src ../../lexlib 71 | 72 | DEFINES += SCINTILLA_QT=1 MAKING_LIBRARY=1 SCI_LEXER=1 _CRT_SECURE_NO_DEPRECATE=1 73 | 74 | DESTDIR = ../../bin 75 | DLLDESTDIR = ../../bin 76 | 77 | macx { 78 | QMAKE_LFLAGS_SONAME = -Wl,-install_name,@executable_path/../Frameworks/ 79 | } 80 | -------------------------------------------------------------------------------- /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 | # Script to generate CharacterCategory.cxx from Python's Unicode data 2 | # Should be run rarely when a Python with a new version of Unicode data is available. 3 | # Requires Python 3.3 or later 4 | # Should not be run with old versions of Python. 5 | 6 | import codecs, os, platform, sys, unicodedata 7 | 8 | from FileGenerator import Regenerate 9 | 10 | def findCategories(filename): 11 | with codecs.open(filename, "r", "UTF-8") as infile: 12 | lines = [x.strip() for x in infile.readlines() if "\tcc" in x] 13 | values = "".join(lines).replace(" ","").split(",") 14 | print(values) 15 | return [v[2:] for v in values] 16 | 17 | def updateCharacterCategory(filename): 18 | values = ["// Created with Python %s, Unicode %s" % ( 19 | platform.python_version(), unicodedata.unidata_version)] 20 | category = unicodedata.category(chr(0)) 21 | startRange = 0 22 | for ch in range(sys.maxunicode): 23 | uch = chr(ch) 24 | if unicodedata.category(uch) != category: 25 | value = startRange * 32 + categories.index(category) 26 | values.append("%d," % value) 27 | category = unicodedata.category(uch) 28 | startRange = ch 29 | value = startRange * 32 + categories.index(category) 30 | values.append("%d," % value) 31 | 32 | Regenerate(filename, "//", values) 33 | 34 | categories = findCategories("../lexlib/CharacterCategory.h") 35 | 36 | updateCharacterCategory("../lexlib/CharacterCategory.cxx") 37 | -------------------------------------------------------------------------------- /scintilla/scripts/HFacer.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # HFacer.py - regenerate the Scintilla.h and SciLexer.h files from the Scintilla.iface interface 3 | # definition file. 4 | # Implemented 2000 by Neil Hodgson neilh@scintilla.org 5 | # Requires Python 2.5 or later 6 | 7 | import sys 8 | import os 9 | import Face 10 | 11 | from FileGenerator import UpdateFile, Generate, Regenerate, UpdateLineInFile, lineEnd 12 | 13 | def printLexHFile(f): 14 | out = [] 15 | for name in f.order: 16 | v = f.features[name] 17 | if v["FeatureType"] in ["val"]: 18 | if "SCE_" in name or "SCLEX_" in name: 19 | out.append("#define " + name + " " + v["Value"]) 20 | return out 21 | 22 | def printHFile(f): 23 | out = [] 24 | previousCategory = "" 25 | anyProvisional = False 26 | for name in f.order: 27 | v = f.features[name] 28 | if v["Category"] != "Deprecated": 29 | if v["Category"] == "Provisional" and previousCategory != "Provisional": 30 | out.append("#ifndef SCI_DISABLE_PROVISIONAL") 31 | anyProvisional = True 32 | previousCategory = v["Category"] 33 | if v["FeatureType"] in ["fun", "get", "set"]: 34 | featureDefineName = "SCI_" + name.upper() 35 | out.append("#define " + featureDefineName + " " + v["Value"]) 36 | elif v["FeatureType"] in ["evt"]: 37 | featureDefineName = "SCN_" + name.upper() 38 | out.append("#define " + featureDefineName + " " + v["Value"]) 39 | elif v["FeatureType"] in ["val"]: 40 | if not ("SCE_" in name or "SCLEX_" in name): 41 | out.append("#define " + name + " " + v["Value"]) 42 | if anyProvisional: 43 | out.append("#endif") 44 | return out 45 | 46 | def RegenerateAll(root, showMaxID): 47 | f = Face.Face() 48 | f.ReadFromFile(root + "include/Scintilla.iface") 49 | Regenerate(root + "include/Scintilla.h", "/* ", printHFile(f)) 50 | Regenerate(root + "include/SciLexer.h", "/* ", printLexHFile(f)) 51 | if showMaxID: 52 | valueSet = set(int(x) for x in f.values if int(x) < 3000) 53 | maximumID = max(valueSet) 54 | print("Maximum ID is %d" % maximumID) 55 | #~ valuesUnused = sorted(x for x in range(2001,maximumID) if x not in valueSet) 56 | #~ print("\nUnused values") 57 | #~ for v in valuesUnused: 58 | #~ print(v) 59 | 60 | if __name__ == "__main__": 61 | RegenerateAll("../", True) 62 | -------------------------------------------------------------------------------- /scintilla/scripts/LexGen.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # LexGen.py - implemented 2002 by Neil Hodgson neilh@scintilla.org 3 | # Released to the public domain. 4 | 5 | # Regenerate the Scintilla source files that list all the lexers. 6 | # Should be run whenever a new lexer is added or removed. 7 | # Requires Python 2.5 or later 8 | # Files are regenerated in place with templates stored in comments. 9 | # The format of generation comments is documented in FileGenerator.py. 10 | 11 | from FileGenerator import Regenerate, UpdateLineInFile, ReplaceREInFile 12 | import ScintillaData 13 | import HFacer 14 | 15 | def UpdateVersionNumbers(sci, root): 16 | UpdateLineInFile(root + "win32/ScintRes.rc", "#define VERSION_SCINTILLA", 17 | "#define VERSION_SCINTILLA \"" + sci.versionDotted + "\"") 18 | UpdateLineInFile(root + "win32/ScintRes.rc", "#define VERSION_WORDS", 19 | "#define VERSION_WORDS " + sci.versionCommad) 20 | UpdateLineInFile(root + "qt/ScintillaEditBase/ScintillaEditBase.pro", 21 | "VERSION =", 22 | "VERSION = " + sci.versionDotted) 23 | UpdateLineInFile(root + "qt/ScintillaEdit/ScintillaEdit.pro", 24 | "VERSION =", 25 | "VERSION = " + sci.versionDotted) 26 | UpdateLineInFile(root + "doc/ScintillaDownload.html", " Release", 27 | " Release " + sci.versionDotted) 28 | ReplaceREInFile(root + "doc/ScintillaDownload.html", 29 | r"/scintilla/([a-zA-Z]+)\d\d\d", 30 | r"/scintilla/\g<1>" + sci.version) 31 | UpdateLineInFile(root + "doc/index.html", 32 | ' Release version', 33 | ' Release version ' +\ 34 | sci.versionDotted + '
') 35 | UpdateLineInFile(root + "doc/index.html", 36 | ' Site last modified', 37 | ' Site last modified ' + sci.mdyModified + '
') 38 | UpdateLineInFile(root + "doc/ScintillaHistory.html", 39 | ' Released ', 40 | ' Released ' + sci.dmyModified + '.') 41 | 42 | def RegenerateAll(root): 43 | 44 | sci = ScintillaData.ScintillaData(root) 45 | 46 | Regenerate(root + "src/Catalogue.cxx", "//", sci.lexerModules) 47 | Regenerate(root + "win32/scintilla.mak", "#", sci.lexFiles) 48 | 49 | UpdateVersionNumbers(sci, root) 50 | 51 | HFacer.RegenerateAll(root, False) 52 | 53 | if __name__=="__main__": 54 | RegenerateAll("../") 55 | -------------------------------------------------------------------------------- /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 | #ifdef SCI_NAMESPACE 14 | namespace Scintilla { 15 | #endif 16 | 17 | enum CaseConversion { 18 | CaseConversionFold, 19 | CaseConversionUpper, 20 | CaseConversionLower 21 | }; 22 | 23 | class ICaseConverter { 24 | public: 25 | virtual size_t CaseConvertString(char *converted, size_t sizeConverted, const char *mixed, size_t lenMixed) = 0; 26 | }; 27 | 28 | ICaseConverter *ConverterFor(enum CaseConversion conversion); 29 | 30 | // Returns a UTF-8 string. Empty when no conversion 31 | const char *CaseConvert(int character, enum CaseConversion conversion); 32 | 33 | // When performing CaseConvertString, the converted value may be up to 3 times longer than the input. 34 | // Ligatures are often decomposed into multiple characters and long cases include: 35 | // ΐ "\xce\x90" folds to ΐ "\xce\xb9\xcc\x88\xcc\x81" 36 | const int maxExpansionCaseConversion=3; 37 | 38 | // Converts a mixed case string using a particular conversion. 39 | // Result may be a different length to input and the length is the return value. 40 | // If there is not enough space then 0 is returned. 41 | size_t CaseConvertString(char *converted, size_t sizeConverted, const char *mixed, size_t lenMixed, enum CaseConversion conversion); 42 | 43 | #ifdef SCI_NAMESPACE 44 | } 45 | #endif 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /scintilla/src/CaseFolder.cxx: -------------------------------------------------------------------------------- 1 | // Scintilla source code edit control 2 | /** @file CaseFolder.cxx 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 | #include 9 | #include 10 | 11 | #include "CaseFolder.h" 12 | #include "CaseConvert.h" 13 | #include "UniConversion.h" 14 | 15 | #ifdef SCI_NAMESPACE 16 | using namespace Scintilla; 17 | #endif 18 | 19 | CaseFolder::~CaseFolder() { 20 | } 21 | 22 | CaseFolderTable::CaseFolderTable() { 23 | for (size_t iChar=0; iChar(iChar); 25 | } 26 | } 27 | 28 | CaseFolderTable::~CaseFolderTable() { 29 | } 30 | 31 | size_t CaseFolderTable::Fold(char *folded, size_t sizeFolded, const char *mixed, size_t lenMixed) { 32 | if (lenMixed > sizeFolded) { 33 | return 0; 34 | } else { 35 | for (size_t i=0; i(mixed[i])]; 37 | } 38 | return lenMixed; 39 | } 40 | } 41 | 42 | void CaseFolderTable::SetTranslation(char ch, char chTranslation) { 43 | mapping[static_cast(ch)] = chTranslation; 44 | } 45 | 46 | void CaseFolderTable::StandardASCII() { 47 | for (size_t iChar=0; iChar= 'A' && iChar <= 'Z') { 49 | mapping[iChar] = static_cast(iChar - 'A' + 'a'); 50 | } else { 51 | mapping[iChar] = static_cast(iChar); 52 | } 53 | } 54 | } 55 | 56 | CaseFolderUnicode::CaseFolderUnicode() { 57 | StandardASCII(); 58 | converter = ConverterFor(CaseConversionFold); 59 | } 60 | 61 | size_t CaseFolderUnicode::Fold(char *folded, size_t sizeFolded, const char *mixed, size_t lenMixed) { 62 | if ((lenMixed == 1) && (sizeFolded > 0)) { 63 | folded[0] = mapping[static_cast(mixed[0])]; 64 | return 1; 65 | } else { 66 | return converter->CaseConvertString(folded, sizeFolded, mixed, lenMixed); 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /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 | #ifdef SCI_NAMESPACE 12 | namespace Scintilla { 13 | #endif 14 | 15 | class CaseFolder { 16 | public: 17 | virtual ~CaseFolder(); 18 | virtual size_t Fold(char *folded, size_t sizeFolded, const char *mixed, size_t lenMixed) = 0; 19 | }; 20 | 21 | class CaseFolderTable : public CaseFolder { 22 | protected: 23 | char mapping[256]; 24 | public: 25 | CaseFolderTable(); 26 | virtual ~CaseFolderTable(); 27 | virtual size_t Fold(char *folded, size_t sizeFolded, const char *mixed, size_t lenMixed); 28 | void SetTranslation(char ch, char chTranslation); 29 | void StandardASCII(); 30 | }; 31 | 32 | class ICaseConverter; 33 | 34 | class CaseFolderUnicode : public CaseFolderTable { 35 | ICaseConverter *converter; 36 | public: 37 | CaseFolderUnicode(); 38 | virtual size_t Fold(char *folded, size_t sizeFolded, const char *mixed, size_t lenMixed); 39 | }; 40 | 41 | #ifdef SCI_NAMESPACE 42 | } 43 | #endif 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /scintilla/src/Catalogue.cxx: -------------------------------------------------------------------------------- 1 | // Scintilla source code edit control 2 | /** @file Catalogue.cxx 3 | ** Colourise for particular languages. 4 | **/ 5 | // Copyright 1998-2002 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 16 | 17 | #include "ILexer.h" 18 | #include "Scintilla.h" 19 | #include "SciLexer.h" 20 | 21 | #include "LexerModule.h" 22 | #include "Catalogue.h" 23 | 24 | #ifdef SCI_NAMESPACE 25 | using namespace Scintilla; 26 | #endif 27 | 28 | static std::vector lexerCatalogue; 29 | static int nextLanguage = SCLEX_AUTOMATIC+1; 30 | 31 | const LexerModule *Catalogue::Find(int language) { 32 | Scintilla_LinkLexers(); 33 | for (std::vector::iterator it=lexerCatalogue.begin(); 34 | it != lexerCatalogue.end(); ++it) { 35 | if ((*it)->GetLanguage() == language) { 36 | return *it; 37 | } 38 | } 39 | return 0; 40 | } 41 | 42 | const LexerModule *Catalogue::Find(const char *languageName) { 43 | Scintilla_LinkLexers(); 44 | if (languageName) { 45 | for (std::vector::iterator it=lexerCatalogue.begin(); 46 | it != lexerCatalogue.end(); ++it) { 47 | if ((*it)->languageName && (0 == strcmp((*it)->languageName, languageName))) { 48 | return *it; 49 | } 50 | } 51 | } 52 | return 0; 53 | } 54 | 55 | void Catalogue::AddLexerModule(LexerModule *plm) { 56 | if (plm->GetLanguage() == SCLEX_AUTOMATIC) { 57 | plm->language = nextLanguage; 58 | nextLanguage++; 59 | } 60 | lexerCatalogue.push_back(plm); 61 | } 62 | 63 | // To add or remove a lexer, add or remove its file and run LexGen.py. 64 | 65 | // Force a reference to all of the Scintilla lexers so that the linker will 66 | // not remove the code of the lexers. 67 | int Scintilla_LinkLexers() { 68 | 69 | static int initialised = 0; 70 | if (initialised) 71 | return 0; 72 | initialised = 1; 73 | 74 | // Shorten the code that declares a lexer and ensures it is linked in by calling a method. 75 | #define LINK_LEXER(lexer) extern LexerModule lexer; Catalogue::AddLexerModule(&lexer); 76 | 77 | //++Autogenerated -- run scripts/LexGen.py to regenerate 78 | //**\(\tLINK_LEXER(\*);\n\) 79 | LINK_LEXER(lmCPP); 80 | LINK_LEXER(lmCPPNoCase); 81 | LINK_LEXER(lmVB); 82 | LINK_LEXER(lmVBScript); 83 | 84 | //--Autogenerated -- end of automatically generated section 85 | 86 | return 1; 87 | } 88 | -------------------------------------------------------------------------------- /scintilla/src/Catalogue.h: -------------------------------------------------------------------------------- 1 | // Scintilla source code edit control 2 | /** @file Catalogue.h 3 | ** Lexer infrastructure. 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 CATALOGUE_H 9 | #define CATALOGUE_H 10 | 11 | #ifdef SCI_NAMESPACE 12 | namespace Scintilla { 13 | #endif 14 | 15 | class Catalogue { 16 | public: 17 | static const LexerModule *Find(int language); 18 | static const LexerModule *Find(const char *languageName); 19 | static void AddLexerModule(LexerModule *plm); 20 | }; 21 | 22 | #ifdef SCI_NAMESPACE 23 | } 24 | #endif 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /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 "CharClassify.h" 12 | 13 | #ifdef SCI_NAMESPACE 14 | using namespace Scintilla; 15 | #endif 16 | 17 | CharClassify::CharClassify() { 18 | SetDefaultCharClasses(true); 19 | } 20 | 21 | void CharClassify::SetDefaultCharClasses(bool includeWordClass) { 22 | // Initialize all char classes to default values 23 | for (int ch = 0; ch < 256; ch++) { 24 | if (ch == '\r' || ch == '\n') 25 | charClass[ch] = ccNewLine; 26 | else if (ch < 0x20 || ch == ' ') 27 | charClass[ch] = ccSpace; 28 | else if (includeWordClass && (ch >= 0x80 || isalnum(ch) || ch == '_')) 29 | charClass[ch] = ccWord; 30 | else 31 | charClass[ch] = ccPunctuation; 32 | } 33 | } 34 | 35 | void CharClassify::SetCharClasses(const unsigned char *chars, cc newCharClass) { 36 | // Apply the newCharClass to the specifed chars 37 | if (chars) { 38 | while (*chars) { 39 | charClass[*chars] = static_cast(newCharClass); 40 | chars++; 41 | } 42 | } 43 | } 44 | 45 | int CharClassify::GetCharsOfClass(cc characterClass, unsigned char *buffer) { 46 | // Get characters belonging to the given char class; return the number 47 | // of characters (if the buffer is NULL, don't write to it). 48 | int count = 0; 49 | for (int ch = maxChar - 1; ch >= 0; --ch) { 50 | if (charClass[ch] == characterClass) { 51 | ++count; 52 | if (buffer) { 53 | *buffer = static_cast(ch); 54 | buffer++; 55 | } 56 | } 57 | } 58 | return count; 59 | } 60 | -------------------------------------------------------------------------------- /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 | #ifdef SCI_NAMESPACE 12 | namespace Scintilla { 13 | #endif 14 | 15 | class CharClassify { 16 | public: 17 | CharClassify(); 18 | 19 | enum cc { ccSpace, ccNewLine, ccWord, ccPunctuation }; 20 | void SetDefaultCharClasses(bool includeWordClass); 21 | void SetCharClasses(const unsigned char *chars, cc newCharClass); 22 | int GetCharsOfClass(cc charClass, unsigned char *buffer); 23 | cc GetClass(unsigned char ch) const { return static_cast(charClass[ch]);} 24 | bool IsWord(unsigned char ch) const { return static_cast(charClass[ch]) == ccWord;} 25 | 26 | private: 27 | enum { maxChar=256 }; 28 | unsigned char charClass[maxChar]; // not type cc to save space 29 | }; 30 | 31 | #ifdef SCI_NAMESPACE 32 | } 33 | #endif 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /scintilla/src/ContractionState.h: -------------------------------------------------------------------------------- 1 | // Scintilla source code edit control 2 | /** @file ContractionState.h 3 | ** Manages visibility of lines for folding and wrapping. 4 | **/ 5 | // Copyright 1998-2007 by Neil Hodgson 6 | // The License.txt file describes the conditions under which this software may be distributed. 7 | 8 | #ifndef CONTRACTIONSTATE_H 9 | #define CONTRACTIONSTATE_H 10 | 11 | #ifdef SCI_NAMESPACE 12 | namespace Scintilla { 13 | #endif 14 | 15 | /** 16 | */ 17 | class ContractionState { 18 | // These contain 1 element for every document line. 19 | RunStyles *visible; 20 | RunStyles *expanded; 21 | RunStyles *heights; 22 | Partitioning *displayLines; 23 | int linesInDocument; 24 | 25 | void EnsureData(); 26 | 27 | bool OneToOne() const { 28 | // True when each document line is exactly one display line so need for 29 | // complex data structures. 30 | return visible == 0; 31 | } 32 | 33 | public: 34 | ContractionState(); 35 | virtual ~ContractionState(); 36 | 37 | void Clear(); 38 | 39 | int LinesInDoc() const; 40 | int LinesDisplayed() const; 41 | int DisplayFromDoc(int lineDoc) const; 42 | int DisplayLastFromDoc(int lineDoc) const; 43 | int DocFromDisplay(int lineDisplay) const; 44 | 45 | void InsertLine(int lineDoc); 46 | void InsertLines(int lineDoc, int lineCount); 47 | void DeleteLine(int lineDoc); 48 | void DeleteLines(int lineDoc, int lineCount); 49 | 50 | bool GetVisible(int lineDoc) const; 51 | bool SetVisible(int lineDocStart, int lineDocEnd, bool isVisible); 52 | bool HiddenLines() const; 53 | 54 | bool GetExpanded(int lineDoc) const; 55 | bool SetExpanded(int lineDoc, bool isExpanded); 56 | int ContractedNext(int lineDocStart) const; 57 | 58 | int GetHeight(int lineDoc) const; 59 | bool SetHeight(int lineDoc, int height); 60 | 61 | void ShowAll(); 62 | void Check() const; 63 | }; 64 | 65 | #ifdef SCI_NAMESPACE 66 | } 67 | #endif 68 | 69 | #endif 70 | -------------------------------------------------------------------------------- /scintilla/src/Decoration.h: -------------------------------------------------------------------------------- 1 | /** @file Decoration.h 2 | ** Visual elements added over text. 3 | **/ 4 | // Copyright 1998-2007 by Neil Hodgson 5 | // The License.txt file describes the conditions under which this software may be distributed. 6 | 7 | #ifndef DECORATION_H 8 | #define DECORATION_H 9 | 10 | #ifdef SCI_NAMESPACE 11 | namespace Scintilla { 12 | #endif 13 | 14 | class Decoration { 15 | public: 16 | Decoration *next; 17 | RunStyles rs; 18 | int indicator; 19 | 20 | explicit Decoration(int indicator_); 21 | ~Decoration(); 22 | 23 | bool Empty() const; 24 | }; 25 | 26 | class DecorationList { 27 | int currentIndicator; 28 | int currentValue; 29 | Decoration *current; 30 | int lengthDocument; 31 | Decoration *DecorationFromIndicator(int indicator); 32 | Decoration *Create(int indicator, int length); 33 | void Delete(int indicator); 34 | void DeleteAnyEmpty(); 35 | public: 36 | Decoration *root; 37 | bool clickNotified; 38 | 39 | DecorationList(); 40 | ~DecorationList(); 41 | 42 | void SetCurrentIndicator(int indicator); 43 | int GetCurrentIndicator() const { return currentIndicator; } 44 | 45 | void SetCurrentValue(int value); 46 | int GetCurrentValue() const { return currentValue; } 47 | 48 | // Returns true if some values may have changed 49 | bool FillRange(int &position, int value, int &fillLength); 50 | 51 | void InsertSpace(int position, int insertLength); 52 | void DeleteRange(int position, int deleteLength); 53 | 54 | int AllOnFor(int position) const; 55 | int ValueAt(int indicator, int position); 56 | int Start(int indicator, int position); 57 | int End(int indicator, int position); 58 | }; 59 | 60 | #ifdef SCI_NAMESPACE 61 | } 62 | #endif 63 | 64 | #endif 65 | -------------------------------------------------------------------------------- /scintilla/src/EditModel.cxx: -------------------------------------------------------------------------------- 1 | // Scintilla source code edit control 2 | /** @file EditModel.cxx 3 | ** Defines the editor state that must be visible to EditorView. 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 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | 21 | #include "Platform.h" 22 | 23 | #include "ILexer.h" 24 | #include "Scintilla.h" 25 | 26 | #include "StringCopy.h" 27 | #include "SplitVector.h" 28 | #include "Partitioning.h" 29 | #include "RunStyles.h" 30 | #include "ContractionState.h" 31 | #include "CellBuffer.h" 32 | #include "KeyMap.h" 33 | #include "Indicator.h" 34 | #include "XPM.h" 35 | #include "LineMarker.h" 36 | #include "Style.h" 37 | #include "ViewStyle.h" 38 | #include "CharClassify.h" 39 | #include "Decoration.h" 40 | #include "CaseFolder.h" 41 | #include "Document.h" 42 | #include "UniConversion.h" 43 | #include "Selection.h" 44 | #include "PositionCache.h" 45 | #include "EditModel.h" 46 | 47 | #ifdef SCI_NAMESPACE 48 | using namespace Scintilla; 49 | #endif 50 | 51 | Caret::Caret() : 52 | active(false), on(false), period(500) {} 53 | 54 | EditModel::EditModel() { 55 | inOverstrike = false; 56 | xOffset = 0; 57 | trackLineWidth = false; 58 | posDrag = SelectionPosition(invalidPosition); 59 | braces[0] = invalidPosition; 60 | braces[1] = invalidPosition; 61 | bracesMatchStyle = STYLE_BRACEBAD; 62 | highlightGuideColumn = 0; 63 | primarySelection = true; 64 | foldFlags = 0; 65 | hotspot = Range(invalidPosition); 66 | wrapWidth = LineLayout::wrapWidthInfinite; 67 | pdoc = new Document(); 68 | pdoc->AddRef(); 69 | } 70 | 71 | EditModel::~EditModel() { 72 | pdoc->Release(); 73 | pdoc = 0; 74 | } 75 | -------------------------------------------------------------------------------- /scintilla/src/EditModel.h: -------------------------------------------------------------------------------- 1 | // Scintilla source code edit control 2 | /** @file EditModel.h 3 | ** Defines the editor state that must be visible to EditorView. 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 EDITMODEL_H 9 | #define EDITMODEL_H 10 | 11 | #ifdef SCI_NAMESPACE 12 | namespace Scintilla { 13 | #endif 14 | 15 | /** 16 | */ 17 | class Caret { 18 | public: 19 | bool active; 20 | bool on; 21 | int period; 22 | 23 | Caret(); 24 | }; 25 | 26 | class EditModel { 27 | // Private so EditModel objects can not be copied 28 | EditModel(const EditModel &); 29 | EditModel &operator=(const EditModel &); 30 | 31 | public: 32 | bool inOverstrike; 33 | int xOffset; ///< Horizontal scrolled amount in pixels 34 | bool trackLineWidth; 35 | 36 | SpecialRepresentations reprs; 37 | Caret caret; 38 | SelectionPosition posDrag; 39 | Position braces[2]; 40 | int bracesMatchStyle; 41 | int highlightGuideColumn; 42 | Selection sel; 43 | bool primarySelection; 44 | 45 | int foldFlags; 46 | ContractionState cs; 47 | // Hotspot support 48 | Range hotspot; 49 | 50 | // Wrapping support 51 | int wrapWidth; 52 | 53 | Document *pdoc; 54 | 55 | EditModel(); 56 | virtual ~EditModel(); 57 | virtual int TopLineOfMain() const = 0; 58 | virtual Point GetVisibleOriginInMain() const = 0; 59 | virtual int LinesOnScreen() const = 0; 60 | virtual Range GetHotSpotRange() const = 0; 61 | }; 62 | 63 | #ifdef SCI_NAMESPACE 64 | } 65 | #endif 66 | 67 | #endif 68 | -------------------------------------------------------------------------------- /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 | #ifdef SCI_NAMESPACE 13 | namespace Scintilla { 14 | #endif 15 | 16 | // These definitions match Scintilla.h 17 | #define SC_EFF_QUALITY_MASK 0xF 18 | #define SC_EFF_QUALITY_DEFAULT 0 19 | #define SC_EFF_QUALITY_NON_ANTIALIASED 1 20 | #define SC_EFF_QUALITY_ANTIALIASED 2 21 | #define SC_EFF_QUALITY_LCD_OPTIMIZED 3 22 | 23 | // These definitions must match SC_TECHNOLOGY_* in Scintilla.h 24 | #define SCWIN_TECH_GDI 0 25 | #define SCWIN_TECH_DIRECTWRITE 1 26 | 27 | #ifdef SCI_NAMESPACE 28 | } 29 | #endif 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /scintilla/src/Indicator.h: -------------------------------------------------------------------------------- 1 | // Scintilla source code edit control 2 | /** @file Indicator.h 3 | ** Defines the style of indicators which are text decorations such as underlining. 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 INDICATOR_H 9 | #define INDICATOR_H 10 | 11 | #ifdef SCI_NAMESPACE 12 | namespace Scintilla { 13 | #endif 14 | 15 | /** 16 | */ 17 | class Indicator { 18 | public: 19 | int style; 20 | bool under; 21 | ColourDesired fore; 22 | int fillAlpha; 23 | int outlineAlpha; 24 | Indicator() : style(INDIC_PLAIN), under(false), fore(ColourDesired(0,0,0)), fillAlpha(30), outlineAlpha(50) { 25 | } 26 | void Draw(Surface *surface, const PRectangle &rc, const PRectangle &rcLine) const; 27 | }; 28 | 29 | #ifdef SCI_NAMESPACE 30 | } 31 | #endif 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /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 | #ifdef SCI_NAMESPACE 12 | namespace Scintilla { 13 | #endif 14 | 15 | #define SCI_NORM 0 16 | #define SCI_SHIFT SCMOD_SHIFT 17 | #define SCI_CTRL SCMOD_CTRL 18 | #define SCI_ALT SCMOD_ALT 19 | #define SCI_META SCMOD_META 20 | #define SCI_CSHIFT (SCI_CTRL | SCI_SHIFT) 21 | #define SCI_ASHIFT (SCI_ALT | SCI_SHIFT) 22 | 23 | /** 24 | */ 25 | class KeyModifiers { 26 | public: 27 | int key; 28 | int modifiers; 29 | KeyModifiers(int key_, int modifiers_) : key(key_), modifiers(modifiers_) { 30 | } 31 | bool operator<(const KeyModifiers &other) const { 32 | if (key == other.key) 33 | return modifiers < other.modifiers; 34 | else 35 | return key < other.key; 36 | } 37 | }; 38 | 39 | /** 40 | */ 41 | class KeyToCommand { 42 | public: 43 | int key; 44 | int modifiers; 45 | unsigned int msg; 46 | }; 47 | 48 | /** 49 | */ 50 | class KeyMap { 51 | std::map kmap; 52 | static const KeyToCommand MapDefault[]; 53 | 54 | public: 55 | KeyMap(); 56 | ~KeyMap(); 57 | void Clear(); 58 | void AssignCmdKey(int key, int modifiers, unsigned int msg); 59 | unsigned int Find(int key, int modifiers) const; // 0 returned on failure 60 | }; 61 | 62 | #ifdef SCI_NAMESPACE 63 | } 64 | #endif 65 | 66 | #endif 67 | -------------------------------------------------------------------------------- /scintilla/src/LineMarker.h: -------------------------------------------------------------------------------- 1 | // Scintilla source code edit control 2 | /** @file LineMarker.h 3 | ** Defines the look of a line marker in the margin . 4 | **/ 5 | // Copyright 1998-2011 by Neil Hodgson 6 | // The License.txt file describes the conditions under which this software may be distributed. 7 | 8 | #ifndef LINEMARKER_H 9 | #define LINEMARKER_H 10 | 11 | #ifdef SCI_NAMESPACE 12 | namespace Scintilla { 13 | #endif 14 | 15 | /** 16 | */ 17 | class LineMarker { 18 | public: 19 | enum typeOfFold { undefined, head, body, tail, headWithTail }; 20 | 21 | int markType; 22 | ColourDesired fore; 23 | ColourDesired back; 24 | ColourDesired backSelected; 25 | int alpha; 26 | XPM *pxpm; 27 | RGBAImage *image; 28 | LineMarker() { 29 | markType = SC_MARK_CIRCLE; 30 | fore = ColourDesired(0,0,0); 31 | back = ColourDesired(0xff,0xff,0xff); 32 | backSelected = ColourDesired(0xff,0x00,0x00); 33 | alpha = SC_ALPHA_NOALPHA; 34 | pxpm = NULL; 35 | image = NULL; 36 | } 37 | LineMarker(const LineMarker &) { 38 | // Defined to avoid pxpm being blindly copied, not as a complete copy constructor 39 | markType = SC_MARK_CIRCLE; 40 | fore = ColourDesired(0,0,0); 41 | back = ColourDesired(0xff,0xff,0xff); 42 | backSelected = ColourDesired(0xff,0x00,0x00); 43 | alpha = SC_ALPHA_NOALPHA; 44 | pxpm = NULL; 45 | image = NULL; 46 | } 47 | ~LineMarker() { 48 | delete pxpm; 49 | delete image; 50 | } 51 | LineMarker &operator=(const LineMarker &other) { 52 | // Defined to avoid pxpm being blindly copied, not as a complete assignment operator 53 | if (this != &other) { 54 | markType = SC_MARK_CIRCLE; 55 | fore = ColourDesired(0,0,0); 56 | back = ColourDesired(0xff,0xff,0xff); 57 | backSelected = ColourDesired(0xff,0x00,0x00); 58 | alpha = SC_ALPHA_NOALPHA; 59 | delete pxpm; 60 | pxpm = NULL; 61 | delete image; 62 | image = NULL; 63 | } 64 | return *this; 65 | } 66 | void SetXPM(const char *textForm); 67 | void SetXPM(const char *const *linesForm); 68 | void SetRGBAImage(Point sizeRGBAImage, float scale, const unsigned char *pixelsRGBAImage); 69 | void Draw(Surface *surface, PRectangle &rc, Font &fontForCharacter, typeOfFold tFold, int marginStyle) const; 70 | }; 71 | 72 | #ifdef SCI_NAMESPACE 73 | } 74 | #endif 75 | 76 | #endif 77 | -------------------------------------------------------------------------------- /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 | #ifdef SCI_NAMESPACE 12 | namespace Scintilla { 13 | #endif 14 | 15 | void DrawWrapMarker(Surface *surface, PRectangle rcPlace, bool isEndMarker, ColourDesired wrapColour); 16 | 17 | /** 18 | * MarginView draws the margins. 19 | */ 20 | class MarginView { 21 | public: 22 | Surface *pixmapSelMargin; 23 | Surface *pixmapSelPattern; 24 | Surface *pixmapSelPatternOffset1; 25 | // Highlight current folding block 26 | HighlightDelimiter highlightDelimiter; 27 | 28 | MarginView(); 29 | 30 | void DropGraphics(bool freeObjects); 31 | void AllocateGraphics(const ViewStyle &vsDraw); 32 | void RefreshPixMaps(Surface *surfaceWindow, WindowID wid, const ViewStyle &vsDraw); 33 | void PaintMargin(Surface *surface, int topLine, PRectangle rc, PRectangle rcMargin, 34 | const EditModel &model, const ViewStyle &vs); 35 | }; 36 | 37 | #ifdef SCI_NAMESPACE 38 | } 39 | #endif 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /scintilla/src/RESearch.h: -------------------------------------------------------------------------------- 1 | // Scintilla source code edit control 2 | /** @file RESearch.h 3 | ** Interface to the regular expression search library. 4 | **/ 5 | // Written by Neil Hodgson 6 | // Based on the work of Ozan S. Yigit. 7 | // This file is in the public domain. 8 | 9 | #ifndef RESEARCH_H 10 | #define RESEARCH_H 11 | 12 | #ifdef SCI_NAMESPACE 13 | namespace Scintilla { 14 | #endif 15 | 16 | /* 17 | * The following defines are not meant to be changeable. 18 | * They are for readability only. 19 | */ 20 | #define MAXCHR 256 21 | #define CHRBIT 8 22 | #define BITBLK MAXCHR/CHRBIT 23 | 24 | class CharacterIndexer { 25 | public: 26 | virtual char CharAt(int index)=0; 27 | virtual ~CharacterIndexer() { 28 | } 29 | }; 30 | 31 | class RESearch { 32 | 33 | public: 34 | explicit RESearch(CharClassify *charClassTable); 35 | ~RESearch(); 36 | void GrabMatches(CharacterIndexer &ci); 37 | const char *Compile(const char *pattern, int length, bool caseSensitive, bool posix); 38 | int Execute(CharacterIndexer &ci, int lp, int endp); 39 | 40 | enum { MAXTAG=10 }; 41 | enum { MAXNFA=2048 }; 42 | enum { NOTFOUND=-1 }; 43 | 44 | int bopat[MAXTAG]; 45 | int eopat[MAXTAG]; 46 | std::string pat[MAXTAG]; 47 | 48 | private: 49 | void Clear(); 50 | void ChSet(unsigned char c); 51 | void ChSetWithCase(unsigned char c, bool caseSensitive); 52 | int GetBackslashExpression(const char *pattern, int &incr); 53 | 54 | int PMatch(CharacterIndexer &ci, int lp, int endp, char *ap); 55 | 56 | int bol; 57 | int tagstk[MAXTAG]; /* subpat tag stack */ 58 | char nfa[MAXNFA]; /* automaton */ 59 | int sta; 60 | unsigned char bittab[BITBLK]; /* bit table for CCL pre-set bits */ 61 | int failure; 62 | CharClassify *charClass; 63 | bool iswordc(unsigned char x) const { 64 | return charClass->IsWord(x); 65 | } 66 | }; 67 | 68 | #ifdef SCI_NAMESPACE 69 | } 70 | #endif 71 | 72 | #endif 73 | 74 | -------------------------------------------------------------------------------- /scintilla/src/RunStyles.h: -------------------------------------------------------------------------------- 1 | /** @file RunStyles.h 2 | ** Data structure used to store sparse styles. 3 | **/ 4 | // Copyright 1998-2007 by Neil Hodgson 5 | // The License.txt file describes the conditions under which this software may be distributed. 6 | 7 | /// Styling buffer using one element for each run rather than using 8 | /// a filled buffer. 9 | 10 | #ifndef RUNSTYLES_H 11 | #define RUNSTYLES_H 12 | 13 | #ifdef SCI_NAMESPACE 14 | namespace Scintilla { 15 | #endif 16 | 17 | class RunStyles { 18 | private: 19 | Partitioning *starts; 20 | SplitVector *styles; 21 | int RunFromPosition(int position) const; 22 | int SplitRun(int position); 23 | void RemoveRun(int run); 24 | void RemoveRunIfEmpty(int run); 25 | void RemoveRunIfSameAsPrevious(int run); 26 | // Private so RunStyles objects can not be copied 27 | RunStyles(const RunStyles &); 28 | public: 29 | RunStyles(); 30 | ~RunStyles(); 31 | int Length() const; 32 | int ValueAt(int position) const; 33 | int FindNextChange(int position, int end) const; 34 | int StartRun(int position) const; 35 | int EndRun(int position) const; 36 | // Returns true if some values may have changed 37 | bool FillRange(int &position, int value, int &fillLength); 38 | void SetValueAt(int position, int value); 39 | void InsertSpace(int position, int insertLength); 40 | void DeleteAll(); 41 | void DeleteRange(int position, int deleteLength); 42 | int Runs() const; 43 | bool AllSame() const; 44 | bool AllSameAs(int value) const; 45 | int Find(int value, int start) const; 46 | 47 | void Check() const; 48 | }; 49 | 50 | #ifdef SCI_NAMESPACE 51 | } 52 | #endif 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /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/UniConversion.h: -------------------------------------------------------------------------------- 1 | // Scintilla source code edit control 2 | /** @file UniConversion.h 3 | ** Functions to handle UTF-8 and UTF-16 strings. 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 UNICONVERSION_H 9 | #define UNICONVERSION_H 10 | 11 | #ifdef SCI_NAMESPACE 12 | namespace Scintilla { 13 | #endif 14 | 15 | const int UTF8MaxBytes = 4; 16 | 17 | unsigned int UTF8Length(const wchar_t *uptr, unsigned int tlen); 18 | void UTF8FromUTF16(const wchar_t *uptr, unsigned int tlen, char *putf, unsigned int len); 19 | unsigned int UTF8CharLength(unsigned char ch); 20 | unsigned int UTF16Length(const char *s, unsigned int len); 21 | unsigned int UTF16FromUTF8(const char *s, unsigned int len, wchar_t *tbuf, unsigned int tlen); 22 | 23 | extern int UTF8BytesOfLead[256]; 24 | void UTF8BytesOfLeadInitialise(); 25 | 26 | inline bool UTF8IsTrailByte(int ch) { 27 | return (ch >= 0x80) && (ch < 0xc0); 28 | } 29 | 30 | inline bool UTF8IsAscii(int ch) { 31 | return ch < 0x80; 32 | } 33 | 34 | enum { UTF8MaskWidth=0x7, UTF8MaskInvalid=0x8 }; 35 | int UTF8Classify(const unsigned char *us, int len); 36 | 37 | // Similar to UTF8Classify but returns a length of 1 for invalid bytes 38 | // instead of setting the invalid flag 39 | int UTF8DrawBytes(const unsigned char *us, int len); 40 | 41 | // Line separator is U+2028 \xe2\x80\xa8 42 | // Paragraph separator is U+2029 \xe2\x80\xa9 43 | const int UTF8SeparatorLength = 3; 44 | inline bool UTF8IsSeparator(const unsigned char *us) { 45 | return (us[0] == 0xe2) && (us[1] == 0x80) && ((us[2] == 0xa8) || (us[2] == 0xa9)); 46 | } 47 | 48 | // NEL is U+0085 \xc2\x85 49 | const int UTF8NELLength = 2; 50 | inline bool UTF8IsNEL(const unsigned char *us) { 51 | return (us[0] == 0xc2) && (us[1] == 0x85); 52 | } 53 | 54 | #ifdef SCI_NAMESPACE 55 | } 56 | #endif 57 | 58 | #endif 59 | -------------------------------------------------------------------------------- /scintilla/src/UnicodeFromUTF8.h: -------------------------------------------------------------------------------- 1 | // Scintilla source code edit control 2 | /** @file UnicodeFromUTF8.h 3 | ** Lexer infrastructure. 4 | **/ 5 | // Copyright 2013 by Neil Hodgson 6 | // This file is in the public domain. 7 | 8 | #ifndef UNICODEFROMUTF8_H 9 | #define UNICODEFROMUTF8_H 10 | 11 | #ifdef SCI_NAMESPACE 12 | namespace Scintilla { 13 | #endif 14 | 15 | inline int UnicodeFromUTF8(const unsigned char *us) { 16 | if (us[0] < 0xC2) { 17 | return us[0]; 18 | } else if (us[0] < 0xE0) { 19 | return ((us[0] & 0x1F) << 6) + (us[1] & 0x3F); 20 | } else if (us[0] < 0xF0) { 21 | return ((us[0] & 0xF) << 12) + ((us[1] & 0x3F) << 6) + (us[2] & 0x3F); 22 | } else if (us[0] < 0xF5) { 23 | return ((us[0] & 0x7) << 18) + ((us[1] & 0x3F) << 12) + ((us[2] & 0x3F) << 6) + (us[3] & 0x3F); 24 | } 25 | return us[0]; 26 | } 27 | 28 | #ifdef SCI_NAMESPACE 29 | } 30 | #endif 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /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_IME_SETCONTEXT":0x0281, 18 | "WM_IME_NOTIFY":0x0282, 19 | "WM_KEYDOWN":256, 20 | "WM_KEYUP":257, 21 | "WM_KILLFOCUS":8, 22 | "WM_LBUTTONDOWN":513, 23 | "WM_LBUTTONUP":514, 24 | "WM_MBUTTONDOWN":519, 25 | "WM_MBUTTONUP":520, 26 | "WM_MBUTTONDBLCLK":521, 27 | "WM_MOUSEACTIVATE":33, 28 | "WM_MOUSEMOVE":512, 29 | "WM_MOVE":3, 30 | "WM_MOVING":534, 31 | "WM_NCACTIVATE":134, 32 | "WM_NCCALCSIZE":131, 33 | "WM_NCCREATE":129, 34 | "WM_NCDESTROY":130, 35 | "WM_NCHITTEST":132, 36 | "WM_NCLBUTTONDBLCLK":163, 37 | "WM_NCLBUTTONDOWN":161, 38 | "WM_NCLBUTTONUP":162, 39 | "WM_NCMOUSEMOVE":160, 40 | "WM_NCPAINT":133, 41 | "WM_PAINT":15, 42 | "WM_PARENTNOTIFY":528, 43 | "WM_SETCURSOR":32, 44 | "WM_SETFOCUS":7, 45 | "WM_SETFONT":48, 46 | "WM_SETTEXT":12, 47 | "WM_SHOWWINDOW":24, 48 | "WM_SIZE":5, 49 | "WM_SIZING":532, 50 | "WM_SYNCPAINT":136, 51 | "WM_SYSCOMMAND":274, 52 | "WM_SYSKEYDOWN":260, 53 | "WM_TIMER":275, 54 | "WM_USER":1024, 55 | "WM_USER+1":1025, 56 | "WM_WINDOWPOSCHANGED":71, 57 | "WM_WINDOWPOSCHANGING":70, 58 | } 59 | 60 | sgsm={} 61 | for k,v in msgs.items(): 62 | sgsm[v] = k 63 | 64 | -------------------------------------------------------------------------------- /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 | # -*- coding: utf-8 -*- 2 | # Requires Python 2.7 or later 3 | 4 | import ctypes, os, sys, unittest 5 | 6 | from PySide.QtCore import * 7 | from PySide.QtGui import * 8 | 9 | import ScintillaCallable 10 | 11 | sys.path.append("..") 12 | from bin import ScintillaEditPy 13 | 14 | scintillaDirectory = ".." 15 | scintillaIncludeDirectory = os.path.join(scintillaDirectory, "include") 16 | scintillaScriptsDirectory = os.path.join(scintillaDirectory, "scripts") 17 | sys.path.append(scintillaScriptsDirectory) 18 | import Face 19 | 20 | class Form(QDialog): 21 | 22 | def __init__(self, parent=None): 23 | super(Form, self).__init__(parent) 24 | self.resize(460,300) 25 | # Create widget 26 | self.edit = ScintillaEditPy.ScintillaEdit(self) 27 | 28 | class XiteWin(): 29 | def __init__(self, test=""): 30 | self.face = Face.Face() 31 | self.face.ReadFromFile(os.path.join(scintillaIncludeDirectory, "Scintilla.iface")) 32 | 33 | self.test = test 34 | 35 | self.form = Form() 36 | 37 | scifn = self.form.edit.send(int(self.face.features["GetDirectFunction"]["Value"]), 0, 0) 38 | sciptr = ctypes.c_char_p(self.form.edit.send( 39 | int(self.face.features["GetDirectPointer"]["Value"]), 0,0)) 40 | 41 | self.ed = ScintillaCallable.ScintillaCallable(self.face, scifn, sciptr) 42 | self.form.show() 43 | 44 | def DoStuff(self): 45 | print(self.test) 46 | self.CmdTest() 47 | 48 | def DoEvents(self): 49 | QApplication.processEvents() 50 | 51 | def CmdTest(self): 52 | runner = unittest.TextTestRunner() 53 | tests = unittest.defaultTestLoader.loadTestsFromName(self.test) 54 | results = runner.run(tests) 55 | print(results) 56 | sys.exit(0) 57 | 58 | xiteFrame = None 59 | 60 | def main(test): 61 | global xiteFrame 62 | app = QApplication(sys.argv) 63 | xiteFrame = XiteWin(test) 64 | xiteFrame.DoStuff() 65 | sys.exit(app.exec_()) 66 | -------------------------------------------------------------------------------- /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}{40} 3 | {46}var{41} {46}b{41} {50}={41} {52}/abc/i{46}.test{50}({49}'abc'{50});{41} 4 | {49}'x\ 5 | '{41} 6 | {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.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.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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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/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/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 3.3 and g++ 4.8 7 | 8 | ifndef windir 9 | ifeq ($(shell uname),Darwin) 10 | # On OS X always use clang as g++ is old version 11 | CLANG = 1 12 | USELIBCPP = 1 13 | endif 14 | endif 15 | 16 | CXXFLAGS += --std=c++11 17 | 18 | ifdef CLANG 19 | CXX = clang++ 20 | ifdef USELIBCPP 21 | # OS X, use libc++ but don't have sanitizers 22 | CXXFLAGS += --stdlib=libc++ 23 | LINKFLAGS = -lc++ 24 | else 25 | # Linux, have sanitizers 26 | SANITIZE = -fsanitize=address,undefined 27 | CXXFLAGS += $(SANITIZE) 28 | endif 29 | else 30 | CXX = g++ 31 | endif 32 | 33 | ifdef windir 34 | DEL = del /q 35 | EXE = unitTest.exe 36 | else 37 | DEL = rm -f 38 | EXE = unitTest 39 | endif 40 | 41 | INCLUDEDIRS = -I ../../include -I ../../src -I../../lexlib 42 | 43 | CPPFLAGS += $(INCLUDEDIRS) 44 | CXXFLAGS += -Wall -Wextra 45 | 46 | # Files in this directory containing tests 47 | TESTSRC=test*.cxx 48 | # Files being tested from scintilla/src directory 49 | TESTEDSRC=\ 50 | ../../src/CellBuffer.cxx \ 51 | ../../src/CharClassify.cxx \ 52 | ../../src/ContractionState.cxx \ 53 | ../../src/Decoration.cxx \ 54 | ../../src/RunStyles.cxx 55 | 56 | TESTS=$(EXE) 57 | 58 | all: $(TESTS) 59 | 60 | test: $(TESTS) 61 | ./$(EXE) 62 | 63 | clean: 64 | $(DEL) $(TESTS) *.o *.obj *.exe 65 | 66 | $(EXE): $(TESTSRC) $(TESTEDSRC) unitTest.cxx 67 | $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(LINKFLAGS) $^ -o $@ 68 | -------------------------------------------------------------------------------- /scintilla/test/unit/test.mak: -------------------------------------------------------------------------------- 1 | # Build all the unit tests with Microsoft Visual C++ using nmake 2 | # Tested with Visual C++ 2010 and 2013 3 | 4 | DEL = del /q 5 | EXE = unitTest.exe 6 | 7 | INCLUDEDIRS = /I../../include /I../../src /I../../lexlib 8 | 9 | CXXFLAGS = /EHsc /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 | ../../src/CellBuffer.cxx \ 16 | ../../src/CharClassify.cxx \ 17 | ../../src/ContractionState.cxx \ 18 | ../../src/Decoration.cxx \ 19 | ../../src/RunStyles.cxx 20 | 21 | TESTS=$(EXE) 22 | 23 | all: $(TESTS) 24 | 25 | test: $(TESTS) 26 | $(EXE) 27 | 28 | clean: 29 | $(DEL) $(TESTS) *.o *.obj *.exe 30 | 31 | $(EXE): $(TESTSRC) $(TESTEDSRC) $(@B).obj 32 | $(CXX) $(CXXFLAGS) /Fe$@ $** 33 | -------------------------------------------------------------------------------- /scintilla/test/unit/testDecoration.cxx: -------------------------------------------------------------------------------- 1 | // Unit Tests for Scintilla internal data structures 2 | 3 | #include 4 | 5 | #include 6 | #include 7 | 8 | #include "Platform.h" 9 | 10 | #include "SplitVector.h" 11 | #include "Partitioning.h" 12 | #include "RunStyles.h" 13 | #include "Decoration.h" 14 | 15 | #include "catch.hpp" 16 | 17 | const int indicator=4; 18 | 19 | // Test Decoration. 20 | 21 | TEST_CASE("Decoration") { 22 | 23 | Decoration deco(indicator); 24 | 25 | SECTION("HasCorrectIndicator") { 26 | REQUIRE(indicator == deco.indicator); 27 | } 28 | 29 | SECTION("IsEmptyInitially") { 30 | REQUIRE(0 == deco.rs.Length()); 31 | REQUIRE(1 == deco.rs.Runs()); 32 | REQUIRE(deco.Empty()); 33 | } 34 | 35 | SECTION("SimpleSpace") { 36 | deco.rs.InsertSpace(0, 1); 37 | REQUIRE(deco.Empty()); 38 | } 39 | 40 | SECTION("SimpleRun") { 41 | deco.rs.InsertSpace(0, 1); 42 | deco.rs.SetValueAt(0, 2); 43 | REQUIRE(!deco.Empty()); 44 | } 45 | } 46 | 47 | // Test DecorationList. 48 | 49 | TEST_CASE("DecorationList") { 50 | 51 | DecorationList decol; 52 | 53 | SECTION("HasCorrectIndicator") { 54 | decol.SetCurrentIndicator(indicator); 55 | REQUIRE(indicator == decol.GetCurrentIndicator()); 56 | } 57 | 58 | SECTION("HasCorrectCurrentValue") { 59 | const int value = 55; 60 | decol.SetCurrentValue(value); 61 | REQUIRE(value == decol.GetCurrentValue()); 62 | } 63 | 64 | SECTION("ExpandSetValues") { 65 | decol.SetCurrentIndicator(indicator); 66 | decol.InsertSpace(0, 9); 67 | const int value = 59; 68 | int position = 4; 69 | int fillLength = 3; 70 | bool changed = decol.FillRange(position, value, fillLength); 71 | REQUIRE(changed); 72 | REQUIRE(position == 4); 73 | REQUIRE(fillLength == 3); 74 | REQUIRE(fillLength == 3); 75 | REQUIRE(decol.ValueAt(indicator, 5) == value); 76 | REQUIRE(decol.AllOnFor(5) == (1 << indicator)); 77 | REQUIRE(decol.Start(indicator, 5) == 4); 78 | REQUIRE(decol.End(indicator, 5) == 7); 79 | const int indicatorB=6; 80 | decol.SetCurrentIndicator(indicatorB); 81 | changed = decol.FillRange(position, value, fillLength); 82 | REQUIRE(changed); 83 | REQUIRE(decol.AllOnFor(5) == ((1 << indicator) | (1 << indicatorB))); 84 | decol.DeleteRange(5, 1); 85 | REQUIRE(decol.Start(indicatorB, 5) == 4); 86 | REQUIRE(decol.End(indicatorB, 5) == 6); 87 | } 88 | 89 | } 90 | -------------------------------------------------------------------------------- /scintilla/test/unit/unitTest.cxx: -------------------------------------------------------------------------------- 1 | // Unit Tests for Scintilla internal data structures 2 | 3 | /* 4 | Currently tested: 5 | SplitVector 6 | Partitioning 7 | RunStyles 8 | ContractionState 9 | CharClassify 10 | Decoration 11 | DecorationList 12 | CellBuffer 13 | 14 | To do: 15 | PerLine * 16 | Range 17 | StyledText 18 | CaseFolder ... 19 | Document 20 | RESearch 21 | Selection 22 | UniConversion 23 | Style 24 | 25 | lexlib: 26 | Accessor 27 | LexAccessor 28 | CharacterSet 29 | OptionSet 30 | PropSetSimple 31 | StyleContext 32 | WordList 33 | */ 34 | 35 | #include 36 | #include 37 | 38 | #include "Platform.h" 39 | 40 | #define CATCH_CONFIG_MAIN // This tells Catch to provide a main() - only do this in one cpp file 41 | #include "catch.hpp" 42 | 43 | // Needed for PLATFORM_ASSERT in code being tested 44 | 45 | void Platform::Assert(const char *c, const char *file, int line) { 46 | fprintf(stderr, "Assertion [%s] failed at %s %d\n", c, file, line); 47 | abort(); 48 | } 49 | 50 | void Platform::DebugPrintf(const char *format, ...) { 51 | char buffer[2000]; 52 | va_list pArguments; 53 | va_start(pArguments, format); 54 | vsprintf(buffer, format, pArguments); 55 | va_end(pArguments); 56 | fprintf(stderr, "%s", buffer); 57 | } 58 | -------------------------------------------------------------------------------- /scintilla/test/xite.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | import XiteWin 4 | 5 | if __name__ == "__main__": 6 | XiteWin.main("") 7 | -------------------------------------------------------------------------------- /scintilla/tgzsrc: -------------------------------------------------------------------------------- 1 | cd .. 2 | rm -f scintilla.tgz 3 | tar --create --exclude \*.o --exclude \*.obj --exclude \*.dll --exclude \*.exe --exclude \*.a scintilla/* \ 4 | | gzip -c >scintilla.tgz 5 | -------------------------------------------------------------------------------- /scintilla/version.txt: -------------------------------------------------------------------------------- 1 | 350 2 | -------------------------------------------------------------------------------- /scintilla/win32/.cvsignore: -------------------------------------------------------------------------------- 1 | .cvsignore 2 | *.obj 3 | ScintRes.res -------------------------------------------------------------------------------- /scintilla/win32/CheckD2D.cxx: -------------------------------------------------------------------------------- 1 | // This file is compiled to check whether Direct2D and DirectWrite headers are available. 2 | #include 3 | #include 4 | -------------------------------------------------------------------------------- /scintilla/win32/PlatWin.h: -------------------------------------------------------------------------------- 1 | // Scintilla source code edit control 2 | /** @file PlatWin.h 3 | ** Implementation of platform facilities on Windows. 4 | **/ 5 | // Copyright 1998-2011 by Neil Hodgson 6 | // The License.txt file describes the conditions under which this software may be distributed. 7 | 8 | #ifndef PLATWIN_H 9 | #define PLATWIN_H 10 | 11 | #ifdef SCI_NAMESPACE 12 | namespace Scintilla { 13 | #endif 14 | 15 | extern bool IsNT(); 16 | extern void Platform_Initialise(void *hInstance); 17 | extern void Platform_Finalise(bool fromDllMain); 18 | 19 | #if defined(USE_D2D) 20 | extern bool LoadD2D(); 21 | extern ID2D1Factory *pD2DFactory; 22 | extern IDWriteFactory *pIDWriteFactory; 23 | #endif 24 | 25 | #ifdef SCI_NAMESPACE 26 | } 27 | #endif 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /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 "3.5.0" 8 | #define VERSION_WORDS 3, 5, 0, 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/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 | --------------------------------------------------------------------------------