X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fgraphics%2Fwindow.cpp;h=d116b691c14bcbf11592bca91d9edcb647eca792;hb=9c7ae47da64904c2aa9a9969870ca8befebe7d02;hp=8c9d1748a199648b3ae5b1e232c99066399c0882;hpb=ca9f477ac356849471c3a3fbf9584f78aadd6027;p=libs%2Fgui.git diff --git a/source/graphics/window.cpp b/source/graphics/window.cpp index 8c9d174..d116b69 100644 --- a/source/graphics/window.cpp +++ b/source/graphics/window.cpp @@ -1,3 +1,4 @@ +#include #include "display.h" #include "window.h" #include "window_private.h" @@ -8,6 +9,9 @@ namespace Msp { namespace Graphics { WindowOptions::WindowOptions(): + x(0), + y(0), + user_position(false), width(640), height(480), fullscreen(false), @@ -36,13 +40,19 @@ void Window::init() { visible = false; kbd_autorepeat = true; + touch_input = false; resizing = false; + moving = false; priv = new Private; platform_init(); display.add_window(*this); display.check_error(); + + const string &app_name = Application::get_name(); + if(!app_name.empty()) + set_title(app_name); } Window::~Window() @@ -60,7 +70,10 @@ Window::~Window() void Window::reconfigure(const WindowOptions &opts) { bool fullscreen_changed = (opts.fullscreen!=options.fullscreen); - resizing = (opts.width!=options.width || opts.height!=options.height); + if(opts.width!=options.width || opts.height!=options.height) + resizing = true; + if(opts.x!=options.x || opts.y!=options.y) + moving = true; if(visible) { @@ -79,6 +92,12 @@ void Window::set_keyboard_autorepeat(bool r) kbd_autorepeat = r; } +void Window::set_touch_input(bool t) +{ + touch_input = t; + platform_set_touch_input(); +} + void Window::show() { platform_show();