From 04c3dcc463c78687b730200dce21cd582b10638a Mon Sep 17 00:00:00 2001 From: nick black Date: Mon, 14 Jun 2021 01:57:17 -0400 Subject: [PATCH] tinfo_debug_caps: add some style work #1758 --- src/lib/debug.c | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/src/lib/debug.c b/src/lib/debug.c index 85f527dde..ea43df988 100644 --- a/src/lib/debug.c +++ b/src/lib/debug.c @@ -10,6 +10,41 @@ capbool(bool cap){ return cap ? 'y' : 'n'; } +static void +tinfo_debug_uline(const tinfo* ti, FILE* debugfp){ + const char* smul = get_escape(ti, ESCAPE_SMUL); + if(smul){ + term_emit(smul, debugfp, false); + } + fprintf(debugfp, "uline"); + if(smul){ + const char* rmul = get_escape(ti, ESCAPE_RMUL); + term_emit(rmul, debugfp, false); + } +} + +static void +tinfo_debug_ucurl(const tinfo* ti, FILE* debugfp){ + const char* smulx = get_escape(ti, ESCAPE_SMULX); + if(smulx){ + term_emit(smulx, debugfp, false); + } + fprintf(debugfp, "ucurl"); + if(smulx){ + const char* smulnox = get_escape(ti, ESCAPE_SMULNOX); + term_emit(smulnox, debugfp, false); + } +} + +static void +tinfo_debug_styles(const tinfo* ti, FILE* debugfp, const char* indent){ + fprintf(debugfp, "%s", indent); + tinfo_debug_ucurl(ti, debugfp); + fprintf(debugfp, " "); + tinfo_debug_uline(ti, debugfp); + fprintf(debugfp, "\n"); +} + static void tinfo_debug_caps(const tinfo* ti, FILE* debugfp, int rows, int cols, unsigned images, unsigned videos){ @@ -36,6 +71,7 @@ tinfo_debug_caps(const tinfo* ti, FILE* debugfp, int rows, int cols, }else{ fprintf(debugfp, "%srgba pixel graphics supported\n", indent); } + tinfo_debug_styles(ti, debugfp, indent); fprintf(debugfp, "%sutf8: %c quad: %c sex: %c braille: %c images: %c videos: %c\n", indent, capbool(ti->caps.utf8), capbool(ti->caps.quadrants), capbool(ti->caps.sextants), capbool(ti->caps.braille),