From 9e804bf4848d926c32bc3f1fbb5f0ee663fecaa1 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Fri, 19 Oct 2018 19:42:56 -0700 Subject: GLK: Added glk_set_window --- engines/gargoyle/glk.cpp | 2 +- engines/gargoyle/windows.cpp | 6 +++++- engines/gargoyle/windows.h | 6 ++++++ 3 files changed, 12 insertions(+), 2 deletions(-) (limited to 'engines') diff --git a/engines/gargoyle/glk.cpp b/engines/gargoyle/glk.cpp index 278faf5678..7274ff2af4 100644 --- a/engines/gargoyle/glk.cpp +++ b/engines/gargoyle/glk.cpp @@ -136,7 +136,7 @@ strid_t Glk::glk_window_get_echo_stream(winid_t win) { } void Glk::glk_set_window(winid_t win) { - // TODO + _windows->setCurrent(win ? win->str : nullptr); } strid_t Glk::glk_stream_open_file(frefid_t fileref, glui32 fmode, diff --git a/engines/gargoyle/windows.cpp b/engines/gargoyle/windows.cpp index 8dc546a61d..0bc16b2c25 100644 --- a/engines/gargoyle/windows.cpp +++ b/engines/gargoyle/windows.cpp @@ -89,7 +89,7 @@ WindowStyle G_STYLES[style_NUMSTYLES] = { Windows::Windows(Graphics::Screen *screen) : _screen(screen), _forceRedraw(true), _moreFocus(false), _windowList(nullptr), _rootWin(nullptr), _focusWin(nullptr), _mask(nullptr), - _claimSelect(0) { + _claimSelect(0), _currentStr(nullptr) { _confLockCols = false; _confLockRows = false; _wMarginx = 15; @@ -280,6 +280,10 @@ void Windows::clearSelection() { _claimSelect = false; } +void Windows::setCurrent(Common::WriteStream *stream) { + _currentStr = stream; +} + /*--------------------------------------------------------------------------*/ Window::Window(Windows *windows, glui32 rock) : _magicnum(MAGIC_WINDOW_NUM), diff --git a/engines/gargoyle/windows.h b/engines/gargoyle/windows.h index 64adf81450..02fa7aab35 100644 --- a/engines/gargoyle/windows.h +++ b/engines/gargoyle/windows.h @@ -54,6 +54,7 @@ private: bool _moreFocus; bool _claimSelect; WindowMask *_mask; + Common::WriteStream *_currentStr; private: /** * Create a new window @@ -111,6 +112,11 @@ public: Window *getRoot() const { return _rootWin; } void clearSelection(); + + /** + * Set the current output stream + */ + void setCurrent(Common::WriteStream *stream); }; /** -- cgit v1.2.3