Various changes to the FTX code for Solaris.
git-svn-id: https://svn.code.sf.net/p/flaim/code/trunk@428 0109f412-320b-0410-ab79-c3e0c5ffbbe6
This commit is contained in:
@@ -566,24 +566,24 @@
|
||||
/// Colors used for logging messages
|
||||
typedef enum
|
||||
{
|
||||
FLM_CURRENT_COLOR = 0,
|
||||
FLM_BLACK, ///< 1 = Black
|
||||
FLM_BLUE, ///< 2 = Blue
|
||||
FLM_GREEN, ///< 3 = Green
|
||||
FLM_CYAN, ///< 4 = Cyan
|
||||
FLM_RED, ///< 5 = Red
|
||||
FLM_MAGENTA, ///< 6 = Magenta
|
||||
FLM_BROWN, ///< 7 = Brown
|
||||
FLM_LIGHTGRAY, ///< 8 = Light Gray
|
||||
FLM_DARKGRAY, ///< 9 = Dark Gray
|
||||
FLM_LIGHTBLUE, ///< 10 = Light Blue
|
||||
FLM_LIGHTGREEN, ///< 11 = Light Green
|
||||
FLM_LIGHTCYAN, ///< 12 = Light Cyan
|
||||
FLM_LIGHTRED, ///< 13 = Light Red
|
||||
FLM_LIGHTMAGENTA, ///< 14 = Light Magenta
|
||||
FLM_YELLOW, ///< 15 = Light Yellow
|
||||
FLM_WHITE, ///< 16 = White
|
||||
FLM_NUM_COLORS
|
||||
FLM_BLACK = 0, ///< 0 = Black
|
||||
FLM_BLUE, ///< 1 = Blue
|
||||
FLM_GREEN, ///< 2 = Green
|
||||
FLM_CYAN, ///< 3 = Cyan
|
||||
FLM_RED, ///< 4 = Red
|
||||
FLM_MAGENTA, ///< 5 = Magenta
|
||||
FLM_BROWN, ///< 6 = Brown
|
||||
FLM_LIGHTGRAY, ///< 7 = Light Gray
|
||||
FLM_DARKGRAY, ///< 8 = Dark Gray
|
||||
FLM_LIGHTBLUE, ///< 9 = Light Blue
|
||||
FLM_LIGHTGREEN, ///< 10 = Light Green
|
||||
FLM_LIGHTCYAN, ///< 11 = Light Cyan
|
||||
FLM_LIGHTRED, ///< 12 = Light Red
|
||||
FLM_LIGHTMAGENTA, ///< 13 = Light Magenta
|
||||
FLM_YELLOW, ///< 14 = Light Yellow
|
||||
FLM_WHITE, ///< 15 = White
|
||||
FLM_NUM_COLORS,
|
||||
FLM_CURRENT_COLOR
|
||||
} eColorType;
|
||||
|
||||
#define F_BLACK "%0C"
|
||||
|
||||
@@ -319,13 +319,13 @@ typedef struct FTX_INFO
|
||||
|
||||
static int ungetChar;
|
||||
|
||||
// Curses gives us only a limited number of color pairs. We use this
|
||||
// Curses gives us only a limited number of color pairs. We use this
|
||||
// static color_pairs array for only the colors we need. flm2curses is
|
||||
// used to convert from flaim colors to curses colors and last_pair
|
||||
// is the last_pair is the last pair that we used.
|
||||
// is the last_pair that we used.
|
||||
|
||||
static short flm2curses[8];
|
||||
static short color_pairs[8][8];
|
||||
static short flm2curses[FLM_NUM_COLORS];
|
||||
static short color_pairs[FLM_NUM_COLORS][FLM_NUM_COLORS];
|
||||
short last_pair = 0;
|
||||
|
||||
FSTATIC void ftxUnixDisplayChar(
|
||||
@@ -5228,11 +5228,11 @@ FSTATIC void ftxUnixDisplayInit( void)
|
||||
initscr();
|
||||
noecho();
|
||||
cbreak();
|
||||
halfdelay(4);
|
||||
meta(stdscr, TRUE);
|
||||
keypad(stdscr, TRUE);
|
||||
scrollok(stdscr, FALSE);
|
||||
move(0, 0);
|
||||
halfdelay( 4);
|
||||
meta( stdscr, TRUE);
|
||||
keypad( stdscr, TRUE);
|
||||
scrollok( stdscr, FALSE);
|
||||
move( 0, 0);
|
||||
refresh();
|
||||
|
||||
ungetChar = (chtype)ERR;
|
||||
@@ -5241,6 +5241,9 @@ FSTATIC void ftxUnixDisplayInit( void)
|
||||
{
|
||||
start_color();
|
||||
|
||||
f_memset( flm2curses, 0, sizeof( flm2curses));
|
||||
f_memset( color_pairs, 0, sizeof( color_pairs));
|
||||
|
||||
flm2curses[ FLM_BLACK] = COLOR_BLACK;
|
||||
flm2curses[ FLM_BLUE] = COLOR_BLUE;
|
||||
flm2curses[ FLM_GREEN] = COLOR_GREEN;
|
||||
@@ -5249,9 +5252,16 @@ FSTATIC void ftxUnixDisplayInit( void)
|
||||
flm2curses[ FLM_MAGENTA] = COLOR_MAGENTA;
|
||||
flm2curses[ FLM_BROWN] = COLOR_YELLOW;
|
||||
flm2curses[ FLM_LIGHTGRAY] = COLOR_WHITE;
|
||||
flm2curses[ FLM_DARKGRAY] = COLOR_WHITE;
|
||||
flm2curses[ FLM_LIGHTBLUE] = COLOR_BLUE;
|
||||
flm2curses[ FLM_LIGHTGREEN] = COLOR_GREEN;
|
||||
flm2curses[ FLM_LIGHTCYAN] = COLOR_CYAN;
|
||||
flm2curses[ FLM_LIGHTRED] = COLOR_RED;
|
||||
flm2curses[ FLM_LIGHTMAGENTA] = COLOR_MAGENTA;
|
||||
flm2curses[ FLM_YELLOW] = COLOR_YELLOW;
|
||||
flm2curses[ FLM_WHITE] = COLOR_WHITE;
|
||||
|
||||
int defaultbg = A_NORMAL | ' ';
|
||||
bkgd(defaultbg);
|
||||
bkgd( A_NORMAL | ' ');
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -5284,17 +5294,16 @@ Desc:
|
||||
****************************************************************************/
|
||||
#ifdef FLM_UNIX
|
||||
static int flm_to_curses_attr(
|
||||
int attr)
|
||||
int attr)
|
||||
{
|
||||
int fg;
|
||||
int bg;
|
||||
int curses_attr = 0;
|
||||
int fg;
|
||||
int bg;
|
||||
int curses_attr = 0;
|
||||
|
||||
fg = attr & 0x0f;
|
||||
bg = (attr >> 4) & 0x07;
|
||||
fg = attr & 0x0F;
|
||||
bg = (attr >> 4) & 0x0F;
|
||||
|
||||
curses_attr = (fg > FLM_LIGHTGRAY) ? A_BOLD : 0;
|
||||
fg &= 0x07;
|
||||
|
||||
if (has_colors())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user