aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2014-05-04 20:01:29 -0400
committerJesse Luehrs <doy@tozt.net>2014-05-04 20:01:29 -0400
commite9ff48e51a9df78375ce703ff3d4df1a362ac259 (patch)
treed4165155445d4fe741145243d1559d4cac6446d0
parent270d383f9fa721bf910235625c77c6ce9245df7e (diff)
downloadrunes-e9ff48e51a9df78375ce703ff3d4df1a362ac259.tar.gz
runes-e9ff48e51a9df78375ce703ff3d4df1a362ac259.zip
refactor to make alternate screens work again
-rw-r--r--src/display.c14
-rw-r--r--src/parser.c1712
-rw-r--r--src/parser.l31
-rw-r--r--src/pty-unix.c4
-rw-r--r--src/screen.c291
-rw-r--r--src/screen.h20
-rw-r--r--src/term.c2
-rw-r--r--src/window-xlib.c4
8 files changed, 444 insertions, 1634 deletions
diff --git a/src/display.c b/src/display.c
index 71fb9df..be64180 100644
--- a/src/display.c
+++ b/src/display.c
@@ -91,10 +91,10 @@ void runes_display_draw_screen(RunesTerm *t)
}
/* XXX quite inefficient */
- for (r = 0; r < t->scr.max.row; ++r) {
+ for (r = 0; r < t->scr.grid->max.row; ++r) {
int c = 0;
- while (c < t->scr.max.col) {
+ while (c < t->scr.grid->max.col) {
c += runes_display_draw_cell(t, r, c);
}
}
@@ -106,10 +106,10 @@ void runes_display_draw_screen(RunesTerm *t)
void runes_display_draw_cursor(RunesTerm *t, cairo_t *cr)
{
if (!t->scr.hide_cursor) {
- int row = t->scr.cur.row, col = t->scr.cur.col;
+ int row = t->scr.grid->cur.row, col = t->scr.grid->cur.col;
- if (col >= t->scr.max.col) {
- col = t->scr.max.col - 1;
+ if (col >= t->scr.grid->max.col) {
+ col = t->scr.grid->max.col - 1;
}
cairo_save(cr);
@@ -124,7 +124,7 @@ void runes_display_draw_cursor(RunesTerm *t, cairo_t *cr)
cairo_stroke(cr);
}
else {
- struct runes_cell *cell = &t->scr.rows[t->scr.row_top + row].cells[col];
+ struct runes_cell *cell = &t->scr.grid->rows[t->scr.grid->row_top + row].cells[col];
cairo_rectangle(
cr,
@@ -182,7 +182,7 @@ static void runes_display_recalculate_font_metrics(RunesTerm *t)
static int runes_display_draw_cell(RunesTerm *t, int row, int col)
{
- struct runes_cell *cell = &t->scr.rows[row + t->scr.row_top - t->scr.row_visible_offset].cells[col];
+ struct runes_cell *cell = &t->scr.grid->rows[row + t->scr.grid->row_top - t->scr.row_visible_offset].cells[col];
cairo_pattern_t *bg = NULL, *fg = NULL;
int bg_is_custom = 0, fg_is_custom = 0;
diff --git a/src/parser.c b/src/parser.c
index 50fc18b..193c747 100644
--- a/src/parser.c
+++ b/src/parser.c
@@ -336,1430 +336,6 @@ typedef int yy_state_type;
#define yytext_ptr yytext_r
-static yyconst flex_int16_t yy_nxt[][52] =
- {
- {
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0
- },
-
- {
- 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
- 13, 14, 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
-
- 14, 14, 14, 14, 14, 14, 14, 15, 16, 17,
- 18, 15
- },
-
- {
- 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
- 13, 14, 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 15, 16, 17,
- 18, 15
- },
-
- {
- -3, -3, -3, -3, -3, -3, -3, -3, -3, -3,
- -3, -3, -3, -3, -3, -3, -3, -3, -3, -3,
-
- -3, -3, -3, -3, -3, -3, -3, -3, -3, -3,
- -3, -3, -3, -3, -3, -3, -3, -3, -3, -3,
- -3, -3, -3, -3, -3, -3, -3, -3, -3, -3,
- -3, -3
- },
-
- {
- 3, -4, -4, -4, -4, -4, -4, -4, -4, -4,
- -4, -4, -4, -4, -4, -4, -4, -4, -4, -4,
- -4, -4, -4, -4, -4, -4, -4, -4, -4, -4,
- -4, -4, -4, -4, -4, -4, -4, -4, -4, -4,
- -4, -4, -4, -4, -4, -4, -4, -4, -4, -4,
- -4, -4
-
- },
-
- {
- 3, -5, -5, -5, -5, -5, -5, -5, -5, -5,
- -5, -5, -5, -5, -5, -5, -5, -5, -5, -5,
- -5, -5, -5, -5, -5, -5, -5, -5, -5, -5,
- -5, -5, -5, -5, -5, -5, -5, -5, -5, -5,
- -5, -5, -5, -5, -5, -5, -5, -5, -5, -5,
- -5, -5
- },
-
- {
- 3, -6, -6, -6, -6, -6, -6, -6, -6, -6,
- -6, -6, -6, -6, -6, -6, -6, -6, -6, -6,
- -6, -6, -6, -6, -6, -6, -6, -6, -6, -6,
- -6, -6, -6, -6, -6, -6, -6, -6, -6, -6,
-
- -6, -6, -6, -6, -6, -6, -6, -6, -6, -6,
- -6, -6
- },
-
- {
- 3, -7, -7, -7, -7, -7, -7, -7, -7, -7,
- -7, -7, -7, -7, -7, -7, -7, -7, -7, -7,
- -7, -7, -7, -7, -7, -7, -7, -7, -7, -7,
- -7, -7, -7, -7, -7, -7, -7, -7, -7, -7,
- -7, -7, -7, -7, -7, -7, -7, -7, -7, -7,
- -7, -7
- },
-
- {
- 3, -8, -8, -8, -8, -8, -8, -8, -8, -8,
- -8, -8, -8, -8, -8, -8, -8, -8, -8, -8,
-
- -8, -8, -8, -8, -8, -8, -8, -8, -8, -8,
- -8, -8, -8, -8, -8, -8, -8, -8, -8, -8,
- -8, -8, -8, -8, -8, -8, -8, -8, -8, -8,
- -8, -8
- },
-
- {
- 3, -9, -9, -9, -9, -9, -9, -9, -9, -9,
- -9, -9, -9, -9, -9, -9, -9, -9, -9, -9,
- -9, -9, -9, -9, -9, -9, -9, -9, -9, -9,
- -9, -9, -9, -9, -9, -9, -9, -9, -9, -9,
- -9, -9, -9, -9, -9, -9, -9, -9, -9, -9,
- -9, -9
-
- },
-
- {
- 3, -10, -10, -10, -10, -10, -10, -10, -10, -10,
- -10, -10, -10, -10, -10, -10, -10, -10, -10, -10,
- -10, -10, -10, -10, -10, -10, -10, -10, -10, -10,
- -10, -10, -10, -10, -10, -10, -10, -10, -10, -10,
- -10, -10, -10, -10, -10, -10, -10, -10, -10, -10,
- -10, -10
- },
-
- {
- 3, -11, -11, -11, -11, -11, -11, -11, -11, -11,
- -11, -11, -11, -11, -11, -11, -11, -11, -11, -11,
- -11, -11, -11, -11, -11, -11, -11, -11, -11, -11,
- -11, -11, -11, -11, -11, -11, -11, -11, -11, -11,
-
- -11, -11, -11, -11, -11, -11, -11, -11, -11, -11,
- -11, -11
- },
-
- {
- 3, -12, -12, -12, -12, -12, -12, -12, -12, -12,
- -12, -12, -12, -12, -12, -12, -12, -12, -12, -12,
- -12, -12, -12, -12, -12, -12, -12, -12, -12, -12,
- -12, -12, -12, -12, -12, -12, -12, -12, -12, -12,
- -12, -12, -12, -12, -12, -12, -12, -12, -12, -12,
- -12, -12
- },
-
- {
- 3, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 20, 21, 22, 23, 24, 20, 20, 20, 20,
-
- 25, 26, 20, 20, 20, 27, 28, 20, 20, 20,
- 20, 20, 20, 20, 20, 20, 20, 29, 20, 30,
- 31, 32, 33, 20, 20, 20, 20, -13, 34, 35,
- 36, -13
- },
-
- {
- 3, -14, -14, -14, -14, -14, -14, -14, -14, -14,
- -14, 37, 37, 37, 37, 37, 37, 37, 37, 37,
- 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
- 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
- 37, 37, 37, 37, 37, 37, 37, -14, 38, 39,
- 40, -14
-
- },
-
- {
- 3, -15, -15, -15, -15, -15, -15, -15, -15, -15,
- -15, -15, -15, -15, -15, -15, -15, -15, -15, -15,
- -15, -15, -15, -15, -15, -15, -15, -15, -15, -15,
- -15, -15, -15, -15, -15, -15, -15, -15, -15, -15,
- -15, -15, -15, -15, -15, -15, -15, -15, -15, -15,
- -15, -15
- },
-
- {
- 3, -16, -16, -16, -16, -16, -16, -16, -16, -16,
- -16, -16, -16, -16, -16, -16, -16, -16, -16, -16,
- -16, -16, -16, -16, -16, -16, -16, -16, -16, -16,
- -16, -16, -16, -16, -16, -16, -16, -16, -16, -16,
-
- -16, -16, -16, -16, -16, -16, -16, 41, -16, -16,
- -16, -16
- },
-
- {
- 3, -17, -17, -17, -17, -17, -17, -17, -17, -17,
- -17, -17, -17, -17, -17, -17, -17, -17, -17, -17,
- -17, -17, -17, -17, -17, -17, -17, -17, -17, -17,
- -17, -17, -17, -17, -17, -17, -17, -17, -17, -17,
- -17, -17, -17, -17, -17, -17, -17, 42, -17, -17,
- -17, -17
- },
-
- {
- 3, -18, -18, -18, -18, -18, -18, -18, -18, -18,
- -18, -18, -18, -18, -18, -18, -18, -18, -18, -18,
-
- -18, -18, -18, -18, -18, -18, -18, -18, -18, -18,
- -18, -18, -18, -18, -18, -18, -18, -18, -18, -18,
- -18, -18, -18, -18, -18, -18, -18, 43, -18, -18,
- -18, -18
- },
-
- {
- 3, -19, -19, -19, -19, -19, -19, -19, -19, -19,
- -19, -19, -19, -19, -19, -19, -19, -19, -19, -19,
- -19, -19, -19, -19, -19, -19, -19, -19, -19, -19,
- -19, -19, -19, -19, -19, -19, -19, -19, -19, -19,
- -19, -19, -19, -19, -19, -19, -19, -19, -19, -19,
- -19, -19
-
- },
-
- {
- 3, -20, -20, -20, -20, -20, -20, -20, -20, -20,
- -20, -20, -20, -20, -20, -20, -20, -20, -20, -20,
- -20, -20, -20, -20, -20, -20, -20, -20, -20, -20,
- -20, -20, -20, -20, -20, -20, -20, -20, -20, -20,
- -20, -20, -20, -20, -20, -20, -20, -20, -20, -20,
- -20, -20
- },
-
- {
- 3, -21, -21, -21, -21, -21, -21, -21, -21, -21,
- -21, 44, 44, 44, 44, 44, 45, 45, 45, 45,
- 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
- 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
-
- 45, 45, 45, 45, 45, 45, 45, -21, -21, -21,
- -21, -21
- },
-
- {
- 3, -22, -22, -22, -22, -22, -22, -22, -22, -22,
- -22, 46, 46, 46, 46, 46, 47, 47, 47, 47,
- 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
- 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
- 47, 47, 47, 47, 47, 47, 47, -22, -22, -22,
- -22, -22
- },
-
- {
- 3, -23, -23, -23, -23, -23, -23, -23, -23, -23,
- -23, 48, 48, 48, 48, 48, 49, 49, 49, 49,
-
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, -23, -23, -23,
- -23, -23
- },
-
- {
- 3, -24, -24, -24, -24, -24, -24, -24, -24, -24,
- -24, 50, 50, 50, 50, 50, 51, 51, 51, 51,
- 51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
- 51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
- 51, 51, 51, 51, 51, 51, 51, -24, -24, -24,
- -24, -24
-
- },
-
- {
- 3, -25, -25, -25, -25, -25, -25, -25, -25, -25,
- -25, -25, -25, -25, -25, -25, -25, -25, -25, -25,
- -25, -25, -25, -25, -25, -25, -25, -25, -25, -25,
- -25, -25, -25, -25, -25, -25, -25, -25, -25, -25,
- -25, -25, -25, -25, -25, -25, -25, -25, -25, -25,
- -25, -25
- },
-
- {
- 3, -26, -26, -26, -26, -26, -26, -26, -26, -26,
- -26, -26, -26, -26, -26, -26, -26, -26, -26, -26,
- -26, -26, -26, -26, -26, -26, -26, -26, -26, -26,
- -26, -26, -26, -26, -26, -26, -26, -26, -26, -26,
-
- -26, -26, -26, -26, -26, -26, -26, -26, -26, -26,
- -26, -26
- },
-
- {
- 3, -27, -27, -27, -27, -27, -27, -27, -27, -27,
- -27, -27, -27, -27, -27, -27, -27, -27, -27, -27,
- -27, -27, -27, -27, -27, -27, -27, -27, -27, -27,
- -27, -27, -27, -27, -27, -27, -27, -27, -27, -27,
- -27, -27, -27, -27, -27, -27, -27, -27, -27, -27,
- -27, -27
- },
-
- {
- 3, -28, -28, -28, -28, -28, -28, -28, -28, -28,
- -28, -28, -28, -28, -28, -28, -28, -28, -28, -28,
-
- -28, -28, -28, -28, -28, -28, -28, -28, -28, -28,
- -28, -28, -28, -28, -28, -28, -28, -28, -28, -28,
- -28, -28, -28, -28, -28, -28, -28, -28, -28, -28,
- -28, -28
- },
-
- {
- 3, -29, -29, -29, -29, -29, -29, -29, -29, -29,
- -29, -29, -29, -29, -29, -29, -29, -29, -29, -29,
- -29, -29, -29, -29, -29, -29, -29, -29, -29, -29,
- -29, -29, -29, -29, -29, -29, -29, -29, -29, -29,
- -29, -29, -29, -29, -29, -29, -29, -29, -29, -29,
- -29, -29
-
- },
-
- {
- 3, 52, 52, 52, 52, 52, 52, 52, 52, 52,
- 52, 53, 53, 53, 53, 53, 54, 54, 54, 54,
- 54, 54, 53, 55, 56, 56, 53, 57, 58, 59,
- 60, 61, 62, 63, 64, 65, 66, 67, 68, 53,
- 53, 53, 53, 69, 70, 71, 72, -30, 73, 74,
- 75, -30
- },
-
- {
- 3, 76, 76, 76, 76, 76, 76, 76, 76, 76,
- 76, 77, 77, 77, 77, 77, 78, 79, 80, 77,
- 77, 77, 77, 77, 77, 77, 77, 77, 77, 77,
- 77, 77, 77, 77, 77, 77, 77, 77, 77, 77,
-
- 77, 77, 77, 77, 77, 77, 77, -31, 81, 82,
- 83, -31
- },
-
- {
- 3, -32, -32, -32, -32, -32, -32, -32, -32, -32,
- -32, -32, -32, -32, -32, -32, -32, -32, -32, -32,
- -32, -32, -32, -32, -32, -32, -32, -32, -32, -32,
- -32, -32, -32, -32, -32, -32, -32, -32, -32, -32,
- -32, -32, -32, -32, -32, -32, -32, -32, -32, -32,
- -32, -32
- },
-
- {
- 3, -33, -33, -33, -33, -33, -33, -33, -33, -33,
- -33, -33, -33, -33, -33, -33, -33, -33, -33, -33,
-
- -33, -33, -33, -33, -33, -33, -33, -33, -33, -33,
- -33, -33, -33, -33, -33, -33, -33, -33, -33, -33,
- -33, -33, -33, -33, -33, -33, -33, -33, -33, -33,
- -33, -33
- },
-
- {
- 3, -34, -34, -34, -34, -34, -34, -34, -34, -34,
- -34, -34, -34, -34, -34, -34, -34, -34, -34, -34,
- -34, -34, -34, -34, -34, -34, -34, -34, -34, -34,
- -34, -34, -34, -34, -34, -34, -34, -34, -34, -34,
- -34, -34, -34, -34, -34, -34, -34, 20, -34, -34,
- -34, -34
-
- },
-
- {
- 3, -35, -35, -35, -35, -35, -35, -35, -35, -35,
- -35, -35, -35, -35, -35, -35, -35, -35, -35, -35,
- -35, -35, -35, -35, -35, -35, -35, -35, -35, -35,
- -35, -35, -35, -35, -35, -35, -35, -35, -35, -35,
- -35, -35, -35, -35, -35, -35, -35, 84, -35, -35,
- -35, -35
- },
-
- {
- 3, -36, -36, -36, -36, -36, -36, -36, -36, -36,
- -36, -36, -36, -36, -36, -36, -36, -36, -36, -36,
- -36, -36, -36, -36, -36, -36, -36, -36, -36, -36,
- -36, -36, -36, -36, -36, -36, -36, -36, -36, -36,
-
- -36, -36, -36, -36, -36, -36, -36, 85, -36, -36,
- -36, -36
- },
-
- {
- 3, -37, -37, -37, -37, -37, -37, -37, -37, -37,
- -37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
- 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
- 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
- 37, 37, 37, 37, 37, 37, 37, -37, 38, 39,
- 40, -37
- },
-
- {
- 3, -38, -38, -38, -38, -38, -38, -38, -38, -38,
- -38, -38, -38, -38, -38, -38, -38, -38, -38, -38,
-
- -38, -38, -38, -38, -38, -38, -38, -38, -38, -38,
- -38, -38, -38, -38, -38, -38, -38, -38, -38, -38,
- -38, -38, -38, -38, -38, -38, -38, 41, -38, -38,
- -38, -38
- },
-
- {
- 3, -39, -39, -39, -39, -39, -39, -39, -39, -39,
- -39, -39, -39, -39, -39, -39, -39, -39, -39, -39,
- -39, -39, -39, -39, -39, -39, -39, -39, -39, -39,
- -39, -39, -39, -39, -39, -39, -39, -39, -39, -39,
- -39, -39, -39, -39, -39, -39, -39, 86, -39, -39,
- -39, -39
-
- },
-
- {
- 3, -40, -40, -40, -40, -40, -40, -40, -40, -40,
- -40, -40, -40, -40, -40, -40, -40, -40, -40, -40,
- -40, -40, -40, -40, -40, -40, -40, -40, -40, -40,
- -40, -40, -40, -40, -40, -40, -40, -40, -40, -40,
- -40, -40, -40, -40, -40, -40, -40, 87, -40, -40,
- -40, -40
- },
-
- {
- 3, -41, -41, -41, -41, -41, -41, -41, -41, -41,
- -41, 41, 41, 41, 41, 41, 41, 41, 41, 41,
- 41, 41, 41, 41, 41, 41, 41, 41, 41, 41,
- 41, 41, 41, 41, 41, 41, 41, 41, 41, 41,
-
- 41, 41, 41, 41, 41, 41, 41, -41, 38, 39,
- 40, -41
- },
-
- {
- 3, -42, -42, -42, -42, -42, -42, -42, -42, -42,
- -42, -42, -42, -42, -42, -42, -42, -42, -42, -42,
- -42, -42, -42, -42, -42, -42, -42, -42, -42, -42,
- -42, -42, -42, -42, -42, -42, -42, -42, -42, -42,
- -42, -42, -42, -42, -42, -42, -42, 41, -42, -42,
- -42, -42
- },
-
- {
- 3, -43, -43, -43, -43, -43, -43, -43, -43, -43,
- -43, -43, -43, -43, -43, -43, -43, -43, -43, -43,
-
- -43, -43, -43, -43, -43, -43, -43, -43, -43, -43,
- -43, -43, -43, -43, -43, -43, -43, -43, -43, -43,
- -43, -43, -43, -43, -43, -43, -43, 88, -43, -43,
- -43, -43
- },
-
- {
- 3, -44, -44, -44, -44, -44, -44, -44, -44, -44,
- -44, 44, 44, 44, 44, 44, 45, 45, 45, 45,
- 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
- 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
- 45, 45, 45, 45, 45, 45, 45, -44, -44, -44,
- -44, -44
-
- },
-
- {
- 3, -45, -45, -45, -45, -45, -45, -45, -45, -45,
- -45, -45, -45, -45, -45, -45, -45, -45, -45, -45,
- -45, -45, -45, -45, -45, -45, -45, -45, -45, -45,
- -45, -45, -45, -45, -45, -45, -45, -45, -45, -45,
- -45, -45, -45, -45, -45, -45, -45, -45, -45, -45,
- -45, -45
- },
-
- {
- 3, -46, -46, -46, -46, -46, -46, -46, -46, -46,
- -46, 46, 46, 46, 46, 46, 47, 47, 47, 47,
- 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
- 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
-
- 47, 47, 47, 47, 47, 47, 47, -46, -46, -46,
- -46, -46
- },
-
- {
- 3, -47, -47, -47, -47, -47, -47, -47, -47, -47,
- -47, -47, -47, -47, -47, -47, -47, -47, -47, -47,
- -47, -47, -47, -47, -47, -47, -47, -47, -47, -47,
- -47, -47, -47, -47, -47, -47, -47, -47, -47, -47,
- -47, -47, -47, -47, -47, -47, -47, -47, -47, -47,
- -47, -47
- },
-
- {
- 3, -48, -48, -48, -48, -48, -48, -48, -48, -48,
- -48, 48, 48, 48, 48, 48, 49, 49, 49, 49,
-
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
- 49, 49, 49, 49, 49, 49, 49, -48, -48, -48,
- -48, -48
- },
-
- {
- 3, -49, -49, -49, -49, -49, -49, -49, -49, -49,
- -49, -49, -49, -49, -49, -49, -49, -49, -49, -49,
- -49, -49, -49, -49, -49, -49, -49, -49, -49, -49,
- -49, -49, -49, -49, -49, -49, -49, -49, -49, -49,
- -49, -49, -49, -49, -49, -49, -49, -49, -49, -49,
- -49, -49
-
- },
-
- {
- 3, -50, -50, -50, -50, -50, -50, -50, -50, -50,
- -50, 50, 50, 50, 50, 50, 51, 51, 51, 51,
- 51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
- 51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
- 51, 51, 51, 51, 51, 51, 51, -50, -50, -50,
- -50, -50
- },
-
- {
- 3, -51, -51, -51, -51, -51, -51, -51, -51, -51,
- -51, -51, -51, -51, -51, -51, -51, -51, -51, -51,
- -51, -51, -51, -51, -51, -51, -51, -51, -51, -51,
- -51, -51, -51, -51, -51, -51, -51, -51, -51, -51,
-
- -51, -51, -51, -51, -51, -51, -51, -51, -51, -51,
- -51, -51
- },
-
- {
- 3, -52, -52, -52, -52, -52, -52, -52, -52, -52,
- -52, -52, -52, -52, -52, -52, -52, -52, -52, -52,
- -52, -52, -52, -52, -52, -52, -52, -52, -52, -52,
- -52, -52, -52, -52, -52, -52, -52, -52, -52, -52,
- -52, -52, -52, -52, -52, -52, -52, -52, -52, -52,
- -52, -52
- },
-
- {
- 3, -53, -53, -53, -53, -53, -53, -53, -53, -53,
- -53, -53, -53, -53, -53, -53, -53, -53, -53, -53,
-
- -53, -53, -53, -53, -53, -53, -53, -53, -53, -53,
- -53, -53, -53, -53, -53, -53, -53, -53, -53, -53,
- -53, -53, -53, -53, -53, -53, -53, -53, -53, -53,
- -53, -53
- },
-
- {
- 3, 52, 52, 52, 52, 52, 52, 52, 52, 52,
- 52, 53, 53, 53, 53, 53, 54, 54, 54, 54,
- 54, 54, 53, 89, 53, 53, 53, 53, 58, 59,
- 60, 61, 62, 63, 64, 65, 66, 67, 68, 53,
- 53, 53, 53, 69, 70, 71, 53, -54, 73, 74,
- 75, -54
-
- },
-
- {
- 3, -55, -55, -55, -55, -55, -55, -55, -55, -55,
- -55, -55, -55, -55, -55, -55, -55, -55, -55, -55,
- -55, -55, -55, -55, -55, -55, -55, -55, -55, -55,
- -55, -55, -55, -55, -55, -55, -55, -55, -55, -55,
- -55, -55, -55, -55, -55, -55, -55, -55, -55, -55,
- -55, -55
- },
-
- {
- 3, 52, 52, 52, 52, 52, 52, 52, 52, 52,
- 52, 53, 53, 53, 53, 53, 90, 90, 90, 90,
- 90, 90, 53, 55, 53, 53, 53, 53, 53, 53,
- 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,
-
- 53, 53, 53, 53, 53, 53, 53, -56, 73, 74,
- 75, -56
- },
-
- {
- 3, 52, 52, 52, 52, 52, 52, 52, 52, 52,
- 52, 53, 53, 53, 53, 53, 91, 91, 91, 91,
- 91, 91, 53, 55, 53, 53, 53, 53, 53, 53,
- 53, 53, 53, 53, 92, 93, 53, 53, 53, 53,
- 53, 53, 53, 53, 53, 53, 53, -57, 73, 74,
- 75, -57
- },
-
- {
- 3, -58, -58, -58, -58, -58, -58, -58, -58, -58,
- -58, -58, -58, -58, -58, -58, -58, -58, -58, -58,
-
- -58, -58, -58, -58, -58, -58, -58, -58, -58, -58,
- -58, -58, -58, -58, -58, -58, -58, -58, -58, -58,
- -58, -58, -58, -58, -58, -58, -58, -58, -58, -58,
- -58, -58
- },
-
- {
- 3, -59, -59, -59, -59, -59, -59, -59, -59, -59,
- -59, -59, -59, -59, -59, -59, -59, -59, -59, -59,
- -59, -59, -59, -59, -59, -59, -59, -59, -59, -59,
- -59, -59, -59, -59, -59, -59, -59, -59, -59, -59,
- -59, -59, -59, -59, -59, -59, -59, -59, -59, -59,
- -59, -59
-
- },
-
- {
- 3, -60, -60, -60, -60, -60, -60, -60, -60, -60,
- -60, -60, -60, -60, -60, -60, -60, -60, -60, -60,
- -60, -60, -60, -60, -60, -60, -60, -60, -60, -60,
- -60, -60, -60, -60, -60, -60, -60, -60, -60, -60,
- -60, -60, -60, -60, -60, -60, -60, -60, -60, -60,
- -60, -60
- },
-
- {
- 3, -61, -61, -61, -61, -61, -61, -61, -61, -61,
- -61, -61, -61, -61, -61, -61, -61, -61, -61, -61,
- -61, -61, -61, -61, -61, -61, -61, -61, -61, -61,
- -61, -61, -61, -61, -61, -61, -61, -61, -61, -61,
-
- -61, -61, -61, -61, -61, -61, -61, -61, -61, -61,
- -61, -61
- },
-
- {
- 3, -62, -62, -62, -62, -62, -62, -62, -62, -62,
- -62, -62, -62, -62, -62, -62, -62, -62, -62, -62,
- -62, -62, -62, -62, -62, -62, -62, -62, -62, -62,
- -62, -62, -62, -62, -62, -62, -62, -62, -62, -62,
- -62, -62, -62, -62, -62, -62, -62, -62, -62, -62,
- -62, -62
- },
-
- {
- 3, -63, -63, -63, -63, -63, -63, -63, -63, -63,
- -63, -63, -63, -63, -63, -63, -63, -63, -63, -63,
-
- -63, -63, -63, -63, -63, -63, -63, -63, -63, -63,
- -63, -63, -63, -63, -63, -63, -63, -63, -63, -63,
- -63, -63, -63, -63, -63, -63, -63, -63, -63, -63,
- -63, -63
- },
-
- {
- 3, -64, -64, -64, -64, -64, -64, -64, -64, -64,
- -64, -64, -64, -64, -64, -64, -64, -64, -64, -64,
- -64, -64, -64, -64, -64, -64, -64, -64, -64, -64,
- -64, -64, -64, -64, -64, -64, -64, -64, -64, -64,
- -64, -64, -64, -64, -64, -64, -64, -64, -64, -64,
- -64, -64
-
- },
-
- {
- 3, -65, -65, -65, -65, -65, -65, -65, -65, -65,
- -65, -65, -65, -65, -65, -65, -65, -65, -65, -65,
- -65, -65, -65, -65, -65, -65, -65, -65, -65, -65,
- -65, -65, -65, -65, -65, -65, -65, -65, -65, -65,
- -65, -65, -65, -65, -65, -65, -65, -65, -65, -65,
- -65, -65
- },
-
- {
- 3, -66, -66, -66, -66, -66, -66, -66, -66, -66,
- -66, -66, -66, -66, -66, -66, -66, -66, -66, -66,
- -66, -66, -66, -66, -66, -66, -66, -66, -66, -66,
- -66, -66, -66, -66, -66, -66, -66, -66, -66, -66,
-
- -66, -66, -66, -66, -66, -66, -66, -66, -66, -66,
- -66, -66
- },
-
- {
- 3, -67, -67, -67, -67, -67, -67, -67, -67, -67,
- -67, -67, -67, -67, -67, -67, -67, -67, -67, -67,
- -67, -67, -67, -67, -67, -67, -67, -67, -67, -67,
- -67, -67, -67, -67, -67, -67, -67, -67, -67, -67,
- -67, -67, -67, -67, -67, -67, -67, -67, -67, -67,
- -67, -67
- },
-
- {
- 3, -68, -68, -68, -68, -68, -68, -68, -68, -68,
- -68, -68, -68, -68, -68, -68, -68, -68, -68, -68,
-
- -68, -68, -68, -68, -68, -68, -68, -68, -68, -68,
- -68, -68, -68, -68, -68, -68, -68, -68, -68, -68,
- -68, -68, -68, -68, -68, -68, -68, -68, -68, -68,
- -68, -68
- },
-
- {
- 3, -69, -69, -69, -69, -69, -69, -69, -69, -69,
- -69, -69, -69, -69, -69, -69, -69, -69, -69, -69,
- -69, -69, -69, -69, -69, -69, -69, -69, -69, -69,
- -69, -69, -69, -69, -69, -69, -69, -69, -69, -69,
- -69, -69, -69, -69, -69, -69, -69, -69, -69, -69,
- -69, -69
-
- },
-
- {
- 3, -70, -70, -70, -70, -70, -70, -70, -70, -70,
- -70, -70, -70, -70, -70, -70, -70, -70, -70, -70,
- -70, -70, -70, -70, -70, -70, -70, -70, -70, -70,
- -70, -70, -70, -70, -70, -70, -70, -70, -70, -70,
- -70, -70, -70, -70, -70, -70, -70, -70, -70, -70,
- -70, -70
- },
-
- {
- 3, -71, -71, -71, -71, -71, -71, -71, -71, -71,
- -71, -71, -71, -71, -71, -71, -71, -71, -71, -71,
- -71, -71, -71, -71, -71, -71, -71, -71, -71, -71,
- -71, -71, -71, -71, -71, -71, -71, -71, -71, -71,
-
- -71, -71, -71, -71, -71, -71, -71, -71, -71, -71,
- -71, -71
- },
-
- {
- 3, -72, -72, -72, -72, -72, -72, -72, -72, -72,
- -72, -72, -72, -72, -72, -72, -72, -72, -72, -72,
- -72, -72, -72, -72, -72, -72, -72, -72, -72, -72,
- -72, -72, -72, -72, -72, -72, -72, -72, -72, -72,
- -72, -72, -72, -72, -72, -72, -72, -72, -72, -72,
- -72, -72
- },
-
- {
- 3, -73, -73, -73, -73, -73, -73, -73, -73, -73,
- -73, -73, -73, -73, -73, -73, -73, -73, -73, -73,
-
- -73, -73, -73, -73, -73, -73, -73, -73, -73, -73,
- -73, -73, -73, -73, -73, -73, -73, -73, -73, -73,
- -73, -73, -73, -73, -73, -73, -73, 53, -73, -73,
- -73, -73
- },
-
- {
- 3, -74, -74, -74, -74, -74, -74, -74, -74, -74,
- -74, -74, -74, -74, -74, -74, -74, -74, -74, -74,
- -74, -74, -74, -74, -74, -74, -74, -74, -74, -74,
- -74, -74, -74, -74, -74, -74, -74, -74, -74, -74,
- -74, -74, -74, -74, -74, -74, -74, 94, -74, -74,
- -74, -74
-
- },
-
- {
- 3, -75, -75, -75, -75, -75, -75, -75, -75, -75,
- -75, -75, -75, -75, -75, -75, -75, -75, -75, -75,
- -75, -75, -75, -75, -75, -75, -75, -75, -75, -75,
- -75, -75, -75, -75, -75, -75, -75, -75, -75, -75,
- -75, -75, -75, -75, -75, -75, -75, 95, -75, -75,
- -75, -75
- },
-
- {
- 3, -76, -76, -76, -76, -76, -76, -76, -76, -76,
- -76, -76, -76, -76, -76, -76, -76, -76, -76, -76,
- -76, -76, -76, -76, -76, -76, -76, -76, -76, -76,
- -76, -76, -76, -76, -76, -76, -76, -76, -76, -76,
-
- -76, -76, -76, -76, -76, -76, -76, -76, -76, -76,
- -76, -76
- },
-
- {
- 3, -77, -77, -77, -77, -77, -77, -77, -77, -77,
- -77, -77, -77, -77, -77, -77, -77, -77, -77, -77,
- -77, -77, -77, -77, -77, -77, -77, -77, -77, -77,
- -77, -77, -77, -77, -77, -77, -77, -77, -77, -77,
- -77, -77, -77, -77, -77, -77, -77, -77, -77, -77,
- -77, -77
- },
-
- {
- 3, -78, -78, -78, -78, -78, -78, -78, -78, -78,
- -78, -78, -78, -78, -78, -78, -78, -78, -78, -78,
-
- -78, -78, -78, 96, -78, -78, -78, -78, -78, -78,
- -78, -78, -78, -78, -78, -78, -78, -78, -78, -78,
- -78, -78, -78, -78, -78, -78, -78, -78, -78, -78,
- -78, -78
- },
-
- {
- 3, -79, -79, -79, -79, -79, -79, -79, -79, -79,
- -79, -79, -79, -79, -79, -79, -79, -79, -79, -79,
- -79, -79, -79, 97, -79, -79, -79, -79, -79, -79,
- -79, -79, -79, -79, -79, -79, -79, -79, -79, -79,
- -79, -79, -79, -79, -79, -79, -79, -79, -79, -79,
- -79, -79
-
- },
-
- {
- 3, -80, -80, -80, -80, -80, -80, -80, -80, -80,
- -80, -80, -80, -80, -80, -80, -80, -80, -80, -80,
- -80, -80, -80, 98, -80, -80, -80, -80, -80, -80,
- -80, -80, -80, -80, -80, -80, -80, -80, -80, -80,
- -80, -80, -80, -80, -80, -80, -80, -80, -80, -80,
- -80, -80
- },
-
- {
- 3, -81, -81, -81, -81, -81, -81, -81, -81, -81,
- -81, -81, -81, -81, -81, -81, -81, -81, -81, -81,
- -81, -81, -81, -81, -81, -81, -81, -81, -81, -81,
- -81, -81, -81, -81, -81, -81, -81, -81, -81, -81,
-
- -81, -81, -81, -81, -81, -81, -81, 77, -81, -81,
- -81, -81
- },
-
- {
- 3, -82, -82, -82, -82, -82, -82, -82, -82, -82,
- -82, -82, -82, -82, -82, -82, -82, -82, -82, -82,
- -82, -82, -82, -82, -82, -82, -82, -82, -82, -82,
- -82, -82, -82, -82, -82, -82, -82, -82, -82, -82,
- -82, -82, -82, -82, -82, -82, -82, 99, -82, -82,
- -82, -82
- },
-
- {
- 3, -83, -83, -83, -83, -83, -83, -83, -83, -83,
- -83, -83, -83, -83, -83, -83, -83, -83, -83, -83,
-
- -83, -83, -83, -83, -83, -83, -83, -83, -83, -83,
- -83, -83, -83, -83, -83, -83, -83, -83, -83, -83,
- -83, -83, -83, -83, -83, -83, -83, 100, -83, -83,
- -83, -83
- },
-
- {
- 3, -84, -84, -84, -84, -84, -84, -84, -84, -84,
- -84, -84, -84, -84, -84, -84, -84, -84, -84, -84,
- -84, -84, -84, -84, -84, -84, -84, -84, -84, -84,
- -84, -84, -84, -84, -84, -84, -84, -84, -84, -84,
- -84, -84, -84, -84, -84, -84, -84, 20, -84, -84,
- -84, -84
-
- },
-
- {
- 3, -85, -85, -85, -85, -85, -85, -85, -85, -85,
- -85, -85, -85, -85, -85, -85, -85, -85, -85, -85,
- -85, -85, -85, -85, -85, -85, -85, -85, -85, -85,
- -85, -85, -85, -85, -85, -85, -85, -85, -85, -85,
- -85, -85, -85, -85, -85, -85, -85, 101, -85, -85,
- -85, -85
- },
-
- {
- 3, -86, -86, -86, -86, -86, -86, -86, -86, -86,
- -86, -86, -86, -86, -86, -86, -86, -86, -86, -86,
- -86, -86, -86, -86, -86, -86, -86, -86, -86, -86,
- -86, -86, -86, -86, -86, -86, -86, -86, -86, -86,
-
- -86, -86, -86, -86, -86, -86, -86, 41, -86, -86,
- -86, -86
- },
-
- {
- 3, -87, -87, -87, -87, -87, -87, -87, -87, -87,
- -87, -87, -87, -87, -87, -87, -87, -87, -87, -87,
- -87, -87, -87, -87, -87, -87, -87, -87, -87, -87,
- -87, -87, -87, -87, -87, -87, -87, -87, -87, -87,
- -87, -87, -87, -87, -87, -87, -87, 102, -87, -87,
- -87, -87
- },
-
- {
- 3, -88, -88, -88, -88, -88, -88, -88, -88, -88,
- -88, -88, -88, -88, -88, -88, -88, -88, -88, -88,
-
- -88, -88, -88, -88, -88, -88, -88, -88, -88, -88,
- -88, -88, -88, -88, -88, -88, -88, -88, -88, -88,
- -88, -88, -88, -88, -88, -88, -88, 41, -88, -88,
- -88, -88
- },
-
- {
- 3, -89, -89, -89, -89, -89, -89, -89, -89, -89,
- -89, -89, -89, -89, -89, -89, 103, 103, 103, 103,
- 103, 103, -89, -89, 104, 104, -89, 104, -89, -89,
- -89, -89, -89, -89, -89, -89, -89, -89, -89, -89,
- -89, -89, -89, -89, -89, -89, -89, -89, -89, -89,
- -89, -89
-
- },
-
- {
- 3, 52, 52, 52, 52, 52, 52, 52, 52, 52,
- 52, 53, 53, 53, 53, 53, 90, 90, 90, 90,
- 90, 90, 53, 105, 53, 53, 53, 53, 53, 53,
- 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,
- 53, 53, 53, 69, 70, 53, 53, -90, 73, 74,
- 75, -90
- },
-
- {
- 3, 52, 52, 52, 52, 52, 52, 52, 52, 52,
- 52, 53, 53, 53, 53, 53, 91, 91, 91, 91,
- 91, 91, 53, 105, 53, 53, 53, 53, 53, 53,
- 53, 53, 53, 53, 92, 93, 53, 53, 53, 53,
-
- 53, 53, 53, 69, 70, 53, 53, -91, 73, 74,
- 75, -91
- },
-
- {
- 3, -92, -92, -92, -92, -92, -92, -92, -92, -92,
- -92, -92, -92, -92, -92, -92, -92, -92, -92, -92,
- -92, -92, -92, -92, -92, -92, -92, -92, -92, -92,
- -92, -92, -92, -92, -92, -92, -92, -92, -92, -92,
- -92, -92, -92, -92, -92, -92, -92, -92, -92, -92,
- -92, -92
- },
-
- {
- 3, -93, -93, -93, -93, -93, -93, -93, -93, -93,
- -93, -93, -93, -93, -93, -93, -93, -93, -93, -93,
-
- -93, -93, -93, -93, -93, -93, -93, -93, -93, -93,
- -93, -93, -93, -93, -93, -93, -93, -93, -93, -93,
- -93, -93, -93, -93, -93, -93, -93, -93, -93, -93,
- -93, -93
- },
-
- {
- 3, -94, -94, -94, -94, -94, -94, -94, -94, -94,
- -94, -94, -94, -94, -94, -94, -94, -94, -94, -94,
- -94, -94, -94, -94, -94, -94, -94, -94, -94, -94,
- -94, -94, -94, -94, -94, -94, -94, -94, -94, -94,
- -94, -94, -94, -94, -94, -94, -94, 53, -94, -94,
- -94, -94
-
- },
-
- {
- 3, -95, -95, -95, -95, -95, -95, -95, -95, -95,
- -95, -95, -95, -95, -95, -95, -95, -95, -95, -95,
- -95, -95, -95, -95, -95, -95, -95, -95, -95, -95,
- -95, -95, -95, -95, -95, -95, -95, -95, -95, -95,
- -95, -95, -95, -95, -95, -95, -95, 106, -95, -95,
- -95, -95
- },
-
- {
- 3, -96, 107, -96, -96, -96, -96, -96, -96, -96,
- -96, 108, 108, 108, 108, 108, 108, 108, 108, 108,
- 108, 108, 108, 108, 108, 108, 108, 108, 108, 108,
- 108, 108, 108, 108, 108, 108, 108, 108, 108, 108,
-
- 108, 108, 108, 108, 108, 108, 108, -96, 109, 110,
- 111, -96
- },
-
- {
- 3, -97, 112, -97, -97, -97, -97, -97, -97, -97,
- -97, 113, 113, 113, 113, 113, 113, 113, 113, 113,
- 113, 113, 113, 113, 113, 113, 113, 113, 113, 113,
- 113, 113, 113, 113, 113, 113, 113, 113, 113, 113,
- 113, 113, 113, 113, 113, 113, 113, -97, 114, 115,
- 116, -97
- },
-
- {
- 3, -98, 117, -98, -98, -98, -98, -98, -98, -98,
- -98, 118, 118, 118, 118, 118, 118, 118, 118, 118,
-
- 118, 118, 118, 118, 118, 118, 118, 118, 118, 118,
- 118, 118, 118, 118, 118, 118, 118, 118, 118, 118,
- 118, 118, 118, 118, 118, 118, 118, -98, 119, 120,
- 121, -98
- },
-
- {
- 3, -99, -99, -99, -99, -99, -99, -99, -99, -99,
- -99, -99, -99, -99, -99, -99, -99, -99, -99, -99,
- -99, -99, -99, -99, -99, -99, -99, -99, -99, -99,
- -99, -99, -99, -99, -99, -99, -99, -99, -99, -99,
- -99, -99, -99, -99, -99, -99, -99, 77, -99, -99,
- -99, -99
-
- },
-
- {
- 3, -100, -100, -100, -100, -100, -100, -100, -100, -100,
- -100, -100, -100, -100, -100, -100, -100, -100, -100, -100,
- -100, -100, -100, -100, -100, -100, -100, -100, -100, -100,
- -100, -100, -100, -100, -100, -100, -100, -100, -100, -100,
- -100, -100, -100, -100, -100, -100, -100, 122, -100, -100,
- -100, -100
- },
-
- {
- 3, -101, -101, -101, -101, -101, -101, -101, -101, -101,
- -101, -101, -101, -101, -101, -101, -101, -101, -101, -101,
- -101, -101, -101, -101, -101, -101, -101, -101, -101, -101,
- -101, -101, -101, -101, -101, -101, -101, -101, -101, -101,
-
- -101, -101, -101, -101, -101, -101, -101, 20, -101, -101,
- -101, -101
- },
-
- {
- 3, -102, -102, -102, -102, -102, -102, -102, -102, -102,
- -102, -102, -102, -102, -102, -102, -102, -102, -102, -102,
- -102, -102, -102, -102, -102, -102, -102, -102, -102, -102,
- -102, -102, -102, -102, -102, -102, -102, -102, -102, -102,
- -102, -102, -102, -102, -102, -102, -102, 41, -102, -102,
- -102, -102
- },
-
- {
- 3, 52, 52, 52, 52, 52, 52, 52, 52, 52,
- 52, 53, 53, 53, 53, 53, 123, 123, 123, 123,
-
- 123, 123, 53, 124, 53, 53, 53, 53, 53, 53,
- 53, 53, 53, 63, 53, 53, 53, 53, 53, 53,
- 53, 53, 53, 69, 70, 71, 72, -103, 73, 74,
- 75, -103
- },
-
- {
- 3, -104, -104, -104, -104, -104, -104, -104, -104, -104,
- -104, -104, -104, -104, -104, -104, 125, 125, 125, 125,
- 125, 125, -104, -104, -104, -104, -104, -104, -104, -104,
- -104, -104, -104, -104, -104, -104, -104, -104, -104, -104,
- -104, -104, -104, -104, -104, -104, -104, -104, -104, -104,
- -104, -104
-
- },
-
- {
- 3, -105, -105, -105, -105, -105, -105, -105, -105, -105,
- -105, -105, -105, -105, -105, -105, 126, 126, 126, 126,
- 126, 126, -105, -105, 104, 104, -105, 104, -105, -105,
- -105, -105, -105, -105, -105, -105, -105, -105, -105, -105,
- -105, -105, -105, -105, -105, -105, -105, -105, -105, -105,
- -105, -105
- },
-
- {
- 3, -106, -106, -106, -106, -106, -106, -106, -106, -106,
- -106, -106, -106, -106, -106, -106, -106, -106, -106, -106,
- -106, -106, -106, -106, -106, -106, -106, -106, -106, -106,
- -106, -106, -106, -106, -106, -106, -106, -106, -106, -106,
-
- -106, -106, -106, -106, -106, -106, -106, 53, -106, -106,
- -106, -106
- },
-
- {
- 3, -107, -107, -107, -107, -107, -107, -107, -107, -107,
- -107, -107, -107, -107, -107, -107, -107, -107, -107, -107,
- -107, -107, -107, -107, -107, -107, -107, -107, -107, -107,
- -107, -107, -107, -107, -107, -107, -107, -107, -107, -107,
- -107, -107, -107, -107, -107, -107, -107, -107, -107, -107,
- -107, -107
- },
-
- {
- 3, -108, 107, -108, -108, -108, -108, -108, -108, -108,
- -108, 108, 108, 108, 108, 108, 108, 108, 108, 108,
-
- 108, 108, 108, 108, 108, 108, 108, 108, 108, 108,
- 108, 108, 108, 108, 108, 108, 108, 108, 108, 108,
- 108, 108, 108, 108, 108, 108, 108, -108, 109, 110,
- 111, -108
- },
-
- {
- 3, -109, -109, -109, -109, -109, -109, -109, -109, -109,
- -109, -109, -109, -109, -109, -109, -109, -109, -109, -109,
- -109, -109, -109, -109, -109, -109, -109, -109, -109, -109,
- -109, -109, -109, -109, -109, -109, -109, -109, -109, -109,
- -109, -109, -109, -109, -109, -109, -109, 108, -109, -109,
- -109, -109
-
- },
-
- {
- 3, -110, -110, -110, -110, -110, -110, -110, -110, -110,
- -110, -110, -110, -110, -110, -110, -110, -110, -110, -110,
- -110, -110, -110, -110, -110, -110, -110, -110, -110, -110,
- -110, -110, -110, -110, -110, -110, -110, -110, -110, -110,
- -110, -110, -110, -110, -110, -110, -110, 127, -110, -110,
- -110, -110
- },
-
- {
- 3, -111, -111, -111, -111, -111, -111, -111, -111, -111,
- -111, -111, -111, -111, -111, -111, -111, -111, -111, -111,
- -111, -111, -111, -111, -111, -111, -111, -111, -111, -111,
- -111, -111, -111, -111, -111, -111, -111, -111, -111, -111,
-
- -111, -111, -111, -111, -111, -111, -111, 128, -111, -111,
- -111, -111
- },
-
- {
- 3, -112, -112, -112, -112, -112, -112, -112, -112, -112,
- -112, -112, -112, -112, -112, -112, -112, -112, -112, -112,
- -112, -112, -112, -112, -112, -112, -112, -112, -112, -112,
- -112, -112, -112, -112, -112, -112, -112, -112, -112, -112,
- -112, -112, -112, -112, -112, -112, -112, -112, -112, -112,
- -112, -112
- },
-
- {
- 3, -113, 112, -113, -113, -113, -113, -113, -113, -113,
- -113, 113, 113, 113, 113, 113, 113, 113, 113, 113,
-
- 113, 113, 113, 113, 113, 113, 113, 113, 113, 113,
- 113, 113, 113, 113, 113, 113, 113, 113, 113, 113,
- 113, 113, 113, 113, 113, 113, 113, -113, 114, 115,
- 116, -113
- },
-
- {
- 3, -114, -114, -114, -114, -114, -114, -114, -114, -114,
- -114, -114, -114, -114, -114, -114, -114, -114, -114, -114,
- -114, -114, -114, -114, -114, -114, -114, -114, -114, -114,
- -114, -114, -114, -114, -114, -114, -114, -114, -114, -114,
- -114, -114, -114, -114, -114, -114, -114, 113, -114, -114,
- -114, -114
-
- },
-
- {
- 3, -115, -115, -115, -115, -115, -115, -115, -115, -115,
- -115, -115, -115, -115, -115, -115, -115, -115, -115, -115,
- -115, -115, -115, -115, -115, -115, -115, -115, -115, -115,
- -115, -115, -115, -115, -115, -115, -115, -115, -115, -115,
- -115, -115, -115, -115, -115, -115, -115, 129, -115, -115,
- -115, -115
- },
-
- {
- 3, -116, -116, -116, -116, -116, -116, -116, -116, -116,
- -116, -116, -116, -116, -116, -116, -116, -116, -116, -116,
- -116, -116, -116, -116, -116, -116, -116, -116, -116, -116,
- -116, -116, -116, -116, -116, -116, -116, -116, -116, -116,
-
- -116, -116, -116, -116, -116, -116, -116, 130, -116, -116,
- -116, -116
- },
-
- {
- 3, -117, -117, -117, -117, -117, -117, -117, -117, -117,
- -117, -117, -117, -117, -117, -117, -117, -117, -117, -117,
- -117, -117, -117, -117, -117, -117, -117, -117, -117, -117,
- -117, -117, -117, -117, -117, -117, -117, -117, -117, -117,
- -117, -117, -117, -117, -117, -117, -117, -117, -117, -117,
- -117, -117
- },
-
- {
- 3, -118, 117, -118, -118, -118, -118, -118, -118, -118,
- -118, 118, 118, 118, 118, 118, 118, 118, 118, 118,
-
- 118, 118, 118, 118, 118, 118, 118, 118, 118, 118,
- 118, 118, 118, 118, 118, 118, 118, 118, 118, 118,
- 118, 118, 118, 118, 118, 118, 118, -118, 119, 120,
- 121, -118
- },
-
- {
- 3, -119, -119, -119, -119, -119, -119, -119, -119, -119,
- -119, -119, -119, -119, -119, -119, -119, -119, -119, -119,
- -119, -119, -119, -119, -119, -119, -119, -119, -119, -119,
- -119, -119, -119, -119, -119, -119, -119, -119, -119, -119,
- -119, -119, -119, -119, -119, -119, -119, 118, -119, -119,
- -119, -119
-
- },
-
- {
- 3, -120, -120, -120, -120, -120, -120, -120, -120, -120,
- -120, -120, -120, -120, -120, -120, -120, -120, -120, -120,
- -120, -120, -120, -120, -120, -120, -120, -120, -120, -120,
- -120, -120, -120, -120, -120, -120, -120, -120, -120, -120,
- -120, -120, -120, -120, -120, -120, -120, 131, -120, -120,
- -120, -120
- },
-
- {
- 3, -121, -121, -121, -121, -121, -121, -121, -121, -121,
- -121, -121, -121, -121, -121, -121, -121, -121, -121, -121,
- -121, -121, -121, -121, -121, -121, -121, -121, -121, -121,
- -121, -121, -121, -121, -121, -121, -121, -121, -121, -121,
-
- -121, -121, -121, -121, -121, -121, -121, 132, -121, -121,
- -121, -121
- },
-
- {
- 3, -122, -122, -122, -122, -122, -122, -122, -122, -122,
- -122, -122, -122, -122, -122, -122, -122, -122, -122, -122,
- -122, -122, -122, -122, -122, -122, -122, -122, -122, -122,
- -122, -122, -122, -122, -122, -122, -122, -122, -122, -122,
- -122, -122, -122, -122, -122, -122, -122, 77, -122, -122,
- -122, -122
- },
-
- {
- 3, 52, 52, 52, 52, 52, 52, 52, 52, 52,
- 52, 53, 53, 53, 53, 53, 123, 123, 123, 123,
-
- 123, 123, 53, 124, 53, 53, 53, 53, 53, 53,
- 53, 53, 53, 63, 53, 53, 53, 53, 53, 53,
- 53, 53, 53, 69, 70, 71, 72, -123, 73, 74,
- 75, -123
- },
-
- {
- 3, -124, -124, -124, -124, -124, -124, -124, -124, -124,
- -124, -124, -124, -124, -124, -124, 133, 133, 133, 133,
- 133, 133, -124, -124, 104, 104, -124, 104, -124, -124,
- -124, -124, -124, -124, -124, -124, -124, -124, -124, -124,
- -124, -124, -124, -124, -124, -124, -124, -124, -124, -124,
- -124, -124
-
- },
-
- {
- 3, -125, -125, -125, -125, -125, -125, -125, -125, -125,
- -125, -125, -125, -125, -125, -125, 125, 125, 125, 125,
- 125, 125, -125, 134, -125, -125, -125, -125, -125, -125,
- -125, -125, -125, -125, -125, -125, -125, -125, -125, -125,
- -125, -125, -125, 135, 136, -125, -125, -125, -125, -125,
- -125, -125
- },
-
- {
- 3, 52, 52, 52, 52, 52, 52, 52, 52, 52,
- 52, 53, 53, 53, 53, 53, 137, 137, 137, 137,
- 137, 137, 53, 105, 53, 53, 53, 53, 53, 53,
- 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,
-
- 53, 53, 53, 69, 70, 53, 53, -126, 73, 74,
- 75, -126
- },
-
- {
- 3, -127, -127, -127, -127, -127, -127, -127, -127, -127,
- -127, -127, -127, -127, -127, -127, -127, -127, -127, -127,
- -127, -127, -127, -127, -127, -127, -127, -127, -127, -127,
- -127, -127, -127, -127, -127, -127, -127, -127, -127, -127,
- -127, -127, -127, -127, -127, -127, -127, 108, -127, -127,
- -127, -127
- },
-
- {
- 3, -128, -128, -128, -128, -128, -128, -128, -128, -128,
- -128, -128, -128, -128, -128, -128, -128, -128, -128, -128,
-
- -128, -128, -128, -128, -128, -128, -128, -128, -128, -128,
- -128, -128, -128, -128, -128, -128, -128, -128, -128, -128,
- -128, -128, -128, -128, -128, -128, -128, 138, -128, -128,
- -128, -128
- },
-
- {
- 3, -129, -129, -129, -129, -129, -129, -129, -129, -129,
- -129, -129, -129, -129, -129, -129, -129, -129, -129, -129,
- -129, -129, -129, -129, -129, -129, -129, -129, -129, -129,
- -129, -129, -129, -129, -129, -129, -129, -129, -129, -129,
- -129, -129, -129, -129, -129, -129, -129, 113, -129, -129,
- -129, -129
-
- },
-
- {
- 3, -130, -130, -130, -130, -130, -130, -130, -130, -130,
- -130, -130, -130, -130, -130, -130, -130, -130, -130, -130,
- -130, -130, -130, -130, -130, -130, -130, -130, -130, -130,
- -130, -130, -130, -130, -130, -130, -130, -130, -130, -130,
- -130, -130, -130, -130, -130, -130, -130, 139, -130, -130,
- -130, -130
- },
-
- {
- 3, -131, -131, -131, -131, -131, -131, -131, -131, -131,
- -131, -131, -131, -131, -131, -131, -131, -131, -131, -131,
- -131, -131, -131, -131, -131, -131, -131, -131, -131, -131,
- -131, -131, -131, -131, -131, -131, -131, -131, -131, -131,
-
- -131, -131, -131, -131, -131, -131, -131, 118, -131, -131,
- -131, -131
- },
-
- {
- 3, -132, -132, -132, -132, -132, -132, -132, -132, -132,
- -132, -132, -132, -132, -132, -132, -132, -132, -132, -132,
- -132, -132, -132, -132, -132, -132, -132, -132, -132, -132,
- -132, -132, -132, -132, -132, -132, -132, -132, -132, -132,
- -132, -132, -132, -132, -132, -132, -132, 140, -132, -132,
- -132, -132
- },
-
- {
- 3, 52, 52, 52, 52, 52, 52, 52, 52, 52,
- 52, 53, 53, 53, 53, 53, 141, 141, 141, 141,
-
- 141, 141, 53, 142, 53, 53, 53, 53, 53, 53,
- 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,
- 53, 53, 53, 69, 70, 71, 72, -133, 73, 74,
- 75, -133
- },
-
- {
- 3, -134, -134, -134, -134, -134, -134, -134, -134, -134,
- -134, -134, -134, -134, -134, -134, 125, 125, 125, 125,
- 125, 125, -134, -134, 104, 104, -134, 104, -134, -134,
- -134, -134, -134, -134, -134, -134, -134, -134, -134, -134,
- -134, -134, -134, -134, -134, -134, -134, -134, -134, -134,
- -134, -134
-
- },
-
- {
- 3, -135, -135, -135, -135, -135, -135, -135, -135, -135,
- -135, -135, -135, -135, -135, -135, -135, -135, -135, -135,
- -135, -135, -135, -135, -135, -135, -135, -135, -135, -135,
- -135, -135, -135, -135, -135, -135, -135, -135, -135, -135,
- -135, -135, -135, -135, -135, -135, -135, -135, -135, -135,
- -135, -135
- },
-
- {
- 3, -136, -136, -136, -136, -136, -136, -136, -136, -136,
- -136, -136, -136, -136, -136, -136, -136, -136, -136, -136,
- -136, -136, -136, -136, -136, -136, -136, -136, -136, -136,
- -136, -136, -136, -136, -136, -136, -136, -136, -136, -136,
-
- -136, -136, -136, -136, -136, -136, -136, -136, -136, -136,
- -136, -136
- },
-
- {
- 3, 52, 52, 52, 52, 52, 52, 52, 52, 52,
- 52, 53, 53, 53, 53, 53, 137, 137, 137, 137,
- 137, 137, 53, 105, 53, 53, 53, 53, 53, 53,
- 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,
- 53, 53, 53, 69, 70, 53, 53, -137, 73, 74,
- 75, -137
- },
-
- {
- 3, -138, -138, -138, -138, -138, -138, -138, -138, -138,
- -138, -138, -138, -138, -138, -138, -138, -138, -138, -138,
-
- -138, -138, -138, -138, -138, -138, -138, -138, -138, -138,
- -138, -138, -138, -138, -138, -138, -138, -138, -138, -138,
- -138, -138, -138, -138, -138, -138, -138, 108, -138, -138,
- -138, -138
- },
-
- {
- 3, -139, -139, -139, -139, -139, -139, -139, -139, -139,
- -139, -139, -139, -139, -139, -139, -139, -139, -139, -139,
- -139, -139, -139, -139, -139, -139, -139, -139, -139, -139,
- -139, -139, -139, -139, -139, -139, -139, -139, -139, -139,
- -139, -139, -139, -139, -139, -139, -139, 113, -139, -139,
- -139, -139
-
- },
-
- {
- 3, -140, -140, -140, -140, -140, -140, -140, -140, -140,
- -140, -140, -140, -140, -140, -140, -140, -140, -140, -140,
- -140, -140, -140, -140, -140, -140, -140, -140, -140, -140,
- -140, -140, -140, -140, -140, -140, -140, -140, -140, -140,
- -140, -140, -140, -140, -140, -140, -140, 118, -140, -140,
- -140, -140
- },
-
- {
- 3, 52, 52, 52, 52, 52, 52, 52, 52, 52,
- 52, 53, 53, 53, 53, 53, 141, 141, 141, 141,
- 141, 141, 53, 142, 53, 53, 53, 53, 53, 53,
- 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,
-
- 53, 53, 53, 69, 70, 71, 72, -141, 73, 74,
- 75, -141
- },
-
- {
- 3, -142, -142, -142, -142, -142, -142, -142, -142, -142,
- -142, -142, -142, -142, -142, -142, 143, 143, 143, 143,
- 143, 143, -142, -142, 104, 104, -142, 104, -142, -142,
- -142, -142, -142, -142, -142, -142, -142, -142, -142, -142,
- -142, -142, -142, -142, -142, -142, -142, -142, -142, -142,
- -142, -142
- },
-
- {
- 3, 52, 52, 52, 52, 52, 52, 52, 52, 52,
- 52, 53, 53, 53, 53, 53, 144, 144, 144, 144,
-
- 144, 144, 53, 145, 53, 53, 53, 53, 53, 53,
- 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,
- 53, 53, 53, 69, 70, 71, 72, -143, 73, 74,
- 75, -143
- },
-
- {
- 3, 52, 52, 52, 52, 52, 52, 52, 52, 52,
- 52, 53, 53, 53, 53, 53, 144, 144, 144, 144,
- 144, 144, 53, 145, 53, 53, 53, 53, 53, 53,
- 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,
- 53, 53, 53, 69, 70, 71, 72, -144, 73, 74,
- 75, -144
-
- },
-
- {
- 3, -145, -145, -145, -145, -145, -145, -145, -145, -145,
- -145, -145, -145, -145, -145, -145, 146, 146, 146, 146,
- 146, 146, -145, -145, 104, 104, -145, 104, -145, -145,
- -145, -145, -145, -145, -145, -145, -145, -145, -145, -145,
- -145, -145, -145, -145, -145, -145, -145, -145, -145, -145,
- -145, -145
- },
-
- {
- 3, 52, 52, 52, 52, 52, 52, 52, 52, 52,
- 52, 53, 53, 53, 53, 53, 147, 147, 147, 147,
- 147, 147, 53, 145, 53, 53, 53, 53, 53, 53,
- 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,
-
- 53, 53, 53, 69, 70, 71, 53, -146, 73, 74,
- 75, -146
- },
-
- {
- 3, 52, 52, 52, 52, 52, 52, 52, 52, 52,
- 52, 53, 53, 53, 53, 53, 147, 147, 147, 147,
- 147, 147, 53, 145, 53, 53, 53, 53, 53, 53,
- 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,
- 53, 53, 53, 69, 70, 71, 53, -147, 73, 74,
- 75, -147
- },
-
- } ;
-
static yy_state_type yy_get_previous_state (yyscan_t yyscanner );
static yy_state_type yy_try_NUL_trans (yy_state_type current_state ,yyscan_t yyscanner);
static int yy_get_next_buffer (yyscan_t yyscanner );
@@ -1784,7 +360,7 @@ struct yy_trans_info
flex_int32_t yy_verify;
flex_int32_t yy_nxt;
};
-static yyconst flex_int16_t yy_accept[148] =
+static yyconst flex_int16_t yy_accept[149] =
{ 0,
0, 0, 58, 55, 1, 2, 3, 4, 5, 6,
7, 8, 48, 40, 56, 42, 43, 44, 53, 54,
@@ -1801,7 +377,7 @@ static yyconst flex_int16_t yy_accept[148] =
0, 34, 0, 0, 0, 0, 35, 0, 0, 0,
0, 0, 45, 45, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 27, 28, 45, 0, 0, 0,
- 45, 45, 0, 45, 45, 0, 45
+ 45, 45, 0, 45, 45, 0, 45, 0
} ;
static yyconst flex_int32_t yy_ec[256] =
@@ -1836,6 +412,202 @@ static yyconst flex_int32_t yy_ec[256] =
51, 51, 51, 51, 51
} ;
+static yyconst flex_int32_t yy_meta[52] =
+ { 0,
+ 1, 2, 1, 1, 1, 1, 1, 1, 1, 1,
+ 3, 3, 3, 3, 3, 4, 4, 4, 4, 4,
+ 4, 3, 5, 6, 6, 3, 6, 3, 3, 3,
+ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
+ 3, 3, 5, 5, 3, 3, 7, 8, 8, 8,
+ 7
+ } ;
+
+static yyconst flex_int16_t yy_base[167] =
+ { 0,
+ 0, 51, 379, 556, 556, 556, 556, 556, 556, 556,
+ 556, 556, 102, 14, 556, 331, 330, 329, 556, 556,
+ 0, 5, 10, 15, 556, 556, 556, 556, 556, 152,
+ 202, 556, 556, 328, 327, 325, 17, 324, 323, 312,
+ 20, 311, 310, 20, 556, 25, 556, 30, 556, 60,
+ 556, 556, 556, 190, 556, 237, 268, 556, 556, 556,
+ 556, 556, 556, 556, 556, 556, 556, 556, 556, 556,
+ 556, 556, 309, 308, 307, 556, 556, 330, 329, 328,
+ 302, 294, 292, 283, 282, 281, 277, 274, 52, 198,
+ 288, 556, 556, 273, 272, 44, 197, 228, 271, 263,
+
+ 254, 253, 317, 64, 62, 252, 556, 242, 251, 250,
+ 246, 556, 246, 216, 202, 196, 556, 277, 188, 186,
+ 181, 177, 0, 198, 216, 348, 169, 102, 50, 49,
+ 48, 44, 368, 202, 556, 556, 386, 43, 41, 31,
+ 406, 207, 424, 0, 213, 296, 327, 556, 470, 476,
+ 482, 486, 490, 494, 500, 506, 511, 516, 523, 530,
+ 535, 538, 541, 543, 546, 549
+ } ;
+
+static yyconst flex_int16_t yy_def[167] =
+ { 0,
+ 149, 149, 148, 148, 148, 148, 148, 148, 148, 148,
+ 148, 148, 148, 150, 148, 148, 148, 148, 148, 148,
+ 151, 152, 153, 154, 148, 148, 148, 148, 148, 148,
+ 155, 148, 148, 148, 148, 148, 150, 148, 148, 148,
+ 156, 148, 148, 151, 148, 152, 148, 153, 148, 154,
+ 148, 148, 148, 30, 148, 30, 56, 148, 148, 148,
+ 148, 148, 148, 148, 148, 148, 148, 148, 148, 148,
+ 148, 148, 148, 148, 148, 148, 148, 148, 148, 148,
+ 148, 148, 148, 148, 148, 148, 148, 148, 157, 56,
+ 56, 148, 148, 148, 148, 158, 159, 160, 148, 148,
+
+ 148, 148, 56, 148, 161, 148, 148, 158, 148, 148,
+ 148, 148, 159, 148, 148, 148, 148, 160, 148, 148,
+ 148, 148, 103, 162, 163, 91, 148, 148, 148, 148,
+ 148, 148, 103, 164, 148, 148, 91, 148, 148, 148,
+ 103, 165, 91, 143, 166, 143, 143, 0, 148, 148,
+ 148, 148, 148, 148, 148, 148, 148, 148, 148, 148,
+ 148, 148, 148, 148, 148, 148
+ } ;
+
+static yyconst flex_int16_t yy_nxt[608] =
+ { 0,
+ 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
+ 44, 44, 44, 44, 44, 46, 46, 46, 46, 46,
+ 48, 48, 48, 48, 48, 50, 50, 50, 50, 50,
+ 44, 44, 44, 44, 44, 46, 46, 46, 46, 46,
+ 48, 48, 48, 48, 48, 107, 15, 16, 17, 18,
+ 15, 4, 5, 6, 7, 8, 9, 10, 11, 12,
+ 13, 38, 39, 40, 38, 39, 40, 38, 39, 40,
+ 50, 50, 50, 50, 50, 104, 104, 118, 104, 125,
+ 125, 125, 125, 125, 125, 104, 104, 113, 104, 108,
+ 140, 109, 110, 111, 118, 139, 113, 15, 16, 17,
+
+ 18, 15, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 20, 21, 22, 23, 24, 20, 20, 20,
+ 20, 25, 26, 20, 20, 20, 27, 28, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 29, 20,
+ 30, 31, 32, 33, 20, 20, 20, 20, 138, 34,
+ 35, 36, 52, 52, 52, 52, 52, 52, 52, 52,
+ 52, 52, 53, 53, 53, 53, 53, 54, 54, 54,
+ 54, 54, 54, 53, 55, 56, 56, 53, 57, 58,
+ 59, 60, 61, 62, 63, 64, 65, 66, 67, 68,
+ 53, 53, 53, 53, 69, 70, 71, 72, 112, 73,
+
+ 74, 75, 76, 76, 76, 76, 76, 76, 76, 76,
+ 76, 76, 89, 53, 53, 108, 53, 78, 79, 80,
+ 105, 104, 104, 77, 104, 104, 104, 132, 104, 117,
+ 104, 104, 131, 104, 118, 53, 104, 104, 134, 104,
+ 69, 70, 130, 107, 114, 115, 116, 112, 129, 81,
+ 82, 83, 90, 90, 90, 90, 90, 90, 135, 136,
+ 53, 53, 113, 53, 53, 53, 53, 53, 53, 53,
+ 53, 53, 53, 53, 53, 119, 120, 121, 117, 53,
+ 53, 53, 53, 91, 91, 91, 91, 91, 91, 109,
+ 110, 111, 128, 114, 115, 116, 127, 108, 53, 41,
+
+ 20, 92, 93, 91, 91, 91, 91, 91, 91, 122,
+ 105, 147, 147, 147, 147, 147, 147, 77, 106, 53,
+ 41, 92, 93, 102, 119, 120, 121, 41, 101, 20,
+ 69, 70, 123, 123, 123, 123, 123, 123, 100, 124,
+ 99, 53, 147, 147, 147, 147, 147, 147, 77, 63,
+ 98, 97, 96, 95, 94, 53, 88, 41, 87, 69,
+ 70, 71, 72, 137, 137, 137, 137, 137, 137, 86,
+ 41, 85, 53, 84, 20, 43, 42, 41, 148, 148,
+ 148, 53, 53, 141, 141, 141, 141, 141, 141, 148,
+ 142, 148, 148, 148, 148, 148, 148, 148, 148, 148,
+
+ 53, 137, 137, 137, 137, 137, 137, 148, 148, 148,
+ 148, 148, 148, 148, 148, 148, 148, 148, 148, 53,
+ 53, 141, 141, 141, 141, 141, 141, 148, 142, 148,
+ 148, 148, 148, 148, 148, 148, 148, 148, 53, 144,
+ 144, 144, 144, 144, 144, 148, 145, 148, 148, 148,
+ 148, 148, 148, 148, 148, 148, 148, 53, 53, 148,
+ 148, 148, 148, 148, 148, 148, 148, 148, 71, 72,
+ 14, 14, 14, 14, 14, 14, 14, 14, 37, 37,
+ 37, 37, 148, 37, 45, 45, 45, 45, 47, 47,
+ 47, 47, 49, 49, 49, 49, 51, 51, 51, 51,
+
+ 77, 77, 77, 77, 77, 77, 148, 77, 41, 41,
+ 41, 41, 148, 41, 103, 148, 103, 108, 108, 108,
+ 108, 108, 148, 108, 113, 113, 113, 113, 113, 148,
+ 113, 118, 118, 118, 118, 118, 148, 118, 126, 148,
+ 126, 133, 148, 133, 125, 125, 125, 148, 125, 143,
+ 148, 143, 146, 148, 146, 3, 148, 148, 148, 148,
+ 148, 148, 148, 148, 148, 148, 148, 148, 148, 148,
+ 148, 148, 148, 148, 148, 148, 148, 148, 148, 148,
+ 148, 148, 148, 148, 148, 148, 148, 148, 148, 148,
+ 148, 148, 148, 148, 148, 148, 148, 148, 148, 148,
+
+ 148, 148, 148, 148, 148, 148, 148
+ } ;
+
+static yyconst flex_int16_t yy_chk[608] =
+ { 0,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 21, 21, 21, 21, 21, 22, 22, 22, 22, 22,
+ 23, 23, 23, 23, 23, 24, 24, 24, 24, 24,
+ 44, 44, 44, 44, 44, 46, 46, 46, 46, 46,
+ 48, 48, 48, 48, 48, 96, 1, 1, 1, 1,
+ 1, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 14, 14, 14, 37, 37, 37, 41, 41, 41,
+ 50, 50, 50, 50, 50, 89, 89, 140, 89, 104,
+ 104, 104, 104, 104, 104, 105, 105, 139, 105, 138,
+ 132, 96, 96, 96, 131, 130, 129, 2, 2, 2,
+
+ 2, 2, 13, 13, 13, 13, 13, 13, 13, 13,
+ 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
+ 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
+ 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
+ 13, 13, 13, 13, 13, 13, 13, 13, 128, 13,
+ 13, 13, 30, 30, 30, 30, 30, 30, 30, 30,
+ 30, 30, 30, 30, 30, 30, 30, 30, 30, 30,
+ 30, 30, 30, 30, 30, 30, 30, 30, 30, 30,
+ 30, 30, 30, 30, 30, 30, 30, 30, 30, 30,
+ 30, 30, 30, 30, 30, 30, 30, 30, 97, 30,
+
+ 30, 30, 31, 31, 31, 31, 31, 31, 31, 31,
+ 31, 31, 54, 54, 54, 127, 54, 31, 31, 31,
+ 90, 124, 124, 122, 124, 134, 134, 121, 134, 98,
+ 142, 142, 120, 142, 119, 54, 145, 145, 125, 145,
+ 90, 90, 116, 108, 97, 97, 97, 113, 115, 31,
+ 31, 31, 56, 56, 56, 56, 56, 56, 125, 125,
+ 56, 56, 114, 56, 56, 56, 56, 56, 56, 56,
+ 56, 56, 56, 56, 56, 98, 98, 98, 118, 56,
+ 56, 56, 56, 57, 57, 57, 57, 57, 57, 108,
+ 108, 108, 111, 113, 113, 113, 110, 109, 106, 102,
+
+ 101, 57, 57, 91, 91, 91, 91, 91, 91, 100,
+ 91, 146, 146, 146, 146, 146, 146, 99, 95, 94,
+ 88, 91, 91, 87, 118, 118, 118, 86, 85, 84,
+ 91, 91, 103, 103, 103, 103, 103, 103, 83, 103,
+ 82, 146, 147, 147, 147, 147, 147, 147, 81, 103,
+ 80, 79, 78, 75, 74, 73, 43, 42, 40, 103,
+ 103, 103, 103, 126, 126, 126, 126, 126, 126, 39,
+ 38, 36, 147, 35, 34, 18, 17, 16, 3, 0,
+ 0, 126, 126, 133, 133, 133, 133, 133, 133, 0,
+ 133, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+
+ 133, 137, 137, 137, 137, 137, 137, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 137,
+ 137, 141, 141, 141, 141, 141, 141, 0, 141, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 141, 143,
+ 143, 143, 143, 143, 143, 0, 143, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 143, 143, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 143, 143,
+ 149, 149, 149, 149, 149, 149, 149, 149, 150, 150,
+ 150, 150, 0, 150, 151, 151, 151, 151, 152, 152,
+ 152, 152, 153, 153, 153, 153, 154, 154, 154, 154,
+
+ 155, 155, 155, 155, 155, 155, 0, 155, 156, 156,
+ 156, 156, 0, 156, 157, 0, 157, 158, 158, 158,
+ 158, 158, 0, 158, 159, 159, 159, 159, 159, 0,
+ 159, 160, 160, 160, 160, 160, 0, 160, 161, 0,
+ 161, 162, 0, 162, 163, 163, 164, 0, 164, 165,
+ 0, 165, 166, 0, 166, 148, 148, 148, 148, 148,
+ 148, 148, 148, 148, 148, 148, 148, 148, 148, 148,
+ 148, 148, 148, 148, 148, 148, 148, 148, 148, 148,
+ 148, 148, 148, 148, 148, 148, 148, 148, 148, 148,
+ 148, 148, 148, 148, 148, 148, 148, 148, 148, 148,
+
+ 148, 148, 148, 148, 148, 148, 148
+ } ;
+
/* The intent behind this definition is that it'll catch
* any uses of REJECT which flex missed.
*/
@@ -1892,7 +664,7 @@ static void runes_parser_handle_osc1(RunesTerm *t, char *buf, size_t len);
static void runes_parser_handle_osc2(RunesTerm *t, char *buf, size_t len);
static void runes_parser_handle_ascii(RunesTerm *t, char *text, size_t len);
static void runes_parser_handle_text(RunesTerm *t, char *text, size_t len);
-#line 1896 "src/parser.c"
+#line 668 "src/parser.c"
#define INITIAL 0
@@ -2143,7 +915,7 @@ YY_DECL
#line 122 "src/parser.l"
-#line 2147 "src/parser.c"
+#line 919 "src/parser.c"
while ( 1 ) /* loops until end-of-file is reached */
{
@@ -2159,18 +931,26 @@ YY_DECL
yy_current_state = yyg->yy_start;
yy_match:
- while ( (yy_current_state = yy_nxt[yy_current_state][ yy_ec[YY_SC_TO_UI(*yy_cp)] ]) > 0 )
+ do
{
+ register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
if ( yy_accept[yy_current_state] )
{
yyg->yy_last_accepting_state = yy_current_state;
yyg->yy_last_accepting_cpos = yy_cp;
}
-
+ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+ {
+ yy_current_state = (int) yy_def[yy_current_state];
+ if ( yy_current_state >= 149 )
+ yy_c = yy_meta[(unsigned int) yy_c];
+ }
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
++yy_cp;
}
-
- yy_current_state = -yy_current_state;
+ while ( yy_current_state != 148 );
+ yy_cp = yyg->yy_last_accepting_cpos;
+ yy_current_state = yyg->yy_last_accepting_state;
yy_find_action:
yy_act = yy_accept[yy_current_state];
@@ -2184,7 +964,7 @@ do_action: /* This label is used only to access EOF actions. */
case 0: /* must back up */
/* undo the effects of YY_DO_BEFORE_ACTION */
*yy_cp = yyg->yy_hold_char;
- yy_cp = yyg->yy_last_accepting_cpos + 1;
+ yy_cp = yyg->yy_last_accepting_cpos;
yy_current_state = yyg->yy_last_accepting_state;
goto yy_find_action;
@@ -2477,7 +1257,7 @@ YY_RULE_SETUP
#line 224 "src/parser.l"
YY_FATAL_ERROR( "flex scanner jammed" );
YY_BREAK
-#line 2481 "src/parser.c"
+#line 1261 "src/parser.c"
case YY_END_OF_BUFFER:
{
@@ -2542,7 +1322,8 @@ YY_FATAL_ERROR( "flex scanner jammed" );
else
{
- yy_cp = yyg->yy_c_buf_p;
+ yy_cp = yyg->yy_last_accepting_cpos;
+ yy_current_state = yyg->yy_last_accepting_state;
goto yy_find_action;
}
}
@@ -2761,12 +1542,19 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp )
{
- yy_current_state = yy_nxt[yy_current_state][(*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1)];
+ register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
if ( yy_accept[yy_current_state] )
{
yyg->yy_last_accepting_state = yy_current_state;
yyg->yy_last_accepting_cpos = yy_cp;
}
+ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+ {
+ yy_current_state = (int) yy_def[yy_current_state];
+ if ( yy_current_state >= 149 )
+ yy_c = yy_meta[(unsigned int) yy_c];
+ }
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
}
return yy_current_state;
@@ -2783,17 +1571,20 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */
register char *yy_cp = yyg->yy_c_buf_p;
- yy_current_state = yy_nxt[yy_current_state][1];
- yy_is_jam = (yy_current_state <= 0);
-
- if ( ! yy_is_jam )
+ register YY_CHAR yy_c = 1;
+ if ( yy_accept[yy_current_state] )
{
- if ( yy_accept[yy_current_state] )
- {
- yyg->yy_last_accepting_state = yy_current_state;
- yyg->yy_last_accepting_cpos = yy_cp;
- }
+ yyg->yy_last_accepting_state = yy_current_state;
+ yyg->yy_last_accepting_cpos = yy_cp;
}
+ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+ {
+ yy_current_state = (int) yy_def[yy_current_state];
+ if ( yy_current_state >= 149 )
+ yy_c = yy_meta[(unsigned int) yy_c];
+ }
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+ yy_is_jam = (yy_current_state == 148);
(void)yyg;
return yy_is_jam ? 0 : yy_current_state;
@@ -3574,23 +2365,24 @@ static void runes_parser_handle_bel(RunesTerm *t)
static void runes_parser_handle_bs(RunesTerm *t)
{
- runes_screen_move_to(t, t->scr.cur.row, t->scr.cur.col - 1);
+ runes_screen_move_to(t, t->scr.grid->cur.row, t->scr.grid->cur.col - 1);
}
static void runes_parser_handle_tab(RunesTerm *t)
{
runes_screen_move_to(
- t, t->scr.cur.row, t->scr.cur.col - (t->scr.cur.col % 8) + 8);
+ t, t->scr.grid->cur.row,
+ t->scr.grid->cur.col - (t->scr.grid->cur.col % 8) + 8);
}
static void runes_parser_handle_lf(RunesTerm *t)
{
- runes_screen_move_to(t, t->scr.cur.row + 1, t->scr.cur.col);
+ runes_screen_move_to(t, t->scr.grid->cur.row + 1, t->scr.grid->cur.col);
}
static void runes_parser_handle_cr(RunesTerm *t)
{
- runes_screen_move_to(t, t->scr.cur.row, 0);
+ runes_screen_move_to(t, t->scr.grid->cur.row, 0);
}
static void runes_parser_handle_deckpam(RunesTerm *t)
@@ -3605,14 +2397,14 @@ static void runes_parser_handle_deckpnm(RunesTerm *t)
static void runes_parser_handle_ri(RunesTerm *t)
{
- runes_screen_move_to(t, t->scr.cur.row - 1, t->scr.cur.col);
+ runes_screen_move_to(t, t->scr.grid->cur.row - 1, t->scr.grid->cur.col);
}
static void runes_parser_handle_ris(RunesTerm *t)
{
runes_screen_use_normal_buffer(t);
runes_screen_set_scroll_region(
- t, 0, t->scr.max.row - 1, 0, t->scr.max.col - 1);
+ t, 0, t->scr.grid->max.row - 1, 0, t->scr.grid->max.col - 1);
runes_screen_clear_screen(t);
runes_screen_save_cursor(t);
runes_screen_reset_text_attributes(t);
@@ -3696,7 +2488,8 @@ static void runes_parser_handle_cuu(RunesTerm *t, char *buf, size_t len)
int params[RUNES_PARSER_CSI_MAX_PARAMS] = { 1 }, nparams;
runes_parser_extract_csi_params(buf + 2, len - 3, params, &nparams);
- runes_screen_move_to(t, t->scr.cur.row - params[0], t->scr.cur.col);
+ runes_screen_move_to(
+ t, t->scr.grid->cur.row - params[0], t->scr.grid->cur.col);
}
static void runes_parser_handle_cud(RunesTerm *t, char *buf, size_t len)
@@ -3704,7 +2497,8 @@ static void runes_parser_handle_cud(RunesTerm *t, char *buf, size_t len)
int params[RUNES_PARSER_CSI_MAX_PARAMS] = { 1 }, nparams;
runes_parser_extract_csi_params(buf + 2, len - 3, params, &nparams);
- runes_screen_move_to(t, t->scr.cur.row + params[0], t->scr.cur.col);
+ runes_screen_move_to(
+ t, t->scr.grid->cur.row + params[0], t->scr.grid->cur.col);
}
static void runes_parser_handle_cuf(RunesTerm *t, char *buf, size_t len)
@@ -3712,7 +2506,8 @@ static void runes_parser_handle_cuf(RunesTerm *t, char *buf, size_t len)
int params[RUNES_PARSER_CSI_MAX_PARAMS] = { 1 }, nparams;
runes_parser_extract_csi_params(buf + 2, len - 3, params, &nparams);
- runes_screen_move_to(t, t->scr.cur.row, t->scr.cur.col + params[0]);
+ runes_screen_move_to(
+ t, t->scr.grid->cur.row, t->scr.grid->cur.col + params[0]);
}
static void runes_parser_handle_cub(RunesTerm *t, char *buf, size_t len)
@@ -3720,7 +2515,8 @@ static void runes_parser_handle_cub(RunesTerm *t, char *buf, size_t len)
int params[RUNES_PARSER_CSI_MAX_PARAMS] = { 1 }, nparams;
runes_parser_extract_csi_params(buf + 2, len - 3, params, &nparams);
- runes_screen_move_to(t, t->scr.cur.row, t->scr.cur.col - params[0]);
+ runes_screen_move_to(
+ t, t->scr.grid->cur.row, t->scr.grid->cur.col - params[0]);
}
static void runes_parser_handle_cup(RunesTerm *t, char *buf, size_t len)
@@ -3785,7 +2581,7 @@ static void runes_parser_handle_il(RunesTerm *t, char *buf, size_t len)
runes_parser_extract_csi_params(buf + 2, len - 3, params, &nparams);
runes_screen_insert_lines(t, params[0]);
- runes_screen_move_to(t, t->scr.cur.row, 0);
+ runes_screen_move_to(t, t->scr.grid->cur.row, 0);
}
static void runes_parser_handle_dl(RunesTerm *t, char *buf, size_t len)
@@ -3794,7 +2590,7 @@ static void runes_parser_handle_dl(RunesTerm *t, char *buf, size_t len)
runes_parser_extract_csi_params(buf + 2, len - 3, params, &nparams);
runes_screen_delete_lines(t, params[0]);
- runes_screen_move_to(t, t->scr.cur.row, 0);
+ runes_screen_move_to(t, t->scr.grid->cur.row, 0);
}
static void runes_parser_handle_dch(RunesTerm *t, char *buf, size_t len)
@@ -4066,7 +2862,7 @@ static void runes_parser_handle_sgr(RunesTerm *t, char *buf, size_t len)
static void runes_parser_handle_csr(RunesTerm *t, char *buf, size_t len)
{
int params[RUNES_PARSER_CSI_MAX_PARAMS] = {
- 1, t->scr.max.row, 1, t->scr.max.col };
+ 1, t->scr.grid->max.row, 1, t->scr.grid->max.col };
int nparams;
runes_parser_extract_csi_params(buf + 2, len - 3, params, &nparams);
diff --git a/src/parser.l b/src/parser.l
index 4fbcd6b..7c3ef02 100644
--- a/src/parser.l
+++ b/src/parser.l
@@ -235,23 +235,24 @@ static void runes_parser_handle_bel(RunesTerm *t)
static void runes_parser_handle_bs(RunesTerm *t)
{
- runes_screen_move_to(t, t->scr.cur.row, t->scr.cur.col - 1);
+ runes_screen_move_to(t, t->scr.grid->cur.row, t->scr.grid->cur.col - 1);
}
static void runes_parser_handle_tab(RunesTerm *t)
{
runes_screen_move_to(
- t, t->scr.cur.row, t->scr.cur.col - (t->scr.cur.col % 8) + 8);
+ t, t->scr.grid->cur.row,
+ t->scr.grid->cur.col - (t->scr.grid->cur.col % 8) + 8);
}
static void runes_parser_handle_lf(RunesTerm *t)
{
- runes_screen_move_to(t, t->scr.cur.row + 1, t->scr.cur.col);
+ runes_screen_move_to(t, t->scr.grid->cur.row + 1, t->scr.grid->cur.col);
}
static void runes_parser_handle_cr(RunesTerm *t)
{
- runes_screen_move_to(t, t->scr.cur.row, 0);
+ runes_screen_move_to(t, t->scr.grid->cur.row, 0);
}
static void runes_parser_handle_deckpam(RunesTerm *t)
@@ -266,14 +267,14 @@ static void runes_parser_handle_deckpnm(RunesTerm *t)
static void runes_parser_handle_ri(RunesTerm *t)
{
- runes_screen_move_to(t, t->scr.cur.row - 1, t->scr.cur.col);
+ runes_screen_move_to(t, t->scr.grid->cur.row - 1, t->scr.grid->cur.col);
}
static void runes_parser_handle_ris(RunesTerm *t)
{
runes_screen_use_normal_buffer(t);
runes_screen_set_scroll_region(
- t, 0, t->scr.max.row - 1, 0, t->scr.max.col - 1);
+ t, 0, t->scr.grid->max.row - 1, 0, t->scr.grid->max.col - 1);
runes_screen_clear_screen(t);
runes_screen_save_cursor(t);
runes_screen_reset_text_attributes(t);
@@ -357,7 +358,8 @@ static void runes_parser_handle_cuu(RunesTerm *t, char *buf, size_t len)
int params[RUNES_PARSER_CSI_MAX_PARAMS] = { 1 }, nparams;
runes_parser_extract_csi_params(buf + 2, len - 3, params, &nparams);
- runes_screen_move_to(t, t->scr.cur.row - params[0], t->scr.cur.col);
+ runes_screen_move_to(
+ t, t->scr.grid->cur.row - params[0], t->scr.grid->cur.col);
}
static void runes_parser_handle_cud(RunesTerm *t, char *buf, size_t len)
@@ -365,7 +367,8 @@ static void runes_parser_handle_cud(RunesTerm *t, char *buf, size_t len)
int params[RUNES_PARSER_CSI_MAX_PARAMS] = { 1 }, nparams;
runes_parser_extract_csi_params(buf + 2, len - 3, params, &nparams);
- runes_screen_move_to(t, t->scr.cur.row + params[0], t->scr.cur.col);
+ runes_screen_move_to(
+ t, t->scr.grid->cur.row + params[0], t->scr.grid->cur.col);
}
static void runes_parser_handle_cuf(RunesTerm *t, char *buf, size_t len)
@@ -373,7 +376,8 @@ static void runes_parser_handle_cuf(RunesTerm *t, char *buf, size_t len)
int params[RUNES_PARSER_CSI_MAX_PARAMS] = { 1 }, nparams;
runes_parser_extract_csi_params(buf + 2, len - 3, params, &nparams);
- runes_screen_move_to(t, t->scr.cur.row, t->scr.cur.col + params[0]);
+ runes_screen_move_to(
+ t, t->scr.grid->cur.row, t->scr.grid->cur.col + params[0]);
}
static void runes_parser_handle_cub(RunesTerm *t, char *buf, size_t len)
@@ -381,7 +385,8 @@ static void runes_parser_handle_cub(RunesTerm *t, char *buf, size_t len)
int params[RUNES_PARSER_CSI_MAX_PARAMS] = { 1 }, nparams;
runes_parser_extract_csi_params(buf + 2, len - 3, params, &nparams);
- runes_screen_move_to(t, t->scr.cur.row, t->scr.cur.col - params[0]);
+ runes_screen_move_to(
+ t, t->scr.grid->cur.row, t->scr.grid->cur.col - params[0]);
}
static void runes_parser_handle_cup(RunesTerm *t, char *buf, size_t len)
@@ -446,7 +451,7 @@ static void runes_parser_handle_il(RunesTerm *t, char *buf, size_t len)
runes_parser_extract_csi_params(buf + 2, len - 3, params, &nparams);
runes_screen_insert_lines(t, params[0]);
- runes_screen_move_to(t, t->scr.cur.row, 0);
+ runes_screen_move_to(t, t->scr.grid->cur.row, 0);
}
static void runes_parser_handle_dl(RunesTerm *t, char *buf, size_t len)
@@ -455,7 +460,7 @@ static void runes_parser_handle_dl(RunesTerm *t, char *buf, size_t len)
runes_parser_extract_csi_params(buf + 2, len - 3, params, &nparams);
runes_screen_delete_lines(t, params[0]);
- runes_screen_move_to(t, t->scr.cur.row, 0);
+ runes_screen_move_to(t, t->scr.grid->cur.row, 0);
}
static void runes_parser_handle_dch(RunesTerm *t, char *buf, size_t len)
@@ -727,7 +732,7 @@ static void runes_parser_handle_sgr(RunesTerm *t, char *buf, size_t len)
static void runes_parser_handle_csr(RunesTerm *t, char *buf, size_t len)
{
int params[RUNES_PARSER_CSI_MAX_PARAMS] = {
- 1, t->scr.max.row, 1, t->scr.max.col };
+ 1, t->scr.grid->max.row, 1, t->scr.grid->max.col };
int nparams;
runes_parser_extract_csi_params(buf + 2, len - 3, params, &nparams);
diff --git a/src/pty-unix.c b/src/pty-unix.c
index 3332535..38afef1 100644
--- a/src/pty-unix.c
+++ b/src/pty-unix.c
@@ -99,8 +99,8 @@ void runes_pty_backend_set_window_size(RunesTerm *t)
{
struct winsize size;
- size.ws_row = t->scr.max.row;
- size.ws_col = t->scr.max.col;
+ size.ws_row = t->scr.grid->max.row;
+ size.ws_col = t->scr.grid->max.col;
size.ws_xpixel = t->xpixel;
size.ws_ypixel = t->ypixel;
ioctl(t->pty.master, TIOCSWINSZ, &size);
diff --git a/src/screen.c b/src/screen.c
index 0549959..3681eb4 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -13,8 +13,9 @@ static int runes_screen_scroll_region_is_active(RunesTerm *t);
void runes_screen_init(RunesTerm *t)
{
- UNUSED(t);
- /* nothing (for now?) */
+ RunesScreen *scr = &t->scr;
+
+ scr->grid = calloc(1, sizeof(struct runes_grid));
}
void runes_screen_set_window_size(RunesTerm *t)
@@ -23,57 +24,58 @@ void runes_screen_set_window_size(RunesTerm *t)
struct runes_loc old_size;
int i;
- old_size.row = scr->max.row;
- old_size.col = scr->max.col;
+ old_size.row = scr->grid->max.row;
+ old_size.col = scr->grid->max.col;
- scr->max.row = t->ypixel / t->fonty;
- scr->max.col = t->xpixel / t->fontx;
+ scr->grid->max.row = t->ypixel / t->fonty;
+ scr->grid->max.col = t->xpixel / t->fontx;
- if (scr->max.row == 0) {
- scr->max.row = 1;
+ if (scr->grid->max.row == 0) {
+ scr->grid->max.row = 1;
}
- if (scr->max.col == 0) {
- scr->max.col = 1;
+ if (scr->grid->max.col == 0) {
+ scr->grid->max.col = 1;
}
- if (scr->max.row == old_size.row && scr->max.col == old_size.col) {
+ if (scr->grid->max.row == old_size.row && scr->grid->max.col == old_size.col) {
return;
}
- if (scr->cur.row >= scr->max.row) {
- scr->cur.row = scr->max.row - 1;
+ if (scr->grid->cur.row >= scr->grid->max.row) {
+ scr->grid->cur.row = scr->grid->max.row - 1;
}
- if (scr->cur.col > scr->max.col) {
- scr->cur.col = scr->max.col;
+ if (scr->grid->cur.col > scr->grid->max.col) {
+ scr->grid->cur.col = scr->grid->max.col;
}
- runes_screen_ensure_capacity(t, scr->max.row);
+ runes_screen_ensure_capacity(t, scr->grid->max.row);
- for (i = 0; i < scr->row_count; ++i) {
- scr->rows[i].cells = realloc(
- scr->rows[i].cells, scr->max.col * sizeof(struct runes_cell));
- if (old_size.col > scr->max.col) {
+ for (i = 0; i < scr->grid->row_count; ++i) {
+ scr->grid->rows[i].cells = realloc(
+ scr->grid->rows[i].cells,
+ scr->grid->max.col * sizeof(struct runes_cell));
+ if (old_size.col > scr->grid->max.col) {
memset(
- &scr->rows[i].cells[scr->max.col], 0,
- (old_size.col - scr->max.col) * sizeof(struct runes_cell));
+ &scr->grid->rows[i].cells[scr->grid->max.col], 0,
+ (old_size.col - scr->grid->max.col) * sizeof(struct runes_cell));
}
}
- for (i = scr->row_count; i < scr->max.row; ++i) {
- scr->rows[i].cells = calloc(
- scr->max.col, sizeof(struct runes_cell));
+ for (i = scr->grid->row_count; i < scr->grid->max.row; ++i) {
+ scr->grid->rows[i].cells = calloc(
+ scr->grid->max.col, sizeof(struct runes_cell));
}
- if (scr->row_count < scr->max.row) {
- scr->row_count = scr->max.row;
- scr->row_top = 0;
+ if (scr->grid->row_count < scr->grid->max.row) {
+ scr->grid->row_count = scr->grid->max.row;
+ scr->grid->row_top = 0;
}
else {
- scr->row_top = scr->row_count - scr->max.row;
+ scr->grid->row_top = scr->grid->row_count - scr->grid->max.row;
}
- scr->scroll_top = 0;
- scr->scroll_bottom = scr->max.row - 1;
+ scr->grid->scroll_top = 0;
+ scr->grid->scroll_bottom = scr->grid->max.row - 1;
}
void runes_screen_process_string(RunesTerm *t, char *buf, size_t len)
@@ -118,18 +120,18 @@ void runes_screen_show_string_ascii(RunesTerm *t, char *buf, size_t len)
for (i = 0; i < len; ++i) {
struct runes_cell *cell;
- if (scr->cur.col >= scr->max.col) {
- runes_screen_row_at(t, scr->cur.row)->wrapped = 1;
- runes_screen_move_to(t, scr->cur.row + 1, 0);
+ if (scr->grid->cur.col >= scr->grid->max.col) {
+ runes_screen_row_at(t, scr->grid->cur.row)->wrapped = 1;
+ runes_screen_move_to(t, scr->grid->cur.row + 1, 0);
}
- cell = runes_screen_cell_at(t, scr->cur.row, scr->cur.col);
+ cell = runes_screen_cell_at(t, scr->grid->cur.row, scr->grid->cur.col);
cell->len = 1;
cell->contents[0] = buf[i];
cell->attrs = scr->attrs;
cell->is_wide = 0;
- runes_screen_move_to(t, scr->cur.row, scr->cur.col + 1);
+ runes_screen_move_to(t, scr->grid->cur.row, scr->grid->cur.col + 1);
}
scr->dirty = 1;
@@ -157,12 +159,13 @@ void runes_screen_show_string_utf8(RunesTerm *t, char *buf, size_t len)
|| ctype == G_UNICODE_NON_SPACING_MARK;
if (is_combining) {
- if (scr->cur.col > 0) {
- cell = runes_screen_cell_at(t, scr->cur.row, scr->cur.col - 1);
+ if (scr->grid->cur.col > 0) {
+ cell = runes_screen_cell_at(
+ t, scr->grid->cur.row, scr->grid->cur.col - 1);
}
- else if (scr->cur.row > 0 && runes_screen_row_at(t, scr->cur.row - 1)->wrapped) {
+ else if (scr->grid->cur.row > 0 && runes_screen_row_at(t, scr->grid->cur.row - 1)->wrapped) {
cell = runes_screen_cell_at(
- t, scr->cur.row - 1, scr->max.col - 1);
+ t, scr->grid->cur.row - 1, scr->grid->max.col - 1);
}
if (cell) {
@@ -181,11 +184,12 @@ void runes_screen_show_string_utf8(RunesTerm *t, char *buf, size_t len)
}
}
else {
- if (scr->cur.col + (is_wide ? 2 : 1) > scr->max.col) {
- runes_screen_row_at(t, scr->cur.row)->wrapped = 1;
- runes_screen_move_to(t, scr->cur.row + 1, 0);
+ if (scr->grid->cur.col + (is_wide ? 2 : 1) > scr->grid->max.col) {
+ runes_screen_row_at(t, scr->grid->cur.row)->wrapped = 1;
+ runes_screen_move_to(t, scr->grid->cur.row + 1, 0);
}
- cell = runes_screen_cell_at(t, scr->cur.row, scr->cur.col);
+ cell = runes_screen_cell_at(
+ t, scr->grid->cur.row, scr->grid->cur.col);
cell->is_wide = is_wide;
cell->len = next - c;
@@ -193,7 +197,7 @@ void runes_screen_show_string_utf8(RunesTerm *t, char *buf, size_t len)
cell->attrs = scr->attrs;
runes_screen_move_to(
- t, scr->cur.row, scr->cur.col + (is_wide ? 2 : 1));
+ t, scr->grid->cur.row, scr->grid->cur.col + (is_wide ? 2 : 1));
}
c = next;
@@ -208,7 +212,7 @@ void runes_screen_show_string_utf8(RunesTerm *t, char *buf, size_t len)
void runes_screen_move_to(RunesTerm *t, int row, int col)
{
RunesScreen *scr = &t->scr;
- int top = scr->scroll_top, bottom = scr->scroll_bottom;
+ int top = scr->grid->scroll_top, bottom = scr->grid->scroll_bottom;
if (row > bottom) {
runes_screen_scroll_down(t, row - bottom);
@@ -223,12 +227,12 @@ void runes_screen_move_to(RunesTerm *t, int row, int col)
col = 0;
}
- if (col > scr->max.col) {
- col = scr->max.col;
+ if (col > scr->grid->max.col) {
+ col = scr->grid->max.col;
}
- scr->cur.row = row;
- scr->cur.col = col;
+ scr->grid->cur.row = row;
+ scr->grid->cur.col = col;
}
void runes_screen_clear_screen(RunesTerm *t)
@@ -236,11 +240,11 @@ void runes_screen_clear_screen(RunesTerm *t)
RunesScreen *scr = &t->scr;
int r;
- for (r = 0; r < scr->max.row; ++r) {
+ for (r = 0; r < scr->grid->max.row; ++r) {
struct runes_row *row;
row = runes_screen_row_at(t, r);
- memset(row->cells, 0, scr->max.col * sizeof(struct runes_cell));
+ memset(row->cells, 0, scr->grid->max.col * sizeof(struct runes_cell));
row->wrapped = 0;
}
@@ -253,14 +257,14 @@ void runes_screen_clear_screen_forward(RunesTerm *t)
struct runes_row *row;
int r;
- row = runes_screen_row_at(t, scr->cur.row);
+ row = runes_screen_row_at(t, scr->grid->cur.row);
memset(
- &row->cells[scr->cur.col], 0,
- (scr->max.col - scr->cur.col) * sizeof(struct runes_cell));
+ &row->cells[scr->grid->cur.col], 0,
+ (scr->grid->max.col - scr->grid->cur.col) * sizeof(struct runes_cell));
row->wrapped = 0;
- for (r = scr->cur.row + 1; r < scr->max.row; ++r) {
+ for (r = scr->grid->cur.row + 1; r < scr->grid->max.row; ++r) {
row = runes_screen_row_at(t, r);
- memset(row->cells, 0, scr->max.col * sizeof(struct runes_cell));
+ memset(row->cells, 0, scr->grid->max.col * sizeof(struct runes_cell));
row->wrapped = 0;
}
@@ -273,13 +277,13 @@ void runes_screen_clear_screen_backward(RunesTerm *t)
struct runes_row *row;
int r;
- for (r = 0; r < scr->cur.row - 1; ++r) {
+ for (r = 0; r < scr->grid->cur.row - 1; ++r) {
row = runes_screen_row_at(t, r);
- memset(row->cells, 0, scr->max.col * sizeof(struct runes_cell));
+ memset(row->cells, 0, scr->grid->max.col * sizeof(struct runes_cell));
row->wrapped = 0;
}
- row = runes_screen_row_at(t, scr->cur.row);
- memset(row->cells, 0, scr->cur.col * sizeof(struct runes_cell));
+ row = runes_screen_row_at(t, scr->grid->cur.row);
+ memset(row->cells, 0, scr->grid->cur.col * sizeof(struct runes_cell));
scr->dirty = 1;
}
@@ -289,8 +293,8 @@ void runes_screen_kill_line(RunesTerm *t)
RunesScreen *scr = &t->scr;
struct runes_row *row;
- row = runes_screen_row_at(t, scr->cur.row);
- memset(row->cells, 0, scr->max.col * sizeof(struct runes_cell));
+ row = runes_screen_row_at(t, scr->grid->cur.row);
+ memset(row->cells, 0, scr->grid->max.col * sizeof(struct runes_cell));
row->wrapped = 0;
scr->dirty = 1;
@@ -301,10 +305,10 @@ void runes_screen_kill_line_forward(RunesTerm *t)
RunesScreen *scr = &t->scr;
struct runes_row *row;
- row = runes_screen_row_at(t, scr->cur.row);
+ row = runes_screen_row_at(t, scr->grid->cur.row);
memset(
- &row->cells[scr->cur.col], 0,
- (scr->max.col - scr->cur.col) * sizeof(struct runes_cell));
+ &row->cells[scr->grid->cur.col], 0,
+ (scr->grid->max.col - scr->grid->cur.col) * sizeof(struct runes_cell));
row->wrapped = 0;
scr->dirty = 1;
@@ -315,10 +319,10 @@ void runes_screen_kill_line_backward(RunesTerm *t)
RunesScreen *scr = &t->scr;
struct runes_row *row;
- row = runes_screen_row_at(t, scr->cur.row);
- memset(row->cells, 0, scr->cur.col * sizeof(struct runes_cell));
- if (scr->cur.row > 0) {
- row = runes_screen_row_at(t, scr->cur.row - 1);
+ row = runes_screen_row_at(t, scr->grid->cur.row);
+ memset(row->cells, 0, scr->grid->cur.col * sizeof(struct runes_cell));
+ if (scr->grid->cur.row > 0) {
+ row = runes_screen_row_at(t, scr->grid->cur.row - 1);
row->wrapped = 0;
}
@@ -330,16 +334,17 @@ void runes_screen_insert_characters(RunesTerm *t, int count)
RunesScreen *scr = &t->scr;
struct runes_row *row;
- row = runes_screen_row_at(t, scr->cur.row);
- if (count >= scr->max.col - scr->cur.col) {
+ row = runes_screen_row_at(t, scr->grid->cur.row);
+ if (count >= scr->grid->max.col - scr->grid->cur.col) {
runes_screen_kill_line_forward(t);
}
else {
memmove(
- &row->cells[scr->cur.col + count], &row->cells[scr->cur.col],
- (scr->max.col - scr->cur.col - count) * sizeof(struct runes_cell));
+ &row->cells[scr->grid->cur.col + count],
+ &row->cells[scr->grid->cur.col],
+ (scr->grid->max.col - scr->grid->cur.col - count) * sizeof(struct runes_cell));
memset(
- &row->cells[scr->cur.col], 0,
+ &row->cells[scr->grid->cur.col], 0,
count * sizeof(struct runes_cell));
row->wrapped = 0;
}
@@ -351,7 +356,7 @@ void runes_screen_insert_lines(RunesTerm *t, int count)
{
RunesScreen *scr = &t->scr;
- if (count >= scr->max.row - scr->cur.row) {
+ if (count >= scr->grid->max.row - scr->grid->cur.row) {
runes_screen_clear_screen_forward(t);
runes_screen_kill_line(t);
}
@@ -359,18 +364,18 @@ void runes_screen_insert_lines(RunesTerm *t, int count)
struct runes_row *row;
int i;
- for (i = scr->max.row - count; i < scr->max.row; ++i) {
+ for (i = scr->grid->max.row - count; i < scr->grid->max.row; ++i) {
row = runes_screen_row_at(t, i);
free(row->cells);
}
- row = runes_screen_row_at(t, scr->cur.row);
+ row = runes_screen_row_at(t, scr->grid->cur.row);
memmove(
row + count, row,
- (scr->max.row - scr->cur.row - count) * sizeof(struct runes_row));
+ (scr->grid->max.row - scr->grid->cur.row - count) * sizeof(struct runes_row));
memset(row, 0, count * sizeof(struct runes_row));
- for (i = scr->cur.row; i < scr->cur.row + count; ++i) {
+ for (i = scr->grid->cur.row; i < scr->grid->cur.row + count; ++i) {
row = runes_screen_row_at(t, i);
- row->cells = calloc(scr->max.col, sizeof(struct runes_cell));
+ row->cells = calloc(scr->grid->max.col, sizeof(struct runes_cell));
row->wrapped = 0;
}
}
@@ -382,18 +387,19 @@ void runes_screen_delete_characters(RunesTerm *t, int count)
{
RunesScreen *scr = &t->scr;
- if (count >= scr->max.col - scr->cur.col) {
+ if (count >= scr->grid->max.col - scr->grid->cur.col) {
runes_screen_kill_line_forward(t);
}
else {
struct runes_row *row;
- row = runes_screen_row_at(t, scr->cur.row);
+ row = runes_screen_row_at(t, scr->grid->cur.row);
memmove(
- &row->cells[scr->cur.col], &row->cells[scr->cur.col + count],
- (scr->max.col - scr->cur.col - count) * sizeof(struct runes_cell));
+ &row->cells[scr->grid->cur.col],
+ &row->cells[scr->grid->cur.col + count],
+ (scr->grid->max.col - scr->grid->cur.col - count) * sizeof(struct runes_cell));
memset(
- &row->cells[scr->max.col - count], 0,
+ &row->cells[scr->grid->max.col - count], 0,
count * sizeof(struct runes_cell));
row->wrapped = 0;
}
@@ -405,7 +411,7 @@ void runes_screen_delete_lines(RunesTerm *t, int count)
{
RunesScreen *scr = &t->scr;
- if (count >= scr->max.row - scr->cur.row) {
+ if (count >= scr->grid->max.row - scr->grid->cur.row) {
runes_screen_clear_screen_forward(t);
runes_screen_kill_line(t);
}
@@ -413,19 +419,19 @@ void runes_screen_delete_lines(RunesTerm *t, int count)
struct runes_row *row;
int i;
- for (i = scr->cur.row; i < scr->cur.row + count; ++i) {
+ for (i = scr->grid->cur.row; i < scr->grid->cur.row + count; ++i) {
row = runes_screen_row_at(t, i);
free(row->cells);
}
- row = runes_screen_row_at(t, scr->cur.row);
+ row = runes_screen_row_at(t, scr->grid->cur.row);
memmove(
row, row + count,
- (scr->max.row - scr->cur.row - count) * sizeof(struct runes_row));
- row = runes_screen_row_at(t, scr->max.row - count);
+ (scr->grid->max.row - scr->grid->cur.row - count) * sizeof(struct runes_row));
+ row = runes_screen_row_at(t, scr->grid->max.row - count);
memset(row, 0, count * sizeof(struct runes_row));
- for (i = scr->max.row - count; i < scr->max.row; ++i) {
+ for (i = scr->grid->max.row - count; i < scr->grid->max.row; ++i) {
row = runes_screen_row_at(t, i);
- row->cells = calloc(scr->max.col, sizeof(struct runes_cell));
+ row->cells = calloc(scr->grid->max.col, sizeof(struct runes_cell));
row->wrapped = 0;
}
}
@@ -438,7 +444,7 @@ void runes_screen_set_scroll_region(
{
RunesScreen *scr = &t->scr;
- if (left > 0 || right < scr->max.col - 1) {
+ if (left > 0 || right < scr->grid->max.col - 1) {
fprintf(stderr, "vertical scroll regions not yet implemented\n");
}
@@ -446,10 +452,14 @@ void runes_screen_set_scroll_region(
return;
}
- scr->scroll_top = top < 0 ? 0 : top;
- scr->scroll_bottom = bottom >= scr->max.row ? scr->max.row - 1 : bottom;
+ scr->grid->scroll_top = top < 0
+ ? 0
+ : top;
+ scr->grid->scroll_bottom = bottom >= scr->grid->max.row
+ ? scr->grid->max.row - 1
+ : bottom;
- runes_screen_move_to(t, scr->scroll_top, 0);
+ runes_screen_move_to(t, scr->grid->scroll_top, 0);
}
void runes_screen_reset_text_attributes(RunesTerm *t)
@@ -570,22 +580,14 @@ void runes_screen_reset_inverse(RunesTerm *t)
void runes_screen_use_alternate_buffer(RunesTerm *t)
{
RunesScreen *scr = &t->scr;
- int i;
if (scr->alternate) {
return;
}
- runes_screen_save_cursor(t);
-
- scr->alternate = scr->rows;
- scr->alternate_max = scr->max;
-
- scr->rows = calloc(scr->max.row, sizeof(struct runes_row));
- for (i = 0; i < scr->max.row; ++i) {
- scr->rows[i].cells = calloc(
- scr->max.col, sizeof(struct runes_cell));
- }
+ scr->alternate = scr->grid;
+ scr->grid = calloc(1, sizeof(struct runes_grid));
+ runes_screen_set_window_size(t);
scr->dirty = 1;
}
@@ -599,16 +601,15 @@ void runes_screen_use_normal_buffer(RunesTerm *t)
return;
}
- for (i = 0; i < scr->max.row; ++i) {
- free(scr->rows[i].cells);
+ for (i = 0; i < scr->grid->row_count; ++i) {
+ free(scr->grid->rows[i].cells);
}
- free(scr->rows);
+ free(scr->grid->rows);
+ free(scr->grid);
- scr->rows = scr->alternate;
- scr->max = scr->alternate_max;
+ scr->grid = scr->alternate;
scr->alternate = NULL;
- runes_screen_restore_cursor(t);
runes_screen_set_window_size(t);
scr->dirty = 1;
@@ -618,14 +619,14 @@ void runes_screen_save_cursor(RunesTerm *t)
{
RunesScreen *scr = &t->scr;
- scr->saved = scr->cur;
+ scr->grid->saved = scr->grid->cur;
}
void runes_screen_restore_cursor(RunesTerm *t)
{
RunesScreen *scr = &t->scr;
- scr->cur = scr->saved;
+ scr->grid->cur = scr->grid->saved;
}
void runes_screen_show_cursor(RunesTerm *t)
@@ -725,10 +726,11 @@ void runes_screen_cleanup(RunesTerm *t)
RunesScreen *scr = &t->scr;
int i;
- for (i = 0; i < scr->row_count; ++i) {
- free(scr->rows[i].cells);
+ for (i = 0; i < scr->grid->row_count; ++i) {
+ free(scr->grid->rows[i].cells);
}
- free(scr->rows);
+ free(scr->grid->rows);
+ free(scr->grid);
free(scr->title);
free(scr->icon_name);
@@ -737,39 +739,39 @@ void runes_screen_cleanup(RunesTerm *t)
static void runes_screen_ensure_capacity(RunesTerm *t, int size)
{
RunesScreen *scr = &t->scr;
- int old_capacity = scr->row_capacity;
+ int old_capacity = scr->grid->row_capacity;
- if (scr->row_capacity >= size) {
+ if (scr->grid->row_capacity >= size) {
return;
}
- if (scr->row_capacity == 0) {
- scr->row_capacity = scr->max.row;
+ if (scr->grid->row_capacity == 0) {
+ scr->grid->row_capacity = scr->grid->max.row;
}
- while (scr->row_capacity < size) {
- scr->row_capacity *= 1.5;
+ while (scr->grid->row_capacity < size) {
+ scr->grid->row_capacity *= 1.5;
}
- scr->rows = realloc(
- scr->rows, scr->row_capacity * sizeof(struct runes_row));
+ scr->grid->rows = realloc(
+ scr->grid->rows, scr->grid->row_capacity * sizeof(struct runes_row));
memset(
- &scr->rows[old_capacity], 0,
- (scr->row_capacity - old_capacity) * sizeof(struct runes_row));
+ &scr->grid->rows[old_capacity], 0,
+ (scr->grid->row_capacity - old_capacity) * sizeof(struct runes_row));
}
static struct runes_row *runes_screen_row_at(RunesTerm *t, int row)
{
RunesScreen *scr = &t->scr;
- return &scr->rows[row + scr->row_top];
+ return &scr->grid->rows[row + scr->grid->row_top];
}
static struct runes_cell *runes_screen_cell_at(RunesTerm *t, int row, int col)
{
RunesScreen *scr = &t->scr;
- return &scr->rows[row + scr->row_top].cells[col];
+ return &scr->grid->rows[row + scr->grid->row_top].cells[col];
}
static void runes_screen_scroll_down(RunesTerm *t, int count)
@@ -779,7 +781,7 @@ static void runes_screen_scroll_down(RunesTerm *t, int count)
int i;
if (runes_screen_scroll_region_is_active(t) || scr->alternate) {
- int bottom = scr->scroll_bottom, top = scr->scroll_top;
+ int bottom = scr->grid->scroll_bottom, top = scr->grid->scroll_top;
if (bottom - top + 1 > count) {
for (i = 0; i < count; ++i) {
@@ -792,7 +794,8 @@ static void runes_screen_scroll_down(RunesTerm *t, int count)
(bottom - top + 1 - count) * sizeof(struct runes_row));
for (i = 0; i < count; ++i) {
row = runes_screen_row_at(t, bottom - i);
- row->cells = calloc(scr->max.col, sizeof(struct runes_cell));
+ row->cells = calloc(
+ scr->grid->max.col, sizeof(struct runes_cell));
row->wrapped = 0;
}
}
@@ -801,19 +804,19 @@ static void runes_screen_scroll_down(RunesTerm *t, int count)
row = runes_screen_row_at(t, top + i);
memset(
row->cells, 0,
- scr->max.col * sizeof(struct runes_cell));
+ scr->grid->max.col * sizeof(struct runes_cell));
row->wrapped = 0;
}
}
}
else {
- runes_screen_ensure_capacity(t, scr->row_count + count);
+ runes_screen_ensure_capacity(t, scr->grid->row_count + count);
for (i = 0; i < count; ++i) {
- row = runes_screen_row_at(t, i + scr->max.row);
- row->cells = calloc(scr->max.col, sizeof(struct runes_cell));
+ row = runes_screen_row_at(t, i + scr->grid->max.row);
+ row->cells = calloc(scr->grid->max.col, sizeof(struct runes_cell));
}
- scr->row_count += count;
- scr->row_top += count;
+ scr->grid->row_count += count;
+ scr->grid->row_top += count;
}
}
@@ -821,7 +824,7 @@ static void runes_screen_scroll_up(RunesTerm *t, int count)
{
RunesScreen *scr = &t->scr;
struct runes_row *row;
- int bottom = scr->scroll_bottom, top = scr->scroll_top;
+ int bottom = scr->grid->scroll_bottom, top = scr->grid->scroll_top;
int i;
if (bottom - top + 1 > count) {
@@ -835,14 +838,15 @@ static void runes_screen_scroll_up(RunesTerm *t, int count)
(bottom - top + 1 - count) * sizeof(struct runes_row));
for (i = 0; i < count; ++i) {
row = runes_screen_row_at(t, top + i);
- row->cells = calloc(scr->max.col, sizeof(struct runes_cell));
+ row->cells = calloc(scr->grid->max.col, sizeof(struct runes_cell));
row->wrapped = 0;
}
}
else {
for (i = 0; i < bottom - top + 1; ++i) {
row = runes_screen_row_at(t, top + i);
- memset(row->cells, 0, scr->max.col * sizeof(struct runes_cell));
+ memset(
+ row->cells, 0, scr->grid->max.col * sizeof(struct runes_cell));
row->wrapped = 0;
}
}
@@ -852,5 +856,6 @@ static int runes_screen_scroll_region_is_active(RunesTerm *t)
{
RunesScreen *scr = &t->scr;
- return scr->scroll_top != 0 || scr->scroll_bottom != scr->max.row - 1;
+ return scr->grid->scroll_top != 0
+ || scr->grid->scroll_bottom != scr->grid->max.row - 1;
}
diff --git a/src/screen.h b/src/screen.h
index b112de5..b18d2b5 100644
--- a/src/screen.h
+++ b/src/screen.h
@@ -57,28 +57,32 @@ struct runes_row {
unsigned char wrapped: 1;
};
-struct runes_screen {
+struct runes_grid {
struct runes_loc cur;
struct runes_loc max;
- struct runes_loc alternate_max;
struct runes_loc saved;
int scroll_top;
int scroll_bottom;
+ int row_count;
+ int row_capacity;
+ int row_top;
+
+ struct runes_row *rows;
+};
+
+struct runes_screen {
+ struct runes_grid *grid;
+ struct runes_grid *alternate;
+
char *title;
size_t title_len;
char *icon_name;
size_t icon_name_len;
- int row_count;
- int row_capacity;
- int row_top;
int row_visible_offset;
- struct runes_row *rows;
- struct runes_row *alternate;
-
struct runes_cell_attrs attrs;
unsigned char hide_cursor: 1;
diff --git a/src/term.c b/src/term.c
index bb3a529..aa7f628 100644
--- a/src/term.c
+++ b/src/term.c
@@ -12,8 +12,8 @@ void runes_term_init(RunesTerm *t, int argc, char *argv[])
runes_window_backend_create_window(t, argc, argv);
runes_pty_backend_spawn_subprocess(t);
- runes_display_set_window_size(t);
runes_screen_init(t);
+ runes_display_set_window_size(t);
t->loop = uv_default_loop();
runes_window_backend_start_loop(t);
diff --git a/src/window-xlib.c b/src/window-xlib.c
index 96d2558..485a3fd 100644
--- a/src/window-xlib.c
+++ b/src/window-xlib.c
@@ -760,8 +760,8 @@ static int runes_window_backend_handle_builtin_button_press(
break;
case Button4:
t->scr.row_visible_offset += t->config.scroll_lines;
- if (t->scr.row_visible_offset > t->scr.row_count - t->scr.max.row) {
- t->scr.row_visible_offset = t->scr.row_count - t->scr.max.row;
+ if (t->scr.row_visible_offset > t->scr.grid->row_count - t->scr.grid->max.row) {
+ t->scr.row_visible_offset = t->scr.grid->row_count - t->scr.grid->max.row;
}
t->scr.dirty = 1;
runes_window_backend_flush(t);