mirror of
https://github.com/oliverschmidt/contiki.git
synced 2024-12-22 10:30:13 +00:00
ctk-curses: style fixes
This commit is contained in:
parent
8daf2b6659
commit
a03334a59d
@ -101,6 +101,7 @@ console_init(void)
|
|||||||
mmask_t oldmask;
|
mmask_t oldmask;
|
||||||
#endif
|
#endif
|
||||||
static unsigned char done;
|
static unsigned char done;
|
||||||
|
int bg, fg;
|
||||||
|
|
||||||
if(done) {
|
if(done) {
|
||||||
return;
|
return;
|
||||||
@ -129,14 +130,12 @@ console_init(void)
|
|||||||
|
|
||||||
screensize(&width, &height);
|
screensize(&width, &height);
|
||||||
|
|
||||||
/* curses color handling is weird... */
|
/* we must declare all possible color pairs */
|
||||||
{
|
for(fg = 0; fg < 8; fg++) {
|
||||||
int bg, fg;
|
for(bg = 0; bg < 8; bg++) {
|
||||||
|
|
||||||
for(fg = 0; fg < 8; fg++)
|
|
||||||
for(bg = 0; bg < 8; bg++)
|
|
||||||
init_pair(MKPAIR(bg, fg), fg, bg);
|
init_pair(MKPAIR(bg, fg), fg, bg);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* set window title */
|
/* set window title */
|
||||||
putp("\033]0;Contiki\a");
|
putp("\033]0;Contiki\a");
|
||||||
@ -195,8 +194,9 @@ setcolor(void)
|
|||||||
bg = (color & 0xF0) >> 4;
|
bg = (color & 0xF0) >> 4;
|
||||||
|
|
||||||
attrs = COLOR_PAIR(MKPAIR(bg, fg));
|
attrs = COLOR_PAIR(MKPAIR(bg, fg));
|
||||||
if(reversed)
|
if(reversed) {
|
||||||
attrs |= WA_REVERSE;
|
attrs |= WA_REVERSE;
|
||||||
|
}
|
||||||
attrset(attrs);
|
attrset(attrs);
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------------------*/
|
||||||
@ -443,9 +443,10 @@ console_read(void)
|
|||||||
int k;
|
int k;
|
||||||
|
|
||||||
k = getch();
|
k = getch();
|
||||||
if(k != ERR)
|
if(k != ERR) {
|
||||||
console_readkey(k);
|
console_readkey(k);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
/*-----------------------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------------------*/
|
||||||
char
|
char
|
||||||
ctk_arch_getkey(void)
|
ctk_arch_getkey(void)
|
||||||
|
Loading…
Reference in New Issue
Block a user