]> git.tdb.fi Git - libs/gui.git/blobdiff - source/gbase/window.h
Various fixes to Window resizing and fullscreen handling on X11
[libs/gui.git] / source / gbase / window.h
index e85f86ac7128e522e7869d9a9faec8f5e811b7f7..38ffb6d5aee967ad81121f8bde8a1abc34b971b6 100644 (file)
@@ -1,7 +1,7 @@
 /* $Id$
 
 This file is part of libmspgbase
-Copyright © 2007 Mikko Rasa, Mikkosoft Productions
+Copyright © 2007-2008  Mikko Rasa, Mikkosoft Productions
 Distributed under the LGPL
 */
 
@@ -10,7 +10,6 @@ Distributed under the LGPL
 
 #include <string>
 #include <sigc++/signal.h>
-#include "types.h"
 
 namespace Msp {
 namespace Graphics {
@@ -30,6 +29,9 @@ struct WindowOptions
 class Window
 {
 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;
@@ -41,37 +43,36 @@ public:
 protected:
        Display &display;
        WindowOptions options;
-       WindowHandle window;
-#ifndef WIN32
-       Atom wm_delete_window;
-#endif
+       bool visible;
+       bool kbd_autorepeat;
+       bool resizing;
+       Private *priv;
 
 public:
        Window(Display &, unsigned w, unsigned h, bool fs=false);
        Window(Display &, const WindowOptions &);
+private:
+       void init();
+public:
        ~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; }
-       WindowHandle get_handle() const { return window; }
+       const Private &get_private() const { return *priv; }
 
        void show();
        void hide();
 
-#ifndef WIN32
-       void event(const XEvent &ev);
-#endif
-protected:
-       void init();
-#ifdef WIN32
-       int wndproc(UINT, WPARAM, LPARAM);
-       static LRESULT CALLBACK wndproc_(HWND, UINT, WPARAM, LPARAM);
-#endif
+       bool event(const Event &evnt);
 };
 
 } // namespace Graphics