diff --git a/Greenshot/Configuration/EditorConfiguration.cs b/Greenshot/Configuration/EditorConfiguration.cs index 25def41ed..ae033f401 100644 --- a/Greenshot/Configuration/EditorConfiguration.cs +++ b/Greenshot/Configuration/EditorConfiguration.cs @@ -24,9 +24,11 @@ using System.Drawing; using Greenshot.Drawing.Fields; using GreenshotPlugin.UnmanagedHelpers; -using Greenshot.IniFile; using GreenshotPlugin.Effects; +using GreenshotPlugin.IniFile; using GreenshotPlugin.Interfaces.Drawing; +using GreenshotPlugin.UnmanagedHelpers.Enums; +using GreenshotPlugin.UnmanagedHelpers.Structs; namespace Greenshot.Configuration { /// diff --git a/Greenshot/Controls/ContextMenuToolStripProfessionalRenderer.cs b/Greenshot/Controls/ContextMenuToolStripProfessionalRenderer.cs index fb609898a..5031f82bb 100644 --- a/Greenshot/Controls/ContextMenuToolStripProfessionalRenderer.cs +++ b/Greenshot/Controls/ContextMenuToolStripProfessionalRenderer.cs @@ -19,10 +19,10 @@ * along with this program. If not, see . */ -using Greenshot.IniFile; using GreenshotPlugin.Core; using System.Drawing; using System.Windows.Forms; +using GreenshotPlugin.IniFile; namespace Greenshot.Controls { /// diff --git a/Greenshot/Controls/Pipette.cs b/Greenshot/Controls/Pipette.cs index efdf67c9b..bbe2b5686 100644 --- a/Greenshot/Controls/Pipette.cs +++ b/Greenshot/Controls/Pipette.cs @@ -24,6 +24,7 @@ using System.Drawing; using System.Windows.Forms; using Greenshot.Forms; using GreenshotPlugin.UnmanagedHelpers; +using GreenshotPlugin.UnmanagedHelpers.Enums; namespace Greenshot.Controls { /// diff --git a/Greenshot/Destinations/ClipboardDestination.cs b/Greenshot/Destinations/ClipboardDestination.cs index cf0330a94..3d415aed8 100644 --- a/Greenshot/Destinations/ClipboardDestination.cs +++ b/Greenshot/Destinations/ClipboardDestination.cs @@ -24,7 +24,7 @@ using System.Windows.Forms; using Greenshot.Configuration; using GreenshotPlugin.Core; -using Greenshot.Plugin; +using GreenshotPlugin.Interfaces; namespace Greenshot.Destinations { /// diff --git a/Greenshot/Destinations/EditorDestination.cs b/Greenshot/Destinations/EditorDestination.cs index e797ee403..2e9252d8b 100644 --- a/Greenshot/Destinations/EditorDestination.cs +++ b/Greenshot/Destinations/EditorDestination.cs @@ -23,8 +23,9 @@ using System.Collections.Generic; using System.Drawing; using Greenshot.Configuration; using GreenshotPlugin.Core; -using Greenshot.Plugin; -using Greenshot.IniFile; +using GreenshotPlugin.IniFile; +using GreenshotPlugin.Interfaces; +using GreenshotPlugin.Interfaces.Forms; using log4net; namespace Greenshot.Destinations { diff --git a/Greenshot/Destinations/EmailDestination.cs b/Greenshot/Destinations/EmailDestination.cs index 39f4dde64..4f8ab24e2 100644 --- a/Greenshot/Destinations/EmailDestination.cs +++ b/Greenshot/Destinations/EmailDestination.cs @@ -24,8 +24,8 @@ using System.Windows.Forms; using Greenshot.Configuration; using Greenshot.Helpers; -using Greenshot.Plugin; using GreenshotPlugin.Core; +using GreenshotPlugin.Interfaces; namespace Greenshot.Destinations { /// diff --git a/Greenshot/Destinations/FileDestination.cs b/Greenshot/Destinations/FileDestination.cs index 7c6730ca0..568337ac6 100644 --- a/Greenshot/Destinations/FileDestination.cs +++ b/Greenshot/Destinations/FileDestination.cs @@ -25,9 +25,10 @@ using System.Windows.Forms; using Greenshot.Configuration; using GreenshotPlugin.Core; -using Greenshot.Plugin; -using Greenshot.IniFile; using GreenshotPlugin.Controls; +using GreenshotPlugin.IniFile; +using GreenshotPlugin.Interfaces; +using GreenshotPlugin.Interfaces.Plugin; using log4net; namespace Greenshot.Destinations { diff --git a/Greenshot/Destinations/FileWithDialogDestination.cs b/Greenshot/Destinations/FileWithDialogDestination.cs index 3cdef2bea..6acb60088 100644 --- a/Greenshot/Destinations/FileWithDialogDestination.cs +++ b/Greenshot/Destinations/FileWithDialogDestination.cs @@ -24,8 +24,8 @@ using System.Windows.Forms; using Greenshot.Configuration; using GreenshotPlugin.Core; -using Greenshot.Plugin; -using Greenshot.IniFile; +using GreenshotPlugin.IniFile; +using GreenshotPlugin.Interfaces; namespace Greenshot.Destinations { /// diff --git a/Greenshot/Destinations/PickerDestination.cs b/Greenshot/Destinations/PickerDestination.cs index 23bb29175..c0f577b9c 100644 --- a/Greenshot/Destinations/PickerDestination.cs +++ b/Greenshot/Destinations/PickerDestination.cs @@ -22,8 +22,8 @@ using System.Collections.Generic; using Greenshot.Configuration; using GreenshotPlugin.Core; -using Greenshot.Plugin; using Greenshot.Helpers; +using GreenshotPlugin.Interfaces; namespace Greenshot.Destinations { /// diff --git a/Greenshot/Destinations/PrinterDestination.cs b/Greenshot/Destinations/PrinterDestination.cs index ae4581742..b9781d286 100644 --- a/Greenshot/Destinations/PrinterDestination.cs +++ b/Greenshot/Destinations/PrinterDestination.cs @@ -27,8 +27,8 @@ using System.Windows.Forms; using Greenshot.Configuration; using GreenshotPlugin.Core; -using Greenshot.Plugin; using Greenshot.Helpers; +using GreenshotPlugin.Interfaces; namespace Greenshot.Destinations { /// diff --git a/Greenshot/Drawing/Adorners/AbstractAdorner.cs b/Greenshot/Drawing/Adorners/AbstractAdorner.cs index 5411a8906..0612753aa 100644 --- a/Greenshot/Drawing/Adorners/AbstractAdorner.cs +++ b/Greenshot/Drawing/Adorners/AbstractAdorner.cs @@ -19,11 +19,11 @@ * along with this program. If not, see . */ -using Greenshot.Plugin.Drawing; -using Greenshot.Plugin.Drawing.Adorners; using System.Drawing; using System.Drawing.Drawing2D; using System.Windows.Forms; +using GreenshotPlugin.Interfaces.Drawing; +using GreenshotPlugin.Interfaces.Drawing.Adorners; namespace Greenshot.Drawing.Adorners { diff --git a/Greenshot/Drawing/Adorners/MoveAdorner.cs b/Greenshot/Drawing/Adorners/MoveAdorner.cs index 2add1b1f4..ec3dcf2d3 100644 --- a/Greenshot/Drawing/Adorners/MoveAdorner.cs +++ b/Greenshot/Drawing/Adorners/MoveAdorner.cs @@ -20,10 +20,10 @@ */ using Greenshot.Helpers; -using Greenshot.Plugin.Drawing; using System.Drawing; using System.Drawing.Drawing2D; using System.Windows.Forms; +using GreenshotPlugin.Interfaces.Drawing; namespace Greenshot.Drawing.Adorners { diff --git a/Greenshot/Drawing/Adorners/ResizeAdorner.cs b/Greenshot/Drawing/Adorners/ResizeAdorner.cs index e541615c4..e75126f10 100644 --- a/Greenshot/Drawing/Adorners/ResizeAdorner.cs +++ b/Greenshot/Drawing/Adorners/ResizeAdorner.cs @@ -20,10 +20,10 @@ */ using Greenshot.Helpers; -using Greenshot.Plugin.Drawing; using System.Drawing; using System.Drawing.Drawing2D; using System.Windows.Forms; +using GreenshotPlugin.Interfaces.Drawing; namespace Greenshot.Drawing.Adorners { diff --git a/Greenshot/Drawing/Adorners/TargetAdorner.cs b/Greenshot/Drawing/Adorners/TargetAdorner.cs index 950765315..8ca0a91ef 100644 --- a/Greenshot/Drawing/Adorners/TargetAdorner.cs +++ b/Greenshot/Drawing/Adorners/TargetAdorner.cs @@ -19,10 +19,10 @@ * along with this program. If not, see . */ -using Greenshot.Plugin.Drawing; using System.Drawing; using System.Drawing.Drawing2D; using System.Windows.Forms; +using GreenshotPlugin.Interfaces.Drawing; namespace Greenshot.Drawing.Adorners { diff --git a/Greenshot/Drawing/ArrowContainer.cs b/Greenshot/Drawing/ArrowContainer.cs index 9cf8d4e39..739f9d430 100644 --- a/Greenshot/Drawing/ArrowContainer.cs +++ b/Greenshot/Drawing/ArrowContainer.cs @@ -23,7 +23,7 @@ using System.Drawing; using System.Drawing.Drawing2D; using Greenshot.Drawing.Fields; -using Greenshot.Plugin.Drawing; +using GreenshotPlugin.Interfaces.Drawing; namespace Greenshot.Drawing { /// diff --git a/Greenshot/Drawing/CropContainer.cs b/Greenshot/Drawing/CropContainer.cs index 42645b302..2dc9761c0 100644 --- a/Greenshot/Drawing/CropContainer.cs +++ b/Greenshot/Drawing/CropContainer.cs @@ -23,7 +23,6 @@ using System.Drawing; using System.Runtime.Serialization; using Greenshot.Drawing.Fields; using Greenshot.Helpers; -using Greenshot.Plugin.Drawing; using GreenshotPlugin.Interfaces.Drawing; namespace Greenshot.Drawing { diff --git a/Greenshot/Drawing/CursorContainer.cs b/Greenshot/Drawing/CursorContainer.cs index 61721008a..5558508a8 100644 --- a/Greenshot/Drawing/CursorContainer.cs +++ b/Greenshot/Drawing/CursorContainer.cs @@ -22,11 +22,10 @@ using System; using System.Drawing; using System.IO; using System.Windows.Forms; - -using Greenshot.Plugin.Drawing; using System.Drawing.Drawing2D; using log4net; using System.Runtime.Serialization; +using GreenshotPlugin.Interfaces.Drawing; namespace Greenshot.Drawing { /// diff --git a/Greenshot/Drawing/DrawableContainer.cs b/Greenshot/Drawing/DrawableContainer.cs index ffa2a1f57..8d805b1f0 100644 --- a/Greenshot/Drawing/DrawableContainer.cs +++ b/Greenshot/Drawing/DrawableContainer.cs @@ -24,11 +24,7 @@ using Greenshot.Drawing.Adorners; using Greenshot.Drawing.Fields; using Greenshot.Drawing.Filters; using Greenshot.Helpers; -using Greenshot.IniFile; using Greenshot.Memento; -using Greenshot.Plugin; -using Greenshot.Plugin.Drawing; -using Greenshot.Plugin.Drawing.Adorners; using GreenshotPlugin.Interfaces.Drawing; using log4net; using System; @@ -38,6 +34,9 @@ using System.Drawing; using System.Drawing.Drawing2D; using System.Runtime.Serialization; using System.Windows.Forms; +using GreenshotPlugin.IniFile; +using GreenshotPlugin.Interfaces; +using GreenshotPlugin.Interfaces.Drawing.Adorners; namespace Greenshot.Drawing { diff --git a/Greenshot/Drawing/DrawableContainerList.cs b/Greenshot/Drawing/DrawableContainerList.cs index d641708b4..d3c325f5b 100644 --- a/Greenshot/Drawing/DrawableContainerList.cs +++ b/Greenshot/Drawing/DrawableContainerList.cs @@ -21,8 +21,6 @@ using Greenshot.Configuration; using Greenshot.Memento; -using Greenshot.Plugin; -using Greenshot.Plugin.Drawing; using GreenshotPlugin.Core; using GreenshotPlugin.Interfaces.Drawing; using System; @@ -32,6 +30,7 @@ using System.Drawing; using System.Drawing.Drawing2D; using System.Threading; using System.Windows.Forms; +using GreenshotPlugin.Interfaces; namespace Greenshot.Drawing { /// diff --git a/Greenshot/Drawing/EllipseContainer.cs b/Greenshot/Drawing/EllipseContainer.cs index 9b67992de..c7a3985d6 100644 --- a/Greenshot/Drawing/EllipseContainer.cs +++ b/Greenshot/Drawing/EllipseContainer.cs @@ -24,7 +24,7 @@ using System.Drawing.Drawing2D; using Greenshot.Drawing.Fields; using Greenshot.Helpers; -using Greenshot.Plugin.Drawing; +using GreenshotPlugin.Interfaces.Drawing; namespace Greenshot.Drawing { /// diff --git a/Greenshot/Drawing/Fields/AbstractFieldHolder.cs b/Greenshot/Drawing/Fields/AbstractFieldHolder.cs index 081eca156..561501634 100644 --- a/Greenshot/Drawing/Fields/AbstractFieldHolder.cs +++ b/Greenshot/Drawing/Fields/AbstractFieldHolder.cs @@ -25,7 +25,7 @@ using System.Drawing; using System.Runtime.Serialization; using Greenshot.Configuration; -using Greenshot.IniFile; +using GreenshotPlugin.IniFile; using log4net; using GreenshotPlugin.Interfaces.Drawing; diff --git a/Greenshot/Drawing/Fields/Binding/BidirectionalBinding.cs b/Greenshot/Drawing/Fields/Binding/BidirectionalBinding.cs index e83c3718f..28a4bddf0 100644 --- a/Greenshot/Drawing/Fields/Binding/BidirectionalBinding.cs +++ b/Greenshot/Drawing/Fields/Binding/BidirectionalBinding.cs @@ -129,7 +129,7 @@ namespace Greenshot.Drawing.Fields.Binding { targetPropertyInfo.SetValue(targetObject, bValue, null); } } catch (Exception e) { - throw new MemberAccessException("Could not set property '"+targetProperty+"' to '"+bValue+"' ["+(bValue?.GetType().Name ?? "")+"] on "+targetObject+". Probably other type than expected, IBindingCoverter to the rescue.", e); + throw new MemberAccessException("Could not set property '"+targetProperty+"' to '"+bValue+"' ["+(bValue?.GetType().Name ?? string.Empty)+"] on "+targetObject+". Probably other type than expected, IBindingCoverter to the rescue.", e); } } diff --git a/Greenshot/Drawing/Fields/FieldAggregator.cs b/Greenshot/Drawing/Fields/FieldAggregator.cs index b357f5946..c22268091 100644 --- a/Greenshot/Drawing/Fields/FieldAggregator.cs +++ b/Greenshot/Drawing/Fields/FieldAggregator.cs @@ -21,13 +21,12 @@ using System; using Greenshot.Configuration; -using Greenshot.IniFile; -using Greenshot.Plugin; -using Greenshot.Plugin.Drawing; using GreenshotPlugin.Interfaces.Drawing; using System.Collections.Generic; using System.ComponentModel; using System.Linq; +using GreenshotPlugin.IniFile; +using GreenshotPlugin.Interfaces; namespace Greenshot.Drawing.Fields { diff --git a/Greenshot/Drawing/FilterContainer.cs b/Greenshot/Drawing/FilterContainer.cs index bec5bbd87..489e8e357 100644 --- a/Greenshot/Drawing/FilterContainer.cs +++ b/Greenshot/Drawing/FilterContainer.cs @@ -22,9 +22,9 @@ using System; using System.Drawing; using Greenshot.Drawing.Fields; using Greenshot.Helpers; -using Greenshot.Plugin.Drawing; using System.Drawing.Drawing2D; using System.Runtime.Serialization; +using GreenshotPlugin.Interfaces.Drawing; namespace Greenshot.Drawing { /// diff --git a/Greenshot/Drawing/Filters/AbstractFilter.cs b/Greenshot/Drawing/Filters/AbstractFilter.cs index fb1ca782a..7c54545bd 100644 --- a/Greenshot/Drawing/Filters/AbstractFilter.cs +++ b/Greenshot/Drawing/Filters/AbstractFilter.cs @@ -23,7 +23,7 @@ using System.ComponentModel; using System.Drawing; using Greenshot.Drawing.Fields; -using Greenshot.Plugin.Drawing; +using GreenshotPlugin.Interfaces.Drawing; namespace Greenshot.Drawing.Filters { /// diff --git a/Greenshot/Drawing/Filters/BlurFilter.cs b/Greenshot/Drawing/Filters/BlurFilter.cs index 1b2d98d38..711c1d02b 100644 --- a/Greenshot/Drawing/Filters/BlurFilter.cs +++ b/Greenshot/Drawing/Filters/BlurFilter.cs @@ -22,10 +22,10 @@ using System; using System.Drawing; using Greenshot.Drawing.Fields; -using Greenshot.Plugin.Drawing; using GreenshotPlugin.Core; using GreenshotPlugin.UnmanagedHelpers; using System.Drawing.Drawing2D; +using GreenshotPlugin.Interfaces.Drawing; namespace Greenshot.Drawing.Filters { [Serializable] diff --git a/Greenshot/Drawing/Filters/BrightnessFilter.cs b/Greenshot/Drawing/Filters/BrightnessFilter.cs index f4755ed7d..852aca9de 100644 --- a/Greenshot/Drawing/Filters/BrightnessFilter.cs +++ b/Greenshot/Drawing/Filters/BrightnessFilter.cs @@ -21,10 +21,10 @@ using System; using System.Drawing; using Greenshot.Drawing.Fields; -using Greenshot.Plugin.Drawing; using GreenshotPlugin.Core; using System.Drawing.Imaging; using System.Drawing.Drawing2D; +using GreenshotPlugin.Interfaces.Drawing; namespace Greenshot.Drawing.Filters { [Serializable()] diff --git a/Greenshot/Drawing/Filters/GrayscaleFilter.cs b/Greenshot/Drawing/Filters/GrayscaleFilter.cs index 76cce4d62..4758d12bd 100644 --- a/Greenshot/Drawing/Filters/GrayscaleFilter.cs +++ b/Greenshot/Drawing/Filters/GrayscaleFilter.cs @@ -21,9 +21,9 @@ using System; using System.Drawing; using GreenshotPlugin.Core; -using Greenshot.Plugin.Drawing; using System.Drawing.Drawing2D; using System.Drawing.Imaging; +using GreenshotPlugin.Interfaces.Drawing; namespace Greenshot.Drawing.Filters { /// diff --git a/Greenshot/Drawing/Filters/HighlightFilter.cs b/Greenshot/Drawing/Filters/HighlightFilter.cs index 49a459d31..36c574493 100644 --- a/Greenshot/Drawing/Filters/HighlightFilter.cs +++ b/Greenshot/Drawing/Filters/HighlightFilter.cs @@ -21,9 +21,9 @@ using System; using System.Drawing; using Greenshot.Drawing.Fields; -using Greenshot.Plugin.Drawing; using GreenshotPlugin.Core; using System.Drawing.Drawing2D; +using GreenshotPlugin.Interfaces.Drawing; namespace Greenshot.Drawing.Filters { [Serializable()] diff --git a/Greenshot/Drawing/Filters/IFilter.cs b/Greenshot/Drawing/Filters/IFilter.cs index 4156c5815..91fdfe74d 100644 --- a/Greenshot/Drawing/Filters/IFilter.cs +++ b/Greenshot/Drawing/Filters/IFilter.cs @@ -21,7 +21,6 @@ using System.ComponentModel; using System.Drawing; -using Greenshot.Plugin.Drawing; using GreenshotPlugin.Interfaces.Drawing; namespace Greenshot.Drawing.Filters diff --git a/Greenshot/Drawing/Filters/MagnifierFilter.cs b/Greenshot/Drawing/Filters/MagnifierFilter.cs index 9a3d2c0e5..601d09967 100644 --- a/Greenshot/Drawing/Filters/MagnifierFilter.cs +++ b/Greenshot/Drawing/Filters/MagnifierFilter.cs @@ -21,9 +21,9 @@ using System; using System.Drawing; using Greenshot.Drawing.Fields; -using Greenshot.Plugin.Drawing; using GreenshotPlugin.Core; using System.Drawing.Drawing2D; +using GreenshotPlugin.Interfaces.Drawing; namespace Greenshot.Drawing.Filters { [Serializable] diff --git a/Greenshot/Drawing/Filters/PixelizationFilter.cs b/Greenshot/Drawing/Filters/PixelizationFilter.cs index 3001ad957..7be7d47a6 100644 --- a/Greenshot/Drawing/Filters/PixelizationFilter.cs +++ b/Greenshot/Drawing/Filters/PixelizationFilter.cs @@ -24,8 +24,8 @@ using System.Drawing; using Greenshot.Drawing.Fields; using Greenshot.Helpers; -using Greenshot.Plugin.Drawing; using GreenshotPlugin.Core; +using GreenshotPlugin.Interfaces.Drawing; namespace Greenshot.Drawing.Filters { [Serializable()] diff --git a/Greenshot/Drawing/FreehandContainer.cs b/Greenshot/Drawing/FreehandContainer.cs index 6c60de500..129ba4822 100644 --- a/Greenshot/Drawing/FreehandContainer.cs +++ b/Greenshot/Drawing/FreehandContainer.cs @@ -21,12 +21,12 @@ using Greenshot.Drawing.Fields; using Greenshot.Helpers; -using Greenshot.Plugin.Drawing; using System; using System.Collections.Generic; using System.Drawing; using System.Drawing.Drawing2D; using System.Runtime.Serialization; +using GreenshotPlugin.Interfaces.Drawing; namespace Greenshot.Drawing { /// diff --git a/Greenshot/Drawing/IconContainer.cs b/Greenshot/Drawing/IconContainer.cs index 9f9e145d2..013fb057f 100644 --- a/Greenshot/Drawing/IconContainer.cs +++ b/Greenshot/Drawing/IconContainer.cs @@ -21,10 +21,10 @@ using System; using System.Drawing; using System.IO; -using Greenshot.Plugin.Drawing; using System.Drawing.Drawing2D; using log4net; using System.Runtime.Serialization; +using GreenshotPlugin.Interfaces.Drawing; namespace Greenshot.Drawing { /// diff --git a/Greenshot/Drawing/ImageContainer.cs b/Greenshot/Drawing/ImageContainer.cs index c51c4a6f7..0e23855bb 100644 --- a/Greenshot/Drawing/ImageContainer.cs +++ b/Greenshot/Drawing/ImageContainer.cs @@ -22,7 +22,6 @@ using System; using System.Drawing; using System.IO; using Greenshot.Drawing.Fields; -using Greenshot.Plugin.Drawing; using GreenshotPlugin.Core; using System.Drawing.Drawing2D; using log4net; diff --git a/Greenshot/Drawing/LineContainer.cs b/Greenshot/Drawing/LineContainer.cs index 8915867cc..af73529d4 100644 --- a/Greenshot/Drawing/LineContainer.cs +++ b/Greenshot/Drawing/LineContainer.cs @@ -25,8 +25,8 @@ using System.Runtime.Serialization; using Greenshot.Drawing.Fields; using Greenshot.Helpers; -using Greenshot.Plugin.Drawing; using Greenshot.Drawing.Adorners; +using GreenshotPlugin.Interfaces.Drawing; namespace Greenshot.Drawing { /// diff --git a/Greenshot/Drawing/RectangleContainer.cs b/Greenshot/Drawing/RectangleContainer.cs index f2bce3f4f..623e28b22 100644 --- a/Greenshot/Drawing/RectangleContainer.cs +++ b/Greenshot/Drawing/RectangleContainer.cs @@ -24,8 +24,8 @@ using System.Drawing; using System.Drawing.Drawing2D; using Greenshot.Drawing.Fields; using Greenshot.Helpers; -using Greenshot.Plugin.Drawing; using System.Runtime.Serialization; +using GreenshotPlugin.Interfaces.Drawing; namespace Greenshot.Drawing { /// diff --git a/Greenshot/Drawing/SpeechbubbleContainer.cs b/Greenshot/Drawing/SpeechbubbleContainer.cs index db44b4b73..f585af7aa 100644 --- a/Greenshot/Drawing/SpeechbubbleContainer.cs +++ b/Greenshot/Drawing/SpeechbubbleContainer.cs @@ -21,12 +21,12 @@ using Greenshot.Drawing.Fields; using Greenshot.Helpers; -using Greenshot.Plugin.Drawing; using System; using System.Drawing; using System.Drawing.Drawing2D; using System.Drawing.Text; using System.Runtime.Serialization; +using GreenshotPlugin.Interfaces.Drawing; namespace Greenshot.Drawing { diff --git a/Greenshot/Drawing/StepLabelContainer.cs b/Greenshot/Drawing/StepLabelContainer.cs index e3e9c9c6b..26510e515 100644 --- a/Greenshot/Drawing/StepLabelContainer.cs +++ b/Greenshot/Drawing/StepLabelContainer.cs @@ -21,7 +21,6 @@ using Greenshot.Drawing.Fields; using Greenshot.Helpers; -using Greenshot.Plugin.Drawing; using System; using System.Drawing; using System.Drawing.Drawing2D; diff --git a/Greenshot/Drawing/Surface.cs b/Greenshot/Drawing/Surface.cs index 335858a69..57fa76974 100644 --- a/Greenshot/Drawing/Surface.cs +++ b/Greenshot/Drawing/Surface.cs @@ -22,11 +22,7 @@ using Greenshot.Configuration; using Greenshot.Drawing.Fields; using Greenshot.Helpers; -using Greenshot.IniFile; using Greenshot.Memento; -using Greenshot.Plugin; -using Greenshot.Plugin.Drawing; -using Greenshot.Plugin.Drawing.Adorners; using GreenshotPlugin.Controls; using GreenshotPlugin.Core; using GreenshotPlugin.Interfaces.Drawing; @@ -41,6 +37,9 @@ using System.IO; using System.Runtime.Serialization.Formatters.Binary; using System.Windows.Forms; using GreenshotPlugin.Effects; +using GreenshotPlugin.IniFile; +using GreenshotPlugin.Interfaces; +using GreenshotPlugin.Interfaces.Drawing.Adorners; namespace Greenshot.Drawing { diff --git a/Greenshot/Drawing/TextContainer.cs b/Greenshot/Drawing/TextContainer.cs index c4d60e806..0f4866d71 100644 --- a/Greenshot/Drawing/TextContainer.cs +++ b/Greenshot/Drawing/TextContainer.cs @@ -22,7 +22,6 @@ using Greenshot.Drawing.Fields; using Greenshot.Helpers; using Greenshot.Memento; -using Greenshot.Plugin.Drawing; using GreenshotPlugin.Interfaces.Drawing; using System; using System.ComponentModel; @@ -511,7 +510,7 @@ namespace Greenshot.Drawing prevSpacePos = _textBox.Text.LastIndexOf(' ', selStart - 1); } _textBox.Select(prevSpacePos + 1, _textBox.SelectionStart - prevSpacePos - 1); - _textBox.SelectedText = ""; + _textBox.SelectedText = string.Empty; } } diff --git a/Greenshot/Forms/AboutForm.cs b/Greenshot/Forms/AboutForm.cs index 1c7d2ddcc..6ed63f2db 100644 --- a/Greenshot/Forms/AboutForm.cs +++ b/Greenshot/Forms/AboutForm.cs @@ -32,8 +32,8 @@ using System.Drawing.Drawing2D; using Greenshot.Helpers; using Greenshot.Configuration; using GreenshotPlugin.Core; -using Greenshot.IniFile; using System.Security.Permissions; +using GreenshotPlugin.IniFile; using log4net; namespace Greenshot { diff --git a/Greenshot/Forms/CaptureForm.cs b/Greenshot/Forms/CaptureForm.cs index 3578cc94d..96d51732d 100644 --- a/Greenshot/Forms/CaptureForm.cs +++ b/Greenshot/Forms/CaptureForm.cs @@ -21,8 +21,6 @@ using Greenshot.Drawing; using Greenshot.Helpers; -using Greenshot.IniFile; -using Greenshot.Plugin; using GreenshotPlugin.Controls; using GreenshotPlugin.Core; using GreenshotPlugin.UnmanagedHelpers; @@ -35,6 +33,8 @@ using System.Drawing.Imaging; using System.Globalization; using System.Security.Permissions; using System.Windows.Forms; +using GreenshotPlugin.IniFile; +using GreenshotPlugin.Interfaces; namespace Greenshot.Forms { /// diff --git a/Greenshot/Forms/ColorDialog.cs b/Greenshot/Forms/ColorDialog.cs index 6ddf7b961..bcf7e8889 100644 --- a/Greenshot/Forms/ColorDialog.cs +++ b/Greenshot/Forms/ColorDialog.cs @@ -21,13 +21,13 @@ using Greenshot.Configuration; using Greenshot.Controls; -using Greenshot.IniFile; using System; using System.Collections.Generic; using System.Drawing; using System.Globalization; using System.Threading; using System.Windows.Forms; +using GreenshotPlugin.IniFile; namespace Greenshot { /// @@ -164,7 +164,7 @@ namespace Greenshot { return; } TextBox textBox = (TextBox)sender; - string text = textBox.Text.Replace("#", ""); + string text = textBox.Text.Replace("#", string.Empty); Color c; if (int.TryParse(text, NumberStyles.AllowHexSpecifier, Thread.CurrentThread.CurrentCulture, out var i)) { c = Color.FromArgb(i); diff --git a/Greenshot/Forms/ImageEditorForm.cs b/Greenshot/Forms/ImageEditorForm.cs index bfb7e2612..8266efa45 100644 --- a/Greenshot/Forms/ImageEditorForm.cs +++ b/Greenshot/Forms/ImageEditorForm.cs @@ -34,14 +34,15 @@ using Greenshot.Drawing.Fields.Binding; using Greenshot.Forms; using Greenshot.Help; using Greenshot.Helpers; -using Greenshot.IniFile; -using Greenshot.Plugin; -using Greenshot.Plugin.Drawing; using GreenshotPlugin.Controls; using GreenshotPlugin.Core; using GreenshotPlugin.Effects; +using GreenshotPlugin.IniFile; +using GreenshotPlugin.Interfaces; using GreenshotPlugin.Interfaces.Drawing; +using GreenshotPlugin.Interfaces.Forms; using GreenshotPlugin.UnmanagedHelpers; +using GreenshotPlugin.UnmanagedHelpers.Structs; using log4net; namespace Greenshot { @@ -905,7 +906,7 @@ namespace Greenshot { bool canUndo = _surface.CanUndo; btnUndo.Enabled = canUndo; undoToolStripMenuItem.Enabled = canUndo; - string undoAction = ""; + string undoAction = string.Empty; if (canUndo) { if (_surface.UndoActionLanguageKey != LangKey.none) { undoAction = Language.GetString(_surface.UndoActionLanguageKey); @@ -918,7 +919,7 @@ namespace Greenshot { bool canRedo = _surface.CanRedo; btnRedo.Enabled = canRedo; redoToolStripMenuItem.Enabled = canRedo; - string redoAction = ""; + string redoAction = string.Empty; if (canRedo) { if (_surface.RedoActionLanguageKey != LangKey.none) { redoAction = Language.GetString(_surface.RedoActionLanguageKey); diff --git a/Greenshot/Forms/MainForm.cs b/Greenshot/Forms/MainForm.cs index 4e768b461..a1206a408 100644 --- a/Greenshot/Forms/MainForm.cs +++ b/Greenshot/Forms/MainForm.cs @@ -36,16 +36,18 @@ using Greenshot.Experimental; using Greenshot.Forms; using Greenshot.Help; using Greenshot.Helpers; -using Greenshot.Plugin; using GreenshotPlugin.UnmanagedHelpers; using GreenshotPlugin.Controls; using GreenshotPlugin.Core; -using Greenshot.IniFile; using Greenshot.Destinations; using Greenshot.Drawing; using log4net; using Timer = System.Timers.Timer; using System.Threading.Tasks; +using GreenshotPlugin.IniFile; +using GreenshotPlugin.Interfaces; +using GreenshotPlugin.Interfaces.Plugin; +using GreenshotPlugin.UnmanagedHelpers.Enums; namespace Greenshot { /// @@ -837,7 +839,7 @@ namespace Greenshot { captureScreenMenuItem.DropDownItems.Add(captureScreenItem); foreach (Screen screen in Screen.AllScreens) { Screen screenToCapture = screen; - string deviceAlignment = ""; + string deviceAlignment = string.Empty; if(screen.Bounds.Top == allScreensBounds.Top && screen.Bounds.Bottom != allScreensBounds.Bottom) { deviceAlignment += " " + Language.GetString(LangKey.contextmenu_capturefullscreen_top); } else if(screen.Bounds.Top != allScreensBounds.Top && screen.Bounds.Bottom == allScreensBounds.Bottom) { diff --git a/Greenshot/Forms/MovableShowColorForm.cs b/Greenshot/Forms/MovableShowColorForm.cs index 243f246c0..22c40183f 100644 --- a/Greenshot/Forms/MovableShowColorForm.cs +++ b/Greenshot/Forms/MovableShowColorForm.cs @@ -47,10 +47,10 @@ namespace Greenshot.Forms { Color c = GetPixelColor(screenCoordinates); preview.BackColor = c; html.Text = "#" + c.Name.Substring(2).ToUpper(); - red.Text = "" + c.R; - blue.Text = "" + c.B; - green.Text = "" + c.G; - alpha.Text = "" + c.A; + red.Text = string.Empty + c.R; + blue.Text = string.Empty + c.B; + green.Text = string.Empty + c.G; + alpha.Text = string.Empty + c.A; Size cursorSize = Cursor.Current.Size; Point hotspot = Cursor.Current.HotSpot; diff --git a/Greenshot/Forms/PrintOptionsDialog.cs b/Greenshot/Forms/PrintOptionsDialog.cs index ff1307b7e..b4a2de28e 100644 --- a/Greenshot/Forms/PrintOptionsDialog.cs +++ b/Greenshot/Forms/PrintOptionsDialog.cs @@ -20,7 +20,7 @@ */ using System; using System.Windows.Forms; -using Greenshot.IniFile; +using GreenshotPlugin.IniFile; namespace Greenshot.Forms { /// diff --git a/Greenshot/Forms/SettingsForm.cs b/Greenshot/Forms/SettingsForm.cs index ffeb5ddb3..2df5b4acd 100644 --- a/Greenshot/Forms/SettingsForm.cs +++ b/Greenshot/Forms/SettingsForm.cs @@ -34,9 +34,11 @@ using Greenshot.Helpers; using GreenshotPlugin.Controls; using GreenshotPlugin.Core; using GreenshotPlugin.UnmanagedHelpers; -using Greenshot.Plugin; -using Greenshot.IniFile; using System.Text.RegularExpressions; +using GreenshotPlugin.IniFile; +using GreenshotPlugin.Interfaces; +using GreenshotPlugin.Interfaces.Plugin; +using GreenshotPlugin.UnmanagedHelpers.Enums; using log4net; namespace Greenshot { diff --git a/Greenshot/Forms/ToolStripMenuSelectList.cs b/Greenshot/Forms/ToolStripMenuSelectList.cs index 7d2ff66a0..a109798f5 100644 --- a/Greenshot/Forms/ToolStripMenuSelectList.cs +++ b/Greenshot/Forms/ToolStripMenuSelectList.cs @@ -19,13 +19,13 @@ * along with this program. If not, see . */ -using Greenshot.IniFile; using GreenshotPlugin.Core; using System; using System.Collections; using System.Collections.Generic; using System.Drawing; using System.Windows.Forms; +using GreenshotPlugin.IniFile; namespace Greenshot.Forms { /// diff --git a/Greenshot/Helpers/CaptureHelper.cs b/Greenshot/Helpers/CaptureHelper.cs index 703442d62..18ddd2731 100644 --- a/Greenshot/Helpers/CaptureHelper.cs +++ b/Greenshot/Helpers/CaptureHelper.cs @@ -23,8 +23,6 @@ using Greenshot.Configuration; using Greenshot.Destinations; using Greenshot.Drawing; using Greenshot.Forms; -using Greenshot.IniFile; -using Greenshot.Plugin; using GreenshotPlugin.Core; using GreenshotPlugin.UnmanagedHelpers; using log4net; @@ -35,6 +33,9 @@ using System.Drawing; using System.IO; using System.Threading; using System.Windows.Forms; +using GreenshotPlugin.IniFile; +using GreenshotPlugin.Interfaces; +using GreenshotPlugin.UnmanagedHelpers.Enums; namespace Greenshot.Helpers { /// diff --git a/Greenshot/Helpers/CopyData.cs b/Greenshot/Helpers/CopyData.cs index 36f707e79..2168c0736 100644 --- a/Greenshot/Helpers/CopyData.cs +++ b/Greenshot/Helpers/CopyData.cs @@ -465,7 +465,7 @@ namespace Greenshot.Helpers { if (ChannelName.Length > 0) { RemoveChannel(); } - ChannelName = ""; + ChannelName = string.Empty; } } diff --git a/Greenshot/Helpers/DestinationHelper.cs b/Greenshot/Helpers/DestinationHelper.cs index 9807828d0..49cec43da 100644 --- a/Greenshot/Helpers/DestinationHelper.cs +++ b/Greenshot/Helpers/DestinationHelper.cs @@ -22,9 +22,9 @@ using System; using System.Collections.Generic; using System.Linq; -using Greenshot.Plugin; using GreenshotPlugin.Core; -using Greenshot.IniFile; +using GreenshotPlugin.IniFile; +using GreenshotPlugin.Interfaces; using log4net; namespace Greenshot.Helpers { diff --git a/Greenshot/Helpers/EnvironmentInfo.cs b/Greenshot/Helpers/EnvironmentInfo.cs index a5a4c04c4..645639414 100644 --- a/Greenshot/Helpers/EnvironmentInfo.cs +++ b/Greenshot/Helpers/EnvironmentInfo.cs @@ -24,7 +24,7 @@ using System.Reflection; using System.Runtime.InteropServices; using System.Text; using System.Windows.Forms; -using Greenshot.IniFile; +using GreenshotPlugin.IniFile; using GreenshotPlugin.UnmanagedHelpers; namespace Greenshot.Helpers diff --git a/Greenshot/Helpers/IECaptureHelper.cs b/Greenshot/Helpers/IECaptureHelper.cs index b9183d7e9..cfe36a96b 100644 --- a/Greenshot/Helpers/IECaptureHelper.cs +++ b/Greenshot/Helpers/IECaptureHelper.cs @@ -26,13 +26,14 @@ using System.Linq; using System.Runtime.InteropServices; using Greenshot.Configuration; using Greenshot.Helpers.IEInterop; -using Greenshot.Interop; -using Greenshot.Interop.IE; -using Greenshot.Plugin; using GreenshotPlugin.UnmanagedHelpers; using GreenshotPlugin.Controls; using GreenshotPlugin.Core; -using Greenshot.IniFile; +using GreenshotPlugin.IEInterop; +using GreenshotPlugin.IniFile; +using GreenshotPlugin.Interfaces; +using GreenshotPlugin.Interop; +using GreenshotPlugin.UnmanagedHelpers.Enums; using log4net; namespace Greenshot.Helpers { diff --git a/Greenshot/Helpers/IEInterop/IEContainer.cs b/Greenshot/Helpers/IEInterop/IEContainer.cs index a91ecea32..56d83ff29 100644 --- a/Greenshot/Helpers/IEInterop/IEContainer.cs +++ b/Greenshot/Helpers/IEInterop/IEContainer.cs @@ -25,9 +25,9 @@ using System.Globalization; using System.Runtime.InteropServices; using GreenshotPlugin.Core; -using Greenshot.Interop.IE; +using GreenshotPlugin.IEInterop; using log4net; -using IServiceProvider = Greenshot.Interop.IServiceProvider; +using IServiceProvider = GreenshotPlugin.Interop.IServiceProvider; namespace Greenshot.Helpers.IEInterop { public class DocumentContainer { diff --git a/Greenshot/Helpers/MailHelper.cs b/Greenshot/Helpers/MailHelper.cs index 7d28605e0..d3daaf446 100644 --- a/Greenshot/Helpers/MailHelper.cs +++ b/Greenshot/Helpers/MailHelper.cs @@ -19,8 +19,6 @@ * along with this program. If not, see . */ -using Greenshot.IniFile; -using Greenshot.Plugin; using GreenshotPlugin.Core; using log4net; using System; @@ -30,6 +28,9 @@ using System.IO; using System.Runtime.InteropServices; using System.Threading; using System.Windows.Forms; +using GreenshotPlugin.IniFile; +using GreenshotPlugin.Interfaces; +using GreenshotPlugin.Interfaces.Plugin; namespace Greenshot.Helpers { /// diff --git a/Greenshot/Helpers/PluginHelper.cs b/Greenshot/Helpers/PluginHelper.cs index 87bb08d99..1d31e8e38 100644 --- a/Greenshot/Helpers/PluginHelper.cs +++ b/Greenshot/Helpers/PluginHelper.cs @@ -26,9 +26,10 @@ using System.IO; using System.Linq; using System.Reflection; using System.Windows.Forms; -using Greenshot.Plugin; using GreenshotPlugin.Core; -using Greenshot.IniFile; +using GreenshotPlugin.IniFile; +using GreenshotPlugin.Interfaces; +using GreenshotPlugin.Interfaces.Plugin; using log4net; namespace Greenshot.Helpers { diff --git a/Greenshot/Helpers/PrintHelper.cs b/Greenshot/Helpers/PrintHelper.cs index a78060f67..5de51a20f 100644 --- a/Greenshot/Helpers/PrintHelper.cs +++ b/Greenshot/Helpers/PrintHelper.cs @@ -25,10 +25,11 @@ using System.Windows.Forms; using Greenshot.Configuration; using Greenshot.Forms; -using Greenshot.Plugin; using GreenshotPlugin.Core; -using Greenshot.IniFile; using GreenshotPlugin.Effects; +using GreenshotPlugin.IniFile; +using GreenshotPlugin.Interfaces; +using GreenshotPlugin.Interfaces.Plugin; using log4net; namespace Greenshot.Helpers { diff --git a/Greenshot/Helpers/ProcessorHelper.cs b/Greenshot/Helpers/ProcessorHelper.cs index 75ce8a1ac..fc2e7197b 100644 --- a/Greenshot/Helpers/ProcessorHelper.cs +++ b/Greenshot/Helpers/ProcessorHelper.cs @@ -20,9 +20,8 @@ */ using System; using System.Collections.Generic; - -using Greenshot.Plugin; using GreenshotPlugin.Core; +using GreenshotPlugin.Interfaces; using log4net; namespace Greenshot.Helpers { diff --git a/Greenshot/Helpers/SoundHelper.cs b/Greenshot/Helpers/SoundHelper.cs index e3dd5a41c..eb9139290 100644 --- a/Greenshot/Helpers/SoundHelper.cs +++ b/Greenshot/Helpers/SoundHelper.cs @@ -25,9 +25,9 @@ using System.Runtime.InteropServices; using GreenshotPlugin.UnmanagedHelpers; using GreenshotPlugin.Core; -using Greenshot.IniFile; using System.IO; - +using GreenshotPlugin.IniFile; +using GreenshotPlugin.UnmanagedHelpers.Enums; using log4net; namespace Greenshot.Helpers { diff --git a/Greenshot/Helpers/UpdateHelper.cs b/Greenshot/Helpers/UpdateHelper.cs index 052ac592b..fd2e26075 100644 --- a/Greenshot/Helpers/UpdateHelper.cs +++ b/Greenshot/Helpers/UpdateHelper.cs @@ -26,7 +26,7 @@ using System.Windows.Forms; using Greenshot.Configuration; using GreenshotPlugin.Core; -using Greenshot.IniFile; +using GreenshotPlugin.IniFile; using log4net; namespace Greenshot.Experimental { diff --git a/Greenshot/Memento/AddElementMemento.cs b/Greenshot/Memento/AddElementMemento.cs index 73b72677a..980bb17b1 100644 --- a/Greenshot/Memento/AddElementMemento.cs +++ b/Greenshot/Memento/AddElementMemento.cs @@ -20,7 +20,7 @@ */ using System; using Greenshot.Drawing; -using Greenshot.Plugin.Drawing; +using GreenshotPlugin.Interfaces.Drawing; namespace Greenshot.Memento { /// diff --git a/Greenshot/Memento/AddElementsMemento.cs b/Greenshot/Memento/AddElementsMemento.cs index 192a96968..91a4f4d56 100644 --- a/Greenshot/Memento/AddElementsMemento.cs +++ b/Greenshot/Memento/AddElementsMemento.cs @@ -19,7 +19,7 @@ * along with this program. If not, see . */ using Greenshot.Drawing; -using Greenshot.Plugin.Drawing; +using GreenshotPlugin.Interfaces.Drawing; namespace Greenshot.Memento { diff --git a/Greenshot/Memento/ChangeFieldHolderMemento.cs b/Greenshot/Memento/ChangeFieldHolderMemento.cs index 808b21ccb..fc94df076 100644 --- a/Greenshot/Memento/ChangeFieldHolderMemento.cs +++ b/Greenshot/Memento/ChangeFieldHolderMemento.cs @@ -19,7 +19,6 @@ * along with this program. If not, see . */ -using Greenshot.Plugin.Drawing; using GreenshotPlugin.Interfaces.Drawing; namespace Greenshot.Memento diff --git a/Greenshot/Memento/DeleteElementMemento.cs b/Greenshot/Memento/DeleteElementMemento.cs index bd3161dc8..fd9e793b2 100644 --- a/Greenshot/Memento/DeleteElementMemento.cs +++ b/Greenshot/Memento/DeleteElementMemento.cs @@ -20,7 +20,7 @@ */ using System; using Greenshot.Drawing; -using Greenshot.Plugin.Drawing; +using GreenshotPlugin.Interfaces.Drawing; namespace Greenshot.Memento { /// diff --git a/Greenshot/Memento/DeleteElementsMemento.cs b/Greenshot/Memento/DeleteElementsMemento.cs index 52cd71240..98e3c63bf 100644 --- a/Greenshot/Memento/DeleteElementsMemento.cs +++ b/Greenshot/Memento/DeleteElementsMemento.cs @@ -19,7 +19,7 @@ * along with this program. If not, see . */ using Greenshot.Drawing; -using Greenshot.Plugin.Drawing; +using GreenshotPlugin.Interfaces.Drawing; namespace Greenshot.Memento { diff --git a/Greenshot/Memento/DrawableContainerBoundsChangeMemento.cs b/Greenshot/Memento/DrawableContainerBoundsChangeMemento.cs index 00e2f25a7..9d29ea05d 100644 --- a/Greenshot/Memento/DrawableContainerBoundsChangeMemento.cs +++ b/Greenshot/Memento/DrawableContainerBoundsChangeMemento.cs @@ -19,10 +19,10 @@ * along with this program. If not, see . */ using Greenshot.Drawing; -using Greenshot.Plugin.Drawing; using GreenshotPlugin.Core; using System.Collections.Generic; using System.Drawing; +using GreenshotPlugin.Interfaces.Drawing; namespace Greenshot.Memento { diff --git a/Greenshot/Memento/SurfaceBackgroundChangeMemento.cs b/Greenshot/Memento/SurfaceBackgroundChangeMemento.cs index 14155e11a..efece64d2 100644 --- a/Greenshot/Memento/SurfaceBackgroundChangeMemento.cs +++ b/Greenshot/Memento/SurfaceBackgroundChangeMemento.cs @@ -22,6 +22,7 @@ using Greenshot.Drawing; using System.Drawing; using System.Drawing.Drawing2D; +using GreenshotPlugin.Interfaces.Drawing; namespace Greenshot.Memento { /// diff --git a/Greenshot/Memento/TextChangeMemento.cs b/Greenshot/Memento/TextChangeMemento.cs index 3c817c9ab..a15907adb 100644 --- a/Greenshot/Memento/TextChangeMemento.cs +++ b/Greenshot/Memento/TextChangeMemento.cs @@ -20,6 +20,7 @@ */ using Greenshot.Drawing; +using GreenshotPlugin.Interfaces.Drawing; namespace Greenshot.Memento { /// diff --git a/Greenshot/Processors/TitleFixProcessor.cs b/Greenshot/Processors/TitleFixProcessor.cs index 368653ee9..2940cad8d 100644 --- a/Greenshot/Processors/TitleFixProcessor.cs +++ b/Greenshot/Processors/TitleFixProcessor.cs @@ -21,10 +21,9 @@ using System.Collections.Generic; using System.Text.RegularExpressions; - -using Greenshot.Plugin; using GreenshotPlugin.Core; -using Greenshot.IniFile; +using GreenshotPlugin.IniFile; +using GreenshotPlugin.Interfaces; using log4net; namespace Greenshot.Processors { @@ -67,7 +66,7 @@ namespace Greenshot.Processors { title = title.Trim(); foreach(string titleIdentifier in config.ActiveTitleFixes) { string regexpString = config.TitleFixMatcher[titleIdentifier]; - string replaceString = config.TitleFixReplacer[titleIdentifier] ?? ""; + string replaceString = config.TitleFixReplacer[titleIdentifier] ?? string.Empty; if (string.IsNullOrEmpty(regexpString)) continue; diff --git a/GreenshotBoxPlugin/BoxConfiguration.cs b/GreenshotBoxPlugin/BoxConfiguration.cs index 991fe594e..27ac67676 100644 --- a/GreenshotBoxPlugin/BoxConfiguration.cs +++ b/GreenshotBoxPlugin/BoxConfiguration.cs @@ -20,9 +20,9 @@ */ using System.Windows.Forms; -using Greenshot.IniFile; using GreenshotPlugin.Core; using System; +using GreenshotPlugin.IniFile; namespace GreenshotBoxPlugin { /// diff --git a/GreenshotBoxPlugin/BoxDestination.cs b/GreenshotBoxPlugin/BoxDestination.cs index 96223a902..8cdd53515 100644 --- a/GreenshotBoxPlugin/BoxDestination.cs +++ b/GreenshotBoxPlugin/BoxDestination.cs @@ -20,8 +20,8 @@ */ using System.ComponentModel; using System.Drawing; -using Greenshot.Plugin; using GreenshotPlugin.Core; +using GreenshotPlugin.Interfaces; namespace GreenshotBoxPlugin { public class BoxDestination : AbstractDestination { diff --git a/GreenshotBoxPlugin/BoxPlugin.cs b/GreenshotBoxPlugin/BoxPlugin.cs index 18b2b8d0e..de72db4a4 100644 --- a/GreenshotBoxPlugin/BoxPlugin.cs +++ b/GreenshotBoxPlugin/BoxPlugin.cs @@ -23,10 +23,11 @@ using System.ComponentModel; using System.Drawing; using System.IO; using System.Windows.Forms; -using Greenshot.IniFile; -using Greenshot.Plugin; using GreenshotPlugin.Controls; using GreenshotPlugin.Core; +using GreenshotPlugin.IniFile; +using GreenshotPlugin.Interfaces; +using GreenshotPlugin.Interfaces.Plugin; namespace GreenshotBoxPlugin { /// diff --git a/GreenshotBoxPlugin/BoxUtils.cs b/GreenshotBoxPlugin/BoxUtils.cs index 64464b8e0..0c5b2b10f 100644 --- a/GreenshotBoxPlugin/BoxUtils.cs +++ b/GreenshotBoxPlugin/BoxUtils.cs @@ -19,13 +19,13 @@ * along with this program. If not, see . */ -using Greenshot.IniFile; using GreenshotPlugin.Core; using System.Collections.Generic; using System.Drawing; using System.IO; using System.Runtime.Serialization.Json; using System.Text; +using GreenshotPlugin.IniFile; namespace GreenshotBoxPlugin { diff --git a/GreenshotBoxPlugin/Properties/AssemblyInfo.cs b/GreenshotBoxPlugin/Properties/AssemblyInfo.cs index 2ccef9573..ce75d8750 100644 --- a/GreenshotBoxPlugin/Properties/AssemblyInfo.cs +++ b/GreenshotBoxPlugin/Properties/AssemblyInfo.cs @@ -19,7 +19,6 @@ * along with this program. If not, see . */ -using Greenshot.Plugin; using System.Reflection; using System.Runtime.InteropServices; diff --git a/GreenshotConfluencePlugin/Confluence.cs b/GreenshotConfluencePlugin/Confluence.cs index ddc4be0c1..3ccfce630 100644 --- a/GreenshotConfluencePlugin/Confluence.cs +++ b/GreenshotConfluencePlugin/Confluence.cs @@ -21,10 +21,10 @@ using System; using System.Collections.Generic; using System.Windows.Forms; -using Greenshot.IniFile; using GreenshotConfluencePlugin; using GreenshotConfluencePlugin.confluence; using GreenshotPlugin.Core; +using GreenshotPlugin.IniFile; namespace Confluence { public class Page { @@ -250,7 +250,7 @@ namespace Confluence { public Page GetPage(long pageId) { RemotePage page = null; - string cacheKey = "" + pageId; + string cacheKey = pageId.ToString(); if (_pageCache.Contains(cacheKey)) { page = _pageCache[cacheKey]; diff --git a/GreenshotConfluencePlugin/ConfluenceConfiguration.cs b/GreenshotConfluencePlugin/ConfluenceConfiguration.cs index b04efa234..a62dcbf38 100644 --- a/GreenshotConfluencePlugin/ConfluenceConfiguration.cs +++ b/GreenshotConfluencePlugin/ConfluenceConfiguration.cs @@ -19,8 +19,8 @@ * along with this program. If not, see . */ using System; -using Greenshot.IniFile; using GreenshotPlugin.Core; +using GreenshotPlugin.IniFile; namespace GreenshotConfluencePlugin { /// diff --git a/GreenshotConfluencePlugin/ConfluenceDestination.cs b/GreenshotConfluencePlugin/ConfluenceDestination.cs index 966c4f4e9..63bf60f01 100644 --- a/GreenshotConfluencePlugin/ConfluenceDestination.cs +++ b/GreenshotConfluencePlugin/ConfluenceDestination.cs @@ -26,10 +26,11 @@ using System.IO; using System.Threading; using System.Windows; using Confluence; -using Greenshot.IniFile; -using Greenshot.Plugin; using GreenshotPlugin.Controls; using GreenshotPlugin.Core; +using GreenshotPlugin.IniFile; +using GreenshotPlugin.Interfaces; +using GreenshotPlugin.Interfaces.Plugin; namespace GreenshotConfluencePlugin { /// diff --git a/GreenshotConfluencePlugin/ConfluencePlugin.cs b/GreenshotConfluencePlugin/ConfluencePlugin.cs index 8dac45b97..bb9fb5aa4 100644 --- a/GreenshotConfluencePlugin/ConfluencePlugin.cs +++ b/GreenshotConfluencePlugin/ConfluencePlugin.cs @@ -20,11 +20,11 @@ */ using Confluence; -using Greenshot.IniFile; -using Greenshot.Plugin; using GreenshotPlugin.Core; using System; using System.Windows; +using GreenshotPlugin.IniFile; +using GreenshotPlugin.Interfaces.Plugin; using TranslationByMarkupExtension; namespace GreenshotConfluencePlugin { diff --git a/GreenshotConfluencePlugin/Forms/ConfluenceSearch.xaml.cs b/GreenshotConfluencePlugin/Forms/ConfluenceSearch.xaml.cs index e84366a8f..1b5c3877e 100644 --- a/GreenshotConfluencePlugin/Forms/ConfluenceSearch.xaml.cs +++ b/GreenshotConfluencePlugin/Forms/ConfluenceSearch.xaml.cs @@ -23,7 +23,7 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; using System.Windows; -using Greenshot.IniFile; +using GreenshotPlugin.IniFile; namespace GreenshotConfluencePlugin { public partial class ConfluenceSearch diff --git a/GreenshotDropboxPlugin/DropboxDestination.cs b/GreenshotDropboxPlugin/DropboxDestination.cs index 055b7ba61..261ead03d 100644 --- a/GreenshotDropboxPlugin/DropboxDestination.cs +++ b/GreenshotDropboxPlugin/DropboxDestination.cs @@ -20,9 +20,9 @@ */ using System.ComponentModel; using System.Drawing; -using Greenshot.IniFile; -using Greenshot.Plugin; using GreenshotPlugin.Core; +using GreenshotPlugin.IniFile; +using GreenshotPlugin.Interfaces; namespace GreenshotDropboxPlugin { internal class DropboxDestination : AbstractDestination { diff --git a/GreenshotDropboxPlugin/DropboxPlugin.cs b/GreenshotDropboxPlugin/DropboxPlugin.cs index d75f4704c..b25d20a2c 100644 --- a/GreenshotDropboxPlugin/DropboxPlugin.cs +++ b/GreenshotDropboxPlugin/DropboxPlugin.cs @@ -23,10 +23,11 @@ using System.ComponentModel; using System.Drawing; using System.IO; using System.Windows.Forms; -using Greenshot.IniFile; -using Greenshot.Plugin; using GreenshotPlugin.Controls; using GreenshotPlugin.Core; +using GreenshotPlugin.IniFile; +using GreenshotPlugin.Interfaces; +using GreenshotPlugin.Interfaces.Plugin; namespace GreenshotDropboxPlugin { /// diff --git a/GreenshotDropboxPlugin/DropboxPluginConfiguration.cs b/GreenshotDropboxPlugin/DropboxPluginConfiguration.cs index 9b2c92569..1b189487b 100644 --- a/GreenshotDropboxPlugin/DropboxPluginConfiguration.cs +++ b/GreenshotDropboxPlugin/DropboxPluginConfiguration.cs @@ -19,8 +19,8 @@ * along with this program. If not, see . */ using System.Windows.Forms; -using Greenshot.IniFile; using GreenshotPlugin.Core; +using GreenshotPlugin.IniFile; namespace GreenshotDropboxPlugin { diff --git a/GreenshotDropboxPlugin/DropboxUtils.cs b/GreenshotDropboxPlugin/DropboxUtils.cs index 0c0824cc3..434cdcdcf 100644 --- a/GreenshotDropboxPlugin/DropboxUtils.cs +++ b/GreenshotDropboxPlugin/DropboxUtils.cs @@ -21,9 +21,10 @@ using System; using System.Collections.Generic; using System.Drawing; -using Greenshot.IniFile; -using Greenshot.Plugin; using GreenshotPlugin.Core; +using GreenshotPlugin.IniFile; +using GreenshotPlugin.Interfaces; +using GreenshotPlugin.Interfaces.Plugin; namespace GreenshotDropboxPlugin { /// diff --git a/GreenshotExternalCommandPlugin/ExternalCommandConfiguration.cs b/GreenshotExternalCommandPlugin/ExternalCommandConfiguration.cs index 3f44bca79..aa5e76d98 100644 --- a/GreenshotExternalCommandPlugin/ExternalCommandConfiguration.cs +++ b/GreenshotExternalCommandPlugin/ExternalCommandConfiguration.cs @@ -22,8 +22,8 @@ using System; using System.Collections.Generic; using System.IO; -using Greenshot.IniFile; using GreenshotPlugin.Core; +using GreenshotPlugin.IniFile; namespace GreenshotExternalCommandPlugin { /// diff --git a/GreenshotExternalCommandPlugin/ExternalCommandDestination.cs b/GreenshotExternalCommandPlugin/ExternalCommandDestination.cs index 01759d35f..74676182c 100644 --- a/GreenshotExternalCommandPlugin/ExternalCommandDestination.cs +++ b/GreenshotExternalCommandPlugin/ExternalCommandDestination.cs @@ -26,9 +26,10 @@ using System.Diagnostics; using System.Drawing; using System.Text.RegularExpressions; using System.Threading; -using Greenshot.IniFile; -using Greenshot.Plugin; using GreenshotPlugin.Core; +using GreenshotPlugin.IniFile; +using GreenshotPlugin.Interfaces; +using GreenshotPlugin.Interfaces.Plugin; namespace GreenshotExternalCommandPlugin { /// diff --git a/GreenshotExternalCommandPlugin/ExternalCommandPlugin.cs b/GreenshotExternalCommandPlugin/ExternalCommandPlugin.cs index bf7b74377..67a278a3a 100644 --- a/GreenshotExternalCommandPlugin/ExternalCommandPlugin.cs +++ b/GreenshotExternalCommandPlugin/ExternalCommandPlugin.cs @@ -24,9 +24,10 @@ using System.Collections.Generic; using System.ComponentModel; using System.IO; using System.Windows.Forms; -using Greenshot.IniFile; -using Greenshot.Plugin; using GreenshotPlugin.Core; +using GreenshotPlugin.IniFile; +using GreenshotPlugin.Interfaces; +using GreenshotPlugin.Interfaces.Plugin; namespace GreenshotExternalCommandPlugin { /// diff --git a/GreenshotExternalCommandPlugin/IconCache.cs b/GreenshotExternalCommandPlugin/IconCache.cs index 4bf4245a2..f510c0823 100644 --- a/GreenshotExternalCommandPlugin/IconCache.cs +++ b/GreenshotExternalCommandPlugin/IconCache.cs @@ -22,8 +22,8 @@ using System; using System.Drawing; using System.IO; -using Greenshot.IniFile; using GreenshotPlugin.Core; +using GreenshotPlugin.IniFile; namespace GreenshotExternalCommandPlugin { public static class IconCache { diff --git a/GreenshotExternalCommandPlugin/SettingsForm.cs b/GreenshotExternalCommandPlugin/SettingsForm.cs index fa650832a..7aecfb04e 100644 --- a/GreenshotExternalCommandPlugin/SettingsForm.cs +++ b/GreenshotExternalCommandPlugin/SettingsForm.cs @@ -22,7 +22,7 @@ using System; using System.Drawing; using System.Windows.Forms; -using Greenshot.IniFile; +using GreenshotPlugin.IniFile; namespace GreenshotExternalCommandPlugin { /// diff --git a/GreenshotExternalCommandPlugin/SettingsFormDetail.cs b/GreenshotExternalCommandPlugin/SettingsFormDetail.cs index 9aee37edf..db154be58 100644 --- a/GreenshotExternalCommandPlugin/SettingsFormDetail.cs +++ b/GreenshotExternalCommandPlugin/SettingsFormDetail.cs @@ -23,8 +23,8 @@ using System; using System.Drawing; using System.IO; using System.Windows.Forms; -using Greenshot.IniFile; using GreenshotPlugin.Core; +using GreenshotPlugin.IniFile; namespace GreenshotExternalCommandPlugin { /// diff --git a/GreenshotFlickrPlugin/FlickrConfiguration.cs b/GreenshotFlickrPlugin/FlickrConfiguration.cs index 64361dbe2..56b74432e 100644 --- a/GreenshotFlickrPlugin/FlickrConfiguration.cs +++ b/GreenshotFlickrPlugin/FlickrConfiguration.cs @@ -19,8 +19,8 @@ * along with this program. If not, see . */ using System.Windows.Forms; -using Greenshot.IniFile; using GreenshotPlugin.Core; +using GreenshotPlugin.IniFile; namespace GreenshotFlickrPlugin { public enum SafetyLevel { diff --git a/GreenshotFlickrPlugin/FlickrDestination.cs b/GreenshotFlickrPlugin/FlickrDestination.cs index 65f685b86..6cc874d29 100644 --- a/GreenshotFlickrPlugin/FlickrDestination.cs +++ b/GreenshotFlickrPlugin/FlickrDestination.cs @@ -20,8 +20,8 @@ */ using System.ComponentModel; using System.Drawing; -using Greenshot.Plugin; using GreenshotPlugin.Core; +using GreenshotPlugin.Interfaces; namespace GreenshotFlickrPlugin { public class FlickrDestination : AbstractDestination { diff --git a/GreenshotFlickrPlugin/FlickrPlugin.cs b/GreenshotFlickrPlugin/FlickrPlugin.cs index 98a3cd020..4e2514eb6 100644 --- a/GreenshotFlickrPlugin/FlickrPlugin.cs +++ b/GreenshotFlickrPlugin/FlickrPlugin.cs @@ -24,10 +24,11 @@ using System.ComponentModel; using System.Drawing; using System.IO; using System.Windows.Forms; -using Greenshot.IniFile; -using Greenshot.Plugin; using GreenshotPlugin.Controls; using GreenshotPlugin.Core; +using GreenshotPlugin.IniFile; +using GreenshotPlugin.Interfaces; +using GreenshotPlugin.Interfaces.Plugin; using log4net; namespace GreenshotFlickrPlugin diff --git a/GreenshotFlickrPlugin/FlickrUtils.cs b/GreenshotFlickrPlugin/FlickrUtils.cs index 33fc80203..868479e10 100644 --- a/GreenshotFlickrPlugin/FlickrUtils.cs +++ b/GreenshotFlickrPlugin/FlickrUtils.cs @@ -23,9 +23,10 @@ using System; using System.Collections.Generic; using System.Drawing; using System.Xml; -using Greenshot.IniFile; -using Greenshot.Plugin; using GreenshotPlugin.Core; +using GreenshotPlugin.IniFile; +using GreenshotPlugin.Interfaces; +using GreenshotPlugin.Interfaces.Plugin; using log4net; namespace GreenshotFlickrPlugin { diff --git a/GreenshotImgurPlugin/Forms/ImgurHistory.cs b/GreenshotImgurPlugin/Forms/ImgurHistory.cs index 34fb72fb1..cc5dc4cf1 100644 --- a/GreenshotImgurPlugin/Forms/ImgurHistory.cs +++ b/GreenshotImgurPlugin/Forms/ImgurHistory.cs @@ -25,7 +25,7 @@ using System.Windows.Forms; using GreenshotPlugin.Controls; using GreenshotPlugin.Core; -using Greenshot.IniFile; +using GreenshotPlugin.IniFile; namespace GreenshotImgurPlugin { /// diff --git a/GreenshotImgurPlugin/ImgurConfiguration.cs b/GreenshotImgurPlugin/ImgurConfiguration.cs index 91f407a5a..795814192 100644 --- a/GreenshotImgurPlugin/ImgurConfiguration.cs +++ b/GreenshotImgurPlugin/ImgurConfiguration.cs @@ -22,8 +22,8 @@ using System; using System.Collections.Generic; using System.Windows.Forms; -using Greenshot.IniFile; using GreenshotPlugin.Core; +using GreenshotPlugin.IniFile; namespace GreenshotImgurPlugin { /// diff --git a/GreenshotImgurPlugin/ImgurDestination.cs b/GreenshotImgurPlugin/ImgurDestination.cs index 898bb6941..c4d1ad445 100644 --- a/GreenshotImgurPlugin/ImgurDestination.cs +++ b/GreenshotImgurPlugin/ImgurDestination.cs @@ -20,8 +20,8 @@ */ using System.ComponentModel; using System.Drawing; -using Greenshot.Plugin; using GreenshotPlugin.Core; +using GreenshotPlugin.Interfaces; namespace GreenshotImgurPlugin { /// diff --git a/GreenshotImgurPlugin/ImgurPlugin.cs b/GreenshotImgurPlugin/ImgurPlugin.cs index fd397ad6b..39cd8b9c0 100644 --- a/GreenshotImgurPlugin/ImgurPlugin.cs +++ b/GreenshotImgurPlugin/ImgurPlugin.cs @@ -24,10 +24,11 @@ using System.ComponentModel; using System.Drawing; using System.IO; using System.Windows.Forms; -using Greenshot.IniFile; -using Greenshot.Plugin; using GreenshotPlugin.Controls; using GreenshotPlugin.Core; +using GreenshotPlugin.IniFile; +using GreenshotPlugin.Interfaces; +using GreenshotPlugin.Interfaces.Plugin; namespace GreenshotImgurPlugin { /// diff --git a/GreenshotImgurPlugin/ImgurUtils.cs b/GreenshotImgurPlugin/ImgurUtils.cs index a5dd95b1d..817ff44fa 100644 --- a/GreenshotImgurPlugin/ImgurUtils.cs +++ b/GreenshotImgurPlugin/ImgurUtils.cs @@ -24,9 +24,10 @@ using System.Drawing; using System.IO; using System.Linq; using System.Net; -using Greenshot.IniFile; -using Greenshot.Plugin; using GreenshotPlugin.Core; +using GreenshotPlugin.IniFile; +using GreenshotPlugin.Interfaces; +using GreenshotPlugin.Interfaces.Plugin; namespace GreenshotImgurPlugin { /// diff --git a/GreenshotJiraPlugin/Forms/JiraForm.cs b/GreenshotJiraPlugin/Forms/JiraForm.cs index 5f52af746..5a346b1c4 100644 --- a/GreenshotJiraPlugin/Forms/JiraForm.cs +++ b/GreenshotJiraPlugin/Forms/JiraForm.cs @@ -23,12 +23,12 @@ using System; using System.Globalization; using System.Windows.Forms; using Dapplo.Jira.Entities; -using Greenshot.IniFile; using GreenshotPlugin.Controls; using GreenshotPlugin.Core; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; +using GreenshotPlugin.IniFile; namespace GreenshotJiraPlugin.Forms { public partial class JiraForm : Form { @@ -148,7 +148,7 @@ namespace GreenshotJiraPlugin.Forms { { if (!Language.TryGetString("jira", column, out var translation)) { - translation = ""; + translation = string.Empty; } jiraListView.Columns.Add(translation); } diff --git a/GreenshotJiraPlugin/JiraConfiguration.cs b/GreenshotJiraPlugin/JiraConfiguration.cs index c9e59f13a..89c4fcf9b 100644 --- a/GreenshotJiraPlugin/JiraConfiguration.cs +++ b/GreenshotJiraPlugin/JiraConfiguration.cs @@ -19,8 +19,8 @@ * along with this program. If not, see . */ -using Greenshot.IniFile; using GreenshotPlugin.Core; +using GreenshotPlugin.IniFile; namespace GreenshotJiraPlugin { /// diff --git a/GreenshotJiraPlugin/JiraConnector.cs b/GreenshotJiraPlugin/JiraConnector.cs index 853b75e52..fa9851ad9 100644 --- a/GreenshotJiraPlugin/JiraConnector.cs +++ b/GreenshotJiraPlugin/JiraConnector.cs @@ -31,8 +31,8 @@ using Dapplo.HttpExtensions.Extensions; using Dapplo.Jira; using Dapplo.Jira.Converters; using Dapplo.Jira.Entities; -using Greenshot.IniFile; using GreenshotPlugin.Core; +using GreenshotPlugin.IniFile; namespace GreenshotJiraPlugin { /// @@ -79,7 +79,7 @@ namespace GreenshotJiraPlugin { /// public JiraConnector() { - JiraConfig.Url = JiraConfig.Url.Replace(DefaultPostfix, ""); + JiraConfig.Url = JiraConfig.Url.Replace(DefaultPostfix, string.Empty); } /// diff --git a/GreenshotJiraPlugin/JiraDestination.cs b/GreenshotJiraPlugin/JiraDestination.cs index ebd2c2910..76d2314b3 100644 --- a/GreenshotJiraPlugin/JiraDestination.cs +++ b/GreenshotJiraPlugin/JiraDestination.cs @@ -27,11 +27,12 @@ using System.IO; using System.Windows.Forms; using Dapplo.HttpExtensions; using Dapplo.Jira.Entities; -using Greenshot.IniFile; -using Greenshot.Plugin; using GreenshotJiraPlugin.Forms; using GreenshotPlugin.Controls; using GreenshotPlugin.Core; +using GreenshotPlugin.IniFile; +using GreenshotPlugin.Interfaces; +using GreenshotPlugin.Interfaces.Plugin; namespace GreenshotJiraPlugin { /// diff --git a/GreenshotJiraPlugin/JiraPlugin.cs b/GreenshotJiraPlugin/JiraPlugin.cs index 726454ad4..f8a98354e 100644 --- a/GreenshotJiraPlugin/JiraPlugin.cs +++ b/GreenshotJiraPlugin/JiraPlugin.cs @@ -20,13 +20,13 @@ */ using System.Windows.Forms; -using Greenshot.IniFile; -using Greenshot.Plugin; using System; using System.Threading.Tasks; using Dapplo.Log; using GreenshotJiraPlugin.Forms; using GreenshotPlugin.Core; +using GreenshotPlugin.IniFile; +using GreenshotPlugin.Interfaces.Plugin; using log4net; namespace GreenshotJiraPlugin { diff --git a/GreenshotOCRPlugin/OCRConfiguration.cs b/GreenshotOCRPlugin/OCRConfiguration.cs index 7c8e1fd55..bee6c33e1 100644 --- a/GreenshotOCRPlugin/OCRConfiguration.cs +++ b/GreenshotOCRPlugin/OCRConfiguration.cs @@ -19,7 +19,7 @@ * along with this program. If not, see . */ -using Greenshot.IniFile; +using GreenshotPlugin.IniFile; namespace GreenshotOCRPlugin { /// diff --git a/GreenshotOCRPlugin/OCRDestination.cs b/GreenshotOCRPlugin/OCRDestination.cs index 1f59d0c15..ee2dd975d 100644 --- a/GreenshotOCRPlugin/OCRDestination.cs +++ b/GreenshotOCRPlugin/OCRDestination.cs @@ -21,8 +21,8 @@ using System.Drawing; using System.IO; -using Greenshot.Plugin; using GreenshotPlugin.Core; +using GreenshotPlugin.Interfaces; namespace GreenshotOCRPlugin { /// diff --git a/GreenshotOCRPlugin/OCRPlugin.cs b/GreenshotOCRPlugin/OCRPlugin.cs index 3e3dbd76e..d43d84a45 100644 --- a/GreenshotOCRPlugin/OCRPlugin.cs +++ b/GreenshotOCRPlugin/OCRPlugin.cs @@ -23,10 +23,11 @@ using System; using System.Diagnostics; using System.IO; using System.Windows.Forms; -using Greenshot.IniFile; -using Greenshot.Plugin; using GreenshotPlugin.Core; using GreenshotPlugin.Effects; +using GreenshotPlugin.IniFile; +using GreenshotPlugin.Interfaces; +using GreenshotPlugin.Interfaces.Plugin; //using Microsoft.Win32; @@ -78,7 +79,7 @@ namespace GreenshotOCRPlugin { _config = IniConfig.GetIniSection(); if (_config.Language != null) { - _config.Language = _config.Language.Replace("miLANG_","").Replace("_"," "); + _config.Language = _config.Language.Replace("miLANG_", string.Empty).Replace("_"," "); } return true; } diff --git a/GreenshotOfficePlugin/Destinations/ExcelDestination.cs b/GreenshotOfficePlugin/Destinations/ExcelDestination.cs index 17f9be7ae..93ea6ed85 100644 --- a/GreenshotOfficePlugin/Destinations/ExcelDestination.cs +++ b/GreenshotOfficePlugin/Destinations/ExcelDestination.cs @@ -23,9 +23,10 @@ using System.Collections.Generic; using System.Drawing; using System.IO; using System.Text.RegularExpressions; -using Greenshot.Plugin; using GreenshotOfficePlugin.OfficeExport; using GreenshotPlugin.Core; +using GreenshotPlugin.Interfaces; +using GreenshotPlugin.Interfaces.Plugin; namespace GreenshotOfficePlugin.Destinations { /// diff --git a/GreenshotOfficePlugin/Destinations/OneNoteDestination.cs b/GreenshotOfficePlugin/Destinations/OneNoteDestination.cs index 0274d6da3..ce24b2862 100644 --- a/GreenshotOfficePlugin/Destinations/OneNoteDestination.cs +++ b/GreenshotOfficePlugin/Destinations/OneNoteDestination.cs @@ -23,10 +23,10 @@ using System; using System.Collections.Generic; using System.Drawing; using System.IO; -using Greenshot.Plugin; using GreenshotOfficePlugin.OfficeExport; using GreenshotOfficePlugin.OfficeInterop.OneNote; using GreenshotPlugin.Core; +using GreenshotPlugin.Interfaces; namespace GreenshotOfficePlugin.Destinations { public class OneNoteDestination : AbstractDestination { diff --git a/GreenshotOfficePlugin/Destinations/OutlookDestination.cs b/GreenshotOfficePlugin/Destinations/OutlookDestination.cs index 7ffec12a7..48590a6da 100644 --- a/GreenshotOfficePlugin/Destinations/OutlookDestination.cs +++ b/GreenshotOfficePlugin/Destinations/OutlookDestination.cs @@ -24,11 +24,12 @@ using System.Drawing; using System.IO; using System.Text.RegularExpressions; using System.Windows.Forms; -using Greenshot.IniFile; -using Greenshot.Plugin; using GreenshotOfficePlugin.OfficeExport; using GreenshotOfficePlugin.OfficeInterop.Outlook; using GreenshotPlugin.Core; +using GreenshotPlugin.IniFile; +using GreenshotPlugin.Interfaces; +using GreenshotPlugin.Interfaces.Plugin; namespace GreenshotOfficePlugin.Destinations { /// @@ -133,7 +134,7 @@ namespace GreenshotOfficePlugin.Destinations { attachmentName = "Greenshot Capture"; } // Make sure it's "clean" so it doesn't corrupt the header - attachmentName = Regex.Replace(attachmentName, @"[^\x20\d\w]", ""); + attachmentName = Regex.Replace(attachmentName, @"[^\x20\d\w]", string.Empty); if (_outlookInspectorCaption != null) { OutlookEmailExporter.ExportToInspector(_outlookInspectorCaption, tmpFile, attachmentName); diff --git a/GreenshotOfficePlugin/Destinations/PowerpointDestination.cs b/GreenshotOfficePlugin/Destinations/PowerpointDestination.cs index ea103a97f..bdb8bad6d 100644 --- a/GreenshotOfficePlugin/Destinations/PowerpointDestination.cs +++ b/GreenshotOfficePlugin/Destinations/PowerpointDestination.cs @@ -23,9 +23,10 @@ using System.Collections.Generic; using System.Drawing; using System.IO; using System.Text.RegularExpressions; -using Greenshot.Plugin; using GreenshotOfficePlugin.OfficeExport; using GreenshotPlugin.Core; +using GreenshotPlugin.Interfaces; +using GreenshotPlugin.Interfaces.Plugin; namespace GreenshotOfficePlugin.Destinations { /// diff --git a/GreenshotOfficePlugin/Destinations/WordDestination.cs b/GreenshotOfficePlugin/Destinations/WordDestination.cs index 260494928..c9148c408 100644 --- a/GreenshotOfficePlugin/Destinations/WordDestination.cs +++ b/GreenshotOfficePlugin/Destinations/WordDestination.cs @@ -24,9 +24,10 @@ using System.Collections.Generic; using System.Drawing; using System.IO; using System.Text.RegularExpressions; -using Greenshot.Plugin; using GreenshotOfficePlugin.OfficeExport; using GreenshotPlugin.Core; +using GreenshotPlugin.Interfaces; +using GreenshotPlugin.Interfaces.Plugin; namespace GreenshotOfficePlugin.Destinations { /// diff --git a/GreenshotOfficePlugin/OfficeConfiguration.cs b/GreenshotOfficePlugin/OfficeConfiguration.cs index cee2f5ffd..2401e782d 100644 --- a/GreenshotOfficePlugin/OfficeConfiguration.cs +++ b/GreenshotOfficePlugin/OfficeConfiguration.cs @@ -18,9 +18,10 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -using Greenshot.IniFile; + using GreenshotOfficePlugin.OfficeInterop.Outlook; using GreenshotOfficePlugin.OfficeInterop.Powerpoint; +using GreenshotPlugin.IniFile; namespace GreenshotOfficePlugin { diff --git a/GreenshotOfficePlugin/OfficeExport/ExcelExporter.cs b/GreenshotOfficePlugin/OfficeExport/ExcelExporter.cs index 67d85796d..2610ab564 100644 --- a/GreenshotOfficePlugin/OfficeExport/ExcelExporter.cs +++ b/GreenshotOfficePlugin/OfficeExport/ExcelExporter.cs @@ -23,12 +23,12 @@ using System; using System.Collections.Generic; using System.Drawing; using System.Reflection; -using Greenshot.Interop; using GreenshotOfficePlugin.OfficeInterop; using GreenshotOfficePlugin.OfficeInterop.Excel; using GreenshotOfficePlugin.OfficeInterop.Outlook; using GreenshotOfficePlugin.OfficeInterop.Powerpoint; using GreenshotPlugin.Core; +using GreenshotPlugin.Interop; namespace GreenshotOfficePlugin.OfficeExport { public class ExcelExporter { diff --git a/GreenshotOfficePlugin/OfficeExport/OneNoteExporter.cs b/GreenshotOfficePlugin/OfficeExport/OneNoteExporter.cs index 71ef1d85f..80934900e 100644 --- a/GreenshotOfficePlugin/OfficeExport/OneNoteExporter.cs +++ b/GreenshotOfficePlugin/OfficeExport/OneNoteExporter.cs @@ -24,10 +24,11 @@ using System.Collections.Generic; using System.IO; using System.Runtime.InteropServices; using System.Xml; -using Greenshot.Interop; -using Greenshot.Plugin; using GreenshotOfficePlugin.OfficeInterop.OneNote; using GreenshotPlugin.Core; +using GreenshotPlugin.Interfaces; +using GreenshotPlugin.Interfaces.Plugin; +using GreenshotPlugin.Interop; namespace GreenshotOfficePlugin.OfficeExport { @@ -48,7 +49,7 @@ namespace GreenshotOfficePlugin.OfficeExport { string unfiledNotesSectionId = GetSectionId(oneNoteApplication, SpecialLocation.slUnfiledNotesSection); if(unfiledNotesSectionId != null) { // ReSharper disable once RedundantAssignment - string pageId = ""; + string pageId = string.Empty; oneNoteApplication.CreateNewPage(unfiledNotesSectionId, out pageId, NewPageStyle.npsDefault); newPage.ID = pageId; // Set the new name, this is automatically done in the export to page @@ -110,12 +111,12 @@ namespace GreenshotOfficePlugin.OfficeExport { return null; } // ReSharper disable once RedundantAssignment - string unfiledNotesPath = ""; + string unfiledNotesPath = string.Empty; oneNoteApplication.GetSpecialLocation(specialLocation, out unfiledNotesPath); // ReSharper disable once RedundantAssignment - string notebookXml = ""; - oneNoteApplication.GetHierarchy("", HierarchyScope.hsPages, out notebookXml, XMLSchema.xs2010); + string notebookXml = string.Empty; + oneNoteApplication.GetHierarchy(string.Empty, HierarchyScope.hsPages, out notebookXml, XMLSchema.xs2010); if(!string.IsNullOrEmpty(notebookXml)) { Log.Debug(notebookXml); StringReader reader = null; @@ -150,8 +151,8 @@ namespace GreenshotOfficePlugin.OfficeExport { using IOneNoteApplication oneNoteApplication = COMWrapper.GetOrCreateInstance(); if (oneNoteApplication != null) { // ReSharper disable once RedundantAssignment - string notebookXml = ""; - oneNoteApplication.GetHierarchy("", HierarchyScope.hsPages, out notebookXml, XMLSchema.xs2010); + string notebookXml = string.Empty; + oneNoteApplication.GetHierarchy(string.Empty, HierarchyScope.hsPages, out notebookXml, XMLSchema.xs2010); if (!string.IsNullOrEmpty(notebookXml)) { Log.Debug(notebookXml); StringReader reader = null; diff --git a/GreenshotOfficePlugin/OfficeExport/OutlookEmailExporter.cs b/GreenshotOfficePlugin/OfficeExport/OutlookEmailExporter.cs index fb9670d3c..9c0b51f1f 100644 --- a/GreenshotOfficePlugin/OfficeExport/OutlookEmailExporter.cs +++ b/GreenshotOfficePlugin/OfficeExport/OutlookEmailExporter.cs @@ -23,12 +23,12 @@ using System; using System.Collections.Generic; using System.IO; using System.Text; -using Greenshot.IniFile; -using Greenshot.Interop; -using Greenshot.Interop.IE; using GreenshotOfficePlugin.OfficeInterop; using GreenshotOfficePlugin.OfficeInterop.Outlook; using GreenshotOfficePlugin.OfficeInterop.Word; +using GreenshotPlugin.IEInterop; +using GreenshotPlugin.IniFile; +using GreenshotPlugin.Interop; using Microsoft.Win32; namespace GreenshotOfficePlugin.OfficeExport { @@ -372,7 +372,7 @@ namespace GreenshotOfficePlugin.OfficeExport { { newMail.BodyFormat = OlBodyFormat.olFormatPlain; if (bodyString == null) { - bodyString = ""; + bodyString = string.Empty; } newMail.Body = bodyString; } @@ -395,8 +395,8 @@ namespace GreenshotOfficePlugin.OfficeExport { } newMail.BodyFormat = OlBodyFormat.olFormatHTML; - string href = ""; - string hrefEnd = ""; + string href = string.Empty; + string hrefEnd = string.Empty; if (!string.IsNullOrEmpty(url)) { href = $""; hrefEnd = ""; @@ -483,7 +483,7 @@ namespace GreenshotOfficePlugin.OfficeExport { if (val == null) { continue; } - string signatureName = ""; + string signatureName = string.Empty; foreach (byte b in val) { if (b != 0) { signatureName += (char)b; diff --git a/GreenshotOfficePlugin/OfficeExport/PowerpointExporter.cs b/GreenshotOfficePlugin/OfficeExport/PowerpointExporter.cs index 8c3270dce..e749ec846 100644 --- a/GreenshotOfficePlugin/OfficeExport/PowerpointExporter.cs +++ b/GreenshotOfficePlugin/OfficeExport/PowerpointExporter.cs @@ -22,11 +22,11 @@ using System; using System.Collections.Generic; using System.Drawing; -using Greenshot.IniFile; -using Greenshot.Interop; using GreenshotOfficePlugin.OfficeInterop; using GreenshotOfficePlugin.OfficeInterop.Outlook; using GreenshotOfficePlugin.OfficeInterop.Powerpoint; +using GreenshotPlugin.IniFile; +using GreenshotPlugin.Interop; namespace GreenshotOfficePlugin.OfficeExport { public class PowerpointExporter { diff --git a/GreenshotOfficePlugin/OfficeExport/WordExporter.cs b/GreenshotOfficePlugin/OfficeExport/WordExporter.cs index 563b6cd4a..96250fe59 100644 --- a/GreenshotOfficePlugin/OfficeExport/WordExporter.cs +++ b/GreenshotOfficePlugin/OfficeExport/WordExporter.cs @@ -21,12 +21,12 @@ using System; using System.Collections.Generic; -using Greenshot.IniFile; -using Greenshot.Interop; using GreenshotOfficePlugin.OfficeInterop; using GreenshotOfficePlugin.OfficeInterop.Outlook; using GreenshotOfficePlugin.OfficeInterop.Word; using GreenshotPlugin.Core; +using GreenshotPlugin.IniFile; +using GreenshotPlugin.Interop; namespace GreenshotOfficePlugin.OfficeExport { public class WordExporter { diff --git a/GreenshotOfficePlugin/OfficeInterop/Excel/IExcelApplication.cs b/GreenshotOfficePlugin/OfficeInterop/Excel/IExcelApplication.cs index 4f3509f80..6d831b328 100644 --- a/GreenshotOfficePlugin/OfficeInterop/Excel/IExcelApplication.cs +++ b/GreenshotOfficePlugin/OfficeInterop/Excel/IExcelApplication.cs @@ -19,7 +19,7 @@ * along with this program. If not, see . */ -using Greenshot.Interop; +using GreenshotPlugin.Interop; namespace GreenshotOfficePlugin.OfficeInterop.Excel { /// diff --git a/GreenshotOfficePlugin/OfficeInterop/Excel/IWorkbook.cs b/GreenshotOfficePlugin/OfficeInterop/Excel/IWorkbook.cs index fce3f4f12..2beca0e2b 100644 --- a/GreenshotOfficePlugin/OfficeInterop/Excel/IWorkbook.cs +++ b/GreenshotOfficePlugin/OfficeInterop/Excel/IWorkbook.cs @@ -1,4 +1,4 @@ -using Greenshot.Interop; +using GreenshotPlugin.Interop; namespace GreenshotOfficePlugin.OfficeInterop.Excel { diff --git a/GreenshotOfficePlugin/OfficeInterop/Excel/IWorkbooks.cs b/GreenshotOfficePlugin/OfficeInterop/Excel/IWorkbooks.cs index 4b7e9750c..9d459e44a 100644 --- a/GreenshotOfficePlugin/OfficeInterop/Excel/IWorkbooks.cs +++ b/GreenshotOfficePlugin/OfficeInterop/Excel/IWorkbooks.cs @@ -1,4 +1,4 @@ -using Greenshot.Interop; +using GreenshotPlugin.Interop; namespace GreenshotOfficePlugin.OfficeInterop.Excel { diff --git a/GreenshotOfficePlugin/OfficeInterop/Excel/IWorksheet.cs b/GreenshotOfficePlugin/OfficeInterop/Excel/IWorksheet.cs index d4a214a63..d40c9a676 100644 --- a/GreenshotOfficePlugin/OfficeInterop/Excel/IWorksheet.cs +++ b/GreenshotOfficePlugin/OfficeInterop/Excel/IWorksheet.cs @@ -1,5 +1,5 @@ -using Greenshot.Interop; -using GreenshotOfficePlugin.OfficeInterop.Powerpoint; +using GreenshotOfficePlugin.OfficeInterop.Powerpoint; +using GreenshotPlugin.Interop; namespace GreenshotOfficePlugin.OfficeInterop.Excel { diff --git a/GreenshotOfficePlugin/OfficeInterop/ICollection.cs b/GreenshotOfficePlugin/OfficeInterop/ICollection.cs index 461076be5..3f8577cc5 100644 --- a/GreenshotOfficePlugin/OfficeInterop/ICollection.cs +++ b/GreenshotOfficePlugin/OfficeInterop/ICollection.cs @@ -20,7 +20,7 @@ */ using System.Collections; -using Greenshot.Interop; +using GreenshotPlugin.Interop; namespace GreenshotOfficePlugin.OfficeInterop { /// diff --git a/GreenshotOfficePlugin/OfficeInterop/OneNote/IOneNoteApplication.cs b/GreenshotOfficePlugin/OfficeInterop/OneNote/IOneNoteApplication.cs index f18315bd0..817ee8189 100644 --- a/GreenshotOfficePlugin/OfficeInterop/OneNote/IOneNoteApplication.cs +++ b/GreenshotOfficePlugin/OfficeInterop/OneNote/IOneNoteApplication.cs @@ -1,5 +1,5 @@ using System; -using Greenshot.Interop; +using GreenshotPlugin.Interop; namespace GreenshotOfficePlugin.OfficeInterop.OneNote { diff --git a/GreenshotOfficePlugin/OfficeInterop/Outlook/AppointmentItem.cs b/GreenshotOfficePlugin/OfficeInterop/Outlook/AppointmentItem.cs index 6a6c42638..17e94d841 100644 --- a/GreenshotOfficePlugin/OfficeInterop/Outlook/AppointmentItem.cs +++ b/GreenshotOfficePlugin/OfficeInterop/Outlook/AppointmentItem.cs @@ -1,5 +1,5 @@ using System; -using Greenshot.Interop; +using GreenshotPlugin.Interop; namespace GreenshotOfficePlugin.OfficeInterop.Outlook { diff --git a/GreenshotOfficePlugin/OfficeInterop/Outlook/IAttachment.cs b/GreenshotOfficePlugin/OfficeInterop/Outlook/IAttachment.cs index 2dde67270..073aca660 100644 --- a/GreenshotOfficePlugin/OfficeInterop/Outlook/IAttachment.cs +++ b/GreenshotOfficePlugin/OfficeInterop/Outlook/IAttachment.cs @@ -1,4 +1,4 @@ -using Greenshot.Interop; +using GreenshotPlugin.Interop; namespace GreenshotOfficePlugin.OfficeInterop.Outlook { diff --git a/GreenshotOfficePlugin/OfficeInterop/Outlook/ICommonExplorer.cs b/GreenshotOfficePlugin/OfficeInterop/Outlook/ICommonExplorer.cs index e2c07c5ed..e8e41368d 100644 --- a/GreenshotOfficePlugin/OfficeInterop/Outlook/ICommonExplorer.cs +++ b/GreenshotOfficePlugin/OfficeInterop/Outlook/ICommonExplorer.cs @@ -1,4 +1,4 @@ -using Greenshot.Interop; +using GreenshotPlugin.Interop; namespace GreenshotOfficePlugin.OfficeInterop.Outlook { diff --git a/GreenshotOfficePlugin/OfficeInterop/Outlook/IContactItem.cs b/GreenshotOfficePlugin/OfficeInterop/Outlook/IContactItem.cs index 3bf14b83a..e4a900770 100644 --- a/GreenshotOfficePlugin/OfficeInterop/Outlook/IContactItem.cs +++ b/GreenshotOfficePlugin/OfficeInterop/Outlook/IContactItem.cs @@ -1,4 +1,4 @@ -using Greenshot.Interop; +using GreenshotPlugin.Interop; namespace GreenshotOfficePlugin.OfficeInterop.Outlook { diff --git a/GreenshotOfficePlugin/OfficeInterop/Outlook/IExplorers.cs b/GreenshotOfficePlugin/OfficeInterop/Outlook/IExplorers.cs index 51d6ef802..b0d6d1b05 100644 --- a/GreenshotOfficePlugin/OfficeInterop/Outlook/IExplorers.cs +++ b/GreenshotOfficePlugin/OfficeInterop/Outlook/IExplorers.cs @@ -1,5 +1,5 @@ using System.Collections; -using Greenshot.Interop; +using GreenshotPlugin.Interop; namespace GreenshotOfficePlugin.OfficeInterop.Outlook { diff --git a/GreenshotOfficePlugin/OfficeInterop/Outlook/IFolder.cs b/GreenshotOfficePlugin/OfficeInterop/Outlook/IFolder.cs index f457cf96d..fb3fd03ec 100644 --- a/GreenshotOfficePlugin/OfficeInterop/Outlook/IFolder.cs +++ b/GreenshotOfficePlugin/OfficeInterop/Outlook/IFolder.cs @@ -1,4 +1,4 @@ -using Greenshot.Interop; +using GreenshotPlugin.Interop; namespace GreenshotOfficePlugin.OfficeInterop.Outlook { diff --git a/GreenshotOfficePlugin/OfficeInterop/Outlook/IInspectors.cs b/GreenshotOfficePlugin/OfficeInterop/Outlook/IInspectors.cs index c958c9b5f..e38d249cc 100644 --- a/GreenshotOfficePlugin/OfficeInterop/Outlook/IInspectors.cs +++ b/GreenshotOfficePlugin/OfficeInterop/Outlook/IInspectors.cs @@ -1,5 +1,5 @@ using System.Collections; -using Greenshot.Interop; +using GreenshotPlugin.Interop; namespace GreenshotOfficePlugin.OfficeInterop.Outlook { diff --git a/GreenshotOfficePlugin/OfficeInterop/Outlook/IItem.cs b/GreenshotOfficePlugin/OfficeInterop/Outlook/IItem.cs index 25c340e3f..625aa5750 100644 --- a/GreenshotOfficePlugin/OfficeInterop/Outlook/IItem.cs +++ b/GreenshotOfficePlugin/OfficeInterop/Outlook/IItem.cs @@ -1,5 +1,5 @@ using System; -using Greenshot.Interop; +using GreenshotPlugin.Interop; namespace GreenshotOfficePlugin.OfficeInterop.Outlook { diff --git a/GreenshotOfficePlugin/OfficeInterop/Outlook/INameSpace.cs b/GreenshotOfficePlugin/OfficeInterop/Outlook/INameSpace.cs index f9a75f6dd..97b2ac2b8 100644 --- a/GreenshotOfficePlugin/OfficeInterop/Outlook/INameSpace.cs +++ b/GreenshotOfficePlugin/OfficeInterop/Outlook/INameSpace.cs @@ -1,4 +1,4 @@ -using Greenshot.Interop; +using GreenshotPlugin.Interop; namespace GreenshotOfficePlugin.OfficeInterop.Outlook { diff --git a/GreenshotOfficePlugin/OfficeInterop/Outlook/IOutlookApplication.cs b/GreenshotOfficePlugin/OfficeInterop/Outlook/IOutlookApplication.cs index 6a29e5bda..ea2f1cc90 100644 --- a/GreenshotOfficePlugin/OfficeInterop/Outlook/IOutlookApplication.cs +++ b/GreenshotOfficePlugin/OfficeInterop/Outlook/IOutlookApplication.cs @@ -1,4 +1,4 @@ -using Greenshot.Interop; +using GreenshotPlugin.Interop; namespace GreenshotOfficePlugin.OfficeInterop.Outlook { diff --git a/GreenshotOfficePlugin/OfficeInterop/Outlook/IPropertyAccessor.cs b/GreenshotOfficePlugin/OfficeInterop/Outlook/IPropertyAccessor.cs index 30d3267b9..3a396752f 100644 --- a/GreenshotOfficePlugin/OfficeInterop/Outlook/IPropertyAccessor.cs +++ b/GreenshotOfficePlugin/OfficeInterop/Outlook/IPropertyAccessor.cs @@ -1,4 +1,4 @@ -using Greenshot.Interop; +using GreenshotPlugin.Interop; namespace GreenshotOfficePlugin.OfficeInterop.Outlook { diff --git a/GreenshotOfficePlugin/OfficeInterop/Outlook/IRecipient.cs b/GreenshotOfficePlugin/OfficeInterop/Outlook/IRecipient.cs index a7bdfa19a..9d4c0b641 100644 --- a/GreenshotOfficePlugin/OfficeInterop/Outlook/IRecipient.cs +++ b/GreenshotOfficePlugin/OfficeInterop/Outlook/IRecipient.cs @@ -1,4 +1,4 @@ -using Greenshot.Interop; +using GreenshotPlugin.Interop; namespace GreenshotOfficePlugin.OfficeInterop.Outlook { diff --git a/GreenshotOfficePlugin/OfficeInterop/Outlook/MailItem.cs b/GreenshotOfficePlugin/OfficeInterop/Outlook/MailItem.cs index 42c1e38f9..fb63fe740 100644 --- a/GreenshotOfficePlugin/OfficeInterop/Outlook/MailItem.cs +++ b/GreenshotOfficePlugin/OfficeInterop/Outlook/MailItem.cs @@ -1,5 +1,5 @@ using System; -using Greenshot.Interop; +using GreenshotPlugin.Interop; namespace GreenshotOfficePlugin.OfficeInterop.Outlook { diff --git a/GreenshotOfficePlugin/OfficeInterop/Powerpoint/IPageSetup.cs b/GreenshotOfficePlugin/OfficeInterop/Powerpoint/IPageSetup.cs index cc3942003..8edaf679f 100644 --- a/GreenshotOfficePlugin/OfficeInterop/Powerpoint/IPageSetup.cs +++ b/GreenshotOfficePlugin/OfficeInterop/Powerpoint/IPageSetup.cs @@ -1,4 +1,4 @@ -using Greenshot.Interop; +using GreenshotPlugin.Interop; namespace GreenshotOfficePlugin.OfficeInterop.Powerpoint { diff --git a/GreenshotOfficePlugin/OfficeInterop/Powerpoint/IPowerpointApplication.cs b/GreenshotOfficePlugin/OfficeInterop/Powerpoint/IPowerpointApplication.cs index 87604065b..b79583e3f 100644 --- a/GreenshotOfficePlugin/OfficeInterop/Powerpoint/IPowerpointApplication.cs +++ b/GreenshotOfficePlugin/OfficeInterop/Powerpoint/IPowerpointApplication.cs @@ -19,7 +19,7 @@ * along with this program. If not, see . */ -using Greenshot.Interop; +using GreenshotPlugin.Interop; namespace GreenshotOfficePlugin.OfficeInterop.Powerpoint { /// diff --git a/GreenshotOfficePlugin/OfficeInterop/Powerpoint/IPowerpointView.cs b/GreenshotOfficePlugin/OfficeInterop/Powerpoint/IPowerpointView.cs index 86d7ab3de..59e066b7f 100644 --- a/GreenshotOfficePlugin/OfficeInterop/Powerpoint/IPowerpointView.cs +++ b/GreenshotOfficePlugin/OfficeInterop/Powerpoint/IPowerpointView.cs @@ -1,5 +1,5 @@ -using Greenshot.Interop; -using GreenshotOfficePlugin.OfficeInterop.Word; +using GreenshotOfficePlugin.OfficeInterop.Word; +using GreenshotPlugin.Interop; namespace GreenshotOfficePlugin.OfficeInterop.Powerpoint { diff --git a/GreenshotOfficePlugin/OfficeInterop/Powerpoint/IPowerpointWindow.cs b/GreenshotOfficePlugin/OfficeInterop/Powerpoint/IPowerpointWindow.cs index bc80c4ad2..f26a882bd 100644 --- a/GreenshotOfficePlugin/OfficeInterop/Powerpoint/IPowerpointWindow.cs +++ b/GreenshotOfficePlugin/OfficeInterop/Powerpoint/IPowerpointWindow.cs @@ -1,4 +1,4 @@ -using Greenshot.Interop; +using GreenshotPlugin.Interop; namespace GreenshotOfficePlugin.OfficeInterop.Powerpoint { diff --git a/GreenshotOfficePlugin/OfficeInterop/Powerpoint/IPresentation.cs b/GreenshotOfficePlugin/OfficeInterop/Powerpoint/IPresentation.cs index bbe0d377a..6f63e3bcf 100644 --- a/GreenshotOfficePlugin/OfficeInterop/Powerpoint/IPresentation.cs +++ b/GreenshotOfficePlugin/OfficeInterop/Powerpoint/IPresentation.cs @@ -1,5 +1,5 @@ -using Greenshot.Interop; -using GreenshotOfficePlugin.OfficeInterop.Outlook; +using GreenshotOfficePlugin.OfficeInterop.Outlook; +using GreenshotPlugin.Interop; namespace GreenshotOfficePlugin.OfficeInterop.Powerpoint { diff --git a/GreenshotOfficePlugin/OfficeInterop/Powerpoint/IPresentations.cs b/GreenshotOfficePlugin/OfficeInterop/Powerpoint/IPresentations.cs index 237f8a079..473d7361b 100644 --- a/GreenshotOfficePlugin/OfficeInterop/Powerpoint/IPresentations.cs +++ b/GreenshotOfficePlugin/OfficeInterop/Powerpoint/IPresentations.cs @@ -1,5 +1,5 @@ -using Greenshot.Interop; -using GreenshotOfficePlugin.OfficeInterop.Outlook; +using GreenshotOfficePlugin.OfficeInterop.Outlook; +using GreenshotPlugin.Interop; namespace GreenshotOfficePlugin.OfficeInterop.Powerpoint { diff --git a/GreenshotOfficePlugin/OfficeInterop/Powerpoint/IShape.cs b/GreenshotOfficePlugin/OfficeInterop/Powerpoint/IShape.cs index e91d3e280..0dc25adbe 100644 --- a/GreenshotOfficePlugin/OfficeInterop/Powerpoint/IShape.cs +++ b/GreenshotOfficePlugin/OfficeInterop/Powerpoint/IShape.cs @@ -1,5 +1,5 @@ -using Greenshot.Interop; -using GreenshotOfficePlugin.OfficeInterop.Outlook; +using GreenshotOfficePlugin.OfficeInterop.Outlook; +using GreenshotPlugin.Interop; namespace GreenshotOfficePlugin.OfficeInterop.Powerpoint { diff --git a/GreenshotOfficePlugin/OfficeInterop/Powerpoint/IShapes.cs b/GreenshotOfficePlugin/OfficeInterop/Powerpoint/IShapes.cs index 27ee9310f..c0dcbe469 100644 --- a/GreenshotOfficePlugin/OfficeInterop/Powerpoint/IShapes.cs +++ b/GreenshotOfficePlugin/OfficeInterop/Powerpoint/IShapes.cs @@ -1,6 +1,6 @@ using System.Collections; -using Greenshot.Interop; using GreenshotOfficePlugin.OfficeInterop.Outlook; +using GreenshotPlugin.Interop; namespace GreenshotOfficePlugin.OfficeInterop.Powerpoint { diff --git a/GreenshotOfficePlugin/OfficeInterop/Powerpoint/ISlide.cs b/GreenshotOfficePlugin/OfficeInterop/Powerpoint/ISlide.cs index c68d8fd83..d50b2797b 100644 --- a/GreenshotOfficePlugin/OfficeInterop/Powerpoint/ISlide.cs +++ b/GreenshotOfficePlugin/OfficeInterop/Powerpoint/ISlide.cs @@ -1,4 +1,4 @@ -using Greenshot.Interop; +using GreenshotPlugin.Interop; namespace GreenshotOfficePlugin.OfficeInterop.Powerpoint { diff --git a/GreenshotOfficePlugin/OfficeInterop/Powerpoint/ISlides.cs b/GreenshotOfficePlugin/OfficeInterop/Powerpoint/ISlides.cs index ead384422..8bcfa35c7 100644 --- a/GreenshotOfficePlugin/OfficeInterop/Powerpoint/ISlides.cs +++ b/GreenshotOfficePlugin/OfficeInterop/Powerpoint/ISlides.cs @@ -1,4 +1,4 @@ -using Greenshot.Interop; +using GreenshotPlugin.Interop; namespace GreenshotOfficePlugin.OfficeInterop.Powerpoint { diff --git a/GreenshotOfficePlugin/OfficeInterop/Powerpoint/ITextFrame.cs b/GreenshotOfficePlugin/OfficeInterop/Powerpoint/ITextFrame.cs index 0aaffd10e..fe3f0b5bc 100644 --- a/GreenshotOfficePlugin/OfficeInterop/Powerpoint/ITextFrame.cs +++ b/GreenshotOfficePlugin/OfficeInterop/Powerpoint/ITextFrame.cs @@ -1,5 +1,5 @@ -using Greenshot.Interop; -using GreenshotOfficePlugin.OfficeInterop.Outlook; +using GreenshotOfficePlugin.OfficeInterop.Outlook; +using GreenshotPlugin.Interop; namespace GreenshotOfficePlugin.OfficeInterop.Powerpoint { diff --git a/GreenshotOfficePlugin/OfficeInterop/Powerpoint/ITextRange.cs b/GreenshotOfficePlugin/OfficeInterop/Powerpoint/ITextRange.cs index 38a960dc2..df11cf3a9 100644 --- a/GreenshotOfficePlugin/OfficeInterop/Powerpoint/ITextRange.cs +++ b/GreenshotOfficePlugin/OfficeInterop/Powerpoint/ITextRange.cs @@ -1,4 +1,4 @@ -using Greenshot.Interop; +using GreenshotPlugin.Interop; namespace GreenshotOfficePlugin.OfficeInterop.Powerpoint { diff --git a/GreenshotOfficePlugin/OfficeInterop/Word/IDocuments.cs b/GreenshotOfficePlugin/OfficeInterop/Word/IDocuments.cs index 07dcc30e0..12abf919c 100644 --- a/GreenshotOfficePlugin/OfficeInterop/Word/IDocuments.cs +++ b/GreenshotOfficePlugin/OfficeInterop/Word/IDocuments.cs @@ -1,4 +1,4 @@ -using Greenshot.Interop; +using GreenshotPlugin.Interop; namespace GreenshotOfficePlugin.OfficeInterop.Word { diff --git a/GreenshotOfficePlugin/OfficeInterop/Word/IHyperlink.cs b/GreenshotOfficePlugin/OfficeInterop/Word/IHyperlink.cs index 565c93689..9a2bc5cc2 100644 --- a/GreenshotOfficePlugin/OfficeInterop/Word/IHyperlink.cs +++ b/GreenshotOfficePlugin/OfficeInterop/Word/IHyperlink.cs @@ -1,4 +1,4 @@ -using Greenshot.Interop; +using GreenshotPlugin.Interop; namespace GreenshotOfficePlugin.OfficeInterop.Word { diff --git a/GreenshotOfficePlugin/OfficeInterop/Word/IHyperlinks.cs b/GreenshotOfficePlugin/OfficeInterop/Word/IHyperlinks.cs index 21b69e231..285154d85 100644 --- a/GreenshotOfficePlugin/OfficeInterop/Word/IHyperlinks.cs +++ b/GreenshotOfficePlugin/OfficeInterop/Word/IHyperlinks.cs @@ -1,4 +1,4 @@ -using Greenshot.Interop; +using GreenshotPlugin.Interop; namespace GreenshotOfficePlugin.OfficeInterop.Word { diff --git a/GreenshotOfficePlugin/OfficeInterop/Word/IInlineShape.cs b/GreenshotOfficePlugin/OfficeInterop/Word/IInlineShape.cs index 224c5136f..5011821e2 100644 --- a/GreenshotOfficePlugin/OfficeInterop/Word/IInlineShape.cs +++ b/GreenshotOfficePlugin/OfficeInterop/Word/IInlineShape.cs @@ -1,5 +1,5 @@ -using Greenshot.Interop; -using GreenshotOfficePlugin.OfficeInterop.Outlook; +using GreenshotOfficePlugin.OfficeInterop.Outlook; +using GreenshotPlugin.Interop; namespace GreenshotOfficePlugin.OfficeInterop.Word { diff --git a/GreenshotOfficePlugin/OfficeInterop/Word/IInlineShapes.cs b/GreenshotOfficePlugin/OfficeInterop/Word/IInlineShapes.cs index 69541925f..7d9c7c003 100644 --- a/GreenshotOfficePlugin/OfficeInterop/Word/IInlineShapes.cs +++ b/GreenshotOfficePlugin/OfficeInterop/Word/IInlineShapes.cs @@ -1,4 +1,4 @@ -using Greenshot.Interop; +using GreenshotPlugin.Interop; namespace GreenshotOfficePlugin.OfficeInterop.Word { diff --git a/GreenshotOfficePlugin/OfficeInterop/Word/IPane.cs b/GreenshotOfficePlugin/OfficeInterop/Word/IPane.cs index 42c1ee3aa..f90808cb1 100644 --- a/GreenshotOfficePlugin/OfficeInterop/Word/IPane.cs +++ b/GreenshotOfficePlugin/OfficeInterop/Word/IPane.cs @@ -1,4 +1,4 @@ -using Greenshot.Interop; +using GreenshotPlugin.Interop; namespace GreenshotOfficePlugin.OfficeInterop.Word { diff --git a/GreenshotOfficePlugin/OfficeInterop/Word/ISelection.cs b/GreenshotOfficePlugin/OfficeInterop/Word/ISelection.cs index c7ff1571c..4ddbe749d 100644 --- a/GreenshotOfficePlugin/OfficeInterop/Word/ISelection.cs +++ b/GreenshotOfficePlugin/OfficeInterop/Word/ISelection.cs @@ -1,4 +1,4 @@ -using Greenshot.Interop; +using GreenshotPlugin.Interop; namespace GreenshotOfficePlugin.OfficeInterop.Word { diff --git a/GreenshotOfficePlugin/OfficeInterop/Word/IWordApplication.cs b/GreenshotOfficePlugin/OfficeInterop/Word/IWordApplication.cs index e7f16ef94..2bc1fffdd 100644 --- a/GreenshotOfficePlugin/OfficeInterop/Word/IWordApplication.cs +++ b/GreenshotOfficePlugin/OfficeInterop/Word/IWordApplication.cs @@ -19,7 +19,7 @@ * along with this program. If not, see . */ -using Greenshot.Interop; +using GreenshotPlugin.Interop; namespace GreenshotOfficePlugin.OfficeInterop.Word { // See http://msdn.microsoft.com/de-de/library/microsoft.office.interop.word.applicationclass_members%28v=Office.11%29.aspx diff --git a/GreenshotOfficePlugin/OfficeInterop/Word/IWordDocument.cs b/GreenshotOfficePlugin/OfficeInterop/Word/IWordDocument.cs index 6515bd1b3..ad9e31a34 100644 --- a/GreenshotOfficePlugin/OfficeInterop/Word/IWordDocument.cs +++ b/GreenshotOfficePlugin/OfficeInterop/Word/IWordDocument.cs @@ -1,4 +1,4 @@ -using Greenshot.Interop; +using GreenshotPlugin.Interop; namespace GreenshotOfficePlugin.OfficeInterop.Word { diff --git a/GreenshotOfficePlugin/OfficeInterop/Word/IWordView.cs b/GreenshotOfficePlugin/OfficeInterop/Word/IWordView.cs index 8c2c72009..14d825555 100644 --- a/GreenshotOfficePlugin/OfficeInterop/Word/IWordView.cs +++ b/GreenshotOfficePlugin/OfficeInterop/Word/IWordView.cs @@ -1,4 +1,4 @@ -using Greenshot.Interop; +using GreenshotPlugin.Interop; namespace GreenshotOfficePlugin.OfficeInterop.Word { diff --git a/GreenshotOfficePlugin/OfficeInterop/Word/IWordWindow.cs b/GreenshotOfficePlugin/OfficeInterop/Word/IWordWindow.cs index 1186c8f45..4b0441510 100644 --- a/GreenshotOfficePlugin/OfficeInterop/Word/IWordWindow.cs +++ b/GreenshotOfficePlugin/OfficeInterop/Word/IWordWindow.cs @@ -1,4 +1,4 @@ -using Greenshot.Interop; +using GreenshotPlugin.Interop; namespace GreenshotOfficePlugin.OfficeInterop.Word { diff --git a/GreenshotOfficePlugin/OfficeInterop/Word/IZoom.cs b/GreenshotOfficePlugin/OfficeInterop/Word/IZoom.cs index c8751fc28..f6e2eb3db 100644 --- a/GreenshotOfficePlugin/OfficeInterop/Word/IZoom.cs +++ b/GreenshotOfficePlugin/OfficeInterop/Word/IZoom.cs @@ -1,4 +1,4 @@ -using Greenshot.Interop; +using GreenshotPlugin.Interop; namespace GreenshotOfficePlugin.OfficeInterop.Word { diff --git a/GreenshotOfficePlugin/OfficePlugin.cs b/GreenshotOfficePlugin/OfficePlugin.cs index 5befd5c30..4e01b38fa 100644 --- a/GreenshotOfficePlugin/OfficePlugin.cs +++ b/GreenshotOfficePlugin/OfficePlugin.cs @@ -20,9 +20,10 @@ */ using System; using System.Collections.Generic; -using Greenshot.Plugin; using GreenshotOfficePlugin.Destinations; using GreenshotPlugin.Core; +using GreenshotPlugin.Interfaces; +using GreenshotPlugin.Interfaces.Plugin; namespace GreenshotOfficePlugin { /// diff --git a/GreenshotPhotobucketPlugin/PhotobucketConfiguration.cs b/GreenshotPhotobucketPlugin/PhotobucketConfiguration.cs index f519f905f..7b00ad768 100644 --- a/GreenshotPhotobucketPlugin/PhotobucketConfiguration.cs +++ b/GreenshotPhotobucketPlugin/PhotobucketConfiguration.cs @@ -19,9 +19,9 @@ * along with this program. If not, see . */ using System.Windows.Forms; -using Greenshot.IniFile; using GreenshotPlugin.Controls; using GreenshotPlugin.Core; +using GreenshotPlugin.IniFile; namespace GreenshotPhotobucketPlugin { /// diff --git a/GreenshotPhotobucketPlugin/PhotobucketDestination.cs b/GreenshotPhotobucketPlugin/PhotobucketDestination.cs index 4687a7aaa..9a22488bf 100644 --- a/GreenshotPhotobucketPlugin/PhotobucketDestination.cs +++ b/GreenshotPhotobucketPlugin/PhotobucketDestination.cs @@ -21,8 +21,8 @@ using System.ComponentModel; using System.Collections.Generic; using System.Drawing; -using Greenshot.Plugin; using GreenshotPlugin.Core; +using GreenshotPlugin.Interfaces; namespace GreenshotPhotobucketPlugin { /// diff --git a/GreenshotPhotobucketPlugin/PhotobucketPlugin.cs b/GreenshotPhotobucketPlugin/PhotobucketPlugin.cs index 7c2be8feb..971ccc0e6 100644 --- a/GreenshotPhotobucketPlugin/PhotobucketPlugin.cs +++ b/GreenshotPhotobucketPlugin/PhotobucketPlugin.cs @@ -23,10 +23,11 @@ using System.ComponentModel; using System.Drawing; using System.IO; using System.Windows.Forms; -using Greenshot.IniFile; -using Greenshot.Plugin; using GreenshotPlugin.Controls; using GreenshotPlugin.Core; +using GreenshotPlugin.IniFile; +using GreenshotPlugin.Interfaces; +using GreenshotPlugin.Interfaces.Plugin; namespace GreenshotPhotobucketPlugin { /// diff --git a/GreenshotPhotobucketPlugin/PhotobucketUtils.cs b/GreenshotPhotobucketPlugin/PhotobucketUtils.cs index 02bb82366..b681edac7 100644 --- a/GreenshotPhotobucketPlugin/PhotobucketUtils.cs +++ b/GreenshotPhotobucketPlugin/PhotobucketUtils.cs @@ -23,9 +23,10 @@ using System.Collections; using System.Collections.Generic; using System.Drawing; using System.Xml; -using Greenshot.IniFile; -using Greenshot.Plugin; using GreenshotPlugin.Core; +using GreenshotPlugin.IniFile; +using GreenshotPlugin.Interfaces; +using GreenshotPlugin.Interfaces.Plugin; namespace GreenshotPhotobucketPlugin { /// diff --git a/GreenshotPicasaPlugin/PicasaConfiguration.cs b/GreenshotPicasaPlugin/PicasaConfiguration.cs index 17e44efee..eb8eb7100 100644 --- a/GreenshotPicasaPlugin/PicasaConfiguration.cs +++ b/GreenshotPicasaPlugin/PicasaConfiguration.cs @@ -18,9 +18,9 @@ * along with this program. If not, see . */ using System.Windows.Forms; -using Greenshot.IniFile; using GreenshotPlugin.Core; using System; +using GreenshotPlugin.IniFile; namespace GreenshotPicasaPlugin { /// diff --git a/GreenshotPicasaPlugin/PicasaDestination.cs b/GreenshotPicasaPlugin/PicasaDestination.cs index 2857ad772..4107ecd48 100644 --- a/GreenshotPicasaPlugin/PicasaDestination.cs +++ b/GreenshotPicasaPlugin/PicasaDestination.cs @@ -19,8 +19,8 @@ */ using System.ComponentModel; using System.Drawing; -using Greenshot.Plugin; using GreenshotPlugin.Core; +using GreenshotPlugin.Interfaces; namespace GreenshotPicasaPlugin { public class PicasaDestination : AbstractDestination { diff --git a/GreenshotPicasaPlugin/PicasaPlugin.cs b/GreenshotPicasaPlugin/PicasaPlugin.cs index ea20eb070..a8f312484 100644 --- a/GreenshotPicasaPlugin/PicasaPlugin.cs +++ b/GreenshotPicasaPlugin/PicasaPlugin.cs @@ -22,10 +22,11 @@ using System.ComponentModel; using System.Drawing; using System.IO; using System.Windows.Forms; -using Greenshot.IniFile; -using Greenshot.Plugin; using GreenshotPlugin.Controls; using GreenshotPlugin.Core; +using GreenshotPlugin.IniFile; +using GreenshotPlugin.Interfaces; +using GreenshotPlugin.Interfaces.Plugin; namespace GreenshotPicasaPlugin { /// diff --git a/GreenshotPicasaPlugin/PicasaUtils.cs b/GreenshotPicasaPlugin/PicasaUtils.cs index 39519915c..eb2b2be2e 100644 --- a/GreenshotPicasaPlugin/PicasaUtils.cs +++ b/GreenshotPicasaPlugin/PicasaUtils.cs @@ -18,11 +18,12 @@ * along with this program. If not, see . */ -using Greenshot.IniFile; -using Greenshot.Plugin; using GreenshotPlugin.Core; using System; using System.Xml; +using GreenshotPlugin.IniFile; +using GreenshotPlugin.Interfaces; +using GreenshotPlugin.Interfaces.Plugin; namespace GreenshotPicasaPlugin { /// diff --git a/GreenshotPlugin/Controls/AnimatingForm.cs b/GreenshotPlugin/Controls/AnimatingForm.cs index b23389cf3..91f4762f0 100644 --- a/GreenshotPlugin/Controls/AnimatingForm.cs +++ b/GreenshotPlugin/Controls/AnimatingForm.cs @@ -22,6 +22,7 @@ using System; using System.Windows.Forms; using GreenshotPlugin.UnmanagedHelpers; +using GreenshotPlugin.UnmanagedHelpers.Enums; using log4net; namespace GreenshotPlugin.Controls { diff --git a/GreenshotPlugin/Controls/ExtendedWebBrowser.cs b/GreenshotPlugin/Controls/ExtendedWebBrowser.cs index d2f1ed61a..78a793866 100644 --- a/GreenshotPlugin/Controls/ExtendedWebBrowser.cs +++ b/GreenshotPlugin/Controls/ExtendedWebBrowser.cs @@ -20,7 +20,7 @@ */ using System; using System.Windows.Forms; -using GreenshotInterop.Interop; +using GreenshotPlugin.Interop; namespace GreenshotPlugin.Controls { public class ExtendedWebBrowser : WebBrowser { diff --git a/GreenshotPlugin/Controls/GreenshotForm.cs b/GreenshotPlugin/Controls/GreenshotForm.cs index 50480f85c..32a9fb64f 100644 --- a/GreenshotPlugin/Controls/GreenshotForm.cs +++ b/GreenshotPlugin/Controls/GreenshotForm.cs @@ -23,10 +23,10 @@ using System.Collections.Generic; using System.Windows.Forms; using System.Reflection; using GreenshotPlugin.Core; -using Greenshot.IniFile; using System.ComponentModel; using System.ComponentModel.Design; using System.IO; +using GreenshotPlugin.IniFile; using log4net; namespace GreenshotPlugin.Controls { diff --git a/GreenshotPlugin/Controls/HotkeyControl.cs b/GreenshotPlugin/Controls/HotkeyControl.cs index 62969d212..89f0889b2 100644 --- a/GreenshotPlugin/Controls/HotkeyControl.cs +++ b/GreenshotPlugin/Controls/HotkeyControl.cs @@ -25,10 +25,9 @@ using System.Diagnostics.CodeAnalysis; using System.Runtime.InteropServices; using System.Text; using System.Windows.Forms; - -using Greenshot.Plugin; using log4net; using GreenshotPlugin.Core; +using GreenshotPlugin.Interfaces.Plugin; namespace GreenshotPlugin.Controls { /// @@ -292,13 +291,13 @@ namespace GreenshotPlugin.Controls { private void Redraw(bool bCalledProgramatically = false) { // No hotkey set if (_hotkey == Keys.None) { - Text = ""; + Text = string.Empty; return; } // LWin/RWin doesn't work as hotkeys (neither do they work as modifier keys in .NET 2.0) if (_hotkey == Keys.LWin || _hotkey == Keys.RWin) { - Text = ""; + Text = string.Empty; return; } @@ -318,7 +317,7 @@ namespace GreenshotPlugin.Controls { // User pressed Shift and an invalid key (e.g. a letter or a number), // that needs another set of modifier keys _hotkey = Keys.None; - Text = ""; + Text = string.Empty; return; } } @@ -326,7 +325,7 @@ namespace GreenshotPlugin.Controls { if ((_modifiers == (Keys.Alt | Keys.Control)) && _needNonAltGrModifier.Contains((int)_hotkey)) { // Ctrl+Alt+4 etc won't work; reset hotkey and tell the user _hotkey = Keys.None; - Text = ""; + Text = string.Empty; return; } } @@ -534,7 +533,7 @@ namespace GreenshotPlugin.Controls { break; case Keys.Multiply: GetKeyNameText(numpad << 16, keyName, 100); - keyString = keyName.ToString().Replace("*","").Trim().ToLower(); + keyString = keyName.ToString().Replace("*", string.Empty).Trim().ToLower(); if (keyString.IndexOf("(", StringComparison.Ordinal) >= 0) { return "* " + keyString; } @@ -542,7 +541,7 @@ namespace GreenshotPlugin.Controls { return keyString + " *"; case Keys.Divide: GetKeyNameText(numpad << 16, keyName, 100); - keyString = keyName.ToString().Replace("*","").Trim().ToLower(); + keyString = keyName.ToString().Replace("*", string.Empty).Trim().ToLower(); if (keyString.IndexOf("(", StringComparison.Ordinal) >= 0) { return "/ " + keyString; } diff --git a/GreenshotPlugin/Controls/QualityDialog.cs b/GreenshotPlugin/Controls/QualityDialog.cs index d60e8fc00..ada7ad476 100644 --- a/GreenshotPlugin/Controls/QualityDialog.cs +++ b/GreenshotPlugin/Controls/QualityDialog.cs @@ -20,8 +20,8 @@ */ using System; using GreenshotPlugin.Core; -using Greenshot.IniFile; -using Greenshot.Plugin; +using GreenshotPlugin.IniFile; +using GreenshotPlugin.Interfaces.Plugin; namespace GreenshotPlugin.Controls { /// diff --git a/GreenshotPlugin/Controls/SaveImageFileDialog.cs b/GreenshotPlugin/Controls/SaveImageFileDialog.cs index 40476b550..45f98118f 100644 --- a/GreenshotPlugin/Controls/SaveImageFileDialog.cs +++ b/GreenshotPlugin/Controls/SaveImageFileDialog.cs @@ -21,10 +21,9 @@ using System; using System.IO; using System.Windows.Forms; - -using Greenshot.Plugin; using GreenshotPlugin.Core; -using Greenshot.IniFile; +using GreenshotPlugin.IniFile; +using GreenshotPlugin.Interfaces; using log4net; namespace GreenshotPlugin.Controls { @@ -89,7 +88,7 @@ namespace GreenshotPlugin.Controls { private void ApplyFilterOptions() { PrepareFilterOptions(); - string fdf = ""; + string fdf = string.Empty; int preselect = 0; var outputFileFormatAsString = Enum.GetName(typeof(OutputFormat), conf.OutputFileFormat); for(int i=0; i<_filterOptions.Length; i++){ diff --git a/GreenshotPlugin/Controls/ThumbnailForm.cs b/GreenshotPlugin/Controls/ThumbnailForm.cs index 56a3207eb..3e8256cf3 100644 --- a/GreenshotPlugin/Controls/ThumbnailForm.cs +++ b/GreenshotPlugin/Controls/ThumbnailForm.cs @@ -21,9 +21,11 @@ using System; using System.Windows.Forms; using GreenshotPlugin.Core; -using Greenshot.IniFile; using System.Drawing; +using GreenshotPlugin.IniFile; using GreenshotPlugin.UnmanagedHelpers; +using GreenshotPlugin.UnmanagedHelpers.Enums; +using GreenshotPlugin.UnmanagedHelpers.Structs; namespace GreenshotPlugin.Controls { /// diff --git a/GreenshotPlugin/Core/AbstractDestination.cs b/GreenshotPlugin/Core/AbstractDestination.cs index 33aff20c1..207a006ef 100644 --- a/GreenshotPlugin/Core/AbstractDestination.cs +++ b/GreenshotPlugin/Core/AbstractDestination.cs @@ -23,8 +23,8 @@ using System.Collections.Generic; using System.Drawing; using System.Threading; using System.Windows.Forms; -using Greenshot.IniFile; -using Greenshot.Plugin; +using GreenshotPlugin.IniFile; +using GreenshotPlugin.Interfaces; using GreenshotPlugin.UnmanagedHelpers; using log4net; diff --git a/GreenshotPlugin/Core/AbstractProcessor.cs b/GreenshotPlugin/Core/AbstractProcessor.cs index 02090ba90..5dd6c38ab 100644 --- a/GreenshotPlugin/Core/AbstractProcessor.cs +++ b/GreenshotPlugin/Core/AbstractProcessor.cs @@ -19,8 +19,7 @@ * along with this program. If not, see . */ using System; - -using Greenshot.Plugin; +using GreenshotPlugin.Interfaces; namespace GreenshotPlugin.Core { /// diff --git a/GreenshotPlugin/Core/ClipboardHelper.cs b/GreenshotPlugin/Core/ClipboardHelper.cs index 47dd0d532..272624c26 100644 --- a/GreenshotPlugin/Core/ClipboardHelper.cs +++ b/GreenshotPlugin/Core/ClipboardHelper.cs @@ -29,10 +29,11 @@ using System.Linq; using System.Text; using System.Threading; using System.Windows.Forms; -using Greenshot.IniFile; -using Greenshot.Plugin; using GreenshotPlugin.UnmanagedHelpers; using System.Runtime.InteropServices; +using GreenshotPlugin.IniFile; +using GreenshotPlugin.Interfaces; +using GreenshotPlugin.Interfaces.Plugin; using log4net; namespace GreenshotPlugin.Core { diff --git a/GreenshotPlugin/Core/CoreConfiguration.cs b/GreenshotPlugin/Core/CoreConfiguration.cs index de6657676..1db95dd93 100644 --- a/GreenshotPlugin/Core/CoreConfiguration.cs +++ b/GreenshotPlugin/Core/CoreConfiguration.cs @@ -19,8 +19,6 @@ * along with this program. If not, see . */ -using Greenshot.IniFile; -using Greenshot.Plugin; using System; using System.Collections.Generic; using System.ComponentModel; @@ -28,6 +26,8 @@ using System.Drawing; using System.IO; using System.Reflection; using System.Windows.Forms; +using GreenshotPlugin.IniFile; +using GreenshotPlugin.Interfaces; namespace GreenshotPlugin.Core { public enum ClipboardFormat { @@ -369,7 +369,7 @@ namespace GreenshotPlugin.Core { case "TitleFixMatcher": return new Dictionary {{"Firefox", " - Mozilla Firefox.*"}, {"IE", " - (Microsoft|Windows) Internet Explorer.*"}, {"Chrome", " - Google Chrome.*"}}; case "TitleFixReplacer": - return new Dictionary {{"Firefox", ""}, {"IE", ""}, {"Chrome", ""}}; + return new Dictionary {{"Firefox", string.Empty }, {"IE", string.Empty }, {"Chrome", string.Empty } }; } return null; } diff --git a/GreenshotPlugin/Core/DpiHelper.cs b/GreenshotPlugin/Core/DpiHelper.cs index 1ca9024ab..2c67eb1b5 100644 --- a/GreenshotPlugin/Core/DpiHelper.cs +++ b/GreenshotPlugin/Core/DpiHelper.cs @@ -5,6 +5,8 @@ using System; using System.Diagnostics; using System.Drawing; using System.Runtime.InteropServices; +using GreenshotPlugin.UnmanagedHelpers.Enums; +using GreenshotPlugin.UnmanagedHelpers.Structs; namespace GreenshotPlugin.Core { diff --git a/GreenshotPlugin/Core/EffectConverter.cs b/GreenshotPlugin/Core/EffectConverter.cs index 69c78a092..f72e271dc 100644 --- a/GreenshotPlugin/Core/EffectConverter.cs +++ b/GreenshotPlugin/Core/EffectConverter.cs @@ -5,7 +5,7 @@ using System.Globalization; using System.Text; using GreenshotPlugin.Effects; -namespace Greenshot.Core +namespace GreenshotPlugin.Core { public class EffectConverter : TypeConverter { // Fix to prevent BUG-1753 diff --git a/GreenshotPlugin/Core/EmailConfigHelper.cs b/GreenshotPlugin/Core/EmailConfigHelper.cs index 59db98886..7da960b09 100644 --- a/GreenshotPlugin/Core/EmailConfigHelper.cs +++ b/GreenshotPlugin/Core/EmailConfigHelper.cs @@ -34,12 +34,12 @@ namespace GreenshotPlugin.Core { public static string GetMapiClient() { using (RegistryKey key = Registry.CurrentUser.OpenSubKey(MapiClientKey, false)) { if (key != null) { - return (string)key.GetValue(""); + return (string)key.GetValue(string.Empty); } } using (RegistryKey key = Registry.LocalMachine.OpenSubKey(MapiClientKey, false)) { - return (string) key?.GetValue(""); + return (string) key?.GetValue(string.Empty); } } @@ -53,7 +53,7 @@ namespace GreenshotPlugin.Core { using (RegistryKey key = Registry.LocalMachine.OpenSubKey(OutlookPathKey, false)) { if (key != null) { // "" is the default key, which should point to the outlook location - return (string)key.GetValue(""); + return (string)key.GetValue(string.Empty); } } return null; diff --git a/GreenshotPlugin/Core/FilenameHelper.cs b/GreenshotPlugin/Core/FilenameHelper.cs index 85d297ade..47987163f 100644 --- a/GreenshotPlugin/Core/FilenameHelper.cs +++ b/GreenshotPlugin/Core/FilenameHelper.cs @@ -23,10 +23,10 @@ using System.Collections; using System.IO; using System.Text.RegularExpressions; using System.Windows.Forms; -using Greenshot.IniFile; -using Greenshot.Plugin; using log4net; using System.Collections.Generic; +using GreenshotPlugin.IniFile; +using GreenshotPlugin.Interfaces; namespace GreenshotPlugin.Core { public static class FilenameHelper { @@ -157,7 +157,7 @@ namespace GreenshotPlugin.Core { char padChar = ' '; string dateFormat = "yyyy-MM-dd HH-mm-ss"; IDictionary replacements = new Dictionary(); - string replaceValue = ""; + string replaceValue = string.Empty; string variable = match.Groups["variable"].Value; string parameters = match.Groups["parameters"].Value; diff --git a/GreenshotPlugin/Core/ImageHelper.cs b/GreenshotPlugin/Core/ImageHelper.cs index 3359048a9..1edb24c06 100644 --- a/GreenshotPlugin/Core/ImageHelper.cs +++ b/GreenshotPlugin/Core/ImageHelper.cs @@ -25,10 +25,10 @@ using System.Drawing; using System.Drawing.Drawing2D; using System.Drawing.Imaging; using System.IO; -using Greenshot.IniFile; using GreenshotPlugin.UnmanagedHelpers; -using Greenshot.Plugin; using GreenshotPlugin.Effects; +using GreenshotPlugin.IniFile; +using GreenshotPlugin.Interfaces; using log4net; namespace GreenshotPlugin.Core { @@ -69,7 +69,7 @@ namespace GreenshotPlugin.Core { } // Fallback - StreamConverters[""] = DefaultConverter; + StreamConverters[string.Empty] = DefaultConverter; StreamConverters["gif"] = DefaultConverter; StreamConverters["bmp"] = DefaultConverter; StreamConverters["jpg"] = DefaultConverter; @@ -1678,7 +1678,7 @@ namespace GreenshotPlugin.Core { } if (!string.IsNullOrEmpty(extension)) { - extension = extension.Replace(".", ""); + extension = extension.Replace(".", string.Empty); } // Make sure we can try multiple times @@ -1690,7 +1690,7 @@ namespace GreenshotPlugin.Core { } Image returnImage = null; - if (StreamConverters.TryGetValue(extension ?? "", out var converter)) + if (StreamConverters.TryGetValue(extension ?? string.Empty, out var converter)) { returnImage = converter(stream, extension); } diff --git a/GreenshotPlugin/Core/ImageOutput.cs b/GreenshotPlugin/Core/ImageOutput.cs index 065f44cdb..97c8f8cf3 100644 --- a/GreenshotPlugin/Core/ImageOutput.cs +++ b/GreenshotPlugin/Core/ImageOutput.cs @@ -19,8 +19,6 @@ * along with this program. If not, see . */ -using Greenshot.IniFile; -using Greenshot.Plugin; using GreenshotPlugin.Controls; using log4net; using System; @@ -35,6 +33,9 @@ using System.Runtime.InteropServices; using System.Text; using System.Text.RegularExpressions; using System.Windows.Forms; +using GreenshotPlugin.IniFile; +using GreenshotPlugin.Interfaces; +using GreenshotPlugin.Interfaces.Plugin; using Encoder = System.Drawing.Imaging.Encoder; namespace GreenshotPlugin.Core { @@ -528,7 +529,7 @@ namespace GreenshotPlugin.Core { public static string SaveToTmpFile(ISurface surface, SurfaceOutputSettings outputSettings, string destinationPath) { string tmpFile = Path.GetRandomFileName() + "." + outputSettings.Format; // Prevent problems with "other characters", which could cause problems - tmpFile = Regex.Replace(tmpFile, @"[^\d\w\.]", ""); + tmpFile = Regex.Replace(tmpFile, @"[^\d\w\.]", string.Empty); if (destinationPath == null) { destinationPath = Path.GetTempPath(); } diff --git a/GreenshotPlugin/Core/InterfaceUtils.cs b/GreenshotPlugin/Core/InterfaceUtils.cs index 0adccda0b..b592474f0 100644 --- a/GreenshotPlugin/Core/InterfaceUtils.cs +++ b/GreenshotPlugin/Core/InterfaceUtils.cs @@ -22,7 +22,7 @@ using System; using System.Collections.Generic; using System.Reflection; using System.Threading; -using Greenshot.Plugin; +using GreenshotPlugin.Interfaces; using log4net; namespace GreenshotPlugin.Core { diff --git a/GreenshotPlugin/Core/JSONHelper.cs b/GreenshotPlugin/Core/JSONHelper.cs index 04015248e..d02845b72 100644 --- a/GreenshotPlugin/Core/JSONHelper.cs +++ b/GreenshotPlugin/Core/JSONHelper.cs @@ -217,7 +217,7 @@ namespace GreenshotPlugin.Core { if (remainingLength >= 4) { // 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))) { - return ""; + return string.Empty; } // convert the integer codepoint to a unicode char and add to string s.Append(char.ConvertFromUtf32((int)codePoint)); diff --git a/GreenshotPlugin/Core/Language.cs b/GreenshotPlugin/Core/Language.cs index 0ceb3659d..b7b8fd8c3 100644 --- a/GreenshotPlugin/Core/Language.cs +++ b/GreenshotPlugin/Core/Language.cs @@ -24,21 +24,20 @@ using System.IO; using System.Reflection; using System.Text.RegularExpressions; using System.Xml; -using Greenshot.IniFile; +using GreenshotPlugin.IniFile; using log4net; using Microsoft.Win32; namespace GreenshotPlugin.Core { - public delegate void LanguageChangedHandler(object sender, EventArgs e); - /// + /// /// This class supplies the GUI with translations, based upon keys. /// The language resources are loaded from the language files found on fixed or supplied paths /// public class Language { private static readonly ILog Log = LogManager.GetLogger(typeof(Language)); - private static readonly IList LanguagePaths = new List(); - private static readonly IDictionary> LanguageFiles = new Dictionary>(); - private static readonly IDictionary HelpFiles = new Dictionary(); + private static readonly List LanguagePaths = new List(); + private static readonly Dictionary> LanguageFiles = new Dictionary>(); + private static readonly Dictionary HelpFiles = new Dictionary(); private const string DefaultLanguage = "en-US"; private const string HelpFilenamePattern = @"help-*.html"; private const string LanguageFilenamePattern = @"language*.xml"; @@ -46,8 +45,8 @@ namespace GreenshotPlugin.Core { private static readonly Regex IetfCleanRegexp = new Regex(@"[^a-zA-Z]+"); private static readonly Regex IetfRegexp = new Regex(@"^.*([a-zA-Z]{2,3}-[a-zA-Z]{1,2})\.xml$"); private const string LanguageGroupsKey = @"SYSTEM\CurrentControlSet\Control\Nls\Language Groups"; - private static readonly IList UnsupportedLanguageGroups = new List(); - private static readonly IDictionary Resources = new Dictionary(); + private static readonly List UnsupportedLanguageGroups = new List(); + private static readonly Dictionary Resources = new Dictionary(); private static string _currentLanguage; public static event LanguageChangedHandler LanguageChanged; @@ -88,19 +87,19 @@ namespace GreenshotPlugin.Core { } try - { - using RegistryKey languageGroupsKey = Registry.LocalMachine.OpenSubKey(LanguageGroupsKey, false); - if (languageGroupsKey != null) { - string [] groups = languageGroupsKey.GetValueNames(); - foreach(string group in groups) { - string groupValue = (string)languageGroupsKey.GetValue(@group); - bool isGroupNotInstalled = "0".Equals(groupValue); - if (isGroupNotInstalled) { - UnsupportedLanguageGroups.Add(@group.ToLower()); - } - } - } - } catch(Exception e) { + { + using RegistryKey languageGroupsKey = Registry.LocalMachine.OpenSubKey(LanguageGroupsKey, false); + if (languageGroupsKey != null) { + string [] groups = languageGroupsKey.GetValueNames(); + foreach(string group in groups) { + string groupValue = (string)languageGroupsKey.GetValue(group); + bool isGroupNotInstalled = "0".Equals(groupValue); + if (isGroupNotInstalled) { + UnsupportedLanguageGroups.Add(group.ToLower()); + } + } + } + } catch(Exception e) { Log.Warn("Couldn't read the installed language groups.", e); } @@ -132,14 +131,15 @@ namespace GreenshotPlugin.Core { /// /// true if the path exists and is added private static bool AddPath(string path) { - if (!LanguagePaths.Contains(path)) { + if (!LanguagePaths.Contains(path)) + { if (Directory.Exists(path)) { Log.DebugFormat("Adding language path {0}", path); LanguagePaths.Add(path); return true; - } else { - Log.InfoFormat("Not adding non existing language path {0}", path); } + + Log.InfoFormat("Not adding non existing language path {0}", path); } return false; } @@ -167,7 +167,7 @@ namespace GreenshotPlugin.Core { /// /// private static void LoadFiles(string ietf) { - ietf = ReformatIETF(ietf); + ietf = ReformatIetf(ietf); if (!LanguageFiles.ContainsKey(ietf)) { Log.ErrorFormat("No language {0} available.", ietf); return; @@ -193,11 +193,9 @@ namespace GreenshotPlugin.Core { /// Get or set the current language /// public static string CurrentLanguage { - get { - return _currentLanguage; - } + get => _currentLanguage; set { - string ietf = FindBestIETFMatch(value); + string ietf = FindBestIetfMatch(value); if (!LanguageFiles.ContainsKey(ietf)) { Log.WarnFormat("No match for language {0} found!", ietf); } else { @@ -225,46 +223,46 @@ namespace GreenshotPlugin.Core { /// /// Try to find the best match for the supplied IETF /// - /// + /// /// IETF - private static string FindBestIETFMatch(string inputIETF) { - string returnIETF = inputIETF; - if (string.IsNullOrEmpty(returnIETF)) { - returnIETF = DefaultLanguage; + private static string FindBestIetfMatch(string inputIetf) { + string returnIetf = inputIetf; + if (string.IsNullOrEmpty(returnIetf)) { + returnIetf = DefaultLanguage; } - returnIETF = ReformatIETF(returnIETF); - if (!LanguageFiles.ContainsKey(returnIETF)) { - Log.WarnFormat("Unknown language {0}, trying best match!", returnIETF); - if (returnIETF.Length == 5) { - returnIETF = returnIETF.Substring(0, 2); + returnIetf = ReformatIetf(returnIetf); + if (!LanguageFiles.ContainsKey(returnIetf)) { + Log.WarnFormat("Unknown language {0}, trying best match!", returnIetf); + if (returnIetf.Length == 5) { + returnIetf = returnIetf.Substring(0, 2); } - foreach (string availableIETF in LanguageFiles.Keys) { - if (availableIETF.StartsWith(returnIETF)) { - Log.InfoFormat("Found language {0}, best match for {1}!", availableIETF, returnIETF); - returnIETF = availableIETF; + foreach (string availableIetf in LanguageFiles.Keys) { + if (availableIetf.StartsWith(returnIetf)) { + Log.InfoFormat("Found language {0}, best match for {1}!", availableIetf, returnIetf); + returnIetf = availableIetf; break; } } } - return returnIETF; + return returnIetf; } /// /// This helper method clears all non alpha characters from the IETF, and does a reformatting. /// This prevents problems with multiple formats or typos. /// - /// + /// /// - private static string ReformatIETF(string inputIETF) { - string returnIETF = null; - if (!string.IsNullOrEmpty(inputIETF)) { - returnIETF = inputIETF.ToLower(); - returnIETF = IetfCleanRegexp.Replace(returnIETF, ""); - if (returnIETF.Length == 4) { - returnIETF = returnIETF.Substring(0, 2) + "-" + returnIETF.Substring(2, 2).ToUpper(); + private static string ReformatIetf(string inputIetf) { + string returnIetf = null; + if (!string.IsNullOrEmpty(inputIetf)) { + returnIetf = inputIetf.ToLower(); + returnIetf = IetfCleanRegexp.Replace(returnIetf, string.Empty); + if (returnIetf.Length == 4) { + returnIetf = returnIetf.Substring(0, 2) + "-" + returnIetf.Substring(2, 2).ToUpper(); } } - return returnIETF; + return returnIetf; } /// @@ -278,11 +276,9 @@ namespace GreenshotPlugin.Core { // Loop over all the files for a language foreach (LanguageFile langFile in langs) { // Only take the ones without prefix, these are the "base" language files - if (langFile.Prefix == null) { - languages.Add(langFile); - break; - } - } + if (langFile.Prefix != null) continue; + languages.Add(langFile); + } } return languages; } @@ -350,7 +346,7 @@ namespace GreenshotPlugin.Core { { languageFile.Description = node.Attributes["description"].Value; if (node.Attributes["ietf"] != null) { - languageFile.Ietf = ReformatIETF(node.Attributes["ietf"].Value); + languageFile.Ietf = ReformatIetf(node.Attributes["ietf"].Value); } if (node.Attributes["version"] != null) { languageFile.Version = new Version(node.Attributes["version"].Value); @@ -395,8 +391,8 @@ namespace GreenshotPlugin.Core { Log.WarnFormat("Fixing missing ietf in language-file {0}", languageFilepath); string languageFilename = Path.GetFileName(languageFilepath); if (IetfRegexp.IsMatch(languageFilename)) { - string replacementIETF = IetfRegexp.Replace(languageFilename, "$1"); - languageFile.Ietf = ReformatIETF(replacementIETF); + string replacementIetf = IetfRegexp.Replace(languageFilename, "$1"); + languageFile.Ietf = ReformatIetf(replacementIetf); Log.InfoFormat("Fixed IETF to {0}", languageFile.Ietf); } else { Log.ErrorFormat("Missing ietf , no recover possible... skipping language-file {0}!", languageFilepath); @@ -416,11 +412,11 @@ namespace GreenshotPlugin.Core { if (PrefixRegexp.IsMatch(languageFilename)) { languageFile.Prefix = PrefixRegexp.Replace(languageFilename, "$1"); if (!string.IsNullOrEmpty(languageFile.Prefix)) { - languageFile.Prefix = languageFile.Prefix.Replace("plugin", "").ToLower(); + languageFile.Prefix = languageFile.Prefix.Replace("plugin", string.Empty).ToLower(); } } } - List currentFiles = null; + List currentFiles; if (LanguageFiles.ContainsKey(languageFile.Ietf)) { currentFiles = LanguageFiles[languageFile.Ietf]; bool needToAdd = true; @@ -431,10 +427,10 @@ namespace GreenshotPlugin.Core { Log.WarnFormat("Skipping {0}:{1}:{2} as {3}:{4}:{5} is newer", languageFile.Filepath, languageFile.Prefix, languageFile.Version, compareWithLangfile.Filepath, compareWithLangfile.Prefix, compareWithLangfile.Version); needToAdd = false; break; - } else { - Log.WarnFormat("Found {0}:{1}:{2} and deleting {3}:{4}:{5}", languageFile.Filepath, languageFile.Prefix, languageFile.Version, compareWithLangfile.Filepath, compareWithLangfile.Prefix, compareWithLangfile.Version); - deleteList.Add(compareWithLangfile); } + + Log.WarnFormat("Found {0}:{1}:{2} and deleting {3}:{4}:{5}", languageFile.Filepath, languageFile.Prefix, languageFile.Version, compareWithLangfile.Filepath, compareWithLangfile.Prefix, compareWithLangfile.Version); + deleteList.Add(compareWithLangfile); } } if (needToAdd) { @@ -462,7 +458,7 @@ namespace GreenshotPlugin.Core { foreach (string helpFilepath in Directory.GetFiles(languagePath, HelpFilenamePattern, SearchOption.AllDirectories)) { Log.DebugFormat("Found help file: {0}", helpFilepath); string helpFilename = Path.GetFileName(helpFilepath); - string ietf = ReformatIETF(helpFilename.Replace(".html", "").Replace("help-", "")); + string ietf = ReformatIetf(helpFilename.Replace(".html", string.Empty).Replace("help-", "")); if (!HelpFiles.ContainsKey(ietf)) { HelpFiles.Add(ietf, helpFilepath); } else { @@ -557,7 +553,11 @@ namespace GreenshotPlugin.Core { return Resources.TryGetValue(prefix + "." + key, out languageString); } - + /// + /// Translate + /// + /// object + /// string public static string Translate(object key) { string typename = key.GetType().Name; string enumKey = typename + "." + key; @@ -570,7 +570,7 @@ namespace GreenshotPlugin.Core { /// /// Get the resource for key /// - /// + /// Enum /// resource or a "string ###key### not found" public static string GetString(Enum key) { if (key == null) { @@ -582,8 +582,8 @@ namespace GreenshotPlugin.Core { /// /// Get the resource for prefix.key /// - /// - /// + /// string + /// Enum /// resource or a "string ###prefix.key### not found" public static string GetString(string prefix, Enum key) { if (key == null) { @@ -595,8 +595,8 @@ namespace GreenshotPlugin.Core { /// /// Get the resource for prefix.key /// - /// - /// + /// string + /// string /// resource or a "string ###prefix.key### not found" public static string GetString(string prefix, string key) { return GetString(prefix + "." + key); @@ -605,14 +605,14 @@ namespace GreenshotPlugin.Core { /// /// Get the resource for key /// - /// + /// string /// resource or a "string ###key### not found" public static string GetString(string key) { if (key == null) { return null; } - if (!Resources.TryGetValue(key, out var returnValue)) { + if (!Resources.TryGetValue(key, out var returnValue)) { return "string ###" + key + "### not found"; } return returnValue; @@ -621,8 +621,8 @@ namespace GreenshotPlugin.Core { /// /// Get the resource for key, format with with string.format an supply the parameters /// - /// - /// + /// Enum + /// object /// formatted resource or a "string ###key### not found" public static string GetFormattedString(Enum key, object param) { return GetFormattedString(key.ToString(), param); @@ -631,9 +631,9 @@ namespace GreenshotPlugin.Core { /// /// Get the resource for prefix.key, format with with string.format an supply the parameters /// - /// - /// - /// + /// string + /// Enum + /// object /// formatted resource or a "string ###prefix.key### not found" public static string GetFormattedString(string prefix, Enum key, object param) { return GetFormattedString(prefix, key.ToString(), param); @@ -642,9 +642,9 @@ namespace GreenshotPlugin.Core { /// /// Get the resource for prefix.key, format with with string.format an supply the parameters /// - /// - /// - /// + /// string + /// string + /// object /// formatted resource or a "string ###prefix.key### not found" public static string GetFormattedString(string prefix, string key, object param) { return GetFormattedString(prefix + "." + key, param); @@ -653,87 +653,14 @@ namespace GreenshotPlugin.Core { /// /// Get the resource for key, format with with string.format an supply the parameters /// - /// - /// + /// string + /// object /// formatted resource or a "string ###key### not found" public static string GetFormattedString(string key, object param) { - if (!Resources.TryGetValue(key, out var returnValue)) { + if (!Resources.TryGetValue(key, out var returnValue)) { return "string ###" + key + "### not found"; } return string.Format(returnValue, param); } } - - /// - /// This class contains the information about a language file - /// - public class LanguageFile : IEquatable { - public string Description { - get; - set; - } - - public string Ietf { - get; - set; - } - - public Version Version { - get; - set; - } - - public string LanguageGroup { - get; - set; - } - - public string Filepath { - get; - set; - } - - public string Prefix { - get; - set; - } - - /// - /// Overload equals so we can delete a entry from a collection - /// - /// - /// - public bool Equals(LanguageFile other) { - if (Prefix != null) { - if (other != null && !Prefix.Equals(other.Prefix)) { - return false; - } - } else if (other?.Prefix != null) { - return false; - } - if (Ietf != null) { - if (other != null && !Ietf.Equals(other.Ietf)) { - return false; - } - } else if (other?.Ietf != null) { - return false; - } - if (Version != null) { - if (other != null && !Version.Equals(other.Version)) { - return false; - } - } else if (other != null && other.Version != null) { - return false; - } - if (Filepath != null) { - if (other != null && !Filepath.Equals(other.Filepath)) { - return false; - } - } else if (other?.Filepath != null) { - return false; - } - return true; - } - } - } diff --git a/GreenshotPlugin/Core/LanguageChangedHandler.cs b/GreenshotPlugin/Core/LanguageChangedHandler.cs new file mode 100644 index 000000000..ab68cb6d4 --- /dev/null +++ b/GreenshotPlugin/Core/LanguageChangedHandler.cs @@ -0,0 +1,6 @@ +using System; + +namespace GreenshotPlugin.Core +{ + public delegate void LanguageChangedHandler(object sender, EventArgs e); +} \ No newline at end of file diff --git a/GreenshotPlugin/Core/LanguageFile.cs b/GreenshotPlugin/Core/LanguageFile.cs new file mode 100644 index 000000000..8c2c69ff1 --- /dev/null +++ b/GreenshotPlugin/Core/LanguageFile.cs @@ -0,0 +1,76 @@ +using System; + +namespace GreenshotPlugin.Core +{ + /// + /// This class contains the information about a language file + /// + public class LanguageFile : IEquatable { + public string Description { + get; + set; + } + + public string Ietf { + get; + set; + } + + public Version Version { + get; + set; + } + + public string LanguageGroup { + get; + set; + } + + public string Filepath { + get; + set; + } + + public string Prefix { + get; + set; + } + + /// + /// Overload equals so we can delete a entry from a collection + /// + /// + /// + public bool Equals(LanguageFile other) { + if (Prefix != null) { + if (other != null && !Prefix.Equals(other.Prefix)) { + return false; + } + } else if (other?.Prefix != null) { + return false; + } + if (Ietf != null) { + if (other != null && !Ietf.Equals(other.Ietf)) { + return false; + } + } else if (other?.Ietf != null) { + return false; + } + if (Version != null) { + if (other != null && !Version.Equals(other.Version)) { + return false; + } + } else if (other != null && other.Version != null) { + return false; + } + if (Filepath != null) { + if (other != null && !Filepath.Equals(other.Filepath)) { + return false; + } + } else if (other?.Filepath != null) { + return false; + } + return true; + } + } +} \ No newline at end of file diff --git a/GreenshotPlugin/Core/LogHelper.cs b/GreenshotPlugin/Core/LogHelper.cs index 04d21b6fc..1b5d8764b 100644 --- a/GreenshotPlugin/Core/LogHelper.cs +++ b/GreenshotPlugin/Core/LogHelper.cs @@ -22,13 +22,12 @@ using System.IO; using System.Reflection; using System.Windows.Forms; - -using Greenshot.IniFile; using log4net; using log4net.Appender; using log4net.Config; using log4net.Repository.Hierarchy; using System; +using GreenshotPlugin.IniFile; using log4net.Util; namespace GreenshotPlugin.Core { diff --git a/GreenshotPlugin/Core/NetworkHelper.cs b/GreenshotPlugin/Core/NetworkHelper.cs index 2872dcc97..b5160ae46 100644 --- a/GreenshotPlugin/Core/NetworkHelper.cs +++ b/GreenshotPlugin/Core/NetworkHelper.cs @@ -19,8 +19,6 @@ * along with this program. If not, see . */ -using Greenshot.IniFile; -using Greenshot.Plugin; using log4net; using System; using System.Collections.Generic; @@ -30,6 +28,9 @@ using System.IO; using System.Net; using System.Text; using System.Text.RegularExpressions; +using GreenshotPlugin.IniFile; +using GreenshotPlugin.Interfaces; +using GreenshotPlugin.Interfaces.Plugin; namespace GreenshotPlugin.Core { /// diff --git a/GreenshotPlugin/Core/PluginUtils.cs b/GreenshotPlugin/Core/PluginUtils.cs index 781585076..d7c1ce08b 100644 --- a/GreenshotPlugin/Core/PluginUtils.cs +++ b/GreenshotPlugin/Core/PluginUtils.cs @@ -19,8 +19,6 @@ * along with this program. If not, see . */ -using Greenshot.IniFile; -using Greenshot.Plugin; using GreenshotPlugin.UnmanagedHelpers; using log4net; using Microsoft.Win32; @@ -30,6 +28,8 @@ using System.ComponentModel; using System.Drawing; using System.IO; using System.Windows.Forms; +using GreenshotPlugin.IniFile; +using GreenshotPlugin.Interfaces.Forms; namespace GreenshotPlugin.Core { /// @@ -74,10 +74,10 @@ namespace GreenshotPlugin.Core { using (RegistryKey key = Registry.LocalMachine.OpenSubKey(PathKey + exeName, false)) { if (key != null) { // "" is the default key, which should point to the requested location - return (string)key.GetValue(""); + return (string)key.GetValue(string.Empty); } } - foreach (string pathEntry in (Environment.GetEnvironmentVariable("PATH") ?? "").Split(';')) { + foreach (string pathEntry in (Environment.GetEnvironmentVariable("PATH") ?? string.Empty).Split(';')) { try { string path = pathEntry.Trim(); if (!string.IsNullOrEmpty(path) && File.Exists(path = Path.Combine(path, exeName))) { diff --git a/GreenshotPlugin/Core/RssHelper.cs b/GreenshotPlugin/Core/RssHelper.cs index d66e124e8..f7a48289c 100644 --- a/GreenshotPlugin/Core/RssHelper.cs +++ b/GreenshotPlugin/Core/RssHelper.cs @@ -173,16 +173,16 @@ namespace GreenshotPlugin.Core { RssFile rssFile = new RssFile(file, pubdate, link); if (file.EndsWith(".exe") ||file.EndsWith(".zip")) { - string version = Regex.Replace(file, @".*[a-zA-Z_]\-", ""); + string version = Regex.Replace(file, @".*[a-zA-Z_]\-", string.Empty); version = version.Replace(@"\-[a-zA-Z]+.*",""); - version = Regex.Replace(version, @"\.exe$", ""); - version = Regex.Replace(version, @"\.zip$", ""); - version = Regex.Replace(version, @"RC[0-9]+", ""); + version = Regex.Replace(version, @"\.exe$", string.Empty); + version = Regex.Replace(version, @"\.zip$", string.Empty); + version = Regex.Replace(version, @"RC[0-9]+", string.Empty); if (version.Trim().Length > 0) { version = version.Replace('-','.'); version = version.Replace(',','.'); - version = Regex.Replace(version, @"^[a-zA-Z_]*\.", ""); - version = Regex.Replace(version, @"\.[a-zA-Z_]*$", ""); + version = Regex.Replace(version, @"^[a-zA-Z_]*\.", string.Empty); + version = Regex.Replace(version, @"\.[a-zA-Z_]*$", string.Empty); try { rssFile.Version = new Version(version); diff --git a/GreenshotPlugin/Core/WindowCapture.cs b/GreenshotPlugin/Core/WindowCapture.cs index 657f409f0..93e88a5a0 100644 --- a/GreenshotPlugin/Core/WindowCapture.cs +++ b/GreenshotPlugin/Core/WindowCapture.cs @@ -19,8 +19,6 @@ * along with this program. If not, see . */ -using Greenshot.IniFile; -using Greenshot.Plugin; using GreenshotPlugin.UnmanagedHelpers; using log4net; using System; @@ -30,6 +28,9 @@ using System.Drawing; using System.Drawing.Imaging; using System.Runtime.InteropServices; using System.Windows.Forms; +using GreenshotPlugin.IniFile; +using GreenshotPlugin.Interfaces; +using GreenshotPlugin.UnmanagedHelpers.Structs; namespace GreenshotPlugin.Core { /// diff --git a/GreenshotPlugin/Core/WindowsHelper.cs b/GreenshotPlugin/Core/WindowsHelper.cs index a24ed9629..cc120df33 100644 --- a/GreenshotPlugin/Core/WindowsHelper.cs +++ b/GreenshotPlugin/Core/WindowsHelper.cs @@ -19,9 +19,6 @@ * along with this program. If not, see . */ -using Greenshot.IniFile; -using Greenshot.Interop; -using Greenshot.Plugin; using GreenshotPlugin.UnmanagedHelpers; using log4net; using System; @@ -33,6 +30,11 @@ using System.Runtime.InteropServices; using System.Text; using System.Text.RegularExpressions; using System.Windows.Forms; +using GreenshotPlugin.IniFile; +using GreenshotPlugin.Interfaces; +using GreenshotPlugin.Interop; +using GreenshotPlugin.UnmanagedHelpers.Enums; +using GreenshotPlugin.UnmanagedHelpers.Structs; namespace GreenshotPlugin.Core { /// diff --git a/GreenshotPlugin/Core/WmInputLangChangeRequestFilter.cs b/GreenshotPlugin/Core/WmInputLangChangeRequestFilter.cs index a671d8a65..7e1507e16 100644 --- a/GreenshotPlugin/Core/WmInputLangChangeRequestFilter.cs +++ b/GreenshotPlugin/Core/WmInputLangChangeRequestFilter.cs @@ -21,6 +21,7 @@ using GreenshotPlugin.UnmanagedHelpers; using System.Windows.Forms; +using GreenshotPlugin.UnmanagedHelpers.Enums; using log4net; namespace GreenshotPlugin.Core diff --git a/GreenshotPlugin/Effects/DropShadowEffect.cs b/GreenshotPlugin/Effects/DropShadowEffect.cs index 2844c5889..b1f23bf1e 100644 --- a/GreenshotPlugin/Effects/DropShadowEffect.cs +++ b/GreenshotPlugin/Effects/DropShadowEffect.cs @@ -23,7 +23,6 @@ using System.ComponentModel; using System.Drawing; using System.Drawing.Drawing2D; using System.Drawing.Imaging; -using Greenshot.Core; using GreenshotPlugin.Core; namespace GreenshotPlugin.Effects { diff --git a/GreenshotPlugin/Effects/TornEdgeEffect.cs b/GreenshotPlugin/Effects/TornEdgeEffect.cs index be577097d..dbd5f5120 100644 --- a/GreenshotPlugin/Effects/TornEdgeEffect.cs +++ b/GreenshotPlugin/Effects/TornEdgeEffect.cs @@ -23,7 +23,6 @@ using System.ComponentModel; using System.Drawing; using System.Drawing.Drawing2D; using System.Drawing.Imaging; -using Greenshot.Core; using GreenshotPlugin.Core; namespace GreenshotPlugin.Effects diff --git a/GreenshotPlugin/Hooking/WindowsEventHook.cs b/GreenshotPlugin/Hooking/WindowsEventHook.cs index 5bf650b7e..2abe9edb4 100644 --- a/GreenshotPlugin/Hooking/WindowsEventHook.cs +++ b/GreenshotPlugin/Hooking/WindowsEventHook.cs @@ -23,6 +23,7 @@ using System; using System.Collections.Generic; using System.Runtime.InteropServices; using GreenshotPlugin.UnmanagedHelpers; +using GreenshotPlugin.UnmanagedHelpers.Enums; namespace GreenshotPlugin.Hooking { diff --git a/GreenshotPlugin/Hooking/WindowsOpenCloseMonitor.cs b/GreenshotPlugin/Hooking/WindowsOpenCloseMonitor.cs index 4eb727151..7f0943ae6 100644 --- a/GreenshotPlugin/Hooking/WindowsOpenCloseMonitor.cs +++ b/GreenshotPlugin/Hooking/WindowsOpenCloseMonitor.cs @@ -22,6 +22,7 @@ using System; using GreenshotPlugin.Core; using GreenshotPlugin.UnmanagedHelpers; +using GreenshotPlugin.UnmanagedHelpers.Enums; namespace GreenshotPlugin.Hooking { diff --git a/GreenshotPlugin/Hooking/WindowsTitleMonitor.cs b/GreenshotPlugin/Hooking/WindowsTitleMonitor.cs index 8e7d54b4f..998da7079 100644 --- a/GreenshotPlugin/Hooking/WindowsTitleMonitor.cs +++ b/GreenshotPlugin/Hooking/WindowsTitleMonitor.cs @@ -22,6 +22,7 @@ using System; using GreenshotPlugin.Core; using GreenshotPlugin.UnmanagedHelpers; +using GreenshotPlugin.UnmanagedHelpers.Enums; namespace GreenshotPlugin.Hooking { diff --git a/GreenshotPlugin/IEInterop/IHTMLBodyElement.cs b/GreenshotPlugin/IEInterop/IHTMLBodyElement.cs index eb5f8c5f9..fb344f237 100644 --- a/GreenshotPlugin/IEInterop/IHTMLBodyElement.cs +++ b/GreenshotPlugin/IEInterop/IHTMLBodyElement.cs @@ -21,7 +21,7 @@ using System.Runtime.InteropServices; -namespace Greenshot.Interop.IE { +namespace GreenshotPlugin.IEInterop { [ComImport, Guid("3050F1D8-98B5-11CF-BB82-00AA00BDCE0B"), TypeLibType(TypeLibTypeFlags.FDual), InterfaceType(ComInterfaceType.InterfaceIsIDispatch)] diff --git a/GreenshotPlugin/IEInterop/IHTMLCurrentStyle.cs b/GreenshotPlugin/IEInterop/IHTMLCurrentStyle.cs index 444c6314d..4de30a205 100644 --- a/GreenshotPlugin/IEInterop/IHTMLCurrentStyle.cs +++ b/GreenshotPlugin/IEInterop/IHTMLCurrentStyle.cs @@ -21,7 +21,7 @@ using System.Runtime.InteropServices; -namespace Greenshot.Interop.IE { +namespace GreenshotPlugin.IEInterop { [ComImport, Guid("3050f3db-98b5-11cf-bb82-00aa00bdce0b"), TypeLibType(TypeLibTypeFlags.FDual), InterfaceType(ComInterfaceType.InterfaceIsIDispatch)] diff --git a/GreenshotPlugin/IEInterop/IHTMLDocument.cs b/GreenshotPlugin/IEInterop/IHTMLDocument.cs index 5e01506ab..79f2b622a 100644 --- a/GreenshotPlugin/IEInterop/IHTMLDocument.cs +++ b/GreenshotPlugin/IEInterop/IHTMLDocument.cs @@ -21,7 +21,7 @@ using System.Runtime.InteropServices; -namespace Greenshot.Interop.IE { +namespace GreenshotPlugin.IEInterop { /// IHTMLDocument interface. [Guid("626FC520-A41E-11CF-A731-00A0C9082637")] [ComImport] diff --git a/GreenshotPlugin/IEInterop/IHTMLDocument2.cs b/GreenshotPlugin/IEInterop/IHTMLDocument2.cs index 4059d5f35..2e0ab177f 100644 --- a/GreenshotPlugin/IEInterop/IHTMLDocument2.cs +++ b/GreenshotPlugin/IEInterop/IHTMLDocument2.cs @@ -21,7 +21,7 @@ using System.Runtime.InteropServices; -namespace Greenshot.Interop.IE { +namespace GreenshotPlugin.IEInterop { /// IHTMLDocument2 interface. [Guid("332C4425-26CB-11D0-B483-00C04FD90119")] [ComImport] diff --git a/GreenshotPlugin/IEInterop/IHTMLDocument3.cs b/GreenshotPlugin/IEInterop/IHTMLDocument3.cs index da6485caa..74af3d8c9 100644 --- a/GreenshotPlugin/IEInterop/IHTMLDocument3.cs +++ b/GreenshotPlugin/IEInterop/IHTMLDocument3.cs @@ -21,7 +21,7 @@ using System.Runtime.InteropServices; -namespace Greenshot.Interop.IE { +namespace GreenshotPlugin.IEInterop { /// IHTMLDocument3 interface. [Guid("3050F485-98B5-11CF-BB82-00AA00BDCE0B")] [ComImport] diff --git a/GreenshotPlugin/IEInterop/IHTMLDocument4.cs b/GreenshotPlugin/IEInterop/IHTMLDocument4.cs index 2b959747d..308243eff 100644 --- a/GreenshotPlugin/IEInterop/IHTMLDocument4.cs +++ b/GreenshotPlugin/IEInterop/IHTMLDocument4.cs @@ -21,7 +21,7 @@ using System.Runtime.InteropServices; -namespace Greenshot.Interop.IE { +namespace GreenshotPlugin.IEInterop { [ComVisible(true), Guid("3050f69a-98b5-11cf-bb82-00aa00bdce0b"), InterfaceType(ComInterfaceType.InterfaceIsIDispatch), TypeLibType(TypeLibTypeFlags.FDual)] diff --git a/GreenshotPlugin/IEInterop/IHTMLDocument5.cs b/GreenshotPlugin/IEInterop/IHTMLDocument5.cs index e486d5007..574edbefe 100644 --- a/GreenshotPlugin/IEInterop/IHTMLDocument5.cs +++ b/GreenshotPlugin/IEInterop/IHTMLDocument5.cs @@ -21,7 +21,7 @@ using System.Runtime.InteropServices; -namespace Greenshot.Interop.IE { +namespace GreenshotPlugin.IEInterop { [ComImport, ComVisible(true), Guid("3050f80c-98b5-11cf-bb82-00aa00bdce0b"), InterfaceType(ComInterfaceType.InterfaceIsIDispatch), TypeLibType(TypeLibTypeFlags.FDual)] diff --git a/GreenshotPlugin/IEInterop/IHTMLElement.cs b/GreenshotPlugin/IEInterop/IHTMLElement.cs index 6f2226140..a7fcae716 100644 --- a/GreenshotPlugin/IEInterop/IHTMLElement.cs +++ b/GreenshotPlugin/IEInterop/IHTMLElement.cs @@ -21,7 +21,7 @@ using System.Runtime.InteropServices; -namespace Greenshot.Interop.IE { +namespace GreenshotPlugin.IEInterop { [ComImport, Guid("3050F1FF-98B5-11CF-BB82-00AA00BDCE0B"), TypeLibType(TypeLibTypeFlags.FDual), InterfaceType(ComInterfaceType.InterfaceIsIDispatch)] diff --git a/GreenshotPlugin/IEInterop/IHTMLElement2.cs b/GreenshotPlugin/IEInterop/IHTMLElement2.cs index 8d920b7f2..a6d258b06 100644 --- a/GreenshotPlugin/IEInterop/IHTMLElement2.cs +++ b/GreenshotPlugin/IEInterop/IHTMLElement2.cs @@ -21,7 +21,7 @@ using System.Runtime.InteropServices; -namespace Greenshot.Interop.IE { +namespace GreenshotPlugin.IEInterop { [ComImport, Guid("3050F434-98B5-11CF-BB82-00AA00BDCE0B"), TypeLibType(TypeLibTypeFlags.FDual), InterfaceType(ComInterfaceType.InterfaceIsIDispatch)] diff --git a/GreenshotPlugin/IEInterop/IHTMLElementCollection.cs b/GreenshotPlugin/IEInterop/IHTMLElementCollection.cs index 111983d62..3901edc30 100644 --- a/GreenshotPlugin/IEInterop/IHTMLElementCollection.cs +++ b/GreenshotPlugin/IEInterop/IHTMLElementCollection.cs @@ -22,7 +22,7 @@ using System.Collections; using System.Runtime.InteropServices; -namespace Greenshot.Interop.IE { +namespace GreenshotPlugin.IEInterop { [ComImport(), ComVisible(true), Guid("3050F21F-98B5-11CF-BB82-00AA00BDCE0B"), InterfaceType(ComInterfaceType.InterfaceIsIDispatch), diff --git a/GreenshotPlugin/IEInterop/IHTMLFrameBase.cs b/GreenshotPlugin/IEInterop/IHTMLFrameBase.cs index b4b1ed9a0..ac26be320 100644 --- a/GreenshotPlugin/IEInterop/IHTMLFrameBase.cs +++ b/GreenshotPlugin/IEInterop/IHTMLFrameBase.cs @@ -21,7 +21,7 @@ using System.Runtime.InteropServices; -namespace Greenshot.Interop.IE { +namespace GreenshotPlugin.IEInterop { [ComVisible(true), ComImport(), Guid("3050f311-98b5-11cf-bb82-00aa00bdce0b"), TypeLibType(TypeLibTypeFlags.FDual), InterfaceType(ComInterfaceType.InterfaceIsIDispatch)] diff --git a/GreenshotPlugin/IEInterop/IHTMLFramesCollection2.cs b/GreenshotPlugin/IEInterop/IHTMLFramesCollection2.cs index 8817f973b..731ff60a4 100644 --- a/GreenshotPlugin/IEInterop/IHTMLFramesCollection2.cs +++ b/GreenshotPlugin/IEInterop/IHTMLFramesCollection2.cs @@ -21,7 +21,7 @@ using System.Runtime.InteropServices; -namespace Greenshot.Interop.IE { +namespace GreenshotPlugin.IEInterop { [ComImport(), ComVisible(true), Guid("332C4426-26CB-11D0-B483-00C04FD90119"), InterfaceType(ComInterfaceType.InterfaceIsIDispatch), diff --git a/GreenshotPlugin/IEInterop/IHTMLRect.cs b/GreenshotPlugin/IEInterop/IHTMLRect.cs index 371f089d3..ae398299b 100644 --- a/GreenshotPlugin/IEInterop/IHTMLRect.cs +++ b/GreenshotPlugin/IEInterop/IHTMLRect.cs @@ -21,7 +21,7 @@ using System.Runtime.InteropServices; -namespace Greenshot.Interop.IE { +namespace GreenshotPlugin.IEInterop { [ComImport, Guid("3050F4A3-98B5-11CF-BB82-00AA00BDCE0B"), TypeLibType(TypeLibTypeFlags.FDual), InterfaceType(ComInterfaceType.InterfaceIsIDispatch)] diff --git a/GreenshotPlugin/IEInterop/IHTMLScreen.cs b/GreenshotPlugin/IEInterop/IHTMLScreen.cs index 8c56480fd..97f87124e 100644 --- a/GreenshotPlugin/IEInterop/IHTMLScreen.cs +++ b/GreenshotPlugin/IEInterop/IHTMLScreen.cs @@ -21,7 +21,7 @@ using System.Runtime.InteropServices; -namespace Greenshot.Interop.IE { +namespace GreenshotPlugin.IEInterop { [ComImport, Guid("3050F35C-98B5-11CF-BB82-00AA00BDCE0B"), TypeLibType(TypeLibTypeFlags.FDual), InterfaceType(ComInterfaceType.InterfaceIsIDispatch)] diff --git a/GreenshotPlugin/IEInterop/IHTMLScreen2.cs b/GreenshotPlugin/IEInterop/IHTMLScreen2.cs index ee350328c..e3c6fb5d2 100644 --- a/GreenshotPlugin/IEInterop/IHTMLScreen2.cs +++ b/GreenshotPlugin/IEInterop/IHTMLScreen2.cs @@ -21,7 +21,7 @@ using System.Runtime.InteropServices; -namespace Greenshot.Interop.IE { +namespace GreenshotPlugin.IEInterop { [ComImport, Guid("3050F84A-98B5-11CF-BB82-00AA00BDCE0B"), TypeLibType(TypeLibTypeFlags.FDual), InterfaceType(ComInterfaceType.InterfaceIsIDispatch)] diff --git a/GreenshotPlugin/IEInterop/IHTMLSelectionObject.cs b/GreenshotPlugin/IEInterop/IHTMLSelectionObject.cs index dae935d15..ac618945b 100644 --- a/GreenshotPlugin/IEInterop/IHTMLSelectionObject.cs +++ b/GreenshotPlugin/IEInterop/IHTMLSelectionObject.cs @@ -21,7 +21,7 @@ using System.Runtime.InteropServices; -namespace Greenshot.Interop.IE { +namespace GreenshotPlugin.IEInterop { // See: http://msdn.microsoft.com/en-us/library/aa768849%28v=vs.85%29.aspx [ComImport, Guid("3050f25A-98b5-11cf-bb82-00aa00bdce0b"), TypeLibType(TypeLibTypeFlags.FDual), diff --git a/GreenshotPlugin/IEInterop/IHTMLStyle.cs b/GreenshotPlugin/IEInterop/IHTMLStyle.cs index fd640333c..5541f0541 100644 --- a/GreenshotPlugin/IEInterop/IHTMLStyle.cs +++ b/GreenshotPlugin/IEInterop/IHTMLStyle.cs @@ -21,7 +21,7 @@ using System.Runtime.InteropServices; -namespace Greenshot.Interop.IE { +namespace GreenshotPlugin.IEInterop { [ComImport, Guid("3050F25E-98B5-11CF-BB82-00AA00BDCE0B"), TypeLibType(TypeLibTypeFlags.FDual), InterfaceType(ComInterfaceType.InterfaceIsIDispatch)] diff --git a/GreenshotPlugin/IEInterop/IHTMLTxtRange.cs b/GreenshotPlugin/IEInterop/IHTMLTxtRange.cs index f01f66751..c45d4313b 100644 --- a/GreenshotPlugin/IEInterop/IHTMLTxtRange.cs +++ b/GreenshotPlugin/IEInterop/IHTMLTxtRange.cs @@ -21,7 +21,7 @@ using System.Runtime.InteropServices; -namespace Greenshot.Interop.IE { +namespace GreenshotPlugin.IEInterop { // See: http://msdn.microsoft.com/en-us/library/aa741548%28v=vs.85%29.aspx [ComImport, Guid("3050F220-98B5-11CF-BB82-00AA00BDCE0B"), TypeLibType(TypeLibTypeFlags.FDual), diff --git a/GreenshotPlugin/IEInterop/IHTMLWindow2.cs b/GreenshotPlugin/IEInterop/IHTMLWindow2.cs index 589bdedbc..c8846dfb4 100644 --- a/GreenshotPlugin/IEInterop/IHTMLWindow2.cs +++ b/GreenshotPlugin/IEInterop/IHTMLWindow2.cs @@ -21,7 +21,7 @@ using System.Runtime.InteropServices; -namespace Greenshot.Interop.IE { +namespace GreenshotPlugin.IEInterop { [ComVisible(true), ComImport(), Guid("332c4427-26cb-11d0-b483-00c04fd90119"), TypeLibType(TypeLibTypeFlags.FDual), InterfaceType(ComInterfaceType.InterfaceIsIDispatch)] diff --git a/GreenshotPlugin/IEInterop/IHTMLWindow3.cs b/GreenshotPlugin/IEInterop/IHTMLWindow3.cs index e1c34cab1..6363d31ac 100644 --- a/GreenshotPlugin/IEInterop/IHTMLWindow3.cs +++ b/GreenshotPlugin/IEInterop/IHTMLWindow3.cs @@ -21,7 +21,7 @@ using System.Runtime.InteropServices; -namespace Greenshot.Interop.IE { +namespace GreenshotPlugin.IEInterop { [ComVisible(true), ComImport(), Guid("3050f4ae-98b5-11cf-bb82-00aa00bdce0b"), TypeLibType(TypeLibTypeFlags.FDual), InterfaceType(ComInterfaceType.InterfaceIsIDispatch)] diff --git a/GreenshotPlugin/IEInterop/IHTMLWindow4.cs b/GreenshotPlugin/IEInterop/IHTMLWindow4.cs index 5fddd4690..b267901a7 100644 --- a/GreenshotPlugin/IEInterop/IHTMLWindow4.cs +++ b/GreenshotPlugin/IEInterop/IHTMLWindow4.cs @@ -21,7 +21,7 @@ using System.Runtime.InteropServices; -namespace Greenshot.Interop.IE { +namespace GreenshotPlugin.IEInterop { [ComVisible(true), ComImport(), Guid("3050f6cf-98b5-11cf-bb82-00aa00bdce0b"), TypeLibType(TypeLibTypeFlags.FDual), InterfaceType(ComInterfaceType.InterfaceIsIDispatch)] diff --git a/GreenshotPlugin/IEInterop/IWebBrowser2.cs b/GreenshotPlugin/IEInterop/IWebBrowser2.cs index f29bd54e0..42b6c3fc1 100644 --- a/GreenshotPlugin/IEInterop/IWebBrowser2.cs +++ b/GreenshotPlugin/IEInterop/IWebBrowser2.cs @@ -21,7 +21,7 @@ using System.Runtime.InteropServices; -namespace Greenshot.Interop.IE { +namespace GreenshotPlugin.IEInterop { // IWebBrowser: EAB22AC1-30C1-11CF-A7EB-0000C05BAE0B // [ComVisible(true), ComImport(), Guid("D30C1661-CDAF-11D0-8A3E-00C04FC9E26E"), // TypeLibType(TypeLibTypeFlags.FDual), diff --git a/GreenshotPlugin/IniFile/IniAttributes.cs b/GreenshotPlugin/IniFile/IniAttributes.cs index a97ce35f1..611661586 100644 --- a/GreenshotPlugin/IniFile/IniAttributes.cs +++ b/GreenshotPlugin/IniFile/IniAttributes.cs @@ -18,9 +18,10 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ + using System; -namespace Greenshot.IniFile { +namespace GreenshotPlugin.IniFile { /// /// Attribute for telling that this class is linked to a section in the ini-configuration /// diff --git a/GreenshotPlugin/IniFile/IniConfig.cs b/GreenshotPlugin/IniFile/IniConfig.cs index 5f61830a7..7981712f6 100644 --- a/GreenshotPlugin/IniFile/IniConfig.cs +++ b/GreenshotPlugin/IniFile/IniConfig.cs @@ -18,6 +18,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ + using System; using System.Collections.Generic; using System.IO; @@ -26,7 +27,7 @@ using System.Text; using System.Threading; using log4net; -namespace Greenshot.IniFile { +namespace GreenshotPlugin.IniFile { public class IniConfig { private static readonly ILog Log = LogManager.GetLogger(typeof(IniConfig)); private const string IniExtension = ".ini"; diff --git a/GreenshotPlugin/IniFile/IniReader.cs b/GreenshotPlugin/IniFile/IniReader.cs index c2c120851..6e399ab5e 100644 --- a/GreenshotPlugin/IniFile/IniReader.cs +++ b/GreenshotPlugin/IniFile/IniReader.cs @@ -23,7 +23,7 @@ using System.Collections.Generic; using System.IO; using System.Text; -namespace Greenshot.IniFile { +namespace GreenshotPlugin.IniFile { /// /// The IniReader does exactly what it says, it reads the .ini file /// diff --git a/GreenshotPlugin/IniFile/IniSection.cs b/GreenshotPlugin/IniFile/IniSection.cs index 89129870e..5022f5ab0 100644 --- a/GreenshotPlugin/IniFile/IniSection.cs +++ b/GreenshotPlugin/IniFile/IniSection.cs @@ -18,14 +18,15 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ + using System; using System.Collections.Generic; -using System.Reflection; using System.IO; +using System.Reflection; using GreenshotPlugin.Core; using log4net; -namespace Greenshot.IniFile { +namespace GreenshotPlugin.IniFile { /// /// Base class for all IniSections /// diff --git a/GreenshotPlugin/IniFile/IniValue.cs b/GreenshotPlugin/IniFile/IniValue.cs index c34fd1f24..9a39ce995 100644 --- a/GreenshotPlugin/IniFile/IniValue.cs +++ b/GreenshotPlugin/IniFile/IniValue.cs @@ -18,15 +18,16 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ + using System; -using System.Reflection; using System.Collections.Generic; using System.ComponentModel; using System.IO; +using System.Reflection; using System.Text; using log4net; -namespace Greenshot.IniFile { +namespace GreenshotPlugin.IniFile { /// /// A container to be able to pass the value from a IniSection around. /// @@ -356,10 +357,10 @@ namespace Greenshot.IniFile { // The following makes the enum string values a bit less restrictive if (valueType.IsEnum) { - string searchingEnumString = valueString.Replace("_", "").ToLowerInvariant(); + string searchingEnumString = valueString.Replace("_", string.Empty).ToLowerInvariant(); foreach (var possibleValue in Enum.GetValues(valueType)) { - var possibleString = possibleValue.ToString().Replace("_", "").ToLowerInvariant(); + var possibleString = possibleValue.ToString().Replace("_", string.Empty).ToLowerInvariant(); if (possibleString.Equals(searchingEnumString)) { return possibleValue; @@ -424,7 +425,7 @@ namespace Greenshot.IniFile { private static string ConvertValueToString(Type valueType, object valueObject, string separator) { if (valueObject == null) { // If there is nothing, deliver nothing! - return ""; + return string.Empty; } if (valueType.IsGenericType && valueType.GetGenericTypeDefinition() == typeof(List<>)) { diff --git a/GreenshotPlugin/Interfaces/Capture.cs b/GreenshotPlugin/Interfaces/Capture.cs index 38ab7dd4a..6a4dd647d 100644 --- a/GreenshotPlugin/Interfaces/Capture.cs +++ b/GreenshotPlugin/Interfaces/Capture.cs @@ -18,11 +18,12 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ + using System; using System.Collections.Generic; using System.Drawing; -namespace Greenshot.Plugin { +namespace GreenshotPlugin.Interfaces { /// /// The capture mode for Greenshot /// diff --git a/GreenshotPlugin/Interfaces/Drawing/Adorners/IAdorner.cs b/GreenshotPlugin/Interfaces/Drawing/Adorners/IAdorner.cs index 1a6c4a950..e35af2141 100644 --- a/GreenshotPlugin/Interfaces/Drawing/Adorners/IAdorner.cs +++ b/GreenshotPlugin/Interfaces/Drawing/Adorners/IAdorner.cs @@ -23,7 +23,7 @@ using System.Drawing; using System.Drawing.Drawing2D; using System.Windows.Forms; -namespace Greenshot.Plugin.Drawing.Adorners +namespace GreenshotPlugin.Interfaces.Drawing.Adorners { public interface IAdorner { diff --git a/GreenshotPlugin/Interfaces/Drawing/Container.cs b/GreenshotPlugin/Interfaces/Drawing/Container.cs index e4297a548..b2b6e3d19 100644 --- a/GreenshotPlugin/Interfaces/Drawing/Container.cs +++ b/GreenshotPlugin/Interfaces/Drawing/Container.cs @@ -18,17 +18,17 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ + using System; +using System.Collections.Generic; +using System.ComponentModel; using System.Drawing; using System.Drawing.Drawing2D; using System.Drawing.Imaging; using System.Windows.Forms; -using System.ComponentModel; -using System.Collections.Generic; -using GreenshotPlugin.Interfaces.Drawing; -using Greenshot.Plugin.Drawing.Adorners; +using GreenshotPlugin.Interfaces.Drawing.Adorners; -namespace Greenshot.Plugin.Drawing +namespace GreenshotPlugin.Interfaces.Drawing { public enum RenderMode { EDIT, EXPORT }; public enum EditStatus { UNDRAWN, DRAWING, MOVING, RESIZING, IDLE }; diff --git a/GreenshotPlugin/Interfaces/Drawing/IMemento.cs b/GreenshotPlugin/Interfaces/Drawing/IMemento.cs index 318d0c7fe..40e1ab61c 100644 --- a/GreenshotPlugin/Interfaces/Drawing/IMemento.cs +++ b/GreenshotPlugin/Interfaces/Drawing/IMemento.cs @@ -18,9 +18,10 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ + using System; -namespace Greenshot.Memento { +namespace GreenshotPlugin.Interfaces.Drawing { /// /// Description of IMemento. /// diff --git a/GreenshotPlugin/Interfaces/Forms/ImageEditor.cs b/GreenshotPlugin/Interfaces/Forms/ImageEditor.cs index 1c393d476..b499231a3 100644 --- a/GreenshotPlugin/Interfaces/Forms/ImageEditor.cs +++ b/GreenshotPlugin/Interfaces/Forms/ImageEditor.cs @@ -22,7 +22,7 @@ using System.Drawing; using System.Windows.Forms; -namespace Greenshot.Plugin { +namespace GreenshotPlugin.Interfaces.Forms { /// /// The IImageEditor is the Interface that the Greenshot ImageEditor has to implement /// diff --git a/GreenshotPlugin/Interfaces/Generic.cs b/GreenshotPlugin/Interfaces/Generic.cs index f0be46838..5ae2177ef 100644 --- a/GreenshotPlugin/Interfaces/Generic.cs +++ b/GreenshotPlugin/Interfaces/Generic.cs @@ -19,15 +19,14 @@ * along with this program. If not, see . */ -using Greenshot.Memento; -using Greenshot.Plugin.Drawing; using System; using System.Drawing; using System.IO; using System.Windows.Forms; using GreenshotPlugin.Effects; +using GreenshotPlugin.Interfaces.Drawing; -namespace Greenshot.Plugin +namespace GreenshotPlugin.Interfaces { /// /// Alignment Enums for possitioning diff --git a/GreenshotPlugin/Interfaces/IDestination.cs b/GreenshotPlugin/Interfaces/IDestination.cs index a56dcc05e..371d2b6b3 100644 --- a/GreenshotPlugin/Interfaces/IDestination.cs +++ b/GreenshotPlugin/Interfaces/IDestination.cs @@ -18,12 +18,13 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ + using System; using System.Collections.Generic; using System.Drawing; using System.Windows.Forms; -namespace Greenshot.Plugin { +namespace GreenshotPlugin.Interfaces { public class ExportInformation { public ExportInformation(string destinationDesignation, string destinationDescription) { DestinationDesignation = destinationDesignation; diff --git a/GreenshotPlugin/Interfaces/IOcrProvider.cs b/GreenshotPlugin/Interfaces/IOcrProvider.cs index f48e1c21e..21bc531c6 100644 --- a/GreenshotPlugin/Interfaces/IOcrProvider.cs +++ b/GreenshotPlugin/Interfaces/IOcrProvider.cs @@ -19,7 +19,6 @@ * along with this program. If not, see . */ -using Greenshot.Plugin; using System.Collections.Generic; using System.Drawing; using System.Threading.Tasks; diff --git a/GreenshotPlugin/Interfaces/IProcessor.cs b/GreenshotPlugin/Interfaces/IProcessor.cs index 6cf07badc..927933abf 100644 --- a/GreenshotPlugin/Interfaces/IProcessor.cs +++ b/GreenshotPlugin/Interfaces/IProcessor.cs @@ -18,9 +18,10 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ + using System; -namespace Greenshot.Plugin { +namespace GreenshotPlugin.Interfaces { /// /// Description of IProcessor. /// diff --git a/GreenshotPlugin/Interfaces/Plugin/HotKeyHandler.cs b/GreenshotPlugin/Interfaces/Plugin/HotKeyHandler.cs index dd76ac113..2db074f62 100644 --- a/GreenshotPlugin/Interfaces/Plugin/HotKeyHandler.cs +++ b/GreenshotPlugin/Interfaces/Plugin/HotKeyHandler.cs @@ -1,4 +1,4 @@ -namespace Greenshot.Plugin +namespace GreenshotPlugin.Interfaces.Plugin { public delegate void HotKeyHandler(); } \ No newline at end of file diff --git a/GreenshotPlugin/Interfaces/Plugin/IGreenshotHost.cs b/GreenshotPlugin/Interfaces/Plugin/IGreenshotHost.cs index 4ba2c15a0..b502a5ba2 100644 --- a/GreenshotPlugin/Interfaces/Plugin/IGreenshotHost.cs +++ b/GreenshotPlugin/Interfaces/Plugin/IGreenshotHost.cs @@ -1,6 +1,6 @@ using System.Drawing; -namespace Greenshot.Plugin +namespace GreenshotPlugin.Interfaces.Plugin { /// /// This interface is the GreenshotPluginHost, that which "Hosts" the plugin. diff --git a/GreenshotPlugin/Interfaces/Plugin/IGreenshotPlugin.cs b/GreenshotPlugin/Interfaces/Plugin/IGreenshotPlugin.cs index e5afec985..697a52a56 100644 --- a/GreenshotPlugin/Interfaces/Plugin/IGreenshotPlugin.cs +++ b/GreenshotPlugin/Interfaces/Plugin/IGreenshotPlugin.cs @@ -1,6 +1,6 @@ using System; -namespace Greenshot.Plugin +namespace GreenshotPlugin.Interfaces.Plugin { /// /// This defines the plugin diff --git a/GreenshotPlugin/Interfaces/Plugin/PluginAttribute.cs b/GreenshotPlugin/Interfaces/Plugin/PluginAttribute.cs index 9d75082f9..73fa60653 100644 --- a/GreenshotPlugin/Interfaces/Plugin/PluginAttribute.cs +++ b/GreenshotPlugin/Interfaces/Plugin/PluginAttribute.cs @@ -21,7 +21,7 @@ using System; -namespace Greenshot.Plugin { +namespace GreenshotPlugin.Interfaces.Plugin { [Serializable] [AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)] public sealed class PluginAttribute : Attribute, IComparable { diff --git a/GreenshotPlugin/Interfaces/Plugin/SurfaceOutputSettings.cs b/GreenshotPlugin/Interfaces/Plugin/SurfaceOutputSettings.cs index aaa7a026c..c3429b2b1 100644 --- a/GreenshotPlugin/Interfaces/Plugin/SurfaceOutputSettings.cs +++ b/GreenshotPlugin/Interfaces/Plugin/SurfaceOutputSettings.cs @@ -1,9 +1,9 @@ using System.Collections.Generic; -using Greenshot.IniFile; using GreenshotPlugin.Core; using GreenshotPlugin.Effects; +using GreenshotPlugin.IniFile; -namespace Greenshot.Plugin +namespace GreenshotPlugin.Interfaces.Plugin { public class SurfaceOutputSettings { private static readonly CoreConfiguration CoreConfig = IniConfig.GetIniSection(); diff --git a/GreenshotPlugin/Interop/Base.cs b/GreenshotPlugin/Interop/Base.cs index 16c4799fe..ec821a6ef 100644 --- a/GreenshotPlugin/Interop/Base.cs +++ b/GreenshotPlugin/Interop/Base.cs @@ -1,6 +1,6 @@ using System; -namespace Greenshot.Interop { +namespace GreenshotPlugin.Interop { /// /// Common properties that has appreared in almost all objects /// diff --git a/GreenshotPlugin/Interop/COMWrapper.cs b/GreenshotPlugin/Interop/COMWrapper.cs index 2c03d48ec..0a0dee361 100644 --- a/GreenshotPlugin/Interop/COMWrapper.cs +++ b/GreenshotPlugin/Interop/COMWrapper.cs @@ -29,7 +29,7 @@ using System.Windows.Forms; using GreenshotPlugin.Core; using log4net; -namespace Greenshot.Interop { +namespace GreenshotPlugin.Interop { /// /// Wraps a late-bound COM server. /// diff --git a/GreenshotPlugin/Interop/ComProgIdAttribute.cs b/GreenshotPlugin/Interop/ComProgIdAttribute.cs index 703c91aa2..9138c1ce6 100644 --- a/GreenshotPlugin/Interop/ComProgIdAttribute.cs +++ b/GreenshotPlugin/Interop/ComProgIdAttribute.cs @@ -18,9 +18,10 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ + using System; -namespace Greenshot.Interop { +namespace GreenshotPlugin.Interop { /// /// An attribute to specifiy the ProgID of the COM class to create. (As suggested by Kristen Wegner) /// diff --git a/GreenshotPlugin/Interop/IAppVisibility.cs b/GreenshotPlugin/Interop/IAppVisibility.cs index 38afe86c0..ed6ceaf1f 100644 --- a/GreenshotPlugin/Interop/IAppVisibility.cs +++ b/GreenshotPlugin/Interop/IAppVisibility.cs @@ -18,10 +18,11 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ + using System; using System.Runtime.InteropServices; -namespace Greenshot.Interop { +namespace GreenshotPlugin.Interop { // This is used for Windows 8 to see if the App Launcher is active // See http://msdn.microsoft.com/en-us/library/windows/desktop/jj554119%28v=vs.85%29.aspx [ComProgId("clsid:7E5FE3D9-985F-4908-91F9-EE19F9FD1514")] diff --git a/GreenshotPlugin/Interop/IDispatch.cs b/GreenshotPlugin/Interop/IDispatch.cs index dd6c086da..eb9f4c918 100644 --- a/GreenshotPlugin/Interop/IDispatch.cs +++ b/GreenshotPlugin/Interop/IDispatch.cs @@ -23,8 +23,7 @@ using System; using System.Runtime.InteropServices; using System.Runtime.InteropServices.CustomMarshalers; - -namespace Greenshot.Interop { +namespace GreenshotPlugin.Interop { [ComImport, Guid("00020400-0000-0000-C000-000000000046"), InterfaceType(ComInterfaceType.InterfaceIsDual)] public interface IDispatch : IUnknown { [PreserveSig] diff --git a/GreenshotPlugin/Interop/IOleCommandTarget.cs b/GreenshotPlugin/Interop/IOleCommandTarget.cs index 01886bf09..3bab1bb5c 100644 --- a/GreenshotPlugin/Interop/IOleCommandTarget.cs +++ b/GreenshotPlugin/Interop/IOleCommandTarget.cs @@ -18,10 +18,11 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ + using System; using System.Runtime.InteropServices; -namespace GreenshotInterop.Interop { +namespace GreenshotPlugin.Interop { [ComImport, InterfaceType(ComInterfaceType.InterfaceIsIUnknown), ComVisible(true), Guid("B722BCCB-4E68-101B-A2BC-00AA00404770")] public interface IOleCommandTarget { [return: MarshalAs(UnmanagedType.I4)] diff --git a/GreenshotPlugin/Interop/IOleWindow.cs b/GreenshotPlugin/Interop/IOleWindow.cs index 7d69483de..650bf6100 100644 --- a/GreenshotPlugin/Interop/IOleWindow.cs +++ b/GreenshotPlugin/Interop/IOleWindow.cs @@ -22,7 +22,7 @@ using System; using System.Runtime.InteropServices; -namespace Greenshot.Interop { +namespace GreenshotPlugin.Interop { // Needed to get the Window handle from the IDocument2 // See: http://msdn.microsoft.com/en-us/library/ms680102%28v=vs.85%29.aspx [ComImport, Guid("00000114-0000-0000-C000-000000000046"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] diff --git a/GreenshotPlugin/Interop/IServiceProvider.cs b/GreenshotPlugin/Interop/IServiceProvider.cs index 68e4b7dfd..ea6a7d437 100644 --- a/GreenshotPlugin/Interop/IServiceProvider.cs +++ b/GreenshotPlugin/Interop/IServiceProvider.cs @@ -18,10 +18,11 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ + using System; using System.Runtime.InteropServices; -namespace Greenshot.Interop { +namespace GreenshotPlugin.Interop { // This is the COM IServiceProvider interface, not System.IServiceProvider .Net interface! [ComImport(), ComVisible(true), Guid("6D5140C1-7436-11CE-8034-00AA006009FA"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] diff --git a/GreenshotPlugin/Interop/IUnknown.cs b/GreenshotPlugin/Interop/IUnknown.cs index 929ad48b6..323bbafa3 100644 --- a/GreenshotPlugin/Interop/IUnknown.cs +++ b/GreenshotPlugin/Interop/IUnknown.cs @@ -22,7 +22,7 @@ using System; using System.Runtime.InteropServices; -namespace Greenshot.Interop { +namespace GreenshotPlugin.Interop { [ComImport, InterfaceType(ComInterfaceType.InterfaceIsIUnknown), Guid("00000000-0000-0000-C000-000000000046")] public interface IUnknown { IntPtr QueryInterface(ref Guid riid); diff --git a/GreenshotPlugin/UnmanagedHelpers/EnumWindowsProc.cs b/GreenshotPlugin/UnmanagedHelpers/EnumWindowsProc.cs new file mode 100644 index 000000000..9ab13906c --- /dev/null +++ b/GreenshotPlugin/UnmanagedHelpers/EnumWindowsProc.cs @@ -0,0 +1,12 @@ +using System; + +namespace GreenshotPlugin.UnmanagedHelpers +{ + /// + /// Used with EnumWindows or EnumChildWindows + /// + /// + /// + /// + public delegate int EnumWindowsProc(IntPtr hwnd, int lParam); +} \ No newline at end of file diff --git a/GreenshotPlugin/UnmanagedHelpers/Enumerations.cs b/GreenshotPlugin/UnmanagedHelpers/Enumerations.cs deleted file mode 100644 index 692f69b41..000000000 --- a/GreenshotPlugin/UnmanagedHelpers/Enumerations.cs +++ /dev/null @@ -1,1280 +0,0 @@ -/* - * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom - * - * For more information see: http://getgreenshot.org/ - * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 1 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -using System; -using System.Diagnostics.CodeAnalysis; - -namespace GreenshotPlugin.UnmanagedHelpers { - /// - /// Window Style Flags - /// - [Flags] - [SuppressMessage("ReSharper", "InconsistentNaming")] - public enum WindowStyleFlags : long { - //WS_OVERLAPPED = 0x00000000, - WS_POPUP = 0x80000000, - WS_CHILD = 0x40000000, - WS_MINIMIZE = 0x20000000, - WS_VISIBLE = 0x10000000, - WS_DISABLED = 0x08000000, - WS_CLIPSIBLINGS = 0x04000000, - WS_CLIPCHILDREN = 0x02000000, - WS_MAXIMIZE = 0x01000000, - WS_BORDER = 0x00800000, - WS_DLGFRAME = 0x00400000, - WS_VSCROLL = 0x00200000, - WS_HSCROLL = 0x00100000, - WS_SYSMENU = 0x00080000, - WS_THICKFRAME = 0x00040000, - WS_GROUP = 0x00020000, - WS_TABSTOP = 0x00010000, - - WS_UNK8000 = 0x00008000, - WS_UNK4000 = 0x00004000, - WS_UNK2000 = 0x00002000, - WS_UNK1000 = 0x00001000, - WS_UNK800 = 0x00000800, - WS_UNK400 = 0x00000400, - WS_UNK200 = 0x00000200, - WS_UNK100 = 0x00000100, - WS_UNK80 = 0x00000080, - WS_UNK40 = 0x00000040, - WS_UNK20 = 0x00000020, - WS_UNK10 = 0x00000010, - WS_UNK8 = 0x00000008, - WS_UNK4 = 0x00000004, - WS_UNK2 = 0x00000002, - WS_UNK1 = 0x00000001, - - //WS_MINIMIZEBOX = 0x00020000, - //WS_MAXIMIZEBOX = 0x00010000, - - //WS_CAPTION = WS_BORDER | WS_DLGFRAME, - //WS_TILED = WS_OVERLAPPED, - //WS_ICONIC = WS_MINIMIZE, - //WS_SIZEBOX = WS_THICKFRAME, - //WS_TILEDWINDOW = WS_OVERLAPPEDWINDOW, - - //WS_OVERLAPPEDWINDOW = WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME | WS_MINIMIZEBOX | WS_MAXIMIZEBOX, - //WS_POPUPWINDOW = WS_POPUP | WS_BORDER | WS_SYSMENU - //WS_CHILDWINDOW = WS_CHILD - } - - [Flags] - [SuppressMessage("ReSharper", "InconsistentNaming")] - public enum ExtendedWindowStyleFlags : uint { - WS_EX_DLGMODALFRAME = 0x00000001, - WS_EX_NOPARENTNOTIFY = 0x00000004, - WS_EX_TOPMOST = 0x00000008, - WS_EX_ACCEPTFILES = 0x00000010, - WS_EX_TRANSPARENT = 0x00000020, - - //#if(WINVER >= 0x0400) - WS_EX_MDICHILD = 0x00000040, - WS_EX_TOOLWINDOW = 0x00000080, - WS_EX_WINDOWEDGE = 0x00000100, - WS_EX_CLIENTEDGE = 0x00000200, - WS_EX_CONTEXTHELP = 0x00000400, - - WS_EX_RIGHT = 0x00001000, - WS_EX_LEFT = 0x00000000, - WS_EX_RTLREADING = 0x00002000, - WS_EX_LTRREADING = 0x00000000, - WS_EX_LEFTSCROLLBAR = 0x00004000, - WS_EX_RIGHTSCROLLBAR = 0x00000000, - - WS_EX_CONTROLPARENT = 0x00010000, - WS_EX_STATICEDGE = 0x00020000, - WS_EX_APPWINDOW = 0x00040000, - - //WS_EX_OVERLAPPEDWINDOW = (WS_EX_WINDOWEDGE | WS_EX_CLIENTEDGE), - //WS_EX_PALETTEWINDOW = (WS_EX_WINDOWEDGE | WS_EX_TOOLWINDOW | WS_EX_TOPMOST), - - WS_EX_LAYERED = 0x00080000, - WS_EX_NOINHERITLAYOUT = 0x00100000, // Disable inheritence of mirroring by children - WS_EX_NOREDIRECTIONBITMAP = 0x00200000, //The window does not render to a redirection surface. This is for windows that do not have visible content or that use mechanisms other than surfaces to provide their visual. - WS_EX_LAYOUTRTL = 0x00400000, // Right to left mirroring - WS_EX_COMPOSITED = 0x02000000, - WS_EX_NOACTIVATE = 0x08000000 // A top-level window created with this style does not become the foreground window when the user clicks it. The system does not bring this window to the foreground when the user minimizes or closes the foreground window. - } - - [Flags] - [SuppressMessage("ReSharper", "InconsistentNaming")] - public enum WindowPlacementFlags : uint { - // The coordinates of the minimized window may be specified. - // This flag must be specified if the coordinates are set in the ptMinPosition member. - WPF_SETMINPOSITION = 0x0001, - // If the calling thread and the thread that owns the window are attached to different input queues, the system posts the request to the thread that owns the window. This prevents the calling thread from blocking its execution while other threads process the request. - WPF_ASYNCWINDOWPLACEMENT = 0x0004, - // The restored window will be maximized, regardless of whether it was maximized before it was minimized. This setting is only valid the next time the window is restored. It does not change the default restoration behavior. - // This flag is only valid when the SW_SHOWMINIMIZED value is specified for the showCmd member. - WPF_RESTORETOMAXIMIZED = 0x0002 - } - - [SuppressMessage("ReSharper", "InconsistentNaming")] - public enum ShowWindowCommand : uint { - /// - /// Hides the window and activates another window. - /// - Hide = 0, - /// - /// Activates and displays a window. If the window is minimized or - /// maximized, the system restores it to its original size and position. - /// An application should specify this flag when displaying the window - /// for the first time. - /// - Normal = 1, - /// - /// Activates the window and displays it as a minimized window. - /// - ShowMinimized = 2, - /// - /// Maximizes the specified window. - /// - Maximize = 3, // is this the right value? - /// - /// Activates the window and displays it as a maximized window. - /// - ShowMaximized = 3, - /// - /// Displays a window in its most recent size and position. This value - /// is similar to , except - /// the window is not actived. - /// - ShowNoActivate = 4, - /// - /// Activates the window and displays it in its current size and position. - /// - Show = 5, - /// - /// Minimizes the specified window and activates the next top-level - /// window in the Z order. - /// - Minimize = 6, - /// - /// Displays the window as a minimized window. This value is similar to - /// , except the - /// window is not activated. - /// - ShowMinNoActive = 7, - /// - /// Displays the window in its current size and position. This value is - /// similar to , except the - /// window is not activated. - /// - ShowNA = 8, - /// - /// Activates and displays the window. If the window is minimized or - /// maximized, the system restores it to its original size and position. - /// An application should specify this flag when restoring a minimized window. - /// - Restore = 9, - /// - /// Sets the show state based on the SW_* value specified in the - /// STARTUPINFO structure passed to the CreateProcess function by the - /// program that started the application. - /// - ShowDefault = 10, - /// - /// Windows 2000/XP: Minimizes a window, even if the thread - /// that owns the window is not responding. This flag should only be - /// used when minimizing windows from a different thread. - /// - ForceMinimize = 11 - } - - [SuppressMessage("ReSharper", "InconsistentNaming")] - public enum SYSCOLOR - { - SCROLLBAR = 0, - BACKGROUND = 1, - DESKTOP = 1, - ACTIVECAPTION = 2, - INACTIVECAPTION = 3, - MENU = 4, - WINDOW = 5, - WINDOWFRAME = 6, - MENUTEXT = 7, - WINDOWTEXT = 8, - CAPTIONTEXT = 9, - ACTIVEBORDER = 10, - INACTIVEBORDER = 11, - APPWORKSPACE = 12, - HIGHLIGHT = 13, - HIGHLIGHTTEXT = 14, - BTNFACE = 15, - THREEDFACE = 15, - BTNSHADOW = 16, - THREEDSHADOW = 16, - GRAYTEXT = 17, - BTNTEXT = 18, - INACTIVECAPTIONTEXT = 19, - BTNHIGHLIGHT = 20, - TREEDHIGHLIGHT = 20, - THREEDHILIGHT = 20, - BTNHILIGHT = 20, - THREEDDKSHADOW = 21, - THREEDLIGHT = 22, - INFOTEXT = 23, - INFOBK = 24 - } - /// - /// Flags used with the Windows API (User32.dll):GetSystemMetrics(SystemMetric smIndex) - /// - /// This Enum and declaration signature was written by Gabriel T. Sharp - /// ai_productions@verizon.net or osirisgothra@hotmail.com - /// Obtained on pinvoke.net, please contribute your code to support the wiki! - /// - [SuppressMessage("ReSharper", "InconsistentNaming")] - public enum SystemMetric - { - /// - /// Width of the screen of the primary display monitor, in pixels. This is the same values obtained by calling GetDeviceCaps as follows: GetDeviceCaps( hdcPrimaryMonitor, HORZRES). - /// - SM_CXSCREEN=0, - /// - /// Height of the screen of the primary display monitor, in pixels. This is the same values obtained by calling GetDeviceCaps as follows: GetDeviceCaps( hdcPrimaryMonitor, VERTRES). - /// - SM_CYSCREEN=1, - /// - /// Width of a horizontal scroll bar, in pixels. - /// - SM_CYVSCROLL=2, - /// - /// Height of a horizontal scroll bar, in pixels. - /// - SM_CXVSCROLL=3, - /// - /// Height of a caption area, in pixels. - /// - SM_CYCAPTION=4, - /// - /// Width of a window border, in pixels. This is equivalent to the SM_CXEDGE value for windows with the 3-D look. - /// - SM_CXBORDER=5, - /// - /// Height of a window border, in pixels. This is equivalent to the SM_CYEDGE value for windows with the 3-D look. - /// - SM_CYBORDER=6, - /// - /// Thickness of the frame around the perimeter of a window that has a caption but is not sizable, in pixels. SM_CXFIXEDFRAME is the height of the horizontal border and SM_CYFIXEDFRAME is the width of the vertical border. - /// - SM_CXDLGFRAME=7, - /// - /// Thickness of the frame around the perimeter of a window that has a caption but is not sizable, in pixels. SM_CXFIXEDFRAME is the height of the horizontal border and SM_CYFIXEDFRAME is the width of the vertical border. - /// - SM_CYDLGFRAME=8, - /// - /// Height of the thumb box in a vertical scroll bar, in pixels - /// - SM_CYVTHUMB=9, - /// - /// Width of the thumb box in a horizontal scroll bar, in pixels. - /// - SM_CXHTHUMB=10, - /// - /// Default width of an icon, in pixels. The LoadIcon function can load only icons with the dimensions specified by SM_CXICON and SM_CYICON - /// - SM_CXICON=11, - /// - /// Default height of an icon, in pixels. The LoadIcon function can load only icons with the dimensions SM_CXICON and SM_CYICON. - /// - SM_CYICON=12, - /// - /// Width of a cursor, in pixels. The system cannot create cursors of other sizes. - /// - SM_CXCURSOR=13, - /// - /// Height of a cursor, in pixels. The system cannot create cursors of other sizes. - /// - SM_CYCURSOR=14, - /// - /// Height of a single-line menu bar, in pixels. - /// - SM_CYMENU=15, - /// - /// Width of the client area for a full-screen window on the primary display monitor, in pixels. To get the coordinates of the portion of the screen not obscured by the system taskbar or by application desktop toolbars, call the SystemParametersInfo function with the SPI_GETWORKAREA value. - /// - SM_CXFULLSCREEN=16, - /// - /// Height of the client area for a full-screen window on the primary display monitor, in pixels. To get the coordinates of the portion of the screen not obscured by the system taskbar or by application desktop toolbars, call the SystemParametersInfo function with the SPI_GETWORKAREA value. - /// - SM_CYFULLSCREEN=17, - /// - /// For double byte character set versions of the system, this is the height of the Kanji window at the bottom of the screen, in pixels - /// - SM_CYKANJIWINDOW=18, - /// - /// Nonzero if a mouse with a wheel is installed; zero otherwise - /// - SM_MOUSEWHEELPRESENT=75, - /// - /// Height of the arrow bitmap on a vertical scroll bar, in pixels. - /// - SM_CYHSCROLL=20, - /// - /// Width of the arrow bitmap on a horizontal scroll bar, in pixels. - /// - SM_CXHSCROLL=21, - /// - /// Nonzero if the debug version of User.exe is installed; zero otherwise. - /// - SM_DEBUG=22, - /// - /// Nonzero if the left and right mouse buttons are reversed; zero otherwise. - /// - SM_SWAPBUTTON=23, - /// - /// Reserved for future use - /// - SM_RESERVED1=24, - /// - /// Reserved for future use - /// - SM_RESERVED2=25, - /// - /// Reserved for future use - /// - SM_RESERVED3=26, - /// - /// Reserved for future use - /// - SM_RESERVED4=27, - /// - /// Minimum width of a window, in pixels. - /// - SM_CXMIN=28, - /// - /// Minimum height of a window, in pixels. - /// - SM_CYMIN=29, - /// - /// Width of a button in a window's caption or title bar, in pixels. - /// - SM_CXSIZE=30, - /// - /// Height of a button in a window's caption or title bar, in pixels. - /// - SM_CYSIZE=31, - /// - /// Thickness of the sizing border around the perimeter of a window that can be resized, in pixels. SM_CXSIZEFRAME is the width of the horizontal border, and SM_CYSIZEFRAME is the height of the vertical border. - /// - SM_CXFRAME=32, - /// - /// Thickness of the sizing border around the perimeter of a window that can be resized, in pixels. SM_CXSIZEFRAME is the width of the horizontal border, and SM_CYSIZEFRAME is the height of the vertical border. - /// - SM_CYFRAME=33, - /// - /// Minimum tracking width of a window, in pixels. The user cannot drag the window frame to a size smaller than these dimensions. A window can override this value by processing the WM_GETMINMAXINFO message. - /// - SM_CXMINTRACK=34, - /// - /// Minimum tracking height of a window, in pixels. The user cannot drag the window frame to a size smaller than these dimensions. A window can override this value by processing the WM_GETMINMAXINFO message - /// - SM_CYMINTRACK=35, - /// - /// Width of the rectangle around the location of a first click in a double-click sequence, in pixels. The second click must occur within the rectangle defined by SM_CXDOUBLECLK and SM_CYDOUBLECLK for the system to consider the two clicks a double-click - /// - SM_CXDOUBLECLK=36, - /// - /// Height of the rectangle around the location of a first click in a double-click sequence, in pixels. The second click must occur within the rectangle defined by SM_CXDOUBLECLK and SM_CYDOUBLECLK for the system to consider the two clicks a double-click. (The two clicks must also occur within a specified time.) - /// - SM_CYDOUBLECLK=37, - /// - /// Width of a grid cell for items in large icon view, in pixels. Each item fits into a rectangle of size SM_CXICONSPACING by SM_CYICONSPACING when arranged. This value is always greater than or equal to SM_CXICON - /// - SM_CXICONSPACING=38, - /// - /// Height of a grid cell for items in large icon view, in pixels. Each item fits into a rectangle of size SM_CXICONSPACING by SM_CYICONSPACING when arranged. This value is always greater than or equal to SM_CYICON. - /// - SM_CYICONSPACING=39, - /// - /// Nonzero if drop-down menus are right-aligned with the corresponding menu-bar item; zero if the menus are left-aligned. - /// - SM_MENUDROPALIGNMENT=40, - /// - /// Nonzero if the Microsoft Windows for Pen computing extensions are installed; zero otherwise. - /// - SM_PENWINDOWS=41, - /// - /// Nonzero if User32.dll supports DBCS; zero otherwise. (WinMe/95/98): Unicode - /// - SM_DBCSENABLED=42, - /// - /// Number of buttons on mouse, or zero if no mouse is installed. - /// - SM_CMOUSEBUTTONS=43, - /// - /// Identical Values Changed After Windows NT 4.0 - /// - SM_CXFIXEDFRAME=SM_CXDLGFRAME, - /// - /// Identical Values Changed After Windows NT 4.0 - /// - SM_CYFIXEDFRAME=SM_CYDLGFRAME, - /// - /// Identical Values Changed After Windows NT 4.0 - /// - SM_CXSIZEFRAME=SM_CXFRAME, - /// - /// Identical Values Changed After Windows NT 4.0 - /// - SM_CYSIZEFRAME=SM_CYFRAME, - /// - /// Nonzero if security is present; zero otherwise. - /// - SM_SECURE=44, - /// - /// Width of a 3-D border, in pixels. This is the 3-D counterpart of SM_CXBORDER - /// - SM_CXEDGE=45, - /// - /// Height of a 3-D border, in pixels. This is the 3-D counterpart of SM_CYBORDER - /// - SM_CYEDGE=46, - /// - /// Width of a grid cell for a minimized window, in pixels. Each minimized window fits into a rectangle this size when arranged. This value is always greater than or equal to SM_CXMINIMIZED. - /// - SM_CXMINSPACING=47, - /// - /// Height of a grid cell for a minimized window, in pixels. Each minimized window fits into a rectangle this size when arranged. This value is always greater than or equal to SM_CYMINIMIZED. - /// - SM_CYMINSPACING=48, - /// - /// Recommended width of a small icon, in pixels. Small icons typically appear in window captions and in small icon view - /// - SM_CXSMICON=49, - /// - /// Recommended height of a small icon, in pixels. Small icons typically appear in window captions and in small icon view. - /// - SM_CYSMICON=50, - /// - /// Height of a small caption, in pixels - /// - SM_CYSMCAPTION=51, - /// - /// Width of small caption buttons, in pixels. - /// - SM_CXSMSIZE=52, - /// - /// Height of small caption buttons, in pixels. - /// - SM_CYSMSIZE=53, - /// - /// Width of menu bar buttons, such as the child window close button used in the multiple document interface, in pixels. - /// - SM_CXMENUSIZE=54, - /// - /// Height of menu bar buttons, such as the child window close button used in the multiple document interface, in pixels. - /// - SM_CYMENUSIZE=55, - /// - /// Flags specifying how the system arranged minimized windows - /// - SM_ARRANGE=56, - /// - /// Width of a minimized window, in pixels. - /// - SM_CXMINIMIZED=57, - /// - /// Height of a minimized window, in pixels. - /// - SM_CYMINIMIZED=58, - /// - /// Default maximum width of a window that has a caption and sizing borders, in pixels. This metric refers to the entire desktop. The user cannot drag the window frame to a size larger than these dimensions. A window can override this value by processing the WM_GETMINMAXINFO message. - /// - SM_CXMAXTRACK=59, - /// - /// Default maximum height of a window that has a caption and sizing borders, in pixels. This metric refers to the entire desktop. The user cannot drag the window frame to a size larger than these dimensions. A window can override this value by processing the WM_GETMINMAXINFO message. - /// - SM_CYMAXTRACK=60, - /// - /// Default width, in pixels, of a maximized top-level window on the primary display monitor. - /// - SM_CXMAXIMIZED=61, - /// - /// Default height, in pixels, of a maximized top-level window on the primary display monitor. - /// - SM_CYMAXIMIZED=62, - /// - /// Least significant bit is set if a network is present; otherwise, it is cleared. The other bits are reserved for future use - /// - SM_NETWORK=63, - /// - /// Value that specifies how the system was started: 0-normal, 1-failsafe, 2-failsafe /w net - /// - SM_CLEANBOOT=67, - /// - /// Width of a rectangle centered on a drag point to allow for limited movement of the mouse pointer before a drag operation begins, in pixels. - /// - SM_CXDRAG=68, - /// - /// Height of a rectangle centered on a drag point to allow for limited movement of the mouse pointer before a drag operation begins. This value is in pixels. It allows the user to click and release the mouse button easily without unintentionally starting a drag operation. - /// - SM_CYDRAG=69, - /// - /// Nonzero if the user requires an application to present information visually in situations where it would otherwise present the information only in audible form; zero otherwise. - /// - SM_SHOWSOUNDS=70, - /// - /// Width of the default menu check-mark bitmap, in pixels. - /// - SM_CXMENUCHECK=71, - /// - /// Height of the default menu check-mark bitmap, in pixels. - /// - SM_CYMENUCHECK=72, - /// - /// Nonzero if the computer has a low-end (slow) processor; zero otherwise - /// - SM_SLOWMACHINE=73, - /// - /// Nonzero if the system is enabled for Hebrew and Arabic languages, zero if not. - /// - SM_MIDEASTENABLED=74, - /// - /// Nonzero if a mouse is installed; zero otherwise. This value is rarely zero, because of support for virtual mice and because some systems detect the presence of the port instead of the presence of a mouse. - /// - SM_MOUSEPRESENT=19, - /// - /// Windows 2000 (v5.0+) Coordinate of the top of the virtual screen - /// - SM_XVIRTUALSCREEN=76, - /// - /// Windows 2000 (v5.0+) Coordinate of the left of the virtual screen - /// - SM_YVIRTUALSCREEN=77, - /// - /// Windows 2000 (v5.0+) Width of the virtual screen - /// - SM_CXVIRTUALSCREEN=78, - /// - /// Windows 2000 (v5.0+) Height of the virtual screen - /// - SM_CYVIRTUALSCREEN=79, - /// - /// Number of display monitors on the desktop - /// - SM_CMONITORS=80, - /// - /// Windows XP (v5.1+) Nonzero if all the display monitors have the same color format, zero otherwise. Note that two displays can have the same bit depth, but different color formats. For example, the red, green, and blue pixels can be encoded with different numbers of bits, or those bits can be located in different places in a pixel's color value. - /// - SM_SAMEDISPLAYFORMAT=81, - /// - /// Windows XP (v5.1+) Nonzero if Input Method Manager/Input Method Editor features are enabled; zero otherwise - /// - SM_IMMENABLED=82, - /// - /// Windows XP (v5.1+) Width of the left and right edges of the focus rectangle drawn by DrawFocusRect. This value is in pixels. - /// - SM_CXFOCUSBORDER=83, - /// - /// Windows XP (v5.1+) Height of the top and bottom edges of the focus rectangle drawn by DrawFocusRect. This value is in pixels. - /// - SM_CYFOCUSBORDER=84, - /// - /// Nonzero if the current operating system is the Windows XP Tablet PC edition, zero if not. - /// - SM_TABLETPC=86, - /// - /// Nonzero if the current operating system is the Windows XP, Media Center Edition, zero if not. - /// - SM_MEDIACENTER=87, - /// - /// Metrics Other - /// - SM_CMETRICS_OTHER=76, - /// - /// Metrics Windows 2000 - /// - SM_CMETRICS_2000=83, - /// - /// Metrics Windows NT - /// - SM_CMETRICS_NT=88, - /// - /// Windows XP (v5.1+) This system metric is used in a Terminal Services environment. If the calling process is associated with a Terminal Services client session, the return value is nonzero. If the calling process is associated with the Terminal Server console session, the return value is zero. The console session is not necessarily the physical console - see WTSGetActiveConsoleSessionId for more information. - /// - SM_REMOTESESSION=0x1000, - /// - /// Windows XP (v5.1+) Nonzero if the current session is shutting down; zero otherwise - /// - SM_SHUTTINGDOWN=0x2000, - /// - /// Windows XP (v5.1+) This system metric is used in a Terminal Services environment. Its value is nonzero if the current session is remotely controlled; zero otherwise - /// - SM_REMOTECONTROL=0x2001 - } - - [SuppressMessage("ReSharper", "InconsistentNaming")] - public enum RegionResult { - REGION_ERROR = 0, - REGION_NULLREGION = 1, - REGION_SIMPLEREGION = 2, - REGION_COMPLEXREGION = 3 - } - - // See http://msdn.microsoft.com/en-us/library/aa969530(v=vs.85).aspx - [SuppressMessage("ReSharper", "InconsistentNaming")] - public enum DWMWINDOWATTRIBUTE { - DWMWA_NCRENDERING_ENABLED = 1, - DWMWA_NCRENDERING_POLICY, - DWMWA_TRANSITIONS_FORCEDISABLED, - DWMWA_ALLOW_NCPAINT, - DWMWA_CAPTION_BUTTON_BOUNDS, - DWMWA_NONCLIENT_RTL_LAYOUT, - DWMWA_FORCE_ICONIC_REPRESENTATION, - DWMWA_FLIP3D_POLICY, - DWMWA_EXTENDED_FRAME_BOUNDS, // This is the one we need for retrieving the Window size since Windows Vista - DWMWA_HAS_ICONIC_BITMAP, // Since Windows 7 - DWMWA_DISALLOW_PEEK, // Since Windows 7 - DWMWA_EXCLUDED_FROM_PEEK, // Since Windows 7 - DWMWA_CLOAK, // Since Windows 8 - DWMWA_CLOAKED, // Since Windows 8 - DWMWA_FREEZE_REPRESENTATION, // Since Windows 8 - DWMWA_LAST - } - - [SuppressMessage("ReSharper", "InconsistentNaming")] - public enum GetWindowCommand : uint { - GW_HWNDFIRST = 0, - GW_HWNDLAST = 1, - GW_HWNDNEXT = 2, - GW_HWNDPREV = 3, - GW_OWNER = 4, - GW_CHILD = 5, - GW_ENABLEDPOPUP = 6 - } - - [Flags] - [SuppressMessage("ReSharper", "InconsistentNaming")] - public enum DWM_BB { - Enable = 1, - BlurRegion = 2, - TransitionMaximized = 4 - } - - [SuppressMessage("ReSharper", "InconsistentNaming")] - public enum ClassLongIndex - { - GCL_CBCLSEXTRA = -20, // the size, in bytes, of the extra memory associated with the class. Setting this value does not change the number of extra bytes already allocated. - GCL_CBWNDEXTRA = -18, // the size, in bytes, of the extra window memory associated with each window in the class. Setting this value does not change the number of extra bytes already allocated. For information on how to access this memory, see SetWindowLong. - GCL_HBRBACKGROUND = -10, // a handle to the background brush associated with the class. - GCL_HCURSOR = -12, // a handle to the cursor associated with the class. - GCL_HICON = -14, // a handle to the icon associated with the class. - GCL_HICONSM = -34, // a handle to the small icon associated with the class. - GCL_HMODULE = -16, // a handle to the module that registered the class. - GCL_MENUNAME = -8, // the address of the menu name string. The string identifies the menu resource associated with the class. - GCL_STYLE = -26, // the window-class style bits. - GCL_WNDPROC = -24, // the address of the window procedure, or a handle representing the address of the window procedure. You must use the CallWindowProc function to call the window procedure. - } - - [SuppressMessage("ReSharper", "InconsistentNaming")] - public enum WindowsMessages - { - WM_NULL = 0x0000, - WM_CREATE = 0x0001, - WM_DESTROY = 0x0002, - WM_MOVE = 0x0003, - WM_SIZE = 0x0005, - WM_ACTIVATE = 0x0006, - WM_SETFOCUS = 0x0007, - WM_KILLFOCUS = 0x0008, - WM_ENABLE = 0x000A, - WM_SETREDRAW = 0x000B, - WM_SETTEXT = 0x000C, - WM_GETTEXT = 0x000D, - WM_GETTEXTLENGTH = 0x000E, - WM_PAINT = 0x000F, - WM_CLOSE = 0x0010, - WM_QUERYENDSESSION = 0x0011, - WM_QUIT = 0x0012, - WM_QUERYOPEN = 0x0013, - WM_ERASEBKGND = 0x0014, - WM_SYSCOLORCHANGE = 0x0015, - WM_ENDSESSION = 0x0016, - WM_SHOWWINDOW = 0x0018, - WM_WININICHANGE = 0x001A, - WM_SETTINGCHANGE = 0x001A, - WM_DEVMODECHANGE = 0x001B, - WM_ACTIVATEAPP = 0x001C, - WM_FONTCHANGE = 0x001D, - WM_TIMECHANGE = 0x001E, - WM_CANCELMODE = 0x001F, - WM_SETCURSOR = 0x0020, - WM_MOUSEACTIVATE = 0x0021, - WM_CHILDACTIVATE = 0x0022, - WM_QUEUESYNC = 0x0023, - WM_GETMINMAXINFO = 0x0024, - WM_PAINTICON = 0x0026, - WM_ICONERASEBKGND = 0x0027, - WM_NEXTDLGCTL = 0x0028, - WM_SPOOLERSTATUS = 0x002A, - WM_DRAWITEM = 0x002B, - WM_MEASUREITEM = 0x002C, - WM_DELETEITEM = 0x002D, - WM_VKEYTOITEM = 0x002E, - WM_CHARTOITEM = 0x002F, - WM_SETFONT = 0x0030, - WM_GETFONT = 0x0031, - WM_SETHOTKEY = 0x0032, - WM_GETHOTKEY = 0x0033, - WM_QUERYDRAGICON = 0x0037, - WM_COMPAREITEM = 0x0039, - WM_GETOBJECT = 0x003D, - WM_COMPACTING = 0x0041, - WM_COMMNOTIFY = 0x0044, - WM_WINDOWPOSCHANGING = 0x0046, - WM_WINDOWPOSCHANGED = 0x0047, - WM_POWER = 0x0048, - WM_COPYDATA = 0x004A, - WM_CANCELJOURNAL = 0x004B, - WM_NOTIFY = 0x004E, - WM_INPUTLANGCHANGEREQUEST = 0x0050, - WM_INPUTLANGCHANGE = 0x0051, - WM_TCARD = 0x0052, - WM_HELP = 0x0053, - WM_USERCHANGED = 0x0054, - WM_NOTIFYFORMAT = 0x0055, - WM_CONTEXTMENU = 0x007B, - WM_STYLECHANGING = 0x007C, - WM_STYLECHANGED = 0x007D, - WM_DISPLAYCHANGE = 0x007E, - WM_GETICON = 0x007F, - WM_SETICON = 0x0080, - WM_NCCREATE = 0x0081, - WM_NCDESTROY = 0x0082, - WM_NCCALCSIZE = 0x0083, - WM_NCHITTEST = 0x0084, - WM_NCPAINT = 0x0085, - WM_NCACTIVATE = 0x0086, - WM_GETDLGCODE = 0x0087, - WM_SYNCPAINT = 0x0088, - WM_NCMOUSEMOVE = 0x00A0, - WM_NCLBUTTONDOWN = 0x00A1, - WM_NCLBUTTONUP = 0x00A2, - WM_NCLBUTTONDBLCLK = 0x00A3, - WM_NCRBUTTONDOWN = 0x00A4, - WM_NCRBUTTONUP = 0x00A5, - WM_NCRBUTTONDBLCLK = 0x00A6, - WM_NCMBUTTONDOWN = 0x00A7, - WM_NCMBUTTONUP = 0x00A8, - WM_NCMBUTTONDBLCLK = 0x00A9, - WM_KEYFIRST = 0x0100, - WM_KEYDOWN = 0x0100, - WM_KEYUP = 0x0101, - WM_CHAR = 0x0102, - WM_DEADCHAR = 0x0103, - WM_SYSKEYDOWN = 0x0104, - WM_SYSKEYUP = 0x0105, - WM_SYSCHAR = 0x0106, - WM_SYSDEADCHAR = 0x0107, - WM_KEYLAST = 0x0108, - WM_IME_STARTCOMPOSITION = 0x010D, - WM_IME_ENDCOMPOSITION = 0x010E, - WM_IME_COMPOSITION = 0x010F, - WM_IME_KEYLAST = 0x010F, - WM_INITDIALOG = 0x0110, - WM_COMMAND = 0x0111, - WM_SYSCOMMAND = 0x0112, - WM_TIMER = 0x0113, - WM_HSCROLL = 0x0114, - WM_VSCROLL = 0x0115, - WM_INITMENU = 0x0116, - WM_INITMENUPOPUP = 0x0117, - WM_MENUSELECT = 0x011F, - WM_MENUCHAR = 0x0120, - WM_ENTERIDLE = 0x0121, - WM_MENURBUTTONUP = 0x0122, - WM_MENUDRAG = 0x0123, - WM_MENUGETOBJECT = 0x0124, - WM_UNINITMENUPOPUP = 0x0125, - WM_MENUCOMMAND = 0x0126, - WM_CTLCOLORMSGBOX = 0x0132, - WM_CTLCOLOREDIT = 0x0133, - WM_CTLCOLORLISTBOX = 0x0134, - WM_CTLCOLORBTN = 0x0135, - WM_CTLCOLORDLG = 0x0136, - WM_CTLCOLORSCROLLBAR = 0x0137, - WM_CTLCOLORSTATIC = 0x0138, - WM_MOUSEMOVE = 0x0200, - WM_MOUSEFIRST = 0x0200, - WM_LBUTTONDOWN = 0x0201, - WM_LBUTTONUP = 0x0202, - WM_LBUTTONDBLCLK = 0x0203, - WM_RBUTTONDOWN = 0x0204, - WM_RBUTTONUP = 0x0205, - WM_RBUTTONDBLCLK = 0x0206, - WM_MBUTTONDOWN = 0x0207, - WM_MBUTTONUP = 0x0208, - WM_MBUTTONDBLCLK = 0x0209, - WM_MOUSEWHEEL = 0x020A, - WM_MOUSELAST = 0x020A, - WM_PARENTNOTIFY = 0x0210, - WM_ENTERMENULOOP = 0x0211, - WM_EXITMENULOOP = 0x0212, - WM_SIZING = 0x0214, - WM_CAPTURECHANGED = 0x0215, - WM_MOVING = 0x0216, - WM_POWERBROADCAST = 0x0218, - WM_DEVICECHANGE = 0x0219, - WM_MDICREATE = 0x0220, - WM_MDIDESTROY = 0x0221, - WM_MDIACTIVATE = 0x0222, - WM_MDIRESTORE = 0x0223, - WM_MDINEXT = 0x0224, - WM_MDIMAXIMIZE = 0x0225, - WM_MDITILE = 0x0226, - WM_MDICASCADE = 0x0227, - WM_MDIICONARRANGE = 0x0228, - WM_MDIGETACTIVE = 0x0229, - WM_MDISETMENU = 0x0230, - WM_ENTERSIZEMOVE = 0x0231, - WM_EXITSIZEMOVE = 0x0232, - WM_DROPFILES = 0x0233, - WM_MDIREFRESHMENU = 0x0234, - WM_IME_SETCONTEXT = 0x0281, - WM_IME_NOTIFY = 0x0282, - WM_IME_CONTROL = 0x0283, - WM_IME_COMPOSITIONFULL = 0x0284, - WM_IME_SELECT = 0x0285, - WM_IME_CHAR = 0x0286, - WM_IME_REQUEST = 0x0288, - WM_IME_KEYDOWN = 0x0290, - WM_IME_KEYUP = 0x0291, - WM_NCMOUSEHOVER = 0x02A0, - WM_MOUSEHOVER = 0x02A1, - WM_NCMOUSELEAVE = 0x02A2, - WM_MOUSELEAVE = 0x02A3, - WM_CUT = 0x0300, - WM_COPY = 0x0301, - WM_PASTE = 0x0302, - WM_CLEAR = 0x0303, - WM_UNDO = 0x0304, - WM_RENDERFORMAT = 0x0305, - WM_RENDERALLFORMATS = 0x0306, - WM_DESTROYCLIPBOARD = 0x0307, - WM_DRAWCLIPBOARD = 0x0308, - WM_PAINTCLIPBOARD = 0x0309, - WM_VSCROLLCLIPBOARD = 0x030A, - WM_SIZECLIPBOARD = 0x030B, - WM_ASKCBFORMATNAME = 0x030C, - WM_CHANGECBCHAIN = 0x030D, - WM_HSCROLLCLIPBOARD = 0x030E, - WM_QUERYNEWPALETTE = 0x030F, - WM_PALETTEISCHANGING = 0x0310, - WM_PALETTECHANGED = 0x0311, - WM_HOTKEY = 0x0312, - WM_PRINT = 0x0317, - WM_PRINTCLIENT = 0x0318, - WM_HANDHELDFIRST = 0x0358, - WM_HANDHELDLAST = 0x035F, - WM_AFXFIRST = 0x0360, - WM_AFXLAST = 0x037F, - WM_PENWINFIRST = 0x0380, - WM_PENWINLAST = 0x038F, - WM_APP = 0x8000, - WM_USER = 0x0400 - } - - // Get/Set WindowLong Enum See: http://msdn.microsoft.com/en-us/library/ms633591.aspx - [SuppressMessage("ReSharper", "InconsistentNaming")] - public enum WindowLongIndex - { - GWL_EXSTYLE = -20, // Sets a new extended window style. - GWL_HINSTANCE = -6, // Sets a new application instance handle. - GWL_ID = -12, // Sets a new identifier of the child window. The window cannot be a top-level window. - GWL_STYLE = -16, // Sets a new window style. - GWL_USERDATA = -21, // Sets the user data associated with the window. This data is intended for use by the application that created the window. Its value is initially zero. - GWL_WNDPROC = -4 // Sets a new address for the window procedure. You cannot change this attribute if the window does not belong to the same process as the calling thread. - } - - // See: http://msdn.microsoft.com/en-us/library/ms633545.aspx - [Flags] - [SuppressMessage("ReSharper", "InconsistentNaming")] - public enum WindowPos - { - SWP_ASYNCWINDOWPOS = 0x4000, // If the calling thread and the thread that owns the window are attached to different input queues, the system posts the request to the thread that owns the window. This prevents the calling thread from blocking its execution while other threads process the request. - SWP_DEFERERASE = 0x2000, // Prevents generation of the WM_SYNCPAINT message. - SWP_DRAWFRAME = 0x0020, // Draws a frame (defined in the window's class description) around the window. - SWP_FRAMECHANGED = 0x0020, //Applies new frame styles set using the SetWindowLong function. Sends a WM_NCCALCSIZE message to the window, even if the window's size is not being changed. If this flag is not specified, WM_NCCALCSIZE is sent only when the window's size is being changed. - SWP_HIDEWINDOW = 0x0080, // Hides the window. - SWP_NOACTIVATE = 0x0010, // Does not activate the window. If this flag is not set, the window is activated and moved to the top of either the topmost or non-topmost group (depending on the setting of the hWndInsertAfter parameter). - SWP_NOCOPYBITS = 0x0100, // Discards the entire contents of the client area. If this flag is not specified, the valid contents of the client area are saved and copied back into the client area after the window is sized or repositioned. - SWP_NOMOVE = 0x0002, //Retains the current position (ignores X and Y parameters). - SWP_NOOWNERZORDER = 0x0200, //Does not change the owner window's position in the Z order. - SWP_NOREDRAW = 0x0008, //Does not redraw changes. If this flag is set, no repainting of any kind occurs. This applies to the client area, the nonclient area (including the title bar and scroll bars), and any part of the parent window uncovered as a result of the window being moved. When this flag is set, the application must explicitly invalidate or redraw any parts of the window and parent window that need redrawing. - SWP_NOREPOSITION = 0x0200, // Same as the SWP_NOOWNERZORDER flag. - SWP_NOSENDCHANGING = 0x0400, //Prevents the window from receiving the WM_WINDOWPOSCHANGING message. - SWP_NOSIZE = 0x0001, // Retains the current size (ignores the cx and cy parameters). - SWP_NOZORDER = 0x0004, // Retains the current Z order (ignores the hWndInsertAfter parameter). - SWP_SHOWWINDOW = 0x0040 //Displays the window. - } - - [SuppressMessage("ReSharper", "InconsistentNaming")] - public enum ScrollBarDirection - { - SB_HORZ = 0, - SB_VERT = 1, - SB_CTL = 2, - SB_BOTH = 3 - } - - [SuppressMessage("ReSharper", "InconsistentNaming")] - public enum ScrollbarCommand - { - SB_LINEUP = 0, // Scrolls one line up. - SB_LINEDOWN = 1, // Scrolls one line down. - SB_PAGEUP = 2, // Scrolls one page up. - SB_PAGEDOWN = 3, // Scrolls one page down. - SB_THUMBPOSITION = 4, // The user has dragged the scroll box (thumb) and released the mouse button. The high-order word indicates the position of the scroll box at the end of the drag operation. - SB_THUMBTRACK = 5, // The user is dragging the scroll box. This message is sent repeatedly until the user releases the mouse button. The high-order word indicates the position that the scroll box has been dragged to. - SB_TOP = 6, // Scrolls to the upper left. - SB_BOTTOM = 7, // Scrolls to the lower right. - SB_ENDSCROLL = 8 // Ends scroll. - } - - [SuppressMessage("ReSharper", "InconsistentNaming")] - public enum ScrollInfoMask { - SIF_RANGE = 0x1, - SIF_PAGE = 0x2, - SIF_POS = 0x4, - SIF_DISABLENOSCROLL = 0x8, - SIF_TRACKPOS = 0x10, - SIF_ALL = SIF_RANGE + SIF_PAGE + SIF_POS + SIF_TRACKPOS - } - - /// - /// See: http://www.pinvoke.net/default.aspx/Enums/SendMessageTimeoutFlags.html - /// - [Flags] - [SuppressMessage("ReSharper", "InconsistentNaming")] - public enum SendMessageTimeoutFlags : uint { - SMTO_NORMAL = 0x0, - SMTO_BLOCK = 0x1, - SMTO_ABORTIFHUNG = 0x2, - SMTO_NOTIMEOUTIFNOTHUNG = 0x8 - } - - [Flags] - [SuppressMessage("ReSharper", "InconsistentNaming")] - public enum ProcessAccessFlags : uint { - All = 0x001F0FFF, - Terminate = 0x00000001, - CreateThread = 0x00000002, - VMOperation = 0x00000008, - VMRead = 0x00000010, - VMWrite = 0x00000020, - DupHandle = 0x00000040, - SetInformation = 0x00000200, - QueryInformation = 0x00000400, - Synchronize = 0x00100000 - } - - /// - /// See: http://msdn.microsoft.com/en-us/library/aa909766.aspx - /// - [Flags] - [SuppressMessage("ReSharper", "InconsistentNaming")] - public enum SoundFlags - { - SND_SYNC = 0x0000, // play synchronously (default) - SND_ASYNC = 0x0001, // play asynchronously - SND_NODEFAULT = 0x0002, // silence (!default) if sound not found - SND_MEMORY = 0x0004, // pszSound points to a memory file - SND_LOOP = 0x0008, // loop the sound until next sndPlaySound - SND_NOSTOP = 0x0010, // don't stop any currently playing sound - SND_NOWAIT = 0x00002000, // don't wait if the driver is busy - SND_ALIAS = 0x00010000, // name is a registry alias - SND_ALIAS_ID = 0x00110000, // alias is a predefined id - SND_FILENAME = 0x00020000, // name is file name - } - - /// - /// Used by GDI32.GetDeviceCaps - /// See: http://msdn.microsoft.com/en-us/library/windows/desktop/dd144877%28v=vs.85%29.aspx - /// - [SuppressMessage("ReSharper", "InconsistentNaming")] - public enum DeviceCaps { - /// - /// Device driver version - /// - DRIVERVERSION = 0, - /// - /// Device classification - /// - TECHNOLOGY = 2, - /// - /// Horizontal size in millimeters - /// - HORZSIZE = 4, - /// - /// Vertical size in millimeters - /// - VERTSIZE = 6, - /// - /// Horizontal width in pixels - /// - HORZRES = 8, - /// - /// Vertical height in pixels - /// - VERTRES = 10, - /// - /// Number of bits per pixel - /// - BITSPIXEL = 12, - /// - /// Number of planes - /// - PLANES = 14, - /// - /// Number of brushes the device has - /// - NUMBRUSHES = 16, - /// - /// Number of pens the device has - /// - NUMPENS = 18, - /// - /// Number of markers the device has - /// - NUMMARKERS = 20, - /// - /// Number of fonts the device has - /// - NUMFONTS = 22, - /// - /// Number of colors the device supports - /// - NUMCOLORS = 24, - /// - /// Size required for device descriptor - /// - PDEVICESIZE = 26, - /// - /// Curve capabilities - /// - CURVECAPS = 28, - /// - /// Line capabilities - /// - LINECAPS = 30, - /// - /// Polygonal capabilities - /// - POLYGONALCAPS = 32, - /// - /// Text capabilities - /// - TEXTCAPS = 34, - /// - /// Clipping capabilities - /// - CLIPCAPS = 36, - /// - /// Bitblt capabilities - /// - RASTERCAPS = 38, - /// - /// Length of the X leg - /// - ASPECTX = 40, - /// - /// Length of the Y leg - /// - ASPECTY = 42, - /// - /// Length of the hypotenuse - /// - ASPECTXY = 44, - /// - /// Shading and Blending caps - /// - SHADEBLENDCAPS = 45, - - /// - /// Logical pixels inch in X - /// - LOGPIXELSX = 88, - /// - /// Logical pixels inch in Y - /// - LOGPIXELSY = 90, - - /// - /// Number of entries in physical palette - /// - SIZEPALETTE = 104, - /// - /// Number of reserved entries in palette - /// - NUMRESERVED = 106, - /// - /// Actual color resolution - /// - COLORRES = 108, - - // Printing related DeviceCaps. These replace the appropriate Escapes - /// - /// Physical Width in device units - /// - PHYSICALWIDTH = 110, - /// - /// Physical Height in device units - /// - PHYSICALHEIGHT = 111, - /// - /// Physical Printable Area x margin - /// - PHYSICALOFFSETX = 112, - /// - /// Physical Printable Area y margin - /// - PHYSICALOFFSETY = 113, - /// - /// Scaling factor x - /// - SCALINGFACTORX = 114, - /// - /// Scaling factor y - /// - SCALINGFACTORY = 115, - - /// - /// Current vertical refresh rate of the display device (for displays only) in Hz - /// - VREFRESH = 116, - /// - /// Horizontal width of entire desktop in pixels - /// - DESKTOPVERTRES = 117, - /// - /// Vertical height of entire desktop in pixels - /// - DESKTOPHORZRES = 118, - /// - /// Preferred blt alignment - /// - BLTALIGNMENT = 119 - } - - /// - /// Used for User32.SetWinEventHook - /// See: http://msdn.microsoft.com/en-us/library/windows/desktop/dd373640%28v=vs.85%29.aspx - /// - [SuppressMessage("ReSharper", "InconsistentNaming"), Flags] - public enum WinEventHookFlags - { - WINEVENT_SKIPOWNTHREAD = 1, - WINEVENT_SKIPOWNPROCESS = 2, - WINEVENT_OUTOFCONTEXT = 0, - WINEVENT_INCONTEXT = 4 - } - - /// - /// Used for User32.SetWinEventHook - /// See MSDN: http://msdn.microsoft.com/en-us/library/windows/desktop/dd318066%28v=vs.85%29.aspx - /// - [SuppressMessage("ReSharper", "InconsistentNaming")] - public enum WinEvent : uint { - EVENT_OBJECT_ACCELERATORCHANGE = 32786, - EVENT_OBJECT_CREATE = 32768, - EVENT_OBJECT_DESTROY = 32769, - EVENT_OBJECT_DEFACTIONCHANGE = 32785, - EVENT_OBJECT_DESCRIPTIONCHANGE = 32781, - EVENT_OBJECT_FOCUS = 32773, - EVENT_OBJECT_HELPCHANGE = 32784, - EVENT_OBJECT_SHOW = 32770, - EVENT_OBJECT_HIDE = 32771, - EVENT_OBJECT_LOCATIONCHANGE = 32779, - EVENT_OBJECT_NAMECHANGE = 32780, - EVENT_OBJECT_PARENTCHANGE = 32783, - EVENT_OBJECT_REORDER = 32772, - EVENT_OBJECT_SELECTION = 32774, - EVENT_OBJECT_SELECTIONADD = 32775, - EVENT_OBJECT_SELECTIONREMOVE = 32776, - EVENT_OBJECT_SELECTIONWITHIN = 32777, - EVENT_OBJECT_STATECHANGE = 32778, - EVENT_OBJECT_VALUECHANGE = 32782, - EVENT_SYSTEM_ALERT = 2, - EVENT_SYSTEM_CAPTUREEND = 9, - EVENT_SYSTEM_CAPTURESTART = 8, - EVENT_SYSTEM_CONTEXTHELPEND = 13, - EVENT_SYSTEM_CONTEXTHELPSTART = 12, - EVENT_SYSTEM_DIALOGEND = 17, - EVENT_SYSTEM_DIALOGSTART = 16, - EVENT_SYSTEM_DRAGDROPEND = 15, - EVENT_SYSTEM_DRAGDROPSTART = 14, - EVENT_SYSTEM_FOREGROUND = 3, - EVENT_SYSTEM_MENUEND = 5, - EVENT_SYSTEM_MENUPOPUPEND = 7, - EVENT_SYSTEM_MENUPOPUPSTART = 6, - EVENT_SYSTEM_MENUSTART = 4, - EVENT_SYSTEM_MINIMIZEEND = 23, - EVENT_SYSTEM_MINIMIZESTART = 22, - EVENT_SYSTEM_MOVESIZEEND = 11, - EVENT_SYSTEM_MOVESIZESTART = 10, - EVENT_SYSTEM_SCROLLINGEND = 19, - EVENT_SYSTEM_SCROLLINGSTART = 18, - EVENT_SYSTEM_SOUND = 1, - EVENT_SYSTEM_SWITCHEND = 21, - EVENT_SYSTEM_SWITCHSTART = 20 - } - - /// - /// Used for User32.SetWinEventHook - /// See: http://msdn.microsoft.com/en-us/library/windows/desktop/dd373606%28v=vs.85%29.aspx#OBJID_WINDOW - /// - [SuppressMessage("ReSharper", "InconsistentNaming")] - public enum EventObjects - { - OBJID_ALERT = -10, - OBJID_CARET = -8, - OBJID_CLIENT = -4, - OBJID_CURSOR = -9, - OBJID_HSCROLL = -6, - OBJID_MENU = -3, - OBJID_SIZEGRIP = -7, - OBJID_SOUND = -11, - OBJID_SYSMENU = -1, - OBJID_TITLEBAR = -2, - OBJID_VSCROLL = -5, - OBJID_WINDOW = 0 - } - - [Flags] - [SuppressMessage("ReSharper", "InconsistentNaming")] - public enum DesktopAccessRight : uint { - DESKTOP_READOBJECTS = 0x00000001, - DESKTOP_CREATEWINDOW = 0x00000002, - DESKTOP_CREATEMENU = 0x00000004, - DESKTOP_HOOKCONTROL = 0x00000008, - DESKTOP_JOURNALRECORD = 0x00000010, - DESKTOP_JOURNALPLAYBACK = 0x00000020, - DESKTOP_ENUMERATE = 0x00000040, - DESKTOP_WRITEOBJECTS = 0x00000080, - DESKTOP_SWITCHDESKTOP = 0x00000100, - - GENERIC_ALL = (DESKTOP_READOBJECTS | DESKTOP_CREATEWINDOW | DESKTOP_CREATEMENU | - DESKTOP_HOOKCONTROL | DESKTOP_JOURNALRECORD | DESKTOP_JOURNALPLAYBACK | - DESKTOP_ENUMERATE | DESKTOP_WRITEOBJECTS | DESKTOP_SWITCHDESKTOP) - }; -} diff --git a/GreenshotPlugin/UnmanagedHelpers/Enums/ClassLongIndex.cs b/GreenshotPlugin/UnmanagedHelpers/Enums/ClassLongIndex.cs new file mode 100644 index 000000000..23c1d0b6f --- /dev/null +++ b/GreenshotPlugin/UnmanagedHelpers/Enums/ClassLongIndex.cs @@ -0,0 +1,19 @@ +using System.Diagnostics.CodeAnalysis; + +namespace GreenshotPlugin.UnmanagedHelpers.Enums +{ + [SuppressMessage("ReSharper", "InconsistentNaming")] + public enum ClassLongIndex + { + GCL_CBCLSEXTRA = -20, // the size, in bytes, of the extra memory associated with the class. Setting this value does not change the number of extra bytes already allocated. + GCL_CBWNDEXTRA = -18, // the size, in bytes, of the extra window memory associated with each window in the class. Setting this value does not change the number of extra bytes already allocated. For information on how to access this memory, see SetWindowLong. + GCL_HBRBACKGROUND = -10, // a handle to the background brush associated with the class. + GCL_HCURSOR = -12, // a handle to the cursor associated with the class. + GCL_HICON = -14, // a handle to the icon associated with the class. + GCL_HICONSM = -34, // a handle to the small icon associated with the class. + GCL_HMODULE = -16, // a handle to the module that registered the class. + GCL_MENUNAME = -8, // the address of the menu name string. The string identifies the menu resource associated with the class. + GCL_STYLE = -26, // the window-class style bits. + GCL_WNDPROC = -24, // the address of the window procedure, or a handle representing the address of the window procedure. You must use the CallWindowProc function to call the window procedure. + } +} \ No newline at end of file diff --git a/GreenshotPlugin/UnmanagedHelpers/DWM.cs b/GreenshotPlugin/UnmanagedHelpers/Enums/DWM.cs similarity index 95% rename from GreenshotPlugin/UnmanagedHelpers/DWM.cs rename to GreenshotPlugin/UnmanagedHelpers/Enums/DWM.cs index 252442c5b..0d8ad5c8e 100644 --- a/GreenshotPlugin/UnmanagedHelpers/DWM.cs +++ b/GreenshotPlugin/UnmanagedHelpers/Enums/DWM.cs @@ -18,12 +18,14 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -using System; -using System.Runtime.InteropServices; -using Microsoft.Win32; -using System.Drawing; -namespace GreenshotPlugin.UnmanagedHelpers { +using System; +using System.Drawing; +using System.Runtime.InteropServices; +using GreenshotPlugin.UnmanagedHelpers.Structs; +using Microsoft.Win32; + +namespace GreenshotPlugin.UnmanagedHelpers.Enums { // See: http://msdn.microsoft.com/en-us/library/aa969502(v=vs.85).aspx [StructLayout(LayoutKind.Sequential)] diff --git a/GreenshotPlugin/UnmanagedHelpers/Enums/DWMWINDOWATTRIBUTE.cs b/GreenshotPlugin/UnmanagedHelpers/Enums/DWMWINDOWATTRIBUTE.cs new file mode 100644 index 000000000..b0ad45084 --- /dev/null +++ b/GreenshotPlugin/UnmanagedHelpers/Enums/DWMWINDOWATTRIBUTE.cs @@ -0,0 +1,24 @@ +using System.Diagnostics.CodeAnalysis; + +namespace GreenshotPlugin.UnmanagedHelpers.Enums +{ + [SuppressMessage("ReSharper", "InconsistentNaming")] + public enum DWMWINDOWATTRIBUTE { + DWMWA_NCRENDERING_ENABLED = 1, + DWMWA_NCRENDERING_POLICY, + DWMWA_TRANSITIONS_FORCEDISABLED, + DWMWA_ALLOW_NCPAINT, + DWMWA_CAPTION_BUTTON_BOUNDS, + DWMWA_NONCLIENT_RTL_LAYOUT, + DWMWA_FORCE_ICONIC_REPRESENTATION, + DWMWA_FLIP3D_POLICY, + DWMWA_EXTENDED_FRAME_BOUNDS, // This is the one we need for retrieving the Window size since Windows Vista + DWMWA_HAS_ICONIC_BITMAP, // Since Windows 7 + DWMWA_DISALLOW_PEEK, // Since Windows 7 + DWMWA_EXCLUDED_FROM_PEEK, // Since Windows 7 + DWMWA_CLOAK, // Since Windows 8 + DWMWA_CLOAKED, // Since Windows 8 + DWMWA_FREEZE_REPRESENTATION, // Since Windows 8 + DWMWA_LAST + } +} \ No newline at end of file diff --git a/GreenshotPlugin/UnmanagedHelpers/Enums/DWM_BB.cs b/GreenshotPlugin/UnmanagedHelpers/Enums/DWM_BB.cs new file mode 100644 index 000000000..416679286 --- /dev/null +++ b/GreenshotPlugin/UnmanagedHelpers/Enums/DWM_BB.cs @@ -0,0 +1,13 @@ +using System; +using System.Diagnostics.CodeAnalysis; + +namespace GreenshotPlugin.UnmanagedHelpers.Enums +{ + [Flags] + [SuppressMessage("ReSharper", "InconsistentNaming")] + public enum DWM_BB { + Enable = 1, + BlurRegion = 2, + TransitionMaximized = 4 + } +} \ No newline at end of file diff --git a/GreenshotPlugin/UnmanagedHelpers/Enums/DesktopAccessRight.cs b/GreenshotPlugin/UnmanagedHelpers/Enums/DesktopAccessRight.cs new file mode 100644 index 000000000..abd70937b --- /dev/null +++ b/GreenshotPlugin/UnmanagedHelpers/Enums/DesktopAccessRight.cs @@ -0,0 +1,23 @@ +using System; +using System.Diagnostics.CodeAnalysis; + +namespace GreenshotPlugin.UnmanagedHelpers.Enums +{ + [Flags] + [SuppressMessage("ReSharper", "InconsistentNaming")] + public enum DesktopAccessRight : uint { + DESKTOP_READOBJECTS = 0x00000001, + DESKTOP_CREATEWINDOW = 0x00000002, + DESKTOP_CREATEMENU = 0x00000004, + DESKTOP_HOOKCONTROL = 0x00000008, + DESKTOP_JOURNALRECORD = 0x00000010, + DESKTOP_JOURNALPLAYBACK = 0x00000020, + DESKTOP_ENUMERATE = 0x00000040, + DESKTOP_WRITEOBJECTS = 0x00000080, + DESKTOP_SWITCHDESKTOP = 0x00000100, + + GENERIC_ALL = (DESKTOP_READOBJECTS | DESKTOP_CREATEWINDOW | DESKTOP_CREATEMENU | + DESKTOP_HOOKCONTROL | DESKTOP_JOURNALRECORD | DESKTOP_JOURNALPLAYBACK | + DESKTOP_ENUMERATE | DESKTOP_WRITEOBJECTS | DESKTOP_SWITCHDESKTOP) + }; +} \ No newline at end of file diff --git a/GreenshotPlugin/UnmanagedHelpers/Enums/DeviceCaps.cs b/GreenshotPlugin/UnmanagedHelpers/Enums/DeviceCaps.cs new file mode 100644 index 000000000..7e40cf277 --- /dev/null +++ b/GreenshotPlugin/UnmanagedHelpers/Enums/DeviceCaps.cs @@ -0,0 +1,173 @@ +using System.Diagnostics.CodeAnalysis; + +namespace GreenshotPlugin.UnmanagedHelpers.Enums +{ + /// + /// Used by GDI32.GetDeviceCaps + /// See: http://msdn.microsoft.com/en-us/library/windows/desktop/dd144877%28v=vs.85%29.aspx + /// + [SuppressMessage("ReSharper", "InconsistentNaming")] + public enum DeviceCaps { + /// + /// Device driver version + /// + DRIVERVERSION = 0, + /// + /// Device classification + /// + TECHNOLOGY = 2, + /// + /// Horizontal size in millimeters + /// + HORZSIZE = 4, + /// + /// Vertical size in millimeters + /// + VERTSIZE = 6, + /// + /// Horizontal width in pixels + /// + HORZRES = 8, + /// + /// Vertical height in pixels + /// + VERTRES = 10, + /// + /// Number of bits per pixel + /// + BITSPIXEL = 12, + /// + /// Number of planes + /// + PLANES = 14, + /// + /// Number of brushes the device has + /// + NUMBRUSHES = 16, + /// + /// Number of pens the device has + /// + NUMPENS = 18, + /// + /// Number of markers the device has + /// + NUMMARKERS = 20, + /// + /// Number of fonts the device has + /// + NUMFONTS = 22, + /// + /// Number of colors the device supports + /// + NUMCOLORS = 24, + /// + /// Size required for device descriptor + /// + PDEVICESIZE = 26, + /// + /// Curve capabilities + /// + CURVECAPS = 28, + /// + /// Line capabilities + /// + LINECAPS = 30, + /// + /// Polygonal capabilities + /// + POLYGONALCAPS = 32, + /// + /// Text capabilities + /// + TEXTCAPS = 34, + /// + /// Clipping capabilities + /// + CLIPCAPS = 36, + /// + /// Bitblt capabilities + /// + RASTERCAPS = 38, + /// + /// Length of the X leg + /// + ASPECTX = 40, + /// + /// Length of the Y leg + /// + ASPECTY = 42, + /// + /// Length of the hypotenuse + /// + ASPECTXY = 44, + /// + /// Shading and Blending caps + /// + SHADEBLENDCAPS = 45, + + /// + /// Logical pixels inch in X + /// + LOGPIXELSX = 88, + /// + /// Logical pixels inch in Y + /// + LOGPIXELSY = 90, + + /// + /// Number of entries in physical palette + /// + SIZEPALETTE = 104, + /// + /// Number of reserved entries in palette + /// + NUMRESERVED = 106, + /// + /// Actual color resolution + /// + COLORRES = 108, + + // Printing related DeviceCaps. These replace the appropriate Escapes + /// + /// Physical Width in device units + /// + PHYSICALWIDTH = 110, + /// + /// Physical Height in device units + /// + PHYSICALHEIGHT = 111, + /// + /// Physical Printable Area x margin + /// + PHYSICALOFFSETX = 112, + /// + /// Physical Printable Area y margin + /// + PHYSICALOFFSETY = 113, + /// + /// Scaling factor x + /// + SCALINGFACTORX = 114, + /// + /// Scaling factor y + /// + SCALINGFACTORY = 115, + + /// + /// Current vertical refresh rate of the display device (for displays only) in Hz + /// + VREFRESH = 116, + /// + /// Horizontal width of entire desktop in pixels + /// + DESKTOPVERTRES = 117, + /// + /// Vertical height of entire desktop in pixels + /// + DESKTOPHORZRES = 118, + /// + /// Preferred blt alignment + /// + BLTALIGNMENT = 119 + } +} \ No newline at end of file diff --git a/GreenshotPlugin/UnmanagedHelpers/Enums/EventObjects.cs b/GreenshotPlugin/UnmanagedHelpers/Enums/EventObjects.cs new file mode 100644 index 000000000..61d890354 --- /dev/null +++ b/GreenshotPlugin/UnmanagedHelpers/Enums/EventObjects.cs @@ -0,0 +1,25 @@ +using System.Diagnostics.CodeAnalysis; + +namespace GreenshotPlugin.UnmanagedHelpers.Enums +{ + /// + /// Used for User32.SetWinEventHook + /// See: http://msdn.microsoft.com/en-us/library/windows/desktop/dd373606%28v=vs.85%29.aspx#OBJID_WINDOW + /// + [SuppressMessage("ReSharper", "InconsistentNaming")] + public enum EventObjects + { + OBJID_ALERT = -10, + OBJID_CARET = -8, + OBJID_CLIENT = -4, + OBJID_CURSOR = -9, + OBJID_HSCROLL = -6, + OBJID_MENU = -3, + OBJID_SIZEGRIP = -7, + OBJID_SOUND = -11, + OBJID_SYSMENU = -1, + OBJID_TITLEBAR = -2, + OBJID_VSCROLL = -5, + OBJID_WINDOW = 0 + } +} \ No newline at end of file diff --git a/GreenshotPlugin/UnmanagedHelpers/Enums/ExtendedWindowStyleFlags.cs b/GreenshotPlugin/UnmanagedHelpers/Enums/ExtendedWindowStyleFlags.cs new file mode 100644 index 000000000..a8897d5bc --- /dev/null +++ b/GreenshotPlugin/UnmanagedHelpers/Enums/ExtendedWindowStyleFlags.cs @@ -0,0 +1,43 @@ +using System; +using System.Diagnostics.CodeAnalysis; + +namespace GreenshotPlugin.UnmanagedHelpers.Enums +{ + [Flags] + [SuppressMessage("ReSharper", "InconsistentNaming")] + public enum ExtendedWindowStyleFlags : uint { + WS_EX_DLGMODALFRAME = 0x00000001, + WS_EX_NOPARENTNOTIFY = 0x00000004, + WS_EX_TOPMOST = 0x00000008, + WS_EX_ACCEPTFILES = 0x00000010, + WS_EX_TRANSPARENT = 0x00000020, + + //#if(WINVER >= 0x0400) + WS_EX_MDICHILD = 0x00000040, + WS_EX_TOOLWINDOW = 0x00000080, + WS_EX_WINDOWEDGE = 0x00000100, + WS_EX_CLIENTEDGE = 0x00000200, + WS_EX_CONTEXTHELP = 0x00000400, + + WS_EX_RIGHT = 0x00001000, + WS_EX_LEFT = 0x00000000, + WS_EX_RTLREADING = 0x00002000, + WS_EX_LTRREADING = 0x00000000, + WS_EX_LEFTSCROLLBAR = 0x00004000, + WS_EX_RIGHTSCROLLBAR = 0x00000000, + + WS_EX_CONTROLPARENT = 0x00010000, + WS_EX_STATICEDGE = 0x00020000, + WS_EX_APPWINDOW = 0x00040000, + + //WS_EX_OVERLAPPEDWINDOW = (WS_EX_WINDOWEDGE | WS_EX_CLIENTEDGE), + //WS_EX_PALETTEWINDOW = (WS_EX_WINDOWEDGE | WS_EX_TOOLWINDOW | WS_EX_TOPMOST), + + WS_EX_LAYERED = 0x00080000, + WS_EX_NOINHERITLAYOUT = 0x00100000, // Disable inheritence of mirroring by children + WS_EX_NOREDIRECTIONBITMAP = 0x00200000, //The window does not render to a redirection surface. This is for windows that do not have visible content or that use mechanisms other than surfaces to provide their visual. + WS_EX_LAYOUTRTL = 0x00400000, // Right to left mirroring + WS_EX_COMPOSITED = 0x02000000, + WS_EX_NOACTIVATE = 0x08000000 // A top-level window created with this style does not become the foreground window when the user clicks it. The system does not bring this window to the foreground when the user minimizes or closes the foreground window. + } +} \ No newline at end of file diff --git a/GreenshotPlugin/UnmanagedHelpers/Enums/GetWindowCommand.cs b/GreenshotPlugin/UnmanagedHelpers/Enums/GetWindowCommand.cs new file mode 100644 index 000000000..51ce444ca --- /dev/null +++ b/GreenshotPlugin/UnmanagedHelpers/Enums/GetWindowCommand.cs @@ -0,0 +1,15 @@ +using System.Diagnostics.CodeAnalysis; + +namespace GreenshotPlugin.UnmanagedHelpers.Enums +{ + [SuppressMessage("ReSharper", "InconsistentNaming")] + public enum GetWindowCommand : uint { + GW_HWNDFIRST = 0, + GW_HWNDLAST = 1, + GW_HWNDNEXT = 2, + GW_HWNDPREV = 3, + GW_OWNER = 4, + GW_CHILD = 5, + GW_ENABLEDPOPUP = 6 + } +} \ No newline at end of file diff --git a/GreenshotPlugin/UnmanagedHelpers/Enums/ProcessAccessFlags.cs b/GreenshotPlugin/UnmanagedHelpers/Enums/ProcessAccessFlags.cs new file mode 100644 index 000000000..79623ec8e --- /dev/null +++ b/GreenshotPlugin/UnmanagedHelpers/Enums/ProcessAccessFlags.cs @@ -0,0 +1,20 @@ +using System; +using System.Diagnostics.CodeAnalysis; + +namespace GreenshotPlugin.UnmanagedHelpers.Enums +{ + [Flags] + [SuppressMessage("ReSharper", "InconsistentNaming")] + public enum ProcessAccessFlags : uint { + All = 0x001F0FFF, + Terminate = 0x00000001, + CreateThread = 0x00000002, + VMOperation = 0x00000008, + VMRead = 0x00000010, + VMWrite = 0x00000020, + DupHandle = 0x00000040, + SetInformation = 0x00000200, + QueryInformation = 0x00000400, + Synchronize = 0x00100000 + } +} \ No newline at end of file diff --git a/GreenshotPlugin/UnmanagedHelpers/Enums/RegionResult.cs b/GreenshotPlugin/UnmanagedHelpers/Enums/RegionResult.cs new file mode 100644 index 000000000..fd07afb1d --- /dev/null +++ b/GreenshotPlugin/UnmanagedHelpers/Enums/RegionResult.cs @@ -0,0 +1,12 @@ +using System.Diagnostics.CodeAnalysis; + +namespace GreenshotPlugin.UnmanagedHelpers.Enums +{ + [SuppressMessage("ReSharper", "InconsistentNaming")] + public enum RegionResult { + REGION_ERROR = 0, + REGION_NULLREGION = 1, + REGION_SIMPLEREGION = 2, + REGION_COMPLEXREGION = 3 + } +} \ No newline at end of file diff --git a/GreenshotPlugin/UnmanagedHelpers/Enums/SYSCOLOR.cs b/GreenshotPlugin/UnmanagedHelpers/Enums/SYSCOLOR.cs new file mode 100644 index 000000000..39f5d506c --- /dev/null +++ b/GreenshotPlugin/UnmanagedHelpers/Enums/SYSCOLOR.cs @@ -0,0 +1,40 @@ +using System.Diagnostics.CodeAnalysis; + +namespace GreenshotPlugin.UnmanagedHelpers.Enums +{ + [SuppressMessage("ReSharper", "InconsistentNaming")] + public enum SYSCOLOR + { + SCROLLBAR = 0, + BACKGROUND = 1, + DESKTOP = 1, + ACTIVECAPTION = 2, + INACTIVECAPTION = 3, + MENU = 4, + WINDOW = 5, + WINDOWFRAME = 6, + MENUTEXT = 7, + WINDOWTEXT = 8, + CAPTIONTEXT = 9, + ACTIVEBORDER = 10, + INACTIVEBORDER = 11, + APPWORKSPACE = 12, + HIGHLIGHT = 13, + HIGHLIGHTTEXT = 14, + BTNFACE = 15, + THREEDFACE = 15, + BTNSHADOW = 16, + THREEDSHADOW = 16, + GRAYTEXT = 17, + BTNTEXT = 18, + INACTIVECAPTIONTEXT = 19, + BTNHIGHLIGHT = 20, + TREEDHIGHLIGHT = 20, + THREEDHILIGHT = 20, + BTNHILIGHT = 20, + THREEDDKSHADOW = 21, + THREEDLIGHT = 22, + INFOTEXT = 23, + INFOBK = 24 + } +} \ No newline at end of file diff --git a/GreenshotPlugin/UnmanagedHelpers/Enums/ScrollBarDirection.cs b/GreenshotPlugin/UnmanagedHelpers/Enums/ScrollBarDirection.cs new file mode 100644 index 000000000..3a76ae2ae --- /dev/null +++ b/GreenshotPlugin/UnmanagedHelpers/Enums/ScrollBarDirection.cs @@ -0,0 +1,13 @@ +using System.Diagnostics.CodeAnalysis; + +namespace GreenshotPlugin.UnmanagedHelpers.Enums +{ + [SuppressMessage("ReSharper", "InconsistentNaming")] + public enum ScrollBarDirection + { + SB_HORZ = 0, + SB_VERT = 1, + SB_CTL = 2, + SB_BOTH = 3 + } +} \ No newline at end of file diff --git a/GreenshotPlugin/UnmanagedHelpers/Enums/ScrollInfoMask.cs b/GreenshotPlugin/UnmanagedHelpers/Enums/ScrollInfoMask.cs new file mode 100644 index 000000000..e7b0d32b2 --- /dev/null +++ b/GreenshotPlugin/UnmanagedHelpers/Enums/ScrollInfoMask.cs @@ -0,0 +1,14 @@ +using System.Diagnostics.CodeAnalysis; + +namespace GreenshotPlugin.UnmanagedHelpers.Enums +{ + [SuppressMessage("ReSharper", "InconsistentNaming")] + public enum ScrollInfoMask { + SIF_RANGE = 0x1, + SIF_PAGE = 0x2, + SIF_POS = 0x4, + SIF_DISABLENOSCROLL = 0x8, + SIF_TRACKPOS = 0x10, + SIF_ALL = SIF_RANGE + SIF_PAGE + SIF_POS + SIF_TRACKPOS + } +} \ No newline at end of file diff --git a/GreenshotPlugin/UnmanagedHelpers/Enums/ScrollbarCommand.cs b/GreenshotPlugin/UnmanagedHelpers/Enums/ScrollbarCommand.cs new file mode 100644 index 000000000..66e1392f2 --- /dev/null +++ b/GreenshotPlugin/UnmanagedHelpers/Enums/ScrollbarCommand.cs @@ -0,0 +1,18 @@ +using System.Diagnostics.CodeAnalysis; + +namespace GreenshotPlugin.UnmanagedHelpers.Enums +{ + [SuppressMessage("ReSharper", "InconsistentNaming")] + public enum ScrollbarCommand + { + SB_LINEUP = 0, // Scrolls one line up. + SB_LINEDOWN = 1, // Scrolls one line down. + SB_PAGEUP = 2, // Scrolls one page up. + SB_PAGEDOWN = 3, // Scrolls one page down. + SB_THUMBPOSITION = 4, // The user has dragged the scroll box (thumb) and released the mouse button. The high-order word indicates the position of the scroll box at the end of the drag operation. + SB_THUMBTRACK = 5, // The user is dragging the scroll box. This message is sent repeatedly until the user releases the mouse button. The high-order word indicates the position that the scroll box has been dragged to. + SB_TOP = 6, // Scrolls to the upper left. + SB_BOTTOM = 7, // Scrolls to the lower right. + SB_ENDSCROLL = 8 // Ends scroll. + } +} \ No newline at end of file diff --git a/GreenshotPlugin/UnmanagedHelpers/Enums/SendMessageTimeoutFlags.cs b/GreenshotPlugin/UnmanagedHelpers/Enums/SendMessageTimeoutFlags.cs new file mode 100644 index 000000000..0b9cc24ca --- /dev/null +++ b/GreenshotPlugin/UnmanagedHelpers/Enums/SendMessageTimeoutFlags.cs @@ -0,0 +1,17 @@ +using System; +using System.Diagnostics.CodeAnalysis; + +namespace GreenshotPlugin.UnmanagedHelpers.Enums +{ + /// + /// See: http://www.pinvoke.net/default.aspx/Enums/SendMessageTimeoutFlags.html + /// + [Flags] + [SuppressMessage("ReSharper", "InconsistentNaming")] + public enum SendMessageTimeoutFlags : uint { + SMTO_NORMAL = 0x0, + SMTO_BLOCK = 0x1, + SMTO_ABORTIFHUNG = 0x2, + SMTO_NOTIMEOUTIFNOTHUNG = 0x8 + } +} \ No newline at end of file diff --git a/GreenshotPlugin/UnmanagedHelpers/Enums/ShowWindowCommand.cs b/GreenshotPlugin/UnmanagedHelpers/Enums/ShowWindowCommand.cs new file mode 100644 index 000000000..0c69e7ea3 --- /dev/null +++ b/GreenshotPlugin/UnmanagedHelpers/Enums/ShowWindowCommand.cs @@ -0,0 +1,76 @@ +using System.Diagnostics.CodeAnalysis; + +namespace GreenshotPlugin.UnmanagedHelpers.Enums +{ + [SuppressMessage("ReSharper", "InconsistentNaming")] + public enum ShowWindowCommand : uint { + /// + /// Hides the window and activates another window. + /// + Hide = 0, + /// + /// Activates and displays a window. If the window is minimized or + /// maximized, the system restores it to its original size and position. + /// An application should specify this flag when displaying the window + /// for the first time. + /// + Normal = 1, + /// + /// Activates the window and displays it as a minimized window. + /// + ShowMinimized = 2, + /// + /// Maximizes the specified window. + /// + Maximize = 3, // is this the right value? + /// + /// Activates the window and displays it as a maximized window. + /// + ShowMaximized = 3, + /// + /// Displays a window in its most recent size and position. This value + /// is similar to , except + /// the window is not actived. + /// + ShowNoActivate = 4, + /// + /// Activates the window and displays it in its current size and position. + /// + Show = 5, + /// + /// Minimizes the specified window and activates the next top-level + /// window in the Z order. + /// + Minimize = 6, + /// + /// Displays the window as a minimized window. This value is similar to + /// , except the + /// window is not activated. + /// + ShowMinNoActive = 7, + /// + /// Displays the window in its current size and position. This value is + /// similar to , except the + /// window is not activated. + /// + ShowNA = 8, + /// + /// Activates and displays the window. If the window is minimized or + /// maximized, the system restores it to its original size and position. + /// An application should specify this flag when restoring a minimized window. + /// + Restore = 9, + /// + /// Sets the show state based on the SW_* value specified in the + /// STARTUPINFO structure passed to the CreateProcess function by the + /// program that started the application. + /// + ShowDefault = 10, + /// + /// Windows 2000/XP: Minimizes a window, even if the thread + /// that owns the window is not responding. This flag should only be + /// used when minimizing windows from a different thread. + /// + ForceMinimize = 11 + } +} \ No newline at end of file diff --git a/GreenshotPlugin/UnmanagedHelpers/Enums/SoundFlags.cs b/GreenshotPlugin/UnmanagedHelpers/Enums/SoundFlags.cs new file mode 100644 index 000000000..67c961381 --- /dev/null +++ b/GreenshotPlugin/UnmanagedHelpers/Enums/SoundFlags.cs @@ -0,0 +1,24 @@ +using System; +using System.Diagnostics.CodeAnalysis; + +namespace GreenshotPlugin.UnmanagedHelpers.Enums +{ + /// + /// See: http://msdn.microsoft.com/en-us/library/aa909766.aspx + /// + [Flags] + [SuppressMessage("ReSharper", "InconsistentNaming")] + public enum SoundFlags + { + SND_SYNC = 0x0000, // play synchronously (default) + SND_ASYNC = 0x0001, // play asynchronously + SND_NODEFAULT = 0x0002, // silence (!default) if sound not found + SND_MEMORY = 0x0004, // pszSound points to a memory file + SND_LOOP = 0x0008, // loop the sound until next sndPlaySound + SND_NOSTOP = 0x0010, // don't stop any currently playing sound + SND_NOWAIT = 0x00002000, // don't wait if the driver is busy + SND_ALIAS = 0x00010000, // name is a registry alias + SND_ALIAS_ID = 0x00110000, // alias is a predefined id + SND_FILENAME = 0x00020000, // name is file name + } +} \ No newline at end of file diff --git a/GreenshotPlugin/UnmanagedHelpers/Enums/SystemMetric.cs b/GreenshotPlugin/UnmanagedHelpers/Enums/SystemMetric.cs new file mode 100644 index 000000000..371cf90a3 --- /dev/null +++ b/GreenshotPlugin/UnmanagedHelpers/Enums/SystemMetric.cs @@ -0,0 +1,392 @@ +using System.Diagnostics.CodeAnalysis; + +namespace GreenshotPlugin.UnmanagedHelpers.Enums +{ + /// + /// Flags used with the Windows API (User32.dll):GetSystemMetrics(SystemMetric smIndex) + /// + /// This Enum and declaration signature was written by Gabriel T. Sharp + /// ai_productions@verizon.net or osirisgothra@hotmail.com + /// Obtained on pinvoke.net, please contribute your code to support the wiki! + /// + [SuppressMessage("ReSharper", "InconsistentNaming")] + public enum SystemMetric + { + /// + /// Width of the screen of the primary display monitor, in pixels. This is the same values obtained by calling GetDeviceCaps as follows: GetDeviceCaps( hdcPrimaryMonitor, HORZRES). + /// + SM_CXSCREEN=0, + /// + /// Height of the screen of the primary display monitor, in pixels. This is the same values obtained by calling GetDeviceCaps as follows: GetDeviceCaps( hdcPrimaryMonitor, VERTRES). + /// + SM_CYSCREEN=1, + /// + /// Width of a horizontal scroll bar, in pixels. + /// + SM_CYVSCROLL=2, + /// + /// Height of a horizontal scroll bar, in pixels. + /// + SM_CXVSCROLL=3, + /// + /// Height of a caption area, in pixels. + /// + SM_CYCAPTION=4, + /// + /// Width of a window border, in pixels. This is equivalent to the SM_CXEDGE value for windows with the 3-D look. + /// + SM_CXBORDER=5, + /// + /// Height of a window border, in pixels. This is equivalent to the SM_CYEDGE value for windows with the 3-D look. + /// + SM_CYBORDER=6, + /// + /// Thickness of the frame around the perimeter of a window that has a caption but is not sizable, in pixels. SM_CXFIXEDFRAME is the height of the horizontal border and SM_CYFIXEDFRAME is the width of the vertical border. + /// + SM_CXDLGFRAME=7, + /// + /// Thickness of the frame around the perimeter of a window that has a caption but is not sizable, in pixels. SM_CXFIXEDFRAME is the height of the horizontal border and SM_CYFIXEDFRAME is the width of the vertical border. + /// + SM_CYDLGFRAME=8, + /// + /// Height of the thumb box in a vertical scroll bar, in pixels + /// + SM_CYVTHUMB=9, + /// + /// Width of the thumb box in a horizontal scroll bar, in pixels. + /// + SM_CXHTHUMB=10, + /// + /// Default width of an icon, in pixels. The LoadIcon function can load only icons with the dimensions specified by SM_CXICON and SM_CYICON + /// + SM_CXICON=11, + /// + /// Default height of an icon, in pixels. The LoadIcon function can load only icons with the dimensions SM_CXICON and SM_CYICON. + /// + SM_CYICON=12, + /// + /// Width of a cursor, in pixels. The system cannot create cursors of other sizes. + /// + SM_CXCURSOR=13, + /// + /// Height of a cursor, in pixels. The system cannot create cursors of other sizes. + /// + SM_CYCURSOR=14, + /// + /// Height of a single-line menu bar, in pixels. + /// + SM_CYMENU=15, + /// + /// Width of the client area for a full-screen window on the primary display monitor, in pixels. To get the coordinates of the portion of the screen not obscured by the system taskbar or by application desktop toolbars, call the SystemParametersInfo function with the SPI_GETWORKAREA value. + /// + SM_CXFULLSCREEN=16, + /// + /// Height of the client area for a full-screen window on the primary display monitor, in pixels. To get the coordinates of the portion of the screen not obscured by the system taskbar or by application desktop toolbars, call the SystemParametersInfo function with the SPI_GETWORKAREA value. + /// + SM_CYFULLSCREEN=17, + /// + /// For double byte character set versions of the system, this is the height of the Kanji window at the bottom of the screen, in pixels + /// + SM_CYKANJIWINDOW=18, + /// + /// Nonzero if a mouse with a wheel is installed; zero otherwise + /// + SM_MOUSEWHEELPRESENT=75, + /// + /// Height of the arrow bitmap on a vertical scroll bar, in pixels. + /// + SM_CYHSCROLL=20, + /// + /// Width of the arrow bitmap on a horizontal scroll bar, in pixels. + /// + SM_CXHSCROLL=21, + /// + /// Nonzero if the debug version of User.exe is installed; zero otherwise. + /// + SM_DEBUG=22, + /// + /// Nonzero if the left and right mouse buttons are reversed; zero otherwise. + /// + SM_SWAPBUTTON=23, + /// + /// Reserved for future use + /// + SM_RESERVED1=24, + /// + /// Reserved for future use + /// + SM_RESERVED2=25, + /// + /// Reserved for future use + /// + SM_RESERVED3=26, + /// + /// Reserved for future use + /// + SM_RESERVED4=27, + /// + /// Minimum width of a window, in pixels. + /// + SM_CXMIN=28, + /// + /// Minimum height of a window, in pixels. + /// + SM_CYMIN=29, + /// + /// Width of a button in a window's caption or title bar, in pixels. + /// + SM_CXSIZE=30, + /// + /// Height of a button in a window's caption or title bar, in pixels. + /// + SM_CYSIZE=31, + /// + /// Thickness of the sizing border around the perimeter of a window that can be resized, in pixels. SM_CXSIZEFRAME is the width of the horizontal border, and SM_CYSIZEFRAME is the height of the vertical border. + /// + SM_CXFRAME=32, + /// + /// Thickness of the sizing border around the perimeter of a window that can be resized, in pixels. SM_CXSIZEFRAME is the width of the horizontal border, and SM_CYSIZEFRAME is the height of the vertical border. + /// + SM_CYFRAME=33, + /// + /// Minimum tracking width of a window, in pixels. The user cannot drag the window frame to a size smaller than these dimensions. A window can override this value by processing the WM_GETMINMAXINFO message. + /// + SM_CXMINTRACK=34, + /// + /// Minimum tracking height of a window, in pixels. The user cannot drag the window frame to a size smaller than these dimensions. A window can override this value by processing the WM_GETMINMAXINFO message + /// + SM_CYMINTRACK=35, + /// + /// Width of the rectangle around the location of a first click in a double-click sequence, in pixels. The second click must occur within the rectangle defined by SM_CXDOUBLECLK and SM_CYDOUBLECLK for the system to consider the two clicks a double-click + /// + SM_CXDOUBLECLK=36, + /// + /// Height of the rectangle around the location of a first click in a double-click sequence, in pixels. The second click must occur within the rectangle defined by SM_CXDOUBLECLK and SM_CYDOUBLECLK for the system to consider the two clicks a double-click. (The two clicks must also occur within a specified time.) + /// + SM_CYDOUBLECLK=37, + /// + /// Width of a grid cell for items in large icon view, in pixels. Each item fits into a rectangle of size SM_CXICONSPACING by SM_CYICONSPACING when arranged. This value is always greater than or equal to SM_CXICON + /// + SM_CXICONSPACING=38, + /// + /// Height of a grid cell for items in large icon view, in pixels. Each item fits into a rectangle of size SM_CXICONSPACING by SM_CYICONSPACING when arranged. This value is always greater than or equal to SM_CYICON. + /// + SM_CYICONSPACING=39, + /// + /// Nonzero if drop-down menus are right-aligned with the corresponding menu-bar item; zero if the menus are left-aligned. + /// + SM_MENUDROPALIGNMENT=40, + /// + /// Nonzero if the Microsoft Windows for Pen computing extensions are installed; zero otherwise. + /// + SM_PENWINDOWS=41, + /// + /// Nonzero if User32.dll supports DBCS; zero otherwise. (WinMe/95/98): Unicode + /// + SM_DBCSENABLED=42, + /// + /// Number of buttons on mouse, or zero if no mouse is installed. + /// + SM_CMOUSEBUTTONS=43, + /// + /// Identical Values Changed After Windows NT 4.0 + /// + SM_CXFIXEDFRAME=SM_CXDLGFRAME, + /// + /// Identical Values Changed After Windows NT 4.0 + /// + SM_CYFIXEDFRAME=SM_CYDLGFRAME, + /// + /// Identical Values Changed After Windows NT 4.0 + /// + SM_CXSIZEFRAME=SM_CXFRAME, + /// + /// Identical Values Changed After Windows NT 4.0 + /// + SM_CYSIZEFRAME=SM_CYFRAME, + /// + /// Nonzero if security is present; zero otherwise. + /// + SM_SECURE=44, + /// + /// Width of a 3-D border, in pixels. This is the 3-D counterpart of SM_CXBORDER + /// + SM_CXEDGE=45, + /// + /// Height of a 3-D border, in pixels. This is the 3-D counterpart of SM_CYBORDER + /// + SM_CYEDGE=46, + /// + /// Width of a grid cell for a minimized window, in pixels. Each minimized window fits into a rectangle this size when arranged. This value is always greater than or equal to SM_CXMINIMIZED. + /// + SM_CXMINSPACING=47, + /// + /// Height of a grid cell for a minimized window, in pixels. Each minimized window fits into a rectangle this size when arranged. This value is always greater than or equal to SM_CYMINIMIZED. + /// + SM_CYMINSPACING=48, + /// + /// Recommended width of a small icon, in pixels. Small icons typically appear in window captions and in small icon view + /// + SM_CXSMICON=49, + /// + /// Recommended height of a small icon, in pixels. Small icons typically appear in window captions and in small icon view. + /// + SM_CYSMICON=50, + /// + /// Height of a small caption, in pixels + /// + SM_CYSMCAPTION=51, + /// + /// Width of small caption buttons, in pixels. + /// + SM_CXSMSIZE=52, + /// + /// Height of small caption buttons, in pixels. + /// + SM_CYSMSIZE=53, + /// + /// Width of menu bar buttons, such as the child window close button used in the multiple document interface, in pixels. + /// + SM_CXMENUSIZE=54, + /// + /// Height of menu bar buttons, such as the child window close button used in the multiple document interface, in pixels. + /// + SM_CYMENUSIZE=55, + /// + /// Flags specifying how the system arranged minimized windows + /// + SM_ARRANGE=56, + /// + /// Width of a minimized window, in pixels. + /// + SM_CXMINIMIZED=57, + /// + /// Height of a minimized window, in pixels. + /// + SM_CYMINIMIZED=58, + /// + /// Default maximum width of a window that has a caption and sizing borders, in pixels. This metric refers to the entire desktop. The user cannot drag the window frame to a size larger than these dimensions. A window can override this value by processing the WM_GETMINMAXINFO message. + /// + SM_CXMAXTRACK=59, + /// + /// Default maximum height of a window that has a caption and sizing borders, in pixels. This metric refers to the entire desktop. The user cannot drag the window frame to a size larger than these dimensions. A window can override this value by processing the WM_GETMINMAXINFO message. + /// + SM_CYMAXTRACK=60, + /// + /// Default width, in pixels, of a maximized top-level window on the primary display monitor. + /// + SM_CXMAXIMIZED=61, + /// + /// Default height, in pixels, of a maximized top-level window on the primary display monitor. + /// + SM_CYMAXIMIZED=62, + /// + /// Least significant bit is set if a network is present; otherwise, it is cleared. The other bits are reserved for future use + /// + SM_NETWORK=63, + /// + /// Value that specifies how the system was started: 0-normal, 1-failsafe, 2-failsafe /w net + /// + SM_CLEANBOOT=67, + /// + /// Width of a rectangle centered on a drag point to allow for limited movement of the mouse pointer before a drag operation begins, in pixels. + /// + SM_CXDRAG=68, + /// + /// Height of a rectangle centered on a drag point to allow for limited movement of the mouse pointer before a drag operation begins. This value is in pixels. It allows the user to click and release the mouse button easily without unintentionally starting a drag operation. + /// + SM_CYDRAG=69, + /// + /// Nonzero if the user requires an application to present information visually in situations where it would otherwise present the information only in audible form; zero otherwise. + /// + SM_SHOWSOUNDS=70, + /// + /// Width of the default menu check-mark bitmap, in pixels. + /// + SM_CXMENUCHECK=71, + /// + /// Height of the default menu check-mark bitmap, in pixels. + /// + SM_CYMENUCHECK=72, + /// + /// Nonzero if the computer has a low-end (slow) processor; zero otherwise + /// + SM_SLOWMACHINE=73, + /// + /// Nonzero if the system is enabled for Hebrew and Arabic languages, zero if not. + /// + SM_MIDEASTENABLED=74, + /// + /// Nonzero if a mouse is installed; zero otherwise. This value is rarely zero, because of support for virtual mice and because some systems detect the presence of the port instead of the presence of a mouse. + /// + SM_MOUSEPRESENT=19, + /// + /// Windows 2000 (v5.0+) Coordinate of the top of the virtual screen + /// + SM_XVIRTUALSCREEN=76, + /// + /// Windows 2000 (v5.0+) Coordinate of the left of the virtual screen + /// + SM_YVIRTUALSCREEN=77, + /// + /// Windows 2000 (v5.0+) Width of the virtual screen + /// + SM_CXVIRTUALSCREEN=78, + /// + /// Windows 2000 (v5.0+) Height of the virtual screen + /// + SM_CYVIRTUALSCREEN=79, + /// + /// Number of display monitors on the desktop + /// + SM_CMONITORS=80, + /// + /// Windows XP (v5.1+) Nonzero if all the display monitors have the same color format, zero otherwise. Note that two displays can have the same bit depth, but different color formats. For example, the red, green, and blue pixels can be encoded with different numbers of bits, or those bits can be located in different places in a pixel's color value. + /// + SM_SAMEDISPLAYFORMAT=81, + /// + /// Windows XP (v5.1+) Nonzero if Input Method Manager/Input Method Editor features are enabled; zero otherwise + /// + SM_IMMENABLED=82, + /// + /// Windows XP (v5.1+) Width of the left and right edges of the focus rectangle drawn by DrawFocusRect. This value is in pixels. + /// + SM_CXFOCUSBORDER=83, + /// + /// Windows XP (v5.1+) Height of the top and bottom edges of the focus rectangle drawn by DrawFocusRect. This value is in pixels. + /// + SM_CYFOCUSBORDER=84, + /// + /// Nonzero if the current operating system is the Windows XP Tablet PC edition, zero if not. + /// + SM_TABLETPC=86, + /// + /// Nonzero if the current operating system is the Windows XP, Media Center Edition, zero if not. + /// + SM_MEDIACENTER=87, + /// + /// Metrics Other + /// + SM_CMETRICS_OTHER=76, + /// + /// Metrics Windows 2000 + /// + SM_CMETRICS_2000=83, + /// + /// Metrics Windows NT + /// + SM_CMETRICS_NT=88, + /// + /// Windows XP (v5.1+) This system metric is used in a Terminal Services environment. If the calling process is associated with a Terminal Services client session, the return value is nonzero. If the calling process is associated with the Terminal Server console session, the return value is zero. The console session is not necessarily the physical console - see WTSGetActiveConsoleSessionId for more information. + /// + SM_REMOTESESSION=0x1000, + /// + /// Windows XP (v5.1+) Nonzero if the current session is shutting down; zero otherwise + /// + SM_SHUTTINGDOWN=0x2000, + /// + /// Windows XP (v5.1+) This system metric is used in a Terminal Services environment. Its value is nonzero if the current session is remotely controlled; zero otherwise + /// + SM_REMOTECONTROL=0x2001 + } +} \ No newline at end of file diff --git a/GreenshotPlugin/UnmanagedHelpers/Enums/ThreadAccess.cs b/GreenshotPlugin/UnmanagedHelpers/Enums/ThreadAccess.cs new file mode 100644 index 000000000..14256ad13 --- /dev/null +++ b/GreenshotPlugin/UnmanagedHelpers/Enums/ThreadAccess.cs @@ -0,0 +1,17 @@ +using System; + +namespace GreenshotPlugin.UnmanagedHelpers.Enums +{ + [Flags] + public enum ThreadAccess : int { + TERMINATE = (0x0001), + SUSPEND_RESUME = (0x0002), + GET_CONTEXT = (0x0008), + SET_CONTEXT = (0x0010), + SET_INFORMATION = (0x0020), + QUERY_INFORMATION = (0x0040), + SET_THREAD_TOKEN = (0x0080), + IMPERSONATE = (0x0100), + DIRECT_IMPERSONATION = (0x0200) + } +} \ No newline at end of file diff --git a/GreenshotPlugin/UnmanagedHelpers/Enums/Win32Error.cs b/GreenshotPlugin/UnmanagedHelpers/Enums/Win32Error.cs new file mode 100644 index 000000000..cf5d43850 --- /dev/null +++ b/GreenshotPlugin/UnmanagedHelpers/Enums/Win32Error.cs @@ -0,0 +1,67 @@ +namespace GreenshotPlugin.UnmanagedHelpers.Enums +{ + /// + /// A Win32 error code. + /// + public enum Win32Error : uint { + Success = 0x0, + InvalidFunction = 0x1, + FileNotFound = 0x2, + PathNotFound = 0x3, + TooManyOpenFiles = 0x4, + AccessDenied = 0x5, + InvalidHandle = 0x6, + ArenaTrashed = 0x7, + NotEnoughMemory = 0x8, + InvalidBlock = 0x9, + BadEnvironment = 0xa, + BadFormat = 0xb, + InvalidAccess = 0xc, + InvalidData = 0xd, + OutOfMemory = 0xe, + InvalidDrive = 0xf, + CurrentDirectory = 0x10, + NotSameDevice = 0x11, + NoMoreFiles = 0x12, + WriteProtect = 0x13, + BadUnit = 0x14, + NotReady = 0x15, + BadCommand = 0x16, + Crc = 0x17, + BadLength = 0x18, + Seek = 0x19, + NotDosDisk = 0x1a, + SectorNotFound = 0x1b, + OutOfPaper = 0x1c, + WriteFault = 0x1d, + ReadFault = 0x1e, + GenFailure = 0x1f, + SharingViolation = 0x20, + LockViolation = 0x21, + WrongDisk = 0x22, + SharingBufferExceeded = 0x24, + HandleEof = 0x26, + HandleDiskFull = 0x27, + NotSupported = 0x32, + RemNotList = 0x33, + DupName = 0x34, + BadNetPath = 0x35, + NetworkBusy = 0x36, + DevNotExist = 0x37, + TooManyCmds = 0x38, + FileExists = 0x50, + CannotMake = 0x52, + AlreadyAssigned = 0x55, + InvalidPassword = 0x56, + InvalidParameter = 0x57, + NetWriteFault = 0x58, + NoProcSlots = 0x59, + TooManySemaphores = 0x64, + ExclSemAlreadyOwned = 0x65, + SemIsSet = 0x66, + TooManySemRequests = 0x67, + InvalidAtInterruptTime = 0x68, + SemOwnerDied = 0x69, + SemUserLimit = 0x6a + } +} \ No newline at end of file diff --git a/GreenshotPlugin/UnmanagedHelpers/Enums/WinEvent.cs b/GreenshotPlugin/UnmanagedHelpers/Enums/WinEvent.cs new file mode 100644 index 000000000..882796a8b --- /dev/null +++ b/GreenshotPlugin/UnmanagedHelpers/Enums/WinEvent.cs @@ -0,0 +1,54 @@ +using System.Diagnostics.CodeAnalysis; + +namespace GreenshotPlugin.UnmanagedHelpers.Enums +{ + /// + /// Used for User32.SetWinEventHook + /// See MSDN: http://msdn.microsoft.com/en-us/library/windows/desktop/dd318066%28v=vs.85%29.aspx + /// + [SuppressMessage("ReSharper", "InconsistentNaming")] + public enum WinEvent : uint { + EVENT_OBJECT_ACCELERATORCHANGE = 32786, + EVENT_OBJECT_CREATE = 32768, + EVENT_OBJECT_DESTROY = 32769, + EVENT_OBJECT_DEFACTIONCHANGE = 32785, + EVENT_OBJECT_DESCRIPTIONCHANGE = 32781, + EVENT_OBJECT_FOCUS = 32773, + EVENT_OBJECT_HELPCHANGE = 32784, + EVENT_OBJECT_SHOW = 32770, + EVENT_OBJECT_HIDE = 32771, + EVENT_OBJECT_LOCATIONCHANGE = 32779, + EVENT_OBJECT_NAMECHANGE = 32780, + EVENT_OBJECT_PARENTCHANGE = 32783, + EVENT_OBJECT_REORDER = 32772, + EVENT_OBJECT_SELECTION = 32774, + EVENT_OBJECT_SELECTIONADD = 32775, + EVENT_OBJECT_SELECTIONREMOVE = 32776, + EVENT_OBJECT_SELECTIONWITHIN = 32777, + EVENT_OBJECT_STATECHANGE = 32778, + EVENT_OBJECT_VALUECHANGE = 32782, + EVENT_SYSTEM_ALERT = 2, + EVENT_SYSTEM_CAPTUREEND = 9, + EVENT_SYSTEM_CAPTURESTART = 8, + EVENT_SYSTEM_CONTEXTHELPEND = 13, + EVENT_SYSTEM_CONTEXTHELPSTART = 12, + EVENT_SYSTEM_DIALOGEND = 17, + EVENT_SYSTEM_DIALOGSTART = 16, + EVENT_SYSTEM_DRAGDROPEND = 15, + EVENT_SYSTEM_DRAGDROPSTART = 14, + EVENT_SYSTEM_FOREGROUND = 3, + EVENT_SYSTEM_MENUEND = 5, + EVENT_SYSTEM_MENUPOPUPEND = 7, + EVENT_SYSTEM_MENUPOPUPSTART = 6, + EVENT_SYSTEM_MENUSTART = 4, + EVENT_SYSTEM_MINIMIZEEND = 23, + EVENT_SYSTEM_MINIMIZESTART = 22, + EVENT_SYSTEM_MOVESIZEEND = 11, + EVENT_SYSTEM_MOVESIZESTART = 10, + EVENT_SYSTEM_SCROLLINGEND = 19, + EVENT_SYSTEM_SCROLLINGSTART = 18, + EVENT_SYSTEM_SOUND = 1, + EVENT_SYSTEM_SWITCHEND = 21, + EVENT_SYSTEM_SWITCHSTART = 20 + } +} \ No newline at end of file diff --git a/GreenshotPlugin/UnmanagedHelpers/Enums/WinEventHookFlags.cs b/GreenshotPlugin/UnmanagedHelpers/Enums/WinEventHookFlags.cs new file mode 100644 index 000000000..4ca58d2df --- /dev/null +++ b/GreenshotPlugin/UnmanagedHelpers/Enums/WinEventHookFlags.cs @@ -0,0 +1,18 @@ +using System; +using System.Diagnostics.CodeAnalysis; + +namespace GreenshotPlugin.UnmanagedHelpers.Enums +{ + /// + /// Used for User32.SetWinEventHook + /// See: http://msdn.microsoft.com/en-us/library/windows/desktop/dd373640%28v=vs.85%29.aspx + /// + [SuppressMessage("ReSharper", "InconsistentNaming"), Flags] + public enum WinEventHookFlags + { + WINEVENT_SKIPOWNTHREAD = 1, + WINEVENT_SKIPOWNPROCESS = 2, + WINEVENT_OUTOFCONTEXT = 0, + WINEVENT_INCONTEXT = 4 + } +} \ No newline at end of file diff --git a/GreenshotPlugin/UnmanagedHelpers/Enums/WindowLongIndex.cs b/GreenshotPlugin/UnmanagedHelpers/Enums/WindowLongIndex.cs new file mode 100644 index 000000000..55622990e --- /dev/null +++ b/GreenshotPlugin/UnmanagedHelpers/Enums/WindowLongIndex.cs @@ -0,0 +1,15 @@ +using System.Diagnostics.CodeAnalysis; + +namespace GreenshotPlugin.UnmanagedHelpers.Enums +{ + [SuppressMessage("ReSharper", "InconsistentNaming")] + public enum WindowLongIndex + { + GWL_EXSTYLE = -20, // Sets a new extended window style. + GWL_HINSTANCE = -6, // Sets a new application instance handle. + GWL_ID = -12, // Sets a new identifier of the child window. The window cannot be a top-level window. + GWL_STYLE = -16, // Sets a new window style. + GWL_USERDATA = -21, // Sets the user data associated with the window. This data is intended for use by the application that created the window. Its value is initially zero. + GWL_WNDPROC = -4 // Sets a new address for the window procedure. You cannot change this attribute if the window does not belong to the same process as the calling thread. + } +} \ No newline at end of file diff --git a/GreenshotPlugin/UnmanagedHelpers/Enums/WindowPlacementFlags.cs b/GreenshotPlugin/UnmanagedHelpers/Enums/WindowPlacementFlags.cs new file mode 100644 index 000000000..7c39ab336 --- /dev/null +++ b/GreenshotPlugin/UnmanagedHelpers/Enums/WindowPlacementFlags.cs @@ -0,0 +1,18 @@ +using System; +using System.Diagnostics.CodeAnalysis; + +namespace GreenshotPlugin.UnmanagedHelpers.Enums +{ + [Flags] + [SuppressMessage("ReSharper", "InconsistentNaming")] + public enum WindowPlacementFlags : uint { + // The coordinates of the minimized window may be specified. + // This flag must be specified if the coordinates are set in the ptMinPosition member. + WPF_SETMINPOSITION = 0x0001, + // If the calling thread and the thread that owns the window are attached to different input queues, the system posts the request to the thread that owns the window. This prevents the calling thread from blocking its execution while other threads process the request. + WPF_ASYNCWINDOWPLACEMENT = 0x0004, + // The restored window will be maximized, regardless of whether it was maximized before it was minimized. This setting is only valid the next time the window is restored. It does not change the default restoration behavior. + // This flag is only valid when the SW_SHOWMINIMIZED value is specified for the showCmd member. + WPF_RESTORETOMAXIMIZED = 0x0002 + } +} \ No newline at end of file diff --git a/GreenshotPlugin/UnmanagedHelpers/Enums/WindowPos.cs b/GreenshotPlugin/UnmanagedHelpers/Enums/WindowPos.cs new file mode 100644 index 000000000..2ae2d248d --- /dev/null +++ b/GreenshotPlugin/UnmanagedHelpers/Enums/WindowPos.cs @@ -0,0 +1,26 @@ +using System; +using System.Diagnostics.CodeAnalysis; + +namespace GreenshotPlugin.UnmanagedHelpers.Enums +{ + [Flags] + [SuppressMessage("ReSharper", "InconsistentNaming")] + public enum WindowPos + { + SWP_ASYNCWINDOWPOS = 0x4000, // If the calling thread and the thread that owns the window are attached to different input queues, the system posts the request to the thread that owns the window. This prevents the calling thread from blocking its execution while other threads process the request. + SWP_DEFERERASE = 0x2000, // Prevents generation of the WM_SYNCPAINT message. + SWP_DRAWFRAME = 0x0020, // Draws a frame (defined in the window's class description) around the window. + SWP_FRAMECHANGED = 0x0020, //Applies new frame styles set using the SetWindowLong function. Sends a WM_NCCALCSIZE message to the window, even if the window's size is not being changed. If this flag is not specified, WM_NCCALCSIZE is sent only when the window's size is being changed. + SWP_HIDEWINDOW = 0x0080, // Hides the window. + SWP_NOACTIVATE = 0x0010, // Does not activate the window. If this flag is not set, the window is activated and moved to the top of either the topmost or non-topmost group (depending on the setting of the hWndInsertAfter parameter). + SWP_NOCOPYBITS = 0x0100, // Discards the entire contents of the client area. If this flag is not specified, the valid contents of the client area are saved and copied back into the client area after the window is sized or repositioned. + SWP_NOMOVE = 0x0002, //Retains the current position (ignores X and Y parameters). + SWP_NOOWNERZORDER = 0x0200, //Does not change the owner window's position in the Z order. + SWP_NOREDRAW = 0x0008, //Does not redraw changes. If this flag is set, no repainting of any kind occurs. This applies to the client area, the nonclient area (including the title bar and scroll bars), and any part of the parent window uncovered as a result of the window being moved. When this flag is set, the application must explicitly invalidate or redraw any parts of the window and parent window that need redrawing. + SWP_NOREPOSITION = 0x0200, // Same as the SWP_NOOWNERZORDER flag. + SWP_NOSENDCHANGING = 0x0400, //Prevents the window from receiving the WM_WINDOWPOSCHANGING message. + SWP_NOSIZE = 0x0001, // Retains the current size (ignores the cx and cy parameters). + SWP_NOZORDER = 0x0004, // Retains the current Z order (ignores the hWndInsertAfter parameter). + SWP_SHOWWINDOW = 0x0040 //Displays the window. + } +} \ No newline at end of file diff --git a/GreenshotPlugin/UnmanagedHelpers/Enums/WindowStyleFlags.cs b/GreenshotPlugin/UnmanagedHelpers/Enums/WindowStyleFlags.cs new file mode 100644 index 000000000..5082f7e0b --- /dev/null +++ b/GreenshotPlugin/UnmanagedHelpers/Enums/WindowStyleFlags.cs @@ -0,0 +1,86 @@ +/* + * Greenshot - a free and open source screenshot tool + * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * + * For more information see: http://getgreenshot.org/ + * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 1 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +using System; +using System.Diagnostics.CodeAnalysis; + +namespace GreenshotPlugin.UnmanagedHelpers.Enums { + /// + /// Window Style Flags + /// + [Flags] + [SuppressMessage("ReSharper", "InconsistentNaming")] + public enum WindowStyleFlags : long { + //WS_OVERLAPPED = 0x00000000, + WS_POPUP = 0x80000000, + WS_CHILD = 0x40000000, + WS_MINIMIZE = 0x20000000, + WS_VISIBLE = 0x10000000, + WS_DISABLED = 0x08000000, + WS_CLIPSIBLINGS = 0x04000000, + WS_CLIPCHILDREN = 0x02000000, + WS_MAXIMIZE = 0x01000000, + WS_BORDER = 0x00800000, + WS_DLGFRAME = 0x00400000, + WS_VSCROLL = 0x00200000, + WS_HSCROLL = 0x00100000, + WS_SYSMENU = 0x00080000, + WS_THICKFRAME = 0x00040000, + WS_GROUP = 0x00020000, + WS_TABSTOP = 0x00010000, + + WS_UNK8000 = 0x00008000, + WS_UNK4000 = 0x00004000, + WS_UNK2000 = 0x00002000, + WS_UNK1000 = 0x00001000, + WS_UNK800 = 0x00000800, + WS_UNK400 = 0x00000400, + WS_UNK200 = 0x00000200, + WS_UNK100 = 0x00000100, + WS_UNK80 = 0x00000080, + WS_UNK40 = 0x00000040, + WS_UNK20 = 0x00000020, + WS_UNK10 = 0x00000010, + WS_UNK8 = 0x00000008, + WS_UNK4 = 0x00000004, + WS_UNK2 = 0x00000002, + WS_UNK1 = 0x00000001, + + //WS_MINIMIZEBOX = 0x00020000, + //WS_MAXIMIZEBOX = 0x00010000, + + //WS_CAPTION = WS_BORDER | WS_DLGFRAME, + //WS_TILED = WS_OVERLAPPED, + //WS_ICONIC = WS_MINIMIZE, + //WS_SIZEBOX = WS_THICKFRAME, + //WS_TILEDWINDOW = WS_OVERLAPPEDWINDOW, + + //WS_OVERLAPPEDWINDOW = WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME | WS_MINIMIZEBOX | WS_MAXIMIZEBOX, + //WS_POPUPWINDOW = WS_POPUP | WS_BORDER | WS_SYSMENU + //WS_CHILDWINDOW = WS_CHILD + } + + // See http://msdn.microsoft.com/en-us/library/aa969530(v=vs.85).aspx + + // Get/Set WindowLong Enum See: http://msdn.microsoft.com/en-us/library/ms633591.aspx + + // See: http://msdn.microsoft.com/en-us/library/ms633545.aspx +} diff --git a/GreenshotPlugin/UnmanagedHelpers/Enums/WindowsMessages.cs b/GreenshotPlugin/UnmanagedHelpers/Enums/WindowsMessages.cs new file mode 100644 index 000000000..72e5c61de --- /dev/null +++ b/GreenshotPlugin/UnmanagedHelpers/Enums/WindowsMessages.cs @@ -0,0 +1,212 @@ +using System.Diagnostics.CodeAnalysis; + +namespace GreenshotPlugin.UnmanagedHelpers.Enums +{ + [SuppressMessage("ReSharper", "InconsistentNaming")] + public enum WindowsMessages + { + WM_NULL = 0x0000, + WM_CREATE = 0x0001, + WM_DESTROY = 0x0002, + WM_MOVE = 0x0003, + WM_SIZE = 0x0005, + WM_ACTIVATE = 0x0006, + WM_SETFOCUS = 0x0007, + WM_KILLFOCUS = 0x0008, + WM_ENABLE = 0x000A, + WM_SETREDRAW = 0x000B, + WM_SETTEXT = 0x000C, + WM_GETTEXT = 0x000D, + WM_GETTEXTLENGTH = 0x000E, + WM_PAINT = 0x000F, + WM_CLOSE = 0x0010, + WM_QUERYENDSESSION = 0x0011, + WM_QUIT = 0x0012, + WM_QUERYOPEN = 0x0013, + WM_ERASEBKGND = 0x0014, + WM_SYSCOLORCHANGE = 0x0015, + WM_ENDSESSION = 0x0016, + WM_SHOWWINDOW = 0x0018, + WM_WININICHANGE = 0x001A, + WM_SETTINGCHANGE = 0x001A, + WM_DEVMODECHANGE = 0x001B, + WM_ACTIVATEAPP = 0x001C, + WM_FONTCHANGE = 0x001D, + WM_TIMECHANGE = 0x001E, + WM_CANCELMODE = 0x001F, + WM_SETCURSOR = 0x0020, + WM_MOUSEACTIVATE = 0x0021, + WM_CHILDACTIVATE = 0x0022, + WM_QUEUESYNC = 0x0023, + WM_GETMINMAXINFO = 0x0024, + WM_PAINTICON = 0x0026, + WM_ICONERASEBKGND = 0x0027, + WM_NEXTDLGCTL = 0x0028, + WM_SPOOLERSTATUS = 0x002A, + WM_DRAWITEM = 0x002B, + WM_MEASUREITEM = 0x002C, + WM_DELETEITEM = 0x002D, + WM_VKEYTOITEM = 0x002E, + WM_CHARTOITEM = 0x002F, + WM_SETFONT = 0x0030, + WM_GETFONT = 0x0031, + WM_SETHOTKEY = 0x0032, + WM_GETHOTKEY = 0x0033, + WM_QUERYDRAGICON = 0x0037, + WM_COMPAREITEM = 0x0039, + WM_GETOBJECT = 0x003D, + WM_COMPACTING = 0x0041, + WM_COMMNOTIFY = 0x0044, + WM_WINDOWPOSCHANGING = 0x0046, + WM_WINDOWPOSCHANGED = 0x0047, + WM_POWER = 0x0048, + WM_COPYDATA = 0x004A, + WM_CANCELJOURNAL = 0x004B, + WM_NOTIFY = 0x004E, + WM_INPUTLANGCHANGEREQUEST = 0x0050, + WM_INPUTLANGCHANGE = 0x0051, + WM_TCARD = 0x0052, + WM_HELP = 0x0053, + WM_USERCHANGED = 0x0054, + WM_NOTIFYFORMAT = 0x0055, + WM_CONTEXTMENU = 0x007B, + WM_STYLECHANGING = 0x007C, + WM_STYLECHANGED = 0x007D, + WM_DISPLAYCHANGE = 0x007E, + WM_GETICON = 0x007F, + WM_SETICON = 0x0080, + WM_NCCREATE = 0x0081, + WM_NCDESTROY = 0x0082, + WM_NCCALCSIZE = 0x0083, + WM_NCHITTEST = 0x0084, + WM_NCPAINT = 0x0085, + WM_NCACTIVATE = 0x0086, + WM_GETDLGCODE = 0x0087, + WM_SYNCPAINT = 0x0088, + WM_NCMOUSEMOVE = 0x00A0, + WM_NCLBUTTONDOWN = 0x00A1, + WM_NCLBUTTONUP = 0x00A2, + WM_NCLBUTTONDBLCLK = 0x00A3, + WM_NCRBUTTONDOWN = 0x00A4, + WM_NCRBUTTONUP = 0x00A5, + WM_NCRBUTTONDBLCLK = 0x00A6, + WM_NCMBUTTONDOWN = 0x00A7, + WM_NCMBUTTONUP = 0x00A8, + WM_NCMBUTTONDBLCLK = 0x00A9, + WM_KEYFIRST = 0x0100, + WM_KEYDOWN = 0x0100, + WM_KEYUP = 0x0101, + WM_CHAR = 0x0102, + WM_DEADCHAR = 0x0103, + WM_SYSKEYDOWN = 0x0104, + WM_SYSKEYUP = 0x0105, + WM_SYSCHAR = 0x0106, + WM_SYSDEADCHAR = 0x0107, + WM_KEYLAST = 0x0108, + WM_IME_STARTCOMPOSITION = 0x010D, + WM_IME_ENDCOMPOSITION = 0x010E, + WM_IME_COMPOSITION = 0x010F, + WM_IME_KEYLAST = 0x010F, + WM_INITDIALOG = 0x0110, + WM_COMMAND = 0x0111, + WM_SYSCOMMAND = 0x0112, + WM_TIMER = 0x0113, + WM_HSCROLL = 0x0114, + WM_VSCROLL = 0x0115, + WM_INITMENU = 0x0116, + WM_INITMENUPOPUP = 0x0117, + WM_MENUSELECT = 0x011F, + WM_MENUCHAR = 0x0120, + WM_ENTERIDLE = 0x0121, + WM_MENURBUTTONUP = 0x0122, + WM_MENUDRAG = 0x0123, + WM_MENUGETOBJECT = 0x0124, + WM_UNINITMENUPOPUP = 0x0125, + WM_MENUCOMMAND = 0x0126, + WM_CTLCOLORMSGBOX = 0x0132, + WM_CTLCOLOREDIT = 0x0133, + WM_CTLCOLORLISTBOX = 0x0134, + WM_CTLCOLORBTN = 0x0135, + WM_CTLCOLORDLG = 0x0136, + WM_CTLCOLORSCROLLBAR = 0x0137, + WM_CTLCOLORSTATIC = 0x0138, + WM_MOUSEMOVE = 0x0200, + WM_MOUSEFIRST = 0x0200, + WM_LBUTTONDOWN = 0x0201, + WM_LBUTTONUP = 0x0202, + WM_LBUTTONDBLCLK = 0x0203, + WM_RBUTTONDOWN = 0x0204, + WM_RBUTTONUP = 0x0205, + WM_RBUTTONDBLCLK = 0x0206, + WM_MBUTTONDOWN = 0x0207, + WM_MBUTTONUP = 0x0208, + WM_MBUTTONDBLCLK = 0x0209, + WM_MOUSEWHEEL = 0x020A, + WM_MOUSELAST = 0x020A, + WM_PARENTNOTIFY = 0x0210, + WM_ENTERMENULOOP = 0x0211, + WM_EXITMENULOOP = 0x0212, + WM_SIZING = 0x0214, + WM_CAPTURECHANGED = 0x0215, + WM_MOVING = 0x0216, + WM_POWERBROADCAST = 0x0218, + WM_DEVICECHANGE = 0x0219, + WM_MDICREATE = 0x0220, + WM_MDIDESTROY = 0x0221, + WM_MDIACTIVATE = 0x0222, + WM_MDIRESTORE = 0x0223, + WM_MDINEXT = 0x0224, + WM_MDIMAXIMIZE = 0x0225, + WM_MDITILE = 0x0226, + WM_MDICASCADE = 0x0227, + WM_MDIICONARRANGE = 0x0228, + WM_MDIGETACTIVE = 0x0229, + WM_MDISETMENU = 0x0230, + WM_ENTERSIZEMOVE = 0x0231, + WM_EXITSIZEMOVE = 0x0232, + WM_DROPFILES = 0x0233, + WM_MDIREFRESHMENU = 0x0234, + WM_IME_SETCONTEXT = 0x0281, + WM_IME_NOTIFY = 0x0282, + WM_IME_CONTROL = 0x0283, + WM_IME_COMPOSITIONFULL = 0x0284, + WM_IME_SELECT = 0x0285, + WM_IME_CHAR = 0x0286, + WM_IME_REQUEST = 0x0288, + WM_IME_KEYDOWN = 0x0290, + WM_IME_KEYUP = 0x0291, + WM_NCMOUSEHOVER = 0x02A0, + WM_MOUSEHOVER = 0x02A1, + WM_NCMOUSELEAVE = 0x02A2, + WM_MOUSELEAVE = 0x02A3, + WM_CUT = 0x0300, + WM_COPY = 0x0301, + WM_PASTE = 0x0302, + WM_CLEAR = 0x0303, + WM_UNDO = 0x0304, + WM_RENDERFORMAT = 0x0305, + WM_RENDERALLFORMATS = 0x0306, + WM_DESTROYCLIPBOARD = 0x0307, + WM_DRAWCLIPBOARD = 0x0308, + WM_PAINTCLIPBOARD = 0x0309, + WM_VSCROLLCLIPBOARD = 0x030A, + WM_SIZECLIPBOARD = 0x030B, + WM_ASKCBFORMATNAME = 0x030C, + WM_CHANGECBCHAIN = 0x030D, + WM_HSCROLLCLIPBOARD = 0x030E, + WM_QUERYNEWPALETTE = 0x030F, + WM_PALETTEISCHANGING = 0x0310, + WM_PALETTECHANGED = 0x0311, + WM_HOTKEY = 0x0312, + WM_PRINT = 0x0317, + WM_PRINTCLIENT = 0x0318, + WM_HANDHELDFIRST = 0x0358, + WM_HANDHELDLAST = 0x035F, + WM_AFXFIRST = 0x0360, + WM_AFXLAST = 0x037F, + WM_PENWINFIRST = 0x0380, + WM_PENWINLAST = 0x038F, + WM_APP = 0x8000, + WM_USER = 0x0400 + } +} \ No newline at end of file diff --git a/GreenshotPlugin/UnmanagedHelpers/GDI32.cs b/GreenshotPlugin/UnmanagedHelpers/GDI32.cs index 8c426f692..ed064e835 100644 --- a/GreenshotPlugin/UnmanagedHelpers/GDI32.cs +++ b/GreenshotPlugin/UnmanagedHelpers/GDI32.cs @@ -23,6 +23,7 @@ using System; using System.Drawing; using System.Runtime.InteropServices; using System.Security; +using GreenshotPlugin.UnmanagedHelpers.Enums; using Microsoft.Win32.SafeHandles; namespace GreenshotPlugin.UnmanagedHelpers { diff --git a/GreenshotPlugin/UnmanagedHelpers/GDIplus.cs b/GreenshotPlugin/UnmanagedHelpers/GDIplus.cs index 708b5e06e..e0bbed83c 100644 --- a/GreenshotPlugin/UnmanagedHelpers/GDIplus.cs +++ b/GreenshotPlugin/UnmanagedHelpers/GDIplus.cs @@ -25,6 +25,7 @@ using log4net; using System.Reflection; using System.Drawing.Drawing2D; using System.Drawing.Imaging; +using GreenshotPlugin.UnmanagedHelpers.Structs; namespace GreenshotPlugin.UnmanagedHelpers { /// diff --git a/GreenshotPlugin/UnmanagedHelpers/Kernel32.cs b/GreenshotPlugin/UnmanagedHelpers/Kernel32.cs index eab2847b7..c877db6dd 100644 --- a/GreenshotPlugin/UnmanagedHelpers/Kernel32.cs +++ b/GreenshotPlugin/UnmanagedHelpers/Kernel32.cs @@ -21,21 +21,10 @@ using System; using System.Runtime.InteropServices; using System.Text; +using GreenshotPlugin.UnmanagedHelpers.Enums; namespace GreenshotPlugin.UnmanagedHelpers { - [Flags] - public enum ThreadAccess : int { - TERMINATE = (0x0001), - SUSPEND_RESUME = (0x0002), - GET_CONTEXT = (0x0008), - SET_CONTEXT = (0x0010), - SET_INFORMATION = (0x0020), - QUERY_INFORMATION = (0x0040), - SET_THREAD_TOKEN = (0x0080), - IMPERSONATE = (0x0100), - DIRECT_IMPERSONATION = (0x0200) - } - /// + /// /// Description of Kernel32. /// public class Kernel32 { diff --git a/GreenshotPlugin/UnmanagedHelpers/SafeCurrentInputDesktopHandle.cs b/GreenshotPlugin/UnmanagedHelpers/SafeCurrentInputDesktopHandle.cs new file mode 100644 index 000000000..6a4d02617 --- /dev/null +++ b/GreenshotPlugin/UnmanagedHelpers/SafeCurrentInputDesktopHandle.cs @@ -0,0 +1,36 @@ +using System; +using System.Security.Permissions; +using GreenshotPlugin.UnmanagedHelpers.Enums; +using log4net; +using Microsoft.Win32.SafeHandles; + +namespace GreenshotPlugin.UnmanagedHelpers +{ + /// + /// A SafeHandle class implementation for the current input desktop + /// + public class SafeCurrentInputDesktopHandle : SafeHandleZeroOrMinusOneIsInvalid { + private static readonly ILog LOG = LogManager.GetLogger(typeof(SafeCurrentInputDesktopHandle)); + + public SafeCurrentInputDesktopHandle() : base(true) { + IntPtr hDesktop = User32.OpenInputDesktop(0, true, DesktopAccessRight.GENERIC_ALL); + if (hDesktop != IntPtr.Zero) { + SetHandle(hDesktop); + if (User32.SetThreadDesktop(hDesktop)) { + LOG.DebugFormat("Switched to desktop {0}", hDesktop); + } else { + LOG.WarnFormat("Couldn't switch to desktop {0}", hDesktop); + LOG.Error(User32.CreateWin32Exception("SetThreadDesktop")); + } + } else { + LOG.Warn("Couldn't get current desktop."); + LOG.Error(User32.CreateWin32Exception("OpenInputDesktop")); + } + } + + [SecurityPermission(SecurityAction.LinkDemand, UnmanagedCode = true)] + protected override bool ReleaseHandle() { + return User32.CloseDesktop(handle); + } + } +} \ No newline at end of file diff --git a/GreenshotPlugin/UnmanagedHelpers/SafeIconHandle.cs b/GreenshotPlugin/UnmanagedHelpers/SafeIconHandle.cs new file mode 100644 index 000000000..dbd3ef2a3 --- /dev/null +++ b/GreenshotPlugin/UnmanagedHelpers/SafeIconHandle.cs @@ -0,0 +1,31 @@ +using System; +using System.Security; +using System.Security.Permissions; +using Microsoft.Win32.SafeHandles; + +namespace GreenshotPlugin.UnmanagedHelpers +{ + /// + /// A SafeHandle class implementation for the hIcon + /// + public class SafeIconHandle : SafeHandleZeroOrMinusOneIsInvalid { + + /// + /// Needed for marshalling return values + /// + [SecurityCritical] + public SafeIconHandle() : base(true) + { + } + + + public SafeIconHandle(IntPtr hIcon) : base(true) { + SetHandle(hIcon); + } + + [SecurityPermission(SecurityAction.LinkDemand, UnmanagedCode = true)] + protected override bool ReleaseHandle() { + return User32.DestroyIcon(handle); + } + } +} \ No newline at end of file diff --git a/GreenshotPlugin/UnmanagedHelpers/SafeWindowDcHandle.cs b/GreenshotPlugin/UnmanagedHelpers/SafeWindowDcHandle.cs new file mode 100644 index 000000000..d9371ee4b --- /dev/null +++ b/GreenshotPlugin/UnmanagedHelpers/SafeWindowDcHandle.cs @@ -0,0 +1,60 @@ +using System; +using System.Runtime.InteropServices; +using System.Security; +using System.Security.Permissions; +using Microsoft.Win32.SafeHandles; + +namespace GreenshotPlugin.UnmanagedHelpers +{ + /// + /// A WindowDC SafeHandle implementation + /// + public class SafeWindowDcHandle : SafeHandleZeroOrMinusOneIsInvalid { + [DllImport("user32", SetLastError = true)] + private static extern IntPtr GetWindowDC(IntPtr hWnd); + [DllImport("user32", SetLastError = true)] + private static extern bool ReleaseDC(IntPtr hWnd, IntPtr hDC); + + private readonly IntPtr _hWnd; + + /// + /// Needed for marshalling return values + /// + public SafeWindowDcHandle() : base(true) + { + } + + [SecurityCritical] + public SafeWindowDcHandle(IntPtr hWnd, IntPtr preexistingHandle) : base(true) { + _hWnd = hWnd; + SetHandle(preexistingHandle); + } + + [SecurityPermission(SecurityAction.LinkDemand, UnmanagedCode=true)] + protected override bool ReleaseHandle() { + bool returnValue = ReleaseDC(_hWnd, handle); + return returnValue; + } + + /// + /// Creates a DC as SafeWindowDcHandle for the whole of the specified hWnd + /// + /// IntPtr + /// SafeWindowDcHandle + public static SafeWindowDcHandle FromWindow(IntPtr hWnd) + { + if (hWnd == IntPtr.Zero) + { + return null; + } + var hDcDesktop = GetWindowDC(hWnd); + return new SafeWindowDcHandle(hWnd, hDcDesktop); + } + + public static SafeWindowDcHandle FromDesktop() { + IntPtr hWndDesktop = User32.GetDesktopWindow(); + IntPtr hDCDesktop = GetWindowDC(hWndDesktop); + return new SafeWindowDcHandle(hWndDesktop, hDCDesktop); + } + } +} \ No newline at end of file diff --git a/GreenshotPlugin/UnmanagedHelpers/Structs.cs b/GreenshotPlugin/UnmanagedHelpers/Structs.cs deleted file mode 100644 index 499c4f8c6..000000000 --- a/GreenshotPlugin/UnmanagedHelpers/Structs.cs +++ /dev/null @@ -1,414 +0,0 @@ -/* - * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom - * - * For more information see: http://getgreenshot.org/ - * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 1 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -using System; -using System.Drawing; -using System.Runtime.InteropServices; - -namespace GreenshotPlugin.UnmanagedHelpers { - [StructLayout(LayoutKind.Sequential), Serializable()] - public struct SIZE { - public int Width; - public int Height; - public SIZE(Size size) : this(size.Width, size.Height) { - - } - - public SIZE(int width, int height) { - Width = width; - Height = height; - } - - public Size ToSize() { - return new Size(Width, Height); - } - } - [StructLayout(LayoutKind.Sequential), Serializable()] - public struct POINT { - public int X; - public int Y; - - public POINT(int x, int y) { - X = x; - Y = y; - } - public POINT(Point point) { - X = point.X; - Y = point.Y; - } - - public static implicit operator Point(POINT p) { - return new Point(p.X, p.Y); - } - - public static implicit operator POINT(Point p) { - return new POINT(p.X, p.Y); - } - - public Point ToPoint() { - return new Point(X, Y); - } - - public override string ToString() { - return X + "," + Y; - } - } - - [StructLayout(LayoutKind.Sequential), Serializable()] - public struct RECT { - private int _Left; - private int _Top; - private int _Right; - private int _Bottom; - - public RECT(RECT rectangle) - : this(rectangle.Left, rectangle.Top, rectangle.Right, rectangle.Bottom) { - } - public RECT(Rectangle rectangle) - : this(rectangle.Left, rectangle.Top, rectangle.Right, rectangle.Bottom) { - } - public RECT(int left, int top, int right, int bottom) { - _Left = left; - _Top = top; - _Right = right; - _Bottom = bottom; - } - - public int X { - get { - return _Left; - } - set { - _Left = value; - } - } - public int Y { - get { - return _Top; - } - set { - _Top = value; - } - } - public int Left { - get { - return _Left; - } - set { - _Left = value; - } - } - public int Top { - get { - return _Top; - } - set { - _Top = value; - } - } - public int Right { - get { - return _Right; - } - set { - _Right = value; - } - } - public int Bottom { - get { - return _Bottom; - } - set { - _Bottom = value; - } - } - public int Height { - get { - return _Bottom - _Top; - } - set { - _Bottom = value - _Top; - } - } - public int Width { - get { - return _Right - _Left; - } - set { - _Right = value + _Left; - } - } - public Point Location { - get { - return new Point(Left, Top); - } - set { - _Left = value.X; - _Top = value.Y; - } - } - public Size Size { - get { - return new Size(Width, Height); - } - set { - _Right = value.Width + _Left; - _Bottom = value.Height + _Top; - } - } - - public static implicit operator Rectangle(RECT rectangle) { - return new Rectangle(rectangle.Left, rectangle.Top, rectangle.Width, rectangle.Height); - } - public static implicit operator RECT(Rectangle rectangle) { - return new RECT(rectangle.Left, rectangle.Top, rectangle.Right, rectangle.Bottom); - } - public static bool operator ==(RECT rectangle1, RECT rectangle2) { - return rectangle1.Equals(rectangle2); - } - public static bool operator !=(RECT rectangle1, RECT rectangle2) { - return !rectangle1.Equals(rectangle2); - } - - public override string ToString() { - return "{Left: " + _Left + "; " + "Top: " + _Top + "; Right: " + _Right + "; Bottom: " + _Bottom + "}"; - } - - public override int GetHashCode() { - return ToString().GetHashCode(); - } - - public bool Equals(RECT rectangle) { - return rectangle.Left == _Left && rectangle.Top == _Top && rectangle.Right == _Right && rectangle.Bottom == _Bottom; - } - - public Rectangle ToRectangle() { - return new Rectangle(Left, Top, Width, Height); - } - public override bool Equals(object Object) { - if (Object is RECT) { - return Equals((RECT)Object); - } else if (Object is Rectangle) { - return Equals(new RECT((Rectangle)Object)); - } - - return false; - } - } - - /// - /// A floating point GDI Plus width/hight based rectangle. - /// - [StructLayout(LayoutKind.Sequential)] - public struct RECTF { - /// - /// The X corner location of the rectangle. - /// - public float X; - - /// - /// The Y corner location of the rectangle. - /// - public float Y; - - /// - /// The width of the rectangle. - /// - public float Width; - - /// - /// The height of the rectangle. - /// - public float Height; - - /// - /// Creates a new GDI Plus rectangle. - /// - /// The X corner location of the rectangle. - /// The Y corner location of the rectangle. - /// The width of the rectangle. - /// The height of the rectangle. - public RECTF(float x, float y, float width, float height) { - X = x; - Y = y; - Width = width; - Height = height; - } - - /// - /// Creates a new GDI Plus rectangle from a System.Drawing.RectangleF. - /// - /// The rectangle to base this GDI Plus rectangle on. - public RECTF(RectangleF rect) { - X = rect.X; - Y = rect.Y; - Width = rect.Width; - Height = rect.Height; - } - - /// - /// Creates a new GDI Plus rectangle from a System.Drawing.Rectangle. - /// - /// The rectangle to base this GDI Plus rectangle on. - public RECTF(Rectangle rect) { - X = rect.X; - Y = rect.Y; - Width = rect.Width; - Height = rect.Height; - } - - /// - /// Returns a RectangleF for this GDI Plus rectangle. - /// - /// A System.Drawing.RectangleF structure. - public RectangleF ToRectangle() { - return new RectangleF(X, Y, Width, Height); - } - - /// - /// Returns a RectangleF for a GDI Plus rectangle. - /// - /// The GDI Plus rectangle to get the RectangleF for. - /// A System.Drawing.RectangleF structure. - public static RectangleF ToRectangle(RECTF rect) { - return rect.ToRectangle(); - } - - /// - /// Returns a GDI Plus rectangle for a RectangleF structure. - /// - /// The RectangleF to get the GDI Plus rectangle for. - /// A GDI Plus rectangle structure. - public static RECTF FromRectangle(RectangleF rect) { - return new RECTF(rect); - } - - /// - /// Returns a GDI Plus rectangle for a Rectangle structure. - /// - /// The Rectangle to get the GDI Plus rectangle for. - /// A GDI Plus rectangle structure. - public static RECTF FromRectangle(Rectangle rect) { - return new RECTF(rect); - } - } - - - /// - /// The structure for the WindowInfo - /// See: http://msdn.microsoft.com/en-us/library/windows/desktop/ms632610%28v=vs.85%29.aspx - /// - [StructLayout(LayoutKind.Sequential), Serializable] - public struct WindowInfo { - public uint cbSize; - public RECT rcWindow; - public RECT rcClient; - public uint dwStyle; - public uint dwExStyle; - public uint dwWindowStatus; - public uint cxWindowBorders; - public uint cyWindowBorders; - public ushort atomWindowType; - public ushort wCreatorVersion; - // Allows automatic initialization of "cbSize" with "new WINDOWINFO(null/true/false)". - public WindowInfo(bool? filler) : this() { - cbSize = (uint)(Marshal.SizeOf(typeof(WindowInfo))); - } - } - - /// - /// Contains information about the placement of a window on the screen. - /// - [StructLayout(LayoutKind.Sequential), Serializable()] - public struct WindowPlacement { - /// - /// The length of the structure, in bytes. Before calling the GetWindowPlacement or SetWindowPlacement functions, set this member to sizeof(WINDOWPLACEMENT). - /// - /// GetWindowPlacement and SetWindowPlacement fail if this member is not set correctly. - /// - /// - public int Length; - - /// - /// Specifies flags that control the position of the minimized window and the method by which the window is restored. - /// - public WindowPlacementFlags Flags; - - /// - /// The current show state of the window. - /// - public ShowWindowCommand ShowCmd; - - /// - /// The coordinates of the window's upper-left corner when the window is minimized. - /// - public POINT MinPosition; - - /// - /// The coordinates of the window's upper-left corner when the window is maximized. - /// - public POINT MaxPosition; - - /// - /// The window's coordinates when the window is in the restored position. - /// - public RECT NormalPosition; - - /// - /// Gets the default (empty) value. - /// - public static WindowPlacement Default { - get { - WindowPlacement result = new WindowPlacement(); - result.Length = Marshal.SizeOf(result); - return result; - } - } - } - - [StructLayout(LayoutKind.Sequential)] - public struct CursorInfo { - public int cbSize; - public int flags; - public IntPtr hCursor; - public POINT ptScreenPos; - } - - [StructLayout(LayoutKind.Sequential)] - public struct IconInfo { - public bool fIcon; - public int xHotspot; - public int yHotspot; - public IntPtr hbmMask; - public IntPtr hbmColor; - } - - [Serializable, StructLayout(LayoutKind.Sequential)] - public struct SCROLLINFO { - public int cbSize; - public int fMask; - public int nMin; - public int nMax; - public int nPage; - public int nPos; - public int nTrackPos; - } - -} diff --git a/GreenshotPlugin/UnmanagedHelpers/Structs/CursorInfo.cs b/GreenshotPlugin/UnmanagedHelpers/Structs/CursorInfo.cs new file mode 100644 index 000000000..9b818288d --- /dev/null +++ b/GreenshotPlugin/UnmanagedHelpers/Structs/CursorInfo.cs @@ -0,0 +1,13 @@ +using System; +using System.Runtime.InteropServices; + +namespace GreenshotPlugin.UnmanagedHelpers.Structs +{ + [StructLayout(LayoutKind.Sequential)] + public struct CursorInfo { + public int cbSize; + public int flags; + public IntPtr hCursor; + public POINT ptScreenPos; + } +} \ No newline at end of file diff --git a/GreenshotPlugin/UnmanagedHelpers/Structs/IconInfo.cs b/GreenshotPlugin/UnmanagedHelpers/Structs/IconInfo.cs new file mode 100644 index 000000000..5808f4883 --- /dev/null +++ b/GreenshotPlugin/UnmanagedHelpers/Structs/IconInfo.cs @@ -0,0 +1,14 @@ +using System; +using System.Runtime.InteropServices; + +namespace GreenshotPlugin.UnmanagedHelpers.Structs +{ + [StructLayout(LayoutKind.Sequential)] + public struct IconInfo { + public bool fIcon; + public int xHotspot; + public int yHotspot; + public IntPtr hbmMask; + public IntPtr hbmColor; + } +} \ No newline at end of file diff --git a/GreenshotPlugin/UnmanagedHelpers/Structs/POINT.cs b/GreenshotPlugin/UnmanagedHelpers/Structs/POINT.cs new file mode 100644 index 000000000..9b78ab9a7 --- /dev/null +++ b/GreenshotPlugin/UnmanagedHelpers/Structs/POINT.cs @@ -0,0 +1,37 @@ +using System; +using System.Drawing; +using System.Runtime.InteropServices; + +namespace GreenshotPlugin.UnmanagedHelpers.Structs +{ + [StructLayout(LayoutKind.Sequential), Serializable()] + public struct POINT { + public int X; + public int Y; + + public POINT(int x, int y) { + X = x; + Y = y; + } + public POINT(Point point) { + X = point.X; + Y = point.Y; + } + + public static implicit operator Point(POINT p) { + return new Point(p.X, p.Y); + } + + public static implicit operator POINT(Point p) { + return new POINT(p.X, p.Y); + } + + public Point ToPoint() { + return new Point(X, Y); + } + + public override string ToString() { + return X + "," + Y; + } + } +} \ No newline at end of file diff --git a/GreenshotPlugin/UnmanagedHelpers/Structs/RECT.cs b/GreenshotPlugin/UnmanagedHelpers/Structs/RECT.cs new file mode 100644 index 000000000..a403cea9b --- /dev/null +++ b/GreenshotPlugin/UnmanagedHelpers/Structs/RECT.cs @@ -0,0 +1,148 @@ +using System; +using System.Drawing; +using System.Runtime.InteropServices; + +namespace GreenshotPlugin.UnmanagedHelpers.Structs +{ + [StructLayout(LayoutKind.Sequential), Serializable()] + public struct RECT { + private int _Left; + private int _Top; + private int _Right; + private int _Bottom; + + public RECT(RECT rectangle) + : this(rectangle.Left, rectangle.Top, rectangle.Right, rectangle.Bottom) { + } + public RECT(Rectangle rectangle) + : this(rectangle.Left, rectangle.Top, rectangle.Right, rectangle.Bottom) { + } + public RECT(int left, int top, int right, int bottom) { + _Left = left; + _Top = top; + _Right = right; + _Bottom = bottom; + } + + public int X { + get { + return _Left; + } + set { + _Left = value; + } + } + public int Y { + get { + return _Top; + } + set { + _Top = value; + } + } + public int Left { + get { + return _Left; + } + set { + _Left = value; + } + } + public int Top { + get { + return _Top; + } + set { + _Top = value; + } + } + public int Right { + get { + return _Right; + } + set { + _Right = value; + } + } + public int Bottom { + get { + return _Bottom; + } + set { + _Bottom = value; + } + } + public int Height { + get { + return _Bottom - _Top; + } + set { + _Bottom = value - _Top; + } + } + public int Width { + get { + return _Right - _Left; + } + set { + _Right = value + _Left; + } + } + public Point Location { + get { + return new Point(Left, Top); + } + set { + _Left = value.X; + _Top = value.Y; + } + } + public Size Size { + get { + return new Size(Width, Height); + } + set { + _Right = value.Width + _Left; + _Bottom = value.Height + _Top; + } + } + + public static implicit operator Rectangle(RECT rectangle) { + return new Rectangle(rectangle.Left, rectangle.Top, rectangle.Width, rectangle.Height); + } + public static implicit operator RECT(Rectangle rectangle) { + return new RECT(rectangle.Left, rectangle.Top, rectangle.Right, rectangle.Bottom); + } + public static bool operator ==(RECT rectangle1, RECT rectangle2) { + return rectangle1.Equals(rectangle2); + } + public static bool operator !=(RECT rectangle1, RECT rectangle2) { + return !rectangle1.Equals(rectangle2); + } + + public override string ToString() { + return "{Left: " + _Left + "; " + "Top: " + _Top + "; Right: " + _Right + "; Bottom: " + _Bottom + "}"; + } + + public override int GetHashCode() { + return ToString().GetHashCode(); + } + + public bool Equals(RECT rectangle) { + return rectangle.Left == _Left && rectangle.Top == _Top && rectangle.Right == _Right && rectangle.Bottom == _Bottom; + } + + public Rectangle ToRectangle() { + return new Rectangle(Left, Top, Width, Height); + } + public override bool Equals(object Object) { + if (Object is RECT) { + return Equals((RECT)Object); + } else if (Object is Rectangle) { + return Equals(new RECT((Rectangle)Object)); + } + + return false; + } + } +} \ No newline at end of file diff --git a/GreenshotPlugin/UnmanagedHelpers/Structs/RECTF.cs b/GreenshotPlugin/UnmanagedHelpers/Structs/RECTF.cs new file mode 100644 index 000000000..5fa193343 --- /dev/null +++ b/GreenshotPlugin/UnmanagedHelpers/Structs/RECTF.cs @@ -0,0 +1,102 @@ +using System.Drawing; +using System.Runtime.InteropServices; + +namespace GreenshotPlugin.UnmanagedHelpers.Structs +{ + /// + /// A floating point GDI Plus width/hight based rectangle. + /// + [StructLayout(LayoutKind.Sequential)] + public struct RECTF { + /// + /// The X corner location of the rectangle. + /// + public float X; + + /// + /// The Y corner location of the rectangle. + /// + public float Y; + + /// + /// The width of the rectangle. + /// + public float Width; + + /// + /// The height of the rectangle. + /// + public float Height; + + /// + /// Creates a new GDI Plus rectangle. + /// + /// The X corner location of the rectangle. + /// The Y corner location of the rectangle. + /// The width of the rectangle. + /// The height of the rectangle. + public RECTF(float x, float y, float width, float height) { + X = x; + Y = y; + Width = width; + Height = height; + } + + /// + /// Creates a new GDI Plus rectangle from a System.Drawing.RectangleF. + /// + /// The rectangle to base this GDI Plus rectangle on. + public RECTF(RectangleF rect) { + X = rect.X; + Y = rect.Y; + Width = rect.Width; + Height = rect.Height; + } + + /// + /// Creates a new GDI Plus rectangle from a System.Drawing.Rectangle. + /// + /// The rectangle to base this GDI Plus rectangle on. + public RECTF(Rectangle rect) { + X = rect.X; + Y = rect.Y; + Width = rect.Width; + Height = rect.Height; + } + + /// + /// Returns a RectangleF for this GDI Plus rectangle. + /// + /// A System.Drawing.RectangleF structure. + public RectangleF ToRectangle() { + return new RectangleF(X, Y, Width, Height); + } + + /// + /// Returns a RectangleF for a GDI Plus rectangle. + /// + /// The GDI Plus rectangle to get the RectangleF for. + /// A System.Drawing.RectangleF structure. + public static RectangleF ToRectangle(RECTF rect) { + return rect.ToRectangle(); + } + + /// + /// Returns a GDI Plus rectangle for a RectangleF structure. + /// + /// The RectangleF to get the GDI Plus rectangle for. + /// A GDI Plus rectangle structure. + public static RECTF FromRectangle(RectangleF rect) { + return new RECTF(rect); + } + + /// + /// Returns a GDI Plus rectangle for a Rectangle structure. + /// + /// The Rectangle to get the GDI Plus rectangle for. + /// A GDI Plus rectangle structure. + public static RECTF FromRectangle(Rectangle rect) { + return new RECTF(rect); + } + } +} \ No newline at end of file diff --git a/GreenshotPlugin/UnmanagedHelpers/Structs/SCROLLINFO.cs b/GreenshotPlugin/UnmanagedHelpers/Structs/SCROLLINFO.cs new file mode 100644 index 000000000..fec30ca08 --- /dev/null +++ b/GreenshotPlugin/UnmanagedHelpers/Structs/SCROLLINFO.cs @@ -0,0 +1,16 @@ +using System; +using System.Runtime.InteropServices; + +namespace GreenshotPlugin.UnmanagedHelpers.Structs +{ + [Serializable, StructLayout(LayoutKind.Sequential)] + public struct SCROLLINFO { + public int cbSize; + public int fMask; + public int nMin; + public int nMax; + public int nPage; + public int nPos; + public int nTrackPos; + } +} \ No newline at end of file diff --git a/GreenshotPlugin/UnmanagedHelpers/Structs/SIZE.cs b/GreenshotPlugin/UnmanagedHelpers/Structs/SIZE.cs new file mode 100644 index 000000000..2481a993c --- /dev/null +++ b/GreenshotPlugin/UnmanagedHelpers/Structs/SIZE.cs @@ -0,0 +1,44 @@ +/* + * Greenshot - a free and open source screenshot tool + * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * + * For more information see: http://getgreenshot.org/ + * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 1 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +using System; +using System.Drawing; +using System.Runtime.InteropServices; + +namespace GreenshotPlugin.UnmanagedHelpers.Structs { + [StructLayout(LayoutKind.Sequential), Serializable()] + public struct SIZE { + public int Width; + public int Height; + public SIZE(Size size) : this(size.Width, size.Height) { + + } + + public SIZE(int width, int height) { + Width = width; + Height = height; + } + + public Size ToSize() { + return new Size(Width, Height); + } + } +} diff --git a/GreenshotPlugin/UnmanagedHelpers/Structs/WindowInfo.cs b/GreenshotPlugin/UnmanagedHelpers/Structs/WindowInfo.cs new file mode 100644 index 000000000..8f0405125 --- /dev/null +++ b/GreenshotPlugin/UnmanagedHelpers/Structs/WindowInfo.cs @@ -0,0 +1,27 @@ +using System; +using System.Runtime.InteropServices; + +namespace GreenshotPlugin.UnmanagedHelpers.Structs +{ + /// + /// The structure for the WindowInfo + /// See: http://msdn.microsoft.com/en-us/library/windows/desktop/ms632610%28v=vs.85%29.aspx + /// + [StructLayout(LayoutKind.Sequential), Serializable] + public struct WindowInfo { + public uint cbSize; + public RECT rcWindow; + public RECT rcClient; + public uint dwStyle; + public uint dwExStyle; + public uint dwWindowStatus; + public uint cxWindowBorders; + public uint cyWindowBorders; + public ushort atomWindowType; + public ushort wCreatorVersion; + // Allows automatic initialization of "cbSize" with "new WINDOWINFO(null/true/false)". + public WindowInfo(bool? filler) : this() { + cbSize = (uint)(Marshal.SizeOf(typeof(WindowInfo))); + } + } +} \ No newline at end of file diff --git a/GreenshotPlugin/UnmanagedHelpers/Structs/WindowPlacement.cs b/GreenshotPlugin/UnmanagedHelpers/Structs/WindowPlacement.cs new file mode 100644 index 000000000..f54baac86 --- /dev/null +++ b/GreenshotPlugin/UnmanagedHelpers/Structs/WindowPlacement.cs @@ -0,0 +1,56 @@ +using System; +using System.Runtime.InteropServices; +using GreenshotPlugin.UnmanagedHelpers.Enums; + +namespace GreenshotPlugin.UnmanagedHelpers.Structs +{ + /// + /// Contains information about the placement of a window on the screen. + /// + [StructLayout(LayoutKind.Sequential), Serializable()] + public struct WindowPlacement { + /// + /// The length of the structure, in bytes. Before calling the GetWindowPlacement or SetWindowPlacement functions, set this member to sizeof(WINDOWPLACEMENT). + /// + /// GetWindowPlacement and SetWindowPlacement fail if this member is not set correctly. + /// + /// + public int Length; + + /// + /// Specifies flags that control the position of the minimized window and the method by which the window is restored. + /// + public WindowPlacementFlags Flags; + + /// + /// The current show state of the window. + /// + public ShowWindowCommand ShowCmd; + + /// + /// The coordinates of the window's upper-left corner when the window is minimized. + /// + public POINT MinPosition; + + /// + /// The coordinates of the window's upper-left corner when the window is maximized. + /// + public POINT MaxPosition; + + /// + /// The window's coordinates when the window is in the restored position. + /// + public RECT NormalPosition; + + /// + /// Gets the default (empty) value. + /// + public static WindowPlacement Default { + get { + WindowPlacement result = new WindowPlacement(); + result.Length = Marshal.SizeOf(result); + return result; + } + } + } +} \ No newline at end of file diff --git a/GreenshotPlugin/UnmanagedHelpers/User32.cs b/GreenshotPlugin/UnmanagedHelpers/User32.cs index 8a889014e..9b9e6b80b 100644 --- a/GreenshotPlugin/UnmanagedHelpers/User32.cs +++ b/GreenshotPlugin/UnmanagedHelpers/User32.cs @@ -26,22 +26,13 @@ using System.Drawing; using System.Runtime.InteropServices; using System.Text; using System.Windows.Forms; -using Microsoft.Win32.SafeHandles; -using System.Security; -using System.Security.Permissions; using log4net; using GreenshotPlugin.Core.Enums; +using GreenshotPlugin.UnmanagedHelpers.Enums; +using GreenshotPlugin.UnmanagedHelpers.Structs; namespace GreenshotPlugin.UnmanagedHelpers { - /// - /// Used with EnumWindows or EnumChildWindows - /// - /// - /// - /// - public delegate int EnumWindowsProc(IntPtr hwnd, int lParam); - - /// + /// /// User32 Wrappers /// public static class User32 { @@ -336,120 +327,4 @@ namespace GreenshotPlugin.UnmanagedHelpers { return exceptionToThrow; } } - - /// - /// Used with SetWinEventHook - /// - /// - /// - /// - /// - /// - /// - /// - public delegate void WinEventDelegate(IntPtr hWinEventHook, WinEvent eventType, IntPtr hwnd, EventObjects idObject, int idChild, uint dwEventThread, uint dwmsEventTime); - - /// - /// A SafeHandle class implementation for the current input desktop - /// - public class SafeCurrentInputDesktopHandle : SafeHandleZeroOrMinusOneIsInvalid { - private static readonly ILog LOG = LogManager.GetLogger(typeof(SafeCurrentInputDesktopHandle)); - - public SafeCurrentInputDesktopHandle() : base(true) { - IntPtr hDesktop = User32.OpenInputDesktop(0, true, DesktopAccessRight.GENERIC_ALL); - if (hDesktop != IntPtr.Zero) { - SetHandle(hDesktop); - if (User32.SetThreadDesktop(hDesktop)) { - LOG.DebugFormat("Switched to desktop {0}", hDesktop); - } else { - LOG.WarnFormat("Couldn't switch to desktop {0}", hDesktop); - LOG.Error(User32.CreateWin32Exception("SetThreadDesktop")); - } - } else { - LOG.Warn("Couldn't get current desktop."); - LOG.Error(User32.CreateWin32Exception("OpenInputDesktop")); - } - } - - [SecurityPermission(SecurityAction.LinkDemand, UnmanagedCode = true)] - protected override bool ReleaseHandle() { - return User32.CloseDesktop(handle); - } - } - - /// - /// A SafeHandle class implementation for the hIcon - /// - public class SafeIconHandle : SafeHandleZeroOrMinusOneIsInvalid { - - /// - /// Needed for marshalling return values - /// - [SecurityCritical] - public SafeIconHandle() : base(true) - { - } - - - public SafeIconHandle(IntPtr hIcon) : base(true) { - SetHandle(hIcon); - } - - [SecurityPermission(SecurityAction.LinkDemand, UnmanagedCode = true)] - protected override bool ReleaseHandle() { - return User32.DestroyIcon(handle); - } - } - - /// - /// A WindowDC SafeHandle implementation - /// - public class SafeWindowDcHandle : SafeHandleZeroOrMinusOneIsInvalid { - [DllImport("user32", SetLastError = true)] - private static extern IntPtr GetWindowDC(IntPtr hWnd); - [DllImport("user32", SetLastError = true)] - private static extern bool ReleaseDC(IntPtr hWnd, IntPtr hDC); - - private readonly IntPtr _hWnd; - - /// - /// Needed for marshalling return values - /// - public SafeWindowDcHandle() : base(true) - { - } - - [SecurityCritical] - public SafeWindowDcHandle(IntPtr hWnd, IntPtr preexistingHandle) : base(true) { - _hWnd = hWnd; - SetHandle(preexistingHandle); - } - - [SecurityPermission(SecurityAction.LinkDemand, UnmanagedCode=true)] - protected override bool ReleaseHandle() { - bool returnValue = ReleaseDC(_hWnd, handle); - return returnValue; - } - - /// - /// Creates a DC as SafeWindowDcHandle for the whole of the specified hWnd - /// - /// IntPtr - /// SafeWindowDcHandle - public static SafeWindowDcHandle FromWindow(IntPtr hWnd) - { - if (hWnd == IntPtr.Zero) - { - return null; - } - var hDcDesktop = GetWindowDC(hWnd); - return new SafeWindowDcHandle(hWnd, hDcDesktop); - } - - public static SafeWindowDcHandle FromDesktop() { - IntPtr hWndDesktop = User32.GetDesktopWindow(); - IntPtr hDCDesktop = GetWindowDC(hWndDesktop); - return new SafeWindowDcHandle(hWndDesktop, hDCDesktop); - } - } } diff --git a/GreenshotPlugin/UnmanagedHelpers/Win32Errors.cs b/GreenshotPlugin/UnmanagedHelpers/Win32.cs similarity index 55% rename from GreenshotPlugin/UnmanagedHelpers/Win32Errors.cs rename to GreenshotPlugin/UnmanagedHelpers/Win32.cs index 92ffd2b92..471f38049 100644 --- a/GreenshotPlugin/UnmanagedHelpers/Win32Errors.cs +++ b/GreenshotPlugin/UnmanagedHelpers/Win32.cs @@ -21,76 +21,12 @@ using System; using System.Runtime.InteropServices; using System.Text; +using GreenshotPlugin.UnmanagedHelpers.Enums; namespace GreenshotPlugin.UnmanagedHelpers { - /// - /// A Win32 error code. - /// - public enum Win32Error : uint { - Success = 0x0, - InvalidFunction = 0x1, - FileNotFound = 0x2, - PathNotFound = 0x3, - TooManyOpenFiles = 0x4, - AccessDenied = 0x5, - InvalidHandle = 0x6, - ArenaTrashed = 0x7, - NotEnoughMemory = 0x8, - InvalidBlock = 0x9, - BadEnvironment = 0xa, - BadFormat = 0xb, - InvalidAccess = 0xc, - InvalidData = 0xd, - OutOfMemory = 0xe, - InvalidDrive = 0xf, - CurrentDirectory = 0x10, - NotSameDevice = 0x11, - NoMoreFiles = 0x12, - WriteProtect = 0x13, - BadUnit = 0x14, - NotReady = 0x15, - BadCommand = 0x16, - Crc = 0x17, - BadLength = 0x18, - Seek = 0x19, - NotDosDisk = 0x1a, - SectorNotFound = 0x1b, - OutOfPaper = 0x1c, - WriteFault = 0x1d, - ReadFault = 0x1e, - GenFailure = 0x1f, - SharingViolation = 0x20, - LockViolation = 0x21, - WrongDisk = 0x22, - SharingBufferExceeded = 0x24, - HandleEof = 0x26, - HandleDiskFull = 0x27, - NotSupported = 0x32, - RemNotList = 0x33, - DupName = 0x34, - BadNetPath = 0x35, - NetworkBusy = 0x36, - DevNotExist = 0x37, - TooManyCmds = 0x38, - FileExists = 0x50, - CannotMake = 0x52, - AlreadyAssigned = 0x55, - InvalidPassword = 0x56, - InvalidParameter = 0x57, - NetWriteFault = 0x58, - NoProcSlots = 0x59, - TooManySemaphores = 0x64, - ExclSemAlreadyOwned = 0x65, - SemIsSet = 0x66, - TooManySemRequests = 0x67, - InvalidAtInterruptTime = 0x68, - SemOwnerDied = 0x69, - SemUserLimit = 0x6a - } - public static class Win32 { [DllImport("kernel32.dll", CharSet = CharSet.Unicode)] - private static extern uint FormatMessage(uint dwFlags, IntPtr lpSource, uint dwMessageId, uint dwLanguageId, [Out] StringBuilder lpBuffer, int nSize, IntPtr Arguments); + private static extern uint FormatMessage(uint dwFlags, IntPtr lpSource, uint dwMessageId, uint dwLanguageId, [Out] StringBuilder lpBuffer, int nSize, IntPtr arguments); [DllImport("kernel32.dll")] public static extern void SetLastError(uint dwErrCode); @@ -130,7 +66,7 @@ namespace GreenshotPlugin.UnmanagedHelpers { i++; } - return result.ToString().Replace("\r\n", ""); + return result.ToString().Replace("\r\n", string.Empty); } } } diff --git a/GreenshotPlugin/UnmanagedHelpers/WinEventDelegate.cs b/GreenshotPlugin/UnmanagedHelpers/WinEventDelegate.cs new file mode 100644 index 000000000..e285418e7 --- /dev/null +++ b/GreenshotPlugin/UnmanagedHelpers/WinEventDelegate.cs @@ -0,0 +1,17 @@ +using System; +using GreenshotPlugin.UnmanagedHelpers.Enums; + +namespace GreenshotPlugin.UnmanagedHelpers +{ + /// + /// Used with SetWinEventHook + /// + /// + /// + /// + /// + /// + /// + /// + public delegate void WinEventDelegate(IntPtr hWinEventHook, WinEvent eventType, IntPtr hwnd, EventObjects idObject, int idChild, uint dwEventThread, uint dwmsEventTime); +} \ No newline at end of file diff --git a/GreenshotWin10Plugin/Properties/AssemblyInfo.cs b/GreenshotWin10Plugin/Properties/AssemblyInfo.cs index ae2eaf0b0..7c2dc1d2c 100644 --- a/GreenshotWin10Plugin/Properties/AssemblyInfo.cs +++ b/GreenshotWin10Plugin/Properties/AssemblyInfo.cs @@ -1,5 +1,4 @@ -using Greenshot.Plugin; -using System.Reflection; +using System.Reflection; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following diff --git a/GreenshotWin10Plugin/Win10OcrDestination.cs b/GreenshotWin10Plugin/Win10OcrDestination.cs index bd762ecbd..32cdeddac 100644 --- a/GreenshotWin10Plugin/Win10OcrDestination.cs +++ b/GreenshotWin10Plugin/Win10OcrDestination.cs @@ -25,10 +25,10 @@ using System.IO; using System.Threading.Tasks; using Windows.Graphics.Imaging; using Windows.Media.Ocr; -using Greenshot.Plugin; using GreenshotPlugin.Core; using System.Text; using GreenshotPlugin.Interfaces; +using GreenshotPlugin.Interfaces.Plugin; namespace GreenshotWin10Plugin { diff --git a/GreenshotWin10Plugin/Win10Plugin.cs b/GreenshotWin10Plugin/Win10Plugin.cs index 40d12094b..1bf1f5b1b 100644 --- a/GreenshotWin10Plugin/Win10Plugin.cs +++ b/GreenshotWin10Plugin/Win10Plugin.cs @@ -21,8 +21,9 @@ using System; using System.Collections.Generic; -using Greenshot.Plugin; using GreenshotPlugin.Core; +using GreenshotPlugin.Interfaces; +using GreenshotPlugin.Interfaces.Plugin; namespace GreenshotWin10Plugin { diff --git a/GreenshotWin10Plugin/Win10ShareDestination.cs b/GreenshotWin10Plugin/Win10ShareDestination.cs index 20fbde97a..97a354cfb 100644 --- a/GreenshotWin10Plugin/Win10ShareDestination.cs +++ b/GreenshotWin10Plugin/Win10ShareDestination.cs @@ -29,12 +29,13 @@ using Windows.ApplicationModel.DataTransfer; using Windows.Storage; using Windows.Storage.Streams; using Color = Windows.UI.Color; -using Greenshot.Plugin; using GreenshotPlugin.Core; using System.Drawing; using GreenshotWin10Plugin.Native; using System.Windows.Media; using GreenshotPlugin.Hooking; +using GreenshotPlugin.Interfaces; +using GreenshotPlugin.Interfaces.Plugin; namespace GreenshotWin10Plugin {