]> git.tdb.fi Git - libs/gui.git/blobdiff - source/gbase/window.h
Header updates
[libs/gui.git] / source / gbase / window.h
index c48adc5fe3ff81b39ace83eb8402e0b3aa9d1e89..a390b8cf4543da9d06ac7dfda37c9e1a9a3a3d4c 100644 (file)
@@ -1,15 +1,9 @@
-/* $Id$
-
-This file is part of libmspgbase
-Copyright © 2007-2008  Mikko Rasa, Mikkosoft Productions
-Distributed under the LGPL
-*/
-
 #ifndef MSP_GBASE_WINDOW_H_
 #define MSP_GBASE_WINDOW_H_
 
 #include <string>
 #include <sigc++/signal.h>
+#include "eventsource.h"
 
 namespace Msp {
 namespace Graphics {
@@ -26,47 +20,47 @@ 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:
        Display &display;
        WindowOptions options;
+       bool visible;
+       bool kbd_autorepeat;
+       bool resizing;
        Private *priv;
 
 public:
-       Window(Display &, unsigned w, unsigned h, bool fs=false);
+       Window(Display &, unsigned w, unsigned h, bool fs = false);
        Window(Display &, const WindowOptions &);
-       ~Window();
+private:
+       void init();
+public:
+       virtual ~Window();
 
        void set_title(const std::string &);
        void reconfigure(const WindowOptions &);
+       void set_keyboard_autorepeat(bool);
+       bool get_keyboard_autorepeat() const { return kbd_autorepeat; }
        void show_cursor(bool);
        void warp_pointer(int, int);
 
        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();
        void hide();
 
        bool event(const Event &evnt);
-protected:
-       void init();
 };
 
 } // namespace Graphics