aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2019-08-04 14:40:01 -0700
committerPaul Gilbert2019-08-04 16:44:22 -0700
commit8a51f305335810d52d3633f8b1cc910b84c5f0e6 (patch)
tree4d3330d15c82086bd6fb94e04ef3f4cdd208cfba
parent2d0912b59b6a5d02f5bfb131e0c288382ca83432 (diff)
downloadscummvm-rg350-8a51f305335810d52d3633f8b1cc910b84c5f0e6.tar.gz
scummvm-rg350-8a51f305335810d52d3633f8b1cc910b84c5f0e6.tar.bz2
scummvm-rg350-8a51f305335810d52d3633f8b1cc910b84c5f0e6.zip
GLK: Create an intermediate TextWindow base class for text windows
This will make it easier to check whether a window is textual without having to check for both the grid & buffer classes explicitly
-rw-r--r--engines/glk/window_text_buffer.cpp2
-rw-r--r--engines/glk/window_text_buffer.h2
-rw-r--r--engines/glk/window_text_grid.cpp2
-rw-r--r--engines/glk/window_text_grid.h2
-rw-r--r--engines/glk/windows.h11
5 files changed, 15 insertions, 4 deletions
diff --git a/engines/glk/window_text_buffer.cpp b/engines/glk/window_text_buffer.cpp
index b182643644..6c312be607 100644
--- a/engines/glk/window_text_buffer.cpp
+++ b/engines/glk/window_text_buffer.cpp
@@ -36,7 +36,7 @@ namespace Glk {
#define SLOP (2 * GLI_SUBPIX)
-TextBufferWindow::TextBufferWindow(Windows *windows, uint rock) : Window(windows, rock),
+TextBufferWindow::TextBufferWindow(Windows *windows, uint rock) : TextWindow(windows, rock),
_font(g_conf->_propInfo), _historyPos(0), _historyFirst(0), _historyPresent(0),
_lastSeen(0), _scrollPos(0), _scrollMax(0), _scrollBack(SCROLLBACK), _width(-1), _height(-1),
_inBuf(nullptr), _lineTerminators(nullptr), _echoLineInput(true), _ladjw(0), _radjw(0),
diff --git a/engines/glk/window_text_buffer.h b/engines/glk/window_text_buffer.h
index 9020c1a871..2e1e2ff653 100644
--- a/engines/glk/window_text_buffer.h
+++ b/engines/glk/window_text_buffer.h
@@ -35,7 +35,7 @@ namespace Glk {
/**
* Text Buffer window
*/
-class TextBufferWindow : public Window, Speech {
+class TextBufferWindow : public TextWindow, Speech {
/**
* Structure for a row within the window
*/
diff --git a/engines/glk/window_text_grid.cpp b/engines/glk/window_text_grid.cpp
index 226b2f1acd..fb5a3a4bc6 100644
--- a/engines/glk/window_text_grid.cpp
+++ b/engines/glk/window_text_grid.cpp
@@ -28,7 +28,7 @@
namespace Glk {
-TextGridWindow::TextGridWindow(Windows *windows, uint rock) : Window(windows, rock),
+TextGridWindow::TextGridWindow(Windows *windows, uint rock) : TextWindow(windows, rock),
_font(g_conf->_monoInfo) {
_type = wintype_TextGrid;
_width = _height = 0;
diff --git a/engines/glk/window_text_grid.h b/engines/glk/window_text_grid.h
index de64ab3801..c9c4b0364c 100644
--- a/engines/glk/window_text_grid.h
+++ b/engines/glk/window_text_grid.h
@@ -31,7 +31,7 @@ namespace Glk {
/**
* Text Grid window
*/
-class TextGridWindow : public Window {
+class TextGridWindow : public TextWindow {
/**
* Structure for a row within the grid window
*/
diff --git a/engines/glk/windows.h b/engines/glk/windows.h
index 1974b3e4a4..f3edbb2069 100644
--- a/engines/glk/windows.h
+++ b/engines/glk/windows.h
@@ -595,6 +595,17 @@ public:
BlankWindow(Windows *windows, uint rock);
};
+/**
+ * Abstract common base for the text window classes
+ */
+class TextWindow : public Window {
+public:
+ /**
+ * Constructor
+ */
+ TextWindow(Windows *windows, uint rock) : Window(windows, rock) {}
+};
+
} // End of namespace Glk
#endif