README: mention SDL2 backend
[rofl0r-concol.git] / ncconsole.h
blobdb886b93309d081895f48f6cad8650835a512c48
1 /*
2 * ncconsole.h
4 * Created on: 29.11.2010
5 *
6 * author: rofl0r
7 *
8 * License: LGPL 2.1+ with static linking exception
9 *
12 * interesting attr_t's:
14 * WA_ALTCHARSET Alternate character set
15 * WA_BLINK Blinking
16 * WA_BOLD Extra bright or bold
17 * WA_DIM Half bright
18 * WA_HORIZONTAL Horizontal highlight
19 * WA_INVIS Invisible
20 * WA_LEFT Left highlight
21 * WA_LOW Low highlight
22 * WA_PROTECT Protected
23 * WA_REVERSE Reverse video
24 * WA_RIGHT Right highlight
25 * WA_STANDOUT Best highlighting mode of the terminal
26 * WA_TOP Top highlight
27 * WA_UNDERLINE Underlining
28 * WA_VERTICAL Vertical highlight
30 * interesting special chars:
33 * ACS_ULCORNER WACS_ULCORNER + upper left-hand corner
34 * ACS_LLCORNER WACS_LLCORNER + lower left-hand corner
35 * ACS_URCORNER WACS_URCORNER + upper right-hand corner
36 * ACS_LRCORNER WACS_LRCORNER + lower right-hand corner
37 * ACS_RTEE WACS_RTEE + right tee
38 * ACS_LTEE WACS_LTEE + left tee
39 * ACS_BTEE WACS_BTEE + bottom tee
40 * ACS_TTEE WACS_TTEE + top tee
41 * ACS_HLINE WACS_HLINE - horizontal line
42 * ACS_VLINE WACS_VLINE | vertical line
43 * ACS_PLUS WACS_PLUS + plus
44 * ACS_S1 WACS_S1 - scan line 1
45 * ACS_S9 WACS_S9 _ scan line 9
46 * ACS_DIAMOND WACS_DIAMOND + diamond
47 * ACS_CKBOARD WACS_CKBOARD : checker board (stipple)
48 * ACS_DEGREE WACS_DEGREE ' degree symbol
49 * ACS_PLMINUS WACS_PLMINUS # plus/minus
50 * ACS_BULLET WACS_BULLET o bullet
51 * ACS_LARROW WACS_LARROW < arrow pointing left
52 * ACS_RARROW WACS_RARROW > arrow pointing right
53 * ACS_DARROW WACS_DARROW v arrow pointing down
54 * ACS_UARROW WACS_UARROW ^ arrow pointing up
55 * ACS_BOARD WACS_BOARD # board of squares
56 * ACS_LANTERN WACS_LANTERN # lantern symbol
57 * ACS_BLOCK WACS_BLOCK # solid square block
62 #ifndef NCCONSOLE_H_
63 #define NCCONSOLE_H_
65 #include <stdint.h>
67 #include "console_sel.h"
69 #if CONSOLE_BACKEND == NCURSES_CONSOLE
70 #pragma RcB2 LINK "-lncurses"
71 #pragma RcB2 DEP "ncconsole.c"
72 #endif
74 #include "rgb.h"
76 #define CONSOLE_COLORPAIRCOUNT 256
77 #define CONSOLE_MAXSAVECOLORS 16
79 typedef struct {
80 short fgcol;
81 short bgcol;
82 } Colorpair;
84 enum nc_flags {
85 NC_HASCOLORS = 1 << 0,
86 NC_CANCHANGECOLORS = 1 << 1,
87 NC_HASMOUSE = 1 << 2,
88 NC_SUPPORTSCOLORREADER = 1 << 3,
91 typedef struct NcConsole {
92 unsigned lastattr;
93 rgb_t colors[CONSOLE_COLORPAIRCOUNT];
94 rgb_t org_colors[CONSOLE_MAXSAVECOLORS];
96 Colorpair lastused;
97 Colorpair active;
98 Colorpair pairs[CONSOLE_COLORPAIRCOUNT];
100 short org_fgcolors[CONSOLE_MAXSAVECOLORS];
101 short org_bgcolors[CONSOLE_MAXSAVECOLORS];
103 short flags;
104 short maxcolor;
105 short maxcolors;
106 } NcConsole;
108 #endif