]> git.tdb.fi Git - libs/gui.git/blobdiff - source/graphics/window.h
Add decorations for things which should be exported from the library
[libs/gui.git] / source / graphics / window.h
index 942fc8c984074f72572828e5ed5efee6f43675ab..a6fb92b4e8e1eb4db2f0cf46004a3a93cf92d1f6 100644 (file)
@@ -3,23 +3,28 @@
 
 #include <string>
 #include <sigc++/signal.h>
+#include "mspgui_api.h"
 
 namespace Msp {
 namespace Graphics {
 
 class Display;
+struct Monitor;
 
 struct WindowOptions
 {
-       unsigned width;
-       unsigned height;
-       bool fullscreen;
-       bool resizable;
-
-       WindowOptions();
+       int x = 0;
+       int y = 0;
+       bool user_position = false;
+       unsigned width = 640;
+       unsigned height = 480;
+       bool fullscreen = false;
+       const Monitor *fullscreen_monitor = nullptr;
+       bool fullscreen_exclusive = true;
+       bool resizable = false;
 };
 
-class Window
+class MSPGUI_API Window
 {
 public:
        struct Private;
@@ -30,41 +35,63 @@ public:
        objects instead. */
        sigc::signal<void, const Event &> signal_input_event;
 
+       sigc::signal<void> signal_got_focus;
+       sigc::signal<void> signal_lost_focus;
+
+       sigc::signal<void, int, int> signal_move;
        sigc::signal<void, unsigned, unsigned> signal_resize;
+       sigc::signal<void, unsigned, unsigned, unsigned, unsigned, const Event &> signal_expose;
        sigc::signal<void> signal_close;
 
 protected:
        Display &display;
        WindowOptions options;
-       bool visible;
-       bool kbd_autorepeat;
-       bool resizing;
-       Private *priv;
+       bool visible = false;
+       bool kbd_autorepeat = true;
+       bool touch_input = false;
+       bool resizing = false;
+       bool moving = false;
+       Private *priv = nullptr;
 
 public:
        Window(Display &, unsigned w, unsigned h, bool fs = false);
        Window(Display &, const WindowOptions &);
 private:
        void init();
+       void platform_init();
+       void platform_cleanup();
 public:
-       virtual ~Window();
+       ~Window();
 
        void set_title(const std::string &);
        void reconfigure(const WindowOptions &);
+private:
+       void set_fullscreen_mode();
+       void platform_reconfigure(bool);
+public:
        void set_keyboard_autorepeat(bool);
        bool get_keyboard_autorepeat() const { return kbd_autorepeat; }
        void show_cursor(bool);
        void warp_pointer(int, int);
+       void set_touch_input(bool);
+private:
+       void platform_set_touch_input();
+public:
+       bool get_touch_input() const { return touch_input; }
 
        Display &get_display() const { return display; }
        const WindowOptions &get_options() const { return options; }
-       virtual unsigned get_width() const { return options.width; }
-       virtual unsigned get_height() const { return options.height; }
+       unsigned get_width() const { return options.width; }
+       unsigned get_height() const { return options.height; }
        const Private &get_private() const { return *priv; }
 
        void show();
        void hide();
+private:
+       void platform_show();
+       void platform_hide();
 
+public:
        bool event(const Event &evnt);
 };