├── .github ├── dependabot.yml └── workflows │ └── CI_build.yml ├── .gitignore ├── ColumnTools.cpp ├── ColumnTools.rc ├── ColumnTools.sln ├── ColumnTools.vcxproj ├── ColumnTools.vcxproj.user ├── HorizontalRuler.cpp ├── HorizontalRuler.h ├── Ini.cpp ├── Ini.h ├── Notepad_plus_msgs.h ├── NppHorizontalRuler.cpp ├── NppHorizontalRuler.h ├── PluginDefinition.cpp ├── PluginDefinition.h ├── PluginInterface.h ├── README.md ├── Sci_Position.h ├── Scintilla.h ├── SettingsDlg.cpp ├── SettingsDlg.h ├── menuCmdID.h └── resource.h /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # To get started with Dependabot version updates, you'll need to specify which 2 | # package ecosystems to update and where the package manifests are located. 3 | # Please see the documentation for all configuration options: 4 | # https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates 5 | 6 | version: 2 7 | updates: 8 | 9 | # Maintain dependencies for GitHub Actions 10 | - package-ecosystem: "github-actions" 11 | directory: "/" 12 | schedule: 13 | interval: "weekly" 14 | -------------------------------------------------------------------------------- /.github/workflows/CI_build.yml: -------------------------------------------------------------------------------- 1 | name: CI_build 2 | 3 | on: [push, pull_request] 4 | 5 | jobs: 6 | build: 7 | 8 | runs-on: windows-latest 9 | strategy: 10 | max-parallel: 6 11 | matrix: 12 | build_configuration: [Release, Debug] 13 | build_platform: [x64, Win32] 14 | 15 | steps: 16 | - name: Checkout repo 17 | uses: actions/checkout@v3 18 | 19 | - name: Add msbuild to PATH 20 | uses: microsoft/setup-msbuild@v1 21 | 22 | - name: MSBuild of plugin dll 23 | working-directory: .\ 24 | run: msbuild ColumnTools.vcxproj /m /p:configuration="${{ matrix.build_configuration }}" /p:platform="${{ matrix.build_platform }}" /p:PlatformToolset="v142" /target:zip 25 | env: 26 | ZIPCMD: 7z a -tzip 27 | 28 | - name: Archive 29 | uses: actions/upload-artifact@v3 30 | with: 31 | name: ColumnTools-${{ matrix.build_configuration }}-${{ matrix.build_platform }} 32 | path: ${{ matrix.build_configuration }}\${{ matrix.build_platform }}\ColumnTools.dll 33 | 34 | - name: Release 35 | uses: softprops/action-gh-release@v1 36 | if: startsWith(github.ref, 'refs/tags/') && matrix.build_configuration == 'Release' 37 | with: 38 | body: ${{ github.event.commits[0].message }} 39 | files: ${{ matrix.build_configuration }}\${{ matrix.build_platform }}\ColumnTools-v${{ github.ref_name }}-${{ matrix.build_platform }}.zip 40 | 41 | - name: SHA256 42 | if: startsWith(github.ref, 'refs/tags/') && matrix.build_configuration == 'Release' 43 | run: sha256sum.exe ${{ matrix.build_configuration }}\${{ matrix.build_platform }}\ColumnTools-v${{ github.ref_name }}-${{ matrix.build_platform }}.zip 44 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # User-specific files 2 | *.rsuser 3 | *.suo 4 | *.user 5 | *.userosscache 6 | *.sln.docstates 7 | 8 | # User-specific files (MonoDevelop/Xamarin Studio) 9 | *.userprefs 10 | 11 | # Mono auto generated files 12 | mono_crash.* 13 | 14 | # Build results 15 | [Dd]ebug/ 16 | [Dd]ebugPublic/ 17 | [Rr]elease/ 18 | [Rr]eleases/ 19 | x64/ 20 | x86/ 21 | [Ww][Ii][Nn]32/ 22 | [Aa][Rr][Mm]/ 23 | [Aa][Rr][Mm]64/ 24 | bld/ 25 | [Bb]in*/ 26 | [Oo]bj/ 27 | [Ll]og/ 28 | [Ll]ogs/ 29 | *.zip 30 | 31 | # Files built by Visual Studio 32 | *_i.c 33 | *_p.c 34 | *_h.h 35 | *.ilk 36 | *.meta 37 | *.obj 38 | *.iobj 39 | *.pch 40 | *.pdb 41 | *.ipdb 42 | *.pgc 43 | *.pgd 44 | *.rsp 45 | *.sbr 46 | *.tlb 47 | *.tli 48 | *.tlh 49 | *.tmp 50 | *.tmp_proj 51 | *_wpftmp.csproj 52 | *.log 53 | *.vspscc 54 | *.vssscc 55 | .builds 56 | *.pidb 57 | *.svclog 58 | *.scc 59 | *.exp 60 | *.lib 61 | -------------------------------------------------------------------------------- /ColumnTools.cpp: -------------------------------------------------------------------------------- 1 | //this file is part of notepad++ 2 | //Copyright (C)2003 Don HO 3 | // 4 | //This program is free software; you can redistribute it and/or 5 | //modify it under the terms of the GNU General Public License 6 | //as published by the Free Software Foundation; either 7 | //version 2 of the License, or (at your option) any later version. 8 | // 9 | //This program is distributed in the hope that it will be useful, 10 | //but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | //MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | //GNU General Public License for more details. 13 | // 14 | //You should have received a copy of the GNU General Public License 15 | //along with this program; if not, write to the Free Software 16 | //Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 17 | 18 | #include "PluginDefinition.h" 19 | #include "HorizontalRuler.h" 20 | #include "NppHorizontalRuler.h" 21 | #include "Scintilla.h" 22 | 23 | extern FuncItem funcItem[nbFunc]; 24 | extern HINSTANCE g_hInst; 25 | extern NppData nppData; 26 | 27 | extern bool g_bBsUnindent; 28 | extern bool g_bIsActiveHi; 29 | extern int g_iEdgeModeOrig; 30 | extern Sci_Position g_iEdgeColOrig; 31 | extern HorizontalRuler mainHRuler; 32 | extern HorizontalRuler subHRuler; 33 | extern HWND mainTabHwnd; 34 | extern HWND subTabHwnd; 35 | 36 | BOOL APIENTRY DllMain( HANDLE hModule, 37 | DWORD reasonForCall, 38 | LPVOID /* lpReserved */ ) 39 | { 40 | switch ( reasonForCall ) 41 | { 42 | case DLL_PROCESS_ATTACH: 43 | g_hInst = ( HINSTANCE )hModule; 44 | pluginInit( hModule ); 45 | break; 46 | 47 | case DLL_PROCESS_DETACH: 48 | pluginCleanUp(); 49 | break; 50 | 51 | case DLL_THREAD_ATTACH: 52 | break; 53 | 54 | case DLL_THREAD_DETACH: 55 | break; 56 | } 57 | 58 | return TRUE; 59 | } 60 | 61 | 62 | extern "C" __declspec( dllexport ) void setInfo( NppData notpadPlusData ) 63 | { 64 | nppData = notpadPlusData; 65 | commandMenuInit(); 66 | } 67 | 68 | extern "C" __declspec( dllexport ) const TCHAR * getName() 69 | { 70 | return NPP_PLUGIN_NAME; 71 | } 72 | 73 | extern "C" __declspec( dllexport ) FuncItem * getFuncsArray( int *nbF ) 74 | { 75 | *nbF = nbFunc; 76 | return funcItem; 77 | } 78 | 79 | 80 | extern "C" __declspec( dllexport ) void beNotified( SCNotification *notifyCode ) 81 | { 82 | static int nHscrollPos; 83 | SCROLLINFO si; 84 | 85 | switch ( notifyCode->nmhdr.code ) 86 | { 87 | case SCN_UPDATEUI: 88 | { 89 | if ( notifyCode->nmhdr.hwndFrom == nppData._scintillaMainHandle ) 90 | { 91 | if ( mainHRuler.IsInit() ) 92 | { 93 | memset( &si, 0, sizeof( SCROLLINFO ) ); 94 | si.cbSize = sizeof( SCROLLINFO ); 95 | si.fMask = SIF_POS;// SIF_TRACKPOS POS???????? 96 | GetScrollInfo( nppData._scintillaMainHandle, SB_HORZ, &si ); 97 | nHscrollPos = si.nPos; 98 | mainHRuler.PaintRuler(); 99 | } 100 | if ( g_bIsActiveHi ) 101 | setColHi( nppData._scintillaMainHandle ); 102 | } 103 | else if ( notifyCode->nmhdr.hwndFrom == nppData._scintillaSecondHandle ) 104 | { 105 | if ( subHRuler.IsInit() ) 106 | { 107 | memset( &si, 0, sizeof( SCROLLINFO ) ); 108 | si.cbSize = sizeof( SCROLLINFO ); 109 | si.fMask = SIF_POS;// SIF_TRACKPOS POS???????? 110 | GetScrollInfo( nppData._scintillaSecondHandle, SB_HORZ, &si ); 111 | nHscrollPos = si.nPos; 112 | subHRuler.PaintRuler(); 113 | } 114 | if ( g_bIsActiveHi ) 115 | setColHi( nppData._scintillaSecondHandle ); 116 | } 117 | } 118 | break; 119 | 120 | case SCN_ZOOM: 121 | case NPPN_WORDSTYLESUPDATED: 122 | { 123 | if ( mainHRuler.IsInit() ) 124 | { 125 | mainHRuler.GetRuleArea(); 126 | mainHRuler.SecureArea(); 127 | mainHRuler.PaintRuler(); 128 | } 129 | 130 | if ( subHRuler.IsInit() ) 131 | { 132 | subHRuler.GetRuleArea(); 133 | subHRuler.SecureArea(); 134 | subHRuler.PaintRuler(); 135 | } 136 | } 137 | break; 138 | 139 | case NPPN_READY: 140 | { 141 | HWND hCurScintilla = getCurScintilla(); 142 | g_iEdgeModeOrig = ( int )::SendMessage( hCurScintilla, SCI_GETEDGEMODE, 0, 143 | 0 ); 144 | g_iEdgeColOrig = ( Sci_Position )::SendMessage( hCurScintilla, SCI_GETEDGECOLUMN, 0, 145 | 0 ); 146 | 147 | RulerWndProcSet(); 148 | mainHRuler.Init( nppData._nppHandle, nppData._scintillaMainHandle, 149 | mainTabHwnd ); 150 | subHRuler.Init( nppData._nppHandle, nppData._scintillaSecondHandle, 151 | subTabHwnd ); 152 | 153 | if ( mainHRuler.GetEnable() ) 154 | SendMessage( nppData._nppHandle, NPPM_SETMENUITEMCHECK, 155 | funcItem[MENU_RULER]._cmdID, TRUE ); 156 | else 157 | SendMessage( nppData._nppHandle, NPPM_SETMENUITEMCHECK, 158 | funcItem[MENU_RULER]._cmdID, FALSE ); 159 | 160 | syncEnable(); 161 | 162 | SendMessage( nppData._nppHandle, WM_SIZE, 0, 0 ); 163 | } 164 | break; 165 | 166 | case NPPN_FILEOPENED: 167 | case NPPN_FILECLOSED: 168 | case NPPN_BUFFERACTIVATED: 169 | { 170 | doBufferSets(); 171 | } 172 | break; 173 | 174 | case NPPN_SHUTDOWN: 175 | { 176 | RulerWndProcUnset(); 177 | commandMenuCleanUp(); 178 | } 179 | break; 180 | 181 | default: 182 | return; 183 | } 184 | } 185 | 186 | // Here you can process the Npp Messages 187 | // I will make the messages accessible little by little, according to the need of plugin development. 188 | // Please let me know if you need to access to some messages : 189 | // http://sourceforge.net/forum/forum.php?forum_id=482781 190 | // 191 | extern "C" __declspec( dllexport ) LRESULT messageProc( UINT Message, 192 | WPARAM wParam, LPARAM lParam ) 193 | { 194 | LRESULT result = TRUE; 195 | result = onHorizontalRulerMessageProc( Message, wParam, lParam ); 196 | 197 | return result; 198 | } 199 | 200 | #ifdef UNICODE 201 | extern "C" __declspec( dllexport ) BOOL isUnicode() 202 | { 203 | return TRUE; 204 | } 205 | #endif //UNICODE 206 | -------------------------------------------------------------------------------- /ColumnTools.rc: -------------------------------------------------------------------------------- 1 | #include // include for version info constants 2 | #include "resource.h" 3 | 4 | // 5 | // TO CHANGE VERSION INFORMATION, EDIT PROJECT OPTIONS... 6 | // 7 | 1 VERSIONINFO 8 | FILEVERSION VER_MAJOR,VER_MINOR,VER_RELEASE,VER_BUILD 9 | PRODUCTVERSION VER_MAJOR,VER_MINOR,VER_RELEASE,VER_BUILD 10 | FILETYPE VFT_APP 11 | { 12 | BLOCK "StringFileInfo" 13 | { 14 | BLOCK "040904E4" 15 | { 16 | VALUE "FileDescription", FILE_DESCRIPTION 17 | VALUE "InternalName", INTERNAL_NAME 18 | 19 | VALUE "CompanyName", COMPANY_NAME 20 | VALUE "FileVersion", VER_STRING 21 | VALUE "LegalCopyright", LEGAL_COPYRIGHT 22 | VALUE "LegalTrademarks", LEGAL_TRADEMARKS 23 | VALUE "OriginalFilename", ORIGINAL_FILENAME 24 | VALUE "ProductName", PRODUCT_NAME 25 | VALUE "ProductVersion", VER_STRING 26 | } 27 | } 28 | BLOCK "VarFileInfo" 29 | { 30 | VALUE "Translation", 0x0409, 1252 31 | } 32 | } 33 | 34 | IDD_SETTINGS DIALOGEX 26,41,170,115 35 | CAPTION "Column Tools Settings" 36 | FONT 8,"MS Shell Dlg",0,0,0 37 | STYLE WS_POPUP|WS_VISIBLE|WS_CAPTION|WS_SYSMENU|DS_SHELLFONT 38 | BEGIN 39 | CONTROL "&OK",IDB_OK,"Button",WS_CHILDWINDOW|WS_VISIBLE|WS_TABSTOP,90,90,50,14 40 | CONTROL "&Backspace Unindents",IDC_STATIC,"Static",WS_CHILDWINDOW|WS_VISIBLE|WS_GROUP,22,16,100,11 41 | CONTROL "",IDC_CHK_BSU,"Button",WS_CHILDWINDOW|WS_VISIBLE|WS_TABSTOP|BS_AUTOCHECKBOX,10,15,10,9 42 | CONTROL "&Indent Guides LookForward",IDC_STATIC,"Static",WS_CHILDWINDOW|WS_VISIBLE|WS_GROUP,22,36,100,11 43 | CONTROL "",IDC_CHK_IGLF,"Button",WS_CHILDWINDOW|WS_VISIBLE|WS_TABSTOP|BS_AUTOCHECKBOX,10,35,10,9 44 | CONTROL "Start Ruler at:",IDC_GRP1,"Button",WS_CHILDWINDOW|WS_VISIBLE|BS_GROUPBOX,10,54,72,27 45 | CONTROL "&0",IDC_RBN_0,"Button",WS_CHILDWINDOW|WS_VISIBLE|WS_TABSTOP|BS_AUTORADIOBUTTON,21,65,18,9 46 | CONTROL "&1",IDC_RBN_1,"Button",WS_CHILDWINDOW|WS_VISIBLE|WS_TABSTOP|BS_AUTORADIOBUTTON,51,65,18,9 47 | CONTROL "Version",IDC_STATIC,"Static",WS_CHILDWINDOW|WS_VISIBLE|WS_DISABLED|WS_GROUP,10,90,30,11 48 | CONTROL "",IDC_STC_VER,"SysLink",WS_CHILDWINDOW|WS_VISIBLE|WS_TABSTOP|LWS_TRANSPARENT,40,90,40,11 49 | END 50 | -------------------------------------------------------------------------------- /ColumnTools.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.28307.489 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ColumnTools", "ColumnTools.vcxproj", "{1590D7CD-7D3A-4AB7-A355-EE02F7FB987D}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|x64 = Debug|x64 11 | Debug|x86 = Debug|x86 12 | Release|x64 = Release|x64 13 | Release|x86 = Release|x86 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {1590D7CD-7D3A-4AB7-A355-EE02F7FB987D}.Debug|x64.ActiveCfg = Debug|x64 17 | {1590D7CD-7D3A-4AB7-A355-EE02F7FB987D}.Debug|x64.Build.0 = Debug|x64 18 | {1590D7CD-7D3A-4AB7-A355-EE02F7FB987D}.Debug|x86.ActiveCfg = Debug|Win32 19 | {1590D7CD-7D3A-4AB7-A355-EE02F7FB987D}.Debug|x86.Build.0 = Debug|Win32 20 | {1590D7CD-7D3A-4AB7-A355-EE02F7FB987D}.Release|x64.ActiveCfg = Release|x64 21 | {1590D7CD-7D3A-4AB7-A355-EE02F7FB987D}.Release|x64.Build.0 = Release|x64 22 | {1590D7CD-7D3A-4AB7-A355-EE02F7FB987D}.Release|x86.ActiveCfg = Release|Win32 23 | {1590D7CD-7D3A-4AB7-A355-EE02F7FB987D}.Release|x86.Build.0 = Release|Win32 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | GlobalSection(ExtensibilityGlobals) = postSolution 29 | SolutionGuid = {9644D4A1-CC03-4F95-BD89-688951E45DBF} 30 | EndGlobalSection 31 | EndGlobal 32 | -------------------------------------------------------------------------------- /ColumnTools.vcxproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | Win32 7 | 8 | 9 | Debug 10 | x64 11 | 12 | 13 | Release 14 | Win32 15 | 16 | 17 | Release 18 | x64 19 | 20 | 21 | 22 | {1590D7CD-7D3A-4AB7-A355-EE02F7FB987D} 23 | Win32Proj 24 | ColumnTools 25 | 10.0 26 | 27 | 28 | 29 | DynamicLibrary 30 | true 31 | v142 32 | Unicode 33 | 34 | 35 | DynamicLibrary 36 | true 37 | v142 38 | Unicode 39 | 40 | 41 | DynamicLibrary 42 | false 43 | v142 44 | true 45 | Unicode 46 | 47 | 48 | DynamicLibrary 49 | false 50 | v142 51 | true 52 | Unicode 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | true 72 | $(Configuration)\$(Platform)\ 73 | 74 | 75 | true 76 | $(Configuration)\$(Platform)\ 77 | 78 | 79 | false 80 | $(Configuration)\$(Platform)\ 81 | 82 | 83 | false 84 | $(Configuration)\$(Platform)\ 85 | 86 | 87 | 88 | Disabled 89 | true 90 | Speed 91 | WIN32;_DEBUG;_WINDOWS;_USRDLL;ColumnTools_EXPORTS;%(PreprocessorDefinitions) 92 | EnableFastChecks 93 | MultiThreadedDebug 94 | Level4 95 | 96 | 97 | %(AdditionalDependencies) 98 | true 99 | Windows 100 | MachineX86 101 | 102 | 103 | 104 | 105 | Disabled 106 | true 107 | Speed 108 | WIN32;_DEBUG;_WINDOWS;_USRDLL;ColumnTools_EXPORTS;%(PreprocessorDefinitions) 109 | EnableFastChecks 110 | MultiThreadedDebug 111 | Level4 112 | 113 | 114 | %(AdditionalDependencies) 115 | true 116 | Windows 117 | 118 | 119 | 120 | 121 | Level4 122 | Full 123 | true 124 | false 125 | Speed 126 | WIN32;NDEBUG;_WINDOWS;_USRDLL;ColumnTools_EXPORTS;%(PreprocessorDefinitions) 127 | MultiThreaded 128 | 129 | 130 | Windows 131 | false 132 | true 133 | true 134 | $(TargetName).lib 135 | MachineX86 136 | 137 | 138 | 139 | 140 | Level4 141 | Full 142 | true 143 | false 144 | Speed 145 | WIN32;NDEBUG;_WINDOWS;_USRDLL;NppGitSCM_EXPORTS;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_CRT_NON_CONFORMING_SWPRINTFS=1;%(PreprocessorDefinitions) 146 | MultiThreaded 147 | 148 | 149 | Windows 150 | false 151 | true 152 | true 153 | $(TargetName).lib 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | -------------------------------------------------------------------------------- /ColumnTools.vcxproj.user: -------------------------------------------------------------------------------- 1 | 2 | 3 | 19 | 20 | 21 | 22 | zip 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /HorizontalRuler.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is: 3 | The zlib/libpng License 4 | Copyright (c) 2012 freesftys 5 | 6 | This software is provided 'as-is', without any express or implied warranty. 7 | In no event will the authors be held liable for any damages arising from 8 | the use of this software. 9 | 10 | Permission is granted to anyone to use this software for any purpose, including 11 | commercial applications, and to alter it and redistribute it freely, subject to 12 | the following restrictions: 13 | 14 | 1. The origin of this software must not be misrepresented; you must not 15 | claim that you wrote the original software. If you use this software in 16 | a product, an acknowledgment in the product documentation would be 17 | appreciated but is not required. 18 | 19 | 2. Altered source versions must be plainly marked as such, and must not be 20 | misrepresented as being the original software. 21 | 22 | 3. This notice may not be removed or altered from any source distribution. 23 | 24 | ?? 25 | http://opensource.org/licenses/Zlib 26 | 27 | ???? 28 | http://sourceforge.jp/projects/opensource/wiki/licenses%2Fzlib_libpng_license 29 | */ 30 | 31 | #include "HorizontalRuler.h" 32 | #include "menuCmdID.h" 33 | #include "ini.h" 34 | #include "PluginDefinition.h" 35 | #include "Scintilla.h" 36 | 37 | #include 38 | #include 39 | #include 40 | #include 41 | 42 | extern NppData nppData; 43 | extern FuncItem funcItem[]; 44 | 45 | extern WNDPROC oldWndProc; 46 | extern bool g_bIsActiveHi; 47 | extern bool g_bBsUnindent; 48 | extern bool g_bIndentGuideLF; 49 | extern int g_iEdgeModeOrig; 50 | extern Sci_Position g_iEdgeColOrig; 51 | 52 | #define FRAMESIZE GetSystemMetrics(SM_CXEDGE) 53 | //SM_CXBORDER //3D?? 54 | //SM_CXEDGE //3D 55 | //SM_CXFRAME //???????? 56 | //SM_CYFIXEDFRAME //?????? 57 | //Dprintf("???? Border %d Edge %d Frame %d Fix %d\n", 58 | // GetSystemMetrics(SM_CXBORDER), GetSystemMetrics(SM_CXEDGE), GetSystemMetrics(SM_CXFRAME), GetSystemMetrics(SM_CXFIXEDFRAME) 59 | // ); 60 | 61 | HorizontalRuler::HorizontalRuler() : 62 | nTopMargin( 0 ), 63 | nCharWidth( 0 ), 64 | nCharHeight( 0 ), 65 | nMarginWidth( 0 ), 66 | bRulerStart( false ), 67 | nppHwnd( 0 ), 68 | scintillaHwnd( 0 ), 69 | tabHwnd( 0 ), 70 | enable( 1 ), 71 | bFontFix( false ), 72 | nFontSize( 10 ) 73 | { 74 | 75 | } 76 | 77 | HorizontalRuler::~HorizontalRuler() 78 | { 79 | if ( this->hFont ) 80 | DeleteObject( this->hFont ); 81 | 82 | // Ruler 83 | Ini::getInstance()->writeDate( TEXT( "HorizontalRuler" ), 84 | TEXT( "FontSize" ), this->nFontSize ); 85 | 86 | int nBuf; 87 | 88 | if ( this->bFontFix == true ) 89 | nBuf = 1; 90 | else 91 | nBuf = 0; 92 | Ini::getInstance()->writeDate( TEXT( "HorizontalRuler" ), TEXT( "Fix" ), 93 | nBuf ); 94 | 95 | 96 | Ini::getInstance()->writeDate( TEXT( "HorizontalRuler" ), 97 | TEXT( "Visible" ), this->enable ); 98 | 99 | if ( this->bRulerStart == true ) 100 | nBuf = 1; 101 | else 102 | nBuf = 0; 103 | Ini::getInstance()->writeDate( TEXT( "HorizontalRuler" ), 104 | TEXT( "RulerStart" ), nBuf ); 105 | 106 | // Column 107 | Ini::getInstance()->writeDate( TEXT( "ColumnHighlight" ), 108 | TEXT( "Mode" ), g_iEdgeModeOrig ); 109 | 110 | Ini::getInstance()->writeDate( TEXT( "ColumnHighlight" ), 111 | TEXT( "Column" ), static_cast(g_iEdgeColOrig) ); 112 | 113 | if ( g_bIsActiveHi == true ) 114 | nBuf = 1; 115 | else 116 | nBuf = 0; 117 | Ini::getInstance()->writeDate( TEXT( "ColumnHighlight" ), TEXT( "Enable" ), 118 | nBuf ); 119 | 120 | // BackspaceUnindent 121 | if ( g_bBsUnindent == true ) 122 | nBuf = 1; 123 | else 124 | nBuf = 0; 125 | Ini::getInstance()->writeDate( TEXT( "BackspaceUnindent" ), TEXT( "Enable" ), 126 | nBuf ); 127 | 128 | // Indent Guides LookForward 129 | if ( g_bIndentGuideLF == true ) 130 | nBuf = 1; 131 | else 132 | nBuf = 0; 133 | Ini::getInstance()->writeDate( TEXT( "IndentGuidesLookForward" ), TEXT( "Enable" ), 134 | nBuf ); 135 | } 136 | 137 | void HorizontalRuler::Init( HWND npp, HWND scintilla, HWND tab ) 138 | { 139 | TCHAR configDir[MAX_PATH]; 140 | TCHAR buf[MAX_PATH]; 141 | int nBuf; 142 | 143 | this->nppHwnd = npp; 144 | this->scintillaHwnd = scintilla; 145 | this->tabHwnd = tab; 146 | 147 | SendMessage( this->nppHwnd, NPPM_GETPLUGINSCONFIGDIR, MAX_PATH, 148 | ( LPARAM )configDir ); 149 | 150 | Ini::getInstance()->setIniPath( configDir ); 151 | 152 | // Ruler 153 | Ini::getInstance()->readDate( TEXT( "HorizontalRuler" ), 154 | TEXT( "FontSize" ), buf, MAX_PATH ); 155 | nBuf = _ttoi( buf ); 156 | 157 | if ( nBuf != 0 ) 158 | this->nFontSize = nBuf; 159 | 160 | Ini::getInstance()->readDate( TEXT( "HorizontalRuler" ), TEXT( "Fix" ), 161 | buf, MAX_PATH ); 162 | nBuf = _ttoi( buf ); 163 | if ( nBuf != 0 ) 164 | this->bFontFix = true; 165 | 166 | Ini::getInstance()->readDate( TEXT( "HorizontalRuler" ), TEXT( "Visible" ), 167 | &this->enable ); 168 | 169 | Ini::getInstance()->readDate( TEXT( "HorizontalRuler" ), TEXT( "RulerStart" ), 170 | buf, MAX_PATH ); 171 | nBuf = _ttoi( buf ); 172 | if ( nBuf != 0 ) 173 | this->bRulerStart = true; 174 | 175 | // Column 176 | Ini::getInstance()->readDate( TEXT( "ColumnHighlight" ), TEXT( "Mode" ), 177 | &g_iEdgeModeOrig ); 178 | 179 | Ini::getInstance()->readDate( TEXT( "ColumnHighlight" ), TEXT( "Column" ), 180 | &static_cast(g_iEdgeColOrig) ); 181 | 182 | Ini::getInstance()->readDate( TEXT( "ColumnHighlight" ), TEXT( "Enable" ), 183 | buf, MAX_PATH ); 184 | nBuf = _ttoi( buf ); 185 | if ( nBuf != 0 ) 186 | { 187 | colHi( true ); 188 | // HMENU hMenu = ::GetMenu( nppData._nppHandle ); 189 | // UINT state = ::GetMenuState( hMenu, funcItem[MENU_HIGHLIGHT]._cmdID, 190 | // MF_BYCOMMAND ); 191 | ::SendMessage( nppData._nppHandle, NPPM_SETMENUITEMCHECK, 192 | funcItem[MENU_HIGHLIGHT]._cmdID, MF_CHECKED ); 193 | } 194 | 195 | // BackspaceUnindent 196 | Ini::getInstance()->readDate( TEXT( "BackspaceUnindent" ), TEXT( "Enable" ), 197 | buf, MAX_PATH ); 198 | nBuf = _ttoi( buf ); 199 | if ( nBuf != 0 ) 200 | g_bBsUnindent = true; 201 | 202 | // Indent Guides LookForward 203 | Ini::getInstance()->readDate( TEXT( "IndentGuidesLookForward" ), TEXT( "Enable" ), 204 | buf, MAX_PATH ); 205 | nBuf = _ttoi( buf ); 206 | if ( nBuf != 0 ) 207 | g_bIndentGuideLF = true; 208 | 209 | doBufferSets(); 210 | 211 | return; 212 | } 213 | 214 | int HorizontalRuler::IsInit() 215 | { 216 | if ( ( this->tabHwnd == NULL ) || ( this->enable == 0 ) ) 217 | return 0; 218 | 219 | return 1; 220 | } 221 | 222 | void HorizontalRuler::doVisible() 223 | { 224 | this->GetInitPos(); 225 | this->GetRuleArea(); 226 | this->SecureArea(); 227 | this->PaintRuler(); 228 | return; 229 | } 230 | 231 | void HorizontalRuler::GetInitPos() 232 | { 233 | RECT clientRc, rc, tabClientRc, tabRc; 234 | //POINT pt; 235 | 236 | GetWindowRect( this->scintillaHwnd, &rc ); 237 | GetClientRect( this->scintillaHwnd, &clientRc ); 238 | GetWindowRect( this->tabHwnd, &tabRc ); 239 | GetClientRect( this->tabHwnd, &tabClientRc ); 240 | 241 | if ( !::SendMessage( this->nppHwnd, NPPM_ISTABBARHIDDEN, 0, 0 ) ) 242 | SendMessage( this->tabHwnd, TCM_ADJUSTRECT, FALSE, 243 | ( LPARAM )&tabClientRc ); 244 | 245 | MapWindowPoints( HWND_DESKTOP, this->nppHwnd, ( LPPOINT )&rc, 2 ); 246 | MapWindowPoints( HWND_DESKTOP, this->nppHwnd, ( LPPOINT )&tabRc, 2 ); 247 | 248 | this->nScintillaFrameSize = GetSystemMetrics( SM_CXEDGE ); 249 | 250 | this->nInitClientX = tabRc.left + tabClientRc.left; 251 | this->nInitClientY = tabRc.top + tabClientRc.top + 252 | this->nScintillaFrameSize; 253 | this->nInitWidth = tabClientRc.right - tabClientRc.left; 254 | this->nInitHeight = tabClientRc.bottom - tabClientRc.top - 255 | this->nScintillaFrameSize; 256 | this->nInitClientX = this->nInitClientX < 0 ? 0 : this->nInitClientX; 257 | this->nInitClientY = this->nInitClientY < 0 ? 0 : this->nInitClientY; 258 | this->nInitWidth = this->nInitWidth < 0 ? 0 : this->nInitWidth; 259 | this->nInitHeight = this->nInitHeight < 0 ? 0 : this->nInitHeight; 260 | 261 | if ( clientRc.right > 0 ) 262 | { 263 | SCROLLBARINFO scrollInfo; 264 | scrollInfo.cbSize = sizeof( scrollInfo ); 265 | GetScrollBarInfo( this->scintillaHwnd, OBJID_VSCROLL, &scrollInfo ); 266 | 267 | if ( scrollInfo.rgstate[0] != STATE_SYSTEM_INVISIBLE ) 268 | tabClientRc.right -= scrollInfo.rcScrollBar.right - 269 | scrollInfo.rcScrollBar.left; 270 | } 271 | 272 | tabClientRc.top += this->nScintillaFrameSize; 273 | 274 | this->nDrawStartX = tabClientRc.left; 275 | this->rulerRect = tabClientRc; 276 | this->rulerDesctopRect = tabClientRc; 277 | MapWindowPoints( this->tabHwnd, HWND_DESKTOP, 278 | ( LPPOINT )&this->rulerDesctopRect, 2 ); 279 | } 280 | 281 | void HorizontalRuler::GetRuleArea() 282 | { 283 | int i; 284 | char sFontName[MAX_PATH]; 285 | // int nFontSize; 286 | HDC hDC; 287 | 288 | this->nCharWidth = ( int )SendMessage( this->scintillaHwnd, SCI_TEXTWIDTH, 289 | STYLE_DEFAULT, ( LPARAM )L"P" ); 290 | 291 | ////Scintilla?????? 292 | this->nMarginWidth = FRAMESIZE; 293 | 294 | int nMargins = ( int )SendMessage( this->scintillaHwnd, SCI_GETMARGINS, 0, 0 ); 295 | for ( i = 0; i < nMargins; i++ ) 296 | this->nMarginWidth += ( int )SendMessage( this->scintillaHwnd, 297 | SCI_GETMARGINWIDTHN, i, 0 ); 298 | 299 | //??????? 300 | if ( this->hFont ) 301 | DeleteObject( this->hFont ); 302 | 303 | SendMessage( this->scintillaHwnd, SCI_STYLEGETFONT, STYLE_DEFAULT, 304 | ( LPARAM )sFontName ); 305 | 306 | if ( this->bFontFix == true ) 307 | nFontSize = this->nFontSize; 308 | else 309 | nFontSize = ( int )SendMessage( this->scintillaHwnd, SCI_STYLEGETSIZE, 310 | STYLE_DEFAULT, 0 ); 311 | LOGFONT logFont; 312 | ZeroMemory( &logFont, sizeof( LOGFONT ) ); 313 | hDC = GetDC( this->scintillaHwnd ); 314 | logFont.lfHeight = -MulDiv( nFontSize, GetDeviceCaps( hDC, LOGPIXELSY ), 315 | 72 ); 316 | ReleaseDC( this->scintillaHwnd, hDC ); 317 | MultiByteToWideChar( CP_ACP, MB_PRECOMPOSED, sFontName, -1, 318 | logFont.lfFaceName, 32 ); 319 | 320 | this->hFont = CreateFontIndirect( &logFont ); 321 | 322 | if ( this->bFontFix == true ) 323 | this->nCharHeight = abs( logFont.lfHeight ); 324 | else 325 | this->nCharHeight = ( int )SendMessage( this->scintillaHwnd, 326 | SCI_TEXTHEIGHT, 0, 0 ); 327 | 328 | this->nTopMargin = ( int )( nCharHeight * 1.5f ); 329 | 330 | return; 331 | } 332 | 333 | void HorizontalRuler::SecureArea() 334 | { 335 | this->x = this->nInitClientX; 336 | this->y = this->nInitClientY + nTopMargin; 337 | this->width = this->nInitWidth; 338 | this->height = this->nInitHeight - nTopMargin; 339 | 340 | if ( this->y > 0 ) 341 | MoveWindow( this->scintillaHwnd, this->x, this->y, this->width, 342 | this->height, TRUE ); 343 | 344 | return; 345 | } 346 | 347 | void HorizontalRuler::PaintRuler() 348 | { 349 | HDC hDC; 350 | HFONT oldFont; 351 | 352 | RECT rc, drawRc; 353 | SCROLLINFO si; 354 | int nScrollMod; 355 | int i; 356 | int nMaxCol; 357 | int nRulerStartX; 358 | int nStartCol; 359 | int tmp; 360 | wchar_t sColumNumber[10] = {L""}; 361 | int nLength; 362 | //?????????? 363 | Sci_Position nCaret; 364 | 365 | if ( this->nCharWidth == 0 ) 366 | return; 367 | 368 | if ( this->tabHwnd == NULL ) 369 | return; 370 | 371 | nRulerStartX = this->nDrawStartX + this->nMarginWidth; 372 | rc = this->rulerRect; 373 | 374 | rc.bottom = rc.top + this->nTopMargin; 375 | 376 | 377 | //????????????? 378 | memset( &si, 0, sizeof( SCROLLINFO ) ); 379 | si.cbSize = sizeof( SCROLLINFO ); 380 | si.fMask = SIF_POS;// SIF_TRACKPOS POS???????? 381 | GetScrollInfo( this->scintillaHwnd, SB_HORZ, &si ); 382 | nScrollMod = ( si.nPos % this->nCharWidth ); 383 | nMaxCol = ( rc.right - nRulerStartX ) / this->nCharWidth; 384 | nStartCol = si.nPos / this->nCharWidth; 385 | 386 | //?????????? 387 | bool rect = ( bool )::SendMessage( this->scintillaHwnd, SCI_SELECTIONISRECTANGLE, 0, 0 ); 388 | Sci_Position vsp = 0; 389 | if ( rect ) 390 | vsp = ( Sci_Position )::SendMessage( this->scintillaHwnd, SCI_GETRECTANGULARSELECTIONCARETVIRTUALSPACE, 0, 0 ); 391 | else 392 | { 393 | int sel = ( int )::SendMessage( this->scintillaHwnd, SCI_GETMAINSELECTION, 0, 0 ); 394 | vsp = ( Sci_Position )::SendMessage( this->scintillaHwnd, SCI_GETSELECTIONNCARETVIRTUALSPACE, sel, 0 ); 395 | } 396 | 397 | nCaret = this->GetCaretPos() + vsp; 398 | 399 | //?????? 400 | hDC = GetWindowDC( this->tabHwnd ); 401 | oldFont = ( HFONT )SelectObject( hDC, this->hFont ); 402 | 403 | drawRc = rc; 404 | drawRc.right = nRulerStartX; 405 | FillRect( hDC, &drawRc, GetSysColorBrush( 0 ) ); 406 | drawRc.left = nRulerStartX; 407 | drawRc.right = rc.right; 408 | FillRect( hDC, &drawRc, ( HBRUSH )GetStockObject( WHITE_BRUSH ) ); 409 | 410 | // Ruler starts at 0 (default) or 1 411 | int nAdjust = 0; 412 | if ( this->bRulerStart ) 413 | { 414 | nStartCol++; 415 | nAdjust = 1; 416 | } 417 | //???? 418 | if ( nScrollMod == 0 ) 419 | { 420 | if ( ( nStartCol % 10 - nAdjust ) == 0 ) 421 | { 422 | memset( sColumNumber, 0, sizeof( sColumNumber ) ); 423 | nLength = swprintf_s( sColumNumber, 10, L"%d", nStartCol ); 424 | SetBkMode( hDC, TRANSPARENT ); 425 | ExtTextOut( hDC, nRulerStartX + 1, rc.top, ETO_CLIPPED, &rc, 426 | sColumNumber, nLength, 0 ); 427 | 428 | MoveToEx( hDC, nRulerStartX, rc.top, NULL ); 429 | LineTo( hDC, nRulerStartX, rc.top + this->nTopMargin ); 430 | } 431 | else 432 | { 433 | MoveToEx( hDC, nRulerStartX, rc.top + this->nCharHeight, NULL ); 434 | LineTo( hDC, nRulerStartX, rc.top + this->nTopMargin ); 435 | } 436 | 437 | if ( ( nStartCol - nAdjust ) == nCaret ) 438 | { 439 | RECT rcCaret; 440 | rcCaret.left = nRulerStartX + 2; 441 | rcCaret.top = rc.top + this->nCharHeight; 442 | rcCaret.right = rcCaret.left + this->nCharWidth - 3; 443 | rcCaret.bottom = rc.bottom - 1; 444 | FillRect( hDC, &rcCaret, ( HBRUSH )GetStockObject( BLACK_BRUSH ) ); 445 | } 446 | } 447 | 448 | for ( i = 1; i < nMaxCol; i++ ) 449 | { 450 | tmp = nRulerStartX - nScrollMod + ( i * this->nCharWidth ); 451 | 452 | if ( ( ( nStartCol + i ) % 10 - nAdjust ) == 0 ) 453 | { 454 | memset( sColumNumber, 0, sizeof( sColumNumber ) ); 455 | nLength = swprintf_s( sColumNumber, 10, L"%d", nStartCol + i ); 456 | SetBkMode( hDC, TRANSPARENT ); 457 | ExtTextOut( hDC, tmp + 1, rc.top, ETO_CLIPPED, &rc, sColumNumber, 458 | nLength, 0 ); 459 | //TextOut(hDC, tmp+1, rc.top, sColumNumber, nLength); 460 | 461 | MoveToEx( hDC, tmp, rc.top, NULL ); 462 | LineTo( hDC, tmp, rc.top + this->nTopMargin ); 463 | } 464 | else 465 | { 466 | MoveToEx( hDC, tmp, rc.top + this->nCharHeight, NULL ); 467 | LineTo( hDC, tmp, rc.top + this->nTopMargin ); 468 | } 469 | 470 | if ( ( nStartCol + i - nAdjust ) == nCaret ) 471 | { 472 | RECT rcCaret; 473 | rcCaret.left = tmp + 2; 474 | rcCaret.top = rc.top + this->nCharHeight; 475 | rcCaret.right = rcCaret.left + this->nCharWidth - 3; 476 | rcCaret.bottom = rc.bottom - 1; 477 | FillRect( hDC, &rcCaret, ( HBRUSH )GetStockObject( BLACK_BRUSH ) ); 478 | } 479 | } 480 | 481 | SelectObject( hDC, oldFont ); 482 | ReleaseDC( this->tabHwnd, hDC ); 483 | } 484 | 485 | Sci_Position HorizontalRuler::GetCaretPos() 486 | { 487 | //?????????? 488 | int i; 489 | 490 | char *curLin; 491 | wchar_t *wideCurLin; 492 | char *ansiCurLin; 493 | int nWideExchange; 494 | int nAnsiExchange; 495 | 496 | Sci_Position nCaret, nLineLength; 497 | int nTabSpace; 498 | 499 | nLineLength = ( Sci_Position )SendMessage( this->scintillaHwnd, SCI_GETCURLINE, 0, 500 | 0 ); 501 | nLineLength += 2; 502 | curLin = new char[nLineLength]; 503 | nCaret = ( Sci_Position )SendMessage( this->scintillaHwnd, SCI_GETCURLINE, 504 | nLineLength, ( LPARAM )curLin ); 505 | nTabSpace = ( int )SendMessage( this->scintillaHwnd, SCI_GETTABWIDTH, 0, 506 | 0 ); 507 | 508 | curLin[nCaret] = '\0'; 509 | //utf8->utf16 510 | nWideExchange = MultiByteToWideChar( CP_UTF8, 0, curLin, -1, 0, 0 ); 511 | wideCurLin = new wchar_t[nWideExchange]; 512 | MultiByteToWideChar( CP_UTF8, 0, curLin, -1, wideCurLin, nWideExchange ); 513 | nAnsiExchange = WideCharToMultiByte( CP_ACP, 0, wideCurLin, nWideExchange, 514 | 0, 0, NULL, NULL ); 515 | //utf16->ansi 516 | ansiCurLin = new char[nAnsiExchange]; 517 | WideCharToMultiByte( CP_ACP, 0, wideCurLin, nWideExchange, ansiCurLin, 518 | nAnsiExchange, NULL, NULL ); 519 | 520 | //??????? 521 | nCaret = 0; 522 | 523 | for ( i = 0; i < nAnsiExchange - 1; i++ ) 524 | { 525 | if ( ansiCurLin[i] == '\t' ) 526 | nCaret = ( ( nCaret / nTabSpace ) + 1 ) * nTabSpace; 527 | else 528 | nCaret++; 529 | } 530 | 531 | delete[] ansiCurLin; 532 | delete[] wideCurLin; 533 | delete[] curLin; 534 | ansiCurLin = NULL; 535 | wideCurLin = NULL; 536 | curLin = NULL; 537 | 538 | return nCaret; 539 | } 540 | 541 | void HorizontalRuler::SendSizeToMain() 542 | { 543 | 544 | RECT rc; 545 | GetWindowRect( this->nppHwnd, &rc ); 546 | SendMessage( this->nppHwnd, WM_SIZE, 0, MAKELPARAM( rc.right - rc.left, 547 | rc.bottom - rc.top ) ); 548 | 549 | return; 550 | } 551 | 552 | bool HorizontalRuler::HitDrawArea( int lx, int ly ) 553 | { 554 | if ( ( lx > this->rulerDesctopRect.left + this->nMarginWidth ) && 555 | ( lx < this->rulerDesctopRect.right ) && 556 | ( ly > this->rulerDesctopRect.top ) && 557 | ( ly < this->rulerDesctopRect.top + this->nTopMargin ) ) 558 | return true; 559 | 560 | return false; 561 | } 562 | 563 | int HorizontalRuler::EdgeLine( int lx, int /* y */) 564 | { 565 | int nSetEdgeLine; 566 | Sci_Position nNowEdgeLine; 567 | int nEdgeLineMode; 568 | int xOffset = 0; 569 | 570 | xOffset = ( int )SendMessage( this->scintillaHwnd, SCI_GETXOFFSET, 0, 0 ); 571 | nSetEdgeLine = ( lx - ( this->rulerDesctopRect.left + xOffset + 572 | this->nMarginWidth ) ) / this->nCharWidth; 573 | nNowEdgeLine = ( Sci_Position )SendMessage( this->scintillaHwnd, SCI_GETEDGECOLUMN, 574 | 0, 0 ); 575 | nEdgeLineMode = ( int )SendMessage( this->scintillaHwnd, SCI_GETEDGEMODE, 576 | 0, 0 ); 577 | 578 | if ( ( nNowEdgeLine != nSetEdgeLine ) || ( nEdgeLineMode == EDGE_NONE ) ) 579 | { 580 | SendMessage( this->scintillaHwnd, SCI_SETEDGECOLUMN, nSetEdgeLine, 0 ); 581 | SendMessage( this->scintillaHwnd, SCI_SETEDGEMODE, EDGE_LINE, 0 ); 582 | } 583 | else 584 | SendMessage( this->scintillaHwnd, SCI_SETEDGEMODE, EDGE_NONE, 0 ); 585 | 586 | return 0; 587 | } 588 | 589 | int HorizontalRuler::MultiEdgeLine( int lx, bool multiEdgeOn ) 590 | { 591 | int nSetEdgeLine; 592 | int xOffset = 0; 593 | 594 | xOffset = ( int )SendMessage( this->scintillaHwnd, SCI_GETXOFFSET, 0, 0 ); 595 | nSetEdgeLine = ( lx - ( this->rulerDesctopRect.left + xOffset + 596 | this->nMarginWidth ) ) / this->nCharWidth; 597 | 598 | COLORREF cColor = ( COLORREF )::SendMessage( this->scintillaHwnd, SCI_GETEDGECOLOUR, 0, 0 ); 599 | 600 | if ( multiEdgeOn ) 601 | { 602 | SendMessage( this->scintillaHwnd, SCI_SETEDGEMODE, EDGE_MULTILINE, 0 ); 603 | SendMessage( this->scintillaHwnd, SCI_MULTIEDGEADDLINE, nSetEdgeLine, cColor ); 604 | } 605 | else 606 | { 607 | SendMessage( this->scintillaHwnd, SCI_MULTIEDGECLEARALL, 0, 0 ); 608 | SendMessage( this->scintillaHwnd, SCI_SETEDGEMODE, g_iEdgeModeOrig, 0 ); 609 | } 610 | 611 | return 0; 612 | } 613 | -------------------------------------------------------------------------------- /HorizontalRuler.h: -------------------------------------------------------------------------------- 1 | /* 2 | This file is: 3 | The zlib/libpng License 4 | Copyright (c) 2012 freesftys 5 | 6 | This software is provided 'as-is', without any express or implied warranty. 7 | In no event will the authors be held liable for any damages arising from 8 | the use of this software. 9 | 10 | Permission is granted to anyone to use this software for any purpose, including 11 | commercial applications, and to alter it and redistribute it freely, subject to 12 | the following restrictions: 13 | 14 | 1. The origin of this software must not be misrepresented; you must not 15 | claim that you wrote the original software. If you use this software in 16 | a product, an acknowledgment in the product documentation would be 17 | appreciated but is not required. 18 | 19 | 2. Altered source versions must be plainly marked as such, and must not be 20 | misrepresented as being the original software. 21 | 22 | 3. This notice may not be removed or altered from any source distribution. 23 | 24 | http://opensource.org/licenses/Zlib 25 | 26 | http://sourceforge.jp/projects/opensource/wiki/licenses%2Fzlib_libpng_license 27 | */ 28 | #ifndef HORIZONTAL_RULER 29 | #define HORIZONTAL_RULER 30 | 31 | #include "PluginInterface.h" 32 | #include "Scintilla.h" 33 | 34 | LRESULT CALLBACK RulerWndProc( HWND hwnd, UINT uMsg, WPARAM wParam, 35 | LPARAM lParam ); 36 | 37 | class HorizontalRuler 38 | { 39 | private: 40 | int nTopMargin; 41 | int nCharWidth; 42 | int nCharHeight; 43 | int nMarginWidth; 44 | 45 | int nScintillaFrameSize; 46 | int nScintillaYFrameSize; 47 | int nScintillaXFrameSize; 48 | 49 | int nInitClientY; 50 | int nInitClientX; 51 | int nInitWidth; 52 | int nInitHeight; 53 | 54 | int x; 55 | int y; 56 | int width; 57 | int height; 58 | HFONT hFont; 59 | HWND nppHwnd; 60 | HWND scintillaHwnd; 61 | HWND tabHwnd; 62 | 63 | RECT rulerRect; 64 | RECT rulerDesctopRect; 65 | int nDrawStartX; 66 | 67 | //無効・有効 68 | int enable; 69 | public: 70 | int nFontSize; 71 | bool bFontFix; 72 | bool bRulerStart; 73 | 74 | HorizontalRuler(); 75 | ~HorizontalRuler(); 76 | 77 | void HorizontalRuler::Init( HWND npp, HWND scintilla, HWND tab ); 78 | int IsInit(); 79 | int GetEnable() 80 | { 81 | return this->enable; 82 | }; 83 | void SetEnable( int flag ) 84 | { 85 | this->enable = flag; 86 | }; 87 | 88 | void doVisible(); 89 | 90 | void GetInitPos(); 91 | void GetRuleArea(); 92 | void SecureArea(); 93 | void PaintRuler(); 94 | Sci_Position GetCaretPos(); 95 | 96 | void SendSizeToMain(); 97 | 98 | bool HitDrawArea( int x, int y ); 99 | int EdgeLine( int x, int y ); 100 | int MultiEdgeLine( int x, bool multiEdgeOn ); 101 | }; 102 | 103 | #endif -------------------------------------------------------------------------------- /Ini.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is: 3 | The zlib/libpng License 4 | Copyright (c) 2012 freesftys 5 | 6 | This software is provided 'as-is', without any express or implied warranty. 7 | In no event will the authors be held liable for any damages arising from 8 | the use of this software. 9 | 10 | Permission is granted to anyone to use this software for any purpose, including 11 | commercial applications, and to alter it and redistribute it freely, subject to 12 | the following restrictions: 13 | 14 | 1. The origin of this software must not be misrepresented; you must not 15 | claim that you wrote the original software. If you use this software in 16 | a product, an acknowledgment in the product documentation would be 17 | appreciated but is not required. 18 | 19 | 2. Altered source versions must be plainly marked as such, and must not be 20 | misrepresented as being the original software. 21 | 22 | 3. This notice may not be removed or altered from any source distribution. 23 | 24 | http://opensource.org/licenses/Zlib 25 | 26 | http://sourceforge.jp/projects/opensource/wiki/licenses%2Fzlib_libpng_license 27 | */ 28 | 29 | #include "Ini.h" 30 | 31 | extern TCHAR NPP_PLUGIN_NAME[]; 32 | 33 | Ini::Ini() : 34 | inited( 0 ), 35 | fileName( _T( "ColumnTools.ini" ) ) 36 | { 37 | 38 | } 39 | 40 | Ini::~Ini() 41 | { 42 | 43 | } 44 | 45 | int Ini::setIniPath( const TCHAR *setPath ) 46 | { 47 | 48 | int flag; 49 | 50 | if ( this->inited != 0 ) 51 | return 0; 52 | 53 | //_tcscat_s(this->fileName, MAX_PATH, _T("HorizontalRuler.ini")); 54 | 55 | if ( setPath == NULL ) 56 | { 57 | //int SetExecuteCurrentPath() 58 | //{ 59 | // //wchar_t t[MAX_PATH]; 60 | // //GetCurrentDirectory(MAX_PATH, t); 61 | // wchar_t wcExePath[MAX_PATH]; 62 | // wchar_t *pwcLastDirectory; 63 | // GetModuleFileName(NULL, wcExePath, _MAX_PATH); 64 | // pwcLastDirectory = wcsrchr(wcExePath, L'\\'); 65 | // *pwcLastDirectory = L'\0'; 66 | // SetCurrentDirectory(wcExePath); 67 | // 68 | // return 0; 69 | //} 70 | TCHAR *ptsLastDirectory; 71 | GetModuleFileName( NULL, this->path, _MAX_PATH ); 72 | ptsLastDirectory = _tcsrchr( this->path, _T( '\\' ) ); 73 | *ptsLastDirectory = _T( '\0' ); 74 | } 75 | else 76 | { 77 | flag = _tcscpy_s( this->path, MAX_PATH, setPath ); 78 | 79 | if ( flag != 0 ) 80 | return flag; 81 | } 82 | 83 | flag = _tcscpy_s( this->fullPath, MAX_PATH, this->path ); 84 | 85 | if ( flag != 0 ) 86 | return flag; 87 | 88 | flag = _tcscat_s( this->fullPath, MAX_PATH, _T( "\\" ) ); 89 | 90 | if ( flag != 0 ) 91 | return flag; 92 | 93 | flag = _tcscat_s( this->fullPath, MAX_PATH, this->fileName ); 94 | 95 | if ( flag != 0 ) 96 | return flag; 97 | 98 | //int SetIniPath(wchar_t *wcSetStr, int nStrSize) 99 | //{ 100 | // int flag; 101 | // wchar_t wcExePath[MAX_PATH]; 102 | // wchar_t *pwcLastDirectory; 103 | // GetModuleFileName(NULL, wcExePath, _MAX_PATH); 104 | // pwcLastDirectory = wcsrchr(wcExePath, L'\\'); 105 | // *pwcLastDirectory = L'\0'; 106 | // flag = wcscat_s(wcExePath, (size_t)nStrSize, L"\\"); 107 | // if(flag != 0) return flag; 108 | // flag = wcscat_s(wcExePath, (size_t)nStrSize, FILENAME); 109 | // if(flag != 0) return flag; 110 | // 111 | // flag = wcscpy_s(wcSetStr, (size_t)nStrSize, wcExePath); 112 | // 113 | // return flag; 114 | //} 115 | this->inited = 1; 116 | return 1; 117 | } 118 | 119 | int Ini::checkIniFile() 120 | { 121 | FILE *fp = NULL; 122 | errno_t error; 123 | 124 | error = _tfopen_s( &fp, this->fullPath, _T( "r" ) ); 125 | 126 | if ( error != 0 ) 127 | return 0; 128 | 129 | fclose( fp ); 130 | //int CheckIniFile(wchar_t *pwsIniPath) 131 | //{ 132 | // FILE *fp; 133 | // int error; 134 | // error = _wfopen_s(&fp, pwsIniPath, L"r"); 135 | // if( error != 0) 136 | // { 137 | // DefalutIniMake(pwsIniPath); 138 | // return 1; 139 | // } 140 | // fclose(fp); 141 | // 142 | // return 0; 143 | //} 144 | return 1; 145 | } 146 | 147 | int Ini::defaultIni() 148 | { 149 | //int DefalutIniMake(wchar_t *filePath) 150 | //{ 151 | // return 0; 152 | //} 153 | return 1; 154 | } 155 | 156 | int Ini::writeDate( const TCHAR *section, const TCHAR *key, float data ) 157 | { 158 | TCHAR buf[NUMDIGIT]; 159 | _stprintf_s( buf, NUMDIGIT, _T( "%f" ), data ); 160 | return ( int )WritePrivateProfileString( section, key, buf, 161 | this->fullPath ); 162 | } 163 | 164 | int Ini::writeDate( const TCHAR *section, const TCHAR *key, int data ) 165 | { 166 | TCHAR buf[NUMDIGIT]; 167 | _itot_s( data, buf, NUMDIGIT, 10 ); 168 | return ( int )WritePrivateProfileString( section, key, buf, 169 | this->fullPath ); 170 | } 171 | 172 | int Ini::writeDate( const TCHAR *section, const TCHAR *key, 173 | const TCHAR *data ) 174 | { 175 | return ( int )WritePrivateProfileString( section, key, data, 176 | this->fullPath ); 177 | } 178 | 179 | int Ini::readDate( const TCHAR *section, const TCHAR *key, TCHAR *data, 180 | int dataSize ) 181 | { 182 | return ( int )GetPrivateProfileString( section, key, L"", data, 183 | ( DWORD )dataSize, this->fullPath ); 184 | } 185 | 186 | int Ini::readDate( const TCHAR *section, const TCHAR *key, int *data ) 187 | { 188 | TCHAR buf[NUMDIGIT]; 189 | int readSize; 190 | readSize = ( int )GetPrivateProfileString( section, key, L"", buf, 191 | ( DWORD )NUMDIGIT, this->fullPath ); 192 | 193 | if ( ( readSize == ( NUMDIGIT - 1 ) ) || ( readSize == ( NUMDIGIT - 2 ) ) ) 194 | { 195 | *data = 0; 196 | return 0; 197 | } 198 | 199 | *data = _ttoi( buf ); 200 | 201 | return readSize; 202 | } 203 | 204 | int Ini::readDate( const TCHAR *section, const TCHAR *key, float *data ) 205 | { 206 | TCHAR buf[NUMDIGIT]; 207 | int readSize; 208 | readSize = ( int )GetPrivateProfileString( section, key, L"", buf, 209 | ( DWORD )NUMDIGIT, this->fullPath ); 210 | 211 | if ( ( readSize == ( NUMDIGIT - 1 ) ) || ( readSize == ( NUMDIGIT - 2 ) ) ) 212 | { 213 | *data = 0; 214 | return 0; 215 | } 216 | 217 | *data = ( float )_tstof( buf ); 218 | 219 | return readSize; 220 | } 221 | -------------------------------------------------------------------------------- /Ini.h: -------------------------------------------------------------------------------- 1 | /* 2 | This file is: 3 | The zlib/libpng License 4 | Copyright (c) 2012 freesftys 5 | 6 | This software is provided 'as-is', without any express or implied warranty. 7 | In no event will the authors be held liable for any damages arising from 8 | the use of this software. 9 | 10 | Permission is granted to anyone to use this software for any purpose, including 11 | commercial applications, and to alter it and redistribute it freely, subject to 12 | the following restrictions: 13 | 14 | 1. The origin of this software must not be misrepresented; you must not 15 | claim that you wrote the original software. If you use this software in 16 | a product, an acknowledgment in the product documentation would be 17 | appreciated but is not required. 18 | 19 | 2. Altered source versions must be plainly marked as such, and must not be 20 | misrepresented as being the original software. 21 | 22 | 3. This notice may not be removed or altered from any source distribution. 23 | 24 | http://opensource.org/licenses/Zlib 25 | 26 | http://sourceforge.jp/projects/opensource/wiki/licenses%2Fzlib_libpng_license 27 | */ 28 | 29 | 30 | #ifndef INI_H 31 | #define INI_H 32 | 33 | #include 34 | #include 35 | #include 36 | 37 | #define NUMDIGIT 64 38 | class Ini 39 | { 40 | private: 41 | TCHAR path[MAX_PATH]; 42 | const TCHAR *fileName; 43 | TCHAR fullPath[MAX_PATH]; 44 | 45 | Ini(); 46 | ~Ini(); 47 | 48 | public: 49 | static Ini *getInstance() 50 | { 51 | static Ini _ini; 52 | return &_ini; 53 | } 54 | 55 | TCHAR *getPath() 56 | { 57 | return this->path; 58 | }; 59 | const TCHAR *getFileName() 60 | { 61 | return this->fileName; 62 | }; 63 | TCHAR *getFullPath() 64 | { 65 | return this->fullPath; 66 | }; 67 | 68 | int inited; 69 | int setIniPath( const TCHAR *path ); 70 | int checkIniFile(); 71 | int defaultIni(); 72 | int writeDate( const TCHAR *section, const TCHAR *key, int data ); 73 | int writeDate( const TCHAR *section, const TCHAR *key, float data ); 74 | int writeDate( const TCHAR *section, const TCHAR *key, const TCHAR *data ); 75 | int readDate( const TCHAR *section, const TCHAR *key, TCHAR *data, 76 | int dataSize ); 77 | int readDate( const TCHAR *section, const TCHAR *key, int *data ); 78 | int readDate( const TCHAR *section, const TCHAR *key, float *data ); 79 | }; 80 | 81 | #endif -------------------------------------------------------------------------------- /Notepad_plus_msgs.h: -------------------------------------------------------------------------------- 1 | //this file is part of notepad++ 2 | //Copyright (C)2003 Don HO 3 | // 4 | //This program is free software; you can redistribute it and/or 5 | //modify it under the terms of the GNU General Public License 6 | //as published by the Free Software Foundation; either 7 | //version 2 of the License, or (at your option) any later version. 8 | // 9 | //This program is distributed in the hope that it will be useful, 10 | //but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | //MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | //GNU General Public License for more details. 13 | // 14 | //You should have received a copy of the GNU General Public License 15 | //along with this program; if not, write to the Free Software 16 | //Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 17 | 18 | #ifndef NOTEPAD_PLUS_MSGS_H 19 | #define NOTEPAD_PLUS_MSGS_H 20 | 21 | //#include "menuCmdID.h" 22 | 23 | enum LangType {L_TXT, L_PHP , L_C, L_CPP, L_CS, L_OBJC, L_JAVA, L_RC,\ 24 | L_HTML, L_XML, L_MAKEFILE, L_PASCAL, L_BATCH, L_INI, L_NFO, L_USER,\ 25 | L_ASP, L_SQL, L_VB, L_JS, L_CSS, L_PERL, L_PYTHON, L_LUA,\ 26 | L_TEX, L_FORTRAN, L_BASH, L_FLASH, L_NSIS, L_TCL, L_LISP, L_SCHEME,\ 27 | L_ASM, L_DIFF, L_PROPS, L_PS, L_RUBY, L_SMALLTALK, L_VHDL, L_KIX, L_AU3,\ 28 | L_CAML, L_ADA, L_VERILOG, L_MATLAB, L_HASKELL, L_INNO, L_SEARCHRESULT,\ 29 | L_CMAKE, L_YAML,\ 30 | // The end of enumated language type, so it should be always at the end 31 | L_EXTERNAL}; 32 | enum winVer{WV_UNKNOWN, WV_WIN32S, WV_95, WV_98, WV_ME, WV_NT, WV_W2K, WV_XP, WV_S2003, WV_XPX64, WV_VISTA, WV_WIN7}; 33 | 34 | 35 | //#include "deprecatedSymbols.h" 36 | 37 | //Here you can find how to use these messages : http://notepad-plus.sourceforge.net/uk/plugins-HOWTO.php 38 | #define NPPMSG (WM_USER + 1000) 39 | 40 | #define NPPM_GETCURRENTSCINTILLA (NPPMSG + 4) 41 | #define NPPM_GETCURRENTLANGTYPE (NPPMSG + 5) 42 | #define NPPM_SETCURRENTLANGTYPE (NPPMSG + 6) 43 | 44 | #define NPPM_GETNBOPENFILES (NPPMSG + 7) 45 | #define ALL_OPEN_FILES 0 46 | #define PRIMARY_VIEW 1 47 | #define SECOND_VIEW 2 48 | 49 | #define NPPM_GETOPENFILENAMES (NPPMSG + 8) 50 | 51 | 52 | #define NPPM_MODELESSDIALOG (NPPMSG + 12) 53 | #define MODELESSDIALOGADD 0 54 | #define MODELESSDIALOGREMOVE 1 55 | 56 | #define NPPM_GETNBSESSIONFILES (NPPMSG + 13) 57 | #define NPPM_GETSESSIONFILES (NPPMSG + 14) 58 | #define NPPM_SAVESESSION (NPPMSG + 15) 59 | #define NPPM_SAVECURRENTSESSION (NPPMSG + 16) 60 | 61 | struct sessionInfo { 62 | TCHAR* sessionFilePathName; 63 | int nbFile; 64 | TCHAR** files; 65 | }; 66 | 67 | #define NPPM_GETOPENFILENAMESPRIMARY (NPPMSG + 17) 68 | #define NPPM_GETOPENFILENAMESSECOND (NPPMSG + 18) 69 | 70 | #define NPPM_CREATESCINTILLAHANDLE (NPPMSG + 20) 71 | #define NPPM_DESTROYSCINTILLAHANDLE (NPPMSG + 21) 72 | #define NPPM_GETNBUSERLANG (NPPMSG + 22) 73 | 74 | #define NPPM_GETCURRENTDOCINDEX (NPPMSG + 23) 75 | #define MAIN_VIEW 0 76 | #define SUB_VIEW 1 77 | 78 | #define NPPM_SETSTATUSBAR (NPPMSG + 24) 79 | #define STATUSBAR_DOC_TYPE 0 80 | #define STATUSBAR_DOC_SIZE 1 81 | #define STATUSBAR_CUR_POS 2 82 | #define STATUSBAR_EOF_FORMAT 3 83 | #define STATUSBAR_UNICODE_TYPE 4 84 | #define STATUSBAR_TYPING_MODE 5 85 | 86 | #define NPPM_GETMENUHANDLE (NPPMSG + 25) 87 | #define NPPPLUGINMENU 0 88 | 89 | #define NPPM_ENCODESCI (NPPMSG + 26) 90 | //ascii file to unicode 91 | //int NPPM_ENCODESCI(MAIN_VIEW/SUB_VIEW, 0) 92 | //return new unicodeMode 93 | 94 | #define NPPM_DECODESCI (NPPMSG + 27) 95 | //unicode file to ascii 96 | //int NPPM_DECODESCI(MAIN_VIEW/SUB_VIEW, 0) 97 | //return old unicodeMode 98 | 99 | #define NPPM_ACTIVATEDOC (NPPMSG + 28) 100 | //void NPPM_ACTIVATEDOC(int view, int index2Activate) 101 | 102 | #define NPPM_LAUNCHFINDINFILESDLG (NPPMSG + 29) 103 | //void NPPM_LAUNCHFINDINFILESDLG(TCHAR * dir2Search, TCHAR * filtre) 104 | 105 | #define NPPM_DMMSHOW (NPPMSG + 30) 106 | #define NPPM_DMMHIDE (NPPMSG + 31) 107 | #define NPPM_DMMUPDATEDISPINFO (NPPMSG + 32) 108 | //void NPPM_DMMxxx(0, tTbData->hClient) 109 | 110 | #define NPPM_DMMREGASDCKDLG (NPPMSG + 33) 111 | //void NPPM_DMMREGASDCKDLG(0, &tTbData) 112 | 113 | #define NPPM_LOADSESSION (NPPMSG + 34) 114 | //void NPPM_LOADSESSION(0, const TCHAR* file name) 115 | 116 | #define NPPM_DMMVIEWOTHERTAB (NPPMSG + 35) 117 | //void WM_DMM_VIEWOTHERTAB(0, tTbData->pszName) 118 | 119 | #define NPPM_RELOADFILE (NPPMSG + 36) 120 | //BOOL NPPM_RELOADFILE(BOOL withAlert, TCHAR *filePathName2Reload) 121 | 122 | #define NPPM_SWITCHTOFILE (NPPMSG + 37) 123 | //BOOL NPPM_SWITCHTOFILE(0, TCHAR *filePathName2switch) 124 | 125 | #define NPPM_SAVECURRENTFILE (NPPMSG + 38) 126 | //BOOL WM_SWITCHTOFILE(0, 0) 127 | 128 | #define NPPM_SAVEALLFILES (NPPMSG + 39) 129 | //BOOL NPPM_SAVEALLFILES(0, 0) 130 | 131 | #define NPPM_SETMENUITEMCHECK (NPPMSG + 40) 132 | //void WM_PIMENU_CHECK(UINT funcItem[X]._cmdID, TRUE/FALSE) 133 | 134 | #define NPPM_ADDTOOLBARICON (NPPMSG + 41) 135 | //void WM_ADDTOOLBARICON(UINT funcItem[X]._cmdID, toolbarIcons icon) 136 | struct toolbarIcons { 137 | HBITMAP hToolbarBmp; 138 | HICON hToolbarIcon; 139 | }; 140 | 141 | #define NPPM_GETWINDOWSVERSION (NPPMSG + 42) 142 | //winVer NPPM_GETWINDOWSVERSION(0, 0) 143 | 144 | #define NPPM_DMMGETPLUGINHWNDBYNAME (NPPMSG + 43) 145 | //HWND WM_DMM_GETPLUGINHWNDBYNAME(const TCHAR *windowName, const TCHAR *moduleName) 146 | // if moduleName is NULL, then return value is NULL 147 | // if windowName is NULL, then the first found window handle which matches with the moduleName will be returned 148 | 149 | #define NPPM_MAKECURRENTBUFFERDIRTY (NPPMSG + 44) 150 | //BOOL NPPM_MAKECURRENTBUFFERDIRTY(0, 0) 151 | 152 | #define NPPM_GETENABLETHEMETEXTUREFUNC (NPPMSG + 45) 153 | //BOOL NPPM_GETENABLETHEMETEXTUREFUNC(0, 0) 154 | 155 | #define NPPM_GETPLUGINSCONFIGDIR (NPPMSG + 46) 156 | //void NPPM_GETPLUGINSCONFIGDIR(int strLen, TCHAR *str) 157 | 158 | #define NPPM_MSGTOPLUGIN (NPPMSG + 47) 159 | //BOOL NPPM_MSGTOPLUGIN(TCHAR *destModuleName, CommunicationInfo *info) 160 | // return value is TRUE when the message arrive to the destination plugins. 161 | // if destModule or info is NULL, then return value is FALSE 162 | struct CommunicationInfo { 163 | long internalMsg; 164 | const TCHAR * srcModuleName; 165 | void * info; // defined by plugin 166 | }; 167 | 168 | #define NPPM_MENUCOMMAND (NPPMSG + 48) 169 | //void NPPM_MENUCOMMAND(0, int cmdID) 170 | // uncomment //#include "menuCmdID.h" 171 | // in the beginning of this file then use the command symbols defined in "menuCmdID.h" file 172 | // to access all the Notepad++ menu command items 173 | 174 | #define NPPM_TRIGGERTABBARCONTEXTMENU (NPPMSG + 49) 175 | //void NPPM_TRIGGERTABBARCONTEXTMENU(int view, int index2Activate) 176 | 177 | #define NPPM_GETNPPVERSION (NPPMSG + 50) 178 | // int NPPM_GETNPPVERSION(0, 0) 179 | // return version 180 | // ex : v4.6 181 | // HIWORD(version) == 4 182 | // LOWORD(version) == 6 183 | 184 | #define NPPM_HIDETABBAR (NPPMSG + 51) 185 | // BOOL NPPM_HIDETABBAR(0, BOOL hideOrNot) 186 | // if hideOrNot is set as TRUE then tab bar will be hidden 187 | // otherwise it'll be shown. 188 | // return value : the old status value 189 | 190 | #define NPPM_ISTABBARHIDDEN (NPPMSG + 52) 191 | // BOOL NPPM_ISTABBARHIDDEN(0, 0) 192 | // returned value : TRUE if tab bar is hidden, otherwise FALSE 193 | 194 | #define NPPM_GETPOSFROMBUFFERID (NPPMSG + 57) 195 | // INT NPPM_GETPOSFROMBUFFERID(INT bufferID, 0) 196 | // Return VIEW|INDEX from a buffer ID. -1 if the bufferID non existing 197 | // 198 | // VIEW takes 2 highest bits and INDEX (0 based) takes the rest (30 bits) 199 | // Here's the values for the view : 200 | // MAIN_VIEW 0 201 | // SUB_VIEW 1 202 | 203 | #define NPPM_GETFULLPATHFROMBUFFERID (NPPMSG + 58) 204 | // INT NPPM_GETFULLPATHFROMBUFFERID(INT bufferID, TCHAR *fullFilePath) 205 | // Get full path file name from a bufferID. 206 | // Return -1 if the bufferID non existing, otherwise the number of TCHAR copied/to copy 207 | // User should call it with fullFilePath be NULL to get the number of TCHAR (not including the nul character), 208 | // allocate fullFilePath with the return values + 1, then call it again to get full path file name 209 | 210 | #define NPPM_GETBUFFERIDFROMPOS (NPPMSG + 59) 211 | //wParam: Position of document 212 | //lParam: View to use, 0 = Main, 1 = Secondary 213 | //Returns 0 if invalid 214 | 215 | #define NPPM_GETCURRENTBUFFERID (NPPMSG + 60) 216 | //Returns active Buffer 217 | 218 | #define NPPM_RELOADBUFFERID (NPPMSG + 61) 219 | //Reloads Buffer 220 | //wParam: Buffer to reload 221 | //lParam: 0 if no alert, else alert 222 | 223 | 224 | #define NPPM_GETBUFFERLANGTYPE (NPPMSG + 64) 225 | //wParam: BufferID to get LangType from 226 | //lParam: 0 227 | //Returns as int, see LangType. -1 on error 228 | 229 | #define NPPM_SETBUFFERLANGTYPE (NPPMSG + 65) 230 | //wParam: BufferID to set LangType of 231 | //lParam: LangType 232 | //Returns TRUE on success, FALSE otherwise 233 | //use int, see LangType for possible values 234 | //L_USER and L_EXTERNAL are not supported 235 | 236 | #define NPPM_GETBUFFERENCODING (NPPMSG + 66) 237 | //wParam: BufferID to get encoding from 238 | //lParam: 0 239 | //returns as int, see UniMode. -1 on error 240 | 241 | #define NPPM_SETBUFFERENCODING (NPPMSG + 67) 242 | //wParam: BufferID to set encoding of 243 | //lParam: format 244 | //Returns TRUE on success, FALSE otherwise 245 | //use int, see UniMode 246 | //Can only be done on new, unedited files 247 | 248 | #define NPPM_GETBUFFERFORMAT (NPPMSG + 68) 249 | //wParam: BufferID to get format from 250 | //lParam: 0 251 | //returns as int, see formatType. -1 on error 252 | 253 | #define NPPM_SETBUFFERFORMAT (NPPMSG + 69) 254 | //wParam: BufferID to set format of 255 | //lParam: format 256 | //Returns TRUE on success, FALSE otherwise 257 | //use int, see formatType 258 | 259 | /* 260 | #define NPPM_ADDREBAR (NPPMSG + 57) 261 | // BOOL NPPM_ADDREBAR(0, REBARBANDINFO *) 262 | // Returns assigned ID in wID value of struct pointer 263 | #define NPPM_UPDATEREBAR (NPPMSG + 58) 264 | // BOOL NPPM_ADDREBAR(INT ID, REBARBANDINFO *) 265 | //Use ID assigned with NPPM_ADDREBAR 266 | #define NPPM_REMOVEREBAR (NPPMSG + 59) 267 | // BOOL NPPM_ADDREBAR(INT ID, 0) 268 | //Use ID assigned with NPPM_ADDREBAR 269 | */ 270 | 271 | #define NPPM_HIDETOOLBAR (NPPMSG + 70) 272 | // BOOL NPPM_HIDETOOLBAR(0, BOOL hideOrNot) 273 | // if hideOrNot is set as TRUE then tool bar will be hidden 274 | // otherwise it'll be shown. 275 | // return value : the old status value 276 | 277 | #define NPPM_ISTOOLBARHIDDEN (NPPMSG + 71) 278 | // BOOL NPPM_ISTOOLBARHIDDEN(0, 0) 279 | // returned value : TRUE if tool bar is hidden, otherwise FALSE 280 | 281 | #define NPPM_HIDEMENU (NPPMSG + 72) 282 | // BOOL NPPM_HIDEMENU(0, BOOL hideOrNot) 283 | // if hideOrNot is set as TRUE then menu will be hidden 284 | // otherwise it'll be shown. 285 | // return value : the old status value 286 | 287 | #define NPPM_ISMENUHIDDEN (NPPMSG + 73) 288 | // BOOL NPPM_ISMENUHIDDEN(0, 0) 289 | // returned value : TRUE if menu is hidden, otherwise FALSE 290 | 291 | #define NPPM_HIDESTATUSBAR (NPPMSG + 74) 292 | // BOOL NPPM_HIDESTATUSBAR(0, BOOL hideOrNot) 293 | // if hideOrNot is set as TRUE then STATUSBAR will be hidden 294 | // otherwise it'll be shown. 295 | // return value : the old status value 296 | 297 | #define NPPM_ISSTATUSBARHIDDEN (NPPMSG + 75) 298 | // BOOL NPPM_ISSTATUSBARHIDDEN(0, 0) 299 | // returned value : TRUE if STATUSBAR is hidden, otherwise FALSE 300 | 301 | #define NPPM_GETSHORTCUTBYCMDID (NPPMSG + 76) 302 | // BOOL NPPM_GETSHORTCUTBYCMDID(int cmdID, ShortcutKey *sk) 303 | // get your plugin command current mapped shortcut into sk via cmdID 304 | // You may need it after getting NPPN_READY notification 305 | // returned value : TRUE if this function call is successful and shorcut is enable, otherwise FALSE 306 | 307 | #define NPPM_DOOPEN (NPPMSG + 77) 308 | // BOOL NPPM_DOOPEN(0, const TCHAR *fullPathName2Open) 309 | // fullPathName2Open indicates the full file path name to be opened. 310 | // The return value is TRUE (1) if the operation is successful, otherwise FALSE (0). 311 | 312 | #define RUNCOMMAND_USER (WM_USER + 3000) 313 | #define NPPM_GETFULLCURRENTPATH (RUNCOMMAND_USER + FULL_CURRENT_PATH) 314 | #define NPPM_GETCURRENTDIRECTORY (RUNCOMMAND_USER + CURRENT_DIRECTORY) 315 | #define NPPM_GETFILENAME (RUNCOMMAND_USER + FILE_NAME) 316 | #define NPPM_GETNAMEPART (RUNCOMMAND_USER + NAME_PART) 317 | #define NPPM_GETEXTPART (RUNCOMMAND_USER + EXT_PART) 318 | #define NPPM_GETCURRENTWORD (RUNCOMMAND_USER + CURRENT_WORD) 319 | #define NPPM_GETNPPDIRECTORY (RUNCOMMAND_USER + NPP_DIRECTORY) 320 | // BOOL NPPM_GETXXXXXXXXXXXXXXXX(size_t strLen, TCHAR *str) 321 | // where str is the allocated TCHAR array, 322 | // strLen is the allocated array size 323 | // The return value is TRUE when get generic_string operation success 324 | // Otherwise (allocated array size is too small) FALSE 325 | 326 | #define NPPM_GETCURRENTLINE (RUNCOMMAND_USER + CURRENT_LINE) 327 | // INT NPPM_GETCURRENTLINE(0, 0) 328 | // return the caret current position line 329 | #define NPPM_GETCURRENTCOLUMN (RUNCOMMAND_USER + CURRENT_COLUMN) 330 | // INT NPPM_GETCURRENTCOLUMN(0, 0) 331 | // return the caret current position column 332 | 333 | #define VAR_NOT_RECOGNIZED 0 334 | #define FULL_CURRENT_PATH 1 335 | #define CURRENT_DIRECTORY 2 336 | #define FILE_NAME 3 337 | #define NAME_PART 4 338 | #define EXT_PART 5 339 | #define CURRENT_WORD 6 340 | #define NPP_DIRECTORY 7 341 | #define CURRENT_LINE 8 342 | #define CURRENT_COLUMN 9 343 | 344 | 345 | // Notification code 346 | #define NPPN_FIRST 1000 347 | #define NPPN_READY (NPPN_FIRST + 1) // To notify plugins that all the procedures of launchment of notepad++ are done. 348 | //scnNotification->nmhdr.code = NPPN_READY; 349 | //scnNotification->nmhdr.hwndFrom = hwndNpp; 350 | //scnNotification->nmhdr.idFrom = 0; 351 | 352 | #define NPPN_TBMODIFICATION (NPPN_FIRST + 2) // To notify plugins that toolbar icons can be registered 353 | //scnNotification->nmhdr.code = NPPN_TB_MODIFICATION; 354 | //scnNotification->nmhdr.hwndFrom = hwndNpp; 355 | //scnNotification->nmhdr.idFrom = 0; 356 | 357 | #define NPPN_FILEBEFORECLOSE (NPPN_FIRST + 3) // To notify plugins that the current file is about to be closed 358 | //scnNotification->nmhdr.code = NPPN_FILEBEFORECLOSE; 359 | //scnNotification->nmhdr.hwndFrom = hwndNpp; 360 | //scnNotification->nmhdr.idFrom = BufferID; 361 | 362 | #define NPPN_FILEOPENED (NPPN_FIRST + 4) // To notify plugins that the current file is just opened 363 | //scnNotification->nmhdr.code = NPPN_FILEOPENED; 364 | //scnNotification->nmhdr.hwndFrom = hwndNpp; 365 | //scnNotification->nmhdr.idFrom = BufferID; 366 | 367 | #define NPPN_FILECLOSED (NPPN_FIRST + 5) // To notify plugins that the current file is just closed 368 | //scnNotification->nmhdr.code = NPPN_FILECLOSED; 369 | //scnNotification->nmhdr.hwndFrom = hwndNpp; 370 | //scnNotification->nmhdr.idFrom = BufferID; 371 | 372 | #define NPPN_FILEBEFOREOPEN (NPPN_FIRST + 6) // To notify plugins that the current file is about to be opened 373 | //scnNotification->nmhdr.code = NPPN_FILEBEFOREOPEN; 374 | //scnNotification->nmhdr.hwndFrom = hwndNpp; 375 | //scnNotification->nmhdr.idFrom = BufferID; 376 | 377 | #define NPPN_FILEBEFORESAVE (NPPN_FIRST + 7) // To notify plugins that the current file is about to be saved 378 | //scnNotification->nmhdr.code = NPPN_FILEBEFOREOPEN; 379 | //scnNotification->nmhdr.hwndFrom = hwndNpp; 380 | //scnNotification->nmhdr.idFrom = BufferID; 381 | 382 | #define NPPN_FILESAVED (NPPN_FIRST + 8) // To notify plugins that the current file is just saved 383 | //scnNotification->nmhdr.code = NPPN_FILESAVED; 384 | //scnNotification->nmhdr.hwndFrom = hwndNpp; 385 | //scnNotification->nmhdr.idFrom = BufferID; 386 | 387 | #define NPPN_SHUTDOWN (NPPN_FIRST + 9) // To notify plugins that Notepad++ is about to be shutdowned. 388 | //scnNotification->nmhdr.code = NPPN_SHUTDOWN; 389 | //scnNotification->nmhdr.hwndFrom = hwndNpp; 390 | //scnNotification->nmhdr.idFrom = 0; 391 | 392 | #define NPPN_BUFFERACTIVATED (NPPN_FIRST + 10) // To notify plugins that a buffer was activated (put to foreground). 393 | //scnNotification->nmhdr.code = NPPN_BUFFERACTIVATED; 394 | //scnNotification->nmhdr.hwndFrom = hwndNpp; 395 | //scnNotification->nmhdr.idFrom = activatedBufferID; 396 | 397 | #define NPPN_LANGCHANGED (NPPN_FIRST + 11) // To notify plugins that the language in the current doc is just changed. 398 | //scnNotification->nmhdr.code = NPPN_LANGCHANGED; 399 | //scnNotification->nmhdr.hwndFrom = hwndNpp; 400 | //scnNotification->nmhdr.idFrom = currentBufferID; 401 | 402 | #define NPPN_WORDSTYLESUPDATED (NPPN_FIRST + 12) // To notify plugins that user initiated a WordStyleDlg change. 403 | //scnNotification->nmhdr.code = NPPN_WORDSTYLESUPDATED; 404 | //scnNotification->nmhdr.hwndFrom = hwndNpp; 405 | //scnNotification->nmhdr.idFrom = currentBufferID; 406 | 407 | #define NPPN_SHORTCUTREMAPPED (NPPN_FIRST + 13) // To notify plugins that plugin command shortcut is remapped. 408 | //scnNotification->nmhdr.code = NPPN_SHORTCUTSREMAPPED; 409 | //scnNotification->nmhdr.hwndFrom = ShortcutKeyStructurePointer; 410 | //scnNotification->nmhdr.idFrom = cmdID; 411 | //where ShortcutKeyStructurePointer is pointer of struct ShortcutKey: 412 | //struct ShortcutKey { 413 | // bool _isCtrl; 414 | // bool _isAlt; 415 | // bool _isShift; 416 | // UCHAR _key; 417 | //}; 418 | 419 | #define NPPN_FILEBEFORELOAD (NPPN_FIRST + 14) // To notify plugins that the current file is about to be loaded 420 | //scnNotification->nmhdr.code = NPPN_FILEBEFOREOPEN; 421 | //scnNotification->nmhdr.hwndFrom = hwndNpp; 422 | //scnNotification->nmhdr.idFrom = NULL; 423 | 424 | #define NPPN_FILELOADFAILED (NPPN_FIRST + 15) // To notify plugins that file open operation failed 425 | //scnNotification->nmhdr.code = NPPN_FILEOPENFAILED; 426 | //scnNotification->nmhdr.hwndFrom = hwndNpp; 427 | //scnNotification->nmhdr.idFrom = BufferID; 428 | 429 | #define NPPN_READONLYCHANGED (NPPN_FIRST + 16) // To notify plugins that current document change the readonly status, 430 | //scnNotification->nmhdr.code = NPPN_READONLYCHANGED; 431 | //scnNotification->nmhdr.hwndFrom = bufferID; 432 | //scnNotification->nmhdr.idFrom = docStatus; 433 | // where bufferID is BufferID 434 | // docStatus can be combined by DOCSTAUS_READONLY and DOCSTAUS_BUFFERDIRTY 435 | 436 | #define DOCSTAUS_READONLY 1 437 | #define DOCSTAUS_BUFFERDIRTY 2 438 | 439 | #define NPPN_DOCORDERCHANGED (NPPN_FIRST + 16) // To notify plugins that document order is changed 440 | //scnNotification->nmhdr.code = NPPN_DOCORDERCHANGED; 441 | //scnNotification->nmhdr.hwndFrom = newIndex; 442 | //scnNotification->nmhdr.idFrom = BufferID; 443 | 444 | #endif //NOTEPAD_PLUS_MSGS_H -------------------------------------------------------------------------------- /NppHorizontalRuler.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is: 3 | The zlib/libpng License 4 | Copyright (c) 2012 freesftys 5 | 6 | This software is provided 'as-is', without any express or implied warranty. 7 | In no event will the authors be held liable for any damages arising from 8 | the use of this software. 9 | 10 | Permission is granted to anyone to use this software for any purpose, including 11 | commercial applications, and to alter it and redistribute it freely, subject to 12 | the following restrictions: 13 | 14 | 1. The origin of this software must not be misrepresented; you must not 15 | claim that you wrote the original software. If you use this software in 16 | a product, an acknowledgment in the product documentation would be 17 | appreciated but is not required. 18 | 19 | 2. Altered source versions must be plainly marked as such, and must not be 20 | misrepresented as being the original software. 21 | 22 | 3. This notice may not be removed or altered from any source distribution. 23 | 24 | http://opensource.org/licenses/Zlib 25 | 26 | http://sourceforge.jp/projects/opensource/wiki/licenses%2Fzlib_libpng_license 27 | */ 28 | 29 | #include "NppHorizontalRuler.h" 30 | #include "HorizontalRuler.h" 31 | #include "PluginDefinition.h" 32 | 33 | #include 34 | #include 35 | #include 36 | 37 | extern NppData nppData; 38 | extern FuncItem funcItem[]; 39 | 40 | HorizontalRuler mainHRuler; 41 | HorizontalRuler subHRuler; 42 | 43 | HWND mainTabHwnd; 44 | WNDPROC mainOldWndProc; 45 | HWND subTabHwnd; 46 | WNDPROC subOldWndProc; 47 | 48 | LRESULT onHorizontalRulerMessageProc( UINT Message, WPARAM wParam, 49 | LPARAM /* lParam */) 50 | { 51 | switch ( Message ) 52 | { 53 | case WM_SIZE: 54 | if ( wParam == SIZE_MINIMIZED ) 55 | break; 56 | 57 | if ( mainHRuler.IsInit() ) 58 | { 59 | mainHRuler.GetInitPos(); 60 | mainHRuler.GetRuleArea(); 61 | mainHRuler.SecureArea(); 62 | mainHRuler.PaintRuler(); 63 | } 64 | 65 | if ( subHRuler.IsInit() ) 66 | { 67 | subHRuler.GetInitPos(); 68 | subHRuler.GetRuleArea(); 69 | subHRuler.SecureArea(); 70 | subHRuler.PaintRuler(); 71 | } 72 | 73 | return TRUE; 74 | } 75 | 76 | return TRUE; 77 | } 78 | 79 | void RulerWndProcSet() 80 | { 81 | mainTabHwnd = FindWindowEx( nppData._nppHandle, NULL, 82 | ( LPCWSTR )L"systabcontrol32", NULL ); 83 | mainOldWndProc = ( WNDPROC )SetWindowLongPtr( mainTabHwnd, GWLP_WNDPROC, 84 | ( LONG_PTR )RulerMainWndProc ); 85 | 86 | subTabHwnd = FindWindowEx( nppData._nppHandle, mainTabHwnd, 87 | ( LPCWSTR )L"systabcontrol32", NULL ); 88 | subOldWndProc = ( WNDPROC )SetWindowLongPtr( subTabHwnd, GWLP_WNDPROC, 89 | ( LONG_PTR )RulerSubWndProc ); 90 | 91 | return; 92 | } 93 | 94 | void RulerWndProcUnset() 95 | { 96 | SetWindowLongPtr( mainTabHwnd, GWLP_WNDPROC, ( LONG_PTR )mainOldWndProc ); 97 | SetWindowLongPtr( subTabHwnd, GWLP_WNDPROC, ( LONG_PTR )subOldWndProc ); 98 | 99 | return; 100 | } 101 | 102 | LRESULT CALLBACK RulerMainWndProc( HWND hwnd, UINT uMsg, WPARAM wParam, 103 | LPARAM lParam ) 104 | { 105 | if ( hwnd == subTabHwnd ) 106 | return CallWindowProc( mainOldWndProc, hwnd, uMsg, wParam, lParam ); 107 | 108 | switch ( uMsg ) 109 | { 110 | case WM_DRAWITEM: 111 | 112 | case WM_PAINT: 113 | if ( mainHRuler.IsInit() ) 114 | mainHRuler.PaintRuler(); 115 | 116 | break; 117 | 118 | case WM_NCLBUTTONDBLCLK: 119 | if ( mainHRuler.IsInit() ) 120 | { 121 | if ( GetKeyState(VK_SHIFT) & 0x8000 ) 122 | mainHRuler.MultiEdgeLine( GET_X_LPARAM( lParam ), true ); 123 | else if ( GetKeyState(VK_CONTROL) & 0x8000 ) 124 | mainHRuler.MultiEdgeLine( GET_X_LPARAM( lParam ), false ); 125 | else 126 | mainHRuler.EdgeLine( GET_X_LPARAM( lParam ), GET_Y_LPARAM( lParam ) ); 127 | } 128 | 129 | break; 130 | 131 | case WM_NCHITTEST: 132 | if ( mainHRuler.IsInit() ) 133 | { 134 | if ( mainHRuler.HitDrawArea( GET_X_LPARAM( lParam ), 135 | GET_Y_LPARAM( lParam ) ) ) 136 | return HTBORDER; 137 | } 138 | 139 | break; 140 | 141 | case TCM_GETIMAGELIST: 142 | if ( mainHRuler.IsInit() ) 143 | { 144 | mainHRuler.GetInitPos(); 145 | mainHRuler.GetRuleArea(); 146 | mainHRuler.SecureArea(); 147 | mainHRuler.PaintRuler(); 148 | } 149 | 150 | break; 151 | 152 | default: 153 | break; 154 | } 155 | 156 | return CallWindowProc( mainOldWndProc, hwnd, uMsg, wParam, lParam ); 157 | } 158 | 159 | LRESULT CALLBACK RulerSubWndProc( HWND hwnd, UINT uMsg, WPARAM wParam, 160 | LPARAM lParam ) 161 | { 162 | if ( hwnd == mainTabHwnd ) 163 | return CallWindowProc( subOldWndProc, hwnd, uMsg, wParam, lParam ); 164 | 165 | switch ( uMsg ) 166 | { 167 | case WM_DRAWITEM: 168 | 169 | case WM_PAINT: 170 | if ( subHRuler.IsInit() ) 171 | subHRuler.PaintRuler(); 172 | 173 | break; 174 | 175 | case WM_NCLBUTTONDBLCLK: 176 | if ( subHRuler.IsInit() ) 177 | { 178 | if ( GetKeyState(VK_SHIFT) & 0x8000 ) 179 | subHRuler.MultiEdgeLine( GET_X_LPARAM( lParam ), true ); 180 | else if ( GetKeyState(VK_CONTROL) & 0x8000 ) 181 | subHRuler.MultiEdgeLine( GET_X_LPARAM( lParam ), false ); 182 | else 183 | subHRuler.EdgeLine( GET_X_LPARAM( lParam ), GET_Y_LPARAM( lParam ) ); 184 | } 185 | 186 | break; 187 | 188 | case WM_NCHITTEST: 189 | if ( subHRuler.IsInit() ) 190 | { 191 | if ( subHRuler.HitDrawArea( GET_X_LPARAM( lParam ), 192 | GET_Y_LPARAM( lParam ) ) ) 193 | return HTBORDER; 194 | } 195 | 196 | break; 197 | 198 | case WM_MOUSEACTIVATE: 199 | return MA_ACTIVATE; 200 | break; 201 | 202 | case TCM_GETIMAGELIST: 203 | if ( subHRuler.IsInit() ) 204 | { 205 | subHRuler.GetInitPos(); 206 | subHRuler.GetRuleArea(); 207 | subHRuler.SecureArea(); 208 | subHRuler.PaintRuler(); 209 | } 210 | 211 | break; 212 | } 213 | 214 | return CallWindowProc( subOldWndProc, hwnd, uMsg, wParam, lParam ); 215 | } 216 | 217 | void ruler( bool enable ) 218 | { 219 | if ( enable ) 220 | { 221 | int iTech = ( int )::SendMessage( getCurScintilla(), SCI_GETTECHNOLOGY, 0 , 0 ); 222 | if ( iTech != SC_TECHNOLOGY_DEFAULT ) 223 | MessageBox( nppData._nppHandle, 224 | TEXT("SC_TECHNOLOGY_DEFAULT not detected!\n\nRuler may not align with text."), 225 | TEXT("SC_TECHNOLOGY_DEFAULT not detected!"), 226 | MB_OK | MB_ICONWARNING ); 227 | 228 | mainHRuler.SetEnable( 1 ); 229 | subHRuler.SetEnable( 1 ); 230 | mainHRuler.SendSizeToMain(); 231 | } 232 | else 233 | { 234 | mainHRuler.SetEnable( 0 ); 235 | subHRuler.SetEnable( 0 ); 236 | mainHRuler.SendSizeToMain(); 237 | 238 | } 239 | } 240 | -------------------------------------------------------------------------------- /NppHorizontalRuler.h: -------------------------------------------------------------------------------- 1 | #ifndef NPPHORIZONTALRULER_H 2 | #define NPPHORIZONTALRULER_H 3 | 4 | #include "HorizontalRuler.h" 5 | 6 | LRESULT CALLBACK RulerMainWndProc( HWND , UINT , WPARAM ,LPARAM ); 7 | LRESULT CALLBACK RulerSubWndProc( HWND , UINT , WPARAM ,LPARAM ); 8 | LRESULT onHorizontalRulerMessageProc( UINT , WPARAM , LPARAM ); 9 | 10 | void ruler( bool enable ); 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /PluginDefinition.cpp: -------------------------------------------------------------------------------- 1 | //this file is part of notepad++ 2 | //Copyright (C)2003 Don HO 3 | // 4 | //This program is free software; you can redistribute it and/or 5 | //modify it under the terms of the GNU General Public License 6 | //as published by the Free Software Foundation; either 7 | //version 2 of the License, or (at your option) any later version. 8 | // 9 | //This program is distributed in the hope that it will be useful, 10 | //but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | //MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | //GNU General Public License for more details. 13 | // 14 | //You should have received a copy of the GNU General Public License 15 | //along with this program; if not, write to the Free Software 16 | //Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 17 | 18 | #include "PluginDefinition.h" 19 | #include "SettingsDlg.h" 20 | #include "HorizontalRuler.h" 21 | #include "NppHorizontalRuler.h" 22 | #include "menuCmdID.h" 23 | #include "Scintilla.h" 24 | 25 | // 26 | // The plugin data that Notepad++ needs 27 | // 28 | FuncItem funcItem[nbFunc]; 29 | 30 | // 31 | // The data of Notepad++ that you can use in your plugin commands 32 | // 33 | NppData nppData; 34 | HINSTANCE g_hInst; 35 | 36 | bool g_bIsActiveHi = false; 37 | bool g_bBsUnindent = false; 38 | bool g_bIndentGuideLF = false; 39 | int g_iEdgeModeOrig; 40 | Sci_Position g_iEdgeColOrig; 41 | 42 | extern HorizontalRuler mainHRuler; 43 | 44 | // 45 | // Initialize your plugin data here 46 | // It will be called while plugin loading 47 | void pluginInit( HANDLE /* hModule */ ) 48 | { 49 | 50 | } 51 | 52 | // 53 | // Here you can do the clean up, save the parameters (if any) for the next session 54 | // 55 | void pluginCleanUp() 56 | { 57 | 58 | } 59 | 60 | // 61 | // Initialization of your plugin commands 62 | // You should fill your plugins commands here 63 | void commandMenuInit() 64 | { 65 | 66 | //--------------------------------------------// 67 | //-- STEP 3. CUSTOMIZE YOUR PLUGIN COMMANDS --// 68 | //--------------------------------------------// 69 | // with function : 70 | // setCommand(int index, // zero based number to indicate the order of command 71 | // TCHAR *commandName, // the command name that you want to see in plugin menu 72 | // PFUNCPLUGINCMD functionPointer, // the symbol of function (function pointer) associated with this command. The body should be defined below. See Step 4. 73 | // ShortcutKey *shortcut, // optional. Define a shortcut to trigger this command 74 | // bool check0nInit // optional. Make this menu item be checked visually 75 | // ); 76 | setCommand( MENU_ENABLE, TEXT( "&Enable all" ), enableAll, NULL, 77 | false ); 78 | setCommand( MENU_SEPARATOR1, TEXT( "-SEPARATOR-" ), NULL, NULL, 79 | false ); 80 | setCommand( MENU_HIGHLIGHT, TEXT( "Column &highlight" ), colHiToggle, NULL, 81 | false ); 82 | setCommand( MENU_RULER, TEXT( "&Ruler" ), rulToggle, NULL, 83 | false ); 84 | setCommand( MENU_SEPARATOR1, TEXT( "-SEPARATOR-" ), NULL, NULL, 85 | false ); 86 | setCommand( MENU_SETTINGS, TEXT( "&Settings" ), doSettings, NULL, 87 | false ); 88 | } 89 | 90 | // 91 | // Here you can do the clean up (especially for the shortcut) 92 | // 93 | void commandMenuCleanUp() 94 | { 95 | // Don't forget to deallocate your shortcut here 96 | } 97 | 98 | // 99 | // This function help you to initialize your plugin commands 100 | // 101 | bool setCommand( size_t index, TCHAR *cmdName, PFUNCPLUGINCMD pFunc, 102 | ShortcutKey *sk, bool check0nInit ) 103 | { 104 | if ( index >= nbFunc ) 105 | return false; 106 | 107 | if ( !pFunc ) 108 | return false; 109 | 110 | lstrcpy( funcItem[index]._itemName, cmdName ); 111 | funcItem[index]._pFunc = pFunc; 112 | funcItem[index]._init2Check = check0nInit; 113 | funcItem[index]._pShKey = sk; 114 | 115 | return true; 116 | } 117 | 118 | //----------------------------------------------// 119 | //-- STEP 4. DEFINE YOUR ASSOCIATED FUNCTIONS --// 120 | //----------------------------------------------// 121 | HWND getCurScintilla() 122 | { 123 | int which = -1; 124 | ::SendMessage( nppData._nppHandle, NPPM_GETCURRENTSCINTILLA, 0, 125 | ( LPARAM )&which ); 126 | return ( which == 0 ) ? nppData._scintillaMainHandle : 127 | nppData._scintillaSecondHandle; 128 | } 129 | 130 | void enableAll() 131 | { 132 | if ( g_bIsActiveHi && mainHRuler.GetEnable() ) 133 | { 134 | colHi( false ); 135 | ruler( false ); 136 | ::SendMessage( nppData._nppHandle, NPPM_SETMENUITEMCHECK, 137 | funcItem[MENU_ENABLE]._cmdID, MF_UNCHECKED ); 138 | ::SendMessage( nppData._nppHandle, NPPM_SETMENUITEMCHECK, 139 | funcItem[MENU_HIGHLIGHT]._cmdID, MF_UNCHECKED ); 140 | ::SendMessage( nppData._nppHandle, NPPM_SETMENUITEMCHECK, 141 | funcItem[MENU_RULER]._cmdID, MF_UNCHECKED ); 142 | } 143 | else 144 | { 145 | colHi( true ); 146 | ruler( true ); 147 | ::SendMessage( nppData._nppHandle, NPPM_SETMENUITEMCHECK, 148 | funcItem[MENU_ENABLE]._cmdID, MF_CHECKED ); 149 | ::SendMessage( nppData._nppHandle, NPPM_SETMENUITEMCHECK, 150 | funcItem[MENU_HIGHLIGHT]._cmdID, MF_CHECKED ); 151 | ::SendMessage( nppData._nppHandle, NPPM_SETMENUITEMCHECK, 152 | funcItem[MENU_RULER]._cmdID, MF_CHECKED ); 153 | } 154 | 155 | } 156 | 157 | void syncEnable() 158 | { 159 | if ( g_bIsActiveHi && mainHRuler.GetEnable() ) 160 | ::SendMessage( nppData._nppHandle, NPPM_SETMENUITEMCHECK, 161 | funcItem[MENU_ENABLE]._cmdID, MF_CHECKED ); 162 | else 163 | ::SendMessage( nppData._nppHandle, NPPM_SETMENUITEMCHECK, 164 | funcItem[MENU_ENABLE]._cmdID, MF_UNCHECKED ); 165 | } 166 | 167 | void doBufferSets() 168 | { 169 | ::SendMessage( getCurScintilla(), SCI_SETBACKSPACEUNINDENTS, g_bBsUnindent, 0 ); 170 | 171 | if ( g_bIndentGuideLF ) 172 | ::SendMessage( getCurScintilla(), SCI_SETINDENTATIONGUIDES, SC_IV_LOOKFORWARD, 0 ); 173 | } 174 | 175 | void resetEdge() 176 | { 177 | // Reset original edge properties - Main 178 | ::SendMessage( nppData._scintillaMainHandle, SCI_SETEDGEMODE, 179 | g_iEdgeModeOrig, 0 ); 180 | ::SendMessage( nppData._scintillaMainHandle, SCI_SETEDGECOLUMN, 181 | g_iEdgeColOrig, 0 ); 182 | // Reset original edge properties - Secondary 183 | ::SendMessage( nppData._scintillaSecondHandle, SCI_SETEDGEMODE, 184 | g_iEdgeModeOrig, 0 ); 185 | ::SendMessage( nppData._scintillaSecondHandle, SCI_SETEDGECOLUMN, 186 | g_iEdgeColOrig, 0 ); 187 | } 188 | 189 | void colHiToggle() 190 | { 191 | if ( g_bIsActiveHi ) 192 | { 193 | colHi( false ); 194 | ::SendMessage( nppData._nppHandle, NPPM_SETMENUITEMCHECK, 195 | funcItem[MENU_HIGHLIGHT]._cmdID, MF_UNCHECKED ); 196 | } 197 | else 198 | { 199 | colHi( true ); 200 | ::SendMessage( nppData._nppHandle, NPPM_SETMENUITEMCHECK, 201 | funcItem[MENU_HIGHLIGHT]._cmdID, MF_CHECKED ); 202 | } 203 | 204 | syncEnable(); 205 | } 206 | 207 | void colHi( bool enable ) 208 | { 209 | g_bIsActiveHi = enable; 210 | 211 | HWND hCurScintilla = getCurScintilla(); 212 | if ( enable ) 213 | { 214 | ::SendMessage( hCurScintilla, SCI_SETEDGEMODE, EDGE_LINE, 0 ); 215 | setColHi( hCurScintilla ); 216 | } 217 | else 218 | { 219 | resetEdge(); 220 | } 221 | } 222 | 223 | void setColHi( HWND hCurScintilla ) 224 | { 225 | // Get current cursor position 226 | bool rect = ( bool )::SendMessage( hCurScintilla, SCI_SELECTIONISRECTANGLE, 227 | 0, 0 ); 228 | Sci_Position vsp = 0; 229 | 230 | if ( rect ) 231 | vsp = ( Sci_Position )::SendMessage( hCurScintilla, 232 | SCI_GETRECTANGULARSELECTIONCARETVIRTUALSPACE, 0, 0 ); 233 | else 234 | { 235 | int sel = ( int )::SendMessage( hCurScintilla, SCI_GETMAINSELECTION, 0, 0 ); 236 | vsp = ( Sci_Position )::SendMessage( hCurScintilla, 237 | SCI_GETSELECTIONNCARETVIRTUALSPACE, sel, 0 ); 238 | } 239 | 240 | // Set edge column to current cursort position 241 | Sci_Position caretPos = GetColumnCaretPos( hCurScintilla ); 242 | caretPos += vsp; 243 | ::SendMessage( hCurScintilla, SCI_SETEDGEMODE, EDGE_LINE, 0 ); 244 | ::SendMessage( hCurScintilla, SCI_SETEDGECOLUMN, caretPos, 0 ); 245 | } 246 | 247 | void rulToggle() 248 | { 249 | if ( mainHRuler.GetEnable() ) 250 | { 251 | ruler( false ); 252 | ::SendMessage( nppData._nppHandle, NPPM_SETMENUITEMCHECK, 253 | funcItem[MENU_RULER]._cmdID, MF_UNCHECKED ); 254 | 255 | if ( ! g_bIsActiveHi ) 256 | resetEdge(); 257 | } 258 | else 259 | { 260 | ruler( true ); 261 | ::SendMessage( nppData._nppHandle, NPPM_SETMENUITEMCHECK, 262 | funcItem[MENU_RULER]._cmdID, MF_CHECKED ); 263 | } 264 | 265 | syncEnable(); 266 | } 267 | 268 | Sci_Position GetColumnCaretPos( HWND hCurScintilla ) 269 | { 270 | int i; 271 | 272 | char *curLin; 273 | wchar_t *wideCurLin; 274 | char *ansiCurLin; 275 | int nWideExchange; 276 | int nAnsiExchange; 277 | 278 | Sci_Position nCaret, nLineLength; 279 | int nTabSpace; 280 | 281 | // HWND hCurScintilla = getCurScintilla(); 282 | 283 | nLineLength = ( Sci_Position )SendMessage( hCurScintilla, SCI_GETCURLINE, 0, 284 | 0 ); 285 | nLineLength += 2; 286 | curLin = new char[nLineLength]; 287 | nCaret = ( Sci_Position )SendMessage( hCurScintilla, SCI_GETCURLINE, 288 | nLineLength, ( LPARAM )curLin ); 289 | nTabSpace = ( int )SendMessage( hCurScintilla, SCI_GETTABWIDTH, 0, 290 | 0 ); 291 | 292 | curLin[nCaret] = '\0'; 293 | //utf8->utf16 294 | nWideExchange = MultiByteToWideChar( CP_UTF8, 0, curLin, -1, 0, 0 ); 295 | wideCurLin = new wchar_t[nWideExchange]; 296 | MultiByteToWideChar( CP_UTF8, 0, curLin, -1, wideCurLin, nWideExchange ); 297 | nAnsiExchange = WideCharToMultiByte( CP_ACP, 0, wideCurLin, nWideExchange, 298 | 0, 0, NULL, NULL ); 299 | //utf16->ansi 300 | ansiCurLin = new char[nAnsiExchange]; 301 | WideCharToMultiByte( CP_ACP, 0, wideCurLin, nWideExchange, ansiCurLin, 302 | nAnsiExchange, NULL, NULL ); 303 | 304 | //??????? 305 | nCaret = 0; 306 | 307 | for ( i = 0; i < nAnsiExchange - 1; i++ ) 308 | { 309 | if ( ansiCurLin[i] == '\t' ) 310 | nCaret = ( ( nCaret / nTabSpace ) + 1 ) * nTabSpace; 311 | else 312 | nCaret++; 313 | } 314 | 315 | delete[] ansiCurLin; 316 | delete[] wideCurLin; 317 | delete[] curLin; 318 | ansiCurLin = NULL; 319 | wideCurLin = NULL; 320 | curLin = NULL; 321 | 322 | return nCaret; 323 | } 324 | -------------------------------------------------------------------------------- /PluginDefinition.h: -------------------------------------------------------------------------------- 1 | //this file is part of notepad++ 2 | //Copyright (C)2003 Don HO 3 | // 4 | //This program is free software; you can redistribute it and/or 5 | //modify it under the terms of the GNU General Public License 6 | //as published by the Free Software Foundation; either 7 | //version 2 of the License, or (at your option) any later version. 8 | // 9 | //This program is distributed in the hope that it will be useful, 10 | //but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | //MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | //GNU General Public License for more details. 13 | // 14 | //You should have received a copy of the GNU General Public License 15 | //along with this program; if not, write to the Free Software 16 | //Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 17 | 18 | #ifndef PLUGINDEFINITION_H 19 | #define PLUGINDEFINITION_H 20 | 21 | // 22 | // All difinitions of plugin interface 23 | // 24 | #include "PluginInterface.h" 25 | #include "Scintilla.h" 26 | #include "resource.h" 27 | 28 | //-------------------------------------// 29 | //-- STEP 1. DEFINE YOUR PLUGIN NAME --// 30 | //-------------------------------------// 31 | // Here define your plugin name 32 | // 33 | const TCHAR NPP_PLUGIN_NAME[] = TEXT( INTERNAL_NAME ); 34 | const TCHAR NPP_PLUGIN_FILENAME[] = TEXT( FILENAME ); 35 | 36 | //-----------------------------------------------// 37 | //-- STEP 2. DEFINE YOUR PLUGIN COMMAND NUMBER --// 38 | //-----------------------------------------------// 39 | // 40 | // Here define the number of your plugin commands 41 | // 42 | const int nbFunc = 6; 43 | 44 | #define MENU_ENABLE 0 45 | #define MENU_SEPARATOR1 1 46 | #define MENU_HIGHLIGHT 2 47 | #define MENU_RULER 3 48 | #define MENU_SEPARATOR2 4 49 | #define MENU_SETTINGS 5 50 | 51 | // 52 | // Initialization of your plugin data 53 | // It will be called while plugin loading 54 | // 55 | void pluginInit(HANDLE hModule); 56 | 57 | // 58 | // Cleaning of your plugin 59 | // It will be called while plugin unloading 60 | // 61 | void pluginCleanUp(); 62 | 63 | // 64 | //Initialization of your plugin commands 65 | // 66 | void commandMenuInit(); 67 | 68 | // 69 | //Clean up your plugin commands allocation (if any) 70 | // 71 | void commandMenuCleanUp(); 72 | 73 | // 74 | // Function which sets your command 75 | // 76 | bool setCommand(size_t index, TCHAR *cmdName, PFUNCPLUGINCMD pFunc, ShortcutKey *sk = NULL, bool check0nInit = false); 77 | 78 | 79 | // 80 | // Your plugin command functions 81 | // 82 | HWND getCurScintilla(); 83 | void enableAll(); 84 | void syncEnable(); 85 | void colHiToggle(); 86 | void colHi( bool enable ); 87 | void setColHi( HWND hCurScintilla ); 88 | 89 | void doBufferSets(); 90 | 91 | void RulerWndProcSet(); 92 | void RulerWndProcUnset(); 93 | void rulToggle(); 94 | Sci_Position GetColumnCaretPos( HWND hCurScintilla ); 95 | 96 | #endif //PLUGINDEFINITION_H 97 | -------------------------------------------------------------------------------- /PluginInterface.h: -------------------------------------------------------------------------------- 1 | //this file is part of notepad++ 2 | //Copyright (C)2003 Don HO 3 | // 4 | //This program is free software; you can redistribute it and/or 5 | //modify it under the terms of the GNU General Public License 6 | //as published by the Free Software Foundation; either 7 | //version 2 of the License, or (at your option) any later version. 8 | // 9 | //This program is distributed in the hope that it will be useful, 10 | //but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | //MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | //GNU General Public License for more details. 13 | // 14 | //You should have received a copy of the GNU General Public License 15 | //along with this program; if not, write to the Free Software 16 | //Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 17 | 18 | #ifndef PLUGININTERFACE_H 19 | #define PLUGININTERFACE_H 20 | 21 | #include 22 | #include "Scintilla.h" 23 | #include "Notepad_plus_msgs.h" 24 | 25 | const int nbChar = 64; 26 | 27 | typedef const TCHAR * (__cdecl * PFUNCGETNAME)(); 28 | 29 | struct NppData { 30 | HWND _nppHandle; 31 | HWND _scintillaMainHandle; 32 | HWND _scintillaSecondHandle; 33 | }; 34 | 35 | typedef void (__cdecl * PFUNCSETINFO)(NppData); 36 | typedef void (__cdecl * PFUNCPLUGINCMD)(); 37 | typedef void (__cdecl * PBENOTIFIED)(SCNotification *); 38 | typedef LRESULT (__cdecl * PMESSAGEPROC)(UINT Message, WPARAM wParam, LPARAM lParam); 39 | 40 | 41 | struct ShortcutKey { 42 | bool _isCtrl; 43 | bool _isAlt; 44 | bool _isShift; 45 | UCHAR _key; 46 | }; 47 | 48 | struct FuncItem { 49 | TCHAR _itemName[nbChar]; 50 | PFUNCPLUGINCMD _pFunc; 51 | int _cmdID; 52 | bool _init2Check; 53 | ShortcutKey *_pShKey; 54 | }; 55 | 56 | typedef FuncItem * (__cdecl * PFUNCGETFUNCSARRAY)(int *); 57 | 58 | // You should implement (or define an empty function body) those functions which are called by Notepad++ plugin manager 59 | extern "C" __declspec(dllexport) void setInfo(NppData); 60 | extern "C" __declspec(dllexport) const TCHAR * getName(); 61 | extern "C" __declspec(dllexport) FuncItem * getFuncsArray(int *); 62 | extern "C" __declspec(dllexport) void beNotified(SCNotification *); 63 | extern "C" __declspec(dllexport) LRESULT messageProc(UINT Message, WPARAM wParam, LPARAM lParam); 64 | 65 | #ifdef UNICODE 66 | extern "C" __declspec(dllexport) BOOL isUnicode(); 67 | #endif //UNICODE 68 | 69 | #endif //PLUGININTERFACE_H -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Notepad++ Column Tools 2 | 3 | ## Description 4 | 5 | This Notepad++ plugin provides highlighting of the current column in the 6 | same way the "Settings" -> "Preferences" -> "Editing" -> "Enable current 7 | line highlighting" option provides highlighting of the current line. It 8 | also provides a "ruler" showing column numbers much the same as line 9 | numbers from "Settings" -> "Preferences" -> "Editing" -> "Display line 10 | number". 11 | 12 | This was more of a proof of concept. I wrote the column highlighting in 13 | about 8 hours while looking at the demo plugin, the Scintilla documentation, 14 | other examples of working plugins and my little (to almost non-existent) 15 | experience with C/C++. 16 | 17 | The ruler functionality is "borrowed" from the 18 | [NppHorizontalRuler](https://notepad-plus-plus.org/community/topic/13369/a-notepad-beautiful-ruler-plugin-finally) 19 | plugin. 20 | 21 | ## Compiling 22 | 23 | I compiled with MS Visual Studio Community 2017 and this seems to work OK. 24 | 25 | For 32-bit: 26 | ``` 27 | [x86 Native Tools Command Prompt for VS 2017] 28 | C:\> set Configuration=Release 29 | C:\> set Platform=x86 30 | C:\> msbuild 31 | ``` 32 | 33 | For 64-bit: 34 | ``` 35 | [x64 Native Tools Command Prompt for VS 2017] 36 | C:\> set Configuration=Release 37 | C:\> set Platform=x64 38 | C:\> msbuild 39 | ``` 40 | 41 | ## Installation 42 | 43 | Copy the: 44 | 45 | + 32-bit: ./bin/ColumnTools.dll 46 | + 64-bit: ./bin64/ColumnTools.dll 47 | 48 | to the Notepad++ plugins folder: 49 | + In N++ <7.6, directly in the plugins/ folder 50 | + In N++ >=7.6, in a directory called ColumnTools in the plugins/ folder (plugins/ColumnTools/) 51 | 52 | ## Usage 53 | 54 | Plugins => Column Tools and select the option(s) you want. 55 | 56 | ### Column Highlight 57 | 58 | To be fair, this plugin doesn't really "highlight" the current column; rather, 59 | uses the edge column marker to do the job. Thus, if you're using the edge 60 | column marker, you "lose" it, but this plugin should remember the state on 61 | startup so when you disable the plugin, the original edge column marker state 62 | should be returned. 63 | 64 | ### Ruler 65 | 66 | The horizonal ruler displays across the top of each tab in each Scintilla view 67 | in Notepad++ (both main and secondary, if visible). 68 | 69 | #### Set Vertical Line 70 | 71 | Double-click on the ruler to set a vertical line at that column. If Column 72 | Highlight is enabled, the vertical line will not stay and will move with the 73 | cursor. This is a Scintilla limitation and can not be "fixed" with this 74 | plugin. To keep the vertical line in position, disable Column Highlight. 75 | 76 | #### Multiple Vertical Lines (Scintilla EDGE_MULTILINE) 77 | 78 | For [multiple vertical lines](https://www.scintilla.org/ScintillaDoc.html#SCI_MULTIEDGEADDLINE) 79 | SHIFT+double-click in the ruler. Again, if Column Highlight is enabled, 80 | the vertical lines will not stay and will move with the cursor. This is a 81 | Scintilla limitation and can not be "fixed" with this plugin. To keep the 82 | vertical lines in position, disable Column Highlight. To remove all 83 | vertical lines, use CTRL+double-click in the ruler. Again, this is a 84 | [Scintilla limitation](https://www.scintilla.org/ScintillaDoc.html#SCI_MULTIEDGECLEARALL); 85 | individual vertical lines cannot be removed, it's all or nothing. 86 | 87 | **NOTE:** The ruler does not line up correctly unless 88 | [SC_TECHNOLOGY_DEFAULT](https://www.scintilla.org/ScintillaDoc.html#SCI_GETTECHNOLOGY) 89 | is set. 90 | 91 | ### Settings 92 | 93 | #### Backspace Unindent 94 | 95 | This implements the Scintilla 96 | [SCI_SETBACKSPACEUNINDENTS](https://www.scintilla.org/ScintillaDoc.html#SCI_SETBACKSPACEUNINDENTS) 97 | feature. 98 | 99 | #### Indent Guides LookForward 100 | 101 | This implements the Scintilla 102 | [SCI_SETINDENTATIONGUIDES](https://www.scintilla.org/ScintillaDoc.html#SCI_SETINDENTATIONGUIDES) 103 | feature to `SC_IV_LOOKFORWARD` which is supposedly "good for Python", but seems 104 | to be good for all languages as well despite what it says for `SC_IV_LOOKBOTH` 105 | being "good for most languages". 106 | -------------------------------------------------------------------------------- /Sci_Position.h: -------------------------------------------------------------------------------- 1 | // Scintilla source code edit control 2 | /** @file Sci_Position.h 3 | ** Define the Sci_Position type used in Scintilla's external interfaces. 4 | ** These need to be available to clients written in C so are not in a C++ namespace. 5 | **/ 6 | // Copyright 2015 by Neil Hodgson 7 | // The License.txt file describes the conditions under which this software may be distributed. 8 | 9 | #ifndef SCI_POSITION_H 10 | #define SCI_POSITION_H 11 | 12 | #include 13 | 14 | // Basic signed type used throughout interface 15 | typedef ptrdiff_t Sci_Position; 16 | 17 | // Unsigned variant used for ILexer::Lex and ILexer::Fold 18 | // Definitions of common types 19 | typedef size_t Sci_PositionU; 20 | 21 | 22 | // For Sci_CharacterRange which is defined as long to be compatible with Win32 CHARRANGE 23 | typedef intptr_t Sci_PositionCR; 24 | 25 | #ifdef _WIN32 26 | #define SCI_METHOD __stdcall 27 | #else 28 | #define SCI_METHOD 29 | #endif 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /Scintilla.h: -------------------------------------------------------------------------------- 1 | /* Scintilla source code edit control */ 2 | /** @file Scintilla.h 3 | ** Interface to the edit control. 4 | **/ 5 | /* Copyright 1998-2003 by Neil Hodgson 6 | * The License.txt file describes the conditions under which this software may be distributed. */ 7 | 8 | /* Most of this file is automatically generated from the Scintilla.iface interface definition 9 | * file which contains any comments about the definitions. HFacer.py does the generation. */ 10 | 11 | #ifndef SCINTILLA_H 12 | #define SCINTILLA_H 13 | 14 | #ifdef __cplusplus 15 | extern "C" { 16 | #endif 17 | 18 | #if defined(_WIN32) 19 | /* Return false on failure: */ 20 | int Scintilla_RegisterClasses(void *hInstance); 21 | int Scintilla_ReleaseResources(void); 22 | #endif 23 | int Scintilla_LinkLexers(void); 24 | 25 | #ifdef __cplusplus 26 | } 27 | #endif 28 | 29 | // Include header that defines basic numeric types. 30 | #include 31 | 32 | // Define uptr_t, an unsigned integer type large enough to hold a pointer. 33 | typedef uintptr_t uptr_t; 34 | // Define sptr_t, a signed integer large enough to hold a pointer. 35 | typedef intptr_t sptr_t; 36 | 37 | #include "Sci_Position.h" 38 | 39 | typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, sptr_t lParam); 40 | 41 | #ifndef SCI_DISABLE_AUTOGENERATED 42 | 43 | /* ++Autogenerated -- start of section automatically generated from Scintilla.iface */ 44 | #define INVALID_POSITION -1 45 | #define SCI_START 2000 46 | #define SCI_OPTIONAL_START 3000 47 | #define SCI_LEXER_START 4000 48 | #define SCI_ADDTEXT 2001 49 | #define SCI_ADDSTYLEDTEXT 2002 50 | #define SCI_INSERTTEXT 2003 51 | #define SCI_CHANGEINSERTION 2672 52 | #define SCI_CLEARALL 2004 53 | #define SCI_DELETERANGE 2645 54 | #define SCI_CLEARDOCUMENTSTYLE 2005 55 | #define SCI_GETLENGTH 2006 56 | #define SCI_GETCHARAT 2007 57 | #define SCI_GETCURRENTPOS 2008 58 | #define SCI_GETANCHOR 2009 59 | #define SCI_GETSTYLEAT 2010 60 | #define SCI_REDO 2011 61 | #define SCI_SETUNDOCOLLECTION 2012 62 | #define SCI_SELECTALL 2013 63 | #define SCI_SETSAVEPOINT 2014 64 | #define SCI_GETSTYLEDTEXT 2015 65 | #define SCI_CANREDO 2016 66 | #define SCI_MARKERLINEFROMHANDLE 2017 67 | #define SCI_MARKERDELETEHANDLE 2018 68 | #define SCI_MARKERHANDLEFROMLINE 2732 69 | #define SCI_MARKERNUMBERFROMLINE 2733 70 | #define SCI_GETUNDOCOLLECTION 2019 71 | #define SCWS_INVISIBLE 0 72 | #define SCWS_VISIBLEALWAYS 1 73 | #define SCWS_VISIBLEAFTERINDENT 2 74 | #define SCWS_VISIBLEONLYININDENT 3 75 | #define SCI_GETVIEWWS 2020 76 | #define SCI_SETVIEWWS 2021 77 | #define SCTD_LONGARROW 0 78 | #define SCTD_STRIKEOUT 1 79 | #define SCI_GETTABDRAWMODE 2698 80 | #define SCI_SETTABDRAWMODE 2699 81 | #define SCI_POSITIONFROMPOINT 2022 82 | #define SCI_POSITIONFROMPOINTCLOSE 2023 83 | #define SCI_GOTOLINE 2024 84 | #define SCI_GOTOPOS 2025 85 | #define SCI_SETANCHOR 2026 86 | #define SCI_GETCURLINE 2027 87 | #define SCI_GETENDSTYLED 2028 88 | #define SC_EOL_CRLF 0 89 | #define SC_EOL_CR 1 90 | #define SC_EOL_LF 2 91 | #define SCI_CONVERTEOLS 2029 92 | #define SCI_GETEOLMODE 2030 93 | #define SCI_SETEOLMODE 2031 94 | #define SCI_STARTSTYLING 2032 95 | #define SCI_SETSTYLING 2033 96 | #define SCI_GETBUFFEREDDRAW 2034 97 | #define SCI_SETBUFFEREDDRAW 2035 98 | #define SCI_SETTABWIDTH 2036 99 | #define SCI_GETTABWIDTH 2121 100 | #define SCI_SETTABMINIMUMWIDTH 2724 101 | #define SCI_GETTABMINIMUMWIDTH 2725 102 | #define SCI_CLEARTABSTOPS 2675 103 | #define SCI_ADDTABSTOP 2676 104 | #define SCI_GETNEXTTABSTOP 2677 105 | #define SC_CP_UTF8 65001 106 | #define SCI_SETCODEPAGE 2037 107 | #define SC_IME_WINDOWED 0 108 | #define SC_IME_INLINE 1 109 | #define SCI_GETIMEINTERACTION 2678 110 | #define SCI_SETIMEINTERACTION 2679 111 | #define SC_ALPHA_TRANSPARENT 0 112 | #define SC_ALPHA_OPAQUE 255 113 | #define SC_ALPHA_NOALPHA 256 114 | #define SC_CURSORNORMAL -1 115 | #define SC_CURSORARROW 2 116 | #define SC_CURSORWAIT 4 117 | #define SC_CURSORREVERSEARROW 7 118 | #define MARKER_MAX 31 119 | #define SC_MARK_CIRCLE 0 120 | #define SC_MARK_ROUNDRECT 1 121 | #define SC_MARK_ARROW 2 122 | #define SC_MARK_SMALLRECT 3 123 | #define SC_MARK_SHORTARROW 4 124 | #define SC_MARK_EMPTY 5 125 | #define SC_MARK_ARROWDOWN 6 126 | #define SC_MARK_MINUS 7 127 | #define SC_MARK_PLUS 8 128 | #define SC_MARK_VLINE 9 129 | #define SC_MARK_LCORNER 10 130 | #define SC_MARK_TCORNER 11 131 | #define SC_MARK_BOXPLUS 12 132 | #define SC_MARK_BOXPLUSCONNECTED 13 133 | #define SC_MARK_BOXMINUS 14 134 | #define SC_MARK_BOXMINUSCONNECTED 15 135 | #define SC_MARK_LCORNERCURVE 16 136 | #define SC_MARK_TCORNERCURVE 17 137 | #define SC_MARK_CIRCLEPLUS 18 138 | #define SC_MARK_CIRCLEPLUSCONNECTED 19 139 | #define SC_MARK_CIRCLEMINUS 20 140 | #define SC_MARK_CIRCLEMINUSCONNECTED 21 141 | #define SC_MARK_BACKGROUND 22 142 | #define SC_MARK_DOTDOTDOT 23 143 | #define SC_MARK_ARROWS 24 144 | #define SC_MARK_PIXMAP 25 145 | #define SC_MARK_FULLRECT 26 146 | #define SC_MARK_LEFTRECT 27 147 | #define SC_MARK_AVAILABLE 28 148 | #define SC_MARK_UNDERLINE 29 149 | #define SC_MARK_RGBAIMAGE 30 150 | #define SC_MARK_BOOKMARK 31 151 | #define SC_MARK_VERTICALBOOKMARK 32 152 | #define SC_MARK_CHARACTER 10000 153 | #define SC_MARKNUM_FOLDEREND 25 154 | #define SC_MARKNUM_FOLDEROPENMID 26 155 | #define SC_MARKNUM_FOLDERMIDTAIL 27 156 | #define SC_MARKNUM_FOLDERTAIL 28 157 | #define SC_MARKNUM_FOLDERSUB 29 158 | #define SC_MARKNUM_FOLDER 30 159 | #define SC_MARKNUM_FOLDEROPEN 31 160 | #define SC_MASK_FOLDERS 0xFE000000 161 | #define SCI_MARKERDEFINE 2040 162 | #define SCI_MARKERSETFORE 2041 163 | #define SCI_MARKERSETBACK 2042 164 | #define SCI_MARKERSETBACKSELECTED 2292 165 | #define SCI_MARKERENABLEHIGHLIGHT 2293 166 | #define SCI_MARKERADD 2043 167 | #define SCI_MARKERDELETE 2044 168 | #define SCI_MARKERDELETEALL 2045 169 | #define SCI_MARKERGET 2046 170 | #define SCI_MARKERNEXT 2047 171 | #define SCI_MARKERPREVIOUS 2048 172 | #define SCI_MARKERDEFINEPIXMAP 2049 173 | #define SCI_MARKERADDSET 2466 174 | #define SCI_MARKERSETALPHA 2476 175 | #define SC_MAX_MARGIN 4 176 | #define SC_MARGIN_SYMBOL 0 177 | #define SC_MARGIN_NUMBER 1 178 | #define SC_MARGIN_BACK 2 179 | #define SC_MARGIN_FORE 3 180 | #define SC_MARGIN_TEXT 4 181 | #define SC_MARGIN_RTEXT 5 182 | #define SC_MARGIN_COLOUR 6 183 | #define SCI_SETMARGINTYPEN 2240 184 | #define SCI_GETMARGINTYPEN 2241 185 | #define SCI_SETMARGINWIDTHN 2242 186 | #define SCI_GETMARGINWIDTHN 2243 187 | #define SCI_SETMARGINMASKN 2244 188 | #define SCI_GETMARGINMASKN 2245 189 | #define SCI_SETMARGINSENSITIVEN 2246 190 | #define SCI_GETMARGINSENSITIVEN 2247 191 | #define SCI_SETMARGINCURSORN 2248 192 | #define SCI_GETMARGINCURSORN 2249 193 | #define SCI_SETMARGINBACKN 2250 194 | #define SCI_GETMARGINBACKN 2251 195 | #define SCI_SETMARGINS 2252 196 | #define SCI_GETMARGINS 2253 197 | #define STYLE_DEFAULT 32 198 | #define STYLE_LINENUMBER 33 199 | #define STYLE_BRACELIGHT 34 200 | #define STYLE_BRACEBAD 35 201 | #define STYLE_CONTROLCHAR 36 202 | #define STYLE_INDENTGUIDE 37 203 | #define STYLE_CALLTIP 38 204 | #define STYLE_FOLDDISPLAYTEXT 39 205 | #define STYLE_LASTPREDEFINED 39 206 | #define STYLE_MAX 255 207 | #define SC_CHARSET_ANSI 0 208 | #define SC_CHARSET_DEFAULT 1 209 | #define SC_CHARSET_BALTIC 186 210 | #define SC_CHARSET_CHINESEBIG5 136 211 | #define SC_CHARSET_EASTEUROPE 238 212 | #define SC_CHARSET_GB2312 134 213 | #define SC_CHARSET_GREEK 161 214 | #define SC_CHARSET_HANGUL 129 215 | #define SC_CHARSET_MAC 77 216 | #define SC_CHARSET_OEM 255 217 | #define SC_CHARSET_RUSSIAN 204 218 | #define SC_CHARSET_OEM866 866 219 | #define SC_CHARSET_CYRILLIC 1251 220 | #define SC_CHARSET_SHIFTJIS 128 221 | #define SC_CHARSET_SYMBOL 2 222 | #define SC_CHARSET_TURKISH 162 223 | #define SC_CHARSET_JOHAB 130 224 | #define SC_CHARSET_HEBREW 177 225 | #define SC_CHARSET_ARABIC 178 226 | #define SC_CHARSET_VIETNAMESE 163 227 | #define SC_CHARSET_THAI 222 228 | #define SC_CHARSET_8859_15 1000 229 | #define SCI_STYLECLEARALL 2050 230 | #define SCI_STYLESETFORE 2051 231 | #define SCI_STYLESETBACK 2052 232 | #define SCI_STYLESETBOLD 2053 233 | #define SCI_STYLESETITALIC 2054 234 | #define SCI_STYLESETSIZE 2055 235 | #define SCI_STYLESETFONT 2056 236 | #define SCI_STYLESETEOLFILLED 2057 237 | #define SCI_STYLERESETDEFAULT 2058 238 | #define SCI_STYLESETUNDERLINE 2059 239 | #define SC_CASE_MIXED 0 240 | #define SC_CASE_UPPER 1 241 | #define SC_CASE_LOWER 2 242 | #define SC_CASE_CAMEL 3 243 | #define SCI_STYLEGETFORE 2481 244 | #define SCI_STYLEGETBACK 2482 245 | #define SCI_STYLEGETBOLD 2483 246 | #define SCI_STYLEGETITALIC 2484 247 | #define SCI_STYLEGETSIZE 2485 248 | #define SCI_STYLEGETFONT 2486 249 | #define SCI_STYLEGETEOLFILLED 2487 250 | #define SCI_STYLEGETUNDERLINE 2488 251 | #define SCI_STYLEGETCASE 2489 252 | #define SCI_STYLEGETCHARACTERSET 2490 253 | #define SCI_STYLEGETVISIBLE 2491 254 | #define SCI_STYLEGETCHANGEABLE 2492 255 | #define SCI_STYLEGETHOTSPOT 2493 256 | #define SCI_STYLESETCASE 2060 257 | #define SC_FONT_SIZE_MULTIPLIER 100 258 | #define SCI_STYLESETSIZEFRACTIONAL 2061 259 | #define SCI_STYLEGETSIZEFRACTIONAL 2062 260 | #define SC_WEIGHT_NORMAL 400 261 | #define SC_WEIGHT_SEMIBOLD 600 262 | #define SC_WEIGHT_BOLD 700 263 | #define SCI_STYLESETWEIGHT 2063 264 | #define SCI_STYLEGETWEIGHT 2064 265 | #define SCI_STYLESETCHARACTERSET 2066 266 | #define SCI_STYLESETHOTSPOT 2409 267 | #define SCI_SETSELFORE 2067 268 | #define SCI_SETSELBACK 2068 269 | #define SCI_GETSELALPHA 2477 270 | #define SCI_SETSELALPHA 2478 271 | #define SCI_GETSELEOLFILLED 2479 272 | #define SCI_SETSELEOLFILLED 2480 273 | #define SCI_SETCARETFORE 2069 274 | #define SCI_ASSIGNCMDKEY 2070 275 | #define SCI_CLEARCMDKEY 2071 276 | #define SCI_CLEARALLCMDKEYS 2072 277 | #define SCI_SETSTYLINGEX 2073 278 | #define SCI_STYLESETVISIBLE 2074 279 | #define SCI_GETCARETPERIOD 2075 280 | #define SCI_SETCARETPERIOD 2076 281 | #define SCI_SETWORDCHARS 2077 282 | #define SCI_GETWORDCHARS 2646 283 | #define SCI_SETCHARACTERCATEGORYOPTIMIZATION 2720 284 | #define SCI_GETCHARACTERCATEGORYOPTIMIZATION 2721 285 | #define SCI_BEGINUNDOACTION 2078 286 | #define SCI_ENDUNDOACTION 2079 287 | #define INDIC_PLAIN 0 288 | #define INDIC_SQUIGGLE 1 289 | #define INDIC_TT 2 290 | #define INDIC_DIAGONAL 3 291 | #define INDIC_STRIKE 4 292 | #define INDIC_HIDDEN 5 293 | #define INDIC_BOX 6 294 | #define INDIC_ROUNDBOX 7 295 | #define INDIC_STRAIGHTBOX 8 296 | #define INDIC_DASH 9 297 | #define INDIC_DOTS 10 298 | #define INDIC_SQUIGGLELOW 11 299 | #define INDIC_DOTBOX 12 300 | #define INDIC_SQUIGGLEPIXMAP 13 301 | #define INDIC_COMPOSITIONTHICK 14 302 | #define INDIC_COMPOSITIONTHIN 15 303 | #define INDIC_FULLBOX 16 304 | #define INDIC_TEXTFORE 17 305 | #define INDIC_POINT 18 306 | #define INDIC_POINTCHARACTER 19 307 | #define INDIC_GRADIENT 20 308 | #define INDIC_GRADIENTCENTRE 21 309 | #define INDIC_EXPLORERLINK 22 310 | #define INDIC_CONTAINER 8 311 | #define INDIC_IME 32 312 | #define INDIC_IME_MAX 35 313 | #define INDIC_MAX 35 314 | #define INDICATOR_CONTAINER 8 315 | #define INDICATOR_IME 32 316 | #define INDICATOR_IME_MAX 35 317 | #define INDICATOR_MAX 35 318 | #define SCI_INDICSETSTYLE 2080 319 | #define SCI_INDICGETSTYLE 2081 320 | #define SCI_INDICSETFORE 2082 321 | #define SCI_INDICGETFORE 2083 322 | #define SCI_INDICSETUNDER 2510 323 | #define SCI_INDICGETUNDER 2511 324 | #define SCI_INDICSETHOVERSTYLE 2680 325 | #define SCI_INDICGETHOVERSTYLE 2681 326 | #define SCI_INDICSETHOVERFORE 2682 327 | #define SCI_INDICGETHOVERFORE 2683 328 | #define SC_INDICVALUEBIT 0x1000000 329 | #define SC_INDICVALUEMASK 0xFFFFFF 330 | #define SC_INDICFLAG_VALUEFORE 1 331 | #define SCI_INDICSETFLAGS 2684 332 | #define SCI_INDICGETFLAGS 2685 333 | #define SCI_SETWHITESPACEFORE 2084 334 | #define SCI_SETWHITESPACEBACK 2085 335 | #define SCI_SETWHITESPACESIZE 2086 336 | #define SCI_GETWHITESPACESIZE 2087 337 | #define SCI_SETLINESTATE 2092 338 | #define SCI_GETLINESTATE 2093 339 | #define SCI_GETMAXLINESTATE 2094 340 | #define SCI_GETCARETLINEVISIBLE 2095 341 | #define SCI_SETCARETLINEVISIBLE 2096 342 | #define SCI_GETCARETLINEBACK 2097 343 | #define SCI_SETCARETLINEBACK 2098 344 | #define SCI_GETCARETLINEFRAME 2704 345 | #define SCI_SETCARETLINEFRAME 2705 346 | #define SCI_STYLESETCHANGEABLE 2099 347 | #define SCI_AUTOCSHOW 2100 348 | #define SCI_AUTOCCANCEL 2101 349 | #define SCI_AUTOCACTIVE 2102 350 | #define SCI_AUTOCPOSSTART 2103 351 | #define SCI_AUTOCCOMPLETE 2104 352 | #define SCI_AUTOCSTOPS 2105 353 | #define SCI_AUTOCSETSEPARATOR 2106 354 | #define SCI_AUTOCGETSEPARATOR 2107 355 | #define SCI_AUTOCSELECT 2108 356 | #define SCI_AUTOCSETCANCELATSTART 2110 357 | #define SCI_AUTOCGETCANCELATSTART 2111 358 | #define SCI_AUTOCSETFILLUPS 2112 359 | #define SCI_AUTOCSETCHOOSESINGLE 2113 360 | #define SCI_AUTOCGETCHOOSESINGLE 2114 361 | #define SCI_AUTOCSETIGNORECASE 2115 362 | #define SCI_AUTOCGETIGNORECASE 2116 363 | #define SCI_USERLISTSHOW 2117 364 | #define SCI_AUTOCSETAUTOHIDE 2118 365 | #define SCI_AUTOCGETAUTOHIDE 2119 366 | #define SCI_AUTOCSETDROPRESTOFWORD 2270 367 | #define SCI_AUTOCGETDROPRESTOFWORD 2271 368 | #define SCI_REGISTERIMAGE 2405 369 | #define SCI_CLEARREGISTEREDIMAGES 2408 370 | #define SCI_AUTOCGETTYPESEPARATOR 2285 371 | #define SCI_AUTOCSETTYPESEPARATOR 2286 372 | #define SCI_AUTOCSETMAXWIDTH 2208 373 | #define SCI_AUTOCGETMAXWIDTH 2209 374 | #define SCI_AUTOCSETMAXHEIGHT 2210 375 | #define SCI_AUTOCGETMAXHEIGHT 2211 376 | #define SCI_SETINDENT 2122 377 | #define SCI_GETINDENT 2123 378 | #define SCI_SETUSETABS 2124 379 | #define SCI_GETUSETABS 2125 380 | #define SCI_SETLINEINDENTATION 2126 381 | #define SCI_GETLINEINDENTATION 2127 382 | #define SCI_GETLINEINDENTPOSITION 2128 383 | #define SCI_GETCOLUMN 2129 384 | #define SCI_COUNTCHARACTERS 2633 385 | #define SCI_COUNTCODEUNITS 2715 386 | #define SCI_SETHSCROLLBAR 2130 387 | #define SCI_GETHSCROLLBAR 2131 388 | #define SC_IV_NONE 0 389 | #define SC_IV_REAL 1 390 | #define SC_IV_LOOKFORWARD 2 391 | #define SC_IV_LOOKBOTH 3 392 | #define SCI_SETINDENTATIONGUIDES 2132 393 | #define SCI_GETINDENTATIONGUIDES 2133 394 | #define SCI_SETHIGHLIGHTGUIDE 2134 395 | #define SCI_GETHIGHLIGHTGUIDE 2135 396 | #define SCI_GETLINEENDPOSITION 2136 397 | #define SCI_GETCODEPAGE 2137 398 | #define SCI_GETCARETFORE 2138 399 | #define SCI_GETREADONLY 2140 400 | #define SCI_SETCURRENTPOS 2141 401 | #define SCI_SETSELECTIONSTART 2142 402 | #define SCI_GETSELECTIONSTART 2143 403 | #define SCI_SETSELECTIONEND 2144 404 | #define SCI_GETSELECTIONEND 2145 405 | #define SCI_SETEMPTYSELECTION 2556 406 | #define SCI_SETPRINTMAGNIFICATION 2146 407 | #define SCI_GETPRINTMAGNIFICATION 2147 408 | #define SC_PRINT_NORMAL 0 409 | #define SC_PRINT_INVERTLIGHT 1 410 | #define SC_PRINT_BLACKONWHITE 2 411 | #define SC_PRINT_COLOURONWHITE 3 412 | #define SC_PRINT_COLOURONWHITEDEFAULTBG 4 413 | #define SC_PRINT_SCREENCOLOURS 5 414 | #define SCI_SETPRINTCOLOURMODE 2148 415 | #define SCI_GETPRINTCOLOURMODE 2149 416 | #define SCFIND_NONE 0x0 417 | #define SCFIND_WHOLEWORD 0x2 418 | #define SCFIND_MATCHCASE 0x4 419 | #define SCFIND_WORDSTART 0x00100000 420 | #define SCFIND_REGEXP 0x00200000 421 | #define SCFIND_POSIX 0x00400000 422 | #define SCFIND_CXX11REGEX 0x00800000 423 | #define SCI_FINDTEXT 2150 424 | #define SCI_FORMATRANGE 2151 425 | #define SCI_GETFIRSTVISIBLELINE 2152 426 | #define SCI_GETLINE 2153 427 | #define SCI_GETLINECOUNT 2154 428 | #define SCI_SETMARGINLEFT 2155 429 | #define SCI_GETMARGINLEFT 2156 430 | #define SCI_SETMARGINRIGHT 2157 431 | #define SCI_GETMARGINRIGHT 2158 432 | #define SCI_GETMODIFY 2159 433 | #define SCI_SETSEL 2160 434 | #define SCI_GETSELTEXT 2161 435 | #define SCI_GETTEXTRANGE 2162 436 | #define SCI_HIDESELECTION 2163 437 | #define SCI_POINTXFROMPOSITION 2164 438 | #define SCI_POINTYFROMPOSITION 2165 439 | #define SCI_LINEFROMPOSITION 2166 440 | #define SCI_POSITIONFROMLINE 2167 441 | #define SCI_LINESCROLL 2168 442 | #define SCI_SCROLLCARET 2169 443 | #define SCI_SCROLLRANGE 2569 444 | #define SCI_REPLACESEL 2170 445 | #define SCI_SETREADONLY 2171 446 | #define SCI_NULL 2172 447 | #define SCI_CANPASTE 2173 448 | #define SCI_CANUNDO 2174 449 | #define SCI_EMPTYUNDOBUFFER 2175 450 | #define SCI_UNDO 2176 451 | #define SCI_CUT 2177 452 | #define SCI_COPY 2178 453 | #define SCI_PASTE 2179 454 | #define SCI_CLEAR 2180 455 | #define SCI_SETTEXT 2181 456 | #define SCI_GETTEXT 2182 457 | #define SCI_GETTEXTLENGTH 2183 458 | #define SCI_GETDIRECTFUNCTION 2184 459 | #define SCI_GETDIRECTPOINTER 2185 460 | #define SCI_SETOVERTYPE 2186 461 | #define SCI_GETOVERTYPE 2187 462 | #define SCI_SETCARETWIDTH 2188 463 | #define SCI_GETCARETWIDTH 2189 464 | #define SCI_SETTARGETSTART 2190 465 | #define SCI_GETTARGETSTART 2191 466 | #define SCI_SETTARGETSTARTVIRTUALSPACE 2728 467 | #define SCI_GETTARGETSTARTVIRTUALSPACE 2729 468 | #define SCI_SETTARGETEND 2192 469 | #define SCI_GETTARGETEND 2193 470 | #define SCI_SETTARGETENDVIRTUALSPACE 2730 471 | #define SCI_GETTARGETENDVIRTUALSPACE 2731 472 | #define SCI_SETTARGETRANGE 2686 473 | #define SCI_GETTARGETTEXT 2687 474 | #define SCI_TARGETFROMSELECTION 2287 475 | #define SCI_TARGETWHOLEDOCUMENT 2690 476 | #define SCI_REPLACETARGET 2194 477 | #define SCI_REPLACETARGETRE 2195 478 | #define SCI_SEARCHINTARGET 2197 479 | #define SCI_SETSEARCHFLAGS 2198 480 | #define SCI_GETSEARCHFLAGS 2199 481 | #define SCI_CALLTIPSHOW 2200 482 | #define SCI_CALLTIPCANCEL 2201 483 | #define SCI_CALLTIPACTIVE 2202 484 | #define SCI_CALLTIPPOSSTART 2203 485 | #define SCI_CALLTIPSETPOSSTART 2214 486 | #define SCI_CALLTIPSETHLT 2204 487 | #define SCI_CALLTIPSETBACK 2205 488 | #define SCI_CALLTIPSETFORE 2206 489 | #define SCI_CALLTIPSETFOREHLT 2207 490 | #define SCI_CALLTIPUSESTYLE 2212 491 | #define SCI_CALLTIPSETPOSITION 2213 492 | #define SCI_VISIBLEFROMDOCLINE 2220 493 | #define SCI_DOCLINEFROMVISIBLE 2221 494 | #define SCI_WRAPCOUNT 2235 495 | #define SC_FOLDLEVELBASE 0x400 496 | #define SC_FOLDLEVELWHITEFLAG 0x1000 497 | #define SC_FOLDLEVELHEADERFLAG 0x2000 498 | #define SC_FOLDLEVELNUMBERMASK 0x0FFF 499 | #define SCI_SETFOLDLEVEL 2222 500 | #define SCI_GETFOLDLEVEL 2223 501 | #define SCI_GETLASTCHILD 2224 502 | #define SCI_GETFOLDPARENT 2225 503 | #define SCI_SHOWLINES 2226 504 | #define SCI_HIDELINES 2227 505 | #define SCI_GETLINEVISIBLE 2228 506 | #define SCI_GETALLLINESVISIBLE 2236 507 | #define SCI_SETFOLDEXPANDED 2229 508 | #define SCI_GETFOLDEXPANDED 2230 509 | #define SCI_TOGGLEFOLD 2231 510 | #define SCI_TOGGLEFOLDSHOWTEXT 2700 511 | #define SC_FOLDDISPLAYTEXT_HIDDEN 0 512 | #define SC_FOLDDISPLAYTEXT_STANDARD 1 513 | #define SC_FOLDDISPLAYTEXT_BOXED 2 514 | #define SCI_FOLDDISPLAYTEXTSETSTYLE 2701 515 | #define SCI_FOLDDISPLAYTEXTGETSTYLE 2707 516 | #define SCI_SETDEFAULTFOLDDISPLAYTEXT 2722 517 | #define SCI_GETDEFAULTFOLDDISPLAYTEXT 2723 518 | #define SC_FOLDACTION_CONTRACT 0 519 | #define SC_FOLDACTION_EXPAND 1 520 | #define SC_FOLDACTION_TOGGLE 2 521 | #define SCI_FOLDLINE 2237 522 | #define SCI_FOLDCHILDREN 2238 523 | #define SCI_EXPANDCHILDREN 2239 524 | #define SCI_FOLDALL 2662 525 | #define SCI_ENSUREVISIBLE 2232 526 | #define SC_AUTOMATICFOLD_SHOW 0x0001 527 | #define SC_AUTOMATICFOLD_CLICK 0x0002 528 | #define SC_AUTOMATICFOLD_CHANGE 0x0004 529 | #define SCI_SETAUTOMATICFOLD 2663 530 | #define SCI_GETAUTOMATICFOLD 2664 531 | #define SC_FOLDFLAG_LINEBEFORE_EXPANDED 0x0002 532 | #define SC_FOLDFLAG_LINEBEFORE_CONTRACTED 0x0004 533 | #define SC_FOLDFLAG_LINEAFTER_EXPANDED 0x0008 534 | #define SC_FOLDFLAG_LINEAFTER_CONTRACTED 0x0010 535 | #define SC_FOLDFLAG_LEVELNUMBERS 0x0040 536 | #define SC_FOLDFLAG_LINESTATE 0x0080 537 | #define SCI_SETFOLDFLAGS 2233 538 | #define SCI_ENSUREVISIBLEENFORCEPOLICY 2234 539 | #define SCI_SETTABINDENTS 2260 540 | #define SCI_GETTABINDENTS 2261 541 | #define SCI_SETBACKSPACEUNINDENTS 2262 542 | #define SCI_GETBACKSPACEUNINDENTS 2263 543 | #define SC_TIME_FOREVER 10000000 544 | #define SCI_SETMOUSEDWELLTIME 2264 545 | #define SCI_GETMOUSEDWELLTIME 2265 546 | #define SCI_WORDSTARTPOSITION 2266 547 | #define SCI_WORDENDPOSITION 2267 548 | #define SCI_ISRANGEWORD 2691 549 | #define SC_IDLESTYLING_NONE 0 550 | #define SC_IDLESTYLING_TOVISIBLE 1 551 | #define SC_IDLESTYLING_AFTERVISIBLE 2 552 | #define SC_IDLESTYLING_ALL 3 553 | #define SCI_SETIDLESTYLING 2692 554 | #define SCI_GETIDLESTYLING 2693 555 | #define SC_WRAP_NONE 0 556 | #define SC_WRAP_WORD 1 557 | #define SC_WRAP_CHAR 2 558 | #define SC_WRAP_WHITESPACE 3 559 | #define SCI_SETWRAPMODE 2268 560 | #define SCI_GETWRAPMODE 2269 561 | #define SC_WRAPVISUALFLAG_NONE 0x0000 562 | #define SC_WRAPVISUALFLAG_END 0x0001 563 | #define SC_WRAPVISUALFLAG_START 0x0002 564 | #define SC_WRAPVISUALFLAG_MARGIN 0x0004 565 | #define SCI_SETWRAPVISUALFLAGS 2460 566 | #define SCI_GETWRAPVISUALFLAGS 2461 567 | #define SC_WRAPVISUALFLAGLOC_DEFAULT 0x0000 568 | #define SC_WRAPVISUALFLAGLOC_END_BY_TEXT 0x0001 569 | #define SC_WRAPVISUALFLAGLOC_START_BY_TEXT 0x0002 570 | #define SCI_SETWRAPVISUALFLAGSLOCATION 2462 571 | #define SCI_GETWRAPVISUALFLAGSLOCATION 2463 572 | #define SCI_SETWRAPSTARTINDENT 2464 573 | #define SCI_GETWRAPSTARTINDENT 2465 574 | #define SC_WRAPINDENT_FIXED 0 575 | #define SC_WRAPINDENT_SAME 1 576 | #define SC_WRAPINDENT_INDENT 2 577 | #define SC_WRAPINDENT_DEEPINDENT 3 578 | #define SCI_SETWRAPINDENTMODE 2472 579 | #define SCI_GETWRAPINDENTMODE 2473 580 | #define SC_CACHE_NONE 0 581 | #define SC_CACHE_CARET 1 582 | #define SC_CACHE_PAGE 2 583 | #define SC_CACHE_DOCUMENT 3 584 | #define SCI_SETLAYOUTCACHE 2272 585 | #define SCI_GETLAYOUTCACHE 2273 586 | #define SCI_SETSCROLLWIDTH 2274 587 | #define SCI_GETSCROLLWIDTH 2275 588 | #define SCI_SETSCROLLWIDTHTRACKING 2516 589 | #define SCI_GETSCROLLWIDTHTRACKING 2517 590 | #define SCI_TEXTWIDTH 2276 591 | #define SCI_SETENDATLASTLINE 2277 592 | #define SCI_GETENDATLASTLINE 2278 593 | #define SCI_TEXTHEIGHT 2279 594 | #define SCI_SETVSCROLLBAR 2280 595 | #define SCI_GETVSCROLLBAR 2281 596 | #define SCI_APPENDTEXT 2282 597 | #define SC_PHASES_ONE 0 598 | #define SC_PHASES_TWO 1 599 | #define SC_PHASES_MULTIPLE 2 600 | #define SCI_GETPHASESDRAW 2673 601 | #define SCI_SETPHASESDRAW 2674 602 | #define SC_EFF_QUALITY_MASK 0xF 603 | #define SC_EFF_QUALITY_DEFAULT 0 604 | #define SC_EFF_QUALITY_NON_ANTIALIASED 1 605 | #define SC_EFF_QUALITY_ANTIALIASED 2 606 | #define SC_EFF_QUALITY_LCD_OPTIMIZED 3 607 | #define SCI_SETFONTQUALITY 2611 608 | #define SCI_GETFONTQUALITY 2612 609 | #define SCI_SETFIRSTVISIBLELINE 2613 610 | #define SC_MULTIPASTE_ONCE 0 611 | #define SC_MULTIPASTE_EACH 1 612 | #define SCI_SETMULTIPASTE 2614 613 | #define SCI_GETMULTIPASTE 2615 614 | #define SCI_GETTAG 2616 615 | #define SCI_LINESJOIN 2288 616 | #define SCI_LINESSPLIT 2289 617 | #define SCI_SETFOLDMARGINCOLOUR 2290 618 | #define SCI_SETFOLDMARGINHICOLOUR 2291 619 | #define SC_ACCESSIBILITY_DISABLED 0 620 | #define SC_ACCESSIBILITY_ENABLED 1 621 | #define SCI_SETACCESSIBILITY 2702 622 | #define SCI_GETACCESSIBILITY 2703 623 | #define SCI_LINEDOWN 2300 624 | #define SCI_LINEDOWNEXTEND 2301 625 | #define SCI_LINEUP 2302 626 | #define SCI_LINEUPEXTEND 2303 627 | #define SCI_CHARLEFT 2304 628 | #define SCI_CHARLEFTEXTEND 2305 629 | #define SCI_CHARRIGHT 2306 630 | #define SCI_CHARRIGHTEXTEND 2307 631 | #define SCI_WORDLEFT 2308 632 | #define SCI_WORDLEFTEXTEND 2309 633 | #define SCI_WORDRIGHT 2310 634 | #define SCI_WORDRIGHTEXTEND 2311 635 | #define SCI_HOME 2312 636 | #define SCI_HOMEEXTEND 2313 637 | #define SCI_LINEEND 2314 638 | #define SCI_LINEENDEXTEND 2315 639 | #define SCI_DOCUMENTSTART 2316 640 | #define SCI_DOCUMENTSTARTEXTEND 2317 641 | #define SCI_DOCUMENTEND 2318 642 | #define SCI_DOCUMENTENDEXTEND 2319 643 | #define SCI_PAGEUP 2320 644 | #define SCI_PAGEUPEXTEND 2321 645 | #define SCI_PAGEDOWN 2322 646 | #define SCI_PAGEDOWNEXTEND 2323 647 | #define SCI_EDITTOGGLEOVERTYPE 2324 648 | #define SCI_CANCEL 2325 649 | #define SCI_DELETEBACK 2326 650 | #define SCI_TAB 2327 651 | #define SCI_BACKTAB 2328 652 | #define SCI_NEWLINE 2329 653 | #define SCI_FORMFEED 2330 654 | #define SCI_VCHOME 2331 655 | #define SCI_VCHOMEEXTEND 2332 656 | #define SCI_ZOOMIN 2333 657 | #define SCI_ZOOMOUT 2334 658 | #define SCI_DELWORDLEFT 2335 659 | #define SCI_DELWORDRIGHT 2336 660 | #define SCI_DELWORDRIGHTEND 2518 661 | #define SCI_LINECUT 2337 662 | #define SCI_LINEDELETE 2338 663 | #define SCI_LINETRANSPOSE 2339 664 | #define SCI_LINEREVERSE 2354 665 | #define SCI_LINEDUPLICATE 2404 666 | #define SCI_LOWERCASE 2340 667 | #define SCI_UPPERCASE 2341 668 | #define SCI_LINESCROLLDOWN 2342 669 | #define SCI_LINESCROLLUP 2343 670 | #define SCI_DELETEBACKNOTLINE 2344 671 | #define SCI_HOMEDISPLAY 2345 672 | #define SCI_HOMEDISPLAYEXTEND 2346 673 | #define SCI_LINEENDDISPLAY 2347 674 | #define SCI_LINEENDDISPLAYEXTEND 2348 675 | #define SCI_HOMEWRAP 2349 676 | #define SCI_HOMEWRAPEXTEND 2450 677 | #define SCI_LINEENDWRAP 2451 678 | #define SCI_LINEENDWRAPEXTEND 2452 679 | #define SCI_VCHOMEWRAP 2453 680 | #define SCI_VCHOMEWRAPEXTEND 2454 681 | #define SCI_LINECOPY 2455 682 | #define SCI_MOVECARETINSIDEVIEW 2401 683 | #define SCI_LINELENGTH 2350 684 | #define SCI_BRACEHIGHLIGHT 2351 685 | #define SCI_BRACEHIGHLIGHTINDICATOR 2498 686 | #define SCI_BRACEBADLIGHT 2352 687 | #define SCI_BRACEBADLIGHTINDICATOR 2499 688 | #define SCI_BRACEMATCH 2353 689 | #define SCI_BRACEMATCHNEXT 2369 690 | #define SCI_GETVIEWEOL 2355 691 | #define SCI_SETVIEWEOL 2356 692 | #define SCI_GETDOCPOINTER 2357 693 | #define SCI_SETDOCPOINTER 2358 694 | #define SCI_SETMODEVENTMASK 2359 695 | #define EDGE_NONE 0 696 | #define EDGE_LINE 1 697 | #define EDGE_BACKGROUND 2 698 | #define EDGE_MULTILINE 3 699 | #define SCI_GETEDGECOLUMN 2360 700 | #define SCI_SETEDGECOLUMN 2361 701 | #define SCI_GETEDGEMODE 2362 702 | #define SCI_SETEDGEMODE 2363 703 | #define SCI_GETEDGECOLOUR 2364 704 | #define SCI_SETEDGECOLOUR 2365 705 | #define SCI_MULTIEDGEADDLINE 2694 706 | #define SCI_MULTIEDGECLEARALL 2695 707 | #define SCI_GETMULTIEDGECOLUMN 2749 708 | #define SCI_SEARCHANCHOR 2366 709 | #define SCI_SEARCHNEXT 2367 710 | #define SCI_SEARCHPREV 2368 711 | #define SCI_LINESONSCREEN 2370 712 | #define SC_POPUP_NEVER 0 713 | #define SC_POPUP_ALL 1 714 | #define SC_POPUP_TEXT 2 715 | #define SCI_USEPOPUP 2371 716 | #define SCI_SELECTIONISRECTANGLE 2372 717 | #define SCI_SETZOOM 2373 718 | #define SCI_GETZOOM 2374 719 | #define SC_DOCUMENTOPTION_DEFAULT 0 720 | #define SC_DOCUMENTOPTION_STYLES_NONE 0x1 721 | #define SC_DOCUMENTOPTION_TEXT_LARGE 0x100 722 | #define SCI_CREATEDOCUMENT 2375 723 | #define SCI_ADDREFDOCUMENT 2376 724 | #define SCI_RELEASEDOCUMENT 2377 725 | #define SCI_GETDOCUMENTOPTIONS 2379 726 | #define SCI_GETMODEVENTMASK 2378 727 | #define SCI_SETCOMMANDEVENTS 2717 728 | #define SCI_GETCOMMANDEVENTS 2718 729 | #define SCI_SETFOCUS 2380 730 | #define SCI_GETFOCUS 2381 731 | #define SC_STATUS_OK 0 732 | #define SC_STATUS_FAILURE 1 733 | #define SC_STATUS_BADALLOC 2 734 | #define SC_STATUS_WARN_START 1000 735 | #define SC_STATUS_WARN_REGEX 1001 736 | #define SCI_SETSTATUS 2382 737 | #define SCI_GETSTATUS 2383 738 | #define SCI_SETMOUSEDOWNCAPTURES 2384 739 | #define SCI_GETMOUSEDOWNCAPTURES 2385 740 | #define SCI_SETMOUSEWHEELCAPTURES 2696 741 | #define SCI_GETMOUSEWHEELCAPTURES 2697 742 | #define SCI_SETCURSOR 2386 743 | #define SCI_GETCURSOR 2387 744 | #define SCI_SETCONTROLCHARSYMBOL 2388 745 | #define SCI_GETCONTROLCHARSYMBOL 2389 746 | #define SCI_WORDPARTLEFT 2390 747 | #define SCI_WORDPARTLEFTEXTEND 2391 748 | #define SCI_WORDPARTRIGHT 2392 749 | #define SCI_WORDPARTRIGHTEXTEND 2393 750 | #define VISIBLE_SLOP 0x01 751 | #define VISIBLE_STRICT 0x04 752 | #define SCI_SETVISIBLEPOLICY 2394 753 | #define SCI_DELLINELEFT 2395 754 | #define SCI_DELLINERIGHT 2396 755 | #define SCI_SETXOFFSET 2397 756 | #define SCI_GETXOFFSET 2398 757 | #define SCI_CHOOSECARETX 2399 758 | #define SCI_GRABFOCUS 2400 759 | #define CARET_SLOP 0x01 760 | #define CARET_STRICT 0x04 761 | #define CARET_JUMPS 0x10 762 | #define CARET_EVEN 0x08 763 | #define SCI_SETXCARETPOLICY 2402 764 | #define SCI_SETYCARETPOLICY 2403 765 | #define SCI_SETPRINTWRAPMODE 2406 766 | #define SCI_GETPRINTWRAPMODE 2407 767 | #define SCI_SETHOTSPOTACTIVEFORE 2410 768 | #define SCI_GETHOTSPOTACTIVEFORE 2494 769 | #define SCI_SETHOTSPOTACTIVEBACK 2411 770 | #define SCI_GETHOTSPOTACTIVEBACK 2495 771 | #define SCI_SETHOTSPOTACTIVEUNDERLINE 2412 772 | #define SCI_GETHOTSPOTACTIVEUNDERLINE 2496 773 | #define SCI_SETHOTSPOTSINGLELINE 2421 774 | #define SCI_GETHOTSPOTSINGLELINE 2497 775 | #define SCI_PARADOWN 2413 776 | #define SCI_PARADOWNEXTEND 2414 777 | #define SCI_PARAUP 2415 778 | #define SCI_PARAUPEXTEND 2416 779 | #define SCI_POSITIONBEFORE 2417 780 | #define SCI_POSITIONAFTER 2418 781 | #define SCI_POSITIONRELATIVE 2670 782 | #define SCI_POSITIONRELATIVECODEUNITS 2716 783 | #define SCI_COPYRANGE 2419 784 | #define SCI_COPYTEXT 2420 785 | #define SC_SEL_STREAM 0 786 | #define SC_SEL_RECTANGLE 1 787 | #define SC_SEL_LINES 2 788 | #define SC_SEL_THIN 3 789 | #define SCI_SETSELECTIONMODE 2422 790 | #define SCI_GETSELECTIONMODE 2423 791 | #define SCI_GETMOVEEXTENDSSELECTION 2706 792 | #define SCI_GETLINESELSTARTPOSITION 2424 793 | #define SCI_GETLINESELENDPOSITION 2425 794 | #define SCI_LINEDOWNRECTEXTEND 2426 795 | #define SCI_LINEUPRECTEXTEND 2427 796 | #define SCI_CHARLEFTRECTEXTEND 2428 797 | #define SCI_CHARRIGHTRECTEXTEND 2429 798 | #define SCI_HOMERECTEXTEND 2430 799 | #define SCI_VCHOMERECTEXTEND 2431 800 | #define SCI_LINEENDRECTEXTEND 2432 801 | #define SCI_PAGEUPRECTEXTEND 2433 802 | #define SCI_PAGEDOWNRECTEXTEND 2434 803 | #define SCI_STUTTEREDPAGEUP 2435 804 | #define SCI_STUTTEREDPAGEUPEXTEND 2436 805 | #define SCI_STUTTEREDPAGEDOWN 2437 806 | #define SCI_STUTTEREDPAGEDOWNEXTEND 2438 807 | #define SCI_WORDLEFTEND 2439 808 | #define SCI_WORDLEFTENDEXTEND 2440 809 | #define SCI_WORDRIGHTEND 2441 810 | #define SCI_WORDRIGHTENDEXTEND 2442 811 | #define SCI_SETWHITESPACECHARS 2443 812 | #define SCI_GETWHITESPACECHARS 2647 813 | #define SCI_SETPUNCTUATIONCHARS 2648 814 | #define SCI_GETPUNCTUATIONCHARS 2649 815 | #define SCI_SETCHARSDEFAULT 2444 816 | #define SCI_AUTOCGETCURRENT 2445 817 | #define SCI_AUTOCGETCURRENTTEXT 2610 818 | #define SC_CASEINSENSITIVEBEHAVIOUR_RESPECTCASE 0 819 | #define SC_CASEINSENSITIVEBEHAVIOUR_IGNORECASE 1 820 | #define SCI_AUTOCSETCASEINSENSITIVEBEHAVIOUR 2634 821 | #define SCI_AUTOCGETCASEINSENSITIVEBEHAVIOUR 2635 822 | #define SC_MULTIAUTOC_ONCE 0 823 | #define SC_MULTIAUTOC_EACH 1 824 | #define SCI_AUTOCSETMULTI 2636 825 | #define SCI_AUTOCGETMULTI 2637 826 | #define SC_ORDER_PRESORTED 0 827 | #define SC_ORDER_PERFORMSORT 1 828 | #define SC_ORDER_CUSTOM 2 829 | #define SCI_AUTOCSETORDER 2660 830 | #define SCI_AUTOCGETORDER 2661 831 | #define SCI_ALLOCATE 2446 832 | #define SCI_TARGETASUTF8 2447 833 | #define SCI_SETLENGTHFORENCODE 2448 834 | #define SCI_ENCODEDFROMUTF8 2449 835 | #define SCI_FINDCOLUMN 2456 836 | #define SC_CARETSTICKY_OFF 0 837 | #define SC_CARETSTICKY_ON 1 838 | #define SC_CARETSTICKY_WHITESPACE 2 839 | #define SCI_GETCARETSTICKY 2457 840 | #define SCI_SETCARETSTICKY 2458 841 | #define SCI_TOGGLECARETSTICKY 2459 842 | #define SCI_SETPASTECONVERTENDINGS 2467 843 | #define SCI_GETPASTECONVERTENDINGS 2468 844 | #define SCI_SELECTIONDUPLICATE 2469 845 | #define SCI_SETCARETLINEBACKALPHA 2470 846 | #define SCI_GETCARETLINEBACKALPHA 2471 847 | #define CARETSTYLE_INVISIBLE 0 848 | #define CARETSTYLE_LINE 1 849 | #define CARETSTYLE_BLOCK 2 850 | #define CARETSTYLE_OVERSTRIKE_BAR 0 851 | #define CARETSTYLE_OVERSTRIKE_BLOCK 0x10 852 | #define CARETSTYLE_INS_MASK 0xF 853 | #define CARETSTYLE_BLOCK_AFTER 0x100 854 | #define SCI_SETCARETSTYLE 2512 855 | #define SCI_GETCARETSTYLE 2513 856 | #define SCI_SETINDICATORCURRENT 2500 857 | #define SCI_GETINDICATORCURRENT 2501 858 | #define SCI_SETINDICATORVALUE 2502 859 | #define SCI_GETINDICATORVALUE 2503 860 | #define SCI_INDICATORFILLRANGE 2504 861 | #define SCI_INDICATORCLEARRANGE 2505 862 | #define SCI_INDICATORALLONFOR 2506 863 | #define SCI_INDICATORVALUEAT 2507 864 | #define SCI_INDICATORSTART 2508 865 | #define SCI_INDICATOREND 2509 866 | #define SCI_SETPOSITIONCACHE 2514 867 | #define SCI_GETPOSITIONCACHE 2515 868 | #define SCI_COPYALLOWLINE 2519 869 | #define SCI_GETCHARACTERPOINTER 2520 870 | #define SCI_GETRANGEPOINTER 2643 871 | #define SCI_GETGAPPOSITION 2644 872 | #define SCI_INDICSETALPHA 2523 873 | #define SCI_INDICGETALPHA 2524 874 | #define SCI_INDICSETOUTLINEALPHA 2558 875 | #define SCI_INDICGETOUTLINEALPHA 2559 876 | #define SCI_SETEXTRAASCENT 2525 877 | #define SCI_GETEXTRAASCENT 2526 878 | #define SCI_SETEXTRADESCENT 2527 879 | #define SCI_GETEXTRADESCENT 2528 880 | #define SCI_MARKERSYMBOLDEFINED 2529 881 | #define SCI_MARGINSETTEXT 2530 882 | #define SCI_MARGINGETTEXT 2531 883 | #define SCI_MARGINSETSTYLE 2532 884 | #define SCI_MARGINGETSTYLE 2533 885 | #define SCI_MARGINSETSTYLES 2534 886 | #define SCI_MARGINGETSTYLES 2535 887 | #define SCI_MARGINTEXTCLEARALL 2536 888 | #define SCI_MARGINSETSTYLEOFFSET 2537 889 | #define SCI_MARGINGETSTYLEOFFSET 2538 890 | #define SC_MARGINOPTION_NONE 0 891 | #define SC_MARGINOPTION_SUBLINESELECT 1 892 | #define SCI_SETMARGINOPTIONS 2539 893 | #define SCI_GETMARGINOPTIONS 2557 894 | #define SCI_ANNOTATIONSETTEXT 2540 895 | #define SCI_ANNOTATIONGETTEXT 2541 896 | #define SCI_ANNOTATIONSETSTYLE 2542 897 | #define SCI_ANNOTATIONGETSTYLE 2543 898 | #define SCI_ANNOTATIONSETSTYLES 2544 899 | #define SCI_ANNOTATIONGETSTYLES 2545 900 | #define SCI_ANNOTATIONGETLINES 2546 901 | #define SCI_ANNOTATIONCLEARALL 2547 902 | #define ANNOTATION_HIDDEN 0 903 | #define ANNOTATION_STANDARD 1 904 | #define ANNOTATION_BOXED 2 905 | #define ANNOTATION_INDENTED 3 906 | #define SCI_ANNOTATIONSETVISIBLE 2548 907 | #define SCI_ANNOTATIONGETVISIBLE 2549 908 | #define SCI_ANNOTATIONSETSTYLEOFFSET 2550 909 | #define SCI_ANNOTATIONGETSTYLEOFFSET 2551 910 | #define SCI_RELEASEALLEXTENDEDSTYLES 2552 911 | #define SCI_ALLOCATEEXTENDEDSTYLES 2553 912 | #define UNDO_NONE 0 913 | #define UNDO_MAY_COALESCE 1 914 | #define SCI_ADDUNDOACTION 2560 915 | #define SCI_CHARPOSITIONFROMPOINT 2561 916 | #define SCI_CHARPOSITIONFROMPOINTCLOSE 2562 917 | #define SCI_SETMOUSESELECTIONRECTANGULARSWITCH 2668 918 | #define SCI_GETMOUSESELECTIONRECTANGULARSWITCH 2669 919 | #define SCI_SETMULTIPLESELECTION 2563 920 | #define SCI_GETMULTIPLESELECTION 2564 921 | #define SCI_SETADDITIONALSELECTIONTYPING 2565 922 | #define SCI_GETADDITIONALSELECTIONTYPING 2566 923 | #define SCI_SETADDITIONALCARETSBLINK 2567 924 | #define SCI_GETADDITIONALCARETSBLINK 2568 925 | #define SCI_SETADDITIONALCARETSVISIBLE 2608 926 | #define SCI_GETADDITIONALCARETSVISIBLE 2609 927 | #define SCI_GETSELECTIONS 2570 928 | #define SCI_GETSELECTIONEMPTY 2650 929 | #define SCI_CLEARSELECTIONS 2571 930 | #define SCI_SETSELECTION 2572 931 | #define SCI_ADDSELECTION 2573 932 | #define SCI_DROPSELECTIONN 2671 933 | #define SCI_SETMAINSELECTION 2574 934 | #define SCI_GETMAINSELECTION 2575 935 | #define SCI_SETSELECTIONNCARET 2576 936 | #define SCI_GETSELECTIONNCARET 2577 937 | #define SCI_SETSELECTIONNANCHOR 2578 938 | #define SCI_GETSELECTIONNANCHOR 2579 939 | #define SCI_SETSELECTIONNCARETVIRTUALSPACE 2580 940 | #define SCI_GETSELECTIONNCARETVIRTUALSPACE 2581 941 | #define SCI_SETSELECTIONNANCHORVIRTUALSPACE 2582 942 | #define SCI_GETSELECTIONNANCHORVIRTUALSPACE 2583 943 | #define SCI_SETSELECTIONNSTART 2584 944 | #define SCI_GETSELECTIONNSTART 2585 945 | #define SCI_GETSELECTIONNSTARTVIRTUALSPACE 2726 946 | #define SCI_SETSELECTIONNEND 2586 947 | #define SCI_GETSELECTIONNENDVIRTUALSPACE 2727 948 | #define SCI_GETSELECTIONNEND 2587 949 | #define SCI_SETRECTANGULARSELECTIONCARET 2588 950 | #define SCI_GETRECTANGULARSELECTIONCARET 2589 951 | #define SCI_SETRECTANGULARSELECTIONANCHOR 2590 952 | #define SCI_GETRECTANGULARSELECTIONANCHOR 2591 953 | #define SCI_SETRECTANGULARSELECTIONCARETVIRTUALSPACE 2592 954 | #define SCI_GETRECTANGULARSELECTIONCARETVIRTUALSPACE 2593 955 | #define SCI_SETRECTANGULARSELECTIONANCHORVIRTUALSPACE 2594 956 | #define SCI_GETRECTANGULARSELECTIONANCHORVIRTUALSPACE 2595 957 | #define SCVS_NONE 0 958 | #define SCVS_RECTANGULARSELECTION 1 959 | #define SCVS_USERACCESSIBLE 2 960 | #define SCVS_NOWRAPLINESTART 4 961 | #define SCI_SETVIRTUALSPACEOPTIONS 2596 962 | #define SCI_GETVIRTUALSPACEOPTIONS 2597 963 | #define SCI_SETRECTANGULARSELECTIONMODIFIER 2598 964 | #define SCI_GETRECTANGULARSELECTIONMODIFIER 2599 965 | #define SCI_SETADDITIONALSELFORE 2600 966 | #define SCI_SETADDITIONALSELBACK 2601 967 | #define SCI_SETADDITIONALSELALPHA 2602 968 | #define SCI_GETADDITIONALSELALPHA 2603 969 | #define SCI_SETADDITIONALCARETFORE 2604 970 | #define SCI_GETADDITIONALCARETFORE 2605 971 | #define SCI_ROTATESELECTION 2606 972 | #define SCI_SWAPMAINANCHORCARET 2607 973 | #define SCI_MULTIPLESELECTADDNEXT 2688 974 | #define SCI_MULTIPLESELECTADDEACH 2689 975 | #define SCI_CHANGELEXERSTATE 2617 976 | #define SCI_CONTRACTEDFOLDNEXT 2618 977 | #define SCI_VERTICALCENTRECARET 2619 978 | #define SCI_MOVESELECTEDLINESUP 2620 979 | #define SCI_MOVESELECTEDLINESDOWN 2621 980 | #define SCI_SETIDENTIFIER 2622 981 | #define SCI_GETIDENTIFIER 2623 982 | #define SCI_RGBAIMAGESETWIDTH 2624 983 | #define SCI_RGBAIMAGESETHEIGHT 2625 984 | #define SCI_RGBAIMAGESETSCALE 2651 985 | #define SCI_MARKERDEFINERGBAIMAGE 2626 986 | #define SCI_REGISTERRGBAIMAGE 2627 987 | #define SCI_SCROLLTOSTART 2628 988 | #define SCI_SCROLLTOEND 2629 989 | #define SC_TECHNOLOGY_DEFAULT 0 990 | #define SC_TECHNOLOGY_DIRECTWRITE 1 991 | #define SC_TECHNOLOGY_DIRECTWRITERETAIN 2 992 | #define SC_TECHNOLOGY_DIRECTWRITEDC 3 993 | #define SCI_SETTECHNOLOGY 2630 994 | #define SCI_GETTECHNOLOGY 2631 995 | #define SCI_CREATELOADER 2632 996 | #define SCI_FINDINDICATORSHOW 2640 997 | #define SCI_FINDINDICATORFLASH 2641 998 | #define SCI_FINDINDICATORHIDE 2642 999 | #define SCI_VCHOMEDISPLAY 2652 1000 | #define SCI_VCHOMEDISPLAYEXTEND 2653 1001 | #define SCI_GETCARETLINEVISIBLEALWAYS 2654 1002 | #define SCI_SETCARETLINEVISIBLEALWAYS 2655 1003 | #define SC_LINE_END_TYPE_DEFAULT 0 1004 | #define SC_LINE_END_TYPE_UNICODE 1 1005 | #define SCI_SETLINEENDTYPESALLOWED 2656 1006 | #define SCI_GETLINEENDTYPESALLOWED 2657 1007 | #define SCI_GETLINEENDTYPESACTIVE 2658 1008 | #define SCI_SETREPRESENTATION 2665 1009 | #define SCI_GETREPRESENTATION 2666 1010 | #define SCI_CLEARREPRESENTATION 2667 1011 | #define SCI_EOLANNOTATIONSETTEXT 2740 1012 | #define SCI_EOLANNOTATIONGETTEXT 2741 1013 | #define SCI_EOLANNOTATIONSETSTYLE 2742 1014 | #define SCI_EOLANNOTATIONGETSTYLE 2743 1015 | #define SCI_EOLANNOTATIONCLEARALL 2744 1016 | #define EOLANNOTATION_HIDDEN 0 1017 | #define EOLANNOTATION_STANDARD 1 1018 | #define EOLANNOTATION_BOXED 2 1019 | #define SCI_EOLANNOTATIONSETVISIBLE 2745 1020 | #define SCI_EOLANNOTATIONGETVISIBLE 2746 1021 | #define SCI_EOLANNOTATIONSETSTYLEOFFSET 2747 1022 | #define SCI_EOLANNOTATIONGETSTYLEOFFSET 2748 1023 | #define SCI_STARTRECORD 3001 1024 | #define SCI_STOPRECORD 3002 1025 | #define SCI_SETLEXER 4001 1026 | #define SCI_GETLEXER 4002 1027 | #define SCI_COLOURISE 4003 1028 | #define SCI_SETPROPERTY 4004 1029 | // #define KEYWORDSET_MAX 8 1030 | #define KEYWORDSET_MAX 30 1031 | #define SCI_SETKEYWORDS 4005 1032 | #define SCI_SETLEXERLANGUAGE 4006 1033 | #define SCI_LOADLEXERLIBRARY 4007 1034 | #define SCI_GETPROPERTY 4008 1035 | #define SCI_GETPROPERTYEXPANDED 4009 1036 | #define SCI_GETPROPERTYINT 4010 1037 | #define SCI_GETLEXERLANGUAGE 4012 1038 | #define SCI_PRIVATELEXERCALL 4013 1039 | #define SCI_PROPERTYNAMES 4014 1040 | #define SC_TYPE_BOOLEAN 0 1041 | #define SC_TYPE_INTEGER 1 1042 | #define SC_TYPE_STRING 2 1043 | #define SCI_PROPERTYTYPE 4015 1044 | #define SCI_DESCRIBEPROPERTY 4016 1045 | #define SCI_DESCRIBEKEYWORDSETS 4017 1046 | #define SCI_GETLINEENDTYPESSUPPORTED 4018 1047 | #define SCI_ALLOCATESUBSTYLES 4020 1048 | #define SCI_GETSUBSTYLESSTART 4021 1049 | #define SCI_GETSUBSTYLESLENGTH 4022 1050 | #define SCI_GETSTYLEFROMSUBSTYLE 4027 1051 | #define SCI_GETPRIMARYSTYLEFROMSTYLE 4028 1052 | #define SCI_FREESUBSTYLES 4023 1053 | #define SCI_SETIDENTIFIERS 4024 1054 | #define SCI_DISTANCETOSECONDARYSTYLES 4025 1055 | #define SCI_GETSUBSTYLEBASES 4026 1056 | #define SCI_GETNAMEDSTYLES 4029 1057 | #define SCI_NAMEOFSTYLE 4030 1058 | #define SCI_TAGSOFSTYLE 4031 1059 | #define SCI_DESCRIPTIONOFSTYLE 4032 1060 | #define SCI_SETILEXER 4033 1061 | #define SC_MOD_NONE 0x0 1062 | #define SC_MOD_INSERTTEXT 0x1 1063 | #define SC_MOD_DELETETEXT 0x2 1064 | #define SC_MOD_CHANGESTYLE 0x4 1065 | #define SC_MOD_CHANGEFOLD 0x8 1066 | #define SC_PERFORMED_USER 0x10 1067 | #define SC_PERFORMED_UNDO 0x20 1068 | #define SC_PERFORMED_REDO 0x40 1069 | #define SC_MULTISTEPUNDOREDO 0x80 1070 | #define SC_LASTSTEPINUNDOREDO 0x100 1071 | #define SC_MOD_CHANGEMARKER 0x200 1072 | #define SC_MOD_BEFOREINSERT 0x400 1073 | #define SC_MOD_BEFOREDELETE 0x800 1074 | #define SC_MULTILINEUNDOREDO 0x1000 1075 | #define SC_STARTACTION 0x2000 1076 | #define SC_MOD_CHANGEINDICATOR 0x4000 1077 | #define SC_MOD_CHANGELINESTATE 0x8000 1078 | #define SC_MOD_CHANGEMARGIN 0x10000 1079 | #define SC_MOD_CHANGEANNOTATION 0x20000 1080 | #define SC_MOD_CONTAINER 0x40000 1081 | #define SC_MOD_LEXERSTATE 0x80000 1082 | #define SC_MOD_INSERTCHECK 0x100000 1083 | #define SC_MOD_CHANGETABSTOPS 0x200000 1084 | #define SC_MOD_CHANGEEOLANNOTATION 0x400000 1085 | #define SC_MODEVENTMASKALL 0x7FFFFF 1086 | #define SC_SEARCHRESULT_LINEBUFFERMAXLENGTH 2048 1087 | #define SC_UPDATE_CONTENT 0x1 1088 | #define SC_UPDATE_SELECTION 0x2 1089 | #define SC_UPDATE_V_SCROLL 0x4 1090 | #define SC_UPDATE_H_SCROLL 0x8 1091 | #define SCEN_CHANGE 768 1092 | #define SCEN_SETFOCUS 512 1093 | #define SCEN_KILLFOCUS 256 1094 | #define SCK_DOWN 300 1095 | #define SCK_UP 301 1096 | #define SCK_LEFT 302 1097 | #define SCK_RIGHT 303 1098 | #define SCK_HOME 304 1099 | #define SCK_END 305 1100 | #define SCK_PRIOR 306 1101 | #define SCK_NEXT 307 1102 | #define SCK_DELETE 308 1103 | #define SCK_INSERT 309 1104 | #define SCK_ESCAPE 7 1105 | #define SCK_BACK 8 1106 | #define SCK_TAB 9 1107 | #define SCK_RETURN 13 1108 | #define SCK_ADD 310 1109 | #define SCK_SUBTRACT 311 1110 | #define SCK_DIVIDE 312 1111 | #define SCK_WIN 313 1112 | #define SCK_RWIN 314 1113 | #define SCK_MENU 315 1114 | #define SCMOD_NORM 0 1115 | #define SCMOD_SHIFT 1 1116 | #define SCMOD_CTRL 2 1117 | #define SCMOD_ALT 4 1118 | #define SCMOD_SUPER 8 1119 | #define SCMOD_META 16 1120 | #define SC_AC_FILLUP 1 1121 | #define SC_AC_DOUBLECLICK 2 1122 | #define SC_AC_TAB 3 1123 | #define SC_AC_NEWLINE 4 1124 | #define SC_AC_COMMAND 5 1125 | #define SC_CHARACTERSOURCE_DIRECT_INPUT 0 1126 | #define SC_CHARACTERSOURCE_TENTATIVE_INPUT 1 1127 | #define SC_CHARACTERSOURCE_IME_RESULT 2 1128 | #define SCN_STYLENEEDED 2000 1129 | #define SCN_CHARADDED 2001 1130 | #define SCN_SAVEPOINTREACHED 2002 1131 | #define SCN_SAVEPOINTLEFT 2003 1132 | #define SCN_MODIFYATTEMPTRO 2004 1133 | #define SCN_KEY 2005 1134 | #define SCN_DOUBLECLICK 2006 1135 | #define SCN_UPDATEUI 2007 1136 | #define SCN_MODIFIED 2008 1137 | #define SCN_MACRORECORD 2009 1138 | #define SCN_MARGINCLICK 2010 1139 | #define SCN_NEEDSHOWN 2011 1140 | #define SCN_PAINTED 2013 1141 | #define SCN_USERLISTSELECTION 2014 1142 | #define SCN_URIDROPPED 2015 1143 | #define SCN_DWELLSTART 2016 1144 | #define SCN_DWELLEND 2017 1145 | #define SCN_ZOOM 2018 1146 | #define SCN_HOTSPOTCLICK 2019 1147 | #define SCN_HOTSPOTDOUBLECLICK 2020 1148 | #define SCN_CALLTIPCLICK 2021 1149 | #define SCN_AUTOCSELECTION 2022 1150 | #define SCN_INDICATORCLICK 2023 1151 | #define SCN_INDICATORRELEASE 2024 1152 | #define SCN_AUTOCCANCELLED 2025 1153 | #define SCN_AUTOCCHARDELETED 2026 1154 | #define SCN_HOTSPOTRELEASECLICK 2027 1155 | #define SCN_FOCUSIN 2028 1156 | #define SCN_FOCUSOUT 2029 1157 | #define SCN_AUTOCCOMPLETED 2030 1158 | #define SCN_MARGINRIGHTCLICK 2031 1159 | #define SCN_AUTOCSELECTIONCHANGE 2032 1160 | #ifndef SCI_DISABLE_PROVISIONAL 1161 | #define SC_BIDIRECTIONAL_DISABLED 0 1162 | #define SC_BIDIRECTIONAL_L2R 1 1163 | #define SC_BIDIRECTIONAL_R2L 2 1164 | #define SCI_GETBIDIRECTIONAL 2708 1165 | #define SCI_SETBIDIRECTIONAL 2709 1166 | #define SC_LINECHARACTERINDEX_NONE 0 1167 | #define SC_LINECHARACTERINDEX_UTF32 1 1168 | #define SC_LINECHARACTERINDEX_UTF16 2 1169 | #define SCI_GETLINECHARACTERINDEX 2710 1170 | #define SCI_ALLOCATELINECHARACTERINDEX 2711 1171 | #define SCI_RELEASELINECHARACTERINDEX 2712 1172 | #define SCI_LINEFROMINDEXPOSITION 2713 1173 | #define SCI_INDEXPOSITIONFROMLINE 2714 1174 | #endif 1175 | 1176 | #define SCI_GETBOOSTREGEXERRMSG 5000 1177 | 1178 | #define SCN_SCROLLED 2080 1179 | #define SCN_FOLDINGSTATECHANGED 2081 1180 | 1181 | /* --Autogenerated -- end of section automatically generated from Scintilla.iface */ 1182 | 1183 | #endif 1184 | 1185 | /* These structures are defined to be exactly the same shape as the Win32 1186 | * CHARRANGE, TEXTRANGE, FINDTEXTEX, FORMATRANGE, and NMHDR structs. 1187 | * So older code that treats Scintilla as a RichEdit will work. */ 1188 | 1189 | struct Sci_CharacterRange { 1190 | Sci_PositionCR cpMin; 1191 | Sci_PositionCR cpMax; 1192 | }; 1193 | 1194 | struct Sci_TextRange { 1195 | struct Sci_CharacterRange chrg; 1196 | char *lpstrText; 1197 | }; 1198 | 1199 | struct Sci_TextToFind { 1200 | struct Sci_CharacterRange chrg; 1201 | const char *lpstrText; 1202 | struct Sci_CharacterRange chrgText; 1203 | }; 1204 | 1205 | typedef void *Sci_SurfaceID; 1206 | 1207 | struct Sci_Rectangle { 1208 | int left; 1209 | int top; 1210 | int right; 1211 | int bottom; 1212 | }; 1213 | 1214 | /* This structure is used in printing and requires some of the graphics types 1215 | * from Platform.h. Not needed by most client code. */ 1216 | 1217 | struct Sci_RangeToFormat { 1218 | Sci_SurfaceID hdc; 1219 | Sci_SurfaceID hdcTarget; 1220 | struct Sci_Rectangle rc; 1221 | struct Sci_Rectangle rcPage; 1222 | struct Sci_CharacterRange chrg; 1223 | }; 1224 | 1225 | #ifndef __cplusplus 1226 | /* For the GTK+ platform, g-ir-scanner needs to have these typedefs. This 1227 | * is not required in C++ code and actually seems to break ScintillaEditPy */ 1228 | typedef struct Sci_NotifyHeader Sci_NotifyHeader; 1229 | typedef struct SCNotification SCNotification; 1230 | #endif 1231 | 1232 | struct Sci_NotifyHeader { 1233 | /* Compatible with Windows NMHDR. 1234 | * hwndFrom is really an environment specific window handle or pointer 1235 | * but most clients of Scintilla.h do not have this type visible. */ 1236 | void *hwndFrom; 1237 | uptr_t idFrom; 1238 | unsigned int code; 1239 | }; 1240 | 1241 | struct SCNotification { 1242 | Sci_NotifyHeader nmhdr; 1243 | Sci_Position position; 1244 | /* SCN_STYLENEEDED, SCN_DOUBLECLICK, SCN_MODIFIED, SCN_MARGINCLICK, */ 1245 | /* SCN_NEEDSHOWN, SCN_DWELLSTART, SCN_DWELLEND, SCN_CALLTIPCLICK, */ 1246 | /* SCN_HOTSPOTCLICK, SCN_HOTSPOTDOUBLECLICK, SCN_HOTSPOTRELEASECLICK, */ 1247 | /* SCN_INDICATORCLICK, SCN_INDICATORRELEASE, */ 1248 | /* SCN_USERLISTSELECTION, SCN_AUTOCSELECTION */ 1249 | 1250 | int ch; 1251 | /* SCN_CHARADDED, SCN_KEY, SCN_AUTOCCOMPLETED, SCN_AUTOCSELECTION, */ 1252 | /* SCN_USERLISTSELECTION */ 1253 | int modifiers; 1254 | /* SCN_KEY, SCN_DOUBLECLICK, SCN_HOTSPOTCLICK, SCN_HOTSPOTDOUBLECLICK, */ 1255 | /* SCN_HOTSPOTRELEASECLICK, SCN_INDICATORCLICK, SCN_INDICATORRELEASE, */ 1256 | 1257 | int modificationType; /* SCN_MODIFIED */ 1258 | const char *text; 1259 | /* SCN_MODIFIED, SCN_USERLISTSELECTION, SCN_AUTOCSELECTION, SCN_URIDROPPED */ 1260 | 1261 | Sci_Position length; /* SCN_MODIFIED */ 1262 | Sci_Position linesAdded; /* SCN_MODIFIED */ 1263 | int message; /* SCN_MACRORECORD */ 1264 | uptr_t wParam; /* SCN_MACRORECORD */ 1265 | sptr_t lParam; /* SCN_MACRORECORD */ 1266 | Sci_Position line; /* SCN_MODIFIED */ 1267 | int foldLevelNow; /* SCN_MODIFIED */ 1268 | int foldLevelPrev; /* SCN_MODIFIED */ 1269 | int margin; /* SCN_MARGINCLICK */ 1270 | int listType; /* SCN_USERLISTSELECTION */ 1271 | int x; /* SCN_DWELLSTART, SCN_DWELLEND */ 1272 | int y; /* SCN_DWELLSTART, SCN_DWELLEND */ 1273 | int token; /* SCN_MODIFIED with SC_MOD_CONTAINER */ 1274 | Sci_Position annotationLinesAdded; /* SCN_MODIFIED with SC_MOD_CHANGEANNOTATION */ 1275 | int updated; /* SCN_UPDATEUI */ 1276 | int listCompletionMethod; 1277 | /* SCN_AUTOCSELECTION, SCN_AUTOCCOMPLETED, SCN_USERLISTSELECTION, */ 1278 | int characterSource; /* SCN_CHARADDED */ 1279 | }; 1280 | 1281 | struct SearchResultMarking { 1282 | intptr_t _start; 1283 | intptr_t _end; 1284 | }; 1285 | 1286 | struct SearchResultMarkings { 1287 | intptr_t _length; 1288 | SearchResultMarking *_markings; 1289 | }; 1290 | 1291 | #ifdef INCLUDE_DEPRECATED_FEATURES 1292 | 1293 | #define SCI_SETKEYSUNICODE 2521 1294 | #define SCI_GETKEYSUNICODE 2522 1295 | 1296 | #define SCI_GETTWOPHASEDRAW 2283 1297 | #define SCI_SETTWOPHASEDRAW 2284 1298 | 1299 | #define CharacterRange Sci_CharacterRange 1300 | #define TextRange Sci_TextRange 1301 | #define TextToFind Sci_TextToFind 1302 | #define RangeToFormat Sci_RangeToFormat 1303 | #define NotifyHeader Sci_NotifyHeader 1304 | 1305 | #define SCI_SETSTYLEBITS 2090 1306 | #define SCI_GETSTYLEBITS 2091 1307 | #define SCI_GETSTYLEBITSNEEDED 4011 1308 | 1309 | #define INDIC0_MASK 0x20 1310 | #define INDIC1_MASK 0x40 1311 | #define INDIC2_MASK 0x80 1312 | #define INDICS_MASK 0xE0 1313 | 1314 | #endif 1315 | 1316 | #endif 1317 | -------------------------------------------------------------------------------- /SettingsDlg.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include "PluginInterface.h" 6 | #include "PluginDefinition.h" 7 | #include "HorizontalRuler.h" 8 | #include "resource.h" 9 | 10 | extern HINSTANCE g_hInst; 11 | extern NppData nppData; 12 | 13 | extern bool g_bBsUnindent; 14 | extern bool g_bIndentGuideLF; 15 | extern HorizontalRuler mainHRuler; 16 | extern HorizontalRuler subHRuler; 17 | 18 | INT_PTR CALLBACK SettingsDlg( HWND hWndDlg, UINT msg, WPARAM wParam, 19 | LPARAM lParam ) 20 | { 21 | switch ( msg ) 22 | { 23 | case WM_INITDIALOG: 24 | { 25 | SendMessage( GetDlgItem( hWndDlg, IDC_CHK_BSU ), BM_SETCHECK, 26 | ( WPARAM )( g_bBsUnindent ? 1 : 0 ), 0 ); 27 | SendMessage( GetDlgItem( hWndDlg, IDC_CHK_IGLF ), BM_SETCHECK, 28 | ( WPARAM )( g_bIndentGuideLF ? 1 : 0 ), 0 ); 29 | 30 | SendMessage( GetDlgItem( hWndDlg, IDC_RBN_0 ), BM_SETCHECK, 31 | ( WPARAM )( mainHRuler.bRulerStart ? 0 : 1 ), 0 ); 32 | SendMessage( GetDlgItem( hWndDlg, IDC_RBN_1 ), BM_SETCHECK, 33 | ( WPARAM )( mainHRuler.bRulerStart ? 1 : 0 ), 0 ); 34 | 35 | std::string version; 36 | version = ""; 37 | version += VER_STRING; 38 | version += ""; 39 | SetDlgItemTextA(hWndDlg, IDC_STC_VER, version.c_str()); 40 | 41 | return TRUE; 42 | } 43 | 44 | case WM_CLOSE: 45 | { 46 | PostMessage( hWndDlg, WM_DESTROY, 0, 0 ); 47 | return TRUE; 48 | } 49 | 50 | case WM_DESTROY: 51 | { 52 | EndDialog( hWndDlg, 0 ); 53 | return TRUE; 54 | } 55 | 56 | case WM_NOTIFY: 57 | { 58 | switch (((LPNMHDR)lParam)->code) 59 | { 60 | case NM_CLICK: 61 | case NM_RETURN: 62 | { 63 | PNMLINK pNMLink = (PNMLINK)lParam; 64 | LITEM item = pNMLink->item; 65 | HWND ver = GetDlgItem( hWndDlg, IDC_STC_VER ); 66 | 67 | if ((((LPNMHDR)lParam)->hwndFrom == ver) && (item.iLink == 0)) 68 | ShellExecute(hWndDlg, TEXT("open"), TEXT("https://github.com/VinsWorldcom/nppColumnTools"), NULL, NULL, SW_SHOWNORMAL); 69 | 70 | return TRUE; 71 | } 72 | } 73 | break; 74 | } 75 | 76 | case WM_COMMAND: 77 | { 78 | switch ( wParam ) 79 | { 80 | case IDB_OK: 81 | PostMessage( hWndDlg, WM_CLOSE, 0, 0 ); 82 | return TRUE; 83 | 84 | case IDC_CHK_BSU: 85 | { 86 | int check = ( int )::SendMessage( GetDlgItem( hWndDlg, IDC_CHK_BSU ), 87 | BM_GETCHECK, 0, 0 ); 88 | 89 | if ( check & BST_CHECKED ) 90 | g_bBsUnindent = true; 91 | else 92 | g_bBsUnindent = false; 93 | 94 | doBufferSets(); 95 | 96 | return TRUE; 97 | } 98 | 99 | case IDC_CHK_IGLF: 100 | { 101 | int check = ( int )::SendMessage( GetDlgItem( hWndDlg, IDC_CHK_IGLF ), 102 | BM_GETCHECK, 0, 0 ); 103 | 104 | if ( check & BST_CHECKED ) 105 | g_bIndentGuideLF = true; 106 | else 107 | g_bIndentGuideLF = false; 108 | 109 | doBufferSets(); 110 | 111 | return TRUE; 112 | } 113 | 114 | case IDC_RBN_0: 115 | { 116 | int check = ( int )::SendMessage( GetDlgItem( hWndDlg, IDC_RBN_0 ), 117 | BM_GETCHECK, 0, 0 ); 118 | 119 | if ( check & BST_CHECKED ) 120 | { 121 | mainHRuler.bRulerStart = false; 122 | subHRuler.bRulerStart = false; 123 | } 124 | else 125 | { 126 | mainHRuler.bRulerStart = true; 127 | subHRuler.bRulerStart = true; 128 | } 129 | 130 | SendMessage( GetDlgItem( hWndDlg, IDC_RBN_1 ), BM_SETCHECK, 131 | ( WPARAM )( mainHRuler.bRulerStart ? 1 : 0 ), 0 ); 132 | 133 | return TRUE; 134 | } 135 | 136 | case IDC_RBN_1: 137 | { 138 | int check = ( int )::SendMessage( GetDlgItem( hWndDlg, IDC_RBN_1 ), 139 | BM_GETCHECK, 0, 0 ); 140 | 141 | if ( check & BST_CHECKED ) 142 | { 143 | mainHRuler.bRulerStart = true; 144 | subHRuler.bRulerStart = true; 145 | } 146 | else 147 | { 148 | mainHRuler.bRulerStart = false; 149 | subHRuler.bRulerStart = false; 150 | } 151 | 152 | SendMessage( GetDlgItem( hWndDlg, IDC_RBN_0 ), BM_SETCHECK, 153 | ( WPARAM )( mainHRuler.bRulerStart ? 0 : 1 ), 0 ); 154 | 155 | return TRUE; 156 | } 157 | 158 | case IDCANCEL: 159 | { 160 | EndDialog(hWndDlg, 0); 161 | return TRUE; 162 | } 163 | } 164 | } 165 | } 166 | 167 | return FALSE; 168 | } 169 | 170 | void doSettings() 171 | { 172 | DialogBoxParam( g_hInst, MAKEINTRESOURCE( IDD_SETTINGS ), 173 | nppData._nppHandle, SettingsDlg, 0 ); 174 | } 175 | -------------------------------------------------------------------------------- /SettingsDlg.h: -------------------------------------------------------------------------------- 1 | #ifndef SETTINGSDLG_H_ 2 | #define SETTINGSDLG_H 3 | 4 | void doSettings(); 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /menuCmdID.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vinsworldcom/nppColumnTools/e7c4d6fe2dac40edd560ad1300a398666ef6c904/menuCmdID.h -------------------------------------------------------------------------------- /resource.h: -------------------------------------------------------------------------------- 1 | #ifndef RESOURCE_H 2 | #define RESOURCE_H 3 | 4 | #define STR_HELPER(x) #x 5 | #define STR(x) STR_HELPER(x) 6 | 7 | /* VERSION DEFINITIONS */ 8 | #define VER_MAJOR 1 9 | #define VER_MINOR 4 10 | #define VER_RELEASE 5 11 | #define VER_BUILD 1 12 | #define VER_STRING STR(VER_MAJOR) "." STR(VER_MINOR) "." STR(VER_RELEASE) "." STR(VER_BUILD) 13 | 14 | #define FILE_DESCRIPTION "Notepad++ Plugin for column highlighting and ruler." 15 | #define INTERNAL_NAME "Column Tools" 16 | #define FILENAME "ColumnTools" 17 | 18 | #define COMPANY_NAME "Vin's World" 19 | #define FILE_VERSION VER_STRING 20 | #define LEGAL_COPYRIGHT "Copyright (C) VinsWorld. All Rights Reserved." 21 | #define LEGAL_TRADEMARKS "" 22 | #define ORIGINAL_FILENAME FILENAME ".dll" 23 | #define PRODUCT_NAME "Column Tools" 24 | #define PRODUCT_VERSION VER_STRING 25 | 26 | /* ADDITIONAL DEFINITIONS */ 27 | 28 | // Settings 29 | #ifndef IDC_STATIC 30 | #define IDC_STATIC -1 31 | #endif 32 | 33 | #define IDD_SETTINGS 2600 34 | 35 | #define IDB_OK (IDD_SETTINGS + 1) 36 | 37 | #define IDC_CHK_BSU (IDD_SETTINGS + 2) 38 | #define IDC_CHK_IGLF (IDD_SETTINGS + 3) 39 | 40 | #define IDC_GRP1 (IDD_SETTINGS + 4) 41 | #define IDC_RBN_0 (IDD_SETTINGS + 5) 42 | #define IDC_RBN_1 (IDD_SETTINGS + 6) 43 | 44 | #define IDC_STC_VER (IDD_SETTINGS + 7) 45 | 46 | #endif 47 | --------------------------------------------------------------------------------