Ian Burgmyer
7 years ago
7 changed files with 133 additions and 61 deletions
@ -1,11 +1,31 @@
|
||||
namespace DotSDL.Events { |
||||
/// <summary> |
||||
/// Represents a window event. Window events are thrown when an event occurs |
||||
/// that affects an <see cref="DotSDL.Graphics.SdlWindow"/> instance and/or |
||||
/// that affects an <see cref="Graphics.SdlWindow"/> instance and/or |
||||
/// the applicaiton as a whole. This includes the UI toolkit minimizing, |
||||
/// maximizing, and closing a window, as well as application quit messages. |
||||
/// </summary> |
||||
public class WindowEvent : IEvent { |
||||
public uint Timestamp { get; set; } |
||||
public IResourceObject Resource { get; set; } |
||||
|
||||
/// <summary> |
||||
/// The event that was triggered. |
||||
/// </summary> |
||||
public WindowEvent Event { get; set; } |
||||
|
||||
/// <summary> |
||||
/// When Event is WindowEventType.Moved, this contains the new X coordinate |
||||
/// of the window. When Event is WindowEventType.Resized, this contains the |
||||
/// new width of the window. For all other events, this value is unused. |
||||
/// </summary> |
||||
public int X { get; set; } |
||||
|
||||
/// <summary> |
||||
/// When Event is WindowEventType.Moved, this contains the new Y coordinate |
||||
/// of the window. When Event is WindowEventType.Resized, this contains the |
||||
/// new height of the window. For all other events, this value is unused. |
||||
/// </summary> |
||||
public int Y { get; set; } |
||||
} |
||||
} |
||||
|
@ -0,0 +1,57 @@
|
||||
namespace DotSDL.Events { |
||||
/// <summary> |
||||
/// Events that can occur on a window. |
||||
/// </summary> |
||||
public enum WindowEventType : byte { |
||||
/// <summary>Unused.</summary> |
||||
None, |
||||
|
||||
/// <summary>Window has been shown.</summary> |
||||
Shown, |
||||
|
||||
/// <summary>Window has been hidden.</summary> |
||||
Hidden, |
||||
|
||||
/// <summary>Window has been exposed and should be redrawn.</summary> |
||||
Exposed, |
||||
|
||||
/// <summary>Window has been moved.</summary> |
||||
Moved, |
||||
|
||||
/// <summary>Window has been resized.</summary> |
||||
Resized, |
||||
|
||||
/// <summary>The window size has changed, either as a result of an API call or through the system or user changing the window size.</summary> |
||||
SizeChanged, |
||||
|
||||
/// <summary>Window has been minimized.</summary> |
||||
Minimized, |
||||
|
||||
/// <summary>Window has been maximized.</summary> |
||||
Maximized, |
||||
|
||||
/// <summary>Window has been restored to normal size and position.</summary> |
||||
Restored, |
||||
|
||||
/// <summary>Window has gained mouse focus.</summary> |
||||
Enter, |
||||
|
||||
/// <summary>Window has lost mouse focus.</summary> |
||||
Leave, |
||||
|
||||
/// <summary>Window has gained keyboard focus.</summary> |
||||
FocusGained, |
||||
|
||||
/// <summary>Window has lost keyboard focus.</summary> |
||||
FocusLost, |
||||
|
||||
/// <summary>The window manager requests that the window be closed.</summary> |
||||
Close, |
||||
|
||||
/// <summary>Window is being offered a focus (should SetWindowInputFocus() on itself or a subwindow, or ignore).</summary> |
||||
TakeFocus, |
||||
|
||||
/// <summary>Window had a hit test that wasn't SDL_HITTEST_NORMAL.</summary> |
||||
HitTest |
||||
} |
||||
} |
Loading…
Reference in new issue