Now have a nice panel to hold all the UI panels we'll use later.
This commit is contained in:
parent
baaf56d4de
commit
9bc9c9007f
12 changed files with 123 additions and 83 deletions
|
@ -2,7 +2,6 @@
|
|||
#line 1 "ansi_parser.rl"
|
||||
#include <fmt/core.h>
|
||||
#include <string_view>
|
||||
#include <charconv>
|
||||
#include "dbc.hpp"
|
||||
#include <SFML/Graphics.hpp>
|
||||
#include "ansi_parser.hpp"
|
||||
|
@ -10,11 +9,11 @@
|
|||
using namespace fmt;
|
||||
|
||||
|
||||
#line 81 "ansi_parser.rl"
|
||||
#line 80 "ansi_parser.rl"
|
||||
|
||||
|
||||
|
||||
#line 13 "ansi_parser.cpp"
|
||||
#line 12 "ansi_parser.cpp"
|
||||
static const char _foo_actions[] = {
|
||||
0, 1, 0, 1, 3, 1, 4, 1,
|
||||
5, 1, 6, 1, 7, 1, 11, 1,
|
||||
|
@ -85,7 +84,7 @@ static const int foo_error = 0;
|
|||
static const int foo_en_main = 19;
|
||||
|
||||
|
||||
#line 84 "ansi_parser.rl"
|
||||
#line 83 "ansi_parser.rl"
|
||||
|
||||
#include <ftxui/screen/terminal.hpp>
|
||||
|
||||
|
@ -99,11 +98,6 @@ ANSIParser::ANSIParser(sf::Color default_fg, sf::Color default_bg) :
|
|||
}
|
||||
}
|
||||
|
||||
bool ANSIParser::parse(const std::string &screen, WriteCB write) {
|
||||
std::wstring screen_utf8 = $converter.from_bytes(screen);
|
||||
return parse(screen_utf8, write);
|
||||
}
|
||||
|
||||
bool ANSIParser::parse(std::wstring_view codes, WriteCB write) {
|
||||
const wchar_t *start = NULL;
|
||||
int cs = 0;
|
||||
|
@ -116,14 +110,14 @@ bool ANSIParser::parse(std::wstring_view codes, WriteCB write) {
|
|||
sf::Color &target = color;
|
||||
|
||||
|
||||
#line 111 "ansi_parser.cpp"
|
||||
#line 105 "ansi_parser.cpp"
|
||||
{
|
||||
cs = foo_start;
|
||||
}
|
||||
|
||||
#line 114 "ansi_parser.rl"
|
||||
#line 108 "ansi_parser.rl"
|
||||
|
||||
#line 114 "ansi_parser.cpp"
|
||||
#line 108 "ansi_parser.cpp"
|
||||
{
|
||||
int _klen;
|
||||
unsigned int _trans;
|
||||
|
@ -197,13 +191,13 @@ _match:
|
|||
switch ( *_acts++ )
|
||||
{
|
||||
case 0:
|
||||
#line 14 "ansi_parser.rl"
|
||||
#line 13 "ansi_parser.rl"
|
||||
{
|
||||
start = p;
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
#line 18 "ansi_parser.rl"
|
||||
#line 17 "ansi_parser.rl"
|
||||
{
|
||||
value = 0;
|
||||
size_t len = p - start;
|
||||
|
@ -227,56 +221,56 @@ _match:
|
|||
}
|
||||
break;
|
||||
case 2:
|
||||
#line 40 "ansi_parser.rl"
|
||||
#line 39 "ansi_parser.rl"
|
||||
{ }
|
||||
break;
|
||||
case 3:
|
||||
#line 41 "ansi_parser.rl"
|
||||
#line 40 "ansi_parser.rl"
|
||||
{
|
||||
target = color;
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
#line 44 "ansi_parser.rl"
|
||||
#line 43 "ansi_parser.rl"
|
||||
{
|
||||
target = bgcolor;
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
#line 48 "ansi_parser.rl"
|
||||
#line 47 "ansi_parser.rl"
|
||||
{
|
||||
write(bgcolor, color, (*p));
|
||||
}
|
||||
break;
|
||||
case 6:
|
||||
#line 52 "ansi_parser.rl"
|
||||
#line 51 "ansi_parser.rl"
|
||||
{ color = $default_fg; }
|
||||
break;
|
||||
case 7:
|
||||
#line 53 "ansi_parser.rl"
|
||||
#line 52 "ansi_parser.rl"
|
||||
{ bgcolor = $default_bg; }
|
||||
break;
|
||||
case 8:
|
||||
#line 55 "ansi_parser.rl"
|
||||
#line 54 "ansi_parser.rl"
|
||||
{ target.r = value; }
|
||||
break;
|
||||
case 9:
|
||||
#line 56 "ansi_parser.rl"
|
||||
#line 55 "ansi_parser.rl"
|
||||
{ target.g = value; }
|
||||
break;
|
||||
case 10:
|
||||
#line 57 "ansi_parser.rl"
|
||||
#line 56 "ansi_parser.rl"
|
||||
{ target.b = value; }
|
||||
break;
|
||||
case 11:
|
||||
#line 58 "ansi_parser.rl"
|
||||
#line 57 "ansi_parser.rl"
|
||||
{ value = 0; }
|
||||
break;
|
||||
case 12:
|
||||
#line 59 "ansi_parser.rl"
|
||||
#line 58 "ansi_parser.rl"
|
||||
{ }
|
||||
break;
|
||||
#line 253 "ansi_parser.cpp"
|
||||
#line 247 "ansi_parser.cpp"
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -293,10 +287,10 @@ _again:
|
|||
while ( __nacts-- > 0 ) {
|
||||
switch ( *__acts++ ) {
|
||||
case 12:
|
||||
#line 59 "ansi_parser.rl"
|
||||
#line 58 "ansi_parser.rl"
|
||||
{ }
|
||||
break;
|
||||
#line 271 "ansi_parser.cpp"
|
||||
#line 265 "ansi_parser.cpp"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -304,7 +298,7 @@ _again:
|
|||
_out: {}
|
||||
}
|
||||
|
||||
#line 115 "ansi_parser.rl"
|
||||
#line 109 "ansi_parser.rl"
|
||||
|
||||
return p - pe == 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue