/
WindowEventSource.cs
44 lines (35 loc) · 1.11 KB
/
WindowEventSource.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
using System;
namespace Com.GitHub.ZachDeibert.GraphicsCore {
public sealed class WindowEventSource {
public event MoveHandler Move;
public event SizeHandler Resize;
public event Action Focus;
public event Action Blur;
public event Action Iconify;
public event Action Restore;
public event SizeHandler ViewportResize;
internal void OnMove(int x, int y) {
Move?.Invoke(x, y);
}
internal void OnResize(int width, int height) {
Resize?.Invoke(width, height);
}
internal void OnFocus() {
Focus?.Invoke();
}
internal void OnBlur() {
Blur?.Invoke();
}
internal void OnIconify() {
Iconify?.Invoke();
}
internal void OnRestore() {
Restore?.Invoke();
}
internal void OnViewportReisze(int width, int height) {
ViewportResize?.Invoke(width, height);
}
public delegate void MoveHandler(int x, int y);
public delegate void SizeHandler(int width, int height);
}
}