├── .gitmodules ├── .gitignore ├── doc ├── Menu.png ├── Options.png ├── PlantUmlViewer.png └── PlantUmlViewerDark.png ├── PlantUmlViewer ├── PlantUmlViewer │ ├── Resources │ │ ├── Icon.ico │ │ ├── Image.png │ │ ├── Save.png │ │ ├── Refresh.png │ │ ├── ZoomFit.png │ │ ├── ZoomIn.png │ │ ├── ZoomOut.png │ │ ├── IconFluent.ico │ │ ├── NavigateUp.png │ │ ├── ZoomReset.png │ │ ├── NavigateDown.png │ │ ├── NavigateLeft.png │ │ ├── NavigateRight.png │ │ ├── IconFluentDark.ico │ │ ├── Empty.svg │ │ └── AboutText.rtf │ ├── Forms │ │ ├── Controls │ │ │ ├── LoadingCircle.cs │ │ │ ├── LoadingCircle.designer.cs │ │ │ └── LoadingCircleToolStripMenuItem.cs │ │ ├── ControlsExtensions.cs │ │ ├── AboutWindow.cs │ │ ├── OptionsWindow.cs │ │ ├── PreviewWindow.resx │ │ ├── AboutWindow.resx │ │ └── OptionsWindow.resx │ ├── PluginInfrastructure │ │ ├── DllExport │ │ │ ├── Mono.Cecil.dll │ │ │ ├── NppPlugin.DllExport.dll │ │ │ ├── NppPlugin.DllExport.MSBuild.dll │ │ │ ├── DllExportAttribute.cs │ │ │ └── NppPlugin.DllExport.targets │ │ ├── Commit.md │ │ ├── UnmanagedExports.cs │ │ ├── NppPluginNETBase.cs │ │ ├── ClikeStringArray.cs │ │ ├── Docking_h.cs │ │ ├── NotepadPPGateway.cs │ │ ├── NppPluginNETHelper.cs │ │ └── resource_h.cs │ ├── Settings │ │ ├── OpenExport.cs │ │ ├── PlantUmlViewerSettings.cs │ │ └── SettingsService.cs │ ├── DiagramGeneration │ │ ├── PlantUml │ │ │ ├── ErrorFormat.cs │ │ │ ├── OutputFormat.cs │ │ │ ├── RenderException.cs │ │ │ ├── PlantUmlArguments.cs │ │ │ └── PlantUmlRunner.cs │ │ ├── GeneratedDiagram.cs │ │ └── DiagramGenerator.cs │ ├── ILMergeOrder.txt │ ├── app.config │ ├── Helpers │ │ ├── PathHelper.cs │ │ ├── ProcessHelper.cs │ │ └── ProcessExtensions.cs │ ├── Main.cs │ ├── packages.config │ ├── Properties │ │ ├── AssemblyInfo.cs │ │ ├── Resources.Designer.cs │ │ └── Resources.resx │ ├── Windows │ │ ├── NativeWindowApi.cs │ │ ├── JavaLocator.cs │ │ └── Messages.cs │ ├── AssemblyAttributes.cs │ ├── ILMerge.props │ ├── PlantUmlViewer.cs │ └── PlantUmlViewer.csproj └── PlantUmlViewer.sln ├── .github ├── ISSUE_TEMPLATE │ ├── feature_request.md │ └── bug_report.md ├── dependabot.yml └── workflows │ └── CI_build.yml ├── LICENSE ├── tools └── create_release.py ├── CHANGELOG.md └── README.md /.gitmodules: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.user 2 | *.csproj.bak 3 | 4 | .vs/ 5 | packages/ 6 | obj/ 7 | bin/ 8 | -------------------------------------------------------------------------------- /doc/Menu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Fruchtzwerg94/PlantUmlViewer/HEAD/doc/Menu.png -------------------------------------------------------------------------------- /doc/Options.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Fruchtzwerg94/PlantUmlViewer/HEAD/doc/Options.png -------------------------------------------------------------------------------- /doc/PlantUmlViewer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Fruchtzwerg94/PlantUmlViewer/HEAD/doc/PlantUmlViewer.png -------------------------------------------------------------------------------- /doc/PlantUmlViewerDark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Fruchtzwerg94/PlantUmlViewer/HEAD/doc/PlantUmlViewerDark.png -------------------------------------------------------------------------------- /PlantUmlViewer/PlantUmlViewer/Resources/Icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Fruchtzwerg94/PlantUmlViewer/HEAD/PlantUmlViewer/PlantUmlViewer/Resources/Icon.ico -------------------------------------------------------------------------------- /PlantUmlViewer/PlantUmlViewer/Resources/Image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Fruchtzwerg94/PlantUmlViewer/HEAD/PlantUmlViewer/PlantUmlViewer/Resources/Image.png -------------------------------------------------------------------------------- /PlantUmlViewer/PlantUmlViewer/Resources/Save.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Fruchtzwerg94/PlantUmlViewer/HEAD/PlantUmlViewer/PlantUmlViewer/Resources/Save.png -------------------------------------------------------------------------------- /PlantUmlViewer/PlantUmlViewer/Resources/Refresh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Fruchtzwerg94/PlantUmlViewer/HEAD/PlantUmlViewer/PlantUmlViewer/Resources/Refresh.png -------------------------------------------------------------------------------- /PlantUmlViewer/PlantUmlViewer/Resources/ZoomFit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Fruchtzwerg94/PlantUmlViewer/HEAD/PlantUmlViewer/PlantUmlViewer/Resources/ZoomFit.png -------------------------------------------------------------------------------- /PlantUmlViewer/PlantUmlViewer/Resources/ZoomIn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Fruchtzwerg94/PlantUmlViewer/HEAD/PlantUmlViewer/PlantUmlViewer/Resources/ZoomIn.png -------------------------------------------------------------------------------- /PlantUmlViewer/PlantUmlViewer/Resources/ZoomOut.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Fruchtzwerg94/PlantUmlViewer/HEAD/PlantUmlViewer/PlantUmlViewer/Resources/ZoomOut.png -------------------------------------------------------------------------------- /PlantUmlViewer/PlantUmlViewer/Resources/IconFluent.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Fruchtzwerg94/PlantUmlViewer/HEAD/PlantUmlViewer/PlantUmlViewer/Resources/IconFluent.ico -------------------------------------------------------------------------------- /PlantUmlViewer/PlantUmlViewer/Resources/NavigateUp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Fruchtzwerg94/PlantUmlViewer/HEAD/PlantUmlViewer/PlantUmlViewer/Resources/NavigateUp.png -------------------------------------------------------------------------------- /PlantUmlViewer/PlantUmlViewer/Resources/ZoomReset.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Fruchtzwerg94/PlantUmlViewer/HEAD/PlantUmlViewer/PlantUmlViewer/Resources/ZoomReset.png -------------------------------------------------------------------------------- /PlantUmlViewer/PlantUmlViewer/Resources/NavigateDown.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Fruchtzwerg94/PlantUmlViewer/HEAD/PlantUmlViewer/PlantUmlViewer/Resources/NavigateDown.png -------------------------------------------------------------------------------- /PlantUmlViewer/PlantUmlViewer/Resources/NavigateLeft.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Fruchtzwerg94/PlantUmlViewer/HEAD/PlantUmlViewer/PlantUmlViewer/Resources/NavigateLeft.png -------------------------------------------------------------------------------- /PlantUmlViewer/PlantUmlViewer/Resources/NavigateRight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Fruchtzwerg94/PlantUmlViewer/HEAD/PlantUmlViewer/PlantUmlViewer/Resources/NavigateRight.png -------------------------------------------------------------------------------- /PlantUmlViewer/PlantUmlViewer/Resources/IconFluentDark.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Fruchtzwerg94/PlantUmlViewer/HEAD/PlantUmlViewer/PlantUmlViewer/Resources/IconFluentDark.ico -------------------------------------------------------------------------------- /PlantUmlViewer/PlantUmlViewer/Forms/Controls/LoadingCircle.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Fruchtzwerg94/PlantUmlViewer/HEAD/PlantUmlViewer/PlantUmlViewer/Forms/Controls/LoadingCircle.cs -------------------------------------------------------------------------------- /PlantUmlViewer/PlantUmlViewer/Forms/Controls/LoadingCircle.designer.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Fruchtzwerg94/PlantUmlViewer/HEAD/PlantUmlViewer/PlantUmlViewer/Forms/Controls/LoadingCircle.designer.cs -------------------------------------------------------------------------------- /PlantUmlViewer/PlantUmlViewer/PluginInfrastructure/DllExport/Mono.Cecil.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Fruchtzwerg94/PlantUmlViewer/HEAD/PlantUmlViewer/PlantUmlViewer/PluginInfrastructure/DllExport/Mono.Cecil.dll -------------------------------------------------------------------------------- /PlantUmlViewer/PlantUmlViewer/Settings/OpenExport.cs: -------------------------------------------------------------------------------- 1 | namespace PlantUmlViewer.Settings 2 | { 3 | public enum OpenExport 4 | { 5 | Ask, 6 | Always, 7 | Never 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /PlantUmlViewer/PlantUmlViewer/Forms/Controls/LoadingCircleToolStripMenuItem.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Fruchtzwerg94/PlantUmlViewer/HEAD/PlantUmlViewer/PlantUmlViewer/Forms/Controls/LoadingCircleToolStripMenuItem.cs -------------------------------------------------------------------------------- /PlantUmlViewer/PlantUmlViewer/PluginInfrastructure/DllExport/NppPlugin.DllExport.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Fruchtzwerg94/PlantUmlViewer/HEAD/PlantUmlViewer/PlantUmlViewer/PluginInfrastructure/DllExport/NppPlugin.DllExport.dll -------------------------------------------------------------------------------- /PlantUmlViewer/PlantUmlViewer/PluginInfrastructure/DllExport/NppPlugin.DllExport.MSBuild.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Fruchtzwerg94/PlantUmlViewer/HEAD/PlantUmlViewer/PlantUmlViewer/PluginInfrastructure/DllExport/NppPlugin.DllExport.MSBuild.dll -------------------------------------------------------------------------------- /PlantUmlViewer/PlantUmlViewer/DiagramGeneration/PlantUml/ErrorFormat.cs: -------------------------------------------------------------------------------- 1 | namespace PlantUmlViewer.DiagramGeneration.PlantUml 2 | { 3 | public enum ErrorFormat 4 | { 5 | TwoLines, 6 | SingleLine, 7 | Verbose 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /PlantUmlViewer/PlantUmlViewer/ILMergeOrder.txt: -------------------------------------------------------------------------------- 1 | # this file contains the partial list of the merged assemblies in the merge order 2 | # you can fill it from the obj\CONFIG\PROJECT.ilmerge generated on every build 3 | # and finetune merge order to your satisfaction 4 | 5 | -------------------------------------------------------------------------------- /PlantUmlViewer/PlantUmlViewer/DiagramGeneration/PlantUml/OutputFormat.cs: -------------------------------------------------------------------------------- 1 | namespace PlantUmlViewer.DiagramGeneration.PlantUml 2 | { 3 | public enum OutputFormat 4 | { 5 | Png, 6 | Svg, 7 | Eps, 8 | Pdf, 9 | Vdx, 10 | Xmi, 11 | Scxml, 12 | Html, 13 | Ascii, 14 | AsciiUnicode, 15 | LaTeX 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /PlantUmlViewer/PlantUmlViewer/Settings/PlantUmlViewerSettings.cs: -------------------------------------------------------------------------------- 1 | namespace PlantUmlViewer.Settings 2 | { 3 | public class PlantUmlViewerSettings 4 | { 5 | public string JavaPath { get; set; } = ""; 6 | public string PlantUmlPath { get; set; } = ""; 7 | public string Include { get; set; } = ""; 8 | public decimal ExportSizeFactor { get; set; } = 1; 9 | public bool ExportDocument { get; set; } = true; 10 | public OpenExport OpenExport { get; set; } = OpenExport.Ask; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /PlantUmlViewer/PlantUmlViewer/DiagramGeneration/GeneratedDiagram.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | using Svg; 4 | 5 | namespace PlantUmlViewer.DiagramGeneration 6 | { 7 | internal class GeneratedDiagram 8 | { 9 | public List Pages { get; } 10 | 11 | public GeneratedDiagram() 12 | { 13 | Pages = new List(); 14 | } 15 | 16 | public GeneratedDiagram(params SvgDocument[] pages) 17 | { 18 | Pages = new List(pages); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /PlantUmlViewer/PlantUmlViewer/app.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /PlantUmlViewer/PlantUmlViewer/DiagramGeneration/PlantUml/RenderException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace PlantUmlViewer.DiagramGeneration.PlantUml 4 | { 5 | public class RenderException : Exception 6 | { 7 | public string Code { get; } 8 | 9 | public RenderException(string code, string error) : base(error) 10 | { 11 | Code = code; 12 | } 13 | 14 | public override string Message 15 | { 16 | get 17 | { 18 | return base.Message + $", Code={Code}"; 19 | } 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: "[FEATURE]" 5 | labels: enhancement 6 | assignees: Fruchtzwerg94 7 | 8 | --- 9 | 10 | **Description** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]. 12 | 13 | **Solution** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Alternatives** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional information** 20 | Add any other information or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /PlantUmlViewer/PlantUmlViewer/PluginInfrastructure/Commit.md: -------------------------------------------------------------------------------- 1 | # Source 2 | https://github.com/kbilsted/NotepadPlusPlusPluginPack.Net 3 | 4 | # Commit URL 5 | https://github.com/kbilsted/NotepadPlusPlusPluginPack.Net/commit/b588f001e5684afbe61af572fc95bff4d21e51b0 6 | 7 | # Commit details 8 | ``` 9 | Commit: b588f001e5684afbe61af572fc95bff4d21e51b0 [b588f00] 10 | Parents: 529a28393b, a6ab346545 11 | Author: Magesh K <47920326+mahee96@users.noreply.github.com> 12 | Date: Freitag, 18. November 2022 01:28:36 13 | Committer: GitHub 14 | Merge pull request #95 from Fruchtzwerg94/fix_64bit_notification 15 | 16 | Updated Position types to work also on 64 bit 17 | ``` 18 | -------------------------------------------------------------------------------- /PlantUmlViewer/PlantUmlViewer/Helpers/PathHelper.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using System.Reflection; 3 | 4 | namespace PlantUmlViewer.Helpers 5 | { 6 | public static class PathHelper 7 | { 8 | private static readonly string assemblyDirectory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); 9 | 10 | public static string ResolvePathToAssembly(string path) 11 | { 12 | if (Path.IsPathRooted(path)) 13 | { 14 | return path; 15 | } 16 | else 17 | { 18 | return Path.GetFullPath(Path.Combine(assemblyDirectory, path)); 19 | } 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: "[BUG]" 5 | labels: bug 6 | assignees: Fruchtzwerg94 7 | 8 | --- 9 | 10 | **Description** 11 | A clear and concise description of what the bug is. 12 | 13 | **Reproduction** 14 | Steps to reproduce the behavior: 15 | 1. Go to '...' 16 | 2. Click on '...' 17 | 3. Scroll down to '...' 18 | 4. See error 19 | 20 | **Expected behavior** 21 | A clear and concise description of what you expected to happen. 22 | 23 | **Screenshots** 24 | If applicable, add screenshots to help explain your problem. 25 | 26 | **Environment** 27 | - Windows: [e.g. 10] 28 | - Notepad++ version: [e.g. 8.4.4 64-bit] 29 | 30 | **Additional information** 31 | Add any other information about the problem here. 32 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # To get started with Dependabot version updates, you'll need to specify which 2 | # package ecosystems to update and where the package manifests are located. 3 | # Please see the documentation for all configuration options: 4 | # https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates 5 | 6 | version: 2 7 | updates: 8 | #Maintain dependencies for NuGet packages 9 | - package-ecosystem: "nuget" 10 | directory: "/PlantUmlViewer/PlantUmlViewer" 11 | schedule: 12 | interval: "weekly" 13 | ignore: 14 | - dependency-name: "ExCSS" 15 | - dependency-name: "Fizzler" 16 | - dependency-name: "System.Memory" 17 | - dependency-name: "System.Runtime.CompilerServices.Unsafe" 18 | 19 | #Maintain dependencies for GitHub Actions 20 | - package-ecosystem: "github-actions" 21 | directory: "/" 22 | schedule: 23 | interval: "weekly" 24 | -------------------------------------------------------------------------------- /PlantUmlViewer/PlantUmlViewer/PluginInfrastructure/DllExport/DllExportAttribute.cs: -------------------------------------------------------------------------------- 1 | // NPP plugin platform for .Net v0.94.00 by Kasper B. Graversen etc. 2 | using System; 3 | using System.Runtime.InteropServices; 4 | 5 | namespace NppPlugin.DllExport 6 | { 7 | [AttributeUsage(AttributeTargets.Method, AllowMultiple = false)] 8 | partial class DllExportAttribute : Attribute 9 | { 10 | public DllExportAttribute() 11 | { 12 | } 13 | 14 | public DllExportAttribute(string exportName) 15 | : this(exportName, CallingConvention.StdCall) 16 | { 17 | } 18 | 19 | public DllExportAttribute(string exportName, CallingConvention callingConvention) 20 | { 21 | ExportName = exportName; 22 | CallingConvention = callingConvention; 23 | } 24 | 25 | public CallingConvention CallingConvention { get; set; } 26 | 27 | public string ExportName { get; set; } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022-2023 Philipp Schmidt 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /PlantUmlViewer/PlantUmlViewer/Main.cs: -------------------------------------------------------------------------------- 1 | using System.Diagnostics; 2 | 3 | using Kbg.NppPluginNET.PluginInfrastructure; 4 | 5 | namespace Kbg.NppPluginNET 6 | { 7 | public static class Main 8 | { 9 | public const string PluginName = PlantUmlViewer.PlantUmlViewer.PLUGIN_NAME; 10 | 11 | private static readonly PlantUmlViewer.PlantUmlViewer plantUmlViewer = new PlantUmlViewer.PlantUmlViewer(); 12 | 13 | public static void OnNotification(ScNotification notification) 14 | { 15 | Debug.WriteLine($"OnNotification: {notification.Header.Code}", nameof(Main)); 16 | plantUmlViewer.OnNotification(notification); 17 | } 18 | 19 | public static void CommandMenuInit() 20 | { 21 | Debug.WriteLine("CommandMenuInit", nameof(Main)); 22 | plantUmlViewer.CommandMenuInit(); 23 | } 24 | 25 | public static void SetToolBarIcon() 26 | { 27 | Debug.WriteLine("SetToolBarIcon", nameof(Main)); 28 | plantUmlViewer.SetToolBarIcon(); 29 | } 30 | 31 | public static void PluginCleanUp() 32 | { 33 | Debug.WriteLine("PluginCleanUp", nameof(Main)); 34 | plantUmlViewer.PluginCleanUp(); 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /PlantUmlViewer/PlantUmlViewer/Forms/ControlsExtensions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Windows.Forms; 5 | 6 | namespace PlantUmlViewer.Forms 7 | { 8 | internal static class ControlsExtensions 9 | { 10 | public static void InvokeIfRequired(this Control control, Action action) 11 | { 12 | if (control.InvokeRequired) 13 | { 14 | control.Invoke(action); 15 | } 16 | else 17 | { 18 | action(); 19 | } 20 | } 21 | 22 | public static IEnumerable GetChildren(this Control control, int depth) 23 | { 24 | if (depth-- >= 1) 25 | { 26 | foreach (var childControl in control.Controls.Cast()) 27 | { 28 | if (childControl is T child) 29 | { 30 | yield return child; 31 | } 32 | else 33 | { 34 | foreach (T next in childControl.GetChildren(depth)) 35 | { 36 | yield return next; 37 | } 38 | } 39 | } 40 | } 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /PlantUmlViewer/PlantUmlViewer/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /PlantUmlViewer/PlantUmlViewer.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.4.33122.133 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PlantUmlViewer", "PlantUmlViewer\PlantUmlViewer.csproj", "{6110E276-539A-49A0-AEAD-269AB1C7B6E1}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|x64 = Debug|x64 11 | Debug|x86 = Debug|x86 12 | Release|x64 = Release|x64 13 | Release|x86 = Release|x86 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {6110E276-539A-49A0-AEAD-269AB1C7B6E1}.Debug|x64.ActiveCfg = Debug|x64 17 | {6110E276-539A-49A0-AEAD-269AB1C7B6E1}.Debug|x64.Build.0 = Debug|x64 18 | {6110E276-539A-49A0-AEAD-269AB1C7B6E1}.Debug|x86.ActiveCfg = Debug|x86 19 | {6110E276-539A-49A0-AEAD-269AB1C7B6E1}.Debug|x86.Build.0 = Debug|x86 20 | {6110E276-539A-49A0-AEAD-269AB1C7B6E1}.Release|x64.ActiveCfg = Release|x64 21 | {6110E276-539A-49A0-AEAD-269AB1C7B6E1}.Release|x64.Build.0 = Release|x64 22 | {6110E276-539A-49A0-AEAD-269AB1C7B6E1}.Release|x86.ActiveCfg = Release|x86 23 | {6110E276-539A-49A0-AEAD-269AB1C7B6E1}.Release|x86.Build.0 = Release|x86 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | GlobalSection(ExtensibilityGlobals) = postSolution 29 | SolutionGuid = {7F132572-8923-4A5E-A148-CED649952C9E} 30 | EndGlobalSection 31 | EndGlobal 32 | -------------------------------------------------------------------------------- /PlantUmlViewer/PlantUmlViewer/DiagramGeneration/PlantUml/PlantUmlArguments.cs: -------------------------------------------------------------------------------- 1 | namespace PlantUmlViewer.DiagramGeneration.PlantUml 2 | { 3 | internal class PlantUmlArguments 4 | { 5 | /// 6 | /// Error format 7 | /// 8 | public ErrorFormat ErrorFormat { get; set; } = ErrorFormat.Verbose; 9 | 10 | /// 11 | /// Output format 12 | /// 13 | public OutputFormat OutputFormat { get; set; } = OutputFormat.Svg; 14 | 15 | /// 16 | /// The file directory to use which may is needed for relative includes, 17 | /// null or empty to use the applications executable directory 18 | /// 19 | public string FileDirectory { get; set; } = null; 20 | 21 | /// 22 | /// Include a file as if '!include file' were used, also allowing pattern like '*.puml' 23 | /// 24 | public string Include { get; set; } = null; 25 | 26 | /// 27 | /// Override %filename% variable 28 | /// 29 | public string FileName { get; set; } = null; 30 | 31 | /// 32 | /// Separators between diagrams to determine where 33 | /// one image ends and another starts if multiple diagrams are generated 34 | /// 35 | public string Delimitor { get; set; } = ""; 36 | 37 | /// 38 | /// To generate the Nth image 39 | /// 40 | public int ImageIndex { get; set; } = 0; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /PlantUmlViewer/PlantUmlViewer/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("PlantUmlViewer")] 9 | [assembly: AssemblyDescription("PlantUML Viewer")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Schmidt")] 12 | [assembly: AssemblyProduct("PlantUML Viewer by Philipp Schmidt")] 13 | [assembly: AssemblyCopyright("Copyright © 2022 - 2025, all rights reserved")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("31492674-6fe0-485c-91f0-2e17244588ff")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.9.0.13")] 36 | [assembly: AssemblyFileVersion("1.9.0.13")] 37 | -------------------------------------------------------------------------------- /PlantUmlViewer/PlantUmlViewer/PluginInfrastructure/UnmanagedExports.cs: -------------------------------------------------------------------------------- 1 | // NPP plugin platform for .Net v0.94.00 by Kasper B. Graversen etc. 2 | using System; 3 | using System.Runtime.InteropServices; 4 | using Kbg.NppPluginNET.PluginInfrastructure; 5 | using NppPlugin.DllExport; 6 | 7 | namespace Kbg.NppPluginNET 8 | { 9 | class UnmanagedExports 10 | { 11 | [DllExport(CallingConvention=CallingConvention.Cdecl)] 12 | static bool isUnicode() 13 | { 14 | return true; 15 | } 16 | 17 | [DllExport(CallingConvention = CallingConvention.Cdecl)] 18 | static void setInfo(NppData notepadPlusData) 19 | { 20 | PluginBase.nppData = notepadPlusData; 21 | Main.CommandMenuInit(); 22 | } 23 | 24 | [DllExport(CallingConvention = CallingConvention.Cdecl)] 25 | static IntPtr getFuncsArray(ref int nbF) 26 | { 27 | nbF = PluginBase._funcItems.Items.Count; 28 | return PluginBase._funcItems.NativePointer; 29 | } 30 | 31 | [DllExport(CallingConvention = CallingConvention.Cdecl)] 32 | static uint messageProc(uint Message, IntPtr wParam, IntPtr lParam) 33 | { 34 | return 1; 35 | } 36 | 37 | static IntPtr _ptrPluginName = IntPtr.Zero; 38 | [DllExport(CallingConvention = CallingConvention.Cdecl)] 39 | static IntPtr getName() 40 | { 41 | if (_ptrPluginName == IntPtr.Zero) 42 | _ptrPluginName = Marshal.StringToHGlobalUni(Main.PluginName); 43 | return _ptrPluginName; 44 | } 45 | 46 | [DllExport(CallingConvention = CallingConvention.Cdecl)] 47 | static void beNotified(IntPtr notifyCode) 48 | { 49 | ScNotification notification = (ScNotification)Marshal.PtrToStructure(notifyCode, typeof(ScNotification)); 50 | if (notification.Header.Code == (uint)NppMsg.NPPN_TBMODIFICATION) 51 | { 52 | PluginBase._funcItems.RefreshItems(); 53 | Main.SetToolBarIcon(); 54 | } 55 | else if (notification.Header.Code == (uint)NppMsg.NPPN_SHUTDOWN) 56 | { 57 | Main.PluginCleanUp(); 58 | Marshal.FreeHGlobal(_ptrPluginName); 59 | } 60 | else 61 | { 62 | Main.OnNotification(notification); 63 | } 64 | } 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /PlantUmlViewer/PlantUmlViewer/Windows/NativeWindowApi.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices; 3 | 4 | namespace PlantUmlViewer.Windows 5 | { 6 | internal static class NativeWindowApi 7 | { 8 | [DllImport("User32.dll", CharSet = CharSet.Ansi)] 9 | private extern static Int32 SetWindowLong(IntPtr hWnd, int nIndex, Int32 dwNewLong); 10 | 11 | [DllImport("User32.dll", CharSet = CharSet.Ansi)] 12 | private extern static Int32 GetWindowLong(IntPtr hWnd, int nIndex); 13 | 14 | private const Int32 GWL_EXSTYLE = -20; 15 | 16 | public const Int32 WS_EX_DLGMODALFRAME = 0x00000001; 17 | public const Int32 WS_EX_NOPARENTNOTIFY = 0x00000004; 18 | public const Int32 WS_EX_TOPMOST = 0x00000008; 19 | public const Int32 WS_EX_ACCEPTFILES = 0x00000010; 20 | public const Int32 WS_EX_TRANSPARENT = 0x00000020; 21 | public const Int32 WS_EX_MDICHILD = 0x00000040; 22 | public const Int32 WS_EX_TOOLWINDOW = 0x00000080; 23 | public const Int32 WS_EX_WINDOWEDGE = 0x00000100; 24 | public const Int32 WS_EX_CLIENTEDGE = 0x00000200; 25 | public const Int32 WS_EX_CONTEXTHELP = 0x00000400; 26 | public const Int32 WS_EX_RIGHT = 0x00001000; 27 | public const Int32 WS_EX_LEFT = 0x00000000; 28 | public const Int32 WS_EX_RTLREADING = 0x00002000; 29 | public const Int32 WS_EX_LTRREADING = 0x00000000; 30 | public const Int32 WS_EX_LEFTSCROLLBAR = 0x00004000; 31 | public const Int32 WS_EX_RIGHTSCROLLBAR = 0x00000000; 32 | public const Int32 WS_EX_CONTROLPARENT = 0x00010000; 33 | public const Int32 WS_EX_STATICEDGE = 0x00020000; 34 | public const Int32 WS_EX_APPWINDOW = 0x00040000; 35 | public const Int32 WS_EX_OVERLAPPEDWINDOW = (0x00000100 | 0x00000200); 36 | public const Int32 WS_EX_PALETTEWINDOW = (0x00000100 | 0x00000080 | 0x00000008); 37 | public const Int32 WS_EX_LAYERED = 0x00080000; 38 | public const Int32 WS_EX_NOINHERITLAYOUT = 0x00100000; 39 | public const Int32 WS_EX_LAYOUTRTL = 0x00400000; 40 | public const Int32 WS_EX_NOACTIVATE = 0x08000000; 41 | 42 | public static void ModifyStyleEx(IntPtr hWnd, Int32 remove, Int32 add) 43 | { 44 | Int32 res = GetWindowLong(hWnd, GWL_EXSTYLE); 45 | 46 | res &= ~remove; 47 | res |= add; 48 | 49 | SetWindowLong(hWnd, GWL_EXSTYLE, res); 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /PlantUmlViewer/PlantUmlViewer/Settings/SettingsService.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Diagnostics; 3 | using System.IO; 4 | using System.Xml; 5 | using System.Xml.Serialization; 6 | 7 | using Kbg.NppPluginNET.PluginInfrastructure; 8 | 9 | namespace PlantUmlViewer.Settings 10 | { 11 | internal class SettingsService 12 | { 13 | private readonly string settingsFilePath; 14 | public PlantUmlViewerSettings Settings { get; private set; } = new PlantUmlViewerSettings(); 15 | 16 | public SettingsService(INotepadPPGateway notepadPp) 17 | { 18 | settingsFilePath = notepadPp.GetPluginConfigPath(); 19 | if (!Directory.Exists(settingsFilePath)) 20 | { 21 | Directory.CreateDirectory(settingsFilePath); 22 | } 23 | settingsFilePath = Path.Combine(settingsFilePath, $"{nameof(PlantUmlViewer)}.xml"); 24 | Debug.WriteLine($"Using settings file '{settingsFilePath}'", nameof(SettingsService)); 25 | 26 | Load(); 27 | } 28 | 29 | private void Load() 30 | { 31 | try 32 | { 33 | XmlSerializer serializer = new XmlSerializer(typeof(PlantUmlViewerSettings)); 34 | using (StreamReader settingsFileReader = new StreamReader(settingsFilePath)) 35 | { 36 | Settings = (PlantUmlViewerSettings)serializer.Deserialize(settingsFileReader); 37 | } 38 | Debug.WriteLine("Settings loaded", nameof(SettingsService)); 39 | } 40 | catch (Exception ex) 41 | { 42 | Debug.WriteLine($"Failed to load settings: {ex}", nameof(SettingsService)); 43 | } 44 | } 45 | 46 | public void Save() 47 | { 48 | try 49 | { 50 | XmlSerializer serializer = new XmlSerializer(Settings.GetType()); 51 | using (StreamWriter settingsFileWriter = new StreamWriter(settingsFilePath)) 52 | using (XmlWriter xmlWriter = XmlWriter.Create(settingsFileWriter, new XmlWriterSettings() { Indent = true })) 53 | { 54 | serializer.Serialize(xmlWriter, Settings); 55 | } 56 | Debug.WriteLine("Settings saved", nameof(SettingsService)); 57 | } 58 | catch (Exception ex) 59 | { 60 | Debug.WriteLine($"Failed to save settings: {ex}", nameof(SettingsService)); 61 | } 62 | } 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /PlantUmlViewer/PlantUmlViewer/AssemblyAttributes.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using System.Reflection; 3 | 4 | namespace PlantUmlViewer 5 | { 6 | internal static class AssemblyAttributes 7 | { 8 | public static string Title 9 | { 10 | get 11 | { 12 | object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyTitleAttribute), false); 13 | if (attributes.Length > 0) 14 | { 15 | AssemblyTitleAttribute titleAttribute = (AssemblyTitleAttribute)attributes[0]; 16 | if (titleAttribute.Title != "") 17 | { 18 | return titleAttribute.Title; 19 | } 20 | } 21 | return Path.GetFileNameWithoutExtension(Assembly.GetExecutingAssembly().CodeBase); 22 | } 23 | } 24 | 25 | public static string Version 26 | { 27 | get 28 | { 29 | return Assembly.GetExecutingAssembly().GetName().Version.ToString(); 30 | } 31 | } 32 | 33 | public static string Product 34 | { 35 | get 36 | { 37 | object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyProductAttribute), false); 38 | if (attributes.Length == 0) 39 | { 40 | return ""; 41 | } 42 | return ((AssemblyProductAttribute)attributes[0]).Product; 43 | } 44 | } 45 | 46 | public static string Copyright 47 | { 48 | get 49 | { 50 | object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false); 51 | if (attributes.Length == 0) 52 | { 53 | return ""; 54 | } 55 | return ((AssemblyCopyrightAttribute)attributes[0]).Copyright; 56 | } 57 | } 58 | 59 | public static string Company 60 | { 61 | get 62 | { 63 | object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCompanyAttribute), false); 64 | if (attributes.Length == 0) 65 | { 66 | return ""; 67 | } 68 | return ((AssemblyCompanyAttribute)attributes[0]).Company; 69 | } 70 | } 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /.github/workflows/CI_build.yml: -------------------------------------------------------------------------------- 1 | name: Continuous Integration 2 | 3 | on: [push, pull_request,workflow_dispatch] 4 | 5 | jobs: 6 | build: 7 | runs-on: windows-2025 8 | strategy: 9 | max-parallel: 4 10 | matrix: 11 | #[Release, Debug] 12 | build_configuration: [Release] 13 | build_platform: [x64, x86] 14 | 15 | steps: 16 | - name: Install .NET Framework for developers 17 | run: choco install netfx-4.6.2-devpack 18 | 19 | - name: Checkout repo 20 | uses: actions/checkout@v5 21 | with: 22 | submodules: recursive 23 | 24 | - name: Add MSBuild to PATH 25 | uses: microsoft/setup-msbuild@v2 26 | 27 | - name: Setup NuGet 28 | uses: nuget/setup-nuget@v2 29 | 30 | - name: Nuget restore 31 | working-directory: PlantUmlViewer/ 32 | run: nuget restore PlantUmlViewer.sln 33 | 34 | - name: MSBuild 35 | run: | 36 | msbuild PlantUmlViewer/PlantUmlViewer.sln /p:configuration="${{ matrix.build_configuration }}" /p:platform="${{ matrix.build_platform }}" /m /verbosity:minimal 37 | mkdir deploy 38 | Copy-Item -Path "PlantUmlViewer/PlantUmlViewer/bin/${{ matrix.build_configuration }}-${{ matrix.build_platform }}/PlantUmlViewer.dll" -Destination "deploy" 39 | 40 | - name: Download libraries 41 | if: matrix.build_configuration == 'Release' 42 | run: | 43 | curl -L --url https://github.com/plantuml/plantuml/releases/download/v1.2025.10/plantuml-1.2025.10.jar --output deploy/plantuml-1.2025.10.jar 44 | if ((Get-FileHash -Algorithm MD5 -Path "deploy/plantuml-1.2025.10.jar").Hash -ne "5ec3e9f1419fdf1d0bc9ee3a8ba5375d") { throw "MD5 sum is invalid" } 45 | curl -L --url http://beta.plantuml.net/plantuml-jlatexmath.zip --output deploy/plantuml-jlatexmath.zip 46 | if ((Get-FileHash -Algorithm MD5 -Path "deploy/plantuml-jlatexmath.zip").Hash -ne "32a81facc3b8ed331f0d19f2c23d709a") { throw "MD5 sum is invalid" } 47 | tar -xf deploy/plantuml-jlatexmath.zip -C deploy 48 | Remove-Item deploy/plantuml-jlatexmath.zip 49 | 50 | - name: Set artifact name 51 | # Replace every invalid file name character 52 | run: | 53 | $artifact_name="PlantUmlViewer_${{ github.ref_name }}.${{ github.sha }}_${{ matrix.build_platform }}" 54 | $illegal_chars = [string]::join('',([System.IO.Path]::GetInvalidFileNameChars())) -replace '\\','\\' 55 | $artifact_name=($artifact_name -replace "[$illegal_chars]", '-') 56 | echo "ARTIFACT_NAME=$artifact_name" >> $env:GITHUB_ENV 57 | 58 | - name: Create artifact 59 | if: matrix.build_configuration == 'Release' 60 | uses: actions/upload-artifact@v4 61 | with: 62 | name: ${{ env.ARTIFACT_NAME }} 63 | path: deploy/ 64 | -------------------------------------------------------------------------------- /PlantUmlViewer/PlantUmlViewer/PluginInfrastructure/NppPluginNETBase.cs: -------------------------------------------------------------------------------- 1 | // NPP plugin platform for .Net v0.94.00 by Kasper B. Graversen etc. 2 | using System; 3 | 4 | namespace Kbg.NppPluginNET.PluginInfrastructure 5 | { 6 | class PluginBase 7 | { 8 | internal static NppData nppData; 9 | internal static FuncItems _funcItems = new FuncItems(); 10 | 11 | internal static void SetCommand(int index, string commandName, NppFuncItemDelegate functionPointer) 12 | { 13 | SetCommand(index, commandName, functionPointer, new ShortcutKey(), false); 14 | } 15 | 16 | internal static void SetCommand(int index, string commandName, NppFuncItemDelegate functionPointer, ShortcutKey shortcut) 17 | { 18 | SetCommand(index, commandName, functionPointer, shortcut, false); 19 | } 20 | 21 | internal static void SetCommand(int index, string commandName, NppFuncItemDelegate functionPointer, bool checkOnInit) 22 | { 23 | SetCommand(index, commandName, functionPointer, new ShortcutKey(), checkOnInit); 24 | } 25 | 26 | internal static void SetCommand(int index, string commandName, NppFuncItemDelegate functionPointer, ShortcutKey shortcut, bool checkOnInit) 27 | { 28 | FuncItem funcItem = new FuncItem(); 29 | funcItem._cmdID = index; 30 | funcItem._itemName = commandName; 31 | if (functionPointer != null) 32 | funcItem._pFunc = new NppFuncItemDelegate(functionPointer); 33 | if (shortcut._key != 0) 34 | funcItem._pShKey = shortcut; 35 | funcItem._init2Check = checkOnInit; 36 | _funcItems.Add(funcItem); 37 | } 38 | 39 | // menuitem with checkmark, toggle visible checkmark on/off 40 | internal static void CheckMenuItemToggle(int idx, ref bool value) 41 | { 42 | // toggle value 43 | value = !value; 44 | 45 | Win32.CheckMenuItem(Win32.GetMenu(nppData._nppHandle), _funcItems.Items[idx]._cmdID, Win32.MF_BYCOMMAND | (value ? Win32.MF_CHECKED : Win32.MF_UNCHECKED)); 46 | } 47 | 48 | internal static IntPtr GetCurrentScintilla() 49 | { 50 | int curScintilla; 51 | Win32.SendMessage(nppData._nppHandle, (uint) NppMsg.NPPM_GETCURRENTSCINTILLA, 0, out curScintilla); 52 | return (curScintilla == 0) ? nppData._scintillaMainHandle : nppData._scintillaSecondHandle; 53 | } 54 | 55 | 56 | static readonly Func gatewayFactory = () => new ScintillaGateway(GetCurrentScintilla()); 57 | 58 | public static Func GetGatewayFactory() 59 | { 60 | return gatewayFactory; 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /tools/create_release.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | Script to help creating a release of the plugin 4 | 5 | @author: Philipp Schmidt 6 | """ 7 | 8 | import hashlib 9 | import json 10 | import os.path 11 | import pathlib 12 | import zipfile 13 | 14 | 15 | def zip_files(directory, zip_file): 16 | with zipfile.ZipFile(zip_file, 'w', zipfile.ZIP_DEFLATED) as zipf: 17 | for root, dirs, files in os.walk(directory): 18 | for file in files: 19 | zipf.write(os.path.join(root, file), 20 | os.path.relpath(os.path.join(root, file), directory)) 21 | 22 | def hash_file(filename): 23 | sha256_hash = hashlib.sha256() 24 | with open(filename, 'rb') as f: 25 | for byte_block in iter(lambda: f.read(4096), b''): 26 | sha256_hash.update(byte_block) 27 | return sha256_hash.hexdigest() 28 | 29 | def create_plugin_list_entry(version, architecture, hash): 30 | entry = { 31 | 'folder-name': 'PlantUmlViewer', 32 | 'display-name': 'PlantUML Viewer', 33 | 'version': '{version}'.format(version=version), 34 | 'npp-compatible-versions': '[8.3,]', 35 | 'id': '{hash}'.format(hash=hash), 36 | 'repository': 'https://github.com/Fruchtzwerg94/PlantUmlViewer/releases/download/{version}/PlantUmlViewer_v{version}_{architecture}.zip' 37 | .format(version=version, architecture=architecture), 38 | 'description': 'A Notepad++ plugin to generate, view and export PlantUML diagrams.', 39 | 'author': 'Philipp Schmidt', 40 | 'homepage': 'https://github.com/Fruchtzwerg94/PlantUmlViewer' 41 | } 42 | return json.dumps(entry, indent=4) 43 | 44 | def main(): 45 | input('Press any key to confirm builds were done for x86 and x64') 46 | input('Press any key to confirm the PlantUML binary was added to the build directory') 47 | input('Press any key to confirm the necessary binaries for JLatexMath and Batik where added to the build directory') 48 | script_directory = pathlib.Path(__file__).parent.resolve() 49 | x86_build_directory = os.path.join(script_directory, '..', 'PlantUmlViewer', 'PlantUmlViewer', 'bin', 'Release-x86') 50 | x64_build_directory = os.path.join(script_directory, '..', 'PlantUmlViewer', 'PlantUmlViewer', 'bin', 'Release-x64') 51 | if not os.path.isdir(x86_build_directory): 52 | print('x86 build directory does not exist: ' + x86_build_directory) 53 | return 54 | if not os.path.isdir(x64_build_directory): 55 | print('x64 build directory does not exist: ' + x64_build_directory) 56 | return 57 | 58 | version = input('Enter version: ') 59 | 60 | x86_file = 'PlantUmlViewer_v{version}_{architecture}.zip'.format(version=version, architecture='x86') 61 | x64_file = 'PlantUmlViewer_v{version}_{architecture}.zip'.format(version=version, architecture='x64') 62 | 63 | zip_files(x86_build_directory, x86_file) 64 | zip_files(x64_build_directory, x64_file) 65 | 66 | x86_hash = hash_file(x86_file) 67 | x64_hash = hash_file(x64_file) 68 | 69 | print(create_plugin_list_entry(version, 'x86', x86_hash)) 70 | print() 71 | print(create_plugin_list_entry(version, 'x64', x64_hash)) 72 | 73 | if __name__ == '__main__': 74 | main() 75 | -------------------------------------------------------------------------------- /PlantUmlViewer/PlantUmlViewer/PluginInfrastructure/ClikeStringArray.cs: -------------------------------------------------------------------------------- 1 | // NPP plugin platform for .Net v0.94.00 by Kasper B. Graversen etc. 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Reflection; 5 | using System.Runtime.InteropServices; 6 | using System.Windows.Forms; 7 | 8 | namespace Kbg.NppPluginNET.PluginInfrastructure 9 | { 10 | public class ClikeStringArray : IDisposable 11 | { 12 | IntPtr _nativeArray; 13 | List _nativeItems; 14 | bool _disposed = false; 15 | 16 | public ClikeStringArray(int num, int stringCapacity) 17 | { 18 | _nativeArray = Marshal.AllocHGlobal((num + 1) * IntPtr.Size); 19 | _nativeItems = new List(); 20 | for (int i = 0; i < num; i++) 21 | { 22 | IntPtr item = Marshal.AllocHGlobal(stringCapacity); 23 | Marshal.WriteIntPtr(_nativeArray + (i * IntPtr.Size), item); 24 | _nativeItems.Add(item); 25 | } 26 | Marshal.WriteIntPtr(_nativeArray + (num * IntPtr.Size), IntPtr.Zero); 27 | } 28 | public ClikeStringArray(List lstStrings) 29 | { 30 | _nativeArray = Marshal.AllocHGlobal((lstStrings.Count + 1) * IntPtr.Size); 31 | _nativeItems = new List(); 32 | for (int i = 0; i < lstStrings.Count; i++) 33 | { 34 | IntPtr item = Marshal.StringToHGlobalUni(lstStrings[i]); 35 | Marshal.WriteIntPtr(_nativeArray + (i * IntPtr.Size), item); 36 | _nativeItems.Add(item); 37 | } 38 | Marshal.WriteIntPtr(_nativeArray + (lstStrings.Count * IntPtr.Size), IntPtr.Zero); 39 | } 40 | 41 | public IntPtr NativePointer { get { return _nativeArray; } } 42 | public List ManagedStringsAnsi { get { return _getManagedItems(false); } } 43 | public List ManagedStringsUnicode { get { return _getManagedItems(true); } } 44 | List _getManagedItems(bool unicode) 45 | { 46 | List _managedItems = new List(); 47 | for (int i = 0; i < _nativeItems.Count; i++) 48 | { 49 | if (unicode) _managedItems.Add(Marshal.PtrToStringUni(_nativeItems[i])); 50 | else _managedItems.Add(Marshal.PtrToStringAnsi(_nativeItems[i])); 51 | } 52 | return _managedItems; 53 | } 54 | 55 | public void Dispose() 56 | { 57 | try 58 | { 59 | if (!_disposed) 60 | { 61 | for (int i = 0; i < _nativeItems.Count; i++) 62 | if (_nativeItems[i] != IntPtr.Zero) Marshal.FreeHGlobal(_nativeItems[i]); 63 | if (_nativeArray != IntPtr.Zero) Marshal.FreeHGlobal(_nativeArray); 64 | _disposed = true; 65 | } 66 | } 67 | catch (Exception e) 68 | { 69 | MessageBox.Show(MethodBase.GetCurrentMethod().ToString() +": "+ e.Message, this.GetType().Name); 70 | } 71 | } 72 | ~ClikeStringArray() 73 | { 74 | Dispose(); 75 | } 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /PlantUmlViewer/PlantUmlViewer/PluginInfrastructure/Docking_h.cs: -------------------------------------------------------------------------------- 1 | // NPP plugin platform for .Net v0.94.00 by Kasper B. Graversen etc. 2 | // 3 | // This file should stay in sync with the CPP project file 4 | // "notepad-plus-plus/PowerEditor/src/WinControls/DockingWnd/Docking.h" 5 | // found at 6 | // https://github.com/notepad-plus-plus/notepad-plus-plus/blob/master/PowerEditor/src/WinControls/DockingWnd/Docking.h 7 | 8 | using System; 9 | using System.Runtime.InteropServices; 10 | 11 | namespace Kbg.NppPluginNET.PluginInfrastructure 12 | { 13 | 14 | [Flags] 15 | public enum NppTbMsg : uint 16 | { 17 | // styles for containers 18 | //CAPTION_TOP = 1, 19 | //CAPTION_BOTTOM = 0, 20 | 21 | // defines for docking manager 22 | CONT_LEFT = 0, 23 | CONT_RIGHT = 1, 24 | CONT_TOP = 2, 25 | CONT_BOTTOM = 3, 26 | DOCKCONT_MAX = 4, 27 | 28 | // mask params for plugins of internal dialogs 29 | DWS_ICONTAB = 0x00000001, // Icon for tabs are available 30 | DWS_ICONBAR = 0x00000002, // Icon for icon bar are available (currently not supported) 31 | DWS_ADDINFO = 0x00000004, // Additional information are in use 32 | DWS_PARAMSALL = (DWS_ICONTAB | DWS_ICONBAR | DWS_ADDINFO), 33 | 34 | // default docking values for first call of plugin 35 | DWS_DF_CONT_LEFT = (CONT_LEFT << 28), // default docking on left 36 | DWS_DF_CONT_RIGHT = (CONT_RIGHT << 28), // default docking on right 37 | DWS_DF_CONT_TOP = (CONT_TOP << 28), // default docking on top 38 | DWS_DF_CONT_BOTTOM = (CONT_BOTTOM << 28), // default docking on bottom 39 | DWS_DF_FLOATING = 0x80000000 // default state is floating 40 | } 41 | 42 | [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] 43 | public struct NppTbData 44 | { 45 | public IntPtr hClient; // HWND: client Window Handle 46 | public string pszName; // TCHAR*: name of plugin (shown in window) 47 | public int dlgID; // int: a funcItem provides the function pointer to start a dialog. Please parse here these ID 48 | // user modifications 49 | public NppTbMsg uMask; // UINT: mask params: look to above defines 50 | public uint hIconTab; // HICON: icon for tabs 51 | public string pszAddInfo; // TCHAR*: for plugin to display additional informations 52 | // internal data, do not use !!! 53 | public RECT rcFloat; // RECT: floating position 54 | public int iPrevCont; // int: stores the privious container (toggling between float and dock) 55 | public string pszModuleName; // const TCHAR*: it's the plugin file name. It's used to identify the plugin 56 | } 57 | 58 | [StructLayout(LayoutKind.Sequential)] 59 | public struct RECT 60 | { 61 | public RECT(int left, int top, int right, int bottom) 62 | { 63 | Left = left; Top = top; Right = right; Bottom = bottom; 64 | } 65 | public int Left; 66 | public int Top; 67 | public int Right; 68 | public int Bottom; 69 | } 70 | 71 | } 72 | -------------------------------------------------------------------------------- /PlantUmlViewer/PlantUmlViewer/Helpers/ProcessHelper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Diagnostics; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading; 7 | using System.Threading.Tasks; 8 | 9 | namespace PlantUmlViewer.Helpers 10 | { 11 | /// 12 | /// Helper class to work with es 13 | /// 14 | internal static class ProcessHelper 15 | { 16 | /// 17 | /// Opens a document using the systems associated application 18 | /// 19 | /// The name of the document to open 20 | /// Failed to open file due to non 0 return value 21 | public static void OpenDocument(string fileName) 22 | { 23 | ProcessStartInfo startInfo = new ProcessStartInfo() 24 | { 25 | FileName = fileName, 26 | UseShellExecute = true 27 | }; 28 | using (Process process = Process.Start(startInfo)) 29 | { 30 | process.WaitForExit(); 31 | if (process.ExitCode != 0) 32 | { 33 | throw new InvalidOperationException("Failed to open file with code " + process.ExitCode); 34 | } 35 | } 36 | } 37 | 38 | /// 39 | /// Asynchronously creates and runs a process 40 | /// 41 | /// The name of the application to start, or the name of a document of a file type 42 | /// Command-line arguments to pass to the application when the process starts 43 | /// The working directory for the process to be started 44 | /// A to cancel execution and kill the process 45 | /// Data to write to the standard input of the process 46 | /// A task running the process and providing its result 47 | public static async Task RunProcessAsync(string fileName, IEnumerable arguments, 48 | string workingDirectory, byte[] input = null, CancellationToken cancellationToken = default) 49 | { 50 | ProcessStartInfo startInfo = new ProcessStartInfo(fileName, 51 | string.Join(" ", arguments.Where(a => !string.IsNullOrWhiteSpace(a)).Select(a => $"{a}"))) 52 | { 53 | UseShellExecute = false, 54 | StandardOutputEncoding = Encoding.UTF8, 55 | StandardErrorEncoding = Encoding.UTF8, 56 | RedirectStandardInput = true, 57 | RedirectStandardOutput = true, 58 | RedirectStandardError = true, 59 | WindowStyle = ProcessWindowStyle.Hidden, 60 | CreateNoWindow = true, 61 | WorkingDirectory = workingDirectory 62 | }; 63 | Debug.WriteLine(startInfo.Arguments); 64 | 65 | using (Process process = new Process() { StartInfo = startInfo }) 66 | { 67 | return await process.RunAsync(input, cancellationToken).ConfigureAwait(false); 68 | } 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /PlantUmlViewer/PlantUmlViewer/ILMerge.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | true 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /PlantUmlViewer/PlantUmlViewer/Resources/Empty.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 16 | 37 | 39 | 43 | Or just by me a coffee :-) 54 | P.S. 65 | YOUR ADHERE 86 | 87 | 88 | -------------------------------------------------------------------------------- /PlantUmlViewer/PlantUmlViewer/DiagramGeneration/PlantUml/PlantUmlRunner.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using System.Text; 4 | using System.Threading; 5 | using System.Threading.Tasks; 6 | 7 | using PlantUmlViewer.Helpers; 8 | 9 | namespace PlantUmlViewer.DiagramGeneration.PlantUml 10 | { 11 | internal static class PlantUmlRunner 12 | { 13 | public static async Task Generate(string javaExecutable, string plantUmlJar, 14 | PlantUmlArguments plantUmlArguments, string code, CancellationToken cancellationToken = default) 15 | { 16 | if (!File.Exists(javaExecutable)) 17 | { 18 | throw new FileNotFoundException($"Java executable '{javaExecutable}' does not exist"); 19 | } 20 | if (!File.Exists(plantUmlJar)) 21 | { 22 | throw new FileNotFoundException($"PlantUML JAR '{plantUmlJar}' does not exist"); 23 | } 24 | 25 | ProcessResult result = await ProcessHelper.RunProcessAsync(javaExecutable, 26 | new string[] 27 | { 28 | "-Dfile.encoding=UTF-8", 29 | "-DPLANTUML_SECURITY_PROFILE=UNSECURE", 30 | "-jar", 31 | $"\"{plantUmlJar}\"", 32 | "-pipe", 33 | "-charset UTF-8", 34 | GetOutputFormatArgument(plantUmlArguments.OutputFormat), 35 | GetErrorFormatArgument(plantUmlArguments.ErrorFormat), 36 | $"-filedir \"{plantUmlArguments.FileDirectory}\"", 37 | string.IsNullOrEmpty(plantUmlArguments.Include) ? string.Empty : $"\"-I{plantUmlArguments.Include}\"", 38 | string.IsNullOrEmpty(plantUmlArguments.FileName) ? string.Empty : $"-filename \"{plantUmlArguments.FileName}\"", 39 | string.IsNullOrEmpty(plantUmlArguments.Delimitor) ? string.Empty : $"-pipedelimitor \"{plantUmlArguments.Delimitor}\"", 40 | $"-pipeimageindex {plantUmlArguments.ImageIndex}" 41 | }, 42 | plantUmlArguments.FileDirectory, Encoding.UTF8.GetBytes(code), cancellationToken); 43 | if (result.ExitCode != 0) 44 | { 45 | string message = Encoding.UTF8.GetString(result.Error); 46 | throw new RenderException(code, message); 47 | } 48 | return result.Output; 49 | } 50 | 51 | private static string GetOutputFormatArgument(OutputFormat outputFormat) 52 | { 53 | switch (outputFormat) 54 | { 55 | case OutputFormat.Svg: 56 | return "-tsvg"; 57 | case OutputFormat.Png: 58 | return "-tpng"; 59 | case OutputFormat.Eps: 60 | return "-teps"; 61 | case OutputFormat.Pdf: 62 | return "-tpdf"; 63 | case OutputFormat.Vdx: 64 | return "-tvdx"; 65 | case OutputFormat.Xmi: 66 | return "-txmi"; 67 | case OutputFormat.Scxml: 68 | return "-tscxml"; 69 | case OutputFormat.Html: 70 | return "-thtml"; 71 | case OutputFormat.Ascii: 72 | return "-ttxt"; 73 | case OutputFormat.AsciiUnicode: 74 | return "-tutxt"; 75 | case OutputFormat.LaTeX: 76 | return "-tlatex"; 77 | default: 78 | throw new NotImplementedException($"Invalid {nameof(OutputFormat)}"); 79 | } 80 | } 81 | 82 | private static string GetErrorFormatArgument(ErrorFormat errorFormat) 83 | { 84 | switch (errorFormat) 85 | { 86 | case ErrorFormat.TwoLines: 87 | return ""; 88 | case ErrorFormat.SingleLine: 89 | return "-stdrpt:2"; 90 | case ErrorFormat.Verbose: 91 | return "-stdrpt:1"; 92 | default: 93 | throw new NotImplementedException($"Invalid {nameof(ErrorFormat)}"); 94 | } 95 | } 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /PlantUmlViewer/PlantUmlViewer/Windows/JavaLocator.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using System.Runtime.InteropServices; 4 | 5 | using Microsoft.Win32; 6 | 7 | namespace PlantUmlViewer.Windows 8 | { 9 | /// 10 | /// Allows localization of Java by checking JAVA_HOME, Windows registry and PATH 11 | /// 12 | internal static class JavaLocator 13 | { 14 | /// 15 | /// Gets the path of the Java executable by checking JAVA_HOME, Windows registry and PATH 16 | /// 17 | /// The path of the Java executable 18 | /// Failed to find Java checking JAVA_HOME, Windows registry and PATH 19 | /// "Found Java but the executable does not exist 20 | public static string GetJavaExecutable() 21 | { 22 | string javaExecutable; 23 | 24 | string javaHome = GetJavaHome(); 25 | if (!string.IsNullOrEmpty(javaHome)) 26 | { 27 | javaExecutable = Path.Combine(javaHome, "bin", "java.exe"); 28 | } 29 | else 30 | { 31 | javaExecutable = FindExecutableInPath("java.exe"); 32 | } 33 | 34 | if (string.IsNullOrEmpty(javaExecutable)) 35 | { 36 | throw new InvalidOperationException("Failed to find Java checking JAVA_HOME, Windows registry and PATH"); 37 | } 38 | if (!File.Exists(javaExecutable)) 39 | { 40 | throw new FileNotFoundException($"Found Java but the executable '{javaExecutable}' does not exist"); 41 | } 42 | return javaExecutable; 43 | } 44 | 45 | private static string GetJavaHome() 46 | { 47 | //First use JAVA_HOME 48 | string javaHome = Environment.GetEnvironmentVariable("JAVA_HOME"); 49 | if (!string.IsNullOrWhiteSpace(javaHome)) 50 | { 51 | return javaHome.Trim('"'); 52 | } 53 | 54 | //Else use Windows registry 55 | if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) 56 | { 57 | using (RegistryKey localMachineKey = Environment.Is64BitOperatingSystem ? 58 | RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry64) : Registry.LocalMachine) 59 | { 60 | using (RegistryKey rk = localMachineKey.OpenSubKey("SOFTWARE\\JavaSoft\\Java Runtime Environment\\")) 61 | { 62 | if (rk != null) 63 | { 64 | string currentVersion = rk.GetValue("CurrentVersion").ToString(); 65 | using (RegistryKey key = rk.OpenSubKey(currentVersion)) 66 | { 67 | if (key != null) 68 | { 69 | return key.GetValue("JavaHome").ToString(); 70 | } 71 | } 72 | } 73 | } 74 | } 75 | } 76 | 77 | return null; 78 | } 79 | 80 | private static string FindExecutableInPath(string executableName) 81 | { 82 | string pathEnv = Environment.GetEnvironmentVariable("PATH"); 83 | if (string.IsNullOrWhiteSpace(pathEnv)) 84 | { 85 | return null; 86 | } 87 | 88 | string[] paths = pathEnv.Split(Path.PathSeparator); 89 | foreach (string path in paths) 90 | { 91 | try 92 | { 93 | string fullPath = Path.Combine(path.Trim(), executableName); 94 | if (File.Exists(fullPath)) 95 | { 96 | return fullPath; 97 | } 98 | } 99 | catch 100 | { 101 | //Ignore invalid paths or access issues 102 | } 103 | } 104 | return null; 105 | } 106 | } 107 | } -------------------------------------------------------------------------------- /PlantUmlViewer/PlantUmlViewer/Resources/AboutText.rtf: -------------------------------------------------------------------------------- 1 | {\rtf1\ansi\ansicpg1252\deff0\nouicompat\deflang1031{\fonttbl{\f0\fnil\fcharset0 Calibri;}{\f1\fswiss\fprq2\fcharset0 Calibri;}{\f2\fnil\fcharset2 Symbol;}} 2 | {\colortbl ;\red0\green0\blue255;} 3 | {\*\generator Riched20 10.0.19041}\viewkind4\uc1 4 | \pard\sa200\sl276\slmult1\b\f0\fs24\lang7 License and credits\par 5 | 6 | \pard\sa200\sl240\slmult1\b0\fs22 PlantUML Viewer is released under the MIT License. This means, you can do with it whatever you want as long as you include the original copyright and license notice in any copy of the software.\par 7 | 8 | \pard\sl240\slmult1 This Notepad++ plugin integrates multiple other libraries and sources. Credits and thanks to all the developers working on these great projects:\par 9 | 10 | \pard{\pntext\f2\'B7\tab}{\*\pn\pnlvlblt\pnf2\pnindent0{\pntxtb\'B7}}\nowidctlpar\fi-360\li720\f1\lang1033 The plugin is based on the \i Notepad++ PluginPack.net\i0 ({{\field{\*\fldinst{HYPERLINK https://github.com/kbilsted/NotepadPlusPlusPluginPack.Net }}{\fldrslt{https://github.com/kbilsted/NotepadPlusPlusPluginPack.Net\ul0\cf0}}}}\f1\fs22 ) by Kasper B. Graversen provided under the Apache-2.0 license.\par 11 | {\pntext\f2\'B7\tab}The plugin uses \i SVG.NET\i0 ({{\field{\*\fldinst{HYPERLINK https://github.com/svg-net/SVG }}{\fldrslt{https://github.com/svg-net/SVG\ul0\cf0}}}}\f1\fs22 ) provided under the Microsoft Public License, which depends on\par 12 | 13 | \pard{\pntext\f2\'B7\tab}{\*\pn\pnlvlblt\pnf2\pnindent0{\pntxtb\'B7}}\nowidctlpar\fi-360\li1068\i ExCSS\i0 ({{\field{\*\fldinst{HYPERLINK https://github.com/TylerBrinks/ExCSS }}{\fldrslt{https://github.com/TylerBrinks/ExCSS\ul0\cf0}}}}\f1\fs22 ) by Tyler Brinks provided under the Microsoft Public License.\par 14 | 15 | \pard{\pntext\f2\'B7\tab}{\*\pn\pnlvlblt\pnf2\pnindent0{\pntxtb\'B7}}\nowidctlpar\fi-360\li720 The plugin uses the \i ImageBox Control\i0 ({{\field{\*\fldinst{HYPERLINK https://github.com/cyotek/Cyotek.Windows.Forms.ImageBox }}{\fldrslt{https://github.com/cyotek/Cyotek.Windows.Forms.ImageBox\ul0\cf0}}}}\f1\fs22 ) by Richard Moss provided under the MIT License.\par 16 | {\pntext\f2\'B7\tab}The plugin uses the \i LoadingCircle\i0 ({{\field{\*\fldinst{HYPERLINK https://www.codeproject.com/articles/14841/how-to-write-a-loading-circle-animation-in-net }}{\fldrslt{https://www.codeproject.com/articles/14841/how-to-write-a-loading-circle-animation-in-net\ul0\cf0}}}}\f1\fs22 ) by Martin Gagne provided under the Code Project Open License.\par 17 | {\pntext\f2\'B7\tab}The plugin uses \i Json.NET\i0 ({{\field{\*\fldinst{HYPERLINK https://www.newtonsoft.com/json }}{\fldrslt{https://www.newtonsoft.com/json\ul0\cf0}}}}\f1\fs22 ) by James Newton-King provided under the MIT License.\par 18 | {\pntext\f2\'B7\tab}The plugin uses \i Material Design Icons\i0 ({{\field{\*\fldinst{HYPERLINK https://materialdesignicons.com/ }}{\fldrslt{https://materialdesignicons.com/\ul0\cf0}}}}\f1\fs22 ) provided under the Pictogrammers Free License.\par 19 | {\pntext\f2\'B7\tab}The plugin is packed using \i ILMerge\i0 ({{\field{\*\fldinst{HYPERLINK https://github.com/dotnet/ILMerge }}{\fldrslt{https://github.com/dotnet/ILMerge\ul0\cf0}}}}\f1\fs22 ) provided under the MIT License.\par 20 | {\pntext\f2\'B7\tab}The plugin release includes the binaries of \i PlantUML\i0 ({{\field{\*\fldinst{HYPERLINK https://plantuml.com/ }}{\fldrslt{https://plantuml.com/\ul0\cf0}}}}\f1\fs22 ) which are free to use and released under the GNU General Public License.\par 21 | {\pntext\f2\'B7\tab}The plugin release includes the binaries of \i JLaTeXMath\i0 ({{\field{\*\fldinst{HYPERLINK https://github.com/opencollab/jlatexmath }}{\fldrslt{https://github.com/opencollab/jlatexmath\ul0\cf0}}}}\f1\fs22 ) which are free to use, released under the GNU General Public License and depend on\par 22 | 23 | \pard{\pntext\f2\'B7\tab}{\*\pn\pnlvlblt\pnf2\pnindent0{\pntxtb\'B7}}\nowidctlpar\fi-360\li1068 the binaries of \i The Apache\'99 Batik Project\i0 ({{\field{\*\fldinst{HYPERLINK https://xmlgraphics.apache.org/batik/ }}{\fldrslt{https://xmlgraphics.apache.org/batik/\ul0\cf0}}}}\f1\fs22 ) which are free to use and released under the Apache 2.0 license.\par 24 | 25 | \pard\sl240\slmult1\f0\lang7\par 26 | 27 | \pard\sa200\sl276\slmult1\b\fs24 Disclaimer\b0\fs22\par 28 | This source and the whole package comes without warranty. It may or may not harm your computer. Please use with care. Any damage cannot be related back to the author. The source has been tested on a virtual environment and scanned for viruses and has passed all tests.\par 29 | } 30 | -------------------------------------------------------------------------------- /PlantUmlViewer/PlantUmlViewer/PluginInfrastructure/DllExport/NppPlugin.DllExport.targets: -------------------------------------------------------------------------------- 1 | 3 | 5 | 8 | 9 | 11 | $(DevEnvDir)\..\..\VC\bin 12 | 13 | 14 | 27 | 28 | $(SDK40ToolsPath)..\NETFX 4.6.1 Tools 29 | $(SDK40ToolsPath)..\NETFX 4.6.2 Tools 30 | 31 | 32 | 33 | 34 | 49 | 50 | 54 | 55 | 60 | 61 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # 1.9.0.13 (14.12.2025) 2 | - PlantUML version updated to 1.2025.10 3 | - Improved Java path resolvement by also checking the PATH environment variable 4 | - Added option to define custom PlantUML path 5 | - Added buttons to check the Java and PlantUML paths in options 6 | - Fixed environment variables not available by executing PlantUML with the unsecure security profile 7 | 8 | # 1.8.0.12 (16.11.2024) 9 | - PlantUML version updated to 1.2024.8 10 | - Removed dependency to PlantUml.Net library 11 | - Removed dependency to Fizzler library 12 | - Added generated file information to support built in %filename() and %dirpath() preprocessor functions 13 | - Fixed diagram background not set e.g. if white 14 | 15 | # 1.7.0.11 (22.02.2024) 16 | - PlantUML version updated to 1.2024.3 17 | - Set generation working directory to current file to allow relative includes 18 | - SVG.NET library updated to 3.4.7, dependent ExCSS library updated to 4.2.3 to fix SVG export namespace prefix not set accordingly 19 | 20 | # 1.6.0.10 (13.07.2023) 21 | - PlantUML version updated to 1.2023.10 22 | - Added option to open the file after export 23 | - Added tooltip with potential generation error message to bottom status 24 | - Ignored non expected generation content due to Java accessibility hooks output like PowerAutomate 25 | - Fixed Notepad++ may freezes if plugin is docked out and looses focus 26 | - Fixed potential generation errors after a generation failed due to Plant UML executable issues 27 | - Json.NET library updated to 13.0.3 28 | 29 | # 1.5.0.9 (10.01.2023) 30 | - PlantUML version updated to 1.2023.0 31 | - Added fluent and dark style icons 32 | - Updated to common zoom and scroll behaviour Ctrl + mouse wheel to zoom and (Shift +) mouse wheel to scroll vertically and horizontally 33 | - Added include option 34 | - Added metadata with option to include generated document to SVG export 35 | - Disabled refresh button after generation until document was changed again 36 | - Grayed out disabled buttons 37 | - Fixed potential crash if generation failed 38 | - Fixed generation may takes exponentially long for diagrams producing big images 39 | - Fixed setting Java path in options not applied without restarting Notepad++ 40 | - Switched order of Ok and Cancel button in options window 41 | - Added information about used PlantUML version in about window 42 | - Json.NET library updated to 13.0.2 43 | - SVG.NET library updated to 3.4.4 44 | 45 | # 1.4.0.8 (07.10.2022) 46 | - Plugin target framework updated to .NET Framework 4.6.2 47 | - PlantUML version updated to 1.2022.8 48 | - Added support for multiple pages per document 49 | - Added error if the input document is not UTF-8 encoded 50 | - Added file name of generated diagram to bottom status bar 51 | - Update plugin colors automatically if Notepad++ colors changed 52 | - Fixed potential crash aborting the generation 53 | - SVG.NET library updated to 3.4.3 54 | 55 | # 1.3.0.7 (16.08.2022) 56 | - PlantUML version updated to 1.2022.6 57 | - Included necessary binaries for JLatexMath and Batik to enable generation of formulas 58 | - Added support for multiple diagrams per document 59 | - Removed corresponding line to error message if diagram generation fails due to a syntax error which is not supported for multiple diagrams 60 | - Fixed using the text of the selected document in split mode 61 | - Added buttons to zoom 62 | - Used icons for all buttons 63 | - Used loading circle instead of progress bar to show refreshing 64 | - Added button to check for update in about window 65 | - Used custom modified version of PlantUml.Net library 66 | 67 | # 1.2.0.6 (11.06.2022) 68 | - Added export of SVG files 69 | - Added option to define the export size factor for PNG files 70 | - Added context menu to copy to clipboard and export diagram 71 | - Added corresponding line to error message if diagram generation fails due to a syntax error 72 | - Switched settings file format from *.ini to *.xml 73 | - Fixed crash generating large documents with more than 10000 characters 74 | - Fixed bottom status bar overlapping the diagrams horizontal scroll bar 75 | 76 | # 1.1.1.5 (27.05.2022) 77 | - Removed shortcut Shift + U 78 | 79 | # 1.1.0.4 (27.05.2022) 80 | - Added support for dark interfaces 81 | - Implemented cancellation of an ongoing generation 82 | - Improved error message if Java was not found 83 | - Extended icon to highlight itself and close preview if opened 84 | - Added menu entry and shortcut Shift + U to refresh diagram 85 | - Renamed settings to options 86 | 87 | # 1.0.2.3 (22.05.2022) 88 | - Fixed generation fails for release builds 89 | - Removed error for generation of empty documents 90 | 91 | # 1.0.1.2 (22.05.2022) 92 | - Fixed generation fails if Notepad++ installation path contains special characters 93 | 94 | # 1.0.0.1 (21.05.2022) 95 | - Initial release 96 | -------------------------------------------------------------------------------- /PlantUmlViewer/PlantUmlViewer/Forms/AboutWindow.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.ComponentModel; 3 | using System.Diagnostics; 4 | using System.Net; 5 | using System.Net.Http; 6 | using System.Windows.Forms; 7 | 8 | using Newtonsoft.Json.Linq; 9 | 10 | namespace PlantUmlViewer.Forms 11 | { 12 | internal partial class AboutWindow : Form 13 | { 14 | public AboutWindow() 15 | { 16 | InitializeComponent(); 17 | 18 | this.Text = "About " + PlantUmlViewer.PLUGIN_NAME; 19 | this.label_ProductName.Text = AssemblyAttributes.Product; 20 | this.label_PluginVersion.Text = string.Format("Plugin version {0}", AssemblyAttributes.Version); 21 | this.label_PlantUmlVersion.Text = string.Format("PlantUML version {0}", PlantUmlViewer.PLANT_UML_VERSION); 22 | this.label_Copyright.Text = AssemblyAttributes.Copyright; 23 | this.richTextBox_Text.SelectedRtf = Properties.Resources.AboutText; 24 | } 25 | 26 | protected override void OnClosing(CancelEventArgs e) 27 | { 28 | //Cancel closing if checking for updates ongoing 29 | if (loadingCircle_checkForUpdate.Active) 30 | { 31 | e.Cancel = true; 32 | } 33 | base.OnClosing(e); 34 | } 35 | 36 | private void LinkLabel_Github_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) 37 | { 38 | linkLabel_Github.LinkVisited = true; 39 | Process.Start("https://github.com/Fruchtzwerg94/PlantUmlViewer"); 40 | } 41 | 42 | private void LinkLabel_Mail_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) 43 | { 44 | linkLabel_Mail.LinkVisited = true; 45 | Process.Start($"mailto:phi_dev@gmx.de?subject={PlantUmlViewer.PLUGIN_NAME}"); 46 | } 47 | 48 | private void LinkLabel_Donate_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) 49 | { 50 | linkLabel_Donate.LinkVisited = true; 51 | Process.Start("https://www.paypal.me/schmidtph"); 52 | } 53 | 54 | private async void Button_CheckForUpdate_Click(object sender, EventArgs e) 55 | { 56 | button_CheckForUpdate.Enabled = false; 57 | loadingCircle_checkForUpdate.Active = true; 58 | loadingCircle_checkForUpdate.Visible = true; 59 | try 60 | { 61 | ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12; 62 | using (HttpClient client = new HttpClient() 63 | { 64 | Timeout = TimeSpan.FromSeconds(3) 65 | }) 66 | { 67 | client.DefaultRequestHeaders.UserAgent.ParseAdd("request"); 68 | HttpResponseMessage response = await client.GetAsync("https://api.github.com/repos/Fruchtzwerg94/PlantUmlViewer/releases").ConfigureAwait(true); 69 | response.EnsureSuccessStatusCode(); 70 | string responseBody = await response.Content.ReadAsStringAsync().ConfigureAwait(true); 71 | JArray responseArray = JArray.Parse(responseBody); 72 | JToken latestRelease = responseArray[0]; 73 | string latestReleaseVersion = latestRelease.Value("name"); 74 | string latestReleaseUrl = latestRelease.Value("html_url"); 75 | 76 | if (latestReleaseVersion == AssemblyAttributes.Version) 77 | { 78 | MessageBox.Show(IsDisposed ? null : this, "You are using the latest release", "Congrats", MessageBoxButtons.OK, MessageBoxIcon.Information); 79 | } 80 | else if (MessageBox.Show(IsDisposed ? null : this, $"A newer version {latestReleaseVersion} is available, do you wish to proceed to the download site?", "Update available", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes) 81 | { 82 | Process.Start(latestReleaseUrl); 83 | } 84 | } 85 | } 86 | catch (Exception ex) 87 | { 88 | MessageBox.Show(IsDisposed ? null : this, ex.Message, "Failed to get the latest release information", MessageBoxButtons.OK, MessageBoxIcon.Error); 89 | } 90 | finally 91 | { 92 | this.InvokeIfRequired(() => 93 | { 94 | loadingCircle_checkForUpdate.Visible = false; 95 | loadingCircle_checkForUpdate.Active = false; 96 | button_CheckForUpdate.Enabled = true; 97 | }); 98 | } 99 | } 100 | } 101 | } 102 | -------------------------------------------------------------------------------- /PlantUmlViewer/PlantUmlViewer/PluginInfrastructure/NotepadPPGateway.cs: -------------------------------------------------------------------------------- 1 | // NPP plugin platform for .Net v0.94.00 by Kasper B. Graversen etc. 2 | using System; 3 | using System.Drawing; 4 | using System.Runtime.InteropServices; 5 | using System.Text; 6 | using NppPluginNET.PluginInfrastructure; 7 | 8 | namespace Kbg.NppPluginNET.PluginInfrastructure 9 | { 10 | public interface INotepadPPGateway 11 | { 12 | void FileNew(); 13 | 14 | void AddToolbarIcon(int funcItemsIndex, toolbarIcons icon); 15 | void AddToolbarIcon(int funcItemsIndex, Bitmap icon); 16 | string GetNppPath(); 17 | string GetPluginConfigPath(); 18 | string GetCurrentFilePath(); 19 | unsafe string GetFilePath(int bufferId); 20 | void SetCurrentLanguage(LangType language); 21 | bool OpenFile(string path); 22 | } 23 | 24 | /// 25 | /// This class holds helpers for sending messages defined in the Msgs_h.cs file. It is at the moment 26 | /// incomplete. Please help fill in the blanks. 27 | /// 28 | public class NotepadPPGateway : INotepadPPGateway 29 | { 30 | private const int Unused = 0; 31 | 32 | public void FileNew() 33 | { 34 | Win32.SendMessage(PluginBase.nppData._nppHandle, (uint) NppMsg.NPPM_MENUCOMMAND, Unused, NppMenuCmd.IDM_FILE_NEW); 35 | } 36 | 37 | public void AddToolbarIcon(int funcItemsIndex, toolbarIcons icon) 38 | { 39 | IntPtr pTbIcons = Marshal.AllocHGlobal(Marshal.SizeOf(icon)); 40 | try { 41 | Marshal.StructureToPtr(icon, pTbIcons, false); 42 | _ = Win32.SendMessage( 43 | PluginBase.nppData._nppHandle, 44 | (uint) NppMsg.NPPM_ADDTOOLBARICON_FORDARKMODE, 45 | PluginBase._funcItems.Items[funcItemsIndex]._cmdID, 46 | pTbIcons); 47 | } finally { 48 | Marshal.FreeHGlobal(pTbIcons); 49 | } 50 | } 51 | 52 | public void AddToolbarIcon(int funcItemsIndex, Bitmap icon) 53 | { 54 | var tbi = new toolbarIcons(); 55 | tbi.hToolbarBmp = icon.GetHbitmap(); 56 | AddToolbarIcon(funcItemsIndex, tbi); 57 | } 58 | 59 | /// 60 | /// Gets the path of the current document. 61 | /// 62 | public string GetCurrentFilePath() 63 | { 64 | var path = new StringBuilder(2000); 65 | Win32.SendMessage(PluginBase.nppData._nppHandle, (uint)NppMsg.NPPM_GETFULLCURRENTPATH, 0, path); 66 | return path.ToString(); 67 | } 68 | 69 | /// 70 | /// This method incapsulates a common pattern in the Notepad++ API: when 71 | /// you need to retrieve a string, you can first query the buffer size. 72 | /// This method queries the necessary buffer size, allocates the temporary 73 | /// memory, then returns the string retrieved through that buffer. 74 | /// 75 | /// Message ID of the data string to query. 76 | /// String returned by Notepad++. 77 | public string GetString(NppMsg message) 78 | { 79 | int len = Win32.SendMessage( 80 | PluginBase.nppData._nppHandle, 81 | (uint) message, Unused, Unused).ToInt32() 82 | + 1; 83 | var res = new StringBuilder(len); 84 | _ = Win32.SendMessage( 85 | PluginBase.nppData._nppHandle, (uint) message, len, res); 86 | return res.ToString(); 87 | } 88 | 89 | /// The path to the Notepad++ executable. 90 | public string GetNppPath() 91 | => GetString(NppMsg.NPPM_GETNPPDIRECTORY); 92 | 93 | /// The path to the Config folder for plugins. 94 | public string GetPluginConfigPath() 95 | => GetString(NppMsg.NPPM_GETPLUGINSCONFIGDIR); 96 | 97 | /// 98 | /// Open a file for editing in Notepad++, pretty much like using the app's 99 | /// File - Open menu. 100 | /// 101 | /// The path to the file to open. 102 | /// True on success. 103 | public bool OpenFile(string path) 104 | => Win32.SendMessage( 105 | PluginBase.nppData._nppHandle, (uint) NppMsg.NPPM_DOOPEN, Unused, path).ToInt32() 106 | != 0; 107 | 108 | /// 109 | /// Gets the path of the current document. 110 | /// 111 | public unsafe string GetFilePath(int bufferId) 112 | { 113 | var path = new StringBuilder(2000); 114 | Win32.SendMessage(PluginBase.nppData._nppHandle, (uint) NppMsg.NPPM_GETFULLPATHFROMBUFFERID, bufferId, path); 115 | return path.ToString(); 116 | } 117 | 118 | public void SetCurrentLanguage(LangType language) 119 | { 120 | Win32.SendMessage(PluginBase.nppData._nppHandle, (uint) NppMsg.NPPM_SETCURRENTLANGTYPE, Unused, (int) language); 121 | } 122 | } 123 | 124 | /// 125 | /// This class holds helpers for sending messages defined in the Resource_h.cs file. It is at the moment 126 | /// incomplete. Please help fill in the blanks. 127 | /// 128 | class NppResource 129 | { 130 | private const int Unused = 0; 131 | 132 | public void ClearIndicator() 133 | { 134 | Win32.SendMessage(PluginBase.nppData._nppHandle, (uint) Resource.NPPM_INTERNAL_CLEARINDICATOR, Unused, Unused); 135 | } 136 | } 137 | } 138 | -------------------------------------------------------------------------------- /PlantUmlViewer/PlantUmlViewer/Helpers/ProcessExtensions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Diagnostics; 3 | using System.IO; 4 | using System.Threading; 5 | using System.Threading.Tasks; 6 | 7 | namespace PlantUmlViewer.Helpers 8 | { 9 | /// 10 | /// Process result data 11 | /// 12 | internal class ProcessResult 13 | { 14 | /// 15 | /// The read to an array of bytes 16 | /// 17 | public byte[] Output { get; } 18 | 19 | /// 20 | /// The read to an array of bytes 21 | /// 22 | public byte[] Error { get; } 23 | 24 | /// 25 | /// The code that the associated process specified when it terminated 26 | /// 27 | public int ExitCode { get; } 28 | 29 | /// 30 | /// Initializes a new instance of the ProcessResult class 31 | /// 32 | /// The read to an array of bytes 33 | /// The read to an array of bytes 34 | /// The code that the associated process specified when it terminated 35 | public ProcessResult(byte[] output, byte[] error, int exitCode) 36 | { 37 | Output = output; 38 | Error = error; 39 | ExitCode = exitCode; 40 | } 41 | } 42 | 43 | /// 44 | /// Provides extension methods for the 45 | /// 46 | internal static class ProcessExtensions 47 | { 48 | /// 49 | /// Asynchronously runs a process 50 | /// 51 | /// The process to run 52 | /// Data to write to the standard input of the process 53 | /// A to cancel execution and kill the process 54 | /// A task running the process and providing its result 55 | /// Failed to start process 56 | public static async Task RunAsync(this Process process, byte[] input = null, 57 | CancellationToken cancellationToken = default) 58 | { 59 | process.EnableRaisingEvents = true; 60 | 61 | TaskCompletionSource tcs = new TaskCompletionSource(); 62 | if (cancellationToken != CancellationToken.None) 63 | { 64 | cancellationToken.Register(() => 65 | { 66 | if (tcs.TrySetCanceled()) 67 | { 68 | try 69 | { 70 | process.Kill(); 71 | } 72 | catch 73 | { 74 | //Nothing else we can do here 75 | } 76 | } 77 | }); 78 | } 79 | 80 | if (!process.Start()) 81 | { 82 | throw new InvalidOperationException("Failed to start process " + process); 83 | } 84 | 85 | if (input != null) 86 | { 87 | await process.StandardInput.BaseStream 88 | .WriteAsync(input, 0, input.Length, cancellationToken).ConfigureAwait(false); 89 | await process.StandardInput.FlushAsync().ConfigureAwait(false); 90 | process.StandardInput.Close(); 91 | } 92 | 93 | _ = Task.Run(() => 94 | { 95 | ProcessResult result = new ProcessResult( 96 | process.GetOutput(), process.GetError(), process.ExitCode); 97 | tcs.SetResult(result); 98 | }, CancellationToken.None); 99 | 100 | return await tcs.Task.ConfigureAwait(false); 101 | } 102 | 103 | /// 104 | /// Reads the to an array 105 | /// 106 | /// 107 | /// The read to an array of bytes 108 | public static byte[] GetOutput(this Process process) 109 | { 110 | return ExtractBytes(process.StandardOutput.BaseStream); 111 | } 112 | 113 | /// 114 | /// Reads the to an array 115 | /// 116 | /// 117 | /// The read to an array of bytes 118 | public static byte[] GetError(this Process process) 119 | { 120 | return ExtractBytes(process.StandardError.BaseStream); 121 | } 122 | 123 | private static byte[] ExtractBytes(Stream stream) 124 | { 125 | using (MemoryStream memoryStream = new MemoryStream()) 126 | { 127 | stream.CopyTo(memoryStream); 128 | return memoryStream.ToArray(); 129 | } 130 | } 131 | } 132 | } 133 | -------------------------------------------------------------------------------- /PlantUmlViewer/PlantUmlViewer/Forms/OptionsWindow.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using System.Text; 4 | using System.Windows.Forms; 5 | 6 | using PlantUmlViewer.Helpers; 7 | using PlantUmlViewer.Settings; 8 | using PlantUmlViewer.Windows; 9 | 10 | namespace PlantUmlViewer.Forms 11 | { 12 | internal partial class OptionsWindow : Form 13 | { 14 | private readonly SettingsService settings; 15 | 16 | public OptionsWindow(SettingsService settings) 17 | { 18 | this.settings = settings; 19 | 20 | InitializeComponent(); 21 | 22 | this.Text = PlantUmlViewer.PLUGIN_NAME + " options"; 23 | 24 | comboBox_OpenExport.DataSource = Enum.GetValues(typeof(OpenExport)); 25 | 26 | textBox_JavaPath.Text = settings.Settings.JavaPath; 27 | textBox_PlantUmlPath.Text = settings.Settings.PlantUmlPath; 28 | textBox_Include.Text = settings.Settings.Include; 29 | numericUpDown_ExportSizeFactor.Value = settings.Settings.ExportSizeFactor; 30 | checkBox_ExportDocument.Checked = settings.Settings.ExportDocument; 31 | comboBox_OpenExport.SelectedItem = settings.Settings.OpenExport; 32 | } 33 | 34 | private void Button_Ok_Click(object sender, EventArgs e) 35 | { 36 | settings.Settings.JavaPath = textBox_JavaPath.Text; 37 | settings.Settings.PlantUmlPath = textBox_PlantUmlPath.Text; 38 | settings.Settings.Include = textBox_Include.Text; 39 | settings.Settings.ExportSizeFactor = numericUpDown_ExportSizeFactor.Value; 40 | settings.Settings.ExportDocument = checkBox_ExportDocument.Checked; 41 | settings.Settings.OpenExport = (OpenExport)comboBox_OpenExport.SelectedValue; 42 | settings.Save(); 43 | 44 | DialogResult = DialogResult.OK; 45 | } 46 | 47 | private async void Button_JavaPathCheck_Click(object sender, EventArgs e) 48 | { 49 | string javaExecutable = textBox_JavaPath.Text; 50 | if (string.IsNullOrWhiteSpace(javaExecutable)) 51 | { 52 | try 53 | { 54 | javaExecutable = JavaLocator.GetJavaExecutable(); 55 | } 56 | catch (Exception ex) 57 | { 58 | MessageBox.Show(this, $"Failed to locate Java:{Environment.NewLine}{ex.Message}", "Java check", 59 | MessageBoxButtons.OK, MessageBoxIcon.Error); 60 | return; 61 | } 62 | } 63 | 64 | string javaVersionInformation; 65 | try 66 | { 67 | ProcessResult result = await ProcessHelper.RunProcessAsync( 68 | javaExecutable, new string[] { "-version" }, null); 69 | if (result.ExitCode != 0) 70 | { 71 | string message = Encoding.UTF8.GetString(result.Error); 72 | throw new IOException(message); 73 | } 74 | //Get version information from stderr 75 | javaVersionInformation = Encoding.UTF8.GetString(result.Error); 76 | } 77 | catch (Exception ex) 78 | { 79 | MessageBox.Show(this, $"Failed to run Java:{Environment.NewLine}{javaExecutable}{Environment.NewLine}{ex.Message}", "Java check", 80 | MessageBoxButtons.OK, MessageBoxIcon.Error); 81 | return; 82 | } 83 | MessageBox.Show(this, $"Java executable found:{Environment.NewLine}{javaExecutable}{Environment.NewLine}{javaVersionInformation}", 84 | "Java check", MessageBoxButtons.OK, MessageBoxIcon.Information); 85 | } 86 | 87 | private async void Button_PlantUmlPathCheck_Click(object sender, EventArgs e) 88 | { 89 | string javaExecutable = textBox_JavaPath.Text; 90 | if (string.IsNullOrWhiteSpace(javaExecutable)) 91 | { 92 | try 93 | { 94 | javaExecutable = JavaLocator.GetJavaExecutable(); 95 | } 96 | catch (InvalidOperationException ex) 97 | { 98 | MessageBox.Show(this, $"Java not found:{Environment.NewLine}{ex.Message}", 99 | "PlantUML check", MessageBoxButtons.OK, MessageBoxIcon.Error); 100 | return; 101 | } 102 | } 103 | javaExecutable = PathHelper.ResolvePathToAssembly(javaExecutable); 104 | 105 | string plantUmlJar = textBox_PlantUmlPath.Text; 106 | if (string.IsNullOrWhiteSpace(plantUmlJar)) 107 | { 108 | plantUmlJar = PlantUmlViewer.PLANT_UML_JAR; 109 | } 110 | plantUmlJar = PathHelper.ResolvePathToAssembly(plantUmlJar); 111 | 112 | string plantUmlVersionInformation; 113 | try 114 | { 115 | ProcessResult result = await ProcessHelper.RunProcessAsync(javaExecutable, 116 | new string[] { "-jar", $"\"{plantUmlJar}\"", "-version" }, null); 117 | if (result.ExitCode != 0) 118 | { 119 | throw new IOException($"Code {result.ExitCode}: {Encoding.UTF8.GetString(result.Error)}"); 120 | } 121 | //Get version information from stdout 122 | plantUmlVersionInformation = Encoding.UTF8.GetString(result.Output); 123 | } 124 | catch (Exception ex) 125 | { 126 | MessageBox.Show(this, $"Failed to run PlantUML:{Environment.NewLine}{plantUmlJar}{Environment.NewLine}{ex.Message}", 127 | "PlantUML check", MessageBoxButtons.OK, MessageBoxIcon.Error); 128 | return; 129 | } 130 | MessageBox.Show(this, $"PlantUML valid:{Environment.NewLine}{plantUmlJar}{Environment.NewLine}{plantUmlVersionInformation}", 131 | "PlantUML check", MessageBoxButtons.OK, MessageBoxIcon.Information); 132 | } 133 | } 134 | } 135 | -------------------------------------------------------------------------------- /PlantUmlViewer/PlantUmlViewer/Forms/PreviewWindow.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | 17, 17 122 | 123 | 124 | 172, 17 125 | 126 | 127 | 372, 17 128 | 129 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # PlantUML Viewer 2 | [![License](https://img.shields.io/github/license/Fruchtzwerg94/PlantUmlViewer)](LICENSE) 3 | [![Downloads](https://img.shields.io/github/downloads/Fruchtzwerg94/PlantUmlViewer/total)](https://tooomm.github.io/github-release-stats/?username=Fruchtzwerg94&repository=PlantUmlViewer) 4 | [![Release](https://img.shields.io/github/v/release/Fruchtzwerg94/PlantUmlViewer)](https://github.com/Fruchtzwerg94/PlantUmlViewer/releases) 5 | [![Build status](https://github.com/Fruchtzwerg94/PlantUmlViewer/actions/workflows/CI_build.yml/badge.svg?branch=master)](https://github.com/Fruchtzwerg94/PlantUmlViewer/actions/workflows/CI_build.yml) 6 | [![Donate](https://img.shields.io/badge/Donate-PayPal-blue.svg)](https://www.paypal.me/SchmidtPh) 7 | 8 | A [Notepad++](https://notepad-plus-plus.org/) plugin to generate, view and export [PlantUML](https://plantuml.com/) diagrams. 9 | 10 | ## Features 11 | * Official and full PlantUML syntax 12 | * Multiple diagrams and pages per document supported 13 | * Dockable panel to show the generated PlantUML diagrams 14 | * Zoomable diagrams 15 | * Export of diagrams as PNG or SVG 16 | * Dark mode support 17 | 18 | ## Latest changes 19 | You can find the latest and all other changes in the [changelog](CHANGELOG.md). 20 | 21 | ## Installation 22 | Detailed information about plugins and how they are installed can be found in the [Notepad++ User Manual](https://npp-user-manual.org/docs/plugins/). 23 | 24 | ### Manual 25 | Download a [release version](https://github.com/Fruchtzwerg94/PlantUmlViewer/releases) and copy the folder *PlantUmlViewer* with its content to the *plugins* subfolder of your Notepad++ installation directory. 26 | 27 | ### Plugins Admin (recommended) 28 | Use the built-in *Plugins Admin* to install it directly. Just open Notepad++ and navigate to *Plugins* → *Plugins Admin*. Here under the *Available* tab, search for *PlantUML Viewer*. After checking the corresponding box, click *Install* at the top right corner of the window. 29 | 30 | ### Compatibility 31 | This plugin requires at least 32 | * Notepad++ 32-bit or 64-bit 33 | * .NET Framework 4.6.2 or above 34 | * Java 35 | 36 | ## Usage 37 | PlantUML Viewer can be opened 38 | * by clicking the toolbar icon ![UML icon](PlantUmlViewer/PlantUmlViewer/Resources/Image.png) 39 | * via the Notepad++ *Plugins* submenu (*Plugins* → *PlantUML Viewer* → *Preview PlantUML*) 40 | 41 | ![PlantUML Viewer](doc/PlantUmlViewer.png) 42 | ![PlantUML Viewer dark](doc/PlantUmlViewerDark.png) 43 | 44 | By clicking the *Refresh* () button the diagram(s) are generated out of the current opened document. The file extension doesn't matter. 45 | The diagram can be 46 | * moved by dragging it, 47 | * zoomed by Ctrl + mouse wheel or clicking the buttons ( / / ) 48 | * or scrolled vertically and horizontally by (Shift +) mouse wheel. 49 | 50 | The currently showed diagram can be exported or copied to clipboard as PNG or SVG image by clicking the *Export* () button or using the right click context menu. 51 | If your document contains multiple diagrams and or pages, you can use the navigation buttons to show the next () or previous () diagram and next () or previous () page. 52 | 53 | Make sure Java is proeprly installed and referenced in your environment, it can be also specified through the options available in the plugins options window. 54 | 55 | ![PlantUML Viewer menu](doc/Menu.png) 56 | ![PlantUML Viewer options](doc/Options.png) 57 | 58 | ### Usability hints 59 | * You may also want use this plugin in combination with [PlantUML_Notepad-_UDL](https://github.com/brianmaher84/PlantUML_Notepad-_UDL), which enables the PlantUML language syntax for Notepad++. 60 | * Using the *Shortcut Mapper*, which is accessible via the *Settings* submenu of Notepad++, you can define a shortcut to generate the diagrams. 61 | 62 | ## License and credits 63 | PlantUML Viewer is released under the [MIT License](LICENSE). This means, you can do with it whatever you want as long as you include the original copyright and license notice in any copy of the software. 64 | 65 | This Notepad++ plugin integrates multiple other libraries and sources. Credits and thanks to all the developers working on these great projects: 66 | * The plugin is based on the [Notepad++ PluginPack.net](https://github.com/kbilsted/NotepadPlusPlusPluginPack.Net) by Kasper B. Graversen provided under the Apache 2.0 license. 67 | * The plugin uses [SVG.NET](https://github.com/svg-net/SVG) provided under the Microsoft Public License which depends on 68 | * [ExCSS](https://github.com/TylerBrinks/ExCSS) by Tyler Brinks provided under the Microsoft Public License. 69 | * The plugin uses the [ImageBox Control](https://github.com/cyotek/Cyotek.Windows.Forms.ImageBox) by Richard Moss provided under the MIT License. 70 | * The plugin uses the [LoadingCircle](https://www.codeproject.com/articles/14841/how-to-write-a-loading-circle-animation-in-net) by Martin Gagne provided under the Code Project Open License. 71 | * The plugin uses [Json.NET](https://www.newtonsoft.com/json) by James Newton-King provided under the MIT License. 72 | * The plugin uses [Material Design Icons](https://materialdesignicons.com/) provided under the Pictogrammers Free License. 73 | * The plugin is packed using [ILMerge](https://github.com/dotnet/ILMerge) provided under the MIT License. 74 | * The plugin release includes the binaries of [PlantUML](https://plantuml.com/) which are free to use and released under the GNU General Public License. 75 | * The plugin release includes the binaries of [JLaTeXMath](https://github.com/opencollab/jlatexmath) which are free to use, released under the GNU General Public License and depend on 76 | * the binaries of [The Apache™ Batik Project](https://xmlgraphics.apache.org/batik/) which are free to use and released under the Apache 2.0 license. 77 | 78 | ## Feedback, issues and contribution 79 | Resonable feedback, issues and contributions are always very welcome. Feel free to bring in your points! 80 | 81 | ## Disclaimer 82 | This source and the whole package comes without warranty. It may or may not harm your computer. Please use with care. Any damage cannot be related back to the author. The source has been tested on a virtual environment and scanned for viruses and has passed all tests. 83 | 84 | ## Personal Note 85 | *I've created this software in my leasure time since I found no comparable solution to preview PlantUML diagrams seamlessly in Notepad++. This software (with all its bugs) is not aiming to be an enterprise solution. It surely will not fulfill the needs of everybody. But it maybe is a nice little helper for some of you. I am always open for your reasonable feedback, issues and contributions. Feel free to contact me and have fun with it.* 86 | -------------------------------------------------------------------------------- /PlantUmlViewer/PlantUmlViewer/PluginInfrastructure/NppPluginNETHelper.cs: -------------------------------------------------------------------------------- 1 | // NPP plugin platform for .Net v0.94.00 by Kasper B. Graversen etc. 2 | using System; 3 | using System.Text; 4 | using System.Windows.Forms; 5 | using System.Collections.Generic; 6 | using System.Runtime.InteropServices; 7 | 8 | namespace Kbg.NppPluginNET.PluginInfrastructure 9 | { 10 | [StructLayout(LayoutKind.Sequential)] 11 | public struct NppData 12 | { 13 | public IntPtr _nppHandle; 14 | public IntPtr _scintillaMainHandle; 15 | public IntPtr _scintillaSecondHandle; 16 | } 17 | 18 | public delegate void NppFuncItemDelegate(); 19 | 20 | [StructLayout(LayoutKind.Sequential)] 21 | public struct ShortcutKey 22 | { 23 | public ShortcutKey(bool isCtrl, bool isAlt, bool isShift, Keys key) 24 | { 25 | // the types 'bool' and 'char' have a size of 1 byte only! 26 | _isCtrl = Convert.ToByte(isCtrl); 27 | _isAlt = Convert.ToByte(isAlt); 28 | _isShift = Convert.ToByte(isShift); 29 | _key = Convert.ToByte(key); 30 | } 31 | public byte _isCtrl; 32 | public byte _isAlt; 33 | public byte _isShift; 34 | public byte _key; 35 | } 36 | 37 | [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] 38 | public struct FuncItem 39 | { 40 | [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 64)] 41 | public string _itemName; 42 | public NppFuncItemDelegate _pFunc; 43 | public int _cmdID; 44 | public bool _init2Check; 45 | public ShortcutKey _pShKey; 46 | } 47 | 48 | public class FuncItems : IDisposable 49 | { 50 | List _funcItems; 51 | int _sizeFuncItem; 52 | List _shortCutKeys; 53 | IntPtr _nativePointer; 54 | bool _disposed = false; 55 | 56 | public FuncItems() 57 | { 58 | _funcItems = new List(); 59 | _sizeFuncItem = Marshal.SizeOf(typeof(FuncItem)); 60 | _shortCutKeys = new List(); 61 | } 62 | 63 | [DllImport("kernel32")] 64 | static extern void RtlMoveMemory(IntPtr Destination, IntPtr Source, int Length); 65 | public void Add(FuncItem funcItem) 66 | { 67 | int oldSize = _funcItems.Count * _sizeFuncItem; 68 | _funcItems.Add(funcItem); 69 | int newSize = _funcItems.Count * _sizeFuncItem; 70 | IntPtr newPointer = Marshal.AllocHGlobal(newSize); 71 | 72 | if (_nativePointer != IntPtr.Zero) 73 | { 74 | RtlMoveMemory(newPointer, _nativePointer, oldSize); 75 | Marshal.FreeHGlobal(_nativePointer); 76 | } 77 | IntPtr ptrPosNewItem = (IntPtr)(newPointer.ToInt64() + oldSize); 78 | byte[] aB = Encoding.Unicode.GetBytes(funcItem._itemName + "\0"); 79 | Marshal.Copy(aB, 0, ptrPosNewItem, aB.Length); 80 | ptrPosNewItem = (IntPtr)(ptrPosNewItem.ToInt64() + 128); 81 | IntPtr p = (funcItem._pFunc != null) ? Marshal.GetFunctionPointerForDelegate(funcItem._pFunc) : IntPtr.Zero; 82 | Marshal.WriteIntPtr(ptrPosNewItem, p); 83 | ptrPosNewItem = (IntPtr)(ptrPosNewItem.ToInt64() + IntPtr.Size); 84 | Marshal.WriteInt32(ptrPosNewItem, funcItem._cmdID); 85 | ptrPosNewItem = (IntPtr)(ptrPosNewItem.ToInt64() + 4); 86 | Marshal.WriteInt32(ptrPosNewItem, Convert.ToInt32(funcItem._init2Check)); 87 | ptrPosNewItem = (IntPtr)(ptrPosNewItem.ToInt64() + 4); 88 | if (funcItem._pShKey._key != 0) 89 | { 90 | IntPtr newShortCutKey = Marshal.AllocHGlobal(4); 91 | Marshal.StructureToPtr(funcItem._pShKey, newShortCutKey, false); 92 | Marshal.WriteIntPtr(ptrPosNewItem, newShortCutKey); 93 | } 94 | else Marshal.WriteIntPtr(ptrPosNewItem, IntPtr.Zero); 95 | 96 | _nativePointer = newPointer; 97 | } 98 | 99 | public void RefreshItems() 100 | { 101 | IntPtr ptrPosItem = _nativePointer; 102 | for (int i = 0; i < _funcItems.Count; i++) 103 | { 104 | FuncItem updatedItem = new FuncItem(); 105 | updatedItem._itemName = _funcItems[i]._itemName; 106 | ptrPosItem = (IntPtr)(ptrPosItem.ToInt64() + 128); 107 | updatedItem._pFunc = _funcItems[i]._pFunc; 108 | ptrPosItem = (IntPtr)(ptrPosItem.ToInt64() + IntPtr.Size); 109 | updatedItem._cmdID = Marshal.ReadInt32(ptrPosItem); 110 | ptrPosItem = (IntPtr)(ptrPosItem.ToInt64() + 4); 111 | updatedItem._init2Check = _funcItems[i]._init2Check; 112 | ptrPosItem = (IntPtr)(ptrPosItem.ToInt64() + 4); 113 | updatedItem._pShKey = _funcItems[i]._pShKey; 114 | ptrPosItem = (IntPtr)(ptrPosItem.ToInt64() + IntPtr.Size); 115 | 116 | _funcItems[i] = updatedItem; 117 | } 118 | } 119 | 120 | public IntPtr NativePointer { get { return _nativePointer; } } 121 | public List Items { get { return _funcItems; } } 122 | 123 | public void Dispose() 124 | { 125 | if (!_disposed) 126 | { 127 | foreach (IntPtr ptr in _shortCutKeys) Marshal.FreeHGlobal(ptr); 128 | if (_nativePointer != IntPtr.Zero) Marshal.FreeHGlobal(_nativePointer); 129 | _disposed = true; 130 | } 131 | } 132 | ~FuncItems() 133 | { 134 | Dispose(); 135 | } 136 | } 137 | 138 | 139 | public enum winVer 140 | { 141 | WV_UNKNOWN, WV_WIN32S, WV_95, WV_98, WV_ME, WV_NT, WV_W2K, 142 | WV_XP, WV_S2003, WV_XPX64, WV_VISTA, WV_WIN7, WV_WIN8, WV_WIN81, WV_WIN10 143 | } 144 | 145 | 146 | [Flags] 147 | public enum DockMgrMsg : uint 148 | { 149 | IDB_CLOSE_DOWN = 137, 150 | IDB_CLOSE_UP = 138, 151 | IDD_CONTAINER_DLG = 139, 152 | 153 | IDC_TAB_CONT = 1027, 154 | IDC_CLIENT_TAB = 1028, 155 | IDC_BTN_CAPTION = 1050, 156 | 157 | DMM_MSG = 0x5000, 158 | DMM_CLOSE = (DMM_MSG + 1), 159 | DMM_DOCK = (DMM_MSG + 2), 160 | DMM_FLOAT = (DMM_MSG + 3), 161 | DMM_DOCKALL = (DMM_MSG + 4), 162 | DMM_FLOATALL = (DMM_MSG + 5), 163 | DMM_MOVE = (DMM_MSG + 6), 164 | DMM_UPDATEDISPINFO = (DMM_MSG + 7), 165 | DMM_GETIMAGELIST = (DMM_MSG + 8), 166 | DMM_GETICONPOS = (DMM_MSG + 9), 167 | DMM_DROPDATA = (DMM_MSG + 10), 168 | DMM_MOVE_SPLITTER = (DMM_MSG + 11), 169 | DMM_CANCEL_MOVE = (DMM_MSG + 12), 170 | DMM_LBUTTONUP = (DMM_MSG + 13), 171 | 172 | DMN_FIRST = 1050, 173 | DMN_CLOSE = (DMN_FIRST + 1), 174 | //nmhdr.Code = DWORD(DMN_CLOSE, 0)); 175 | //nmhdr.hwndFrom = hwndNpp; 176 | //nmhdr.IdFrom = ctrlIdNpp; 177 | 178 | DMN_DOCK = (DMN_FIRST + 2), 179 | DMN_FLOAT = (DMN_FIRST + 3) 180 | //nmhdr.Code = DWORD(DMN_XXX, int newContainer); 181 | //nmhdr.hwndFrom = hwndNpp; 182 | //nmhdr.IdFrom = ctrlIdNpp; 183 | } 184 | 185 | [StructLayout(LayoutKind.Sequential)] 186 | public struct toolbarIcons 187 | { 188 | public IntPtr hToolbarBmp; // standard icon (color) 189 | public IntPtr hToolbarIcon; // Fluent UI icon (black) 190 | public IntPtr hToolbarIconDarkMode; // Fluent UI icon (white) 191 | } 192 | } 193 | -------------------------------------------------------------------------------- /PlantUmlViewer/PlantUmlViewer/PlantUmlViewer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Drawing; 3 | using System.IO; 4 | using System.Reflection; 5 | using System.Runtime.InteropServices; 6 | 7 | using Kbg.NppPluginNET.PluginInfrastructure; 8 | 9 | using PlantUmlViewer.Forms; 10 | using PlantUmlViewer.Settings; 11 | 12 | namespace PlantUmlViewer 13 | { 14 | internal class PlantUmlViewer 15 | { 16 | public const string PLUGIN_NAME = "PlantUML Viewer"; 17 | public const string PLANT_UML_VERSION = "1.2025.10"; 18 | public const string PLANT_UML_JAR = "plantuml-" + PLANT_UML_VERSION + ".jar"; 19 | 20 | private enum CommandId 21 | { 22 | ShowPreview = 0, 23 | Refresh = 1, 24 | Separator1 = 2, 25 | ShowOptions = 3, 26 | ShowAbout = 4 27 | } 28 | 29 | private INotepadPPGateway notepadPp; 30 | private SettingsService settings; 31 | 32 | private PreviewWindow previewWindow; 33 | 34 | public PlantUmlViewer() 35 | { } 36 | 37 | public void OnNotification(ScNotification notification) 38 | { 39 | //NPPN_DARKMODECHANGED or NPPN_WORDSTYLESUPDATED 40 | if ( (notification.Header.Code == ((uint)NppMsg.NPPN_FIRST + 27)) 41 | || (notification.Header.Code == (uint)NppMsg.NPPN_WORDSTYLESUPDATED)) 42 | { 43 | UpdateStyle(); 44 | } 45 | //Text modification or document changed 46 | else if(( (notification.Header.Code == (uint)SciMsg.SCN_MODIFIED) 47 | && ((notification.ModificationType & ((int)SciMsg.SC_MOD_INSERTTEXT | (int)SciMsg.SC_MOD_DELETETEXT)) != 0)) 48 | || (notification.Header.Code == (uint)NppMsg.NPPN_BUFFERACTIVATED)) 49 | { 50 | previewWindow?.DocumentChanged(); 51 | } 52 | } 53 | 54 | public void CommandMenuInit() 55 | { 56 | notepadPp = new NotepadPPGateway(); 57 | settings = new SettingsService(notepadPp); 58 | 59 | PluginBase.SetCommand((int)CommandId.ShowPreview, "Preview PlantUML", ShowPreview); 60 | PluginBase.SetCommand((int)CommandId.Refresh, "Refresh", Refresh); 61 | PluginBase.SetCommand((int)CommandId.Separator1, "---", null); 62 | PluginBase.SetCommand((int)CommandId.ShowOptions, "Options", ShowOptions); 63 | PluginBase.SetCommand((int)CommandId.ShowAbout, "About", ShowAbout); 64 | } 65 | 66 | public void SetToolBarIcon() 67 | { 68 | notepadPp.AddToolbarIcon((int)CommandId.ShowPreview, new toolbarIcons() 69 | { 70 | hToolbarBmp = Properties.Resources.Image.GetHbitmap(), 71 | hToolbarIcon = Properties.Resources.IconFluent.Handle, 72 | hToolbarIconDarkMode = Properties.Resources.IconFluentDark.Handle 73 | }); 74 | 75 | VisibilityChanged(false); 76 | } 77 | 78 | public void PluginCleanUp() 79 | { } 80 | 81 | private void ShowPreview() 82 | { 83 | if (previewWindow == null) 84 | { 85 | previewWindow = new PreviewWindow(notepadPp.GetCurrentFilePath, GetText, settings); 86 | 87 | previewWindow.DockablePanelClose += (_, __) => VisibilityChanged(false); 88 | 89 | NppTbData nppTbData = new NppTbData 90 | { 91 | hClient = previewWindow.Handle, 92 | pszName = "PlantUML", 93 | dlgID = (int)CommandId.ShowPreview, 94 | uMask = NppTbMsg.DWS_DF_CONT_RIGHT | NppTbMsg.DWS_ICONTAB | NppTbMsg.DWS_ICONBAR, 95 | hIconTab = (uint)Properties.Resources.Icon.Handle, 96 | pszModuleName = PLUGIN_NAME 97 | }; 98 | IntPtr nppTbDataPtr = Marshal.AllocHGlobal(Marshal.SizeOf(nppTbData)); 99 | Marshal.StructureToPtr(nppTbData, nppTbDataPtr, false); 100 | 101 | Win32.SendMessage(PluginBase.nppData._nppHandle, (uint)NppMsg.NPPM_DMMREGASDCKDLG, 0, nppTbDataPtr); 102 | UpdateStyle(); 103 | } 104 | else 105 | { 106 | if (!previewWindow.Visible) 107 | { 108 | Win32.SendMessage(PluginBase.nppData._nppHandle, (uint)NppMsg.NPPM_DMMSHOW, 0, previewWindow.Handle); 109 | UpdateStyle(); 110 | } 111 | else 112 | { 113 | Win32.SendMessage(PluginBase.nppData._nppHandle, (uint)NppMsg.NPPM_DMMHIDE, 0, previewWindow.Handle); 114 | } 115 | } 116 | VisibilityChanged(previewWindow.Visible); 117 | } 118 | 119 | private static string GetText() 120 | { 121 | IScintillaGateway editor = new ScintillaGateway(PluginBase.GetCurrentScintilla()); 122 | if (editor.GetCodePage() != (int)SciMsg.SC_CP_UTF8) 123 | { 124 | throw new FileFormatException("File encoding invalid, please use UTF-8 as encoding"); 125 | } 126 | return editor.GetText(editor.GetLength() + 1); 127 | 128 | //const int GET_TEXT_STEP_SIZE = 10000; 129 | //StringBuilder textBuilder = new StringBuilder(); 130 | //int length = editor.GetLength(); 131 | //int position = 0; 132 | //int rest = length; 133 | //while (rest > 0) 134 | //{ 135 | // int step = Math.Min(rest, GET_TEXT_STEP_SIZE); 136 | // using (TextRange textRange = new TextRange(position, position + step, step + 1)) 137 | // { 138 | // int ret = editor.GetTextRange(textRange); 139 | // if (ret != step) 140 | // { 141 | // throw new Exception("Failed to get text"); 142 | // } 143 | // textBuilder.Append(textRange.lpstrText.TrimEnd('\0')); 144 | // } 145 | // position += step; 146 | // rest -= step; 147 | //} 148 | //return textBuilder.ToString(); 149 | } 150 | 151 | private void UpdateStyle() 152 | { 153 | IntPtr editorBachgroundColorPtr = Win32.SendMessage(PluginBase.nppData._nppHandle, 154 | (uint)NppMsg.NPPM_GETEDITORDEFAULTBACKGROUNDCOLOR, 0, 0); 155 | int bbggrr = editorBachgroundColorPtr.ToInt32(); 156 | Color editorBackgroundColor = Color.FromArgb(bbggrr & 0x0000FF, (bbggrr & 0x00FF00) >> 8, (bbggrr & 0xFF0000) >> 16); 157 | previewWindow?.SetStyle(editorBackgroundColor); 158 | } 159 | 160 | private void VisibilityChanged(bool visible) 161 | { 162 | //Check / uncheck icon 163 | Win32.SendMessage(PluginBase.nppData._nppHandle, (uint)NppMsg.NPPM_SETMENUITEMCHECK, 164 | PluginBase._funcItems.Items[(int)CommandId.ShowPreview]._cmdID, visible ? 1 : 0); 165 | 166 | //Enable / disable refresh menu entry 167 | IntPtr hMenu = Win32.SendMessage(PluginBase.nppData._nppHandle, 168 | (uint)NppMsg.NPPM_GETMENUHANDLE, (int)NppMsg.NPPPLUGINMENU, 0); 169 | Win32.EnableMenuItem(hMenu, PluginBase._funcItems.Items[(int)CommandId.Refresh]._cmdID, 170 | Win32.MF_BYCOMMAND | (visible ? Win32.MF_ENABLED : (Win32.MF_DISABLED | Win32.MF_GRAYED))); 171 | } 172 | 173 | private void Refresh() 174 | { 175 | if (previewWindow?.Visible == true) 176 | { 177 | previewWindow.Button_Refresh_Click(this, null); 178 | } 179 | } 180 | 181 | private void ShowOptions() 182 | { 183 | using (OptionsWindow optionsWindow = new OptionsWindow(settings)) 184 | { 185 | optionsWindow.ShowDialog(); 186 | } 187 | } 188 | 189 | private void ShowAbout() 190 | { 191 | using (AboutWindow aboutWindow = new AboutWindow()) 192 | { 193 | aboutWindow.ShowDialog(); 194 | } 195 | } 196 | } 197 | } 198 | -------------------------------------------------------------------------------- /PlantUmlViewer/PlantUmlViewer/Forms/AboutWindow.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | 122 | 123 | AAABAAEAEBAAAAAACABoBQAAFgAAACgAAAAQAAAAIAAAAAEACAAAAAAAAAEAAAAAAAAAAAAAAAEAAAAB 124 | AAAAAAAAOQAVADwEGAA+BxwAORCZADm6/wBIv/8AACzwABE9/wAxV/8AUXH/AHGL/wCRpf8Asb//ANHa 125 | /wD///8AAAAAAAAaLwAALVAAAD9wAABRkAAAY7AAAHbPAACI8AARmP8AMab/AFGz/wBxwf8Akc//ALHd 126 | /wDR6/8A////AAAAAAAALC8AAEtQAABocAAAhpAAAKWwAADDzwAA4fAAEe//ADHx/wBR8/8AcfX/AJH3 127 | /wCx+f8A0fv/AP///wAAAAAAAC8hAABQNwAAcEwAAJBjAACweQAAz48AAPCmABH/tAAx/74AUf/IAHH/ 128 | 0wCR/9wAsf/lANH/8AD///8AAAAAAAAvDgAAUBgAAHAiAACQLAAAsDYAAM9AAADwSgAR/1sAMf9xAFH/ 129 | hwBx/50Akf+yALH/yQDR/98A////AAAAAAACLwAABFAAAAZwAAAIkAAACrAAAAvPAAAO8AAAIP8SAD3/ 130 | MQBb/1EAef9xAJj/kQC1/7EA1P/RAP///wAAAAAAFC8AACJQAAAwcAAAPZAAAEywAABZzwAAZ/AAAHj/ 131 | EQCK/zEAnP9RAK7/cQDA/5EA0v+xAOT/0QD///8AAAAAACYvAABAUAAAWnAAAHSQAACOsAAAqc8AAMLw 132 | AADR/xEA2P8xAN7/UQDj/3EA6f+RAO//sQD2/9EA////AAAAAAAvJgAAUEEAAHBbAACQdAAAsI4AAM+p 133 | AADwwwAA/9IRAP/YMQD/3VEA/+RxAP/qkQD/8LEA//bRAP///wAAAAAALxQAAFAiAABwMAAAkD4AALBN 134 | AADPWwAA8GkAAP95EQD/ijEA/51RAP+vcQD/wZEA/9KxAP/l0QD///8AAAAAAC8DAABQBAAAcAYAAJAJ 135 | AACwCgAAzwwAAPAOAAD/IBIA/z4xAP9cUQD/enEA/5eRAP+2sQD/1NEA////AAAAAAAvAA4AUAAXAHAA 136 | IQCQACsAsAA2AM8AQADwAEkA/xFaAP8xcAD/UYYA/3GcAP+RsgD/scgA/9HfAP///wAAAAAALwAgAFAA 137 | NgBwAEwAkABiALAAeADPAI4A8ACkAP8RswD/Mb4A/1HHAP9x0QD/kdwA/7HlAP/R8AD///8AAAAAACwA 138 | LwBLAFAAaQBwAIcAkAClALAAxADPAOEA8ADwEf8A8jH/APRR/wD2cf8A95H/APmx/wD70f8A////AAAA 139 | AAAbAC8ALQBQAD8AcABSAJAAYwCwAHYAzwCIAPAAmRH/AKYx/wC0Uf8AwnH/AM+R/wDcsf8A69H/AP// 140 | /wAAAAAACAAvAA4AUAAVAHAAGwCQACEAsAAmAM8ALADwAD4R/wBYMf8AcVH/AIxx/wCmkf8Av7H/ANrR 141 | /wD///8ADw8PDw8PDw8PDw8PAwMDAw8PDw8PDw8PDw8PDwMPDw8PDw8PDw8PDw8PDw8DDw8PDw8PDw8P 142 | Dw8PDw8PAw8PDw8PDw8PDw8PDw8PDwMPDw8PDw8PDwUPDwUPDwUDDw8PDw8PDw8FDw8FDw8FAw8PDw8P 143 | Dw8PBQ8FDwUPBQ8PDw8PDw8PDwUPBQ8FDwUPDw8PDwQEBA8FBQ8PDwYFDw8PDwQPDw8EBQUPDw8FBQ8P 144 | Dw8EDw8PBAUPDw8PDwUPDw8PBA8PDwQPDw8PDw8PDw8PDwQPDw8EDw8PDw8PDw8PDw8EDw8PBA8PDw8P 145 | Dw8PDw8PBA8PDwQPDw8PDw8PDw8PDwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 146 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA= 147 | 148 | 149 | -------------------------------------------------------------------------------- /PlantUmlViewer/PlantUmlViewer/Forms/OptionsWindow.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | 122 | 123 | AAABAAEAEBAAAAAACABoBQAAFgAAACgAAAAQAAAAIAAAAAEACAAAAAAAAAEAAAAAAAAAAAAAAAEAAAAB 124 | AAAAAAAAOQAVADwEGAA+BxwAORCZADm6/wBIv/8AACzwABE9/wAxV/8AUXH/AHGL/wCRpf8Asb//ANHa 125 | /wD///8AAAAAAAAaLwAALVAAAD9wAABRkAAAY7AAAHbPAACI8AARmP8AMab/AFGz/wBxwf8Akc//ALHd 126 | /wDR6/8A////AAAAAAAALC8AAEtQAABocAAAhpAAAKWwAADDzwAA4fAAEe//ADHx/wBR8/8AcfX/AJH3 127 | /wCx+f8A0fv/AP///wAAAAAAAC8hAABQNwAAcEwAAJBjAACweQAAz48AAPCmABH/tAAx/74AUf/IAHH/ 128 | 0wCR/9wAsf/lANH/8AD///8AAAAAAAAvDgAAUBgAAHAiAACQLAAAsDYAAM9AAADwSgAR/1sAMf9xAFH/ 129 | hwBx/50Akf+yALH/yQDR/98A////AAAAAAACLwAABFAAAAZwAAAIkAAACrAAAAvPAAAO8AAAIP8SAD3/ 130 | MQBb/1EAef9xAJj/kQC1/7EA1P/RAP///wAAAAAAFC8AACJQAAAwcAAAPZAAAEywAABZzwAAZ/AAAHj/ 131 | EQCK/zEAnP9RAK7/cQDA/5EA0v+xAOT/0QD///8AAAAAACYvAABAUAAAWnAAAHSQAACOsAAAqc8AAMLw 132 | AADR/xEA2P8xAN7/UQDj/3EA6f+RAO//sQD2/9EA////AAAAAAAvJgAAUEEAAHBbAACQdAAAsI4AAM+p 133 | AADwwwAA/9IRAP/YMQD/3VEA/+RxAP/qkQD/8LEA//bRAP///wAAAAAALxQAAFAiAABwMAAAkD4AALBN 134 | AADPWwAA8GkAAP95EQD/ijEA/51RAP+vcQD/wZEA/9KxAP/l0QD///8AAAAAAC8DAABQBAAAcAYAAJAJ 135 | AACwCgAAzwwAAPAOAAD/IBIA/z4xAP9cUQD/enEA/5eRAP+2sQD/1NEA////AAAAAAAvAA4AUAAXAHAA 136 | IQCQACsAsAA2AM8AQADwAEkA/xFaAP8xcAD/UYYA/3GcAP+RsgD/scgA/9HfAP///wAAAAAALwAgAFAA 137 | NgBwAEwAkABiALAAeADPAI4A8ACkAP8RswD/Mb4A/1HHAP9x0QD/kdwA/7HlAP/R8AD///8AAAAAACwA 138 | LwBLAFAAaQBwAIcAkAClALAAxADPAOEA8ADwEf8A8jH/APRR/wD2cf8A95H/APmx/wD70f8A////AAAA 139 | AAAbAC8ALQBQAD8AcABSAJAAYwCwAHYAzwCIAPAAmRH/AKYx/wC0Uf8AwnH/AM+R/wDcsf8A69H/AP// 140 | /wAAAAAACAAvAA4AUAAVAHAAGwCQACEAsAAmAM8ALADwAD4R/wBYMf8AcVH/AIxx/wCmkf8Av7H/ANrR 141 | /wD///8ADw8PDw8PDw8PDw8PAwMDAw8PDw8PDw8PDw8PDwMPDw8PDw8PDw8PDw8PDw8DDw8PDw8PDw8P 142 | Dw8PDw8PAw8PDw8PDw8PDw8PDw8PDwMPDw8PDw8PDwUPDwUPDwUDDw8PDw8PDw8FDw8FDw8FAw8PDw8P 143 | Dw8PBQ8FDwUPBQ8PDw8PDw8PDwUPBQ8FDwUPDw8PDwQEBA8FBQ8PDwYFDw8PDwQPDw8EBQUPDw8FBQ8P 144 | Dw8EDw8PBAUPDw8PDwUPDw8PBA8PDwQPDw8PDw8PDw8PDwQPDw8EDw8PDw8PDw8PDw8EDw8PBA8PDw8P 145 | Dw8PDw8PBA8PDwQPDw8PDw8PDw8PDwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 146 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA= 147 | 148 | 149 | -------------------------------------------------------------------------------- /PlantUmlViewer/PlantUmlViewer/Windows/Messages.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices; 3 | 4 | //https://gist.github.com/amgine/2395987 5 | namespace PlantUmlViewer.Windows 6 | { 7 | [StructLayout(LayoutKind.Sequential)] 8 | public struct NMHDR 9 | { 10 | public IntPtr hwndFrom; 11 | public IntPtr idFrom; 12 | public int code; 13 | } 14 | 15 | public enum WindowsMessage 16 | { 17 | WM_NULL = 0x0000, 18 | WM_CREATE = 0x0001, 19 | WM_DESTROY = 0x0002, 20 | WM_MOVE = 0x0003, 21 | WM_SIZE = 0x0005, 22 | WM_ACTIVATE = 0x0006, 23 | WM_SETFOCUS = 0x0007, 24 | WM_KILLFOCUS = 0x0008, 25 | WM_ENABLE = 0x000A, 26 | WM_SETREDRAW = 0x000B, 27 | WM_SETTEXT = 0x000C, 28 | WM_GETTEXT = 0x000D, 29 | WM_GETTEXTLENGTH = 0x000E, 30 | WM_PAINT = 0x000F, 31 | WM_CLOSE = 0x0010, 32 | WM_QUERYENDSESSION = 0x0011, 33 | WM_QUERYOPEN = 0x0013, 34 | WM_ENDSESSION = 0x0016, 35 | WM_QUIT = 0x0012, 36 | WM_ERASEBKGND = 0x0014, 37 | WM_SYSCOLORCHANGE = 0x0015, 38 | WM_SHOWWINDOW = 0x0018, 39 | WM_WININICHANGE = 0x001A, 40 | WM_SETTINGCHANGE = WM_WININICHANGE, 41 | WM_DEVMODECHANGE = 0x001B, 42 | WM_ACTIVATEAPP = 0x001C, 43 | WM_FONTCHANGE = 0x001D, 44 | WM_TIMECHANGE = 0x001E, 45 | WM_CANCELMODE = 0x001F, 46 | WM_SETCURSOR = 0x0020, 47 | WM_MOUSEACTIVATE = 0x0021, 48 | WM_CHILDACTIVATE = 0x0022, 49 | WM_QUEUESYNC = 0x0023, 50 | WM_GETMINMAXINFO = 0x0024, 51 | WM_PAINTICON = 0x0026, 52 | WM_ICONERASEBKGND = 0x0027, 53 | WM_NEXTDLGCTL = 0x0028, 54 | WM_SPOOLERSTATUS = 0x002A, 55 | WM_DRAWITEM = 0x002B, 56 | WM_MEASUREITEM = 0x002C, 57 | WM_DELETEITEM = 0x002D, 58 | WM_VKEYTOITEM = 0x002E, 59 | WM_CHARTOITEM = 0x002F, 60 | WM_SETFONT = 0x0030, 61 | WM_GETFONT = 0x0031, 62 | WM_SETHOTKEY = 0x0032, 63 | WM_GETHOTKEY = 0x0033, 64 | WM_QUERYDRAGICON = 0x0037, 65 | WM_COMPAREITEM = 0x0039, 66 | WM_GETOBJECT = 0x003D, 67 | WM_COMPACTING = 0x0041, 68 | WM_COMMNOTIFY = 0x0044, 69 | WM_WINDOWPOSCHANGING = 0x0046, 70 | WM_WINDOWPOSCHANGED = 0x0047, 71 | WM_POWER = 0x0048, 72 | WM_COPYDATA = 0x004A, 73 | WM_CANCELJOURNAL = 0x004B, 74 | WM_NOTIFY = 0x004E, 75 | WM_INPUTLANGCHANGEREQUEST = 0x0050, 76 | WM_INPUTLANGCHANGE = 0x0051, 77 | WM_TCARD = 0x0052, 78 | WM_HELP = 0x0053, 79 | WM_USERCHANGED = 0x0054, 80 | WM_NOTIFYFORMAT = 0x0055, 81 | WM_CONTEXTMENU = 0x007B, 82 | WM_STYLECHANGING = 0x007C, 83 | WM_STYLECHANGED = 0x007D, 84 | WM_DISPLAYCHANGE = 0x007E, 85 | WM_GETICON = 0x007F, 86 | WM_SETICON = 0x0080, 87 | WM_NCCREATE = 0x0081, 88 | WM_NCDESTROY = 0x0082, 89 | WM_NCCALCSIZE = 0x0083, 90 | WM_NCHITTEST = 0x0084, 91 | WM_NCPAINT = 0x0085, 92 | WM_NCACTIVATE = 0x0086, 93 | WM_GETDLGCODE = 0x0087, 94 | WM_SYNCPAINT = 0x0088, 95 | 96 | 97 | WM_NCMOUSEMOVE = 0x00A0, 98 | WM_NCLBUTTONDOWN = 0x00A1, 99 | WM_NCLBUTTONUP = 0x00A2, 100 | WM_NCLBUTTONDBLCLK = 0x00A3, 101 | WM_NCRBUTTONDOWN = 0x00A4, 102 | WM_NCRBUTTONUP = 0x00A5, 103 | WM_NCRBUTTONDBLCLK = 0x00A6, 104 | WM_NCMBUTTONDOWN = 0x00A7, 105 | WM_NCMBUTTONUP = 0x00A8, 106 | WM_NCMBUTTONDBLCLK = 0x00A9, 107 | WM_NCXBUTTONDOWN = 0x00AB, 108 | WM_NCXBUTTONUP = 0x00AC, 109 | WM_NCXBUTTONDBLCLK = 0x00AD, 110 | 111 | WM_INPUT_DEVICE_CHANGE = 0x00FE, 112 | WM_INPUT = 0x00FF, 113 | 114 | WM_KEYFIRST = 0x0100, 115 | WM_KEYDOWN = 0x0100, 116 | WM_KEYUP = 0x0101, 117 | WM_CHAR = 0x0102, 118 | WM_DEADCHAR = 0x0103, 119 | WM_SYSKEYDOWN = 0x0104, 120 | WM_SYSKEYUP = 0x0105, 121 | WM_SYSCHAR = 0x0106, 122 | WM_SYSDEADCHAR = 0x0107, 123 | WM_UNICHAR = 0x0109, 124 | WM_KEYLAST = 0x0109, 125 | 126 | WM_IME_STARTCOMPOSITION = 0x010D, 127 | WM_IME_ENDCOMPOSITION = 0x010E, 128 | WM_IME_COMPOSITION = 0x010F, 129 | WM_IME_KEYLAST = 0x010F, 130 | 131 | WM_INITDIALOG = 0x0110, 132 | WM_COMMAND = 0x0111, 133 | WM_SYSCOMMAND = 0x0112, 134 | WM_TIMER = 0x0113, 135 | WM_HSCROLL = 0x0114, 136 | WM_VSCROLL = 0x0115, 137 | WM_INITMENU = 0x0116, 138 | WM_INITMENUPOPUP = 0x0117, 139 | WM_MENUSELECT = 0x011F, 140 | WM_MENUCHAR = 0x0120, 141 | WM_ENTERIDLE = 0x0121, 142 | WM_MENURBUTTONUP = 0x0122, 143 | WM_MENUDRAG = 0x0123, 144 | WM_MENUGETOBJECT = 0x0124, 145 | WM_UNINITMENUPOPUP = 0x0125, 146 | WM_MENUCOMMAND = 0x0126, 147 | 148 | WM_CHANGEUISTATE = 0x0127, 149 | WM_UPDATEUISTATE = 0x0128, 150 | WM_QUERYUISTATE = 0x0129, 151 | 152 | WM_CTLCOLORMSGBOX = 0x0132, 153 | WM_CTLCOLOREDIT = 0x0133, 154 | WM_CTLCOLORLISTBOX = 0x0134, 155 | WM_CTLCOLORBTN = 0x0135, 156 | WM_CTLCOLORDLG = 0x0136, 157 | WM_CTLCOLORSCROLLBAR = 0x0137, 158 | WM_CTLCOLORSTATIC = 0x0138, 159 | MN_GETHMENU = 0x01E1, 160 | 161 | WM_MOUSEFIRST = 0x0200, 162 | WM_MOUSEMOVE = 0x0200, 163 | WM_LBUTTONDOWN = 0x0201, 164 | WM_LBUTTONUP = 0x0202, 165 | WM_LBUTTONDBLCLK = 0x0203, 166 | WM_RBUTTONDOWN = 0x0204, 167 | WM_RBUTTONUP = 0x0205, 168 | WM_RBUTTONDBLCLK = 0x0206, 169 | WM_MBUTTONDOWN = 0x0207, 170 | WM_MBUTTONUP = 0x0208, 171 | WM_MBUTTONDBLCLK = 0x0209, 172 | WM_MOUSEWHEEL = 0x020A, 173 | WM_XBUTTONDOWN = 0x020B, 174 | WM_XBUTTONUP = 0x020C, 175 | WM_XBUTTONDBLCLK = 0x020D, 176 | WM_MOUSEHWHEEL = 0x020E, 177 | 178 | WM_PARENTNOTIFY = 0x0210, 179 | WM_ENTERMENULOOP = 0x0211, 180 | WM_EXITMENULOOP = 0x0212, 181 | 182 | WM_NEXTMENU = 0x0213, 183 | WM_SIZING = 0x0214, 184 | WM_CAPTURECHANGED = 0x0215, 185 | WM_MOVING = 0x0216, 186 | 187 | WM_POWERBROADCAST = 0x0218, 188 | 189 | WM_DEVICECHANGE = 0x0219, 190 | 191 | WM_MDICREATE = 0x0220, 192 | WM_MDIDESTROY = 0x0221, 193 | WM_MDIACTIVATE = 0x0222, 194 | WM_MDIRESTORE = 0x0223, 195 | WM_MDINEXT = 0x0224, 196 | WM_MDIMAXIMIZE = 0x0225, 197 | WM_MDITILE = 0x0226, 198 | WM_MDICASCADE = 0x0227, 199 | WM_MDIICONARRANGE = 0x0228, 200 | WM_MDIGETACTIVE = 0x0229, 201 | 202 | 203 | WM_MDISETMENU = 0x0230, 204 | WM_ENTERSIZEMOVE = 0x0231, 205 | WM_EXITSIZEMOVE = 0x0232, 206 | WM_DROPFILES = 0x0233, 207 | WM_MDIREFRESHMENU = 0x0234, 208 | 209 | WM_IME_SETCONTEXT = 0x0281, 210 | WM_IME_NOTIFY = 0x0282, 211 | WM_IME_CONTROL = 0x0283, 212 | WM_IME_COMPOSITIONFULL = 0x0284, 213 | WM_IME_SELECT = 0x0285, 214 | WM_IME_CHAR = 0x0286, 215 | WM_IME_REQUEST = 0x0288, 216 | WM_IME_KEYDOWN = 0x0290, 217 | WM_IME_KEYUP = 0x0291, 218 | 219 | WM_MOUSEHOVER = 0x02A1, 220 | WM_MOUSELEAVE = 0x02A3, 221 | WM_NCMOUSEHOVER = 0x02A0, 222 | WM_NCMOUSELEAVE = 0x02A2, 223 | 224 | WM_WTSSESSION_CHANGE = 0x02B1, 225 | 226 | WM_TABLET_FIRST = 0x02c0, 227 | WM_TABLET_LAST = 0x02df, 228 | 229 | WM_CUT = 0x0300, 230 | WM_COPY = 0x0301, 231 | WM_PASTE = 0x0302, 232 | WM_CLEAR = 0x0303, 233 | WM_UNDO = 0x0304, 234 | WM_RENDERFORMAT = 0x0305, 235 | WM_RENDERALLFORMATS = 0x0306, 236 | WM_DESTROYCLIPBOARD = 0x0307, 237 | WM_DRAWCLIPBOARD = 0x0308, 238 | WM_PAINTCLIPBOARD = 0x0309, 239 | WM_VSCROLLCLIPBOARD = 0x030A, 240 | WM_SIZECLIPBOARD = 0x030B, 241 | WM_ASKCBFORMATNAME = 0x030C, 242 | WM_CHANGECBCHAIN = 0x030D, 243 | WM_HSCROLLCLIPBOARD = 0x030E, 244 | WM_QUERYNEWPALETTE = 0x030F, 245 | WM_PALETTEISCHANGING = 0x0310, 246 | WM_PALETTECHANGED = 0x0311, 247 | WM_HOTKEY = 0x0312, 248 | 249 | WM_PRINT = 0x0317, 250 | WM_PRINTCLIENT = 0x0318, 251 | 252 | WM_APPCOMMAND = 0x0319, 253 | 254 | WM_THEMECHANGED = 0x031A, 255 | 256 | WM_CLIPBOARDUPDATE = 0x031D, 257 | 258 | WM_DWMCOMPOSITIONCHANGED = 0x031E, 259 | WM_DWMNCRENDERINGCHANGED = 0x031F, 260 | WM_DWMCOLORIZATIONCOLORCHANGED = 0x0320, 261 | WM_DWMWINDOWMAXIMIZEDCHANGE = 0x0321, 262 | 263 | WM_GETTITLEBARINFOEX = 0x033F, 264 | 265 | WM_HANDHELDFIRST = 0x0358, 266 | WM_HANDHELDLAST = 0x035F, 267 | 268 | WM_AFXFIRST = 0x0360, 269 | WM_AFXLAST = 0x037F, 270 | 271 | WM_PENWINFIRST = 0x0380, 272 | WM_PENWINLAST = 0x038F, 273 | 274 | WM_APP = 0x8000, 275 | 276 | WM_USER = 0x0400, 277 | 278 | WM_REFLECT = WM_USER + 0x1C00, 279 | } 280 | } -------------------------------------------------------------------------------- /PlantUmlViewer/PlantUmlViewer/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace PlantUmlViewer.Properties { 12 | using System; 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Resources() { 33 | } 34 | 35 | /// 36 | /// Returns the cached ResourceManager instance used by this class. 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("PlantUmlViewer.Properties.Resources", typeof(Resources).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// Overrides the current thread's CurrentUICulture property for all 51 | /// resource lookups using this strongly typed resource class. 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | 63 | /// 64 | /// Looks up a localized string similar to {\rtf1\ansi\ansicpg1252\deff0\nouicompat\deflang1031{\fonttbl{\f0\fnil\fcharset0 Calibri;}{\f1\fswiss\fprq2\fcharset0 Calibri;}{\f2\fnil\fcharset2 Symbol;}} 65 | ///{\colortbl ;\red0\green0\blue255;} 66 | ///{\*\generator Riched20 10.0.19041}\viewkind4\uc1 67 | ///\pard\sa200\sl276\slmult1\b\f0\fs24\lang7 License and credits\par 68 | /// 69 | ///\pard\sa200\sl240\slmult1\b0\fs22 PlantUML Viewer is released under the MIT License.\par 70 | /// 71 | ///\pard\sl240\slmult1 This Notepad++ plugin integrates multiple other libraries and sources. Credits and tha [rest of string was truncated]";. 72 | /// 73 | internal static string AboutText { 74 | get { 75 | return ResourceManager.GetString("AboutText", resourceCulture); 76 | } 77 | } 78 | 79 | /// 80 | /// Looks up a localized resource of type System.Byte[]. 81 | /// 82 | internal static byte[] Empty { 83 | get { 84 | object obj = ResourceManager.GetObject("Empty", resourceCulture); 85 | return ((byte[])(obj)); 86 | } 87 | } 88 | 89 | /// 90 | /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon). 91 | /// 92 | internal static System.Drawing.Icon Icon { 93 | get { 94 | object obj = ResourceManager.GetObject("Icon", resourceCulture); 95 | return ((System.Drawing.Icon)(obj)); 96 | } 97 | } 98 | 99 | /// 100 | /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon). 101 | /// 102 | internal static System.Drawing.Icon IconFluent { 103 | get { 104 | object obj = ResourceManager.GetObject("IconFluent", resourceCulture); 105 | return ((System.Drawing.Icon)(obj)); 106 | } 107 | } 108 | 109 | /// 110 | /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon). 111 | /// 112 | internal static System.Drawing.Icon IconFluentDark { 113 | get { 114 | object obj = ResourceManager.GetObject("IconFluentDark", resourceCulture); 115 | return ((System.Drawing.Icon)(obj)); 116 | } 117 | } 118 | 119 | /// 120 | /// Looks up a localized resource of type System.Drawing.Bitmap. 121 | /// 122 | internal static System.Drawing.Bitmap Image { 123 | get { 124 | object obj = ResourceManager.GetObject("Image", resourceCulture); 125 | return ((System.Drawing.Bitmap)(obj)); 126 | } 127 | } 128 | 129 | /// 130 | /// Looks up a localized resource of type System.Drawing.Bitmap. 131 | /// 132 | internal static System.Drawing.Bitmap NavigateDown { 133 | get { 134 | object obj = ResourceManager.GetObject("NavigateDown", resourceCulture); 135 | return ((System.Drawing.Bitmap)(obj)); 136 | } 137 | } 138 | 139 | /// 140 | /// Looks up a localized resource of type System.Drawing.Bitmap. 141 | /// 142 | internal static System.Drawing.Bitmap NavigateLeft { 143 | get { 144 | object obj = ResourceManager.GetObject("NavigateLeft", resourceCulture); 145 | return ((System.Drawing.Bitmap)(obj)); 146 | } 147 | } 148 | 149 | /// 150 | /// Looks up a localized resource of type System.Drawing.Bitmap. 151 | /// 152 | internal static System.Drawing.Bitmap NavigateRight { 153 | get { 154 | object obj = ResourceManager.GetObject("NavigateRight", resourceCulture); 155 | return ((System.Drawing.Bitmap)(obj)); 156 | } 157 | } 158 | 159 | /// 160 | /// Looks up a localized resource of type System.Drawing.Bitmap. 161 | /// 162 | internal static System.Drawing.Bitmap NavigateUp { 163 | get { 164 | object obj = ResourceManager.GetObject("NavigateUp", resourceCulture); 165 | return ((System.Drawing.Bitmap)(obj)); 166 | } 167 | } 168 | 169 | /// 170 | /// Looks up a localized resource of type System.Drawing.Bitmap. 171 | /// 172 | internal static System.Drawing.Bitmap Refresh { 173 | get { 174 | object obj = ResourceManager.GetObject("Refresh", resourceCulture); 175 | return ((System.Drawing.Bitmap)(obj)); 176 | } 177 | } 178 | 179 | /// 180 | /// Looks up a localized resource of type System.Drawing.Bitmap. 181 | /// 182 | internal static System.Drawing.Bitmap Save { 183 | get { 184 | object obj = ResourceManager.GetObject("Save", resourceCulture); 185 | return ((System.Drawing.Bitmap)(obj)); 186 | } 187 | } 188 | 189 | /// 190 | /// Looks up a localized resource of type System.Drawing.Bitmap. 191 | /// 192 | internal static System.Drawing.Bitmap ZoomFit { 193 | get { 194 | object obj = ResourceManager.GetObject("ZoomFit", resourceCulture); 195 | return ((System.Drawing.Bitmap)(obj)); 196 | } 197 | } 198 | 199 | /// 200 | /// Looks up a localized resource of type System.Drawing.Bitmap. 201 | /// 202 | internal static System.Drawing.Bitmap ZoomIn { 203 | get { 204 | object obj = ResourceManager.GetObject("ZoomIn", resourceCulture); 205 | return ((System.Drawing.Bitmap)(obj)); 206 | } 207 | } 208 | 209 | /// 210 | /// Looks up a localized resource of type System.Drawing.Bitmap. 211 | /// 212 | internal static System.Drawing.Bitmap ZoomOut { 213 | get { 214 | object obj = ResourceManager.GetObject("ZoomOut", resourceCulture); 215 | return ((System.Drawing.Bitmap)(obj)); 216 | } 217 | } 218 | 219 | /// 220 | /// Looks up a localized resource of type System.Drawing.Bitmap. 221 | /// 222 | internal static System.Drawing.Bitmap ZoomReset { 223 | get { 224 | object obj = ResourceManager.GetObject("ZoomReset", resourceCulture); 225 | return ((System.Drawing.Bitmap)(obj)); 226 | } 227 | } 228 | } 229 | } 230 | -------------------------------------------------------------------------------- /PlantUmlViewer/PlantUmlViewer/Properties/Resources.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | 122 | ..\Resources\AboutText.rtf;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252 123 | 124 | 125 | ..\Resources\Empty.svg;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 126 | 127 | 128 | ..\Resources\Icon.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 129 | 130 | 131 | ..\Resources\IconFluent.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 132 | 133 | 134 | ..\Resources\IconFluentDark.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 135 | 136 | 137 | ..\Resources\Image.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 138 | 139 | 140 | ..\Resources\NavigateDown.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 141 | 142 | 143 | ..\Resources\NavigateLeft.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 144 | 145 | 146 | ..\Resources\NavigateRight.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 147 | 148 | 149 | ..\Resources\NavigateUp.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 150 | 151 | 152 | ..\Resources\Refresh.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 153 | 154 | 155 | ..\Resources\Save.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 156 | 157 | 158 | ..\Resources\ZoomFit.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 159 | 160 | 161 | ..\Resources\ZoomIn.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 162 | 163 | 164 | ..\Resources\ZoomOut.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 165 | 166 | 167 | ..\Resources\ZoomReset.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 168 | 169 | -------------------------------------------------------------------------------- /PlantUmlViewer/PlantUmlViewer/DiagramGeneration/DiagramGenerator.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Diagnostics; 4 | using System.Drawing; 5 | using System.IO; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Threading; 9 | using System.Threading.Tasks; 10 | 11 | using Svg; 12 | 13 | using PlantUmlViewer.DiagramGeneration.PlantUml; 14 | 15 | namespace PlantUmlViewer.DiagramGeneration 16 | { 17 | internal static class DiagramGenerator 18 | { 19 | private const string DIAGRAM_DELIMITOR = "|##|##||##|##|"; 20 | private const string SVG_START = "> GenerateDocumentAsync( 24 | string javaExecutable, string plantUmlJar, 25 | string text, string fileName, string include, string workingDirectory, 26 | CancellationTokenSource cancellationTokenSource) 27 | { 28 | /* 29 | * The PlantUML responses could contain multiple pages, where each page could contain the images for multiple diagrams 30 | * The dictionaries are build up like, note that some images in between may are not set since they are empty 31 | * - Page[0] 32 | * - DiagramImage[0] 33 | * - ... 34 | * - DiagramImage[n] 35 | * - ... 36 | * - ... 37 | * - Page[n] 38 | * - ... 39 | * 40 | * Diagrams can contain multiple pages, which are generated in independent steps 41 | * At least 2 generation calls needed to be done for each diagram to find out this was the last page 42 | * To speed this up, the first two calls are executed parallel 43 | * Afterwards page by page is generated 44 | */ 45 | 46 | Dictionary> pages = new Dictionary>(); 47 | 48 | //Generate the first page directly at startup 49 | List> generateTasks = new List>() 50 | { 51 | Task.Run(() => GeneratePageAsync(javaExecutable, plantUmlJar, 52 | text, fileName, include, workingDirectory, 0, pages, cancellationTokenSource)) 53 | }; 54 | //Generate the (maybe) following pages 55 | int pageIndex = 1; 56 | while (true) 57 | { 58 | generateTasks.Add(Task.Run(() => GeneratePageAsync(javaExecutable, plantUmlJar, 59 | text, fileName, include, workingDirectory, pageIndex, pages, cancellationTokenSource))); 60 | await Task.WhenAll(generateTasks); 61 | if (generateTasks.Exists(rT => !rT.Result)) 62 | { 63 | //The last page was detected 64 | break; 65 | } 66 | generateTasks.Clear(); 67 | pageIndex++; 68 | } 69 | 70 | Debug.WriteLine($"{pages.Sum(p => p.Value.Count)} images(s) at {pages.Count} page(s) generated", 71 | nameof(DiagramGenerator)); 72 | 73 | return ReorganizePagesToDiagram(pages); 74 | } 75 | 76 | public static Image SvgImageToBitmap(SvgDocument svgImage, decimal sizeFactor) 77 | { 78 | //Resize (see: https://github.com/svg-net/SVG/blob/master/Source/SvgDocument.Drawing.cs#L217) 79 | SizeF svgSize = svgImage.GetDimensions(); 80 | SizeF imageSize = svgSize; 81 | svgImage.RasterizeDimensions(ref imageSize, 82 | (int)Math.Round((decimal)svgSize.Width * sizeFactor), (int)Math.Round((decimal)svgSize.Height * sizeFactor)); 83 | Size bitmapSize = Size.Round(imageSize); 84 | Bitmap image = new Bitmap(bitmapSize.Width, bitmapSize.Height); 85 | 86 | //Set background if defined in SVG style since PlantUml does not set it e.g. if white 87 | if (svgImage.TryGetAttribute(ExCSS.PropertyNames.BackgroundColor, out string backgroundAttribute)) 88 | { 89 | using (Graphics g = Graphics.FromImage(image)) 90 | using (SolidBrush brush = new SolidBrush(ColorTranslator.FromHtml(backgroundAttribute))) 91 | { 92 | g.FillRectangle(brush, 0, 0, image.Width, image.Height); 93 | } 94 | } 95 | 96 | //Render 97 | using (ISvgRenderer renderer = SvgRenderer.FromImage(image)) 98 | { 99 | renderer.ScaleTransform(imageSize.Width / svgSize.Width, imageSize.Height / svgSize.Height); 100 | svgImage.Draw(renderer); 101 | } 102 | return image; 103 | } 104 | 105 | private static async Task GeneratePageAsync(string javaExecutable, string plantUmlJar, 106 | string text, string fileName, string include, string fileDirectory, int pageIndexToGenerate, 107 | Dictionary> pages, CancellationTokenSource cancellationTokenSource) 108 | { 109 | PlantUmlArguments arguments = new PlantUmlArguments() 110 | { 111 | OutputFormat = OutputFormat.Svg, 112 | ErrorFormat = ErrorFormat.Verbose, 113 | FileDirectory = fileDirectory, 114 | Include = include, 115 | FileName = fileName, 116 | Delimitor = DIAGRAM_DELIMITOR, 117 | ImageIndex = pageIndexToGenerate 118 | }; 119 | 120 | byte[] bytes = await PlantUmlRunner.Generate(javaExecutable, plantUmlJar, arguments, text, 121 | cancellationTokenSource.Token).ConfigureAwait(true); 122 | 123 | //Find all delimitors to parse multiple diagram images 124 | Dictionary imagesOfPage = new Dictionary(); 125 | List delimitorIndices = new int[] { -(DIAGRAM_DELIMITOR.Length + 2) } 126 | .Concat(PatternAt(bytes, Encoding.UTF8.GetBytes(DIAGRAM_DELIMITOR), 0, bytes.Length)).ToList(); 127 | for (int i = 0; i < delimitorIndices.Count - 1; i++) 128 | { 129 | int start = delimitorIndices[i] + DIAGRAM_DELIMITOR.Length + 2; 130 | int end = delimitorIndices[i + 1]; 131 | if (end - start > 0) 132 | { 133 | //Remove all unexpected data which may is added due to Java accessibility hooks output e.g. like PowerAutomate 134 | List startPatterns = PatternAt(bytes, Encoding.UTF8.GetBytes(SVG_START), start, end).ToList(); 135 | List endPatterns = PatternAt(bytes, Encoding.UTF8.GetBytes(SVG_END), start, end).ToList(); 136 | if (startPatterns.Count != 1 || endPatterns.Count != 1) 137 | { 138 | throw new InvalidOperationException("Failed to parse generated data"); 139 | } 140 | start = startPatterns[0]; 141 | end = endPatterns[0] + SVG_END.Length; 142 | 143 | using (MemoryStream memoryStream = new MemoryStream(bytes, start, end - start)) 144 | { 145 | Debug.WriteLine($"Generating image {i + 1} at page {pageIndexToGenerate + 1}", nameof(DiagramGenerator)); 146 | imagesOfPage[i] = SvgDocument.Open(memoryStream); 147 | } 148 | } 149 | else 150 | { 151 | Debug.WriteLine($"No image {i + 1} at page {pageIndexToGenerate + 1}", nameof(DiagramGenerator)); 152 | } 153 | } 154 | //No more pages available 155 | if (imagesOfPage.Count == 0) 156 | { 157 | return false; 158 | } 159 | pages[pageIndexToGenerate] = imagesOfPage; 160 | return true; 161 | } 162 | 163 | private static List ReorganizePagesToDiagram(Dictionary> pages) 164 | { 165 | //Reorganize page based structure to intuitive diagram based structure 166 | //pages[pageIndex][diagramIndex] --> images[diagramIndex][nonEmptyPageIndex] 167 | int numberOfDiagrams = pages.Max(p => p.Value.Max(d => d.Key)) + 1; 168 | List images = Enumerable.Repeat(null, numberOfDiagrams) 169 | .Select(_ => new GeneratedDiagram()).ToList(); 170 | for (int diagramIndex = 0; diagramIndex < numberOfDiagrams; diagramIndex++) 171 | { 172 | foreach (Dictionary newPage in pages.OrderBy(nP => nP.Key).Select(nP => nP.Value)) 173 | { 174 | if (newPage.TryGetValue(diagramIndex, out SvgDocument newDiagram)) 175 | { 176 | images[diagramIndex].Pages.Add(newDiagram); 177 | } 178 | } 179 | } 180 | return images; 181 | } 182 | 183 | private static IEnumerable PatternAt(byte[] source, byte[] pattern, int start, int end) 184 | { 185 | if (source == null || pattern == null || source.Length < pattern.Length) 186 | { 187 | yield break; 188 | } 189 | 190 | end = Math.Min(source.Length, end); 191 | for (int i = start; i < end; i++) 192 | { 193 | if (IsPatternMatch(source, i, pattern)) 194 | { 195 | yield return i; 196 | } 197 | } 198 | } 199 | 200 | private static bool IsPatternMatch(byte[] source, int position, byte[] pattern) 201 | { 202 | if (pattern.Length > (source.Length - position)) 203 | { 204 | return false; 205 | } 206 | for (int i = 0; i < pattern.Length; i++) 207 | { 208 | if (source[position + i] != pattern[i]) 209 | { 210 | return false; 211 | } 212 | } 213 | return true; 214 | } 215 | } 216 | } 217 | -------------------------------------------------------------------------------- /PlantUmlViewer/PlantUmlViewer/PluginInfrastructure/resource_h.cs: -------------------------------------------------------------------------------- 1 | // NPP plugin platform for .Net v0.94.00 by Kasper B. Graversen etc. 2 | // 3 | // This file should stay in sync with the CPP project file 4 | // "notepad-plus-plus/scintilla/include/Scintilla.iface" 5 | // found at 6 | // https://github.com/notepad-plus-plus/notepad-plus-plus/blob/master/scintilla/include/Scintilla.iface 7 | using Kbg.NppPluginNET.PluginInfrastructure; 8 | 9 | namespace NppPluginNET.PluginInfrastructure 10 | { 11 | public enum Resource 12 | { 13 | /* ++Autogenerated -- start of section automatically generated from resource.h */ 14 | 15 | IDC_STATIC = -1, 16 | 17 | IDI_M30ICON = 100, 18 | IDI_CHAMELEON = 101, 19 | 20 | IDR_RT_MANIFEST = 103, 21 | 22 | IDI_NEW_OFF_ICON = 201, 23 | IDI_OPEN_OFF_ICON = 202, 24 | IDI_CLOSE_OFF_ICON = 203, 25 | IDI_CLOSEALL_OFF_ICON = 204, 26 | IDI_SAVE_OFF_ICON = 205, 27 | IDI_SAVEALL_OFF_ICON = 206, 28 | IDI_CUT_OFF_ICON = 207, 29 | IDI_COPY_OFF_ICON = 208, 30 | IDI_PASTE_OFF_ICON = 209, 31 | IDI_UNDO_OFF_ICON = 210, 32 | IDI_REDO_OFF_ICON = 211, 33 | IDI_FIND_OFF_ICON = 212, 34 | IDI_REPLACE_OFF_ICON = 213, 35 | IDI_ZOOMIN_OFF_ICON = 214, 36 | IDI_ZOOMOUT_OFF_ICON = 215, 37 | IDI_VIEW_UD_DLG_OFF_ICON = 216, 38 | IDI_PRINT_OFF_ICON = 217, 39 | IDI_VIEW_ALL_CHAR_ON_ICON = 218, 40 | IDI_VIEW_INDENT_ON_ICON = 219, 41 | IDI_VIEW_WRAP_ON_ICON = 220, 42 | 43 | IDI_STARTRECORD_OFF_ICON = 221, 44 | IDI_STARTRECORD_ON_ICON = 222, 45 | IDI_STARTRECORD_DISABLE_ICON = 223, 46 | IDI_STOPRECORD_OFF_ICON = 224, 47 | IDI_STOPRECORD_ON_ICON = 225, 48 | IDI_STOPRECORD_DISABLE_ICON = 226, 49 | IDI_PLAYRECORD_OFF_ICON = 227, 50 | IDI_PLAYRECORD_ON_ICON = 228, 51 | IDI_PLAYRECORD_DISABLE_ICON = 229, 52 | IDI_SAVERECORD_OFF_ICON = 230, 53 | IDI_SAVERECORD_ON_ICON = 231, 54 | IDI_SAVERECORD_DISABLE_ICON = 232, 55 | 56 | IDI_MMPLAY_DIS_ICON = 233, 57 | IDI_MMPLAY_OFF_ICON = 234, 58 | IDI_MMPLAY_ON_ICON = 235, 59 | 60 | IDI_NEW_ON_ICON = 301, 61 | IDI_OPEN_ON_ICON = 302, 62 | IDI_CLOSE_ON_ICON = 303, 63 | IDI_CLOSEALL_ON_ICON = 304, 64 | IDI_SAVE_ON_ICON = 305, 65 | IDI_SAVEALL_ON_ICON = 306, 66 | IDI_CUT_ON_ICON = 307, 67 | IDI_COPY_ON_ICON = 308, 68 | IDI_PASTE_ON_ICON = 309, 69 | IDI_UNDO_ON_ICON = 310, 70 | IDI_REDO_ON_ICON = 311, 71 | IDI_FIND_ON_ICON = 312, 72 | IDI_REPLACE_ON_ICON = 313, 73 | IDI_ZOOMIN_ON_ICON = 314, 74 | IDI_ZOOMOUT_ON_ICON = 315, 75 | IDI_VIEW_UD_DLG_ON_ICON = 316, 76 | IDI_PRINT_ON_ICON = 317, 77 | IDI_VIEW_ALL_CHAR_OFF_ICON = 318, 78 | IDI_VIEW_INDENT_OFF_ICON = 319, 79 | IDI_VIEW_WRAP_OFF_ICON = 320, 80 | 81 | IDI_SAVE_DISABLE_ICON = 403, 82 | IDI_SAVEALL_DISABLE_ICON = 404, 83 | 84 | IDI_CUT_DISABLE_ICON = 407, 85 | IDI_COPY_DISABLE_ICON = 408, 86 | IDI_PASTE_DISABLE_ICON = 409, 87 | IDI_UNDO_DISABLE_ICON = 410, 88 | IDI_REDO_DISABLE_ICON = 411, 89 | IDI_DELETE_ICON = 412, 90 | 91 | IDI_SYNCV_OFF_ICON = 413, 92 | IDI_SYNCV_ON_ICON = 414, 93 | IDI_SYNCV_DISABLE_ICON = 415, 94 | 95 | IDI_SYNCH_OFF_ICON = 416, 96 | IDI_SYNCH_ON_ICON = 417, 97 | IDI_SYNCH_DISABLE_ICON = 418, 98 | 99 | IDI_SAVED_ICON = 501, 100 | IDI_UNSAVED_ICON = 502, 101 | IDI_READONLY_ICON = 503, 102 | IDI_FIND_RESULT_ICON = 504, 103 | IDI_MONITORING_ICON = 505, 104 | 105 | IDI_PROJECT_WORKSPACE = 601, 106 | IDI_PROJECT_WORKSPACEDIRTY = 602, 107 | IDI_PROJECT_PROJECT = 603, 108 | IDI_PROJECT_FOLDEROPEN = 604, 109 | IDI_PROJECT_FOLDERCLOSE = 605, 110 | IDI_PROJECT_FILE = 606, 111 | IDI_PROJECT_FILEINVALID = 607, 112 | IDI_FB_ROOTOPEN = 608, 113 | IDI_FB_ROOTCLOSE = 609, 114 | IDI_FB_SELECTCURRENTFILE = 610, 115 | IDI_FB_FOLDALL = 611, 116 | IDI_FB_EXPANDALL = 612, 117 | 118 | IDI_FUNCLIST_ROOT = 620, 119 | IDI_FUNCLIST_NODE = 621, 120 | IDI_FUNCLIST_LEAF = 622, 121 | 122 | IDI_FUNCLIST_SORTBUTTON = 631, 123 | IDI_FUNCLIST_RELOADBUTTON = 632, 124 | 125 | IDI_VIEW_DOC_MAP_ON_ICON = 633, 126 | IDI_VIEW_DOC_MAP_OFF_ICON = 634, 127 | IDI_VIEW_FILEBROWSER_ON_ICON = 635, 128 | IDI_VIEW_FILEBROWSER_OFF_ICON = 636, 129 | IDI_VIEW_FUNCLIST_ON_ICON = 637, 130 | IDI_VIEW_FUNCLIST_OFF_ICON = 638, 131 | IDI_VIEW_MONITORING_ON_ICON = 639, 132 | IDI_VIEW_MONITORING_OFF_ICON = 640, 133 | 134 | IDC_MY_CUR = 1402, 135 | IDC_UP_ARROW = 1403, 136 | IDC_DRAG_TAB = 1404, 137 | IDC_DRAG_INTERDIT_TAB = 1405, 138 | IDC_DRAG_PLUS_TAB = 1406, 139 | IDC_DRAG_OUT_TAB = 1407, 140 | 141 | IDC_MACRO_RECORDING = 1408, 142 | 143 | IDR_SAVEALL = 1500, 144 | IDR_CLOSEFILE = 1501, 145 | IDR_CLOSEALL = 1502, 146 | IDR_FIND = 1503, 147 | IDR_REPLACE = 1504, 148 | IDR_ZOOMIN = 1505, 149 | IDR_ZOOMOUT = 1506, 150 | IDR_WRAP = 1507, 151 | IDR_INVISIBLECHAR = 1508, 152 | IDR_INDENTGUIDE = 1509, 153 | IDR_SHOWPANNEL = 1510, 154 | IDR_STARTRECORD = 1511, 155 | IDR_STOPRECORD = 1512, 156 | IDR_PLAYRECORD = 1513, 157 | IDR_SAVERECORD = 1514, 158 | IDR_SYNCV = 1515, 159 | IDR_SYNCH = 1516, 160 | IDR_FILENEW = 1517, 161 | IDR_FILEOPEN = 1518, 162 | IDR_FILESAVE = 1519, 163 | IDR_PRINT = 1520, 164 | IDR_CUT = 1521, 165 | IDR_COPY = 1522, 166 | IDR_PASTE = 1523, 167 | IDR_UNDO = 1524, 168 | IDR_REDO = 1525, 169 | IDR_M_PLAYRECORD = 1526, 170 | IDR_DOCMAP = 1527, 171 | IDR_FUNC_LIST = 1528, 172 | IDR_FILEBROWSER = 1529, 173 | IDR_CLOSETAB = 1530, 174 | IDR_CLOSETAB_INACT = 1531, 175 | IDR_CLOSETAB_HOVER = 1532, 176 | IDR_CLOSETAB_PUSH = 1533, 177 | IDR_FUNC_LIST_ICO = 1534, 178 | IDR_DOCMAP_ICO = 1535, 179 | IDR_PROJECTPANEL_ICO = 1536, 180 | IDR_CLIPBOARDPANEL_ICO = 1537, 181 | IDR_ASCIIPANEL_ICO = 1538, 182 | IDR_DOCSWITCHER_ICO = 1539, 183 | IDR_FILEBROWSER_ICO = 1540, 184 | IDR_FILEMONITORING = 1541, 185 | 186 | ID_MACRO = 20000, 187 | ID_MACRO_LIMIT = 20200, 188 | 189 | ID_USER_CMD = 21000, 190 | ID_USER_CMD_LIMIT = 21200, 191 | 192 | ID_PLUGINS_CMD = 22000, 193 | ID_PLUGINS_CMD_LIMIT = 22500, 194 | 195 | ID_PLUGINS_CMD_DYNAMIC = 23000, 196 | ID_PLUGINS_CMD_DYNAMIC_LIMIT = 24999, 197 | 198 | MARKER_PLUGINS = 3, 199 | MARKER_PLUGINS_LIMIT = 19, 200 | 201 | ID_PLUGINS_REMOVING = 22501, 202 | ID_PLUGINS_REMOVING_END = 22600, 203 | 204 | IDCMD = 50000, 205 | 206 | IDC_PREV_DOC = IDCMD+3, 207 | IDC_NEXT_DOC = IDCMD+4, 208 | IDC_EDIT_TOGGLEMACRORECORDING = IDCMD+5, 209 | 210 | IDCMD_LIMIT = IDCMD+20, 211 | 212 | IDSCINTILLA = 60000, 213 | IDSCINTILLA_KEY_HOME = IDSCINTILLA+0, 214 | IDSCINTILLA_KEY_HOME_WRAP = IDSCINTILLA+1, 215 | IDSCINTILLA_KEY_END = IDSCINTILLA+2, 216 | IDSCINTILLA_KEY_END_WRAP = IDSCINTILLA+3, 217 | IDSCINTILLA_KEY_LINE_DUP = IDSCINTILLA+4, 218 | IDSCINTILLA_KEY_LINE_CUT = IDSCINTILLA+5, 219 | IDSCINTILLA_KEY_LINE_DEL = IDSCINTILLA+6, 220 | IDSCINTILLA_KEY_LINE_TRANS = IDSCINTILLA+7, 221 | IDSCINTILLA_KEY_LINE_COPY = IDSCINTILLA+8, 222 | IDSCINTILLA_KEY_CUT = IDSCINTILLA+9, 223 | IDSCINTILLA_KEY_COPY = IDSCINTILLA+10, 224 | IDSCINTILLA_KEY_PASTE = IDSCINTILLA+11, 225 | IDSCINTILLA_KEY_DEL = IDSCINTILLA+12, 226 | IDSCINTILLA_KEY_SELECTALL = IDSCINTILLA+13, 227 | IDSCINTILLA_KEY_OUTDENT = IDSCINTILLA+14, 228 | IDSCINTILLA_KEY_UNDO = IDSCINTILLA+15, 229 | IDSCINTILLA_KEY_REDO = IDSCINTILLA+16, 230 | IDSCINTILLA_LIMIT = IDSCINTILLA+30, 231 | 232 | IDD_FILEVIEW_DIALOG = 1000, 233 | 234 | IDC_MINIMIZED_TRAY = 67001, 235 | 236 | IDD_CREATE_DIRECTORY = 1100, 237 | IDC_STATIC_CURRENT_FOLDER = 1101, 238 | IDC_EDIT_NEW_FOLDER = 1102, 239 | 240 | IDD_INSERT_INPUT_TEXT = 1200, 241 | IDC_EDIT_INPUT_VALUE = 1201, 242 | IDC_STATIC_INPUT_TITLE = 1202, 243 | IDC_ICON_INPUT_ICON = 1203, 244 | 245 | IDR_M30_MENU = 1500, 246 | 247 | IDR_SYSTRAYPOPUP_MENU = 1501, 248 | 249 | IDD_ABOUTBOX = 1700, 250 | IDC_LICENCE_EDIT = 1701, 251 | IDC_HOME_ADDR = 1702, 252 | IDC_EMAIL_ADDR = 1703, 253 | IDC_ONLINEHELP_ADDR = 1704, 254 | IDC_AUTHOR_NAME = 1705, 255 | IDC_BUILD_DATETIME = 1706, 256 | IDC_VERSION_BIT = 1707, 257 | 258 | IDD_DEBUGINFOBOX = 1750, 259 | IDC_DEBUGINFO_EDIT = 1751, 260 | IDC_DEBUGINFO_COPYLINK = 1752, 261 | 262 | IDD_DOSAVEORNOTBOX = 1760, 263 | IDC_DOSAVEORNOTTEX = 1761, 264 | 265 | IDD_GOLINE = 2000, 266 | ID_GOLINE_EDIT = IDD_GOLINE + 1, 267 | ID_CURRLINE = IDD_GOLINE + 2, 268 | ID_LASTLINE = IDD_GOLINE + 3, 269 | ID_URHERE_STATIC = IDD_GOLINE + 4, 270 | ID_UGO_STATIC = IDD_GOLINE + 5, 271 | ID_NOMORETHAN_STATIC = IDD_GOLINE + 6, 272 | IDC_RADIO_GOTOLINE = IDD_GOLINE + 7, 273 | IDC_RADIO_GOTOOFFSET = IDD_GOLINE + 8, 274 | 275 | IDD_VALUE_DLG = 2400, 276 | IDC_VALUE_STATIC = 2401, 277 | IDC_VALUE_EDIT = 2402, 278 | 279 | IDD_BUTTON_DLG = 2410, 280 | IDC_RESTORE_BUTTON = 2411, 281 | 282 | IDD_SETTING_DLG = 2500, 283 | 284 | NOTEPADPLUS_USER_INTERNAL = Constants.WM_USER + 0000, 285 | NPPM_INTERNAL_USERCMDLIST_MODIFIED = NOTEPADPLUS_USER_INTERNAL + 1, 286 | NPPM_INTERNAL_CMDLIST_MODIFIED = NOTEPADPLUS_USER_INTERNAL + 2, 287 | NPPM_INTERNAL_MACROLIST_MODIFIED = NOTEPADPLUS_USER_INTERNAL + 3, 288 | NPPM_INTERNAL_PLUGINCMDLIST_MODIFIED = NOTEPADPLUS_USER_INTERNAL + 4, 289 | NPPM_INTERNAL_CLEARSCINTILLAKEY = NOTEPADPLUS_USER_INTERNAL + 5, 290 | NPPM_INTERNAL_BINDSCINTILLAKEY = NOTEPADPLUS_USER_INTERNAL + 6, 291 | NPPM_INTERNAL_SCINTILLAKEYMODIFIED = NOTEPADPLUS_USER_INTERNAL + 7, 292 | NPPM_INTERNAL_SCINTILLAFINFERCOLLAPSE = NOTEPADPLUS_USER_INTERNAL + 8, 293 | NPPM_INTERNAL_SCINTILLAFINFERUNCOLLAPSE = NOTEPADPLUS_USER_INTERNAL + 9, 294 | NPPM_INTERNAL_DISABLEAUTOUPDATE = NOTEPADPLUS_USER_INTERNAL + 10, 295 | NPPM_INTERNAL_SETTING_HISTORY_SIZE = NOTEPADPLUS_USER_INTERNAL + 11, 296 | NPPM_INTERNAL_ISTABBARREDUCED = NOTEPADPLUS_USER_INTERNAL + 12, 297 | NPPM_INTERNAL_ISFOCUSEDTAB = NOTEPADPLUS_USER_INTERNAL + 13, 298 | NPPM_INTERNAL_GETMENU = NOTEPADPLUS_USER_INTERNAL + 14, 299 | NPPM_INTERNAL_CLEARINDICATOR = NOTEPADPLUS_USER_INTERNAL + 15, 300 | NPPM_INTERNAL_SCINTILLAFINFERCOPY = NOTEPADPLUS_USER_INTERNAL + 16, 301 | NPPM_INTERNAL_SCINTILLAFINFERSELECTALL = NOTEPADPLUS_USER_INTERNAL + 17, 302 | NPPM_INTERNAL_SETCARETWIDTH = NOTEPADPLUS_USER_INTERNAL + 18, 303 | NPPM_INTERNAL_SETCARETBLINKRATE = NOTEPADPLUS_USER_INTERNAL + 19, 304 | NPPM_INTERNAL_CLEARINDICATORTAGMATCH = NOTEPADPLUS_USER_INTERNAL + 20, 305 | NPPM_INTERNAL_CLEARINDICATORTAGATTR = NOTEPADPLUS_USER_INTERNAL + 21, 306 | NPPM_INTERNAL_SWITCHVIEWFROMHWND = NOTEPADPLUS_USER_INTERNAL + 22, 307 | NPPM_INTERNAL_UPDATETITLEBAR = NOTEPADPLUS_USER_INTERNAL + 23, 308 | NPPM_INTERNAL_CANCEL_FIND_IN_FILES = NOTEPADPLUS_USER_INTERNAL + 24, 309 | NPPM_INTERNAL_RELOADNATIVELANG = NOTEPADPLUS_USER_INTERNAL + 25, 310 | NPPM_INTERNAL_PLUGINSHORTCUTMOTIFIED = NOTEPADPLUS_USER_INTERNAL + 26, 311 | NPPM_INTERNAL_SCINTILLAFINFERCLEARALL = NOTEPADPLUS_USER_INTERNAL + 27, 312 | 313 | NPPM_INTERNAL_SETTING_TAB_REPLCESPACE = NOTEPADPLUS_USER_INTERNAL + 29, 314 | NPPM_INTERNAL_SETTING_TAB_SIZE = NOTEPADPLUS_USER_INTERNAL + 30, 315 | NPPM_INTERNAL_RELOADSTYLERS = NOTEPADPLUS_USER_INTERNAL + 31, 316 | NPPM_INTERNAL_DOCORDERCHANGED = NOTEPADPLUS_USER_INTERNAL + 32, 317 | NPPM_INTERNAL_SETMULTISELCTION = NOTEPADPLUS_USER_INTERNAL + 33, 318 | NPPM_INTERNAL_SCINTILLAFINFEROPENALL = NOTEPADPLUS_USER_INTERNAL + 34, 319 | NPPM_INTERNAL_RECENTFILELIST_UPDATE = NOTEPADPLUS_USER_INTERNAL + 35, 320 | NPPM_INTERNAL_RECENTFILELIST_SWITCH = NOTEPADPLUS_USER_INTERNAL + 36, 321 | NPPM_INTERNAL_GETSCINTEDTVIEW = NOTEPADPLUS_USER_INTERNAL + 37, 322 | NPPM_INTERNAL_ENABLESNAPSHOT = NOTEPADPLUS_USER_INTERNAL + 38, 323 | NPPM_INTERNAL_SAVECURRENTSESSION = NOTEPADPLUS_USER_INTERNAL + 39, 324 | NPPM_INTERNAL_FINDINFINDERDLG = NOTEPADPLUS_USER_INTERNAL + 40, 325 | NPPM_INTERNAL_REMOVEFINDER = NOTEPADPLUS_USER_INTERNAL + 41, 326 | NPPM_INTERNAL_RELOADSCROLLTOEND = NOTEPADPLUS_USER_INTERNAL + 42, 327 | NPPM_INTERNAL_FINDKEYCONFLICTS = NOTEPADPLUS_USER_INTERNAL + 43, 328 | NPPM_INTERNAL_SCROLLBEYONDLASTLINE = NOTEPADPLUS_USER_INTERNAL + 44, 329 | NPPM_INTERNAL_SETWORDCHARS = NOTEPADPLUS_USER_INTERNAL + 45, 330 | NPPM_INTERNAL_EXPORTFUNCLISTANDQUIT = NOTEPADPLUS_USER_INTERNAL + 46, 331 | NPPM_INTERNAL_PRNTANDQUIT = NOTEPADPLUS_USER_INTERNAL + 47, 332 | NPPM_INTERNAL_SAVEBACKUP = NOTEPADPLUS_USER_INTERNAL + 48, 333 | NPPM_INTERNAL_STOPMONITORING = NOTEPADPLUS_USER_INTERNAL + 49, 334 | NPPM_INTERNAL_EDGEBACKGROUND = NOTEPADPLUS_USER_INTERNAL + 50, 335 | NPPM_INTERNAL_EDGEMULTISETSIZE = NOTEPADPLUS_USER_INTERNAL + 51, 336 | NPPM_INTERNAL_UPDATECLICKABLELINKS = NOTEPADPLUS_USER_INTERNAL + 52, 337 | 338 | NPPM_INTERNAL_CHECKDOCSTATUS = Constants.NPPMSG + 53, 339 | 340 | NPPM_INTERNAL_ENABLECHECKDOCOPT = Constants.NPPMSG + 54, 341 | 342 | CHECKDOCOPT_NONE = 0, 343 | CHECKDOCOPT_UPDATESILENTLY = 1, 344 | CHECKDOCOPT_UPDATEGO2END = 2, 345 | 346 | NPPM_INTERNAL_SETFILENAME = Constants.NPPMSG + 63, 347 | 348 | SCINTILLA_USER = Constants.WM_USER + 2000, 349 | 350 | MACRO_USER = Constants.WM_USER + 4000, 351 | WM_GETCURRENTMACROSTATUS = MACRO_USER + 01, 352 | WM_MACRODLGRUNMACRO = MACRO_USER + 02, 353 | 354 | SPLITTER_USER = Constants.WM_USER + 4000, 355 | WORDSTYLE_USER = Constants.WM_USER + 5000, 356 | COLOURPOPUP_USER = Constants.WM_USER + 6000, 357 | BABYGRID_USER = Constants.WM_USER + 7000, 358 | 359 | MENUINDEX_FILE = 0, 360 | MENUINDEX_EDIT = 1, 361 | MENUINDEX_SEARCH = 2, 362 | MENUINDEX_VIEW = 3, 363 | MENUINDEX_FORMAT = 4, 364 | MENUINDEX_LANGUAGE = 5, 365 | MENUINDEX_SETTINGS = 6, 366 | MENUINDEX_TOOLS = 7, 367 | MENUINDEX_MACRO = 8, 368 | MENUINDEX_RUN = 9, 369 | MENUINDEX_PLUGINS = 10, 370 | /* --Autogenerated -- end of section automatically generated from resource.h */ 371 | } 372 | } 373 | -------------------------------------------------------------------------------- /PlantUmlViewer/PlantUmlViewer/PlantUmlViewer.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Debug 7 | x86 8 | {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 9 | {6110E276-539A-49A0-AEAD-269AB1C7B6E1} 10 | Library 11 | Properties 12 | PlantUmlViewer 13 | PlantUmlViewer 14 | bin\Debug\ 15 | v4.6.2 16 | 17 | 18 | 19 | 20 | 21 | true 22 | DEBUG;TRACE 23 | full 24 | prompt 25 | false 26 | bin\Debug-x86 27 | x86 28 | true 29 | false 30 | 31 | 32 | TRACE 33 | true 34 | bin\Release-x86 35 | pdbonly 36 | prompt 37 | x86 38 | true 39 | false 40 | 41 | 42 | true 43 | DEBUG;TRACE 44 | full 45 | prompt 46 | false 47 | bin\Debug-x64 48 | x64 49 | true 50 | false 51 | 52 | 53 | TRACE 54 | true 55 | bin\Release-x64 56 | pdbonly 57 | prompt 58 | x64 59 | true 60 | false 61 | 62 | 63 | 65 | Program 66 | $(ProgramW6432)\Notepad++\notepad++.exe 67 | $(MSBuildProgramFiles32)\Notepad++\notepad++.exe 68 | 69 | 70 | 71 | ..\packages\CyotekImageBox.1.4.0-beta.1\lib\net20\Cyotek.Windows.Forms.ImageBox.dll 72 | 73 | 74 | ..\packages\ExCSS.4.2.3\lib\netstandard2.0\ExCSS.dll 75 | 76 | 77 | ..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll 78 | 79 | 80 | ..\packages\Svg.3.4.7\lib\net462\Svg.dll 81 | 82 | 83 | 84 | ..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll 85 | 86 | 87 | 88 | 89 | ..\packages\System.Memory.4.5.5\lib\net461\System.Memory.dll 90 | 91 | 92 | ..\packages\System.Net.Http.4.3.4\lib\net46\System.Net.Http.dll 93 | 94 | 95 | 96 | ..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll 97 | 98 | 99 | ..\packages\System.Runtime.CompilerServices.Unsafe.4.5.3\lib\net461\System.Runtime.CompilerServices.Unsafe.dll 100 | 101 | 102 | ..\packages\System.Security.Cryptography.Algorithms.4.3.1\lib\net461\System.Security.Cryptography.Algorithms.dll 103 | 104 | 105 | ..\packages\System.Security.Cryptography.Encoding.4.3.0\lib\net46\System.Security.Cryptography.Encoding.dll 106 | 107 | 108 | ..\packages\System.Security.Cryptography.Primitives.4.3.0\lib\net46\System.Security.Cryptography.Primitives.dll 109 | 110 | 111 | ..\packages\System.Security.Cryptography.X509Certificates.4.3.2\lib\net461\System.Security.Cryptography.X509Certificates.dll 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | Component 132 | 133 | 134 | LoadingCircle.cs 135 | 136 | 137 | Component 138 | 139 | 140 | Form 141 | 142 | 143 | AboutWindow.cs 144 | 145 | 146 | 147 | Form 148 | 149 | 150 | OptionsWindow.cs 151 | 152 | 153 | 154 | 155 | 156 | 157 | Form 158 | 159 | 160 | PreviewWindow.cs 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | True 180 | True 181 | Resources.resx 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | AboutWindow.cs 192 | Designer 193 | 194 | 195 | PreviewWindow.cs 196 | Designer 197 | 198 | 199 | OptionsWindow.cs 200 | Designer 201 | 202 | 203 | ResXFileCodeGenerator 204 | Designer 205 | Resources.Designer.cs 206 | 207 | 208 | 209 | 210 | CHANGELOG.md 211 | Always 212 | 213 | 214 | README.md 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 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. 290 | 291 | 292 | 293 | 294 | 295 | 296 | 303 | --------------------------------------------------------------------------------