mirror of
https://github.com/greenshot/greenshot
synced 2025-08-22 22:34:27 -07:00
Removed multi-targeting in favor of dotnet core 3.0, this should reduce the resources needed to build for now.
This commit is contained in:
parent
ef13db8be7
commit
2649a323a4
75 changed files with 55 additions and 2569 deletions
|
@ -187,6 +187,12 @@ Task("DisableDNC30")
|
|||
ReplaceRegexInFiles("./**/*.csproj", "<Project Sdk=\"Microsoft.NET.Sdk.WindowsDesktop\">", "<Project Sdk=\"Microsoft.NET.Sdk\"><!-- Microsoft.NET.Sdk.WindowsDesktop -->");
|
||||
});
|
||||
|
||||
Task("DNC30Only")
|
||||
.Does(() =>
|
||||
{
|
||||
ReplaceRegexInFiles("./**/*.csproj", "<TargetFrameworks>net472;netcoreapp3.0</TargetFrameworks>", "<TargetFramework>netcoreapp3.0</TargetFramework><!-- net472;netcoreapp3.0 -->");
|
||||
});
|
||||
|
||||
Task("ChangeNETVersion")
|
||||
.Does(() =>
|
||||
{
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
|
||||
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
|
||||
|
||||
<PropertyGroup>
|
||||
<RootNamespace>Greenshot.Addon.Box</RootNamespace>
|
||||
<AssemblyName>Greenshot.Addon.Box</AssemblyName>
|
||||
<TargetFrameworks>net472;netcoreapp3.0</TargetFrameworks>
|
||||
<TargetFramework>netcoreapp3.0</TargetFramework><!-- net472;netcoreapp3.0 -->
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
|
||||
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
|
||||
|
||||
<PropertyGroup>
|
||||
<RootNamespace>Greenshot.Addon.Confluence</RootNamespace>
|
||||
<AssemblyName>Greenshot.Addon.Confluence</AssemblyName>
|
||||
<TargetFrameworks>net472;netcoreapp3.0</TargetFrameworks>
|
||||
<TargetFramework>netcoreapp3.0</TargetFramework><!-- net472;netcoreapp3.0 -->
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
|
||||
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
|
||||
|
||||
<PropertyGroup>
|
||||
<RootNamespace>Greenshot.Addon.Dropbox</RootNamespace>
|
||||
<AssemblyName>Greenshot.Addon.Dropbox</AssemblyName>
|
||||
<TargetFrameworks>net472;netcoreapp3.0</TargetFrameworks>
|
||||
<TargetFramework>netcoreapp3.0</TargetFramework><!-- net472;netcoreapp3.0 -->
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
|
||||
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
|
||||
|
||||
<PropertyGroup>
|
||||
<RootNamespace>Greenshot.Addon.ExternalCommand</RootNamespace>
|
||||
<AssemblyName>Greenshot.Addon.ExternalCommand</AssemblyName>
|
||||
<TargetFrameworks>net472;netcoreapp3.0</TargetFrameworks>
|
||||
<TargetFramework>netcoreapp3.0</TargetFramework><!-- net472;netcoreapp3.0 -->
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
@ -41,7 +41,7 @@
|
|||
<PackageReference Include="Dapplo.CaliburnMicro.Configuration" Version="1.2.21" />
|
||||
<PackageReference Include="Dapplo.CaliburnMicro.Translations" Version="1.2.21" />
|
||||
<PackageReference Include="Dapplo.Windows.Clipboard" Version="0.8.18" />
|
||||
<PackageReference Include="CliWrap" Version="2.2.0" />
|
||||
<PackageReference Include="CliWrap" Version="2.2.1" />
|
||||
<PackageReference Include="Fody" Version="4.0.2">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
|
||||
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
|
||||
|
||||
<PropertyGroup>
|
||||
<RootNamespace>Greenshot.Addon.Flickr</RootNamespace>
|
||||
<AssemblyName>Greenshot.Addon.Flickr</AssemblyName>
|
||||
<TargetFrameworks>net472;netcoreapp3.0</TargetFrameworks>
|
||||
<TargetFramework>netcoreapp3.0</TargetFramework><!-- net472;netcoreapp3.0 -->
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
|
||||
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
|
||||
|
||||
<PropertyGroup>
|
||||
<RootNamespace>Greenshot.Addon.GooglePhotos</RootNamespace>
|
||||
<AssemblyName>Greenshot.Addon.GooglePhotos</AssemblyName>
|
||||
<TargetFrameworks>net472;netcoreapp3.0</TargetFrameworks>
|
||||
<TargetFramework>netcoreapp3.0</TargetFramework><!-- net472;netcoreapp3.0 -->
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
|
||||
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
|
||||
|
||||
<PropertyGroup>
|
||||
<RootNamespace>Greenshot.Addon.Imgur</RootNamespace>
|
||||
<AssemblyName>Greenshot.Addon.Imgur</AssemblyName>
|
||||
<TargetFrameworks>net472;netcoreapp3.0</TargetFrameworks>
|
||||
<TargetFramework>netcoreapp3.0</TargetFramework><!-- net472;netcoreapp3.0 -->
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
|
||||
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>net472;netcoreapp3.0</TargetFrameworks>
|
||||
<TargetFramework>netcoreapp3.0</TargetFramework><!-- net472;netcoreapp3.0 -->
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
</PropertyGroup>
|
||||
|
||||
|
|
|
@ -3,41 +3,14 @@
|
|||
<PropertyGroup>
|
||||
<RootNamespace>Greenshot.Addon.Jira</RootNamespace>
|
||||
<AssemblyName>Greenshot.Addon.Jira</AssemblyName>
|
||||
<TargetFrameworks>net472</TargetFrameworks>
|
||||
<TargetFrameworks>netcoreapp3.0</TargetFrameworks>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Include="Languages\language*.xml">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition="'$(TargetFramework)' == 'net472'">
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="Microsoft.VisualBasic" />
|
||||
<Reference Include="PresentationCore" />
|
||||
<Reference Include="PresentationFramework" />
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.ComponentModel.Composition" />
|
||||
<Reference Include="System.ComponentModel.DataAnnotations" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Net.Http.WebRequest" />
|
||||
<Reference Include="System.Runtime.Caching" />
|
||||
<Reference Include="System.Runtime.Serialization" />
|
||||
<Reference Include="System.ServiceModel" />
|
||||
<Reference Include="System.Web.Services" />
|
||||
<Reference Include="System.Windows" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xaml" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="WindowsBase" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="jira.svgz" />
|
||||
<EmbeddedResource Include="jira.svgz" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
@ -52,7 +25,7 @@
|
|||
<PackageReference Include="Dapplo.CaliburnMicro.Translations" Version="1.2.21" />
|
||||
<PackageReference Include="Dapplo.HttpExtensions.JsonNet" Version="0.9.18" />
|
||||
<PackageReference Include="Dapplo.HttpExtensions.OAuth" Version="0.9.18" />
|
||||
<PackageReference Include="Dapplo.Utils" Version="1.1.9" />
|
||||
<PackageReference Include="Dapplo.Utils" Version="1.1.18" />
|
||||
<PackageReference Include="Dapplo.Windows.Clipboard" Version="0.8.18" />
|
||||
<PackageReference Include="Dapplo.Jira" Version="0.8.9" />
|
||||
<PackageReference Include="Fody" Version="4.0.2">
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
|
||||
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
|
||||
|
||||
<PropertyGroup>
|
||||
<RootNamespace>Greenshot.Addon.LegacyEditor</RootNamespace>
|
||||
<AssemblyName>Greenshot.Addon.LegacyEditor</AssemblyName>
|
||||
<TargetFrameworks>net472;netcoreapp3.0</TargetFrameworks>
|
||||
<TargetFramework>netcoreapp3.0</TargetFramework><!-- net472;netcoreapp3.0 -->
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
</PropertyGroup>
|
||||
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
|
||||
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
|
||||
|
||||
<PropertyGroup>
|
||||
<RootNamespace>Greenshot.Addon.Lutim</RootNamespace>
|
||||
<AssemblyName>Greenshot.Addon.Lutim</AssemblyName>
|
||||
<TargetFrameworks>net472;netcoreapp3.0</TargetFrameworks>
|
||||
<TargetFramework>netcoreapp3.0</TargetFramework><!-- net472;netcoreapp3.0 -->
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
@ -1,47 +0,0 @@
|
|||
// Greenshot - a free and open source screenshot tool
|
||||
// Copyright (C) 2007-2018 Thomas Braun, Jens Klingen, Robin Krom
|
||||
//
|
||||
// For more information see: http://getgreenshot.org/
|
||||
// The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 1 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using Dapplo.Config.Ini;
|
||||
|
||||
namespace Greenshot.Addon.OCR.Configuration
|
||||
{
|
||||
/// <summary>
|
||||
/// OCR Configuration.
|
||||
/// </summary>
|
||||
[IniSection("OCR")]
|
||||
[Description("Greenshot OCR Plugin configuration")]
|
||||
[SuppressMessage("ReSharper", "UnusedMember.Global")]
|
||||
#pragma warning disable CS1591
|
||||
public interface IOcrConfiguration : IIniSection
|
||||
{
|
||||
[Description("Language for OCR")]
|
||||
[DefaultValue ("miLANG_ENGLISH")]
|
||||
string Language { get; set; }
|
||||
|
||||
[Description("Orient image?")]
|
||||
[DefaultValue(true)]
|
||||
bool Orientimage { get; set; }
|
||||
|
||||
[Description("Straighten image?")]
|
||||
[DefaultValue(true)]
|
||||
bool StraightenImage { get; set; }
|
||||
}
|
||||
}
|
|
@ -1,35 +0,0 @@
|
|||
// Greenshot - a free and open source screenshot tool
|
||||
// Copyright (C) 2007-2017 Thomas Braun, Jens Klingen, Robin Krom
|
||||
//
|
||||
// For more information see: http://getgreenshot.org/
|
||||
// The Greenshot project is hosted on GitHub: https://github.com/greenshot
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 1 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using Dapplo.Config.Language;
|
||||
|
||||
namespace Greenshot.Addon.OCR.Configuration
|
||||
{
|
||||
[Language("Ocr")]
|
||||
[SuppressMessage("ReSharper", "UnusedMember.Global")]
|
||||
#pragma warning disable CS1591
|
||||
public interface IOcrLanguage : ILanguage
|
||||
{
|
||||
string Language { get; }
|
||||
string OrientImage { get; }
|
||||
string StraightenImage { get; }
|
||||
|
||||
}
|
||||
}
|
|
@ -1,30 +0,0 @@
|
|||
// Greenshot - a free and open source screenshot tool
|
||||
// Copyright (C) 2007-2018 Thomas Braun, Jens Klingen, Robin Krom
|
||||
//
|
||||
// For more information see: http://getgreenshot.org/
|
||||
// The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 1 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
using Dapplo.Config.Ini;
|
||||
|
||||
namespace Greenshot.Addon.OCR.Configuration.Impl
|
||||
{
|
||||
internal class OcrConfigurationImpl : IniSectionBase<IOcrConfiguration>, IOcrConfiguration
|
||||
{
|
||||
public string Language { get; set; }
|
||||
public bool Orientimage { get; set; }
|
||||
public bool StraightenImage { get; set; }
|
||||
}
|
||||
}
|
|
@ -1,36 +0,0 @@
|
|||
// Greenshot - a free and open source screenshot tool
|
||||
// Copyright (C) 2007-2018 Thomas Braun, Jens Klingen, Robin Krom
|
||||
//
|
||||
// For more information see: http://getgreenshot.org/
|
||||
// The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 1 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using Dapplo.Config.Language;
|
||||
|
||||
namespace Greenshot.Addon.OCR.Configuration.Impl
|
||||
{
|
||||
/// <summary>
|
||||
/// This implements IOcrLanguage and takes care of storing, all setters are replaced via AutoProperties.Fody
|
||||
/// </summary>
|
||||
#pragma warning disable CS1591
|
||||
[SuppressMessage("ReSharper", "UnassignedGetOnlyAutoProperty")]
|
||||
public class OcrLanguageImpl : LanguageBase<IOcrLanguage>, IOcrLanguage
|
||||
{
|
||||
public string Language { get; }
|
||||
public string OrientImage { get; }
|
||||
public string StraightenImage { get; }
|
||||
}
|
||||
}
|
|
@ -1,4 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
|
||||
<AutoProperties />
|
||||
</Weavers>
|
|
@ -1,26 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
|
||||
<!-- This file was generated by Fody. Manual changes to this file will be lost when your project is rebuilt. -->
|
||||
<xs:element name="Weavers">
|
||||
<xs:complexType>
|
||||
<xs:all>
|
||||
<xs:element name="AutoProperties" minOccurs="0" maxOccurs="1" type="xs:anyType" />
|
||||
</xs:all>
|
||||
<xs:attribute name="VerifyAssembly" type="xs:boolean">
|
||||
<xs:annotation>
|
||||
<xs:documentation>'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.</xs:documentation>
|
||||
</xs:annotation>
|
||||
</xs:attribute>
|
||||
<xs:attribute name="VerifyIgnoreCodes" type="xs:string">
|
||||
<xs:annotation>
|
||||
<xs:documentation>A comma-separated list of error codes that can be safely ignored in assembly verification.</xs:documentation>
|
||||
</xs:annotation>
|
||||
</xs:attribute>
|
||||
<xs:attribute name="GenerateXsd" type="xs:boolean">
|
||||
<xs:annotation>
|
||||
<xs:documentation>'false' to turn off automatic generation of the XML Schema file.</xs:documentation>
|
||||
</xs:annotation>
|
||||
</xs:attribute>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:schema>
|
|
@ -1,49 +0,0 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
|
||||
|
||||
<PropertyGroup>
|
||||
<RootNamespace>Greenshot.Addon.OCR</RootNamespace>
|
||||
<AssemblyName>Greenshot.Addon.OCR</AssemblyName>
|
||||
<TargetFrameworks>net472;netcoreapp3.0</TargetFrameworks>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Include="Languages\language*.xml">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition="'$(TargetFramework)' == 'net472'">
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="Microsoft.VisualBasic" />
|
||||
<Reference Include="PresentationCore" />
|
||||
<Reference Include="PresentationFramework" />
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.ComponentModel.Composition" />
|
||||
<Reference Include="System.ComponentModel.DataAnnotations" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Runtime.Caching" />
|
||||
<Reference Include="System.Runtime.Serialization" />
|
||||
<Reference Include="System.Windows" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xaml" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="WindowsBase" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Greenshot.Addons\Greenshot.Addons.csproj" />
|
||||
<ProjectReference Include="..\Greenshot.Core\Greenshot.Core.csproj" />
|
||||
<ProjectReference Include="..\Greenshot.Gfx\Greenshot.Gfx.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="AutoProperties.Fody" Version="1.20.0" />
|
||||
<PackageReference Include="Dapplo.CaliburnMicro.Configuration" Version="1.2.21" />
|
||||
<PackageReference Include="Dapplo.CaliburnMicro.Translations" Version="1.2.21" />
|
||||
<PackageReference Include="Dapplo.Windows.Clipboard" Version="0.8.18" />
|
||||
<PackageReference Include="Fody" Version="4.0.2">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -1,9 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<language>
|
||||
<resources prefix="OCR">
|
||||
<resource name="language">Jazyk pro OCR</resource>
|
||||
<resource name="orient_image">Orientaci obrázku</resource>
|
||||
<resource name="straighten_image">Srovnat obrázek</resource>
|
||||
</resources>
|
||||
</language>
|
|
@ -1,15 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<language>
|
||||
<resources prefix="OCR">
|
||||
<resource name="language">
|
||||
Sprache für OCR
|
||||
</resource>
|
||||
<resource name="orient_image">
|
||||
Bild ausrichten
|
||||
</resource>
|
||||
<resource name="straighten_image">
|
||||
Bild glätten
|
||||
</resource>
|
||||
</resources>
|
||||
</language>
|
|
@ -1,15 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<language>
|
||||
<resources prefix="OCR">
|
||||
<resource name="language">
|
||||
Language for OCR
|
||||
</resource>
|
||||
<resource name="orient_image">
|
||||
Orient image
|
||||
</resource>
|
||||
<resource name="straighten_image">
|
||||
Straighten image
|
||||
</resource>
|
||||
</resources>
|
||||
</language>
|
|
@ -1,9 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<language>
|
||||
<resources prefix="OCR">
|
||||
<resource name="language">Langage pour l'OCR</resource>
|
||||
<resource name="orient_image">Orienter l'image</resource>
|
||||
<resource name="straighten_image">Redresser l'image</resource>
|
||||
</resources>
|
||||
</language>
|
|
@ -1,9 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<language>
|
||||
<resources prefix="OCR">
|
||||
<resource name="language">Bahasa untuk OCR</resource>
|
||||
<resource name="orient_image">Orientasikan gambar</resource>
|
||||
<resource name="straighten_image">Rapikan gambar</resource>
|
||||
</resources>
|
||||
</language>
|
|
@ -1,15 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<language>
|
||||
<resources prefix="OCR">
|
||||
<resource name="language">
|
||||
Lingua OCR
|
||||
</resource>
|
||||
<resource name="orient_image">
|
||||
Orienta
|
||||
</resource>
|
||||
<resource name="straighten_image">
|
||||
Raddrizza
|
||||
</resource>
|
||||
</resources>
|
||||
</language>
|
|
@ -1,8 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<language>
|
||||
<resources prefix="OCR">
|
||||
<resource name="language">OCRの言語</resource>
|
||||
<resource name="orient_image">画像の向きを揃える</resource>
|
||||
<resource name="straighten_image">画像の傾きを補正する</resource>
|
||||
</resources>
|
||||
</language>
|
|
@ -1,8 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<language>
|
||||
<resources prefix="OCR">
|
||||
<resource name="language">Tutlayt i OCR</resource>
|
||||
<resource name="orient_image">Wehhi tugna</resource>
|
||||
<resource name="straighten_image">Seggwem tugna</resource>
|
||||
</resources>
|
||||
</language>
|
|
@ -1,15 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<language>
|
||||
<resources prefix="OCR">
|
||||
<resource name="language">
|
||||
OCR 언어
|
||||
</resource>
|
||||
<resource name="orient_image">
|
||||
가로 이미지
|
||||
</resource>
|
||||
<resource name="straighten_image">
|
||||
세로 이미지
|
||||
</resource>
|
||||
</resources>
|
||||
</language>
|
|
@ -1,16 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<!-- Translated by Kārlis Kalviškis (eko@lanet.lv) 2014.12.17. -->
|
||||
<language>
|
||||
<resources prefix="OCR">
|
||||
<resource name="language">
|
||||
OCR valoda
|
||||
</resource>
|
||||
<resource name="orient_image">
|
||||
Pagriezt attēlu
|
||||
</resource>
|
||||
<resource name="straighten_image">
|
||||
Iztaisnot attēlu
|
||||
</resource>
|
||||
</resources>
|
||||
</language>
|
|
@ -1,15 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<language>
|
||||
<resources prefix="OCR">
|
||||
<resource name="language">
|
||||
Taal voor OCR
|
||||
</resource>
|
||||
<resource name="orient_image">
|
||||
Beeld richten
|
||||
</resource>
|
||||
<resource name="straighten_image">
|
||||
Beeld vereffenen
|
||||
</resource>
|
||||
</resources>
|
||||
</language>
|
|
@ -1,9 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<language>
|
||||
<resources prefix="OCR">
|
||||
<resource name="language">Język dla OCR</resource>
|
||||
<resource name="orient_image">Orientacja obrazu</resource>
|
||||
<resource name="straighten_image">Wyprostowanie obrazów</resource>
|
||||
</resources>
|
||||
</language>
|
|
@ -1,9 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<language>
|
||||
<resources prefix="OCR">
|
||||
<resource name="language">Idioma para OCR</resource>
|
||||
<resource name="orient_image">Orientar imagem</resource>
|
||||
<resource name="straighten_image">Endireitar imagem</resource>
|
||||
</resources>
|
||||
</language>
|
|
@ -1,9 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<language>
|
||||
<resources prefix="OCR">
|
||||
<resource name="language">Язык для OCR</resource>
|
||||
<resource name="orient_image">Ориентация изображения</resource>
|
||||
<resource name="straighten_image">Выпрямление изображения</resource>
|
||||
</resources>
|
||||
</language>
|
|
@ -1,15 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<language>
|
||||
<resources prefix="OCR">
|
||||
<resource name="language">
|
||||
Jazyk pre OCR
|
||||
</resource>
|
||||
<resource name="orient_image">
|
||||
Orientácia obrázku
|
||||
</resource>
|
||||
<resource name="straighten_image">
|
||||
Narovnať obrázok
|
||||
</resource>
|
||||
</resources>
|
||||
</language>
|
|
@ -1,9 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<language>
|
||||
<resources prefix="OCR">
|
||||
<resource name="language">Језик за препознавање знакова</resource>
|
||||
<resource name="orient_image">Усмери слику</resource>
|
||||
<resource name="straighten_image">Исправи слику</resource>
|
||||
</resources>
|
||||
</language>
|
|
@ -1,15 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<language>
|
||||
<resources prefix="OCR">
|
||||
<resource name="language">
|
||||
Språk för OCR
|
||||
</resource>
|
||||
<resource name="orient_image">
|
||||
Orientera bild
|
||||
</resource>
|
||||
<resource name="straighten_image">
|
||||
Släta ut bild
|
||||
</resource>
|
||||
</resources>
|
||||
</language>
|
|
@ -1,9 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<language>
|
||||
<resources prefix="OCR">
|
||||
<resource name="language">Мова для ОРТ</resource>
|
||||
<resource name="orient_image">Орієнтувати зображення</resource>
|
||||
<resource name="straighten_image">Випрямлення зображення</resource>
|
||||
</resources>
|
||||
</language>
|
|
@ -1,15 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<language>
|
||||
<resources prefix="OCR">
|
||||
<resource name="language">
|
||||
OCR语言
|
||||
</resource>
|
||||
<resource name="orient_image">
|
||||
图像定位
|
||||
</resource>
|
||||
<resource name="straighten_image">
|
||||
图像矫正
|
||||
</resource>
|
||||
</resources>
|
||||
</language>
|
|
@ -1,9 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<language>
|
||||
<resources prefix="OCR">
|
||||
<resource name="language">OCR 語言</resource>
|
||||
<resource name="orient_image">定向圖片</resource>
|
||||
<resource name="straighten_image">拉直圖片</resource>
|
||||
</resources>
|
||||
</language>
|
|
@ -1,31 +0,0 @@
|
|||
namespace Greenshot.Addon.OCR
|
||||
{
|
||||
/// <summary>
|
||||
/// Needed for the drop down, available languages for OCR
|
||||
/// </summary>
|
||||
public enum ModiLanguage
|
||||
{
|
||||
CHINESE_SIMPLIFIED = 2052,
|
||||
CHINESE_TRADITIONAL = 1028,
|
||||
CZECH = 5,
|
||||
DANISH = 6,
|
||||
DUTCH = 19,
|
||||
ENGLISH = 9,
|
||||
FINNISH = 11,
|
||||
FRENCH = 12,
|
||||
GERMAN = 7,
|
||||
GREEK = 8,
|
||||
HUNGARIAN = 14,
|
||||
ITALIAN = 16,
|
||||
JAPANESE = 17,
|
||||
KOREAN = 18,
|
||||
NORWEGIAN = 20,
|
||||
POLISH = 21,
|
||||
PORTUGUESE = 22,
|
||||
RUSSIAN = 25,
|
||||
SPANISH = 10,
|
||||
SWEDISH = 29,
|
||||
TURKISH = 31,
|
||||
SYSDEFAULT = 2048
|
||||
}
|
||||
}
|
|
@ -1,209 +0,0 @@
|
|||
// Greenshot - a free and open source screenshot tool
|
||||
// Copyright (C) 2007-2018 Thomas Braun, Jens Klingen, Robin Krom
|
||||
//
|
||||
// For more information see: http://getgreenshot.org/
|
||||
// The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 1 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using System.Windows.Forms;
|
||||
using Dapplo.Log;
|
||||
using Greenshot.Addon.OCR.Configuration;
|
||||
using Greenshot.Addons;
|
||||
using Greenshot.Addons.Components;
|
||||
using Greenshot.Addons.Core;
|
||||
using Greenshot.Addons.Interfaces;
|
||||
using Greenshot.Addons.Interfaces.Plugin;
|
||||
using Greenshot.Core.Enums;
|
||||
using Greenshot.Gfx;
|
||||
using Greenshot.Gfx.Effects;
|
||||
|
||||
namespace Greenshot.Addon.OCR
|
||||
{
|
||||
/// <summary>
|
||||
/// Description of OCRDestination.
|
||||
/// </summary>
|
||||
[Destination("OCR")]
|
||||
public class OcrDestination : AbstractDestination
|
||||
{
|
||||
private static readonly LogSource Log = new LogSource();
|
||||
private const int MinWidth = 130;
|
||||
private const int MinHeight = 130;
|
||||
private readonly IOcrConfiguration _ocrConfiguration;
|
||||
private readonly string _ocrCommand;
|
||||
|
||||
public OcrDestination(
|
||||
IOcrConfiguration ocrConfiguration,
|
||||
ICoreConfiguration coreConfiguration,
|
||||
IGreenshotLanguage greenshotLanguage,
|
||||
ExportNotification exportNotification
|
||||
) : base(coreConfiguration, greenshotLanguage)
|
||||
{
|
||||
_ocrConfiguration = ocrConfiguration;
|
||||
|
||||
var ocrDirectory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
|
||||
if (ocrDirectory == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
_ocrCommand = Path.Combine(ocrDirectory, "greenshotocrcommand.exe");
|
||||
IsActive = File.Exists(_ocrCommand) && HasModi();
|
||||
|
||||
}
|
||||
|
||||
public override bool IsActive { get; }
|
||||
|
||||
public override string Description => "OCR";
|
||||
|
||||
public override IBitmapWithNativeSupport GetDisplayIcon(double dpi)
|
||||
{
|
||||
var exePath = PluginUtils.GetExePath("MSPVIEW.EXE");
|
||||
if (exePath != null && File.Exists(exePath))
|
||||
{
|
||||
return PluginUtils.GetCachedExeIcon(exePath, 0, dpi > 100);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
protected override ExportInformation ExportCapture(bool manuallyInitiated, ISurface surface, ICaptureDetails captureDetails)
|
||||
{
|
||||
var exportInformation = new ExportInformation(Designation, Description)
|
||||
{
|
||||
ExportMade = DoOcr(surface) != null
|
||||
};
|
||||
return exportInformation;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Handling of the CaptureTaken "event" from the ICaptureHost
|
||||
/// We do the OCR here!
|
||||
/// </summary>
|
||||
/// <param name="surface">Has the Image and the capture details</param>
|
||||
public string DoOcr(ISurface surface)
|
||||
{
|
||||
var outputSettings = new SurfaceOutputSettings(CoreConfiguration, OutputFormats.bmp, 0, true)
|
||||
{
|
||||
ReduceColors = true,
|
||||
SaveBackgroundOnly = true
|
||||
};
|
||||
// We only want the background
|
||||
// Force Grayscale output
|
||||
outputSettings.Effects.Add(new GrayscaleEffect());
|
||||
|
||||
// Also we need to check the size, resize if needed to 130x130 this is the minimum
|
||||
if (surface.Screenshot.Width < MinWidth || surface.Screenshot.Height < MinHeight)
|
||||
{
|
||||
var addedWidth = MinWidth - surface.Screenshot.Width;
|
||||
if (addedWidth < 0)
|
||||
{
|
||||
addedWidth = 0;
|
||||
}
|
||||
var addedHeight = MinHeight - surface.Screenshot.Height;
|
||||
if (addedHeight < 0)
|
||||
{
|
||||
addedHeight = 0;
|
||||
}
|
||||
IEffect effect = new ResizeCanvasEffect(addedWidth / 2, addedWidth / 2, addedHeight / 2, addedHeight / 2);
|
||||
outputSettings.Effects.Add(effect);
|
||||
}
|
||||
var filePath = ImageOutput.SaveToTmpFile(surface, outputSettings, null);
|
||||
|
||||
Log.Debug().WriteLine("Saved tmp file to: " + filePath);
|
||||
|
||||
var text = "";
|
||||
try
|
||||
{
|
||||
var processStartInfo = new ProcessStartInfo(_ocrCommand, "\"" + filePath + "\" " + _ocrConfiguration.Language + " " + _ocrConfiguration.Orientimage + " " + _ocrConfiguration.StraightenImage)
|
||||
{
|
||||
CreateNoWindow = true,
|
||||
RedirectStandardOutput = true,
|
||||
UseShellExecute = false
|
||||
};
|
||||
using (var process = Process.Start(processStartInfo))
|
||||
{
|
||||
if (process != null)
|
||||
{
|
||||
process.WaitForExit(30 * 1000);
|
||||
if (process.ExitCode == 0)
|
||||
{
|
||||
text = process.StandardOutput.ReadToEnd();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Log.Error().WriteLine(e, "Error while calling Microsoft Office Document Imaging (MODI) to OCR: ");
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (File.Exists(filePath))
|
||||
{
|
||||
Log.Debug().WriteLine("Cleaning up tmp file: " + filePath);
|
||||
File.Delete(filePath);
|
||||
}
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(text))
|
||||
{
|
||||
Log.Info().WriteLine("No text returned");
|
||||
return null;
|
||||
}
|
||||
|
||||
// For for BUG-1884:
|
||||
text = text.Trim();
|
||||
|
||||
try
|
||||
{
|
||||
Log.Debug().WriteLine("Pasting OCR Text to Clipboard: {0}", text);
|
||||
// Paste to Clipboard (the Plugin currently doesn't have access to the ClipboardHelper from Greenshot
|
||||
IDataObject ido = new DataObject();
|
||||
ido.SetData(DataFormats.Text, true, text);
|
||||
Clipboard.SetDataObject(ido, true);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Log.Error().WriteLine(e, "Problem pasting text to clipboard: ");
|
||||
}
|
||||
return text;
|
||||
}
|
||||
|
||||
private bool HasModi()
|
||||
{
|
||||
try
|
||||
{
|
||||
using (var process = Process.Start(_ocrCommand, "-c"))
|
||||
{
|
||||
if (process != null)
|
||||
{
|
||||
process.WaitForExit();
|
||||
return process.ExitCode == 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Log.Debug().WriteLine("Error trying to initiate MODI: {0}", e.Message);
|
||||
}
|
||||
Log.Info().WriteLine("No Microsoft Office Document Imaging (MODI) found, disabling OCR");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,83 +0,0 @@
|
|||
// Greenshot - a free and open source screenshot tool
|
||||
// Copyright (C) 2007-2018 Thomas Braun, Jens Klingen, Robin Krom
|
||||
//
|
||||
// For more information see: http://getgreenshot.org/
|
||||
// The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 1 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using Autofac;
|
||||
using Dapplo.Addons;
|
||||
using Dapplo.Addons.Bootstrapper.Resolving;
|
||||
using Dapplo.Config.Ini;
|
||||
using Dapplo.Config.Language;
|
||||
using Greenshot.Addon.OCR.Configuration;
|
||||
using Greenshot.Addon.OCR.Configuration.Impl;
|
||||
using Greenshot.Addons.Components;
|
||||
|
||||
namespace Greenshot.Addon.OCR
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public class OcrAddonModule : AddonModule
|
||||
{
|
||||
private bool HasModi()
|
||||
{
|
||||
var ocrCommand = Path.Combine(FileTools.NormalizeDirectory(Path.GetDirectoryName(GetType().Assembly.Location)), "greenshotocrcommand.exe");
|
||||
try
|
||||
{
|
||||
using (var process = Process.Start(ocrCommand, "-c"))
|
||||
{
|
||||
if (process != null)
|
||||
{
|
||||
process.WaitForExit();
|
||||
return process.ExitCode == 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
// ignored
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Load(ContainerBuilder builder)
|
||||
{
|
||||
if (HasModi())
|
||||
{
|
||||
builder
|
||||
.RegisterType<OcrConfigurationImpl>()
|
||||
.As<IOcrConfiguration>()
|
||||
.As<IIniSection>()
|
||||
.SingleInstance();
|
||||
|
||||
builder
|
||||
.RegisterType<OcrLanguageImpl>()
|
||||
.As<IOcrLanguage>()
|
||||
.As<ILanguage>()
|
||||
.SingleInstance();
|
||||
|
||||
builder
|
||||
.RegisterType<OcrDestination>()
|
||||
.As<IDestination>()
|
||||
.SingleInstance();
|
||||
}
|
||||
base.Load(builder);
|
||||
}
|
||||
}
|
||||
}
|
149
src/Greenshot.Addon.OCR/SettingsForm.Designer.cs
generated
149
src/Greenshot.Addon.OCR/SettingsForm.Designer.cs
generated
|
@ -1,149 +0,0 @@
|
|||
/*
|
||||
* Greenshot - a free and open source screenshot tool
|
||||
* Copyright (C) 2007-2018 Thomas Braun, Jens Klingen, Robin Krom
|
||||
*
|
||||
* For more information see: http://getgreenshot.org/
|
||||
* The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 1 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
using Greenshot.Addons.Controls;
|
||||
|
||||
namespace Greenshot.Addon.OCR
|
||||
{
|
||||
partial class SettingsForm
|
||||
{
|
||||
/// <summary>
|
||||
/// Designer variable used to keep track of non-visual components.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Disposes resources used by the form.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing) {
|
||||
if (components != null) {
|
||||
components.Dispose();
|
||||
}
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This method is required for Windows Forms designer support.
|
||||
/// Do not change the method contents inside the source code editor. The Forms designer might
|
||||
/// not be able to load this method if it was changed manually.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.comboBox_languages = new System.Windows.Forms.ComboBox();
|
||||
this.checkBox_orientImage = new GreenshotCheckBox();
|
||||
this.checkBox_straightenImage = new GreenshotCheckBox();
|
||||
this.label_language = new GreenshotLabel();
|
||||
this.buttonOK = new GreenshotButton();
|
||||
this.buttonCancel = new GreenshotButton();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// comboBox_languages
|
||||
//
|
||||
this.comboBox_languages.FormattingEnabled = true;
|
||||
this.comboBox_languages.Items.AddRange(new object[] {
|
||||
"English",
|
||||
"Deutsch"});
|
||||
this.comboBox_languages.Location = new System.Drawing.Point(74, 12);
|
||||
this.comboBox_languages.Name = "comboBox_languages";
|
||||
this.comboBox_languages.Size = new System.Drawing.Size(153, 21);
|
||||
this.comboBox_languages.TabIndex = 1;
|
||||
//
|
||||
// checkBox_orientImage
|
||||
//
|
||||
this.checkBox_orientImage.LanguageKey = "ocr.orient_image";
|
||||
this.checkBox_orientImage.Location = new System.Drawing.Point(13, 68);
|
||||
this.checkBox_orientImage.Name = "checkBox_orientImage";
|
||||
this.checkBox_orientImage.PropertyName = "orientimage";
|
||||
this.checkBox_orientImage.SectionName = "OCR";
|
||||
this.checkBox_orientImage.Size = new System.Drawing.Size(104, 24);
|
||||
this.checkBox_orientImage.TabIndex = 3;
|
||||
this.checkBox_orientImage.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// checkBox_straightenImage
|
||||
//
|
||||
this.checkBox_straightenImage.LanguageKey = "ocr.straighten_image";
|
||||
this.checkBox_straightenImage.Location = new System.Drawing.Point(13, 41);
|
||||
this.checkBox_straightenImage.Name = "checkBox_straightenImage";
|
||||
this.checkBox_straightenImage.PropertyName = "straightenImage";
|
||||
this.checkBox_straightenImage.SectionName = "OCR";
|
||||
this.checkBox_straightenImage.Size = new System.Drawing.Size(109, 24);
|
||||
this.checkBox_straightenImage.TabIndex = 2;
|
||||
this.checkBox_straightenImage.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// label_language
|
||||
//
|
||||
this.label_language.LanguageKey = "ocr.language";
|
||||
this.label_language.Location = new System.Drawing.Point(13, 15);
|
||||
this.label_language.Name = "label_language";
|
||||
this.label_language.Size = new System.Drawing.Size(55, 23);
|
||||
this.label_language.TabIndex = 3;
|
||||
//
|
||||
// buttonOK
|
||||
//
|
||||
this.buttonOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.buttonOK.DialogResult = System.Windows.Forms.DialogResult.OK;
|
||||
this.buttonOK.LanguageKey = "OK";
|
||||
this.buttonOK.Location = new System.Drawing.Point(12, 98);
|
||||
this.buttonOK.Name = "buttonOK";
|
||||
this.buttonOK.Size = new System.Drawing.Size(104, 23);
|
||||
this.buttonOK.TabIndex = 4;
|
||||
this.buttonOK.UseVisualStyleBackColor = true;
|
||||
this.buttonOK.Click += new System.EventHandler(this.ButtonOkClick);
|
||||
//
|
||||
// buttonCancel
|
||||
//
|
||||
this.buttonCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
||||
this.buttonCancel.LanguageKey = "CANCEL";
|
||||
this.buttonCancel.Location = new System.Drawing.Point(128, 98);
|
||||
this.buttonCancel.Name = "buttonCancel";
|
||||
this.buttonCancel.Size = new System.Drawing.Size(104, 23);
|
||||
this.buttonCancel.TabIndex = 5;
|
||||
this.buttonCancel.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// SettingsForm
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13.5F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(244, 135);
|
||||
this.Controls.Add(this.buttonCancel);
|
||||
this.Controls.Add(this.buttonOK);
|
||||
this.Controls.Add(this.label_language);
|
||||
this.Controls.Add(this.checkBox_straightenImage);
|
||||
this.Controls.Add(this.checkBox_orientImage);
|
||||
this.Controls.Add(this.comboBox_languages);
|
||||
this.LanguageKey = "settings_title";
|
||||
this.Name = "SettingsForm";
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
private GreenshotLabel label_language;
|
||||
private GreenshotButton buttonCancel;
|
||||
private GreenshotButton buttonOK;
|
||||
private GreenshotCheckBox checkBox_orientImage;
|
||||
private GreenshotCheckBox checkBox_straightenImage;
|
||||
private System.Windows.Forms.ComboBox comboBox_languages;
|
||||
}
|
||||
}
|
|
@ -1,73 +0,0 @@
|
|||
// Greenshot - a free and open source screenshot tool
|
||||
// Copyright (C) 2007-2018 Thomas Braun, Jens Klingen, Robin Krom
|
||||
//
|
||||
// For more information see: http://getgreenshot.org/
|
||||
// The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 1 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
using System;
|
||||
using Greenshot.Addon.OCR.Configuration;
|
||||
using Greenshot.Addons.Controls;
|
||||
|
||||
namespace Greenshot.Addon.OCR
|
||||
{
|
||||
/// <summary>
|
||||
/// Description of SettingsForm.
|
||||
/// </summary>
|
||||
public partial class SettingsForm : GreenshotForm
|
||||
{
|
||||
private readonly IOcrConfiguration _config;
|
||||
|
||||
public SettingsForm(string[] languages, IOcrLanguage ocrLanguage, IOcrConfiguration config) : base(ocrLanguage)
|
||||
{
|
||||
//
|
||||
// The InitializeComponent() call is required for Windows Forms designer support.
|
||||
//
|
||||
_config = config;
|
||||
InitializeComponent();
|
||||
AcceptButton = buttonOK;
|
||||
CancelButton = buttonCancel;
|
||||
|
||||
comboBox_languages.Items.Clear();
|
||||
var index = 0;
|
||||
|
||||
// Preventing Tracker #3234560, although this should not happen...
|
||||
var languageFromConfig = "ENGLISH";
|
||||
if (config.Language != null)
|
||||
{
|
||||
languageFromConfig = config.Language;
|
||||
}
|
||||
foreach (var availableLanguage in languages)
|
||||
{
|
||||
var displayLanguage = availableLanguage.Substring(0, 1).ToUpper() + availableLanguage.Substring(1).ToLower();
|
||||
comboBox_languages.Items.Add(displayLanguage);
|
||||
if (availableLanguage.Equals(languageFromConfig, StringComparison.CurrentCultureIgnoreCase))
|
||||
{
|
||||
comboBox_languages.SelectedIndex = index;
|
||||
}
|
||||
index++;
|
||||
}
|
||||
}
|
||||
|
||||
private void ButtonOkClick(object sender, EventArgs e)
|
||||
{
|
||||
var selectedString = (string) comboBox_languages.SelectedItem;
|
||||
if (selectedString != null)
|
||||
{
|
||||
_config.Language = selectedString.ToUpper();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,27 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="CommonServiceLocator" publicKeyToken="489b6accfaf20ef0" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-2.0.3.0" newVersion="2.0.3.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Autofac" publicKeyToken="17863af14b0044da" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.8.1.0" newVersion="4.8.1.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="ToastNotifications" publicKeyToken="e89d9d7314a7c797" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-2.3.4.0" newVersion="2.3.4.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.ValueTuple" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Reactive" publicKeyToken="94bc3704cddfc263" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" /></startup></configuration>
|
|
@ -1,6 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1"/>
|
||||
</startup>
|
||||
</configuration>
|
|
@ -1,619 +0,0 @@
|
|||
// Greenshot - a free and open source screenshot tool
|
||||
// Copyright (C) 2007-2018 Thomas Braun, Jens Klingen, Robin Krom
|
||||
//
|
||||
// For more information see: http://getgreenshot.org/
|
||||
// The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 1 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Runtime.Remoting;
|
||||
using System.Runtime.Remoting.Messaging;
|
||||
using System.Runtime.Remoting.Proxies;
|
||||
|
||||
namespace Greenshot.Addon.OcrCommand
|
||||
{
|
||||
/// <summary>
|
||||
/// Wraps a late-bound COM server.
|
||||
/// </summary>
|
||||
public sealed class COMWrapper : RealProxy, IDisposable, IRemotingTypeInfo
|
||||
{
|
||||
private const int MK_E_UNAVAILABLE = -2147221021;
|
||||
private const int CO_E_CLASSSTRING = -2147221005;
|
||||
|
||||
/// <summary>
|
||||
/// Implementation for the interface IRemotingTypeInfo
|
||||
/// This makes it possible to cast the COMWrapper
|
||||
/// </summary>
|
||||
/// <param name="toType">Type to cast to</param>
|
||||
/// <param name="o">object to cast</param>
|
||||
/// <returns></returns>
|
||||
public bool CanCastTo(Type toType, object o)
|
||||
{
|
||||
var returnValue = _interceptType.IsAssignableFrom(toType);
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Implementation for the interface IRemotingTypeInfo
|
||||
/// </summary>
|
||||
public string TypeName
|
||||
{
|
||||
get { throw new NotSupportedException(); }
|
||||
set { throw new NotSupportedException(); }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Intercept method calls
|
||||
/// </summary>
|
||||
/// <param name="myMessage">
|
||||
/// Contains information about the method being called
|
||||
/// </param>
|
||||
/// <returns>
|
||||
/// A <see cref="ReturnMessage" />.
|
||||
/// </returns>
|
||||
public override IMessage Invoke(IMessage myMessage)
|
||||
{
|
||||
var callMessage = myMessage as IMethodCallMessage;
|
||||
|
||||
var method = callMessage?.MethodBase as MethodInfo;
|
||||
if (method == null)
|
||||
{
|
||||
if (callMessage != null)
|
||||
{
|
||||
Debug.WriteLine($"Unrecognized Invoke call: {callMessage.MethodBase}");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
object returnValue = null;
|
||||
object[] outArgs = null;
|
||||
var outArgsCount = 0;
|
||||
|
||||
var methodName = method.Name;
|
||||
var returnType = method.ReturnType;
|
||||
var flags = BindingFlags.InvokeMethod;
|
||||
var argCount = callMessage.ArgCount;
|
||||
|
||||
ParameterModifier[] argModifiers = null;
|
||||
ParameterInfo[] parameters = null;
|
||||
|
||||
if ("Dispose" == methodName && 0 == argCount && typeof(void) == returnType)
|
||||
{
|
||||
Dispose();
|
||||
}
|
||||
else if ("ToString" == methodName && 0 == argCount && typeof(string) == returnType)
|
||||
{
|
||||
returnValue = ToString();
|
||||
}
|
||||
else if ("GetType" == methodName && 0 == argCount && typeof(Type) == returnType)
|
||||
{
|
||||
returnValue = _interceptType;
|
||||
}
|
||||
else if ("GetHashCode" == methodName && 0 == argCount && typeof(int) == returnType)
|
||||
{
|
||||
returnValue = GetHashCode();
|
||||
}
|
||||
else if ("Equals" == methodName && 1 == argCount && typeof(bool) == returnType)
|
||||
{
|
||||
returnValue = Equals(callMessage.Args[0]);
|
||||
}
|
||||
else if (1 == argCount && typeof(void) == returnType && (methodName.StartsWith("add_") || methodName.StartsWith("remove_")))
|
||||
{
|
||||
var handler = callMessage.InArgs[0] as Delegate;
|
||||
if (null == handler)
|
||||
{
|
||||
return new ReturnMessage(new ArgumentNullException(nameof(handler)), callMessage);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
var invokeObject = _comObject;
|
||||
var invokeType = _comType;
|
||||
|
||||
ParameterInfo parameter;
|
||||
object[] args;
|
||||
if (methodName.StartsWith("get_"))
|
||||
{
|
||||
// Property Get
|
||||
methodName = methodName.Substring(4);
|
||||
flags = BindingFlags.GetProperty;
|
||||
args = callMessage.InArgs;
|
||||
}
|
||||
else if (methodName.StartsWith("set_"))
|
||||
{
|
||||
// Property Set
|
||||
methodName = methodName.Substring(4);
|
||||
flags = BindingFlags.SetProperty;
|
||||
args = callMessage.InArgs;
|
||||
}
|
||||
else
|
||||
{
|
||||
args = callMessage.Args;
|
||||
if (null != args && 0 != args.Length)
|
||||
{
|
||||
// Modifiers for ref / out parameters
|
||||
argModifiers = new ParameterModifier[1];
|
||||
argModifiers[0] = new ParameterModifier(args.Length);
|
||||
|
||||
parameters = method.GetParameters();
|
||||
for (var i = 0; i < parameters.Length; i++)
|
||||
{
|
||||
parameter = parameters[i];
|
||||
if (parameter.IsOut || parameter.ParameterType.IsByRef)
|
||||
{
|
||||
argModifiers[0][i] = true;
|
||||
outArgsCount++;
|
||||
}
|
||||
}
|
||||
|
||||
if (0 == outArgsCount)
|
||||
{
|
||||
argModifiers = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Un-wrap wrapped COM objects before passing to the method
|
||||
COMWrapper[] originalArgs;
|
||||
COMWrapper wrapper;
|
||||
Type byValType;
|
||||
if (null == args || 0 == args.Length)
|
||||
{
|
||||
originalArgs = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
originalArgs = new COMWrapper[args.Length];
|
||||
for (var i = 0; i < args.Length; i++)
|
||||
{
|
||||
if (null != args[i] && RemotingServices.IsTransparentProxy(args[i]))
|
||||
{
|
||||
wrapper = RemotingServices.GetRealProxy(args[i]) as COMWrapper;
|
||||
if (null != wrapper)
|
||||
{
|
||||
originalArgs[i] = wrapper;
|
||||
args[i] = wrapper._comObject;
|
||||
}
|
||||
}
|
||||
else if (argModifiers != null && 0 != outArgsCount && argModifiers[0][i])
|
||||
{
|
||||
byValType = GetByValType(parameters[i].ParameterType);
|
||||
if (byValType.IsInterface)
|
||||
{
|
||||
// If we're passing a COM object by reference, and
|
||||
// the parameter is null, we need to pass a
|
||||
// DispatchWrapper to avoid a type mismatch exception.
|
||||
if (null == args[i])
|
||||
{
|
||||
args[i] = new DispatchWrapper(null);
|
||||
}
|
||||
}
|
||||
else if (typeof(decimal) == byValType)
|
||||
{
|
||||
// If we're passing a decimal value by reference,
|
||||
// we need to pass a CurrencyWrapper to avoid a
|
||||
// type mismatch exception.
|
||||
// http://support.microsoft.com/?kbid=837378
|
||||
args[i] = new CurrencyWrapper(args[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
returnValue = invokeType.InvokeMember(methodName, flags, null, invokeObject, args, argModifiers, null, null);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ReturnMessage(ex, callMessage);
|
||||
}
|
||||
|
||||
// Handle enum and interface return types
|
||||
if (null != returnValue)
|
||||
{
|
||||
if (returnType.IsInterface)
|
||||
{
|
||||
// Wrap the returned value in an intercepting COM wrapper
|
||||
if (Marshal.IsComObject(returnValue))
|
||||
{
|
||||
returnValue = Wrap(returnValue, returnType);
|
||||
}
|
||||
}
|
||||
else if (returnType.IsEnum)
|
||||
{
|
||||
// Convert to proper Enum type
|
||||
returnValue = Enum.Parse(returnType, returnValue.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
// Handle out args
|
||||
if (0 != outArgsCount)
|
||||
{
|
||||
if (args != null && parameters != null)
|
||||
{
|
||||
outArgs = new object[args.Length];
|
||||
for (var i = 0; i < parameters.Length; i++)
|
||||
{
|
||||
if (argModifiers != null && !argModifiers[0][i])
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
var arg = args[i];
|
||||
if (null == arg)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
parameter = parameters[i];
|
||||
wrapper = null;
|
||||
|
||||
byValType = GetByValType(parameter.ParameterType);
|
||||
if (typeof(decimal) == byValType)
|
||||
{
|
||||
if (arg is CurrencyWrapper)
|
||||
{
|
||||
arg = ((CurrencyWrapper) arg).WrappedObject;
|
||||
}
|
||||
}
|
||||
else if (byValType.IsEnum)
|
||||
{
|
||||
arg = Enum.Parse(byValType, arg.ToString());
|
||||
}
|
||||
else if (byValType.IsInterface)
|
||||
{
|
||||
if (Marshal.IsComObject(arg))
|
||||
{
|
||||
if (originalArgs != null)
|
||||
{
|
||||
wrapper = originalArgs[i];
|
||||
}
|
||||
if (null != wrapper && wrapper._comObject != arg)
|
||||
{
|
||||
wrapper.Dispose();
|
||||
wrapper = null;
|
||||
}
|
||||
|
||||
if (null == wrapper)
|
||||
{
|
||||
wrapper = new COMWrapper(arg, byValType);
|
||||
}
|
||||
arg = wrapper.GetTransparentProxy();
|
||||
}
|
||||
}
|
||||
outArgs[i] = arg;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return new ReturnMessage(returnValue, outArgs, outArgsCount, callMessage.LogicalCallContext, callMessage);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Holds reference to the actual COM object which is wrapped by this proxy
|
||||
/// </summary>
|
||||
private readonly object _comObject;
|
||||
|
||||
/// <summary>
|
||||
/// Type of the COM object, set on constructor after getting the COM reference
|
||||
/// </summary>
|
||||
private readonly Type _comType;
|
||||
|
||||
/// <summary>
|
||||
/// The type of which method calls are intercepted and executed on the COM object.
|
||||
/// </summary>
|
||||
private readonly Type _interceptType;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a COM object and returns the transparent proxy which intercepts all calls to the object
|
||||
/// </summary>
|
||||
/// <typeparam name="T">Interface which defines the method and properties to intercept</typeparam>
|
||||
/// <returns>Transparent proxy to the real proxy for the object</returns>
|
||||
/// <remarks>T must be an interface decorated with the <see cref="ComProgIdAttribute" />attribute.</remarks>
|
||||
public static T GetInstance<T>()
|
||||
{
|
||||
var type = typeof(T);
|
||||
if (null == type)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(T));
|
||||
}
|
||||
if (!type.IsInterface)
|
||||
{
|
||||
throw new ArgumentException("The specified type must be an interface.", nameof(T));
|
||||
}
|
||||
|
||||
var progIdAttribute = ComProgIdAttribute.GetAttribute(type);
|
||||
if (string.IsNullOrEmpty(progIdAttribute?.Value))
|
||||
{
|
||||
throw new ArgumentException("The specified type must define a ComProgId attribute.", nameof(T));
|
||||
}
|
||||
var progId = progIdAttribute.Value;
|
||||
|
||||
object comObject = null;
|
||||
try
|
||||
{
|
||||
comObject = Marshal.GetActiveObject(progId);
|
||||
}
|
||||
catch (COMException comE)
|
||||
{
|
||||
if (comE.ErrorCode == MK_E_UNAVAILABLE)
|
||||
{
|
||||
Debug.WriteLine($"No current instance of {progId} object available.");
|
||||
}
|
||||
else if (comE.ErrorCode == CO_E_CLASSSTRING)
|
||||
{
|
||||
Debug.WriteLine($"Unknown progId {progId}");
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Debug.WriteLine($"Error getting active object for {progId} {ex.Message}");
|
||||
}
|
||||
|
||||
if (comObject != null)
|
||||
{
|
||||
var wrapper = new COMWrapper(comObject, type);
|
||||
return (T) wrapper.GetTransparentProxy();
|
||||
}
|
||||
return default;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or creates a COM object and returns the transparent proxy which intercepts all calls to the object
|
||||
/// The ComProgId can be a normal ComProgId or a GUID prefixed with "clsid:"
|
||||
/// </summary>
|
||||
/// <typeparam name="T">Interface which defines the method and properties to intercept</typeparam>
|
||||
/// <returns>Transparent proxy to the real proxy for the object</returns>
|
||||
/// <remarks>The type must be an interface decorated with the <see cref="ComProgIdAttribute" />attribute.</remarks>
|
||||
public static T GetOrCreateInstance<T>()
|
||||
{
|
||||
var type = typeof(T);
|
||||
if (null == type)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(T));
|
||||
}
|
||||
if (!type.IsInterface)
|
||||
{
|
||||
throw new ArgumentException("The specified type must be an interface.", nameof(T));
|
||||
}
|
||||
|
||||
var progIdAttribute = ComProgIdAttribute.GetAttribute(type);
|
||||
if (string.IsNullOrEmpty(progIdAttribute?.Value))
|
||||
{
|
||||
throw new ArgumentException("The specified type must define a ComProgId attribute.", nameof(T));
|
||||
}
|
||||
|
||||
object comObject = null;
|
||||
Type comType = null;
|
||||
var progId = progIdAttribute.Value;
|
||||
|
||||
try
|
||||
{
|
||||
comObject = Marshal.GetActiveObject(progId);
|
||||
}
|
||||
catch (COMException comE)
|
||||
{
|
||||
if (comE.ErrorCode == MK_E_UNAVAILABLE)
|
||||
{
|
||||
Debug.WriteLine($"No current instance of {progId} object available.");
|
||||
}
|
||||
else if (comE.ErrorCode == CO_E_CLASSSTRING)
|
||||
{
|
||||
Debug.WriteLine($"Unknown progId {progId}");
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Debug.WriteLine($"Error getting active object for {progId} {ex.Message}");
|
||||
}
|
||||
// Did we get the current instance? If not, try to create a new
|
||||
if (comObject == null)
|
||||
{
|
||||
try
|
||||
{
|
||||
comType = Type.GetTypeFromProgID(progId, true);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
Debug.WriteLine($"Error getting type for {progId}");
|
||||
}
|
||||
if (comType != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
comObject = Activator.CreateInstance(comType);
|
||||
if (comObject != null)
|
||||
{
|
||||
Debug.WriteLine($"Created new instance of {progId} object.");
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Debug.WriteLine($"Error creating object for {progId} {ex.Message}");
|
||||
}
|
||||
}
|
||||
}
|
||||
if (comObject != null)
|
||||
{
|
||||
var wrapper = new COMWrapper(comObject, type);
|
||||
return (T) wrapper.GetTransparentProxy();
|
||||
}
|
||||
return default;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Wrap an object and return the transparent proxy which intercepts all calls to the object
|
||||
/// </summary>
|
||||
/// <param name="comObject">An object to intercept</param>
|
||||
/// <param name="type">Interface which defines the method and properties to intercept</param>
|
||||
/// <returns>Transparent proxy to the real proxy for the object</returns>
|
||||
private static object Wrap(object comObject, Type type)
|
||||
{
|
||||
if (null == comObject)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(comObject));
|
||||
}
|
||||
if (null == type)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(type));
|
||||
}
|
||||
|
||||
var wrapper = new COMWrapper(comObject, type);
|
||||
return wrapper.GetTransparentProxy();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Constructor
|
||||
/// </summary>
|
||||
/// <param name="comObject">
|
||||
/// The COM object to wrap.
|
||||
/// </param>
|
||||
/// <param name="type">
|
||||
/// The interface type to impersonate.
|
||||
/// </param>
|
||||
private COMWrapper(object comObject, Type type)
|
||||
: base(type)
|
||||
{
|
||||
_comObject = comObject;
|
||||
_comType = comObject.GetType();
|
||||
_interceptType = type;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// If dispose() is not called, we need to make
|
||||
/// sure that the COM object is still cleaned up.
|
||||
/// </summary>
|
||||
~COMWrapper()
|
||||
{
|
||||
Dispose(false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Cleans up the COM object.
|
||||
/// </summary>
|
||||
public void Dispose()
|
||||
{
|
||||
Dispose(true);
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Release the COM reference
|
||||
/// </summary>
|
||||
/// <param name="disposing">
|
||||
/// <see langword="true" /> if this was called from the
|
||||
/// <see cref="IDisposable" /> interface.
|
||||
/// </param>
|
||||
private void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && null != _comObject)
|
||||
{
|
||||
if (Marshal.IsComObject(_comObject))
|
||||
{
|
||||
try
|
||||
{
|
||||
while (Marshal.ReleaseComObject(_comObject) > 0)
|
||||
{
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Debug.WriteLine($"Problem releasing {_comType}");
|
||||
Debug.WriteLine("Error: " + ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a string representing the wrapped object.
|
||||
/// </summary>
|
||||
/// <returns>
|
||||
/// The full name of the intercepted type.
|
||||
/// </returns>
|
||||
public override string ToString()
|
||||
{
|
||||
return _interceptType.FullName;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the hash code of the wrapped object.
|
||||
/// </summary>
|
||||
/// <returns>
|
||||
/// The hash code of the wrapped object.
|
||||
/// </returns>
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return _comObject.GetHashCode();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Compares this object to another.
|
||||
/// </summary>
|
||||
/// <param name="value">
|
||||
/// The value to compare to.
|
||||
/// </param>
|
||||
/// <returns>
|
||||
/// <see langword="true" /> if the objects are equal.
|
||||
/// </returns>
|
||||
public override bool Equals(object value)
|
||||
{
|
||||
if (null != value && RemotingServices.IsTransparentProxy(value))
|
||||
{
|
||||
var wrapper = RemotingServices.GetRealProxy(value) as COMWrapper;
|
||||
if (null != wrapper)
|
||||
{
|
||||
return _comObject == wrapper._comObject;
|
||||
}
|
||||
}
|
||||
|
||||
return base.Equals(value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the base type for a reference type.
|
||||
/// </summary>
|
||||
/// <param name="byRefType">
|
||||
/// The reference type.
|
||||
/// </param>
|
||||
/// <returns>
|
||||
/// The base value type.
|
||||
/// </returns>
|
||||
/// <exception cref="ArgumentNullException">
|
||||
/// <paramref name="byRefType" /> is <see langword="null" />.
|
||||
/// </exception>
|
||||
private static Type GetByValType(Type byRefType)
|
||||
{
|
||||
if (null == byRefType)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(byRefType));
|
||||
}
|
||||
|
||||
if (byRefType.IsByRef)
|
||||
{
|
||||
var name = byRefType.FullName;
|
||||
name = name.Substring(0, name.Length - 1);
|
||||
byRefType = byRefType.Assembly.GetType(name, true);
|
||||
}
|
||||
|
||||
return byRefType;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,85 +0,0 @@
|
|||
// Greenshot - a free and open source screenshot tool
|
||||
// Copyright (C) 2007-2018 Thomas Braun, Jens Klingen, Robin Krom
|
||||
//
|
||||
// For more information see: http://getgreenshot.org/
|
||||
// The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 1 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
using System;
|
||||
|
||||
namespace Greenshot.Addon.OcrCommand
|
||||
{
|
||||
/// <summary>
|
||||
/// An attribute to specifiy the ProgID of the COM class to create. (As suggested by Kristen Wegner)
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.Interface)]
|
||||
public sealed class ComProgIdAttribute : Attribute
|
||||
{
|
||||
/// <summary>Constructor</summary>
|
||||
/// <param name="value">The COM ProgID.</param>
|
||||
public ComProgIdAttribute(string value)
|
||||
{
|
||||
Value = value;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the COM ProgID
|
||||
/// </summary>
|
||||
public string Value { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Extracts the attribute from the specified type.
|
||||
/// </summary>
|
||||
/// <param name="interfaceType">
|
||||
/// The interface type.
|
||||
/// </param>
|
||||
/// <returns>
|
||||
/// The <see cref="ComProgIdAttribute" />.
|
||||
/// </returns>
|
||||
/// <exception cref="ArgumentNullException">
|
||||
/// <paramref name="interfaceType" /> is <see langword="null" />.
|
||||
/// </exception>
|
||||
public static ComProgIdAttribute GetAttribute(Type interfaceType)
|
||||
{
|
||||
if (null == interfaceType)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(interfaceType));
|
||||
}
|
||||
|
||||
var attributeType = typeof(ComProgIdAttribute);
|
||||
var attributes = interfaceType.GetCustomAttributes(attributeType, false);
|
||||
|
||||
if (0 == attributes.Length)
|
||||
{
|
||||
var interfaces = interfaceType.GetInterfaces();
|
||||
for (var i = 0; i < interfaces.Length; i++)
|
||||
{
|
||||
interfaceType = interfaces[i];
|
||||
attributes = interfaceType.GetCustomAttributes(attributeType, false);
|
||||
if (0 != attributes.Length)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (0 == attributes.Length)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
return (ComProgIdAttribute) attributes[0];
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,25 +0,0 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<TargetFrameworks>net472</TargetFrameworks>
|
||||
<RootNamespace>Greenshot.Addon.OcrCommand</RootNamespace>
|
||||
<AssemblyName>GreenshotOCRCommand</AssemblyName>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup Condition="'$(TargetFramework)' == 'net472' ">
|
||||
<Reference Include="CustomMarshalers" />
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Windows" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="WindowsBase" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
|
@ -1,28 +0,0 @@
|
|||
// Greenshot - a free and open source screenshot tool
|
||||
// Copyright (C) 2007-2018 Thomas Braun, Jens Klingen, Robin Krom
|
||||
//
|
||||
// For more information see: http://getgreenshot.org/
|
||||
// The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 1 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
namespace Greenshot.Addon.OcrCommand.Modi
|
||||
{
|
||||
public enum CompressionLevel
|
||||
{
|
||||
miCOMP_LEVEL_LOW = 0,
|
||||
miCOMP_LEVEL_MEDIUM = 1,
|
||||
miCOMP_LEVEL_HIGH = 2
|
||||
}
|
||||
}
|
|
@ -1,29 +0,0 @@
|
|||
// Greenshot - a free and open source screenshot tool
|
||||
// Copyright (C) 2007-2018 Thomas Braun, Jens Klingen, Robin Krom
|
||||
//
|
||||
// For more information see: http://getgreenshot.org/
|
||||
// The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 1 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
namespace Greenshot.Addon.OcrCommand.Modi
|
||||
{
|
||||
public enum FileFormat
|
||||
{
|
||||
miFILE_FORMAT_DEFAULTVALUE = -1,
|
||||
miFILE_FORMAT_TIFF = 1,
|
||||
miFILE_FORMAT_TIFF_LOSSLESS = 2,
|
||||
miFILE_FORMAT_MDI = 4
|
||||
}
|
||||
}
|
|
@ -1,31 +0,0 @@
|
|||
// Greenshot - a free and open source screenshot tool
|
||||
// Copyright (C) 2007-2018 Thomas Braun, Jens Klingen, Robin Krom
|
||||
//
|
||||
// For more information see: http://getgreenshot.org/
|
||||
// The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 1 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
using System;
|
||||
|
||||
namespace Greenshot.Addon.OcrCommand.Modi
|
||||
{
|
||||
/// <summary>
|
||||
/// Base class for the common properties of the Modi interfaces
|
||||
/// </summary>
|
||||
public interface ICommon : IDisposable
|
||||
{
|
||||
IDocument Application { get; }
|
||||
}
|
||||
}
|
|
@ -1,36 +0,0 @@
|
|||
// Greenshot - a free and open source screenshot tool
|
||||
// Copyright (C) 2007-2018 Thomas Braun, Jens Klingen, Robin Krom
|
||||
//
|
||||
// For more information see: http://getgreenshot.org/
|
||||
// The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 1 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Runtime.InteropServices.CustomMarshalers;
|
||||
|
||||
namespace Greenshot.Addon.OcrCommand.Modi
|
||||
{
|
||||
[ComImport]
|
||||
[Guid("00020400-0000-0000-C000-000000000046")]
|
||||
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
|
||||
public interface IDispatch
|
||||
{
|
||||
void Reserved();
|
||||
|
||||
[PreserveSig]
|
||||
int GetTypeInfo(uint nInfo, int lcid, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(TypeToTypeInfoMarshaler))] out Type typeInfo);
|
||||
}
|
||||
}
|
|
@ -1,85 +0,0 @@
|
|||
// Greenshot - a free and open source screenshot tool
|
||||
// Copyright (C) 2007-2018 Thomas Braun, Jens Klingen, Robin Krom
|
||||
//
|
||||
// For more information see: http://getgreenshot.org/
|
||||
// The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 1 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
namespace Greenshot.Addon.OcrCommand.Modi
|
||||
{
|
||||
/// <summary>
|
||||
/// The MODI Document object represents an ordered collection of document images saved as a single file.
|
||||
/// You can use the Create method to load an existing MDI or TIF file, or to create an empty document that you can
|
||||
/// populate with images from other documents.
|
||||
/// The OCR method performs OCR on all pages in the document, and the OnOCRProgress event reports the status of the
|
||||
/// operation and allows the user to cancel it.
|
||||
/// The Dirty property lets you know whether your document has unsaved OCR results or changes.
|
||||
/// The SaveAs method allows you to specify an image file format and a compression level.
|
||||
/// You can also use the PrintOut method to print the document to a printer or a file.
|
||||
/// </summary>
|
||||
[ComProgId("MODI.Document")]
|
||||
public interface IDocument : ICommon
|
||||
{
|
||||
/// <summary>
|
||||
/// The document's collection of pages.
|
||||
/// </summary>
|
||||
IImages Images { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Occurs periodically during an optical character recognition (OCR) operation. Returns the estimated percentage of
|
||||
/// the OCR operation that is complete, and allows the user to cancel the operation.
|
||||
/// </summary>
|
||||
/// <summary>
|
||||
/// Indicates whether the active document has unsaved changes.
|
||||
/// </summary>
|
||||
bool Dirty { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Closes the document.
|
||||
/// </summary>
|
||||
/// <param name="saveCall"></param>
|
||||
void Close(bool saveCall);
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new document.
|
||||
/// </summary>
|
||||
/// <param name="file">
|
||||
/// Optional String. The path and filename of the optional document file that is to be loaded into the
|
||||
/// new document.
|
||||
/// </param>
|
||||
void Create(string file);
|
||||
|
||||
/// <summary>
|
||||
/// Performs optical character recognition (OCR) on the specified document or image.
|
||||
/// </summary>
|
||||
/// <param name="language">ModiLanguage</param>
|
||||
/// <param name="orientimage">
|
||||
/// Optional Boolean. Specifies whether the OCR engine attempts to determine the orientation of
|
||||
/// the page. Default is true.
|
||||
/// </param>
|
||||
/// <param name="straightenImage">
|
||||
/// Optional Boolean. Specifies whether the OCR engine attempts to "de-skew" the page to
|
||||
/// correct for small angles of misalignment from the vertical. Default is true.
|
||||
/// </param>
|
||||
void OCR(ModiLanguage language, bool orientimage, bool straightenImage);
|
||||
|
||||
/// <summary>
|
||||
/// </summary>
|
||||
/// <param name="filename"></param>
|
||||
/// <param name="fileFormat"></param>
|
||||
/// <param name="compressionLevel"></param>
|
||||
void SaveAs(string filename, FileFormat fileFormat, CompressionLevel compressionLevel);
|
||||
}
|
||||
}
|
|
@ -1,38 +0,0 @@
|
|||
// Greenshot - a free and open source screenshot tool
|
||||
// Copyright (C) 2007-2018 Thomas Braun, Jens Klingen, Robin Krom
|
||||
//
|
||||
// For more information see: http://getgreenshot.org/
|
||||
// The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 1 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
namespace Greenshot.Addon.OcrCommand.Modi
|
||||
{
|
||||
/// <summary>
|
||||
/// Describes the page in a scan
|
||||
/// </summary>
|
||||
public interface IImage : ICommon
|
||||
{
|
||||
ILayout Layout { get; }
|
||||
|
||||
long BitsPerPixel { get; }
|
||||
CompressionLevel Compression { get; }
|
||||
//IPictureDisp Picture { get; }
|
||||
int PixelHeight { get; }
|
||||
int PixelWidth { get; }
|
||||
//IPictureDisp Thumbnail { get; }
|
||||
int XDPI { get; }
|
||||
int YDPI { get; }
|
||||
}
|
||||
}
|
|
@ -1,39 +0,0 @@
|
|||
// Greenshot - a free and open source screenshot tool
|
||||
// Copyright (C) 2007-2018 Thomas Braun, Jens Klingen, Robin Krom
|
||||
//
|
||||
// For more information see: http://getgreenshot.org/
|
||||
// The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 1 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
using System.Collections;
|
||||
|
||||
namespace Greenshot.Addon.OcrCommand.Modi
|
||||
{
|
||||
/// <summary>
|
||||
/// Use the Images accessor property of the Document object to return an Images collection.
|
||||
/// Use the Item property of the Images collection to return an Image object and gain access to its OCR Layout
|
||||
/// (including recognized Text and Words), the properties that describe its dimensions and format (BitsPerPixel,
|
||||
/// Compression, PixelHeight, PixelWidth, XDPI, and YDPI),
|
||||
/// and its Picture and Thumbnail images.
|
||||
/// </summary>
|
||||
public interface IImages : ICommon, IEnumerable
|
||||
{
|
||||
int Count { get; }
|
||||
|
||||
IImage this[int index] { get; }
|
||||
|
||||
new IEnumerator GetEnumerator();
|
||||
}
|
||||
}
|
|
@ -1,53 +0,0 @@
|
|||
// Greenshot - a free and open source screenshot tool
|
||||
// Copyright (C) 2007-2018 Thomas Braun, Jens Klingen, Robin Krom
|
||||
//
|
||||
// For more information see: http://getgreenshot.org/
|
||||
// The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 1 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
namespace Greenshot.Addon.OcrCommand.Modi
|
||||
{
|
||||
/// <summary>
|
||||
/// Layout of the IImage
|
||||
/// </summary>
|
||||
public interface ILayout : ICommon
|
||||
{
|
||||
/// <summary>
|
||||
/// Returns the recognized text as a Unicode string.
|
||||
/// </summary>
|
||||
string Text { get; }
|
||||
|
||||
/// <summary>
|
||||
/// An accessor property that returns the Words collection recognized in the text during an optical character
|
||||
/// recognition (OCR) operation.
|
||||
/// </summary>
|
||||
IWords Words { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Returns the number of characters in the recognized text.
|
||||
/// </summary>
|
||||
int NumChars { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Returns the number of words in the recognized text.
|
||||
/// </summary>
|
||||
int NumWords { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Returns the language identifier for the recognized text. Read-only Long.
|
||||
/// </summary>
|
||||
ModiLanguage Language { get; }
|
||||
}
|
||||
}
|
|
@ -1,47 +0,0 @@
|
|||
// Greenshot - a free and open source screenshot tool
|
||||
// Copyright (C) 2007-2018 Thomas Braun, Jens Klingen, Robin Krom
|
||||
//
|
||||
// For more information see: http://getgreenshot.org/
|
||||
// The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 1 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
namespace Greenshot.Addon.OcrCommand.Modi
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a bounding rectangle in the optical character recognition (OCR) layout.
|
||||
/// </summary>
|
||||
public interface IMiRect : ICommon
|
||||
{
|
||||
/// <summary>
|
||||
/// The Bottom property represent the distance in pixels from the top edge of the containing image.
|
||||
/// </summary>
|
||||
int Bottom { get; }
|
||||
|
||||
/// <summary>
|
||||
/// The Left property represent the distance in pixels from the left edge of the containing image.
|
||||
/// </summary>
|
||||
int Left { get; }
|
||||
|
||||
/// <summary>
|
||||
/// The Right property represent the distance in pixels from the left edge of the containing image.
|
||||
/// </summary>
|
||||
int Right { get; }
|
||||
|
||||
/// <summary>
|
||||
/// The Top property represent the distance in pixels from the top edge of the containing image.
|
||||
/// </summary>
|
||||
int Top { get; }
|
||||
}
|
||||
}
|
|
@ -1,36 +0,0 @@
|
|||
// Greenshot - a free and open source screenshot tool
|
||||
// Copyright (C) 2007-2018 Thomas Braun, Jens Klingen, Robin Krom
|
||||
//
|
||||
// For more information see: http://getgreenshot.org/
|
||||
// The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 1 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
using System.Collections;
|
||||
|
||||
namespace Greenshot.Addon.OcrCommand.Modi
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents the collection of bounding rectangles in the optical character recognition (OCR) layout. A collection of
|
||||
/// MiRect objects.
|
||||
/// </summary>
|
||||
public interface IMiRects : ICommon, IEnumerable
|
||||
{
|
||||
int Count { get; }
|
||||
|
||||
IMiRect this[int index] { get; }
|
||||
|
||||
new IEnumerator GetEnumerator();
|
||||
}
|
||||
}
|
|
@ -1,64 +0,0 @@
|
|||
// Greenshot - a free and open source screenshot tool
|
||||
// Copyright (C) 2007-2018 Thomas Braun, Jens Klingen, Robin Krom
|
||||
//
|
||||
// For more information see: http://getgreenshot.org/
|
||||
// The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 1 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
namespace Greenshot.Addon.OcrCommand.Modi
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a word recognized in the text during an optical character recognition (OCR) operation.
|
||||
/// </summary>
|
||||
public interface IWord : ICommon
|
||||
{
|
||||
/// <summary>
|
||||
/// Returns the index of the specified word in the Words collection of the Layout or IMiSelectableItem object.
|
||||
/// </summary>
|
||||
long Id { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Returns the number of the region in the optical character recognition (OCR) layout where the word occurs.
|
||||
/// </summary>
|
||||
long RegionId { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Returns the number of the line in the optical character recognition (OCR) layout where the word occurs.
|
||||
/// </summary>
|
||||
long LineId { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Returns the recognized text as a Unicode string.
|
||||
/// </summary>
|
||||
string Text { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Returns the relative confidence factor reported by the optical character recognition (OCR) engine (on a scale of 0
|
||||
/// to 999) after recognizing the specified word.
|
||||
/// </summary>
|
||||
short RecognitionConfidence { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Returns the index of the font used by the specified wordthis is the font that was recognized in the text during an
|
||||
/// optical character recognition (OCR) operation.
|
||||
/// </summary>
|
||||
long FontId { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Rectangles
|
||||
/// </summary>
|
||||
IMiRects Rects { get; }
|
||||
}
|
||||
}
|
|
@ -1,35 +0,0 @@
|
|||
// Greenshot - a free and open source screenshot tool
|
||||
// Copyright (C) 2007-2018 Thomas Braun, Jens Klingen, Robin Krom
|
||||
//
|
||||
// For more information see: http://getgreenshot.org/
|
||||
// The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 1 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
using System.Collections;
|
||||
|
||||
namespace Greenshot.Addon.OcrCommand.Modi
|
||||
{
|
||||
/// <summary>
|
||||
/// The Words collection recognized in the text during an optical character recognition (OCR) operation.
|
||||
/// </summary>
|
||||
public interface IWords : ICommon, IEnumerable
|
||||
{
|
||||
int Count { get; }
|
||||
|
||||
IWord this[int index] { get; }
|
||||
|
||||
new IEnumerator GetEnumerator();
|
||||
}
|
||||
}
|
|
@ -1,47 +0,0 @@
|
|||
// Greenshot - a free and open source screenshot tool
|
||||
// Copyright (C) 2007-2018 Thomas Braun, Jens Klingen, Robin Krom
|
||||
//
|
||||
// For more information see: http://getgreenshot.org/
|
||||
// The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 1 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
namespace Greenshot.Addon.OcrCommand.Modi
|
||||
{
|
||||
public enum ModiLanguage
|
||||
{
|
||||
CHINESE_SIMPLIFIED = 2052,
|
||||
CHINESE_TRADITIONAL = 1028,
|
||||
CZECH = 5,
|
||||
DANISH = 6,
|
||||
DUTCH = 19,
|
||||
ENGLISH = 9,
|
||||
FINNISH = 11,
|
||||
FRENCH = 12,
|
||||
GERMAN = 7,
|
||||
GREEK = 8,
|
||||
HUNGARIAN = 14,
|
||||
ITALIAN = 16,
|
||||
JAPANESE = 17,
|
||||
KOREAN = 18,
|
||||
NORWEGIAN = 20,
|
||||
POLISH = 21,
|
||||
PORTUGUESE = 22,
|
||||
RUSSIAN = 25,
|
||||
SPANISH = 10,
|
||||
SWEDISH = 29,
|
||||
TURKISH = 31,
|
||||
SYSDEFAULT = 2048
|
||||
}
|
||||
}
|
|
@ -1,138 +0,0 @@
|
|||
// Greenshot - a free and open source screenshot tool
|
||||
// Copyright (C) 2007-2018 Thomas Braun, Jens Klingen, Robin Krom
|
||||
//
|
||||
// For more information see: http://getgreenshot.org/
|
||||
// The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 1 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using Greenshot.Addon.OcrCommand.Modi;
|
||||
#if DEBUG
|
||||
using System.Diagnostics;
|
||||
#endif
|
||||
|
||||
namespace Greenshot.Addon.OcrCommand
|
||||
{
|
||||
public static class Program
|
||||
{
|
||||
private const string Usage = "<-c> | <path to image.bmp> [language] [orientimage] [straightenImage]";
|
||||
|
||||
public static int Main(string[] args)
|
||||
{
|
||||
if (args.Length == 0)
|
||||
{
|
||||
Console.WriteLine(Usage);
|
||||
return -1;
|
||||
}
|
||||
var filename = args[0];
|
||||
var language = ModiLanguage.ENGLISH;
|
||||
if (args.Length >= 2)
|
||||
{
|
||||
language = (ModiLanguage) Enum.Parse(typeof(ModiLanguage), args[1]);
|
||||
}
|
||||
var orientimage = true;
|
||||
if (args.Length >= 3)
|
||||
{
|
||||
orientimage = bool.Parse(args[2]);
|
||||
}
|
||||
var straightenImage = true;
|
||||
if (args.Length >= 4)
|
||||
{
|
||||
straightenImage = bool.Parse(args[3]);
|
||||
}
|
||||
try
|
||||
{
|
||||
if (File.Exists(filename) || "-c".Equals(filename))
|
||||
{
|
||||
using (var document = COMWrapper.GetOrCreateInstance<IDocument>())
|
||||
{
|
||||
if (document == null)
|
||||
{
|
||||
Console.WriteLine("MODI not installed");
|
||||
return -2;
|
||||
}
|
||||
if ("-c".Equals(filename))
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
document.Create(filename);
|
||||
document.OCR(language, orientimage, straightenImage);
|
||||
var modiImage = document.Images[0];
|
||||
var layout = modiImage.Layout;
|
||||
if (layout != null)
|
||||
{
|
||||
#if DEBUG
|
||||
if (layout.Words != null)
|
||||
{
|
||||
foreach (var word in ToEnumerable(layout.Words))
|
||||
{
|
||||
if (word.Rects == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
foreach (var rect in ToEnumerable(word.Rects))
|
||||
{
|
||||
Debug.WriteLine($"Rect {rect.Left},{rect.Top},{rect.Right},{rect.Bottom} - Word {word.Text} : Confidence: {word.RecognitionConfidence}");
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
if (layout.Text != null)
|
||||
{
|
||||
// For for BUG-1884:
|
||||
// Although trim is done in the OCR Plugin, it does make sense in the command too.
|
||||
Console.WriteLine(layout.Text.Trim());
|
||||
}
|
||||
}
|
||||
document.Close(false);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine(ex.Message);
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Helper method
|
||||
/// </summary>
|
||||
/// <returns>IEnumerable of IMiRect</returns>
|
||||
private static IEnumerable<IMiRect> ToEnumerable(IMiRects rects)
|
||||
{
|
||||
for (var i = 0; i < rects.Count; i++)
|
||||
{
|
||||
yield return rects[i];
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Helper method
|
||||
/// </summary>
|
||||
/// <returns>IEnumerable of IWord</returns>
|
||||
private static IEnumerable<IWord> ToEnumerable(IWords words)
|
||||
{
|
||||
for (var i = 0; i < words.Count; i++)
|
||||
{
|
||||
yield return words[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,9 +1,9 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
|
||||
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
|
||||
|
||||
<PropertyGroup>
|
||||
<RootNamespace>Greenshot.Addon.Office</RootNamespace>
|
||||
<AssemblyName>Greenshot.Addon.Office</AssemblyName>
|
||||
<TargetFrameworks>net472;netcoreapp3.0</TargetFrameworks>
|
||||
<TargetFramework>netcoreapp3.0</TargetFramework><!-- net472;netcoreapp3.0 -->
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
|
||||
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
|
||||
|
||||
<PropertyGroup>
|
||||
<RootNamespace>Greenshot.Addon.OneDrive</RootNamespace>
|
||||
<AssemblyName>Greenshot.Addon.OneDrive</AssemblyName>
|
||||
<TargetFrameworks>net472;netcoreapp3.0</TargetFrameworks>
|
||||
<TargetFramework>netcoreapp3.0</TargetFramework><!-- net472;netcoreapp3.0 -->
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
|
||||
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
|
||||
|
||||
<PropertyGroup>
|
||||
<RootNamespace>Greenshot.Addon.Photobucket</RootNamespace>
|
||||
<AssemblyName>Greenshot.Addon.Photobucket</AssemblyName>
|
||||
<TargetFrameworks>net472;netcoreapp3.0</TargetFrameworks>
|
||||
<TargetFramework>netcoreapp3.0</TargetFramework><!-- net472;netcoreapp3.0 -->
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
|
||||
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
|
||||
|
||||
<PropertyGroup>
|
||||
<RootNamespace>Greenshot.Addon.Tfs</RootNamespace>
|
||||
<AssemblyName>Greenshot.Addon.Tfs</AssemblyName>
|
||||
<TargetFrameworks>net472;netcoreapp3.0</TargetFrameworks>
|
||||
<TargetFramework>netcoreapp3.0</TargetFramework><!-- net472;netcoreapp3.0 -->
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
|
||||
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
|
||||
|
||||
<PropertyGroup>
|
||||
<RootNamespace>Greenshot.Addon.Win10</RootNamespace>
|
||||
<AssemblyName>Greenshot.Addon.Win10</AssemblyName>
|
||||
<TargetFrameworks>net472;netcoreapp3.0</TargetFrameworks>
|
||||
<TargetFramework>netcoreapp3.0</TargetFramework><!-- net472;netcoreapp3.0 -->
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
|
||||
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>net472;netcoreapp3.0</TargetFrameworks>
|
||||
<TargetFramework>netcoreapp3.0</TargetFramework><!-- net472;netcoreapp3.0 -->
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
</PropertyGroup>
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
|
||||
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>net472;netcoreapp3.0</TargetFrameworks>
|
||||
<TargetFramework>netcoreapp3.0</TargetFramework><!-- net472;netcoreapp3.0 -->
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
</PropertyGroup>
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
|
||||
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>net472;netcoreapp3.0</TargetFrameworks>
|
||||
<TargetFramework>netcoreapp3.0</TargetFramework><!-- net472;netcoreapp3.0 -->
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<LangVersion>8</LangVersion>
|
||||
</PropertyGroup>
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
|
||||
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
|
||||
|
||||
<PropertyGroup>
|
||||
<RootNamespace>Greenshot.PerformanceTests</RootNamespace>
|
||||
<AssemblyName>Greenshot.PerformanceTests</AssemblyName>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFrameworks>net472;netcoreapp3.0</TargetFrameworks>
|
||||
<TargetFramework>netcoreapp3.0</TargetFramework><!-- net472;netcoreapp3.0 -->
|
||||
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
|
||||
</PropertyGroup>
|
||||
|
||||
|
@ -63,7 +63,7 @@
|
|||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="BenchmarkDotNet" Version="0.11.4" />
|
||||
<PackageReference Include="BenchmarkDotNet" Version="0.11.5" />
|
||||
<PackageReference Include="CommandLineParser" Version="2.4.3" />
|
||||
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers">
|
||||
<Version>2.6.3</Version>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
|
||||
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>net472;netcoreapp3.0</TargetFrameworks>
|
||||
<TargetFramework>netcoreapp3.0</TargetFramework><!-- net472;netcoreapp3.0 -->
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
</PropertyGroup>
|
||||
|
||||
|
@ -67,7 +67,7 @@
|
|||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="BenchmarkDotNet" Version="0.11.4" />
|
||||
<PackageReference Include="BenchmarkDotNet" Version="0.11.5" />
|
||||
<PackageReference Include="CommandLineParser" Version="2.4.3" />
|
||||
<PackageReference Include="Dapplo.CaliburnMicro.Translations" Version="1.2.21" />
|
||||
<PackageReference Include="Dapplo.HttpExtensions.OAuth" Version="0.9.18" />
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 15
|
||||
VisualStudioVersion = 15.0.28307.421
|
||||
# Visual Studio Version 16
|
||||
VisualStudioVersion = 16.0.28729.10
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Greenshot", "Greenshot\Greenshot.csproj", "{CD642BF4-D815-4D67-A0B5-C69F0B8231AF}"
|
||||
EndProject
|
||||
|
@ -15,8 +15,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Greenshot.Addon.Imgur", "Gr
|
|||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Greenshot.Addon.Jira", "Greenshot.Addon.Jira\Greenshot.Addon.Jira.csproj", "{19FEEF09-313F-43C7-819D-F1BCA782B08B}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Greenshot.Addon.OCR", "Greenshot.Addon.OCR\Greenshot.Addon.OCR.csproj", "{C6988EE8-2FEE-4349-9F09-F9628A0D8965}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Greenshot.Addon.Box", "Greenshot.Addon.Box\Greenshot.Addon.Box.csproj", "{697CF066-9077-4F22-99D9-D989CCE7282B}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Greenshot.Addon.Dropbox", "Greenshot.Addon.Dropbox\Greenshot.Addon.Dropbox.csproj", "{AD7CFFE2-40E7-46CF-A172-D48CF7AE9A12}"
|
||||
|
@ -45,8 +43,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Greenshot.Addon.OneDrive",
|
|||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Greenshot.Addon.Tfs", "Greenshot.Addon.Tfs\Greenshot.Addon.Tfs.csproj", "{8B3643A5-AFED-49FF-8D66-6348FB102EB2}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Greenshot.Addon.OcrCommand", "Greenshot.Addon.OcrCommand\Greenshot.Addon.OcrCommand.csproj", "{7B8E9055-A054-4290-B537-075EBFDF8BDF}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Greenshot.Core", "Greenshot.Core\Greenshot.Core.csproj", "{BF35190D-B2A7-4CFA-B397-51CB384CF0D7}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Greenshot.Addon.InternetExplorer", "Greenshot.Addon.InternetExplorer\Greenshot.Addon.InternetExplorer.csproj", "{4CCA2717-B8A4-44F7-965B-5687107E4921}"
|
||||
|
@ -107,14 +103,6 @@ Global
|
|||
{19FEEF09-313F-43C7-819D-F1BCA782B08B}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{19FEEF09-313F-43C7-819D-F1BCA782B08B}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{19FEEF09-313F-43C7-819D-F1BCA782B08B}.Release|x86.Build.0 = Release|Any CPU
|
||||
{C6988EE8-2FEE-4349-9F09-F9628A0D8965}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{C6988EE8-2FEE-4349-9F09-F9628A0D8965}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{C6988EE8-2FEE-4349-9F09-F9628A0D8965}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{C6988EE8-2FEE-4349-9F09-F9628A0D8965}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{C6988EE8-2FEE-4349-9F09-F9628A0D8965}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{C6988EE8-2FEE-4349-9F09-F9628A0D8965}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{C6988EE8-2FEE-4349-9F09-F9628A0D8965}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{C6988EE8-2FEE-4349-9F09-F9628A0D8965}.Release|x86.Build.0 = Release|Any CPU
|
||||
{697CF066-9077-4F22-99D9-D989CCE7282B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{697CF066-9077-4F22-99D9-D989CCE7282B}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{697CF066-9077-4F22-99D9-D989CCE7282B}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
|
@ -227,14 +215,6 @@ Global
|
|||
{8B3643A5-AFED-49FF-8D66-6348FB102EB2}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{8B3643A5-AFED-49FF-8D66-6348FB102EB2}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{8B3643A5-AFED-49FF-8D66-6348FB102EB2}.Release|x86.Build.0 = Release|Any CPU
|
||||
{7B8E9055-A054-4290-B537-075EBFDF8BDF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{7B8E9055-A054-4290-B537-075EBFDF8BDF}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{7B8E9055-A054-4290-B537-075EBFDF8BDF}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{7B8E9055-A054-4290-B537-075EBFDF8BDF}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{7B8E9055-A054-4290-B537-075EBFDF8BDF}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{7B8E9055-A054-4290-B537-075EBFDF8BDF}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{7B8E9055-A054-4290-B537-075EBFDF8BDF}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{7B8E9055-A054-4290-B537-075EBFDF8BDF}.Release|x86.Build.0 = Release|Any CPU
|
||||
{BF35190D-B2A7-4CFA-B397-51CB384CF0D7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{BF35190D-B2A7-4CFA-B397-51CB384CF0D7}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{BF35190D-B2A7-4CFA-B397-51CB384CF0D7}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
<PropertyGroup>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<TargetFrameworks>net472;netcoreapp3.0</TargetFrameworks>
|
||||
<TargetFramework>netcoreapp3.0</TargetFramework><!-- net472;netcoreapp3.0 -->
|
||||
<LangVersion>latest</LangVersion>
|
||||
<ApplicationIcon>icons\applicationIcon\icon.ico</ApplicationIcon>
|
||||
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue