aboutsummaryrefslogtreecommitdiff
path: root/engines/gargoyle/windows.h
diff options
context:
space:
mode:
authorPaul Gilbert2018-10-18 21:15:43 -0700
committerPaul Gilbert2018-12-08 19:05:59 -0800
commit47a7a1d4e2640b3b34e2091be606b26723990efb (patch)
treeb2756a6f1f5d8f8724fd9dfaf099f4434f321b70 /engines/gargoyle/windows.h
parent77f357e72f1f1bfad93b3b1c54f6f57b67131ba7 (diff)
downloadscummvm-rg350-47a7a1d4e2640b3b34e2091be606b26723990efb.tar.gz
scummvm-rg350-47a7a1d4e2640b3b34e2091be606b26723990efb.tar.bz2
scummvm-rg350-47a7a1d4e2640b3b34e2091be606b26723990efb.zip
GLK: Added setup of text grid windows
Diffstat (limited to 'engines/gargoyle/windows.h')
-rw-r--r--engines/gargoyle/windows.h107
1 files changed, 93 insertions, 14 deletions
diff --git a/engines/gargoyle/windows.h b/engines/gargoyle/windows.h
index 91cbc91a53..45907a86e3 100644
--- a/engines/gargoyle/windows.h
+++ b/engines/gargoyle/windows.h
@@ -23,6 +23,7 @@
#ifndef GARGOYLE_WINDOWS_H
#define GARGOYLE_WINDOWS_H
+#include "common/array.h"
#include "common/list.h"
#include "common/rect.h"
#include "common/stream.h"
@@ -58,6 +59,24 @@ private:
*/
void rearrange();
public:
+ static bool _confLockCols, _confLockRows;
+ static int _wMarginx;
+ static int _wMarginy;
+ static int _wPaddingx;
+ static int _wPaddingy;
+ static int _wBorderx;
+ static int _wBordery;
+ static int _tMarginx;
+ static int _tMarginy;
+ static int _wMarginXsave;
+ static int _wMarginYsave;
+ static int _cols;
+ static int _rows;
+ static int _imageW, _imageH;
+ static int _cellW, _cellH;
+ static int _baseLine;
+ static int _leading;
+public:
/**
* Constructor
*/
@@ -76,9 +95,21 @@ public:
};
/**
+ * Window styles
+ */
+struct WindowStyle {
+ int font;
+ byte bg[3];
+ byte fg[3];
+ int reverse;
+
+ WindowStyle();
+};
+
+/**
* Window attributes
*/
-struct attr_t {
+struct Attributes {
unsigned fgset : 1;
unsigned bgset : 1;
unsigned reverse : 1;
@@ -87,20 +118,18 @@ struct attr_t {
unsigned fgcolor : 24;
unsigned bgcolor : 24;
unsigned hyper : 32;
-};
-struct WindowPair {
- Window *owner;
- Window *child1, *child2;
+ /**
+ * Constructor
+ */
+ Attributes() {
+ clear();
+ }
- // split info...
- glui32 dir; ///< winmethod_Left, Right, Above, or Below
- int vertical, backward; ///< flags
- glui32 division; ///< winmethod_Fixed or winmethod_Proportional
- Window *key; ///< NULL or a leaf-descendant (not a Pair)
- int keydamage; ///< used as scratch space in window closing
- glui32 size; ///< size value
- glui32 wborder; ///< winMethod_Border, NoBorder
+ /**
+ * Clear
+ */
+ void clear();
};
/**
@@ -133,7 +162,7 @@ public:
glui32 *line_terminators;
glui32 termct;
- attr_t attr;
+ Attributes attr;
byte bgcolor[3];
byte fgcolor[3];
@@ -149,6 +178,11 @@ public:
* Destructor
*/
virtual ~Window() {}
+
+ /**
+ * Rearranges the window
+ */
+ virtual void rearrange(const Common::Rect &box) { bbox = box; }
};
typedef Window *winid_t;
@@ -167,11 +201,56 @@ public:
* Text Grid window
*/
class TextGridWindow : public Window {
+ /**
+ * Structure for a row within the grid window
+ */
+ struct TextGridRow {
+ Common::Array<uint32> chars;
+ Common::Array<Attributes> attr;
+ bool dirty;
+
+ /**
+ * Constructor
+ */
+ TextGridRow() : dirty(false) {}
+
+ /**
+ * Resize the row
+ */
+ void resize(size_t newSize);
+ };
+ typedef Common::Array<TextGridRow> TextGridRows;
+private:
+ /**
+ * Mark a given text row as modified
+ */
+ void touch(int line);
+public:
+ int width, height;
+ TextGridRows lines;
+
+ int curx, cury; ///< the window cursor position
+
+ ///< for line input
+ void *inbuf; ///< unsigned char* for latin1, glui32* for unicode
+ int inorgx, inorgy;
+ int inmax;
+ int incurs, inlen;
+ Attributes origattr;
+ gidispatch_rock_t inarrayrock;
+ glui32 *line_terminators;
+
+ WindowStyle styles[style_NUMSTYLES]; ///< style hints and settings
public:
/**
* Constructor
*/
TextGridWindow(uint32 rock);
+
+ /**
+ * Rearranges the window
+ */
+ virtual void rearrange(const Common::Rect &box);
};
/**