├── .gitignore
├── DoxyIt.sln
├── LICENSE
├── README.md
├── appveyor.yml
├── img
├── Demo.gif
├── Demo2.gif
└── Settings.png
├── src
├── Dialogs
│ ├── AboutDialog.cpp
│ ├── AboutDialog.h
│ ├── Hyperlinks.cpp
│ ├── Hyperlinks.h
│ ├── SettingsDialog.cpp
│ ├── SettingsDialog.h
│ ├── StaticDialog.cpp
│ ├── StaticDialog.h
│ ├── Version.rc
│ ├── Window.h
│ ├── resource.h
│ └── resource.rc
├── DoxyIt.cpp
├── DoxyIt.vcxproj
├── DoxyIt.vcxproj.filters
├── JumpLocations.cpp
├── JumpLocations.h
├── Npp
│ ├── Notepad_plus_msgs.h
│ ├── PluginInterface.h
│ ├── Sci_Position.h
│ ├── Scintilla.h
│ └── menuCmdID.h
├── Parsers
│ ├── C_Parser.cpp
│ ├── Null_Parser.cpp
│ ├── Parsers.cpp
│ ├── Parsers.h
│ └── Python_Parser.cpp
├── PluginDefinition.cpp
├── PluginDefinition.h
├── ScintillaEditor.h
├── Utilities
│ ├── Utils.cpp
│ ├── Utils.h
│ ├── trex.cpp
│ └── trex.h
└── Version.h
└── tests
├── test.c
├── test.cpp
├── test.cs
├── test.java
├── test.js
├── test.php
└── test.py
/.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 |
290 |
291 | /Unicode Realeas
292 | /Unicode Release
293 | /ResEdit-x64
294 |
--------------------------------------------------------------------------------
/DoxyIt.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 15
4 | VisualStudioVersion = 15.0.28307.645
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DoxyIt", "src\DoxyIt.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 | # DoxyIt
2 |
3 | [](https://ci.appveyor.com/project/dail8859/doxyit)
4 |
5 | Notepad++ plugin for [Doxygen](http://www.doxygen.org) commenting. This also provides helpful features for creating and editing comment blocks, even if Doxygen isn't desired.
6 |
7 | The release versions of DoxyIt can be downloaded [here](https://github.com/dail8859/DoxyIt/releases).
8 |
9 | Currently there is support for:
10 | - C
11 | - C++
12 | - Python
13 | - Java
14 | - PHP
15 | - JavaScript
16 | - C#
17 | - User Defined Languages
18 |
19 | **Note:** DoxyIt uses very simplistic parsing mechanisms and does not enforce valid language syntax, meaning it can easily be fooled. Thus, it is up to the user to ensure the function/method is syntactically valid when attempting to generate Doxygen function commenting as described below.
20 |
21 | ## Usage
22 | ### Doxygen Function Commenting
23 | Just start by opening a function block above the function.
24 |
25 | 
26 |
27 | You can also manually trigger the function documentation (this is sometimes required for specific settings). Place the cursor on the line directly above the function definition and press `Ctrl+Alt+Shift+D` (or through the menu command *Plugins > DoxyIt > DoxyIt - Function*).
28 |
29 | **Note:** Function commenting for User Defined Languages inserts a comment block but does not parse any text.
30 |
31 | ### Doxygen File Commenting
32 | Using the menu command *Plugins > DoxyIt > DoxyIt - File* will insert a Doxygen comment block for the file at the current cursor position.
33 |
34 | ### Active Commenting
35 | Even if Doxygen commands aren't desired, you can still take advantage of the active commenting feature. A new comment block can be started by typing the opening string and pressing `Enter`. Adding a new line within the block will extend it.
36 |
37 | 
38 |
39 | **Note:** If DoxyIt is configured to use long strings to indicate the start of a comment block, only the first 3 characters need to be typed.
40 |
41 | ## Settings
42 | Each language can be configured to have any string to indicate the start, middle, and end of a document block. The settings dialog also provides a live preview of what a documentation block would look like:
43 |
44 | 
45 |
46 | ### Doxygen Commenting Format
47 | The format string is used to customize the Doxygen Function Commenting block generated. There are currently a few keywords that are used.
48 | - `$FILENAME` - The current file name.
49 | - `$FUNCTION` - The name of the function/method.
50 | - `$PARAM` - Expands to a single function/method parameter. Any line containing this will get repeated for each parameter.
51 | - `$COMPUTER` - Current computer name.
52 | - `$USER` - User account name of current user (for example, smith).
53 | - `$FULLUSER` - Full user name of current user (for example, Jeff Smith).
54 | - `$DATE` - Current date and time, format ISO 8601 (for example, 2009-06-30T18:30:00).
55 | - `$DATE_a` - Abbreviated weekday name
56 | - `$DATE_A` - Full weekday name
57 | - `$DATE_b` - Abbreviated month name
58 | - `$DATE_B` - Full month name
59 | - `$DATE_c` - Date and time representation appropriate for locale
60 | - `$DATE_d` - Day of month as decimal number (01 - 31)
61 | - `$DATE_H` - Hour in 24-hour format (00 - 23)
62 | - `$DATE_I` - Hour in 12-hour format (01 - 12)
63 | - `$DATE_j` - Day of year as decimal number (001 - 366)
64 | - `$DATE_m` - Month as decimal number (01 - 12)
65 | - `$DATE_M` - Minute as decimal number (00 - 59)
66 | - `$DATE_p` - Current locale's A.M./P.M. indicator for 12-hour clock
67 | - `$DATE_S` - Second as decimal number (00 - 59)
68 | - `$DATE_U` - Week of year as decimal number, with Sunday as first day of week (00 - 53)
69 | - `$DATE_w` - Weekday as decimal number (0 - 6; Sunday is 0)
70 | - `$DATE_W` - Week of year as decimal number, with Monday as first day of week (00 - 53)
71 | - `$DATE_x` - Date representation for current locale
72 | - `$DATE_X` - Time representation for current locale
73 | - `$DATE_y` - Year without century, as decimal number (00 - 99)
74 | - `$DATE_Y` - Year with century, as decimal number
75 | - `$DATE_z`, `$DATE_Z` - Either the time-zone name or time zone abbreviation, depending on registry settings; no characters if time zone is unknown
76 | - `$@` - Expands to the prefix character for Doxygen commands.
77 | - `$|` - Marks the alignment position. This flag is only valid for lines containing $PARAM.
78 | - `$(...)` - Defines a location to jump to when pressing the Tab key. Text within the parenthesis is used as a default value.
79 |
80 | Not all keywords are valid for User Defined Languages.
81 |
82 | ### Jump Locations
83 | The function and file formats can specify jump locations. These are areas of text that can be jumped to by pressing the `Tab` key. Using `$(...)` will use the text within the parenthesis as a default value for the location. Jump locations with the same default text will be edited simultaneously. Pressing the `Esc` key will remove all marked jump locations.
84 |
85 | ### UDL Support
86 | Custom UDLs can be added by pressing the `+` button next to the list of supported languages. The name entered for the UDL must match the name of the desired UDL. Pressing the `-` button will remove the selected UDL. Function commenting is partially supported for UDLs. It will insert a comment block at the current location but will not attempt to parse any text.
87 |
88 | ## Installation
89 | Use the built in Plugin Admin to install the plugin.
90 |
91 | ## Development
92 | The code is developed using Visual Studio 2017. Building the code will generate a DLL which can be used by Notepad++. For convenience, Visual Studio copies the DLL into the Notepad++ plugin directory.
93 |
94 | ## License
95 | This code is released under the [GNU General Public License version 2](http://www.gnu.org/licenses/gpl-2.0.txt).
96 |
97 | The [T-Rex Regular Expression library](http://tiny-rex.sourceforge.net/) used in this project has been released under the [zlib/libpng License](http://opensource.org/licenses/zlib-license.php). (C) 2003-2006 Alberto Demichelis
98 |
--------------------------------------------------------------------------------
/appveyor.yml:
--------------------------------------------------------------------------------
1 | version: 0.4.4.{build}
2 | image: Visual Studio 2017
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\2017\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 DoxyIt.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)\DoxyIt.dll" -FileName DoxyIt.dll
36 |
37 | if ($($env:APPVEYOR_REPO_TAG) -eq "true" -and $env:CONFIGURATION -eq "Release") {
38 | if ($env:BUILD_PLATFORM -eq "x64"){
39 | $ZipFileName = "DoxyIt_$($env:APPVEYOR_REPO_TAG_NAME)_x64.zip"
40 | }
41 | if ($env:BUILD_PLATFORM -eq "Win32"){
42 | $ZipFileName = "DoxyIt_$($env:APPVEYOR_REPO_TAG_NAME).zip"
43 | }
44 | 7z a $ZipFileName "$($BuildPath)\DoxyIt.dll"
45 | }
46 |
47 | artifacts:
48 | - path: DoxyIt*.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
--------------------------------------------------------------------------------
/img/Demo.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dail8859/DoxyIt/8c251ad6ee8eef6aef2d5b4cad73017c42a87450/img/Demo.gif
--------------------------------------------------------------------------------
/img/Demo2.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dail8859/DoxyIt/8c251ad6ee8eef6aef2d5b4cad73017c42a87450/img/Demo2.gif
--------------------------------------------------------------------------------
/img/Settings.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dail8859/DoxyIt/8c251ad6ee8eef6aef2d5b4cad73017c42a87450/img/Settings.png
--------------------------------------------------------------------------------
/src/Dialogs/AboutDialog.cpp:
--------------------------------------------------------------------------------
1 | // This file is part of DoxyIt.
2 | //
3 | // Copyright (C)2013 Justin Dailey
4 | //
5 | // DoxyIt 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 "PluginDefinition.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("DoxyIt 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/DoxyIt/"), NULL, NULL, SW_SHOWNORMAL);
45 | return true;
46 | case IDC_README:
47 | ShellExecute(hwndDlg, TEXT("open"), TEXT("https://github.com/dail8859/DoxyIt/blob/v") VERSION_TEXT TEXT("/README.md"), NULL, NULL, SW_SHOWNORMAL);
48 | return true;
49 | }
50 | case WM_DESTROY:
51 | DestroyWindow(hwndDlg);
52 | return true;
53 | }
54 | return false;
55 | }
56 |
--------------------------------------------------------------------------------
/src/Dialogs/AboutDialog.h:
--------------------------------------------------------------------------------
1 | // This file is part of DoxyIt.
2 | //
3 | // Copyright (C)2013 Justin Dailey
4 | //
5 | // DoxyIt 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 | #ifndef ABOUTDIALOG_H
20 | #define ABOUTDIALOG_H
21 |
22 | INT_PTR CALLBACK abtDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
23 |
24 | #endif
--------------------------------------------------------------------------------
/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/SettingsDialog.cpp:
--------------------------------------------------------------------------------
1 | // This file is part of DoxyIt.
2 | //
3 | // Copyright (C)2013 Justin Dailey
4 | //
5 | // DoxyIt 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 "SettingsDialog.h"
21 | #include "PluginDefinition.h"
22 | #include "Hyperlinks.h"
23 |
24 | const wchar_t *msg = TEXT("An option is blank (or all whitespace). If this is desired, it is recommended that you disable Active Commenting! Continue anyways?");
25 | const wchar_t *help = TEXT("\
26 | Format Keywords:\r\n\
27 | $FILENAME - The current file name.\r\n\
28 | $FUNCTION - The name of the function/method.\r\n\
29 | $PARAM - Expands to a single function/method parameter. Any line containing this will get repeated for each parameter.\r\n\
30 | $COMPUTER - Current computer name.\r\n\
31 | $USER - User account name of current user.\r\n\
32 | $FULLUSER - full user name of current user.\r\n\
33 | $DATE - Current date and time, format ISO 8601.\r\n\
34 | $DATE_a - Abbreviated weekday name\r\n\
35 | $DATE_A - Full weekday name\r\n\
36 | $DATE_b - Abbreviated month name\r\n\
37 | $DATE_B - Full month name\r\n\
38 | $DATE_c - Date and time representation appropriate for locale\r\n\
39 | $DATE_d - Day of month as decimal number (01 - 31)\r\n\
40 | $DATE_H - Hour in 24 - hour format (00 - 23)\r\n\
41 | $DATE_I - Hour in 12 - hour format (01 - 12)\r\n\
42 | $DATE_j - Day of year as decimal number (001 - 366)\r\n\
43 | $DATE_m - Month as decimal number (01 - 12)\r\n\
44 | $DATE_M - Minute as decimal number (00 - 59)\r\n\
45 | $DATE_p - Current locale's A.M./P.M. indicator for 12-hour clock\r\n\
46 | $DATE_S - Second as decimal number (00 - 59)\r\n\
47 | $DATE_U - Week of year as decimal number, with Sunday as first day of week (00 - 53)\r\n\
48 | $DATE_w - Weekday as decimal number (0 - 6; Sunday is 0)\r\n\
49 | $DATE_W - Week of year as decimal number, with Monday as first day of week (00 - 53)\r\n\
50 | $DATE_x - Date representation for current locale\r\n\
51 | $DATE_X - Time representation for current locale\r\n\
52 | $DATE_y - Year without century, as decimal number (00 - 99)\r\n\
53 | $DATE_Y - Year with century, as decimal number\r\n\
54 | $DATE_z, $DATE_Z - Either the time - zone name or time zone abbreviation, depending on registry settings; no characters if time zone is unknown\r\n\
55 | $@ - Expands to the prefix character for Doxygen commands.\r\n\
56 | $| - Marks the alignment position. This is only valid for lines containing $PARAM.\r\n\
57 | \r\n\
58 | $(...) - Defines a location to jump to when pressing the Tab key. Text within the parenthesis is used as a default value.\r\n\
59 | \r\n");
60 |
61 |
62 | INT_PTR CALLBACK inputDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
63 | {
64 | switch(uMsg)
65 | {
66 | case WM_INITDIALOG:
67 | SetFocus(GetDlgItem(hwndDlg, IDC_EDIT_LANG));
68 | Edit_LimitText(GetDlgItem(hwndDlg, IDC_EDIT_LANG), 30);
69 | return true;
70 | case WM_COMMAND:
71 | switch(LOWORD(wParam))
72 | {
73 | case IDOK:
74 | {
75 | wchar_t *text;
76 | int len = Edit_GetTextLength(GetDlgItem(hwndDlg, IDC_EDIT_LANG));
77 |
78 | text = new wchar_t[len + 1];
79 | Edit_GetText(GetDlgItem(hwndDlg, IDC_EDIT_LANG), text, len + 1);
80 | EndDialog(hwndDlg, (INT_PTR) text);
81 | return true;
82 | }
83 | default:
84 | return false;
85 | }
86 | case WM_CLOSE:
87 | case WM_DESTROY:
88 | EndDialog(hwndDlg, NULL);
89 | return true;
90 | }
91 |
92 | return false;
93 | }
94 |
95 | void SettingsDialog::init(HINSTANCE hInst, NppData nppData)
96 | {
97 | _nppData = nppData;
98 | Window::init(hInst, nppData._nppHandle);
99 | }
100 |
101 | void SettingsDialog::doDialog()
102 | {
103 | if (!isCreated()) create(IDD_SETTINGSDLG);
104 | goToCenter();
105 |
106 | initParserSettings();
107 | loadParserSettings();
108 | updatePreview();
109 | }
110 |
111 | void SettingsDialog::initParserSettings()
112 | {
113 | _parserSettings.clear();
114 | for(unsigned int i = 0; i < parsers.size(); ++i)
115 | _parserSettings.push_back(parsers[i].ps);
116 | }
117 |
118 | void SettingsDialog::storeParserSettings(int index)
119 | {
120 | wchar_t *dtext;
121 | wchar_t text[256]; // Edit_LimitText is used to limit to 255 chars
122 | int len;
123 |
124 | ParserSettings *prev_ps = &_parserSettings[index];
125 |
126 | Edit_GetText(GetDlgItem(_hSelf, IDC_EDIT_START), text, 256);
127 | prev_ps->doc_start = toString(text);
128 |
129 | Edit_GetText(GetDlgItem(_hSelf, IDC_EDIT_LINE), text, 256);
130 | prev_ps->doc_line = toString(text);
131 |
132 | Edit_GetText(GetDlgItem(_hSelf, IDC_EDIT_END), text, 256);
133 | prev_ps->doc_end = toString(text);
134 |
135 | Edit_GetText(GetDlgItem(_hSelf, IDC_EDIT_PREFIX), text, 256);
136 | prev_ps->command_prefix = toString(text);
137 |
138 | len = Edit_GetTextLength(GetDlgItem(_hSelf, IDC_EDIT_FORMAT)) + 1;
139 | dtext = (wchar_t *) malloc(sizeof(wchar_t) * len);
140 | Edit_GetText(GetDlgItem(_hSelf, IDC_EDIT_FORMAT), dtext, len);
141 |
142 | if(Button_GetCheck(GetDlgItem(_hSelf, IDC_RAD_FUNCTION)) == BST_CHECKED)
143 | prev_ps->function_format = toString(dtext);
144 | else
145 | prev_ps->file_format = toString(dtext);
146 |
147 | free(dtext);
148 |
149 | // Go ahead and get the align checkbox even though it doesnt apply to external parsers
150 | prev_ps->align = (Button_GetCheck(GetDlgItem(_hSelf, IDC_CHB_ALIGN)) == BST_CHECKED);
151 | }
152 |
153 | // Note: Setting the text of edit boxes causes notifications to be generated, which update the
154 | // preview multiple times when calling loadParserSettings(). The 'updating' flag is used to
155 | // temporarily ignore notifications.
156 | void SettingsDialog::loadParserSettings()
157 | {
158 | int index = ComboBox_GetCurSel(GetDlgItem(_hSelf, IDC_CMB_LANG));
159 |
160 | _current = &_parserSettings[index];
161 |
162 | // Load the edit controls with the new parsers settings
163 | _updating = true;
164 |
165 | Edit_SetText(GetDlgItem(_hSelf, IDC_EDIT_START), toWideString(_current->doc_start).c_str());
166 | Edit_SetText(GetDlgItem(_hSelf, IDC_EDIT_LINE), toWideString(_current->doc_line).c_str());
167 | Edit_SetText(GetDlgItem(_hSelf, IDC_EDIT_END), toWideString(_current->doc_end).c_str());
168 | Edit_SetText(GetDlgItem(_hSelf, IDC_EDIT_PREFIX), toWideString(_current->command_prefix).c_str());
169 |
170 | Button_SetCheck(GetDlgItem(_hSelf, IDC_CHB_ALIGN), _current->align); // Cannot be last! Doesn't update preview
171 |
172 | if(Button_GetCheck(GetDlgItem(_hSelf, IDC_RAD_FUNCTION)) == BST_CHECKED)
173 | Edit_SetText(GetDlgItem(_hSelf, IDC_EDIT_FORMAT), toWideString(_current->function_format).c_str());
174 | else
175 | Edit_SetText(GetDlgItem(_hSelf, IDC_EDIT_FORMAT), toWideString(_current->file_format).c_str());
176 |
177 | if(!parsers[index].external)
178 | {
179 | _updating = false; // NOTE: if the main proc ignores the following messages, it does not redraw them correctly
180 | EnableWindow(GetDlgItem(_hSelf, IDC_CHB_ALIGN), TRUE);
181 | EnableWindow(GetDlgItem(_hSelf, IDC_BTN_REMOVE), FALSE);
182 | _updating = true; // just to be safe incase we add anything later
183 | }
184 | else
185 | {
186 | Button_SetCheck(GetDlgItem(_hSelf, IDC_CHB_ALIGN), BST_UNCHECKED);
187 |
188 | _updating = false; // NOTE: if the main proc ignores the following messages, it does not redraw them correctly
189 | EnableWindow(GetDlgItem(_hSelf, IDC_CHB_ALIGN), FALSE);
190 | EnableWindow(GetDlgItem(_hSelf, IDC_BTN_REMOVE), TRUE);
191 | _updating = true; // just to be safe incase we add anything later
192 | }
193 |
194 | _updating = false;
195 | }
196 |
197 | void SettingsDialog::removeParserSettings()
198 | {
199 | int index = ComboBox_GetCurSel(GetDlgItem(_hSelf, IDC_CMB_LANG));
200 |
201 | _parserSettings.erase(_parserSettings.begin() + index);
202 | parsers.erase(parsers.begin() + index);
203 |
204 | ComboBox_DeleteString(GetDlgItem(_hSelf, IDC_CMB_LANG), index);
205 | ComboBox_SetCurSel(GetDlgItem(_hSelf, IDC_CMB_LANG), index - 1);
206 | _previousSelection = index - 1;
207 |
208 | loadParserSettings();
209 | updatePreview();
210 | }
211 |
212 | void SettingsDialog::addParserSettings()
213 | {
214 | wchar_t *text;
215 | HWND cmb = GetDlgItem(_hSelf, IDC_CMB_LANG);
216 |
217 | text = (wchar_t *) DialogBox((HINSTANCE) _hInst, MAKEINTRESOURCE(IDD_NEWLANG), _hSelf, inputDlgProc);
218 | if(text == NULL) return; // user canceled the dialog
219 |
220 | std::wstring name(text);
221 | delete[] text;
222 |
223 | // make sure len > 0 && no white space
224 | if(name.length() == 0 || name.find(TEXT(' ')) != std::string::npos)
225 | {
226 | MessageBox(NULL, TEXT("Error: New language name cannot be blank or contain whitespace."), NPP_PLUGIN_NAME, MB_OK|MB_ICONERROR);
227 | return;
228 | }
229 |
230 | // make sure not already in list (case insensitive!)
231 | for(auto const &p : parsers)
232 | {
233 | if(_wcsicmp(p.lang.c_str(), name.c_str()) == 0)
234 | {
235 | MessageBox(NULL, TEXT("Error: Naming conflict with another language."), NPP_PLUGIN_NAME, MB_OK|MB_ICONERROR);
236 | return;
237 | }
238 | }
239 |
240 | addNewParser(toString(name.c_str()));
241 | _parserSettings.push_back(parsers.back().ps);
242 |
243 | name += TEXT('*');
244 | ComboBox_SetCurSel(cmb, ComboBox_AddString(cmb, name.c_str()));
245 |
246 | // Update the window
247 | storeParserSettings(_previousSelection);
248 | loadParserSettings();
249 | updatePreview();
250 | _previousSelection = ComboBox_GetCurSel(GetDlgItem(_hSelf, IDC_CMB_LANG));
251 |
252 | MessageBox(NULL, TEXT("Please note: Custom configurations do not parse function/method defintions, but can still be used to insert comment blocks."), NPP_PLUGIN_NAME, MB_OK|MB_ICONINFORMATION);
253 | }
254 |
255 | bool SettingsDialog::validateText(std::string text, int idc)
256 | {
257 | if(text.length() != 0 && !isWhiteSpace(text))
258 | return true;
259 |
260 | SetFocus(GetDlgItem(_hSelf, idc));
261 | return false;
262 | }
263 |
264 | bool SettingsDialog::validateSettings()
265 | {
266 | for(unsigned int i = 0; i < parsers.size(); ++i)
267 | {
268 | bool ret = true;
269 | const ParserSettings *ps = &_parserSettings[i];
270 |
271 | if(!validateText(ps->doc_start, IDC_EDIT_START)) ret = false;
272 | if(!validateText(ps->doc_line, IDC_EDIT_LINE)) ret = false;
273 | if(!validateText(ps->doc_end, IDC_EDIT_END)) ret = false;
274 | if(!validateText(ps->command_prefix, IDC_EDIT_PREFIX)) ret = false;
275 |
276 | if(!ret)
277 | {
278 | ComboBox_SetCurSel(GetDlgItem(_hSelf, IDC_CMB_LANG), i);
279 | loadParserSettings();
280 | updatePreview();
281 | return false;
282 | }
283 | }
284 |
285 | return true;
286 | }
287 |
288 | void SettingsDialog::saveSettings()
289 | {
290 | for(unsigned int i = 0; i < parsers.size(); ++i)
291 | parsers[i].ps = _parserSettings[i];
292 | }
293 |
294 | void SettingsDialog::updatePreview()
295 | {
296 | std::string block;
297 | int prev_eol_mode;
298 | int index = ComboBox_GetCurSel(GetDlgItem(_hSelf, IDC_CMB_LANG));
299 |
300 | // Set eol mode to "\r\n" so it will display correctly in the dialogbox
301 | prev_eol_mode = editor.GetEOLMode();
302 | editor.SetEOLMode(SC_EOL_CRLF);
303 |
304 | if(Button_GetCheck(GetDlgItem(_hSelf, IDC_RAD_FUNCTION)) == BST_CHECKED)
305 | {
306 | // Get the parser and have it parse the example
307 | const Parser *p = &parsers[index];
308 |
309 | if(!p->external)
310 | {
311 | block = FormatFunctionBlock(p, _current, p->example.c_str());
312 | block += "\r\n" + p->example;
313 | }
314 | else // External parsers dont have any example text to parse
315 | {
316 | block = FormatFunctionBlock(p, _current, NULL);
317 | }
318 | }
319 | else // IDC_RAD_FILE is set
320 | {
321 | block = FormatFileBlock(_current);
322 | }
323 |
324 | // Restore the eol mode
325 | editor.SetEOLMode(prev_eol_mode);
326 |
327 | // Set the preview
328 | Edit_SetText(GetDlgItem(_hSelf, IDC_EDIT_PREVIEW), toWideString(block).c_str());
329 | }
330 |
331 | void SettingsDialog::swapFormat()
332 | {
333 | wchar_t *text;
334 | unsigned int len;
335 | static int last_rad = IDC_RAD_FUNCTION; // In case the selected radio button is clicked again
336 |
337 | // Get the text length, dynamically allocate it
338 | len = Edit_GetTextLength(GetDlgItem(_hSelf, IDC_EDIT_FORMAT)) + 1;
339 | text = (wchar_t *) malloc(sizeof(wchar_t) * len);
340 | Edit_GetText(GetDlgItem(_hSelf, IDC_EDIT_FORMAT), text, len);
341 |
342 | if(Button_GetCheck(GetDlgItem(_hSelf, IDC_RAD_FUNCTION)) == BST_CHECKED && last_rad == IDC_RAD_FILE)
343 | {
344 | _current->file_format = toString(text);
345 | Edit_SetText(GetDlgItem(_hSelf, IDC_EDIT_FORMAT), toWideString(_current->function_format).c_str());
346 | last_rad = IDC_RAD_FUNCTION;
347 | }
348 | else if(Button_GetCheck(GetDlgItem(_hSelf, IDC_RAD_FILE)) == BST_CHECKED && last_rad == IDC_RAD_FUNCTION)
349 | {
350 | _current->function_format = toString(text);
351 | Edit_SetText(GetDlgItem(_hSelf, IDC_EDIT_FORMAT), toWideString(_current->file_format).c_str());
352 | last_rad = IDC_RAD_FILE;
353 | }
354 |
355 | free(text);
356 | }
357 |
358 | INT_PTR CALLBACK SettingsDialog::run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam)
359 | {
360 | if(_updating) return true;
361 |
362 | switch(message)
363 | {
364 | case WM_INITDIALOG:
365 | {
366 | HWND cmb = GetDlgItem(_hSelf, IDC_CMB_LANG);
367 | long lfHeight = -MulDiv(10, GetDeviceCaps(GetDC(NULL), LOGPIXELSY), 72);
368 |
369 | //for(unsigned int i = 0; i < parsers.size(); ++i)
370 | for(auto const &p : parsers)
371 | {
372 | if(p.external)
373 | {
374 | std::wstring name = p.language_name + TEXT("*");
375 | ComboBox_AddString(cmb, name.c_str());
376 | }
377 | else
378 | {
379 | ComboBox_AddString(cmb, p.language_name.c_str());
380 | }
381 | }
382 | ComboBox_SetCurSel(cmb, _previousSelection);
383 |
384 | // I have no idea what these values do, but these work
385 | _monoFont = CreateFont(lfHeight,0,0,0,0,0,0,0,0,0,0,0,0,TEXT("Courier New"));
386 | SetWindowFont(GetDlgItem(_hSelf, IDC_EDIT_START), _monoFont, false);
387 | SetWindowFont(GetDlgItem(_hSelf, IDC_EDIT_LINE), _monoFont, false);
388 | SetWindowFont(GetDlgItem(_hSelf, IDC_EDIT_END), _monoFont, false);
389 | SetWindowFont(GetDlgItem(_hSelf, IDC_EDIT_PREFIX), _monoFont, false);
390 | SetWindowFont(GetDlgItem(_hSelf, IDC_EDIT_PREVIEW), _monoFont, false);
391 | SetWindowFont(GetDlgItem(_hSelf, IDC_EDIT_FORMAT), _monoFont, false);
392 | SetWindowFont(GetDlgItem(_hSelf, IDC_EDIT_FORMAT), _monoFont, false);
393 | SetWindowFont(GetDlgItem(_hSelf, IDC_BTN_ADD), _monoFont, false);
394 | SetWindowFont(GetDlgItem(_hSelf, IDC_BTN_REMOVE), _monoFont, false);
395 |
396 | // Limit the input boxes
397 | Edit_LimitText(GetDlgItem(_hSelf, IDC_EDIT_START), 255);
398 | Edit_LimitText(GetDlgItem(_hSelf, IDC_EDIT_LINE), 255);
399 | Edit_LimitText(GetDlgItem(_hSelf, IDC_EDIT_END), 255);
400 | Edit_LimitText(GetDlgItem(_hSelf, IDC_EDIT_PREFIX), 1);
401 |
402 | Button_SetCheck(GetDlgItem(_hSelf, IDC_RAD_FUNCTION), BST_CHECKED);
403 |
404 | ConvertStaticToHyperlink(_hSelf, IDC_SETTINGS_HELP);
405 |
406 | return true;
407 | }
408 | case WM_COMMAND:
409 | switch(HIWORD(wParam))
410 | {
411 | case CBN_SELCHANGE:
412 | storeParserSettings(_previousSelection);
413 | loadParserSettings();
414 | updatePreview();
415 | _previousSelection = ComboBox_GetCurSel(GetDlgItem(_hSelf, IDC_CMB_LANG));
416 | return true;
417 | case BN_CLICKED:
418 | switch(LOWORD(wParam))
419 | {
420 | case IDOK:
421 | _previousSelection = ComboBox_GetCurSel(GetDlgItem(_hSelf, IDC_CMB_LANG));
422 | storeParserSettings(_previousSelection);
423 | if(validateSettings())
424 | {
425 | saveSettings();
426 | display(false);
427 | }
428 | else if(MessageBox(_hSelf, msg, NPP_PLUGIN_NAME, MB_YESNO|MB_ICONEXCLAMATION) == IDYES)
429 | {
430 | saveSettings();
431 | display(false);
432 | }
433 | return true;
434 | case IDCANCEL:
435 | display(false);
436 | return true;
437 | case IDC_BTN_ADD:
438 | addParserSettings();
439 | return true;
440 | case IDC_BTN_REMOVE:
441 | {
442 | int index = ComboBox_GetCurSel(GetDlgItem(_hSelf, IDC_CMB_LANG));
443 | std::wstring message = TEXT("Do you want to remove ") + parsers[index].language_name + TEXT("?");
444 |
445 | if(MessageBox(_hSelf, message.c_str(), NPP_PLUGIN_NAME, MB_YESNO|MB_ICONEXCLAMATION) == IDYES)
446 | removeParserSettings();
447 |
448 | return true;
449 | }
450 | case IDC_CHB_ALIGN:
451 | storeParserSettings(ComboBox_GetCurSel(GetDlgItem(_hSelf, IDC_CMB_LANG)));
452 | updatePreview();
453 | return true;
454 | case IDC_RAD_FUNCTION:
455 | case IDC_RAD_FILE:
456 | swapFormat();
457 | updatePreview();
458 | return true;
459 | case IDC_SETTINGS_HELP:
460 | MessageBox(NULL, help, NPP_PLUGIN_NAME, MB_OK);
461 | return true;
462 | }
463 | case EN_CHANGE:
464 | storeParserSettings(_previousSelection);
465 | updatePreview();
466 | return true;
467 | case EN_MAXTEXT:
468 | MessageBeep(MB_ICONERROR);
469 | return true;
470 | }
471 | default:
472 | return StaticDialog::dlgProc(_HSource, message, wParam, lParam);
473 | }
474 |
475 | return false;
476 | }
477 |
--------------------------------------------------------------------------------
/src/Dialogs/SettingsDialog.h:
--------------------------------------------------------------------------------
1 | // This file is part of DoxyIt.
2 | //
3 | // Copyright (C)2013 Justin Dailey
4 | //
5 | // DoxyIt 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 | #ifndef SETTINGSDIALOG_H
20 | #define SETTINGSDIALOG_H
21 |
22 | #include