]> git.tdb.fi Git - libs/gui.git/blobdiff - source/gbase/window.h
Hide the platform-specific parts of other classes as well
[libs/gui.git] / source / gbase / window.h
index f422296f8d3be7e98f6a33ad31932d9197b3b85f..53c2d958fbf9eeebf094e34476f70aa88acc3190 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,11 +43,7 @@ public:
 protected:
        Display &display;
        WindowOptions options;
-       WindowHandle window;
-#ifndef WIN32
-       Atom wm_delete_window;
-       Cursor invisible_cursor;
-#endif
+       Private *priv;
 
 public:
        Window(Display &, unsigned w, unsigned h, bool fs=false);
@@ -60,20 +58,14 @@ public:
        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
+       bool event(const Event &evnt);
 protected:
        void init();
-#ifdef WIN32
-       int wndproc(UINT, WPARAM, LPARAM);
-       static LRESULT CALLBACK wndproc_(HWND, UINT, WPARAM, LPARAM);
-#endif
 };
 
 } // namespace Graphics