diff options
author | Paul Gilbert | 2018-11-09 18:34:04 -0800 |
---|---|---|
committer | Paul Gilbert | 2018-12-08 19:05:59 -0800 |
commit | c4bcb0882f6e8f7fba5c89b9a561bb91fb662f1a (patch) | |
tree | 50e639a1b5ef6a259ed0650b28f72ee449fd1f5c /engines | |
parent | d6538380d7afe31b571945bf642496a08af09dfc (diff) | |
download | scummvm-rg350-c4bcb0882f6e8f7fba5c89b9a561bb91fb662f1a.tar.gz scummvm-rg350-c4bcb0882f6e8f7fba5c89b9a561bb91fb662f1a.tar.bz2 scummvm-rg350-c4bcb0882f6e8f7fba5c89b9a561bb91fb662f1a.zip |
GLK: Merge Clipboard and WindowMask into a new Selection class
Diffstat (limited to 'engines')
-rw-r--r-- | engines/gargoyle/clipboard.cpp | 51 | ||||
-rw-r--r-- | engines/gargoyle/clipboard.h | 48 | ||||
-rw-r--r-- | engines/gargoyle/events.cpp | 16 | ||||
-rw-r--r-- | engines/gargoyle/gargoyle.cpp | 11 | ||||
-rw-r--r-- | engines/gargoyle/gargoyle.h | 4 | ||||
-rw-r--r-- | engines/gargoyle/module.mk | 2 | ||||
-rw-r--r-- | engines/gargoyle/selection.cpp (renamed from engines/gargoyle/window_mask.cpp) | 37 | ||||
-rw-r--r-- | engines/gargoyle/selection.h (renamed from engines/gargoyle/window_mask.h) | 43 | ||||
-rw-r--r-- | engines/gargoyle/window_graphics.cpp | 8 | ||||
-rw-r--r-- | engines/gargoyle/window_text_buffer.cpp | 30 | ||||
-rw-r--r-- | engines/gargoyle/window_text_grid.cpp | 10 | ||||
-rw-r--r-- | engines/gargoyle/windows.h | 2 |
12 files changed, 112 insertions, 150 deletions
diff --git a/engines/gargoyle/clipboard.cpp b/engines/gargoyle/clipboard.cpp deleted file mode 100644 index 81ef12f5da..0000000000 --- a/engines/gargoyle/clipboard.cpp +++ /dev/null @@ -1,51 +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/clipboard.h" -#include "gargoyle/gargoyle.h" -#include "gargoyle/windows.h" -#include "common/system.h" - -namespace Gargoyle { - -void Clipboard::store(const uint32 *text, size_t len) { - // TODO -} - -void Clipboard::send(ClipSource source) { - // TODO -} - -void Clipboard::receive(ClipSource source) { - Windows &windows = *g_vm->_windows; - - if (g_system->hasTextInClipboard()) { - Common::String text = g_system->getTextFromClipboard(); - for (uint idx = 0; idx < text.size(); ++idx) { - uint c = text[idx]; - if (c != '\r' && c != '\n' && c != '\b' && c != '\t') - windows.inputHandleKey(c); - } - } -} - -} // End of namespace Gargoyle diff --git a/engines/gargoyle/clipboard.h b/engines/gargoyle/clipboard.h deleted file mode 100644 index 18519c736d..0000000000 --- a/engines/gargoyle/clipboard.h +++ /dev/null @@ -1,48 +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_CLIPBOARD_H -#define GARGOYLE_CLIPBOARD_H - -#include "common/array.h" - -namespace Gargoyle { - -enum ClipSource { PRIMARY = 0, CLIPBOARD = 1 }; - -/** - * Handles selection of text, and copying to and from the clipboard - */ -class Clipboard { -private: - Common::Array<uint32> _text; -public: - void store(const uint32 *text, size_t len); - - void send(ClipSource source); - - void receive(ClipSource source); -}; - -} // End of namespace Gargoyle - -#endif diff --git a/engines/gargoyle/events.cpp b/engines/gargoyle/events.cpp index 4618df4107..bc56407ee8 100644 --- a/engines/gargoyle/events.cpp +++ b/engines/gargoyle/events.cpp @@ -21,10 +21,10 @@ */ #include "gargoyle/events.h" -#include "gargoyle/clipboard.h" #include "gargoyle/conf.h" #include "gargoyle/gargoyle.h" #include "gargoyle/screen.h" +#include "gargoyle/selection.h" #include "gargoyle/windows.h" #include "graphics/cursorman.h" @@ -217,15 +217,15 @@ void Events::handleKeyDown(const Common::KeyState &ks) { if (ks.keycode == Common::KEYCODE_a) windows.inputHandleKey(keycode_Home); else if (ks.keycode == Common::KEYCODE_c) - clipboard.send(CLIPBOARD); + clipboard.clipboardSend(CLIPBOARD); else if (ks.keycode == Common::KEYCODE_e) windows.inputHandleKey(keycode_End); else if (ks.keycode == Common::KEYCODE_u) windows.inputHandleKey(keycode_Escape); else if (ks.keycode == Common::KEYCODE_v) - clipboard.receive(CLIPBOARD); + clipboard.clipboardReceive(CLIPBOARD); else if (ks.keycode == Common::KEYCODE_x) - clipboard.send(CLIPBOARD); + clipboard.clipboardSend(CLIPBOARD); else if (ks.keycode == Common::KEYCODE_LEFT || ks.keycode == Common::KEYCODE_KP4) windows.inputHandleKey(keycode_SkipWordLeft); else if (ks.keycode == Common::KEYCODE_RIGHT || ks.keycode == Common::KEYCODE_KP6) @@ -281,9 +281,9 @@ void Events::handleMouseMove(const Point &pos) { // TODO: Properly handle commented out lines if (g_vm->_copySelect) { //gdk_window_set_cursor((GTK_WIDGET(widget)->window), gdk_ibeam); - g_vm->_windowMask->moveSelection(pos); + g_vm->_selection->moveSelection(pos); } else { - if (g_vm->_windowMask->getHyperlink(pos)) { + if (g_vm->_selection->getHyperlink(pos)) { //gdk_window_set_cursor((GTK_WIDGET(widget)->window), gdk_hand); } else { //gdk_window_set_cursor((GTK_WIDGET(widget)->window), nullptr); @@ -296,7 +296,7 @@ void Events::handleButtonDown(bool isLeft, const Point &pos) { setCursor(CURSOR_IBEAM); g_vm->_windows->inputHandleClick(pos); } else { - g_vm->_clipboard->receive(PRIMARY); + g_vm->_clipboard->clipboardReceive(PRIMARY); } } @@ -304,7 +304,7 @@ void Events::handleButtonUp(bool isLeft, const Point &pos) { if (isLeft) { setCursor(CURSOR_ARROW); g_vm->_copySelect = false; - g_vm->_clipboard->send(PRIMARY); + g_vm->_clipboard->clipboardSend(PRIMARY); } } diff --git a/engines/gargoyle/gargoyle.cpp b/engines/gargoyle/gargoyle.cpp index 59a39b44aa..9c00937185 100644 --- a/engines/gargoyle/gargoyle.cpp +++ b/engines/gargoyle/gargoyle.cpp @@ -29,14 +29,13 @@ #include "graphics/scaler.h" #include "graphics/thumbnail.h" #include "gargoyle/gargoyle.h" -#include "gargoyle/clipboard.h" #include "gargoyle/conf.h" #include "gargoyle/events.h" #include "gargoyle/picture.h" #include "gargoyle/screen.h" +#include "gargoyle/selection.h" #include "gargoyle/streams.h" #include "gargoyle/windows.h" -#include "gargoyle/window_mask.h" namespace Gargoyle { @@ -44,8 +43,8 @@ GargoyleEngine *g_vm; GargoyleEngine::GargoyleEngine(OSystem *syst, const GargoyleGameDescription *gameDesc) : _gameDescription(gameDesc), Engine(syst), _random("Gargoyle"), _clipboard(nullptr), - _conf(nullptr), _events(nullptr), _picList(nullptr), _screen(nullptr), _windows(nullptr), - _windowMask(nullptr), _copySelect(false), _terminated(false), + _conf(nullptr), _events(nullptr), _picList(nullptr), _screen(nullptr), + _selection(nullptr), _windows(nullptr), _copySelect(false), _terminated(false), gli_unregister_obj(nullptr), gli_register_arr(nullptr), gli_unregister_arr(nullptr) { g_vm = this; } @@ -56,9 +55,9 @@ GargoyleEngine::~GargoyleEngine() { delete _events; delete _picList; delete _screen; + delete _selection; delete _streams; delete _windows; - delete _windowMask; } void GargoyleEngine::initialize() { @@ -75,9 +74,9 @@ void GargoyleEngine::initialize() { _clipboard = new Clipboard(); _events = new Events(); _picList = new PicList(); + _selection = new Selection(); _streams = new Streams(); _windows = new Windows(_screen); - _windowMask = new WindowMask(); } void GargoyleEngine::initGraphicsMode() { diff --git a/engines/gargoyle/gargoyle.h b/engines/gargoyle/gargoyle.h index f65ce943f1..793a353d08 100644 --- a/engines/gargoyle/gargoyle.h +++ b/engines/gargoyle/gargoyle.h @@ -38,9 +38,9 @@ class Conf; class Events; class PicList; class Screen; +class Selection; class Streams; class Windows; -class WindowMask; enum InterpreterType { INTERPRETER_ADVSYS = 0, @@ -109,9 +109,9 @@ public: Events *_events; PicList *_picList; Screen *_screen; + Selection *_selection; Streams *_streams; Windows *_windows; - WindowMask *_windowMask; bool _copySelect; bool _terminated; void (*gli_unregister_obj)(void *obj, glui32 objclass, gidispatch_rock_t objrock); diff --git a/engines/gargoyle/module.mk b/engines/gargoyle/module.mk index f4422b0b31..bf4138aadc 100644 --- a/engines/gargoyle/module.mk +++ b/engines/gargoyle/module.mk @@ -1,7 +1,6 @@ MODULE := engines/gargoyle MODULE_OBJS := \ - clipboard.o \ conf.o \ detection.o \ events.o \ @@ -10,6 +9,7 @@ MODULE_OBJS := \ glk.o \ picture.o \ screen.o \ + selection.o \ streams.o \ time.o \ unicode.o \ diff --git a/engines/gargoyle/window_mask.cpp b/engines/gargoyle/selection.cpp index 495abc68af..2b72c1e6fc 100644 --- a/engines/gargoyle/window_mask.cpp +++ b/engines/gargoyle/selection.cpp @@ -20,7 +20,7 @@ * */ -#include "gargoyle/window_mask.h" +#include "gargoyle/selection.h" #include "gargoyle/conf.h" #include "gargoyle/gargoyle.h" #include "gargoyle/windows.h" @@ -28,6 +28,29 @@ namespace Gargoyle { +void Clipboard::clipboardStore(const uint32 *text, size_t len) { + // TODO +} + +void Clipboard::clipboardSend(ClipSource source) { + // TODO +} + +void Clipboard::clipboardReceive(ClipSource source) { + Windows &windows = *g_vm->_windows; + + if (g_system->hasTextInClipboard()) { + Common::String text = g_system->getTextFromClipboard(); + for (uint idx = 0; idx < text.size(); ++idx) { + uint c = text[idx]; + if (c != '\r' && c != '\n' && c != '\b' && c != '\t') + windows.inputHandleKey(c); + } + } +} + +/*--------------------------------------------------------------------------*/ + WindowMask::WindowMask() : _hor(0), _ver(0), _links(nullptr) { _last.x = _last.y = 0; resize(g_system->getWidth(), g_system->getHeight()); @@ -107,7 +130,9 @@ glui32 WindowMask::getHyperlink(const Point &pos) const { return _links[pos.x][pos.y]; } -void WindowMask::startSelection(const Point &pos) { +/*--------------------------------------------------------------------------*/ + +void Selection::startSelection(const Point &pos) { int tx, ty; if (!_hor || !_ver) { @@ -126,7 +151,7 @@ void WindowMask::startSelection(const Point &pos) { g_vm->_windows->selectionChanged(); } -void WindowMask::moveSelection(const Point &pos) { +void Selection::moveSelection(const Point &pos) { int tx, ty; if (ABS(pos.x - _last.x) < 5 && ABS(pos.y - _last.y) < 5) @@ -146,7 +171,7 @@ void WindowMask::moveSelection(const Point &pos) { g_vm->_windows->selectionChanged(); } -void WindowMask::clearSelection() { +void Selection::clearSelection() { if (!_select.isEmpty()) Windows::_forceRedraw = true; @@ -154,7 +179,7 @@ void WindowMask::clearSelection() { g_vm->_windows->clearClaimSelect(); } -bool WindowMask::checkSelection(const Rect &r) const { +bool Selection::checkSelection(const Rect &r) const { Rect select(MIN(_select.left, _select.right), MAX(_select.left, _select.right), MIN(_select.top, _select.bottom), MAX(_select.top, _select.bottom)); if (select.isEmpty()) @@ -163,7 +188,7 @@ bool WindowMask::checkSelection(const Rect &r) const { return select.intersects(r); } -bool WindowMask::getSelection(const Rect &r, int *rx0, int *rx1) const { +bool Selection::getSelection(const Rect &r, int *rx0, int *rx1) const { uint row, upper, lower, above, below; bool row_selected, found_left, found_right; int from_right, from_below, is_above, is_below; diff --git a/engines/gargoyle/window_mask.h b/engines/gargoyle/selection.h index 502ed49c07..bc56319256 100644 --- a/engines/gargoyle/window_mask.h +++ b/engines/gargoyle/selection.h @@ -20,17 +20,47 @@ * */ -#ifndef GARGOYLE_WINDOW_MASK_H -#define GARGOYLE_WINDOW_MASK_H +#ifndef GARGOYLE_SELECTION_H +#define GARGOYLE_SELECTION_H -#include "common/rect.h" #include "gargoyle/glk_types.h" #include "gargoyle/utils.h" +#include "common/array.h" +#include "common/rect.h" namespace Gargoyle { +enum ClipSource { PRIMARY = 0, CLIPBOARD = 1 }; + class Window; +/** + * Acts as interface to and from the system's clipboard storage + */ +class Clipboard { +private: + Common::Array<uint32> _text; +public: + /** + * Makes a copy of selected text in preparation for the user copying it + * to the clpboard + */ + void clipboardStore(const uint32 *text, size_t len); + + /** + * Send previously designated text to the clipboard + */ + void clipboardSend(ClipSource source); + + /** + * Receive text from the clipboard, and paste it into the current window + */ + void clipboardReceive(ClipSource source); +}; + +/** + * Manages hyperlinks for the screen + */ class WindowMask { public: size_t _hor, _ver; @@ -51,7 +81,14 @@ public: void putHyperlink(glui32 linkval, uint x0, uint y0, uint x1, uint y1); glui32 getHyperlink(const Point &pos) const; +}; +/** + * Overall manager for selecting areas on the screen, copying to/from the clipboard, + * and managing hyperlinks + */ +class Selection : public Clipboard, public WindowMask { +public: /** * Start selecting an area of the screen * @param pos Position to start selection area at diff --git a/engines/gargoyle/window_graphics.cpp b/engines/gargoyle/window_graphics.cpp index 3286876cb7..a0d8b6ddba 100644 --- a/engines/gargoyle/window_graphics.cpp +++ b/engines/gargoyle/window_graphics.cpp @@ -147,7 +147,7 @@ void GraphicsWindow::eraseRect(bool whole, const Rect &box) { hy1 = _bbox.top + y1; /* zero out hyperlinks for these coordinates */ - g_vm->_windowMask->putHyperlink(0, hx0, hy0, hx1, hy1); + g_vm->_selection->putHyperlink(0, hx0, hy0, hx1, hy1); _surface->fillRect(Rect(x0, y0, x1, y1), MKTAG(_bgnd[0], _bgnd[1], _bgnd[2], 0)); touch(); @@ -177,7 +177,7 @@ void GraphicsWindow::fillRect(glui32 color, const Rect &box) { hy1 = _bbox.top + y1; /* zero out hyperlinks for these coordinates */ - g_vm->_windowMask->putHyperlink(0, hx0, hy0, hx1, hy1); + g_vm->_selection->putHyperlink(0, hx0, hy0, hx1, hy1); _surface->fillRect(Rect(x0, y0, x1, y1), MKTAG(col[0], col[1], col[2], 0)); touch(); @@ -229,7 +229,7 @@ void GraphicsWindow::drawPicture(Picture *src, int x0, int y0, int width, int h hy1 = _bbox.top + y1; /* zero out or set hyperlink for these coordinates */ - g_vm->_windowMask->putHyperlink(linkval, hx0, hy0, hx1, hy1); + g_vm->_selection->putHyperlink(linkval, hx0, hy0, hx1, hy1); w = sx1 - sx0; h = sy1 - sy0; @@ -259,7 +259,7 @@ void GraphicsWindow::click(const Point &newPos) { } if (_hyperRequest) { - glui32 linkval = g_vm->_windowMask->getHyperlink(newPos); + glui32 linkval = g_vm->_selection->getHyperlink(newPos); if (linkval) { g_vm->_events->store(evtype_Hyperlink, this, linkval, 0); _hyperRequest = false; diff --git a/engines/gargoyle/window_text_buffer.cpp b/engines/gargoyle/window_text_buffer.cpp index c6dde5bdb4..a7e5365b38 100644 --- a/engines/gargoyle/window_text_buffer.cpp +++ b/engines/gargoyle/window_text_buffer.cpp @@ -21,10 +21,10 @@ */ #include "gargoyle/window_text_buffer.h" -#include "gargoyle/clipboard.h" #include "gargoyle/conf.h" #include "gargoyle/gargoyle.h" #include "gargoyle/screen.h" +#include "gargoyle/selection.h" #include "gargoyle/unicode.h" namespace Gargoyle { @@ -232,7 +232,7 @@ void TextBufferWindow::reflow() { } void TextBufferWindow::touchScroll() { - g_vm->_windowMask->clearSelection(); + g_vm->_selection->clearSelection(); _windows->repaint(_bbox); for (int i = 0; i < _scrollMax; i++) @@ -364,7 +364,7 @@ void TextBufferWindow::putTextUni(const glui32 *buf, int len, int pos, int oldle void TextBufferWindow::touch(int line) { _lines[line]._dirty = true; - g_vm->_windowMask->clearSelection(); + g_vm->_selection->clearSelection(); int y = _bbox.top + g_conf->_tMarginY + (_height - line - 1) * g_conf->_leading; _windows->repaint(Rect(_bbox.left, y - 2, _bbox.right, y + g_conf->_leading + 2)); @@ -572,7 +572,7 @@ void TextBufferWindow::click(const Point &newPos) { _windows->setFocus(this); if (_hyperRequest) { - glui32 linkval = g_vm->_windowMask->getHyperlink(newPos); + glui32 linkval = g_vm->_selection->getHyperlink(newPos); if (linkval) { g_vm->_events->store(evtype_Hyperlink, this, linkval, 0); _hyperRequest = false; @@ -596,7 +596,7 @@ void TextBufferWindow::click(const Point &newPos) { if (!gh && !gs) { g_vm->_copySelect = true; - g_vm->_windowMask->startSelection(newPos); + g_vm->_selection->startSelection(newPos); } } @@ -815,7 +815,7 @@ void TextBufferWindow::redraw() { pw = x1 - x0 - 2 * GLI_SUBPIX; // check if any part of buffer is selected - selBuf = g_vm->_windowMask->checkSelection(Rect(x0 / GLI_SUBPIX, y0, x1 / GLI_SUBPIX, y1)); + selBuf = g_vm->_selection->checkSelection(Rect(x0 / GLI_SUBPIX, y0, x1 / GLI_SUBPIX, y1)); for (i = _scrollPos + _height - 1; i >= _scrollPos; i--) { // top of line @@ -823,7 +823,7 @@ void TextBufferWindow::redraw() { // check if part of line is selected if (selBuf) { - selrow = g_vm->_windowMask->getSelection(Rect(x0 / GLI_SUBPIX, y, + selrow = g_vm->_selection->getSelection(Rect(x0 / GLI_SUBPIX, y, x1 / GLI_SUBPIX, y + g_conf->_leading), &sx0, &sx1); selleft = (sx0 == x0/GLI_SUBPIX); selright = (sx1 == x1/GLI_SUBPIX); @@ -947,7 +947,7 @@ void TextBufferWindow::redraw() { } // clear any stored hyperlink coordinates - g_vm->_windowMask->putHyperlink(0, x0/GLI_SUBPIX, y, + g_vm->_selection->putHyperlink(0, x0/GLI_SUBPIX, y, x1/GLI_SUBPIX, y + g_conf->_leading); /* @@ -970,7 +970,7 @@ void TextBufferWindow::redraw() { if (link) { screen.fillRect(Rect::fromXYWH(x / GLI_SUBPIX + 1, y + g_conf->_baseLine + 1, w / GLI_SUBPIX + 1, g_conf->_linkStyle), g_conf->_linkColor); - g_vm->_windowMask->putHyperlink(link, x/GLI_SUBPIX, y, + g_vm->_selection->putHyperlink(link, x/GLI_SUBPIX, y, x/GLI_SUBPIX + w/GLI_SUBPIX, y + g_conf->_leading); } @@ -986,7 +986,7 @@ void TextBufferWindow::redraw() { if (link) { screen.fillRect(Rect::fromXYWH(x / GLI_SUBPIX + 1, y + g_conf->_baseLine + 1, w/GLI_SUBPIX + 1, g_conf->_linkStyle), g_conf->_linkColor); - g_vm->_windowMask->putHyperlink(link, x / GLI_SUBPIX, y, + g_vm->_selection->putHyperlink(link, x / GLI_SUBPIX, y, x / GLI_SUBPIX + w / GLI_SUBPIX, y + g_conf->_leading); } @@ -1034,7 +1034,7 @@ void TextBufferWindow::redraw() { x = x0 + SLOP; y = y0 + (_height - 1) * g_conf->_leading; - g_vm->_windowMask->putHyperlink(0, x0/GLI_SUBPIX, y, + g_vm->_selection->putHyperlink(0, x0/GLI_SUBPIX, y, x1/GLI_SUBPIX, y + g_conf->_leading); color = Windows::_overrideBgSet ? g_conf->_windowColor : _bgColor; @@ -1080,7 +1080,7 @@ void TextBufferWindow::redraw() { hx1 = x0/GLI_SUBPIX + ln->_lPic->w < x1/GLI_SUBPIX ? x0/GLI_SUBPIX + ln->_lPic->w : x1/GLI_SUBPIX; - g_vm->_windowMask->putHyperlink(link, hx0, hy0, hx1, hy1); + g_vm->_selection->putHyperlink(link, hx0, hy0, hx1, hy1); } } @@ -1095,7 +1095,7 @@ void TextBufferWindow::redraw() { ? x1/GLI_SUBPIX - ln->_rPic->w : x0/GLI_SUBPIX; hx1 = x1/GLI_SUBPIX; - g_vm->_windowMask->putHyperlink(link, hx0, hy0, hx1, hy1); + g_vm->_selection->putHyperlink(link, hx0, hy0, hx1, hy1); } } } @@ -1114,7 +1114,7 @@ void TextBufferWindow::redraw() { y0 = _bbox.top + g_conf->_tMarginY; y1 = _bbox.bottom - g_conf->_tMarginY; - g_vm->_windowMask->putHyperlink(0, x0, y0, x1, y1); + g_vm->_selection->putHyperlink(0, x0, y0, x1, y1); y0 += g_conf->_scrollWidth / 2; y1 -= g_conf->_scrollWidth / 2; @@ -1144,7 +1144,7 @@ void TextBufferWindow::redraw() { if (selBuf && _copyPos) { Windows::_claimSelect = true; - g_vm->_clipboard->store(_copyBuf, _copyPos); + g_vm->_clipboard->clipboardStore(_copyBuf, _copyPos); for (i = 0; i < _copyPos; i++) _copyBuf[i] = 0; _copyPos = 0; diff --git a/engines/gargoyle/window_text_grid.cpp b/engines/gargoyle/window_text_grid.cpp index 351d9fbe23..1e5e41dd53 100644 --- a/engines/gargoyle/window_text_grid.cpp +++ b/engines/gargoyle/window_text_grid.cpp @@ -23,8 +23,8 @@ #include "gargoyle/window_text_grid.h" #include "gargoyle/conf.h" #include "gargoyle/gargoyle.h" +#include "gargoyle/selection.h" #include "gargoyle/screen.h" -#include "gargoyle/window_mask.h" namespace Gargoyle { @@ -204,7 +204,7 @@ void TextGridWindow::click(const Point &newPos) { } if (_hyperRequest) { - glui32 linkval = g_vm->_windowMask->getHyperlink(newPos); + glui32 linkval = g_vm->_selection->getHyperlink(newPos); if (linkval) { g_vm->_events->store(evtype_Hyperlink, this, linkval, 0); @@ -592,7 +592,7 @@ void TextGridWindow::redraw() { y = y0 + i * g_conf->_leading; // clear any stored hyperlink coordinates - g_vm->_windowMask->putHyperlink(0, x0, y, x0 + g_conf->_cellW * _width, y + g_conf->_leading); + g_vm->_selection->putHyperlink(0, x0, y, x0 + g_conf->_cellW * _width, y + g_conf->_leading); a = 0; for (b = 0; b < _width; b++) { @@ -612,7 +612,7 @@ void TextGridWindow::redraw() { if (link) { screen.fillRect(Rect::fromXYWH(x, y + g_conf->_baseLine + 1, w, g_conf->_linkStyle), g_conf->_linkColor); - g_vm->_windowMask->putHyperlink(link, x, y, x + w, y + g_conf->_leading); + g_vm->_selection->putHyperlink(link, x, y, x + w, y + g_conf->_leading); } x += w; @@ -634,7 +634,7 @@ void TextGridWindow::redraw() { if (link) { screen.fillRect(Rect::fromXYWH(x, y + g_conf->_baseLine + 1, w, g_conf->_linkStyle), g_conf->_linkColor); - g_vm->_windowMask->putHyperlink(link, x, y, x + w, y + g_conf->_leading); + g_vm->_selection->putHyperlink(link, x, y, x + w, y + g_conf->_leading); } } } diff --git a/engines/gargoyle/windows.h b/engines/gargoyle/windows.h index 5830c7c85e..0e4020bb76 100644 --- a/engines/gargoyle/windows.h +++ b/engines/gargoyle/windows.h @@ -30,8 +30,8 @@ #include "gargoyle/events.h" #include "gargoyle/glk_types.h" #include "gargoyle/fonts.h" +#include "gargoyle/selection.h" #include "gargoyle/streams.h" -#include "gargoyle/window_mask.h" namespace Gargoyle { |