X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fgraphics%2Fwindow.h;h=75c48850e991b93fa53cc33fcd52b0fd0358f91a;hb=d12fe10340948a3dfa6a5261fec51be079046fad;hp=38b92177f932ca67c6dbee81cd40cbc015f4321e;hpb=1023b38fa278cea71fba3d2881e1bfde930cd025;p=libs%2Fgui.git diff --git a/source/graphics/window.h b/source/graphics/window.h index 38b9217..75c4885 100644 --- a/source/graphics/window.h +++ b/source/graphics/window.h @@ -3,29 +3,45 @@ #include #include -#include "eventsource.h" namespace Msp { namespace Graphics { class Display; +struct Monitor; struct WindowOptions { + int x; + int y; + bool user_position; unsigned width; unsigned height; bool fullscreen; + const Monitor *fullscreen_monitor; + bool fullscreen_exclusive; bool resizable; WindowOptions(); }; -class Window: public EventSource +class Window { public: struct Private; struct Event; + /** Provides input events. The event structure contents are platform- + specific. Applications will want to use the enclosed Keyboard and Mouse + 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: @@ -33,7 +49,9 @@ protected: WindowOptions options; bool visible; bool kbd_autorepeat; + bool touch_input; bool resizing; + bool moving; Private *priv; public: @@ -41,15 +59,26 @@ public: Window(Display &, const WindowOptions &); private: void init(); + void platform_init(); + void platform_cleanup(); public: virtual ~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; } @@ -59,7 +88,11 @@ public: void show(); void hide(); +private: + void platform_show(); + void platform_hide(); +public: bool event(const Event &evnt); };