diff --git a/ShareX.ScreenCaptureLib/Forms/FreeHandRegion.cs b/ShareX.ScreenCaptureLib/Forms/FreeHandRegionForm.cs similarity index 97% rename from ShareX.ScreenCaptureLib/Forms/FreeHandRegion.cs rename to ShareX.ScreenCaptureLib/Forms/FreeHandRegionForm.cs index 11261744e..e14dc5cb5 100644 --- a/ShareX.ScreenCaptureLib/Forms/FreeHandRegion.cs +++ b/ShareX.ScreenCaptureLib/Forms/FreeHandRegionForm.cs @@ -31,14 +31,14 @@ You should have received a copy of the GNU General Public License namespace ShareX.ScreenCaptureLib { - public class FreeHandRegion : Surface + public class FreeHandRegionForm : SurfaceForm { private NodeObject lastNode; private List points; private bool isAreaCreated; private Rectangle currentArea; - public FreeHandRegion() + public FreeHandRegionForm() { points = new List(128); regionFillPath = new GraphicsPath(); diff --git a/ShareX.ScreenCaptureLib/Forms/PolygonRegion.cs b/ShareX.ScreenCaptureLib/Forms/PolygonRegionForm.cs similarity index 98% rename from ShareX.ScreenCaptureLib/Forms/PolygonRegion.cs rename to ShareX.ScreenCaptureLib/Forms/PolygonRegionForm.cs index b3d8f4f1f..fdb734525 100644 --- a/ShareX.ScreenCaptureLib/Forms/PolygonRegion.cs +++ b/ShareX.ScreenCaptureLib/Forms/PolygonRegionForm.cs @@ -32,13 +32,13 @@ You should have received a copy of the GNU General Public License namespace ShareX.ScreenCaptureLib { - public class PolygonRegion : Surface + public class PolygonRegionForm : SurfaceForm { private List nodes; private bool isAreaCreated; private Rectangle currentArea; - public PolygonRegion() + public PolygonRegionForm() { nodes = new List(); MouseDown += PolygonRegionSurface_MouseDown; diff --git a/ShareX.ScreenCaptureLib/Forms/RectangleAnnotate.cs b/ShareX.ScreenCaptureLib/Forms/RectangleAnnotateForm.cs similarity index 99% rename from ShareX.ScreenCaptureLib/Forms/RectangleAnnotate.cs rename to ShareX.ScreenCaptureLib/Forms/RectangleAnnotateForm.cs index bb5e5ea3f..ea771dd29 100644 --- a/ShareX.ScreenCaptureLib/Forms/RectangleAnnotate.cs +++ b/ShareX.ScreenCaptureLib/Forms/RectangleAnnotateForm.cs @@ -36,7 +36,7 @@ You should have received a copy of the GNU General Public License namespace ShareX.ScreenCaptureLib { - public class RectangleAnnotate : Form + public class RectangleAnnotateForm : Form { public static Rectangle LastSelectionRectangle0Based { get; private set; } @@ -95,7 +95,7 @@ public Point PreviousMousePosition0Based private Stopwatch penTimer; private Font infoFont; - public RectangleAnnotate(RectangleAnnotateOptions options) + public RectangleAnnotateForm(RectangleAnnotateOptions options) { Options = options; diff --git a/ShareX.ScreenCaptureLib/Forms/RectangleLight.cs b/ShareX.ScreenCaptureLib/Forms/RectangleLightForm.cs similarity index 98% rename from ShareX.ScreenCaptureLib/Forms/RectangleLight.cs rename to ShareX.ScreenCaptureLib/Forms/RectangleLightForm.cs index 6106f12b1..8b20205e4 100644 --- a/ShareX.ScreenCaptureLib/Forms/RectangleLight.cs +++ b/ShareX.ScreenCaptureLib/Forms/RectangleLightForm.cs @@ -34,7 +34,7 @@ You should have received a copy of the GNU General Public License namespace ShareX.ScreenCaptureLib { - public class RectangleLight : Form + public class RectangleLightForm : Form { public static Rectangle LastSelectionRectangle0Based { get; private set; } @@ -66,7 +66,7 @@ public Rectangle SelectionRectangle0Based private bool isMouseDown; private Stopwatch penTimer; - public RectangleLight() + public RectangleLightForm() { backgroundImage = Screenshot.CaptureFullscreen(); backgroundBrush = new TextureBrush(backgroundImage); diff --git a/ShareX.ScreenCaptureLib/Forms/RectangleRegion.cs b/ShareX.ScreenCaptureLib/Forms/RectangleRegionForm.cs similarity index 99% rename from ShareX.ScreenCaptureLib/Forms/RectangleRegion.cs rename to ShareX.ScreenCaptureLib/Forms/RectangleRegionForm.cs index 14069131f..bace7a850 100644 --- a/ShareX.ScreenCaptureLib/Forms/RectangleRegion.cs +++ b/ShareX.ScreenCaptureLib/Forms/RectangleRegionForm.cs @@ -35,7 +35,7 @@ You should have received a copy of the GNU General Public License namespace ShareX.ScreenCaptureLib { - public class RectangleRegion : Surface + public class RectangleRegionForm : SurfaceForm { public AreaManager AreaManager { get; private set; } @@ -75,7 +75,7 @@ public Color CurrentColor private ColorBlinkAnimation colorBlinkAnimation = new ColorBlinkAnimation(); - public RectangleRegion() + public RectangleRegionForm() { AreaManager = new AreaManager(this); diff --git a/ShareX.ScreenCaptureLib/Forms/RectangleTransparent.cs b/ShareX.ScreenCaptureLib/Forms/RectangleTransparentForm.cs similarity index 98% rename from ShareX.ScreenCaptureLib/Forms/RectangleTransparent.cs rename to ShareX.ScreenCaptureLib/Forms/RectangleTransparentForm.cs index 92cbc4c12..52a9087d0 100644 --- a/ShareX.ScreenCaptureLib/Forms/RectangleTransparent.cs +++ b/ShareX.ScreenCaptureLib/Forms/RectangleTransparentForm.cs @@ -34,7 +34,7 @@ You should have received a copy of the GNU General Public License namespace ShareX.ScreenCaptureLib { - public class RectangleTransparent : LayeredForm + public class RectangleTransparentForm : LayeredForm { public static Rectangle LastSelectionRectangle0Based { get; private set; } @@ -77,7 +77,7 @@ private Rectangle PreviousSelectionRectangle0Based private bool isMouseDown; private Stopwatch penTimer; - public RectangleTransparent() + public RectangleTransparentForm() { clearPen = new Pen(Color.FromArgb(1, 0, 0, 0)); borderDotPen = new Pen(Color.Black, 1); diff --git a/ShareX.ScreenCaptureLib/Forms/ScrollingCaptureForm.cs b/ShareX.ScreenCaptureLib/Forms/ScrollingCaptureForm.cs index 108bb9afe..47a1ca9d0 100644 --- a/ShareX.ScreenCaptureLib/Forms/ScrollingCaptureForm.cs +++ b/ShareX.ScreenCaptureLib/Forms/ScrollingCaptureForm.cs @@ -160,7 +160,7 @@ private void SelectRectangle() Thread.Sleep(250); Rectangle rect; - if (Surface.SelectRegion(out rect)) + if (SurfaceForm.SelectRegion(out rect)) { selectedRectangle = rect; lblSelectedRectangle.Text = selectedRectangle.ToString(); @@ -186,7 +186,7 @@ private void btnCapture_Click(object sender, EventArgs e) private SimpleWindowInfo GetWindowInfo() { - using (RectangleRegion surface = new RectangleRegion()) + using (RectangleRegionForm surface = new RectangleRegionForm()) { surface.OneClickMode = true; surface.Config.DetectWindows = true; diff --git a/ShareX.ScreenCaptureLib/Forms/Surface.cs b/ShareX.ScreenCaptureLib/Forms/SurfaceForm.cs similarity index 99% rename from ShareX.ScreenCaptureLib/Forms/Surface.cs rename to ShareX.ScreenCaptureLib/Forms/SurfaceForm.cs index 58a9de3d8..698ed082f 100644 --- a/ShareX.ScreenCaptureLib/Forms/Surface.cs +++ b/ShareX.ScreenCaptureLib/Forms/SurfaceForm.cs @@ -37,7 +37,7 @@ You should have received a copy of the GNU General Public License namespace ShareX.ScreenCaptureLib { - public class Surface : Form + public abstract class SurfaceForm : Form { public Image SurfaceImage { get; set; } public SurfaceOptions Config { get; set; } @@ -62,7 +62,7 @@ public class Surface : Form private bool pause; - public Surface() + public SurfaceForm() { ScreenRectangle = CaptureHelpers.GetScreenBounds(); ScreenRectangle0Based = CaptureHelpers.ScreenToClient(ScreenRectangle); @@ -459,7 +459,7 @@ public static bool SelectRegion(out Rectangle rect) public static bool SelectRegion(out Rectangle rect, SurfaceOptions options) { - using (RectangleRegion surface = new RectangleRegion()) + using (RectangleRegionForm surface = new RectangleRegionForm()) { surface.Config = options; surface.Config.ShowTips = false; diff --git a/ShareX.ScreenCaptureLib/RegionHelpers/AreaManager.cs b/ShareX.ScreenCaptureLib/RegionHelpers/AreaManager.cs index 37d86f33b..500123071 100644 --- a/ShareX.ScreenCaptureLib/RegionHelpers/AreaManager.cs +++ b/ShareX.ScreenCaptureLib/RegionHelpers/AreaManager.cs @@ -142,10 +142,10 @@ public bool IsResizing public bool IncludeControls { get; set; } public int MinimumSize { get; set; } = 3; - private RectangleRegion surface; + private RectangleRegionForm surface; private ContextMenuStrip cmsShapeMenu; - public AreaManager(RectangleRegion surface) + public AreaManager(RectangleRegionForm surface) { this.surface = surface; diff --git a/ShareX.ScreenCaptureLib/RegionHelpers/ResizeManager.cs b/ShareX.ScreenCaptureLib/RegionHelpers/ResizeManager.cs index 3218c2ad3..e5b8330dc 100644 --- a/ShareX.ScreenCaptureLib/RegionHelpers/ResizeManager.cs +++ b/ShareX.ScreenCaptureLib/RegionHelpers/ResizeManager.cs @@ -65,7 +65,7 @@ public bool Visible private NodeObject[] nodes; private Rectangle tempRect; - public ResizeManager(Surface surface, AreaManager areaManager) + public ResizeManager(SurfaceForm surface, AreaManager areaManager) { this.areaManager = areaManager; diff --git a/ShareX.ScreenCaptureLib/ShareX.ScreenCaptureLib.csproj b/ShareX.ScreenCaptureLib/ShareX.ScreenCaptureLib.csproj index a2a2a1297..a4db94837 100644 --- a/ShareX.ScreenCaptureLib/ShareX.ScreenCaptureLib.csproj +++ b/ShareX.ScreenCaptureLib/ShareX.ScreenCaptureLib.csproj @@ -60,10 +60,10 @@ - + Form - + Form @@ -97,10 +97,10 @@ FFmpegOptionsForm.cs - + Form - + Form @@ -112,13 +112,13 @@ - + Form - + Form - + Form diff --git a/ShareX/Forms/MainForm.cs b/ShareX/Forms/MainForm.cs index 89dd5d2d1..8772e6808 100644 --- a/ShareX/Forms/MainForm.cs +++ b/ShareX/Forms/MainForm.cs @@ -2075,19 +2075,19 @@ private void CaptureWindow(IntPtr handle, TaskSettings taskSettings = null, bool private void CaptureRegion(CaptureType captureType, TaskSettings taskSettings, bool autoHideForm = true) { - Surface surface; + SurfaceForm surface; switch (captureType) { default: case CaptureType.Rectangle: - surface = new RectangleRegion(); + surface = new RectangleRegionForm(); break; case CaptureType.Polygon: - surface = new PolygonRegion(); + surface = new PolygonRegionForm(); break; case CaptureType.Freehand: - surface = new FreeHandRegion(); + surface = new FreeHandRegionForm(); break; } @@ -2175,7 +2175,7 @@ private void CaptureRectangleAnnotate(TaskSettings taskSettings = null, bool aut { Image img = null; - using (RectangleAnnotate rectangleAnnotate = new RectangleAnnotate(taskSettings.CaptureSettingsReference.RectangleAnnotateOptions)) + using (RectangleAnnotateForm rectangleAnnotate = new RectangleAnnotateForm(taskSettings.CaptureSettingsReference.RectangleAnnotateOptions)) { if (rectangleAnnotate.ShowDialog() == DialogResult.OK) { @@ -2200,7 +2200,7 @@ private void CaptureRectangleLight(TaskSettings taskSettings = null, bool autoHi { Image img = null; - using (RectangleLight rectangleLight = new RectangleLight()) + using (RectangleLightForm rectangleLight = new RectangleLightForm()) { if (rectangleLight.ShowDialog() == DialogResult.OK) { @@ -2225,7 +2225,7 @@ private void CaptureRectangleTransparent(TaskSettings taskSettings = null, bool { Image img = null; - using (RectangleTransparent rectangleTransparent = new RectangleTransparent()) + using (RectangleTransparentForm rectangleTransparent = new RectangleTransparentForm()) { if (rectangleTransparent.ShowDialog() == DialogResult.OK) { @@ -2247,13 +2247,13 @@ private void CaptureLastRegion(TaskSettings taskSettings, bool autoHideForm = tr switch (lastRegionCaptureType) { case LastRegionCaptureType.Surface: - if (Surface.LastRegionFillPath != null) + if (SurfaceForm.LastRegionFillPath != null) { DoCapture(() => { using (Image screenshot = Screenshot.CaptureFullscreen()) { - return ShapeCaptureHelpers.GetRegionImage(screenshot, Surface.LastRegionFillPath, Surface.LastRegionDrawPath, taskSettings.CaptureSettings.SurfaceOptions); + return ShapeCaptureHelpers.GetRegionImage(screenshot, SurfaceForm.LastRegionFillPath, SurfaceForm.LastRegionDrawPath, taskSettings.CaptureSettings.SurfaceOptions); } }, CaptureType.LastRegion, taskSettings, autoHideForm); } @@ -2263,13 +2263,13 @@ private void CaptureLastRegion(TaskSettings taskSettings, bool autoHideForm = tr } break; case LastRegionCaptureType.Light: - if (!RectangleLight.LastSelectionRectangle0Based.IsEmpty) + if (!RectangleLightForm.LastSelectionRectangle0Based.IsEmpty) { DoCapture(() => { using (Image screenshot = Screenshot.CaptureFullscreen()) { - return ImageHelpers.CropImage(screenshot, RectangleLight.LastSelectionRectangle0Based); + return ImageHelpers.CropImage(screenshot, RectangleLightForm.LastSelectionRectangle0Based); } }, CaptureType.LastRegion, taskSettings, autoHideForm); } @@ -2279,13 +2279,13 @@ private void CaptureLastRegion(TaskSettings taskSettings, bool autoHideForm = tr } break; case LastRegionCaptureType.Transparent: - if (!RectangleTransparent.LastSelectionRectangle0Based.IsEmpty) + if (!RectangleTransparentForm.LastSelectionRectangle0Based.IsEmpty) { DoCapture(() => { using (Image screenshot = Screenshot.CaptureFullscreen()) { - return ImageHelpers.CropImage(screenshot, RectangleTransparent.LastSelectionRectangle0Based); + return ImageHelpers.CropImage(screenshot, RectangleTransparentForm.LastSelectionRectangle0Based); } }, CaptureType.LastRegion, taskSettings, autoHideForm); } @@ -2295,13 +2295,13 @@ private void CaptureLastRegion(TaskSettings taskSettings, bool autoHideForm = tr } break; case LastRegionCaptureType.Annotate: - if (!RectangleAnnotate.LastSelectionRectangle0Based.IsEmpty) + if (!RectangleAnnotateForm.LastSelectionRectangle0Based.IsEmpty) { DoCapture(() => { using (Image screenshot = Screenshot.CaptureFullscreen()) { - return ImageHelpers.CropImage(screenshot, RectangleAnnotate.LastSelectionRectangle0Based); + return ImageHelpers.CropImage(screenshot, RectangleAnnotateForm.LastSelectionRectangle0Based); } }, CaptureType.LastRegion, taskSettings, autoHideForm); } diff --git a/ShareX/TaskHelpers.cs b/ShareX/TaskHelpers.cs index ad5fc59df..3a9b96ce9 100644 --- a/ShareX/TaskHelpers.cs +++ b/ShareX/TaskHelpers.cs @@ -308,12 +308,12 @@ private static void AddExternalProgramFromRegistry(TaskSettings taskSettings, st public static bool SelectRegion(out Rectangle rect, TaskSettings taskSettings) { - return Surface.SelectRegion(out rect, taskSettings.CaptureSettings.SurfaceOptions); + return SurfaceForm.SelectRegion(out rect, taskSettings.CaptureSettings.SurfaceOptions); } public static PointInfo SelectPointColor() { - using (RectangleRegion surface = new RectangleRegion()) + using (RectangleRegionForm surface = new RectangleRegionForm()) { surface.ScreenColorPickerMode = true; surface.Config.DetectWindows = false; @@ -538,7 +538,7 @@ public static void OpenScreenColorPicker(TaskSettings taskSettings = null) public static void OpenRuler() { - using (RectangleRegion surface = new RectangleRegion()) + using (RectangleRegionForm surface = new RectangleRegionForm()) { surface.RulerMode = true; surface.Config.ShowTips = false;