Add scr.css and scr.css.prefix used in 'ecc' for now ##cons

This commit is contained in:
pancake 2024-09-24 18:59:31 +02:00 committed by pancake
parent 39cd603d63
commit acd1d8f426
2 changed files with 21 additions and 1 deletions

View File

@ -2453,6 +2453,20 @@ static bool cb_scrfgets(void* user, void* data) {
return true;
}
static bool cb_scrcss(void *user, void *data) {
RConfigNode *node = (RConfigNode*) data;
if (node->i_value) {
R_LOG_TODO ("Not implemented");
return false;
}
return true;
}
static bool cb_scrcss_prefix(void *user, void *data) {
// do nothing for now
return true;
}
static bool cb_scrhtml(void *user, void *data) {
RConfigNode *node = (RConfigNode *) data;
r_cons_context ()->was_html = r_cons_context ()->is_html;
@ -4328,6 +4342,8 @@ R_API int r_core_config_init(RCore *core) {
SETCB ("scr.bgfill", "false", &cb_scr_bgfill, "fill background for ascii art when possible");
SETI ("scr.feedback", 1, "set visual feedback level (1=arrow on jump, 2=every key (useful for videos))");
SETCB ("scr.html", "false", &cb_scrhtml, "disassembly uses HTML syntax");
SETCB ("scr.css", "false", &cb_scrcss, "make scr.html use css instead of hardcoded colors (TODO)");
SETCB ("scr.css.prefix", "", &cb_scrcss_prefix, "hardcoded prefix for the css output (see ecc command)");
n = NODECB ("scr.nkey", "flag", &cb_scrnkey);
SETDESC (n, "select visual seek mode (affects n/N visual commands)");
SETOPTIONS (n, "fun", "hit", "flag", NULL);

View File

@ -497,7 +497,11 @@ static bool cmd_ec(RCore *core, const char *input) {
r_cons_pal_list ('j', NULL);
break;
case 'c': // "ecc"
r_cons_pal_list ('c', input + 2);
if (input[2]) {
r_cons_pal_list ('c', input + 2);
} else {
r_cons_pal_list ('c', r_config_get (core->config, "scr.css.prefix"));
}
break;
case '\0': // "ec"
r_cons_pal_list (0, NULL);