From cf5259d3bc279fd73b4ae8bad2d7b04b8ff7265e Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 20 Oct 2018 14:39:34 -0700 Subject: GLK: Adding stream open/closing --- engines/gargoyle/gargoyle.cpp | 6 +- engines/gargoyle/gargoyle.h | 7 +- engines/gargoyle/glk.cpp | 10 +- engines/gargoyle/module.mk | 2 +- engines/gargoyle/stream.cpp | 146 --------------------------- engines/gargoyle/stream.h | 196 ------------------------------------ engines/gargoyle/streams.cpp | 156 +++++++++++++++++++++++++++++ engines/gargoyle/streams.h | 227 ++++++++++++++++++++++++++++++++++++++++++ engines/gargoyle/windows.cpp | 11 +- engines/gargoyle/windows.h | 18 +--- 10 files changed, 408 insertions(+), 371 deletions(-) delete mode 100644 engines/gargoyle/stream.cpp delete mode 100644 engines/gargoyle/stream.h create mode 100644 engines/gargoyle/streams.cpp create mode 100644 engines/gargoyle/streams.h (limited to 'engines') diff --git a/engines/gargoyle/gargoyle.cpp b/engines/gargoyle/gargoyle.cpp index 986a40ab78..a481ae9624 100644 --- a/engines/gargoyle/gargoyle.cpp +++ b/engines/gargoyle/gargoyle.cpp @@ -30,7 +30,7 @@ #include "graphics/thumbnail.h" #include "gargoyle/gargoyle.h" #include "gargoyle/events.h" -#include "gargoyle/stream.h" +#include "gargoyle/streams.h" #include "gargoyle/windows.h" namespace Gargoyle { @@ -57,8 +57,8 @@ void GargoyleEngine::initialize() { initGraphics(640, 480, false); _screen = new Graphics::Screen(); _events = new Events(); - _streams = new Streams(); - _windows = new Windows(_screen); + _streams = new Streams(this); + _windows = new Windows(this, _screen); } Common::Error GargoyleEngine::run() { diff --git a/engines/gargoyle/gargoyle.h b/engines/gargoyle/gargoyle.h index bd977137b4..e7d5df2ae4 100644 --- a/engines/gargoyle/gargoyle.h +++ b/engines/gargoyle/gargoyle.h @@ -73,10 +73,7 @@ private: void initialize(); protected: const GargoyleGameDescription *_gameDescription; - Events *_events; Graphics::Screen *_screen; - Streams *_streams; - Windows *_windows; Common::RandomSource _random; int _loadSaveSlot; @@ -92,6 +89,10 @@ protected: * Main game loop for the individual interpreters */ virtual void runGame(Common::SeekableReadStream *gameFile) = 0; +public: + Events *_events; + Streams *_streams; + Windows *_windows; public: GargoyleEngine(OSystem *syst, const GargoyleGameDescription *gameDesc); virtual ~GargoyleEngine(); diff --git a/engines/gargoyle/glk.cpp b/engines/gargoyle/glk.cpp index 22d02f5237..b49fb63e66 100644 --- a/engines/gargoyle/glk.cpp +++ b/engines/gargoyle/glk.cpp @@ -22,7 +22,7 @@ #include "gargoyle/glk.h" #include "gargoyle/events.h" -#include "gargoyle/stream.h" +#include "gargoyle/streams.h" #include "gargoyle/windows.h" namespace Gargoyle { @@ -136,7 +136,7 @@ strid_t Glk::glk_window_get_echo_stream(winid_t win) { } void Glk::glk_set_window(winid_t win) { - _windows->setCurrent(win ? win->_stream : nullptr); + _streams->setCurrent(win ? win->_stream : nullptr); } strid_t Glk::glk_stream_open_file(frefid_t fileref, FileMode fmode, @@ -374,15 +374,15 @@ glui32 Glk::glk_buffer_to_title_case_uni(glui32 *buf, glui32 len, } void Glk::glk_put_char_uni(glui32 ch) { - glk_put_char_stream_uni(_windows->getCurrent(), ch); + glk_put_char_stream_uni(_streams->getCurrent(), ch); } void Glk::glk_put_string_uni(glui32 *s) { - glk_put_buffer_stream_uni(_windows->getCurrent(), s, strlen_uni(s)); + glk_put_buffer_stream_uni(_streams->getCurrent(), s, strlen_uni(s)); } void Glk::glk_put_buffer_uni(glui32 *buf, glui32 len) { - glk_put_buffer_stream_uni(_windows->getCurrent(), buf, len); + glk_put_buffer_stream_uni(_streams->getCurrent(), buf, len); } void Glk::glk_put_char_stream_uni(strid_t str, glui32 ch) { diff --git a/engines/gargoyle/module.mk b/engines/gargoyle/module.mk index 5acba6a7a4..05b7f5ff3a 100644 --- a/engines/gargoyle/module.mk +++ b/engines/gargoyle/module.mk @@ -6,7 +6,7 @@ MODULE_OBJS := \ gargoyle.o \ glk.o \ picture.o \ - stream.o \ + streams.o \ windows.o \ scott/detection.o \ scott/scott.o diff --git a/engines/gargoyle/stream.cpp b/engines/gargoyle/stream.cpp deleted file mode 100644 index c447646638..0000000000 --- a/engines/gargoyle/stream.cpp +++ /dev/null @@ -1,146 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software{} you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation{} either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY{} without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program{} if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "gargoyle/stream.h" -#include "gargoyle/windows.h" - -namespace Gargoyle { - -Stream::Stream(bool readable, bool writable, uint32 rock, bool unicode) : - _readable(readable), _writable(writable), _readCount(0), _writeCount(0), - _prev(nullptr), _next(nullptr), _rock(0) { -} - -Stream *Stream::getNext(uint32 *rock) const { - Stream *stream = _next; - if (rock) - *rock = stream ? stream->_rock : 0; - return stream; -} - -void Stream::fillResult(StreamResult *result) { - if (result) { - result->_readCount = _readCount; - result->_writeCount = _writeCount; - } -} - -void Stream::close(StreamResult *result) { - fillResult(result); - -} - -/*--------------------------------------------------------------------------*/ - -void WindowStream::writeChar(unsigned char ch) { - -} - -void WindowStream::writeCharUni(uint32 ch) { - -} - -/*--------------------------------------------------------------------------*/ - -MemoryStream::MemoryStream(void *buf, size_t buflen, FileMode mode, uint32 rock, bool unicode) : - Stream(mode != filemode_Write, mode != filemode_Read, rock, unicode), - _buf(buf), _buflen(buflen), _bufptr(buf) { - assert(_buf && _buflen); - assert(mode == filemode_Read || mode == filemode_Write || mode == filemode_ReadWrite); - - if (unicode) - _bufend = (uint32 *)buf + buflen; - else - _bufend = (byte *)buf + buflen; - _bufeof = mode == filemode_Write ? _buf : _bufend; -} - -void MemoryStream::writeChar(unsigned char ch) { - -} - -void MemoryStream::writeCharUni(uint32 ch) { - -} - -/*--------------------------------------------------------------------------*/ - -/*--------------------------------------------------------------------------*/ - -/*--------------------------------------------------------------------------*/ - -Streams::Streams() : _streamList(nullptr) {} - -Streams::~Streams() { - while (_streamList) - deleteStream(_streamList); -} - -WindowStream *Streams::addWindowStream(Window *window) { - WindowStream *stream = new WindowStream(window); - addStream(stream); - return stream; -} - -MemoryStream *Streams::addMemoryStream(void *buf, size_t buflen, FileMode mode, uint32 rock, bool unicode) { - MemoryStream *stream = new MemoryStream(buf, buflen, mode, rock, unicode); - addStream(stream); - return stream; -} - -void Streams::addStream(Stream *stream) { - stream->_next = _streamList; - _streamList = stream; - if (stream->_next) - stream->_next->_prev = stream; -} - -void Streams::deleteStream(Stream *stream) { - Stream *prev = stream->_prev; - Stream *next = stream->_next; - - if (prev) - prev->_next = next; - else - _streamList = next; - if (next) - next->_prev = prev; - - delete stream; -} - -Stream *Streams::getFirst(uint32 *rock) { - if (rock) - *rock = _streamList ? _streamList->_rock : 0; - return _streamList; -} - -/*--------------------------------------------------------------------------*/ - -size_t strlen_uni(const uint32 *s) { - size_t len = 0; - while (*s++) - ++len; - return len; -} - -} // End of namespace Gargoyle diff --git a/engines/gargoyle/stream.h b/engines/gargoyle/stream.h deleted file mode 100644 index 4effee33ff..0000000000 --- a/engines/gargoyle/stream.h +++ /dev/null @@ -1,196 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#ifndef GARGOYLE_STREAM_H -#define GARGOYLE_STREAM_H - -#include "common/scummsys.h" -#include "gargoyle/glk_types.h" - -namespace Gargoyle { - -class Window; - -struct StreamResult { - uint32 _readCount; - uint32 _writeCount; -}; - -/** - * Base class for streams - */ -class Stream { -public: - Stream *_prev; - Stream *_next; - uint32 _rock; - bool _unicode; - uint32 _readCount; - uint32 _writeCount; - bool _readable, _writable; -public: - /** - * Constructor - */ - Stream(bool readable, bool writable, uint32 rock, bool unicode); - - /** - * Destructor - */ - virtual ~Stream() {} - - /** - * Get the next stream - */ - Stream *getNext(uint32 *rock) const; - - /** - * Get the rock value for the stream - */ - uint32 getRock() const { return _rock; } - - /** - * Fill out the total amount read and/or written - */ - void fillResult(StreamResult *result); - - /** - * Close the stream - */ - virtual void close(StreamResult *result = nullptr); - - /** - * Write a character - */ - virtual void writeChar(unsigned char ch) = 0; - - /** - * Write a unicode character - */ - virtual void writeCharUni(uint32 ch) = 0; -}; -typedef Stream *strid_t; - -/** - * Implements the stream for writing text to a window - */ -class WindowStream : public Stream { -private: - Window *_window; -public: - /** - * Constructor - */ - WindowStream(Window *window, uint32 rock = 0, bool unicode = true) : - Stream(true, false, rock, unicode), _window(window) {} - - /** - * Write a character - */ - virtual void writeChar(unsigned char ch) override; - - /** - * Write a unicode character - */ - virtual void writeCharUni(uint32 ch) override; -}; - -/** - * Implements an in-memory stream - */ -class MemoryStream : public Stream { -private: - void *_buf; ///< unsigned char* for latin1, glui32* for unicode - void *_bufptr; - void *_bufend; - void *_bufeof; - size_t _buflen; ///< # of bytes for latin1, # of 4-byte words for unicode -public: - /** - * Constructor - */ - MemoryStream(void *buf, size_t buflen, FileMode mode, uint32 rock = 0, bool unicode = true); - - /** - * Write a character - */ - virtual void writeChar(unsigned char ch); - - /** - * Write a unicode character - */ - virtual void writeCharUni(uint32 ch); -}; - -/** - * Streams manager - */ -class Streams { -private: - Stream *_streamList; -private: - /** - * Adds a created stream to the list - */ - void addStream(Stream *stream); -public: - /** - * Constructor - */ - Streams(); - - /** - * Destructor - */ - ~Streams(); - - /** - * Add a window stream - */ - WindowStream *addWindowStream(Window *window); - - /** - * Add a memory stream - */ - MemoryStream *addMemoryStream(void *buf, size_t buflen, FileMode mode, uint32 rock = 0, bool unicode = true); - - /** - * Delete a stream - */ - void deleteStream(Stream *stream); - - /** - * Start an Iteration through streams - */ - Stream *getFirst(uint32 *rock); -}; - - - -/* - * Get the length of a unicode string - */ -size_t strlen_uni(const uint32 *s); - -} // End of namespace Gargoyle - -#endif diff --git a/engines/gargoyle/streams.cpp b/engines/gargoyle/streams.cpp new file mode 100644 index 0000000000..62e43e3908 --- /dev/null +++ b/engines/gargoyle/streams.cpp @@ -0,0 +1,156 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software{} you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation{} either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY{} without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program{} if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "gargoyle/streams.h" +#include "gargoyle/windows.h" + +namespace Gargoyle { + +Stream::Stream(Streams *streams, bool readable, bool writable, uint32 rock, bool unicode) : + _streams(streams), _readable(readable), _writable(writable), _readCount(0), + _writeCount(0), _prev(nullptr), _next(nullptr), _rock(0) { +} + +Stream::~Stream() { + _streams->removeStream(this); +} + +Stream *Stream::getNext(uint32 *rock) const { + Stream *stream = _next; + if (rock) + *rock = stream ? stream->_rock : 0; + return stream; +} + +void Stream::fillResult(StreamResult *result) { + if (result) { + result->_readCount = _readCount; + result->_writeCount = _writeCount; + } +} + +void Stream::close(StreamResult *result) { + // Get the read/write totals + fillResult(result); + + // Remove the stream + delete this; +} + +/*--------------------------------------------------------------------------*/ + +void WindowStream::close(StreamResult *result) { + warning("cannot close window stream"); +} + +void WindowStream::writeChar(unsigned char ch) { + +} + +void WindowStream::writeCharUni(uint32 ch) { + +} + +/*--------------------------------------------------------------------------*/ + +MemoryStream::MemoryStream(Streams *streams, void *buf, size_t buflen, FileMode mode, uint32 rock, bool unicode) : + Stream(streams, mode != filemode_Write, mode != filemode_Read, rock, unicode), + _buf(buf), _buflen(buflen), _bufptr(buf) { + assert(_buf && _buflen); + assert(mode == filemode_Read || mode == filemode_Write || mode == filemode_ReadWrite); + + if (unicode) + _bufend = (uint32 *)buf + buflen; + else + _bufend = (byte *)buf + buflen; + _bufeof = mode == filemode_Write ? _buf : _bufend; +} + +void MemoryStream::writeChar(unsigned char ch) { + +} + +void MemoryStream::writeCharUni(uint32 ch) { + +} + +/*--------------------------------------------------------------------------*/ + +/*--------------------------------------------------------------------------*/ + +/*--------------------------------------------------------------------------*/ + +Streams::Streams(GargoyleEngine *engine) : _engine(engine), _streamList(nullptr), _currentStream(nullptr) { +} + +Streams::~Streams() { + while (_streamList) + deleteStream(_streamList); +} + +WindowStream *Streams::addWindowStream(Window *window) { + WindowStream *stream = new WindowStream(this, window); + addStream(stream); + return stream; +} + +MemoryStream *Streams::addMemoryStream(void *buf, size_t buflen, FileMode mode, uint32 rock, bool unicode) { + MemoryStream *stream = new MemoryStream(this, buf, buflen, mode, rock, unicode); + addStream(stream); + return stream; +} + +void Streams::addStream(Stream *stream) { + stream->_next = _streamList; + _streamList = stream; + if (stream->_next) + stream->_next->_prev = stream; +} + +void Streams::removeStream(Stream *stream) { + Stream *prev = stream->_prev; + Stream *next = stream->_next; + + if (prev) + prev->_next = next; + else + _streamList = next; + if (next) + next->_prev = prev; +} + +Stream *Streams::getFirst(uint32 *rock) { + if (rock) + *rock = _streamList ? _streamList->_rock : 0; + return _streamList; +} + +/*--------------------------------------------------------------------------*/ + +size_t strlen_uni(const uint32 *s) { + size_t len = 0; + while (*s++) + ++len; + return len; +} + +} // End of namespace Gargoyle diff --git a/engines/gargoyle/streams.h b/engines/gargoyle/streams.h new file mode 100644 index 0000000000..db21d58867 --- /dev/null +++ b/engines/gargoyle/streams.h @@ -0,0 +1,227 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#ifndef GARGOYLE_STREAMS_H +#define GARGOYLE_STREAMS_H + +#include "common/scummsys.h" +#include "gargoyle/glk_types.h" + +namespace Gargoyle { + +class GargoyleEngine; +class Window; +class Streams; + +struct StreamResult { + uint32 _readCount; + uint32 _writeCount; +}; + +/** + * Base class for streams + */ +class Stream { +public: + Streams *_streams; + Stream *_prev; + Stream *_next; + uint32 _rock; + bool _unicode; + uint32 _readCount; + uint32 _writeCount; + bool _readable, _writable; +public: + /** + * Constructor + */ + Stream(Streams *streams, bool readable, bool writable, uint32 rock, bool unicode); + + /** + * Destructor + */ + virtual ~Stream(); + + /** + * Get the next stream + */ + Stream *getNext(uint32 *rock) const; + + /** + * Get the rock value for the stream + */ + uint32 getRock() const { return _rock; } + + /** + * Fill out the total amount read and/or written + */ + void fillResult(StreamResult *result); + + /** + * Close and delete the stream + */ + void close(StreamResult *result = nullptr); + + /** + * Write a character + */ + virtual void writeChar(unsigned char ch) = 0; + + /** + * Write a unicode character + */ + virtual void writeCharUni(uint32 ch) = 0; +}; +typedef Stream *strid_t; + +/** + * Implements the stream for writing text to a window + */ +class WindowStream : public Stream { +private: + Window *_window; +public: + /** + * Constructor + */ + WindowStream(Streams *streams, Window *window, uint32 rock = 0, bool unicode = true) : + Stream(streams, true, false, rock, unicode), _window(window) {} + + /** + * Close the stream + */ + virtual void close(StreamResult *result = nullptr); + + /** + * Write a character + */ + virtual void writeChar(unsigned char ch) override; + + /** + * Write a unicode character + */ + virtual void writeCharUni(uint32 ch) override; +}; + +/** + * Implements an in-memory stream + */ +class MemoryStream : public Stream { +private: + void *_buf; ///< unsigned char* for latin1, glui32* for unicode + void *_bufptr; + void *_bufend; + void *_bufeof; + size_t _buflen; ///< # of bytes for latin1, # of 4-byte words for unicode +public: + /** + * Constructor + */ + MemoryStream(Streams *streams, void *buf, size_t buflen, FileMode mode, uint32 rock = 0, bool unicode = true); + + /** + * Write a character + */ + virtual void writeChar(unsigned char ch); + + /** + * Write a unicode character + */ + virtual void writeCharUni(uint32 ch); +}; + +/** + * Streams manager + */ +class Streams { + friend class Stream; +private: + GargoyleEngine *_engine; + Stream *_streamList; + Stream *_currentStream; +private: + /** + * Adds a created stream to the list + */ + void addStream(Stream *stream); + + /** + * Remove a stream + */ + void removeStream(Stream *stream); +public: + /** + * Constructor + */ + Streams(GargoyleEngine *engine); + + /** + * Destructor + */ + ~Streams(); + + /** + * Add a window stream + */ + WindowStream *addWindowStream(Window *window); + + /** + * Add a memory stream + */ + MemoryStream *addMemoryStream(void *buf, size_t buflen, FileMode mode, uint32 rock = 0, bool unicode = true); + + /** + * Delete a stream + */ + void deleteStream(Stream *stream) { + delete stream; + } + + /** + * Start an Iteration through streams + */ + Stream *getFirst(uint32 *rock); + + /** + * Set the current output stream + */ + void setCurrent(Stream *stream) { + assert(stream->_writable); + _currentStream = stream; + } + + /** + * Gets the current output stream + */ + Stream *getCurrent() const { return _currentStream; } +}; + + + +/* + * Get the length of a unicode string + */ +size_t strlen_uni(const uint32 *s); + +} // End of namespace Gargoyle + +#endif diff --git a/engines/gargoyle/windows.cpp b/engines/gargoyle/windows.cpp index 0abc8a8797..2c8680b45d 100644 --- a/engines/gargoyle/windows.cpp +++ b/engines/gargoyle/windows.cpp @@ -21,7 +21,8 @@ */ #include "gargoyle/windows.h" -#include "gargoyle/stream.h" +#include "gargoyle/gargoyle.h" +#include "gargoyle/streams.h" #include "common/algorithm.h" #include "common/textconsole.h" @@ -88,9 +89,10 @@ WindowStyle G_STYLES[style_NUMSTYLES] = { /*--------------------------------------------------------------------------*/ -Windows::Windows(Graphics::Screen *screen) : _screen(screen), _forceRedraw(true), _moreFocus(false), +Windows::Windows(GargoyleEngine *engine, Graphics::Screen *screen) : + _engine(engine), _screen(screen), _forceRedraw(true), _moreFocus(false), _windowList(nullptr), _rootWin(nullptr), _focusWin(nullptr), _mask(nullptr), - _claimSelect(0), _currentStr(nullptr) { + _claimSelect(0) { _imageW = _screen->w; _imageH = _screen->h; _cellW = _cellH = 8; @@ -305,7 +307,8 @@ Window::Window(Windows *windows, glui32 rock) : _magicnum(MAGIC_WINDOW_NUM), Common::fill(&fgcolor[0], &fgcolor[3], 3); disprock.num = 0; - _stream = new WindowStream(this, rock); + Streams &streams = *windows->_engine->_streams; + _stream = streams.addWindowStream(this); } /*--------------------------------------------------------------------------*/ diff --git a/engines/gargoyle/windows.h b/engines/gargoyle/windows.h index fdb29bb7b1..95f1ed48e1 100644 --- a/engines/gargoyle/windows.h +++ b/engines/gargoyle/windows.h @@ -29,10 +29,11 @@ #include "graphics/screen.h" #include "gargoyle/glk_types.h" #include "gargoyle/picture.h" -#include "gargoyle/stream.h" +#include "gargoyle/streams.h" namespace Gargoyle { +class GargoyleEngine; class Window; class PairWindow; struct WindowMask; @@ -45,7 +46,9 @@ struct WindowMask; * Main windows manager */ class Windows { + friend class Window; private: + GargoyleEngine *_engine; Graphics::Screen *_screen; Window * _windowList; ///< List of all windows Window *_rootWin; ///< The topmost window @@ -54,7 +57,6 @@ private: bool _moreFocus; bool _claimSelect; WindowMask *_mask; - Stream *_currentStr; private: /** * Create a new window @@ -98,7 +100,7 @@ public: /** * Constructor */ - Windows(Graphics::Screen *screen); + Windows(GargoyleEngine *engine, Graphics::Screen *screen); /** * Open a new window @@ -113,16 +115,6 @@ public: void clearSelection(); - /** - * Set the current output stream - */ - void setCurrent(Stream *stream) { _currentStr = stream; } - - /** - * Gets the current output stream - */ - Stream *getCurrent() const { return _currentStr; } - /** * Repaint an area of the windows */ -- cgit v1.2.3