diff options
Diffstat (limited to 'include/visio.h')
-rw-r--r-- | include/visio.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/include/visio.h b/include/visio.h index 986be0df..af8cf4dd 100644 --- a/include/visio.h +++ b/include/visio.h @@ -9,6 +9,7 @@ #include "bbs.h" #include "ansi.h" // we need it. +#include <limits.h> // THEME DEFINITION ---------------------------------------------------- #define VCLR_HEADER ANSI_COLOR(1;37;46) // was: TITLE_COLOR @@ -30,10 +31,28 @@ #define VMSG_HDR_PREFIX "Ħi " #define VMSG_HDR_POSTFIX " Ħj" +// CONSTANT DEFINITION ------------------------------------------------- +#define VCOL_ALIGN_LEFT (0) +#define VCOL_ALIGN_RIGHT (1) +// #define VCOL_ALIGN_MIDDLE (2) +#define VCOL_MAXW (INT16_MAX) + // DATATYPE DEFINITION ------------------------------------------------- typedef void * VREFSCR; typedef long VREFCUR; +typedef short VCOLW; +typedef struct { + char *caption; + char *attr; // default attribute + VCOLW minw; // minimal width + VCOLW maxw; // max width + char has_ansi; // support ANSI escape sequence + char align; // alignment + char usewhole; // draw entire column, not leaving borders + char flag; // reserved +} VCOL; + // API DEFINITION ---------------------------------------------------- // int vans(char *prompt); // prompt at bottom and return y/n in lower case. // void vs_bar(char *title); // like stand_title @@ -56,6 +75,11 @@ void vs_header (const char *title, const char *mid, const char *right); // vs_ void vs_hdr (const char *title); // vs_bar, stand_title void vs_footer (const char *caption, const char *prompt); +// columned output +void vs_cols_layout (const VCOL* cols, VCOLW *ws, int n); +void vs_cols_hdr (const VCOL* cols, const VCOLW *ws, int n); +void vs_cols (const VCOL* cols, const VCOLW *ws, int n, ...); + // compatible macros #define stand_title vs_hdr |