X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fgraphics%2Fwindow.h;h=a6fb92b4e8e1eb4db2f0cf46004a3a93cf92d1f6;hb=d7686e3867e3c68cec0d3767a21f9d2408383085;hp=8065762a4b2cc57d826db9f904f594de17365b96;hpb=f6ca714e2258f4cad433801c88264947d4c2d14c;p=libs%2Fgui.git diff --git a/source/graphics/window.h b/source/graphics/window.h index 8065762..a6fb92b 100644 --- a/source/graphics/window.h +++ b/source/graphics/window.h @@ -3,25 +3,28 @@ #include #include +#include "mspgui_api.h" namespace Msp { namespace Graphics { class Display; +struct Monitor; struct WindowOptions { - int x; - int y; - 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; @@ -32,6 +35,9 @@ public: objects instead. */ sigc::signal signal_input_event; + sigc::signal signal_got_focus; + sigc::signal signal_lost_focus; + sigc::signal signal_move; sigc::signal signal_resize; sigc::signal signal_expose; @@ -40,11 +46,12 @@ public: protected: Display &display; WindowOptions options; - bool visible; - bool kbd_autorepeat; - bool touch_input; - 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); @@ -54,11 +61,12 @@ private: 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); @@ -73,8 +81,8 @@ public: 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();