aboutsummaryrefslogtreecommitdiffstats
path: root/src/events.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/events.rs')
-rw-r--r--src/events.rs33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/events.rs b/src/events.rs
new file mode 100644
index 0000000..f66e6a2
--- /dev/null
+++ b/src/events.rs
@@ -0,0 +1,33 @@
+
+#[deriving(Clone,Show)]
+pub enum Event {
+ /// The position of the window has changed.
+ PositionChanged(uint, uint),
+
+ /// The size of the window has changed.
+ SizeChanged(uint, uint),
+
+ /// The window has been closed.
+ Closed,
+
+ /// The cursor has moved on the window.
+ ///
+ /// The parameter are the (x,y) coords in pixels relative to the top-left corner of the window.
+ CursorPositionChanged(uint, uint),
+
+ /// The window gained or lost focus.
+ ///
+ /// The parameter is true if the window has gained focus, and false if it has lost focus.
+ Focused(bool),
+
+ /// The window has been turned into an icon or restored.
+ ///
+ /// The parameter is true if the window has been iconified, and false if it has been restored.
+ Iconified(bool),
+
+ /// The system asked that the content of this window must be redrawn.
+ NeedRefresh,
+
+ /// The size of the framebuffer of the window has changed.
+ FramebufferSizeChanged(uint, uint),
+}