├── .gitignore
├── BetterMultiSelection.sln
├── LICENSE
├── README.md
├── appveyor.yml
├── img
└── Demo.gif
└── src
├── BetterMultiSelection.vcxproj
├── BetterMultiSelection.vcxproj.filters
├── Dialogs
├── AboutDialog.cpp
├── AboutDialog.h
├── Hyperlinks.cpp
├── Hyperlinks.h
├── Version.rc
├── resource.h
└── resource.rc
├── GlobalMemory.h
├── Main.cpp
├── Npp
├── Notepad_plus_msgs.h
├── PluginInterface.h
├── SciLexer.h
├── Sci_Position.h
├── Scintilla.h
└── menuCmdID.h
├── ScintillaEditor.h
├── UniConversion.cpp
├── UniConversion.h
└── Version.h
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 | ##
4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
5 |
6 | # User-specific files
7 | *.suo
8 | *.user
9 | *.userosscache
10 | *.sln.docstates
11 |
12 | # User-specific files (MonoDevelop/Xamarin Studio)
13 | *.userprefs
14 |
15 | # Build results
16 | [Dd]ebug/
17 | [Dd]ebugPublic/
18 | [Rr]elease/
19 | [Rr]eleases/
20 | x64/
21 | x86/
22 | bld/
23 | [Bb]in/
24 | [Oo]bj/
25 | [Ll]og/
26 |
27 | # Visual Studio 2015 cache/options directory
28 | .vs/
29 | # Uncomment if you have tasks that create the project's static files in wwwroot
30 | #wwwroot/
31 |
32 | # MSTest test Results
33 | [Tt]est[Rr]esult*/
34 | [Bb]uild[Ll]og.*
35 |
36 | # NUNIT
37 | *.VisualState.xml
38 | TestResult.xml
39 |
40 | # Build Results of an ATL Project
41 | [Dd]ebugPS/
42 | [Rr]eleasePS/
43 | dlldata.c
44 |
45 | # .NET Core
46 | project.lock.json
47 | project.fragment.lock.json
48 | artifacts/
49 | **/Properties/launchSettings.json
50 |
51 | *_i.c
52 | *_p.c
53 | *_i.h
54 | *.ilk
55 | *.meta
56 | *.obj
57 | *.pch
58 | *.pdb
59 | *.pgc
60 | *.pgd
61 | *.rsp
62 | *.sbr
63 | *.tlb
64 | *.tli
65 | *.tlh
66 | *.tmp
67 | *.tmp_proj
68 | *.log
69 | *.vspscc
70 | *.vssscc
71 | .builds
72 | *.pidb
73 | *.svclog
74 | *.scc
75 |
76 | # Chutzpah Test files
77 | _Chutzpah*
78 |
79 | # Visual C++ cache files
80 | ipch/
81 | *.aps
82 | *.ncb
83 | *.opendb
84 | *.opensdf
85 | *.sdf
86 | *.cachefile
87 | *.VC.db
88 | *.VC.VC.opendb
89 |
90 | # Visual Studio profiler
91 | *.psess
92 | *.vsp
93 | *.vspx
94 | *.sap
95 |
96 | # TFS 2012 Local Workspace
97 | $tf/
98 |
99 | # Guidance Automation Toolkit
100 | *.gpState
101 |
102 | # ReSharper is a .NET coding add-in
103 | _ReSharper*/
104 | *.[Rr]e[Ss]harper
105 | *.DotSettings.user
106 |
107 | # JustCode is a .NET coding add-in
108 | .JustCode
109 |
110 | # TeamCity is a build add-in
111 | _TeamCity*
112 |
113 | # DotCover is a Code Coverage Tool
114 | *.dotCover
115 |
116 | # Visual Studio code coverage results
117 | *.coverage
118 | *.coveragexml
119 |
120 | # NCrunch
121 | _NCrunch_*
122 | .*crunch*.local.xml
123 | nCrunchTemp_*
124 |
125 | # MightyMoose
126 | *.mm.*
127 | AutoTest.Net/
128 |
129 | # Web workbench (sass)
130 | .sass-cache/
131 |
132 | # Installshield output folder
133 | [Ee]xpress/
134 |
135 | # DocProject is a documentation generator add-in
136 | DocProject/buildhelp/
137 | DocProject/Help/*.HxT
138 | DocProject/Help/*.HxC
139 | DocProject/Help/*.hhc
140 | DocProject/Help/*.hhk
141 | DocProject/Help/*.hhp
142 | DocProject/Help/Html2
143 | DocProject/Help/html
144 |
145 | # Click-Once directory
146 | publish/
147 |
148 | # Publish Web Output
149 | *.[Pp]ublish.xml
150 | *.azurePubxml
151 | # TODO: Comment the next line if you want to checkin your web deploy settings
152 | # but database connection strings (with potential passwords) will be unencrypted
153 | *.pubxml
154 | *.publishproj
155 |
156 | # Microsoft Azure Web App publish settings. Comment the next line if you want to
157 | # checkin your Azure Web App publish settings, but sensitive information contained
158 | # in these scripts will be unencrypted
159 | PublishScripts/
160 |
161 | # NuGet Packages
162 | *.nupkg
163 | # The packages folder can be ignored because of Package Restore
164 | **/packages/*
165 | # except build/, which is used as an MSBuild target.
166 | !**/packages/build/
167 | # Uncomment if necessary however generally it will be regenerated when needed
168 | #!**/packages/repositories.config
169 | # NuGet v3's project.json files produces more ignorable files
170 | *.nuget.props
171 | *.nuget.targets
172 |
173 | # Microsoft Azure Build Output
174 | csx/
175 | *.build.csdef
176 |
177 | # Microsoft Azure Emulator
178 | ecf/
179 | rcf/
180 |
181 | # Windows Store app package directories and files
182 | AppPackages/
183 | BundleArtifacts/
184 | Package.StoreAssociation.xml
185 | _pkginfo.txt
186 |
187 | # Visual Studio cache files
188 | # files ending in .cache can be ignored
189 | *.[Cc]ache
190 | # but keep track of directories ending in .cache
191 | !*.[Cc]ache/
192 |
193 | # Others
194 | ClientBin/
195 | ~$*
196 | *~
197 | *.dbmdl
198 | *.dbproj.schemaview
199 | *.jfm
200 | *.pfx
201 | *.publishsettings
202 | orleans.codegen.cs
203 |
204 | # Since there are multiple workflows, uncomment next line to ignore bower_components
205 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
206 | #bower_components/
207 |
208 | # RIA/Silverlight projects
209 | Generated_Code/
210 |
211 | # Backup & report files from converting an old project file
212 | # to a newer Visual Studio version. Backup files are not needed,
213 | # because we have git ;-)
214 | _UpgradeReport_Files/
215 | Backup*/
216 | UpgradeLog*.XML
217 | UpgradeLog*.htm
218 |
219 | # SQL Server files
220 | *.mdf
221 | *.ldf
222 | *.ndf
223 |
224 | # Business Intelligence projects
225 | *.rdl.data
226 | *.bim.layout
227 | *.bim_*.settings
228 |
229 | # Microsoft Fakes
230 | FakesAssemblies/
231 |
232 | # GhostDoc plugin setting file
233 | *.GhostDoc.xml
234 |
235 | # Node.js Tools for Visual Studio
236 | .ntvs_analysis.dat
237 | node_modules/
238 |
239 | # Typescript v1 declaration files
240 | typings/
241 |
242 | # Visual Studio 6 build log
243 | *.plg
244 |
245 | # Visual Studio 6 workspace options file
246 | *.opt
247 |
248 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
249 | *.vbw
250 |
251 | # Visual Studio LightSwitch build output
252 | **/*.HTMLClient/GeneratedArtifacts
253 | **/*.DesktopClient/GeneratedArtifacts
254 | **/*.DesktopClient/ModelManifest.xml
255 | **/*.Server/GeneratedArtifacts
256 | **/*.Server/ModelManifest.xml
257 | _Pvt_Extensions
258 |
259 | # Paket dependency manager
260 | .paket/paket.exe
261 | paket-files/
262 |
263 | # FAKE - F# Make
264 | .fake/
265 |
266 | # JetBrains Rider
267 | .idea/
268 | *.sln.iml
269 |
270 | # CodeRush
271 | .cr/
272 |
273 | # Python Tools for Visual Studio (PTVS)
274 | __pycache__/
275 | *.pyc
276 |
277 | # Cake - Uncomment if you are using it
278 | # tools/**
279 | # !tools/packages.config
280 |
281 | # Telerik's JustMock configuration file
282 | *.jmconfig
283 |
284 | # BizTalk build output
285 | *.btp.cs
286 | *.btm.cs
287 | *.odx.cs
288 | *.xsd.cs
289 |
--------------------------------------------------------------------------------
/BetterMultiSelection.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 14
4 | VisualStudioVersion = 14.0.25420.1
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BetterMultiSelection", "src\BetterMultiSelection.vcxproj", "{1590D7CD-7D3A-4AB7-A355-EE02F7FB987D}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Win32 = Debug|Win32
11 | Debug|x64 = Debug|x64
12 | Release|Win32 = Release|Win32
13 | Release|x64 = Release|x64
14 | EndGlobalSection
15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
16 | {1590D7CD-7D3A-4AB7-A355-EE02F7FB987D}.Debug|Win32.ActiveCfg = Debug|Win32
17 | {1590D7CD-7D3A-4AB7-A355-EE02F7FB987D}.Debug|Win32.Build.0 = Debug|Win32
18 | {1590D7CD-7D3A-4AB7-A355-EE02F7FB987D}.Debug|x64.ActiveCfg = Debug|x64
19 | {1590D7CD-7D3A-4AB7-A355-EE02F7FB987D}.Debug|x64.Build.0 = Debug|x64
20 | {1590D7CD-7D3A-4AB7-A355-EE02F7FB987D}.Release|Win32.ActiveCfg = Release|Win32
21 | {1590D7CD-7D3A-4AB7-A355-EE02F7FB987D}.Release|Win32.Build.0 = Release|Win32
22 | {1590D7CD-7D3A-4AB7-A355-EE02F7FB987D}.Release|x64.ActiveCfg = Release|x64
23 | {1590D7CD-7D3A-4AB7-A355-EE02F7FB987D}.Release|x64.Build.0 = Release|x64
24 | EndGlobalSection
25 | GlobalSection(SolutionProperties) = preSolution
26 | HideSolutionNode = FALSE
27 | EndGlobalSection
28 | EndGlobal
29 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 |
2 |
3 | GNU GENERAL PUBLIC LICENSE
4 | Version 2, June 1991
5 |
6 | Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
7 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
8 | Everyone is permitted to copy and distribute verbatim copies
9 | of this license document, but changing it is not allowed.
10 |
11 | Preamble
12 |
13 | The licenses for most software are designed to take away your
14 | freedom to share and change it. By contrast, the GNU General Public
15 | License is intended to guarantee your freedom to share and change free
16 | software--to make sure the software is free for all its users. This
17 | General Public License applies to most of the Free Software
18 | Foundation's software and to any other program whose authors commit to
19 | using it. (Some other Free Software Foundation software is covered by
20 | the GNU Lesser General Public License instead.) You can apply it to
21 | your programs, too.
22 |
23 | When we speak of free software, we are referring to freedom, not
24 | price. Our General Public Licenses are designed to make sure that you
25 | have the freedom to distribute copies of free software (and charge for
26 | this service if you wish), that you receive source code or can get it
27 | if you want it, that you can change the software or use pieces of it
28 | in new free programs; and that you know you can do these things.
29 |
30 | To protect your rights, we need to make restrictions that forbid
31 | anyone to deny you these rights or to ask you to surrender the rights.
32 | These restrictions translate to certain responsibilities for you if you
33 | distribute copies of the software, or if you modify it.
34 |
35 | For example, if you distribute copies of such a program, whether
36 | gratis or for a fee, you must give the recipients all the rights that
37 | you have. You must make sure that they, too, receive or can get the
38 | source code. And you must show them these terms so they know their
39 | rights.
40 |
41 | We protect your rights with two steps: (1) copyright the software, and
42 | (2) offer you this license which gives you legal permission to copy,
43 | distribute and/or modify the software.
44 |
45 | Also, for each author's protection and ours, we want to make certain
46 | that everyone understands that there is no warranty for this free
47 | software. If the software is modified by someone else and passed on, we
48 | want its recipients to know that what they have is not the original, so
49 | that any problems introduced by others will not reflect on the original
50 | authors' reputations.
51 |
52 | Finally, any free program is threatened constantly by software
53 | patents. We wish to avoid the danger that redistributors of a free
54 | program will individually obtain patent licenses, in effect making the
55 | program proprietary. To prevent this, we have made it clear that any
56 | patent must be licensed for everyone's free use or not licensed at all.
57 |
58 | The precise terms and conditions for copying, distribution and
59 | modification follow.
60 |
61 | GNU GENERAL PUBLIC LICENSE
62 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
63 |
64 | 0. This License applies to any program or other work which contains
65 | a notice placed by the copyright holder saying it may be distributed
66 | under the terms of this General Public License. The "Program", below,
67 | refers to any such program or work, and a "work based on the Program"
68 | means either the Program or any derivative work under copyright law:
69 | that is to say, a work containing the Program or a portion of it,
70 | either verbatim or with modifications and/or translated into another
71 | language. (Hereinafter, translation is included without limitation in
72 | the term "modification".) Each licensee is addressed as "you".
73 |
74 | Activities other than copying, distribution and modification are not
75 | covered by this License; they are outside its scope. The act of
76 | running the Program is not restricted, and the output from the Program
77 | is covered only if its contents constitute a work based on the
78 | Program (independent of having been made by running the Program).
79 | Whether that is true depends on what the Program does.
80 |
81 | 1. You may copy and distribute verbatim copies of the Program's
82 | source code as you receive it, in any medium, provided that you
83 | conspicuously and appropriately publish on each copy an appropriate
84 | copyright notice and disclaimer of warranty; keep intact all the
85 | notices that refer to this License and to the absence of any warranty;
86 | and give any other recipients of the Program a copy of this License
87 | along with the Program.
88 |
89 | You may charge a fee for the physical act of transferring a copy, and
90 | you may at your option offer warranty protection in exchange for a fee.
91 |
92 | 2. You may modify your copy or copies of the Program or any portion
93 | of it, thus forming a work based on the Program, and copy and
94 | distribute such modifications or work under the terms of Section 1
95 | above, provided that you also meet all of these conditions:
96 |
97 | a) You must cause the modified files to carry prominent notices
98 | stating that you changed the files and the date of any change.
99 |
100 | b) You must cause any work that you distribute or publish, that in
101 | whole or in part contains or is derived from the Program or any
102 | part thereof, to be licensed as a whole at no charge to all third
103 | parties under the terms of this License.
104 |
105 | c) If the modified program normally reads commands interactively
106 | when run, you must cause it, when started running for such
107 | interactive use in the most ordinary way, to print or display an
108 | announcement including an appropriate copyright notice and a
109 | notice that there is no warranty (or else, saying that you provide
110 | a warranty) and that users may redistribute the program under
111 | these conditions, and telling the user how to view a copy of this
112 | License. (Exception: if the Program itself is interactive but
113 | does not normally print such an announcement, your work based on
114 | the Program is not required to print an announcement.)
115 |
116 | These requirements apply to the modified work as a whole. If
117 | identifiable sections of that work are not derived from the Program,
118 | and can be reasonably considered independent and separate works in
119 | themselves, then this License, and its terms, do not apply to those
120 | sections when you distribute them as separate works. But when you
121 | distribute the same sections as part of a whole which is a work based
122 | on the Program, the distribution of the whole must be on the terms of
123 | this License, whose permissions for other licensees extend to the
124 | entire whole, and thus to each and every part regardless of who wrote it.
125 |
126 | Thus, it is not the intent of this section to claim rights or contest
127 | your rights to work written entirely by you; rather, the intent is to
128 | exercise the right to control the distribution of derivative or
129 | collective works based on the Program.
130 |
131 | In addition, mere aggregation of another work not based on the Program
132 | with the Program (or with a work based on the Program) on a volume of
133 | a storage or distribution medium does not bring the other work under
134 | the scope of this License.
135 |
136 | 3. You may copy and distribute the Program (or a work based on it,
137 | under Section 2) in object code or executable form under the terms of
138 | Sections 1 and 2 above provided that you also do one of the following:
139 |
140 | a) Accompany it with the complete corresponding machine-readable
141 | source code, which must be distributed under the terms of Sections
142 | 1 and 2 above on a medium customarily used for software interchange; or,
143 |
144 | b) Accompany it with a written offer, valid for at least three
145 | years, to give any third party, for a charge no more than your
146 | cost of physically performing source distribution, a complete
147 | machine-readable copy of the corresponding source code, to be
148 | distributed under the terms of Sections 1 and 2 above on a medium
149 | customarily used for software interchange; or,
150 |
151 | c) Accompany it with the information you received as to the offer
152 | to distribute corresponding source code. (This alternative is
153 | allowed only for noncommercial distribution and only if you
154 | received the program in object code or executable form with such
155 | an offer, in accord with Subsection b above.)
156 |
157 | The source code for a work means the preferred form of the work for
158 | making modifications to it. For an executable work, complete source
159 | code means all the source code for all modules it contains, plus any
160 | associated interface definition files, plus the scripts used to
161 | control compilation and installation of the executable. However, as a
162 | special exception, the source code distributed need not include
163 | anything that is normally distributed (in either source or binary
164 | form) with the major components (compiler, kernel, and so on) of the
165 | operating system on which the executable runs, unless that component
166 | itself accompanies the executable.
167 |
168 | If distribution of executable or object code is made by offering
169 | access to copy from a designated place, then offering equivalent
170 | access to copy the source code from the same place counts as
171 | distribution of the source code, even though third parties are not
172 | compelled to copy the source along with the object code.
173 |
174 | 4. You may not copy, modify, sublicense, or distribute the Program
175 | except as expressly provided under this License. Any attempt
176 | otherwise to copy, modify, sublicense or distribute the Program is
177 | void, and will automatically terminate your rights under this License.
178 | However, parties who have received copies, or rights, from you under
179 | this License will not have their licenses terminated so long as such
180 | parties remain in full compliance.
181 |
182 | 5. You are not required to accept this License, since you have not
183 | signed it. However, nothing else grants you permission to modify or
184 | distribute the Program or its derivative works. These actions are
185 | prohibited by law if you do not accept this License. Therefore, by
186 | modifying or distributing the Program (or any work based on the
187 | Program), you indicate your acceptance of this License to do so, and
188 | all its terms and conditions for copying, distributing or modifying
189 | the Program or works based on it.
190 |
191 | 6. Each time you redistribute the Program (or any work based on the
192 | Program), the recipient automatically receives a license from the
193 | original licensor to copy, distribute or modify the Program subject to
194 | these terms and conditions. You may not impose any further
195 | restrictions on the recipients' exercise of the rights granted herein.
196 | You are not responsible for enforcing compliance by third parties to
197 | this License.
198 |
199 | 7. If, as a consequence of a court judgment or allegation of patent
200 | infringement or for any other reason (not limited to patent issues),
201 | conditions are imposed on you (whether by court order, agreement or
202 | otherwise) that contradict the conditions of this License, they do not
203 | excuse you from the conditions of this License. If you cannot
204 | distribute so as to satisfy simultaneously your obligations under this
205 | License and any other pertinent obligations, then as a consequence you
206 | may not distribute the Program at all. For example, if a patent
207 | license would not permit royalty-free redistribution of the Program by
208 | all those who receive copies directly or indirectly through you, then
209 | the only way you could satisfy both it and this License would be to
210 | refrain entirely from distribution of the Program.
211 |
212 | If any portion of this section is held invalid or unenforceable under
213 | any particular circumstance, the balance of the section is intended to
214 | apply and the section as a whole is intended to apply in other
215 | circumstances.
216 |
217 | It is not the purpose of this section to induce you to infringe any
218 | patents or other property right claims or to contest validity of any
219 | such claims; this section has the sole purpose of protecting the
220 | integrity of the free software distribution system, which is
221 | implemented by public license practices. Many people have made
222 | generous contributions to the wide range of software distributed
223 | through that system in reliance on consistent application of that
224 | system; it is up to the author/donor to decide if he or she is willing
225 | to distribute software through any other system and a licensee cannot
226 | impose that choice.
227 |
228 | This section is intended to make thoroughly clear what is believed to
229 | be a consequence of the rest of this License.
230 |
231 | 8. If the distribution and/or use of the Program is restricted in
232 | certain countries either by patents or by copyrighted interfaces, the
233 | original copyright holder who places the Program under this License
234 | may add an explicit geographical distribution limitation excluding
235 | those countries, so that distribution is permitted only in or among
236 | countries not thus excluded. In such case, this License incorporates
237 | the limitation as if written in the body of this License.
238 |
239 | 9. The Free Software Foundation may publish revised and/or new versions
240 | of the General Public License from time to time. Such new versions will
241 | be similar in spirit to the present version, but may differ in detail to
242 | address new problems or concerns.
243 |
244 | Each version is given a distinguishing version number. If the Program
245 | specifies a version number of this License which applies to it and "any
246 | later version", you have the option of following the terms and conditions
247 | either of that version or of any later version published by the Free
248 | Software Foundation. If the Program does not specify a version number of
249 | this License, you may choose any version ever published by the Free Software
250 | Foundation.
251 |
252 | 10. If you wish to incorporate parts of the Program into other free
253 | programs whose distribution conditions are different, write to the author
254 | to ask for permission. For software which is copyrighted by the Free
255 | Software Foundation, write to the Free Software Foundation; we sometimes
256 | make exceptions for this. Our decision will be guided by the two goals
257 | of preserving the free status of all derivatives of our free software and
258 | of promoting the sharing and reuse of software generally.
259 |
260 | NO WARRANTY
261 |
262 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
263 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
264 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
265 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
266 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
267 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
268 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
269 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
270 | REPAIR OR CORRECTION.
271 |
272 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
273 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
274 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
275 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
276 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
277 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
278 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
279 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
280 | POSSIBILITY OF SUCH DAMAGES.
281 |
282 | END OF TERMS AND CONDITIONS
283 |
284 | How to Apply These Terms to Your New Programs
285 |
286 | If you develop a new program, and you want it to be of the greatest
287 | possible use to the public, the best way to achieve this is to make it
288 | free software which everyone can redistribute and change under these terms.
289 |
290 | To do so, attach the following notices to the program. It is safest
291 | to attach them to the start of each source file to most effectively
292 | convey the exclusion of warranty; and each file should have at least
293 | the "copyright" line and a pointer to where the full notice is found.
294 |
295 | {description}
296 | Copyright (C) {year} {fullname}
297 |
298 | This program is free software; you can redistribute it and/or modify
299 | it under the terms of the GNU General Public License as published by
300 | the Free Software Foundation; either version 2 of the License, or
301 | (at your option) any later version.
302 |
303 | This program is distributed in the hope that it will be useful,
304 | but WITHOUT ANY WARRANTY; without even the implied warranty of
305 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
306 | GNU General Public License for more details.
307 |
308 | You should have received a copy of the GNU General Public License along
309 | with this program; if not, write to the Free Software Foundation, Inc.,
310 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
311 |
312 | Also add information on how to contact you by electronic and paper mail.
313 |
314 | If the program is interactive, make it output a short notice like this
315 | when it starts in an interactive mode:
316 |
317 | Gnomovision version 69, Copyright (C) year name of author
318 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
319 | This is free software, and you are welcome to redistribute it
320 | under certain conditions; type `show c' for details.
321 |
322 | The hypothetical commands `show w' and `show c' should show the appropriate
323 | parts of the General Public License. Of course, the commands you use may
324 | be called something other than `show w' and `show c'; they could even be
325 | mouse-clicks or menu items--whatever suits your program.
326 |
327 | You should also get your employer (if you work as a programmer) or your
328 | school, if any, to sign a "copyright disclaimer" for the program, if
329 | necessary. Here is a sample; alter the names:
330 |
331 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program
332 | `Gnomovision' (which makes passes at compilers) written by James Hacker.
333 |
334 | {signature of Ty Coon}, 1 April 1989
335 | Ty Coon, President of Vice
336 |
337 | This General Public License does not permit incorporating your program into
338 | proprietary programs. If your program is a subroutine library, you may
339 | consider it more useful to permit linking proprietary applications with the
340 | library. If this is what you want to do, use the GNU Lesser General
341 | Public License instead of this License.
342 |
343 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # BetterMultiSelection
2 |
3 | [](https://ci.appveyor.com/project/dail8859/bettermultiselection)
4 |
5 | Notepad++ plugin to provide better cursor movements when using multiple selections.
6 |
7 | **Note:** This may not be fully supported on non-US keyboard layouts. This does have some minor quirks (such as the cursor not always blinking correctly) that are a side effect of the implementation.
8 |
9 | 
10 |
11 | ## Usage
12 | Ensure you have Multi-Editing turned *on* in Notepad++'s preferences. `Settings > Preferences > Editing > Multi-Editing Settings`
13 |
14 | Make multiple or rectangular selections and move the cursor. Supported cursor movements are:
15 |
16 | - Left
17 | - Right
18 | - Up
19 | - Down
20 | - Home
21 | - End
22 | - Word Left (`Ctrl+Left`)
23 | - Word Right (`Ctrl+Right`)
24 | - Delete Word Left (`Ctrl+Backspace`)
25 | - Delete Word Right (`Ctrl+Delete`)
26 | - Enter
27 |
28 | You can also hold down `Shift` to extend the selections.
29 |
30 | ## Installation
31 | Install the plugin by the Plugin Manager, or manually by downloading it from the [Release](https://github.com/dail8859/BetterMultiSelection/releases) page and copy `BetterMultiSelection.dll` to your `plugins` folder.
32 |
33 | ## Development
34 | The code has been developed using Visual Studio 2015. Building the code will generate the DLL which can be used by Notepad++. For convenience, Visual Studio copies the DLL into the Notepad++ plugin directory.
35 |
36 | ## License
37 | This code is released under the [GNU General Public License version 2](http://www.gnu.org/licenses/gpl-2.0.txt).
38 |
--------------------------------------------------------------------------------
/appveyor.yml:
--------------------------------------------------------------------------------
1 | version: 1.4.0.{build}
2 | image: Visual Studio 2019
3 |
4 | platform:
5 | - x64
6 | - Win32
7 |
8 | configuration:
9 | - Release
10 | - Debug
11 |
12 | install:
13 | - if "%platform%"=="x64" set archi=amd64
14 | - if "%platform%"=="x64" set build_platform=x64
15 |
16 | - if "%platform%"=="Win32" set archi=x86
17 | - if "%platform%"=="Win32" set build_platform=Win32
18 |
19 | - call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat" %archi%
20 |
21 | build:
22 | parallel: true
23 | verbosity: minimal
24 |
25 | build_script:
26 | - cd "%APPVEYOR_BUILD_FOLDER%"
27 | - msbuild BetterMultiSelection.sln /p:Configuration="%configuration%" /p:Platform="%build_platform%" /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
28 |
29 | after_build:
30 | - cd "%APPVEYOR_BUILD_FOLDER%"
31 | - ps: >-
32 |
33 | $BuildPath = "$($env:APPVEYOR_BUILD_FOLDER)\bin\$($env:CONFIGURATION)_$($env:BUILD_PLATFORM)"
34 |
35 | Push-AppveyorArtifact "$($BuildPath)\BetterMultiSelection.dll" -FileName BetterMultiSelection.dll
36 |
37 | if ($($env:APPVEYOR_REPO_TAG) -eq "true" -and $env:CONFIGURATION -eq "Release") {
38 | if ($env:BUILD_PLATFORM -eq "x64"){
39 | $ZipFileName = "BetterMultiSelection_$($env:APPVEYOR_REPO_TAG_NAME)_x64.zip"
40 | }
41 | if ($env:BUILD_PLATFORM -eq "Win32"){
42 | $ZipFileName = "BetterMultiSelection_$($env:APPVEYOR_REPO_TAG_NAME).zip"
43 | }
44 | 7z a $ZipFileName "$($BuildPath)\BetterMultiSelection.dll"
45 | }
46 |
47 | artifacts:
48 | - path: BetterMultiSelection*.zip
49 | name: releases
50 |
51 | deploy:
52 | provider: GitHub
53 | auth_token:
54 | secure: qrw+nu8dQKFLG+lNmky6buHsvHFwlibAai0r0aJ3MYbyBniONVxvgnmyx37bPh44
55 | artifact: releases
56 | draft: true
57 | prerelease: false
58 | force_update: true
59 | on:
60 | appveyor_repo_tag: true
61 | configuration: Release
62 |
--------------------------------------------------------------------------------
/img/Demo.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dail8859/BetterMultiSelection/4c63c6dd8eaf4f2df5a56c87ab79a57bb9c671c4/img/Demo.gif
--------------------------------------------------------------------------------
/src/BetterMultiSelection.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 | BetterMultiSelection
24 | Win32Proj
25 | 10.0
26 |
27 |
28 |
29 | DynamicLibrary
30 | Unicode
31 | v142
32 |
33 |
34 | DynamicLibrary
35 | Unicode
36 | v142
37 |
38 |
39 | DynamicLibrary
40 | Unicode
41 | v142
42 | true
43 |
44 |
45 | DynamicLibrary
46 | Unicode
47 | v142
48 | true
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 | <_ProjectFileVersion>10.0.30319.1
72 | $(SolutionDir)bin\$(Configuration)_$(Platform)\
73 | $(SolutionDir)bin\$(Configuration)_$(Platform)\build\
74 | true
75 | $(SolutionDir)bin\$(Configuration)_$(Platform)\
76 | $(SolutionDir)bin\$(Configuration)_$(Platform)\build\
77 | true
78 | $(SolutionDir)bin\$(Configuration)_$(Platform)\
79 | $(SolutionDir)bin\$(Configuration)_$(Platform)\build\
80 | false
81 | $(SolutionDir)bin\$(Configuration)_$(Platform)\
82 | $(SolutionDir)bin\$(Configuration)_$(Platform)\build\
83 | false
84 |
85 |
86 | $(ProjectName)
87 |
88 |
89 | $(ProjectName)
90 |
91 |
92 |
93 | .\Dialogs;.\Parsers;.\Npp;.\Utilities;.\;%(AdditionalIncludeDirectories)
94 | WIN32;NDEBUG;_WINDOWS;_USRDLL;$(ProjectName)_EXPORTS;__STDC_WANT_SECURE_LIB__=1;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)
95 | MultiThreaded
96 | Level3
97 | ProgramDatabase
98 | true
99 | Size
100 | true
101 | MaxSpeed
102 | Sync
103 | true
104 | true
105 |
106 |
107 | shlwapi.lib;%(AdditionalDependencies)
108 | $(OutDir)$(ProjectName).dll
109 | true
110 | Windows
111 | true
112 | true
113 | true
114 | true
115 | $(OutDir)$(ProjectName).lib
116 | MachineX86
117 |
118 |
119 | if EXIST "C:\Program Files (x86)\Notepad++\plugins\" (
120 | mkdir "C:\Program Files (x86)\Notepad++\plugins\$(TargetName)"
121 | copy "$(TargetPath)" "C:\Program Files (x86)\Notepad++\plugins\$(TargetName)"
122 | )
123 |
124 |
125 |
126 |
127 | .\Dialogs;.\Parsers;.\Npp;.\Utilities;.\;%(AdditionalIncludeDirectories)
128 | WIN32;NDEBUG;_WINDOWS;_USRDLL;$(ProjectName)_EXPORTS;__STDC_WANT_SECURE_LIB__=1;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)
129 | MultiThreaded
130 | Level3
131 | ProgramDatabase
132 | true
133 | Size
134 | true
135 | MaxSpeed
136 | Sync
137 | true
138 | true
139 |
140 |
141 | shlwapi.lib;%(AdditionalDependencies)
142 | $(OutDir)$(ProjectName).dll
143 | true
144 | Windows
145 | true
146 | true
147 | true
148 | true
149 | $(OutDir)$(ProjectName).lib
150 |
151 |
152 | if EXIST "C:\Program Files\Notepad++\plugins\" (
153 | mkdir "C:\Program Files\Notepad++\plugins\$(TargetName)"
154 | copy "$(TargetPath)" "C:\Program Files\Notepad++\plugins\$(TargetName)"
155 | )
156 |
157 |
158 |
159 |
160 | Disabled
161 | .\Dialogs;.\Parsers;.\Npp;.\Utilities;.\;%(AdditionalIncludeDirectories)
162 | WIN32;_DEBUG;_WINDOWS;_USRDLL;$(ProjectName)_EXPORTS;__STDC_WANT_SECURE_LIB__=1;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)
163 | EnableFastChecks
164 | MultiThreadedDebug
165 | Level3
166 | ProgramDatabase
167 | true
168 |
169 |
170 | shlwapi.lib;%(AdditionalDependencies)
171 | $(OutDir)$(ProjectName).dll
172 | true
173 | $(OutDir)$(ProjectName).pdb
174 | Windows
175 | true
176 | true
177 | $(OutDir)$(ProjectName).lib
178 | MachineX86
179 |
180 |
181 | if EXIST "C:\Program Files (x86)\Notepad++\plugins\" (
182 | mkdir "C:\Program Files (x86)\Notepad++\plugins\$(TargetName)"
183 | copy "$(TargetPath)" "C:\Program Files (x86)\Notepad++\plugins\$(TargetName)"
184 | )
185 |
186 |
187 |
188 |
189 | Disabled
190 | .\Dialogs;.\Parsers;.\Npp;.\Utilities;.\;%(AdditionalIncludeDirectories)
191 | WIN32;_DEBUG;_WINDOWS;_USRDLL;$(ProjectName)_EXPORTS;__STDC_WANT_SECURE_LIB__=1;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)
192 | EnableFastChecks
193 | MultiThreadedDebug
194 | Level3
195 | ProgramDatabase
196 | true
197 |
198 |
199 | shlwapi.lib;%(AdditionalDependencies)
200 | $(OutDir)$(ProjectName).dll
201 | true
202 | $(OutDir)$(ProjectName).pdb
203 | Windows
204 | true
205 | true
206 | $(OutDir)$(ProjectName).lib
207 |
208 |
209 | if EXIST "C:\Program Files\Notepad++\plugins\" (
210 | mkdir "C:\Program Files\Notepad++\plugins\$(TargetName)"
211 | copy "$(TargetPath)" "C:\Program Files\Notepad++\plugins\$(TargetName)"
212 | )
213 |
214 |
215 |
216 |
217 |
218 |
219 |
220 |
221 |
222 |
223 |
224 |
225 |
226 |
227 |
228 |
229 |
230 |
231 |
232 |
233 |
234 |
235 |
236 |
237 |
238 |
239 |
240 |
241 |
--------------------------------------------------------------------------------
/src/BetterMultiSelection.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
6 | cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx
7 |
8 |
9 | {93995380-89BD-4b04-88EB-625FBE52EBFB}
10 | h;hpp;hxx;hm;inl;inc;xsd
11 |
12 |
13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx
15 |
16 |
17 |
18 |
19 | Source Files
20 |
21 |
22 | Source Files
23 |
24 |
25 | Source Files
26 |
27 |
28 | Source Files
29 |
30 |
31 |
32 |
33 | Header Files
34 |
35 |
36 | Header Files
37 |
38 |
39 | Header Files
40 |
41 |
42 | Header Files
43 |
44 |
45 | Header Files
46 |
47 |
48 | Header Files
49 |
50 |
51 | Header Files
52 |
53 |
54 | Header Files
55 |
56 |
57 | Header Files
58 |
59 |
60 | Header Files
61 |
62 |
63 | Header Files
64 |
65 |
66 |
67 |
68 | Resource Files
69 |
70 |
71 | Resource Files
72 |
73 |
74 |
--------------------------------------------------------------------------------
/src/Dialogs/AboutDialog.cpp:
--------------------------------------------------------------------------------
1 | // This file is part of BetterMultiSelection.
2 | //
3 | // Copyright (C)2017 Justin Dailey
4 | //
5 | // BetterMultiSelection is free software; you can redistribute it and/or
6 | // modify it under the terms of the GNU General Public License
7 | // as published by the Free Software Foundation; either
8 | // version 2 of the License, or (at your option) any later version.
9 | //
10 | // This program is distributed in the hope that it will be useful,
11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | // GNU General Public License for more details.
14 | //
15 | // You should have received a copy of the GNU General Public License
16 | // along with this program; if not, write to the Free Software
17 | // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 |
19 | #include
20 | #include "PluginInterface.h"
21 | #include "resource.h"
22 | #include "Hyperlinks.h"
23 | #include "Version.h"
24 |
25 | #ifdef _WIN64
26 | #define BITNESS TEXT("(64 bit)")
27 | #else
28 | #define BITNESS TEXT("(32 bit)")
29 | #endif
30 |
31 | INT_PTR CALLBACK abtDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) {
32 | switch(uMsg) {
33 | case WM_INITDIALOG:
34 | ConvertStaticToHyperlink(hwndDlg, IDC_GITHUB);
35 | ConvertStaticToHyperlink(hwndDlg, IDC_README);
36 | Edit_SetText(GetDlgItem(hwndDlg, IDC_VERSION), TEXT("BetterMultiSelection v") VERSION_TEXT TEXT(" ") VERSION_STAGE TEXT(" ") BITNESS);
37 | return true;
38 | case WM_COMMAND:
39 | switch(LOWORD(wParam)) {
40 | case IDOK:
41 | DestroyWindow(hwndDlg);
42 | return true;
43 | case IDC_GITHUB:
44 | ShellExecute(hwndDlg, TEXT("open"), TEXT("https://github.com/dail8859/BetterMultiSelection/"), NULL, NULL, SW_SHOWNORMAL);
45 | return true;
46 | }
47 | case WM_DESTROY:
48 | DestroyWindow(hwndDlg);
49 | return true;
50 | }
51 | return false;
52 | }
53 |
54 | void ShowAboutDialog(HINSTANCE hInstance, const wchar_t *lpTemplateName, HWND hWndParent) {
55 | HWND hSelf = CreateDialogParam((HINSTANCE)hInstance, lpTemplateName, hWndParent, abtDlgProc, NULL);
56 |
57 | // Go to center
58 | RECT rc;
59 | GetClientRect(hWndParent, &rc);
60 | POINT center;
61 | int w = rc.right - rc.left;
62 | int h = rc.bottom - rc.top;
63 | center.x = rc.left + w / 2;
64 | center.y = rc.top + h / 2;
65 | ClientToScreen(hWndParent, ¢er);
66 |
67 | RECT dlgRect;
68 | GetClientRect(hSelf, &dlgRect);
69 | int x = center.x - (dlgRect.right - dlgRect.left) / 2;
70 | int y = center.y - (dlgRect.bottom - dlgRect.top) / 2;
71 |
72 | SetWindowPos(hSelf, HWND_TOP, x, y, (dlgRect.right - dlgRect.left), (dlgRect.bottom - dlgRect.top), SWP_SHOWWINDOW);
73 | }
74 |
--------------------------------------------------------------------------------
/src/Dialogs/AboutDialog.h:
--------------------------------------------------------------------------------
1 | // This file is part of BetterMultiSelection.
2 | //
3 | // Copyright (C)2017 Justin Dailey
4 | //
5 | // BetterMultiSelection is free software; you can redistribute it and/or
6 | // modify it under the terms of the GNU General Public License
7 | // as published by the Free Software Foundation; either
8 | // version 2 of the License, or (at your option) any later version.
9 | //
10 | // This program is distributed in the hope that it will be useful,
11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | // GNU General Public License for more details.
14 | //
15 | // You should have received a copy of the GNU General Public License
16 | // along with this program; if not, write to the Free Software
17 | // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 |
19 | #pragma once
20 |
21 | #include
22 |
23 | void ShowAboutDialog(HINSTANCE hInstance, const wchar_t *lpTemplateName, HWND hWndParent);
24 |
--------------------------------------------------------------------------------
/src/Dialogs/Hyperlinks.cpp:
--------------------------------------------------------------------------------
1 | // Hyperlinks.cpp
2 | //
3 | // Copyright 2002 Neal Stublen
4 | // All rights reserved.
5 | //
6 | // http://www.awesoftware.com
7 | //
8 |
9 | #include
10 |
11 | #include "Hyperlinks.h"
12 |
13 |
14 | #define PROP_ORIGINAL_FONT TEXT("_Hyperlink_Original_Font_")
15 | #define PROP_ORIGINAL_PROC TEXT("_Hyperlink_Original_Proc_")
16 | #define PROP_STATIC_HYPERLINK TEXT("_Hyperlink_From_Static_")
17 | #define PROP_UNDERLINE_FONT TEXT("_Hyperlink_Underline_Font_")
18 |
19 |
20 | LRESULT CALLBACK _HyperlinkParentProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
21 | {
22 | WNDPROC pfnOrigProc = (WNDPROC) GetProp(hwnd, PROP_ORIGINAL_PROC);
23 |
24 | switch (message)
25 | {
26 | case WM_CTLCOLORSTATIC:
27 | {
28 | HDC hdc = (HDC) wParam;
29 | HWND hwndCtl = (HWND) lParam;
30 |
31 | BOOL fHyperlink = (NULL != GetProp(hwndCtl, PROP_STATIC_HYPERLINK));
32 | if (fHyperlink)
33 | {
34 | LRESULT lr = CallWindowProc(pfnOrigProc, hwnd, message, wParam, lParam);
35 | SetTextColor(hdc, RGB(0, 0, 192));
36 | return lr;
37 | }
38 |
39 | break;
40 | }
41 | case WM_DESTROY:
42 | {
43 | SetWindowLongPtr(hwnd, GWLP_WNDPROC, reinterpret_cast(pfnOrigProc));
44 | RemoveProp(hwnd, PROP_ORIGINAL_PROC);
45 | break;
46 | }
47 | }
48 | return CallWindowProc(pfnOrigProc, hwnd, message, wParam, lParam);
49 | }
50 |
51 | LRESULT CALLBACK _HyperlinkProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
52 | {
53 | WNDPROC pfnOrigProc = (WNDPROC) GetProp(hwnd, PROP_ORIGINAL_PROC);
54 |
55 | switch (message)
56 | {
57 | case WM_DESTROY:
58 | {
59 | SetWindowLongPtr(hwnd, GWLP_WNDPROC, reinterpret_cast(pfnOrigProc));
60 | RemoveProp(hwnd, PROP_ORIGINAL_PROC);
61 |
62 | HFONT hOrigFont = (HFONT) GetProp(hwnd, PROP_ORIGINAL_FONT);
63 | SendMessage(hwnd, WM_SETFONT, (WPARAM) hOrigFont, 0);
64 | RemoveProp(hwnd, PROP_ORIGINAL_FONT);
65 |
66 | HFONT hFont = (HFONT) GetProp(hwnd, PROP_UNDERLINE_FONT);
67 | DeleteObject(hFont);
68 | RemoveProp(hwnd, PROP_UNDERLINE_FONT);
69 |
70 | RemoveProp(hwnd, PROP_STATIC_HYPERLINK);
71 |
72 | break;
73 | }
74 | case WM_MOUSEMOVE:
75 | {
76 | if (GetCapture() != hwnd)
77 | {
78 | HFONT hFont = (HFONT) GetProp(hwnd, PROP_UNDERLINE_FONT);
79 | SendMessage(hwnd, WM_SETFONT, (WPARAM) hFont, FALSE);
80 | InvalidateRect(hwnd, NULL, FALSE);
81 | SetCapture(hwnd);
82 | }
83 | else
84 | {
85 | RECT rect;
86 | GetWindowRect(hwnd, &rect);
87 |
88 | POINT pt = { LOWORD(lParam), HIWORD(lParam) };
89 | ClientToScreen(hwnd, &pt);
90 |
91 | if (!PtInRect(&rect, pt))
92 | {
93 | HFONT hFont = (HFONT) GetProp(hwnd, PROP_ORIGINAL_FONT);
94 | SendMessage(hwnd, WM_SETFONT, (WPARAM) hFont, FALSE);
95 | InvalidateRect(hwnd, NULL, FALSE);
96 | ReleaseCapture();
97 | }
98 | }
99 | break;
100 | }
101 | case WM_SETCURSOR:
102 | {
103 | // Since IDC_HAND is not available on all operating systems,
104 | // we will load the arrow cursor if IDC_HAND is not present.
105 | HCURSOR hCursor = LoadCursor(NULL, IDC_HAND);
106 | if (NULL == hCursor)
107 | {
108 | hCursor = LoadCursor(NULL, IDC_ARROW);
109 | }
110 | SetCursor(hCursor);
111 | return TRUE;
112 | }
113 | }
114 |
115 | return CallWindowProc(pfnOrigProc, hwnd, message, wParam, lParam);
116 | }
117 |
118 | BOOL ConvertStaticToHyperlink(HWND hwndCtl)
119 | {
120 | // Subclass the parent so we can color the controls as we desire.
121 |
122 | HWND hwndParent = GetParent(hwndCtl);
123 | if (NULL != hwndParent)
124 | {
125 | WNDPROC pfnOrigProc = (WNDPROC) GetWindowLongPtr(hwndParent, GWLP_WNDPROC);
126 | if (pfnOrigProc != _HyperlinkParentProc)
127 | {
128 | SetProp(hwndParent, PROP_ORIGINAL_PROC, (HANDLE) pfnOrigProc);
129 | SetWindowLongPtr(hwndParent, GWLP_WNDPROC, reinterpret_cast(_HyperlinkParentProc));
130 | }
131 | }
132 |
133 | // Make sure the control will send notifications.
134 |
135 | LONG_PTR dwStyle = GetWindowLongPtr(hwndCtl, GWL_STYLE);
136 | SetWindowLongPtr(hwndCtl, GWL_STYLE, dwStyle | SS_NOTIFY);
137 |
138 | // Subclass the existing control.
139 |
140 | WNDPROC pfnOrigProc = (WNDPROC) GetWindowLongPtr(hwndCtl, GWLP_WNDPROC);
141 | SetProp(hwndCtl, PROP_ORIGINAL_PROC, (HANDLE) pfnOrigProc);
142 | SetWindowLongPtr(hwndCtl, GWLP_WNDPROC, reinterpret_cast(_HyperlinkProc));
143 |
144 | // Create an updated font by adding an underline.
145 |
146 | HFONT hOrigFont = (HFONT) SendMessage(hwndCtl, WM_GETFONT, 0, 0);
147 | SetProp(hwndCtl, PROP_ORIGINAL_FONT, (HANDLE) hOrigFont);
148 |
149 | LOGFONT lf;
150 | GetObject(hOrigFont, sizeof(lf), &lf);
151 | lf.lfUnderline = TRUE;
152 |
153 | HFONT hFont = CreateFontIndirect(&lf);
154 | SetProp(hwndCtl, PROP_UNDERLINE_FONT, (HANDLE) hFont);
155 |
156 | // Set a flag on the control so we know what color it should be.
157 |
158 | SetProp(hwndCtl, PROP_STATIC_HYPERLINK, (HANDLE) 1);
159 |
160 | return TRUE;
161 | }
162 |
163 | BOOL ConvertStaticToHyperlink(HWND hwndParent, UINT uiCtlId)
164 | {
165 | return ConvertStaticToHyperlink(GetDlgItem(hwndParent, uiCtlId));
166 | }
167 |
--------------------------------------------------------------------------------
/src/Dialogs/Hyperlinks.h:
--------------------------------------------------------------------------------
1 | // Hyperlinks.h
2 | //
3 | // Copyright 2002 Neal Stublen
4 | // All rights reserved.
5 | //
6 | // http://www.awesoftware.com
7 | //
8 |
9 | #ifndef HYPERLINKS_H
10 | #define HYPERLINKS_H
11 |
12 | BOOL ConvertStaticToHyperlink(HWND hwndCtl);
13 | BOOL ConvertStaticToHyperlink(HWND hwndParent, UINT uiCtlId);
14 |
15 | #endif
--------------------------------------------------------------------------------
/src/Dialogs/Version.rc:
--------------------------------------------------------------------------------
1 | #include
2 | #include "Version.h"
3 |
4 |
5 | //
6 | // Version Information resources
7 | //
8 | LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
9 | 1 VERSIONINFO
10 | FILEVERSION VERSION_NUM
11 | PRODUCTVERSION VERSION_NUM
12 | FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
13 | FILEFLAGS VS_FF_SPECIALBUILD
14 | FILEOS VOS__WINDOWS32
15 | FILETYPE VFT_DLL
16 | FILESUBTYPE VFT2_UNKNOWN
17 | {
18 | BLOCK "StringFileInfo"
19 | {
20 | BLOCK "040904b0"
21 | {
22 | VALUE "Comments", "Notepad++ plugin"
23 | VALUE "CompanyName", "Justin Dailey "
24 | VALUE "FileDescription", "Notepad++ plugin"
25 | VALUE "FileVersion", VERSION_TEXT
26 | VALUE "InternalName", "BetterMultiSelection"
27 | VALUE "OriginalFilename", "BetterMultiSelection.dll"
28 | VALUE "ProductName", "BetterMultiSelection"
29 | VALUE "ProductVersion", VERSION_TEXT
30 | VALUE "SpecialBuild", "UNICODE"
31 | }
32 | }
33 | BLOCK "VarFileInfo"
34 | {
35 | VALUE "Translation", 0x0409, 0x01B5
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/src/Dialogs/resource.h:
--------------------------------------------------------------------------------
1 | #ifndef IDC_STATIC
2 | #define IDC_STATIC (-1)
3 | #endif
4 |
5 | #define IDD_ABOUTDLG 101
6 | #define IDC_GITHUB 1000
7 | #define IDC_VERSION 1001
8 | #define IDC_README 1002
9 |
--------------------------------------------------------------------------------
/src/Dialogs/resource.rc:
--------------------------------------------------------------------------------
1 |
2 | #include
3 | #include
4 | #include
5 | #include "resource.h"
6 |
7 |
8 | //
9 | // Dialog resources
10 | //
11 | LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
12 | IDD_ABOUTDLG DIALOGEX 0, 0, 223, 130
13 | STYLE DS_SETFONT | DS_FIXEDSYS | WS_POPUP | WS_BORDER | WS_SYSMENU
14 | FONT 8, "MS Shell Dlg", 0, 0, 0x1
15 | {
16 | PUSHBUTTON "Close", IDOK, 86, 109, 50, 14
17 | GROUPBOX "", IDC_VERSION, 10, 9, 201, 93, BS_CENTER
18 | LTEXT "Author: Justin Dailey ", IDC_STATIC, 30, 26, 180, 8
19 | LTEXT "The BetterMultiSelection code is hosted on", IDC_STATIC, 30, 43, 180, 8
20 | LTEXT "GitHub", IDC_GITHUB, 167, 43, 27, 8, SS_LEFT | SS_NOTIFY, WS_EX_LEFT
21 | LTEXT "This code is licensed under GPLv2", IDC_STATIC, 30, 80, 180, 8
22 | }
23 |
--------------------------------------------------------------------------------
/src/GlobalMemory.h:
--------------------------------------------------------------------------------
1 | // Copyright 1998-2003 by Neil Hodgson
2 | // The License.txt file describes the conditions under which this software may be distributed.
3 |
4 | #ifndef GLOBALMEMORY_H
5 | #define GLOBALMEMORY_H
6 |
7 | #include
8 |
9 | class GlobalMemory {
10 | HGLOBAL hand{};
11 | public:
12 | void *ptr{};
13 | GlobalMemory() {
14 | }
15 | explicit GlobalMemory(HGLOBAL hand_) : hand(hand_) {
16 | if (hand) {
17 | ptr = ::GlobalLock(hand);
18 | }
19 | }
20 | // Deleted so GlobalMemory objects can not be copied.
21 | GlobalMemory(const GlobalMemory &) = delete;
22 | GlobalMemory(GlobalMemory &&) = delete;
23 | GlobalMemory &operator=(const GlobalMemory &) = delete;
24 | GlobalMemory &operator=(GlobalMemory &&) = delete;
25 | ~GlobalMemory() {
26 | }
27 | void Allocate(size_t bytes) {
28 | hand = ::GlobalAlloc(GMEM_MOVEABLE | GMEM_ZEROINIT, bytes);
29 | if (hand) {
30 | ptr = ::GlobalLock(hand);
31 | }
32 | }
33 | HGLOBAL Unlock() {
34 | HGLOBAL handCopy = hand;
35 | ::GlobalUnlock(hand);
36 | ptr = 0;
37 | hand = 0;
38 | return handCopy;
39 | }
40 | void SetClip(UINT uFormat) {
41 | ::SetClipboardData(uFormat, Unlock());
42 | }
43 | operator bool() const {
44 | return ptr != nullptr;
45 | }
46 | SIZE_T Size() {
47 | return ::GlobalSize(hand);
48 | }
49 | };
50 |
51 | #endif
52 |
--------------------------------------------------------------------------------
/src/Main.cpp:
--------------------------------------------------------------------------------
1 | // This file is part of BetterMultiSelection.
2 | //
3 | // Copyright (C)2017 Justin Dailey
4 | //
5 | // BetterMultiSelection is free software; you can redistribute it and/or
6 | // modify it under the terms of the GNU General Public License
7 | // as published by the Free Software Foundation; either
8 | // version 2 of the License, or (at your option) any later version.
9 | //
10 | // This program is distributed in the hope that it will be useful,
11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | // GNU General Public License for more details.
14 | //
15 | // You should have received a copy of the GNU General Public License
16 | // along with this program; if not, write to the Free Software
17 | // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 |
19 | #include "AboutDialog.h"
20 | #include "resource.h"
21 | #include "PluginInterface.h"
22 | #include "ScintillaEditor.h"
23 |
24 | #include "UniConversion.h"
25 | #include "GlobalMemory.h"
26 |
27 | #include
28 | #include
29 | #include
30 |
31 | #define IsShiftPressed() ((GetKeyState(VK_SHIFT) & KF_UP) != 0)
32 | #define IsControlPressed() ((GetKeyState(VK_CONTROL) & KF_UP) != 0)
33 | #define IsAltPressed() ((GetKeyState(VK_MENU) & KF_UP) != 0)
34 |
35 |
36 | static HANDLE _hModule;
37 | static NppData nppData;
38 | static HHOOK hook = NULL;
39 | static bool hasFocus = true;
40 | static ScintillaEditor editor;
41 |
42 | static UINT cfMultiSelect = 0;
43 | static UINT cfColumnSelect = 0;
44 |
45 | static void enableBetterMultiSelection();
46 | static void showAbout();
47 |
48 | static LRESULT CALLBACK KeyboardProc(int ncode, WPARAM wparam, LPARAM lparam);
49 |
50 | struct Selection {
51 | int caret;
52 | int anchor;
53 |
54 | Selection(int caret, int anchor) : caret(caret), anchor(anchor) {}
55 |
56 | int start() const { return min(caret, anchor); }
57 | int end() const { return max(caret, anchor); }
58 | int length() const { return end() - start(); }
59 | void set(int pos) { anchor = caret = pos; }
60 | void offset(int offset) { anchor += offset; caret += offset; }
61 | };
62 |
63 | static FuncItem funcItem[] = {
64 | { TEXT("Enable"), enableBetterMultiSelection, 0, false, nullptr },
65 | { TEXT(""), nullptr, 0, false, nullptr },
66 | { TEXT("About..."), showAbout, 0, false, nullptr }
67 | };
68 |
69 | static const wchar_t *GetIniFilePath() {
70 | static wchar_t iniPath[MAX_PATH] = { 0 };
71 |
72 | if (iniPath[0] == 0) {
73 | SendMessage(nppData._nppHandle, NPPM_GETPLUGINSCONFIGDIR, MAX_PATH, (LPARAM)iniPath);
74 | wcscat_s(iniPath, MAX_PATH, L"\\BetterMultiSelection.ini");
75 | }
76 |
77 | return iniPath;
78 | }
79 |
80 | static void enableBetterMultiSelection() {
81 | if (hook) {
82 | UnhookWindowsHookEx(hook);
83 | hook = NULL;
84 | SendMessage(nppData._nppHandle, NPPM_SETMENUITEMCHECK, funcItem[0]._cmdID, 0);
85 | }
86 | else {
87 | hook = SetWindowsHookEx(WH_KEYBOARD, KeyboardProc, (HINSTANCE)_hModule, ::GetCurrentThreadId());
88 | SendMessage(nppData._nppHandle, NPPM_SETMENUITEMCHECK, funcItem[0]._cmdID, 1);
89 | editor.AutoCSetMulti(SC_MULTIAUTOC_EACH);
90 | }
91 | }
92 |
93 | static void showAbout() {
94 | ShowAboutDialog((HINSTANCE)_hModule, MAKEINTRESOURCE(IDD_ABOUTDLG), nppData._nppHandle);
95 | }
96 |
97 | static HWND GetCurrentScintilla() {
98 | int which = 0;
99 | SendMessage(nppData._nppHandle, NPPM_GETCURRENTSCINTILLA, SCI_UNUSED, (LPARAM)&which);
100 | return (which == 0) ? nppData._scintillaMainHandle : nppData._scintillaSecondHandle;
101 | }
102 |
103 | static std::vector GetSelections() {
104 | std::vector selections;
105 |
106 | int num = editor.GetSelections();
107 | for (int i = 0; i < num; ++i) {
108 | int caret = editor.GetSelectionNCaret(i);
109 | int anchor = editor.GetSelectionNAnchor(i);
110 | selections.emplace_back(Selection{ caret, anchor });
111 | }
112 |
113 | return selections;
114 | }
115 |
116 | static void SetSelections(const std::vector &selections) {
117 | for (size_t i = 0; i < selections.size(); ++i) {
118 | if (i == 0)
119 | editor.SetSelection(selections[i].caret, selections[i].anchor);
120 | else
121 | editor.AddSelection(selections[i].caret, selections[i].anchor);
122 | }
123 | }
124 |
125 | template
126 | It uniquify(It begin, It const end)
127 | {
128 | std::vector v;
129 | v.reserve(static_cast(std::distance(begin, end)));
130 |
131 | for (It i = begin; i != end; ++i)
132 | v.push_back(i);
133 |
134 | std::sort(v.begin(), v.end(), [](const auto &lhs, const auto &rhs) {
135 | return (*lhs).start() < (*rhs).start() || (!((*rhs).start() < (*lhs).start()) && (*lhs).end() < (*rhs).end());
136 | });
137 |
138 | v.erase(std::unique(v.begin(), v.end(), [](const auto &lhs, const auto &rhs) {
139 | return (*lhs).start() == (*rhs).start() && (*lhs).end() == (*rhs).end();
140 | }), v.end());
141 |
142 | std::sort(v.begin(), v.end());
143 |
144 | size_t j = 0;
145 | for (It i = begin; i != end && j != v.size(); ++i) {
146 | if (i == v[j]) {
147 | using std::iter_swap; iter_swap(i, begin);
148 | ++j;
149 | ++begin;
150 | }
151 | }
152 | return begin;
153 | }
154 |
155 | // Create a closure that simply calls a SCI_XXX message
156 | static auto SimpleEdit(int message) {
157 | return [message](Selection &selection) {
158 | editor.SetSelection(selection.caret, selection.anchor);
159 | editor.Call(message);
160 |
161 | selection.caret = editor.GetSelectionNCaret(0);
162 | selection.anchor = editor.GetSelectionNAnchor(0);
163 | };
164 | }
165 |
166 | template
167 | static void EditSelections(T edit) {
168 | auto selections = GetSelections();
169 |
170 | editor.ClearSelections();
171 |
172 | std::sort(selections.begin(), selections.end(), [](const auto &lhs, const auto &rhs) {
173 | return lhs.start() < rhs.start() || (!(rhs.start() < lhs.start()) && lhs.end() < rhs.end());
174 | });
175 |
176 | editor.BeginUndoAction();
177 |
178 | int totalOffset = 0;
179 | for (auto &selection : selections) {
180 | selection.offset(totalOffset);
181 | const int length = editor.GetLength();
182 |
183 | edit(selection);
184 |
185 | totalOffset += editor.GetLength() - length;
186 | }
187 |
188 | editor.EndUndoAction();
189 |
190 | selections.erase(uniquify(selections.begin(), selections.end()), selections.end());
191 |
192 | SetSelections(selections);
193 | }
194 |
195 | std::string TransformLineEnds(const char *s, int eolModeWanted) {
196 | std::string dest;
197 | const size_t len = strlen(s);
198 | for (size_t i = 0; s[i]; i++) {
199 | if (s[i] == '\n' || s[i] == '\r') {
200 | if (eolModeWanted == SC_EOL_CR) {
201 | dest.push_back('\r');
202 | }
203 | else if (eolModeWanted == SC_EOL_LF) {
204 | dest.push_back('\n');
205 | }
206 | else { // eolModeWanted == SC_EOL_CRLF
207 | dest.push_back('\r');
208 | dest.push_back('\n');
209 | }
210 | if ((s[i] == '\r') && (i + 1 < len) && (s[i + 1] == '\n')) {
211 | i++;
212 | }
213 | }
214 | else {
215 | dest.push_back(s[i]);
216 | }
217 | }
218 | return dest;
219 | }
220 |
221 | const char *StringFromEOLMode(int eolMode) {
222 | if (eolMode == SC_EOL_CRLF) {
223 | return "\r\n";
224 | }
225 | else if (eolMode == SC_EOL_CR) {
226 | return "\r";
227 | }
228 | else {
229 | return "\n";
230 | }
231 | }
232 |
233 | template
234 | static std::string join(const std::vector &v, const U &delim) {
235 | std::stringstream ss;
236 | for (size_t i = 0; i < v.size(); ++i) {
237 | if (i != 0) ss << delim;
238 | ss << v[i];
239 | }
240 | return ss.str();
241 | }
242 |
243 | template
244 | static std::vector> split(std::basic_string const &str, const std::basic_string &delim) {
245 | size_t start;
246 | size_t end = 0;
247 | std::vector> out;
248 |
249 | while ((start = str.find_first_not_of(delim, end)) != std::basic_string::npos) {
250 | end = str.find(delim, start);
251 | out.push_back(str.substr(start, end - start));
252 | }
253 |
254 | return out;
255 | }
256 |
257 | bool AllSelectionsHaveText(ScintillaEditor &editor) {
258 | const int selections = editor.GetSelections();
259 | bool has_selections = true;
260 |
261 | for (int i = 0; i < editor.GetSelections(); ++i) {
262 | int start = editor.GetSelectionNStart(i);
263 | int end = editor.GetSelectionNEnd(i);
264 |
265 | if (start == end) {
266 | return false;
267 | }
268 | }
269 |
270 | return true;
271 | }
272 |
273 | // ============================================================================
274 |
275 | // OpenClipboard may fail if another application has opened the clipboard.
276 | // Try up to 8 times, with an initial delay of 1 ms and an exponential back off
277 | // for a maximum total delay of 127 ms (1+2+4+8+16+32+64).
278 | bool OpenClipboardRetry(HWND hwnd) {
279 | for (int attempt = 0; attempt < 8; attempt++) {
280 | if (attempt > 0) {
281 | Sleep(1 << (attempt - 1));
282 | }
283 | if (OpenClipboard(hwnd)) {
284 | return true;
285 | }
286 | }
287 | return false;
288 | }
289 |
290 | UINT CodePageFromCharSet(DWORD characterSet, UINT documentCodePage) {
291 | if (documentCodePage == SC_CP_UTF8) {
292 | return SC_CP_UTF8;
293 | }
294 | switch (characterSet) {
295 | case SC_CHARSET_ANSI: return 1252;
296 | case SC_CHARSET_DEFAULT: return documentCodePage ? documentCodePage : 1252;
297 | case SC_CHARSET_BALTIC: return 1257;
298 | case SC_CHARSET_CHINESEBIG5: return 950;
299 | case SC_CHARSET_EASTEUROPE: return 1250;
300 | case SC_CHARSET_GB2312: return 936;
301 | case SC_CHARSET_GREEK: return 1253;
302 | case SC_CHARSET_HANGUL: return 949;
303 | case SC_CHARSET_MAC: return 10000;
304 | case SC_CHARSET_OEM: return 437;
305 | case SC_CHARSET_RUSSIAN: return 1251;
306 | case SC_CHARSET_SHIFTJIS: return 932;
307 | case SC_CHARSET_TURKISH: return 1254;
308 | case SC_CHARSET_JOHAB: return 1361;
309 | case SC_CHARSET_HEBREW: return 1255;
310 | case SC_CHARSET_ARABIC: return 1256;
311 | case SC_CHARSET_VIETNAMESE: return 1258;
312 | case SC_CHARSET_THAI: return 874;
313 | case SC_CHARSET_8859_15: return 28605;
314 | // Not supported
315 | case SC_CHARSET_CYRILLIC: return documentCodePage;
316 | case SC_CHARSET_SYMBOL: return documentCodePage;
317 | }
318 | return documentCodePage;
319 | }
320 |
321 |
322 | // This is a modificated version of ScintillaWin::CopyToClipboard()
323 | // Multilpe selects can be treated like rectangular and concat'ed together by newlines
324 | bool CopyToClipboard(ScintillaEditor &editor) {
325 | if (!OpenClipboardRetry(editor.GetScintillaInstance())) {
326 | return false;
327 | }
328 |
329 | EmptyClipboard();
330 |
331 | GlobalMemory uniText;
332 |
333 | std::string selectedText;
334 |
335 | EditSelections([&selectedText, &editor](Selection& selection) {
336 | editor.SetTargetRange(selection.start(), selection.end());
337 |
338 | // TODO: check if newline in range and if so abort?
339 | // Newlines in the selection will mess up pasting since it
340 | // will look like an extra row
341 |
342 | selectedText.append(editor.GetTargetText());
343 | selectedText.append(StringFromEOLMode(editor.GetEOLMode()));
344 | });
345 |
346 | // Default Scintilla behaviour in Unicode mode
347 | if (editor.GetCodePage() == SC_CP_UTF8) {
348 | const size_t uchars = UTF16Length(selectedText.c_str(), selectedText.size());
349 | uniText.Allocate(2 * uchars);
350 | if (uniText) {
351 | UTF16FromUTF8(selectedText.c_str(), selectedText.size(), static_cast(uniText.ptr), uchars);
352 | }
353 | }
354 | else {
355 | // Not Unicode mode
356 | // Convert to Unicode using the current Scintilla code page
357 | const UINT cpSrc = CodePageFromCharSet(editor.StyleGetCharacterSet(STYLE_DEFAULT), editor.GetCodePage());
358 | const int uLen = MultiByteToWideChar(cpSrc, 0, selectedText.c_str(), static_cast(selectedText.size()), 0, 0);
359 | uniText.Allocate(2 * uLen);
360 | if (uniText) {
361 | MultiByteToWideChar(cpSrc, 0, selectedText.c_str(), static_cast(selectedText.size()), static_cast(uniText.ptr), uLen);
362 | }
363 | }
364 |
365 | if (uniText) {
366 | uniText.SetClip(CF_UNICODETEXT);
367 | }
368 | else {
369 | // There was a failure - try to copy at least ANSI text
370 | GlobalMemory ansiText;
371 | ansiText.Allocate(selectedText.size());
372 | if (ansiText) {
373 | memcpy(ansiText.ptr, selectedText.c_str(), selectedText.size());
374 | ansiText.SetClip(CF_TEXT);
375 | }
376 | }
377 |
378 | SetClipboardData(cfColumnSelect, 0);
379 | SetClipboardData(cfMultiSelect, 0);
380 |
381 | CloseClipboard();
382 |
383 | return true;
384 | }
385 |
386 | UINT CodePageOfDocument(ScintillaEditor &editor) {
387 | return CodePageFromCharSet(editor.StyleGetCharacterSet(STYLE_DEFAULT), editor.GetCodePage());
388 | }
389 |
390 | bool InsertMultiCursorPaste(ScintillaEditor &editor, const char *text) {
391 | std::string st;
392 |
393 | if (editor.GetPasteConvertEndings()) {
394 | st = TransformLineEnds(text, editor.GetEOLMode());
395 | }
396 | else {
397 | st = text;
398 | }
399 |
400 | auto lines = split(st, std::string(StringFromEOLMode(editor.GetEOLMode())));
401 | if (lines.size() == editor.GetSelections()) {
402 | EditSelections([&lines, &editor](Selection &selection) {
403 | if (selection.caret < selection.anchor)
404 | editor.SetTargetRange(selection.caret, selection.anchor);
405 | else
406 | editor.SetTargetRange(selection.anchor, selection.caret);
407 |
408 | editor.ReplaceTarget(lines[0]);
409 |
410 | selection.caret = editor.GetTargetEnd();
411 | selection.anchor = editor.GetTargetEnd();
412 |
413 | // pop front
414 | lines.erase(lines.cbegin());
415 | });
416 |
417 | return true;
418 | }
419 |
420 | return false;
421 | }
422 |
423 | bool Paste(ScintillaEditor &editor) {
424 | if (!IsClipboardFormatAvailable(cfColumnSelect) && !IsClipboardFormatAvailable(cfMultiSelect))
425 | return false;
426 |
427 | if (!OpenClipboardRetry(editor.GetScintillaInstance())) {
428 | return false;
429 | }
430 |
431 | // Always use CF_UNICODETEXT if available
432 | GlobalMemory memUSelection(::GetClipboardData(CF_UNICODETEXT));
433 | if (memUSelection) {
434 | const wchar_t *uptr = static_cast(memUSelection.ptr);
435 | if (uptr) {
436 | size_t len;
437 | std::vector putf;
438 | // Default Scintilla behaviour in Unicode mode
439 | if (editor.GetCodePage() == SC_CP_UTF8) {
440 | const size_t bytes = memUSelection.Size();
441 | len = UTF8Length(uptr, bytes / 2);
442 | putf.resize(len + 1);
443 | UTF8FromUTF16(uptr, bytes / 2, &putf[0], len);
444 | }
445 | else {
446 | // CF_UNICODETEXT available, but not in Unicode mode
447 | // Convert from Unicode to current Scintilla code page
448 | const UINT cpDest = CodePageOfDocument(editor);
449 | len = WideCharToMultiByte(cpDest, 0, uptr, -1, NULL, 0, NULL, NULL) - 1; // subtract 0 terminator
450 | putf.resize(len + 1);
451 | WideCharToMultiByte(cpDest, 0, uptr, -1, &putf[0], static_cast(len) + 1, NULL, NULL);
452 | }
453 |
454 | if (InsertMultiCursorPaste(editor, &putf[0])) {
455 | memUSelection.Unlock();
456 | CloseClipboard();
457 | return true;
458 | }
459 | }
460 |
461 | }
462 | else {
463 | // CF_UNICODETEXT not available, paste ANSI text
464 | GlobalMemory memSelection(::GetClipboardData(CF_TEXT));
465 | if (memSelection) {
466 | const char *ptr = static_cast(memSelection.ptr);
467 | if (ptr) {
468 | const size_t bytes = memSelection.Size();
469 | size_t len = bytes;
470 | for (size_t i = 0; i < bytes; i++) {
471 | if ((len == bytes) && (0 == ptr[i]))
472 | len = i;
473 | }
474 |
475 | // In Unicode mode, convert clipboard text to UTF-8
476 | if (editor.GetCodePage() == SC_CP_UTF8) {
477 | std::vector uptr(len + 1);
478 |
479 | const int ilen = static_cast(len);
480 | const size_t ulen = ::MultiByteToWideChar(CP_ACP, 0, ptr, ilen, &uptr[0], ilen + 1);
481 |
482 | const size_t mlen = UTF8Length(&uptr[0], ulen);
483 | std::vector putf(mlen + 1);
484 | UTF8FromUTF16(&uptr[0], ulen, &putf[0], mlen);
485 |
486 | if (InsertMultiCursorPaste(editor, &putf[0])) {
487 | memSelection.Unlock();
488 | CloseClipboard();
489 | return true;
490 | }
491 | }
492 | else {
493 | if (InsertMultiCursorPaste(editor, ptr)) {
494 | memSelection.Unlock();
495 | CloseClipboard();
496 | return true;
497 | }
498 | }
499 | }
500 | }
501 | }
502 |
503 | CloseClipboard();
504 | return false;
505 | }
506 |
507 | LRESULT CALLBACK KeyboardProc(int ncode, WPARAM wparam, LPARAM lparam) {
508 | if (ncode == HC_ACTION && (HIWORD(lparam) & KF_UP) == 0 && !IsAltPressed()) {
509 | if (hasFocus && editor.GetSelections() > 1) {
510 | if (IsControlPressed()) {
511 | if (wparam == VK_LEFT) {
512 | EditSelections(SimpleEdit(IsShiftPressed() ? SCI_WORDLEFTEXTEND : SCI_WORDLEFT));
513 | return TRUE; // This key has been "handled" and won't propogate
514 | }
515 | else if (wparam == VK_RIGHT) {
516 | EditSelections(SimpleEdit(IsShiftPressed() ? SCI_WORDRIGHTENDEXTEND : SCI_WORDRIGHT));
517 | return TRUE;
518 | }
519 | else if (!IsShiftPressed()) { // Handle CTRL+{} only, allow CTRL+SHIFT+{} to be used elsewhere
520 | if (wparam == VK_BACK) {
521 | EditSelections(SimpleEdit(SCI_DELWORDLEFT));
522 | return TRUE;
523 | }
524 | else if (wparam == VK_DELETE) {
525 | EditSelections(SimpleEdit(SCI_DELWORDRIGHT));
526 | return TRUE;
527 | }
528 | else if (wparam == 'X' || wparam == 'C') {
529 | if (CopyToClipboard(editor)) {
530 | if (wparam == 'X') {
531 | EditSelections(SimpleEdit(SCI_DELETEBACK));
532 | }
533 | return TRUE;
534 | }
535 | }
536 | else if (wparam == 'V') {
537 | if (Paste(editor)) {
538 | return TRUE;
539 | }
540 | }
541 | }
542 | }
543 | else {
544 | if (wparam == VK_ESCAPE) {
545 | int caret = editor.GetSelectionNCaret(editor.GetMainSelection());
546 | editor.SetSelection(caret, caret);
547 | return TRUE;
548 | }
549 | else if (wparam == VK_LEFT) {
550 | EditSelections(SimpleEdit(IsShiftPressed() ? SCI_CHARLEFTEXTEND : SCI_CHARLEFT));
551 | return TRUE;
552 | }
553 | else if (wparam == VK_RIGHT) {
554 | EditSelections(SimpleEdit(IsShiftPressed() ? SCI_CHARRIGHTEXTEND : SCI_CHARRIGHT));
555 | return TRUE;
556 | }
557 | else if (wparam == VK_HOME) {
558 | EditSelections(SimpleEdit(IsShiftPressed() ? SCI_VCHOMEWRAPEXTEND : SCI_VCHOMEWRAP));
559 | return TRUE;
560 | }
561 | else if (wparam == VK_END) {
562 | EditSelections(SimpleEdit(IsShiftPressed() ? SCI_LINEENDWRAPEXTEND : SCI_LINEENDWRAP));
563 | return TRUE;
564 | }
565 | else if (wparam == VK_BACK) {
566 | EditSelections(SimpleEdit(SCI_DELETEBACK));
567 | return TRUE;
568 | }
569 | else if (wparam == VK_DELETE) {
570 | EditSelections(SimpleEdit(SCI_CLEAR));
571 | return TRUE;
572 | }
573 | else if (wparam == VK_RETURN) {
574 | if (!editor.AutoCActive()) {
575 | EditSelections(SimpleEdit(SCI_NEWLINE));
576 | return TRUE;
577 | }
578 | // else just let Scintilla handle the insertion of autocompletion
579 | }
580 | else if (wparam == VK_UP) {
581 | if (!editor.AutoCActive()) {
582 | EditSelections(SimpleEdit(IsShiftPressed() ? SCI_LINEUPEXTEND : SCI_LINEUP));
583 | return TRUE;
584 | }
585 | // else just let Scintilla handle the navigation of autocompletion
586 | }
587 | else if (wparam == VK_DOWN) {
588 | if (!editor.AutoCActive()) {
589 | EditSelections(SimpleEdit(IsShiftPressed() ? SCI_LINEDOWNEXTEND : SCI_LINEDOWN));
590 | return TRUE;
591 | }
592 | // else just let Scintilla handle the navigation of autocompletion
593 | }
594 | }
595 | }
596 | }
597 |
598 | return CallNextHookEx(hook, ncode, wparam, lparam); // pass control to next hook in the hook chain
599 | }
600 |
601 |
602 | BOOL APIENTRY DllMain(HANDLE hModule, DWORD reasonForCall, LPVOID lpReserved) {
603 | switch (reasonForCall) {
604 | case DLL_PROCESS_ATTACH:
605 | cfColumnSelect = RegisterClipboardFormat(L"MSDEVColumnSelect");
606 | cfMultiSelect = RegisterClipboardFormat(L"BMSMultiSelect");
607 | _hModule = hModule;
608 | break;
609 | case DLL_PROCESS_DETACH:
610 | break;
611 | case DLL_THREAD_ATTACH:
612 | break;
613 | case DLL_THREAD_DETACH:
614 | break;
615 | }
616 | return TRUE;
617 | }
618 |
619 | extern "C" __declspec(dllexport) void setInfo(NppData notepadPlusData) {
620 | nppData = notepadPlusData;
621 |
622 | // Set this as early as possible so it is in a valid state
623 | editor.SetScintillaInstance(nppData._scintillaMainHandle);
624 | }
625 |
626 | extern "C" __declspec(dllexport) const wchar_t *getName() {
627 | return TEXT("BetterMultiSelection");
628 | }
629 |
630 | extern "C" __declspec(dllexport) FuncItem *getFuncsArray(int *nbF) {
631 | *nbF = sizeof(funcItem) / sizeof(funcItem[0]);
632 | return funcItem;
633 | }
634 |
635 | extern "C" __declspec(dllexport) void beNotified(SCNotification *notifyCode) {
636 | switch (notifyCode->nmhdr.code) {
637 | case SCN_CHARADDED:
638 | //if (editor.GetSelections() > 1)
639 |
640 | break;
641 | case SCN_FOCUSIN:
642 | hasFocus = true;
643 | break;
644 | case SCN_FOCUSOUT:
645 | hasFocus = false;
646 | break;
647 | case NPPN_READY: {
648 | bool isEnabled = GetPrivateProfileInt(TEXT("BetterMultiSelection"), TEXT("enabled"), 1, GetIniFilePath()) == 1;
649 | if (isEnabled) {
650 | enableBetterMultiSelection();
651 | }
652 | break;
653 | }
654 | case NPPN_SHUTDOWN:
655 | WritePrivateProfileString(TEXT("BetterMultiSelection"), TEXT("enabled"), hook ? TEXT("1") : TEXT("0"), GetIniFilePath());
656 | if (hook != NULL)
657 | UnhookWindowsHookEx(hook);
658 | break;
659 | case NPPN_BUFFERACTIVATED:
660 | editor.SetScintillaInstance(GetCurrentScintilla());
661 | editor.AutoCSetMulti(SC_MULTIAUTOC_EACH);
662 | break;
663 | }
664 | return;
665 | }
666 |
667 | extern "C" __declspec(dllexport) LRESULT messageProc(UINT Message, WPARAM wParam, LPARAM lParam) {
668 | return TRUE;
669 | }
670 |
671 | #ifdef UNICODE
672 | extern "C" __declspec(dllexport) BOOL isUnicode() {
673 | return TRUE;
674 | }
675 | #endif
676 |
--------------------------------------------------------------------------------
/src/Npp/Notepad_plus_msgs.h:
--------------------------------------------------------------------------------
1 | // This file is part of Notepad++ project
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 | // Note that the GPL places important restrictions on "derived works", yet
10 | // it does not provide a detailed definition of that term. To avoid
11 | // misunderstandings, we consider an application to constitute a
12 | // "derivative work" for the purpose of this license if it does any of the
13 | // following:
14 | // 1. Integrates source code from Notepad++.
15 | // 2. Integrates/includes/aggregates Notepad++ into a proprietary executable
16 | // installer, such as those produced by InstallShield.
17 | // 3. Links to a library or executes a program that does any of the above.
18 | //
19 | // This program is distributed in the hope that it will be useful,
20 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
21 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 | // GNU General Public License for more details.
23 | //
24 | // You should have received a copy of the GNU General Public License
25 | // along with this program; if not, write to the Free Software
26 | // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
27 |
28 |
29 | #pragma once
30 |
31 | #include
32 | #include
33 |
34 | enum LangType {L_TEXT, L_PHP , L_C, L_CPP, L_CS, L_OBJC, L_JAVA, L_RC,\
35 | L_HTML, L_XML, L_MAKEFILE, L_PASCAL, L_BATCH, L_INI, L_ASCII, L_USER,\
36 | L_ASP, L_SQL, L_VB, L_JS, L_CSS, L_PERL, L_PYTHON, L_LUA, \
37 | L_TEX, L_FORTRAN, L_BASH, L_FLASH, L_NSIS, L_TCL, L_LISP, L_SCHEME,\
38 | L_ASM, L_DIFF, L_PROPS, L_PS, L_RUBY, L_SMALLTALK, L_VHDL, L_KIX, L_AU3,\
39 | L_CAML, L_ADA, L_VERILOG, L_MATLAB, L_HASKELL, L_INNO, L_SEARCHRESULT,\
40 | L_CMAKE, L_YAML, L_COBOL, L_GUI4CLI, L_D, L_POWERSHELL, L_R, L_JSP,\
41 | L_COFFEESCRIPT, L_JSON, L_JAVASCRIPT, L_FORTRAN_77, L_BAANC, L_SREC,\
42 | L_IHEX, L_TEHEX, L_SWIFT,\
43 | L_ASN1, L_AVS, L_BLITZBASIC, L_PUREBASIC, L_FREEBASIC, \
44 | L_CSOUND, L_ERLANG, L_ESCRIPT, L_FORTH, L_LATEX, \
45 | L_MMIXAL, L_NIMROD, L_NNCRONTAB, L_OSCRIPT, L_REBOL, \
46 | L_REGISTRY, L_RUST, L_SPICE, L_TXT2TAGS, L_VISUALPROLOG,\
47 | // Don't use L_JS, use L_JAVASCRIPT instead
48 | // The end of enumated language type, so it should be always at the end
49 | L_EXTERNAL};
50 |
51 | 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, WV_WIN8, WV_WIN81, WV_WIN10};
52 | enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64 };
53 |
54 |
55 |
56 | #define NPPMSG (WM_USER + 1000)
57 |
58 | #define NPPM_GETCURRENTSCINTILLA (NPPMSG + 4)
59 | #define NPPM_GETCURRENTLANGTYPE (NPPMSG + 5)
60 | #define NPPM_SETCURRENTLANGTYPE (NPPMSG + 6)
61 |
62 | #define NPPM_GETNBOPENFILES (NPPMSG + 7)
63 | #define ALL_OPEN_FILES 0
64 | #define PRIMARY_VIEW 1
65 | #define SECOND_VIEW 2
66 |
67 | #define NPPM_GETOPENFILENAMES (NPPMSG + 8)
68 |
69 |
70 | #define NPPM_MODELESSDIALOG (NPPMSG + 12)
71 | #define MODELESSDIALOGADD 0
72 | #define MODELESSDIALOGREMOVE 1
73 |
74 | #define NPPM_GETNBSESSIONFILES (NPPMSG + 13)
75 | #define NPPM_GETSESSIONFILES (NPPMSG + 14)
76 | #define NPPM_SAVESESSION (NPPMSG + 15)
77 | #define NPPM_SAVECURRENTSESSION (NPPMSG + 16)
78 |
79 | struct sessionInfo {
80 | TCHAR* sessionFilePathName;
81 | int nbFile;
82 | TCHAR** files;
83 | };
84 |
85 | #define NPPM_GETOPENFILENAMESPRIMARY (NPPMSG + 17)
86 | #define NPPM_GETOPENFILENAMESSECOND (NPPMSG + 18)
87 |
88 | #define NPPM_CREATESCINTILLAHANDLE (NPPMSG + 20)
89 | #define NPPM_DESTROYSCINTILLAHANDLE (NPPMSG + 21)
90 | #define NPPM_GETNBUSERLANG (NPPMSG + 22)
91 |
92 | #define NPPM_GETCURRENTDOCINDEX (NPPMSG + 23)
93 | #define MAIN_VIEW 0
94 | #define SUB_VIEW 1
95 |
96 | #define NPPM_SETSTATUSBAR (NPPMSG + 24)
97 | #define STATUSBAR_DOC_TYPE 0
98 | #define STATUSBAR_DOC_SIZE 1
99 | #define STATUSBAR_CUR_POS 2
100 | #define STATUSBAR_EOF_FORMAT 3
101 | #define STATUSBAR_UNICODE_TYPE 4
102 | #define STATUSBAR_TYPING_MODE 5
103 |
104 | #define NPPM_GETMENUHANDLE (NPPMSG + 25)
105 | #define NPPPLUGINMENU 0
106 | #define NPPMAINMENU 1
107 | // INT NPPM_GETMENUHANDLE(INT menuChoice, 0)
108 | // Return: menu handle (HMENU) of choice (plugin menu handle or Notepad++ main menu handle)
109 |
110 | #define NPPM_ENCODESCI (NPPMSG + 26)
111 | //ascii file to unicode
112 | //int NPPM_ENCODESCI(MAIN_VIEW/SUB_VIEW, 0)
113 | //return new unicodeMode
114 |
115 | #define NPPM_DECODESCI (NPPMSG + 27)
116 | //unicode file to ascii
117 | //int NPPM_DECODESCI(MAIN_VIEW/SUB_VIEW, 0)
118 | //return old unicodeMode
119 |
120 | #define NPPM_ACTIVATEDOC (NPPMSG + 28)
121 | //void NPPM_ACTIVATEDOC(int view, int index2Activate)
122 |
123 | #define NPPM_LAUNCHFINDINFILESDLG (NPPMSG + 29)
124 | //void NPPM_LAUNCHFINDINFILESDLG(TCHAR * dir2Search, TCHAR * filtre)
125 |
126 | #define NPPM_DMMSHOW (NPPMSG + 30)
127 | //void NPPM_DMMSHOW(0, tTbData->hClient)
128 |
129 | #define NPPM_DMMHIDE (NPPMSG + 31)
130 | //void NPPM_DMMHIDE(0, tTbData->hClient)
131 |
132 | #define NPPM_DMMUPDATEDISPINFO (NPPMSG + 32)
133 | //void NPPM_DMMUPDATEDISPINFO(0, tTbData->hClient)
134 |
135 | #define NPPM_DMMREGASDCKDLG (NPPMSG + 33)
136 | //void NPPM_DMMREGASDCKDLG(0, &tTbData)
137 |
138 | #define NPPM_LOADSESSION (NPPMSG + 34)
139 | //void NPPM_LOADSESSION(0, const TCHAR* file name)
140 |
141 | #define NPPM_DMMVIEWOTHERTAB (NPPMSG + 35)
142 | //void WM_DMM_VIEWOTHERTAB(0, tTbData->pszName)
143 |
144 | #define NPPM_RELOADFILE (NPPMSG + 36)
145 | //BOOL NPPM_RELOADFILE(BOOL withAlert, TCHAR *filePathName2Reload)
146 |
147 | #define NPPM_SWITCHTOFILE (NPPMSG + 37)
148 | //BOOL NPPM_SWITCHTOFILE(0, TCHAR *filePathName2switch)
149 |
150 | #define NPPM_SAVECURRENTFILE (NPPMSG + 38)
151 | //BOOL NPPM_SAVECURRENTFILE(0, 0)
152 |
153 | #define NPPM_SAVEALLFILES (NPPMSG + 39)
154 | //BOOL NPPM_SAVEALLFILES(0, 0)
155 |
156 | #define NPPM_SETMENUITEMCHECK (NPPMSG + 40)
157 | //void WM_PIMENU_CHECK(UINT funcItem[X]._cmdID, TRUE/FALSE)
158 |
159 | #define NPPM_ADDTOOLBARICON (NPPMSG + 41)
160 | //void WM_ADDTOOLBARICON(UINT funcItem[X]._cmdID, toolbarIcons icon)
161 | struct toolbarIcons {
162 | HBITMAP hToolbarBmp;
163 | HICON hToolbarIcon;
164 | };
165 |
166 | #define NPPM_GETWINDOWSVERSION (NPPMSG + 42)
167 | //winVer NPPM_GETWINDOWSVERSION(0, 0)
168 |
169 | #define NPPM_DMMGETPLUGINHWNDBYNAME (NPPMSG + 43)
170 | //HWND WM_DMM_GETPLUGINHWNDBYNAME(const TCHAR *windowName, const TCHAR *moduleName)
171 | // if moduleName is NULL, then return value is NULL
172 | // if windowName is NULL, then the first found window handle which matches with the moduleName will be returned
173 |
174 | #define NPPM_MAKECURRENTBUFFERDIRTY (NPPMSG + 44)
175 | //BOOL NPPM_MAKECURRENTBUFFERDIRTY(0, 0)
176 |
177 | #define NPPM_GETENABLETHEMETEXTUREFUNC (NPPMSG + 45)
178 | //BOOL NPPM_GETENABLETHEMETEXTUREFUNC(0, 0)
179 |
180 | #define NPPM_GETPLUGINSCONFIGDIR (NPPMSG + 46)
181 | //INT NPPM_GETPLUGINSCONFIGDIR(int strLen, TCHAR *str)
182 | // Get user's plugin config directory path. It's useful if plugins want to save/load parameters for the current user
183 | // Returns the number of TCHAR copied/to copy.
184 | // Users should call it with "str" be NULL to get the required number of TCHAR (not including the terminating nul character),
185 | // allocate "str" buffer with the return value + 1, then call it again to get the path.
186 |
187 | #define NPPM_MSGTOPLUGIN (NPPMSG + 47)
188 | //BOOL NPPM_MSGTOPLUGIN(TCHAR *destModuleName, CommunicationInfo *info)
189 | // return value is TRUE when the message arrive to the destination plugins.
190 | // if destModule or info is NULL, then return value is FALSE
191 | struct CommunicationInfo {
192 | long internalMsg;
193 | const TCHAR * srcModuleName;
194 | void * info; // defined by plugin
195 | };
196 |
197 | #define NPPM_MENUCOMMAND (NPPMSG + 48)
198 | //void NPPM_MENUCOMMAND(0, int cmdID)
199 | // uncomment //#include "menuCmdID.h"
200 | // in the beginning of this file then use the command symbols defined in "menuCmdID.h" file
201 | // to access all the Notepad++ menu command items
202 |
203 | #define NPPM_TRIGGERTABBARCONTEXTMENU (NPPMSG + 49)
204 | //void NPPM_TRIGGERTABBARCONTEXTMENU(int view, int index2Activate)
205 |
206 | #define NPPM_GETNPPVERSION (NPPMSG + 50)
207 | // int NPPM_GETNPPVERSION(0, 0)
208 | // return version
209 | // ex : v4.6
210 | // HIWORD(version) == 4
211 | // LOWORD(version) == 6
212 |
213 | #define NPPM_HIDETABBAR (NPPMSG + 51)
214 | // BOOL NPPM_HIDETABBAR(0, BOOL hideOrNot)
215 | // if hideOrNot is set as TRUE then tab bar will be hidden
216 | // otherwise it'll be shown.
217 | // return value : the old status value
218 |
219 | #define NPPM_ISTABBARHIDDEN (NPPMSG + 52)
220 | // BOOL NPPM_ISTABBARHIDDEN(0, 0)
221 | // returned value : TRUE if tab bar is hidden, otherwise FALSE
222 |
223 | #define NPPM_GETPOSFROMBUFFERID (NPPMSG + 57)
224 | // INT NPPM_GETPOSFROMBUFFERID(UINT_PTR bufferID, INT priorityView)
225 | // Return VIEW|INDEX from a buffer ID. -1 if the bufferID non existing
226 | // if priorityView set to SUB_VIEW, then SUB_VIEW will be search firstly
227 | //
228 | // VIEW takes 2 highest bits and INDEX (0 based) takes the rest (30 bits)
229 | // Here's the values for the view :
230 | // MAIN_VIEW 0
231 | // SUB_VIEW 1
232 |
233 | #define NPPM_GETFULLPATHFROMBUFFERID (NPPMSG + 58)
234 | // INT NPPM_GETFULLPATHFROMBUFFERID(UINT_PTR bufferID, TCHAR *fullFilePath)
235 | // Get full path file name from a bufferID.
236 | // Return -1 if the bufferID non existing, otherwise the number of TCHAR copied/to copy
237 | // User should call it with fullFilePath be NULL to get the number of TCHAR (not including the nul character),
238 | // allocate fullFilePath with the return values + 1, then call it again to get full path file name
239 |
240 | #define NPPM_GETBUFFERIDFROMPOS (NPPMSG + 59)
241 | // LRESULT NPPM_GETBUFFERIDFROMPOS(INT index, INT iView)
242 | // wParam: Position of document
243 | // lParam: View to use, 0 = Main, 1 = Secondary
244 | // Returns 0 if invalid
245 |
246 | #define NPPM_GETCURRENTBUFFERID (NPPMSG + 60)
247 | // LRESULT NPPM_GETCURRENTBUFFERID(0, 0)
248 | // Returns active Buffer
249 |
250 | #define NPPM_RELOADBUFFERID (NPPMSG + 61)
251 | // VOID NPPM_RELOADBUFFERID(UINT_PTR bufferID, BOOL alert)
252 | // Reloads Buffer
253 | // wParam: Buffer to reload
254 | // lParam: 0 if no alert, else alert
255 |
256 |
257 | #define NPPM_GETBUFFERLANGTYPE (NPPMSG + 64)
258 | // INT NPPM_GETBUFFERLANGTYPE(UINT_PTR bufferID, 0)
259 | // wParam: BufferID to get LangType from
260 | // lParam: 0
261 | // Returns as int, see LangType. -1 on error
262 |
263 | #define NPPM_SETBUFFERLANGTYPE (NPPMSG + 65)
264 | // BOOL NPPM_SETBUFFERLANGTYPE(UINT_PTR bufferID, INT langType)
265 | // wParam: BufferID to set LangType of
266 | // lParam: LangType
267 | // Returns TRUE on success, FALSE otherwise
268 | // use int, see LangType for possible values
269 | // L_USER and L_EXTERNAL are not supported
270 |
271 | #define NPPM_GETBUFFERENCODING (NPPMSG + 66)
272 | // INT NPPM_GETBUFFERENCODING(UINT_PTR bufferID, 0)
273 | // wParam: BufferID to get encoding from
274 | // lParam: 0
275 | // returns as int, see UniMode. -1 on error
276 |
277 | #define NPPM_SETBUFFERENCODING (NPPMSG + 67)
278 | // BOOL NPPM_SETBUFFERENCODING(UINT_PTR bufferID, INT encoding)
279 | // wParam: BufferID to set encoding of
280 | // lParam: encoding
281 | // Returns TRUE on success, FALSE otherwise
282 | // use int, see UniMode
283 | // Can only be done on new, unedited files
284 |
285 | #define NPPM_GETBUFFERFORMAT (NPPMSG + 68)
286 | // INT NPPM_GETBUFFERFORMAT(UINT_PTR bufferID, 0)
287 | // wParam: BufferID to get EolType format from
288 | // lParam: 0
289 | // returns as int, see EolType format. -1 on error
290 |
291 | #define NPPM_SETBUFFERFORMAT (NPPMSG + 69)
292 | // BOOL NPPM_SETBUFFERFORMAT(UINT_PTR bufferID, INT format)
293 | // wParam: BufferID to set EolType format of
294 | // lParam: format
295 | // Returns TRUE on success, FALSE otherwise
296 | // use int, see EolType format
297 |
298 |
299 | #define NPPM_HIDETOOLBAR (NPPMSG + 70)
300 | // BOOL NPPM_HIDETOOLBAR(0, BOOL hideOrNot)
301 | // if hideOrNot is set as TRUE then tool bar will be hidden
302 | // otherwise it'll be shown.
303 | // return value : the old status value
304 |
305 | #define NPPM_ISTOOLBARHIDDEN (NPPMSG + 71)
306 | // BOOL NPPM_ISTOOLBARHIDDEN(0, 0)
307 | // returned value : TRUE if tool bar is hidden, otherwise FALSE
308 |
309 | #define NPPM_HIDEMENU (NPPMSG + 72)
310 | // BOOL NPPM_HIDEMENU(0, BOOL hideOrNot)
311 | // if hideOrNot is set as TRUE then menu will be hidden
312 | // otherwise it'll be shown.
313 | // return value : the old status value
314 |
315 | #define NPPM_ISMENUHIDDEN (NPPMSG + 73)
316 | // BOOL NPPM_ISMENUHIDDEN(0, 0)
317 | // returned value : TRUE if menu is hidden, otherwise FALSE
318 |
319 | #define NPPM_HIDESTATUSBAR (NPPMSG + 74)
320 | // BOOL NPPM_HIDESTATUSBAR(0, BOOL hideOrNot)
321 | // if hideOrNot is set as TRUE then STATUSBAR will be hidden
322 | // otherwise it'll be shown.
323 | // return value : the old status value
324 |
325 | #define NPPM_ISSTATUSBARHIDDEN (NPPMSG + 75)
326 | // BOOL NPPM_ISSTATUSBARHIDDEN(0, 0)
327 | // returned value : TRUE if STATUSBAR is hidden, otherwise FALSE
328 |
329 | #define NPPM_GETSHORTCUTBYCMDID (NPPMSG + 76)
330 | // BOOL NPPM_GETSHORTCUTBYCMDID(int cmdID, ShortcutKey *sk)
331 | // get your plugin command current mapped shortcut into sk via cmdID
332 | // You may need it after getting NPPN_READY notification
333 | // returned value : TRUE if this function call is successful and shortcut is enable, otherwise FALSE
334 |
335 | #define NPPM_DOOPEN (NPPMSG + 77)
336 | // BOOL NPPM_DOOPEN(0, const TCHAR *fullPathName2Open)
337 | // fullPathName2Open indicates the full file path name to be opened.
338 | // The return value is TRUE (1) if the operation is successful, otherwise FALSE (0).
339 |
340 | #define NPPM_SAVECURRENTFILEAS (NPPMSG + 78)
341 | // BOOL NPPM_SAVECURRENTFILEAS (BOOL asCopy, const TCHAR* filename)
342 |
343 | #define NPPM_GETCURRENTNATIVELANGENCODING (NPPMSG + 79)
344 | // INT NPPM_GETCURRENTNATIVELANGENCODING(0, 0)
345 | // returned value : the current native language encoding
346 |
347 | #define NPPM_ALLOCATESUPPORTED (NPPMSG + 80)
348 | // returns TRUE if NPPM_ALLOCATECMDID is supported
349 | // Use to identify if subclassing is necessary
350 |
351 | #define NPPM_ALLOCATECMDID (NPPMSG + 81)
352 | // BOOL NPPM_ALLOCATECMDID(int numberRequested, int* startNumber)
353 | // sets startNumber to the initial command ID if successful
354 | // Returns: TRUE if successful, FALSE otherwise. startNumber will also be set to 0 if unsuccessful
355 |
356 | #define NPPM_ALLOCATEMARKER (NPPMSG + 82)
357 | // BOOL NPPM_ALLOCATEMARKER(int numberRequested, int* startNumber)
358 | // sets startNumber to the initial command ID if successful
359 | // Allocates a marker number to a plugin
360 | // Returns: TRUE if successful, FALSE otherwise. startNumber will also be set to 0 if unsuccessful
361 |
362 | #define NPPM_GETLANGUAGENAME (NPPMSG + 83)
363 | // INT NPPM_GETLANGUAGENAME(int langType, TCHAR *langName)
364 | // Get programming language name from the given language type (LangType)
365 | // Return value is the number of copied character / number of character to copy (\0 is not included)
366 | // You should call this function 2 times - the first time you pass langName as NULL to get the number of characters to copy.
367 | // You allocate a buffer of the length of (the number of characters + 1) then call NPPM_GETLANGUAGENAME function the 2nd time
368 | // by passing allocated buffer as argument langName
369 |
370 | #define NPPM_GETLANGUAGEDESC (NPPMSG + 84)
371 | // INT NPPM_GETLANGUAGEDESC(int langType, TCHAR *langDesc)
372 | // Get programming language short description from the given language type (LangType)
373 | // Return value is the number of copied character / number of character to copy (\0 is not included)
374 | // You should call this function 2 times - the first time you pass langDesc as NULL to get the number of characters to copy.
375 | // You allocate a buffer of the length of (the number of characters + 1) then call NPPM_GETLANGUAGEDESC function the 2nd time
376 | // by passing allocated buffer as argument langDesc
377 |
378 | #define NPPM_SHOWDOCSWITCHER (NPPMSG + 85)
379 | // VOID NPPM_SHOWDOCSWITCHER(0, BOOL toShowOrNot)
380 | // Send this message to show or hide doc switcher.
381 | // if toShowOrNot is TRUE then show doc switcher, otherwise hide it.
382 |
383 | #define NPPM_ISDOCSWITCHERSHOWN (NPPMSG + 86)
384 | // BOOL NPPM_ISDOCSWITCHERSHOWN(0, 0)
385 | // Check to see if doc switcher is shown.
386 |
387 | #define NPPM_GETAPPDATAPLUGINSALLOWED (NPPMSG + 87)
388 | // BOOL NPPM_GETAPPDATAPLUGINSALLOWED(0, 0)
389 | // Check to see if loading plugins from "%APPDATA%\..\Local\Notepad++\plugins" is allowed.
390 |
391 | #define NPPM_GETCURRENTVIEW (NPPMSG + 88)
392 | // INT NPPM_GETCURRENTVIEW(0, 0)
393 | // Return: current edit view of Notepad++. Only 2 possible values: 0 = Main, 1 = Secondary
394 |
395 | #define NPPM_DOCSWITCHERDISABLECOLUMN (NPPMSG + 89)
396 | // VOID NPPM_DOCSWITCHERDISABLECOLUMN(0, BOOL disableOrNot)
397 | // Disable or enable extension column of doc switcher
398 |
399 | #define NPPM_GETEDITORDEFAULTFOREGROUNDCOLOR (NPPMSG + 90)
400 | // INT NPPM_GETEDITORDEFAULTFOREGROUNDCOLOR(0, 0)
401 | // Return: current editor default foreground color. You should convert the returned value in COLORREF
402 |
403 | #define NPPM_GETEDITORDEFAULTBACKGROUNDCOLOR (NPPMSG + 91)
404 | // INT NPPM_GETEDITORDEFAULTBACKGROUNDCOLOR(0, 0)
405 | // Return: current editor default background color. You should convert the returned value in COLORREF
406 |
407 | #define NPPM_SETSMOOTHFONT (NPPMSG + 92)
408 | // VOID NPPM_SETSMOOTHFONT(0, BOOL setSmoothFontOrNot)
409 |
410 | #define NPPM_SETEDITORBORDEREDGE (NPPMSG + 93)
411 | // VOID NPPM_SETEDITORBORDEREDGE(0, BOOL withEditorBorderEdgeOrNot)
412 |
413 | #define NPPM_SAVEFILE (NPPMSG + 94)
414 | // VOID NPPM_SAVEFILE(0, const TCHAR *fileNameToSave)
415 |
416 | #define NPPM_DISABLEAUTOUPDATE (NPPMSG + 95) // 2119 in decimal
417 | // VOID NPPM_DISABLEAUTOUPDATE(0, 0)
418 |
419 | #define NPPM_REMOVESHORTCUTBYCMDID (NPPMSG + 96) // 2120 in decimal
420 | // BOOL NPPM_REMOVESHORTCUTASSIGNMENT(int cmdID)
421 | // removes the assigned shortcut mapped to cmdID
422 | // returned value : TRUE if function call is successful, otherwise FALSE
423 |
424 | #define NPPM_GETPLUGINHOMEPATH (NPPMSG + 97)
425 | // INT NPPM_GETPLUGINHOMEPATH(size_t strLen, TCHAR *pluginRootPath)
426 | // Get plugin home root path. It's useful if plugins want to get its own path
427 | // by appending which is the name of plugin without extension part.
428 | // Returns the number of TCHAR copied/to copy.
429 | // Users should call it with pluginRootPath be NULL to get the required number of TCHAR (not including the terminating nul character),
430 | // allocate pluginRootPath buffer with the return value + 1, then call it again to get the path.
431 |
432 | #define RUNCOMMAND_USER (WM_USER + 3000)
433 | #define NPPM_GETFULLCURRENTPATH (RUNCOMMAND_USER + FULL_CURRENT_PATH)
434 | #define NPPM_GETCURRENTDIRECTORY (RUNCOMMAND_USER + CURRENT_DIRECTORY)
435 | #define NPPM_GETFILENAME (RUNCOMMAND_USER + FILE_NAME)
436 | #define NPPM_GETNAMEPART (RUNCOMMAND_USER + NAME_PART)
437 | #define NPPM_GETEXTPART (RUNCOMMAND_USER + EXT_PART)
438 | #define NPPM_GETCURRENTWORD (RUNCOMMAND_USER + CURRENT_WORD)
439 | #define NPPM_GETNPPDIRECTORY (RUNCOMMAND_USER + NPP_DIRECTORY)
440 | #define NPPM_GETFILENAMEATCURSOR (RUNCOMMAND_USER + GETFILENAMEATCURSOR)
441 | // BOOL NPPM_GETXXXXXXXXXXXXXXXX(size_t strLen, TCHAR *str)
442 | // where str is the allocated TCHAR array,
443 | // strLen is the allocated array size
444 | // The return value is TRUE when get generic_string operation success
445 | // Otherwise (allocated array size is too small) FALSE
446 |
447 | #define NPPM_GETCURRENTLINE (RUNCOMMAND_USER + CURRENT_LINE)
448 | // INT NPPM_GETCURRENTLINE(0, 0)
449 | // return the caret current position line
450 | #define NPPM_GETCURRENTCOLUMN (RUNCOMMAND_USER + CURRENT_COLUMN)
451 | // INT NPPM_GETCURRENTCOLUMN(0, 0)
452 | // return the caret current position column
453 |
454 | #define NPPM_GETNPPFULLFILEPATH (RUNCOMMAND_USER + NPP_FULL_FILE_PATH)
455 |
456 | #define VAR_NOT_RECOGNIZED 0
457 | #define FULL_CURRENT_PATH 1
458 | #define CURRENT_DIRECTORY 2
459 | #define FILE_NAME 3
460 | #define NAME_PART 4
461 | #define EXT_PART 5
462 | #define CURRENT_WORD 6
463 | #define NPP_DIRECTORY 7
464 | #define CURRENT_LINE 8
465 | #define CURRENT_COLUMN 9
466 | #define NPP_FULL_FILE_PATH 10
467 | #define GETFILENAMEATCURSOR 11
468 |
469 |
470 | // Notification code
471 | #define NPPN_FIRST 1000
472 | #define NPPN_READY (NPPN_FIRST + 1) // To notify plugins that all the procedures of launchment of notepad++ are done.
473 | //scnNotification->nmhdr.code = NPPN_READY;
474 | //scnNotification->nmhdr.hwndFrom = hwndNpp;
475 | //scnNotification->nmhdr.idFrom = 0;
476 |
477 | #define NPPN_TBMODIFICATION (NPPN_FIRST + 2) // To notify plugins that toolbar icons can be registered
478 | //scnNotification->nmhdr.code = NPPN_TB_MODIFICATION;
479 | //scnNotification->nmhdr.hwndFrom = hwndNpp;
480 | //scnNotification->nmhdr.idFrom = 0;
481 |
482 | #define NPPN_FILEBEFORECLOSE (NPPN_FIRST + 3) // To notify plugins that the current file is about to be closed
483 | //scnNotification->nmhdr.code = NPPN_FILEBEFORECLOSE;
484 | //scnNotification->nmhdr.hwndFrom = hwndNpp;
485 | //scnNotification->nmhdr.idFrom = BufferID;
486 |
487 | #define NPPN_FILEOPENED (NPPN_FIRST + 4) // To notify plugins that the current file is just opened
488 | //scnNotification->nmhdr.code = NPPN_FILEOPENED;
489 | //scnNotification->nmhdr.hwndFrom = hwndNpp;
490 | //scnNotification->nmhdr.idFrom = BufferID;
491 |
492 | #define NPPN_FILECLOSED (NPPN_FIRST + 5) // To notify plugins that the current file is just closed
493 | //scnNotification->nmhdr.code = NPPN_FILECLOSED;
494 | //scnNotification->nmhdr.hwndFrom = hwndNpp;
495 | //scnNotification->nmhdr.idFrom = BufferID;
496 |
497 | #define NPPN_FILEBEFOREOPEN (NPPN_FIRST + 6) // To notify plugins that the current file is about to be opened
498 | //scnNotification->nmhdr.code = NPPN_FILEBEFOREOPEN;
499 | //scnNotification->nmhdr.hwndFrom = hwndNpp;
500 | //scnNotification->nmhdr.idFrom = BufferID;
501 |
502 | #define NPPN_FILEBEFORESAVE (NPPN_FIRST + 7) // To notify plugins that the current file is about to be saved
503 | //scnNotification->nmhdr.code = NPPN_FILEBEFOREOPEN;
504 | //scnNotification->nmhdr.hwndFrom = hwndNpp;
505 | //scnNotification->nmhdr.idFrom = BufferID;
506 |
507 | #define NPPN_FILESAVED (NPPN_FIRST + 8) // To notify plugins that the current file is just saved
508 | //scnNotification->nmhdr.code = NPPN_FILESAVED;
509 | //scnNotification->nmhdr.hwndFrom = hwndNpp;
510 | //scnNotification->nmhdr.idFrom = BufferID;
511 |
512 | #define NPPN_SHUTDOWN (NPPN_FIRST + 9) // To notify plugins that Notepad++ is about to be shutdowned.
513 | //scnNotification->nmhdr.code = NPPN_SHUTDOWN;
514 | //scnNotification->nmhdr.hwndFrom = hwndNpp;
515 | //scnNotification->nmhdr.idFrom = 0;
516 |
517 | #define NPPN_BUFFERACTIVATED (NPPN_FIRST + 10) // To notify plugins that a buffer was activated (put to foreground).
518 | //scnNotification->nmhdr.code = NPPN_BUFFERACTIVATED;
519 | //scnNotification->nmhdr.hwndFrom = hwndNpp;
520 | //scnNotification->nmhdr.idFrom = activatedBufferID;
521 |
522 | #define NPPN_LANGCHANGED (NPPN_FIRST + 11) // To notify plugins that the language in the current doc is just changed.
523 | //scnNotification->nmhdr.code = NPPN_LANGCHANGED;
524 | //scnNotification->nmhdr.hwndFrom = hwndNpp;
525 | //scnNotification->nmhdr.idFrom = currentBufferID;
526 |
527 | #define NPPN_WORDSTYLESUPDATED (NPPN_FIRST + 12) // To notify plugins that user initiated a WordStyleDlg change.
528 | //scnNotification->nmhdr.code = NPPN_WORDSTYLESUPDATED;
529 | //scnNotification->nmhdr.hwndFrom = hwndNpp;
530 | //scnNotification->nmhdr.idFrom = currentBufferID;
531 |
532 | #define NPPN_SHORTCUTREMAPPED (NPPN_FIRST + 13) // To notify plugins that plugin command shortcut is remapped.
533 | //scnNotification->nmhdr.code = NPPN_SHORTCUTSREMAPPED;
534 | //scnNotification->nmhdr.hwndFrom = ShortcutKeyStructurePointer;
535 | //scnNotification->nmhdr.idFrom = cmdID;
536 | //where ShortcutKeyStructurePointer is pointer of struct ShortcutKey:
537 | //struct ShortcutKey {
538 | // bool _isCtrl;
539 | // bool _isAlt;
540 | // bool _isShift;
541 | // UCHAR _key;
542 | //};
543 |
544 | #define NPPN_FILEBEFORELOAD (NPPN_FIRST + 14) // To notify plugins that the current file is about to be loaded
545 | //scnNotification->nmhdr.code = NPPN_FILEBEFOREOPEN;
546 | //scnNotification->nmhdr.hwndFrom = hwndNpp;
547 | //scnNotification->nmhdr.idFrom = NULL;
548 |
549 | #define NPPN_FILELOADFAILED (NPPN_FIRST + 15) // To notify plugins that file open operation failed
550 | //scnNotification->nmhdr.code = NPPN_FILEOPENFAILED;
551 | //scnNotification->nmhdr.hwndFrom = hwndNpp;
552 | //scnNotification->nmhdr.idFrom = BufferID;
553 |
554 | #define NPPN_READONLYCHANGED (NPPN_FIRST + 16) // To notify plugins that current document change the readonly status,
555 | //scnNotification->nmhdr.code = NPPN_READONLYCHANGED;
556 | //scnNotification->nmhdr.hwndFrom = bufferID;
557 | //scnNotification->nmhdr.idFrom = docStatus;
558 | // where bufferID is BufferID
559 | // docStatus can be combined by DOCSTATUS_READONLY and DOCSTATUS_BUFFERDIRTY
560 |
561 | #define DOCSTATUS_READONLY 1
562 | #define DOCSTATUS_BUFFERDIRTY 2
563 |
564 | #define NPPN_DOCORDERCHANGED (NPPN_FIRST + 17) // To notify plugins that document order is changed
565 | //scnNotification->nmhdr.code = NPPN_DOCORDERCHANGED;
566 | //scnNotification->nmhdr.hwndFrom = newIndex;
567 | //scnNotification->nmhdr.idFrom = BufferID;
568 |
569 | #define NPPN_SNAPSHOTDIRTYFILELOADED (NPPN_FIRST + 18) // To notify plugins that a snapshot dirty file is loaded on startup
570 | //scnNotification->nmhdr.code = NPPN_SNAPSHOTDIRTYFILELOADED;
571 | //scnNotification->nmhdr.hwndFrom = NULL;
572 | //scnNotification->nmhdr.idFrom = BufferID;
573 |
574 | #define NPPN_BEFORESHUTDOWN (NPPN_FIRST + 19) // To notify plugins that Npp shutdown has been triggered, files have not been closed yet
575 | //scnNotification->nmhdr.code = NPPN_BEFORESHUTDOWN;
576 | //scnNotification->nmhdr.hwndFrom = hwndNpp;
577 | //scnNotification->nmhdr.idFrom = 0;
578 |
579 | #define NPPN_CANCELSHUTDOWN (NPPN_FIRST + 20) // To notify plugins that Npp shutdown has been cancelled
580 | //scnNotification->nmhdr.code = NPPN_CANCELSHUTDOWN;
581 | //scnNotification->nmhdr.hwndFrom = hwndNpp;
582 | //scnNotification->nmhdr.idFrom = 0;
583 |
584 | #define NPPN_FILEBEFORERENAME (NPPN_FIRST + 21) // To notify plugins that file is to be renamed
585 | //scnNotification->nmhdr.code = NPPN_FILEBEFORERENAME;
586 | //scnNotification->nmhdr.hwndFrom = hwndNpp;
587 | //scnNotification->nmhdr.idFrom = BufferID;
588 |
589 | #define NPPN_FILERENAMECANCEL (NPPN_FIRST + 22) // To notify plugins that file rename has been cancelled
590 | //scnNotification->nmhdr.code = NPPN_FILERENAMECANCEL;
591 | //scnNotification->nmhdr.hwndFrom = hwndNpp;
592 | //scnNotification->nmhdr.idFrom = BufferID;
593 |
594 | #define NPPN_FILERENAMED (NPPN_FIRST + 23) // To notify plugins that file has been renamed
595 | //scnNotification->nmhdr.code = NPPN_FILERENAMED;
596 | //scnNotification->nmhdr.hwndFrom = hwndNpp;
597 | //scnNotification->nmhdr.idFrom = BufferID;
598 |
599 | #define NPPN_FILEBEFOREDELETE (NPPN_FIRST + 24) // To notify plugins that file is to be deleted
600 | //scnNotification->nmhdr.code = NPPN_FILEBEFOREDELETE;
601 | //scnNotification->nmhdr.hwndFrom = hwndNpp;
602 | //scnNotification->nmhdr.idFrom = BufferID;
603 |
604 | #define NPPN_FILEDELETEFAILED (NPPN_FIRST + 25) // To notify plugins that file deletion has failed
605 | //scnNotification->nmhdr.code = NPPN_FILEDELETEFAILED;
606 | //scnNotification->nmhdr.hwndFrom = hwndNpp;
607 | //scnNotification->nmhdr.idFrom = BufferID;
608 |
609 | #define NPPN_FILEDELETED (NPPN_FIRST + 26) // To notify plugins that file has been deleted
610 | //scnNotification->nmhdr.code = NPPN_FILEDELETED;
611 | //scnNotification->nmhdr.hwndFrom = hwndNpp;
612 | //scnNotification->nmhdr.idFrom = BufferID;
613 |
--------------------------------------------------------------------------------
/src/Npp/PluginInterface.h:
--------------------------------------------------------------------------------
1 | // This file is part of Notepad++ project
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 | // Note that the GPL places important restrictions on "derived works", yet
10 | // it does not provide a detailed definition of that term. To avoid
11 | // misunderstandings, we consider an application to constitute a
12 | // "derivative work" for the purpose of this license if it does any of the
13 | // following:
14 | // 1. Integrates source code from Notepad++.
15 | // 2. Integrates/includes/aggregates Notepad++ into a proprietary executable
16 | // installer, such as those produced by InstallShield.
17 | // 3. Links to a library or executes a program that does any of the above.
18 | //
19 | // This program is distributed in the hope that it will be useful,
20 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
21 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 | // GNU General Public License for more details.
23 | //
24 | // You should have received a copy of the GNU General Public License
25 | // along with this program; if not, write to the Free Software
26 | // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
27 |
28 |
29 | #pragma once
30 |
31 | #include "Scintilla.h"
32 | #include "Notepad_plus_msgs.h"
33 |
34 | const int nbChar = 64;
35 |
36 | typedef const TCHAR * (__cdecl * PFUNCGETNAME)();
37 |
38 | struct NppData
39 | {
40 | HWND _nppHandle;
41 | HWND _scintillaMainHandle;
42 | HWND _scintillaSecondHandle;
43 | };
44 |
45 | typedef void (__cdecl * PFUNCSETINFO)(NppData);
46 | typedef void (__cdecl * PFUNCPLUGINCMD)();
47 | typedef void (__cdecl * PBENOTIFIED)(SCNotification *);
48 | typedef LRESULT (__cdecl * PMESSAGEPROC)(UINT Message, WPARAM wParam, LPARAM lParam);
49 |
50 |
51 | struct ShortcutKey
52 | {
53 | bool _isCtrl;
54 | bool _isAlt;
55 | bool _isShift;
56 | UCHAR _key;
57 | };
58 |
59 | struct FuncItem
60 | {
61 | TCHAR _itemName[nbChar];
62 | PFUNCPLUGINCMD _pFunc;
63 | int _cmdID;
64 | bool _init2Check;
65 | ShortcutKey *_pShKey;
66 | };
67 |
68 | typedef FuncItem * (__cdecl * PFUNCGETFUNCSARRAY)(int *);
69 |
70 | // You should implement (or define an empty function body) those functions which are called by Notepad++ plugin manager
71 | extern "C" __declspec(dllexport) void setInfo(NppData);
72 | extern "C" __declspec(dllexport) const TCHAR * getName();
73 | extern "C" __declspec(dllexport) FuncItem * getFuncsArray(int *);
74 | extern "C" __declspec(dllexport) void beNotified(SCNotification *);
75 | extern "C" __declspec(dllexport) LRESULT messageProc(UINT Message, WPARAM wParam, LPARAM lParam);
76 |
77 | // This API return always true now, since Notepad++ isn't compiled in ANSI mode anymore
78 | extern "C" __declspec(dllexport) BOOL isUnicode();
79 |
80 |
--------------------------------------------------------------------------------
/src/Npp/Sci_Position.h:
--------------------------------------------------------------------------------
1 | // Scintilla source code edit control
2 | /** @file Sci_Position.h
3 | ** Define the Sci_Position type used in Scintilla's external interfaces.
4 | ** These need to be available to clients written in C so are not in a C++ namespace.
5 | **/
6 | // Copyright 2015 by Neil Hodgson
7 | // The License.txt file describes the conditions under which this software may be distributed.
8 |
9 | #ifndef SCI_POSITION_H
10 | #define SCI_POSITION_H
11 |
12 | #include
13 |
14 | // Basic signed type used throughout interface
15 | typedef ptrdiff_t Sci_Position;
16 |
17 | // Unsigned variant used for ILexer::Lex and ILexer::Fold
18 | typedef size_t Sci_PositionU;
19 |
20 | // For Sci_CharacterRange which is defined as long to be compatible with Win32 CHARRANGE
21 | typedef intptr_t Sci_PositionCR;
22 |
23 | #ifdef _WIN32
24 | #define SCI_METHOD __stdcall
25 | #else
26 | #define SCI_METHOD
27 | #endif
28 |
29 | #endif
30 |
--------------------------------------------------------------------------------
/src/Npp/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 | /* ++Autogenerated -- start of section automatically generated from Scintilla.iface */
42 | #define INVALID_POSITION -1
43 | #define SCI_START 2000
44 | #define SCI_OPTIONAL_START 3000
45 | #define SCI_LEXER_START 4000
46 | #define SCI_ADDTEXT 2001
47 | #define SCI_ADDSTYLEDTEXT 2002
48 | #define SCI_INSERTTEXT 2003
49 | #define SCI_CHANGEINSERTION 2672
50 | #define SCI_CLEARALL 2004
51 | #define SCI_DELETERANGE 2645
52 | #define SCI_CLEARDOCUMENTSTYLE 2005
53 | #define SCI_GETLENGTH 2006
54 | #define SCI_GETCHARAT 2007
55 | #define SCI_GETCURRENTPOS 2008
56 | #define SCI_GETANCHOR 2009
57 | #define SCI_GETSTYLEAT 2010
58 | #define SCI_REDO 2011
59 | #define SCI_SETUNDOCOLLECTION 2012
60 | #define SCI_SELECTALL 2013
61 | #define SCI_SETSAVEPOINT 2014
62 | #define SCI_GETSTYLEDTEXT 2015
63 | #define SCI_CANREDO 2016
64 | #define SCI_MARKERLINEFROMHANDLE 2017
65 | #define SCI_MARKERDELETEHANDLE 2018
66 | #define SCI_GETUNDOCOLLECTION 2019
67 | #define SCWS_INVISIBLE 0
68 | #define SCWS_VISIBLEALWAYS 1
69 | #define SCWS_VISIBLEAFTERINDENT 2
70 | #define SCWS_VISIBLEONLYININDENT 3
71 | #define SCI_GETVIEWWS 2020
72 | #define SCI_SETVIEWWS 2021
73 | #define SCTD_LONGARROW 0
74 | #define SCTD_STRIKEOUT 1
75 | #define SCI_GETTABDRAWMODE 2698
76 | #define SCI_SETTABDRAWMODE 2699
77 | #define SCI_POSITIONFROMPOINT 2022
78 | #define SCI_POSITIONFROMPOINTCLOSE 2023
79 | #define SCI_GOTOLINE 2024
80 | #define SCI_GOTOPOS 2025
81 | #define SCI_SETANCHOR 2026
82 | #define SCI_GETCURLINE 2027
83 | #define SCI_GETENDSTYLED 2028
84 | #define SC_EOL_CRLF 0
85 | #define SC_EOL_CR 1
86 | #define SC_EOL_LF 2
87 | #define SCI_CONVERTEOLS 2029
88 | #define SCI_GETEOLMODE 2030
89 | #define SCI_SETEOLMODE 2031
90 | #define SCI_STARTSTYLING 2032
91 | #define SCI_SETSTYLING 2033
92 | #define SCI_GETBUFFEREDDRAW 2034
93 | #define SCI_SETBUFFEREDDRAW 2035
94 | #define SCI_SETTABWIDTH 2036
95 | #define SCI_GETTABWIDTH 2121
96 | #define SCI_CLEARTABSTOPS 2675
97 | #define SCI_ADDTABSTOP 2676
98 | #define SCI_GETNEXTTABSTOP 2677
99 | #define SC_CP_UTF8 65001
100 | #define SCI_SETCODEPAGE 2037
101 | #define SC_IME_WINDOWED 0
102 | #define SC_IME_INLINE 1
103 | #define SCI_GETIMEINTERACTION 2678
104 | #define SCI_SETIMEINTERACTION 2679
105 | #define MARKER_MAX 31
106 | #define SC_MARK_CIRCLE 0
107 | #define SC_MARK_ROUNDRECT 1
108 | #define SC_MARK_ARROW 2
109 | #define SC_MARK_SMALLRECT 3
110 | #define SC_MARK_SHORTARROW 4
111 | #define SC_MARK_EMPTY 5
112 | #define SC_MARK_ARROWDOWN 6
113 | #define SC_MARK_MINUS 7
114 | #define SC_MARK_PLUS 8
115 | #define SC_MARK_VLINE 9
116 | #define SC_MARK_LCORNER 10
117 | #define SC_MARK_TCORNER 11
118 | #define SC_MARK_BOXPLUS 12
119 | #define SC_MARK_BOXPLUSCONNECTED 13
120 | #define SC_MARK_BOXMINUS 14
121 | #define SC_MARK_BOXMINUSCONNECTED 15
122 | #define SC_MARK_LCORNERCURVE 16
123 | #define SC_MARK_TCORNERCURVE 17
124 | #define SC_MARK_CIRCLEPLUS 18
125 | #define SC_MARK_CIRCLEPLUSCONNECTED 19
126 | #define SC_MARK_CIRCLEMINUS 20
127 | #define SC_MARK_CIRCLEMINUSCONNECTED 21
128 | #define SC_MARK_BACKGROUND 22
129 | #define SC_MARK_DOTDOTDOT 23
130 | #define SC_MARK_ARROWS 24
131 | #define SC_MARK_PIXMAP 25
132 | #define SC_MARK_FULLRECT 26
133 | #define SC_MARK_LEFTRECT 27
134 | #define SC_MARK_AVAILABLE 28
135 | #define SC_MARK_UNDERLINE 29
136 | #define SC_MARK_RGBAIMAGE 30
137 | #define SC_MARK_BOOKMARK 31
138 | #define SC_MARK_VERTICALBOOKMARK 32
139 | #define SC_MARK_CHARACTER 10000
140 | #define SC_MARKNUM_FOLDEREND 25
141 | #define SC_MARKNUM_FOLDEROPENMID 26
142 | #define SC_MARKNUM_FOLDERMIDTAIL 27
143 | #define SC_MARKNUM_FOLDERTAIL 28
144 | #define SC_MARKNUM_FOLDERSUB 29
145 | #define SC_MARKNUM_FOLDER 30
146 | #define SC_MARKNUM_FOLDEROPEN 31
147 | #define SC_MASK_FOLDERS 0xFE000000
148 | #define SCI_MARKERDEFINE 2040
149 | #define SCI_MARKERSETFORE 2041
150 | #define SCI_MARKERSETBACK 2042
151 | #define SCI_MARKERSETBACKSELECTED 2292
152 | #define SCI_MARKERENABLEHIGHLIGHT 2293
153 | #define SCI_MARKERADD 2043
154 | #define SCI_MARKERDELETE 2044
155 | #define SCI_MARKERDELETEALL 2045
156 | #define SCI_MARKERGET 2046
157 | #define SCI_MARKERNEXT 2047
158 | #define SCI_MARKERPREVIOUS 2048
159 | #define SCI_MARKERDEFINEPIXMAP 2049
160 | #define SCI_MARKERADDSET 2466
161 | #define SCI_MARKERSETALPHA 2476
162 | #define SC_MAX_MARGIN 4
163 | #define SC_MARGIN_SYMBOL 0
164 | #define SC_MARGIN_NUMBER 1
165 | #define SC_MARGIN_BACK 2
166 | #define SC_MARGIN_FORE 3
167 | #define SC_MARGIN_TEXT 4
168 | #define SC_MARGIN_RTEXT 5
169 | #define SC_MARGIN_COLOUR 6
170 | #define SCI_SETMARGINTYPEN 2240
171 | #define SCI_GETMARGINTYPEN 2241
172 | #define SCI_SETMARGINWIDTHN 2242
173 | #define SCI_GETMARGINWIDTHN 2243
174 | #define SCI_SETMARGINMASKN 2244
175 | #define SCI_GETMARGINMASKN 2245
176 | #define SCI_SETMARGINSENSITIVEN 2246
177 | #define SCI_GETMARGINSENSITIVEN 2247
178 | #define SCI_SETMARGINCURSORN 2248
179 | #define SCI_GETMARGINCURSORN 2249
180 | #define SCI_SETMARGINBACKN 2250
181 | #define SCI_GETMARGINBACKN 2251
182 | #define SCI_SETMARGINS 2252
183 | #define SCI_GETMARGINS 2253
184 | #define STYLE_DEFAULT 32
185 | #define STYLE_LINENUMBER 33
186 | #define STYLE_BRACELIGHT 34
187 | #define STYLE_BRACEBAD 35
188 | #define STYLE_CONTROLCHAR 36
189 | #define STYLE_INDENTGUIDE 37
190 | #define STYLE_CALLTIP 38
191 | #define STYLE_FOLDDISPLAYTEXT 39
192 | #define STYLE_LASTPREDEFINED 39
193 | #define STYLE_MAX 255
194 | #define SC_CHARSET_ANSI 0
195 | #define SC_CHARSET_DEFAULT 1
196 | #define SC_CHARSET_BALTIC 186
197 | #define SC_CHARSET_CHINESEBIG5 136
198 | #define SC_CHARSET_EASTEUROPE 238
199 | #define SC_CHARSET_GB2312 134
200 | #define SC_CHARSET_GREEK 161
201 | #define SC_CHARSET_HANGUL 129
202 | #define SC_CHARSET_MAC 77
203 | #define SC_CHARSET_OEM 255
204 | #define SC_CHARSET_RUSSIAN 204
205 | #define SC_CHARSET_OEM866 866
206 | #define SC_CHARSET_CYRILLIC 1251
207 | #define SC_CHARSET_SHIFTJIS 128
208 | #define SC_CHARSET_SYMBOL 2
209 | #define SC_CHARSET_TURKISH 162
210 | #define SC_CHARSET_JOHAB 130
211 | #define SC_CHARSET_HEBREW 177
212 | #define SC_CHARSET_ARABIC 178
213 | #define SC_CHARSET_VIETNAMESE 163
214 | #define SC_CHARSET_THAI 222
215 | #define SC_CHARSET_8859_15 1000
216 | #define SCI_STYLECLEARALL 2050
217 | #define SCI_STYLESETFORE 2051
218 | #define SCI_STYLESETBACK 2052
219 | #define SCI_STYLESETBOLD 2053
220 | #define SCI_STYLESETITALIC 2054
221 | #define SCI_STYLESETSIZE 2055
222 | #define SCI_STYLESETFONT 2056
223 | #define SCI_STYLESETEOLFILLED 2057
224 | #define SCI_STYLERESETDEFAULT 2058
225 | #define SCI_STYLESETUNDERLINE 2059
226 | #define SC_CASE_MIXED 0
227 | #define SC_CASE_UPPER 1
228 | #define SC_CASE_LOWER 2
229 | #define SC_CASE_CAMEL 3
230 | #define SCI_STYLEGETFORE 2481
231 | #define SCI_STYLEGETBACK 2482
232 | #define SCI_STYLEGETBOLD 2483
233 | #define SCI_STYLEGETITALIC 2484
234 | #define SCI_STYLEGETSIZE 2485
235 | #define SCI_STYLEGETFONT 2486
236 | #define SCI_STYLEGETEOLFILLED 2487
237 | #define SCI_STYLEGETUNDERLINE 2488
238 | #define SCI_STYLEGETCASE 2489
239 | #define SCI_STYLEGETCHARACTERSET 2490
240 | #define SCI_STYLEGETVISIBLE 2491
241 | #define SCI_STYLEGETCHANGEABLE 2492
242 | #define SCI_STYLEGETHOTSPOT 2493
243 | #define SCI_STYLESETCASE 2060
244 | #define SC_FONT_SIZE_MULTIPLIER 100
245 | #define SCI_STYLESETSIZEFRACTIONAL 2061
246 | #define SCI_STYLEGETSIZEFRACTIONAL 2062
247 | #define SC_WEIGHT_NORMAL 400
248 | #define SC_WEIGHT_SEMIBOLD 600
249 | #define SC_WEIGHT_BOLD 700
250 | #define SCI_STYLESETWEIGHT 2063
251 | #define SCI_STYLEGETWEIGHT 2064
252 | #define SCI_STYLESETCHARACTERSET 2066
253 | #define SCI_STYLESETHOTSPOT 2409
254 | #define SCI_SETSELFORE 2067
255 | #define SCI_SETSELBACK 2068
256 | #define SCI_GETSELALPHA 2477
257 | #define SCI_SETSELALPHA 2478
258 | #define SCI_GETSELEOLFILLED 2479
259 | #define SCI_SETSELEOLFILLED 2480
260 | #define SCI_SETCARETFORE 2069
261 | #define SCI_ASSIGNCMDKEY 2070
262 | #define SCI_CLEARCMDKEY 2071
263 | #define SCI_CLEARALLCMDKEYS 2072
264 | #define SCI_SETSTYLINGEX 2073
265 | #define SCI_STYLESETVISIBLE 2074
266 | #define SCI_GETCARETPERIOD 2075
267 | #define SCI_SETCARETPERIOD 2076
268 | #define SCI_SETWORDCHARS 2077
269 | #define SCI_GETWORDCHARS 2646
270 | #define SCI_SETCHARACTERCATEGORYOPTIMIZATION 2720
271 | #define SCI_GETCHARACTERCATEGORYOPTIMIZATION 2721
272 | #define SCI_BEGINUNDOACTION 2078
273 | #define SCI_ENDUNDOACTION 2079
274 | #define INDIC_PLAIN 0
275 | #define INDIC_SQUIGGLE 1
276 | #define INDIC_TT 2
277 | #define INDIC_DIAGONAL 3
278 | #define INDIC_STRIKE 4
279 | #define INDIC_HIDDEN 5
280 | #define INDIC_BOX 6
281 | #define INDIC_ROUNDBOX 7
282 | #define INDIC_STRAIGHTBOX 8
283 | #define INDIC_DASH 9
284 | #define INDIC_DOTS 10
285 | #define INDIC_SQUIGGLELOW 11
286 | #define INDIC_DOTBOX 12
287 | #define INDIC_SQUIGGLEPIXMAP 13
288 | #define INDIC_COMPOSITIONTHICK 14
289 | #define INDIC_COMPOSITIONTHIN 15
290 | #define INDIC_FULLBOX 16
291 | #define INDIC_TEXTFORE 17
292 | #define INDIC_POINT 18
293 | #define INDIC_POINTCHARACTER 19
294 | #define INDIC_GRADIENT 20
295 | #define INDIC_GRADIENTCENTRE 21
296 | #define INDIC_CONTAINER 8
297 | #define INDIC_IME 32
298 | #define INDIC_IME_MAX 35
299 | #define INDIC_MAX 35
300 | #define INDICATOR_CONTAINER 8
301 | #define INDICATOR_IME 32
302 | #define INDICATOR_IME_MAX 35
303 | #define INDICATOR_MAX 35
304 | #define SCI_INDICSETSTYLE 2080
305 | #define SCI_INDICGETSTYLE 2081
306 | #define SCI_INDICSETFORE 2082
307 | #define SCI_INDICGETFORE 2083
308 | #define SCI_INDICSETUNDER 2510
309 | #define SCI_INDICGETUNDER 2511
310 | #define SCI_INDICSETHOVERSTYLE 2680
311 | #define SCI_INDICGETHOVERSTYLE 2681
312 | #define SCI_INDICSETHOVERFORE 2682
313 | #define SCI_INDICGETHOVERFORE 2683
314 | #define SC_INDICVALUEBIT 0x1000000
315 | #define SC_INDICVALUEMASK 0xFFFFFF
316 | #define SC_INDICFLAG_VALUEFORE 1
317 | #define SCI_INDICSETFLAGS 2684
318 | #define SCI_INDICGETFLAGS 2685
319 | #define SCI_SETWHITESPACEFORE 2084
320 | #define SCI_SETWHITESPACEBACK 2085
321 | #define SCI_SETWHITESPACESIZE 2086
322 | #define SCI_GETWHITESPACESIZE 2087
323 | #define SCI_SETLINESTATE 2092
324 | #define SCI_GETLINESTATE 2093
325 | #define SCI_GETMAXLINESTATE 2094
326 | #define SCI_GETCARETLINEVISIBLE 2095
327 | #define SCI_SETCARETLINEVISIBLE 2096
328 | #define SCI_GETCARETLINEBACK 2097
329 | #define SCI_SETCARETLINEBACK 2098
330 | #define SCI_GETCARETLINEFRAME 2704
331 | #define SCI_SETCARETLINEFRAME 2705
332 | #define SCI_STYLESETCHANGEABLE 2099
333 | #define SCI_AUTOCSHOW 2100
334 | #define SCI_AUTOCCANCEL 2101
335 | #define SCI_AUTOCACTIVE 2102
336 | #define SCI_AUTOCPOSSTART 2103
337 | #define SCI_AUTOCCOMPLETE 2104
338 | #define SCI_AUTOCSTOPS 2105
339 | #define SCI_AUTOCSETSEPARATOR 2106
340 | #define SCI_AUTOCGETSEPARATOR 2107
341 | #define SCI_AUTOCSELECT 2108
342 | #define SCI_AUTOCSETCANCELATSTART 2110
343 | #define SCI_AUTOCGETCANCELATSTART 2111
344 | #define SCI_AUTOCSETFILLUPS 2112
345 | #define SCI_AUTOCSETCHOOSESINGLE 2113
346 | #define SCI_AUTOCGETCHOOSESINGLE 2114
347 | #define SCI_AUTOCSETIGNORECASE 2115
348 | #define SCI_AUTOCGETIGNORECASE 2116
349 | #define SCI_USERLISTSHOW 2117
350 | #define SCI_AUTOCSETAUTOHIDE 2118
351 | #define SCI_AUTOCGETAUTOHIDE 2119
352 | #define SCI_AUTOCSETDROPRESTOFWORD 2270
353 | #define SCI_AUTOCGETDROPRESTOFWORD 2271
354 | #define SCI_REGISTERIMAGE 2405
355 | #define SCI_CLEARREGISTEREDIMAGES 2408
356 | #define SCI_AUTOCGETTYPESEPARATOR 2285
357 | #define SCI_AUTOCSETTYPESEPARATOR 2286
358 | #define SCI_AUTOCSETMAXWIDTH 2208
359 | #define SCI_AUTOCGETMAXWIDTH 2209
360 | #define SCI_AUTOCSETMAXHEIGHT 2210
361 | #define SCI_AUTOCGETMAXHEIGHT 2211
362 | #define SCI_SETINDENT 2122
363 | #define SCI_GETINDENT 2123
364 | #define SCI_SETUSETABS 2124
365 | #define SCI_GETUSETABS 2125
366 | #define SCI_SETLINEINDENTATION 2126
367 | #define SCI_GETLINEINDENTATION 2127
368 | #define SCI_GETLINEINDENTPOSITION 2128
369 | #define SCI_GETCOLUMN 2129
370 | #define SCI_COUNTCHARACTERS 2633
371 | #define SCI_COUNTCODEUNITS 2715
372 | #define SCI_SETHSCROLLBAR 2130
373 | #define SCI_GETHSCROLLBAR 2131
374 | #define SC_IV_NONE 0
375 | #define SC_IV_REAL 1
376 | #define SC_IV_LOOKFORWARD 2
377 | #define SC_IV_LOOKBOTH 3
378 | #define SCI_SETINDENTATIONGUIDES 2132
379 | #define SCI_GETINDENTATIONGUIDES 2133
380 | #define SCI_SETHIGHLIGHTGUIDE 2134
381 | #define SCI_GETHIGHLIGHTGUIDE 2135
382 | #define SCI_GETLINEENDPOSITION 2136
383 | #define SCI_GETCODEPAGE 2137
384 | #define SCI_GETCARETFORE 2138
385 | #define SCI_GETREADONLY 2140
386 | #define SCI_SETCURRENTPOS 2141
387 | #define SCI_SETSELECTIONSTART 2142
388 | #define SCI_GETSELECTIONSTART 2143
389 | #define SCI_SETSELECTIONEND 2144
390 | #define SCI_GETSELECTIONEND 2145
391 | #define SCI_SETEMPTYSELECTION 2556
392 | #define SCI_SETPRINTMAGNIFICATION 2146
393 | #define SCI_GETPRINTMAGNIFICATION 2147
394 | #define SC_PRINT_NORMAL 0
395 | #define SC_PRINT_INVERTLIGHT 1
396 | #define SC_PRINT_BLACKONWHITE 2
397 | #define SC_PRINT_COLOURONWHITE 3
398 | #define SC_PRINT_COLOURONWHITEDEFAULTBG 4
399 | #define SC_PRINT_SCREENCOLOURS 5
400 | #define SCI_SETPRINTCOLOURMODE 2148
401 | #define SCI_GETPRINTCOLOURMODE 2149
402 | #define SCFIND_NONE 0x0
403 | #define SCFIND_WHOLEWORD 0x2
404 | #define SCFIND_MATCHCASE 0x4
405 | #define SCFIND_WORDSTART 0x00100000
406 | #define SCFIND_REGEXP 0x00200000
407 | #define SCFIND_POSIX 0x00400000
408 | #define SCFIND_CXX11REGEX 0x00800000
409 | #define SCI_FINDTEXT 2150
410 | #define SCI_FORMATRANGE 2151
411 | #define SCI_GETFIRSTVISIBLELINE 2152
412 | #define SCI_GETLINE 2153
413 | #define SCI_GETLINECOUNT 2154
414 | #define SCI_SETMARGINLEFT 2155
415 | #define SCI_GETMARGINLEFT 2156
416 | #define SCI_SETMARGINRIGHT 2157
417 | #define SCI_GETMARGINRIGHT 2158
418 | #define SCI_GETMODIFY 2159
419 | #define SCI_SETSEL 2160
420 | #define SCI_GETSELTEXT 2161
421 | #define SCI_GETTEXTRANGE 2162
422 | #define SCI_HIDESELECTION 2163
423 | #define SCI_POINTXFROMPOSITION 2164
424 | #define SCI_POINTYFROMPOSITION 2165
425 | #define SCI_LINEFROMPOSITION 2166
426 | #define SCI_POSITIONFROMLINE 2167
427 | #define SCI_LINESCROLL 2168
428 | #define SCI_SCROLLCARET 2169
429 | #define SCI_SCROLLRANGE 2569
430 | #define SCI_REPLACESEL 2170
431 | #define SCI_SETREADONLY 2171
432 | #define SCI_NULL 2172
433 | #define SCI_CANPASTE 2173
434 | #define SCI_CANUNDO 2174
435 | #define SCI_EMPTYUNDOBUFFER 2175
436 | #define SCI_UNDO 2176
437 | #define SCI_CUT 2177
438 | #define SCI_COPY 2178
439 | #define SCI_PASTE 2179
440 | #define SCI_CLEAR 2180
441 | #define SCI_SETTEXT 2181
442 | #define SCI_GETTEXT 2182
443 | #define SCI_GETTEXTLENGTH 2183
444 | #define SCI_GETDIRECTFUNCTION 2184
445 | #define SCI_GETDIRECTPOINTER 2185
446 | #define SCI_SETOVERTYPE 2186
447 | #define SCI_GETOVERTYPE 2187
448 | #define SCI_SETCARETWIDTH 2188
449 | #define SCI_GETCARETWIDTH 2189
450 | #define SCI_SETTARGETSTART 2190
451 | #define SCI_GETTARGETSTART 2191
452 | #define SCI_SETTARGETEND 2192
453 | #define SCI_GETTARGETEND 2193
454 | #define SCI_SETTARGETRANGE 2686
455 | #define SCI_GETTARGETTEXT 2687
456 | #define SCI_TARGETFROMSELECTION 2287
457 | #define SCI_TARGETWHOLEDOCUMENT 2690
458 | #define SCI_REPLACETARGET 2194
459 | #define SCI_REPLACETARGETRE 2195
460 | #define SCI_SEARCHINTARGET 2197
461 | #define SCI_SETSEARCHFLAGS 2198
462 | #define SCI_GETSEARCHFLAGS 2199
463 | #define SCI_CALLTIPSHOW 2200
464 | #define SCI_CALLTIPCANCEL 2201
465 | #define SCI_CALLTIPACTIVE 2202
466 | #define SCI_CALLTIPPOSSTART 2203
467 | #define SCI_CALLTIPSETPOSSTART 2214
468 | #define SCI_CALLTIPSETHLT 2204
469 | #define SCI_CALLTIPSETBACK 2205
470 | #define SCI_CALLTIPSETFORE 2206
471 | #define SCI_CALLTIPSETFOREHLT 2207
472 | #define SCI_CALLTIPUSESTYLE 2212
473 | #define SCI_CALLTIPSETPOSITION 2213
474 | #define SCI_VISIBLEFROMDOCLINE 2220
475 | #define SCI_DOCLINEFROMVISIBLE 2221
476 | #define SCI_WRAPCOUNT 2235
477 | #define SC_FOLDLEVELBASE 0x400
478 | #define SC_FOLDLEVELWHITEFLAG 0x1000
479 | #define SC_FOLDLEVELHEADERFLAG 0x2000
480 | #define SC_FOLDLEVELNUMBERMASK 0x0FFF
481 | #define SCI_SETFOLDLEVEL 2222
482 | #define SCI_GETFOLDLEVEL 2223
483 | #define SCI_GETLASTCHILD 2224
484 | #define SCI_GETFOLDPARENT 2225
485 | #define SCI_SHOWLINES 2226
486 | #define SCI_HIDELINES 2227
487 | #define SCI_GETLINEVISIBLE 2228
488 | #define SCI_GETALLLINESVISIBLE 2236
489 | #define SCI_SETFOLDEXPANDED 2229
490 | #define SCI_GETFOLDEXPANDED 2230
491 | #define SCI_TOGGLEFOLD 2231
492 | #define SCI_TOGGLEFOLDSHOWTEXT 2700
493 | #define SC_FOLDDISPLAYTEXT_HIDDEN 0
494 | #define SC_FOLDDISPLAYTEXT_STANDARD 1
495 | #define SC_FOLDDISPLAYTEXT_BOXED 2
496 | #define SCI_FOLDDISPLAYTEXTSETSTYLE 2701
497 | #define SCI_FOLDDISPLAYTEXTGETSTYLE 2707
498 | #define SCI_SETDEFAULTFOLDDISPLAYTEXT 2722
499 | #define SCI_GETDEFAULTFOLDDISPLAYTEXT 2723
500 | #define SC_FOLDACTION_CONTRACT 0
501 | #define SC_FOLDACTION_EXPAND 1
502 | #define SC_FOLDACTION_TOGGLE 2
503 | #define SCI_FOLDLINE 2237
504 | #define SCI_FOLDCHILDREN 2238
505 | #define SCI_EXPANDCHILDREN 2239
506 | #define SCI_FOLDALL 2662
507 | #define SCI_ENSUREVISIBLE 2232
508 | #define SC_AUTOMATICFOLD_SHOW 0x0001
509 | #define SC_AUTOMATICFOLD_CLICK 0x0002
510 | #define SC_AUTOMATICFOLD_CHANGE 0x0004
511 | #define SCI_SETAUTOMATICFOLD 2663
512 | #define SCI_GETAUTOMATICFOLD 2664
513 | #define SC_FOLDFLAG_LINEBEFORE_EXPANDED 0x0002
514 | #define SC_FOLDFLAG_LINEBEFORE_CONTRACTED 0x0004
515 | #define SC_FOLDFLAG_LINEAFTER_EXPANDED 0x0008
516 | #define SC_FOLDFLAG_LINEAFTER_CONTRACTED 0x0010
517 | #define SC_FOLDFLAG_LEVELNUMBERS 0x0040
518 | #define SC_FOLDFLAG_LINESTATE 0x0080
519 | #define SCI_SETFOLDFLAGS 2233
520 | #define SCI_ENSUREVISIBLEENFORCEPOLICY 2234
521 | #define SCI_SETTABINDENTS 2260
522 | #define SCI_GETTABINDENTS 2261
523 | #define SCI_SETBACKSPACEUNINDENTS 2262
524 | #define SCI_GETBACKSPACEUNINDENTS 2263
525 | #define SC_TIME_FOREVER 10000000
526 | #define SCI_SETMOUSEDWELLTIME 2264
527 | #define SCI_GETMOUSEDWELLTIME 2265
528 | #define SCI_WORDSTARTPOSITION 2266
529 | #define SCI_WORDENDPOSITION 2267
530 | #define SCI_ISRANGEWORD 2691
531 | #define SC_IDLESTYLING_NONE 0
532 | #define SC_IDLESTYLING_TOVISIBLE 1
533 | #define SC_IDLESTYLING_AFTERVISIBLE 2
534 | #define SC_IDLESTYLING_ALL 3
535 | #define SCI_SETIDLESTYLING 2692
536 | #define SCI_GETIDLESTYLING 2693
537 | #define SC_WRAP_NONE 0
538 | #define SC_WRAP_WORD 1
539 | #define SC_WRAP_CHAR 2
540 | #define SC_WRAP_WHITESPACE 3
541 | #define SCI_SETWRAPMODE 2268
542 | #define SCI_GETWRAPMODE 2269
543 | #define SC_WRAPVISUALFLAG_NONE 0x0000
544 | #define SC_WRAPVISUALFLAG_END 0x0001
545 | #define SC_WRAPVISUALFLAG_START 0x0002
546 | #define SC_WRAPVISUALFLAG_MARGIN 0x0004
547 | #define SCI_SETWRAPVISUALFLAGS 2460
548 | #define SCI_GETWRAPVISUALFLAGS 2461
549 | #define SC_WRAPVISUALFLAGLOC_DEFAULT 0x0000
550 | #define SC_WRAPVISUALFLAGLOC_END_BY_TEXT 0x0001
551 | #define SC_WRAPVISUALFLAGLOC_START_BY_TEXT 0x0002
552 | #define SCI_SETWRAPVISUALFLAGSLOCATION 2462
553 | #define SCI_GETWRAPVISUALFLAGSLOCATION 2463
554 | #define SCI_SETWRAPSTARTINDENT 2464
555 | #define SCI_GETWRAPSTARTINDENT 2465
556 | #define SC_WRAPINDENT_FIXED 0
557 | #define SC_WRAPINDENT_SAME 1
558 | #define SC_WRAPINDENT_INDENT 2
559 | #define SC_WRAPINDENT_DEEPINDENT 3
560 | #define SCI_SETWRAPINDENTMODE 2472
561 | #define SCI_GETWRAPINDENTMODE 2473
562 | #define SC_CACHE_NONE 0
563 | #define SC_CACHE_CARET 1
564 | #define SC_CACHE_PAGE 2
565 | #define SC_CACHE_DOCUMENT 3
566 | #define SCI_SETLAYOUTCACHE 2272
567 | #define SCI_GETLAYOUTCACHE 2273
568 | #define SCI_SETSCROLLWIDTH 2274
569 | #define SCI_GETSCROLLWIDTH 2275
570 | #define SCI_SETSCROLLWIDTHTRACKING 2516
571 | #define SCI_GETSCROLLWIDTHTRACKING 2517
572 | #define SCI_TEXTWIDTH 2276
573 | #define SCI_SETENDATLASTLINE 2277
574 | #define SCI_GETENDATLASTLINE 2278
575 | #define SCI_TEXTHEIGHT 2279
576 | #define SCI_SETVSCROLLBAR 2280
577 | #define SCI_GETVSCROLLBAR 2281
578 | #define SCI_APPENDTEXT 2282
579 | #define SC_PHASES_ONE 0
580 | #define SC_PHASES_TWO 1
581 | #define SC_PHASES_MULTIPLE 2
582 | #define SCI_GETPHASESDRAW 2673
583 | #define SCI_SETPHASESDRAW 2674
584 | #define SC_EFF_QUALITY_MASK 0xF
585 | #define SC_EFF_QUALITY_DEFAULT 0
586 | #define SC_EFF_QUALITY_NON_ANTIALIASED 1
587 | #define SC_EFF_QUALITY_ANTIALIASED 2
588 | #define SC_EFF_QUALITY_LCD_OPTIMIZED 3
589 | #define SCI_SETFONTQUALITY 2611
590 | #define SCI_GETFONTQUALITY 2612
591 | #define SCI_SETFIRSTVISIBLELINE 2613
592 | #define SC_MULTIPASTE_ONCE 0
593 | #define SC_MULTIPASTE_EACH 1
594 | #define SCI_SETMULTIPASTE 2614
595 | #define SCI_GETMULTIPASTE 2615
596 | #define SCI_GETTAG 2616
597 | #define SCI_LINESJOIN 2288
598 | #define SCI_LINESSPLIT 2289
599 | #define SCI_SETFOLDMARGINCOLOUR 2290
600 | #define SCI_SETFOLDMARGINHICOLOUR 2291
601 | #define SC_ACCESSIBILITY_DISABLED 0
602 | #define SC_ACCESSIBILITY_ENABLED 1
603 | #define SCI_SETACCESSIBILITY 2702
604 | #define SCI_GETACCESSIBILITY 2703
605 | #define SCI_LINEDOWN 2300
606 | #define SCI_LINEDOWNEXTEND 2301
607 | #define SCI_LINEUP 2302
608 | #define SCI_LINEUPEXTEND 2303
609 | #define SCI_CHARLEFT 2304
610 | #define SCI_CHARLEFTEXTEND 2305
611 | #define SCI_CHARRIGHT 2306
612 | #define SCI_CHARRIGHTEXTEND 2307
613 | #define SCI_WORDLEFT 2308
614 | #define SCI_WORDLEFTEXTEND 2309
615 | #define SCI_WORDRIGHT 2310
616 | #define SCI_WORDRIGHTEXTEND 2311
617 | #define SCI_HOME 2312
618 | #define SCI_HOMEEXTEND 2313
619 | #define SCI_LINEEND 2314
620 | #define SCI_LINEENDEXTEND 2315
621 | #define SCI_DOCUMENTSTART 2316
622 | #define SCI_DOCUMENTSTARTEXTEND 2317
623 | #define SCI_DOCUMENTEND 2318
624 | #define SCI_DOCUMENTENDEXTEND 2319
625 | #define SCI_PAGEUP 2320
626 | #define SCI_PAGEUPEXTEND 2321
627 | #define SCI_PAGEDOWN 2322
628 | #define SCI_PAGEDOWNEXTEND 2323
629 | #define SCI_EDITTOGGLEOVERTYPE 2324
630 | #define SCI_CANCEL 2325
631 | #define SCI_DELETEBACK 2326
632 | #define SCI_TAB 2327
633 | #define SCI_BACKTAB 2328
634 | #define SCI_NEWLINE 2329
635 | #define SCI_FORMFEED 2330
636 | #define SCI_VCHOME 2331
637 | #define SCI_VCHOMEEXTEND 2332
638 | #define SCI_ZOOMIN 2333
639 | #define SCI_ZOOMOUT 2334
640 | #define SCI_DELWORDLEFT 2335
641 | #define SCI_DELWORDRIGHT 2336
642 | #define SCI_DELWORDRIGHTEND 2518
643 | #define SCI_LINECUT 2337
644 | #define SCI_LINEDELETE 2338
645 | #define SCI_LINETRANSPOSE 2339
646 | #define SCI_LINEREVERSE 2354
647 | #define SCI_LINEDUPLICATE 2404
648 | #define SCI_LOWERCASE 2340
649 | #define SCI_UPPERCASE 2341
650 | #define SCI_LINESCROLLDOWN 2342
651 | #define SCI_LINESCROLLUP 2343
652 | #define SCI_DELETEBACKNOTLINE 2344
653 | #define SCI_HOMEDISPLAY 2345
654 | #define SCI_HOMEDISPLAYEXTEND 2346
655 | #define SCI_LINEENDDISPLAY 2347
656 | #define SCI_LINEENDDISPLAYEXTEND 2348
657 | #define SCI_HOMEWRAP 2349
658 | #define SCI_HOMEWRAPEXTEND 2450
659 | #define SCI_LINEENDWRAP 2451
660 | #define SCI_LINEENDWRAPEXTEND 2452
661 | #define SCI_VCHOMEWRAP 2453
662 | #define SCI_VCHOMEWRAPEXTEND 2454
663 | #define SCI_LINECOPY 2455
664 | #define SCI_MOVECARETINSIDEVIEW 2401
665 | #define SCI_LINELENGTH 2350
666 | #define SCI_BRACEHIGHLIGHT 2351
667 | #define SCI_BRACEHIGHLIGHTINDICATOR 2498
668 | #define SCI_BRACEBADLIGHT 2352
669 | #define SCI_BRACEBADLIGHTINDICATOR 2499
670 | #define SCI_BRACEMATCH 2353
671 | #define SCI_GETVIEWEOL 2355
672 | #define SCI_SETVIEWEOL 2356
673 | #define SCI_GETDOCPOINTER 2357
674 | #define SCI_SETDOCPOINTER 2358
675 | #define SCI_SETMODEVENTMASK 2359
676 | #define EDGE_NONE 0
677 | #define EDGE_LINE 1
678 | #define EDGE_BACKGROUND 2
679 | #define EDGE_MULTILINE 3
680 | #define SCI_GETEDGECOLUMN 2360
681 | #define SCI_SETEDGECOLUMN 2361
682 | #define SCI_GETEDGEMODE 2362
683 | #define SCI_SETEDGEMODE 2363
684 | #define SCI_GETEDGECOLOUR 2364
685 | #define SCI_SETEDGECOLOUR 2365
686 | #define SCI_MULTIEDGEADDLINE 2694
687 | #define SCI_MULTIEDGECLEARALL 2695
688 | #define SCI_SEARCHANCHOR 2366
689 | #define SCI_SEARCHNEXT 2367
690 | #define SCI_SEARCHPREV 2368
691 | #define SCI_LINESONSCREEN 2370
692 | #define SC_POPUP_NEVER 0
693 | #define SC_POPUP_ALL 1
694 | #define SC_POPUP_TEXT 2
695 | #define SCI_USEPOPUP 2371
696 | #define SCI_SELECTIONISRECTANGLE 2372
697 | #define SCI_SETZOOM 2373
698 | #define SCI_GETZOOM 2374
699 | #define SC_DOCUMENTOPTION_DEFAULT 0
700 | #define SC_DOCUMENTOPTION_STYLES_NONE 0x1
701 | #define SC_DOCUMENTOPTION_TEXT_LARGE 0x100
702 | #define SCI_CREATEDOCUMENT 2375
703 | #define SCI_ADDREFDOCUMENT 2376
704 | #define SCI_RELEASEDOCUMENT 2377
705 | #define SCI_GETDOCUMENTOPTIONS 2379
706 | #define SCI_GETMODEVENTMASK 2378
707 | #define SCI_SETCOMMANDEVENTS 2717
708 | #define SCI_GETCOMMANDEVENTS 2718
709 | #define SCI_SETFOCUS 2380
710 | #define SCI_GETFOCUS 2381
711 | #define SC_STATUS_OK 0
712 | #define SC_STATUS_FAILURE 1
713 | #define SC_STATUS_BADALLOC 2
714 | #define SC_STATUS_WARN_START 1000
715 | #define SC_STATUS_WARN_REGEX 1001
716 | #define SCI_SETSTATUS 2382
717 | #define SCI_GETSTATUS 2383
718 | #define SCI_SETMOUSEDOWNCAPTURES 2384
719 | #define SCI_GETMOUSEDOWNCAPTURES 2385
720 | #define SCI_SETMOUSEWHEELCAPTURES 2696
721 | #define SCI_GETMOUSEWHEELCAPTURES 2697
722 | #define SC_CURSORNORMAL -1
723 | #define SC_CURSORARROW 2
724 | #define SC_CURSORWAIT 4
725 | #define SC_CURSORREVERSEARROW 7
726 | #define SCI_SETCURSOR 2386
727 | #define SCI_GETCURSOR 2387
728 | #define SCI_SETCONTROLCHARSYMBOL 2388
729 | #define SCI_GETCONTROLCHARSYMBOL 2389
730 | #define SCI_WORDPARTLEFT 2390
731 | #define SCI_WORDPARTLEFTEXTEND 2391
732 | #define SCI_WORDPARTRIGHT 2392
733 | #define SCI_WORDPARTRIGHTEXTEND 2393
734 | #define VISIBLE_SLOP 0x01
735 | #define VISIBLE_STRICT 0x04
736 | #define SCI_SETVISIBLEPOLICY 2394
737 | #define SCI_DELLINELEFT 2395
738 | #define SCI_DELLINERIGHT 2396
739 | #define SCI_SETXOFFSET 2397
740 | #define SCI_GETXOFFSET 2398
741 | #define SCI_CHOOSECARETX 2399
742 | #define SCI_GRABFOCUS 2400
743 | #define CARET_SLOP 0x01
744 | #define CARET_STRICT 0x04
745 | #define CARET_JUMPS 0x10
746 | #define CARET_EVEN 0x08
747 | #define SCI_SETXCARETPOLICY 2402
748 | #define SCI_SETYCARETPOLICY 2403
749 | #define SCI_SETPRINTWRAPMODE 2406
750 | #define SCI_GETPRINTWRAPMODE 2407
751 | #define SCI_SETHOTSPOTACTIVEFORE 2410
752 | #define SCI_GETHOTSPOTACTIVEFORE 2494
753 | #define SCI_SETHOTSPOTACTIVEBACK 2411
754 | #define SCI_GETHOTSPOTACTIVEBACK 2495
755 | #define SCI_SETHOTSPOTACTIVEUNDERLINE 2412
756 | #define SCI_GETHOTSPOTACTIVEUNDERLINE 2496
757 | #define SCI_SETHOTSPOTSINGLELINE 2421
758 | #define SCI_GETHOTSPOTSINGLELINE 2497
759 | #define SCI_PARADOWN 2413
760 | #define SCI_PARADOWNEXTEND 2414
761 | #define SCI_PARAUP 2415
762 | #define SCI_PARAUPEXTEND 2416
763 | #define SCI_POSITIONBEFORE 2417
764 | #define SCI_POSITIONAFTER 2418
765 | #define SCI_POSITIONRELATIVE 2670
766 | #define SCI_POSITIONRELATIVECODEUNITS 2716
767 | #define SCI_COPYRANGE 2419
768 | #define SCI_COPYTEXT 2420
769 | #define SC_SEL_STREAM 0
770 | #define SC_SEL_RECTANGLE 1
771 | #define SC_SEL_LINES 2
772 | #define SC_SEL_THIN 3
773 | #define SCI_SETSELECTIONMODE 2422
774 | #define SCI_GETSELECTIONMODE 2423
775 | #define SCI_GETMOVEEXTENDSSELECTION 2706
776 | #define SCI_GETLINESELSTARTPOSITION 2424
777 | #define SCI_GETLINESELENDPOSITION 2425
778 | #define SCI_LINEDOWNRECTEXTEND 2426
779 | #define SCI_LINEUPRECTEXTEND 2427
780 | #define SCI_CHARLEFTRECTEXTEND 2428
781 | #define SCI_CHARRIGHTRECTEXTEND 2429
782 | #define SCI_HOMERECTEXTEND 2430
783 | #define SCI_VCHOMERECTEXTEND 2431
784 | #define SCI_LINEENDRECTEXTEND 2432
785 | #define SCI_PAGEUPRECTEXTEND 2433
786 | #define SCI_PAGEDOWNRECTEXTEND 2434
787 | #define SCI_STUTTEREDPAGEUP 2435
788 | #define SCI_STUTTEREDPAGEUPEXTEND 2436
789 | #define SCI_STUTTEREDPAGEDOWN 2437
790 | #define SCI_STUTTEREDPAGEDOWNEXTEND 2438
791 | #define SCI_WORDLEFTEND 2439
792 | #define SCI_WORDLEFTENDEXTEND 2440
793 | #define SCI_WORDRIGHTEND 2441
794 | #define SCI_WORDRIGHTENDEXTEND 2442
795 | #define SCI_SETWHITESPACECHARS 2443
796 | #define SCI_GETWHITESPACECHARS 2647
797 | #define SCI_SETPUNCTUATIONCHARS 2648
798 | #define SCI_GETPUNCTUATIONCHARS 2649
799 | #define SCI_SETCHARSDEFAULT 2444
800 | #define SCI_AUTOCGETCURRENT 2445
801 | #define SCI_AUTOCGETCURRENTTEXT 2610
802 | #define SC_CASEINSENSITIVEBEHAVIOUR_RESPECTCASE 0
803 | #define SC_CASEINSENSITIVEBEHAVIOUR_IGNORECASE 1
804 | #define SCI_AUTOCSETCASEINSENSITIVEBEHAVIOUR 2634
805 | #define SCI_AUTOCGETCASEINSENSITIVEBEHAVIOUR 2635
806 | #define SC_MULTIAUTOC_ONCE 0
807 | #define SC_MULTIAUTOC_EACH 1
808 | #define SCI_AUTOCSETMULTI 2636
809 | #define SCI_AUTOCGETMULTI 2637
810 | #define SC_ORDER_PRESORTED 0
811 | #define SC_ORDER_PERFORMSORT 1
812 | #define SC_ORDER_CUSTOM 2
813 | #define SCI_AUTOCSETORDER 2660
814 | #define SCI_AUTOCGETORDER 2661
815 | #define SCI_ALLOCATE 2446
816 | #define SCI_TARGETASUTF8 2447
817 | #define SCI_SETLENGTHFORENCODE 2448
818 | #define SCI_ENCODEDFROMUTF8 2449
819 | #define SCI_FINDCOLUMN 2456
820 | #define SCI_GETCARETSTICKY 2457
821 | #define SCI_SETCARETSTICKY 2458
822 | #define SC_CARETSTICKY_OFF 0
823 | #define SC_CARETSTICKY_ON 1
824 | #define SC_CARETSTICKY_WHITESPACE 2
825 | #define SCI_TOGGLECARETSTICKY 2459
826 | #define SCI_SETPASTECONVERTENDINGS 2467
827 | #define SCI_GETPASTECONVERTENDINGS 2468
828 | #define SCI_SELECTIONDUPLICATE 2469
829 | #define SC_ALPHA_TRANSPARENT 0
830 | #define SC_ALPHA_OPAQUE 255
831 | #define SC_ALPHA_NOALPHA 256
832 | #define SCI_SETCARETLINEBACKALPHA 2470
833 | #define SCI_GETCARETLINEBACKALPHA 2471
834 | #define CARETSTYLE_INVISIBLE 0
835 | #define CARETSTYLE_LINE 1
836 | #define CARETSTYLE_BLOCK 2
837 | #define CARETSTYLE_OVERSTRIKE_BAR 0
838 | #define CARETSTYLE_OVERSTRIKE_BLOCK 0x10
839 | #define CARETSTYLE_INS_MASK 0xF
840 | #define CARETSTYLE_BLOCK_AFTER 0x100
841 | #define SCI_SETCARETSTYLE 2512
842 | #define SCI_GETCARETSTYLE 2513
843 | #define SCI_SETINDICATORCURRENT 2500
844 | #define SCI_GETINDICATORCURRENT 2501
845 | #define SCI_SETINDICATORVALUE 2502
846 | #define SCI_GETINDICATORVALUE 2503
847 | #define SCI_INDICATORFILLRANGE 2504
848 | #define SCI_INDICATORCLEARRANGE 2505
849 | #define SCI_INDICATORALLONFOR 2506
850 | #define SCI_INDICATORVALUEAT 2507
851 | #define SCI_INDICATORSTART 2508
852 | #define SCI_INDICATOREND 2509
853 | #define SCI_SETPOSITIONCACHE 2514
854 | #define SCI_GETPOSITIONCACHE 2515
855 | #define SCI_COPYALLOWLINE 2519
856 | #define SCI_GETCHARACTERPOINTER 2520
857 | #define SCI_GETRANGEPOINTER 2643
858 | #define SCI_GETGAPPOSITION 2644
859 | #define SCI_INDICSETALPHA 2523
860 | #define SCI_INDICGETALPHA 2524
861 | #define SCI_INDICSETOUTLINEALPHA 2558
862 | #define SCI_INDICGETOUTLINEALPHA 2559
863 | #define SCI_SETEXTRAASCENT 2525
864 | #define SCI_GETEXTRAASCENT 2526
865 | #define SCI_SETEXTRADESCENT 2527
866 | #define SCI_GETEXTRADESCENT 2528
867 | #define SCI_MARKERSYMBOLDEFINED 2529
868 | #define SCI_MARGINSETTEXT 2530
869 | #define SCI_MARGINGETTEXT 2531
870 | #define SCI_MARGINSETSTYLE 2532
871 | #define SCI_MARGINGETSTYLE 2533
872 | #define SCI_MARGINSETSTYLES 2534
873 | #define SCI_MARGINGETSTYLES 2535
874 | #define SCI_MARGINTEXTCLEARALL 2536
875 | #define SCI_MARGINSETSTYLEOFFSET 2537
876 | #define SCI_MARGINGETSTYLEOFFSET 2538
877 | #define SC_MARGINOPTION_NONE 0
878 | #define SC_MARGINOPTION_SUBLINESELECT 1
879 | #define SCI_SETMARGINOPTIONS 2539
880 | #define SCI_GETMARGINOPTIONS 2557
881 | #define SCI_ANNOTATIONSETTEXT 2540
882 | #define SCI_ANNOTATIONGETTEXT 2541
883 | #define SCI_ANNOTATIONSETSTYLE 2542
884 | #define SCI_ANNOTATIONGETSTYLE 2543
885 | #define SCI_ANNOTATIONSETSTYLES 2544
886 | #define SCI_ANNOTATIONGETSTYLES 2545
887 | #define SCI_ANNOTATIONGETLINES 2546
888 | #define SCI_ANNOTATIONCLEARALL 2547
889 | #define ANNOTATION_HIDDEN 0
890 | #define ANNOTATION_STANDARD 1
891 | #define ANNOTATION_BOXED 2
892 | #define ANNOTATION_INDENTED 3
893 | #define SCI_ANNOTATIONSETVISIBLE 2548
894 | #define SCI_ANNOTATIONGETVISIBLE 2549
895 | #define SCI_ANNOTATIONSETSTYLEOFFSET 2550
896 | #define SCI_ANNOTATIONGETSTYLEOFFSET 2551
897 | #define SCI_RELEASEALLEXTENDEDSTYLES 2552
898 | #define SCI_ALLOCATEEXTENDEDSTYLES 2553
899 | #define UNDO_NONE 0
900 | #define UNDO_MAY_COALESCE 1
901 | #define SCI_ADDUNDOACTION 2560
902 | #define SCI_CHARPOSITIONFROMPOINT 2561
903 | #define SCI_CHARPOSITIONFROMPOINTCLOSE 2562
904 | #define SCI_SETMOUSESELECTIONRECTANGULARSWITCH 2668
905 | #define SCI_GETMOUSESELECTIONRECTANGULARSWITCH 2669
906 | #define SCI_SETMULTIPLESELECTION 2563
907 | #define SCI_GETMULTIPLESELECTION 2564
908 | #define SCI_SETADDITIONALSELECTIONTYPING 2565
909 | #define SCI_GETADDITIONALSELECTIONTYPING 2566
910 | #define SCI_SETADDITIONALCARETSBLINK 2567
911 | #define SCI_GETADDITIONALCARETSBLINK 2568
912 | #define SCI_SETADDITIONALCARETSVISIBLE 2608
913 | #define SCI_GETADDITIONALCARETSVISIBLE 2609
914 | #define SCI_GETSELECTIONS 2570
915 | #define SCI_GETSELECTIONEMPTY 2650
916 | #define SCI_CLEARSELECTIONS 2571
917 | #define SCI_SETSELECTION 2572
918 | #define SCI_ADDSELECTION 2573
919 | #define SCI_DROPSELECTIONN 2671
920 | #define SCI_SETMAINSELECTION 2574
921 | #define SCI_GETMAINSELECTION 2575
922 | #define SCI_SETSELECTIONNCARET 2576
923 | #define SCI_GETSELECTIONNCARET 2577
924 | #define SCI_SETSELECTIONNANCHOR 2578
925 | #define SCI_GETSELECTIONNANCHOR 2579
926 | #define SCI_SETSELECTIONNCARETVIRTUALSPACE 2580
927 | #define SCI_GETSELECTIONNCARETVIRTUALSPACE 2581
928 | #define SCI_SETSELECTIONNANCHORVIRTUALSPACE 2582
929 | #define SCI_GETSELECTIONNANCHORVIRTUALSPACE 2583
930 | #define SCI_SETSELECTIONNSTART 2584
931 | #define SCI_GETSELECTIONNSTART 2585
932 | #define SCI_SETSELECTIONNEND 2586
933 | #define SCI_GETSELECTIONNEND 2587
934 | #define SCI_SETRECTANGULARSELECTIONCARET 2588
935 | #define SCI_GETRECTANGULARSELECTIONCARET 2589
936 | #define SCI_SETRECTANGULARSELECTIONANCHOR 2590
937 | #define SCI_GETRECTANGULARSELECTIONANCHOR 2591
938 | #define SCI_SETRECTANGULARSELECTIONCARETVIRTUALSPACE 2592
939 | #define SCI_GETRECTANGULARSELECTIONCARETVIRTUALSPACE 2593
940 | #define SCI_SETRECTANGULARSELECTIONANCHORVIRTUALSPACE 2594
941 | #define SCI_GETRECTANGULARSELECTIONANCHORVIRTUALSPACE 2595
942 | #define SCVS_NONE 0
943 | #define SCVS_RECTANGULARSELECTION 1
944 | #define SCVS_USERACCESSIBLE 2
945 | #define SCVS_NOWRAPLINESTART 4
946 | #define SCI_SETVIRTUALSPACEOPTIONS 2596
947 | #define SCI_GETVIRTUALSPACEOPTIONS 2597
948 | #define SCI_SETRECTANGULARSELECTIONMODIFIER 2598
949 | #define SCI_GETRECTANGULARSELECTIONMODIFIER 2599
950 | #define SCI_SETADDITIONALSELFORE 2600
951 | #define SCI_SETADDITIONALSELBACK 2601
952 | #define SCI_SETADDITIONALSELALPHA 2602
953 | #define SCI_GETADDITIONALSELALPHA 2603
954 | #define SCI_SETADDITIONALCARETFORE 2604
955 | #define SCI_GETADDITIONALCARETFORE 2605
956 | #define SCI_ROTATESELECTION 2606
957 | #define SCI_SWAPMAINANCHORCARET 2607
958 | #define SCI_MULTIPLESELECTADDNEXT 2688
959 | #define SCI_MULTIPLESELECTADDEACH 2689
960 | #define SCI_CHANGELEXERSTATE 2617
961 | #define SCI_CONTRACTEDFOLDNEXT 2618
962 | #define SCI_VERTICALCENTRECARET 2619
963 | #define SCI_MOVESELECTEDLINESUP 2620
964 | #define SCI_MOVESELECTEDLINESDOWN 2621
965 | #define SCI_SETIDENTIFIER 2622
966 | #define SCI_GETIDENTIFIER 2623
967 | #define SCI_RGBAIMAGESETWIDTH 2624
968 | #define SCI_RGBAIMAGESETHEIGHT 2625
969 | #define SCI_RGBAIMAGESETSCALE 2651
970 | #define SCI_MARKERDEFINERGBAIMAGE 2626
971 | #define SCI_REGISTERRGBAIMAGE 2627
972 | #define SCI_SCROLLTOSTART 2628
973 | #define SCI_SCROLLTOEND 2629
974 | #define SC_TECHNOLOGY_DEFAULT 0
975 | #define SC_TECHNOLOGY_DIRECTWRITE 1
976 | #define SC_TECHNOLOGY_DIRECTWRITERETAIN 2
977 | #define SC_TECHNOLOGY_DIRECTWRITEDC 3
978 | #define SCI_SETTECHNOLOGY 2630
979 | #define SCI_GETTECHNOLOGY 2631
980 | #define SCI_CREATELOADER 2632
981 | #define SCI_FINDINDICATORSHOW 2640
982 | #define SCI_FINDINDICATORFLASH 2641
983 | #define SCI_FINDINDICATORHIDE 2642
984 | #define SCI_VCHOMEDISPLAY 2652
985 | #define SCI_VCHOMEDISPLAYEXTEND 2653
986 | #define SCI_GETCARETLINEVISIBLEALWAYS 2654
987 | #define SCI_SETCARETLINEVISIBLEALWAYS 2655
988 | #define SC_LINE_END_TYPE_DEFAULT 0
989 | #define SC_LINE_END_TYPE_UNICODE 1
990 | #define SCI_SETLINEENDTYPESALLOWED 2656
991 | #define SCI_GETLINEENDTYPESALLOWED 2657
992 | #define SCI_GETLINEENDTYPESACTIVE 2658
993 | #define SCI_SETREPRESENTATION 2665
994 | #define SCI_GETREPRESENTATION 2666
995 | #define SCI_CLEARREPRESENTATION 2667
996 | #define SCI_STARTRECORD 3001
997 | #define SCI_STOPRECORD 3002
998 | #define SCI_SETLEXER 4001
999 | #define SCI_GETLEXER 4002
1000 | #define SCI_COLOURISE 4003
1001 | #define SCI_SETPROPERTY 4004
1002 | // #define KEYWORDSET_MAX 8
1003 | #define KEYWORDSET_MAX 30
1004 | #define SCI_SETKEYWORDS 4005
1005 | #define SCI_SETLEXERLANGUAGE 4006
1006 | #define SCI_LOADLEXERLIBRARY 4007
1007 | #define SCI_GETPROPERTY 4008
1008 | #define SCI_GETPROPERTYEXPANDED 4009
1009 | #define SCI_GETPROPERTYINT 4010
1010 | #define SCI_GETLEXERLANGUAGE 4012
1011 | #define SCI_PRIVATELEXERCALL 4013
1012 | #define SCI_PROPERTYNAMES 4014
1013 | #define SC_TYPE_BOOLEAN 0
1014 | #define SC_TYPE_INTEGER 1
1015 | #define SC_TYPE_STRING 2
1016 | #define SCI_PROPERTYTYPE 4015
1017 | #define SCI_DESCRIBEPROPERTY 4016
1018 | #define SCI_DESCRIBEKEYWORDSETS 4017
1019 | #define SCI_GETLINEENDTYPESSUPPORTED 4018
1020 | #define SCI_ALLOCATESUBSTYLES 4020
1021 | #define SCI_GETSUBSTYLESSTART 4021
1022 | #define SCI_GETSUBSTYLESLENGTH 4022
1023 | #define SCI_GETSTYLEFROMSUBSTYLE 4027
1024 | #define SCI_GETPRIMARYSTYLEFROMSTYLE 4028
1025 | #define SCI_FREESUBSTYLES 4023
1026 | #define SCI_SETIDENTIFIERS 4024
1027 | #define SCI_DISTANCETOSECONDARYSTYLES 4025
1028 | #define SCI_GETSUBSTYLEBASES 4026
1029 | #define SCI_GETNAMEDSTYLES 4029
1030 | #define SCI_NAMEOFSTYLE 4030
1031 | #define SCI_TAGSOFSTYLE 4031
1032 | #define SCI_DESCRIPTIONOFSTYLE 4032
1033 | #define SC_MOD_NONE 0x0
1034 | #define SC_MOD_INSERTTEXT 0x1
1035 | #define SC_MOD_DELETETEXT 0x2
1036 | #define SC_MOD_CHANGESTYLE 0x4
1037 | #define SC_MOD_CHANGEFOLD 0x8
1038 | #define SC_PERFORMED_USER 0x10
1039 | #define SC_PERFORMED_UNDO 0x20
1040 | #define SC_PERFORMED_REDO 0x40
1041 | #define SC_MULTISTEPUNDOREDO 0x80
1042 | #define SC_LASTSTEPINUNDOREDO 0x100
1043 | #define SC_MOD_CHANGEMARKER 0x200
1044 | #define SC_MOD_BEFOREINSERT 0x400
1045 | #define SC_MOD_BEFOREDELETE 0x800
1046 | #define SC_MULTILINEUNDOREDO 0x1000
1047 | #define SC_STARTACTION 0x2000
1048 | #define SC_MOD_CHANGEINDICATOR 0x4000
1049 | #define SC_MOD_CHANGELINESTATE 0x8000
1050 | #define SC_MOD_CHANGEMARGIN 0x10000
1051 | #define SC_MOD_CHANGEANNOTATION 0x20000
1052 | #define SC_MOD_CONTAINER 0x40000
1053 | #define SC_MOD_LEXERSTATE 0x80000
1054 | #define SC_MOD_INSERTCHECK 0x100000
1055 | #define SC_MOD_CHANGETABSTOPS 0x200000
1056 | #define SC_MODEVENTMASKALL 0x3FFFFF
1057 | #define SC_SEARCHRESULT_LINEBUFFERMAXLENGTH 1024
1058 | #define SC_UPDATE_CONTENT 0x1
1059 | #define SC_UPDATE_SELECTION 0x2
1060 | #define SC_UPDATE_V_SCROLL 0x4
1061 | #define SC_UPDATE_H_SCROLL 0x8
1062 | #define SCEN_CHANGE 768
1063 | #define SCEN_SETFOCUS 512
1064 | #define SCEN_KILLFOCUS 256
1065 | #define SCK_DOWN 300
1066 | #define SCK_UP 301
1067 | #define SCK_LEFT 302
1068 | #define SCK_RIGHT 303
1069 | #define SCK_HOME 304
1070 | #define SCK_END 305
1071 | #define SCK_PRIOR 306
1072 | #define SCK_NEXT 307
1073 | #define SCK_DELETE 308
1074 | #define SCK_INSERT 309
1075 | #define SCK_ESCAPE 7
1076 | #define SCK_BACK 8
1077 | #define SCK_TAB 9
1078 | #define SCK_RETURN 13
1079 | #define SCK_ADD 310
1080 | #define SCK_SUBTRACT 311
1081 | #define SCK_DIVIDE 312
1082 | #define SCK_WIN 313
1083 | #define SCK_RWIN 314
1084 | #define SCK_MENU 315
1085 | #define SCMOD_NORM 0
1086 | #define SCMOD_SHIFT 1
1087 | #define SCMOD_CTRL 2
1088 | #define SCMOD_ALT 4
1089 | #define SCMOD_SUPER 8
1090 | #define SCMOD_META 16
1091 | #define SC_AC_FILLUP 1
1092 | #define SC_AC_DOUBLECLICK 2
1093 | #define SC_AC_TAB 3
1094 | #define SC_AC_NEWLINE 4
1095 | #define SC_AC_COMMAND 5
1096 | #define SC_CHARACTERSOURCE_DIRECT_INPUT 0
1097 | #define SC_CHARACTERSOURCE_TENTATIVE_INPUT 1
1098 | #define SC_CHARACTERSOURCE_IME_RESULT 2
1099 | #define SCN_STYLENEEDED 2000
1100 | #define SCN_CHARADDED 2001
1101 | #define SCN_SAVEPOINTREACHED 2002
1102 | #define SCN_SAVEPOINTLEFT 2003
1103 | #define SCN_MODIFYATTEMPTRO 2004
1104 | #define SCN_KEY 2005
1105 | #define SCN_DOUBLECLICK 2006
1106 | #define SCN_UPDATEUI 2007
1107 | #define SCN_MODIFIED 2008
1108 | #define SCN_MACRORECORD 2009
1109 | #define SCN_MARGINCLICK 2010
1110 | #define SCN_NEEDSHOWN 2011
1111 | #define SCN_PAINTED 2013
1112 | #define SCN_USERLISTSELECTION 2014
1113 | #define SCN_URIDROPPED 2015
1114 | #define SCN_DWELLSTART 2016
1115 | #define SCN_DWELLEND 2017
1116 | #define SCN_ZOOM 2018
1117 | #define SCN_HOTSPOTCLICK 2019
1118 | #define SCN_HOTSPOTDOUBLECLICK 2020
1119 | #define SCN_CALLTIPCLICK 2021
1120 | #define SCN_AUTOCSELECTION 2022
1121 | #define SCN_INDICATORCLICK 2023
1122 | #define SCN_INDICATORRELEASE 2024
1123 | #define SCN_AUTOCCANCELLED 2025
1124 | #define SCN_AUTOCCHARDELETED 2026
1125 | #define SCN_HOTSPOTRELEASECLICK 2027
1126 | #define SCN_FOCUSIN 2028
1127 | #define SCN_FOCUSOUT 2029
1128 | #define SCN_AUTOCCOMPLETED 2030
1129 | #define SCN_MARGINRIGHTCLICK 2031
1130 | #define SCN_AUTOCSELECTIONCHANGE 2032
1131 | #ifndef SCI_DISABLE_PROVISIONAL
1132 | #define SC_BIDIRECTIONAL_DISABLED 0
1133 | #define SC_BIDIRECTIONAL_L2R 1
1134 | #define SC_BIDIRECTIONAL_R2L 2
1135 | #define SCI_GETBIDIRECTIONAL 2708
1136 | #define SCI_SETBIDIRECTIONAL 2709
1137 | #define SC_LINECHARACTERINDEX_NONE 0
1138 | #define SC_LINECHARACTERINDEX_UTF32 1
1139 | #define SC_LINECHARACTERINDEX_UTF16 2
1140 | #define SCI_GETLINECHARACTERINDEX 2710
1141 | #define SCI_ALLOCATELINECHARACTERINDEX 2711
1142 | #define SCI_RELEASELINECHARACTERINDEX 2712
1143 | #define SCI_LINEFROMINDEXPOSITION 2713
1144 | #define SCI_INDEXPOSITIONFROMLINE 2714
1145 | #endif
1146 |
1147 | #define SCN_SCROLLED 2080
1148 | #define SCN_FOLDINGSTATECHANGED 2081
1149 |
1150 | /* --Autogenerated -- end of section automatically generated from Scintilla.iface */
1151 |
1152 | /* These structures are defined to be exactly the same shape as the Win32
1153 | * CHARRANGE, TEXTRANGE, FINDTEXTEX, FORMATRANGE, and NMHDR structs.
1154 | * So older code that treats Scintilla as a RichEdit will work. */
1155 |
1156 | struct Sci_CharacterRange {
1157 | Sci_PositionCR cpMin;
1158 | Sci_PositionCR cpMax;
1159 | };
1160 |
1161 | struct Sci_TextRange {
1162 | struct Sci_CharacterRange chrg;
1163 | char *lpstrText;
1164 | };
1165 |
1166 | struct Sci_TextToFind {
1167 | struct Sci_CharacterRange chrg;
1168 | const char *lpstrText;
1169 | struct Sci_CharacterRange chrgText;
1170 | };
1171 |
1172 | typedef void *Sci_SurfaceID;
1173 |
1174 | struct Sci_Rectangle {
1175 | int left;
1176 | int top;
1177 | int right;
1178 | int bottom;
1179 | };
1180 |
1181 | /* This structure is used in printing and requires some of the graphics types
1182 | * from Platform.h. Not needed by most client code. */
1183 |
1184 | struct Sci_RangeToFormat {
1185 | Sci_SurfaceID hdc;
1186 | Sci_SurfaceID hdcTarget;
1187 | struct Sci_Rectangle rc;
1188 | struct Sci_Rectangle rcPage;
1189 | struct Sci_CharacterRange chrg;
1190 | };
1191 |
1192 | #ifndef __cplusplus
1193 | /* For the GTK+ platform, g-ir-scanner needs to have these typedefs. This
1194 | * is not required in C++ code and actually seems to break ScintillaEditPy */
1195 | typedef struct Sci_NotifyHeader Sci_NotifyHeader;
1196 | typedef struct SCNotification SCNotification;
1197 | #endif
1198 |
1199 | struct Sci_NotifyHeader {
1200 | /* Compatible with Windows NMHDR.
1201 | * hwndFrom is really an environment specific window handle or pointer
1202 | * but most clients of Scintilla.h do not have this type visible. */
1203 | void *hwndFrom;
1204 | uptr_t idFrom;
1205 | unsigned int code;
1206 | };
1207 |
1208 | struct SCNotification {
1209 | Sci_NotifyHeader nmhdr;
1210 | Sci_Position position;
1211 | /* SCN_STYLENEEDED, SCN_DOUBLECLICK, SCN_MODIFIED, SCN_MARGINCLICK, */
1212 | /* SCN_NEEDSHOWN, SCN_DWELLSTART, SCN_DWELLEND, SCN_CALLTIPCLICK, */
1213 | /* SCN_HOTSPOTCLICK, SCN_HOTSPOTDOUBLECLICK, SCN_HOTSPOTRELEASECLICK, */
1214 | /* SCN_INDICATORCLICK, SCN_INDICATORRELEASE, */
1215 | /* SCN_USERLISTSELECTION, SCN_AUTOCSELECTION */
1216 |
1217 | int ch;
1218 | /* SCN_CHARADDED, SCN_KEY, SCN_AUTOCCOMPLETED, SCN_AUTOCSELECTION, */
1219 | /* SCN_USERLISTSELECTION */
1220 | int modifiers;
1221 | /* SCN_KEY, SCN_DOUBLECLICK, SCN_HOTSPOTCLICK, SCN_HOTSPOTDOUBLECLICK, */
1222 | /* SCN_HOTSPOTRELEASECLICK, SCN_INDICATORCLICK, SCN_INDICATORRELEASE, */
1223 |
1224 | int modificationType; /* SCN_MODIFIED */
1225 | const char *text;
1226 | /* SCN_MODIFIED, SCN_USERLISTSELECTION, SCN_AUTOCSELECTION, SCN_URIDROPPED */
1227 |
1228 | Sci_Position length; /* SCN_MODIFIED */
1229 | Sci_Position linesAdded; /* SCN_MODIFIED */
1230 | int message; /* SCN_MACRORECORD */
1231 | uptr_t wParam; /* SCN_MACRORECORD */
1232 | sptr_t lParam; /* SCN_MACRORECORD */
1233 | Sci_Position line; /* SCN_MODIFIED */
1234 | int foldLevelNow; /* SCN_MODIFIED */
1235 | int foldLevelPrev; /* SCN_MODIFIED */
1236 | int margin; /* SCN_MARGINCLICK */
1237 | int listType; /* SCN_USERLISTSELECTION */
1238 | int x; /* SCN_DWELLSTART, SCN_DWELLEND */
1239 | int y; /* SCN_DWELLSTART, SCN_DWELLEND */
1240 | int token; /* SCN_MODIFIED with SC_MOD_CONTAINER */
1241 | Sci_Position annotationLinesAdded; /* SCN_MODIFIED with SC_MOD_CHANGEANNOTATION */
1242 | int updated; /* SCN_UPDATEUI */
1243 | int listCompletionMethod;
1244 | /* SCN_AUTOCSELECTION, SCN_AUTOCCOMPLETED, SCN_USERLISTSELECTION, */
1245 | int characterSource; /* SCN_CHARADDED */
1246 | };
1247 |
1248 | struct SearchResultMarking {
1249 | long _start;
1250 | long _end;
1251 | };
1252 |
1253 | struct SearchResultMarkings {
1254 | long _length;
1255 | SearchResultMarking *_markings;
1256 | };
1257 |
1258 | #ifdef INCLUDE_DEPRECATED_FEATURES
1259 |
1260 | #define SCI_SETKEYSUNICODE 2521
1261 | #define SCI_GETKEYSUNICODE 2522
1262 |
1263 | #define SCI_GETTWOPHASEDRAW 2283
1264 | #define SCI_SETTWOPHASEDRAW 2284
1265 |
1266 | #define CharacterRange Sci_CharacterRange
1267 | #define TextRange Sci_TextRange
1268 | #define TextToFind Sci_TextToFind
1269 | #define RangeToFormat Sci_RangeToFormat
1270 | #define NotifyHeader Sci_NotifyHeader
1271 |
1272 | #define SCI_SETSTYLEBITS 2090
1273 | #define SCI_GETSTYLEBITS 2091
1274 | #define SCI_GETSTYLEBITSNEEDED 4011
1275 |
1276 | #define INDIC0_MASK 0x20
1277 | #define INDIC1_MASK 0x40
1278 | #define INDIC2_MASK 0x80
1279 | #define INDICS_MASK 0xE0
1280 |
1281 | #endif
1282 |
1283 | #endif
1284 |
--------------------------------------------------------------------------------
/src/Npp/menuCmdID.h:
--------------------------------------------------------------------------------
1 | // This file is part of Notepad++ project
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 | // Note that the GPL places important restrictions on "derived works", yet
10 | // it does not provide a detailed definition of that term. To avoid
11 | // misunderstandings, we consider an application to constitute a
12 | // "derivative work" for the purpose of this license if it does any of the
13 | // following:
14 | // 1. Integrates source code from Notepad++.
15 | // 2. Integrates/includes/aggregates Notepad++ into a proprietary executable
16 | // installer, such as those produced by InstallShield.
17 | // 3. Links to a library or executes a program that does any of the above.
18 | //
19 | // This program is distributed in the hope that it will be useful,
20 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
21 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 | // GNU General Public License for more details.
23 | //
24 | // You should have received a copy of the GNU General Public License
25 | // along with this program; if not, write to the Free Software
26 | // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
27 |
28 |
29 | #pragma once
30 |
31 | #define IDM 40000
32 |
33 | #define IDM_FILE (IDM + 1000)
34 | // IMPORTANT: If list below is modified, you have to change the value of IDM_FILEMENU_LASTONE and IDM_FILEMENU_EXISTCMDPOSITION
35 | #define IDM_FILE_NEW (IDM_FILE + 1)
36 | #define IDM_FILE_OPEN (IDM_FILE + 2)
37 | #define IDM_FILE_CLOSE (IDM_FILE + 3)
38 | #define IDM_FILE_CLOSEALL (IDM_FILE + 4)
39 | #define IDM_FILE_CLOSEALL_BUT_CURRENT (IDM_FILE + 5)
40 | #define IDM_FILE_SAVE (IDM_FILE + 6)
41 | #define IDM_FILE_SAVEALL (IDM_FILE + 7)
42 | #define IDM_FILE_SAVEAS (IDM_FILE + 8)
43 | #define IDM_FILE_CLOSEALL_TOLEFT (IDM_FILE + 9)
44 | #define IDM_FILE_PRINT (IDM_FILE + 10)
45 | #define IDM_FILE_PRINTNOW 1001
46 | #define IDM_FILE_EXIT (IDM_FILE + 11)
47 | #define IDM_FILE_LOADSESSION (IDM_FILE + 12)
48 | #define IDM_FILE_SAVESESSION (IDM_FILE + 13)
49 | #define IDM_FILE_RELOAD (IDM_FILE + 14)
50 | #define IDM_FILE_SAVECOPYAS (IDM_FILE + 15)
51 | #define IDM_FILE_DELETE (IDM_FILE + 16)
52 | #define IDM_FILE_RENAME (IDM_FILE + 17)
53 | #define IDM_FILE_CLOSEALL_TORIGHT (IDM_FILE + 18)
54 | #define IDM_FILE_OPEN_FOLDER (IDM_FILE + 19)
55 | #define IDM_FILE_OPEN_CMD (IDM_FILE + 20)
56 | #define IDM_FILE_RESTORELASTCLOSEDFILE (IDM_FILE + 21)
57 | #define IDM_FILE_OPENFOLDERASWORSPACE (IDM_FILE + 22)
58 | #define IDM_FILE_OPEN_DEFAULT_VIEWER (IDM_FILE + 23)
59 | #define IDM_FILE_CLOSEALL_UNCHANGED (IDM_FILE + 24)
60 | // IMPORTANT: If list above is modified, you have to change the following values:
61 |
62 | // To be updated if new menu item(s) is (are) added in menu "File"
63 | #define IDM_FILEMENU_LASTONE IDM_FILE_CLOSEALL_UNCHANGED
64 |
65 | // 0 based position of command "Exit" including the bars in the file menu
66 | // and without counting "Recent files history" items
67 |
68 | // 0 New
69 | // 1 Open...
70 | // 2 Open Containing Folder
71 | // 3 Open Folder as Workspace
72 | // 4 Open in Default Viewer
73 | // 5 Reload from Disk
74 | // 6 Save
75 | // 7 Save As...
76 | // 8 Save a Copy As...
77 | // 9 Save All
78 | //10 Rename...
79 | //11 Close
80 | //12 Close All
81 | //13 Close More
82 | //14 Move to Recycle Bin
83 | //15 --------
84 | //16 Load Session...
85 | //17 Save Session...
86 | //18 --------
87 | //19 Print...
88 | //20 Print Now
89 | //21 --------
90 | //22 Exit
91 | #define IDM_FILEMENU_EXISTCMDPOSITION 22
92 |
93 |
94 | #define IDM_EDIT (IDM + 2000)
95 | #define IDM_EDIT_CUT (IDM_EDIT + 1)
96 | #define IDM_EDIT_COPY (IDM_EDIT + 2)
97 | #define IDM_EDIT_UNDO (IDM_EDIT + 3)
98 | #define IDM_EDIT_REDO (IDM_EDIT + 4)
99 | #define IDM_EDIT_PASTE (IDM_EDIT + 5)
100 | #define IDM_EDIT_DELETE (IDM_EDIT + 6)
101 | #define IDM_EDIT_SELECTALL (IDM_EDIT + 7)
102 | #define IDM_EDIT_BEGINENDSELECT (IDM_EDIT + 20)
103 |
104 | #define IDM_EDIT_INS_TAB (IDM_EDIT + 8)
105 | #define IDM_EDIT_RMV_TAB (IDM_EDIT + 9)
106 | #define IDM_EDIT_DUP_LINE (IDM_EDIT + 10)
107 | #define IDM_EDIT_REMOVE_DUP_LINES (IDM_EDIT + 77)
108 | #define IDM_EDIT_TRANSPOSE_LINE (IDM_EDIT + 11)
109 | #define IDM_EDIT_SPLIT_LINES (IDM_EDIT + 12)
110 | #define IDM_EDIT_JOIN_LINES (IDM_EDIT + 13)
111 | #define IDM_EDIT_LINE_UP (IDM_EDIT + 14)
112 | #define IDM_EDIT_LINE_DOWN (IDM_EDIT + 15)
113 | #define IDM_EDIT_UPPERCASE (IDM_EDIT + 16)
114 | #define IDM_EDIT_LOWERCASE (IDM_EDIT + 17)
115 | #define IDM_EDIT_PROPERCASE_FORCE (IDM_EDIT + 67)
116 | #define IDM_EDIT_PROPERCASE_BLEND (IDM_EDIT + 68)
117 | #define IDM_EDIT_SENTENCECASE_FORCE (IDM_EDIT + 69)
118 | #define IDM_EDIT_SENTENCECASE_BLEND (IDM_EDIT + 70)
119 | #define IDM_EDIT_INVERTCASE (IDM_EDIT + 71)
120 | #define IDM_EDIT_RANDOMCASE (IDM_EDIT + 72)
121 | #define IDM_EDIT_REMOVEEMPTYLINES (IDM_EDIT + 55)
122 | #define IDM_EDIT_REMOVEEMPTYLINESWITHBLANK (IDM_EDIT + 56)
123 | #define IDM_EDIT_BLANKLINEABOVECURRENT (IDM_EDIT + 57)
124 | #define IDM_EDIT_BLANKLINEBELOWCURRENT (IDM_EDIT + 58)
125 | #define IDM_EDIT_SORTLINES_LEXICOGRAPHIC_ASCENDING (IDM_EDIT + 59)
126 | #define IDM_EDIT_SORTLINES_LEXICOGRAPHIC_DESCENDING (IDM_EDIT + 60)
127 | #define IDM_EDIT_SORTLINES_INTEGER_ASCENDING (IDM_EDIT + 61)
128 | #define IDM_EDIT_SORTLINES_INTEGER_DESCENDING (IDM_EDIT + 62)
129 | #define IDM_EDIT_SORTLINES_DECIMALCOMMA_ASCENDING (IDM_EDIT + 63)
130 | #define IDM_EDIT_SORTLINES_DECIMALCOMMA_DESCENDING (IDM_EDIT + 64)
131 | #define IDM_EDIT_SORTLINES_DECIMALDOT_ASCENDING (IDM_EDIT + 65)
132 | #define IDM_EDIT_SORTLINES_DECIMALDOT_DESCENDING (IDM_EDIT + 66)
133 |
134 | #define IDM_EDIT_OPENASFILE (IDM_EDIT + 73)
135 | #define IDM_EDIT_OPENINFOLDER (IDM_EDIT + 74)
136 | #define IDM_EDIT_SEARCHONINTERNET (IDM_EDIT + 75)
137 | #define IDM_EDIT_CHANGESEARCHENGINE (IDM_EDIT + 76)
138 |
139 | // Menu macro
140 | #define IDM_MACRO_STARTRECORDINGMACRO (IDM_EDIT + 18)
141 | #define IDM_MACRO_STOPRECORDINGMACRO (IDM_EDIT + 19)
142 | #define IDM_MACRO_PLAYBACKRECORDEDMACRO (IDM_EDIT + 21)
143 | //-----------
144 |
145 | #define IDM_EDIT_BLOCK_COMMENT (IDM_EDIT + 22)
146 | #define IDM_EDIT_STREAM_COMMENT (IDM_EDIT + 23)
147 | #define IDM_EDIT_TRIMTRAILING (IDM_EDIT + 24)
148 | #define IDM_EDIT_TRIMLINEHEAD (IDM_EDIT + 42)
149 | #define IDM_EDIT_TRIM_BOTH (IDM_EDIT + 43)
150 | #define IDM_EDIT_EOL2WS (IDM_EDIT + 44)
151 | #define IDM_EDIT_TRIMALL (IDM_EDIT + 45)
152 | #define IDM_EDIT_TAB2SW (IDM_EDIT + 46)
153 | #define IDM_EDIT_SW2TAB_LEADING (IDM_EDIT + 53)
154 | #define IDM_EDIT_SW2TAB_ALL (IDM_EDIT + 54)
155 | #define IDM_EDIT_STREAM_UNCOMMENT (IDM_EDIT + 47)
156 |
157 | // Menu macro
158 | #define IDM_MACRO_SAVECURRENTMACRO (IDM_EDIT + 25)
159 | //-----------
160 |
161 | #define IDM_EDIT_RTL (IDM_EDIT + 26)
162 | #define IDM_EDIT_LTR (IDM_EDIT + 27)
163 | #define IDM_EDIT_SETREADONLY (IDM_EDIT + 28)
164 | #define IDM_EDIT_FULLPATHTOCLIP (IDM_EDIT + 29)
165 | #define IDM_EDIT_FILENAMETOCLIP (IDM_EDIT + 30)
166 | #define IDM_EDIT_CURRENTDIRTOCLIP (IDM_EDIT + 31)
167 |
168 | // Menu macro
169 | #define IDM_MACRO_RUNMULTIMACRODLG (IDM_EDIT + 32)
170 | //-----------
171 |
172 | #define IDM_EDIT_CLEARREADONLY (IDM_EDIT + 33)
173 | #define IDM_EDIT_COLUMNMODE (IDM_EDIT + 34)
174 | #define IDM_EDIT_BLOCK_COMMENT_SET (IDM_EDIT + 35)
175 | #define IDM_EDIT_BLOCK_UNCOMMENT (IDM_EDIT + 36)
176 | #define IDM_EDIT_COLUMNMODETIP (IDM_EDIT + 37)
177 | #define IDM_EDIT_PASTE_AS_HTML (IDM_EDIT + 38)
178 | #define IDM_EDIT_PASTE_AS_RTF (IDM_EDIT + 39)
179 | #define IDM_EDIT_COPY_BINARY (IDM_EDIT + 48)
180 | #define IDM_EDIT_CUT_BINARY (IDM_EDIT + 49)
181 | #define IDM_EDIT_PASTE_BINARY (IDM_EDIT + 50)
182 | #define IDM_EDIT_CHAR_PANEL (IDM_EDIT + 51)
183 | #define IDM_EDIT_CLIPBOARDHISTORY_PANEL (IDM_EDIT + 52)
184 |
185 | #define IDM_EDIT_AUTOCOMPLETE (50000 + 0)
186 | #define IDM_EDIT_AUTOCOMPLETE_CURRENTFILE (50000 + 1)
187 | #define IDM_EDIT_FUNCCALLTIP (50000 + 2)
188 | #define IDM_EDIT_AUTOCOMPLETE_PATH (50000 + 6)
189 |
190 | //Belong to MENU FILE
191 | #define IDM_OPEN_ALL_RECENT_FILE (IDM_EDIT + 40)
192 | #define IDM_CLEAN_RECENT_FILE_LIST (IDM_EDIT + 41)
193 |
194 | #define IDM_SEARCH (IDM + 3000)
195 | #define IDM_SEARCH_FIND (IDM_SEARCH + 1)
196 | #define IDM_SEARCH_FINDNEXT (IDM_SEARCH + 2)
197 | #define IDM_SEARCH_REPLACE (IDM_SEARCH + 3)
198 | #define IDM_SEARCH_GOTOLINE (IDM_SEARCH + 4)
199 | #define IDM_SEARCH_TOGGLE_BOOKMARK (IDM_SEARCH + 5)
200 | #define IDM_SEARCH_NEXT_BOOKMARK (IDM_SEARCH + 6)
201 | #define IDM_SEARCH_PREV_BOOKMARK (IDM_SEARCH + 7)
202 | #define IDM_SEARCH_CLEAR_BOOKMARKS (IDM_SEARCH + 8)
203 | #define IDM_SEARCH_GOTOMATCHINGBRACE (IDM_SEARCH + 9)
204 | #define IDM_SEARCH_FINDPREV (IDM_SEARCH + 10)
205 | #define IDM_SEARCH_FINDINCREMENT (IDM_SEARCH + 11)
206 | #define IDM_SEARCH_FINDINFILES (IDM_SEARCH + 13)
207 | #define IDM_SEARCH_VOLATILE_FINDNEXT (IDM_SEARCH + 14)
208 | #define IDM_SEARCH_VOLATILE_FINDPREV (IDM_SEARCH + 15)
209 | #define IDM_SEARCH_CUTMARKEDLINES (IDM_SEARCH + 18)
210 | #define IDM_SEARCH_COPYMARKEDLINES (IDM_SEARCH + 19)
211 | #define IDM_SEARCH_PASTEMARKEDLINES (IDM_SEARCH + 20)
212 | #define IDM_SEARCH_DELETEMARKEDLINES (IDM_SEARCH + 21)
213 | #define IDM_SEARCH_MARKALLEXT1 (IDM_SEARCH + 22)
214 | #define IDM_SEARCH_UNMARKALLEXT1 (IDM_SEARCH + 23)
215 | #define IDM_SEARCH_MARKALLEXT2 (IDM_SEARCH + 24)
216 | #define IDM_SEARCH_UNMARKALLEXT2 (IDM_SEARCH + 25)
217 | #define IDM_SEARCH_MARKALLEXT3 (IDM_SEARCH + 26)
218 | #define IDM_SEARCH_UNMARKALLEXT3 (IDM_SEARCH + 27)
219 | #define IDM_SEARCH_MARKALLEXT4 (IDM_SEARCH + 28)
220 | #define IDM_SEARCH_UNMARKALLEXT4 (IDM_SEARCH + 29)
221 | #define IDM_SEARCH_MARKALLEXT5 (IDM_SEARCH + 30)
222 | #define IDM_SEARCH_UNMARKALLEXT5 (IDM_SEARCH + 31)
223 | #define IDM_SEARCH_CLEARALLMARKS (IDM_SEARCH + 32)
224 |
225 | #define IDM_SEARCH_GOPREVMARKER1 (IDM_SEARCH + 33)
226 | #define IDM_SEARCH_GOPREVMARKER2 (IDM_SEARCH + 34)
227 | #define IDM_SEARCH_GOPREVMARKER3 (IDM_SEARCH + 35)
228 | #define IDM_SEARCH_GOPREVMARKER4 (IDM_SEARCH + 36)
229 | #define IDM_SEARCH_GOPREVMARKER5 (IDM_SEARCH + 37)
230 | #define IDM_SEARCH_GOPREVMARKER_DEF (IDM_SEARCH + 38)
231 |
232 | #define IDM_SEARCH_GONEXTMARKER1 (IDM_SEARCH + 39)
233 | #define IDM_SEARCH_GONEXTMARKER2 (IDM_SEARCH + 40)
234 | #define IDM_SEARCH_GONEXTMARKER3 (IDM_SEARCH + 41)
235 | #define IDM_SEARCH_GONEXTMARKER4 (IDM_SEARCH + 42)
236 | #define IDM_SEARCH_GONEXTMARKER5 (IDM_SEARCH + 43)
237 | #define IDM_SEARCH_GONEXTMARKER_DEF (IDM_SEARCH + 44)
238 |
239 | #define IDM_FOCUS_ON_FOUND_RESULTS (IDM_SEARCH + 45)
240 | #define IDM_SEARCH_GOTONEXTFOUND (IDM_SEARCH + 46)
241 | #define IDM_SEARCH_GOTOPREVFOUND (IDM_SEARCH + 47)
242 |
243 | #define IDM_SEARCH_SETANDFINDNEXT (IDM_SEARCH + 48)
244 | #define IDM_SEARCH_SETANDFINDPREV (IDM_SEARCH + 49)
245 | #define IDM_SEARCH_INVERSEMARKS (IDM_SEARCH + 50)
246 | #define IDM_SEARCH_DELETEUNMARKEDLINES (IDM_SEARCH + 51)
247 | #define IDM_SEARCH_FINDCHARINRANGE (IDM_SEARCH + 52)
248 | #define IDM_SEARCH_SELECTMATCHINGBRACES (IDM_SEARCH + 53)
249 | #define IDM_SEARCH_MARK (IDM_SEARCH + 54)
250 |
251 | #define IDM_MISC (IDM + 3500)
252 | #define IDM_FILESWITCHER_FILESCLOSE (IDM_MISC + 1)
253 | #define IDM_FILESWITCHER_FILESCLOSEOTHERS (IDM_MISC + 2)
254 |
255 |
256 | #define IDM_VIEW (IDM + 4000)
257 | //#define IDM_VIEW_TOOLBAR_HIDE (IDM_VIEW + 1)
258 | #define IDM_VIEW_TOOLBAR_REDUCE (IDM_VIEW + 2)
259 | #define IDM_VIEW_TOOLBAR_ENLARGE (IDM_VIEW + 3)
260 | #define IDM_VIEW_TOOLBAR_STANDARD (IDM_VIEW + 4)
261 | #define IDM_VIEW_REDUCETABBAR (IDM_VIEW + 5)
262 | #define IDM_VIEW_LOCKTABBAR (IDM_VIEW + 6)
263 | #define IDM_VIEW_DRAWTABBAR_TOPBAR (IDM_VIEW + 7)
264 | #define IDM_VIEW_DRAWTABBAR_INACIVETAB (IDM_VIEW + 8)
265 | #define IDM_VIEW_POSTIT (IDM_VIEW + 9)
266 | #define IDM_VIEW_TOGGLE_FOLDALL (IDM_VIEW + 10)
267 | //#define IDM_VIEW_USER_DLG (IDM_VIEW + 11)
268 | #define IDM_VIEW_LINENUMBER (IDM_VIEW + 12)
269 | #define IDM_VIEW_SYMBOLMARGIN (IDM_VIEW + 13)
270 | #define IDM_VIEW_FOLDERMAGIN (IDM_VIEW + 14)
271 | #define IDM_VIEW_FOLDERMAGIN_SIMPLE (IDM_VIEW + 15)
272 | #define IDM_VIEW_FOLDERMAGIN_ARROW (IDM_VIEW + 16)
273 | #define IDM_VIEW_FOLDERMAGIN_CIRCLE (IDM_VIEW + 17)
274 | #define IDM_VIEW_FOLDERMAGIN_BOX (IDM_VIEW + 18)
275 | #define IDM_VIEW_ALL_CHARACTERS (IDM_VIEW + 19)
276 | #define IDM_VIEW_INDENT_GUIDE (IDM_VIEW + 20)
277 | #define IDM_VIEW_CURLINE_HILITING (IDM_VIEW + 21)
278 | #define IDM_VIEW_WRAP (IDM_VIEW + 22)
279 | #define IDM_VIEW_ZOOMIN (IDM_VIEW + 23)
280 | #define IDM_VIEW_ZOOMOUT (IDM_VIEW + 24)
281 | #define IDM_VIEW_TAB_SPACE (IDM_VIEW + 25)
282 | #define IDM_VIEW_EOL (IDM_VIEW + 26)
283 | #define IDM_VIEW_EDGELINE (IDM_VIEW + 27)
284 | #define IDM_VIEW_EDGEBACKGROUND (IDM_VIEW + 28)
285 | #define IDM_VIEW_TOGGLE_UNFOLDALL (IDM_VIEW + 29)
286 | #define IDM_VIEW_FOLD_CURRENT (IDM_VIEW + 30)
287 | #define IDM_VIEW_UNFOLD_CURRENT (IDM_VIEW + 31)
288 | #define IDM_VIEW_FULLSCREENTOGGLE (IDM_VIEW + 32)
289 | #define IDM_VIEW_ZOOMRESTORE (IDM_VIEW + 33)
290 | #define IDM_VIEW_ALWAYSONTOP (IDM_VIEW + 34)
291 | #define IDM_VIEW_SYNSCROLLV (IDM_VIEW + 35)
292 | #define IDM_VIEW_SYNSCROLLH (IDM_VIEW + 36)
293 | #define IDM_VIEW_EDGENONE (IDM_VIEW + 37)
294 | #define IDM_VIEW_DRAWTABBAR_CLOSEBOTTUN (IDM_VIEW + 38)
295 | #define IDM_VIEW_DRAWTABBAR_DBCLK2CLOSE (IDM_VIEW + 39)
296 | #define IDM_VIEW_REFRESHTABAR (IDM_VIEW + 40)
297 | #define IDM_VIEW_WRAP_SYMBOL (IDM_VIEW + 41)
298 | #define IDM_VIEW_HIDELINES (IDM_VIEW + 42)
299 | #define IDM_VIEW_DRAWTABBAR_VERTICAL (IDM_VIEW + 43)
300 | #define IDM_VIEW_DRAWTABBAR_MULTILINE (IDM_VIEW + 44)
301 | #define IDM_VIEW_DOCCHANGEMARGIN (IDM_VIEW + 45)
302 | #define IDM_VIEW_LWDEF (IDM_VIEW + 46)
303 | #define IDM_VIEW_LWALIGN (IDM_VIEW + 47)
304 | #define IDM_VIEW_LWINDENT (IDM_VIEW + 48)
305 | #define IDM_VIEW_SUMMARY (IDM_VIEW + 49)
306 |
307 | #define IDM_VIEW_FOLD (IDM_VIEW + 50)
308 | #define IDM_VIEW_FOLD_1 (IDM_VIEW_FOLD + 1)
309 | #define IDM_VIEW_FOLD_2 (IDM_VIEW_FOLD + 2)
310 | #define IDM_VIEW_FOLD_3 (IDM_VIEW_FOLD + 3)
311 | #define IDM_VIEW_FOLD_4 (IDM_VIEW_FOLD + 4)
312 | #define IDM_VIEW_FOLD_5 (IDM_VIEW_FOLD + 5)
313 | #define IDM_VIEW_FOLD_6 (IDM_VIEW_FOLD + 6)
314 | #define IDM_VIEW_FOLD_7 (IDM_VIEW_FOLD + 7)
315 | #define IDM_VIEW_FOLD_8 (IDM_VIEW_FOLD + 8)
316 |
317 | #define IDM_VIEW_UNFOLD (IDM_VIEW + 60)
318 | #define IDM_VIEW_UNFOLD_1 (IDM_VIEW_UNFOLD + 1)
319 | #define IDM_VIEW_UNFOLD_2 (IDM_VIEW_UNFOLD + 2)
320 | #define IDM_VIEW_UNFOLD_3 (IDM_VIEW_UNFOLD + 3)
321 | #define IDM_VIEW_UNFOLD_4 (IDM_VIEW_UNFOLD + 4)
322 | #define IDM_VIEW_UNFOLD_5 (IDM_VIEW_UNFOLD + 5)
323 | #define IDM_VIEW_UNFOLD_6 (IDM_VIEW_UNFOLD + 6)
324 | #define IDM_VIEW_UNFOLD_7 (IDM_VIEW_UNFOLD + 7)
325 | #define IDM_VIEW_UNFOLD_8 (IDM_VIEW_UNFOLD + 8)
326 |
327 | #define IDM_VIEW_FILESWITCHER_PANEL (IDM_VIEW + 70)
328 | #define IDM_VIEW_SWITCHTO_OTHER_VIEW (IDM_VIEW + 72)
329 | #define IDM_EXPORT_FUNC_LIST_AND_QUIT (IDM_VIEW + 73)
330 |
331 | #define IDM_VIEW_DOC_MAP (IDM_VIEW + 80)
332 |
333 | #define IDM_VIEW_PROJECT_PANEL_1 (IDM_VIEW + 81)
334 | #define IDM_VIEW_PROJECT_PANEL_2 (IDM_VIEW + 82)
335 | #define IDM_VIEW_PROJECT_PANEL_3 (IDM_VIEW + 83)
336 |
337 | #define IDM_VIEW_FUNC_LIST (IDM_VIEW + 84)
338 | #define IDM_VIEW_FILEBROWSER (IDM_VIEW + 85)
339 |
340 | #define IDM_VIEW_TAB1 (IDM_VIEW + 86)
341 | #define IDM_VIEW_TAB2 (IDM_VIEW + 87)
342 | #define IDM_VIEW_TAB3 (IDM_VIEW + 88)
343 | #define IDM_VIEW_TAB4 (IDM_VIEW + 89)
344 | #define IDM_VIEW_TAB5 (IDM_VIEW + 90)
345 | #define IDM_VIEW_TAB6 (IDM_VIEW + 91)
346 | #define IDM_VIEW_TAB7 (IDM_VIEW + 92)
347 | #define IDM_VIEW_TAB8 (IDM_VIEW + 93)
348 | #define IDM_VIEW_TAB9 (IDM_VIEW + 94)
349 | #define IDM_VIEW_TAB_NEXT (IDM_VIEW + 95)
350 | #define IDM_VIEW_TAB_PREV (IDM_VIEW + 96)
351 | #define IDM_VIEW_MONITORING (IDM_VIEW + 97)
352 | #define IDM_VIEW_TAB_MOVEFORWARD (IDM_VIEW + 98)
353 | #define IDM_VIEW_TAB_MOVEBACKWARD (IDM_VIEW + 99)
354 | #define IDM_VIEW_IN_FIREFOX (IDM_VIEW + 100)
355 | #define IDM_VIEW_IN_CHROME (IDM_VIEW + 101)
356 | #define IDM_VIEW_IN_EDGE (IDM_VIEW + 102)
357 | #define IDM_VIEW_IN_IE (IDM_VIEW + 103)
358 |
359 | #define IDM_VIEW_GOTO_ANOTHER_VIEW 10001
360 | #define IDM_VIEW_CLONE_TO_ANOTHER_VIEW 10002
361 | #define IDM_VIEW_GOTO_NEW_INSTANCE 10003
362 | #define IDM_VIEW_LOAD_IN_NEW_INSTANCE 10004
363 |
364 |
365 | #define IDM_FORMAT (IDM + 5000)
366 | #define IDM_FORMAT_TODOS (IDM_FORMAT + 1)
367 | #define IDM_FORMAT_TOUNIX (IDM_FORMAT + 2)
368 | #define IDM_FORMAT_TOMAC (IDM_FORMAT + 3)
369 | #define IDM_FORMAT_ANSI (IDM_FORMAT + 4)
370 | #define IDM_FORMAT_UTF_8 (IDM_FORMAT + 5)
371 | #define IDM_FORMAT_UCS_2BE (IDM_FORMAT + 6)
372 | #define IDM_FORMAT_UCS_2LE (IDM_FORMAT + 7)
373 | #define IDM_FORMAT_AS_UTF_8 (IDM_FORMAT + 8)
374 | #define IDM_FORMAT_CONV2_ANSI (IDM_FORMAT + 9)
375 | #define IDM_FORMAT_CONV2_AS_UTF_8 (IDM_FORMAT + 10)
376 | #define IDM_FORMAT_CONV2_UTF_8 (IDM_FORMAT + 11)
377 | #define IDM_FORMAT_CONV2_UCS_2BE (IDM_FORMAT + 12)
378 | #define IDM_FORMAT_CONV2_UCS_2LE (IDM_FORMAT + 13)
379 |
380 | #define IDM_FORMAT_ENCODE (IDM_FORMAT + 20)
381 | #define IDM_FORMAT_WIN_1250 (IDM_FORMAT_ENCODE + 0)
382 | #define IDM_FORMAT_WIN_1251 (IDM_FORMAT_ENCODE + 1)
383 | #define IDM_FORMAT_WIN_1252 (IDM_FORMAT_ENCODE + 2)
384 | #define IDM_FORMAT_WIN_1253 (IDM_FORMAT_ENCODE + 3)
385 | #define IDM_FORMAT_WIN_1254 (IDM_FORMAT_ENCODE + 4)
386 | #define IDM_FORMAT_WIN_1255 (IDM_FORMAT_ENCODE + 5)
387 | #define IDM_FORMAT_WIN_1256 (IDM_FORMAT_ENCODE + 6)
388 | #define IDM_FORMAT_WIN_1257 (IDM_FORMAT_ENCODE + 7)
389 | #define IDM_FORMAT_WIN_1258 (IDM_FORMAT_ENCODE + 8)
390 | #define IDM_FORMAT_ISO_8859_1 (IDM_FORMAT_ENCODE + 9)
391 | #define IDM_FORMAT_ISO_8859_2 (IDM_FORMAT_ENCODE + 10)
392 | #define IDM_FORMAT_ISO_8859_3 (IDM_FORMAT_ENCODE + 11)
393 | #define IDM_FORMAT_ISO_8859_4 (IDM_FORMAT_ENCODE + 12)
394 | #define IDM_FORMAT_ISO_8859_5 (IDM_FORMAT_ENCODE + 13)
395 | #define IDM_FORMAT_ISO_8859_6 (IDM_FORMAT_ENCODE + 14)
396 | #define IDM_FORMAT_ISO_8859_7 (IDM_FORMAT_ENCODE + 15)
397 | #define IDM_FORMAT_ISO_8859_8 (IDM_FORMAT_ENCODE + 16)
398 | #define IDM_FORMAT_ISO_8859_9 (IDM_FORMAT_ENCODE + 17)
399 | //#define IDM_FORMAT_ISO_8859_10 (IDM_FORMAT_ENCODE + 18)
400 | //#define IDM_FORMAT_ISO_8859_11 (IDM_FORMAT_ENCODE + 19)
401 | #define IDM_FORMAT_ISO_8859_13 (IDM_FORMAT_ENCODE + 20)
402 | #define IDM_FORMAT_ISO_8859_14 (IDM_FORMAT_ENCODE + 21)
403 | #define IDM_FORMAT_ISO_8859_15 (IDM_FORMAT_ENCODE + 22)
404 | //#define IDM_FORMAT_ISO_8859_16 (IDM_FORMAT_ENCODE + 23)
405 | #define IDM_FORMAT_DOS_437 (IDM_FORMAT_ENCODE + 24)
406 | #define IDM_FORMAT_DOS_720 (IDM_FORMAT_ENCODE + 25)
407 | #define IDM_FORMAT_DOS_737 (IDM_FORMAT_ENCODE + 26)
408 | #define IDM_FORMAT_DOS_775 (IDM_FORMAT_ENCODE + 27)
409 | #define IDM_FORMAT_DOS_850 (IDM_FORMAT_ENCODE + 28)
410 | #define IDM_FORMAT_DOS_852 (IDM_FORMAT_ENCODE + 29)
411 | #define IDM_FORMAT_DOS_855 (IDM_FORMAT_ENCODE + 30)
412 | #define IDM_FORMAT_DOS_857 (IDM_FORMAT_ENCODE + 31)
413 | #define IDM_FORMAT_DOS_858 (IDM_FORMAT_ENCODE + 32)
414 | #define IDM_FORMAT_DOS_860 (IDM_FORMAT_ENCODE + 33)
415 | #define IDM_FORMAT_DOS_861 (IDM_FORMAT_ENCODE + 34)
416 | #define IDM_FORMAT_DOS_862 (IDM_FORMAT_ENCODE + 35)
417 | #define IDM_FORMAT_DOS_863 (IDM_FORMAT_ENCODE + 36)
418 | #define IDM_FORMAT_DOS_865 (IDM_FORMAT_ENCODE + 37)
419 | #define IDM_FORMAT_DOS_866 (IDM_FORMAT_ENCODE + 38)
420 | #define IDM_FORMAT_DOS_869 (IDM_FORMAT_ENCODE + 39)
421 | #define IDM_FORMAT_BIG5 (IDM_FORMAT_ENCODE + 40)
422 | #define IDM_FORMAT_GB2312 (IDM_FORMAT_ENCODE + 41)
423 | #define IDM_FORMAT_SHIFT_JIS (IDM_FORMAT_ENCODE + 42)
424 | #define IDM_FORMAT_KOREAN_WIN (IDM_FORMAT_ENCODE + 43)
425 | #define IDM_FORMAT_EUC_KR (IDM_FORMAT_ENCODE + 44)
426 | #define IDM_FORMAT_TIS_620 (IDM_FORMAT_ENCODE + 45)
427 | #define IDM_FORMAT_MAC_CYRILLIC (IDM_FORMAT_ENCODE + 46)
428 | #define IDM_FORMAT_KOI8U_CYRILLIC (IDM_FORMAT_ENCODE + 47)
429 | #define IDM_FORMAT_KOI8R_CYRILLIC (IDM_FORMAT_ENCODE + 48)
430 | #define IDM_FORMAT_ENCODE_END IDM_FORMAT_KOI8R_CYRILLIC
431 |
432 | //#define IDM_FORMAT_CONVERT 200
433 |
434 | #define IDM_LANG (IDM + 6000)
435 | #define IDM_LANGSTYLE_CONFIG_DLG (IDM_LANG + 1)
436 | #define IDM_LANG_C (IDM_LANG + 2)
437 | #define IDM_LANG_CPP (IDM_LANG + 3)
438 | #define IDM_LANG_JAVA (IDM_LANG + 4)
439 | #define IDM_LANG_HTML (IDM_LANG + 5)
440 | #define IDM_LANG_XML (IDM_LANG + 6)
441 | #define IDM_LANG_JS (IDM_LANG + 7)
442 | #define IDM_LANG_PHP (IDM_LANG + 8)
443 | #define IDM_LANG_ASP (IDM_LANG + 9)
444 | #define IDM_LANG_CSS (IDM_LANG + 10)
445 | #define IDM_LANG_PASCAL (IDM_LANG + 11)
446 | #define IDM_LANG_PYTHON (IDM_LANG + 12)
447 | #define IDM_LANG_PERL (IDM_LANG + 13)
448 | #define IDM_LANG_OBJC (IDM_LANG + 14)
449 | #define IDM_LANG_ASCII (IDM_LANG + 15)
450 | #define IDM_LANG_TEXT (IDM_LANG + 16)
451 | #define IDM_LANG_RC (IDM_LANG + 17)
452 | #define IDM_LANG_MAKEFILE (IDM_LANG + 18)
453 | #define IDM_LANG_INI (IDM_LANG + 19)
454 | #define IDM_LANG_SQL (IDM_LANG + 20)
455 | #define IDM_LANG_VB (IDM_LANG + 21)
456 | #define IDM_LANG_BATCH (IDM_LANG + 22)
457 | #define IDM_LANG_CS (IDM_LANG + 23)
458 | #define IDM_LANG_LUA (IDM_LANG + 24)
459 | #define IDM_LANG_TEX (IDM_LANG + 25)
460 | #define IDM_LANG_FORTRAN (IDM_LANG + 26)
461 | #define IDM_LANG_BASH (IDM_LANG + 27)
462 | #define IDM_LANG_FLASH (IDM_LANG + 28)
463 | #define IDM_LANG_NSIS (IDM_LANG + 29)
464 | #define IDM_LANG_TCL (IDM_LANG + 30)
465 | #define IDM_LANG_LISP (IDM_LANG + 31)
466 | #define IDM_LANG_SCHEME (IDM_LANG + 32)
467 | #define IDM_LANG_ASM (IDM_LANG + 33)
468 | #define IDM_LANG_DIFF (IDM_LANG + 34)
469 | #define IDM_LANG_PROPS (IDM_LANG + 35)
470 | #define IDM_LANG_PS (IDM_LANG + 36)
471 | #define IDM_LANG_RUBY (IDM_LANG + 37)
472 | #define IDM_LANG_SMALLTALK (IDM_LANG + 38)
473 | #define IDM_LANG_VHDL (IDM_LANG + 39)
474 | #define IDM_LANG_CAML (IDM_LANG + 40)
475 | #define IDM_LANG_KIX (IDM_LANG + 41)
476 | #define IDM_LANG_ADA (IDM_LANG + 42)
477 | #define IDM_LANG_VERILOG (IDM_LANG + 43)
478 | #define IDM_LANG_AU3 (IDM_LANG + 44)
479 | #define IDM_LANG_MATLAB (IDM_LANG + 45)
480 | #define IDM_LANG_HASKELL (IDM_LANG + 46)
481 | #define IDM_LANG_INNO (IDM_LANG + 47)
482 | #define IDM_LANG_CMAKE (IDM_LANG + 48)
483 | #define IDM_LANG_YAML (IDM_LANG + 49)
484 | #define IDM_LANG_COBOL (IDM_LANG + 50)
485 | #define IDM_LANG_D (IDM_LANG + 51)
486 | #define IDM_LANG_GUI4CLI (IDM_LANG + 52)
487 | #define IDM_LANG_POWERSHELL (IDM_LANG + 53)
488 | #define IDM_LANG_R (IDM_LANG + 54)
489 | #define IDM_LANG_JSP (IDM_LANG + 55)
490 | #define IDM_LANG_COFFEESCRIPT (IDM_LANG + 56)
491 | #define IDM_LANG_JSON (IDM_LANG + 57)
492 | #define IDM_LANG_FORTRAN_77 (IDM_LANG + 58)
493 | #define IDM_LANG_BAANC (IDM_LANG + 59)
494 | #define IDM_LANG_SREC (IDM_LANG + 60)
495 | #define IDM_LANG_IHEX (IDM_LANG + 61)
496 | #define IDM_LANG_TEHEX (IDM_LANG + 62)
497 | #define IDM_LANG_SWIFT (IDM_LANG + 63)
498 | #define IDM_LANG_ASN1 (IDM_LANG + 64)
499 | #define IDM_LANG_AVS (IDM_LANG + 65)
500 | #define IDM_LANG_BLITZBASIC (IDM_LANG + 66)
501 | #define IDM_LANG_PUREBASIC (IDM_LANG + 67)
502 | #define IDM_LANG_FREEBASIC (IDM_LANG + 68)
503 | #define IDM_LANG_CSOUND (IDM_LANG + 69)
504 | #define IDM_LANG_ERLANG (IDM_LANG + 70)
505 | #define IDM_LANG_ESCRIPT (IDM_LANG + 71)
506 | #define IDM_LANG_FORTH (IDM_LANG + 72)
507 | #define IDM_LANG_LATEX (IDM_LANG + 73)
508 | #define IDM_LANG_MMIXAL (IDM_LANG + 74)
509 | #define IDM_LANG_NIMROD (IDM_LANG + 75)
510 | #define IDM_LANG_NNCRONTAB (IDM_LANG + 76)
511 | #define IDM_LANG_OSCRIPT (IDM_LANG + 77)
512 | #define IDM_LANG_REBOL (IDM_LANG + 78)
513 | #define IDM_LANG_REGISTRY (IDM_LANG + 79)
514 | #define IDM_LANG_RUST (IDM_LANG + 80)
515 | #define IDM_LANG_SPICE (IDM_LANG + 81)
516 | #define IDM_LANG_TXT2TAGS (IDM_LANG + 82)
517 | #define IDM_LANG_VISUALPROLOG (IDM_LANG + 83)
518 |
519 | #define IDM_LANG_EXTERNAL (IDM_LANG + 165)
520 | #define IDM_LANG_EXTERNAL_LIMIT (IDM_LANG + 179)
521 |
522 | #define IDM_LANG_USER (IDM_LANG + 180) //46180: Used for translation
523 | #define IDM_LANG_USER_LIMIT (IDM_LANG + 210) //46210: Ajust with IDM_LANG_USER
524 | #define IDM_LANG_USER_DLG (IDM_LANG + 250) //46250: Used for translation
525 | #define IDM_LANG_OPENUDLDIR (IDM_LANG + 300)
526 |
527 |
528 |
529 |
530 | #define IDM_ABOUT (IDM + 7000)
531 | #define IDM_HOMESWEETHOME (IDM_ABOUT + 1)
532 | #define IDM_PROJECTPAGE (IDM_ABOUT + 2)
533 | #define IDM_ONLINEDOCUMENT (IDM_ABOUT + 3)
534 | #define IDM_FORUM (IDM_ABOUT + 4)
535 | //#define IDM_PLUGINSHOME (IDM_ABOUT + 5)
536 | #define IDM_UPDATE_NPP (IDM_ABOUT + 6)
537 | #define IDM_WIKIFAQ (IDM_ABOUT + 7)
538 | #define IDM_HELP (IDM_ABOUT + 8)
539 | #define IDM_CONFUPDATERPROXY (IDM_ABOUT + 9)
540 | #define IDM_CMDLINEARGUMENTS (IDM_ABOUT + 10)
541 | #define IDM_ONLINESUPPORT (IDM_ABOUT + 11)
542 | #define IDM_DEBUGINFO (IDM_ABOUT + 12)
543 |
544 |
545 | #define IDM_SETTING (IDM + 8000)
546 | // #define IDM_SETTING_TAB_SIZE (IDM_SETTING + 1)
547 | // #define IDM_SETTING_TAB_REPLCESPACE (IDM_SETTING + 2)
548 | // #define IDM_SETTING_HISTORY_SIZE (IDM_SETTING + 3)
549 | // #define IDM_SETTING_EDGE_SIZE (IDM_SETTING + 4)
550 | #define IDM_SETTING_IMPORTPLUGIN (IDM_SETTING + 5)
551 | #define IDM_SETTING_IMPORTSTYLETHEMS (IDM_SETTING + 6)
552 | #define IDM_SETTING_TRAYICON (IDM_SETTING + 8)
553 | #define IDM_SETTING_SHORTCUT_MAPPER (IDM_SETTING + 9)
554 | #define IDM_SETTING_REMEMBER_LAST_SESSION (IDM_SETTING + 10)
555 | #define IDM_SETTING_PREFERENCE (IDM_SETTING + 11)
556 | #define IDM_SETTING_OPENPLUGINSDIR (IDM_SETTING + 14)
557 | #define IDM_SETTING_PLUGINADM (IDM_SETTING + 15)
558 | #define IDM_SETTING_SHORTCUT_MAPPER_MACRO (IDM_SETTING + 16)
559 | #define IDM_SETTING_SHORTCUT_MAPPER_RUN (IDM_SETTING + 17)
560 | #define IDM_SETTING_EDITCONTEXTMENU (IDM_SETTING + 18)
561 |
562 | #define IDM_TOOL (IDM + 8500)
563 | #define IDM_TOOL_MD5_GENERATE (IDM_TOOL + 1)
564 | #define IDM_TOOL_MD5_GENERATEFROMFILE (IDM_TOOL + 2)
565 | #define IDM_TOOL_MD5_GENERATEINTOCLIPBOARD (IDM_TOOL + 3)
566 | #define IDM_TOOL_SHA256_GENERATE (IDM_TOOL + 4)
567 | #define IDM_TOOL_SHA256_GENERATEFROMFILE (IDM_TOOL + 5)
568 | #define IDM_TOOL_SHA256_GENERATEINTOCLIPBOARD (IDM_TOOL + 6)
569 |
570 | #define IDM_EXECUTE (IDM + 9000)
571 |
572 | #define IDM_SYSTRAYPOPUP (IDM + 3100)
573 | #define IDM_SYSTRAYPOPUP_ACTIVATE (IDM_SYSTRAYPOPUP + 1)
574 | #define IDM_SYSTRAYPOPUP_NEWDOC (IDM_SYSTRAYPOPUP + 2)
575 | #define IDM_SYSTRAYPOPUP_NEW_AND_PASTE (IDM_SYSTRAYPOPUP + 3)
576 | #define IDM_SYSTRAYPOPUP_OPENFILE (IDM_SYSTRAYPOPUP + 4)
577 | #define IDM_SYSTRAYPOPUP_CLOSE (IDM_SYSTRAYPOPUP + 5)
578 |
--------------------------------------------------------------------------------
/src/UniConversion.cpp:
--------------------------------------------------------------------------------
1 | // Scintilla source code edit control
2 | /** @file UniConversion.cxx
3 | ** Functions to handle UTF-8 and UTF-16 strings.
4 | **/
5 | // Copyright 1998-2001 by Neil Hodgson
6 | // The License.txt file describes the conditions under which this software may be distributed.
7 |
8 | #include
9 |
10 | #include
11 | #include
12 |
13 | #include "UniConversion.h"
14 |
15 | size_t UTF8Length(const wchar_t *uptr, size_t tlen) {
16 | size_t len = 0;
17 | for (size_t i = 0; i < tlen && uptr[i];) {
18 | const unsigned int uch = uptr[i];
19 | if (uch < 0x80) {
20 | len++;
21 | } else if (uch < 0x800) {
22 | len += 2;
23 | } else if ((uch >= SURROGATE_LEAD_FIRST) &&
24 | (uch <= SURROGATE_TRAIL_LAST)) {
25 | len += 4;
26 | i++;
27 | } else {
28 | len += 3;
29 | }
30 | i++;
31 | }
32 | return len;
33 | }
34 |
35 | void UTF8FromUTF16(const wchar_t *uptr, size_t tlen, char *putf, size_t len) {
36 | size_t k = 0;
37 | for (size_t i = 0; i < tlen && uptr[i];) {
38 | const unsigned int uch = uptr[i];
39 | if (uch < 0x80) {
40 | putf[k++] = static_cast(uch);
41 | } else if (uch < 0x800) {
42 | putf[k++] = static_cast(0xC0 | (uch >> 6));
43 | putf[k++] = static_cast(0x80 | (uch & 0x3f));
44 | } else if ((uch >= SURROGATE_LEAD_FIRST) &&
45 | (uch <= SURROGATE_TRAIL_LAST)) {
46 | // Half a surrogate pair
47 | i++;
48 | const unsigned int xch = 0x10000 + ((uch & 0x3ff) << 10) + (uptr[i] & 0x3ff);
49 | putf[k++] = static_cast(0xF0 | (xch >> 18));
50 | putf[k++] = static_cast(0x80 | ((xch >> 12) & 0x3f));
51 | putf[k++] = static_cast(0x80 | ((xch >> 6) & 0x3f));
52 | putf[k++] = static_cast(0x80 | (xch & 0x3f));
53 | } else {
54 | putf[k++] = static_cast(0xE0 | (uch >> 12));
55 | putf[k++] = static_cast(0x80 | ((uch >> 6) & 0x3f));
56 | putf[k++] = static_cast(0x80 | (uch & 0x3f));
57 | }
58 | i++;
59 | }
60 | if (k < len)
61 | putf[k] = '\0';
62 | }
63 |
64 | void UTF8FromUTF32Character(int uch, char *putf) {
65 | size_t k = 0;
66 | if (uch < 0x80) {
67 | putf[k++] = static_cast(uch);
68 | } else if (uch < 0x800) {
69 | putf[k++] = static_cast(0xC0 | (uch >> 6));
70 | putf[k++] = static_cast(0x80 | (uch & 0x3f));
71 | } else if (uch < 0x10000) {
72 | putf[k++] = static_cast(0xE0 | (uch >> 12));
73 | putf[k++] = static_cast(0x80 | ((uch >> 6) & 0x3f));
74 | putf[k++] = static_cast(0x80 | (uch & 0x3f));
75 | } else {
76 | putf[k++] = static_cast(0xF0 | (uch >> 18));
77 | putf[k++] = static_cast(0x80 | ((uch >> 12) & 0x3f));
78 | putf[k++] = static_cast(0x80 | ((uch >> 6) & 0x3f));
79 | putf[k++] = static_cast(0x80 | (uch & 0x3f));
80 | }
81 | putf[k] = '\0';
82 | }
83 |
84 | size_t UTF16Length(const char *s, size_t len) {
85 | size_t ulen = 0;
86 | for (size_t i = 0; i < len;) {
87 | const unsigned char ch = s[i];
88 | const unsigned int byteCount = UTF8BytesOfLead[ch];
89 | const unsigned int utf16Len = UTF16LengthFromUTF8ByteCount(byteCount);
90 | i += byteCount;
91 | ulen += (i > len) ? 1 : utf16Len;
92 | }
93 | return ulen;
94 | }
95 |
96 | constexpr unsigned char TrailByteValue(unsigned char c) {
97 | // The top 2 bits are 0b10 to indicate a trail byte.
98 | // The lower 6 bits contain the value.
99 | return c & 0x3F;
100 | }
101 |
102 | size_t UTF16FromUTF8(const char *s, size_t len, wchar_t *tbuf, size_t tlen) {
103 | size_t ui = 0;
104 | for (size_t i = 0; i < len;) {
105 | unsigned char ch = s[i];
106 | const unsigned int byteCount = UTF8BytesOfLead[ch];
107 | unsigned int value;
108 |
109 | if (i + byteCount > len) {
110 | // Trying to read past end but still have space to write
111 | if (ui < tlen) {
112 | tbuf[ui] = ch;
113 | ui++;
114 | }
115 | break;
116 | }
117 |
118 | const size_t outLen = UTF16LengthFromUTF8ByteCount(byteCount);
119 | if (ui + outLen > tlen) {
120 | throw std::runtime_error("UTF16FromUTF8: attempted write beyond end");
121 | }
122 |
123 | i++;
124 | switch (byteCount) {
125 | case 1:
126 | tbuf[ui] = ch;
127 | break;
128 | case 2:
129 | value = (ch & 0x1F) << 6;
130 | ch = s[i++];
131 | value += TrailByteValue(ch);
132 | tbuf[ui] = static_cast(value);
133 | break;
134 | case 3:
135 | value = (ch & 0xF) << 12;
136 | ch = s[i++];
137 | value += (TrailByteValue(ch) << 6);
138 | ch = s[i++];
139 | value += TrailByteValue(ch);
140 | tbuf[ui] = static_cast(value);
141 | break;
142 | default:
143 | // Outside the BMP so need two surrogates
144 | value = (ch & 0x7) << 18;
145 | ch = s[i++];
146 | value += TrailByteValue(ch) << 12;
147 | ch = s[i++];
148 | value += TrailByteValue(ch) << 6;
149 | ch = s[i++];
150 | value += TrailByteValue(ch);
151 | tbuf[ui] = static_cast(((value - 0x10000) >> 10) + SURROGATE_LEAD_FIRST);
152 | ui++;
153 | tbuf[ui] = static_cast((value & 0x3ff) + SURROGATE_TRAIL_FIRST);
154 | break;
155 | }
156 | ui++;
157 | }
158 | return ui;
159 | }
160 |
161 | size_t UTF32FromUTF8(const char *s, size_t len, unsigned int *tbuf, size_t tlen) {
162 | size_t ui = 0;
163 | for (size_t i = 0; i < len;) {
164 | unsigned char ch = s[i];
165 | const unsigned int byteCount = UTF8BytesOfLead[ch];
166 | unsigned int value;
167 |
168 | if (i + byteCount > len) {
169 | // Trying to read past end but still have space to write
170 | if (ui < tlen) {
171 | tbuf[ui] = ch;
172 | ui++;
173 | }
174 | break;
175 | }
176 |
177 | if (ui == tlen) {
178 | throw std::runtime_error("UTF32FromUTF8: attempted write beyond end");
179 | }
180 |
181 | i++;
182 | switch (byteCount) {
183 | case 1:
184 | value = ch;
185 | break;
186 | case 2:
187 | value = (ch & 0x1F) << 6;
188 | ch = s[i++];
189 | value += TrailByteValue(ch);
190 | break;
191 | case 3:
192 | value = (ch & 0xF) << 12;
193 | ch = s[i++];
194 | value += TrailByteValue(ch) << 6;
195 | ch = s[i++];
196 | value += TrailByteValue(ch);
197 | break;
198 | default:
199 | value = (ch & 0x7) << 18;
200 | ch = s[i++];
201 | value += TrailByteValue(ch) << 12;
202 | ch = s[i++];
203 | value += TrailByteValue(ch) << 6;
204 | ch = s[i++];
205 | value += TrailByteValue(ch);
206 | break;
207 | }
208 | tbuf[ui] = value;
209 | ui++;
210 | }
211 | return ui;
212 | }
213 |
214 | unsigned int UTF16FromUTF32Character(unsigned int val, wchar_t *tbuf) noexcept {
215 | if (val < SUPPLEMENTAL_PLANE_FIRST) {
216 | tbuf[0] = static_cast(val);
217 | return 1;
218 | } else {
219 | tbuf[0] = static_cast(((val - SUPPLEMENTAL_PLANE_FIRST) >> 10) + SURROGATE_LEAD_FIRST);
220 | tbuf[1] = static_cast((val & 0x3ff) + SURROGATE_TRAIL_FIRST);
221 | return 2;
222 | }
223 | }
224 |
225 | const unsigned char UTF8BytesOfLead[256] = {
226 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 00 - 0F
227 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 10 - 1F
228 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 20 - 2F
229 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 30 - 3F
230 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 40 - 4F
231 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 50 - 5F
232 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 60 - 6F
233 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 70 - 7F
234 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 80 - 8F
235 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 90 - 9F
236 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // A0 - AF
237 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // B0 - BF
238 | 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, // C0 - CF
239 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, // D0 - DF
240 | 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, // E0 - EF
241 | 4, 4, 4, 4, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // F0 - FF
242 | };
243 |
244 | // Return both the width of the first character in the string and a status
245 | // saying whether it is valid or invalid.
246 | // Most invalid sequences return a width of 1 so are treated as isolated bytes but
247 | // the non-characters *FFFE, *FFFF and FDD0 .. FDEF return 3 or 4 as they can be
248 | // reasonably treated as code points in some circumstances. They will, however,
249 | // not have associated glyphs.
250 | int UTF8Classify(const unsigned char *us, size_t len) noexcept {
251 | // For the rules: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
252 | if (us[0] < 0x80) {
253 | // ASCII
254 | return 1;
255 | }
256 |
257 | const size_t byteCount = UTF8BytesOfLead[us[0]];
258 | if (byteCount == 1 || byteCount > len) {
259 | // Invalid lead byte
260 | return UTF8MaskInvalid | 1;
261 | }
262 |
263 | if (!UTF8IsTrailByte(us[1])) {
264 | // Invalid trail byte
265 | return UTF8MaskInvalid | 1;
266 | }
267 |
268 | switch (byteCount) {
269 | case 2:
270 | return 2;
271 |
272 | case 3:
273 | if (UTF8IsTrailByte(us[2])) {
274 | if ((*us == 0xe0) && ((us[1] & 0xe0) == 0x80)) {
275 | // Overlong
276 | return UTF8MaskInvalid | 1;
277 | }
278 | if ((*us == 0xed) && ((us[1] & 0xe0) == 0xa0)) {
279 | // Surrogate
280 | return UTF8MaskInvalid | 1;
281 | }
282 | if ((*us == 0xef) && (us[1] == 0xbf) && (us[2] == 0xbe)) {
283 | // U+FFFE non-character - 3 bytes long
284 | return UTF8MaskInvalid | 3;
285 | }
286 | if ((*us == 0xef) && (us[1] == 0xbf) && (us[2] == 0xbf)) {
287 | // U+FFFF non-character - 3 bytes long
288 | return UTF8MaskInvalid | 3;
289 | }
290 | if ((*us == 0xef) && (us[1] == 0xb7) && (((us[2] & 0xf0) == 0x90) || ((us[2] & 0xf0) == 0xa0))) {
291 | // U+FDD0 .. U+FDEF
292 | return UTF8MaskInvalid | 3;
293 | }
294 | return 3;
295 | }
296 | break;
297 |
298 | default:
299 | if (UTF8IsTrailByte(us[2]) && UTF8IsTrailByte(us[3])) {
300 | if (((us[1] & 0xf) == 0xf) && (us[2] == 0xbf) && ((us[3] == 0xbe) || (us[3] == 0xbf))) {
301 | // *FFFE or *FFFF non-character
302 | return UTF8MaskInvalid | 4;
303 | }
304 | if (*us == 0xf4) {
305 | // Check if encoding a value beyond the last Unicode character 10FFFF
306 | if (us[1] > 0x8f) {
307 | return UTF8MaskInvalid | 1;
308 | }
309 | } else if ((*us == 0xf0) && ((us[1] & 0xf0) == 0x80)) {
310 | // Overlong
311 | return UTF8MaskInvalid | 1;
312 | }
313 | return 4;
314 | }
315 | break;
316 | }
317 |
318 | return UTF8MaskInvalid | 1;
319 | }
320 |
321 | int UTF8DrawBytes(const unsigned char *us, int len) noexcept {
322 | const int utf8StatusNext = UTF8Classify(us, len);
323 | return (utf8StatusNext & UTF8MaskInvalid) ? 1 : (utf8StatusNext & UTF8MaskWidth);
324 | }
325 |
326 | bool UTF8IsValid(const char *s, size_t len) noexcept {
327 | const unsigned char *us = reinterpret_cast(s);
328 | size_t remaining = len;
329 | while (remaining > 0) {
330 | const int utf8Status = UTF8Classify(us, remaining);
331 | if (utf8Status & UTF8MaskInvalid) {
332 | return false;
333 | } else {
334 | const int lenChar = utf8Status & UTF8MaskWidth;
335 | us += lenChar;
336 | remaining -= lenChar;
337 | }
338 | }
339 | return remaining == 0;
340 | }
341 |
342 | // Replace invalid bytes in UTF-8 with the replacement character
343 | std::string FixInvalidUTF8(const std::string &text) {
344 | std::string result;
345 | const char *s = text.c_str();
346 | size_t remaining = text.size();
347 | while (remaining > 0) {
348 | const int utf8Status = UTF8Classify(reinterpret_cast(s), remaining);
349 | if (utf8Status & UTF8MaskInvalid) {
350 | // Replacement character 0xFFFD = UTF8:"efbfbd".
351 | result.append("\xef\xbf\xbd");
352 | s++;
353 | remaining--;
354 | } else {
355 | const size_t len = utf8Status & UTF8MaskWidth;
356 | result.append(s, len);
357 | s += len;
358 | remaining -= len;
359 | }
360 | }
361 | return result;
362 | }
363 |
--------------------------------------------------------------------------------
/src/UniConversion.h:
--------------------------------------------------------------------------------
1 | // Scintilla source code edit control
2 | /** @file UniConversion.h
3 | ** Functions to handle UTF-8 and UTF-16 strings.
4 | **/
5 | // Copyright 1998-2001 by Neil Hodgson
6 | // The License.txt file describes the conditions under which this software may be distributed.
7 |
8 | #ifndef UNICONVERSION_H
9 | #define UNICONVERSION_H
10 |
11 | const int UTF8MaxBytes = 4;
12 |
13 | const int unicodeReplacementChar = 0xFFFD;
14 |
15 | size_t UTF8Length(const wchar_t *uptr, size_t tlen);
16 | void UTF8FromUTF16(const wchar_t *uptr, size_t tlen, char *putf, size_t len);
17 | void UTF8FromUTF32Character(int uch, char *putf);
18 | size_t UTF16Length(const char *s, size_t len);
19 | size_t UTF16FromUTF8(const char *s, size_t len, wchar_t *tbuf, size_t tlen);
20 | size_t UTF32FromUTF8(const char *s, size_t len, unsigned int *tbuf, size_t tlen);
21 | unsigned int UTF16FromUTF32Character(unsigned int val, wchar_t *tbuf) noexcept;
22 | bool UTF8IsValid(const char *s, size_t len) noexcept;
23 | std::string FixInvalidUTF8(const std::string &text);
24 |
25 | extern const unsigned char UTF8BytesOfLead[256];
26 |
27 | inline int UnicodeFromUTF8(const unsigned char *us) noexcept {
28 | switch (UTF8BytesOfLead[us[0]]) {
29 | case 1:
30 | return us[0];
31 | case 2:
32 | return ((us[0] & 0x1F) << 6) + (us[1] & 0x3F);
33 | case 3:
34 | return ((us[0] & 0xF) << 12) + ((us[1] & 0x3F) << 6) + (us[2] & 0x3F);
35 | default:
36 | return ((us[0] & 0x7) << 18) + ((us[1] & 0x3F) << 12) + ((us[2] & 0x3F) << 6) + (us[3] & 0x3F);
37 | }
38 | }
39 |
40 | inline constexpr bool UTF8IsTrailByte(unsigned char ch) noexcept {
41 | return (ch >= 0x80) && (ch < 0xc0);
42 | }
43 |
44 | inline constexpr bool UTF8IsAscii(int ch) noexcept {
45 | return ch < 0x80;
46 | }
47 |
48 | enum { UTF8MaskWidth=0x7, UTF8MaskInvalid=0x8 };
49 | int UTF8Classify(const unsigned char *us, size_t len) noexcept;
50 |
51 | // Similar to UTF8Classify but returns a length of 1 for invalid bytes
52 | // instead of setting the invalid flag
53 | int UTF8DrawBytes(const unsigned char *us, int len) noexcept;
54 |
55 | // Line separator is U+2028 \xe2\x80\xa8
56 | // Paragraph separator is U+2029 \xe2\x80\xa9
57 | const int UTF8SeparatorLength = 3;
58 | inline bool UTF8IsSeparator(const unsigned char *us) noexcept {
59 | return (us[0] == 0xe2) && (us[1] == 0x80) && ((us[2] == 0xa8) || (us[2] == 0xa9));
60 | }
61 |
62 | // NEL is U+0085 \xc2\x85
63 | const int UTF8NELLength = 2;
64 | inline bool UTF8IsNEL(const unsigned char *us) noexcept {
65 | return (us[0] == 0xc2) && (us[1] == 0x85);
66 | }
67 |
68 | enum { SURROGATE_LEAD_FIRST = 0xD800 };
69 | enum { SURROGATE_LEAD_LAST = 0xDBFF };
70 | enum { SURROGATE_TRAIL_FIRST = 0xDC00 };
71 | enum { SURROGATE_TRAIL_LAST = 0xDFFF };
72 | enum { SUPPLEMENTAL_PLANE_FIRST = 0x10000 };
73 |
74 | inline constexpr unsigned int UTF16CharLength(wchar_t uch) noexcept {
75 | return ((uch >= SURROGATE_LEAD_FIRST) && (uch <= SURROGATE_LEAD_LAST)) ? 2 : 1;
76 | }
77 |
78 | inline constexpr unsigned int UTF16LengthFromUTF8ByteCount(unsigned int byteCount) noexcept {
79 | return (byteCount < 4) ? 1 : 2;
80 | }
81 |
82 | #endif
83 |
--------------------------------------------------------------------------------
/src/Version.h:
--------------------------------------------------------------------------------
1 | // This file is part of BetterMultiSelection.
2 | //
3 | // Copyright (C)2017 Justin Dailey
4 | //
5 | // BetterMultiSelection is free software; you can redistribute it and/or
6 | // modify it under the terms of the GNU General Public License
7 | // as published by the Free Software Foundation; either
8 | // version 2 of the License, or (at your option) any later version.
9 | //
10 | // This program is distributed in the hope that it will be useful,
11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | // GNU General Public License for more details.
14 | //
15 | // You should have received a copy of the GNU General Public License
16 | // along with this program; if not, write to the Free Software
17 | // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 |
19 | #define VERSION_NUM 1,5,0,0
20 | #define VERSION_LINEAR 1500
21 | #define VERSION_LINEAR_TEXT TEXT("1500")
22 | #define VERSION_TEXT TEXT("1.5")
23 | #define VERSION_STAGE TEXT("") // "alpha", "beta", ""
24 |
--------------------------------------------------------------------------------