Renamed the GreenshotPlugin to Greenshot.Base

This commit is contained in:
Robin Krom 2021-03-28 21:01:29 +02:00
parent e8c0b307ee
commit 79cdca03eb
No known key found for this signature in database
GPG key ID: BCC01364F1371490
423 changed files with 30044 additions and 30000 deletions

View file

@ -20,7 +20,7 @@
[Files] [Files]
Source: {#ReleaseDir}\Greenshot.exe; DestDir: {app}; Components: greenshot; Flags: overwritereadonly ignoreversion replacesameversion Source: {#ReleaseDir}\Greenshot.exe; DestDir: {app}; Components: greenshot; Flags: overwritereadonly ignoreversion replacesameversion
Source: {#ReleaseDir}\GreenshotPlugin.dll; DestDir: {app}; Components: greenshot; Flags: overwritereadonly ignoreversion replacesameversion Source: {#ReleaseDir}\Greenshot.Base.dll; DestDir: {app}; Components: greenshot; Flags: overwritereadonly ignoreversion replacesameversion
Source: {#ReleaseDir}\Greenshot.exe.config; DestDir: {app}; Components: greenshot; Flags: overwritereadonly ignoreversion replacesameversion Source: {#ReleaseDir}\Greenshot.exe.config; DestDir: {app}; Components: greenshot; Flags: overwritereadonly ignoreversion replacesameversion
Source: {#ReleaseDir}\log4net.dll; DestDir: {app}; Components: greenshot; Flags: overwritereadonly ignoreversion replacesameversion Source: {#ReleaseDir}\log4net.dll; DestDir: {app}; Components: greenshot; Flags: overwritereadonly ignoreversion replacesameversion
Source: {#ReleaseDir}\Dapplo.Http*.dll; DestDir: {app}; Components: greenshot; Flags: overwritereadonly ignoreversion replacesameversion Source: {#ReleaseDir}\Dapplo.Http*.dll; DestDir: {app}; Components: greenshot; Flags: overwritereadonly ignoreversion replacesameversion

View file

@ -1,140 +1,140 @@
/* /*
* Greenshot - a free and open source screenshot tool * Greenshot - a free and open source screenshot tool
* Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom
* *
* For more information see: http://getgreenshot.org/ * For more information see: http://getgreenshot.org/
* The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 1 of the License, or * the Free Software Foundation, either version 1 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
using System; using System;
using System.Windows.Forms; using System.Windows.Forms;
using GreenshotPlugin.UnmanagedHelpers; using Greenshot.Base.UnmanagedHelpers;
using GreenshotPlugin.UnmanagedHelpers.Enums; using Greenshot.Base.UnmanagedHelpers.Enums;
using log4net; using log4net;
namespace GreenshotPlugin.Controls namespace Greenshot.Base.Controls
{ {
/// <summary> /// <summary>
/// Extend this Form to have the possibility for animations on your form /// Extend this Form to have the possibility for animations on your form
/// </summary> /// </summary>
public class AnimatingForm : GreenshotForm public class AnimatingForm : GreenshotForm
{ {
private static readonly ILog Log = LogManager.GetLogger(typeof(AnimatingForm)); private static readonly ILog Log = LogManager.GetLogger(typeof(AnimatingForm));
private const int DEFAULT_VREFRESH = 60; private const int DEFAULT_VREFRESH = 60;
private int _vRefresh; private int _vRefresh;
private Timer _timer; private Timer _timer;
/// <summary> /// <summary>
/// This flag specifies if any animation is used /// This flag specifies if any animation is used
/// </summary> /// </summary>
protected bool EnableAnimation { get; set; } protected bool EnableAnimation { get; set; }
/// <summary> /// <summary>
/// Vertical Refresh Rate /// Vertical Refresh Rate
/// </summary> /// </summary>
protected int VRefresh protected int VRefresh
{ {
get get
{ {
if (_vRefresh == 0) if (_vRefresh == 0)
{ {
// get te hDC of the desktop to get the VREFRESH // get te hDC of the desktop to get the VREFRESH
using SafeWindowDcHandle desktopHandle = SafeWindowDcHandle.FromDesktop(); using SafeWindowDcHandle desktopHandle = SafeWindowDcHandle.FromDesktop();
_vRefresh = GDI32.GetDeviceCaps(desktopHandle, DeviceCaps.VREFRESH); _vRefresh = GDI32.GetDeviceCaps(desktopHandle, DeviceCaps.VREFRESH);
} }
// A vertical refresh rate value of 0 or 1 represents the display hardware's default refresh rate. // A vertical refresh rate value of 0 or 1 represents the display hardware's default refresh rate.
// As there is currently no know way to get the default, we guess it. // As there is currently no know way to get the default, we guess it.
if (_vRefresh <= 1) if (_vRefresh <= 1)
{ {
_vRefresh = DEFAULT_VREFRESH; _vRefresh = DEFAULT_VREFRESH;
} }
return _vRefresh; return _vRefresh;
} }
} }
/// <summary> /// <summary>
/// Check if we are in a Terminal Server session OR need to optimize for RDP / remote desktop connections /// Check if we are in a Terminal Server session OR need to optimize for RDP / remote desktop connections
/// </summary> /// </summary>
protected bool IsTerminalServerSession => !coreConfiguration.DisableRDPOptimizing && (coreConfiguration.OptimizeForRDP || SystemInformation.TerminalServerSession); protected bool IsTerminalServerSession => !coreConfiguration.DisableRDPOptimizing && (coreConfiguration.OptimizeForRDP || SystemInformation.TerminalServerSession);
/// <summary> /// <summary>
/// Calculate the amount of frames that an animation takes /// Calculate the amount of frames that an animation takes
/// </summary> /// </summary>
/// <param name="milliseconds"></param> /// <param name="milliseconds"></param>
/// <returns>Number of frames, 1 if in Terminal Server Session</returns> /// <returns>Number of frames, 1 if in Terminal Server Session</returns>
protected int FramesForMillis(int milliseconds) protected int FramesForMillis(int milliseconds)
{ {
// If we are in a Terminal Server Session we return 1 // If we are in a Terminal Server Session we return 1
if (IsTerminalServerSession) if (IsTerminalServerSession)
{ {
return 1; return 1;
} }
return milliseconds / VRefresh; return milliseconds / VRefresh;
} }
/// <summary> /// <summary>
/// Initialize the animation /// Initialize the animation
/// </summary> /// </summary>
protected AnimatingForm() protected AnimatingForm()
{ {
Load += delegate Load += delegate
{ {
if (!EnableAnimation) if (!EnableAnimation)
{ {
return; return;
} }
_timer = new Timer _timer = new Timer
{ {
Interval = 1000 / VRefresh Interval = 1000 / VRefresh
}; };
_timer.Tick += timer_Tick; _timer.Tick += timer_Tick;
_timer.Start(); _timer.Start();
}; };
// Unregister at close // Unregister at close
FormClosing += delegate { _timer?.Stop(); }; FormClosing += delegate { _timer?.Stop(); };
} }
/// <summary> /// <summary>
/// The tick handler initiates the animation. /// The tick handler initiates the animation.
/// </summary> /// </summary>
/// <param name="sender"></param> /// <param name="sender"></param>
/// <param name="e"></param> /// <param name="e"></param>
private void timer_Tick(object sender, EventArgs e) private void timer_Tick(object sender, EventArgs e)
{ {
try try
{ {
Animate(); Animate();
} }
catch (Exception ex) catch (Exception ex)
{ {
Log.Warn("An exception occured while animating:", ex); Log.Warn("An exception occured while animating:", ex);
} }
} }
/// <summary> /// <summary>
/// This method will be called every frame, so implement your animation/redraw logic here. /// This method will be called every frame, so implement your animation/redraw logic here.
/// </summary> /// </summary>
protected virtual void Animate() protected virtual void Animate()
{ {
throw new NotImplementedException(); throw new NotImplementedException();
} }
} }
} }

View file

@ -1,96 +1,96 @@
/* /*
* Greenshot - a free and open source screenshot tool * Greenshot - a free and open source screenshot tool
* Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom
* *
* For more information see: http://getgreenshot.org/ * For more information see: http://getgreenshot.org/
* The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 1 of the License, or * the Free Software Foundation, either version 1 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
namespace GreenshotPlugin.Controls namespace Greenshot.Base.Controls
{ {
partial class BackgroundForm partial class BackgroundForm
{ {
/// <summary> /// <summary>
/// Designer variable used to keep track of non-visual components. /// Designer variable used to keep track of non-visual components.
/// </summary> /// </summary>
private System.ComponentModel.IContainer components = null; private System.ComponentModel.IContainer components = null;
/// <summary> /// <summary>
/// Disposes resources used by the form. /// Disposes resources used by the form.
/// </summary> /// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing) protected override void Dispose(bool disposing)
{ {
if (disposing) { if (disposing) {
if (components != null) { if (components != null) {
components.Dispose(); components.Dispose();
} }
} }
base.Dispose(disposing); base.Dispose(disposing);
} }
/// <summary> /// <summary>
/// This method is required for Windows Forms designer support. /// This method is required for Windows Forms designer support.
/// Do not change the method contents inside the source code editor. The Forms designer might /// 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. /// not be able to load this method if it was changed manually.
/// </summary> /// </summary>
private void InitializeComponent() private void InitializeComponent()
{ {
this.components = new System.ComponentModel.Container(); this.components = new System.ComponentModel.Container();
this.label_pleasewait = new System.Windows.Forms.Label(); this.label_pleasewait = new System.Windows.Forms.Label();
this.timer_checkforclose = new System.Windows.Forms.Timer(this.components); this.timer_checkforclose = new System.Windows.Forms.Timer(this.components);
this.SuspendLayout(); this.SuspendLayout();
// //
// label_pleasewait // label_pleasewait
// //
this.label_pleasewait.Dock = System.Windows.Forms.DockStyle.Fill; this.label_pleasewait.Dock = System.Windows.Forms.DockStyle.Fill;
this.label_pleasewait.Location = new System.Drawing.Point(0, 0); this.label_pleasewait.Location = new System.Drawing.Point(0, 0);
this.label_pleasewait.Name = "label_pleasewait"; this.label_pleasewait.Name = "label_pleasewait";
this.label_pleasewait.Padding = new System.Windows.Forms.Padding(10); this.label_pleasewait.Padding = new System.Windows.Forms.Padding(10);
this.label_pleasewait.Size = new System.Drawing.Size(90, 33); this.label_pleasewait.Size = new System.Drawing.Size(90, 33);
this.label_pleasewait.TabIndex = 0; this.label_pleasewait.TabIndex = 0;
this.label_pleasewait.Text = "Please wait..."; this.label_pleasewait.Text = "Please wait...";
this.label_pleasewait.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; this.label_pleasewait.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.label_pleasewait.UseWaitCursor = true; this.label_pleasewait.UseWaitCursor = true;
// //
// timer_checkforclose // timer_checkforclose
// //
this.timer_checkforclose.Interval = 200; this.timer_checkforclose.Interval = 200;
this.timer_checkforclose.Tick += new System.EventHandler(this.Timer_checkforcloseTick); this.timer_checkforclose.Tick += new System.EventHandler(this.Timer_checkforcloseTick);
// //
// BackgroundForm // BackgroundForm
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.ClientSize = new System.Drawing.Size(169, 52); this.ClientSize = new System.Drawing.Size(169, 52);
this.ControlBox = true; this.ControlBox = true;
this.Controls.Add(this.label_pleasewait); this.Controls.Add(this.label_pleasewait);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.MaximizeBox = false; this.MaximizeBox = false;
this.MinimizeBox = false; this.MinimizeBox = false;
this.Name = "BackgroundForm"; this.Name = "BackgroundForm";
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Greenshot"; this.Text = "Greenshot";
this.TopMost = true; this.TopMost = true;
this.UseWaitCursor = true; this.UseWaitCursor = true;
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.BackgroundFormFormClosing); this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.BackgroundFormFormClosing);
this.ResumeLayout(false); this.ResumeLayout(false);
this.PerformLayout(); this.PerformLayout();
} }
private System.Windows.Forms.Timer timer_checkforclose; private System.Windows.Forms.Timer timer_checkforclose;
private System.Windows.Forms.Label label_pleasewait; private System.Windows.Forms.Label label_pleasewait;
} }
} }

View file

@ -1,99 +1,99 @@
/* /*
* Greenshot - a free and open source screenshot tool * Greenshot - a free and open source screenshot tool
* Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom
* *
* For more information see: http://getgreenshot.org/ * For more information see: http://getgreenshot.org/
* The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 1 of the License, or * the Free Software Foundation, either version 1 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
using System; using System;
using System.Drawing; using System.Drawing;
using System.Windows.Forms; using System.Windows.Forms;
using GreenshotPlugin.Core; using Greenshot.Base.Core;
namespace GreenshotPlugin.Controls namespace Greenshot.Base.Controls
{ {
/// <summary> /// <summary>
/// Description of PleaseWaitForm. /// Description of PleaseWaitForm.
/// </summary> /// </summary>
public sealed partial class BackgroundForm : Form public sealed partial class BackgroundForm : Form
{ {
private volatile bool _shouldClose; private volatile bool _shouldClose;
public BackgroundForm(string title, string text) public BackgroundForm(string title, string text)
{ {
// //
// The InitializeComponent() call is required for Windows Forms designer support. // The InitializeComponent() call is required for Windows Forms designer support.
// //
InitializeComponent(); InitializeComponent();
Icon = GreenshotResources.GetGreenshotIcon(); Icon = GreenshotResources.GetGreenshotIcon();
_shouldClose = false; _shouldClose = false;
Text = title; Text = title;
label_pleasewait.Text = text; label_pleasewait.Text = text;
FormClosing += PreventFormClose; FormClosing += PreventFormClose;
timer_checkforclose.Start(); timer_checkforclose.Start();
} }
// Can be used instead of ShowDialog // Can be used instead of ShowDialog
public new void Show() public new void Show()
{ {
base.Show(); base.Show();
bool positioned = false; bool positioned = false;
foreach (Screen screen in Screen.AllScreens) foreach (Screen screen in Screen.AllScreens)
{ {
if (screen.Bounds.Contains(Cursor.Position)) if (screen.Bounds.Contains(Cursor.Position))
{ {
positioned = true; positioned = true;
Location = new Point(screen.Bounds.X + (screen.Bounds.Width / 2) - (Width / 2), screen.Bounds.Y + (screen.Bounds.Height / 2) - (Height / 2)); Location = new Point(screen.Bounds.X + (screen.Bounds.Width / 2) - (Width / 2), screen.Bounds.Y + (screen.Bounds.Height / 2) - (Height / 2));
break; break;
} }
} }
if (!positioned) if (!positioned)
{ {
Location = new Point(Cursor.Position.X - Width / 2, Cursor.Position.Y - Height / 2); Location = new Point(Cursor.Position.X - Width / 2, Cursor.Position.Y - Height / 2);
} }
} }
private void PreventFormClose(object sender, FormClosingEventArgs e) private void PreventFormClose(object sender, FormClosingEventArgs e)
{ {
if (!_shouldClose) if (!_shouldClose)
{ {
e.Cancel = true; e.Cancel = true;
} }
} }
private void Timer_checkforcloseTick(object sender, EventArgs e) private void Timer_checkforcloseTick(object sender, EventArgs e)
{ {
if (_shouldClose) if (_shouldClose)
{ {
timer_checkforclose.Stop(); timer_checkforclose.Stop();
BeginInvoke(new EventHandler(delegate { Close(); })); BeginInvoke(new EventHandler(delegate { Close(); }));
} }
} }
public void CloseDialog() public void CloseDialog()
{ {
_shouldClose = true; _shouldClose = true;
Application.DoEvents(); Application.DoEvents();
} }
private void BackgroundFormFormClosing(object sender, FormClosingEventArgs e) private void BackgroundFormFormClosing(object sender, FormClosingEventArgs e)
{ {
timer_checkforclose.Stop(); timer_checkforclose.Stop();
} }
} }
} }

View file

@ -1,68 +1,68 @@
/* /*
* Greenshot - a free and open source screenshot tool * Greenshot - a free and open source screenshot tool
* Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom
* *
* For more information see: http://getgreenshot.org/ * For more information see: http://getgreenshot.org/
* The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 1 of the License, or * the Free Software Foundation, either version 1 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
using System; using System;
using System.Windows.Forms; using System.Windows.Forms;
using GreenshotPlugin.Interop; using Greenshot.Base.Interop;
namespace GreenshotPlugin.Controls namespace Greenshot.Base.Controls
{ {
public class ExtendedWebBrowser : WebBrowser public class ExtendedWebBrowser : WebBrowser
{ {
protected class ExtendedWebBrowserSite : WebBrowserSite, IOleCommandTarget protected class ExtendedWebBrowserSite : WebBrowserSite, IOleCommandTarget
{ {
private const int OLECMDID_SHOWSCRIPTERROR = 40; private const int OLECMDID_SHOWSCRIPTERROR = 40;
private static readonly Guid CGID_DocHostCommandHandler = new Guid("F38BC242-B950-11D1-8918-00C04FC2C836"); private static readonly Guid CGID_DocHostCommandHandler = new Guid("F38BC242-B950-11D1-8918-00C04FC2C836");
private const int S_OK = 0; private const int S_OK = 0;
private const int OLECMDERR_E_NOTSUPPORTED = (-2147221248); private const int OLECMDERR_E_NOTSUPPORTED = (-2147221248);
public ExtendedWebBrowserSite(WebBrowser wb) : base(wb) public ExtendedWebBrowserSite(WebBrowser wb) : base(wb)
{ {
} }
public int QueryStatus(Guid pguidCmdGroup, int cCmds, IntPtr prgCmds, IntPtr pCmdText) public int QueryStatus(Guid pguidCmdGroup, int cCmds, IntPtr prgCmds, IntPtr pCmdText)
{ {
return OLECMDERR_E_NOTSUPPORTED; return OLECMDERR_E_NOTSUPPORTED;
} }
public int Exec(Guid pguidCmdGroup, int nCmdID, int nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut) public int Exec(Guid pguidCmdGroup, int nCmdID, int nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut)
{ {
if (pguidCmdGroup == CGID_DocHostCommandHandler) if (pguidCmdGroup == CGID_DocHostCommandHandler)
{ {
if (nCmdID == OLECMDID_SHOWSCRIPTERROR) if (nCmdID == OLECMDID_SHOWSCRIPTERROR)
{ {
// do not need to alter pvaOut as the docs says, enough to return S_OK here // do not need to alter pvaOut as the docs says, enough to return S_OK here
return S_OK; return S_OK;
} }
} }
return OLECMDERR_E_NOTSUPPORTED; return OLECMDERR_E_NOTSUPPORTED;
} }
} }
protected override WebBrowserSiteBase CreateWebBrowserSiteBase() protected override WebBrowserSiteBase CreateWebBrowserSiteBase()
{ {
return new ExtendedWebBrowserSite(this); return new ExtendedWebBrowserSite(this);
} }
} }
} }

View file

@ -1,36 +1,36 @@
/* /*
* Greenshot - a free and open source screenshot tool * Greenshot - a free and open source screenshot tool
* Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom
* *
* For more information see: http://getgreenshot.org/ * For more information see: http://getgreenshot.org/
* The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 1 of the License, or * the Free Software Foundation, either version 1 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
using System.Windows.Forms; using System.Windows.Forms;
namespace GreenshotPlugin.Controls namespace Greenshot.Base.Controls
{ {
/// <summary> /// <summary>
/// FormWithoutActivation is exactly like a normal form, but doesn't activate (steal focus) /// FormWithoutActivation is exactly like a normal form, but doesn't activate (steal focus)
/// </summary> /// </summary>
public class FormWithoutActivation : Form public class FormWithoutActivation : Form
{ {
protected override bool ShowWithoutActivation protected override bool ShowWithoutActivation
{ {
get { return true; } get { return true; }
} }
} }
} }

View file

@ -1,32 +1,32 @@
/* /*
* Greenshot - a free and open source screenshot tool * Greenshot - a free and open source screenshot tool
* Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom
* *
* For more information see: http://getgreenshot.org/ * For more information see: http://getgreenshot.org/
* The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 1 of the License, or * the Free Software Foundation, either version 1 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
using System.ComponentModel; using System.ComponentModel;
using System.Windows.Forms; using System.Windows.Forms;
namespace GreenshotPlugin.Controls namespace Greenshot.Base.Controls
{ {
public class GreenshotButton : Button, IGreenshotLanguageBindable public class GreenshotButton : Button, IGreenshotLanguageBindable
{ {
[Category("Greenshot"), DefaultValue(null), Description("Specifies key of the language file to use when displaying the text.")] [Category("Greenshot"), DefaultValue(null), Description("Specifies key of the language file to use when displaying the text.")]
public string LanguageKey { get; set; } public string LanguageKey { get; set; }
} }
} }

View file

@ -1,41 +1,41 @@
/* /*
* Greenshot - a free and open source screenshot tool * Greenshot - a free and open source screenshot tool
* Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom
* *
* For more information see: http://getgreenshot.org/ * For more information see: http://getgreenshot.org/
* The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 1 of the License, or * the Free Software Foundation, either version 1 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
using System.ComponentModel; using System.ComponentModel;
using System.Windows.Forms; using System.Windows.Forms;
namespace GreenshotPlugin.Controls namespace Greenshot.Base.Controls
{ {
/// <summary> /// <summary>
/// Description of GreenshotCheckbox. /// Description of GreenshotCheckbox.
/// </summary> /// </summary>
public class GreenshotCheckBox : CheckBox, IGreenshotLanguageBindable, IGreenshotConfigBindable public class GreenshotCheckBox : CheckBox, IGreenshotLanguageBindable, IGreenshotConfigBindable
{ {
[Category("Greenshot"), DefaultValue(null), Description("Specifies key of the language file to use when displaying the text.")] [Category("Greenshot"), DefaultValue(null), Description("Specifies key of the language file to use when displaying the text.")]
public string LanguageKey { get; set; } public string LanguageKey { get; set; }
[Category("Greenshot"), DefaultValue("Core"), Description("Specifies the Ini-Section to map this control with.")] [Category("Greenshot"), DefaultValue("Core"), Description("Specifies the Ini-Section to map this control with.")]
public string SectionName { get; set; } = "Core"; public string SectionName { get; set; } = "Core";
[Category("Greenshot"), DefaultValue(null), Description("Specifies the property name to map the configuration.")] [Category("Greenshot"), DefaultValue(null), Description("Specifies the property name to map the configuration.")]
public string PropertyName { get; set; } public string PropertyName { get; set; }
} }
} }

View file

@ -22,7 +22,7 @@
using System.Collections; using System.Collections;
using System.Windows.Forms; using System.Windows.Forms;
namespace GreenshotPlugin.Controls namespace Greenshot.Base.Controls
{ {
/// <summary> /// <summary>
/// This class is an implementation of the 'IComparer' interface. /// This class is an implementation of the 'IComparer' interface.

View file

@ -1,116 +1,116 @@
/* /*
* Greenshot - a free and open source screenshot tool * Greenshot - a free and open source screenshot tool
* Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom
* *
* For more information see: http://getgreenshot.org/ * For more information see: http://getgreenshot.org/
* The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 1 of the License, or * the Free Software Foundation, either version 1 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
using System; using System;
using System.ComponentModel; using System.ComponentModel;
using System.Windows.Forms; using System.Windows.Forms;
using GreenshotPlugin.Core; using Greenshot.Base.Core;
namespace GreenshotPlugin.Controls namespace Greenshot.Base.Controls
{ {
public class GreenshotComboBox : ComboBox, IGreenshotConfigBindable public class GreenshotComboBox : ComboBox, IGreenshotConfigBindable
{ {
private Type _enumType; private Type _enumType;
private Enum _selectedEnum; private Enum _selectedEnum;
[Category("Greenshot"), DefaultValue("Core"), Description("Specifies the Ini-Section to map this control with.")] [Category("Greenshot"), DefaultValue("Core"), Description("Specifies the Ini-Section to map this control with.")]
public string SectionName { get; set; } = "Core"; public string SectionName { get; set; } = "Core";
[Category("Greenshot"), DefaultValue(null), Description("Specifies the property name to map the configuration.")] [Category("Greenshot"), DefaultValue(null), Description("Specifies the property name to map the configuration.")]
public string PropertyName { get; set; } public string PropertyName { get; set; }
public GreenshotComboBox() public GreenshotComboBox()
{ {
SelectedIndexChanged += delegate { StoreSelectedEnum(); }; SelectedIndexChanged += delegate { StoreSelectedEnum(); };
} }
public void SetValue(Enum currentValue) public void SetValue(Enum currentValue)
{ {
if (currentValue != null) if (currentValue != null)
{ {
_selectedEnum = currentValue; _selectedEnum = currentValue;
SelectedItem = Language.Translate(currentValue); SelectedItem = Language.Translate(currentValue);
} }
} }
/// <summary> /// <summary>
/// This is a method to popululate the ComboBox /// This is a method to popululate the ComboBox
/// with the items from the enumeration /// with the items from the enumeration
/// </summary> /// </summary>
/// <param name="enumType">TEnum to populate with</param> /// <param name="enumType">TEnum to populate with</param>
public void Populate(Type enumType) public void Populate(Type enumType)
{ {
// Store the enum-type, so we can work with it // Store the enum-type, so we can work with it
_enumType = enumType; _enumType = enumType;
var availableValues = Enum.GetValues(enumType); var availableValues = Enum.GetValues(enumType);
Items.Clear(); Items.Clear();
foreach (var enumValue in availableValues) foreach (var enumValue in availableValues)
{ {
Items.Add(Language.Translate((Enum) enumValue)); Items.Add(Language.Translate((Enum) enumValue));
} }
} }
/// <summary> /// <summary>
/// Store the selected value internally /// Store the selected value internally
/// </summary> /// </summary>
private void StoreSelectedEnum() private void StoreSelectedEnum()
{ {
string enumTypeName = _enumType.Name; string enumTypeName = _enumType.Name;
string selectedValue = SelectedItem as string; string selectedValue = SelectedItem as string;
var availableValues = Enum.GetValues(_enumType); var availableValues = Enum.GetValues(_enumType);
object returnValue = null; object returnValue = null;
try try
{ {
returnValue = Enum.Parse(_enumType, selectedValue); returnValue = Enum.Parse(_enumType, selectedValue);
} }
catch (Exception) catch (Exception)
{ {
// Ignore // Ignore
} }
foreach (Enum enumValue in availableValues) foreach (Enum enumValue in availableValues)
{ {
string enumKey = enumTypeName + "." + enumValue; string enumKey = enumTypeName + "." + enumValue;
if (Language.HasKey(enumKey)) if (Language.HasKey(enumKey))
{ {
string translation = Language.GetString(enumTypeName + "." + enumValue); string translation = Language.GetString(enumTypeName + "." + enumValue);
if (translation.Equals(selectedValue)) if (translation.Equals(selectedValue))
{ {
returnValue = enumValue; returnValue = enumValue;
} }
} }
} }
_selectedEnum = (Enum) returnValue; _selectedEnum = (Enum) returnValue;
} }
/// <summary> /// <summary>
/// Get the selected enum value from the combobox, uses generics /// Get the selected enum value from the combobox, uses generics
/// </summary> /// </summary>
/// <returns>The enum value of the combobox</returns> /// <returns>The enum value of the combobox</returns>
public Enum GetSelectedEnum() public Enum GetSelectedEnum()
{ {
return _selectedEnum; return _selectedEnum;
} }
} }
} }

View file

@ -1,32 +1,32 @@
/* /*
* Greenshot - a free and open source screenshot tool * Greenshot - a free and open source screenshot tool
* Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom
* *
* For more information see: http://getgreenshot.org/ * For more information see: http://getgreenshot.org/
* The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 1 of the License, or * the Free Software Foundation, either version 1 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
using System.Windows.Forms; using System.ComponentModel;
using System.ComponentModel; using System.Windows.Forms;
namespace GreenshotPlugin.Controls namespace Greenshot.Base.Controls
{ {
public class GreenshotGroupBox : GroupBox, IGreenshotLanguageBindable public class GreenshotGroupBox : GroupBox, IGreenshotLanguageBindable
{ {
[Category("Greenshot"), DefaultValue(null), Description("Specifies key of the language file to use when displaying the text.")] [Category("Greenshot"), DefaultValue(null), Description("Specifies key of the language file to use when displaying the text.")]
public string LanguageKey { get; set; } public string LanguageKey { get; set; }
} }
} }

View file

@ -1,32 +1,32 @@
/* /*
* Greenshot - a free and open source screenshot tool * Greenshot - a free and open source screenshot tool
* Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom
* *
* For more information see: http://getgreenshot.org/ * For more information see: http://getgreenshot.org/
* The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 1 of the License, or * the Free Software Foundation, either version 1 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
using System.Windows.Forms; using System.ComponentModel;
using System.ComponentModel; using System.Windows.Forms;
namespace GreenshotPlugin.Controls namespace Greenshot.Base.Controls
{ {
public class GreenshotLabel : Label, IGreenshotLanguageBindable public class GreenshotLabel : Label, IGreenshotLanguageBindable
{ {
[Category("Greenshot"), DefaultValue(null), Description("Specifies key of the language file to use when displaying the text.")] [Category("Greenshot"), DefaultValue(null), Description("Specifies key of the language file to use when displaying the text.")]
public string LanguageKey { get; set; } public string LanguageKey { get; set; }
} }
} }

View file

@ -1,41 +1,41 @@
/* /*
* Greenshot - a free and open source screenshot tool * Greenshot - a free and open source screenshot tool
* Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom
* *
* For more information see: http://getgreenshot.org/ * For more information see: http://getgreenshot.org/
* The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 1 of the License, or * the Free Software Foundation, either version 1 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
using System.ComponentModel; using System.ComponentModel;
using System.Windows.Forms; using System.Windows.Forms;
namespace GreenshotPlugin.Controls namespace Greenshot.Base.Controls
{ {
/// <summary> /// <summary>
/// Description of GreenshotCheckbox. /// Description of GreenshotCheckbox.
/// </summary> /// </summary>
public class GreenshotRadioButton : RadioButton, IGreenshotLanguageBindable, IGreenshotConfigBindable public class GreenshotRadioButton : RadioButton, IGreenshotLanguageBindable, IGreenshotConfigBindable
{ {
[Category("Greenshot"), DefaultValue(null), Description("Specifies key of the language file to use when displaying the text.")] [Category("Greenshot"), DefaultValue(null), Description("Specifies key of the language file to use when displaying the text.")]
public string LanguageKey { get; set; } public string LanguageKey { get; set; }
[Category("Greenshot"), DefaultValue("Core"), Description("Specifies the Ini-Section to map this control with.")] [Category("Greenshot"), DefaultValue("Core"), Description("Specifies the Ini-Section to map this control with.")]
public string SectionName { get; set; } = "Core"; public string SectionName { get; set; } = "Core";
[Category("Greenshot"), DefaultValue(null), Description("Specifies the property name to map the configuration.")] [Category("Greenshot"), DefaultValue(null), Description("Specifies the property name to map the configuration.")]
public string PropertyName { get; set; } public string PropertyName { get; set; }
} }
} }

View file

@ -1,32 +1,32 @@
/* /*
* Greenshot - a free and open source screenshot tool * Greenshot - a free and open source screenshot tool
* Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom
* *
* For more information see: http://getgreenshot.org/ * For more information see: http://getgreenshot.org/
* The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 1 of the License, or * the Free Software Foundation, either version 1 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
using System.Windows.Forms; using System.ComponentModel;
using System.ComponentModel; using System.Windows.Forms;
namespace GreenshotPlugin.Controls namespace Greenshot.Base.Controls
{ {
public class GreenshotTabPage : TabPage, IGreenshotLanguageBindable public class GreenshotTabPage : TabPage, IGreenshotLanguageBindable
{ {
[Category("Greenshot"), DefaultValue(null), Description("Specifies key of the language file to use when displaying the text.")] [Category("Greenshot"), DefaultValue(null), Description("Specifies key of the language file to use when displaying the text.")]
public string LanguageKey { get; set; } public string LanguageKey { get; set; }
} }
} }

View file

@ -1,35 +1,35 @@
/* /*
* Greenshot - a free and open source screenshot tool * Greenshot - a free and open source screenshot tool
* Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom
* *
* For more information see: http://getgreenshot.org/ * For more information see: http://getgreenshot.org/
* The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 1 of the License, or * the Free Software Foundation, either version 1 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
using System.ComponentModel; using System.ComponentModel;
using System.Windows.Forms; using System.Windows.Forms;
namespace GreenshotPlugin.Controls namespace Greenshot.Base.Controls
{ {
public class GreenshotTextBox : TextBox, IGreenshotConfigBindable public class GreenshotTextBox : TextBox, IGreenshotConfigBindable
{ {
[Category("Greenshot"), DefaultValue("Core"), Description("Specifies the Ini-Section to map this control with.")] [Category("Greenshot"), DefaultValue("Core"), Description("Specifies the Ini-Section to map this control with.")]
public string SectionName { get; set; } = "Core"; public string SectionName { get; set; } = "Core";
[Category("Greenshot"), DefaultValue(null), Description("Specifies the property name to map the configuration.")] [Category("Greenshot"), DefaultValue(null), Description("Specifies the property name to map the configuration.")]
public string PropertyName { get; set; } public string PropertyName { get; set; }
} }
} }

View file

@ -1,32 +1,32 @@
/* /*
* Greenshot - a free and open source screenshot tool * Greenshot - a free and open source screenshot tool
* Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom
* *
* For more information see: http://getgreenshot.org/ * For more information see: http://getgreenshot.org/
* The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 1 of the License, or * the Free Software Foundation, either version 1 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
using System.ComponentModel; using System.ComponentModel;
using System.Windows.Forms; using System.Windows.Forms;
namespace GreenshotPlugin.Controls namespace Greenshot.Base.Controls
{ {
public class GreenshotToolStripDropDownButton : ToolStripDropDownButton, IGreenshotLanguageBindable public class GreenshotToolStripDropDownButton : ToolStripDropDownButton, IGreenshotLanguageBindable
{ {
[Category("Greenshot"), DefaultValue(null), Description("Specifies key of the language file to use when displaying the text.")] [Category("Greenshot"), DefaultValue(null), Description("Specifies key of the language file to use when displaying the text.")]
public string LanguageKey { get; set; } public string LanguageKey { get; set; }
} }
} }

View file

@ -1,32 +1,32 @@
/* /*
* Greenshot - a free and open source screenshot tool * Greenshot - a free and open source screenshot tool
* Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom
* *
* For more information see: http://getgreenshot.org/ * For more information see: http://getgreenshot.org/
* The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 1 of the License, or * the Free Software Foundation, either version 1 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
using System.ComponentModel; using System.ComponentModel;
using System.Windows.Forms; using System.Windows.Forms;
namespace GreenshotPlugin.Controls namespace Greenshot.Base.Controls
{ {
public class GreenshotToolStripButton : ToolStripButton, IGreenshotLanguageBindable public class GreenshotToolStripButton : ToolStripButton, IGreenshotLanguageBindable
{ {
[Category("Greenshot"), DefaultValue(null), Description("Specifies key of the language file to use when displaying the text.")] [Category("Greenshot"), DefaultValue(null), Description("Specifies key of the language file to use when displaying the text.")]
public string LanguageKey { get; set; } public string LanguageKey { get; set; }
} }
} }

View file

@ -1,32 +1,32 @@
/* /*
* Greenshot - a free and open source screenshot tool * Greenshot - a free and open source screenshot tool
* Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom
* *
* For more information see: http://getgreenshot.org/ * For more information see: http://getgreenshot.org/
* The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 1 of the License, or * the Free Software Foundation, either version 1 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
using System.Windows.Forms; using System.ComponentModel;
using System.ComponentModel; using System.Windows.Forms;
namespace GreenshotPlugin.Controls namespace Greenshot.Base.Controls
{ {
public class GreenshotToolStripLabel : ToolStripLabel, IGreenshotLanguageBindable public class GreenshotToolStripLabel : ToolStripLabel, IGreenshotLanguageBindable
{ {
[Category("Greenshot"), DefaultValue(null), Description("Specifies key of the language file to use when displaying the text.")] [Category("Greenshot"), DefaultValue(null), Description("Specifies key of the language file to use when displaying the text.")]
public string LanguageKey { get; set; } public string LanguageKey { get; set; }
} }
} }

View file

@ -1,32 +1,32 @@
/* /*
* Greenshot - a free and open source screenshot tool * Greenshot - a free and open source screenshot tool
* Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom
* *
* For more information see: http://getgreenshot.org/ * For more information see: http://getgreenshot.org/
* The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 1 of the License, or * the Free Software Foundation, either version 1 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
using System.ComponentModel; using System.ComponentModel;
using System.Windows.Forms; using System.Windows.Forms;
namespace GreenshotPlugin.Controls namespace Greenshot.Base.Controls
{ {
public class GreenshotToolStripMenuItem : ToolStripMenuItem, IGreenshotLanguageBindable public class GreenshotToolStripMenuItem : ToolStripMenuItem, IGreenshotLanguageBindable
{ {
[Category("Greenshot"), DefaultValue(null), Description("Specifies key of the language file to use when displaying the text.")] [Category("Greenshot"), DefaultValue(null), Description("Specifies key of the language file to use when displaying the text.")]
public string LanguageKey { get; set; } public string LanguageKey { get; set; }
} }
} }

View file

@ -1,36 +1,36 @@
/* /*
* Greenshot - a free and open source screenshot tool * Greenshot - a free and open source screenshot tool
* Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom
* *
* For more information see: http://getgreenshot.org/ * For more information see: http://getgreenshot.org/
* The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 1 of the License, or * the Free Software Foundation, either version 1 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
namespace GreenshotPlugin.Controls namespace Greenshot.Base.Controls
{ {
public interface IGreenshotConfigBindable public interface IGreenshotConfigBindable
{ {
/// <summary> /// <summary>
/// The class where the property-value is stored /// The class where the property-value is stored
/// </summary> /// </summary>
string SectionName { get; set; } string SectionName { get; set; }
/// <summary> /// <summary>
/// Path to the property value which will be mapped with this control /// Path to the property value which will be mapped with this control
/// </summary> /// </summary>
string PropertyName { get; set; } string PropertyName { get; set; }
} }
} }

View file

@ -1,34 +1,34 @@
/* /*
* Greenshot - a free and open source screenshot tool * Greenshot - a free and open source screenshot tool
* Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom
* *
* For more information see: http://getgreenshot.org/ * For more information see: http://getgreenshot.org/
* The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 1 of the License, or * the Free Software Foundation, either version 1 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
namespace GreenshotPlugin.Controls namespace Greenshot.Base.Controls
{ {
/// <summary> /// <summary>
/// This interface describes the designer fields that need to be implemented for Greenshot controls /// This interface describes the designer fields that need to be implemented for Greenshot controls
/// </summary> /// </summary>
public interface IGreenshotLanguageBindable public interface IGreenshotLanguageBindable
{ {
/// <summary> /// <summary>
/// Language key to use to fill the Text value with /// Language key to use to fill the Text value with
/// </summary> /// </summary>
string LanguageKey { get; set; } string LanguageKey { get; set; }
} }
} }

View file

@ -1,92 +1,92 @@
/* /*
* Greenshot - a free and open source screenshot tool * Greenshot - a free and open source screenshot tool
* Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom
* *
* For more information see: http://getgreenshot.org/ * For more information see: http://getgreenshot.org/
* The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 1 of the License, or * the Free Software Foundation, either version 1 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
namespace GreenshotPlugin.Controls { namespace Greenshot.Base.Controls {
partial class OAuthLoginForm { partial class OAuthLoginForm {
/// <summary> /// <summary>
/// Required designer variable. /// Required designer variable.
/// </summary> /// </summary>
private System.ComponentModel.IContainer components = null; private System.ComponentModel.IContainer components = null;
/// <summary> /// <summary>
/// Clean up any resources being used. /// Clean up any resources being used.
/// </summary> /// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing) protected override void Dispose(bool disposing)
{ {
if (disposing && (components != null)) { if (disposing && (components != null)) {
components.Dispose(); components.Dispose();
} }
base.Dispose(disposing); base.Dispose(disposing);
} }
#region Windows Form Designer generated code #region Windows Form Designer generated code
/// <summary> /// <summary>
/// Required method for Designer support - do not modify /// Required method for Designer support - do not modify
/// the contents of this method with the code editor. /// the contents of this method with the code editor.
/// </summary> /// </summary>
private void InitializeComponent() { private void InitializeComponent() {
this._addressTextBox = new System.Windows.Forms.TextBox(); this._addressTextBox = new System.Windows.Forms.TextBox();
this._browser = new ExtendedWebBrowser(); this._browser = new ExtendedWebBrowser();
this.SuspendLayout(); this.SuspendLayout();
// //
// _addressTextBox // _addressTextBox
// //
this._addressTextBox.Cursor = System.Windows.Forms.Cursors.Arrow; this._addressTextBox.Cursor = System.Windows.Forms.Cursors.Arrow;
this._addressTextBox.Dock = System.Windows.Forms.DockStyle.Top; this._addressTextBox.Dock = System.Windows.Forms.DockStyle.Top;
this._addressTextBox.Enabled = false; this._addressTextBox.Enabled = false;
this._addressTextBox.Location = new System.Drawing.Point(0, 0); this._addressTextBox.Location = new System.Drawing.Point(0, 0);
this._addressTextBox.Name = "addressTextBox"; this._addressTextBox.Name = "addressTextBox";
this._addressTextBox.Size = new System.Drawing.Size(595, 20); this._addressTextBox.Size = new System.Drawing.Size(595, 20);
this._addressTextBox.TabIndex = 3; this._addressTextBox.TabIndex = 3;
this._addressTextBox.TabStop = false; this._addressTextBox.TabStop = false;
// //
// _browser // _browser
// //
this._browser.Dock = System.Windows.Forms.DockStyle.Fill; this._browser.Dock = System.Windows.Forms.DockStyle.Fill;
this._browser.Location = new System.Drawing.Point(0, 20); this._browser.Location = new System.Drawing.Point(0, 20);
this._browser.MinimumSize = new System.Drawing.Size(100, 100); this._browser.MinimumSize = new System.Drawing.Size(100, 100);
this._browser.Name = "browser"; this._browser.Name = "browser";
this._browser.Size = new System.Drawing.Size(595, 295); this._browser.Size = new System.Drawing.Size(595, 295);
this._browser.TabIndex = 4; this._browser.TabIndex = 4;
// //
// OAuthLoginForm // OAuthLoginForm
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.ClientSize = new System.Drawing.Size(595, 315); this.ClientSize = new System.Drawing.Size(595, 315);
this.Controls.Add(this._browser); this.Controls.Add(this._browser);
this.Controls.Add(this._addressTextBox); this.Controls.Add(this._addressTextBox);
this.MaximizeBox = false; this.MaximizeBox = false;
this.MinimizeBox = false; this.MinimizeBox = false;
this.Name = "OAuthLoginForm"; this.Name = "OAuthLoginForm";
this.ResumeLayout(false); this.ResumeLayout(false);
this.PerformLayout(); this.PerformLayout();
} }
#endregion #endregion
private System.Windows.Forms.TextBox _addressTextBox; private System.Windows.Forms.TextBox _addressTextBox;
private ExtendedWebBrowser _browser; private ExtendedWebBrowser _browser;
} }
} }

View file

@ -1,121 +1,121 @@
/* /*
* Greenshot - a free and open source screenshot tool * Greenshot - a free and open source screenshot tool
* Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom
* *
* For more information see: http://getgreenshot.org/ * For more information see: http://getgreenshot.org/
* The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 1 of the License, or * the Free Software Foundation, either version 1 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Drawing; using System.Drawing;
using System.Windows.Forms; using System.Windows.Forms;
using GreenshotPlugin.Core; using Greenshot.Base.Core;
using log4net; using log4net;
namespace GreenshotPlugin.Controls namespace Greenshot.Base.Controls
{ {
/// <summary> /// <summary>
/// The OAuthLoginForm is used to allow the user to authorize Greenshot with an "Oauth" application /// The OAuthLoginForm is used to allow the user to authorize Greenshot with an "Oauth" application
/// </summary> /// </summary>
public sealed partial class OAuthLoginForm : Form public sealed partial class OAuthLoginForm : Form
{ {
private static readonly ILog LOG = LogManager.GetLogger(typeof(OAuthLoginForm)); private static readonly ILog LOG = LogManager.GetLogger(typeof(OAuthLoginForm));
private readonly string _callbackUrl; private readonly string _callbackUrl;
public IDictionary<string, string> CallbackParameters { get; private set; } public IDictionary<string, string> CallbackParameters { get; private set; }
public bool IsOk => DialogResult == DialogResult.OK; public bool IsOk => DialogResult == DialogResult.OK;
public OAuthLoginForm(string browserTitle, Size size, string authorizationLink, string callbackUrl) public OAuthLoginForm(string browserTitle, Size size, string authorizationLink, string callbackUrl)
{ {
// Make sure Greenshot uses the correct browser version // Make sure Greenshot uses the correct browser version
IEHelper.FixBrowserVersion(false); IEHelper.FixBrowserVersion(false);
_callbackUrl = callbackUrl; _callbackUrl = callbackUrl;
// Fix for BUG-2071 // Fix for BUG-2071
if (callbackUrl.EndsWith("/")) if (callbackUrl.EndsWith("/"))
{ {
_callbackUrl = callbackUrl.Substring(0, callbackUrl.Length - 1); _callbackUrl = callbackUrl.Substring(0, callbackUrl.Length - 1);
} }
InitializeComponent(); InitializeComponent();
ClientSize = size; ClientSize = size;
Icon = GreenshotResources.GetGreenshotIcon(); Icon = GreenshotResources.GetGreenshotIcon();
Text = browserTitle; Text = browserTitle;
_addressTextBox.Text = authorizationLink; _addressTextBox.Text = authorizationLink;
// The script errors are suppressed by using the ExtendedWebBrowser // The script errors are suppressed by using the ExtendedWebBrowser
_browser.ScriptErrorsSuppressed = false; _browser.ScriptErrorsSuppressed = false;
_browser.DocumentCompleted += Browser_DocumentCompleted; _browser.DocumentCompleted += Browser_DocumentCompleted;
_browser.Navigated += Browser_Navigated; _browser.Navigated += Browser_Navigated;
_browser.Navigating += Browser_Navigating; _browser.Navigating += Browser_Navigating;
_browser.Navigate(new Uri(authorizationLink)); _browser.Navigate(new Uri(authorizationLink));
} }
/// <summary> /// <summary>
/// Make sure the form is visible /// Make sure the form is visible
/// </summary> /// </summary>
/// <param name="e">EventArgs</param> /// <param name="e">EventArgs</param>
protected override void OnShown(EventArgs e) protected override void OnShown(EventArgs e)
{ {
base.OnShown(e); base.OnShown(e);
WindowDetails.ToForeground(Handle); WindowDetails.ToForeground(Handle);
} }
private void Browser_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e) private void Browser_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
{ {
LOG.DebugFormat("document completed with url: {0}", _browser.Url); LOG.DebugFormat("document completed with url: {0}", _browser.Url);
CheckUrl(); CheckUrl();
} }
private void Browser_Navigating(object sender, WebBrowserNavigatingEventArgs e) private void Browser_Navigating(object sender, WebBrowserNavigatingEventArgs e)
{ {
LOG.DebugFormat("Navigating to url: {0}", _browser.Url); LOG.DebugFormat("Navigating to url: {0}", _browser.Url);
_addressTextBox.Text = e.Url.ToString(); _addressTextBox.Text = e.Url.ToString();
} }
private void Browser_Navigated(object sender, WebBrowserNavigatedEventArgs e) private void Browser_Navigated(object sender, WebBrowserNavigatedEventArgs e)
{ {
LOG.DebugFormat("Navigated to url: {0}", _browser.Url); LOG.DebugFormat("Navigated to url: {0}", _browser.Url);
CheckUrl(); CheckUrl();
} }
private void CheckUrl() private void CheckUrl()
{ {
if (_browser.Url.ToString().StartsWith(_callbackUrl)) if (_browser.Url.ToString().StartsWith(_callbackUrl))
{ {
var correctedUri = new Uri(_browser.Url.AbsoluteUri.Replace("#", "&")); var correctedUri = new Uri(_browser.Url.AbsoluteUri.Replace("#", "&"));
string queryParams = correctedUri.Query; string queryParams = correctedUri.Query;
if (queryParams.Length > 0) if (queryParams.Length > 0)
{ {
queryParams = NetworkHelper.UrlDecode(queryParams); queryParams = NetworkHelper.UrlDecode(queryParams);
//Store the Token and Token Secret //Store the Token and Token Secret
CallbackParameters = NetworkHelper.ParseQueryString(queryParams); CallbackParameters = NetworkHelper.ParseQueryString(queryParams);
} }
DialogResult = DialogResult.OK; DialogResult = DialogResult.OK;
} }
} }
private void AddressTextBox_KeyPress(object sender, KeyPressEventArgs e) private void AddressTextBox_KeyPress(object sender, KeyPressEventArgs e)
{ {
//Cancel the key press so the user can't enter a new url //Cancel the key press so the user can't enter a new url
e.Handled = true; e.Handled = true;
} }
} }
} }

View file

@ -1,99 +1,99 @@
/* /*
* Greenshot - a free and open source screenshot tool * Greenshot - a free and open source screenshot tool
* Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom
* *
* For more information see: http://getgreenshot.org/ * For more information see: http://getgreenshot.org/
* The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 1 of the License, or * the Free Software Foundation, either version 1 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
namespace GreenshotPlugin.Controls { namespace Greenshot.Base.Controls {
partial class PleaseWaitForm { partial class PleaseWaitForm {
/// <summary> /// <summary>
/// Designer variable used to keep track of non-visual components. /// Designer variable used to keep track of non-visual components.
/// </summary> /// </summary>
private System.ComponentModel.IContainer components = null; private System.ComponentModel.IContainer components = null;
/// <summary> /// <summary>
/// Disposes resources used by the form. /// Disposes resources used by the form.
/// </summary> /// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing) { protected override void Dispose(bool disposing) {
if (disposing) { if (disposing) {
if (components != null) { if (components != null) {
components.Dispose(); components.Dispose();
} }
} }
base.Dispose(disposing); base.Dispose(disposing);
} }
/// <summary> /// <summary>
/// This method is required for Windows Forms designer support. /// This method is required for Windows Forms designer support.
/// Do not change the method contents inside the source code editor. The Forms designer might /// 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. /// not be able to load this method if it was changed manually.
/// </summary> /// </summary>
private void InitializeComponent() { private void InitializeComponent() {
this.label_pleasewait = new System.Windows.Forms.Label(); this.label_pleasewait = new System.Windows.Forms.Label();
this.cancelButton = new System.Windows.Forms.Button(); this.cancelButton = new System.Windows.Forms.Button();
this.SuspendLayout(); this.SuspendLayout();
// //
// label_pleasewait // label_pleasewait
// //
this.label_pleasewait.Dock = System.Windows.Forms.DockStyle.Fill; this.label_pleasewait.Dock = System.Windows.Forms.DockStyle.Fill;
this.label_pleasewait.Location = new System.Drawing.Point(0, 0); this.label_pleasewait.Location = new System.Drawing.Point(0, 0);
this.label_pleasewait.Name = "label_pleasewait"; this.label_pleasewait.Name = "label_pleasewait";
this.label_pleasewait.Padding = new System.Windows.Forms.Padding(10); this.label_pleasewait.Padding = new System.Windows.Forms.Padding(10);
this.label_pleasewait.Size = new System.Drawing.Size(90, 33); this.label_pleasewait.Size = new System.Drawing.Size(90, 33);
this.label_pleasewait.TabIndex = 0; this.label_pleasewait.TabIndex = 0;
this.label_pleasewait.Text = "Please wait..."; this.label_pleasewait.Text = "Please wait...";
this.label_pleasewait.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; this.label_pleasewait.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.label_pleasewait.UseWaitCursor = true; this.label_pleasewait.UseWaitCursor = true;
// //
// cancelButton // cancelButton
// //
this.cancelButton.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) this.cancelButton.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.cancelButton.Location = new System.Drawing.Point(38, 41); this.cancelButton.Location = new System.Drawing.Point(38, 41);
this.cancelButton.Name = "cancelButton"; this.cancelButton.Name = "cancelButton";
this.cancelButton.Size = new System.Drawing.Size(94, 23); this.cancelButton.Size = new System.Drawing.Size(94, 23);
this.cancelButton.TabIndex = 1; this.cancelButton.TabIndex = 1;
this.cancelButton.Text = "Cancel"; this.cancelButton.Text = "Cancel";
this.cancelButton.UseVisualStyleBackColor = true; this.cancelButton.UseVisualStyleBackColor = true;
this.cancelButton.UseWaitCursor = true; this.cancelButton.UseWaitCursor = true;
this.cancelButton.Click += new System.EventHandler(this.CancelButtonClick); this.cancelButton.Click += new System.EventHandler(this.CancelButtonClick);
// //
// PleaseWaitForm // PleaseWaitForm
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.CancelButton = this.cancelButton; this.CancelButton = this.cancelButton;
this.ClientSize = new System.Drawing.Size(169, 76); this.ClientSize = new System.Drawing.Size(169, 76);
this.Controls.Add(this.cancelButton); this.Controls.Add(this.cancelButton);
this.Controls.Add(this.label_pleasewait); this.Controls.Add(this.label_pleasewait);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.MaximizeBox = false; this.MaximizeBox = false;
this.MinimizeBox = false; this.MinimizeBox = false;
this.Name = "PleaseWaitForm"; this.Name = "PleaseWaitForm";
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Greenshot"; this.Text = "Greenshot";
this.UseWaitCursor = true; this.UseWaitCursor = true;
this.ResumeLayout(false); this.ResumeLayout(false);
this.PerformLayout(); this.PerformLayout();
} }
private System.Windows.Forms.Button cancelButton; private System.Windows.Forms.Button cancelButton;
private System.Windows.Forms.Label label_pleasewait; private System.Windows.Forms.Label label_pleasewait;
} }
} }

View file

@ -1,143 +1,143 @@
/* /*
* Greenshot - a free and open source screenshot tool * Greenshot - a free and open source screenshot tool
* Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom
* *
* For more information see: http://getgreenshot.org/ * For more information see: http://getgreenshot.org/
* The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 1 of the License, or * the Free Software Foundation, either version 1 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
using System; using System;
using System.Windows.Forms; using System.Threading;
using System.Threading; using System.Windows.Forms;
using GreenshotPlugin.Core; using Greenshot.Base.Core;
using log4net; using log4net;
namespace GreenshotPlugin.Controls namespace Greenshot.Base.Controls
{ {
/// <summary> /// <summary>
/// Description of PleaseWaitForm. /// Description of PleaseWaitForm.
/// </summary> /// </summary>
public partial class PleaseWaitForm : Form public partial class PleaseWaitForm : Form
{ {
private static readonly ILog LOG = LogManager.GetLogger(typeof(PleaseWaitForm)); private static readonly ILog LOG = LogManager.GetLogger(typeof(PleaseWaitForm));
private Thread _waitFor; private Thread _waitFor;
private string _title; private string _title;
public PleaseWaitForm() public PleaseWaitForm()
{ {
// //
// The InitializeComponent() call is required for Windows Forms designer support. // The InitializeComponent() call is required for Windows Forms designer support.
// //
InitializeComponent(); InitializeComponent();
Icon = GreenshotResources.GetGreenshotIcon(); Icon = GreenshotResources.GetGreenshotIcon();
} }
/// <summary> /// <summary>
/// Prevent the close-window button showing /// Prevent the close-window button showing
/// </summary> /// </summary>
private const int CP_NOCLOSE_BUTTON = 0x200; private const int CP_NOCLOSE_BUTTON = 0x200;
protected override CreateParams CreateParams protected override CreateParams CreateParams
{ {
get get
{ {
CreateParams createParams = base.CreateParams; CreateParams createParams = base.CreateParams;
createParams.ClassStyle |= CP_NOCLOSE_BUTTON; createParams.ClassStyle |= CP_NOCLOSE_BUTTON;
return createParams; return createParams;
} }
} }
/// <summary> /// <summary>
/// Show the "please wait" form, execute the code from the delegate and wait until execution finishes. /// Show the "please wait" form, execute the code from the delegate and wait until execution finishes.
/// The supplied delegate will be wrapped with a try/catch so this method can return any exception that was thrown. /// The supplied delegate will be wrapped with a try/catch so this method can return any exception that was thrown.
/// </summary> /// </summary>
/// <param name="title">The title of the form (and Thread)</param> /// <param name="title">The title of the form (and Thread)</param>
/// <param name="text">The text in the form</param> /// <param name="text">The text in the form</param>
/// <param name="waitDelegate">delegate { with your code }</param> /// <param name="waitDelegate">delegate { with your code }</param>
public void ShowAndWait(string title, string text, ThreadStart waitDelegate) public void ShowAndWait(string title, string text, ThreadStart waitDelegate)
{ {
_title = title; _title = title;
Text = title; Text = title;
label_pleasewait.Text = text; label_pleasewait.Text = text;
cancelButton.Text = Language.GetString("CANCEL"); cancelButton.Text = Language.GetString("CANCEL");
// Make sure the form is shown. // Make sure the form is shown.
Show(); Show();
// Variable to store the exception, if one is generated, from inside the thread. // Variable to store the exception, if one is generated, from inside the thread.
Exception threadException = null; Exception threadException = null;
try try
{ {
// Wrap the passed delegate in a try/catch which makes it possible to save the exception // Wrap the passed delegate in a try/catch which makes it possible to save the exception
_waitFor = new Thread(new ThreadStart( _waitFor = new Thread(new ThreadStart(
delegate delegate
{ {
try try
{ {
waitDelegate.Invoke(); waitDelegate.Invoke();
} }
catch (Exception ex) catch (Exception ex)
{ {
LOG.Error("invoke error:", ex); LOG.Error("invoke error:", ex);
threadException = ex; threadException = ex;
} }
}) })
) )
{ {
Name = title, Name = title,
IsBackground = true IsBackground = true
}; };
_waitFor.SetApartmentState(ApartmentState.STA); _waitFor.SetApartmentState(ApartmentState.STA);
_waitFor.Start(); _waitFor.Start();
// Wait until finished // Wait until finished
while (!_waitFor.Join(TimeSpan.FromMilliseconds(100))) while (!_waitFor.Join(TimeSpan.FromMilliseconds(100)))
{ {
Application.DoEvents(); Application.DoEvents();
} }
LOG.DebugFormat("Finished {0}", title); LOG.DebugFormat("Finished {0}", title);
} }
catch (Exception ex) catch (Exception ex)
{ {
LOG.Error(ex); LOG.Error(ex);
throw; throw;
} }
finally finally
{ {
Close(); Close();
} }
// Check if an exception occured, if so throw it // Check if an exception occured, if so throw it
if (threadException != null) if (threadException != null)
{ {
throw threadException; throw threadException;
} }
} }
/// <summary> /// <summary>
/// Called if the cancel button is clicked, will use Thread.Abort() /// Called if the cancel button is clicked, will use Thread.Abort()
/// </summary> /// </summary>
/// <param name="sender"></param> /// <param name="sender"></param>
/// <param name="e"></param> /// <param name="e"></param>
private void CancelButtonClick(object sender, EventArgs e) private void CancelButtonClick(object sender, EventArgs e)
{ {
LOG.DebugFormat("Cancel clicked on {0}", _title); LOG.DebugFormat("Cancel clicked on {0}", _title);
cancelButton.Enabled = false; cancelButton.Enabled = false;
_waitFor.Abort(); _waitFor.Abort();
} }
} }
} }

View file

@ -1,147 +1,147 @@
/* /*
* Greenshot - a free and open source screenshot tool * Greenshot - a free and open source screenshot tool
* Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom
* *
* For more information see: http://getgreenshot.org/ * For more information see: http://getgreenshot.org/
* The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 1 of the License, or * the Free Software Foundation, either version 1 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
namespace GreenshotPlugin.Controls { namespace Greenshot.Base.Controls {
partial class QualityDialog { partial class QualityDialog {
/// <summary> /// <summary>
/// Designer variable used to keep track of non-visual components. /// Designer variable used to keep track of non-visual components.
/// </summary> /// </summary>
private System.ComponentModel.IContainer components = null; private System.ComponentModel.IContainer components = null;
/// <summary> /// <summary>
/// Disposes resources used by the form. /// Disposes resources used by the form.
/// </summary> /// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing) protected override void Dispose(bool disposing)
{ {
if (disposing) { if (disposing) {
if (components != null) { if (components != null) {
components.Dispose(); components.Dispose();
} }
} }
base.Dispose(disposing); base.Dispose(disposing);
} }
/// <summary> /// <summary>
/// This method is required for Windows Forms designer support. /// This method is required for Windows Forms designer support.
/// Do not change the method contents inside the source code editor. The Forms designer might /// 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. /// not be able to load this method if it was changed manually.
/// </summary> /// </summary>
private void InitializeComponent() private void InitializeComponent()
{ {
this.label_choosejpegquality = new GreenshotPlugin.Controls.GreenshotLabel(); this.label_choosejpegquality = new GreenshotLabel();
this.textBoxJpegQuality = new System.Windows.Forms.TextBox(); this.textBoxJpegQuality = new System.Windows.Forms.TextBox();
this.trackBarJpegQuality = new System.Windows.Forms.TrackBar(); this.trackBarJpegQuality = new System.Windows.Forms.TrackBar();
this.checkbox_dontaskagain = new GreenshotPlugin.Controls.GreenshotCheckBox(); this.checkbox_dontaskagain = new GreenshotCheckBox();
this.button_ok = new GreenshotPlugin.Controls.GreenshotButton(); this.button_ok = new GreenshotButton();
this.checkBox_reduceColors = new System.Windows.Forms.CheckBox(); this.checkBox_reduceColors = new System.Windows.Forms.CheckBox();
((System.ComponentModel.ISupportInitialize)(this.trackBarJpegQuality)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.trackBarJpegQuality)).BeginInit();
this.SuspendLayout(); this.SuspendLayout();
// //
// label_choosejpegquality // label_choosejpegquality
// //
this.label_choosejpegquality.Location = new System.Drawing.Point(12, 47); this.label_choosejpegquality.Location = new System.Drawing.Point(12, 47);
this.label_choosejpegquality.Name = "label_choosejpegquality"; this.label_choosejpegquality.Name = "label_choosejpegquality";
this.label_choosejpegquality.Size = new System.Drawing.Size(268, 19); this.label_choosejpegquality.Size = new System.Drawing.Size(268, 19);
this.label_choosejpegquality.TabIndex = 15; this.label_choosejpegquality.TabIndex = 15;
this.label_choosejpegquality.LanguageKey = "jpegqualitydialog_choosejpegquality"; this.label_choosejpegquality.LanguageKey = "jpegqualitydialog_choosejpegquality";
// //
// textBoxJpegQuality // textBoxJpegQuality
// //
this.textBoxJpegQuality.Location = new System.Drawing.Point(245, 69); this.textBoxJpegQuality.Location = new System.Drawing.Point(245, 69);
this.textBoxJpegQuality.Name = "textBoxJpegQuality"; this.textBoxJpegQuality.Name = "textBoxJpegQuality";
this.textBoxJpegQuality.ReadOnly = true; this.textBoxJpegQuality.ReadOnly = true;
this.textBoxJpegQuality.Size = new System.Drawing.Size(35, 20); this.textBoxJpegQuality.Size = new System.Drawing.Size(35, 20);
this.textBoxJpegQuality.TabIndex = 4; this.textBoxJpegQuality.TabIndex = 4;
this.textBoxJpegQuality.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; this.textBoxJpegQuality.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
// //
// trackBarJpegQuality // trackBarJpegQuality
// //
this.trackBarJpegQuality.LargeChange = 10; this.trackBarJpegQuality.LargeChange = 10;
this.trackBarJpegQuality.Location = new System.Drawing.Point(12, 69); this.trackBarJpegQuality.Location = new System.Drawing.Point(12, 69);
this.trackBarJpegQuality.Maximum = 100; this.trackBarJpegQuality.Maximum = 100;
this.trackBarJpegQuality.Name = "trackBarJpegQuality"; this.trackBarJpegQuality.Name = "trackBarJpegQuality";
this.trackBarJpegQuality.Size = new System.Drawing.Size(233, 45); this.trackBarJpegQuality.Size = new System.Drawing.Size(233, 45);
this.trackBarJpegQuality.TabIndex = 3; this.trackBarJpegQuality.TabIndex = 3;
this.trackBarJpegQuality.TickFrequency = 10; this.trackBarJpegQuality.TickFrequency = 10;
this.trackBarJpegQuality.Scroll += new System.EventHandler(this.TrackBarJpegQualityScroll); this.trackBarJpegQuality.Scroll += new System.EventHandler(this.TrackBarJpegQualityScroll);
// //
// checkbox_dontaskagain // checkbox_dontaskagain
// //
this.checkbox_dontaskagain.CheckAlign = System.Drawing.ContentAlignment.TopLeft; this.checkbox_dontaskagain.CheckAlign = System.Drawing.ContentAlignment.TopLeft;
this.checkbox_dontaskagain.ImageAlign = System.Drawing.ContentAlignment.TopLeft; this.checkbox_dontaskagain.ImageAlign = System.Drawing.ContentAlignment.TopLeft;
this.checkbox_dontaskagain.Location = new System.Drawing.Point(12, 106); this.checkbox_dontaskagain.Location = new System.Drawing.Point(12, 106);
this.checkbox_dontaskagain.Name = "checkbox_dontaskagain"; this.checkbox_dontaskagain.Name = "checkbox_dontaskagain";
this.checkbox_dontaskagain.LanguageKey = "qualitydialog_dontaskagain"; this.checkbox_dontaskagain.LanguageKey = "qualitydialog_dontaskagain";
this.checkbox_dontaskagain.Size = new System.Drawing.Size(268, 37); this.checkbox_dontaskagain.Size = new System.Drawing.Size(268, 37);
this.checkbox_dontaskagain.TabIndex = 5; this.checkbox_dontaskagain.TabIndex = 5;
this.checkbox_dontaskagain.TextAlign = System.Drawing.ContentAlignment.TopLeft; this.checkbox_dontaskagain.TextAlign = System.Drawing.ContentAlignment.TopLeft;
this.checkbox_dontaskagain.UseVisualStyleBackColor = true; this.checkbox_dontaskagain.UseVisualStyleBackColor = true;
// //
// button_ok // button_ok
// //
this.button_ok.DialogResult = System.Windows.Forms.DialogResult.Cancel; this.button_ok.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.button_ok.Location = new System.Drawing.Point(205, 149); this.button_ok.Location = new System.Drawing.Point(205, 149);
this.button_ok.Name = "button_ok"; this.button_ok.Name = "button_ok";
this.button_ok.Size = new System.Drawing.Size(75, 23); this.button_ok.Size = new System.Drawing.Size(75, 23);
this.button_ok.TabIndex = 1; this.button_ok.TabIndex = 1;
this.button_ok.LanguageKey = "OK"; this.button_ok.LanguageKey = "OK";
this.button_ok.UseVisualStyleBackColor = true; this.button_ok.UseVisualStyleBackColor = true;
this.button_ok.Click += new System.EventHandler(this.Button_okClick); this.button_ok.Click += new System.EventHandler(this.Button_okClick);
// //
// checkBox_reduceColors // checkBox_reduceColors
// //
this.checkBox_reduceColors.Location = new System.Drawing.Point(12, 11); this.checkBox_reduceColors.Location = new System.Drawing.Point(12, 11);
this.checkBox_reduceColors.Name = "checkBox_reduceColors"; this.checkBox_reduceColors.Name = "checkBox_reduceColors";
this.checkBox_reduceColors.Size = new System.Drawing.Size(95, 17); this.checkBox_reduceColors.Size = new System.Drawing.Size(95, 17);
this.checkBox_reduceColors.TabIndex = 2; this.checkBox_reduceColors.TabIndex = 2;
this.checkBox_reduceColors.Text = "settings_reducecolors"; this.checkBox_reduceColors.Text = "settings_reducecolors";
this.checkBox_reduceColors.UseVisualStyleBackColor = true; this.checkBox_reduceColors.UseVisualStyleBackColor = true;
// //
// QualityDialog // QualityDialog
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.ClientSize = new System.Drawing.Size(299, 184); this.ClientSize = new System.Drawing.Size(299, 184);
this.ControlBox = false; this.ControlBox = false;
this.Controls.Add(this.checkBox_reduceColors); this.Controls.Add(this.checkBox_reduceColors);
this.Controls.Add(this.button_ok); this.Controls.Add(this.button_ok);
this.Controls.Add(this.checkbox_dontaskagain); this.Controls.Add(this.checkbox_dontaskagain);
this.Controls.Add(this.label_choosejpegquality); this.Controls.Add(this.label_choosejpegquality);
this.Controls.Add(this.textBoxJpegQuality); this.Controls.Add(this.textBoxJpegQuality);
this.Controls.Add(this.trackBarJpegQuality); this.Controls.Add(this.trackBarJpegQuality);
this.MaximizeBox = false; this.MaximizeBox = false;
this.MinimizeBox = false; this.MinimizeBox = false;
this.Name = "QualityDialog"; this.Name = "QualityDialog";
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
this.LanguageKey = "qualitydialog_title"; this.LanguageKey = "qualitydialog_title";
((System.ComponentModel.ISupportInitialize)(this.trackBarJpegQuality)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.trackBarJpegQuality)).EndInit();
this.ResumeLayout(false); this.ResumeLayout(false);
this.PerformLayout(); this.PerformLayout();
} }
private GreenshotPlugin.Controls.GreenshotButton button_ok; private GreenshotButton button_ok;
private GreenshotPlugin.Controls.GreenshotCheckBox checkbox_dontaskagain; private GreenshotCheckBox checkbox_dontaskagain;
private System.Windows.Forms.TrackBar trackBarJpegQuality; private System.Windows.Forms.TrackBar trackBarJpegQuality;
private System.Windows.Forms.TextBox textBoxJpegQuality; private System.Windows.Forms.TextBox textBoxJpegQuality;
private GreenshotPlugin.Controls.GreenshotLabel label_choosejpegquality; private GreenshotLabel label_choosejpegquality;
private System.Windows.Forms.CheckBox checkBox_reduceColors; private System.Windows.Forms.CheckBox checkBox_reduceColors;
} }
} }

View file

@ -1,71 +1,71 @@
/* /*
* Greenshot - a free and open source screenshot tool * Greenshot - a free and open source screenshot tool
* Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom
* *
* For more information see: http://getgreenshot.org/ * For more information see: http://getgreenshot.org/
* The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 1 of the License, or * the Free Software Foundation, either version 1 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
using System; using System;
using GreenshotPlugin.Core; using Greenshot.Base.Core;
using GreenshotPlugin.IniFile; using Greenshot.Base.IniFile;
using GreenshotPlugin.Interfaces.Plugin; using Greenshot.Base.Interfaces.Plugin;
namespace GreenshotPlugin.Controls namespace Greenshot.Base.Controls
{ {
/// <summary> /// <summary>
/// Description of JpegQualityDialog. /// Description of JpegQualityDialog.
/// </summary> /// </summary>
public partial class QualityDialog : GreenshotForm public partial class QualityDialog : GreenshotForm
{ {
private static readonly CoreConfiguration conf = IniConfig.GetIniSection<CoreConfiguration>(); private static readonly CoreConfiguration conf = IniConfig.GetIniSection<CoreConfiguration>();
public SurfaceOutputSettings Settings { get; set; } public SurfaceOutputSettings Settings { get; set; }
public QualityDialog(SurfaceOutputSettings outputSettings) public QualityDialog(SurfaceOutputSettings outputSettings)
{ {
Settings = outputSettings; Settings = outputSettings;
// //
// The InitializeComponent() call is required for Windows Forms designer support. // The InitializeComponent() call is required for Windows Forms designer support.
// //
InitializeComponent(); InitializeComponent();
checkBox_reduceColors.Checked = Settings.ReduceColors; checkBox_reduceColors.Checked = Settings.ReduceColors;
trackBarJpegQuality.Enabled = OutputFormat.jpg.Equals(outputSettings.Format); trackBarJpegQuality.Enabled = OutputFormat.jpg.Equals(outputSettings.Format);
trackBarJpegQuality.Value = Settings.JPGQuality; trackBarJpegQuality.Value = Settings.JPGQuality;
textBoxJpegQuality.Enabled = OutputFormat.jpg.Equals(outputSettings.Format); textBoxJpegQuality.Enabled = OutputFormat.jpg.Equals(outputSettings.Format);
textBoxJpegQuality.Text = Settings.JPGQuality.ToString(); textBoxJpegQuality.Text = Settings.JPGQuality.ToString();
ToFront = true; ToFront = true;
} }
private void Button_okClick(object sender, EventArgs e) private void Button_okClick(object sender, EventArgs e)
{ {
Settings.JPGQuality = trackBarJpegQuality.Value; Settings.JPGQuality = trackBarJpegQuality.Value;
Settings.ReduceColors = checkBox_reduceColors.Checked; Settings.ReduceColors = checkBox_reduceColors.Checked;
if (checkbox_dontaskagain.Checked) if (checkbox_dontaskagain.Checked)
{ {
conf.OutputFileJpegQuality = Settings.JPGQuality; conf.OutputFileJpegQuality = Settings.JPGQuality;
conf.OutputFilePromptQuality = false; conf.OutputFilePromptQuality = false;
conf.OutputFileReduceColors = Settings.ReduceColors; conf.OutputFileReduceColors = Settings.ReduceColors;
IniConfig.Save(); IniConfig.Save();
} }
} }
private void TrackBarJpegQualityScroll(object sender, EventArgs e) private void TrackBarJpegQualityScroll(object sender, EventArgs e)
{ {
textBoxJpegQuality.Text = trackBarJpegQuality.Value.ToString(); textBoxJpegQuality.Text = trackBarJpegQuality.Value.ToString();
} }
} }
} }

View file

@ -1,235 +1,235 @@
/* /*
* Greenshot - a free and open source screenshot tool * Greenshot - a free and open source screenshot tool
* Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom
* *
* For more information see: http://getgreenshot.org/ * For more information see: http://getgreenshot.org/
* The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 1 of the License, or * the Free Software Foundation, either version 1 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
using System; using System;
using System.IO; using System.IO;
using System.Windows.Forms; using System.Windows.Forms;
using GreenshotPlugin.Core; using Greenshot.Base.Core;
using GreenshotPlugin.IniFile; using Greenshot.Base.IniFile;
using GreenshotPlugin.Interfaces; using Greenshot.Base.Interfaces;
using log4net; using log4net;
namespace GreenshotPlugin.Controls namespace Greenshot.Base.Controls
{ {
/// <summary> /// <summary>
/// Custom dialog for saving images, wraps SaveFileDialog. /// Custom dialog for saving images, wraps SaveFileDialog.
/// For some reason SFD is sealed :( /// For some reason SFD is sealed :(
/// </summary> /// </summary>
public class SaveImageFileDialog : IDisposable public class SaveImageFileDialog : IDisposable
{ {
private static readonly ILog LOG = LogManager.GetLogger(typeof(SaveImageFileDialog)); private static readonly ILog LOG = LogManager.GetLogger(typeof(SaveImageFileDialog));
private static readonly CoreConfiguration conf = IniConfig.GetIniSection<CoreConfiguration>(); private static readonly CoreConfiguration conf = IniConfig.GetIniSection<CoreConfiguration>();
protected SaveFileDialog SaveFileDialog; protected SaveFileDialog SaveFileDialog;
private FilterOption[] _filterOptions; private FilterOption[] _filterOptions;
private DirectoryInfo _eagerlyCreatedDirectory; private DirectoryInfo _eagerlyCreatedDirectory;
private readonly ICaptureDetails _captureDetails; private readonly ICaptureDetails _captureDetails;
public void Dispose() public void Dispose()
{ {
Dispose(true); Dispose(true);
GC.SuppressFinalize(this); GC.SuppressFinalize(this);
} }
protected virtual void Dispose(bool disposing) protected virtual void Dispose(bool disposing)
{ {
if (disposing) if (disposing)
{ {
if (SaveFileDialog != null) if (SaveFileDialog != null)
{ {
SaveFileDialog.Dispose(); SaveFileDialog.Dispose();
SaveFileDialog = null; SaveFileDialog = null;
} }
} }
} }
public SaveImageFileDialog(ICaptureDetails captureDetails) public SaveImageFileDialog(ICaptureDetails captureDetails)
{ {
_captureDetails = captureDetails; _captureDetails = captureDetails;
Init(); Init();
} }
private void Init() private void Init()
{ {
SaveFileDialog = new SaveFileDialog(); SaveFileDialog = new SaveFileDialog();
ApplyFilterOptions(); ApplyFilterOptions();
string initialDirectory = null; string initialDirectory = null;
try try
{ {
conf.ValidateAndCorrectOutputFileAsFullpath(); conf.ValidateAndCorrectOutputFileAsFullpath();
initialDirectory = Path.GetDirectoryName(conf.OutputFileAsFullpath); initialDirectory = Path.GetDirectoryName(conf.OutputFileAsFullpath);
} }
catch catch
{ {
LOG.WarnFormat("OutputFileAsFullpath was set to {0}, ignoring due to problem in path.", conf.OutputFileAsFullpath); LOG.WarnFormat("OutputFileAsFullpath was set to {0}, ignoring due to problem in path.", conf.OutputFileAsFullpath);
} }
if (!string.IsNullOrEmpty(initialDirectory) && Directory.Exists(initialDirectory)) if (!string.IsNullOrEmpty(initialDirectory) && Directory.Exists(initialDirectory))
{ {
SaveFileDialog.InitialDirectory = initialDirectory; SaveFileDialog.InitialDirectory = initialDirectory;
} }
else if (Directory.Exists(conf.OutputFilePath)) else if (Directory.Exists(conf.OutputFilePath))
{ {
SaveFileDialog.InitialDirectory = conf.OutputFilePath; SaveFileDialog.InitialDirectory = conf.OutputFilePath;
} }
// The following property fixes a problem that the directory where we save is locked (bug #2899790) // The following property fixes a problem that the directory where we save is locked (bug #2899790)
SaveFileDialog.RestoreDirectory = true; SaveFileDialog.RestoreDirectory = true;
SaveFileDialog.OverwritePrompt = true; SaveFileDialog.OverwritePrompt = true;
SaveFileDialog.CheckPathExists = false; SaveFileDialog.CheckPathExists = false;
SaveFileDialog.AddExtension = true; SaveFileDialog.AddExtension = true;
ApplySuggestedValues(); ApplySuggestedValues();
} }
private void ApplyFilterOptions() private void ApplyFilterOptions()
{ {
PrepareFilterOptions(); PrepareFilterOptions();
string fdf = string.Empty; string fdf = string.Empty;
int preselect = 0; int preselect = 0;
var outputFileFormatAsString = Enum.GetName(typeof(OutputFormat), conf.OutputFileFormat); var outputFileFormatAsString = Enum.GetName(typeof(OutputFormat), conf.OutputFileFormat);
for (int i = 0; i < _filterOptions.Length; i++) for (int i = 0; i < _filterOptions.Length; i++)
{ {
FilterOption fo = _filterOptions[i]; FilterOption fo = _filterOptions[i];
fdf += fo.Label + "|*." + fo.Extension + "|"; fdf += fo.Label + "|*." + fo.Extension + "|";
if (outputFileFormatAsString == fo.Extension) if (outputFileFormatAsString == fo.Extension)
preselect = i; preselect = i;
} }
fdf = fdf.Substring(0, fdf.Length - 1); fdf = fdf.Substring(0, fdf.Length - 1);
SaveFileDialog.Filter = fdf; SaveFileDialog.Filter = fdf;
SaveFileDialog.FilterIndex = preselect + 1; SaveFileDialog.FilterIndex = preselect + 1;
} }
private void PrepareFilterOptions() private void PrepareFilterOptions()
{ {
OutputFormat[] supportedImageFormats = (OutputFormat[]) Enum.GetValues(typeof(OutputFormat)); OutputFormat[] supportedImageFormats = (OutputFormat[]) Enum.GetValues(typeof(OutputFormat));
_filterOptions = new FilterOption[supportedImageFormats.Length]; _filterOptions = new FilterOption[supportedImageFormats.Length];
for (int i = 0; i < _filterOptions.Length; i++) for (int i = 0; i < _filterOptions.Length; i++)
{ {
string ifo = supportedImageFormats[i].ToString(); string ifo = supportedImageFormats[i].ToString();
if (ifo.ToLower().Equals("jpeg")) ifo = "Jpg"; // we dont want no jpeg files, so let the dialog check for jpg if (ifo.ToLower().Equals("jpeg")) ifo = "Jpg"; // we dont want no jpeg files, so let the dialog check for jpg
FilterOption fo = new FilterOption FilterOption fo = new FilterOption
{ {
Label = ifo.ToUpper(), Label = ifo.ToUpper(),
Extension = ifo.ToLower() Extension = ifo.ToLower()
}; };
_filterOptions.SetValue(fo, i); _filterOptions.SetValue(fo, i);
} }
} }
/// <summary> /// <summary>
/// filename exactly as typed in the filename field /// filename exactly as typed in the filename field
/// </summary> /// </summary>
public string FileName public string FileName
{ {
get { return SaveFileDialog.FileName; } get { return SaveFileDialog.FileName; }
set { SaveFileDialog.FileName = value; } set { SaveFileDialog.FileName = value; }
} }
/// <summary> /// <summary>
/// initial directory of the dialog /// initial directory of the dialog
/// </summary> /// </summary>
public string InitialDirectory public string InitialDirectory
{ {
get { return SaveFileDialog.InitialDirectory; } get { return SaveFileDialog.InitialDirectory; }
set { SaveFileDialog.InitialDirectory = value; } set { SaveFileDialog.InitialDirectory = value; }
} }
/// <summary> /// <summary>
/// returns filename as typed in the filename field with extension. /// returns filename as typed in the filename field with extension.
/// if filename field value ends with selected extension, the value is just returned. /// if filename field value ends with selected extension, the value is just returned.
/// otherwise, the selected extension is appended to the filename. /// otherwise, the selected extension is appended to the filename.
/// </summary> /// </summary>
public string FileNameWithExtension public string FileNameWithExtension
{ {
get get
{ {
string fn = SaveFileDialog.FileName; string fn = SaveFileDialog.FileName;
// if the filename contains a valid extension, which is the same like the selected filter item's extension, the filename is okay // if the filename contains a valid extension, which is the same like the selected filter item's extension, the filename is okay
if (fn.EndsWith(Extension, StringComparison.CurrentCultureIgnoreCase)) return fn; if (fn.EndsWith(Extension, StringComparison.CurrentCultureIgnoreCase)) return fn;
// otherwise we just add the selected filter item's extension // otherwise we just add the selected filter item's extension
else return fn + "." + Extension; else return fn + "." + Extension;
} }
set set
{ {
FileName = Path.GetFileNameWithoutExtension(value); FileName = Path.GetFileNameWithoutExtension(value);
Extension = Path.GetExtension(value); Extension = Path.GetExtension(value);
} }
} }
/// <summary> /// <summary>
/// gets or sets selected extension /// gets or sets selected extension
/// </summary> /// </summary>
public string Extension public string Extension
{ {
get { return _filterOptions[SaveFileDialog.FilterIndex - 1].Extension; } get { return _filterOptions[SaveFileDialog.FilterIndex - 1].Extension; }
set set
{ {
for (int i = 0; i < _filterOptions.Length; i++) for (int i = 0; i < _filterOptions.Length; i++)
{ {
if (value.Equals(_filterOptions[i].Extension, StringComparison.CurrentCultureIgnoreCase)) if (value.Equals(_filterOptions[i].Extension, StringComparison.CurrentCultureIgnoreCase))
{ {
SaveFileDialog.FilterIndex = i + 1; SaveFileDialog.FilterIndex = i + 1;
} }
} }
} }
} }
public DialogResult ShowDialog() public DialogResult ShowDialog()
{ {
DialogResult ret = SaveFileDialog.ShowDialog(); DialogResult ret = SaveFileDialog.ShowDialog();
CleanUp(); CleanUp();
return ret; return ret;
} }
/// <summary> /// <summary>
/// sets InitialDirectory and FileName property of a SaveFileDialog smartly, considering default pattern and last used path /// sets InitialDirectory and FileName property of a SaveFileDialog smartly, considering default pattern and last used path
/// </summary> /// </summary>
private void ApplySuggestedValues() private void ApplySuggestedValues()
{ {
// build the full path and set dialog properties // build the full path and set dialog properties
FileName = FilenameHelper.GetFilenameWithoutExtensionFromPattern(conf.OutputFileFilenamePattern, _captureDetails); FileName = FilenameHelper.GetFilenameWithoutExtensionFromPattern(conf.OutputFileFilenamePattern, _captureDetails);
} }
private class FilterOption private class FilterOption
{ {
public string Label; public string Label;
public string Extension; public string Extension;
} }
private void CleanUp() private void CleanUp()
{ {
// fix for bug #3379053 // fix for bug #3379053
try try
{ {
if (_eagerlyCreatedDirectory != null && _eagerlyCreatedDirectory.GetFiles().Length == 0 && _eagerlyCreatedDirectory.GetDirectories().Length == 0) if (_eagerlyCreatedDirectory != null && _eagerlyCreatedDirectory.GetFiles().Length == 0 && _eagerlyCreatedDirectory.GetDirectories().Length == 0)
{ {
_eagerlyCreatedDirectory.Delete(); _eagerlyCreatedDirectory.Delete();
_eagerlyCreatedDirectory = null; _eagerlyCreatedDirectory = null;
} }
} }
catch (Exception e) catch (Exception e)
{ {
LOG.WarnFormat("Couldn't cleanup directory due to: {0}", e.Message); LOG.WarnFormat("Couldn't cleanup directory due to: {0}", e.Message);
_eagerlyCreatedDirectory = null; _eagerlyCreatedDirectory = null;
} }
} }
} }
} }

View file

@ -1,157 +1,156 @@
/* /*
* Greenshot - a free and open source screenshot tool * Greenshot - a free and open source screenshot tool
* Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom
* *
* For more information see: http://getgreenshot.org/ * For more information see: http://getgreenshot.org/
* The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 1 of the License, or * the Free Software Foundation, either version 1 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
using System; using System;
using System.Windows.Forms; using System.Drawing;
using GreenshotPlugin.Core; using System.Windows.Forms;
using System.Drawing; using Greenshot.Base.Core;
using GreenshotPlugin.Core.Enums; using Greenshot.Base.IniFile;
using GreenshotPlugin.IniFile; using Greenshot.Base.UnmanagedHelpers;
using GreenshotPlugin.UnmanagedHelpers; using Greenshot.Base.UnmanagedHelpers.Enums;
using GreenshotPlugin.UnmanagedHelpers.Enums; using Greenshot.Base.UnmanagedHelpers.Structs;
using GreenshotPlugin.UnmanagedHelpers.Structs;
namespace Greenshot.Base.Controls
namespace GreenshotPlugin.Controls {
{ /// <summary>
/// <summary> /// This form allows us to show a Thumbnail preview of a window near the context menu when selecting a window to capture.
/// This form allows us to show a Thumbnail preview of a window near the context menu when selecting a window to capture. /// Didn't make it completely "generic" yet, but at least most logic is in here so we don't have it in the mainform.
/// Didn't make it completely "generic" yet, but at least most logic is in here so we don't have it in the mainform. /// </summary>
/// </summary> public sealed class ThumbnailForm : FormWithoutActivation
public sealed class ThumbnailForm : FormWithoutActivation {
{ private static readonly CoreConfiguration conf = IniConfig.GetIniSection<CoreConfiguration>();
private static readonly CoreConfiguration conf = IniConfig.GetIniSection<CoreConfiguration>();
private IntPtr _thumbnailHandle = IntPtr.Zero;
private IntPtr _thumbnailHandle = IntPtr.Zero;
public ThumbnailForm()
public ThumbnailForm() {
{ ShowInTaskbar = false;
ShowInTaskbar = false; FormBorderStyle = FormBorderStyle.None;
FormBorderStyle = FormBorderStyle.None; TopMost = false;
TopMost = false; Enabled = false;
Enabled = false; if (conf.WindowCaptureMode == WindowCaptureMode.Auto || conf.WindowCaptureMode == WindowCaptureMode.Aero)
if (conf.WindowCaptureMode == WindowCaptureMode.Auto || conf.WindowCaptureMode == WindowCaptureMode.Aero) {
{ BackColor = Color.FromArgb(255, conf.DWMBackgroundColor.R, conf.DWMBackgroundColor.G, conf.DWMBackgroundColor.B);
BackColor = Color.FromArgb(255, conf.DWMBackgroundColor.R, conf.DWMBackgroundColor.G, conf.DWMBackgroundColor.B); }
} else
else {
{ BackColor = Color.White;
BackColor = Color.White; }
}
// cleanup at close
// cleanup at close FormClosing += delegate { UnregisterThumbnail(); };
FormClosing += delegate { UnregisterThumbnail(); }; }
}
public new void Hide()
public new void Hide() {
{ UnregisterThumbnail();
UnregisterThumbnail(); base.Hide();
base.Hide(); }
}
private void UnregisterThumbnail()
private void UnregisterThumbnail() {
{ if (_thumbnailHandle == IntPtr.Zero) return;
if (_thumbnailHandle == IntPtr.Zero) return;
DWM.DwmUnregisterThumbnail(_thumbnailHandle);
DWM.DwmUnregisterThumbnail(_thumbnailHandle); _thumbnailHandle = IntPtr.Zero;
_thumbnailHandle = IntPtr.Zero; }
}
/// <summary>
/// <summary> /// Show the thumbnail of the supplied window above (or under) the parent Control
/// Show the thumbnail of the supplied window above (or under) the parent Control /// </summary>
/// </summary> /// <param name="window">WindowDetails</param>
/// <param name="window">WindowDetails</param> /// <param name="parentControl">Control</param>
/// <param name="parentControl">Control</param> public void ShowThumbnail(WindowDetails window, Control parentControl)
public void ShowThumbnail(WindowDetails window, Control parentControl) {
{ UnregisterThumbnail();
UnregisterThumbnail();
DWM.DwmRegisterThumbnail(Handle, window.Handle, out _thumbnailHandle);
DWM.DwmRegisterThumbnail(Handle, window.Handle, out _thumbnailHandle); if (_thumbnailHandle == IntPtr.Zero) return;
if (_thumbnailHandle == IntPtr.Zero) return;
var result = DWM.DwmQueryThumbnailSourceSize(_thumbnailHandle, out var sourceSize);
var result = DWM.DwmQueryThumbnailSourceSize(_thumbnailHandle, out var sourceSize); if (result.Failed())
if (result.Failed()) {
{ DWM.DwmUnregisterThumbnail(_thumbnailHandle);
DWM.DwmUnregisterThumbnail(_thumbnailHandle); return;
return; }
}
if (sourceSize.IsEmpty)
if (sourceSize.IsEmpty) {
{ DWM.DwmUnregisterThumbnail(_thumbnailHandle);
DWM.DwmUnregisterThumbnail(_thumbnailHandle); return;
return; }
}
int thumbnailHeight = 200;
int thumbnailHeight = 200; int thumbnailWidth = (int) (thumbnailHeight * (sourceSize.Width / (float) sourceSize.Height));
int thumbnailWidth = (int) (thumbnailHeight * (sourceSize.Width / (float) sourceSize.Height)); if (parentControl != null && thumbnailWidth > parentControl.Width)
if (parentControl != null && thumbnailWidth > parentControl.Width) {
{ thumbnailWidth = parentControl.Width;
thumbnailWidth = parentControl.Width; thumbnailHeight = (int) (thumbnailWidth * (sourceSize.Height / (float) sourceSize.Width));
thumbnailHeight = (int) (thumbnailWidth * (sourceSize.Height / (float) sourceSize.Width)); }
}
Width = thumbnailWidth;
Width = thumbnailWidth; Height = thumbnailHeight;
Height = thumbnailHeight; // Prepare the displaying of the Thumbnail
// Prepare the displaying of the Thumbnail var dwmThumbnailProperties = new DWM_THUMBNAIL_PROPERTIES
var dwmThumbnailProperties = new DWM_THUMBNAIL_PROPERTIES {
{ Opacity = 255,
Opacity = 255, Visible = true,
Visible = true, SourceClientAreaOnly = false,
SourceClientAreaOnly = false, Destination = new RECT(0, 0, thumbnailWidth, thumbnailHeight)
Destination = new RECT(0, 0, thumbnailWidth, thumbnailHeight) };
}; result = DWM.DwmUpdateThumbnailProperties(_thumbnailHandle, ref dwmThumbnailProperties);
result = DWM.DwmUpdateThumbnailProperties(_thumbnailHandle, ref dwmThumbnailProperties); if (result.Failed())
if (result.Failed()) {
{ DWM.DwmUnregisterThumbnail(_thumbnailHandle);
DWM.DwmUnregisterThumbnail(_thumbnailHandle); return;
return; }
}
if (parentControl != null)
if (parentControl != null) {
{ AlignToControl(parentControl);
AlignToControl(parentControl); }
}
if (!Visible)
if (!Visible) {
{ Show();
Show(); }
}
// Make sure it's on "top"!
// Make sure it's on "top"! if (parentControl != null)
if (parentControl != null) {
{ User32.SetWindowPos(Handle, parentControl.Handle, 0, 0, 0, 0, WindowPos.SWP_NOMOVE | WindowPos.SWP_NOSIZE | WindowPos.SWP_NOACTIVATE);
User32.SetWindowPos(Handle, parentControl.Handle, 0, 0, 0, 0, WindowPos.SWP_NOMOVE | WindowPos.SWP_NOSIZE | WindowPos.SWP_NOACTIVATE); }
} }
}
public void AlignToControl(Control alignTo)
public void AlignToControl(Control alignTo) {
{ var screenBounds = WindowCapture.GetScreenBounds();
var screenBounds = WindowCapture.GetScreenBounds(); if (screenBounds.Contains(alignTo.Left, alignTo.Top - Height))
if (screenBounds.Contains(alignTo.Left, alignTo.Top - Height)) {
{ Location = new Point(alignTo.Left + (alignTo.Width / 2) - (Width / 2), alignTo.Top - Height);
Location = new Point(alignTo.Left + (alignTo.Width / 2) - (Width / 2), alignTo.Top - Height); }
} else
else {
{ Location = new Point(alignTo.Left + (alignTo.Width / 2) - (Width / 2), alignTo.Bottom);
Location = new Point(alignTo.Left + (alignTo.Width / 2) - (Width / 2), alignTo.Bottom); }
} }
} }
}
} }

View file

@ -1,416 +1,416 @@
/* /*
* Greenshot - a free and open source screenshot tool * Greenshot - a free and open source screenshot tool
* Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom
* *
* For more information see: http://getgreenshot.org/ * For more information see: http://getgreenshot.org/
* The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 1 of the License, or * the Free Software Foundation, either version 1 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Drawing; using System.Drawing;
using System.Threading; using System.Threading;
using System.Windows.Forms; using System.Windows.Forms;
using GreenshotPlugin.IniFile; using Greenshot.Base.IniFile;
using GreenshotPlugin.Interfaces; using Greenshot.Base.Interfaces;
using GreenshotPlugin.UnmanagedHelpers; using Greenshot.Base.UnmanagedHelpers;
using log4net; using log4net;
namespace GreenshotPlugin.Core namespace Greenshot.Base.Core
{ {
/// <summary> /// <summary>
/// Description of AbstractDestination. /// Description of AbstractDestination.
/// </summary> /// </summary>
public abstract class AbstractDestination : IDestination public abstract class AbstractDestination : IDestination
{ {
private static readonly ILog Log = LogManager.GetLogger(typeof(AbstractDestination)); private static readonly ILog Log = LogManager.GetLogger(typeof(AbstractDestination));
private static readonly CoreConfiguration CoreConfig = IniConfig.GetIniSection<CoreConfiguration>(); private static readonly CoreConfiguration CoreConfig = IniConfig.GetIniSection<CoreConfiguration>();
public virtual int CompareTo(object obj) public virtual int CompareTo(object obj)
{ {
if (!(obj is IDestination other)) if (!(obj is IDestination other))
{ {
return 1; return 1;
} }
if (Priority == other.Priority) if (Priority == other.Priority)
{ {
return string.Compare(Description, other.Description, StringComparison.Ordinal); return string.Compare(Description, other.Description, StringComparison.Ordinal);
} }
return Priority - other.Priority; return Priority - other.Priority;
} }
public abstract string Designation { get; } public abstract string Designation { get; }
public abstract string Description { get; } public abstract string Description { get; }
public virtual int Priority => 10; public virtual int Priority => 10;
public virtual Image DisplayIcon => null; public virtual Image DisplayIcon => null;
public virtual Keys EditorShortcutKeys => Keys.None; public virtual Keys EditorShortcutKeys => Keys.None;
public virtual IEnumerable<IDestination> DynamicDestinations() public virtual IEnumerable<IDestination> DynamicDestinations()
{ {
yield break; yield break;
} }
public void Dispose() public void Dispose()
{ {
Dispose(true); Dispose(true);
GC.SuppressFinalize(this); GC.SuppressFinalize(this);
} }
protected virtual void Dispose(bool disposing) protected virtual void Dispose(bool disposing)
{ {
//if (disposing) {} //if (disposing) {}
} }
public virtual bool IsDynamic => false; public virtual bool IsDynamic => false;
public virtual bool UseDynamicsOnly => false; public virtual bool UseDynamicsOnly => false;
public virtual bool IsLinkable => false; public virtual bool IsLinkable => false;
public virtual bool IsActive public virtual bool IsActive
{ {
get get
{ {
if (CoreConfig.ExcludeDestinations != null && CoreConfig.ExcludeDestinations.Contains(Designation)) if (CoreConfig.ExcludeDestinations != null && CoreConfig.ExcludeDestinations.Contains(Designation))
{ {
return false; return false;
} }
return true; return true;
} }
} }
public abstract ExportInformation ExportCapture(bool manuallyInitiated, ISurface surface, ICaptureDetails captureDetails); public abstract ExportInformation ExportCapture(bool manuallyInitiated, ISurface surface, ICaptureDetails captureDetails);
/// <summary> /// <summary>
/// A small helper method to perform some default destination actions, like inform the surface of the export /// A small helper method to perform some default destination actions, like inform the surface of the export
/// </summary> /// </summary>
/// <param name="exportInformation"></param> /// <param name="exportInformation"></param>
/// <param name="surface"></param> /// <param name="surface"></param>
public void ProcessExport(ExportInformation exportInformation, ISurface surface) public void ProcessExport(ExportInformation exportInformation, ISurface surface)
{ {
if (exportInformation != null && exportInformation.ExportMade) if (exportInformation != null && exportInformation.ExportMade)
{ {
if (!string.IsNullOrEmpty(exportInformation.Uri)) if (!string.IsNullOrEmpty(exportInformation.Uri))
{ {
surface.UploadUrl = exportInformation.Uri; surface.UploadUrl = exportInformation.Uri;
surface.SendMessageEvent(this, SurfaceMessageTyp.UploadedUri, Language.GetFormattedString("exported_to", exportInformation.DestinationDescription)); surface.SendMessageEvent(this, SurfaceMessageTyp.UploadedUri, Language.GetFormattedString("exported_to", exportInformation.DestinationDescription));
} }
else if (!string.IsNullOrEmpty(exportInformation.Filepath)) else if (!string.IsNullOrEmpty(exportInformation.Filepath))
{ {
surface.LastSaveFullPath = exportInformation.Filepath; surface.LastSaveFullPath = exportInformation.Filepath;
surface.SendMessageEvent(this, SurfaceMessageTyp.FileSaved, Language.GetFormattedString("exported_to", exportInformation.DestinationDescription)); surface.SendMessageEvent(this, SurfaceMessageTyp.FileSaved, Language.GetFormattedString("exported_to", exportInformation.DestinationDescription));
} }
else else
{ {
surface.SendMessageEvent(this, SurfaceMessageTyp.Info, Language.GetFormattedString("exported_to", exportInformation.DestinationDescription)); surface.SendMessageEvent(this, SurfaceMessageTyp.Info, Language.GetFormattedString("exported_to", exportInformation.DestinationDescription));
} }
surface.Modified = false; surface.Modified = false;
} }
else if (!string.IsNullOrEmpty(exportInformation?.ErrorMessage)) else if (!string.IsNullOrEmpty(exportInformation?.ErrorMessage))
{ {
surface.SendMessageEvent(this, SurfaceMessageTyp.Error, surface.SendMessageEvent(this, SurfaceMessageTyp.Error,
Language.GetFormattedString("exported_to_error", exportInformation.DestinationDescription) + " " + exportInformation.ErrorMessage); Language.GetFormattedString("exported_to_error", exportInformation.DestinationDescription) + " " + exportInformation.ErrorMessage);
} }
} }
public override string ToString() public override string ToString()
{ {
return Description; return Description;
} }
/// <summary> /// <summary>
/// Helper method to add events which set the tag, this way we can see why there might be a close. /// Helper method to add events which set the tag, this way we can see why there might be a close.
/// </summary> /// </summary>
/// <param name="menuItem">Item to add the events to</param> /// <param name="menuItem">Item to add the events to</param>
/// <param name="menu">Menu to set the tag</param> /// <param name="menu">Menu to set the tag</param>
/// <param name="tagValue">Value for the tag</param> /// <param name="tagValue">Value for the tag</param>
private void AddTagEvents(ToolStripMenuItem menuItem, ContextMenuStrip menu, string tagValue) private void AddTagEvents(ToolStripMenuItem menuItem, ContextMenuStrip menu, string tagValue)
{ {
if (menuItem != null && menu != null) if (menuItem != null && menu != null)
{ {
menuItem.MouseDown += delegate menuItem.MouseDown += delegate
{ {
Log.DebugFormat("Setting tag to '{0}'", tagValue); Log.DebugFormat("Setting tag to '{0}'", tagValue);
menu.Tag = tagValue; menu.Tag = tagValue;
}; };
menuItem.MouseUp += delegate menuItem.MouseUp += delegate
{ {
Log.Debug("Deleting tag"); Log.Debug("Deleting tag");
menu.Tag = null; menu.Tag = null;
}; };
} }
} }
/// <summary> /// <summary>
/// This method will create and show the destination picker menu /// This method will create and show the destination picker menu
/// </summary> /// </summary>
/// <param name="addDynamics">Boolean if the dynamic values also need to be added</param> /// <param name="addDynamics">Boolean if the dynamic values also need to be added</param>
/// <param name="surface">The surface which can be exported</param> /// <param name="surface">The surface which can be exported</param>
/// <param name="captureDetails">Details for the surface</param> /// <param name="captureDetails">Details for the surface</param>
/// <param name="destinations">The list of destinations to show</param> /// <param name="destinations">The list of destinations to show</param>
/// <returns></returns> /// <returns></returns>
public ExportInformation ShowPickerMenu(bool addDynamics, ISurface surface, ICaptureDetails captureDetails, IEnumerable<IDestination> destinations) public ExportInformation ShowPickerMenu(bool addDynamics, ISurface surface, ICaptureDetails captureDetails, IEnumerable<IDestination> destinations)
{ {
// Generate an empty ExportInformation object, for when nothing was selected. // Generate an empty ExportInformation object, for when nothing was selected.
ExportInformation exportInformation = new ExportInformation(Designation, Language.GetString("settings_destination_picker")); ExportInformation exportInformation = new ExportInformation(Designation, Language.GetString("settings_destination_picker"));
var menu = new ContextMenuStrip var menu = new ContextMenuStrip
{ {
ImageScalingSize = CoreConfig.ScaledIconSize, ImageScalingSize = CoreConfig.ScaledIconSize,
Tag = null, Tag = null,
TopLevel = true TopLevel = true
}; };
menu.Opening += (sender, args) => menu.Opening += (sender, args) =>
{ {
// find the DPI settings for the screen where this is going to land // find the DPI settings for the screen where this is going to land
var screenDpi = DpiHelper.GetDpi(menu.Location); var screenDpi = DpiHelper.GetDpi(menu.Location);
var scaledIconSize = DpiHelper.ScaleWithDpi(CoreConfig.IconSize, screenDpi); var scaledIconSize = DpiHelper.ScaleWithDpi(CoreConfig.IconSize, screenDpi);
menu.SuspendLayout(); menu.SuspendLayout();
var fontSize = DpiHelper.ScaleWithDpi(12f, screenDpi); var fontSize = DpiHelper.ScaleWithDpi(12f, screenDpi);
menu.Font = new Font(FontFamily.GenericSansSerif, fontSize, FontStyle.Regular, GraphicsUnit.Pixel); menu.Font = new Font(FontFamily.GenericSansSerif, fontSize, FontStyle.Regular, GraphicsUnit.Pixel);
menu.ImageScalingSize = scaledIconSize; menu.ImageScalingSize = scaledIconSize;
menu.ResumeLayout(); menu.ResumeLayout();
}; };
menu.Closing += delegate(object source, ToolStripDropDownClosingEventArgs eventArgs) menu.Closing += delegate(object source, ToolStripDropDownClosingEventArgs eventArgs)
{ {
Log.DebugFormat("Close reason: {0}", eventArgs.CloseReason); Log.DebugFormat("Close reason: {0}", eventArgs.CloseReason);
switch (eventArgs.CloseReason) switch (eventArgs.CloseReason)
{ {
case ToolStripDropDownCloseReason.AppFocusChange: case ToolStripDropDownCloseReason.AppFocusChange:
if (menu.Tag == null) if (menu.Tag == null)
{ {
// Do not allow the close if the tag is not set, this means the user clicked somewhere else. // Do not allow the close if the tag is not set, this means the user clicked somewhere else.
eventArgs.Cancel = true; eventArgs.Cancel = true;
} }
else else
{ {
Log.DebugFormat("Letting the menu 'close' as the tag is set to '{0}'", menu.Tag); Log.DebugFormat("Letting the menu 'close' as the tag is set to '{0}'", menu.Tag);
} }
break; break;
case ToolStripDropDownCloseReason.ItemClicked: case ToolStripDropDownCloseReason.ItemClicked:
case ToolStripDropDownCloseReason.CloseCalled: case ToolStripDropDownCloseReason.CloseCalled:
// The ContextMenuStrip can be "closed" for these reasons. // The ContextMenuStrip can be "closed" for these reasons.
break; break;
case ToolStripDropDownCloseReason.Keyboard: case ToolStripDropDownCloseReason.Keyboard:
// Dispose as the close is clicked // Dispose as the close is clicked
if (!captureDetails.HasDestination("Editor")) if (!captureDetails.HasDestination("Editor"))
{ {
surface.Dispose(); surface.Dispose();
surface = null; surface = null;
} }
break; break;
default: default:
eventArgs.Cancel = true; eventArgs.Cancel = true;
break; break;
} }
}; };
menu.MouseEnter += delegate menu.MouseEnter += delegate
{ {
// in case the menu has been unfocused, focus again so that dropdown menus will still open on mouseenter // in case the menu has been unfocused, focus again so that dropdown menus will still open on mouseenter
if (!menu.ContainsFocus) if (!menu.ContainsFocus)
{ {
menu.Focus(); menu.Focus();
} }
}; };
foreach (IDestination destination in destinations) foreach (IDestination destination in destinations)
{ {
// Fix foreach loop variable for the delegate // Fix foreach loop variable for the delegate
ToolStripMenuItem item = destination.GetMenuItem(addDynamics, menu, ToolStripMenuItem item = destination.GetMenuItem(addDynamics, menu,
delegate(object sender, EventArgs e) delegate(object sender, EventArgs e)
{ {
ToolStripMenuItem toolStripMenuItem = sender as ToolStripMenuItem; ToolStripMenuItem toolStripMenuItem = sender as ToolStripMenuItem;
IDestination clickedDestination = (IDestination) toolStripMenuItem?.Tag; IDestination clickedDestination = (IDestination) toolStripMenuItem?.Tag;
if (clickedDestination == null) if (clickedDestination == null)
{ {
return; return;
} }
menu.Tag = clickedDestination.Designation; menu.Tag = clickedDestination.Designation;
// Export // Export
exportInformation = clickedDestination.ExportCapture(true, surface, captureDetails); exportInformation = clickedDestination.ExportCapture(true, surface, captureDetails);
if (exportInformation != null && exportInformation.ExportMade) if (exportInformation != null && exportInformation.ExportMade)
{ {
Log.InfoFormat("Export to {0} success, closing menu", exportInformation.DestinationDescription); Log.InfoFormat("Export to {0} success, closing menu", exportInformation.DestinationDescription);
// close menu if the destination wasn't the editor // close menu if the destination wasn't the editor
menu.Close(); menu.Close();
// Cleanup surface, only if there is no editor in the destinations and we didn't export to the editor // Cleanup surface, only if there is no editor in the destinations and we didn't export to the editor
if (!captureDetails.HasDestination("Editor") && !"Editor".Equals(clickedDestination.Designation)) if (!captureDetails.HasDestination("Editor") && !"Editor".Equals(clickedDestination.Designation))
{ {
surface.Dispose(); surface.Dispose();
surface = null; surface = null;
} }
} }
else else
{ {
Log.Info("Export cancelled or failed, showing menu again"); Log.Info("Export cancelled or failed, showing menu again");
// Make sure a click besides the menu don't close it. // Make sure a click besides the menu don't close it.
menu.Tag = null; menu.Tag = null;
// This prevents the problem that the context menu shows in the task-bar // This prevents the problem that the context menu shows in the task-bar
ShowMenuAtCursor(menu); ShowMenuAtCursor(menu);
} }
} }
); );
if (item != null) if (item != null)
{ {
menu.Items.Add(item); menu.Items.Add(item);
} }
} }
// Close // Close
menu.Items.Add(new ToolStripSeparator()); menu.Items.Add(new ToolStripSeparator());
ToolStripMenuItem closeItem = new ToolStripMenuItem(Language.GetString("editor_close")) ToolStripMenuItem closeItem = new ToolStripMenuItem(Language.GetString("editor_close"))
{ {
Image = GreenshotResources.GetImage("Close.Image") Image = GreenshotResources.GetImage("Close.Image")
}; };
closeItem.Click += delegate closeItem.Click += delegate
{ {
// This menu entry is the close itself, we can dispose the surface // This menu entry is the close itself, we can dispose the surface
menu.Close(); menu.Close();
if (!captureDetails.HasDestination("Editor")) if (!captureDetails.HasDestination("Editor"))
{ {
surface.Dispose(); surface.Dispose();
surface = null; surface = null;
} }
}; };
menu.Items.Add(closeItem); menu.Items.Add(closeItem);
ShowMenuAtCursor(menu); ShowMenuAtCursor(menu);
return exportInformation; return exportInformation;
} }
/// <summary> /// <summary>
/// This method will show the supplied context menu at the mouse cursor, also makes sure it has focus and it's not visible in the taskbar. /// This method will show the supplied context menu at the mouse cursor, also makes sure it has focus and it's not visible in the taskbar.
/// </summary> /// </summary>
/// <param name="menu"></param> /// <param name="menu"></param>
private static void ShowMenuAtCursor(ContextMenuStrip menu) private static void ShowMenuAtCursor(ContextMenuStrip menu)
{ {
// find a suitable location // find a suitable location
Point location = Cursor.Position; Point location = Cursor.Position;
Rectangle menuRectangle = new Rectangle(location, menu.Size); Rectangle menuRectangle = new Rectangle(location, menu.Size);
menuRectangle.Intersect(WindowCapture.GetScreenBounds()); menuRectangle.Intersect(WindowCapture.GetScreenBounds());
if (menuRectangle.Height < menu.Height) if (menuRectangle.Height < menu.Height)
{ {
location.Offset(-40, -(menuRectangle.Height - menu.Height)); location.Offset(-40, -(menuRectangle.Height - menu.Height));
} }
else else
{ {
location.Offset(-40, -10); location.Offset(-40, -10);
} }
// This prevents the problem that the context menu shows in the task-bar // This prevents the problem that the context menu shows in the task-bar
User32.SetForegroundWindow(SimpleServiceProvider.Current.GetInstance<NotifyIcon>().ContextMenuStrip.Handle); User32.SetForegroundWindow(SimpleServiceProvider.Current.GetInstance<NotifyIcon>().ContextMenuStrip.Handle);
menu.Show(location); menu.Show(location);
menu.Focus(); menu.Focus();
// Wait for the menu to close, so we can dispose it. // Wait for the menu to close, so we can dispose it.
while (true) while (true)
{ {
if (menu.Visible) if (menu.Visible)
{ {
Application.DoEvents(); Application.DoEvents();
Thread.Sleep(100); Thread.Sleep(100);
} }
else else
{ {
menu.Dispose(); menu.Dispose();
break; break;
} }
} }
} }
/// <summary> /// <summary>
/// Return a menu item /// Return a menu item
/// </summary> /// </summary>
/// <param name="menu"></param> /// <param name="menu"></param>
/// <param name="addDynamics"></param> /// <param name="addDynamics"></param>
/// <param name="destinationClickHandler"></param> /// <param name="destinationClickHandler"></param>
/// <returns>ToolStripMenuItem</returns> /// <returns>ToolStripMenuItem</returns>
public virtual ToolStripMenuItem GetMenuItem(bool addDynamics, ContextMenuStrip menu, EventHandler destinationClickHandler) public virtual ToolStripMenuItem GetMenuItem(bool addDynamics, ContextMenuStrip menu, EventHandler destinationClickHandler)
{ {
var basisMenuItem = new ToolStripMenuItem(Description) var basisMenuItem = new ToolStripMenuItem(Description)
{ {
Image = DisplayIcon, Image = DisplayIcon,
Tag = this, Tag = this,
Text = Description Text = Description
}; };
AddTagEvents(basisMenuItem, menu, Description); AddTagEvents(basisMenuItem, menu, Description);
basisMenuItem.Click -= destinationClickHandler; basisMenuItem.Click -= destinationClickHandler;
basisMenuItem.Click += destinationClickHandler; basisMenuItem.Click += destinationClickHandler;
if (IsDynamic && addDynamics) if (IsDynamic && addDynamics)
{ {
basisMenuItem.DropDownOpening += delegate basisMenuItem.DropDownOpening += delegate
{ {
if (basisMenuItem.DropDownItems.Count == 0) if (basisMenuItem.DropDownItems.Count == 0)
{ {
List<IDestination> subDestinations = new List<IDestination>(); List<IDestination> subDestinations = new List<IDestination>();
// Fixing Bug #3536968 by catching the COMException (every exception) and not displaying the "subDestinations" // Fixing Bug #3536968 by catching the COMException (every exception) and not displaying the "subDestinations"
try try
{ {
subDestinations.AddRange(DynamicDestinations()); subDestinations.AddRange(DynamicDestinations());
} }
catch (Exception ex) catch (Exception ex)
{ {
Log.ErrorFormat("Skipping {0}, due to the following error: {1}", Description, ex.Message); Log.ErrorFormat("Skipping {0}, due to the following error: {1}", Description, ex.Message);
} }
if (subDestinations.Count > 0) if (subDestinations.Count > 0)
{ {
if (UseDynamicsOnly && subDestinations.Count == 1) if (UseDynamicsOnly && subDestinations.Count == 1)
{ {
basisMenuItem.Tag = subDestinations[0]; basisMenuItem.Tag = subDestinations[0];
basisMenuItem.Text = subDestinations[0].Description; basisMenuItem.Text = subDestinations[0].Description;
basisMenuItem.Click -= destinationClickHandler; basisMenuItem.Click -= destinationClickHandler;
basisMenuItem.Click += destinationClickHandler; basisMenuItem.Click += destinationClickHandler;
} }
else else
{ {
foreach (IDestination subDestination in subDestinations) foreach (IDestination subDestination in subDestinations)
{ {
var destinationMenuItem = new ToolStripMenuItem(subDestination.Description) var destinationMenuItem = new ToolStripMenuItem(subDestination.Description)
{ {
Tag = subDestination, Tag = subDestination,
Image = subDestination.DisplayIcon Image = subDestination.DisplayIcon
}; };
destinationMenuItem.Click += destinationClickHandler; destinationMenuItem.Click += destinationClickHandler;
AddTagEvents(destinationMenuItem, menu, subDestination.Description); AddTagEvents(destinationMenuItem, menu, subDestination.Description);
basisMenuItem.DropDownItems.Add(destinationMenuItem); basisMenuItem.DropDownItems.Add(destinationMenuItem);
} }
} }
} }
} }
}; };
} }
return basisMenuItem; return basisMenuItem;
} }
} }
} }

View file

@ -1,68 +1,68 @@
/* /*
* Greenshot - a free and open source screenshot tool * Greenshot - a free and open source screenshot tool
* Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom
* *
* For more information see: http://getgreenshot.org/ * For more information see: http://getgreenshot.org/
* The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 1 of the License, or * the Free Software Foundation, either version 1 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
using System; using System;
using GreenshotPlugin.Interfaces; using Greenshot.Base.Interfaces;
namespace GreenshotPlugin.Core namespace Greenshot.Base.Core
{ {
/// <summary> /// <summary>
/// Description of AbstractProcessor. /// Description of AbstractProcessor.
/// </summary> /// </summary>
public abstract class AbstractProcessor : IProcessor public abstract class AbstractProcessor : IProcessor
{ {
public virtual int CompareTo(object obj) public virtual int CompareTo(object obj)
{ {
if (!(obj is IProcessor other)) if (!(obj is IProcessor other))
{ {
return 1; return 1;
} }
if (Priority == other.Priority) if (Priority == other.Priority)
{ {
return string.Compare(Description, other.Description, StringComparison.Ordinal); return string.Compare(Description, other.Description, StringComparison.Ordinal);
} }
return Priority - other.Priority; return Priority - other.Priority;
} }
public abstract string Designation { get; } public abstract string Designation { get; }
public abstract string Description { get; } public abstract string Description { get; }
public virtual int Priority => 10; public virtual int Priority => 10;
public void Dispose() public void Dispose()
{ {
Dispose(true); Dispose(true);
GC.SuppressFinalize(this); GC.SuppressFinalize(this);
} }
protected virtual void Dispose(bool disposing) protected virtual void Dispose(bool disposing)
{ {
//if (disposing) {} //if (disposing) {}
} }
public virtual bool isActive => true; public virtual bool isActive => true;
public abstract bool ProcessCapture(ISurface surface, ICaptureDetails captureDetails); public abstract bool ProcessCapture(ISurface surface, ICaptureDetails captureDetails);
} }
} }

View file

@ -1,237 +1,237 @@
/* /*
* Greenshot - a free and open source screenshot tool * Greenshot - a free and open source screenshot tool
* Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom
* *
* For more information see: http://getgreenshot.org/ * For more information see: http://getgreenshot.org/
* The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 1 of the License, or * the Free Software Foundation, either version 1 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using Accessibility; using Accessibility;
namespace GreenshotPlugin.Core namespace Greenshot.Base.Core
{ {
/// <summary> /// <summary>
/// See: http://social.msdn.microsoft.com/Forums/en-US/ieextensiondevelopment/thread/03a8c835-e9e4-405b-8345-6c3d36bc8941 /// See: http://social.msdn.microsoft.com/Forums/en-US/ieextensiondevelopment/thread/03a8c835-e9e4-405b-8345-6c3d36bc8941
/// This should really be cleaned up, there is little OO behind this class! /// This should really be cleaned up, there is little OO behind this class!
/// Maybe move the basic Accessible functions to WindowDetails!? /// Maybe move the basic Accessible functions to WindowDetails!?
/// </summary> /// </summary>
public class Accessible public class Accessible
{ {
private static int AccessibleObjectFromWindow(IntPtr hWnd, OBJID idObject, ref IAccessible acc) private static int AccessibleObjectFromWindow(IntPtr hWnd, OBJID idObject, ref IAccessible acc)
{ {
var guid = new Guid("{618736e0-3c3d-11cf-810c-00aa00389b71}"); // IAccessible var guid = new Guid("{618736e0-3c3d-11cf-810c-00aa00389b71}"); // IAccessible
object obj = null; object obj = null;
int num = AccessibleObjectFromWindow(hWnd, (uint) idObject, ref guid, ref obj); int num = AccessibleObjectFromWindow(hWnd, (uint) idObject, ref guid, ref obj);
acc = (IAccessible) obj; acc = (IAccessible) obj;
return num; return num;
} }
[DllImport("oleacc.dll")] [DllImport("oleacc.dll")]
private static extern int AccessibleObjectFromWindow(IntPtr hWnd, uint id, ref Guid iid, [In, Out, MarshalAs(UnmanagedType.IUnknown)] private static extern int AccessibleObjectFromWindow(IntPtr hWnd, uint id, ref Guid iid, [In, Out, MarshalAs(UnmanagedType.IUnknown)]
ref object ppvObject); ref object ppvObject);
[DllImport("oleacc.dll")] [DllImport("oleacc.dll")]
private static extern int AccessibleChildren(IAccessible paccContainer, int iChildStart, int cChildren, [In, Out, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 2)] private static extern int AccessibleChildren(IAccessible paccContainer, int iChildStart, int cChildren, [In, Out, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 2)]
object[] rgvarChildren, out int pcObtained); object[] rgvarChildren, out int pcObtained);
[DllImport("oleacc.dll", PreserveSig = false)] [DllImport("oleacc.dll", PreserveSig = false)]
[return: MarshalAs(UnmanagedType.Interface)] [return: MarshalAs(UnmanagedType.Interface)]
public static extern object ObjectFromLresult(UIntPtr lResult, [MarshalAs(UnmanagedType.LPStruct)] Guid refiid, IntPtr wParam); public static extern object ObjectFromLresult(UIntPtr lResult, [MarshalAs(UnmanagedType.LPStruct)] Guid refiid, IntPtr wParam);
private enum OBJID : uint private enum OBJID : uint
{ {
OBJID_WINDOW = 0x00000000, OBJID_WINDOW = 0x00000000,
} }
private const int IE_ACTIVE_TAB = 2097154; private const int IE_ACTIVE_TAB = 2097154;
private const int CHILDID_SELF = 0; private const int CHILDID_SELF = 0;
private readonly IAccessible accessible; private readonly IAccessible accessible;
private Accessible[] Children private Accessible[] Children
{ {
get get
{ {
object[] res = GetAccessibleChildren(accessible, out var num); object[] res = GetAccessibleChildren(accessible, out var num);
if (res == null) if (res == null)
{ {
return new Accessible[0]; return new Accessible[0];
} }
List<Accessible> list = new List<Accessible>(res.Length); List<Accessible> list = new List<Accessible>(res.Length);
foreach (object obj in res) foreach (object obj in res)
{ {
if (obj is IAccessible acc) if (obj is IAccessible acc)
{ {
list.Add(new Accessible(acc)); list.Add(new Accessible(acc));
} }
} }
return list.ToArray(); return list.ToArray();
} }
} }
private string Name private string Name
{ {
get { return accessible.get_accName(CHILDID_SELF); } get { return accessible.get_accName(CHILDID_SELF); }
} }
private int ChildCount private int ChildCount
{ {
get { return accessible.accChildCount; } get { return accessible.accChildCount; }
} }
public Accessible(IntPtr hWnd) public Accessible(IntPtr hWnd)
{ {
AccessibleObjectFromWindow(hWnd, OBJID.OBJID_WINDOW, ref accessible); AccessibleObjectFromWindow(hWnd, OBJID.OBJID_WINDOW, ref accessible);
if (accessible == null) if (accessible == null)
{ {
throw new Exception(); throw new Exception();
} }
} }
public void ActivateIETab(int tabIndexToActivate) public void ActivateIETab(int tabIndexToActivate)
{ {
var index = 0; var index = 0;
foreach (Accessible accessor in Children) foreach (Accessible accessor in Children)
{ {
foreach (var child in accessor.Children) foreach (var child in accessor.Children)
{ {
foreach (var tab in child.Children) foreach (var tab in child.Children)
{ {
if (tabIndexToActivate >= child.ChildCount - 1) if (tabIndexToActivate >= child.ChildCount - 1)
{ {
return; return;
} }
if (index == tabIndexToActivate) if (index == tabIndexToActivate)
{ {
tab.Activate(); tab.Activate();
return; return;
} }
index++; index++;
} }
} }
} }
} }
public string IEActiveTabCaption public string IEActiveTabCaption
{ {
get get
{ {
foreach (Accessible accessor in Children) foreach (Accessible accessor in Children)
{ {
foreach (var child in accessor.Children) foreach (var child in accessor.Children)
{ {
foreach (var tab in child.Children) foreach (var tab in child.Children)
{ {
object tabIndex = tab.accessible.get_accState(0); object tabIndex = tab.accessible.get_accState(0);
if ((int) tabIndex == IE_ACTIVE_TAB) if ((int) tabIndex == IE_ACTIVE_TAB)
{ {
return tab.Name; return tab.Name;
} }
} }
} }
} }
return string.Empty; return string.Empty;
} }
} }
public List<string> IETabCaptions public List<string> IETabCaptions
{ {
get get
{ {
var captionList = new List<string>(); var captionList = new List<string>();
foreach (Accessible accessor in Children) foreach (Accessible accessor in Children)
{ {
foreach (var child in accessor.Children) foreach (var child in accessor.Children)
{ {
foreach (var tab in child.Children) foreach (var tab in child.Children)
{ {
captionList.Add(tab.Name); captionList.Add(tab.Name);
} }
} }
} }
// TODO: Why again? // TODO: Why again?
if (captionList.Count > 0) if (captionList.Count > 0)
{ {
captionList.RemoveAt(captionList.Count - 1); captionList.RemoveAt(captionList.Count - 1);
} }
return captionList; return captionList;
} }
} }
public IEnumerable<string> IETabUrls public IEnumerable<string> IETabUrls
{ {
get get
{ {
foreach (Accessible accessor in Children) foreach (Accessible accessor in Children)
{ {
foreach (var child in accessor.Children) foreach (var child in accessor.Children)
{ {
foreach (var tab in child.Children) foreach (var tab in child.Children)
{ {
object tabIndex = tab.accessible.get_accState(CHILDID_SELF); object tabIndex = tab.accessible.get_accState(CHILDID_SELF);
var description = tab.accessible.get_accDescription(CHILDID_SELF); var description = tab.accessible.get_accDescription(CHILDID_SELF);
if (!string.IsNullOrEmpty(description)) if (!string.IsNullOrEmpty(description))
{ {
if (description.Contains(Environment.NewLine)) if (description.Contains(Environment.NewLine))
{ {
var url = description.Substring(description.IndexOf(Environment.NewLine)).Trim(); var url = description.Substring(description.IndexOf(Environment.NewLine)).Trim();
yield return url; yield return url;
} }
} }
} }
} }
} }
} }
} }
private Accessible(IAccessible acc) private Accessible(IAccessible acc)
{ {
accessible = acc ?? throw new Exception(); accessible = acc ?? throw new Exception();
} }
private void Activate() private void Activate()
{ {
accessible.accDoDefaultAction(CHILDID_SELF); accessible.accDoDefaultAction(CHILDID_SELF);
} }
private static object[] GetAccessibleChildren(IAccessible ao, out int childs) private static object[] GetAccessibleChildren(IAccessible ao, out int childs)
{ {
childs = 0; childs = 0;
object[] ret = null; object[] ret = null;
int count = ao.accChildCount; int count = ao.accChildCount;
if (count > 0) if (count > 0)
{ {
ret = new object[count]; ret = new object[count];
AccessibleChildren(ao, 0, count, ret, out childs); AccessibleChildren(ao, 0, count, ret, out childs);
} }
return ret; return ret;
} }
} }
} }

View file

@ -1,108 +1,108 @@
/* /*
* Greenshot - a free and open source screenshot tool * Greenshot - a free and open source screenshot tool
* Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom
* *
* For more information see: http://getgreenshot.org/ * For more information see: http://getgreenshot.org/
* The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 1 of the License, or * the Free Software Foundation, either version 1 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
using System; using System;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
namespace GreenshotPlugin.Core namespace Greenshot.Base.Core
{ {
/// <summary> /// <summary>
/// A helper class which does the mashalling for structs /// A helper class which does the mashalling for structs
/// </summary> /// </summary>
public static class BinaryStructHelper public static class BinaryStructHelper
{ {
/// <summary> /// <summary>
/// Get a struct from a byte array /// Get a struct from a byte array
/// </summary> /// </summary>
/// <typeparam name="T">typeof struct</typeparam> /// <typeparam name="T">typeof struct</typeparam>
/// <param name="bytes">byte[]</param> /// <param name="bytes">byte[]</param>
/// <returns>struct</returns> /// <returns>struct</returns>
public static T FromByteArray<T>(byte[] bytes) where T : struct public static T FromByteArray<T>(byte[] bytes) where T : struct
{ {
IntPtr ptr = IntPtr.Zero; IntPtr ptr = IntPtr.Zero;
try try
{ {
int size = Marshal.SizeOf(typeof(T)); int size = Marshal.SizeOf(typeof(T));
ptr = Marshal.AllocHGlobal(size); ptr = Marshal.AllocHGlobal(size);
Marshal.Copy(bytes, 0, ptr, size); Marshal.Copy(bytes, 0, ptr, size);
return FromIntPtr<T>(ptr); return FromIntPtr<T>(ptr);
} }
finally finally
{ {
if (ptr != IntPtr.Zero) if (ptr != IntPtr.Zero)
{ {
Marshal.FreeHGlobal(ptr); Marshal.FreeHGlobal(ptr);
} }
} }
} }
/// <summary> /// <summary>
/// Get a struct from a byte array /// Get a struct from a byte array
/// </summary> /// </summary>
/// <typeparam name="T">typeof struct</typeparam> /// <typeparam name="T">typeof struct</typeparam>
/// <param name="intPtr">Pointer to the structor to return</param> /// <param name="intPtr">Pointer to the structor to return</param>
/// <returns>struct</returns> /// <returns>struct</returns>
public static T FromIntPtr<T>(IntPtr intPtr) where T : struct public static T FromIntPtr<T>(IntPtr intPtr) where T : struct
{ {
object obj = Marshal.PtrToStructure(intPtr, typeof(T)); object obj = Marshal.PtrToStructure(intPtr, typeof(T));
return (T) obj; return (T) obj;
} }
/// <summary> /// <summary>
/// copy a struct to a byte array /// copy a struct to a byte array
/// </summary> /// </summary>
/// <typeparam name="T">typeof struct</typeparam> /// <typeparam name="T">typeof struct</typeparam>
/// <param name="obj">struct</param> /// <param name="obj">struct</param>
/// <returns>byte[]</returns> /// <returns>byte[]</returns>
public static byte[] ToByteArray<T>(T obj) where T : struct public static byte[] ToByteArray<T>(T obj) where T : struct
{ {
IntPtr ptr = IntPtr.Zero; IntPtr ptr = IntPtr.Zero;
try try
{ {
int size = Marshal.SizeOf(typeof(T)); int size = Marshal.SizeOf(typeof(T));
ptr = Marshal.AllocHGlobal(size); ptr = Marshal.AllocHGlobal(size);
Marshal.StructureToPtr(obj, ptr, true); Marshal.StructureToPtr(obj, ptr, true);
return FromPtrToByteArray<T>(ptr); return FromPtrToByteArray<T>(ptr);
} }
finally finally
{ {
if (ptr != IntPtr.Zero) if (ptr != IntPtr.Zero)
{ {
Marshal.FreeHGlobal(ptr); Marshal.FreeHGlobal(ptr);
} }
} }
} }
/// <summary> /// <summary>
/// copy a struct from a pointer to a byte array /// copy a struct from a pointer to a byte array
/// </summary> /// </summary>
/// <typeparam name="T">typeof struct</typeparam> /// <typeparam name="T">typeof struct</typeparam>
/// <param name="ptr">IntPtr to struct</param> /// <param name="ptr">IntPtr to struct</param>
/// <returns>byte[]</returns> /// <returns>byte[]</returns>
public static byte[] FromPtrToByteArray<T>(IntPtr ptr) where T : struct public static byte[] FromPtrToByteArray<T>(IntPtr ptr) where T : struct
{ {
int size = Marshal.SizeOf(typeof(T)); int size = Marshal.SizeOf(typeof(T));
byte[] bytes = new byte[size]; byte[] bytes = new byte[size];
Marshal.Copy(ptr, bytes, 0, size); Marshal.Copy(ptr, bytes, 0, size);
return bytes; return bytes;
} }
} }
} }

View file

@ -1,259 +1,259 @@
/* /*
* Greenshot - a free and open source screenshot tool * Greenshot - a free and open source screenshot tool
* Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom
* *
* For more information see: http://getgreenshot.org/ * For more information see: http://getgreenshot.org/
* The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 1 of the License, or * the Free Software Foundation, either version 1 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Timers; using System.Timers;
using log4net; using log4net;
namespace GreenshotPlugin.Core namespace Greenshot.Base.Core
{ {
/// <summary> /// <summary>
/// Cache class /// Cache class
/// </summary> /// </summary>
/// <typeparam name="TK">Type of key</typeparam> /// <typeparam name="TK">Type of key</typeparam>
/// <typeparam name="TV">Type of value</typeparam> /// <typeparam name="TV">Type of value</typeparam>
public class Cache<TK, TV> public class Cache<TK, TV>
{ {
private static readonly ILog Log = LogManager.GetLogger(typeof(Cache<TK, TV>)); private static readonly ILog Log = LogManager.GetLogger(typeof(Cache<TK, TV>));
private readonly IDictionary<TK, TV> _internalCache = new Dictionary<TK, TV>(); private readonly IDictionary<TK, TV> _internalCache = new Dictionary<TK, TV>();
private readonly object _lockObject = new object(); private readonly object _lockObject = new object();
private readonly int _secondsToExpire = 10; private readonly int _secondsToExpire = 10;
private readonly CacheObjectExpired _expiredCallback; private readonly CacheObjectExpired _expiredCallback;
public delegate void CacheObjectExpired(TK key, TV cacheValue); public delegate void CacheObjectExpired(TK key, TV cacheValue);
/// <summary> /// <summary>
/// Initialize the cache /// Initialize the cache
/// </summary> /// </summary>
public Cache() public Cache()
{ {
} }
/// <summary> /// <summary>
/// Initialize the cache /// Initialize the cache
/// </summary> /// </summary>
/// <param name="expiredCallback"></param> /// <param name="expiredCallback"></param>
public Cache(CacheObjectExpired expiredCallback) : this() public Cache(CacheObjectExpired expiredCallback) : this()
{ {
_expiredCallback = expiredCallback; _expiredCallback = expiredCallback;
} }
/// <summary> /// <summary>
/// Initialize the cache with a expire setting /// Initialize the cache with a expire setting
/// </summary> /// </summary>
/// <param name="secondsToExpire"></param> /// <param name="secondsToExpire"></param>
public Cache(int secondsToExpire) : this() public Cache(int secondsToExpire) : this()
{ {
_secondsToExpire = secondsToExpire; _secondsToExpire = secondsToExpire;
} }
/// <summary> /// <summary>
/// Initialize the cache with a expire setting /// Initialize the cache with a expire setting
/// </summary> /// </summary>
/// <param name="secondsToExpire"></param> /// <param name="secondsToExpire"></param>
/// <param name="expiredCallback"></param> /// <param name="expiredCallback"></param>
public Cache(int secondsToExpire, CacheObjectExpired expiredCallback) : this(expiredCallback) public Cache(int secondsToExpire, CacheObjectExpired expiredCallback) : this(expiredCallback)
{ {
_secondsToExpire = secondsToExpire; _secondsToExpire = secondsToExpire;
} }
/// <summary> /// <summary>
/// Enumerable for the values in the cache /// Enumerable for the values in the cache
/// </summary> /// </summary>
public IEnumerable<TV> Elements public IEnumerable<TV> Elements
{ {
get get
{ {
List<TV> elements = new List<TV>(); List<TV> elements = new List<TV>();
lock (_lockObject) lock (_lockObject)
{ {
foreach (TV element in _internalCache.Values) foreach (TV element in _internalCache.Values)
{ {
elements.Add(element); elements.Add(element);
} }
} }
foreach (TV element in elements) foreach (TV element in elements)
{ {
yield return element; yield return element;
} }
} }
} }
/// <summary> /// <summary>
/// Get the value by key from the cache /// Get the value by key from the cache
/// </summary> /// </summary>
/// <param name="key"></param> /// <param name="key"></param>
/// <returns></returns> /// <returns></returns>
public TV this[TK key] public TV this[TK key]
{ {
get get
{ {
TV result = default; TV result = default;
lock (_lockObject) lock (_lockObject)
{ {
if (_internalCache.ContainsKey(key)) if (_internalCache.ContainsKey(key))
{ {
result = _internalCache[key]; result = _internalCache[key];
} }
} }
return result; return result;
} }
} }
/// <summary> /// <summary>
/// Contains /// Contains
/// </summary> /// </summary>
/// <param name="key"></param> /// <param name="key"></param>
/// <returns>true if the cache contains the key</returns> /// <returns>true if the cache contains the key</returns>
public bool Contains(TK key) public bool Contains(TK key)
{ {
lock (_lockObject) lock (_lockObject)
{ {
return _internalCache.ContainsKey(key); return _internalCache.ContainsKey(key);
} }
} }
/// <summary> /// <summary>
/// Add a value to the cache /// Add a value to the cache
/// </summary> /// </summary>
/// <param name="key"></param> /// <param name="key"></param>
/// <param name="value"></param> /// <param name="value"></param>
public void Add(TK key, TV value) public void Add(TK key, TV value)
{ {
Add(key, value, null); Add(key, value, null);
} }
/// <summary> /// <summary>
/// Add a value to the cache /// Add a value to the cache
/// </summary> /// </summary>
/// <param name="key"></param> /// <param name="key"></param>
/// <param name="value"></param> /// <param name="value"></param>
/// <param name="secondsToExpire">optional value for the seconds to expire</param> /// <param name="secondsToExpire">optional value for the seconds to expire</param>
public void Add(TK key, TV value, int? secondsToExpire) public void Add(TK key, TV value, int? secondsToExpire)
{ {
lock (_lockObject) lock (_lockObject)
{ {
var cachedItem = new CachedItem(key, value, secondsToExpire ?? _secondsToExpire); var cachedItem = new CachedItem(key, value, secondsToExpire ?? _secondsToExpire);
cachedItem.Expired += delegate(TK cacheKey, TV cacheValue) cachedItem.Expired += delegate(TK cacheKey, TV cacheValue)
{ {
if (_internalCache.ContainsKey(cacheKey)) if (_internalCache.ContainsKey(cacheKey))
{ {
Log.DebugFormat("Expiring object with Key: {0}", cacheKey); Log.DebugFormat("Expiring object with Key: {0}", cacheKey);
_expiredCallback?.Invoke(cacheKey, cacheValue); _expiredCallback?.Invoke(cacheKey, cacheValue);
Remove(cacheKey); Remove(cacheKey);
} }
else else
{ {
Log.DebugFormat("Expired old object with Key: {0}", cacheKey); Log.DebugFormat("Expired old object with Key: {0}", cacheKey);
} }
}; };
if (_internalCache.ContainsKey(key)) if (_internalCache.ContainsKey(key))
{ {
_internalCache[key] = value; _internalCache[key] = value;
Log.DebugFormat("Updated item with Key: {0}", key); Log.DebugFormat("Updated item with Key: {0}", key);
} }
else else
{ {
_internalCache.Add(key, cachedItem); _internalCache.Add(key, cachedItem);
Log.DebugFormat("Added item with Key: {0}", key); Log.DebugFormat("Added item with Key: {0}", key);
} }
} }
} }
/// <summary> /// <summary>
/// Remove item from cache /// Remove item from cache
/// </summary> /// </summary>
/// <param name="key"></param> /// <param name="key"></param>
public void Remove(TK key) public void Remove(TK key)
{ {
lock (_lockObject) lock (_lockObject)
{ {
if (!_internalCache.ContainsKey(key)) if (!_internalCache.ContainsKey(key))
{ {
throw new ApplicationException($"An object with key {key} does not exists in cache"); throw new ApplicationException($"An object with key {key} does not exists in cache");
} }
_internalCache.Remove(key); _internalCache.Remove(key);
Log.DebugFormat("Removed item with Key: {0}", key); Log.DebugFormat("Removed item with Key: {0}", key);
} }
} }
/// <summary> /// <summary>
/// A cache item /// A cache item
/// </summary> /// </summary>
private class CachedItem private class CachedItem
{ {
public event CacheObjectExpired Expired; public event CacheObjectExpired Expired;
private readonly int _secondsToExpire; private readonly int _secondsToExpire;
private readonly Timer _timerEvent; private readonly Timer _timerEvent;
public CachedItem(TK key, TV item, int secondsToExpire) public CachedItem(TK key, TV item, int secondsToExpire)
{ {
if (key == null) if (key == null)
{ {
throw new ArgumentNullException(nameof(key)); throw new ArgumentNullException(nameof(key));
} }
Key = key; Key = key;
Item = item; Item = item;
_secondsToExpire = secondsToExpire; _secondsToExpire = secondsToExpire;
if (secondsToExpire <= 0) if (secondsToExpire <= 0)
{ {
return; return;
} }
_timerEvent = new Timer(secondsToExpire * 1000) _timerEvent = new Timer(secondsToExpire * 1000)
{ {
AutoReset = false AutoReset = false
}; };
_timerEvent.Elapsed += timerEvent_Elapsed; _timerEvent.Elapsed += timerEvent_Elapsed;
_timerEvent.Start(); _timerEvent.Start();
} }
private void ExpireNow() private void ExpireNow()
{ {
_timerEvent.Stop(); _timerEvent.Stop();
if (_secondsToExpire > 0) if (_secondsToExpire > 0)
{ {
Expired?.Invoke(Key, Item); Expired?.Invoke(Key, Item);
} }
} }
private void timerEvent_Elapsed(object sender, ElapsedEventArgs e) private void timerEvent_Elapsed(object sender, ElapsedEventArgs e)
{ {
ExpireNow(); ExpireNow();
} }
public TK Key { get; private set; } public TK Key { get; private set; }
public TV Item { get; private set; } public TV Item { get; private set; }
public static implicit operator TV(CachedItem a) public static implicit operator TV(CachedItem a)
{ {
return a.Item; return a.Item;
} }
} }
} }
} }

View file

@ -22,11 +22,11 @@
using System; using System;
using System.Drawing; using System.Drawing;
using System.Drawing.Imaging; using System.Drawing.Imaging;
using GreenshotPlugin.Interfaces; using Greenshot.Base.Interfaces;
using GreenshotPlugin.Interfaces.Ocr; using Greenshot.Base.Interfaces.Ocr;
using log4net; using log4net;
namespace GreenshotPlugin.Core namespace Greenshot.Base.Core
{ {
/// <summary> /// <summary>
/// This class is used to pass an instance of the "Capture" around /// This class is used to pass an instance of the "Capture" around

View file

@ -21,10 +21,10 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using GreenshotPlugin.Interfaces; using Greenshot.Base.Interfaces;
using GreenshotPlugin.Interfaces.Ocr; using Greenshot.Base.Interfaces.Ocr;
namespace GreenshotPlugin.Core namespace Greenshot.Base.Core
{ {
/// <summary> /// <summary>
/// This Class is used to pass details about the capture around. /// This Class is used to pass details about the capture around.

View file

@ -1,43 +1,43 @@
/* /*
* Greenshot - a free and open source screenshot tool * Greenshot - a free and open source screenshot tool
* Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom
* *
* For more information see: http://getgreenshot.org/ * For more information see: http://getgreenshot.org/
* The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 1 of the License, or * the Free Software Foundation, either version 1 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
using System.Drawing; using System.Drawing;
namespace GreenshotPlugin.Core namespace Greenshot.Base.Core
{ {
/// <summary> /// <summary>
/// This is the method signature which is used to capture a rectangle from the screen. /// This is the method signature which is used to capture a rectangle from the screen.
/// </summary> /// </summary>
/// <param name="captureBounds"></param> /// <param name="captureBounds"></param>
/// <returns>Captured Bitmap</returns> /// <returns>Captured Bitmap</returns>
public delegate Bitmap CaptureScreenRectangleHandler(Rectangle captureBounds); public delegate Bitmap CaptureScreenRectangleHandler(Rectangle captureBounds);
/// <summary> /// <summary>
/// This is a hack to experiment with different screen capture routines /// This is a hack to experiment with different screen capture routines
/// </summary> /// </summary>
public static class CaptureHandler public static class CaptureHandler
{ {
/// <summary> /// <summary>
/// By changing this value, null is default /// By changing this value, null is default
/// </summary> /// </summary>
public static CaptureScreenRectangleHandler CaptureScreenRectangle { get; set; } public static CaptureScreenRectangleHandler CaptureScreenRectangle { get; set; }
} }
} }

View file

@ -1,40 +1,40 @@
/* /*
* Greenshot - a free and open source screenshot tool * Greenshot - a free and open source screenshot tool
* Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom
* *
* For more information see: http://getgreenshot.org/ * For more information see: http://getgreenshot.org/
* The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 1 of the License, or * the Free Software Foundation, either version 1 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
using System; using System;
namespace GreenshotPlugin.Core namespace Greenshot.Base.Core
{ {
[AttributeUsage(AttributeTargets.Field)] [AttributeUsage(AttributeTargets.Field)]
public sealed class DisplayKeyAttribute : Attribute public sealed class DisplayKeyAttribute : Attribute
{ {
public string Value { get; } public string Value { get; }
public DisplayKeyAttribute(string v) public DisplayKeyAttribute(string v)
{ {
Value = v; Value = v;
} }
public DisplayKeyAttribute() public DisplayKeyAttribute()
{ {
} }
} }
} }

View file

@ -19,15 +19,15 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
using GreenshotPlugin.Core.Enums;
using GreenshotPlugin.UnmanagedHelpers;
using System; using System;
using System.Drawing; using System.Drawing;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using GreenshotPlugin.UnmanagedHelpers.Enums; using Greenshot.Base.Core.Enums;
using GreenshotPlugin.UnmanagedHelpers.Structs; using Greenshot.Base.UnmanagedHelpers;
using Greenshot.Base.UnmanagedHelpers.Enums;
using Greenshot.Base.UnmanagedHelpers.Structs;
namespace GreenshotPlugin.Core namespace Greenshot.Base.Core
{ {
/// <summary> /// <summary>
/// This handles DPI changes see /// This handles DPI changes see

View file

@ -1,233 +1,233 @@
using System; using System;
using System.ComponentModel; using System.ComponentModel;
using System.Drawing; using System.Drawing;
using System.Globalization; using System.Globalization;
using System.Text; using System.Text;
using GreenshotPlugin.Effects; using Greenshot.Base.Effects;
namespace GreenshotPlugin.Core namespace Greenshot.Base.Core
{ {
public class EffectConverter : TypeConverter public class EffectConverter : TypeConverter
{ {
// Fix to prevent BUG-1753 // Fix to prevent BUG-1753
private readonly NumberFormatInfo _numberFormatInfo = new NumberFormatInfo(); private readonly NumberFormatInfo _numberFormatInfo = new NumberFormatInfo();
public EffectConverter() public EffectConverter()
{ {
_numberFormatInfo.NumberDecimalSeparator = "."; _numberFormatInfo.NumberDecimalSeparator = ".";
_numberFormatInfo.NumberGroupSeparator = ","; _numberFormatInfo.NumberGroupSeparator = ",";
} }
public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
{ {
if (sourceType == typeof(string)) if (sourceType == typeof(string))
{ {
return true; return true;
} }
return base.CanConvertFrom(context, sourceType); return base.CanConvertFrom(context, sourceType);
} }
public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType)
{ {
if (destinationType == typeof(string)) if (destinationType == typeof(string))
{ {
return true; return true;
} }
if (destinationType == typeof(DropShadowEffect)) if (destinationType == typeof(DropShadowEffect))
{ {
return true; return true;
} }
if (destinationType == typeof(TornEdgeEffect)) if (destinationType == typeof(TornEdgeEffect))
{ {
return true; return true;
} }
return base.CanConvertTo(context, destinationType); return base.CanConvertTo(context, destinationType);
} }
public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType) public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
{ {
// to string // to string
if (destinationType == typeof(string)) if (destinationType == typeof(string))
{ {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
if (value.GetType() == typeof(DropShadowEffect)) if (value.GetType() == typeof(DropShadowEffect))
{ {
DropShadowEffect effect = value as DropShadowEffect; DropShadowEffect effect = value as DropShadowEffect;
RetrieveDropShadowEffectValues(effect, sb); RetrieveDropShadowEffectValues(effect, sb);
return sb.ToString(); return sb.ToString();
} }
if (value.GetType() == typeof(TornEdgeEffect)) if (value.GetType() == typeof(TornEdgeEffect))
{ {
TornEdgeEffect effect = value as TornEdgeEffect; TornEdgeEffect effect = value as TornEdgeEffect;
RetrieveDropShadowEffectValues(effect, sb); RetrieveDropShadowEffectValues(effect, sb);
sb.Append("|"); sb.Append("|");
RetrieveTornEdgeEffectValues(effect, sb); RetrieveTornEdgeEffectValues(effect, sb);
return sb.ToString(); return sb.ToString();
} }
} }
// from string // from string
if (value is string) if (value is string)
{ {
string settings = value as string; string settings = value as string;
if (destinationType == typeof(DropShadowEffect)) if (destinationType == typeof(DropShadowEffect))
{ {
DropShadowEffect effect = new DropShadowEffect(); DropShadowEffect effect = new DropShadowEffect();
ApplyDropShadowEffectValues(settings, effect); ApplyDropShadowEffectValues(settings, effect);
return effect; return effect;
} }
if (destinationType == typeof(TornEdgeEffect)) if (destinationType == typeof(TornEdgeEffect))
{ {
TornEdgeEffect effect = new TornEdgeEffect(); TornEdgeEffect effect = new TornEdgeEffect();
ApplyDropShadowEffectValues(settings, effect); ApplyDropShadowEffectValues(settings, effect);
ApplyTornEdgeEffectValues(settings, effect); ApplyTornEdgeEffectValues(settings, effect);
return effect; return effect;
} }
} }
return base.ConvertTo(context, culture, value, destinationType); return base.ConvertTo(context, culture, value, destinationType);
} }
public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value) public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
{ {
if (value is string settings) if (value is string settings)
{ {
if (settings.Contains("ToothHeight")) if (settings.Contains("ToothHeight"))
{ {
return ConvertTo(context, culture, settings, typeof(TornEdgeEffect)); return ConvertTo(context, culture, settings, typeof(TornEdgeEffect));
} }
return ConvertTo(context, culture, settings, typeof(DropShadowEffect)); return ConvertTo(context, culture, settings, typeof(DropShadowEffect));
} }
return base.ConvertFrom(context, culture, value); return base.ConvertFrom(context, culture, value);
} }
private void ApplyDropShadowEffectValues(string valuesString, DropShadowEffect effect) private void ApplyDropShadowEffectValues(string valuesString, DropShadowEffect effect)
{ {
string[] values = valuesString.Split('|'); string[] values = valuesString.Split('|');
foreach (string nameValuePair in values) foreach (string nameValuePair in values)
{ {
string[] pair = nameValuePair.Split(':'); string[] pair = nameValuePair.Split(':');
switch (pair[0]) switch (pair[0])
{ {
case "Darkness": case "Darkness":
// Fix to prevent BUG-1753 // Fix to prevent BUG-1753
if (pair[1] != null && float.TryParse(pair[1], NumberStyles.Float, _numberFormatInfo, out var darkness)) if (pair[1] != null && float.TryParse(pair[1], NumberStyles.Float, _numberFormatInfo, out var darkness))
{ {
if (darkness <= 1.0) if (darkness <= 1.0)
{ {
effect.Darkness = darkness; effect.Darkness = darkness;
} }
} }
break; break;
case "ShadowSize": case "ShadowSize":
if (int.TryParse(pair[1], out var shadowSize)) if (int.TryParse(pair[1], out var shadowSize))
{ {
effect.ShadowSize = shadowSize; effect.ShadowSize = shadowSize;
} }
break; break;
case "ShadowOffset": case "ShadowOffset":
Point shadowOffset = new Point(); Point shadowOffset = new Point();
string[] coordinates = pair[1].Split(','); string[] coordinates = pair[1].Split(',');
if (int.TryParse(coordinates[0], out var shadowOffsetX)) if (int.TryParse(coordinates[0], out var shadowOffsetX))
{ {
shadowOffset.X = shadowOffsetX; shadowOffset.X = shadowOffsetX;
} }
if (int.TryParse(coordinates[1], out var shadowOffsetY)) if (int.TryParse(coordinates[1], out var shadowOffsetY))
{ {
shadowOffset.Y = shadowOffsetY; shadowOffset.Y = shadowOffsetY;
} }
effect.ShadowOffset = shadowOffset; effect.ShadowOffset = shadowOffset;
break; break;
} }
} }
} }
private void ApplyTornEdgeEffectValues(string valuesString, TornEdgeEffect effect) private void ApplyTornEdgeEffectValues(string valuesString, TornEdgeEffect effect)
{ {
string[] values = valuesString.Split('|'); string[] values = valuesString.Split('|');
foreach (string nameValuePair in values) foreach (string nameValuePair in values)
{ {
string[] pair = nameValuePair.Split(':'); string[] pair = nameValuePair.Split(':');
switch (pair[0]) switch (pair[0])
{ {
case "GenerateShadow": case "GenerateShadow":
if (bool.TryParse(pair[1], out var generateShadow)) if (bool.TryParse(pair[1], out var generateShadow))
{ {
effect.GenerateShadow = generateShadow; effect.GenerateShadow = generateShadow;
} }
break; break;
case "ToothHeight": case "ToothHeight":
if (int.TryParse(pair[1], out var toothHeight)) if (int.TryParse(pair[1], out var toothHeight))
{ {
effect.ToothHeight = toothHeight; effect.ToothHeight = toothHeight;
} }
break; break;
case "HorizontalToothRange": case "HorizontalToothRange":
if (int.TryParse(pair[1], out var horizontalToothRange)) if (int.TryParse(pair[1], out var horizontalToothRange))
{ {
effect.HorizontalToothRange = horizontalToothRange; effect.HorizontalToothRange = horizontalToothRange;
} }
break; break;
case "VerticalToothRange": case "VerticalToothRange":
if (int.TryParse(pair[1], out var verticalToothRange)) if (int.TryParse(pair[1], out var verticalToothRange))
{ {
effect.VerticalToothRange = verticalToothRange; effect.VerticalToothRange = verticalToothRange;
} }
break; break;
case "Edges": case "Edges":
string[] edges = pair[1].Split(','); string[] edges = pair[1].Split(',');
if (bool.TryParse(edges[0], out var edge)) if (bool.TryParse(edges[0], out var edge))
{ {
effect.Edges[0] = edge; effect.Edges[0] = edge;
} }
if (bool.TryParse(edges[1], out edge)) if (bool.TryParse(edges[1], out edge))
{ {
effect.Edges[1] = edge; effect.Edges[1] = edge;
} }
if (bool.TryParse(edges[2], out edge)) if (bool.TryParse(edges[2], out edge))
{ {
effect.Edges[2] = edge; effect.Edges[2] = edge;
} }
if (bool.TryParse(edges[3], out edge)) if (bool.TryParse(edges[3], out edge))
{ {
effect.Edges[3] = edge; effect.Edges[3] = edge;
} }
break; break;
} }
} }
} }
private void RetrieveDropShadowEffectValues(DropShadowEffect effect, StringBuilder sb) private void RetrieveDropShadowEffectValues(DropShadowEffect effect, StringBuilder sb)
{ {
// Fix to prevent BUG-1753 is to use the numberFormatInfo // Fix to prevent BUG-1753 is to use the numberFormatInfo
sb.AppendFormat("Darkness:{0}|ShadowSize:{1}|ShadowOffset:{2},{3}", effect.Darkness.ToString("F2", _numberFormatInfo), effect.ShadowSize, effect.ShadowOffset.X, sb.AppendFormat("Darkness:{0}|ShadowSize:{1}|ShadowOffset:{2},{3}", effect.Darkness.ToString("F2", _numberFormatInfo), effect.ShadowSize, effect.ShadowOffset.X,
effect.ShadowOffset.Y); effect.ShadowOffset.Y);
} }
private void RetrieveTornEdgeEffectValues(TornEdgeEffect effect, StringBuilder sb) private void RetrieveTornEdgeEffectValues(TornEdgeEffect effect, StringBuilder sb)
{ {
sb.AppendFormat("GenerateShadow:{0}|ToothHeight:{1}|HorizontalToothRange:{2}|VerticalToothRange:{3}|Edges:{4},{5},{6},{7}", effect.GenerateShadow, effect.ToothHeight, sb.AppendFormat("GenerateShadow:{0}|ToothHeight:{1}|HorizontalToothRange:{2}|VerticalToothRange:{3}|Edges:{4},{5},{6},{7}", effect.GenerateShadow, effect.ToothHeight,
effect.HorizontalToothRange, effect.VerticalToothRange, effect.Edges[0], effect.Edges[1], effect.Edges[2], effect.Edges[3]); effect.HorizontalToothRange, effect.VerticalToothRange, effect.Edges[0], effect.Edges[1], effect.Edges[2], effect.Edges[3]);
} }
} }
} }

View file

@ -19,7 +19,7 @@
using System.Diagnostics.CodeAnalysis; using System.Diagnostics.CodeAnalysis;
namespace GreenshotPlugin.Core.Enums namespace Greenshot.Base.Core.Enums
{ {
/// <summary> /// <summary>
/// The HRESULT represents Windows error codes /// The HRESULT represents Windows error codes

View file

@ -3,7 +3,7 @@
using System; using System;
namespace GreenshotPlugin.Core.Enums namespace Greenshot.Base.Core.Enums
{ {
/// <summary> /// <summary>
/// See /// See

View file

@ -3,7 +3,7 @@
using System; using System;
namespace GreenshotPlugin.Core.Enums namespace Greenshot.Base.Core.Enums
{ {
/// <summary> /// <summary>
/// Flags for the MonitorFromRect / MonitorFromWindow "flags" field /// Flags for the MonitorFromRect / MonitorFromWindow "flags" field

View file

@ -23,11 +23,11 @@ using System;
using System.Reflection; using System.Reflection;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Text; using System.Text;
using GreenshotPlugin.IniFile; using Greenshot.Base.IniFile;
using GreenshotPlugin.UnmanagedHelpers; using Greenshot.Base.UnmanagedHelpers;
using Microsoft.Win32; using Microsoft.Win32;
namespace GreenshotPlugin.Core namespace Greenshot.Base.Core
{ {
/// <summary> /// <summary>
/// Description of EnvironmentInfo. /// Description of EnvironmentInfo.

View file

@ -21,7 +21,7 @@
using System; using System;
namespace GreenshotPlugin.Core namespace Greenshot.Base.Core
{ {
public class EventDelay public class EventDelay
{ {

View file

@ -1,55 +1,55 @@
using System; using System;
using System.Diagnostics; using System.Diagnostics;
using System.IO; using System.IO;
namespace GreenshotPlugin.Core namespace Greenshot.Base.Core
{ {
/// <summary> /// <summary>
/// Simple utility for the explorer /// Simple utility for the explorer
/// </summary> /// </summary>
public static class ExplorerHelper public static class ExplorerHelper
{ {
/// <summary> /// <summary>
/// Open the path in the windows explorer. /// Open the path in the windows explorer.
/// If the path is a directory, it will just open the explorer with that directory. /// If the path is a directory, it will just open the explorer with that directory.
/// If the path is a file, the explorer is opened with the directory and the file is selected. /// If the path is a file, the explorer is opened with the directory and the file is selected.
/// </summary> /// </summary>
/// <param name="path">Path to file or directory</param> /// <param name="path">Path to file or directory</param>
public static bool OpenInExplorer(string path) public static bool OpenInExplorer(string path)
{ {
if (path == null) if (path == null)
{ {
return false; return false;
} }
try try
{ {
// Check if path is a directory // Check if path is a directory
if (Directory.Exists(path)) if (Directory.Exists(path))
{ {
using (Process.Start(path)) using (Process.Start(path))
{ {
return true; return true;
} }
} }
// Check if path is a file // Check if path is a file
if (File.Exists(path)) if (File.Exists(path))
{ {
// Start the explorer process and select the file // Start the explorer process and select the file
using var explorer = Process.Start("explorer.exe", $"/select,\"{path}\""); using var explorer = Process.Start("explorer.exe", $"/select,\"{path}\"");
explorer?.WaitForInputIdle(500); explorer?.WaitForInputIdle(500);
return true; return true;
} }
} }
catch (Exception ex) catch (Exception ex)
{ {
// Make sure we show what we tried to open in the exception // Make sure we show what we tried to open in the exception
ex.Data.Add("path", path); ex.Data.Add("path", path);
throw; throw;
} }
return false; return false;
} }
} }
} }

View file

@ -1,7 +1,7 @@
using System; using System;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
namespace GreenshotPlugin.Core namespace Greenshot.Base.Core
{ {
/// <summary> /// <summary>
/// Basic Fraction (Rational) numbers with features only needed to represent scale factors. /// Basic Fraction (Rational) numbers with features only needed to represent scale factors.

View file

@ -1,49 +1,49 @@
/* /*
* Greenshot - a free and open source screenshot tool * Greenshot - a free and open source screenshot tool
* Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom
* *
* For more information see: http://getgreenshot.org/ * For more information see: http://getgreenshot.org/
* The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 1 of the License, or * the Free Software Foundation, either version 1 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
using System.ComponentModel; using System.ComponentModel;
using System.Drawing; using System.Drawing;
namespace GreenshotPlugin.Core namespace Greenshot.Base.Core
{ {
/// <summary> /// <summary>
/// Centralized storage of the icons & bitmaps /// Centralized storage of the icons & bitmaps
/// </summary> /// </summary>
public static class GreenshotResources public static class GreenshotResources
{ {
private static readonly ComponentResourceManager GreenshotResourceManager = new ComponentResourceManager(typeof(GreenshotResources)); private static readonly ComponentResourceManager GreenshotResourceManager = new ComponentResourceManager(typeof(GreenshotResources));
public static Image GetImage(string imageName) public static Image GetImage(string imageName)
{ {
return (Image) GreenshotResourceManager.GetObject(imageName); return (Image) GreenshotResourceManager.GetObject(imageName);
} }
public static Icon GetIcon(string imageName) public static Icon GetIcon(string imageName)
{ {
return (Icon) GreenshotResourceManager.GetObject(imageName); return (Icon) GreenshotResourceManager.GetObject(imageName);
} }
public static Icon GetGreenshotIcon() public static Icon GetGreenshotIcon()
{ {
return GetIcon("Greenshot.Icon"); return GetIcon("Greenshot.Icon");
} }
} }
} }

View file

@ -1,471 +1,471 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<root> <root>
<!-- <!--
Microsoft ResX Schema Microsoft ResX Schema
Version 2.0 Version 2.0
The primary goals of this format is to allow a simple XML format The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes various data types are done through the TypeConverter classes
associated with the data types. associated with the data types.
Example: Example:
... ado.net/XML headers & schema ... ... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader> <resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader> <resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value> <value>[base64 mime encoded serialized .NET Framework object]</value>
</data> </data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment> <comment>This is a comment</comment>
</data> </data>
There are any number of "resheader" rows that contain simple There are any number of "resheader" rows that contain simple
name/value pairs. name/value pairs.
Each data row contains a name, and value. The row also contains a Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture. text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the Classes that don't support this are serialized and stored with the
mimetype set. mimetype set.
The mimetype is used for serialized objects, and tells the The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly: extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below. read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64 mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding. : and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64 mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding. : and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64 mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter : using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding. : and then encoded with base64 encoding.
--> -->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true"> <xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType> <xsd:complexType>
<xsd:choice maxOccurs="unbounded"> <xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata"> <xsd:element name="metadata">
<xsd:complexType> <xsd:complexType>
<xsd:sequence> <xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" /> <xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence> </xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" /> <xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" /> <xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" /> <xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" /> <xsd:attribute ref="xml:space" />
</xsd:complexType> </xsd:complexType>
</xsd:element> </xsd:element>
<xsd:element name="assembly"> <xsd:element name="assembly">
<xsd:complexType> <xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" /> <xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" /> <xsd:attribute name="name" type="xsd:string" />
</xsd:complexType> </xsd:complexType>
</xsd:element> </xsd:element>
<xsd:element name="data"> <xsd:element name="data">
<xsd:complexType> <xsd:complexType>
<xsd:sequence> <xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence> </xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" /> <xsd:attribute ref="xml:space" />
</xsd:complexType> </xsd:complexType>
</xsd:element> </xsd:element>
<xsd:element name="resheader"> <xsd:element name="resheader">
<xsd:complexType> <xsd:complexType>
<xsd:sequence> <xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence> </xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" /> <xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType> </xsd:complexType>
</xsd:element> </xsd:element>
</xsd:choice> </xsd:choice>
</xsd:complexType> </xsd:complexType>
</xsd:element> </xsd:element>
</xsd:schema> </xsd:schema>
<resheader name="resmimetype"> <resheader name="resmimetype">
<value>text/microsoft-resx</value> <value>text/microsoft-resx</value>
</resheader> </resheader>
<resheader name="version"> <resheader name="version">
<value>2.0</value> <value>2.0</value>
</resheader> </resheader>
<resheader name="reader"> <resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<resheader name="writer"> <resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="Greenshot.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="Greenshot.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value> <value>
AAABAAUAAAAAAAEACAClFwAAVgAAADAwAAABAAgAqA4AAPsXAAAgIAAAAQAIAKgIAACjJgAAGBgAAAEA AAABAAUAAAAAAAEACAClFwAAVgAAADAwAAABAAgAqA4AAPsXAAAgIAAAAQAIAKgIAACjJgAAGBgAAAEA
CADIBgAASy8AABAQAAABAAgAaAUAABM2AACJUE5HDQoaCgAAAA1JSERSAAABAAAAAQAIBgAAAFxyqGYA CADIBgAASy8AABAQAAABAAgAaAUAABM2AACJUE5HDQoaCgAAAA1JSERSAAABAAAAAQAIBgAAAFxyqGYA
ABdsSURBVHja7Z1fqFVVHsf3YQqnUTJQSJMcujkK3UHuFW5geBXGYK5B0EP6Gto8zIsG8zKY82rCvKXP ABdsSURBVHja7Z1fqFVVHsf3YQqnUTJQSJMcujkK3UHuFW5geBXGYK5B0EP6Gto8zIsG8zKY82rCvKXP
6bv2FqQP9eAfEhS8Eilozo0xTAOFbGycKLjTd9u6nnvvXnuvvff6/dbea30/cEioPPucs9Z3/dbv72By 6bv2FqQP9eAfEhS8Eilozo0xTAOFbGycKLjTd9u6nnvvXnuvvff6/dbea30/cEioPPucs9Z3/dbv72By
cnI2I4QkyYACQEi6UAAISR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AAAAAAAAAAAJMR0UDAAAAAAAAAAAAAAAAA0C
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA= AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=
</value> </value>
</data> </data>
<data name="Checkerboard.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="Checkerboard.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value> <value>
iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAMAAAC67D+PAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAMAAAC67D+PAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAwBQTFRFgICA//// YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAwBQTFRFgICA////
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAA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AAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAODgHVgAAAAlwSFlzAAAOvgAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAODgHVgAAAAlwSFlzAAAOvgAA
Dr4B6kKxwAAAABZJREFUGFdjYAABRhAAs4hlkq4DZDgACywAM12jTsYAAAAASUVORK5CYII= Dr4B6kKxwAAAABZJREFUGFdjYAABRhAAs4hlkq4DZDgACywAM12jTsYAAAAASUVORK5CYII=
</value> </value>
</data> </data>
<data name="Email.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="Email.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value> <value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAnBJREFUOE+dk11I YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAnBJREFUOE+dk11I
k1Ecxs+2q1DLqwRvvCgoM6mLvoTAC6WLSrDUYBcSGK6y6EMzc6a2NnERlVKhSEMTYWSyksTZh7KZGboU k1Ecxs+2q1DLqwRvvCgoM6mLvoTAC6WLSrDUYBcSGK6y6EMzc6a2NnERlVKhSEMTYWSyksTZh7KZGboU
HNmUKemcupnuI5tuqHs6/7cSUenrwMPhPf/n97wPB46IrVrHCwuTxCJR5EbxbHiUZHQnEzE2uhj18Wsw HNmUKemcupnuI5tuqHs6/7cSUenrwMPhPf/n97wPB46IrVrHCwuTxCJR5EbxbHiUZHQnEzE2uhj18Wsw
zPPLGgQmdErli9Ws8C2VX8wFX9y0rmiWnJ9/dg38Qc02dZdKUlQ3DrcuBINIfQTItMDJWiBHByj1gMEK zPPLGgQmdErli9Ws8C2VX8wFX9y0rmiWnJ9/dg38Qc02dZdKUlQ3DrcuBINIfQTItMDJWiBHByj1gMEK
0OxY9rkrywEvb7OQdzclR6tKDjRUV522qh7Kl5q6unDqQTnuNbZD89qEyhYTNK9M0PcMwLewgOsFh5oH 0OxY9rkrywEvb7OQdzclR6tKDjRUV522qh7Kl5q6unDqQTnuNbZD89qEyhYTNK9M0PcMwLewgOsFh5oH
70oSbXfYBmZUiM8P1Se06Z4WBP5UvarFALffj+q6goDjTXJTf7k4nWVmp159ayhDnVYu1Ot7tvmnImB+ 70oSbXfYBmZUiM8P1Se06Z4WBP5UvarFALffj+q6goDjTXJTf7k4nWVmp159ayhDnVYu1Ot7tvmnImB+
ztX4Y6dZUYMRzrk5VD4uxPueWmTlpVxmCVlZF1wuG8pqVJj0eKA+s5cHRMNm2Iapvn3wjCRirGOHUF2j ztX4Y6dZUYMRzrk5VD4uxPueWmTlpVxmCVlZF1wuG8pqVJj0eKA+s5cHRMNm2Iapvn3wjCRirGOHUF2j
12PY7Ubx/SJ4vJMglsXLZJcWefrI+Ge09PZCGr8V105sQU3xdgx0HYHfJ4O5ebdQXVNXjLb2Csy4x0EM 12PY7Ubx/SJ4vJMglsXLZJcWefrI+Ge09PZCGr8V105sQU3xdgx0HYHfJ4O5ebdQXVNXjLb2Csy4x0EM
sexgRka2f2kJvkAAEzz9VmkCatWR0JaEoqkiDJ26cDxRh2LQ6YSyQgGna0zwEkMs25+envON13P7fII+ sexgRka2f2kJvkAAEzz9VmkCatWR0JaEoqkiDJ26cDxRh2LQ6YSyQgGna0zwEkMs25+envON13P7fII+
2e3QGo1rVN/RAZPFvOwjhli2RyrNdfNEh9eL0elpdFutsPMmLl55peiMZuQhLzHEsl1paXlf5udhdTjQ 2e3QGo1rVN/RAZPFvOwjhli2RyrNdfNEh9eL0elpdFutsPMmLl55peiMZuQhLzHEsl1paXlf5udhdTjQ
abEIu21mZl2t9BBDLItOSpKP8HSj2Yx+Xn9oauq3Ig95iSGWRcTFKVr57Q/zv9pnZ/9K5CWGWBYaG5sZ abEIu21mZl2t9BBDLItOSpKP8HSj2Yx+Xn9oauq3Ig95iSGWRcTFKVr57Q/zv9pnZ/9K5CWGWBYaG5sZ
EhNT+j8idt0X+S+H3wE2DYYIXysH6QAAAABJRU5ErkJggg== EhNT+j8idt0X+S+H3wE2DYYIXysH6QAAAABJRU5ErkJggg==
</value> </value>
</data> </data>
<data name="Printer.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="Printer.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value> <value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAm1JREFUOE+Nkl9I YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAm1JREFUOE+Nkl9I
U1Ecx39T31o9SBq97cWHiUIimKiQ0zFbbcJ1U2YkBtLuFYkQnMrcdKQyEUIwWk+GDy58EfUhmYoTRtKE U1Ecx39T31o9SBq97cWHiUIimKiQ0zFbbcJ1U2YkBtLuFYkQnMrcdKQyEUIwWk+GDy58EfUhmYoTRtKE
HitI8kGZIkEW/oF0um/nd3OyYUnn8rn3nMPn+733wNXYe3spOTQajVXMb55vpE/CiUTiqyB91+b1Ugry HitI8kGZIkEW/oF0um/nd3OyYUnn8rn3nMPn+733wNXYe3spOTQajVXMb55vpE/CiUTiqyB91+b1Ugry
j3gcWwcH2Nzfx8benspsJALhyII8qaeHUiHJ7U5F+Xl0hM3dXXzZ2cGn7W183NpCcG4OPISrmNvbdQZF j3gcWwcH2Nzfx8benspsJALhyII8qaeHUiHJ7U5F+Xl0hM3dXXzZ2cGn7W183NpCcG4OPISrmNvbdQZF
IaZOlolsNhvVOZ1U29XFtO4fH+ObeGtqyYuJCSTJM5s9Aqqqr1ez6s1ut5OtqYksHR1tB6Lg++HhhRL+ IaZOlolsNhvVOZ1U29XFtO4fH+ObeGtqyYuJCSTJM5s9Aqqqr1ez6s1ut5OtqYksHR1tB6Lg++HhhRL+
Ej4OO+yqmbOCDLGwCuSsrKznLpcLl8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ing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="Clipboard.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value> <value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAW1JREFUOE+NkL1L YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAW1JREFUOE+NkL1L
QlEYh9/b4NzS1BgNShBRQQ3VGEGr/0BDBEG0uLRIFIREIX2ANhgZKphj/4PLASOi0i4SYWWmWH5y/bhv QlEYh9/b4NzS1BgNShBRQQ3VGEGr/0BDBEG0uLRIFIREIX2ANhgZKphj/4PLASOi0i4SYWWmWH5y/bhv
5yc4HTl04YHD+z4893AMGvB53S7Hg+1cNQxjBGtm/p4YerrdvXlsDfJ7s7MlCp4ukgD7U3QX8mx+ZDIm 5yc4HTl04YHD+z4893AMGvB53S7Hg+1cNQxjBGtm/p4YerrdvXlsDfJ7s7MlCp4ukgD7U3QX8mx+ZDIm
A5wx6+/hKiEs0+drnNiY5WTynlOpZ85mcz1wxgw7OHCVwPECCXlVDoev2ec75EDggiORGMfjCQ5dXrHf A5wx6+/hKiEs0+drnNiY5WTynlOpZ85mcz1wxgw7OHCVwPECCXlVDoev2ec75EDggiORGMfjCQ5dXrHf
f8LRaAwKw1UCR/MkbLns2Da/mOZAsIMDVwn45ki0pWB1OlrgwFUCBzMkrG6X662WFjhwlcDeNIlGu82/ f8LRaAwKw1UCR/MkbLns2Da/mOZAsIMDVwn45ki0pWB1OlrgwFUCBzMkrG6X662WFjhwlcDeNIlGu82/
zaYWOHCVgHeSRFX+vVSraYEDVwnsuEj8WBbnKxUtcOAqAY+TREleP1cua4EDVwlsj5MoNBr8WixqgQNX zaYWOHCVgHeSRFX+vVSraYEDVwnsuEj8WBbnKxUtcOAqAY+TREleP1cua4EDVwlsj5MoNBr8WixqgQNX
CWyNkfis19ksFLTAgasE1kdJvMsHTOfzWuDAVQLuYRJf8oHeqlUtcOAqgRUHBZcdJP4D3H7gDzdsNup2 CWyNkfis19ksFLTAgasE1kdJvMsHTOfzWuDAVQLuYRJf8oHeqlUtcOAqgRUHBZcdJP4D3H7gDzdsNup2
mXizAAAAAElFTkSuQmCC mXizAAAAAElFTkSuQmCC
</value> </value>
</data> </data>
<data name="Save.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="Save.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value> <value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAXJJREFUOE+lk0FL YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAXJJREFUOE+lk0FL
AkEYhlvwv3jzoiDoQdCbdEnYf6CrqCgoHgRRAk/9EQVLdEGyFiQNMS+dvHnoEkgglGAmCL7NO6RMIZvU AkEYhlvwv3jzoiDoQdCbdEnYf6CrqCgoHgRRAk/9EQVLdEGyFiQNMS+dvHnoEkgglGAmCL7NO6RMIZvU
wsMO3zzzzGk0ACf/+hjQNO1ccKlXKsYx0OUZeflXoFmtVsUS2P4CHboi0FQDrXK5jM12i/VmYwsduiLQ wsMO3zzzzGk0ACf/+hjQNO1ccKlXKsYx0OUZeflXoFmtVsUS2P4CHboi0FQDrXK5jM12i/VmYwsduiLQ
UgNmqVTCuzj8tlrZQoeuCJhqoFMsFvG6XmO2WNhCh64IdNRAt1Ao4EXc/jSf20KHrgh01YCVy+Uwnkzw UgNmqVTCuzj8tlrZQoeuCJhqoFMsFvG6XmO2WNhCh64IdNRAt1Ao4EXc/jSf20KHrgh01YCVy+Uwnkzw
vFzaQoeuCFhqoJfJZBCLxY6Crgj01EA/lUrB4/HA7XYfhHs78vk8A301MIzH4/B6vRiNHjAY3H+DM+7p vFzaQoeuCFhqoJfJZBCLxY6Crgj01EA/lUrB4/HA7XYfhHs78vk8A301MIzH4/B6vRiNHjAY3H+DM+7p
ug6fz4dsNsvAUA2Mo9Eo/H4/LOsOTqdTYprXEs64x0AwGEQ6nWZgrAYeDcNAIBBAu30r/6Reb0t2MwbC ug6fz4dsNsvAUA2Mo9Eo/H4/LOsOTqdTYprXEs64x0AwGEQ6nWZgrAYeDcNAIBBAu30r/6Reb0t2MwbC
4TCSySQDj/uAeEyngqnL5fpoNG4QCoUktVpHspsxEIlEkEgk+AKnaoAP8kwwczgcF4fg3g+u9gEu/son 4TCSySQDj/uAeEyngqnL5fpoNG4QCoUktVpHspsxEIlEkEgk+AKnaoAP8kwwczgcF4fg3g+u9gEu/son
bfJW/NwRDyIAAAAASUVORK5CYII= bfJW/NwRDyIAAAAASUVORK5CYII=
</value> </value>
</data> </data>
<data name="Close.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="Close.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value> <value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAA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C
</value> </value>
</data> </data>
</root> </root>

View file

@ -17,10 +17,10 @@
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>. // along with this program. If not, see <http://www.gnu.org/licenses/>.
using GreenshotPlugin.Core.Enums;
using System.Diagnostics.Contracts; using System.Diagnostics.Contracts;
using Greenshot.Base.Core.Enums;
namespace GreenshotPlugin.Core namespace Greenshot.Base.Core
{ {
/// <summary> /// <summary>
/// Extensions to handle the HResult /// Extensions to handle the HResult

View file

@ -1,203 +1,203 @@
/* /*
* Greenshot - a free and open source screenshot tool * Greenshot - a free and open source screenshot tool
* Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom
* *
* For more information see: http://getgreenshot.org/ * For more information see: http://getgreenshot.org/
* The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 1 of the License, or * the Free Software Foundation, either version 1 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Reflection; using System.Reflection;
using log4net; using log4net;
using Microsoft.Win32; using Microsoft.Win32;
namespace GreenshotPlugin.Core namespace Greenshot.Base.Core
{ {
/// <summary> /// <summary>
/// Description of IEHelper. /// Description of IEHelper.
/// </summary> /// </summary>
public static class IEHelper public static class IEHelper
{ {
private static readonly ILog Log = LogManager.GetLogger(typeof(IEHelper)); private static readonly ILog Log = LogManager.GetLogger(typeof(IEHelper));
// Internet explorer Registry key // Internet explorer Registry key
private const string IeKey = @"Software\Microsoft\Internet Explorer"; private const string IeKey = @"Software\Microsoft\Internet Explorer";
/// <summary> /// <summary>
/// Get the current browser version /// Get the current browser version
/// </summary> /// </summary>
/// <returns>int with browser version</returns> /// <returns>int with browser version</returns>
public static int IEVersion public static int IEVersion
{ {
get get
{ {
var maxVer = 7; var maxVer = 7;
using (var ieKey = Registry.LocalMachine.OpenSubKey(IeKey, false)) using (var ieKey = Registry.LocalMachine.OpenSubKey(IeKey, false))
{ {
foreach (var value in new[] foreach (var value in new[]
{ {
"svcVersion", "svcUpdateVersion", "Version", "W2kVersion" "svcVersion", "svcUpdateVersion", "Version", "W2kVersion"
}) })
{ {
var objVal = ieKey.GetValue(value, "0"); var objVal = ieKey.GetValue(value, "0");
var strVal = Convert.ToString(objVal); var strVal = Convert.ToString(objVal);
var iPos = strVal.IndexOf('.'); var iPos = strVal.IndexOf('.');
if (iPos > 0) if (iPos > 0)
{ {
strVal = strVal.Substring(0, iPos); strVal = strVal.Substring(0, iPos);
} }
if (int.TryParse(strVal, out var res)) if (int.TryParse(strVal, out var res))
{ {
maxVer = Math.Max(maxVer, res); maxVer = Math.Max(maxVer, res);
} }
} }
} }
return maxVer; return maxVer;
} }
} }
/// <summary> /// <summary>
/// Get the highest possible version for the embedded browser /// Get the highest possible version for the embedded browser
/// </summary> /// </summary>
/// <param name="ignoreDoctype">true to ignore the doctype when loading a page</param> /// <param name="ignoreDoctype">true to ignore the doctype when loading a page</param>
/// <returns>IE Feature</returns> /// <returns>IE Feature</returns>
public static int GetEmbVersion(bool ignoreDoctype = true) public static int GetEmbVersion(bool ignoreDoctype = true)
{ {
var ieVersion = IEVersion; var ieVersion = IEVersion;
if (ieVersion > 9) if (ieVersion > 9)
{ {
return ieVersion * 1000 + (ignoreDoctype ? 1 : 0); return ieVersion * 1000 + (ignoreDoctype ? 1 : 0);
} }
if (ieVersion > 7) if (ieVersion > 7)
{ {
return ieVersion * 1111; return ieVersion * 1111;
} }
return 7000; return 7000;
} }
/// <summary> /// <summary>
/// Fix browser version to the highest possible /// Fix browser version to the highest possible
/// </summary> /// </summary>
/// <param name="ignoreDoctype">true to ignore the doctype when loading a page</param> /// <param name="ignoreDoctype">true to ignore the doctype when loading a page</param>
public static void FixBrowserVersion(bool ignoreDoctype = true) public static void FixBrowserVersion(bool ignoreDoctype = true)
{ {
var applicationName = Path.GetFileNameWithoutExtension(Assembly.GetEntryAssembly().Location); var applicationName = Path.GetFileNameWithoutExtension(Assembly.GetEntryAssembly().Location);
FixBrowserVersion(applicationName, ignoreDoctype); FixBrowserVersion(applicationName, ignoreDoctype);
} }
/// <summary> /// <summary>
/// Fix the browser version for the specified application /// Fix the browser version for the specified application
/// </summary> /// </summary>
/// <param name="applicationName">Name of the process</param> /// <param name="applicationName">Name of the process</param>
/// <param name="ignoreDoctype">true to ignore the doctype when loading a page</param> /// <param name="ignoreDoctype">true to ignore the doctype when loading a page</param>
public static void FixBrowserVersion(string applicationName, bool ignoreDoctype = true) public static void FixBrowserVersion(string applicationName, bool ignoreDoctype = true)
{ {
FixBrowserVersion(applicationName, GetEmbVersion(ignoreDoctype)); FixBrowserVersion(applicationName, GetEmbVersion(ignoreDoctype));
} }
/// <summary> /// <summary>
/// Fix the browser version for the specified application /// Fix the browser version for the specified application
/// </summary> /// </summary>
/// <param name="applicationName">Name of the process</param> /// <param name="applicationName">Name of the process</param>
/// <param name="ieVersion"> /// <param name="ieVersion">
/// Version, see /// Version, see
/// <a href="https://msdn.microsoft.com/en-us/library/ee330730(v=vs.85).aspx#browser_emulation">Browser Emulation</a> /// <a href="https://msdn.microsoft.com/en-us/library/ee330730(v=vs.85).aspx#browser_emulation">Browser Emulation</a>
/// </param> /// </param>
public static void FixBrowserVersion(string applicationName, int ieVersion) public static void FixBrowserVersion(string applicationName, int ieVersion)
{ {
ModifyRegistry("HKEY_CURRENT_USER", applicationName + ".exe", ieVersion); ModifyRegistry("HKEY_CURRENT_USER", applicationName + ".exe", ieVersion);
#if DEBUG #if DEBUG
ModifyRegistry("HKEY_CURRENT_USER", applicationName + ".vshost.exe", ieVersion); ModifyRegistry("HKEY_CURRENT_USER", applicationName + ".vshost.exe", ieVersion);
#endif #endif
} }
/// <summary> /// <summary>
/// Make the change to the registry /// Make the change to the registry
/// </summary> /// </summary>
/// <param name="root">HKEY_CURRENT_USER or something</param> /// <param name="root">HKEY_CURRENT_USER or something</param>
/// <param name="applicationName">Name of the executable</param> /// <param name="applicationName">Name of the executable</param>
/// <param name="ieFeatureVersion">Version to use</param> /// <param name="ieFeatureVersion">Version to use</param>
private static void ModifyRegistry(string root, string applicationName, int ieFeatureVersion) private static void ModifyRegistry(string root, string applicationName, int ieFeatureVersion)
{ {
var regKey = root + @"\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION"; var regKey = root + @"\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION";
try try
{ {
Registry.SetValue(regKey, applicationName, ieFeatureVersion); Registry.SetValue(regKey, applicationName, ieFeatureVersion);
} }
catch (Exception ex) catch (Exception ex)
{ {
// some config will hit access rights exceptions // some config will hit access rights exceptions
// this is why we try with both LOCAL_MACHINE and CURRENT_USER // this is why we try with both LOCAL_MACHINE and CURRENT_USER
Log.Error(ex); Log.Error(ex);
Log.ErrorFormat("couldn't modify the registry key {0}", regKey); Log.ErrorFormat("couldn't modify the registry key {0}", regKey);
} }
} }
/// <summary> /// <summary>
/// Find the DirectUI window for MSAA (Accessible) /// Find the DirectUI window for MSAA (Accessible)
/// </summary> /// </summary>
/// <param name="browserWindowDetails">The browser WindowDetails</param> /// <param name="browserWindowDetails">The browser WindowDetails</param>
/// <returns>WindowDetails for the DirectUI window</returns> /// <returns>WindowDetails for the DirectUI window</returns>
public static WindowDetails GetDirectUI(WindowDetails browserWindowDetails) public static WindowDetails GetDirectUI(WindowDetails browserWindowDetails)
{ {
if (browserWindowDetails == null) if (browserWindowDetails == null)
{ {
return null; return null;
} }
WindowDetails tmpWd = browserWindowDetails; WindowDetails tmpWd = browserWindowDetails;
// Since IE 9 the TabBandClass is less deep! // Since IE 9 the TabBandClass is less deep!
if (IEVersion < 9) if (IEVersion < 9)
{ {
tmpWd = tmpWd.GetChild("CommandBarClass"); tmpWd = tmpWd.GetChild("CommandBarClass");
tmpWd = tmpWd?.GetChild("ReBarWindow32"); tmpWd = tmpWd?.GetChild("ReBarWindow32");
} }
tmpWd = tmpWd?.GetChild("TabBandClass"); tmpWd = tmpWd?.GetChild("TabBandClass");
tmpWd = tmpWd?.GetChild("DirectUIHWND"); tmpWd = tmpWd?.GetChild("DirectUIHWND");
return tmpWd; return tmpWd;
} }
/// <summary> /// <summary>
/// Return an IEnumerable with the currently opened IE urls /// Return an IEnumerable with the currently opened IE urls
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
public static IEnumerable<string> GetIEUrls() public static IEnumerable<string> GetIEUrls()
{ {
// Find the IE window // Find the IE window
foreach (WindowDetails ieWindow in WindowDetails.GetAllWindows("IEFrame")) foreach (WindowDetails ieWindow in WindowDetails.GetAllWindows("IEFrame"))
{ {
WindowDetails directUIWD = GetDirectUI(ieWindow); WindowDetails directUIWD = GetDirectUI(ieWindow);
if (directUIWD != null) if (directUIWD != null)
{ {
Accessible ieAccessible = new Accessible(directUIWD.Handle); Accessible ieAccessible = new Accessible(directUIWD.Handle);
foreach (string url in ieAccessible.IETabUrls) foreach (string url in ieAccessible.IETabUrls)
{ {
yield return url; yield return url;
} }
} }
} }
} }
} }
} }

View file

@ -1,68 +1,68 @@
/* /*
* Greenshot - a free and open source screenshot tool * Greenshot - a free and open source screenshot tool
* Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom
* *
* For more information see: http://getgreenshot.org/ * For more information see: http://getgreenshot.org/
* The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 1 of the License, or * the Free Software Foundation, either version 1 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
using System; using System;
using System.Drawing; using System.Drawing;
using System.Drawing.Imaging; using System.Drawing.Imaging;
namespace GreenshotPlugin.Core namespace Greenshot.Base.Core
{ {
/// <summary> /// <summary>
/// The image interface, this abstracts an image /// The image interface, this abstracts an image
/// </summary> /// </summary>
public interface IImage : IDisposable public interface IImage : IDisposable
{ {
/// <summary> /// <summary>
/// Height of the image, can be set to change /// Height of the image, can be set to change
/// </summary> /// </summary>
int Height { get; set; } int Height { get; set; }
/// <summary> /// <summary>
/// Width of the image, can be set to change. /// Width of the image, can be set to change.
/// </summary> /// </summary>
int Width { get; set; } int Width { get; set; }
/// <summary> /// <summary>
/// Size of the image /// Size of the image
/// </summary> /// </summary>
Size Size { get; } Size Size { get; }
/// <summary> /// <summary>
/// Pixelformat of the underlying image /// Pixelformat of the underlying image
/// </summary> /// </summary>
PixelFormat PixelFormat { get; } PixelFormat PixelFormat { get; }
/// <summary> /// <summary>
/// Vertical resolution of the underlying image /// Vertical resolution of the underlying image
/// </summary> /// </summary>
float VerticalResolution { get; } float VerticalResolution { get; }
/// <summary> /// <summary>
/// Horizontal resolution of the underlying image /// Horizontal resolution of the underlying image
/// </summary> /// </summary>
float HorizontalResolution { get; } float HorizontalResolution { get; }
/// <summary> /// <summary>
/// Unterlying image, or an on demand rendered version with different attributes as the original /// Unterlying image, or an on demand rendered version with different attributes as the original
/// </summary> /// </summary>
Image Image { get; } Image Image { get; }
} }
} }

View file

@ -1,77 +1,77 @@
using System.Drawing; using System.Drawing;
using System.Drawing.Imaging; using System.Drawing.Imaging;
namespace GreenshotPlugin.Core namespace Greenshot.Base.Core
{ {
/// <summary> /// <summary>
/// Wrap an image, make it resizeable /// Wrap an image, make it resizeable
/// </summary> /// </summary>
public class ImageWrapper : IImage public class ImageWrapper : IImage
{ {
// Underlying image, is used to generate a resized version of it when needed // Underlying image, is used to generate a resized version of it when needed
private readonly Image _image; private readonly Image _image;
private Image _imageClone; private Image _imageClone;
public ImageWrapper(Image image) public ImageWrapper(Image image)
{ {
// Make sure the orientation is set correctly so Greenshot can process the image correctly // Make sure the orientation is set correctly so Greenshot can process the image correctly
ImageHelper.Orientate(image); ImageHelper.Orientate(image);
_image = image; _image = image;
Width = _image.Width; Width = _image.Width;
Height = _image.Height; Height = _image.Height;
} }
public void Dispose() public void Dispose()
{ {
_image.Dispose(); _image.Dispose();
_imageClone?.Dispose(); _imageClone?.Dispose();
} }
/// <summary> /// <summary>
/// Height of the image, can be set to change /// Height of the image, can be set to change
/// </summary> /// </summary>
public int Height { get; set; } public int Height { get; set; }
/// <summary> /// <summary>
/// Width of the image, can be set to change. /// Width of the image, can be set to change.
/// </summary> /// </summary>
public int Width { get; set; } public int Width { get; set; }
/// <summary> /// <summary>
/// Size of the image /// Size of the image
/// </summary> /// </summary>
public Size Size => new Size(Width, Height); public Size Size => new Size(Width, Height);
/// <summary> /// <summary>
/// Pixelformat of the underlying image /// Pixelformat of the underlying image
/// </summary> /// </summary>
public PixelFormat PixelFormat => Image.PixelFormat; public PixelFormat PixelFormat => Image.PixelFormat;
public float HorizontalResolution => Image.HorizontalResolution; public float HorizontalResolution => Image.HorizontalResolution;
public float VerticalResolution => Image.VerticalResolution; public float VerticalResolution => Image.VerticalResolution;
public Image Image public Image Image
{ {
get get
{ {
if (_imageClone == null) if (_imageClone == null)
{ {
if (_image.Height == Height && _image.Width == Width) if (_image.Height == Height && _image.Width == Width)
{ {
return _image; return _image;
} }
} }
if (_imageClone?.Height == Height && _imageClone?.Width == Width) if (_imageClone?.Height == Height && _imageClone?.Width == Width)
{ {
return _imageClone; return _imageClone;
} }
// Calculate new image clone // Calculate new image clone
_imageClone?.Dispose(); _imageClone?.Dispose();
_imageClone = ImageHelper.ResizeImage(_image, false, Width, Height, null); _imageClone = ImageHelper.ResizeImage(_image, false, Width, Height, null);
return _imageClone; return _imageClone;
} }
} }
} }
} }

View file

@ -1,73 +1,73 @@
/* /*
* Greenshot - a free and open source screenshot tool * Greenshot - a free and open source screenshot tool
* Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom
* *
* For more information see: http://getgreenshot.org/ * For more information see: http://getgreenshot.org/
* The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 1 of the License, or * the Free Software Foundation, either version 1 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Threading; using System.Threading;
using log4net; using log4net;
namespace GreenshotPlugin.Core namespace Greenshot.Base.Core
{ {
/// <summary> /// <summary>
/// Description of InterfaceUtils. /// Description of InterfaceUtils.
/// </summary> /// </summary>
public static class InterfaceUtils public static class InterfaceUtils
{ {
private static readonly ILog LOG = LogManager.GetLogger(typeof(InterfaceUtils)); private static readonly ILog LOG = LogManager.GetLogger(typeof(InterfaceUtils));
public static List<Type> GetSubclassesOf(Type type, bool excludeSystemTypes) public static List<Type> GetSubclassesOf(Type type, bool excludeSystemTypes)
{ {
var list = new List<Type>(); var list = new List<Type>();
foreach (var currentAssembly in Thread.GetDomain().GetAssemblies()) foreach (var currentAssembly in Thread.GetDomain().GetAssemblies())
{ {
try try
{ {
Type[] types = currentAssembly.GetTypes(); Type[] types = currentAssembly.GetTypes();
if (excludeSystemTypes && (!excludeSystemTypes || currentAssembly.FullName.StartsWith("System."))) if (excludeSystemTypes && (!excludeSystemTypes || currentAssembly.FullName.StartsWith("System.")))
{ {
continue; continue;
} }
foreach (var currentType in types) foreach (var currentType in types)
{ {
if (type.IsInterface) if (type.IsInterface)
{ {
if (currentType.GetInterface(type.FullName) != null) if (currentType.GetInterface(type.FullName) != null)
{ {
list.Add(currentType); list.Add(currentType);
} }
} }
else if (currentType.IsSubclassOf(type)) else if (currentType.IsSubclassOf(type))
{ {
list.Add(currentType); list.Add(currentType);
} }
} }
} }
catch (Exception ex) catch (Exception ex)
{ {
LOG.WarnFormat("Problem getting subclasses of type: {0}, message: {1}", type.FullName, ex.Message); LOG.WarnFormat("Problem getting subclasses of type: {0}, message: {1}", type.FullName, ex.Message);
} }
} }
return list; return list;
} }
} }
} }

View file

@ -1,436 +1,436 @@
/* /*
Copyright (C) 2008 Patrick van Bergen Copyright (C) 2008 Patrick van Bergen
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
using System.Collections.Generic; using System.Collections.Generic;
using System.Globalization; using System.Globalization;
using System.Text; using System.Text;
namespace GreenshotPlugin.Core namespace Greenshot.Base.Core
{ {
/// <summary> /// <summary>
/// This parses a JSON response, a modified version of the code found at: /// This parses a JSON response, a modified version of the code found at:
/// See: http://techblog.procurios.nl/k/n618/news/view/14605/14863/How-do-I-write-my-own-parser-for-JSON.html /// See: http://techblog.procurios.nl/k/n618/news/view/14605/14863/How-do-I-write-my-own-parser-for-JSON.html
/// ///
/// This file is under the MIT License, which is GPL Compatible and according to: http://en.wikipedia.org/wiki/MIT_License /// This file is under the MIT License, which is GPL Compatible and according to: http://en.wikipedia.org/wiki/MIT_License
/// can be used under the GPL "umbrella". /// can be used under the GPL "umbrella".
/// ///
/// TODO: code should be replaced when upgrading to .NET 3.5 or higher!! /// TODO: code should be replaced when upgrading to .NET 3.5 or higher!!
/// </summary> /// </summary>
public class JSONHelper public class JSONHelper
{ {
public const int TOKEN_NONE = 0; public const int TOKEN_NONE = 0;
public const int TOKEN_CURLY_OPEN = 1; public const int TOKEN_CURLY_OPEN = 1;
public const int TOKEN_CURLY_CLOSE = 2; public const int TOKEN_CURLY_CLOSE = 2;
public const int TOKEN_SQUARED_OPEN = 3; public const int TOKEN_SQUARED_OPEN = 3;
public const int TOKEN_SQUARED_CLOSE = 4; public const int TOKEN_SQUARED_CLOSE = 4;
public const int TOKEN_COLON = 5; public const int TOKEN_COLON = 5;
public const int TOKEN_COMMA = 6; public const int TOKEN_COMMA = 6;
public const int TOKEN_STRING = 7; public const int TOKEN_STRING = 7;
public const int TOKEN_NUMBER = 8; public const int TOKEN_NUMBER = 8;
public const int TOKEN_TRUE = 9; public const int TOKEN_TRUE = 9;
public const int TOKEN_FALSE = 10; public const int TOKEN_FALSE = 10;
public const int TOKEN_NULL = 11; public const int TOKEN_NULL = 11;
private const int BUILDER_CAPACITY = 2000; private const int BUILDER_CAPACITY = 2000;
/// <summary> /// <summary>
/// Parses the string json into a value /// Parses the string json into a value
/// </summary> /// </summary>
/// <param name="json">A JSON string.</param> /// <param name="json">A JSON string.</param>
/// <returns>An ArrayList, a Hashtable, a double, a string, null, true, or false</returns> /// <returns>An ArrayList, a Hashtable, a double, a string, null, true, or false</returns>
public static IDictionary<string, object> JsonDecode(string json) public static IDictionary<string, object> JsonDecode(string json)
{ {
bool success = true; bool success = true;
return JsonDecode(json, ref success); return JsonDecode(json, ref success);
} }
/// <summary> /// <summary>
/// Parses the string json into a value; and fills 'success' with the successfullness of the parse. /// Parses the string json into a value; and fills 'success' with the successfullness of the parse.
/// </summary> /// </summary>
/// <param name="json">A JSON string.</param> /// <param name="json">A JSON string.</param>
/// <param name="success">Successful parse?</param> /// <param name="success">Successful parse?</param>
/// <returns>An ArrayList, a Hashtable, a double, a string, null, true, or false</returns> /// <returns>An ArrayList, a Hashtable, a double, a string, null, true, or false</returns>
public static IDictionary<string, object> JsonDecode(string json, ref bool success) public static IDictionary<string, object> JsonDecode(string json, ref bool success)
{ {
success = true; success = true;
if (json != null) if (json != null)
{ {
char[] charArray = json.ToCharArray(); char[] charArray = json.ToCharArray();
int index = 0; int index = 0;
IDictionary<string, object> value = ParseValue(charArray, ref index, ref success) as IDictionary<string, object>; IDictionary<string, object> value = ParseValue(charArray, ref index, ref success) as IDictionary<string, object>;
return value; return value;
} }
return null; return null;
} }
protected static IDictionary<string, object> ParseObject(char[] json, ref int index, ref bool success) protected static IDictionary<string, object> ParseObject(char[] json, ref int index, ref bool success)
{ {
IDictionary<string, object> table = new Dictionary<string, object>(); IDictionary<string, object> table = new Dictionary<string, object>();
int token; int token;
// { // {
NextToken(json, ref index); NextToken(json, ref index);
bool done = false; bool done = false;
while (!done) while (!done)
{ {
token = LookAhead(json, index); token = LookAhead(json, index);
if (token == TOKEN_NONE) if (token == TOKEN_NONE)
{ {
success = false; success = false;
return null; return null;
} }
else if (token == TOKEN_COMMA) else if (token == TOKEN_COMMA)
{ {
NextToken(json, ref index); NextToken(json, ref index);
} }
else if (token == TOKEN_CURLY_CLOSE) else if (token == TOKEN_CURLY_CLOSE)
{ {
NextToken(json, ref index); NextToken(json, ref index);
return table; return table;
} }
else else
{ {
// name // name
string name = ParseString(json, ref index, ref success); string name = ParseString(json, ref index, ref success);
if (!success) if (!success)
{ {
success = false; success = false;
return null; return null;
} }
// : // :
token = NextToken(json, ref index); token = NextToken(json, ref index);
if (token != TOKEN_COLON) if (token != TOKEN_COLON)
{ {
success = false; success = false;
return null; return null;
} }
// value // value
object value = ParseValue(json, ref index, ref success); object value = ParseValue(json, ref index, ref success);
if (!success) if (!success)
{ {
success = false; success = false;
return null; return null;
} }
table.Add(name, value); table.Add(name, value);
} }
} }
return table; return table;
} }
protected static IList<object> ParseArray(char[] json, ref int index, ref bool success) protected static IList<object> ParseArray(char[] json, ref int index, ref bool success)
{ {
IList<object> array = new List<object>(); IList<object> array = new List<object>();
// [ // [
NextToken(json, ref index); NextToken(json, ref index);
bool done = false; bool done = false;
while (!done) while (!done)
{ {
int token = LookAhead(json, index); int token = LookAhead(json, index);
if (token == TOKEN_NONE) if (token == TOKEN_NONE)
{ {
success = false; success = false;
return null; return null;
} }
else if (token == TOKEN_COMMA) else if (token == TOKEN_COMMA)
{ {
NextToken(json, ref index); NextToken(json, ref index);
} }
else if (token == TOKEN_SQUARED_CLOSE) else if (token == TOKEN_SQUARED_CLOSE)
{ {
NextToken(json, ref index); NextToken(json, ref index);
break; break;
} }
else else
{ {
object value = ParseValue(json, ref index, ref success); object value = ParseValue(json, ref index, ref success);
if (!success) if (!success)
{ {
return null; return null;
} }
array.Add(value); array.Add(value);
} }
} }
return array; return array;
} }
protected static object ParseValue(char[] json, ref int index, ref bool success) protected static object ParseValue(char[] json, ref int index, ref bool success)
{ {
switch (LookAhead(json, index)) switch (LookAhead(json, index))
{ {
case TOKEN_STRING: case TOKEN_STRING:
return ParseString(json, ref index, ref success); return ParseString(json, ref index, ref success);
case TOKEN_NUMBER: case TOKEN_NUMBER:
return ParseNumber(json, ref index, ref success); return ParseNumber(json, ref index, ref success);
case TOKEN_CURLY_OPEN: case TOKEN_CURLY_OPEN:
return ParseObject(json, ref index, ref success); return ParseObject(json, ref index, ref success);
case TOKEN_SQUARED_OPEN: case TOKEN_SQUARED_OPEN:
return ParseArray(json, ref index, ref success); return ParseArray(json, ref index, ref success);
case TOKEN_TRUE: case TOKEN_TRUE:
NextToken(json, ref index); NextToken(json, ref index);
return true; return true;
case TOKEN_FALSE: case TOKEN_FALSE:
NextToken(json, ref index); NextToken(json, ref index);
return false; return false;
case TOKEN_NULL: case TOKEN_NULL:
NextToken(json, ref index); NextToken(json, ref index);
return null; return null;
case TOKEN_NONE: case TOKEN_NONE:
break; break;
} }
success = false; success = false;
return null; return null;
} }
protected static string ParseString(char[] json, ref int index, ref bool success) protected static string ParseString(char[] json, ref int index, ref bool success)
{ {
StringBuilder s = new StringBuilder(BUILDER_CAPACITY); StringBuilder s = new StringBuilder(BUILDER_CAPACITY);
EatWhitespace(json, ref index); EatWhitespace(json, ref index);
// " // "
var c = json[index++]; var c = json[index++];
bool complete = false; bool complete = false;
while (!complete) while (!complete)
{ {
if (index == json.Length) if (index == json.Length)
{ {
break; break;
} }
c = json[index++]; c = json[index++];
if (c == '"') if (c == '"')
{ {
complete = true; complete = true;
break; break;
} }
else if (c == '\\') else if (c == '\\')
{ {
if (index == json.Length) if (index == json.Length)
{ {
break; break;
} }
c = json[index++]; c = json[index++];
if (c == '"') if (c == '"')
{ {
s.Append('"'); s.Append('"');
} }
else if (c == '\\') else if (c == '\\')
{ {
s.Append('\\'); s.Append('\\');
} }
else if (c == '/') else if (c == '/')
{ {
s.Append('/'); s.Append('/');
} }
else if (c == 'b') else if (c == 'b')
{ {
s.Append('\b'); s.Append('\b');
} }
else if (c == 'f') else if (c == 'f')
{ {
s.Append('\f'); s.Append('\f');
} }
else if (c == 'n') else if (c == 'n')
{ {
s.Append('\n'); s.Append('\n');
} }
else if (c == 'r') else if (c == 'r')
{ {
s.Append('\r'); s.Append('\r');
} }
else if (c == 't') else if (c == 't')
{ {
s.Append('\t'); s.Append('\t');
} }
else if (c == 'u') else if (c == 'u')
{ {
int remainingLength = json.Length - index; int remainingLength = json.Length - index;
if (remainingLength >= 4) if (remainingLength >= 4)
{ {
// parse the 32 bit hex into an integer codepoint // parse the 32 bit hex into an integer codepoint
if (!(success = uint.TryParse(new string(json, index, 4), NumberStyles.HexNumber, CultureInfo.InvariantCulture, out var codePoint))) if (!(success = uint.TryParse(new string(json, index, 4), NumberStyles.HexNumber, CultureInfo.InvariantCulture, out var codePoint)))
{ {
return string.Empty; return string.Empty;
} }
// convert the integer codepoint to a unicode char and add to string // convert the integer codepoint to a unicode char and add to string
s.Append(char.ConvertFromUtf32((int) codePoint)); s.Append(char.ConvertFromUtf32((int) codePoint));
// skip 4 chars // skip 4 chars
index += 4; index += 4;
} }
else else
{ {
break; break;
} }
} }
} }
else else
{ {
s.Append(c); s.Append(c);
} }
} }
if (!complete) if (!complete)
{ {
success = false; success = false;
return null; return null;
} }
return s.ToString(); return s.ToString();
} }
protected static double ParseNumber(char[] json, ref int index, ref bool success) protected static double ParseNumber(char[] json, ref int index, ref bool success)
{ {
EatWhitespace(json, ref index); EatWhitespace(json, ref index);
int lastIndex = GetLastIndexOfNumber(json, index); int lastIndex = GetLastIndexOfNumber(json, index);
int charLength = (lastIndex - index) + 1; int charLength = (lastIndex - index) + 1;
success = double.TryParse(new string(json, index, charLength), NumberStyles.Any, CultureInfo.InvariantCulture, out var number); success = double.TryParse(new string(json, index, charLength), NumberStyles.Any, CultureInfo.InvariantCulture, out var number);
index = lastIndex + 1; index = lastIndex + 1;
return number; return number;
} }
protected static int GetLastIndexOfNumber(char[] json, int index) protected static int GetLastIndexOfNumber(char[] json, int index)
{ {
int lastIndex; int lastIndex;
for (lastIndex = index; lastIndex < json.Length; lastIndex++) for (lastIndex = index; lastIndex < json.Length; lastIndex++)
{ {
if ("0123456789+-.eE".IndexOf(json[lastIndex]) == -1) if ("0123456789+-.eE".IndexOf(json[lastIndex]) == -1)
{ {
break; break;
} }
} }
return lastIndex - 1; return lastIndex - 1;
} }
protected static void EatWhitespace(char[] json, ref int index) protected static void EatWhitespace(char[] json, ref int index)
{ {
for (; index < json.Length; index++) for (; index < json.Length; index++)
{ {
if (" \t\n\r".IndexOf(json[index]) == -1) if (" \t\n\r".IndexOf(json[index]) == -1)
{ {
break; break;
} }
} }
} }
protected static int LookAhead(char[] json, int index) protected static int LookAhead(char[] json, int index)
{ {
int saveIndex = index; int saveIndex = index;
return NextToken(json, ref saveIndex); return NextToken(json, ref saveIndex);
} }
protected static int NextToken(char[] json, ref int index) protected static int NextToken(char[] json, ref int index)
{ {
EatWhitespace(json, ref index); EatWhitespace(json, ref index);
if (index == json.Length) if (index == json.Length)
{ {
return TOKEN_NONE; return TOKEN_NONE;
} }
char c = json[index]; char c = json[index];
index++; index++;
switch (c) switch (c)
{ {
case '{': case '{':
return TOKEN_CURLY_OPEN; return TOKEN_CURLY_OPEN;
case '}': case '}':
return TOKEN_CURLY_CLOSE; return TOKEN_CURLY_CLOSE;
case '[': case '[':
return TOKEN_SQUARED_OPEN; return TOKEN_SQUARED_OPEN;
case ']': case ']':
return TOKEN_SQUARED_CLOSE; return TOKEN_SQUARED_CLOSE;
case ',': case ',':
return TOKEN_COMMA; return TOKEN_COMMA;
case '"': case '"':
return TOKEN_STRING; return TOKEN_STRING;
case '0': case '0':
case '1': case '1':
case '2': case '2':
case '3': case '3':
case '4': case '4':
case '5': case '5':
case '6': case '6':
case '7': case '7':
case '8': case '8':
case '9': case '9':
case '-': case '-':
return TOKEN_NUMBER; return TOKEN_NUMBER;
case ':': case ':':
return TOKEN_COLON; return TOKEN_COLON;
} }
index--; index--;
int remainingLength = json.Length - index; int remainingLength = json.Length - index;
// false // false
if (remainingLength >= 5) if (remainingLength >= 5)
{ {
if (json[index] == 'f' && if (json[index] == 'f' &&
json[index + 1] == 'a' && json[index + 1] == 'a' &&
json[index + 2] == 'l' && json[index + 2] == 'l' &&
json[index + 3] == 's' && json[index + 3] == 's' &&
json[index + 4] == 'e') json[index + 4] == 'e')
{ {
index += 5; index += 5;
return TOKEN_FALSE; return TOKEN_FALSE;
} }
} }
// true // true
if (remainingLength >= 4) if (remainingLength >= 4)
{ {
if (json[index] == 't' && if (json[index] == 't' &&
json[index + 1] == 'r' && json[index + 1] == 'r' &&
json[index + 2] == 'u' && json[index + 2] == 'u' &&
json[index + 3] == 'e') json[index + 3] == 'e')
{ {
index += 4; index += 4;
return TOKEN_TRUE; return TOKEN_TRUE;
} }
} }
// null // null
if (remainingLength >= 4) if (remainingLength >= 4)
{ {
if (json[index] == 'n' && if (json[index] == 'n' &&
json[index + 1] == 'u' && json[index + 1] == 'u' &&
json[index + 2] == 'l' && json[index + 2] == 'l' &&
json[index + 3] == 'l') json[index + 3] == 'l')
{ {
index += 4; index += 4;
return TOKEN_NULL; return TOKEN_NULL;
} }
} }
return TOKEN_NONE; return TOKEN_NONE;
} }
} }
} }

View file

@ -1,6 +1,6 @@
using System; using System;
namespace GreenshotPlugin.Core namespace Greenshot.Base.Core
{ {
public delegate void LanguageChangedHandler(object sender, EventArgs e); public delegate void LanguageChangedHandler(object sender, EventArgs e);
} }

View file

@ -1,80 +1,80 @@
using System; using System;
namespace GreenshotPlugin.Core namespace Greenshot.Base.Core
{ {
/// <summary> /// <summary>
/// This class contains the information about a language file /// This class contains the information about a language file
/// </summary> /// </summary>
public class LanguageFile : IEquatable<LanguageFile> public class LanguageFile : IEquatable<LanguageFile>
{ {
public string Description { get; set; } public string Description { get; set; }
public string Ietf { get; set; } public string Ietf { get; set; }
public Version Version { get; set; } public Version Version { get; set; }
public string LanguageGroup { get; set; } public string LanguageGroup { get; set; }
public string Filepath { get; set; } public string Filepath { get; set; }
public string Prefix { get; set; } public string Prefix { get; set; }
/// <summary> /// <summary>
/// Overload equals so we can delete a entry from a collection /// Overload equals so we can delete a entry from a collection
/// </summary> /// </summary>
/// <param name="other"></param> /// <param name="other"></param>
/// <returns></returns> /// <returns></returns>
public bool Equals(LanguageFile other) public bool Equals(LanguageFile other)
{ {
if (Prefix != null) if (Prefix != null)
{ {
if (other != null && !Prefix.Equals(other.Prefix)) if (other != null && !Prefix.Equals(other.Prefix))
{ {
return false; return false;
} }
} }
else if (other?.Prefix != null) else if (other?.Prefix != null)
{ {
return false; return false;
} }
if (Ietf != null) if (Ietf != null)
{ {
if (other != null && !Ietf.Equals(other.Ietf)) if (other != null && !Ietf.Equals(other.Ietf))
{ {
return false; return false;
} }
} }
else if (other?.Ietf != null) else if (other?.Ietf != null)
{ {
return false; return false;
} }
if (Version != null) if (Version != null)
{ {
if (other != null && !Version.Equals(other.Version)) if (other != null && !Version.Equals(other.Version))
{ {
return false; return false;
} }
} }
else if (other != null && other.Version != null) else if (other != null && other.Version != null)
{ {
return false; return false;
} }
if (Filepath != null) if (Filepath != null)
{ {
if (other != null && !Filepath.Equals(other.Filepath)) if (other != null && !Filepath.Equals(other.Filepath))
{ {
return false; return false;
} }
} }
else if (other?.Filepath != null) else if (other?.Filepath != null)
{ {
return false; return false;
} }
return true; return true;
} }
} }
} }

View file

@ -1,124 +1,124 @@
/* /*
* Greenshot - a free and open source screenshot tool * Greenshot - a free and open source screenshot tool
* Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom
* *
* For more information see: http://getgreenshot.org/ * For more information see: http://getgreenshot.org/
* The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 1 of the License, or * the Free Software Foundation, either version 1 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
using System.IO; using System;
using System.Reflection; using System.IO;
using System.Windows.Forms; using System.Reflection;
using log4net; using System.Windows.Forms;
using log4net.Appender; using Greenshot.Base.IniFile;
using log4net.Config; using log4net;
using log4net.Repository.Hierarchy; using log4net.Appender;
using System; using log4net.Config;
using GreenshotPlugin.IniFile; using log4net.Repository.Hierarchy;
using log4net.Util; using log4net.Util;
namespace GreenshotPlugin.Core namespace Greenshot.Base.Core
{ {
/// <summary> /// <summary>
/// Initialize the logger /// Initialize the logger
/// </summary> /// </summary>
public class LogHelper public class LogHelper
{ {
private static bool _isLog4NetConfigured; private static bool _isLog4NetConfigured;
private const string InitMessage = "Greenshot initialization of log system failed"; private const string InitMessage = "Greenshot initialization of log system failed";
public static bool IsInitialized => _isLog4NetConfigured; public static bool IsInitialized => _isLog4NetConfigured;
// Initialize Log4J // Initialize Log4J
public static string InitializeLog4Net() public static string InitializeLog4Net()
{ {
// Setup log4j, currently the file is called log4net.xml // Setup log4j, currently the file is called log4net.xml
foreach (var logName in new[] foreach (var logName in new[]
{ {
"log4net.xml", @"App\Greenshot\log4net-portable.xml" "log4net.xml", @"App\Greenshot\log4net-portable.xml"
}) })
{ {
string log4NetFilename = Path.Combine(Application.StartupPath, logName); string log4NetFilename = Path.Combine(Application.StartupPath, logName);
if (File.Exists(log4NetFilename)) if (File.Exists(log4NetFilename))
{ {
try try
{ {
XmlConfigurator.Configure(new FileInfo(log4NetFilename)); XmlConfigurator.Configure(new FileInfo(log4NetFilename));
_isLog4NetConfigured = true; _isLog4NetConfigured = true;
} }
catch (Exception ex) catch (Exception ex)
{ {
MessageBox.Show(ex.Message, InitMessage, MessageBoxButtons.OK, MessageBoxIcon.Warning); MessageBox.Show(ex.Message, InitMessage, MessageBoxButtons.OK, MessageBoxIcon.Warning);
} }
} }
} }
// Fallback // Fallback
if (!_isLog4NetConfigured) if (!_isLog4NetConfigured)
{ {
try try
{ {
Assembly assembly = typeof(LogHelper).Assembly; Assembly assembly = typeof(LogHelper).Assembly;
using Stream stream = assembly.GetManifestResourceStream("GreenshotPlugin.log4net-embedded.xml"); using Stream stream = assembly.GetManifestResourceStream("GreenshotPlugin.log4net-embedded.xml");
XmlConfigurator.Configure(stream); XmlConfigurator.Configure(stream);
_isLog4NetConfigured = true; _isLog4NetConfigured = true;
IniConfig.ForceIniInStartupPath(); IniConfig.ForceIniInStartupPath();
} }
catch (Exception ex) catch (Exception ex)
{ {
MessageBox.Show(ex.Message, InitMessage, MessageBoxButtons.OK, MessageBoxIcon.Warning); MessageBox.Show(ex.Message, InitMessage, MessageBoxButtons.OK, MessageBoxIcon.Warning);
} }
} }
if (_isLog4NetConfigured) if (_isLog4NetConfigured)
{ {
// Get the logfile name // Get the logfile name
try try
{ {
if (((Hierarchy) LogManager.GetRepository()).Root.Appenders.Count > 0) if (((Hierarchy) LogManager.GetRepository()).Root.Appenders.Count > 0)
{ {
foreach (IAppender appender in ((Hierarchy) LogManager.GetRepository()).Root.Appenders) foreach (IAppender appender in ((Hierarchy) LogManager.GetRepository()).Root.Appenders)
{ {
var fileAppender = appender as FileAppender; var fileAppender = appender as FileAppender;
if (fileAppender != null) if (fileAppender != null)
{ {
return fileAppender.File; return fileAppender.File;
} }
} }
} }
} }
catch catch
{ {
// ignored // ignored
} }
} }
return null; return null;
} }
} }
/// <summary> /// <summary>
/// A simple helper class to support the logging to the AppData location /// A simple helper class to support the logging to the AppData location
/// </summary> /// </summary>
public class SpecialFolderPatternConverter : PatternConverter public class SpecialFolderPatternConverter : PatternConverter
{ {
protected override void Convert(TextWriter writer, object state) protected override void Convert(TextWriter writer, object state)
{ {
Environment.SpecialFolder specialFolder = (Environment.SpecialFolder) Enum.Parse(typeof(Environment.SpecialFolder), Option, true); Environment.SpecialFolder specialFolder = (Environment.SpecialFolder) Enum.Parse(typeof(Environment.SpecialFolder), Option, true);
writer.Write(Environment.GetFolderPath(specialFolder)); writer.Write(Environment.GetFolderPath(specialFolder));
} }
} }
} }

View file

@ -30,7 +30,7 @@ using System.Threading;
using log4net; using log4net;
using Newtonsoft.Json; using Newtonsoft.Json;
namespace GreenshotPlugin.Core.OAuth namespace Greenshot.Base.Core.OAuth
{ {
/// <summary> /// <summary>
/// OAuth 2.0 verification code receiver that runs a local server on a free port /// OAuth 2.0 verification code receiver that runs a local server on a free port

View file

@ -29,7 +29,7 @@ using System.Text;
using System.Threading; using System.Threading;
using log4net; using log4net;
namespace GreenshotPlugin.Core.OAuth namespace Greenshot.Base.Core.OAuth
{ {
/// <summary> /// <summary>
/// OAuth 2.0 verification code receiver that runs a local server on a free port /// OAuth 2.0 verification code receiver that runs a local server on a free port

View file

@ -19,7 +19,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
namespace GreenshotPlugin.Core.OAuth namespace Greenshot.Base.Core.OAuth
{ {
/// <summary> /// <summary>
/// Specify the authorize mode that is used to get the token from the cloud service. /// Specify the authorize mode that is used to get the token from the cloud service.

View file

@ -23,9 +23,9 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Drawing; using System.Drawing;
using System.Net; using System.Net;
using GreenshotPlugin.Controls; using Greenshot.Base.Controls;
namespace GreenshotPlugin.Core.OAuth namespace Greenshot.Base.Core.OAuth
{ {
/// <summary> /// <summary>
/// Code to simplify OAuth 2 /// Code to simplify OAuth 2

View file

@ -23,7 +23,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Drawing; using System.Drawing;
namespace GreenshotPlugin.Core.OAuth namespace Greenshot.Base.Core.OAuth
{ {
/// <summary> /// <summary>
/// Settings for the OAuth 2 protocol /// Settings for the OAuth 2 protocol

View file

@ -27,10 +27,10 @@ using System.Net;
using System.Security.Cryptography; using System.Security.Cryptography;
using System.Text; using System.Text;
using System.Threading; using System.Threading;
using GreenshotPlugin.Controls; using Greenshot.Base.Controls;
using log4net; using log4net;
namespace GreenshotPlugin.Core.OAuth namespace Greenshot.Base.Core.OAuth
{ {
/// <summary> /// <summary>
/// An OAuth 1 session object /// An OAuth 1 session object

View file

@ -19,7 +19,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
namespace GreenshotPlugin.Core.OAuth namespace Greenshot.Base.Core.OAuth
{ {
/// <summary> /// <summary>
/// Provides a predefined set of algorithms that are supported officially by the OAuth 1.x protocol /// Provides a predefined set of algorithms that are supported officially by the OAuth 1.x protocol

View file

@ -1,118 +1,118 @@
/* /*
* Greenshot - a free and open source screenshot tool * Greenshot - a free and open source screenshot tool
* Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom
* *
* For more information see: http://getgreenshot.org/ * For more information see: http://getgreenshot.org/
* The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 1 of the License, or * the Free Software Foundation, either version 1 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Reflection; using System.Reflection;
using System.Runtime.Serialization; using System.Runtime.Serialization;
using System.Runtime.Serialization.Formatters.Binary; using System.Runtime.Serialization.Formatters.Binary;
namespace GreenshotPlugin.Core namespace Greenshot.Base.Core
{ {
/// <summary> /// <summary>
/// Extension methods which work for objects /// Extension methods which work for objects
/// </summary> /// </summary>
public static class ObjectExtensions public static class ObjectExtensions
{ {
/// <summary> /// <summary>
/// Perform a deep Copy of the object. /// Perform a deep Copy of the object.
/// </summary> /// </summary>
/// <typeparam name="T">The type of object being copied.</typeparam> /// <typeparam name="T">The type of object being copied.</typeparam>
/// <param name="source">The object instance to copy.</param> /// <param name="source">The object instance to copy.</param>
/// <returns>The copied object.</returns> /// <returns>The copied object.</returns>
public static T Clone<T>(this T source) public static T Clone<T>(this T source)
{ {
var typeparam = typeof(T); var typeparam = typeof(T);
if (!typeparam.IsInterface && !typeparam.IsSerializable) if (!typeparam.IsInterface && !typeparam.IsSerializable)
{ {
throw new ArgumentException("The type must be serializable.", nameof(source)); throw new ArgumentException("The type must be serializable.", nameof(source));
} }
// Don't serialize a null object, simply return the default for that object // Don't serialize a null object, simply return the default for that object
if (source == null) if (source == null)
{ {
return default; return default;
} }
IFormatter formatter = new BinaryFormatter(); IFormatter formatter = new BinaryFormatter();
using var stream = new MemoryStream(); using var stream = new MemoryStream();
formatter.Serialize(stream, source); formatter.Serialize(stream, source);
stream.Seek(0, SeekOrigin.Begin); stream.Seek(0, SeekOrigin.Begin);
return (T) formatter.Deserialize(stream); return (T) formatter.Deserialize(stream);
} }
/// <summary> /// <summary>
/// Clone the content from source to destination /// Clone the content from source to destination
/// </summary> /// </summary>
/// <typeparam name="T">Type to clone</typeparam> /// <typeparam name="T">Type to clone</typeparam>
/// <param name="source">Instance to copy from</param> /// <param name="source">Instance to copy from</param>
/// <param name="destination">Instance to copy to</param> /// <param name="destination">Instance to copy to</param>
public static void CloneTo<T>(this T source, T destination) public static void CloneTo<T>(this T source, T destination)
{ {
var type = typeof(T); var type = typeof(T);
var myObjectFields = type.GetFields(BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance); var myObjectFields = type.GetFields(BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance);
foreach (var fieldInfo in myObjectFields) foreach (var fieldInfo in myObjectFields)
{ {
fieldInfo.SetValue(destination, fieldInfo.GetValue(source)); fieldInfo.SetValue(destination, fieldInfo.GetValue(source));
} }
var myObjectProperties = type.GetProperties(BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance); var myObjectProperties = type.GetProperties(BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance);
foreach (var propertyInfo in myObjectProperties) foreach (var propertyInfo in myObjectProperties)
{ {
if (propertyInfo.CanWrite) if (propertyInfo.CanWrite)
{ {
propertyInfo.SetValue(destination, propertyInfo.GetValue(source, null), null); propertyInfo.SetValue(destination, propertyInfo.GetValue(source, null), null);
} }
} }
} }
/// <summary> /// <summary>
/// Compare two lists /// Compare two lists
/// </summary> /// </summary>
/// <typeparam name="T"></typeparam> /// <typeparam name="T"></typeparam>
/// <param name="l1">IList</param> /// <param name="l1">IList</param>
/// <param name="l2">IList</param> /// <param name="l2">IList</param>
/// <returns>true if they are the same</returns> /// <returns>true if they are the same</returns>
public static bool CompareLists<T>(IList<T> l1, IList<T> l2) public static bool CompareLists<T>(IList<T> l1, IList<T> l2)
{ {
if (l1.Count != l2.Count) if (l1.Count != l2.Count)
{ {
return false; return false;
} }
int matched = 0; int matched = 0;
foreach (T item in l1) foreach (T item in l1)
{ {
if (!l2.Contains(item)) if (!l2.Contains(item))
{ {
return false; return false;
} }
matched++; matched++;
} }
return matched == l1.Count; return matched == l1.Count;
} }
} }
} }

View file

@ -1,228 +1,228 @@
/* /*
* Greenshot - a free and open source screenshot tool * Greenshot - a free and open source screenshot tool
* Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom
* *
* For more information see: http://getgreenshot.org/ * For more information see: http://getgreenshot.org/
* The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 1 of the License, or * the Free Software Foundation, either version 1 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
using GreenshotPlugin.UnmanagedHelpers; using System;
using log4net; using System.Collections.Generic;
using Microsoft.Win32; using System.ComponentModel;
using System; using System.Drawing;
using System.Collections.Generic; using System.IO;
using System.ComponentModel; using System.Windows.Forms;
using System.Drawing; using Greenshot.Base.IniFile;
using System.IO; using Greenshot.Base.UnmanagedHelpers;
using System.Windows.Forms; using log4net;
using GreenshotPlugin.IniFile; using Microsoft.Win32;
namespace GreenshotPlugin.Core namespace Greenshot.Base.Core
{ {
/// <summary> /// <summary>
/// Description of PluginUtils. /// Description of PluginUtils.
/// </summary> /// </summary>
public static class PluginUtils public static class PluginUtils
{ {
private static readonly ILog Log = LogManager.GetLogger(typeof(PluginUtils)); private static readonly ILog Log = LogManager.GetLogger(typeof(PluginUtils));
private static readonly CoreConfiguration CoreConfig = IniConfig.GetIniSection<CoreConfiguration>(); private static readonly CoreConfiguration CoreConfig = IniConfig.GetIniSection<CoreConfiguration>();
private const string PathKey = @"SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\"; private const string PathKey = @"SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\";
private static readonly IDictionary<string, Image> ExeIconCache = new Dictionary<string, Image>(); private static readonly IDictionary<string, Image> ExeIconCache = new Dictionary<string, Image>();
static PluginUtils() static PluginUtils()
{ {
CoreConfig.PropertyChanged += OnIconSizeChanged; CoreConfig.PropertyChanged += OnIconSizeChanged;
} }
/// <summary> /// <summary>
/// Clear icon cache /// Clear icon cache
/// </summary> /// </summary>
/// <param name="sender"></param> /// <param name="sender"></param>
/// <param name="e"></param> /// <param name="e"></param>
private static void OnIconSizeChanged(object sender, PropertyChangedEventArgs e) private static void OnIconSizeChanged(object sender, PropertyChangedEventArgs e)
{ {
if (e.PropertyName != "IconSize") return; if (e.PropertyName != "IconSize") return;
var cachedImages = new List<Image>(); var cachedImages = new List<Image>();
lock (ExeIconCache) lock (ExeIconCache)
{ {
foreach (string key in ExeIconCache.Keys) foreach (string key in ExeIconCache.Keys)
{ {
cachedImages.Add(ExeIconCache[key]); cachedImages.Add(ExeIconCache[key]);
} }
ExeIconCache.Clear(); ExeIconCache.Clear();
} }
foreach (Image cachedImage in cachedImages) foreach (Image cachedImage in cachedImages)
{ {
cachedImage?.Dispose(); cachedImage?.Dispose();
} }
} }
/// <summary> /// <summary>
/// Get the path of an executable /// Get the path of an executable
/// </summary> /// </summary>
/// <param name="exeName">e.g. cmd.exe</param> /// <param name="exeName">e.g. cmd.exe</param>
/// <returns>Path to file</returns> /// <returns>Path to file</returns>
public static string GetExePath(string exeName) public static string GetExePath(string exeName)
{ {
using (var key = Registry.LocalMachine.OpenSubKey(PathKey + exeName, false)) using (var key = Registry.LocalMachine.OpenSubKey(PathKey + exeName, false))
{ {
if (key != null) if (key != null)
{ {
// "" is the default key, which should point to the requested location // "" is the default key, which should point to the requested location
return (string) key.GetValue(string.Empty); return (string) key.GetValue(string.Empty);
} }
} }
foreach (string pathEntry in (Environment.GetEnvironmentVariable("PATH") ?? string.Empty).Split(';')) foreach (string pathEntry in (Environment.GetEnvironmentVariable("PATH") ?? string.Empty).Split(';'))
{ {
try try
{ {
string path = pathEntry.Trim(); string path = pathEntry.Trim();
if (!string.IsNullOrEmpty(path) && File.Exists(path = Path.Combine(path, exeName))) if (!string.IsNullOrEmpty(path) && File.Exists(path = Path.Combine(path, exeName)))
{ {
return Path.GetFullPath(path); return Path.GetFullPath(path);
} }
} }
catch (Exception) catch (Exception)
{ {
Log.WarnFormat("Problem with path entry '{0}'.", pathEntry); Log.WarnFormat("Problem with path entry '{0}'.", pathEntry);
} }
} }
return null; return null;
} }
/// <summary> /// <summary>
/// Get icon from resource files, from the cache. /// Get icon from resource files, from the cache.
/// Examples can be found here: https://diymediahome.org/windows-icons-reference-list-with-details-locations-images/ /// Examples can be found here: https://diymediahome.org/windows-icons-reference-list-with-details-locations-images/
/// </summary> /// </summary>
/// <param name="path">path to the exe or dll</param> /// <param name="path">path to the exe or dll</param>
/// <param name="index">index of the icon</param> /// <param name="index">index of the icon</param>
/// <returns>Bitmap with the icon or null if something happended</returns> /// <returns>Bitmap with the icon or null if something happended</returns>
public static Image GetCachedExeIcon(string path, int index) public static Image GetCachedExeIcon(string path, int index)
{ {
string cacheKey = $"{path}:{index}"; string cacheKey = $"{path}:{index}";
Image returnValue; Image returnValue;
lock (ExeIconCache) lock (ExeIconCache)
{ {
if (ExeIconCache.TryGetValue(cacheKey, out returnValue)) if (ExeIconCache.TryGetValue(cacheKey, out returnValue))
{ {
return returnValue; return returnValue;
} }
lock (ExeIconCache) lock (ExeIconCache)
{ {
if (ExeIconCache.TryGetValue(cacheKey, out returnValue)) if (ExeIconCache.TryGetValue(cacheKey, out returnValue))
{ {
return returnValue; return returnValue;
} }
returnValue = GetExeIcon(path, index); returnValue = GetExeIcon(path, index);
if (returnValue != null) if (returnValue != null)
{ {
ExeIconCache.Add(cacheKey, returnValue); ExeIconCache.Add(cacheKey, returnValue);
} }
} }
} }
return returnValue; return returnValue;
} }
/// <summary> /// <summary>
/// Get icon for executable /// Get icon for executable
/// </summary> /// </summary>
/// <param name="path">path to the exe or dll</param> /// <param name="path">path to the exe or dll</param>
/// <param name="index">index of the icon</param> /// <param name="index">index of the icon</param>
/// <returns>Bitmap with the icon or null if something happended</returns> /// <returns>Bitmap with the icon or null if something happended</returns>
private static Bitmap GetExeIcon(string path, int index) private static Bitmap GetExeIcon(string path, int index)
{ {
if (!File.Exists(path)) if (!File.Exists(path))
{ {
return null; return null;
} }
try try
{ {
using (Icon appIcon = ImageHelper.ExtractAssociatedIcon(path, index, CoreConfig.UseLargeIcons)) using (Icon appIcon = ImageHelper.ExtractAssociatedIcon(path, index, CoreConfig.UseLargeIcons))
{ {
if (appIcon != null) if (appIcon != null)
{ {
return appIcon.ToBitmap(); return appIcon.ToBitmap();
} }
} }
using (Icon appIcon = Shell32.GetFileIcon(path, CoreConfig.UseLargeIcons ? Shell32.IconSize.Large : Shell32.IconSize.Small, false)) using (Icon appIcon = Shell32.GetFileIcon(path, CoreConfig.UseLargeIcons ? Shell32.IconSize.Large : Shell32.IconSize.Small, false))
{ {
if (appIcon != null) if (appIcon != null)
{ {
return appIcon.ToBitmap(); return appIcon.ToBitmap();
} }
} }
} }
catch (Exception exIcon) catch (Exception exIcon)
{ {
Log.Error("error retrieving icon: ", exIcon); Log.Error("error retrieving icon: ", exIcon);
} }
return null; return null;
} }
/// <summary> /// <summary>
/// Helper method to add a plugin MenuItem to the Greenshot context menu /// Helper method to add a plugin MenuItem to the Greenshot context menu
/// </summary> /// </summary>
/// <param name="item">ToolStripMenuItem</param> /// <param name="item">ToolStripMenuItem</param>
public static void AddToContextMenu(ToolStripMenuItem item) public static void AddToContextMenu(ToolStripMenuItem item)
{ {
// Here we can hang ourselves to the main context menu! // Here we can hang ourselves to the main context menu!
var contextMenu = SimpleServiceProvider.Current.GetInstance<ContextMenuStrip>(); var contextMenu = SimpleServiceProvider.Current.GetInstance<ContextMenuStrip>();
bool addedItem = false; bool addedItem = false;
// Try to find a separator, so we insert ourselves after it // Try to find a separator, so we insert ourselves after it
for (int i = 0; i < contextMenu.Items.Count; i++) for (int i = 0; i < contextMenu.Items.Count; i++)
{ {
if (contextMenu.Items[i].GetType() == typeof(ToolStripSeparator)) if (contextMenu.Items[i].GetType() == typeof(ToolStripSeparator))
{ {
// Check if we need to add a new separator, which is done if the first found has a Tag with the value "PluginsAreAddedBefore" // Check if we need to add a new separator, which is done if the first found has a Tag with the value "PluginsAreAddedBefore"
if ("PluginsAreAddedBefore".Equals(contextMenu.Items[i].Tag)) if ("PluginsAreAddedBefore".Equals(contextMenu.Items[i].Tag))
{ {
var separator = new ToolStripSeparator var separator = new ToolStripSeparator
{ {
Tag = "PluginsAreAddedAfter", Tag = "PluginsAreAddedAfter",
Size = new Size(305, 6) Size = new Size(305, 6)
}; };
contextMenu.Items.Insert(i, separator); contextMenu.Items.Insert(i, separator);
} }
else if (!"PluginsAreAddedAfter".Equals(contextMenu.Items[i].Tag)) else if (!"PluginsAreAddedAfter".Equals(contextMenu.Items[i].Tag))
{ {
continue; continue;
} }
contextMenu.Items.Insert(i + 1, item); contextMenu.Items.Insert(i + 1, item);
addedItem = true; addedItem = true;
break; break;
} }
} }
// If we didn't insert the item, we just add it... // If we didn't insert the item, we just add it...
if (!addedItem) if (!addedItem)
{ {
contextMenu.Items.Add(item); contextMenu.Items.Add(item);
} }
} }
} }
} }

View file

@ -22,7 +22,7 @@
using System; using System;
using Microsoft.Win32; using Microsoft.Win32;
namespace GreenshotPlugin.Core namespace Greenshot.Base.Core
{ {
/// <summary> /// <summary>
/// A helper class for accessing the registry /// A helper class for accessing the registry

View file

@ -1,61 +1,61 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using GreenshotPlugin.Interfaces; using Greenshot.Base.Interfaces;
namespace GreenshotPlugin.Core namespace Greenshot.Base.Core
{ {
/// <summary> /// <summary>
/// A really cheap and simple DI system /// A really cheap and simple DI system
/// </summary> /// </summary>
public class SimpleServiceProvider : IServiceLocator public class SimpleServiceProvider : IServiceLocator
{ {
private readonly Dictionary<Type, List<object>> _services = new Dictionary<Type, List<object>>(); private readonly Dictionary<Type, List<object>> _services = new Dictionary<Type, List<object>>();
public static IServiceLocator Current { get; } = new SimpleServiceProvider(); public static IServiceLocator Current { get; } = new SimpleServiceProvider();
public IEnumerable<TService> GetAllInstances<TService>() public IEnumerable<TService> GetAllInstances<TService>()
{ {
var typeOfService = typeof(TService); var typeOfService = typeof(TService);
if (!_services.TryGetValue(typeOfService, out var results)) if (!_services.TryGetValue(typeOfService, out var results))
{ {
yield break; yield break;
} }
foreach (TService result in results) foreach (TService result in results)
{ {
yield return result; yield return result;
} }
} }
public TService GetInstance<TService>() public TService GetInstance<TService>()
{ {
return GetAllInstances<TService>().SingleOrDefault(); return GetAllInstances<TService>().SingleOrDefault();
} }
public void AddService<TService>(IEnumerable<TService> services) public void AddService<TService>(IEnumerable<TService> services)
{ {
var serviceType = typeof(TService); var serviceType = typeof(TService);
if (!_services.TryGetValue(serviceType, out var currentServices)) if (!_services.TryGetValue(serviceType, out var currentServices))
{ {
currentServices = new List<object>(); currentServices = new List<object>();
_services.Add(serviceType, currentServices); _services.Add(serviceType, currentServices);
} }
foreach (var service in services) foreach (var service in services)
{ {
if (service == null) if (service == null)
{ {
continue; continue;
} }
currentServices.Add(service); currentServices.Add(service);
} }
} }
public void AddService<TService>(params TService[] services) public void AddService<TService>(params TService[] services)
{ {
AddService(services.AsEnumerable()); AddService(services.AsEnumerable());
} }
} }
} }

View file

@ -20,14 +20,14 @@
*/ */
using System; using System;
using System.Collections.Generic;
using System.IO; using System.IO;
using System.Security.Cryptography; using System.Security.Cryptography;
using System.Text; using System.Text;
using log4net;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using System.Collections.Generic; using log4net;
namespace GreenshotPlugin.Core namespace Greenshot.Base.Core
{ {
public static class StringExtensions public static class StringExtensions
{ {

View file

@ -24,7 +24,7 @@ using System.Drawing.Imaging;
using System.IO; using System.IO;
using Svg; using Svg;
namespace GreenshotPlugin.Core namespace Greenshot.Base.Core
{ {
/// <summary> /// <summary>
/// Create an image look like of the SVG /// Create an image look like of the SVG

View file

@ -1,444 +1,444 @@
/* /*
* Greenshot - a free and open source screenshot tool * Greenshot - a free and open source screenshot tool
* Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom
* *
* For more information see: http://getgreenshot.org/ * For more information see: http://getgreenshot.org/
* The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 1 of the License, or * the Free Software Foundation, either version 1 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
using GreenshotPlugin.UnmanagedHelpers; using System;
using log4net; using System.Collections.Generic;
using System; using System.Diagnostics;
using System.Collections.Generic; using System.Drawing;
using System.Diagnostics; using System.Drawing.Imaging;
using System.Drawing; using System.Runtime.InteropServices;
using System.Drawing.Imaging; using System.Windows.Forms;
using System.Runtime.InteropServices; using Greenshot.Base.IniFile;
using System.Windows.Forms; using Greenshot.Base.Interfaces;
using GreenshotPlugin.IniFile; using Greenshot.Base.UnmanagedHelpers;
using GreenshotPlugin.Interfaces; using Greenshot.Base.UnmanagedHelpers.Structs;
using GreenshotPlugin.UnmanagedHelpers.Structs; using log4net;
namespace GreenshotPlugin.Core namespace Greenshot.Base.Core
{ {
/// <summary> /// <summary>
/// The Window Capture code /// The Window Capture code
/// </summary> /// </summary>
public static class WindowCapture public static class WindowCapture
{ {
private static readonly ILog Log = LogManager.GetLogger(typeof(WindowCapture)); private static readonly ILog Log = LogManager.GetLogger(typeof(WindowCapture));
private static readonly CoreConfiguration Configuration = IniConfig.GetIniSection<CoreConfiguration>(); private static readonly CoreConfiguration Configuration = IniConfig.GetIniSection<CoreConfiguration>();
/// <summary> /// <summary>
/// Used to cleanup the unmanaged resource in the iconInfo for the CaptureCursor method /// Used to cleanup the unmanaged resource in the iconInfo for the CaptureCursor method
/// </summary> /// </summary>
/// <param name="hObject"></param> /// <param name="hObject"></param>
/// <returns></returns> /// <returns></returns>
[DllImport("gdi32", SetLastError = true)] [DllImport("gdi32", SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)] [return: MarshalAs(UnmanagedType.Bool)]
private static extern bool DeleteObject(IntPtr hObject); private static extern bool DeleteObject(IntPtr hObject);
/// <summary> /// <summary>
/// Get the bounds of all screens combined. /// Get the bounds of all screens combined.
/// </summary> /// </summary>
/// <returns>A Rectangle of the bounds of the entire display area.</returns> /// <returns>A Rectangle of the bounds of the entire display area.</returns>
public static Rectangle GetScreenBounds() public static Rectangle GetScreenBounds()
{ {
int left = 0, top = 0, bottom = 0, right = 0; int left = 0, top = 0, bottom = 0, right = 0;
foreach (Screen screen in Screen.AllScreens) foreach (Screen screen in Screen.AllScreens)
{ {
left = Math.Min(left, screen.Bounds.X); left = Math.Min(left, screen.Bounds.X);
top = Math.Min(top, screen.Bounds.Y); top = Math.Min(top, screen.Bounds.Y);
int screenAbsRight = screen.Bounds.X + screen.Bounds.Width; int screenAbsRight = screen.Bounds.X + screen.Bounds.Width;
int screenAbsBottom = screen.Bounds.Y + screen.Bounds.Height; int screenAbsBottom = screen.Bounds.Y + screen.Bounds.Height;
right = Math.Max(right, screenAbsRight); right = Math.Max(right, screenAbsRight);
bottom = Math.Max(bottom, screenAbsBottom); bottom = Math.Max(bottom, screenAbsBottom);
} }
return new Rectangle(left, top, (right + Math.Abs(left)), (bottom + Math.Abs(top))); return new Rectangle(left, top, (right + Math.Abs(left)), (bottom + Math.Abs(top)));
} }
/// <summary> /// <summary>
/// Retrieves the cursor location safely, accounting for DPI settings in Vista/Windows 7. This implementation /// Retrieves the cursor location safely, accounting for DPI settings in Vista/Windows 7. This implementation
/// can conveniently be used when the cursor location is needed to deal with a fullscreen bitmap. /// can conveniently be used when the cursor location is needed to deal with a fullscreen bitmap.
/// </summary> /// </summary>
/// <returns> /// <returns>
/// Point with cursor location, relative to the top left corner of the monitor setup (which itself might actually not be on any screen) /// Point with cursor location, relative to the top left corner of the monitor setup (which itself might actually not be on any screen)
/// </returns> /// </returns>
public static Point GetCursorLocationRelativeToScreenBounds() public static Point GetCursorLocationRelativeToScreenBounds()
{ {
return GetLocationRelativeToScreenBounds(User32.GetCursorLocation()); return GetLocationRelativeToScreenBounds(User32.GetCursorLocation());
} }
/// <summary> /// <summary>
/// Converts locationRelativeToScreenOrigin to be relative to top left corner of all screen bounds, which might /// Converts locationRelativeToScreenOrigin to be relative to top left corner of all screen bounds, which might
/// be different in multi-screen setups. This implementation /// be different in multi-screen setups. This implementation
/// can conveniently be used when the cursor location is needed to deal with a fullscreen bitmap. /// can conveniently be used when the cursor location is needed to deal with a fullscreen bitmap.
/// </summary> /// </summary>
/// <param name="locationRelativeToScreenOrigin"></param> /// <param name="locationRelativeToScreenOrigin"></param>
/// <returns>Point</returns> /// <returns>Point</returns>
public static Point GetLocationRelativeToScreenBounds(Point locationRelativeToScreenOrigin) public static Point GetLocationRelativeToScreenBounds(Point locationRelativeToScreenOrigin)
{ {
Point ret = locationRelativeToScreenOrigin; Point ret = locationRelativeToScreenOrigin;
Rectangle bounds = GetScreenBounds(); Rectangle bounds = GetScreenBounds();
ret.Offset(-bounds.X, -bounds.Y); ret.Offset(-bounds.X, -bounds.Y);
return ret; return ret;
} }
/// <summary> /// <summary>
/// This method will capture the current Cursor by using User32 Code /// This method will capture the current Cursor by using User32 Code
/// </summary> /// </summary>
/// <returns>A Capture Object with the Mouse Cursor information in it.</returns> /// <returns>A Capture Object with the Mouse Cursor information in it.</returns>
public static ICapture CaptureCursor(ICapture capture) public static ICapture CaptureCursor(ICapture capture)
{ {
Log.Debug("Capturing the mouse cursor."); Log.Debug("Capturing the mouse cursor.");
if (capture == null) if (capture == null)
{ {
capture = new Capture(); capture = new Capture();
} }
var cursorInfo = new CursorInfo(); var cursorInfo = new CursorInfo();
cursorInfo.cbSize = Marshal.SizeOf(cursorInfo); cursorInfo.cbSize = Marshal.SizeOf(cursorInfo);
if (!User32.GetCursorInfo(out cursorInfo)) return capture; if (!User32.GetCursorInfo(out cursorInfo)) return capture;
if (cursorInfo.flags != User32.CURSOR_SHOWING) return capture; if (cursorInfo.flags != User32.CURSOR_SHOWING) return capture;
using SafeIconHandle safeIcon = User32.CopyIcon(cursorInfo.hCursor); using SafeIconHandle safeIcon = User32.CopyIcon(cursorInfo.hCursor);
if (!User32.GetIconInfo(safeIcon, out var iconInfo)) return capture; if (!User32.GetIconInfo(safeIcon, out var iconInfo)) return capture;
Point cursorLocation = User32.GetCursorLocation(); Point cursorLocation = User32.GetCursorLocation();
// Align cursor location to Bitmap coordinates (instead of Screen coordinates) // Align cursor location to Bitmap coordinates (instead of Screen coordinates)
var x = cursorLocation.X - iconInfo.xHotspot - capture.ScreenBounds.X; var x = cursorLocation.X - iconInfo.xHotspot - capture.ScreenBounds.X;
var y = cursorLocation.Y - iconInfo.yHotspot - capture.ScreenBounds.Y; var y = cursorLocation.Y - iconInfo.yHotspot - capture.ScreenBounds.Y;
// Set the location // Set the location
capture.CursorLocation = new Point(x, y); capture.CursorLocation = new Point(x, y);
using (Icon icon = Icon.FromHandle(safeIcon.DangerousGetHandle())) using (Icon icon = Icon.FromHandle(safeIcon.DangerousGetHandle()))
{ {
capture.Cursor = icon; capture.Cursor = icon;
} }
if (iconInfo.hbmMask != IntPtr.Zero) if (iconInfo.hbmMask != IntPtr.Zero)
{ {
DeleteObject(iconInfo.hbmMask); DeleteObject(iconInfo.hbmMask);
} }
if (iconInfo.hbmColor != IntPtr.Zero) if (iconInfo.hbmColor != IntPtr.Zero)
{ {
DeleteObject(iconInfo.hbmColor); DeleteObject(iconInfo.hbmColor);
} }
return capture; return capture;
} }
/// <summary> /// <summary>
/// This method will call the CaptureRectangle with the screenbounds, therefor Capturing the whole screen. /// This method will call the CaptureRectangle with the screenbounds, therefor Capturing the whole screen.
/// </summary> /// </summary>
/// <returns>A Capture Object with the Screen as an Image</returns> /// <returns>A Capture Object with the Screen as an Image</returns>
public static ICapture CaptureScreen(ICapture capture) public static ICapture CaptureScreen(ICapture capture)
{ {
if (capture == null) if (capture == null)
{ {
capture = new Capture(); capture = new Capture();
} }
return CaptureRectangle(capture, capture.ScreenBounds); return CaptureRectangle(capture, capture.ScreenBounds);
} }
/// <summary> /// <summary>
/// Helper method to create an exception that might explain what is wrong while capturing /// Helper method to create an exception that might explain what is wrong while capturing
/// </summary> /// </summary>
/// <param name="method">string with current method</param> /// <param name="method">string with current method</param>
/// <param name="captureBounds">Rectangle of what we want to capture</param> /// <param name="captureBounds">Rectangle of what we want to capture</param>
/// <returns></returns> /// <returns></returns>
private static Exception CreateCaptureException(string method, Rectangle captureBounds) private static Exception CreateCaptureException(string method, Rectangle captureBounds)
{ {
Exception exceptionToThrow = User32.CreateWin32Exception(method); Exception exceptionToThrow = User32.CreateWin32Exception(method);
if (!captureBounds.IsEmpty) if (!captureBounds.IsEmpty)
{ {
exceptionToThrow.Data.Add("Height", captureBounds.Height); exceptionToThrow.Data.Add("Height", captureBounds.Height);
exceptionToThrow.Data.Add("Width", captureBounds.Width); exceptionToThrow.Data.Add("Width", captureBounds.Width);
} }
return exceptionToThrow; return exceptionToThrow;
} }
/// <summary> /// <summary>
/// Helper method to check if it is allowed to capture the process using DWM /// Helper method to check if it is allowed to capture the process using DWM
/// </summary> /// </summary>
/// <param name="process">Process owning the window</param> /// <param name="process">Process owning the window</param>
/// <returns>true if it's allowed</returns> /// <returns>true if it's allowed</returns>
public static bool IsDwmAllowed(Process process) public static bool IsDwmAllowed(Process process)
{ {
if (process == null) return true; if (process == null) return true;
if (Configuration.NoDWMCaptureForProduct == null || if (Configuration.NoDWMCaptureForProduct == null ||
Configuration.NoDWMCaptureForProduct.Count <= 0) return true; Configuration.NoDWMCaptureForProduct.Count <= 0) return true;
try try
{ {
string productName = process.MainModule?.FileVersionInfo.ProductName; string productName = process.MainModule?.FileVersionInfo.ProductName;
if (productName != null && Configuration.NoDWMCaptureForProduct.Contains(productName.ToLower())) if (productName != null && Configuration.NoDWMCaptureForProduct.Contains(productName.ToLower()))
{ {
return false; return false;
} }
} }
catch (Exception ex) catch (Exception ex)
{ {
Log.Warn(ex.Message); Log.Warn(ex.Message);
} }
return true; return true;
} }
/// <summary> /// <summary>
/// Helper method to check if it is allowed to capture the process using GDI /// Helper method to check if it is allowed to capture the process using GDI
/// </summary> /// </summary>
/// <param name="process">Process owning the window</param> /// <param name="process">Process owning the window</param>
/// <returns>true if it's allowed</returns> /// <returns>true if it's allowed</returns>
public static bool IsGdiAllowed(Process process) public static bool IsGdiAllowed(Process process)
{ {
if (process == null) return true; if (process == null) return true;
if (Configuration.NoGDICaptureForProduct == null || if (Configuration.NoGDICaptureForProduct == null ||
Configuration.NoGDICaptureForProduct.Count <= 0) return true; Configuration.NoGDICaptureForProduct.Count <= 0) return true;
try try
{ {
string productName = process.MainModule?.FileVersionInfo.ProductName; string productName = process.MainModule?.FileVersionInfo.ProductName;
if (productName != null && Configuration.NoGDICaptureForProduct.Contains(productName.ToLower())) if (productName != null && Configuration.NoGDICaptureForProduct.Contains(productName.ToLower()))
{ {
return false; return false;
} }
} }
catch (Exception ex) catch (Exception ex)
{ {
Log.Warn(ex.Message); Log.Warn(ex.Message);
} }
return true; return true;
} }
/// <summary> /// <summary>
/// This method will use User32 code to capture the specified captureBounds from the screen /// This method will use User32 code to capture the specified captureBounds from the screen
/// </summary> /// </summary>
/// <param name="capture">ICapture where the captured Bitmap will be stored</param> /// <param name="capture">ICapture where the captured Bitmap will be stored</param>
/// <param name="captureBounds">Rectangle with the bounds to capture</param> /// <param name="captureBounds">Rectangle with the bounds to capture</param>
/// <returns>A Capture Object with a part of the Screen as an Image</returns> /// <returns>A Capture Object with a part of the Screen as an Image</returns>
public static ICapture CaptureRectangle(ICapture capture, Rectangle captureBounds) public static ICapture CaptureRectangle(ICapture capture, Rectangle captureBounds)
{ {
if (capture == null) if (capture == null)
{ {
capture = new Capture(); capture = new Capture();
} }
Image capturedImage = null; Image capturedImage = null;
// If the CaptureHandler has a handle use this, otherwise use the CaptureRectangle here // If the CaptureHandler has a handle use this, otherwise use the CaptureRectangle here
if (CaptureHandler.CaptureScreenRectangle != null) if (CaptureHandler.CaptureScreenRectangle != null)
{ {
try try
{ {
capturedImage = CaptureHandler.CaptureScreenRectangle(captureBounds); capturedImage = CaptureHandler.CaptureScreenRectangle(captureBounds);
} }
catch catch
{ {
// ignored // ignored
} }
} }
// If no capture, use the normal screen capture // If no capture, use the normal screen capture
if (capturedImage == null) if (capturedImage == null)
{ {
capturedImage = CaptureRectangle(captureBounds); capturedImage = CaptureRectangle(captureBounds);
} }
capture.Image = capturedImage; capture.Image = capturedImage;
capture.Location = captureBounds.Location; capture.Location = captureBounds.Location;
return capture.Image == null ? null : capture; return capture.Image == null ? null : capture;
} }
/// <summary> /// <summary>
/// This method will use User32 code to capture the specified captureBounds from the screen /// This method will use User32 code to capture the specified captureBounds from the screen
/// </summary> /// </summary>
/// <param name="capture">ICapture where the captured Bitmap will be stored</param> /// <param name="capture">ICapture where the captured Bitmap will be stored</param>
/// <param name="captureBounds">Rectangle with the bounds to capture</param> /// <param name="captureBounds">Rectangle with the bounds to capture</param>
/// <returns>A Capture Object with a part of the Screen as an Image</returns> /// <returns>A Capture Object with a part of the Screen as an Image</returns>
public static ICapture CaptureRectangleFromDesktopScreen(ICapture capture, Rectangle captureBounds) public static ICapture CaptureRectangleFromDesktopScreen(ICapture capture, Rectangle captureBounds)
{ {
if (capture == null) if (capture == null)
{ {
capture = new Capture(); capture = new Capture();
} }
capture.Image = CaptureRectangle(captureBounds); capture.Image = CaptureRectangle(captureBounds);
capture.Location = captureBounds.Location; capture.Location = captureBounds.Location;
return capture.Image == null ? null : capture; return capture.Image == null ? null : capture;
} }
/// <summary> /// <summary>
/// This method will use User32 code to capture the specified captureBounds from the screen /// This method will use User32 code to capture the specified captureBounds from the screen
/// </summary> /// </summary>
/// <param name="captureBounds">Rectangle with the bounds to capture</param> /// <param name="captureBounds">Rectangle with the bounds to capture</param>
/// <returns>Bitmap which is captured from the screen at the location specified by the captureBounds</returns> /// <returns>Bitmap which is captured from the screen at the location specified by the captureBounds</returns>
public static Bitmap CaptureRectangle(Rectangle captureBounds) public static Bitmap CaptureRectangle(Rectangle captureBounds)
{ {
Bitmap returnBitmap = null; Bitmap returnBitmap = null;
if (captureBounds.Height <= 0 || captureBounds.Width <= 0) if (captureBounds.Height <= 0 || captureBounds.Width <= 0)
{ {
Log.Warn("Nothing to capture, ignoring!"); Log.Warn("Nothing to capture, ignoring!");
return null; return null;
} }
Log.Debug("CaptureRectangle Called!"); Log.Debug("CaptureRectangle Called!");
// .NET GDI+ Solution, according to some post this has a GDI+ leak... // .NET GDI+ Solution, according to some post this has a GDI+ leak...
// See http://connect.microsoft.com/VisualStudio/feedback/details/344752/gdi-object-leak-when-calling-graphics-copyfromscreen // See http://connect.microsoft.com/VisualStudio/feedback/details/344752/gdi-object-leak-when-calling-graphics-copyfromscreen
// Bitmap capturedBitmap = new Bitmap(captureBounds.Width, captureBounds.Height); // Bitmap capturedBitmap = new Bitmap(captureBounds.Width, captureBounds.Height);
// using (Graphics graphics = Graphics.FromImage(capturedBitmap)) { // using (Graphics graphics = Graphics.FromImage(capturedBitmap)) {
// graphics.CopyFromScreen(captureBounds.Location, Point.Empty, captureBounds.Size, CopyPixelOperation.CaptureBlt); // graphics.CopyFromScreen(captureBounds.Location, Point.Empty, captureBounds.Size, CopyPixelOperation.CaptureBlt);
// } // }
// capture.Image = capturedBitmap; // capture.Image = capturedBitmap;
// capture.Location = captureBounds.Location; // capture.Location = captureBounds.Location;
using (var desktopDcHandle = SafeWindowDcHandle.FromDesktop()) using (var desktopDcHandle = SafeWindowDcHandle.FromDesktop())
{ {
if (desktopDcHandle.IsInvalid) if (desktopDcHandle.IsInvalid)
{ {
// Get Exception before the error is lost // Get Exception before the error is lost
Exception exceptionToThrow = CreateCaptureException("desktopDCHandle", captureBounds); Exception exceptionToThrow = CreateCaptureException("desktopDCHandle", captureBounds);
// throw exception // throw exception
throw exceptionToThrow; throw exceptionToThrow;
} }
// create a device context we can copy to // create a device context we can copy to
using SafeCompatibleDCHandle safeCompatibleDcHandle = GDI32.CreateCompatibleDC(desktopDcHandle); using SafeCompatibleDCHandle safeCompatibleDcHandle = GDI32.CreateCompatibleDC(desktopDcHandle);
// Check if the device context is there, if not throw an error with as much info as possible! // Check if the device context is there, if not throw an error with as much info as possible!
if (safeCompatibleDcHandle.IsInvalid) if (safeCompatibleDcHandle.IsInvalid)
{ {
// Get Exception before the error is lost // Get Exception before the error is lost
Exception exceptionToThrow = CreateCaptureException("CreateCompatibleDC", captureBounds); Exception exceptionToThrow = CreateCaptureException("CreateCompatibleDC", captureBounds);
// throw exception // throw exception
throw exceptionToThrow; throw exceptionToThrow;
} }
// Create BITMAPINFOHEADER for CreateDIBSection // Create BITMAPINFOHEADER for CreateDIBSection
BITMAPINFOHEADER bmi = new BITMAPINFOHEADER(captureBounds.Width, captureBounds.Height, 24); BITMAPINFOHEADER bmi = new BITMAPINFOHEADER(captureBounds.Width, captureBounds.Height, 24);
// Make sure the last error is set to 0 // Make sure the last error is set to 0
Win32.SetLastError(0); Win32.SetLastError(0);
// create a bitmap we can copy it to, using GetDeviceCaps to get the width/height // create a bitmap we can copy it to, using GetDeviceCaps to get the width/height
using SafeDibSectionHandle safeDibSectionHandle = GDI32.CreateDIBSection(desktopDcHandle, ref bmi, BITMAPINFOHEADER.DIB_RGB_COLORS, out _, IntPtr.Zero, 0); using SafeDibSectionHandle safeDibSectionHandle = GDI32.CreateDIBSection(desktopDcHandle, ref bmi, BITMAPINFOHEADER.DIB_RGB_COLORS, out _, IntPtr.Zero, 0);
if (safeDibSectionHandle.IsInvalid) if (safeDibSectionHandle.IsInvalid)
{ {
// Get Exception before the error is lost // Get Exception before the error is lost
var exceptionToThrow = CreateCaptureException("CreateDIBSection", captureBounds); var exceptionToThrow = CreateCaptureException("CreateDIBSection", captureBounds);
exceptionToThrow.Data.Add("hdcDest", safeCompatibleDcHandle.DangerousGetHandle().ToInt32()); exceptionToThrow.Data.Add("hdcDest", safeCompatibleDcHandle.DangerousGetHandle().ToInt32());
exceptionToThrow.Data.Add("hdcSrc", desktopDcHandle.DangerousGetHandle().ToInt32()); exceptionToThrow.Data.Add("hdcSrc", desktopDcHandle.DangerousGetHandle().ToInt32());
// Throw so people can report the problem // Throw so people can report the problem
throw exceptionToThrow; throw exceptionToThrow;
} }
// select the bitmap object and store the old handle // select the bitmap object and store the old handle
using (safeCompatibleDcHandle.SelectObject(safeDibSectionHandle)) using (safeCompatibleDcHandle.SelectObject(safeDibSectionHandle))
{ {
// bitblt over (make copy) // bitblt over (make copy)
// ReSharper disable once BitwiseOperatorOnEnumWithoutFlags // ReSharper disable once BitwiseOperatorOnEnumWithoutFlags
GDI32.BitBlt(safeCompatibleDcHandle, 0, 0, captureBounds.Width, captureBounds.Height, desktopDcHandle, captureBounds.X, captureBounds.Y, GDI32.BitBlt(safeCompatibleDcHandle, 0, 0, captureBounds.Width, captureBounds.Height, desktopDcHandle, captureBounds.X, captureBounds.Y,
CopyPixelOperation.SourceCopy | CopyPixelOperation.CaptureBlt); CopyPixelOperation.SourceCopy | CopyPixelOperation.CaptureBlt);
} }
// get a .NET image object for it // get a .NET image object for it
// A suggestion for the "A generic error occurred in GDI+." E_FAIL/0<>80004005 error is to re-try... // A suggestion for the "A generic error occurred in GDI+." E_FAIL/0<>80004005 error is to re-try...
bool success = false; bool success = false;
ExternalException exception = null; ExternalException exception = null;
for (int i = 0; i < 3; i++) for (int i = 0; i < 3; i++)
{ {
try try
{ {
// Collect all screens inside this capture // Collect all screens inside this capture
List<Screen> screensInsideCapture = new List<Screen>(); List<Screen> screensInsideCapture = new List<Screen>();
foreach (Screen screen in Screen.AllScreens) foreach (Screen screen in Screen.AllScreens)
{ {
if (screen.Bounds.IntersectsWith(captureBounds)) if (screen.Bounds.IntersectsWith(captureBounds))
{ {
screensInsideCapture.Add(screen); screensInsideCapture.Add(screen);
} }
} }
// Check all all screens are of an equal size // Check all all screens are of an equal size
bool offscreenContent; bool offscreenContent;
using (Region captureRegion = new Region(captureBounds)) using (Region captureRegion = new Region(captureBounds))
{ {
// Exclude every visible part // Exclude every visible part
foreach (Screen screen in screensInsideCapture) foreach (Screen screen in screensInsideCapture)
{ {
captureRegion.Exclude(screen.Bounds); captureRegion.Exclude(screen.Bounds);
} }
// If the region is not empty, we have "offscreenContent" // If the region is not empty, we have "offscreenContent"
using Graphics screenGraphics = Graphics.FromHwnd(User32.GetDesktopWindow()); using Graphics screenGraphics = Graphics.FromHwnd(User32.GetDesktopWindow());
offscreenContent = !captureRegion.IsEmpty(screenGraphics); offscreenContent = !captureRegion.IsEmpty(screenGraphics);
} }
// Check if we need to have a transparent background, needed for offscreen content // Check if we need to have a transparent background, needed for offscreen content
if (offscreenContent) if (offscreenContent)
{ {
using Bitmap tmpBitmap = Image.FromHbitmap(safeDibSectionHandle.DangerousGetHandle()); using Bitmap tmpBitmap = Image.FromHbitmap(safeDibSectionHandle.DangerousGetHandle());
// Create a new bitmap which has a transparent background // Create a new bitmap which has a transparent background
returnBitmap = ImageHelper.CreateEmpty(tmpBitmap.Width, tmpBitmap.Height, PixelFormat.Format32bppArgb, Color.Transparent, returnBitmap = ImageHelper.CreateEmpty(tmpBitmap.Width, tmpBitmap.Height, PixelFormat.Format32bppArgb, Color.Transparent,
tmpBitmap.HorizontalResolution, tmpBitmap.VerticalResolution); tmpBitmap.HorizontalResolution, tmpBitmap.VerticalResolution);
// Content will be copied here // Content will be copied here
using Graphics graphics = Graphics.FromImage(returnBitmap); using Graphics graphics = Graphics.FromImage(returnBitmap);
// For all screens copy the content to the new bitmap // For all screens copy the content to the new bitmap
foreach (Screen screen in Screen.AllScreens) foreach (Screen screen in Screen.AllScreens)
{ {
Rectangle screenBounds = screen.Bounds; Rectangle screenBounds = screen.Bounds;
// Make sure the bounds are offsetted to the capture bounds // Make sure the bounds are offsetted to the capture bounds
screenBounds.Offset(-captureBounds.X, -captureBounds.Y); screenBounds.Offset(-captureBounds.X, -captureBounds.Y);
graphics.DrawImage(tmpBitmap, screenBounds, screenBounds.X, screenBounds.Y, screenBounds.Width, screenBounds.Height, GraphicsUnit.Pixel); graphics.DrawImage(tmpBitmap, screenBounds, screenBounds.X, screenBounds.Y, screenBounds.Width, screenBounds.Height, GraphicsUnit.Pixel);
} }
} }
else else
{ {
// All screens, which are inside the capture, are of equal size // All screens, which are inside the capture, are of equal size
// assign image to Capture, the image will be disposed there.. // assign image to Capture, the image will be disposed there..
returnBitmap = Image.FromHbitmap(safeDibSectionHandle.DangerousGetHandle()); returnBitmap = Image.FromHbitmap(safeDibSectionHandle.DangerousGetHandle());
} }
// We got through the capture without exception // We got through the capture without exception
success = true; success = true;
break; break;
} }
catch (ExternalException ee) catch (ExternalException ee)
{ {
Log.Warn("Problem getting bitmap at try " + i + " : ", ee); Log.Warn("Problem getting bitmap at try " + i + " : ", ee);
exception = ee; exception = ee;
} }
} }
if (!success) if (!success)
{ {
Log.Error("Still couldn't create Bitmap!"); Log.Error("Still couldn't create Bitmap!");
if (exception != null) if (exception != null)
{ {
throw exception; throw exception;
} }
} }
} }
return returnBitmap; return returnBitmap;
} }
} }
} }

View file

@ -1,108 +1,108 @@
/* /*
* Greenshot - a free and open source screenshot tool * Greenshot - a free and open source screenshot tool
* Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom
* *
* For more information see: http://getgreenshot.org/ * For more information see: http://getgreenshot.org/
* The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 1 of the License, or * the Free Software Foundation, either version 1 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
using GreenshotPlugin.UnmanagedHelpers; using System;
using System; using System.Collections.Generic;
using System.Collections.Generic; using System.Text;
using System.Text; using Greenshot.Base.UnmanagedHelpers;
namespace GreenshotPlugin.Core namespace Greenshot.Base.Core
{ {
/// <summary> /// <summary>
/// EnumWindows wrapper for .NET /// EnumWindows wrapper for .NET
/// </summary> /// </summary>
public class WindowsEnumerator public class WindowsEnumerator
{ {
/// <summary> /// <summary>
/// Returns the collection of windows returned by GetWindows /// Returns the collection of windows returned by GetWindows
/// </summary> /// </summary>
public IList<WindowDetails> Items { get; private set; } public IList<WindowDetails> Items { get; private set; }
/// <summary> /// <summary>
/// Gets all child windows of the specified window /// Gets all child windows of the specified window
/// </summary> /// </summary>
/// <param name="hWndParent">Window Handle to get children for</param> /// <param name="hWndParent">Window Handle to get children for</param>
/// <param name="classname">Window Classname to copy, use null to copy all</param> /// <param name="classname">Window Classname to copy, use null to copy all</param>
public WindowsEnumerator GetWindows(IntPtr hWndParent, string classname) public WindowsEnumerator GetWindows(IntPtr hWndParent, string classname)
{ {
Items = new List<WindowDetails>(); Items = new List<WindowDetails>();
User32.EnumChildWindows(hWndParent, WindowEnum, IntPtr.Zero); User32.EnumChildWindows(hWndParent, WindowEnum, IntPtr.Zero);
bool hasParent = !IntPtr.Zero.Equals(hWndParent); bool hasParent = !IntPtr.Zero.Equals(hWndParent);
string parentText = null; string parentText = null;
if (hasParent) if (hasParent)
{ {
var title = new StringBuilder(260, 260); var title = new StringBuilder(260, 260);
User32.GetWindowText(hWndParent, title, title.Capacity); User32.GetWindowText(hWndParent, title, title.Capacity);
parentText = title.ToString(); parentText = title.ToString();
} }
var windows = new List<WindowDetails>(); var windows = new List<WindowDetails>();
foreach (var window in Items) foreach (var window in Items)
{ {
if (hasParent) if (hasParent)
{ {
window.Text = parentText; window.Text = parentText;
window.ParentHandle = hWndParent; window.ParentHandle = hWndParent;
} }
if (classname == null || window.ClassName.Equals(classname)) if (classname == null || window.ClassName.Equals(classname))
{ {
windows.Add(window); windows.Add(window);
} }
} }
Items = windows; Items = windows;
return this; return this;
} }
/// <summary> /// <summary>
/// The enum Windows callback. /// The enum Windows callback.
/// </summary> /// </summary>
/// <param name="hWnd">Window Handle</param> /// <param name="hWnd">Window Handle</param>
/// <param name="lParam">Application defined value</param> /// <param name="lParam">Application defined value</param>
/// <returns>1 to continue enumeration, 0 to stop</returns> /// <returns>1 to continue enumeration, 0 to stop</returns>
private int WindowEnum(IntPtr hWnd, int lParam) private int WindowEnum(IntPtr hWnd, int lParam)
{ {
return OnWindowEnum(hWnd) ? 1 : 0; return OnWindowEnum(hWnd) ? 1 : 0;
} }
/// <summary> /// <summary>
/// Called whenever a new window is about to be added /// Called whenever a new window is about to be added
/// by the Window enumeration called from GetWindows. /// by the Window enumeration called from GetWindows.
/// If overriding this function, return true to continue /// If overriding this function, return true to continue
/// enumeration or false to stop. If you do not call /// enumeration or false to stop. If you do not call
/// the base implementation the Items collection will /// the base implementation the Items collection will
/// be empty. /// be empty.
/// </summary> /// </summary>
/// <param name="hWnd">Window handle to add</param> /// <param name="hWnd">Window handle to add</param>
/// <returns>True to continue enumeration, False to stop</returns> /// <returns>True to continue enumeration, False to stop</returns>
private bool OnWindowEnum(IntPtr hWnd) private bool OnWindowEnum(IntPtr hWnd)
{ {
if (!WindowDetails.IsIgnoreHandle(hWnd)) if (!WindowDetails.IsIgnoreHandle(hWnd))
{ {
Items.Add(new WindowDetails(hWnd)); Items.Add(new WindowDetails(hWnd));
} }
return true; return true;
} }
} }
} }

View file

@ -3,7 +3,7 @@
using System; using System;
namespace GreenshotPlugin.Core namespace Greenshot.Base.Core
{ {
/// <summary> /// <summary>
/// Extension methods to test the windows version /// Extension methods to test the windows version

View file

@ -1,66 +1,66 @@
/* /*
* Greenshot - a free and open source screenshot tool * Greenshot - a free and open source screenshot tool
* Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom
* *
* For more information see: http://getgreenshot.org/ * For more information see: http://getgreenshot.org/
* The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 1 of the License, or * the Free Software Foundation, either version 1 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
using System.Windows.Forms; using System.Windows.Forms;
using GreenshotPlugin.UnmanagedHelpers.Enums; using Greenshot.Base.UnmanagedHelpers.Enums;
using log4net; using log4net;
namespace GreenshotPlugin.Core namespace Greenshot.Base.Core
{ {
/// <summary> /// <summary>
/// This IMessageFilter filters out all WM_INPUTLANGCHANGEREQUEST messages which go to a handle which is >32 bits. /// This IMessageFilter filters out all WM_INPUTLANGCHANGEREQUEST messages which go to a handle which is >32 bits.
/// The need for this is documented here: http://stackoverflow.com/a/32021586 /// The need for this is documented here: http://stackoverflow.com/a/32021586
/// </summary> /// </summary>
public class WmInputLangChangeRequestFilter : IMessageFilter public class WmInputLangChangeRequestFilter : IMessageFilter
{ {
private static readonly ILog LOG = LogManager.GetLogger(typeof(WmInputLangChangeRequestFilter)); private static readonly ILog LOG = LogManager.GetLogger(typeof(WmInputLangChangeRequestFilter));
/// <summary> /// <summary>
/// This will do some filtering /// This will do some filtering
/// </summary> /// </summary>
/// <param name="m">Message</param> /// <param name="m">Message</param>
/// <returns>true if the message should be filtered</returns> /// <returns>true if the message should be filtered</returns>
public bool PreFilterMessage(ref Message m) public bool PreFilterMessage(ref Message m)
{ {
return PreFilterMessageExternal(ref m); return PreFilterMessageExternal(ref m);
} }
/// <summary> /// <summary>
/// Also used in the MainForm WndProc /// Also used in the MainForm WndProc
/// </summary> /// </summary>
/// <param name="m">Message</param> /// <param name="m">Message</param>
/// <returns>true if the message should be filtered</returns> /// <returns>true if the message should be filtered</returns>
public static bool PreFilterMessageExternal(ref Message m) public static bool PreFilterMessageExternal(ref Message m)
{ {
WindowsMessages message = (WindowsMessages) m.Msg; WindowsMessages message = (WindowsMessages) m.Msg;
if (message == WindowsMessages.WM_INPUTLANGCHANGEREQUEST || message == WindowsMessages.WM_INPUTLANGCHANGE) if (message == WindowsMessages.WM_INPUTLANGCHANGEREQUEST || message == WindowsMessages.WM_INPUTLANGCHANGE)
{ {
LOG.WarnFormat("Filtering: {0}, {1:X} - {2:X} - {3:X}", message, m.LParam.ToInt64(), m.WParam.ToInt64(), m.HWnd.ToInt64()); LOG.WarnFormat("Filtering: {0}, {1:X} - {2:X} - {3:X}", message, m.LParam.ToInt64(), m.WParam.ToInt64(), m.HWnd.ToInt64());
// For now we always return true // For now we always return true
return true; return true;
// But it could look something like this: // But it could look something like this:
//return (m.LParam.ToInt64() | 0x7FFFFFFF) != 0; //return (m.LParam.ToInt64() | 0x7FFFFFFF) != 0;
} }
return false; return false;
} }
} }
} }

View file

@ -1,54 +1,54 @@
/* /*
* Greenshot - a free and open source screenshot tool * Greenshot - a free and open source screenshot tool
* Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom
* *
* For more information see: http://getgreenshot.org/ * For more information see: http://getgreenshot.org/
* The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 1 of the License, or * the Free Software Foundation, either version 1 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
using System.Drawing; using System.Drawing;
using System.Drawing.Drawing2D; using System.Drawing.Drawing2D;
using GreenshotPlugin.Core; using Greenshot.Base.Core;
namespace GreenshotPlugin.Effects namespace Greenshot.Base.Effects
{ {
/// <summary> /// <summary>
/// AdjustEffect /// AdjustEffect
/// </summary> /// </summary>
public class AdjustEffect : IEffect public class AdjustEffect : IEffect
{ {
public AdjustEffect() public AdjustEffect()
{ {
Reset(); Reset();
} }
public float Contrast { get; set; } public float Contrast { get; set; }
public float Brightness { get; set; } public float Brightness { get; set; }
public float Gamma { get; set; } public float Gamma { get; set; }
public void Reset() public void Reset()
{ {
Contrast = 1f; Contrast = 1f;
Brightness = 1f; Brightness = 1f;
Gamma = 1f; Gamma = 1f;
} }
public Image Apply(Image sourceImage, Matrix matrix) public Image Apply(Image sourceImage, Matrix matrix)
{ {
return ImageHelper.Adjust(sourceImage, Brightness, Contrast, Gamma); return ImageHelper.Adjust(sourceImage, Brightness, Contrast, Gamma);
} }
} }
} }

View file

@ -1,52 +1,52 @@
/* /*
* Greenshot - a free and open source screenshot tool * Greenshot - a free and open source screenshot tool
* Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom
* *
* For more information see: http://getgreenshot.org/ * For more information see: http://getgreenshot.org/
* The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 1 of the License, or * the Free Software Foundation, either version 1 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
using System.Drawing; using System.Drawing;
using System.Drawing.Drawing2D; using System.Drawing.Drawing2D;
using GreenshotPlugin.Core; using Greenshot.Base.Core;
namespace GreenshotPlugin.Effects namespace Greenshot.Base.Effects
{ {
/// <summary> /// <summary>
/// BorderEffect /// BorderEffect
/// </summary> /// </summary>
public class BorderEffect : IEffect public class BorderEffect : IEffect
{ {
public BorderEffect() public BorderEffect()
{ {
Reset(); Reset();
} }
public Color Color { get; set; } public Color Color { get; set; }
public int Width { get; set; } public int Width { get; set; }
public void Reset() public void Reset()
{ {
Width = 2; Width = 2;
Color = Color.Black; Color = Color.Black;
} }
public Image Apply(Image sourceImage, Matrix matrix) public Image Apply(Image sourceImage, Matrix matrix)
{ {
return ImageHelper.CreateBorder(sourceImage, Width, Color, sourceImage.PixelFormat, matrix); return ImageHelper.CreateBorder(sourceImage, Width, Color, sourceImage.PixelFormat, matrix);
} }
} }
} }

View file

@ -1,59 +1,59 @@
/* /*
* Greenshot - a free and open source screenshot tool * Greenshot - a free and open source screenshot tool
* Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom
* *
* For more information see: http://getgreenshot.org/ * For more information see: http://getgreenshot.org/
* The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 1 of the License, or * the Free Software Foundation, either version 1 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
using System.ComponentModel; using System.ComponentModel;
using System.Drawing; using System.Drawing;
using System.Drawing.Drawing2D; using System.Drawing.Drawing2D;
using System.Drawing.Imaging; using System.Drawing.Imaging;
using GreenshotPlugin.Core; using Greenshot.Base.Core;
namespace GreenshotPlugin.Effects namespace Greenshot.Base.Effects
{ {
/// <summary> /// <summary>
/// DropShadowEffect /// DropShadowEffect
/// </summary> /// </summary>
[TypeConverter(typeof(EffectConverter))] [TypeConverter(typeof(EffectConverter))]
public class DropShadowEffect : IEffect public class DropShadowEffect : IEffect
{ {
public DropShadowEffect() public DropShadowEffect()
{ {
Reset(); Reset();
} }
public float Darkness { get; set; } public float Darkness { get; set; }
public int ShadowSize { get; set; } public int ShadowSize { get; set; }
public Point ShadowOffset { get; set; } public Point ShadowOffset { get; set; }
public virtual void Reset() public virtual void Reset()
{ {
Darkness = 0.6f; Darkness = 0.6f;
ShadowSize = 7; ShadowSize = 7;
ShadowOffset = new Point(-1, -1); ShadowOffset = new Point(-1, -1);
} }
public virtual Image Apply(Image sourceImage, Matrix matrix) public virtual Image Apply(Image sourceImage, Matrix matrix)
{ {
return ImageHelper.CreateShadow(sourceImage, Darkness, ShadowSize, ShadowOffset, matrix, PixelFormat.Format32bppArgb); return ImageHelper.CreateShadow(sourceImage, Darkness, ShadowSize, ShadowOffset, matrix, PixelFormat.Format32bppArgb);
} }
} }
} }

View file

@ -1,43 +1,43 @@
/* /*
* Greenshot - a free and open source screenshot tool * Greenshot - a free and open source screenshot tool
* Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom
* *
* For more information see: http://getgreenshot.org/ * For more information see: http://getgreenshot.org/
* The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 1 of the License, or * the Free Software Foundation, either version 1 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
using System.Drawing; using System.Drawing;
using System.Drawing.Drawing2D; using System.Drawing.Drawing2D;
using GreenshotPlugin.Core; using Greenshot.Base.Core;
namespace GreenshotPlugin.Effects namespace Greenshot.Base.Effects
{ {
/// <summary> /// <summary>
/// GrayscaleEffect /// GrayscaleEffect
/// </summary> /// </summary>
public class GrayscaleEffect : IEffect public class GrayscaleEffect : IEffect
{ {
public Image Apply(Image sourceImage, Matrix matrix) public Image Apply(Image sourceImage, Matrix matrix)
{ {
return ImageHelper.CreateGrayscale(sourceImage); return ImageHelper.CreateGrayscale(sourceImage);
} }
public void Reset() public void Reset()
{ {
// No settings to reset // No settings to reset
} }
} }
} }

View file

@ -1,46 +1,46 @@
/* /*
* Greenshot - a free and open source screenshot tool * Greenshot - a free and open source screenshot tool
* Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom
* *
* For more information see: http://getgreenshot.org/ * For more information see: http://getgreenshot.org/
* The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 1 of the License, or * the Free Software Foundation, either version 1 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
using System.Drawing; using System.Drawing;
using System.Drawing.Drawing2D; using System.Drawing.Drawing2D;
namespace GreenshotPlugin.Effects namespace Greenshot.Base.Effects
{ {
/// <summary> /// <summary>
/// Interface to describe an effect /// Interface to describe an effect
/// </summary> /// </summary>
public interface IEffect public interface IEffect
{ {
/// <summary> /// <summary>
/// Apply this IEffect to the supplied sourceImage. /// Apply this IEffect to the supplied sourceImage.
/// In the process of applying the supplied matrix will be modified to represent the changes. /// In the process of applying the supplied matrix will be modified to represent the changes.
/// </summary> /// </summary>
/// <param name="sourceImage">Image to apply the effect to</param> /// <param name="sourceImage">Image to apply the effect to</param>
/// <param name="matrix">Matrix with the modifications like rotate, translate etc. this can be used to calculate the new location of elements on a canvas</param> /// <param name="matrix">Matrix with the modifications like rotate, translate etc. this can be used to calculate the new location of elements on a canvas</param>
/// <returns>new image with applied effect</returns> /// <returns>new image with applied effect</returns>
Image Apply(Image sourceImage, Matrix matrix); Image Apply(Image sourceImage, Matrix matrix);
/// <summary> /// <summary>
/// Reset all values to their defaults /// Reset all values to their defaults
/// </summary> /// </summary>
void Reset(); void Reset();
} }
} }

View file

@ -1,43 +1,43 @@
/* /*
* Greenshot - a free and open source screenshot tool * Greenshot - a free and open source screenshot tool
* Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom
* *
* For more information see: http://getgreenshot.org/ * For more information see: http://getgreenshot.org/
* The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 1 of the License, or * the Free Software Foundation, either version 1 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
using System.Drawing; using System.Drawing;
using System.Drawing.Drawing2D; using System.Drawing.Drawing2D;
using GreenshotPlugin.Core; using Greenshot.Base.Core;
namespace GreenshotPlugin.Effects namespace Greenshot.Base.Effects
{ {
/// <summary> /// <summary>
/// InvertEffect /// InvertEffect
/// </summary> /// </summary>
public class InvertEffect : IEffect public class InvertEffect : IEffect
{ {
public Image Apply(Image sourceImage, Matrix matrix) public Image Apply(Image sourceImage, Matrix matrix)
{ {
return ImageHelper.CreateNegative(sourceImage); return ImageHelper.CreateNegative(sourceImage);
} }
public void Reset() public void Reset()
{ {
// No settings to reset // No settings to reset
} }
} }
} }

View file

@ -1,51 +1,51 @@
/* /*
* Greenshot - a free and open source screenshot tool * Greenshot - a free and open source screenshot tool
* Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom
* *
* For more information see: http://getgreenshot.org/ * For more information see: http://getgreenshot.org/
* The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 1 of the License, or * the Free Software Foundation, either version 1 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
using System.Drawing; using System.Drawing;
using System.Drawing.Drawing2D; using System.Drawing.Drawing2D;
using GreenshotPlugin.Core; using Greenshot.Base.Core;
namespace GreenshotPlugin.Effects namespace Greenshot.Base.Effects
{ {
/// <summary> /// <summary>
/// MonochromeEffect /// MonochromeEffect
/// </summary> /// </summary>
public class MonochromeEffect : IEffect public class MonochromeEffect : IEffect
{ {
private readonly byte _threshold; private readonly byte _threshold;
/// <param name="threshold">Threshold for monochrome filter (0 - 255), lower value means less black</param> /// <param name="threshold">Threshold for monochrome filter (0 - 255), lower value means less black</param>
public MonochromeEffect(byte threshold) public MonochromeEffect(byte threshold)
{ {
_threshold = threshold; _threshold = threshold;
} }
public void Reset() public void Reset()
{ {
// TODO: Modify the threshold to have a default, which is reset here // TODO: Modify the threshold to have a default, which is reset here
} }
public Image Apply(Image sourceImage, Matrix matrix) public Image Apply(Image sourceImage, Matrix matrix)
{ {
return ImageHelper.CreateMonochrome(sourceImage, _threshold); return ImageHelper.CreateMonochrome(sourceImage, _threshold);
} }
} }
} }

View file

@ -1,70 +1,70 @@
/* /*
* Greenshot - a free and open source screenshot tool * Greenshot - a free and open source screenshot tool
* Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom
* *
* For more information see: http://getgreenshot.org/ * For more information see: http://getgreenshot.org/
* The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 1 of the License, or * the Free Software Foundation, either version 1 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
using System; using System;
using System.Drawing; using System.Drawing;
using System.Drawing.Drawing2D; using System.Drawing.Drawing2D;
using GreenshotPlugin.Core; using Greenshot.Base.Core;
using log4net; using log4net;
namespace GreenshotPlugin.Effects namespace Greenshot.Base.Effects
{ {
/// <summary> /// <summary>
/// ReduceColorsEffect /// ReduceColorsEffect
/// </summary> /// </summary>
public class ReduceColorsEffect : IEffect public class ReduceColorsEffect : IEffect
{ {
private static readonly ILog Log = LogManager.GetLogger(typeof(ReduceColorsEffect)); private static readonly ILog Log = LogManager.GetLogger(typeof(ReduceColorsEffect));
public ReduceColorsEffect() public ReduceColorsEffect()
{ {
Reset(); Reset();
} }
public int Colors { get; set; } public int Colors { get; set; }
public void Reset() public void Reset()
{ {
Colors = 256; Colors = 256;
} }
public Image Apply(Image sourceImage, Matrix matrix) public Image Apply(Image sourceImage, Matrix matrix)
{ {
using (WuQuantizer quantizer = new WuQuantizer((Bitmap) sourceImage)) using (WuQuantizer quantizer = new WuQuantizer((Bitmap) sourceImage))
{ {
int colorCount = quantizer.GetColorCount(); int colorCount = quantizer.GetColorCount();
if (colorCount > Colors) if (colorCount > Colors)
{ {
try try
{ {
return quantizer.GetQuantizedImage(Colors); return quantizer.GetQuantizedImage(Colors);
} }
catch (Exception e) catch (Exception e)
{ {
Log.Warn("Error occurred while Quantizing the image, ignoring and using original. Error: ", e); Log.Warn("Error occurred while Quantizing the image, ignoring and using original. Error: ", e);
} }
} }
} }
return null; return null;
} }
} }
} }

View file

@ -1,58 +1,58 @@
/* /*
* Greenshot - a free and open source screenshot tool * Greenshot - a free and open source screenshot tool
* Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom
* *
* For more information see: http://getgreenshot.org/ * For more information see: http://getgreenshot.org/
* The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 1 of the License, or * the Free Software Foundation, either version 1 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
using System.Drawing; using System.Drawing;
using System.Drawing.Drawing2D; using System.Drawing.Drawing2D;
using GreenshotPlugin.Core; using Greenshot.Base.Core;
namespace GreenshotPlugin.Effects namespace Greenshot.Base.Effects
{ {
/// <summary> /// <summary>
/// ResizeCanvasEffect /// ResizeCanvasEffect
/// </summary> /// </summary>
public class ResizeCanvasEffect : IEffect public class ResizeCanvasEffect : IEffect
{ {
public ResizeCanvasEffect(int left, int right, int top, int bottom) public ResizeCanvasEffect(int left, int right, int top, int bottom)
{ {
Left = left; Left = left;
Right = right; Right = right;
Top = top; Top = top;
Bottom = bottom; Bottom = bottom;
BackgroundColor = Color.Empty; // Uses the default background color depending on the format BackgroundColor = Color.Empty; // Uses the default background color depending on the format
} }
public int Left { get; set; } public int Left { get; set; }
public int Right { get; set; } public int Right { get; set; }
public int Top { get; set; } public int Top { get; set; }
public int Bottom { get; set; } public int Bottom { get; set; }
public Color BackgroundColor { get; set; } public Color BackgroundColor { get; set; }
public void Reset() public void Reset()
{ {
// values don't have a default value // values don't have a default value
} }
public Image Apply(Image sourceImage, Matrix matrix) public Image Apply(Image sourceImage, Matrix matrix)
{ {
return ImageHelper.ResizeCanvas(sourceImage, BackgroundColor, Left, Right, Top, Bottom, matrix); return ImageHelper.ResizeCanvas(sourceImage, BackgroundColor, Left, Right, Top, Bottom, matrix);
} }
} }
} }

View file

@ -1,54 +1,54 @@
/* /*
* Greenshot - a free and open source screenshot tool * Greenshot - a free and open source screenshot tool
* Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom
* *
* For more information see: http://getgreenshot.org/ * For more information see: http://getgreenshot.org/
* The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 1 of the License, or * the Free Software Foundation, either version 1 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
using System.Drawing; using System.Drawing;
using System.Drawing.Drawing2D; using System.Drawing.Drawing2D;
using GreenshotPlugin.Core; using Greenshot.Base.Core;
namespace GreenshotPlugin.Effects namespace Greenshot.Base.Effects
{ {
/// <summary> /// <summary>
/// ResizeEffect /// ResizeEffect
/// </summary> /// </summary>
public class ResizeEffect : IEffect public class ResizeEffect : IEffect
{ {
public ResizeEffect(int width, int height, bool maintainAspectRatio) public ResizeEffect(int width, int height, bool maintainAspectRatio)
{ {
Width = width; Width = width;
Height = height; Height = height;
MaintainAspectRatio = maintainAspectRatio; MaintainAspectRatio = maintainAspectRatio;
} }
public int Width { get; set; } public int Width { get; set; }
public int Height { get; set; } public int Height { get; set; }
public bool MaintainAspectRatio { get; set; } public bool MaintainAspectRatio { get; set; }
public void Reset() public void Reset()
{ {
// values don't have a default value // values don't have a default value
} }
public Image Apply(Image sourceImage, Matrix matrix) public Image Apply(Image sourceImage, Matrix matrix)
{ {
return ImageHelper.ResizeImage(sourceImage, MaintainAspectRatio, Width, Height, matrix); return ImageHelper.ResizeImage(sourceImage, MaintainAspectRatio, Width, Height, matrix);
} }
} }
} }

View file

@ -1,69 +1,69 @@
/* /*
* Greenshot - a free and open source screenshot tool * Greenshot - a free and open source screenshot tool
* Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom
* *
* For more information see: http://getgreenshot.org/ * For more information see: http://getgreenshot.org/
* The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 1 of the License, or * the Free Software Foundation, either version 1 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
using System; using System;
using System.Drawing; using System.Drawing;
using System.Drawing.Drawing2D; using System.Drawing.Drawing2D;
using GreenshotPlugin.Core; using Greenshot.Base.Core;
namespace GreenshotPlugin.Effects namespace Greenshot.Base.Effects
{ {
/// <summary> /// <summary>
/// RotateEffect /// RotateEffect
/// </summary> /// </summary>
public class RotateEffect : IEffect public class RotateEffect : IEffect
{ {
public RotateEffect(int angle) public RotateEffect(int angle)
{ {
Angle = angle; Angle = angle;
} }
public int Angle { get; set; } public int Angle { get; set; }
public void Reset() public void Reset()
{ {
// Angle doesn't have a default value // Angle doesn't have a default value
} }
public Image Apply(Image sourceImage, Matrix matrix) public Image Apply(Image sourceImage, Matrix matrix)
{ {
RotateFlipType flipType; RotateFlipType flipType;
if (Angle == 90) if (Angle == 90)
{ {
matrix.Rotate(90, MatrixOrder.Append); matrix.Rotate(90, MatrixOrder.Append);
matrix.Translate(sourceImage.Height, 0, MatrixOrder.Append); matrix.Translate(sourceImage.Height, 0, MatrixOrder.Append);
flipType = RotateFlipType.Rotate90FlipNone; flipType = RotateFlipType.Rotate90FlipNone;
} }
else if (Angle == -90 || Angle == 270) else if (Angle == -90 || Angle == 270)
{ {
flipType = RotateFlipType.Rotate270FlipNone; flipType = RotateFlipType.Rotate270FlipNone;
matrix.Rotate(-90, MatrixOrder.Append); matrix.Rotate(-90, MatrixOrder.Append);
matrix.Translate(0, sourceImage.Width, MatrixOrder.Append); matrix.Translate(0, sourceImage.Width, MatrixOrder.Append);
} }
else else
{ {
throw new NotSupportedException("Currently only an angle of 90 or -90 (270) is supported."); throw new NotSupportedException("Currently only an angle of 90 or -90 (270) is supported.");
} }
return ImageHelper.RotateFlip(sourceImage, flipType); return ImageHelper.RotateFlip(sourceImage, flipType);
} }
} }
} }

Some files were not shown because too many files have changed in this diff Show more