]> git.tdb.fi Git - libs/gui.git/blobdiff - source/gbase/window.h
Add EventSource abstraction layer below Window
[libs/gui.git] / source / gbase / window.h
index 38ffb6d5aee967ad81121f8bde8a1abc34b971b6..c008fe8353d86b8a41921f2ab012252e33f33919 100644 (file)
@@ -1,7 +1,7 @@
 /* $Id$
 
 This file is part of libmspgbase
-Copyright © 2007-2008  Mikko Rasa, Mikkosoft Productions
+Copyright © 2007-2010  Mikko Rasa, Mikkosoft Productions
 Distributed under the LGPL
 */
 
@@ -10,6 +10,7 @@ Distributed under the LGPL
 
 #include <string>
 #include <sigc++/signal.h>
+#include "eventsource.h"
 
 namespace Msp {
 namespace Graphics {
@@ -26,18 +27,12 @@ struct WindowOptions
        WindowOptions();
 };
 
-class Window
+class Window: public EventSource
 {
 public:
        struct Private;
        struct Event;
 
-       sigc::signal<void, int, int, unsigned, unsigned> signal_button_press;
-       sigc::signal<void, int, int, unsigned, unsigned> signal_button_release;
-       sigc::signal<void, int, int> signal_pointer_motion;
-       sigc::signal<void, unsigned, unsigned, unsigned> signal_key_press;
-       sigc::signal<void, unsigned, unsigned> signal_key_release;
-       sigc::signal<void, unsigned, unsigned> signal_resize;
        sigc::signal<void> signal_close;
 
 protected:
@@ -65,8 +60,8 @@ public:
 
        Display &get_display() const { return display; }
        const WindowOptions &get_options() const { return options; }
-       unsigned get_width() const  { return options.width; }
-       unsigned get_height() const { return options.height; }
+       virtual unsigned get_width() const { return options.width; }
+       virtual unsigned get_height() const { return options.height; }
        const Private &get_private() const { return *priv; }
 
        void show();