mirror of
https://github.com/greenshot/greenshot
synced 2025-08-21 05:53:27 -07:00
Fixed some interface usage, also cleanup of the surface & editor code. This should theoretically allow usage of home made IDrawableContainer objects, which plug-ins supply.
Also made it possible to reuse the editor, currently only available editors which have a non modified surface can be reused. And only than if the configuration is set to do so. git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@2100 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
parent
7bb187ce71
commit
f9abcac063
13 changed files with 233 additions and 154 deletions
|
@ -22,12 +22,13 @@ using System;
|
|||
using System.Drawing;
|
||||
using System.Drawing.Imaging;
|
||||
using System.Windows.Forms;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace Greenshot.Plugin.Drawing {
|
||||
public enum RenderMode {EDIT, EXPORT};
|
||||
public enum EditStatus {UNDRAWN, DRAWING, MOVING, RESIZING, IDLE};
|
||||
|
||||
public interface IDrawableContainer {
|
||||
public interface IDrawableContainer : INotifyPropertyChanged {
|
||||
ISurface Parent {
|
||||
get;
|
||||
}
|
||||
|
@ -76,9 +77,22 @@ namespace Greenshot.Plugin.Drawing {
|
|||
get;
|
||||
}
|
||||
|
||||
EditStatus Status {
|
||||
get;
|
||||
set;
|
||||
}
|
||||
void AlignToParent(HorizontalAlignment horizontalAlignment, VerticalAlignment verticalAlignment);
|
||||
void Invalidate();
|
||||
void Dispose();
|
||||
bool ClickableAt(int x, int y);
|
||||
void HideGrippers();
|
||||
void ShowGrippers();
|
||||
void MoveBy(int x, int y);
|
||||
bool HandleMouseDown(int x, int y);
|
||||
void HandleMouseUp(int x, int y);
|
||||
bool HandleMouseMove(int x, int y);
|
||||
bool InitContent();
|
||||
void MakeBoundsChangeUndoable(bool allowMerge);
|
||||
}
|
||||
|
||||
public interface ITextContainer: IDrawableContainer {
|
||||
|
|
|
@ -70,9 +70,10 @@ namespace Greenshot.Plugin {
|
|||
ICaptureDetails CaptureDetails {
|
||||
get;
|
||||
}
|
||||
|
||||
|
||||
ISurface Surface {
|
||||
get;
|
||||
set;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,6 +25,7 @@ using System.Windows.Forms;
|
|||
|
||||
using Greenshot.Plugin.Drawing;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Greenshot.Plugin {
|
||||
/// <summary>
|
||||
|
@ -58,13 +59,18 @@ namespace Greenshot.Plugin {
|
|||
|
||||
public delegate void SurfaceSizeChangeEventHandler(object source);
|
||||
public delegate void SurfaceMessageEventHandler(object source, SurfaceMessageEventArgs eventArgs);
|
||||
public delegate void SurfaceElementEventHandler(object source, IList<IDrawableContainer> element);
|
||||
public delegate void SurfaceDrawingModeEventHandler(object source, DrawingModes drawingMode);
|
||||
public enum DrawingModes { None, Rect, Ellipse, Text, Line, Arrow, Crop, Highlight, Obfuscate, Bitmap, Path }
|
||||
|
||||
/// <summary>
|
||||
/// The interface to the Surface object, so Plugins can use it.
|
||||
/// </summary>
|
||||
public interface ISurface : IDisposable {
|
||||
event SurfaceSizeChangeEventHandler SurfaceSizeChanged;
|
||||
event SurfaceMessageEventHandler SurfaceMessage;
|
||||
event SurfaceMessageEventHandler SurfaceMessage;
|
||||
event SurfaceDrawingModeEventHandler DrawingModeChanged;
|
||||
event SurfaceElementEventHandler MovingElementChanged;
|
||||
|
||||
/// <summary>
|
||||
/// Get/Set the image to the Surface
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue