X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fgraphics%2Fwindow.h;h=de8a3d0beaccf79c2bc7bf9e42c3535840636fbf;hb=e82345f2c1286e684789854c7dbe32411bb0b05f;hp=70b40443d3d84575f93f4fefc51ffa99119da2c1;hpb=1d7113259625a91f5f6d2f53365aad22ae744689;p=libs%2Fgui.git diff --git a/source/graphics/window.h b/source/graphics/window.h index 70b4044..de8a3d0 100644 --- a/source/graphics/window.h +++ b/source/graphics/window.h @@ -8,15 +8,19 @@ 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 @@ -30,17 +34,23 @@ 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; sigc::signal signal_close; 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); @@ -50,11 +60,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); @@ -69,8 +80,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();